Comparing version 6.2.1 to 6.3.1
{ | ||
"name": "remixml", | ||
"version": "6.2.1", | ||
"version": "6.3.1", | ||
"description": "XML/HTML-like macro language/template compiler engine", | ||
@@ -5,0 +5,0 @@ "main": "remixml.min.js", |
@@ -16,3 +16,3 @@ <h1>Remixml</h1> | ||
whitespace-collapsing, asynchronous control and more. | ||
- Fast & lean: Small 6 KB gzipped runtime which includes the compiler | ||
- Fast & lean: Small 7 KB gzipped runtime which includes the compiler | ||
which can precompile templates in node and in the browser. | ||
@@ -23,2 +23,3 @@ - Compiles to minified Javascript. | ||
- Extensible with custom filters and tags programmed in Javascript. | ||
- Easy multi-level caching for even more speed. | ||
- Available everywhere in node and all modern web browsers. | ||
@@ -51,3 +52,3 @@ - It contains a fully featured fast validating XHTML parser. | ||
Minified and gzip-compressed, it is less than 6 KB of code. | ||
Minified and gzip-compressed, it is less than 7 KB of code. | ||
@@ -470,3 +471,3 @@ It has zero dependencies on other modules. | ||
- `<nocache>...</nocache>`<br /> | ||
Reserved for future use. | ||
Mark sections inside a `<cache>` section to be uncached instead. | ||
@@ -473,0 +474,0 @@ #### Javascript helperfunctions |
@@ -19,3 +19,3 @@ /** @license | ||
var B,C,CG,CS,D,E,F,G,K,L,M,N,O,P,Q,R,S,T,U,V,X,Y,Z, | ||
var B,C,CG,CS,D,E,F,G,K,L,M,N,O,OA,P,Q,R,S,T,U,V,X,Y,Z, | ||
log,sizeof,desc,abstract2txt,abstract2dom; | ||
@@ -176,3 +176,3 @@ function A(_,$,v) | ||
{ abstractcache.set(skey, value); // Move to front | ||
return O(value[0]); | ||
return value[0]; | ||
} | ||
@@ -183,3 +183,3 @@ } | ||
// Cache-set for abstracts | ||
CS = /** void */(/** !Array */ key,/** !Array */ value,/** number= */ ttl) => | ||
CS = /** !Array */(/** !Array */ key,/** !Array */ value,/** number= */ ttl) => | ||
{ if (key) | ||
@@ -218,2 +218,3 @@ { var /** number */ t = Date.now(); | ||
} | ||
return value; | ||
}; | ||
@@ -472,20 +473,49 @@ // Trim a single space from both ends | ||
}; | ||
// cloneabstract | ||
O = /** !Array */ (/** !Array */ k,/** !Array= */ r) => | ||
{ var /** * */ i; | ||
if (r) | ||
{ for (i in r) | ||
delete r[/** @type {?} */(i)]; | ||
function /** !Array */ targetclear(/** !Array */ src,/** !Array= */ dst) | ||
{ var /** string */ i; | ||
if (dst) | ||
{ for (i in dst) | ||
delete dst[/** @type {?} */(i)]; // clear target attributes | ||
} else | ||
r = []; | ||
if (!isa(k)) | ||
/** @type {!Object} */(k)["length"] = 0; // Object->Array kludge | ||
r = /** @type {!Array} */(Obj.assign(r, k)); | ||
i = r.length; | ||
dst = []; | ||
if (!isa(src)) | ||
/** @type {!Object} */(src)["length"] = 0; // Object->Array kludge | ||
return /** @type {!Array} */(Obj.assign(dst, src)); // clone array values | ||
} | ||
// cloneabstract | ||
O = /** !Array */(/** !Array */ src,/** !Array= */ dst,/** !Object= */ $) => | ||
{ var /** number */ i; | ||
dst = targetclear(src, dst); | ||
i = dst.length; | ||
while (i--) | ||
{ if (r[i][""]) | ||
r[i] = O(r[i]); | ||
{ let /** !Object */ value = dst[i]; | ||
if (value[""]) | ||
dst[i] = O(value, 0, $); // clone recursively | ||
else if (typeof value === "function") | ||
{ let /** !Array */ H = [i, 1]; | ||
value(H, $); // Fill in the <nocache> element | ||
Array.prototype.splice.apply(dst, H); // Replace it with the content | ||
} | ||
} | ||
return r; | ||
return dst; | ||
}; | ||
// async cloneabstract | ||
OA = async /** !Array */(/** !Array */ src, | ||
/** !Array= */ dst,/** !Object= */ $) => | ||
{ var /** number */ i; | ||
dst = targetclear(src, dst); | ||
i = dst.length; | ||
while (i--) | ||
{ let /** !Object */ value = dst[i]; | ||
if (value[""]) | ||
dst[i] = await OA(value, 0, $); // clone recursively | ||
else if (typeof value === "function") | ||
{ let /** !Array */ H = [i, 1]; | ||
await value(H, $); // Fill in the <nocache> element | ||
Array.prototype.splice.apply(dst, H); // Replace it with the content | ||
} | ||
} | ||
return dst; | ||
}; | ||
// varinsert | ||
@@ -597,4 +627,5 @@ K = /** number */ | ||
const /** string */ awaitf = isasync ? "await " : ""; | ||
var /** string */ obj = "(" + asyncf | ||
+ '$=>{"use strict";var I,W,_,H=N($);'; | ||
const /** string */ awaito = isasync ? "await OA" : "O"; | ||
const /** string */ cacheasync = isasync ? "\"\x02\"+" : ""; // Async cache prefix | ||
var /** string */ obj = "(" + asyncf + '$=>{"use strict";var I,W,_,H=N($);'; | ||
var /** number */ noparse = 0; | ||
@@ -797,4 +828,3 @@ var /** number */ comment = 0; | ||
{ startcfn(); | ||
obj += "v=0;Q(" + ts + ",$," + asyncf | ||
+ "(H,a,$,W)=>{$=C(a,$,{"; | ||
obj += "v=0;Q(" + ts + ",$," + asyncf + "(H,a,$,W)=>{$=C(a,$,{"; | ||
{ let /** string|undefined */ args = getparm("args"); | ||
@@ -864,3 +894,3 @@ if (args && (args = args.replace(nonwordrx, ""))) | ||
let /** string */ tobj | ||
= "v=[" + (getparm("shared") || ++cachetags); | ||
= "v=[" + cacheasync + (getparm("shared") || ++cachetags); | ||
let /** string|undefined */ key = getparm("key"); | ||
@@ -877,5 +907,9 @@ let /** string */ tobjafter = ""; | ||
tobj += "," + (key||0), tobjafter = ";"; | ||
obj += tobj + "]" + tobjafter + "H=CG(v);if(!H){H=L();"; | ||
obj += tobj + "]" + tobjafter | ||
+ "H=CG(v);if(!H){H=L();"; | ||
continue; | ||
} | ||
case "nocache": | ||
obj += "W.push(" + asyncf + "(H,$,W)=>{"; | ||
continue; | ||
case "attrib": | ||
@@ -1070,4 +1104,7 @@ obj += letHprefix + "v=" + getparm("name") + ",J=W;"; | ||
case "cache": | ||
obj += "CS(v,H,g)}J.push(H)}"; | ||
continue; | ||
obj += "H=CS(v,H,g)}H=" + awaito + "(H,0,$);J.push(H)}"; | ||
break; | ||
case "nocache": | ||
obj += "});"; | ||
break; | ||
case "attrib": | ||
@@ -1074,0 +1111,0 @@ obj += "V(H,v,J)}"; |
@@ -23,3 +23,3 @@ /** @license | ||
// Cut BEGIN for prepend | ||
var B,C,CG,CS,D,E,F,G,K,L,M,N,O,P,Q,R,S,T,U,V,X,Y,Z, | ||
var B,C,CG,CS,D,E,F,G,K,L,M,N,O,OA,P,Q,R,S,T,U,V,X,Y,Z, | ||
log,sizeof,desc,abstract2txt,abstract2dom; | ||
@@ -184,3 +184,3 @@ // Cut END for prepend | ||
{ abstractcache.set(skey, value); // Move to front | ||
return O(value[0]); | ||
return value[0]; | ||
} | ||
@@ -191,3 +191,3 @@ } | ||
// Cache-set for abstracts | ||
CS = /** void */(/** !Array */ key,/** !Array */ value,/** number= */ ttl) => | ||
CS = /** !Array */(/** !Array */ key,/** !Array */ value,/** number= */ ttl) => | ||
{ if (key) | ||
@@ -226,2 +226,3 @@ { var /** number */ t = Date.now(); | ||
} | ||
return value; | ||
}; | ||
@@ -480,20 +481,49 @@ // Trim a single space from both ends | ||
}; | ||
// cloneabstract | ||
O = /** !Array */ (/** !Array */ k,/** !Array= */ r) => | ||
{ var /** * */ i; | ||
if (r) | ||
{ for (i in r) | ||
delete r[/** @type {?} */(i)]; | ||
function /** !Array */ targetclear(/** !Array */ src,/** !Array= */ dst) | ||
{ var /** string */ i; | ||
if (dst) | ||
{ for (i in dst) | ||
delete dst[/** @type {?} */(i)]; // clear target attributes | ||
} else | ||
r = []; | ||
if (!isa(k)) | ||
/** @type {!Object} */(k)["length"] = 0; // Object->Array kludge | ||
r = /** @type {!Array} */(Obj.assign(r, k)); | ||
i = r.length; | ||
dst = []; | ||
if (!isa(src)) | ||
/** @type {!Object} */(src)["length"] = 0; // Object->Array kludge | ||
return /** @type {!Array} */(Obj.assign(dst, src)); // clone array values | ||
} | ||
// cloneabstract | ||
O = /** !Array */(/** !Array */ src,/** !Array= */ dst,/** !Object= */ $) => | ||
{ var /** number */ i; | ||
dst = targetclear(src, dst); | ||
i = dst.length; | ||
while (i--) | ||
{ if (r[i][""]) | ||
r[i] = O(r[i]); | ||
{ let /** !Object */ value = dst[i]; | ||
if (value[""]) | ||
dst[i] = O(value, 0, $); // clone recursively | ||
else if (typeof value === "function") | ||
{ let /** !Array */ H = [i, 1]; | ||
value(H, $); // Fill in the <nocache> element | ||
Array.prototype.splice.apply(dst, H); // Replace it with the content | ||
} | ||
} | ||
return r; | ||
return dst; | ||
}; | ||
// async cloneabstract | ||
OA = async /** !Array */(/** !Array */ src, | ||
/** !Array= */ dst,/** !Object= */ $) => | ||
{ var /** number */ i; | ||
dst = targetclear(src, dst); | ||
i = dst.length; | ||
while (i--) | ||
{ let /** !Object */ value = dst[i]; | ||
if (value[""]) | ||
dst[i] = await OA(value, 0, $); // clone recursively | ||
else if (typeof value === "function") | ||
{ let /** !Array */ H = [i, 1]; | ||
await value(H, $); // Fill in the <nocache> element | ||
Array.prototype.splice.apply(dst, H); // Replace it with the content | ||
} | ||
} | ||
return dst; | ||
}; | ||
// varinsert | ||
@@ -605,4 +635,5 @@ K = /** number */ | ||
const /** string */ awaitf = isasync ? "await " : ""; | ||
var /** string */ obj = "(" + asyncf | ||
+ '$=>{"use strict";var I,W,_,H=N($);'; | ||
const /** string */ awaito = isasync ? "await OA" : "O"; | ||
const /** string */ cacheasync = isasync ? "\"\x02\"+" : ""; // Async cache prefix | ||
var /** string */ obj = "(" + asyncf + '$=>{"use strict";var I,W,_,H=N($);'; | ||
var /** number */ noparse = 0; | ||
@@ -805,4 +836,3 @@ var /** number */ comment = 0; | ||
{ startcfn(); | ||
obj += "v=0;Q(" + ts + ",$," + asyncf | ||
+ "(H,a,$,W)=>{$=C(a,$,{"; | ||
obj += "v=0;Q(" + ts + ",$," + asyncf + "(H,a,$,W)=>{$=C(a,$,{"; | ||
{ let /** string|undefined */ args = getparm("args"); | ||
@@ -872,3 +902,3 @@ if (args && (args = args.replace(nonwordrx, ""))) | ||
let /** string */ tobj | ||
= "v=[" + (getparm("shared") || ++cachetags); | ||
= "v=[" + cacheasync + (getparm("shared") || ++cachetags); | ||
let /** string|undefined */ key = getparm("key"); | ||
@@ -885,5 +915,9 @@ let /** string */ tobjafter = ""; | ||
tobj += "," + (key||0), tobjafter = ";"; | ||
obj += tobj + "]" + tobjafter + "H=CG(v);if(!H){H=L();"; | ||
obj += tobj + "]" + tobjafter | ||
+ "H=CG(v);if(!H){H=L();"; | ||
continue; | ||
} | ||
case "nocache": | ||
obj += "W.push(" + asyncf + "(H,$,W)=>{"; | ||
continue; | ||
case "attrib": | ||
@@ -1078,4 +1112,7 @@ obj += letHprefix + "v=" + getparm("name") + ",J=W;"; | ||
case "cache": | ||
obj += "CS(v,H,g)}J.push(H)}"; | ||
continue; | ||
obj += "H=CS(v,H,g)}H=" + awaito + "(H,0,$);J.push(H)}"; | ||
break; | ||
case "nocache": | ||
obj += "});"; | ||
break; | ||
case "attrib": | ||
@@ -1082,0 +1119,0 @@ obj += "V(H,v,J)}"; |
(function(){"use strict"; | ||
var B,C,CG,CS,D,E,F,G,K,L,M,N,O,P,Q,R,S,T,U,V,X,Y,Z, | ||
var B,C,CG,CS,D,E,F,G,K,L,M,N,O,OA,P,Q,R,S,T,U,V,X,Y,Z, | ||
log,sizeof,desc,abstract2txt,abstract2dom; | ||
@@ -14,28 +14,30 @@ function A(_,$,v) | ||
*/ | ||
'use strict';(()=>{function ka(a){return"string"===typeof a}function Ma(a){return Na[a]}function Oa(a){return Pa[a]}function Qa(a,b){a[b]=1;return a}function Ra(a,b,c,e,h){b._._tag[c]=(g,w,m)=>{delete w[""];m=C(w,m,h?h.split(wa).reduce(Qa,{}):{},e);return a(m)}}function ia(a,b){var c=a.match(Sa);return c?(a=T(c[1]),b?[a]:"["+a+"]"):a}function xa(a,b){return na(oa(a,b))}function ya(a){return a.replace(Ta," ")}function za(a,b,c){y.defineProperty(a,b,{get:c,configurable:!0})}function Aa(a){return a.match(Ua)? | ||
"."+a:'["'+a+'"]'}function ja(a,b){return"(()=>{try{return "+a+"}catch(x){"+(b?"":"D(x)")+'}return ""})()'}function Ba(a){var b="",c="",e;for(Ca.lastIndex=0;e=aa(Ca,a);)b=e[1]?b+(c+ja(Da(e),1)):b+(c+JSON.stringify(e[0])),c="+";return b}function pa(a,b,c){a="Z($,"+ia(a);b&&(a+=","+b);c&&(b||(a+=",0"),a+=","+c);return a+")"}function Da(a){var b=a[2],c=a[3];return pa(JSON.stringify(a[1]),ka(b)&&JSON.stringify(b),c&&JSON.stringify(c))}function da(a){a&&(a.includes("(")?(a='"'===a.slice(-1)?'"'===a[0]? | ||
a.slice(1,-1):'"+'+a.slice(0,-1):('"'===a[0]?a.slice(1):'"+'+a)+'+"',a.includes("{")&&(a="("+a+")"),a=ja('eval("'+a+'")'),a=a.includes("_")?"(_=$._,"+a+")":a):((a=JSON.parse(a)).includes("_")&&(a="(_=$._,"+a+")"),a=ja(a)));return a}function oa(a,b){function c(n,W){var p=D,ea=a.slice(0,v),ba=(ea.match(Va)||"").length+1;ea=ea.match(Wa)[0].length+1;p(W+" at "+(ba+":"+ea),a.substr(v-64,128+(n?n.length:0)))}function e(){2===(q[2]&6)&&(q[2]|=4,d+="H._c=(H,$)=>{")}function h(n,W){I||(d+='H.push(W=L("'+n[0][0]+ | ||
'"));W[0]='+JSON.stringify(n[W])+";")}var g=b&4;const w=g?"async ":"";var m=g?"await ":"",d="("+w+'$=>{"use strict";var I,W,_,H=N($);',I=g=0;const qa="w,v="+w+"()=>{"+m+"w();",Ea=")};w=("+w+"W=>{",Fa="});"+m+"v()}",Xa=m+"X(J,H,$)";m="do{if((k=Y(H))===m)break;H="+m+"E(m=k,$"+(b?","+b:"")+")}while(--n);J.push.apply(J,H)}";for(var z,q=[0,{},4,""],ca=[q],v=0;;){var r,f="";if(v>=a.length){var t=q[0];if(t){c(t,"Missing </"+t+">");a+="</"+t+">";continue}break}a:switch(a[v]){case "<":var x=function(){return l("var")|| | ||
l("variable")};t=function(){r=aa(la,a);r[1]?c(0,'Skipping malformed parameter "'+r[1]+'"'):r||c(0,"Parse error");return H=r[2]};var fa=function(p,ea){var ba=l("mkmapping");if(ba){let Ha=Ga(ba);for(d+=p;ba=Ha.pop();)d+=ea+Aa(ba)+"=k["+Ha.length+"];"}else if(""===ba)return 1},Ga=function(p){return p.slice(1,-1).split(Ya)},l=function(p){return(p=n[p])&&Ba(p)};ra.lastIndex=++v;if(r=aa(ra,a)){v=ra.lastIndex;I||(r[1]?h(r,1):r[2]?(r[0]="<",h(r,2)):(sa.lastIndex=0,aa(sa,f=r[3])?"n"===f[0]&&(d+="H.push("+ | ||
JSON.stringify(f.slice(sa.lastIndex))+");"):h(r,3)));break}let n={};var H;la.lastIndex=v;if("/"===t())n[H]=1,t();else if(!H){r&&(v=la.lastIndex);break a}for(n[""]=H;;){if(!t()){r&&(v=la.lastIndex);break}n[H]=r[3]?r[3].slice(1,-1):H}let W=n["/"];delete n["/"];t=n[""];if(1!==W){do{ca.push(q=[t,n,0,d]);d="";n["-"]&&(delete n["-"],q[2]=1);switch(t){case "noparse":if(!g++)continue;break;case "comment":g||I++}if(!I){delete n[""];d+="W=H;";if(!g)switch(t){case "set":d+="{let H=L(),";var k=x();z=0;if(k){var u= | ||
l("expr");d+=qa;q[2]|=16;z=d.length;if(f=l("selector"))d+="B($,w=L(),H,"+f+");H=w;";else{void 0!==n.json&&(d+="H=JSON.parse(Y(H));");if(f=l("split"))d+="H=Y(H).split("+(da(u)||f)+");",u=void 0;void 0!==u&&(d+="H="+(da(u)||"(_=$._,"+ja("eval(Y(H))")+")")+";");if(f=l("join"))d+="H=H.join("+f+");";fa("let k=H[0];H={};","H")}d.length!==z&&(z=0);k=ia(k,1);Array.isArray(k)?d+=k[0]+"=A("+(void 0!==n.clone?(z=0,"O(H,"+k[0]+")"):"H"):(z=0,d+="A(H,$,"+k);d+=Ea}else if(f=l("tag")){e();d+="v=0;Q("+f+",$,"+w+ | ||
"(H,a,$,W)=>{$=C(a,$,{";(f=l("args"))&&(f=f.replace(Za,""))&&(d+='"'+f.replace(wa,'":1,"')+'":1');d+="}";if(f=l("scope"))d+=","+f;d+=");"}continue;case "insert":if(u=x()){k=function(){p&&(d+="let x="+p+";",p=0)};let p=pa(u,l("quote"),l("format"));d+="try{";if(f=l("join"))k(),d+="x=x.join?x.join("+f+"):x;";u=l("limit");if((f=l("offset"))||void 0!==u)k(),d+="x=F(x,"+f+(void 0!==u?","+u:"")+");";d+="I=K($,H,"+(p||"x")+")}catch(x){I=0}"}else if(void 0!==(u=l("expr")))d+="{let H=L(),"+qa+("H="+(da(u)|| | ||
"(_=$._,"+ja("eval(Y(H))")+")")+";W.push(A(H)")+Ea,q[2]|=8;else switch(l("variables")){case "dump":d+="log((W="+l("scope")+")?$[W]:$);"}continue;case "replace":k=l("flags");void 0===k&&(k="g");d+="{let H=L(),J=W,v=P("+(l("regexp")||l("from").replace($a,"\\$1"))+","+JSON.stringify(k)+","+(da(l("expr"))||l("to"))+");";continue;case "trim":d+="{let H=L(),J=W;";continue;case "maketag":d+="{let H=L("+l("name")+"),J=W;";continue;case "cache":d+="{let v,J=W,H,g="+(l("ttl")||0)+";";k="v=["+(l("shared")|| | ||
++ab);var ha=l("key");u="";if(!ha&&(ha=x())){ha=Ga(ha);k="_=$._;try{"+k;u="}catch(e){v=0}";let p;for(p of ha)k+=","+pa(p,'"json"')}else k+=","+(ha||0),u=";";d+=k+"]"+u+"H=CG(v);if(!H){H=L();";continue;case "attrib":d+="{let H=L(),v="+l("name")+",J=W;";continue;case "for":d+="{I=0;let g,i,k,m,J=W,n=0;";d=(k=l("in"))?d+("g=G($,"+ia(k)+((f=l("orderby"))?",(m=$._,_=>{let _index=_[0];$._=_=_[1];return["+da(f)+"]}));$._=m":")")+";while(!(m=g.next()).done){k=(m=m.value)[1];i=m[0];W=S({_value:k,"):d+("for(i=+"+ | ||
(l("from")||0)+",m="+((k=l("step"))?"+("+k+"||1)":1)+",k=+"+(l("to")||0)+";m<0?i>=k:i<=k;i+=m){W=S({");d+="_recno:++n,_index:i});let o=$;$=C(W,$,{}";if(f=l("scope"))d+=","+f;d+=");";1===fa("k=(m=$._)._value;","m")&&(d+="M($._,$._._value);");continue;case "eval":d+="{let H=L(),n="+(void 0===(f=l("recurse"))?1:0<f?+f:0)+",J=W,k,m=0;";continue;case "unset":if(f=l("tag"))k=function(p){p="._._tag"+p;d+="$"+p+"=$._._&&$._"+p+";"},e(),u=ia(f,1),Array.isArray(u)?k(u[0].slice(1)):(d+="{let v="+u+";",k("[v]"), | ||
d+="}");else if(f=x())k=ia(f,1),d+=Array.isArray(k)?"delete "+k[0]+";":'eval("delete $."+'+k+");";continue;case "delimiter":d+="if($._._recno>1){";continue;case "elif":f="(!I&&";case "if":d+="if"+f+"(I="+(da(l("expr"))||0)+")"+(f?")":"")+"{";continue;case "then":d+="if(I){";continue;case "else":d+="if(!I){";continue}d+="{let J=W,H=S({";(k=n["::"])&&(n["::"]=k.slice(0,-1)+":;");k="";for(H in n)if(f=l(H))d+=k+(bb.test(H)?H:'"'+H+'"')+":"+f,k=",";d+='},"'+t+'")'}if(!W&&(k="script"===t?cb:"style"===t? | ||
db:0)){k.lastIndex=v;x=aa(k,a)?k.lastIndex:a.length+3+t.length;d+=";";!I&&(f=a.slice(v,x-3-t.length))&&(d+="H[0]="+JSON.stringify(f)+";");v=x;W=1;break}I||(d+=";",q[2]|=2)}while(0)}if(W)for(;;){q=ca.pop();x=q[0];fa=0;if(t!==x){c(t,(x?"Expected </"+x+"> got </":"Missing <")+t+">");for(f=ca.length;f;)if(ca[--f][0]===t){fa=1;break}if(!fa){ca.push(q);break}}b:do{switch(x){case "noparse":if(!--g)break b;break;case "comment":if(!g){I--;break b}break;case 0:break b}if(!I)if(g)d+="J.push(H)}";else{c:do switch(x){case "set":if("{"!== | ||
d.slice(-1)&&z){f=d.slice(z).match(eb);d=d.slice(0,z-11-qa.length)+f[1]+f[2]+";";break c}d+=q[2]&16?Fa:"})}";break;case "insert":q[2]&8&&(d+=Fa);break;case "replace":d+="J.push.apply(J,R(H,v))}";break;case "trim":d+="J.push.apply(J,U(R(H)))}";break;case "maketag":d+="J.push(H)}";break;case "cache":d+="CS(v,H,g)}J.push(H)}";continue;case "attrib":d+="V(H,v,J)}";case "unset":break c;case "for":d+="$=o;I=1}}";break;case "if":case "then":case "elif":case "else":d+="I=1}";break c;case "eval":d+=m;break; | ||
case "nooutput":d+="J=[];";default:q[2]&4&&(d+="};");case "script":case "style":d+=Xa;case "delimiter":d+="}"}while(0);z=0}}while(0);d=q[3]+d;if(!fa){q=ca[ca.length-1];break}}break;case "&":ta.lastIndex=++v;if(!g&&(r=aa(ta,a))){v=ta.lastIndex;I||(d+="try{I=K($,H,"+(Da(r)+")}catch(x){I=0}"),z=0);break}f="&";default:ua.lastIndex=v,(r=aa(ua,a))?(f+=r[0],v=ua.lastIndex):(c(0,"Parse error"),f+=a.substr(v),v=a.length),I||(!g&&b&1&&(f=ya(f)),!f||q[2]&1&&"0}"!==d.slice(-2)&&f.match(fb)||(d+="H.push("+JSON.stringify(f)+ | ||
");"))}}return d+="return H})"}function na(a){try{var b=eval(a)}catch(c){D(c,a),gb(a),b=()=>""}return b}function aa(a,b){return a.exec(b)}const hb=("object"==typeof document?document:null)&&window,y=Object,Na={" ":"+","\t":"%09","\n":"%0A","\r":"%0D",'"':"%22","#":"%23","%":"%25","&":"%26","'":"%27","+":"%2B","<":"%3C","?":"%3F"},ib=/[ \t\n\r#%&'"+<?]/g,Pa={"&":"&","<":"<"},jb=/[&<]/g,wa=/\s*,\s*/g,Ya=/\s*,\s*/,Ca=RegExp("(?:[^&]+|(?:&(?:\\w*;|[\\w$:.[\\]]+(?=[^%;\\w$:.[\\]])|(?=[^\\w$:.[\\]]))[^&]*))+|&([\\w$]+(?:[.[][\\w$]+]?)*\\.[\\w$]+)(?::([\\w$]*))?(?:%([^;]*))?;", | ||
"y"),ta=/([\w$]+\.[\w$]+(?:[.[][\w$]+]?)*)(?::([\w$]*))?(?:%([^;]*))?;/y,ra=/!(?:--(.*?)(?:--|$)|([^-].*?))(?:>|$)|\?(.*?)(?:\?>|$)/ys,sa=/(?:noparse|comment)\s/y,ua=RegExp("[^&<]+(?:&(?:\\w*;|[\\w$:.[\\]]+(?=[^%;\\w$:.[\\]])|(?=[^\\w$:.[\\]]))[^&<]*)*","y"),la=/\s*((?:[^-:_a-zA-Z<&>\s\/]\s*)*)(?:([-:_a-zA-Z][-:\w]*|\/)\s*(?:=\s*("[^"]*"|'[^']*'))?|[<&>])/y,bb=/^[_a-zA-Z]\w*$/,cb=/<\/script>/g,db=/<\/style>/g,Sa=/^"([^(+]+)"$/,Ua=/^[A-Za-z_][\w]*$/,Va=/\n/g,Wa=/[^\n]*$/,eb=/([^=]+=).+(".*")/,fb=/^\s+$/, | ||
Ta=/\s\s+/g,kb=/</g,Za=/[^-:\w,]+/g,$a=/([\\^$*+?.|()[{])/g,lb=/"/g,mb=/[.[\]]+/,Ia={},J=new Map;var ab=0,va,gb=console.debug,Ja=console.error,Ka,La;M=(a,b)=>{try{y.assign(a,b)}catch(c){}};D=(a,b)=>Ja("Remixml expression: "+(b?JSON.stringify(b):"")+"\n",a);E=(a,b,c)=>xa(a,c)(b);P=(a,b,c)=>e=>(Array.isArray(e)?e.join(", "):e).replace(RegExp(a,b),c);CG=a=>{if(a){a=a.join("\u0001");var b=J.get(a);if(b){let c=Date.now();J.delete(a);if(b[1]>c)return J.set(a,b),O(b[0])}}};CS=(a,b,c)=>{if(a){var e=Date.now(), | ||
h=J.size;if(La--||Ka<e||1024<h){Ka=e+256;La=32;let w=Array.from(J.keys()),m=0;for(1024<=h&&(h=1023);m<h;){var g=m+h>>1;J.get(w[g])[1]>e?h=g:m=g}for(h=J.size;m<h;)g=w[m++],(1024<=m||J.get(g)[1]>e)&&J.delete(g)}J.set(a.join("\u0001"),[b,e+(c||32768)])}};U=a=>{var b;ka(b=a[0])&&" "===b[0]&&!(a[0]=b.substr(1))&&a.splice(0,1);var c=a.length-1;ka(b=a[c])&&" "===b.slice(-1)&&!(a[c]=b.slice(0,-1))&&a.splice(c,1);return a};F=(a,b,c)=>(b=+(b||0),c=+c,0>c?a.slice(b,c):0<c?a.slice(b,b+c):0==c?a.slice(b):""); | ||
R=(a,b)=>{for(var c,e=a.length,h=b||ya;e--;){switch((c=a[e])[""]){case "!":case "<":case "?":if(!b)break;default:R(c,b);continue;case void 0:if(a[e]=h(c))continue}a.splice(e,1)}return a};S=(a,b)=>{b=L(b);y.assign(b,a);delete b["::"];(a=a["::"])&&y.assign(b,a);return b};L=a=>{var b=[];b[""]=a||1;return b};N=a=>{var b=a._;b||(a._=b={});b._tag||(b._tag={});!a["var"]&&a.__&&(a["var"]=a.__);return L()};C=(a,b,c,e)=>{if(1!==a[""])if(za(a,"_contents",()=>{let g=a._c;g?g(a.slice(),b):a[""]=1;return a}),c)za(a, | ||
"_restargs",function(){var g,w={};for(g in this)switch(g[0]){default:0<=g||c[g]||(w[g]=this[g]);case "_":case void 0:}return w});else return a;var h;(h=y.assign({},b))._=y.assign(a,{_:b._,_tag:y.assign({},b._._tag)});e&&(h[e]=a);return h};V=(a,b,c)=>{void 0===c[b]&&(c[b]=1!==a.length||a[0][""]?a.length?a:"":a[0])};X=(a,b,c)=>{var e=c._._tag[b[""]];if(e)return e(a,b,c);if(e=b._c)delete b._c,e(b,c);a.push(b)};Q=(a,b,c)=>b._._tag[a]=c;G=(a,b,c)=>{if((b=(b=Array.isArray(b)?b[0]:VE(a,b))||0)&&0<=b.size)a= | ||
b.entries();else if(a=y.entries(b),0<=b.length&&a.splice(b.length),c)try{a=a.sort((e,h)=>{var g,w;e=c(e);h=c(h);var m=0;for(g=e.length;m<g;m++){var d=0;Array.isArray(e[m])&&(d=1,e[m]=e[m][0],h[m]=h[m][0]);if(w=e[m]>h[m]||-(e[m]!==h[m]))break}return d?-w:w})}catch(e){D(e,c)}return a[Symbol.iterator]()};B=(a,b,c,e)=>{for(var h=0;h<c.length;){let g=c[h++];switch(g[""]){default:B(a,b,g,e);return;case e:b.push(C(g,a));case void 0:}}};T=a=>{var b=a.split(mb),c;a="$";for(c of b)a+=Aa(c);return a};Z=(a,b, | ||
c,e)=>{b=Array.isArray(b)?b[0]:VE(a,b);null==b&&(b="");"function"===typeof b&&(b=b(a._,a));if(b[""])switch(c){case "r":case "recurse":case "":case "none":if(!e)break;default:b=Y(b)}else- -b==b&&(b+="");e&&!b[""]&&va&&(b=va(e,b,a));switch(c){case "json":b=JSON.stringify(b).replace(kb,"\\\\u003c");break;case "uric":b=b.replace(ib,Ma);break;default:b[""]||(b=Array.isArray(b)?b.join(", "):b,b=(e=Ia[c])?e(b):b.replace(jb,Oa));case "":case "none":case "r":case "recurse":}switch(b.length){case 0:b="";break; | ||
case 1:1===b[""]&&(b=b[0])}if("r"===c)for(c="";b!==c&&b.includes("&");)c=b,b=VE(a,["("+Ba(b)+")"]);return b};O=(a,b)=>{var c;if(b)for(c in b)delete b[c];else b=[];Array.isArray(a)||(a.length=0);b=y.assign(b,a);for(c=b.length;c--;)b[c][""]&&(b[c]=O(b[c]));return b};K=(a,b,c)=>{c[""]?(1===c[""]?b.push.apply(b,O(c)):b.push(c),c=1):c||void 0!==c&&c?(b.push(c),c=1):c=0;return c};sizeof=a=>Number(a)===a?1:a?a.length||1!==a[""]||y.keys(a).length:0;desc=a=>- -a===a?-a:[a,1];abstract2dom=(a,b)=>ma.abstract2dom(a, | ||
b);abstract2txt=Y=(a,b)=>{for(;;){switch(a[""]){case void 0:return a;case 1:switch(a.length){case 0:return"";case 1:a=a[0];continue}}break}var c,e=a[""];switch(e){case "!":return"\x3c!--"+a[0]+"--\x3e";case "<":return"<!"+a[0]+">";case "?":return"<?"+a[0]+"?>";case 1:e=c="";break;default:c="<"+e;for(var h of y.keys(a).splice(a.length))switch(h[0]){default:var g=a[h];null!=g&&(g[""]&&(g=g.join("")),c+=" "+h,h!==g&&(c+='="'+(g.replace?g.replace(lb,"&dquot;"):g)+'"'));case "_":case void 0:}if(!a.length)return c+ | ||
(b&&"br"!==e?"></"+e+">":"/>");c+=">"}for(g=0;void 0!==(h=a[g++]);)c+=h[""]?Y(h,b):h;e&&(c+="</"+e+">");return c};const ma={remixml2js:oa,js2obj:na,compile:xa,parse2txt:(a,b,c)=>{ka(a)&&(a=na(oa(a,c)));return Y(a(b))},abstract2txt:Y,add_filter:(a,b)=>Ia[a]=b,set_proc_fmt:a=>va=a,set_tag:(a,b,c,e,h)=>(N(b),Ra(a,b,c,e,h)),set_log_callback:a=>Ja=a};"function"==typeof define&&define.amd?define("remixml",[],ma):"object"==typeof exports?y.assign(exports,ma):hb.Remixml=ma}).call(this); | ||
'use strict';(()=>{function la(a){return"string"===typeof a}function Pa(a){return Qa[a]}function Ra(a){return Sa[a]}function Ta(a,b){a[b]=1;return a}function Ua(a,b,c,e,g){b._._tag[c]=(h,v,m)=>{delete v[""];m=C(v,m,g?g.split(ya).reduce(Ta,{}):{},e);return a(m)}}function ja(a,b){var c=a.match(Va);return c?(a=T(c[1]),b?[a]:"["+a+"]"):a}function za(a,b){return pa(qa(a,b))}function Aa(a){return a.replace(Wa," ")}function Ba(a,b,c){y.defineProperty(a,b,{get:c,configurable:!0})}function Ca(a){return a.match(Xa)? | ||
"."+a:'["'+a+'"]'}function Da(a,b){var c;if(b)for(c in b)delete b[c];else b=[];Array.isArray(a)||(a.length=0);return y.assign(b,a)}function ka(a,b){return"(()=>{try{return "+a+"}catch(x){"+(b?"":"D(x)")+'}return ""})()'}function Ea(a){var b="",c="",e;for(Fa.lastIndex=0;e=ba(Fa,a);)b=e[1]?b+(c+ka(Ga(e),1)):b+(c+JSON.stringify(e[0])),c="+";return b}function ra(a,b,c){a="Z($,"+ja(a);b&&(a+=","+b);c&&(b||(a+=",0"),a+=","+c);return a+")"}function Ga(a){var b=a[2],c=a[3];return ra(JSON.stringify(a[1]), | ||
la(b)&&JSON.stringify(b),c&&JSON.stringify(c))}function ea(a){a&&(a.includes("(")?(a='"'===a.slice(-1)?'"'===a[0]?a.slice(1,-1):'"+'+a.slice(0,-1):('"'===a[0]?a.slice(1):'"+'+a)+'+"',a.includes("{")&&(a="("+a+")"),a=ka('eval("'+a+'")'),a=a.includes("_")?"(_=$._,"+a+")":a):((a=JSON.parse(a)).includes("_")&&(a="(_=$._,"+a+")"),a=ka(a)));return a}function qa(a,b){function c(n,W){var p=D,fa=a.slice(0,w),ca=(fa.match(Ya)||"").length+1;fa=fa.match(Za)[0].length+1;p(W+" at "+(ca+":"+fa),a.substr(w-64,128+ | ||
(n?n.length:0)))}function e(){2===(q[2]&6)&&(q[2]|=4,d+="H._c=(H,$)=>{")}function g(n,W){I||(d+='H.push(W=L("'+n[0][0]+'"));W[0]='+JSON.stringify(n[W])+";")}var h=b&4;const v=h?"async ":"";var m=h?"await ":"";const ma=h?"await OA":"O";h=h?'"\u0002"+':"";var d="("+v+'$=>{"use strict";var I,W,_,H=N($);',aa=0,I=0;const sa="w,v="+v+"()=>{"+m+"w();",Ha=")};w=("+v+"W=>{",Ia="});"+m+"v()}",$a=m+"X(J,H,$)";m="do{if((k=Y(H))===m)break;H="+m+"E(m=k,$"+(b?","+b:"")+")}while(--n);J.push.apply(J,H)}";for(var z, | ||
q=[0,{},4,""],da=[q],w=0;;){var r,f="";if(w>=a.length){var t=q[0];if(t){c(t,"Missing </"+t+">");a+="</"+t+">";continue}break}a:switch(a[w]){case "<":var x=function(){return l("var")||l("variable")};t=function(){r=ba(na,a);r[1]?c(0,'Skipping malformed parameter "'+r[1]+'"'):r||c(0,"Parse error");return H=r[2]};var ha=function(p,fa){var ca=l("mkmapping");if(ca){let Ka=Ja(ca);for(d+=p;ca=Ka.pop();)d+=fa+Ca(ca)+"=k["+Ka.length+"];"}else if(""===ca)return 1},Ja=function(p){return p.slice(1,-1).split(ab)}, | ||
l=function(p){return(p=n[p])&&Ea(p)};ta.lastIndex=++w;if(r=ba(ta,a)){w=ta.lastIndex;I||(r[1]?g(r,1):r[2]?(r[0]="<",g(r,2)):(ua.lastIndex=0,ba(ua,f=r[3])?"n"===f[0]&&(d+="H.push("+JSON.stringify(f.slice(ua.lastIndex))+");"):g(r,3)));break}let n={};var H;na.lastIndex=w;if("/"===t())n[H]=1,t();else if(!H){r&&(w=na.lastIndex);break a}for(n[""]=H;;){if(!t()){r&&(w=na.lastIndex);break}n[H]=r[3]?r[3].slice(1,-1):H}let W=n["/"];delete n["/"];t=n[""];if(1!==W){do{da.push(q=[t,n,0,d]);d="";n["-"]&&(delete n["-"], | ||
q[2]=1);switch(t){case "noparse":if(!aa++)continue;break;case "comment":aa||I++}if(!I){delete n[""];d+="W=H;";if(!aa)switch(t){case "set":d+="{let H=L(),";var k=x();z=0;if(k){var u=l("expr");d+=sa;q[2]|=16;z=d.length;if(f=l("selector"))d+="B($,w=L(),H,"+f+");H=w;";else{void 0!==n.json&&(d+="H=JSON.parse(Y(H));");if(f=l("split"))d+="H=Y(H).split("+(ea(u)||f)+");",u=void 0;void 0!==u&&(d+="H="+(ea(u)||"(_=$._,"+ka("eval(Y(H))")+")")+";");if(f=l("join"))d+="H=H.join("+f+");";ha("let k=H[0];H={};","H")}d.length!== | ||
z&&(z=0);k=ja(k,1);Array.isArray(k)?d+=k[0]+"=A("+(void 0!==n.clone?(z=0,"O(H,"+k[0]+")"):"H"):(z=0,d+="A(H,$,"+k);d+=Ha}else if(f=l("tag")){e();d+="v=0;Q("+f+",$,"+v+"(H,a,$,W)=>{$=C(a,$,{";(f=l("args"))&&(f=f.replace(bb,""))&&(d+='"'+f.replace(ya,'":1,"')+'":1');d+="}";if(f=l("scope"))d+=","+f;d+=");"}continue;case "insert":if(u=x()){k=function(){p&&(d+="let x="+p+";",p=0)};let p=ra(u,l("quote"),l("format"));d+="try{";if(f=l("join"))k(),d+="x=x.join?x.join("+f+"):x;";u=l("limit");if((f=l("offset"))|| | ||
void 0!==u)k(),d+="x=F(x,"+f+(void 0!==u?","+u:"")+");";d+="I=K($,H,"+(p||"x")+")}catch(x){I=0}"}else if(void 0!==(u=l("expr")))d+="{let H=L(),"+sa+("H="+(ea(u)||"(_=$._,"+ka("eval(Y(H))")+")")+";W.push(A(H)")+Ha,q[2]|=8;else switch(l("variables")){case "dump":d+="log((W="+l("scope")+")?$[W]:$);"}continue;case "replace":k=l("flags");void 0===k&&(k="g");d+="{let H=L(),J=W,v=P("+(l("regexp")||l("from").replace(cb,"\\$1"))+","+JSON.stringify(k)+","+(ea(l("expr"))||l("to"))+");";continue;case "trim":d+= | ||
"{let H=L(),J=W;";continue;case "maketag":d+="{let H=L("+l("name")+"),J=W;";continue;case "cache":d+="{let v,J=W,H,g="+(l("ttl")||0)+";";k="v=["+h+(l("shared")||++db);var ia=l("key");u="";if(!ia&&(ia=x())){ia=Ja(ia);k="_=$._;try{"+k;u="}catch(e){v=0}";let p;for(p of ia)k+=","+ra(p,'"json"')}else k+=","+(ia||0),u=";";d+=k+"]"+u+"H=CG(v);if(!H){H=L();";continue;case "nocache":d+="W.push("+v+"(H,$,W)=>{";continue;case "attrib":d+="{let H=L(),v="+l("name")+",J=W;";continue;case "for":d+="{I=0;let g,i,k,m,J=W,n=0;"; | ||
d=(k=l("in"))?d+("g=G($,"+ja(k)+((f=l("orderby"))?",(m=$._,_=>{let _index=_[0];$._=_=_[1];return["+ea(f)+"]}));$._=m":")")+";while(!(m=g.next()).done){k=(m=m.value)[1];i=m[0];W=S({_value:k,"):d+("for(i=+"+(l("from")||0)+",m="+((k=l("step"))?"+("+k+"||1)":1)+",k=+"+(l("to")||0)+";m<0?i>=k:i<=k;i+=m){W=S({");d+="_recno:++n,_index:i});let o=$;$=C(W,$,{}";if(f=l("scope"))d+=","+f;d+=");";1===ha("k=(m=$._)._value;","m")&&(d+="M($._,$._._value);");continue;case "eval":d+="{let H=L(),n="+(void 0===(f=l("recurse"))? | ||
1:0<f?+f:0)+",J=W,k,m=0;";continue;case "unset":if(f=l("tag"))k=function(p){p="._._tag"+p;d+="$"+p+"=$._._&&$._"+p+";"},e(),u=ja(f,1),Array.isArray(u)?k(u[0].slice(1)):(d+="{let v="+u+";",k("[v]"),d+="}");else if(f=x())k=ja(f,1),d+=Array.isArray(k)?"delete "+k[0]+";":'eval("delete $."+'+k+");";continue;case "delimiter":d+="if($._._recno>1){";continue;case "elif":f="(!I&&";case "if":d+="if"+f+"(I="+(ea(l("expr"))||0)+")"+(f?")":"")+"{";continue;case "then":d+="if(I){";continue;case "else":d+="if(!I){"; | ||
continue}d+="{let J=W,H=S({";(k=n["::"])&&(n["::"]=k.slice(0,-1)+":;");k="";for(H in n)if(f=l(H))d+=k+(eb.test(H)?H:'"'+H+'"')+":"+f,k=",";d+='},"'+t+'")'}if(!W&&(k="script"===t?fb:"style"===t?gb:0)){k.lastIndex=w;x=ba(k,a)?k.lastIndex:a.length+3+t.length;d+=";";!I&&(f=a.slice(w,x-3-t.length))&&(d+="H[0]="+JSON.stringify(f)+";");w=x;W=1;break}I||(d+=";",q[2]|=2)}while(0)}if(W)for(;;){q=da.pop();x=q[0];ha=0;if(t!==x){c(t,(x?"Expected </"+x+"> got </":"Missing <")+t+">");for(f=da.length;f;)if(da[--f][0]=== | ||
t){ha=1;break}if(!ha){da.push(q);break}}b:do{switch(x){case "noparse":if(!--aa)break b;break;case "comment":if(!aa){I--;break b}break;case 0:break b}if(!I)if(aa)d+="J.push(H)}";else{c:do switch(x){case "set":if("{"!==d.slice(-1)&&z){f=d.slice(z).match(hb);d=d.slice(0,z-11-sa.length)+f[1]+f[2]+";";break c}d+=q[2]&16?Ia:"})}";break;case "insert":q[2]&8&&(d+=Ia);break;case "replace":d+="J.push.apply(J,R(H,v))}";break;case "trim":d+="J.push.apply(J,U(R(H)))}";break;case "maketag":d+="J.push(H)}";break; | ||
case "cache":d+="H=CS(v,H,g)}H="+ma+"(H,0,$);J.push(H)}";break;case "nocache":d+="});";break;case "attrib":d+="V(H,v,J)}";case "unset":break c;case "for":d+="$=o;I=1}}";break;case "if":case "then":case "elif":case "else":d+="I=1}";break c;case "eval":d+=m;break;case "nooutput":d+="J=[];";default:q[2]&4&&(d+="};");case "script":case "style":d+=$a;case "delimiter":d+="}"}while(0);z=0}}while(0);d=q[3]+d;if(!ha){q=da[da.length-1];break}}break;case "&":va.lastIndex=++w;if(!aa&&(r=ba(va,a))){w=va.lastIndex; | ||
I||(d+="try{I=K($,H,"+(Ga(r)+")}catch(x){I=0}"),z=0);break}f="&";default:wa.lastIndex=w,(r=ba(wa,a))?(f+=r[0],w=wa.lastIndex):(c(0,"Parse error"),f+=a.substr(w),w=a.length),I||(!aa&&b&1&&(f=Aa(f)),!f||q[2]&1&&"0}"!==d.slice(-2)&&f.match(ib)||(d+="H.push("+JSON.stringify(f)+");"))}}return d+="return H})"}function pa(a){try{var b=eval(a)}catch(c){D(c,a),jb(a),b=()=>""}return b}function ba(a,b){return a.exec(b)}const kb=("object"==typeof document?document:null)&&window,y=Object,Qa={" ":"+","\t":"%09", | ||
"\n":"%0A","\r":"%0D",'"':"%22","#":"%23","%":"%25","&":"%26","'":"%27","+":"%2B","<":"%3C","?":"%3F"},lb=/[ \t\n\r#%&'"+<?]/g,Sa={"&":"&","<":"<"},mb=/[&<]/g,ya=/\s*,\s*/g,ab=/\s*,\s*/,Fa=RegExp("(?:[^&]+|(?:&(?:\\w*;|[\\w$:.[\\]]+(?=[^%;\\w$:.[\\]])|(?=[^\\w$:.[\\]]))[^&]*))+|&([\\w$]+(?:[.[][\\w$]+]?)*\\.[\\w$]+)(?::([\\w$]*))?(?:%([^;]*))?;","y"),va=/([\w$]+\.[\w$]+(?:[.[][\w$]+]?)*)(?::([\w$]*))?(?:%([^;]*))?;/y,ta=/!(?:--(.*?)(?:--|$)|([^-].*?))(?:>|$)|\?(.*?)(?:\?>|$)/ys,ua=/(?:noparse|comment)\s/y, | ||
wa=RegExp("[^&<]+(?:&(?:\\w*;|[\\w$:.[\\]]+(?=[^%;\\w$:.[\\]])|(?=[^\\w$:.[\\]]))[^&<]*)*","y"),na=/\s*((?:[^-:_a-zA-Z<&>\s\/]\s*)*)(?:([-:_a-zA-Z][-:\w]*|\/)\s*(?:=\s*("[^"]*"|'[^']*'))?|[<&>])/y,eb=/^[_a-zA-Z]\w*$/,fb=/<\/script>/g,gb=/<\/style>/g,Va=/^"([^(+]+)"$/,Xa=/^[A-Za-z_][\w]*$/,Ya=/\n/g,Za=/[^\n]*$/,hb=/([^=]+=).+(".*")/,ib=/^\s+$/,Wa=/\s\s+/g,nb=/</g,bb=/[^-:\w,]+/g,cb=/([\\^$*+?.|()[{])/g,ob=/"/g,pb=/[.[\]]+/,La={},J=new Map;var db=0,xa,jb=console.debug,Ma=console.error,Na,Oa;M=(a,b)=> | ||
{try{y.assign(a,b)}catch(c){}};D=(a,b)=>Ma("Remixml expression: "+(b?JSON.stringify(b):"")+"\n",a);E=(a,b,c)=>za(a,c)(b);P=(a,b,c)=>e=>(Array.isArray(e)?e.join(", "):e).replace(RegExp(a,b),c);CG=a=>{if(a){a=a.join("\u0001");var b=J.get(a);if(b){let c=Date.now();J.delete(a);if(b[1]>c)return J.set(a,b),b[0]}}};CS=(a,b,c)=>{if(a){var e=Date.now(),g=J.size;if(Oa--||Na<e||1024<g){Na=e+256;Oa=32;let v=Array.from(J.keys()),m=0;for(1024<=g&&(g=1023);m<g;){var h=m+g>>1;J.get(v[h])[1]>e?g=h:m=h}for(g=J.size;m< | ||
g;)h=v[m++],(1024<=m||J.get(h)[1]>e)&&J.delete(h)}J.set(a.join("\u0001"),[b,e+(c||32768)])}return b};U=a=>{var b;la(b=a[0])&&" "===b[0]&&!(a[0]=b.substr(1))&&a.splice(0,1);var c=a.length-1;la(b=a[c])&&" "===b.slice(-1)&&!(a[c]=b.slice(0,-1))&&a.splice(c,1);return a};F=(a,b,c)=>(b=+(b||0),c=+c,0>c?a.slice(b,c):0<c?a.slice(b,b+c):0==c?a.slice(b):"");R=(a,b)=>{for(var c,e=a.length,g=b||Aa;e--;){switch((c=a[e])[""]){case "!":case "<":case "?":if(!b)break;default:R(c,b);continue;case void 0:if(a[e]=g(c))continue}a.splice(e, | ||
1)}return a};S=(a,b)=>{b=L(b);y.assign(b,a);delete b["::"];(a=a["::"])&&y.assign(b,a);return b};L=a=>{var b=[];b[""]=a||1;return b};N=a=>{var b=a._;b||(a._=b={});b._tag||(b._tag={});!a["var"]&&a.__&&(a["var"]=a.__);return L()};C=(a,b,c,e)=>{if(1!==a[""])if(Ba(a,"_contents",()=>{let h=a._c;h?h(a.slice(),b):a[""]=1;return a}),c)Ba(a,"_restargs",function(){var h,v={};for(h in this)switch(h[0]){default:0<=h||c[h]||(v[h]=this[h]);case "_":case void 0:}return v});else return a;var g;(g=y.assign({},b))._= | ||
y.assign(a,{_:b._,_tag:y.assign({},b._._tag)});e&&(g[e]=a);return g};V=(a,b,c)=>{void 0===c[b]&&(c[b]=1!==a.length||a[0][""]?a.length?a:"":a[0])};X=(a,b,c)=>{var e=c._._tag[b[""]];if(e)return e(a,b,c);if(e=b._c)delete b._c,e(b,c);a.push(b)};Q=(a,b,c)=>b._._tag[a]=c;G=(a,b,c)=>{if((b=(b=Array.isArray(b)?b[0]:VE(a,b))||0)&&0<=b.size)a=b.entries();else if(a=y.entries(b),0<=b.length&&a.splice(b.length),c)try{a=a.sort((e,g)=>{var h,v;e=c(e);g=c(g);var m=0;for(h=e.length;m<h;m++){var ma=0;Array.isArray(e[m])&& | ||
(ma=1,e[m]=e[m][0],g[m]=g[m][0]);if(v=e[m]>g[m]||-(e[m]!==g[m]))break}return ma?-v:v})}catch(e){D(e,c)}return a[Symbol.iterator]()};B=(a,b,c,e)=>{for(var g=0;g<c.length;){let h=c[g++];switch(h[""]){default:B(a,b,h,e);return;case e:b.push(C(h,a));case void 0:}}};T=a=>{var b=a.split(pb),c;a="$";for(c of b)a+=Ca(c);return a};Z=(a,b,c,e)=>{b=Array.isArray(b)?b[0]:VE(a,b);null==b&&(b="");"function"===typeof b&&(b=b(a._,a));if(b[""])switch(c){case "r":case "recurse":case "":case "none":if(!e)break;default:b= | ||
Y(b)}else- -b==b&&(b+="");e&&!b[""]&&xa&&(b=xa(e,b,a));switch(c){case "json":b=JSON.stringify(b).replace(nb,"\\\\u003c");break;case "uric":b=b.replace(lb,Pa);break;default:b[""]||(b=Array.isArray(b)?b.join(", "):b,b=(e=La[c])?e(b):b.replace(mb,Ra));case "":case "none":case "r":case "recurse":}switch(b.length){case 0:b="";break;case 1:1===b[""]&&(b=b[0])}if("r"===c)for(c="";b!==c&&b.includes("&");)c=b,b=VE(a,["("+Ea(b)+")"]);return b};O=(a,b,c)=>{b=Da(a,b);for(a=b.length;a--;){let e=b[a];if(e[""])b[a]= | ||
O(e,0,c);else if("function"===typeof e){let g=[a,1];e(g,c);Array.prototype.splice.apply(b,g)}}return b};OA=async(a,b,c)=>{b=Da(a,b);for(a=b.length;a--;){let e=b[a];if(e[""])b[a]=await OA(e,0,c);else if("function"===typeof e){let g=[a,1];await e(g,c);Array.prototype.splice.apply(b,g)}}return b};K=(a,b,c)=>{c[""]?(1===c[""]?b.push.apply(b,O(c)):b.push(c),c=1):c||void 0!==c&&c?(b.push(c),c=1):c=0;return c};sizeof=a=>Number(a)===a?1:a?a.length||1!==a[""]||y.keys(a).length:0;desc=a=>- -a===a?-a:[a,1]; | ||
abstract2dom=(a,b)=>oa.abstract2dom(a,b);abstract2txt=Y=(a,b)=>{for(;;){switch(a[""]){case void 0:return a;case 1:switch(a.length){case 0:return"";case 1:a=a[0];continue}}break}var c,e=a[""];switch(e){case "!":return"\x3c!--"+a[0]+"--\x3e";case "<":return"<!"+a[0]+">";case "?":return"<?"+a[0]+"?>";case 1:e=c="";break;default:c="<"+e;for(var g of y.keys(a).splice(a.length))switch(g[0]){default:var h=a[g];null!=h&&(h[""]&&(h=h.join("")),c+=" "+g,g!==h&&(c+='="'+(h.replace?h.replace(ob,"&dquot;"):h)+ | ||
'"'));case "_":case void 0:}if(!a.length)return c+(b&&"br"!==e?"></"+e+">":"/>");c+=">"}for(h=0;void 0!==(g=a[h++]);)c+=g[""]?Y(g,b):g;e&&(c+="</"+e+">");return c};const oa={remixml2js:qa,js2obj:pa,compile:za,parse2txt:(a,b,c)=>{la(a)&&(a=pa(qa(a,c)));return Y(a(b))},abstract2txt:Y,add_filter:(a,b)=>La[a]=b,set_proc_fmt:a=>xa=a,set_tag:(a,b,c,e,g)=>(N(b),Ua(a,b,c,e,g)),set_log_callback:a=>Ma=a};"function"==typeof define&&define.amd?define("remixml",[],oa):"object"==typeof exports?y.assign(exports, | ||
oa):kb.Remixml=oa}).call(this); | ||
}).call(this); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
579776
7347
568