-
Notifications
You must be signed in to change notification settings - Fork 130
/
jsviews.min.js.map
1 lines (1 loc) · 472 KB
/
jsviews.min.js.map
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","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","rSplitBindings","_jsvTr","delegateTarget","activeBody","_jsvChg","_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","lastIndex","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","select2","filtered","add","find","withMarkers","prevIsFirstNode","lastSibling","childTags","_gm","indexFrom","newVal","_bdArgs","_bdVals","inArray","extra","domChange","forOrIfTagCtx","linkTag","domChangeNotification","tagParElem","hasListener","_data","events","triggerHandler","onDomChange","parentElement","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","_inId","cbBindings","unbind","relPath","prevAllPath","observeObjects","observeObjectPaths","pths","getInnerCb","newObj","observePath","prts","obArrAddRemove","arrIndex","dep","obArr","prt","fnProp","isGet","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","linkExpr","useDisable","disabled","checkboxgroup","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,UAAU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OACHouB,GAAiB/d,GAAqBy7B,SACtCre,GAAe2Z,GAAa,KAAOhZ,GAAiB,IACpDhe,GAAUC,GAAqBC,IAC/BF,GAAQg4B,SAAWh4B,GAAQ27B,OAC3B37B,GAAQ03B,MAAQ13B,GAAQ43B,MAAQ53B,GAAQ83B,SAAW93B,GAAQ47B,QAAU57B,GAAQ23B,MAC7E33B,GAAQ67B,GAAK77B,GAAQ87B,IAGtBtsC,GAAe27B,UACduQ,SAAU,YACVh6B,UAAU,EACVkd,YAAY,EAIZ1e,KACCy7B,QAAS,EAAG,+BAAgC,aAC5CI,QAAS,EAAG,aAAc,eAC1BzD,MAAO,EAAG,QAAS,UACnBlzB,OAAQ,EAAG,WAAY,aACvBuyB,OAAQ,EAAG,UAAW,YACtBE,IAAK,EAAG,iBAAkB,oBAC1BiE,IAAK,EAAG,qBAAsB,yBAC9BvD,KAAM,EAAG,mCAAoC,uBAC7CL,QAAS,EAAG,QAAS,UAGrB53B,IAAK1U,EAAEowC,QAAQC,eAAiB,EAAG,GAAI,KAAO,EAAG,SAAU,WAE5D7kB,KACC6f,OACC3f,KAAMwN,GAAa3V,GAAIgD,IAExB+pB,SAAUhF,GACVxR,OAAQwR,GACRc,UACC7oB,GAAI,YAKAvjB,GACJ8qC","file":"jsviews.min.js","sourcesContent":["/*! jsviews.js v1.0.15 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 2024, 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 <script> tag\n\t\tfactory(global, false);\n\t}\n} (\n\n// factory (for jsviews.js)\nfunction(global, $) {\n\"use strict\";\n\n//========================== Top-level vars ==========================\n\n// global var is the this object, which is window when running in the usual browser environment\nvar setGlobals = $ === false; // Only set globals if script block in browser (not AMD and not CommonJS)\n\n$ = $ || global.jQuery; // $ is jQuery passed in by CommonJS loader (Browserify), or global jQuery.\n\nif (!$ || !$.fn) {\n\t// jQuery is not loaded.\n\tthrow \"JsViews requires jQuery\"; // We require jQuery\n}\n\nvar versionNumber = \"v1.0.15\",\n\n\tjsvStoreName, rTag, rTmplString, topView, $views, $observe, $observable, $expando,\n\t_ocp = \"_ocp\", // Observable contextual parameter\n\n\t$isFunction, $isArray, $templates, $converters, $helpers, $tags, $sub, $subSettings, $subSettingsAdvanced, $viewsSettings,\n\tdelimOpenChar0, delimOpenChar1, delimCloseChar0, delimCloseChar1, linkChar, setting, baseOnError,\n\n\tisRenderCall,\n\trNewLine = /[ \\t]*(\\r\\n|\\n|\\r)/g,\n\trUnescapeQuotes = /\\\\(['\"\\\\])/g, // Unescape quotes and trim\n\trEscapeQuotes = /['\"\\\\]/g, // Escape quotes and \\ character\n\trBuildHash = /(?:\\x08|^)(onerror:)?(?:(~?)(([\\w$.]+):)?([^\\x08]+))\\x08(,)?([^\\x08]+)/gi,\n\trTestElseIf = /^if\\s/,\n\trFirstElem = /<(\\w+)[>\\s]/,\n\trAttrEncode = /[\\x00`><\"'&=]/g, // Includes > encoding since rConvertMarkers in JsViews does not skip > characters in attribute strings\n\trIsHtml = /[\\x00`><\\\"'&=]/,\n\trHasHandlers = /^on[A-Z]|^convert(Back)?$/,\n\trWrappedInViewMarker = /^\\#\\d+_`[\\s\\S]*\\/\\d+_`$/,\n\trHtmlEncode = rAttrEncode,\n\trDataEncode = /[&<>]/g,\n\trDataUnencode = /&(amp|gt|lt);/g,\n\trBracketQuote = /\\[['\"]?|['\"]?\\]/g,\n\tviewId = 0,\n\tcharEntities = {\n\t\t\"&\": \"&\",\n\t\t\"<\": \"<\",\n\t\t\">\": \">\",\n\t\t\"\\x00\": \"�\",\n\t\t\"'\": \"'\",\n\t\t'\"': \""\",\n\t\t\"`\": \"`\",\n\t\t\"=\": \"=\"\n\t},\n\tcharsFromEntities = {\n\t\tamp: \"&\",\n\t\tgt: \">\",\n\t\tlt: \"<\"\n\t},\n\tHTML = \"html\",\n\tSTRING = \"string\",\n\tOBJECT = \"object\",\n\ttmplAttr = \"data-jsv-tmpl\",\n\tjsvTmpl = \"jsvTmpl\",\n\tindexStr = \"For #index in nested block use #getIndex().\",\n\tcpFnStore = {}, // Compiled furnctions for computed values in template expressions (properties, methods, helpers)\n\t$render = {},\n\n\tjsr = global.jsrender,\n\tjsrToJq = jsr && $ && !$.render, // JsRender already loaded, without jQuery. but we will re-load it now to attach to jQuery\n\n\tjsvStores = {\n\t\ttemplate: {\n\t\t\tcompile: compileTmpl\n\t\t},\n\t\ttag: {\n\t\t\tcompile: compileTag\n\t\t},\n\t\tviewModel: {\n\t\t\tcompile: compileViewModel\n\t\t},\n\t\thelper: {},\n\t\tconverter: {}\n\t};\n\n\t// views object ($.views if jQuery is loaded, jsrender.views if no jQuery, e.g. in Node.js)\n\t$views = {\n\t\tjsviews: versionNumber,\n\t\tsub: {\n\t\t\t// subscription, e.g. JsViews integration\n\t\t\trPath: /^(!*?)(?:null|true|false|\\d[\\d.]*|([\\w$]+|\\.|~([\\w$]+)|#(view|([\\w$]+))?)([\\w$.^]*?)(?:[.[^]([\\w$]+)\\]?)?)$/g,\n\t\t\t// not object helper view viewProperty pathTokens leafToken\n\n\t\t\trPrm: /(\\()(?=\\s*\\()|(?:([([])\\s*)?(?:(\\^?)(~?[\\w$.^]+)?\\s*((\\+\\+|--)|\\+|-|~(?![\\w$])|&&|\\|\\||===|!==|==|!=|<=|>=|[<>%*:?\\/]|(=))\\s*|(!*?(@)?[#~]?[\\w$.^]+)([([])?)|(,\\s*)|(?:(\\()\\s*)?\\\\?(?:(')|(\"))|(?:\\s*(([)\\]])(?=[.^]|\\s*$|[^([])|[)\\]])([([]?))|(\\s+)/g,\n\t\t\t// lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space\n\n\t\t\tView: View,\n\t\t\tErr: JsViewsError,\n\t\t\ttmplFn: tmplFn,\n\t\t\tparse: parseParams,\n\t\t\textend: $extend,\n\t\t\textendCtx: extendCtx,\n\t\t\tsyntaxErr: syntaxError,\n\t\t\tonStore: {\n\t\t\t\ttemplate: function(name, item) {\n\t\t\t\t\tif (item === null) {\n\t\t\t\t\t\tdelete $render[name];\n\t\t\t\t\t} else if (name) {\n\t\t\t\t\t\t$render[name] = item;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\taddSetting: addSetting,\n\t\t\tsettings: {\n\t\t\t\tallowCode: false\n\t\t\t},\n\t\t\tadvSet: noop, // Update advanced settings\n\t\t\t_thp: tagHandlersFromProps,\n\t\t\t_gm: getMethod,\n\t\t\t_tg: function() {}, // Constructor for tagDef\n\t\t\t_cnvt: convertVal,\n\t\t\t_tag: renderTag,\n\t\t\t_er: error,\n\t\t\t_err: onRenderError,\n\t\t\t_cp: retVal, // Get observable contextual parameters (or properties) ~foo=expr. In JsRender, simply returns val.\n\t\t\t_sq: function(token) {\n\t\t\t\tif (token === \"constructor\") {\n\t\t\t\t\tsyntaxError(\"\");\n\t\t\t\t}\n\t\t\t\treturn token;\n\t\t\t}\n\t\t},\n\t\tsettings: {\n\t\t\tdelimiters: $viewsDelimiters,\n\t\t\tadvanced: function(value) {\n\t\t\t\treturn value\n\t\t\t\t\t? (\n\t\t\t\t\t\t\t$extend($subSettingsAdvanced, value),\n\t\t\t\t\t\t\t$sub.advSet(),\n\t\t\t\t\t\t\t$viewsSettings\n\t\t\t\t\t\t)\n\t\t\t\t\t\t: $subSettingsAdvanced;\n\t\t\t\t}\n\t\t},\n\t\tmap: dataMap // If jsObservable loaded first, use that definition of dataMap\n\t};\n\nfunction getDerivedMethod(baseMethod, method) {\n\treturn function() {\n\t\tvar ret,\n\t\t\ttag = this,\n\t\t\tprevBase = tag.base;\n\n\t\ttag.base = baseMethod; // Within method call, calling this.base will call the base method\n\t\tret = method.apply(tag, arguments); // Call the method\n\t\ttag.base = prevBase; // Replace this.base to be the base method of the previous call, for chained calls\n\t\treturn ret;\n\t};\n}\n\nfunction getMethod(baseMethod, method) {\n\t// For derived methods (or handlers declared declaratively as in {{:foo onChange=~fooChanged}} replace by a derived method, to allow using this.base(...)\n\t// or this.baseApply(arguments) to call the base implementation. (Equivalent to this._super(...) and this._superApply(arguments) in jQuery UI)\n\tif ($isFunction(method)) {\n\t\tmethod = getDerivedMethod(\n\t\t\t\t!baseMethod\n\t\t\t\t\t? noop // no base method implementation, so use noop as base method\n\t\t\t\t\t: baseMethod._d\n\t\t\t\t\t\t? baseMethod // baseMethod is a derived method, so use it\n\t\t\t\t\t\t: getDerivedMethod(noop, baseMethod), // baseMethod is not derived so make its base method be the noop method\n\t\t\t\tmethod\n\t\t\t);\n\t\tmethod._d = (baseMethod && baseMethod._d || 0) + 1; // Add flag for derived method (incremented for derived of derived...)\n\t}\n\treturn method;\n}\n\nfunction tagHandlersFromProps(tag, tagCtx) {\n\tvar prop,\n\t\tprops = tagCtx.props;\n\tfor (prop in props) {\n\t\tif (rHasHandlers.test(prop) && !(tag[prop] && tag[prop].fix)) { // Don't override handlers with fix expando (used in datepicker and spinner)\n\t\t\ttag[prop] = prop !== \"convert\" ? getMethod(tag.constructor.prototype[prop], props[prop]) : props[prop];\n\t\t\t// Copy over the onFoo props, convert and convertBack from tagCtx.props to tag (overrides values in tagDef).\n\t\t\t// Note: unsupported scenario: if handlers are dynamically added ^onFoo=expression this will work, but dynamically removing will not work.\n\t\t}\n\t}\n}\n\nfunction retVal(val) {\n\treturn val;\n}\n\nfunction noop() {\n\treturn \"\";\n}\n\nfunction dbgBreak(val) {\n\t// Usage examples: {{dbg:...}}, {{:~dbg(...)}}, {{dbg .../}}, {^{for ... onAfterLink=~dbg}} etc.\n\ttry {\n\t\tconsole.log(\"JsRender dbg breakpoint: \" + val);\n\t\tthrow \"dbg breakpoint\"; // To break here, stop on caught exceptions.\n\t}\n\tcatch (e) {}\n\treturn this.base ? this.baseApply(arguments) : val;\n}\n\nfunction JsViewsError(message) {\n\t// Error exception type for JsViews/JsRender\n\t// Override of $.views.sub.Error is possible\n\tthis.name = ($.link ? \"JsViews\" : \"JsRender\") + \" Error\";\n\tthis.message = message || this.name;\n}\n\nfunction $extend(target, source) {\n\tif (target) {\n\t\tfor (var name in source) {\n\t\t\ttarget[name] = source[name];\n\t\t}\n\t\treturn target;\n\t}\n}\n\n(JsViewsError.prototype = new Error()).constructor = JsViewsError;\n\n//========================== Top-level functions ==========================\n\n//===================\n// views.delimiters\n//===================\n\n\t/**\n\t* Set the tag opening and closing delimiters and 'link' character. Default is \"{{\", \"}}\" and \"^\"\n\t* openChars, closeChars: opening and closing strings, each with two characters\n\t* $.views.settings.delimiters(...)\n\t*\n\t* @param {string} openChars\n\t* @param {string} [closeChars]\n\t* @param {string} [link]\n\t* @returns {Settings}\n\t*\n\t* Get delimiters\n\t* delimsArray = $.views.settings.delimiters()\n\t*\n\t* @returns {string[]}\n\t*/\nfunction $viewsDelimiters(openChars, closeChars, link) {\n\tif (!openChars) {\n\t\treturn $subSettings.delimiters;\n\t}\n\tif ($isArray(openChars)) {\n\t\treturn $viewsDelimiters.apply($views, openChars);\n\t}\n\tlinkChar = link ? link[0] : linkChar;\n\tif (!/^(\\W|_){5}$/.test(openChars + closeChars + linkChar)) {\n\t\terror(\"Invalid delimiters\"); // Must be non-word characters, and openChars and closeChars must each be length 2\n\t}\n\tdelimOpenChar0 = openChars[0];\n\tdelimOpenChar1 = openChars[1];\n\tdelimCloseChar0 = closeChars[0];\n\tdelimCloseChar1 = closeChars[1];\n\n\t$subSettings.delimiters = [delimOpenChar0 + delimOpenChar1, delimCloseChar0 + delimCloseChar1, linkChar];\n\n\t// Escape the characters - since they could be regex special characters\n\topenChars = \"\\\\\" + delimOpenChar0 + \"(\\\\\" + linkChar + \")?\\\\\" + delimOpenChar1; // Default is \"{^{\"\n\tcloseChars = \"\\\\\" + delimCloseChar0 + \"\\\\\" + delimCloseChar1; // Default is \"}}\"\n\t// Build regex with new delimiters\n\t// [tag (followed by / space or }) or cvtr+colon or html or code] followed by space+params then convertBack?\n\trTag = \"(?:(\\\\w+(?=[\\\\/\\\\s\\\\\" + delimCloseChar0 + \"]))|(\\\\w+)?(:)|(>)|(\\\\*))\\\\s*((?:[^\\\\\"\n\t\t+ delimCloseChar0 + \"]|\\\\\" + delimCloseChar0 + \"(?!\\\\\" + delimCloseChar1 + \"))*?)\";\n\n\t// Make rTag available to JsViews (or other components) for parsing binding expressions\n\t$sub.rTag = \"(?:\" + rTag + \")\";\n\t// { ^? { tag+params slash? or closingTag or comment\n\trTag = new RegExp(\"(?:\" + openChars + rTag + \"(\\\\/)?|\\\\\" + delimOpenChar0 + \"(\\\\\" + linkChar + \")?\\\\\" + delimOpenChar1 + \"(?:(?:\\\\/(\\\\w+))\\\\s*|!--[\\\\s\\\\S]*?--))\" + closeChars, \"g\");\n\n\t// Default: bind tagName cvt cln html code params slash bind2 closeBlk comment\n\t// /(?:{(\\^)?{(?:(\\w+(?=[\\/\\s}]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^}]|}(?!}))*?)(\\/)?|{(\\^)?{(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))}}\n\n\t$sub.rTmpl = new RegExp(\"^\\\\s|\\\\s$|<.*>|([^\\\\\\\\]|^)[{}]|\" + openChars + \".*\" + closeChars);\n\t// $sub.rTmpl looks for initial or final white space, html tags or { or } char not preceded by \\\\, or JsRender tags {{xxx}}.\n\t// Each of these strings are considered NOT to be jQuery selectors\n\treturn $viewsSettings;\n}\n\n//=========\n// View.get\n//=========\n\nfunction getView(inner, type) { //view.get(inner, type)\n\tif (!type && inner !== true) {\n\t\t// view.get(type)\n\t\ttype = inner;\n\t\tinner = undefined;\n\t}\n\n\tvar views, i, l, found,\n\t\tview = this,\n\t\troot = type === \"root\";\n\t\t// view.get(\"root\") returns view.root, view.get() returns view.parent, view.get(true) returns view.views[0].\n\n\tif (inner) {\n\t\t// Go through views - this one, and all nested ones, depth-first - and return first one with given type.\n\t\t// If type is undefined, i.e. view.get(true), return first child view.\n\t\tfound = type && view.type === type && view;\n\t\tif (!found) {\n\t\t\tviews = view.views;\n\t\t\tif (view._.useKey) {\n\t\t\t\tfor (i in views) {\n\t\t\t\t\tif (found = type ? views[i].get(inner, type) : views[i]) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (i = 0, l = views.length; !found && i < l; i++) {\n\t\t\t\t\tfound = type ? views[i].get(inner, type) : views[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (root) {\n\t\t// Find root view. (view whose parent is top view)\n\t\tfound = view.root;\n\t} else if (type) {\n\t\twhile (view && !found) {\n\t\t\t// Go through views - this one, and all parent ones - and return first one with given type.\n\t\t\tfound = view.type === type ? view : undefined;\n\t\t\tview = view.parent;\n\t\t}\n\t} else {\n\t\tfound = view.parent;\n\t}\n\treturn found || undefined;\n}\n\nfunction getNestedIndex() {\n\tvar view = this.get(\"item\");\n\treturn view ? view.index : undefined;\n}\n\ngetNestedIndex.depends = function() {\n\treturn [this.get(\"item\"), \"index\"];\n};\n\nfunction getIndex() {\n\treturn this.index;\n}\n\ngetIndex.depends = \"index\";\n\n//==================\n// View.ctxPrm, etc.\n//==================\n\n/* Internal private: view._getOb() */\nfunction getPathObject(ob, path, ltOb, fn) {\n\t// Iterate through path to late paths: @a.b.c paths\n\t// Return \"\" (or noop if leaf is a function @a.b.c(...) ) if intermediate object not yet available\n\tvar prevOb, tokens, l,\n\t\ti = 0;\n\tif (ltOb === 1) {\n\t\tfn = 1;\n\t\tltOb = undefined;\n\t}\n\t// Paths like ^a^b^c or ~^a^b^c will not throw if an object in path is undefined.\n\tif (path) {\n\t\ttokens = path.split(\".\");\n\t\tl = tokens.length;\n\n\t\tfor (; ob && i < l; i++) {\n\t\t\tprevOb = ob;\n\t\t\tob = tokens[i] ? ob[tokens[i]] : ob;\n\t\t}\n\t}\n\tif (ltOb) {\n\t\tltOb.lt = ltOb.lt || i<l; // If i < l there was an object in the path not yet available\n\t}\n\treturn ob === undefined\n\t\t? fn ? noop : \"\"\n\t\t: fn ? function() {\n\t\t\treturn ob.apply(prevOb, arguments);\n\t\t} : ob;\n}\n\nfunction contextParameter(key, value, get) {\n\t// Helper method called as view.ctxPrm(key) for helpers or template parameters ~foo - from compiled template or from context callback\n\tvar wrapped, deps, res, obsCtxPrm, tagElse, callView, newRes,\n\t\tstoreView = this,\n\t\tisUpdate = !isRenderCall && arguments.length > 1,\n\t\tstore = storeView.ctx;\n\tif (key) {\n\t\tif (!storeView._) { // tagCtx.ctxPrm() call\n\t\t\ttagElse = storeView.index;\n\t\t\tstoreView = storeView.tag;\n\t\t}\n\t\tcallView = storeView;\n\t\tif (store && store.hasOwnProperty(key) || (store = $helpers).hasOwnProperty(key)) {\n\t\t\tres = store[key];\n\t\t\tif (key === \"tag\" || key === \"tagCtx\" || key === \"root\" || key === \"parentTags\") {\n\t\t\t\treturn res;\n\t\t\t}\n\t\t} else {\n\t\t\tstore = undefined;\n\t\t}\n\t\tif (!isRenderCall && storeView.tagCtx || storeView.linked) { // Data-linked view, or tag instance\n\t\t\tif (!res || !res._cxp) {\n\t\t\t\t// Not a contextual parameter\n\t\t\t\t// Set storeView to tag (if this is a tag.ctxPrm() call) or to root view (\"data\" view of linked template)\n\t\t\t\tstoreView = storeView.tagCtx || $isFunction(res)\n\t\t\t\t\t? storeView // Is a tag, not a view, or is a computed contextual parameter, so scope to the callView, not the 'scope view'\n\t\t\t\t\t: (storeView = storeView.scope || storeView,\n\t\t\t\t\t\t!storeView.isTop && storeView.ctx.tag // If this view is in a tag, set storeView to the tag\n\t\t\t\t\t\t\t|| storeView);\n\t\t\t\tif (res !== undefined && storeView.tagCtx) {\n\t\t\t\t\t// If storeView is a tag, but the contextual parameter has been set at at higher level (e.g. helpers)...\n\t\t\t\t\tstoreView = storeView.tagCtx.view.scope; // then move storeView to the outer level (scope of tag container view)\n\t\t\t\t}\n\t\t\t\tstore = storeView._ocps;\n\t\t\t\tres = store && store.hasOwnProperty(key) && store[key] || res;\n\t\t\t\tif (!(res && res._cxp) && (get || isUpdate)) {\n\t\t\t\t\t// Create observable contextual parameter\n\t\t\t\t\t(store || (storeView._ocps = storeView._ocps || {}))[key]\n\t\t\t\t\t\t= res\n\t\t\t\t\t\t= [{\n\t\t\t\t\t\t\t_ocp: res, // The observable contextual parameter value\n\t\t\t\t\t\t\t_vw: callView,\n\t\t\t\t\t\t\t_key: key\n\t\t\t\t\t\t}];\n\t\t\t\t\tres._cxp = {\n\t\t\t\t\t\tpath: _ocp,\n\t\t\t\t\t\tind: 0,\n\t\t\t\t\t\tupdateValue: function(val, path) {\n\t\t\t\t\t\t\t$.observable(res[0]).setProperty(_ocp, val); // Set the value (res[0]._ocp)\n\t\t\t\t\t\t\treturn this;\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 (obsCtxPrm = res && res._cxp) {\n\t\t\t\t// If this helper resource is an observable contextual parameter\n\t\t\t\tif (arguments.length > 2) {\n\t\t\t\t\tdeps = res[1] ? $sub._ceo(res[1].deps) : [_ocp]; // fn deps (with any exprObs cloned using $sub._ceo)\n\t\t\t\t\tdeps.unshift(res[0]); // view\n\t\t\t\t\tdeps._cxp = obsCtxPrm;\n\t\t\t\t\t// In a context callback for a contextual param, we set get = true, to get ctxPrm [view, dependencies...] array - needed for observe call\n\t\t\t\t\treturn deps;\n\t\t\t\t}\n\t\t\t\ttagElse = obsCtxPrm.tagElse;\n\t\t\t\tnewRes = res[1] // linkFn for compiled expression\n\t\t\t\t\t? obsCtxPrm.tag && obsCtxPrm.tag.cvtArgs\n\t\t\t\t\t\t? obsCtxPrm.tag.cvtArgs(tagElse, 1)[obsCtxPrm.ind] // = tag.bndArgs() - for tag contextual parameter\n\t\t\t\t\t\t: res[1](res[0].data, res[0], $sub) // = fn(data, view, $sub) for compiled binding expression\n\t\t\t\t\t: res[0]._ocp; // Observable contextual parameter (uninitialized, or initialized as static expression, so no path dependencies)\n\t\t\t\tif (isUpdate) {\n\t\t\t\t\t$sub._ucp(key, value, storeView, obsCtxPrm); // Update observable contextual parameter\n\t\t\t\t\treturn storeView;\n\t\t\t\t}\n\t\t\t\tres = newRes;\n\t\t\t}\n\t\t}\n\t\tif (res && $isFunction(res)) {\n\t\t\t// If a helper is of type function we will wrap it, so if called with no this pointer it will be called with the\n\t\t\t// view as 'this' context. If the helper ~foo() was in a data-link expression, the view will have a 'temporary' linkCtx property too.\n\t\t\t// Note that helper functions on deeper paths will have specific this pointers, from the preceding path.\n\t\t\t// For example, ~util.foo() will have the ~util object as 'this' pointer\n\t\t\twrapped = function() {\n\t\t\t\treturn res.apply((!this || this === global) ? callView : this, arguments);\n\t\t\t};\n\t\t\t$extend(wrapped, res); // Attach same expandos (if any) to the wrapped function\n\t\t}\n\t\treturn wrapped || res;\n\t}\n}\n\n/* Internal private: view._getTmpl() */\nfunction getTemplate(tmpl) {\n\treturn tmpl && (tmpl.fn\n\t\t? tmpl\n\t\t: this.getRsc(\"templates\", tmpl) || $templates(tmpl)); // not yet compiled\n}\n\n//==============\n// views._cnvt\n//==============\n\nfunction convertVal(converter, view, tagCtx, onError) {\n\t// Called from compiled template code for {{:}}\n\t// self is template object or linkCtx object\n\tvar tag, linkCtx, value, argsLen, bindTo,\n\t\t// If tagCtx is an integer, then it is the key for the compiled function to return the boundTag tagCtx\n\t\tboundTag = typeof tagCtx === \"number\" && view.tmpl.bnds[tagCtx-1];\n\n\tif (onError === undefined && boundTag && boundTag._lr) { // lateRender\n\t\tonError = \"\";\n\t}\n\tif (onError !== undefined) {\n\t\ttagCtx = onError = {props: {}, args: [onError]};\n\t} else if (boundTag) {\n\t\ttagCtx = boundTag(view.data, view, $sub);\n\t}\n\tboundTag = boundTag._bd && boundTag;\n\tif (converter || boundTag) {\n\t\tlinkCtx = view._lc; // For data-link=\"{cvt:...}\"... See onDataLinkedTagChange\n\t\ttag = linkCtx && linkCtx.tag;\n\t\ttagCtx.view = view;\n\t\tif (!tag) {\n\t\t\ttag = $extend(new $sub._tg(), {\n\t\t\t\t_: {\n\t\t\t\t\tbnd: boundTag,\n\t\t\t\t\tunlinked: true,\n\t\t\t\t\tlt: tagCtx.lt // If a late path @some.path has not returned @some object, mark tag as late\n\t\t\t\t},\n\t\t\t\tinline: !linkCtx,\n\t\t\t\ttagName: \":\",\n\t\t\t\tconvert: converter,\n\t\t\t\tonArrayChange: true,\n\t\t\t\tflow: true,\n\t\t\t\ttagCtx: tagCtx,\n\t\t\t\ttagCtxs: [tagCtx],\n\t\t\t\t_is: \"tag\"\n\t\t\t});\n\t\t\targsLen = tagCtx.args.length;\n\t\t\tif (argsLen>1) {\n\t\t\t\tbindTo = tag.bindTo = [];\n\t\t\t\twhile (argsLen--) {\n\t\t\t\t\tbindTo.unshift(argsLen); // Bind to all the arguments - generate bindTo array: [0,1,2...]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (linkCtx) {\n\t\t\t\tlinkCtx.tag = tag;\n\t\t\t\ttag.linkCtx = linkCtx;\n\t\t\t}\n\t\t\ttagCtx.ctx = extendCtx(tagCtx.ctx, (linkCtx ? linkCtx.view : view).ctx);\n\t\t\ttagHandlersFromProps(tag, tagCtx);\n\t\t}\n\t\ttag._er = onError && value;\n\t\ttag.ctx = tagCtx.ctx || tag.ctx || {};\n\t\ttagCtx.ctx = undefined;\n\t\tvalue = tag.cvtArgs()[0]; // If there is a convertBack but no convert, converter will be \"true\"\n\t\ttag._er = onError && value;\n\t} else {\n\t\tvalue = tagCtx.args[0];\n\t}\n\n\t// Call onRender (used by JsViews if present, to add binding annotations around rendered content)\n\tvalue = boundTag && view._.onRender\n\t\t? view._.onRender(value, view, tag)\n\t\t: value;\n\treturn value != undefined ? value : \"\";\n}\n\nfunction convertArgs(tagElse, bound) { // tag.cvtArgs() or tag.cvtArgs(tagElse?, true?)\n\tvar l, key, boundArgs, args, bindFrom, tag, converter,\n\t\ttagCtx = this;\n\n\tif (tagCtx.tagName) {\n\t\ttag = tagCtx;\n\t\ttagCtx = (tag.tagCtxs || [tagCtx])[tagElse||0];\n\t\tif (!tagCtx) {\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\ttag = tagCtx.tag;\n\t}\n\n\tbindFrom = tag.bindFrom;\n\targs = tagCtx.args;\n\n\tif ((converter = tag.convert) && typeof converter === STRING) {\n\t\tconverter = converter === \"true\"\n\t\t\t? undefined\n\t\t\t: (tagCtx.view.getRsc(\"converters\", converter) || error(\"Unknown converter: '\" + converter + \"'\"));\n\t}\n\n\tif (converter && !bound) { // If there is a converter, use a copy of the tagCtx.args array for rendering, and replace the args[0] in\n\t\targs = args.slice(); // the copied array with the converted value. But we do not modify the value of tag.tagCtx.args[0] (the original args array)\n\t}\n\tif (bindFrom) { // Get the values of the boundArgs\n\t\tboundArgs = [];\n\t\tl = bindFrom.length;\n\t\twhile (l--) {\n\t\t\tkey = bindFrom[l];\n\t\t\tboundArgs.unshift(argOrProp(tagCtx, key));\n\t\t}\n\t\tif (bound) {\n\t\t\targs = boundArgs; // Call to bndArgs() - returns the boundArgs\n\t\t}\n\t}\n\tif (converter) {\n\t\tconverter = converter.apply(tag, boundArgs || args);\n\t\tif (converter === undefined) {\n\t\t\treturn args; // Returning undefined from a converter is equivalent to not having a converter.\n\t\t}\n\t\tbindFrom = bindFrom || [0];\n\t\tl = bindFrom.length;\n\t\tif (!$isArray(converter) || (converter.arg0 !== false && (l === 1 || converter.length !== l || converter.arg0))) {\n\t\t\tconverter = [converter]; // Returning converter as first arg, even if converter value is an array\n\t\t\tbindFrom = [0];\n\t\t\tl = 1;\n\t\t}\n\t\tif (bound) { // Call to bndArgs() - so apply converter to all boundArgs\n\t\t\targs = converter; // The array of values returned from the converter\n\t\t} else { // Call to cvtArgs()\n\t\t\twhile (l--) {\n\t\t\t\tkey = bindFrom[l];\n\t\t\t\tif (+key === key) {\n\t\t\t\t\targs[key] = converter[l];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn args;\n}\n\nfunction argOrProp(context, key) {\n\tcontext = context[+key === key ? \"args\" : \"props\"];\n\treturn context && context[key];\n}\n\nfunction convertBoundArgs(tagElse) { // tag.bndArgs()\n\treturn this.cvtArgs(tagElse, 1);\n}\n\n//=============\n// views.tag\n//=============\n\n/* view.getRsc() */\nfunction getResource(resourceType, itemName) {\n\tvar res, store,\n\t\tview = this;\n\tif (typeof itemName === STRING) {\n\t\twhile ((res === undefined) && view) {\n\t\t\tstore = view.tmpl && view.tmpl[resourceType];\n\t\t\tres = store && store[itemName];\n\t\t\tview = view.parent;\n\t\t}\n\t\treturn res || $views[resourceType][itemName];\n\t}\n}\n\nfunction renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) {\n\tfunction bindToOrBindFrom(type) {\n\t\tvar bindArray = tag[type];\n\n\t\tif (bindArray !== undefined) {\n\t\t\tbindArray = $isArray(bindArray) ? bindArray : [bindArray];\n\t\t\tm = bindArray.length;\n\t\t\twhile (m--) {\n\t\t\t\tkey = bindArray[m];\n\t\t\t\tif (!isNaN(parseInt(key))) {\n\t\t\t\t\tbindArray[m] = parseInt(key); // Convert \"0\" to 0, etc.\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn bindArray || [0];\n\t}\n\n\tparentView = parentView || topView;\n\tvar tag, tagDef, template, tags, attr, parentTag, l, m, n, itemRet, tagCtx, tagCtxCtx, ctxPrm, bindTo, bindFrom, initVal,\n\t\tcontent, callInit, mapDef, thisMap, args, bdArgs, props, tagDataMap, contentCtx, key, bindFromLength, bindToLength, linkedElement, defaultCtx,\n\t\ti = 0,\n\t\tret = \"\",\n\t\tlinkCtx = parentView._lc || false, // For data-link=\"{myTag...}\"... See onDataLinkedTagChange\n\t\tctx = parentView.ctx,\n\t\tparentTmpl = tmpl || parentView.tmpl,\n\t\t// If tagCtxs is an integer, then it is the key for the compiled function to return the boundTag tagCtxs\n\t\tboundTag = typeof tagCtxs === \"number\" && parentView.tmpl.bnds[tagCtxs-1];\n\n\tif (tagName._is === \"tag\") {\n\t\ttag = tagName;\n\t\ttagName = tag.tagName;\n\t\ttagCtxs = tag.tagCtxs;\n\t\ttemplate = tag.template;\n\t} else {\n\t\ttagDef = parentView.getRsc(\"tags\", tagName) || error(\"Unknown tag: {{\" + tagName + \"}} \");\n\t\ttemplate = tagDef.template;\n\t}\n\tif (onError === undefined && boundTag && (boundTag._lr = (tagDef.lateRender && boundTag._lr!== false || boundTag._lr))) {\n\t\tonError = \"\"; // If lateRender, set temporary onError, to skip initial rendering (and render just \"\")\n\t}\n\tif (onError !== undefined) {\n\t\tret += onError;\n\t\ttagCtxs = onError = [{props: {}, args: [], params: {props:{}}}];\n\t} else if (boundTag) {\n\t\ttagCtxs = boundTag(parentView.data, parentView, $sub);\n\t}\n\n\tl = tagCtxs.length;\n\tfor (; i < l; i++) {\n\t\ttagCtx = tagCtxs[i];\n\t\tcontent = tagCtx.tmpl;\n\t\tif (!linkCtx || !linkCtx.tag || i && !linkCtx.tag.inline || tag._er || content && +content===content) {\n\t\t\t// Initialize tagCtx\n\t\t\t// For block tags, tagCtx.tmpl is an integer > 0\n\t\t\tif (content && parentTmpl.tmpls) {\n\t\t\t\ttagCtx.tmpl = tagCtx.content = parentTmpl.tmpls[content - 1]; // Set the tmpl property to the content of the block tag\n\t\t\t}\n\t\t\ttagCtx.index = i;\n\t\t\ttagCtx.ctxPrm = contextParameter;\n\t\t\ttagCtx.render = renderContent;\n\t\t\ttagCtx.cvtArgs = convertArgs;\n\t\t\ttagCtx.bndArgs = convertBoundArgs;\n\t\t\ttagCtx.view = parentView;\n\t\t\ttagCtx.ctx = extendCtx(extendCtx(tagCtx.ctx, tagDef && tagDef.ctx), ctx); // Clone and extend parentView.ctx\n\t\t}\n\t\tif (tmpl = tagCtx.props.tmpl) {\n\t\t\t// If the tmpl property is overridden, set the value (when initializing, or, in case of binding: ^tmpl=..., when updating)\n\t\t\ttagCtx.tmpl = parentView._getTmpl(tmpl);\n\t\t\ttagCtx.content = tagCtx.content || tagCtx.tmpl;\n\t\t}\n\n\t\tif (!tag) {\n\t\t\t// This will only be hit for initial tagCtx (not for {{else}}) - if the tag instance does not exist yet\n\t\t\t// If the tag has not already been instantiated, we will create a new instance.\n\t\t\t// ~tag will access the tag, even within the rendering of the template content of this tag.\n\t\t\t// From child/descendant tags, can access using ~tag.parent, or ~parentTags.tagName\n\t\t\ttag = new tagDef._ctr();\n\t\t\tcallInit = !!tag.init;\n\n\t\t\ttag.parent = parentTag = ctx && ctx.tag;\n\t\t\ttag.tagCtxs = tagCtxs;\n\n\t\t\tif (linkCtx) {\n\t\t\t\ttag.inline = false;\n\t\t\t\tlinkCtx.tag = tag;\n\t\t\t}\n\t\t\ttag.linkCtx = linkCtx;\n\t\t\tif (tag._.bnd = boundTag || linkCtx.fn) {\n\t\t\t\t// Bound if {^{tag...}} or data-link=\"{tag...}\"\n\t\t\t\ttag._.ths = tagCtx.params.props[\"this\"]; // Tag has a this=expr binding, to get javascript reference to tag instance\n\t\t\t\ttag._.lt = tagCtxs.lt; // If a late path @some.path has not returned @some object, mark tag as late\n\t\t\t\ttag._.arrVws = {};\n\t\t\t} else if (tag.dataBoundOnly) {\n\t\t\t\terror(tagName + \" must be data-bound:\\n{^{\" + tagName + \"}}\");\n\t\t\t}\n\t\t\t//TODO better perf for childTags() - keep child tag.tags array, (and remove child, when disposed)\n\t\t\t// tag.tags = [];\n\t\t} else if (linkCtx && linkCtx.fn._lr) {\n\t\t\tcallInit = !!tag.init;\n\t\t}\n\t\ttagDataMap = tag.dataMap;\n\n\t\ttagCtx.tag = tag;\n\t\tif (tagDataMap && tagCtxs) {\n\t\t\ttagCtx.map = tagCtxs[i].map; // Copy over the compiled map instance from the previous tagCtxs to the refreshed ones\n\t\t}\n\t\tif (!tag.flow) {\n\t\t\ttagCtxCtx = tagCtx.ctx = tagCtx.ctx || {};\n\n\t\t\t// tags hash: tag.ctx.tags, merged with parentView.ctx.tags,\n\t\t\ttags = tag.parents = tagCtxCtx.parentTags = ctx && extendCtx(tagCtxCtx.parentTags, ctx.parentTags) || {};\n\t\t\tif (parentTag) {\n\t\t\t\ttags[parentTag.tagName] = parentTag;\n\t\t\t\t//TODO better perf for childTags: parentTag.tags.push(tag);\n\t\t\t}\n\t\t\ttags[tag.tagName] = tagCtxCtx.tag = tag;\n\t\t\ttagCtxCtx.tagCtx = tagCtx;\n\t\t}\n\t}\n\tif (!(tag._er = onError)) {\n\t\ttagHandlersFromProps(tag, tagCtxs[0]);\n\t\ttag.rendering = {rndr: tag.rendering}; // Provide object for state during render calls to tag and elses. (Used by {{if}} and {{for}}...)\n\t\tfor (i = 0; i < l; i++) { // Iterate tagCtx for each {{else}} block\n\t\t\ttagCtx = tag.tagCtx = tagCtxs[i];\n\t\t\tprops = tagCtx.props;\n\t\t\ttag.ctx = tagCtx.ctx;\n\n\t\t\tif (!i) {\n\t\t\t\tif (callInit) {\n\t\t\t\t\ttag.init(tagCtx, linkCtx, tag.ctx);\n\t\t\t\t\tcallInit = undefined;\n\t\t\t\t}\n\t\t\t\tif (!tagCtx.args.length && tagCtx.argDefault !== false && tag.argDefault !== false) {\n\t\t\t\t\ttagCtx.args = args = [tagCtx.view.data]; // Missing first arg defaults to the current data context\n\t\t\t\t\ttagCtx.params.args = [\"#data\"];\n\t\t\t\t}\n\n\t\t\t\tbindTo = bindToOrBindFrom(\"bindTo\");\n\n\t\t\t\tif (tag.bindTo !== undefined) {\n\t\t\t\t\ttag.bindTo = bindTo;\n\t\t\t\t}\n\n\t\t\t\tif (tag.bindFrom !== undefined) {\n\t\t\t\t\ttag.bindFrom = bindToOrBindFrom(\"bindFrom\");\n\t\t\t\t} else if (tag.bindTo) {\n\t\t\t\t\ttag.bindFrom = tag.bindTo = bindTo;\n\t\t\t\t}\n\t\t\t\tbindFrom = tag.bindFrom || bindTo;\n\n\t\t\t\tbindToLength = bindTo.length;\n\t\t\t\tbindFromLength = bindFrom.length;\n\n\t\t\t\tif (tag._.bnd && (linkedElement = tag.linkedElement)) {\n\t\t\t\t\ttag.linkedElement = linkedElement = $isArray(linkedElement) ? linkedElement: [linkedElement];\n\n\t\t\t\t\tif (bindToLength !== linkedElement.length) {\n\t\t\t\t\t\terror(\"linkedElement not same length as bindTo\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (linkedElement = tag.linkedCtxParam) {\n\t\t\t\t\ttag.linkedCtxParam = linkedElement = $isArray(linkedElement) ? linkedElement: [linkedElement];\n\n\t\t\t\t\tif (bindFromLength !== linkedElement.length) {\n\t\t\t\t\t\terror(\"linkedCtxParam not same length as bindFrom/bindTo\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (bindFrom) {\n\t\t\t\t\ttag._.fromIndex = {}; // Hash of bindFrom index which has same path value as bindTo index. fromIndex = tag._.fromIndex[toIndex]\n\t\t\t\t\ttag._.toIndex = {}; // Hash of bindFrom index which has same path value as bindTo index. fromIndex = tag._.fromIndex[toIndex]\n\t\t\t\t\tn = bindFromLength;\n\t\t\t\t\twhile (n--) {\n\t\t\t\t\t\tkey = bindFrom[n];\n\t\t\t\t\t\tm = bindToLength;\n\t\t\t\t\t\twhile (m--) {\n\t\t\t\t\t\t\tif (key === bindTo[m]) {\n\t\t\t\t\t\t\t\ttag._.fromIndex[m] = n;\n\t\t\t\t\t\t\t\ttag._.toIndex[n] = m;\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\n\t\t\t\tif (linkCtx) {\n\t\t\t\t\t// Set attr on linkCtx to ensure outputting to the correct target attribute.\n\t\t\t\t\t// Setting either linkCtx.attr or this.attr in the init() allows per-instance choice of target attrib.\n\t\t\t\t\tlinkCtx.attr = tag.attr = linkCtx.attr || tag.attr || linkCtx._dfAt;\n\t\t\t\t}\n\t\t\t\tattr = tag.attr;\n\t\t\t\ttag._.noVws = attr && attr !== HTML;\n\t\t\t}\n\t\t\targs = tag.cvtArgs(i);\n\t\t\tif (tag.linkedCtxParam) {\n\t\t\t\tbdArgs = tag.cvtArgs(i, 1);\n\t\t\t\tm = bindFromLength;\n\t\t\t\tdefaultCtx = tag.constructor.prototype.ctx;\n\t\t\t\twhile (m--) {\n\t\t\t\t\tif (ctxPrm = tag.linkedCtxParam[m]) {\n\t\t\t\t\t\tkey = bindFrom[m];\n\t\t\t\t\t\tinitVal = bdArgs[m];\n\t\t\t\t\t\t// Create tag contextual parameter\n\t\t\t\t\t\ttagCtx.ctx[ctxPrm] = $sub._cp(\n\t\t\t\t\t\t\tdefaultCtx && initVal === undefined ? defaultCtx[ctxPrm]: initVal,\n\t\t\t\t\t\t\tinitVal !== undefined && argOrProp(tagCtx.params, key),\n\t\t\t\t\t\t\ttagCtx.view,\n\t\t\t\t\t\t\ttag._.bnd && {tag: tag, cvt: tag.convert, ind: m, tagElse: i}\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 ((mapDef = props.dataMap || tagDataMap) && (args.length || props.dataMap)) {\n\t\t\t\tthisMap = tagCtx.map;\n\t\t\t\tif (!thisMap || thisMap.src !== args[0] || isUpdate) {\n\t\t\t\t\tif (thisMap && thisMap.src) {\n\t\t\t\t\t\tthisMap.unmap(); // only called if observable map - not when only used in JsRender, e.g. by {{props}}\n\t\t\t\t\t}\n\t\t\t\t\tmapDef.map(args[0], tagCtx, thisMap, !tag._.bnd);\n\t\t\t\t\tthisMap = tagCtx.map;\n\t\t\t\t}\n\t\t\t\targs = [thisMap.tgt];\n\t\t\t}\n\n\t\t\titemRet = undefined;\n\t\t\tif (tag.render) {\n\t\t\t\titemRet = tag.render.apply(tag, args);\n\t\t\t\tif (parentView.linked && itemRet && !rWrappedInViewMarker.test(itemRet)) {\n\t\t\t\t\t// When a tag renders content from the render method, with data linking then we need to wrap with view markers, if absent,\n\t\t\t\t\t// to provide a contentView for the tag, which will correctly dispose bindings if deleted. The 'tmpl' for this view will\n\t\t\t\t\t// be a dumbed-down template which will always return the itemRet string (no matter what the data is). The itemRet string\n\t\t\t\t\t// is not compiled as template markup, so can include \"{{\" or \"}}\" without triggering syntax errors\n\t\t\t\t\ttmpl = { // 'Dumbed-down' template which always renders 'static' itemRet string\n\t\t\t\t\t\tlinks: []\n\t\t\t\t\t};\n\t\t\t\t\ttmpl.render = tmpl.fn = function() {\n\t\t\t\t\t\treturn itemRet;\n\t\t\t\t\t};\n\t\t\t\t\titemRet = renderWithViews(tmpl, parentView.data, undefined, true, parentView, undefined, undefined, tag);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!args.length) {\n\t\t\t\targs = [parentView]; // no arguments - (e.g. {{else}}) get data context from view.\n\t\t\t}\n\t\t\tif (itemRet === undefined) {\n\t\t\t\tcontentCtx = args[0]; // Default data context for wrapped block content is the first argument\n\t\t\t\tif (tag.contentCtx) { // Set tag.contentCtx to true, to inherit parent context, or to a function to provide alternate context.\n\t\t\t\t\tcontentCtx = tag.contentCtx === true ? parentView : tag.contentCtx(contentCtx);\n\t\t\t\t}\n\t\t\t\titemRet = tagCtx.render(contentCtx, true) || (isUpdate ? undefined : \"\");\n\t\t\t}\n\t\t\tret = ret\n\t\t\t\t? ret + (itemRet || \"\")\n\t\t\t\t: itemRet !== undefined\n\t\t\t\t\t? \"\" + itemRet\n\t\t\t\t\t: undefined; // If no return value from render, and no template/content tagCtx.render(...), return undefined\n\t\t}\n\t\ttag.rendering = tag.rendering.rndr; // Remove tag.rendering object (if this is outermost render call. (In case of nested calls)\n\t}\n\ttag.tagCtx = tagCtxs[0];\n\ttag.ctx = tag.tagCtx.ctx;\n\n\tif (tag._.noVws && tag.inline) {\n\t\t// inline tag with attr set to \"text\" will insert HTML-encoded content - as if it was element-based innerText\n\t\tret = attr === \"text\"\n\t\t\t? $converters.html(ret)\n\t\t\t: \"\";\n\t}\n\treturn boundTag && parentView._.onRender\n\t\t// Call onRender (used by JsViews if present, to add binding annotations around rendered content)\n\t\t? parentView._.onRender(ret, parentView, tag)\n\t\t: ret;\n}\n\n//=================\n// View constructor\n//=================\n\nfunction View(context, type, parentView, data, template, key, onRender, contentTmpl) {\n\t// Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)\n\tvar views, parentView_, tag, self_,\n\t\tself = this,\n\t\tisArray = type === \"array\";\n\t\t// If the data is an array, this is an 'array view' with a views array for each child 'item view'\n\t\t// If the data is not an array, this is an 'item view' with a views 'hash' object for any child nested views\n\n\tself.content = contentTmpl;\n\tself.views = isArray ? [] : {};\n\tself.data = data;\n\tself.tmpl = template;\n\tself_ = self._ = {\n\t\tkey: 0,\n\t\t// ._.useKey is non zero if is not an 'array view' (owning a data array). Use this as next key for adding to child views hash\n\t\tuseKey: isArray ? 0 : 1,\n\t\tid: \"\" + viewId++,\n\t\tonRender: onRender,\n\t\tbnds: {}\n\t};\n\tself.linked = !!onRender;\n\tself.type = type || \"top\";\n\tif (type) {\n\t\tself.cache = {_ct: $subSettings._cchCt}; // Used for caching results of computed properties and helpers (view.getCache)\n\t}\n\n\tif (!parentView || parentView.type === \"top\") {\n\t\t(self.ctx = context || {}).root = self.data;\n\t}\n\n\tif (self.parent = parentView) {\n\t\tself.root = parentView.root || self; // view whose parent is top view\n\t\tviews = parentView.views;\n\t\tparentView_ = parentView._;\n\t\tself.isTop = parentView_.scp; // Is top content view of a link(\"#container\", ...) call\n\t\tself.scope = (!context.tag || context.tag === parentView.ctx.tag) && !self.isTop && parentView.scope || self;\n\t\t// Scope for contextParams - closest non flow tag ancestor or root view\n\t\tif (parentView_.useKey) {\n\t\t\t// Parent is not an 'array view'. Add this view to its views object\n\t\t\t// self._key = is the key in the parent view hash\n\t\t\tviews[self_.key = \"_\" + parentView_.useKey++] = self;\n\t\t\tself.index = indexStr;\n\t\t\tself.getIndex = getNestedIndex;\n\t\t} else if (views.length === (self_.key = self.index = key)) { // Parent is an 'array view'. Add this view to its views array\n\t\t\tviews.push(self); // Adding to end of views array. (Using push when possible - better perf than splice)\n\t\t} else {\n\t\t\tviews.splice(key, 0, self); // Inserting in views array\n\t\t}\n\t\t// If no context was passed in, use parent context\n\t\t// If context was passed in, it should have been merged already with parent context\n\t\tself.ctx = context || parentView.ctx;\n\t} else if (type) {\n\t\tself.root = self; // view whose parent is top view\n\t}\n}\n\nView.prototype = {\n\tget: getView,\n\tgetIndex: getIndex,\n\tctxPrm: contextParameter,\n\tgetRsc: getResource,\n\t_getTmpl: getTemplate,\n\t_getOb: getPathObject,\n\tgetCache: function(key) { // Get cached value of computed value\n\t\tif ($subSettings._cchCt > this.cache._ct) {\n\t\t\tthis.cache = {_ct: $subSettings._cchCt};\n\t\t}\n\t\treturn this.cache[key] !== undefined ? this.cache[key] : (this.cache[key] = cpFnStore[key](this.data, this, $sub));\n\t},\n\t_is: \"view\"\n};\n\n//====================================================\n// Registration\n//====================================================\n\nfunction compileChildResources(parentTmpl) {\n\tvar storeName, storeNames, resources;\n\tfor (storeName in jsvStores) {\n\t\tstoreNames = storeName + \"s\";\n\t\tif (parentTmpl[storeNames]) {\n\t\t\tresources = parentTmpl[storeNames]; // Resources not yet compiled\n\t\t\tparentTmpl[storeNames] = {}; // Remove uncompiled resources\n\t\t\t$views[storeNames](resources, parentTmpl); // Add back in the compiled resources\n\t\t}\n\t}\n}\n\n//===============\n// compileTag\n//===============\n\nfunction compileTag(name, tagDef, parentTmpl) {\n\tvar tmpl, baseTag, prop,\n\t\tcompiledDef = new $sub._tg();\n\n\tfunction Tag() {\n\t\tvar tag = this;\n\t\ttag._ = {\n\t\t\tunlinked: true\n\t\t};\n\t\ttag.inline = true;\n\t\ttag.tagName = name;\n\t}\n\n\tif ($isFunction(tagDef)) {\n\t\t// Simple tag declared as function. No presenter instantation.\n\t\ttagDef = {\n\t\t\tdepends: tagDef.depends,\n\t\t\trender: tagDef\n\t\t};\n\t} else if (typeof tagDef === STRING) {\n\t\ttagDef = {template: tagDef};\n\t}\n\n\tif (baseTag = tagDef.baseTag) {\n\t\ttagDef.flow = !!tagDef.flow; // Set flow property, so defaults to false even if baseTag has flow=true\n\t\tbaseTag = typeof baseTag === STRING\n\t\t\t? (parentTmpl && parentTmpl.tags[baseTag] || $tags[baseTag])\n\t\t\t: baseTag;\n\t\tif (!baseTag) {\n\t\t\terror('baseTag: \"' + tagDef.baseTag + '\" not found');\n\t\t}\n\t\tcompiledDef = $extend(compiledDef, baseTag);\n\n\t\tfor (prop in tagDef) {\n\t\t\tcompiledDef[prop] = getMethod(baseTag[prop], tagDef[prop]);\n\t\t}\n\t} else {\n\t\tcompiledDef = $extend(compiledDef, tagDef);\n\t}\n\n\t// Tag declared as object, used as the prototype for tag instantiation (control/presenter)\n\tif ((tmpl = compiledDef.template) !== undefined) {\n\t\tcompiledDef.template = typeof tmpl === STRING ? ($templates[tmpl] || $templates(tmpl)) : tmpl;\n\t}\n\t(Tag.prototype = compiledDef).constructor = compiledDef._ctr = Tag;\n\n\tif (parentTmpl) {\n\t\tcompiledDef._parentTmpl = parentTmpl;\n\t}\n\treturn compiledDef;\n}\n\nfunction baseApply(args) {\n\t// In derived method (or handler declared declaratively as in {{:foo onChange=~fooChanged}} can call base method,\n\t// using this.baseApply(arguments) (Equivalent to this._superApply(arguments) in jQuery UI)\n\treturn this.base.apply(this, args);\n}\n\n//===============\n// compileTmpl\n//===============\n\nfunction compileTmpl(name, tmpl, parentTmpl, options) {\n\t// tmpl is either a template object, a selector for a template script block, or the name of a compiled template\n\n\t//==== nested functions ====\n\tfunction lookupTemplate(value) {\n\t\t// If value is of type string - treat as selector, or name of compiled template\n\t\t// Return the template object, if already compiled, or the markup string\n\t\tvar currentName, tmpl;\n\t\tif ((typeof value === STRING) || value.nodeType > 0 && (elem = value)) {\n\t\t\tif (!elem) {\n\t\t\t\tif (/^\\.?\\/[^\\\\:*?\"<>]*$/.test(value)) {\n\t\t\t\t\t// value=\"./some/file.html\" (or \"/some/file.html\")\n\t\t\t\t\t// If the template is not named, use \"./some/file.html\" as name.\n\t\t\t\t\tif (tmpl = $templates[name = name || value]) {\n\t\t\t\t\t\tvalue = tmpl;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// BROWSER-SPECIFIC CODE (not on Node.js):\n\t\t\t\t\t\t// Look for server-generated script block with id \"./some/file.html\"\n\t\t\t\t\t\telem = document.getElementById(value);\n\t\t\t\t\t}\n\t\t\t\t} else if (value.charAt(0) === \"#\") {\n\t\t\t\t\telem = document.getElementById(value.slice(1));\n\t\t\t\t} if (!elem && $.fn && !$sub.rTmpl.test(value)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\telem = $(value, document)[0]; // if jQuery is loaded, test for selector returning elements, and get first element\n\t\t\t\t\t} catch (e) {}\n\t\t\t\t}// END BROWSER-SPECIFIC CODE\n\t\t\t} //BROWSER-SPECIFIC CODE\n\t\t\tif (elem) {\n\t\t\t\tif (elem.tagName !== \"SCRIPT\") {\n\t\t\t\t\terror(value + \": Use script block, not \" + elem.tagName);\n\t\t\t\t}\n\t\t\t\tif (options) {\n\t\t\t\t\t// We will compile a new template using the markup in the script element\n\t\t\t\t\tvalue = elem.innerHTML;\n\t\t\t\t} else {\n\t\t\t\t\t// We will cache a single copy of the compiled template, and associate it with the name\n\t\t\t\t\t// (renaming from a previous name if there was one).\n\t\t\t\t\tcurrentName = elem.getAttribute(tmplAttr);\n\t\t\t\t\tif (currentName) {\n\t\t\t\t\t\tif (currentName !== jsvTmpl) {\n\t\t\t\t\t\t\tvalue = $templates[currentName];\n\t\t\t\t\t\t\tdelete $templates[currentName];\n\t\t\t\t\t\t} else if ($.fn) {\n\t\t\t\t\t\t\tvalue = $.data(elem)[jsvTmpl]; // Get cached compiled template\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!currentName || !value) { // Not yet compiled, or cached version lost\n\t\t\t\t\t\tname = name || ($.fn ? jsvTmpl : value);\n\t\t\t\t\t\tvalue = compileTmpl(name, elem.innerHTML, parentTmpl, options);\n\t\t\t\t\t}\n\t\t\t\t\tvalue.tmplName = name = name || currentName;\n\t\t\t\t\tif (name !== jsvTmpl) {\n\t\t\t\t\t\t$templates[name] = value;\n\t\t\t\t\t}\n\t\t\t\t\telem.setAttribute(tmplAttr, name);\n\t\t\t\t\tif ($.fn) {\n\t\t\t\t\t\t$.data(elem, jsvTmpl, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // END BROWSER-SPECIFIC CODE\n\t\t\telem = undefined;\n\t\t} else if (!value.fn) {\n\t\t\tvalue = undefined;\n\t\t\t// If value is not a string. HTML element, or compiled template, return undefined\n\t\t}\n\t\treturn value;\n\t}\n\n\tvar elem, compiledTmpl,\n\t\ttmplOrMarkup = tmpl = tmpl || \"\";\n\t$sub._html = $converters.html;\n\n\t//==== Compile the template ====\n\tif (options === 0) {\n\t\toptions = undefined;\n\t\ttmplOrMarkup = lookupTemplate(tmplOrMarkup); // Top-level compile so do a template lookup\n\t}\n\n\t// If options, then this was already compiled from a (script) element template declaration.\n\t// If not, then if tmpl is a template object, use it for options\n\toptions = options || (tmpl.markup\n\t\t? tmpl.bnds\n\t\t\t? $extend({}, tmpl)\n\t\t\t: tmpl\n\t\t: {}\n\t);\n\n\toptions.tmplName = options.tmplName || name || \"unnamed\";\n\tif (parentTmpl) {\n\t\toptions._parentTmpl = parentTmpl;\n\t}\n\t// If tmpl is not a markup string or a selector string, then it must be a template object\n\t// In that case, get it from the markup property of the object\n\tif (!tmplOrMarkup && tmpl.markup && (tmplOrMarkup = lookupTemplate(tmpl.markup)) && tmplOrMarkup.fn) {\n\t\t// If the string references a compiled template object, need to recompile to merge any modified options\n\t\ttmplOrMarkup = tmplOrMarkup.markup;\n\t}\n\tif (tmplOrMarkup !== undefined) {\n\t\tif (tmplOrMarkup.render || tmpl.render) {\n\t\t\t// tmpl is already compiled, so use it\n\t\t\tif (tmplOrMarkup.tmpls) {\n\t\t\t\tcompiledTmpl = tmplOrMarkup;\n\t\t\t}\n\t\t} else {\n\t\t\t// tmplOrMarkup is a markup string, not a compiled template\n\t\t\t// Create template object\n\t\t\ttmpl = tmplObject(tmplOrMarkup, options);\n\t\t\t// Compile to AST and then to compiled function\n\t\t\ttmplFn(tmplOrMarkup.replace(rEscapeQuotes, \"\\\\$&\"), tmpl);\n\t\t}\n\t\tif (!compiledTmpl) {\n\t\t\tcompiledTmpl = $extend(function() {\n\t\t\t\treturn compiledTmpl.render.apply(compiledTmpl, arguments);\n\t\t\t}, tmpl);\n\n\t\t\tcompileChildResources(compiledTmpl);\n\t\t}\n\t\treturn compiledTmpl;\n\t}\n}\n\n//==== /end of function compileTmpl ====\n\n//=================\n// compileViewModel\n//=================\n\nfunction getDefaultVal(defaultVal, data) {\n\treturn $isFunction(defaultVal)\n\t\t? defaultVal.call(data)\n\t\t: defaultVal;\n}\n\nfunction addParentRef(ob, ref, parent) {\n\tObject.defineProperty(ob, ref, {\n\t\tvalue: parent,\n\t\tconfigurable: true\n\t});\n}\n\nfunction compileViewModel(name, type) {\n\tvar i, constructor, parent,\n\t\tviewModels = this,\n\t\tgetters = type.getters,\n\t\textend = type.extend,\n\t\tid = type.id,\n\t\tproto = $.extend({\n\t\t\t_is: name || \"unnamed\",\n\t\t\tunmap: unmap,\n\t\t\tmerge: merge\n\t\t}, extend),\n\t\targs = \"\",\n\t\tcnstr = \"\",\n\t\tgetterCount = getters ? getters.length : 0,\n\t\t$observable = $.observable,\n\t\tgetterNames = {};\n\n\tfunction JsvVm(args) {\n\t\tconstructor.apply(this, args);\n\t}\n\n\tfunction vm() {\n\t\treturn new JsvVm(arguments);\n\t}\n\n\tfunction iterate(data, action) {\n\t\tvar getterType, defaultVal, prop, ob, parentRef,\n\t\t\tj = 0;\n\t\tfor (; j < getterCount; j++) {\n\t\t\tprop = getters[j];\n\t\t\tgetterType = undefined;\n\t\t\tif (typeof prop !== STRING) {\n\t\t\t\tgetterType = prop;\n\t\t\t\tprop = getterType.getter;\n\t\t\t\tparentRef = getterType.parentRef;\n\t\t\t}\n\t\t\tif ((ob = data[prop]) === undefined && getterType && (defaultVal = getterType.defaultVal) !== undefined) {\n\t\t\t\tob = getDefaultVal(defaultVal, data);\n\t\t\t}\n\t\t\taction(ob, getterType && viewModels[getterType.type], prop, parentRef);\n\t\t}\n\t}\n\n\tfunction map(data) {\n\t\tdata = typeof data === STRING\n\t\t\t? JSON.parse(data) // Accept JSON string\n\t\t\t: data; // or object/array\n\t\tvar l, prop, childOb, parentRef,\n\t\t\tj = 0,\n\t\t\tob = data,\n\t\t\tarr = [];\n\n\t\tif ($isArray(data)) {\n\t\t\tdata = data || [];\n\t\t\tl = data.length;\n\t\t\tfor (; j<l; j++) {\n\t\t\t\tarr.push(this.map(data[j]));\n\t\t\t}\n\t\t\tarr._is = name;\n\t\t\tarr.unmap = unmap;\n\t\t\tarr.merge = merge;\n\t\t\treturn arr;\n\t\t}\n\n\t\tif (data) {\n\t\t\titerate(data, function(ob, viewModel) {\n\t\t\t\tif (viewModel) { // Iterate to build getters arg array (value, or mapped value)\n\t\t\t\t\tob = viewModel.map(ob);\n\t\t\t\t}\n\t\t\t\tarr.push(ob);\n\t\t\t});\n\t\t\tob = this.apply(this, arr); // Instantiate this View Model, passing getters args array to constructor\n\t\t\tj = getterCount;\n\t\t\twhile (j--) {\n\t\t\t\tchildOb = arr[j];\n\t\t\t\tparentRef = getters[j].parentRef;\n\t\t\t\tif (parentRef && childOb && childOb.unmap) {\n\t\t\t\t\tif ($isArray(childOb)) {\n\t\t\t\t\t\tl = childOb.length;\n\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\taddParentRef(childOb[l], parentRef, ob);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\taddParentRef(childOb, parentRef, ob);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (prop in data) { // Copy over any other properties. that are not get/set properties\n\t\t\t\tif (prop !== $expando && !getterNames[prop]) {\n\t\t\t\t\tob[prop] = data[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ob;\n\t}\n\n\tfunction merge(data, parent, parentRef) {\n\t\tdata = typeof data === STRING\n\t\t\t? JSON.parse(data) // Accept JSON string\n\t\t\t: data; // or object/array\n\n\t\tvar j, l, m, prop, mod, found, assigned, ob, newModArr, childOb,\n\t\t\tk = 0,\n\t\t\tmodel = this;\n\n\t\tif ($isArray(model)) {\n\t\t\tassigned = {};\n\t\t\tnewModArr = [];\n\t\t\tl = data.length;\n\t\t\tm = model.length;\n\t\t\tfor (; k<l; k++) {\n\t\t\t\tob = data[k];\n\t\t\t\tfound = false;\n\t\t\t\tfor (j=0; j<m && !found; j++) {\n\t\t\t\t\tif (assigned[j]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tmod = model[j];\n\n\t\t\t\t\tif (id) {\n\t\t\t\t\t\tassigned[j] = found = typeof id === STRING\n\t\t\t\t\t\t? (ob[id] && (getterNames[id] ? mod[id]() : mod[id]) === ob[id])\n\t\t\t\t\t\t: id(mod, ob);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (found) {\n\t\t\t\t\tmod.merge(ob);\n\t\t\t\t\tnewModArr.push(mod);\n\t\t\t\t} else {\n\t\t\t\t\tnewModArr.push(childOb = vm.map(ob));\n\t\t\t\t\tif (parentRef) {\n\t\t\t\t\t\taddParentRef(childOb, parentRef, parent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($observable) {\n\t\t\t\t$observable(model).refresh(newModArr, true);\n\t\t\t} else {\n\t\t\t\tmodel.splice.apply(model, [0, model.length].concat(newModArr));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\titerate(data, function(ob, viewModel, getter, parentRef) {\n\t\t\tif (viewModel) {\n\t\t\t\tmodel[getter]().merge(ob, model, parentRef); // Update typed property\n\t\t\t} else if (model[getter]() !== ob) {\n\t\t\t\tmodel[getter](ob); // Update non-typed property\n\t\t\t}\n\t\t});\n\t\tfor (prop in data) {\n\t\t\tif (prop !== $expando && !getterNames[prop]) {\n\t\t\t\tmodel[prop] = data[prop];\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction unmap() {\n\t\tvar ob, prop, getterType, arr, value,\n\t\t\tk = 0,\n\t\t\tmodel = this;\n\n\t\tfunction unmapArray(modelArr) {\n\t\t\tvar arr = [],\n\t\t\t\ti = 0,\n\t\t\t\tl = modelArr.length;\n\t\t\tfor (; i<l; i++) {\n\t\t\t\tarr.push(modelArr[i].unmap());\n\t\t\t}\n\t\t\treturn arr;\n\t\t}\n\n\t\tif ($isArray(model)) {\n\t\t\treturn unmapArray(model);\n\t\t}\n\t\tob = {};\n\t\tfor (; k < getterCount; k++) {\n\t\t\tprop = getters[k];\n\t\t\tgetterType = undefined;\n\t\t\tif (typeof prop !== STRING) {\n\t\t\t\tgetterType = prop;\n\t\t\t\tprop = getterType.getter;\n\t\t\t}\n\t\t\tvalue = model[prop]();\n\t\t\tob[prop] = getterType && value && viewModels[getterType.type]\n\t\t\t\t? $isArray(value)\n\t\t\t\t\t? unmapArray(value)\n\t\t\t\t\t: value.unmap()\n\t\t\t\t: value;\n\t\t}\n\t\tfor (prop in model) {\n\t\t\tif (model.hasOwnProperty(prop) && (prop.charAt(0) !== \"_\" || !getterNames[prop.slice(1)]) && prop !== $expando && !$isFunction(model[prop])) {\n\t\t\t\tob[prop] = model[prop];\n\t\t\t}\n\t\t}\n\t\treturn ob;\n\t}\n\n\tJsvVm.prototype = proto;\n\n\tfor (i=0; i < getterCount; i++) {\n\t\t(function(getter) {\n\t\t\tgetter = getter.getter || getter;\n\t\t\tgetterNames[getter] = i+1;\n\t\t\tvar privField = \"_\" + getter;\n\n\t\t\targs += (args ? \",\" : \"\") + getter;\n\t\t\tcnstr += \"this.\" + privField + \" = \" + getter + \";\\n\";\n\t\t\tproto[getter] = proto[getter] || function(val) {\n\t\t\t\tif (!arguments.length) {\n\t\t\t\t\treturn this[privField]; // If there is no argument, use as a getter\n\t\t\t\t}\n\t\t\t\tif ($observable) {\n\t\t\t\t\t$observable(this).setProperty(getter, val);\n\t\t\t\t} else {\n\t\t\t\t\tthis[privField] = val;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif ($observable) {\n\t\t\t\tproto[getter].set = proto[getter].set || function(val) {\n\t\t\t\t\tthis[privField] = val; // Setter called by observable property change\n\t\t\t\t};\n\t\t\t}\n\t\t})(getters[i]);\n\t}\n\n\t// Constructor for new viewModel instance.\n\tcnstr = new Function(args, cnstr);\n\n\tconstructor = function() {\n\t\tcnstr.apply(this, arguments);\n\t\t// Pass additional parentRef str and parent obj to have a parentRef pointer on instance\n\t\tif (parent = arguments[getterCount + 1]) {\n\t\t\taddParentRef(this, arguments[getterCount], parent);\n\t\t}\n\t};\n\n\tconstructor.prototype = proto;\n\tproto.constructor = constructor;\n\n\tvm.map = map;\n\tvm.getters = getters;\n\tvm.extend = extend;\n\tvm.id = id;\n\treturn vm;\n}\n\nfunction tmplObject(markup, options) {\n\t// Template object constructor\n\tvar htmlTag,\n\t\twrapMap = $subSettingsAdvanced._wm || {}, // Only used in JsViews. Otherwise empty: {}\n\t\ttmpl = {\n\t\t\ttmpls: [],\n\t\t\tlinks: {}, // Compiled functions for link expressions\n\t\t\tbnds: [],\n\t\t\t_is: \"template\",\n\t\t\trender: renderContent\n\t\t};\n\n\tif (options) {\n\t\ttmpl = $extend(tmpl, options);\n\t}\n\n\ttmpl.markup = markup;\n\tif (!tmpl.htmlTag) {\n\t\t// Set tmpl.tag to the top-level HTML tag used in the template, if any...\n\t\thtmlTag = rFirstElem.exec(markup);\n\t\ttmpl.htmlTag = htmlTag ? htmlTag[1].toLowerCase() : \"\";\n\t}\n\thtmlTag = wrapMap[tmpl.htmlTag];\n\tif (htmlTag && htmlTag !== wrapMap.div) {\n\t\t// When using JsViews, we trim templates which are inserted into HTML contexts where text nodes are not rendered (i.e. not 'Phrasing Content').\n\t\t// Currently not trimmed for <li> tag. (Not worth adding perf cost)\n\t\ttmpl.markup = $.trim(tmpl.markup);\n\t}\n\n\treturn tmpl;\n}\n\n//==============\n// registerStore\n//==============\n\n/**\n* Internal. Register a store type (used for template, tags, helpers, converters)\n*/\nfunction registerStore(storeName, storeSettings) {\n\n/**\n* Generic store() function to register item, named item, or hash of items\n* Also used as hash to store the registered items\n* Used as implementation of $.templates(), $.views.templates(), $.views.tags(), $.views.helpers() and $.views.converters()\n*\n* @param {string|hash} name name - or selector, in case of $.templates(). Or hash of items\n* @param {any} [item] (e.g. markup for named template)\n* @param {template} [parentTmpl] For item being registered as private resource of template\n* @returns {any|$.views} item, e.g. compiled template - or $.views in case of registering hash of items\n*/\n\tfunction theStore(name, item, parentTmpl) {\n\t\t// The store is also the function used to add items to the store. e.g. $.templates, or $.views.tags\n\n\t\t// For store of name 'thing', Call as:\n\t\t// $.views.things(items[, parentTmpl]),\n\t\t// or $.views.things(name[, item, parentTmpl])\n\n\t\tvar compile, itemName, thisStore, cnt,\n\t\t\tonStore = $sub.onStore[storeName];\n\n\t\tif (name && typeof name === OBJECT && !name.nodeType && !name.markup && !name.getTgt && !(storeName === \"viewModel\" && name.getters || name.extend)) {\n\t\t\t// Call to $.views.things(items[, parentTmpl]),\n\n\t\t\t// Adding items to the store\n\t\t\t// If name is a hash, then item is parentTmpl. Iterate over hash and call store for key.\n\t\t\tfor (itemName in name) {\n\t\t\t\ttheStore(itemName, name[itemName], item);\n\t\t\t}\n\t\t\treturn item || $views;\n\t\t}\n\t\t// Adding a single unnamed item to the store\n\t\tif (name && typeof name !== STRING) { // name must be a string\n\t\t\tparentTmpl = item;\n\t\t\titem = name;\n\t\t\tname = undefined;\n\t\t}\n\t\tthisStore = parentTmpl\n\t\t\t? storeName === \"viewModel\"\n\t\t\t\t? parentTmpl\n\t\t\t\t: (parentTmpl[storeNames] = parentTmpl[storeNames] || {})\n\t\t\t: theStore;\n\t\tcompile = storeSettings.compile;\n\n\t\tif (item === undefined) {\n\t\t\titem = compile ? name : thisStore[name];\n\t\t\tname = undefined;\n\t\t}\n\t\tif (item === null) {\n\t\t\t// If item is null, delete this entry\n\t\t\tif (name) {\n\t\t\t\tdelete thisStore[name];\n\t\t\t}\n\t\t} else {\n\t\t\tif (compile) {\n\t\t\t\titem = compile.call(thisStore, name, item, parentTmpl, 0) || {};\n\t\t\t\titem._is = storeName; // Only do this for compiled objects (tags, templates...)\n\t\t\t}\n\t\t\tif (name) {\n\t\t\t\tthisStore[name] = item;\n\t\t\t}\n\t\t}\n\t\tif (onStore) {\n\t\t\t// e.g. JsViews integration\n\t\t\tonStore(name, item, parentTmpl, compile);\n\t\t}\n\t\treturn item;\n\t}\n\n\tvar storeNames = storeName + \"s\";\n\t$views[storeNames] = theStore;\n}\n\n/**\n* Add settings such as:\n* $.views.settings.allowCode(true)\n* @param {boolean} value\n* @returns {Settings}\n*\n* allowCode = $.views.settings.allowCode()\n* @returns {boolean}\n*/\nfunction addSetting(st) {\n\t$viewsSettings[st] = $viewsSettings[st] || function(value) {\n\t\treturn arguments.length\n\t\t\t? ($subSettings[st] = value, $viewsSettings)\n\t\t\t: $subSettings[st];\n\t};\n}\n\n//========================\n// dataMap for render only\n//========================\n\nfunction dataMap(mapDef) {\n\tfunction Map(source, options) {\n\t\tthis.tgt = mapDef.getTgt(source, options);\n\t\toptions.map = this;\n\t}\n\n\tif ($isFunction(mapDef)) {\n\t\t// Simple map declared as function\n\t\tmapDef = {\n\t\t\tgetTgt: mapDef\n\t\t};\n\t}\n\n\tif (mapDef.baseMap) {\n\t\tmapDef = $extend($extend({}, mapDef.baseMap), mapDef);\n\t}\n\n\tmapDef.map = function(source, options) {\n\t\treturn new Map(source, options);\n\t};\n\treturn mapDef;\n}\n\n//==============\n// renderContent\n//==============\n\n/** Render the template as a string, using the specified data and helpers/context\n* $(\"#tmpl\").render(), tmpl.render(), tagCtx.render(), $.render.namedTmpl()\n*\n* @param {any} data\n* @param {hash} [context] helpers or context\n* @param {boolean} [noIteration]\n* @param {View} [parentView] internal\n* @param {string} [key] internal\n* @param {function} [onRender] internal\n* @returns {string} rendered template internal\n*/\nfunction renderContent(data, context, noIteration, parentView, key, onRender) {\n\tvar i, l, tag, tmpl, tagCtx, isTopRenderCall, prevData, prevIndex,\n\t\tview = parentView,\n\t\tresult = \"\";\n\n\tif (context === true) {\n\t\tnoIteration = context; // passing boolean as second 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}\n\n\tif (tag = this.tag) {\n\t\t// This is a call from renderTag or tagCtx.render(...)\n\t\ttagCtx = this;\n\t\tview = view || tagCtx.view;\n\t\ttmpl = view._getTmpl(tag.template || tagCtx.tmpl);\n\t\tif (!arguments.length) {\n\t\t\tdata = tag.contentCtx && $isFunction(tag.contentCtx)\n\t\t\t\t? data = tag.contentCtx(data)\n\t\t\t\t: view; // Default data context for wrapped block content is the first argument\n\t\t}\n\t} else {\n\t\t// This is a template.render(...) call\n\t\ttmpl = this;\n\t}\n\n\tif (tmpl) {\n\t\tif (!parentView && data && data._is === \"view\") {\n\t\t\tview = data; // When passing in a view to render or link (and not passing in a parent view) use the passed-in view as parentView\n\t\t}\n\n\t\tif (view && data === view) {\n\t\t\t// Inherit the data from the parent view.\n\t\t\tdata = view.data;\n\t\t}\n\n\t\tisTopRenderCall = !view;\n\t\tisRenderCall = isRenderCall || isTopRenderCall;\n\t\tif (isTopRenderCall) {\n\t\t\t(context = context || {}).root = data; // Provide ~root as shortcut to top-level data.\n\t\t}\n\t\tif (!isRenderCall || $subSettingsAdvanced.useViews || tmpl.useViews || view && view !== topView) {\n\t\t\tresult = renderWithViews(tmpl, data, context, noIteration, view, key, onRender, tag);\n\t\t} else {\n\t\t\tif (view) { // In a block\n\t\t\t\tprevData = view.data;\n\t\t\t\tprevIndex = view.index;\n\t\t\t\tview.index = indexStr;\n\t\t\t} else {\n\t\t\t\tview = topView;\n\t\t\t\tprevData = view.data;\n\t\t\t\tview.data = data;\n\t\t\t\tview.ctx = context;\n\t\t\t}\n\t\t\tif ($isArray(data) && !noIteration) {\n\t\t\t\t// Create a view for the array, whose child views correspond to each data item. (Note: if key and parentView are passed in\n\t\t\t\t// along with parent view, treat as insert -e.g. from view.addViews - so parentView is already the view item for array)\n\t\t\t\tfor (i = 0, l = data.length; i < l; i++) {\n\t\t\t\t\tview.index = i;\n\t\t\t\t\tview.data = data[i];\n\t\t\t\t\tresult += tmpl.fn(data[i], view, $sub);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tview.data = data;\n\t\t\t\tresult += tmpl.fn(data, view, $sub);\n\t\t\t}\n\t\t\tview.data = prevData;\n\t\t\tview.index = prevIndex;\n\t\t}\n\t\tif (isTopRenderCall) {\n\t\t\tisRenderCall = undefined;\n\t\t}\n\t}\n\treturn result;\n}\n\nfunction renderWithViews(tmpl, data, context, noIteration, view, key, onRender, tag) {\n\t// Render template against data as a tree of subviews (nested rendered template instances), or as a string (top-level template).\n\t// If the data is the parent view, treat as noIteration, re-render with the same data context.\n\t// tmpl can be a string (e.g. rendered by a tag.render() method), or a compiled template.\n\tvar i, l, newView, childView, itemResult, swapContent, contentTmpl, outerOnRender, tmplName, itemVar, newCtx, tagCtx, noLinking,\n\t\tresult = \"\";\n\n\tif (tag) {\n\t\t// This is a call from renderTag or tagCtx.render(...)\n\t\ttmplName = tag.tagName;\n\t\ttagCtx = tag.tagCtx;\n\t\tcontext = context ? extendCtx(context, tag.ctx) : tag.ctx;\n\n\t\tif (tmpl === view.content) { // {{xxx tmpl=#content}}\n\t\t\tcontentTmpl = tmpl !== view.ctx._wrp // We are rendering the #content\n\t\t\t\t? view.ctx._wrp // #content was the tagCtx.props.tmpl wrapper of the block content - so within this view, #content will now be the view.ctx._wrp block content\n\t\t\t\t: undefined; // #content was the view.ctx._wrp block content - so within this view, there is no longer any #content to wrap.\n\t\t} else if (tmpl !== tagCtx.content) {\n\t\t\tif (tmpl === tag.template) { // Rendering {{tag}} tag.template, replacing block content.\n\t\t\t\tcontentTmpl = tagCtx.tmpl; // Set #content to block content (or wrapped block content if tagCtx.props.tmpl is set)\n\t\t\t\tcontext._wrp = tagCtx.content; // Pass wrapped block content to nested views\n\t\t\t} else { // Rendering tagCtx.props.tmpl wrapper\n\t\t\t\tcontentTmpl = tagCtx.content || view.content; // Set #content to wrapped block content\n\t\t\t}\n\t\t} else {\n\t\t\tcontentTmpl = view.content; // Nested views inherit same wrapped #content property\n\t\t}\n\n\t\tif (tagCtx.props.link === false) {\n\t\t\t// link=false setting on block tag\n\t\t\t// We will override inherited value of link by the explicit setting link=false taken from props\n\t\t\t// The child views of an unlinked view are also unlinked. So setting child back to true will not have any effect.\n\t\t\tcontext = context || {};\n\t\t\tcontext.link = false;\n\t\t}\n\t}\n\n\tif (view) {\n\t\tonRender = onRender || view._.onRender;\n\t\tnoLinking = context && context.link === false;\n\n\t\tif (noLinking && view._.nl) {\n\t\t\tonRender = undefined;\n\t\t}\n\n\t\tcontext = extendCtx(context, view.ctx);\n\t\ttagCtx = !tag && view.tag\n\t\t\t? view.tag.tagCtxs[view.tagElse]\n\t\t\t: tagCtx;\n\t}\n\n\tif (itemVar = tagCtx && tagCtx.props.itemVar) {\n\t\tif (itemVar[0] !== \"~\") {\n\t\t\tsyntaxError(\"Use itemVar='~myItem'\");\n\t\t}\n\t\titemVar = itemVar.slice(1);\n\t}\n\n\tif (key === true) {\n\t\tswapContent = true;\n\t\tkey = 0;\n\t}\n\n\t// If link===false, do not call onRender, so no data-linking marker nodes\n\tif (onRender && tag && tag._.noVws) {\n\t\tonRender = undefined;\n\t}\n\touterOnRender = onRender;\n\tif (onRender === true) {\n\t\t// Used by view.refresh(). Don't create a new wrapper view.\n\t\touterOnRender = undefined;\n\t\tonRender = view._.onRender;\n\t}\n\t// Set additional context on views created here, (as modified context inherited from the parent, and to be inherited by child views)\n\tcontext = tmpl.helpers\n\t\t? extendCtx(tmpl.helpers, context)\n\t\t: context;\n\n\tnewCtx = context;\n\tif ($isArray(data) && !noIteration) {\n\t\t// Create a view for the array, whose child views correspond to each data item. (Note: if key and view are passed in\n\t\t// along with parent view, treat as insert -e.g. from view.addViews - so view is already the view item for array)\n\t\tnewView = swapContent\n\t\t\t? view\n\t\t\t: (key !== undefined && view)\n\t\t\t\t|| new View(context, \"array\", view, data, tmpl, key, onRender, contentTmpl);\n\t\tnewView._.nl= noLinking;\n\t\tif (view && view._.useKey) {\n\t\t\t// Parent is not an 'array view'\n\t\t\tnewView._.bnd = !tag || tag._.bnd && tag; // For array views that are data bound for collection change events, set the\n\t\t\t// view._.bnd property to true for top-level link() or data-link=\"{for}\", or to the tag instance for a data-bound tag, e.g. {^{for ...}}\n\t\t\tnewView.tag = tag;\n\t\t}\n\t\tfor (i = 0, l = data.length; i < l; i++) {\n\t\t\t// Create a view for each data item.\n\t\t\tchildView = new View(newCtx, \"item\", newView, data[i], tmpl, (key || 0) + i, onRender, newView.content);\n\t\t\tif (itemVar) {\n\t\t\t\t(childView.ctx = $extend({}, newCtx))[itemVar] = $sub._cp(data[i], \"#data\", childView);\n\t\t\t}\n\t\t\titemResult = tmpl.fn(data[i], childView, $sub);\n\t\t\tresult += newView._.onRender ? newView._.onRender(itemResult, childView) : itemResult;\n\t\t}\n\t} else {\n\t\t// Create a view for singleton data object. The type of the view will be the tag name, e.g. \"if\" or \"mytag\" except for\n\t\t// \"item\", \"array\" and \"data\" views. A \"data\" view is from programmatic render(object) against a 'singleton'.\n\t\tnewView = swapContent ? view : new View(newCtx, tmplName || \"data\", view, data, tmpl, key, onRender, contentTmpl);\n\n\t\tif (itemVar) {\n\t\t\t(newView.ctx = $extend({}, newCtx))[itemVar] = $sub._cp(data, \"#data\", newView);\n\t\t}\n\n\t\tnewView.tag = tag;\n\t\tnewView._.nl = noLinking;\n\t\tresult += tmpl.fn(data, newView, $sub);\n\t}\n\tif (tag) {\n\t\tnewView.tagElse = tagCtx.index;\n\t\ttagCtx.contentView = newView;\n\t}\n\treturn outerOnRender ? outerOnRender(result, newView) : result;\n}\n\n//===========================\n// Build and compile template\n//===========================\n\n// Generate a reusable function that will serve to render a template against data\n// (Compile AST then build template function)\n\nfunction onRenderError(e, view, fallback) {\n\tvar message = fallback !== undefined\n\t\t? $isFunction(fallback)\n\t\t\t? fallback.call(view.data, e, view)\n\t\t\t: fallback || \"\"\n\t\t: \"{Error: \" + (e.message||e) + \"}\";\n\n\tif ($subSettings.onError && (fallback = $subSettings.onError.call(view.data, e, fallback && message, view)) !== undefined) {\n\t\tmessage = fallback; // There is a settings.debugMode(handler) onError override. Call it, and use return value (if any) to replace message\n\t}\n\treturn view && !view._lc ? $converters.html(message) : message; // For data-link=\\\"{... onError=...}\"... See onDataLinkedTagChange\n}\n\nfunction error(message) {\n\tthrow new $sub.Err(message);\n}\n\nfunction syntaxError(message) {\n\terror(\"Syntax error\\n\" + message);\n}\n\nfunction tmplFn(markup, tmpl, isLinkExpr, convertBack, hasElse) {\n\t// Compile markup to AST (abtract syntax tree) then build the template function code from the AST nodes\n\t// Used for compiling templates, and also by JsViews to build functions for data link expressions\n\n\t//==== nested functions ====\n\tfunction pushprecedingContent(shift) {\n\t\tshift -= loc;\n\t\tif (shift) {\n\t\t\tcontent.push(markup.substr(loc, shift).replace(rNewLine, \"\\\\n\"));\n\t\t}\n\t}\n\n\tfunction blockTagCheck(tagName, block) {\n\t\tif (tagName) {\n\t\t\ttagName += '}}';\n\t\t\t//\t\t\t'{{include}} block has {{/for}} with no open {{for}}'\n\t\t\tsyntaxError((\n\t\t\t\tblock\n\t\t\t\t\t? '{{' + block + '}} block has {{/' + tagName + ' without {{' + tagName\n\t\t\t\t\t: 'Unmatched or missing {{/' + tagName) + ', in template:\\n' + markup);\n\t\t}\n\t}\n\n\tfunction parseTag(all, bind, tagName, converter, colon, html, codeTag, params, slash, bind2, closeBlock, index) {\n/*\n\n bind tagName cvt cln html code params slash bind2 closeBlk comment\n/(?:{(\\^)?{(?:(\\w+(?=[\\/\\s}]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^}]|}(?!}))*?)(\\/)?|{(\\^)?{(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))}}/g\n\n(?:\n {(\\^)?{ bind\n (?:\n (\\w+ tagName\n (?=[\\/\\s}])\n )\n |\n (\\w+)?(:) converter colon\n |\n (>) html\n |\n (\\*) codeTag\n )\n \\s*\n ( params\n (?:[^}]|}(?!}))*?\n )\n (\\/)? slash\n |\n {(\\^)?{ bind2\n (?:\n (?:\\/(\\w+))\\s* closeBlock\n |\n !--[\\s\\S]*?-- comment\n )\n)\n}}/g\n\n*/\n\t\tif (codeTag && bind || slash && !tagName || params && params.slice(-1) === \":\" || bind2) {\n\t\t\tsyntaxError(all);\n\t\t}\n\n\t\t// Build abstract syntax tree (AST): [tagName, converter, params, content, hash, bindings, contentMarkup]\n\t\tif (html) {\n\t\t\tcolon = \":\";\n\t\t\tconverter = HTML;\n\t\t}\n\t\tslash = slash || isLinkExpr && !hasElse;\n\n\t\tvar late, openTagName, isLateOb,\n\t\t\tpathBindings = (bind || isLinkExpr) && [[]], // pathBindings is an array of arrays for arg bindings and a hash of arrays for prop bindings\n\t\t\tprops = \"\",\n\t\t\targs = \"\",\n\t\t\tctxProps = \"\",\n\t\t\tparamsArgs = \"\",\n\t\t\tparamsProps = \"\",\n\t\t\tparamsCtxProps = \"\",\n\t\t\tonError = \"\",\n\t\t\tuseTrigger = \"\",\n\t\t\t// Block tag if not self-closing and not {{:}} or {{>}} (special case) and not a data-link expression\n\t\t\tblock = !slash && !colon;\n\n\t\t//==== nested helper function ====\n\t\ttagName = tagName || (params = params || \"#data\", colon); // {{:}} is equivalent to {{:#data}}\n\t\tpushprecedingContent(index);\n\t\tloc = index + all.length; // location marker - parsed up to here\n\t\tif (codeTag) {\n\t\t\tif (allowCode) {\n\t\t\t\tcontent.push([\"*\", \"\\n\" + params.replace(/^:/, \"ret+= \").replace(rUnescapeQuotes, \"$1\") + \";\\n\"]);\n\t\t\t}\n\t\t} else if (tagName) {\n\t\t\tif (tagName === \"else\") {\n\t\t\t\tif (rTestElseIf.test(params)) {\n\t\t\t\t\tsyntaxError('For \"{{else if expr}}\" use \"{{else expr}}\"');\n\t\t\t\t}\n\t\t\t\tpathBindings = current[9] && [[]];\n\t\t\t\tcurrent[10] = markup.substring(current[10], index); // contentMarkup for block tag\n\t\t\t\topenTagName = current[11] || current[0] || syntaxError(\"Mismatched: \" + all);\n\t\t\t\t// current[0] is tagName, but for {{else}} nodes, current[11] is tagName of preceding open tag\n\t\t\t\tcurrent = stack.pop();\n\t\t\t\tcontent = current[2];\n\t\t\t\tblock = true;\n\t\t\t}\n\t\t\tif (params) {\n\t\t\t\t// remove newlines from the params string, to avoid compiled code errors for unterminated strings\n\t\t\t\tparseParams(params.replace(rNewLine, \" \"), pathBindings, tmpl, isLinkExpr)\n\t\t\t\t\t.replace(rBuildHash, function(all, onerror, isCtxPrm, key, keyToken, keyValue, arg, param) {\n\t\t\t\t\t\tif (key === \"this:\") {\n\t\t\t\t\t\t\tkeyValue = \"undefined\"; // this=some.path is always a to parameter (one-way), so don't need to compile/evaluate some.path initialization\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (param) {\n\t\t\t\t\t\t\tisLateOb = isLateOb || param[0] === \"@\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tkey = \"'\" + keyToken + \"':\";\n\t\t\t\t\t\tif (arg) {\n\t\t\t\t\t\t\targs += isCtxPrm + keyValue + \",\";\n\t\t\t\t\t\t\tparamsArgs += \"'\" + param + \"',\";\n\t\t\t\t\t\t} else if (isCtxPrm) { // Contextual parameter, ~foo=expr\n\t\t\t\t\t\t\tctxProps += key + 'j._cp(' + keyValue + ',\"' + param + '\",view),';\n\t\t\t\t\t\t\t// Compiled code for evaluating tagCtx on a tag will have: ctx:{'foo':j._cp(compiledExpr, \"expr\", view)}\n\t\t\t\t\t\t\tparamsCtxProps += key + \"'\" + param + \"',\";\n\t\t\t\t\t\t} else if (onerror) {\n\t\t\t\t\t\t\tonError += keyValue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (keyToken === \"trigger\") {\n\t\t\t\t\t\t\t\tuseTrigger += keyValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keyToken === \"lateRender\") {\n\t\t\t\t\t\t\t\tlate = param !== \"false\"; // Render after first pass\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprops += key + keyValue + \",\";\n\t\t\t\t\t\t\tparamsProps += key + \"'\" + param + \"',\";\n\t\t\t\t\t\t\thasHandlers = hasHandlers || rHasHandlers.test(keyToken);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t}).slice(0, -1);\n\t\t\t}\n\n\t\t\tif (pathBindings && pathBindings[0]) {\n\t\t\t\tpathBindings.pop(); // Remove the binding that was prepared for next arg. (There is always an extra one ready).\n\t\t\t}\n\n\t\t\tnewNode = [\n\t\t\t\t\ttagName,\n\t\t\t\t\tconverter || !!convertBack || hasHandlers || \"\",\n\t\t\t\t\tblock && [],\n\t\t\t\t\tparsedParam(paramsArgs || (tagName === \":\" ? \"'#data',\" : \"\"), paramsProps, paramsCtxProps), // {{:}} equivalent to {{:#data}}\n\t\t\t\t\tparsedParam(args || (tagName === \":\" ? \"data,\" : \"\"), props, ctxProps),\n\t\t\t\t\tonError,\n\t\t\t\t\tuseTrigger,\n\t\t\t\t\tlate,\n\t\t\t\t\tisLateOb,\n\t\t\t\t\tpathBindings || 0\n\t\t\t\t];\n\t\t\tcontent.push(newNode);\n\t\t\tif (block) {\n\t\t\t\tstack.push(current);\n\t\t\t\tcurrent = newNode;\n\t\t\t\tcurrent[10] = loc; // Store current location of open tag, to be able to add contentMarkup when we reach closing tag\n\t\t\t\tcurrent[11] = openTagName; // Used for checking syntax (matching close tag)\n\t\t\t}\n\t\t} else if (closeBlock) {\n\t\t\tblockTagCheck(closeBlock !== current[0] && closeBlock !== current[11] && closeBlock, current[0]); // Check matching close tag name\n\t\t\tcurrent[10] = markup.substring(current[10], index); // contentMarkup for block tag\n\t\t\tcurrent = stack.pop();\n\t\t}\n\t\tblockTagCheck(!current && closeBlock);\n\t\tcontent = current[2];\n\t}\n\t//==== /end of nested functions ====\n\n\tvar i, result, newNode, hasHandlers, bindings,\n\t\tallowCode = $subSettings.allowCode || tmpl && tmpl.allowCode\n\t\t\t|| $viewsSettings.allowCode === true, // include direct setting of settings.allowCode true for backward compat only\n\t\tastTop = [],\n\t\tloc = 0,\n\t\tstack = [],\n\t\tcontent = astTop,\n\t\tcurrent = [,,astTop];\n\n\tif (allowCode && tmpl._is) {\n\t\ttmpl.allowCode = allowCode;\n\t}\n\n//TODO\tresult = tmplFnsCache[markup]; // Only cache if template is not named and markup length < ...,\n//and there are no bindings or subtemplates?? Consider standard optimization for data-link=\"a.b.c\"\n//\t\tif (result) {\n//\t\t\ttmpl.fn = result;\n//\t\t} else {\n\n//\t\tresult = markup;\n\tif (isLinkExpr) {\n\t\tif (convertBack !== undefined) {\n\t\t\tmarkup = markup.slice(0, -convertBack.length - 2) + delimCloseChar0;\n\t\t}\n\t\tmarkup = delimOpenChar0 + markup + delimCloseChar1;\n\t}\n\n\tblockTagCheck(stack[0] && stack[0][2].pop()[0]);\n\t// Build the AST (abstract syntax tree) under astTop\n\tmarkup.replace(rTag, parseTag);\n\n\tpushprecedingContent(markup.length);\n\n\tif (loc = astTop[astTop.length - 1]) {\n\t\tblockTagCheck(typeof loc !== STRING && (+loc[10] === loc[10]) && loc[0]);\n\t}\n//\t\t\tresult = tmplFnsCache[markup] = buildCode(astTop, tmpl);\n//\t\t}\n\n\tif (isLinkExpr) {\n\t\tresult = buildCode(astTop, markup, isLinkExpr);\n\t\tbindings = [];\n\t\ti = astTop.length;\n\t\twhile (i--) {\n\t\t\tbindings.unshift(astTop[i][9]); // With data-link expressions, pathBindings array for tagCtx[i] is astTop[i][9]\n\t\t}\n\t\tsetPaths(result, bindings);\n\t} else {\n\t\tresult = buildCode(astTop, tmpl);\n\t}\n\treturn result;\n}\n\nfunction setPaths(fn, pathsArr) {\n\tvar key, paths,\n\t\ti = 0,\n\t\tl = pathsArr.length;\n\tfn.deps = [];\n\tfn.paths = []; // The array of path binding (array/dictionary)s for each tag/else block's args and props\n\tfor (; i < l; i++) {\n\t\tfn.paths.push(paths = pathsArr[i]);\n\t\tfor (key in paths) {\n\t\t\tif (key !== \"_jsvto\" && paths.hasOwnProperty(key) && paths[key].length && !paths[key].skp) {\n\t\t\t\tfn.deps = fn.deps.concat(paths[key]); // deps is the concatenation of the paths arrays for the different bindings\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction parsedParam(args, props, ctx) {\n\treturn [args.slice(0, -1), props.slice(0, -1), ctx.slice(0, -1)];\n}\n\nfunction paramStructure(paramCode, paramVals) {\n\treturn '\\n\\tparams:{args:[' + paramCode[0] + '],\\n\\tprops:{' + paramCode[1] + '}'\n\t\t+ (paramCode[2] ? ',\\n\\tctx:{' + paramCode[2] + '}' : \"\")\n\t\t+ '},\\n\\targs:[' + paramVals[0] + '],\\n\\tprops:{' + paramVals[1] + '}'\n\t\t+ (paramVals[2] ? ',\\n\\tctx:{' + paramVals[2] + '}' : \"\");\n}\n\nfunction parseParams(params, pathBindings, tmpl, isLinkExpr) {\n\n\tfunction parseTokens(all, lftPrn0, lftPrn, bound, path, operator, err, eq, path2, late, prn,\n\t\t\t\t\t\t\t\t\t\t\t\tcomma, lftPrn2, apos, quot, rtPrn, rtPrnDot, prn2, space, index, full) {\n\t// /(\\()(?=\\s*\\()|(?:([([])\\s*)?(?:(\\^?)(~?[\\w$.^]+)?\\s*((\\+\\+|--)|\\+|-|~(?![\\w$])|&&|\\|\\||===|!==|==|!=|<=|>=|[<>%*:?\\/]|(=))\\s*|(!*?(@)?[#~]?[\\w$.^]+)([([])?)|(,\\s*)|(?:(\\()\\s*)?\\\\?(?:(')|(\"))|(?:\\s*(([)\\]])(?=[.^]|\\s*$|[^([])|[)\\]])([([]?))|(\\s+)/g,\n\t//lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space\n\t// (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space\n\n\t\tfunction parsePath(allPath, not, object, helper, view, viewProperty, pathTokens, leafToken) {\n\t\t\t// /^(!*?)(?:null|true|false|\\d[\\d.]*|([\\w$]+|\\.|~([\\w$]+)|#(view|([\\w$]+))?)([\\w$.^]*?)(?:[.[^]([\\w$]+)\\]?)?)$/g,\n\t\t\t// not object helper view viewProperty pathTokens leafToken\n\t\t\tsubPath = object === \".\";\n\t\t\tif (object) {\n\t\t\t\tpath = path.slice(not.length);\n\t\t\t\tif (/^\\.?constructor$/.test(leafToken||path)) {\n\t\t\t\t\tsyntaxError(allPath);\n\t\t\t\t}\n\t\t\t\tif (!subPath) {\n\t\t\t\t\tallPath = (late // late path @a.b.c: not throw on 'property of undefined' if a undefined, and will use _getOb() after linking to resolve late.\n\t\t\t\t\t\t\t? (isLinkExpr ? '' : '(ltOb.lt=ltOb.lt||') + '(ob='\n\t\t\t\t\t\t\t: \"\"\n\t\t\t\t\t\t)\n\t\t\t\t\t\t+ (helper\n\t\t\t\t\t\t\t? 'view.ctxPrm(\"' + helper + '\")'\n\t\t\t\t\t\t\t: view\n\t\t\t\t\t\t\t\t? \"view\"\n\t\t\t\t\t\t\t\t: \"data\")\n\t\t\t\t\t\t+ (late\n\t\t\t\t\t\t\t? ')===undefined' + (isLinkExpr ? '' : ')') + '?\"\":view._getOb(ob,\"'\n\t\t\t\t\t\t\t: \"\"\n\t\t\t\t\t\t)\n\t\t\t\t\t\t+ (leafToken\n\t\t\t\t\t\t\t? (viewProperty\n\t\t\t\t\t\t\t\t? \".\" + viewProperty\n\t\t\t\t\t\t\t\t: helper\n\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t: (view ? \"\" : \".\" + object)\n\t\t\t\t\t\t\t\t) + (pathTokens || \"\")\n\t\t\t\t\t\t\t: (leafToken = helper ? \"\" : view ? viewProperty || \"\" : object, \"\"));\n\t\t\t\t\tallPath = allPath + (leafToken ? \".\" + leafToken : \"\");\n\n\t\t\t\t\tallPath = not + (allPath.slice(0, 9) === \"view.data\"\n\t\t\t\t\t\t? allPath.slice(5) // convert #view.data... to data...\n\t\t\t\t\t\t: allPath)\n\t\t\t\t\t+ (late\n\t\t\t\t\t\t\t? (isLinkExpr ? '\"': '\",ltOb') + (prn ? ',1)':')')\n\t\t\t\t\t\t\t: \"\"\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (bindings) {\n\t\t\t\t\tbinds = named === \"_linkTo\" ? (bindto = pathBindings._jsvto = pathBindings._jsvto || []) : bndCtx.bd;\n\t\t\t\t\tif (theOb = subPath && binds[binds.length-1]) {\n\t\t\t\t\t\tif (theOb._cpfn) { // Computed property exprOb\n\t\t\t\t\t\t\twhile (theOb.sb) {\n\t\t\t\t\t\t\t\ttheOb = theOb.sb;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (theOb.prm) {\n\t\t\t\t\t\t\t\tif (theOb.bnd) {\n\t\t\t\t\t\t\t\t\tpath = \"^\" + path.slice(1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttheOb.sb = path;\n\t\t\t\t\t\t\t\ttheOb.bnd = theOb.bnd || path[0] === \"^\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbinds.push(path);\n\t\t\t\t\t}\n\t\t\t\t\tif (prn && !subPath) {\n\t\t\t\t\t\tpathStart[fnDp] = ind;\n\t\t\t\t\t\tcompiledPathStart[fnDp] = compiledPath[fnDp].length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn allPath;\n\t\t}\n\n\t\t//bound = bindings && bound;\n\t\tif (bound && !eq) {\n\t\t\tpath = bound + path; // e.g. some.fn(...)^some.path - so here path is \"^some.path\"\n\t\t}\n\t\toperator = operator || \"\";\n\t\tlftPrn2 = lftPrn2 || \"\";\n\t\tlftPrn = lftPrn || lftPrn0 || lftPrn2;\n\t\tpath = path || path2;\n\n\t\tif (late && (late = !/\\)|]/.test(full[index-1]))) {\n\t\t\tpath = path.slice(1).split(\".\").join(\"^\"); // Late path @z.b.c. Use \"^\" rather than \".\" to ensure that deep binding will be used\n\t\t}\n\t\t// Could do this - but not worth perf cost?? :-\n\t\t// if (!path.lastIndexOf(\"#data.\", 0)) { path = path.slice(6); } // If path starts with \"#data.\", remove that.\n\t\tprn = prn || prn2 || \"\";\n\t\tvar expr, binds, theOb, newOb, subPath, lftPrnFCall, ret,\n\t\t\tind = index;\n\n\t\tif (!aposed && !quoted) {\n\t\t\tif (err) {\n\t\t\t\tsyntaxError(params);\n\t\t\t}\n\t\t\tif (rtPrnDot && bindings) {\n\t\t\t\t// This is a binding to a path in which an object is returned by a helper/data function/expression, e.g. foo()^x.y or (a?b:c)^x.y\n\t\t\t\t// We create a compiled function to get the object instance (which will be called when the dependent data of the subexpression changes,\n\t\t\t\t// to return the new object, and trigger re-binding of the subsequent path)\n\t\t\t\texpr = pathStart[fnDp-1];\n\t\t\t\tif (full.length - 1 > ind - (expr || 0)) { // We need to compile a subexpression\n\t\t\t\t\texpr = $.trim(full.slice(expr, ind + all.length));\n\t\t\t\t\tbinds = bindto || bndStack[fnDp-1].bd;\n\t\t\t\t\t// Insert exprOb object, to be used during binding to return the computed object\n\t\t\t\t\ttheOb = binds[binds.length-1];\n\t\t\t\t\tif (theOb && theOb.prm) {\n\t\t\t\t\t\twhile (theOb.sb && theOb.sb.prm) {\n\t\t\t\t\t\t\ttheOb = theOb.sb;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewOb = theOb.sb = {path: theOb.sb, bnd: theOb.bnd};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbinds.push(newOb = {path: binds.pop()}); // Insert exprOb object, to be used during binding to return the computed object\n\t\t\t\t\t}\n\t\t\t\t\tif (theOb && theOb.sb === newOb) {\n\t\t\t\t\t\tcompiledPath[fnDp] = compiledPath[fnDp-1].slice(theOb._cpPthSt) + compiledPath[fnDp];\n\t\t\t\t\t\tcompiledPath[fnDp-1] = compiledPath[fnDp-1].slice(0, theOb._cpPthSt);\n\t\t\t\t\t}\n\t\t\t\t\tnewOb._cpPthSt = compiledPathStart[fnDp-1];\n\t\t\t\t\tnewOb._cpKey = expr;\n\n\t\t\t\t\tcompiledPath[fnDp] += full.slice(prevIndex, index);\n\t\t\t\t\tprevIndex = index;\n\n\t\t\t\t\tnewOb._cpfn = cpFnStore[expr] = cpFnStore[expr] || // Compiled function for computed value: get from store, or compile and store\n\t\t\t\t\t\tnew Function(\"data,view,j\", // Compiled function for computed value in template\n\t\t\t\t\t\"//\" + expr + \"\\nvar v;\\nreturn ((v=\" + compiledPath[fnDp] + (rtPrn === \"]\" ? \")]\" : rtPrn) + \")!=null?v:null);\");\n\n\t\t\t\t\tcompiledPath[fnDp-1] += (fnCall[prnDp] && $subSettingsAdvanced.cache ? \"view.getCache(\\\"\" + expr.replace(rEscapeQuotes, \"\\\\$&\") + \"\\\"\" : compiledPath[fnDp]);\n\n\t\t\t\t\tnewOb.prm = bndCtx.bd;\n\t\t\t\t\tnewOb.bnd = newOb.bnd || newOb.path && newOb.path.indexOf(\"^\") >= 0;\n\t\t\t\t}\n\t\t\t\tcompiledPath[fnDp] = \"\";\n\t\t\t}\n\t\t\tif (prn === \"[\") {\n\t\t\t\tprn = \"[j._sq(\";\n\t\t\t}\n\t\t\tif (lftPrn === \"[\") {\n\t\t\t\tlftPrn = \"[j._sq(\";\n\t\t\t}\n\t\t}\n\t\tret = (aposed\n\t\t\t// within single-quoted string\n\t\t\t? (aposed = !apos, (aposed ? all : lftPrn2 + '\"'))\n\t\t\t: quoted\n\t\t\t// within double-quoted string\n\t\t\t\t? (quoted = !quot, (quoted ? all : lftPrn2 + '\"'))\n\t\t\t\t:\n\t\t\t(\n\t\t\t\t(lftPrn\n\t\t\t\t\t? (\n\t\t\t\t\t\tprnStack[++prnDp] = true,\n\t\t\t\t\t\tprnInd[prnDp] = 0,\n\t\t\t\t\t\tbindings && (\n\t\t\t\t\t\t\tpathStart[fnDp++] = ind++,\n\t\t\t\t\t\t\tbndCtx = bndStack[fnDp] = {bd: []},\n\t\t\t\t\t\t\tcompiledPath[fnDp] = \"\",\n\t\t\t\t\t\t\tcompiledPathStart[fnDp] = 1\n\t\t\t\t\t\t),\n\t\t\t\t\t\tlftPrn) // Left paren, (not a function call paren)\n\t\t\t\t\t: \"\")\n\t\t\t\t+ (space\n\t\t\t\t\t? (prnDp\n\t\t\t\t\t\t? \"\" // A space within parens or within function call parens, so not a separator for tag args\n\t\t\t// New arg or prop - so insert backspace \\b (\\x08) as separator for named params, used subsequently by rBuildHash, and prepare new bindings array\n\t\t\t\t\t\t: (paramIndex = full.slice(paramIndex, ind), named\n\t\t\t\t\t\t\t? (named = boundName = bindto = false, \"\\b\")\n\t\t\t\t\t\t\t: \"\\b,\") + paramIndex + (paramIndex = ind + all.length, bindings && pathBindings.push(bndCtx.bd = []), \"\\b\")\n\t\t\t\t\t)\n\t\t\t\t\t: eq\n\t\t\t// named param. Remove bindings for arg and create instead bindings array for prop\n\t\t\t\t\t\t? (fnDp && syntaxError(params), bindings && pathBindings.pop(), named = \"_\" + path, boundName = bound, paramIndex = ind + all.length,\n\t\t\t\t\t\t\t\tbindings && ((bindings = bndCtx.bd = pathBindings[named] = []), bindings.skp = !bound), path + ':')\n\t\t\t\t\t\t: path\n\t\t\t// path\n\t\t\t\t\t\t\t? (path.split(\"^\").join(\".\").replace($sub.rPath, parsePath)\n\t\t\t\t\t\t\t\t+ (prn || operator)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: operator\n\t\t\t// operator\n\t\t\t\t\t\t\t\t? operator\n\t\t\t\t\t\t\t\t: rtPrn\n\t\t\t// function\n\t\t\t\t\t\t\t\t\t? rtPrn === \"]\" ? \")]\" : \")\"\n\t\t\t\t\t\t\t\t\t: comma\n\t\t\t\t\t\t\t\t\t\t? (fnCall[prnDp] || syntaxError(params), \",\") // We don't allow top-level literal arrays or objects\n\t\t\t\t\t\t\t\t\t\t: lftPrn0\n\t\t\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t\t\t: (aposed = apos, quoted = quot, '\"')\n\t\t\t))\n\t\t);\n\n\t\tif (!aposed && !quoted) {\n\t\t\tif (rtPrn) {\n\t\t\t\tfnCall[prnDp] = false;\n\t\t\t\tprnDp--;\n\t\t\t}\n\t\t}\n\n\t\tif (bindings) {\n\t\t\tif (!aposed && !quoted) {\n\t\t\t\tif (rtPrn) {\n\t\t\t\t\tif (prnStack[prnDp+1]) {\n\t\t\t\t\t\tbndCtx = bndStack[--fnDp];\n\t\t\t\t\t\tprnStack[prnDp+1] = false;\n\t\t\t\t\t}\n\t\t\t\t\tprnStart = prnInd[prnDp+1];\n\t\t\t\t}\n\t\t\t\tif (prn) {\n\t\t\t\t\tprnInd[prnDp+1] = compiledPath[fnDp].length + (lftPrn ? 1 : 0);\n\t\t\t\t\tif (path || rtPrn) {\n\t\t\t\t\t\tbndCtx = bndStack[++fnDp] = {bd: []};\n\t\t\t\t\t\tprnStack[prnDp+1] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcompiledPath[fnDp] = (compiledPath[fnDp]||\"\") + full.slice(prevIndex, index);\n\t\t\tprevIndex = index+all.length;\n\n\t\t\tif (!aposed && !quoted) {\n\t\t\t\tif (lftPrnFCall = lftPrn && prnStack[prnDp+1]) {\n\t\t\t\t\tcompiledPath[fnDp-1] += lftPrn;\n\t\t\t\t\tcompiledPathStart[fnDp-1]++;\n\t\t\t\t}\n\t\t\t\tif (prn === \"(\" && subPath && !newOb) {\n\t\t\t\t\tcompiledPath[fnDp] = compiledPath[fnDp-1].slice(prnStart) + compiledPath[fnDp];\n\t\t\t\t\tcompiledPath[fnDp-1] = compiledPath[fnDp-1].slice(0, prnStart);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcompiledPath[fnDp] += lftPrnFCall ? ret.slice(1) : ret;\n\t\t}\n\n\t\tif (!aposed && !quoted && prn) {\n\t\t\tprnDp++;\n\t\t\tif (path && prn === \"(\") {\n\t\t\t\tfnCall[prnDp] = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!aposed && !quoted && prn2) {\n\t\t\tif (bindings) {\n\t\t\t\tcompiledPath[fnDp] += prn;\n\t\t\t}\n\t\t\tret += prn;\n\t\t}\n\t\treturn ret;\n\t}\n\n\tvar named, bindto, boundName, result,\n\t\tquoted, // boolean for string content in double quotes\n\t\taposed, // or in single quotes\n\t\tbindings = pathBindings && pathBindings[0], // bindings array for the first arg\n\t\tbndCtx = {bd: bindings},\n\t\tbndStack = {0: bndCtx},\n\t\tparamIndex = 0, // list,\n\t\t// The following are used for tracking path parsing including nested paths, such as \"a.b(c^d + (e))^f\", and chained computed paths such as\n\t\t// \"a.b().c^d().e.f().g\" - which has four chained paths, \"a.b()\", \"^c.d()\", \".e.f()\" and \".g\"\n\t\tprnDp = 0, // For tracking paren depth (not function call parens)\n\t\tfnDp = 0, // For tracking depth of function call parens\n\t\tprnInd = {}, // We are in a function call\n\t\tprnStart = 0, // tracks the start of the current path such as c^d() in the above example\n\t\tprnStack = {}, // tracks parens which are not function calls, and so are associated with new bndStack contexts\n\t\tfnCall = {}, // We are in a function call\n\t\tpathStart = {},// tracks the start of the current path such as c^d() in the above example\n\t\tcompiledPathStart = {0: 0},\n\t\tcompiledPath = {0:\"\"},\n\t\tprevIndex = 0;\n\n\tif (params[0] === \"@\") {\n\t\tparams = params.replace(rBracketQuote, \".\");\n\t}\n\tresult = (params + (tmpl ? \" \" : \"\")).replace($sub.rPrm, parseTokens);\n\n\tif (bindings) {\n\t\tresult = compiledPath[0];\n\t}\n\n\treturn !prnDp && result || syntaxError(params); // Syntax error if unbalanced parens in params expression\n}\n\nfunction buildCode(ast, tmpl, isLinkExpr) {\n\t// Build the template function code from the AST nodes, and set as property on the passed-in template object\n\t// Used for compiling templates, and also by JsViews to build functions for data link expressions\n\tvar i, node, tagName, converter, tagCtx, hasTag, hasEncoder, getsVal, hasCnvt, useCnvt, tmplBindings, pathBindings, params, boundOnErrStart,\n\t\tboundOnErrEnd, tagRender, nestedTmpls, tmplName, nestedTmpl, tagAndElses, content, markup, nextIsElse, oldCode, isElse, isGetVal, tagCtxFn,\n\t\tonError, tagStart, trigger, lateRender, retStrOpen, retStrClose,\n\t\ttmplBindingKey = 0,\n\t\tuseViews = $subSettingsAdvanced.useViews || tmpl.useViews || tmpl.tags || tmpl.templates || tmpl.helpers || tmpl.converters,\n\t\tcode = \"\",\n\t\ttmplOptions = {},\n\t\tl = ast.length;\n\n\tif (typeof tmpl === STRING) {\n\t\ttmplName = isLinkExpr ? 'data-link=\"' + tmpl.replace(rNewLine, \" \").slice(1, -1) + '\"' : tmpl;\n\t\ttmpl = 0;\n\t} else {\n\t\ttmplName = tmpl.tmplName || \"unnamed\";\n\t\tif (tmpl.allowCode) {\n\t\t\ttmplOptions.allowCode = true;\n\t\t}\n\t\tif (tmpl.debug) {\n\t\t\ttmplOptions.debug = true;\n\t\t}\n\t\ttmplBindings = tmpl.bnds;\n\t\tnestedTmpls = tmpl.tmpls;\n\t}\n\tfor (i = 0; i < l; i++) {\n\t\t// AST nodes: [0: tagName, 1: converter, 2: content, 3: params, 4: code, 5: onError, 6: trigger, 7:pathBindings, 8: contentMarkup]\n\t\tnode = ast[i];\n\n\t\t// Add newline for each callout to t() c() etc. and each markup string\n\t\tif (typeof node === STRING) {\n\t\t\t// a markup string to be inserted\n\t\t\tcode += '+\"' + node + '\"';\n\t\t} else {\n\t\t\t// a compiled tag expression to be inserted\n\t\t\ttagName = node[0];\n\t\t\tif (tagName === \"*\") {\n\t\t\t\t// Code tag: {{* }}\n\t\t\t\tcode += \";\\n\" + node[1] + \"\\nret=ret\";\n\t\t\t} else {\n\t\t\t\tconverter = node[1];\n\t\t\t\tcontent = !isLinkExpr && node[2];\n\t\t\t\ttagCtx = paramStructure(node[3], params = node[4]);\n\t\t\t\ttrigger = node[6];\n\t\t\t\tlateRender = node[7];\n\t\t\t\tif (node[8]) { // latePath @a.b.c or @~a.b.c\n\t\t\t\t\tretStrOpen = \"\\nvar ob,ltOb={},ctxs=\";\n\t\t\t\t\tretStrClose = \";\\nctxs.lt=ltOb.lt;\\nreturn ctxs;\";\n\t\t\t\t} else {\n\t\t\t\t\tretStrOpen = \"\\nreturn \";\n\t\t\t\t\tretStrClose = \"\";\n\t\t\t\t}\n\t\t\t\tmarkup = node[10] && node[10].replace(rUnescapeQuotes, \"$1\");\n\t\t\t\tif (isElse = tagName === \"else\") {\n\t\t\t\t\tif (pathBindings) {\n\t\t\t\t\t\tpathBindings.push(node[9]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tonError = node[5] || $subSettings.debugMode !== false && \"undefined\"; // If debugMode not false, set default onError handler on tag to \"undefined\" (see onRenderError)\n\t\t\t\t\tif (tmplBindings && (pathBindings = node[9])) { // Array of paths, or false if not data-bound\n\t\t\t\t\t\tpathBindings = [pathBindings];\n\t\t\t\t\t\ttmplBindingKey = tmplBindings.push(1); // Add placeholder in tmplBindings for compiled function\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tuseViews = useViews || params[1] || params[2] || pathBindings || /view.(?!index)/.test(params[0]);\n\t\t\t\t// useViews is for perf optimization. For render() we only use views if necessary - for the more advanced scenarios.\n\t\t\t\t// We use views if there are props, contextual properties or args with #... (other than #index) - but you can force\n\t\t\t\t// using the full view infrastructure, (and pay a perf price) by opting in: Set useViews: true on the template, manually...\n\t\t\t\tif (isGetVal = tagName === \":\") {\n\t\t\t\t\tif (converter) {\n\t\t\t\t\t\ttagName = converter === HTML ? \">\" : converter + tagName;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (content) { // TODO optimize - if content.length === 0 or if there is a tmpl=\"...\" specified - set content to null / don't run this compilation code - since content won't get used!!\n\t\t\t\t\t\t// Create template object for nested template\n\t\t\t\t\t\tnestedTmpl = tmplObject(markup, tmplOptions);\n\t\t\t\t\t\tnestedTmpl.tmplName = tmplName + \"/\" + tagName;\n\t\t\t\t\t\t// Compile to AST and then to compiled function\n\t\t\t\t\t\tnestedTmpl.useViews = nestedTmpl.useViews || useViews;\n\t\t\t\t\t\tbuildCode(content, nestedTmpl);\n\t\t\t\t\t\tuseViews = nestedTmpl.useViews;\n\t\t\t\t\t\tnestedTmpls.push(nestedTmpl);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!isElse) {\n\t\t\t\t\t\t// This is not an else tag.\n\t\t\t\t\t\ttagAndElses = tagName;\n\t\t\t\t\t\tuseViews = useViews || tagName && (!$tags[tagName] || !$tags[tagName].flow);\n\t\t\t\t\t\t// Switch to a new code string for this bound tag (and its elses, if it has any) - for returning the tagCtxs array\n\t\t\t\t\t\toldCode = code;\n\t\t\t\t\t\tcode = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tnextIsElse = ast[i + 1];\n\t\t\t\t\tnextIsElse = nextIsElse && nextIsElse[0] === \"else\";\n\t\t\t\t}\n\t\t\t\ttagStart = onError ? \";\\ntry{\\nret+=\" : \"\\n+\";\n\t\t\t\tboundOnErrStart = \"\";\n\t\t\t\tboundOnErrEnd = \"\";\n\n\t\t\t\tif (isGetVal && (pathBindings || trigger || converter && converter !== HTML || lateRender)) {\n\t\t\t\t\t// For convertVal we need a compiled function to return the new tagCtx(s)\n\t\t\t\t\ttagCtxFn = new Function(\"data,view,j\", \"// \" + tmplName + \" \" + (++tmplBindingKey) + \" \" + tagName\n\t\t\t\t\t\t+ retStrOpen + \"{\" + tagCtx + \"};\" + retStrClose);\n\t\t\t\t\ttagCtxFn._er = onError;\n\t\t\t\t\ttagCtxFn._tag = tagName;\n\t\t\t\t\ttagCtxFn._bd = !!pathBindings; // data-linked tag {^{.../}}\n\t\t\t\t\ttagCtxFn._lr = lateRender;\n\n\t\t\t\t\tif (isLinkExpr) {\n\t\t\t\t\t\treturn tagCtxFn;\n\t\t\t\t\t}\n\n\t\t\t\t\tsetPaths(tagCtxFn, pathBindings);\n\t\t\t\t\ttagRender = 'c(\"' + converter + '\",view,';\n\t\t\t\t\tuseCnvt = true;\n\t\t\t\t\tboundOnErrStart = tagRender + tmplBindingKey + \",\";\n\t\t\t\t\tboundOnErrEnd = \")\";\n\t\t\t\t}\n\t\t\t\tcode += (isGetVal\n\t\t\t\t\t? (isLinkExpr ? (onError ? \"try{\\n\" : \"\") + \"return \" : tagStart) + (useCnvt // Call _cnvt if there is a converter: {{cnvt: ... }} or {^{cnvt: ... }}\n\t\t\t\t\t\t? (useCnvt = undefined, useViews = hasCnvt = true, tagRender + (tagCtxFn\n\t\t\t\t\t\t\t? ((tmplBindings[tmplBindingKey - 1] = tagCtxFn), tmplBindingKey) // Store the compiled tagCtxFn in tmpl.bnds, and pass the key to convertVal()\n\t\t\t\t\t\t\t: \"{\" + tagCtx + \"}\") + \")\")\n\t\t\t\t\t\t: tagName === \">\"\n\t\t\t\t\t\t\t? (hasEncoder = true, \"h(\" + params[0] + \")\")\n\t\t\t\t\t\t\t: (getsVal = true, \"((v=\" + params[0] + ')!=null?v:' + (isLinkExpr ? 'null)' : '\"\")'))\n\t\t\t\t\t\t\t// Non strict equality so data-link=\"title{:expr}\" with expr=null/undefined removes title attribute\n\t\t\t\t\t)\n\t\t\t\t\t: (hasTag = true, \"\\n{view:view,content:false,tmpl:\" // Add this tagCtx to the compiled code for the tagCtxs to be passed to renderTag()\n\t\t\t\t\t\t+ (content ? nestedTmpls.length : \"false\") + \",\" // For block tags, pass in the key (nestedTmpls.length) to the nested content template\n\t\t\t\t\t\t+ tagCtx + \"},\"));\n\n\t\t\t\tif (tagAndElses && !nextIsElse) {\n\t\t\t\t\t// This is a data-link expression or an inline tag without any elses, or the last {{else}} of an inline tag\n\t\t\t\t\t// We complete the code for returning the tagCtxs array\n\t\t\t\t\tcode = \"[\" + code.slice(0, -1) + \"]\";\n\t\t\t\t\ttagRender = 't(\"' + tagAndElses + '\",view,this,';\n\t\t\t\t\tif (isLinkExpr || pathBindings) {\n\t\t\t\t\t\t// This is a bound tag (data-link expression or inline bound tag {^{tag ...}}) so we store a compiled tagCtxs function in tmp.bnds\n\t\t\t\t\t\tcode = new Function(\"data,view,j\", \" // \" + tmplName + \" \" + tmplBindingKey + \" \" + tagAndElses + retStrOpen + code\n\t\t\t\t\t\t\t+ retStrClose);\n\t\t\t\t\t\tcode._er = onError;\n\t\t\t\t\t\tcode._tag = tagAndElses;\n\t\t\t\t\t\tif (pathBindings) {\n\t\t\t\t\t\t\tsetPaths(tmplBindings[tmplBindingKey - 1] = code, pathBindings);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcode._lr = lateRender;\n\t\t\t\t\t\tif (isLinkExpr) {\n\t\t\t\t\t\t\treturn code; // For a data-link expression we return the compiled tagCtxs function\n\t\t\t\t\t\t}\n\t\t\t\t\t\tboundOnErrStart = tagRender + tmplBindingKey + \",undefined,\";\n\t\t\t\t\t\tboundOnErrEnd = \")\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// This is the last {{else}} for an inline tag.\n\t\t\t\t\t// For a bound tag, pass the tagCtxs fn lookup key to renderTag.\n\t\t\t\t\t// For an unbound tag, include the code directly for evaluating tagCtxs array\n\t\t\t\t\tcode = oldCode + tagStart + tagRender + (pathBindings && tmplBindingKey || code) + \")\";\n\t\t\t\t\tpathBindings = 0;\n\t\t\t\t\ttagAndElses = 0;\n\t\t\t\t}\n\t\t\t\tif (onError && !nextIsElse) {\n\t\t\t\t\tuseViews = true;\n\t\t\t\t\tcode += ';\\n}catch(e){ret' + (isLinkExpr ? \"urn \" : \"+=\") + boundOnErrStart + 'j._err(e,view,' + onError + ')' + boundOnErrEnd + ';}' + (isLinkExpr ? \"\" : '\\nret=ret');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Include only the var references that are needed in the code\n\tcode = \"// \" + tmplName\n\t\t+ (tmplOptions.debug ? \"\\ndebugger;\" : \"\")\n\t\t+ \"\\nvar v\"\n\t\t+ (hasTag ? \",t=j._tag\" : \"\") // has tag\n\t\t+ (hasCnvt ? \",c=j._cnvt\" : \"\") // converter\n\t\t+ (hasEncoder ? \",h=j._html\" : \"\") // html converter\n\t\t+ (isLinkExpr\n\t\t\t\t? (node[8] // late @... path?\n\t\t\t\t\t\t? \", ob\"\n\t\t\t\t\t\t: \"\"\n\t\t\t\t\t) + \";\\n\"\n\t\t\t\t: ',ret=\"\"')\n\t\t+ code\n\t\t+ (isLinkExpr ? \"\\n\" : \";\\nreturn ret;\");\n\n\ttry {\n\t\tcode = new Function(\"data,view,j\", code);\n\t} catch (e) {\n\t\tsyntaxError(\"Compiled template code:\\n\\n\" + code + '\\n: \"' + (e.message||e) + '\"');\n\t}\n\tif (tmpl) {\n\t\ttmpl.fn = code;\n\t\ttmpl.useViews = !!useViews;\n\t}\n\treturn code;\n}\n\n//==========\n// Utilities\n//==========\n\n// Merge objects, in particular contexts which inherit from parent contexts\nfunction extendCtx(context, parentContext) {\n\t// Return copy of parentContext, unless context is defined and is different, in which case return a new merged context\n\t// If neither context nor parentContext are defined, return undefined\n\treturn context && context !== parentContext\n\t\t? (parentContext\n\t\t\t? $extend($extend({}, parentContext), context)\n\t\t\t: context)\n\t\t: parentContext && $extend({}, parentContext);\n}\n\nfunction getTargetProps(source, tagCtx) {\n\t// this pointer is theMap - which has tagCtx.props too\n\t// arguments: tagCtx.args.\n\tvar key, prop,\n\t\tmap = tagCtx.map,\n\t\tpropsArr = map && map.propsArr;\n\n\tif (!propsArr) { // map.propsArr is the full array of {key:..., prop:...} objects\n\t\tpropsArr = [];\n\t\tif (typeof source === OBJECT || $isFunction(source)) {\n\t\t\tfor (key in source) {\n\t\t\t\tprop = source[key];\n\t\t\t\tif (key !== $expando && source.hasOwnProperty(key) && (!tagCtx.props.noFunctions || !$.isFunction(prop))) {\n\t\t\t\t\tpropsArr.push({key: key, prop: prop});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (map) {\n\t\t\tmap.propsArr = map.options && propsArr; // If bound {^{props}} and not isRenderCall, store propsArr on map (map.options is defined only for bound, && !isRenderCall)\n\t\t}\n\t}\n\treturn getTargetSorted(propsArr, tagCtx); // Obtains map.tgt, by filtering, sorting and splicing the full propsArr\n}\n\nfunction getTargetSorted(value, tagCtx) {\n\t// getTgt\n\tvar mapped, start, end,\n\t\ttag = tagCtx.tag,\n\t\tprops = tagCtx.props,\n\t\tpropParams = tagCtx.params.props,\n\t\tfilter = props.filter,\n\t\tsort = props.sort,\n\t\tdirectSort = sort === true,\n\t\tstep = parseInt(props.step),\n\t\treverse = props.reverse ? -1 : 1;\n\n\tif (!$isArray(value)) {\n\t\treturn value;\n\t}\n\tif (directSort || sort && typeof sort === STRING) {\n\t\t// Temporary mapped array holds objects with index and sort-value\n\t\tmapped = value.map(function(item, i) {\n\t\t\titem = directSort ? item : getPathObject(item, sort);\n\t\t\treturn {i: i, v: typeof item === STRING ? item.toLowerCase() : item};\n\t\t});\n\t\t// Sort mapped array\n\t\tmapped.sort(function(a, b) {\n\t\t\treturn a.v > b.v ? reverse : a.v < b.v ? -reverse : 0;\n\t\t});\n\t\t// Map to new array with resulting order\n\t\tvalue = mapped.map(function(item){\n\t\t\treturn value[item.i];\n\t\t});\n\t} else if ((sort || reverse < 0) && !tag.dataMap) {\n\t\tvalue = value.slice(); // Clone array first if not already a new array\n\t}\n\tif ($isFunction(sort)) {\n\t\tvalue = value.sort(function() { // Wrap the sort function to provide tagCtx as 'this' pointer\n\t\t\treturn sort.apply(tagCtx, arguments);\n\t\t});\n\t}\n\tif (reverse < 0 && (!sort || $isFunction(sort))) { // Reverse result if not already reversed in sort\n\t\tvalue = value.reverse();\n\t}\n\n\tif (value.filter && filter) { // IE8 does not support filter\n\t\tvalue = value.filter(filter, tagCtx);\n\t\tif (tagCtx.tag.onFilter) {\n\t\t\ttagCtx.tag.onFilter(tagCtx);\n\t\t}\n\t}\n\n\tif (propParams.sorted) {\n\t\tmapped = (sort || reverse < 0) ? value : value.slice();\n\t\tif (tag.sorted) {\n\t\t\t$.observable(tag.sorted).refresh(mapped); // Note that this might cause the start and end props to be modified - e.g. by pager tag control\n\t\t} else {\n\t\t\ttagCtx.map.sorted = mapped;\n\t\t}\n\t}\n\n\tstart = props.start; // Get current value - after possible changes triggered by tag.sorted refresh() above\n\tend = props.end;\n\tif (propParams.start && start === undefined || propParams.end && end === undefined) {\n\t\tstart = end = 0;\n\t}\n\tif (!isNaN(start) || !isNaN(end)) { // start or end specified, but not the auto-create Number array scenario of {{for start=xxx end=yyy}}\n\t\tstart = +start || 0;\n\t\tend = end === undefined || end > value.length ? value.length : +end;\n\t\tvalue = value.slice(start, end);\n\t}\n\tif (step > 1) {\n\t\tstart = 0;\n\t\tend = value.length;\n\t\tmapped = [];\n\t\tfor (; start<end; start+=step) {\n\t\t\tmapped.push(value[start]);\n\t\t}\n\t\tvalue = mapped;\n\t}\n\tif (propParams.paged && tag.paged) {\n\t\t$observable(tag.paged).refresh(value);\n\t}\n\n\treturn value;\n}\n\n/** Render the template as a string, using the specified data and helpers/context\n* $(\"#tmpl\").render()\n*\n* @param {any} data\n* @param {hash} [helpersOrContext]\n* @param {boolean} [noIteration]\n* @returns {string} rendered template\n*/\nfunction $fnRender(data, context, noIteration) {\n\tvar tmplElem = this.jquery && (this[0] || error('Unknown template')), // Targeted element not found for jQuery template selector such as \"#myTmpl\"\n\t\ttmpl = tmplElem.getAttribute(tmplAttr);\n\n\treturn renderContent.call(tmpl && $.data(tmplElem)[jsvTmpl] || $templates(tmplElem),\n\t\tdata, context, noIteration);\n}\n\n//========================== Register converters ==========================\n\nfunction getCharEntity(ch) {\n\t// Get character entity for HTML, Attribute and optional data encoding\n\treturn charEntities[ch] || (charEntities[ch] = \"&#\" + ch.charCodeAt(0) + \";\");\n}\n\nfunction getCharFromEntity(match, token) {\n\t// Get character from HTML entity, for optional data unencoding\n\treturn charsFromEntities[token] || \"\";\n}\n\nfunction htmlEncode(text) {\n\t// HTML encode: Replace < > & ' \" ` etc. by corresponding entities.\n\treturn text != undefined ? rIsHtml.test(text) && (\"\" + text).replace(rHtmlEncode, getCharEntity) || text : \"\";\n}\n\nfunction dataEncode(text) {\n\t// Encode just < > and & - intended for 'safe data' along with {{:}} rather than {{>}}\n return typeof text === STRING ? text.replace(rDataEncode, getCharEntity) : text;\n}\n\nfunction dataUnencode(text) {\n // Unencode just < > and & - intended for 'safe data' along with {{:}} rather than {{>}}\n return typeof text === STRING ? text.replace(rDataUnencode, getCharFromEntity) : text;\n}\n\n//========================== Initialize ==========================\n\n$sub = $views.sub;\n$viewsSettings = $views.settings;\n\nif (!$.link) {\n\t// JsRender/JsViews not already loaded (or loaded without jQuery, and we are now moving from jsrender namespace to jQuery namepace)\n\tfor (jsvStoreName in jsvStores) {\n\t\tregisterStore(jsvStoreName, jsvStores[jsvStoreName]);\n\t}\n\n\t$converters = $views.converters;\n\t$helpers = $views.helpers;\n\t$tags = $views.tags;\n\n\t$sub._tg.prototype = {\n\t\tbaseApply: baseApply,\n\t\tcvtArgs: convertArgs,\n\t\tbndArgs: convertBoundArgs,\n\t\tctxPrm: contextParameter\n\t};\n\n\ttopView = $sub.topView = new View();\n\n\t//BROWSER-SPECIFIC CODE\n\tif ($) {\n\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t// jQuery (= $) is loaded\n\n\t\t$.fn.render = $fnRender;\n\t\t$expando = $.expando;\n\t\tif ($.observable) {\n\t\t\tif (versionNumber !== (versionNumber = $.views.jsviews)) {\n\t\t\t\t// Different version of jsRender was loaded\n\t\t\t\tthrow \"jquery.observable.js requires jsrender.js \" + versionNumber;\n\t\t\t}\n\t\t\t$extend($sub, $.views.sub); // jquery.observable.js was loaded before jsrender.js\n\t\t\t$views.map = $.views.map;\n\t\t}\n\n\t} else {\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t// jQuery is not loaded.\n\n\t\t$ = {};\n\n\t\tif (setGlobals) {\n\t\t\tglobal.jsrender = $; // We are loading jsrender.js from a script element, not AMD or CommonJS, so set global\n\t\t}\n\n\t\t// Error warning if jsrender.js is used as template engine on Node.js (e.g. Express or Hapi...)\n\t\t// Use jsrender-node.js instead...\n\t\t$.renderFile = $.__express = $.compile = function() { throw \"Node.js: use npm jsrender, or jsrender-node.js\"; };\n\n\t\t//END BROWSER-SPECIFIC CODE\n\t\t$.isFunction = function(ob) {\n\t\t\treturn typeof ob === \"function\";\n\t\t};\n\n\t\t$.isArray = Array.isArray || function(obj) {\n\t\t\treturn ({}.toString).call(obj) === \"[object Array]\";\n\t\t};\n\n\t\t$sub._jq = function(jq) { // private method to move from JsRender APIs from jsrender namespace to jQuery namespace\n\t\t\tif (jq !== $) {\n\t\t\t\t$extend(jq, $); // map over from jsrender namespace to jQuery namespace\n\t\t\t\t$ = jq;\n\t\t\t\t$.fn.render = $fnRender;\n\t\t\t\tdelete $.jsrender;\n\t\t\t\t$expando = $.expando;\n\t\t\t}\n\t\t};\n\n\t\t$.jsrender = versionNumber;\n\t}\n\t$subSettings = $sub.settings;\n\t$subSettings.allowCode = false;\n\t$isFunction = $.isFunction;\n\t$.render = $render;\n\t$.views = $views;\n\t$.templates = $templates = $views.templates;\n\n\tfor (setting in $subSettings) {\n\t\taddSetting(setting);\n\t}\n\n\t/**\n\t* $.views.settings.debugMode(true)\n\t* @param {boolean} debugMode\n\t* @returns {Settings}\n\t*\n\t* debugMode = $.views.settings.debugMode()\n\t* @returns {boolean}\n\t*/\n\t($viewsSettings.debugMode = function(debugMode) {\n\t\treturn debugMode === undefined\n\t\t\t? $subSettings.debugMode\n\t\t\t: (\n\t\t\t\t$subSettings._clFns && $subSettings._clFns(), // Clear linkExprStore (cached compiled expressions), since debugMode setting affects compilation for expressions\n\t\t\t\t$subSettings.debugMode = debugMode,\n\t\t\t\t$subSettings.onError = typeof debugMode === STRING\n\t\t\t\t\t? function() { return debugMode; }\n\t\t\t\t\t: $isFunction(debugMode)\n\t\t\t\t\t\t? debugMode\n\t\t\t\t\t\t: undefined,\n\t\t\t\t$viewsSettings);\n\t})(false); // jshint ignore:line\n\n\t$subSettingsAdvanced = $subSettings.advanced = {\n\t\tcache: true, // By default use cached values of computed values (Otherwise, set advanced cache setting to false)\n\t\tuseViews: false,\n\t\t_jsv: false // For global access to JsViews store\n\t};\n\n\t//========================== Register tags ==========================\n\n\t$tags({\n\t\t\"if\": {\n\t\t\trender: function(val) {\n\t\t\t\t// This function is called once for {{if}} and once for each {{else}}.\n\t\t\t\t// We will use the tag.rendering object for carrying rendering state across the calls.\n\t\t\t\t// If not done (a previous block has not been rendered), look at expression for this block and render the block if expression is truthy\n\t\t\t\t// Otherwise return \"\"\n\t\t\t\tvar self = this,\n\t\t\t\t\ttagCtx = self.tagCtx,\n\t\t\t\t\tret = (self.rendering.done || !val && (tagCtx.args.length || !tagCtx.index))\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: (self.rendering.done = true,\n\t\t\t\t\t\t\tself.selected = tagCtx.index,\n\t\t\t\t\t\t\tundefined); // Test is satisfied, so render content on current context\n\t\t\t\treturn ret;\n\t\t\t},\n\t\t\tcontentCtx: true, // Inherit parent view data context\n\t\t\tflow: true\n\t\t},\n\t\t\"for\": {\n\t\t\tsortDataMap: dataMap(getTargetSorted),\n\t\t\tinit: function(val, cloned) {\n\t\t\t\tthis.setDataMap(this.tagCtxs);\n\t\t\t},\n\t\t\trender: function(val) {\n\t\t\t\t// This function is called once for {{for}} and once for each {{else}}.\n\t\t\t\t// We will use the tag.rendering object for carrying rendering state across the calls.\n\t\t\t\tvar value, filter, srtField, isArray, i, sorted, end, step,\n\t\t\t\t\tself = this,\n\t\t\t\t\ttagCtx = self.tagCtx,\n\t\t\t\t\trange = tagCtx.argDefault === false,\n\t\t\t\t\tprops = tagCtx.props,\n\t\t\t\t\titerate = range || tagCtx.args.length, // Not final else and not auto-create range\n\t\t\t\t\tresult = \"\",\n\t\t\t\t\tdone = 0;\n\n\t\t\t\tif (!self.rendering.done) {\n\t\t\t\t\tvalue = iterate ? val : tagCtx.view.data; // For the final else, defaults to current data without iteration.\n\n\t\t\t\t\tif (range) {\n\t\t\t\t\t\trange = props.reverse ? \"unshift\" : \"push\";\n\t\t\t\t\t\tend = +props.end;\n\t\t\t\t\t\tstep = +props.step || 1;\n\t\t\t\t\t\tvalue = []; // auto-create integer array scenario of {{for start=xxx end=yyy}}\n\t\t\t\t\t\tfor (i = +props.start || 0; (end - i) * step > 0; i += step) {\n\t\t\t\t\t\t\tvalue[range](i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\tisArray = $isArray(value);\n\t\t\t\t\t\tresult += tagCtx.render(value, !iterate || props.noIteration);\n\t\t\t\t\t\t// Iterates if data is an array, except on final else - or if noIteration property\n\t\t\t\t\t\t// set to true. (Use {{include}} to compose templates without array iteration)\n\t\t\t\t\t\tdone += isArray ? value.length : 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (self.rendering.done = done) {\n\t\t\t\t\t\tself.selected = tagCtx.index;\n\t\t\t\t\t}\n\t\t\t\t\t// If nothing was rendered we will look at the next {{else}}. Otherwise, we are done.\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tsetDataMap: function(tagCtxs) {\n\t\t\t\tvar tagCtx, props, paramsProps,\n\t\t\t\t\tself = this,\n\t\t\t\t\tl = tagCtxs.length;\n\t\t\t\twhile (l--) {\n\t\t\t\t\ttagCtx = tagCtxs[l];\n\t\t\t\t\tprops = tagCtx.props;\n\t\t\t\t\tparamsProps = tagCtx.params.props;\n\t\t\t\t\ttagCtx.argDefault = props.end === undefined || tagCtx.args.length > 0; // Default to #data except for auto-create range scenario {{for start=xxx end=yyy step=zzz}}\n\t\t\t\t\tprops.dataMap = (tagCtx.argDefault !== false && $isArray(tagCtx.args[0]) &&\n\t\t\t\t\t\t(paramsProps.sort || paramsProps.start || paramsProps.end || paramsProps.step || paramsProps.filter || paramsProps.reverse\n\t\t\t\t\t\t|| props.sort || props.start || props.end || props.step || props.filter || props.reverse))\n\t\t\t\t\t\t&& self.sortDataMap;\n\t\t\t\t}\n\t\t\t},\n\t\t\tflow: true\n\t\t},\n\t\tprops: {\n\t\t\tbaseTag: \"for\",\n\t\t\tdataMap: dataMap(getTargetProps),\n\t\t\tinit: noop, // Don't execute the base init() of the \"for\" tag\n\t\t\tflow: true\n\t\t},\n\t\tinclude: {\n\t\t\tflow: true\n\t\t},\n\t\t\"*\": {\n\t\t\t// {{* code... }} - Ignored if template.allowCode and $.views.settings.allowCode are false. Otherwise include code in compiled template\n\t\t\trender: retVal,\n\t\t\tflow: true\n\t\t},\n\t\t\":*\": {\n\t\t\t// {{:* returnedExpression }} - Ignored if template.allowCode and $.views.settings.allowCode are false. Otherwise include code in compiled template\n\t\t\trender: retVal,\n\t\t\tflow: true\n\t\t},\n\t\tdbg: $helpers.dbg = $converters.dbg = dbgBreak // Register {{dbg/}}, {{dbg:...}} and ~dbg() to throw and catch, as breakpoints for debugging.\n\t});\n\n\t$converters({\n\t\thtml: htmlEncode,\n\t\tattr: htmlEncode, // Includes > encoding since rConvertMarkers in JsViews does not skip > characters in attribute strings\n\t\tencode: dataEncode,\n\t\tunencode: dataUnencode, // Includes > encoding since rConvertMarkers in JsViews does not skip > characters in attribute strings\n\t\turl: function(text) {\n\t\t\t// URL encoding helper.\n\t\t\treturn text != undefined ? encodeURI(\"\" + text) : text === null ? text : \"\"; // null returns null, e.g. to remove attribute. undefined returns \"\"\n\t\t}\n\t});\n}\n//========================== Define default delimiters ==========================\n$subSettings = $sub.settings;\n$isArray = ($||jsr).isArray;\n$viewsSettings.delimiters(\"{{\", \"}}\", \"^\");\n\nif (jsrToJq) { // Moving from jsrender namespace to jQuery namepace - copy over the stored items (templates, converters, helpers...)\n\tjsr.views.sub._jq($);\n}\n\n//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< JsObservable >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n/* JsObservable:\n * See https://www.jsviews.com/#jsobservable and http://github.com/borismoore/jsviews\n * Copyright 2024, Boris Moore\n * Released under the MIT License.\n */\n\n//========================== Top-level vars ==========================\n\n$views = $.views;\n$sub = $views.sub;\n$isFunction = $.isFunction;\n$isArray = $.isArray;\n$expando = $.expando;\nif (!$.observe) {\n\n\tvar $eventSpecial = $.event.special,\n\t\tslice = [].slice,\n\t\tsplice = [].splice,\n\t\tconcat = [].concat,\n\t\tPARSEINT = parseInt,\n\t\trNotWhite = /\\S+/g,\n\t\trShallowPath = /^[^.[]*$/, // No '.' or '[' in path\n\t\tpropertyChangeStr = $sub.propChng = $sub.propChng || \"propertyChange\",// These two settings can be overridden on settings after loading\n\t\tarrayChangeStr = $sub.arrChng = $sub.arrChng || \"arrayChange\", // jsRender, and prior to loading jquery.observable.js and/or JsViews\n\t\tcbBindingsStore = {},\n\t\tobserveStr = propertyChangeStr + \".observe\",\n\t\tobserveObjKey = 1,\n\t\tobserveCbKey = 1,\n\t\tobserveInnerCbKey = 1,\n\t\t$data = $.data,\n\t\tremove = {}, // flag for removeProperty\n\t\tasyncBatch = [],\n\n\t//========================== Top-level functions ==========================\n\n\tgetCbKey = function(cb) {\n\t\treturn cb\n\t\t? (cb._cId = cb._cId || (\".obs\" + observeCbKey++))\n\t\t: \"\";\n\t},\n\n\tObjectObservable = function(ns, data) {\n\t\tthis._data = data;\n\t\tthis._ns = ns;\n\t\treturn this;\n\t},\n\n\tArrayObservable = function(ns, data) {\n\t\tthis._data = data;\n\t\tthis._ns = ns;\n\t\treturn this;\n\t},\n\n\twrapArray = function(data) {\n\t\treturn $isArray(data)\n\t\t\t? [data]\n\t\t\t: data;\n\t},\n\n\tdependsPaths = function(paths, root, callback) {\n\t\t// Process depends = ... paths to resolve objects, and recursively process functions.\n\t\tpaths = paths\n\t\t\t? $isArray(paths)\n\t\t\t\t? paths\n\t\t\t\t: [paths]\n\t\t\t: [];\n\n\t\tvar i, path, object, rt,\n\t\t\tnextObj = object = root,\n\t\t\tl = paths && paths.length,\n\t\t\tout = [];\n\n\t\tfor (i = 0; i < l; i++) {\n\t\t\tpath = paths[i];\n\t\t\tif ($isFunction(path)) { // path is a depends function, returning [path1, ...]\n\t\t\t\trt = root.tagName\n\t\t\t\t\t\t? root.linkCtx.data // root is tag instance. rt is current data context of tag\n\t\t\t\t\t\t: root; // rt = root = current data context of computed prop\n\t\t\t\tout = out.concat(dependsPaths(path.call(root, rt, callback), rt, callback));\n\t\t\t\tcontinue;\n\t\t\t} else if (typeof path !== STRING) {\n\t\t\t\troot = nextObj = path = (path === undefined ? null : path);\n\t\t\t\tif (nextObj !== object) {\n\t\t\t\t\tout.push(object = nextObj);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (nextObj !== object) {\n\t\t\t\tout.push(object = nextObj);\n\t\t\t}\n\t\t\tout.push(path);\n\t\t}\n\t\tif (out.length) {\n\t\t\t// Switch on allowArray, for depends paths, by passing {_ar: ...} objects to switch on allowArray then return to contextual allowArray value\n\t\t\tout.unshift({_ar: 1});\n\t\t\tout.push({_ar: -1});\n\t\t}\n\t\treturn out;\n\t},\n\n\tonDataChange = function(ev, eventArgs) {\n\t\tfunction isOb(val) {\n\t\t\treturn typeof val === OBJECT && (paths[0] || !noArray && $isArray(val));\n\t\t}\n\n\t\tif (!(ev.data && ev.data.off)) {\n\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\tvar allPath, filter, parentObs,\n\t\t\t\toldValue = eventArgs.oldValue,\n\t\t\t\tvalue = eventArgs.value,\n\t\t\t\tctx = ev.data,\n\t\t\t\tobserveAll = ctx.observeAll,\n\t\t\t\tcb = ctx.cb,\n\t\t\t\tnoArray = ctx._arOk ? 0 : 1,\n\t\t\t\tpaths = ctx.paths,\n\t\t\t\tns = ctx.ns;\n\n\t\t\tif (ev.type === arrayChangeStr) {\n\t\t\t\t(cb.array || cb).call(ctx, ev, eventArgs); // If there is an arrayHandler expando on the regular handler, use it, otherwise use the regular handler for arrayChange events also - for example: $.observe(array, handler)\n\t\t\t\t// or observeAll() with an array in the graph. Note that on data-link bindings we ensure always to have an array handler - $.noop if none is specified e.g. on the data-linked tag.\n\t\t\t} else if (ctx.prop === eventArgs.path || ctx.prop === \"*\") {\n\t\t\t\tif (observeAll) {\n\t\t\t\t\tallPath = observeAll._path + \".\" + eventArgs.path;\n\t\t\t\t\tfilter = observeAll.filter;\n\t\t\t\t\tparentObs = [ev.target].concat(observeAll.parents());\n\n\t\t\t\t\tif (isOb(oldValue)) {\n\t\t\t\t\t\tobserve_apply(undefined, ns, [oldValue], paths, cb, true, filter, [parentObs], allPath); // unobserve\n\t\t\t\t\t}\n\t\t\t\t\tif (isOb(value)) {\n\t\t\t\t\t\tobserve_apply(undefined, ns, [value], paths, cb, undefined, filter, [parentObs], allPath);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (isOb(oldValue)) { // oldValue is an object, so unobserve\n\t\t\t\t\t\tobserve_apply(noArray, ns, [oldValue], paths, cb, true); // unobserve. Observe array change events too if this change is not from an 'observeAndBind' tag binding, or is from a 'depends' path\n\t\t\t\t\t}\n\t\t\t\t\tif (isOb(value)) { // value is an object, so observe\n\t\t\t\t\t\tobserve_apply(noArray, ns, [value], paths, cb); // observe. Observe array change events too if this change is not from an 'observeAndBind' tag binding, or is from a 'depends' path\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tctx.cb(ev, eventArgs);\n\t\t\t}\n\t\t}\n\t},\n\n\tobserve_apply = function() {\n\t\t// $.observe(), but allowing you to include arrays within the arguments - which you want flattened.\n\t\tvar args = concat.apply([], arguments); // Flatten the arguments\n\t\treturn $observe.apply(args.shift(), args);\n\t},\n\n\t$observeAll = function(cb, filter, unobserve) {\n\t\tobserveAll(this._ns, this._data, cb, filter, [], \"root\", unobserve);\n\t},\n\n\t$unobserveAll = function(cb, filter) {\n\t\t$observeAll.call(this, cb, filter, true);\n\t},\n\n\tobserveAll = function(namespace, object, cb, filter, parentObs, allPath, unobserve, objMap) {\n\t\tfunction observeArrayItems(arr, unobs) {\n\t\t\tl = arr.length;\n\t\t\tnewAllPath = allPath + \"[]\";\n\t\t\twhile (l--) {\n\t\t\t\tfilterAndObserveAll(arr, l, unobs, 1);\n\t\t\t}\n\t\t}\n\n\t\tfunction filterAndObserveAll(obj, prop, unobs, nestedArray) {\n\t\t\tvar newObject, newParentObs;\n\t\t\tif ((+prop === prop || prop !== $expando) && (newObject = $observable._fltr(newAllPath, obj[prop], nextParentObs, filter))) {\n\t\t\t\tnewParentObs = nextParentObs.slice();\n\t\t\t\tif (nestedArray && updatedTgt && newParentObs[0] !== updatedTgt) {\n\t\t\t\t\tnewParentObs.unshift(updatedTgt); // For array change events when observing an array which is not the root, need to add updated array to parentObs\n\t\t\t\t}\n\t\t\t\tobserveAll(namespace, newObject, cb, filter || (nestedArray ? undefined : 0), newParentObs, newAllPath, unobs, objMap);\n\t\t\t}\n\t\t}\n\n\t\tfunction wrappedCb(ev, eventArgs) {\n\t\t\t// This object is changing.\n\t\t\tallPath = ev.data.observeAll._path;\n\t\t\tupdatedTgt = ev.target;\n\t\t\tswitch (eventArgs.change) { // observeAll/unobserveAll on added or removed objects\n\t\t\t\tcase \"insert\":\n\t\t\t\t\tobserveArrayItems(eventArgs.items);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"remove\":\n\t\t\t\t\tobserveArrayItems(eventArgs.items, true); // unobserveAll on removed items\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"set\":\n\t\t\t\t\tnewAllPath = allPath + \".\" + eventArgs.path;\n\t\t\t\t\tfilterAndObserveAll(eventArgs, \"oldValue\", true); // unobserve old value\n\t\t\t\t\tfilterAndObserveAll(eventArgs, \"value\"); // observe new value\n\t\t\t}\n\t\t\tupdatedTgt = undefined;\n\t\t\tcb.apply(this, arguments); // Observe this object (invoke the callback)\n\t\t}\n\t\twrappedCb._wrp = 1;\n\n\t\tvar l, isObject, newAllPath, nextParentObs, updatedTgt, obId,\n\t\t\tnotRemoving = !objMap || objMap.un || !unobserve; // true unless it is an observeAll call (not unobserveAll) and we are removing a listener (not adding one)\n\n\t\tif (object && typeof object === OBJECT) {\n\t\t\tnextParentObs = [object].concat(parentObs); // The parentObs chain for the next depth of observeAll\n\t\t\tisObject = $isArray(object) ? \"\" : \"*\";\n\t\t\tif (objMap && notRemoving && $.hasData(object) && objMap[obId = $data(object).obId]) {\n\t\t\t\tobjMap[obId]++;\n\t\t\t\treturn; // This object has already being observed/unobserved by this observeAll/unobserveAll call (must be a cyclic object graph) so skip, to avoid\n\t\t\t\t// stack overflow/multiple instances of listener. See jsviews/pull/305\n\t\t\t\t// NOTE - WE DO NOT support ObserveAll on data with cyclic graphs which include DUPLICATE REFERENCES TO ARRAY PROPERTIES - such as data.children = data.descendants = []\n\t\t\t}\n\t\t\tif (!objMap) {\n\t\t\t\tobjMap = {un: unobserve}; // Map object to register observed objects for this observeAll\n\t\t\t}\n\n\t\t\tif (cb) {\n\t\t\t\t// Observe this object or array - and also listen for changes to object graph, to add or remove observers from the modified object graph\n\t\t\t\tif (isObject || filter !== 0) {\n\t\t\t\t\t// If an object, observe the object. If an array, only add arrayChange binding if has filter or if filter is undefined (!== 0) - which\n\t\t\t\t\t// is the case for top-level calls or for nested array (array item of an array - e.g. member of 2-dimensional array).\n\t\t\t\t\t// For array properties lower in the tree, with no filter, filter is set to 0 in filterAndObserveAll, so no arrayChange binding here,\n\t\t\t\t\t// since they get arrayChange binding added during regular $.observe(array ...) binding.\n\t\t\t\t\twrappedCb._cId = getCbKey(cb); // Identify wrapped callback with unwrapped callback, so unobserveAll will\n\t\t\t\t\t\t\t\t\t\t\t\t\t// remove previous observeAll wrapped callback, if inner callback was the same;\n\t\t\t\t\tif (notRemoving) {\n\t\t\t\t\t\t$observe(namespace, object, isObject, wrappedCb, unobserve, filter, nextParentObs, allPath);\n\t\t\t\t\t\tobId = $data(object).obId;\n\t\t\t\t\t\tobjMap[obId] = (objMap[obId] || 0) + 1; // Register on map of objects observed/unobserved by this observeAll/unobserveAll call\n\t\t\t\t\t\t\t//- or remove from map if we are removing this object from observeAll call. (Avoid dups, for cyclic graphs)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (--objMap[$data(object).obId]) {\n\t\t\t\t\t\t\t// Register on map of objects observed/unobserved by this observeAll/unobserveAll call\n\t\t\t\t\t\t\t//- or remove from map if we are removing this object from observeAll call. (Avoid dups, for cyclic graphs)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$observe(namespace, object, isObject, wrappedCb, unobserve, filter, nextParentObs, allPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No callback. Just unobserve if unobserve === true.\n\t\t\t\tif (objMap) {\n\t\t\t\t\tobjMap[$data(object).obId] = 1; // Register on map of objects unobserved by this unobserveAll call. (Avoid dups, for cyclic graphs)\n\t\t\t\t}\n\t\t\t\t$observe(namespace, object, isObject, undefined, unobserve, filter, nextParentObs, allPath);\n\t\t\t}\n\n\t\t\tif (isObject) {\n\t\t\t\t// Continue stepping through object graph, observing object and arrays\n\t\t\t\t// To override filtering, pass in filter function, or replace $.observable._fltr\n\t\t\t\tfor (l in object) {\n\t\t\t\t\tnewAllPath = allPath + \".\" + l;\n\t\t\t\t\tfilterAndObserveAll(object, l, unobserve);\n\t\t\t\t}\n\t\t\t} else { // Observe items in Array\n\t\t\t\tobserveArrayItems(object, unobserve);\n\t\t\t}\n\t\t}\n\t},\n\n\tshallowFilter = function(path /*, object, parentObs*/) {\n\t\treturn rShallowPath.test(path); // No '.' and no '[' in path\n\t},\n\n\t$unobserve = function() {\n\t\t[].push.call(arguments, true); // Add true as additional final argument\n\t\treturn $observe.apply(undefined, arguments);\n\t},\n\n\tbatchTrigger = function(async) {\n\t\tvar event,\n\t\tbatch = this.slice();\n\t\tthis.length = 0;\n\t\tthis._go = 0;\n\t\twhile (event = batch.shift()) {\n\t\t\tif (!event.skip) {\n\t\t\t\tevent[0]._trigger(event[1], event[2], true);\n\t\t\t}\n\t\t}\n\t\tthis.paths = {};\n\t};\n\n\t$observe = function() {\n\t\t// $.observe([namespace, ]root, [1 or more objects, path or path Array params...], callback[, contextCallback][, unobserve])\n\n\t\tfunction innerObserve() {\n\t\t\tvar p, parts, unobserve, callback, cbId, inId, data, contextCb, items, cbBindings,\n\t\t\t\tinnerCb, parentObs, allPath, filter, initNsArr, initNsArrLen, view, prop, events, el;\n\n\t\t\tfunction unobserveBinding(cb, binding) {\n\t\t\t\tvar object;\n\t\t\t\tfor (data in binding) {\n\t\t\t\t\tobject = binding[data];\n\t\t\t\t\tif ($isArray(object)) {\n\t\t\t\t\t\tbindArray(cb, object, unobserve, unobserve);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobserveOnOff(cb, object, undefined, ns, \"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction observeOnOff(cb, object, fullPath, namespace, pathStr, isArrayBinding, off) {\n\t\t\t\tvar j, evData, dataOb,\n\t\t\t\t\tboundObOrArr = wrapArray(object),\n\t\t\t\t\tprntObs = parentObs,\n\t\t\t\t\tallPth = allPath;\n\n\t\t\t\tnamespace = initialNs ? namespace + \".\" + initialNs : namespace;\n\n\t\t\t\tif (!unobserve && (off || isArrayBinding)) {\n\t\t\t\t\tevents = $._data(object).events;\n\t\t\t\t\tevents = events && events[isArrayBinding ? arrayChangeStr : propertyChangeStr];\n\t\t\t\t\tel = events && events.length;\n\t\t\t\t\twhile (el--) { // Skip duplicates\n\t\t\t\t\t\tdata = events[el] && events[el].data;\n\t\t\t\t\t\tif (data && (off && data.ns !== initialNs\n\t\t\t\t\t\t\t// When observing, don't unbind dups unless they have the same namespace\n\t\t\t\t\t\t\t|| !off && data.ns === initialNs && data.cb && data.cb._cId === cb._cId && data.cb._inId === cb._inId && (!cb._wrp || data.cb._wrp)))\n\t\t\t\t\t\t\t// When observing and doing array binding, don't bind dups if they have the same namespace (Dups can happen e.g. with {^{for people ^~foo=people}})\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (unobserve || off) {\n\t\t\t\t\t$(boundObOrArr).off(namespace, onDataChange);\n\t\t\t\t} else {\n\t\t\t\t\tevData = isArrayBinding ? {}\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\tfullPath: fullPath,\n\t\t\t\t\t\t\tpaths: pathStr ? [pathStr] : [],\n\t\t\t\t\t\t\tprop: prop,\n\t\t\t\t\t\t\t_arOk: allowArray\n\t\t\t\t\t\t};\n\t\t\t\t\tevData.ns = initialNs;\n\t\t\t\t\tevData.cb = cb;\n\n\t\t\t\t\tif (allPath) {\n\t\t\t\t\t\t// This is an observeAll call\n\t\t\t\t\t\tevData.observeAll = {\n\t\t\t\t\t\t\t_path: allPth,\n\t\t\t\t\t\t\tpath: function() { // Step through path and parentObs parent chain, replacing '[]' by '[n]' based on current index of objects in parent arrays.\n\t\t\t\t\t\t\t\tj = prntObs.length;\n\t\t\t\t\t\t\t\treturn allPth.replace(/[[.]/g, function(all) {\n\t\t\t\t\t\t\t\t\tj--;\n\t\t\t\t\t\t\t\t\treturn all === \"[\"\n\t\t\t\t\t\t\t\t\t\t? \"[\" + $.inArray(prntObs[j - 1], prntObs[j])\n\t\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\tparents: function() {\n\t\t\t\t\t\t\t\treturn prntObs; // The chain of parents between the modified object and the root object used in the observeAll() call\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfilter: filter\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\t$(boundObOrArr).on(namespace, null, evData, onDataChange);\n\t\t\t\t\tif (cbBindings) {\n\t\t\t\t\t\t// Add object to cbBindings\n\t\t\t\t\t\tdataOb = $data(object);\n\t\t\t\t\t\tdataOb = dataOb.obId || (dataOb.obId = observeObjKey++);\n\t\t\t\t\t\tcbBindings[dataOb] = cbBindings[dataOb] || (cbBindings.len++, object);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction bindArray(cb, arr, unbind, isArray, relPath) {\n\t\t\t\tif (allowArray) {\n\t\t\t\t\t// allowArray is 1 if this is a call to observe that does not come from observeAndBind (tag binding), or is from a 'depends' path,\n\t\t\t\t\t// or for a tag with tag.onArrayChange = true - so we allow arrayChange binding. Otherwise allowArray is zero.\n\t\t\t\t\tvar object,\n\t\t\t\t\t\tprevAllPath = allPath;\n\n\t\t\t\t\tobject = arr;\n\t\t\t\t\tif (relPath) {\n\t\t\t\t\t\tobject = arr[relPath];\n\t\t\t\t\t\tallPath = allPath ? allPath + \".\" + relPath : allPath;\n\t\t\t\t\t}\n\t\t\t\t\tif (filter && object) {\n\t\t\t\t\t\tobject = $observable._fltr(allPath, object, relPath ? [arr].concat(parentObs) : parentObs, filter);\n\t\t\t\t\t}\n\t\t\t\t\tif (object && (isArray || $isArray(object))) {\n\t\t\t\t\t\tobserveOnOff(cb, object, undefined, arrayChangeStr + \".observe\" + getCbKey(cb), undefined, true, unbind);\n\t\t\t\t\t}\n\t\t\t\t\tallPath = prevAllPath;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction observeObjects(paths) {\n\n\t\t\t\tfunction observeObjectPaths(object, pths, callback, contextCb) {\n\n\t\t\t\t\tfunction getInnerCb(exprOb) {\n\t\t\t\t\t\texprOb.ob = contextCb(exprOb); // Initialize object\n\t\t\t\t\t\treturn exprOb.cb = function(ev, eventArgs) {\n\t\t\t\t\t\t\t// The innerCb used for updating a computed in a compiled expression (setting the new instance as exprOb.ob, unobserving the previous object,\n\t\t\t\t\t\t\t// and observing the new one), then calling the outerCB - i.e. the handler for the whole compiled expression.\n\t\t\t\t\t\t\t// Initialized exprOb.ob to the current object.\n\t\t\t\t\t\t\t// Uses the contextCb callback to execute the compiled exprOb template in the context of the view/data etc. to get the returned value, typically an object or array.\n\t\t\t\t\t\t\t// If it is an array, registers array binding\n\t\t\t\t\t\t\t// Note: For jsviews/issues/292 ctxCb will need var ctxCb = contextCb || function(exprOb, origRt) {return exprOb._cpfn(origRt);};\n\t\t\t\t\t\t\tvar obj = exprOb.ob, // The old object\n\t\t\t\t\t\t\t\tsub = exprOb.sb,\n\t\t\t\t\t\t\t\tnewObj = contextCb(exprOb);\n\n\t\t\t\t\t\t\tif (newObj !== obj) {\n\t\t\t\t\t\t\t\tif (typeof obj === OBJECT) {\n\t\t\t\t\t\t\t\t\tbindArray(callback, obj, true);\n\t\t\t\t\t\t\t\t\tif (sub || allowArray && $isArray(obj)) {\n\t\t\t\t\t\t\t\t\t\tinnerObserve([obj], sub, callback, contextCb, true); // unobserve on the old object\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\texprOb.ob = newObj;\n\t\t\t\t\t\t\t\t// Put the updated object instance onto the exprOb in the paths array, so subsequent string paths are relative to this object\n\t\t\t\t\t\t\t\tif (typeof newObj === OBJECT) {\n\t\t\t\t\t\t\t\t\tbindArray(callback, newObj);\n\t\t\t\t\t\t\t\t\tif (sub || allowArray && $isArray(newObj)) { // observe on new object\n\t\t\t\t\t\t\t\t\t\tinnerObserve([newObj], sub, callback, contextCb);\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\t// Call the outerCb - to execute the compiled expression that this computed is part of\n\t\t\t\t\t\t\tcallback(ev, eventArgs);\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction observePath(object, prts) { // Step through the path parts \"this.is^some.path\" and observe changes (on the leaf, or down to the bound depth)\n\n\t\t\t\t\t\tfunction obArrAddRemove(ev, eventArgs) {\n\t\t\t\t\t\t\t// If a \"[].*\" or \"[].prop\" wild card path (for observing properties of array items) we need to observe or unobserve added or removed items\n\t\t\t\t\t\t\tvar l;\n\t\t\t\t\t\t\tif (eventArgs.change === \"insert\" || (unobserve = eventArgs.change === \"remove\")) {\n\t\t\t\t\t\t\t\tl = eventArgs.items.length;\n\t\t\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\t\t\tobservePath(eventArgs.items[l], prts.slice());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tunobserve = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (callback) {\n\t\t\t\t\t\t\tobArrAddRemove._cId = getCbKey(callback); // Identify wrapped callback with unwrapped callback, so unobserveAll will\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// remove previous observeAll wrapped callback, if inner callback was the same;\n\t\t\t\t\t\t\tobArrAddRemove._inId = \".arIn\" + observeInnerCbKey++; // Specific _inId for each distinct obArrAddRemove, so not skipped as dups\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar arrIndex, skip, dep, obArr, prt, fnProp, isGet,\n\t\t\t\t\t\t\tobj = object;\n\t\t\t\t\t\tif (object && object._cxp) {\n\t\t\t\t\t\t\treturn observeObjectPaths(object[0], [object[1]], callback, contextCb);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twhile ((prop = prts.shift()) !== undefined) {\n\t\t\t\t\t\t\tif (obj && typeof obj === OBJECT && typeof prop === STRING) {\n\t\t\t\t\t\t\t\tif (prop === \"\") {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (prop.slice(-2) === \"()\") {\n\t\t\t\t\t\t\t\t\tprop = prop.slice(0, -2);\n\t\t\t\t\t\t\t\t\tisGet = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ((prts.length < depth + 1) && !obj.nodeType) {\n\t\t\t\t\t\t\t\t\t// Add observer for each token in path starting at depth, and on to the leaf\n\t\t\t\t\t\t\t\t\tif (!unobserve && (events = $._data(obj).events)) {\n\t\t\t\t\t\t\t\t\t\tevents = events && events[propertyChangeStr];\n\t\t\t\t\t\t\t\t\t\tel = events && events.length;\n\t\t\t\t\t\t\t\t\t\tskip = 0;\n\t\t\t\t\t\t\t\t\t\twhile (el--) { // Skip duplicates\n\t\t\t\t\t\t\t\t\t\t\tdata = events[el].data;\n\t\t\t\t\t\t\t\t\t\t\tif (data\n\t\t\t\t\t\t\t\t\t\t\t\t&& data.ns === initialNs\n\t\t\t\t\t\t\t\t\t\t\t\t&& data.cb._cId === callback._cId\n\t\t\t\t\t\t\t\t\t\t\t\t&& data.cb._inId === callback._inId\n\t\t\t\t\t\t\t\t\t\t\t\t&& !data._arOk === !allowArray\n\t\t\t\t\t\t\t\t\t\t\t\t&& (data.prop === prop || data.prop === \"*\" || data.prop === \"**\")) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (prt = prts.join(\".\")) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tdata.paths.push(prt); // We will skip this binding, but if it is not a leaf binding,\n\t\t\t\t\t\t\t\t\t\t\t\t\t// need to keep bindings for rest of path, ready for if the obj gets swapped.\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tskip++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (skip) {\n\t\t\t\t\t\t\t\t\t\t\t// Duplicate binding(s) found, so move on\n\t\t\t\t\t\t\t\t\t\t\tfnProp = obj[prop];\n\t\t\t\t\t\t\t\t\t\t\tobj = $isFunction(fnProp) ? fnProp.call(obj) : obj[prop];\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (prop === \"*\" || prop === \"**\") { // \"*\" => all properties. \"**\" => all properties and sub-properties (i.e. deep observeAll behavior)\n\t\t\t\t\t\t\t\t\t\tif (!unobserve && events && events.length) {\n\t\t\t\t\t\t\t\t\t\t\t// Remove existing bindings, since they will be duplicates with \"*\" or \"**\"\n\t\t\t\t\t\t\t\t\t\t\tobserveOnOff(callback, obj, path, ns, \"\", false, true);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (prop === \"*\") {\n\t\t\t\t\t\t\t\t\t\t\tobserveOnOff(callback, obj, path, ns, \"\"); // observe the object for any property change\n\t\t\t\t\t\t\t\t\t\t\tfor (prt in obj) {\n\t\t\t\t\t\t\t\t\t\t\t\t// observing \"*\": So (in addition to listening to prop change, above) listen to arraychange on props of type array\n\t\t\t\t\t\t\t\t\t\t\t\tif (prt !== $expando) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tbindArray(callback, obj, unobserve, undefined, prt);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$.observable(initialNs, obj)[(unobserve ? \"un\" : \"\") + \"observeAll\"](callback); // observe or unobserve the object for any property change\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else if (prop == \"[]\") { // \"[].*\" or \"[].prop\" wild card path, for observing properties of array items\n\t\t\t\t\t\t\t\t\t\tif ($isArray(obj)) {\n\t\t\t\t\t\t\t\t\t\t\tif (unobserve) {\n\t\t\t\t\t\t\t\t\t\t\t\tobserveOnOff(callback, obj, path, arrayChangeStr + getCbKey(callback), undefined, unobserve, unobserve);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$observe(initialNs, obj, obArrAddRemove, unobserve); // observe or unobserve added or removed items\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else if (prop) {\n\t\t\t\t\t\t\t\t\t\tobserveOnOff(callback, obj, path, ns + \".p_\" + prop, prts.join(\"^\")); // By using \"^\" rather than \".\" we ensure that deep binding will be used on newly inserted object graphs\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 (allPath) {\n\t\t\t\t\t\t\t\t\tallPath += \".\" + prop;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (prop === \"[]\") {\n\t\t\t\t\t\t\t\t\tif ($isArray(obj)) {\n\t\t\t\t\t\t\t\t\t\tobArr = obj;\n\t\t\t\t\t\t\t\t\t\tarrIndex = obj.length;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\twhile (arrIndex--) {\n\t\t\t\t\t\t\t\t\t\tobj = obArr[arrIndex];\n\t\t\t\t\t\t\t\t\t\tobservePath(obj, prts.slice());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tprop = obj[prop];\n\t\t\t\t\t\t\t\tif (!prts[0]) {\n\t\t\t\t\t\t\t\t\tbindArray(callback, prop, unobserve); // [un]observe(object, \"arrayProperty\") observes array changes on property of type array\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($isFunction(prop)) {\n\t\t\t\t\t\t\t\tfnProp = prop;\n\t\t\t\t\t\t\t\tif (dep = fnProp.depends) {\n\t\t\t\t\t\t\t\t\t// This is a computed observable. We will observe any declared dependencies.\n\t\t\t\t\t\t\t\t\tif (obj._vw && obj._ocp) {\n\t\t\t\t\t\t\t\t\t\t// Observable contextual parameter, so context was ocp object. Now move context to view.data for dependencies\n\t\t\t\t\t\t\t\t\t\tobj = obj._vw; // storeView or tag (scope of contextual parameter)\n\t\t\t\t\t\t\t\t\t\tif (obj._tgId) {\n\t\t\t\t\t\t\t\t\t\t\t// Is a tag, so get view\n\t\t\t\t\t\t\t\t\t\t\tobj = obj.tagCtx.view;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tobj = obj.data; // view.data\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tobserveObjects(concat.apply([], [[obj], dependsPaths(dep, obj, callback)]));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (isGet) {\n\t\t\t\t\t\t\t\t\tif (!prts[0]) {\n\t\t\t\t\t\t\t\t\t\tbindArray(callback, fnProp.call(obj), unobserve);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tprop = fnProp.call(obj);\n\t\t\t\t\t\t\t\t\tif (!prop) {\n\t\t\t\t\t\t\t\t\t\tbreak;\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\tobj = prop;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar i, path,\n\t\t\t\t\t\tdepth = 0,\n\t\t\t\t\t\tl = pths.length;\n\t\t\t\t\tif (object && !contextCb && ((view = object._is === \"view\") || object._is === \"tag\")) {\n\t\t\t\t\t\tcontextCb = $sub._gccb(view ? object : object.tagCtx.contentView);\n\t\t\t\t\t\tif (callback && !unobserve) {\n\t\t\t\t\t\t\t(function() {\n\t\t\t\t\t\t\t\tvar ob = object,\n\t\t\t\t\t\t\t\t\tcb = callback;\n\t\t\t\t\t\t\t\tcallback = function(ev, eventArgs) {\n\t\t\t\t\t\t\t\t\t// Wrapped callback so this pointer is tag or view\n\t\t\t\t\t\t\t\t\tcb.call(ob, ev, eventArgs);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tcallback._cId = cb._cId;\n\t\t\t\t\t\t\t\tcallback._inId = cb._inId;\n\t\t\t\t\t\t\t})();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tobject = view ? object.data : object;\n\t\t\t\t\t}\n\t\t\t\t\tif (!pths[0]) {\n\t\t\t\t\t\tif ($isArray(object)) {\n\t\t\t\t\t\t\tbindArray(callback, object, unobserve, true); // observe(array, handler)\n\t\t\t\t\t\t} else if (unobserve) {\n\t\t\t\t\t\t\tobserveOnOff(callback, object, undefined, ns, \"\"); // unobserve(objectOrArray[, handler])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (i = 0; i < l; i++) { // Step through objects and paths\n\t\t\t\t\t\tpath = pths[i];\n\t\t\t\t\t\tif (path === \"\") {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (path && path._ar) {\n\t\t\t\t\t\t\tallowArray += path._ar; // Switch on allowArray for depends paths, and off, afterwards.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (typeof path === STRING) {\n\t\t\t\t\t\t\tparts = path.split(\"^\");\n\t\t\t\t\t\t\tif (parts[1]) {\n\t\t\t\t\t\t\t\t// We bind the leaf, plus additional nodes based on depth.\n\t\t\t\t\t\t\t\t// \"a.b.c^d.e\" is depth 2, so listens to changes of e, plus changes of d and of c\n\t\t\t\t\t\t\t\tdepth = parts[0].split(\".\").length;\n\t\t\t\t\t\t\t\tpath = parts.join(\".\");\n\t\t\t\t\t\t\t\tdepth = path.split(\".\").length - depth;\n\t\t\t\t\t\t\t\t// if more than one ^ in the path, the first one determines depth\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (contextCb && (items = contextCb(path, depth))) {\n\t\t\t\t\t\t\t\t//object, paths\n\t\t\t\t\t\t\t\tif (items.length) {\n\t\t\t\t\t\t\t\t\tvar ob = items[0],\n\t\t\t\t\t\t\t\t\t\tpth = items[1];\n\t\t\t\t\t\t\t\t\tif (ob && ob._cxp) { // contextual parameter\n\t\t\t\t\t\t\t\t\t\tpth = ob[1];\n\t\t\t\t\t\t\t\t\t\tob = ob[0];\n\t\t\t\t\t\t\t\t\t\tif (ob._is === \"view\") {\n\t\t\t\t\t\t\t\t\t\t\tobserveObjectPaths(ob, [pth], callback); // Setting contextCb to undefined, to use passed in view for new contextCb\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (typeof pth === STRING) {\n\t\t\t\t\t\t\t\t\t\tobservePath(ob, pth.split(\".\"));\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tobserveObjectPaths(items.shift(), items, callback, contextCb);\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} else {\n\t\t\t\t\t\t\t\tobservePath(object, path.split(\".\"));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (!$isFunction(path) && path && path._cpfn) {\n\t\t\t\t\t\t\t// Path is an exprOb returned by a computed property - helper/data function (compiled expr function).\n\t\t\t\t\t\t\t// Get innerCb for updating the object\n\t\t\t\t\t\t\tinnerCb = unobserve ? path.cb : getInnerCb(path);\n\t\t\t\t\t\t\t// innerCb._ctx = callback._ctx; Could pass context (e.g. linkCtx) for use in a depends = function() {} call, so depends is different for different linkCtx's\n\t\t\t\t\t\t\tinnerCb._cId = callback._cId;\n\t\t\t\t\t\t\t// Set the same cbBindingsStore key as for callback, so when callback is disposed, disposal of innerCb happens too.\n\t\t\t\t\t\t\tinnerCb._inId = innerCb._inId || \".obIn\" + observeInnerCbKey++;\n\t\t\t\t\t\t\tif (path.bnd || path.prm && path.prm.length || !path.sb) {\n\t\t\t\t\t\t\t\t// If the exprOb is bound e.g. foo()^sub.path, or has parameters e.g. foo(bar) or is a leaf object (so no sub path) e.g. foo()\n\t\t\t\t\t\t\t\t// then observe changes on the object, or its parameters and sub-path\n\t\t\t\t\t\t\t\tinnerObserve([object], path.path, (path.prm.length ? [path.root||object] : []), path.prm, innerCb, contextCb, unobserve);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (path.sb) { // Has a subPath\n\t\t\t\t\t\t\t\t// Observe changes on the sub-path\n\t\t\t\t\t\t\t\tif (path.sb.prm) {\n\t\t\t\t\t\t\t\t\tpath.sb.root = object;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Set current object on exprOb.ob\n\t\t\t\t\t\t\t\tobserveObjectPaths(path.ob, [path.sb], callback, contextCb);\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\n\t\t\t\tvar pth,\n\t\t\t\t\tpths = [], // Array of paths for current object\n\t\t\t\t\tl = paths.length;\n\t\t\t\twhile (l--) { // Step backwards through paths and objects\n\t\t\t\t\tpth = paths[l];\n\t\t\t\t\tif (typeof pth === STRING || pth && (pth._ar || pth._cpfn)) {\n\t\t\t\t\t\tpths.unshift(pth); // This is a path so add to arr\n\t\t\t\t\t} else { // This is an object\n\t\t\t\t\t\tobserveObjectPaths(pth, pths, callback, contextCb);\n\t\t\t\t\t\tpths = []; // New array for next object\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n//END OF FUNCTIONS\n\n\t\t\tvar ns = observeStr,\n\t\t\t\tpaths = this != 1 // Using != for IE<10 bug- see jsviews/issues/237\n\t\t\t\t\t? concat.apply([], arguments) // Flatten the arguments - this is a 'recursive call' with params using the 'wrapped array'\n\t\t\t\t\t\t\t\t\t\t\t\t\t// style - such as innerObserve([object], path.path, [origRoot], path.prm, innerCb, ...);\n\t\t\t\t\t: slice.call(arguments), // Don't flatten - this is the first 'top-level call, to innerObserve.apply(1, paths)\n\t\t\t\tlastArg = paths.pop() || false,\n\t\t\t\tm = paths.length;\n\n\t\t\tif (typeof lastArg === STRING) { // If last arg is a string then this observe call is part of an observeAll call,\n\t\t\t\tallPath = lastArg; // and the last three args are the parentObs array, the filter, and the allPath string.\n\t\t\t\tparentObs = paths.pop();\n\t\t\t\tfilter = paths.pop();\n\t\t\t\tlastArg = !!paths.pop(); // unobserve\n\t\t\t\tm -= 3;\n\t\t\t}\n\t\t\tif (lastArg === !!lastArg) {\n\t\t\t\tunobserve = lastArg;\n\t\t\t\tlastArg = paths[m-1];\n\t\t\t\tlastArg = m && typeof lastArg !== STRING && (!lastArg || $isFunction(lastArg)) ? (m--, paths.pop()) : undefined;\n\t\t\t\tif (unobserve && !m && $isFunction(paths[0])) {\n\t\t\t\t\tlastArg = paths.shift();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcallback = lastArg;\n\t\t\tif (m && $isFunction(paths[m - 1])) {\n\t\t\t\tcontextCb = callback;\n\t\t\t\tlastArg = callback = paths.pop();\n\t\t\t\tm--;\n\t\t\t}\n\n\t\t\tif (unobserve && callback && !callback._cId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Use a unique namespace (e.g. obs7) associated with each observe() callback to allow unobserve to remove handlers\n\t\t\tns += callback\n\t\t\t\t? ((inId = callback._inId || \"\"), unobserve)\n\t\t\t\t\t? callback._cId + inId\n\t\t\t\t\t: (cbId = getCbKey(callback)) + inId\n\t\t\t\t: \"\";\n\n\t\t\tif (cbId && !unobserve) {\n\t\t\t\tcbBindings = cbBindingsStore[cbId] = cbBindingsStore[cbId] || {len: 0};\n\t\t\t}\n\n\t\t\tinitNsArr = initialNs && initialNs.match(rNotWhite) || [\"\"];\n\t\t\tinitNsArrLen = initNsArr.length;\n\n\t\t\twhile (initNsArrLen--) { // Step through multiple white-space separated namespaces if there are any\n\t\t\t\tinitialNs = initNsArr[initNsArrLen];\n\t\t\t\tif (unobserve && arguments.length < 3) {\n\t\t\t\t\tif (callback) {\n\t\t\t\t\t\tunobserveBinding(callback, cbBindingsStore[callback._cId]); // unobserve(handler) - unobserves this handler, all objects\n\t\t\t\t\t} else if (!paths[0]) {\n\t\t\t\t\t\tfor (p in cbBindingsStore) {\n\t\t\t\t\t\t\tunobserveBinding(callback, cbBindingsStore[p]); // unobserve() - unobserves all\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tobserveObjects(paths);\n\t\t\t}\n\t\t\tif (cbId && !cbBindings.len) {\n\t\t\t\t// If the cbBindings collection is empty we will remove it from the cbBindingsStore\n\t\t\t\tdelete cbBindingsStore[cbId];\n\t\t\t}\n\n\t\t\t// Return the cbBindings to the top-level caller, along with the cbId\n\t\t\treturn {cbId: cbId, bnd: cbBindings};\n\t\t}\n\n\t\tvar initialNs,\n\t\t\tallowArray = this == 1 ? 0 : 1, // If this == 1, this is a call from observeAndBind (doing binding of datalink expressions),\n\t\t\t// and tag.onArrayChange is not set to true. We don't bind arrayChange events in this scenario. Instead, {^{for}} and similar\n\t\t\t// do specific arrayChange binding to the tagCtx.args[0] value, in onAfterLink.\n\t\t\t// Note deliberately using this == 1, rather than this === 1 because of IE<10 bug - see jsviews/issues/237\n\t\t\tpaths = slice.call(arguments),\n\t\t\tpth = paths[0];\n\n\t\tif (typeof pth === STRING) {\n\t\t\tinitialNs = pth; // The first arg is a namespace, since it is a string\n\t\t\tpaths.shift();\n\t\t}\n\t\treturn innerObserve.apply(1, paths);\n\t};\n\n\tasyncBatch.wait = function() {\n\t\tvar batch = this;\n\t\tbatch._go = 1;\n\t\tsetTimeout(function() {\n\t\t\tbatch.trigger(true);\n\t\t\tbatch._go = 0;\n\t\t\tbatch.paths = {};\n\t\t});\n\t};\n\n\t$observable = function(ns, data, delay) {\n\t\tif (typeof ns !== STRING) {\n\t\t\tdelay = data;\n\t\t\tdata = ns;\n\t\t\tns = \"\";\n\t\t}\n\t\tdelay = delay === undefined ? $subSettingsAdvanced.asyncObserve : delay;\n\t\tvar observable = $isArray(data)\n\t\t\t? new ArrayObservable(ns, data)\n\t\t\t: new ObjectObservable(ns, data);\n\t\tif (delay) {\n\t\t\tif (delay === true) {\n\t\t\t\tobservable.async = true;\n\t\t\t\tdelay = asyncBatch;\n\t\t\t}\n\t\t\tif (!delay.trigger) {\n\t\t\t\tif ($isArray(delay)) {\n\t\t\t\t\tdelay.trigger = batchTrigger;\n\t\t\t\t\tdelay.paths = {};\n\t\t\t\t} else {\n\t\t\t\t\tdelay = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t\tobservable._batch = delay;\n\t\t}\n\t\treturn observable;\n\t};\n\n\t//========================== Initialize ==========================\n\n\t$.observable = $observable;\n\t$observable._fltr = function(path, object, parentObs, filter) {\n\t\tif (filter && $isFunction(filter)\n\t\t\t? filter(path, object, parentObs)\n\t\t\t: true // TODO Consider supporting filter being a string or strings to do RegEx filtering based on key and/or path\n\t\t) {\n\t\t\tobject = $isFunction(object)\n\t\t\t\t? object.set && object.call(parentObs[0]) // It is a getter/setter\n\t\t\t\t: object;\n\t\t\treturn typeof object === OBJECT && object;\n\t\t}\n\t};\n\n\t$observable.Object = ObjectObservable;\n\t$observable.Array = ArrayObservable;\n\t$.observe = $observable.observe = $observe;\n\t$.unobserve = $observable.unobserve = $unobserve;\n\t$observable._apply = observe_apply;\n\n\tObjectObservable.prototype = {\n\t\t_data: null,\n\n\t\tobserveAll: $observeAll,\n\t\tunobserveAll: $unobserveAll,\n\n\t\tdata: function() {\n\t\t\treturn this._data;\n\t\t},\n\n\t\tsetProperty: function(path, value, nonStrict, isCpfn) {\n\t\t\tpath = path || \"\";\n\t\t\tvar key, pair, parts, tempBatch,\n\t\t\t\tmulti = typeof path !== STRING, // Hash of paths\n\t\t\t\tself = this,\n\t\t\t\tobject = self._data,\n\t\t\t\tbatch = self._batch;\n\n\t\t\tif (object) {\n\t\t\t\tif (multi) {\n\t\t\t\t\tnonStrict = value;\n\t\t\t\t\tif ($isArray(path)) {\n\t\t\t\t\t\t// This is the array format generated by serializeArray. However, this has the problem that it coerces types to string,\n\t\t\t\t\t\t// and does not provide simple support of convertTo and convertFrom functions.\n\t\t\t\t\t\tkey = path.length;\n\t\t\t\t\t\twhile (key--) {\n\t\t\t\t\t\t\tpair = path[key];\n\t\t\t\t\t\t\tself.setProperty(pair.name, pair.value, nonStrict === undefined || nonStrict); //If nonStrict not specified, default to true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!batch) {\n\t\t\t\t\t\t\tself._batch = tempBatch = [];\n\t\t\t\t\t\t\ttempBatch.trigger = batchTrigger;\n\t\t\t\t\t\t\ttempBatch.paths = {};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (key in path) { // Object representation where property name is path and property value is value.\n\t\t\t\t\t\t\tself.setProperty(key, path[key], nonStrict);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempBatch) {\n\t\t\t\t\t\t\tself._batch.trigger();\n\t\t\t\t\t\t\tself._batch = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (path !== $expando) {\n\t\t\t\t\t// Simple single property case.\n\t\t\t\t\tparts = path.split(/[.^]/);\n\t\t\t\t\twhile (object && parts.length > 1) {\n\t\t\t\t\t\tobject = object[parts.shift()];\n\t\t\t\t\t}\n\t\t\t\t\tif (object) {\n\t\t\t\t\t\tself._setProperty(object, parts[0], value, nonStrict, isCpfn);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn self;\n\t\t},\n\n\t\tremoveProperty: function(path) {\n\t\t\tthis.setProperty(path, remove);\n\t\t\treturn this;\n\t\t},\n\n\t\t_setProperty: function(leaf, path, value, nonStrict, isCpfn) {\n\t\t\tvar setter, getter, removeProp, eventArgs, view,\n\t\t\t\tproperty = path ? leaf[path] : leaf;\n\t\t\tif ($isFunction(property) && !$isFunction(value)) {\n\t\t\t\tif (isCpfn && !property.set) {\n\t\t\t\t\treturn; // getter function with no setter defined. So will not trigger update\n\t\t\t\t}\telse if (property.set) {\n\t\t\t\t\t// Case of property setter/getter - with convention that property is getter and property.set is setter\n\t\t\t\t\tview = leaf._vw // Case of JsViews 2-way data-linking to an observable context parameter, with a setter.\n\t\t\t\t\t\t// The view will be the this pointer for getter and setter. Note: this is the one scenario where path is \"\".\n\t\t\t\t\t\t|| leaf;\n\t\t\t\t\tgetter = property;\n\t\t\t\t\tsetter = getter.set === true ? getter : getter.set;\n\t\t\t\t\tproperty = getter.call(view); // get - only treated as getter if also a setter. Otherwise it is simply a property of type function.\n\t\t\t\t\t// See unit tests 'Can observe properties of type function'.\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (property !== value || nonStrict && property != value) {\n\t\t\t\t// Optional non-strict equality, since serializeArray, and form-based editors can map numbers to strings, etc.\n\t\t\t\t// Date objects don't support != comparison. Treat as special case.\n\t\t\t\tif (!(property instanceof Date && value instanceof Date) || property > value || property < value) {\n\t\t\t\t\tif (setter) {\n\t\t\t\t\t\tsetter.call(view, value); // set\n\t\t\t\t\t\tvalue = getter.call(view); // get updated value\n\t\t\t\t\t} else if (removeProp = value === remove) {\n\t\t\t\t\t\tif (property !== undefined) {\n\t\t\t\t\t\t\tdelete leaf[path];\n\t\t\t\t\t\t\tvalue = undefined;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpath = undefined; // If value was already undefined, don't trigger handler for removeProp\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (path) {\n\t\t\t\t\t\tleaf[path] = value;\n\t\t\t\t\t}\n\t\t\t\t\tif (path) {\n\t\t\t\t\t\teventArgs = {change: \"set\", path: path, value: value, oldValue: property, remove: removeProp};\n\t\t\t\t\t\tif (leaf._ocp) {\n\t\t\t\t\t\t\teventArgs.ctxPrm = leaf._key;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._trigger(leaf, eventArgs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t_trigger: function(target, eventArgs, force) {\n\t\t\t$subSettings._cchCt++; // Since we are making observable data change, increment cacheCounter to clear cached values and recompute\n\t\t\tvar key, batch, previous,\n\t\t\t\tself = this;\n\t\t\tif ($.hasData(target)) {\n\t\t\t\tif (!force && (batch = self._batch)) {\n\t\t\t\t\tif (self.async && !batch._go) {\n\t\t\t\t\t\tbatch.wait();\n\t\t\t\t\t}\n\t\t\t\t\tbatch.push([self, target, eventArgs]);\n\t\t\t\t\tkey = $data(target).obId + eventArgs.path;\n\t\t\t\t\tif (previous = batch.paths[key]) {\n\t\t\t\t\t\tbatch[previous-1].skip = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbatch.paths[key] = batch.length;\n\t\t\t\t} else {\n\t\t\t\t\t$(target).triggerHandler(propertyChangeStr + (this._ns ? \".\" + /^\\S+/.exec(this._ns)[0] : \"\"), eventArgs); // If white-space separated namespaces, use first one only\n\t\t\t\t\teventArgs.oldValue = null; // Avoid holding on to stale objects\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tArrayObservable.prototype = {\n\t\t_data: null,\n\n\t\tobserveAll: $observeAll,\n\t\tunobserveAll: $unobserveAll,\n\n\t\tdata: function() {\n\t\t\treturn this._data;\n\t\t},\n\n\t\tinsert: function(index, data) {\n\t\t\tvar _data = this._data;\n\t\t\tif (arguments.length === 1) {\n\t\t\t\tdata = index;\n\t\t\t\tindex = _data.length;\n\t\t\t}\n\t\t\tindex = PARSEINT(index);\n\t\t\tif (index > -1) {\n\t\t\t\tdata = $isArray(data) ? data : [data];\n\t\t\t\t// data can be a single item (including a null/undefined value) or an array of items.\n\t\t\t\t// Note the provided items are inserted without being cloned, as direct references to the provided objects\n\n\t\t\t\tif (data.length) {\n\t\t\t\t\tthis._insert(index, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\n\t\t_insert: function(index, data) {\n\t\t\tvar _data = this._data,\n\t\t\t\toldLength = _data.length;\n\t\t\tif (index > oldLength) {\n\t\t\t\tindex = oldLength;\n\t\t\t}\n\t\t\tsplice.apply(_data, [index, 0].concat(data));\n\t\t\tthis._trigger({change: \"insert\", index: index, items: data}, oldLength);\n\t\t},\n\n\t\tremove: function(index, numToRemove) {\n\t\t\tvar items,\n\t\t\t\t_data = this._data;\n\n\t\t\tif (index === undefined) {\n\t\t\t\tindex = _data.length - 1;\n\t\t\t}\n\n\t\t\tindex = PARSEINT(index);\n\t\t\tnumToRemove = numToRemove ? PARSEINT(numToRemove) : numToRemove === 0 ? 0 : 1; // if null or undefined: remove 1\n\t\t\tif (numToRemove > 0 && index > -1) {\n\t\t\t\titems = _data.slice(index, index + numToRemove);\n\t\t\t\tif (numToRemove = items.length) {\n\t\t\t\t\tthis._remove(index, numToRemove, items);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\n\t\t_remove: function(index, numToRemove, items) {\n\t\t\tvar _data = this._data,\n\t\t\t\toldLength = _data.length;\n\n\t\t\t_data.splice(index, numToRemove);\n\t\t\tthis._trigger({change: \"remove\", index: index, items: items}, oldLength);\n\t\t},\n\n\t\tmove: function(oldIndex, newIndex, numToMove) {\n\t\t\tnumToMove = numToMove ? PARSEINT(numToMove) : numToMove === 0 ? 0 : 1; // if null or undefined: move 1\n\t\t\toldIndex = PARSEINT(oldIndex);\n\t\t\tnewIndex = PARSEINT(newIndex);\n\n\t\t\tif (numToMove > 0 && oldIndex > -1 && newIndex > -1 && oldIndex !== newIndex) {\n\t\t\t\tthis._move(oldIndex, newIndex, numToMove);\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\n\t\t_move: function(oldIndex, newIndex, numToMove) {\n\t\t\tvar items,\n\t\t\t\t_data = this._data,\n\t\t\t\toldLength = _data.length,\n\t\t\t\texcess = oldIndex + numToMove - oldLength;\n\t\t\tif (excess > 0) {\n\t\t\t\tnumToMove -= excess;\n\t\t\t}\n\t\t\tif (numToMove) {\n\t\t\t\titems = _data.splice(oldIndex, numToMove); // remove\n\t\t\t\tif (newIndex > _data.length) {\n\t\t\t\t\tnewIndex = _data.length;\n\t\t\t\t}\n\t\t\t\tsplice.apply(_data, [newIndex, 0].concat(items)); //re-insert\n\t\t\t\tif (newIndex !== oldIndex) {\n\t\t\t\t\tthis._trigger({change: \"move\", oldIndex: oldIndex, index: newIndex, items: items}, oldLength);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\trefresh: function(newItems) {\n\t\t\tfunction insertAdded() {\n\t\t\t\tif (k) {\n\t\t\t\t\tself.insert(j-k, addedItems); // Not found in original array - so insert\n\t\t\t\t\tdataLength += k;\n\t\t\t\t\ti += k;\n\t\t\t\t\tk = 0;\n\t\t\t\t\taddedItems = [];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For refresh operation we iteratively step through the target array and sort by move/add/remove operations on the source array until they match\n\t\t\tvar i, j, k, newItem, num,\n\t\t\t\tself = this,\n\t\t\t\taddedItems = [],\n\t\t\t\tdata = self._data,\n\t\t\t\toldItems = data.slice(),\n\t\t\t\toldLength = data.length,\n\t\t\t\tdataLength = oldLength,\n\t\t\t\tnewLength = newItems.length;\n\t\t\tself._srt = true; // Flag for sorting during refresh\n\t\t\tfor (j=k=0; j<newLength; j++) {\n\t\t\t\tif ((newItem = newItems[j]) === data[j-k]) {\n\t\t\t\t\tinsertAdded();\n\t\t\t\t} else {\n\t\t\t\t\tfor (i=j-k; i<dataLength && newItem !== data[i]; i++) {}\n\t\t\t\t\tif (i<dataLength) {\n\t\t\t\t\t\tinsertAdded();\n\t\t\t\t\t\tnum = 0;\n\t\t\t\t\t\twhile (num++ < newLength-i && newItems[j+num] === data[i+num]);\n\t\t\t\t\t\tself.move(i, j, num); // Found newItem in original array - so move it to new position\n\t\t\t\t\t\tj += num - 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tk++;\n\t\t\t\t\t\taddedItems.push(newItem); // Not found in original array - so insert\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tinsertAdded();\n\t\t\tif (dataLength > j) {\n\t\t\t\tself.remove(j, dataLength - j);\n\t\t\t}\n\t\t\tself._srt = undefined; // We have finished sort operations during refresh\n\t\t\tif (oldLength || newLength) {\n\t\t\t\tself._trigger({change: \"refresh\", oldItems: oldItems}, oldLength);\n\t\t\t}\n\t\t\treturn self;\n\t\t},\n\n\t\t_trigger: function(eventArgs, oldLength, force) {\n\t\t\t$subSettings._cchCt++; // Since we are making observable data change, increment cacheCounter to clear cached values and recompute\n\t\t\tvar length, _data, batch,\n\t\t\t\tself = this;\n\t\t\tif ($.hasData(_data = self._data)) {\n\t\t\t\tif (!force && (batch = self._batch)) {\n\t\t\t\t\teventArgs._dly = true; // Delayed event (async or batch change)\n\t\t\t\t\tbatch.push([self, eventArgs, oldLength]);\n\t\t\t\t\tif (self.async && !batch._go) {\n\t\t\t\t\t\tbatch.wait();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlength = _data.length;\n\t\t\t\t\t_data = $([_data]);\n\n\t\t\t\t\tif (self._srt) {\n\t\t\t\t\t\teventArgs.refresh = true; // We are sorting during refresh\n\t\t\t\t\t} else if (length !== oldLength) { // We have finished sort operations during refresh\n\t\t\t\t\t\t_data.triggerHandler(propertyChangeStr, {change: \"set\", path: \"length\", value: length, oldValue: oldLength});\n\t\t\t\t\t}\n\t\t\t\t\t_data.triggerHandler(arrayChangeStr + (self._ns ? \".\" + /^\\S+/.exec(self._ns)[0] : \"\"), eventArgs); // If white-space separated namespaces, use first one only\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t$eventSpecial[propertyChangeStr] = $eventSpecial[arrayChangeStr] = {\n\t\t// Register a jQuery special 'remove' event, to access the data associated with handlers being removed by jQuery.off().\n\t\t// We get data.cb._cId from the event handleObj and get the corresponding cbBindings hash from the cbBindingsStore,\n\t\t// then remove this object from that bindings hash - if the object does not have any other handlers associated with the same callback.\n\t\tremove: function (handleObj) {\n\t\t\tvar cbBindings, found, events, l, data,\n\t\t\t\tevData = handleObj.data;\n\t\t\tif ((evData) && (evData.off = true, evData = evData.cb)) { //Set off = true as marker for disposed event\n\t\t\t\t// Get the cb._cId from handleObj.data.cb._cId\n\t\t\t\tif (cbBindings = cbBindingsStore[evData._cId]) {\n\t\t\t\t\t// There were bindings for this callback. If this was the last one, we'll remove it.\n\t\t\t\t\tevents = $._data(this).events[handleObj.type];\n\t\t\t\t\tl = events.length;\n\t\t\t\t\twhile (l-- && !found) {\n\t\t\t\t\t\tfound = (data = events[l].data) && data.cb && data.cb._cId === evData._cId;\n\t\t\t\t\t\t// Found another one with same callback (though may be a different innerCallback)\n\t\t\t\t\t}\n\t\t\t\t\tif (!found) {\n\t\t\t\t\t\tif (--cbBindings.len) {\n\t\t\t\t\t\t\tdelete cbBindings[$data(this).obId];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdelete cbBindingsStore[evData._cId]; // If the cbBindings collection is empty we will remove it from the cbBindingsStore\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//==========================\n// dataMap with data-linking\n//==========================\n\n\t$views.map = function(mapDef) {\n\t\tfunction Map(source, options, oldMapOrTarget, unbound) {\n\t\t\tvar changing, updatedMap,\n\t\t\t\tmap = this;\n\t\t\tif (map.src) {\n\t\t\t\tmap.unmap(); // We are re-mapping a new source\n\t\t\t}\n\t\t\tif (options) {\n\t\t\t\toptions.map = map;\n\t\t\t}\n\t\t\tif (typeof source === OBJECT || $isFunction(source)) {\n\t\t\t\tmap.src = source;\n\t\t\t\tif (unbound) {\n\t\t\t\t\tmap.tgt = mapDef.getTgt(source, options);\n\t\t\t\t} else {\n\t\t\t\t\tif (oldMapOrTarget) {\n\t\t\t\t\t\tmap.tgt = oldMapOrTarget.tgt || $isArray(oldMapOrTarget) && oldMapOrTarget; // Can provide an existing map, or a target array to be used on new map\n\t\t\t\t\t}\n\t\t\t\t\tmap.tgt = map.tgt || [];\n\t\t\t\t\tmap.options = options || map.options;\n\t\t\t\t\tif (updatedMap = map.update()) {\n\t\t\t\t\t\tmap = updatedMap; // If updating returns another map, then we can replace this one (so no need to bind it)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (mapDef.obsSrc) {\n\t\t\t\t\t\t\t$observable(map.src).observeAll(map.obs = function(ev, eventArgs) {\n\t\t\t\t\t\t\t\tif (!changing && !eventArgs.refresh) {\n\t\t\t\t\t\t\t\t\tchanging = true;\n\t\t\t\t\t\t\t\t\tmapDef.obsSrc(map, ev, eventArgs);\n\t\t\t\t\t\t\t\t\tchanging = undefined;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, map.srcFlt);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (mapDef.obsTgt) {\n\t\t\t\t\t\t\t$observable(map.tgt).observeAll(map.obt = function(ev, eventArgs) {\n\t\t\t\t\t\t\t\tif (!changing && !map.tgt._updt) {\n\t\t\t\t\t\t\t\t\tchanging = true;\n\t\t\t\t\t\t\t\t\tmapDef.obsTgt(map, ev, eventArgs);\n\t\t\t\t\t\t\t\t\tchanging = undefined;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, map.tgtFlt);\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\n\t\tif ($isFunction(mapDef)) {\n\t\t\t// Simple map declared as function\n\t\t\tmapDef = {\n\t\t\t\tgetTgt: mapDef\n\t\t\t};\n\t\t}\n\n\t\tif (mapDef.baseMap) {\n\t\t\tmapDef = $.extend({}, mapDef.baseMap, mapDef);\n\t\t}\n\n\t\tmapDef.map = function(source, options, oldMap, unbound) {\n\t\t\treturn new Map(source, options, oldMap, unbound);\n\t\t};\n\n\t\t(Map.prototype = {\n\t\t\tsrcFlt: mapDef.srcFlt || shallowFilter, // default to shallowFilter\n\t\t\ttgtFlt: mapDef.tgtFlt || shallowFilter,\n\t\t\tupdate: function(options) {\n\t\t\t\tvar oldMap, newMap,\n\t\t\t\t\tmap = this,\n\t\t\t\t\ttgt = map.tgt;\n\t\t\t\tif (!tgt._updt) {\n\t\t\t\t\ttgt._updt = true;\n\t\t\t\t\toldMap = map.options && map.options.map;\n\t\t\t\t\t$observable(tgt).refresh(mapDef.getTgt(map.src, map.options = options || map.options));\n\t\t\t\t\ttgt._updt = false;\n\t\t\t\t\tnewMap = map.options && map.options.map;\n\t\t\t\t\tif (newMap && oldMap !== newMap) {\n\t\t\t\t\t\treturn newMap;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tobserve: function(deps, linkCtx) { // Listen to observable changes of mapProps, and call map.update when change happens\n\t\t\t\tvar map = this,\n\t\t\t\t\toptions = map.options;\n\t\t\t\tif (map.obmp) {\n\t\t\t\t\t// There is a previous handler observing the mapProps\n\t\t\t\t\t$unobserve(map.obmp);\n\t\t\t\t}\n\t\t\t\tmap.obmp = function() {\n\t\t\t\t\t// Observe changes in the mapProps (\"filter\", \"sort\", \"reverse\", \"start\", \"end\")\n\t\t\t\t\tvar newTagCtx = linkCtx.fn(linkCtx.data, linkCtx.view, $sub)[options.index]; // Updated tagCtx props and args\n\t\t\t\t\t$.extend(options.props, newTagCtx.props); // Update props to new values\n\t\t\t\t\toptions.args = newTagCtx.args; // Update args to new values\n\t\t\t\t\tmap.update(); // Update the map target array, based on new mapProp values\n\t\t\t\t};\n\t\t\t\t$observable._apply(1, linkCtx.data, dependsPaths(deps, linkCtx.tag, map.obmp), map.obmp, linkCtx._ctxCb);\n\t\t\t},\n\t\t\tunmap: function() {\n\t\t\t\tvar map = this;\n\t\t\t\tif (map.src && map.obs) {\n\t\t\t\t\t$observable(map.src).unobserveAll(map.obs, map.srcFlt);\n\t\t\t\t}\n\t\t\t\tif (map.tgt && map.obt) {\n\t\t\t\t\t$observable(map.tgt).unobserveAll(map.obt, map.tgtFlt);\n\t\t\t\t}\n\t\t\t\tif (map.obmp) {\n\t\t\t\t\t$unobserve(map.obmp);\n\t\t\t\t}\n\t\t\t\tmap.src = undefined;\n\t\t\t},\n\t\t\tmap: Map,\n\t\t\t_def: mapDef\n\t\t}).constructor = Map;\n\n\t\treturn mapDef;\n\t};\n\n\t$sub.advSet = function() { // refresh advanced settings\n\t\t$sub = this; // If JsRender is loaded after jquery.observable, then this sets $sub to $.views.sub\n\t\t$subSettingsAdvanced = $subSettings.advanced;\n\t\tglobal._jsv = $subSettingsAdvanced._jsv\n\t\t\t? { // create global _jsv, for accessing views, etc\n\t\t\t\t\tcbBindings: cbBindingsStore\n\t\t\t\t}\n\t\t\t: undefined; // In IE8 cannot do delete global._jsv\n\t};\n\t$sub._dp = dependsPaths;\n\t$sub._gck = getCbKey;\n\t$sub._obs = $observe;\n\t$subSettings._cchCt = 0; // Counter for clearing cached values for getCache() call\n\t$subSettingsAdvanced = $subSettings.advanced = $subSettingsAdvanced || {\n\t\tuseViews: false,\n\t\t_jsv: false // For global access to JsViews store\n\t};\n}\n\n//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< JsViews >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n/* JsViews:\n * Interactive data-driven views using templates and data-linking.\n * See https://www.jsviews.com/#jsviews and http://github.com/BorisMoore/jsviews\n * Copyright 2024, Boris Moore\n * Released under the MIT License.\n */\n\n//========================== Top-level vars ==========================\n\n$viewsSettings = $views.settings;\n$subSettings = $sub.settings;\n$subSettingsAdvanced = $subSettings.advanced;\n$converters = $views.converters;\n$.templates = $templates = $views.templates;\n$tags = $views.tags;\nrFirstElem = /<(?!script)(\\w+)[>\\s]/;\nSTRING = \"string\";\n\nif ($.link) { return $; } // JsViews is already loaded\n\n$subSettings.trigger = true;\n\nvar activeBody, rTagDatalink, $view, $viewsLinkAttr, linkViewsSel, wrapMap, viewStore, oldAdvSet, useInput,\n\tisIE = window.navigator.userAgent,\n\tTEXTCONTENT = document.textContent !== undefined ? \"textContent\" : \"innerText\",\n\tjsvAttrStr = \"data-jsv\",\n\telementChangeStr = \"change.jsv\",\n\tonBeforeChangeStr = \"onBeforeChange\",\n\tonAfterChangeStr = \"onAfterChange\",\n\tonAfterCreateStr = \"onAfterCreate\",\n\tCHECKED = \"checked\",\n\tCHECKBOX = \"checkbox\",\n\tRADIO = \"radio\",\n\tRADIOINPUT = \"input[type=\",\n\tCHECKBOXINPUT = RADIOINPUT + CHECKBOX + \"]\", // input[type=checkbox]\n\tNONE = \"none\",\n\tVALUE = \"value\",\n\tSCRIPT = \"SCRIPT\",\n\tTRUE = \"true\",\n\tcloseScript = '\"></script>',\n\topenScript = '<script type=\"jsv',\n\tdeferAttr = jsvAttrStr + \"-df\",\n\tbindElsSel = \"script,[\" + jsvAttrStr + \"]\",\n\tfnSetters = {\n\t\tvalue: \"val\",\n\t\tinput: \"val\",\n\t\thtml: HTML,\n\t\ttext: \"text\"\n\t},\n\tvalueBinding = {from: VALUE, to: VALUE},\n\tisCleanCall = 0,\n\toldCleanData = $.cleanData,\n\toldJsvDelimiters = $viewsSettings.delimiters,\n\tlinkExprStore = {}, // Compiled functions for data-link expressions\n\tsafeFragment = document.createDocumentFragment(),\n\tqsa = document.querySelector,\n\n\t// elContent maps tagNames which have only element content, so may not support script nodes.\n\telContent = {ol: 1, ul: 1, table: 1, tbody: 1, thead: 1, tfoot: 1, tr: 1, colgroup: 1, dl: 1, select: 1, optgroup: 1, svg: 1, svg_ns: 1},\n\tbadParent = {tr: \"table\"},\n\tvoidElems = {br: 1, img: 1, input: 1, hr: 1, area: 1, base: 1, col: 1, link: 1, meta: 1,\n\t\tcommand: 1, embed: 1, keygen: 1, param: 1, source: 1, track: 1, wbr: 1},\n\tdisplayStyles = {},\n\tbindingStore = {},\n\tbindingKey = 1,\n\trViewPath = /^#(view\\.?)?/,\n\trConvertMarkers = /((\\/>)|<\\/(\\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\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 <select> 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.slice();\n\t\t\tind = $inArray(sourceElem.value, vals);\n\t\t\tif (ind > -1 && !sourceElem.checked) {\n\t\t\t\tvals.splice(ind, 1); // Unchecking this checkbox\n\t\t\t} else if (ind < 0 && sourceElem.checked) {\n\t\t\t\tvals.push(sourceElem.value); // Checking this checkbox\n\t\t\t}\n\t\t\tsourceValues = [vals];\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\t\trSplitBindings = /&(\\d+)\\+?/g;\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\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 \"change\"\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: <input type=\"radio\" data-link=\"value{:name} {:#get('data').data.currency:} \" .../>\n\t\t\t// or (allowing any order for the binding expressions):\n\t\t\t// <input type=\"radio\" value=\"{{:name}}\" data-link=\"{:#get('data').data.currency:} value^{:name}\" .../>\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); // <select> (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 <option> 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 <select>. 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 <span title=\"<a/>\"></span>\">\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 <br>.\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 <tbody> - to be completed for robust insertion of deferred bindings etc.\n\t\t\t//if (closeTag === \"table\" && parentTag === \"tbody\") {\n\t\t\t//\tpreceding = \"</tbody>\" + 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 <br/>, 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 </input>\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: <tr data-jsv=\"/2_#6_\"> - 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 <tbody> - to be completed for robust insertion of deferred bindings etc.\n\t\t\t\t//if (tag === \"<tr\" && parentTag === \"table\") {\n\t\t\t\t//\ttagStack.unshift(parentTag);\n\t\t\t\t//\tparentTag = \"tbody\";\n\t\t\t\t//\tpreceding += \"<\" + parentTag + \">\";\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: <script type=\"jsv3/\"></script> - 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// \"<table {{if ...}}...{{/if}}... >\" or \"<table {{if ...}}...> ...{{/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 <tbody>\n\t\t\t\t// TODO: replace this by smart insertion of <tbody> tags\n\t\t\t\terror('Parent of <tr> must be <tbody>');\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 <span> as child of <tr>, 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. <input data-link=\"{:firstName:} title{>~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}\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. <input data-link=\"~wd\"/> 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, select2) {\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 select2\t\t\t\t\t\t\t// select2 is optional selector for an additional filtering. e.g checkboxgroup with\n\t\t\t? nodes.filter(select2)\t\t// selector for binding to subset of checkbox <input> elements\n\t\t\t: 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(forOrIfTagCtx, linkCtx, eventArgs, ev) {\n\t\t\t// domChange notification support, called by {^{for}}, onArrayChange, {^{if}} onAfterLink etc.\n\t\t\tvar bindId, linkTag, view, elem,\n\t\t\t\ttag = theTag,\n\t\t\t\tdomChangeNotification = \"jsv-domchange\",\n\t\t\t\trSplitBindings = /&(\\d+)\\+?/g,\n\t\t\t\ttagParElem = tag.parentElem,\n\t\t\t\thasListener = $._data(tagParElem).events;\n\t\t\tif (hasListener && hasListener[domChangeNotification]) {\n\t\t\t\t// If the parent element of this tag has a 'jsv-domchange' event handler binding, we will trigger it.\n\t\t\t\t// e.g. <ul data-link=\"{on 'jsv-domchange' ~root.domchange}\">, or <select data-link=\"selected\">...\n\t\t\t\t$(tagParElem).triggerHandler(domChangeNotification, arguments);\n\t\t\t}\n\t\t\twhile (tagParElem !== activeBody) { // Step up through inline tags, whether unlinked, or data-linked with same 'tagParElem' parentElem\n\t\t\t\twhile (tag && (!tag.parentElem || tag.parentElem === tagParElem)) {\n\t\t\t\t\tif (tag.onDomChange) { // If inline tag has an onDomChange method, invoke it\n\t\t\t\t\t\ttag.onDomChange(tagCtx, linkCtx, eventArgs, ev);\n\t\t\t\t\t}\n\t\t\t\t\tview = tag.tagCtx.view || topView;\n\t\t\t\t\ttag = view.tag;\n\t\t\t\t\twhile (!tag && view.parent && !view.isTop) { // Step up through parent views, and find next parent tag\n\t\t\t\t\t\tview = view.parent;\n\t\t\t\t\t\ttag = view.tag;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telem = tagParElem; // We will step through elements from the parentElem of the previous tag\n\t\t\t\ttagParElem = tag && tag.parentElem || activeBody; // We will stop on element inside the parentElem of the next tag\n\t\t\t\twhile (elem && elem !== tagParElem) { // Step up through parentElements\n\t\t\t\t\twhile (bindId = rSplitBindings.exec(elem._jsvBnd)) { // Step through linked tag bindings on this elem (_jsvBnd has syntax: \"&bindingId1&bindingId2\")\n\t\t\t\t\t\tif (linkTag = bindingStore[bindId[1]]) {\n\t\t\t\t\t\t\tlinkTag = linkTag.linkCtx.tag;\n\t\t\t\t\t\t\tif (linkTag && linkTag.onDomChange) { // If linked tag has an onDomChange method, invoke it\n\t\t\t\t\t\t\t\tlinkTag.onDomChange(tagCtx, linkCtx, eventArgs, ev);\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\telem = elem.parentElement;\n\t\t\t\t}\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 (; i<l && !$isFunction(args[i]); i++); // Handler is first arg of type function\n\t\t\ttag._hi = l>i && 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 <button> 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 = \"<button>\" + (content || tagCtx.params.args[i] || \"noop\") + \"</button>\";\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 <button>. 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 $linkedElem, l,\n\t\t\t\ttag = this,\n\t\t\t\tfilter = tagCtx.args[1], // args[1] is an optional selector to choose a filtered subset of radio buttons\n\t\t\t\tlinkExpr = tagCtx.params.args[0],\n\t\t\t\tpropParams = tagCtx.params.props,\n\t\t\t\tuseDisable = propParams && propParams.disabled;\n\n\t\t\tif (tag.inline) {\n\t\t\t\t$linkedElem = tag.contents(true, RADIOINPUT, filter);\n\t\t\t} else {\n\t\t\t\t$linkedElem = $(RADIOINPUT, linkCtx.elem);\n\t\t\t\tif (filter) {\n\t\t\t\t\t$linkedElem = $linkedElem.filter(filter); // Obtain filtered list of radio inputs\n\t\t\t\t}\n\t\t\t}\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// Data-link each checkbox input element using the checkboxgroup data-link expression\n\t\t\tfor (l in propParams) {\n\t\t\t\tlinkExpr += \" \" + l + \"=\" + propParams[l];\n\t\t\t}\n\t\t\t$linkedElem.link(linkExpr, linkCtx.data, undefined, undefined, linkCtx.view); // data-link the checkboxes\n\t\t\ttag.linkedElem = $linkedElem;\n\n\t\t\t// This onDomChange method is called by nested tags such as {^{for}} or {^{if}}, when DOM contents are changed\n\t\t\ttag.onDomChange = function(forOrIfTagCtx, linkCtx, eventArgs, ev) {\n\t\t\t\tvar linkedElem, l,\n\t\t\t\t\tval = tag.cvtArgs()[0];\n\n\t\t\t\ttag.linkedElem = $linkedElem = tag.contents(true, RADIOINPUT, filter); // Obtain updated (possibly filtered) list\n\t\t\t\tl = $linkedElem.length;\n\t\t\t\t// Contents may have changed so recreate $linkedElem for any additional radio button input elements\n\t\t\t\twhile (l--) {\n\t\t\t\t\t// Configure binding and name for each radio input element\n\t\t\t\t\tlinkedElem = $linkedElem[l];\n\t\t\t\t\tif (!linkedElem._jsvLkEl) {\n\t\t\t\t\t\t// This is a new inserted radio button, so we will data-link it based on the radiogroup binding\n\t\t\t\t\t\tlinkedElem.name = linkedElem.name || tag.name;\n\t\t\t\t\t\tlinkedElem._jsvLkEl = tag;\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\t$.link(linkExpr, linkedElem, linkCtx.data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\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\tflow: true,\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 $linkedElem, l,\n\t\t\t\ttag = this,\n\t\t\t\tfilter = tagCtx.args[1], // args[1] is an optional selector to choose a filtered subset of checkboxes\n\t\t\t\tlinkExpr = tagCtx.params.args[0],\n\t\t\t\tpropParams = tagCtx.params.props,\n\t\t\t\tuseDisable = propParams && propParams.disabled;\n\n\t\t\tif (tag.inline) {\n\t\t\t\t$linkedElem = tag.contents(true, CHECKBOXINPUT, filter); // Obtain (optionally filtered) list of checkbox elements\n\t\t\t} else {\n\t\t\t\ttag.lateRender = true;\n\t\t\t\t$linkedElem = $(CHECKBOXINPUT, linkCtx.elem); // Obtain list of checkbox inputs\n\t\t\t\tif (filter) {\n\t\t\t\t\t$linkedElem = $linkedElem.filter(filter); // Filter the list\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Configure the name for each checkbox input element\n\t\t\tl = $linkedElem.length;\n\t\t\twhile (l--) {\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\t// Data-link each checkbox input element using the checkboxgroup data-link expression\n\t\t\tfor (l in propParams) {\n\t\t\t\tlinkExpr += \" \" + l + \"=\" + propParams[l];\n\t\t\t}\n\t\t\t$linkedElem.link(linkExpr, linkCtx.data, undefined, undefined, linkCtx.view); // data-link the checkboxes\n\t\t\ttag.linkedElem = $linkedElem;\n\n\t\t\t// This onDomChange method is called by nested tags such as {^{for}} or {^{if}}, when DOM contents are changed\n\t\t\ttag.onDomChange = function(forOrIfTagCtx, linkCtx, eventArgs, ev) {\n\t\t\t\tvar linkedElem,\n\t\t\t\t\t$linkedElem = tag.contents(true, CHECKBOXINPUT, filter), // Obtain updated (possibly filtered) list\n\t\t\t\t\tl = $linkedElem.length;\n\t\t\t\t// Contents may have changed so recreate $linkedElem for any additional checkbox input elements\n\t\t\t\twhile (l--) {\n\t\t\t\t\t// Configure binding and name for each checkbox input element\n\t\t\t\t\tlinkedElem = $linkedElem[l];\n\t\t\t\t\tif (useDisable) {\n\t\t\t\t\t\tlinkedElem.disabled = !!tagCtx.props.disabled;\n\t\t\t\t\t}\n\t\t\t\t\tif (!linkedElem._jsvSel) {\n\t\t\t\t\t\t// This is a new inserted checkbox, so we will data-link it based on the checkboxgroup binding\n\t\t\t\t\t\tlinkedElem.name = linkedElem.name || tag.name;\n\t\t\t\t\t\t$.link(linkExpr, linkedElem, linkCtx.data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\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, tagCtx.args[1]).prop(\"disabled\", !!tagCtx.props.disabled);\n\t\t\t\t// args[1] is an optional selector to choose filtered subset of checkboxes\n\t\t\t}\n\t\t},\n\t\tflow: true,\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, ev); // Call onDomChange method on ancestors such as checkboxgroup, to notify new content\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, ev); // Call onDomChange method on ancestors such as checkboxgroup, to notify new content\n\t\t}\n\t},\n\tonAfterLink: function() {\n\t\tvar data, map, props, tagCtx,\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, ev); // Call onDomChange method on ancestors such as checkboxgroup, to notify new content\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, \"<select multiple='multiple'>\", \"</select>\"],\n\t\tlegend: [1, \"<fieldset>\", \"</fieldset>\"],\n\t\tarea: [1, \"<map>\", \"</map>\"],\n\t\tparam: [1, \"<object>\", \"</object>\"],\n\t\tthead: [1, \"<table>\", \"</table>\"],\n\t\ttr: [2, \"<table><tbody>\", \"</tbody></table>\"],\n\t\ttd: [3, \"<table><tbody><tr>\", \"</tr></tbody></table>\"],\n\t\tcol: [2, \"<table><tbody></tbody><colgroup>\", \"</colgroup></table>\"],\n\t\tsvg_ns: [1, \"<svg>\", \"</svg>\"],\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<div>\", \"</div>\"]\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));"]}