forked from BorisMoore/jsrender
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsrender.min.js
More file actions
4 lines (4 loc) · 15.7 KB
/
jsrender.min.js
File metadata and controls
4 lines (4 loc) · 15.7 KB
1
2
3
4
/*! JsRender v1.0.0-beta: http://github.com/BorisMoore/jsrender and http://jsviews.com/jsviews
informal pre V1.0 commit counter: 63 */
(function(n,t,i){"use strict";function gt(n,t){return function(){var r,i=this,u=i.base;return i.base=n,r=t.apply(i,arguments),i.base=u,r}}function ni(n,t){return y(t)&&(t=gt(n?n._d?n:gt(ii,n):ii,t),t._d=1),t}function et(n,t){for(var i in t.props)bt.test(i)&&(n[i]=ni(n[i],t.props[i]))}function ti(n){return n}function ii(){return""}function er(n){return this.base?this.baseApply(arguments):n}function ri(n){s._dbgMode=n;pt=n?"Unavailable (nested view): use #getIndex()":"";vt("dbg",pi.dbg=tt.dbg=n?er:ti)}function ot(n){this.name=(r.link?"JsViews":"JsRender")+" Error";this.message=n||this.name}function f(n,t){for(var i in t)n[i]=t[i];return n}function y(n){return typeof n=="function"}function ui(n,t,i){return(!o.rTag||n)&&(w=n?n.charAt(0):w,b=n?n.charAt(1):b,h=t?t.charAt(0):h,v=t?t.charAt(1):v,nt=i||nt,n="\\"+w+"(\\"+nt+")?\\"+b,t="\\"+h+"\\"+v,p="(?:(?:(\\w+(?=[\\/\\s\\"+h+"]))|(?:(\\w+)?(:)|(>)|!--((?:[^-]|-(?!-))*)--|(\\*)))\\s*((?:[^\\"+h+"]|\\"+h+"(?!\\"+v+"))*?)",o.rTag=p+")",p=new RegExp(n+p+"(\\/)?|(?:\\/(\\w+)))"+t,"g"),yt=new RegExp("<.*>|([^\\\\]|^)[{}]|"+n+".*"+t)),[w,b,h,v,nt]}function or(n,t){t||(t=n,n=i);var e,f,o,u,r=this,s=!t||t==="root";if(n){if(u=r.type===t?r:i,!u)if(e=r.views,r._.useKey){for(f in e)if(u=e[f].get(n,t))break}else for(f=0,o=e.length;!u&&f<o;f++)u=e[f].get(n,t)}else if(s)while(r.parent.parent)u=r=r.parent;else while(r&&!u)u=r.type===t?r:i,r=r.parent;return u}function fi(){var n=this.get("item");return n?n.index:i}function ei(){return this.index}function sr(t){var u,e=this,o=e.linkCtx,r=(e.ctx||{})[t];return r===i&&o&&o.ctx&&(r=o.ctx[t]),r===i&&(r=pi[t]),r&&y(r)&&!r._wrp&&(u=function(){return r.apply(!this||this===n?e:this,arguments)},u._wrp=!0,f(u,r)),u||r}function hr(n,t,r,e){var s,h,l=+r===r&&t.tmpl.bnds[r-1],c=t.linkCtx;return e=e!==i&&{props:{},args:[e]},r=e||(l?l(t.data,t,u):r),h=r.args[0],(n||l)&&(s=c&&c.tag,s||(s=f(new o._tg,{_:{inline:!c,bnd:l,unlinked:!0},tagName:":",cvt:n,flow:!0,tagCtx:r}),c&&(c.tag=s,s.linkCtx=c),r.ctx=a(r.ctx,(c?c.view:t).ctx)),s._er=e&&h,et(s,r),r.view=t,s.ctx=r.ctx||{},delete r.ctx,t._.tag=s,h=st(s,s.convert||n!=="true"&&n)[0],h=l&&t._.onRender?t._.onRender(h,t,l):h,t._.tag=i),h!=i?h:""}function st(n,t){var r=n.tagCtx,u=r.view,i=r.args;return t=t&&(""+t===t?u.getRsc("converters",t)||l("Unknown converter: '"+t+"'"):t),i=!i.length&&!r.index?[u.data]:t?i.slice():i,t&&(t.depends&&(n.depends=o.getDeps(n.depends,n,t.depends,t)),i[0]=t.apply(n,i)),i}function cr(n,t){for(var f,e,r=this;f===i&&r;)e=r.tmpl[n],f=e&&e[t],r=r.parent;return f||u[n][t]}function lr(n,t,r,o,s,h){var c,ct,lt,ut,y,at,g,v,ft,nt,ot,vt,yt,b,w,ht,pt,d="",p=t.linkCtx||0,it=t.ctx,wt=r||t.tmpl,rt=+o===o&&wt.bnds[o-1];for(n._is==="tag"&&(c=n,n=c.tagName,o=c.tagCtxs),c=c||p.tag,h=h!==i&&(d+=h,[{props:{},args:[]}]),o=h||(rt?rt(t.data,t,u):o),at=o.length,y=0;y<at;y++)y||r&&c||(ot=t.getRsc("tags",n)||l("Unknown tag: {{"+n+"}}")),v=o[y],(!p.tag||y&&!p.tag._.inline||c._er)&&(nt=v.tmpl,nt=v.content=nt&&wt.tmpls[nt-1],f(v,{tmpl:(c?c:ot).template||nt,render:li,index:y,view:t,ctx:a(v.ctx,it)})),(r=v.props.tmpl)&&(r=""+r===r?t.getRsc("templates",r)||e(r):r,v.tmpl=r),c||(c=new ot._ctr,vt=!!c.init,c._={inline:!p,unlinked:!0},p&&(p.tag=c,c.linkCtx=p),(c._.bnd=rt||p.fn)?c._.arrVws={}:c.dataBoundOnly&&l("{^{"+n+"}} tag must be data-bound"),c.tagName=n,c.parent=ut=it&&it.tag,c._def=ot,c.tagCtxs=o),v.tag=c,c.dataMap&&c.tagCtxs&&(v.map=c.tagCtxs[y].map),c.flow||(ft=v.ctx=v.ctx||{},ct=c.parents=ft.parentTags=it&&a(ft.parentTags,it.parentTags)||{},ut&&(ct[ut.tagName]=ut),ct[c.tagName]=ft.tag=c);if(t._.tag=c,!(c._er=h)){for(et(c,o[0]),c.rendering={},y=0;y<at;y++)v=c.tagCtx=c.tagCtxs[y],ht=v.props,w=st(c,c.convert),(yt=ht.dataMap||c.dataMap)&&(w.length||ht.dataMap)&&(b=v.map,(!b||b.src!==w[0]||s)&&(b&&b.src&&b.unmap(),b=v.map=yt.map(w[0],ht)),w=[b.tgt]),c.ctx=v.ctx,!y&&vt&&(pt=c.template,c.init(v,p,c.ctx),vt=i,c.template!==pt&&(c._.tmpl=c.template)),p&&(p.attr=c.attr=p.attr||c.attr),g=i,c.render&&(g=c.render.apply(c,w)),w=w.length?w:[t],g=g!==i?g:v.render(w[0],!0)||(s?i:""),d=d?d+(g||""):g;delete c.rendering}return c.tagCtx=c.tagCtxs[0],c.ctx=c.tagCtx.ctx,c._.inline&&(lt=c.attr)&<!==k&&(d=lt==="text"?tt.html(d):""),rt&&t._.onRender?t._.onRender(d,t,rt):d}function g(n,t,i,r,u,f,e,o){var a,h,c,s=this,v=t==="array",l={key:0,useKey:v?0:1,id:""+fr++,onRender:o,bnds:{}};s.data=r;s.tmpl=u;s.content=e;s.views=v?[]:{};s.parent=i;s.type=t||"top";s._=l;s.linked=!!o;i?(a=i.views,h=i._,h.useKey?(a[l.key="_"+h.useKey++]=s,s.index=pt,s.getIndex=fi,c=h.tag,l.bnd=v&&(!c||!!c._.bnd&&c)):a.splice(l.key=s.index=f,0,s),s.ctx=n||i.ctx):s.ctx=n}function ar(n){var i,r,t,u,e,f,s;for(i in d)if(e=d[i],(f=e.compile)&&(r=n[i+"s"]))for(t in r)u=r[t]=f(t,r[t],n),u&&(s=o.onStore[i])&&s(t,u,f)}function vr(n,t,r){var l,h,s,c,u=new o._tg;if(y(t)&&(t={depends:t.depends,render:t}),s=t.baseTag){t.flow=!!t.flow;t.baseTag=s=""+s===s?r&&r.tags[s]||vt[s]:s;u=f(u,s);for(c in t)u[c]=ni(s[c],t[c])}else u=f(u,t);return(h=u.template)!==i&&(u.template=""+h===h?e[h]||e(h):h),u.init!==!1&&(l=u._ctr=function(){},(l.prototype=u).constructor=l),r&&(u._parentTmpl=r),u}function yr(n){return this.base.apply(this,n)}function oi(r,u,f,o){function c(u){if(""+u===u||u.nodeType>0){try{h=u.nodeType>0?u:!yt.test(u)&&t&&t(n.document).find(u)[0]}catch(s){}return h&&(u=e[r=r||h.getAttribute(ft)],u||(r=r||"_"+ur++,h.setAttribute(ft,r),u=e[r]=oi(r,h.innerHTML,f,o)),h=i),u}}var s,h;return u=u||"",s=c(u),o=o||(u.markup?u:{}),o.tmplName=r,f&&(o._parentTmpl=f),!s&&u.markup&&(s=c(u.markup))&&s.fn&&(s.debug!==u.debug||s.allowCode!==u.allowCode)&&(s=s.markup),s!==i?(r&&!f&&(dt[r]=function(){return u.render.apply(u,arguments)}),s.fn||u.fn?s.fn&&(u=r&&r!==s.tmplName?a(o,s):s):(u=hi(s,o),ct(s.replace(di,"\\$&"),u)),ar(o),u):void 0}function si(n){function t(t,i){this.tgt=n.getTgt(t,i)}return y(n)&&(n={getTgt:n}),n.baseMap&&(n=f(f({},n.baseMap),n)),n.map=function(n,i){return new t(n,i)},n}function hi(n,t){var i,e=s.wrapMap||{},u=f({markup:n,tmpls:[],links:{},tags:{},bnds:[],_is:"template",render:ci},t);return t.htmlTag||(i=tr.exec(n),u.htmlTag=i?i[1].toLowerCase():""),i=e[u.htmlTag],i&&i!==e.div&&(u.markup=r.trim(u.markup)),u}function pr(n,t){function r(e,s,h){var v,c,l,a;if(e&&typeof e===ut&&!e.nodeType&&!e.markup&&!e.getTgt){for(l in e)r(l,e[l],s);return u}return s===i&&(s=e,e=i),e&&""+e!==e&&(h=s,s=e,e=i),a=h?h[f]=h[f]||{}:r,c=t.compile,s===null?e&&delete a[e]:(s=c?s=c(e,s,h):s,e&&(a[e]=s)),c&&s&&(s._is=n),s&&(v=o.onStore[n])&&v(e,s,c),s}var f=n+"s";u[f]=r;d[n]=t}function wr(n,t,i){var r=this.jquery&&(this[0]||l('Unknown template: "'+this.selector+'"')),u=r.getAttribute(ft);return ci.call(u?e[u]:e(r),n,t,i)}function ht(n,t,i){if(s._dbgMode)try{return n.fn(t,i,u)}catch(r){return l(r,i)}return n.fn(t,i,u)}function ci(n,t,i,u,f,e){var o=this;return!u&&o.fn._nvw&&!r.isArray(n)?ht(o,n,{tmpl:o}):li.call(o,n,t,i,u,f,e)}function li(n,t,u,o,s,h){function st(n){nt=f({},t);nt[p]=n}var w,ct,y,ft,et,ot,b,d,tt,it,lt,l,at,p,nt,v=this,rt="";if(!!t===t&&(u=t,t=i),typeof t!==ut&&(t=i),s===!0&&(ot=!0,s=0),v.tag?(b=v,v=v.tag,tt=v._,lt=v.tagName,l=tt.tmpl||b.tmpl,tt.noVws=at=v.attr&&v.attr!==k,t=a(t,v.ctx),d=b.content,b.props.link===!1&&(t=t||{},t.link=!1),o=o||b.view,(p=b.props.itemVar)&&(p.charAt(0)!=="~"&&c("Use itemVar='~myItem'"),p=p.slice(1)),n=arguments.length?n:o):l=v,l&&(!o&&n&&n._is==="view"&&(o=n),o&&(d=d||o.content,h=h||o._.onRender,n===o&&(n=o.data),t=a(t,o.ctx)),o&&o.type!=="top"||((t=t||{}).root=n),l.fn||(l=e[l]||e(l)),l)){if(h=(t&&t.link)!==!1&&!at&&h,it=h,h===!0&&(it=i,h=o._.onRender),t=l.helpers?a(l.helpers,t):t,nt=t,r.isArray(n)&&!u)for(y=ot?o:s!==i&&o||new g(t,"array",o,n,l,s,d,h),p&&(y.it=p),p=y.it,w=0,ct=n.length;w<ct;w++)p&&st(n[w]),ft=new g(nt,"item",y,n[w],l,(s||0)+w,d,h),et=ht(l,n[w],ft),rt+=y._.onRender?y._.onRender(et,ft):et;else p&&st(n),y=ot?o:new g(nt,lt||"data",o,n,l,s,d,h),tt&&!v.flow&&(y.tag=v),rt+=ht(l,n,y);return it?it(rt,y):rt}return""}function l(n,t,i){var r=s.onError(n,t,i);if(""+n===n)throw new o.Err(r);return!t.linkCtx&&t.linked?tt.html(r):r}function c(n){l("Syntax error\n"+n)}function ct(n,t,i,r,u){function d(t){t-=e;t&&l.push(n.substr(e,t).replace(rt,"\\n"))}function a(t){t&&c('Unmatched or missing tag: "{{/'+t+'}}" in template:\n'+n)}function g(o,s,v,p,w,g,tt,it,ut,ft,et,ot){g&&(w=":",p=k);ft=ft||i&&!u;var st=(s||i)&&[[]],ct="",lt="",at="",vt="",yt="",pt="",kt="",dt="",ht=!ft&&!w&&!tt;v=v||(ut=ut||"#data",w);d(ot);e=ot+o.length;it?nt&&l.push(["*","\n"+ut.replace(wt,"$1")+"\n"]):v?(v==="else"&&(nr.test(ut)&&c('for "{{else if expr}}" use "{{else expr}}"'),st=f[7]&&[[]],f[8]=n.substring(f[8],ot),f=h.pop(),l=f[2],ht=!0),ut&&yi(ut.replace(rt," "),st,t).replace(gi,function(n,t,i,r,u,f,e,o){return e?(lt+=f+",",vt+="'"+o+"',"):i?(at+=r+f+",",pt+=r+"'"+o+"',"):t?kt+=f:(u==="trigger"&&(dt+=f),ct+=r+f+",",yt+=r+"'"+o+"',",b=b||bt.test(u)),""}).slice(0,-1),st&&st[0]&&st.pop(),y=[v,p||!!r||b||"",ht&&[],ai(vt,yt,pt),ai(lt,ct,at),kt,dt,st||0],l.push(y),ht&&(h.push(f),f=y,f[8]=e)):et&&(a(et!==f[0]&&f[0]!=="else"&&et),f[8]=n.substring(f[8],ot),f=h.pop());a(!f&&et);l=f[2]}var s,y,b,nt=t&&t.allowCode,o=[],e=0,h=[],l=o,f=[,,o];return i&&(n=w+n+v),a(h[0]&&h[0][2].pop()[0]),n.replace(p,g),d(n.length),(e=o[o.length-1])&&a(""+e!==e&&+e[8]===e[8]&&e[0]),i?(s=at(o,n,i),lt(s,[o[0][7]])):s=at(o,t),s._nvw&&(s._nvw=!/[~#]/.test(n)),s}function lt(n,t){var r,i,u=0,f=t.length;for(n.deps=[];u<f;u++){i=t[u];for(r in i)r!=="_jsvto"&&i[r].length&&(n.deps=n.deps.concat(i[r]))}n.paths=i}function ai(n,t,i){return[n.slice(0,-1),t.slice(0,-1),i.slice(0,-1)]}function vi(n,t){return"\n\t"+(t?t+":{":"")+"args:["+n[0]+"]"+(n[1]||!t?",\n\tprops:{"+n[1]+"}":"")+(n[2]?",\n\tctx:{"+n[2]+"}":"")}function yi(n,t,i){function d(d,g,nt,tt,it,rt,ut,ft,et,ot,st,ht,lt,at,vt,yt,pt,wt,bt,kt){function ri(n,i,o,s,h,c,l,a){var y=o===".";if(o&&(it=it.slice(i.length),y||(n=(s?'view.hlp("'+s+'")':h?"view":"data")+(a?(c?"."+c:s?"":h?"":"."+o)+(l||""):(a=s?"":h?c||"":o,"")),n=n+(a?"."+a:""),n=i+(n.slice(0,9)==="view.data"?n.slice(5):n)),u)){if(gt=e==="linkTo"?v=t._jsvto=t._jsvto||[]:f.bd,dt=y&>[gt.length-1]){if(dt._jsv){while(dt.sb)dt=dt.sb;dt.bnd&&(it="^"+it.slice(1));dt.sb=it;dt.bnd=dt.bnd||it.charAt(0)==="^"}}else gt.push(it);k[r]=bt+(y?1:0)}return n}tt=u&&tt;tt&&!ft&&(it=tt+it);rt=rt||"";nt=nt||g||ht;it=it||et;ot=ot||pt||"";var ii,ti,gt,dt,ni;if(!ut||s||o){if(u&&yt&&!s&&!o&&(!e||p||v)&&(ii=k[r-1],kt.length-1>bt-(ii||0))){if(ii=kt.slice(ii,bt+d.length),ti!==!0)if(gt=v||l[r-1].bd,dt=gt[gt.length-1],dt&&dt.prm){while(dt.sb&&dt.sb.prm)dt=dt.sb;ni=dt.sb={path:dt.sb,bnd:dt.bnd}}else gt.push(ni={path:gt.pop()});yt=b+":"+ii+" onerror=''"+h;ti=w[yt];ti||(w[yt]=!0,w[yt]=ti=ct(yt,i,!0));ti!==!0&&ni&&(ni._jsv=ti,ni.prm=f.bd,ni.bnd=ni.bnd||ni.path&&ni.path.indexOf("^")>=0)}return s?(s=!lt,s?d:'"'):o?(o=!at,o?d:'"'):(nt?(k[r]=bt++,f=l[++r]={bd:[]},nt):"")+(wt?r?"":(a=kt.slice(a,bt),e?(e=p=v=!1,"\b"):"\b,")+a+(a=bt+d.length,u&&t.push(f.bd=[]),"\b"):ft?(r&&c(n),u&&t.pop(),e=it,p=tt,a=bt+d.length,tt&&(u=f.bd=t[e]=[]),it+":"):it?it.split("^").join(".").replace(bi,ri)+(ot?(f=l[++r]={bd:[]},y[r]=!0,ot):rt):rt?rt:vt?(y[r]=!1,f=l[--r],vt)+(ot?(f=l[++r],y[r]=!0,ot):""):st?(y[r]||c(n),","):g?"":(s=lt,o=at,'"'))}c(n)}var e,v,p,o,s,u=t&&t[0],f={bd:u},l={0:f},a=0,w=i?i.links:u&&(u.links=u.links||{}),r=0,y={},k={};return(n+(i?" ":"")).replace(ki,d)}function at(n,t,r){var w,f,o,l,g,yt,pt,ti,bt,nt,ot,b,e,st,tt,it,v,ht,y,ut,p,ft,kt,d,dt,gt,ct,h,a,vt,ni,s=0,u="",et={},ii=n.length;for(""+t===t?(y=r?'data-link="'+t.replace(rt," ").slice(1,-1)+'"':t,t=0):(y=t.tmplName||"unnamed",t.allowCode&&(et.allowCode=!0),t.debug&&(et.debug=!0),b=t.bnds,ht=t.tmpls),w=0;w<ii;w++)if(f=n[w],""+f===f)u+='\n+"'+f+'"';else if(o=f[0],o==="*")u+=";\n"+f[1]+"\nret=ret";else{if(l=f[1],ft=!r&&f[2],g=vi(f[3],"params")+"},"+vi(st=f[4]),a=f[5],ni=f[6],kt=f[8]&&f[8].replace(wt,"$1"),(gt=o==="else")?e&&e.push(f[7]):(s=0,b&&(e=f[7])&&(e=[e],s=b.push(1))),(ct=o===":")?l&&(o=l===k?">":l+o):(ft&&(ut=hi(kt,et),ut.tmplName=y+"/"+o,at(ft,ut),ht.push(ut)),gt||(p=o,dt=u,u=""),d=n[w+1],d=d&&d[0]==="else"),vt=a?";\ntry{\nret+=":"\n+",tt="",it="",ct&&(e||ni||l&&l!==k)){if(h="return {"+g+"};",v='c("'+l+'",view,',h=new Function("data,view,j,u"," // "+y+" "+s+" "+o+"\n"+h),h._er=a,tt=v+s+",",it=")",h._tag=o,r)return h;lt(h,e);ot=!0}if(u+=ct?(r?(a?"\ntry{\n":"")+"return ":vt)+(ot?(ot=i,nt=bt=!0,v+(e?(b[s-1]=h,s):"{"+g+"}")+")"):o===">"?(pt=!0,"h("+st[0]+")"):(ti=!0,"((v="+(st[0]||"data")+')!=null?v:"")')):(nt=yt=!0,"\n{view:view,tmpl:"+(ft?ht.length:"0")+","+g+"},"),p&&!d){if(u="["+u.slice(0,-1)+"]",v='t("'+p+'",view,this,',r||e){if(u=new Function("data,view,j,u"," // "+y+" "+s+" "+p+"\nreturn "+u+";"),u._er=a,u._tag=p,e&<(b[s-1]=u,e),r)return u;tt=v+s+",undefined,";it=")"}u=dt+vt+v+(s||u)+")";e=0;p=0}a&&(nt=!0,u+=";\n}catch(e){ret"+(r?"urn ":"+=")+tt+"j._err(e,view,"+a+")"+it+";}"+(r?"":"ret=ret"))}u="// "+y+"\nvar v"+(yt?",t=j._tag":"")+(bt?",c=j._cnvt":"")+(pt?",h=j.converters.html":"")+(r?";\n":',ret=""\n')+(et.debug?"debugger;":"")+u+(r?"\n":";\nreturn ret;");try{u=new Function("data,view,j,u",u)}catch(ri){c("Compiled template code:\n\n"+u+'\n: "'+ri.message+'"')}return t&&(t.fn=u),nt||(u._nvw=!0),u}function a(n,t){return n&&n!==t?t?f(f({},t),n):n:t&&f({},t)}function br(n){return kt[n]||(kt[n]="&#"+n.charCodeAt(0)+";")}function kr(n){var i,t,r=[];if(typeof n===ut)for(i in n)t=n[i],t&&t.toJSON&&!t.toJSON()||y(t)||r.push({key:i,prop:t});return r}function wi(n){return n!=null?ir.test(n)&&(""+n).replace(rr,br)||n:""}if((!t||!t.render)&&!n.jsviews){var r,it,p,yt,pt,w="{",b="{",h="}",v="}",nt="^",bi=/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,ki=/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(!*?[#~]?[\w$.^]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=\s*[.^]|\s*$|[^\(\[])|[)\]])([([]?))|(\s+)/g,rt=/[ \t]*(\r\n|\n|\r)/g,wt=/\\(['"])/g,di=/['"\\]/g,gi=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,nr=/^if\s/,tr=/<(\w+)[>\s]/,ir=/[\x00`><\"'&]/,bt=/^on[A-Z]|^convert(Back)?$/,rr=/[\x00`><"'&]/g,ur=0,fr=0,kt={"&":"&","<":"<",">":">","\x00":"�","'":"'",'"':""","`":"`"},k="html",ut="object",ft="data-jsv-tmpl",dt={},d={template:{compile:oi},tag:{compile:vr},helper:{},converter:{}},u={jsviews:"v1.0.0-beta",settings:function(n){f(s,n);ri(s._dbgMode);s.jsv&&s.jsv()},sub:{View:g,Err:ot,tmplFn:ct,cvt:st,parse:yi,extend:f,syntaxErr:c,onStore:{},_ths:et,_tg:function(){}},map:si,_cnvt:hr,_tag:lr,_err:l};(ot.prototype=new Error).constructor=ot;fi.depends=function(){return[this.get("item"),"index"]};ei.depends="index";g.prototype={get:or,getIndex:ei,getRsc:cr,hlp:sr,_is:"view"};for(it in d)pr(it,d[it]);var e=u.templates,tt=u.converters,pi=u.helpers,vt=u.tags,o=u.sub,s=u.settings;o._tg.prototype={baseApply:yr};t?(r=t,r.fn.render=wr,r.observable&&(f(o,r.views.sub),u.map=r.views.map)):(r=n.jsviews={},r.isArray=Array.isArray||function(n){return r.toString.call(n)==="[object Array]"});r.render=dt;r.views=u;r.templates=e=u.templates;s({debugMode:ri,delimiters:ui,onError:function(n,t,r){return t&&(n=r===i?"{Error: "+(n.message||n)+"}":y(r)?r(n,t):r),n==i?"":n},_dbgMode:!0});vt({"else":function(){},"if":{render:function(n){var t=this;return t.rendering.done||!n&&(arguments.length||!t.tagCtx.index)?"":(t.rendering.done=!0,t.selected=t.tagCtx.index,t.tagCtx.render(t.tagCtx.view,!0))},flow:!0},"for":{render:function(n){var f,t=this,u=t.tagCtx,e="",o=0;return t.rendering.done||((f=!arguments.length)&&(n=u.view.data),n!==i&&(e+=u.render(n,f),o+=r.isArray(n)?n.length:1),(t.rendering.done=o)&&(t.selected=u.index)),e},flow:!0},props:{baseTag:"for",dataMap:si(kr)},include:{flow:!0},"*":{render:ti,flow:!0}});tt({html:wi,attr:wi,url:function(n){return n!=i?encodeURI(""+n):n===null?n:""}});ui()}})(this,this.jQuery);
//# sourceMappingURL=jsrender.min.js.map