/** * GrammarTemplate, * versatile and intuitive grammar-based templating for PHP, Python, Node/XPCOM/JS, ActionScript * * @version: 3.0.0 * https://github.com/foo123/GrammarTemplate * **/ !function(l,n,e){"use strict";"undefined"!=typeof Components&&"object"==typeof Components.classes&&"object"==typeof Components.classesByID&&Components.utils&&"function"==typeof Components.utils.import?(l.$deps=l.$deps||{})&&(l.EXPORTED_SYMBOLS=[n])&&(l[n]=l.$deps[n]=e.call(l)):"object"==typeof module&&module.exports?(module.$deps=module.$deps||{})&&(module.exports=module.$deps[n]=e.call(l)):"undefined"!=typeof System&&"function"==typeof System.register&&"function"==typeof System.import?System.register(n,[],function(t){t(n,e.call(l))}):"function"==typeof define&&define.amd&&"function"==typeof require&&"function"==typeof require.specified&&require.specified(n)?define(n,["module"],function(n){return e.moduleUri=n.uri,e.call(l)}):n in l||(l[n]=e.call(l)||1)&&"function"==typeof define&&define.amd&&define(function(){return l[n]})}("undefined"!=typeof self?self:this,"GrammarTemplate",function(l){"use strict";function n(l,n){return l&&y.call(l,n)?1:0}function e(l,n,e,t){var u=String(l);if(e=e||"0",t)for(;u.lengthn.start)for(c=n.start,v=-1===n.end?m-1:Math.min(n.end,m-1),y=c;y<=v;y++)b+=d(l,n.tpl,e,t,y,a,i);else g||n.start!==n.end||(b=d(l,n.tpl,e,t,null,a,i));return b}function p(l,e,t,o,i,s,p){var d,c,v,y,m="";return e.stpl&&(n(t,e.stpl)||n(g.subGlobal,e.stpl)||n(o,e.stpl)||n(o,"*")||n(g.fnGlobal,e.stpl)||n(g.fnGlobal,"*"))?(d=r(l,e.key,[String(e.name)],e.loc?null:p),n(t,e.stpl)||n(g.subGlobal,e.stpl)?(null==i||0===i&&e.start===e.end&&e.opt||!u(d)||(d=i","[","]"],g.fnGlobal={},g.subGlobal={},g.guid=t,g.multisplit=function(l,e,u){var a,r,f,p,d,g,c,y,m,h,w,S,k,G,_,x,O,D,$,j,A,C,I,U,q,E,T=e[0],B=e[1],M=e[2],P=e[3],R=T.length,L=B.length,N=M.length,V=P.length,X="#"+P,Y=null,z=0,F=0,H=0,J=0,K=l.length,Q=[T,R,B,L],W=[M,N,P,V],Z=[null,0,null,0,null,0,null,0];for(u=!0===u,$={type:1,name:null,key:null,stpl:null,dval:null,opt:0,neg:0,algn:0,loc:0,start:0,end:0},A=m=new s({type:0,val:"",algn:""}),C=null,j=null,_={},O=null,x={},D=null,Q[1]r&&4>f;)Q[r+1]r;)Z[S]=Q[r],Z[S+1]=Q[r+1],r+=2,S+=2;for(;4>f;)Z[S]=W[f],Z[S+1]=W[f+1],f+=2,S+=2;for(c=null,w="",S=0;S1?(r=(r=b(w[0])).length?0|+r:0,f=(f=b(w[1])).length?0|+f:-1,F=1):(f=r=(r=b(w[0])).length?0|+r:0,F=0),w="",z=0}else F=0,z=0,r=0,f=0;if(z&&null===Y&&(Y=""),"@"===(y=d[v](0))?(H=1,d=d.slice(1)):H=0,"."===(y=d[v](0))?(J=1,d=d.slice(1)):J=0,p=-1