Comparing version 6.1.4 to 6.1.5
{ | ||
"name": "remixml", | ||
"version": "6.1.4", | ||
"version": "6.1.5", | ||
"description": "XML/HTML-like macro language/template compiler engine", | ||
@@ -5,0 +5,0 @@ "main": "remixml.min.js", |
@@ -38,3 +38,2 @@ /** @license | ||
const /** string */ varinsert = "I=K($,H,x)}catch(x){I=0}"; | ||
const /** string */ cfnprefix = "H._c=(H,$)=>{"; | ||
@@ -97,2 +96,6 @@ const /** string */ letHprefix = "{let H=L(),"; | ||
function /** string */ varinsert(/** string */ s) | ||
{ return "I=K($,H," + s + ")}catch(x){I=0}"; | ||
} | ||
M = /** void */(/** !Object */ dst, /** !Object */ src) => | ||
@@ -442,4 +445,4 @@ { try | ||
{ if (a5[1]) | ||
{ obj += sep + "(()=>{" + varent(a5) | ||
+ 'return x}catch(x){}return ""})()'; | ||
{ obj += sep + "(()=>{try{return " + varent(a5) | ||
+ '}catch(x){}return ""})()'; | ||
} else | ||
@@ -454,3 +457,3 @@ obj += sep + JSON.stringify(a5[0]); | ||
/** string|boolean|undefined */ quot,/** string|undefined */ fmt) | ||
{ var /** string */ obj = "try{let x=Z($," + simplify(vname); | ||
{ var /** string */ obj = "Z($," + simplify(vname); | ||
if (quot) | ||
@@ -463,3 +466,3 @@ obj += "," + quot; | ||
} | ||
return obj + ");"; | ||
return obj + ")"; | ||
} | ||
@@ -737,11 +740,18 @@ | ||
if (vname) | ||
{ obj += | ||
{ let /** string|number */ vval = | ||
vareval(vname, getparm("quote"), getparm("format")); | ||
obj += "try{"; | ||
function /** void */ flushvval() { | ||
if (vval) | ||
obj += "let x=" + vval + ";", vval = 0; | ||
} | ||
if (ts = getparm("join")) | ||
obj += "x=x.join?x.join(" + ts + "):x;"; | ||
flushvval(), obj += "x=x.join?x.join(" + ts + "):x;"; | ||
vname = getparm("limit"); | ||
if ((ts = getparm("offset")) || vname !== undefined) | ||
if ((ts = getparm("offset")) || vname !== undefined) { | ||
flushvval(); | ||
obj += "x=F(x," + ts + | ||
(vname !== undefined ? "," + vname : "") + ");"; | ||
obj += varinsert; | ||
} | ||
obj += varinsert(/** @type {string} */(vval) || "x"); | ||
} else if ((vname = getparm("expr")) !== undefined) | ||
@@ -1009,3 +1019,3 @@ { obj += letHprefix + vfnprefix + execexpr(vname) | ||
if (!comment) | ||
{ obj += varent(/** @type{!Array} */(rm)) + varinsert; | ||
{ obj += "try{" + varinsert(varent(/** @type{!Array} */(rm))); | ||
simpleset = 0; | ||
@@ -1012,0 +1022,0 @@ } |
@@ -46,3 +46,2 @@ /** @license | ||
const /** string */ varinsert = "I=K($,H,x)}catch(x){I=0}"; | ||
const /** string */ cfnprefix = "H._c=(H,$)=>{"; | ||
@@ -105,2 +104,6 @@ const /** string */ letHprefix = "{let H=L(),"; | ||
function /** string */ varinsert(/** string */ s) | ||
{ return "I=K($,H," + s + ")}catch(x){I=0}"; | ||
} | ||
M = /** void */(/** !Object */ dst, /** !Object */ src) => | ||
@@ -450,4 +453,4 @@ { try | ||
{ if (a5[1]) | ||
{ obj += sep + "(()=>{" + varent(a5) | ||
+ 'return x}catch(x){}return ""})()'; | ||
{ obj += sep + "(()=>{try{return " + varent(a5) | ||
+ '}catch(x){}return ""})()'; | ||
} else | ||
@@ -462,3 +465,3 @@ obj += sep + JSON.stringify(a5[0]); | ||
/** string|boolean|undefined */ quot,/** string|undefined */ fmt) | ||
{ var /** string */ obj = "try{let x=Z($," + simplify(vname); | ||
{ var /** string */ obj = "Z($," + simplify(vname); | ||
if (quot) | ||
@@ -471,3 +474,3 @@ obj += "," + quot; | ||
} | ||
return obj + ");"; | ||
return obj + ")"; | ||
} | ||
@@ -745,11 +748,18 @@ | ||
if (vname) | ||
{ obj += | ||
{ let /** string|number */ vval = | ||
vareval(vname, getparm("quote"), getparm("format")); | ||
obj += "try{"; | ||
function /** void */ flushvval() { | ||
if (vval) | ||
obj += "let x=" + vval + ";", vval = 0; | ||
} | ||
if (ts = getparm("join")) | ||
obj += "x=x.join?x.join(" + ts + "):x;"; | ||
flushvval(), obj += "x=x.join?x.join(" + ts + "):x;"; | ||
vname = getparm("limit"); | ||
if ((ts = getparm("offset")) || vname !== undefined) | ||
if ((ts = getparm("offset")) || vname !== undefined) { | ||
flushvval(); | ||
obj += "x=F(x," + ts + | ||
(vname !== undefined ? "," + vname : "") + ");"; | ||
obj += varinsert; | ||
} | ||
obj += varinsert(/** @type {string} */(vval) || "x"); | ||
} else if ((vname = getparm("expr")) !== undefined) | ||
@@ -1017,3 +1027,3 @@ { obj += letHprefix + vfnprefix + execexpr(vname) | ||
if (!comment) | ||
{ obj += varent(/** @type{!Array} */(rm)) + varinsert; | ||
{ obj += "try{" + varinsert(varent(/** @type{!Array} */(rm))); | ||
simpleset = 0; | ||
@@ -1020,0 +1030,0 @@ } |
@@ -14,26 +14,27 @@ (function(){"use strict"; | ||
*/ | ||
'use strict';(()=>{function ea(a){return"string"===typeof a}function Ga(a){return Ha[a]}function Ia(a){return Ja[a]}function Ka(a,b){a[b]=1;return a}function La(a,b,c,e,l){b._._tag[c]=(g,u,m)=>{delete u[""];m=C(u,m,l?l.split(ta).reduce(Ka,{}):{},e);return a(m)}}function da(a,b){var c=a.match(Ma);return c?(a=T(c[1]),b?[a]:"["+a+"]"):a}function ua(a,b){return ka(la(a,b))}function va(a){return a.replace(Na," ")}function wa(a,b,c){w.defineProperty(a,b,{get:c,configurable:!0})}function xa(a){return a.match(Oa)? | ||
"."+a:'["'+a+'"]'}function ya(a){var b="",c="",e;for(za.lastIndex=0;e=aa(za,a);)b=e[1]?b+(c+"(()=>{"+Aa(e)+'return x}catch(x){}return ""})()'):b+(c+JSON.stringify(e[0])),c="+";return b}function Ba(a,b,c){a="try{let x=Z($,"+da(a);b&&(a+=","+b);c&&(b||(a+=",0"),a+=","+c);return a+");"}function Aa(a){var b=a[2],c=a[3];return Ba(JSON.stringify(a[1]),ea(b)&&JSON.stringify(b),c&&JSON.stringify(c))}function fa(a){return"(()=>{try{return "+a+'}catch(x){D(x)}return ""})()'}function ca(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=fa('eval("'+a+'")'),a=a.includes("_")?"(_=$._,"+a+")":a):((a=JSON.parse(a)).includes("_")&&(a="(_=$._,"+a+")"),a=fa(a)));return a}function la(a,b){function c(n,v){var ma=D,H=a.slice(0,t),ha=(H.match(Pa)||"").length+1;H=H.match(Qa)[0].length+1;ma(v+" at "+(ha+":"+H),a.substr(t-64,128+(n?n.length:0)))}function e(){2===(p[2]&6)&&(p[2]|=4,d+="H._c=(H,$)=>{")}function l(n, | ||
v){I||(d+='H.push(W=L("'+n[0][0]+'"));W[0]='+JSON.stringify(n[v])+";")}var g=b&4;const u=g?"async ":"";var m=g?"await ":"",d="("+u+'$=>{"use strict";var I,W,_,H=N($);',I=g=0;const na="w,v="+u+"()=>{"+m+"w();",Ca=")};w=("+u+"W=>{",Da="});"+m+"v()}",Ra=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 x,p=[0,{},4,""],ba=[p],t=0;;){var q,f="";if(t>=a.length){var r=p[0];if(r){c(r,"Missing </"+r+">");a+="</"+r+">";continue}break}a:switch(a[t]){case "<":r= | ||
function(){q=aa(ia,a);q[1]?c(0,'Skipping malformed parameter "'+q[1]+'"'):q||c(0,"Parse error");return y=q[2]};var z=function(v,ma){var H=h("mkmapping");if(H){let ha=H.slice(1,-1).split(Sa);for(d+=v;H=ha.pop();)d+=ma+xa(H)+"=k["+ha.length+"];"}else if(""===H)return 1},h=function(v){return(v=n[v])&&ya(v)};oa.lastIndex=++t;if(q=aa(oa,a)){t=oa.lastIndex;I||(q[1]?l(q,1):q[2]?(q[0]="<",l(q,2)):(pa.lastIndex=0,aa(pa,f=q[3])?"n"===f[0]&&(d+="H.push("+JSON.stringify(f.slice(pa.lastIndex))+");"):l(q,3))); | ||
break}let n={};var y;ia.lastIndex=t;if("/"===r())n[y]=1,r();else if(!y){q&&(t=ia.lastIndex);break a}for(n[""]=y;;){if(!r()){q&&(t=ia.lastIndex);break}n[y]=q[3]?q[3].slice(1,-1):y}var J=n["/"];delete n["/"];r=n[""];if(1!==J){do{ba.push(p=[r,n,0,d]);d="";n["-"]&&(delete n["-"],p[2]=1);switch(r){case "noparse":if(!g++)continue;break;case "comment":g||I++}if(!I){delete n[""];d+="W=H;";if(!g)switch(r){case "set":d+="{let H=L(),";var k=h("var")||h("variable");x=0;if(k){var W=h("expr");d+=na;p[2]|=16;x= | ||
d.length;if(f=h("selector"))d+="B($,w=L(),H,"+f+");H=w;";else{void 0!==n.json&&(d+="H=JSON.parse(Y(H));");if(f=h("split"))d+="H=Y(H).split("+(ca(W)||f)+");",W=void 0;void 0!==W&&(d+="H="+(ca(W)||"(_=$._,"+fa("eval(Y(H))")+")")+";");if(f=h("join"))d+="H=H.join("+f+");";z("let k=H[0];H={};","H")}d.length!==x&&(x=0);k=da(k,1);Array.isArray(k)?d+=k[0]+"=A("+(void 0!==n.clone?(x=0,"O(H,"+k[0]+")"):"H"):(x=0,d+="A(H,$,"+k);d+=Ca}else if(f=h("tag")){e();d+="v=0;Q("+f+",$,"+u+"(H,a,$,W)=>{let o=$;$=C(a,$,{"; | ||
(f=h("args"))&&(f=f.replace(Ta,""))&&(d+='"'+f.replace(ta,'":1,"')+'":1');d+="}";if(f=h("scope"))d+=","+f;d+=");"}continue;case "insert":if(k=h("var")||h("variable")){d+=Ba(k,h("quote"),h("format"));if(f=h("join"))d+="x=x.join?x.join("+f+"):x;";k=h("limit");if((f=h("offset"))||void 0!==k)d+="x=F(x,"+f+(void 0!==k?","+k:"")+");";d+="I=K($,H,x)}catch(x){I=0}"}else if(void 0!==(k=h("expr")))d+="{let H=L(),"+na+("H="+(ca(k)||"(_=$._,"+fa("eval(Y(H))")+")")+";W.push(A(H)")+Ca,p[2]|=8;else switch(h("variables")){case "dump":d+= | ||
"log((W="+h("scope")+")?$[W]:$);"}continue;case "replace":k=h("flags");void 0===k&&(k="g");d+="{let H=L(),J=W,v=P("+(h("regexp")||h("from").replace(Ua,"\\$1"))+","+JSON.stringify(k)+","+(ca(h("expr"))||h("to"))+");";continue;case "trim":d+="{let H=L(),J=W;";continue;case "maketag":d+="{let H=L("+h("name")+"),J=W;";continue;case "attrib":d+="{let H=L(),v="+h("name")+",J=W;";continue;case "for":d+="{I=0;let g,i,k,m,J=W,n=0;";d=(k=h("in"))?d+("g=G($,"+da(k)+((f=h("orderby"))?",(m=$._,_=>{let _index=_[0];$._=_=_[1];return["+ | ||
ca(f)+"]}));$._=m":")")+";while(!(m=g.next()).done){k=(m=m.value)[1];i=m[0];W=S({_value:k,"):d+("for(i=+"+(h("from")||0)+",m="+((k=h("step"))?"+("+k+"||1)":1)+",k=+"+(h("to")||0)+";m<0?i>=k:i<=k;i+=m){W=S({");d+="_recno:++n,_index:i});let o=$;$=C(W,$,{}";if(f=h("scope"))d+=","+f;d+=");";1===z("k=(m=$._)._value;","m")&&(d+="M($._,$._._value);");continue;case "eval":d+="{let H=L(),n="+(void 0===(f=h("recurse"))?1:0<f?+f:0)+",J=W,k,m=0;";continue;case "unset":if(f=h("tag"))k=function(v){v="._._tag"+ | ||
v;d+="$"+v+"=$._._&&$._"+v+";"},e(),W=da(f,1),Array.isArray(W)?k(W[0].slice(1)):(d+="{let v="+W+";",k("[v]"),d+="}");else if(f=h("var")||h("variable"))k=da(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="+(ca(h("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(y in n)if(f=h(y))d+=k+(Va.test(y)?y:'"'+y+'"')+":"+f,k=",";d+='},"'+r+'")'}if(!J&&(k="script"===r?Wa:"style"===r?Xa:0)){k.lastIndex=t;z=aa(k,a)?k.lastIndex:a.length+3+r.length;d+=";";!I&&(f=a.slice(t,z-3-r.length))&&(d+="H[0]="+JSON.stringify(f)+";");t=z;J=1;break}I||(d+=";",p[2]|=2)}while(0)}if(J)for(;;){p=ba.pop();z=p[0];f=0;if(r!==z){c(r,(z?"Expected </"+z+"> got </":"Missing <")+r+">");for(J=ba.length;J;)if(ba[--J][0]===r){f=1;break}if(!f){ba.push(p);break}}b:do{switch(z){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(z){case "set":if("{"!==d.slice(-1)&&x){J=d.slice(x).match(Ya);d=d.slice(0,x-11-na.length)+J[1]+J[2]+";";break c}d+=p[2]&16?Da:"})}";break;case "insert":p[2]&8&&(d+=Da);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 "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:p[2]&4&&(d+="};");case "script":case "style":d+=Ra;case "delimiter":d+="}"}while(0);x=0}}while(0);d=p[3]+d;if(!f){p=ba[ba.length-1];break}}break;case "&":qa.lastIndex=++t;if(!g&&(q=aa(qa,a))){t=qa.lastIndex;I||(d+=Aa(q)+"I=K($,H,x)}catch(x){I=0}",x=0);break}f="&";default:ra.lastIndex=t,(q=aa(ra,a))?(f+=q[0],t=ra.lastIndex):(c(0,"Parse error"),f+=a.substr(t),t=a.length),I||(!g&&b&1&&(f=va(f)),!f||p[2]&1&&"0}"!==d.slice(-2)&&f.match(Za)|| | ||
(d+="H.push("+JSON.stringify(f)+");"))}}return d+="return H})"}function ka(a){try{var b=eval(a)}catch(c){D(c,a),$a(a),b=()=>""}return b}function aa(a,b){return a.exec(b)}const ab=("object"==typeof document?document:null)&&window,w=Object,Ha={" ":"+","\t":"%09","\n":"%0A","\r":"%0D",'"':"%22","#":"%23","%":"%25","&":"%26","'":"%27","+":"%2B","<":"%3C","?":"%3F"},bb=/[ \t\n\r#%&'"+<?]/g,Ja={"&":"&","<":"<"},cb=/[&<]/g,ta=/\s*,\s*/g,Sa=/\s*,\s*/,za=RegExp("(?:[^&]+|(?:&(?:\\w*;|[\\w$:.[\\]]+(?=[^%;\\w$:.[\\]])|(?=[^\\w$:.[\\]]))[^&]*))+|&([\\w$]+(?:[.[][\\w$]+]?)*\\.[\\w$]+)(?::([\\w$]*))?(?:%([^;]*))?;", | ||
"y"),qa=/([\w$]+\.[\w$]+(?:[.[][\w$]+]?)*)(?::([\w$]*))?(?:%([^;]*))?;/y,oa=/!(?:--(.*?)(?:--|$)|([^-].*?))(?:>|$)|\?(.*?)(?:\?>|$)/ys,pa=/(?:noparse|comment)\s/y,ra=RegExp("[^&<]+(?:&(?:\\w*;|[\\w$:.[\\]]+(?=[^%;\\w$:.[\\]])|(?=[^\\w$:.[\\]]))[^&<]*)*","y"),ia=/\s*((?:[^-:_a-zA-Z<&>\s\/]\s*)*)(?:([-:_a-zA-Z][-:\w]*|\/)\s*(?:=\s*("[^"]*"|'[^']*'))?|[<&>])/y,Va=/^[_a-zA-Z]\w*$/,Wa=/<\/script>/g,Xa=/<\/style>/g,Ma=/^"([^(+]+)"$/,Oa=/^[A-Za-z_][\w]*$/,Pa=/\n/g,Qa=/[^\n]*$/,Ya=/([^=]+=).+(".*")/,Za=/^\s+$/, | ||
Na=/\s\s+/g,db=/</g,Ta=/[^-:\w,]+/g,Ua=/([\\^$*+?.|()[{])/g,eb=/"/g,fb=/[.[\]]+/,Ea={};var sa,$a=console.debug,Fa=console.error;M=(a,b)=>{try{w.assign(a,b)}catch(c){}};D=(a,b)=>Fa("Remixml expression: "+(b?JSON.stringify(b):"")+"\n",a);E=(a,b,c)=>ua(a,c)(b);P=(a,b,c)=>e=>(Array.isArray(e)?e.join(", "):e).replace(RegExp(a,b),c);U=a=>{var b;ea(b=a[0])&&" "===b[0]&&!(a[0]=b.substr(1))&&a.splice(0,1);var c=a.length-1;ea(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,l=b||va;e--;){switch((c=a[e])[""]){case "!":case "<":case "?":if(!b)break;default:R(c,b);continue;case void 0:if(a[e]=l(c))continue}a.splice(e,1)}return a};S=(a,b)=>{b=L(b);w.assign(b,a);delete b["::"];(a=a["::"])&&w.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(wa(a, | ||
"_contents",()=>{let g=a._c;g?g(a.slice(),b):a[""]=1;return a}),c)wa(a,"_restargs",function(){var g,u={};for(g in this)switch(g[0]){default:0<=g||c[g]||(u[g]=this[g]);case "_":case void 0:}return u});else return a;var l;(l=w.assign({},b))._=w.assign(a,{_:b._,_tag:w.assign({},b._._tag)});e&&(l[e]=a);return l};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=w.entries(b),0<=b.length&&a.splice(b.length),c)try{a=a.sort((e,l)=>{var g,u;e=c(e);l=c(l);var m=0;for(g=e.length;m<g;m++){var d=0;Array.isArray(e[m])&&(d=1,e[m]=e[m][0],l[m]=l[m][0]);if(u=e[m]>l[m]||-(e[m]!==l[m]))break}return d?-u:u})}catch(e){D(e,c)}return a[Symbol.iterator]()};B=(a,b,c,e)=>{for(var l=0;l<c.length;){let g=c[l++];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(fb),c;a="$";for(c of b)a+=xa(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[""]&&sa&&(b=sa(e,b,a));switch(c){case "json":b=JSON.stringify(b).replace(db,"\\\\u003c");break;case "uric":b=b.replace(bb,Ga);break;default:b[""]||(b=Array.isArray(b)?b.join(", "):b,b=(e=Ea[c])?e(b):b.replace(cb,Ia));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,["("+ya(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=w.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[""]||w.keys(a).length:0;desc=a=>- -a===a?-a:[a,1];abstract2dom=(a,b)=>ja.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 l of w.keys(a).splice(a.length))switch(l[0]){default:var g=a[l];null!=g&&(g[""]&&(g=g.join("")),c+=" "+l,l!==g&&(c+='="'+(g.replace?g.replace(eb,"&dquot;"):g)+'"'));case "_":case void 0:}if(!a.length)return c+ | ||
(b&&"br"!==e?"></"+e+">":"/>");c+=">"}for(g=0;void 0!==(l=a[g++]);)c+=l[""]?Y(l,b):l;e&&(c+="</"+e+">");return c};const ja={remixml2js:la,js2obj:ka,compile:ua,parse2txt:(a,b,c)=>{ea(a)&&(a=ka(la(a,c)));return Y(a(b))},abstract2txt:Y,add_filter:(a,b)=>Ea[a]=b,set_proc_fmt:a=>sa=a,set_tag:(a,b,c,e,l)=>(N(b),La(a,b,c,e,l)),set_log_callback:a=>Fa=a};"function"==typeof define&&define.amd?define("remixml",[],ja):"object"==typeof exports?w.assign(exports,ja):ab.Remixml=ja}).call(this); | ||
'use strict';(()=>{function ea(a){return"string"===typeof a}function Ga(a){return Ha[a]}function Ia(a){return Ja[a]}function Ka(a,b){a[b]=1;return a}function La(a,b,c,e,l){b._._tag[c]=(g,w,m)=>{delete w[""];m=C(w,m,l?l.split(ta).reduce(Ka,{}):{},e);return a(m)}}function da(a,b){var c=a.match(Ma);return c?(a=T(c[1]),b?[a]:"["+a+"]"):a}function ua(a,b){return ka(la(a,b))}function va(a){return a.replace(Na," ")}function wa(a,b,c){x.defineProperty(a,b,{get:c,configurable:!0})}function xa(a){return a.match(Oa)? | ||
"."+a:'["'+a+'"]'}function ya(a){var b="",c="",e;for(za.lastIndex=0;e=aa(za,a);)b=e[1]?b+(c+"(()=>{try{return "+Aa(e)+'}catch(x){}return ""})()'):b+(c+JSON.stringify(e[0])),c="+";return b}function Ba(a,b,c){a="Z($,"+da(a);b&&(a+=","+b);c&&(b||(a+=",0"),a+=","+c);return a+")"}function Aa(a){var b=a[2],c=a[3];return Ba(JSON.stringify(a[1]),ea(b)&&JSON.stringify(b),c&&JSON.stringify(c))}function fa(a){return"(()=>{try{return "+a+'}catch(x){D(x)}return ""})()'}function ca(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=fa('eval("'+a+'")'),a=a.includes("_")?"(_=$._,"+a+")":a):((a=JSON.parse(a)).includes("_")&&(a="(_=$._,"+a+")"),a=fa(a)));return a}function la(a,b){function c(n,t){var ma=D,I=a.slice(0,u),ha=(I.match(Pa)||"").length+1;I=I.match(Qa)[0].length+1;ma(t+" at "+(ha+":"+I),a.substr(u-64,128+(n?n.length:0)))}function e(){2===(p[2]&6)&&(p[2]|=4,d+="H._c=(H,$)=>{")}function l(n,t){J|| | ||
(d+='H.push(W=L("'+n[0][0]+'"));W[0]='+JSON.stringify(n[t])+";")}var g=b&4;const w=g?"async ":"";var m=g?"await ":"",d="("+w+'$=>{"use strict";var I,W,_,H=N($);',J=g=0;const na="w,v="+w+"()=>{"+m+"w();",Ca=")};w=("+w+"W=>{",Da="});"+m+"v()}",Ra=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 y,p=[0,{},4,""],ba=[p],u=0;;){var q,f="";if(u>=a.length){var r=p[0];if(r){c(r,"Missing </"+r+">");a+="</"+r+">";continue}break}a:switch(a[u]){case "<":r= | ||
function(){q=aa(ia,a);q[1]?c(0,'Skipping malformed parameter "'+q[1]+'"'):q||c(0,"Parse error");return z=q[2]};var H=function(t,ma){var I=h("mkmapping");if(I){let ha=I.slice(1,-1).split(Sa);for(d+=t;I=ha.pop();)d+=ma+xa(I)+"=k["+ha.length+"];"}else if(""===I)return 1},h=function(t){return(t=n[t])&&ya(t)};oa.lastIndex=++u;if(q=aa(oa,a)){u=oa.lastIndex;J||(q[1]?l(q,1):q[2]?(q[0]="<",l(q,2)):(pa.lastIndex=0,aa(pa,f=q[3])?"n"===f[0]&&(d+="H.push("+JSON.stringify(f.slice(pa.lastIndex))+");"):l(q,3))); | ||
break}let n={};var z;ia.lastIndex=u;if("/"===r())n[z]=1,r();else if(!z){q&&(u=ia.lastIndex);break a}for(n[""]=z;;){if(!r()){q&&(u=ia.lastIndex);break}n[z]=q[3]?q[3].slice(1,-1):z}var W=n["/"];delete n["/"];r=n[""];if(1!==W){do{ba.push(p=[r,n,0,d]);d="";n["-"]&&(delete n["-"],p[2]=1);switch(r){case "noparse":if(!g++)continue;break;case "comment":g||J++}if(!J){delete n[""];d+="W=H;";if(!g)switch(r){case "set":d+="{let H=L(),";var k=h("var")||h("variable");y=0;if(k){var v=h("expr");d+=na;p[2]|=16;y= | ||
d.length;if(f=h("selector"))d+="B($,w=L(),H,"+f+");H=w;";else{void 0!==n.json&&(d+="H=JSON.parse(Y(H));");if(f=h("split"))d+="H=Y(H).split("+(ca(v)||f)+");",v=void 0;void 0!==v&&(d+="H="+(ca(v)||"(_=$._,"+fa("eval(Y(H))")+")")+";");if(f=h("join"))d+="H=H.join("+f+");";H("let k=H[0];H={};","H")}d.length!==y&&(y=0);k=da(k,1);Array.isArray(k)?d+=k[0]+"=A("+(void 0!==n.clone?(y=0,"O(H,"+k[0]+")"):"H"):(y=0,d+="A(H,$,"+k);d+=Ca}else if(f=h("tag")){e();d+="v=0;Q("+f+",$,"+w+"(H,a,$,W)=>{let o=$;$=C(a,$,{"; | ||
(f=h("args"))&&(f=f.replace(Ta,""))&&(d+='"'+f.replace(ta,'":1,"')+'":1');d+="}";if(f=h("scope"))d+=","+f;d+=");"}continue;case "insert":if(v=h("var")||h("variable")){k=function(){t&&(d+="let x="+t+";",t=0)};let t=Ba(v,h("quote"),h("format"));d+="try{";if(f=h("join"))k(),d+="x=x.join?x.join("+f+"):x;";v=h("limit");if((f=h("offset"))||void 0!==v)k(),d+="x=F(x,"+f+(void 0!==v?","+v:"")+");";d+="I=K($,H,"+(t||"x")+")}catch(x){I=0}"}else if(void 0!==(v=h("expr")))d+="{let H=L(),"+na+("H="+(ca(v)||"(_=$._,"+ | ||
fa("eval(Y(H))")+")")+";W.push(A(H)")+Ca,p[2]|=8;else switch(h("variables")){case "dump":d+="log((W="+h("scope")+")?$[W]:$);"}continue;case "replace":k=h("flags");void 0===k&&(k="g");d+="{let H=L(),J=W,v=P("+(h("regexp")||h("from").replace(Ua,"\\$1"))+","+JSON.stringify(k)+","+(ca(h("expr"))||h("to"))+");";continue;case "trim":d+="{let H=L(),J=W;";continue;case "maketag":d+="{let H=L("+h("name")+"),J=W;";continue;case "attrib":d+="{let H=L(),v="+h("name")+",J=W;";continue;case "for":d+="{I=0;let g,i,k,m,J=W,n=0;"; | ||
d=(k=h("in"))?d+("g=G($,"+da(k)+((f=h("orderby"))?",(m=$._,_=>{let _index=_[0];$._=_=_[1];return["+ca(f)+"]}));$._=m":")")+";while(!(m=g.next()).done){k=(m=m.value)[1];i=m[0];W=S({_value:k,"):d+("for(i=+"+(h("from")||0)+",m="+((k=h("step"))?"+("+k+"||1)":1)+",k=+"+(h("to")||0)+";m<0?i>=k:i<=k;i+=m){W=S({");d+="_recno:++n,_index:i});let o=$;$=C(W,$,{}";if(f=h("scope"))d+=","+f;d+=");";1===H("k=(m=$._)._value;","m")&&(d+="M($._,$._._value);");continue;case "eval":d+="{let H=L(),n="+(void 0===(f=h("recurse"))? | ||
1:0<f?+f:0)+",J=W,k,m=0;";continue;case "unset":if(f=h("tag"))k=function(t){t="._._tag"+t;d+="$"+t+"=$._._&&$._"+t+";"},e(),v=da(f,1),Array.isArray(v)?k(v[0].slice(1)):(d+="{let v="+v+";",k("[v]"),d+="}");else if(f=h("var")||h("variable"))k=da(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="+(ca(h("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(z in n)if(f=h(z))d+=k+(Va.test(z)?z:'"'+z+'"')+":"+f,k=",";d+='},"'+r+'")'}if(!W&&(k="script"===r?Wa:"style"===r?Xa:0)){k.lastIndex=u;H=aa(k,a)?k.lastIndex:a.length+3+r.length;d+=";";!J&&(f=a.slice(u,H-3-r.length))&&(d+="H[0]="+JSON.stringify(f)+";");u=H;W=1;break}J||(d+=";",p[2]|=2)}while(0)}if(W)for(;;){p=ba.pop();H=p[0];f=0;if(r!==H){c(r,(H?"Expected </"+H+"> got </":"Missing <")+r+">");for(W= | ||
ba.length;W;)if(ba[--W][0]===r){f=1;break}if(!f){ba.push(p);break}}b:do{switch(H){case "noparse":if(!--g)break b;break;case "comment":if(!g){J--;break b}break;case 0:break b}if(!J)if(g)d+="J.push(H)}";else{c:do switch(H){case "set":if("{"!==d.slice(-1)&&y){W=d.slice(y).match(Ya);d=d.slice(0,y-11-na.length)+W[1]+W[2]+";";break c}d+=p[2]&16?Da:"})}";break;case "insert":p[2]&8&&(d+=Da);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 "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:p[2]&4&&(d+="};");case "script":case "style":d+=Ra;case "delimiter":d+="}"}while(0);y=0}}while(0);d=p[3]+d;if(!f){p=ba[ba.length-1];break}}break;case "&":qa.lastIndex=++u;if(!g&&(q=aa(qa,a))){u=qa.lastIndex;J||(d+="try{I=K($,H,"+(Aa(q)+")}catch(x){I=0}"),y=0);break}f="&";default:ra.lastIndex= | ||
u,(q=aa(ra,a))?(f+=q[0],u=ra.lastIndex):(c(0,"Parse error"),f+=a.substr(u),u=a.length),J||(!g&&b&1&&(f=va(f)),!f||p[2]&1&&"0}"!==d.slice(-2)&&f.match(Za)||(d+="H.push("+JSON.stringify(f)+");"))}}return d+="return H})"}function ka(a){try{var b=eval(a)}catch(c){D(c,a),$a(a),b=()=>""}return b}function aa(a,b){return a.exec(b)}const ab=("object"==typeof document?document:null)&&window,x=Object,Ha={" ":"+","\t":"%09","\n":"%0A","\r":"%0D",'"':"%22","#":"%23","%":"%25","&":"%26","'":"%27","+":"%2B","<":"%3C", | ||
"?":"%3F"},bb=/[ \t\n\r#%&'"+<?]/g,Ja={"&":"&","<":"<"},cb=/[&<]/g,ta=/\s*,\s*/g,Sa=/\s*,\s*/,za=RegExp("(?:[^&]+|(?:&(?:\\w*;|[\\w$:.[\\]]+(?=[^%;\\w$:.[\\]])|(?=[^\\w$:.[\\]]))[^&]*))+|&([\\w$]+(?:[.[][\\w$]+]?)*\\.[\\w$]+)(?::([\\w$]*))?(?:%([^;]*))?;","y"),qa=/([\w$]+\.[\w$]+(?:[.[][\w$]+]?)*)(?::([\w$]*))?(?:%([^;]*))?;/y,oa=/!(?:--(.*?)(?:--|$)|([^-].*?))(?:>|$)|\?(.*?)(?:\?>|$)/ys,pa=/(?:noparse|comment)\s/y,ra=RegExp("[^&<]+(?:&(?:\\w*;|[\\w$:.[\\]]+(?=[^%;\\w$:.[\\]])|(?=[^\\w$:.[\\]]))[^&<]*)*", | ||
"y"),ia=/\s*((?:[^-:_a-zA-Z<&>\s\/]\s*)*)(?:([-:_a-zA-Z][-:\w]*|\/)\s*(?:=\s*("[^"]*"|'[^']*'))?|[<&>])/y,Va=/^[_a-zA-Z]\w*$/,Wa=/<\/script>/g,Xa=/<\/style>/g,Ma=/^"([^(+]+)"$/,Oa=/^[A-Za-z_][\w]*$/,Pa=/\n/g,Qa=/[^\n]*$/,Ya=/([^=]+=).+(".*")/,Za=/^\s+$/,Na=/\s\s+/g,db=/</g,Ta=/[^-:\w,]+/g,Ua=/([\\^$*+?.|()[{])/g,eb=/"/g,fb=/[.[\]]+/,Ea={};var sa,$a=console.debug,Fa=console.error;M=(a,b)=>{try{x.assign(a,b)}catch(c){}};D=(a,b)=>Fa("Remixml expression: "+(b?JSON.stringify(b):"")+"\n",a);E=(a,b,c)=> | ||
ua(a,c)(b);P=(a,b,c)=>e=>(Array.isArray(e)?e.join(", "):e).replace(RegExp(a,b),c);U=a=>{var b;ea(b=a[0])&&" "===b[0]&&!(a[0]=b.substr(1))&&a.splice(0,1);var c=a.length-1;ea(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,l=b||va;e--;){switch((c=a[e])[""]){case "!":case "<":case "?":if(!b)break;default:R(c,b);continue;case void 0:if(a[e]=l(c))continue}a.splice(e, | ||
1)}return a};S=(a,b)=>{b=L(b);x.assign(b,a);delete b["::"];(a=a["::"])&&x.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(wa(a,"_contents",()=>{let g=a._c;g?g(a.slice(),b):a[""]=1;return a}),c)wa(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 l;(l=x.assign({},b))._= | ||
x.assign(a,{_:b._,_tag:x.assign({},b._._tag)});e&&(l[e]=a);return l};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=x.entries(b),0<=b.length&&a.splice(b.length),c)try{a=a.sort((e,l)=>{var g,w;e=c(e);l=c(l);var m=0;for(g=e.length;m<g;m++){var d=0;Array.isArray(e[m])&& | ||
(d=1,e[m]=e[m][0],l[m]=l[m][0]);if(w=e[m]>l[m]||-(e[m]!==l[m]))break}return d?-w:w})}catch(e){D(e,c)}return a[Symbol.iterator]()};B=(a,b,c,e)=>{for(var l=0;l<c.length;){let g=c[l++];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(fb),c;a="$";for(c of b)a+=xa(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[""]&&sa&&(b=sa(e,b,a));switch(c){case "json":b=JSON.stringify(b).replace(db,"\\\\u003c");break;case "uric":b=b.replace(bb,Ga);break;default:b[""]||(b=Array.isArray(b)?b.join(", "):b,b=(e=Ea[c])?e(b):b.replace(cb,Ia));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,["("+ya(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=x.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[""]||x.keys(a).length:0;desc=a=>- -a===a?-a:[a,1];abstract2dom=(a,b)=>ja.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 l of x.keys(a).splice(a.length))switch(l[0]){default:var g=a[l];null!=g&&(g[""]&&(g=g.join("")),c+=" "+l,l!==g&&(c+='="'+(g.replace?g.replace(eb,"&dquot;"):g)+'"'));case "_":case void 0:}if(!a.length)return c+(b&&"br"!==e?"></"+e+">":"/>");c+=">"}for(g=0;void 0!==(l=a[g++]);)c+=l[""]?Y(l,b):l;e&&(c+="</"+e+">");return c};const ja={remixml2js:la,js2obj:ka,compile:ua,parse2txt:(a,b,c)=> | ||
{ea(a)&&(a=ka(la(a,c)));return Y(a(b))},abstract2txt:Y,add_filter:(a,b)=>Ea[a]=b,set_proc_fmt:a=>sa=a,set_tag:(a,b,c,e,l)=>(N(b),La(a,b,c,e,l)),set_log_callback:a=>Fa=a};"function"==typeof define&&define.amd?define("remixml",[],ja):"object"==typeof exports?x.assign(exports,ja):ab.Remixml=ja}).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
558757
7131