UNPKG

@divkitframework/divkit

Version:
11 lines 453 kB
"use strict";var Bd=Object.defineProperty;var Hd=(e,r,t)=>r in e?Bd(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Er=(e,r,t)=>Hd(e,typeof r!="symbol"?r+"":r,t);/*! DivKit v32.51.0 https://github.com/divkit/divkit @licence Apache-2.0 */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Pl(e){return BigInt(e)}const To=Pl("9223372036854775807"),Mo=Pl("-9223372036854775808");function ln(e){const r=Pl(e);if(r>To||r<Mo)throw new Error("Integer overflow.");return r}const Qi=ln(0);function If(e){let r=e;return r<0&&(r=-r),r}function Df(e){let r=0;return e>0?r=1:e<0&&(r=-1),ln(r)}function Wd(e,r){return r&&r[3]&&r[7]?{type:"ConditionalExpression",test:e,consequent:r[3],alternate:r[7]}:e}function Ud(e,r){return r&&r[3]?{type:"TryExpression",test:e,alternate:r[3]}:e}function Ro(e,r){return r.length?r.reduce((t,n)=>({type:"BinaryExpression",operator:n[1],left:t,right:n[3]}),e):e}function sa(e,r){return r.length?r.reduce((t,n)=>({type:"LogicalExpression",operator:n[1],left:t,right:n[3]}),e):e}function Gd(e,r){return r.length?r.reduce((t,n)=>{if(!n[5])throw new Error("Method expected after .");return{type:"MethodExpression",object:t,method:n[3],arguments:n[5][2]}},e):e}function Yd(e){return e==="true"||e==="false"?{type:"BooleanLiteral",value:e==="true"}:{type:"Variable",id:{type:"Identifier",name:e}}}function la(e){if(e.every(t=>typeof t=="string"))return{type:"StringLiteral",value:e.join("")};let r=e.reduce((t,n)=>(typeof n=="string"&&typeof t[t.length-1]=="string"?t[t.length-1]+=n:t.push(n),t),[]).reduce((t,n)=>(typeof n=="string"?t.quasis.push({type:"StringLiteral",value:n}):(t.quasis.length===t.expressions.length&&t.quasis.push({type:"StringLiteral",value:""}),t.expressions.push(n)),t),{type:"TemplateLiteral",quasis:[],expressions:[]});return r.quasis.length===r.expressions.length&&r.quasis.push({type:"StringLiteral",value:""}),r}function qd(e){try{return ln(e)}catch{throw new Error(`Value ${e} can't be converted to Integer type.`)}}function aa(e){if(e==="'"||e==="\\")return e;throw new Error("Incorrect string escape")}function Jd(e,r){function t(){this.constructor=e}t.prototype=r.prototype,e.prototype=new t}function ho(e,r,t,n){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,ho.prototype),i.expected=r,i.found=t,i.location=n,i.name="SyntaxError",i}Jd(ho,Error);function Ks(e,r,t){return t=t||" ",e.length>r?e:(r-=e.length,t+=t.repeat(r),e+t.slice(0,r))}ho.prototype.format=function(e){var r="Error: "+this.message;if(this.location){var t=null,n;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){t=e[n].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,o=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(i):i,s=this.location.source+":"+o.line+":"+o.column;if(t){var a=this.location.end,l=Ks("",o.line.toString().length," "),u=t[i.line-1],c=i.line===a.line?a.column:u.length+1,d=c-i.column||1;r+=` --> `+s+` `+l+` | `+o.line+" | "+u+` `+l+" | "+Ks("",i.column-1," ")+Ks("",d,"^")}else r+=` at `+s}return r};ho.buildMessage=function(e,r){var t={literal:function(u){return'"'+i(u.text)+'"'},class:function(u){var c=u.parts.map(function(d){return Array.isArray(d)?o(d[0])+"-"+o(d[1]):o(d)});return"["+(u.inverted?"^":"")+c.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(u){return u.description}};function n(u){return u.charCodeAt(0).toString(16).toUpperCase()}function i(u){return u.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(c){return"\\x0"+n(c)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(c){return"\\x"+n(c)})}function o(u){return u.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(c){return"\\x0"+n(c)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(c){return"\\x"+n(c)})}function s(u){return t[u.type](u)}function a(u){var c=u.map(s),d,_;if(c.sort(),c.length>0){for(d=1,_=1;d<c.length;d++)c[d-1]!==c[d]&&(c[_]=c[d],_++);c.length=_}switch(c.length){case 1:return c[0];case 2:return c[0]+" or "+c[1];default:return c.slice(0,-1).join(", ")+", or "+c[c.length-1]}}function l(u){return u?'"'+i(u)+'"':"end of input"}return"Expected "+a(e)+" but "+l(r)+" found."};function Vs(e,r){r=r!==void 0?r:{};var t={},n=r.grammarSource,i={start:hn,JsonStringContents:Cn},o=hn,s="@{",a="}",l="@{}",u="\\",c="?",d=":",_="||",g="&&",m="==",h="!=",w=">=",k=">",J="<=",X="<",R="!:",$="+",ge="-",Y="/",Q="*",se="%",T="!",V=".",P="(",O=")",ke=",",tt="'",Ye="e",Pe="E",le=/^[^}]/,qe=/^[^'}]/,ze=/^[0-9]/,wt=/^[a-zA-Z_]/,Qe=/^[a-zA-Z_0-9]/,ot=/^[ \t\r\n]/,ye=je("@{",!1),Pt=je("}",!1),_e=je("@{}",!1),Ie=je("\\",!1),pe=St(),re=Ke(["}"],!0,!1),Je=je("?",!1),$e=je(":",!1),Be=je("||",!1),Tt=je("&&",!1),nt=je("==",!1),K=je("!=",!1),st=je(">=",!1),Fe=je(">",!1),lt=je("<=",!1),ut=je("<",!1),Zt=je("!:",!1),gt=je("+",!1),he=je("-",!1),Ht=je("/",!1),Mt=je("*",!1),Gt=je("%",!1),G=je("!",!1),ht=je(".",!1),Ve=je("(",!1),ue=je(")",!1),kt=je(",",!1),Lt=Qr("string"),De=je("'",!1),Ne=Ke(["'","}"],!0,!1),I=Qr("integer"),Ue=Ke([["0","9"]],!1,!1),qt=Qr("number"),ft=je("e",!1),Et=je("E",!1),lr=Ke([["a","z"],["A","Z"],"_"],!1,!1),we=Ke([["a","z"],["A","Z"],"_",["0","9"]],!1,!1),pt=Qr("whitespace"),We=Ke([" "," ","\r",` `],!1,!1),Ae=function(p){return p},q=function(p){return la(p)},vt=function(p){return p},Wt=function(){return""},Oe=function(){return Le()},ur=function(){throw new Error("Error tokenizing '"+e+"'.")},or=function(){throw new Error("Error tokenizing '"+e+"'.")},Bt=function(p){return p},de=function(p){return aa(p)},ce=function(){throw new Error("Error tokenizing '"+e+"'.")},at=function(p,A){return Wd(p,A)},nr=function(p,A){return sa(p,A)},cr=function(p,A){return sa(p,A)},Jt=function(p,A){return Ro(p,A)},jr=function(p,A){return Ro(p,A)},wr=function(p,A){return Ud(p,A)},At=function(p,A){return Ro(p,A)},Dt=function(p,A){return Ro(p,A)},Kt=function(p){return p},sr=function(p){return p},bt=function(p,A){return{type:"UnaryExpression",operator:p,argument:A}},jt=function(){throw new Error("Incorrect unary operator")},vr=function(p,A){return Gd(p,A)},Ge=function(p,A){return{type:"CallExpression",callee:p,arguments:A}},ar=function(p,A){return[p,...A]},Ir=function(p){return p},zr=function(p){return p},me=function(p){return la(p)},dt=function(p){return p},Cr=function(){return""},kr=function(){return Le()},fr=function(){throw new Error("Error tokenizing '"+e+"'.")},Sr=function(){throw new Error("Error tokenizing '"+e+"'.")},Ee=function(p){return p},Ze=function(p){return aa(p)},Ct=function(){throw new Error("Error tokenizing '"+e+"'.")},ee=function(){return{type:"IntegerLiteral",value:qd(Le())}},xe=function(){return{type:"NumberLiteral",value:parseFloat(Le())}},mr=function(){return{type:"NumberLiteral",value:parseFloat(Le())}},j=function(){const p=Le();if(/\.\./.test(p)||/\.$/.test(p))throw new Error("Unexpected token: .");return Yd(p)},fe=function(){return{type:"Identifier",name:Le()}},f=0,M=0,rt=[{line:1,column:1}],et=0,ir=[],z=0,it;if("startRule"in r){if(!(r.startRule in i))throw new Error(`Can't start parsing from rule "`+r.startRule+'".');o=i[r.startRule]}function Le(){return e.substring(M,f)}function je(p,A){return{type:"literal",text:p,ignoreCase:A}}function Ke(p,A,N){return{type:"class",parts:p,inverted:A,ignoreCase:N}}function St(){return{type:"any"}}function br(){return{type:"end"}}function Qr(p){return{type:"other",description:p}}function dn(p){var A=rt[p],N;if(A)return A;for(N=p-1;!rt[N];)N--;for(A=rt[N],A={line:A.line,column:A.column};N<p;)e.charCodeAt(N)===10?(A.line++,A.column=1):A.column++,N++;return rt[p]=A,A}function Pr(p,A,N){var C=dn(p),oe=dn(A),te={source:n,start:{offset:p,line:C.line,column:C.column},end:{offset:A,line:oe.line,column:oe.column}};return te}function ie(p){f<et||(f>et&&(et=f,ir=[]),ir.push(p))}function bn(p,A,N){return new ho(ho.buildMessage(p,A),p,A,N)}function hn(){var p,A;return p=f,_t(),A=Ur(),A!==t?(_t(),M=p,p=Ae(A)):(f=p,p=t),p}function Cn(){var p,A,N;for(p=f,A=[],N=On();N!==t;)A.push(N),N=On();return M=p,A=q(A),p=A,p}function On(){var p,A,N,C,oe;if(p=f,e.substr(f,2)===s?(A=s,f+=2):(A=t,z===0&&ie(ye)),A!==t?(N=_t(),C=Ur(),C!==t?(_t(),e.charCodeAt(f)===125?(oe=a,f++):(oe=t,z===0&&ie(Pt)),oe!==t?(M=p,p=vt(C)):(f=p,p=t)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.substr(f,3)===l?(A=l,f+=3):(A=t,z===0&&ie(_e)),A!==t&&(M=p,A=Wt()),p=A,p===t&&(p=f,A=f,z++,e.charCodeAt(f)===92?(N=u,f++):(N=t,z===0&&ie(Ie)),N===t&&(e.substr(f,2)===s?(N=s,f+=2):(N=t,z===0&&ie(ye))),z--,N===t?A=void 0:(f=A,A=t),A!==t?(e.length>f?(N=e.charAt(f),f++):(N=t,z===0&&ie(pe)),N!==t?(M=p,p=Oe()):(f=p,p=t)):(f=p,p=t),p===t))){if(p=f,e.substr(f,2)===s?(A=s,f+=2):(A=t,z===0&&ie(ye)),A!==t){if(N=[],le.test(e.charAt(f))?(C=e.charAt(f),f++):(C=t,z===0&&ie(re)),C!==t)for(;C!==t;)N.push(C),le.test(e.charAt(f))?(C=e.charAt(f),f++):(C=t,z===0&&ie(re));else N=t;N!==t?(e.charCodeAt(f)===125?(C=a,f++):(C=t,z===0&&ie(Pt)),C!==t?(M=p,p=ur()):(f=p,p=t)):(f=p,p=t)}else f=p,p=t;p===t&&(p=f,e.substr(f,2)===s?(A=s,f+=2):(A=t,z===0&&ie(ye)),A!==t&&(M=p,A=or()),p=A,p===t&&(p=f,e.charCodeAt(f)===92?(A=u,f++):(A=t,z===0&&ie(Ie)),A!==t?(e.substr(f,2)===s?(N=s,f+=2):(N=t,z===0&&ie(ye)),N!==t?(M=p,p=Bt(N)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.charCodeAt(f)===92?(A=u,f++):(A=t,z===0&&ie(Ie)),A!==t?(e.length>f?(N=e.charAt(f),f++):(N=t,z===0&&ie(pe)),N!==t?(M=p,p=de(N)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.charCodeAt(f)===92?(A=u,f++):(A=t,z===0&&ie(Ie)),A!==t&&(M=p,A=ce()),p=A))))}return p}function Ur(){var p,A,N,C,oe,te,mt,ct,Gr,Dr,Kr;return p=f,A=yn(),A!==t?(N=f,C=_t(),e.charCodeAt(f)===63?(oe=c,f++):(oe=t,z===0&&ie(Je)),oe!==t?(te=_t(),mt=Ur(),mt!==t?(ct=_t(),e.charCodeAt(f)===58?(Gr=d,f++):(Gr=t,z===0&&ie($e)),Gr!==t?(Dr=_t(),Kr=Ur(),Kr!==t?(C=[C,oe,te,mt,ct,Gr,Dr,Kr],N=C):(f=N,N=t)):(f=N,N=t)):(f=N,N=t)):(f=N,N=t),N===t&&(N=null),M=p,p=at(A,N)):(f=p,p=t),p}function yn(){var p,A,N,C,oe,te,mt,ct;if(p=f,A=fn(),A!==t){for(N=[],C=f,oe=_t(),e.substr(f,2)===_?(te=_,f+=2):(te=t,z===0&&ie(Be)),te!==t?(mt=_t(),ct=fn(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);C!==t;)N.push(C),C=f,oe=_t(),e.substr(f,2)===_?(te=_,f+=2):(te=t,z===0&&ie(Be)),te!==t?(mt=_t(),ct=fn(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);M=p,p=nr(A,N)}else f=p,p=t;return p}function fn(){var p,A,N,C,oe,te,mt,ct;if(p=f,A=y(),A!==t){for(N=[],C=f,oe=_t(),e.substr(f,2)===g?(te=g,f+=2):(te=t,z===0&&ie(Tt)),te!==t?(mt=_t(),ct=y(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);C!==t;)N.push(C),C=f,oe=_t(),e.substr(f,2)===g?(te=g,f+=2):(te=t,z===0&&ie(Tt)),te!==t?(mt=_t(),ct=y(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);M=p,p=cr(A,N)}else f=p,p=t;return p}function y(){var p,A,N,C,oe,te,mt,ct;if(p=f,A=v(),A!==t){for(N=[],C=f,oe=_t(),e.substr(f,2)===m?(te=m,f+=2):(te=t,z===0&&ie(nt)),te===t&&(e.substr(f,2)===h?(te=h,f+=2):(te=t,z===0&&ie(K))),te!==t?(mt=_t(),ct=v(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);C!==t;)N.push(C),C=f,oe=_t(),e.substr(f,2)===m?(te=m,f+=2):(te=t,z===0&&ie(nt)),te===t&&(e.substr(f,2)===h?(te=h,f+=2):(te=t,z===0&&ie(K))),te!==t?(mt=_t(),ct=v(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);M=p,p=Jt(A,N)}else f=p,p=t;return p}function v(){var p,A,N,C,oe,te,mt,ct;if(p=f,A=E(),A!==t){for(N=[],C=f,oe=_t(),e.substr(f,2)===w?(te=w,f+=2):(te=t,z===0&&ie(st)),te===t&&(e.charCodeAt(f)===62?(te=k,f++):(te=t,z===0&&ie(Fe)),te===t&&(e.substr(f,2)===J?(te=J,f+=2):(te=t,z===0&&ie(lt)),te===t&&(e.charCodeAt(f)===60?(te=X,f++):(te=t,z===0&&ie(ut))))),te!==t?(mt=_t(),ct=E(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);C!==t;)N.push(C),C=f,oe=_t(),e.substr(f,2)===w?(te=w,f+=2):(te=t,z===0&&ie(st)),te===t&&(e.charCodeAt(f)===62?(te=k,f++):(te=t,z===0&&ie(Fe)),te===t&&(e.substr(f,2)===J?(te=J,f+=2):(te=t,z===0&&ie(lt)),te===t&&(e.charCodeAt(f)===60?(te=X,f++):(te=t,z===0&&ie(ut))))),te!==t?(mt=_t(),ct=E(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);M=p,p=jr(A,N)}else f=p,p=t;return p}function E(){var p,A,N,C,oe,te,mt;return p=f,A=B(),A!==t?(N=f,C=_t(),e.substr(f,2)===R?(oe=R,f+=2):(oe=t,z===0&&ie(Zt)),oe!==t?(te=_t(),mt=B(),mt!==t?(C=[C,oe,te,mt],N=C):(f=N,N=t)):(f=N,N=t),N===t&&(N=null),M=p,p=wr(A,N)):(f=p,p=t),p}function B(){var p,A,N,C,oe,te,mt,ct;if(p=f,A=D(),A!==t){for(N=[],C=f,oe=_t(),e.charCodeAt(f)===43?(te=$,f++):(te=t,z===0&&ie(gt)),te===t&&(e.charCodeAt(f)===45?(te=ge,f++):(te=t,z===0&&ie(he))),te!==t?(mt=_t(),ct=D(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);C!==t;)N.push(C),C=f,oe=_t(),e.charCodeAt(f)===43?(te=$,f++):(te=t,z===0&&ie(gt)),te===t&&(e.charCodeAt(f)===45?(te=ge,f++):(te=t,z===0&&ie(he))),te!==t?(mt=_t(),ct=D(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);M=p,p=At(A,N)}else f=p,p=t;return p}function D(){var p,A,N,C,oe,te,mt,ct;if(p=f,A=Ce(),A!==t){for(N=[],C=f,oe=_t(),e.charCodeAt(f)===47?(te=Y,f++):(te=t,z===0&&ie(Ht)),te===t&&(e.charCodeAt(f)===42?(te=Q,f++):(te=t,z===0&&ie(Mt)),te===t&&(e.charCodeAt(f)===37?(te=se,f++):(te=t,z===0&&ie(Gt)))),te!==t?(mt=_t(),ct=Ce(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);C!==t;)N.push(C),C=f,oe=_t(),e.charCodeAt(f)===47?(te=Y,f++):(te=t,z===0&&ie(Ht)),te===t&&(e.charCodeAt(f)===42?(te=Q,f++):(te=t,z===0&&ie(Mt)),te===t&&(e.charCodeAt(f)===37?(te=se,f++):(te=t,z===0&&ie(Gt)))),te!==t?(mt=_t(),ct=Ce(),ct!==t?(oe=[oe,te,mt,ct],C=oe):(f=C,C=t)):(f=C,C=t);M=p,p=Dt(A,N)}else f=p,p=t;return p}function Ce(){var p,A,N,C;return p=f,A=f,z++,e.charCodeAt(f)===45?(N=ge,f++):(N=t,z===0&&ie(he)),z--,N!==t?(f=A,A=void 0):A=t,A!==t?(N=Yt(),N!==t?(M=p,p=Kt(N)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,A=f,z++,e.charCodeAt(f)===45?(N=ge,f++):(N=t,z===0&&ie(he)),z--,N!==t?(f=A,A=void 0):A=t,A!==t?(N=Vr(),N!==t?(M=p,p=sr(N)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.charCodeAt(f)===33?(A=T,f++):(A=t,z===0&&ie(G)),A===t&&(e.charCodeAt(f)===43?(A=$,f++):(A=t,z===0&&ie(gt)),A===t&&(e.charCodeAt(f)===45?(A=ge,f++):(A=t,z===0&&ie(he)))),A!==t?(N=_t(),C=be(),C===t&&(C=Rt()),C!==t?(M=p,p=bt(A,C)):(f=p,p=t)):(f=p,p=t),p===t&&(p=Rt()))),p}function be(){var p,A;return p=f,e.charCodeAt(f)===43?(A=$,f++):(A=t,z===0&&ie(gt)),A===t&&(e.charCodeAt(f)===45?(A=ge,f++):(A=t,z===0&&ie(he))),A!==t&&(M=p,A=jt()),p=A,p}function Rt(){var p,A,N,C,oe,te,mt,ct,Gr,Dr,Kr,pi,Kn,Pi,xn;if(p=f,A=Vt(),A!==t){for(N=[],C=f,oe=_t(),e.charCodeAt(f)===46?(te=V,f++):(te=t,z===0&&ie(ht)),te!==t?(mt=_t(),ct=Jr(),ct!==t?(Gr=_t(),Dr=f,e.charCodeAt(f)===40?(Kr=P,f++):(Kr=t,z===0&&ie(Ve)),Kr!==t?(pi=_t(),Kn=Nt(),Kn!==t?(Pi=_t(),e.charCodeAt(f)===41?(xn=O,f++):(xn=t,z===0&&ie(ue)),xn!==t?(Kr=[Kr,pi,Kn,Pi,xn],Dr=Kr):(f=Dr,Dr=t)):(f=Dr,Dr=t)):(f=Dr,Dr=t),Dr===t&&(Dr=null),oe=[oe,te,mt,ct,Gr,Dr],C=oe):(f=C,C=t)):(f=C,C=t);C!==t;)N.push(C),C=f,oe=_t(),e.charCodeAt(f)===46?(te=V,f++):(te=t,z===0&&ie(ht)),te!==t?(mt=_t(),ct=Jr(),ct!==t?(Gr=_t(),Dr=f,e.charCodeAt(f)===40?(Kr=P,f++):(Kr=t,z===0&&ie(Ve)),Kr!==t?(pi=_t(),Kn=Nt(),Kn!==t?(Pi=_t(),e.charCodeAt(f)===41?(xn=O,f++):(xn=t,z===0&&ie(ue)),xn!==t?(Kr=[Kr,pi,Kn,Pi,xn],Dr=Kr):(f=Dr,Dr=t)):(f=Dr,Dr=t)):(f=Dr,Dr=t),Dr===t&&(Dr=null),oe=[oe,te,mt,ct,Gr,Dr],C=oe):(f=C,C=t)):(f=C,C=t);M=p,p=vr(A,N)}else f=p,p=t;return p}function Vt(){var p,A,N,C,oe;return p=f,A=Jr(),A!==t?(_t(),e.charCodeAt(f)===40?(N=P,f++):(N=t,z===0&&ie(Ve)),N!==t?(_t(),C=Nt(),C!==t?(_t(),e.charCodeAt(f)===41?(oe=O,f++):(oe=t,z===0&&ie(ue)),oe!==t?(M=p,p=Ge(A,C)):(f=p,p=t)):(f=p,p=t)):(f=p,p=t)):(f=p,p=t),p===t&&(p=It()),p}function Nt(){var p,A,N,C,oe,te;if(p=f,A=Ur(),A!==t){for(N=[],C=f,_t(),e.charCodeAt(f)===44?(oe=ke,f++):(oe=t,z===0&&ie(kt)),oe!==t?(_t(),te=Ur(),te!==t?C=te:(f=C,C=t)):(f=C,C=t);C!==t;)N.push(C),C=f,_t(),e.charCodeAt(f)===44?(oe=ke,f++):(oe=t,z===0&&ie(kt)),oe!==t?(_t(),te=Ur(),te!==t?C=te:(f=C,C=t)):(f=C,C=t);M=p,p=ar(A,N)}else f=p,p=t;return p===t&&(p=_t()),p}function It(){var p,A,N,C;return p=Br(),p===t&&(p=Ut(),p===t&&(p=Yt(),p===t&&(p=Vr(),p===t&&(p=f,e.charCodeAt(f)===40?(A=P,f++):(A=t,z===0&&ie(Ve)),A!==t?(_t(),N=Ur(),N!==t?(_t(),e.charCodeAt(f)===41?(C=O,f++):(C=t,z===0&&ie(ue)),C!==t?(M=p,p=Ir(N)):(f=p,p=t)):(f=p,p=t)):(f=p,p=t))))),p}function Ut(){var p,A,N,C;return z++,p=f,e.charCodeAt(f)===39?(A=tt,f++):(A=t,z===0&&ie(De)),A!==t?(N=Mr(),e.charCodeAt(f)===39?(C=tt,f++):(C=t,z===0&&ie(De)),C!==t?(M=p,p=zr(N)):(f=p,p=t)):(f=p,p=t),z--,p===t&&(A=t,z===0&&ie(Lt)),p}function Mr(){var p,A,N;for(p=f,A=[],N=yt();N!==t;)A.push(N),N=yt();return M=p,A=me(A),p=A,p}function yt(){var p,A,N,C,oe;if(p=f,e.substr(f,2)===s?(A=s,f+=2):(A=t,z===0&&ie(ye)),A!==t?(N=_t(),C=Ur(),C!==t?(_t(),e.charCodeAt(f)===125?(oe=a,f++):(oe=t,z===0&&ie(Pt)),oe!==t?(M=p,p=dt(C)):(f=p,p=t)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.substr(f,3)===l?(A=l,f+=3):(A=t,z===0&&ie(_e)),A!==t&&(M=p,A=Cr()),p=A,p===t&&(p=f,A=f,z++,e.charCodeAt(f)===92?(N=u,f++):(N=t,z===0&&ie(Ie)),N===t&&(e.charCodeAt(f)===39?(N=tt,f++):(N=t,z===0&&ie(De)),N===t&&(e.substr(f,2)===s?(N=s,f+=2):(N=t,z===0&&ie(ye)))),z--,N===t?A=void 0:(f=A,A=t),A!==t?(e.length>f?(N=e.charAt(f),f++):(N=t,z===0&&ie(pe)),N!==t?(M=p,p=kr()):(f=p,p=t)):(f=p,p=t),p===t))){if(p=f,e.substr(f,2)===s?(A=s,f+=2):(A=t,z===0&&ie(ye)),A!==t){if(N=[],qe.test(e.charAt(f))?(C=e.charAt(f),f++):(C=t,z===0&&ie(Ne)),C!==t)for(;C!==t;)N.push(C),qe.test(e.charAt(f))?(C=e.charAt(f),f++):(C=t,z===0&&ie(Ne));else N=t;N!==t?(e.charCodeAt(f)===125?(C=a,f++):(C=t,z===0&&ie(Pt)),C!==t?(M=p,p=fr()):(f=p,p=t)):(f=p,p=t)}else f=p,p=t;p===t&&(p=f,e.substr(f,2)===s?(A=s,f+=2):(A=t,z===0&&ie(ye)),A!==t&&(M=p,A=Sr()),p=A,p===t&&(p=f,e.charCodeAt(f)===92?(A=u,f++):(A=t,z===0&&ie(Ie)),A!==t?(e.substr(f,2)===s?(N=s,f+=2):(N=t,z===0&&ie(ye)),N!==t?(M=p,p=Ee(N)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.charCodeAt(f)===92?(A=u,f++):(A=t,z===0&&ie(Ie)),A!==t?(e.length>f?(N=e.charAt(f),f++):(N=t,z===0&&ie(pe)),N!==t?(M=p,p=Ze(N)):(f=p,p=t)):(f=p,p=t),p===t&&(p=f,e.charCodeAt(f)===92?(A=u,f++):(A=t,z===0&&ie(Ie)),A!==t&&(M=p,A=Ct()),p=A))))}return p}function Vr(){var p,A,N;if(z++,p=f,e.charCodeAt(f)===45?f++:z===0&&ie(he),A=[],ze.test(e.charAt(f))?(N=e.charAt(f),f++):(N=t,z===0&&ie(Ue)),N!==t)for(;N!==t;)A.push(N),ze.test(e.charAt(f))?(N=e.charAt(f),f++):(N=t,z===0&&ie(Ue));else A=t;return A!==t?(M=p,p=ee()):(f=p,p=t),z--,p===t&&z===0&&ie(I),p}function Yt(){var p,A,N,C,oe,te,mt,ct,Gr;for(z++,p=f,e.charCodeAt(f)===45?f++:z===0&&ie(he),A=[],ze.test(e.charAt(f))?(N=e.charAt(f),f++):(N=t,z===0&&ie(Ue));N!==t;)A.push(N),ze.test(e.charAt(f))?(N=e.charAt(f),f++):(N=t,z===0&&ie(Ue));if(e.charCodeAt(f)===46?(N=V,f++):(N=t,z===0&&ie(ht)),N!==t){if(C=[],ze.test(e.charAt(f))?(oe=e.charAt(f),f++):(oe=t,z===0&&ie(Ue)),oe!==t)for(;oe!==t;)C.push(oe),ze.test(e.charAt(f))?(oe=e.charAt(f),f++):(oe=t,z===0&&ie(Ue));else C=t;if(C!==t){if(oe=f,e.charCodeAt(f)===101?(te=Ye,f++):(te=t,z===0&&ie(ft)),te===t&&(e.charCodeAt(f)===69?(te=Pe,f++):(te=t,z===0&&ie(Et))),te!==t){if(e.charCodeAt(f)===43?(mt=$,f++):(mt=t,z===0&&ie(gt)),mt===t&&(e.charCodeAt(f)===45?(mt=ge,f++):(mt=t,z===0&&ie(he))),mt===t&&(mt=null),ct=[],ze.test(e.charAt(f))?(Gr=e.charAt(f),f++):(Gr=t,z===0&&ie(Ue)),Gr!==t)for(;Gr!==t;)ct.push(Gr),ze.test(e.charAt(f))?(Gr=e.charAt(f),f++):(Gr=t,z===0&&ie(Ue));else ct=t;ct!==t?(te=[te,mt,ct],oe=te):(f=oe,oe=t)}else f=oe,oe=t;oe===t&&(oe=null),M=p,p=xe()}else f=p,p=t}else f=p,p=t;if(p===t){if(p=f,e.charCodeAt(f)===45?f++:z===0&&ie(he),A=[],ze.test(e.charAt(f))?(N=e.charAt(f),f++):(N=t,z===0&&ie(Ue)),N!==t)for(;N!==t;)A.push(N),ze.test(e.charAt(f))?(N=e.charAt(f),f++):(N=t,z===0&&ie(Ue));else A=t;if(A!==t)if(e.charCodeAt(f)===101?(N=Ye,f++):(N=t,z===0&&ie(ft)),N===t&&(e.charCodeAt(f)===69?(N=Pe,f++):(N=t,z===0&&ie(Et))),N!==t){if(e.charCodeAt(f)===43?(C=$,f++):(C=t,z===0&&ie(gt)),C===t&&(e.charCodeAt(f)===45?(C=ge,f++):(C=t,z===0&&ie(he))),C===t&&(C=null),oe=[],ze.test(e.charAt(f))?(te=e.charAt(f),f++):(te=t,z===0&&ie(Ue)),te!==t)for(;te!==t;)oe.push(te),ze.test(e.charAt(f))?(te=e.charAt(f),f++):(te=t,z===0&&ie(Ue));else oe=t;oe!==t?(M=p,p=mr()):(f=p,p=t)}else f=p,p=t;else f=p,p=t}return z--,p===t&&z===0&&ie(qt),p}function Br(){var p,A,N,C,oe,te,mt,ct,Gr,Dr,Kr;if(p=f,wt.test(e.charAt(f))?(A=e.charAt(f),f++):(A=t,z===0&&ie(lr)),A!==t){if(N=[],C=[],Qe.test(e.charAt(f))?(oe=e.charAt(f),f++):(oe=t,z===0&&ie(we)),oe!==t)for(;oe!==t;)C.push(oe),Qe.test(e.charAt(f))?(oe=e.charAt(f),f++):(oe=t,z===0&&ie(we));else C=t;for(C===t&&(C=f,e.charCodeAt(f)===46?(oe=V,f++):(oe=t,z===0&&ie(ht)),oe!==t?(te=f,z++,mt=f,ct=_t(),Gr=Jr(),Gr!==t?(Dr=_t(),e.charCodeAt(f)===40?(Kr=P,f++):(Kr=t,z===0&&ie(Ve)),Kr!==t?(ct=[ct,Gr,Dr,Kr],mt=ct):(f=mt,mt=t)):(f=mt,mt=t),z--,mt===t?te=void 0:(f=te,te=t),te!==t?(oe=[oe,te],C=oe):(f=C,C=t)):(f=C,C=t));C!==t;){if(N.push(C),C=[],Qe.test(e.charAt(f))?(oe=e.charAt(f),f++):(oe=t,z===0&&ie(we)),oe!==t)for(;oe!==t;)C.push(oe),Qe.test(e.charAt(f))?(oe=e.charAt(f),f++):(oe=t,z===0&&ie(we));else C=t;C===t&&(C=f,e.charCodeAt(f)===46?(oe=V,f++):(oe=t,z===0&&ie(ht)),oe!==t?(te=f,z++,mt=f,ct=_t(),Gr=Jr(),Gr!==t?(Dr=_t(),e.charCodeAt(f)===40?(Kr=P,f++):(Kr=t,z===0&&ie(Ve)),Kr!==t?(ct=[ct,Gr,Dr,Kr],mt=ct):(f=mt,mt=t)):(f=mt,mt=t),z--,mt===t?te=void 0:(f=te,te=t),te!==t?(oe=[oe,te],C=oe):(f=C,C=t)):(f=C,C=t))}M=p,p=j()}else f=p,p=t;return p}function Jr(){var p,A,N,C;if(p=f,wt.test(e.charAt(f))?(A=e.charAt(f),f++):(A=t,z===0&&ie(lr)),A!==t){for(N=[],Qe.test(e.charAt(f))?(C=e.charAt(f),f++):(C=t,z===0&&ie(we));C!==t;)N.push(C),Qe.test(e.charAt(f))?(C=e.charAt(f),f++):(C=t,z===0&&ie(we));M=p,p=fe()}else f=p,p=t;return p}function _t(){var p,A;for(z++,p=[],ot.test(e.charAt(f))?(A=e.charAt(f),f++):(A=t,z===0&&ie(We));A!==t;)p.push(A),ot.test(e.charAt(f))?(A=e.charAt(f),f++):(A=t,z===0&&ie(We));return z--,A=t,z===0&&ie(pt),p}if(it=o(),it!==t&&f===e.length)return it;throw it!==t&&f<e.length&&ie(br()),bn(ir,et<e.length?e.charAt(et):null,et<e.length?Pr(et,et+1):Pr(et,et))}const Kd=2147483647,Xd=-2147483648,Zd=Number.MAX_VALUE,Qd=Number.MIN_VALUE,ae="string",ve="integer",Xe="number",Nr="boolean",xr="color",Nn="url",Fr="datetime",Qt="dict",xt="array",xd="function";function Zn(e,r){var t;switch((t=r[e.type])==null||t.call(r,e),e.type){case"TemplateLiteral":e.expressions.forEach(n=>{Zn(n,r)});break;case"BinaryExpression":case"LogicalExpression":Zn(e.left,r),Zn(e.right,r);break;case"UnaryExpression":Zn(e.argument,r);break;case"ConditionalExpression":Zn(e.test,r),Zn(e.consequent,r),Zn(e.alternate,r);break;case"TryExpression":Zn(e.test,r),Zn(e.alternate,r);break;case"CallExpression":e.arguments.forEach(n=>{Zn(n,r)});break;case"MethodExpression":Zn(e.object,r),e.arguments.forEach(n=>{Zn(n,r)});break}}function Ff(e,r){for(;e.length<r;)e="0"+e;return e}function Lr(e,r=1,t="transparent"){if(e=(typeof e=="string"&&e||"").toLowerCase(),e.charAt(0)!=="#")return t;const n=ni(e);return n?(n.a*=r,Nl(n)):t}function $d(e,r,t="transparent"){if(e=(typeof e=="string"&&e||"").toLowerCase(),e.charAt(0)!=="#")return t;const n=ni(e);return n?(n.a=r,Nl(n)):t}function Nl(e){return e.a===255?`#${[e.r,e.g,e.b].map(r=>Ff(Math.round(r).toString(16),2)).join("")}`:`rgba(${e.r},${e.g},${e.b},${(e.a/255).toFixed(2)})`}function ni(e){const r=e.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||e.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||e.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||e.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(r){if(r.length===5){const[u,c,d,_,g]=r,m=d.length===2?d:d+d,h=_.length===2?_:_+_,w=g.length===2?g:g+g,k=c.length===2?c:c+c;return{a:parseInt(k,16),r:parseInt(m,16),g:parseInt(h,16),b:parseInt(w,16)}}const[t,n,i,o]=r,s=n.length===2?n:n+n,a=i.length===2?i:i+i,l=o.length===2?o:o+o;return{a:255,r:parseInt(s,16),g:parseInt(a,16),b:parseInt(l,16)}}return null}class zl extends Error{}function _s(e){return e.type==="url"||e.type==="color"?{type:"string",value:e.value}:e}function Tf(e){return[e.getFullYear(),String(e.getMonth()+1).padStart(2,"0"),String(e.getDate()).padStart(2,"0")].join("-")+" "+[String(e.getHours()).padStart(2,"0"),String(e.getMinutes()).padStart(2,"0"),String(e.getSeconds()).padStart(2,"0")].join(":")}function eh(e,r){return r&&r instanceof Object&&!Array.isArray(r)?Object.keys(r).sort().reduce((t,n)=>(t[n]=r[n],t),{}):r}function Ri(e,r){if(e.type==="string")return e.value;if(e.type==="integer")return String(e.value);if(e.type==="number"){let t=String(e.value);return t.includes(".")||(t.includes("e")?t=t.replace("e",".0e"):t+=".0"),t=t.replace(/e\+?/i,"E"),t}else{if(e.type==="boolean")return e.value?"true":"false";if(e.type==="datetime")return Tf(e.value);if(e.type==="color")return no(Is(e.value));if(e.type==="url")return e.value;if((e.type==="dict"||e.type==="array")&&r)return JSON.stringify(e.value,eh);if(e.type==="dict")return"<dict>";if(e.type==="array")return"<array>";if(e.type==="function")return e.value[0].name||"Function"}throw new Error(`Unexpected type ${e.type}`)}function cn(e){let r=Ri(e,!1);return e.type==="string"&&(r="'"+r.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),r}function Yn(e){return e==="datetime"?"DateTime":e.charAt(0).toUpperCase()+e.substring(1)}function ro(e,r){return ln(r)}function Tn(e,r){if(r<Mo||r>To)throw new Error("Integer overflow.")}function ii(e){if(typeof e!="string")throw new Error("Incorrect url value.");try{new URL(e)}catch{throw new Error("Incorrect url value.")}}function th(e){try{return ii(e),!0}catch{return!1}}function rh(e){const r=new Set;return Zn(e,{Variable(t){r.add(t.id.name)}}),[...r]}function Vn(e,r){throw new zl(`Failed to evaluate [${e}]. ${r}`)}function nh(e,r){throw new Error(r)}function Is(e){const r=ni(e);if(r)return r;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function no(e){return`#${[e.a,e.r,e.g,e.b].map(r=>{if(r<0||r>255)throw new Error("Value out of range 0..1.");return Ff(Math.round(r).toString(16),2)}).join("").toUpperCase()}`}function Bi(e){return no(Is(e))}function ll(e){return{type:Xe,value:Number(e.value)}}const ih={string:"string",number:"number",integer:"number",boolean:"boolean",color:"string",url:"string",array:"array",dict:"object",datetime:"never"};function Ds(e,r,t){if(t==="function")throw new Error("Cannot convert function");const n=ih[t];let i=typeof r;if(n==="array"&&!Array.isArray(r)||n!=="array"&&i!==n||i==="object"&&r===null)throw i==="object"&&(Array.isArray(r)?i="array":r===null?i="null":i="dict"),new Error(`Incorrect value type: expected ${Yn(t)}, got ${Yn(i)}.`);if(n==="number"&&t==="integer"){e&&Tn(e,r);try{r=ln(r)}catch{throw new Error("Cannot convert value to integer.")}}return n==="string"&&t==="color"&&(r=Bi(r)),n==="string"&&t==="url"&&ii(r),n==="boolean"&&t===Nr&&(r=r?1:0),{type:t,value:r}}function oh(e){return e.type==="number"||e.type==="integer"?Number(e.value):e.type==="boolean"?!!e.value:e.value}function Fs(e){return oh(Ds(void 0,e.value,e.type))}function gs(e){return e.map(cn).join(", ")}function Mf(e,r,t,n=!1){const i=r.map(a=>Yn(a.type)).join(", "),o=`${e}(${gs(r)})`,s=n?nh:Vn;if(t.type==="few"&&r.length===0&&t.hasOverloads)s(o,"Function requires non empty argument list.");else if(t.type==="many"||t.type==="few"||t.type==="mismatch")if(t.hasOverloads)s(o,`Function has no matching overload for given argument types: ${i}.`);else if(t.type==="many"||t.type==="few")t.def.args.some(a=>typeof a=="object"&&a.isVararg)?s(o,`At least ${t.def.args.length} argument(s) expected.`):s(o,`Exactly ${t.def.args.length} argument(s) expected.`);else{const a=t.def.args.map(l=>Yn(typeof l=="string"?l:l.type)).join(", ");s(o,`Invalid argument type: expected ${a}, got ${i}.`)}else s(o,`Unknown function name: ${e}.`)}const Io=new Map,al=new Map,Qo=new Map,ul=new Map;function S(e,r,t){const n={args:r,cb:t},i=Io.get(e)||[];Io.has(e)||Io.set(e,i),i.push(n);const o=e+":"+r.map(s=>typeof s=="object"?s.type:s).join("#");al.set(o,n)}function Or(e,r,t){const n={args:r,cb:t},i=Qo.get(e)||[];Qo.has(e)||Qo.set(e,i),i.push(n);const o=e+":"+r.map(s=>typeof s=="object"?s.type:s).join("#");ul.set(o,n)}function sh(e,r,t){const n=e.args.length;let i=e.args.length,o=0;const s=e.args[e.args.length-1];if(typeof s=="object"&&s.isVararg&&(i=1/0),r.length<n)return{type:"few",expected:n,found:r.length,def:e,hasOverloads:t};if(r.length>i)return{type:"many",expected:i,found:r.length,def:e,hasOverloads:t};for(let a=0;a<r.length;++a){let l=a>=e.args.length?e.args[e.args.length-1]:e.args[a];if(typeof l!="object"&&(l={type:l}),l.type===Xe&&r[a].type===ve){++o;continue}if(l.type!==r[a].type)return{type:"mismatch",expected:l.type,found:r[a].type,def:e,hasOverloads:t}}return{type:"match",conversions:o}}function Pf(e,r){if(!e)return{type:"missing"};let t=null,n=null;for(let i=0;i<e.length;++i){const o=sh(e[i],r,e.length>1);if(o.type==="match"){(!n||n.conversions>o.conversions)&&(n={func:e[i],conversions:o.conversions});continue}t||(t=o)}if(!n){if(t)return t;throw new Error("Missing function")}return n}function cl(e,r,t){return Pf(e.get(r),t)}function Nf(e,r){return r.map((t,n)=>{let i=n>=e.args.length?e.args[e.args.length-1]:e.args[n];return typeof i!="object"&&(i={type:i}),i.type===Xe&&t.type===ve?ll(t):t})}function ua(e,r){return e+":"+r.args.map(t=>typeof t=="string"?t:t.type).join("#")}function Ln(e,r){return{type:ae,value:Ri(r,!0)}}function ca(e,r){const t=Number(r.value);if(Number.isNaN(t)||!Number.isFinite(t))throw new Error("Unable to convert value to Number.");if(r.value==="")throw new Error("Unable to convert value to Number.");return{type:Xe,value:t}}function lh(e,r){if(r.value>To||r.value<Mo)throw new Error("Unable to convert value to Integer.");const t=r.value-r.value%1;return{type:ve,value:ln(t)}}function ah(e,r){let t;try{t=ln(r.value)}catch{throw new Error("Unable to convert value to Integer.")}return{type:ve,value:t}}function uh(e,r){return{type:ve,value:ln(r.value?1:0)}}function ch(e,r){const t=Number(r.value);if(t!==1&&t!==0)throw new Error("Unable to convert value to Boolean.");return{type:Nr,value:t}}function fh(e,r){if(r.value!=="true"&&r.value!=="false")throw new Error("Unable to convert value to Boolean.");return{type:Nr,value:r.value==="true"?1:0}}function dh(e,r){return{type:xr,value:Bi(r.value)}}function hh(e,r){return ii(r.value),{type:Nn,value:r.value}}function _h(e,r){try{return{type:ae,value:encodeURIComponent(r.value)}}catch{throw new Error("Unable to encodeUri string.")}}function gh(e,r){try{return{type:ae,value:decodeURIComponent(r.value)}}catch{throw new Error("Unable to decodeUri string.")}}function Ol(e,r,t,n){const i=e.variables.get(r.value);let o;return i&&i.getType()===n?(o=i.getValue(),e.storeUsedVars||(e.storeUsedVars=new Set),e.storeUsedVars.add(i)):o=t.value,n==="color"?o=Bi(o):n==="url"&&ii(o),{type:n,value:o}}function Bo(e,r,t){return Ol(e,r,t,t.type)}function fa(e,r,t){return Ol(e,r,t,"color")}function da(e,r,t){return Ol(e,r,t,"url")}function zf(e,r){for(let t=0;t<r.length;++t){const n=e.charAt(t),i=r.charAt(t);if(n!==i&&i)return i}return""}const ps=1234567890;function ha(e){const r=new Intl.NumberFormat(e,{maximumFractionDigits:0}),t=new Intl.NumberFormat(e,{minimumFractionDigits:1}),n=r.format(ps),i=t.format(ps);return zf(n,i)}function ph(e){const r=new Intl.NumberFormat(e,{useGrouping:!1}),t=new Intl.NumberFormat(e,{useGrouping:!0}),n=r.format(ps),i=t.format(ps);return zf(n,i)}function Ni(e,r,t,n){const i=t.value,o=i.replace(/,/g,"");if(!/^((#+)|(#*0+))(\.0*#*)?$/.test(o)&&!/^#*0*\.((0*#*)|(#+))$/.test(o)||/,.*,/.test(i)||i.indexOf(",")>i.indexOf(".")&&i.indexOf(".")>-1)throw new Error("Incorrect format pattern.");const s=i.split("."),a=s[0],l=s[1]||"",u=i.replace(/[^#0.]/g,"").split("."),c=u[0],d=u[1]||"",_=a.indexOf(","),g=_>-1?a.length-_-1:-1;if(_>-1&&g<1||l.indexOf(",")>-1)throw new Error("Incorrect format pattern.");try{let m=0;for(;c[c.length-1-m]==="0";)++m;let h=0;for(;d[h]==="0";)++h;let w=h;for(;d[w]==="#";)++w;let J=new Intl.NumberFormat((n==null?void 0:n.value)||void 0,{useGrouping:!1,minimumIntegerDigits:Math.min(Math.max(m,1),21),minimumFractionDigits:Math.min(Math.max(h,0),100),maximumFractionDigits:Math.min(Math.max(w,h,0),100),roundingMode:"halfEven"}).format(r.value);if(_>-1&&g>0){const X=ph(n==null?void 0:n.value),R=ha(n==null?void 0:n.value);if(X&&R){const $=J.split(R),ge=$[0];let Y="";for(let Q=ge.length-1;Q>=0;--Q)Y=ge[Q]+Y,Q>0&&(ge.length-Q)%g===0&&(Y=X+Y);J=Y+($.length>1?R+$[1]:"")}}if(h===0&&w===0&&i.endsWith(".")){const X=ha(n==null?void 0:n.value);X&&(J+=X)}return{type:ae,value:J}}catch(m){throw new Error("Incorrect or unsupported number format."+m+" "+(n==null?void 0:n.value)||void 0)}}function mh(){S("toString",[ve],Ln),S("toString",[Xe],Ln),S("toString",[Nr],Ln),S("toString",[xr],Ln),S("toString",[Nn],Ln),S("toString",[ae],Ln),S("toString",[xt],Ln),S("toString",[Qt],Ln),S("toNumber",[ve],ca),S("toNumber",[ae],ca),S("toInteger",[Xe],lh),S("toInteger",[ae],ah),S("toInteger",[Nr],uh),S("toBoolean",[ve],ch),S("toBoolean",[ae],fh),S("toColor",[ae],dh),S("toUrl",[ae],hh),S("encodeUri",[ae],_h),S("decodeUri",[ae],gh),S("getIntegerValue",[ae,ve],Bo),S("getNumberValue",[ae,Xe],Bo),S("getBooleanValue",[ae,Nr],Bo),S("getStringValue",[ae,ae],Bo),S("getColorValue",[ae,xr],fa),S("getColorValue",[ae,ae],fa),S("getUrlValue",[ae,Nn],da),S("getUrlValue",[ae,ae],da),Or("toString",[ve],Ln),Or("toString",[Xe],Ln),Or("toString",[Nr],Ln),Or("toString",[xr],Ln),Or("toString",[Nn],Ln),Or("toString",[ae],Ln),Or("toString",[xt],Ln),Or("toString",[Qt],Ln),S("decimalFormat",[ve,ae],Ni),S("decimalFormat",[Xe,ae],Ni),S("decimalFormat",[ve,ae,ae],Ni),S("decimalFormat",[Xe,ae,ae],Ni),Or("decimalFormat",[ve,ae],Ni),Or("decimalFormat",[Xe,ae],Ni),Or("decimalFormat",[ve,ae,ae],Ni),Or("decimalFormat",[Xe,ae,ae],Ni)}function Rn(e,r){return!e||!r?e:e.padStart(r,"0")}const fl={G(e,r){let t;return e<4?t="short":e===5?t="narrow":t="long",r({era:t},"era")},d(e,r){return Rn(r({day:"numeric"},"day"),e>1?e:0)},D(e,r){return Rn(r({},"dayofyear"),e>1?e:0)},F(e,r){return Rn(r({},"dayofweekinmonth"),e>1?e:0)},M(e,r){let t;return e===1?t="numeric":e===2?t="2-digit":e===3?t="short":e===5?t="narrow":t="long",r({month:t,day:"numeric"},"month")},y(e,r){return Rn(r({year:e===2?"2-digit":"numeric"},"year"),e>2?e:void 0)},Y(e,r){return Rn(r({year:e===2?"2-digit":"numeric"},"weekyear"),e>2?e:void 0)},u(e,r){return Rn(r({year:"numeric"},"extendedyear"),e>1?e:void 0)},E(e,r){let t;return e<=3?t="short":e===5?t="narrow":t="long",r({weekday:t},"weekday")},e(e,r){return e>2?fl.E(e,r):Rn(r({},"weekdaynumeric"),e>1?e:void 0)},w(e,r){return Rn(r({},"week"),e>1?e:void 0)},W(e,r){return Rn(r({},"weekofmonth"),e>1?e:void 0)},H(e,r){const t=r({hour:"numeric",hour12:!1,hourCycle:"h23"},"hour");if(!t)return;const n=String(Number(t)%24);return Rn(n,e>1?e:void 0)},h(e,r){return Rn(r({hour:"numeric",hour12:!0,hourCycle:"h12"},"hour"),e>1?e:void 0)},K(e,r){const t=r({hour:"numeric",hour12:!0,hourCycle:"h11"},"hour");if(!t)return;const n=String(Number(t)%12);return Rn(n,e>1?e:void 0)},k(e,r){return Rn(r({hour:"numeric",hour12:!1,hourCycle:"h24"},"hour"),e>2?e:void 0)},a(e,r){return r({hour:"numeric",hour12:!0,hourCycle:"h11",dayPeriod:void 0},"dayPeriod")},m(e,r){return Rn(r({minute:"numeric"},"minute"),e>1?e:void 0)},s(e,r){return Rn(r({second:"numeric"},"second"),e>1?e:void 0)},S(e,r){const t=r({fractionalSecondDigits:Math.min(3,e)},"fractionalSecond");return t&&e>3?t.padEnd(e,"0"):t},z(e,r){return r({timeZoneName:e===4?"long":"short"},"timeZoneName")},Z(e,r){const t=-Number(r({},"timezoneoffset")),n=Math.abs(t/60),i=Math.floor(n)*100+(n-Math.floor(n))*60;return(t>=0?"+":"-")+Rn(String(i),4)}},bh=/(\w)\1*|''|'(''|[^'])+('|$)|./g,yh=/^'([^]*?)'?$/,wh=/''/g,vh=/[a-zA-Z]/,Ll=1e3*60*60*24;function kh(e){const r=e.match(yh);return r?r[1].replace(wh,"'"):e}function dl(e,r,t){const n=e[r?"getUTCDay":"getDay"](),i=n<t?t-n-7:t-n;return new Date(e.getTime()+Ll*i)}function _a(e,r,t){const n=new Date(e);return n[r?"setUTCDate":"setDate"](1),n[r?"setUTCMonth":"setMonth"](0),dl(n,r,t)}function ga(e,r){return Math.round((e.getTime()-r.getTime())/Ll)}function pa(e,r,t){let n=0;const i=_a(e,r||!1,t),o=new Date(e);o[r?"setUTCFullYear":"setFullYear"](e[r?"getUTCFullYear":"getFullYear"]()+1);const s=_a(o,r||!1,t),a=e.getTime()<i.getTime(),l=e.getTime()>=s.getTime();let u=e[r?"getUTCFullYear":"getFullYear"]();if(a){--u,i[r?"setUTCFullYear":"setFullYear"](i[r?"getUTCFullYear":"getFullYear"]()-1);const c=ga(dl(e,r,t),i);n=Math.round(c/7)+1}else if(l)++u,n=1;else{const c=ga(dl(e,r,t),i);n=Math.round(c/7)+1}return{week:n,year:u}}function Eh(e,r,{locale:t,isUTC:n,weekStartDay:i=0}={}){const o=(s,a)=>{if(a==="week"){const{week:c}=pa(e,n||!1,i);return String(c)}if(a==="weekofmonth"){const c=e[n?"getUTCDay":"getDay"](),d=new Date(e);d[n?"setUTCDate":"setDate"](1);const _=d[n?"getUTCDay":"getDay"](),g=e[n?"getUTCDate":"getDate"]();return String(Math.ceil(g/7)+(c<_?1:0))}if(a==="dayofweekinmonth"){const c=e[n?"getUTCDate":"getDate"]();return String(Math.ceil(c/7))}if(a==="weekdaynumeric"){let c=e[n?"getUTCDay":"getDay"]();return c<i&&(c+=7),String(c-i+1)}if(a==="dayofyear"){const c=new Date(e);c[n?"setUTCMonth":"setMonth"](0),c[n?"setUTCDate":"setDate"](1),c[n?"setUTCHours":"setHours"](1),c[n?"setUTCMinutes":"setMinutes"](1),c[n?"setUTCSeconds":"setSeconds"](1);const d=Math.ceil((e.getTime()-c.getTime())/Ll);return String(d)}if(a==="weekyear"){let{year:c}=pa(e,n||!1,i);return c<1&&(c=1-c),s.year==="2-digit"?String(c%100):String(c)}if(a==="extendedyear"){const c=e[n?"getUTCFullYear":"getFullYear"]();return s.year==="2-digit"?String(c%100):String(c)}if(a==="timezoneoffset")return n?"0":String(e.getTimezoneOffset());n&&(s.timeZone="UTC");const u=new Intl.DateTimeFormat(t,s).formatToParts(e);for(let c=0;c<u.length;++c)if(u[c].type===a)return u[c].value};return(r.match(bh)||[]).map(s=>{if(s==="''")return"'";const a=s[0];if(a==="'")return kh(s);if(fl[a])return fl[a](s.length,o);if(a.match(vh))throw new Error(`Format string contains an unescaped latin alphabet character "${a}"`);return s}).join("")}function Ah(e){const r=new Date(e);return r.setUTCMonth(r.getUTCMonth()+1),r.setUTCDate(0),r.getUTCDate()}function jh(e,r){return{type:Fr,value:new Date(Number(r.value)*1e3)}}function Ch(e,r){const t=new Date(Number(r.value)*1e3),n=t.getTimezoneOffset();return t.setMinutes(t.getMinutes()-n),{type:Fr,value:t}}function Sh(){return{type:Fr,value:new Date}}function Vh(e,r,t){return{type:Fr,value:new Date(r.value.getTime()+Number(t.value))}}function Ih(e,r,t){const n=new Date(r.value);return n.setUTCFullYear(Number(t.value)),{type:Fr,value:n}}function Dh(e,r,t){const n=Number(t.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const i=new Date(r.value);return i.setUTCMonth(n-1),{type:Fr,value:i}}function Fh(e,r,t){const n=new Date(r.value),i=Number(t.value);if(i<=0&&i!==-1||i>Ah(n))throw new Error(`Unable to set day ${i} for date ${Ri(r,!1)}.`);return n.setUTCDate(i===-1?0:i),{type:Fr,value:n}}function Th(e,r,t){const n=Number(t.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const i=new Date(r.value);return i.setUTCHours(n),{type:Fr,value:i}}function Mh(e,r,t){const n=Number(t.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const i=new Date(r.value);return i.setUTCMinutes(n),{type:Fr,value:i}}function Ph(e,r,t){const n=Number(t.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const i=new Date(r.value);return i.setUTCSeconds(n),{type:Fr,value:i}}function Nh(e,r,t){const n=Number(t.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const i=new Date(r.value);return i.setUTCMilliseconds(n),{type:Fr,value:i}}const Hi=e=>(r,t)=>{let i=new Date(t.value.getTime())[e]();return e==="getUTCMonth"?++i:e==="getUTCDay"&&i===0&&(i=7),{type:ve,value:ln(i)}};function Of(e){return(r,t,n,i)=>({type:ae,value:Eh(t.value,n.value,{locale:i==null?void 0:i.value,isUTC:e,weekStartDay:r.weekStartDay})})}const zh=Hi("getUTCFullYear"),Oh=Hi("getUTCMonth"),Lh=Hi("getUTCDate"),Rh=Hi("getUTCDay"),Bh=Hi("getUTCHours"),Hh=Hi("getUTCMinutes"),Wh=Hi("getUTCSeconds"),Uh=Hi("getUTCMilliseconds"),ma=Of(!1),ba=Of(!0);function Gh(e,r){return{type:ve,value:ln(r.value.getTime())}}function Yh(){S("parseUnixTime",[ve],jh),S("parseUnixTimeAsLocal",[ve],Ch),S("nowLocal",[],Sh),S("addMillis",[Fr,ve],Vh),S("setYear",[Fr,ve],Ih),S("setMonth",[Fr,ve],Dh),S("setDay",[Fr,ve],Fh),S("setHours",[Fr,ve],Th),S("setMinutes",[Fr,ve],Mh),S("setSeconds",[Fr,ve],Ph),S("setMillis",[Fr,ve],Nh),S("getYear",[Fr],zh),S("getMonth",[Fr],Oh),S("getDay",[Fr],Lh),S("getDayOfWeek",[Fr],Rh),S("getHours",[Fr],Bh),S("getMinutes",[Fr],Hh),S("getSeconds",[Fr],Wh),S("getMillis",[Fr],Uh),S("formatDateAsLocal",[Fr,ae],ma),S("formatDateAsUTC",[Fr,ae],ba),S("formatDateAsLocalWithLocale",[Fr,ae,ae],ma),S("formatDateAsUTCWithLocale",[Fr,ae,ae],ba),S("getTimestamp",[Fr],Gh)}function qh(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function L(e,r={}){const t=e;return t.level=r.level||"error",r.additional&&(t.additional=r.additional),t}function Jh(e,r){return{type:ve,value:ln(r.value.length)}}function Kh(e,r,t){return{type:Nr,value:r.value.includes(t.value)?1:0}}function Xh(e,r,t,n){if(n.value<t.value)throw new Error("Indexes should be in ascending order.");if(t.value<0||t.value>r.value.length||n.value<0||n.value>r.value.length)throw new Error("Indexes are out of bounds.");return{type:ae,value:r.value.substring(Number(t.value),Number(n.value))}}function Zh(e,r,t,n){let i;return t.value?i=r.value.replace(new RegExp(qh(t.value),"g"),n.value):i=r.value,{type:ae,value:i}}function Qh(e,r,t){return{type:ve,value:ln(r.value.indexOf(t.value))}}function xh(e,r,t){return{type:ve,value:ln(r.value.lastIndexOf(t.value))}}function $h(e,r){return{type:ae,value:r.value.trim()}}function e_(e,r){return{type:ae,value:r.value.replace(/^\s+/,"")}}function t_(e,r){return{type:ae,value:r.value.replace(/\s+$/,"")}}function r_(e,r){return{type:ae,value:r.value.toUpperCase()}}function n_(e,r){return{type:ae,value:r.value.toLowerCase()}}function Lf(e,r,t,n){if(!n.value.length)return e.warnings.push(L(new Error("String for padding is empty."),{level:"warn"})),"";let i="";const o=r.type===ae?r.value:Ri(r,!1);for(;i.length+o.length<t.value;)i+=n.value;return i.length>0&&i.length+o.length>t.value&&(i=i.substring(0,Number(t.value)-Number(o.length))),i}function ya(e,r,t,n){const i=Lf(e,r,t,n);return{type:ae,value:i+Ri(r,!1)}}function wa(e,r,t,n){const i=Lf(e,r,t,n);return{type:ae,value:Ri(r,!1)+i}}function i_(e,r,t){let n;try{n=new RegExp(t.value)}catch{throw new Error("Invalid regular expression.")}return{type:Nr,value:n.test(r.value)?1:0}}function o_(e,r){return{type:ae,value:r.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}function s_(){S("len",[ae],Jh),S("contains",[ae,ae],Kh),S("substring",[ae,ve,ve],Xh),S("replaceAll",[ae,ae,ae],Zh),S("index",[ae,ae],Qh),S("lastIndex",[ae,ae],xh),S("trim",[ae],$h),S("trimLeft",[ae],e_),S("trimRight",[ae],t_),S("toUpperCase",[ae],r_),S("toLowerCase",[ae],n_),S("padStart",[ae,ve,ae],ya),S("padStart",[ve,ve,ae],ya),S("padEnd",[ae,ve,ae],wa),S("padEnd",[ve,ve,ae],wa),S("testRegex",[ae,ae],i_),S("encodeRegex",[ae],o_)}function l_(e,r,t){if(t.value===Qi)throw new Error("Division by zero is not supported.");let n=r.value/t.value;return n=ro(e,n),Tn(e,n),{type:ve,value:n}}function a_(e,r,t){if(t.value===0)throw new Error("Division by zero is not supported.");const n=r.value/t.value;return{type:Xe,value:n}}function u_(e,r,t){if(t.value===Qi)throw new Error("Division by zero is not supported.");let n=r.value%t.value;return n=ro(e,n),Tn(e,n),{type:ve,value:n}}function c_(e,r,t){if(t.value===0)throw new Error("Division by zero is not supported.");const n=r.value%t.value;return{type:Xe,value:n}}function f_(e,...r){let t=r.length?r[0].value:Qi;for(let n=1;n<r.length;++n)t*=r[n].value,t=ro(e,t),Tn(e,t);return{type:ve,value:t}}function d_(e,...r){let t=r.length?r[0].value:0;for(let n=1;n<r.length;++n)t*=r[n].value;return{type:Xe,value:t}}function h_(e,...r){let t=r.length?r[0].value:Qi;for(let n=1;n<r.length;++n)t-=r[n].value,t=ro(e,t),Tn(e,t);return{type:ve,value:t}}function __(e,...r){let t=r.length?r[0].value:0;for(let n=1;n<r.length;++n)t-=r[n].value;return{type:Xe,value:t}}function g_(e,...r){let t=Qi;for(let n=0;n<r.length;++n)t+=r[n].value,t=ro(e,t),Tn(e,t);return{type:ve,value:t}}function p_(e,...r){let t=0;for(let n=0;n<r.length;++n)t+=r[n].value;return{type:Xe,value:t}}function m_(e,r){const t=If(r.value);return Tn(e,t),{type:r.type,value:t}}function b_(e,r){const t=Math.abs(r.value);return{type:Xe,value:t}}function y_(e,...r){if(!r.length)throw new Error("Function requires non empty argument list.");let t=r[0].value;for(let n=1;n<r.length;++n)r[n].value>t&&(t=r[n].value);return{type:ve,value:t}}function w_(e,...r){if(!r.length)throw new Error("Function requires non empty argument list.");return{type:Xe,value:Math.max(...r.map(t=>t.value))}}function v_(e,...r){if(!r.length)throw new Error("Function requires non empty argument list.");let t=r[0].value;for(let n=1;n<r.length;++n)r[n].value<t&&(t=r[n].value);return{type:ve,value:t}}function k_(e,...r){if(!r.length)throw new Error("Function requires non empty argument list.");return{type:Xe,value:Math.min(...r.map(t=>t.value))}}function E_(){return{type:Xe,value:Zd}}function A_(){return{type:Xe,value:Qd}}function j_(e){return Tn(e,To),{type:ve,value:To}}function C_(e){return Tn(e,Mo),{type:ve,value:Mo}}function S_(e,r){const t=Math.sign(r.value);return{type:Xe,value:t*Math.round(Math.abs(r.value))}}function V_(e,r){return{type:Xe,value:Math.floor(r.value)}}function I_(e,r){return{type:Xe,value:Math.ceil(r.value)}}function D_(e,r){return{type:ve,value:Df(r.value)}}function F_(e,r){return{type:Xe,value:Math.sign(r.value)}}function T_(e,r,t){let n;if(t.value===Qi)n=r.value;else if(r.value===Qi)n=ln(0);else{const i=Df(t.value);n=If(r.value)*i}return Tn(e,n),{type:ve,value:n}}function M_(e,r,t){let n=Math.sign(t.value);n===0&&(n=Object.is(n,0)?1:-1);const i=Math.abs(r.value)*n;return{type:Xe,value:i}}function P_(){S("div",[ve,ve],l_),S("div",[Xe,Xe],a_),S("mod",[ve,ve],u_),S("mod",[Xe,Xe],c_),S("mul",[{type:ve,isVararg:!0}],f_),S("mul",[{type:Xe,isVararg:!0}],d_),S("sub",[{type:ve,isVararg:!0}],h_),S("sub",[{type:Xe,isVararg:!0}],__),S("sum",[{type:ve,isVararg:!0}],g_),S("sum",[{type:Xe,isVararg:!0}],p_),S("abs",[ve],m_),S("abs",[Xe],b_),S("max",[{type:ve,isVararg:!0}],y_),S("max",[{type:Xe,isVararg:!0}],w_),S("min",[{type:ve,isVararg:!0}],v_),S("min",[{type:Xe,isVararg:!0}],k_),S("maxNumber",[],E_),S("minNumber",[],A_),S("maxInteger",[],j_),S("minInteger",[],C_),S("round",[Xe],S_),S("floor",[Xe],V_),S("ceil",[Xe],I_),S("signum",[ve],D_),S("signum",[Xe],F_),S("copySign",[ve,ve],T_),S("copySign",[Xe,Xe],M_)}function Ts(e){return(r,t)=>{const n=Is(t.value);return{type:Xe,value:n[e]/255}}}function Ms(e){return(r,t,n)=>{const i=Is(t.value);return i[e]=n.value*255,{type:xr,value:no(i)}}}const va=Ts("a"),ka=Ts("r"),Ea=Ts("g"),Aa=Ts("b"),ja=Ms("a"),Ca=Ms("r"),Sa=Ms("g"),Va=Ms("b");function N_(e,r,t,n){const i={a:255,r:r.value*255,g:t.value*255,b:n.value*255};return{type:xr,value:no(i)}}function z_(e,r,t,n,i){const o={a:r.value*255,r:t.value*255,g:n.value*255,b:i.value*255};return{type:xr,value:no(o)}}function O_(){S("getColorAlpha",[ae],va),S("getColorAlpha",[xr],va),S("getColorRed",[ae],ka),S("getColorRed",[xr],ka),S("getColorGreen",[ae],Ea),S("getColorGreen",[xr],Ea),S("getColorBlue",[ae],Aa),S("getColorBlue",[xr],Aa),S("setColorAlpha",[ae,Xe],ja),S("setColorAlpha",[xr,Xe],ja),S("setColorRed",[ae,Xe],Ca),S("setColorRed",[xr,Xe],Ca),S("setColorGreen",[ae,Xe],Sa),S("setColorGreen",[xr,Xe],Sa),S("setColorBlue",[ae,Xe],Va),S("setColorBlue",[xr,Xe],Va),S("rgb",[Xe,Xe,Xe],N_),S("argb",[Xe,Xe,Xe,Xe],z_)}function Wi(e,r,t,n){if(r.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=ln(r.value)/ln(t);return Tn(e,i),n&&(i=ln(i)%ln(n)),{type:ve,value:i}}const Rf=1e3,L_=60,Bf=1e3*60,R_=60,Hf=1e3*60*60,B_=24,H_=1e3*60*60*24,W_=1e3*60*60*24*7;function U_(e,r){return Wi(e,r,Rf,L_)}function G_(e,r){return Wi(e,r,Rf)}function Y_(e,r){return Wi(e,r,Bf,R_)}function q_(e,r){return Wi(e,r,Bf)}function J_(e,r){return Wi(e,r,Hf,B_)}function K_(e,r){return Wi(e,r,Hf)}function X_(e,r){return Wi(e,r,H_)}function Z_(e,r){return Wi(e,r,W_)}function Q_(){S("getIntervalSeconds",[ve],U_),S("getIntervalTotalSeconds",[ve],G_),S("getIntervalMinutes",[ve],Y_),S("getIntervalTotalMinutes",[ve],q_),S("getIntervalHours",[ve],J_),S("getIntervalTotalHours",[ve],K_),S("getIntervalTotalDays",[ve],X_),S("getIntervalTotalWeeks",[ve],Z_)}function x_(e,r){let t=e;for(let n=0;n<r.length;++n){if(!t)throw new Error(`Missing property "${r[n]}" in the dict.`);const i=t[r[n]];if(i===void 0)throw new Error(`Missing property "${r[n]}" in the dict.`);t=i}return t}function Ui(e){return(r,t,...n)=>{if(n.length===0)throw new Error("Non empty argument list is required.");const i=x_(t.value,n.map(o=>o.value));return Ds(r,i,e)}}function yo(e,r){return(t,n,i,...o)=>{try{return e(t,i,...o)}catch{let a=n.value;return r==="color"?a=Bi(a):r==="url"&&ii(a),{type:r,value:a}}}}const xo=Ui(ae),$o=Ui(Xe),es=Ui(ve),ts=Ui(Nr),rs=Ui(xr),ns=Ui(Nn),hl=Ui(xt),_l=Ui(Qt),Ia=yo(xo,ae),Da=yo($o,Xe),Fa=yo(es,ve),Ta=yo(ts,Nr),Ho=yo(rs,xr),Wo=yo(ns,Nn);function $_(e,r,...t){try{return hl(e,r,...t)}catch{return{type:xt,value:[]}}}function eg(e,r,...t){try{return _l(e,r,...t)}catch{return{type:Qt,value:{}}}}function tg(e,r,t){return{type:Nr,value:t.value in r.value?1:0}}function rg(e,r){return{type:Nr,value:Object.keys(r.value).length?0:1}}function ng(e,r){return{type:ve,value:ln(Object.keys(r.value).length)}}function Ma(e,r){return{type:xt,value:Object.keys(r.value)}}function Pa(e,r){return{type:xt,value:Object.values(r.value)}}function ig(){const e={type:ae,isVararg:!0};S("getDictString",[Qt,e],xo),S("getStringFromDict",[Qt,e],xo),S("getDictNumber",[Qt,e],$o),S("getNumberFromDict",[Qt,e],$o),S("getDictInteger",[Qt,e],es),S("getIntegerFromDic