PHP Classes

File: test/08-web/js/Contemplate.min.js

Recommend this page to a friend!
  Classes of Nikos M.   Contemplate   test/08-web/js/Contemplate.min.js   Download  
File: test/08-web/js/Contemplate.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Contemplate
Template engine that provides programming controls
Author: By
Last change: v.1.6.0

* local keyword to define literal local vars, some names are reserved
* literal code can communicate to and fro template code
* better variable parsing, any valid expression can be inside variable bracket notation
* update tests
Date: 1 year ago
Size: 51,751 bytes
 

Contents

Class file image Download
/** * Contemplate * Light-weight Object-Oriented Template Engine for PHP, Python, JavaScript * * @version: 1.6.0 * https://github.com/foo123/Contemplate * * @inspired by : Simple JavaScript Templating, John Resig - http://ejohn.org/ - MIT Licensed * http://ejohn.org/blog/javascript-micro-templating/ * **/ !function(n,e,t){"use strict";"undefined"!=typeof Components&&"object"==typeof Components.classes&&"object"==typeof Components.classesByID&&Components.utils&&"function"==typeof Components.utils.import?(n.$deps=n.$deps||{})&&(n.EXPORTED_SYMBOLS=[e])&&(n[e]=n.$deps[e]=t.call(n)):"object"==typeof module&&module.exports?(module.$deps=module.$deps||{})&&(module.exports=module.$deps[e]=t.call(n)):"function"==typeof define&&define.amd&&"function"==typeof require&&"function"==typeof require.specified&&require.specified(e)?define(e,["module"],function(e){return t.moduleUri=e.uri,t.call(n)}):e in n||(n[e]=t.call(n)||1)&&"function"==typeof define&&define.amd&&define(function(){return n[e]})}("undefined"!=typeof self?self:this,"Contemplate",function(){"use strict";function e(){}function i(){return window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")}var v,X,A,z,s,E,j,_,m,f,p,b,n="prototype",t=Object,c=Array,G=t[n].hasOwnProperty,d=t[n].toString,C="undefined"!=typeof Components&&"object"==typeof Components.classes&&"object"==typeof Components.classesByID&&Components.utils&&"function"==typeof Components.utils.import,x="undefined"!=typeof global&&"[object global]"===d.call(global),l=this,r=C?Components.utils:null,a=C?Components.classes:null,u=C?Components.interfaces:null,o=C?r.import:x?require:e,h=x?o("fs"):null,O=C?function(e,n){return o(n,l),l[e]}:x?function(e,n){return o(n)}:e,g=!1,y="<%",T="%>",W="",J="",S="\n",Z=!0,D="' + \"\\n\" + '",V="",Q=0,k=" ",ee=0,w=0,M=0,I=0,F=2,ne=null,L=null,N=null,te=null,le=null,re=-1,R=null,U=null,ie=null,B=0,P=/[\W]+/g,K=/\n\r|\r\n|\n|\r/g,H=/'/g,$=/[\/\\]/,q=/[\/\\]?[^\/\\]+$/,Y=/<\/?[a-zA-Z0-9:_\-]+[^<>]*>/gm,oe=/&+/g,ae=/^[a-zA-Z_]/,ce=/^[0-9]/,ue=/^[a-zA-Z0-9_]/i,se=/^\s/,fe=/^\s+$/,pe=/^(postdent|predent)\((-?\d+)\):/,de=/(\t|\s?)\s*((#ID_(continue|endblock|elsefor|endfor|endif|break|else|fi)#(\s*\(\s*\))?)|(#ID_([^#]+)#\s*(\()))(.*)$/g,he=["Contemplate","self","this","data","__p__","__i__","__ctx"],ge=["set","unset","isset","if","elseif","else","endif","for","elsefor","endfor","extends","block","endblock","include","super","getblock","iif","empty","continue","break","local_set","get","local"],_e={elif:"elseif",fi:"endif"},me={cc:"concat",j:"join",dq:"qq",now:"time",template:"tpl"};function be(){F=2,Q=I=M=w=0,ne=[],L={},N=[[null,-1]],R=null,U=[],A={},(X={})[z="_"]=X[z]||{},A[z]=A[z]||{}}function Ce(){F=2,ee=Q=I=M=w=0,ie=z=A=X=N=L=ne=null}function xe(){return[w,M,I,F,Q,ne,L,N,R,X,A,z,U]}function Oe(e){w=e[0],M=e[1],I=e[2],F=e[3],Q=e[4],ne=e[5],L=e[6],N=e[7],R=e[8],X=e[9],A=e[10],z=e[11],U=e[12]}function ye(e){for(var n,t=e.split("\n"),l=t.length,r=0,i=l-1,o=0;o<l;++o)if((n=t[o]).length&&!fe.test(n)){r=o;break}for(o=l-1;r<=o;--o)if((n=t[o]).length&&!fe.test(n)){i=o;break}return t.slice(r,i+1).join("\n")}function Te(e,n){arguments.length<2&&(n=Q);var t,l,r,i,o="",a=(e=function(e){var n,t,l,r,i,o=e.length;if(o){for(l="",t=0;t<o&&(" "===(r=e.charAt(t))||"\t"===r);++t)l+=r;if(n=l.length)for(i=(e=e.slice(n)).indexOf("\n",0);-1!==i;)l===e.slice(i+1,i+1+n)&&(e=e.slice(0,i+1)+e.slice(i+1+n)),i=e.indexOf("\n",i+1)}return e}(e)).length;if(a&&0<n)for(o=t=new c(n+1).join(k),i=!0,r=0;r<a;++r)"\n"===(l=e.charAt(r))?(o+="\n"+t,i=!0):i?se.test(l)?o+="\t"===l?k:l:(o+=l,i=!1):o+=l;else o=e;return o}function De(){var e=arguments,n=e.length;if(!(n<1)){for(var t,l,r=e[0],i=1;i<n;++i)if(l=e[i])for(t in l)G.call(l,t)&&(r[t]=l[t]);return r}}function ve(e,n){var t,l,r,i,o;if(n)l=Mn(n).split(" "),y=Mn(l[0]),T=Mn(l[1]);else{for(o=e.length,r=i=0,t="";i<o&&-1<r&&!t.length;)t=-1<(r=e.indexOf("\n",i))?Mn(e.slice(i,r+1)):"",i=r+1;t.length&&(l=t.split(" "),y=Mn(l[0]),T=Mn(l[1]),e=e.slice(r+1))}return e}function Ae(e,n){if(!(e=Mn(e)).length)return[""];arguments.length<2&&(n=",");for(var t,l=[],r=[],i="",o=0,a=e.length;o<a;)if(n!==(t=e.charAt(o++))||r.length){if(i+=t,"("===t)r.unshift(")");else if("{"===t)r.unshift("}");else if("["===t)r.unshift("]");else if(")"===t||"}"===t||"]"===t){if(!r.length||r[0]!==t)break;r.shift()}}else l.push(Mn(i)),i="";return i.length&&l.push(Mn(i)),o<a&&l.push(Mn(e.slice(o))),l}function Ee(e,n,t){return null==e?"_loc_"+ ++ee:(null==n&&(n=z),G.call(X[n],A[n][e])||(X[n][A[n][e]]=t?2:1),e)}function je(e,n){return null==n&&(n=z),G.call(X[n],A[n][e])&&X[n][A[n][e]]}function Se(r,i){var o,e,a=j;if(r=Mn(r),ie&&G.call(ie,r)&&(r=ie[r]),'"'!==(e=r.charAt(0))&&"'"!==e||e!==r.charAt(r.length-1)||(r=r.slice(1,-1)),"function"==typeof i){if(G.call(a.partials,r)){for(var n=a.partials[r][1],t=0;t<n.length;++t)-1===U.indexOf(n[t])&&U.push(n[t]);i(null,Te(a.partials[r][0]))}else Be(r,a,function(e,n){e?i(e,null):(n=ve(n),o=xe(),be(),Ne(n,y,T,!1,function(e,n){if(e)i(e,null);else{a.partials[r]=[" "+n+"';"+S,U?U.slice():[]],Oe(o);for(var t=a.partials[r][1],l=0;l<t.length;++l)-1===U.indexOf(t[l])&&U.push(t[l]);i(null,Te(a.partials[r][0]))}}))});return""}G.call(a.partials,r)||(e=ve(Be(r,a)),o=xe(),be(),a.partials[r]=[" "+Ne(e,y,T,!1)+"';"+S,U?U.slice():[]],Oe(o));for(n=a.partials[r][1],t=0;t<n.length;++t)-1===U.indexOf(n[t])&&U.push(n[t]);return Te(a.partials[r][0])}function ke(t,l){de.lastIndex=0;var r,i=de.exec(t);i?we(i,function(e,n){e?l(e,null):(r=t.slice(0,i.index)+n,ke(t.slice(i.index+i[0].length),function(e,n){e?l(e,null):l(null,r+n)}))}):l(null,t)}function we(e,l){l="function"==typeof l?l:null;e[0];var n,t,r=e[1],i=(e[2],e[3],e[4]),o=(e[5],e[6],e[7]),a=e[8],e=e[9],c=r||"",r=i||o||"",u=e||"",i=a||!1,s="",f="",p=0,o=function(e,n,t,l,r,i,o,a,c,u){return we([e,n,t,l,r,i,o,a,c,u])};if(i&&i.length){for(p=1,n=u.length,t=0;t<n&&0<p;)"("===(y=u.charAt(t++))?++p:")"===y&&--p,0<p&&(s+=y);u=u.slice(s.length+1)}if(s=Mn(s),G.call(_e,r)&&(r=_e[r]),-1<(e=ge.indexOf(r))){switch(e){case 22:if(O=Mn(s),a=A[z][O],-1!==he.indexOf(a)){if(C=new v.Exception('Contemplate Parse: Use of reserved name as local variable name "'+a+'"'),l)return void l(C,null);throw C}Ee(O,null,!0),f="';"+S+Te("var "+O+";")+S;break;case 0:case 20:O=Mn((s=Ae(s=s.replace(de,o),",")).shift()),x=Mn(s.join(",")),20!==e||je(O)||(Ee(O),O="var "+O),f="';"+S+Te(O+" = ("+x+");")+S;break;case 21:s=s.replace(de,o),f=c+"Contemplate.get("+s+")";break;case 1:s=s.replace(de,o),f=(O=s)&&O.length?(O=Mn(O),"';"+S+Te('if ("undefined" !== typeof('+O+")) delete "+O+";")+S):"';"+S;break;case 2:s=s.replace(de,o),f='("undefined" !== typeof('+(O=s)+") && null !== "+O+")";break;case 3:s=s.replace(de,o),f="';"+Te(["","if ("+s+")","{",""].join(S)),++M,++Q;break;case 4:s=s.replace(de,o),--Q,f="';"+Te(["","}","else if ("+s+")","{",""].join(S)),++Q;break;case 5:--Q,f="';"+Te(["","}","else","{",""].join(S)),++Q;break;case 6:--M,--Q,f="';"+Te(["","}",""].join(S));break;case 7:var d,h,g,_,m,b,C=s=s.replace(de,o),x=C.indexOf(" as "),O=C.indexOf(" in "),x=-1<O?(d=Mn((C=[C.slice(0,O),C.slice(O+4)])[1]),h=Ee(),C[0].split(",")):(d=Mn((C=[C.slice(0,x),C.slice(x+4)])[0]),h=Ee(),C[1].split("=>"));2<=x.length?(_=Mn(x[0]),g=Mn(x[1]),C=Ee(),m=Ee(),b=Ee(),f="';",je(_)||(Ee(_),f+=S+Te("var "+_+";")),je(g)||(Ee(g),f+=S+Te("var "+g+";")),f+=Te(["","var "+h+" = "+d+", "+C+" = "+h+" ? Object.keys("+h+") : null,"," "+m+", "+b+" = "+h+" ? "+C+".length : 0;","if ("+b+")","{"," for ("+m+"=0; "+m+"<"+b+"; ++"+m+")"," {"," "+_+" = "+C+"["+m+"]; "+g+" = "+h+"["+_+"];"," ",""].join(S)),Q+=F=2):(g=Mn(x[0]),_=Ee(),x=Ee(),m=Ee(),T=Ee(),b=Ee(),f="';",je(g)||(Ee(g),f+=S+Te("var "+g+";")),f+=Te(["","var "+h+" = "+d+", "+x+" = !!"+h+".forEach,"," "+_+" = "+h+" ? ("+x+" ? "+h+" : Object.keys("+h+")) : null,"," "+m+", "+T+", "+b+" = "+_+" ? "+_+".length : 0;","if ("+b+")","{"," for ("+m+"=0; "+m+"<"+b+"; ++"+m+")"," {"," "+T+" = "+_+"["+m+"];"," "+g+" = "+x+" ? "+T+" : "+h+"["+T+"];"," ",""].join(S)),F=1,Q+=2),++w,++I;break;case 8:--I,Q+=-2,f="';"+Te([""," }","}","else","{ ",""].join(S)),++Q;break;case 9:f=I===w?(--w,--I,Q+=-2,"';"+Te([""," }","}",""].join(S))):(--w,--Q,"';"+Te(["","}",""].join(S)));break;case 10:var y,T=Mn(s);ie&&G.call(ie,T)&&(T=ie[T]),'"'!==(y=T.charAt(0))&&"'"!==y||y!==T.charAt(T.length-1)||(T=T.slice(1,-1)),R=T,f="';"+S;break;case 11:f=function(e){var n=!(1<(e=e.split(",")).length&&"false"===Mn(e[1]));e=Mn(e[0]),ie&&G.call(ie,e)&&(e=ie[e]);var t=e.charAt(0);return'"'!==t&&"'"!==t||t!==e.charAt(e.length-1)||(e=e.slice(1,-1)),ne.push([e,-1,-1,0,N[0][1],n]),L[e]=L[e]?L[e]+1:1,re=ne.length,N.unshift([e,re-1]),le=null,X[z=te=e]=X[z]||{},A[z]=A[z]||{},"' + #BLOCK_"+e+"#"}(s);break;case 12:f=function(){if(1<N.length){var e=N.shift();return le=e[0],re=e[1]+1,te=null,z=N.length?N[0][0]:"_","#/BLOCK_"+e[0]+"#"}return z="_",""}();break;case 13:f=l?"":Se(s);break;case 14:s=s.replace(de,o),f=c+"self.sprblock("+s+", data)";break;case 15:s=s.replace(de,o),f=c+"__i__.block("+s+", data)";break;case 16:s=Ae(s.replace(de,o),","),f=c+"(("+s[0]+") ? ("+s[1]+") : ("+s[2]+"))";break;case 17:s=s.replace(de,o),f=c+'(("undefined" === typeof('+s+")) || (null === "+s+") || Contemplate.empty("+s+"))";break;case 18:case 19:f="';"+S+Te(18===e?"continue;":"break;")+S}return l?void(13===e?Se(s,function(e,t){e?l(e,null):ke(u,function(e,n){e?l(e,null):l(null,t+n)})}):ke(u,function(e,n){e?l(e,null):l(null,f+n)})):f+u.replace(de,o)}if(G.call(j.plugins,r)||G.call(E.plugins,r)){var D=j.plugins[r]||E.plugins[r],s=s.replace(de,o);return f=D instanceof v.InlineTemplate?D.render([s].concat(Ae(s,","))):'Contemplate.plg_("'+r+'"'+(s.length?","+s:"")+")",l?void ke(u,function(e,n){e?l(e,null):l(null,c+f+n)}):c+f+u.replace(de,o)}switch(G.call(me,r)&&(r=me[r]),s=s.replace(de,o),r){case"s":f="String("+s+")";break;case"n":f="parseInt("+s+")";break;case"f":f="parseFloat("+s+")";break;case"q":f='"\'"+('+s+')+"\'"';break;case"qq":f="'\"'+("+s+")+'\"'";break;case"concat":f="String("+Ae(s,",").join(")+String(")+")";break;case"is_array":s=Ae(s,","),f=1<s.length?"(("+s[1]+") ? '[object Array]' === Object.prototype.toString.call("+s[0]+") : '[object Array]' === Object.prototype.toString.call("+s[0]+") || '[object Object]' === Object.prototype.toString.call("+s[0]+"))":"('[object Array]'===Object.prototype.toString.call("+s[0]+")||'[object Object]'===Object.prototype.toString.call("+s[0]+"))";break;case"in_array":s=Ae(s,","),f="(-1<("+s[1]+").indexOf("+s[0]+"))";break;case"tpl":"#STR_"===(D=Ae(s,",")[0]).slice(0,5)&&G.call(ie,D)&&(D=ie[D].slice(1,-1),-1===U.indexOf(D)&&U.push(D));default:f=G.call(v,r)&&"function"==typeof v[r]?"Contemplate."+r+"("+s+")":r+(i?"("+s+")":"")}if(!l)return c+f+u.replace(de,o);ke(u,function(e,n){e?l(e,null):l(null,c+f+n)})}function Me(e){for(var n,t,l,r,i,o,a,c,u=[],s=ne.length;s--;)n=(t=ne[s])[0],r=t[1],i=t[2],o=t[3],a=t[4],c=t[5],l=("#BLOCK_"+n+"#").length,c=(t=c?"__i__.block('"+n+"', data);":"'';").length,-1<a&&(ne[a][3]+=c-(i-r+1)),i+=o,1===L[n]&&u.push([n,f.render({BLOCKCODE:e.slice(r+l,i-l-1)+"';"})]),e=e.slice(0,r)+t+e.slice(i+1),1<=L[n]&&--L[n];return[e,u]}function Ie(e,n,t){if(ae.test(e[n])){for(var l,r,i,o,a,c,u,s,f,p,d,h,g,_,m,b,C,x={},O=[],y=0,T=!1,D=e.charAt(n++);n<t&&ue.test(p=e.charAt(n));)D+=p,++n;for(o="data."+(i=D),a="",l="#VAR_"+ ++ee+"#",c=i.length,A[z][l]=i,y=0;n<t&&se.test(e.charAt(n));)++y,++n;for(;n<t&&("."===e.charAt(n)||"["===e.charAt(n)||"->"===e.substring(n,n+2));){for("-"===(f=e.charAt(n++))&&(f+=e.charAt(n++));n<t&&se.test(e.charAt(n));)++y,++n;if("."===f){for(r="";n<t&&ue.test(e.charAt(n));)r+=e.charAt(n++);if(!(u=r.length))break;a+="."+r,c+=y+1+u,y=0}else if("->"===f){for(r="";n<t&&ue.test(e.charAt(n));)r+=e.charAt(n++);if(!(u=r.length))break;a+="."+r,c+=y+2+u,y=0}else if("["===f)for(s="";n<t;)if(p=e.charAt(n),se.test(p))++y,++n;else if('"'===p||"'"===p){for(d=h=p,g=!1,_=n+1;_<t&&(d+=p=e.charAt(_++),h!==p||g);)g=!g&&"\\"===p;r=d,n+=u=(x[b="#STR_"+ ++ee+"#"]=r).length,c+=y+u,T=!(y=0),s+=b}else if(ce.test(p)){for(r=e.charAt(n++);n<t&&ce.test(e.charAt(n));)r+=e.charAt(n++);c+=y+(u=r.length),y=0,s+=r}else if("$"===p)(C=Ie(C=e.slice(n+1),0,C.length))?(n+=(u=(r=C[C.length-1])[4])+1,c+=y+1+u,y=0,O=O.concat(C),T=T||r[5],s+=r[0]):(s+=p,++c,++n);else if(ae.test(p)){for(c+=y+1,0<y&&(s+=" ",y=0),C=2<++n&&"-"===e.charAt(n-3)&&">"===e.charAt(n-2),m=p;n<t&&ue.test(p=e.charAt(n));)++n,++c,m+=p;C||"as"===m||"in"===m||"null"===m||"false"===m||"true"===m||(m="#ID_"+m+"#"),s+=m}else{if("]"===p){a+=f+s.replace(de,function(e,n,t,l,r,i,o,a,c,u){return we([e,n,t,l,r,i,o,a,c,u])})+p,c+=y+2,y=0,++n;break}s+=p,++c,++n}for(;n<t&&se.test(e.charAt(n));)++y,++n}return O.push([l,i,o,a,c,T,x]),O}return null}C&&(o("resource://gre/modules/NetUtil.jsm"),o("resource://gre/modules/FileUtils.jsm"));var Fe=/#STR_\d+#/g;function Le(e,n,t,l,r){function i(){if(e&&e.length){if(-1===(o=e.indexOf(B)))return u=e,Z&&(u=u.split("\\").join("\\\\")),$+=u.split("'").join("\\'").split(/\n/).join(V),void Y();if(-1===(a=e.indexOf(K,o+P))&&(a=e.length),0<o&&(u=e.slice(0,o),Z&&(u=u.split("\\").join("\\\\")),$+=u.split("'").join("\\'").split(/\n/).join(V)),L="php:"===e.slice(o+P,o+P+4),R="js:"===e.slice(o+P,o+P+3),N="py:"===e.slice(o+P,o+P+3),L||R||N)return R&&("="===e.slice(o+P+3,o+P+4)?$+="';"+Te("\n/* js code start */")+Te("\n__p__ += String("+Mn(e.slice(o+P+4,a))+");")+Te("\n/* js code end */\n__p__ += '"):(L=F=0,N="none",(R=e.slice(o+P+3).match(pe))&&(N=R[1],F=parseInt(R[2]),L=R[0].length),L=ye(e.slice(o+P+3+L,a)),"predent"===N&&(Q=Math.max(0,Q+F)),$+="';"+Te("\n/* js code start */"),Mn(L).length&&($+="\n"+Te(L)),"postdent"===N&&(Q=Math.max(0,Q+F)),$+=Te("\n/* js code end */\n__p__ += '"))),e=e.slice(a+H),void i();for(u=e.slice(o+P,a),e=e.slice(a+H),b=u.length,d=[],w=g=h=!(p={}),S=C=0,O=x="";C<b;)if(x=u.charAt(C++),-1<(I="$'\" \n\r\t\v\0%".indexOf(x)))if(0===I)if(0<S&&(O+=" ",S=0),y=Ie(u,C,b)){for(T=0,c=y.length;T<c;++T)D=y[T],m=D[0],D[5]&&(p=De(p,D[6]));O+=m,C+=D[4],d=d.concat(y),h=!0,g=g||D[5]}else O+="$";else if(I<3){for(0<S&&(O+=" ",S=0),A=v=x,E=!1,j=C;j<b&&(A+=x=u.charAt(j++),v!==x||E);)E=!E&&"\\"===x;y=A,p[m="#STR_"+ ++ee+"#"]=y,O+=m,C+=y.length-1,g=!0}else I<9?++S:(0<S&&(O+=" ",S=0),O+=v=x);else if(ae.test(x)){for(0<S&&(O+=" ",S=0),I=2<C&&"-"===u.charAt(C-3)&&">"===u.charAt(C-2),y=x;C<b&&ue.test(x=u.charAt(C));)++C,y+=x;I||"as"===y||"in"===y||"null"===y||"false"===y||"true"===y||(y="#ID_"+y+"#"),O+=y}else 0<S&&(O+=" ",S=0),O+=x;O=O.split("->").join("."),s="\t"+O+"\v",le=te=null,re=-1,ie=p,q()}else Y()}var o,a,c,u,s,f,p,d,h,g,_,m,b,C,x,O,y,T,D,v,A,E,j,S,k,w,M,I,F,L,N,R,U=Ye.multisplit_re,B=n,P=B.length,K=t,H=K.length,$="",q=function(){ke(s,function(e,n){e?r(e,null):(s=n,function(){if(te?(te="#BLOCK_"+te+"#",w=!0):le&&(le="#/BLOCK_"+le+"#",w=!0),M=w,9===s.charCodeAt(0)&&11===s.charCodeAt(s.length-1)&&(s="' + ("+Mn(s.slice(1,-1))+") + '"),h)for(T=d.length-1;0<=T;--T)m=d[T][0],_=d[T][1],s=s.split(m+"__RAW__").join(_).split(m).join((G.call(X[z],_)?(2===X[z][_]?"":"_loc_")+_:d[T][2])+d[T][3]);if(g)for(f=U(s,Fe),s="",T=0,c=f.length;T<c;++T)f[T][0]?(M&&(te?-1!==(k=f[T][1].indexOf(te))&&(ne[re-1][1]=k+$.length+s.length,M=!1):-1!==(k=f[T][1].indexOf(le))&&(ne[re-1][2]=k+$.length+s.length+le.length,M=!1)),s+=f[T][1]):s+=p[f[T][1]];else w&&(te?ne[re-1][1]=$.length+s.indexOf(te):ne[re-1][2]=$.length+s.indexOf(le)+le.length);11===s.charCodeAt(s.length-1)&&(s=s.slice(0,-1)+Te(J)),9===s.charCodeAt(0)&&(s=W+s.slice(1),w&&(k=W.length-1,te?ne[re-1][1]+=k:ne[re-1][2]+=k)),$+=s,i()}())})},Y=function(){r(null,!1!==l?0<ne.length?Me($):[$,[]]:$)};i()}function Ne(e,n,t,l,r){if("function"!=typeof r){for(var i,o,a,c,u,s,f,p,d,h,g,_,m,b,C,x,O,y,T,D,v,A,E,j,S,k,w,M,I,F,L,N=Ye.multisplit_re,R=n,U=R.length,B=t,P=B.length,K="";e&&e.length;){if(-1===(i=e.indexOf(R))){a=e,Z&&(a=a.split("\\").join("\\\\")),K+=a.split("'").join("\\'").split(/\n/).join(V);break}if(-1===(S=e.indexOf(B,i+U))&&(S=e.length),0<i&&(a=e.slice(0,i),Z&&(a=a.split("\\").join("\\\\")),K+=a.split("'").join("\\'").split(/\n/).join(V)),I="php:"===e.slice(i+U,i+U+4),L="js:"===e.slice(i+U,i+U+3),F="py:"===e.slice(i+U,i+U+3),I||L||F)L&&("="===e.slice(i+U+3,i+U+4)?K+="';"+Te("\n/* js code start */")+Te("\n__p__ += String("+Mn(e.slice(i+U+4,S))+");")+Te("\n/* js code end */\n__p__ += '"):(I=M=0,F="none",(L=e.slice(i+U+3).match(pe))&&(F=L[1],M=parseInt(L[2]),I=L[0].length),I=ye(e.slice(i+U+3+I,S)),"predent"===F&&(Q=Math.max(0,Q+M)),K+="';"+Te("\n/* js code start */"),Mn(I).length&&(K+="\n"+Te(I)),"postdent"===F&&(Q=Math.max(0,Q+M)),K+=Te("\n/* js code end */\n__p__ += '"))),e=e.slice(S+P);else{for(a=e.slice(i+U,S),e=e.slice(S+P),_=a.length,f=[],S=d=p=!(s={}),E=m=0,C=b="";m<_;)if(b=a.charAt(m++),-1<(w="$'\" \n\r\t\v\0%".indexOf(b)))if(0===w)if(0<E&&(C+=" ",E=0),x=Ie(a,m,_)){for(O=0,o=x.length;O<o;++O)g=(y=x[O])[0],y[5]&&(s=De(s,y[6]));C+=g,m+=y[4],f=f.concat(x),p=!0,d=d||y[5]}else C+="$";else if(w<3){for(0<E&&(C+=" ",E=0),D=T=b,v=!1,A=m;A<_&&(D+=b=a.charAt(A++),T!==b||v);)v=!v&&"\\"===b;x=D,C+=g="#STR_"+ ++ee+"#",m+=(s[g]=x).length-1,d=!0}else w<9?++E:(0<E&&(C+=" ",E=0),C+=T=b);else if(ae.test(b)){for(0<E&&(C+=" ",E=0),w=2<m&&"-"===a.charAt(m-3)&&">"===a.charAt(m-2),x=b;m<_&&ue.test(b=a.charAt(m));)++m,x+=b;w||"as"===x||"in"===x||"null"===x||"false"===x||"true"===x||(x="#ID_"+x+"#"),C+=x}else 0<E&&(C+=" ",E=0),C+=b;if(C=C.split("->").join("."),le=te=null,re=-1,ie=s,c=(c="\t"+C+"\v").replace(de,function(e,n,t,l,r,i,o,a,c,u){return we([e,n,t,l,r,i,o,a,c,u])}),te?(te="#BLOCK_"+te+"#",S=!0):le&&(le="#/BLOCK_"+le+"#",S=!0),k=S,9===c.charCodeAt(0)&&11===c.charCodeAt(c.length-1)&&(c="' + ("+Mn(c.slice(1,-1))+") + '"),p)for(O=f.length-1;0<=O;--O)g=f[O][0],h=f[O][1],c=c.split(g+"__RAW__").join(h).split(g).join((G.call(X[z],h)?(2===X[z][h]?"":"_loc_")+h:f[O][2])+f[O][3]);if(d)for(u=N(c,Fe),c="",O=0,o=u.length;O<o;++O)u[O][0]?(k&&(te?-1!==(j=u[O][1].indexOf(te))&&(ne[re-1][1]=j+K.length+c.length,k=!1):-1!==(j=u[O][1].indexOf(le))&&(ne[re-1][2]=j+K.length+c.length+le.length,k=!1)),c+=u[O][1]):c+=s[u[O][1]];else S&&(te?ne[re-1][1]=K.length+c.indexOf(te):ne[re-1][2]=K.length+c.indexOf(le)+le.length);11===c.charCodeAt(c.length-1)&&(c=c.slice(0,-1)+Te(J)),9===c.charCodeAt(0)&&(c=W+c.slice(1),S&&(j=W.length-1,te?ne[re-1][1]+=j:ne[re-1][2]+=j)),K+=c}}return!1!==l?0<ne.length?Me(K):[K,[]]:K}Le(e,n,t,l,r)}function Re(e,n,t){var l,r;return!x&&!C||-1===e.indexOf("/")&&-1===e.indexOf("\\")?(l=e,r=""):(l=In(e),(r=Mn(Fn(e),"/\\")).length&&(r+="/")),t+r+l.replace(P,"_")+"_tpl__"+n.replace(P,"_")+".js"}function Ue(e,n){e=!x&&!C||-1===e.indexOf("/")&&-1===e.indexOf("\\")?e:In(e);return"Contemplate_"+e.replace(P,"_")+"__"+n.replace(P,"_")}function Be(t,l,r){r="function"==typeof r?r:null;function i(){var e=l.templates[t]||E.templates[t]||null;return e?e[1]?r?(r(null,e[0]),""):e[0]:x||C?r?(xn(e[0],l.encoding,function(e,n){e?r(e,""):r(null,n)}),""):Cn(e[0],l.encoding):"#"===e[0].charAt(0)?r?(r(null,window.document.getElementById(e[0].slice(1)).innerHTML||""),""):window.document.getElementById(e[0].slice(1)).innerHTML||"":r?(xn(e[0],l.encoding,function(e,n){e?r(e,null):r(null,n)}),""):Cn(e[0],l.encoding):(r&&r(null,""),"")}if(v.hasTpl(t,l.id))return i();if(!r){var e=v.findTpl(t,l.id);if(!e)return"";var n={};return n[t]=e,v.add(n,l.id),i()}v.findTpl(t,l.id,function(e,n){!e&&n?((e={})[t]=n,v.add(e,l.id),i()):r(null,"")})}function Pe(e,n,t,l){var r,i,o,a,c,u={};if(l="function"==typeof l?l:null)return Be(e,n,function(e,n){e?l(e,null):(n=ve(n,t),be(),Ne(n,y,T,!0,function(e,n){if(e)l(e,null);else{for(Ce(),c=n[0],n=n[1],o=n.length,a=p.render({FCODE:R?"__p__ = '';":"__p__ = '"+c+"';"}),i=0;i<o;++i)u[n[i][0]]=Tn("Contemplate,data,self,__i__",n[i][1]);l(null,[Tn("Contemplate",a),u])}}))}),null;for(n=ve(n=Be(e,n),t),be(),r=Ne(n,y,T,!0),Ce(),c=r[0],r=r[1],o=r.length,a=p.render({FCODE:R?"__p__ = '';":"__p__ = '"+c+"';"}),i=0;i<o;++i)u[r[i][0]]=Tn("Contemplate,data,self,__i__",r[i][1]);return[Tn("Contemplate",a),u]}function Ke(t,l,r,i,o,a){var c,u,s,f,p,d,e,h,g=S;if(!(a="function"==typeof a?a:null)){for(n=ve(Be(t,l),o),be(),e=Ne(n,y,T,!0),Ce(),h=e[0],e=e[1],p=e.length,d=[],f=0;f<p;++f)d.push(g+m.render({BLOCKNAME:e[f][0],BLOCKMETHODNAME:e[f][0],BLOCKMETHODCODE:Te(e[f][1],1)}));d=d.length?g+"self._blocks = {"+g+d.join(","+g)+g+"};"+g:"",s=b.render({RCODE:R?"__p__ = '';":"__p__ += '"+h+"';"}),u=R?"self._extendsTpl = '"+R+"';":"",u+=g+"self._usesTpl = ["+(U.length?"'"+U.join("','")+"'":"")+"];",c=l.prefix?l.prefix:"";var n=_.render({CLASSNAME:i,TPLID:t,PREFIXCODE:c,EXTENDCODE:Te(u,1),BLOCKS:Te(d,1),RENDERCODE:Te(s,1)});return On(r,n,l.encoding)}Be(t,l,function(e,n){e?a(e,null):(n=ve(n,o),be(),Ne(n,y,T,!0,function(e,n){if(e)a(e,null);else{for(Ce(),h=n[0],n=n[1],p=n.length,d=[],f=0;f<p;++f)d.push(g+m.render({BLOCKNAME:n[f][0],BLOCKMETHODNAME:n[f][0],BLOCKMETHODCODE:Te(n[f][1],1)}));d=d.length?g+"self._blocks = {"+g+d.join(","+g)+g+"};"+g:"",s=b.render({RCODE:R?"__p__ = '';":"__p__ += '"+h+"';"}),u=R?"self._extendsTpl = '"+R+"';":"",u+=g+"self._usesTpl = ["+(U.length?"'"+U.join("','")+"'":"")+"];",c=l.prefix?l.prefix:"";e=_.render({CLASSNAME:i,TPLID:t,PREFIXCODE:c,EXTENDCODE:Te(u,1),BLOCKS:Te(d,1),RENDERCODE:Te(s,1)});yn(r,e,l.encoding,function(e,n){a(e,n)})}}))})}function He(t,l,i,r){var o,a,c,e,u,s,n,f,p,d;if(r="function"==typeof r?r:null,!(o=l.templates[t]||E.templates[t]||null))return r&&r(null,null),null;if(d=(i=i||{context:l.id,autoUpdate:!1}).parsed||null,G.call(i,"parsed")&&delete i.parsed,!r)return o[1]?(_=new v.Template(t).ctx(l),d?_.setRenderFunction(Tn("Contemplate",d)):(e=Pe(t,l,i.separators),_.setRenderFunction(e[0]).setBlocks(e[1]).usesTpl(U)),(c=R||_._extendsTpl)&&_.extend(v.tpl(c,null,i)),_):(x||C||(l.cacheMode=v.CACHE_TO_DISK_NONE),!0!==i.autoUpdate&&v.CACHE_TO_DISK_NOUPDATE===l.cacheMode?(u=Re(t,l.id,l.cacheDir),s=Ue(t,l.id),dn(u)||((p=-1!==t.indexOf("/")||-1!==t.indexOf("\\")?(In(t),Mn(Fn(t),"/\\")):"").length&&$e(p,l.cacheDir,parseInt("0755",8)),Ke(t,l,u,s,i.separators)),dn(u)?(a=O(s,u)(v),(_=new a(t).ctx(l))._extendsTpl&&_.extend(v.tpl(_._extendsTpl,null,i)),_):null):!0===i.autoUpdate||v.CACHE_TO_DISK_AUTOUPDATE===l.cacheMode?(u=Re(t,l.id,l.cacheDir),s=Ue(t,l.id),dn(u)?(n=mn(u),f=mn(o[0]),n.mtime.getTime()<=f.mtime.getTime()&&Ke(t,l,u,s,i.separators)):((p=-1!==t.indexOf("/")||-1!==t.indexOf("\\")?(In(t),Mn(Fn(t),"/\\")):"").length&&$e(p,l.cacheDir,parseInt("0755",8)),Ke(t,l,u,s,i.separators)),dn(u)?(a=O(s,u)(v),(_=new a(t).ctx(l))._extendsTpl&&_.extend(v.tpl(_._extendsTpl,null,i)),_):null):(e=Pe(t,l,i.separators),_=new v.Template(t).ctx(l).setRenderFunction(e[0]).setBlocks(e[1]).usesTpl(U),(c=R||_._extendsTpl)&&_.extend(v.tpl(c,null,i)),_));function h(e,n){var l,r=e._usesTpl&&e._usesTpl.length?e._usesTpl:null;r?(l=0,function t(){l>=r.length?n(null,e):v.tpl(r[l],null,i,function(e,n){++l,t()})}()):n(null,e)}if(o[1]){var g=function(t,l){(c=R||t._extendsTpl)?v.tpl(c,null,i,function(e,n){e?l(e,null):(t.extend(n),l(null,t))}):l(null,t)},_=new v.Template(t).ctx(l);d?(_.setRenderFunction(Tn("Contemplate",d)),g(_,function(e,n){e?r(e,null):h(n,r)})):Pe(t,l,i.separators,function(e,n){e?r(e,null):(_.setRenderFunction(n[0]).setBlocks(n[1]).usesTpl(U),g(_,function(e,n){e?r(e,null):h(n,r)}))})}else{x||C||(l.cacheMode=v.CACHE_TO_DISK_NONE);var m=function(e,n){!1===e?!1===n?(a=O(s,u)(v),_=new a(t).ctx(l),(c=_._extendsTpl)?v.tpl(c,null,i,function(e,n){e?r(e,null):(_.extend(n),h(_,r))}):h(_,r)):hn(u,function(e,n){!e&&n?(a=O(s,u)(v),_=new a(t).ctx(l),(c=_._extendsTpl)?v.tpl(c,null,i,function(e,n){e?r(e,null):(_.extend(n),h(_,r))}):h(_,r)):r(e||new Error('Could not create or read file "'+u+'"!'),null)}):Ke(t,l,u,s,i.separators,function(e,n){e?r(e,null):hn(u,function(e,n){!e&&n?(a=O(s,u)(v),_=new a(t).ctx(l),(c=_._extendsTpl)?v.tpl(c,null,i,function(e,n){e?r(e,null):(_.extend(n),h(_,r))}):h(_,r)):r(e||new Error('Could not create or read file "'+u+'"!'),null)})})};if(!0!==i.autoUpdate&&v.CACHE_TO_DISK_NOUPDATE===l.cacheMode)u=Re(t,l.id,l.cacheDir),s=Ue(t,l.id),hn(u,function(e,n){n?m(!1,!1):(p=-1!==t.indexOf("/")||-1!==t.indexOf("\\")?(In(t),Mn(Fn(t),"/\\")):"").length?$e(p,l.cacheDir,parseInt("0755",8),function(e,n){e?r(e,null):m()}):m()});else{if(!0===i.autoUpdate||v.CACHE_TO_DISK_AUTOUPDATE===l.cacheMode)return u=Re(t,l.id,l.cacheDir),s=Ue(t,l.id),hn(u,function(e,n){n?bn(u,function(e,t){e?r(e,null):bn(o[0],function(e,n){e?r(e,null):t.mtime.getTime()<=n.mtime.getTime()?m():m(!1,!1)})}):(p=-1!==t.indexOf("/")||-1!==t.indexOf("\\")?(In(t),Mn(Fn(t),"/\\")):"").length?$e(p,l.cacheDir,parseInt("0755",8),function(e,n){e?r(e,null):m()}):m()}),null;Pe(t,l,i.separators,function(e,n){e?r(e,null):(_=new v.Template(t).ctx(l).setRenderFunction(n[0]).setBlocks(n[1]).usesTpl(U),(c=R)?v.tpl(c,null,i,function(e,n){e?r(e,null):(_.extend(n),h(_,r))}):h(_,r))})}}}function $e(e,n,l,r){if((e=Mn(e)).length){l=l||parseInt("0755",8),n=n||"";var t,i=(t=$,e.split(t).map(function(e){return Mn(e)}).filter(function(e){return 0<e.length})),o=wn(n,"/\\"),a=!0;if("function"==typeof r){var c=0,u=i.length;o+="/"+i[c],function t(){u<=c?r(null,!0):!1===a?_n(o,l,function(e,n){e?r(e,null):c+1<u?(o+="/"+i[++c],t()):r(null,!0)}):hn(o,function(e,n){e?r(e,null):(n||(a=!1),_n(o,l,function(e,n){e?r(e,null):c+1<u?(o+="/"+i[++c],t()):r(null,!0)}))})}()}else for(c=0,u=i.length;c<u;++c)o+="/"+i[c],dn(o)||gn(o,l)}}function qe(e){this.name="ContemplateException",this.message=e}function Ye(e,n,t){var l=this;if(!(l instanceof Ye))return new Ye(e,n,t);l.id=null,l._renderer=null,l._parsed=!1,l._args=[e,n,t],l.tpl=null}function Xe(e){var n=this;if(!(n instanceof Xe))return new Xe(e);n._renderer=null,n._blocks=null,n._extends=null,n._extendsTpl=null,n._usesTpl=null,n._ctx=null,n._autonomus=!1,n.id=null,e&&(n.id=e)}function ze(e){var n=this;n.id=e,n.cacheDir="./",n.cacheMode=0,n.cache={},n.templateDirs=[],n.templateFinder=null,n.templates={},n.partials={},n.plugins={},n.prefix="",n.encoding=C?"UTF-8":"utf8"}qe[n]=Object.create(Error[n]),Ye.multisplit=function(e,n,t){var l,r,i,o,a,c,u,s,f,p;for(l in t=!!t,c=[[1,e]],n)if(G.call(n,l)){for(s=[],r=t?n[l]:l,i=[0,n[l]],o=0,f=c.length;o<f;++o)if(1===c[o][0]){if(p=(u=c[o][1].split(r)).length,s.push([1,u[0]]),1<p)for(a=0;a<p-1;++a)s.push(i),s.push([1,u[a+1]])}else s.push(c[o]);c=s}return c},Ye.multisplit_re=function(e,n){n=n.global?n:new RegExp(n.source,n.ignoreCase?"gi":"g");for(var t,l=[],r=0;t=n.exec(e);)l.push([1,e.slice(r,n.lastIndex-t[0].length)]),l.push([0,t[1]?t[1]:t[0]]),r=n.lastIndex;return l.push([1,e.slice(r)]),l},Ye.compile=function(e){for(var n,t,l=e.length,r='"use strict";\nreturn (',i=0;i<l;++i)n=e[i][0],t=e[i][1],r+=n?"'"+t.replace(H,"\\'").replace(K,"' + \"\\n\" + '")+"'":" + String(args['"+t+"']) + ";return Tn("args",r+=");")},Ye[n]={constructor:Ye,id:null,tpl:null,_renderer:null,_parsed:!1,_args:null,dispose:function(){var e=this;return e.id=null,e.tpl=null,e._renderer=null,e._parsed=null,e._args=null,e},render:function(e){var n,t,l=this;if(e=e||[],l._parsed||(r=l._args[0],n=l._args[1],t=l._args[2],l.tpl=n instanceof RegExp?Ye.multisplit_re(r||"",n):Ye.multisplit(r||"",n||{}),!0===t&&(l._renderer=Ye.compile(l.tpl),l.render=l._renderer),l._args=null,l._parsed=!0),vn(l._renderer))return l._renderer(e);for(var r,i,o,a=(r=l.tpl).length,c="",u=0;u<a;++u)i=r[u][0],o=r[u][1],c+=i?o:e[o];return c}},Xe.spr=function(e,n){var t=!1;return!n&&(n=this)&&(this._autonomus||(t=v._set_ctx(this._ctx))),n=this._extends.render(e,n),t&&v._set_ctx(t),n},Xe.fixr=function(e){return e.render=e._extends instanceof Xe?Xe.spr:vn(e._renderer)?e._renderer:e.constructor[n].render,e},(Xe[n]={constructor:Xe,id:null,_renderer:null,_blocks:null,_extends:null,_extendsTpl:null,_usesTpl:null,_ctx:null,_autonomus:!1,dispose:function(){var e=this;return e._renderer=null,e._blocks=null,e._extends=null,e._extendsTpl=null,e._usesTpl=null,e._ctx=null,e._autonomus=null,e.id=null,e},setId:function(e){return e&&(this.id=e),this},ctx:function(e){return this._ctx=e,this},autonomus:function(e){return this._autonomus=!arguments.length||!!e,this},extend:function(e){return this._extends=e&&e.substr?v.tpl(e):e instanceof Xe?e:null,Xe.fixr(this),this},usesTpl:function(e){return this._usesTpl=[].concat(e),this},setRenderFunction:function(e){return this._renderer=vn(e)?e(v):null,Xe.fixr(this),this},setBlocks:function(e){return"object"==typeof e&&(this._blocks=De(this._blocks||{},e)),this},sprblock:function(e,n){return this._extends?this._extends.block(e,n,this._extends):""},block:function(e,n,t){var l=this,r="",i=!1,o=l._blocks;return!t&&(t=l)&&(l._autonomus||(i=v._set_ctx(l._ctx))),o&&G.call(o,e)?r=o[e](v,n,l,t):l._extends&&(r=l._extends.block(e,n,t)),i&&v._set_ctx(i),r},render:function(e,n){return""}}).renderBlock=Xe[n].block,Xe[n].renderSuperBlock=Xe[n].sprblock,ze[n]={constructor:ze,id:null,cacheDir:null,cacheMode:null,cache:null,templateDirs:null,templateFinder:null,templates:null,partials:null,plugins:null,prefix:null,encoding:null,dispose:function(){var e=this;if(e.id=null,e.cacheDir=null,e.cacheMode=null,e.templateDirs=null,e.templateFinder=null,e.templates=null,e.partials=null,e.plugins=null,e.prefix=null,e.encoding=null,e.cache)for(var n in e.cache)G.call(e.cache,n)&&e.cache[n].dispose();e.cache=null}},v={VERSION:"1.6.0",CACHE_TO_DISK_NONE:0,CACHE_TO_DISK_AUTOUPDATE:2,CACHE_TO_DISK_NOUPDATE:4,Exception:qe,Template:Xe,InlineTemplate:Ye,Ctx:ze,init:function(){g||(E=new ze("global"),s={global:E},j=E,V=D,W="';"+S,J=S+"__p__ += '",_=new Ye(["#PREFIXCODE#","!function(root, name, factory) {",'"use strict";',"if (('undefined'!==typeof Components)&&('object'===typeof Components.classes)&&('object'===typeof Components.classesByID)&&Components.utils&&('function'===typeof Components.utils['import'])) /* XPCOM */"," (root.$deps = root.$deps||{}) && (root.EXPORTED_SYMBOLS = [name]) && (root[name] = root.$deps[name] = factory.call(root));","else if (('object'===typeof module)&&module.exports) /* CommonJS */"," (module.$deps = module.$deps||{}) && (module.exports = module.$deps[name] = factory.call(root));","else if (('function'===typeof define)&&define.amd&&('function'===typeof require)&&('function'===typeof require.specified)&&require.specified(name) /*&& !require.defined(name)*/) /* AMD */"," define(name,['module'],function(module){factory.moduleUri = module.uri; return factory.call(root);});","else if (!(name in root)) /* Browser/WebWorker/.. */"," (root[name] = factory.call(root)||1)&&('function'===typeof(define))&&define.amd&&define(function(){return root[name];} );","}('undefined' !== typeof self ? self : this,'#CLASSNAME#',function() {",'"use strict";',"return function(Contemplate) {","/* Contemplate cached template '#TPLID#', constructor */","function #CLASSNAME#(id)","{"," var self = this;"," Contemplate.Template.call(self, id);"," /* tpl-defined blocks render code starts here */","#BLOCKS#"," /* tpl-defined blocks render code ends here */"," /* extend tpl assign code starts here */","#EXTENDCODE#"," /* extend tpl assign code ends here */","}","/* extends main Contemplate.Template class */","#CLASSNAME#.prototype = Object.create(Contemplate.Template.prototype);","/* render method */","#CLASSNAME#.prototype.render = function(data, __i__) {",' "use strict";'," var self = this, __p__ = '', __ctx = false;"," !__i__&&(__i__=self)&&(self._autonomus||(__ctx=Contemplate._set_ctx(self._ctx)));"," /* tpl main render code starts here */","#RENDERCODE#"," /* tpl main render code ends here */"," __ctx&&Contemplate._set_ctx(__ctx);"," return __p__;","};","// export it","return #CLASSNAME#;","};","});",""].join(S),{"#PREFIXCODE#":"PREFIXCODE","#CLASSNAME#":"CLASSNAME","#TPLID#":"TPLID","#BLOCKS#":"BLOCKS","#EXTENDCODE#":"EXTENDCODE","#RENDERCODE#":"RENDERCODE"},!1),m=new Ye(["","/* tpl block render method for block '#BLOCKNAME#' */","'#BLOCKMETHODNAME#': function(Contemplate, data, self, __i__) {","#BLOCKMETHODCODE#","}",""].join(S),{"#BLOCKNAME#":"BLOCKNAME","#BLOCKMETHODNAME#":"BLOCKMETHODNAME","#BLOCKMETHODCODE#":"BLOCKMETHODCODE"},!1),f=new Ye(['"use strict";',"var __p__ = '';","#BLOCKCODE#","return __p__;",""].join(S),{"#BLOCKCODE#":"BLOCKCODE"},!1),p=new Ye(["return function(data, __i__){",'"use strict";',"var self = this, __p__ = '', __ctx = false;","!__i__&&(__i__=self)&&(self._autonomus||(__ctx=Contemplate._set_ctx(self._ctx)));","#FCODE#","__ctx&&Contemplate._set_ctx(__ctx);","return __p__;","};"].join(S),{"#FCODE#":"FCODE"},!1),b=new Ye(["","#RCODE#",""].join(S),{"#RCODE#":"RCODE"},!1),Ce(),g=!0)},_set_ctx:function(e){var n=j;return j=e||E,n},createCtx:function(e){e&&"global"!==e&&!G.call(s,e)&&(s[e]=new ze(e))},disposeCtx:function(e){e&&"global"!==e&&G.call(s,e)&&(s[e].dispose(),delete s[e])},setTemplateSeparators:function(e){e&&(e.left&&(y=""+e.left),e.right&&(T=""+e.right))},setPreserveLines:function(e){arguments.length<1&&(e=!0),V=e?D:""},hasPlugin:function(e,n){return arguments.length<2&&(n="global"),n=n&&G.call(s,n)?s[n]:j,!!e&&(G.call(n.plugins,e)||G.call(E.plugins,e))},addPlugin:function(e,n,t){e&&n&&(arguments.length<2&&(t="global"),(t&&G.call(s,t)?s[t]:j).plugins[e]=n)},plg_:function(e){var n=arguments;return G.call(j.plugins,e)&&vn(j.plugins[e])?j.plugins[e].apply(null,Ve.call(n,1)):G.call(E.plugins,e)&&vn(E.plugins[e])?E.plugins[e].apply(null,Ve.call(n,1)):""},setPrefixCode:function(e,n){arguments.length<2&&(n="global"),n=n&&G.call(s,n)?s[n]:j,e&&(n.prefix=""+e)},setEncoding:function(e,n){arguments.length<2&&(n="global"),(n&&G.call(s,n)?s[n]:j).encoding=e},setCacheDir:function(e,n){arguments.length<2&&(n="global"),(n&&G.call(s,n)?s[n]:j).cacheDir=wn(e,"/\\")+"/"},setCacheMode:function(e,n){arguments.length<2&&(n="global"),(n&&G.call(s,n)?s[n]:j).cacheMode=x||C?e:v.CACHE_TO_DISK_NONE},setTemplateDirs:function(e,n){arguments.length<2&&(n="global"),(n&&G.call(s,n)?s[n]:j).templateDirs=[].concat(e)},getTemplateDirs:function(e){return arguments.length<1&&(e="global"),(e&&G.call(s,e)?s[e]:j).templateDirs},setTemplateFinder:function(e,n){arguments.length<2&&(n="global"),(n&&G.call(s,n)?s[n]:j).templateFinder=vn(e)?e:null},clearCache:function(e,n){arguments.length<2&&(n="global"),(n=n&&G.call(s,n)?s[n]:j).cache={},e&&(n.partials={})},add:function(e,n){var t,l;if(e&&"object"==typeof e)for(l in arguments.length<2&&(n="global"),t=n&&G.call(s,n)?s[n]:j,e)G.call(e,l)&&(An(e[l])?e[l][0]&&(t.templates[l]=[e[l][0],!0]):t.templates[l]=[e[l],!1])},hasTpl:function(e,n){return arguments.length<2&&(n="global"),n=n&&G.call(s,n)?s[n]:j,!!e&&(G.call(n.templates,e)||G.call(E.templates,e))},getTemplateContents:function(e,n,t){if(arguments.length<2&&(n="global"),n=n&&G.call(s,n)?s[n]:j,!vn(t))return Be(e,n);Be(e,n,function(e,n){t(e,n)})},getTemplateContentsPromise:function(e,n){return"function"==typeof Promise?new Promise(function(t,l){v.getTemplateContents(e,n,function(e,n){e?l(e):t(n)})}):null},findTpl:function(e,n,r){var t,l,i;if(arguments.length<2&&(n="global"),t=n&&G.call(s,n)?s[n]:j,vn(r)){var o,a,c,n=function t(){var l;c>=o.length?r(null,null):(l=wn(o[c],"/\\")+"/"+a,hn(l,function(e,n){!e&&n?r(null,l):(++c,t())}))};if(vn(t.templateFinder))return void t.templateFinder(e,function(e){r(null,e)});if(t.templateDirs&&t.templateDirs.length)return o=t.templateDirs,a=kn(e,"/\\"),c=0,void n();if(t!=E){if(vn((t=E).templateFinder))return void t.templateFinder(e,function(e){r(null,e)});if(t.templateDirs&&t.templateDirs.length)return o=t.templateDirs,a=kn(e,"/\\"),c=0,void n()}r(null,null)}else{if(vn(t.templateFinder))return t.templateFinder(e);if(t.templateDirs&&t.templateDirs.length){for(a=kn(e,"/\\"),c=0,i=t.templateDirs.length;c<i;++c)if(l=wn(t.templateDirs[c],"/\\")+"/"+a,dn(l))return l;return null}if(t!=E){if(vn((t=E).templateFinder))return t.templateFinder(e);if(t.templateDirs&&t.templateDirs.length){for(a=kn(e,"/\\"),c=0,i=t.templateDirs.length;c<i;++c)if(l=wn(t.templateDirs[c],"/\\")+"/"+a,dn(l))return l;return null}}}return null},findTplPromise:function(e,n){return"function"==typeof Promise?(arguments.length<2&&(n="global"),new Promise(function(t,l){v.findTpl(e,n,function(e,n){e?l(e):t(n)})})):null},parseTpl:function(e,n,t){var l,r,i,o=null;return n&&n.substr&&(o=G.call(s,n)?s[n]:E,n={}),(n=De({separators:null},n)).context&&(o=G.call(s,n.context)?s[n.context]:o||E,delete n.context),o=o||E,l=y,r=T,(n=n&&n.separators?n.separators:null)&&(l=n[0],r=n[1]),vn(t)?(i=j,j=o,be(),Ne(e,l,r,!0,function(e,n){Ce(),j=i,t(e,n)}),null):(i=j,j=o,be(),r=Ne(e,l,r,!0),Ce(),j=i,r)},parseTplPromise:function(e,n){return"function"==typeof Promise?new Promise(function(t,l){v.parseTpl(e,n,function(e,n){e?l(e):t(n)})}):null},tpl:function(l,r,t,i){var o,a,c;if(i=vn(i)?i:null,l instanceof v.Template)return o=l,i?(i(null,r&&"object"==typeof r?o.render(r):o),null):r&&"object"==typeof r?o.render(r):o;if((a=null)==t&&(t={}),t&&t.substr&&(a=G.call(s,t)?s[t]:j,t={}),(t=De({separators:null,autoUpdate:!1,refresh:!1,escape:!0,standalone:!1},t)).context&&(a=G.call(s,t.context)?s[t.context]:a||j,delete t.context),a=a||j,Z=!1!==t.escape,i){var u=function(){t.refresh||!a.cache[l]&&!E.cache[l]?(c=j,He(l,j=a,t,function(e,n){j=c,e?i(e,null):(a.cache[l]=n,(o=a.cache[l]||E.cache[l]).autonomus(t.standalone),i(null,r&&"object"==typeof r?o.render(r):o))})):((o=a.cache[l]||E.cache[l]).autonomus(t.standalone),i(null,r&&"object"==typeof r?o.render(r):o))};return null!=t.parsed||v.hasTpl(l,a.id)?u():v.findTpl(l,a.id,function(e,n){var t;n?((t={})[l]=n,v.add(t,a.id),u()):i(null,r&&"object"==typeof r?"":null)}),null}if(null==t.parsed&&!v.hasTpl(l,a.id)){var e=v.findTpl(l,a.id);if(!e)return r&&"object"==typeof r?"":null;var n={};n[l]=e,v.add(n,a.id)}return!t.refresh&&(a.cache[l]||E.cache[l])||(c=j,(j=a).cache[l]=He(l,a,t),j=c),(o=a.cache[l]||E.cache[l]).autonomus(t.standalone),r&&"object"==typeof r?o.render(r):o},tplPromise:function(e,n,r){return"function"==typeof Promise?new Promise(function(t,l){v.tpl(e,n,r,function(e,n){e?l(e):t(n)})}):null},inline:function(e,n,t){return e instanceof v.InlineTemplate?e.render(n):v.InlineTemplate(e,n,t)},concat:function(){return Ze.call(arguments,"")},join:function(e,n,t){if(null==n)return"";if(t=!0===t,"object"!=typeof n)return t&&!String(n).length?"":String(n);null==e&&(e="");for(var l,r=n.length,i=0<r?"object"==typeof n[0]?v.join(e,n[0],t):!t||null!=n[0]&&String(n[0]).length?String(n[0]):"":"",o=1;o<r;++o)l="object"==typeof n[o]?v.join(e,n[o],t):!t||null!=n[o]&&String(n[o]).length?String(n[o]):"",(!t||0<l.length)&&(i+=e+l);return i},keys:function(e){return e?jn(e):[]},values:function(e){return e?Sn(e):[]},items:function(e){return e},count:function(e){return null==e?0:An(e)?e.length:En(e)?jn(e).length:1},is_array:function(e,n){e=d.call(e);return n?"[object Array]"===e:"[object Array]"===e||"[object Object]"===e},in_array:function(e,n){return-1<n.indexOf(e)},is_list:An,haskey:function(e){var n,t,l;if(!e||!v.is_array(e))return!1;for(n=arguments,l=e,t=1;t<n.length;++t){if(null==l||!v.is_array(l)||!G.call(l,n[t]))return!1;l=l[n[t]]}return!0},time:Bn,date:function(e,n){return arguments.length<2&&(n=Bn()),function(e,n){var t,l,r,i,o,a=We;o=n instanceof Date?new Date(n):"number"==typeof n?new Date(1e3*n):new Date;var c={},u=o.getTimezoneOffset(),s=nn(u),f=o.getMonth();for(c.G=o.getHours(),c.j=o.getDate(),n=c.j%10,c.n=f+1,c.Y=o.getFullYear(),c.w=o.getDay(),c.N=c.w||7,c.d=Ln(c.j,2,"0"),c.D=a.day_short[c.w],c.l=a.day[c.w],c.S=a.ordinal.ord[c.j]?a.ordinal.ord[c.j]:a.ordinal.ord[n]?a.ordinal.ord[n]:a.ordinal.nth,c.z=en((new Date(c.Y,f,c.j)-new Date(c.Y,0,1))/864e5),c.W=Ln(1+en((new Date(c.Y,f,c.j-c.N+3)-new Date(c.Y,0,4))/864e5/7),2,"0"),c.F=a.month[f],c.m=Ln(c.n,2,"0"),c.M=a.month_short[f],c.t=new Date(c.Y,f+1,0).getDate(),c.L=c.Y%4==0&c.Y%100!=0|c.Y%400==0,c.o=c.Y+(11===f&&c.W<9?1:0===f&&9<c.W?-1:0),c.y=c.Y.toString().slice(-2),c.a=11<c.G?a.meridian.pm:a.meridian.am,c.A=11<c.G?a.meridian.PM:a.meridian.AM,c.B=Ln(Qe((3600*o.getUTCHours()+60*o.getUTCMinutes()+o.getUTCSeconds()+3600)/86.4)%1e3,3,"0"),c.g=c.G%12||12,c.h=Ln(c.g,2,"0"),c.H=Ln(c.G,2,"0"),c.i=Ln(o.getMinutes(),2,"0"),c.s=Ln(o.getSeconds(),2,"0"),c.u=Ln(1e3*o.getMilliseconds(),6,"0"),c.e="",c.I=new Date(c.Y,0)-Date.UTC(c.Y,0)!=new Date(c.Y,6)-Date.UTC(c.Y,6)?1:0,c.O=(0<u?"-":"+")+Ln(100*Qe(s/60)+s%60,4,"0"),c.P=c.O.substr(0,3)+":"+c.O.substr(3,2),c.T="UTC",c.Z=60*-u,c.U=o/1e3|0,c.c=c.Y+"-"+c.m+"-"+c.d+"\\"+c.T+c.H+":"+c.i+":"+c.s+c.P,c.r=c.D+", "+c.d+" "+c.M+" "+c.Y+" "+c.H+":"+c.i+":"+c.s+" "+c.O,t="",r=0,i=e.length;r<i;++r)l=e.charAt(r),t+=G.call(c,l)?c[l]:l;return t}(e,n)},lowercase:function(e){return String(e).toLowerCase()},uppercase:function(e){return String(e).toUpperCase()},striptags:function(e){return e.replace(Y,"")},e:function(e,n){var t,l,r=0,i=e.length,o="";if(n)for(r=0;r<i;++r)switch(l=(t=e.charAt(r)).charCodeAt(0)){case 34:o+="&quot;";break;case 38:o+="&amp;";break;case 39:o+="&apos;";break;case 60:o+="&lt;";break;case 62:o+="&gt;";break;default:o+=t}else for(r=0;r<i;++r)switch(l=(t=e.charAt(r)).charCodeAt(0)){case 34:case 38:case 39:case 60:case 62:o+="&#"+l+";";break;default:o+=t}return o},json_encode:function(e){return JSON.stringify(e)},json_decode:function(e){return JSON.parse(e)},urlencode:Rn,urldecode:function(e){return Un((""+e).split("+").join("%20"))},buildquery:function(e){return function(e,n,t){var l,r,i=[];arguments.length<2&&(n="&");arguments.length<3&&(t=!1);for(l in e)G.call(e,l)&&(r=e[l],""!=(r=function e(n,t,l,r){var i,o,a=r?Nn:Rn;!0===t?t="1":!1===t&&(t="0");{if(null==t)return"";if("object"!=typeof t)return a(n)+"="+a(t);for(i in o=[],t)G.call(t,i)&&null!=t[i]&&o.push(e(n+"["+i+"]",t[i],l,r));return o.join(l)}}(l,r,n,t))&&i.push(r));return i.join(n)}(e,"&")},parsequery:function(e){var n,t,l,r,i,o,a,c,u,s,f,p,d,h=e.replace(/^&+|&+$/g,"").split("&"),g=h.length,_={},m=[];for(n=0;n<g;++n)if(a=h[n].split("="),o=Un(Mn(a[0])),a=a.length<2?"":Un(Mn(a[1])),-1<(t=o.indexOf("\0"))&&(o=o.slice(0,t)),o&&"["!==o.charAt(0)){for(u=[],t=c=0;t<o.length;++t)if("["!==o.charAt(t)||c){if("]"===o.charAt(t)&&c&&(u.length||u.push(o.slice(0,c-1)),u.push(o.substr(c,t-c)),c=0,"["!==o.charAt(t+1)))break}else c=t+1;for(u.length||(u=[o]),t=0;t<u[0].length&&(" "!==(i=u[0].charAt(t))&&"."!==i&&"["!==i||(u[0]=u[0].substr(0,t)+"_"+u[0].substr(t+1)),"["!==i);++t);for(o=null,l=r=_,f=u.length?Mn(u[u.length-1].replace(/^['"]|['"]$/g,"")):null,t=0,s=u.length;t<s;++t)p=o,o=u[t].replace(/^['"]|['"]$/g,""),d=l,l=r,""!==Mn(o)||0===t?(G.call(r,o)||(r[o]=t+1===s-1&&""===f?[]:{}),r=r[o]):o=!0;!0===o?l.push(a):(o==+o&&m.push({key:p,obj:d}),l[o]=a)}for(n=m.length-1;0<=n;--n)(function(e){if(An(e))return!0;if(En(e)){var n,t=jn(e),l=t.length;for(n=0;n<l;++n)if(n!==+t[n])return!1;return!0}return!1})(r=m[n].key?m[n].obj[m[n].key]:m[n].obj)&&(r=Sn(r),m[n].key?m[n].obj[m[n].key]=r:_=r);return _},queryvar:function(e,n,t){var l,r,i,o,a,c,u;if(null!=t){for(a=(l=[].concat(t)).length,o=0;o<a;++o)e=e.replace(Dn("(\\?|&)"+Rn(l[o]).replace(un,"\\$1")+"(\\[[^\\[\\]]*\\])*(=[^&]+)?","g"),"$1");"?"!==(t=(e=e.replace(oe,"&").replace("?&","?")).slice(-1))&&"&"!==t||(e=e.slice(0,-1))}if(n)for(a=(l=Je(n)).length,c=-1===e.indexOf("?")?"?":"&",o=0;o<a;++o){if(i=n[r=l[o]],r=Rn(r),"[object Array]"===(u=d.call(i))||"[object Object]"===u)if("[object Array]"===u)for(var s=0,f=i.length;s<f;++s)e+=c+r+"[]="+Rn(i[s]),c="&";else for(var p=Je(i),s=0,f=p.length;s<f;++s)e+=c+r+"["+Rn(p[s])+"]="+Rn(i[p[s]]),c="&";else e+=c+r+"="+Rn(i);c="&"}return e},get:function(e,n,t){t=null!=t?t:null,v.is_array(n,!0)||(n=[n]);for(var l,r=e,i=0,o=n.length,a=1,i=0;i<o;++i)if(l=String(n[i]),G.call(r,l))r=r[l];else{if(!vn(r[l="get"+l.charAt(0).toUpperCase()+l.substring(1)])){a=0;break}r=r[l]()}return a?r:t},uuid:function(e){return[e||"UUID",++B,Bn()].join("_")},merge:De,empty:function(e){if(!e||!Boolean(e)||"0"===e)return!0;var n=d.call(e);return(e instanceof Array||e instanceof String||"[object Array]"===n||"[object String]"===n)&&!e.length||(e instanceof Object||"[object Object]"===n)&&!jn(e).length},trim:Mn,ltrim:kn,rtrim:wn,sprintf:qn,vsprintf:function(e,n){return qn.apply(null,[e].concat(n||[]))}};function Ge(e){return a["@mozilla.org/network/io-service;1"].getService(u.nsIIOService).newURI(e,null,null).QueryInterface(u.nsIFileURL).file}var We={meridian:{am:"am",pm:"pm",AM:"AM",PM:"PM"},ordinal:{ord:{1:"st",2:"nd",3:"rd"},nth:"th"},timezone:["UTC","EST","MDT"],timezone_short:["UTC","EST","MDT"],day:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],month:["January","February","March","April","May","June","July","August","September","October","November","December"],month_short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},Je=t.keys,Ze=c[n].join,Ve=c[n].slice,Qe=Math.floor,en=Math.round,nn=Math.abs,tn=/!/g,ln=/'/g,rn=/\(/g,on=/\)/g,an=/\*/g,cn=/%20/g,un=/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:\\])/g,sn=/[ \s\u00A0]+$/g,fn=/^[ \s\u00A0]+/g,pn=/^[ \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]+|[ \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]+$/g,dn=C?function(e){return Ge(e).exists()}:x?function(e){return h.existsSync(e)}:function(){return!0},hn=C?function(e,n){n&&n(null,dn(e))}:x?function(e,t){h.stat(e,function(e,n){t&&(e?"ENOENT"===e.code?t(null,!1):t(e,null):t(null,!0))})}:function(e,n){n&&n(null,!0)},gn=C?function(e,n){e=Ge(e);return e.create(e.DIRECTORY_TYPE,n)}:x?function(e,n){return h.mkdirSync(e,n)}:function(){return!1},_n=C?function(e,n,t){n=gn(e,n);t&&t(null,n)}:x?function(e,n,t){h.mkdir(e,n,function(e){t&&t(e,!e)})}:function(e,n,t){t&&t(null,!1)},mn=C?function(e){e=Ge(e).lastModifiedTime;return{mtime:!!e&&new Date(e)}}:x?function(e){return h.statSync(e)}:function(e){var n=i(),t={mtime:!1};return n.open("HEAD",e,!1),n.send(null),200===n.status&&(e=new Date(n.getResponseHeader("Last-Modified")),"Invalid Date"===n.toString()&&(e=!1),t.mtime=e),t},bn=C?function(e,n){n&&n(null,mn(e))}:x?function(e,n){h.stat(e,n)}:function(e,n){var t,l=i(),r={mtime:!1};l.open("HEAD",e,!0),l.onload=function(){200===l.status&&("Invalid Date"===(t=new Date(l.getResponseHeader("Last-Modified"))).toString()&&(t=!1),r.mtime=t),n&&n(null,r)},l.send(null)},Cn=C?function(e,n){var t,l="",r={value:""},i=a["@mozilla.org/network/file-input-stream;1"].createInstance(u.nsIFileInputStream),o=a["@mozilla.org/intl/converter-input-stream;1"].createInstance(u.nsIConverterInputStream);for(i.init(Ge(e),-1,0,0),o.init(i,n||"UTF-8",0,0);t=o.readString(4294967295,r),l+=r.value,0!=t;);return o.close(),l}:x?function(e,n){return h.readFileSync(e,{encoding:n||"utf8"})}:function(e,n){var t=i();return t.open("GET",e,!1),t.setRequestHeader("Content-Type","text/plain; charset="+(n||"utf8")),t.overrideMimeType("text/plain; charset="+(n||"utf8")),t.send(null),200===t.status?t.responseText:""},xn=C?function(e,t,l){NetUtil.asyncFetch(Ge(e),function(e,n){n=!Components.isSuccessCode(n),e=n?"":NetUtil.readInputStreamToString(e,e.available(),{charset:t||"UTF-8"});l&&l(n,e)})}:x?function(e,n,t){h.readFile(e,{encoding:n||"utf8"},t)}:function(e,n,t){var l=i();l.open("GET",e,!0),l.responseType="text",l.setRequestHeader("Content-Type","text/plain; charset="+(n||"utf8")),l.overrideMimeType("text/plain; charset="+(n||"utf8")),l.onload=function(){var e=200!==l.status,n=e?"":l.responseText;t&&t(e,n)},l.send(null)},On=C?function(e,n,t){var l=a["@mozilla.org/network/file-output-stream;1"].createInstance(u.nsIFileOutputStream),r=a["@mozilla.org/intl/converter-output-stream;1"].createInstance(u.nsIConverterOutputStream);l.init(Ge(e),42,438,0),r.init(l,t||"UTF-8",0,0),r.writeString(n),r.close()}:x?function(e,n,t){h.writeFileSync(e,n,{encoding:t||"utf8"})}:function(){},yn=C?function(e,n,t,l){var r=FileUtils.openSafeFileOutputStream(Ge(e)),e=a["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(u.nsIScriptableUnicodeConverter);e.charset=t||"UTF-8",n=e.convertToInputStream(n),NetUtil.asyncCopy(n,r,function(e){l&&l(Components.isSuccessCode(e))})}:x?function(e,n,t,l){h.writeFile(e,n,{encoding:t||"utf8"},function(e,n){l(e,n)})}:function(e,n,t,l){l&&l(null)},Tn=C?function(e,n){var t=a["@mozilla.org/systemprincipal;1"].createInstance(u.nsIPrincipal),l=new r.Sandbox(t,{sandboxName:"contemplate_sandbox_"+j.id,sameZoneAs:v,wantComponents:!1,wantExportHelpers:!1,wantXrays:!0,wantGlobalProperties:[]}),t=v.uuid("dyna_func");return l.Contemplate=v,r.evalInSandbox(";function "+t+"("+e+"){"+n+"};",l),l[t]}:function(e,n){return new Function(e,n)};function Dn(e,n){return new RegExp(e,n||"")}function vn(e){return"function"==typeof e}function An(e){return e&&(e instanceof c||"[object Array]"===d.call(e))}function En(e){return e&&"[object Object]"===d.call(e)}function jn(e){if(vn(Object.keys))return Object.keys(e);var n,t,l;if(An(e))for(n=new Array(l=e.length),t=0;t<l;++t)n[t]=String(t);else for(t in n=[],e)G.call(e,t)&&n.push(t);return n}function Sn(e){if(An(e))return e;if(vn(Object.values))return Object.values(e);var n,t=[];for(n in e)G.call(e,n)&&t.push(e[n]);return t}function kn(e,n){return(e+"").replace(n?Dn("^["+(n+"").replace(un,"\\$1")+"]+","g"):fn,"")}function wn(e,n){return(e+"").replace(n?Dn("["+(n+"").replace(un,"\\$1")+"]+$","g"):sn,"")}function Mn(e,n){return(e+"").replace(n?Dn("^["+(n=(n+"").replace(un,"\\$1"))+"]+|["+n+"]+$","g"):pn,"")}function In(e){var n=e.charAt(e.length-1);return"/"!==n&&"\\"!==n||(e=e.slice(0,-1)),e.split($).pop()}function Fn(e){var n=e.charAt(e.length-1);return"/"!==n&&"\\"!==n||(e=e.slice(0,-1)),e.replace(q,"")}function Ln(e,n,t){e=e.toString(),n-=e.length;return 0<n?new Array(1+n).join(t||" ")+e:e}function Nn(e){return encodeURIComponent(""+e).replace(tn,"%21").replace(ln,"%27").replace(rn,"%28").replace(on,"%29").replace(an,"%2A")}function Rn(e){return encodeURIComponent(""+e).replace(tn,"%21").replace(ln,"%27").replace(rn,"%28").replace(on,"%29").replace(an,"%2A").replace(cn,"+")}function Un(e){return decodeURIComponent(""+e)}function Bn(){return Qe((new Date).getTime()/1e3)}function Pn(e,n,t,l){null==t&&(t=" ");var r=String(e),e=r.length,t=e<n?new Array(n-e+1).join(t):"";return l?r+t:t+r}function Kn(e,n,t,l,r,i){var o=String(e),e=l-o.length;return 0<e&&(o=t||!r?Pn(o,l,i,t):o.slice(0,n.length)+Pn("",e,"0",!0)+o.slice(n.length)),o}function Hn(e,n,t,l,r,i,o){var a=e>>>0;return Kn(e=(t=t&&a&&{2:"0b",8:"0",16:"0x"}[n]||"")+Pn(a.toString(n),i||0,"0",!1),t,l,r,o)}function $n(e,n,t,l,r,i){return null!=l&&(e=e.slice(0,l)),Kn(e,"",n,t,r,i)}function qn(){var m=1,b=arguments;return arguments[0].replace(qn.format_re,function(e,n,t,l,r,i,o){var a,c,u;if("%%"==e)return"%";for(var s=!1,f="",p=!1,d=!1,h=" ",g=t.length,_=0;t&&_<g;++_)switch(t.charAt(_)){case" ":f=" ";break;case"+":f="+";break;case"-":s=!0;break;case"'":h=t.charAt(_+1);break;case"0":p=!0;break;case"#":d=!0}if((l=l?"*"==l?+b[m++]:"*"==l.charAt(0)?+b[l.slice(1,-1)]:+l:0)<0&&(l=-l,s=!0),!isFinite(l))throw new Error("sprintf: (minimum-)width must be finite");switch(i=i?"*"==i?+b[m++]:"*"==i.charAt(0)?+b[i.slice(1,-1)]:+i:-1<"fFeE".indexOf(o)?6:"d"==o?0:void 0,u=n?b[n.slice(0,-1)]:b[m++],o){case"s":return $n(String(u),s,l,i,p,h);case"c":return $n(String.fromCharCode(+u),s,l,i,p);case"b":return Hn(u,2,d,s,l,i,p);case"o":return Hn(u,8,d,s,l,i,p);case"x":return Hn(u,16,d,s,l,i,p);case"X":return Hn(u,16,d,s,l,i,p).toUpperCase();case"u":return Hn(u,10,d,s,l,i,p);case"i":case"d":return a=+u||0,Kn(u=(c=(a=Math.round(a-a%1))<0?"-":f)+Pn(String(Math.abs(a)),i,"0",!1),c,s,l,p);case"e":case"E":case"f":case"F":case"g":case"G":return c=(a=+u)<0?"-":f,n=["toExponential","toFixed","toPrecision"]["efg".indexOf(o.toLowerCase())],o=["toString","toUpperCase"]["eEfFgG".indexOf(o)%2],Kn(u=c+Math.abs(a)[n](i),c,s,l,p)[o]();default:return e}})}return qn.format_re=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,v.init(),v});