forked from BorisMoore/jsviews
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsviews.min.js
5 lines (5 loc) · 62.5 KB
/
jsviews.min.js
1
2
3
4
5
/*! jsviews.js v0.9.87 (Beta) single-file version: http://jsviews.com/ */
/*! includes JsRender, JsObservable and JsViews - see: http://jsviews.com/#download */
!function(e,t){var n=t.jQuery;"object"==typeof exports?module.exports=n?e(t,n):function(n){return e(t,n)}:"function"==typeof define&&define.amd?define(["jquery"],function(n){return e(t,n)}):e(t,!1)}(function(e,t){"use strict";function n(e,t){return function(){var n,r=this,i=r.base;return r.base=e,n=t.apply(r,arguments),r.base=i,n}}function r(e,t){return ze(t)&&(t=n(e?e._d?e:n(a,e):a,t),t._d=1),t}function i(e,t){for(var n in t.props)!wt.test(n)||e[n]&&e[n].fix||(e[n]=r(e.constructor.prototype[n],t.props[n]))}function o(e){return e}function a(){return""}function s(e){try{throw console.log("JsRender dbg breakpoint: "+e),"dbg breakpoint"}catch(t){}return this.base?this.baseApply(arguments):e}function l(e){this.name=(t.link?"JsViews":"JsRender")+" Error",this.message=e||this.name}function d(e,t){if(e){for(var n in t)e[n]=t[n];return e}}function c(e,t,n){return e?Qe(e)?c.apply(De,e):(et.delimiters=[e,t,st=n?n.charAt(0):st],rt=e.charAt(0),it=e.charAt(1),ot=t.charAt(0),at=t.charAt(1),e="\\"+rt+"(\\"+st+")?\\"+it,t="\\"+ot+"\\"+at,Oe="(?:(\\w+(?=[\\/\\s\\"+ot+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+ot+"]|\\"+ot+"(?!\\"+at+"))*?)",Ye.rTag="(?:"+Oe+")",Oe=new RegExp("(?:"+e+Oe+"(\\/)?|\\"+rt+"(\\"+st+")?\\"+it+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+t,"g"),Ye.rTmpl=new RegExp("^\\s|\\s$|<.*>|([^\\\\]|^)[{}]|"+e+".*"+t),nt):et.delimiters}function p(e,t){t||e===!0||(t=e,e=void 0);var n,r,i,o,a=this,s=!t||"root"===t;if(e){if(o=t&&a.type===t&&a,!o)if(n=a.views,a._.useKey){for(r in n)if(o=t?n[r].get(e,t):n[r])break}else for(r=0,i=n.length;!o&&r<i;r++)o=t?n[r].get(e,t):n[r]}else if(s)o=a.root;else for(;a&&!o;)o=a.type===t?a:void 0,a=a.parent;return o}function f(){var e=this.get("item");return e?e.index:void 0}function u(){return this.index}function v(t,n,r){var i,o,a,s,l=this,c=!dt&&void 0!==n,p=l.ctx;if(t in p||t in(p=Ze)){if(a=p&&p[t],"tag"===t||"root"===t||"parentTags"===t||l._.it===t)return a}else p=void 0;if((!a||!ze(a)&&l.linked||l.tagCtx)&&(a&&a._cxp||(p!==Ze&&(l=l.ctx&&l.ctx.tag||l.root,p=l._ocps,a=p&&p[t]||a),a&&a._cxp||!r&&!c||(a=Ye._crcp(t,a,l,p))),s=a&&a._cxp)){if(c)return Ye._ucp(t,n,l,s);if(r)return o=a[1]?Ye._ceo(a[1].deps):[pt],o.unshift(a[0]),o._cxp=s,o;a=a[1]?s.tag&&s.tag.cvtArgs?s.tag.cvtArgs(void 0,1,s.tagElse)[s.ind]:a[1](a[0].data,a[0],Ye):a[0]._ocp}return a&&ze(a)&&(i=function(){return a.apply(this&&this!==e?this:l,arguments)},d(i,a),i._vw=l),i||a}function g(e){return e&&(e.fn?e:this.getRsc("templates",e)||We(e))}function h(e,t,n,r){var o,a,s="number"==typeof n&&t.tmpl.bnds[n-1],l=t.linkCtx;return void 0===r&&s&&s._lr&&(r=""),void 0!==r?n=r={props:{},args:[r]}:s&&(n=s(t.data,t,Ye)),s=s._bd&&s,a=n.args[0],(e||s)&&(o=l&&l.tag,n.view=t,o||(o=d(new Ye._tg,{_:{inline:!l,bnd:s,unlinked:!0},tagName:":",cvt:e,flow:!0,tagCtx:n}),l&&(l.tag=o,o.linkCtx=l),n.ctx=H(n.ctx,(l?l.view:t).ctx),i(o,n)),o._er=r&&a,o.ctx=n.ctx||o.ctx||{},n.ctx=void 0,a=o.cvtArgs("true"!==e&&e)[0]),a=s&&t._.onRender?t._.onRender(a,t,o):a,void 0!=a?a:""}function _(e,t,n){var r,i,o,a,s,l,d=this;if(d.tagName?(l=d,d=l.tagCtxs?l.tagCtxs[n||0]:l.tagCtx):(l=d.tag,n=d.index),s=l.bindTo,a=d.args,e=e||l.convert,""+e===e&&(e=d.view.getRsc("converters",e)||$("Unknown converter: '"+e+"'")),a.length||l.argDefault===!1||d.index?e&&!t&&(a=a.slice()):a=[d.view.data],s){for(o=[],r=s.length;r--;)i=s[r],o.unshift(m(d,i));t&&(a=o)}if(e)if(s=s||[0],e=e.apply(l,o||a),r=s.length,e=r<2?[e]:e||[],t)a=e;else for(;r--;)i=s[r],+i===i&&(a[i]=e?e[r]:void 0);return a}function m(e,t){return e=e[+t===t?"args":"props"],e&&e[t]}function b(e){return this.cvtArgs(void 0,!0,e)}function x(e,t){for(var n,r,i=this;void 0===n&&i;)r=i.tmpl&&i.tmpl[e],n=r&&r[t],i=i.parent;return n||De[e][t]}function y(e,t,n,r,o,a){t=t||qe;var s,l,d,c,p,f,u,v,g,h,_,b,x,y,w,k,C,E,j,A,I,T,V=0,S="",N=t.linkCtx||0,P=t.ctx,U=n||t.tmpl,M="number"==typeof r&&t.tmpl.bnds[r-1];for("tag"===e._is?(s=e,e=s.tagName,r=s.tagCtxs,d=s.template):(l=t.getRsc("tags",e)||$("Unknown tag: {{"+e+"}} "),d=l.template),void 0===a&&M&&M._lr&&(a=""),void 0!==a?(S+=a,r=a=[{props:{},args:[]}]):M&&(r=M(t.data,t,Ye)),u=r.length;V<u;V++)h=r[V],(!N||!N.tag||V&&!N.tag._.inline||s._er)&&((y=U.tmpls&&h.tmpl)&&(y=h.content=U.tmpls[y-1]),h.index=V,h.tmpl=y,h.render=B,h.view=t,h.ctx=H(h.ctx,P)),(n=h.props.tmpl)&&(h.tmpl=t.getTmpl(n)),s||(s=new l._ctr,w=!!s.init,s.parent=f=P&&P.tag,s.tagCtxs=r,A=s.dataMap,N&&(s._.inline=!1,N.tag=s,s.linkCtx=N),(s._.bnd=M||N.fn)?s._.arrVws={}:s.dataBoundOnly&&$(e+" must be data-bound:\n{^{"+e+"}}")),x=s.bindTo||[0],r=s.tagCtxs,A=s.dataMap,h.tag=s,A&&r&&(h.map=r[V].map),s.flow||(_=h.ctx=h.ctx||{},c=s.parents=_.parentTags=P&&H(_.parentTags,P.parentTags)||{},f&&(c[f.tagName]=f),c[s.tagName]=_.tag=s);if(!(s._er=a)){for(i(s,r[0]),s.rendering={},V=0;V<u;V++){if(h=s.tagCtx=r[V],j=h.props,s.ctx=h.ctx,V||(w&&(s.init(h,N,s.ctx),w=void 0),N&&(N.attr=s.attr=N.attr||s.attr),p=s.attr,s._.noVws=p&&p!==At),E=s.cvtArgs(void 0,void 0,V),s.linkedCtxParam)for(v=x.length;v--;)(b=s.linkedCtxParam[v])&&(T=x[v],h.ctx[b]=Ye._cp(m(h,T),m(h.params,T),h.view,s._.bnd&&{tag:s,ind:v,tagElse:V}));(k=j.dataMap||A)&&(E.length||j.dataMap)&&(C=h.map,C&&C.src===E[0]&&!o||(C&&C.src&&C.unmap(),C=h.map=k.map(E[0],j,void 0,!s._.bnd)),E=[C.tgt]),g=void 0,s.render&&(g=s.render.apply(s,E),t.linked&&g&&!kt.test(g)&&(n={links:[]},n.render=n.fn=function(){return g},g=L(n,t.data,void 0,!0,t,void 0,void 0,s))),E.length||(E=[t]),void 0===g&&(I=E[0],s.contentCtx&&(I=s.contentCtx===!0?t:s.contentCtx(I)),g=h.render(I,!0)||(o?void 0:"")),S=S?S+(g||""):g}s.rendering=void 0}return s.tagCtx=r[0],s.ctx=s.tagCtx.ctx,s._.noVws&&s._.inline&&(S="text"===p?Xe.html(S):""),M&&t._.onRender?t._.onRender(S,t,s):S}function w(e,t,n,r,i,o,a,s){var l,d,c,p=this,u="array"===t;p.content=s,p.views=u?[]:{},p.parent=n,p.type=t||"top",p.root=n&&n.root||t&&p,p.data=r,p.tmpl=i,c=p._={key:0,useKey:u?0:1,id:""+Et++,onRender:a,bnds:{}},p.linked=!!a,n?(l=n.views,d=n._,d.useKey?(l[c.key="_"+d.useKey++]=p,p.index=St,p.getIndex=f):l.length===(c.key=p.index=o)?l.push(p):l.splice(o,0,p),p.ctx=e||n.ctx):p.ctx=e||{}}function k(e){var t,n,r;for(t in Lt)n=t+"s",e[n]&&(r=e[n],e[n]={},De[n](r,e))}function C(e,t,n){function i(){var t=this;t._={inline:!0,unlinked:!0},t.tagName=e}function o(e){var n;(n=t[e])&&(t[e]=n=Qe(n)?n:[n],(f||1)!==n.length&&$(e+" length not same as bindTo "))}var a,s,l,c,p,f,u=t.bindTo,v=new Ye._tg;if(ze(t)?t={depends:t.depends,render:t}:""+t===t&&(t={template:t}),void 0!==u)for(u=t.bindTo=Qe(u)?u:[u],c=f=u.length;c--;)p=u[c],isNaN(parseInt(p))||(p=parseInt(p)),u[c]=p;if(o("linkedElement"),o("linkedCtxParam"),s=t.baseTag){t.flow=!!t.flow,t.baseTag=s=""+s===s?n&&n.tags[s]||Ge[s]:s,v=d(v,s);for(l in t)v[l]=r(s[l],t[l])}else v=d(v,t);return void 0!==(a=v.template)&&(v.template=""+a===a?We[a]||We(a):a),(i.prototype=v).constructor=v._ctr=i,n&&(v._parentTmpl=n),v}function E(e){return this.base.apply(this,e)}function j(e,n,r,i){function o(n){var o,s;if(""+n===n||n.nodeType>0&&(a=n)){if(!a)if(/^\.\/[^\\:*?"<>]*$/.test(n))(s=We[e=e||n])?n=s:a=document.getElementById(n);else if(t.fn&&!Ye.rTmpl.test(n))try{a=t(n,document)[0]}catch(l){}a&&(i?n=a.innerHTML:(o=a.getAttribute(Tt),o&&(o!==Vt?(n=We[o],delete We[o]):t.fn&&(n=t.data(a)[Vt])),o&&n||(e=e||(t.fn?Vt:n),n=j(e,a.innerHTML,r,i)),n.tmplName=e=e||o,e!==Vt&&(We[e]=n),a.setAttribute(Tt,e),t.fn&&t.data(a,Vt,n))),a=void 0}else n.fn||(n=void 0);return n}var a,s,l=n=n||"";if(0===i&&(i=void 0,l=o(l)),i=i||(n.markup?n:{}),i.tmplName=e,r&&(i._parentTmpl=r),!l&&n.markup&&(l=o(n.markup))&&l.fn&&(l=l.markup),void 0!==l)return l.fn||n.fn?l.fn&&(s=l):(n=V(l,i),R(l.replace(ht,"\\$&"),n)),s||(s=d(function(){return s.render.apply(s,arguments)},n),k(s)),s}function A(e,t){return ze(e)?e.call(t):e}function I(e){for(var t=[],n=0,r=e.length;n<r;n++)t.push(e[n].unmap());return t}function T(e,n){function r(e){c.apply(this,e)}function i(){return new r(arguments)}function o(e,t){for(var n,r,i,o,a=0;a<m;a++)i=f[a],n=void 0,i+""!==i&&(n=i,i=n.getter),void 0===(o=e[i])&&n&&void 0!==(r=n.defaultVal)&&(o=A(r,e)),t(o,n&&p[n.type],i)}function a(t){t=t+""===t?JSON.parse(t):t;var n,r,i=0,a=t,d=[];if(Qe(t)){for(t=t||[],n=t.length;i<n;i++)d.push(this.map(t[i]));return d._is=e,d.unmap=l,d.merge=s,d}if(t){o(t,function(e,t){t&&(e=t.map(e)),d.push(e)}),a=this.apply(this,d);for(r in t)r===Je||x[r]||(a[r]=t[r])}return a}function s(e){e=e+""===e?JSON.parse(e):e;var t,n,r,a,s,l,d,c,p,f=0,u=this;if(Qe(u)){for(d={},p=[],n=e.length,r=u.length;f<n;f++){for(c=e[f],l=!1,t=0;t<r&&!l;t++)d[t]||(s=u[t],v&&(d[t]=l=v+""===v?c[v]&&(x[v]?s[v]():s[v])===c[v]:v(s,c)));l?(s.merge(c),p.push(s)):p.push(i.map(c))}return void(b?b(u).refresh(p,!0):u.splice.apply(u,[0,u.length].concat(p)))}o(e,function(e,t,n){t?u[n]().merge(e):u[n](e)});for(a in e)a===Je||x[a]||(u[a]=e[a])}function l(){var e,t,n,r,i=0,o=this;if(Qe(o))return I(o);for(e={};i<m;i++)t=f[i],n=void 0,t+""!==t&&(n=t,t=n.getter),r=o[t](),e[t]=n&&r&&p[n.type]?Qe(r)?I(r):r.unmap():r;for(t in o)"_is"===t||x[t]||t===Je||"_"===t.charAt(0)&&x[t.slice(1)]||ze(o[t])||(e[t]=o[t]);return e}var d,c,p=this,f=n.getters,u=n.extend,v=n.id,g=t.extend({_is:e||"unnamed",unmap:l,merge:s},u),h="",_="",m=f?f.length:0,b=t.observable,x={};for(r.prototype=g,d=0;d<m;d++)!function(e){e=e.getter||e,x[e]=d+1;var t="_"+e;h+=(h?",":"")+e,_+="this."+t+" = "+e+";\n",g[e]=g[e]||function(n){return arguments.length?void(b?b(this).setProperty(e,n):this[t]=n):this[t]},b&&(g[e].set=g[e].set||function(e){this[t]=e})}(f[d]);return c=new Function(h,_.slice(0,-1)),c.prototype=g,g.constructor=c,i.map=a,i.getters=f,i.extend=u,i.id=v,i}function V(e,n){var r,i=tt._wm||{},o=d({tmpls:[],links:{},bnds:[],_is:"template",render:B},n);return o.markup=e,n.htmlTag||(r=bt.exec(e),o.htmlTag=r?r[1].toLowerCase():""),r=i[o.htmlTag],r&&r!==i.div&&(o.markup=t.trim(o.markup)),o}function S(e,t){function n(i,o,a){var s,l,d,c=Ye.onStore[e];if(i&&typeof i===It&&!i.nodeType&&!i.markup&&!i.getTgt&&!("viewModel"===e&&i.getters||i.extend)){for(l in i)n(l,i[l],o);return o||De}return void 0===o&&(o=i,i=void 0),i&&""+i!==i&&(a=o,o=i,i=void 0),d=a?"viewModel"===e?a:a[r]=a[r]||{}:n,s=t.compile,null===o?i&&delete d[i]:(s&&(o=s.call(d,i,o,a,0),o._is=e),i&&(d[i]=o)),c&&c(i,o,a,s),o}var r=e+"s";De[r]=n}function N(e){nt[e]=function(t){return arguments.length?(et[e]=t,nt):et[e]}}function P(e){function t(t,n){this.tgt=e.getTgt(t,n)}return ze(e)&&(e={getTgt:e}),e.baseMap&&(e=d(d({},e.baseMap),e)),e.map=function(e,n){return new t(e,n)},e}function B(e,t,n,r,i,o){var a,s,l,d,c,p,f,u,v=r,g="";if(t===!0?(n=t,t=void 0):typeof t!==It&&(t=void 0),(l=this.tag)?(c=this,v=v||c.view,d=v.getTmpl(l.template||c.tmpl),arguments.length||(e=v)):d=this,d){if(!r&&e&&"view"===e._is&&(v=e),v&&e===v&&(e=v.data),p=!v,dt=dt||p,v||((t=t||{}).root=e),!dt||tt.useViews||d.useViews||v&&v!==qe)g=L(d,e,t,n,v,i,o,l);else{if(v?(f=v.data,u=v.index,v.index=St):(v=qe,v.data=e,v.ctx=t),Qe(e)&&!n)for(a=0,s=e.length;a<s;a++)v.index=a,v.data=e[a],g+=d.fn(e[a],v,Ye);else v.data=e,g+=d.fn(e,v,Ye);v.data=f,v.index=u}p&&(dt=void 0)}return g}function L(e,t,n,r,i,o,a,s){function l(e){x=d({},n),x[b]=e}var c,p,f,u,v,g,h,_,m,b,x,y,k="";if(s&&(m=s.tagName,y=s.tagCtx,n=n?H(n,s.ctx):s.ctx,e===i.content?h=e!==i.ctx._wrp?i.ctx._wrp:void 0:e!==y.content?e===s.template?(h=y.tmpl,n._wrp=y.content):h=y.content||i.content:h=i.content,y.props.link===!1&&(n=n||{},n.link=!1),(b=y.props.itemVar)&&("~"!==b.charAt(0)&&M("Use itemVar='~myItem'"),b=b.slice(1))),i&&(a=a||i._.onRender,n=H(n,i.ctx)),o===!0&&(g=!0,o=0),a&&(n&&n.link===!1||s&&s._.noVws)&&(a=void 0),_=a,a===!0&&(_=void 0,a=i._.onRender),n=e.helpers?H(e.helpers,n):n,x=n,Qe(t)&&!r)for(f=g?i:void 0!==o&&i||new w(n,"array",i,t,e,o,a,h),i&&i._.useKey&&(f._.bnd=!s||s._.bnd&&s),c=0,p=t.length;c<p;c++)b&&l(t[c]),u=new w(x,"item",f,t[c],e,(o||0)+c,a,f.content),u._.it=b,v=e.fn(t[c],u,Ye),k+=f._.onRender?f._.onRender(v,u):v;else b&&l(t),f=g?i:new w(x,m||"data",i,t,e,o,a,h),f._.it=b,k+=e.fn(t,f,Ye);return s&&(f.tag=s,f.tagElse=y.index,y.contentView=f),_?_(k,f):k}function U(e,t,n){var r=void 0!==n?ze(n)?n.call(t.data,e,t):n||"":"{Error: "+(e.message||e)+"}";return et.onError&&void 0!==(n=et.onError.call(t.data,e,n&&r,t))&&(r=n),t&&!t.linkCtx?Xe.html(r):r}function $(e){throw new Ye.Err(e)}function M(e){$("Syntax error\n"+e)}function R(e,t,n,r,i){function o(t){t-=g,t&&_.push(e.substr(g,t).replace(vt,"\\n"))}function a(t,n){t&&(t+="}}",M((n?"{{"+n+"}} block has {{/"+t+" without {{"+t:"Unmatched or missing {{/"+t)+", in template:\n"+e))}function s(s,l,d,f,v,b,x,y,w,k,C,E){(x&&l||w&&!d||y&&":"===y.slice(-1)||k)&&M(s),b&&(v=":",f=At),w=w||n&&!i;var j,A=(l||n)&&[[]],I="",T="",V="",S="",N="",P="",B="",L="",U=!w&&!v;d=d||(y=y||"#data",v),o(E),g=E+s.length,x?u&&_.push(["*","\n"+y.replace(/^:/,"ret+= ").replace(gt,"$1")+";\n"]):d?("else"===d&&(mt.test(y)&&M('for "{{else if expr}}" use "{{else expr}}"'),A=m[8]&&[[]],m[9]=e.substring(m[9],E),m=h.pop(),_=m[2],U=!0),y&&D(y.replace(vt," "),A,t).replace(_t,function(e,t,n,r,i,o,a,s){return r="'"+i+"':",a?(T+=o+",",S+="'"+s+"',"):n?(V+=r+"j._cp("+o+',"'+s+'",view),',P+=r+"'"+s+"',"):t?B+=o:("trigger"===i&&(L+=o),"lateRender"===i&&(j=1),I+=r+o+",",N+=r+"'"+s+"',",p=p||wt.test(i)),""}).slice(0,-1),A&&A[0]&&A.pop(),c=[d,f||!!r||p||"",U&&[],O(S||(":"===d?"'#data',":""),N,P),O(T||(":"===d?"data,":""),I,V),B,L,j,A||0],_.push(c),U&&(h.push(m),m=c,m[9]=g)):C&&(a(C!==m[0]&&"else"!==m[0]&&C,m[0]),m[9]=e.substring(m[9],E),m=h.pop()),a(!m&&C),_=m[2]}var l,d,c,p,f,u=et.allowCode||t&&t.allowCode||nt.allowCode===!0,v=[],g=0,h=[],_=v,m=[,,v];if(u&&t._is&&(t.allowCode=u),n&&(void 0!==r&&(e=e.slice(0,-r.length-2)+ot),e=rt+e+at),a(h[0]&&h[0][2].pop()[0]),e.replace(Oe,s),o(e.length),(g=v[v.length-1])&&a(""+g!==g&&+g[9]===g[9]&&g[0]),n){for(d=K(v,e,n),f=[],l=v.length;l--;)f.unshift(v[l][8]);F(d,f)}else d=K(v,t);return d}function F(e,t){var n,r,i=0,o=t.length;for(e.deps=[],e.paths=[];i<o;i++){e.paths.push(r=t[i]);for(n in r)"_jsvto"!==n&&r.hasOwnProperty(n)&&r[n].length&&!r[n].skp&&(e.deps=e.deps.concat(r[n]))}}function O(e,t,n){return[e.slice(0,-1),t.slice(0,-1),n.slice(0,-1)]}function q(e,t){return"\n\t"+(t?t+":{":"")+"args:["+e[0]+"]"+(e[1]||!t?",\n\tprops:{"+e[1]+"}":"")+(e[2]?",\n\tctx:{"+e[2]+"}":"")}function D(e,t,n){function r(r,_,m,b,x,y,w,k,C,E,j,A,I,T,V,S,N,P,B,L){function U(e,n,r,a,s,l,p,f){var u="."===r;if(r&&(x=x.slice(n.length),/^\.?constructor$/.test(f||x)&&M(e),u||(e=(a?'view.ctxPrm("'+a+'")':s?"view":"data")+(f?(l?"."+l:a?"":s?"":"."+r)+(p||""):(f=a?"":s?l||"":r,"")),e+=f?"."+f:"",e=n+("view.data"===e.slice(0,9)?e.slice(5):e)),d)){if(O="linkTo"===i?o=t._jsvto=t._jsvto||[]:c.bd,q=u&&O[O.length-1]){if(q._cpfn){for(;q.sb;)q=q.sb;q.bnd&&(x="^"+x.slice(1)),q.sb=x,q.bnd=q.bnd||"^"===x.charAt(0)}}else O.push(x);h[v]=B+(u?1:0)}return e}b&&!k&&(x=b+x),y=y||"",m=m||_||A,x=x||C,E=E||N||"";var $,F,O,q,D,K=")";if("["===E&&(E="[j._sq(",K=")]"),!w||l||s){if(d&&S&&!l&&!s&&(!i||a||o)&&($=h[v-1],L.length-1>B-($||0))){if($=L.slice($,B+r.length),F!==!0)if(O=o||p[v-1].bd,q=O[O.length-1],q&&q.prm){for(;q.sb&&q.sb.prm;)q=q.sb;D=q.sb={path:q.sb,bnd:q.bnd}}else O.push(D={path:O.pop()});S=it+":"+$+" onerror=''"+ot,F=u[S],F||(u[S]=!0,u[S]=F=R(S,n,!0)),F!==!0&&D&&(D._cpfn=F,D.prm=c.bd,D.bnd=D.bnd||D.path&&D.path.indexOf("^")>=0)}return l?(l=!I,l?r:A+'"'):s?(s=!T,s?r:A+'"'):(m?(h[v]=B++,c=p[++v]={bd:[]},m):"")+(P?v?"":(f=L.slice(f,B),(i?(i=a=o=!1,"\b"):"\b,")+f+(f=B+r.length,d&&t.push(c.bd=[]),"\b")):k?(v&&M(e),d&&t.pop(),i=x,a=b,f=B+r.length,d&&(d=c.bd=t[i]=[],d.skp=!b),x+":"):x?x.split("^").join(".").replace(ft,U)+(E?(c=p[++v]={bd:[]},g[v]=K,E):y):y?y:V?(V=g[v]||V,g[v]=!1,c=p[--v],V+(E?(c=p[++v],g[v]=K,E):"")):j?(g[v]||M(e),","):_?"":(l=I,s=T,'"'))}M(e)}var i,o,a,s,l,d=t&&t[0],c={bd:d},p={0:c},f=0,u=(n?n.links:d&&(d.links=d.links||{}))||qe.tmpl.links,v=0,g={},h={},_=(e+(n?" ":"")).replace(ut,r);return!v&&_||M(e)}function K(e,t,n){var r,i,o,a,s,l,d,c,p,f,u,v,g,h,_,m,b,x,y,w,k,C,E,j,A,I,T,S,N,P,B,L=0,U=tt.useViews||t.useViews||t.tags||t.templates||t.helpers||t.converters,$="",R={},O=e.length;for(""+t===t?(x=n?'data-link="'+t.replace(vt," ").slice(1,-1)+'"':t,t=0):(x=t.tmplName||"unnamed",t.allowCode&&(R.allowCode=!0),t.debug&&(R.debug=!0),u=t.bnds,b=t.tmpls),r=0;r<O;r++)if(i=e[r],""+i===i)$+='\n+"'+i+'"';else if(o=i[0],"*"===o)$+=";\n"+i[1]+"\nret=ret";else{if(a=i[1],k=!n&&i[2],s=q(i[3],"params")+"},"+q(g=i[4]),S=i[5],P=i[6],B=i[7],C=i[9]&&i[9].replace(gt,"$1"),(A="else"===o)?v&&v.push(i[8]):u&&(v=i[8])&&(v=[v],L=u.push(1)),U=U||g[1]||g[2]||v||/view.(?!index)/.test(g[0]),(I=":"===o)?a&&(o=a===At?">":a+o):(k&&(y=V(C,R),y.tmplName=x+"/"+o,y.useViews=y.useViews||U,K(k,y),U=y.useViews,b.push(y)),A||(w=o,U=U||o&&(!Ge[o]||!Ge[o].flow),j=$,$=""),E=e[r+1],E=E&&"else"===E[0]),N=S?";\ntry{\nret+=":"\n+",h="",_="",I&&(v||P||a&&a!==At||B)){if(T=new Function("data,view,j,u","// "+x+" "+ ++L+" "+o+"\nreturn {"+s+"};"),T._er=S,T._tag=o,T._bd=!!v,T._lr=B,n)return T;F(T,v),m='c("'+a+'",view,',f=!0,h=m+L+",",_=")"}if($+=I?(n?(S?"try{\n":"")+"return ":N)+(f?(f=void 0,U=p=!0,m+(T?(u[L-1]=T,L):"{"+s+"}")+")"):">"===o?(d=!0,"h("+g[0]+")"):(c=!0,"((v="+g[0]+")!=null?v:"+(n?"null)":'"")'))):(l=!0,"\n{view:view,tmpl:"+(k?b.length:"0")+","+s+"},"),w&&!E){if($="["+$.slice(0,-1)+"]",m='t("'+w+'",view,this,',n||v){if($=new Function("data,view,j,u"," // "+x+" "+L+" "+w+"\nreturn "+$+";"),$._er=S,$._tag=w,v&&F(u[L-1]=$,v),$._lr=B,n)return $;h=m+L+",undefined,",_=")"}$=j+N+m+($.deps&&L||$)+")",v=0,w=0}S&&(U=!0,$+=";\n}catch(e){ret"+(n?"urn ":"+=")+h+"j._err(e,view,"+S+")"+_+";}"+(n?"":"ret=ret"))}$="// "+x+"\nvar v"+(l?",t=j._tag":"")+(p?",c=j._cnvt":"")+(d?",h=j._html":"")+(n?";\n":',ret=""\n')+(R.debug?"debugger;":"")+$+(n?"\n":";\nreturn ret;"),et.debugMode!==!1&&($="try {\n"+$+"\n}catch(e){\nreturn j._err(e, view);\n}");try{$=new Function("data,view,j,u",$)}catch(D){M("Compiled template code:\n\n"+$+'\n: "'+(D.message||D)+'"')}return t&&(t.fn=$,t.useViews=!!U),$}function H(e,t){return e&&e!==t?t?d(d({},t),e):e:t&&d({},t)}function J(e){return jt[e]||(jt[e]="&#"+e.charCodeAt(0)+";")}function z(e){var t,n,r=[];if(typeof e===It)for(t in e)n=e[t],t!==Je&&e.hasOwnProperty(t)&&!ze(n)&&r.push({key:t,prop:n});return r}function Q(e,n,r){var i=this.jquery&&(this[0]||$("Unknown template")),o=i.getAttribute(Tt);return B.call(o&&t.data(i)[Vt]||We(i),e,n,r)}function W(e){return void 0!=e?yt.test(e)&&(""+e).replace(Ct,J)||e:""}function X(e,t,n,r){var i,o,a,s,l,d,c,p,f,u,v,g,h,_,m,b,x,y;if(n&&n._tgId&&(y=n,n=y._tgId,y._.chg=1),(d=zn[n])&&(g=d.to)){for(g=g[t||0],i=d.linkCtx,i.ev=r,f=i.elem,l=i.view,y=i.tag,!y&&g._cxp&&(y=g._cxp.path!==pt&&g._cxp.tag,c=e[0],e=[],e[g._cxp.ind]=c),(a=y&&y.convertBack)&&(o=ze(a)?a:l.getRsc("converters",a)),"SELECT"===f.nodeName&&(f.multiple&&null===e[0]&&(e=[[]]),f._jsvSel=e),p=e,o&&(e=o.apply(y,e),e=g.length>1?e||[]:[e]),v=l.linkCtx,l.linkCtx=i,f._jsvChg=1,x=g.length;x--;)if((h=g[x])&&(h=h+""===h?[i.data,h]:h,s=h[0],_=h.tag,c=(h[1]===pt?p:e)[x],!(void 0===c||r&&y&&y.onBeforeUpdateVal&&y.onBeforeUpdateVal(r,{change:"change",data:s,path:h[1],index:x,tagElse:t,value:c})===!1)))if(_)_.updateValue(c,h.ind,h.tagElse,void 0,r),_.setValue&&_.setValue(c,h.ind,h.tagElse);else if(void 0!==c&&s){if((_=r&&(u=r.target)._jsvInd===x&&u._jsvLkEl)&&_.setValue(p[x],x,u._jsvElse),s._cpfn)for(b=i._ctxCb,m=s,s=i.data,m._cpCtx&&(s=m.data,b=m._cpCtx);m&&m.sb;)s=b(m,s),m=m.sb;He(s).setProperty(h[1],c)}f._jsvChg=i.ev=void 0,l.linkCtx=v}if(y)return y._.chg=void 0,y}function Z(e){var n,r,i=e.target,o=re(i),a=Un[o];if(!i._jsvTr||e.delegateTarget!==fn&&"number"!==e.target.type||"input"===e.type){for(r=ze(o)?o(i):(i=t(i),a?i[a]():i.attr(o)),e.target._jsvChg=1,nr.lastIndex=0;n=nr.exec(e.target._jsvBnd);)Pe(r,i._jsvInd,i._jsvElse,n[1],e);e.target._jsvChg=void 0}}function G(e,n){function r(){if(!u.flow){var r,i,o=u.tagCtx.props,a=u.bindTo||{};u.mainElement&&(u.mainElem=u._.inline?u.contents(!0,u.mainElement).first():t(g)),u.onBeforeBind&&u._.unlinked&&u.onBeforeBind(u.tagCtx,p,u.ctx,e,n),(r=u.mainElem||u.linkedElem)&&(o.id&&!r[0].id&&(r[0].id=o.id),u.setSize&&(o.height&&!a.height&&r.height(o.height),o.width&&!a.width&&r.width(o.width))),o["class"]&&!a["class"]&&(i=u.displayElem||r)&&(n&&i.hasClass(n.oldValue)&&i.removeClass(n.oldValue),i.addClass(o["class"]))}}var i,o,a,s,l,d,c,p=this,f=p.fn,u=p.tag,v=p.data,g=p.elem,h=p.convert,_=g.parentNode,m=p.view,b=m.linkCtx,x=n&&Ve(m,wn,u);if(m.linkCtx=p,_&&(!x||x.call(p,e,n)!==!1)&&(!n||"*"===e.data.prop||e.data.prop===n.path)){if(n&&(p.eventArgs=n),n||p._toLk){if(p._toLk=0,f._er)try{o=f(v,m,Ye)}catch(y){l=f._er,d=U(y,m,new Function("data,view","return "+l+";")(v,m)),o=[{props:{},args:[d],tag:u}]}else o=f(v,m,Ye);if(i=u&&u.attr||p.attr||re(g,!0,void 0!==h),i===Tn&&(u&&u.parentElem||p.elem).type===jn&&(i=En),u){if(s=l||u._er,o=o[0]?o:[o],a=!s&&(u.onUpdate===!1||n&&ze(u.onUpdate)&&u.onUpdate(e,n,o)===!1),Ee(u,o,s),r(),g._jsvChg&&(i===At||i===Tn)||a||i===In)return be(u,e,n),g._jsvChg||ae(p,v,g),m.linkCtx=b,void(n&&(x=Ve(m,kn,u))&&x.call(p,e,n));u.onUnbind&&u.onUnbind(u.tagCtx,p,u.ctx,e,n),o=":"===u.tagName?Ye._cnvt(u.cvt,m,o[0]):Ye._tag(u,m,m.tmpl,o,!0,d)}else f._tag&&(h=""===h?Sn:h,o=h?Ye._cnvt(h,m,o[0]||o):Ye._tag(f._tag,m,m.tmpl,o,!0,d),Le(u=p.tag),r(),i=p.attr||i);(c=u&&!u._.inline&&u.template)&&ae(p,v,g),ee(o,p,i,u),p._noUpd=0,u&&(u._er=l,be(u,e,n))}else r();c||ae(p,v,g),n&&(x=Ve(m,kn,u))&&x.call(p,e,n),m.linkCtx=b}}function Y(e,t){e._df=t,e[(t?"set":"remove")+"Attribute"](Bn,"")}function ee(n,r,i,o){var a,s,l,d,c,p,f,u,v,g,h,_,m,b,x=!(i===In||void 0===n||r._noUpd||r.elem._jsvChg&&(i===Tn||i===At)),y=r.data,w=o&&o.parentElem||r.elem,k=w.parentNode,C=t(w),E=r.view,j=r._val,A=E.linkCtx,I=o;return o&&(o._.unlinked=!0,o.parentElem=o.parentElem||r.expr||o._elCnt?w:k,s=o._prv,l=o._nxt),x?("visible"===i&&(i="css-display"),/^css-/.test(i)?("visible"===r.attr&&(m=(w.currentStyle||rr.call(e,w,"")).display,n?(n=w._jsvd||m,n!==In||(n=Jn[_=w.nodeName])||(h=document.createElement(_),document.body.appendChild(h),n=Jn[_]=(h.currentStyle||rr.call(e,h,"")).display,document.body.removeChild(h))):(w._jsvd=m,n=In)),(I=I||j!==n)&&t.style(w,i.slice(4),n)):"link"!==i&&(/^data-/.test(i)&&t.data(w,i.slice(5),n),i===En?(p=!0,n=n&&"false"!==n):i===An?(p=!0,i=En,n=w.value===n):"selected"===i||"disabled"===i||"multiple"===i||"readonly"===i?n=n&&"false"!==n?i:null:i===Tn&&"SELECT"===w.nodeName&&(w._jsvSel=Qe(n)?n:""+n),(a=Un[i])?i===At?(E.linkCtx=r,o&&o._.inline?(c=o.nodes(!0),zn[o._tgId].to=void 0,o._elCnt&&(s&&s!==l?Se(s,l,w,o._tgId,"^",!0):(f=w._df)&&(u=o._tgId+"^",v=f.indexOf("#"+u)+1,g=f.indexOf("/"+u),v&&g>0&&(v+=u.length,g>v&&(Y(w,f.slice(0,v)+f.slice(g)),Ne(f.slice(v,g))))),s=s?s.previousSibling:l?l.previousSibling:w.lastChild),t(c).remove(),d=E.link(E.data,w,s,l,n,o&&{tag:o._tgId})):(x=x&&j!==n,x&&(C.empty(),d=E.link(y,w,s,l,n,o&&{tag:o._tgId}))),E.linkCtx=A):((I=I||j!==n)&&("text"===i&&w.children&&!w.children[0]?void 0!==w.textContent?w.textContent=n:w.innerText=null===n?"":n:C[a](n)),!(b=k._jsvSel)||i!==Tn&&C.attr(Tn)||(w.selected=t.inArray(""+n,Qe(b)?b:[b])>-1)):(I=I||j!==n)&&C[p?"prop":"attr"](i,void 0!==n||p?n:null)),r._val=n,se(d),I):void(r._val=n)}function te(e,t){var n=this,r=Ve(n,wn,n.tag),i=Ve(n,kn,n.tag);if(!r||r.call(n,e,t)!==!1){if(t){var o=t.change,a=t.index,s=t.items;switch(n._.srt=t.refresh,o){case"insert":n.addViews(a,s);break;case"remove":n.removeViews(a,s.length);break;case"move":n.moveViews(t.oldIndex,a,s.length);break;case"refresh":n._.srt=void 0,n.fixIndex(0)}}i&&i.call(n,e,t)}}function ne(e){var n,r,i=e.type,o=e.data,a=e._.bnd;!e._.useKey&&a&&((r=e._.bndArr)&&(t([r[1]]).off(Dt,r[0]),e._.bndArr=void 0),a!==!!a?i?a._.arrVws[e._.id]=e:delete a._.arrVws[e._.id]:i&&o&&(n=function(t){t.data&&t.data.off||te.apply(e,arguments)},t([o]).on(Dt,n),e._.bndArr=[n,o]))}function re(e,t,n){var r=e.nodeName.toLowerCase(),i=tt._fe[r]||e.contentEditable===Sn&&{to:At,from:At};return i?t?"input"===r&&e.type===An?An:i.to:i.from:t?n?"text":At:""}function ie(e,n,r,i,o,a,s){var l,d,c,p,f,u=e.parentElem,v=e._prv,g=e._nxt,h=e._elCnt;if(v&&v.parentNode!==u&&$("Missing parentNode"),s){p=e.nodes(),h&&v&&v!==g&&Se(v,g,u,e._.id,"_",!0),e.removeViews(void 0,void 0,!0),d=g,h&&(v=v?v.previousSibling:g?g.previousSibling:u.lastChild),t(p).remove();for(f in e._.bnds)Ae(f)}else{if(n){if(c=i[n-1],!c)return!1;v=c._nxt}h?(d=v,v=d?d.previousSibling:u.lastChild):d=v.nextSibling}l=r.render(o,a,e._.useKey&&s,e,s||n,!0),se(e.link(o,u,v,d,l,c))}function oe(e,t,n){var r,i;return n?(i="^`",Le(n),r=n._tgId,r||(zn[r=Qn++]=n,n._tgId=""+r)):(i="_`",mn[r=t._.id]=t),"#"+r+i+(void 0!=e?e:"")+"/"+r+i}function ae(e,t,n){var r,i,o,a,s,l,c,p,f,u,v,g=e.tag,h=e.convertBack,_=e._hdl;if(g&&((f=g.cvt)&&(f="true"===f?g.tagCtx.props.convert:e.view.getRsc("converters",f),f=f&&f.depends),f=g.depends?f?g.depends.concat(f):g.depends:f,f=f&&Ye._dp(f,g,_),v=g.linkedElems),f=f||[],!e._depends||""+e._depends!=""+f){if(s=e.fn.deps.slice(),e._depends&&(u=e._depends.bdId,He._apply(1,[t],s,e._depends,_,e._ctxCb,!0)),g&&g.boundProps)for(i=g.boundProps.length;i--;)for(c=g.boundProps[i],o=g._.bnd.paths.length;o--;)p=g._.bnd.paths[o][c],p&&p.skp&&(s=s.concat(p));for(i=s.length;i--;)l=s[i],l._cpfn&&(s[i]=d({},l));if(r=He._apply(1,[t],s,f,_,e._ctxCb),u||(u=e._bndId||""+Qn++,e._bndId=void 0,n._jsvBnd=(n._jsvBnd||"")+"&"+u,e.view._.bnds[u]=u),r.elem=n,r.linkCtx=e,r._tgId=u,f.bdId=u,e._depends=f,zn[u]=r,(v||void 0!==h||g&&(g.bindTo||g.linkedElement||g.linkedCtxParam))&&ke(r,g,h),v)for(i=v.length;i--;)for(a=v[i],o=a&&a.length;o--;)a[o]._jsvLkEl=g,we(g,a[o]),a[o]._jsvBnd="&"+u+"+";else void 0!==h&&we(g,n);g&&(g.flow||g._.inline||(n.setAttribute(xn,(n.getAttribute(xn)||"")+"#"+u+"^/"+u+"^"),g._tgId=""+u))}}function se(e){var t;if(e)for(;t=e.pop();)t._hdl()}function le(e,t,n,r,i,o,a){return de(this,e,t,n,r,i,o,a)}function de(e,n,r,i,o,a,s,l){if(i===!0?(o=i,i=void 0):i="object"!=typeof i?void 0:d({},i),e&&n){n=n.jquery?n:t(n),fn||(fn=document.body,t(fn).on(yn,Z).on("input",'input[type="number"]',Z).on("blur","[contenteditable]",Z));for(var c,p,f,u,v,g,h,_,m,b,x=oe,y=i&&"replace"===i.target,w=n.length;w--;){if(h=n[w],a=a||vn(h),(m=a===qe)&&(qe.data=(qe.ctx=i||{}).root=r),""+e===e)pe(b=[],e,h,a,void 0,!0,r,i);else{if(void 0!==e.markup)y&&(g=h.parentNode),f=e.render(r,i,o,a,void 0,x),g?(s=h.previousSibling,l=h.nextSibling,t.cleanData([h],!0),g.removeChild(h),h=g):(s=l=void 0,t(h).empty());else{if(e!==!0||a!==qe)break;_={lnk:1}}if(h._df&&!l){for(u=ge(h._df,!0,Zn),c=0,p=u.length;c<p;c++)v=u[c],(v=mn[v.id])&&void 0!==v.data&&v.parent.removeViews(v._.key,void 0,!0);Y(h)}b=a.link(r,h,s,l,f,_,i)}se(b)}}return n}function ce(e,n,r,i,o,a,s,l){function d(e,t,n,r,i,a,s,l,d,c,p,f,v,h){var _,m,b="";return h?(u=0,e):(g=d||c||"",r=r||p,n=n||v,D&&!n&&(!e||r||g||a&&!u)&&(D=void 0,q=ce.shift()),r=r||n,r&&(u=0,D=void 0,B&&(n||v?Hn[q]||/;svg;|;math;/.test(";"+ce.join(";")+";")||(_="'<"+q+".../"):Hn[r]?_="'</"+r:ce.length&&r===q||(_="Mismatch: '</"+r),_&&M(_+">' in:\n"+o)),Q=z,q=ce.shift(),z=Dn[q],p=p?"</"+p+">":"",Q&&(le+=X,X="",z?le+="-":(b=p+Pn+"@"+le+Nn+(f||""),le=fe.shift()))),z?(a?X+=a:t=p||v||"",g&&(t+=g,X&&(t+=" "+xn+'="'+X+'"',X=""))):t=a?t+b+i+(u?"":Pn+a+Nn)+l+g:b||e,B&&s&&(u&&M("{^{ within elem markup ("+u+' ). Use data-link="..."'),"#"===a.charAt(0)?ce.unshift(a.slice(1)):a.slice(1)!==(m=ce.shift())&&M("Closing tag for {^{...}} under different elem: <"+m+">")),g&&(u=g,ce.unshift(q),q=g.slice(1),B&&ce[0]&&ce[0]===Kn[q]&&$("Parent of <tr> must be <tbody>"),D=Hn[q],(z=Dn[q])&&!Q&&(fe.unshift(le),le=""),Q=z,le&&z&&(le+="+")),t)}function c(e,t){var r,i,o,a,s,l,d,c=[];if(e){for("@"===e._tkns.charAt(0)&&(t=y.previousSibling,y.parentNode.removeChild(y),y=void 0),b=e.length;b--;){if(k=e[b],o=k.ch,r=k.path)for(m=r.length-1;i=r.charAt(m--);)"+"===i?"-"===r.charAt(m)?(m--,t=t.previousSibling):t=t.parentNode:t=t.lastChild;"^"===o?(g=zn[s=k.id])&&(d=t&&(!y||y.parentNode!==t),y&&!d||(g.parentElem=t),k.elCnt&&d&&Y(t,(k.open?"#":"/")+s+o+(t._df||"")),c.push([d?null:y,k])):(w=mn[s=k.id])&&(w.parentElem||(w.parentElem=t||y&&y.parentNode||n,w._.onRender=oe,w._.onArrayChange=te,ne(w)),a=w.parentElem,k.open?(w._elCnt=k.elCnt,t&&!y?Y(t,"#"+s+o+(t._df||"")):(w._prv||Y(a,ue(a._df,"#"+s+o)),w._prv=y)):(!t||y&&y.parentNode===t?y&&(w._nxt||Y(a,ue(a._df,"/"+s+o)),w._nxt=y):(Y(t,"/"+s+o+(t._df||"")),w._nxt=void 0),(l=w.ctx&&w.ctx[Cn]||xe)&&l.call(w.ctx.tag,w)))}for(b=c.length;b--;)de.push(c[b])}return!e||e.elCnt}function p(e){var t,n,r;if(e)for(b=e.length,m=0;m<b;m++)if(k=e[m],g=zn[k.id],!g._is&&g.linkCtx&&(n=g=g.linkCtx.tag,r=g.tagName===N,!g.flow||r)){if(!S){for(t=1;n=n.parent;)t++;L=L||t}!S&&t!==L||N&&!r||V.push(g)}}function f(a){var l,d,f="",u={},m=hn+(ie?",["+Bn+"]":"");for(x=qn?n.querySelectorAll(m):t(m,n).get(),_=x.length,r&&r.innerHTML&&(E=qn?r.querySelectorAll(m):t(m,r).get(),r=E.length?E[E.length-1]:r),L=0,h=0;h<_;h++)if(y=x[h],r&&!G)G=y===r;else{if(i&&y===i){ie&&(f+=ve(y));break}if(y.parentNode)if(ie){if(f+=ve(y),y._df){for(l=h+1;l<_&&y.contains(x[l]);)l++;u[l-1]=y._df}u[h]&&(f+=u[h]||"")}else re&&(k=ge(y,void 0,Yn))&&(k=k[0])&&(ee=ee?k.id!==ee&&ee:k.open&&k.id),!ee&&ye(ge(y))&&y.getAttribute(gn)&&de.push([y])}if(ie&&(f+=n._df||"",(d=f.indexOf("#"+ie.id)+1)&&(f=f.slice(d+ie.id.length)),d=f.indexOf("/"+ie.id),d+1&&(f=f.slice(0,d)),p(ge(f,void 0,er))),void 0===o&&n.getAttribute(gn)&&de.push([n]),he(r,z),he(i,z),!ie)for(z&&le+X&&(y=i,le&&(i?c(ge(le+"+",!0),i):c(ge(le,!0),n)),c(ge(X,!0),n),i&&(f=i.getAttribute(xn),(_=f.indexOf(Z)+1)&&(f=f.slice(_+Z.length-1)),i.setAttribute(xn,X+f))),_=de.length,h=0;h<_;h++)y=de[h],C=y[1],y=y[0],C?(g=zn[C.id])&&((v=g.linkCtx)&&(g=v.tag,g.linkCtx=v),C.open?(y&&(g.parentElem=y.parentNode,g._prv=y),g._elCnt=C.elCnt,w=g.tagCtx.view,pe(a,void 0,g._prv,w,C.id)):(g._nxt=y,g._.unlinked&&!g._toLk&&(P=g.tagCtx,w=P.view,be(g)))):pe(a,y.getAttribute(gn),y,vn(y),void 0,re,e,s)}var u,v,g,h,_,m,b,x,y,w,k,C,E,j,A,I,T,V,S,N,P,B,L,U,R,F,O,q,D,K,H,J,z,Q,W,X,Z,G,ee,re,ie,ae=this,se=ae._.id+"_",le="",de=[],ce=[],fe=[],me=[],xe=Ve(ae,Cn),ye=c;if(a&&(a.tmpl?A="/"+a._.id+"_":(re=a.lnk,a.tag&&(se=a.tag+"^",a=!0),(ie=a.get)&&(ye=p,V=ie.tags,S=ie.deep,N=ie.name)),a=a===!0),n=n?""+n===n?t(n)[0]:n.jquery?n[0]:n:ae.parentElem||document.body,B=!tt.noValidate&&n.contentEditable!==Sn,q=n.tagName.toLowerCase(),z=!!Dn[q],r=r&&_e(r,z),i=i&&_e(i,z)||null,void 0!=o){if(H=document.createElement("div"),K=H,Z=X="",W="http://www.w3.org/2000/svg"===n.namespaceURI?"svg_ns":(O=bt.exec(o))&&O[1]||"",z){for(T=i;T&&!(I=ge(T));)T=T.nextSibling;(J=I?I._tkns:n._df)&&(j=A||"",!a&&A||(j+="#"+se),m=J.indexOf(j),m+1&&(m+=j.length,Z=X=J.slice(0,m),J=J.slice(m),I?T.setAttribute(xn,J):Y(n,J)))}if(D=void 0,o=(""+o).replace(Xn,d),B&&ce.length&&M("Mismatched '<"+q+"...>' in:\n"+o),l)return;for(On.appendChild(H),W=_n[W]||_n.div,U=W[0],K.innerHTML=W[1]+o+W[2];U--;)K=K.lastChild;for(On.removeChild(H),R=document.createDocumentFragment();F=K.firstChild;)R.appendChild(F);n.insertBefore(R,i)}return f(me),me}function pe(e,t,n,r,i,o,a,s){var l,d,c,p,f,u,v,g,h,_,m,b=[];if(i)g=zn[i],g=g.linkCtx?g.linkCtx.tag:g,v=g.linkCtx||{type:"inline",data:r.data,elem:g._elCnt?g.parentElem:n,view:r,ctx:r.ctx,attr:At,fn:g._.bnd,tag:g,_bndId:i},g.linkCtx=v,fe(v,e),g._toLk=v._bndId;else if(t&&n){for(a=o?a:r.data,l=r.tmpl,t=me(t,re(n)),m=un.lastIndex=0;d=un.exec(t);)b.push(d),m=un.lastIndex;for(m<t.length&&M(t);d=b.shift();){for(h=un.lastIndex,c=d[1],f=d[3];b[0]&&"else"===b[0][4];)f+=at+rt+b.shift()[3],_=!0;_&&(f+=at+rt+it+"/"+d[4]+ot),v={type:o?"top":"link",data:a,elem:n,view:r,ctx:s,attr:c,isLk:o,_toLk:1,_noUpd:d[2]},p=void 0,d[6]&&(p=d[10]||void 0,v.convert=d[5]||"",!c&&void 0!==p&&re(n)&&(v.convertBack=p=p.slice(1))),v.expr=c+f,u=l.links[f],u||(l.links[f]=u=Ye.tmplFn(f,l,!0,p,_)),v.fn=u,fe(v,e),un.lastIndex=h}}}function fe(e,t){function n(t,n){G.call(e,t,n)}e.isLk&&(e.view=new Ye.View(Ye.extendCtx(e.ctx,e.view.ctx),"link",e.view,e.data,e.expr,(void 0),oe)),e._ctxCb=Ye._gccb(e.view),e._hdl=n,e.fn._lr?(e._toLk=1,t.push(e)):n(!0)}function ue(e,t){var n;return e?(n=e.indexOf(t),n+1?e.slice(0,n)+e.slice(n+t.length):e):""}function ve(e){return e&&(""+e===e?e:e.tagName===Vn?e.type.slice(3):1===e.nodeType&&e.getAttribute(xn)||"");
}function ge(e,t,n){function r(e,t,n,r,o,s){a.push({elCnt:i,id:r,ch:o,open:t,close:n,path:s,token:e})}var i,o,a=[];if(o=t?e:ve(e))return i=a.elCnt=e.tagName!==Vn,i="@"===o.charAt(0)||i,a._tkns=o,o.replace(n||tr,r),a}function he(e,t){e&&("jsv"===e.type?e.parentNode.removeChild(e):t&&""===e.getAttribute(gn)&&e.removeAttribute(gn))}function _e(e,t){for(var n=e;t&&n&&1!==n.nodeType;)n=n.previousSibling;return n&&(1!==n.nodeType?(n=document.createElement(Vn),n.type="jsv",e.parentNode.insertBefore(n,e)):ve(n)||n.getAttribute(gn)||n.setAttribute(gn,"")),n}function me(e,n){return e=t.trim(e).replace(ht,"\\$&"),e.slice(-1)!==ot?e=it+":"+e+(n?":":"")+ot:e}function be(e,n,r){var i,o,a,s,l,d,c,p=e.tagCtx,f=e.linkCtx,u=e.bindTo;if(e._.unlinked){if(d=t(f.elem),o=e.linkedElement){for(l=e.tagCtxs.length;l--;)for(c=e.tagCtxs[l],s=o.length,i=c.linkedElems=c.linkedElems||new Array(s);s--;)o[s]&&(a=e._.inline?c.contents(!0,o[s]):d,a[0]&&a[0].type!==An&&(a=a.first(),a[0]._jsvLkEl||(i[s]=a)));e.linkedElems=p.linkedElems,e.linkedElem=e.linkedElems[0]}e.onBind&&e.onBind(p,f,e.ctx,n,r)}e.onAfterLink&&e.onAfterLink(p,f,e.ctx,n,r),(i=p.linkedElems||e.linkedElems||e.linkedElem&&[e.linkedElem])&&(e.linkedElems=p.linkedElems=i,e.linkedElem=i[0]=e.linkedElem||e.linkedElems[0]),e.flow||f.elem._jsvChg||(e._.inline&&e._.unlinked&&(e.linkedElems||u)&&ke(zn[e._tgId],e),u=u||{},e.setValue()),e._.unlinked=void 0}function xe(e){var t=e.which;t>15&&t<21||t>32&&t<41||t>111&&t<131||27===t||144===t||setTimeout(function(){Z(e)})}function ye(e,t,n){t&&(t=""+t===t?t:"keydown",e[n](t,t.indexOf("keydown")>=0?xe:Z))}function we(e,n){var r,i,o=n._jsvTr||!1;e&&(i=e.tagCtx.props.trigger),void 0===i&&(i=et.trigger),i=i&&("INPUT"===n.tagName&&n.type!==jn&&n.type!==An||"textarea"===n.type||n.contentEditable===Sn)&&i||!1,o!==i&&(r=t(n),ye(r,o,"off"),ye(r,n._jsvTr=i,"on"))}function ke(e,t,n){var r,i,o,a,s,l,d,c,p,f,u,v,g,h=1,_=[],m=e.linkCtx,b=m.data,x=m.fn.paths;if(e&&!e.to){for(t&&(t.convertBack=t.convertBack||n,l=t.bindTo,h=t.tagCtxs?t.tagCtxs.length:1);h--;){if(g=[],v=x[h])for(l=v._jsvto?["_jsvto"]:l||[0],c=l.length;c--;){if(i="",u=m._ctxCb,d=v[l[c]],r=d&&d.length){if(o=d[r-1],o._cpfn){for(a=o;o.sb&&o.sb._cpfn;)i=o=o.sb;i=o.sb||i&&i.path,o=i?i.slice(1):a.path}s=i?[a,o]:Ce(o,b,u)}else f=t.linkedCtxParam,s=[],f&&f[c]&&(s=[t.tagCtxs[h].ctx[f[c]][0],pt]);(p=s._cxp)&&p.tag&&(s=p),g.unshift(s)}_.unshift(g)}e.to=_}}function Ce(e,t,n){for(var r,i,o,a,s,l,d,c;e&&e!==pt&&(o=n(r=e.split("^").join("."),t))&&(a=o.length);){if(s=o[0]._cxp)if(d=d||s,l=o[0][0],pt in l?(c=l,l=l._vw):c=l.data,d.path=e=o[0][1],o=[d.data=c,e],n=Ye._gccb(l),e._cpfn){for(i=e,i.data=o[0],i._cpCtx=n;e.sb&&e.sb._cpfn;)r=e=e.sb;r=e.sb||r&&r.path,e=r?r.slice(1):i.path,o=[i,e]}else s.tag&&s.path===pt&&(o=s);else o=a>2?[o[a-3],o[a-2]]:[o[a-2]];t=o[0],e=o[1]}return o=o||[t,r],o._cxp=d,o}function Ee(e,t,n){var r,i,o=e.tagCtx.view,a=e.tagCtxs||[e.tagCtx],s=a.length,l=!t;if(t=t||e._.bnd.call(o.tmpl,(e.linkCtx||o).data,o,Ye),n)a=e.tagCtxs=t,e.tagCtx=a[0];else for(;s--;)r=a[s],i=t[s],He(r.props).setProperty(i.props),d(r.ctx,i.ctx),r.args=i.args,l&&(r.tmpl=i.tmpl);return Ye._ths(e,a[0]),a}function je(e){for(var t,n,r,i=[],o=e.length,a=o;a--;)i.push(e[a]);for(a=o;a--;)if(n=i[a],n.parentNode){if(r=n._jsvBnd)for(r=r.slice(1).split("&"),n._jsvBnd="",t=r.length;t--;)Ae(r[t],n._jsvLkEl,n);Ne(ve(n)+(n._df||""),n)}}function Ae(e,n,r){var i,o,a,s,l,d,c,p,f,u,v,g,h,_,m=zn[e];if(n)r._jsvLkEl=void 0;else if(m&&(!r||r===m.elem)){delete zn[e];for(i in m.bnd)s=m.bnd[i],l=m.cbId,Qe(s)?t([s]).off(Dt+l).off(qt+l):t(s).off(qt+l),delete m.bnd[i];if(o=m.linkCtx){if(a=o.tag){if(d=a.tagCtxs)for(c=d.length;c--;)g=d[c],(p=g.map)&&p.unmap(),(h=g.linkedElems)&&(_=(_||[]).concat(h));a.onUnbind&&a.onUnbind(a.tagCtx,o,a.ctx,!0),a.onDispose&&a.onDispose(),a._elCnt||(a._prv&&a._prv.parentNode.removeChild(a._prv),a._nxt&&a._nxt.parentNode.removeChild(a._nxt))}for(h=_||[t(o.elem)],c=h.length;c--;)f=h[c],(u=f&&f[0]&&f[0]._jsvTr)&&(ye(f,u,"off"),f[0]._jsvTr=void 0);v=o.view,"link"===v.type?v.parent.removeViews(v._.key,void 0,!0):delete v._.bnds[e]}delete Kt[m.cbId]}}function Ie(e){e?(e=e.jquery?e:t(e),e.each(function(){for(var e;(e=vn(this,!0))&&e.parent;)e.parent.removeViews(e._.key,void 0,!0);je(this.getElementsByTagName("*"))}),je(e)):(fn&&(t(fn).off(yn,Z).off("input",'input[type="number"]',Z).off("blur","[contenteditable]",Z),fn=void 0),qe.removeViews(),je(document.body.getElementsByTagName("*")))}function Te(e){return e.type===jn?e[En]:e.value}function Ve(e,t,n){return n&&n[t]||e.ctx[t]&&e.ctxPrm(t)||De.helpers[t]}function Se(e,t,n,r,i,o){var a,s,l,d,c,p,f,u=0,v=e===t;if(e){for(l=ge(e)||[],a=0,s=l.length;a<s;a++){if(d=l[a],p=d.id,p===r&&d.ch===i){if(!o)break;s=0}v||(c="_"===d.ch?mn[p]:zn[p].linkCtx.tag,d.open?c._prv=t:d.close&&(c._nxt=t)),u+=p.length+2}u&&e.setAttribute(xn,e.getAttribute(xn).slice(u)),f=t?t.getAttribute(xn):n._df,(s=f.indexOf("/"+r+i)+1)&&(f=l._tkns.slice(0,u)+f.slice(s+(o?-1:r.length+1))),f&&(t?t.setAttribute(xn,f):Y(n,f))}else Y(n,ue(n._df,"#"+r+i)),o||t||Y(n,ue(n._df,"/"+r+i))}function Ne(e,t){var n,r,i,o;if(o=ge(e,!0,Gn))for(n=0,r=o.length;n<r;n++)i=o[n],"_"===i.ch?!(i=mn[i.id])||!i.type||t&&i._prv!==t&&i.parentElem!==t||i.parent.removeViews(i._.key,void 0,!0):Ae(i.id,void 0,t)}function Pe(e,t,n,r,i){var o=[];return this&&this._tgId&&(r=this),o[t||0]=e,X(o,n,r,i),this}function Be(){var e=arguments,t=e.length;for(t||(e=this.tag.cvtArgs(void 0,1,this.index),t=e.length);t--;)this.tag.setValue(e[t],t,this.index)}function Le(e){var n,r,i,o,a,s,l,d;if(e.contents=function(e,n){e!==!!e&&(n=e,e=void 0);var r,i=t(this.nodes());return i[0]&&(r=n?i.filter(n):i,i=e&&n?r.add(i.find(n)):r),i},e.nodes=function(e,t,n){var r,i=this.contentView||this,o=i._elCnt,a=!t&&o,s=[];if(!i.args)for(t=t||i._prv,n=n||i._nxt,r=a?t===i._nxt?i.parentElem.lastSibling:t:i._.inline===!1?t||i.linkCtx.elem.firstChild:t&&t.nextSibling;r&&(!n||r!==n);)(e||o||r.tagName!==Vn)&&s.push(r),r=r.nextSibling;return s},e.childTags=function(e,t){e!==!!e&&(t=e,e=void 0);var n=this.contentView||this,r=n.link?n:n.tagCtx.view,i=n._prv,o=n._elCnt,a=[];return n.args||r.link(void 0,n.parentElem,o?i&&i.previousSibling:i,n._nxt,void 0,{get:{tags:a,deep:e,name:t,id:n.link?n._.id+"_":n._tgId+"^"}}),a},"tag"===e._is){for(l=e,r=l.tagCtxs.length;r--;)i=l.tagCtxs[r],i.setValues=Be,i.cvtArgs=_,i.bndArgs=b,i.contents=e.contents,i.childTags=e.childTags,i.nodes=e.nodes;if(o=l.boundProps=l.boundProps||[],a=l.linkTo?["linkTo"]:l.bindTo)for(n=a.length;n--;)s=a[n],s+""===s&&(a[s]=1,t.inArray(s,o)<0&&o.push(s));l.setValue=Ye._gm(l.constructor.prototype.setValue,function(e,r,i){if(!l._.chg){if(!arguments.length)return l.setValues(),l;var o,a,s,d=l.linkedCtxParam,c=l.tagCtxs[i||0],p=c.props,f=l.linkCtx,u=c.linkedElems||l.linkedElem&&[l.linkedElem];if(void 0!==e?l.base.call(l,e,r,i):l.getValue&&(e=l.getValue(i))&&void 0!==e&&(l.bindTo.length>1&&(e=e[r]),d&&d[r]&&t.observable(c.ctx[d[r]][0]).setProperty(pt,e)),(o=u&&u[r])&&o[0])for(n=o.length;n--;)a=o[n],l._.unlinked&&a!==f.elem&&(s=a._jsvLkEl,!l._.inline||s&&s===l||(s&&(e=s.cvtArgs(void 0,1,i)[r]),a._jsvLkEl=l,a._jsvInd=r,a._jsvElse=i,we(l,a),a._jsvBnd="&"+l._tgId+"+")),void 0===e||a._jsvChg||f._val===e||(void 0!==a.value?a.type===jn?a[En]=e&&"false"!==e:a.type===An?a[En]=a.value===e:Qe(e)?a.value=e:t(a).val(e):a.contentEditable===Sn&&(a.innerHTML=e)),p.name&&(a.name=a.name||p.name)}return l}),l.updateValue=Pe,l.updateValues=function(){return X(arguments,void 0,this)},l.setValues=function(){for(var e=arguments.length?1:l.tagCtxs.length;e--;)Be.apply(l.tagCtxs[e],arguments)},l.refresh=function(e){var t,n=l.linkCtx,r=l.tagCtx.view;return void 0===e&&(e=Ye._tag(l,r,r.tmpl,Ee(l),!0)),e+""===e&&(l.onUnbind&&l.onUnbind(l.tagCtx,n,l.ctx),t=l._.inline?At:n.attr||re(l.parentElem,!0),ee(e,n,t,l)),be(l),l},l.domChange=function(){var e=this.parentElem,n=t.hasData(e)&&t._data(e).events,r="jsv-domchange";n&&n[r]&&t(e).triggerHandler(r,arguments)}}else d=e,d.addViews=function(e,t){var n,r=this,i=t.length,o=r.views;!r._.useKey&&i&&(n=o.length+i,n===r.data.length&&ie(r,e,r.tmpl,o,t,r.ctx)!==!1&&(r._.srt||r.fixIndex(e+i)))},d.removeViews=function(e,n,r,i){function o(e){var n,i,o,a,s,l,d=p[e];if(d&&d.link){if(n=d._.id,r||(l=d.nodes()),d.removeViews(void 0,void 0,!0),d.type=void 0,a=d._prv,s=d._nxt,o=d.parentElem,r||(d._elCnt&&Se(a,s,o,n,"_"),t(l).remove()),!d._elCnt)try{a.parentNode.removeChild(a),s.parentNode.removeChild(s)}catch(c){}ne(d);for(i in d._.bnds)Ae(i);delete mn[n]}}var a,s,l,d=this,c=!d._.useKey,p=d.views;if(c&&(l=p.length),void 0===e)if(c){for(a=l;a--;)o(a);d.views=[]}else{for(s in p)o(s);d.views={}}else if(void 0===n&&(c?n=1:(o(e),delete p[e])),c&&n&&(i||l-n===d.data.length)){for(a=e+n;a-- >e;)o(a);p.splice(e,n),d._.srt||d.fixIndex(e)}},d.moveViews=function(e,n,r){function i(e,t){return RegExp("^(.*)("+(t?"\\/":"#")+e._.id+"_.*)$").exec(t||e._prv.getAttribute(xn))}function o(e,t){e._prv.setAttribute(xn,t)}var a,s,l,d=this,c=d._nxt,p=d.views,f=n<e,u=f?n:e,v=f?e:n,g=n,h=[],_=p.splice(e,r);for(n>p.length&&(n=p.length),p.splice.apply(p,[n,0].concat(_)),r=_.length,l=n+r,v+=r,g;g<l;g++)s=p[g],a=s.nodes(!0),h=d._elCnt?h.concat(a):h.concat(s._prv,a,s._nxt);if(h=t(h),l<p.length?h.insertBefore(p[l]._prv):c?h.insertBefore(c):h.appendTo(d.parentElem),d._elCnt){var m,b=f?u+r:v-r,x=p[u-1],y=p[u],w=p[b],k=p[v],C=i(y),E=i(w);o(y,E[1]+C[2]),k?(m=i(k),o(k,C[1]+m[2])):c?(m=i(d,c.getAttribute(xn)),c.setAttribute(xn,C[1]+m[2])):(m=i(d,d.parentElem._df),Y(d.parentElem,C[1]+m[2])),o(w,m[1]+E[2]),x?x._nxt=y._prv:d._prv=y._prv,p[b-1]._nxt=w._prv,p[v-1]._nxt=k?k._prv:c}d.fixIndex(u)},d.refresh=function(){var e=this,t=e.parent;t&&(ie(e,e.index,e.tmpl,t.views,e.data,void 0,!0),ne(e))},d.fixIndex=function(e){for(var t=this.views,n=t.length;e<n--;)t[n].index!==n&&He(t[n]).setProperty("index",n)},d.link=ce}function Ue(e,t,n){if("set"===n.change){for(var r=e.tgt,i=r.length;i--&&r[i].key!==n.path;);i===-1?n.path&&!n.remove&&He(r).insert({key:n.path,prop:n.value}):n.remove?He(r).remove(i):He(r[i]).setProperty("prop",n.value)}}function $e(e,t,n){var r,i=e.src,o=n.change;"set"===o?"prop"===n.path?He(i).setProperty(t.target.key,n.value):(He(i).removeProperty(n.oldValue),He(i).setProperty(n.value,t.target.prop)):"remove"===o?(r=n.items[0],He(i).removeProperty(r.key),delete i[r.key]):"insert"===o&&(r=n.items[0],r.key&&He(i).setProperty(r.key,r.prop))}function Me(e){return e.indexOf(".")<0}var Re=t===!1;if(t=t||e.jQuery,!t||!t.fn)throw"JsViews requires jQuery";var Fe,Oe,qe,De,Ke,He,Je,ze,Qe,We,Xe,Ze,Ge,Ye,et,tt,nt,rt,it,ot,at,st,lt,dt,ct="v0.9.87",pt="_ocp",ft=/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,ut=/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(!*?[#~]?[\w$.^]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=\s*[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,vt=/[ \t]*(\r\n|\n|\r)/g,gt=/\\(['"])/g,ht=/['"\\]/g,_t=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$_\.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,mt=/^if\s/,bt=/<(\w+)[>\s]/,xt=/[\x00`><"'&=]/g,yt=/[\x00`><\"'&=]/,wt=/^on[A-Z]|^convert(Back)?$/,kt=/^\#\d+_`[\s\S]*\/\d+_`$/,Ct=xt,Et=0,jt={"&":"&","<":"<",">":">","\0":"�","'":"'",'"':""","`":"`","=":"="},At="html",It="object",Tt="data-jsv-tmpl",Vt="jsvTmpl",St="For #index in nested block use #getIndex().",Nt={},Pt=e.jsrender,Bt=Pt&&t&&!t.render,Lt={template:{compile:j},tag:{compile:C},viewModel:{compile:T},helper:{},converter:{}};if(De={jsviews:ct,sub:{View:w,Err:l,tmplFn:R,parse:D,extend:d,extendCtx:H,syntaxErr:M,onStore:{template:function(e,t){null===t?delete Nt[e]:Nt[e]=t}},addSetting:N,settings:{allowCode:!1},advSet:a,_ths:i,_gm:r,_tg:function(){},_cnvt:h,_tag:y,_er:$,_err:U,_html:W,_cp:o,_sq:function(e){return"constructor"===e&&M(""),e}},settings:{delimiters:c,advanced:function(e){return e?(d(tt,e),Ye.advSet(),nt):tt}},map:P},(l.prototype=new Error).constructor=l,f.depends=function(){return[this.get("item"),"index"]},u.depends="index",w.prototype={get:p,getIndex:u,getRsc:x,getTmpl:g,ctxPrm:v,_is:"view"},Ye=De.sub,nt=De.settings,!(Pt||t&&t.render)){for(Fe in Lt)S(Fe,Lt[Fe]);Xe=De.converters,Ze=De.helpers,Ge=De.tags,Ye._tg.prototype={baseApply:E,cvtArgs:_,bndArgs:b,ctxPrm:v},qe=Ye.topView=new w,t?(t.fn.render=Q,Je=t.expando,t.observable&&(d(Ye,t.views.sub),De.map=t.views.map)):(t={},Re&&(e.jsrender=t),t.renderFile=t.__express=t.compile=function(){throw"Node.js: use npm jsrender, or jsrender-node.js"},t.isFunction=function(e){return"function"==typeof e},t.isArray=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},Ye._jq=function(e){e!==t&&(d(e,t),t=e,t.fn.render=Q,delete t.jsrender,Je=t.expando)},t.jsrender=ct),et=Ye.settings,et.allowCode=!1,ze=t.isFunction,t.render=Nt,t.views=De,t.templates=We=De.templates;for(lt in et)N(lt);(nt.debugMode=function(e){return void 0===e?et.debugMode:(et.debugMode=e,et.onError=e+""===e?new Function("","return '"+e+"';"):ze(e)?e:void 0,nt)})(!1),tt=et.advanced={useViews:!1,_jsv:!1},Ge({"if":{render:function(e){var t=this,n=t.tagCtx,r=t.rendering.done||!e&&(arguments.length||!n.index)?"":(t.rendering.done=!0,t.selected=n.index,n.render(n.view,!0));return r},flow:!0},"for":{render:function(e){var t,n=!arguments.length,r=this,i=r.tagCtx,o="",a=0;return r.rendering.done||(t=n?i.view.data:e,void 0!==t&&(o+=i.render(t,n),a+=Qe(t)?t.length:1),(r.rendering.done=a)&&(r.selected=i.index)),o},flow:!0},props:{baseTag:"for",dataMap:P(z),flow:!0},include:{flow:!0},"*":{render:o,flow:!0},":*":{render:o,flow:!0},dbg:Ze.dbg=Xe.dbg=s}),Xe({html:W,attr:W,url:function(e){return void 0!=e?encodeURI(""+e):null===e?e:""}})}if(et=Ye.settings,Qe=(t||Pt).isArray,nt.delimiters("{{","}}","^"),Bt&&Pt.views.sub._jq(t),De=t.views,Ye=De.sub,ze=t.isFunction,Qe=t.isArray,Je=t.expando,!t.observe){var Ut=t.event.special,$t=[].slice,Mt=[].splice,Rt=[].concat,Ft=parseInt,Ot=/\S+/g,qt=Ye.propChng=Ye.propChng||"propertyChange",Dt=Ye.arrChng=Ye.arrChng||"arrayChange",Kt={},Ht=qt+".observe",Jt=1,zt=1,Qt=1,Wt=t.hasData,Xt=t.data,Zt={},Gt=function(e){return e._cId=e._cId||".obs"+zt++},Yt=function(e,t){return this._data=t,this._ns=e,this},en=function(e,t){return this._data=t,this._ns=e,this},tn=function(e){return Qe(e)?[e]:e},nn=function(e,t,n){e=e?Qe(e)?e:[e]:[];var r,i,o,a,s=o=t,l=e&&e.length,d=[];for(r=0;r<l;r++)i=e[r],ze(i)?(a=t._ocp?t.view.data:t,d=d.concat(nn(i.call(a,a,n),t,n))):""+i===i?(s!==o&&d.push(o=s),d.push(i)):(t=s=i,s!==o&&d.push(o=s));return d.length&&(d.unshift({_ar:1}),d.push({_ar:-1})),d},rn=function(e,t){for(var n in e)return;delete Kt[t]},on=function(e,t){function n(e){return typeof e===It&&(f[0]||p&&Qe(e))}if(!e.data||!e.data.off){var r,i,o,a=t.oldValue,s=t.value,l=e.data,d=l.observeAll,c=l.cb,p=l.arOk,f=l.paths,u=l.ns;e.type===Dt?(c.array||c).call(l,e,t):l.prop!==t.path&&"*"!==l.prop||(d?(r=d._path+"."+t.path,i=d.filter,o=[e.target].concat(d.parents()),n(a)&&an(void 0,u,[a],f,c,!0,i,[o],r),n(s)&&an(void 0,u,[s],f,c,void 0,i,[o],r)):(n(a)&&an(void 0,u,[a],f,c,!0),n(s)&&an(void 0,u,[s],f,c)),l.cb(e,t))}},an=function(){var e=Rt.apply([],arguments);return Ke.apply(e.shift(),e)},sn=function(e,t,n){dn(this._ns,this._data,e,t,[],"root",n)},ln=function(e,t){sn.call(this,e,t,!0)},dn=function(e,t,n,r,i,o,a,s){function l(e,t){for(p=e.length,u=o+"[]";p--;)d(e,p,t,1)}function d(t,i,o,a){var l,d;i!==Je&&(l=He._fltr(u,t[i],v,r))&&(d=v.slice(),a&&g&&d[0]!==g&&d.unshift(g),dn(e,l,n,r||(a?void 0:0),d,u,o,s))}function c(e,t){switch(o=e.data.observeAll._path,g=e.target,t.change){case"insert":l(t.items);break;case"remove":l(t.items,!0);break;case"set":u=o+"."+t.path,d(t,"oldValue",!0),d(t,"value")}g=void 0,n.apply(this,arguments)}c._wrp=1;var p,f,u,v,g,h,_=!s||s.un||!a;if(t&&typeof t===It){if(v=[t].concat(i),f=Qe(t)?"":"*",s&&_&&Wt(t)&&s[h=Xt(t).obId])return void s[h]++;if(s||(s={un:a}),n){if(f||0!==r)if(c._cId=Gt(n),_)Ke(e,t,f,c,a,r,v,o),h=Xt(t).obId,s[h]=(s[h]||0)+1;else{if(--s[Xt(t).obId])return;Ke(e,t,f,c,a,r,v,o)}}else s&&(s[Xt(t).obId]=1),Ke(e,t,f,void 0,a,r,v,o);if(f)for(p in t)u=o+"."+p,d(t,p,a);else l(t,a)}},cn=function(e){return e.indexOf(".")<0&&e.indexOf("[")<0},pn=function(){return[].push.call(arguments,!0),Ke.apply(void 0,arguments)};Ke=function(){function e(){function i(e,i,o,a){var s,l,d=Wt(R),c=tn(R),p=T,f=V;if(e=n?e+"."+n:e,!h&&(a||o))for(w=d&&t._data(R),w=w&&w.events,w=w&&w[o?Dt:qt],x=w&&w.length;x--;)if(y=w[x]&&w[x].data,y&&(a&&y.ns!==n||!a&&y.ns===n&&y.cb&&y.cb._cId===_._cId&&(!_._wrp||y.cb._wrp)))return;h||a?t(c).off(e,on):(l=o?{}:{fullPath:v,paths:i?[i]:[],prop:u,arOk:r},l.ns=n,l.cb=_,V&&(l.observeAll={_path:f,path:function(){return s=p.length,f.replace(/[[.]/g,function(e){return s--,"["===e?"["+t.inArray(p[s-1],p[s]):"."})},parents:function(){return p},filter:S}),t(c).on(e,null,l,on),j&&(j[Xt(R).obId||Xt(R,"obId",Jt++)]=R))}function s(t){var n=M;return t.ob=k(t,n),t.cb=function(i,o){var a=t.ob,s=t.sb,d=k(t,n);d!==a&&(typeof a===It&&(l(a,!0),(s||r&&Qe(a))&&e([a],s,_,k,!0)),t.ob=d,typeof d===It&&(l(d),(s||r&&Qe(d))&&e([d],s,_,k))),_(i,o)}}function l(e,t,n,o){if(r){var a=R,s=V;R=e,o&&(R=e[o],V+="."+o),S&&R&&(R=He._fltr(V,R,o?[e].concat(T):T,S)),R&&(n||Qe(R))&&i(Dt+".observe"+(_?Gt(_):""),void 0,!0,t),R=a,V=s}}var d,c,p,f,u,v,g,h,_,m,b,x,y,w,k,C,E,j,A,I,T,V,S,N,P,B,L=Ht,U=1!=this?Rt.apply([],arguments):$t.call(arguments),$=U.pop()||!1,M=U.shift(),R=M,F=U.length;if(a.unshift(M),$+""===$&&(V=$,T=U.pop(),S=U.pop(),$=!!U.pop(),F-=3),$===!!$&&(h=$,$=U[F-1],$=!F||$+""===$||$&&!ze($)?void 0:(F--,U.pop()),h&&!F&&ze(M)&&($=M,M=void 0)),_=$,F&&ze(U[F-1])&&(C=k=_,_=U.pop(),F--),h&&_&&!_._cId)return void a.shift();for(L+=_?(b=_._inId||"",h?_._cId+b:(m=Gt(_))+b):"",m&&!h&&(j=Kt[m]=Kt[m]||{}),N=n&&n.match(Ot)||[""],P=N.length;P--;){if(n=N[P],M&&!U[0]&&(Qe(M)&&l(M,h,!0),h&&i(L,"")),h&&!F&&!M)for(c in Kt){c=Kt[c];for(y in c)R=c[y],Qe(R)?l(R,h,h):i(L,"")}for(A=0,d=0;d<F;d++)if(v=U[d],""!==v&&v!==M)if(v&&v._ar)r+=v._ar;else if(R=M,""+v===v?(f=v.split("^"),f[1]&&(A=f[0].split(".").length,v=f.join("."),A=v.split(".").length-A),k&&(E=k(v,M,A)),k=C,f=v.split(".")):v&&v._cxp?(B=v.shift(),pt in B?(M=B,k=0):(k=Ye._gccb(B),M=B.data),E=v,E.push(o)):(ze(v)||v&&v._cpfn&&(I=h?v.cb:s(v),I._cId=_._cId,I._inId=I._inId||".obIn"+Qt++,(v.bnd||v.prm&&v.prm.length||!v.sb)&&e([R],v.path,[v.root||M],v.prm,I,k,h),v.sb&&(v.sb.prm&&(v.sb.root=M),e([v.ob],v.sb,_,k,h)),v=o,R=void 0),f=[M=v]),E)F+=E.length-1,Mt.apply(U,[d--,1].concat(E)),E=void 0;else for(;R&&void 0!==(u=f.shift());)if(typeof R===It){if(""+u===u){if(""===u)continue;if(f.length<A+1&&!R.nodeType){if(!h&&(w=Wt(R)&&t._data(R))){for(w=w.events,w=w&&w[qt],x=w&&w.length,p=0;x--;)y=w[x].data,!y||y.ns!==n||y.cb._cId!==_._cId||y.cb._inId!==_._inId||y.prop!==u&&"*"!==y.prop&&"**"!==y.prop||((c=f.join("."))&&y.paths.push(c),p++);if(p){R=R[u];continue}}if("*"===u||"**"===u){if(!h&&w&&w.length&&i(L,"",!1,!0),"*"===u){i(L,"");for(c in R)c!==Je&&l(R,h,void 0,c)}else t.observable(n,R)[(h?"un":"")+"observeAll"](_);break}u&&i(L+".p_"+u,f.join("^"))}V&&(V+="."+u),u=R[u],f[0]||l(u,h)}if(ze(u)){(g=u.depends)&&e([R._ocp?R.view.data:R],nn(g,R,_),_,k,h);break}R=u}}return m&&rn(j,m),a.shift(),{cbId:m,bnd:j}}var n,r=1==this?0:1,i=$t.call(arguments),o=i[0],a=[o];return o+""===o&&r&&(n=o,i.shift(),o=i[0]),e.apply(1,i)},He=function(e,t){return 1===arguments.length&&(t=e,e=""),Qe(t)?new en(e,t):new Yt(e,t)},t.observable=He,He._fltr=function(e,t,n,r){if(!r||!ze(r)||r(e,t,n))return t=ze(t)?t.set&&t.call(n[0]):t,typeof t===It&&t},He.Object=Yt,He.Array=en,t.observe=He.observe=Ke,t.unobserve=He.unobserve=pn,He._apply=an,Yt.prototype={_data:null,observeAll:sn,unobserveAll:ln,data:function(){return this._data},setProperty:function(e,t,n){e=e||"";var r,i,o,a=e+""!==e&&!e._is,s=this,l=s._data;if(l)if(a)if(n=t,Qe(e))for(r=e.length;r--;)i=e[r],s.setProperty(i.name,i.value,void 0===n||n);else for(r in e)s.setProperty(r,e[r],n);else if(e!==Je){if(e._is)o=[e];else for(o=e.split(/[.^]/);l&&o.length>1;)l=l[o.shift()];l&&s._setProperty(l,o[0],t,n)}return s},removeProperty:function(e){return this.setProperty(e,Zt),this},_setProperty:function(e,t,n,r){var i,o,a,s=t?e[t]:e;ze(s)&&s.set&&(e=e._vw||e,o=s,i=o.set===!0?o:o.set,s=o.call(e)),(s!==n||r&&s!=n)&&(!(s instanceof Date&&n instanceof Date)||s>n||s<n)&&(i?(i.call(e,n),n=o.call(e)):(a=n===Zt)?void 0!==s?(delete e[t],n=void 0):t=void 0:t&&(e[t]=n),t&&this._trigger(e,{change:"set",path:t,value:n,oldValue:s,remove:a}))},_trigger:function(e,n){t(e).triggerHandler(qt+(this._ns?"."+/^\S+/.exec(this._ns)[0]:""),n)}},en.prototype={_data:null,observeAll:sn,unobserveAll:ln,data:function(){return this._data},insert:function(e,t){var n=this._data;return 1===arguments.length&&(t=e,e=n.length),e=Ft(e),e>-1&&(t=Qe(t)?t:[t],t.length&&this._insert(e,t)),this},_insert:function(e,t){var n=this._data,r=n.length;e>r&&(e=r),Mt.apply(n,[e,0].concat(t)),this._trigger({change:"insert",index:e,items:t},r)},remove:function(e,t){var n,r=this._data;return void 0===e&&(e=r.length-1),e=Ft(e),t=t?Ft(t):0===t?0:1,t>0&&e>-1&&(n=r.slice(e,e+t),(t=n.length)&&this._remove(e,t,n)),this},_remove:function(e,t,n){var r=this._data,i=r.length;r.splice(e,t),this._trigger({change:"remove",index:e,items:n},i)},move:function(e,t,n){return n=n?Ft(n):0===n?0:1,e=Ft(e),t=Ft(t),n>0&&e>-1&&t>-1&&e!==t&&this._move(e,t,n),this},_move:function(e,t,n){var r,i=this._data,o=i.length,a=e+n-o;a>0&&(n-=a),n&&(r=i.splice(e,n),t>i.length&&(t=i.length),Mt.apply(i,[t,0].concat(r)),t!==e&&this._trigger({change:"move",oldIndex:e,index:t,items:r},o))},refresh:function(e){function t(){i&&(s.insert(r-i,l),f+=i,n+=i,i=0,l=[])}var n,r,i,o,a,s=this,l=[],d=s._data,c=d.slice(),p=d.length,f=p,u=e.length;for(s._srt=!0,r=i=0;r<u;r++)if((o=e[r])===d[r-i])t();else{for(n=r-i;n<f&&o!==d[n];n++);if(n<f){for(t(),a=0;a++<u-n&&e[r+a]===d[n+a];);s.move(n,r,a),r+=a-1}else i++,l.push(o)}return t(),f>r&&s.remove(r,f-r),s._srt=void 0,s._trigger({change:"refresh",oldItems:c},p),s},_trigger:function(e,n){var r=this,i=r._data,o=i.length,a=t([i]);r._srt?e.refresh=!0:o!==n&&a.triggerHandler(qt,{change:"set",path:"length",value:o,oldValue:n}),a.triggerHandler(Dt+(r._ns?"."+/^\S+/.exec(r._ns)[0]:""),e)}},Ut[qt]=Ut[Dt]={remove:function(e){var n,r,i,o,a,s=e.data;if(s&&(s.off=!0,s=s.cb)&&(n=Kt[s._cId])){for(i=t._data(this).events[e.type],o=i.length;o--&&!r;)r=(a=i[o].data)&&a.cb&&a.cb._cId===s._cId;r||(delete n[Xt(this).obId],rn(n,s._cId))}}},De.map=function(e){function n(t,n,r,i){var o,a=this;this.src&&this.unmap(),typeof t===It&&(a.src=t,a.tgt=r||a.tgt||[],a.options=n||a.options,a.update(),i||(e.obsSrc&&He(a.src).observeAll(a.obs=function(t,n){o||(o=!0,e.obsSrc(a,t,n),o=void 0)},a.srcFlt),e.obsTgt&&He(a.tgt).observeAll(a.obt=function(t,n){o||(o=!0,e.obsTgt(a,t,n),o=void 0)},a.tgtFlt)))}return ze(e)&&(e={getTgt:e}),e.baseMap&&(e=t.extend({},e.baseMap,e)),e.map=function(e,t,r,i){return new n(e,t,r,i)},(n.prototype={srcFlt:e.srcFlt||cn,tgtFlt:e.tgtFlt||cn,update:function(t){var n=this;He(n.tgt).refresh(e.getTgt(n.src,n.options=t||n.options))},unmap:function(){var e=this;e.src&&(e.obs&&He(e.src).unobserveAll(e.obs,e.srcFlt),e.obt&&He(e.tgt).unobserveAll(e.obt,e.tgtFlt),e.src=void 0)},map:n,_def:e}).constructor=n,e},Ye.advSet=function(){Ye._gccb=this._gccb,e._jsv=et.advanced._jsv?{cbBindings:Kt}:void 0},Ye._dp=nn}if(nt=De.settings,et=Ye.settings,tt=et.advanced,Xe=De.converters,t.templates=We=De.templates,Ge=De.tags,bt=/<(?!script)(\w+)[>\s]/,t.link)return t;et.trigger=!0;var fn,un,vn,gn,hn,_n,mn,bn,xn="data-jsv",yn="change.jsv",wn="onBeforeChange",kn="onAfterChange",Cn="onAfterCreate",En="checked",jn="checkbox",An="radio",In="none",Tn="value",Vn="SCRIPT",Sn="true",Nn='"></script>',Pn='<script type="jsv',Bn=xn+"-df",Ln="script,["+xn+"]",Un={value:"val",input:"val",html:At,text:"text"},$n={from:Tn,to:Tn},Mn=0,Rn=t.cleanData,Fn=nt.delimiters,On=document.createDocumentFragment(),qn=document.querySelector,Dn={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},Kn={tr:"table"},Hn={br:1,img:1,input:1,hr:1,area:1,base:1,col:1,link:1,meta:1,command:1,embed:1,keygen:1,param:1,source:1,track:1,wbr:1},Jn={},zn={},Qn=1,Wn=/^#(view\.?)?/,Xn=/((\/>)|<\/(\w+)>|)(\s*)([#\/]\d+(?:_|(\^)))`(\s*)(<\w+(?=[\s\/>]))?|\s*(?:(<\w+(?=[\s\/>]))|<\/(\w+)>(\s*)|(\/>)\s*|(>)|$)/g,Zn=/(#)()(\d+)(_)/g,Gn=/(#)()(\d+)([_^])/g,Yn=/(?:(#)|(\/))(\d+)(_)/g,er=/(#)()(\d+)(\^)/g,tr=/(?:(#)|(\/))(\d+)([_^])([-+@\d]+)?/g,nr=/&(\d+)\+?/g,rr=e.getComputedStyle;if(He=t.observable,!He)throw requiresStr+"JsObservable";return Ke=He.observe,Le(Ye.View.prototype),Ye.onStore.template=function(e,n,r){null===n?(delete t.link[e],delete t.render[e]):(n.link=le,e&&!r&&"jsvTmpl"!==e&&(t.render[e]=n,t.link[e]=function(){return le.apply(n,arguments)}))},Ye.viewInfos=ge,(nt.delimiters=function(){var e=Fn.apply(0,arguments);return Fn!==c&&(e=c.apply(0,arguments)),un=new RegExp("(?:^|\\s*)([\\w-]*)(\\"+st+")?(\\"+it+Ye.rTag+"(:\\w*)?\\"+ot+")","g"),e})(),Ye.addSetting("trigger"),Xe.merge=function(e){var t,n=this.linkCtx.elem.className,r=this.tagCtx.props.toggle;return r&&(t=r.replace(/[\\^$.|?*+()[{]/g,"\\$&"),t="(\\s(?="+t+"$)|(\\s)|^)("+t+"(\\s|$))",n=n.replace(new RegExp(t),"$2"),e=n+(e?(n&&" ")+r:"")),e},Ge({on:{attr:In,init:function(e){for(var n,r=this,i=0,o=e.args,a=o.length;i<a&&!ze(o[i]);i++);r._hi=a>i&&i+1,r._.inline&&(Ye.rTmpl.exec(n=t.trim(e.tmpl.markup))||(r.template="<button>"+(n||e.params.args[i]||"noop")+"</button>"),r.attr=At)},onBeforeBind:function(){this.template&&(this.mainElem=this.contents("button"))},onAfterLink:function(e,n){var r,i,o,a=this,s=a._hi,l=e.args,d=l.length,c=e.props,p=c.data,f=e.view,u=c.context;s&&(r=l[s-1],i=l.slice(s),l=l.slice(0,s-1),a._sel=l[1],o=a.activeElem=a.activeElem||t(a._.inline?(a._sel=l[1]||"*",a.parentElem):n.elem),u||(u=/^(.*)[\.^][\w$]+$/.exec(e.params.args.slice(-i.length-1)[0]),u=u&&Ye.tmplFn(it+":"+u[1]+ot,f.tmpl,!0)(n.data,f)),a._evs&&a.onUnbind(),o.on(a._evs=l[0]||"click",a._sel,void 0==p?null:p,a._hlr=function(e){var t,o=!a._.inline;if(!o)for(t=a.contents("*"),d=t.length;!o&&d--;)t[d].contains(e.target)&&(o=!0);if(o)return r.apply(u||n.data,[].concat(i,e,{change:e.type,view:f,linkCtx:n},i.slice.call(arguments,1)))}))},onUpdate:!1,onUnbind:function(){var e=this;e.activeElem&&e.activeElem.off(e._evs,e._sel,e._hlr)},contentCtx:!0,setSize:!0,dataBoundOnly:!0},radiogroup:{init:function(e){this.name=e.props.name||(Math.random()+"jsv").slice(9)},onBind:function(e,n){var r,i,o,a=this;for(a._.inline?(r=a.contents("*")[0],r=r&&vn(r).ctx.tag===a.parent?r:a.parentElem,i=a.contents(!0,"input[type=radio]")):(r=n.elem,i=t("input[type=radio]",n.elem)),a.linkedElem=i,o=i.length;o--;)i[o].name=i[o].name||a.name;t(r).on("jsv-domchange",function(t,n){var s,l,d=n.ctx.parentTags;if(!a._.inline||r!==a.parentElem||d&&d[a.tagName]===a){for(l=a.cvtArgs()[0],i=a.linkedElem=a.contents(!0,"input[type=radio]"),o=i.length;o--;)s=i[o],s._jsvLkEl=a,s.name=s.name||a.name,s._jsvBnd="&"+a._tgId+"+",s.checked=l===s.value;a.linkedElems=e.linkedElems=[i]}})},onUpdate:!1,contentCtx:!0,dataBoundOnly:!0}}),d(Ge["for"],{onArrayChange:function(e,t,n,r){var i,o=e.target,a=o.length,s=this,l=t.change;for(i in s._.arrVws)i=s._.arrVws[i];s._.noVws||s.tagCtxs[1]&&("insert"===l&&a===t.items.length||"remove"===l&&!a)?s.refresh():i.data===o&&te.apply(i,arguments),s._elCnt&&(i=i.views[0],s._prv=i?i._prv:null),s.domChange(n,r,t),e.done=!0},onAfterLink:function(e,t){for(var n,r,i,o=this,a=0,s=o._ars||{},l=o.tagCtxs,d=l.length,c=o.selected||0;a<=c;a++)e=l[a],i=e.map?e.map.tgt:e.args.length?e.args[0]:e.view.data,(r=s[a])&&i!==r[0]&&(Ke(r[0],r[1],!0),delete s[a]),!s[a]&&Qe(i)&&!function(){var r=e;Ke(i,n=function(e,n){o.onArrayChange(e,n,r,t)}),s[a]=[i,n]}();for(a=c+1;a<d;a++)(r=s[a])&&(Ke(r[0],r[1],!0),delete s[a]);o._ars=s},onDispose:function(){var e,t=this;for(e in t._ars)Ke(t._ars[e][0],t._ars[e][1],!0)}}),d(Ge["if"],{onUpdate:function(e,t,n){for(var r,i,o=0;r=this.tagCtxs[o];o++)if(i=r.props.tmpl!==n[o].props.tmpl||r.args.length&&!(r=r.args[0])!=!n[o].args[0],!this.convert&&r||i)return i;return!1},onAfterLink:function(e,t,n,r,i){i&&this.domChange(e,t,i)}}),Ge("props",{baseTag:"for",dataMap:De.map({getTgt:Ge.props.dataMap.getTgt,obsSrc:Ue,obsTgt:$e,tgtFlt:Me}),flow:!0}),d(t,{view:vn=function(e,n,r){function i(e,t){if(e)for(a=ge(e,t,Zn),l=0,d=a.length;l<d&&(!(o=mn[a[l].id])||!(o=o&&r?o.get(!0,r):o));l++);}n!==!!n&&(r=n,n=void 0);var o,a,s,l,d,c,p,f=0,u=document.body;if(e&&e!==u&&qe._.useKey>1&&(e=""+e===e?t(e)[0]:e.jquery?e[0]:e)){if(n){if(i(e._df,!0),!o)for(p=qn?e.querySelectorAll(Ln):t(Ln,e).get(),c=p.length,s=0;!o&&s<c;s++)i(p[s]);return o}for(;e;){if(a=ge(e,void 0,Yn))for(c=a.length;c--;)if(o=a[c],o.open){if(f<1)return o=mn[o.id],o&&r?o.get(r):o||qe;f--}else f++;e=e.previousSibling||e.parentNode}}return qe},link:de,unlink:Ie,cleanData:function(e){e.length&&Mn&&je(e),Rn.apply(t,arguments)}}),d(t.fn,{link:function(e,t,n,r,i,o,a){return de(e,this,t,n,r,i,o,a)},unlink:function(){return Ie(this)},view:function(e,t){return vn(this[0],e,t)}}),t.each([At,"replaceWith","empty","remove"],function(e,n){var r=t.fn[n];t.fn[n]=function(){var e;Mn=1;try{e=r.apply(this,arguments)}finally{Mn=0}return e}}),d(qe=Ye.topView,{tmpl:{links:{}}}),mn={0:qe},Ye._glt=function(e){for(var t,n=/#(\d*)\^\/\1\^/g,r=[],i=ve(e);t=n.exec(i);)(t=zn[t[1]])&&r.push(t.linkCtx.tag);return r},Ye._gccb=function(e){return function(t,n,r){var i,o,a,s,l,d,c,p,f,u,v;if(e&&t){if(t._cpfn)return t._cpfn.call(e.tmpl,n,e,Ye);if("~"===t.charAt(0)){if("~tag"===t.slice(0,4)&&(o=e.ctx,"."===t.charAt(4)&&(i=t.slice(5).split("."),o=o.tag),i))return o?[o,i.join("."),n]:[];if(t=t.slice(1).split("."),s=e.ctxPrm(l=t.shift(),void 0,!0))if(p=s._cxp){if(t.length&&(d="."+t.join("."),l=s[c=s.length-1],l._cpfn?(l.sb=d,l.bnd=!!r):(s[c]=(l+d).replace("#data.",""),"#view"===l.slice(0,5)&&(s[c]=s[c].slice(6),s.splice(c,0,e)))),a=[s],(o=p.tag)&&o.convert)for(v=o.bindTo||[0],c=v.length;c--;)void 0!==r&&c!==p.ind&&(u=v[c],f=[s[0],o.tagCtx.params[+u===u?"args":"props"]],f._cxp=p,a.push(f))}else(t.length||ze(s))&&(a=[s,t.join("."),n]);return a||[]}if("#"===t.charAt(0))return"#data"===t?[]:[e,t.replace(Wn,""),n]}}},Ye._cp=function(e,t,n,r){if(n.linked){if(t){var i=it+":"+t+ot,o=qe.tmpl.links,a=o[i];a||(o[i]=a=Ye.tmplFn(i,n.tmpl,!0)),e=a.deps[0]?[n,a]:[{_ocp:r?r.tag.cvtArgs(void 0,1,r.tagElse)[r.ind]:a()}]}else e=[{_ocp:void 0}];e._cxp=r||{updateValue:function(t){return He(e._cxp.data).setProperty(e._cxp.path,t),this}}}return e},Ye._crcp=function(e,n,r,i){return(i||(r._ocps=r._ocps||{}))[e]=n=[{_ocp:n,_vw:r}],n._cxp={path:pt,ind:0,updateValue:function(e,r){return t.observable(n[0]).setProperty(pt,e),this}},n},Ye._ucp=function(e,n,r,i){var o,a;return i.path||Ce("~"+e,r.data,Ye._gccb(r)),(a=i.tag)&&(o=t.inArray(e,a.linkedCtxParam),a.setValue(n,o,i.tagElse)),(a||i).updateValue(n,o,i.tagElse)},Ye._ceo=function ir(e){for(var t,n=[],r=e.length;r--;)t=e[r],t._cpfn&&(t=d({},t),t.prm=ir(t.prm)),n.unshift(t);return n},bn=Ye.advSet,Ye.advSet=function(){bn.call(Ye),e._jsv=tt._jsv?d(e._jsv||{},{views:mn,bindings:zn}):void 0,gn=tt.linkAttr,hn=Ln+",["+gn+"]",_n=tt._wm,_n.optgroup=_n.option,_n.tbody=_n.tfoot=_n.colgroup=_n.caption=_n.thead,_n.th=_n.td},nt.advanced({linkAttr:"data-link",useViews:!1,noValidate:!1,_wm:{option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],svg_ns:[1,"<svg>","</svg>"],div:t.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},_fe:{input:{from:Te,to:Tn},textarea:$n,select:$n,optgroup:{to:"label"}}}),t},window);
//# sourceMappingURL=jsviews.min.js.map