@lipsjs/lips 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lips.min.js +2 -2
- package/dist/lips.min.js.map +10 -9
- package/dist/test.component.min.js +280 -65
- package/dist/test.component.min.js.map +11 -12
- package/dist/test.stress.min.js +8 -8
- package/dist/test.stress.min.js.map +10 -9
- package/dist/types/syntax/async.d.ts +7 -8
- package/dist/types/syntax/for.d.ts +9 -4
- package/dist/types/types.d.ts +7 -3
- package/dist/types/utils.d.ts +2 -1
- package/package.json +1 -1
package/dist/lips.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var w6=Object.create;var{defineProperty:T0,getPrototypeOf:Y6,getOwnPropertyNames:M6}=Object;var K6=Object.prototype.hasOwnProperty;var A0=(J,Z,H)=>{H=J!=null?w6(Y6(J)):{};const X=Z||!J||!J.__esModule?T0(H,"default",{value:J,enumerable:!0}):H;for(let q of M6(J))if(!K6.call(X,q))T0(X,q,{get:()=>J[q],enumerable:!0});return X};var j6=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var m1=(J,Z)=>{for(var H in Z)T0(J,H,{get:Z[H],enumerable:!0,configurable:!0,set:(X)=>Z[H]=()=>X})};var e1=j6((Q5,W5)=>{(function(){var J=document,Z=window,H=J.documentElement,X=J.createElement.bind(J),q=X("div"),W=X("table"),G=X("tbody"),Y=X("tr"),w=Array.isArray,M=Array.prototype,O=M.concat,C=M.filter,b=M.indexOf,i=M.map,e=M.push,r=M.slice,H1=M.some,t=M.splice,J1=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,h=/<.+>/,u=/^\w+$/;function v(Q,z){var B=V(z);return!Q||!B&&!F(z)&&!S(z)?[]:!B&&d.test(Q)?z.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!B&&u.test(Q)?z.getElementsByTagName(Q):z.querySelectorAll(Q)}var T=function(){function Q(z,B){if(!z)return;if(D(z))return z;var K=z;if(A(z)){var N=B||J;if(K=J1.test(z)&&F(N)?N.getElementById(z.slice(1).replace(/\\/g,"")):h.test(z)?d0(z):D(N)?N.find(z):A(N)?j(N).find(z):v(z,N),!K)return}else if(f(z))return this.ready(z);if(K.nodeType||K===Z)K=[K];this.length=K.length;for(var R=0,y=this.length;R<y;R++)this[R]=K[R]}return Q.prototype.init=function(z,B){return new Q(z,B)},Q}(),U=T.prototype,j=U.init;if(j.fn=j.prototype=U,U.length=0,U.splice=t,typeof Symbol==="function")U[Symbol.iterator]=M[Symbol.iterator];function D(Q){return Q instanceof T}function P(Q){return!!Q&&Q===Q.window}function F(Q){return!!Q&&Q.nodeType===9}function V(Q){return!!Q&&Q.nodeType===11}function S(Q){return!!Q&&Q.nodeType===1}function m(Q){return!!Q&&Q.nodeType===3}function c(Q){return typeof Q==="boolean"}function f(Q){return typeof Q==="function"}function A(Q){return typeof Q==="string"}function $(Q){return Q===void 0}function k(Q){return Q===null}function E(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function _(Q){if(typeof Q!=="object"||Q===null)return!1;var z=Object.getPrototypeOf(Q);return z===null||z===Object.prototype}j.isWindow=P,j.isFunction=f,j.isArray=w,j.isNumeric=E,j.isPlainObject=_;function L(Q,z,B){if(B){var K=Q.length;while(K--)if(z.call(Q[K],K,Q[K])===!1)return Q}else if(_(Q)){var N=Object.keys(Q);for(var K=0,R=N.length;K<R;K++){var y=N[K];if(z.call(Q[y],y,Q[y])===!1)return Q}}else for(var K=0,R=Q.length;K<R;K++)if(z.call(Q[K],K,Q[K])===!1)return Q;return Q}j.each=L,U.each=function(Q){return L(this,Q)},U.empty=function(){return this.each(function(Q,z){while(z.firstChild)z.removeChild(z.firstChild)})};function g(){var Q=[];for(var z=0;z<arguments.length;z++)Q[z]=arguments[z];var B=c(Q[0])?Q.shift():!1,K=Q.shift(),N=Q.length;if(!K)return{};if(!N)return g(B,j,K);for(var R=0;R<N;R++){var y=Q[R];for(var l in y)if(B&&(w(y[l])||_(y[l]))){if(!K[l]||K[l].constructor!==y[l].constructor)K[l]=new y[l].constructor;g(B,K[l],y[l])}else K[l]=y[l]}return K}j.extend=g,U.extend=function(Q){return g(U,Q)};var I=/\S+/g;function x(Q){return A(Q)?Q.match(I)||[]:[]}U.toggleClass=function(Q,z){var B=x(Q),K=!$(z);return this.each(function(N,R){if(!S(R))return;L(B,function(y,l){if(K)z?R.classList.add(l):R.classList.remove(l);else R.classList.toggle(l)})})},U.addClass=function(Q){return this.toggleClass(Q,!0)},U.removeAttr=function(Q){var z=x(Q);return this.each(function(B,K){if(!S(K))return;L(z,function(N,R){K.removeAttribute(R)})})};function a(Q,z){if(!Q)return;if(A(Q)){if(arguments.length<2){if(!this[0]||!S(this[0]))return;var B=this[0].getAttribute(Q);return k(B)?void 0:B}if($(z))return this;if(k(z))return this.removeAttr(Q);return this.each(function(N,R){if(!S(R))return;R.setAttribute(Q,z)})}for(var K in Q)this.attr(K,Q[K]);return this}U.attr=a,U.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},U.hasClass=function(Q){return!!Q&&H1.call(this,function(z){return S(z)&&z.classList.contains(Q)})},U.get=function(Q){if($(Q))return r.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},U.eq=function(Q){return j(this.get(Q))},U.first=function(){return this.eq(0)},U.last=function(){return this.eq(-1)};function n(Q){if($(Q))return this.get().map(function(z){return S(z)||m(z)?z.textContent:""}).join("");return this.each(function(z,B){if(!S(B))return;B.textContent=Q})}U.text=n;function p(Q,z,B){if(!S(Q))return;var K=Z.getComputedStyle(Q,null);return B?K.getPropertyValue(z)||void 0:K[z]||Q.style[z]}function s(Q,z){return parseInt(p(Q,z),10)||0}function o(Q,z){return s(Q,"border".concat(z?"Left":"Top","Width"))+s(Q,"padding".concat(z?"Left":"Top"))+s(Q,"padding".concat(z?"Right":"Bottom"))+s(Q,"border".concat(z?"Right":"Bottom","Width"))}var Q1={};function L1(Q){if(Q1[Q])return Q1[Q];var z=X(Q);J.body.insertBefore(z,null);var B=p(z,"display");return J.body.removeChild(z),Q1[Q]=B!=="none"?B:"block"}function g1(Q){return p(Q,"display")==="none"}function u0(Q,z){var B=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!B&&!!z&&B.call(Q,z)}function p1(Q){return A(Q)?function(z,B){return u0(B,Q)}:f(Q)?Q:D(Q)?function(z,B){return Q.is(B)}:!Q?function(){return!1}:function(z,B){return B===Q}}U.filter=function(Q){var z=p1(Q);return j(C.call(this,function(B,K){return z.call(B,K,B)}))};function E1(Q,z){return!z?Q:Q.filter(z)}U.detach=function(Q){return E1(this,Q).each(function(z,B){if(B.parentNode)B.parentNode.removeChild(B)}),this};var y5=/^\s*<(\w+)[^>]*>/,v5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,m0={"*":q,tr:G,td:Y,th:Y,thead:W,tbody:W,tfoot:W};function d0(Q){if(!A(Q))return[];if(v5.test(Q))return[X(RegExp.$1)];var z=y5.test(Q)&&RegExp.$1,B=m0[z]||m0["*"];return B.innerHTML=Q,j(B.childNodes).detach().get()}j.parseHTML=d0,U.has=function(Q){var z=A(Q)?function(B,K){return v(Q,K).length}:function(B,K){return K.contains(Q)};return this.filter(z)},U.not=function(Q){var z=p1(Q);return this.filter(function(B,K){return(!A(Q)||S(K))&&!z.call(K,B,K)})};function I1(Q,z,B,K){var N=[],R=f(z),y=K&&p1(K);for(var l=0,j1=Q.length;l<j1;l++)if(R){var q1=z(Q[l]);if(q1.length)e.apply(N,q1)}else{var U1=Q[l][z];while(U1!=null){if(K&&y(-1,U1))break;N.push(U1),U1=B?U1[z]:null}}return N}function i0(Q){if(Q.multiple&&Q.options)return I1(C.call(Q.options,function(z){return z.selected&&!z.disabled&&!z.parentNode.disabled}),"value");return Q.value||""}function u5(Q){if(!arguments.length)return this[0]&&i0(this[0]);return this.each(function(z,B){var K=B.multiple&&B.options;if(K||J5.test(B.type)){var N=w(Q)?i.call(Q,String):k(Q)?[]:[String(Q)];if(K)L(B.options,function(R,y){y.selected=N.indexOf(y.value)>=0},!0);else B.checked=N.indexOf(B.value)>=0}else B.value=$(Q)||k(Q)?"":Q})}U.val=u5,U.is=function(Q){var z=p1(Q);return H1.call(this,function(B,K){return z.call(B,K,B)})},j.guid=1;function F1(Q){return Q.length>1?C.call(Q,function(z,B,K){return b.call(K,z)===B}):Q}j.unique=F1,U.add=function(Q,z){return j(F1(this.get().concat(j(Q,z).get())))},U.children=function(Q){return E1(j(F1(I1(this,function(z){return z.children}))),Q)},U.parent=function(Q){return E1(j(F1(I1(this,"parentNode"))),Q)},U.index=function(Q){var z=Q?j(Q)[0]:this[0],B=Q?this:j(z).parent().children();return b.call(B,z)},U.closest=function(Q){var z=this.filter(Q);if(z.length)return z;var B=this.parent();if(!B.length)return z;return B.closest(Q)},U.siblings=function(Q){return E1(j(F1(I1(this,function(z){return j(z).parent().children().not(z)}))),Q)},U.find=function(Q){return j(F1(I1(this,function(z){return v(Q,z)})))};var m5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,d5=/^$|^module$|\/(java|ecma)script/i,i5=["type","src","nonce","noModule"];function c5(Q,z){var B=j(Q);B.filter("script").add(B.find("script")).each(function(K,N){if(d5.test(N.type)&&H.contains(N)){var R=X("script");R.text=N.textContent.replace(m5,""),L(i5,function(y,l){if(N[l])R[l]=N[l]}),z.head.insertBefore(R,null),z.head.removeChild(R)}})}function p5(Q,z,B,K,N){if(K)Q.insertBefore(z,B?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(z,Q);else Q.parentNode.insertBefore(z,B?Q:Q.nextSibling);if(N)c5(z,Q.ownerDocument)}function R1(Q,z,B,K,N,R,y,l){return L(Q,function(j1,q1){L(j(q1),function(U1,A1){L(j(z),function(D1,l1){var P0=B?A1:l1,$0=B?l1:A1,w1=B?U1:D1;p5(P0,!w1?$0:$0.cloneNode(!0),K,N,!w1)},l)},y)},R),z}U.after=function(){return R1(arguments,this,!1,!1,!1,!0,!0)},U.append=function(){return R1(arguments,this,!1,!1,!0)};function s5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if($(Q))return this;var z=/<script[\s>]/.test(Q);return this.each(function(B,K){if(!S(K))return;if(z)j(K).empty().append(Q);else K.innerHTML=Q})}U.html=s5,U.appendTo=function(Q){return R1(arguments,this,!0,!1,!0)},U.wrapInner=function(Q){return this.each(function(z,B){var K=j(B),N=K.contents();N.length?N.wrapAll(Q):K.append(Q)})},U.before=function(){return R1(arguments,this,!1,!0)},U.wrapAll=function(Q){var z=j(Q),B=z[0];while(B.children.length)B=B.firstElementChild;return this.first().before(z),this.appendTo(B)},U.wrap=function(Q){return this.each(function(z,B){var K=j(Q)[0];j(B).wrapAll(!z?K:K.cloneNode(!0))})},U.insertAfter=function(Q){return R1(arguments,this,!0,!1,!1,!1,!1,!0)},U.insertBefore=function(Q){return R1(arguments,this,!0,!0)},U.prepend=function(){return R1(arguments,this,!1,!0,!0,!0,!0)},U.prependTo=function(Q){return R1(arguments,this,!0,!0,!0,!1,!1,!0)},U.contents=function(){return j(F1(I1(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},U.next=function(Q,z,B){return E1(j(F1(I1(this,"nextElementSibling",z,B))),Q)},U.nextAll=function(Q){return this.next(Q,!0)},U.nextUntil=function(Q,z){return this.next(z,!0,Q)},U.parents=function(Q,z){return E1(j(F1(I1(this,"parentElement",!0,z))),Q)},U.parentsUntil=function(Q,z){return this.parents(z,Q)},U.prev=function(Q,z,B){return E1(j(F1(I1(this,"previousElementSibling",z,B))),Q)},U.prevAll=function(Q){return this.prev(Q,!0)},U.prevUntil=function(Q,z){return this.prev(z,!0,Q)},U.map=function(Q){return j(O.apply([],i.call(this,function(z,B){return Q.call(z,B,z)})))},U.clone=function(){return this.map(function(Q,z){return z.cloneNode(!0)})},U.offsetParent=function(){return this.map(function(Q,z){var B=z.offsetParent;while(B&&p(B,"position")==="static")B=B.offsetParent;return B||H})},U.slice=function(Q,z){return j(r.call(this,Q,z))};var l5=/-([a-z])/g;function O0(Q){return Q.replace(l5,function(z,B){return B.toUpperCase()})}U.ready=function(Q){var z=function(){return setTimeout(Q,0,j)};if(J.readyState!=="loading")z();else J.addEventListener("DOMContentLoaded",z);return this},U.unwrap=function(){return this.parent().each(function(Q,z){if(z.tagName==="BODY")return;var B=j(z);B.replaceWith(B.children())}),this},U.offset=function(){var Q=this[0];if(!Q)return;var z=Q.getBoundingClientRect();return{top:z.top+Z.pageYOffset,left:z.left+Z.pageXOffset}},U.position=function(){var Q=this[0];if(!Q)return;var z=p(Q,"position")==="fixed",B=z?Q.getBoundingClientRect():this.offset();if(!z){var K=Q.ownerDocument,N=Q.offsetParent||K.documentElement;while((N===K.body||N===K.documentElement)&&p(N,"position")==="static")N=N.parentNode;if(N!==Q&&S(N)){var R=j(N).offset();B.top-=R.top+s(N,"borderTopWidth"),B.left-=R.left+s(N,"borderLeftWidth")}}return{top:B.top-s(Q,"marginTop"),left:B.left-s(Q,"marginLeft")}};var c0={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};U.prop=function(Q,z){if(!Q)return;if(A(Q)){if(Q=c0[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(K,N){N[Q]=z})}for(var B in Q)this.prop(B,Q[B]);return this},U.removeProp=function(Q){return this.each(function(z,B){delete B[c0[Q]||Q]})};var o5=/^--/;function L0(Q){return o5.test(Q)}var F0={},r5=q.style,n5=["webkit","moz","ms"];function a5(Q,z){if(z===void 0)z=L0(Q);if(z)return Q;if(!F0[Q]){var B=O0(Q),K="".concat(B[0].toUpperCase()).concat(B.slice(1)),N="".concat(B," ").concat(n5.join("".concat(K," "))).concat(K).split(" ");L(N,function(R,y){if(y in r5)return F0[Q]=y,!1})}return F0[Q]}var t5={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function p0(Q,z,B){if(B===void 0)B=L0(Q);return!B&&!t5[Q]&&E(z)?"".concat(z,"px"):z}function e5(Q,z){if(A(Q)){var B=L0(Q);if(Q=a5(Q,B),arguments.length<2)return this[0]&&p(this[0],Q,B);if(!Q)return this;return z=p0(Q,z,B),this.each(function(N,R){if(!S(R))return;if(B)R.style.setProperty(Q,z);else R.style[Q]=z})}for(var K in Q)this.css(K,Q[K]);return this}U.css=e5;function s0(Q,z){try{return Q(z)}catch(B){return z}}var J6=/^\s+|\s+$/;function l0(Q,z){var B=Q.dataset[z]||Q.dataset[O0(z)];if(J6.test(B))return B;return s0(JSON.parse,B)}function Z6(Q,z,B){B=s0(JSON.stringify,B),Q.dataset[O0(z)]=B}function Q6(Q,z){if(!Q){if(!this[0])return;var B={};for(var K in this[0].dataset)B[K]=l0(this[0],K);return B}if(A(Q)){if(arguments.length<2)return this[0]&&l0(this[0],Q);if($(z))return this;return this.each(function(N,R){Z6(R,Q,z)})}for(var K in Q)this.data(K,Q[K]);return this}U.data=Q6;function o0(Q,z){var B=Q.documentElement;return Math.max(Q.body["scroll".concat(z)],B["scroll".concat(z)],Q.body["offset".concat(z)],B["offset".concat(z)],B["client".concat(z)])}L([!0,!1],function(Q,z){L(["Width","Height"],function(B,K){var N="".concat(z?"outer":"inner").concat(K);U[N]=function(R){if(!this[0])return;if(P(this[0]))return z?this[0]["inner".concat(K)]:this[0].document.documentElement["client".concat(K)];if(F(this[0]))return o0(this[0],K);return this[0]["".concat(z?"offset":"client").concat(K)]+(R&&z?s(this[0],"margin".concat(B?"Top":"Left"))+s(this[0],"margin".concat(B?"Bottom":"Right")):0)}})}),L(["Width","Height"],function(Q,z){var B=z.toLowerCase();U[B]=function(K){if(!this[0])return $(K)?void 0:this;if(!arguments.length){if(P(this[0]))return this[0].document.documentElement["client".concat(z)];if(F(this[0]))return o0(this[0],z);return this[0].getBoundingClientRect()[B]-o(this[0],!Q)}var N=parseInt(K,10);return this.each(function(R,y){if(!S(y))return;var l=p(y,"boxSizing");y.style[B]=p0(B,N+(l==="border-box"?o(y,!Q):0))})}});var r0="___cd";U.toggle=function(Q){return this.each(function(z,B){if(!S(B))return;var K=g1(B),N=$(Q)?K:Q;if(N){if(B.style.display=B[r0]||"",g1(B))B.style.display=L1(B.tagName)}else if(!K)B[r0]=p(B,"display"),B.style.display="none"})},U.hide=function(){return this.toggle(!1)},U.show=function(){return this.toggle(!0)};var n0="___ce",I0=".",V0={focus:"focusin",blur:"focusout"},a0={mouseenter:"mouseover",mouseleave:"mouseout"},W6=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function N0(Q){return a0[Q]||V0[Q]||Q}function C0(Q){var z=Q.split(I0);return[z[0],z.slice(1).sort()]}U.trigger=function(Q,z){if(A(Q)){var B=C0(Q),K=B[0],N=B[1],R=N0(K);if(!R)return this;var y=W6.test(R)?"MouseEvents":"HTMLEvents";Q=J.createEvent(y),Q.initEvent(R,!0,!0),Q.namespace=N.join(I0),Q.___ot=K}Q.___td=z;var l=Q.___ot in V0;return this.each(function(j1,q1){if(l&&f(q1[Q.___ot]))q1["___i".concat(Q.type)]=!0,q1[Q.___ot](),q1["___i".concat(Q.type)]=!1;q1.dispatchEvent(Q)})};function t0(Q){return Q[n0]=Q[n0]||{}}function H6(Q,z,B,K,N){var R=t0(Q);R[z]=R[z]||[],R[z].push([B,K,N]),Q.addEventListener(z,N)}function e0(Q,z){return!z||!H1.call(z,function(B){return Q.indexOf(B)<0})}function s1(Q,z,B,K,N){var R=t0(Q);if(!z)for(z in R)s1(Q,z,B,K,N);else if(R[z])R[z]=R[z].filter(function(y){var l=y[0],j1=y[1],q1=y[2];if(N&&q1.guid!==N.guid||!e0(l,B)||K&&K!==j1)return!0;Q.removeEventListener(z,q1)})}U.off=function(Q,z,B){var K=this;if($(Q))this.each(function(R,y){if(!S(y)&&!F(y)&&!P(y))return;s1(y)});else if(!A(Q))for(var N in Q)this.off(N,Q[N]);else{if(f(z))B=z,z="";L(x(Q),function(R,y){var l=C0(y),j1=l[0],q1=l[1],U1=N0(j1);K.each(function(A1,D1){if(!S(D1)&&!F(D1)&&!P(D1))return;s1(D1,U1,q1,z,B)})})}return this},U.remove=function(Q){return E1(this,Q).detach().off(),this},U.replaceWith=function(Q){return this.before(Q).remove()},U.replaceAll=function(Q){return j(Q).replaceWith(this),this};function X6(Q,z,B,K,N){var R=this;if(!A(Q)){for(var y in Q)this.on(y,z,B,Q[y],N);return this}if(!A(z))if($(z)||k(z))z="";else if($(B))B=z,z="";else K=B,B=z,z="";if(!f(K))K=B,B=void 0;if(!K)return this;return L(x(Q),function(l,j1){var q1=C0(j1),U1=q1[0],A1=q1[1],D1=N0(U1),l1=U1 in a0,P0=U1 in V0;if(!D1)return;R.each(function($0,w1){if(!S(w1)&&!F(w1)&&!P(w1))return;var E0=function(z1){if(z1.target["___i".concat(z1.type)])return z1.stopImmediatePropagation();if(z1.namespace&&!e0(A1,z1.namespace.split(I0)))return;if(!z&&(P0&&(z1.target!==w1||z1.___ot===D1)||l1&&z1.relatedTarget&&w1.contains(z1.relatedTarget)))return;var R0=w1;if(z){var k1=z1.target;while(!u0(k1,z)){if(k1===w1)return;if(k1=k1.parentNode,!k1)return}R0=k1}Object.defineProperty(z1,"currentTarget",{configurable:!0,get:function(){return R0}}),Object.defineProperty(z1,"delegateTarget",{configurable:!0,get:function(){return w1}}),Object.defineProperty(z1,"data",{configurable:!0,get:function(){return B}});var U6=K.call(R0,z1,z1.___td);if(N)s1(w1,D1,A1,z,E0);if(U6===!1)z1.preventDefault(),z1.stopPropagation()};E0.guid=K.guid=K.guid||j.guid++,H6(w1,D1,A1,z,E0)})}),this}U.on=X6;function q6(Q,z,B,K){return this.on(Q,z,B,K,!0)}U.one=q6;var z6=/\r?\n/g;function B6(Q,z){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(z.replace(z6,"\r\n")))}var G6=/file|reset|submit|button|image/i,J5=/radio|checkbox/i;if(U.serialize=function(){var Q="";return this.each(function(z,B){L(B.elements||[B],function(K,N){if(N.disabled||!N.name||N.tagName==="FIELDSET"||G6.test(N.type)||J5.test(N.type)&&!N.checked)return;var R=i0(N);if(!$(R)){var y=w(R)?R:[R];L(y,function(l,j1){Q+=B6(N.name,j1)})}})}),Q.slice(1)},typeof Q5!=="undefined")W5.exports=j;else Z.cash=Z.$=j})()});class o1{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,Z){this.callbacks.set(J,Z)}unregister(J){this.callbacks.delete(J)}queue(J){if(!this.callbacks.has(J))return;if(this.pendingComponents.add(J),!this.isPending)this.isPending=!0,this.schedule()}schedule(){Promise.resolve().then(()=>this.process())}process(){const J=Array.from(this.pendingComponents);this.pendingComponents.clear(),this.isPending=!1,J.forEach((Z)=>{try{const H=this.callbacks.get(Z);if(H)H()}catch(H){console.error(`Error updating component ${Z}:`,H)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class r1{subscriptions=new Map;tick=new o1;register(J,Z){this.subscriptions.set(J,Z),this.tick.register(J,Z)}unregister(J){this.subscriptions.delete(J),this.tick.unregister(J)}queueUpdate(J){this.tick.queue(J)}dispose(){this.subscriptions.clear(),this.tick.dispose()}prepareForPotentialUnload(){this.tick.clear(),this.subscriptions.forEach((J,Z)=>{this.subscriptions.set(Z,()=>{})})}proxyState(J,Z){const H=this,X=new WeakMap,q=(G)=>{if(typeof G.toJSON==="function")return G;if(G instanceof Map)G.forEach((w,M)=>G.set(M,W(w)));else if(Array.isArray(G))G.forEach((w,M)=>G[M]=W(w));else if(typeof G==="object")Object.entries(G).forEach(([w,M])=>G[w]=W(M));let Y=new Proxy(G,{get(w,M){if(M==="toJSON")return function(){const C=(b)=>{if(!b||typeof b!=="object")return b;if(X.has(b)){const i=X.get(b);if(i instanceof Map){const r={};return i.forEach((H1,t)=>r[typeof t==="object"?JSON.stringify(t):String(t)]=C(H1)),r}if(Array.isArray(i))return i.map((r)=>C(r));const e={};return Object.entries(i).forEach(([r,H1])=>e[r]=C(H1)),e}if(typeof b.toJSON==="function"&&!X.has(b))return b.toJSON();return b};return C(Y)};if(M==="reset")return function(){Y=null};const O=w[M];if(G instanceof Map&&typeof O==="function")return function(...C){const b=M.toString();if(b==="set"&&C.length>=2)C[1]=W(C[1]);const i=O.apply(w,C);return["set","delete","clear"].includes(b)&&H.queueUpdate(J),i};if(Array.isArray(G)&&typeof O==="function")return function(...C){const b=M.toString();if(["push","unshift"].includes(b))C=C.map((e)=>W(e));else if(b==="splice"&&C.length>2)C=[C[0],C[1],...C.slice(2).map((e)=>W(e))];const i=O.apply(w,C);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(b)&&H.queueUpdate(J),i};return O},set(w,M,O){if(w[M]===O)return!0;if(O instanceof Map&&w[M]instanceof Map){const C=w[M];return C.clear(),O.forEach((b,i)=>C.set(i,W(b))),H.queueUpdate(J),!0}return w[M]=W(O),H.queueUpdate(J),!0}});return X.set(Y,G),Y},W=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Z)}}class n1{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Z)=>{try{const H=Z.node;if(!H){this.unwatch(Z);return}if(J.type==="attach"&&document.contains(H[0]))this.unwatch(Z),Z.emit("component:attached"),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();else if(J.type==="detach"&&!document.contains(H[0]))this.unwatch(Z),Z.emit("component:detached"),typeof Z.onDetach=="function"&&Z.onDetach.bind(Z)()}catch(H){console.log("DWS error --",H)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Z="attach"){const H=J.node;if(!H)return;if(Z==="attach"&&document.contains(H[0])){J.emit("component:attached"),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Z==="detach"&&!document.contains(H[0])){J.emit("component:detached"),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const X=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Z}ment-timeout`)},this.TIMEOUT);this.observedComponents.set(J,{timeout:X,type:Z}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Z==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const Z=this.observedComponents.get(J);if(Z)clearTimeout(Z.timeout),this.observedComponents.delete(J);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((J)=>clearTimeout(J.timeout)),this.observedComponents.clear()}}var a1=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(H,X)=>{return Z[X]!==void 0?Z[X].toString():`{${X}}`})},Z5=(J,Z,H,X,q)=>{switch(J){case"plural":{if(typeof H==="string"){console.warn("Plural format value cannot be a string");return}if(X.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let Y=H["*"];if(typeof Y==="object")Y=Y[q||"*"];return a1(Y,X)}if(typeof X.count==="string")X.count=Number(X.count);let W="*";if(X.count.toString()in H)W=X.count.toString();let G=H[W]||H["*"];if(typeof G==="object")G=G[q||"*"];return a1(G,X)}case"condition":{if(typeof H==="string"){console.warn("Condition format value cannot be a string");return}let W;for(let G in H)try{if(new Function("params",`with( params ){ return ${G}; }`)(X||{})){W=H[G];break}}catch(Y){console.warn(`Invalid <${Z}(${G})> condition expression`)}if(W===void 0)return;if(typeof W==="object")W=W[q||"*"];return a1(W,X)}case"variable":default:{const W=typeof H==="object"?H[q||"*"]:H;if(typeof W==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return a1(W,X)}}};class t1{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,Z){this.DICTIONARIES[J]=Z}translate(J,Z){if(Z&&this.currentLang===Z)return{text:J,lang:this.currentLang};Z=Z||this.currentLang;const[H,X]=Z.split("-");if(this.DICTIONARIES[H]&&J in this.DICTIONARIES[H]){if(typeof this.DICTIONARIES[H][J]==="object"){const q=this.DICTIONARIES[H][J];J=q[X||"*"]||q["*"]}else if(typeof this.DICTIONARIES[H][J]==="string")J=this.DICTIONARIES[H][J]}return{text:J,lang:Z}}format(J,Z,H){H=H||this.currentLang;const[X,q]=H.split("-");if(!this.DICTIONARIES[X]){console.warn(`Undefined <${H}> format dictionary`);return}if(!this.DICTIONARIES[X][J]){console.warn(`Undefined <${H}[${J}]> format reference`);return}const W=this.DICTIONARIES[X][J];if(typeof W==="string"){console.warn(`Invalid <${H}[${J}]> format reference. Expected object`);return}if(typeof W!=="object"||W===null||Array.isArray(W)){console.warn(`Invalid <${H}[${J}]> format value`);return}return Z5(W.type,J,W.value,Z,q)}}var C5=A0(e1(),1);var J0="comm",Z0="rule",Q0="decl";var H5="@import";var X5="@namespace",q5="@keyframes";var z5="@layer";function W0(J){return J.trim()}function _1(J,Z,H){return J.replace(Z,H)}function B5(J,Z,H){return J.indexOf(Z,H)}function V1(J,Z){return J.charCodeAt(Z)|0}function N1(J,Z,H){return J.slice(Z,H)}function G1(J){return J.length}function H0(J){return J.length}function h1(J,Z){return Z.push(J),J}var S0=Math.abs,d1=String.fromCharCode;function q0(J,Z,H,X,q,W,G,Y){return{value:J,root:Z,parent:H,type:X,props:q,children:W,line:X0,column:f1,length:G,return:"",siblings:Y}}function U5(){return X1}function w5(){if(X1=M1>0?V1(v1,--M1):0,f1--,X1===10)f1=1,X0--;return X1}function K1(){if(X1=M1<G5?V1(v1,M1++):0,f1++,X1===10)f1=1,X0++;return X1}function C1(){return V1(v1,M1)}function i1(){return M1}function z0(J,Z){return N1(v1,J,Z)}function y1(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Y5(J){return X0=f1=1,G5=G1(v1=J),M1=0,[]}function M5(J){return v1="",J}function B0(J){return W0(z0(M1-1,b0(J===91?J+2:J===40?J+1:J)))}function K5(J){while(X1=C1())if(X1<33)K1();else break;return y1(J)>2||y1(X1)>3?"":" "}function j5(J,Z){while(--Z&&K1())if(X1<48||X1>102||X1>57&&X1<65||X1>70&&X1<97)break;return z0(J,i1()+(Z<6&&C1()==32&&K1()==32))}function b0(J){while(K1())switch(X1){case J:return M1;case 34:case 39:if(J!==34&&J!==39)b0(X1);break;case 40:if(J===41)b0(J);break;case 92:K1();break}return M1}function D5(J,Z){while(K1())if(J+X1===57)break;else if(J+X1===84&&C1()===47)break;return"/*"+z0(Z,M1-1)+"*"+d1(J===47?J:K1())}function O5(J){while(!y1(C1()))K1();return z0(J,M1)}var X0=1,f1=1,G5=0,M1=0,X1=0,v1="";function I5(J){return M5(G0("",null,null,null,[""],J=Y5(J),0,[0],J))}function G0(J,Z,H,X,q,W,G,Y,w){var M=0,O=0,C=G,b=0,i=0,e=0,r=1,H1=1,t=1,J1=0,d="",h=q,u=W,v=X,T=d;while(H1)switch(e=J1,J1=K1()){case 40:if(e!=108&&V1(T,C-1)==58){if(B5(T+=_1(B0(J1),"&","&\f"),"&\f",S0(M?Y[M-1]:0))!=-1)t=-1;break}case 34:case 39:case 91:T+=B0(J1);break;case 9:case 10:case 13:case 32:T+=K5(e);break;case 92:T+=j5(i1()-1,7);continue;case 47:switch(C1()){case 42:case 47:if(h1(O6(D5(K1(),i1()),Z,H,w),w),(y1(e||1)==5||y1(C1()||1)==5)&&G1(T)&&N1(T,-1,void 0)!==" ")T+=" ";break;default:T+="/"}break;case 123*r:Y[M++]=G1(T)*t;case 125*r:case 59:case 0:switch(J1){case 0:case 125:H1=0;case 59+O:if(t==-1)T=_1(T,/\f/g,"");if(i>0&&(G1(T)-C||r===0&&e===47))h1(i>32?F5(T+";",X,H,C-1,w):F5(_1(T," ","")+";",X,H,C-2,w),w);break;case 59:T+=";";default:if(h1(v=L5(T,Z,H,M,O,q,Y,d,h=[],u=[],C,W),W),J1===123)if(O===0)G0(T,Z,v,v,h,W,C,Y,u);else{switch(b){case 99:if(V1(T,3)===110)break;case 108:if(V1(T,2)===97)break;default:O=0;case 100:case 109:case 115:}if(O)G0(J,v,v,X&&h1(L5(J,v,v,0,0,q,Y,d,q,h=[],C,u),u),q,u,C,Y,X?h:u);else G0(T,v,v,v,[""],u,0,Y,u)}}M=O=i=0,r=t=1,d=T="",C=G;break;case 58:C=1+G1(T),i=e;default:if(r<1){if(J1==123)--r;else if(J1==125&&r++==0&&w5()==125)continue}switch(T+=d1(J1),J1*r){case 38:t=O>0?1:(T+="\f",-1);break;case 44:Y[M++]=(G1(T)-1)*t,t=1;break;case 64:if(C1()===45)T+=B0(K1());b=C1(),O=C=G1(d=T+=O5(i1())),J1++;break;case 45:if(e===45&&G1(T)==2)r=0}}return W}function L5(J,Z,H,X,q,W,G,Y,w,M,O,C){var b=q-1,i=q===0?W:[""],e=H0(i);for(var r=0,H1=0,t=0;r<X;++r)for(var J1=0,d=N1(J,b+1,b=S0(H1=G[r])),h=J;J1<e;++J1)if(h=W0(H1>0?i[J1]+" "+d:_1(d,/&\f/g,i[J1])))w[t++]=h;return q0(J,Z,H,q===0?Z0:Y,w,M,O,C)}function O6(J,Z,H,X){return q0(J,Z,H,J0,d1(U5()),N1(J,2,-2),0,X)}function F5(J,Z,H,X,q){return q0(J,Z,H,Q0,N1(J,0,X),N1(J,X+1,-1),X,q)}function U0(J,Z){var H="";for(var X=0;X<J.length;X++)H+=Z(J[X],X,J,Z)||"";return H}function V5(J,Z,H,X){switch(J.type){case z5:if(J.children.length)break;case H5:case X5:case Q0:return J.return=J.return||J.value;case J0:return"";case q5:return J.return=J.value+"{"+U0(J.children,X)+"}";case Z0:if(!G1(J.value=J.props.join(",")))return""}return G1(H=U0(J.children,X))?J.return=J.value+"{"+H+"}":""}function N5(J){var Z=H0(J);return function(H,X,q,W){var G="";for(var Y=0;Y<Z;Y++)G+=J[Y](H,X,q,W)||"";return G}}class u1{nsp;settings;$head;constructor(J,Z){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=C5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return U0(I5(J),N5([V5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const H=new MutationObserver(()=>{const X=document.querySelector(J);if(X&&getComputedStyle(X).cssText)H.disconnect(),Z()});H.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(J){if(!J)throw new Error("Invalid injection arguments");const Z=`rel="${this.settings.meta?"@":""}${this.nsp}"`;J=this.settings.meta?J:`[rel="${this.nsp}"] { ${J} }`;try{const H=this.compile(J);if(!H)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const X=document.createElement("style");X.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),X.textContent=H;let q=0;const W=this.$head.find(`style[${Z}]`);if(W.length)q=parseInt(W.attr("dindex"))+1,W.remove();return X.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(X):document.head.appendChild(X),X}catch(H){throw new Error(`Style injection failed: ${H.message}`)}}async load(J){if(this.settings=J,typeof this.settings!=="object")throw new Error("Undefined styles settings");if(this.settings.sheet){const Z=await this.inject(this.settings.sheet);await this.waitForStyles(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`)}}get(){}async clear(){const J=this.$head.find(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`);if(!J.length)return;const Z=parseInt(J.attr("dindex"));Z===0?J.remove():J.attr("dindex",String(Z-1))}async custom(){return{}}async style(){return{}}}class w0{pending=new Map;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){const Z=J.priority??2;if(!this.pending.has(Z))this.pending.set(Z,new Set);if(this.pending.get(Z)?.add(J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}apply({dep:J,deppath:Z},H="batch-updator"){try{const X=this.component.FGUD.get(J)?.get(Z);if(!X){console.warn(`[batch update]: <${Z}> dependency not found`);return}if(X.garbage){this.component.FGUD.get(J)?.delete(Z),!this.component.FGUD.get(J)?.size&&this.component.FGUD.delete(J);return}const q=this.component.FGUDMemory.get(X.nodepath);if(!q)return;const W=X.update(q.memo||{},H);if(W){if(typeof W.memo==="object")q.memo=W.memo;typeof W.cleanup==="function"&&W.cleanup()}}catch(X){console.error("Failed to update dependency --",X)}}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=new Map;this.pending.forEach((X,q)=>J.set(q,new Set(X))),this.pending.clear(),this.isPending=!1;const Z=(X)=>{const q=Array.from(X);this.component.metrics.trackBatch(q.length),this.metrics.batchCount++,this.metrics.lastBatchSize=q.length,this.metrics.updatesProcessed+=q.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),q.forEach((W)=>this.apply(W))},H=Array.from(J.keys()).sort((X,q)=>X-q);for(let X of H){const q=J.get(X);q&&q.size&&Z(q)}if(this.pending.size>0&&!this.isPending)this.isPending=!0,this.scheduleProcessing()}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class Y0{options={emit:!0};__events={};__once_events={};constructor(J){if(J)this.options=J}on(J,Z){if(!Array.isArray(this.__events[J]))this.__events[J]=[];return this.__events[J].push(Z),this}once(J,Z){if(!Array.isArray(this.__once_events[J]))this.__once_events[J]=[];return this.__once_events[J].push(Z),this}off(J){return delete this.__events[J],delete this.__once_events[J],this}emit(J,...Z){if(!this.options.emit)return;const H=(q)=>{if(typeof q.toJSON==="function")return q.toJSON();if(Array.isArray(q))return q.map(H);if(typeof q==="object")for(let W in q)q[W]=H(q[W]);return q},X=Z.map(H);this.__events[J]?.forEach((q)=>q(...X)),this.__once_events[J]?.forEach((q)=>q(...X)),delete this.__once_events[J]}}var x0=A0(e1(),1);function B1(J,Z){if(J===Z)return!1;if(typeof J!=="object"||typeof Z!=="object")return!1;if(J===null||Z===null)return!0;if(J instanceof Set){if(!(Z instanceof Set))return!0;if(J.size!==Z.size)return!0;if(P5(J)&&P5(Z)){for(let G of J)if(!Z.has(G))return!0;return!1}const W=new WeakMap;for(let G of J){let Y=!1;if(typeof G!=="object"){if(Z.has(G))Y=!0}else for(let w of Z){if(typeof w!=="object")continue;if(!W.has(G))W.set(G,new WeakMap);const M=W.get(G);if(M.has(w)){if(Y=M.get(w),Y)break;continue}const O=!B1(G,w);if(M.set(w,O),O){Y=!0;break}}if(!Y)return!0}return!1}if(J instanceof Map){if(!(Z instanceof Map))return!0;if(J.size!==Z.size)return!0;if($5(J)&&$5(Z)){for(let[G,Y]of J)if(Z.get(G)!==Y)return!0;return!1}const W=new WeakMap;for(let[G,Y]of J){if(typeof G!=="object"){if(!Z.has(G))return!0;const O=Z.get(G);if(typeof Y!=="object"){if(Y!==O)return!0;continue}if(typeof O!=="object"||B1(Y,O))return!0;continue}let w=!1,M=!1;for(let[O,C]of Z){if(typeof O!=="object")continue;if(!W.has(G))W.set(G,new WeakMap);const b=W.get(G);if(b.has(O)){const[i,e]=b.get(O);if(i){w=!0,M=e;break}continue}if(!B1(G,O)){if(w=!0,M=typeof Y==="object"&&typeof C==="object"?!B1(Y,C):Y===C,b.set(O,[!0,M]),M)break}else b.set(O,[!1,!1])}if(!w||!M)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Z))return!0;if(J.length!==Z.length)return!0;for(let W=0;W<J.length;W++){const G=J[W],Y=Z[W];if(G!==Y&&(typeof G!=="object"||B1(G,Y)))return!0}return!1}const H=Object.keys(J),X=Object.keys(Z);if(H.length!==X.length)return!0;H.sort(),X.sort();const q=H.length;for(let W=0;W<q;W++)if(H[W]!==X[W])return!0;for(let W=0;W<q;W++){const G=H[W],Y=J[G],w=Z[G];if(Y===w)continue;if(Y instanceof Date){if(!(w instanceof Date)||String(Y)!==String(w))return!0;continue}if(Y instanceof RegExp){if(!(w instanceof RegExp)||Y.source!==w.source||Y.flags!==w.flags)return!0;continue}if(Y instanceof Map){if(!(w instanceof Map)||B1(Y,w))return!0;continue}if(Y instanceof Set){if(!(w instanceof Set)||B1(Y,w))return!0;continue}if(Y instanceof Function){if(!(w instanceof Function))return!0;continue}if(typeof Y==="object"){if(typeof w!=="object")return!0;if(Y===J){if(w!==Z)return!0}else if(B1(Y,w))return!0}else return!0}return!1}function P1(J,Z){if(J===Z)return!0;if(J==null||Z==null)return J===Z;const H=typeof J;if(H!==typeof Z)return!1;if(H!=="object"){if(H==="number"&&isNaN(J)&&isNaN(Z))return!0;return!1}if(J instanceof Date)return Z instanceof Date&&J.getTime()===Z.getTime();if(J instanceof RegExp)return Z instanceof RegExp&&J.source===Z.source&&J.flags===Z.flags;if(J instanceof Error)return Z instanceof Error&&J.name===Z.name&&J.message===Z.message&&(J.stack===Z.stack||!J.stack&&!Z.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(Z))return!1;if(J.byteLength!==Z.byteLength)return!1;const Y=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),w=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let M=0;M<Y.length;M++)if(Y[M]!==w[M])return!1;return!0}if(J instanceof Promise||J instanceof WeakMap||J instanceof WeakSet)return J===Z;if(typeof J==="function"){if(typeof Z!=="function")return!1;return J.toString()===Z.toString()&&J.name===Z.name}if(J.constructor!==Z.constructor)return!1;if(J instanceof Map||J instanceof Set||Array.isArray(J)||Object.getPrototypeOf(J)===Object.prototype)return!B1(J,Z);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Z))return!1;const W=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(Z);if(W.length!==G.length)return!1;for(let Y of W){if(!Object.prototype.hasOwnProperty.call(Z,Y))return!1;if(!P1(J[Y],Z[Y]))return!1}if(q!==null&&q!==Object.prototype){const Y=Object.getOwnPropertyNames(q),w=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(Y.length!==w.length)return!1;for(let M of Y){if(M==="constructor")continue;if(!P1(q[M],Object.getPrototypeOf(Z)[M]))return!1}}return!0}function P5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function $5(J){for(let[Z,H]of J)if(typeof Z==="object"&&Z!==null||typeof H==="object"&&H!==null)return!1;return!0}function W1(J,Z=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Z.has(J))return Z.get(J);if(J instanceof Date)return new Date(J.getTime());if(J instanceof RegExp)return new RegExp(J.source,J.flags);if(J instanceof Map){const q=new Map;return Z.set(J,q),J.forEach((W,G)=>q.set(W1(G,Z),W1(W,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((W)=>q.add(W1(W,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let W=0;W<J.length;W++)q[W]=W1(J[W],Z);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const H=Object.create(Object.getPrototypeOf(J));Z.set(J,H);const X=Object.getOwnPropertySymbols(J);for(let q of X)H[q]=W1(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))H[q]=W1(J[q],Z);return H}function g5(J,Z){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!Z||typeof Z!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Z).length)return{...J};function H(q,W,G){const Y=W.split(/\.|\[|\]/).filter(Boolean);let w=q;for(let M=0;M<Y.length;M++){const O=Y[M],C=!isNaN(Number(O)),b=M===Y.length-1,i=!isNaN(Number(Y[M+1]));if(b){w[O]=G;continue}if(!(O in w))w[O]=i?[]:{};else if(i&&!Array.isArray(w[O]))w[O]=[];else if(!i&&Array.isArray(w[O]))w[O]={};w=w[O]}}const X=W1(J);try{for(let[q,W]of Object.entries(Z)){if(typeof q!=="string")throw new TypeError(`Invalid path: ${q}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(q))throw new Error(`Invalid path format: ${q}`);H(X,q,W)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return X}function k5(J){return JSON.parse(JSON.stringify(J))}var T1="i18n",$1="syn:",O1="fn:",S1="on-",Y1=/^\.\.\./,M0=/^\[(.*?)\]$/,g0=/{\s*([^{}]+)\s*}/g,E5=["@html","@text","@format"],R5=["display","visibility","position","width","height"],K0=":r",T5=":n",A5="m",S5="c",b5="x",x5=100;x0.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&x0.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class j0{debug;initialStats={renderCount:0,elementCount:0,renderTime:0,avgRenderTime:0,maxRenderTime:0,componentCount:0,componentUpdateCount:0,partialCount:0,partialUpdateCount:0,memoryUsage:void 0,domOperations:0,domInsertsCount:0,domUpdatesCount:0,domRemovalsCount:0,i18nTrackCount:0,i18nUpdateCount:0,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(J=!1){if(this.debug=J,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const J=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");J.push({timestamp:Date.now(),metrics:{...this.stats}}),J.length>100&&J.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(J))}catch(J){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const J=performance.now()-this.renderStartTime;this.stats.renderTime=J,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,J),this.renderTimes.push(J),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((Z,H)=>Z+H,0)/this.renderTimes.length,this.renderStartTime=0,this.measurementCount++}inc(J){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]++}dec(J){if(!this.debug)return;if(typeof this.stats[J]==="number"&&this.stats[J]>0)this.stats[J]--}record(J,Z){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=Z}add(J,Z){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=Z}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=W1(this.initialStats)}log(){if(!this.debug)return;if(this.loggingInterval>1&&this.measurementCount%this.loggingInterval!==0)return;const J={"Render Count":this.stats.renderCount,"Element Count":this.stats.elementCount,"Avg Render Time (ms)":this.stats.avgRenderTime.toFixed(2),"Max Render Time (ms)":this.stats.maxRenderTime.toFixed(2)},Z={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},H={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},X={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},q={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},W={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},G={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(J),console.table(Z),console.table(H),console.table(X),console.table(q),console.table(W),console.table(G),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return W1(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var Z1=A0(e1(),1);var L6=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let H=J,X;while((X=Z.exec(J))!==null){const q=X[1],W=X.index+X[0].length;let G=1,Y=W;while(Y<J.length&&G>0){if(J[Y]==="(")G++;if(J[Y]===")")G--;Y++}if(G===0){const w=J.slice(W,Y-1).trim(),M=J.slice(0,X.index),O=`${S1}${q}="${w}"`,C=J.slice(Y);H=M+O+C,J=H,Z.lastIndex=M.length+O.length}}return H},F6=function(J){const Z=[];let X=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,W,G)=>{return Z.push(G),`<${W}##TAG_ATTRS_${Z.length-1}##>`});for(let q=0;q<Z.length;q++){const W=`##TAG_ATTRS_${q}##`,G=Z[q],Y=I6(G);X=X.replace(W,Y)}return X},I6=function(J){let Z="",H=0,X=!1,q="",W=0,G=0,Y=0;while(H<J.length){const w=J[H];if((w==='"'||w==="'")&&(H===0||J[H-1]!=="\\")){if(!X)X=!0,q=w;else if(w===q)X=!1}if(!X){if(w==="(")G++;else if(w===")")G--;else if(w==="{")Y++;else if(w==="}")Y--}if(!X&&G===0&&Y===0&&(w===" "||H===J.length-1)){let M=H;if(H===J.length-1)M=H+1;const O=J.substring(W,M).trim();if(O){const C=V6(O);Z+=" "+C}W=H+1}H++}return Z},V6=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===T1||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let H=J.substring(0,Z).trim(),X=J.substring(Z+1).trim();if(H.startsWith("@"))return H=!E5.includes(H)?H.slice(1):H,`:${H}=${X}`;if(H.startsWith(O1)||H.startsWith(S1))return J;if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'")){const q=X.substring(1,X.length-1);if(N6(q))return`:${H}="${q}"`;return J}else return`:${H}="${X}"`};function N6(J){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(J))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(J))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(J))return!0;if(J.includes("{")&&J.includes("}"))return!0;return!1}function k0(J){let Z=(J||"").trim().replace(/>\s*</g,"><").replace(/\s{2,}/g," ").replace(/[\r\n\t]/g,"").replace(/<([a-zA-Z0-9_-]+)([^>]*?)\s*\/>/g,"<$1$2></$1>").replace(/<\{([^}]+)\}\s*(.*?)(\/)>/g,(H,X,q)=>{return q.endsWith("<")?`<lips dtag="${X}" ${q}/lips>`:`<lips dtag="${X}" ${q}></lips>`}).replace(/(<>)([\s\S]*?)(<\/>)/g,'<lips fragment="true">$2</lips>').replace(/<if\(\s*(.*?)\s*\)>/g,'<if @by="$1">').replace(/<else-if\(\s*(.*?)\s*\)>/g,'<else-if @by="$1">').replace(/<switch\(\s*(.*?)\s*\)>/g,'<switch @by="$1">').replace(/<async await\(\s*(.*?)\s*\)>/g,`<async ${O1}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(H)=>H.replace(/\s+/g,""));return Z=L6(Z),Z=F6(Z),Z}var C6=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},h5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function b1(J,Z={maxSize:100}){const H=new Set,X=[{value:J,timestamp:Date.now()}];let q=0;const W=()=>{const M=D0[D0.length-1];return M&&C6(M,H),X[q].value},G=()=>{const M=[...H];if(_5)for(let O of M)_5.add(O);else for(let O of M)O.execute()};return[W,(M,O)=>{if(Object.is(X[q].value,M))return;if(q<X.length-1)X.splice(q+1);if(X.push({value:M,timestamp:Date.now(),metadata:O}),X.length>Z.maxSize)X.shift(),q=Math.max(0,q-1);else q++;G()},{undo(){if(q>0)q--,G()},redo(){if(q<X.length-1)q++,G()},jumpTo(M){if(M>=0&&M<X.length&&M!==q)q=M,G()},getHistory(){return[...X]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<X.length-1},clear(){const M=X[0];X.length=0,X.push(M),q=0,G()}}]}function c1(J){let Z=!1;const H=()=>{if(Z)throw new Error("Circular dependency detected");if(X.isDisposed)return;Z=!0,h5(X),D0.push(X);try{J()}finally{Z=!1,D0.pop()}},X={execute:H,dependencies:new Set,isDisposed:!1};return H(),{dispose:()=>{X.isDisposed=!0,h5(X)}}}var D0=[],_5=null;class x1 extends Y0{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=new Map;FGUD=new Map;FGUDMemory=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;metrics;stylesheet;__inpath__="";__inpathCounter__=0;__renderDepth__=0;__boundaries__;constructor(J,Z,{input:H,state:X,context:q,_static:W,handler:G,stylesheet:Y,macros:w,declaration:M},O){super();if(this.lips=O.lips,O?.debug)this.debug=O.debug||this.lips.debug;if(O?.prepath)this.prepath=O.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=this.__inpath__=`${this.prepath}:${this.__name__}`,this.__template__=k0(Z),this.__boundaries__=O.boundaries,this.declaration=M||{name:J},this.input=H||{},this.static=W||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,X||{}),w&&this.setMacros(w),G&&this.setHandler(G),Y&&this.setStylesheet(Y),this.metrics=new j0(this.debug),this.metrics.inc("componentCount"),this.UQS=new w0(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create"),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(),this.emit("component:input");this.__previous={state:W1(this.state),input:W1(this.input),context:W1(this.context)};const[C,b]=b1(this.input),[i,e]=b1(this.state),[r,H1]=b1(this.context);this.__setInput=b,this.__setState=e,this.__getState=i,this.lips.IUC.register(this.__path__,()=>{B1(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(t)=>{if(!B1(this.context,t))return;H1(t),this.context=t,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context")}),this.lips.useTranslator("*",(t)=>{if(t===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=t}),this.ICE=c1(()=>{const t=i(),J1=this.input=C(),d=this.context=r();if(!this.isRendered){if(this.metrics.reset(),!this.__template__.length||M?.syntax&&typeof this.onSelfRender=="function"){const h=this.onSelfRender.bind(this)(this.input);if(!this.__boundaries__?.start||!this.__boundaries__?.end)throw new Error(`Undefined <${this.__name__} syntax component boundaries`);this.$=h||Z1.default()}else{const{$log:h}=this.render("",void 0,void 0,this.FGUD);this.$=h}!M?.syntax&&this.$?.each((h,u)=>{typeof u.setAttribute=="function"&&u.setAttribute("rel",this.__name__)}),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount"),this.lips.watcher.watch(this)}else this.__updateDepNodes__(),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update"),this.__previous={input:W1(J1),state:W1(t),context:W1(d)};typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render")})}setContext(J,Z){this.lips.setContext(J,Z)}setInput(J,Z){if(!B1(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(this.declaration.syntax?Z:void 0)}subInput(J,Z){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(g5(this.input,J),this.declaration.syntax?Z:void 0),this}setMacros(J){const Z=k0(J),H=Z1.default(Z);if(!H.length)return;const X=this;H.each(function(){const q=Z1.default(this),{argv:W,attrs:G}=X.__getAttributes__(q);if(!Object.keys(G))throw new Error("Invalid macro component definition");if(!G.literals.name)throw new Error("Undefined macro `name` attribute.");if(X.__macros.get(G.literals.name))console.warn(`Duplicate macro <${G.literals.name}> will be override`);if(!q.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");X.__macros.set(G.literals.name,{argv:W,$node:q})})}setHandler(J){Object.entries(J).map(([Z,H])=>this[Z]=H?.bind(this))}setStylesheet(J){const Z={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new u1(this.__name__,Z)}get node(){if(!this.isRendered)throw new Error("node() is expected to be call after component get rendered");return this.$}get boundaries(){return this.__boundaries__}render(J,Z,H={},X,q){if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:X||new Map};const W=this,G=X||new Map,Y=[];this.metrics.startRender();let w=Z1.default();function M(){return W1(H)}function O(U,j=!1){const D=C(U,j);return W.__inpathCounter__++,W.__inpath__?`${W.__inpath__}/${D}`:`${J?J+"/":""}${D}`}function C(U,j=!1){let D="";switch(U){case"component":D=j?b5:S5;break;case"macro":D=A5;break}return D+W.__inpathCounter__}function b(U){return U!==null&&typeof U==="object"&&typeof U.mesh==="function"&&typeof U.update==="function"}function i(U){return U!==null&&typeof U==="object"&&typeof U.default&&typeof U.default==="string"}function e(U){if(!U.attr(":dtag")||U.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const j=U.attr(":dtag"),D=W.__evaluate__(j,H);if(b(D)||D===null)return J1(U,j,D);else if(i(D))return d(U,{template:D});else return d(U,{name:D})}function r(U){const j=U.attr(":args"),D=O("log");if(!j)return;const P=M();if(W.__evaluate__(`console.log(${j})`,P),W.__isReactive__(j,P))W.__extractExpressionDeps__(j,P).forEach((V)=>W.__trackDep__(G,V,P,{nodetype:"log",nodepath:D,target:"argument",$fragment:null,update:(S)=>W.__evaluate__(`console.log(${j})`,S),syntax:!0}))}function H1(U){const j=O("var"),{attrs:D}=W.__getAttributes__(U);if(!D)return;Object.entries(D.literals).forEach(([P,F])=>{if(H[P]&&H[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);H[P]={value:F,type:"let"}}),Object.entries(D.expressions).forEach(([P,F])=>{if(H[P]&&H[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);if(H[P]={value:W.__evaluate__(F,H),type:"let"},W.__isReactive__(F,H)){const V=W.__extractExpressionDeps__(F,H),S=(m,c)=>{if(m[P]&&m[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);if(D.map.beforeSpreadAttrs.includes(P))return;const f=W.__evaluate__(F,m);if(P1(m[P].value,f))return;return m[P]={value:f,type:"let"},W.__updateVarDepNodes__(P,j,m),k5({memo:m})};V.forEach((m)=>W.__trackDep__(G,m,M(),{nodetype:"let",nodepath:j,deppath:`${j}.${P}`,target:"attr",$fragment:null,update:S,syntax:!0}))}}),W.metrics.inc("elementCount")}function t(U){const{attrs:j}=W.__getAttributes__(U);if(!j)return;Object.entries(j.literals).forEach(([D,P])=>{if(H[D]&&H[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!P)return;H[D]={value:P,type:"const"}}),Object.entries(j.expressions).forEach(([D,P])=>{if(H[D]&&H[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!P)return;H[D]={value:W.__evaluate__(P,H),type:"const"}}),W.metrics.inc("elementCount")}function J1(U,j,D){const{attrs:P}=W.__getAttributes__(U),F=O("element"),V=W.__getBoundaries__(F),S={},m={};let c=M(),f=Z1.default(V.start),A={},$=D;if($){P.literals&&Object.entries(P.literals).forEach(([E,_])=>{S[E]=_,A[E]={type:"arg",value:_}}),P.expressions&&Object.entries(P.expressions).forEach(([E,_])=>{if(!$)return;if(Y1.test(E))W.__evaluateSpreadAttr__(E,{memo:c,get keystore(){return m[E]},set keystore(L){if(!m[E])m[E]=[];m[E]=L},each:(L,g)=>{if(S[L]=g,L!=="#"&&!$?.argv.includes(L))return;A[L]={type:"arg",value:g}}});else{const L=_?W.__evaluate__(_,c):!0;if(S[E]=L,E!=="#"&&!$.argv.includes(E))return;A[E]={type:"arg",value:L}}}),c.__arguments__=S;const k=$.mesh(A);if(k&&k.length)f=f.add(k);P.expressions&&Object.entries(P.expressions).forEach(([E,_])=>{if(!$)return;if(Y1.test(E)&&W.__isReactive__(E,c)){const L=W.__extractExpressionDeps__(E,c),g=(I,x)=>{if(!$)return;const a={};let n=[];if(W.__evaluateSpreadAttr__(E,{memo:I,get keystore(){return m[E]},set keystore(p){if(!m[E])m[E]=[];m[E]=p},each:(p,s)=>{if(P.map.afterSpreadAttrs.includes(p))return;if(p!=="#"&&!$?.argv.includes(p))return;if(P1(s,I[p]?.value))return;A[p]=a[p]={value:s,type:"arg"},S[p]=s,n.push(p)},nullify:(p)=>{p.forEach((s)=>{a[s]={value:void 0,type:"arg"},delete S[s]}),n=p}}),n.length)$.argv.length&&W.__updateArgumentsDepNodes__(F,S),$.update(n,a,I,V)};L.forEach((I)=>W.__trackDep__(G,I,c,{nodetype:"dynamic",nodepath:F,deppath:`${F}.${E}`,target:"spread-attr",$fragment:null,boundaries:V,update:g}))}else if((E==="#"||$.argv.includes(E))&&W.__isReactive__(_,c)){const L=W.__extractExpressionDeps__(_,c),g=(I,x)=>{if(!$)return;if(P.map.beforeSpreadAttrs.includes(E))return;const a=_?W.__evaluate__(_,I):!0,n={type:"arg",value:a};if(A[E]=n,$.argv.length)S[E]=a,W.__updateArgumentsDepNodes__(F,S);$.update([E],{[E]:n},I,V)};L.forEach((I)=>W.__trackDep__(G,I,c,{nodetype:"dynamic",nodepath:F,deppath:`${F}.${E}`,target:"attr",$fragment:null,boundaries:V,update:g}))}})}if(W.__isReactive__(j,c)){const k=(_,L)=>{const g=W.__evaluate__(j,_);let I;if(i(g))I=d(U,{template:g}),W.__fillBoundaries__(I,V);else if(b(g)){if("#"in A)A=A["#"].value;else Object.entries(A).forEach(([x,a])=>{if(typeof a==="function")return;S[x]=a.value});if($?.cleanup(V),$=g,$)$.argv.length&&W.__updateArgumentsDepNodes__(F,S),I=$.mesh(A),I?.length&&$.fill(I,V)}else if($)$.cleanup(V),$=null};W.__extractExpressionDeps__(j,c).forEach((_)=>W.__trackDep__(G,_,{...c,...A},{nodetype:"dynamic",nodepath:F,deppath:`${F}.dtag`,target:"dtag",$fragment:null,boundaries:V,update:k}))}return f=f.add(V.end),f}function d(U,j){let D,P;if(j?.template)D=j.template,P=C("component",D.declaration?.syntax);else{if(P=j?.name||U.prop("tagName")?.toLowerCase(),!P)throw new Error("Invalid component");if(P===W.__name__)throw new Error("Render component within itself is forbidden");D=W.lips.import(P)}if(!D||!P)throw new Error(`<${P}> template not found`);const F=O("component",D.declaration?.syntax),V=W.__getBoundaries__(F),{argv:S,functions:m,attrs:c,events:f}=W.__getAttributes__(U),A={},$={};let k={},E=Z1.default(V.start),_=W.PCC.get(F),L=M();c.literals&&Object.entries(c.literals).forEach(([I,x])=>{if(I=="key")return;k[I]=x}),m&&Object.entries(m).forEach(([I,x])=>{k[I]=W.__evaluateFunction__(x,[],L),D.declaration?.syntax?A[$1+O1+I]=x:A[O1+I]=x}),c.expressions&&Object.entries(c.expressions).forEach(([I,x])=>{if(I=="key")return;if(Y1.test(I))W.__evaluateSpreadAttr__(I,{memo:L,get keystore(){return $[I]},set keystore(a){if(!$[I])$[I]=[];$[I]=a},each:(a,n)=>k[a]=n});else k[I]=x?W.__evaluate__(x,L):!0;D.declaration?.syntax?A[$1+I]=x:A[I]=x});const g=U.contents();if(g.length){if(k={...k,...W.__meshwire__({$node:U,fragmentPath:F,fragmentBoundaries:V,meshPath:null,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:D.declaration},A)},D.declaration){if(D.declaration.tags){let I;Object.entries(D.declaration?.tags).forEach(([x,{type:a,many:n,alts:p}])=>{switch(a){case"nexted":{let s=U.next(x);if(!s.length&&Array.isArray(p)&&I?.length&&I.is(p.join(",")))s=I.next(x);if(!s.length)return;if(n){k[x]=[];let o=0,Q1=!1;while(!Q1){if(k[x].push(W.__meshwire__({$node:s,meshPath:`${x}[${o}]`,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:D.declaration},A)),!s.next(x).length){Q1=!0;break}s=I=s.next(x),o++}}else k[x]=W.__meshwire__({$node:s,meshPath:x,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:D.declaration},A)}break;case"child":{const s=U.children(x);if(n)k[x]=[],s.each(function(o){const Q1=Z1.default(this),{argv:L1}=W.__getAttributes__(Q1);k[x].push(W.__meshwire__({$node:Q1,meshPath:`${x}[${o}]`,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:L1,xmlns:q,useAttributes:!0,declaration:D.declaration},A))});else if(U.children(x).first().length){const o=U.children(x).first(),{argv:Q1}=W.__getAttributes__(o);k[x]=W.__meshwire__({$node:o,meshPath:x,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:Q1,xmlns:q,useAttributes:!0,declaration:D.declaration},A)}}break}})}else if(D.declaration.contents)k.__contents__=g}}if(_)_.setInput(W1(k)),E=E.add(_.node);else{const{declaration:I,state:x,_static:a,handler:n,context:p,default:s,stylesheet:o}=D;_=new x1(P,s||"",{state:W1(x),input:W1(k),context:p,_static:W1(a),handler:n,stylesheet:o,declaration:I},{debug:W.debug,lips:W.lips,prepath:F,boundaries:V}),E=E.add(_.node),!D.declaration?.syntax&&W.PCC.set(F,_)}return E=E.add(V.end),Object.entries(f).forEach(([I,x])=>{W.__attachEvent__({nodepath:F,element:_,_event:I,instruction:x,scope:L,get __dependencies__(){return G}})}),A&&Object.entries(A).forEach(([I,x])=>{let a=!1,n=!1;if(I.startsWith($1))a=!0,I=I.replace($1,"");if(I.startsWith(O1))n=!0,I=I.replace(O1,"");if(Y1.test(I)){if(W.__isReactive__(I,L)){const p=(o)=>{const Q1={};W.__evaluateSpreadAttr__(I,{memo:o,get keystore(){return $[I]},set keystore(L1){if(!$[I])$[I]=[];$[I]=L1},each:(L1,g1)=>{if(c.map.afterSpreadAttrs.includes(L1))return;Q1[L1]=g1},nullify:(L1)=>L1.forEach((g1)=>Q1[g1]=void 0)}),_?.subInput(Q1,o)};W.__extractExpressionDeps__(I,L).forEach((o)=>W.__trackDep__(G,o,L,{nodetype:"component",nodepath:F,deppath:`${F}.${I}`,target:"spread-attr",$fragment:null,boundaries:V,update:p,syntax:a}))}}else if(W.__isReactive__(x,L)){const p=(o)=>{if(c.map.beforeSpreadAttrs.includes(I))return;const Q1=n?W.__evaluateFunction__(x,[],o):x?W.__evaluate__(x,o):!0;_?.subInput({[I]:Q1},o)};W.__extractExpressionDeps__(x,L).forEach((o)=>W.__trackDep__(G,o,L,{nodetype:"component",nodepath:F,deppath:`${F}.${I}`,target:"attr",$fragment:null,boundaries:V,update:p,syntax:a}))}}),W.metrics.inc("componentCount"),E}function h(U){const j=U.prop("tagName")?.toLowerCase();if(!j)throw new Error("Invalid macro rendering call");const D=W.__macros.get(j);if(!D)throw new Error("Macro component not found");const P=O("macro"),F=W.__getBoundaries__(P),{attrs:V}=W.__getAttributes__(U),S={},m=M(),c={},f={};V.literals&&Object.entries(V.literals).forEach(([L,g])=>{c[L]=g,f[L]={value:g,type:"arg"}});const A={};V.expressions&&Object.entries(V.expressions).forEach(([L,g])=>{if(Y1.test(L))W.__evaluateSpreadAttr__(L,{memo:m,get keystore(){return A[L]},set keystore(I){if(!A[L])A[L]=[];A[L]=I},each:(I,x)=>{if(c[I]=x,D.argv.includes(I))f[I]={value:x,type:"arg"}}}),S[L]=g;else{const I=g?W.__evaluate__(g,m):!0;if(c[L]=I,D.argv.includes(L))f[L]={value:I,type:"arg"},S[L]=g}D.argv.forEach((I)=>{if(f[I]!==void 0)return;f[I]={value:!1,type:"arg"}})}),f.__arguments__=c;let $=Z1.default(F.start);const k={$node:D.$node,meshPath:null,fragmentPath:P,fragmentBoundaries:F,argv:D.argv,scope:m,xmlns:q,useAttributes:!0},E=W.__meshwire__(k,S),_=E.renderer.mesh(f,m);return $=$.add(_),S&&Object.entries(S).forEach(([L,g])=>{let I=!1;if(new RegExp(`^${$1}`).test(L))I=!0,L=L.replace($1,"");if(Y1.test(L)){if(!W.__isReactive__(L,m))return;const x=W.__extractExpressionDeps__(L,m),a=(n)=>{const p={};let s=[];if(W.__evaluateSpreadAttr__(L,{memo:n,get keystore(){return A[L]},set keystore(o){if(!A[L])A[L]=[];A[L]=o},each:(o,Q1)=>{if(V.map.afterSpreadAttrs.includes(o))return;if(P1(Q1,n[o]?.value))return;p[o]={value:Q1,type:"arg"},c[o]=Q1,s.push(o)},nullify:(o)=>{o.forEach((Q1)=>{p[Q1]={value:void 0,type:"arg"},delete c[Q1]}),s=o}}),s.length)W.__updateArgumentsDepNodes__(P,c),E.renderer.update(s,p,n)};x.forEach((n)=>W.__trackDep__(G,n,{...m,...f},{nodetype:"macro",nodepath:P,deppath:`${P}.${L}`,target:"spread-attr",$fragment:null,boundaries:F,update:a,syntax:I}))}else if(W.__isReactive__(g,m)){const x=W.__extractExpressionDeps__(g,m),a=(n)=>{if(V.map.beforeSpreadAttrs.includes(L))return;const p=g?W.__evaluate__(g,n):!0;c[L]=p,W.__updateArgumentsDepNodes__(P,c),E.renderer.update([L],{[L]:{value:p,type:"arg"}},n)};x.forEach((n)=>W.__trackDep__(G,n,{...m,...f},{nodetype:"macro",nodepath:P,deppath:`${P}.${L}`,target:"attr",$fragment:null,boundaries:F,update:a,syntax:I}))}}),$=$.add(F.end),W.metrics.inc("elementCount"),$}function u(U){if(!U.length||!U.prop("tagName"))return U;const j=U.is("svg")||q,D=j?Z1.default(document.createElementNS("http://www.w3.org/2000/svg",U.prop("tagName").toLowerCase())):Z1.default(`<${U.prop("tagName").toLowerCase()}/>`),P=U.contents(),F=O("element"),V=M();P.length&&D.append(W.__withPath__(F,()=>W.render(F+T5,P,V,G,j).$log));const{attrs:S,events:m}=W.__getAttributes__(U);S.literals&&Object.entries(S.literals).forEach(([f,A])=>{if(f===T1)return;const $=U.is(`[${T1}]`)&&["title","placeholder"].includes(f);D.attr(f,$?W.lips.i18n.translate(A).text:A);const k=(E)=>{D.attr(f,$?W.lips.i18n.translate(A).text:A),$&&W.__trackTranslationDep__(E,{nodetype:"element",nodepath:F,deppath:`${F}.${f}`,target:"attr",$fragment:D,update:k})};$&&W.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${f}`,target:"attr",$fragment:D,update:k})});const c=(f,A=!1)=>{f&&Object.entries(f).forEach(([$,k])=>{switch($){case"@html":{const E=(_)=>{D.html(W.__evaluate__(k,_))};if(E(V),A&&W.__isReactive__(k,V))W.__extractExpressionDeps__(k,V).forEach((L)=>W.__trackDep__(G,L,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:E}))}break;case"@text":{const E=U.is(`[${T1}]`),_=(L)=>{D.text(W.__evaluate__(k,L,{translate:E})),E&&W.__trackTranslationDep__(L,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:_})};if(_(V),A&&W.__isReactive__(k,V))W.__extractExpressionDeps__(k,V).forEach((g)=>W.__trackDep__(G,g,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:_}));E&&W.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:_})}break;case"@format":{const[E,_]=k.split(",").map((g)=>g.trim());if(!E)throw new Error("Invalid @format reference");if(!_)throw new Error("Invalid @format parameters");const L=(g)=>{const I=W.__evaluate__(`!${_.trim()}`,g);if(typeof I!=="object")throw new Error("Invalid @format parameters");const x=W.lips.i18n.format(E,I);x!==void 0&&D.text(x),W.__trackTranslationDep__(g,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:L})};L(V),W.__extractExpressionDeps__(_,V).forEach((g)=>W.__trackDep__(G,g,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:L}))}break;case"style":if(A&&W.__isReactive__(k,V)){const E=(L)=>{const g=W.__evaluate__(k,L);if(typeof g==="object"){let I="";Object.entries(g).forEach(([x,a])=>I+=`${x}:${a};`),I.length&&D.attr("style",I)}else D.attr("style",g)};E(V),W.__extractExpressionDeps__(k,V).forEach((L)=>W.__trackDep__(G,L,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:D,update:E}))}else D.attr("style",k);break;default:{const E=U.is(`[${T1}]`)&&["title","placeholder"].includes($),_=(L)=>{const g=k&&W.__isReactive__(k,V)?W.__evaluate__(k,L,{translate:E}):k!==void 0?k:!0;if(g===void 0||g===!1)D.removeAttr($);else D.attr($,g),E&&W.__trackTranslationDep__(L,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:D,update:_})};if(_(V),A&&W.__isReactive__(k,V))W.__extractExpressionDeps__(k,V).forEach((g)=>W.__trackDep__(G,g,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:D,update:_}));E&&W.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:D,update:_})}}})};return S.expressions&&Object.keys(S.expressions).forEach((f)=>{if(!Y1.test(f))return;let A=[];const $=(k,E,_=!1)=>{const L={};W.__evaluateSpreadAttr__(f,{memo:k,get keystore(){return A},set keystore(g){A=g},each:(g,I)=>{if(!_&&S.map.afterSpreadAttrs.includes(g))return;L[g]=I},nullify:(g)=>g.forEach((I)=>D.removeAttr(I))}),Object.keys(L).length&&c(L)};if(delete S.expressions[f],$(V,"",!0),f&&W.__isReactive__(f,V))W.__extractExpressionDeps__(f,V).forEach((E)=>W.__trackDep__(G,E,V,{nodetype:"element",nodepath:F,deppath:`${F}.${f}`,target:"spread-attr",$fragment:D,update:$}))}),c(S.expressions,!0),m&&Object.entries(m).forEach(([f,A])=>{Y.push({nodepath:F,element:D,_event:f,instruction:A,scope:V,get __dependencies__(){return G}})}),W.metrics.inc("elementCount"),W.metrics.inc("domInsertsCount"),D}function v(U){const j=U.text(),D=M(),P=O("element"),F=U.parent().is(`[${T1}]`),V=Z1.default(document.createTextNode(W.__interpolate__(j,D,F))),S=(m)=>{const c=W.__interpolate__(j,m,F);if(!V[0])return;V[0].textContent=c,F&&W.__trackTranslationDep__(m,{nodetype:"text",nodepath:P,target:"value",$fragment:V,update:S})};if(j&&W.__isReactive__(j,D))W.__extractTextDeps__(j,D).forEach((c)=>W.__trackDep__(G,c,D,{nodetype:"text",nodepath:P,deppath:`${P}.${c}`,target:"value",$fragment:V,update:S}));return F&&W.__trackTranslationDep__(D,{nodetype:"text",nodepath:P,target:"value",$fragment:V,update:S}),W.metrics.inc("elementCount"),W.metrics.inc("domInsertsCount"),V}function T(U){if(U.get(0)?.nodeType===Node.COMMENT_NODE)return U;if(U.get(0)?.nodeType===Node.TEXT_NODE)return v(U);if(U.is("let"))return H1(U);else if(U.is("const"))return t(U);else if(U.is("lips")&&U.attr(":dtag"))return e(U);else if(U.is("log"))return r(U);else if(W.__macros.has(U.prop("tagName")?.toLowerCase()))return h(U);else if(U.is("if, for, switch, async")||W.lips.has(U.prop("tagName")?.toLowerCase()))return d(U);else if(U.is("else-if, else"))return;return u(U)}try{this.__renderDepth__++,Z=!Z&&Z1.default(this.__template__).length>1?Z1.default("<template>").html(this.__template__).contents():Z||Z1.default(this.__template__),Z.each(function(){const U=T(Z1.default(this));if(U)w=w.add(U)}),Y.forEach(this.__attachEvent__.bind(this)),W.metrics.inc("renderCount")}catch(U){console.error("Rendering Failed --",U),W.metrics.trackError(U)}finally{if(this.__renderDepth__--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth__===0)this.__inpath__="",this.__inpathCounter__=0}return{$log:w,dependencies:G,events:Y}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(this.__detachEvent__.bind(this)),this.VER=[];for(let J in this.PCC){const Z=this.PCC.get(J);Z?.destroy(),Z?.delete(J)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.FGUDMemory?.clear(),this.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Z)=>{Z1.default(Z).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy")}__meshwire__(J,Z){const H=this,{$node:X,meshPath:q,fragmentPath:W,fragmentBoundaries:G,argv:Y,xmlns:w,declaration:M,useAttributes:O}=J;let C,b=[];const i=[],e=W+K0,r=(d,h,u,v)=>{const T=`${e}${v!==void 0?`[${v}]`:""}`,{$log:U,dependencies:j,events:D}=H.__withPath__(T,()=>{return H.render(T,d,{...h,...u},void 0,w)});if(i.push(T),j?.forEach((P,F)=>{if(!H.FGUD?.has(F))H.FGUD.set(F,new Map);P.forEach((V,S)=>{if(V.garbage)return;V.partial?.length?V.partial.push(T):V.partial=[T],H.FGUD.get(F)?.set(S,V)})}),H.metrics.inc("partialCount"),v!==void 0){const P=H.__getBoundaries__(T);b[v]={argvalues:u,boundaries:P};let F=Z1.default(P.start);return F=F.add(U),F=F.add(P.end),F}return U},H1=(d,h,u,v)=>{H.metrics.startRender();const T=v!==void 0?i.filter((U)=>U.endsWith(`${K0}[${v}]`)):i;if(d.forEach((U)=>{const j=H.FGUD.get(U);if(!j)return;j.forEach((D)=>{const P=T.find((S)=>{return D.partial?.find((m)=>S==m||H.__hasSamePathParent__(m,S))});if(!D.partial||!P)return;const F=D.deppath||D.nodepath,V=this.FGUDMemory.get(D.nodepath);if(D.garbage||G?.start&&!document.contains(G.start)){j.delete(F),H.__unbindMemo__(D);return}if(!V){console.warn(`unexpected occurence: <${F}> has no memo`);return}if(V.memo?.[U]&&u?.[U]&&!P1(V.memo[U],u[U]))V.memo={...h,...V.memo,...u};H.UQS.queue({dep:U,deppath:F,priority:D.priority}),H.metrics.inc("dependencyUpdateCount")}),!j.size&&H.FGUD.delete(U)}),v!==void 0&&b[v])b[v].argvalues=u;H.metrics.inc("partialUpdateCount"),H.metrics.endRender()},t=(d)=>{if(!b[d])return;const h=b[d].boundaries;if(b.splice(d,1),!document.contains(h.start)||!document.contains(h.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const u=[];let v=h.start.nextSibling;while(v&&v!==h.end)u.push(v),v=v.nextSibling;Z1.default(u).remove(),h.start.remove(),h.end.remove()},J1={renderer:{path:q,argv:Y,mesh(d,h){if(C=X.contents(),!C?.length)return null;if(h=h||J.scope,M?.iterator){const u=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!u.length)return null;let v=Z1.default();return u.forEach((T,U)=>{if(!C?.length)return null;v=v.add(r(C,h,T,U))}),v}else return r(C,h,d)},update(d,h,u,v){if(!i.length)return;if(u=u||J.scope,v=v||G,M?.iterator){const T=h?.["#"].value;if(!Array.isArray(T))return;if(Array.isArray(b)){if(b.length===T.length){for(let j=0;j<T.length;j++)!P1(b[j].argvalues,T[j])&&H1(Object.keys(T[j]),u,T[j],j);return}const U=Math.min(b.length,T.length);for(let j=0;j<U;j++)H1(Object.keys(T[j]),u,T[j],j);if(T.length>b.length){if(!C?.length)return;for(let j=b.length;j<T.length;j++){const D=r(C,u,T[j],j);Z1.default(v.end).before(D)}}else if(T.length<b.length)for(let j=b.length-1;j>=T.length;j--)t(j)}}else H1(d,u,h)},fill(d,h){console.log("fill",h||G),H.__fillBoundaries__(d,h||G)},cleanup(d){console.log("cleanup"),H.FGUD.forEach((h,u)=>{h.forEach((v,T)=>{if(!H.__hasSamePathParent__(T,e))return;H.__unbindMemo__(v),v.garbage=!0}),!h.size&&H.FGUD.delete(u)}),H.__emptyBoundaries__(d||G)}}};if(O&&q){const{attrs:d}=H.__getAttributes__(X);d.literals&&Object.entries(d.literals).forEach(([h,u])=>J1[h]=u),d.expressions&&Object.entries(d.expressions).forEach(([h,u])=>{if(Y1.test(h)){let v=[];H.__evaluateSpreadAttr__(h,{memo:J.scope,get keystore(){return v},set keystore(T){v=T},each:(T,U)=>J1[T]=U}),Z[`${M?.syntax?$1:""}${q}.${h}`]=u}else J1[h]=u?H.__evaluate__(u,J.scope):!0,Z[`${M?.syntax?$1:""}${q}.${h}`]=u})}return J1}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${J}`),end:document.createComment(`e:${J}`)}}__emptyBoundaries__(J){const Z=[];let H=J.start.nextSibling;while(H&&H!==J.end)Z.push(H),H=H.nextSibling;Z1.default(Z).remove()}__fillBoundaries__(J,Z){if(!document.contains(Z.start)||!document.contains(Z.end)){console.warn("Dynamic element boundaries not found");return}this.__emptyBoundaries__(Z),J.length&&Z1.default(Z.start).after(J)}__getAttributes__(J){const Z=J.attrs(),H={},X={},q={literals:{},expressions:{},map:{explicitAttrs:[],spreadAttrs:[],beforeSpreadAttrs:[],afterSpreadAttrs:[],metaAttrs:[]}},W=Object.keys(Z).find((w)=>Y1.test(w));let G=[],Y=!1;return Z&&Object.entries(Z).forEach(([w,M])=>{if(w==":dtag")return;if(w.startsWith(":")||w.startsWith(O1)||w.startsWith(S1)||Y1.test(w)||M0.test(w))if(M0.test(w)){const[O,C]=w.match(M0)||[];G=C.split(",")}else if(w.startsWith(S1))H[w.replace(S1,"")]=M;else if(w.startsWith(O1))X[w.replace(O1,"")]=M;else{if(w.startsWith(":"))w=w.slice(1,w.length);if(W)if(Y1.test(w))q.map.spreadAttrs.push(w),Y=!0;else q.map.explicitAttrs.push(w),!Y?q.map.beforeSpreadAttrs.push(w):q.map.afterSpreadAttrs.push(w);q.expressions[w]=M||""}else if(q.literals[w]=M,W)q.map.explicitAttrs.push(w),!Y?q.map.beforeSpreadAttrs.push(w):q.map.afterSpreadAttrs.push(w)}),{argv:G,events:H,functions:X,attrs:q}}__withPath__(J,Z){const H=this.__inpath__;this.__inpath__=J;const X=Z();return this.__inpath__=H,X}__getPathParent__(J){const Z=J.split("/");if(Z.length>1)Z.pop();return Z.join("/")}__hasSamePathParent__(J,Z){return J.startsWith(Z)&&!J.replace(Z,"").startsWith(".")||J.startsWith(`${Z+K0}`)}__evaluate__(J,Z,H){J=typeof J==="string"?J.trim():J;try{const X=(q)=>{const W=this.state.toJSON(),G=(w,...M)=>{try{return w(...M)}catch(O){!H?.mute&&console.error("Eval error --",O);return}};let Y=`return ${q};`;if(Z){let w={},M;for(let C in Z){if(C==="__arguments__")continue;w[C]=Z[C].value}if(typeof Z.__arguments__==="object")M=Z.__arguments__;Y=`with( scope ){ ${Y} }`;const O=new Function("self","input","state","static","context","scope","arguments",Y);return G(O,this,this.input,W,this.static,this.context,w||{},M)}else{const w=new Function("self","input","state","static","context",Y);return G(w,this,this.input,W,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return X(J.slice(1));return J.replace(g0,(q,W)=>X(W))}return X(J)}catch(X){!H?.mute&&console.error("Expression evaluation error --",X);return}}__evaluateFunction__(J,Z,H){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,H)(...Z);else{let[X,...q]=J.split(/\s*,\s*/),W;const G=this.__evaluate__(X,H,{mute:!0});if(typeof G==="function")W=G;else{if(typeof this[X]!=="function")throw new Error(`Undefined <${X}> handler method`);W=this[X].bind(this)}if(typeof W!=="function")throw new Error(`Expected <${X}> to be a function or handler method`);let Y=q.map((w)=>this.__evaluate__(w,H));if(Z.length)Y=[...Y,...Z];return W(...Y)}}__evaluateSpreadAttr__(J,Z){const H=this.__evaluate__(J.replace(Y1,""),Z.memo);if(!H){if(!Z.keystore.length)throw new Error(`Undefined spread operator ${J}`);typeof Z.nullify==="function"&&Z.nullify(Z.keystore);return}if(typeof H!=="object"||Array.isArray(H))throw new Error(`Invalid spread operator ${J}`);if(Z.keystore=Object.keys(H)||[],typeof Z.each==="function")for(let X in H)Z.each(X,H[X])}__interpolate__(J,Z,H){if(J=J.replace(g0,(X,q)=>this.__evaluate__(q,Z)),H)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J){const{element:Z,nodepath:H,_event:X,instruction:q,scope:W,__dependencies__:G}=J;let Y=W;if(Z.on(X,(...w)=>this.__evaluateFunction__(q,w,Y)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(q,W))this.__extractExpressionDeps__(q,W).forEach((M)=>this.__trackDep__(G,M,W||{},{nodetype:"event",nodepath:H,deppath:`${H}.${X}`,target:"event-handler",$fragment:!(Z instanceof x1)?Z:null,boundaries:Z instanceof x1?Z.__boundaries__:void 0,update:(O)=>{Y=O}}))}__detachEvent__({element:J,nodepath:Z,_event:H,instruction:X,scope:q,__dependencies__:W}){if(J.off(H),this.__isReactive__(X,q)){const G=this.__extractExpressionDeps__(X,q),Y=`${Z}.${H}`;G.forEach((w)=>{W.get(w)?.delete(Y),this.FGUD.get(w)?.delete(Y)})}this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const H=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const W=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(W,Z).forEach((Y)=>H.add(Y))}),Array.from(H)}__extractExpressionDeps__(J,Z){const H=/\b(state|input|context|arguments)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,X=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g,q=/\b(arguments)((?:\.[a-zA-Z_]\w*)+)?(?=\[|\.|$|\s|;|,|\))/g;let W=[...Array.from(J.matchAll(H)),...Array.from(J.matchAll(X)),...Array.from(J.matchAll(q))];if(Z&&Object.keys(Z).length){const G=new RegExp(`\\b(?<!\\.)(${Object.keys(Z).join("|")})`,"g"),Y=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");W=[...W,...Array.from(J.matchAll(G)),...Array.from(J.matchAll(Y))]}return[...new Set(W.map((G)=>G[0]))]}__isReactive__(J,Z){if(/(self|state|input|context|arguments)(\.[\w.]+)?/.test(J))return!0;if(Z&&Object.keys(Z).length&&new RegExp(Object.keys(Z).join("|")).test(J))return!0;return!1}__bindMemo__(J,Z){const H=Z.deppath||Z.nodepath,X=this.FGUDMemory.get(Z.nodepath);if(X)X.tracks.set(H,Z.priority||2),X.memo=J,this.FGUDMemory.set(Z.nodepath,X);else{const q=new Map;q.set(H,Z.priority),this.FGUDMemory.set(Z.nodepath,{tracks:q,memo:J})}}__unbindMemo__(J){const Z=J.deppath||J.nodepath,H=this.FGUDMemory.get(J.nodepath);if(!H||!H.tracks.get(Z))return;H.tracks.delete(Z),!H.tracks.size&&this.FGUDMemory.delete(J.nodepath)}__trackDep__(J,Z,H,X){if(H&&H[Z]&&H[Z].type==="let")X.haslet=!0;if(X.priority===void 0)if(X.target==="attr"&&Z.split(".").find((W)=>R5.includes(W)))X.priority=0;else if(X.syntax)X.priority=1;else if(["event"].includes(X.nodetype))X.priority=3;else X.priority=2;const q=X.deppath||X.nodepath;X.level=q.split(/\//g).length,X.priority=X.level*x5+X.priority,!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(q,X),this.__bindMemo__(H,X),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J,Z){this.__i18nDeps.set(Z.deppath||Z.nodepath,Z),this.__bindMemo__(J,Z),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Z){return Z.reduce((H,X)=>H?.[X],J)}__shouldUpdate__(J,Z){if(J==="self")return!0;const H={state:this.state,input:this.input,context:this.context},X=this.__valueDep__(this.__previous[J],Z),q=this.__valueDep__(H[J],Z);return!P1(X,q)}__updateDepNodes__(){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((J,Z)=>{const[H,...X]=Z.split(".");if(!this.__shouldUpdate__(H,X))return;J.forEach((q)=>{try{const W=q.deppath||q.nodepath;if(q.garbage||q.boundaries?.start&&!document.contains(q.boundaries.start)||q.$fragment!==null&&!q.$fragment.closest("body").length){J.delete(W),this.__unbindMemo__(q);return}this.UQS.queue({dep:Z,deppath:W,priority:q.priority}),this.metrics.inc("dependencyUpdateCount")}catch(W){console.error("failed to update dependency nodes --",W);return}}),!J.size&&this.FGUD?.delete(Z)}),this.metrics.endRender()}__updateVarDepNodes__(J,Z,H){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((X,q)=>{if(!X.haslet||!this.__hasSamePathParent__(q,this.__getPathParent__(Z)))return;const W=X.deppath||X.nodepath,G=this.FGUDMemory.get(X.nodepath);if(!G){console.warn(`unexpected occurence: <${W}> has no memo`);return}G.memo={...G.memo,...H},this.UQS.queue({dep:J,deppath:W,priority:X.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateArgumentsDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender();const H="arguments";this.FGUD.get(H)?.forEach((X,q)=>{if(!this.__hasSamePathParent__(q,J))return;const W=X.deppath||X.nodepath,G=this.FGUDMemory.get(X.nodepath);if(!G){console.warn(`unexpected occurence: <${W}> has no memo`);return}G.memo.__arguments__=Z,this.UQS.queue({dep:H,deppath:W,priority:X.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Z)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Z);return}const H=this.FGUDMemory.get(J.nodepath);if(!H){console.warn(`unexpected occurence: <${J.deppath||J.nodepath}> has no memo`);return}J.update(H.memo,"i18n-partial-updator"),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?Z1.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?Z1.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?Z1.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var _0={};m1(_0,{handler:()=>{{return E6}},declaration:()=>{{return P6}},_static:()=>{{return $6}}});var P6={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},$6={initialized:!1,prevRenderer:null},E6={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,H=!1){if(!J.renderer)return;if(J.by){this.static.prevRenderer?.cleanup();const X=J.renderer.mesh({},Z);if(this.static.prevRenderer=J.renderer,!X?.length)return;if(H)return X;J.renderer.fill(X)}else{this.static.prevRenderer?.cleanup();let X=!1,q;if(Array.isArray(J["else-if"])&&J["else-if"].length)for(let W of J["else-if"]){if(!W.by)continue;if(q=W.renderer.mesh({},Z),this.static.prevRenderer=W.renderer,!q?.length)return;if(H)return q;q?.length&&W.renderer.fill(q),X=!0;break}if(!X&&J.else){const W=J.else.renderer.mesh({},Z);if(this.static.prevRenderer=J.else.renderer,!W?.length)return;if(H)return W;J.else.renderer.fill(W)}}}};var h0={};m1(h0,{state:()=>{{return T6}},handler:()=>{{return S6}},default:()=>{{return b6}},declaration:()=>{{return R6}},_static:()=>{{return A6}}});var R6={name:"for",syntax:!0,iterator:!0},T6={argvlist:null},A6={lastIn:null,processingBatch:!1},S6={onInput(){this.processor(this.input)},processor(J){if(this.static.processingBatch)return;if(!J.renderer)throw new Error("Undefined mesh renderer");let{in:Z,from:H,to:X}=J;if(Z===void 0&&H===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(H!==void 0){if(H=parseFloat(String(H)),X==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");X=parseFloat(String(X));const q=H<X,W=Math.abs(X-H)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===W){const[Y]=J.renderer.argv;if(Y){let w=H,M=!0;for(let O=0;O<this.state.argvlist.length;O++){if(this.state.argvlist[O][Y].value!==w){M=!1;break}w=q?w+1:w-1}if(M)return;w=H;for(let O=0;O<this.state.argvlist.length;O++)this.state.argvlist[O][Y].value=w,w=q?w+1:w-1;return}}const G=[];for(let Y=H;q?Y<=X:Y>=X;q?Y++:Y--){const w={},[M]=J.renderer.argv;if(M)w[M]={value:Y,type:"arg"};G.push(w)}this.state.argvlist=G}else if(Array.isArray(Z)){if(this.state.argvlist&&this.static.lastIn&&J.in===this.static.lastIn)return;if(!Z.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update");this.state.argvlist=[];return}if(this.static.lastIn=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.length){const[G,Y]=J.renderer.argv;for(let w=0;w<Z.length;w++){const M=this.state.argvlist[w];if(G)M[G].value=Z[w]}return}const q=[];let W=0;for(let G of Z){const Y={},[w,M]=J.renderer.argv;if(w)Y[w]={value:G,type:"arg"};if(M)Y[M]={value:W,type:"arg"};q.push(Y),W++}this.state.argvlist=q}else if(Z instanceof Map){if(this.state.argvlist&&this.static.lastIn&&J.in===this.static.lastIn)return;if(!Z.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update");this.state.argvlist=[];return}if(this.static.lastIn=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.size){const[G,Y,w]=J.renderer.argv;let M=0;for(let[O,C]of Z){const b=this.state.argvlist[M];if(G)b[G].value=O;if(Y)b[Y].value=C;M++}return}const q=[];let W=0;for(let[G,Y]of Z){const w={},[M,O,C]=J.renderer.argv;if(M)w[M]={value:G,type:"arg"};if(O)w[O]={value:Y,type:"arg"};if(C)w[C]={value:W,type:"arg"};q.push(w),W++}this.state.argvlist=q}else if(typeof Z=="object"){if(this.state.argvlist&&this.static.lastIn&&J.in===this.static.lastIn)return;if(!Object.keys(Z).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update");this.state.argvlist=[];return}this.static.lastIn=Z;const q=Object.keys(Z);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q.length){const[Y,w,M]=J.renderer.argv;for(let O=0;O<q.length;O++){const C=q[O],b=this.state.argvlist[O];if(Y)b[Y].value=C;if(w)b[w].value=Z[C]}return}const W=[];let G=0;for(let Y in Z){const w={},[M,O,C]=J.renderer.argv;if(M)w[M]={value:Y,type:"arg"};if(O)w[O]={value:Z[Y],type:"arg"};if(C)w[C]={value:G,type:"arg"};W.push(w),G++}this.state.argvlist=W}}finally{this.static.processingBatch=!1}}},b6="<{input.renderer} #=state.argvlist/>";var f0={};m1(f0,{state:()=>{{return g6}},handler:()=>{{return k6}},default:()=>{{return _6}},declaration:()=>{{return x6}}});var x6={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},g6={renderer:null,props:{}},k6={onInput(){this.processor(this.input)},processor(J){if(!J.await)throw new Error("Undefined async <await> attribute");if(!(J.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(J.loading)this.state.renderer=J.loading.renderer,this.state.props={};J.await.then((Z)=>{if(!J.then)return;this.state.renderer=J.then.renderer;const[H]=J.then.renderer.argv;this.state.props={[H]:{value:Z,type:"arg"}}}).catch((Z)=>{if(!J.catch)return;this.state.renderer=J.catch.renderer;const[H]=J.then.renderer.argv;this.state.props={[H]:{value:Z,type:"arg"}}})}},_6="<{state.renderer} #=state.props/>";var y0={};m1(y0,{handler:()=>{{return y6}},declaration:()=>{{return h6}},_static:()=>{{return f6}}});var h6={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},f6={initialized:!1,prevRenderer:null},y6={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,H=!1){let X=[];this.static.prevRenderer?.cleanup();for(let q of J.case)if(q.is==J.by||Array.isArray(q.is)&&q.is.includes(J.by)){Array.isArray(q.is)?X=[...new Set([...X,...q.is])]:X.push(q.is);const W=q.renderer.mesh({},Z);if(this.static.prevRenderer=q.renderer,!W?.length)return;if(H)return W;q.renderer.fill(W)}if(X.includes(J.by))return;if(J.default){const q=J.default.renderer.mesh({},Z);if(this.static.prevRenderer=J.default.renderer,!q?.length)return;if(H)return q;J.default.renderer.fill(q)}else this.static.prevRenderer=null}};var v0={};m1(v0,{state:()=>{{return v6}},handler:()=>{{return i6}},default:()=>{{return c6}},context:()=>{{return m6}},_static:()=>{{return u6}}});var d6=function(J){const Z={};return J.split("&").map((X)=>{const[q,W]=X.split("=");Z[q]=W}),Z},v6={page:null,params:{},query:{}},u6={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},m6=["navigate"],i6={onInput(){this.processor(this.input)},processor(J){if(!J.routes)return;if(J.global)this.static.global=J.global;if(this.static.routes=J.routes.map(({path:Z,template:H,default:X})=>{if(X)this.static.defaultPath=Z;const q=Z.match(/:[^\/]*(\/|$)/gi)||[],W=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:H,default:X,pathVars:q,pathRegex:new RegExp(`${W}\$`,"i")}}),J.global){const Z=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&Z=="/"&&Z!==this.static.defaultPath?this.static.defaultPath:Z?Z+window.location.search:this.static.routes[0].path}},onAttach(){if(this.input.global)window.navigate=this.navigate.bind(this),window.addEventListener("popstate",(J)=>J.state&&this.navigate(J.state.path,!0));this.setContext("navigate",this.navigate.bind(this)),this.static.defaultPath&&this.navigate(this.static.defaultPath)},navigate(J,Z){!Z&&this.static.global&&history.pushState({path:J},"",J);const H=J.split("?");J=H[0];const X=H[1]?d6(H[1]):{};let q=null;if(this.static.currentRoute)q={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:q,toState:{path:J,query:X}});const W=this.match(J);if(!W){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:G,params:Y}=W;this.emit("after",{fromState:q,toState:{path:G.path,params:Y,query:X}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=Y,this.state.query=X,this.state.page=G.template},match(J){const Z={};let H=!1;for(let X of this.static.routes){const{pathVars:q,pathRegex:W}=X,G=J.match(W);if(G!==null&&G.index===0){for(let Y=0;Y+1<G.length&&Y<q.length;Y++)Z[q[Y].replaceAll(/[\/:]/g,"")]=G[Y+1];H=X;break}}return H?{route:H,params:Z}:!1}},c6="<{state.page} params=state.params query=state.query/>";class f5{debug=!1;stylesheets=[];config={};store={};__root;i18n=new t1;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new n1,this.IUC=new r1;const[Z,H]=b1(this.i18n.lang),[X,q]=b1(J?.context||{});this.__setLang=H,this.__getLang=Z,this.__setContext=q,this.__getContext=X,this.register("if",_0),this.register("for",h0),this.register("async",f0),this.register("switch",y0),this.register("router",v0)}register(J,Z){return this.store[J]=Z,this}unregister(J){return delete this.store[J],this}has(J){return J in this.store}import(J){if(!this.has(J))throw new Error(`<${J}> component not found`);if(!this.store[J].declaration?.syntax&&!this.store[J].default)throw new Error(`Invalid <${J}> component`);return this.store[J]}render(J,Z,H){const{default:X,...q}=Z,W={debug:this.debug,prepath:"0",lips:this},G=new x1(J,X||"",{...q,input:H},W);return window.addEventListener("beforeunload",()=>{return this.dispose(),G.destroy(),null}),window.addEventListener("pagehide",(Y)=>{!Y.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),G}root(J,Z){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Z),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((H)=>new u1("root",{sheet:H,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Z){const H=this.__getContext();if(typeof J==="string"){const X={...H,[J]:Z};B1(H,X)&&this.__setContext(X)}else if(!Array.isArray(J)){const X={...H,...J};B1(H,X)&&this.__setContext(X)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;c1(()=>{const H=this.__getContext();if(!H)return;const X=Object.fromEntries(J.map((q)=>[q,H[q]]));X&&typeof Z==="function"&&Object.keys(X).length&&Z(X)})}useTranslator(J,Z){c1(()=>{const H=this.__getLang();if(!H)return;(J==="*"||Array.isArray(J)&&J.includes(H))&&typeof Z==="function"&&Z(H)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}export{f5 as default};
|
|
1
|
+
var M8=Object.create;var{defineProperty:g0,getPrototypeOf:K8,getOwnPropertyNames:I8}=Object;var O8=Object.prototype.hasOwnProperty;var t1=(J,Z,W)=>{W=J!=null?M8(K8(J)):{};const H=Z||!J||!J.__esModule?g0(W,"default",{value:J,enumerable:!0}):W;for(let q of I8(J))if(!O8.call(H,q))g0(H,q,{get:()=>J[q],enumerable:!0});return H};var D8=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var i1=(J,Z)=>{for(var W in Z)g0(J,W,{get:Z[W],enumerable:!0,configurable:!0,set:(H)=>Z[W]=()=>H})};var c1=D8((H5,q5)=>{(function(){var J=document,Z=window,W=J.documentElement,H=J.createElement.bind(J),q=H("div"),X=H("table"),G=H("tbody"),w=H("tr"),M=Array.isArray,Y=Array.prototype,D=Y.concat,K=Y.filter,S=Y.indexOf,m=Y.map,e=Y.push,t=Y.slice,H1=Y.some,r=Y.splice,d=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,v=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,c=/<.+>/,p=/^\w+$/;function J1(Q,z){var B=P(z);return!Q||!B&&!L(z)&&!A(z)?[]:!B&&v.test(Q)?z.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!B&&p.test(Q)?z.getElementsByTagName(Q):z.querySelectorAll(Q)}var u=function(){function Q(z,B){if(!z)return;if(O(z))return z;var I=z;if(x(z)){var V=B||J;if(I=d.test(z)&&L(V)?V.getElementById(z.slice(1).replace(/\\/g,"")):c.test(z)?p0(z):O(V)?V.find(z):x(V)?j(V).find(z):J1(z,V),!I)return}else if(g(z))return this.ready(z);if(I.nodeType||I===Z)I=[I];this.length=I.length;for(var E=0,f=this.length;E<f;E++)this[E]=I[E]}return Q.prototype.init=function(z,B){return new Q(z,B)},Q}(),U=u.prototype,j=U.init;if(j.fn=j.prototype=U,U.length=0,U.splice=r,typeof Symbol==="function")U[Symbol.iterator]=Y[Symbol.iterator];function O(Q){return Q instanceof u}function C(Q){return!!Q&&Q===Q.window}function L(Q){return!!Q&&Q.nodeType===9}function P(Q){return!!Q&&Q.nodeType===11}function A(Q){return!!Q&&Q.nodeType===1}function y(Q){return!!Q&&Q.nodeType===3}function l(Q){return typeof Q==="boolean"}function g(Q){return typeof Q==="function"}function x(Q){return typeof Q==="string"}function N(Q){return Q===void 0}function _(Q){return Q===null}function R(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function k(Q){if(typeof Q!=="object"||Q===null)return!1;var z=Object.getPrototypeOf(Q);return z===null||z===Object.prototype}j.isWindow=C,j.isFunction=g,j.isArray=M,j.isNumeric=R,j.isPlainObject=k;function F(Q,z,B){if(B){var I=Q.length;while(I--)if(z.call(Q[I],I,Q[I])===!1)return Q}else if(k(Q)){var V=Object.keys(Q);for(var I=0,E=V.length;I<E;I++){var f=V[I];if(z.call(Q[f],f,Q[f])===!1)return Q}}else for(var I=0,E=Q.length;I<E;I++)if(z.call(Q[I],I,Q[I])===!1)return Q;return Q}j.each=F,U.each=function(Q){return F(this,Q)},U.empty=function(){return this.each(function(Q,z){while(z.firstChild)z.removeChild(z.firstChild)})};function T(){var Q=[];for(var z=0;z<arguments.length;z++)Q[z]=arguments[z];var B=l(Q[0])?Q.shift():!1,I=Q.shift(),V=Q.length;if(!I)return{};if(!V)return T(B,j,I);for(var E=0;E<V;E++){var f=Q[E];for(var s in f)if(B&&(M(f[s])||k(f[s]))){if(!I[s]||I[s].constructor!==f[s].constructor)I[s]=new f[s].constructor;T(B,I[s],f[s])}else I[s]=f[s]}return I}j.extend=T,U.extend=function(Q){return T(U,Q)};var h=/\S+/g;function $(Q){return x(Q)?Q.match(h)||[]:[]}U.toggleClass=function(Q,z){var B=$(Q),I=!N(z);return this.each(function(V,E){if(!A(E))return;F(B,function(f,s){if(I)z?E.classList.add(s):E.classList.remove(s);else E.classList.toggle(s)})})},U.addClass=function(Q){return this.toggleClass(Q,!0)},U.removeAttr=function(Q){var z=$(Q);return this.each(function(B,I){if(!A(I))return;F(z,function(V,E){I.removeAttribute(E)})})};function b(Q,z){if(!Q)return;if(x(Q)){if(arguments.length<2){if(!this[0]||!A(this[0]))return;var B=this[0].getAttribute(Q);return _(B)?void 0:B}if(N(z))return this;if(_(z))return this.removeAttr(Q);return this.each(function(V,E){if(!A(E))return;E.setAttribute(Q,z)})}for(var I in Q)this.attr(I,Q[I]);return this}U.attr=b,U.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},U.hasClass=function(Q){return!!Q&&H1.call(this,function(z){return A(z)&&z.classList.contains(Q)})},U.get=function(Q){if(N(Q))return t.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},U.eq=function(Q){return j(this.get(Q))},U.first=function(){return this.eq(0)},U.last=function(){return this.eq(-1)};function o(Q){if(N(Q))return this.get().map(function(z){return A(z)||y(z)?z.textContent:""}).join("");return this.each(function(z,B){if(!A(B))return;B.textContent=Q})}U.text=o;function i(Q,z,B){if(!A(Q))return;var I=Z.getComputedStyle(Q,null);return B?I.getPropertyValue(z)||void 0:I[z]||Q.style[z]}function n(Q,z){return parseInt(i(Q,z),10)||0}function Z1(Q,z){return n(Q,"border".concat(z?"Left":"Top","Width"))+n(Q,"padding".concat(z?"Left":"Top"))+n(Q,"padding".concat(z?"Right":"Bottom"))+n(Q,"border".concat(z?"Right":"Bottom","Width"))}var a={};function B1(Q){if(a[Q])return a[Q];var z=H(Q);J.body.insertBefore(z,null);var B=i(z,"display");return J.body.removeChild(z),a[Q]=B!=="none"?B:"block"}function D1(Q){return i(Q,"display")==="none"}function h1(Q,z){var B=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!B&&!!z&&B.call(Q,z)}function r1(Q){return x(Q)?function(z,B){return h1(B,Q)}:g(Q)?Q:O(Q)?function(z,B){return Q.is(B)}:!Q?function(){return!1}:function(z,B){return B===Q}}U.filter=function(Q){var z=r1(Q);return j(K.call(this,function(B,I){return z.call(B,I,B)}))};function A1(Q,z){return!z?Q:Q.filter(z)}U.detach=function(Q){return A1(this,Q).each(function(z,B){if(B.parentNode)B.parentNode.removeChild(B)}),this};var u5=/^\s*<(\w+)[^>]*>/,m5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,c0={"*":q,tr:G,td:w,th:w,thead:X,tbody:X,tfoot:X};function p0(Q){if(!x(Q))return[];if(m5.test(Q))return[H(RegExp.$1)];var z=u5.test(Q)&&RegExp.$1,B=c0[z]||c0["*"];return B.innerHTML=Q,j(B.childNodes).detach().get()}j.parseHTML=p0,U.has=function(Q){var z=x(Q)?function(B,I){return J1(Q,I).length}:function(B,I){return I.contains(Q)};return this.filter(z)},U.not=function(Q){var z=r1(Q);return this.filter(function(B,I){return(!x(Q)||A(I))&&!z.call(I,B,I)})};function C1(Q,z,B,I){var V=[],E=g(z),f=I&&r1(I);for(var s=0,j1=Q.length;s<j1;s++)if(E){var q1=z(Q[s]);if(q1.length)e.apply(V,q1)}else{var w1=Q[s][z];while(w1!=null){if(I&&f(-1,w1))break;V.push(w1),w1=B?w1[z]:null}}return V}function s0(Q){if(Q.multiple&&Q.options)return C1(K.call(Q.options,function(z){return z.selected&&!z.disabled&&!z.parentNode.disabled}),"value");return Q.value||""}function d5(Q){if(!arguments.length)return this[0]&&s0(this[0]);return this.each(function(z,B){var I=B.multiple&&B.options;if(I||W5.test(B.type)){var V=M(Q)?m.call(Q,String):_(Q)?[]:[String(Q)];if(I)F(B.options,function(E,f){f.selected=V.indexOf(f.value)>=0},!0);else B.checked=V.indexOf(B.value)>=0}else B.value=N(Q)||_(Q)?"":Q})}U.val=d5,U.is=function(Q){var z=r1(Q);return H1.call(this,function(B,I){return z.call(B,I,B)})},j.guid=1;function V1(Q){return Q.length>1?K.call(Q,function(z,B,I){return S.call(I,z)===B}):Q}j.unique=V1,U.add=function(Q,z){return j(V1(this.get().concat(j(Q,z).get())))},U.children=function(Q){return A1(j(V1(C1(this,function(z){return z.children}))),Q)},U.parent=function(Q){return A1(j(V1(C1(this,"parentNode"))),Q)},U.index=function(Q){var z=Q?j(Q)[0]:this[0],B=Q?this:j(z).parent().children();return S.call(B,z)},U.closest=function(Q){var z=this.filter(Q);if(z.length)return z;var B=this.parent();if(!B.length)return z;return B.closest(Q)},U.siblings=function(Q){return A1(j(V1(C1(this,function(z){return j(z).parent().children().not(z)}))),Q)},U.find=function(Q){return j(V1(C1(this,function(z){return J1(Q,z)})))};var i5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,c5=/^$|^module$|\/(java|ecma)script/i,p5=["type","src","nonce","noModule"];function s5(Q,z){var B=j(Q);B.filter("script").add(B.find("script")).each(function(I,V){if(c5.test(V.type)&&W.contains(V)){var E=H("script");E.text=V.textContent.replace(i5,""),F(p5,function(f,s){if(V[s])E[s]=V[s]}),z.head.insertBefore(E,null),z.head.removeChild(E)}})}function l5(Q,z,B,I,V){if(I)Q.insertBefore(z,B?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(z,Q);else Q.parentNode.insertBefore(z,B?Q:Q.nextSibling);if(V)s5(z,Q.ownerDocument)}function $1(Q,z,B,I,V,E,f,s){return F(Q,function(j1,q1){F(j(q1),function(w1,b1){F(j(z),function(F1,a1){var A0=B?b1:a1,$0=B?a1:b1,M1=B?w1:F1;l5(A0,!M1?$0:$0.cloneNode(!0),I,V,!M1)},s)},f)},E),z}U.after=function(){return $1(arguments,this,!1,!1,!1,!0,!0)},U.append=function(){return $1(arguments,this,!1,!1,!0)};function o5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if(N(Q))return this;var z=/<script[\s>]/.test(Q);return this.each(function(B,I){if(!A(I))return;if(z)j(I).empty().append(Q);else I.innerHTML=Q})}U.html=o5,U.appendTo=function(Q){return $1(arguments,this,!0,!1,!0)},U.wrapInner=function(Q){return this.each(function(z,B){var I=j(B),V=I.contents();V.length?V.wrapAll(Q):I.append(Q)})},U.before=function(){return $1(arguments,this,!1,!0)},U.wrapAll=function(Q){var z=j(Q),B=z[0];while(B.children.length)B=B.firstElementChild;return this.first().before(z),this.appendTo(B)},U.wrap=function(Q){return this.each(function(z,B){var I=j(Q)[0];j(B).wrapAll(!z?I:I.cloneNode(!0))})},U.insertAfter=function(Q){return $1(arguments,this,!0,!1,!1,!1,!1,!0)},U.insertBefore=function(Q){return $1(arguments,this,!0,!0)},U.prepend=function(){return $1(arguments,this,!1,!0,!0,!0,!0)},U.prependTo=function(Q){return $1(arguments,this,!0,!0,!0,!1,!1,!0)},U.contents=function(){return j(V1(C1(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},U.next=function(Q,z,B){return A1(j(V1(C1(this,"nextElementSibling",z,B))),Q)},U.nextAll=function(Q){return this.next(Q,!0)},U.nextUntil=function(Q,z){return this.next(z,!0,Q)},U.parents=function(Q,z){return A1(j(V1(C1(this,"parentElement",!0,z))),Q)},U.parentsUntil=function(Q,z){return this.parents(z,Q)},U.prev=function(Q,z,B){return A1(j(V1(C1(this,"previousElementSibling",z,B))),Q)},U.prevAll=function(Q){return this.prev(Q,!0)},U.prevUntil=function(Q,z){return this.prev(z,!0,Q)},U.map=function(Q){return j(D.apply([],m.call(this,function(z,B){return Q.call(z,B,z)})))},U.clone=function(){return this.map(function(Q,z){return z.cloneNode(!0)})},U.offsetParent=function(){return this.map(function(Q,z){var B=z.offsetParent;while(B&&i(B,"position")==="static")B=B.offsetParent;return B||W})},U.slice=function(Q,z){return j(t.call(this,Q,z))};var r5=/-([a-z])/g;function V0(Q){return Q.replace(r5,function(z,B){return B.toUpperCase()})}U.ready=function(Q){var z=function(){return setTimeout(Q,0,j)};if(J.readyState!=="loading")z();else J.addEventListener("DOMContentLoaded",z);return this},U.unwrap=function(){return this.parent().each(function(Q,z){if(z.tagName==="BODY")return;var B=j(z);B.replaceWith(B.children())}),this},U.offset=function(){var Q=this[0];if(!Q)return;var z=Q.getBoundingClientRect();return{top:z.top+Z.pageYOffset,left:z.left+Z.pageXOffset}},U.position=function(){var Q=this[0];if(!Q)return;var z=i(Q,"position")==="fixed",B=z?Q.getBoundingClientRect():this.offset();if(!z){var I=Q.ownerDocument,V=Q.offsetParent||I.documentElement;while((V===I.body||V===I.documentElement)&&i(V,"position")==="static")V=V.parentNode;if(V!==Q&&A(V)){var E=j(V).offset();B.top-=E.top+n(V,"borderTopWidth"),B.left-=E.left+n(V,"borderLeftWidth")}}return{top:B.top-n(Q,"marginTop"),left:B.left-n(Q,"marginLeft")}};var l0={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};U.prop=function(Q,z){if(!Q)return;if(x(Q)){if(Q=l0[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(I,V){V[Q]=z})}for(var B in Q)this.prop(B,Q[B]);return this},U.removeProp=function(Q){return this.each(function(z,B){delete B[l0[Q]||Q]})};var n5=/^--/;function N0(Q){return n5.test(Q)}var C0={},a5=q.style,t5=["webkit","moz","ms"];function e5(Q,z){if(z===void 0)z=N0(Q);if(z)return Q;if(!C0[Q]){var B=V0(Q),I="".concat(B[0].toUpperCase()).concat(B.slice(1)),V="".concat(B," ").concat(t5.join("".concat(I," "))).concat(I).split(" ");F(V,function(E,f){if(f in a5)return C0[Q]=f,!1})}return C0[Q]}var J8={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function o0(Q,z,B){if(B===void 0)B=N0(Q);return!B&&!J8[Q]&&R(z)?"".concat(z,"px"):z}function Z8(Q,z){if(x(Q)){var B=N0(Q);if(Q=e5(Q,B),arguments.length<2)return this[0]&&i(this[0],Q,B);if(!Q)return this;return z=o0(Q,z,B),this.each(function(V,E){if(!A(E))return;if(B)E.style.setProperty(Q,z);else E.style[Q]=z})}for(var I in Q)this.css(I,Q[I]);return this}U.css=Z8;function r0(Q,z){try{return Q(z)}catch(B){return z}}var Q8=/^\s+|\s+$/;function n0(Q,z){var B=Q.dataset[z]||Q.dataset[V0(z)];if(Q8.test(B))return B;return r0(JSON.parse,B)}function W8(Q,z,B){B=r0(JSON.stringify,B),Q.dataset[V0(z)]=B}function X8(Q,z){if(!Q){if(!this[0])return;var B={};for(var I in this[0].dataset)B[I]=n0(this[0],I);return B}if(x(Q)){if(arguments.length<2)return this[0]&&n0(this[0],Q);if(N(z))return this;return this.each(function(V,E){W8(E,Q,z)})}for(var I in Q)this.data(I,Q[I]);return this}U.data=X8;function a0(Q,z){var B=Q.documentElement;return Math.max(Q.body["scroll".concat(z)],B["scroll".concat(z)],Q.body["offset".concat(z)],B["offset".concat(z)],B["client".concat(z)])}F([!0,!1],function(Q,z){F(["Width","Height"],function(B,I){var V="".concat(z?"outer":"inner").concat(I);U[V]=function(E){if(!this[0])return;if(C(this[0]))return z?this[0]["inner".concat(I)]:this[0].document.documentElement["client".concat(I)];if(L(this[0]))return a0(this[0],I);return this[0]["".concat(z?"offset":"client").concat(I)]+(E&&z?n(this[0],"margin".concat(B?"Top":"Left"))+n(this[0],"margin".concat(B?"Bottom":"Right")):0)}})}),F(["Width","Height"],function(Q,z){var B=z.toLowerCase();U[B]=function(I){if(!this[0])return N(I)?void 0:this;if(!arguments.length){if(C(this[0]))return this[0].document.documentElement["client".concat(z)];if(L(this[0]))return a0(this[0],z);return this[0].getBoundingClientRect()[B]-Z1(this[0],!Q)}var V=parseInt(I,10);return this.each(function(E,f){if(!A(f))return;var s=i(f,"boxSizing");f.style[B]=o0(B,V+(s==="border-box"?Z1(f,!Q):0))})}});var t0="___cd";U.toggle=function(Q){return this.each(function(z,B){if(!A(B))return;var I=D1(B),V=N(Q)?I:Q;if(V){if(B.style.display=B[t0]||"",D1(B))B.style.display=B1(B.tagName)}else if(!I)B[t0]=i(B,"display"),B.style.display="none"})},U.hide=function(){return this.toggle(!1)},U.show=function(){return this.toggle(!0)};var e0="___ce",R0=".",P0={focus:"focusin",blur:"focusout"},J5={mouseenter:"mouseover",mouseleave:"mouseout"},H8=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function T0(Q){return J5[Q]||P0[Q]||Q}function E0(Q){var z=Q.split(R0);return[z[0],z.slice(1).sort()]}U.trigger=function(Q,z){if(x(Q)){var B=E0(Q),I=B[0],V=B[1],E=T0(I);if(!E)return this;var f=H8.test(E)?"MouseEvents":"HTMLEvents";Q=J.createEvent(f),Q.initEvent(E,!0,!0),Q.namespace=V.join(R0),Q.___ot=I}Q.___td=z;var s=Q.___ot in P0;return this.each(function(j1,q1){if(s&&g(q1[Q.___ot]))q1["___i".concat(Q.type)]=!0,q1[Q.___ot](),q1["___i".concat(Q.type)]=!1;q1.dispatchEvent(Q)})};function Z5(Q){return Q[e0]=Q[e0]||{}}function q8(Q,z,B,I,V){var E=Z5(Q);E[z]=E[z]||[],E[z].push([B,I,V]),Q.addEventListener(z,V)}function Q5(Q,z){return!z||!H1.call(z,function(B){return Q.indexOf(B)<0})}function n1(Q,z,B,I,V){var E=Z5(Q);if(!z)for(z in E)n1(Q,z,B,I,V);else if(E[z])E[z]=E[z].filter(function(f){var s=f[0],j1=f[1],q1=f[2];if(V&&q1.guid!==V.guid||!Q5(s,B)||I&&I!==j1)return!0;Q.removeEventListener(z,q1)})}U.off=function(Q,z,B){var I=this;if(N(Q))this.each(function(E,f){if(!A(f)&&!L(f)&&!C(f))return;n1(f)});else if(!x(Q))for(var V in Q)this.off(V,Q[V]);else{if(g(z))B=z,z="";F($(Q),function(E,f){var s=E0(f),j1=s[0],q1=s[1],w1=T0(j1);I.each(function(b1,F1){if(!A(F1)&&!L(F1)&&!C(F1))return;n1(F1,w1,q1,z,B)})})}return this},U.remove=function(Q){return A1(this,Q).detach().off(),this},U.replaceWith=function(Q){return this.before(Q).remove()},U.replaceAll=function(Q){return j(Q).replaceWith(this),this};function z8(Q,z,B,I,V){var E=this;if(!x(Q)){for(var f in Q)this.on(f,z,B,Q[f],V);return this}if(!x(z))if(N(z)||_(z))z="";else if(N(B))B=z,z="";else I=B,B=z,z="";if(!g(I))I=B,B=void 0;if(!I)return this;return F($(Q),function(s,j1){var q1=E0(j1),w1=q1[0],b1=q1[1],F1=T0(w1),a1=w1 in J5,A0=w1 in P0;if(!F1)return;E.each(function($0,M1){if(!A(M1)&&!L(M1)&&!C(M1))return;var S0=function(z1){if(z1.target["___i".concat(z1.type)])return z1.stopImmediatePropagation();if(z1.namespace&&!Q5(b1,z1.namespace.split(R0)))return;if(!z&&(A0&&(z1.target!==M1||z1.___ot===F1)||a1&&z1.relatedTarget&&M1.contains(z1.relatedTarget)))return;var b0=M1;if(z){var f1=z1.target;while(!h1(f1,z)){if(f1===M1)return;if(f1=f1.parentNode,!f1)return}b0=f1}Object.defineProperty(z1,"currentTarget",{configurable:!0,get:function(){return b0}}),Object.defineProperty(z1,"delegateTarget",{configurable:!0,get:function(){return M1}}),Object.defineProperty(z1,"data",{configurable:!0,get:function(){return B}});var w8=I.call(b0,z1,z1.___td);if(V)n1(M1,F1,b1,z,S0);if(w8===!1)z1.preventDefault(),z1.stopPropagation()};S0.guid=I.guid=I.guid||j.guid++,q8(M1,F1,b1,z,S0)})}),this}U.on=z8;function G8(Q,z,B,I){return this.on(Q,z,B,I,!0)}U.one=G8;var B8=/\r?\n/g;function Y8(Q,z){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(z.replace(B8,"\r\n")))}var U8=/file|reset|submit|button|image/i,W5=/radio|checkbox/i;if(U.serialize=function(){var Q="";return this.each(function(z,B){F(B.elements||[B],function(I,V){if(V.disabled||!V.name||V.tagName==="FIELDSET"||U8.test(V.type)||W5.test(V.type)&&!V.checked)return;var E=s0(V);if(!N(E)){var f=M(E)?E:[E];F(f,function(s,j1){Q+=Y8(V.name,j1)})}})}),Q.slice(1)},typeof H5!=="undefined")q5.exports=j;else Z.cash=Z.$=j})()});class e1{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,Z){this.callbacks.set(J,Z)}unregister(J){this.callbacks.delete(J)}queue(J){if(!this.callbacks.has(J))return;if(this.pendingComponents.add(J),!this.isPending)this.isPending=!0,this.schedule()}schedule(){Promise.resolve().then(()=>this.process())}process(){const J=Array.from(this.pendingComponents);this.pendingComponents.clear(),this.isPending=!1,J.forEach((Z)=>{try{const W=this.callbacks.get(Z);if(W)W()}catch(W){console.error(`Error updating component ${Z}:`,W)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class J0{subscriptions=new Map;tick=new e1;register(J,Z){this.subscriptions.set(J,Z),this.tick.register(J,Z)}unregister(J){this.subscriptions.delete(J),this.tick.unregister(J)}queueUpdate(J){this.tick.queue(J)}dispose(){this.subscriptions.clear(),this.tick.dispose()}prepareForPotentialUnload(){this.tick.clear(),this.subscriptions.forEach((J,Z)=>{this.subscriptions.set(Z,()=>{})})}proxyState(J,Z){const W=this,H=new WeakMap,q=(G)=>{if(typeof G.toJSON==="function")return G;if(G instanceof Map)G.forEach((M,Y)=>G.set(Y,X(M)));else if(Array.isArray(G))G.forEach((M,Y)=>G[Y]=X(M));else if(typeof G==="object")Object.entries(G).forEach(([M,Y])=>G[M]=X(Y));let w=new Proxy(G,{get(M,Y){if(Y==="toJSON")return function(){const K=(S)=>{if(!S||typeof S!=="object")return S;if(H.has(S)){const m=H.get(S);if(m instanceof Map){const t={};return m.forEach((H1,r)=>t[typeof r==="object"?JSON.stringify(r):String(r)]=K(H1)),t}if(Array.isArray(m))return m.map((t)=>K(t));const e={};return Object.entries(m).forEach(([t,H1])=>e[t]=K(H1)),e}if(typeof S.toJSON==="function"&&!H.has(S))return S.toJSON();return S};return K(w)};if(Y==="reset")return function(){w=null};const D=M[Y];if(G instanceof Map&&typeof D==="function")return function(...K){const S=Y.toString();if(S==="set"&&K.length>=2)K[1]=X(K[1]);const m=D.apply(M,K);return["set","delete","clear"].includes(S)&&W.queueUpdate(J),m};if(Array.isArray(G)&&typeof D==="function")return function(...K){const S=Y.toString();if(["push","unshift"].includes(S))K=K.map((e)=>X(e));else if(S==="splice"&&K.length>2)K=[K[0],K[1],...K.slice(2).map((e)=>X(e))];const m=D.apply(M,K);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(S)&&W.queueUpdate(J),m};return D},set(M,Y,D){if(M[Y]===D)return!0;if(D instanceof Map&&M[Y]instanceof Map){const K=M[Y];return K.clear(),D.forEach((S,m)=>K.set(m,X(S))),W.queueUpdate(J),!0}return M[Y]=X(D),W.queueUpdate(J),!0}});return H.set(w,G),w},X=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Z)}}class Z0{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Z)=>{try{const W=Z.node;if(!W){this.unwatch(Z);return}if(J.type==="attach"&&document.contains(W[0]))this.unwatch(Z),Z.emit("component:attached"),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();else if(J.type==="detach"&&!document.contains(W[0]))this.unwatch(Z),Z.emit("component:detached"),typeof Z.onDetach=="function"&&Z.onDetach.bind(Z)()}catch(W){console.log("DWS error --",W)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Z="attach"){const W=J.node;if(!W)return;if(Z==="attach"&&document.contains(W[0])){J.emit("component:attached"),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Z==="detach"&&!document.contains(W[0])){J.emit("component:detached"),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const H=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Z}ment-timeout`)},this.TIMEOUT);this.observedComponents.set(J,{timeout:H,type:Z}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Z==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const Z=this.observedComponents.get(J);if(Z)clearTimeout(Z.timeout),this.observedComponents.delete(J);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((J)=>clearTimeout(J.timeout)),this.observedComponents.clear()}}var Q0=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(W,H)=>{return Z[H]!==void 0?Z[H].toString():`{${H}}`})},X5=(J,Z,W,H,q)=>{switch(J){case"plural":{if(typeof W==="string"){console.warn("Plural format value cannot be a string");return}if(H.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let w=W["*"];if(typeof w==="object")w=w[q||"*"];return Q0(w,H)}if(typeof H.count==="string")H.count=Number(H.count);let X="*";if(H.count.toString()in W)X=H.count.toString();let G=W[X]||W["*"];if(typeof G==="object")G=G[q||"*"];return Q0(G,H)}case"condition":{if(typeof W==="string"){console.warn("Condition format value cannot be a string");return}let X;for(let G in W)try{if(new Function("params",`with( params ){ return ${G}; }`)(H||{})){X=W[G];break}}catch(w){console.warn(`Invalid <${Z}(${G})> condition expression`)}if(X===void 0)return;if(typeof X==="object")X=X[q||"*"];return Q0(X,H)}case"variable":default:{const X=typeof W==="object"?W[q||"*"]:W;if(typeof X==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return Q0(X,H)}}};class W0{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,Z){this.DICTIONARIES[J]=Z}translate(J,Z){if(Z&&this.currentLang===Z)return{text:J,lang:this.currentLang};Z=Z||this.currentLang;const[W,H]=Z.split("-");if(this.DICTIONARIES[W]&&J in this.DICTIONARIES[W]){if(typeof this.DICTIONARIES[W][J]==="object"){const q=this.DICTIONARIES[W][J];J=q[H||"*"]||q["*"]}else if(typeof this.DICTIONARIES[W][J]==="string")J=this.DICTIONARIES[W][J]}return{text:J,lang:Z}}format(J,Z,W){W=W||this.currentLang;const[H,q]=W.split("-");if(!this.DICTIONARIES[H]){console.warn(`Undefined <${W}> format dictionary`);return}if(!this.DICTIONARIES[H][J]){console.warn(`Undefined <${W}[${J}]> format reference`);return}const X=this.DICTIONARIES[H][J];if(typeof X==="string"){console.warn(`Invalid <${W}[${J}]> format reference. Expected object`);return}if(typeof X!=="object"||X===null||Array.isArray(X)){console.warn(`Invalid <${W}[${J}]> format value`);return}return X5(X.type,J,X.value,Z,q)}}var T5=t1(c1(),1);var X0="comm",H0="rule",q0="decl";var z5="@import";var G5="@namespace",B5="@keyframes";var Y5="@layer";function z0(J){return J.trim()}function _1(J,Z,W){return J.replace(Z,W)}function U5(J,Z,W){return J.indexOf(Z,W)}function R1(J,Z){return J.charCodeAt(Z)|0}function P1(J,Z,W){return J.slice(Z,W)}function Y1(J){return J.length}function G0(J){return J.length}function y1(J,Z){return Z.push(J),J}var x0=Math.abs,p1=String.fromCharCode;function Y0(J,Z,W,H,q,X,G,w){return{value:J,root:Z,parent:W,type:H,props:q,children:X,line:B0,column:v1,length:G,return:"",siblings:w}}function M5(){return X1}function K5(){if(X1=I1>0?R1(m1,--I1):0,v1--,X1===10)v1=1,B0--;return X1}function O1(){if(X1=I1<w5?R1(m1,I1++):0,v1++,X1===10)v1=1,B0++;return X1}function T1(){return R1(m1,I1)}function s1(){return I1}function U0(J,Z){return P1(m1,J,Z)}function u1(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function I5(J){return B0=v1=1,w5=Y1(m1=J),I1=0,[]}function O5(J){return m1="",J}function w0(J){return z0(U0(I1-1,k0(J===91?J+2:J===40?J+1:J)))}function D5(J){while(X1=T1())if(X1<33)O1();else break;return u1(J)>2||u1(X1)>3?"":" "}function j5(J,Z){while(--Z&&O1())if(X1<48||X1>102||X1>57&&X1<65||X1>70&&X1<97)break;return U0(J,s1()+(Z<6&&T1()==32&&O1()==32))}function k0(J){while(O1())switch(X1){case J:return I1;case 34:case 39:if(J!==34&&J!==39)k0(X1);break;case 40:if(J===41)k0(J);break;case 92:O1();break}return I1}function F5(J,Z){while(O1())if(J+X1===57)break;else if(J+X1===84&&T1()===47)break;return"/*"+U0(Z,I1-1)+"*"+p1(J===47?J:O1())}function L5(J){while(!u1(T1()))O1();return U0(J,I1)}var B0=1,v1=1,w5=0,I1=0,X1=0,m1="";function C5(J){return O5(M0("",null,null,null,[""],J=I5(J),0,[0],J))}function M0(J,Z,W,H,q,X,G,w,M){var Y=0,D=0,K=G,S=0,m=0,e=0,t=1,H1=1,r=1,d=0,v="",c=q,p=X,J1=H,u=v;while(H1)switch(e=d,d=O1()){case 40:if(e!=108&&R1(u,K-1)==58){if(U5(u+=_1(w0(d),"&","&\f"),"&\f",x0(Y?w[Y-1]:0))!=-1)r=-1;break}case 34:case 39:case 91:u+=w0(d);break;case 9:case 10:case 13:case 32:u+=D5(e);break;case 92:u+=j5(s1()-1,7);continue;case 47:switch(T1()){case 42:case 47:if(y1(F8(F5(O1(),s1()),Z,W,M),M),(u1(e||1)==5||u1(T1()||1)==5)&&Y1(u)&&P1(u,-1,void 0)!==" ")u+=" ";break;default:u+="/"}break;case 123*t:w[Y++]=Y1(u)*r;case 125*t:case 59:case 0:switch(d){case 0:case 125:H1=0;case 59+D:if(r==-1)u=_1(u,/\f/g,"");if(m>0&&(Y1(u)-K||t===0&&e===47))y1(m>32?N5(u+";",H,W,K-1,M):N5(_1(u," ","")+";",H,W,K-2,M),M);break;case 59:u+=";";default:if(y1(J1=V5(u,Z,W,Y,D,q,w,v,c=[],p=[],K,X),X),d===123)if(D===0)M0(u,Z,J1,J1,c,X,K,w,p);else{switch(S){case 99:if(R1(u,3)===110)break;case 108:if(R1(u,2)===97)break;default:D=0;case 100:case 109:case 115:}if(D)M0(J,J1,J1,H&&y1(V5(J,J1,J1,0,0,q,w,v,q,c=[],K,p),p),q,p,K,w,H?c:p);else M0(u,J1,J1,J1,[""],p,0,w,p)}}Y=D=m=0,t=r=1,v=u="",K=G;break;case 58:K=1+Y1(u),m=e;default:if(t<1){if(d==123)--t;else if(d==125&&t++==0&&K5()==125)continue}switch(u+=p1(d),d*t){case 38:r=D>0?1:(u+="\f",-1);break;case 44:w[Y++]=(Y1(u)-1)*r,r=1;break;case 64:if(T1()===45)u+=w0(O1());S=T1(),D=K=Y1(v=u+=L5(s1())),d++;break;case 45:if(e===45&&Y1(u)==2)t=0}}return X}function V5(J,Z,W,H,q,X,G,w,M,Y,D,K){var S=q-1,m=q===0?X:[""],e=G0(m);for(var t=0,H1=0,r=0;t<H;++t)for(var d=0,v=P1(J,S+1,S=x0(H1=G[t])),c=J;d<e;++d)if(c=z0(H1>0?m[d]+" "+v:_1(v,/&\f/g,m[d])))M[r++]=c;return Y0(J,Z,W,q===0?H0:w,M,Y,D,K)}function F8(J,Z,W,H){return Y0(J,Z,W,X0,p1(M5()),P1(J,2,-2),0,H)}function N5(J,Z,W,H,q){return Y0(J,Z,W,q0,P1(J,0,H),P1(J,H+1,-1),H,q)}function K0(J,Z){var W="";for(var H=0;H<J.length;H++)W+=Z(J[H],H,J,Z)||"";return W}function R5(J,Z,W,H){switch(J.type){case Y5:if(J.children.length)break;case z5:case G5:case q0:return J.return=J.return||J.value;case X0:return"";case B5:return J.return=J.value+"{"+K0(J.children,H)+"}";case H0:if(!Y1(J.value=J.props.join(",")))return""}return Y1(W=K0(J.children,H))?J.return=J.value+"{"+W+"}":""}function P5(J){var Z=G0(J);return function(W,H,q,X){var G="";for(var w=0;w<Z;w++)G+=J[w](W,H,q,X)||"";return G}}class d1{nsp;settings;$head;constructor(J,Z){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=T5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return K0(C5(J),P5([R5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const W=new MutationObserver(()=>{const H=document.querySelector(J);if(H&&getComputedStyle(H).cssText)W.disconnect(),Z()});W.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(J){if(!J)throw new Error("Invalid injection arguments");const Z=`rel="${this.settings.meta?"@":""}${this.nsp}"`;J=this.settings.meta?J:`[rel="${this.nsp}"] { ${J} }`;try{const W=this.compile(J);if(!W)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const H=document.createElement("style");H.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),H.textContent=W;let q=0;const X=this.$head.find(`style[${Z}]`);if(X.length)q=parseInt(X.attr("dindex"))+1,X.remove();return H.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(H):document.head.appendChild(H),H}catch(W){throw new Error(`Style injection failed: ${W.message}`)}}async load(J){if(this.settings=J,typeof this.settings!=="object")throw new Error("Undefined styles settings");if(this.settings.sheet){const Z=await this.inject(this.settings.sheet);await this.waitForStyles(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`)}}get(){}async clear(){const J=this.$head.find(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`);if(!J.length)return;const Z=parseInt(J.attr("dindex"));Z===0?J.remove():J.attr("dindex",String(Z-1))}async custom(){return{}}async style(){return{}}}class I0{pending=new Map;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){const Z=J.priority??2;if(!this.pending.has(Z))this.pending.set(Z,new Set);if(this.pending.get(Z)?.add(J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}apply({dep:J,deppath:Z},W="batch-updator"){try{const H=this.component.FGUD.get(J)?.get(Z);if(!H){console.warn(`[batch update]: <${Z}> dependency not found`);return}if(H.garbage){this.component.FGUD.get(J)?.delete(Z),!this.component.FGUD.get(J)?.size&&this.component.FGUD.delete(J);return}const q=this.component.FGUDMemory.get(H.nodepath);if(!q)return;const X=H.update(q.memo||{},W);if(X){if(typeof X.memo==="object")q.memo=X.memo;typeof X.cleanup==="function"&&X.cleanup()}}catch(H){console.error("Failed to update dependency --",H)}}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=new Map;this.pending.forEach((H,q)=>J.set(q,new Set(H))),this.pending.clear(),this.isPending=!1;const Z=(H)=>{const q=Array.from(H);this.component.metrics.trackBatch(q.length),this.metrics.batchCount++,this.metrics.lastBatchSize=q.length,this.metrics.updatesProcessed+=q.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),q.forEach((X)=>this.apply(X))},W=Array.from(J.keys()).sort((H,q)=>H-q);for(let H of W){const q=J.get(H);q&&q.size&&Z(q)}if(this.pending.size>0&&!this.isPending)this.isPending=!0,this.scheduleProcessing()}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class O0{options={emit:!0};__events={};__once_events={};constructor(J){if(J)this.options=J}on(J,Z){if(!Array.isArray(this.__events[J]))this.__events[J]=[];return this.__events[J].push(Z),this}once(J,Z){if(!Array.isArray(this.__once_events[J]))this.__once_events[J]=[];return this.__once_events[J].push(Z),this}off(J){return delete this.__events[J],delete this.__once_events[J],this}emit(J,...Z){if(!this.options.emit)return;const W=(q)=>{if(typeof q.toJSON==="function")return q.toJSON();if(Array.isArray(q))return q.map(W);if(typeof q==="object")for(let X in q)q[X]=W(q[X]);return q},H=Z.map(W);this.__events[J]?.forEach((q)=>q(...H)),this.__once_events[J]?.forEach((q)=>q(...H)),delete this.__once_events[J]}}var h0=t1(c1(),1);function G1(J,Z){if(J===Z)return!1;if(typeof J!=="object"||typeof Z!=="object")return!1;if(J===null||Z===null)return!0;if(J instanceof Set){if(!(Z instanceof Set))return!0;if(J.size!==Z.size)return!0;if(E5(J)&&E5(Z)){for(let G of J)if(!Z.has(G))return!0;return!1}const X=new WeakMap;for(let G of J){let w=!1;if(typeof G!=="object"){if(Z.has(G))w=!0}else for(let M of Z){if(typeof M!=="object")continue;if(!X.has(G))X.set(G,new WeakMap);const Y=X.get(G);if(Y.has(M)){if(w=Y.get(M),w)break;continue}const D=!G1(G,M);if(Y.set(M,D),D){w=!0;break}}if(!w)return!0}return!1}if(J instanceof Map){if(!(Z instanceof Map))return!0;if(J.size!==Z.size)return!0;if(A5(J)&&A5(Z)){for(let[G,w]of J)if(Z.get(G)!==w)return!0;return!1}const X=new WeakMap;for(let[G,w]of J){if(typeof G!=="object"){if(!Z.has(G))return!0;const D=Z.get(G);if(typeof w!=="object"){if(w!==D)return!0;continue}if(typeof D!=="object"||G1(w,D))return!0;continue}let M=!1,Y=!1;for(let[D,K]of Z){if(typeof D!=="object")continue;if(!X.has(G))X.set(G,new WeakMap);const S=X.get(G);if(S.has(D)){const[m,e]=S.get(D);if(m){M=!0,Y=e;break}continue}if(!G1(G,D)){if(M=!0,Y=typeof w==="object"&&typeof K==="object"?!G1(w,K):w===K,S.set(D,[!0,Y]),Y)break}else S.set(D,[!1,!1])}if(!M||!Y)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Z))return!0;if(J.length!==Z.length)return!0;for(let X=0;X<J.length;X++){const G=J[X],w=Z[X];if(G!==w&&(typeof G!=="object"||G1(G,w)))return!0}return!1}const W=Object.keys(J),H=Object.keys(Z);if(W.length!==H.length)return!0;W.sort(),H.sort();const q=W.length;for(let X=0;X<q;X++)if(W[X]!==H[X])return!0;for(let X=0;X<q;X++){const G=W[X],w=J[G],M=Z[G];if(w===M)continue;if(w instanceof Date){if(!(M instanceof Date)||String(w)!==String(M))return!0;continue}if(w instanceof RegExp){if(!(M instanceof RegExp)||w.source!==M.source||w.flags!==M.flags)return!0;continue}if(w instanceof Map){if(!(M instanceof Map)||G1(w,M))return!0;continue}if(w instanceof Set){if(!(M instanceof Set)||G1(w,M))return!0;continue}if(w instanceof Function){if(!(M instanceof Function))return!0;continue}if(typeof w==="object"){if(typeof M!=="object")return!0;if(w===J){if(M!==Z)return!0}else if(G1(w,M))return!0}else return!0}return!1}function U1(J,Z){if(J===Z)return!0;if(J==null||Z==null)return J===Z;const W=typeof J;if(W!==typeof Z)return!1;if(W!=="object"){if(W==="number"&&isNaN(J)&&isNaN(Z))return!0;return!1}if(J instanceof Date)return Z instanceof Date&&J.getTime()===Z.getTime();if(J instanceof RegExp)return Z instanceof RegExp&&J.source===Z.source&&J.flags===Z.flags;if(J instanceof Error)return Z instanceof Error&&J.name===Z.name&&J.message===Z.message&&(J.stack===Z.stack||!J.stack&&!Z.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(Z))return!1;if(J.byteLength!==Z.byteLength)return!1;const w=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),M=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let Y=0;Y<w.length;Y++)if(w[Y]!==M[Y])return!1;return!0}if(J instanceof Promise||J instanceof WeakMap||J instanceof WeakSet)return J===Z;if(typeof J==="function"){if(typeof Z!=="function")return!1;return J.toString()===Z.toString()&&J.name===Z.name}if(J.constructor!==Z.constructor)return!1;if(J instanceof Map||J instanceof Set||Array.isArray(J)||Object.getPrototypeOf(J)===Object.prototype)return!G1(J,Z);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Z))return!1;const X=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(Z);if(X.length!==G.length)return!1;for(let w of X){if(!Object.prototype.hasOwnProperty.call(Z,w))return!1;if(!U1(J[w],Z[w]))return!1}if(q!==null&&q!==Object.prototype){const w=Object.getOwnPropertyNames(q),M=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(w.length!==M.length)return!1;for(let Y of w){if(Y==="constructor")continue;if(!U1(q[Y],Object.getPrototypeOf(Z)[Y]))return!1}}return!0}function E5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function A5(J){for(let[Z,W]of J)if(typeof Z==="object"&&Z!==null||typeof W==="object"&&W!==null)return!1;return!0}function W1(J,Z=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Z.has(J))return Z.get(J);if(J instanceof Date)return new Date(J.getTime());if(J instanceof RegExp)return new RegExp(J.source,J.flags);if(J instanceof Map){const q=new Map;return Z.set(J,q),J.forEach((X,G)=>q.set(W1(G,Z),W1(X,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((X)=>q.add(W1(X,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let X=0;X<J.length;X++)q[X]=W1(J[X],Z);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const W=Object.create(Object.getPrototypeOf(J));Z.set(J,W);const H=Object.getOwnPropertySymbols(J);for(let q of H)W[q]=W1(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))W[q]=W1(J[q],Z);return W}function f5(J,Z){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!Z||typeof Z!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Z).length)return{...J};function W(q,X,G){const w=X.split(/\.|\[|\]/).filter(Boolean);let M=q;for(let Y=0;Y<w.length;Y++){const D=w[Y],K=!isNaN(Number(D)),S=Y===w.length-1,m=!isNaN(Number(w[Y+1]));if(S){M[D]=G;continue}if(!(D in M))M[D]=m?[]:{};else if(m&&!Array.isArray(M[D]))M[D]=[];else if(!m&&Array.isArray(M[D]))M[D]={};M=M[D]}}const H=W1(J);try{for(let[q,X]of Object.entries(Z)){if(typeof q!=="string")throw new TypeError(`Invalid path: ${q}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(q))throw new Error(`Invalid path format: ${q}`);W(H,q,X)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return H}function j0(J){return JSON.parse(JSON.stringify(J))}var S1="i18n",E1="syn:",L1="fn:",g1="on-",K1=/^\.\.\./,D0=/^\[(.*?)\]$/,f0=/{\s*([^{}]+)\s*}/g,$5=["@html","@text","@format"],S5=["display","visibility","position","width","height"],b5=":n",_0=":pr",g5="m",x5="c",k5="x",l1="*",h5=100;h0.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&h0.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class F0{debug;initialStats={renderCount:0,elementCount:0,renderTime:0,avgRenderTime:0,maxRenderTime:0,componentCount:0,componentUpdateCount:0,partialCount:0,partialUpdateCount:0,memoryUsage:void 0,domOperations:0,domInsertsCount:0,domUpdatesCount:0,domRemovalsCount:0,i18nTrackCount:0,i18nUpdateCount:0,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(J=!1){if(this.debug=J,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const J=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");J.push({timestamp:Date.now(),metrics:{...this.stats}}),J.length>100&&J.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(J))}catch(J){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const J=performance.now()-this.renderStartTime;this.stats.renderTime=J,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,J),this.renderTimes.push(J),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((Z,W)=>Z+W,0)/this.renderTimes.length,this.renderStartTime=0,this.measurementCount++}inc(J){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]++}dec(J){if(!this.debug)return;if(typeof this.stats[J]==="number"&&this.stats[J]>0)this.stats[J]--}record(J,Z){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=Z}add(J,Z){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=Z}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=W1(this.initialStats)}log(){if(!this.debug)return;if(this.loggingInterval>1&&this.measurementCount%this.loggingInterval!==0)return;const J={"Render Count":this.stats.renderCount,"Element Count":this.stats.elementCount,"Avg Render Time (ms)":this.stats.avgRenderTime.toFixed(2),"Max Render Time (ms)":this.stats.maxRenderTime.toFixed(2)},Z={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},W={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},H={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},q={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},X={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},G={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(J),console.table(Z),console.table(W),console.table(H),console.table(q),console.table(X),console.table(G),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return W1(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var Q1=t1(c1(),1);var L8=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let W=J,H;while((H=Z.exec(J))!==null){const q=H[1],X=H.index+H[0].length;let G=1,w=X;while(w<J.length&&G>0){if(J[w]==="(")G++;if(J[w]===")")G--;w++}if(G===0){const M=J.slice(X,w-1).trim(),Y=J.slice(0,H.index),D=`${g1}${q}="${M}"`,K=J.slice(w);W=Y+D+K,J=W,Z.lastIndex=Y.length+D.length}}return W},V8=function(J){const Z=[];let H=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,X,G)=>{return Z.push(G),`<${X}##TAG_ATTRS_${Z.length-1}##>`});for(let q=0;q<Z.length;q++){const X=`##TAG_ATTRS_${q}##`,G=Z[q],w=N8(G);H=H.replace(X,w)}return H},N8=function(J){let Z="",W=0,H=!1,q="",X=0,G=0,w=0;while(W<J.length){const M=J[W];if((M==='"'||M==="'")&&(W===0||J[W-1]!=="\\")){if(!H)H=!0,q=M;else if(M===q)H=!1}if(!H){if(M==="(")G++;else if(M===")")G--;else if(M==="{")w++;else if(M==="}")w--}if(!H&&G===0&&w===0&&(M===" "||W===J.length-1)){let Y=W;if(W===J.length-1)Y=W+1;const D=J.substring(X,Y).trim();if(D){const K=C8(D);Z+=" "+K}X=W+1}W++}return Z},C8=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===S1||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let W=J.substring(0,Z).trim(),H=J.substring(Z+1).trim();if(W.startsWith("@"))return W=!$5.includes(W)?W.slice(1):W,`:${W}=${H}`;if(W.startsWith(L1)||W.startsWith(g1))return J;if(H.startsWith('"')&&H.endsWith('"')||H.startsWith("'")&&H.endsWith("'")){const q=H.substring(1,H.length-1);if(R8(q))return`:${W}="${q}"`;return J}else return`:${W}="${H}"`};function R8(J){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(J))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(J))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(J))return!0;if(J.includes("{")&&J.includes("}"))return!0;return!1}function y0(J){let Z=(J||"").trim().replace(/>\s*</g,"><").replace(/\s{2,}/g," ").replace(/[\r\n\t]/g,"").replace(/<([a-zA-Z0-9_-]+)([^>]*?)\s*\/>/g,"<$1$2></$1>").replace(/<\{([^}]+)\}\s*(.*?)(\/)>/g,(W,H,q)=>{return q.endsWith("<")?`<lips dtag="${H}" ${q}/lips>`:`<lips dtag="${H}" ${q}></lips>`}).replace(/(<>)([\s\S]*?)(<\/>)/g,'<lips fragment="true">$2</lips>').replace(/<if\(\s*(.*?)\s*\)>/g,'<if @by="$1">').replace(/<else-if\(\s*(.*?)\s*\)>/g,'<else-if @by="$1">').replace(/<switch\(\s*(.*?)\s*\)>/g,'<switch @by="$1">').replace(/<async await\(\s*(.*?)\s*\)>/g,`<async ${L1}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Z=L8(Z),Z=V8(Z),Z}var P8=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},y5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function x1(J,Z={maxSize:100}){const W=new Set,H=[{value:J,timestamp:Date.now()}];let q=0;const X=()=>{const Y=L0[L0.length-1];return Y&&P8(Y,W),H[q].value},G=()=>{const Y=[...W];if(_5)for(let D of Y)_5.add(D);else for(let D of Y)D.execute()};return[X,(Y,D)=>{if(Object.is(H[q].value,Y))return;if(q<H.length-1)H.splice(q+1);if(H.push({value:Y,timestamp:Date.now(),metadata:D}),H.length>Z.maxSize)H.shift(),q=Math.max(0,q-1);else q++;G()},{undo(){if(q>0)q--,G()},redo(){if(q<H.length-1)q++,G()},jumpTo(Y){if(Y>=0&&Y<H.length&&Y!==q)q=Y,G()},getHistory(){return[...H]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<H.length-1},clear(){const Y=H[0];H.length=0,H.push(Y),q=0,G()}}]}function o1(J){let Z=!1;const W=()=>{if(Z)throw new Error("Circular dependency detected");if(H.isDisposed)return;Z=!0,y5(H),L0.push(H);try{J()}finally{Z=!1,L0.pop()}},H={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{H.isDisposed=!0,y5(H)}}}var L0=[],_5=null;class k1 extends O0{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=new Map;FGUD=new Map;FGUDMemory=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;metrics;stylesheet;__inpath__="";__inpathCounter__=0;__renderDepth__=0;__boundaries__;constructor(J,Z,{input:W,state:H,context:q,_static:X,handler:G,stylesheet:w,macros:M,declaration:Y},D){super();if(this.lips=D.lips,D?.debug)this.debug=D.debug||this.lips.debug;if(D?.prepath)this.prepath=D.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=this.__inpath__=`${this.prepath}:${this.__name__}`,this.__template__=y0(Z),this.__boundaries__=D.boundaries,this.declaration=Y||{name:J},this.input=W||{},this.static=X||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,H||{}),M&&this.setMacros(M),G&&this.setHandler(G),w&&this.setStylesheet(w),this.metrics=new F0(this.debug),this.metrics.inc("componentCount"),this.UQS=new I0(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create"),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(),this.emit("component:input");this.__previous={state:W1(this.state),input:W1(this.input),context:W1(this.context)};const[K,S]=x1(this.input),[m,e]=x1(this.state),[t,H1]=x1(this.context);this.__setInput=S,this.__setState=e,this.__getState=m,this.lips.IUC.register(this.__path__,()=>{G1(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(r)=>{if(!G1(this.context,r))return;H1(r),this.context=r,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context")}),this.lips.useTranslator("*",(r)=>{if(r===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=r}),this.ICE=o1(()=>{const r=m(),d=this.input=K(),v=this.context=t();if(!this.isRendered){if(this.metrics.reset(),!this.__template__.length||Y?.syntax&&typeof this.onSelfRender=="function"){const c=this.onSelfRender.bind(this)(this.input);if(!this.__boundaries__?.start||!this.__boundaries__?.end)throw new Error(`Undefined <${this.__name__} syntax component boundaries`);this.$=c||Q1.default()}else{const{$log:c}=this.render("",void 0,void 0,this.FGUD);this.$=c}!Y?.syntax&&this.$?.each((c,p)=>{typeof p.setAttribute=="function"&&p.setAttribute("rel",this.__name__)}),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount"),this.lips.watcher.watch(this)}else this.__updateDepNodes__(),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update"),this.__previous={input:W1(d),state:W1(r),context:W1(v)};typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render")})}setContext(J,Z){this.lips.setContext(J,Z)}setInput(J,Z){if(!G1(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(this.declaration.syntax?Z:void 0)}subInput(J,Z){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(f5(this.input,J),this.declaration.syntax?Z:void 0),this}setMacros(J){const Z=y0(J),W=Q1.default(Z);if(!W.length)return;const H=this;W.each(function(){const q=Q1.default(this),{argv:X,attrs:G}=H.__getAttributes__(q);if(!Object.keys(G))throw new Error("Invalid macro component definition");if(!G.literals.name)throw new Error("Undefined macro `name` attribute.");if(H.__macros.get(G.literals.name))console.warn(`Duplicate macro <${G.literals.name}> will be override`);if(!q.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");H.__macros.set(G.literals.name,{argv:X,$node:q})})}setHandler(J){Object.entries(J).map(([Z,W])=>this[Z]=W?.bind(this))}setStylesheet(J){const Z={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new d1(this.__name__,Z)}get node(){if(!this.isRendered)throw new Error("node() is expected to be call after component get rendered");return this.$}get boundaries(){return this.__boundaries__}render(J,Z,W={},H,q){if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:H||new Map};const X=this,G=H||new Map,w=[];this.metrics.startRender();let M=Q1.default();function Y(){return W1(W)}function D(U,j=!1){const O=K(U,j);return X.__inpathCounter__++,X.__inpath__?`${X.__inpath__}/${O}`:`${J?J+"/":""}${O}`}function K(U,j=!1){let O="";switch(U){case"component":O=j?k5:x5;break;case"macro":O=g5;break}return O+X.__inpathCounter__}function S(U){return U!==null&&typeof U==="object"&&typeof U.mesh==="function"&&typeof U.update==="function"}function m(U){return U!==null&&typeof U==="object"&&typeof U.default&&typeof U.default==="string"}function e(U){if(!U.attr(":dtag")||U.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const j=U.attr(":dtag"),O=X.__evaluate__(j,W);if(S(O)||O===null)return d(U,j,O);else if(m(O))return v(U,{template:O});else return v(U,{name:O})}function t(U){const j=U.attr(":args"),O=D("log");if(!j)return;const C=Y();if(X.__evaluate__(`console.log(${j})`,C),X.__isReactive__(j,C))X.__extractExpressionDeps__(j,C).forEach((P)=>X.__trackDep__(G,P,C,{nodetype:"log",nodepath:O,target:"argument",$fragment:null,update:(A)=>X.__evaluate__(`console.log(${j})`,A),syntax:!0}))}function H1(U){const j=D("var"),{attrs:O}=X.__getAttributes__(U);if(!O)return;Object.entries(O.literals).forEach(([C,L])=>{if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);W[C]={value:L,type:"let"}}),Object.entries(O.expressions).forEach(([C,L])=>{if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);if(W[C]={value:X.__evaluate__(L,W),type:"let"},X.__isReactive__(L,W)){const P=X.__extractExpressionDeps__(L,W),A=(y,l)=>{if(y[C]&&y[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);if(O.map.beforeSpreadAttrs.includes(C))return;const g=X.__evaluate__(L,y);if(U1(y[C].value,g))return;return y[C]={value:g,type:"let"},X.__updateVarDepNodes__(C,j,y),j0({memo:y})};P.forEach((y)=>X.__trackDep__(G,y,Y(),{nodetype:"let",nodepath:j,deppath:`${j}.${C}`,target:"attr",$fragment:null,update:A,syntax:!0}))}}),X.metrics.inc("elementCount")}function r(U){const{attrs:j}=X.__getAttributes__(U);if(!j)return;Object.entries(j.literals).forEach(([O,C])=>{if(W[O]&&W[O].type==="const")throw new Error(`<const ${O}=[value]/> variable already defined`);if(!C)return;W[O]={value:C,type:"const"}}),Object.entries(j.expressions).forEach(([O,C])=>{if(W[O]&&W[O].type==="const")throw new Error(`<const ${O}=[value]/> variable already defined`);if(!C)return;W[O]={value:X.__evaluate__(C,W),type:"const"}}),X.metrics.inc("elementCount")}function d(U,j,O){const{attrs:C}=X.__getAttributes__(U),L=D("element"),P=X.__getBoundaries__(L),A={},y={};let l=Y(),g=Q1.default(P.start),x={},N=O;if(N){C.literals&&Object.entries(C.literals).forEach(([R,k])=>{A[R]=k,x[R]={type:"arg",value:k}}),C.expressions&&Object.entries(C.expressions).forEach(([R,k])=>{if(!N)return;if(K1.test(R))X.__evaluateSpreadAttr__(R,{memo:l,get keystore(){return y[R]},set keystore(F){if(!y[R])y[R]=[];y[R]=F},each:(F,T)=>{if(A[F]=T,!N?.argv.includes(F))return;x[F]={type:"arg",value:T}}});else{const F=k?X.__evaluate__(k,l):!0;if(A[R]=F,!N.argv.includes(R))return;x[R]={type:"arg",value:F}}}),l.__arguments__=A;const _=N.mesh(x);if(_&&_.length)g=g.add(_);C.expressions&&Object.entries(C.expressions).forEach(([R,k])=>{if(!N)return;if(K1.test(R)&&X.__isReactive__(R,l)){const F=X.__extractExpressionDeps__(R,l),T=(h,$)=>{if(!N)return;const b={};let o=[];if(X.__evaluateSpreadAttr__(R,{memo:h,get keystore(){return y[R]},set keystore(i){if(!y[R])y[R]=[];y[R]=i},each:(i,n)=>{if(C.map.afterSpreadAttrs.includes(i))return;if(!N?.argv.includes(i))return;if(U1(n,h[i]?.value))return;x[i]=b[i]={value:n,type:"arg"},A[i]=n,o.push(i)},nullify:(i)=>{i.forEach((n)=>{b[n]={value:void 0,type:"arg"},delete A[n]}),o=i}}),o.length)N.argv.length&&X.__updateArgumentsDepNodes__(L,A),N.update(o,b,h,P)};F.forEach((h)=>X.__trackDep__(G,h,l,{nodetype:"dynamic",nodepath:L,deppath:`${L}.${R}`,target:"spread-attr",$fragment:null,boundaries:P,update:T}))}else if(N.argv.includes(R)&&X.__isReactive__(k,l)){const F=X.__extractExpressionDeps__(k,l),T=(h,$)=>{if(!N)return;if(C.map.beforeSpreadAttrs.includes(R))return;const b=k?X.__evaluate__(k,h):!0,o={type:"arg",value:b};if(x[R]=o,N.argv.length)A[R]=b,X.__updateArgumentsDepNodes__(L,A);N.update([R],{[R]:o},h,P)};F.forEach((h)=>X.__trackDep__(G,h,l,{nodetype:"dynamic",nodepath:L,deppath:`${L}.${R}`,target:"attr",$fragment:null,boundaries:P,update:T}))}})}if(X.__isReactive__(j,l)){const _=(k,F)=>{const T=X.__evaluate__(j,k);let h;if(m(T))h=v(U,{template:T}),X.__fillBoundaries__(h,P);else if(S(T)){if(Object.entries(x).forEach(([$,b])=>{if(typeof b==="function")return;A[$]=b.value}),N?.cleanup(P),N=T,N)N.argv.length&&X.__updateArgumentsDepNodes__(L,A),h=N.mesh(x),h?.length&&N.fill(h,P)}else if(N)N.cleanup(P),N=null};X.__extractExpressionDeps__(j,l).forEach((k)=>X.__trackDep__(G,k,{...l,...x},{nodetype:"dynamic",nodepath:L,deppath:`${L}.dtag`,target:"dtag",$fragment:null,boundaries:P,update:_}))}return g=g.add(P.end),g}function v(U,j){let O,C;if(j?.template)O=j.template,C=K("component",O.declaration?.syntax);else{if(C=j?.name||U.prop("tagName")?.toLowerCase(),!C)throw new Error("Invalid component");if(C===X.__name__)throw new Error("Render component within itself is forbidden");O=X.lips.import(C)}if(!O||!C)throw new Error(`<${C}> template not found`);const L=D("component",O.declaration?.syntax),P=`${L}#${C}`,A=X.__getBoundaries__(L),{argv:y,functions:l,attrs:g,events:x}=X.__getAttributes__(U),N={},_={};let R={},k=Q1.default(A.start),F=X.PCC.get(P),T=Y();g.literals&&Object.entries(g.literals).forEach(([$,b])=>{if($=="key")return;R[$]=b}),l&&Object.entries(l).forEach(([$,b])=>{R[$]=X.__evaluateFunction__(b,[],T),O.declaration?.syntax?N[E1+L1+$]=b:N[L1+$]=b}),g.expressions&&Object.entries(g.expressions).forEach(([$,b])=>{if($=="key")return;if(K1.test($))X.__evaluateSpreadAttr__($,{memo:T,get keystore(){return _[$]},set keystore(o){if(!_[$])_[$]=[];_[$]=o},each:(o,i)=>R[o]=i});else R[$]=b?X.__evaluate__(b,T):!0;O.declaration?.syntax?N[E1+$]=b:N[$]=b});const h=U.contents();if(h.length){if(R={...R,...X.__meshwire__({$node:U,fragmentPath:L,fragmentBoundaries:A,meshPath:null,scope:T,argv:y,xmlns:q,useAttributes:!0,declaration:O.declaration},N)},O.declaration){if(O.declaration.tags){let $;Object.entries(O.declaration?.tags).forEach(([b,{type:o,many:i,alts:n}])=>{switch(o){case"nexted":{let Z1=U.next(b);if(!Z1.length&&Array.isArray(n)&&$?.length&&$.is(n.join(",")))Z1=$.next(b);if(!Z1.length)return;if(i){R[b]=[];let a=0,B1=!1;while(!B1){if(R[b].push(X.__meshwire__({$node:Z1,meshPath:`${b}[${a}]`,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:y,xmlns:q,useAttributes:!0,declaration:O.declaration},N)),!Z1.next(b).length){B1=!0;break}Z1=$=Z1.next(b),a++}}else R[b]=X.__meshwire__({$node:Z1,meshPath:b,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:y,xmlns:q,useAttributes:!0,declaration:O.declaration},N)}break;case"child":{const Z1=U.children(b);if(i)R[b]=[],Z1.each(function(a){const B1=Q1.default(this),{argv:D1}=X.__getAttributes__(B1);R[b].push(X.__meshwire__({$node:B1,meshPath:`${b}[${a}]`,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:D1,xmlns:q,useAttributes:!0,declaration:O.declaration},N))});else if(U.children(b).first().length){const a=U.children(b).first(),{argv:B1}=X.__getAttributes__(a);R[b]=X.__meshwire__({$node:a,meshPath:b,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:B1,xmlns:q,useAttributes:!0,declaration:O.declaration},N)}}break}})}else if(O.declaration.contents)R.__contents__=h}}if(F)F.setInput(W1(R)),k=k.add(F.node);else{const{declaration:$,state:b,_static:o,handler:i,context:n,default:Z1,stylesheet:a}=O;F=new k1(C,Z1||"",{state:W1(b),input:W1(R),context:n,_static:W1(o),handler:i,stylesheet:a,declaration:$},{debug:X.debug,lips:X.lips,prepath:L,boundaries:A}),k=k.add(F.node),!O.declaration?.syntax&&X.PCC.set(P,F)}return k=k.add(A.end),Object.entries(x).forEach(([$,b])=>{X.__attachEvent__({nodepath:L,element:F,_event:$,instruction:b,scope:T,get __dependencies__(){return G}})}),N&&Object.entries(N).forEach(([$,b])=>{let o=!1,i=!1;if($.startsWith(E1))o=!0,$=$.replace(E1,"");if($.startsWith(L1))i=!0,$=$.replace(L1,"");if(K1.test($)){if(X.__isReactive__($,T)){const n=(a)=>{const B1={};X.__evaluateSpreadAttr__($,{memo:a,get keystore(){return _[$]},set keystore(D1){if(!_[$])_[$]=[];_[$]=D1},each:(D1,h1)=>{if(g.map.afterSpreadAttrs.includes(D1))return;B1[D1]=h1},nullify:(D1)=>D1.forEach((h1)=>B1[h1]=void 0)}),F?.subInput(B1,a)};X.__extractExpressionDeps__($,T).forEach((a)=>X.__trackDep__(G,a,T,{nodetype:"component",nodepath:L,deppath:`${L}.${$}`,target:"spread-attr",$fragment:null,boundaries:A,update:n,syntax:o}))}}else if(X.__isReactive__(b,T)){const n=(a)=>{if(g.map.beforeSpreadAttrs.includes($))return;const B1=i?X.__evaluateFunction__(b,[],a):b?X.__evaluate__(b,a):!0;F?.subInput({[$]:B1},a)};X.__extractExpressionDeps__(b,T).forEach((a)=>X.__trackDep__(G,a,T,{nodetype:"component",nodepath:L,deppath:`${L}.${$}`,target:"attr",$fragment:null,boundaries:A,update:n,syntax:o}))}}),X.metrics.inc("componentCount"),k}function c(U){const j=U.prop("tagName")?.toLowerCase();if(!j)throw new Error("Invalid macro rendering call");const O=X.__macros.get(j);if(!O)throw new Error("Macro component not found");const C=D("macro"),L=X.__getBoundaries__(C),{attrs:P}=X.__getAttributes__(U),A={},y=Y(),l={},g={};P.literals&&Object.entries(P.literals).forEach(([F,T])=>{l[F]=T,g[F]={value:T,type:"arg"}});const x={};P.expressions&&Object.entries(P.expressions).forEach(([F,T])=>{if(K1.test(F))X.__evaluateSpreadAttr__(F,{memo:y,get keystore(){return x[F]},set keystore(h){if(!x[F])x[F]=[];x[F]=h},each:(h,$)=>{if(l[h]=$,O.argv.includes(h))g[h]={value:$,type:"arg"}}}),A[F]=T;else{const h=T?X.__evaluate__(T,y):!0;if(l[F]=h,O.argv.includes(F))g[F]={value:h,type:"arg"},A[F]=T}O.argv.forEach((h)=>{if(g[h]!==void 0)return;g[h]={value:!1,type:"arg"}})}),g.__arguments__=l;let N=Q1.default(L.start);const _={$node:O.$node,meshPath:null,fragmentPath:C,fragmentBoundaries:L,argv:O.argv,scope:y,xmlns:q,useAttributes:!0},R=X.__meshwire__(_,A),k=R.renderer.mesh(g,y);return N=N.add(k),A&&Object.entries(A).forEach(([F,T])=>{let h=!1;if(new RegExp(`^${E1}`).test(F))h=!0,F=F.replace(E1,"");if(K1.test(F)){if(!X.__isReactive__(F,y))return;const $=X.__extractExpressionDeps__(F,y),b=(o)=>{const i={};let n=[];if(X.__evaluateSpreadAttr__(F,{memo:o,get keystore(){return x[F]},set keystore(Z1){if(!x[F])x[F]=[];x[F]=Z1},each:(Z1,a)=>{if(P.map.afterSpreadAttrs.includes(Z1))return;if(U1(a,o[Z1]?.value))return;i[Z1]={value:a,type:"arg"},l[Z1]=a,n.push(Z1)},nullify:(Z1)=>{Z1.forEach((a)=>{i[a]={value:void 0,type:"arg"},delete l[a]}),n=Z1}}),n.length)X.__updateArgumentsDepNodes__(C,l),R.renderer.update(n,i,o);return j0({memo:{...o,...i}})};$.forEach((o)=>X.__trackDep__(G,o,{...y,...g},{nodetype:"macro",nodepath:C,deppath:`${C}.${F}`,target:"spread-attr",$fragment:null,boundaries:L,update:b,syntax:h}))}else if(X.__isReactive__(T,y)){const $=X.__extractExpressionDeps__(T,y),b=(o)=>{if(P.map.beforeSpreadAttrs.includes(F))return;const i=T?X.__evaluate__(T,o):!0;return l[F]=i,X.__updateArgumentsDepNodes__(C,l),R.renderer.update([F],{[F]:{value:i,type:"arg"}},o),j0({memo:o})};$.forEach((o)=>X.__trackDep__(G,o,{...y,...g},{nodetype:"macro",nodepath:C,deppath:`${C}.${F}`,target:"attr",$fragment:null,boundaries:L,update:b,syntax:h}))}}),N=N.add(L.end),X.metrics.inc("elementCount"),N}function p(U){if(!U.length||!U.prop("tagName"))return U;const j=U.is("svg")||q,O=j?Q1.default(document.createElementNS("http://www.w3.org/2000/svg",U.prop("tagName").toLowerCase())):Q1.default(`<${U.prop("tagName").toLowerCase()}/>`),C=U.contents(),L=D("element"),P=Y();C.length&&O.append(X.__withPath__(L,()=>X.render(L+b5,C,P,G,j).$log));const{attrs:A,events:y}=X.__getAttributes__(U);A.literals&&Object.entries(A.literals).forEach(([g,x])=>{if(g===S1)return;const N=U.is(`[${S1}]`)&&["title","placeholder"].includes(g);O.attr(g,N?X.lips.i18n.translate(x).text:x);const _=(R)=>{O.attr(g,N?X.lips.i18n.translate(x).text:x),N&&X.__trackTranslationDep__(R,{nodetype:"element",nodepath:L,deppath:`${L}.${g}`,target:"attr",$fragment:O,update:_})};N&&X.__trackTranslationDep__(P,{nodetype:"element",nodepath:L,deppath:`${L}.${g}`,target:"attr",$fragment:O,update:_})});const l=(g,x=!1)=>{g&&Object.entries(g).forEach(([N,_])=>{switch(N){case"@html":{const R=(k)=>{O.html(X.__evaluate__(_,k))};if(R(P),x&&X.__isReactive__(_,P))X.__extractExpressionDeps__(_,P).forEach((F)=>X.__trackDep__(G,F,P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:O,update:R}))}break;case"@text":{const R=U.is(`[${S1}]`),k=(F)=>{O.text(X.__evaluate__(_,F,{translate:R})),R&&X.__trackTranslationDep__(F,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:O,update:k})};if(k(P),x&&X.__isReactive__(_,P))X.__extractExpressionDeps__(_,P).forEach((T)=>X.__trackDep__(G,T,P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:O,update:k}));R&&X.__trackTranslationDep__(P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:O,update:k})}break;case"@format":{const[R,k]=_.split(",").map((T)=>T.trim());if(!R)throw new Error("Invalid @format reference");if(!k)throw new Error("Invalid @format parameters");const F=(T)=>{const h=X.__evaluate__(`!${k.trim()}`,T);if(typeof h!=="object")throw new Error("Invalid @format parameters");const $=X.lips.i18n.format(R,h);$!==void 0&&O.text($),X.__trackTranslationDep__(T,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:O,update:F})};F(P),X.__extractExpressionDeps__(k,P).forEach((T)=>X.__trackDep__(G,T,P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:O,update:F}))}break;case"style":if(x&&X.__isReactive__(_,P)){const R=(F)=>{const T=X.__evaluate__(_,F);if(typeof T==="object"){let h="";Object.entries(T).forEach(([$,b])=>h+=`${$}:${b};`),h.length&&O.attr("style",h)}else O.attr("style",T)};R(P),X.__extractExpressionDeps__(_,P).forEach((F)=>X.__trackDep__(G,F,P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"attr",$fragment:O,update:R}))}else O.attr("style",_);break;default:{const R=U.is(`[${S1}]`)&&["title","placeholder"].includes(N),k=(F)=>{const T=_&&X.__isReactive__(_,P)?X.__evaluate__(_,F,{translate:R}):_!==void 0?_:!0;if(T===void 0||T===!1)O.removeAttr(N);else O.attr(N,T),R&&X.__trackTranslationDep__(F,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"attr",$fragment:O,update:k})};if(k(P),x&&X.__isReactive__(_,P))X.__extractExpressionDeps__(_,P).forEach((T)=>X.__trackDep__(G,T,P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"attr",$fragment:O,update:k}));R&&X.__trackTranslationDep__(P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"attr",$fragment:O,update:k})}}})};return A.expressions&&Object.keys(A.expressions).forEach((g)=>{if(!K1.test(g))return;let x=[];const N=(_,R,k=!1)=>{const F={};X.__evaluateSpreadAttr__(g,{memo:_,get keystore(){return x},set keystore(T){x=T},each:(T,h)=>{if(!k&&A.map.afterSpreadAttrs.includes(T))return;F[T]=h},nullify:(T)=>T.forEach((h)=>O.removeAttr(h))}),Object.keys(F).length&&l(F)};if(delete A.expressions[g],N(P,"",!0),g&&X.__isReactive__(g,P))X.__extractExpressionDeps__(g,P).forEach((R)=>X.__trackDep__(G,R,P,{nodetype:"element",nodepath:L,deppath:`${L}.${g}`,target:"spread-attr",$fragment:O,update:N}))}),l(A.expressions,!0),y&&Object.entries(y).forEach(([g,x])=>{w.push({nodepath:L,element:O,_event:g,instruction:x,scope:P,get __dependencies__(){return G}})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),O}function J1(U){const j=U.text(),O=Y(),C=D("element"),L=U.parent().is(`[${S1}]`),P=Q1.default(document.createTextNode(X.__interpolate__(j,O,L))),A=(y)=>{const l=X.__interpolate__(j,y,L);if(!P[0])return;P[0].textContent=l,L&&X.__trackTranslationDep__(y,{nodetype:"text",nodepath:C,target:"value",$fragment:P,update:A})};if(j&&X.__isReactive__(j,O))X.__extractTextDeps__(j,O).forEach((l)=>X.__trackDep__(G,l,O,{nodetype:"text",nodepath:C,deppath:`${C}.${l}`,target:"value",$fragment:P,update:A}));return L&&X.__trackTranslationDep__(O,{nodetype:"text",nodepath:C,target:"value",$fragment:P,update:A}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),P}function u(U){if(U.get(0)?.nodeType===Node.COMMENT_NODE)return U;if(U.get(0)?.nodeType===Node.TEXT_NODE)return J1(U);if(U.is("let"))return H1(U);else if(U.is("const"))return r(U);else if(U.is("lips")&&U.attr(":dtag"))return e(U);else if(U.is("log"))return t(U);else if(X.__macros.has(U.prop("tagName")?.toLowerCase()))return c(U);else if(U.is("if, for, switch, async")||X.lips.has(U.prop("tagName")?.toLowerCase()))return v(U);else if(U.is("else-if, else"))return;return p(U)}try{this.__renderDepth__++,Z=!Z&&Q1.default(this.__template__).length>1?Q1.default("<template>").html(this.__template__).contents():Z||Q1.default(this.__template__),Z.each(function(){const U=u(Q1.default(this));if(U)M=M.add(U)}),w.forEach(this.__attachEvent__.bind(this)),X.metrics.inc("renderCount")}catch(U){console.error("Rendering Failed --",U),X.metrics.trackError(U)}finally{if(this.__renderDepth__--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth__===0)this.__inpath__="",this.__inpathCounter__=0}return{$log:M,dependencies:G,events:w}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(this.__detachEvent__.bind(this)),this.VER=[];for(let J in this.PCC){const Z=this.PCC.get(J);Z?.destroy(),Z?.delete(J)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.FGUDMemory?.clear(),this.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Z)=>{Q1.default(Z).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy")}__meshwire__(J,Z){const W=this,{$node:H,meshPath:q,fragmentPath:X,fragmentBoundaries:G,argv:w,xmlns:M,declaration:Y,useAttributes:D}=J;let K;const S=new Map,m=X+_0,e=(d,v,c)=>{if(K=H.contents(),!K?.length)return null;v=v||J.scope;const p=m+(c||""),{$log:J1,dependencies:u,events:U}=W.__withPath__(p,()=>{return W.render(p,K,{...v,...d},void 0,M)}),j=c||l1;return!S.has(j)&&S.set(j,new Set),S.get(j)?.add(p),u?.forEach((O,C)=>{!W.FGUD?.has(C)&&W.FGUD.set(C,new Map),O.forEach((L,P)=>{if(L.garbage)return;L.partial?.length?L.partial.push(p):L.partial=[p],W.FGUD.get(C)?.set(P,L)})}),W.metrics.inc("partialCount"),J1},t=(d,v,c,p,J1)=>{if(!S.get(J1||l1)?.size)return;c=c||J.scope,p=p||G,W.metrics.startRender();const u=Array.from(S.get(J1||l1)||[]);d.forEach((U)=>{const j=W.FGUD.get(U);if(!j)return;j.forEach((O)=>{const C=u.find((A)=>{return O.partial?.find((y)=>A==y||W.__hasSamePathParent__(y,A))});if(!O.partial||!C)return;const L=O.deppath||O.nodepath,P=this.FGUDMemory.get(O.nodepath);if(O.garbage||p?.start&&!document.contains(p.start)){j.delete(L),W.__unbindMemo__(O);return}if(!P){console.warn(`unexpected occurence: <${L}> has no memo`);return}if(P.memo?.[U]&&v?.[U]&&!U1(P.memo[U],v[U]))P.memo={...c,...P.memo,...v};W.UQS.queue({dep:U,deppath:L,priority:O.priority}),W.metrics.inc("dependencyUpdateCount")}),!j.size&&W.FGUD.delete(U)}),W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},H1=(d,v)=>{if(W.FGUD.forEach((c,p)=>{c.forEach((J1,u)=>{if(!W.__hasSamePathParent__(u,m+(v||"")))return;W.__unbindMemo__(J1),J1.garbage=!0}),!c.size&&W.FGUD.delete(p)}),S.delete(typeof v==="string"&&v||l1),d=d||G,W.__emptyBoundaries__(d),v)d.start.remove(),d.end.remove()},r={renderer:{path:q,argv:w,mesh:e,update:t,cleanup:H1,fill(d,v){W.__fillBoundaries__(d,v||G)},demarcate(d,v){const c=W.__getBoundaries__(m+(v||""));let p=Q1.default(c.start);return p=p.add(d),p=p.add(c.end),{$partial:p,boundaries:c}}}};if(D&&q){const{attrs:d}=W.__getAttributes__(H);d.literals&&Object.entries(d.literals).forEach(([v,c])=>r[v]=c),d.expressions&&Object.entries(d.expressions).forEach(([v,c])=>{if(K1.test(v)){let p=[];W.__evaluateSpreadAttr__(v,{memo:J.scope,get keystore(){return p},set keystore(J1){p=J1},each:(J1,u)=>r[J1]=u}),Z[`${Y?.syntax?E1:""}${q}.${v}`]=c}else r[v]=c?W.__evaluate__(c,J.scope):!0,Z[`${Y?.syntax?E1:""}${q}.${v}`]=c})}return r}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${J}`),end:document.createComment(`e:${J}`)}}__emptyBoundaries__(J){const Z=[];let W=J.start.nextSibling;while(W&&W!==J.end)Z.push(W),W=W.nextSibling;Q1.default(Z).remove()}__fillBoundaries__(J,Z){if(!document.contains(Z.start)||!document.contains(Z.end)){console.warn("Dynamic element boundaries not found");return}this.__emptyBoundaries__(Z),J.length&&Q1.default(Z.start).after(J)}__getAttributes__(J){const Z=J.attrs(),W={},H={},q={literals:{},expressions:{},map:{explicitAttrs:[],spreadAttrs:[],beforeSpreadAttrs:[],afterSpreadAttrs:[],metaAttrs:[]}},X=Object.keys(Z).find((M)=>K1.test(M));let G=[],w=!1;return Z&&Object.entries(Z).forEach(([M,Y])=>{if(M==":dtag")return;if(M.startsWith(":")||M.startsWith(L1)||M.startsWith(g1)||K1.test(M)||D0.test(M))if(D0.test(M)){const[D,K]=M.match(D0)||[];G=K.split(",")}else if(M.startsWith(g1))W[M.replace(g1,"")]=Y;else if(M.startsWith(L1))H[M.replace(L1,"")]=Y;else{if(M.startsWith(":"))M=M.slice(1,M.length);if(X)if(K1.test(M))q.map.spreadAttrs.push(M),w=!0;else q.map.explicitAttrs.push(M),!w?q.map.beforeSpreadAttrs.push(M):q.map.afterSpreadAttrs.push(M);q.expressions[M]=Y||""}else if(q.literals[M]=Y,X)q.map.explicitAttrs.push(M),!w?q.map.beforeSpreadAttrs.push(M):q.map.afterSpreadAttrs.push(M)}),{argv:G,events:W,functions:H,attrs:q}}__withPath__(J,Z){const W=this.__inpath__;this.__inpath__=J;const H=Z();return this.__inpath__=W,H}__getPathParent__(J){const Z=J.split("/");if(Z.length>1)Z.pop();return Z.join("/")}__hasSamePathParent__(J,Z){return J.startsWith(Z)&&!J.replace(Z,"").startsWith(".")||J.startsWith(`${Z+_0}`)}__evaluate__(J,Z,W){J=typeof J==="string"?J.trim():J;try{const H=(q)=>{const X=this.state.toJSON(),G=(M,...Y)=>{try{return M(...Y)}catch(D){!W?.mute&&console.error("Eval error --",D);return}};let w=`return ${q};`;if(Z){let M={},Y;for(let K in Z){if(K==="__arguments__")continue;M[K]=Z[K].value}if(typeof Z.__arguments__==="object")Y=Z.__arguments__;w=`with( scope ){ ${w} }`;const D=new Function("self","input","state","static","context","scope","arguments",w);return G(D,this,this.input,X,this.static,this.context,M||{},Y)}else{const M=new Function("self","input","state","static","context",w);return G(M,this,this.input,X,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return H(J.slice(1));return J.replace(f0,(q,X)=>H(X))}return H(J)}catch(H){!W?.mute&&console.error("Expression evaluation error --",H);return}}__evaluateFunction__(J,Z,W){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,W)(...Z);else{let[H,...q]=J.split(/\s*,\s*/),X;const G=this.__evaluate__(H,W,{mute:!0});if(typeof G==="function")X=G;else{if(typeof this[H]!=="function")throw new Error(`Undefined <${H}> handler method`);X=this[H].bind(this)}if(typeof X!=="function")throw new Error(`Expected <${H}> to be a function or handler method`);let w=q.map((M)=>this.__evaluate__(M,W));if(Z.length)w=[...w,...Z];return X(...w)}}__evaluateSpreadAttr__(J,Z){const W=this.__evaluate__(J.replace(K1,""),Z.memo);if(!W){if(!Z.keystore.length)throw new Error(`Undefined spread operator ${J}`);typeof Z.nullify==="function"&&Z.nullify(Z.keystore);return}if(typeof W!=="object"||Array.isArray(W))throw new Error(`Invalid spread operator ${J}`);if(Z.keystore=Object.keys(W)||[],typeof Z.each==="function")for(let H in W)Z.each(H,W[H])}__interpolate__(J,Z,W){if(J=J.replace(f0,(H,q)=>this.__evaluate__(q,Z)),W)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J){const{element:Z,nodepath:W,_event:H,instruction:q,scope:X,__dependencies__:G}=J;let w=X;if(Z.on(H,(...M)=>this.__evaluateFunction__(q,M,w)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(q,X))this.__extractExpressionDeps__(q,X).forEach((Y)=>this.__trackDep__(G,Y,X||{},{nodetype:"event",nodepath:W,deppath:`${W}.${H}`,target:"event-handler",$fragment:!(Z instanceof k1)?Z:null,boundaries:Z instanceof k1?Z.__boundaries__:void 0,update:(D)=>{w=D}}))}__detachEvent__({element:J,nodepath:Z,_event:W,instruction:H,scope:q,__dependencies__:X}){if(J.off(W),this.__isReactive__(H,q)){const G=this.__extractExpressionDeps__(H,q),w=`${Z}.${W}`;G.forEach((M)=>{X.get(M)?.delete(w),this.FGUD.get(M)?.delete(w)})}this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const W=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const X=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(X,Z).forEach((w)=>W.add(w))}),Array.from(W)}__extractExpressionDeps__(J,Z){const W=/\b(state|input|context|arguments)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,H=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g,q=/\b(arguments)((?:\.[a-zA-Z_]\w*)+)?(?=\[|\.|$|\s|;|,|\))/g;let X=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(H)),...Array.from(J.matchAll(q))];if(Z&&Object.keys(Z).length){const G=new RegExp(`\\b(?<!\\.)(${Object.keys(Z).join("|")})`,"g"),w=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");X=[...X,...Array.from(J.matchAll(G)),...Array.from(J.matchAll(w))]}return[...new Set(X.map((G)=>G[0]))]}__isReactive__(J,Z){if(/(self|state|input|context|arguments)(\.[\w.]+)?/.test(J))return!0;if(Z&&Object.keys(Z).length&&new RegExp(Object.keys(Z).join("|")).test(J))return!0;return!1}__bindMemo__(J,Z){const W=Z.deppath||Z.nodepath,H=this.FGUDMemory.get(Z.nodepath);if(H)H.tracks.set(W,Z.priority||2),H.memo=J,this.FGUDMemory.set(Z.nodepath,H);else{const q=new Map;q.set(W,Z.priority),this.FGUDMemory.set(Z.nodepath,{tracks:q,memo:J})}}__unbindMemo__(J){const Z=J.deppath||J.nodepath,W=this.FGUDMemory.get(J.nodepath);if(!W||!W.tracks.get(Z))return;W.tracks.delete(Z),!W.tracks.size&&this.FGUDMemory.delete(J.nodepath)}__trackDep__(J,Z,W,H){if(W&&W[Z]&&W[Z].type==="let")H.haslet=!0;if(H.priority===void 0)if(H.target==="attr"&&Z.split(".").find((X)=>S5.includes(X)))H.priority=0;else if(H.syntax)H.priority=1;else if(["event"].includes(H.nodetype))H.priority=3;else H.priority=2;const q=H.deppath||H.nodepath;H.level=q.split(/\//g).length,H.priority=H.level*h5+H.priority,!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(q,H),this.__bindMemo__(W,H),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J,Z){this.__i18nDeps.set(Z.deppath||Z.nodepath,Z),this.__bindMemo__(J,Z),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Z){return Z.reduce((W,H)=>W?.[H],J)}__shouldUpdate__(J,Z){if(J==="self")return!0;const W={state:this.state,input:this.input,context:this.context},H=this.__valueDep__(this.__previous[J],Z),q=this.__valueDep__(W[J],Z);return!U1(H,q)}__updateDepNodes__(){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((J,Z)=>{const[W,...H]=Z.split(".");if(!this.__shouldUpdate__(W,H))return;J.forEach((q)=>{try{const X=q.deppath||q.nodepath;if(q.garbage||q.boundaries?.start&&!document.contains(q.boundaries.start)||q.$fragment!==null&&!q.$fragment.closest("body").length){J.delete(X),this.__unbindMemo__(q);return}this.UQS.queue({dep:Z,deppath:X,priority:q.priority}),this.metrics.inc("dependencyUpdateCount")}catch(X){console.error("failed to update dependency nodes --",X);return}}),!J.size&&this.FGUD?.delete(Z)}),this.metrics.endRender()}__updateVarDepNodes__(J,Z,W){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((H,q)=>{if(!H.haslet||!this.__hasSamePathParent__(q,this.__getPathParent__(Z)))return;const X=H.deppath||H.nodepath,G=this.FGUDMemory.get(H.nodepath);if(!G){console.warn(`unexpected occurence: <${X}> has no memo`);return}G.memo={...G.memo,...W},this.UQS.queue({dep:J,deppath:X,priority:H.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateArgumentsDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender();const W="arguments";this.FGUD.get(W)?.forEach((H,q)=>{if(!this.__hasSamePathParent__(q,J))return;const X=H.deppath||H.nodepath,G=this.FGUDMemory.get(H.nodepath);if(!G){console.warn(`unexpected occurence: <${X}> has no memo`);return}G.memo.__arguments__=Z,this.UQS.queue({dep:W,deppath:X,priority:H.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Z)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Z);return}const W=this.FGUDMemory.get(J.nodepath);if(!W){console.warn(`unexpected occurence: <${J.deppath||J.nodepath}> has no memo`);return}J.update(W.memo,"i18n-partial-updator"),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?Q1.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?Q1.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?Q1.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var v0={};i1(v0,{handler:()=>{{return A8}},declaration:()=>{{return T8}},_static:()=>{{return E8}}});var T8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},E8={initialized:!1,prevRenderer:null},A8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,W=!1){if(!J.renderer)return;if(J.by){this.static.prevRenderer?.cleanup();const H=J.renderer.mesh({},Z);if(this.static.prevRenderer=J.renderer,!H?.length)return;if(W)return H;J.renderer.fill(H)}else{this.static.prevRenderer?.cleanup();let H=!1,q;if(Array.isArray(J["else-if"])&&J["else-if"].length)for(let X of J["else-if"]){if(!X.by)continue;if(q=X.renderer.mesh({},Z),this.static.prevRenderer=X.renderer,!q?.length)return;if(W)return q;q?.length&&X.renderer.fill(q),H=!0;break}if(!H&&J.else){const X=J.else.renderer.mesh({},Z);if(this.static.prevRenderer=J.else.renderer,!X?.length)return;if(W)return X;J.else.renderer.fill(X)}}}};var u0={};i1(u0,{handler:()=>{{return b8}},declaration:()=>{{return $8}},_static:()=>{{return S8}}});var N1=t1(c1(),1);var $8={name:"for",syntax:!0},S8={lastIn:null,argvlist:null,initialized:!1,prevRenderer:null,processingBatch:!1},b8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,W=!1){if(this.static.processingBatch)return;if(!J.renderer)throw new Error("Undefined mesh renderer");let{in:H,from:q,to:X}=J;if(H===void 0&&q===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(q!==void 0)return this.asFromTo(J.renderer,q,X,Z,W);else if(Array.isArray(H))return this.asArray(J.renderer,H,Z,W);else if(H instanceof Map)return this.asMap(J.renderer,H,Z,W);else if(typeof H=="object")return this.asObject(J.renderer,H,Z,W)}finally{this.static.processingBatch=!1}},addItem(J,Z,W,H){if(!this.static.argvlist)this.static.argvlist=[];const q=`[${H}]`,X=J.mesh(W,Z,q);if(!X)return;const{boundaries:G,$partial:w}=J.demarcate(X,q);return this.static.prevRenderer=J,this.static.argvlist.push({argvalues:W,boundaries:G}),w},updateItem(J,Z,W,H){if(!this.static.argvlist?.[H])return;this.static.argvlist[H].argvalues=W,J.update(Object.keys(W),W,Z,this.static.argvlist[H].boundaries,`[${H}]`)},removeItem(J,Z){if(!this.static.argvlist?.[Z])return;J.cleanup(this.static.argvlist[Z].boundaries,`[${Z}]`),this.static.argvlist.splice(Z,1)},asFromTo(J,Z,W,H,q){if(Z=parseFloat(String(Z)),W==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");W=parseFloat(String(W));const X=Z<W,G=Math.abs(W-Z)+1;if(Array.isArray(this.static.argvlist)){const[M]=J.argv;if(M){let Y=Z;if(this.static.argvlist.length===G){for(let K=0;K<this.static.argvlist.length;K++)this.static.argvlist[K].argvalues[M].value!==Y&&this.updateItem(J,H,{[M]:{value:Y,type:"arg"}},K),Y=X?Y+1:Y-1;return}const D=Math.min(this.static.argvlist.length,G);for(let K=0;K<D;K++)this.updateItem(J,H,{[M]:{value:K,type:"arg"}},K);if(G>this.static.argvlist.length)for(let K=this.static.argvlist.length;K<G;K++){const S={[M]:{value:K,type:"arg"}};this.boundaries&&N1.default(this.boundaries.end).before(this.addItem(J,H,S,K))}else if(G<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=G;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let w=N1.default();for(let M=Z;X?M<=W:M>=W;X?M++:M--){const Y={},[D]=J.argv;if(D)Y[D]={value:M,type:"arg"};w=w.add(this.addItem(J,H,Y,M))}if(!w?.length)return;if(q)return w;J.fill(w)},asArray(J,Z,W,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Z.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[G,w]=J.argv;if(G){if(this.static.argvlist.length===Z.length){for(let Y=0;Y<this.static.argvlist.length;Y++)!U1(this.static.argvlist[Y].argvalues[G].value,Z[Y])&&this.updateItem(J,W,{[G]:{value:Z[Y],type:"arg"},[w]:{value:Y,type:"arg"}},Y);return}const M=Math.min(this.static.argvlist.length,Z.length);for(let Y=0;Y<M;Y++)this.updateItem(J,W,{[G]:{value:Z[Y],type:"arg"},[w]:{value:Y,type:"arg"}},Y);if(Z.length>this.static.argvlist.length)for(let Y=this.static.argvlist.length;Y<Z.length;Y++){const D={[G]:{value:Z[Y],type:"arg"},[w]:{value:Y,type:"arg"}};this.boundaries&&N1.default(this.boundaries.end).before(this.addItem(J,W,D,Y))}else if(Z.length<this.static.argvlist.length)for(let Y=this.static.argvlist.length-1;Y>=Z.length;Y--)this.removeItem(J,Y)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N1.default(),X=0;for(let G of Z){const w={},[M,Y]=J.argv;if(M)w[M]={value:G,type:"arg"};if(Y)w[Y]={value:X,type:"arg"};q=q.add(this.addItem(J,W,w,X)),X++}if(!q?.length)return;if(H)return q;J.fill(q)},asMap(J,Z,W,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Z.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[G,w,M]=J.argv,Y=Array.from(Z.entries());if(G){if(this.static.argvlist.length===Y.length){for(let K=0;K<this.static.argvlist.length;K++)!U1(this.static.argvlist[K].argvalues[G].value,Y[K][0])||!U1(this.static.argvlist[K].argvalues[w].value,Y[K][1])&&this.updateItem(J,W,{[G]:{value:Y[K][0],type:"arg"},[w]:{value:Y[K][1],type:"arg"},[M]:{value:K,type:"arg"}},K);return}const D=Math.min(this.static.argvlist.length,Y.length);for(let K=0;K<D;K++)this.updateItem(J,W,{[G]:{value:Y[K][0],type:"arg"},[w]:{value:Y[K][1],type:"arg"},[M]:{value:K,type:"arg"}},K);if(Y.length>this.static.argvlist.length)for(let K=this.static.argvlist.length;K<Y.length;K++){const S={[G]:{value:Y[K][0],type:"arg"},[w]:{value:Y[K][1],type:"arg"},[M]:{value:K,type:"arg"}};this.boundaries&&N1.default(this.boundaries.end).before(this.addItem(J,W,S,K))}else if(Y.length<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=Y.length;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N1.default(),X=0;for(let[G,w]of Z){const M={},[Y,D,K]=J.argv;if(Y)M[Y]={value:G,type:"arg"};if(D)M[D]={value:w,type:"arg"};if(K)M[K]={value:X,type:"arg"};q=q.add(this.addItem(J,W,M,X)),X++}if(!q?.length)return;if(H)return q;J.fill(q)},asObject(J,Z,W,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Object.keys(Z).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[G,w,M]=J.argv,Y=Object.entries(Z);if(G){if(this.static.argvlist.length===Y.length){for(let K=0;K<this.static.argvlist.length;K++)!U1(this.static.argvlist[K].argvalues[G].value,Y[K][0])||!U1(this.static.argvlist[K].argvalues[w].value,Y[K][1])&&this.updateItem(J,W,{[G]:{value:Y[K][0],type:"arg"},[w]:{value:Y[K][1],type:"arg"},[M]:{value:K,type:"arg"}},K);return}const D=Math.min(this.static.argvlist.length,Y.length);for(let K=0;K<D;K++)this.updateItem(J,W,{[G]:{value:Y[K][0],type:"arg"},[w]:{value:Y[K][1],type:"arg"},[M]:{value:K,type:"arg"}},K);if(Y.length>this.static.argvlist.length){let K=N1.default();for(let S=this.static.argvlist.length;S<Y.length;S++){const m={[G]:{value:Y[S][0],type:"arg"},[w]:{value:Y[S][1],type:"arg"},[M]:{value:S,type:"arg"}},e=this.addItem(J,W,m,S);K=K.add(e)}this.boundaries&&N1.default(this.boundaries.end).before(K)}else if(Y.length<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=Y.length;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N1.default(),X=0;for(let G in Z){const w={},[M,Y,D]=J.argv;if(M)w[M]={value:G,type:"arg"};if(Y)w[Y]={value:Z[G],type:"arg"};if(D)w[D]={value:X,type:"arg"};q=q.add(this.addItem(J,W,w,X)),X++}if(!q?.length)return;if(H)return q;J.fill(q)},onDestroy(){this.static.prevRenderer?.cleanup(void 0,!0),this.static.prevRenderer=null,this.static.argvlist=null,this.static.lastIn=null}};var m0={};i1(m0,{handler:()=>{{return k8}},declaration:()=>{{return g8}},_static:()=>{{return x8}}});var g8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},x8={initialized:!1,finalized:!1,prevRenderer:null},k8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,W=!1){if(!J.await)throw new Error("Undefined async <await> attribute");if(!(J.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(this.static.finalized=!1,J.loading){this.static.prevRenderer?.cleanup();const H=J.loading.renderer.mesh({},Z);if(this.static.prevRenderer=J.loading.renderer,this.execute(J,Z,!0),this.static.finalized)return;if(!H?.length)return;if(W)return H;J.loading.renderer.fill(H)}else this.execute(J,Z)},execute(J,Z,W=!1){J.await.then((H)=>{if(this.static.prevRenderer?.cleanup(),!J.then)return;const[q]=J.then.renderer.argv,X={[q]:{value:H,type:"arg"}},G=J.then.renderer.mesh(X,Z);if(this.static.prevRenderer=J.then.renderer,!G?.length)return;if(!W)return G;J.then.renderer.fill(G)}).catch((H)=>{if(this.static.prevRenderer?.cleanup(),!J.catch)return;const[q]=J.catch.renderer.argv,X={[q]:{value:H,type:"arg"}},G=J.catch.renderer.mesh(X,Z);if(this.static.prevRenderer=J.catch.renderer,!G?.length)return;if(!W)return G;J.catch.renderer.fill(G)}).finally(()=>this.static.finalized=!0)}};var d0={};i1(d0,{handler:()=>{{return _8}},declaration:()=>{{return h8}},_static:()=>{{return f8}}});var h8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},f8={initialized:!1,prevRenderer:null},_8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,W=!1){let H=[];this.static.prevRenderer?.cleanup();for(let q of J.case)if(q.is==J.by||Array.isArray(q.is)&&q.is.includes(J.by)){Array.isArray(q.is)?H=[...new Set([...H,...q.is])]:H.push(q.is);const X=q.renderer.mesh({},Z);if(this.static.prevRenderer=q.renderer,!X?.length)return;if(W)return X;q.renderer.fill(X)}if(H.includes(J.by))return;if(J.default){const q=J.default.renderer.mesh({},Z);if(this.static.prevRenderer=J.default.renderer,!q?.length)return;if(W)return q;J.default.renderer.fill(q)}else this.static.prevRenderer=null}};var i0={};i1(i0,{state:()=>{{return y8}},handler:()=>{{return d8}},default:()=>{{return i8}},context:()=>{{return u8}},_static:()=>{{return v8}}});var m8=function(J){const Z={};return J.split("&").map((H)=>{const[q,X]=H.split("=");Z[q]=X}),Z},y8={page:null,params:{},query:{}},v8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},u8=["navigate"],d8={onInput(){this.processor(this.input)},processor(J){if(!J.routes)return;if(J.global)this.static.global=J.global;if(this.static.routes=J.routes.map(({path:Z,template:W,default:H})=>{if(H)this.static.defaultPath=Z;const q=Z.match(/:[^\/]*(\/|$)/gi)||[],X=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:W,default:H,pathVars:q,pathRegex:new RegExp(`${X}\$`,"i")}}),J.global){const Z=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&Z=="/"&&Z!==this.static.defaultPath?this.static.defaultPath:Z?Z+window.location.search:this.static.routes[0].path}},onAttach(){if(this.input.global)window.navigate=this.navigate.bind(this),window.addEventListener("popstate",(J)=>J.state&&this.navigate(J.state.path,!0));this.setContext("navigate",this.navigate.bind(this)),this.static.defaultPath&&this.navigate(this.static.defaultPath)},navigate(J,Z){!Z&&this.static.global&&history.pushState({path:J},"",J);const W=J.split("?");J=W[0];const H=W[1]?m8(W[1]):{};let q=null;if(this.static.currentRoute)q={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:q,toState:{path:J,query:H}});const X=this.match(J);if(!X){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:G,params:w}=X;this.emit("after",{fromState:q,toState:{path:G.path,params:w,query:H}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=w,this.state.query=H,this.state.page=G.template},match(J){const Z={};let W=!1;for(let H of this.static.routes){const{pathVars:q,pathRegex:X}=H,G=J.match(X);if(G!==null&&G.index===0){for(let w=0;w+1<G.length&&w<q.length;w++)Z[q[w].replaceAll(/[\/:]/g,"")]=G[w+1];W=H;break}}return W?{route:W,params:Z}:!1}},i8="<{state.page} params=state.params query=state.query/>";class v5{debug=!1;stylesheets=[];config={};store={};__root;i18n=new W0;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new Z0,this.IUC=new J0;const[Z,W]=x1(this.i18n.lang),[H,q]=x1(J?.context||{});this.__setLang=W,this.__getLang=Z,this.__setContext=q,this.__getContext=H,this.register("if",v0),this.register("for",u0),this.register("async",m0),this.register("switch",d0),this.register("router",i0)}register(J,Z){return this.store[J]=Z,this}unregister(J){return delete this.store[J],this}has(J){return J in this.store}import(J){if(!this.has(J))throw new Error(`<${J}> component not found`);if(!this.store[J].declaration?.syntax&&!this.store[J].default)throw new Error(`Invalid <${J}> component`);return this.store[J]}render(J,Z,W){const{default:H,...q}=Z,X={debug:this.debug,prepath:"0",lips:this},G=new k1(J,H||"",{...q,input:W},X);return window.addEventListener("beforeunload",()=>{return this.dispose(),G.destroy(),null}),window.addEventListener("pagehide",(w)=>{!w.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),G}root(J,Z){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Z),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((W)=>new d1("root",{sheet:W,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Z){const W=this.__getContext();if(typeof J==="string"){const H={...W,[J]:Z};G1(W,H)&&this.__setContext(H)}else if(!Array.isArray(J)){const H={...W,...J};G1(W,H)&&this.__setContext(H)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;o1(()=>{const W=this.__getContext();if(!W)return;const H=Object.fromEntries(J.map((q)=>[q,W[q]]));H&&typeof Z==="function"&&Object.keys(H).length&&Z(H)})}useTranslator(J,Z){o1(()=>{const W=this.__getLang();if(!W)return;(J==="*"||Array.isArray(J)&&J.includes(W))&&typeof Z==="function"&&Z(W)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}export{v5 as default};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=4B6CD72A855519C964756e2164756e21
|