i&&i+1,r.inline&&(at.rTmpl.exec(n=t.trim(e.tmpl.markup))||(r.template=""+(n||e.params.args[i]||"noop")+" "),r.attr=Mt)},onBind:function(){this.template&&(this.mainElem=this.contents("button"))},onAfterLink:function(e,n){var r,i,a,o=this,s=o._hi,l=e.args,d=l.length,p=e.props,c=p.data,f=e.view,u=p.context;s&&(r=l[s-1],i=l.slice(s),l=l.slice(0,s-1),o._sel=l[1],a=o.activeElem=o.activeElem||t(o.inline?(o._sel=l[1]||"*",o.parentElem):n.elem),u||(u=/^(.*)[.^][\w$]+$/.exec(e.params.args.slice(-i.length-1)[0]),u=u&&at.tmplFn(pt+":"+u[1]+ct,f.tmpl,!0)(n.data,f,at)),o._evs&&o.onUnbind(e,n,o.ctx),a.on(o._evs=l[0]||"click",o._sel,void 0==c?null:c,o._hlr=function(e){var t,a=!o.inline;if(!a)for(t=o.contents("*"),d=t.length;!a&&d--;)t[d].contains(e.target)&&(a=!0);if(a)return r.apply(u||n.data,[].concat(i,e,{change:e.type,view:f,linkCtx:n},i.slice.call(arguments,1)))}))},onUpdate:!1,onArrayChange:!1,onUnbind:function(){var e=this,t=er;e.activeElem&&(er=0,e.activeElem.off(e._evs,e._sel,e._hlr),er=t)},contentCtx:!0,setSize:!0,dataBoundOnly:!0},radiogroup:{boundProps:["disabled"],init:function(e){this.name=e.props.name||(Math.random()+"jsv").slice(9)},onBind:function(e,n){var r,i,a,o=this,s=e.params.props;for(s=s&&s.disabled,o.inline?(r=o.contents("*")[0],r=r&&En(r).ctx.tag===o.parent?r:o.parentElem,i=o.contents(!0,Dn)):(r=n.elem,i=t(Dn,n.elem)),o.linkedElem=i,a=i.length;a--;)i[a].name=i[a].name||o.name;t(r).on("jsv-domchange",o._dmChg=function(t,n,l,d){var p,c,f=n.ctx.parentTags;if(!d.refresh&&(!o.inline||r!==o.parentElem||f&&f[o.tagName]===o)){for(c=o.cvtArgs()[0],i=o.linkedElem=o.contents(!0,Dn),a=i.length;a--;)p=i[a],p._jsvLkEl=o,p.name=p.name||o.name,p._jsvBnd="&"+o._tgId+"+",p.checked=c===p.value,s&&(p.disabled=!!e.props.disabled);o.linkedElems=e.linkedElems=[i]}}),o._dmChg.tgt=r},onAfterLink:function(e,t,n,r,i){var a=e.params.props;a&&a.disabled&&this.linkedElem.prop("disabled",!!e.props.disabled)},onUnbind:function(){var e=this;e._dmChg&&(t(e._dmChg.tgt).off("jsv-domchange",e._dmChg),e._dmChg=void 0)},onUpdate:!1,contentCtx:!0,dataBoundOnly:!0},checkboxgroup:{boundProps:["disabled"],init:function(e){this.name=e.props.name||(Math.random()+"jsv").slice(9)},onBind:function(e,n){for(var r,i=this,a=e.params.props,o=a&&a.disabled,s=e.params.args[0],l=i.contents(!0,qn),d=l.length;d--;)l[d].name=l[d].name||i.name,l[d]._jsvLkEl=i;for(d in a)s+=" "+d+"="+a[d];l.link(s,n.data,void 0,void 0,n.view),i.linkedElem=l,i.inline?(r=i.contents("*")[0],r=r&&t.view(r).ctx.tag===i.parent?r:i.parentElem):r=n.elem,t(r).on("jsv-domchange",i._dmChg=function(n,a,p,c){var f,u=a.ctx.parentTags;if(!c.refresh&&(!i.inline||r!==i.parentElem||u&&u[i.tagName]===i))for(l=i.contents(!0,qn),d=l.length;d--;)f=l[d],f._jsvSel||(f.name=f.name||i.name,t.link(s,f,p.data),o&&(f.disabled=!!e.props.disabled))}),i._dmChg.tgt=r},onAfterLink:function(e,t,n,r,i){var a=e.params.props;a&&a.disabled&&this.contents(!0,qn).prop("disabled",!!e.props.disabled)},onUnbind:function(){var e=this;e._dmChg&&(t(e._dmChg.tgt).off("jsv-domchange",e._dmChg),e._dmChg=void 0)},onUpdate:!1,contentCtx:!0,dataBoundOnly:!0}}),d(it["for"],{sortDataMap:We.map({getTgt:it["for"].sortDataMap.getTgt,obsSrc:function(e,t,n){e.update()},obsTgt:function(e,t,n){var r,i=n.items,a=e.src;if("remove"===n.change)for(r=i.length;r--;)Ze(a).remove(Cr(i[r],a));else"insert"===n.change&&Ze(a).insert(i)}}),mapProps:["filter","sort","reverse","start","end","step"],bindTo:["paged","sorted"],bindFrom:[0],onArrayChange:function(e,t,n,r){var i,a,o=e.target.length,s=this;if(!s.rendering)if(s._.noVws||s.tagCtxs[1]&&("insert"===t.change&&o===t.items.length||"remove"===t.change&&!o))a=n.map&&n.map.propsArr,s.refresh(),a&&(n.map.propsArr=a);else for(i in s._.arrVws)i=s._.arrVws[i],i.data===e.target&&oe.apply(i,arguments);s.domChange(n,r,t),e.done=!0},onUpdate:function(e,t,n){this.setDataMap(n)},onBind:function(e,t,n,r,i){for(var a,o=this,s=0,l=o._ars=o._ars||{},d=o.tagCtxs,p=d.length,c=o.selected||0;s<=c;s++)e=d[s],a=e.map?e.map.tgt:e.args.length?e.args[0]:e.view.data,l[s]&&(Xe(l[s],!0),delete l[s]),!l[s]&&et(a)&&!function(){var n=e;Xe(a,l[s]=function(e,r){o.onArrayChange(e,r,n,t)})}();for(s=c+1;s1&&(e=typeof e===Bt?t(e)[0]:e.jquery?e[0]:e)){if(n){if(i(e._df,!0),!a&&e.tagName)for(c=ar?e.querySelectorAll(Zn):t(Zn,e).get(),p=c.length,s=0;!a&&s
",""],legend:[1,"
"," "],area:[1,""," "],param:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],svg_ns:[1,""," "],div:t.support.htmlSerialize?[0,"",""]:[1,"X","
"]},_fe:{input:{from:Fe,to:Hn},textarea:Yn,select:Yn,optgroup:{to:"label"}}}),t},window);
//# sourceMappingURL=jsviews.min.js.map
diff --git a/jsviews.min.js.map b/jsviews.min.js.map
index 936f0b9..b623044 100644
--- a/jsviews.min.js.map
+++ b/jsviews.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["jsviews.js"],"names":["factory","global","$","jQuery","exports","module","define","amd","getDerivedMethod","baseMethod","method","ret","tag","this","prevBase","base","apply","arguments","getMethod","$isFunction","_d","noop","tagHandlersFromProps","tagCtx","prop","props","rHasHandlers","test","fix","constructor","prototype","retVal","val","dbgBreak","console","log","e","baseApply","JsViewsError","message","name","link","$extend","target","source","$viewsDelimiters","openChars","closeChars","$isArray","$views","linkChar","error","delimOpenChar0","delimOpenChar1","delimCloseChar0","delimCloseChar1","$subSettings","delimiters","rTag","$sub","RegExp","rTmpl","$viewsSettings","getView","inner","type","undefined","views","i","l","found","view","root","_","useKey","get","length","parent","getNestedIndex","index","getIndex","getPathObject","ob","path","ltOb","fn","prevOb","tokens","split","lt","contextParameter","key","value","wrapped","deps","res","obsCtxPrm","tagElse","callView","newRes","storeView","isUpdate","isRenderCall","store","ctx","hasOwnProperty","$helpers","linked","_cxp","scope","isTop","_ocps","_ocp","_vw","_key","ind","updateValue","observable","setProperty","_ceo","unshift","cvtArgs","data","_ucp","getTemplate","tmpl","getRsc","$templates","convertVal","converter","onError","linkCtx","argsLen","bindTo","boundTag","bnds","_lr","args","_bd","_lc","_tg","bnd","unlinked","inline","tagName","convert","onArrayChange","flow","tagCtxs","_is","extendCtx","_er","onRender","convertArgs","bound","boundArgs","bindFrom","STRING","slice","argOrProp","arg0","context","convertBoundArgs","getResource","resourceType","itemName","renderTag","parentView","bindToOrBindFrom","bindArray","m","isNaN","parseInt","topView","tagDef","template","tags","attr","parentTag","n","itemRet","tagCtxCtx","ctxPrm","initVal","content","callInit","mapDef","thisMap","bdArgs","tagDataMap","contentCtx","bindFromLength","bindToLength","linkedElement","defaultCtx","parentTmpl","lateRender","params","tmpls","render","renderContent","bndArgs","_getTmpl","init","_ctr","ths","arrVws","dataBoundOnly","dataMap","map","parents","parentTags","rendering","rndr","argDefault","linkedCtxParam","fromIndex","toIndex","_dfAt","noVws","HTML","_cp","cvt","src","unmap","tgt","rWrappedInViewMarker","links","renderWithViews","$converters","html","View","contentTmpl","parentView_","self_","self","isArray","id","viewId","cache","_ct","_cchCt","scp","indexStr","push","splice","compileChildResources","storeName","storeNames","resources","jsvStores","compileTag","Tag","baseTag","compiledDef","depends","$tags","_parentTmpl","compileTmpl","options","lookupTemplate","currentName","nodeType","elem","document","getElementById","charAt","innerHTML","getAttribute","tmplAttr","jsvTmpl","tmplName","setAttribute","compiledTmpl","tmplOrMarkup","_html","markup","tmplObject","tmplFn","replace","rEscapeQuotes","getDefaultVal","defaultVal","call","addParentRef","ref","Object","defineProperty","configurable","compileViewModel","JsvVm","vm","iterate","action","getterType","parentRef","j","getterCount","getters","getter","viewModels","JSON","parse","childOb","arr","merge","viewModel","$expando","getterNames","mod","assigned","newModArr","k","model","$observable","refresh","concat","unmapArray","modelArr","extend","proto","cnstr","privField","set","Function","htmlTag","wrapMap","$subSettingsAdvanced","_wm","rFirstElem","exec","toLowerCase","div","trim","registerStore","storeSettings","theStore","item","compile","thisStore","onStore","OBJECT","getTgt","addSetting","st","Map","baseMap","noIteration","isTopRenderCall","prevData","prevIndex","result","useViews","newView","childView","itemResult","swapContent","outerOnRender","itemVar","newCtx","noLinking","_wrp","nl","syntaxError","helpers","contentView","onRenderError","fallback","Err","isLinkExpr","convertBack","hasElse","pushprecedingContent","shift","loc","substr","rNewLine","blockTagCheck","block","parseTag","all","bind","colon","codeTag","slash","bind2","closeBlock","late","openTagName","isLateOb","pathBindings","ctxProps","paramsArgs","paramsProps","paramsCtxProps","useTrigger","allowCode","rUnescapeQuotes","rTestElseIf","current","substring","stack","pop","parseParams","rBuildHash","onerror","isCtxPrm","keyToken","keyValue","arg","param","hasHandlers","newNode","parsedParam","bindings","astTop","buildCode","setPaths","pathsArr","paths","skp","paramStructure","paramCode","paramVals","parseTokens","lftPrn0","lftPrn","operator","err","eq","path2","prn","comma","lftPrn2","apos","quot","rtPrn","rtPrnDot","prn2","space","full","parsePath","allPath","not","object","helper","viewProperty","pathTokens","leafToken","subPath","binds","named","bindto","_jsvto","bndCtx","bd","theOb","_cpfn","sb","prm","pathStart","fnDp","compiledPathStart","compiledPath","join","expr","newOb","lftPrnFCall","aposed","quoted","bndStack","_cpPthSt","_cpKey","cpFnStore","fnCall","prnDp","indexOf","prnStack","prnInd","paramIndex","boundName","rPath","prnStart","0","rBracketQuote","rPrm","ast","node","hasTag","hasEncoder","getsVal","hasCnvt","useCnvt","tmplBindings","boundOnErrStart","boundOnErrEnd","tagRender","nestedTmpls","nestedTmpl","tagAndElses","nextIsElse","oldCode","isElse","isGetVal","tagCtxFn","tagStart","trigger","retStrOpen","retStrClose","tmplBindingKey","templates","converters","code","tmplOptions","debug","debugMode","_tag","parentContext","getTargetProps","propsArr","noFunctions","isFunction","getTargetSorted","mapped","start","end","propParams","filter","sort","directSort","step","reverse","v","a","b","onFilter","sorted","paged","$fnRender","tmplElem","jquery","getCharEntity","ch","charEntities","charCodeAt","getCharFromEntity","match","token","charsFromEntities","htmlEncode","text","rIsHtml","rHtmlEncode","dataEncode","rDataEncode","dataUnencode","rDataUnencode","updateValues","sourceValues","async","bindId","ev","cvtBack","cnvtName","binding","sourceValue","origVals","sourceElem","sourceEl","tos","to","tcpTag","exprOb","contextCb","vals","_tgId","defineBindToDataTargets","bindingStore","chg","nodeName","multiple","_jsvSel","$inArray","checked","onBeforeUpdateVal","change","setValue","_jsvInd","_jsvLkEl","_jsvElse","_ctxCb","_cpCtx","isCpfn","onElemChange","fromAttr","defaultAttr","setter","fnSetters","_jsvTr","delegateTarget","activeBody","_jsvChg","rSplitBindings","lastIndex","_jsvBnd","onDataLinkedTagChange","eventArgs","noUpdate","forceUpdate","hasError","bindEarly","linkFn","parentElem","parentNode","oldLinkCtx","onEvent","changeHandler","onBeforeChangeStr","_toLk","VALUE","CHECKBOX","CHECKED","onUpdate","mergeCtxs","NONE","callAfterLink","observeAndBind","onAfterChangeStr","onUnbind","linkedElems","linkedElem","mainElem","displayElem","_cnvt","TRUE","addLinkMethods","updateContent","_noUpd","setDefer","_df","deferAttr","prevNode","nextNode","nodesToRemove","useProp","openIndex","closeIndex","testElem","cStyle","jsvSel","renders","targetParent","$target","targetVal","_val","_elCnt","_prv","_nxt","currentStyle","getComputedStyle","display","_jsvd","displayStyles","createElement","body","appendChild","removeChild","style","RADIO","nodes","transferViewTokens","jsvAttrStr","disposeTokens","previousSibling","lastChild","remove","empty","children","TEXTCONTENT","selected","lateLink","arrayChangeHandler","onBeforeChange","onAfterChange","items","srt","addViews","_dly","removeViews","moveViews","oldIndex","fixIndex","setArrayChangeLink","handler","arrayBinding","bndArr","off","arrayChangeStr","on","linkGetVal","_fe","contentEditable","from","renderAndLink","linkToNode","prevView","elCnt","removeViewBinding","nextSibling","addBindingMarkers","bindingKey","viewStore","exprFnDeps","propDeps","tagDepends","allowArray","cvtBk","_hdl","_dp","_depends","bdId","_apply","boundProps","_bndId","bindLinkedElChange","lnkCtx","tmplLink","$link","tmplOrLinkExpr","useInput","elementChangeStr","vwInfos","placeholderParent","targetEl","prntView","replaceMode","$view","addDataBinding","cleanData","lnk","viewInfos","rOpenViewMarkers","viewLink","outerData","validateOnly","convertMarkers","preceding","selfClose","closeTag","spaceBefore","boundId","spaceAfter","tag1","tag2","closeTag2","spaceAfterClose","selfClose2","endOpenTag","errorMsg","bndId","endOfElCnt","inTag","isVoid","tagStack","validate","voidElems","prevElCnt","elContent","defer","ids","openScript","closeScript","deferStack","badParent","processViewInfos","deferPath","deferChar","bindChar","onAftCr","deep","addedBindEls","_tkns","len","vwInfo","previousElementSibling","lastElementChild","open","removeSubStr","onAfterCreateStr","onAfterCreate","bindEls","getViewInfos","level","tagDepth","dataLink","wrap","selector","linkViewsSel","elems","qsa","querySelectorAll","prevNodes","markerNodeInfo","contains","isLink","rViewMarkers","skip","processInfos","$viewsLinkAttr","rOpenTagMarkers","unmarkPrevOrNextNode","prevIds","linkInfo","nextView","depth","fragment","copiedNode","firstTag","wrapper","thisId","noValidate","markPrevOrNextNode","namespaceURI","rConvertMarkers","safeFragment","createDocumentFragment","firstChild","insertBefore","linkMarkup","currentView","boundTagId","tagExpr","rTagIndex","linkExpressions","bindDataLinkTarget","normalizeLinkTag","rTagDatalink","linkExprStore","linkCtxType","_gccb","$elem","str","SCRIPT","isVal","rBinding","getInfos","close","elPath","infos","rMarkerTokens","removeAttribute","marker","twoway","copyFromTagCtxToTag","linkedElements","$linkCtxElem","linkCtxElem","linkedEl","linkedTag","tagCtxElse","oldVal","indexTo","mapDeps","tagCtxslength","mainElement","displayElement","Array","contents","onBind","mapProps","mapDepends","observe","setSize","height","width","className","_jsvCl","hasClass","removeClass","addClass","onAfterLink","asyncOnElemChange","which","setTimeout","bindTriggerEvent","trig","onoff","isIE","$linkedElem","newTrig","oldTrig","pathIndex","lastPath","bindtoOb","targetPaths","bindTos","targetPathsElses","resolveDataTargetPath","targetPath","topCp","newCtxs","newTagCtx","_thp","clean","elemArray","linkedElemTag","objId","obsId","allLinkedElems","cbId","propertyChangeStr","onDispose","cbBindingsStore","$unlink","each","innerView","getElementsByTagName","inputAttrib","viewOrTagChar","viewOrTag","precedingLength","emptyView","vwItem","rOpenMarkers","values","setValues","tagOrView","theTag","theView","select","filtered","add","find","withMarkers","prevIsFirstNode","lastSibling","childTags","_gm","indexFrom","newVal","_bdArgs","_bdVals","inArray","extra","domChange","hasListener","_data","events","domChangeNotification","triggerHandler","dataItems","delayed","viewsCount","itemsCount","keepNodes","removeView","viewToRemove","parts","itemView","setPrv","prv","rTagMarkers","selfNxt","backwards","firstChange","lastChange","movedNodes","viewsToMove","appendTo","afterParts","endChange","startView","endView","afterView","startParts","endParts","observeProps","updatePropsArr","update","insert","observeMappedProps","removeProperty","oldValue","shallowArrayFilter","rShallowArrayPath","setGlobals","jsvStoreName","$observe","setting","versionNumber","rAttrEncode","&","<",">","\u0000","'","\"","`","=","amp","gt","$render","jsr","jsrender","jsrToJq","jsviews","sub","syntaxErr","settings","advSet","_err","_sq","advanced","Error","_getOb","getCache","expando","renderFile","__express","obj","_jq","jq","_clFns","_jsv","if","done","for","sortDataMap","cloned","setDataMap","range","include","*",":*","dbg","encode","unencode","url","encodeURI","$eventSpecial","event","special","PARSEINT","rNotWhite","rShallowPath","propChng","arrChng","observeStr","observeObjKey","observeCbKey","observeInnerCbKey","$data","asyncBatch","getCbKey","cb","_cId","ObjectObservable","ns","_ns","ArrayObservable","wrapArray","dependsPaths","callback","rt","nextObj","out","_ar","onDataChange","isOb","noArray","parentObs","observeAll","_arOk","array","_path","observe_apply","$observeAll","unobserve","$unobserveAll","namespace","objMap","observeArrayItems","unobs","newAllPath","filterAndObserveAll","nestedArray","newObject","newParentObs","_fltr","nextParentObs","updatedTgt","wrappedCb","isObject","obId","notRemoving","un","hasData","shallowFilter","$unobserve","batchTrigger","batch","_go","_trigger","innerObserve","unobserveBinding","observeOnOff","fullPath","pathStr","isArrayBinding","evData","dataOb","boundObOrArr","prntObs","allPth","initialNs","el","cbBindings","unbind","relPath","prevAllPath","observeObjects","observeObjectPaths","pths","getInnerCb","newObj","observePath","prts","obArrAddRemove","arrIndex","dep","obArr","prt","fnProp","isGet","_inId","pth","innerCb","p","inId","initNsArr","initNsArrLen","lastArg","wait","delay","asyncObserve","_batch","unobserveAll","nonStrict","pair","tempBatch","multi","_setProperty","leaf","removeProp","property","Date","force","previous","_insert","oldLength","numToRemove","_remove","move","newIndex","numToMove","_move","excess","newItems","insertAdded","addedItems","dataLength","newItem","num","oldItems","newLength","_srt","handleObj","oldMapOrTarget","unbound","changing","updatedMap","obsSrc","obs","srcFlt","obsTgt","obt","_updt","tgtFlt","oldMap","newMap","obmp","_def","_gck","_obs","oldAdvSet","window","navigator","userAgent","textContent","RADIOINPUT","CHECKBOXINPUT","bindElsSel","input","valueBinding","isCleanCall","oldCleanData","oldJsvDelimiters","querySelector","ol","ul","table","tbody","thead","tfoot","tr","colgroup","dl","optgroup","svg","svg_ns","br","img","hr","area","col","meta","command","embed","keygen","track","wbr","rViewPath","requiresStr","regularExpression","currentValue","toggle","_hi","activeElem","contextOb","_sel","_evs","_hlr","oldIsCleanCall","radiogroup","Math","random","domChngCntnr","useDisable","disabled","_dmChg","forOrIfTagCtx","checkboxgroup","tgCtxProps","linkExpr","arrayView","targetLength","arrayBindings","_ars","tagCt","newTagCtxs","prevArg","different","tci","getInnerView","nd","isVl","unlink","oldFn","_glt","regEx","linkCtxs","last","nextPath","addedTagCpDep","paramVal","paramExpr","tagCtxPrm","cloneExprObjects","clones","linkAttr","option","caption","th","td","legend","support","htmlSerialize","textarea"],"mappings":";;CAcC,SAASA,EAASC,GAElB,GAAIC,GAAID,EAAOE,MAEQ,iBAAZC,SACVC,OAAOD,QAAUF,EACdF,EAAQC,EAAQC,GAChB,SAASA,GACV,MAAOF,GAAQC,EAAQC,IAEG,kBAAXI,SAAyBA,OAAOC,IACjDD,QAAQ,UAAW,SAASJ,GAC3B,MAAOF,GAAQC,EAAQC,KAGxBF,EAAQC,GAAQ,IAKlB,SAASA,EAAQC,GACjB,YA6IA,SAASM,GAAiBC,EAAYC,GACrC,MAAO,YACN,GAAIC,GACHC,EAAMC,KACNC,EAAWF,EAAIG,IAKhB,OAHAH,GAAIG,KAAON,EACXE,EAAMD,EAAOM,MAAMJ,EAAKK,WACxBL,EAAIG,KAAOD,EACJH,GAIT,QAASO,GAAUT,EAAYC,GAc9B,MAXIS,IAAYT,KACfA,EAASF,EACNC,EAEEA,EAAWW,GACVX,EACAD,EAAiBa,EAAMZ,GAHxBY,EAIHX,GAEFA,EAAOU,IAAMX,GAAcA,EAAWW,IAAM,GAAK,GAE3CV,EAGR,QAASY,GAAqBV,EAAKW,GAClC,GAAIC,GACHC,EAAQF,EAAOE,KAChB,KAAKD,IAAQC,IACRC,GAAaC,KAAKH,IAAWZ,EAAIY,IAASZ,EAAIY,GAAMI,MACvDhB,EAAIY,GAAiB,YAATA,EAAqBN,EAAUN,EAAIiB,YAAYC,UAAUN,GAAOC,EAAMD,IAASC,EAAMD,IAOpG,QAASO,GAAOC,GACf,MAAOA,GAGR,QAASX,KACR,MAAO,GAGR,QAASY,GAASD,GAEjB,IAEC,KADAE,SAAQC,IAAI,4BAA8BH,GACpC,iBAEP,MAAOI,IACP,MAAOvB,MAAKE,KAAOF,KAAKwB,UAAUpB,WAAae,EAGhD,QAASM,GAAaC,GAGrB1B,KAAK2B,MAAQtC,EAAEu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U,WAE5D1kB,KACCsf,OACCpf,KAAMuN,GAAa3V,GAAIiD,IAExB4pB,SAAUpF,GACVlR,OAAQkR,GACRc,UACCvoB,GAAI,YAKAxjB,GACJyqC","file":"jsviews.min.js","sourcesContent":["/*! jsviews.js v1.0.12 single-file version: http://jsviews.com/ */\n/*! includes JsRender, JsObservable and JsViews - see: http://jsviews.com/#download */\n\n/* Interactive data-driven views using JsRender templates */\n\n//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< JsRender >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n/* JsRender:\n * See http://jsviews.com/#jsrender and http://github.com/BorisMoore/jsrender\n * Copyright 2021, Boris Moore\n * Released under the MIT License.\n */\n\n//jshint -W018, -W041, -W120\n\n(function(factory, global) {\n\t// global var is the this object, which is window when running in the usual browser environment\n\tvar $ = global.jQuery;\n\n\tif (typeof exports === \"object\") { // CommonJS e.g. Browserify\n\t\tmodule.exports = $\n\t\t\t? factory(global, $)\n\t\t\t: function($) { // If no global jQuery, take jQuery passed as parameter: require(\"jsviews\")(jQuery)\n\t\t\t\treturn factory(global, $);\n\t\t\t};\n\t} else if (typeof define === \"function\" && define.amd) { // AMD script loader, e.g. RequireJS\n\t\tdefine([\"jquery\"], function($) {\n\t\t\treturn factory(global, $);\n\t\t}); // Require jQuery\n\t} else { // Browser using plain ',\n\topenScript = ')|<\\/(\\w+)>|)(\\s*)([#/]\\d+(?:_|(\\^)))`(\\s*)(<\\w+(?=[\\s\\/>]))?|\\s*(?:(<\\w+(?=[\\s\\/>]))|<\\/(\\w+)>(\\s*)|(\\/>)\\s*|(>)|$)/g,\n\trOpenViewMarkers = /(#)()(\\d+)(_)/g,\n\trOpenMarkers = /(#)()(\\d+)([_^])/g,\n\trViewMarkers = /(?:(#)|(\\/))(\\d+)(_)/g,\n\trTagMarkers = /(?:(#)|(\\/))(\\d+)(\\^)/g,\n\trOpenTagMarkers = /(#)()(\\d+)(\\^)/g,\n\trMarkerTokens = /(?:(#)|(\\/))(\\d+)([_^])([-+@\\d]+)?/g,\n\trSplitBindings = /&(\\d+)\\+?/g,\n\trShallowArrayPath = /^[^.]*$/, // No '.' in path\n\tgetComputedStyle = global.getComputedStyle,\n\t$inArray = $.inArray;\n\nRADIOINPUT += RADIO + \"]\"; // input[type=radio]\nisIE = isIE.indexOf('MSIE ')>0 || isIE.indexOf('Trident/')>0;\n\n$observable = $.observable;\n\nif (!$observable) {\n\t// JsObservable is not loaded.\n\tthrow requiresStr + \"jquery.observable.js\"; // jquery.observable.js must be loaded before JsViews\n}\n\n$observe = $observable.observe;\n\n$subSettings._clFns = function() {\n\tlinkExprStore = {};\n};\n\n//========================== Top-level functions ==========================\n\n//===============\n// Event handlers\n//===============\n\nfunction updateValues(sourceValues, tagElse, async, bindId, ev) {\n// Observably update a data value targeted by the binding.to binding of a 2way data-link binding. Called when elem changes\n// Called when linkedElem of a tag control changes: as updateValue(val, index, tagElse, bindId, ev) - this: undefined\n// Called directly as tag.updateValues(val1, val2, val3, ...) - this: tag\n\tvar linkCtx, cvtBack, cnvtName, target, view, binding, sourceValue, origVals, sourceElem, sourceEl,\n\t\ttos, to, tcpTag, exprOb, contextCb, l, m, tag, vals, ind;\n\n\tif (bindId && bindId._tgId) {\n\t\ttag = bindId;\n\t\tbindId = tag._tgId;\n\t\tif (!tag.bindTo) {\n\t\t\tdefineBindToDataTargets(bindingStore[bindId], tag); // If this tag is updating for the first time, we need to create the 'to' bindings first\n\t\t\ttag.bindTo = [0];\n\t\t}\n\t}\n\tif ((binding = bindingStore[bindId]) && (tos = binding.to)) {\n\t\ttos = tos[tagElse||0];\n\t\t// The binding has a 'to' field, which is of the form [tosForElse0, tosForElse1, ...]\n\t\t// where tosForElseX is of the form [[[targetObject, toPath], [targetObject, toPath], ...], cvtBack]\n\t\tlinkCtx = binding.linkCtx;\n\t\tsourceElem = linkCtx.elem;\n\t\tview = linkCtx.view;\n\t\ttag = linkCtx.tag;\n\t\tif (!tag && tos._cxp) {\n\t\t\ttag = tos._cxp.path !== _ocp && tos._cxp.tag;\n\t\t\tsourceValue = sourceValues[0];\n\t\t\tsourceValues = [];\n\t\t\tsourceValues[tos._cxp.ind] = sourceValue;\n\t\t}\n\n\t\tif (tag) {\n\t\t\ttag._.chg = 1; // Set 'changing' marker to prevent tag update from updating itself\n\t\t\tif (cnvtName = tag.convertBack) {\n\t\t\t\tif ($isFunction(cnvtName)) {\n\t\t\t\t\tcvtBack = cnvtName;\n\t\t\t\t} else {\n\t\t\t\t\tcvtBack = view.getRsc(\"converters\", cnvtName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (sourceElem.nodeName === \"SELECT\") {\n\t\t\t// data-link to string or (multiselect) array of strings\n\t\t\tif (sourceElem.multiple && sourceValues[0] === null) {\n\t\t\t\t// Case where sourceValues was undefined, and set to [null] by $source[setter]() above\n\t\t\t\tsourceValues = [[]];\n\t\t\t}\n\t\t\tsourceElem._jsvSel = sourceValues;\n\t\t} else if (sourceElem._jsvSel) {\n\t\t\t// Checkbox group (possibly using {{checkboxgroup}} tag) data-linking to array of strings\n\t\t\tvals = sourceElem._jsvSel;\n\t\t\tind = $inArray(sourceElem.value, vals);\n\t\t\tif (ind > -1 && !sourceElem.checked) {\n\t\t\t\tvals.splice(ind, 1); // Checking this checkbox\n\t\t\t} else if (ind < 0 && sourceElem.checked) {\n\t\t\t\tvals.push(sourceElem.value); // Unchecking this checkbox\n\t\t\t}\n\t\t\tsourceValues = [vals.slice()];\n\t\t}\n\t\torigVals = sourceValues;\n\t\tl = tos.length;\n\t\tif (cvtBack) {\n\t\t\tsourceValues = cvtBack.apply(tag, sourceValues);\n\t\t\tif (sourceValues === undefined) {\n\t\t\t\ttos = []; // If cvtBack does not return anything, do not update target.\n\t\t\t\t//(But cvtBack may be designed to modify observable values from code as a side effect)\n\t\t\t}\n\t\t\tif (!$isArray(sourceValues) || (sourceValues.arg0 !== false && (l === 1 || sourceValues.length !== l || sourceValues.arg0))) {\n\t\t\t\tsourceValues = [sourceValues];\n\t\t\t\t// If there are multiple tos (e.g. multiple args on data-linked input) then cvtBack can update not only\n\t\t\t\t// the first arg, but all of them by returning an array.\n\t\t\t}\n\t\t}\n\n\t\twhile (l--) {\n\t\t\tif (to = tos[l]) {\n\t\t\t\tto = typeof to === STRING ? [linkCtx.data, to] : to; // [object, path]\n\t\t\t\ttarget = to[0];\n\t\t\t\ttcpTag = to.tag; // If this is a tag contextual parameter - the owner tag\n\t\t\t\tsourceValue = (target && target._ocp && !target._vw\n\t\t\t\t\t? origVals // If to target is for tag contextual parameter set to static expression (or uninitialized) - we are\n\t\t\t\t\t// binding to tag.ctx.foo._ocp - and we use original values, without applying cvtBack converter\n\t\t\t\t\t: sourceValues // Otherwise use the converted value\n\t\t\t\t)[l];\n\t\t\t\tif (sourceValue !== undefined && (!tag || !tag.onBeforeUpdateVal || tag.onBeforeUpdateVal(ev, {\n\t\t\t\t\t\tchange: \"change\",\n\t\t\t\t\t\tdata: target,\n\t\t\t\t\t\tpath: to[1],\n\t\t\t\t\t\tindex: l,\n\t\t\t\t\t\ttagElse: tagElse,\n\t\t\t\t\t\tvalue: sourceValue\n\t\t\t\t\t}) !== false)) {\n\t\t\t\t\tif (tcpTag) { // We are modifying a tag contextual parameter ~foo (e.g. from within block) so update 'owner' tag: tcpTag\n\t\t\t\t\t\tif ((m = tcpTag._.toIndex[to.ind]) !== undefined) {\n\t\t\t\t\t\t\ttcpTag.updateValue(sourceValue, m, to.tagElse, undefined, undefined, ev); // if doesn't map, don't update, or update scoped tagCtxPrm. But should initialize from outer from binding...\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttcpTag.setValue(sourceValue, to.ind, to.tagElse);\n\t\t\t\t\t} else if (sourceValue !== undefined && target) {\n\t\t\t\t\t\tif ((tcpTag = ev && (sourceEl = ev.target)._jsvInd === l && sourceEl._jsvLkEl) && (m = tcpTag._.fromIndex[l]) !== undefined) {\n\t\t\t\t\t\t\t// The source is a tag linkedElem (linkedElement: [..., \"elemSelector\", ...], which is updating\n\t\t\t\t\t\t\ttcpTag.setValue(origVals[l], m, sourceEl._jsvElse);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (target._cpfn) {\n\t\t\t\t\t\t\tcontextCb = linkCtx._ctxCb; // This is the exprOb for a computed property\n\t\t\t\t\t\t\texprOb = target;\n\t\t\t\t\t\t\ttarget = linkCtx.data;\n\t\t\t\t\t\t\tif (exprOb._cpCtx) { // Computed value for a contextual parameter\n\t\t\t\t\t\t\t\ttarget = exprOb.data; // The data for the contextual view (where contextual param expression evaluated/assigned)\n\t\t\t\t\t\t\t\tcontextCb = exprOb._cpCtx; // Context callback for contextual view\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twhile (exprOb && exprOb.sb) { // Step through chained computed values to leaf one...\n\t\t\t\t\t\t\t\ttarget = contextCb(exprOb);\n\t\t\t\t\t\t\t\texprOb = exprOb.sb;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$observable(target, async).setProperty(to[1], sourceValue, undefined, to.isCpfn); // 2way binding change event - observably updating bound object\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (tag) {\n\t\ttag._.chg = undefined; // Clear marker\n\t\treturn tag;\n\t}\n}\n\nfunction onElemChange(ev) {\n\tvar bindId, val,\n\t\tsource = ev.target,\n\t\tfromAttr = defaultAttr(source),\n\t\tsetter = fnSetters[fromAttr];\n\n\tif (!source._jsvTr || ev.delegateTarget !== activeBody && source.type !== \"number\" || ev.type === \"input\") {\n\t\t// If this is an element using trigger, ignore event delegated (bubbled) to activeBody\n\t\tval = $isFunction(fromAttr)\n\t\t\t? fromAttr(source)\n\t\t\t: setter\n\t\t\t\t? $(source)[setter]()\n\t\t\t\t: $(source).attr(fromAttr);\n\n\t\tsource._jsvChg = 1; // // Set 'changing' marker to prevent linkedElem change event triggering its own refresh\n\t\trSplitBindings.lastIndex = 0; // Ensure starts at zero\n\t\twhile (bindId = rSplitBindings.exec(source._jsvBnd)) {\n\t\t\t// _jsvBnd is a string with the syntax: \"&bindingId1&bindingId2\"\n\t\t\tupdateValue(val, source._jsvInd, source._jsvElse, undefined, bindId[1], ev);\n\t\t}\n\t\tsource._jsvChg = undefined; // Clear marker\n\t}\n}\n\nfunction onDataLinkedTagChange(ev, eventArgs) {\n\t// Update or initial rendering of any tag (including {{:}}) whether inline or data-linked element.\n\tvar attr, sourceValue, noUpdate, forceUpdate, hasError, onError, bindEarly, tagCtx, l,\n\t\tlinkCtx = this,\n\t\tlinkFn = linkCtx.fn,\n\t\ttag = linkCtx.tag,\n\t\tsource = linkCtx.data,\n\t\ttarget = linkCtx.elem,\n\t\tcvt = linkCtx.convert,\n\t\tparentElem = target.parentNode,\n\t\tview = linkCtx.view,\n\t\toldLinkCtx = view._lc,\n\t\tonEvent = eventArgs && changeHandler(view, onBeforeChangeStr, tag);\n\n\tif (parentElem && (!onEvent || onEvent.call(tag || linkCtx, ev, eventArgs) !== false)\n\t\t\t// If data changed, the ev.data is set to be the path. Use that to filter the handler action...\n\t\t\t&& (!eventArgs || ev.data.prop === \"*\" || ev.data.prop === eventArgs.path)) {\n\n\t\t// Set linkCtx on view, dynamically, just during this handler call\n\t\tview._lc = linkCtx;\n\n\t\tif (eventArgs || linkCtx._toLk) {\n\t\t\t// If eventArgs are defined, this is a data update\n\t\t\t// Otherwise this is the initial data-link rendering call. Bind on this the first time it gets called\n\t\t\tlinkCtx._toLk = 0; // Remove flag to skip unneccessary rebinding next time\n\t\t\tif (linkFn._er) {\n\t\t\t\t// data-link=\"exprUsingTagOrCvt with onerror=...\" - e.g. {tag ... {cvt:... {:... convert='cvt'\n\t\t\t\ttry {\n\t\t\t\t\tsourceValue = linkFn(source, view, $sub); // Compiled link expression\n\t\t\t\t\t// For data-link=\"{:xxx}\" with no cvt or cvtBk returns value. Otherwise returns tagCtxs\n\t\t\t\t} catch (e) {\n\t\t\t\t\thasError = linkFn._er;\n\t\t\t\t\tonError = onRenderError(e,view,(new Function(\"data,view\", \"return \" + hasError + \";\"))(source, view));\n\t\t\t\t\tsourceValue = [{props: {}, args: [onError], tag: tag}];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsourceValue = linkFn(source, view, $sub); // Compiled link expression\n\t\t\t\t// For data-link=\"{:xxx}\" with no cvt or cvtBk returns value. Otherwise returns tagCtxs\n\t\t\t}\n\t\t\t// Compiled link expression for linkTag: return value for data-link=\"{:xxx}\" with no cvt or cvtBk, otherwise tagCtx or tagCtxs\n\t\t\tattr = tag && tag.attr || linkCtx.attr || (linkCtx._dfAt = defaultAttr(target, true, cvt !== undefined));\n\t\t\tif (linkCtx._dfAt === VALUE && (tag && tag.parentElem || linkCtx.elem).type === CHECKBOX) {\n\t\t\t\tattr = CHECKED; // This is a single checkbox (not in a checkboxgroup - which might have data-link=\"value{:...}\" so linkCtx.attr === VALUE, but would not have _dfAt === VALUE)\n\t\t\t}\n\t\t\t// For {{: ...}} without a convert or convertBack, (tag and linkFn._tag undefined) we already have the sourceValue, and we are done\n\t\t\tif (tag) {\n\t\t\t\t// Existing tag instance\n\t\t\t\tforceUpdate = hasError || tag._er;\n\t\t\t\t// If the new tagCtxs hasError or the previous tagCtxs had error, then force update\n\t\t\t\tsourceValue = sourceValue[0] ? sourceValue : [sourceValue];\n\n\t\t\t\t// Tag will update unless tag.onUpdate is false or is a function which returns false\n\t\t\t\tnoUpdate = !forceUpdate && (tag.onUpdate === false || eventArgs && $isFunction(tag.onUpdate) && tag.onUpdate(ev, eventArgs, sourceValue) === false);\n\n\t\t\t\tmergeCtxs(tag, sourceValue, forceUpdate); // Merge new tagCtxs (in sourceValue var) with current tagCtxs on tag instance\n\n\t\t\t\tif (tag._.chg && (attr === HTML || attr === VALUE) || noUpdate || attr === NONE) {\n\t\t\t\t\t// This is an update coming from the tag itself (linkedElem change), or else onUpdate returned false, or attr === \"none\"\n\t\t\t\t\tcallAfterLink(tag, ev, eventArgs);\n\t\t\t\t\tif (!tag._.chg) {\n\t\t\t\t\t\t// onUpdate returned false, or attr === \"none\" - so don't refresh the tag: we just use the new tagCtxs merged\n\t\t\t\t\t\t// from the sourceValue (which may optionally have been modifed in onUpdate()...) and then bind, and we are done\n\t\t\t\t\t\tobserveAndBind(linkCtx, source, target);\n\t\t\t\t\t}\n\t\t\t\t\t// Remove dynamically added linkCtx from view\n\t\t\t\t\tview._lc = oldLinkCtx;\n\t\t\t\t\tif (eventArgs && (onEvent = changeHandler(view, onAfterChangeStr, tag))) {\n\t\t\t\t\t\tonEvent.call(tag || linkCtx, ev, eventArgs);\n\t\t\t\t\t}\n\t\t\t\t\tif (tag.tagCtx.props.dataMap) {\n\t\t\t\t\t\ttag.tagCtx.props.dataMap.map(tag.tagCtx.args[0], tag.tagCtx, tag.tagCtx.map, isRenderCall || !tag._.bnd);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (tag.onUnbind) {\n\t\t\t\t\ttag.onUnbind(tag.tagCtx, linkCtx, tag.ctx, ev, eventArgs);\n\t\t\t\t}\n\n\t\t\t\ttag.linkedElems = tag.linkedElem = tag.mainElem = tag.displayElem = undefined;\n\t\t\t\tl = tag.tagCtxs.length;\n\t\t\t\twhile (l--) {\n\t\t\t\t\ttagCtx = tag.tagCtxs[l];\n\t\t\t\t\ttagCtx.linkedElems = tagCtx.mainElem = tagCtx.displayElem = undefined;\n\t\t\t\t}\n\n\t\t\t\tsourceValue = tag.tagName === \":\" // Call convertVal if it is a {{cvt:...}} - otherwise call renderTag\n\t\t\t\t\t? $sub._cnvt(tag.convert, view, sourceValue[0]) // convertVal(converter, view, tagCtx, onError)\n\t\t\t\t\t: $sub._tag(tag, view, view.tmpl, sourceValue, true, onError); // renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError)\n\t\t\t} else if (linkFn._tag) {\n\t\t\t\t// For {{: ...}} with either cvt or cvtBack we call convertVal to get the sourceValue and instantiate the tag\n\t\t\t\t// If cvt is undefined then this is a tag, and we call renderTag to get the rendered content and instantiate the tag\n\t\t\t\tcvt = cvt === \"\" ? TRUE : cvt; // If there is a cvtBack but no cvt, set cvt to \"true\"\n\t\t\t\tsourceValue = cvt // Call convertVal if it is a {{cvt:...}} - otherwise call renderTag\n\t\t\t\t\t? $sub._cnvt(cvt, view, sourceValue[0] || sourceValue) // convertVal(converter, view, tagCtx, onError)\n\t\t\t\t\t: $sub._tag(linkFn._tag, view, view.tmpl, sourceValue, true, onError); // renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError)\n\n\t\t\t\taddLinkMethods(tag = linkCtx.tag); // In both convertVal and renderTag we have instantiated a tag\n\t\t\t\tattr = linkCtx.attr || attr; // linkCtx.attr may have been set to tag.attr during tag instantiation in renderTag\n\t\t\t}\n\t\t\tif (bindEarly = tag && (!tag.inline || linkCtx.fn._lr) && tag.template) {\n\t\t\t\t// Data-linked tags with templated contents need to be data-linked before their contents, so that observable updates\n\t\t\t\t// will trigger the parent tags before the child tags.\n\t\t\t\tobserveAndBind(linkCtx, source, target);\n\t\t\t}\n\t\t\tupdateContent(sourceValue, linkCtx, attr, tag);\n\t\t\tlinkCtx._noUpd = 0; // For data-link=\"^{...}\" remove _noUpd flag so updates on subsequent calls\n\n\t\t\tif (tag) {\n\t\t\t\ttag._er = hasError;\n\t\t\t\tcallAfterLink(tag, ev, eventArgs);\n\t\t\t}\n\t\t}\n\n\t\tif (!bindEarly) {\n\t\t\tobserveAndBind(linkCtx, source, target);\n\t\t}\n\n\t\tif (tag && tag._.ths) {\n\t\t\t// Tag has a this=expr binding for which we have created an additional 'to' (defineBindToDataTargets) target (at index bindTo.length)\n\t\t\t// We now have the this pointer, so we push it to the binding, using updateValue(index)\n\t\t\ttag.updateValue(tag, tag.bindTo ? tag.bindTo.length : 1); // If bindTo not defined yet, it will be [0], so length 1\n\t\t}\n\n\t\tif (eventArgs && (onEvent = changeHandler(view, onAfterChangeStr, tag))) {\n\t\t\tonEvent.call(tag || linkCtx, ev, eventArgs);\n\t\t}\n\t\t// Remove dynamically added linkCtx from view\n\t\tview._lc = oldLinkCtx;\n\t}\n}\n\nfunction setDefer(elem, value) {\n\telem._df = value; // Use both an expando and an attribute to track deferred tokens. Attribute is needed for querySelectorAll for getViewInfos (childTags)\n\telem[(value ? \"set\" : \"remove\") + \"Attribute\"](deferAttr, \"\");\n}\n\nfunction updateContent(sourceValue, linkCtx, attr, tag) {\n\t// When called for a tag, either in tag.refresh() or onDataLinkedTagChange(), returns tag\n\t// When called (in onDataLinkedTagChange) for target HTML returns true\n\t// When called (in onDataLinkedTagChange) for other targets returns boolean for \"changed\"\n\tvar setter, prevNode, nextNode, late, nodesToRemove, useProp, tokens, id, openIndex, closeIndex, testElem, nodeName, cStyle, jsvSel,\n\t\trenders = attr !== NONE && sourceValue !== undefined && !linkCtx._noUpd && !((attr === VALUE || attr === HTML) && (!tag && linkCtx.elem._jsvChg)),\n\t\t// For data-link=\"^{...}\", don't update the first time (no initial render) - e.g. to leave server rendered values.\n\t\tsource = linkCtx.data,\n\t\ttarget = tag && tag.parentElem || linkCtx.elem,\n\t\ttargetParent = target.parentNode,\n\t\t$target = $(target),\n\t\tview = linkCtx.view,\n\t\ttargetVal = linkCtx._val,\n\t\tchange = tag;\n\n\tif (tag) {\n\t\t// Initialize the tag with element references\n\t\ttag._.unlinked = true; // Set to unlinked, so initialization is triggered after re-rendering, e.g. for setting linkedElem, and calling onBind\n\t\ttag.parentElem = tag.parentElem || (linkCtx.expr || tag._elCnt) ? target : targetParent;\n\t\tprevNode = tag._prv;\n\t\tnextNode = tag._nxt;\n\t}\n\tif (!renders) {\n\t\tlinkCtx._val = sourceValue;\n\t\treturn;\n\t}\n\n\tif (attr === \"visible\") {\n\t\tattr = \"css-display\";\n\t}\n\tif (/^css-/.test(attr)) {\n\t\tif (linkCtx.attr === \"visible\") {\n\t\t\t// Get the current display style\n\t\t\tcStyle = (target.currentStyle || getComputedStyle.call(global, target, \"\")).display;\n\n\t\t\tif (sourceValue) {\n\t\t\t\t// We are showing the element.\n\t\t\t\t// Get the cached 'visible' display value from the -jsvd expando\n\t\t\t\tsourceValue = target._jsvd\n\t\t\t\t\t// Or, if not yet cached, get the current display value\n\t\t\t\t\t|| cStyle;\n\t\t\t\tif (sourceValue === NONE && !(sourceValue = displayStyles[nodeName = target.nodeName])) {\n\t\t\t\t\t// Currently display value is 'none', and the 'visible' style has not been cached.\n\t\t\t\t\t// We create an element to find the correct 'visible' display style for this nodeName\n\t\t\t\t\ttestElem = document.createElement(nodeName);\n\t\t\t\t\tdocument.body.appendChild(testElem);\n\n\t\t\t\t\t// Get the default style for this HTML tag to use as 'visible' style\n\t\t\t\t\tsourceValue\n\t\t\t\t\t\t// and cache it as a hash against nodeName\n\t\t\t\t\t\t= displayStyles[nodeName]\n\t\t\t\t\t\t= (testElem.currentStyle || getComputedStyle.call(global, testElem, \"\")).display;\n\t\t\t\t\tdocument.body.removeChild(testElem);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We are hiding the element.\n\t\t\t\t// Cache the current display value as 'visible' style, on _jsvd expando, for when we show the element again\n\t\t\t\ttarget._jsvd = cStyle;\n\t\t\t\tsourceValue = NONE; // Hide the element\n\t\t\t}\n\t\t}\n\t\tif (change = change || targetVal !== sourceValue) {\n\t\t\t$.style(target, attr.slice(4), sourceValue);\n\t\t}\n\t} else if (attr !== \"link\") { // attr === \"link\" is for tag controls which do data binding but have no rendered output or target\n\t\tif (/^data-/.test(attr)) {\n\t\t\t$.data(target, attr.slice(5), sourceValue); // Support for binding to data attributes: data-foo{:expr}: data-foo attribute will be\n\t\t\t// expr.toString(), but $.data(element, \"foo\") and $(element).data(\"foo\") will actually return value of expr, even if of type object\n\t\t} else if (/^prop-/.test(attr)) {\n\t\t\tuseProp = true;\n\t\t\tattr = attr.slice(5);\n\t\t} else if (attr === CHECKED) {\n\t\t\tuseProp = true;\n\t\t\tif (target.name && $isArray(sourceValue)) {\n\t\t\t\ttarget._jsvSel = sourceValue; // Checkbox group (possibly using {{checkboxgroup}} tag) data-linking to array of strings\n\t\t\t\tsourceValue = $inArray(target.value, sourceValue) > -1;\n\t\t\t} else {\n\t\t\t\tsourceValue = sourceValue && sourceValue !== \"false\";\n\t\t\t}\n\t\t\t// The string value \"false\" can occur with data-link=\"checked{attr:expr}\" - as a result of attr, and hence using convertVal()\n\t\t\t// We will set the \"checked\" property\n\t\t\t// We will compare this with the current value\n\t\t} else if (attr === RADIO) {\n\t\t\t// This is a special binding attribute for radio buttons, which corresponds to the default 'to' binding.\n\t\t\t// This allows binding both to value (for each input) and to the default checked radio button (for each input in named group,\n\t\t\t// e.g. binding to parent data).\n\t\t\t// Place value binding first: \n\t\t\t// or (allowing any order for the binding expressions):\n\t\t\t// \n\t\t\tuseProp = true;\n\t\t\tattr = CHECKED;\n\t\t\tsourceValue = target.value === sourceValue;\n\t\t\t// If the data value corresponds to the value attribute of this radio button input, set the checked property to true\n\t\t\t// Otherwise set the checked property to false\n\t\t} else if (attr === \"selected\" || attr === \"disabled\" || attr === \"multiple\" || attr === \"readonly\") {\n\t\t\tsourceValue = (sourceValue && sourceValue !== \"false\") ? attr : null;\n\t\t\t// Use attr, not prop, so when the options (for example) are changed dynamically, but include the previously selected value,\n\t\t\t// they will still be selected after the change\n\t\t} else if (attr === VALUE && target.nodeName === \"SELECT\") {\n\t\t\ttarget._jsvSel = $isArray(sourceValue)\n\t\t\t\t? sourceValue\n\t\t\t\t: \"\" + sourceValue; // If not array, coerce to string\n\t\t}\n\n\t\tif (setter = fnSetters[attr]) {\n\t\t\tif (attr === HTML) {\n\t\t\t\tif (tag && tag.inline) {\n\t\t\t\t\tnodesToRemove = tag.nodes(true);\n\t\t\t\t\tif (tag._elCnt) {\n\t\t\t\t\t\tif (prevNode && prevNode !== nextNode) { // nextNode !== prevNode\n\t\t\t\t\t\t\t// This prevNode will be removed from the DOM, so transfer the view tokens on prevNode to nextNode of this 'viewToRefresh'\n\t\t\t\t\t\t\ttransferViewTokens(prevNode, nextNode, target, tag._tgId, \"^\", true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// nextNode === prevNode, or there is no nextNode and so the target._df may have tokens\n\t\t\t\t\t\t\ttokens = prevNode ? prevNode.getAttribute(jsvAttrStr) : target._df;\n\t\t\t\t\t\t\tid = tag._tgId + \"^\";\n\t\t\t\t\t\t\topenIndex = tokens.indexOf(\"#\" + id) + 1;\n\t\t\t\t\t\t\tcloseIndex = tokens.indexOf(\"/\" + id);\n\n\t\t\t\t\t\t\tif (openIndex && closeIndex > 0) {\n\t\t\t\t\t\t\t\t// If prevNode, or target._df, include tokens referencing view and tag bindings contained within the open and close tokens\n\t\t\t\t\t\t\t\t// of the updated tag control, they need to be processed (disposed)\n\t\t\t\t\t\t\t\topenIndex += id.length;\n\t\t\t\t\t\t\t\tif (closeIndex > openIndex) {\n\t\t\t\t\t\t\t\t\tdisposeTokens(tokens.slice(openIndex, closeIndex)); // Dispose view and tag bindings\n\t\t\t\t\t\t\t\t\ttokens = tokens.slice(0, openIndex) + tokens.slice(closeIndex);\n\n\t\t\t\t\t\t\t\t\tif (prevNode) {\n\t\t\t\t\t\t\t\t\t\tprevNode.setAttribute(jsvAttrStr, tokens); // Remove tokens of replaced content\n\t\t\t\t\t\t\t\t\t} else if (target._df) { // Remove tokens of replaced content\n\t\t\t\t\t\t\t\t\t\tsetDefer(target, tokens);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprevNode = prevNode\n\t\t\t\t\t\t\t? prevNode.previousSibling\n\t\t\t\t\t\t\t: nextNode\n\t\t\t\t\t\t\t\t? nextNode.previousSibling\n\t\t\t\t\t\t\t\t: target.lastChild;\n\t\t\t\t\t}\n\t\t\t\t\t// Remove HTML nodes\n\t\t\t\t\t$(nodesToRemove).remove(); // Note if !tag._elCnt removing the nodesToRemove will process and dispose view and tag bindings contained within the updated tag control\n\n\t\t\t\t\t// Insert and link new content\n\t\t\t\t\tlate = view.link(view.data, target, prevNode, nextNode, sourceValue, tag && {tag: tag._tgId});\n\t\t\t\t} else {\n\t\t\t\t\t// data-linked value targeting innerHTML: data-link=\"html{:expr}\" or contenteditable=\"true\"\n\t\t\t\t\trenders = renders && targetVal !== sourceValue;\n\t\t\t\t\tif (renders) {\n\t\t\t\t\t\t$target.empty();\n\t\t\t\t\t\tlate = view.link(source, target, prevNode, nextNode, sourceValue, tag && {tag: tag._tgId});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (target._jsvSel) {\n\t\t\t\t$target[setter](sourceValue); // (or multiselect)\n\t\t\t} else {\n\t\t\t\tif (change = change || targetVal !== sourceValue) {\n\t\t\t\t\tif (attr === \"text\" && target.children && !target.children[0]) {\n\t\t\t\t\t\t// This code is faster then $target.text()\n\t\t\t\t\t\ttarget[TEXTCONTENT] = sourceValue === null ? \"\" : sourceValue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$target[setter](sourceValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ((jsvSel = targetParent._jsvSel) !== undefined\n\t\t\t\t\t// Setting value of element\n\t\t\t\t\t&& (attr === VALUE || $target.attr(VALUE) === undefined)) { // Setting value attribute, or setting textContent if attribute is null\n\t\t\t\t\t// Set/unselect selection based on value set on parent . Works for multiselect too\n\t\t\t\t\ttarget.selected = $inArray(\"\" + sourceValue, $isArray(jsvSel) ? jsvSel : [jsvSel]) > -1;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (change = change || targetVal !== sourceValue) {\n\t\t\t// Setting an attribute to undefined should remove the attribute\n\t\t\t$target[useProp ? \"prop\" : \"attr\"](attr, sourceValue === undefined && !useProp ? null : sourceValue);\n\t\t}\n\t}\n\tlinkCtx._val = sourceValue;\n\tlateLink(late); // Do any deferred linking (lateRender)\n\treturn change;\n}\n\nfunction arrayChangeHandler(ev, eventArgs) { // array change handler for 'array' views\n\tvar self = this,\n\t\tonBeforeChange = changeHandler(self, onBeforeChangeStr, self.tag),\n\t\tonAfterChange = changeHandler(self, onAfterChangeStr, self.tag);\n\tif (!onBeforeChange || onBeforeChange.call(self, ev, eventArgs) !== false) {\n\t\tif (eventArgs) {\n\t\t\t// This is an observable action (not a trigger/handler call from pushValues, or similar, for which eventArgs will be null)\n\t\t\tvar action = eventArgs.change,\n\t\t\t\tindex = eventArgs.index,\n\t\t\t\titems = eventArgs.items;\n\t\t\tself._.srt = eventArgs.refresh; // true if part of a 'sort' on refresh\n\t\t\tswitch (action) {\n\t\t\t\tcase \"insert\":\n\t\t\t\t\tself.addViews(index, items, eventArgs._dly);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"remove\":\n\t\t\t\t\tself.removeViews(index, items.length, undefined, eventArgs._dly);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"move\":\n\t\t\t\t\tself.moveViews(eventArgs.oldIndex, index, items.length);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"refresh\":\n\t\t\t\t\tself._.srt = undefined;\n\t\t\t\t\tself.fixIndex(0);\n\t\t\t\t\t// Other cases: (e.g.undefined, for setProperty on observable object) etc. do nothing\n\t\t\t}\n\t\t}\n\t\tif (onAfterChange) {\n\t\t\tonAfterChange.call(self, ev, eventArgs);\n\t\t}\n\t}\n}\n\n//=============================\n// Utilities for event handlers\n//=============================\n\nfunction setArrayChangeLink(view) {\n\t// Add/remove arrayChange handler on view\n\tvar handler, arrayBinding,\n\t\ttype = view.type, // undefined if view is being removed\n\t\tdata = view.data,\n\t\tbound = view._.bnd; // true for top-level link() or data-link=\"{for}\", or the for tag instance for {^{for}} (or for any custom tag that has an onArrayChange handler)\n\n\tif (!view._.useKey && bound) {\n\t\t// This is an array view. (view._.useKey not defined => data is array), and is data-bound to collection change events\n\n\t\tif (arrayBinding = view._.bndArr) {\n\t\t\t// First remove the current handler if there is one\n\t\t\t$([arrayBinding[1]]).off(arrayChangeStr, arrayBinding[0]);\n\t\t\tview._.bndArr = undefined;\n\t\t}\n\t\tif (bound !== !!bound) {\n\t\t\t// bound is not a boolean, so it is the data-linked tag that 'owns' this array binding - e.g. {^{for...}}\n\t\t\tif (type) {\n\t\t\t\tbound._.arrVws[view._.id] = view;\n\t\t\t} else {\n\t\t\t\tdelete bound._.arrVws[view._.id]; // if view.type is undefined, view is being removed\n\t\t\t}\n\t\t} else if (type && data) {\n\t\t\t// If this view is not being removed, but the data array has been replaced, then bind to the new data array\n\t\t\thandler = function(ev) {\n\t\t\t\tif (!(ev.data && ev.data.off)) {\n\t\t\t\t\t// Skip if !!ev.data.off: - a handler that has already been removed (maybe was on handler collection at call time - then removed by another handler)\n\t\t\t\t\t// If view.type is undefined, do nothing. (Corresponds to case where there is another handler on the same data whose\n\t\t\t\t\t// effect was to remove this view, and which happened to precede this event in the trigger sequence. So although this\n\t\t\t\t\t// event has been removed now, it is still called since already on the trigger sequence)\n\t\t\t\t\tarrayChangeHandler.apply(view, arguments);\n\t\t\t\t}\n\t\t\t};\n\t\t\t$([data]).on(arrayChangeStr, handler);\n\t\t\tview._.bndArr = [handler, data];\n\t\t}\n\t}\n}\n\nfunction defaultAttr(elem, to, linkGetVal) {\n\t// to: true - default attribute for setting data value on HTML element; false: default attribute for getting value from HTML element\n\t// Merge in the default attribute bindings for this target element\n\tvar nodeName = elem.nodeName.toLowerCase(),\n\t\tattr =\n\t\t\t$subSettingsAdvanced._fe[nodeName] // get form element binding settings for input textarea select or optgroup\n\t\t\t|| elem.contentEditable === TRUE && {to: HTML, from: HTML}; // Or if contentEditable set to \"true\" set attr to \"html\"\n\treturn attr\n\t\t? (to\n\t\t\t? ((nodeName === \"input\" && elem.type === RADIO) // For radio buttons, bind from value, but bind to 'radio' - special value.\n\t\t\t\t? RADIO\n\t\t\t\t: attr.to)\n\t\t\t: attr.from)\n\t\t: to\n\t\t\t? linkGetVal ? \"text\" : HTML // Default innerText for data-link=\"a.b.c\" or data-link=\"{:a.b.c}\" (with or without converters)- otherwise innerHTML\n\t\t\t: \"\"; // Default is not to bind from\n}\n\n//==============================\n// Rendering and DOM insertion\n//==============================\n\nfunction renderAndLink(view, index, tmpl, views, data, context, refresh) {\n\tvar html, linkToNode, prevView, nodesToRemove, bindId,\n\t\tparentNode = view.parentElem,\n\t\tprevNode = view._prv,\n\t\tnextNode = view._nxt,\n\t\telCnt = view._elCnt;\n\n\tif (prevNode && prevNode.parentNode !== parentNode) {\n\t\terror(\"Missing parentNode\");\n\t\t// Abandon, since node has already been removed, or wrapper element has been inserted between prevNode and parentNode\n\t}\n\n\tif (refresh) {\n\t\tnodesToRemove = view.nodes();\n\t\tif (elCnt && prevNode && prevNode !== nextNode) {\n\t\t\t// This prevNode will be removed from the DOM, so transfer the view tokens on prevNode to nextNode of this 'viewToRefresh'\n\t\t\ttransferViewTokens(prevNode, nextNode, parentNode, view._.id, \"_\", true);\n\t\t}\n\t\t// Remove child views\n\t\tview.removeViews(undefined, undefined, true);\n\t\tlinkToNode = nextNode;\n\n\t\tif (elCnt) {\n\t\t\tprevNode = prevNode\n\t\t\t\t? prevNode.previousSibling\n\t\t\t\t: nextNode\n\t\t\t\t\t? nextNode.previousSibling\n\t\t\t\t\t: parentNode.lastChild;\n\t\t}\n\n\t\t// Remove HTML nodes\n\t\t$(nodesToRemove).remove();\n\n\t\tfor (bindId in view._.bnds) {\n\t\t\t// The view bindings may have already been removed above in: $(nodesToRemove).remove();\n\t\t\t// If not, remove them here:\n\t\t\tremoveViewBinding(bindId);\n\t\t}\n\t} else {\n\t\t// addViews. Only called if view is of type \"array\"\n\t\tif (index) {\n\t\t\t// index is a number, so indexed view in view array\n\t\t\tprevView = views[index - 1];\n\t\t\tif (!prevView) {\n\t\t\t\treturn false; // If subview for provided index does not exist, do nothing\n\t\t\t}\n\t\t\tprevNode = prevView._nxt;\n\t\t}\n\t\tif (elCnt) {\n\t\t\tlinkToNode = prevNode;\n\t\t\tprevNode = linkToNode\n\t\t\t\t? linkToNode.previousSibling // There is a linkToNode, so insert after previousSibling, or at the beginning\n\t\t\t\t: parentNode.lastChild; // If no prevView and no prevNode, index is 0 and the container is empty,\n\t\t\t\t// so prevNode = linkToNode = null. But if prevView._nxt is null then we set prevNode to parentNode.lastChild\n\t\t\t\t// (which must be before the prevView) so we insert after that node - and only link the inserted nodes\n\t\t} else {\n\t\t\tlinkToNode = prevNode.nextSibling;\n\t\t}\n\t}\n\thtml = tmpl.render(data, context, view._.useKey && refresh, view, refresh || index, true);\n\t// Pass in view._.useKey as test for noIteration (which corresponds to when self._.useKey > 0 and self.data is an array)\n\n\t// Link the new HTML nodes to the data\n\tlateLink(view.link(data, parentNode, prevNode, linkToNode, html, prevView));\n}\n\n//=====================\n// addBindingMarkers\n//=====================\n\nfunction addBindingMarkers(value, view, tag) {\n\t// Insert binding markers into the rendered template output, which will get converted to appropriate\n\t// data-jsv attributes (element-only content) or script marker nodes (phrasing or flow content), in convertMarkers,\n\t// within view.link, prior to inserting into the DOM. Linking will then bind based on these markers in the DOM.\n\t// Added view markers: #m_...VIEW.../m_\n\t// Added tag markers: #m^...TAG..../m^\n\tvar id, end;\n\tif (tag) {\n\t\t// This is a binding marker for a data-linked tag {^{...}}\n\t\tend = \"^`\";\n\t\taddLinkMethods(tag); // This is {^{>...}} or {^{tag ...}}, {{cvt:...} or {^{:...}}, and tag was defined in convertVal or renderTag\n\t\tid = tag._tgId;\n\t\tif (!id) {\n\t\t\tbindingStore[id = bindingKey++] = tag; // Store the tag temporarily, ready for databinding.\n\t\t\t// During linking, in addDataBinding, the tag will be attached to the linkCtx,\n\t\t\t// and then in observeAndBind, bindingStore[bindId] will be replaced by binding info.\n\t\t\ttag._tgId = \"\" + id;\n\t\t}\n\t} else {\n\t\t// This is a binding marker for a view\n\t\t// Add the view to the store of current linked views\n\t\tend = \"_`\";\n\t\tviewStore[id = view._.id] = view;\n\t}\n\t// Example: \"#23^TheValue/23^\"\n\treturn \"#\" + id + end\n\t\t+ (value != undefined ? value : \"\") // For {^{:name}} this gives the equivalent semantics to compiled\n\t\t\t\t\t\t\t\t\t\t\t// (v=data.name)!=null?v:\"\"; used in {{:name}} or data-link=\"name\"\n\t\t+ \"/\" + id + end;\n}\n\n//==============================\n// Data-linking and data binding\n//==============================\n\n//---------------\n// observeAndBind\n//---------------\n\nfunction observeAndBind(linkCtx, source, target) {\n\tvar binding, l, k, linkedElem, exprFnDeps, exprOb, prop, propDeps, depends, tagDepends, bindId, linkedElems,\n\t\ttag = linkCtx.tag,\n\t\tallowArray = !tag,\n\t\tcvtBk = linkCtx.convertBack,\n\t\thandler = linkCtx._hdl;\n\tsource = typeof source === \"object\" && source; // If not an object set to false\n\n\tif (tag) {\n\t\t// Use the 'depends' paths set on linkCtx.tag, or on the converter\n\t\t// - which may have been set on declaration or in events: init, render, onAfterLink etc.\n\t\tif (depends = tag.convert) {\n\t\t\tdepends = depends === TRUE ? tag.tagCtx.props.convert : depends;\n\t\t\tdepends = linkCtx.view.getRsc(\"converters\", depends) || depends;\n\t\t\tdepends = depends && depends.depends;\n\t\t\tdepends = depends && $sub._dp(depends, source, handler); // dependsPaths\n\t\t}\n\t\tif (tagDepends = tag.tagCtx.props.depends || tag.depends) {\n\t\t\ttagDepends = $sub._dp(tagDepends, tag, handler);\n\t\t\tdepends = depends ? depends.concat(tagDepends) : tagDepends;\n\t\t}\n\t\tlinkedElems = tag.linkedElems;\n\t}\n\tdepends = depends || [];\n\tif (!linkCtx._depends || (\"\" + linkCtx._depends !== \"\" + depends)) {\n\t\t// Only bind the first time, or if the new depends (toString) has changed from when last bound\n\n\t\texprFnDeps = linkCtx.fn.deps.slice(); // Make a copy of the dependency paths for the compiled linkCtx expression - to pass to observe(). In getInnerCb(),\n\t\t// (and whenever the object is updated, in innerCb), we will set exprOb.ob to the current object returned by that computed expression, for this view.\n\n\t\tif (linkCtx._depends) {\n\t\t\tbindId = linkCtx._depends.bdId;\n\t\t\t// Unobserve previous binding\n\t\t\t$observable._apply(1, [source], exprFnDeps, linkCtx._depends, handler, linkCtx._ctxCb, true);\n\t\t}\n\n\t\tif (tag) {\n\t\t\t// Add dependency paths for declared boundProps (so no need to write ^myprop=... to get binding) and for linkedProp too if there is one\n\t\t\tl = tag.boundProps.length;\n\t\t\twhile (l--) {\n\t\t\t\tprop = tag.boundProps[l];\n\t\t\t\tk = tag._.bnd.paths.length;\n\t\t\t\twhile (k--) { // Iterate across tagCtxs\n\t\t\t\t\tpropDeps = tag._.bnd.paths[k][\"_\" + prop];\n\t\t\t\t\tif (propDeps && propDeps.length && propDeps.skp) { // Not already a bound prop ^prop=expression;\n\t\t\t\t\t\texprFnDeps = exprFnDeps.concat(propDeps); // Add dependencies for this prop expression\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tallowArray = tag.onArrayChange === undefined || tag.onArrayChange === true;\n\t\t}\n\n\t\tl = exprFnDeps.length;\n\t\twhile (l--) {\n\t\t\texprOb = exprFnDeps[l];\n\t\t\tif (exprOb._cpfn) {\n\t\t\t\t// This path is an 'exprOb', corresponding to a computed property returning an object. We replace the exprOb by\n\t\t\t\t// a view-binding-specific exprOb instance. The current object will be stored as exprOb.ob.\n\t\t\t\texprFnDeps[l] = $extend({}, exprOb);\n\t\t\t}\n\t\t}\n\t\tbinding = $observable._apply(\n\t\t\tallowArray ? 0 : 1, // 'this' pointer for observeAndBind, used to set allowArray to 1 or 0.\n\t\t\t[source],\n\t\t\texprFnDeps, // flatten the paths - to gather all the dependencies across args and bound params\n\t\t\tdepends,\n\t\t\thandler,\n\t\t\tlinkCtx._ctxCb);\n\t\t// The binding returned by $observe has a bnd array with the source objects of the individual bindings.\n\n\t\tif (!bindId) {\n\t\t\tbindId = linkCtx._bndId || \"\" + bindingKey++;\n\t\t\tlinkCtx._bndId = undefined;\n\t\t\t// Store the binding key on the view and on the element, for disposal when the view is removed\n\t\t\ttarget._jsvBnd = (target._jsvBnd || \"\") + \"&\" + bindId;\n\t\t\tlinkCtx.view._.bnds[bindId] = bindId;\n\t\t}\n\n\t\tbinding.elem = target; // The target of all the individual bindings\n\t\tbinding.linkCtx = linkCtx;\n\t\tbinding._tgId = bindId;\n\n\t\tdepends.bdId = bindId;\n\t\tlinkCtx._depends = depends;\n\t\t// Store the binding.\n\t\tbindingStore[bindId] = binding; // Note: If this corresponds to a data-linked tag, we are replacing the\n\t\t// temporarily stored tag by the stored binding. The tag will now be at binding.linkCtx.tag\n\n\t\tif (linkedElems || cvtBk !== undefined || tag && tag.bindTo) {\n\t\t\tdefineBindToDataTargets(binding, tag, cvtBk);\n\t\t}\n\t\tif (linkedElems) {\n\t\t\tl = linkedElems.length;\n\t\t\twhile (l--) {\n\t\t\t\tlinkedElem = linkedElems[l];\n\t\t\t\tk = linkedElem && linkedElem.length;\n\t\t\t\twhile (k--) {\n\t\t\t\t\tif (linkedElem[k]._jsvLkEl) {\n\t\t\t\t\t\tif (!linkedElem[k]._jsvBnd) {\n\t\t\t\t\t\t\tlinkedElem[k]._jsvBnd = \"&\" + bindId + \"+\"; // Add a \"+\" for cloned binding - so removing\n\t\t\t\t\t\t\t// elems with cloned bindings will not remove the 'parent' binding from the bindingStore.\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlinkedElem[k]._jsvLkEl = tag;\n\t\t\t\t\t\tbindLinkedElChange(tag, linkedElem[k]);\n\t\t\t\t\t\tlinkedElem[k]._jsvBnd = \"&\" + bindId + \"+\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cvtBk !== undefined) {\n\t\t\tbindLinkedElChange(tag, target);\n\t\t}\n\n\t\tif (tag && !tag.inline) {\n\t\t\tif (!tag.flow) {\n\t\t\t\ttarget.setAttribute(jsvAttrStr, (target.getAttribute(jsvAttrStr)||\"\") + \"#\" + bindId + \"^/\" + bindId + \"^\");\n\t\t\t}\n\t\t\ttag._tgId = \"\" + bindId;\n\t\t}\n\t}\n}\n\n//-------\n// $.link\n//-------\n\nfunction lateLink(late) {\n\t// Do any deferred linking (lateRender)\n\tvar lnkCtx;\n\tif (late) {\n\t\twhile (lnkCtx = late.pop()) {\n\t\t\tlnkCtx._hdl();\n\t\t}\n\t}\n}\n\nfunction tmplLink(to, from, context, noIteration, parentView, prevNode, nextNode) {\n\treturn $link(this, to, from, context, noIteration, parentView, prevNode, nextNode);\n}\n\nfunction $link(tmplOrLinkExpr, to, from, context, noIteration, parentView, prevNode, nextNode) {\n\t// When linking from a template, prevNode and nextNode parameters are ignored\n\tif (context === true) {\n\t\tnoIteration = context; // passing boolean as third param - noIteration\n\t\tcontext = undefined;\n\t} else if (typeof context !== \"object\") {\n\t\tcontext = undefined; // context must be a boolean (noIteration) or a plain object\n\t} else {\n\t\tcontext = $extend({}, context);\n\t}\n\tif (tmplOrLinkExpr && to) {\n\t\tto = to.jquery ? to : $(to); // to is a jquery object or an element or selector\n\n\t\tif (!activeBody) {\n\t\t\tactiveBody = document.body;\n\t\t\tuseInput = \"oninput\" in activeBody;\n\t\t\t$(activeBody)\n\t\t\t\t.on(elementChangeStr, onElemChange)\n\t\t\t\t.on('blur.jsv', '[contenteditable]', onElemChange);\n\t\t}\n\n\t\tvar i, k, html, vwInfos, view, placeholderParent, targetEl, refresh, late, prntView,\n\t\t\tonRender = addBindingMarkers,\n\t\t\treplaceMode = context && context.target === \"replace\",\n\t\t\tl = to.length;\n\n\t\twhile (l--) { // iterate over 'to' targets. (Usually one, but can be multiple)\n\t\t\ttargetEl = to[l];\n\n\t\t\tprntView = parentView || $view(targetEl);\n\t\t\tif (typeof tmplOrLinkExpr === STRING) {\n\t\t\t\t// tmplOrLinkExpr is a string: treat as data-link expression.\n\t\t\t\taddDataBinding(late = [], tmplOrLinkExpr, targetEl, prntView, undefined, \"expr\", from, context);\n\t\t\t} else {\n\t\t\t\tif (tmplOrLinkExpr.markup !== undefined) {\n\t\t\t\t\t// This is a call to template.link()\n\t\t\t\t\tif (replaceMode) {\n\t\t\t\t\t\tplaceholderParent = targetEl.parentNode;\n\t\t\t\t\t}\n\t\t\t\t\tprntView._.scp = true; // Set scope flag on prntView for link() call - used to set view.isTop for outermost view of created linked content\n\t\t\t\t\thtml = tmplOrLinkExpr.render(from, context, noIteration, prntView, undefined, onRender, true);\n\t\t\t\t\tprntView._.scp = undefined;\n\t\t\t\t\t// TODO Consider finding a way to bind data (link) within template without html being different for each view, the HTML can\n\t\t\t\t\t// be evaluated once outside the while (l--), and pushed into a document fragment, then cloned and inserted at each target.\n\n\t\t\t\t\tif (placeholderParent) {\n\t\t\t\t\t\t// This is target=\"replace\" mode\n\t\t\t\t\t\tprevNode = targetEl.previousSibling;\n\t\t\t\t\t\tnextNode = targetEl.nextSibling;\n\t\t\t\t\t\t$.cleanData([targetEl], true);\n\t\t\t\t\t\tplaceholderParent.removeChild(targetEl);\n\n\t\t\t\t\t\ttargetEl = placeholderParent;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprevNode = nextNode = undefined; // When linking from a template, prevNode and nextNode parameters are ignored\n\t\t\t\t\t\t$(targetEl).empty();\n\t\t\t\t\t}\n\t\t\t\t} else if (tmplOrLinkExpr === true && prntView === topView) {\n\t\t\t\t\t// $.link(true, selector, data, ctx) - where selector points to elem in top-level content. (If not top-level content, no-op)\n\t\t\t\t\trefresh = {lnk: \"top\"};\n\t\t\t\t} else {\n\t\t\t\t\tbreak; // no-op - $.link(true, selector, data, ctx) targeting within previously linked rendered template\n\t\t\t\t}\n\n// TODO Consider deferred linking API feature on per-template basis - {@{ instead of {^{ which allows the user to see the rendered content\n// before that content is linked, with better perceived perf. Have view.link return a deferred, and pass that to onAfterLink...\n// or something along those lines.\n// setTimeout(function() {\n\n\t\t\t\tif (targetEl._df && !nextNode) {\n\t\t\t\t\t// We are inserting new content and the target element has some deferred binding annotations,and there is no nextNode.\n\t\t\t\t\t// Those views may be stale views (that will be recreated in this new linking action) so we will first remove them\n\t\t\t\t\t// (if not already removed).\n\t\t\t\t\tvwInfos = viewInfos(targetEl._df, true, rOpenViewMarkers);\n\n\t\t\t\t\tfor (i = 0, k = vwInfos.length; i < k; i++) {\n\t\t\t\t\t\tview = vwInfos[i];\n\t\t\t\t\t\tif ((view = viewStore[view.id]) && view.data !== undefined) {\n\t\t\t\t\t\t\t// If this is the _prv (prevNode) for a view, remove the view\n\t\t\t\t\t\t\t// - unless view.data is undefined, in which case it is already being removed\n\t\t\t\t\t\t\tview.parent.removeViews(view._.key, undefined, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetDefer(targetEl); // remove defer tokens\n\t\t\t\t}\n\n\t\t\t\t// Link the content of the element, since this is a call to template.link(), or to $(el).link(true, ...),\n\t\t\t\tlate = prntView.link(from, targetEl, prevNode, nextNode, html, refresh, context);\n//});\n\t\t\t}\n\t\t\tlateLink(late); // Do any deferred linking (lateRender)\n\t\t}\n\t}\n\treturn to; // Allow chaining, to attach event handlers, etc.\n}\n\n//----------\n// view.link\n//----------\n\nfunction viewLink(outerData, parentNode, prevNode, nextNode, html, refresh, context, validateOnly) {\n\t// Optionally insert HTML into DOM using documentFragments (and wrapping HTML appropriately).\n\t// Data-link existing contents of parentNode, or the inserted HTML, if provided\n\n\t// Depending on the content model for the HTML elements, the standard data-linking markers inserted in the HTML by addBindingMarkers during\n\t// template rendering will be converted either to script marker nodes or, for element-only content sections, to data-jsv element annotations.\n\n\t// Data-linking will then add _prv and _nxt to views, where:\n\t// _prv: References the previous node (script element of type \"jsv123\"), or (for elCnt=true), the first element node in the view (or if none, set _prv = _nxt)\n\t// _nxt: References the last node (script element of type \"jsv/123\"), or (for elCnt=true), the next element node after the view.\n\n\t//==== nested functions ====\n\tfunction convertMarkers(all, preceding, selfClose, closeTag, spaceBefore, id, boundId, spaceAfter, tag1, tag2, closeTag2, spaceAfterClose, selfClose2, endOpenTag) {\n\t\t// rConvertMarkers = /(^|(\\/>)|<\\/(\\w+)>|)(\\s*)([#/]\\d+(?:_|(\\^)))`(\\s*)(<\\w+(?=[\\s\\/>]))?|\\s*(?:(<\\w+(?=[\\s\\/>]))|<\\/(\\w+)>(\\s*)|(\\/>)\\s*|(>))/g,\n\t\t// prec, slfCl, clsTag, spBefore, id, bndId spAfter,tag1, tag2, clTag2,sac slfCl2, endOpenTag\n\t\t// Convert the markers that were included by addBindingMarkers in template output, to appropriate DOM annotations:\n\t\t// data-jsv attributes (for element-only content) or script marker nodes (within phrasing or flow content).\n\n// TODO consider detecting 'quoted' contexts (attribute strings) so that attribute encoding does not need to encode >\n// Currently rAttrEncode = /[><\"'&]/g includes '>' encoding in order to avoid erroneous parsing of \"> \">\n\t\tvar errorMsg, bndId,\n\t\t\tendOfElCnt = \"\";\n\t\tif (endOpenTag) {\n\t\t\tinTag = 0;\n\t\t\treturn all;\n\t\t}\n\t\ttag = (tag1 || tag2 || \"\").toLowerCase();\n\t\tcloseTag = closeTag || closeTag2;\n\t\tselfClose = selfClose || selfClose2;\n\t\tif (isVoid && !selfClose && (!all || closeTag || tag || id && !inTag)) { // !all = end of string\n\t\t\tisVoid = undefined;\n\t\t\tparentTag = tagStack.shift(); // preceding tag was a void element, with no closing slash, such as .\n\t\t}\n\t\tcloseTag = closeTag || selfClose;\n\t\tif (closeTag) {\n\t\t\tcloseTag = closeTag.toLowerCase();\n\t\t\tinTag = 0;\n\t\t\tisVoid = undefined;\n\t\t\t// TODO: smart insertion of - to be completed for robust insertion of deferred bindings etc.\n\t\t\t//if (closeTag === \"table\" && parentTag === \"tbody\") {\n\t\t\t//\tpreceding = \" \" + preceding;\n\t\t\t//\tparentTag = \"table\";\n\t\t\t//\ttagStack.shift();\n\t\t\t//}\n\t\t\tif (validate) {\n\t\t\t\tif (selfClose || selfClose2) {\n\t\t\t\t\tif (!voidElems[parentTag] && !/;svg;|;math;/.test(\";\" + tagStack.join(\";\") + \";\")) {\n\t\t\t\t\t\t// Only self-closing elements must be legitimate void elements, such as , per HTML schema,\n\t\t\t\t\t\t// or under svg or math foreign namespace elements.\n\t\t\t\t\t\terrorMsg = \"'<\" + parentTag + \".../\";\n\t\t\t\t\t}\n\t\t\t\t} else if (voidElems[closeTag]) {\n\t\t\t\t\terrorMsg = \"'\" + closeTag; // closing tag such as \n\t\t\t\t} else if (!tagStack.length || closeTag !== parentTag) {\n\t\t\t\t\terrorMsg = \"Mismatch: '\" + closeTag;\n\t\t\t\t}\n\t\t\t\tif (errorMsg) {\n\t\t\t\t\tsyntaxError(errorMsg + \">' in:\\n\" + html);\n\t\t\t\t}\n\t\t\t}\n\t\t\tprevElCnt = elCnt;\n\t\t\tparentTag = tagStack.shift();\n\t\t\telCnt = elContent[parentTag];\n\t\t\tcloseTag2 = closeTag2 ? (\"\" + closeTag2 + \">\") : \"\";\n\t\t\tif (prevElCnt) {\n\t\t\t\t// If there are ids (markers since the last tag), move them to the defer string\n\t\t\t\tdefer += ids;\n\t\t\t\tids = \"\";\n\t\t\t\tif (!elCnt) {\n\t\t\t\t\tendOfElCnt = closeTag2 + openScript + \"@\" + defer + closeScript + (spaceAfterClose || \"\");\n\t\t\t\t\tdefer = deferStack.shift();\n\t\t\t\t} else {\n\t\t\t\t\tdefer += \"-\"; // Will be used for stepping back through deferred tokens\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (elCnt && !inTag) {\n\t\t\t// elContent maps tagNames which have only element content, so may not support script nodes.\n\t\t\t// We are in element-only content, can remove white space, and use data-jsv attributes on elements as markers\n\t\t\t// Example: - close marker for view 2 and open marker for view 6\n\n\t\t\tif (id) {\n\t\t\t\t// append marker for this id, to ids string\n\t\t\t\tids += id;\n\t\t\t} else {\n\t\t\t\tpreceding = (closeTag2 || selfClose2 || \"\");\n\t\t\t}\n\t\t\tif (tag) {\n\t\t\t\t// TODO: smart insertion of - to be completed for robust insertion of deferred bindings etc.\n\t\t\t\t//if (tag === \"\";\n\t\t\t\t//\tif (defer) {\n\t\t\t\t//\t\tdefer += \"+\"; // Will be used for stepping back through deferred tokens\n\t\t\t\t//\t}\n\t\t\t\t//\t// TODO: move this to design-time validation check\n\t\t\t\t//\t//\terror('\"' + parentTag + '\" has incorrect parent tag');\n\t\t\t\t//}\n\t\t\t\tpreceding += tag;\n\t\t\t\tif (ids) {\n\t\t\t\t\tpreceding += ' ' + jsvAttrStr + '=\"' + ids + '\"';\n\t\t\t\t\tids = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// We are in phrasing or flow content, so use script marker nodes\n\t\t\t// Example: - data-linked tag, close marker\n\t\t\t// We validate with inTag so no script markers are inserted in attribute context e.g. for:\n\t\t\t// \"\" or \" ...{{/if}}...\"\n\t\t\tpreceding = id\n\t\t\t\t? (preceding + endOfElCnt + spaceBefore + (inTag ? \"\" : openScript + id + closeScript)+ spaceAfter + tag)\n\t\t\t\t: endOfElCnt || all;\n\t\t}\n\n\t\tif (validate && boundId) {\n\t\t\tif (inTag) {\n\t\t\t\t// JsViews data-linking tags are not allowed within element markup.\n\t\t\t\t// See jsviews/issues/303\n\t\t\t\tsyntaxError('{^{ within elem markup (' + inTag + ' ). Use data-link=\"...\"');\n\t\t\t}\n\t\t\tif (id.charAt(0) === \"#\") {\n\t\t\t\ttagStack.unshift(id.slice(1));\n\t\t\t} else if (id.slice(1) !== (bndId = tagStack.shift())) {\n\t\t\t\t// See jsviews/issues/213\n\t\t\t\tsyntaxError('Closing tag for {^{...}} under different elem: <' + bndId + '>');\n\t\t\t}\n\t\t}\n\t\tif (tag) {\n\t\t\tinTag = tag;\n\t\t\t// If there are ids (markers since the last tag), move them to the defer string\n\t\t\ttagStack.unshift(parentTag);\n\t\t\tparentTag = tag.slice(1);\n\t\t\tif (validate && tagStack[0] && tagStack[0] === badParent[parentTag]) {\n\t\t\t\t// Missing \n\t\t\t\t// TODO: replace this by smart insertion of tags\n\t\t\t\terror('Parent of must be ');\n\t\t\t}\n\t\t\tisVoid = voidElems[parentTag];\n\t\t\tif ((elCnt = elContent[parentTag]) && !prevElCnt) {\n\t\t\t\tdeferStack.unshift(defer);\n\t\t\t\tdefer = \"\";\n\t\t\t}\n\t\t\tprevElCnt = elCnt;\n//TODO Consider providing validation which throws if you place as child of , etc. - since if not caught,\n//this can cause errors subsequently which are difficult to debug.\n//\t\t\t\tif (elContent[tagStack[0]]>2 && !elCnt) {\n//\t\t\t\t\terror(parentTag + \" in \" + tagStack[0]);\n//\t\t\t\t}\n\t\t\tif (defer && elCnt) {\n\t\t\t\tdefer += \"+\"; // Will be used for stepping back through deferred tokens\n\t\t\t}\n\t\t}\n\t\treturn preceding;\n\t}\n\n\tfunction processViewInfos(vwInfos, targetParent) {\n\t\t// If targetParent, we are processing viewInfos (which may include navigation through '+-' paths) and hooking up to the right parentElem etc.\n\t\t// (and elem may also be defined - the next node)\n\t\t// If no targetParent, then we are processing viewInfos on newly inserted content\n\t\tvar deferPath, deferChar, bindChar, parentElem, id, onAftCr, deep,\n\t\t\taddedBindEls = [];\n\n\t\t// In elCnt context (element-only content model), prevNode is the first node after the open, nextNode is the first node after the close.\n\t\t// If both are null/undefined, then open and close are at end of parent content, so the view is empty, and its placeholder is the\n\t\t// 'lastChild' of the parentNode. If there is a prevNode, then it is either the first node in the view, or the view is empty and\n\t\t// its placeholder is the 'previousSibling' of the prevNode, which is also the nextNode.\n\t\tif (vwInfos) {\n\t\t\tif (vwInfos._tkns.charAt(0) === \"@\") {\n\t\t\t\t// We are processing newly inserted content. This is a special script element that was created in convertMarkers() to process deferred bindings,\n\t\t\t\t// and inserted following the target parent element - because no element tags (outside elCnt) were encountered to carry those binding tokens.\n\t\t\t\t// We will step back from the preceding sibling of this element, looking at targetParent elements until we find the one that the current binding\n\t\t\t\t// token belongs to. Set elem to null (the special script element), and remove it from the DOM.\n\t\t\t\ttargetParent = elem.previousSibling;\n\t\t\t\telem.parentNode.removeChild(elem);\n\t\t\t\telem = undefined;\n\t\t\t}\n\t\t\tlen = vwInfos.length;\n\t\t\twhile (len--) {\n\t\t\t\tvwInfo = vwInfos[len];\n//if (prevIds.indexOf(vwInfo.token) < 0) { // This token is a newly created view or tag binding\n\t\t\t\tbindChar = vwInfo.ch;\n\t\t\t\tif (deferPath = vwInfo.path) {\n\t\t\t\t\t// We have a 'deferred path'\n\t\t\t\t\tj = deferPath.length - 1;\n\t\t\t\t\twhile (deferChar = deferPath.charAt(j--)) {\n\t\t\t\t\t\t// Use the \"+\" and\"-\" characters to navigate the path back to the original parent node where the deferred bindings ocurred\n\t\t\t\t\t\tif (deferChar === \"+\") {\n\t\t\t\t\t\t\tif (deferPath.charAt(j) === \"-\") {\n\t\t\t\t\t\t\t\tj--;\n\t\t\t\t\t\t\t\ttargetParent = targetParent.previousElementSibling; // IE9 or later only\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttargetParent = targetParent.parentNode;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttargetParent = targetParent.lastElementChild; // IE9 or later only\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (bindChar === \"^\") {\n\t\t\t\t\tif (tag = bindingStore[id = vwInfo.id]) {\n\t\t\t\t\t\t// The binding may have been deleted, for example in a different handler to an array collectionChange event\n\t\t\t\t\t\t// This is a tag binding\n\t\t\t\t\t\tdeep = targetParent && (!elem || elem.parentNode !== targetParent); // We are stepping back looking for the right targetParent,\n\t\t\t\t\t\t// or we are linking existing content and this element is in elCnt, not an immediate child of the targetParent.\n\t\t\t\t\t\tif (!elem || deep) {\n\t\t\t\t\t\t\ttag.parentElem = targetParent;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (vwInfo.elCnt && deep) {\n\t\t\t\t\t\t\t// With element only content, if there is no following element, or if the binding is deeper than the following element\n\t\t\t\t\t\t\t// then we need to set the open or close token as a deferred binding annotation on the parent\n\t\t\t\t\t\t\tsetDefer(targetParent, (vwInfo.open ? \"#\" : \"/\") + id + bindChar + (targetParent._df || \"\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// This is an open or close marker for a data-linked tag {^{...}}. Add it to bindEls.\n\t\t\t\t\t\taddedBindEls.push([deep ? null : elem, vwInfo]);\n\t\t\t\t\t}\n\t\t\t\t} else if (view = viewStore[id = vwInfo.id]) {\n\t\t\t\t\t// The view may have been deleted, for example in a different handler to an array collectionChange event\n\t\t\t\t\tif (!view.parentElem) {\n\t\t\t\t\t\t// If view is not already extended for JsViews, extend and initialize the view object created in JsRender, as a JsViews view\n\t\t\t\t\t\tview.parentElem = targetParent || elem && elem.parentNode || parentNode;\n\t\t\t\t\t\tview._.onRender = addBindingMarkers;\n\t\t\t\t\t\tview._.onArrayChange = arrayChangeHandler;\n\t\t\t\t\t\tsetArrayChangeLink(view);\n\t\t\t\t\t}\n\t\t\t\t\tparentElem = view.parentElem;\n\t\t\t\t\tif (vwInfo.open) {\n\t\t\t\t\t\t// This is an 'open view' node (preceding script marker node,\n\t\t\t\t\t\t// or if elCnt, the first element in the view, with a data-jsv annotation) for binding\n\t\t\t\t\t\tview._elCnt = vwInfo.elCnt;\n\t\t\t\t\t\tif (targetParent && !elem) {\n\t\t\t\t\t\t\tsetDefer(targetParent, \"#\" + id + bindChar + (targetParent._df || \"\"));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// No targetParent, so there is a ._nxt elem (and this is processing tokens on the elem)\n\t\t\t\t\t\t\tif (!view._prv) {\n\t\t\t\t\t\t\t\tsetDefer(parentElem, removeSubStr(parentElem._df, \"#\" + id + bindChar));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tview._prv = elem;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This is a 'close view' marker node for binding\n\t\t\t\t\t\tif (targetParent && (!elem || elem.parentNode !== targetParent)) {\n\t\t\t\t\t\t\t// There is no ._nxt so add token to _df. It is deferred.\n\t\t\t\t\t\t\tsetDefer(targetParent, \"/\" + id + bindChar + (targetParent._df || \"\"));\n\t\t\t\t\t\t\tview._nxt = undefined;\n\t\t\t\t\t\t} else if (elem) {\n\t\t\t\t\t\t\t// This view did not have a ._nxt, but has one now, so token may be in _df, and must be removed. (No longer deferred)\n\t\t\t\t\t\t\tif (!view._nxt) {\n\t\t\t\t\t\t\t\tsetDefer(parentElem, removeSubStr(parentElem._df, \"/\" + id + bindChar));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tview._nxt = elem;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (onAftCr = changeHandler(view, onAfterCreateStr) || onAfterCreate) {\n\t\t\t\t\t\t\tonAftCr.call(view.ctx.tag, view);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n//}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlen = addedBindEls.length;\n\t\t\twhile (len--) {\n\t\t\t\t// These were added in reverse order to addedBindEls. We push them in BindEls in the correct order.\n\t\t\t\tbindEls.push(addedBindEls[len]);\n\t\t\t}\n\t\t}\n\t\treturn !vwInfos || vwInfos.elCnt;\n\t}\n\n\tfunction getViewInfos(vwInfos) {\n\t\t// Used by view.childTags() and tag.childTags()\n\t\t// Similar to processViewInfos in how it steps through bindings to find tags. Only finds data-linked tags.\n\t\tvar level, parentTag, named;\n\n\t\tif (vwInfos) {\n\t\t\tlen = vwInfos.length;\n\t\t\tfor (j = 0; j < len; j++) {\n\t\t\t\tvwInfo = vwInfos[j];\n\t\t\t\t// This is an open marker for a data-linked tag {^{...}}, within the content of the tag whose id is get.id. Add it to bindEls.\n\t\t\t\t// Note - if bindingStore[vwInfo.id]._is === \"tag\" then getViewInfos is being called too soon - during first linking pass\n\t\t\t\ttag = bindingStore[vwInfo.id];\n\t\t\t\tif (!tag._is && tag.linkCtx) {\n\t\t\t\t\tparentTag = tag = tag.linkCtx.tag;\n\t\t\t\t\tnamed = tag.tagName === tagName;\n\t\t\t\t\tif (!tag.flow || named) {\n\t\t\t\t\t\tif (!deep) {\n\t\t\t\t\t\t\tlevel = 1;\n\t\t\t\t\t\t\twhile (parentTag = parentTag.parent) {\n\t\t\t\t\t\t\t\tlevel++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttagDepth = tagDepth || level; // The level of the first tag encountered.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((deep || level === tagDepth) && (!tagName || named)) {\n\t\t\t\t\t\t\t// Filter on top-level or tagName as appropriate\n\t\t\t\t\t\t\ttags.push(tag);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction dataLink() {\n\t\t//================ Data-link and fixup of data-jsv annotations ================\n\t\tvar j, index,\n\t\t\ttokens = \"\",\n\t\t\twrap = {},\n\t\t\tselector = linkViewsSel + (get ? \",[\" + deferAttr + \"]\" : \"\");\n\t\t\t// If a childTags() call, get = \",[\" + deferAttr + \"]\" - since we need to include elements that have a ._df expando for deferred tokens\n\n\t\telems = qsa ? parentNode.querySelectorAll(selector) : $(selector, parentNode).get();\n\t\tl = elems.length;\n\n\t\t// The prevNode will be in the returned query, since we called markPrevOrNextNode() on it.\n\t\t// But it may have contained nodes that satisfy the selector also.\n\t\tif (prevNode && prevNode.innerHTML) {\n\t\t\t// Find the last contained node of prevNode, to use as the prevNode - so we only link subsequent elems in the query\n\t\t\tprevNodes = qsa ? prevNode.querySelectorAll(selector) : $(selector, prevNode).get();\n\t\t\tprevNode = prevNodes.length ? prevNodes[prevNodes.length - 1] : prevNode;\n\t\t}\n\n\t\ttagDepth = 0;\n\t\tfor (i = 0; i < l; i++) {\n\t\t\telem = elems[i];\n\t\t\tif (prevNode && !found) {\n\t\t\t\t// If prevNode is set, not false, skip linking. If this element is the prevNode, set to false so subsequent elements will link.\n\t\t\t\tfound = (elem === prevNode);\n\t\t\t} else if (nextNode && elem === nextNode) {\n\t\t\t\t// If nextNode is set then break when we get to nextNode\n\t\t\t\tif (get) {\n\t\t\t\t\ttokens += markerNodeInfo(elem);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} else if (elem.parentNode) {\n\t\t\t\t// elem has not been removed from DOM\n\t\t\t\tif (get) {\n\t\t\t\t\ttokens += markerNodeInfo(elem);\n\t\t\t\t\tif (elem._df) {\n\t\t\t\t\t\tj = i + 1;\n\t\t\t\t\t\twhile (j < l && elem.contains(elems[j])) {\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Add deferred tokens after any tokens on descendant elements of this one\n\t\t\t\t\t\twrap[j-1] = elem._df;\n\t\t\t\t\t}\n\t\t\t\t\tif (wrap[i]) {\n\t\t\t\t\t\ttokens += wrap[i] || \"\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (isLink && (vwInfo = viewInfos(elem, undefined, rViewMarkers)) && (vwInfo = vwInfo[0])) {\n\t\t\t\t\t\t// If this is a link(trueOrString ...) call we will avoid re-binding to elems that are within template-rendered views\n\t\t\t\t\t\tskip = skip ? (vwInfo.id !== skip && skip) : vwInfo.open && vwInfo.id;\n\t\t\t\t\t}\n\t\t\t\t\tif (!skip && processInfos(viewInfos(elem))\n\t\t\t\t\t\t// If a link() call, processViewInfos() adds bindings to bindEls, and returns true for non-script nodes, for adding data-link bindings\n\t\t\t\t\t\t// If a childTags() call, getViewInfos returns array of tag bindings.\n\t\t\t\t\t\t\t&& elem.getAttribute($viewsLinkAttr)) {\n\t\t\t\t\t\tbindEls.push([elem]); // A data-linked element so add to bindEls too\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (get) {\n\t\t\ttokens += parentNode._df || \"\";\n\t\t\tif (index = tokens.indexOf(\"#\" + get.id) + 1) {\n\t\t\t\t// We are looking for view.childTags() or tag.childTags() - so start after the open token of the parent view or tag.\n\t\t\t\ttokens = tokens.slice(index + get.id.length);\n\t\t\t}\n\t\t\tindex = tokens.indexOf(\"/\" + get.id);\n\t\t\tif (index + 1) {\n\t\t\t\t// We are looking for view.childTags() or tag.childTags() - so don't look beyond the close token of the parent view or tag.\n\t\t\t\ttokens = tokens.slice(0, index);\n\t\t\t}\n\t\t\t// Call getViewInfos to add the found childTags to the tags array\n\t\t\tgetViewInfos(viewInfos(tokens, undefined, rOpenTagMarkers));\n\t\t}\n\n\t\tif (html === undefined && parentNode.getAttribute($viewsLinkAttr)) {\n\t\t\tbindEls.push([parentNode]); // Support data-linking top-level element directly (not within a data-linked container)\n\t\t}\n\n\t\t// Remove temporary marker script nodes they were added by markPrevOrNextNode\n\t\tunmarkPrevOrNextNode(prevNode, elCnt);\n\t\tunmarkPrevOrNextNode(nextNode, elCnt);\n\n\t\tif (get) {\n\t\t\treturn; // We have added childTags to the tags array, so we are done\n\t\t}\n\n\t\tif (elCnt && defer + ids) {\n\t\t\t// There are some views with elCnt, for which the open or close did not precede any HTML tag - so they have not been processed yet\n\t\t\telem = nextNode;\n\t\t\tif (defer) {\n\t\t\t\tif (nextNode) {\n\t\t\t\t\tprocessViewInfos(viewInfos(defer + \"+\", true), nextNode);\n\t\t\t\t} else {\n\t\t\t\t\tprocessViewInfos(viewInfos(defer, true), parentNode);\n\t\t\t\t}\n\t\t\t}\n\t\t\tprocessViewInfos(viewInfos(ids, true), parentNode);\n\t\t\t// If there were any tokens on nextNode which have now been associated with inserted HTML tags, remove them from nextNode\n\t\t\tif (nextNode) {\n\t\t\t\ttokens = nextNode.getAttribute(jsvAttrStr);\n\t\t\t\tif (l = tokens.indexOf(prevIds) + 1) {\n\t\t\t\t\ttokens = tokens.slice(l + prevIds.length - 1);\n\t\t\t\t}\n\t\t\t\tnextNode.setAttribute(jsvAttrStr, ids + tokens);\n\t\t\t}\n\t\t}\n\n// if (context.lazyLink) {\n// setTimeout(doLinking) (doLinking is function wrapper of following lines)\n// See Future tasks, and https://github.com/BorisMoore/jsviews/issues/368.\n// Could call context.lazyLink as callback, on async completion - or return promise.\n\t\t//================ Bind the data-linked elements and tags ================\n\t\tl = bindEls.length;\n\t\tfor (i = 0; i < l; i++) {\n\t\t\telem = bindEls[i];\n\t\t\tlinkInfo = elem[1];\n\t\t\telem = elem[0];\n\t\t\tif (linkInfo) {\n\t\t\t\tif (tag = bindingStore[linkInfo.id]) {\n\t\t\t\t\tif (linkCtx = tag.linkCtx) {\n\t\t\t\t\t\t// The tag may have been stored temporarily on the bindingStore - or may have already been replaced by the actual binding\n\t\t\t\t\t\ttag = linkCtx.tag;\n\t\t\t\t\t\ttag.linkCtx = linkCtx;\n\t\t\t\t\t}\n\t\t\t\t\tif (linkInfo.open) {\n\t\t\t\t\t\t// This is an 'open linked tag' binding annotation for a data-linked tag {^{...}}\n\t\t\t\t\t\tif (elem) {\n\t\t\t\t\t\t\ttag.parentElem = elem.parentNode;\n\t\t\t\t\t\t\ttag._prv = elem;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttag._elCnt = linkInfo.elCnt;\n\t\t\t\t\t\t// We data-link depth-first (\"on the way in\"), which is better for perf - and allows setting parent tags etc.\n\t\t\t\t\t\tview = tag.tagCtx.view;\n\n\t\t\t\t\t\t// Add data binding (unless skipped due to lateRender)\n\t\t\t\t\t\taddDataBinding(late, undefined, tag._prv, view, linkInfo.id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttag._nxt = elem;\n\t\t\t\t\t\tif (tag._.unlinked && !tag._toLk) {\n\t\t\t\t\t\t\t// This is a 'close linked tag' binding annotation (and data-binding was not skipped due to lateRender)\n\t\t\t\t\t\t\ttagCtx = tag.tagCtx;\n\t\t\t\t\t\t\tview = tagCtx.view;\n\t\t\t\t\t\t\tcallAfterLink(tag);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Add data binding for a data-linked element (with data-link attribute)\n\t\t\t\taddDataBinding(late, elem.getAttribute($viewsLinkAttr), elem, $view(elem), undefined, isLink, outerData, context);\n\t\t\t}\n\t\t}\n//});\n\t}\n\t//==== /end of nested functions ====\n\n\tvar inTag, linkCtx, tag, i, l, j, len, elems, elem, view, vwInfo, linkInfo, prevNodes, token, prevView, nextView,\n\t\tnode, tags, deep, tagName, tagCtx, validate, tagDepth, depth, fragment, copiedNode, firstTag, parentTag,\n\t\tisVoid, wrapper, div, tokens, elCnt, prevElCnt, htmlTag, ids, prevIds, found, skip, isLink, get,\n\t\tself = this,\n\t\tthisId = self._.id + \"_\",\n\t\tdefer = \"\",\n\t\t// The marker ids for which no tag was encountered (empty views or final closing markers) which we carry over to container tag\n\t\tbindEls = [],\n\t\ttagStack = [],\n\t\tdeferStack = [],\n\t\tlate = [],\n\t\tonAfterCreate = changeHandler(self, onAfterCreateStr),\n\t\tprocessInfos = processViewInfos;\n\n\tif (refresh) {\n\t\tif (refresh.tmpl) {\n\t\t\t// refresh is the prevView, passed in from addViews()\n\t\t\tprevView = \"/\" + refresh._.id + \"_\";\n\t\t} else {\n\t\t\tisLink = refresh.lnk; // Top-level linking\n\t\t\tif (refresh.tag) {\n\t\t\t\tthisId = refresh.tag + \"^\";\n\t\t\t\trefresh = true;\n\t\t\t}\n\t\t\tif (get = refresh.get) {\n\t\t\t\tprocessInfos = getViewInfos;\n\t\t\t\ttags = get.tags;\n\t\t\t\tdeep = get.deep;\n\t\t\t\ttagName = get.name;\n\t\t\t}\n\t\t}\n\t\trefresh = refresh === true;\n\t}\n\n\tparentNode = parentNode\n\t\t? (typeof parentNode === STRING\n\t\t\t? $(parentNode)[0] // It is a string, so treat as selector\n\t\t\t: parentNode.jquery\n\t\t\t\t? parentNode[0] // A jQuery object - take first element.\n\t\t\t\t: parentNode)\n\t\t: (self.parentElem // view.link()\n\t\t\t|| document.body); // link(null, data) to link the whole document\n\n\tvalidate = !$subSettingsAdvanced.noValidate && parentNode.contentEditable !== TRUE;\n\tparentTag = parentNode.tagName.toLowerCase();\n\telCnt = !!elContent[parentTag];\n\n\tprevNode = prevNode && markPrevOrNextNode(prevNode, elCnt);\n\tnextNode = nextNode && markPrevOrNextNode(nextNode, elCnt) || null;\n\n\tif (html != undefined) {\n\t\t//================ Insert html into DOM using documentFragments (and wrapping HTML appropriately). ================\n\t\t// Also convert markers to DOM annotations, based on content model.\n\t\t// Corresponds to nextNode ? $(nextNode).before(html) : $(parentNode).html(html);\n\t\t// but allows insertion to wrap correctly even with inserted script nodes. jQuery version will fail e.g. under tbody or select.\n\t\t// This version should also be slightly faster\n\t\tdiv = document.createElement(\"div\");\n\t\twrapper = div;\n\t\tprevIds = ids = \"\";\n\t\thtmlTag = parentNode.namespaceURI === \"http://www.w3.org/2000/svg\" ? \"svg_ns\" : (firstTag = rFirstElem.exec(html)) && firstTag[1] || \"\";\n\t\tif (elCnt) {\n\t\t\t// Now look for following view, and find its tokens, or if not found, get the parentNode._df tokens\n\t\t\tnode = nextNode;\n\t\t\twhile (node && !(nextView = viewInfos(node))) {\n\t\t\t\tnode = node.nextSibling;\n\t\t\t}\n\t\t\tif (tokens = nextView ? nextView._tkns : parentNode._df) {\n\t\t\t\ttoken = prevView || \"\";\n\t\t\t\tif (refresh || !prevView) {\n\t\t\t\t\ttoken += \"#\" + thisId;\n\t\t\t\t}\n\t\t\t\tj = tokens.indexOf(token);\n\t\t\t\tif (j + 1) {\n\t\t\t\t\tj += token.length;\n\t\t\t\t\t// Transfer the initial tokens to inserted nodes, by setting them as the ids variable, picked up in convertMarkers\n\t\t\t\t\tprevIds = ids = tokens.slice(0, j);\n\t\t\t\t\ttokens = tokens.slice(j);\n\t\t\t\t\tif (nextView) {\n\t\t\t\t\t\tnode.setAttribute(jsvAttrStr, tokens);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetDefer(parentNode, tokens);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//================ Convert the markers to DOM annotations, based on content model. ================\n//\t\t\toldElCnt = elCnt;\n\t\tisVoid = undefined;\n\t\thtml = (\"\" + html).replace(rConvertMarkers, convertMarkers);\n//\t\t\tif (!!oldElCnt !== !!elCnt) {\n//\t\t\t\terror(\"Parse: \" + html); // Parse error. Content not well-formed?\n//\t\t\t}\n\t\tif (validate && tagStack.length) {\n\t\t\tsyntaxError(\"Mismatched '<\" + parentTag + \"...>' in:\\n\" + html); // Unmatched tag\n\t\t}\n\t\tif (validateOnly) {\n\t\t\treturn;\n\t\t}\n\t\t// Append wrapper element to doc fragment\n\t\tsafeFragment.appendChild(div);\n\n\t\t// Go to html and back, then peel off extra wrappers\n\t\t// Corresponds to jQuery $(nextNode).before(html) or $(parentNode).html(html);\n\t\t// but supports svg elements, and other features missing from jQuery version (and this version should also be slightly faster)\n\t\thtmlTag = wrapMap[htmlTag] || wrapMap.div;\n\t\tdepth = htmlTag[0];\n\t\twrapper.innerHTML = htmlTag[1] + html + htmlTag[2];\n\t\twhile (depth--) {\n\t\t\twrapper = wrapper.lastChild;\n\t\t}\n\t\tsafeFragment.removeChild(div);\n\t\tfragment = document.createDocumentFragment();\n\t\twhile (copiedNode = wrapper.firstChild) {\n\t\t\tfragment.appendChild(copiedNode);\n\t\t}\n\t\t// Insert into the DOM\n\t\tparentNode.insertBefore(fragment, nextNode);\n\t}\n\tdataLink();\n\n\treturn late;\n}\n\nfunction addDataBinding(late, linkMarkup, node, currentView, boundTagId, isLink, data, context) {\n\t// Add data binding for data-linked elements or {^{...}} data-linked tags\n\tvar tmpl, tokens, attr, convertBack, tagExpr, linkFn, linkCtx, tag, rTagIndex, hasElse, lastIndex,\n\t\tlinkExpressions = [];\n\n\tif (boundTagId) {\n\t\t// boundTagId is a string for {^{...}} data-linked tag. So only one linkTag in linkMarkup\n\t\t// data and context arguments are undefined\n\t\ttag = bindingStore[boundTagId];\n\t\ttag = tag.linkCtx ? tag.linkCtx.tag : tag;\n\n\t\tlinkCtx = tag.linkCtx || {\n\t\t\ttype: \"inline\",\n\t\t\tdata: currentView.data, // source\n\t\t\telem: tag._elCnt ? tag.parentElem : node, // target\n\t\t\tview: currentView,\n\t\t\tctx: currentView.ctx,\n\t\t\tattr: HTML, // Script marker nodes are associated with {^{ and always target HTML.\n\t\t\tfn: tag._.bnd,\n\t\t\ttag: tag,\n\t\t\t// Pass the boundTagId in the linkCtx, so that it can be picked up in observeAndBind\n\t\t\t_bndId: boundTagId\n\t\t};\n\t\ttag.linkCtx = linkCtx;\n\t\tbindDataLinkTarget(linkCtx, late);\n\t\ttag._toLk = linkCtx._bndId; // If data binding happened, remove _toLk flag from tag\n\t} else if (linkMarkup && node) {\n\t\t// Data-linked element\n\n\t\t// If isLink then this is a top-level linking: .link(expression, target, data, ....) or\n\t\t// .link(true, target, data, ....) scenario - and data and context are passed in separately from the view\n\t\tdata = isLink ? data : currentView.data;\n\t\ttmpl = currentView.tmpl;\n\t\tlinkMarkup = normalizeLinkTag(linkMarkup, defaultAttr(node));\n\t\tlastIndex = rTagDatalink.lastIndex = 0;\n\t\twhile (tokens = rTagDatalink.exec(linkMarkup)) { // TODO require } to be followed by whitespace or $, and remove the \\}(!\\}) option.\n\t\t\tlinkExpressions.push(tokens);\n\t\t\tlastIndex = rTagDatalink.lastIndex;\n\t\t}\n\t\tif (lastIndex < linkMarkup.length) {\n\t\t\tsyntaxError(linkMarkup);\n\t\t}\n\t\twhile (tokens = linkExpressions.shift()) {\n\t\t\t// Iterate over the data-link expressions, for different target attrs,\n\t\t\t// e.g. ~description(firstName, lastName)}\"\n\t\t\t// tokens: [all, attr, bindOnly, tagExpr, tagName, converter, colon, html, comment, code, params]\n\t\t\trTagIndex = rTagDatalink.lastIndex;\n\t\t\tattr = tokens[1];\n\t\t\ttagExpr = tokens[3];\n\t\t\twhile (linkExpressions[0] && linkExpressions[0][4] === \"else\") { // If this is {sometag...} and is followed by an {else...} add to tagExpr\n\t\t\t\ttagExpr += delimCloseChar1 + delimOpenChar0 + linkExpressions.shift()[3];\n\t\t\t\thasElse = true;\n\t\t\t}\n\t\t\tif (hasElse) { // If an {else} has been added, need also to add closing {{/sometag}}\n\t\t\t\ttagExpr += delimCloseChar1 + delimOpenChar0 + delimOpenChar1 + \"/\" + tokens[4] + delimCloseChar0;\n\t\t\t}\n\t\t\tlinkCtx = {\n\t\t\t\ttype: isLink || \"link\",\n\t\t\t\tdata: data, // source\n\t\t\t\telem: node, // target\n\t\t\t\tview: currentView,\n\t\t\t\tctx: context,\n\t\t\t\tattr: attr,\n\t\t\t\t_toLk : 1, // Flag to data-link on initial data-link call rendering call\n\t\t\t\t_noUpd : tokens[2] // Flag for data-link=\"^{...}\" so on initial data-link call will bind, but not render)\n\t\t\t};\n\n\t\t\tconvertBack = undefined;\n\t\t\tif (tokens[6]) {\n\t\t\t\tconvertBack = tokens[10] || undefined;\n\t\t\t\tlinkCtx.convert = tokens[5] || \"\";\n\t\t\t\tif (convertBack !== undefined && defaultAttr(node)) {\n\t\t\t\t\tif (attr) {\n\t\t\t\t\t\tsyntaxError(tagExpr + \"- Remove target: \" + attr);\n\t\t\t\t\t}\n\t\t\t\t\t// Default target, so allow 2 way binding\n\t\t\t\t\tlinkCtx.convertBack = convertBack = convertBack.slice(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Compile the linkFn expression which evaluates and binds a data-link expression\n\t\t\t// TODO - optimize for the case of simple data path with no conversion, helpers, etc.:\n\t\t\t// i.e. data-link=\"a.b.c\". Avoid creating new instances of Function every time. Can use a default function for all of these...\n\n\t\t\tlinkCtx.expr = attr + tagExpr;\n\t\t\tlinkFn = linkExprStore[tagExpr];\n\t\t\tif (!linkFn) {\n\t\t\t\tlinkExprStore[tagExpr] = linkFn = $sub.tmplFn(tagExpr.replace(rEscapeQuotes, \"\\\\$&\"), tmpl, true, convertBack, hasElse);\n\t\t\t}\n\t\t\tlinkCtx.fn = linkFn;\n\t\t\tbindDataLinkTarget(linkCtx, late);\n\t\t\t// We store rTagIndex in local scope, since this addDataBinding method can sometimes be called recursively,\n\t\t\t// and each is using the same rTagDatalink instance.\n\t\t\trTagDatalink.lastIndex = rTagIndex;\n\t\t}\n//\t\t}\n\t}\n}\n\nfunction bindDataLinkTarget(linkCtx, late) {\n\t// Add data link bindings for a link expression in data-link attribute markup, or for a linkedElement\n\tfunction handler(ev, eventArgs) {\n\t\t// If the link expression uses a custom tag, the onDataLinkedTagChange call will call renderTag, which will set tagCtx on linkCtx\n\t\tif (!eventArgs || !eventArgs.refresh) {\n\t\t\tonDataLinkedTagChange.call(linkCtx, ev, eventArgs);\n\t\t}\n\t}\n\n\tvar view,\n\t\tlinkCtxType = linkCtx.type;\n\tif (linkCtxType === \"top\" || linkCtxType === \"expr\") {\n\t\t// Top-level linking: .link(expressionOrTrue, data, context) - so we need to create a view for the linking, with the data and ctx\n\t\t// which may be different than the current context of the target. Note that this view is not a standard data-linked view, so it will\n\t\t// be disposed only when its parent view is disposed.\n\t\tlinkCtx.view = new $sub.View(\n\t\t\t$sub.extendCtx(linkCtx.ctx, linkCtx.view.ctx),\n\t\t\t\"link\", linkCtx.view, linkCtx.data, linkCtx.expr, undefined, addBindingMarkers);\n\t}\n\tlinkCtx._ctxCb = $sub._gccb(view = linkCtx.view); // getContextCallback: _ctxCb, for filtering/appending to dependency paths: function(path, object) { return [(object|path)*]}\n\tlinkCtx._hdl = handler;\n\t// handler._ctx = linkCtx; Could pass linkCtx for use in a depends = function() {} call, so depends is different for different linkCtx's\n\n\tif (linkCtx.elem.nodeName === \"SELECT\"\n\t\t&& (linkCtx.elem._jsvLkEl // A SELECT which is a linkedElement\n\t\t|| (linkCtxType === \"link\" && !linkCtx.attr && linkCtx.convert !== undefined))) { // A SELECT with a data-link binding (the assign tag {:...}, not another expression such as {on ...} (See https://github.com/BorisMoore/jsviews/issues/444))\n\t\t\tvar source,\n\t\t\t\telem = linkCtx.elem,\n\t\t\t\t$elem = $(elem);\n\t\t\t$elem.on(\"jsv-domchange\", function() {\n\t\t\t\t// If the options have changed dynamically under the select, we need to refresh the data-linked selection, using the new options\n\t\t\t\tif (!arguments[3].refresh) { // eventArgs.refresh !== true - so a refresh action will only set the selection once\n\t\t\t\t\tif (elem._jsvLkEl) {\n\t\t\t\t\t\t$elem.val(elem._jsvLkEl.cvtArgs(elem._jsvElse, 1)[elem._jsvInd]); // SELECT is a linkedElement, so set to value of bndArgs(elseIndex)[bindToIndex]\n\t\t\t\t\t} else if (linkCtx.tag) {\n\t\t\t\t\t\t$elem.val(linkCtx.tag.cvtArgs(0,1)); // SELECT with data-link expression with convert=... convertBack=...\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsource = linkCtx.fn(view.data, view, $sub); // SELECT with data-link expression (either data-link='expression', or data-link='{cvt:expression:cvtBk}')\n\t\t\t\t\t\t$elem.val(linkCtx.convert || linkCtx.convertBack ? $sub._cnvt(linkCtx.convert, view, source) : source);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tif (linkCtx.fn._lr) {\n\t\tlinkCtx._toLk = 1;\n\t\tlate.push(linkCtx); // lateRender - defer rendering and linking (sync but after first linking pass)\n\t} else {\n\t\thandler(true);\n\t}\n}\n\n//=====================\n// Data-linking helpers\n//=====================\n\nfunction removeSubStr(str, substr) {\n\tvar k;\n\treturn str\n\t\t? (k = str.indexOf(substr),\n\t\t\t(k + 1\n\t\t\t\t? str.slice(0, k) + str.slice(k + substr.length)\n\t\t\t\t: str))\n\t\t: \"\";\n}\n\nfunction markerNodeInfo(node) {\n\treturn node &&\n\t\t(typeof node === STRING\n\t\t\t? node\n\t\t\t: node.tagName === SCRIPT\n\t\t\t\t? node.type.slice(3)\n\t\t\t\t: node.nodeType === 1 && node.getAttribute(jsvAttrStr) || \"\");\n}\n\nfunction viewInfos(node, isVal, rBinding) {\n\t// Test whether node is a script marker node, and if so, return metadata\n\tfunction getInfos(all, open, close, id, ch, elPath) {\n\t\tinfos.push({\n\t\t\telCnt: elCnt,\n\t\t\tid: id,\n\t\t\tch: ch,\n\t\t\topen: open,\n\t\t\tclose: close,\n\t\t\tpath: elPath,\n\t\t\ttoken: all\n\t\t});\n\t}\n\tvar elCnt, tokens,\n\t\tinfos = [];\n\tif (tokens = isVal ? node : markerNodeInfo(node)) {\n\t\telCnt = infos.elCnt = node.tagName !== SCRIPT;\n\t\telCnt = tokens.charAt(0) === \"@\" || elCnt;\n\t\tinfos._tkns = tokens;\n\t\t// rMarkerTokens = /(?:(#)|(\\/))(\\d+)([_^])([-+@\\d]+)?/g;\n\t\ttokens.replace(rBinding || rMarkerTokens, getInfos);\n\t\treturn infos;\n\t}\n}\n\nfunction unmarkPrevOrNextNode(node, elCnt) {\n\tif (node) {\n\t\tif (node.type === \"jsv\") {\n\t\t\tnode.parentNode.removeChild(node);\n\t\t} else if (elCnt && node.getAttribute($viewsLinkAttr) === \"\") {\n\t\t\tnode.removeAttribute($viewsLinkAttr);\n\t\t}\n\t}\n}\n\nfunction markPrevOrNextNode(node, elCnt) {\n\tvar marker = node;\n\twhile (elCnt && marker && marker.nodeType !== 1) {\n\t\tmarker = marker.previousSibling;\n\t}\n\tif (marker) {\n\t\tif (marker.nodeType !== 1) {\n\t\t\t// For text nodes, we will add a script node before\n\t\t\tmarker = document.createElement(SCRIPT);\n\t\t\tmarker.type = \"jsv\";\n\t\t\tnode.parentNode.insertBefore(marker, node);\n\t\t} else if (!markerNodeInfo(marker) && !marker.getAttribute($viewsLinkAttr)) {\n\t\t\t// For element nodes, we will add a data-link attribute (unless there is already one)\n\t\t\t// so that this node gets included in the node linking process.\n\t\t\tmarker.setAttribute($viewsLinkAttr, \"\");\n\t\t}\n\t}\n\treturn marker;\n}\n\nfunction normalizeLinkTag(linkMarkup, twoway) {\n\tlinkMarkup = $.trim(linkMarkup);\n\treturn linkMarkup.slice(-1) !== delimCloseChar0\n\t// If simplified syntax is used: data-link=\"expression\", convert to data-link=\"{:expression}\",\n\t// or for inputs, data-link=\"{:expression:}\" for (default) two-way binding\n\t\t? linkMarkup = delimOpenChar1 + \":\" + linkMarkup + (twoway ? \":\" : \"\") + delimCloseChar0\n\t\t: linkMarkup;\n}\n\n//===========================\n// Methods for views and tags\n//===========================\n\nfunction callAfterLink(tag, ev, eventArgs) {\n\tfunction copyFromTagCtxToTag() {\n\t\tlinkedElems = tagCtx.linkedElems || tag.linkedElems || tag.linkedElem && [tag.linkedElem];\n\t\tif (linkedElems) {\n\t\t\ttag.linkedElems = tagCtx.linkedElems = linkedElems;\n\t\t\ttag.linkedElem = linkedElems[0] = tag.linkedElem || linkedElems[0];\n\t\t}\n\t\tif (linkedElem = tagCtx.mainElem || tag.mainElem) {\n\t\t\ttagCtx.mainElem = tag.mainElem = linkedElem;\n\t\t}\n\t\tif (linkedElem = tagCtx.displayElem || tag.displayElem) {\n\t\t\ttagCtx.displayElem = tag.displayElem = linkedElem;\n\t\t}\n\t}\n\n\tvar linkedElems, linkedElements, linkedElem, l, m, $linkCtxElem, linkCtxElem, linkedEl, linkedTag,\n\t\ttagCtxElse, props, val, oldVal, indexTo, i, mapDeps, propDeps,\n\t\ttagCtx = tag.tagCtx,\n\t\ttagCtxs = tag.tagCtxs,\n\t\ttagCtxslength = tagCtxs && tagCtxs.length,\n\t\tlinkCtx = tag.linkCtx,\n\t\tbindTo = tag.bindTo || {};\n\n\tif (tag._.unlinked) { // First call to onAfterLink, or first call after onUpdate: updateContent. Initialize and call onBind and set properties\n\t\t$linkCtxElem = $(linkCtx.elem);\n\t\tif (tag.linkedElement || tag.mainElement || tag.displayElement) {\n\t\t\tif (linkedElements = tag.linkedElement) {\n\t\t\t\t// tag.linkedElement: - selector, or array of selectors, for identifying linked elements in template/rendered content.\n\t\t\t\t// (But for tag bindings on data-linked elements, defaults to data-linked element)\n\t\t\t\ttag.linkedElem = undefined;\n\t\t\t\tl = linkedElements.length;\n\t\t\t\twhile (l--) {\n\t\t\t\t\tif (linkedElements[l]) {\n\t\t\t\t\t\tlinkCtxElem = !tag.inline && $linkCtxElem.filter(linkedElements[l]);\n\t\t\t\t\t\tm = tagCtxslength;\n\t\t\t\t\t\twhile (m--) {\n\t\t\t\t\t\t\ttagCtxElse = tagCtxs[m];\n\t\t\t\t\t\t\tlinkedElems = tagCtxElse.linkedElems = tagCtxElse.linkedElems || new Array(l);\n\t\t\t\t\t\t\tlinkedElem = linkCtxElem[0] ? linkCtxElem : tagCtxElse.contents(true, linkedElements[l]);\n\t\t\t\t\t\t\tif (linkedElem[0] && linkedElem[0].type !== RADIO) {\n\t\t\t\t\t\t\t\tlinkedElems[l] = linkedElem.eq(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (linkedElements = tag.mainElement) {\n\t\t\t\t// tag.mainElement: - selector for identifying mainElem in template/rendered content\n\t\t\t\t// (But for tag bindings on data-linked elements, defaults to data-linked element)\n\t\t\t\tlinkCtxElem = !tag.inline && $linkCtxElem.filter(linkedElements);\n\t\t\t\tm = tagCtxslength;\n\t\t\t\twhile (m--) {\n\t\t\t\t\ttagCtxElse = tagCtxs[m];\n\t\t\t\t\tlinkedElem = linkCtxElem[0] ? linkCtxElem : tagCtxElse.contents(true, linkedElements).eq(0);\n\t\t\t\t\tif (linkedElem[0]) {\n\t\t\t\t\t\ttagCtxElse.mainElem = linkedElem;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (linkedElements = tag.displayElement) {\n\t\t\t\t// tag.displayElement: - selector for identifying displayElem in template/rendered content\n\t\t\t\t// (But for tag bindings on data-linked elements, defaults to data-linked element)\n\t\t\t\tlinkCtxElem = !tag.inline && $linkCtxElem.filter(linkedElements);\n\t\t\t\tm = tagCtxslength;\n\t\t\t\twhile (m--) {\n\t\t\t\t\ttagCtxElse = tagCtxs[m];\n\t\t\t\t\tlinkedElem = linkCtxElem[0] ? linkCtxElem : tagCtxElse.contents(true, linkedElements).eq(0);\n\t\t\t\t\tif (linkedElem[0]) {\n\t\t\t\t\t\ttagCtxElse.displayElem = linkedElem;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcopyFromTagCtxToTag();\n\t\t}\n\t\tif (tag.onBind) {\n\t\t\ttag.onBind(tagCtx, linkCtx, tag.ctx, ev, eventArgs);\n\t\t\tcopyFromTagCtxToTag();\n\t\t}\n\t}\n\n\tm = tagCtxslength;\n\twhile (m--) {\n\t\ttagCtxElse = tagCtxs[m];\n\t\tprops = tagCtxElse.props;\n\n\t\tif (tag._.unlinked && tagCtxElse.map && tag.mapProps) {\n\t\t\t// Compile the dependency paths for observable changes in mapProps (e.g. start, end, filter)\n\t\t\ti = tag.mapProps.length;\n\t\t\tmapDeps = props.mapDepends || tag.mapDepends || []; // dependency paths\n\t\t\tmapDeps = $isArray(mapDeps) ? mapDeps : [mapDeps];\n\t\t\twhile (i--) { // Iterate through mapProps\n\t\t\t\tvar prop = tag.mapProps[i];\n\t\t\t\tpropDeps = tag._.bnd.paths[m][\"_\" + prop]; // paths for mapProps on this tagCtx\n\t\t\t\tif (propDeps && propDeps.length && propDeps.skp) { // Not already a bound prop ^prop=expression;\n\t\t\t\t\tmapDeps = mapDeps.concat(propDeps); // Add dependencies for this prop expression\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (mapDeps.length) {\n\t\t\t\ttagCtxElse.map.observe(mapDeps, linkCtx); // Listen to observable changes of mapProps, and call map.update when change happens\n\t\t\t}\n\t\t}\n\t\tif (linkedElem = tagCtxElse.mainElem || !tag.mainElement && tagCtxElse.linkedElems && tagCtxElse.linkedElems[0]) {\n\t\t\t// linkedElem is the mainElem (defaulting to linkedElem)\n\t\t\tif (linkedElem[0] && props.id && !linkedElem[0].id) {\n\t\t\t\tlinkedElem[0].id = props.id;\n\t\t\t}\n\t\t\tif (tag.setSize) {\n\t\t\t\tif (val = !bindTo.height && props.height || tag.height) {\n\t\t\t\t\tlinkedElem.height(val);\n\t\t\t\t}\n\t\t\t\tif (val = !bindTo.width && props.width || tag.width) {\n\t\t\t\t\tlinkedElem.width(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (val = (linkedElem = tagCtxElse.displayElem || linkedElem) && (!bindTo[\"class\"] && props[\"class\"] || tag.className)) {\n\t\t\t// This code supports dynamic binding to class - where it adds the class if absent, and removes/adds if a previous value is present\n\t\t\toldVal = linkedElem[0]._jsvCl;\n\t\t\tif (val !== oldVal) {\n\t\t\t\tif (linkedElem.hasClass(oldVal)) {\n\t\t\t\t\tlinkedElem.removeClass(oldVal);\n\t\t\t\t}\n\t\t\t\tlinkedElem.addClass(val);\n\t\t\t\tlinkedElem[0]._jsvCl = val;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (tag.onAfterLink) {\n\t\ttag.onAfterLink(tagCtx, linkCtx, tag.ctx, ev, eventArgs);\n\t\tcopyFromTagCtxToTag();\n\t}\n\n\tif (!tag.flow && !tag._.chg) {\n\t\tif (tag._tgId && tag._.unlinked && (tag.linkedElems || tag.bindTo)) {\n\t\t\tdefineBindToDataTargets(bindingStore[tag._tgId], tag);\n\t\t}\n\t\tm = tagCtxs.length;\n\t\twhile (m--) {\n\t\t\tprops = tag.cvtArgs(m, 1); // array of bindFrom args/props\n\t\t\tl = props.length;\n\t\t\twhile (l--) {\n\t\t\t\t// If the bound property or arg has not yet been set (e.g. during initial rendering),\n\t\t\t\t// or has been unset, because onUpdate is set to true, or if onUpdate is false,\n\t\t\t\t// but this particular bound arg/prop is being changed observably: call setValue()\n\t\t\t\ttag.setValue(props[l], l, m, ev, eventArgs);\n\t\t\t}\n\t\t\tif (tag._.unlinked) {\n\t\t\t\ttagCtx = tagCtxs[m];\n\t\t\t\tlinkedElems = tagCtx.linkedElems || !m && tag.linkedElem && [tag.linkedElem];\n\t\t\t\tindexTo = (tag.bindTo || [0]).length;\n\t\t\t\twhile (indexTo--) {\n\t\t\t\t\tif ((linkedElem = linkedElems && linkedElems[indexTo]) && (l = linkedElem.length)) {\n\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\tlinkedEl = linkedElem[l];\n\t\t\t\t\t\t\tlinkedTag = linkedEl._jsvLkEl;\n\t\t\t\t\t\t\tif (!linkedTag || linkedTag !== tag) {\n\t\t\t\t\t\t\t\t// For data-linked tags, identify the linkedEl with the tag, for \"to\" binding\n\t\t\t\t\t\t\t\t// (For data-linked elements, if not yet bound, we identify later when the linkCtx.elem is bound)\n\t\t\t\t\t\t\t\tlinkedEl._jsvLkEl = tag;\n\t\t\t\t\t\t\t\tlinkedEl._jsvInd = indexTo;\n\t\t\t\t\t\t\t\tlinkedEl._jsvElse = m;\n\t\t\t\t\t\t\t\tbindLinkedElChange(tag, linkedEl);\n\t\t\t\t\t\t\t\tif (tag._tgId) {\n\t\t\t\t\t\t\t\t\tlinkedEl._jsvBnd = \"&\" + tag._tgId + \"+\"; // Add a \"+\" for cloned binding - so removing\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// elems with cloned bindings will not remove the 'parent' binding from the bindingStore.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\ttag._.unlinked = undefined;\n\tif (tag._.lt) { // Late tag: Late path: @some.path had not returned @some object, so try again with refresh\n\t\ttag.refresh();\n\t}\n}\n\nfunction asyncOnElemChange(ev) {\n\tvar which = ev.which;\n\tif (!(which > 15 && which < 21 || which > 32 && which < 41 || which > 111 && which < 131 || which === 27 || which === 144)) {\n\t\t// Shift, Ctrl, Alt, Pause, Caplock, Page up/down End, Home, Left, Up, Right, Down, Function keys, Escape, Numlock\n\t\tsetTimeout(function() {\n\t\t\tonElemChange(ev);\n\t\t});\n\t}\n}\n\nfunction bindTriggerEvent($elem, trig, onoff) {\n\t// Bind keydown, or other trigger - (rather than use the default change event bubbled to activeBody)\n\tif (trig === true && useInput && (!isIE || $elem[0].contentEditable !== TRUE)) { // IE oninput event is not raised for contenteditable changes\n\t\t$elem[onoff](\"input.jsv\", onElemChange); // For HTML5 browser with \"oninput\" support - for mouse editing of text\n\t} else {\n\t\ttrig = typeof trig === STRING ? trig : \"keydown.jsv\"; // Set trigger to (true || truey non-string (e.g. 1) || 'keydown')\n\t\t$elem[onoff](trig, trig.indexOf(\"keydown\") >= 0 ? asyncOnElemChange : onElemChange); // Get 'keydown' with async\n\t}\n}\n\nfunction bindLinkedElChange(tag, linkedElem) {\n\t// Two-way binding for linkedElem - in the case of input, textarea or contentEditable elements.\n\t// Trigger setting may have changed. Unbind previous trigger binding (if any) and bind new one.\n\n\tvar $linkedElem, newTrig,\n\t\toldTrig = linkedElem._jsvTr || false;\n\n\tif (tag) {\n\t\tnewTrig = tag.tagCtx.props.trigger;\n\t\tif (newTrig === undefined) {\n\t\t\tnewTrig = tag.trigger;\n\t\t}\n\t}\n\tif (newTrig === undefined) {\n\t\tnewTrig = $subSettings.trigger;\n\t}\n\t// Trigger is noop except for text box, textarea, contenteditable...\n\tnewTrig = newTrig && (linkedElem.tagName === \"INPUT\" && linkedElem.type !== CHECKBOX && linkedElem.type !== RADIO\n\t\t|| linkedElem.type === \"textarea\" || linkedElem.contentEditable === TRUE) && newTrig || false;\n\n\tif (oldTrig !== newTrig) {\n\t\t$linkedElem = $(linkedElem);\n\t\tbindTriggerEvent($linkedElem, oldTrig, \"off\");\n\t\tbindTriggerEvent($linkedElem, linkedElem._jsvTr = newTrig, \"on\");\n\t}\n}\n\nfunction defineBindToDataTargets(binding, tag, cvtBk) {\n\t// Two-way binding.\n\t// We set the binding.to[1] to be the cvtBack, and binding.to[0] to be either the path to the target, or [object, path] where the target is the\n\t// path on the provided object. So for a computed path with an object call: a.b.getObject().d.e, we set to[0] to be [exprOb, \"d.e\"], and\n\t// we bind to the path on the returned object, exprOb.ob, as target. Otherwise our target is the first path, paths[0], which we will convert\n\t// with contextCb() for paths like ~a.b.c or #x.y.z\n\n\tvar pathIndex, path, lastPath, bindtoOb, to, bindTo, paths, k, obsCtxPrm, linkedCtxParam, contextCb, targetPaths, bindTos, fromIndex, isCpfn,\n\t\ttagElse = 1,\n\t\ttos = [],\n\t\tlinkCtx = binding.linkCtx,\n\t\tsource = linkCtx.data,\n\t\ttargetPathsElses = linkCtx.fn.paths;\n\n\tif (binding && !binding.to) {\n\t\tif (tag) {\n\t\t\tif (!tag.convertBack) {\n\t\t\t\ttag.convertBack = cvtBk;\n\t\t\t}\n\t\t\tbindTo = tag.bindTo;\n\t\t\ttagElse = tag.tagCtxs ? tag.tagCtxs.length : 1;\n\t\t}\n\t\twhile (tagElse--) {\n\t\t\tbindTos = [];\n\t\t\tif (targetPaths = targetPathsElses[tagElse]) {\n\t\t\t\tbindTo = targetPaths._jsvto ? [\"jsvto\"] : (bindTo || [0]);\n\t\t\t\tif (!tagElse && tag && tag._.ths) {\n\t\t\t\t\t// Tag has a this=expr bindign for which we will create an additional 'to' target (at index bindTo.length)\n\t\t\t\t\tbindTo = bindTo.concat(\"this\");\n\t\t\t\t}\n\t\t\t\tk = bindTo.length;\n\t\t\t\twhile (k--) {\n\t\t\t\t\tpath = \"\";\n\t\t\t\t\tcontextCb = linkCtx._ctxCb;\n\t\t\t\t\tpaths = bindTo[k];\n\t\t\t\t\tpaths = targetPaths[+paths === paths ? paths : \"_\" + paths]; // If path is a string, prepend \"_\" to avoid collision (e.g. with array.length if path is \"length\")\n\t\t\t\t\tif (pathIndex = paths && paths.length) {\n\t\t\t\t\t\tlastPath = paths[pathIndex - 1];\n\t\t\t\t\t\tif (lastPath._cpfn) { // Computed property exprOb\n\n\t\t\t\t\t\t\tbindtoOb = lastPath;\n\t\t\t\t\t\t\twhile (lastPath.sb && lastPath.sb._cpfn) {\n\t\t\t\t\t\t\t\tpath = lastPath = lastPath.sb;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpath = lastPath.sb || path && path.path;\n\t\t\t\t\t\t\tisCpfn = lastPath._cpfn && !lastPath.sb; // leaf binding to computed property/function \"a.b.c()\"\n\t\t\t\t\t\t\tlastPath = path ? path.slice(1) : bindtoOb.path;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tto = path\n\t\t\t\t\t\t\t? [bindtoOb, // 'exprOb' for this expression and view-binding. So bindtoOb.ob is current object returned by expression.\n\t\t\t\t\t\t\t\tlastPath]\n\t\t\t\t\t\t\t: resolveDataTargetPath(lastPath, source, contextCb); // Get 'to' for target path: lastPath\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Contextual parameter ~foo with no external binding - has ctx.foo = [{_ocp: xxx}] and binds to ctx.foo._ocp\n\t\t\t\t\t\tlinkedCtxParam = tag.linkedCtxParam;\n\t\t\t\t\t\tto = [];\n\t\t\t\t\t\tfromIndex = tag._.fromIndex;\n\t\t\t\t\t\tif (fromIndex && linkedCtxParam && linkedCtxParam[fromIndex[k]]) {\n\t\t\t\t\t\t\t// This is a tag binding, with linked tag contextual parameters\n\t\t\t\t\t\t\tto = [tag.tagCtxs[tagElse].ctx[linkedCtxParam[fromIndex[k]]][0], _ocp];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ((obsCtxPrm = to._cxp) && obsCtxPrm.tag && lastPath.indexOf(\".\")<0) {\n\t\t\t\t\t\t// This is a binding for a tag contextual parameter (e.g. within a tag block content\n\t\t\t\t\t\tto = obsCtxPrm;\n\t\t\t\t\t}\n\t\t\t\t\tto.isCpfn = isCpfn;\n\t\t\t\t\tbindTos.unshift(to);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttos.unshift(bindTos);\n\t\t}\n\t\tbinding.to = tos;\n\t}\n}\n\nfunction resolveDataTargetPath(targetPath, source, contextCb) {\n\t// Iteratively process targetPath, resolving ~a.b.c paths for contextual parameters\n\tvar path, bindtoOb, to, l, obsCtxPrm, view, topCp, data;\n\n\twhile (targetPath && targetPath !== _ocp && (to = contextCb(path = targetPath.split(\"^\").join(\".\"))) && (l = to.length)) {\n\t\tif (obsCtxPrm = to[0]._cxp) { // Two-way binding to a contextual parameter reference, ~foo (declared as ~foo=expr on a parent tag)\n\t\t\ttopCp = topCp || obsCtxPrm;\n\t\t\tview = to[0][0];\n\t\t\tif (_ocp in view) {\n\t\t\t\tdata = view;\n\t\t\t\tview = view._vw;\n\t\t\t} else {\n\t\t\t\tdata = view.data;\n\t\t\t}\n\t\t\ttopCp.path = targetPath = to[0][1];\n\t\t\tto = [topCp.data = data, targetPath];\n\t\t\t\tcontextCb = $sub._gccb(view);\n\t\t\t\tif (targetPath._cpfn) { // computed property\n\t\t\t\t\tbindtoOb = targetPath;\n\t\t\t\t\tbindtoOb.data = to[0];\n\t\t\t\t\tbindtoOb._cpCtx = contextCb;\n\t\t\t\t\twhile (targetPath.sb && targetPath.sb._cpfn) {\n\t\t\t\t\t\tpath = targetPath = targetPath.sb;\n\t\t\t\t\t}\n\t\t\t\t\tpath = targetPath.sb || path && path.path;\n\t\t\t\t\ttargetPath = path ? path.slice(1) : bindtoOb.path;\n\t\t\t\t\tto = [\n\t\t\t\t\t\tbindtoOb, // 'exprOb' for this expression and view-binding. So bindtoOb.ob is current object returned by expression.\n\t\t\t\t\t\ttargetPath\n\t\t\t\t\t];\n\t\t\t\t} else if (obsCtxPrm.tag && obsCtxPrm.path === _ocp) {\n\t\t\t\t\tto = obsCtxPrm;\n\t\t\t\t}\n\t\t} else { // Two-way binding to a helper - e.g. ~address.street, or computed, e.g. ~fullName(), or view property e.g. #data.foo\n\t\t\tto = l>1\n\t\t\t\t? [to[l-2], to[l-1]] // With path: [object, path]\n\t\t\t\t: [to[l-1]]; // No path, (e.g. [function] for computed with setter)\n\t\t}\n\t\tsource = to[0];\n\t\ttargetPath = to[1];\n\t}\n\tto = to || [source, path];\n\tto._cxp = topCp;\n\treturn to;\n}\n\nfunction mergeCtxs(tag, newCtxs, replace) { // Merge updated tagCtxs into tag.tagCtxs\n\tvar tagCtx, newTagCtx, latePath,\n\t\tview = tag.tagCtx.view,\n\t\ttagCtxs = tag.tagCtxs || [tag.tagCtx],\n\t\tl = tagCtxs.length,\n\t\trefresh = !newCtxs;\n\n\tif (refresh) {\n\t\tnewCtxs = tag._.bnd.call(view.tmpl, (tag.linkCtx || view).data, view, $sub);\n\t\tif (newCtxs.lt) {\n\t\t\treturn; // We are calling tag.refresh() but a late path (@a.b.c) has not yet returned an object (@a) so cancel the refresh()\n\t\t}\n\t\ttag._.lt = undefined; // All late paths are now resolved, so this is no longer a late tag\n\t\tnewCtxs = $isArray(newCtxs) ? newCtxs : [newCtxs];\n\t}\n\n\tif (replace) {\n\t\t// Replace previous tagCtxs by new ones, rather than merging\n\t\ttagCtxs = tag.tagCtxs = newCtxs;\n\t\ttag.tagCtx = tagCtxs[0];\n\t\taddLinkMethods(tag);\n\t} else {\n\t\twhile (l--) {\n\t\t\ttagCtx = tagCtxs[l];\n\t\t\tnewTagCtx = newCtxs[l];\n\t\t\t$extend(tagCtx.ctx, newTagCtx.ctx); // We don't support propagating ctx variables, ~foo, observably, to nested views. So extend, not setProperty...\n\t\t\ttagCtx.args = newTagCtx.args;\n\t\t\tif (refresh) {\n\t\t\t\ttagCtx.tmpl = newTagCtx.tmpl;\n\t\t\t}\n\t\t\t$observable(tagCtx.props).setProperty(newTagCtx.props);\n\t\t}\n\t}\n\t$sub._thp(tag, tagCtxs[0]); // tagHandlersFromProps\n\treturn tagCtxs;\n}\n\n//=========\n// Disposal\n//=========\n\nfunction clean(elems) {\n\t// Remove data-link bindings, or contained views\n\tvar l, elem, bindings,\n\t\telemArray = [],\n\t\tlen = elems.length,\n\t\ti = len;\n\twhile (i--) {\n\t\t// Copy into an array, so that deletion of nodes from DOM will not cause our 'i' counter to get shifted\n\t\t// (Note: This seems as fast or faster than elemArray = [].slice.call(elems); ...)\n\t\telemArray.push(elems[i]);\n\t}\n\ti = len;\n\twhile (i--) {\n\t\telem = elemArray[i];\n\t\tif (elem.parentNode) {\n\t\t\t// Has not already been removed from the DOM\n\t\t\tif (bindings = elem._jsvBnd) {\n\t\t\t\t// Get propertyChange bindings for this element\n\t\t\t\t// This may be an element with data-link, or the opening script marker node for a data-linked tag {^{...}}\n\t\t\t\t// bindings is a string with the syntax: \"(&bindingId)*\"\n\t\t\t\tbindings = bindings.slice(1).split(\"&\");\n\t\t\t\telem._jsvBnd = \"\";\n\t\t\t\tl = bindings.length;\n\t\t\t\twhile (l--) {\n\t\t\t\t\t// Remove associated bindings\n\t\t\t\t\tremoveViewBinding(bindings[l], elem._jsvLkEl, elem); // unbind bindings with this bindingId on this view\n\t\t\t\t}\n\t\t\t}\n\t\t\tdisposeTokens(markerNodeInfo(elem) + (elem._df || \"\"), elem);\n\t\t}\n\t}\n}\n\nfunction removeViewBinding(bindId, linkedElemTag, elem) {\n\t// Unbind\n\tvar objId, linkCtx, tag, object, obsId, tagCtxs, l, map, linkedElem, trigger, view, tagCtx, linkedElems, allLinkedElems,\n\t\tbinding = bindingStore[bindId];\n\n\tif (linkedElemTag) {\n\t\telem._jsvLkEl = undefined;\n\t} else if (binding && (!elem || elem === binding.elem)) { // Test that elem is actually binding.elem, since cloned elements can have inappropriate markerNode info\n\t\tdelete bindingStore[bindId]; // Delete already, so call to onDispose handler below cannot trigger recursive deletion (through recursive call to jQuery cleanData)\n\t\tfor (objId in binding.bnd) {\n\t\t\tif (object = binding.bnd[objId]) {\n\t\t\t\tobsId = binding.cbId;\n\t\t\t\tif ($isArray(object)) {\n\t\t\t\t\t$([object]).off(arrayChangeStr + obsId).off(propertyChangeStr + obsId); // There may be either or both of arrayChange and propertyChange\n\t\t\t\t} else {\n\t\t\t\t\t$(object).off(propertyChangeStr + obsId);\n\t\t\t\t}\n\t\t\t\tdelete binding.bnd[objId];\n\t\t\t}\n\t\t}\n\n\t\tif (linkCtx = binding.linkCtx) {\n\t\t\tif (tag = linkCtx.tag) {\n\t\t\t\tif (tagCtxs = tag.tagCtxs) {\n\t\t\t\t\tl = tagCtxs.length;\n\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\ttagCtx = tagCtxs[l];\n\t\t\t\t\t\tif (map = tagCtx.map) {\n\t\t\t\t\t\t\tmap.unmap(); //unobserve\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Copy linkedElems in case tag.linkedElem or tag.linkedElems are undefined in onUnbind\n\t\t\t\t\t\tif (linkedElems = tagCtx.linkedElems) {\n\t\t\t\t\t\t\tallLinkedElems = (allLinkedElems || []).concat(linkedElems);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (tag.onUnbind) {\n\t\t\t\t\ttag.onUnbind(tag.tagCtx, linkCtx, tag.ctx);\n\t\t\t\t}\n\t\t\t\tif (tag.onDispose) {\n\t\t\t\t\ttag.onDispose();\n\t\t\t\t}\n\n\t\t\t\tif (!tag._elCnt) {\n\t\t\t\t\tif (tag._prv) {\n\t\t\t\t\t\ttag._prv.parentNode.removeChild(tag._prv);\n\t\t\t\t\t}\n\t\t\t\t\tif (tag._nxt) {\n\t\t\t\t\t\ttag._nxt.parentNode.removeChild(tag._nxt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlinkedElems = allLinkedElems || [$(linkCtx.elem)];\n\t\t\tl = linkedElems.length;\n\t\t\twhile (l--) {\n\t\t\t\tlinkedElem = linkedElems[l];\n\t\t\t\tif (trigger = linkedElem && linkedElem[0] && linkedElem[0]._jsvTr) {\n\t\t\t\t\tbindTriggerEvent(linkedElem, trigger, \"off\");\n\t\t\t\t\tlinkedElem[0]._jsvTr = undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tview = linkCtx.view;\n\t\t\tif (view.type === \"link\") {\n\t\t\t\tview.parent.removeViews(view._.key, undefined, true); // A \"link\" view is associated with the binding, so should be disposed with binding.\n\t\t\t} else {\n\t\t\t\tdelete view._.bnds[bindId];\n\t\t\t}\n\t\t}\n\t\tdelete cbBindingsStore[binding.cbId];\n\t}\n}\n\nfunction $unlink(to) {\n\tif (to) {\n\t\tto = to.jquery ? to : $(to);\n\t\tto.each(function() {\n\t\t\tvar innerView;\n\t\t\t//TODO fix this for better perf. Rather that calling inner view multiple times which does querySelectorAll each time, consider a single querySelectorAll\n\t\t\t// or simply call view.removeViews() on the top-level views under the target 'to' node, then clean(...)\n\t\t\t// And/or replace each() by for() or while()\n\t\t\twhile ((innerView = $view(this, true)) && innerView.parent) {\n\t\t\t\tinnerView.parent.removeViews(innerView._.key, undefined, true);\n\t\t\t}\n\t\t\tclean(this.getElementsByTagName(\"*\"));\n\t\t});\n\t\tclean(to);\n\t} else {\n\t\t// Call to $.unlink() is equivalent to $.unlink(true, \"body\")\n\t\tif (activeBody) {\n\t\t\t$(activeBody)\n\t\t\t\t.off(elementChangeStr, onElemChange)\n\t\t\t\t.off('blur.jsv', '[contenteditable]', onElemChange);\n\t\t\tactiveBody = undefined;\n\t\t}\n\t\ttopView.removeViews();\n\t\tclean(document.body.getElementsByTagName(\"*\"));\n\t}\n}\n\n//========\n// Helpers\n//========\n\nfunction inputAttrib(elem) {\n\treturn elem.type === CHECKBOX ? elem[CHECKED] : elem.value;\n}\n\nfunction changeHandler(view, name, tag) {\n\t// Get onBeforeChange, onAfterChange, onAfterCreate handler - if there is one;\n\treturn tag && tag[name] || view.ctx[name] && view.ctxPrm(name) || $views.helpers[name];\n}\n\n//========================== Initialize ==========================\n\n//=====================\n// JsRender integration\n//=====================\n\naddLinkMethods($sub.View.prototype); // Modify the View prototype to include link methods\n\n$sub.onStore.template = function(name, item, parentTmpl) {\n\tif (item === null) {\n\t\tdelete $.link[name];\n\t\tdelete $.render[name];\n\t} else {\n\t\titem.link = tmplLink;\n\n\t\tif (name && !parentTmpl && name !== \"jsvTmpl\") {\n\t\t\t$.render[name] = item;\n\t\t\t$.link[name] = function() {\n\t\t\t\treturn tmplLink.apply(item, arguments);\n\t\t\t};\n\t\t}\n\t}\n};\n\n$sub.viewInfos = viewInfos; // Expose viewInfos() as public helper method\n\n// Define JsViews version of delimiters(), and initialize\n($viewsSettings.delimiters = function() {\n\t// Run delimiters initialization in context of jsrender.js\n\tvar ret = oldJsvDelimiters.apply(0, arguments);\n\n\tif (oldJsvDelimiters !== $viewsDelimiters) {\n\t\t// If JsRender was loaded before JsViews, then need also to initialize and set globals in that JsRender instance\n\t\tret = $viewsDelimiters.apply(0, arguments);\n\t}\n\n\t// Data-linking must use new delimiters\n\trTagDatalink = new RegExp(\"(?:^|\\\\s*)([\\\\w-]*)(\\\\\" + linkChar + \")?(\\\\\" + delimOpenChar1 + $sub.rTag + \"(:\\\\w*)?\\\\\" + delimCloseChar0 + \")\", \"g\");\n\treturn ret;\n})(); // jshint ignore:line\n\n$sub.addSetting(\"trigger\");\n\n//====================================\n// Additional members for linked views\n//====================================\n\nfunction transferViewTokens(prevNode, nextNode, parentElem, id, viewOrTagChar, refresh) {\n\t// Transfer tokens on prevNode of viewToRemove/viewToRefresh to nextNode or parentElem._df\n\t// view marker tokens: #m_...VIEW.../m_\n\t// tag marker tokens: #m^...TAG..../m^\n\n\tvar i, l, vwInfos, vwInfo, viewOrTag, viewId, tokens,\n\t\tprecedingLength = 0,\n\t\temptyView = prevNode === nextNode;\n\n\tif (prevNode) {\n\t\t// prevNode is either the first node in the viewOrTag, or has been replaced by the vwInfos tokens string\n\t\tvwInfos = viewInfos(prevNode) || [];\n\t\tfor (i = 0, l = vwInfos.length; i < l; i++) {\n\t\t\t// Step through views or tags on the prevNode\n\t\t\tvwInfo = vwInfos[i];\n\t\t\tviewId = vwInfo.id;\n\t\t\tif (viewId === id && vwInfo.ch === viewOrTagChar) {\n\t\t\t\tif (refresh) {\n\t\t\t\t\t// This is viewOrTagToRefresh, this is the last viewOrTag to process...\n\t\t\t\t\tl = 0;\n\t\t\t\t} else {\n\t\t\t\t\t// This is viewOrTagToRemove, so we are done...\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!emptyView) {\n\t\t\t\tviewOrTag = vwInfo.ch === \"_\"\n\t\t\t\t\t? viewStore[viewId] // A view: \"#m_\" or \"/m_\"\n\t\t\t\t\t: bindingStore[viewId].linkCtx.tag; // A tag \"#m^\" or \"/m^\"\n\t\t\t\tif (viewOrTag) {\n\t\t\t\t\tif (vwInfo.open) { // A \"#m_\" or \"#m^\" token\n\t\t\t\t\t\tviewOrTag._prv = nextNode;\n\t\t\t\t\t} else if (vwInfo.close) { // A \"/m_\" or \"/m^\" token\n\t\t\t\t\t\tviewOrTag._nxt = nextNode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tprecedingLength += viewId.length + 2;\n\t\t}\n\n\t\tif (precedingLength) {\n\t\t\tprevNode.setAttribute(jsvAttrStr, prevNode.getAttribute(jsvAttrStr).slice(precedingLength));\n\t\t}\n\t\ttokens = nextNode ? nextNode.getAttribute(jsvAttrStr) : parentElem._df;\n\t\tif (l = tokens.indexOf(\"/\" + id + viewOrTagChar) + 1) {\n\t\t\ttokens = vwInfos._tkns.slice(0, precedingLength) + tokens.slice(l + (refresh ? -1 : id.length + 1));\n\t\t}\n\t\tif (tokens) {\n\t\t\tif (nextNode) {\n\t\t\t\t// If viewOrTagToRemove was an empty viewOrTag, we will remove both #n and /n\n\t\t\t\t// (and any intervening tokens) from the nextNode (=== prevNode)\n\t\t\t\t// If viewOrTagToRemove was not empty, we will take tokens preceding #n from prevNode,\n\t\t\t\t// and concatenate with tokens following /n on nextNode\n\t\t\t\tnextNode.setAttribute(jsvAttrStr, tokens);\n\t\t\t} else {\n\t\t\t\tsetDefer(parentElem, tokens);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// !prevNode, so there may be a deferred nodes token on the parentElem. Remove it.\n\t\tsetDefer(parentElem, removeSubStr(parentElem._df, \"#\" + id + viewOrTagChar));\n\t\tif (!refresh && !nextNode) {\n\t\t\t// If this viewOrTag is being removed, and there was no .nxt, remove closing token from deferred tokens\n\t\t\tsetDefer(parentElem, removeSubStr(parentElem._df, \"/\" + id + viewOrTagChar));\n\t\t}\n\t}\n}\n\nfunction disposeTokens(tokens, elem) {\n\tvar i, l, vwItem, vwInfos;\n\tif (vwInfos = viewInfos(tokens, true, rOpenMarkers)) {\n\t\tfor (i = 0, l = vwInfos.length; i < l; i++) {\n\t\t\tvwItem = vwInfos[i];\n\t\t\tif (vwItem.ch === \"_\") {\n\t\t\t\tif ((vwItem = viewStore[vwItem.id]) && vwItem.type && (!elem || vwItem._prv === elem || vwItem.parentElem === elem )) {\n\t\t\t\t\t// If this is the _prv (prevNode) for a view, remove the view\n\t\t\t\t\t// - unless view.type is undefined, in which case it is already being removed\n\t\t\t\t\t// (or unless the elem is not related - e.g. a cloned element which 'accidentally' picked up the data-jsv atttribute of the ._df expando)\n\t\t\t\t\tvwItem.parent.removeViews(vwItem._.key, undefined, true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveViewBinding(vwItem.id, undefined, elem); // unbind bindings with this bindingId on this view\n\t\t\t}\n\t\t}\n\t}\n}\n\n//============================================\n// Add link methods to data-linked view or tag\n//============================================\n\nfunction updateValue(val, index, tagElse, async, bindId, ev) {\n// async, bindId and ev not documented - used internally, e.g. for paged and sorted arrays on tags with dataMap, such as {{for}}\n// Observably update a data value targeted by the binding.to binding of a 2way data-link binding. Called when elem changes\n// Called when linkedElem of a tag control changes: as updateValue(val, index, tagElse, bindId, ev) - this: undefined\n// Called directly as tag.updateValue(val, index, tagElse) - this: tag\n\tvar self = this,\n\t\tvalues = [];\n\tif (self && self._tgId) {\n\t\tbindId = self;\n\t}\n\tif (arguments.length < 4) {\n\t\tif (+index !== index) {\n\t\t\tasync = index;\n\t\t\ttagElse = index = 0;\n\t\t} else if (+tagElse !== tagElse) {\n\t\t\tasync = tagElse;\n\t\t\ttagElse = 0;\n\t\t}\n\t}\n\tvalues[index||0] = val;\n\tupdateValues(values, tagElse, async, bindId, ev);\n\treturn self;\n}\n\nfunction setValues() {\n\t// tagCtx.setValues() calls tag.setValue() on that tagCtx for each bindTo target\n\tvar m = this.tag.bindTo.length,\n\t\tev = arguments[m],\n\t\teventArgs = arguments[m+1];\n\twhile (m--) {\n\t\tthis.tag.setValue(arguments[m], m, this.index, ev, eventArgs);\n\t}\n}\n\nfunction addLinkMethods(tagOrView) { // tagOrView is View prototype or tag instance\n\n\tvar l, m, tagCtx, boundProps, bindFrom, key, theTag, theView;\n\n\ttagOrView.contents = function(deep, select) {\n\t\t// For a view, a tag or a tagCtx, return jQuery object with the content nodes,\n\t\tif (deep !== !!deep) {\n\t\t\t// deep not boolean, so this is contents(selector)\n\t\t\tselect = deep;\n\t\t\tdeep = undefined;\n\t\t}\n\t\tvar filtered,\n\t\t\tnodes = $(this.nodes());\n\t\tif (nodes[0]) {\n\t\t\tselect = deep ? select || \"*\" : select;\n\t\t\tfiltered = select ? nodes.filter(select) : nodes;\n\t\t\tnodes = deep ? filtered.add(nodes.find(select)) : filtered;\n\t\t}\n\t\treturn nodes;\n\t};\n\n\ttagOrView.nodes = function(withMarkers, prevNode, nextNode) {\n\t\t// For a view, a tag or a tagCtx, return top-level nodes\n\t\t// Do not return any script marker nodes, unless withMarkers is true\n\t\t// Optionally limit range, by passing in prevNode or nextNode parameters\n\n\t\tvar node,\n\t\t\tself = this.contentView || this, // If tagCtx, use tagCtx.contentView\n\t\t\telCnt = self._elCnt,\n\t\t\tprevIsFirstNode = !prevNode && elCnt,\n\t\t\tnodes = [];\n\n\t\tif (!self.args) { // If tagCtx with no content (so no contentView) self is tagCtx: return empty [];\n\t\t\tprevNode = prevNode || self._prv;\n\t\t\tnextNode = nextNode || self._nxt;\n\n\t\t\tnode = prevIsFirstNode\n\t\t\t\t? (prevNode === self._nxt\n\t\t\t\t\t? self.parentElem.lastSibling\n\t\t\t\t\t: prevNode)\n\t\t\t\t: (self.inline === false\n\t\t\t\t\t? prevNode || self.linkCtx.elem.firstChild\n\t\t\t\t\t: prevNode && prevNode.nextSibling);\n\n\t\t\twhile (node && (!nextNode || node !== nextNode)) {\n\t\t\t\tif (withMarkers || elCnt || node.tagName !== SCRIPT) {\n\t\t\t\t\t// All the top-level nodes in the view\n\t\t\t\t\t// (except script marker nodes, unless withMarkers = true)\n\t\t\t\t\t// (Note: If a script marker node, viewInfo.elCnt undefined)\n\t\t\t\t\tnodes.push(node);\n\t\t\t\t}\n\t\t\t\tnode = node.nextSibling;\n\t\t\t}\n\t\t}\n\t\treturn nodes;\n\t};\n\n\ttagOrView.childTags = function(deep, tagName) {\n\t\t// For a view, a tag or a tagCtx, return child tags - at any depth, or as immediate children only.\n\t\tif (deep !== !!deep) {\n\t\t\t// deep not boolean, so this is childTags(tagName) - which looks for top-level tags of given tagName\n\t\t\ttagName = deep;\n\t\t\tdeep = undefined;\n\t\t}\n\n\t\tvar self = this.contentView || this, // If tagCtx, use tagCtx.contentView\n\t\t\tview = self.link ? self : self.tagCtx.view, // This may be a view or a tag. If a tag, get the view from tag.tagCtx.view\n\t\t\tprevNode = self._prv,\n\t\t\telCnt = self._elCnt,\n\t\t\ttags = [];\n\n\t\tif (!self.args) { // If tagCtx with no content (so no contentView) self is tagCtx: return empty [];\n\t\t\tview.link(\n\t\t\t\tundefined,\n\t\t\t\tself.parentElem,\n\t\t\t\telCnt ? prevNode && prevNode.previousSibling : prevNode,\n\t\t\t\tself._nxt,\n\t\t\t\tundefined,\n\t\t\t\t{get:{\n\t\t\t\t\ttags: tags,\n\t\t\t\t\tdeep: deep,\n\t\t\t\t\tname: tagName,\n\t\t\t\t\tid: self.link ? self._.id + \"_\" : self._tgId + \"^\"\n\t\t\t\t}}\n\t\t\t);\n\t\t}\n\t\treturn tags;\n\t};\n\n\tif (tagOrView._is === \"tag\") {\n\t\t//=======================\n\t\t// This is a TAG instance\n\t\t//=======================\n\n\t\ttheTag = tagOrView;\n\n\t\tm = theTag.tagCtxs.length;\n\t\twhile (m--) {\n\t\t\ttagCtx = theTag.tagCtxs[m];\n\n\t\t\ttagCtx.setValues = setValues;\n\t\t\ttagCtx.contents = tagOrView.contents;\n\t\t\ttagCtx.childTags = tagOrView.childTags;\n\t\t\ttagCtx.nodes = tagOrView.nodes;\n\t\t}\n\n\t\tboundProps = theTag.boundProps = theTag.boundProps || [];\n\t\tif (bindFrom = theTag.bindFrom) {\n\t\t\tl = bindFrom.length;\n\t\t\twhile (l--) {\n\t\t\t\tkey = bindFrom[l];\n\t\t\t\tif (typeof key === STRING) {\n\t\t\t\t\tbindFrom[key] = 1;\n\t\t\t\t\tif ($inArray(key, boundProps) < 0) {\n\t\t\t\t\t\tboundProps.push(key); // Add any 'bindFrom' props to boundProps array. (So two-way binding works without writing ^foo=expression)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttheTag.setValue = $sub._gm( // getMethod\n\t\t\ttheTag.constructor.prototype.setValue || function(val) { // base method\n\t\t\t\treturn val;\n\t\t\t},\n\t\t\tfunction(val, indexFrom, tagElse, ev, eventArgs) {\n\t\t\t\tindexFrom = indexFrom || 0;\n\t\t\t\ttagElse = tagElse || 0;\n\n\t\t\t\tvar linkedElem, linkedEl, linkedCtxParam, indexTo, linkedElems, newVal,\n\t\t\t\t\ttagCtx = theTag.tagCtxs[tagElse];\n\n\t\t\t\tif (tagCtx._bdArgs && (eventArgs || val !== undefined) && tagCtx._bdArgs[indexFrom]===val\n\t\t\t\t\t&& (!eventArgs || eventArgs.change !== \"set\" || ev.target !== val && eventArgs.value !== val)) {\n\n\t\t\t\t\tif (tagCtx._bdVals) { // If val is not undefined (or is coming from an observable change event), and is a value that was already returned, use stored value and don't call tag.setValue()\n\t\t\t\t\t\tval = tagCtx._bdVals[indexFrom];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Call tag method tag.setValue(), if implemented\n\t\t\t\t\ttagCtx._bdArgs = tagCtx._bdArgs || [];\n\t\t\t\t\ttagCtx._bdArgs[indexFrom] = val;\n\t\t\t\t\tnewVal = theTag.base.call(theTag, val, indexFrom, tagElse, ev, eventArgs);\n\t\t\t\t\tif (newVal !== undefined) {\n\t\t\t\t\t\ttagCtx._bdVals = tagCtx._bdVals || [];\n\t\t\t\t\t\ttagCtx._bdVals[indexFrom] = newVal; // store value, so that if same value is called later we'll use the stored value, and won't call tag.setValue()\n\t\t\t\t\t\tval = newVal;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (val !== undefined && (linkedCtxParam = theTag.linkedCtxParam) && linkedCtxParam[indexFrom]) {\n\t\t\t\t\t\t// If this setValue call corresponds to a tag contextual parameter and the tag has a converter, then we need to set the\n\t\t\t\t\t\t// value of this contextual parameter (since it is not directly bound to the tag argument/property when there is a converter).\n\t\t\t\t\ttagCtx.ctxPrm(linkedCtxParam[indexFrom], val);\n\t\t\t\t}\n\t\t\t\tindexTo = theTag._.toIndex[indexFrom];\n\t\t\t\tif (indexTo !== undefined) {\n\t\t\t\t\tif (linkedElems = tagCtx.linkedElems || theTag.linkedElem && [theTag.linkedElem]) {\n\t\t\t\t\t\tif ((linkedElem = linkedElems[indexTo]) && (l = linkedElem.length)) {\n\t\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\t\tlinkedEl = linkedElem[l];\n\t\t\t\t\t\t\t\tif (val !== undefined && !linkedEl._jsvChg && theTag.linkCtx._val !== val) {\n\t\t\t\t\t\t\t\t\tif (linkedEl.value !== undefined) {\n\t\t\t\t\t\t\t\t\t\tif (linkedEl.type === CHECKBOX) {\n\t\t\t\t\t\t\t\t\t\t\tlinkedEl[CHECKED] = $.isArray(val)\n\t\t\t\t\t\t\t\t\t\t\t\t? $.inArray(linkedEl.value, val) > -1\n\t\t\t\t\t\t\t\t\t\t\t\t: val && val !== \"false\";\n\t\t\t\t\t\t\t\t\t\t} else if (linkedEl.type === RADIO) {\n\t\t\t\t\t\t\t\t\t\t\tlinkedEl[CHECKED] = (linkedEl.value === val);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$(linkedEl).val(val); // Use jQuery for attrHooks - can't just set value (on select, for example)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlinkedEl[linkedEl.contentEditable === TRUE ? \"innerHTML\" : TEXTCONTENT] = val;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (tagCtx.props.name) {\n\t\t\t\t\t\t\t\t\tlinkedEl.name = linkedEl.name || tagCtx.props.name;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn theTag;\n\t\t\t}\n\t\t);\n\t\ttheTag.updateValue = updateValue;\n\n\t\ttheTag.updateValues = function() {\n\t\t\tvar tagElse, async,\n\t\t\t\ttag = this,\n\t\t\t\tbindToLength = tag.bindTo ? tag.bindTo.length : 1,\n\t\t\t\textra = arguments.length - bindToLength;\n\n\t\t\tif (extra) {\n\t\t\t\ttagElse = arguments[bindToLength];\n\t\t\t\tif (extra > 1) {\n\t\t\t\t\tasync = extra > 1 ? arguments[bindToLength + 1] : undefined;\n\t\t\t\t} else if (+tagElse !== tagElse) {\n\t\t\t\t\tasync = tagElse;\n\t\t\t\t\ttagElse = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn updateValues(arguments, tagElse, async, this);\n\t\t};\n\n\t\ttheTag.setValues = function() {\n\t\t// tag.setValues(a, b, c) calls tagCtx.setValues(a, b, c) on the first tagCtx\n\t\t\tsetValues.apply(theTag.tagCtx, arguments);\n\t\t\treturn theTag;\n\t\t};\n\n\t\ttheTag.refresh = function() {\n\t\t\tvar attr, sourceValue,\n\t\t\t\tlinkCtx = theTag.linkCtx,\n\t\t\t\tview = theTag.tagCtx.view;\n\n\t\t\tif (!(sourceValue = mergeCtxs(theTag))) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (theTag.onUnbind) {\n\t\t\t\ttheTag.onUnbind(theTag.tagCtx, linkCtx, theTag.ctx);\n\t\t\t\ttheTag._.unlinked = true;\n\t\t\t}\n\t\t\tattr = theTag.inline ? HTML : (linkCtx.attr || defaultAttr(theTag.parentElem, true));\n\t\t\tsourceValue = theTag.tagName === \":\"\n\t\t\t\t? $sub._cnvt(theTag.convert, view, theTag.tagCtx)\n\t\t\t\t: $sub._tag(theTag, view, view.tmpl, sourceValue, true); // Get rendered HTML for tag, based on refreshed tagCtxs\n\n\t\t\tobserveAndBind(linkCtx, linkCtx.data, linkCtx.elem);\n\t\t\tupdateContent(sourceValue, linkCtx, attr, theTag);\n\t\t\tcallAfterLink(theTag);\n\t\t\treturn theTag;\n\t\t};\n\n\t\ttheTag.domChange = function() { // domChange notification support\n\t\t\tvar elem = this.parentElem,\n\t\t\t\thasListener = $._data(elem).events,\n\t\t\t\tdomChangeNotification = \"jsv-domchange\";\n\n\t\t\tif (hasListener && hasListener[domChangeNotification]) {\n\t\t\t\t// Only trigger handler if there is a handler listening for this event. (Note using triggerHandler - so no event bubbling.)\n\t\t\t\t$(elem).triggerHandler(domChangeNotification, arguments);\n\t\t\t}\n\t\t};\n\n\t\t//====================================\n\t\t// End of added link methods for TAG\n\t\t//====================================\n\t} else {\n\t\t//=========================\n\t\t// This is a VIEW prototype\n\t\t//=========================\n\n\t\ttheView = tagOrView;\n\n\t\t// Note: a linked view will also, after linking have nodes[], _prv (prevNode), _nxt (nextNode) ...\n\t\ttheView.addViews = function(index, dataItems, delayed) {\n\t\t\t// if view is not an array view, do nothing\n\t\t\tvar i, viewsCount,\n\t\t\t\tview = this,\n\t\t\t\titemsCount = dataItems.length,\n\t\t\t\tviews = view.views;\n\n\t\t\tif (!view._.useKey && itemsCount) {\n\t\t\t\t// view is of type \"array\"\n\t\t\t\tviewsCount = views.length + itemsCount;\n\n\t\t\t\tif ((delayed || viewsCount === view.data.length) // If delayed or if views not already synced to array (e.g. triggered by array.length propertyChange - jsviews/issues/301)\n\t\t\t\t\t&& renderAndLink(view, index, view.tmpl, views, dataItems, view.ctx) !== false\n\t\t\t\t\t&& !view._.srt) { // Not part of a 'sort' on refresh\n\t\t\t\t\tview.fixIndex(index + itemsCount);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\ttheView.removeViews = function(index, itemsCount, keepNodes, delayed) {\n\t\t\t// view.removeViews() removes all the child views\n\t\t\t// view.removeViews(index) removes the child view with specified index or key\n\t\t\t// view.removeViews(index, count) removes the specified nummber of child views, starting with the specified index\n\t\t\tfunction removeView(index) {\n\t\t\t\tvar id, bindId, parentElem, prevNode, nextNode, nodesToRemove,\n\t\t\t\t\tviewToRemove = views[index];\n\n\t\t\t\tif (viewToRemove && viewToRemove.link) {\n\t\t\t\t\tid = viewToRemove._.id;\n\t\t\t\t\tif (!keepNodes) {\n\t\t\t\t\t\t// Remove the HTML nodes from the DOM, unless they have already been removed, including nodes of child views\n\t\t\t\t\t\tnodesToRemove = viewToRemove.nodes();\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove child views, without removing nodes\n\t\t\t\t\tviewToRemove.removeViews(undefined, undefined, true);\n\n\t\t\t\t\tviewToRemove.type = undefined; // Set type to undefined: used as a flag that this view is being removed\n\t\t\t\t\tprevNode = viewToRemove._prv;\n\t\t\t\t\tnextNode = viewToRemove._nxt;\n\t\t\t\t\tparentElem = viewToRemove.parentElem;\n\t\t\t\t\t// If prevNode and nextNode are the same, the view is empty\n\t\t\t\t\tif (!keepNodes) {\n\t\t\t\t\t\t// Remove the HTML nodes from the DOM, unless they have already been removed, including nodes of child views\n\t\t\t\t\t\tif (viewToRemove._elCnt) {\n\t\t\t\t\t\t\t// if keepNodes is false (and transferring of tokens has not already been done at a higher level)\n\t\t\t\t\t\t\t// then transfer tokens from prevNode which is being removed, to nextNode.\n\t\t\t\t\t\t\ttransferViewTokens(prevNode, nextNode, parentElem, id, \"_\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$(nodesToRemove).remove();\n\t\t\t\t\t}\n\t\t\t\t\tif (!viewToRemove._elCnt && prevNode) {\n\t\t\t\t\t\tprevNode.parentNode.removeChild(prevNode); // (prevNode.parentNode is parentElem, except if jQuery Mobile or similar has inserted an intermediate wrapper\n\t\t\t\t\t\tnextNode.parentNode.removeChild(nextNode);\n\t\t\t\t\t}\n\t\t\t\t\tsetArrayChangeLink(viewToRemove);\n\t\t\t\t\tfor (bindId in viewToRemove._.bnds) {\n\t\t\t\t\t\tremoveViewBinding(bindId);\n\t\t\t\t\t}\n\t\t\t\t\tdelete viewStore[id];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar current, childView, viewsCount,\n\t\t\t\tview = this,\n\t\t\t\tisArray = !view._.useKey,\n\t\t\t\tviews = view.views;\n\n\t\t\tif (isArray) {\n\t\t\t\tviewsCount = views.length;\n\t\t\t}\n\t\t\tif (index === undefined) {\n\t\t\t\t// Remove all child views\n\t\t\t\tif (isArray) {\n\t\t\t\t\t// views and data are arrays\n\t\t\t\t\tcurrent = viewsCount;\n\t\t\t\t\twhile (current--) {\n\t\t\t\t\t\tremoveView(current);\n\t\t\t\t\t}\n\t\t\t\t\tview.views = [];\n\t\t\t\t} else {\n\t\t\t\t\t// views and data are objects\n\t\t\t\t\tfor (childView in views) {\n\t\t\t\t\t\t// Remove by key\n\t\t\t\t\t\tremoveView(childView);\n\t\t\t\t\t}\n\t\t\t\t\tview.views = {};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (itemsCount === undefined) {\n\t\t\t\t\tif (isArray) {\n\t\t\t\t\t\t// The parentView is data array view.\n\t\t\t\t\t\t// Set itemsCount to 1, to remove this item\n\t\t\t\t\t\titemsCount = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Remove child view with key 'index'\n\t\t\t\t\t\tremoveView(index);\n\t\t\t\t\t\tdelete views[index];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isArray && itemsCount\n\t\t\t\t\t&& (delayed || viewsCount - itemsCount === view.data.length)) { // If views not already synced to array (e.g. triggered by array.length propertyChange - jsviews/issues/301)\n\t\t\t\t\tcurrent = index + itemsCount;\n\t\t\t\t\t// Remove indexed items (parentView is data array view);\n\t\t\t\t\twhile (current-- > index) {\n\t\t\t\t\t\tremoveView(current);\n\t\t\t\t\t}\n\t\t\t\t\tviews.splice(index, itemsCount);\n\t\t\t\t\tif (!view._.srt) {\n\t\t\t\t\t\tview.fixIndex(index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\ttheView.moveViews = function(oldIndex, index, itemsCount) {\n\t\t\tfunction parts(itemView, str) { // Get the totkens preceding the 'open' token for this view, #n_, and the tokens following (and including) the 'open' token\n\t\t\t\treturn RegExp(\"^(.*)(\" + (str ? \"\\\\/\" : \"#\") + itemView._.id + \"_.*)$\").exec(str || itemView._prv.getAttribute(jsvAttrStr));\n\t\t\t}\n\t\t\tfunction setPrv(itemView, tokens) {\n\t\t\t\tvar tag,\n\t\t\t\t\tprv = itemView._prv;\n\t\t\t\tprv.setAttribute(jsvAttrStr, tokens);\n\t\t\t\ttokens.replace(rTagMarkers, function(all, open, close, id) {\n\t\t\t\t\ttag = bindingStore[id].linkCtx.tag;\n\t\t\t\t\tif (tag.inline) {\n\t\t\t\t\t\ttag[open ? \"_prv\" : \"_nxt\"] = prv;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\ttokens.replace(rViewMarkers, function(all, open, close, id) {\n\t\t\t\t\tviewStore[id][open ? \"_prv\" : \"_nxt\"] = prv;\n\t\t\t\t});\n\t\t\t}\n\t\t\tvar nodes, childView, nxtView, insertBefore, viewId,\n\t\t\t\tview = this,\n\t\t\t\tselfNxt = view._nxt,\n\t\t\t\tviews = view.views,\n\t\t\t\tbackwards = index < oldIndex,\n\t\t\t\tfirstChange = backwards ? index : oldIndex,\n\t\t\t\tlastChange = backwards ? oldIndex : index,\n\t\t\t\ti = index,\n\t\t\t\tmovedNodes = [],\n\n\t\t\t\tviewsToMove = views.splice(oldIndex, itemsCount); // remove\n\n\t\t\tif (index > views.length) {\n\t\t\t\tindex = views.length;\n\t\t\t}\n\t\t\tviews.splice.apply(views, [index, 0].concat(viewsToMove)); //re-insert\n\n\t\t\titemsCount = viewsToMove.length;\n\t\t\tinsertBefore = index + itemsCount;\n\t\t\tlastChange += itemsCount;\n\n\t\t\tfor (i; i < insertBefore; i++) {\n\t\t\t\tchildView = views[i];\n\t\t\t\tnodes = childView.nodes(true);\n\t\t\t\tmovedNodes = view._elCnt ? movedNodes.concat(nodes) : movedNodes.concat(childView._prv, nodes, childView._nxt);\n\t\t\t}\n\t\t\tmovedNodes = $(movedNodes);\n\n\t\t\tif (insertBefore < views.length) {\n\t\t\t\tmovedNodes.insertBefore(views[insertBefore]._prv);\n\t\t\t} else if (selfNxt) {\n\t\t\t\tmovedNodes.insertBefore(selfNxt);\n\t\t\t} else {\n\t\t\t\tmovedNodes.appendTo(view.parentElem);\n\t\t\t}\n\n\t\t\tif (view._elCnt) {\n\t\t\t\tvar afterParts,\n\t\t\t\t\tendChange = backwards ? firstChange + itemsCount : lastChange - itemsCount,\n\t\t\t\t\tbeforeView = views[firstChange-1],\n\t\t\t\t\tstartView = views[firstChange],\n\t\t\t\t\tendView = views[endChange],\n\t\t\t\t\tafterView = views[lastChange],\n\t\t\t\t\tstartParts = parts(startView),\n\t\t\t\t\tendParts = parts(endView);\n\n\t\t\t\tsetPrv(startView, endParts[1] + startParts[2]);\n\t\t\t\tif (afterView) {\n\t\t\t\t\tafterParts = parts(afterView);\n\t\t\t\t\tsetPrv(afterView, startParts[1] + afterParts[2]);\n\t\t\t\t} else {\n\t\t\t\t\tviews[lastChange-1]._nxt = selfNxt;\n\t\t\t\t\tif (selfNxt) {\n\t\t\t\t\t\tafterParts = parts(view, selfNxt.getAttribute(jsvAttrStr));\n\t\t\t\t\t\tselfNxt.setAttribute(jsvAttrStr, startParts[1] + afterParts[2]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tafterParts = parts(view, view.parentElem._df);\n\n\t\t\t\t\t\tsetDefer(view.parentElem, startParts[1] + afterParts[2]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsetPrv(endView, afterParts[1] + endParts[2]);\n\t\t\t}\n\t\t\tview.fixIndex(firstChange);\n\t\t};\n\n\t\ttheView.refresh = function() {\n\t\t\tvar view = this,\n\t\t\t\tparent = view.parent;\n\n\t\t\tif (parent) {\n\t\t\t\trenderAndLink(view, view.index, view.tmpl, parent.views, view.data, undefined, true);\n\t\t\t\tsetArrayChangeLink(view);\n\t\t\t}\n\t\t\treturn view;\n\t\t};\n\n\t\ttheView.fixIndex = function(fromIndex) {\n\t\t\t// Fixup index on following view items...\n\t\t\tvar views = this.views,\n\t\t\t\tindex = views.length;\n\t\t\twhile (fromIndex < index--) {\n\t\t\t\tif (views[index].index !== index) {\n\t\t\t\t\t$observable(views[index]).setProperty(\"index\", index);\n\t\t\t\t\t// This is fixing up index, but not key, and not index on child views. From child views, use view.getIndex()\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\ttheView.link = viewLink;\n\n\t\t//====================================\n\t\t// End of added link methods for VIEW\n\t\t//====================================\n\t}\n}\n\n//========================\n// JsViews-specific converters\n//========================\n\n$converters.merge = function(val) {\n\t// Special converter used in data-linking to space-separated lists, such as className:\n\t// Currently only supports toggle semantics - and has no effect if toggle string is not specified\n\t// data-link=\"class{merge:boolExpr toggle=className}\"\n\tvar regularExpression,\n\t\tcurrentValue = this.linkCtx.elem.className,\n\t\ttoggle = this.tagCtx.props.toggle;\n\n\tif (toggle) {\n\t\t// We are toggling the class specified by the toggle property,\n\t\t// and the boolean val binding is driving the insert/remove toggle\n\n\t\tregularExpression = toggle.replace(/[\\\\^$.|?*+()[{]/g, \"\\\\$&\");\n\t\t// Escape any regular expression special characters (metacharacters) within the toggle string\n\t\tregularExpression = \"(\\\\s(?=\" + regularExpression + \"$)|(\\\\s)|^)(\" + regularExpression + \"(\\\\s|$))\";\n\t\t// Example: /(\\s(?=myclass$)|(\\s)|^)?(myclass(\\s|$))/ - so matches (\" myclass\" or \" \" or ^ ) followed by (\"myclass \" or \"myclass$\") where ^/$ are beginning/end of string\n\t\tcurrentValue = currentValue.replace(new RegExp(regularExpression), \"$2\");\n\t\tval = currentValue + (val ? (currentValue && \" \") + toggle : \"\");\n\t}\n\treturn val;\n};\n\n//========================\n// JsViews-specific tags\n//========================\n\n$tags({\n\ton: {\n\t\tattr: NONE,\n\t\tbindTo: [], // Don't need to bind to first arg, so prevent the default [0] binding\n\t\tinit: function(tagCtx) {\n\t\t\tvar content,\n\t\t\t\ttag = this,\n\t\t\t\ti = 0,\n\t\t\t\targs = tagCtx.args, // [events,] [selector,] handler\n\t\t\t\tl = args.length;\n\n\t\t\tfor (; ii && i+1; // handler index\n\t\t\tif (tag.inline) {\n\t\t\t\tif (!$sub.rTmpl.exec(content = $.trim(tagCtx.tmpl.markup))) {\n\t\t\t\t\t// Inline {^{on}} tag with no content (or external template content) or with content containing\n\t\t\t\t\t// no HTML or JsRender tags: We will wrap the (text) content, or the operation name in a element\n\t\t\t\t\t// (Otherwise we will attach the handler to the element content after data-linking)\n\t\t\t\t\ttag.template = \"\" + (content || tagCtx.params.args[i] || \"noop\") + \" \";\n\t\t\t\t}\n\t\t\t\ttag.attr = HTML;\n\t\t\t}\n\t\t},\n\t\tonBind: function() {\n\t\t\tif (this.template) { // {^{on/}} with no content has template rendering . Make it the mainElem, so we can set id, size or class\n\t\t\t\tthis.mainElem = this.contents(\"button\");\n\t\t\t}\n\t\t},\n\t\tonAfterLink: function(tagCtx, linkCtx) {\n\t\t\tvar handler, params, find, activeElem,\n\t\t\t\ttag = this,\n\t\t\t\ti = tag._hi,\n\t\t\t\targs = tagCtx.args, // [events,] [selector,] handler\n\t\t\t\tl = args.length,\n\t\t\t\tprops = tagCtx.props,\n\t\t\t\tdata = props.data,\n\t\t\t\tview = tagCtx.view,\n\t\t\t\tcontextOb = props.context; // Context ('this' pointer) for attached handler\n\n\t\t\tif (i) { // There is a handler\n\t\t\t\thandler = args[i-1];\n\t\t\t\tparams = args.slice(i); // Subsequent args are params\n\t\t\t\targs = args.slice(0, i-1); // Preceding args (if any) are events and selector\n\t\t\t\ttag._sel = args[1]; // Selector for descendant elements - for delegated events on those elements, delegating to the activeElem\n\n\t\t\t\tactiveElem = tag.activeElem = tag.activeElem || $(tag.inline\n\t\t\t\t\t? (tag._sel = args[1] || \"*\", tag.parentElem)\n\t\t\t\t\t// If inline, attach to child elements of tag parent element (filtered by selector argument if provided.\n\t\t\t\t\t// (In handler we'll filter out events from sibling elements preceding or following tag.)\n\t\t\t\t\t// This allows us to use the delegated pattern where the attached event works even for added elements satisfying the selector\n\t\t\t\t\t: linkCtx.elem);\n\n\t\t\t\tif (!contextOb) {\n\t\t\t\t\t// Get the path for the preceding object (context object) of handler (which is the last arg), compile function\n\t\t\t\t\t// to return that context object, and run compiled function against data\n\t\t\t\t\tcontextOb = /^(.*)[.^][\\w$]+$/.exec(tagCtx.params.args.slice(-params.length - 1)[0]);\n\t\t\t\t\tcontextOb = contextOb && $sub.tmplFn(delimOpenChar1 + \":\" + contextOb[1] + delimCloseChar0, view.tmpl, true)(linkCtx.data, view, $sub);\n\t\t\t\t}\n\n\t\t\t\tif (tag._evs) {\n\t\t\t\t\ttag.onUnbind(tagCtx, linkCtx, tag.ctx);\n\t\t\t\t}\n\n\t\t\t\tactiveElem.on(\n\t\t\t\t\ttag._evs = args[0] || \"click\", // events defaults to \"click\"\n\t\t\t\t\ttag._sel,\n\t\t\t\t\tdata == undefined ? null : data,\n\t\t\t\t\ttag._hlr = function hndlr(ev) {\n\t\t\t\t\t\tvar nodes, length,\n\t\t\t\t\t\t\tfound = !tag.inline;\n\n\t\t\t\t\t\tif (!found) { // If inline, filter out events from sibling elements preceding or following tag.\n\t\t\t\t\t\t\tnodes = tag.contents(\"*\");\n\t\t\t\t\t\t\tl = nodes.length;\n\t\t\t\t\t\t\twhile (!found && l--) {\n\t\t\t\t\t\t\t\tif (nodes[l].contains(ev.target)) {\n\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (found) { // target elem is indeed within the tag, so call the {on} handler\n\t\t\t\t\t\t\treturn handler.apply(contextOb || linkCtx.data, [].concat(\n\t\t\t\t\t\t\t\tparams, // e.g. par1, par2\n\t\t\t\t\t\t\t\tev,\n\t\t\t\t\t\t\t\t{change: ev.type, view: view, linkCtx: linkCtx},\n\t\t\t\t\t\t\t\tparams.slice.call(arguments, 1) // If triggering event (e.g. jsv-domchange) has additional arguments after ev, pass them too\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t// for {on 'click' handler par1 par2} use handler(par1, par2, ev, domchangeEventArgs)\n\t\t\t\t\t\t\t// for {on 'jsv-domchange' handler par1 par2} use handler(par1, par2, ev, domchangeEventArgs, tagCtx, linkCtx, observableEventArgs)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\tonUpdate: false,\n\t\tonArrayChange: false,\n\t\tonUnbind: function() {\n\t\t\tvar self = this,\n\t\t\t\toldIsCleanCall = isCleanCall;\n\t\t\tif (self.activeElem) {\n\t\t\t\tisCleanCall = 0; // Needed when using jquery-1.x, to avoid bug where jQuery calls cleanData on elements that are not being removed\n\t\t\t\tself.activeElem.off(self._evs, self._sel, self._hlr);\n\t\t\t\tisCleanCall = oldIsCleanCall;\n\t\t\t}\n\t\t},\n\t\tcontentCtx: true,\n\t\tsetSize: true,\n\t\tdataBoundOnly: true\n\t},\n\tradiogroup: {\n\t\tboundProps: [\"disabled\"],\n\t\tinit: function(tagCtx) {\n\t\t\tthis.name = tagCtx.props.name || (Math.random() + \"jsv\").slice(9);\n\t\t},\n\t\tonBind: function(tagCtx, linkCtx) {\n\t\t\tvar domChngCntnr, $linkedElem, l,\n\t\t\t\ttag = this,\n\t\t\t\tuseDisable = tagCtx.params.props;\n\t\t\tuseDisable = useDisable && useDisable.disabled;\n\t\t\tif (tag.inline) {\n\t\t\t\t// If the first element is owned by (rendered by) this tag (not by a childTag such as {^{for}})\n\t\t\t\t// use it as container for detecting dom changes\n\t\t\t\tdomChngCntnr = tag.contents(\"*\")[0];\n\t\t\t\tdomChngCntnr = domChngCntnr && $view(domChngCntnr).ctx.tag === tag.parent ? domChngCntnr : tag.parentElem;\n\t\t\t\t$linkedElem = tag.contents(true, RADIOINPUT);\n\t\t\t} else {\n\t\t\t\tdomChngCntnr = linkCtx.elem;\n\t\t\t\t$linkedElem = $(RADIOINPUT, linkCtx.elem);\n\t\t\t}\n\t\t\ttag.linkedElem = $linkedElem;\n\t\t\tl = $linkedElem.length;\n\t\t\twhile (l--) {\n\t\t\t\t// Configure the name for each radio input element\n\t\t\t\t$linkedElem[l].name = $linkedElem[l].name || tag.name;\n\t\t\t}\n\t\t\t// Establish a domchange listener in case this radiogroup wraps a {^{for}} or {^{if}} or similar\n\t\t\t// which might dynamically insert new radio input elements\n\t\t\t$(domChngCntnr).on(\"jsv-domchange\", tag._dmChg = function(ev, forOrIfTagCtx, linkCtx, eventArgs) {\n\t\t\t\tvar linkedElem, val,\n\t\t\t\t\tparentTags = forOrIfTagCtx.ctx.parentTags;\n\t\t\t\tif (!eventArgs.refresh &&\n\t\t\t\t\t(!tag.inline ||\n\t\t\t\t\t\tdomChngCntnr !== tag.parentElem ||\n\t\t\t\t\t\t// If the tag is inline, and the domChngCntnr is the parentElem, then we need to\n\t\t\t\t\t\t// make sure dom change event is fora content change within this tag, not outside it.\n\t\t\t\t\t\tparentTags && parentTags[tag.tagName] === tag\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\t// Contents have changed so recreate $linkedElem for the radio input elements (including possible new one just inserted)\n\t\t\t\t\tval = tag.cvtArgs()[0];\n\t\t\t\t\t$linkedElem = tag.linkedElem = tag.contents(true, RADIOINPUT);\n\t\t\t\t\tl = $linkedElem.length;\n\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t// Configure binding and name for each radio input element\n\t\t\t\t\t\tlinkedElem = $linkedElem[l];\n\t\t\t\t\t\tlinkedElem._jsvLkEl = tag;\n\t\t\t\t\t\tlinkedElem.name = linkedElem.name || tag.name;\n\t\t\t\t\t\tlinkedElem._jsvBnd = \"&\" + tag._tgId + \"+\";\n\t\t\t\t\t\tlinkedElem.checked = val === linkedElem.value;\n\t\t\t\t\t\tif (useDisable) {\n\t\t\t\t\t\t\tlinkedElem.disabled = !!tagCtx.props.disabled;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttag.linkedElems = tagCtx.linkedElems = [$linkedElem];\n\t\t\t\t}\n\t\t\t});\n\t\t\ttag._dmChg.tgt = domChngCntnr; // Used to remove listener in onUnbind\n\t\t},\n\t\tonAfterLink: function(tagCtx, linkCtx, ctx, ev, eventArgs) {\n\t\t\tvar propParams = tagCtx.params.props;\n\t\t\tif (propParams && propParams.disabled) {\n\t\t\t\tthis.linkedElem.prop(\"disabled\", !!tagCtx.props.disabled);\n\t\t\t}\n\t\t},\n\t\tonUnbind: function() {\n\t\t\tvar tag = this;\n\t\t\tif (tag._dmChg) {\n\t\t\t\t$(tag._dmChg.tgt).off(\"jsv-domchange\", tag._dmChg); // Remove listener\n\t\t\t\ttag._dmChg = undefined;\n\t\t\t}\n\t\t},\n\t\tonUpdate: false, // don't rerender\n\t\tcontentCtx: true,\n\t\tdataBoundOnly: true\n\t},\n\tcheckboxgroup: {\n\t\tboundProps: [\"disabled\"],\n\t\tinit: function(tagCtx) {\n\t\t\tthis.name = tagCtx.props.name || (Math.random() + \"jsv\").slice(9);\n\t\t},\n\t\tonBind: function(tagCtx, linkCtx) {\n\t\t\tvar domChngCntnr,\n\t\t\t\ttag = this,\n\t\t\t\ttgCtxProps = tagCtx.params.props,\n\t\t\t\tuseDisable = tgCtxProps && tgCtxProps.disabled,\n\t\t\t\tlinkExpr = tagCtx.params.args[0],\n\t\t\t\t$linkedElem = tag.contents(true, CHECKBOXINPUT),\n\t\t\t\tl = $linkedElem.length;\n\t\t\twhile (l--) {\n\t\t\t\t// Configure the name for each checkbox input element\n\t\t\t\t$linkedElem[l].name = $linkedElem[l].name || tag.name;\n\t\t\t\t$linkedElem[l]._jsvLkEl = tag;\n\t\t\t}\n\t\t\tfor (l in tgCtxProps) {\n\t\t\t\tlinkExpr += \" \" + l + \"=\" + tgCtxProps[l];\n\t\t\t}\n\t\t\t$linkedElem.link(linkExpr, linkCtx.data, undefined, undefined, linkCtx.view);\n\t\t\ttag.linkedElem = $linkedElem;\n\t\t\tif (tag.inline) {\n\t\t\t\t// If the first element is owned by (rendered by) this tag (not by a childTag such as {^{for}})\n\t\t\t\t// use it as container for detecting dom changes\n\t\t\t\tdomChngCntnr = tag.contents(\"*\")[0];\n\t\t\t\tdomChngCntnr = domChngCntnr && $.view(domChngCntnr).ctx.tag === tag.parent ? domChngCntnr : tag.parentElem;\n\t\t\t} else {\n\t\t\t\tdomChngCntnr = linkCtx.elem;\n\t\t\t}\n\t\t\t// Establish a domchange listener in case this checkboxgroup wraps a {^{for}} or {^{if}} or similar\n\t\t\t// which might dynamically insert new checkbox input elements\n\t\t\t$(domChngCntnr).on(\"jsv-domchange\", tag._dmChg = function(ev, forOrIfTagCtx, linkCtx, eventArgs) {\n\t\t\t\tvar linkedElem,\n\t\t\t\t\tparentTags = forOrIfTagCtx.ctx.parentTags;\n\t\t\t\tif (!eventArgs.refresh &&\n\t\t\t\t\t(!tag.inline ||\n\t\t\t\t\t\tdomChngCntnr !== tag.parentElem ||\n\t\t\t\t\t\t// If the tag is inline, and the domChngCntnr is the parentElem, then we need to\n\t\t\t\t\t\t// make sure dom change event is fora content change within this tag, not outside it.\n\t\t\t\t\t\tparentTags && parentTags[tag.tagName] === tag\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\t// Contents have changed so recreate $linkedElem for the checkbox input elements (including possible new one just inserted)\n\t\t\t\t\t$linkedElem = tag.contents(true, CHECKBOXINPUT);\n\t\t\t\t\tl = $linkedElem.length;\n\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t// Configure binding and name for each checkbox input element\n\t\t\t\t\t\tlinkedElem = $linkedElem[l];\n\t\t\t\t\t\tif (!linkedElem._jsvSel) {\n\t\t\t\t\t\t\tlinkedElem.name = linkedElem.name || tag.name;\n\t\t\t\t\t\t\t$.link(linkExpr, linkedElem, linkCtx.data);\n\t\t\t\t\t\t\tif (useDisable) {\n\t\t\t\t\t\t\t\tlinkedElem.disabled = !!tagCtx.props.disabled;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\ttag._dmChg.tgt = domChngCntnr; // Used to remove listener in onUnbind\n\t\t},\n\t\tonAfterLink: function(tagCtx, linkCtx, ctx, ev, eventArgs) {\n\t\t\tvar propParams = tagCtx.params.props;\n\t\t\tif (propParams && propParams.disabled) {\n\t\t\t\tthis.contents(true, CHECKBOXINPUT).prop(\"disabled\", !!tagCtx.props.disabled);\n\t\t\t}\n\t\t},\n\t\tonUnbind: function() {\n\t\t\tvar tag = this;\n\t\t\tif (tag._dmChg) {\n\t\t\t\t$(tag._dmChg.tgt).off(\"jsv-domchange\", tag._dmChg); // Remove listener\n\t\t\t\ttag._dmChg = undefined;\n\t\t\t}\n\t\t},\n\t\tonUpdate: false, // don't rerender\n\t\tcontentCtx: true,\n\t\tdataBoundOnly: true\n\t}\n});\n\n$extend($tags[\"for\"], {\n\t//onUpdate: function(ev, eventArgs, newTagCtxs) {\n\t\t//Consider adding filtering for perf optimization. However the below prevents update on some scenarios which _should_ update - namely when there is another array on which for also depends.\n\t\t//var i, l, tci, prevArg;\n\t\t//for (tci = 0; (prevArg = this.tagCtxs[tci]) && prevArg.args.length; tci++) {\n\t\t//\tif (prevArg.args[0] !== newTagCtxs[tci].args[0]) {\n\t\t//\t\treturn true;\n\t\t//\t}\n\t\t//}\n\t\t//return false;\n\t//},\n\tsortDataMap: $views.map({\n\t\tgetTgt: $tags[\"for\"].sortDataMap.getTgt, // getTargetSorted\n\t\tobsSrc: function(map, ev, eventArgs) {\n\t\t\tmap.update(); // refresh sorting and filtering\n\t\t},\n\t\tobsTgt: function(map, ev, eventArgs) {\n\t\t\tvar l,\n\t\t\t\titems = eventArgs.items,\n\t\t\t\tsource = map.src;\n\t\t\tif (eventArgs.change === \"remove\") {\n\t\t\t\tl = items.length;\n\t\t\t\twhile (l--) {\n\t\t\t\t\t$observable(source).remove($inArray(items[l], source));\n\t\t\t\t}\n\t\t\t} else if (eventArgs.change === \"insert\") {\n\t\t\t\t$observable(source).insert(items);\n\t\t\t}\n\t\t}\n\t}),\n\tmapProps: [\"filter\", \"sort\", \"reverse\", \"start\", \"end\", \"step\"],\n\tbindTo: [\"paged\", \"sorted\"],\n\tbindFrom: [0],\n\n\tonArrayChange: function(ev, eventArgs, tagCtx, linkCtx) {\n\t\tvar arrayView, propsArr,\n\t\t\ttargetLength = ev.target.length,\n\t\t\ttag = this;\n\t\tif (!tag.rendering) {\n\t\t\tif (tag._.noVws // Child views not supported because target is not html - e.g. data-link=\"title{for ...}\"\n\t\t\t\t|| tag.tagCtxs[1] && ( // There is an {{else}}\n\t\t\t\t\teventArgs.change === \"insert\" && targetLength === eventArgs.items.length // inserting, and new length is same as inserted length, so going from 0 to n\n\t\t\t\t\t|| eventArgs.change === \"remove\" && !targetLength) // removing, and new length 0, so going from n to 0\n\t\t\t\t) {\n\t\t\t\tpropsArr = tagCtx.map && tagCtx.map.propsArr; // Used by {{props}}, which derives from {{for}}\n\t\t\t\ttag.refresh();\n\t\t\t\tif (propsArr) {\n\t\t\t\t\ttagCtx.map.propsArr = propsArr; // Keep previous propsArr with new map\n\t\t\t\t}\n\t\t\t} else for (arrayView in tag._.arrVws) {\n\t\t\t\tarrayView = tag._.arrVws[arrayView];\n\t\t\t\tif (arrayView.data === ev.target) {\n\t\t\t\t\tarrayChangeHandler.apply(arrayView, arguments);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttag.domChange(tagCtx, linkCtx, eventArgs);\n\t\tev.done = true;\n\t},\n\tonUpdate: function(ev, eventArgs, tagCtxs) {\n\t\tthis.setDataMap(tagCtxs);\n\t},\n\tonBind: function(tagCtx, linkCtx, ctx, ev, eventArgs) {\n\t\tvar data,\n\t\t\ttag = this,\n\t\t\ti = 0,\n\t\t\tarrayBindings = tag._ars = tag._ars || {},\n\t\t\ttagCtxs = tag.tagCtxs,\n\t\t\tl = tagCtxs.length,\n\t\t\tselected = tag.selected || 0;\n\n\t\tfor (; i <= selected; i++) {\n\t\t\ttagCtx = tagCtxs[i]; // loop through tagCtxs up to selected\n\t\t\tdata = tagCtx.map\n\t\t\t\t? tagCtx.map.tgt // 'data' is mapped data\n\t\t\t\t: tagCtx.args.length\n\t\t\t\t\t? tagCtx.args[0] // or args[0]\n\t\t\t\t\t: tagCtx.view.data; // or defaults to current data.\n\t\t\tif (arrayBindings[i]) { // Is there was a previous binding on this tagCtx, (maybe with data different from new data)\n\t\t\t\t$observe(arrayBindings[i], true); //unobserve previous array\n\t\t\t\tdelete arrayBindings[i];\n\t\t\t}\n\t\t\tif (!arrayBindings[i] && $isArray(data)) {\n\t\t\t\t(function() {\n\t\t\t\t\tvar tagCt = tagCtx;\n\t\t\t\t\t$observe(data, arrayBindings[i] = function(ev, eventArgs) { // Store arrayChangeHandler on tag._ars[i]\n\t\t\t\t\t\ttag.onArrayChange(ev, eventArgs, tagCt, linkCtx);\n\t\t\t\t\t});\n\t\t\t\t})();\n\t\t\t}\n\t\t}\n\t\tfor (i = selected + 1; i < l; i++) { // If there were previous bindings on later tagCtxs, remove them\n\t\t\tif (arrayBindings[i]) {\n\t\t\t\t$observe(arrayBindings[i], true); //unobserve previous binding\n\t\t\t\tdelete arrayBindings[i];\n\t\t\t}\n\t\t}\n\t\tif (eventArgs) {\n\t\t\ttag.domChange(tagCtx, linkCtx, eventArgs);\n\t\t}\n\t},\n\tonAfterLink: function(tagCtx) {\n\t\tvar data, map, props,\n\t\t\ttag = this,\n\t\t\ti = 0,\n\t\t\ttagCtxs = tag.tagCtxs,\n\t\t\tl = tagCtxs.length,\n\t\t\tselected = tag.selected || 0;\n\n\t\tfor (; i <= selected; i++) {\n\t\t\ttagCtx = tagCtxs[i]; // loop through tagCtxs up to selected\n\t\t\tmap = tagCtx.map;\n\t\t\tdata = tagCtx.map\n\t\t\t\t? map.tgt // 'data' is mapped data\n\t\t\t\t: tagCtx.args.length\n\t\t\t\t\t? tagCtx.args[0] // or args[0]\n\t\t\t\t\t: tagCtx.view.data; // or defaults to current data.\n\t\t\tif ($isArray(data) && (props = tagCtx.params.props)) {\n\t\t\t\tif (props.paged && !tag.paged) {\n\t\t\t\t\t$.observable(tag).setProperty(\"paged\", data.slice());\n\t\t\t\t\ttag.updateValue(tag.paged, 0, i, true); // Update paged (async, to wait until parent tag has been datalinked)\n\t\t\t\t}\n\t\t\t\tif (props.sorted && !tag.sorted) {\n\t\t\t\t\t$.observable(tag).setProperty(\"sorted\", map && map.sorted || data.slice());\n\t\t\t\t\ttag.updateValue(tag.sorted, 1, i, true); // Update sorted (async, to wait until parent tag has been datalinked)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tonDispose: function() {\n\t\tvar l, tag = this;\n\t\tfor (l in tag._ars) {\n\t\t\t$observe(tag._ars[l], true); //unobserve\n\t\t}\n\t}\n});\n\n$extend($tags[\"if\"], {\n\tonUpdate: function(ev, eventArgs, newTagCtxs) {\n\t\tvar prevArg, different,\n\t\t\ttci = 0;\n\t\tfor (; (prevArg = this.tagCtxs[tci]); tci++) {\n\t\t\tdifferent = prevArg.props.tmpl !== newTagCtxs[tci].props.tmpl || prevArg.args.length && !(prevArg = prevArg.args[0]) !== !newTagCtxs[tci].args[0];\n\t\t\tif ((!this.convert && !!prevArg) || different) {\n\t\t\t\treturn different;\n\t\t\t\t// If there is not a change of template, and there is no converter, and newArg and prevArg are both truthy, return false to cancel update.\n\t\t\t\t// (Even if values on later elses are different, we still don't want to update, since rendered output would be unchanged)\n\t\t\t\t// If newArg and prevArg are different, return true, to update\n\t\t\t\t// If newArg and prevArg are both falsey, move to the next {{else ...}}\n\t\t\t}\n\t\t}\n\t\t// Boolean value of all args are unchanged (falsey), so return false to cancel update\n\t\treturn false;\n\t},\n\tonAfterLink: function(tagCtx, linkCtx, ctx, ev, eventArgs) {\n\t\tif (eventArgs) {\n\t\t\tthis.domChange(tagCtx, linkCtx, eventArgs);\n\t\t}\n\t}\n});\n\nfunction observeProps(map, ev, eventArgs) {\n\tvar target, l, props = map.options.props;\n\tupdatePropsArr(map.propsArr, eventArgs.path, eventArgs.value, eventArgs.remove);\n\tif (props.sort !== undefined || props.start !== undefined || props.end !== undefined || props.step !== undefined || props.filter || props.reverse) {\n\t\tmap.update(); // refresh sorting and filtering\n\t} else if (eventArgs.change === \"set\") {\n\t\ttarget = map.tgt;\n\t\tl = target.length;\n\t\twhile (l-- && target[l].key !== eventArgs.path) {}\n\t\tif (l === -1) {\n\t\t\tif (eventArgs.path && !eventArgs.remove) {\n\t\t\t\t$observable(target).insert({key: eventArgs.path, prop: eventArgs.value});\n\t\t\t}\n\t\t} else if (eventArgs.remove) {\n\t\t\t$observable(target).remove(l);\n\t\t} else {\n\t\t\t$observable(target[l]).setProperty(\"prop\", eventArgs.value);\n\t\t}\n\t}\n}\n\nfunction observeMappedProps(map, ev, eventArgs) {\n\tvar items, l, key, remove,\n\t\tsource = map.src,\n\t\tchange = eventArgs.change;\n\n\tif (change === \"set\") {\n\t\tif (eventArgs.path === \"prop\") {\n\t\t\t$observable(source).setProperty(ev.target.key, eventArgs.value);\n\t\t} else { // path === \"key\"\n\t\t\t$observable(source).removeProperty(eventArgs.oldValue); // When key is modified observably, remove old one and set new one\n\t\t\t$observable(source).setProperty(eventArgs.value, ev.target.prop);\n\t\t}\n\t} else if (change === \"insert\" || (remove = change === \"remove\")) {\n\t\titems = eventArgs.items;\n\t\tl = items.length;\n\t\twhile (l--) {\n\t\t\tif (key = items[l].key) {\n\t\t\t\tupdatePropsArr(map.propsArr, key, items[l].prop, remove);\n\t\t\t\tif (remove) {\n\t\t\t\t\t$observable(source).removeProperty(key);\n\t\t\t\t\tdelete source[key];\n\t\t\t\t} else {\n\t\t\t\t\t$observable(source).setProperty(key, items[l].prop);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction updatePropsArr(propsArr, key, prop, remove) {\n\tvar l = propsArr.length;\n\twhile (l-- && propsArr[l].key !== key) {}\n\tif (l === -1) {\n\t\tif (key && !remove) {\n\t\t\tpropsArr.push({key: key, prop: prop});\n\t\t}\n\t} else if (remove) {\n\t\tpropsArr.splice(l, 1);\n\t}\n}\n\nfunction shallowArrayFilter(path /*, object, parentObs*/) { // Filter used by {{props}} for the mappedProps target array\n\treturn rShallowArrayPath.test(path); // No '.' in path\n}\n\n$tags(\"props\", {\n\tbaseTag: \"for\",\n\tdataMap: $views.map({\n\t\tgetTgt: $tags.props.dataMap.getTgt, // getTargetProps\n\t\tobsSrc: observeProps,\n\t\tobsTgt: observeMappedProps,\n\t\ttgtFlt: shallowArrayFilter\n\t}),\n\tflow: true\n});\n\n//========================\n// Extend jQuery namespace\n//========================\n\n$extend($, {\n\n\t//=======================\n\t// jQuery $.view() plugin\n\t//=======================\n\n\tview: $view = function(node, inner, type) {\n\t\t// $.view() returns top view\n\t\t// $.view(node) returns view that contains node\n\t\t// $.view(selector) returns view that contains first selected element\n\t\t// $.view(nodeOrSelector, type) returns nearest containing view of given type\n\t\t// $.view(nodeOrSelector, \"root\") returns root containing view (child of top view)\n\t\t// $.view(nodeOrSelector, true, type) returns nearest inner (contained) view of given type\n\n\t\tfunction getInnerView(nd, isVl) {\n\t\t\tif (nd) {\n\t\t\t\tvwInfos = viewInfos(nd, isVl, rOpenViewMarkers);\n\t\t\t\tfor (j = 0, k = vwInfos.length; j < k; j++) {\n\t\t\t\t\tif ((view = viewStore[vwInfos[j].id]) && (view = view && type ? view.get(true, type) : view)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (inner !== !!inner) {\n\t\t\t// inner not boolean, so this is view(nodeOrSelector, type)\n\t\t\ttype = inner;\n\t\t\tinner = undefined;\n\t\t}\n\t\tvar view, vwInfos, i, j, k, l, elems,\n\t\t\tlevel = 0,\n\t\t\tbody = document.body;\n\n\t\tif (node && node !== body && topView._.useKey > 1) {\n\t\t\t// Perf optimization for common cases\n\n\t\t\tnode = typeof node === STRING\n\t\t\t\t? $(node)[0]\n\t\t\t\t: node.jquery\n\t\t\t\t\t? node[0]\n\t\t\t\t\t: node;\n\n\t\t\tif (node) {\n\t\t\t\tif (inner) {\n\t\t\t\t\tgetInnerView(node._df, true);\n\t\t\t\t\tif (!view && node.tagName) { // Not a text node\n\t\t\t\t\t\t// Treat supplied node as a container element and return the first view encountered.\n\t\t\t\t\t\telems = qsa ? node.querySelectorAll(bindElsSel) : $(bindElsSel, node).get();\n\t\t\t\t\t\tl = elems.length;\n\t\t\t\t\t\tfor (i = 0; !view && i < l; i++) {\n\t\t\t\t\t\t\tgetInnerView(elems[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn view;\n\t\t\t\t}\n\t\t\t\twhile (node) {\n\t\t\t\t\t// Move back through siblings and up through parents to find preceding node which is a _prv (prevNode)\n\t\t\t\t\t// script marker node for a non-element-content view, or a _prv (first node) for an elCnt view\n\t\t\t\t\tif (vwInfos = viewInfos(node, undefined, rViewMarkers)) {\n\t\t\t\t\t\tl = vwInfos.length;\n\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\tview = vwInfos[l];\n\t\t\t\t\t\t\tif (view.open) {\n\t\t\t\t\t\t\t\tif (level < 1) {\n\t\t\t\t\t\t\t\t\tview = viewStore[view.id];\n\t\t\t\t\t\t\t\t\treturn view && type ? view.get(type) : view || topView;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlevel--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// level starts at zero. If we hit a view.close, then we move level to 1, and we don't return a view until\n\t\t\t\t\t\t\t\t// we are back at level zero (or a parent view with level < 0)\n\t\t\t\t\t\t\t\tlevel++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnode = node.previousSibling || node.parentNode;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn topView;\n\t},\n\n\tlink: $link,\n\tunlink: $unlink,\n\n\t//=====================\n\t// override $.cleanData\n\t//=====================\n\tcleanData: function(elems) {\n\t\tif (elems.length && isCleanCall) {\n\t\t\t// Remove JsViews bindings. Also, remove from the DOM any corresponding script marker nodes\n\t\t\tclean(elems);\n\t\t}\n\t\toldCleanData.apply($, arguments);\n\t}\n});\n\n// Possible future addition - e.g. for ckeditor tag control\n//$views.utility = {\n//\tvalidate: function(html) {\n//\t\ttry {\n//\t\t\ttopView.link(undefined, document.createElement(\"div\"), undefined, undefined, html, undefined, undefined, 1);\n//\t\t}\n//\t\tcatch (e) {\n//\t\t\treturn e.message;\n//\t\t}\n//\t}\n//};\n\n//===============================\n// Extend jQuery instance plugins\n//===============================\n\n$extend($.fn, {\n\tlink: function(expr, from, context, noIteration, parentView, prevNode, nextNode) {\n\t\treturn $link(expr, this, from, context, noIteration, parentView, prevNode, nextNode);\n\t},\n\tunlink: function() {\n\t\treturn $unlink(this);\n\t},\n\tview: function(inner, type) {\n\t\treturn $view(this[0], inner, type);\n\t}\n});\n\n//==============================================================================\n// Override jQuery methods that call our overridden cleanData, for disposal etc.\n//==============================================================================\n\n$.each([HTML, \"replaceWith\", \"empty\", \"remove\"], function(i, name) {\n\tvar oldFn = $.fn[name];\n\t$.fn[name] = function() {\n\t\tvar result;\n\t\tisCleanCall++; // Make sure cleanData does disposal only when coming from these calls.\n\t\ttry {\n\t\t\tresult = oldFn.apply(this, arguments);\n\t\t}\n\t\tfinally {\n\t\t\tisCleanCall--;\n\t\t}\n\t\treturn result;\n\t};\n});\n\n//===============\n// Extend topView\n//===============\n\n$extend(topView = $sub.topView, {tmpl: {links: {}}});\n\nviewStore = {0: topView}; // Top-level view\n\n//===================\n// Extend $.views.sub\n//===================\n\n$sub._glt = function(elem) { // get linked tags (Used in validate.js)\n\tvar linkCtx,\n\t\tregEx = /#(\\d*)\\^\\/\\1\\^/g,\n\t\tlinkCtxs = [],\n\t\ttokens = markerNodeInfo(elem);\n\n\twhile (linkCtx = regEx.exec(tokens)) {\n\t\tif (linkCtx = bindingStore[linkCtx[1]]) {\n\t\t\tlinkCtxs.push(linkCtx.linkCtx.tag);\n\t\t}\n\t}\n\treturn linkCtxs;\n};\n\n$sub._gccb = function(view) { // Return a callback for accessing the context of a template/data-link expression - and converting ~foo, #foo etc.\n\t// TODO Consider exposing or allowing override, as public API\n\treturn function(path, depth) {\n\t\t// TODO consider only calling the contextCb on the initial token in path '~a.b.c' and not calling again on\n\t\t// the individual tokens, 'a', 'b', 'c'... Currently it is called multiple times\n\t\tvar tokens, tag, items, helper, last, nextPath, l, obsCtxPrm, addedTagCpDep, key, bindTo;\n\t\tif (view && path) {\n\t\t\tif (path._cpfn) {\n\t\t\t\ttry {\n\t\t\t\t\treturn $subSettingsAdvanced.cache ? view.getCache(path._cpKey) : path._cpfn.call(view.tmpl, view.data, view, $sub); // exprOb for computed property\n\t\t\t\t} catch(e) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (path.charAt(0) === \"~\") {\n\t\t\t\t// We return new items to insert into the sequence, replacing the \"~a.b.c\" string:\n\t\t\t\t// [helperObject 'a', \"a.b.c\" currentDataItem] so currentDataItem becomes the object for subsequent paths.\n\t\t\t\tif (path.slice(0, 4) === \"~tag\") {\n\t\t\t\t\ttag = view.ctx;\n\t\t\t\t\tif (path.charAt(4) === \".\") {\n\t\t\t\t\t\t// \"~tag.xxx\"\n\t\t\t\t\t\ttokens = path.slice(5);\n\t\t\t\t\t\ttag = tag.tag;\n\t\t\t\t\t} else if (path.slice(0, 8) === \"~tagCtx.\") {\n\t\t\t\t\t\t// \"~tagCtx.xxx\"\n\t\t\t\t\t\ttokens = path.slice(8);\n\t\t\t\t\t\ttag = tag.tagCtx;\n\t\t\t\t\t}\n\t\t\t\t\tif (tokens) {\n\t\t\t\t\t\treturn tag ? [tag, tokens] : [];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpath = path.slice(1).split(\".\");\n\t\t\t\tif (helper = view.ctxPrm(last = path.shift(), undefined, true)) {\n\t\t\t\t\tif (obsCtxPrm = helper._cxp) { // helper for (contextual parameter ~foo=...) is an array - [view, ctxPrmDependencies ...]\n\t\t\t\t\t\tif (path.length) {\n\t\t\t\t\t\t\tnextPath = \".\" + path.join(\".\");\n\t\t\t\t\t\t\tlast = helper[l = helper.length-1];\n\t\t\t\t\t\t\tif (last._cpfn) {\n\t\t\t\t\t\t\t\tlast.sb = nextPath;\n\t\t\t\t\t\t\t\tlast.bnd = !!depth;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thelper[l] = (last + nextPath).replace(\"#data.\", \"\");\n\t\t\t\t\t\t\t\tif (last.slice(0, 5) === \"#view\") {\n\t\t\t\t\t\t\t\t\thelper[l] = helper[l].slice(6);\n\t\t\t\t\t\t\t\t\thelper.splice(l, 0, view);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\titems = [helper]; // Contextual parameter\n\t\t\t\t\t\tif ((tag = obsCtxPrm.tag) && tag.convert) {\n\t\t\t\t\t\t\t// If there is a converter, it might mix inputs, so tag contextual param needs to depend on all bound args/props.\n\t\t\t\t\t\t\tbindTo = tag.bindTo || [0];\n\t\t\t\t\t\t\tl = bindTo.length;\n\t\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\t\tif (depth !== undefined && l !== obsCtxPrm.ind) {\n\t\t\t\t\t\t\t\t\tkey = bindTo[l];\n\t\t\t\t\t\t\t\t\taddedTagCpDep = [helper[0], tag.tagCtx.params[+key === key ? \"args\" : \"props\"]];\n\t\t\t\t\t\t\t\t\taddedTagCpDep._cxp = obsCtxPrm;\n\t\t\t\t\t\t\t\t\titems.push(addedTagCpDep); // Added dependency for tag contextual parameter\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (path.length || $isFunction(helper)) {\n\t\t\t\t\t\titems = [helper, path.join(\".\")]; // 2way bindng on ~foo.helperLeafProperty or ~computed() or ~contextualParam\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn items || [];\n\t\t\t}\n\t\t\tif (path.charAt(0) === \"#\") {\n\t\t\t\t// We return new items to insert into the sequence, replacing the \"#a.b.c\" string: [view, \"a.b.c\" currentDataItem]\n\t\t\t\t// so currentDataItem becomes the object for subsequent paths. The 'true' flag makes the paths bind only to leaf changes.\n\t\t\t\treturn path === \"#data\" ? [] : [view, path.replace(rViewPath, \"\")];\n\t\t\t}\n\t\t}\n\t};\n};\n\n//===================\n// ctxPrm helpers\n//===================\n// The following helper functions for observable contextual parameters are needed by render.js in data-linking scenarios\n// Implemented here rather than in render.js to keep render.js size down, and exposed via $.sub...\n\n$sub._cp = function(paramVal, paramExpr, view, tagCtxPrm) { // Create tag or inline contextual parameter\n\t// Called for inline contextual parameter ~foo=expression, from compiled function for expression. (tagCtxPrm is undefined)\n\t// Called for tag parameter (two-way binding), from renderTag. (tagCtxPrm is {tag: ..., ind: ...})\n\tif (view.linked) { // In JsViews, returns [view, linkFn] where linkFn is compiled function for expression, or observable contextual parameter object\n\t\tif (tagCtxPrm && (tagCtxPrm.cvt || tagCtxPrm.tag._.toIndex[tagCtxPrm.ind] === undefined)) {\n\t\t\tparamVal = [{_ocp: paramVal}]; // With convert, or with bindTo/bindFrom different, the tag contextual parameter object will be 'local' to the tag.\n\t\t\t\t// It will be updated by bindFrom binding, and by tag.setValue(...), but not by tag.updateValue() (which will update bindTo value externally)\n\t\t\ttagCtxPrm.updateValue = function(val) {\n\t\t\t\t$.observable(paramVal._cxp.data).setProperty(_ocp, val); // Set the value (res[0]._ocp)\n\t\t\t\treturn this;\n\t\t\t};\n\t\t} else if (paramExpr) { // With no convert/convertBack and no bindTo/bindFrom difference, tag contextual parameter 2way binds to bindTo/bindFrom value.\n\t\t\t\t// So tag.updateValue() updates external value, which updates contextual parameter through 2way binding\n\t\t\tvar params = delimOpenChar1 + \":\" + paramExpr + delimCloseChar0,\n\t\t\t\tlinkFn = linkExprStore[params];\n\t\t\tif (!linkFn) {\n\t\t\t\tlinkExprStore[params] = linkFn = $sub.tmplFn(params.replace(rEscapeQuotes, \"\\\\$&\"), view.tmpl, true);\n\t\t\t}\n\t\t\tparamVal = linkFn.deps[0]\n\t\t\t\t? [view, linkFn] // compiled expression\n\t\t\t\t: [{_ocp: tagCtxPrm ? paramVal : linkFn()}]; // Static value - no deps - returns observable contextual parameter object\n\t\t} else {\n\t\t\tparamVal = [{_ocp: paramVal}]; // Uninitialized observable contextual parameter object\n\t\t}\n\t\tparamVal._cxp = tagCtxPrm || {\n\t\t\tupdateValue: function(val) {\n\t\t\t\t$observable(paramVal._cxp.data).setProperty(paramVal._cxp.path, val);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t};\n\t}\n\treturn paramVal; // In JsRender returns evaluated expression\n};\n\n$sub._ucp = function(key, value, view, obsCtxPrm) {\n\tvar tag = obsCtxPrm.tag,\n\t\tindex = tag ? $inArray(key, tag.linkedCtxParam) : 0;\n\tif (!obsCtxPrm.path) {\n\t\tresolveDataTargetPath(\"~\" + key, view.data, $sub._gccb(view));\n\t}\n\treturn (obsCtxPrm.updateValue || tag.updateValue)(value, index, obsCtxPrm.tagElse, undefined, tag);\n};\n\n$sub._ceo = function cloneExprObjects(obs) { // Clone exprObs so that each referenced contextual parameter ~foo uses its own exprOb instances\n\tvar ob,\n\t\tclones = [],\n\t\tl = obs.length;\n\twhile (l--) {\n\t\tob = obs[l];\n\t\tif (ob._cpfn) {\n\t\t\tob = $extend({}, ob); // If an exprOb, clone it. If a string, keep as is\n\t\t\tob.prm = cloneExprObjects(ob.prm); // Recursively clone exprObs in parameters, too\n\t\t}\n\t\tclones.unshift(ob);\n\t}\n\treturn clones;\n};\n\n//=========================\n// Extend $.views.settings\n//=========================\n\noldAdvSet = $sub.advSet;\n\n$sub.advSet = function() { // refresh advanced settings\n\toldAdvSet.call($sub);\n\tglobal._jsv = $subSettingsAdvanced._jsv\n\t\t? $extend(global._jsv || {}, { // create global _jsv, for accessing views, etc\n\t\t\t\tviews: viewStore,\n\t\t\t\tbindings: bindingStore\n\t\t\t})\n\t\t: undefined; // In IE8 cannot do delete global._jsv\n\t$viewsLinkAttr = $subSettingsAdvanced.linkAttr;\n\tlinkViewsSel = bindElsSel + \",[\" + $viewsLinkAttr + \"]\";\n\twrapMap = $subSettingsAdvanced._wm;\n\twrapMap.optgroup = wrapMap.option;\n\twrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\n\twrapMap.th = wrapMap.td;\n};\n\n$viewsSettings.advanced({\n\tlinkAttr: \"data-link\",\n\tuseViews: false,\n\tnoValidate: false,\n\t// wrapMap provide appropriate wrappers for inserting innerHTML, used in insertBefore\n\t// We have to close these tags to support XHTML (#13200)\n\t// TODO investigate whether more recent jQuery implementation using wrapMap in domManip/$().html() etc. is better optimized now...\n\t_wm: {\n\t\toption: [1, \"\", \" \"],\n\t\tlegend: [1, \"\", \" \"],\n\t\tarea: [1, \"\", \" \"],\n\t\tparam: [1, \"\", \" \"],\n\t\tthead: [1, \"\"],\n\t\ttr: [2, \"\"],\n\t\ttd: [3, \"\"],\n\t\tcol: [2, \"\"],\n\t\tsvg_ns: [1, \"\", \" \"],\n\t\t// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,\n\t\t// unless wrapped in a div with non-breaking characters in front of it.\n\t\tdiv: $.support.htmlSerialize ? [0, \"\", \"\"] : [1, \"X\", \"
\"]\n\t},\n\t_fe: {\n\t\tinput: {\n\t\t\tfrom: inputAttrib, to: VALUE\n\t\t},\n\t\ttextarea: valueBinding,\n\t\tselect: valueBinding,\n\t\toptgroup: {\n\t\t\tto: \"label\"\n\t\t}\n\t}\n});\n\nreturn $;\n}, window));"]}
\ No newline at end of file
+{"version":3,"sources":["jsviews.js"],"names":["factory","global","$","jQuery","exports","module","define","amd","getDerivedMethod","baseMethod","method","ret","tag","this","prevBase","base","apply","arguments","getMethod","$isFunction","_d","noop","tagHandlersFromProps","tagCtx","prop","props","rHasHandlers","test","fix","constructor","prototype","retVal","val","dbgBreak","console","log","e","baseApply","JsViewsError","message","name","link","$extend","target","source","$viewsDelimiters","openChars","closeChars","$isArray","$views","linkChar","error","delimOpenChar0","delimOpenChar1","delimCloseChar0","delimCloseChar1","$subSettings","delimiters","rTag","$sub","RegExp","rTmpl","$viewsSettings","getView","inner","type","undefined","views","i","l","found","view","root","_","useKey","get","length","parent","getNestedIndex","index","getIndex","getPathObject","ob","path","ltOb","fn","prevOb","tokens","split","lt","contextParameter","key","value","wrapped","deps","res","obsCtxPrm","tagElse","callView","newRes","storeView","isUpdate","isRenderCall","store","ctx","hasOwnProperty","$helpers","linked","_cxp","scope","isTop","_ocps","_ocp","_vw","_key","ind","updateValue","observable","setProperty","_ceo","unshift","cvtArgs","data","_ucp","getTemplate","tmpl","getRsc","$templates","convertVal","converter","onError","linkCtx","argsLen","bindTo","boundTag","bnds","_lr","args","_bd","_lc","_tg","bnd","unlinked","inline","tagName","convert","onArrayChange","flow","tagCtxs","_is","extendCtx","_er","onRender","convertArgs","bound","boundArgs","bindFrom","STRING","slice","argOrProp","arg0","context","convertBoundArgs","getResource","resourceType","itemName","renderTag","parentView","bindToOrBindFrom","bindArray","m","isNaN","parseInt","topView","tagDef","template","tags","attr","parentTag","n","itemRet","tagCtxCtx","ctxPrm","initVal","content","callInit","mapDef","thisMap","bdArgs","tagDataMap","contentCtx","bindFromLength","bindToLength","linkedElement","defaultCtx","parentTmpl","lateRender","params","tmpls","render","renderContent","bndArgs","_getTmpl","init","_ctr","ths","arrVws","dataBoundOnly","dataMap","map","parents","parentTags","rendering","rndr","argDefault","linkedCtxParam","fromIndex","toIndex","_dfAt","noVws","HTML","_cp","cvt","src","unmap","tgt","rWrappedInViewMarker","links","renderWithViews","$converters","html","View","contentTmpl","parentView_","self_","self","isArray","id","viewId","cache","_ct","_cchCt","scp","indexStr","push","splice","compileChildResources","storeName","storeNames","resources","jsvStores","compileTag","Tag","baseTag","compiledDef","depends","$tags","_parentTmpl","compileTmpl","options","lookupTemplate","currentName","nodeType","elem","document","getElementById","charAt","innerHTML","getAttribute","tmplAttr","jsvTmpl","tmplName","setAttribute","compiledTmpl","tmplOrMarkup","_html","markup","tmplObject","tmplFn","replace","rEscapeQuotes","getDefaultVal","defaultVal","call","addParentRef","ref","Object","defineProperty","configurable","compileViewModel","JsvVm","vm","iterate","action","getterType","parentRef","j","getterCount","getters","getter","viewModels","JSON","parse","childOb","arr","merge","viewModel","$expando","getterNames","mod","assigned","newModArr","k","model","$observable","refresh","concat","unmapArray","modelArr","extend","proto","cnstr","privField","set","Function","htmlTag","wrapMap","$subSettingsAdvanced","_wm","rFirstElem","exec","toLowerCase","div","trim","registerStore","storeSettings","theStore","item","compile","thisStore","onStore","OBJECT","getTgt","addSetting","st","Map","baseMap","noIteration","isTopRenderCall","prevData","prevIndex","result","useViews","newView","childView","itemResult","swapContent","outerOnRender","itemVar","newCtx","noLinking","_wrp","nl","syntaxError","helpers","contentView","onRenderError","fallback","Err","isLinkExpr","convertBack","hasElse","pushprecedingContent","shift","loc","substr","rNewLine","blockTagCheck","block","parseTag","all","bind","colon","codeTag","slash","bind2","closeBlock","late","openTagName","isLateOb","pathBindings","ctxProps","paramsArgs","paramsProps","paramsCtxProps","useTrigger","allowCode","rUnescapeQuotes","rTestElseIf","current","substring","stack","pop","parseParams","rBuildHash","onerror","isCtxPrm","keyToken","keyValue","arg","param","hasHandlers","newNode","parsedParam","bindings","astTop","buildCode","setPaths","pathsArr","paths","skp","paramStructure","paramCode","paramVals","parseTokens","lftPrn0","lftPrn","operator","err","eq","path2","prn","comma","lftPrn2","apos","quot","rtPrn","rtPrnDot","prn2","space","full","parsePath","allPath","not","object","helper","viewProperty","pathTokens","leafToken","subPath","binds","named","bindto","_jsvto","bndCtx","bd","theOb","_cpfn","sb","prm","pathStart","fnDp","compiledPathStart","compiledPath","join","expr","newOb","lftPrnFCall","aposed","quoted","bndStack","_cpPthSt","_cpKey","cpFnStore","fnCall","prnDp","indexOf","prnStack","prnInd","paramIndex","boundName","rPath","prnStart","0","rBracketQuote","rPrm","ast","node","hasTag","hasEncoder","getsVal","hasCnvt","useCnvt","tmplBindings","boundOnErrStart","boundOnErrEnd","tagRender","nestedTmpls","nestedTmpl","tagAndElses","nextIsElse","oldCode","isElse","isGetVal","tagCtxFn","tagStart","trigger","retStrOpen","retStrClose","tmplBindingKey","templates","converters","code","tmplOptions","debug","debugMode","_tag","parentContext","getTargetProps","propsArr","noFunctions","isFunction","getTargetSorted","mapped","start","end","propParams","filter","sort","directSort","step","reverse","v","a","b","onFilter","sorted","paged","$fnRender","tmplElem","jquery","getCharEntity","ch","charEntities","charCodeAt","getCharFromEntity","match","token","charsFromEntities","htmlEncode","text","rIsHtml","rHtmlEncode","dataEncode","rDataEncode","dataUnencode","rDataUnencode","updateValues","sourceValues","async","bindId","ev","cvtBack","cnvtName","binding","sourceValue","origVals","sourceElem","sourceEl","tos","to","tcpTag","exprOb","contextCb","vals","_tgId","defineBindToDataTargets","bindingStore","chg","nodeName","multiple","_jsvSel","$inArray","checked","onBeforeUpdateVal","change","setValue","_jsvInd","_jsvLkEl","_jsvElse","_ctxCb","_cpCtx","isCpfn","onElemChange","fromAttr","defaultAttr","setter","fnSetters","_jsvTr","delegateTarget","activeBody","_jsvChg","rSplitBindings","lastIndex","_jsvBnd","onDataLinkedTagChange","eventArgs","noUpdate","forceUpdate","hasError","bindEarly","linkFn","parentElem","parentNode","oldLinkCtx","onEvent","changeHandler","onBeforeChangeStr","_toLk","VALUE","CHECKBOX","CHECKED","onUpdate","mergeCtxs","NONE","callAfterLink","observeAndBind","onAfterChangeStr","onUnbind","linkedElems","linkedElem","mainElem","displayElem","_cnvt","TRUE","addLinkMethods","updateContent","_noUpd","setDefer","_df","deferAttr","prevNode","nextNode","nodesToRemove","useProp","openIndex","closeIndex","testElem","cStyle","jsvSel","renders","targetParent","$target","targetVal","_val","_elCnt","_prv","_nxt","currentStyle","getComputedStyle","display","_jsvd","displayStyles","createElement","body","appendChild","removeChild","style","RADIO","nodes","transferViewTokens","jsvAttrStr","disposeTokens","previousSibling","lastChild","remove","empty","children","TEXTCONTENT","selected","lateLink","arrayChangeHandler","onBeforeChange","onAfterChange","items","srt","addViews","_dly","removeViews","moveViews","oldIndex","fixIndex","setArrayChangeLink","handler","arrayBinding","bndArr","off","arrayChangeStr","on","linkGetVal","_fe","contentEditable","from","renderAndLink","linkToNode","prevView","elCnt","removeViewBinding","nextSibling","addBindingMarkers","bindingKey","viewStore","exprFnDeps","propDeps","tagDepends","allowArray","cvtBk","_hdl","_dp","_depends","bdId","_apply","boundProps","_bndId","bindLinkedElChange","lnkCtx","tmplLink","$link","tmplOrLinkExpr","useInput","elementChangeStr","vwInfos","placeholderParent","targetEl","prntView","replaceMode","$view","addDataBinding","cleanData","lnk","viewInfos","rOpenViewMarkers","viewLink","outerData","validateOnly","convertMarkers","preceding","selfClose","closeTag","spaceBefore","boundId","spaceAfter","tag1","tag2","closeTag2","spaceAfterClose","selfClose2","endOpenTag","errorMsg","bndId","endOfElCnt","inTag","isVoid","tagStack","validate","voidElems","prevElCnt","elContent","defer","ids","openScript","closeScript","deferStack","badParent","processViewInfos","deferPath","deferChar","bindChar","onAftCr","deep","addedBindEls","_tkns","len","vwInfo","previousElementSibling","lastElementChild","open","removeSubStr","onAfterCreateStr","onAfterCreate","bindEls","getViewInfos","level","tagDepth","dataLink","wrap","selector","linkViewsSel","elems","qsa","querySelectorAll","prevNodes","markerNodeInfo","contains","isLink","rViewMarkers","skip","processInfos","$viewsLinkAttr","rOpenTagMarkers","unmarkPrevOrNextNode","prevIds","linkInfo","nextView","depth","fragment","copiedNode","firstTag","wrapper","thisId","noValidate","markPrevOrNextNode","namespaceURI","rConvertMarkers","safeFragment","createDocumentFragment","firstChild","insertBefore","linkMarkup","currentView","boundTagId","tagExpr","rTagIndex","linkExpressions","bindDataLinkTarget","normalizeLinkTag","rTagDatalink","linkExprStore","linkCtxType","_gccb","$elem","str","SCRIPT","isVal","rBinding","getInfos","close","elPath","infos","rMarkerTokens","removeAttribute","marker","twoway","copyFromTagCtxToTag","linkedElements","$linkCtxElem","linkCtxElem","linkedEl","linkedTag","tagCtxElse","oldVal","indexTo","mapDeps","tagCtxslength","mainElement","displayElement","Array","contents","onBind","mapProps","mapDepends","observe","setSize","height","width","className","_jsvCl","hasClass","removeClass","addClass","onAfterLink","asyncOnElemChange","which","setTimeout","bindTriggerEvent","trig","onoff","isIE","$linkedElem","newTrig","oldTrig","pathIndex","lastPath","bindtoOb","targetPaths","bindTos","targetPathsElses","resolveDataTargetPath","targetPath","topCp","newCtxs","newTagCtx","_thp","clean","elemArray","linkedElemTag","objId","obsId","allLinkedElems","cbId","propertyChangeStr","onDispose","cbBindingsStore","$unlink","each","innerView","getElementsByTagName","inputAttrib","viewOrTagChar","viewOrTag","precedingLength","emptyView","vwItem","rOpenMarkers","values","setValues","tagOrView","theTag","theView","select","filtered","add","find","withMarkers","prevIsFirstNode","lastSibling","childTags","_gm","indexFrom","newVal","_bdArgs","_bdVals","inArray","extra","domChange","hasListener","_data","events","domChangeNotification","triggerHandler","dataItems","delayed","viewsCount","itemsCount","keepNodes","removeView","viewToRemove","parts","itemView","setPrv","prv","rTagMarkers","selfNxt","backwards","firstChange","lastChange","movedNodes","viewsToMove","appendTo","afterParts","endChange","startView","endView","afterView","startParts","endParts","observeProps","updatePropsArr","update","insert","observeMappedProps","removeProperty","oldValue","shallowArrayFilter","rShallowArrayPath","setGlobals","jsvStoreName","$observe","setting","versionNumber","rAttrEncode","&","<",">","\u0000","'","\"","`","=","amp","gt","$render","jsr","jsrender","jsrToJq","jsviews","sub","syntaxErr","settings","advSet","_err","_sq","advanced","Error","_getOb","getCache","expando","renderFile","__express","obj","_jq","jq","_clFns","_jsv","if","done","for","sortDataMap","cloned","setDataMap","range","include","*",":*","dbg","encode","unencode","url","encodeURI","$eventSpecial","event","special","PARSEINT","rNotWhite","rShallowPath","propChng","arrChng","observeStr","observeObjKey","observeCbKey","observeInnerCbKey","$data","asyncBatch","getCbKey","cb","_cId","ObjectObservable","ns","_ns","ArrayObservable","wrapArray","dependsPaths","callback","rt","nextObj","out","_ar","onDataChange","isOb","noArray","parentObs","observeAll","_arOk","array","_path","observe_apply","$observeAll","unobserve","$unobserveAll","namespace","objMap","observeArrayItems","unobs","newAllPath","filterAndObserveAll","nestedArray","newObject","newParentObs","_fltr","nextParentObs","updatedTgt","wrappedCb","isObject","obId","notRemoving","un","hasData","shallowFilter","$unobserve","batchTrigger","batch","_go","_trigger","innerObserve","unobserveBinding","observeOnOff","fullPath","pathStr","isArrayBinding","evData","dataOb","boundObOrArr","prntObs","allPth","initialNs","el","cbBindings","unbind","relPath","prevAllPath","observeObjects","observeObjectPaths","pths","getInnerCb","newObj","observePath","prts","obArrAddRemove","arrIndex","dep","obArr","prt","fnProp","isGet","_inId","pth","innerCb","p","inId","initNsArr","initNsArrLen","lastArg","wait","delay","asyncObserve","_batch","unobserveAll","nonStrict","pair","tempBatch","multi","_setProperty","leaf","removeProp","property","Date","force","previous","_insert","oldLength","numToRemove","_remove","move","newIndex","numToMove","_move","excess","newItems","insertAdded","addedItems","dataLength","newItem","num","oldItems","newLength","_srt","handleObj","oldMapOrTarget","unbound","changing","updatedMap","obsSrc","obs","srcFlt","obsTgt","obt","_updt","tgtFlt","oldMap","newMap","obmp","_def","_gck","_obs","oldAdvSet","window","navigator","userAgent","textContent","RADIOINPUT","CHECKBOXINPUT","bindElsSel","input","valueBinding","isCleanCall","oldCleanData","oldJsvDelimiters","querySelector","ol","ul","table","tbody","thead","tfoot","tr","colgroup","dl","optgroup","svg","svg_ns","br","img","hr","area","col","meta","command","embed","keygen","track","wbr","rViewPath","requiresStr","regularExpression","currentValue","toggle","_hi","activeElem","contextOb","_sel","_evs","_hlr","oldIsCleanCall","radiogroup","Math","random","domChngCntnr","useDisable","disabled","_dmChg","forOrIfTagCtx","checkboxgroup","tgCtxProps","linkExpr","arrayView","targetLength","arrayBindings","_ars","tagCt","newTagCtxs","prevArg","different","tci","getInnerView","nd","isVl","unlink","oldFn","_glt","regEx","linkCtxs","last","nextPath","addedTagCpDep","paramVal","paramExpr","tagCtxPrm","cloneExprObjects","clones","linkAttr","option","caption","th","td","legend","support","htmlSerialize","textarea"],"mappings":";;CAcC,SAASA,EAASC,GAElB,GAAIC,GAAID,EAAOE,MAEQ,iBAAZC,SACVC,OAAOD,QAAUF,EACdF,EAAQC,EAAQC,GAChB,SAASA,GACV,MAAOF,GAAQC,EAAQC,IAEG,kBAAXI,SAA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KAAYwC,GACjBA,EAAGyX,IAAMkzB,GAAiB3qC,EAAGyX,MAE9BmzB,EAAOtoC,QAAQtC,EAEhB,OAAO4qC,IAORpF,GAAY/mC,GAAKs7B,OAEjBt7B,GAAKs7B,OAAS,WACbyL,GAAU/4B,KAAKhO,IACf1D,EAAO8/B,KAAOxrB,GAAqBwrB,KAChCr9B,EAAQzC,EAAO8/B,UACf57B,MAAOooB,GACPzS,SAAUmK,KAEV/f,OACHsuB,GAAiBje,GAAqBw7B,SACtCle,GAAeoZ,GAAa,KAAOzY,GAAiB,IACpDle,GAAUC,GAAqBC,IAC/BF,GAAQ23B,SAAW33B,GAAQ07B,OAC3B17B,GAAQq3B,MAAQr3B,GAAQu3B,MAAQv3B,GAAQy3B,SAAWz3B,GAAQ27B,QAAU37B,GAAQs3B,MAC7Et3B,GAAQ47B,GAAK57B,GAAQ67B,IAGtBrsC,GAAes7B,UACd2Q,SAAU,YACV/5B,UAAU,EACVod,YAAY,EAIZ5e,KACCw7B,QAAS,EAAG,+BAAgC,aAC5CI,QAAS,EAAG,aAAc,eAC1B7D,MAAO,EAAG,QAAS,UACnB7yB,OAAQ,EAAG,WAAY,aACvBkyB,OAAQ,EAAG,UAAW,YACtBE,IAAK,EAAG,iBAAkB,oBAC1BqE,IAAK,EAAG,qBAAsB,yBAC9B3D,KAAM,EAAG,mCAAoC,uBAC7CL,QAAS,EAAG,QAAS,UAGrBv3B,IAAK1U,EAAEmwC,QAAQC,eAAiB,EAAG,GAAI,KAAO,EAAG,SAAU,WAE5D1kB,KACCsf,OACCpf,KAAMuN,GAAa3V,GAAIiD,IAExB4pB,SAAUpF,GACVlR,OAAQkR,GACRc,UACCvoB,GAAI,YAKAxjB,GACJyqC","file":"jsviews.min.js","sourcesContent":["/*! jsviews.js v1.0.13 single-file version: http://jsviews.com/ */\n/*! includes JsRender, JsObservable and JsViews - see: http://jsviews.com/#download */\n\n/* Interactive data-driven views using JsRender templates */\n\n//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< JsRender >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n/* JsRender:\n * See http://jsviews.com/#jsrender and http://github.com/BorisMoore/jsrender\n * Copyright 2023, Boris Moore\n * Released under the MIT License.\n */\n\n//jshint -W018, -W041, -W120\n\n(function(factory, global) {\n\t// global var is the this object, which is window when running in the usual browser environment\n\tvar $ = global.jQuery;\n\n\tif (typeof exports === \"object\") { // CommonJS e.g. Browserify\n\t\tmodule.exports = $\n\t\t\t? factory(global, $)\n\t\t\t: function($) { // If no global jQuery, take jQuery passed as parameter: require(\"jsviews\")(jQuery)\n\t\t\t\treturn factory(global, $);\n\t\t\t};\n\t} else if (typeof define === \"function\" && define.amd) { // AMD script loader, e.g. RequireJS\n\t\tdefine([\"jquery\"], function($) {\n\t\t\treturn factory(global, $);\n\t\t}); // Require jQuery\n\t} else { // Browser using plain ',\n\topenScript = ')|<\\/(\\w+)>|)(\\s*)([#/]\\d+(?:_|(\\^)))`(\\s*)(<\\w+(?=[\\s\\/>]))?|\\s*(?:(<\\w+(?=[\\s\\/>]))|<\\/(\\w+)>(\\s*)|(\\/>)\\s*|(>)|$)/g,\n\trOpenViewMarkers = /(#)()(\\d+)(_)/g,\n\trOpenMarkers = /(#)()(\\d+)([_^])/g,\n\trViewMarkers = /(?:(#)|(\\/))(\\d+)(_)/g,\n\trTagMarkers = /(?:(#)|(\\/))(\\d+)(\\^)/g,\n\trOpenTagMarkers = /(#)()(\\d+)(\\^)/g,\n\trMarkerTokens = /(?:(#)|(\\/))(\\d+)([_^])([-+@\\d]+)?/g,\n\trSplitBindings = /&(\\d+)\\+?/g,\n\trShallowArrayPath = /^[^.]*$/, // No '.' in path\n\tgetComputedStyle = global.getComputedStyle,\n\t$inArray = $.inArray;\n\nRADIOINPUT += RADIO + \"]\"; // input[type=radio]\nisIE = isIE.indexOf('MSIE ')>0 || isIE.indexOf('Trident/')>0;\n\n$observable = $.observable;\n\nif (!$observable) {\n\t// JsObservable is not loaded.\n\tthrow requiresStr + \"jquery.observable.js\"; // jquery.observable.js must be loaded before JsViews\n}\n\n$observe = $observable.observe;\n\n$subSettings._clFns = function() {\n\tlinkExprStore = {};\n};\n\n//========================== Top-level functions ==========================\n\n//===============\n// Event handlers\n//===============\n\nfunction updateValues(sourceValues, tagElse, async, bindId, ev) {\n// Observably update a data value targeted by the binding.to binding of a 2way data-link binding. Called when elem changes\n// Called when linkedElem of a tag control changes: as updateValue(val, index, tagElse, bindId, ev) - this: undefined\n// Called directly as tag.updateValues(val1, val2, val3, ...) - this: tag\n\tvar linkCtx, cvtBack, cnvtName, target, view, binding, sourceValue, origVals, sourceElem, sourceEl,\n\t\ttos, to, tcpTag, exprOb, contextCb, l, m, tag, vals, ind;\n\n\tif (bindId && bindId._tgId) {\n\t\ttag = bindId;\n\t\tbindId = tag._tgId;\n\t\tif (!tag.bindTo) {\n\t\t\tdefineBindToDataTargets(bindingStore[bindId], tag); // If this tag is updating for the first time, we need to create the 'to' bindings first\n\t\t\ttag.bindTo = [0];\n\t\t}\n\t}\n\tif ((binding = bindingStore[bindId]) && (tos = binding.to)) {\n\t\ttos = tos[tagElse||0];\n\t\t// The binding has a 'to' field, which is of the form [tosForElse0, tosForElse1, ...]\n\t\t// where tosForElseX is of the form [[[targetObject, toPath], [targetObject, toPath], ...], cvtBack]\n\t\tlinkCtx = binding.linkCtx;\n\t\tsourceElem = linkCtx.elem;\n\t\tview = linkCtx.view;\n\t\ttag = linkCtx.tag;\n\t\tif (!tag && tos._cxp) {\n\t\t\ttag = tos._cxp.path !== _ocp && tos._cxp.tag;\n\t\t\tsourceValue = sourceValues[0];\n\t\t\tsourceValues = [];\n\t\t\tsourceValues[tos._cxp.ind] = sourceValue;\n\t\t}\n\n\t\tif (tag) {\n\t\t\ttag._.chg = 1; // Set 'changing' marker to prevent tag update from updating itself\n\t\t\tif (cnvtName = tag.convertBack) {\n\t\t\t\tif ($isFunction(cnvtName)) {\n\t\t\t\t\tcvtBack = cnvtName;\n\t\t\t\t} else {\n\t\t\t\t\tcvtBack = view.getRsc(\"converters\", cnvtName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (sourceElem.nodeName === \"SELECT\") {\n\t\t\t// data-link to string or (multiselect) array of strings\n\t\t\tif (sourceElem.multiple && sourceValues[0] === null) {\n\t\t\t\t// Case where sourceValues was undefined, and set to [null] by $source[setter]() above\n\t\t\t\tsourceValues = [[]];\n\t\t\t}\n\t\t\tsourceElem._jsvSel = sourceValues;\n\t\t} else if (sourceElem._jsvSel) {\n\t\t\t// Checkbox group (possibly using {{checkboxgroup}} tag) data-linking to array of strings\n\t\t\tvals = sourceElem._jsvSel;\n\t\t\tind = $inArray(sourceElem.value, vals);\n\t\t\tif (ind > -1 && !sourceElem.checked) {\n\t\t\t\tvals.splice(ind, 1); // Checking this checkbox\n\t\t\t} else if (ind < 0 && sourceElem.checked) {\n\t\t\t\tvals.push(sourceElem.value); // Unchecking this checkbox\n\t\t\t}\n\t\t\tsourceValues = [vals.slice()];\n\t\t}\n\t\torigVals = sourceValues;\n\t\tl = tos.length;\n\t\tif (cvtBack) {\n\t\t\tsourceValues = cvtBack.apply(tag, sourceValues);\n\t\t\tif (sourceValues === undefined) {\n\t\t\t\ttos = []; // If cvtBack does not return anything, do not update target.\n\t\t\t\t//(But cvtBack may be designed to modify observable values from code as a side effect)\n\t\t\t}\n\t\t\tif (!$isArray(sourceValues) || (sourceValues.arg0 !== false && (l === 1 || sourceValues.length !== l || sourceValues.arg0))) {\n\t\t\t\tsourceValues = [sourceValues];\n\t\t\t\t// If there are multiple tos (e.g. multiple args on data-linked input) then cvtBack can update not only\n\t\t\t\t// the first arg, but all of them by returning an array.\n\t\t\t}\n\t\t}\n\n\t\twhile (l--) {\n\t\t\tif (to = tos[l]) {\n\t\t\t\tto = typeof to === STRING ? [linkCtx.data, to] : to; // [object, path]\n\t\t\t\ttarget = to[0];\n\t\t\t\ttcpTag = to.tag; // If this is a tag contextual parameter - the owner tag\n\t\t\t\tsourceValue = (target && target._ocp && !target._vw\n\t\t\t\t\t? origVals // If to target is for tag contextual parameter set to static expression (or uninitialized) - we are\n\t\t\t\t\t// binding to tag.ctx.foo._ocp - and we use original values, without applying cvtBack converter\n\t\t\t\t\t: sourceValues // Otherwise use the converted value\n\t\t\t\t)[l];\n\t\t\t\tif (sourceValue !== undefined && (!tag || !tag.onBeforeUpdateVal || tag.onBeforeUpdateVal(ev, {\n\t\t\t\t\t\tchange: \"change\",\n\t\t\t\t\t\tdata: target,\n\t\t\t\t\t\tpath: to[1],\n\t\t\t\t\t\tindex: l,\n\t\t\t\t\t\ttagElse: tagElse,\n\t\t\t\t\t\tvalue: sourceValue\n\t\t\t\t\t}) !== false)) {\n\t\t\t\t\tif (tcpTag) { // We are modifying a tag contextual parameter ~foo (e.g. from within block) so update 'owner' tag: tcpTag\n\t\t\t\t\t\tif ((m = tcpTag._.toIndex[to.ind]) !== undefined) {\n\t\t\t\t\t\t\ttcpTag.updateValue(sourceValue, m, to.tagElse, undefined, undefined, ev); // if doesn't map, don't update, or update scoped tagCtxPrm. But should initialize from outer from binding...\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttcpTag.setValue(sourceValue, to.ind, to.tagElse);\n\t\t\t\t\t} else if (sourceValue !== undefined && target) {\n\t\t\t\t\t\tif ((tcpTag = ev && (sourceEl = ev.target)._jsvInd === l && sourceEl._jsvLkEl) && (m = tcpTag._.fromIndex[l]) !== undefined) {\n\t\t\t\t\t\t\t// The source is a tag linkedElem (linkedElement: [..., \"elemSelector\", ...], which is updating\n\t\t\t\t\t\t\ttcpTag.setValue(origVals[l], m, sourceEl._jsvElse);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (target._cpfn) {\n\t\t\t\t\t\t\tcontextCb = linkCtx._ctxCb; // This is the exprOb for a computed property\n\t\t\t\t\t\t\texprOb = target;\n\t\t\t\t\t\t\ttarget = linkCtx.data;\n\t\t\t\t\t\t\tif (exprOb._cpCtx) { // Computed value for a contextual parameter\n\t\t\t\t\t\t\t\ttarget = exprOb.data; // The data for the contextual view (where contextual param expression evaluated/assigned)\n\t\t\t\t\t\t\t\tcontextCb = exprOb._cpCtx; // Context callback for contextual view\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twhile (exprOb && exprOb.sb) { // Step through chained computed values to leaf one...\n\t\t\t\t\t\t\t\ttarget = contextCb(exprOb);\n\t\t\t\t\t\t\t\texprOb = exprOb.sb;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$observable(target, async).setProperty(to[1], sourceValue, undefined, to.isCpfn); // 2way binding change event - observably updating bound object\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (tag) {\n\t\ttag._.chg = undefined; // Clear marker\n\t\treturn tag;\n\t}\n}\n\nfunction onElemChange(ev) {\n\tvar bindId, val,\n\t\tsource = ev.target,\n\t\tfromAttr = defaultAttr(source),\n\t\tsetter = fnSetters[fromAttr];\n\n\tif (!source._jsvTr || ev.delegateTarget !== activeBody && source.type !== \"number\" || ev.type === \"input\") {\n\t\t// If this is an element using trigger, ignore event delegated (bubbled) to activeBody\n\t\tval = $isFunction(fromAttr)\n\t\t\t? fromAttr(source)\n\t\t\t: setter\n\t\t\t\t? $(source)[setter]()\n\t\t\t\t: $(source).attr(fromAttr);\n\n\t\tsource._jsvChg = 1; // // Set 'changing' marker to prevent linkedElem change event triggering its own refresh\n\t\trSplitBindings.lastIndex = 0; // Ensure starts at zero\n\t\twhile (bindId = rSplitBindings.exec(source._jsvBnd)) {\n\t\t\t// _jsvBnd is a string with the syntax: \"&bindingId1&bindingId2\"\n\t\t\tupdateValue(val, source._jsvInd, source._jsvElse, undefined, bindId[1], ev);\n\t\t}\n\t\tsource._jsvChg = undefined; // Clear marker\n\t}\n}\n\nfunction onDataLinkedTagChange(ev, eventArgs) {\n\t// Update or initial rendering of any tag (including {{:}}) whether inline or data-linked element.\n\tvar attr, sourceValue, noUpdate, forceUpdate, hasError, onError, bindEarly, tagCtx, l,\n\t\tlinkCtx = this,\n\t\tlinkFn = linkCtx.fn,\n\t\ttag = linkCtx.tag,\n\t\tsource = linkCtx.data,\n\t\ttarget = linkCtx.elem,\n\t\tcvt = linkCtx.convert,\n\t\tparentElem = target.parentNode,\n\t\tview = linkCtx.view,\n\t\toldLinkCtx = view._lc,\n\t\tonEvent = eventArgs && changeHandler(view, onBeforeChangeStr, tag);\n\n\tif (parentElem && (!onEvent || onEvent.call(tag || linkCtx, ev, eventArgs) !== false)\n\t\t\t// If data changed, the ev.data is set to be the path. Use that to filter the handler action...\n\t\t\t&& (!eventArgs || ev.data.prop === \"*\" || ev.data.prop === eventArgs.path)) {\n\n\t\t// Set linkCtx on view, dynamically, just during this handler call\n\t\tview._lc = linkCtx;\n\n\t\tif (eventArgs || linkCtx._toLk) {\n\t\t\t// If eventArgs are defined, this is a data update\n\t\t\t// Otherwise this is the initial data-link rendering call. Bind on this the first time it gets called\n\t\t\tlinkCtx._toLk = 0; // Remove flag to skip unneccessary rebinding next time\n\t\t\tif (linkFn._er) {\n\t\t\t\t// data-link=\"exprUsingTagOrCvt with onerror=...\" - e.g. {tag ... {cvt:... {:... convert='cvt'\n\t\t\t\ttry {\n\t\t\t\t\tsourceValue = linkFn(source, view, $sub); // Compiled link expression\n\t\t\t\t\t// For data-link=\"{:xxx}\" with no cvt or cvtBk returns value. Otherwise returns tagCtxs\n\t\t\t\t} catch (e) {\n\t\t\t\t\thasError = linkFn._er;\n\t\t\t\t\tonError = onRenderError(e,view,(new Function(\"data,view\", \"return \" + hasError + \";\"))(source, view));\n\t\t\t\t\tsourceValue = [{props: {}, args: [onError], tag: tag}];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsourceValue = linkFn(source, view, $sub); // Compiled link expression\n\t\t\t\t// For data-link=\"{:xxx}\" with no cvt or cvtBk returns value. Otherwise returns tagCtxs\n\t\t\t}\n\t\t\t// Compiled link expression for linkTag: return value for data-link=\"{:xxx}\" with no cvt or cvtBk, otherwise tagCtx or tagCtxs\n\t\t\tattr = tag && tag.attr || linkCtx.attr || (linkCtx._dfAt = defaultAttr(target, true, cvt !== undefined));\n\t\t\tif (linkCtx._dfAt === VALUE && (tag && tag.parentElem || linkCtx.elem).type === CHECKBOX) {\n\t\t\t\tattr = CHECKED; // This is a single checkbox (not in a checkboxgroup - which might have data-link=\"value{:...}\" so linkCtx.attr === VALUE, but would not have _dfAt === VALUE)\n\t\t\t}\n\t\t\t// For {{: ...}} without a convert or convertBack, (tag and linkFn._tag undefined) we already have the sourceValue, and we are done\n\t\t\tif (tag) {\n\t\t\t\t// Existing tag instance\n\t\t\t\tforceUpdate = hasError || tag._er;\n\t\t\t\t// If the new tagCtxs hasError or the previous tagCtxs had error, then force update\n\t\t\t\tsourceValue = sourceValue[0] ? sourceValue : [sourceValue];\n\n\t\t\t\t// Tag will update unless tag.onUpdate is false or is a function which returns false\n\t\t\t\tnoUpdate = !forceUpdate && (tag.onUpdate === false || eventArgs && $isFunction(tag.onUpdate) && tag.onUpdate(ev, eventArgs, sourceValue) === false);\n\n\t\t\t\tmergeCtxs(tag, sourceValue, forceUpdate); // Merge new tagCtxs (in sourceValue var) with current tagCtxs on tag instance\n\n\t\t\t\tif (tag._.chg && (attr === HTML || attr === VALUE) || noUpdate || attr === NONE) {\n\t\t\t\t\t// This is an update coming from the tag itself (linkedElem change), or else onUpdate returned false, or attr === \"none\"\n\t\t\t\t\tcallAfterLink(tag, ev, eventArgs);\n\t\t\t\t\tif (!tag._.chg) {\n\t\t\t\t\t\t// onUpdate returned false, or attr === \"none\" - so don't refresh the tag: we just use the new tagCtxs merged\n\t\t\t\t\t\t// from the sourceValue (which may optionally have been modifed in onUpdate()...) and then bind, and we are done\n\t\t\t\t\t\tobserveAndBind(linkCtx, source, target);\n\t\t\t\t\t}\n\t\t\t\t\t// Remove dynamically added linkCtx from view\n\t\t\t\t\tview._lc = oldLinkCtx;\n\t\t\t\t\tif (eventArgs && (onEvent = changeHandler(view, onAfterChangeStr, tag))) {\n\t\t\t\t\t\tonEvent.call(tag || linkCtx, ev, eventArgs);\n\t\t\t\t\t}\n\t\t\t\t\tif (tag.tagCtx.props.dataMap) {\n\t\t\t\t\t\ttag.tagCtx.props.dataMap.map(tag.tagCtx.args[0], tag.tagCtx, tag.tagCtx.map, isRenderCall || !tag._.bnd);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (tag.onUnbind) {\n\t\t\t\t\ttag.onUnbind(tag.tagCtx, linkCtx, tag.ctx, ev, eventArgs);\n\t\t\t\t}\n\n\t\t\t\ttag.linkedElems = tag.linkedElem = tag.mainElem = tag.displayElem = undefined;\n\t\t\t\tl = tag.tagCtxs.length;\n\t\t\t\twhile (l--) {\n\t\t\t\t\ttagCtx = tag.tagCtxs[l];\n\t\t\t\t\ttagCtx.linkedElems = tagCtx.mainElem = tagCtx.displayElem = undefined;\n\t\t\t\t}\n\n\t\t\t\tsourceValue = tag.tagName === \":\" // Call convertVal if it is a {{cvt:...}} - otherwise call renderTag\n\t\t\t\t\t? $sub._cnvt(tag.convert, view, sourceValue[0]) // convertVal(converter, view, tagCtx, onError)\n\t\t\t\t\t: $sub._tag(tag, view, view.tmpl, sourceValue, true, onError); // renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError)\n\t\t\t} else if (linkFn._tag) {\n\t\t\t\t// For {{: ...}} with either cvt or cvtBack we call convertVal to get the sourceValue and instantiate the tag\n\t\t\t\t// If cvt is undefined then this is a tag, and we call renderTag to get the rendered content and instantiate the tag\n\t\t\t\tcvt = cvt === \"\" ? TRUE : cvt; // If there is a cvtBack but no cvt, set cvt to \"true\"\n\t\t\t\tsourceValue = cvt // Call convertVal if it is a {{cvt:...}} - otherwise call renderTag\n\t\t\t\t\t? $sub._cnvt(cvt, view, sourceValue[0] || sourceValue) // convertVal(converter, view, tagCtx, onError)\n\t\t\t\t\t: $sub._tag(linkFn._tag, view, view.tmpl, sourceValue, true, onError); // renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError)\n\n\t\t\t\taddLinkMethods(tag = linkCtx.tag); // In both convertVal and renderTag we have instantiated a tag\n\t\t\t\tattr = linkCtx.attr || attr; // linkCtx.attr may have been set to tag.attr during tag instantiation in renderTag\n\t\t\t}\n\t\t\tif (bindEarly = tag && (!tag.inline || linkCtx.fn._lr) && tag.template) {\n\t\t\t\t// Data-linked tags with templated contents need to be data-linked before their contents, so that observable updates\n\t\t\t\t// will trigger the parent tags before the child tags.\n\t\t\t\tobserveAndBind(linkCtx, source, target);\n\t\t\t}\n\t\t\tupdateContent(sourceValue, linkCtx, attr, tag);\n\t\t\tlinkCtx._noUpd = 0; // For data-link=\"^{...}\" remove _noUpd flag so updates on subsequent calls\n\n\t\t\tif (tag) {\n\t\t\t\ttag._er = hasError;\n\t\t\t\tcallAfterLink(tag, ev, eventArgs);\n\t\t\t}\n\t\t}\n\n\t\tif (!bindEarly) {\n\t\t\tobserveAndBind(linkCtx, source, target);\n\t\t}\n\n\t\tif (tag && tag._.ths) {\n\t\t\t// Tag has a this=expr binding for which we have created an additional 'to' (defineBindToDataTargets) target (at index bindTo.length)\n\t\t\t// We now have the this pointer, so we push it to the binding, using updateValue(index)\n\t\t\ttag.updateValue(tag, tag.bindTo ? tag.bindTo.length : 1); // If bindTo not defined yet, it will be [0], so length 1\n\t\t}\n\n\t\tif (eventArgs && (onEvent = changeHandler(view, onAfterChangeStr, tag))) {\n\t\t\tonEvent.call(tag || linkCtx, ev, eventArgs);\n\t\t}\n\t\t// Remove dynamically added linkCtx from view\n\t\tview._lc = oldLinkCtx;\n\t}\n}\n\nfunction setDefer(elem, value) {\n\telem._df = value; // Use both an expando and an attribute to track deferred tokens. Attribute is needed for querySelectorAll for getViewInfos (childTags)\n\telem[(value ? \"set\" : \"remove\") + \"Attribute\"](deferAttr, \"\");\n}\n\nfunction updateContent(sourceValue, linkCtx, attr, tag) {\n\t// When called for a tag, either in tag.refresh() or onDataLinkedTagChange(), returns tag\n\t// When called (in onDataLinkedTagChange) for target HTML returns true\n\t// When called (in onDataLinkedTagChange) for other targets returns boolean for \"changed\"\n\tvar setter, prevNode, nextNode, late, nodesToRemove, useProp, tokens, id, openIndex, closeIndex, testElem, nodeName, cStyle, jsvSel,\n\t\trenders = attr !== NONE && sourceValue !== undefined && !linkCtx._noUpd && !((attr === VALUE || attr === HTML) && (!tag && linkCtx.elem._jsvChg)),\n\t\t// For data-link=\"^{...}\", don't update the first time (no initial render) - e.g. to leave server rendered values.\n\t\tsource = linkCtx.data,\n\t\ttarget = tag && tag.parentElem || linkCtx.elem,\n\t\ttargetParent = target.parentNode,\n\t\t$target = $(target),\n\t\tview = linkCtx.view,\n\t\ttargetVal = linkCtx._val,\n\t\tchange = tag;\n\n\tif (tag) {\n\t\t// Initialize the tag with element references\n\t\ttag._.unlinked = true; // Set to unlinked, so initialization is triggered after re-rendering, e.g. for setting linkedElem, and calling onBind\n\t\ttag.parentElem = tag.parentElem || (linkCtx.expr || tag._elCnt) ? target : targetParent;\n\t\tprevNode = tag._prv;\n\t\tnextNode = tag._nxt;\n\t}\n\tif (!renders) {\n\t\tlinkCtx._val = sourceValue;\n\t\treturn;\n\t}\n\n\tif (attr === \"visible\") {\n\t\tattr = \"css-display\";\n\t}\n\tif (/^css-/.test(attr)) {\n\t\tif (linkCtx.attr === \"visible\") {\n\t\t\t// Get the current display style\n\t\t\tcStyle = (target.currentStyle || getComputedStyle.call(global, target, \"\")).display;\n\n\t\t\tif (sourceValue) {\n\t\t\t\t// We are showing the element.\n\t\t\t\t// Get the cached 'visible' display value from the -jsvd expando\n\t\t\t\tsourceValue = target._jsvd\n\t\t\t\t\t// Or, if not yet cached, get the current display value\n\t\t\t\t\t|| cStyle;\n\t\t\t\tif (sourceValue === NONE && !(sourceValue = displayStyles[nodeName = target.nodeName])) {\n\t\t\t\t\t// Currently display value is 'none', and the 'visible' style has not been cached.\n\t\t\t\t\t// We create an element to find the correct 'visible' display style for this nodeName\n\t\t\t\t\ttestElem = document.createElement(nodeName);\n\t\t\t\t\tdocument.body.appendChild(testElem);\n\n\t\t\t\t\t// Get the default style for this HTML tag to use as 'visible' style\n\t\t\t\t\tsourceValue\n\t\t\t\t\t\t// and cache it as a hash against nodeName\n\t\t\t\t\t\t= displayStyles[nodeName]\n\t\t\t\t\t\t= (testElem.currentStyle || getComputedStyle.call(global, testElem, \"\")).display;\n\t\t\t\t\tdocument.body.removeChild(testElem);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We are hiding the element.\n\t\t\t\t// Cache the current display value as 'visible' style, on _jsvd expando, for when we show the element again\n\t\t\t\ttarget._jsvd = cStyle;\n\t\t\t\tsourceValue = NONE; // Hide the element\n\t\t\t}\n\t\t}\n\t\tif (change = change || targetVal !== sourceValue) {\n\t\t\t$.style(target, attr.slice(4), sourceValue);\n\t\t}\n\t} else if (attr !== \"link\") { // attr === \"link\" is for tag controls which do data binding but have no rendered output or target\n\t\tif (/^data-/.test(attr)) {\n\t\t\t$.data(target, attr.slice(5), sourceValue); // Support for binding to data attributes: data-foo{:expr}: data-foo attribute will be\n\t\t\t// expr.toString(), but $.data(element, \"foo\") and $(element).data(\"foo\") will actually return value of expr, even if of type object\n\t\t} else if (/^prop-/.test(attr)) {\n\t\t\tuseProp = true;\n\t\t\tattr = attr.slice(5);\n\t\t} else if (attr === CHECKED) {\n\t\t\tuseProp = true;\n\t\t\tif (target.name && $isArray(sourceValue)) {\n\t\t\t\ttarget._jsvSel = sourceValue; // Checkbox group (possibly using {{checkboxgroup}} tag) data-linking to array of strings\n\t\t\t\tsourceValue = $inArray(target.value, sourceValue) > -1;\n\t\t\t} else {\n\t\t\t\tsourceValue = sourceValue && sourceValue !== \"false\";\n\t\t\t}\n\t\t\t// The string value \"false\" can occur with data-link=\"checked{attr:expr}\" - as a result of attr, and hence using convertVal()\n\t\t\t// We will set the \"checked\" property\n\t\t\t// We will compare this with the current value\n\t\t} else if (attr === RADIO) {\n\t\t\t// This is a special binding attribute for radio buttons, which corresponds to the default 'to' binding.\n\t\t\t// This allows binding both to value (for each input) and to the default checked radio button (for each input in named group,\n\t\t\t// e.g. binding to parent data).\n\t\t\t// Place value binding first: \n\t\t\t// or (allowing any order for the binding expressions):\n\t\t\t// \n\t\t\tuseProp = true;\n\t\t\tattr = CHECKED;\n\t\t\tsourceValue = target.value === sourceValue;\n\t\t\t// If the data value corresponds to the value attribute of this radio button input, set the checked property to true\n\t\t\t// Otherwise set the checked property to false\n\t\t} else if (attr === \"selected\" || attr === \"disabled\" || attr === \"multiple\" || attr === \"readonly\") {\n\t\t\tsourceValue = (sourceValue && sourceValue !== \"false\") ? attr : null;\n\t\t\t// Use attr, not prop, so when the options (for example) are changed dynamically, but include the previously selected value,\n\t\t\t// they will still be selected after the change\n\t\t} else if (attr === VALUE && target.nodeName === \"SELECT\") {\n\t\t\ttarget._jsvSel = $isArray(sourceValue)\n\t\t\t\t? sourceValue\n\t\t\t\t: \"\" + sourceValue; // If not array, coerce to string\n\t\t}\n\n\t\tif (setter = fnSetters[attr]) {\n\t\t\tif (attr === HTML) {\n\t\t\t\tif (tag && tag.inline) {\n\t\t\t\t\tnodesToRemove = tag.nodes(true);\n\t\t\t\t\tif (tag._elCnt) {\n\t\t\t\t\t\tif (prevNode && prevNode !== nextNode) { // nextNode !== prevNode\n\t\t\t\t\t\t\t// This prevNode will be removed from the DOM, so transfer the view tokens on prevNode to nextNode of this 'viewToRefresh'\n\t\t\t\t\t\t\ttransferViewTokens(prevNode, nextNode, target, tag._tgId, \"^\", true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// nextNode === prevNode, or there is no nextNode and so the target._df may have tokens\n\t\t\t\t\t\t\ttokens = prevNode ? prevNode.getAttribute(jsvAttrStr) : target._df;\n\t\t\t\t\t\t\tid = tag._tgId + \"^\";\n\t\t\t\t\t\t\topenIndex = tokens.indexOf(\"#\" + id) + 1;\n\t\t\t\t\t\t\tcloseIndex = tokens.indexOf(\"/\" + id);\n\n\t\t\t\t\t\t\tif (openIndex && closeIndex > 0) {\n\t\t\t\t\t\t\t\t// If prevNode, or target._df, include tokens referencing view and tag bindings contained within the open and close tokens\n\t\t\t\t\t\t\t\t// of the updated tag control, they need to be processed (disposed)\n\t\t\t\t\t\t\t\topenIndex += id.length;\n\t\t\t\t\t\t\t\tif (closeIndex > openIndex) {\n\t\t\t\t\t\t\t\t\tdisposeTokens(tokens.slice(openIndex, closeIndex)); // Dispose view and tag bindings\n\t\t\t\t\t\t\t\t\ttokens = tokens.slice(0, openIndex) + tokens.slice(closeIndex);\n\n\t\t\t\t\t\t\t\t\tif (prevNode) {\n\t\t\t\t\t\t\t\t\t\tprevNode.setAttribute(jsvAttrStr, tokens); // Remove tokens of replaced content\n\t\t\t\t\t\t\t\t\t} else if (target._df) { // Remove tokens of replaced content\n\t\t\t\t\t\t\t\t\t\tsetDefer(target, tokens);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprevNode = prevNode\n\t\t\t\t\t\t\t? prevNode.previousSibling\n\t\t\t\t\t\t\t: nextNode\n\t\t\t\t\t\t\t\t? nextNode.previousSibling\n\t\t\t\t\t\t\t\t: target.lastChild;\n\t\t\t\t\t}\n\t\t\t\t\t// Remove HTML nodes\n\t\t\t\t\t$(nodesToRemove).remove(); // Note if !tag._elCnt removing the nodesToRemove will process and dispose view and tag bindings contained within the updated tag control\n\n\t\t\t\t\t// Insert and link new content\n\t\t\t\t\tlate = view.link(view.data, target, prevNode, nextNode, sourceValue, tag && {tag: tag._tgId});\n\t\t\t\t} else {\n\t\t\t\t\t// data-linked value targeting innerHTML: data-link=\"html{:expr}\" or contenteditable=\"true\"\n\t\t\t\t\trenders = renders && targetVal !== sourceValue;\n\t\t\t\t\tif (renders) {\n\t\t\t\t\t\t$target.empty();\n\t\t\t\t\t\tlate = view.link(source, target, prevNode, nextNode, sourceValue, tag && {tag: tag._tgId});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (target._jsvSel) {\n\t\t\t\t$target[setter](sourceValue); // (or multiselect)\n\t\t\t} else {\n\t\t\t\tif (change = change || targetVal !== sourceValue) {\n\t\t\t\t\tif (attr === \"text\" && target.children && !target.children[0]) {\n\t\t\t\t\t\t// This code is faster then $target.text()\n\t\t\t\t\t\ttarget[TEXTCONTENT] = sourceValue === null ? \"\" : sourceValue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$target[setter](sourceValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ((jsvSel = targetParent._jsvSel) !== undefined\n\t\t\t\t\t// Setting value of element\n\t\t\t\t\t&& (attr === VALUE || $target.attr(VALUE) === undefined)) { // Setting value attribute, or setting textContent if attribute is null\n\t\t\t\t\t// Set/unselect selection based on value set on parent . Works for multiselect too\n\t\t\t\t\ttarget.selected = $inArray(\"\" + sourceValue, $isArray(jsvSel) ? jsvSel : [jsvSel]) > -1;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (change = change || targetVal !== sourceValue) {\n\t\t\t// Setting an attribute to undefined should remove the attribute\n\t\t\t$target[useProp ? \"prop\" : \"attr\"](attr, sourceValue === undefined && !useProp ? null : sourceValue);\n\t\t}\n\t}\n\tlinkCtx._val = sourceValue;\n\tlateLink(late); // Do any deferred linking (lateRender)\n\treturn change;\n}\n\nfunction arrayChangeHandler(ev, eventArgs) { // array change handler for 'array' views\n\tvar self = this,\n\t\tonBeforeChange = changeHandler(self, onBeforeChangeStr, self.tag),\n\t\tonAfterChange = changeHandler(self, onAfterChangeStr, self.tag);\n\tif (!onBeforeChange || onBeforeChange.call(self, ev, eventArgs) !== false) {\n\t\tif (eventArgs) {\n\t\t\t// This is an observable action (not a trigger/handler call from pushValues, or similar, for which eventArgs will be null)\n\t\t\tvar action = eventArgs.change,\n\t\t\t\tindex = eventArgs.index,\n\t\t\t\titems = eventArgs.items;\n\t\t\tself._.srt = eventArgs.refresh; // true if part of a 'sort' on refresh\n\t\t\tswitch (action) {\n\t\t\t\tcase \"insert\":\n\t\t\t\t\tself.addViews(index, items, eventArgs._dly);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"remove\":\n\t\t\t\t\tself.removeViews(index, items.length, undefined, eventArgs._dly);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"move\":\n\t\t\t\t\tself.moveViews(eventArgs.oldIndex, index, items.length);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"refresh\":\n\t\t\t\t\tself._.srt = undefined;\n\t\t\t\t\tself.fixIndex(0);\n\t\t\t\t\t// Other cases: (e.g.undefined, for setProperty on observable object) etc. do nothing\n\t\t\t}\n\t\t}\n\t\tif (onAfterChange) {\n\t\t\tonAfterChange.call(self, ev, eventArgs);\n\t\t}\n\t}\n}\n\n//=============================\n// Utilities for event handlers\n//=============================\n\nfunction setArrayChangeLink(view) {\n\t// Add/remove arrayChange handler on view\n\tvar handler, arrayBinding,\n\t\ttype = view.type, // undefined if view is being removed\n\t\tdata = view.data,\n\t\tbound = view._.bnd; // true for top-level link() or data-link=\"{for}\", or the for tag instance for {^{for}} (or for any custom tag that has an onArrayChange handler)\n\n\tif (!view._.useKey && bound) {\n\t\t// This is an array view. (view._.useKey not defined => data is array), and is data-bound to collection change events\n\n\t\tif (arrayBinding = view._.bndArr) {\n\t\t\t// First remove the current handler if there is one\n\t\t\t$([arrayBinding[1]]).off(arrayChangeStr, arrayBinding[0]);\n\t\t\tview._.bndArr = undefined;\n\t\t}\n\t\tif (bound !== !!bound) {\n\t\t\t// bound is not a boolean, so it is the data-linked tag that 'owns' this array binding - e.g. {^{for...}}\n\t\t\tif (type) {\n\t\t\t\tbound._.arrVws[view._.id] = view;\n\t\t\t} else {\n\t\t\t\tdelete bound._.arrVws[view._.id]; // if view.type is undefined, view is being removed\n\t\t\t}\n\t\t} else if (type && data) {\n\t\t\t// If this view is not being removed, but the data array has been replaced, then bind to the new data array\n\t\t\thandler = function(ev) {\n\t\t\t\tif (!(ev.data && ev.data.off)) {\n\t\t\t\t\t// Skip if !!ev.data.off: - a handler that has already been removed (maybe was on handler collection at call time - then removed by another handler)\n\t\t\t\t\t// If view.type is undefined, do nothing. (Corresponds to case where there is another handler on the same data whose\n\t\t\t\t\t// effect was to remove this view, and which happened to precede this event in the trigger sequence. So although this\n\t\t\t\t\t// event has been removed now, it is still called since already on the trigger sequence)\n\t\t\t\t\tarrayChangeHandler.apply(view, arguments);\n\t\t\t\t}\n\t\t\t};\n\t\t\t$([data]).on(arrayChangeStr, handler);\n\t\t\tview._.bndArr = [handler, data];\n\t\t}\n\t}\n}\n\nfunction defaultAttr(elem, to, linkGetVal) {\n\t// to: true - default attribute for setting data value on HTML element; false: default attribute for getting value from HTML element\n\t// Merge in the default attribute bindings for this target element\n\tvar nodeName = elem.nodeName.toLowerCase(),\n\t\tattr =\n\t\t\t$subSettingsAdvanced._fe[nodeName] // get form element binding settings for input textarea select or optgroup\n\t\t\t|| elem.contentEditable === TRUE && {to: HTML, from: HTML}; // Or if contentEditable set to \"true\" set attr to \"html\"\n\treturn attr\n\t\t? (to\n\t\t\t? ((nodeName === \"input\" && elem.type === RADIO) // For radio buttons, bind from value, but bind to 'radio' - special value.\n\t\t\t\t? RADIO\n\t\t\t\t: attr.to)\n\t\t\t: attr.from)\n\t\t: to\n\t\t\t? linkGetVal ? \"text\" : HTML // Default innerText for data-link=\"a.b.c\" or data-link=\"{:a.b.c}\" (with or without converters)- otherwise innerHTML\n\t\t\t: \"\"; // Default is not to bind from\n}\n\n//==============================\n// Rendering and DOM insertion\n//==============================\n\nfunction renderAndLink(view, index, tmpl, views, data, context, refresh) {\n\tvar html, linkToNode, prevView, nodesToRemove, bindId,\n\t\tparentNode = view.parentElem,\n\t\tprevNode = view._prv,\n\t\tnextNode = view._nxt,\n\t\telCnt = view._elCnt;\n\n\tif (prevNode && prevNode.parentNode !== parentNode) {\n\t\terror(\"Missing parentNode\");\n\t\t// Abandon, since node has already been removed, or wrapper element has been inserted between prevNode and parentNode\n\t}\n\n\tif (refresh) {\n\t\tnodesToRemove = view.nodes();\n\t\tif (elCnt && prevNode && prevNode !== nextNode) {\n\t\t\t// This prevNode will be removed from the DOM, so transfer the view tokens on prevNode to nextNode of this 'viewToRefresh'\n\t\t\ttransferViewTokens(prevNode, nextNode, parentNode, view._.id, \"_\", true);\n\t\t}\n\t\t// Remove child views\n\t\tview.removeViews(undefined, undefined, true);\n\t\tlinkToNode = nextNode;\n\n\t\tif (elCnt) {\n\t\t\tprevNode = prevNode\n\t\t\t\t? prevNode.previousSibling\n\t\t\t\t: nextNode\n\t\t\t\t\t? nextNode.previousSibling\n\t\t\t\t\t: parentNode.lastChild;\n\t\t}\n\n\t\t// Remove HTML nodes\n\t\t$(nodesToRemove).remove();\n\n\t\tfor (bindId in view._.bnds) {\n\t\t\t// The view bindings may have already been removed above in: $(nodesToRemove).remove();\n\t\t\t// If not, remove them here:\n\t\t\tremoveViewBinding(bindId);\n\t\t}\n\t} else {\n\t\t// addViews. Only called if view is of type \"array\"\n\t\tif (index) {\n\t\t\t// index is a number, so indexed view in view array\n\t\t\tprevView = views[index - 1];\n\t\t\tif (!prevView) {\n\t\t\t\treturn false; // If subview for provided index does not exist, do nothing\n\t\t\t}\n\t\t\tprevNode = prevView._nxt;\n\t\t}\n\t\tif (elCnt) {\n\t\t\tlinkToNode = prevNode;\n\t\t\tprevNode = linkToNode\n\t\t\t\t? linkToNode.previousSibling // There is a linkToNode, so insert after previousSibling, or at the beginning\n\t\t\t\t: parentNode.lastChild; // If no prevView and no prevNode, index is 0 and the container is empty,\n\t\t\t\t// so prevNode = linkToNode = null. But if prevView._nxt is null then we set prevNode to parentNode.lastChild\n\t\t\t\t// (which must be before the prevView) so we insert after that node - and only link the inserted nodes\n\t\t} else {\n\t\t\tlinkToNode = prevNode.nextSibling;\n\t\t}\n\t}\n\thtml = tmpl.render(data, context, view._.useKey && refresh, view, refresh || index, true);\n\t// Pass in view._.useKey as test for noIteration (which corresponds to when self._.useKey > 0 and self.data is an array)\n\n\t// Link the new HTML nodes to the data\n\tlateLink(view.link(data, parentNode, prevNode, linkToNode, html, prevView));\n}\n\n//=====================\n// addBindingMarkers\n//=====================\n\nfunction addBindingMarkers(value, view, tag) {\n\t// Insert binding markers into the rendered template output, which will get converted to appropriate\n\t// data-jsv attributes (element-only content) or script marker nodes (phrasing or flow content), in convertMarkers,\n\t// within view.link, prior to inserting into the DOM. Linking will then bind based on these markers in the DOM.\n\t// Added view markers: #m_...VIEW.../m_\n\t// Added tag markers: #m^...TAG..../m^\n\tvar id, end;\n\tif (tag) {\n\t\t// This is a binding marker for a data-linked tag {^{...}}\n\t\tend = \"^`\";\n\t\taddLinkMethods(tag); // This is {^{>...}} or {^{tag ...}}, {{cvt:...} or {^{:...}}, and tag was defined in convertVal or renderTag\n\t\tid = tag._tgId;\n\t\tif (!id) {\n\t\t\tbindingStore[id = bindingKey++] = tag; // Store the tag temporarily, ready for databinding.\n\t\t\t// During linking, in addDataBinding, the tag will be attached to the linkCtx,\n\t\t\t// and then in observeAndBind, bindingStore[bindId] will be replaced by binding info.\n\t\t\ttag._tgId = \"\" + id;\n\t\t}\n\t} else {\n\t\t// This is a binding marker for a view\n\t\t// Add the view to the store of current linked views\n\t\tend = \"_`\";\n\t\tviewStore[id = view._.id] = view;\n\t}\n\t// Example: \"#23^TheValue/23^\"\n\treturn \"#\" + id + end\n\t\t+ (value != undefined ? value : \"\") // For {^{:name}} this gives the equivalent semantics to compiled\n\t\t\t\t\t\t\t\t\t\t\t// (v=data.name)!=null?v:\"\"; used in {{:name}} or data-link=\"name\"\n\t\t+ \"/\" + id + end;\n}\n\n//==============================\n// Data-linking and data binding\n//==============================\n\n//---------------\n// observeAndBind\n//---------------\n\nfunction observeAndBind(linkCtx, source, target) {\n\tvar binding, l, k, linkedElem, exprFnDeps, exprOb, prop, propDeps, depends, tagDepends, bindId, linkedElems,\n\t\ttag = linkCtx.tag,\n\t\tallowArray = !tag,\n\t\tcvtBk = linkCtx.convertBack,\n\t\thandler = linkCtx._hdl;\n\tsource = typeof source === \"object\" && source; // If not an object set to false\n\n\tif (tag) {\n\t\t// Use the 'depends' paths set on linkCtx.tag, or on the converter\n\t\t// - which may have been set on declaration or in events: init, render, onAfterLink etc.\n\t\tif (depends = tag.convert) {\n\t\t\tdepends = depends === TRUE ? tag.tagCtx.props.convert : depends;\n\t\t\tdepends = linkCtx.view.getRsc(\"converters\", depends) || depends;\n\t\t\tdepends = depends && depends.depends;\n\t\t\tdepends = depends && $sub._dp(depends, source, handler); // dependsPaths\n\t\t}\n\t\tif (tagDepends = tag.tagCtx.props.depends || tag.depends) {\n\t\t\ttagDepends = $sub._dp(tagDepends, tag, handler);\n\t\t\tdepends = depends ? depends.concat(tagDepends) : tagDepends;\n\t\t}\n\t\tlinkedElems = tag.linkedElems;\n\t}\n\tdepends = depends || [];\n\tif (!linkCtx._depends || (\"\" + linkCtx._depends !== \"\" + depends)) {\n\t\t// Only bind the first time, or if the new depends (toString) has changed from when last bound\n\n\t\texprFnDeps = linkCtx.fn.deps.slice(); // Make a copy of the dependency paths for the compiled linkCtx expression - to pass to observe(). In getInnerCb(),\n\t\t// (and whenever the object is updated, in innerCb), we will set exprOb.ob to the current object returned by that computed expression, for this view.\n\n\t\tif (linkCtx._depends) {\n\t\t\tbindId = linkCtx._depends.bdId;\n\t\t\t// Unobserve previous binding\n\t\t\t$observable._apply(1, [source], exprFnDeps, linkCtx._depends, handler, linkCtx._ctxCb, true);\n\t\t}\n\n\t\tif (tag) {\n\t\t\t// Add dependency paths for declared boundProps (so no need to write ^myprop=... to get binding) and for linkedProp too if there is one\n\t\t\tl = tag.boundProps.length;\n\t\t\twhile (l--) {\n\t\t\t\tprop = tag.boundProps[l];\n\t\t\t\tk = tag._.bnd.paths.length;\n\t\t\t\twhile (k--) { // Iterate across tagCtxs\n\t\t\t\t\tpropDeps = tag._.bnd.paths[k][\"_\" + prop];\n\t\t\t\t\tif (propDeps && propDeps.length && propDeps.skp) { // Not already a bound prop ^prop=expression;\n\t\t\t\t\t\texprFnDeps = exprFnDeps.concat(propDeps); // Add dependencies for this prop expression\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tallowArray = tag.onArrayChange === undefined || tag.onArrayChange === true;\n\t\t}\n\n\t\tl = exprFnDeps.length;\n\t\twhile (l--) {\n\t\t\texprOb = exprFnDeps[l];\n\t\t\tif (exprOb._cpfn) {\n\t\t\t\t// This path is an 'exprOb', corresponding to a computed property returning an object. We replace the exprOb by\n\t\t\t\t// a view-binding-specific exprOb instance. The current object will be stored as exprOb.ob.\n\t\t\t\texprFnDeps[l] = $extend({}, exprOb);\n\t\t\t}\n\t\t}\n\t\tbinding = $observable._apply(\n\t\t\tallowArray ? 0 : 1, // 'this' pointer for observeAndBind, used to set allowArray to 1 or 0.\n\t\t\t[source],\n\t\t\texprFnDeps, // flatten the paths - to gather all the dependencies across args and bound params\n\t\t\tdepends,\n\t\t\thandler,\n\t\t\tlinkCtx._ctxCb);\n\t\t// The binding returned by $observe has a bnd array with the source objects of the individual bindings.\n\n\t\tif (!bindId) {\n\t\t\tbindId = linkCtx._bndId || \"\" + bindingKey++;\n\t\t\tlinkCtx._bndId = undefined;\n\t\t\t// Store the binding key on the view and on the element, for disposal when the view is removed\n\t\t\ttarget._jsvBnd = (target._jsvBnd || \"\") + \"&\" + bindId;\n\t\t\tlinkCtx.view._.bnds[bindId] = bindId;\n\t\t}\n\n\t\tbinding.elem = target; // The target of all the individual bindings\n\t\tbinding.linkCtx = linkCtx;\n\t\tbinding._tgId = bindId;\n\n\t\tdepends.bdId = bindId;\n\t\tlinkCtx._depends = depends;\n\t\t// Store the binding.\n\t\tbindingStore[bindId] = binding; // Note: If this corresponds to a data-linked tag, we are replacing the\n\t\t// temporarily stored tag by the stored binding. The tag will now be at binding.linkCtx.tag\n\n\t\tif (linkedElems || cvtBk !== undefined || tag && tag.bindTo) {\n\t\t\tdefineBindToDataTargets(binding, tag, cvtBk);\n\t\t}\n\t\tif (linkedElems) {\n\t\t\tl = linkedElems.length;\n\t\t\twhile (l--) {\n\t\t\t\tlinkedElem = linkedElems[l];\n\t\t\t\tk = linkedElem && linkedElem.length;\n\t\t\t\twhile (k--) {\n\t\t\t\t\tif (linkedElem[k]._jsvLkEl) {\n\t\t\t\t\t\tif (!linkedElem[k]._jsvBnd) {\n\t\t\t\t\t\t\tlinkedElem[k]._jsvBnd = \"&\" + bindId + \"+\"; // Add a \"+\" for cloned binding - so removing\n\t\t\t\t\t\t\t// elems with cloned bindings will not remove the 'parent' binding from the bindingStore.\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlinkedElem[k]._jsvLkEl = tag;\n\t\t\t\t\t\tbindLinkedElChange(tag, linkedElem[k]);\n\t\t\t\t\t\tlinkedElem[k]._jsvBnd = \"&\" + bindId + \"+\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cvtBk !== undefined) {\n\t\t\tbindLinkedElChange(tag, target);\n\t\t}\n\n\t\tif (tag && !tag.inline) {\n\t\t\tif (!tag.flow) {\n\t\t\t\ttarget.setAttribute(jsvAttrStr, (target.getAttribute(jsvAttrStr)||\"\") + \"#\" + bindId + \"^/\" + bindId + \"^\");\n\t\t\t}\n\t\t\ttag._tgId = \"\" + bindId;\n\t\t}\n\t}\n}\n\n//-------\n// $.link\n//-------\n\nfunction lateLink(late) {\n\t// Do any deferred linking (lateRender)\n\tvar lnkCtx;\n\tif (late) {\n\t\twhile (lnkCtx = late.pop()) {\n\t\t\tlnkCtx._hdl();\n\t\t}\n\t}\n}\n\nfunction tmplLink(to, from, context, noIteration, parentView, prevNode, nextNode) {\n\treturn $link(this, to, from, context, noIteration, parentView, prevNode, nextNode);\n}\n\nfunction $link(tmplOrLinkExpr, to, from, context, noIteration, parentView, prevNode, nextNode) {\n\t// When linking from a template, prevNode and nextNode parameters are ignored\n\tif (context === true) {\n\t\tnoIteration = context; // passing boolean as third param - noIteration\n\t\tcontext = undefined;\n\t} else if (typeof context !== \"object\") {\n\t\tcontext = undefined; // context must be a boolean (noIteration) or a plain object\n\t} else {\n\t\tcontext = $extend({}, context);\n\t}\n\tif (tmplOrLinkExpr && to) {\n\t\tto = to.jquery ? to : $(to); // to is a jquery object or an element or selector\n\n\t\tif (!activeBody) {\n\t\t\tactiveBody = document.body;\n\t\t\tuseInput = \"oninput\" in activeBody;\n\t\t\t$(activeBody)\n\t\t\t\t.on(elementChangeStr, onElemChange)\n\t\t\t\t.on('blur.jsv', '[contenteditable]', onElemChange);\n\t\t}\n\n\t\tvar i, k, html, vwInfos, view, placeholderParent, targetEl, refresh, late, prntView,\n\t\t\tonRender = addBindingMarkers,\n\t\t\treplaceMode = context && context.target === \"replace\",\n\t\t\tl = to.length;\n\n\t\twhile (l--) { // iterate over 'to' targets. (Usually one, but can be multiple)\n\t\t\ttargetEl = to[l];\n\n\t\t\tprntView = parentView || $view(targetEl);\n\t\t\tif (typeof tmplOrLinkExpr === STRING) {\n\t\t\t\t// tmplOrLinkExpr is a string: treat as data-link expression.\n\t\t\t\taddDataBinding(late = [], tmplOrLinkExpr, targetEl, prntView, undefined, \"expr\", from, context);\n\t\t\t} else {\n\t\t\t\tif (tmplOrLinkExpr.markup !== undefined) {\n\t\t\t\t\t// This is a call to template.link()\n\t\t\t\t\tif (replaceMode) {\n\t\t\t\t\t\tplaceholderParent = targetEl.parentNode;\n\t\t\t\t\t}\n\t\t\t\t\tprntView._.scp = true; // Set scope flag on prntView for link() call - used to set view.isTop for outermost view of created linked content\n\t\t\t\t\thtml = tmplOrLinkExpr.render(from, context, noIteration, prntView, undefined, onRender, true);\n\t\t\t\t\tprntView._.scp = undefined;\n\t\t\t\t\t// TODO Consider finding a way to bind data (link) within template without html being different for each view, the HTML can\n\t\t\t\t\t// be evaluated once outside the while (l--), and pushed into a document fragment, then cloned and inserted at each target.\n\n\t\t\t\t\tif (placeholderParent) {\n\t\t\t\t\t\t// This is target=\"replace\" mode\n\t\t\t\t\t\tprevNode = targetEl.previousSibling;\n\t\t\t\t\t\tnextNode = targetEl.nextSibling;\n\t\t\t\t\t\t$.cleanData([targetEl], true);\n\t\t\t\t\t\tplaceholderParent.removeChild(targetEl);\n\n\t\t\t\t\t\ttargetEl = placeholderParent;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprevNode = nextNode = undefined; // When linking from a template, prevNode and nextNode parameters are ignored\n\t\t\t\t\t\t$(targetEl).empty();\n\t\t\t\t\t}\n\t\t\t\t} else if (tmplOrLinkExpr === true && prntView === topView) {\n\t\t\t\t\t// $.link(true, selector, data, ctx) - where selector points to elem in top-level content. (If not top-level content, no-op)\n\t\t\t\t\trefresh = {lnk: \"top\"};\n\t\t\t\t} else {\n\t\t\t\t\tbreak; // no-op - $.link(true, selector, data, ctx) targeting within previously linked rendered template\n\t\t\t\t}\n\n// TODO Consider deferred linking API feature on per-template basis - {@{ instead of {^{ which allows the user to see the rendered content\n// before that content is linked, with better perceived perf. Have view.link return a deferred, and pass that to onAfterLink...\n// or something along those lines.\n// setTimeout(function() {\n\n\t\t\t\tif (targetEl._df && !nextNode) {\n\t\t\t\t\t// We are inserting new content and the target element has some deferred binding annotations,and there is no nextNode.\n\t\t\t\t\t// Those views may be stale views (that will be recreated in this new linking action) so we will first remove them\n\t\t\t\t\t// (if not already removed).\n\t\t\t\t\tvwInfos = viewInfos(targetEl._df, true, rOpenViewMarkers);\n\n\t\t\t\t\tfor (i = 0, k = vwInfos.length; i < k; i++) {\n\t\t\t\t\t\tview = vwInfos[i];\n\t\t\t\t\t\tif ((view = viewStore[view.id]) && view.data !== undefined) {\n\t\t\t\t\t\t\t// If this is the _prv (prevNode) for a view, remove the view\n\t\t\t\t\t\t\t// - unless view.data is undefined, in which case it is already being removed\n\t\t\t\t\t\t\tview.parent.removeViews(view._.key, undefined, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetDefer(targetEl); // remove defer tokens\n\t\t\t\t}\n\n\t\t\t\t// Link the content of the element, since this is a call to template.link(), or to $(el).link(true, ...),\n\t\t\t\tlate = prntView.link(from, targetEl, prevNode, nextNode, html, refresh, context);\n//});\n\t\t\t}\n\t\t\tlateLink(late); // Do any deferred linking (lateRender)\n\t\t}\n\t}\n\treturn to; // Allow chaining, to attach event handlers, etc.\n}\n\n//----------\n// view.link\n//----------\n\nfunction viewLink(outerData, parentNode, prevNode, nextNode, html, refresh, context, validateOnly) {\n\t// Optionally insert HTML into DOM using documentFragments (and wrapping HTML appropriately).\n\t// Data-link existing contents of parentNode, or the inserted HTML, if provided\n\n\t// Depending on the content model for the HTML elements, the standard data-linking markers inserted in the HTML by addBindingMarkers during\n\t// template rendering will be converted either to script marker nodes or, for element-only content sections, to data-jsv element annotations.\n\n\t// Data-linking will then add _prv and _nxt to views, where:\n\t// _prv: References the previous node (script element of type \"jsv123\"), or (for elCnt=true), the first element node in the view (or if none, set _prv = _nxt)\n\t// _nxt: References the last node (script element of type \"jsv/123\"), or (for elCnt=true), the next element node after the view.\n\n\t//==== nested functions ====\n\tfunction convertMarkers(all, preceding, selfClose, closeTag, spaceBefore, id, boundId, spaceAfter, tag1, tag2, closeTag2, spaceAfterClose, selfClose2, endOpenTag) {\n\t\t// rConvertMarkers = /(^|(\\/>)|<\\/(\\w+)>|)(\\s*)([#/]\\d+(?:_|(\\^)))`(\\s*)(<\\w+(?=[\\s\\/>]))?|\\s*(?:(<\\w+(?=[\\s\\/>]))|<\\/(\\w+)>(\\s*)|(\\/>)\\s*|(>))/g,\n\t\t// prec, slfCl, clsTag, spBefore, id, bndId spAfter,tag1, tag2, clTag2,sac slfCl2, endOpenTag\n\t\t// Convert the markers that were included by addBindingMarkers in template output, to appropriate DOM annotations:\n\t\t// data-jsv attributes (for element-only content) or script marker nodes (within phrasing or flow content).\n\n// TODO consider detecting 'quoted' contexts (attribute strings) so that attribute encoding does not need to encode >\n// Currently rAttrEncode = /[><\"'&]/g includes '>' encoding in order to avoid erroneous parsing of \"> \">\n\t\tvar errorMsg, bndId,\n\t\t\tendOfElCnt = \"\";\n\t\tif (endOpenTag) {\n\t\t\tinTag = 0;\n\t\t\treturn all;\n\t\t}\n\t\ttag = (tag1 || tag2 || \"\").toLowerCase();\n\t\tcloseTag = closeTag || closeTag2;\n\t\tselfClose = selfClose || selfClose2;\n\t\tif (isVoid && !selfClose && (!all || closeTag || tag || id && !inTag)) { // !all = end of string\n\t\t\tisVoid = undefined;\n\t\t\tparentTag = tagStack.shift(); // preceding tag was a void element, with no closing slash, such as .\n\t\t}\n\t\tcloseTag = closeTag || selfClose;\n\t\tif (closeTag) {\n\t\t\tcloseTag = closeTag.toLowerCase();\n\t\t\tinTag = 0;\n\t\t\tisVoid = undefined;\n\t\t\t// TODO: smart insertion of - to be completed for robust insertion of deferred bindings etc.\n\t\t\t//if (closeTag === \"table\" && parentTag === \"tbody\") {\n\t\t\t//\tpreceding = \" \" + preceding;\n\t\t\t//\tparentTag = \"table\";\n\t\t\t//\ttagStack.shift();\n\t\t\t//}\n\t\t\tif (validate) {\n\t\t\t\tif (selfClose || selfClose2) {\n\t\t\t\t\tif (!voidElems[parentTag] && !/;svg;|;math;/.test(\";\" + tagStack.join(\";\") + \";\")) {\n\t\t\t\t\t\t// Only self-closing elements must be legitimate void elements, such as , per HTML schema,\n\t\t\t\t\t\t// or under svg or math foreign namespace elements.\n\t\t\t\t\t\terrorMsg = \"'<\" + parentTag + \".../\";\n\t\t\t\t\t}\n\t\t\t\t} else if (voidElems[closeTag]) {\n\t\t\t\t\terrorMsg = \"'\" + closeTag; // closing tag such as \n\t\t\t\t} else if (!tagStack.length || closeTag !== parentTag) {\n\t\t\t\t\terrorMsg = \"Mismatch: '\" + closeTag;\n\t\t\t\t}\n\t\t\t\tif (errorMsg) {\n\t\t\t\t\tsyntaxError(errorMsg + \">' in:\\n\" + html);\n\t\t\t\t}\n\t\t\t}\n\t\t\tprevElCnt = elCnt;\n\t\t\tparentTag = tagStack.shift();\n\t\t\telCnt = elContent[parentTag];\n\t\t\tcloseTag2 = closeTag2 ? (\"\" + closeTag2 + \">\") : \"\";\n\t\t\tif (prevElCnt) {\n\t\t\t\t// If there are ids (markers since the last tag), move them to the defer string\n\t\t\t\tdefer += ids;\n\t\t\t\tids = \"\";\n\t\t\t\tif (!elCnt) {\n\t\t\t\t\tendOfElCnt = closeTag2 + openScript + \"@\" + defer + closeScript + (spaceAfterClose || \"\");\n\t\t\t\t\tdefer = deferStack.shift();\n\t\t\t\t} else {\n\t\t\t\t\tdefer += \"-\"; // Will be used for stepping back through deferred tokens\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (elCnt && !inTag) {\n\t\t\t// elContent maps tagNames which have only element content, so may not support script nodes.\n\t\t\t// We are in element-only content, can remove white space, and use data-jsv attributes on elements as markers\n\t\t\t// Example: - close marker for view 2 and open marker for view 6\n\n\t\t\tif (id) {\n\t\t\t\t// append marker for this id, to ids string\n\t\t\t\tids += id;\n\t\t\t} else {\n\t\t\t\tpreceding = (closeTag2 || selfClose2 || \"\");\n\t\t\t}\n\t\t\tif (tag) {\n\t\t\t\t// TODO: smart insertion of - to be completed for robust insertion of deferred bindings etc.\n\t\t\t\t//if (tag === \"\";\n\t\t\t\t//\tif (defer) {\n\t\t\t\t//\t\tdefer += \"+\"; // Will be used for stepping back through deferred tokens\n\t\t\t\t//\t}\n\t\t\t\t//\t// TODO: move this to design-time validation check\n\t\t\t\t//\t//\terror('\"' + parentTag + '\" has incorrect parent tag');\n\t\t\t\t//}\n\t\t\t\tpreceding += tag;\n\t\t\t\tif (ids) {\n\t\t\t\t\tpreceding += ' ' + jsvAttrStr + '=\"' + ids + '\"';\n\t\t\t\t\tids = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// We are in phrasing or flow content, so use script marker nodes\n\t\t\t// Example: - data-linked tag, close marker\n\t\t\t// We validate with inTag so no script markers are inserted in attribute context e.g. for:\n\t\t\t// \"\" or \" ...{{/if}}...\"\n\t\t\tpreceding = id\n\t\t\t\t? (preceding + endOfElCnt + spaceBefore + (inTag ? \"\" : openScript + id + closeScript)+ spaceAfter + tag)\n\t\t\t\t: endOfElCnt || all;\n\t\t}\n\n\t\tif (validate && boundId) {\n\t\t\tif (inTag) {\n\t\t\t\t// JsViews data-linking tags are not allowed within element markup.\n\t\t\t\t// See jsviews/issues/303\n\t\t\t\tsyntaxError('{^{ within elem markup (' + inTag + ' ). Use data-link=\"...\"');\n\t\t\t}\n\t\t\tif (id.charAt(0) === \"#\") {\n\t\t\t\ttagStack.unshift(id.slice(1));\n\t\t\t} else if (id.slice(1) !== (bndId = tagStack.shift())) {\n\t\t\t\t// See jsviews/issues/213\n\t\t\t\tsyntaxError('Closing tag for {^{...}} under different elem: <' + bndId + '>');\n\t\t\t}\n\t\t}\n\t\tif (tag) {\n\t\t\tinTag = tag;\n\t\t\t// If there are ids (markers since the last tag), move them to the defer string\n\t\t\ttagStack.unshift(parentTag);\n\t\t\tparentTag = tag.slice(1);\n\t\t\tif (validate && tagStack[0] && tagStack[0] === badParent[parentTag]) {\n\t\t\t\t// Missing \n\t\t\t\t// TODO: replace this by smart insertion of tags\n\t\t\t\terror('Parent of must be ');\n\t\t\t}\n\t\t\tisVoid = voidElems[parentTag];\n\t\t\tif ((elCnt = elContent[parentTag]) && !prevElCnt) {\n\t\t\t\tdeferStack.unshift(defer);\n\t\t\t\tdefer = \"\";\n\t\t\t}\n\t\t\tprevElCnt = elCnt;\n//TODO Consider providing validation which throws if you place as child of , etc. - since if not caught,\n//this can cause errors subsequently which are difficult to debug.\n//\t\t\t\tif (elContent[tagStack[0]]>2 && !elCnt) {\n//\t\t\t\t\terror(parentTag + \" in \" + tagStack[0]);\n//\t\t\t\t}\n\t\t\tif (defer && elCnt) {\n\t\t\t\tdefer += \"+\"; // Will be used for stepping back through deferred tokens\n\t\t\t}\n\t\t}\n\t\treturn preceding;\n\t}\n\n\tfunction processViewInfos(vwInfos, targetParent) {\n\t\t// If targetParent, we are processing viewInfos (which may include navigation through '+-' paths) and hooking up to the right parentElem etc.\n\t\t// (and elem may also be defined - the next node)\n\t\t// If no targetParent, then we are processing viewInfos on newly inserted content\n\t\tvar deferPath, deferChar, bindChar, parentElem, id, onAftCr, deep,\n\t\t\taddedBindEls = [];\n\n\t\t// In elCnt context (element-only content model), prevNode is the first node after the open, nextNode is the first node after the close.\n\t\t// If both are null/undefined, then open and close are at end of parent content, so the view is empty, and its placeholder is the\n\t\t// 'lastChild' of the parentNode. If there is a prevNode, then it is either the first node in the view, or the view is empty and\n\t\t// its placeholder is the 'previousSibling' of the prevNode, which is also the nextNode.\n\t\tif (vwInfos) {\n\t\t\tif (vwInfos._tkns.charAt(0) === \"@\") {\n\t\t\t\t// We are processing newly inserted content. This is a special script element that was created in convertMarkers() to process deferred bindings,\n\t\t\t\t// and inserted following the target parent element - because no element tags (outside elCnt) were encountered to carry those binding tokens.\n\t\t\t\t// We will step back from the preceding sibling of this element, looking at targetParent elements until we find the one that the current binding\n\t\t\t\t// token belongs to. Set elem to null (the special script element), and remove it from the DOM.\n\t\t\t\ttargetParent = elem.previousSibling;\n\t\t\t\telem.parentNode.removeChild(elem);\n\t\t\t\telem = undefined;\n\t\t\t}\n\t\t\tlen = vwInfos.length;\n\t\t\twhile (len--) {\n\t\t\t\tvwInfo = vwInfos[len];\n//if (prevIds.indexOf(vwInfo.token) < 0) { // This token is a newly created view or tag binding\n\t\t\t\tbindChar = vwInfo.ch;\n\t\t\t\tif (deferPath = vwInfo.path) {\n\t\t\t\t\t// We have a 'deferred path'\n\t\t\t\t\tj = deferPath.length - 1;\n\t\t\t\t\twhile (deferChar = deferPath.charAt(j--)) {\n\t\t\t\t\t\t// Use the \"+\" and\"-\" characters to navigate the path back to the original parent node where the deferred bindings ocurred\n\t\t\t\t\t\tif (deferChar === \"+\") {\n\t\t\t\t\t\t\tif (deferPath.charAt(j) === \"-\") {\n\t\t\t\t\t\t\t\tj--;\n\t\t\t\t\t\t\t\ttargetParent = targetParent.previousElementSibling; // IE9 or later only\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttargetParent = targetParent.parentNode;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttargetParent = targetParent.lastElementChild; // IE9 or later only\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (bindChar === \"^\") {\n\t\t\t\t\tif (tag = bindingStore[id = vwInfo.id]) {\n\t\t\t\t\t\t// The binding may have been deleted, for example in a different handler to an array collectionChange event\n\t\t\t\t\t\t// This is a tag binding\n\t\t\t\t\t\tdeep = targetParent && (!elem || elem.parentNode !== targetParent); // We are stepping back looking for the right targetParent,\n\t\t\t\t\t\t// or we are linking existing content and this element is in elCnt, not an immediate child of the targetParent.\n\t\t\t\t\t\tif (!elem || deep) {\n\t\t\t\t\t\t\ttag.parentElem = targetParent;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (vwInfo.elCnt && deep) {\n\t\t\t\t\t\t\t// With element only content, if there is no following element, or if the binding is deeper than the following element\n\t\t\t\t\t\t\t// then we need to set the open or close token as a deferred binding annotation on the parent\n\t\t\t\t\t\t\tsetDefer(targetParent, (vwInfo.open ? \"#\" : \"/\") + id + bindChar + (targetParent._df || \"\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// This is an open or close marker for a data-linked tag {^{...}}. Add it to bindEls.\n\t\t\t\t\t\taddedBindEls.push([deep ? null : elem, vwInfo]);\n\t\t\t\t\t}\n\t\t\t\t} else if (view = viewStore[id = vwInfo.id]) {\n\t\t\t\t\t// The view may have been deleted, for example in a different handler to an array collectionChange event\n\t\t\t\t\tif (!view.parentElem) {\n\t\t\t\t\t\t// If view is not already extended for JsViews, extend and initialize the view object created in JsRender, as a JsViews view\n\t\t\t\t\t\tview.parentElem = targetParent || elem && elem.parentNode || parentNode;\n\t\t\t\t\t\tview._.onRender = addBindingMarkers;\n\t\t\t\t\t\tview._.onArrayChange = arrayChangeHandler;\n\t\t\t\t\t\tsetArrayChangeLink(view);\n\t\t\t\t\t}\n\t\t\t\t\tparentElem = view.parentElem;\n\t\t\t\t\tif (vwInfo.open) {\n\t\t\t\t\t\t// This is an 'open view' node (preceding script marker node,\n\t\t\t\t\t\t// or if elCnt, the first element in the view, with a data-jsv annotation) for binding\n\t\t\t\t\t\tview._elCnt = vwInfo.elCnt;\n\t\t\t\t\t\tif (targetParent && !elem) {\n\t\t\t\t\t\t\tsetDefer(targetParent, \"#\" + id + bindChar + (targetParent._df || \"\"));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// No targetParent, so there is a ._nxt elem (and this is processing tokens on the elem)\n\t\t\t\t\t\t\tif (!view._prv) {\n\t\t\t\t\t\t\t\tsetDefer(parentElem, removeSubStr(parentElem._df, \"#\" + id + bindChar));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tview._prv = elem;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This is a 'close view' marker node for binding\n\t\t\t\t\t\tif (targetParent && (!elem || elem.parentNode !== targetParent)) {\n\t\t\t\t\t\t\t// There is no ._nxt so add token to _df. It is deferred.\n\t\t\t\t\t\t\tsetDefer(targetParent, \"/\" + id + bindChar + (targetParent._df || \"\"));\n\t\t\t\t\t\t\tview._nxt = undefined;\n\t\t\t\t\t\t} else if (elem) {\n\t\t\t\t\t\t\t// This view did not have a ._nxt, but has one now, so token may be in _df, and must be removed. (No longer deferred)\n\t\t\t\t\t\t\tif (!view._nxt) {\n\t\t\t\t\t\t\t\tsetDefer(parentElem, removeSubStr(parentElem._df, \"/\" + id + bindChar));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tview._nxt = elem;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (onAftCr = changeHandler(view, onAfterCreateStr) || onAfterCreate) {\n\t\t\t\t\t\t\tonAftCr.call(view.ctx.tag, view);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n//}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlen = addedBindEls.length;\n\t\t\twhile (len--) {\n\t\t\t\t// These were added in reverse order to addedBindEls. We push them in BindEls in the correct order.\n\t\t\t\tbindEls.push(addedBindEls[len]);\n\t\t\t}\n\t\t}\n\t\treturn !vwInfos || vwInfos.elCnt;\n\t}\n\n\tfunction getViewInfos(vwInfos) {\n\t\t// Used by view.childTags() and tag.childTags()\n\t\t// Similar to processViewInfos in how it steps through bindings to find tags. Only finds data-linked tags.\n\t\tvar level, parentTag, named;\n\n\t\tif (vwInfos) {\n\t\t\tlen = vwInfos.length;\n\t\t\tfor (j = 0; j < len; j++) {\n\t\t\t\tvwInfo = vwInfos[j];\n\t\t\t\t// This is an open marker for a data-linked tag {^{...}}, within the content of the tag whose id is get.id. Add it to bindEls.\n\t\t\t\t// Note - if bindingStore[vwInfo.id]._is === \"tag\" then getViewInfos is being called too soon - during first linking pass\n\t\t\t\ttag = bindingStore[vwInfo.id];\n\t\t\t\tif (!tag._is && tag.linkCtx) {\n\t\t\t\t\tparentTag = tag = tag.linkCtx.tag;\n\t\t\t\t\tnamed = tag.tagName === tagName;\n\t\t\t\t\tif (!tag.flow || named) {\n\t\t\t\t\t\tif (!deep) {\n\t\t\t\t\t\t\tlevel = 1;\n\t\t\t\t\t\t\twhile (parentTag = parentTag.parent) {\n\t\t\t\t\t\t\t\tlevel++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttagDepth = tagDepth || level; // The level of the first tag encountered.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((deep || level === tagDepth) && (!tagName || named)) {\n\t\t\t\t\t\t\t// Filter on top-level or tagName as appropriate\n\t\t\t\t\t\t\ttags.push(tag);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction dataLink() {\n\t\t//================ Data-link and fixup of data-jsv annotations ================\n\t\tvar j, index,\n\t\t\ttokens = \"\",\n\t\t\twrap = {},\n\t\t\tselector = linkViewsSel + (get ? \",[\" + deferAttr + \"]\" : \"\");\n\t\t\t// If a childTags() call, get = \",[\" + deferAttr + \"]\" - since we need to include elements that have a ._df expando for deferred tokens\n\n\t\telems = qsa ? parentNode.querySelectorAll(selector) : $(selector, parentNode).get();\n\t\tl = elems.length;\n\n\t\t// The prevNode will be in the returned query, since we called markPrevOrNextNode() on it.\n\t\t// But it may have contained nodes that satisfy the selector also.\n\t\tif (prevNode && prevNode.innerHTML) {\n\t\t\t// Find the last contained node of prevNode, to use as the prevNode - so we only link subsequent elems in the query\n\t\t\tprevNodes = qsa ? prevNode.querySelectorAll(selector) : $(selector, prevNode).get();\n\t\t\tprevNode = prevNodes.length ? prevNodes[prevNodes.length - 1] : prevNode;\n\t\t}\n\n\t\ttagDepth = 0;\n\t\tfor (i = 0; i < l; i++) {\n\t\t\telem = elems[i];\n\t\t\tif (prevNode && !found) {\n\t\t\t\t// If prevNode is set, not false, skip linking. If this element is the prevNode, set to false so subsequent elements will link.\n\t\t\t\tfound = (elem === prevNode);\n\t\t\t} else if (nextNode && elem === nextNode) {\n\t\t\t\t// If nextNode is set then break when we get to nextNode\n\t\t\t\tif (get) {\n\t\t\t\t\ttokens += markerNodeInfo(elem);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} else if (elem.parentNode) {\n\t\t\t\t// elem has not been removed from DOM\n\t\t\t\tif (get) {\n\t\t\t\t\ttokens += markerNodeInfo(elem);\n\t\t\t\t\tif (elem._df) {\n\t\t\t\t\t\tj = i + 1;\n\t\t\t\t\t\twhile (j < l && elem.contains(elems[j])) {\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Add deferred tokens after any tokens on descendant elements of this one\n\t\t\t\t\t\twrap[j-1] = elem._df;\n\t\t\t\t\t}\n\t\t\t\t\tif (wrap[i]) {\n\t\t\t\t\t\ttokens += wrap[i] || \"\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (isLink && (vwInfo = viewInfos(elem, undefined, rViewMarkers)) && (vwInfo = vwInfo[0])) {\n\t\t\t\t\t\t// If this is a link(trueOrString ...) call we will avoid re-binding to elems that are within template-rendered views\n\t\t\t\t\t\tskip = skip ? (vwInfo.id !== skip && skip) : vwInfo.open && vwInfo.id;\n\t\t\t\t\t}\n\t\t\t\t\tif (!skip && processInfos(viewInfos(elem))\n\t\t\t\t\t\t// If a link() call, processViewInfos() adds bindings to bindEls, and returns true for non-script nodes, for adding data-link bindings\n\t\t\t\t\t\t// If a childTags() call, getViewInfos returns array of tag bindings.\n\t\t\t\t\t\t\t&& elem.getAttribute($viewsLinkAttr)) {\n\t\t\t\t\t\tbindEls.push([elem]); // A data-linked element so add to bindEls too\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (get) {\n\t\t\ttokens += parentNode._df || \"\";\n\t\t\tif (index = tokens.indexOf(\"#\" + get.id) + 1) {\n\t\t\t\t// We are looking for view.childTags() or tag.childTags() - so start after the open token of the parent view or tag.\n\t\t\t\ttokens = tokens.slice(index + get.id.length);\n\t\t\t}\n\t\t\tindex = tokens.indexOf(\"/\" + get.id);\n\t\t\tif (index + 1) {\n\t\t\t\t// We are looking for view.childTags() or tag.childTags() - so don't look beyond the close token of the parent view or tag.\n\t\t\t\ttokens = tokens.slice(0, index);\n\t\t\t}\n\t\t\t// Call getViewInfos to add the found childTags to the tags array\n\t\t\tgetViewInfos(viewInfos(tokens, undefined, rOpenTagMarkers));\n\t\t}\n\n\t\tif (html === undefined && parentNode.getAttribute($viewsLinkAttr)) {\n\t\t\tbindEls.push([parentNode]); // Support data-linking top-level element directly (not within a data-linked container)\n\t\t}\n\n\t\t// Remove temporary marker script nodes they were added by markPrevOrNextNode\n\t\tunmarkPrevOrNextNode(prevNode, elCnt);\n\t\tunmarkPrevOrNextNode(nextNode, elCnt);\n\n\t\tif (get) {\n\t\t\treturn; // We have added childTags to the tags array, so we are done\n\t\t}\n\n\t\tif (elCnt && defer + ids) {\n\t\t\t// There are some views with elCnt, for which the open or close did not precede any HTML tag - so they have not been processed yet\n\t\t\telem = nextNode;\n\t\t\tif (defer) {\n\t\t\t\tif (nextNode) {\n\t\t\t\t\tprocessViewInfos(viewInfos(defer + \"+\", true), nextNode);\n\t\t\t\t} else {\n\t\t\t\t\tprocessViewInfos(viewInfos(defer, true), parentNode);\n\t\t\t\t}\n\t\t\t}\n\t\t\tprocessViewInfos(viewInfos(ids, true), parentNode);\n\t\t\t// If there were any tokens on nextNode which have now been associated with inserted HTML tags, remove them from nextNode\n\t\t\tif (nextNode) {\n\t\t\t\ttokens = nextNode.getAttribute(jsvAttrStr);\n\t\t\t\tif (l = tokens.indexOf(prevIds) + 1) {\n\t\t\t\t\ttokens = tokens.slice(l + prevIds.length - 1);\n\t\t\t\t}\n\t\t\t\tnextNode.setAttribute(jsvAttrStr, ids + tokens);\n\t\t\t}\n\t\t}\n\n// if (context.lazyLink) {\n// setTimeout(doLinking) (doLinking is function wrapper of following lines)\n// See Future tasks, and https://github.com/BorisMoore/jsviews/issues/368.\n// Could call context.lazyLink as callback, on async completion - or return promise.\n\t\t//================ Bind the data-linked elements and tags ================\n\t\tl = bindEls.length;\n\t\tfor (i = 0; i < l; i++) {\n\t\t\telem = bindEls[i];\n\t\t\tlinkInfo = elem[1];\n\t\t\telem = elem[0];\n\t\t\tif (linkInfo) {\n\t\t\t\tif (tag = bindingStore[linkInfo.id]) {\n\t\t\t\t\tif (linkCtx = tag.linkCtx) {\n\t\t\t\t\t\t// The tag may have been stored temporarily on the bindingStore - or may have already been replaced by the actual binding\n\t\t\t\t\t\ttag = linkCtx.tag;\n\t\t\t\t\t\ttag.linkCtx = linkCtx;\n\t\t\t\t\t}\n\t\t\t\t\tif (linkInfo.open) {\n\t\t\t\t\t\t// This is an 'open linked tag' binding annotation for a data-linked tag {^{...}}\n\t\t\t\t\t\tif (elem) {\n\t\t\t\t\t\t\ttag.parentElem = elem.parentNode;\n\t\t\t\t\t\t\ttag._prv = elem;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttag._elCnt = linkInfo.elCnt;\n\t\t\t\t\t\t// We data-link depth-first (\"on the way in\"), which is better for perf - and allows setting parent tags etc.\n\t\t\t\t\t\tview = tag.tagCtx.view;\n\n\t\t\t\t\t\t// Add data binding (unless skipped due to lateRender)\n\t\t\t\t\t\taddDataBinding(late, undefined, tag._prv, view, linkInfo.id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttag._nxt = elem;\n\t\t\t\t\t\tif (tag._.unlinked && !tag._toLk) {\n\t\t\t\t\t\t\t// This is a 'close linked tag' binding annotation (and data-binding was not skipped due to lateRender)\n\t\t\t\t\t\t\ttagCtx = tag.tagCtx;\n\t\t\t\t\t\t\tview = tagCtx.view;\n\t\t\t\t\t\t\tcallAfterLink(tag);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Add data binding for a data-linked element (with data-link attribute)\n\t\t\t\taddDataBinding(late, elem.getAttribute($viewsLinkAttr), elem, $view(elem), undefined, isLink, outerData, context);\n\t\t\t}\n\t\t}\n//});\n\t}\n\t//==== /end of nested functions ====\n\n\tvar inTag, linkCtx, tag, i, l, j, len, elems, elem, view, vwInfo, linkInfo, prevNodes, token, prevView, nextView,\n\t\tnode, tags, deep, tagName, tagCtx, validate, tagDepth, depth, fragment, copiedNode, firstTag, parentTag,\n\t\tisVoid, wrapper, div, tokens, elCnt, prevElCnt, htmlTag, ids, prevIds, found, skip, isLink, get,\n\t\tself = this,\n\t\tthisId = self._.id + \"_\",\n\t\tdefer = \"\",\n\t\t// The marker ids for which no tag was encountered (empty views or final closing markers) which we carry over to container tag\n\t\tbindEls = [],\n\t\ttagStack = [],\n\t\tdeferStack = [],\n\t\tlate = [],\n\t\tonAfterCreate = changeHandler(self, onAfterCreateStr),\n\t\tprocessInfos = processViewInfos;\n\n\tif (refresh) {\n\t\tif (refresh.tmpl) {\n\t\t\t// refresh is the prevView, passed in from addViews()\n\t\t\tprevView = \"/\" + refresh._.id + \"_\";\n\t\t} else {\n\t\t\tisLink = refresh.lnk; // Top-level linking\n\t\t\tif (refresh.tag) {\n\t\t\t\tthisId = refresh.tag + \"^\";\n\t\t\t\trefresh = true;\n\t\t\t}\n\t\t\tif (get = refresh.get) {\n\t\t\t\tprocessInfos = getViewInfos;\n\t\t\t\ttags = get.tags;\n\t\t\t\tdeep = get.deep;\n\t\t\t\ttagName = get.name;\n\t\t\t}\n\t\t}\n\t\trefresh = refresh === true;\n\t}\n\n\tparentNode = parentNode\n\t\t? (typeof parentNode === STRING\n\t\t\t? $(parentNode)[0] // It is a string, so treat as selector\n\t\t\t: parentNode.jquery\n\t\t\t\t? parentNode[0] // A jQuery object - take first element.\n\t\t\t\t: parentNode)\n\t\t: (self.parentElem // view.link()\n\t\t\t|| document.body); // link(null, data) to link the whole document\n\n\tvalidate = !$subSettingsAdvanced.noValidate && parentNode.contentEditable !== TRUE;\n\tparentTag = parentNode.tagName.toLowerCase();\n\telCnt = !!elContent[parentTag];\n\n\tprevNode = prevNode && markPrevOrNextNode(prevNode, elCnt);\n\tnextNode = nextNode && markPrevOrNextNode(nextNode, elCnt) || null;\n\n\tif (html != undefined) {\n\t\t//================ Insert html into DOM using documentFragments (and wrapping HTML appropriately). ================\n\t\t// Also convert markers to DOM annotations, based on content model.\n\t\t// Corresponds to nextNode ? $(nextNode).before(html) : $(parentNode).html(html);\n\t\t// but allows insertion to wrap correctly even with inserted script nodes. jQuery version will fail e.g. under tbody or select.\n\t\t// This version should also be slightly faster\n\t\tdiv = document.createElement(\"div\");\n\t\twrapper = div;\n\t\tprevIds = ids = \"\";\n\t\thtmlTag = parentNode.namespaceURI === \"http://www.w3.org/2000/svg\" ? \"svg_ns\" : (firstTag = rFirstElem.exec(html)) && firstTag[1] || \"\";\n\t\tif (elCnt) {\n\t\t\t// Now look for following view, and find its tokens, or if not found, get the parentNode._df tokens\n\t\t\tnode = nextNode;\n\t\t\twhile (node && !(nextView = viewInfos(node))) {\n\t\t\t\tnode = node.nextSibling;\n\t\t\t}\n\t\t\tif (tokens = nextView ? nextView._tkns : parentNode._df) {\n\t\t\t\ttoken = prevView || \"\";\n\t\t\t\tif (refresh || !prevView) {\n\t\t\t\t\ttoken += \"#\" + thisId;\n\t\t\t\t}\n\t\t\t\tj = tokens.indexOf(token);\n\t\t\t\tif (j + 1) {\n\t\t\t\t\tj += token.length;\n\t\t\t\t\t// Transfer the initial tokens to inserted nodes, by setting them as the ids variable, picked up in convertMarkers\n\t\t\t\t\tprevIds = ids = tokens.slice(0, j);\n\t\t\t\t\ttokens = tokens.slice(j);\n\t\t\t\t\tif (nextView) {\n\t\t\t\t\t\tnode.setAttribute(jsvAttrStr, tokens);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetDefer(parentNode, tokens);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//================ Convert the markers to DOM annotations, based on content model. ================\n//\t\t\toldElCnt = elCnt;\n\t\tisVoid = undefined;\n\t\thtml = (\"\" + html).replace(rConvertMarkers, convertMarkers);\n//\t\t\tif (!!oldElCnt !== !!elCnt) {\n//\t\t\t\terror(\"Parse: \" + html); // Parse error. Content not well-formed?\n//\t\t\t}\n\t\tif (validate && tagStack.length) {\n\t\t\tsyntaxError(\"Mismatched '<\" + parentTag + \"...>' in:\\n\" + html); // Unmatched tag\n\t\t}\n\t\tif (validateOnly) {\n\t\t\treturn;\n\t\t}\n\t\t// Append wrapper element to doc fragment\n\t\tsafeFragment.appendChild(div);\n\n\t\t// Go to html and back, then peel off extra wrappers\n\t\t// Corresponds to jQuery $(nextNode).before(html) or $(parentNode).html(html);\n\t\t// but supports svg elements, and other features missing from jQuery version (and this version should also be slightly faster)\n\t\thtmlTag = wrapMap[htmlTag] || wrapMap.div;\n\t\tdepth = htmlTag[0];\n\t\twrapper.innerHTML = htmlTag[1] + html + htmlTag[2];\n\t\twhile (depth--) {\n\t\t\twrapper = wrapper.lastChild;\n\t\t}\n\t\tsafeFragment.removeChild(div);\n\t\tfragment = document.createDocumentFragment();\n\t\twhile (copiedNode = wrapper.firstChild) {\n\t\t\tfragment.appendChild(copiedNode);\n\t\t}\n\t\t// Insert into the DOM\n\t\tparentNode.insertBefore(fragment, nextNode);\n\t}\n\tdataLink();\n\n\treturn late;\n}\n\nfunction addDataBinding(late, linkMarkup, node, currentView, boundTagId, isLink, data, context) {\n\t// Add data binding for data-linked elements or {^{...}} data-linked tags\n\tvar tmpl, tokens, attr, convertBack, tagExpr, linkFn, linkCtx, tag, rTagIndex, hasElse, lastIndex,\n\t\tlinkExpressions = [];\n\n\tif (boundTagId) {\n\t\t// boundTagId is a string for {^{...}} data-linked tag. So only one linkTag in linkMarkup\n\t\t// data and context arguments are undefined\n\t\ttag = bindingStore[boundTagId];\n\t\ttag = tag.linkCtx ? tag.linkCtx.tag : tag;\n\n\t\tlinkCtx = tag.linkCtx || {\n\t\t\ttype: \"inline\",\n\t\t\tdata: currentView.data, // source\n\t\t\telem: tag._elCnt ? tag.parentElem : node, // target\n\t\t\tview: currentView,\n\t\t\tctx: currentView.ctx,\n\t\t\tattr: HTML, // Script marker nodes are associated with {^{ and always target HTML.\n\t\t\tfn: tag._.bnd,\n\t\t\ttag: tag,\n\t\t\t// Pass the boundTagId in the linkCtx, so that it can be picked up in observeAndBind\n\t\t\t_bndId: boundTagId\n\t\t};\n\t\ttag.linkCtx = linkCtx;\n\t\tbindDataLinkTarget(linkCtx, late);\n\t\ttag._toLk = linkCtx._bndId; // If data binding happened, remove _toLk flag from tag\n\t} else if (linkMarkup && node) {\n\t\t// Data-linked element\n\n\t\t// If isLink then this is a top-level linking: .link(expression, target, data, ....) or\n\t\t// .link(true, target, data, ....) scenario - and data and context are passed in separately from the view\n\t\tdata = isLink ? data : currentView.data;\n\t\ttmpl = currentView.tmpl;\n\t\tlinkMarkup = normalizeLinkTag(linkMarkup, defaultAttr(node));\n\t\tlastIndex = rTagDatalink.lastIndex = 0;\n\t\twhile (tokens = rTagDatalink.exec(linkMarkup)) { // TODO require } to be followed by whitespace or $, and remove the \\}(!\\}) option.\n\t\t\tlinkExpressions.push(tokens);\n\t\t\tlastIndex = rTagDatalink.lastIndex;\n\t\t}\n\t\tif (lastIndex < linkMarkup.length) {\n\t\t\tsyntaxError(linkMarkup);\n\t\t}\n\t\twhile (tokens = linkExpressions.shift()) {\n\t\t\t// Iterate over the data-link expressions, for different target attrs,\n\t\t\t// e.g. ~description(firstName, lastName)}\"\n\t\t\t// tokens: [all, attr, bindOnly, tagExpr, tagName, converter, colon, html, comment, code, params]\n\t\t\trTagIndex = rTagDatalink.lastIndex;\n\t\t\tattr = tokens[1];\n\t\t\ttagExpr = tokens[3];\n\t\t\twhile (linkExpressions[0] && linkExpressions[0][4] === \"else\") { // If this is {sometag...} and is followed by an {else...} add to tagExpr\n\t\t\t\ttagExpr += delimCloseChar1 + delimOpenChar0 + linkExpressions.shift()[3];\n\t\t\t\thasElse = true;\n\t\t\t}\n\t\t\tif (hasElse) { // If an {else} has been added, need also to add closing {{/sometag}}\n\t\t\t\ttagExpr += delimCloseChar1 + delimOpenChar0 + delimOpenChar1 + \"/\" + tokens[4] + delimCloseChar0;\n\t\t\t}\n\t\t\tlinkCtx = {\n\t\t\t\ttype: isLink || \"link\",\n\t\t\t\tdata: data, // source\n\t\t\t\telem: node, // target\n\t\t\t\tview: currentView,\n\t\t\t\tctx: context,\n\t\t\t\tattr: attr,\n\t\t\t\t_toLk : 1, // Flag to data-link on initial data-link call rendering call\n\t\t\t\t_noUpd : tokens[2] // Flag for data-link=\"^{...}\" so on initial data-link call will bind, but not render)\n\t\t\t};\n\n\t\t\tconvertBack = undefined;\n\t\t\tif (tokens[6]) {\n\t\t\t\tconvertBack = tokens[10] || undefined;\n\t\t\t\tlinkCtx.convert = tokens[5] || \"\";\n\t\t\t\tif (convertBack !== undefined && defaultAttr(node)) {\n\t\t\t\t\tif (attr) {\n\t\t\t\t\t\tsyntaxError(tagExpr + \"- Remove target: \" + attr);\n\t\t\t\t\t}\n\t\t\t\t\t// Default target, so allow 2 way binding\n\t\t\t\t\tlinkCtx.convertBack = convertBack = convertBack.slice(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Compile the linkFn expression which evaluates and binds a data-link expression\n\t\t\t// TODO - optimize for the case of simple data path with no conversion, helpers, etc.:\n\t\t\t// i.e. data-link=\"a.b.c\". Avoid creating new instances of Function every time. Can use a default function for all of these...\n\n\t\t\tlinkCtx.expr = attr + tagExpr;\n\t\t\tlinkFn = linkExprStore[tagExpr];\n\t\t\tif (!linkFn) {\n\t\t\t\tlinkExprStore[tagExpr] = linkFn = $sub.tmplFn(tagExpr.replace(rEscapeQuotes, \"\\\\$&\"), tmpl, true, convertBack, hasElse);\n\t\t\t}\n\t\t\tlinkCtx.fn = linkFn;\n\t\t\tbindDataLinkTarget(linkCtx, late);\n\t\t\t// We store rTagIndex in local scope, since this addDataBinding method can sometimes be called recursively,\n\t\t\t// and each is using the same rTagDatalink instance.\n\t\t\trTagDatalink.lastIndex = rTagIndex;\n\t\t}\n//\t\t}\n\t}\n}\n\nfunction bindDataLinkTarget(linkCtx, late) {\n\t// Add data link bindings for a link expression in data-link attribute markup, or for a linkedElement\n\tfunction handler(ev, eventArgs) {\n\t\t// If the link expression uses a custom tag, the onDataLinkedTagChange call will call renderTag, which will set tagCtx on linkCtx\n\t\tif (!eventArgs || !eventArgs.refresh) {\n\t\t\tonDataLinkedTagChange.call(linkCtx, ev, eventArgs);\n\t\t}\n\t}\n\n\tvar view,\n\t\tlinkCtxType = linkCtx.type;\n\tif (linkCtxType === \"top\" || linkCtxType === \"expr\") {\n\t\t// Top-level linking: .link(expressionOrTrue, data, context) - so we need to create a view for the linking, with the data and ctx\n\t\t// which may be different than the current context of the target. Note that this view is not a standard data-linked view, so it will\n\t\t// be disposed only when its parent view is disposed.\n\t\tlinkCtx.view = new $sub.View(\n\t\t\t$sub.extendCtx(linkCtx.ctx, linkCtx.view.ctx),\n\t\t\t\"link\", linkCtx.view, linkCtx.data, linkCtx.expr, undefined, addBindingMarkers);\n\t}\n\tlinkCtx._ctxCb = $sub._gccb(view = linkCtx.view); // getContextCallback: _ctxCb, for filtering/appending to dependency paths: function(path, object) { return [(object|path)*]}\n\tlinkCtx._hdl = handler;\n\t// handler._ctx = linkCtx; Could pass linkCtx for use in a depends = function() {} call, so depends is different for different linkCtx's\n\n\tif (linkCtx.elem.nodeName === \"SELECT\"\n\t\t&& (linkCtx.elem._jsvLkEl // A SELECT which is a linkedElement\n\t\t|| (linkCtxType === \"link\" && !linkCtx.attr && linkCtx.convert !== undefined))) { // A SELECT with a data-link binding (the assign tag {:...}, not another expression such as {on ...} (See https://github.com/BorisMoore/jsviews/issues/444))\n\t\t\tvar source,\n\t\t\t\telem = linkCtx.elem,\n\t\t\t\t$elem = $(elem);\n\t\t\t$elem.on(\"jsv-domchange\", function() {\n\t\t\t\t// If the options have changed dynamically under the select, we need to refresh the data-linked selection, using the new options\n\t\t\t\tif (!arguments[3].refresh) { // eventArgs.refresh !== true - so a refresh action will only set the selection once\n\t\t\t\t\tif (elem._jsvLkEl) {\n\t\t\t\t\t\t$elem.val(elem._jsvLkEl.cvtArgs(elem._jsvElse, 1)[elem._jsvInd]); // SELECT is a linkedElement, so set to value of bndArgs(elseIndex)[bindToIndex]\n\t\t\t\t\t} else if (linkCtx.tag) {\n\t\t\t\t\t\t$elem.val(linkCtx.tag.cvtArgs(0,1)); // SELECT with data-link expression with convert=... convertBack=...\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsource = linkCtx.fn(view.data, view, $sub); // SELECT with data-link expression (either data-link='expression', or data-link='{cvt:expression:cvtBk}')\n\t\t\t\t\t\t$elem.val(linkCtx.convert || linkCtx.convertBack ? $sub._cnvt(linkCtx.convert, view, source) : source);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tif (linkCtx.fn._lr) {\n\t\tlinkCtx._toLk = 1;\n\t\tlate.push(linkCtx); // lateRender - defer rendering and linking (sync but after first linking pass)\n\t} else {\n\t\thandler(true);\n\t}\n}\n\n//=====================\n// Data-linking helpers\n//=====================\n\nfunction removeSubStr(str, substr) {\n\tvar k;\n\treturn str\n\t\t? (k = str.indexOf(substr),\n\t\t\t(k + 1\n\t\t\t\t? str.slice(0, k) + str.slice(k + substr.length)\n\t\t\t\t: str))\n\t\t: \"\";\n}\n\nfunction markerNodeInfo(node) {\n\treturn node &&\n\t\t(typeof node === STRING\n\t\t\t? node\n\t\t\t: node.tagName === SCRIPT\n\t\t\t\t? node.type.slice(3)\n\t\t\t\t: node.nodeType === 1 && node.getAttribute(jsvAttrStr) || \"\");\n}\n\nfunction viewInfos(node, isVal, rBinding) {\n\t// Test whether node is a script marker node, and if so, return metadata\n\tfunction getInfos(all, open, close, id, ch, elPath) {\n\t\tinfos.push({\n\t\t\telCnt: elCnt,\n\t\t\tid: id,\n\t\t\tch: ch,\n\t\t\topen: open,\n\t\t\tclose: close,\n\t\t\tpath: elPath,\n\t\t\ttoken: all\n\t\t});\n\t}\n\tvar elCnt, tokens,\n\t\tinfos = [];\n\tif (tokens = isVal ? node : markerNodeInfo(node)) {\n\t\telCnt = infos.elCnt = node.tagName !== SCRIPT;\n\t\telCnt = tokens.charAt(0) === \"@\" || elCnt;\n\t\tinfos._tkns = tokens;\n\t\t// rMarkerTokens = /(?:(#)|(\\/))(\\d+)([_^])([-+@\\d]+)?/g;\n\t\ttokens.replace(rBinding || rMarkerTokens, getInfos);\n\t\treturn infos;\n\t}\n}\n\nfunction unmarkPrevOrNextNode(node, elCnt) {\n\tif (node) {\n\t\tif (node.type === \"jsv\") {\n\t\t\tnode.parentNode.removeChild(node);\n\t\t} else if (elCnt && node.getAttribute($viewsLinkAttr) === \"\") {\n\t\t\tnode.removeAttribute($viewsLinkAttr);\n\t\t}\n\t}\n}\n\nfunction markPrevOrNextNode(node, elCnt) {\n\tvar marker = node;\n\twhile (elCnt && marker && marker.nodeType !== 1) {\n\t\tmarker = marker.previousSibling;\n\t}\n\tif (marker) {\n\t\tif (marker.nodeType !== 1) {\n\t\t\t// For text nodes, we will add a script node before\n\t\t\tmarker = document.createElement(SCRIPT);\n\t\t\tmarker.type = \"jsv\";\n\t\t\tnode.parentNode.insertBefore(marker, node);\n\t\t} else if (!markerNodeInfo(marker) && !marker.getAttribute($viewsLinkAttr)) {\n\t\t\t// For element nodes, we will add a data-link attribute (unless there is already one)\n\t\t\t// so that this node gets included in the node linking process.\n\t\t\tmarker.setAttribute($viewsLinkAttr, \"\");\n\t\t}\n\t}\n\treturn marker;\n}\n\nfunction normalizeLinkTag(linkMarkup, twoway) {\n\tlinkMarkup = $.trim(linkMarkup);\n\treturn linkMarkup.slice(-1) !== delimCloseChar0\n\t// If simplified syntax is used: data-link=\"expression\", convert to data-link=\"{:expression}\",\n\t// or for inputs, data-link=\"{:expression:}\" for (default) two-way binding\n\t\t? linkMarkup = delimOpenChar1 + \":\" + linkMarkup + (twoway ? \":\" : \"\") + delimCloseChar0\n\t\t: linkMarkup;\n}\n\n//===========================\n// Methods for views and tags\n//===========================\n\nfunction callAfterLink(tag, ev, eventArgs) {\n\tfunction copyFromTagCtxToTag() {\n\t\tlinkedElems = tagCtx.linkedElems || tag.linkedElems || tag.linkedElem && [tag.linkedElem];\n\t\tif (linkedElems) {\n\t\t\ttag.linkedElems = tagCtx.linkedElems = linkedElems;\n\t\t\ttag.linkedElem = linkedElems[0] = tag.linkedElem || linkedElems[0];\n\t\t}\n\t\tif (linkedElem = tagCtx.mainElem || tag.mainElem) {\n\t\t\ttagCtx.mainElem = tag.mainElem = linkedElem;\n\t\t}\n\t\tif (linkedElem = tagCtx.displayElem || tag.displayElem) {\n\t\t\ttagCtx.displayElem = tag.displayElem = linkedElem;\n\t\t}\n\t}\n\n\tvar linkedElems, linkedElements, linkedElem, l, m, $linkCtxElem, linkCtxElem, linkedEl, linkedTag,\n\t\ttagCtxElse, props, val, oldVal, indexTo, i, mapDeps, propDeps,\n\t\ttagCtx = tag.tagCtx,\n\t\ttagCtxs = tag.tagCtxs,\n\t\ttagCtxslength = tagCtxs && tagCtxs.length,\n\t\tlinkCtx = tag.linkCtx,\n\t\tbindTo = tag.bindTo || {};\n\n\tif (tag._.unlinked) { // First call to onAfterLink, or first call after onUpdate: updateContent. Initialize and call onBind and set properties\n\t\t$linkCtxElem = $(linkCtx.elem);\n\t\tif (tag.linkedElement || tag.mainElement || tag.displayElement) {\n\t\t\tif (linkedElements = tag.linkedElement) {\n\t\t\t\t// tag.linkedElement: - selector, or array of selectors, for identifying linked elements in template/rendered content.\n\t\t\t\t// (But for tag bindings on data-linked elements, defaults to data-linked element)\n\t\t\t\ttag.linkedElem = undefined;\n\t\t\t\tl = linkedElements.length;\n\t\t\t\twhile (l--) {\n\t\t\t\t\tif (linkedElements[l]) {\n\t\t\t\t\t\tlinkCtxElem = !tag.inline && $linkCtxElem.filter(linkedElements[l]);\n\t\t\t\t\t\tm = tagCtxslength;\n\t\t\t\t\t\twhile (m--) {\n\t\t\t\t\t\t\ttagCtxElse = tagCtxs[m];\n\t\t\t\t\t\t\tlinkedElems = tagCtxElse.linkedElems = tagCtxElse.linkedElems || new Array(l);\n\t\t\t\t\t\t\tlinkedElem = linkCtxElem[0] ? linkCtxElem : tagCtxElse.contents(true, linkedElements[l]);\n\t\t\t\t\t\t\tif (linkedElem[0] && linkedElem[0].type !== RADIO) {\n\t\t\t\t\t\t\t\tlinkedElems[l] = linkedElem.eq(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (linkedElements = tag.mainElement) {\n\t\t\t\t// tag.mainElement: - selector for identifying mainElem in template/rendered content\n\t\t\t\t// (But for tag bindings on data-linked elements, defaults to data-linked element)\n\t\t\t\tlinkCtxElem = !tag.inline && $linkCtxElem.filter(linkedElements);\n\t\t\t\tm = tagCtxslength;\n\t\t\t\twhile (m--) {\n\t\t\t\t\ttagCtxElse = tagCtxs[m];\n\t\t\t\t\tlinkedElem = linkCtxElem[0] ? linkCtxElem : tagCtxElse.contents(true, linkedElements).eq(0);\n\t\t\t\t\tif (linkedElem[0]) {\n\t\t\t\t\t\ttagCtxElse.mainElem = linkedElem;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (linkedElements = tag.displayElement) {\n\t\t\t\t// tag.displayElement: - selector for identifying displayElem in template/rendered content\n\t\t\t\t// (But for tag bindings on data-linked elements, defaults to data-linked element)\n\t\t\t\tlinkCtxElem = !tag.inline && $linkCtxElem.filter(linkedElements);\n\t\t\t\tm = tagCtxslength;\n\t\t\t\twhile (m--) {\n\t\t\t\t\ttagCtxElse = tagCtxs[m];\n\t\t\t\t\tlinkedElem = linkCtxElem[0] ? linkCtxElem : tagCtxElse.contents(true, linkedElements).eq(0);\n\t\t\t\t\tif (linkedElem[0]) {\n\t\t\t\t\t\ttagCtxElse.displayElem = linkedElem;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcopyFromTagCtxToTag();\n\t\t}\n\t\tif (tag.onBind) {\n\t\t\ttag.onBind(tagCtx, linkCtx, tag.ctx, ev, eventArgs);\n\t\t\tcopyFromTagCtxToTag();\n\t\t}\n\t}\n\n\tm = tagCtxslength;\n\twhile (m--) {\n\t\ttagCtxElse = tagCtxs[m];\n\t\tprops = tagCtxElse.props;\n\n\t\tif (tag._.unlinked && tagCtxElse.map && tag.mapProps) {\n\t\t\t// Compile the dependency paths for observable changes in mapProps (e.g. start, end, filter)\n\t\t\ti = tag.mapProps.length;\n\t\t\tmapDeps = props.mapDepends || tag.mapDepends || []; // dependency paths\n\t\t\tmapDeps = $isArray(mapDeps) ? mapDeps : [mapDeps];\n\t\t\twhile (i--) { // Iterate through mapProps\n\t\t\t\tvar prop = tag.mapProps[i];\n\t\t\t\tpropDeps = tag._.bnd.paths[m][\"_\" + prop]; // paths for mapProps on this tagCtx\n\t\t\t\tif (propDeps && propDeps.length && propDeps.skp) { // Not already a bound prop ^prop=expression;\n\t\t\t\t\tmapDeps = mapDeps.concat(propDeps); // Add dependencies for this prop expression\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (mapDeps.length) {\n\t\t\t\ttagCtxElse.map.observe(mapDeps, linkCtx); // Listen to observable changes of mapProps, and call map.update when change happens\n\t\t\t}\n\t\t}\n\t\tif (linkedElem = tagCtxElse.mainElem || !tag.mainElement && tagCtxElse.linkedElems && tagCtxElse.linkedElems[0]) {\n\t\t\t// linkedElem is the mainElem (defaulting to linkedElem)\n\t\t\tif (linkedElem[0] && props.id && !linkedElem[0].id) {\n\t\t\t\tlinkedElem[0].id = props.id;\n\t\t\t}\n\t\t\tif (tag.setSize) {\n\t\t\t\tif (val = !bindTo.height && props.height || tag.height) {\n\t\t\t\t\tlinkedElem.height(val);\n\t\t\t\t}\n\t\t\t\tif (val = !bindTo.width && props.width || tag.width) {\n\t\t\t\t\tlinkedElem.width(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (val = (linkedElem = tagCtxElse.displayElem || linkedElem) && (!bindTo[\"class\"] && props[\"class\"] || tag.className)) {\n\t\t\t// This code supports dynamic binding to class - where it adds the class if absent, and removes/adds if a previous value is present\n\t\t\toldVal = linkedElem[0]._jsvCl;\n\t\t\tif (val !== oldVal) {\n\t\t\t\tif (linkedElem.hasClass(oldVal)) {\n\t\t\t\t\tlinkedElem.removeClass(oldVal);\n\t\t\t\t}\n\t\t\t\tlinkedElem.addClass(val);\n\t\t\t\tlinkedElem[0]._jsvCl = val;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (tag.onAfterLink) {\n\t\ttag.onAfterLink(tagCtx, linkCtx, tag.ctx, ev, eventArgs);\n\t\tcopyFromTagCtxToTag();\n\t}\n\n\tif (!tag.flow && !tag._.chg) {\n\t\tif (tag._tgId && tag._.unlinked && (tag.linkedElems || tag.bindTo)) {\n\t\t\tdefineBindToDataTargets(bindingStore[tag._tgId], tag);\n\t\t}\n\t\tm = tagCtxs.length;\n\t\twhile (m--) {\n\t\t\tprops = tag.cvtArgs(m, 1); // array of bindFrom args/props\n\t\t\tl = props.length;\n\t\t\twhile (l--) {\n\t\t\t\t// If the bound property or arg has not yet been set (e.g. during initial rendering),\n\t\t\t\t// or has been unset, because onUpdate is set to true, or if onUpdate is false,\n\t\t\t\t// but this particular bound arg/prop is being changed observably: call setValue()\n\t\t\t\ttag.setValue(props[l], l, m, ev, eventArgs);\n\t\t\t}\n\t\t\tif (tag._.unlinked) {\n\t\t\t\ttagCtx = tagCtxs[m];\n\t\t\t\tlinkedElems = tagCtx.linkedElems || !m && tag.linkedElem && [tag.linkedElem];\n\t\t\t\tindexTo = (tag.bindTo || [0]).length;\n\t\t\t\twhile (indexTo--) {\n\t\t\t\t\tif ((linkedElem = linkedElems && linkedElems[indexTo]) && (l = linkedElem.length)) {\n\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\tlinkedEl = linkedElem[l];\n\t\t\t\t\t\t\tlinkedTag = linkedEl._jsvLkEl;\n\t\t\t\t\t\t\tif (!linkedTag || linkedTag !== tag) {\n\t\t\t\t\t\t\t\t// For data-linked tags, identify the linkedEl with the tag, for \"to\" binding\n\t\t\t\t\t\t\t\t// (For data-linked elements, if not yet bound, we identify later when the linkCtx.elem is bound)\n\t\t\t\t\t\t\t\tlinkedEl._jsvLkEl = tag;\n\t\t\t\t\t\t\t\tlinkedEl._jsvInd = indexTo;\n\t\t\t\t\t\t\t\tlinkedEl._jsvElse = m;\n\t\t\t\t\t\t\t\tbindLinkedElChange(tag, linkedEl);\n\t\t\t\t\t\t\t\tif (tag._tgId) {\n\t\t\t\t\t\t\t\t\tlinkedEl._jsvBnd = \"&\" + tag._tgId + \"+\"; // Add a \"+\" for cloned binding - so removing\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// elems with cloned bindings will not remove the 'parent' binding from the bindingStore.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\ttag._.unlinked = undefined;\n\tif (tag._.lt) { // Late tag: Late path: @some.path had not returned @some object, so try again with refresh\n\t\ttag.refresh();\n\t}\n}\n\nfunction asyncOnElemChange(ev) {\n\tvar which = ev.which;\n\tif (!(which > 15 && which < 21 || which > 32 && which < 41 || which > 111 && which < 131 || which === 27 || which === 144)) {\n\t\t// Shift, Ctrl, Alt, Pause, Caplock, Page up/down End, Home, Left, Up, Right, Down, Function keys, Escape, Numlock\n\t\tsetTimeout(function() {\n\t\t\tonElemChange(ev);\n\t\t});\n\t}\n}\n\nfunction bindTriggerEvent($elem, trig, onoff) {\n\t// Bind keydown, or other trigger - (rather than use the default change event bubbled to activeBody)\n\tif (trig === true && useInput && (!isIE || $elem[0].contentEditable !== TRUE)) { // IE oninput event is not raised for contenteditable changes\n\t\t$elem[onoff](\"input.jsv\", onElemChange); // For HTML5 browser with \"oninput\" support - for mouse editing of text\n\t} else {\n\t\ttrig = typeof trig === STRING ? trig : \"keydown.jsv\"; // Set trigger to (true || truey non-string (e.g. 1) || 'keydown')\n\t\t$elem[onoff](trig, trig.indexOf(\"keydown\") >= 0 ? asyncOnElemChange : onElemChange); // Get 'keydown' with async\n\t}\n}\n\nfunction bindLinkedElChange(tag, linkedElem) {\n\t// Two-way binding for linkedElem - in the case of input, textarea or contentEditable elements.\n\t// Trigger setting may have changed. Unbind previous trigger binding (if any) and bind new one.\n\n\tvar $linkedElem, newTrig,\n\t\toldTrig = linkedElem._jsvTr || false;\n\n\tif (tag) {\n\t\tnewTrig = tag.tagCtx.props.trigger;\n\t\tif (newTrig === undefined) {\n\t\t\tnewTrig = tag.trigger;\n\t\t}\n\t}\n\tif (newTrig === undefined) {\n\t\tnewTrig = $subSettings.trigger;\n\t}\n\t// Trigger is noop except for text box, textarea, contenteditable...\n\tnewTrig = newTrig && (linkedElem.tagName === \"INPUT\" && linkedElem.type !== CHECKBOX && linkedElem.type !== RADIO\n\t\t|| linkedElem.type === \"textarea\" || linkedElem.contentEditable === TRUE) && newTrig || false;\n\n\tif (oldTrig !== newTrig) {\n\t\t$linkedElem = $(linkedElem);\n\t\tbindTriggerEvent($linkedElem, oldTrig, \"off\");\n\t\tbindTriggerEvent($linkedElem, linkedElem._jsvTr = newTrig, \"on\");\n\t}\n}\n\nfunction defineBindToDataTargets(binding, tag, cvtBk) {\n\t// Two-way binding.\n\t// We set the binding.to[1] to be the cvtBack, and binding.to[0] to be either the path to the target, or [object, path] where the target is the\n\t// path on the provided object. So for a computed path with an object call: a.b.getObject().d.e, we set to[0] to be [exprOb, \"d.e\"], and\n\t// we bind to the path on the returned object, exprOb.ob, as target. Otherwise our target is the first path, paths[0], which we will convert\n\t// with contextCb() for paths like ~a.b.c or #x.y.z\n\n\tvar pathIndex, path, lastPath, bindtoOb, to, bindTo, paths, k, obsCtxPrm, linkedCtxParam, contextCb, targetPaths, bindTos, fromIndex, isCpfn,\n\t\ttagElse = 1,\n\t\ttos = [],\n\t\tlinkCtx = binding.linkCtx,\n\t\tsource = linkCtx.data,\n\t\ttargetPathsElses = linkCtx.fn.paths;\n\n\tif (binding && !binding.to) {\n\t\tif (tag) {\n\t\t\tif (!tag.convertBack) {\n\t\t\t\ttag.convertBack = cvtBk;\n\t\t\t}\n\t\t\tbindTo = tag.bindTo;\n\t\t\ttagElse = tag.tagCtxs ? tag.tagCtxs.length : 1;\n\t\t}\n\t\twhile (tagElse--) {\n\t\t\tbindTos = [];\n\t\t\tif (targetPaths = targetPathsElses[tagElse]) {\n\t\t\t\tbindTo = targetPaths._jsvto ? [\"jsvto\"] : (bindTo || [0]);\n\t\t\t\tif (!tagElse && tag && tag._.ths) {\n\t\t\t\t\t// Tag has a this=expr bindign for which we will create an additional 'to' target (at index bindTo.length)\n\t\t\t\t\tbindTo = bindTo.concat(\"this\");\n\t\t\t\t}\n\t\t\t\tk = bindTo.length;\n\t\t\t\twhile (k--) {\n\t\t\t\t\tpath = \"\";\n\t\t\t\t\tcontextCb = linkCtx._ctxCb;\n\t\t\t\t\tpaths = bindTo[k];\n\t\t\t\t\tpaths = targetPaths[+paths === paths ? paths : \"_\" + paths]; // If path is a string, prepend \"_\" to avoid collision (e.g. with array.length if path is \"length\")\n\t\t\t\t\tif (pathIndex = paths && paths.length) {\n\t\t\t\t\t\tlastPath = paths[pathIndex - 1];\n\t\t\t\t\t\tif (lastPath._cpfn) { // Computed property exprOb\n\n\t\t\t\t\t\t\tbindtoOb = lastPath;\n\t\t\t\t\t\t\twhile (lastPath.sb && lastPath.sb._cpfn) {\n\t\t\t\t\t\t\t\tpath = lastPath = lastPath.sb;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpath = lastPath.sb || path && path.path;\n\t\t\t\t\t\t\tisCpfn = lastPath._cpfn && !lastPath.sb; // leaf binding to computed property/function \"a.b.c()\"\n\t\t\t\t\t\t\tlastPath = path ? path.slice(1) : bindtoOb.path;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tto = path\n\t\t\t\t\t\t\t? [bindtoOb, // 'exprOb' for this expression and view-binding. So bindtoOb.ob is current object returned by expression.\n\t\t\t\t\t\t\t\tlastPath]\n\t\t\t\t\t\t\t: resolveDataTargetPath(lastPath, source, contextCb); // Get 'to' for target path: lastPath\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Contextual parameter ~foo with no external binding - has ctx.foo = [{_ocp: xxx}] and binds to ctx.foo._ocp\n\t\t\t\t\t\tlinkedCtxParam = tag.linkedCtxParam;\n\t\t\t\t\t\tto = [];\n\t\t\t\t\t\tfromIndex = tag._.fromIndex;\n\t\t\t\t\t\tif (fromIndex && linkedCtxParam && linkedCtxParam[fromIndex[k]]) {\n\t\t\t\t\t\t\t// This is a tag binding, with linked tag contextual parameters\n\t\t\t\t\t\t\tto = [tag.tagCtxs[tagElse].ctx[linkedCtxParam[fromIndex[k]]][0], _ocp];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ((obsCtxPrm = to._cxp) && obsCtxPrm.tag && lastPath.indexOf(\".\")<0) {\n\t\t\t\t\t\t// This is a binding for a tag contextual parameter (e.g. within a tag block content\n\t\t\t\t\t\tto = obsCtxPrm;\n\t\t\t\t\t}\n\t\t\t\t\tto.isCpfn = isCpfn;\n\t\t\t\t\tbindTos.unshift(to);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttos.unshift(bindTos);\n\t\t}\n\t\tbinding.to = tos;\n\t}\n}\n\nfunction resolveDataTargetPath(targetPath, source, contextCb) {\n\t// Iteratively process targetPath, resolving ~a.b.c paths for contextual parameters\n\tvar path, bindtoOb, to, l, obsCtxPrm, view, topCp, data;\n\n\twhile (targetPath && targetPath !== _ocp && (to = contextCb(path = targetPath.split(\"^\").join(\".\"))) && (l = to.length)) {\n\t\tif (obsCtxPrm = to[0]._cxp) { // Two-way binding to a contextual parameter reference, ~foo (declared as ~foo=expr on a parent tag)\n\t\t\ttopCp = topCp || obsCtxPrm;\n\t\t\tview = to[0][0];\n\t\t\tif (_ocp in view) {\n\t\t\t\tdata = view;\n\t\t\t\tview = view._vw;\n\t\t\t} else {\n\t\t\t\tdata = view.data;\n\t\t\t}\n\t\t\ttopCp.path = targetPath = to[0][1];\n\t\t\tto = [topCp.data = data, targetPath];\n\t\t\t\tcontextCb = $sub._gccb(view);\n\t\t\t\tif (targetPath._cpfn) { // computed property\n\t\t\t\t\tbindtoOb = targetPath;\n\t\t\t\t\tbindtoOb.data = to[0];\n\t\t\t\t\tbindtoOb._cpCtx = contextCb;\n\t\t\t\t\twhile (targetPath.sb && targetPath.sb._cpfn) {\n\t\t\t\t\t\tpath = targetPath = targetPath.sb;\n\t\t\t\t\t}\n\t\t\t\t\tpath = targetPath.sb || path && path.path;\n\t\t\t\t\ttargetPath = path ? path.slice(1) : bindtoOb.path;\n\t\t\t\t\tto = [\n\t\t\t\t\t\tbindtoOb, // 'exprOb' for this expression and view-binding. So bindtoOb.ob is current object returned by expression.\n\t\t\t\t\t\ttargetPath\n\t\t\t\t\t];\n\t\t\t\t} else if (obsCtxPrm.tag && obsCtxPrm.path === _ocp) {\n\t\t\t\t\tto = obsCtxPrm;\n\t\t\t\t}\n\t\t} else { // Two-way binding to a helper - e.g. ~address.street, or computed, e.g. ~fullName(), or view property e.g. #data.foo\n\t\t\tto = l>1\n\t\t\t\t? [to[l-2], to[l-1]] // With path: [object, path]\n\t\t\t\t: [to[l-1]]; // No path, (e.g. [function] for computed with setter)\n\t\t}\n\t\tsource = to[0];\n\t\ttargetPath = to[1];\n\t}\n\tto = to || [source, path];\n\tto._cxp = topCp;\n\treturn to;\n}\n\nfunction mergeCtxs(tag, newCtxs, replace) { // Merge updated tagCtxs into tag.tagCtxs\n\tvar tagCtx, newTagCtx, latePath,\n\t\tview = tag.tagCtx.view,\n\t\ttagCtxs = tag.tagCtxs || [tag.tagCtx],\n\t\tl = tagCtxs.length,\n\t\trefresh = !newCtxs;\n\n\tif (refresh) {\n\t\tnewCtxs = tag._.bnd.call(view.tmpl, (tag.linkCtx || view).data, view, $sub);\n\t\tif (newCtxs.lt) {\n\t\t\treturn; // We are calling tag.refresh() but a late path (@a.b.c) has not yet returned an object (@a) so cancel the refresh()\n\t\t}\n\t\ttag._.lt = undefined; // All late paths are now resolved, so this is no longer a late tag\n\t\tnewCtxs = $isArray(newCtxs) ? newCtxs : [newCtxs];\n\t}\n\n\tif (replace) {\n\t\t// Replace previous tagCtxs by new ones, rather than merging\n\t\ttagCtxs = tag.tagCtxs = newCtxs;\n\t\ttag.tagCtx = tagCtxs[0];\n\t\taddLinkMethods(tag);\n\t} else {\n\t\twhile (l--) {\n\t\t\ttagCtx = tagCtxs[l];\n\t\t\tnewTagCtx = newCtxs[l];\n\t\t\t$extend(tagCtx.ctx, newTagCtx.ctx); // We don't support propagating ctx variables, ~foo, observably, to nested views. So extend, not setProperty...\n\t\t\ttagCtx.args = newTagCtx.args;\n\t\t\tif (refresh) {\n\t\t\t\ttagCtx.tmpl = newTagCtx.tmpl;\n\t\t\t}\n\t\t\t$observable(tagCtx.props).setProperty(newTagCtx.props);\n\t\t}\n\t}\n\t$sub._thp(tag, tagCtxs[0]); // tagHandlersFromProps\n\treturn tagCtxs;\n}\n\n//=========\n// Disposal\n//=========\n\nfunction clean(elems) {\n\t// Remove data-link bindings, or contained views\n\tvar l, elem, bindings,\n\t\telemArray = [],\n\t\tlen = elems.length,\n\t\ti = len;\n\twhile (i--) {\n\t\t// Copy into an array, so that deletion of nodes from DOM will not cause our 'i' counter to get shifted\n\t\t// (Note: This seems as fast or faster than elemArray = [].slice.call(elems); ...)\n\t\telemArray.push(elems[i]);\n\t}\n\ti = len;\n\twhile (i--) {\n\t\telem = elemArray[i];\n\t\tif (elem.parentNode) {\n\t\t\t// Has not already been removed from the DOM\n\t\t\tif (bindings = elem._jsvBnd) {\n\t\t\t\t// Get propertyChange bindings for this element\n\t\t\t\t// This may be an element with data-link, or the opening script marker node for a data-linked tag {^{...}}\n\t\t\t\t// bindings is a string with the syntax: \"(&bindingId)*\"\n\t\t\t\tbindings = bindings.slice(1).split(\"&\");\n\t\t\t\telem._jsvBnd = \"\";\n\t\t\t\tl = bindings.length;\n\t\t\t\twhile (l--) {\n\t\t\t\t\t// Remove associated bindings\n\t\t\t\t\tremoveViewBinding(bindings[l], elem._jsvLkEl, elem); // unbind bindings with this bindingId on this view\n\t\t\t\t}\n\t\t\t}\n\t\t\tdisposeTokens(markerNodeInfo(elem) + (elem._df || \"\"), elem);\n\t\t}\n\t}\n}\n\nfunction removeViewBinding(bindId, linkedElemTag, elem) {\n\t// Unbind\n\tvar objId, linkCtx, tag, object, obsId, tagCtxs, l, map, linkedElem, trigger, view, tagCtx, linkedElems, allLinkedElems,\n\t\tbinding = bindingStore[bindId];\n\n\tif (linkedElemTag) {\n\t\telem._jsvLkEl = undefined;\n\t} else if (binding && (!elem || elem === binding.elem)) { // Test that elem is actually binding.elem, since cloned elements can have inappropriate markerNode info\n\t\tdelete bindingStore[bindId]; // Delete already, so call to onDispose handler below cannot trigger recursive deletion (through recursive call to jQuery cleanData)\n\t\tfor (objId in binding.bnd) {\n\t\t\tif (object = binding.bnd[objId]) {\n\t\t\t\tobsId = binding.cbId;\n\t\t\t\tif ($isArray(object)) {\n\t\t\t\t\t$([object]).off(arrayChangeStr + obsId).off(propertyChangeStr + obsId); // There may be either or both of arrayChange and propertyChange\n\t\t\t\t} else {\n\t\t\t\t\t$(object).off(propertyChangeStr + obsId);\n\t\t\t\t}\n\t\t\t\tdelete binding.bnd[objId];\n\t\t\t}\n\t\t}\n\n\t\tif (linkCtx = binding.linkCtx) {\n\t\t\tif (tag = linkCtx.tag) {\n\t\t\t\tif (tagCtxs = tag.tagCtxs) {\n\t\t\t\t\tl = tagCtxs.length;\n\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\ttagCtx = tagCtxs[l];\n\t\t\t\t\t\tif (map = tagCtx.map) {\n\t\t\t\t\t\t\tmap.unmap(); //unobserve\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Copy linkedElems in case tag.linkedElem or tag.linkedElems are undefined in onUnbind\n\t\t\t\t\t\tif (linkedElems = tagCtx.linkedElems) {\n\t\t\t\t\t\t\tallLinkedElems = (allLinkedElems || []).concat(linkedElems);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (tag.onUnbind) {\n\t\t\t\t\ttag.onUnbind(tag.tagCtx, linkCtx, tag.ctx);\n\t\t\t\t}\n\t\t\t\tif (tag.onDispose) {\n\t\t\t\t\ttag.onDispose();\n\t\t\t\t}\n\n\t\t\t\tif (!tag._elCnt) {\n\t\t\t\t\tif (tag._prv) {\n\t\t\t\t\t\ttag._prv.parentNode.removeChild(tag._prv);\n\t\t\t\t\t}\n\t\t\t\t\tif (tag._nxt) {\n\t\t\t\t\t\ttag._nxt.parentNode.removeChild(tag._nxt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlinkedElems = allLinkedElems || [$(linkCtx.elem)];\n\t\t\tl = linkedElems.length;\n\t\t\twhile (l--) {\n\t\t\t\tlinkedElem = linkedElems[l];\n\t\t\t\tif (trigger = linkedElem && linkedElem[0] && linkedElem[0]._jsvTr) {\n\t\t\t\t\tbindTriggerEvent(linkedElem, trigger, \"off\");\n\t\t\t\t\tlinkedElem[0]._jsvTr = undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tview = linkCtx.view;\n\t\t\tif (view.type === \"link\") {\n\t\t\t\tview.parent.removeViews(view._.key, undefined, true); // A \"link\" view is associated with the binding, so should be disposed with binding.\n\t\t\t} else {\n\t\t\t\tdelete view._.bnds[bindId];\n\t\t\t}\n\t\t}\n\t\tdelete cbBindingsStore[binding.cbId];\n\t}\n}\n\nfunction $unlink(to) {\n\tif (to) {\n\t\tto = to.jquery ? to : $(to);\n\t\tto.each(function() {\n\t\t\tvar innerView;\n\t\t\t//TODO fix this for better perf. Rather that calling inner view multiple times which does querySelectorAll each time, consider a single querySelectorAll\n\t\t\t// or simply call view.removeViews() on the top-level views under the target 'to' node, then clean(...)\n\t\t\t// And/or replace each() by for() or while()\n\t\t\twhile ((innerView = $view(this, true)) && innerView.parent) {\n\t\t\t\tinnerView.parent.removeViews(innerView._.key, undefined, true);\n\t\t\t}\n\t\t\tclean(this.getElementsByTagName(\"*\"));\n\t\t});\n\t\tclean(to);\n\t} else {\n\t\t// Call to $.unlink() is equivalent to $.unlink(true, \"body\")\n\t\tif (activeBody) {\n\t\t\t$(activeBody)\n\t\t\t\t.off(elementChangeStr, onElemChange)\n\t\t\t\t.off('blur.jsv', '[contenteditable]', onElemChange);\n\t\t\tactiveBody = undefined;\n\t\t}\n\t\ttopView.removeViews();\n\t\tclean(document.body.getElementsByTagName(\"*\"));\n\t}\n}\n\n//========\n// Helpers\n//========\n\nfunction inputAttrib(elem) {\n\treturn elem.type === CHECKBOX ? elem[CHECKED] : elem.value;\n}\n\nfunction changeHandler(view, name, tag) {\n\t// Get onBeforeChange, onAfterChange, onAfterCreate handler - if there is one;\n\treturn tag && tag[name] || view.ctx[name] && view.ctxPrm(name) || $views.helpers[name];\n}\n\n//========================== Initialize ==========================\n\n//=====================\n// JsRender integration\n//=====================\n\naddLinkMethods($sub.View.prototype); // Modify the View prototype to include link methods\n\n$sub.onStore.template = function(name, item, parentTmpl) {\n\tif (item === null) {\n\t\tdelete $.link[name];\n\t\tdelete $.render[name];\n\t} else {\n\t\titem.link = tmplLink;\n\n\t\tif (name && !parentTmpl && name !== \"jsvTmpl\") {\n\t\t\t$.render[name] = item;\n\t\t\t$.link[name] = function() {\n\t\t\t\treturn tmplLink.apply(item, arguments);\n\t\t\t};\n\t\t}\n\t}\n};\n\n$sub.viewInfos = viewInfos; // Expose viewInfos() as public helper method\n\n// Define JsViews version of delimiters(), and initialize\n($viewsSettings.delimiters = function() {\n\t// Run delimiters initialization in context of jsrender.js\n\tvar ret = oldJsvDelimiters.apply(0, arguments);\n\n\tif (oldJsvDelimiters !== $viewsDelimiters) {\n\t\t// If JsRender was loaded before JsViews, then need also to initialize and set globals in that JsRender instance\n\t\tret = $viewsDelimiters.apply(0, arguments);\n\t}\n\n\t// Data-linking must use new delimiters\n\trTagDatalink = new RegExp(\"(?:^|\\\\s*)([\\\\w-]*)(\\\\\" + linkChar + \")?(\\\\\" + delimOpenChar1 + $sub.rTag + \"(:\\\\w*)?\\\\\" + delimCloseChar0 + \")\", \"g\");\n\treturn ret;\n})(); // jshint ignore:line\n\n$sub.addSetting(\"trigger\");\n\n//====================================\n// Additional members for linked views\n//====================================\n\nfunction transferViewTokens(prevNode, nextNode, parentElem, id, viewOrTagChar, refresh) {\n\t// Transfer tokens on prevNode of viewToRemove/viewToRefresh to nextNode or parentElem._df\n\t// view marker tokens: #m_...VIEW.../m_\n\t// tag marker tokens: #m^...TAG..../m^\n\n\tvar i, l, vwInfos, vwInfo, viewOrTag, viewId, tokens,\n\t\tprecedingLength = 0,\n\t\temptyView = prevNode === nextNode;\n\n\tif (prevNode) {\n\t\t// prevNode is either the first node in the viewOrTag, or has been replaced by the vwInfos tokens string\n\t\tvwInfos = viewInfos(prevNode) || [];\n\t\tfor (i = 0, l = vwInfos.length; i < l; i++) {\n\t\t\t// Step through views or tags on the prevNode\n\t\t\tvwInfo = vwInfos[i];\n\t\t\tviewId = vwInfo.id;\n\t\t\tif (viewId === id && vwInfo.ch === viewOrTagChar) {\n\t\t\t\tif (refresh) {\n\t\t\t\t\t// This is viewOrTagToRefresh, this is the last viewOrTag to process...\n\t\t\t\t\tl = 0;\n\t\t\t\t} else {\n\t\t\t\t\t// This is viewOrTagToRemove, so we are done...\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!emptyView) {\n\t\t\t\tviewOrTag = vwInfo.ch === \"_\"\n\t\t\t\t\t? viewStore[viewId] // A view: \"#m_\" or \"/m_\"\n\t\t\t\t\t: bindingStore[viewId].linkCtx.tag; // A tag \"#m^\" or \"/m^\"\n\t\t\t\tif (viewOrTag) {\n\t\t\t\t\tif (vwInfo.open) { // A \"#m_\" or \"#m^\" token\n\t\t\t\t\t\tviewOrTag._prv = nextNode;\n\t\t\t\t\t} else if (vwInfo.close) { // A \"/m_\" or \"/m^\" token\n\t\t\t\t\t\tviewOrTag._nxt = nextNode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tprecedingLength += viewId.length + 2;\n\t\t}\n\n\t\tif (precedingLength) {\n\t\t\tprevNode.setAttribute(jsvAttrStr, prevNode.getAttribute(jsvAttrStr).slice(precedingLength));\n\t\t}\n\t\ttokens = nextNode ? nextNode.getAttribute(jsvAttrStr) : parentElem._df;\n\t\tif (l = tokens.indexOf(\"/\" + id + viewOrTagChar) + 1) {\n\t\t\ttokens = vwInfos._tkns.slice(0, precedingLength) + tokens.slice(l + (refresh ? -1 : id.length + 1));\n\t\t}\n\t\tif (tokens) {\n\t\t\tif (nextNode) {\n\t\t\t\t// If viewOrTagToRemove was an empty viewOrTag, we will remove both #n and /n\n\t\t\t\t// (and any intervening tokens) from the nextNode (=== prevNode)\n\t\t\t\t// If viewOrTagToRemove was not empty, we will take tokens preceding #n from prevNode,\n\t\t\t\t// and concatenate with tokens following /n on nextNode\n\t\t\t\tnextNode.setAttribute(jsvAttrStr, tokens);\n\t\t\t} else {\n\t\t\t\tsetDefer(parentElem, tokens);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// !prevNode, so there may be a deferred nodes token on the parentElem. Remove it.\n\t\tsetDefer(parentElem, removeSubStr(parentElem._df, \"#\" + id + viewOrTagChar));\n\t\tif (!refresh && !nextNode) {\n\t\t\t// If this viewOrTag is being removed, and there was no .nxt, remove closing token from deferred tokens\n\t\t\tsetDefer(parentElem, removeSubStr(parentElem._df, \"/\" + id + viewOrTagChar));\n\t\t}\n\t}\n}\n\nfunction disposeTokens(tokens, elem) {\n\tvar i, l, vwItem, vwInfos;\n\tif (vwInfos = viewInfos(tokens, true, rOpenMarkers)) {\n\t\tfor (i = 0, l = vwInfos.length; i < l; i++) {\n\t\t\tvwItem = vwInfos[i];\n\t\t\tif (vwItem.ch === \"_\") {\n\t\t\t\tif ((vwItem = viewStore[vwItem.id]) && vwItem.type && (!elem || vwItem._prv === elem || vwItem.parentElem === elem )) {\n\t\t\t\t\t// If this is the _prv (prevNode) for a view, remove the view\n\t\t\t\t\t// - unless view.type is undefined, in which case it is already being removed\n\t\t\t\t\t// (or unless the elem is not related - e.g. a cloned element which 'accidentally' picked up the data-jsv atttribute of the ._df expando)\n\t\t\t\t\tvwItem.parent.removeViews(vwItem._.key, undefined, true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveViewBinding(vwItem.id, undefined, elem); // unbind bindings with this bindingId on this view\n\t\t\t}\n\t\t}\n\t}\n}\n\n//============================================\n// Add link methods to data-linked view or tag\n//============================================\n\nfunction updateValue(val, index, tagElse, async, bindId, ev) {\n// async, bindId and ev not documented - used internally, e.g. for paged and sorted arrays on tags with dataMap, such as {{for}}\n// Observably update a data value targeted by the binding.to binding of a 2way data-link binding. Called when elem changes\n// Called when linkedElem of a tag control changes: as updateValue(val, index, tagElse, bindId, ev) - this: undefined\n// Called directly as tag.updateValue(val, index, tagElse) - this: tag\n\tvar self = this,\n\t\tvalues = [];\n\tif (self && self._tgId) {\n\t\tbindId = self;\n\t}\n\tif (arguments.length < 4) {\n\t\tif (+index !== index) {\n\t\t\tasync = index;\n\t\t\ttagElse = index = 0;\n\t\t} else if (+tagElse !== tagElse) {\n\t\t\tasync = tagElse;\n\t\t\ttagElse = 0;\n\t\t}\n\t}\n\tvalues[index||0] = val;\n\tupdateValues(values, tagElse, async, bindId, ev);\n\treturn self;\n}\n\nfunction setValues() {\n\t// tagCtx.setValues() calls tag.setValue() on that tagCtx for each bindTo target\n\tvar m = this.tag.bindTo.length,\n\t\tev = arguments[m],\n\t\teventArgs = arguments[m+1];\n\twhile (m--) {\n\t\tthis.tag.setValue(arguments[m], m, this.index, ev, eventArgs);\n\t}\n}\n\nfunction addLinkMethods(tagOrView) { // tagOrView is View prototype or tag instance\n\n\tvar l, m, tagCtx, boundProps, bindFrom, key, theTag, theView;\n\n\ttagOrView.contents = function(deep, select) {\n\t\t// For a view, a tag or a tagCtx, return jQuery object with the content nodes,\n\t\tif (deep !== !!deep) {\n\t\t\t// deep not boolean, so this is contents(selector)\n\t\t\tselect = deep;\n\t\t\tdeep = undefined;\n\t\t}\n\t\tvar filtered,\n\t\t\tnodes = $(this.nodes());\n\t\tif (nodes[0]) {\n\t\t\tselect = deep ? select || \"*\" : select;\n\t\t\tfiltered = select ? nodes.filter(select) : nodes;\n\t\t\tnodes = deep ? filtered.add(nodes.find(select)) : filtered;\n\t\t}\n\t\treturn nodes;\n\t};\n\n\ttagOrView.nodes = function(withMarkers, prevNode, nextNode) {\n\t\t// For a view, a tag or a tagCtx, return top-level nodes\n\t\t// Do not return any script marker nodes, unless withMarkers is true\n\t\t// Optionally limit range, by passing in prevNode or nextNode parameters\n\n\t\tvar node,\n\t\t\tself = this.contentView || this, // If tagCtx, use tagCtx.contentView\n\t\t\telCnt = self._elCnt,\n\t\t\tprevIsFirstNode = !prevNode && elCnt,\n\t\t\tnodes = [];\n\n\t\tif (!self.args) { // If tagCtx with no content (so no contentView) self is tagCtx: return empty [];\n\t\t\tprevNode = prevNode || self._prv;\n\t\t\tnextNode = nextNode || self._nxt;\n\n\t\t\tnode = prevIsFirstNode\n\t\t\t\t? (prevNode === self._nxt\n\t\t\t\t\t? self.parentElem.lastSibling\n\t\t\t\t\t: prevNode)\n\t\t\t\t: (self.inline === false\n\t\t\t\t\t? prevNode || self.linkCtx.elem.firstChild\n\t\t\t\t\t: prevNode && prevNode.nextSibling);\n\n\t\t\twhile (node && (!nextNode || node !== nextNode)) {\n\t\t\t\tif (withMarkers || elCnt || node.tagName !== SCRIPT) {\n\t\t\t\t\t// All the top-level nodes in the view\n\t\t\t\t\t// (except script marker nodes, unless withMarkers = true)\n\t\t\t\t\t// (Note: If a script marker node, viewInfo.elCnt undefined)\n\t\t\t\t\tnodes.push(node);\n\t\t\t\t}\n\t\t\t\tnode = node.nextSibling;\n\t\t\t}\n\t\t}\n\t\treturn nodes;\n\t};\n\n\ttagOrView.childTags = function(deep, tagName) {\n\t\t// For a view, a tag or a tagCtx, return child tags - at any depth, or as immediate children only.\n\t\tif (deep !== !!deep) {\n\t\t\t// deep not boolean, so this is childTags(tagName) - which looks for top-level tags of given tagName\n\t\t\ttagName = deep;\n\t\t\tdeep = undefined;\n\t\t}\n\n\t\tvar self = this.contentView || this, // If tagCtx, use tagCtx.contentView\n\t\t\tview = self.link ? self : self.tagCtx.view, // This may be a view or a tag. If a tag, get the view from tag.tagCtx.view\n\t\t\tprevNode = self._prv,\n\t\t\telCnt = self._elCnt,\n\t\t\ttags = [];\n\n\t\tif (!self.args) { // If tagCtx with no content (so no contentView) self is tagCtx: return empty [];\n\t\t\tview.link(\n\t\t\t\tundefined,\n\t\t\t\tself.parentElem,\n\t\t\t\telCnt ? prevNode && prevNode.previousSibling : prevNode,\n\t\t\t\tself._nxt,\n\t\t\t\tundefined,\n\t\t\t\t{get:{\n\t\t\t\t\ttags: tags,\n\t\t\t\t\tdeep: deep,\n\t\t\t\t\tname: tagName,\n\t\t\t\t\tid: self.link ? self._.id + \"_\" : self._tgId + \"^\"\n\t\t\t\t}}\n\t\t\t);\n\t\t}\n\t\treturn tags;\n\t};\n\n\tif (tagOrView._is === \"tag\") {\n\t\t//=======================\n\t\t// This is a TAG instance\n\t\t//=======================\n\n\t\ttheTag = tagOrView;\n\n\t\tm = theTag.tagCtxs.length;\n\t\twhile (m--) {\n\t\t\ttagCtx = theTag.tagCtxs[m];\n\n\t\t\ttagCtx.setValues = setValues;\n\t\t\ttagCtx.contents = tagOrView.contents;\n\t\t\ttagCtx.childTags = tagOrView.childTags;\n\t\t\ttagCtx.nodes = tagOrView.nodes;\n\t\t}\n\n\t\tboundProps = theTag.boundProps = theTag.boundProps || [];\n\t\tif (bindFrom = theTag.bindFrom) {\n\t\t\tl = bindFrom.length;\n\t\t\twhile (l--) {\n\t\t\t\tkey = bindFrom[l];\n\t\t\t\tif (typeof key === STRING) {\n\t\t\t\t\tbindFrom[key] = 1;\n\t\t\t\t\tif ($inArray(key, boundProps) < 0) {\n\t\t\t\t\t\tboundProps.push(key); // Add any 'bindFrom' props to boundProps array. (So two-way binding works without writing ^foo=expression)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttheTag.setValue = $sub._gm( // getMethod\n\t\t\ttheTag.constructor.prototype.setValue || function(val) { // base method\n\t\t\t\treturn val;\n\t\t\t},\n\t\t\tfunction(val, indexFrom, tagElse, ev, eventArgs) {\n\t\t\t\tindexFrom = indexFrom || 0;\n\t\t\t\ttagElse = tagElse || 0;\n\n\t\t\t\tvar linkedElem, linkedEl, linkedCtxParam, indexTo, linkedElems, newVal,\n\t\t\t\t\ttagCtx = theTag.tagCtxs[tagElse];\n\n\t\t\t\tif (tagCtx._bdArgs && (eventArgs || val !== undefined) && tagCtx._bdArgs[indexFrom]===val\n\t\t\t\t\t&& (!eventArgs || eventArgs.change !== \"set\" || ev.target !== val && eventArgs.value !== val)) {\n\n\t\t\t\t\tif (tagCtx._bdVals) { // If val is not undefined (or is coming from an observable change event), and is a value that was already returned, use stored value and don't call tag.setValue()\n\t\t\t\t\t\tval = tagCtx._bdVals[indexFrom];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Call tag method tag.setValue(), if implemented\n\t\t\t\t\ttagCtx._bdArgs = tagCtx._bdArgs || [];\n\t\t\t\t\ttagCtx._bdArgs[indexFrom] = val;\n\t\t\t\t\tnewVal = theTag.base.call(theTag, val, indexFrom, tagElse, ev, eventArgs);\n\t\t\t\t\tif (newVal !== undefined) {\n\t\t\t\t\t\ttagCtx._bdVals = tagCtx._bdVals || [];\n\t\t\t\t\t\ttagCtx._bdVals[indexFrom] = newVal; // store value, so that if same value is called later we'll use the stored value, and won't call tag.setValue()\n\t\t\t\t\t\tval = newVal;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (val !== undefined && (linkedCtxParam = theTag.linkedCtxParam) && linkedCtxParam[indexFrom]) {\n\t\t\t\t\t\t// If this setValue call corresponds to a tag contextual parameter and the tag has a converter, then we need to set the\n\t\t\t\t\t\t// value of this contextual parameter (since it is not directly bound to the tag argument/property when there is a converter).\n\t\t\t\t\ttagCtx.ctxPrm(linkedCtxParam[indexFrom], val);\n\t\t\t\t}\n\t\t\t\tindexTo = theTag._.toIndex[indexFrom];\n\t\t\t\tif (indexTo !== undefined) {\n\t\t\t\t\tif (linkedElems = tagCtx.linkedElems || theTag.linkedElem && [theTag.linkedElem]) {\n\t\t\t\t\t\tif ((linkedElem = linkedElems[indexTo]) && (l = linkedElem.length)) {\n\t\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\t\tlinkedEl = linkedElem[l];\n\t\t\t\t\t\t\t\tif (val !== undefined && !linkedEl._jsvChg && theTag.linkCtx._val !== val) {\n\t\t\t\t\t\t\t\t\tif (linkedEl.value !== undefined) {\n\t\t\t\t\t\t\t\t\t\tif (linkedEl.type === CHECKBOX) {\n\t\t\t\t\t\t\t\t\t\t\tlinkedEl[CHECKED] = $.isArray(val)\n\t\t\t\t\t\t\t\t\t\t\t\t? $.inArray(linkedEl.value, val) > -1\n\t\t\t\t\t\t\t\t\t\t\t\t: val && val !== \"false\";\n\t\t\t\t\t\t\t\t\t\t} else if (linkedEl.type === RADIO) {\n\t\t\t\t\t\t\t\t\t\t\tlinkedEl[CHECKED] = (linkedEl.value === val);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$(linkedEl).val(val); // Use jQuery for attrHooks - can't just set value (on select, for example)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlinkedEl[linkedEl.contentEditable === TRUE ? \"innerHTML\" : TEXTCONTENT] = val;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (tagCtx.props.name) {\n\t\t\t\t\t\t\t\t\tlinkedEl.name = linkedEl.name || tagCtx.props.name;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn theTag;\n\t\t\t}\n\t\t);\n\t\ttheTag.updateValue = updateValue;\n\n\t\ttheTag.updateValues = function() {\n\t\t\tvar tagElse, async,\n\t\t\t\ttag = this,\n\t\t\t\tbindToLength = tag.bindTo ? tag.bindTo.length : 1,\n\t\t\t\textra = arguments.length - bindToLength;\n\n\t\t\tif (extra) {\n\t\t\t\ttagElse = arguments[bindToLength];\n\t\t\t\tif (extra > 1) {\n\t\t\t\t\tasync = extra > 1 ? arguments[bindToLength + 1] : undefined;\n\t\t\t\t} else if (+tagElse !== tagElse) {\n\t\t\t\t\tasync = tagElse;\n\t\t\t\t\ttagElse = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn updateValues(arguments, tagElse, async, this);\n\t\t};\n\n\t\ttheTag.setValues = function() {\n\t\t// tag.setValues(a, b, c) calls tagCtx.setValues(a, b, c) on the first tagCtx\n\t\t\tsetValues.apply(theTag.tagCtx, arguments);\n\t\t\treturn theTag;\n\t\t};\n\n\t\ttheTag.refresh = function() {\n\t\t\tvar attr, sourceValue,\n\t\t\t\tlinkCtx = theTag.linkCtx,\n\t\t\t\tview = theTag.tagCtx.view;\n\n\t\t\tif (!(sourceValue = mergeCtxs(theTag))) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (theTag.onUnbind) {\n\t\t\t\ttheTag.onUnbind(theTag.tagCtx, linkCtx, theTag.ctx);\n\t\t\t\ttheTag._.unlinked = true;\n\t\t\t}\n\t\t\tattr = theTag.inline ? HTML : (linkCtx.attr || defaultAttr(theTag.parentElem, true));\n\t\t\tsourceValue = theTag.tagName === \":\"\n\t\t\t\t? $sub._cnvt(theTag.convert, view, theTag.tagCtx)\n\t\t\t\t: $sub._tag(theTag, view, view.tmpl, sourceValue, true); // Get rendered HTML for tag, based on refreshed tagCtxs\n\n\t\t\tobserveAndBind(linkCtx, linkCtx.data, linkCtx.elem);\n\t\t\tupdateContent(sourceValue, linkCtx, attr, theTag);\n\t\t\tcallAfterLink(theTag);\n\t\t\treturn theTag;\n\t\t};\n\n\t\ttheTag.domChange = function() { // domChange notification support\n\t\t\tvar elem = this.parentElem,\n\t\t\t\thasListener = $._data(elem).events,\n\t\t\t\tdomChangeNotification = \"jsv-domchange\";\n\n\t\t\tif (hasListener && hasListener[domChangeNotification]) {\n\t\t\t\t// Only trigger handler if there is a handler listening for this event. (Note using triggerHandler - so no event bubbling.)\n\t\t\t\t$(elem).triggerHandler(domChangeNotification, arguments);\n\t\t\t}\n\t\t};\n\n\t\t//====================================\n\t\t// End of added link methods for TAG\n\t\t//====================================\n\t} else {\n\t\t//=========================\n\t\t// This is a VIEW prototype\n\t\t//=========================\n\n\t\ttheView = tagOrView;\n\n\t\t// Note: a linked view will also, after linking have nodes[], _prv (prevNode), _nxt (nextNode) ...\n\t\ttheView.addViews = function(index, dataItems, delayed) {\n\t\t\t// if view is not an array view, do nothing\n\t\t\tvar i, viewsCount,\n\t\t\t\tview = this,\n\t\t\t\titemsCount = dataItems.length,\n\t\t\t\tviews = view.views;\n\n\t\t\tif (!view._.useKey && itemsCount) {\n\t\t\t\t// view is of type \"array\"\n\t\t\t\tviewsCount = views.length + itemsCount;\n\n\t\t\t\tif ((delayed || viewsCount === view.data.length) // If delayed or if views not already synced to array (e.g. triggered by array.length propertyChange - jsviews/issues/301)\n\t\t\t\t\t&& renderAndLink(view, index, view.tmpl, views, dataItems, view.ctx) !== false\n\t\t\t\t\t&& !view._.srt) { // Not part of a 'sort' on refresh\n\t\t\t\t\tview.fixIndex(index + itemsCount);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\ttheView.removeViews = function(index, itemsCount, keepNodes, delayed) {\n\t\t\t// view.removeViews() removes all the child views\n\t\t\t// view.removeViews(index) removes the child view with specified index or key\n\t\t\t// view.removeViews(index, count) removes the specified nummber of child views, starting with the specified index\n\t\t\tfunction removeView(index) {\n\t\t\t\tvar id, bindId, parentElem, prevNode, nextNode, nodesToRemove,\n\t\t\t\t\tviewToRemove = views[index];\n\n\t\t\t\tif (viewToRemove && viewToRemove.link) {\n\t\t\t\t\tid = viewToRemove._.id;\n\t\t\t\t\tif (!keepNodes) {\n\t\t\t\t\t\t// Remove the HTML nodes from the DOM, unless they have already been removed, including nodes of child views\n\t\t\t\t\t\tnodesToRemove = viewToRemove.nodes();\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove child views, without removing nodes\n\t\t\t\t\tviewToRemove.removeViews(undefined, undefined, true);\n\n\t\t\t\t\tviewToRemove.type = undefined; // Set type to undefined: used as a flag that this view is being removed\n\t\t\t\t\tprevNode = viewToRemove._prv;\n\t\t\t\t\tnextNode = viewToRemove._nxt;\n\t\t\t\t\tparentElem = viewToRemove.parentElem;\n\t\t\t\t\t// If prevNode and nextNode are the same, the view is empty\n\t\t\t\t\tif (!keepNodes) {\n\t\t\t\t\t\t// Remove the HTML nodes from the DOM, unless they have already been removed, including nodes of child views\n\t\t\t\t\t\tif (viewToRemove._elCnt) {\n\t\t\t\t\t\t\t// if keepNodes is false (and transferring of tokens has not already been done at a higher level)\n\t\t\t\t\t\t\t// then transfer tokens from prevNode which is being removed, to nextNode.\n\t\t\t\t\t\t\ttransferViewTokens(prevNode, nextNode, parentElem, id, \"_\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$(nodesToRemove).remove();\n\t\t\t\t\t}\n\t\t\t\t\tif (!viewToRemove._elCnt && prevNode) {\n\t\t\t\t\t\tprevNode.parentNode.removeChild(prevNode); // (prevNode.parentNode is parentElem, except if jQuery Mobile or similar has inserted an intermediate wrapper\n\t\t\t\t\t\tnextNode.parentNode.removeChild(nextNode);\n\t\t\t\t\t}\n\t\t\t\t\tsetArrayChangeLink(viewToRemove);\n\t\t\t\t\tfor (bindId in viewToRemove._.bnds) {\n\t\t\t\t\t\tremoveViewBinding(bindId);\n\t\t\t\t\t}\n\t\t\t\t\tdelete viewStore[id];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar current, childView, viewsCount,\n\t\t\t\tview = this,\n\t\t\t\tisArray = !view._.useKey,\n\t\t\t\tviews = view.views;\n\n\t\t\tif (isArray) {\n\t\t\t\tviewsCount = views.length;\n\t\t\t}\n\t\t\tif (index === undefined) {\n\t\t\t\t// Remove all child views\n\t\t\t\tif (isArray) {\n\t\t\t\t\t// views and data are arrays\n\t\t\t\t\tcurrent = viewsCount;\n\t\t\t\t\twhile (current--) {\n\t\t\t\t\t\tremoveView(current);\n\t\t\t\t\t}\n\t\t\t\t\tview.views = [];\n\t\t\t\t} else {\n\t\t\t\t\t// views and data are objects\n\t\t\t\t\tfor (childView in views) {\n\t\t\t\t\t\t// Remove by key\n\t\t\t\t\t\tremoveView(childView);\n\t\t\t\t\t}\n\t\t\t\t\tview.views = {};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (itemsCount === undefined) {\n\t\t\t\t\tif (isArray) {\n\t\t\t\t\t\t// The parentView is data array view.\n\t\t\t\t\t\t// Set itemsCount to 1, to remove this item\n\t\t\t\t\t\titemsCount = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Remove child view with key 'index'\n\t\t\t\t\t\tremoveView(index);\n\t\t\t\t\t\tdelete views[index];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isArray && itemsCount\n\t\t\t\t\t&& (delayed || viewsCount - itemsCount === view.data.length)) { // If views not already synced to array (e.g. triggered by array.length propertyChange - jsviews/issues/301)\n\t\t\t\t\tcurrent = index + itemsCount;\n\t\t\t\t\t// Remove indexed items (parentView is data array view);\n\t\t\t\t\twhile (current-- > index) {\n\t\t\t\t\t\tremoveView(current);\n\t\t\t\t\t}\n\t\t\t\t\tviews.splice(index, itemsCount);\n\t\t\t\t\tif (!view._.srt) {\n\t\t\t\t\t\tview.fixIndex(index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\ttheView.moveViews = function(oldIndex, index, itemsCount) {\n\t\t\tfunction parts(itemView, str) { // Get the totkens preceding the 'open' token for this view, #n_, and the tokens following (and including) the 'open' token\n\t\t\t\treturn RegExp(\"^(.*)(\" + (str ? \"\\\\/\" : \"#\") + itemView._.id + \"_.*)$\").exec(str || itemView._prv.getAttribute(jsvAttrStr));\n\t\t\t}\n\t\t\tfunction setPrv(itemView, tokens) {\n\t\t\t\tvar tag,\n\t\t\t\t\tprv = itemView._prv;\n\t\t\t\tprv.setAttribute(jsvAttrStr, tokens);\n\t\t\t\ttokens.replace(rTagMarkers, function(all, open, close, id) {\n\t\t\t\t\ttag = bindingStore[id].linkCtx.tag;\n\t\t\t\t\tif (tag.inline) {\n\t\t\t\t\t\ttag[open ? \"_prv\" : \"_nxt\"] = prv;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\ttokens.replace(rViewMarkers, function(all, open, close, id) {\n\t\t\t\t\tviewStore[id][open ? \"_prv\" : \"_nxt\"] = prv;\n\t\t\t\t});\n\t\t\t}\n\t\t\tvar nodes, childView, nxtView, insertBefore, viewId,\n\t\t\t\tview = this,\n\t\t\t\tselfNxt = view._nxt,\n\t\t\t\tviews = view.views,\n\t\t\t\tbackwards = index < oldIndex,\n\t\t\t\tfirstChange = backwards ? index : oldIndex,\n\t\t\t\tlastChange = backwards ? oldIndex : index,\n\t\t\t\ti = index,\n\t\t\t\tmovedNodes = [],\n\n\t\t\t\tviewsToMove = views.splice(oldIndex, itemsCount); // remove\n\n\t\t\tif (index > views.length) {\n\t\t\t\tindex = views.length;\n\t\t\t}\n\t\t\tviews.splice.apply(views, [index, 0].concat(viewsToMove)); //re-insert\n\n\t\t\titemsCount = viewsToMove.length;\n\t\t\tinsertBefore = index + itemsCount;\n\t\t\tlastChange += itemsCount;\n\n\t\t\tfor (i; i < insertBefore; i++) {\n\t\t\t\tchildView = views[i];\n\t\t\t\tnodes = childView.nodes(true);\n\t\t\t\tmovedNodes = view._elCnt ? movedNodes.concat(nodes) : movedNodes.concat(childView._prv, nodes, childView._nxt);\n\t\t\t}\n\t\t\tmovedNodes = $(movedNodes);\n\n\t\t\tif (insertBefore < views.length) {\n\t\t\t\tmovedNodes.insertBefore(views[insertBefore]._prv);\n\t\t\t} else if (selfNxt) {\n\t\t\t\tmovedNodes.insertBefore(selfNxt);\n\t\t\t} else {\n\t\t\t\tmovedNodes.appendTo(view.parentElem);\n\t\t\t}\n\n\t\t\tif (view._elCnt) {\n\t\t\t\tvar afterParts,\n\t\t\t\t\tendChange = backwards ? firstChange + itemsCount : lastChange - itemsCount,\n\t\t\t\t\tbeforeView = views[firstChange-1],\n\t\t\t\t\tstartView = views[firstChange],\n\t\t\t\t\tendView = views[endChange],\n\t\t\t\t\tafterView = views[lastChange],\n\t\t\t\t\tstartParts = parts(startView),\n\t\t\t\t\tendParts = parts(endView);\n\n\t\t\t\tsetPrv(startView, endParts[1] + startParts[2]);\n\t\t\t\tif (afterView) {\n\t\t\t\t\tafterParts = parts(afterView);\n\t\t\t\t\tsetPrv(afterView, startParts[1] + afterParts[2]);\n\t\t\t\t} else {\n\t\t\t\t\tviews[lastChange-1]._nxt = selfNxt;\n\t\t\t\t\tif (selfNxt) {\n\t\t\t\t\t\tafterParts = parts(view, selfNxt.getAttribute(jsvAttrStr));\n\t\t\t\t\t\tselfNxt.setAttribute(jsvAttrStr, startParts[1] + afterParts[2]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tafterParts = parts(view, view.parentElem._df);\n\n\t\t\t\t\t\tsetDefer(view.parentElem, startParts[1] + afterParts[2]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsetPrv(endView, afterParts[1] + endParts[2]);\n\t\t\t}\n\t\t\tview.fixIndex(firstChange);\n\t\t};\n\n\t\ttheView.refresh = function() {\n\t\t\tvar view = this,\n\t\t\t\tparent = view.parent;\n\n\t\t\tif (parent) {\n\t\t\t\trenderAndLink(view, view.index, view.tmpl, parent.views, view.data, undefined, true);\n\t\t\t\tsetArrayChangeLink(view);\n\t\t\t}\n\t\t\treturn view;\n\t\t};\n\n\t\ttheView.fixIndex = function(fromIndex) {\n\t\t\t// Fixup index on following view items...\n\t\t\tvar views = this.views,\n\t\t\t\tindex = views.length;\n\t\t\twhile (fromIndex < index--) {\n\t\t\t\tif (views[index].index !== index) {\n\t\t\t\t\t$observable(views[index]).setProperty(\"index\", index);\n\t\t\t\t\t// This is fixing up index, but not key, and not index on child views. From child views, use view.getIndex()\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\ttheView.link = viewLink;\n\n\t\t//====================================\n\t\t// End of added link methods for VIEW\n\t\t//====================================\n\t}\n}\n\n//========================\n// JsViews-specific converters\n//========================\n\n$converters.merge = function(val) {\n\t// Special converter used in data-linking to space-separated lists, such as className:\n\t// Currently only supports toggle semantics - and has no effect if toggle string is not specified\n\t// data-link=\"class{merge:boolExpr toggle=className}\"\n\tvar regularExpression,\n\t\tcurrentValue = this.linkCtx.elem.className,\n\t\ttoggle = this.tagCtx.props.toggle;\n\n\tif (toggle) {\n\t\t// We are toggling the class specified by the toggle property,\n\t\t// and the boolean val binding is driving the insert/remove toggle\n\n\t\tregularExpression = toggle.replace(/[\\\\^$.|?*+()[{]/g, \"\\\\$&\");\n\t\t// Escape any regular expression special characters (metacharacters) within the toggle string\n\t\tregularExpression = \"(\\\\s(?=\" + regularExpression + \"$)|(\\\\s)|^)(\" + regularExpression + \"(\\\\s|$))\";\n\t\t// Example: /(\\s(?=myclass$)|(\\s)|^)?(myclass(\\s|$))/ - so matches (\" myclass\" or \" \" or ^ ) followed by (\"myclass \" or \"myclass$\") where ^/$ are beginning/end of string\n\t\tcurrentValue = currentValue.replace(new RegExp(regularExpression), \"$2\");\n\t\tval = currentValue + (val ? (currentValue && \" \") + toggle : \"\");\n\t}\n\treturn val;\n};\n\n//========================\n// JsViews-specific tags\n//========================\n\n$tags({\n\ton: {\n\t\tattr: NONE,\n\t\tbindTo: [], // Don't need to bind to first arg, so prevent the default [0] binding\n\t\tinit: function(tagCtx) {\n\t\t\tvar content,\n\t\t\t\ttag = this,\n\t\t\t\ti = 0,\n\t\t\t\targs = tagCtx.args, // [events,] [selector,] handler\n\t\t\t\tl = args.length;\n\n\t\t\tfor (; ii && i+1; // handler index\n\t\t\tif (tag.inline) {\n\t\t\t\tif (!$sub.rTmpl.exec(content = $.trim(tagCtx.tmpl.markup))) {\n\t\t\t\t\t// Inline {^{on}} tag with no content (or external template content) or with content containing\n\t\t\t\t\t// no HTML or JsRender tags: We will wrap the (text) content, or the operation name in a element\n\t\t\t\t\t// (Otherwise we will attach the handler to the element content after data-linking)\n\t\t\t\t\ttag.template = \"\" + (content || tagCtx.params.args[i] || \"noop\") + \" \";\n\t\t\t\t}\n\t\t\t\ttag.attr = HTML;\n\t\t\t}\n\t\t},\n\t\tonBind: function() {\n\t\t\tif (this.template) { // {^{on/}} with no content has template rendering . Make it the mainElem, so we can set id, size or class\n\t\t\t\tthis.mainElem = this.contents(\"button\");\n\t\t\t}\n\t\t},\n\t\tonAfterLink: function(tagCtx, linkCtx) {\n\t\t\tvar handler, params, find, activeElem,\n\t\t\t\ttag = this,\n\t\t\t\ti = tag._hi,\n\t\t\t\targs = tagCtx.args, // [events,] [selector,] handler\n\t\t\t\tl = args.length,\n\t\t\t\tprops = tagCtx.props,\n\t\t\t\tdata = props.data,\n\t\t\t\tview = tagCtx.view,\n\t\t\t\tcontextOb = props.context; // Context ('this' pointer) for attached handler\n\n\t\t\tif (i) { // There is a handler\n\t\t\t\thandler = args[i-1];\n\t\t\t\tparams = args.slice(i); // Subsequent args are params\n\t\t\t\targs = args.slice(0, i-1); // Preceding args (if any) are events and selector\n\t\t\t\ttag._sel = args[1]; // Selector for descendant elements - for delegated events on those elements, delegating to the activeElem\n\n\t\t\t\tactiveElem = tag.activeElem = tag.activeElem || $(tag.inline\n\t\t\t\t\t? (tag._sel = args[1] || \"*\", tag.parentElem)\n\t\t\t\t\t// If inline, attach to child elements of tag parent element (filtered by selector argument if provided.\n\t\t\t\t\t// (In handler we'll filter out events from sibling elements preceding or following tag.)\n\t\t\t\t\t// This allows us to use the delegated pattern where the attached event works even for added elements satisfying the selector\n\t\t\t\t\t: linkCtx.elem);\n\n\t\t\t\tif (!contextOb) {\n\t\t\t\t\t// Get the path for the preceding object (context object) of handler (which is the last arg), compile function\n\t\t\t\t\t// to return that context object, and run compiled function against data\n\t\t\t\t\tcontextOb = /^(.*)[.^][\\w$]+$/.exec(tagCtx.params.args.slice(-params.length - 1)[0]);\n\t\t\t\t\tcontextOb = contextOb && $sub.tmplFn(delimOpenChar1 + \":\" + contextOb[1] + delimCloseChar0, view.tmpl, true)(linkCtx.data, view, $sub);\n\t\t\t\t}\n\n\t\t\t\tif (tag._evs) {\n\t\t\t\t\ttag.onUnbind(tagCtx, linkCtx, tag.ctx);\n\t\t\t\t}\n\n\t\t\t\tactiveElem.on(\n\t\t\t\t\ttag._evs = args[0] || \"click\", // events defaults to \"click\"\n\t\t\t\t\ttag._sel,\n\t\t\t\t\tdata == undefined ? null : data,\n\t\t\t\t\ttag._hlr = function hndlr(ev) {\n\t\t\t\t\t\tvar nodes, length,\n\t\t\t\t\t\t\tfound = !tag.inline;\n\n\t\t\t\t\t\tif (!found) { // If inline, filter out events from sibling elements preceding or following tag.\n\t\t\t\t\t\t\tnodes = tag.contents(\"*\");\n\t\t\t\t\t\t\tl = nodes.length;\n\t\t\t\t\t\t\twhile (!found && l--) {\n\t\t\t\t\t\t\t\tif (nodes[l].contains(ev.target)) {\n\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (found) { // target elem is indeed within the tag, so call the {on} handler\n\t\t\t\t\t\t\treturn handler.apply(contextOb || linkCtx.data, [].concat(\n\t\t\t\t\t\t\t\tparams, // e.g. par1, par2\n\t\t\t\t\t\t\t\tev,\n\t\t\t\t\t\t\t\t{change: ev.type, view: view, linkCtx: linkCtx},\n\t\t\t\t\t\t\t\tparams.slice.call(arguments, 1) // If triggering event (e.g. jsv-domchange) has additional arguments after ev, pass them too\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t// for {on 'click' handler par1 par2} use handler(par1, par2, ev, domchangeEventArgs)\n\t\t\t\t\t\t\t// for {on 'jsv-domchange' handler par1 par2} use handler(par1, par2, ev, domchangeEventArgs, tagCtx, linkCtx, observableEventArgs)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\tonUpdate: false,\n\t\tonArrayChange: false,\n\t\tonUnbind: function() {\n\t\t\tvar self = this,\n\t\t\t\toldIsCleanCall = isCleanCall;\n\t\t\tif (self.activeElem) {\n\t\t\t\tisCleanCall = 0; // Needed when using jquery-1.x, to avoid bug where jQuery calls cleanData on elements that are not being removed\n\t\t\t\tself.activeElem.off(self._evs, self._sel, self._hlr);\n\t\t\t\tisCleanCall = oldIsCleanCall;\n\t\t\t}\n\t\t},\n\t\tcontentCtx: true,\n\t\tsetSize: true,\n\t\tdataBoundOnly: true\n\t},\n\tradiogroup: {\n\t\tboundProps: [\"disabled\"],\n\t\tinit: function(tagCtx) {\n\t\t\tthis.name = tagCtx.props.name || (Math.random() + \"jsv\").slice(9);\n\t\t},\n\t\tonBind: function(tagCtx, linkCtx) {\n\t\t\tvar domChngCntnr, $linkedElem, l,\n\t\t\t\ttag = this,\n\t\t\t\tuseDisable = tagCtx.params.props;\n\t\t\tuseDisable = useDisable && useDisable.disabled;\n\t\t\tif (tag.inline) {\n\t\t\t\t// If the first element is owned by (rendered by) this tag (not by a childTag such as {^{for}})\n\t\t\t\t// use it as container for detecting dom changes\n\t\t\t\tdomChngCntnr = tag.contents(\"*\")[0];\n\t\t\t\tdomChngCntnr = domChngCntnr && $view(domChngCntnr).ctx.tag === tag.parent ? domChngCntnr : tag.parentElem;\n\t\t\t\t$linkedElem = tag.contents(true, RADIOINPUT);\n\t\t\t} else {\n\t\t\t\tdomChngCntnr = linkCtx.elem;\n\t\t\t\t$linkedElem = $(RADIOINPUT, linkCtx.elem);\n\t\t\t}\n\t\t\ttag.linkedElem = $linkedElem;\n\t\t\tl = $linkedElem.length;\n\t\t\twhile (l--) {\n\t\t\t\t// Configure the name for each radio input element\n\t\t\t\t$linkedElem[l].name = $linkedElem[l].name || tag.name;\n\t\t\t}\n\t\t\t// Establish a domchange listener in case this radiogroup wraps a {^{for}} or {^{if}} or similar\n\t\t\t// which might dynamically insert new radio input elements\n\t\t\t$(domChngCntnr).on(\"jsv-domchange\", tag._dmChg = function(ev, forOrIfTagCtx, linkCtx, eventArgs) {\n\t\t\t\tvar linkedElem, val,\n\t\t\t\t\tparentTags = forOrIfTagCtx.ctx.parentTags;\n\t\t\t\tif (!eventArgs.refresh &&\n\t\t\t\t\t(!tag.inline ||\n\t\t\t\t\t\tdomChngCntnr !== tag.parentElem ||\n\t\t\t\t\t\t// If the tag is inline, and the domChngCntnr is the parentElem, then we need to\n\t\t\t\t\t\t// make sure dom change event is fora content change within this tag, not outside it.\n\t\t\t\t\t\tparentTags && parentTags[tag.tagName] === tag\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\t// Contents have changed so recreate $linkedElem for the radio input elements (including possible new one just inserted)\n\t\t\t\t\tval = tag.cvtArgs()[0];\n\t\t\t\t\t$linkedElem = tag.linkedElem = tag.contents(true, RADIOINPUT);\n\t\t\t\t\tl = $linkedElem.length;\n\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t// Configure binding and name for each radio input element\n\t\t\t\t\t\tlinkedElem = $linkedElem[l];\n\t\t\t\t\t\tlinkedElem._jsvLkEl = tag;\n\t\t\t\t\t\tlinkedElem.name = linkedElem.name || tag.name;\n\t\t\t\t\t\tlinkedElem._jsvBnd = \"&\" + tag._tgId + \"+\";\n\t\t\t\t\t\tlinkedElem.checked = val === linkedElem.value;\n\t\t\t\t\t\tif (useDisable) {\n\t\t\t\t\t\t\tlinkedElem.disabled = !!tagCtx.props.disabled;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttag.linkedElems = tagCtx.linkedElems = [$linkedElem];\n\t\t\t\t}\n\t\t\t});\n\t\t\ttag._dmChg.tgt = domChngCntnr; // Used to remove listener in onUnbind\n\t\t},\n\t\tonAfterLink: function(tagCtx, linkCtx, ctx, ev, eventArgs) {\n\t\t\tvar propParams = tagCtx.params.props;\n\t\t\tif (propParams && propParams.disabled) {\n\t\t\t\tthis.linkedElem.prop(\"disabled\", !!tagCtx.props.disabled);\n\t\t\t}\n\t\t},\n\t\tonUnbind: function() {\n\t\t\tvar tag = this;\n\t\t\tif (tag._dmChg) {\n\t\t\t\t$(tag._dmChg.tgt).off(\"jsv-domchange\", tag._dmChg); // Remove listener\n\t\t\t\ttag._dmChg = undefined;\n\t\t\t}\n\t\t},\n\t\tonUpdate: false, // don't rerender\n\t\tcontentCtx: true,\n\t\tdataBoundOnly: true\n\t},\n\tcheckboxgroup: {\n\t\tboundProps: [\"disabled\"],\n\t\tinit: function(tagCtx) {\n\t\t\tthis.name = tagCtx.props.name || (Math.random() + \"jsv\").slice(9);\n\t\t},\n\t\tonBind: function(tagCtx, linkCtx) {\n\t\t\tvar domChngCntnr,\n\t\t\t\ttag = this,\n\t\t\t\ttgCtxProps = tagCtx.params.props,\n\t\t\t\tuseDisable = tgCtxProps && tgCtxProps.disabled,\n\t\t\t\tlinkExpr = tagCtx.params.args[0],\n\t\t\t\t$linkedElem = tag.contents(true, CHECKBOXINPUT),\n\t\t\t\tl = $linkedElem.length;\n\t\t\twhile (l--) {\n\t\t\t\t// Configure the name for each checkbox input element\n\t\t\t\t$linkedElem[l].name = $linkedElem[l].name || tag.name;\n\t\t\t\t$linkedElem[l]._jsvLkEl = tag;\n\t\t\t}\n\t\t\tfor (l in tgCtxProps) {\n\t\t\t\tlinkExpr += \" \" + l + \"=\" + tgCtxProps[l];\n\t\t\t}\n\t\t\t$linkedElem.link(linkExpr, linkCtx.data, undefined, undefined, linkCtx.view);\n\t\t\ttag.linkedElem = $linkedElem;\n\t\t\tif (tag.inline) {\n\t\t\t\t// If the first element is owned by (rendered by) this tag (not by a childTag such as {^{for}})\n\t\t\t\t// use it as container for detecting dom changes\n\t\t\t\tdomChngCntnr = tag.contents(\"*\")[0];\n\t\t\t\tdomChngCntnr = domChngCntnr && $.view(domChngCntnr).ctx.tag === tag.parent ? domChngCntnr : tag.parentElem;\n\t\t\t} else {\n\t\t\t\tdomChngCntnr = linkCtx.elem;\n\t\t\t}\n\t\t\t// Establish a domchange listener in case this checkboxgroup wraps a {^{for}} or {^{if}} or similar\n\t\t\t// which might dynamically insert new checkbox input elements\n\t\t\t$(domChngCntnr).on(\"jsv-domchange\", tag._dmChg = function(ev, forOrIfTagCtx, linkCtx, eventArgs) {\n\t\t\t\tvar linkedElem,\n\t\t\t\t\tparentTags = forOrIfTagCtx.ctx.parentTags;\n\t\t\t\tif (!eventArgs.refresh &&\n\t\t\t\t\t(!tag.inline ||\n\t\t\t\t\t\tdomChngCntnr !== tag.parentElem ||\n\t\t\t\t\t\t// If the tag is inline, and the domChngCntnr is the parentElem, then we need to\n\t\t\t\t\t\t// make sure dom change event is fora content change within this tag, not outside it.\n\t\t\t\t\t\tparentTags && parentTags[tag.tagName] === tag\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\t// Contents have changed so recreate $linkedElem for the checkbox input elements (including possible new one just inserted)\n\t\t\t\t\t$linkedElem = tag.contents(true, CHECKBOXINPUT);\n\t\t\t\t\tl = $linkedElem.length;\n\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t// Configure binding and name for each checkbox input element\n\t\t\t\t\t\tlinkedElem = $linkedElem[l];\n\t\t\t\t\t\tif (!linkedElem._jsvSel) {\n\t\t\t\t\t\t\tlinkedElem.name = linkedElem.name || tag.name;\n\t\t\t\t\t\t\t$.link(linkExpr, linkedElem, linkCtx.data);\n\t\t\t\t\t\t\tif (useDisable) {\n\t\t\t\t\t\t\t\tlinkedElem.disabled = !!tagCtx.props.disabled;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\ttag._dmChg.tgt = domChngCntnr; // Used to remove listener in onUnbind\n\t\t},\n\t\tonAfterLink: function(tagCtx, linkCtx, ctx, ev, eventArgs) {\n\t\t\tvar propParams = tagCtx.params.props;\n\t\t\tif (propParams && propParams.disabled) {\n\t\t\t\tthis.contents(true, CHECKBOXINPUT).prop(\"disabled\", !!tagCtx.props.disabled);\n\t\t\t}\n\t\t},\n\t\tonUnbind: function() {\n\t\t\tvar tag = this;\n\t\t\tif (tag._dmChg) {\n\t\t\t\t$(tag._dmChg.tgt).off(\"jsv-domchange\", tag._dmChg); // Remove listener\n\t\t\t\ttag._dmChg = undefined;\n\t\t\t}\n\t\t},\n\t\tonUpdate: false, // don't rerender\n\t\tcontentCtx: true,\n\t\tdataBoundOnly: true\n\t}\n});\n\n$extend($tags[\"for\"], {\n\t//onUpdate: function(ev, eventArgs, newTagCtxs) {\n\t\t//Consider adding filtering for perf optimization. However the below prevents update on some scenarios which _should_ update - namely when there is another array on which for also depends.\n\t\t//var i, l, tci, prevArg;\n\t\t//for (tci = 0; (prevArg = this.tagCtxs[tci]) && prevArg.args.length; tci++) {\n\t\t//\tif (prevArg.args[0] !== newTagCtxs[tci].args[0]) {\n\t\t//\t\treturn true;\n\t\t//\t}\n\t\t//}\n\t\t//return false;\n\t//},\n\tsortDataMap: $views.map({\n\t\tgetTgt: $tags[\"for\"].sortDataMap.getTgt, // getTargetSorted\n\t\tobsSrc: function(map, ev, eventArgs) {\n\t\t\tmap.update(); // refresh sorting and filtering\n\t\t},\n\t\tobsTgt: function(map, ev, eventArgs) {\n\t\t\tvar l,\n\t\t\t\titems = eventArgs.items,\n\t\t\t\tsource = map.src;\n\t\t\tif (eventArgs.change === \"remove\") {\n\t\t\t\tl = items.length;\n\t\t\t\twhile (l--) {\n\t\t\t\t\t$observable(source).remove($inArray(items[l], source));\n\t\t\t\t}\n\t\t\t} else if (eventArgs.change === \"insert\") {\n\t\t\t\t$observable(source).insert(items);\n\t\t\t}\n\t\t}\n\t}),\n\tmapProps: [\"filter\", \"sort\", \"reverse\", \"start\", \"end\", \"step\"],\n\tbindTo: [\"paged\", \"sorted\"],\n\tbindFrom: [0],\n\n\tonArrayChange: function(ev, eventArgs, tagCtx, linkCtx) {\n\t\tvar arrayView, propsArr,\n\t\t\ttargetLength = ev.target.length,\n\t\t\ttag = this;\n\t\tif (!tag.rendering) {\n\t\t\tif (tag._.noVws // Child views not supported because target is not html - e.g. data-link=\"title{for ...}\"\n\t\t\t\t|| tag.tagCtxs[1] && ( // There is an {{else}}\n\t\t\t\t\teventArgs.change === \"insert\" && targetLength === eventArgs.items.length // inserting, and new length is same as inserted length, so going from 0 to n\n\t\t\t\t\t|| eventArgs.change === \"remove\" && !targetLength) // removing, and new length 0, so going from n to 0\n\t\t\t\t) {\n\t\t\t\tpropsArr = tagCtx.map && tagCtx.map.propsArr; // Used by {{props}}, which derives from {{for}}\n\t\t\t\ttag.refresh();\n\t\t\t\tif (propsArr) {\n\t\t\t\t\ttagCtx.map.propsArr = propsArr; // Keep previous propsArr with new map\n\t\t\t\t}\n\t\t\t} else for (arrayView in tag._.arrVws) {\n\t\t\t\tarrayView = tag._.arrVws[arrayView];\n\t\t\t\tif (arrayView.data === ev.target) {\n\t\t\t\t\tarrayChangeHandler.apply(arrayView, arguments);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttag.domChange(tagCtx, linkCtx, eventArgs);\n\t\tev.done = true;\n\t},\n\tonUpdate: function(ev, eventArgs, tagCtxs) {\n\t\tthis.setDataMap(tagCtxs);\n\t},\n\tonBind: function(tagCtx, linkCtx, ctx, ev, eventArgs) {\n\t\tvar data,\n\t\t\ttag = this,\n\t\t\ti = 0,\n\t\t\tarrayBindings = tag._ars = tag._ars || {},\n\t\t\ttagCtxs = tag.tagCtxs,\n\t\t\tl = tagCtxs.length,\n\t\t\tselected = tag.selected || 0;\n\n\t\tfor (; i <= selected; i++) {\n\t\t\ttagCtx = tagCtxs[i]; // loop through tagCtxs up to selected\n\t\t\tdata = tagCtx.map\n\t\t\t\t? tagCtx.map.tgt // 'data' is mapped data\n\t\t\t\t: tagCtx.args.length\n\t\t\t\t\t? tagCtx.args[0] // or args[0]\n\t\t\t\t\t: tagCtx.view.data; // or defaults to current data.\n\t\t\tif (arrayBindings[i]) { // Is there was a previous binding on this tagCtx, (maybe with data different from new data)\n\t\t\t\t$observe(arrayBindings[i], true); //unobserve previous array\n\t\t\t\tdelete arrayBindings[i];\n\t\t\t}\n\t\t\tif (!arrayBindings[i] && $isArray(data)) {\n\t\t\t\t(function() {\n\t\t\t\t\tvar tagCt = tagCtx;\n\t\t\t\t\t$observe(data, arrayBindings[i] = function(ev, eventArgs) { // Store arrayChangeHandler on tag._ars[i]\n\t\t\t\t\t\ttag.onArrayChange(ev, eventArgs, tagCt, linkCtx);\n\t\t\t\t\t});\n\t\t\t\t})();\n\t\t\t}\n\t\t}\n\t\tfor (i = selected + 1; i < l; i++) { // If there were previous bindings on later tagCtxs, remove them\n\t\t\tif (arrayBindings[i]) {\n\t\t\t\t$observe(arrayBindings[i], true); //unobserve previous binding\n\t\t\t\tdelete arrayBindings[i];\n\t\t\t}\n\t\t}\n\t\tif (eventArgs) {\n\t\t\ttag.domChange(tagCtx, linkCtx, eventArgs);\n\t\t}\n\t},\n\tonAfterLink: function(tagCtx) {\n\t\tvar data, map, props,\n\t\t\ttag = this,\n\t\t\ti = 0,\n\t\t\ttagCtxs = tag.tagCtxs,\n\t\t\tl = tagCtxs.length,\n\t\t\tselected = tag.selected || 0;\n\n\t\tfor (; i <= selected; i++) {\n\t\t\ttagCtx = tagCtxs[i]; // loop through tagCtxs up to selected\n\t\t\tmap = tagCtx.map;\n\t\t\tdata = tagCtx.map\n\t\t\t\t? map.tgt // 'data' is mapped data\n\t\t\t\t: tagCtx.args.length\n\t\t\t\t\t? tagCtx.args[0] // or args[0]\n\t\t\t\t\t: tagCtx.view.data; // or defaults to current data.\n\t\t\tif ($isArray(data) && (props = tagCtx.params.props)) {\n\t\t\t\tif (props.paged && !tag.paged) {\n\t\t\t\t\t$.observable(tag).setProperty(\"paged\", data.slice());\n\t\t\t\t\ttag.updateValue(tag.paged, 0, i, true); // Update paged (async, to wait until parent tag has been datalinked)\n\t\t\t\t}\n\t\t\t\tif (props.sorted && !tag.sorted) {\n\t\t\t\t\t$.observable(tag).setProperty(\"sorted\", map && map.sorted || data.slice());\n\t\t\t\t\ttag.updateValue(tag.sorted, 1, i, true); // Update sorted (async, to wait until parent tag has been datalinked)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tonDispose: function() {\n\t\tvar l, tag = this;\n\t\tfor (l in tag._ars) {\n\t\t\t$observe(tag._ars[l], true); //unobserve\n\t\t}\n\t}\n});\n\n$extend($tags[\"if\"], {\n\tonUpdate: function(ev, eventArgs, newTagCtxs) {\n\t\tvar prevArg, different,\n\t\t\ttci = 0;\n\t\tfor (; (prevArg = this.tagCtxs[tci]); tci++) {\n\t\t\tdifferent = prevArg.props.tmpl !== newTagCtxs[tci].props.tmpl || prevArg.args.length && !(prevArg = prevArg.args[0]) !== !newTagCtxs[tci].args[0];\n\t\t\tif ((!this.convert && !!prevArg) || different) {\n\t\t\t\treturn different;\n\t\t\t\t// If there is not a change of template, and there is no converter, and newArg and prevArg are both truthy, return false to cancel update.\n\t\t\t\t// (Even if values on later elses are different, we still don't want to update, since rendered output would be unchanged)\n\t\t\t\t// If newArg and prevArg are different, return true, to update\n\t\t\t\t// If newArg and prevArg are both falsey, move to the next {{else ...}}\n\t\t\t}\n\t\t}\n\t\t// Boolean value of all args are unchanged (falsey), so return false to cancel update\n\t\treturn false;\n\t},\n\tonAfterLink: function(tagCtx, linkCtx, ctx, ev, eventArgs) {\n\t\tif (eventArgs) {\n\t\t\tthis.domChange(tagCtx, linkCtx, eventArgs);\n\t\t}\n\t}\n});\n\nfunction observeProps(map, ev, eventArgs) {\n\tvar target, l, props = map.options.props;\n\tupdatePropsArr(map.propsArr, eventArgs.path, eventArgs.value, eventArgs.remove);\n\tif (props.sort !== undefined || props.start !== undefined || props.end !== undefined || props.step !== undefined || props.filter || props.reverse) {\n\t\tmap.update(); // refresh sorting and filtering\n\t} else if (eventArgs.change === \"set\") {\n\t\ttarget = map.tgt;\n\t\tl = target.length;\n\t\twhile (l-- && target[l].key !== eventArgs.path) {}\n\t\tif (l === -1) {\n\t\t\tif (eventArgs.path && !eventArgs.remove) {\n\t\t\t\t$observable(target).insert({key: eventArgs.path, prop: eventArgs.value});\n\t\t\t}\n\t\t} else if (eventArgs.remove) {\n\t\t\t$observable(target).remove(l);\n\t\t} else {\n\t\t\t$observable(target[l]).setProperty(\"prop\", eventArgs.value);\n\t\t}\n\t}\n}\n\nfunction observeMappedProps(map, ev, eventArgs) {\n\tvar items, l, key, remove,\n\t\tsource = map.src,\n\t\tchange = eventArgs.change;\n\n\tif (change === \"set\") {\n\t\tif (eventArgs.path === \"prop\") {\n\t\t\t$observable(source).setProperty(ev.target.key, eventArgs.value);\n\t\t} else { // path === \"key\"\n\t\t\t$observable(source).removeProperty(eventArgs.oldValue); // When key is modified observably, remove old one and set new one\n\t\t\t$observable(source).setProperty(eventArgs.value, ev.target.prop);\n\t\t}\n\t} else if (change === \"insert\" || (remove = change === \"remove\")) {\n\t\titems = eventArgs.items;\n\t\tl = items.length;\n\t\twhile (l--) {\n\t\t\tif (key = items[l].key) {\n\t\t\t\tupdatePropsArr(map.propsArr, key, items[l].prop, remove);\n\t\t\t\tif (remove) {\n\t\t\t\t\t$observable(source).removeProperty(key);\n\t\t\t\t\tdelete source[key];\n\t\t\t\t} else {\n\t\t\t\t\t$observable(source).setProperty(key, items[l].prop);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction updatePropsArr(propsArr, key, prop, remove) {\n\tvar l = propsArr.length;\n\twhile (l-- && propsArr[l].key !== key) {}\n\tif (l === -1) {\n\t\tif (key && !remove) {\n\t\t\tpropsArr.push({key: key, prop: prop});\n\t\t}\n\t} else if (remove) {\n\t\tpropsArr.splice(l, 1);\n\t}\n}\n\nfunction shallowArrayFilter(path /*, object, parentObs*/) { // Filter used by {{props}} for the mappedProps target array\n\treturn rShallowArrayPath.test(path); // No '.' in path\n}\n\n$tags(\"props\", {\n\tbaseTag: \"for\",\n\tdataMap: $views.map({\n\t\tgetTgt: $tags.props.dataMap.getTgt, // getTargetProps\n\t\tobsSrc: observeProps,\n\t\tobsTgt: observeMappedProps,\n\t\ttgtFlt: shallowArrayFilter\n\t}),\n\tflow: true\n});\n\n//========================\n// Extend jQuery namespace\n//========================\n\n$extend($, {\n\n\t//=======================\n\t// jQuery $.view() plugin\n\t//=======================\n\n\tview: $view = function(node, inner, type) {\n\t\t// $.view() returns top view\n\t\t// $.view(node) returns view that contains node\n\t\t// $.view(selector) returns view that contains first selected element\n\t\t// $.view(nodeOrSelector, type) returns nearest containing view of given type\n\t\t// $.view(nodeOrSelector, \"root\") returns root containing view (child of top view)\n\t\t// $.view(nodeOrSelector, true, type) returns nearest inner (contained) view of given type\n\n\t\tfunction getInnerView(nd, isVl) {\n\t\t\tif (nd) {\n\t\t\t\tvwInfos = viewInfos(nd, isVl, rOpenViewMarkers);\n\t\t\t\tfor (j = 0, k = vwInfos.length; j < k; j++) {\n\t\t\t\t\tif ((view = viewStore[vwInfos[j].id]) && (view = view && type ? view.get(true, type) : view)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (inner !== !!inner) {\n\t\t\t// inner not boolean, so this is view(nodeOrSelector, type)\n\t\t\ttype = inner;\n\t\t\tinner = undefined;\n\t\t}\n\t\tvar view, vwInfos, i, j, k, l, elems,\n\t\t\tlevel = 0,\n\t\t\tbody = document.body;\n\n\t\tif (node && node !== body && topView._.useKey > 1) {\n\t\t\t// Perf optimization for common cases\n\n\t\t\tnode = typeof node === STRING\n\t\t\t\t? $(node)[0]\n\t\t\t\t: node.jquery\n\t\t\t\t\t? node[0]\n\t\t\t\t\t: node;\n\n\t\t\tif (node) {\n\t\t\t\tif (inner) {\n\t\t\t\t\tgetInnerView(node._df, true);\n\t\t\t\t\tif (!view && node.tagName) { // Not a text node\n\t\t\t\t\t\t// Treat supplied node as a container element and return the first view encountered.\n\t\t\t\t\t\telems = qsa ? node.querySelectorAll(bindElsSel) : $(bindElsSel, node).get();\n\t\t\t\t\t\tl = elems.length;\n\t\t\t\t\t\tfor (i = 0; !view && i < l; i++) {\n\t\t\t\t\t\t\tgetInnerView(elems[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn view;\n\t\t\t\t}\n\t\t\t\twhile (node) {\n\t\t\t\t\t// Move back through siblings and up through parents to find preceding node which is a _prv (prevNode)\n\t\t\t\t\t// script marker node for a non-element-content view, or a _prv (first node) for an elCnt view\n\t\t\t\t\tif (vwInfos = viewInfos(node, undefined, rViewMarkers)) {\n\t\t\t\t\t\tl = vwInfos.length;\n\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\tview = vwInfos[l];\n\t\t\t\t\t\t\tif (view.open) {\n\t\t\t\t\t\t\t\tif (level < 1) {\n\t\t\t\t\t\t\t\t\tview = viewStore[view.id];\n\t\t\t\t\t\t\t\t\treturn view && type ? view.get(type) : view || topView;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlevel--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// level starts at zero. If we hit a view.close, then we move level to 1, and we don't return a view until\n\t\t\t\t\t\t\t\t// we are back at level zero (or a parent view with level < 0)\n\t\t\t\t\t\t\t\tlevel++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnode = node.previousSibling || node.parentNode;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn topView;\n\t},\n\n\tlink: $link,\n\tunlink: $unlink,\n\n\t//=====================\n\t// override $.cleanData\n\t//=====================\n\tcleanData: function(elems) {\n\t\tif (elems.length && isCleanCall) {\n\t\t\t// Remove JsViews bindings. Also, remove from the DOM any corresponding script marker nodes\n\t\t\tclean(elems);\n\t\t}\n\t\toldCleanData.apply($, arguments);\n\t}\n});\n\n// Possible future addition - e.g. for ckeditor tag control\n//$views.utility = {\n//\tvalidate: function(html) {\n//\t\ttry {\n//\t\t\ttopView.link(undefined, document.createElement(\"div\"), undefined, undefined, html, undefined, undefined, 1);\n//\t\t}\n//\t\tcatch (e) {\n//\t\t\treturn e.message;\n//\t\t}\n//\t}\n//};\n\n//===============================\n// Extend jQuery instance plugins\n//===============================\n\n$extend($.fn, {\n\tlink: function(expr, from, context, noIteration, parentView, prevNode, nextNode) {\n\t\treturn $link(expr, this, from, context, noIteration, parentView, prevNode, nextNode);\n\t},\n\tunlink: function() {\n\t\treturn $unlink(this);\n\t},\n\tview: function(inner, type) {\n\t\treturn $view(this[0], inner, type);\n\t}\n});\n\n//==============================================================================\n// Override jQuery methods that call our overridden cleanData, for disposal etc.\n//==============================================================================\n\n$.each([HTML, \"replaceWith\", \"empty\", \"remove\"], function(i, name) {\n\tvar oldFn = $.fn[name];\n\t$.fn[name] = function() {\n\t\tvar result;\n\t\tisCleanCall++; // Make sure cleanData does disposal only when coming from these calls.\n\t\ttry {\n\t\t\tresult = oldFn.apply(this, arguments);\n\t\t}\n\t\tfinally {\n\t\t\tisCleanCall--;\n\t\t}\n\t\treturn result;\n\t};\n});\n\n//===============\n// Extend topView\n//===============\n\n$extend(topView = $sub.topView, {tmpl: {links: {}}});\n\nviewStore = {0: topView}; // Top-level view\n\n//===================\n// Extend $.views.sub\n//===================\n\n$sub._glt = function(elem) { // get linked tags (Used in validate.js)\n\tvar linkCtx,\n\t\tregEx = /#(\\d*)\\^\\/\\1\\^/g,\n\t\tlinkCtxs = [],\n\t\ttokens = markerNodeInfo(elem);\n\n\twhile (linkCtx = regEx.exec(tokens)) {\n\t\tif (linkCtx = bindingStore[linkCtx[1]]) {\n\t\t\tlinkCtxs.push(linkCtx.linkCtx.tag);\n\t\t}\n\t}\n\treturn linkCtxs;\n};\n\n$sub._gccb = function(view) { // Return a callback for accessing the context of a template/data-link expression - and converting ~foo, #foo etc.\n\t// TODO Consider exposing or allowing override, as public API\n\treturn function(path, depth) {\n\t\t// TODO consider only calling the contextCb on the initial token in path '~a.b.c' and not calling again on\n\t\t// the individual tokens, 'a', 'b', 'c'... Currently it is called multiple times\n\t\tvar tokens, tag, items, helper, last, nextPath, l, obsCtxPrm, addedTagCpDep, key, bindTo;\n\t\tif (view && path) {\n\t\t\tif (path._cpfn) {\n\t\t\t\ttry {\n\t\t\t\t\treturn $subSettingsAdvanced.cache ? view.getCache(path._cpKey) : path._cpfn.call(view.tmpl, view.data, view, $sub); // exprOb for computed property\n\t\t\t\t} catch(e) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (path.charAt(0) === \"~\") {\n\t\t\t\t// We return new items to insert into the sequence, replacing the \"~a.b.c\" string:\n\t\t\t\t// [helperObject 'a', \"a.b.c\" currentDataItem] so currentDataItem becomes the object for subsequent paths.\n\t\t\t\tif (path.slice(0, 4) === \"~tag\") {\n\t\t\t\t\ttag = view.ctx;\n\t\t\t\t\tif (path.charAt(4) === \".\") {\n\t\t\t\t\t\t// \"~tag.xxx\"\n\t\t\t\t\t\ttokens = path.slice(5);\n\t\t\t\t\t\ttag = tag.tag;\n\t\t\t\t\t} else if (path.slice(0, 8) === \"~tagCtx.\") {\n\t\t\t\t\t\t// \"~tagCtx.xxx\"\n\t\t\t\t\t\ttokens = path.slice(8);\n\t\t\t\t\t\ttag = tag.tagCtx;\n\t\t\t\t\t}\n\t\t\t\t\tif (tokens) {\n\t\t\t\t\t\treturn tag ? [tag, tokens] : [];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpath = path.slice(1).split(\".\");\n\t\t\t\tif (helper = view.ctxPrm(last = path.shift(), undefined, true)) {\n\t\t\t\t\tif (obsCtxPrm = helper._cxp) { // helper for (contextual parameter ~foo=...) is an array - [view, ctxPrmDependencies ...]\n\t\t\t\t\t\tif (path.length) {\n\t\t\t\t\t\t\tnextPath = \".\" + path.join(\".\");\n\t\t\t\t\t\t\tlast = helper[l = helper.length-1];\n\t\t\t\t\t\t\tif (last._cpfn) {\n\t\t\t\t\t\t\t\tlast.sb = nextPath;\n\t\t\t\t\t\t\t\tlast.bnd = !!depth;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thelper[l] = (last + nextPath).replace(\"#data.\", \"\");\n\t\t\t\t\t\t\t\tif (last.slice(0, 5) === \"#view\") {\n\t\t\t\t\t\t\t\t\thelper[l] = helper[l].slice(6);\n\t\t\t\t\t\t\t\t\thelper.splice(l, 0, view);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\titems = [helper]; // Contextual parameter\n\t\t\t\t\t\tif ((tag = obsCtxPrm.tag) && tag.convert) {\n\t\t\t\t\t\t\t// If there is a converter, it might mix inputs, so tag contextual param needs to depend on all bound args/props.\n\t\t\t\t\t\t\tbindTo = tag.bindTo || [0];\n\t\t\t\t\t\t\tl = bindTo.length;\n\t\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\t\tif (depth !== undefined && l !== obsCtxPrm.ind) {\n\t\t\t\t\t\t\t\t\tkey = bindTo[l];\n\t\t\t\t\t\t\t\t\taddedTagCpDep = [helper[0], tag.tagCtx.params[+key === key ? \"args\" : \"props\"]];\n\t\t\t\t\t\t\t\t\taddedTagCpDep._cxp = obsCtxPrm;\n\t\t\t\t\t\t\t\t\titems.push(addedTagCpDep); // Added dependency for tag contextual parameter\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (path.length || $isFunction(helper)) {\n\t\t\t\t\t\titems = [helper, path.join(\".\")]; // 2way bindng on ~foo.helperLeafProperty or ~computed() or ~contextualParam\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn items || [];\n\t\t\t}\n\t\t\tif (path.charAt(0) === \"#\") {\n\t\t\t\t// We return new items to insert into the sequence, replacing the \"#a.b.c\" string: [view, \"a.b.c\" currentDataItem]\n\t\t\t\t// so currentDataItem becomes the object for subsequent paths. The 'true' flag makes the paths bind only to leaf changes.\n\t\t\t\treturn path === \"#data\" ? [] : [view, path.replace(rViewPath, \"\")];\n\t\t\t}\n\t\t}\n\t};\n};\n\n//===================\n// ctxPrm helpers\n//===================\n// The following helper functions for observable contextual parameters are needed by render.js in data-linking scenarios\n// Implemented here rather than in render.js to keep render.js size down, and exposed via $.sub...\n\n$sub._cp = function(paramVal, paramExpr, view, tagCtxPrm) { // Create tag or inline contextual parameter\n\t// Called for inline contextual parameter ~foo=expression, from compiled function for expression. (tagCtxPrm is undefined)\n\t// Called for tag parameter (two-way binding), from renderTag. (tagCtxPrm is {tag: ..., ind: ...})\n\tif (view.linked) { // In JsViews, returns [view, linkFn] where linkFn is compiled function for expression, or observable contextual parameter object\n\t\tif (tagCtxPrm && (tagCtxPrm.cvt || tagCtxPrm.tag._.toIndex[tagCtxPrm.ind] === undefined)) {\n\t\t\tparamVal = [{_ocp: paramVal}]; // With convert, or with bindTo/bindFrom different, the tag contextual parameter object will be 'local' to the tag.\n\t\t\t\t// It will be updated by bindFrom binding, and by tag.setValue(...), but not by tag.updateValue() (which will update bindTo value externally)\n\t\t\ttagCtxPrm.updateValue = function(val) {\n\t\t\t\t$.observable(paramVal._cxp.data).setProperty(_ocp, val); // Set the value (res[0]._ocp)\n\t\t\t\treturn this;\n\t\t\t};\n\t\t} else if (paramExpr) { // With no convert/convertBack and no bindTo/bindFrom difference, tag contextual parameter 2way binds to bindTo/bindFrom value.\n\t\t\t\t// So tag.updateValue() updates external value, which updates contextual parameter through 2way binding\n\t\t\tvar params = delimOpenChar1 + \":\" + paramExpr + delimCloseChar0,\n\t\t\t\tlinkFn = linkExprStore[params];\n\t\t\tif (!linkFn) {\n\t\t\t\tlinkExprStore[params] = linkFn = $sub.tmplFn(params.replace(rEscapeQuotes, \"\\\\$&\"), view.tmpl, true);\n\t\t\t}\n\t\t\tparamVal = linkFn.deps[0]\n\t\t\t\t? [view, linkFn] // compiled expression\n\t\t\t\t: [{_ocp: tagCtxPrm ? paramVal : linkFn()}]; // Static value - no deps - returns observable contextual parameter object\n\t\t} else {\n\t\t\tparamVal = [{_ocp: paramVal}]; // Uninitialized observable contextual parameter object\n\t\t}\n\t\tparamVal._cxp = tagCtxPrm || {\n\t\t\tupdateValue: function(val) {\n\t\t\t\t$observable(paramVal._cxp.data).setProperty(paramVal._cxp.path, val);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t};\n\t}\n\treturn paramVal; // In JsRender returns evaluated expression\n};\n\n$sub._ucp = function(key, value, view, obsCtxPrm) {\n\tvar tag = obsCtxPrm.tag,\n\t\tindex = tag ? $inArray(key, tag.linkedCtxParam) : 0;\n\tif (!obsCtxPrm.path) {\n\t\tresolveDataTargetPath(\"~\" + key, view.data, $sub._gccb(view));\n\t}\n\treturn (obsCtxPrm.updateValue || tag.updateValue)(value, index, obsCtxPrm.tagElse, undefined, tag);\n};\n\n$sub._ceo = function cloneExprObjects(obs) { // Clone exprObs so that each referenced contextual parameter ~foo uses its own exprOb instances\n\tvar ob,\n\t\tclones = [],\n\t\tl = obs.length;\n\twhile (l--) {\n\t\tob = obs[l];\n\t\tif (ob._cpfn) {\n\t\t\tob = $extend({}, ob); // If an exprOb, clone it. If a string, keep as is\n\t\t\tob.prm = cloneExprObjects(ob.prm); // Recursively clone exprObs in parameters, too\n\t\t}\n\t\tclones.unshift(ob);\n\t}\n\treturn clones;\n};\n\n//=========================\n// Extend $.views.settings\n//=========================\n\noldAdvSet = $sub.advSet;\n\n$sub.advSet = function() { // refresh advanced settings\n\toldAdvSet.call($sub);\n\tglobal._jsv = $subSettingsAdvanced._jsv\n\t\t? $extend(global._jsv || {}, { // create global _jsv, for accessing views, etc\n\t\t\t\tviews: viewStore,\n\t\t\t\tbindings: bindingStore\n\t\t\t})\n\t\t: undefined; // In IE8 cannot do delete global._jsv\n\t$viewsLinkAttr = $subSettingsAdvanced.linkAttr;\n\tlinkViewsSel = bindElsSel + \",[\" + $viewsLinkAttr + \"]\";\n\twrapMap = $subSettingsAdvanced._wm;\n\twrapMap.optgroup = wrapMap.option;\n\twrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\n\twrapMap.th = wrapMap.td;\n};\n\n$viewsSettings.advanced({\n\tlinkAttr: \"data-link\",\n\tuseViews: false,\n\tnoValidate: false,\n\t// wrapMap provide appropriate wrappers for inserting innerHTML, used in insertBefore\n\t// We have to close these tags to support XHTML (#13200)\n\t// TODO investigate whether more recent jQuery implementation using wrapMap in domManip/$().html() etc. is better optimized now...\n\t_wm: {\n\t\toption: [1, \"\", \" \"],\n\t\tlegend: [1, \"\", \" \"],\n\t\tarea: [1, \"\", \" \"],\n\t\tparam: [1, \"\", \" \"],\n\t\tthead: [1, \"\"],\n\t\ttr: [2, \"\"],\n\t\ttd: [3, \"\"],\n\t\tcol: [2, \"\"],\n\t\tsvg_ns: [1, \"\", \" \"],\n\t\t// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,\n\t\t// unless wrapped in a div with non-breaking characters in front of it.\n\t\tdiv: $.support.htmlSerialize ? [0, \"\", \"\"] : [1, \"X\", \"
\"]\n\t},\n\t_fe: {\n\t\tinput: {\n\t\t\tfrom: inputAttrib, to: VALUE\n\t\t},\n\t\ttextarea: valueBinding,\n\t\tselect: valueBinding,\n\t\toptgroup: {\n\t\t\tto: \"label\"\n\t\t}\n\t}\n});\n\nreturn $;\n}, window));"]}
\ No newline at end of file
diff --git a/package.json b/package.json
index 1fa66c7..75b6959 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "jsviews",
- "version": "v1.0.12",
+ "version": "v1.0.13",
"description": "Next-generation MVVM and MVP framework - built on top of JsRender templates. Bringing templates to life...",
"main": "./jsviews.js",
"author": {
@@ -35,7 +35,7 @@
"browserify": "^11.0.1",
"glob-stream": "^5.0.0",
"gulp": "^3.9.0",
- "jsrender": "^1.0.12",
+ "jsrender": "^1.0.13",
"qunit": "^0.7.6"
},
"dependencies": {
diff --git a/test/browserify/bundles/1-bundle.js b/test/browserify/bundles/1-bundle.js
index 88a2b2d..97eb9e2 100644
--- a/test/browserify/bundles/1-bundle.js
+++ b/test/browserify/bundles/1-bundle.js
@@ -1,12 +1,12 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/* JsRender:
* See http://jsviews.com/#jsrender and http://github.com/BorisMoore/jsrender
- * Copyright 2021, Boris Moore
+ * Copyright 2023, Boris Moore
* Released under the MIT License.
*/
@@ -4080,7 +4080,7 @@ if (!$ || !$.fn) {
throw "JsViews requires jQuery"; // We require jQuery
}
-var versionNumber = "v1.0.12",
+var versionNumber = "v1.0.13",
jsvStoreName, rTag, rTmplString, topView, $views, $observe, $observable, $expando,
_ocp = "_ocp", // Observable contextual parameter
@@ -5155,7 +5155,7 @@ function compileTmpl(name, tmpl, parentTmpl, options) {
}
} else if (value.charAt(0) === "#") {
elem = document.getElementById(value.slice(1));
- } else if ($.fn && !$sub.rTmpl.test(value)) {
+ } if (!elem && $.fn && !$sub.rTmpl.test(value)) {
try {
elem = $(value, document)[0]; // if jQuery is loaded, test for selector returning elements, and get first element
} catch (e) {}
@@ -7058,7 +7058,7 @@ if (jsrToJq) { // Moving from jsrender namespace to jQuery namepace - copy over
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< JsObservable >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/* JsObservable:
* See https://www.jsviews.com/#jsobservable and http://github.com/borismoore/jsviews
- * Copyright 2021, Boris Moore
+ * Copyright 2023, Boris Moore
* Released under the MIT License.
*/
@@ -8347,7 +8347,7 @@ if (!$.observe) {
/* JsViews:
* Interactive data-driven views using templates and data-linking.
* See https://www.jsviews.com/#jsviews and http://github.com/BorisMoore/jsviews
- * Copyright 2021, Boris Moore
+ * Copyright 2023, Boris Moore
* Released under the MIT License.
*/
@@ -22890,14 +22890,14 @@ return jQuery;
} );
},{}],4:[function(require,module,exports){
-/*! JsRender v1.0.12: http://jsviews.com/#jsrender */
+/*! JsRender v1.0.13: http://jsviews.com/#jsrender */
/*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */
/*
* Best-of-breed templating in browser or on Node.js.
* Does not require jQuery, or HTML DOM
* Integrates with JsViews (http://jsviews.com/#jsviews)
*
- * Copyright 2021, Boris Moore
+ * Copyright 2023, Boris Moore
* Released under the MIT License.
*/
@@ -22936,7 +22936,7 @@ var setGlobals = $ === false; // Only set globals if script block in browser (no
$ = $ && $.fn ? $ : global.jQuery; // $ is jQuery passed in by CommonJS loader (Browserify), or global jQuery.
-var versionNumber = "v1.0.12",
+var versionNumber = "v1.0.13",
jsvStoreName, rTag, rTmplString, topView, $views, $expando,
_ocp = "_ocp", // Observable contextual parameter
@@ -24010,7 +24010,7 @@ function compileTmpl(name, tmpl, parentTmpl, options) {
}
} else if (value.charAt(0) === "#") {
elem = document.getElementById(value.slice(1));
- } else if ($.fn && !$sub.rTmpl.test(value)) {
+ } if (!elem && $.fn && !$sub.rTmpl.test(value)) {
try {
elem = $(value, document)[0]; // if jQuery is loaded, test for selector returning elements, and get first element
} catch (e) {}
@@ -25997,4 +25997,4 @@ QUnit.test('More Errors for require() for JsRender, JsViews, JsObservable, JsRen
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../../":2,"../../jquery.views":1,"jQuery":3,"jsrender":4}]},{},[5])
-//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJqcXVlcnkudmlld3MuanMiLCJqc3ZpZXdzLmpzIiwibm9kZV9tb2R1bGVzL2pRdWVyeS9kaXN0L2pxdWVyeS5qcyIsIm5vZGVfbW9kdWxlcy9qc3JlbmRlci9qc3JlbmRlci5qcyIsInRlc3QvYnJvd3NlcmlmeS8xMS1lcnJvcnMtdW5pdC10ZXN0cy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ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bXFx3JF0rKSk/KShbXFx3JC5eXSo/KSg/OlsuW15dKFtcXHckXSspXFxdPyk/KSQvZyxcblx0XHRcdC8vICAgICAgICBub3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2JqZWN0ICAgICBoZWxwZXIgICAgdmlldyAgdmlld1Byb3BlcnR5IHBhdGhUb2tlbnMgICAgICBsZWFmVG9rZW5cblxuXHRcdFx0clBybTogLyhcXCgpKD89XFxzKlxcKCl8KD86KFsoW10pXFxzKik/KD86KFxcXj8pKH4/W1xcdyQuXl0rKT9cXHMqKChcXCtcXCt8LS0pfFxcK3wtfH4oPyFbXFx3JF0pfCYmfFxcfFxcfHw9PT18IT09fD09fCE9fDw9fD49fFs8PiUqOj9cXC9dfCg9KSlcXHMqfCghKj8oQCk/WyN+XT9bXFx3JC5eXSspKFsoW10pPyl8KCxcXHMqKXwoPzooXFwoKVxccyopP1xcXFw/KD86KCcpfChcIikpfCg/OlxccyooKFspXFxdXSkoPz1bLl5dfFxccyokfFteKFtdKXxbKVxcXV0pKFsoW10/KSl8KFxccyspL2csXG5cdFx0XHQvLyAgIGxmdFBybjAgICAgICAgICAgIGxmdFBybiAgICAgICAgIGJvdW5kICAgICBwYXRoICAgICAgICAgICAgICAgb3BlcmF0b3IgICAgIGVyciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVxICAgICAgcGF0aDIgbGF0ZSAgICAgICAgICAgIHBybiAgICAgIGNvbW1hICBsZnRQcm4yICAgICAgICAgIGFwb3MgcXVvdCAgICAgICAgcnRQcm4gIHJ0UHJuRG90ICAgICAgICAgICAgICAgICAgcHJuMiAgICAgc3BhY2VcblxuXHRcdFx0VmlldzogVmlldyxcblx0XHRcdEVycjogSnNWaWV3c0Vycm9yLFxuXHRcdFx0dG1wbEZuOiB0bXBsRm4sXG5cdFx0XHRwYXJzZTogcGFyc2VQYXJhbXMsXG5cdFx0XHRleHRlbmQ6ICRleHRlbmQsXG5cdFx0XHRleHRlbm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hbWUsIGNvbnZlcnRlciwgY29sb24sIGh0bWwsIGNvZGVUYWcsIHBhcmFtcywgc2xhc2gsIGJpbmQyLCBjbG9zZUJsb2NrLCBpbmRleCkge1xuLypcblxuICAgICBiaW5kICAgICB0YWdOYW1lICAgICAgICAgY3Z0ICAgY2xuIGh0bWwgY29kZSAgICBwYXJhbXMgICAgICAgICAgICBzbGFzaCAgIGJpbmQyICAgICAgICAgY2xvc2VCbGsgIGNvbW1lbnRcbi8oPzp7KFxcXik/eyg/OihcXHcrKD89W1xcL1xcc31dKSl8KFxcdyspPyg6KXwoPil8KFxcKikpXFxzKigoPzpbXn1dfH0oPyF9KSkqPykoXFwvKT98eyhcXF4pP3soPzooPzpcXC8oXFx3KykpXFxzKnwhLS1bXFxzXFxTXSo/LS0pKX19L2dcblxuKD86XG4gIHsoXFxeKT97ICAgICAgICAgICAgYmluZFxuICAoPzpcbiAgICAoXFx3KyAgICAgICAgICAgICB0YWdOYW1lXG4gICAgICAoPz1bXFwvXFxzfV0pXG4gICAgKVxuICAgIHxcbiAgICAoXFx3Kyk/KDopICAgICAgICBjb252ZXJ0ZXIgY29sb25cbiAgICB8XG4gICAgKD4pICAgICAgICAgICAgICBodG1sXG4gICAgfFxuICAgIChcXCopICAgICAgICAgICAgIGNvZGVUYWdcbiAgKVxuICBcXHMqXG4gICggICAgICAgICAgICAgICAgICBwYXJhbXNcbiAgICAoPzpbXn1dfH0oPyF9KSkqP1xuICApXG4gIChcXC8pPyAgICAgICAgICAgICAgc2xhc2hcbiAgfFxuICB7KFxcXik/eyAgICAgICAgICAgIGJpbmQyXG4gICg/OlxuICAgICg/OlxcLyhcXHcrKSlcXHMqICAgY2xvc2VCbG9ja1xuICAgIHxcbiAgICAhLS1bXFxzXFxTXSo/LS0gICAgY29tbWVudFxuICApXG4pXG59fS9nXG5cbiovXG5cdFx0aWYgKGNvZGVUYWcgJiYgYmluZCB8fCBzbGFzaCAmJiAhdGFnTmFtZSB8fCBwYXJhbXMgJiYgcG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8dHJ1ZXxmYWxzZXxcXGRbXFxkLl0qfChbXFx3JF0rfFxcLnx+KFtcXHckXSspfCModmlld3woW1xcdyRdKykpPykoW1xcdyQuXl0qPykoPzpbLlteXShbXFx3JF0rKVxcXT8pPykkL2csXG5cdFx0XHQvLyAgICAgICAgbm90ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iamVjdCAgICAgaGVscGVyICAgIHZpZXcgIHZpZXdQcm9wZXJ0eSBwYXRoVG9rZW5zICAgICAgbGVhZlRva2VuXG5cblx0XHRcdHJQcm06IC8oXFwoKSg/PVxccypcXCgpfCg/OihbKFtdKVxccyopPyg/OihcXF4/KSh+P1tcXHckLl5dKyk/XFxzKigoXFwrXFwrfC0tKXxcXCt8LXx+KD8hW1xcdyRdKXwmJnxcXHxcXHx8PT09fCE9PXw9PXwhPXw8PXw+PXxbPD4lKjo/XFwvXXwoPSkpXFxzKnwoISo/KEApP1sjfl0/W1xcdyQuXl0rKShbKFtdKT8pfCgsXFxzKil8KD86KFxcKClcXHMqKT9cXFxcPyg/OignKXwoXCIpKXwoPzpcXHMqKChbKVxcXV0pKD89Wy5eXXxcXHMqJHxbXihbXSl8WylcXF1dKShbKFtdPykpfChcXHMrKS9nLFxuXHRcdFx0Ly8gICBsZnRQcm4wICAgICAgICAgICBsZnRQcm4gICAgICAgICBib3VuZCAgICAgcGF0aCAgICAgICAgICAgICAgIG9wZXJhdG9yICAgICBlcnIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcSAgICAgIHBhdGgyIGxhdGUgICAgICAgICAgICBwcm4gICAgICBjb21tYSAgbGZ0UHJuMiAgICAgICAgICBhcG9zIHF1b3QgICAgICAgIHJ0UHJuICBydFBybkRvdCAgICAgICAgICAgICAgICAgIHBybjIgICAgIHNwYWNlXG5cblx0XHRcdFZpZXc6IFZpZXcsXG5cdFx0XHRFcnI6IEpzVmlld3NFcnJvcixcblx0XHRcdHRtcGxGbjogdG1wbEZuLFxuXHRcd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aGVkIG9yIG1pc3Npbmcge3svJyArIHRhZ05hbWUpICsgJywgaW4gdGVtcGxhdGU6XFxuJyArIG1hcmt1cCk7XG5cdFx0fVxuXHR9XG5cblx0ZnVuY3Rpb24gcGFyc2VUYWcoYWxsLCBiaW5kLCB0YWdOYW1lLCBjb252ZXJ0ZXIsIGNvbG9uLCBodG1sLCBjb2RlVGFnLCBwYXJhbXMsIHNsYXNoLCBiaW5kMiwgY2xvc2VCbG9jaywgaW5kZXgpIHtcbi8qXG5cbiAgICAgYmluZCAgICAgdGFnTmFtZSAgICAgICAgIGN2dCAgIGNsbiBodG1sIGNvZGUgICAgcGFyYW1zICAgICAgICAgICAgc2xhc2ggICBiaW5kMiAgICAgICAgIGNsb3NlQmxrICBjb21tZW50XG4vKD86eyhcXF4pP3soPzooXFx3Kyg/PVtcXC9cXHN9XSkpfChcXHcrKT8oOil8KD4pfChcXCopKVxccyooKD86W159XXx9KD8hfSkpKj8pKFxcLyk/fHsoXFxeKT97KD86KD86XFwvKFxcdyspKVxccyp8IS0tW1xcc1xcU10qPy0tKSl9fS9nXG5cbig/OlxuICB7KFxcXik/eyAgICAgICAgICAgIGJpbmRcbiAgKD86XG4gICAgKFxcdysgICAgICAgICAgICAgdGFnTmFtZVxuICAgICAgKD89W1xcL1xcc31dKVxuICAgIClcbiAgICB8XG4gICAgKFxcdyspPyg6KSAgICAgICAgY29udmVydGVyIGNvbG9uXG4gICAgfFxuICAgICg+KSAgICAgICAgICAgICAgaHRtbFxuICAgIHxcbiAgICAoXFwqKSAgICAgICAgICAgICBjb2RlVGFnXG4gIClcbiAgXFxzKlxuICAoICAgICAgICAgICAgICAgICAgcGFyYW1zXG4gICAgKD86W159XXx9KD8hfSkpKj9cbiAgKVxuICAoXFwvKT8gICAgICAgICAgICAgIHNsYXNoXG4gIHxcbiAgeyhcXF4pP3sgICAgICAgICAgICBiaW5kMlxuICAoPzpcbiAgICAoPzpcXC8oXFx3KykpXFxzKiAgIGNsb3NlQmxvY2tcb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ic2NyaXB0aW9uLCBlLmcuIEpzVmlld3MgaW50ZWdyYXRpb25cblx0XHRcdHJQYXRoOiAvXighKj8pKD86bnVsbHx0cnVlfGZhbHNlfFxcZFtcXGQuXSp8KFtcXHckXSt8XFwufH4oW1xcdyRdKyl8Iyh2aWV3fChbXFx3JF0rKSk/KShbXFx3JC5eXSo/KSg/OlsuW15dKFtcXHckXSspXFxdPyk/KSQvZyxcblx0XHRcdC8vICAgICAgICBub3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2JqZWN0ICAgICBoZWxwZXIgICAgdmlldyAgdmlld1Byb3BlcnR5IHBhdGhUb2tlbnMgICAgICBsZWFmVG9rZW5cblxuXHRcdFx0clBybTogLyhcXCgpKD89XFxzKlxcKCl8KD86KFsoW10pXFxzKik/KD86KFxcXj8pKH4/W1xcdyQuXl0rKT9cXHMqKChcXCtcXCt8LS0pfFxcK3wtfH4oPyFbXFx3JF0pfCYmfFxcfFxcfHw9PT18IT09fD09fCE9fDw9fD49fFs8PiUqOj9cXC9dfCg9KSlcXHMqfCghKj8oQCk/WyN+XT9bXFx3JC5eXSspKFsoW10pPyl8KCxcXHMqKXwoPzooXFwoKVxccyopP1xcXFw/KD86KCcpfChcIikpfCg/OlxccyooKFspXFxdXSkoPz1bLl5dfFxccyokfFteKFtdKXxbKVxcXV0pKFsoW10/KSl8KFxccyspL2csXG5cdFx0XHQvLyAgIGxmdFBybjAgICAgICAgICAgIGxmdFBybiAgICAgICAgIGJvdW5kICAgICBwYXRoICAgICAgICAgICAgICAgb3BlcmF0b3IgICAgIGVyciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVxICAgICAgcGF0aDIgbGF0ZSAgICAgICAgICAgIHBybiAgICAgIGNvbW1hICBsZnRQcm4yICAgICAgICAgIGFwb3MgcXVvdCAgICAgICAgcnRQcm4gIHJ0UHJuRG90ICAgICAgICAgICAgICAgICAgcHJuMiAgICAgc3BhY2VcblxuXHRcdFx0Vmlldzog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yB0YWdOYW1lXG5cdFx0XHRcdFx0OiAnVW5tYXRjaGVkIG9yIG1pc3Npbmcge3svJyArIHRhZ05hbWUpICsgJywgaW4gdGVtcGxhdGU6XFxuJyArIG1hcmt1cCk7XG5cdFx0fVxuXHR9XG5cblx0ZnVuY3Rpb24gcGFyc2VUYWcoYWxsLCBiaW5kLCB0YWdOYW1lLCBjb252ZXJ0ZXIsIGNvbG9uLCBodG1sLCBjb2RlVGFnLCBwYXJhbXMsIHNsYXNoLCBiaW5kMiwgY2xvc2VCbG9jaywgaW5kZXgpIHtcbi8qXG5cbiAgICAgYmluZCAgICAgdGFnTmFtZSAgICAgICAgIGN2dCAgIGNsbiBodG1sIGNvZGUgICAgcGFyYW1zICAgICAgICAgICAgc2xhc2ggICBiaW5kMiAgICAgICAgIGNsb3NlQmxrICBjb21tZW50XG4vKD86eyhcXF4pP3soPzooXFx3Kyg/PVtcXC9cXHN9XSkpfChcXHcrKT8oOil8KD4pfChcXCopKVxccyooKD86W159XXx9KD8hfSkpKj8pKFxcLyk/fHsoXFxeKT97KD86KD86XFwvKFxcdyspKVxccyp8IS0tW1xcc1xcU10qPy0tKSl9fS9nXG5cbig/OlxuICB7KFxcXik/eyAgICAgICAgICAgIGJpbmRcbiAgKD86XG4gICAgKFxcdysgICAgICAgICAgICAgdGFnTmFtZVxuICAgICAgKD89W1xcL1xcc31dKVxuICAgIClcbiAgICB8XG4gICAgKFxcdyspPyg6KSAgICAgICAgY29udmVydGVyIGNvbG9uXG4gICAgfFxuICAgICg+KSAgICAgICAgICAgICAgaHRtbFxuICAgIHxcbiAgICAoXFwqKSAgICAgICAgICAgICBjb2RlVGFnXG4gIClcbiAgXFxzKlxuICAoICAgICAgICAgICAgICAgICAgcGFyYW1zXG4gICAgKD86W159XXx9KD8hfSkpKj9cbiAgKVxuICAoXFwvKT8gICAgICAgICAgICAgIHNsYXNoXG4gIHxcbiAgeyhcXF4pP3sgICAgICAgICAgICBiaW5kMlxuICAoPzpcbiAgICAoP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ckLl5dKj8pKD86Wy5bXl0oW1xcdyRdKylcXF0/KT8pJC9nLFxuXHRcdFx0Ly8gICAgICAgIG5vdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmplY3QgICAgIGhlbHBlciAgICB2aWV3ICB2aWV3UHJvcGVydHkgcGF0aFRva2VucyAgICAgIGxlYWZUb2tlblxuXG5cdFx0XHRyUHJtOiAvKFxcKCkoPz1cXHMqXFwoKXwoPzooWyhbXSlcXHMqKT8oPzooXFxePykofj9bXFx3JC5eXSspP1xccyooKFxcK1xcK3wtLSl8XFwrfC18fig/IVtcXHckXSl8JiZ8XFx8XFx8fD09PXwhPT18PT18IT18PD18Pj18Wzw+JSo6P1xcL118KD0pKVxccyp8KCEqPyhAKT9bI35dP1tcXHckLl5dKykoWyhbXSk/KXwoLFxccyopfCg/OihcXCgpXFxzKik/XFxcXD8oPzooJyl8KFwiKSl8KD86XFxzKigoWylcXF1dKSg/PVsuXl18XFxzKiR8W14oW10pfFspXFxdXSkoWyhbXT8pKXwoXFxzKykvZyxcblx0XHRcdC8vICAgbGZ0UHJuMCAgICAgICAgICAgbGZ0UHJuICAgICAgICAgYm91bmQgICAgIHBhdGggICAgICAgICAgICAgICBvcGVyYXRvciAgICAgZXJyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXEgICAgICBwYXRoMiBsYXRlICAgICAgICAgICAgcHJuICAgICAgY29tbWEgIGxmdFBybjIgICAgICAgICAgYXBvcyBxdW90ICAgICAgICBydFBybiAgcnRQcm5Eb3QgICAgICAgICAgICAgICAgICBwcm4yICAgICBzcGFjZVxuXG5cdFx0XHRWaWV3OiBWaWV3LFxuXHRcdFx0RXJyOiBKc1ZpZXdzRXJyb3IsXG5cdFx0XHR0bXBsRm46IHRtcGxGbixcblx0XHRcdHBhcnNlOiBwYXJzZVBhcmFtcyxcblx0XHRcdGV4dGVuZDogJGV4dGVuZCxcblx0XHRcdGV4dGVuZEN0eDogZXh0ZW5kQ3R4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ciwgY29sb24sIGh0bWwsIGNvZGVUYWcsIHBhcmFtcywgc2xhc2gsIGJpbmQyLCBjbG9zZUJsb2NrLCBpbmRleCkge1xuLypcblxuICAgICBiaW5kICAgICB0YWdOYW1lICAgICAgICAgY3Z0ICAgY2xuIGh0bWwgY29kZSAgICBwYXJhbXMgICAgICAgICAgICBzbGFzaCAgIGJpbmQyICAgICAgICAgY2xvc2VCbGsgIGNvbW1lbnRcbi8oPzp7KFxcXik/eyg/OihcXHcrKD89W1xcL1xcc31dKSl8KFxcdyspPyg6KXwoPil8KFxcKikpXFxzKigoPzpbXn1dfH0oPyF9KSkqPykoXFwvKT98eyhcXF4pP3soPzooPzpcXC8oXFx3KykpXFxzKnwhLS1bXFxzXFxTXSo/LS0pKX19L2dcblxuKD86XG4gIHsoXFxeKT97ICAgICAgICAgICAgYmluZFxuICAoPzpcbiAgICAoXFx3KyAgICAgICAgICAgICB0YWdOYW1lXG4gICAgICAoPz1bXFwvXFxzfV0pXG4gICAgKVxuICAgIHxcbiAgICAoXFx3Kyk/KDopICAgICAgICBjb252ZXJ0ZXIgY29sb25cbiAgICB8XG4gICAgKD4pICAgICAgICAgICAgICBodG1sXG4gICAgfFxuICAgIChcXCopICAgICAgICAgICAgIGNvZGVUYWdcbiAgKVxuICBcXHMqXG4gICggICAgICAgICAgICAgICAgICBwYXJhbXNcbiAgICAoPzpbXn1dfH0oPyF9KSkqP1xuICApXG4gIChcXC8pPyAgICAgICAgICAgICAgc2xhc2hcbiAgfFxuICB7KFxcXik/eyAgICAgICAgICAgIGJpbmQyXG4gICg/OlxuICAgICg/OlxcLyhcXHcrKSlcXHMqICAgY2xvc2VCbG9ja1xuICAgIHxcbiAgICAhLS1bXFxzXFxTXSo/LS0gICAgY29tbWVudFxuICApXG4pXG59fS9nXG5cbiovXG5cdFx0aWYgKGNvZGVUYWcgJiYgYmluZCB8fCBzbGFzaCAmJiAhdGFnTmFtZSB8fCBwYXJhbXMgJiYgcGFyYW1zLnNsaWNlKC0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aWRlIGpRdWVyeVxuXHR9XG5cdGNhdGNoKGUpIHtcblx0XHRyZXN1bHQgPSBlO1xuXHR9XG5cblx0Ly8gLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLiBBc3NlcnQgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uXG5cdGFzc2VydC5lcXVhbChyZXN1bHQsIFwiSnNWaWV3cyByZXF1aXJlcyBqUXVlcnlcIiwgJ3JlcXVpcmUoXCJqc3ZpZXdzXCIpKGpRdWVyeSkgdGhyb3dzIFwiSnNWaWV3cyByZXF1aXJlcyBqUXVlcnlcIicpO1xuXG5cdC8vIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gUmVzZXQgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uXG5cdGdsb2JhbC5qUXVlcnkgPSBqUXVlcnk7IC8vIFJlcGxhY2UgUVVuaXQgZ2xvYmFsIGpRdWVyeVxuXHRnbG9iYWwuanNyZW5kZXIgPSBqc3I7IC8vIFJlcGxhY2UgYW55IHByZXZpb3VzIGdsb2JhbCBqc3JlbmRlclxufSk7XG59XG59KSgpO1xuIl19
diff --git a/test/browserify/bundles/12-nested-bundle.js b/test/browserify/bundles/12-nested-bundle.js
index 8739bb4..596ef26 100644
--- a/test/browserify/bundles/12-nested-bundle.js
+++ b/test/browserify/bundles/12-nested-bundle.js
@@ -1,12 +1,12 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/* JsRender:
* See http://jsviews.com/#jsrender and http://github.com/BorisMoore/jsrender
- * Copyright 2021, Boris Moore
+ * Copyright 2023, Boris Moore
* Released under the MIT License.
*/
@@ -48,7 +48,7 @@ if (!$ || !$.fn) {
throw "JsViews requires jQuery"; // We require jQuery
}
-var versionNumber = "v1.0.12",
+var versionNumber = "v1.0.13",
jsvStoreName, rTag, rTmplString, topView, $views, $observe, $observable, $expando,
_ocp = "_ocp", // Observable contextual parameter
@@ -1123,7 +1123,7 @@ function compileTmpl(name, tmpl, parentTmpl, options) {
}
} else if (value.charAt(0) === "#") {
elem = document.getElementById(value.slice(1));
- } else if ($.fn && !$sub.rTmpl.test(value)) {
+ } if (!elem && $.fn && !$sub.rTmpl.test(value)) {
try {
elem = $(value, document)[0]; // if jQuery is loaded, test for selector returning elements, and get first element
} catch (e) {}
@@ -3026,7 +3026,7 @@ if (jsrToJq) { // Moving from jsrender namespace to jQuery namepace - copy over
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< JsObservable >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/* JsObservable:
* See https://www.jsviews.com/#jsobservable and http://github.com/borismoore/jsviews
- * Copyright 2021, Boris Moore
+ * Copyright 2023, Boris Moore
* Released under the MIT License.
*/
@@ -4315,7 +4315,7 @@ if (!$.observe) {
/* JsViews:
* Interactive data-driven views using templates and data-linking.
* See https://www.jsviews.com/#jsviews and http://github.com/BorisMoore/jsviews
- * Copyright 2021, Boris Moore
+ * Copyright 2023, Boris Moore
* Released under the MIT License.
*/
@@ -18926,4 +18926,4 @@ module.exports = $ ? $.templates("./test/templates/name-template.html", mkup) :
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[3])
-//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJqc3ZpZXdzLmpzIiwibm9kZV9t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