@lipsjs/lips 0.0.14 → 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/test.stress.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var K8=Object.create;var{defineProperty:g1,getPrototypeOf:O8,getOwnPropertyNames:I8}=Object;var j8=Object.prototype.hasOwnProperty;var t0=(J,Z,W)=>{W=J!=null?K8(O8(J)):{};const H=Z||!J||!J.__esModule?g1(W,"default",{value:J,enumerable:!0}):W;for(let G of I8(J))if(!j8.call(H,G))g1(H,G,{get:()=>J[G],enumerable:!0});return H};var D8=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var i0=(J,Z)=>{for(var W in Z)g1(J,W,{get:Z[W],enumerable:!0,configurable:!0,set:(H)=>Z[W]=()=>H})};var c0=D8((G5,q5)=>{(function(){var J=document,Z=window,W=J.documentElement,H=J.createElement.bind(J),G=H("div"),X=H("table"),z=H("tbody"),Y=H("tr"),U=Array.isArray,B=Array.prototype,I=B.concat,K=B.filter,g=B.indexOf,u=B.map,e=B.push,a=B.slice,H0=B.some,n=B.splice,m=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,y=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,c=/<.+>/,p=/^\w+$/;function J0(Q,q){var w=C(q);return!Q||!w&&!L(q)&&!$(q)?[]:!w&&y.test(Q)?q.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!w&&p.test(Q)?q.getElementsByTagName(Q):q.querySelectorAll(Q)}var v=function(){function Q(q,w){if(!q)return;if(j(q))return q;var O=q;if(A(q)){var N=w||J;if(O=m.test(q)&&L(N)?N.getElementById(q.slice(1).replace(/\\/g,"")):c.test(q)?s1(q):j(N)?N.find(q):A(N)?F(N).find(q):J0(q,N),!O)return}else if(h(q))return this.ready(q);if(O.nodeType||O===Z)O=[O];this.length=O.length;for(var T=0,f=this.length;T<f;T++)this[T]=O[T]}return Q.prototype.init=function(q,w){return new Q(q,w)},Q}(),M=v.prototype,F=M.init;if(F.fn=F.prototype=M,M.length=0,M.splice=n,typeof Symbol==="function")M[Symbol.iterator]=B[Symbol.iterator];function j(Q){return Q instanceof v}function R(Q){return!!Q&&Q===Q.window}function L(Q){return!!Q&&Q.nodeType===9}function C(Q){return!!Q&&Q.nodeType===11}function $(Q){return!!Q&&Q.nodeType===1}function _(Q){return!!Q&&Q.nodeType===3}function d(Q){return typeof Q==="boolean"}function h(Q){return typeof Q==="function"}function A(Q){return typeof Q==="string"}function P(Q){return Q===void 0}function x(Q){return Q===null}function E(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function k(Q){if(typeof Q!=="object"||Q===null)return!1;var q=Object.getPrototypeOf(Q);return q===null||q===Object.prototype}F.isWindow=R,F.isFunction=h,F.isArray=U,F.isNumeric=E,F.isPlainObject=k;function D(Q,q,w){if(w){var O=Q.length;while(O--)if(q.call(Q[O],O,Q[O])===!1)return Q}else if(k(Q)){var N=Object.keys(Q);for(var O=0,T=N.length;O<T;O++){var f=N[O];if(q.call(Q[f],f,Q[f])===!1)return Q}}else for(var O=0,T=Q.length;O<T;O++)if(q.call(Q[O],O,Q[O])===!1)return Q;return Q}F.each=D,M.each=function(Q){return D(this,Q)},M.empty=function(){return this.each(function(Q,q){while(q.firstChild)q.removeChild(q.firstChild)})};function b(){var Q=[];for(var q=0;q<arguments.length;q++)Q[q]=arguments[q];var w=d(Q[0])?Q.shift():!1,O=Q.shift(),N=Q.length;if(!O)return{};if(!N)return b(w,F,O);for(var T=0;T<N;T++){var f=Q[T];for(var l in f)if(w&&(U(f[l])||k(f[l]))){if(!O[l]||O[l].constructor!==f[l].constructor)O[l]=new f[l].constructor;b(w,O[l],f[l])}else O[l]=f[l]}return O}F.extend=b,M.extend=function(Q){return b(M,Q)};var V=/\S+/g;function S(Q){return A(Q)?Q.match(V)||[]:[]}M.toggleClass=function(Q,q){var w=S(Q),O=!P(q);return this.each(function(N,T){if(!$(T))return;D(w,function(f,l){if(O)q?T.classList.add(l):T.classList.remove(l);else T.classList.toggle(l)})})},M.addClass=function(Q){return this.toggleClass(Q,!0)},M.removeAttr=function(Q){var q=S(Q);return this.each(function(w,O){if(!$(O))return;D(q,function(N,T){O.removeAttribute(T)})})};function t(Q,q){if(!Q)return;if(A(Q)){if(arguments.length<2){if(!this[0]||!$(this[0]))return;var w=this[0].getAttribute(Q);return x(w)?void 0:w}if(P(q))return this;if(x(q))return this.removeAttr(Q);return this.each(function(N,T){if(!$(T))return;T.setAttribute(Q,q)})}for(var O in Q)this.attr(O,Q[O]);return this}M.attr=t,M.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},M.hasClass=function(Q){return!!Q&&H0.call(this,function(q){return $(q)&&q.classList.contains(Q)})},M.get=function(Q){if(P(Q))return a.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},M.eq=function(Q){return F(this.get(Q))},M.first=function(){return this.eq(0)},M.last=function(){return this.eq(-1)};function r(Q){if(P(Q))return this.get().map(function(q){return $(q)||_(q)?q.textContent:""}).join("");return this.each(function(q,w){if(!$(w))return;w.textContent=Q})}M.text=r;function i(Q,q,w){if(!$(Q))return;var O=Z.getComputedStyle(Q,null);return w?O.getPropertyValue(q)||void 0:O[q]||Q.style[q]}function s(Q,q){return parseInt(i(Q,q),10)||0}function o(Q,q){return s(Q,"border".concat(q?"Left":"Top","Width"))+s(Q,"padding".concat(q?"Left":"Top"))+s(Q,"padding".concat(q?"Right":"Bottom"))+s(Q,"border".concat(q?"Right":"Bottom","Width"))}var Z0={};function F0(Q){if(Z0[Q])return Z0[Q];var q=H(Q);J.body.insertBefore(q,null);var w=i(q,"display");return J.body.removeChild(q),Z0[Q]=w!=="none"?w:"block"}function k0(Q){return i(Q,"display")==="none"}function c1(Q,q){var w=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!w&&!!q&&w.call(Q,q)}function r0(Q){return A(Q)?function(q,w){return c1(w,Q)}:h(Q)?Q:j(Q)?function(q,w){return Q.is(w)}:!Q?function(){return!1}:function(q,w){return w===Q}}M.filter=function(Q){var q=r0(Q);return F(K.call(this,function(w,O){return q.call(w,O,w)}))};function T0(Q,q){return!q?Q:Q.filter(q)}M.detach=function(Q){return T0(this,Q).each(function(q,w){if(w.parentNode)w.parentNode.removeChild(w)}),this};var m5=/^\s*<(\w+)[^>]*>/,d5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p1={"*":G,tr:z,td:Y,th:Y,thead:X,tbody:X,tfoot:X};function s1(Q){if(!A(Q))return[];if(d5.test(Q))return[H(RegExp.$1)];var q=m5.test(Q)&&RegExp.$1,w=p1[q]||p1["*"];return w.innerHTML=Q,F(w.childNodes).detach().get()}F.parseHTML=s1,M.has=function(Q){var q=A(Q)?function(w,O){return J0(Q,O).length}:function(w,O){return O.contains(Q)};return this.filter(q)},M.not=function(Q){var q=r0(Q);return this.filter(function(w,O){return(!A(Q)||$(O))&&!q.call(O,w,O)})};function N0(Q,q,w,O){var N=[],T=h(q),f=O&&r0(O);for(var l=0,I0=Q.length;l<I0;l++)if(T){var G0=q(Q[l]);if(G0.length)e.apply(N,G0)}else{var w0=Q[l][q];while(w0!=null){if(O&&f(-1,w0))break;N.push(w0),w0=w?w0[q]:null}}return N}function l1(Q){if(Q.multiple&&Q.options)return N0(K.call(Q.options,function(q){return q.selected&&!q.disabled&&!q.parentNode.disabled}),"value");return Q.value||""}function i5(Q){if(!arguments.length)return this[0]&&l1(this[0]);return this.each(function(q,w){var O=w.multiple&&w.options;if(O||X5.test(w.type)){var N=U(Q)?u.call(Q,String):x(Q)?[]:[String(Q)];if(O)D(w.options,function(T,f){f.selected=N.indexOf(f.value)>=0},!0);else w.checked=N.indexOf(w.value)>=0}else w.value=P(Q)||x(Q)?"":Q})}M.val=i5,M.is=function(Q){var q=r0(Q);return H0.call(this,function(w,O){return q.call(w,O,w)})},F.guid=1;function L0(Q){return Q.length>1?K.call(Q,function(q,w,O){return g.call(O,q)===w}):Q}F.unique=L0,M.add=function(Q,q){return F(L0(this.get().concat(F(Q,q).get())))},M.children=function(Q){return T0(F(L0(N0(this,function(q){return q.children}))),Q)},M.parent=function(Q){return T0(F(L0(N0(this,"parentNode"))),Q)},M.index=function(Q){var q=Q?F(Q)[0]:this[0],w=Q?this:F(q).parent().children();return g.call(w,q)},M.closest=function(Q){var q=this.filter(Q);if(q.length)return q;var w=this.parent();if(!w.length)return q;return w.closest(Q)},M.siblings=function(Q){return T0(F(L0(N0(this,function(q){return F(q).parent().children().not(q)}))),Q)},M.find=function(Q){return F(L0(N0(this,function(q){return J0(Q,q)})))};var c5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,p5=/^$|^module$|\/(java|ecma)script/i,s5=["type","src","nonce","noModule"];function l5(Q,q){var w=F(Q);w.filter("script").add(w.find("script")).each(function(O,N){if(p5.test(N.type)&&W.contains(N)){var T=H("script");T.text=N.textContent.replace(c5,""),D(s5,function(f,l){if(N[l])T[l]=N[l]}),q.head.insertBefore(T,null),q.head.removeChild(T)}})}function o5(Q,q,w,O,N){if(O)Q.insertBefore(q,w?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(q,Q);else Q.parentNode.insertBefore(q,w?Q:Q.nextSibling);if(N)l5(q,Q.ownerDocument)}function A0(Q,q,w,O,N,T,f,l){return D(Q,function(I0,G0){D(F(G0),function(w0,S0){D(F(q),function(j0,a0){var A1=w?S0:a0,$1=w?a0:S0,Y0=w?w0:j0;o5(A1,!Y0?$1:$1.cloneNode(!0),O,N,!Y0)},l)},f)},T),q}M.after=function(){return A0(arguments,this,!1,!1,!1,!0,!0)},M.append=function(){return A0(arguments,this,!1,!1,!0)};function r5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if(P(Q))return this;var q=/<script[\s>]/.test(Q);return this.each(function(w,O){if(!$(O))return;if(q)F(O).empty().append(Q);else O.innerHTML=Q})}M.html=r5,M.appendTo=function(Q){return A0(arguments,this,!0,!1,!0)},M.wrapInner=function(Q){return this.each(function(q,w){var O=F(w),N=O.contents();N.length?N.wrapAll(Q):O.append(Q)})},M.before=function(){return A0(arguments,this,!1,!0)},M.wrapAll=function(Q){var q=F(Q),w=q[0];while(w.children.length)w=w.firstElementChild;return this.first().before(q),this.appendTo(w)},M.wrap=function(Q){return this.each(function(q,w){var O=F(Q)[0];F(w).wrapAll(!q?O:O.cloneNode(!0))})},M.insertAfter=function(Q){return A0(arguments,this,!0,!1,!1,!1,!1,!0)},M.insertBefore=function(Q){return A0(arguments,this,!0,!0)},M.prepend=function(){return A0(arguments,this,!1,!0,!0,!0,!0)},M.prependTo=function(Q){return A0(arguments,this,!0,!0,!0,!1,!1,!0)},M.contents=function(){return F(L0(N0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},M.next=function(Q,q,w){return T0(F(L0(N0(this,"nextElementSibling",q,w))),Q)},M.nextAll=function(Q){return this.next(Q,!0)},M.nextUntil=function(Q,q){return this.next(q,!0,Q)},M.parents=function(Q,q){return T0(F(L0(N0(this,"parentElement",!0,q))),Q)},M.parentsUntil=function(Q,q){return this.parents(q,Q)},M.prev=function(Q,q,w){return T0(F(L0(N0(this,"previousElementSibling",q,w))),Q)},M.prevAll=function(Q){return this.prev(Q,!0)},M.prevUntil=function(Q,q){return this.prev(q,!0,Q)},M.map=function(Q){return F(I.apply([],u.call(this,function(q,w){return Q.call(q,w,q)})))},M.clone=function(){return this.map(function(Q,q){return q.cloneNode(!0)})},M.offsetParent=function(){return this.map(function(Q,q){var w=q.offsetParent;while(w&&i(w,"position")==="static")w=w.offsetParent;return w||W})},M.slice=function(Q,q){return F(a.call(this,Q,q))};var n5=/-([a-z])/g;function V1(Q){return Q.replace(n5,function(q,w){return w.toUpperCase()})}M.ready=function(Q){var q=function(){return setTimeout(Q,0,F)};if(J.readyState!=="loading")q();else J.addEventListener("DOMContentLoaded",q);return this},M.unwrap=function(){return this.parent().each(function(Q,q){if(q.tagName==="BODY")return;var w=F(q);w.replaceWith(w.children())}),this},M.offset=function(){var Q=this[0];if(!Q)return;var q=Q.getBoundingClientRect();return{top:q.top+Z.pageYOffset,left:q.left+Z.pageXOffset}},M.position=function(){var Q=this[0];if(!Q)return;var q=i(Q,"position")==="fixed",w=q?Q.getBoundingClientRect():this.offset();if(!q){var O=Q.ownerDocument,N=Q.offsetParent||O.documentElement;while((N===O.body||N===O.documentElement)&&i(N,"position")==="static")N=N.parentNode;if(N!==Q&&$(N)){var T=F(N).offset();w.top-=T.top+s(N,"borderTopWidth"),w.left-=T.left+s(N,"borderLeftWidth")}}return{top:w.top-s(Q,"marginTop"),left:w.left-s(Q,"marginLeft")}};var o1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};M.prop=function(Q,q){if(!Q)return;if(A(Q)){if(Q=o1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(O,N){N[Q]=q})}for(var w in Q)this.prop(w,Q[w]);return this},M.removeProp=function(Q){return this.each(function(q,w){delete w[o1[Q]||Q]})};var a5=/^--/;function N1(Q){return a5.test(Q)}var C1={},t5=G.style,e5=["webkit","moz","ms"];function J8(Q,q){if(q===void 0)q=N1(Q);if(q)return Q;if(!C1[Q]){var w=V1(Q),O="".concat(w[0].toUpperCase()).concat(w.slice(1)),N="".concat(w," ").concat(e5.join("".concat(O," "))).concat(O).split(" ");D(N,function(T,f){if(f in t5)return C1[Q]=f,!1})}return C1[Q]}var Z8={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 r1(Q,q,w){if(w===void 0)w=N1(Q);return!w&&!Z8[Q]&&E(q)?"".concat(q,"px"):q}function Q8(Q,q){if(A(Q)){var w=N1(Q);if(Q=J8(Q,w),arguments.length<2)return this[0]&&i(this[0],Q,w);if(!Q)return this;return q=r1(Q,q,w),this.each(function(N,T){if(!$(T))return;if(w)T.style.setProperty(Q,q);else T.style[Q]=q})}for(var O in Q)this.css(O,Q[O]);return this}M.css=Q8;function n1(Q,q){try{return Q(q)}catch(w){return q}}var W8=/^\s+|\s+$/;function a1(Q,q){var w=Q.dataset[q]||Q.dataset[V1(q)];if(W8.test(w))return w;return n1(JSON.parse,w)}function X8(Q,q,w){w=n1(JSON.stringify,w),Q.dataset[V1(q)]=w}function H8(Q,q){if(!Q){if(!this[0])return;var w={};for(var O in this[0].dataset)w[O]=a1(this[0],O);return w}if(A(Q)){if(arguments.length<2)return this[0]&&a1(this[0],Q);if(P(q))return this;return this.each(function(N,T){X8(T,Q,q)})}for(var O in Q)this.data(O,Q[O]);return this}M.data=H8;function t1(Q,q){var w=Q.documentElement;return Math.max(Q.body["scroll".concat(q)],w["scroll".concat(q)],Q.body["offset".concat(q)],w["offset".concat(q)],w["client".concat(q)])}D([!0,!1],function(Q,q){D(["Width","Height"],function(w,O){var N="".concat(q?"outer":"inner").concat(O);M[N]=function(T){if(!this[0])return;if(R(this[0]))return q?this[0]["inner".concat(O)]:this[0].document.documentElement["client".concat(O)];if(L(this[0]))return t1(this[0],O);return this[0]["".concat(q?"offset":"client").concat(O)]+(T&&q?s(this[0],"margin".concat(w?"Top":"Left"))+s(this[0],"margin".concat(w?"Bottom":"Right")):0)}})}),D(["Width","Height"],function(Q,q){var w=q.toLowerCase();M[w]=function(O){if(!this[0])return P(O)?void 0:this;if(!arguments.length){if(R(this[0]))return this[0].document.documentElement["client".concat(q)];if(L(this[0]))return t1(this[0],q);return this[0].getBoundingClientRect()[w]-o(this[0],!Q)}var N=parseInt(O,10);return this.each(function(T,f){if(!$(f))return;var l=i(f,"boxSizing");f.style[w]=r1(w,N+(l==="border-box"?o(f,!Q):0))})}});var e1="___cd";M.toggle=function(Q){return this.each(function(q,w){if(!$(w))return;var O=k0(w),N=P(Q)?O:Q;if(N){if(w.style.display=w[e1]||"",k0(w))w.style.display=F0(w.tagName)}else if(!O)w[e1]=i(w,"display"),w.style.display="none"})},M.hide=function(){return this.toggle(!1)},M.show=function(){return this.toggle(!0)};var J5="___ce",R1=".",P1={focus:"focusin",blur:"focusout"},Z5={mouseenter:"mouseover",mouseleave:"mouseout"},G8=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function E1(Q){return Z5[Q]||P1[Q]||Q}function T1(Q){var q=Q.split(R1);return[q[0],q.slice(1).sort()]}M.trigger=function(Q,q){if(A(Q)){var w=T1(Q),O=w[0],N=w[1],T=E1(O);if(!T)return this;var f=G8.test(T)?"MouseEvents":"HTMLEvents";Q=J.createEvent(f),Q.initEvent(T,!0,!0),Q.namespace=N.join(R1),Q.___ot=O}Q.___td=q;var l=Q.___ot in P1;return this.each(function(I0,G0){if(l&&h(G0[Q.___ot]))G0["___i".concat(Q.type)]=!0,G0[Q.___ot](),G0["___i".concat(Q.type)]=!1;G0.dispatchEvent(Q)})};function Q5(Q){return Q[J5]=Q[J5]||{}}function q8(Q,q,w,O,N){var T=Q5(Q);T[q]=T[q]||[],T[q].push([w,O,N]),Q.addEventListener(q,N)}function W5(Q,q){return!q||!H0.call(q,function(w){return Q.indexOf(w)<0})}function n0(Q,q,w,O,N){var T=Q5(Q);if(!q)for(q in T)n0(Q,q,w,O,N);else if(T[q])T[q]=T[q].filter(function(f){var l=f[0],I0=f[1],G0=f[2];if(N&&G0.guid!==N.guid||!W5(l,w)||O&&O!==I0)return!0;Q.removeEventListener(q,G0)})}M.off=function(Q,q,w){var O=this;if(P(Q))this.each(function(T,f){if(!$(f)&&!L(f)&&!R(f))return;n0(f)});else if(!A(Q))for(var N in Q)this.off(N,Q[N]);else{if(h(q))w=q,q="";D(S(Q),function(T,f){var l=T1(f),I0=l[0],G0=l[1],w0=E1(I0);O.each(function(S0,j0){if(!$(j0)&&!L(j0)&&!R(j0))return;n0(j0,w0,G0,q,w)})})}return this},M.remove=function(Q){return T0(this,Q).detach().off(),this},M.replaceWith=function(Q){return this.before(Q).remove()},M.replaceAll=function(Q){return F(Q).replaceWith(this),this};function z8(Q,q,w,O,N){var T=this;if(!A(Q)){for(var f in Q)this.on(f,q,w,Q[f],N);return this}if(!A(q))if(P(q)||x(q))q="";else if(P(w))w=q,q="";else O=w,w=q,q="";if(!h(O))O=w,w=void 0;if(!O)return this;return D(S(Q),function(l,I0){var G0=T1(I0),w0=G0[0],S0=G0[1],j0=E1(w0),a0=w0 in Z5,A1=w0 in P1;if(!j0)return;T.each(function($1,Y0){if(!$(Y0)&&!L(Y0)&&!R(Y0))return;var S1=function(q0){if(q0.target["___i".concat(q0.type)])return q0.stopImmediatePropagation();if(q0.namespace&&!W5(S0,q0.namespace.split(R1)))return;if(!q&&(A1&&(q0.target!==Y0||q0.___ot===j0)||a0&&q0.relatedTarget&&Y0.contains(q0.relatedTarget)))return;var b1=Y0;if(q){var h0=q0.target;while(!c1(h0,q)){if(h0===Y0)return;if(h0=h0.parentNode,!h0)return}b1=h0}Object.defineProperty(q0,"currentTarget",{configurable:!0,get:function(){return b1}}),Object.defineProperty(q0,"delegateTarget",{configurable:!0,get:function(){return Y0}}),Object.defineProperty(q0,"data",{configurable:!0,get:function(){return w}});var M8=O.call(b1,q0,q0.___td);if(N)n0(Y0,j0,S0,q,S1);if(M8===!1)q0.preventDefault(),q0.stopPropagation()};S1.guid=O.guid=O.guid||F.guid++,q8(Y0,j0,S0,q,S1)})}),this}M.on=z8;function B8(Q,q,w,O){return this.on(Q,q,w,O,!0)}M.one=B8;var U8=/\r?\n/g;function w8(Q,q){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(q.replace(U8,"\r\n")))}var Y8=/file|reset|submit|button|image/i,X5=/radio|checkbox/i;if(M.serialize=function(){var Q="";return this.each(function(q,w){D(w.elements||[w],function(O,N){if(N.disabled||!N.name||N.tagName==="FIELDSET"||Y8.test(N.type)||X5.test(N.type)&&!N.checked)return;var T=l1(N);if(!P(T)){var f=U(T)?T:[T];D(f,function(l,I0){Q+=w8(N.name,I0)})}})}),Q.slice(1)},typeof G5!=="undefined")q5.exports=F;else Z.cash=Z.$=F})()});class e0{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 J1{subscriptions=new Map;tick=new e0;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,G=(z)=>{if(typeof z.toJSON==="function")return z;if(z instanceof Map)z.forEach((U,B)=>z.set(B,X(U)));else if(Array.isArray(z))z.forEach((U,B)=>z[B]=X(U));else if(typeof z==="object")Object.entries(z).forEach(([U,B])=>z[U]=X(B));let Y=new Proxy(z,{get(U,B){if(B==="toJSON")return function(){const K=(g)=>{if(!g||typeof g!=="object")return g;if(H.has(g)){const u=H.get(g);if(u instanceof Map){const a={};return u.forEach((H0,n)=>a[typeof n==="object"?JSON.stringify(n):String(n)]=K(H0)),a}if(Array.isArray(u))return u.map((a)=>K(a));const e={};return Object.entries(u).forEach(([a,H0])=>e[a]=K(H0)),e}if(typeof g.toJSON==="function"&&!H.has(g))return g.toJSON();return g};return K(Y)};if(B==="reset")return function(){Y=null};const I=U[B];if(z instanceof Map&&typeof I==="function")return function(...K){const g=B.toString();if(g==="set"&&K.length>=2)K[1]=X(K[1]);const u=I.apply(U,K);return["set","delete","clear"].includes(g)&&W.queueUpdate(J),u};if(Array.isArray(z)&&typeof I==="function")return function(...K){const g=B.toString();if(["push","unshift"].includes(g))K=K.map((e)=>X(e));else if(g==="splice"&&K.length>2)K=[K[0],K[1],...K.slice(2).map((e)=>X(e))];const u=I.apply(U,K);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(g)&&W.queueUpdate(J),u};return I},set(U,B,I){if(U[B]===I)return!0;if(I instanceof Map&&U[B]instanceof Map){const K=U[B];return K.clear(),I.forEach((g,u)=>K.set(u,X(g))),W.queueUpdate(J),!0}return U[B]=X(I),W.queueUpdate(J),!0}});return H.set(Y,z),Y},X=(z)=>{if(!z)return z;return z instanceof Map||Array.isArray(z)||typeof z==="object"?G(z):z};return G(Z)}}class Z1{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 Q1=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(W,H)=>{return Z[H]!==void 0?Z[H].toString():`{${H}}`})},H5=(J,Z,W,H,G)=>{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 Y=W["*"];if(typeof Y==="object")Y=Y[G||"*"];return Q1(Y,H)}if(typeof H.count==="string")H.count=Number(H.count);let X="*";if(H.count.toString()in W)X=H.count.toString();let z=W[X]||W["*"];if(typeof z==="object")z=z[G||"*"];return Q1(z,H)}case"condition":{if(typeof W==="string"){console.warn("Condition format value cannot be a string");return}let X;for(let z in W)try{if(new Function("params",`with( params ){ return ${z}; }`)(H||{})){X=W[z];break}}catch(Y){console.warn(`Invalid <${Z}(${z})> condition expression`)}if(X===void 0)return;if(typeof X==="object")X=X[G||"*"];return Q1(X,H)}case"variable":default:{const X=typeof W==="object"?W[G||"*"]:W;if(typeof X==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return Q1(X,H)}}};class W1{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 G=this.DICTIONARIES[W][J];J=G[H||"*"]||G["*"]}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,G]=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 H5(X.type,J,X.value,Z,G)}}var T5=t0(c0(),1);var X1="comm",H1="rule",G1="decl";var z5="@import";var B5="@namespace",U5="@keyframes";var w5="@layer";function q1(J){return J.trim()}function f0(J,Z,W){return J.replace(Z,W)}function Y5(J,Z,W){return J.indexOf(Z,W)}function C0(J,Z){return J.charCodeAt(Z)|0}function R0(J,Z,W){return J.slice(Z,W)}function B0(J){return J.length}function z1(J){return J.length}function _0(J,Z){return Z.push(J),J}var x1=Math.abs,p0=String.fromCharCode;function U1(J,Z,W,H,G,X,z,Y){return{value:J,root:Z,parent:W,type:H,props:G,children:X,line:B1,column:y0,length:z,return:"",siblings:Y}}function K5(){return X0}function O5(){if(X0=K0>0?C0(u0,--K0):0,y0--,X0===10)y0=1,B1--;return X0}function O0(){if(X0=K0<M5?C0(u0,K0++):0,y0++,X0===10)y0=1,B1++;return X0}function P0(){return C0(u0,K0)}function s0(){return K0}function w1(J,Z){return R0(u0,J,Z)}function v0(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 B1=y0=1,M5=B0(u0=J),K0=0,[]}function j5(J){return u0="",J}function Y1(J){return q1(w1(K0-1,k1(J===91?J+2:J===40?J+1:J)))}function D5(J){while(X0=P0())if(X0<33)O0();else break;return v0(J)>2||v0(X0)>3?"":" "}function F5(J,Z){while(--Z&&O0())if(X0<48||X0>102||X0>57&&X0<65||X0>70&&X0<97)break;return w1(J,s0()+(Z<6&&P0()==32&&O0()==32))}function k1(J){while(O0())switch(X0){case J:return K0;case 34:case 39:if(J!==34&&J!==39)k1(X0);break;case 40:if(J===41)k1(J);break;case 92:O0();break}return K0}function L5(J,Z){while(O0())if(J+X0===57)break;else if(J+X0===84&&P0()===47)break;return"/*"+w1(Z,K0-1)+"*"+p0(J===47?J:O0())}function V5(J){while(!v0(P0()))O0();return w1(J,K0)}var B1=1,y0=1,M5=0,K0=0,X0=0,u0="";function R5(J){return j5(M1("",null,null,null,[""],J=I5(J),0,[0],J))}function M1(J,Z,W,H,G,X,z,Y,U){var B=0,I=0,K=z,g=0,u=0,e=0,a=1,H0=1,n=1,m=0,y="",c=G,p=X,J0=H,v=y;while(H0)switch(e=m,m=O0()){case 40:if(e!=108&&C0(v,K-1)==58){if(Y5(v+=f0(Y1(m),"&","&\f"),"&\f",x1(B?Y[B-1]:0))!=-1)n=-1;break}case 34:case 39:case 91:v+=Y1(m);break;case 9:case 10:case 13:case 32:v+=D5(e);break;case 92:v+=F5(s0()-1,7);continue;case 47:switch(P0()){case 42:case 47:if(_0(L8(L5(O0(),s0()),Z,W,U),U),(v0(e||1)==5||v0(P0()||1)==5)&&B0(v)&&R0(v,-1,void 0)!==" ")v+=" ";break;default:v+="/"}break;case 123*a:Y[B++]=B0(v)*n;case 125*a:case 59:case 0:switch(m){case 0:case 125:H0=0;case 59+I:if(n==-1)v=f0(v,/\f/g,"");if(u>0&&(B0(v)-K||a===0&&e===47))_0(u>32?C5(v+";",H,W,K-1,U):C5(f0(v," ","")+";",H,W,K-2,U),U);break;case 59:v+=";";default:if(_0(J0=N5(v,Z,W,B,I,G,Y,y,c=[],p=[],K,X),X),m===123)if(I===0)M1(v,Z,J0,J0,c,X,K,Y,p);else{switch(g){case 99:if(C0(v,3)===110)break;case 108:if(C0(v,2)===97)break;default:I=0;case 100:case 109:case 115:}if(I)M1(J,J0,J0,H&&_0(N5(J,J0,J0,0,0,G,Y,y,G,c=[],K,p),p),G,p,K,Y,H?c:p);else M1(v,J0,J0,J0,[""],p,0,Y,p)}}B=I=u=0,a=n=1,y=v="",K=z;break;case 58:K=1+B0(v),u=e;default:if(a<1){if(m==123)--a;else if(m==125&&a++==0&&O5()==125)continue}switch(v+=p0(m),m*a){case 38:n=I>0?1:(v+="\f",-1);break;case 44:Y[B++]=(B0(v)-1)*n,n=1;break;case 64:if(P0()===45)v+=Y1(O0());g=P0(),I=K=B0(y=v+=V5(s0())),m++;break;case 45:if(e===45&&B0(v)==2)a=0}}return X}function N5(J,Z,W,H,G,X,z,Y,U,B,I,K){var g=G-1,u=G===0?X:[""],e=z1(u);for(var a=0,H0=0,n=0;a<H;++a)for(var m=0,y=R0(J,g+1,g=x1(H0=z[a])),c=J;m<e;++m)if(c=q1(H0>0?u[m]+" "+y:f0(y,/&\f/g,u[m])))U[n++]=c;return U1(J,Z,W,G===0?H1:Y,U,B,I,K)}function L8(J,Z,W,H){return U1(J,Z,W,X1,p0(K5()),R0(J,2,-2),0,H)}function C5(J,Z,W,H,G){return U1(J,Z,W,G1,R0(J,0,H),R0(J,H+1,-1),H,G)}function K1(J,Z){var W="";for(var H=0;H<J.length;H++)W+=Z(J[H],H,J,Z)||"";return W}function P5(J,Z,W,H){switch(J.type){case w5:if(J.children.length)break;case z5:case B5:case G1:return J.return=J.return||J.value;case X1:return"";case U5:return J.return=J.value+"{"+K1(J.children,H)+"}";case H1:if(!B0(J.value=J.props.join(",")))return""}return B0(W=K1(J.children,H))?J.return=J.value+"{"+W+"}":""}function E5(J){var Z=z1(J);return function(W,H,G,X){var z="";for(var Y=0;Y<Z;Y++)z+=J[Y](W,H,G,X)||"";return z}}class m0{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 K1(R5(J),E5([P5]))}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 G=0;const X=this.$head.find(`style[${Z}]`);if(X.length)G=parseInt(X.attr("dindex"))+1,X.remove();return H.setAttribute("dindex",String(G)),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 O1{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 G=this.component.FGUDMemory.get(H.nodepath);if(!G)return;const X=H.update(G.memo||{},W);if(X){if(typeof X.memo==="object")G.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,G)=>J.set(G,new Set(H))),this.pending.clear(),this.isPending=!1;const Z=(H)=>{const G=Array.from(H);this.component.metrics.trackBatch(G.length),this.metrics.batchCount++,this.metrics.lastBatchSize=G.length,this.metrics.updatesProcessed+=G.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),G.forEach((X)=>this.apply(X))},W=Array.from(J.keys()).sort((H,G)=>H-G);for(let H of W){const G=J.get(H);G&&G.size&&Z(G)}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 I1{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=(G)=>{if(typeof G.toJSON==="function")return G.toJSON();if(Array.isArray(G))return G.map(W);if(typeof G==="object")for(let X in G)G[X]=W(G[X]);return G},H=Z.map(W);this.__events[J]?.forEach((G)=>G(...H)),this.__once_events[J]?.forEach((G)=>G(...H)),delete this.__once_events[J]}}var h1=t0(c0(),1);function z0(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(A5(J)&&A5(Z)){for(let z of J)if(!Z.has(z))return!0;return!1}const X=new WeakMap;for(let z of J){let Y=!1;if(typeof z!=="object"){if(Z.has(z))Y=!0}else for(let U of Z){if(typeof U!=="object")continue;if(!X.has(z))X.set(z,new WeakMap);const B=X.get(z);if(B.has(U)){if(Y=B.get(U),Y)break;continue}const I=!z0(z,U);if(B.set(U,I),I){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[z,Y]of J)if(Z.get(z)!==Y)return!0;return!1}const X=new WeakMap;for(let[z,Y]of J){if(typeof z!=="object"){if(!Z.has(z))return!0;const I=Z.get(z);if(typeof Y!=="object"){if(Y!==I)return!0;continue}if(typeof I!=="object"||z0(Y,I))return!0;continue}let U=!1,B=!1;for(let[I,K]of Z){if(typeof I!=="object")continue;if(!X.has(z))X.set(z,new WeakMap);const g=X.get(z);if(g.has(I)){const[u,e]=g.get(I);if(u){U=!0,B=e;break}continue}if(!z0(z,I)){if(U=!0,B=typeof Y==="object"&&typeof K==="object"?!z0(Y,K):Y===K,g.set(I,[!0,B]),B)break}else g.set(I,[!1,!1])}if(!U||!B)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 z=J[X],Y=Z[X];if(z!==Y&&(typeof z!=="object"||z0(z,Y)))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 G=W.length;for(let X=0;X<G;X++)if(W[X]!==H[X])return!0;for(let X=0;X<G;X++){const z=W[X],Y=J[z],U=Z[z];if(Y===U)continue;if(Y instanceof Date){if(!(U instanceof Date)||String(Y)!==String(U))return!0;continue}if(Y instanceof RegExp){if(!(U instanceof RegExp)||Y.source!==U.source||Y.flags!==U.flags)return!0;continue}if(Y instanceof Map){if(!(U instanceof Map)||z0(Y,U))return!0;continue}if(Y instanceof Set){if(!(U instanceof Set)||z0(Y,U))return!0;continue}if(Y instanceof Function){if(!(U instanceof Function))return!0;continue}if(typeof Y==="object"){if(typeof U!=="object")return!0;if(Y===J){if(U!==Z)return!0}else if(z0(Y,U))return!0}else return!0}return!1}function U0(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 Y=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),U=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let B=0;B<Y.length;B++)if(Y[B]!==U[B])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!z0(J,Z);const G=Object.getPrototypeOf(J);if(G!==Object.getPrototypeOf(Z))return!1;const X=Object.getOwnPropertyNames(J),z=Object.getOwnPropertyNames(Z);if(X.length!==z.length)return!1;for(let Y of X){if(!Object.prototype.hasOwnProperty.call(Z,Y))return!1;if(!U0(J[Y],Z[Y]))return!1}if(G!==null&&G!==Object.prototype){const Y=Object.getOwnPropertyNames(G),U=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(Y.length!==U.length)return!1;for(let B of Y){if(B==="constructor")continue;if(!U0(G[B],Object.getPrototypeOf(Z)[B]))return!1}}return!0}function A5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function $5(J){for(let[Z,W]of J)if(typeof Z==="object"&&Z!==null||typeof W==="object"&&W!==null)return!1;return!0}function W0(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 G=new Map;return Z.set(J,G),J.forEach((X,z)=>G.set(W0(z,Z),W0(X,Z))),G}if(J instanceof Set){const G=new Set;return Z.set(J,G),J.forEach((X)=>G.add(W0(X,Z))),G}if(Array.isArray(J)){const G=[];Z.set(J,G);for(let X=0;X<J.length;X++)G[X]=W0(J[X],Z);return G}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 G of H)W[G]=W0(J[G],Z);for(let G in J)if(Object.prototype.hasOwnProperty.call(J,G))W[G]=W0(J[G],Z);return W}function _5(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(G,X,z){const Y=X.split(/\.|\[|\]/).filter(Boolean);let U=G;for(let B=0;B<Y.length;B++){const I=Y[B],K=!isNaN(Number(I)),g=B===Y.length-1,u=!isNaN(Number(Y[B+1]));if(g){U[I]=z;continue}if(!(I in U))U[I]=u?[]:{};else if(u&&!Array.isArray(U[I]))U[I]=[];else if(!u&&Array.isArray(U[I]))U[I]={};U=U[I]}}const H=W0(J);try{for(let[G,X]of Object.entries(Z)){if(typeof G!=="string")throw new TypeError(`Invalid path: ${G}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(G))throw new Error(`Invalid path format: ${G}`);W(H,G,X)}}catch(G){throw new Error(`Failed to assign value: ${G.message}`)}return H}function D1(J){return JSON.parse(JSON.stringify(J))}var $0="i18n",E0="syn:",D0="fn:",b0="on-",M0=/^\.\.\./,j1=/^\[(.*?)\]$/,f1=/{\s*([^{}]+)\s*}/g,S5=["@html","@text","@format"],b5=["display","visibility","position","width","height"],g5=":n",_1=":pr",x5="m",k5="c",h5="x",l0="*",f5=100;h1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&h1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class F1{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=W0(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},G={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},X={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},z={"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(G),console.table(X),console.table(z),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 W0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var Q0=t0(c0(),1);var V8=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let W=J,H;while((H=Z.exec(J))!==null){const G=H[1],X=H.index+H[0].length;let z=1,Y=X;while(Y<J.length&&z>0){if(J[Y]==="(")z++;if(J[Y]===")")z--;Y++}if(z===0){const U=J.slice(X,Y-1).trim(),B=J.slice(0,H.index),I=`${b0}${G}="${U}"`,K=J.slice(Y);W=B+I+K,J=W,Z.lastIndex=B.length+I.length}}return W},N8=function(J){const Z=[];let H=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(G,X,z)=>{return Z.push(z),`<${X}##TAG_ATTRS_${Z.length-1}##>`});for(let G=0;G<Z.length;G++){const X=`##TAG_ATTRS_${G}##`,z=Z[G],Y=C8(z);H=H.replace(X,Y)}return H},C8=function(J){let Z="",W=0,H=!1,G="",X=0,z=0,Y=0;while(W<J.length){const U=J[W];if((U==='"'||U==="'")&&(W===0||J[W-1]!=="\\")){if(!H)H=!0,G=U;else if(U===G)H=!1}if(!H){if(U==="(")z++;else if(U===")")z--;else if(U==="{")Y++;else if(U==="}")Y--}if(!H&&z===0&&Y===0&&(U===" "||W===J.length-1)){let B=W;if(W===J.length-1)B=W+1;const I=J.substring(X,B).trim();if(I){const K=R8(I);Z+=" "+K}X=W+1}W++}return Z},R8=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===$0||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=!S5.includes(W)?W.slice(1):W,`:${W}=${H}`;if(W.startsWith(D0)||W.startsWith(b0))return J;if(H.startsWith('"')&&H.endsWith('"')||H.startsWith("'")&&H.endsWith("'")){const G=H.substring(1,H.length-1);if(P8(G))return`:${W}="${G}"`;return J}else return`:${W}="${H}"`};function P8(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 y1(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,G)=>{return G.endsWith("<")?`<lips dtag="${H}" ${G}/lips>`:`<lips dtag="${H}" ${G}></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 ${D0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Z=V8(Z),Z=N8(Z),Z}var E8=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},v5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function g0(J,Z={maxSize:100}){const W=new Set,H=[{value:J,timestamp:Date.now()}];let G=0;const X=()=>{const B=L1[L1.length-1];return B&&E8(B,W),H[G].value},z=()=>{const B=[...W];if(y5)for(let I of B)y5.add(I);else for(let I of B)I.execute()};return[X,(B,I)=>{if(Object.is(H[G].value,B))return;if(G<H.length-1)H.splice(G+1);if(H.push({value:B,timestamp:Date.now(),metadata:I}),H.length>Z.maxSize)H.shift(),G=Math.max(0,G-1);else G++;z()},{undo(){if(G>0)G--,z()},redo(){if(G<H.length-1)G++,z()},jumpTo(B){if(B>=0&&B<H.length&&B!==G)G=B,z()},getHistory(){return[...H]},getCurrentIndex(){return G},canUndo(){return G>0},canRedo(){return G<H.length-1},clear(){const B=H[0];H.length=0,H.push(B),G=0,z()}}]}function o0(J){let Z=!1;const W=()=>{if(Z)throw new Error("Circular dependency detected");if(H.isDisposed)return;Z=!0,v5(H),L1.push(H);try{J()}finally{Z=!1,L1.pop()}},H={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{H.isDisposed=!0,v5(H)}}}var L1=[],y5=null;class x0 extends I1{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:G,_static:X,handler:z,stylesheet:Y,macros:U,declaration:B},I){super();if(this.lips=I.lips,I?.debug)this.debug=I.debug||this.lips.debug;if(I?.prepath)this.prepath=I.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=this.__inpath__=`${this.prepath}:${this.__name__}`,this.__template__=y1(Z),this.__boundaries__=I.boundaries,this.declaration=B||{name:J},this.input=W||{},this.static=X||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,H||{}),U&&this.setMacros(U),z&&this.setHandler(z),Y&&this.setStylesheet(Y),this.metrics=new F1(this.debug),this.metrics.inc("componentCount"),this.UQS=new O1(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:W0(this.state),input:W0(this.input),context:W0(this.context)};const[K,g]=g0(this.input),[u,e]=g0(this.state),[a,H0]=g0(this.context);this.__setInput=g,this.__setState=e,this.__getState=u,this.lips.IUC.register(this.__path__,()=>{z0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(G)&&G.length&&this.lips.useContext(G,(n)=>{if(!z0(this.context,n))return;H0(n),this.context=n,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context")}),this.lips.useTranslator("*",(n)=>{if(n===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=n}),this.ICE=o0(()=>{const n=u(),m=this.input=K(),y=this.context=a();if(!this.isRendered){if(this.metrics.reset(),!this.__template__.length||B?.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||Q0.default()}else{const{$log:c}=this.render("",void 0,void 0,this.FGUD);this.$=c}!B?.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:W0(m),state:W0(n),context:W0(y)};typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render")})}setContext(J,Z){this.lips.setContext(J,Z)}setInput(J,Z){if(!z0(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(_5(this.input,J),this.declaration.syntax?Z:void 0),this}setMacros(J){const Z=y1(J),W=Q0.default(Z);if(!W.length)return;const H=this;W.each(function(){const G=Q0.default(this),{argv:X,attrs:z}=H.__getAttributes__(G);if(!Object.keys(z))throw new Error("Invalid macro component definition");if(!z.literals.name)throw new Error("Undefined macro `name` attribute.");if(H.__macros.get(z.literals.name))console.warn(`Duplicate macro <${z.literals.name}> will be override`);if(!G.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");H.__macros.set(z.literals.name,{argv:X,$node:G})})}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 m0(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,G){if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:H||new Map};const X=this,z=H||new Map,Y=[];this.metrics.startRender();let U=Q0.default();function B(){return W0(W)}function I(M,F=!1){const j=K(M,F);return X.__inpathCounter__++,X.__inpath__?`${X.__inpath__}/${j}`:`${J?J+"/":""}${j}`}function K(M,F=!1){let j="";switch(M){case"component":j=F?h5:k5;break;case"macro":j=x5;break}return j+X.__inpathCounter__}function g(M){return M!==null&&typeof M==="object"&&typeof M.mesh==="function"&&typeof M.update==="function"}function u(M){return M!==null&&typeof M==="object"&&typeof M.default&&typeof M.default==="string"}function e(M){if(!M.attr(":dtag")||M.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const F=M.attr(":dtag"),j=X.__evaluate__(F,W);if(g(j)||j===null)return m(M,F,j);else if(u(j))return y(M,{template:j});else return y(M,{name:j})}function a(M){const F=M.attr(":args"),j=I("log");if(!F)return;const R=B();if(X.__evaluate__(`console.log(${F})`,R),X.__isReactive__(F,R))X.__extractExpressionDeps__(F,R).forEach((C)=>X.__trackDep__(z,C,R,{nodetype:"log",nodepath:j,target:"argument",$fragment:null,update:($)=>X.__evaluate__(`console.log(${F})`,$),syntax:!0}))}function H0(M){const F=I("var"),{attrs:j}=X.__getAttributes__(M);if(!j)return;Object.entries(j.literals).forEach(([R,L])=>{if(W[R]&&W[R].type==="const")throw new Error(`Cannot override <const ${R}=[value]/> variable`);W[R]={value:L,type:"let"}}),Object.entries(j.expressions).forEach(([R,L])=>{if(W[R]&&W[R].type==="const")throw new Error(`Cannot override <const ${R}=[value]/> variable`);if(W[R]={value:X.__evaluate__(L,W),type:"let"},X.__isReactive__(L,W)){const C=X.__extractExpressionDeps__(L,W),$=(_,d)=>{if(_[R]&&_[R].type==="const")throw new Error(`Cannot override <const ${R}=[value]/> variable`);if(j.map.beforeSpreadAttrs.includes(R))return;const h=X.__evaluate__(L,_);if(U0(_[R].value,h))return;return _[R]={value:h,type:"let"},X.__updateVarDepNodes__(R,F,_),D1({memo:_})};C.forEach((_)=>X.__trackDep__(z,_,B(),{nodetype:"let",nodepath:F,deppath:`${F}.${R}`,target:"attr",$fragment:null,update:$,syntax:!0}))}}),X.metrics.inc("elementCount")}function n(M){const{attrs:F}=X.__getAttributes__(M);if(!F)return;Object.entries(F.literals).forEach(([j,R])=>{if(W[j]&&W[j].type==="const")throw new Error(`<const ${j}=[value]/> variable already defined`);if(!R)return;W[j]={value:R,type:"const"}}),Object.entries(F.expressions).forEach(([j,R])=>{if(W[j]&&W[j].type==="const")throw new Error(`<const ${j}=[value]/> variable already defined`);if(!R)return;W[j]={value:X.__evaluate__(R,W),type:"const"}}),X.metrics.inc("elementCount")}function m(M,F,j){const{attrs:R}=X.__getAttributes__(M),L=I("element"),C=X.__getBoundaries__(L),$={},_={};let d=B(),h=Q0.default(C.start),A={},P=j;if(P){R.literals&&Object.entries(R.literals).forEach(([E,k])=>{$[E]=k,A[E]={type:"arg",value:k}}),R.expressions&&Object.entries(R.expressions).forEach(([E,k])=>{if(!P)return;if(M0.test(E))X.__evaluateSpreadAttr__(E,{memo:d,get keystore(){return _[E]},set keystore(D){if(!_[E])_[E]=[];_[E]=D},each:(D,b)=>{if($[D]=b,!P?.argv.includes(D))return;A[D]={type:"arg",value:b}}});else{const D=k?X.__evaluate__(k,d):!0;if($[E]=D,!P.argv.includes(E))return;A[E]={type:"arg",value:D}}}),d.__arguments__=$;const x=P.mesh(A);if(x&&x.length)h=h.add(x);R.expressions&&Object.entries(R.expressions).forEach(([E,k])=>{if(!P)return;if(M0.test(E)&&X.__isReactive__(E,d)){const D=X.__extractExpressionDeps__(E,d),b=(V,S)=>{if(!P)return;const t={};let r=[];if(X.__evaluateSpreadAttr__(E,{memo:V,get keystore(){return _[E]},set keystore(i){if(!_[E])_[E]=[];_[E]=i},each:(i,s)=>{if(R.map.afterSpreadAttrs.includes(i))return;if(!P?.argv.includes(i))return;if(U0(s,V[i]?.value))return;A[i]=t[i]={value:s,type:"arg"},$[i]=s,r.push(i)},nullify:(i)=>{i.forEach((s)=>{t[s]={value:void 0,type:"arg"},delete $[s]}),r=i}}),r.length)P.argv.length&&X.__updateArgumentsDepNodes__(L,$),P.update(r,t,V,C)};D.forEach((V)=>X.__trackDep__(z,V,d,{nodetype:"dynamic",nodepath:L,deppath:`${L}.${E}`,target:"spread-attr",$fragment:null,boundaries:C,update:b}))}else if(P.argv.includes(E)&&X.__isReactive__(k,d)){const D=X.__extractExpressionDeps__(k,d),b=(V,S)=>{if(!P)return;if(R.map.beforeSpreadAttrs.includes(E))return;const t=k?X.__evaluate__(k,V):!0,r={type:"arg",value:t};if(A[E]=r,P.argv.length)$[E]=t,X.__updateArgumentsDepNodes__(L,$);P.update([E],{[E]:r},V,C)};D.forEach((V)=>X.__trackDep__(z,V,d,{nodetype:"dynamic",nodepath:L,deppath:`${L}.${E}`,target:"attr",$fragment:null,boundaries:C,update:b}))}})}if(X.__isReactive__(F,d)){const x=(k,D)=>{const b=X.__evaluate__(F,k);let V;if(u(b))V=y(M,{template:b}),X.__fillBoundaries__(V,C);else if(g(b)){if(Object.entries(A).forEach(([S,t])=>{if(typeof t==="function")return;$[S]=t.value}),P?.cleanup(C),P=b,P)P.argv.length&&X.__updateArgumentsDepNodes__(L,$),V=P.mesh(A),V?.length&&P.fill(V,C)}else if(P)P.cleanup(C),P=null};X.__extractExpressionDeps__(F,d).forEach((k)=>X.__trackDep__(z,k,{...d,...A},{nodetype:"dynamic",nodepath:L,deppath:`${L}.dtag`,target:"dtag",$fragment:null,boundaries:C,update:x}))}return h=h.add(C.end),h}function y(M,F){let j,R;if(F?.template)j=F.template,R=K("component",j.declaration?.syntax);else{if(R=F?.name||M.prop("tagName")?.toLowerCase(),!R)throw new Error("Invalid component");if(R===X.__name__)throw new Error("Render component within itself is forbidden");j=X.lips.import(R)}if(!j||!R)throw new Error(`<${R}> template not found`);const L=I("component",j.declaration?.syntax),C=X.__getBoundaries__(L),{argv:$,functions:_,attrs:d,events:h}=X.__getAttributes__(M),A={},P={};let x={},E=Q0.default(C.start),k=X.PCC.get(L),D=B();d.literals&&Object.entries(d.literals).forEach(([V,S])=>{if(V=="key")return;x[V]=S}),_&&Object.entries(_).forEach(([V,S])=>{x[V]=X.__evaluateFunction__(S,[],D),j.declaration?.syntax?A[E0+D0+V]=S:A[D0+V]=S}),d.expressions&&Object.entries(d.expressions).forEach(([V,S])=>{if(V=="key")return;if(M0.test(V))X.__evaluateSpreadAttr__(V,{memo:D,get keystore(){return P[V]},set keystore(t){if(!P[V])P[V]=[];P[V]=t},each:(t,r)=>x[t]=r});else x[V]=S?X.__evaluate__(S,D):!0;j.declaration?.syntax?A[E0+V]=S:A[V]=S});const b=M.contents();if(b.length){if(x={...x,...X.__meshwire__({$node:M,fragmentPath:L,fragmentBoundaries:C,meshPath:null,scope:D,argv:$,xmlns:G,useAttributes:!0,declaration:j.declaration},A)},j.declaration){if(j.declaration.tags){let V;Object.entries(j.declaration?.tags).forEach(([S,{type:t,many:r,alts:i}])=>{switch(t){case"nexted":{let s=M.next(S);if(!s.length&&Array.isArray(i)&&V?.length&&V.is(i.join(",")))s=V.next(S);if(!s.length)return;if(r){x[S]=[];let o=0,Z0=!1;while(!Z0){if(x[S].push(X.__meshwire__({$node:s,meshPath:`${S}[${o}]`,fragmentPath:L,fragmentBoundaries:C,scope:D,argv:$,xmlns:G,useAttributes:!0,declaration:j.declaration},A)),!s.next(S).length){Z0=!0;break}s=V=s.next(S),o++}}else x[S]=X.__meshwire__({$node:s,meshPath:S,fragmentPath:L,fragmentBoundaries:C,scope:D,argv:$,xmlns:G,useAttributes:!0,declaration:j.declaration},A)}break;case"child":{const s=M.children(S);if(r)x[S]=[],s.each(function(o){const Z0=Q0.default(this),{argv:F0}=X.__getAttributes__(Z0);x[S].push(X.__meshwire__({$node:Z0,meshPath:`${S}[${o}]`,fragmentPath:L,fragmentBoundaries:C,scope:D,argv:F0,xmlns:G,useAttributes:!0,declaration:j.declaration},A))});else if(M.children(S).first().length){const o=M.children(S).first(),{argv:Z0}=X.__getAttributes__(o);x[S]=X.__meshwire__({$node:o,meshPath:S,fragmentPath:L,fragmentBoundaries:C,scope:D,argv:Z0,xmlns:G,useAttributes:!0,declaration:j.declaration},A)}}break}})}else if(j.declaration.contents)x.__contents__=b}}if(k)k.setInput(W0(x)),E=E.add(k.node);else{const{declaration:V,state:S,_static:t,handler:r,context:i,default:s,stylesheet:o}=j;k=new x0(R,s||"",{state:W0(S),input:W0(x),context:i,_static:W0(t),handler:r,stylesheet:o,declaration:V},{debug:X.debug,lips:X.lips,prepath:L,boundaries:C}),E=E.add(k.node),!j.declaration?.syntax&&X.PCC.set(L,k)}return E=E.add(C.end),Object.entries(h).forEach(([V,S])=>{X.__attachEvent__({nodepath:L,element:k,_event:V,instruction:S,scope:D,get __dependencies__(){return z}})}),A&&Object.entries(A).forEach(([V,S])=>{let t=!1,r=!1;if(V.startsWith(E0))t=!0,V=V.replace(E0,"");if(V.startsWith(D0))r=!0,V=V.replace(D0,"");if(M0.test(V)){if(X.__isReactive__(V,D)){const i=(o)=>{const Z0={};X.__evaluateSpreadAttr__(V,{memo:o,get keystore(){return P[V]},set keystore(F0){if(!P[V])P[V]=[];P[V]=F0},each:(F0,k0)=>{if(d.map.afterSpreadAttrs.includes(F0))return;Z0[F0]=k0},nullify:(F0)=>F0.forEach((k0)=>Z0[k0]=void 0)}),k?.subInput(Z0,o)};X.__extractExpressionDeps__(V,D).forEach((o)=>X.__trackDep__(z,o,D,{nodetype:"component",nodepath:L,deppath:`${L}.${V}`,target:"spread-attr",$fragment:null,boundaries:C,update:i,syntax:t}))}}else if(X.__isReactive__(S,D)){const i=(o)=>{if(d.map.beforeSpreadAttrs.includes(V))return;const Z0=r?X.__evaluateFunction__(S,[],o):S?X.__evaluate__(S,o):!0;k?.subInput({[V]:Z0},o)};X.__extractExpressionDeps__(S,D).forEach((o)=>X.__trackDep__(z,o,D,{nodetype:"component",nodepath:L,deppath:`${L}.${V}`,target:"attr",$fragment:null,boundaries:C,update:i,syntax:t}))}}),X.metrics.inc("componentCount"),E}function c(M){const F=M.prop("tagName")?.toLowerCase();if(!F)throw new Error("Invalid macro rendering call");const j=X.__macros.get(F);if(!j)throw new Error("Macro component not found");const R=I("macro"),L=X.__getBoundaries__(R),{attrs:C}=X.__getAttributes__(M),$={},_=B(),d={},h={};C.literals&&Object.entries(C.literals).forEach(([D,b])=>{d[D]=b,h[D]={value:b,type:"arg"}});const A={};C.expressions&&Object.entries(C.expressions).forEach(([D,b])=>{if(M0.test(D))X.__evaluateSpreadAttr__(D,{memo:_,get keystore(){return A[D]},set keystore(V){if(!A[D])A[D]=[];A[D]=V},each:(V,S)=>{if(d[V]=S,j.argv.includes(V))h[V]={value:S,type:"arg"}}}),$[D]=b;else{const V=b?X.__evaluate__(b,_):!0;if(d[D]=V,j.argv.includes(D))h[D]={value:V,type:"arg"},$[D]=b}j.argv.forEach((V)=>{if(h[V]!==void 0)return;h[V]={value:!1,type:"arg"}})}),h.__arguments__=d;let P=Q0.default(L.start);const x={$node:j.$node,meshPath:null,fragmentPath:R,fragmentBoundaries:L,argv:j.argv,scope:_,xmlns:G,useAttributes:!0},E=X.__meshwire__(x,$),k=E.renderer.mesh(h,_);return P=P.add(k),$&&Object.entries($).forEach(([D,b])=>{let V=!1;if(new RegExp(`^${E0}`).test(D))V=!0,D=D.replace(E0,"");if(M0.test(D)){if(!X.__isReactive__(D,_))return;const S=X.__extractExpressionDeps__(D,_),t=(r)=>{const i={};let s=[];if(X.__evaluateSpreadAttr__(D,{memo:r,get keystore(){return A[D]},set keystore(o){if(!A[D])A[D]=[];A[D]=o},each:(o,Z0)=>{if(C.map.afterSpreadAttrs.includes(o))return;if(U0(Z0,r[o]?.value))return;i[o]={value:Z0,type:"arg"},d[o]=Z0,s.push(o)},nullify:(o)=>{o.forEach((Z0)=>{i[Z0]={value:void 0,type:"arg"},delete d[Z0]}),s=o}}),s.length)X.__updateArgumentsDepNodes__(R,d),E.renderer.update(s,i,r);return D1({memo:{...r,...i}})};S.forEach((r)=>X.__trackDep__(z,r,{..._,...h},{nodetype:"macro",nodepath:R,deppath:`${R}.${D}`,target:"spread-attr",$fragment:null,boundaries:L,update:t,syntax:V}))}else if(X.__isReactive__(b,_)){const S=X.__extractExpressionDeps__(b,_),t=(r)=>{if(C.map.beforeSpreadAttrs.includes(D))return;const i=b?X.__evaluate__(b,r):!0;return d[D]=i,X.__updateArgumentsDepNodes__(R,d),E.renderer.update([D],{[D]:{value:i,type:"arg"}},r),D1({memo:r})};S.forEach((r)=>X.__trackDep__(z,r,{..._,...h},{nodetype:"macro",nodepath:R,deppath:`${R}.${D}`,target:"attr",$fragment:null,boundaries:L,update:t,syntax:V}))}}),P=P.add(L.end),X.metrics.inc("elementCount"),P}function p(M){if(!M.length||!M.prop("tagName"))return M;const F=M.is("svg")||G,j=F?Q0.default(document.createElementNS("http://www.w3.org/2000/svg",M.prop("tagName").toLowerCase())):Q0.default(`<${M.prop("tagName").toLowerCase()}/>`),R=M.contents(),L=I("element"),C=B();R.length&&j.append(X.__withPath__(L,()=>X.render(L+g5,R,C,z,F).$log));const{attrs:$,events:_}=X.__getAttributes__(M);$.literals&&Object.entries($.literals).forEach(([h,A])=>{if(h===$0)return;const P=M.is(`[${$0}]`)&&["title","placeholder"].includes(h);j.attr(h,P?X.lips.i18n.translate(A).text:A);const x=(E)=>{j.attr(h,P?X.lips.i18n.translate(A).text:A),P&&X.__trackTranslationDep__(E,{nodetype:"element",nodepath:L,deppath:`${L}.${h}`,target:"attr",$fragment:j,update:x})};P&&X.__trackTranslationDep__(C,{nodetype:"element",nodepath:L,deppath:`${L}.${h}`,target:"attr",$fragment:j,update:x})});const d=(h,A=!1)=>{h&&Object.entries(h).forEach(([P,x])=>{switch(P){case"@html":{const E=(k)=>{j.html(X.__evaluate__(x,k))};if(E(C),A&&X.__isReactive__(x,C))X.__extractExpressionDeps__(x,C).forEach((D)=>X.__trackDep__(z,D,C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:j,update:E}))}break;case"@text":{const E=M.is(`[${$0}]`),k=(D)=>{j.text(X.__evaluate__(x,D,{translate:E})),E&&X.__trackTranslationDep__(D,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:j,update:k})};if(k(C),A&&X.__isReactive__(x,C))X.__extractExpressionDeps__(x,C).forEach((b)=>X.__trackDep__(z,b,C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:j,update:k}));E&&X.__trackTranslationDep__(C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:j,update:k})}break;case"@format":{const[E,k]=x.split(",").map((b)=>b.trim());if(!E)throw new Error("Invalid @format reference");if(!k)throw new Error("Invalid @format parameters");const D=(b)=>{const V=X.__evaluate__(`!${k.trim()}`,b);if(typeof V!=="object")throw new Error("Invalid @format parameters");const S=X.lips.i18n.format(E,V);S!==void 0&&j.text(S),X.__trackTranslationDep__(b,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:j,update:D})};D(C),X.__extractExpressionDeps__(k,C).forEach((b)=>X.__trackDep__(z,b,C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:j,update:D}))}break;case"style":if(A&&X.__isReactive__(x,C)){const E=(D)=>{const b=X.__evaluate__(x,D);if(typeof b==="object"){let V="";Object.entries(b).forEach(([S,t])=>V+=`${S}:${t};`),V.length&&j.attr("style",V)}else j.attr("style",b)};E(C),X.__extractExpressionDeps__(x,C).forEach((D)=>X.__trackDep__(z,D,C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"attr",$fragment:j,update:E}))}else j.attr("style",x);break;default:{const E=M.is(`[${$0}]`)&&["title","placeholder"].includes(P),k=(D)=>{const b=x&&X.__isReactive__(x,C)?X.__evaluate__(x,D,{translate:E}):x!==void 0?x:!0;if(b===void 0||b===!1)j.removeAttr(P);else j.attr(P,b),E&&X.__trackTranslationDep__(D,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"attr",$fragment:j,update:k})};if(k(C),A&&X.__isReactive__(x,C))X.__extractExpressionDeps__(x,C).forEach((b)=>X.__trackDep__(z,b,C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"attr",$fragment:j,update:k}));E&&X.__trackTranslationDep__(C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"attr",$fragment:j,update:k})}}})};return $.expressions&&Object.keys($.expressions).forEach((h)=>{if(!M0.test(h))return;let A=[];const P=(x,E,k=!1)=>{const D={};X.__evaluateSpreadAttr__(h,{memo:x,get keystore(){return A},set keystore(b){A=b},each:(b,V)=>{if(!k&&$.map.afterSpreadAttrs.includes(b))return;D[b]=V},nullify:(b)=>b.forEach((V)=>j.removeAttr(V))}),Object.keys(D).length&&d(D)};if(delete $.expressions[h],P(C,"",!0),h&&X.__isReactive__(h,C))X.__extractExpressionDeps__(h,C).forEach((E)=>X.__trackDep__(z,E,C,{nodetype:"element",nodepath:L,deppath:`${L}.${h}`,target:"spread-attr",$fragment:j,update:P}))}),d($.expressions,!0),_&&Object.entries(_).forEach(([h,A])=>{Y.push({nodepath:L,element:j,_event:h,instruction:A,scope:C,get __dependencies__(){return z}})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),j}function J0(M){const F=M.text(),j=B(),R=I("element"),L=M.parent().is(`[${$0}]`),C=Q0.default(document.createTextNode(X.__interpolate__(F,j,L))),$=(_)=>{const d=X.__interpolate__(F,_,L);if(!C[0])return;C[0].textContent=d,L&&X.__trackTranslationDep__(_,{nodetype:"text",nodepath:R,target:"value",$fragment:C,update:$})};if(F&&X.__isReactive__(F,j))X.__extractTextDeps__(F,j).forEach((d)=>X.__trackDep__(z,d,j,{nodetype:"text",nodepath:R,deppath:`${R}.${d}`,target:"value",$fragment:C,update:$}));return L&&X.__trackTranslationDep__(j,{nodetype:"text",nodepath:R,target:"value",$fragment:C,update:$}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),C}function v(M){if(M.get(0)?.nodeType===Node.COMMENT_NODE)return M;if(M.get(0)?.nodeType===Node.TEXT_NODE)return J0(M);if(M.is("let"))return H0(M);else if(M.is("const"))return n(M);else if(M.is("lips")&&M.attr(":dtag"))return e(M);else if(M.is("log"))return a(M);else if(X.__macros.has(M.prop("tagName")?.toLowerCase()))return c(M);else if(M.is("if, for, switch, async")||X.lips.has(M.prop("tagName")?.toLowerCase()))return y(M);else if(M.is("else-if, else"))return;return p(M)}try{this.__renderDepth__++,Z=!Z&&Q0.default(this.__template__).length>1?Q0.default("<template>").html(this.__template__).contents():Z||Q0.default(this.__template__),Z.each(function(){const M=v(Q0.default(this));if(M)U=U.add(M)}),Y.forEach(this.__attachEvent__.bind(this)),X.metrics.inc("renderCount")}catch(M){console.error("Rendering Failed --",M),X.metrics.trackError(M)}finally{if(this.__renderDepth__--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth__===0)this.__inpath__="",this.__inpathCounter__=0}return{$log:U,dependencies:z,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)=>{Q0.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:G,fragmentPath:X,fragmentBoundaries:z,argv:Y,xmlns:U,declaration:B,useAttributes:I}=J;let K;const g=new Map,u=X+_1,e=(m,y,c)=>{if(K=H.contents(),!K?.length)return null;y=y||J.scope;const p=u+(c||""),{$log:J0,dependencies:v,events:M}=W.__withPath__(p,()=>{return W.render(p,K,{...y,...m},void 0,U)}),F=c||l0;return!g.has(F)&&g.set(F,new Set),g.get(F)?.add(p),v?.forEach((j,R)=>{!W.FGUD?.has(R)&&W.FGUD.set(R,new Map),j.forEach((L,C)=>{if(L.garbage)return;L.partial?.length?L.partial.push(p):L.partial=[p],W.FGUD.get(R)?.set(C,L)})}),W.metrics.inc("partialCount"),J0},a=(m,y,c,p,J0)=>{if(!g.get(J0||l0)?.size)return;c=c||J.scope,p=p||z,W.metrics.startRender();const v=Array.from(g.get(J0||l0)||[]);m.forEach((M)=>{const F=W.FGUD.get(M);if(!F)return;F.forEach((j)=>{const R=v.find(($)=>{return j.partial?.find((_)=>$==_||W.__hasSamePathParent__(_,$))});if(!j.partial||!R)return;const L=j.deppath||j.nodepath,C=this.FGUDMemory.get(j.nodepath);if(j.garbage||p?.start&&!document.contains(p.start)){F.delete(L),W.__unbindMemo__(j);return}if(!C){console.warn(`unexpected occurence: <${L}> has no memo`);return}if(C.memo?.[M]&&y?.[M]&&!U0(C.memo[M],y[M]))C.memo={...c,...C.memo,...y};W.UQS.queue({dep:M,deppath:L,priority:j.priority}),W.metrics.inc("dependencyUpdateCount")}),!F.size&&W.FGUD.delete(M)}),W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},H0=(m,y)=>{if(W.FGUD.forEach((c,p)=>{c.forEach((J0,v)=>{if(!W.__hasSamePathParent__(v,u+(y||"")))return;W.__unbindMemo__(J0),J0.garbage=!0}),!c.size&&W.FGUD.delete(p)}),g.delete(typeof y==="string"&&y||l0),m=m||z,W.__emptyBoundaries__(m),y)m.start.remove(),m.end.remove()},n={renderer:{path:G,argv:Y,mesh:e,update:a,cleanup:H0,fill(m,y){W.__fillBoundaries__(m,y||z)},demarcate(m,y){const c=W.__getBoundaries__(u+(y||""));let p=Q0.default(c.start);return p=p.add(m),p=p.add(c.end),{$partial:p,boundaries:c}}}};if(I&&G){const{attrs:m}=W.__getAttributes__(H);m.literals&&Object.entries(m.literals).forEach(([y,c])=>n[y]=c),m.expressions&&Object.entries(m.expressions).forEach(([y,c])=>{if(M0.test(y)){let p=[];W.__evaluateSpreadAttr__(y,{memo:J.scope,get keystore(){return p},set keystore(J0){p=J0},each:(J0,v)=>n[J0]=v}),Z[`${B?.syntax?E0:""}${G}.${y}`]=c}else n[y]=c?W.__evaluate__(c,J.scope):!0,Z[`${B?.syntax?E0:""}${G}.${y}`]=c})}return n}__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;Q0.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&&Q0.default(Z.start).after(J)}__getAttributes__(J){const Z=J.attrs(),W={},H={},G={literals:{},expressions:{},map:{explicitAttrs:[],spreadAttrs:[],beforeSpreadAttrs:[],afterSpreadAttrs:[],metaAttrs:[]}},X=Object.keys(Z).find((U)=>M0.test(U));let z=[],Y=!1;return Z&&Object.entries(Z).forEach(([U,B])=>{if(U==":dtag")return;if(U.startsWith(":")||U.startsWith(D0)||U.startsWith(b0)||M0.test(U)||j1.test(U))if(j1.test(U)){const[I,K]=U.match(j1)||[];z=K.split(",")}else if(U.startsWith(b0))W[U.replace(b0,"")]=B;else if(U.startsWith(D0))H[U.replace(D0,"")]=B;else{if(U.startsWith(":"))U=U.slice(1,U.length);if(X)if(M0.test(U))G.map.spreadAttrs.push(U),Y=!0;else G.map.explicitAttrs.push(U),!Y?G.map.beforeSpreadAttrs.push(U):G.map.afterSpreadAttrs.push(U);G.expressions[U]=B||""}else if(G.literals[U]=B,X)G.map.explicitAttrs.push(U),!Y?G.map.beforeSpreadAttrs.push(U):G.map.afterSpreadAttrs.push(U)}),{argv:z,events:W,functions:H,attrs:G}}__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+_1}`)}__evaluate__(J,Z,W){J=typeof J==="string"?J.trim():J;try{const H=(G)=>{const X=this.state.toJSON(),z=(U,...B)=>{try{return U(...B)}catch(I){!W?.mute&&console.error("Eval error --",I);return}};let Y=`return ${G};`;if(Z){let U={},B;for(let K in Z){if(K==="__arguments__")continue;U[K]=Z[K].value}if(typeof Z.__arguments__==="object")B=Z.__arguments__;Y=`with( scope ){ ${Y} }`;const I=new Function("self","input","state","static","context","scope","arguments",Y);return z(I,this,this.input,X,this.static,this.context,U||{},B)}else{const U=new Function("self","input","state","static","context",Y);return z(U,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(f1,(G,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,...G]=J.split(/\s*,\s*/),X;const z=this.__evaluate__(H,W,{mute:!0});if(typeof z==="function")X=z;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 Y=G.map((U)=>this.__evaluate__(U,W));if(Z.length)Y=[...Y,...Z];return X(...Y)}}__evaluateSpreadAttr__(J,Z){const W=this.__evaluate__(J.replace(M0,""),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(f1,(H,G)=>this.__evaluate__(G,Z)),W)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J){const{element:Z,nodepath:W,_event:H,instruction:G,scope:X,__dependencies__:z}=J;let Y=X;if(Z.on(H,(...U)=>this.__evaluateFunction__(G,U,Y)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(G,X))this.__extractExpressionDeps__(G,X).forEach((B)=>this.__trackDep__(z,B,X||{},{nodetype:"event",nodepath:W,deppath:`${W}.${H}`,target:"event-handler",$fragment:!(Z instanceof x0)?Z:null,boundaries:Z instanceof x0?Z.__boundaries__:void 0,update:(I)=>{Y=I}}))}__detachEvent__({element:J,nodepath:Z,_event:W,instruction:H,scope:G,__dependencies__:X}){if(J.off(W),this.__isReactive__(H,G)){const z=this.__extractExpressionDeps__(H,G),Y=`${Z}.${W}`;z.forEach((U)=>{X.get(U)?.delete(Y),this.FGUD.get(U)?.delete(Y)})}this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const W=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((G)=>{const X=G.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(X,Z).forEach((Y)=>W.add(Y))}),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,G=/\b(arguments)((?:\.[a-zA-Z_]\w*)+)?(?=\[|\.|$|\s|;|,|\))/g;let X=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(H)),...Array.from(J.matchAll(G))];if(Z&&Object.keys(Z).length){const z=new RegExp(`\\b(?<!\\.)(${Object.keys(Z).join("|")})`,"g"),Y=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");X=[...X,...Array.from(J.matchAll(z)),...Array.from(J.matchAll(Y))]}return[...new Set(X.map((z)=>z[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 G=new Map;G.set(W,Z.priority),this.FGUDMemory.set(Z.nodepath,{tracks:G,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)=>b5.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 G=H.deppath||H.nodepath;H.level=G.split(/\//g).length,H.priority=H.level*f5+H.priority,!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(G,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),G=this.__valueDep__(W[J],Z);return!U0(H,G)}__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((G)=>{try{const X=G.deppath||G.nodepath;if(G.garbage||G.boundaries?.start&&!document.contains(G.boundaries.start)||G.$fragment!==null&&!G.$fragment.closest("body").length){J.delete(X),this.__unbindMemo__(G);return}this.UQS.queue({dep:Z,deppath:X,priority:G.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,G)=>{if(!H.haslet||!this.__hasSamePathParent__(G,this.__getPathParent__(Z)))return;const X=H.deppath||H.nodepath,z=this.FGUDMemory.get(H.nodepath);if(!z){console.warn(`unexpected occurence: <${X}> has no memo`);return}z.memo={...z.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,G)=>{if(!this.__hasSamePathParent__(G,J))return;const X=H.deppath||H.nodepath,z=this.FGUDMemory.get(H.nodepath);if(!z){console.warn(`unexpected occurence: <${X}> has no memo`);return}z.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"?Q0.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?Q0.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?Q0.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var v1={};i0(v1,{handler:()=>{{return $8}},declaration:()=>{{return T8}},_static:()=>{{return A8}}});var T8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},A8={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){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,G;if(Array.isArray(J["else-if"])&&J["else-if"].length)for(let X of J["else-if"]){if(!X.by)continue;if(G=X.renderer.mesh({},Z),this.static.prevRenderer=X.renderer,!G?.length)return;if(W)return G;G?.length&&X.renderer.fill(G),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 u1={};i0(u1,{handler:()=>{{return g8}},declaration:()=>{{return S8}},_static:()=>{{return b8}}});var V0=t0(c0(),1);var S8={name:"for",syntax:!0},b8={lastIn:null,argvlist:null,initialized:!1,prevRenderer:null,processingBatch:!1},g8={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:G,to:X}=J;if(H===void 0&&G===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(G!==void 0)return this.asFromTo(J.renderer,G,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 G=`[${H}]`,X=J.mesh(W,Z,G);if(!X)return;const{boundaries:z,$partial:Y}=J.demarcate(X,G);return this.static.prevRenderer=J,this.static.argvlist.push({argvalues:W,boundaries:z}),Y},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,G){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,z=Math.abs(W-Z)+1;if(Array.isArray(this.static.argvlist)){const[U]=J.argv;if(U){let B=Z;if(this.static.argvlist.length===z){for(let K=0;K<this.static.argvlist.length;K++)this.static.argvlist[K].argvalues[U].value!==B&&this.updateItem(J,H,{[U]:{value:B,type:"arg"}},K),B=X?B+1:B-1;return}const I=Math.min(this.static.argvlist.length,z);for(let K=0;K<I;K++)this.updateItem(J,H,{[U]:{value:K,type:"arg"}},K);if(z>this.static.argvlist.length)for(let K=this.static.argvlist.length;K<z;K++){const g={[U]:{value:K,type:"arg"}};this.boundaries&&V0.default(this.boundaries.end).before(this.addItem(J,H,g,K))}else if(z<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=z;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let Y=V0.default();for(let U=Z;X?U<=W:U>=W;X?U++:U--){const B={},[I]=J.argv;if(I)B[I]={value:U,type:"arg"};Y=Y.add(this.addItem(J,H,B,U))}if(!Y?.length)return;if(G)return Y;J.fill(Y)},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[z,Y]=J.argv;if(z){if(this.static.argvlist.length===Z.length){for(let B=0;B<this.static.argvlist.length;B++)!U0(this.static.argvlist[B].argvalues[z].value,Z[B])&&this.updateItem(J,W,{[z]:{value:Z[B],type:"arg"},[Y]:{value:B,type:"arg"}},B);return}const U=Math.min(this.static.argvlist.length,Z.length);for(let B=0;B<U;B++)this.updateItem(J,W,{[z]:{value:Z[B],type:"arg"},[Y]:{value:B,type:"arg"}},B);if(Z.length>this.static.argvlist.length)for(let B=this.static.argvlist.length;B<Z.length;B++){const I={[z]:{value:Z[B],type:"arg"},[Y]:{value:B,type:"arg"}};this.boundaries&&V0.default(this.boundaries.end).before(this.addItem(J,W,I,B))}else if(Z.length<this.static.argvlist.length)for(let B=this.static.argvlist.length-1;B>=Z.length;B--)this.removeItem(J,B)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let G=V0.default(),X=0;for(let z of Z){const Y={},[U,B]=J.argv;if(U)Y[U]={value:z,type:"arg"};if(B)Y[B]={value:X,type:"arg"};G=G.add(this.addItem(J,W,Y,X)),X++}if(!G?.length)return;if(H)return G;J.fill(G)},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[z,Y,U]=J.argv,B=Array.from(Z.entries());if(z){if(this.static.argvlist.length===B.length){for(let K=0;K<this.static.argvlist.length;K++)!U0(this.static.argvlist[K].argvalues[z].value,B[K][0])||!U0(this.static.argvlist[K].argvalues[Y].value,B[K][1])&&this.updateItem(J,W,{[z]:{value:B[K][0],type:"arg"},[Y]:{value:B[K][1],type:"arg"},[U]:{value:K,type:"arg"}},K);return}const I=Math.min(this.static.argvlist.length,B.length);for(let K=0;K<I;K++)this.updateItem(J,W,{[z]:{value:B[K][0],type:"arg"},[Y]:{value:B[K][1],type:"arg"},[U]:{value:K,type:"arg"}},K);if(B.length>this.static.argvlist.length)for(let K=this.static.argvlist.length;K<B.length;K++){const g={[z]:{value:B[K][0],type:"arg"},[Y]:{value:B[K][1],type:"arg"},[U]:{value:K,type:"arg"}};this.boundaries&&V0.default(this.boundaries.end).before(this.addItem(J,W,g,K))}else if(B.length<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=B.length;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let G=V0.default(),X=0;for(let[z,Y]of Z){const U={},[B,I,K]=J.argv;if(B)U[B]={value:z,type:"arg"};if(I)U[I]={value:Y,type:"arg"};if(K)U[K]={value:X,type:"arg"};G=G.add(this.addItem(J,W,U,X)),X++}if(!G?.length)return;if(H)return G;J.fill(G)},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[z,Y,U]=J.argv,B=Object.entries(Z);if(z){if(this.static.argvlist.length===B.length){for(let K=0;K<this.static.argvlist.length;K++)!U0(this.static.argvlist[K].argvalues[z].value,B[K][0])||!U0(this.static.argvlist[K].argvalues[Y].value,B[K][1])&&this.updateItem(J,W,{[z]:{value:B[K][0],type:"arg"},[Y]:{value:B[K][1],type:"arg"},[U]:{value:K,type:"arg"}},K);return}const I=Math.min(this.static.argvlist.length,B.length);for(let K=0;K<I;K++)this.updateItem(J,W,{[z]:{value:B[K][0],type:"arg"},[Y]:{value:B[K][1],type:"arg"},[U]:{value:K,type:"arg"}},K);if(B.length>this.static.argvlist.length){let K=V0.default();for(let g=this.static.argvlist.length;g<B.length;g++){const u={[z]:{value:B[g][0],type:"arg"},[Y]:{value:B[g][1],type:"arg"},[U]:{value:g,type:"arg"}},e=this.addItem(J,W,u,g);K=K.add(e)}this.boundaries&&V0.default(this.boundaries.end).before(K)}else if(B.length<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=B.length;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let G=V0.default(),X=0;for(let z in Z){const Y={},[U,B,I]=J.argv;if(U)Y[U]={value:z,type:"arg"};if(B)Y[B]={value:Z[z],type:"arg"};if(I)Y[I]={value:X,type:"arg"};G=G.add(this.addItem(J,W,Y,X)),X++}if(!G?.length)return;if(H)return G;J.fill(G)},onDestroy(){this.static.prevRenderer?.cleanup(void 0,!0),this.static.prevRenderer=null,this.static.argvlist=null,this.static.lastIn=null}};var m1={};i0(m1,{handler:()=>{{return h8}},declaration:()=>{{return x8}},_static:()=>{{return k8}}});var x8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},k8={initialized:!1,finalized:!1,prevRenderer:null},h8={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[G]=J.then.renderer.argv,X={[G]:{value:H,type:"arg"}},z=J.then.renderer.mesh(X,Z);if(this.static.prevRenderer=J.then.renderer,!z?.length)return;if(!W)return z;J.then.renderer.fill(z)}).catch((H)=>{if(this.static.prevRenderer?.cleanup(),!J.catch)return;const[G]=J.catch.renderer.argv,X={[G]:{value:H,type:"arg"}},z=J.catch.renderer.mesh(X,Z);if(this.static.prevRenderer=J.catch.renderer,!z?.length)return;if(!W)return z;J.catch.renderer.fill(z)}).finally(()=>this.static.finalized=!0)}};var d1={};i0(d1,{handler:()=>{{return y8}},declaration:()=>{{return f8}},_static:()=>{{return _8}}});var f8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},_8={initialized:!1,prevRenderer:null},y8={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 G of J.case)if(G.is==J.by||Array.isArray(G.is)&&G.is.includes(J.by)){Array.isArray(G.is)?H=[...new Set([...H,...G.is])]:H.push(G.is);const X=G.renderer.mesh({},Z);if(this.static.prevRenderer=G.renderer,!X?.length)return;if(W)return X;G.renderer.fill(X)}if(H.includes(J.by))return;if(J.default){const G=J.default.renderer.mesh({},Z);if(this.static.prevRenderer=J.default.renderer,!G?.length)return;if(W)return G;J.default.renderer.fill(G)}else this.static.prevRenderer=null}};var i1={};i0(i1,{state:()=>{{return v8}},handler:()=>{{return i8}},default:()=>{{return c8}},context:()=>{{return m8}},_static:()=>{{return u8}}});var d8=function(J){const Z={};return J.split("&").map((H)=>{const[G,X]=H.split("=");Z[G]=X}),Z},v8={page:null,params:{},query:{}},u8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},m8=["navigate"],i8={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 G=Z.match(/:[^\/]*(\/|$)/gi)||[],X=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:W,default:H,pathVars:G,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]?d8(W[1]):{};let G=null;if(this.static.currentRoute)G={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:G,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:z,params:Y}=X;this.emit("after",{fromState:G,toState:{path:z.path,params:Y,query:H}}),this.static.currentPath=J,this.static.currentRoute=z,this.state.params=Y,this.state.query=H,this.state.page=z.template},match(J){const Z={};let W=!1;for(let H of this.static.routes){const{pathVars:G,pathRegex:X}=H,z=J.match(X);if(z!==null&&z.index===0){for(let Y=0;Y+1<z.length&&Y<G.length;Y++)Z[G[Y].replaceAll(/[\/:]/g,"")]=z[Y+1];W=H;break}}return W?{route:W,params:Z}:!1}},c8="<{state.page} params=state.params query=state.query/>";class d0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new W1;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new Z1,this.IUC=new J1;const[Z,W]=g0(this.i18n.lang),[H,G]=g0(J?.context||{});this.__setLang=W,this.__getLang=Z,this.__setContext=G,this.__getContext=H,this.register("if",v1),this.register("for",u1),this.register("async",m1),this.register("switch",d1),this.register("router",i1)}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,...G}=Z,X={debug:this.debug,prepath:"0",lips:this},z=new x0(J,H||"",{...G,input:W},X);return window.addEventListener("beforeunload",()=>{return this.dispose(),z.destroy(),null}),window.addEventListener("pagehide",(Y)=>{!Y.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),z}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 m0("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};z0(W,H)&&this.__setContext(H)}else if(!Array.isArray(J)){const H={...W,...J};z0(W,H)&&this.__setContext(H)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;o0(()=>{const W=this.__getContext();if(!W)return;const H=Object.fromEntries(J.map((G)=>[G,W[G]]));H&&typeof Z==="function"&&Object.keys(H).length&&Z(H)})}useTranslator(J,Z){o0(()=>{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())}}function p8(J="body"){const Z={counter:0,counterHistory:[],updateFrequency:16,isRunning:!1,metrics:{fps:0,avgRenderTime:0,totalUpdates:0,memoryUsageMB:0,domOperations:0}},W={updateInterval:null,frameCountInterval:null,frameCount:0,lastFrameTimestamp:0,updateTimes:[]},H={onCreate(){console.log("Stress test component created")},onMount(){console.log("Stress test component mounted"),this.startPerformanceTracking()},onRender(){const U=performance.now();if(this.static.lastFrameTimestamp){const B=U-this.static.lastFrameTimestamp;if(B<1000){if(this.static.updateTimes.push(B),this.static.updateTimes.length>100)this.static.updateTimes.shift()}}this.static.lastFrameTimestamp=U,this.static.frameCount++},startPerformanceTracking(){this.static.frameCountInterval=setInterval(()=>{if(this.state.metrics.fps=this.static.frameCount,this.static.frameCount=0,this.static.updateTimes.length){const U=this.static.updateTimes.reduce((B,I)=>B+I,0)/this.static.updateTimes.length;this.state.metrics.avgRenderTime=U}if(window.performance&&window.performance.memory)this.state.metrics.memoryUsageMB=window.performance.memory.usedJSHeapSize/1048576},1000)},startStressTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.counterHistory=[],this.static.updateInterval=setInterval(()=>{if(this.state.counter++,this.state.metrics.totalUpdates++,this.state.counterHistory.length>100)this.state.counterHistory.shift();this.state.counterHistory.push(this.state.counter)},this.state.updateFrequency)},stopStressTest(){if(!this.state.isRunning)return;clearInterval(this.static.updateInterval),this.state.isRunning=!1},setUpdateFrequency(U){const B=parseFloat(U.target.value);if(this.state.updateFrequency=B,this.state.isRunning)this.stopStressTest(),this.startStressTest()},resetCounter(){this.state.counter=0,this.state.counterHistory=[],this.state.metrics.totalUpdates=0},runHeavyComputation(){const U=performance.now();let B=0;for(let I=0;I<1e7;I++)B+=Math.sqrt(I);console.log(`Heavy computation completed in ${performance.now()-U}ms, result: ${B}`)},destroy(){clearInterval(this.static.updateInterval),clearInterval(this.static.frameCountInterval)}},Y=new d0({debug:!0}).render("StressTestApp",{default:`
|
|
1
|
+
var K8=Object.create;var{defineProperty:x1,getPrototypeOf:I8,getOwnPropertyNames:O8}=Object;var D8=Object.prototype.hasOwnProperty;var e0=(J,Z,W)=>{W=J!=null?K8(I8(J)):{};const H=Z||!J||!J.__esModule?x1(W,"default",{value:J,enumerable:!0}):W;for(let q of O8(J))if(!D8.call(H,q))x1(H,q,{get:()=>J[q],enumerable:!0});return H};var j8=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var c0=(J,Z)=>{for(var W in Z)x1(J,W,{get:Z[W],enumerable:!0,configurable:!0,set:(H)=>Z[W]=()=>H})};var p0=j8((q5,z5)=>{(function(){var J=document,Z=window,W=J.documentElement,H=J.createElement.bind(J),q=H("div"),X=H("table"),G=H("tbody"),U=H("tr"),Y=Array.isArray,B=Array.prototype,O=B.concat,K=B.filter,S=B.indexOf,m=B.map,e=B.push,t=B.slice,H0=B.some,r=B.splice,d=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,v=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,c=/<.+>/,p=/^\w+$/;function J0(Q,z){var w=P(z);return!Q||!w&&!L(z)&&!A(z)?[]:!w&&v.test(Q)?z.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!w&&p.test(Q)?z.getElementsByTagName(Q):z.querySelectorAll(Q)}var u=function(){function Q(z,w){if(!z)return;if(D(z))return z;var I=z;if(x(z)){var V=w||J;if(I=d.test(z)&&L(V)?V.getElementById(z.slice(1).replace(/\\/g,"")):c.test(z)?s1(z):D(V)?V.find(z):x(V)?j(V).find(z):J0(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,w){return new Q(z,w)},Q}(),M=u.prototype,j=M.init;if(j.fn=j.prototype=M,M.length=0,M.splice=r,typeof Symbol==="function")M[Symbol.iterator]=B[Symbol.iterator];function D(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=Y,j.isNumeric=R,j.isPlainObject=k;function F(Q,z,w){if(w){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,M.each=function(Q){return F(this,Q)},M.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 w=l(Q[0])?Q.shift():!1,I=Q.shift(),V=Q.length;if(!I)return{};if(!V)return T(w,j,I);for(var E=0;E<V;E++){var f=Q[E];for(var s in f)if(w&&(Y(f[s])||k(f[s]))){if(!I[s]||I[s].constructor!==f[s].constructor)I[s]=new f[s].constructor;T(w,I[s],f[s])}else I[s]=f[s]}return I}j.extend=T,M.extend=function(Q){return T(M,Q)};var h=/\S+/g;function $(Q){return x(Q)?Q.match(h)||[]:[]}M.toggleClass=function(Q,z){var w=$(Q),I=!N(z);return this.each(function(V,E){if(!A(E))return;F(w,function(f,s){if(I)z?E.classList.add(s):E.classList.remove(s);else E.classList.toggle(s)})})},M.addClass=function(Q){return this.toggleClass(Q,!0)},M.removeAttr=function(Q){var z=$(Q);return this.each(function(w,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 w=this[0].getAttribute(Q);return _(w)?void 0:w}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}M.attr=b,M.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},M.hasClass=function(Q){return!!Q&&H0.call(this,function(z){return A(z)&&z.classList.contains(Q)})},M.get=function(Q){if(N(Q))return t.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},M.eq=function(Q){return j(this.get(Q))},M.first=function(){return this.eq(0)},M.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,w){if(!A(w))return;w.textContent=Q})}M.text=o;function i(Q,z,w){if(!A(Q))return;var I=Z.getComputedStyle(Q,null);return w?I.getPropertyValue(z)||void 0:I[z]||Q.style[z]}function n(Q,z){return parseInt(i(Q,z),10)||0}function Z0(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 B0(Q){if(a[Q])return a[Q];var z=H(Q);J.body.insertBefore(z,null);var w=i(z,"display");return J.body.removeChild(z),a[Q]=w!=="none"?w:"block"}function D0(Q){return i(Q,"display")==="none"}function h0(Q,z){var w=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!w&&!!z&&w.call(Q,z)}function n0(Q){return x(Q)?function(z,w){return h0(w,Q)}:g(Q)?Q:D(Q)?function(z,w){return Q.is(w)}:!Q?function(){return!1}:function(z,w){return w===Q}}M.filter=function(Q){var z=n0(Q);return j(K.call(this,function(w,I){return z.call(w,I,w)}))};function A0(Q,z){return!z?Q:Q.filter(z)}M.detach=function(Q){return A0(this,Q).each(function(z,w){if(w.parentNode)w.parentNode.removeChild(w)}),this};var m5=/^\s*<(\w+)[^>]*>/,d5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p1={"*":q,tr:G,td:U,th:U,thead:X,tbody:X,tfoot:X};function s1(Q){if(!x(Q))return[];if(d5.test(Q))return[H(RegExp.$1)];var z=m5.test(Q)&&RegExp.$1,w=p1[z]||p1["*"];return w.innerHTML=Q,j(w.childNodes).detach().get()}j.parseHTML=s1,M.has=function(Q){var z=x(Q)?function(w,I){return J0(Q,I).length}:function(w,I){return I.contains(Q)};return this.filter(z)},M.not=function(Q){var z=n0(Q);return this.filter(function(w,I){return(!x(Q)||A(I))&&!z.call(I,w,I)})};function C0(Q,z,w,I){var V=[],E=g(z),f=I&&n0(I);for(var s=0,j0=Q.length;s<j0;s++)if(E){var q0=z(Q[s]);if(q0.length)e.apply(V,q0)}else{var U0=Q[s][z];while(U0!=null){if(I&&f(-1,U0))break;V.push(U0),U0=w?U0[z]:null}}return V}function l1(Q){if(Q.multiple&&Q.options)return C0(K.call(Q.options,function(z){return z.selected&&!z.disabled&&!z.parentNode.disabled}),"value");return Q.value||""}function i5(Q){if(!arguments.length)return this[0]&&l1(this[0]);return this.each(function(z,w){var I=w.multiple&&w.options;if(I||X5.test(w.type)){var V=Y(Q)?m.call(Q,String):_(Q)?[]:[String(Q)];if(I)F(w.options,function(E,f){f.selected=V.indexOf(f.value)>=0},!0);else w.checked=V.indexOf(w.value)>=0}else w.value=N(Q)||_(Q)?"":Q})}M.val=i5,M.is=function(Q){var z=n0(Q);return H0.call(this,function(w,I){return z.call(w,I,w)})},j.guid=1;function V0(Q){return Q.length>1?K.call(Q,function(z,w,I){return S.call(I,z)===w}):Q}j.unique=V0,M.add=function(Q,z){return j(V0(this.get().concat(j(Q,z).get())))},M.children=function(Q){return A0(j(V0(C0(this,function(z){return z.children}))),Q)},M.parent=function(Q){return A0(j(V0(C0(this,"parentNode"))),Q)},M.index=function(Q){var z=Q?j(Q)[0]:this[0],w=Q?this:j(z).parent().children();return S.call(w,z)},M.closest=function(Q){var z=this.filter(Q);if(z.length)return z;var w=this.parent();if(!w.length)return z;return w.closest(Q)},M.siblings=function(Q){return A0(j(V0(C0(this,function(z){return j(z).parent().children().not(z)}))),Q)},M.find=function(Q){return j(V0(C0(this,function(z){return J0(Q,z)})))};var c5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,p5=/^$|^module$|\/(java|ecma)script/i,s5=["type","src","nonce","noModule"];function l5(Q,z){var w=j(Q);w.filter("script").add(w.find("script")).each(function(I,V){if(p5.test(V.type)&&W.contains(V)){var E=H("script");E.text=V.textContent.replace(c5,""),F(s5,function(f,s){if(V[s])E[s]=V[s]}),z.head.insertBefore(E,null),z.head.removeChild(E)}})}function o5(Q,z,w,I,V){if(I)Q.insertBefore(z,w?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(z,Q);else Q.parentNode.insertBefore(z,w?Q:Q.nextSibling);if(V)l5(z,Q.ownerDocument)}function $0(Q,z,w,I,V,E,f,s){return F(Q,function(j0,q0){F(j(q0),function(U0,b0){F(j(z),function(F0,t0){var $1=w?b0:t0,S1=w?t0:b0,M0=w?U0:F0;o5($1,!M0?S1:S1.cloneNode(!0),I,V,!M0)},s)},f)},E),z}M.after=function(){return $0(arguments,this,!1,!1,!1,!0,!0)},M.append=function(){return $0(arguments,this,!1,!1,!0)};function r5(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(w,I){if(!A(I))return;if(z)j(I).empty().append(Q);else I.innerHTML=Q})}M.html=r5,M.appendTo=function(Q){return $0(arguments,this,!0,!1,!0)},M.wrapInner=function(Q){return this.each(function(z,w){var I=j(w),V=I.contents();V.length?V.wrapAll(Q):I.append(Q)})},M.before=function(){return $0(arguments,this,!1,!0)},M.wrapAll=function(Q){var z=j(Q),w=z[0];while(w.children.length)w=w.firstElementChild;return this.first().before(z),this.appendTo(w)},M.wrap=function(Q){return this.each(function(z,w){var I=j(Q)[0];j(w).wrapAll(!z?I:I.cloneNode(!0))})},M.insertAfter=function(Q){return $0(arguments,this,!0,!1,!1,!1,!1,!0)},M.insertBefore=function(Q){return $0(arguments,this,!0,!0)},M.prepend=function(){return $0(arguments,this,!1,!0,!0,!0,!0)},M.prependTo=function(Q){return $0(arguments,this,!0,!0,!0,!1,!1,!0)},M.contents=function(){return j(V0(C0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},M.next=function(Q,z,w){return A0(j(V0(C0(this,"nextElementSibling",z,w))),Q)},M.nextAll=function(Q){return this.next(Q,!0)},M.nextUntil=function(Q,z){return this.next(z,!0,Q)},M.parents=function(Q,z){return A0(j(V0(C0(this,"parentElement",!0,z))),Q)},M.parentsUntil=function(Q,z){return this.parents(z,Q)},M.prev=function(Q,z,w){return A0(j(V0(C0(this,"previousElementSibling",z,w))),Q)},M.prevAll=function(Q){return this.prev(Q,!0)},M.prevUntil=function(Q,z){return this.prev(z,!0,Q)},M.map=function(Q){return j(O.apply([],m.call(this,function(z,w){return Q.call(z,w,z)})))},M.clone=function(){return this.map(function(Q,z){return z.cloneNode(!0)})},M.offsetParent=function(){return this.map(function(Q,z){var w=z.offsetParent;while(w&&i(w,"position")==="static")w=w.offsetParent;return w||W})},M.slice=function(Q,z){return j(t.call(this,Q,z))};var n5=/-([a-z])/g;function N1(Q){return Q.replace(n5,function(z,w){return w.toUpperCase()})}M.ready=function(Q){var z=function(){return setTimeout(Q,0,j)};if(J.readyState!=="loading")z();else J.addEventListener("DOMContentLoaded",z);return this},M.unwrap=function(){return this.parent().each(function(Q,z){if(z.tagName==="BODY")return;var w=j(z);w.replaceWith(w.children())}),this},M.offset=function(){var Q=this[0];if(!Q)return;var z=Q.getBoundingClientRect();return{top:z.top+Z.pageYOffset,left:z.left+Z.pageXOffset}},M.position=function(){var Q=this[0];if(!Q)return;var z=i(Q,"position")==="fixed",w=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();w.top-=E.top+n(V,"borderTopWidth"),w.left-=E.left+n(V,"borderLeftWidth")}}return{top:w.top-n(Q,"marginTop"),left:w.left-n(Q,"marginLeft")}};var o1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};M.prop=function(Q,z){if(!Q)return;if(x(Q)){if(Q=o1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(I,V){V[Q]=z})}for(var w in Q)this.prop(w,Q[w]);return this},M.removeProp=function(Q){return this.each(function(z,w){delete w[o1[Q]||Q]})};var a5=/^--/;function C1(Q){return a5.test(Q)}var R1={},t5=q.style,e5=["webkit","moz","ms"];function J8(Q,z){if(z===void 0)z=C1(Q);if(z)return Q;if(!R1[Q]){var w=N1(Q),I="".concat(w[0].toUpperCase()).concat(w.slice(1)),V="".concat(w," ").concat(e5.join("".concat(I," "))).concat(I).split(" ");F(V,function(E,f){if(f in t5)return R1[Q]=f,!1})}return R1[Q]}var Z8={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 r1(Q,z,w){if(w===void 0)w=C1(Q);return!w&&!Z8[Q]&&R(z)?"".concat(z,"px"):z}function Q8(Q,z){if(x(Q)){var w=C1(Q);if(Q=J8(Q,w),arguments.length<2)return this[0]&&i(this[0],Q,w);if(!Q)return this;return z=r1(Q,z,w),this.each(function(V,E){if(!A(E))return;if(w)E.style.setProperty(Q,z);else E.style[Q]=z})}for(var I in Q)this.css(I,Q[I]);return this}M.css=Q8;function n1(Q,z){try{return Q(z)}catch(w){return z}}var W8=/^\s+|\s+$/;function a1(Q,z){var w=Q.dataset[z]||Q.dataset[N1(z)];if(W8.test(w))return w;return n1(JSON.parse,w)}function X8(Q,z,w){w=n1(JSON.stringify,w),Q.dataset[N1(z)]=w}function H8(Q,z){if(!Q){if(!this[0])return;var w={};for(var I in this[0].dataset)w[I]=a1(this[0],I);return w}if(x(Q)){if(arguments.length<2)return this[0]&&a1(this[0],Q);if(N(z))return this;return this.each(function(V,E){X8(E,Q,z)})}for(var I in Q)this.data(I,Q[I]);return this}M.data=H8;function t1(Q,z){var w=Q.documentElement;return Math.max(Q.body["scroll".concat(z)],w["scroll".concat(z)],Q.body["offset".concat(z)],w["offset".concat(z)],w["client".concat(z)])}F([!0,!1],function(Q,z){F(["Width","Height"],function(w,I){var V="".concat(z?"outer":"inner").concat(I);M[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 t1(this[0],I);return this[0]["".concat(z?"offset":"client").concat(I)]+(E&&z?n(this[0],"margin".concat(w?"Top":"Left"))+n(this[0],"margin".concat(w?"Bottom":"Right")):0)}})}),F(["Width","Height"],function(Q,z){var w=z.toLowerCase();M[w]=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 t1(this[0],z);return this[0].getBoundingClientRect()[w]-Z0(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[w]=r1(w,V+(s==="border-box"?Z0(f,!Q):0))})}});var e1="___cd";M.toggle=function(Q){return this.each(function(z,w){if(!A(w))return;var I=D0(w),V=N(Q)?I:Q;if(V){if(w.style.display=w[e1]||"",D0(w))w.style.display=B0(w.tagName)}else if(!I)w[e1]=i(w,"display"),w.style.display="none"})},M.hide=function(){return this.toggle(!1)},M.show=function(){return this.toggle(!0)};var J5="___ce",P1=".",T1={focus:"focusin",blur:"focusout"},Z5={mouseenter:"mouseover",mouseleave:"mouseout"},q8=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function E1(Q){return Z5[Q]||T1[Q]||Q}function A1(Q){var z=Q.split(P1);return[z[0],z.slice(1).sort()]}M.trigger=function(Q,z){if(x(Q)){var w=A1(Q),I=w[0],V=w[1],E=E1(I);if(!E)return this;var f=q8.test(E)?"MouseEvents":"HTMLEvents";Q=J.createEvent(f),Q.initEvent(E,!0,!0),Q.namespace=V.join(P1),Q.___ot=I}Q.___td=z;var s=Q.___ot in T1;return this.each(function(j0,q0){if(s&&g(q0[Q.___ot]))q0["___i".concat(Q.type)]=!0,q0[Q.___ot](),q0["___i".concat(Q.type)]=!1;q0.dispatchEvent(Q)})};function Q5(Q){return Q[J5]=Q[J5]||{}}function z8(Q,z,w,I,V){var E=Q5(Q);E[z]=E[z]||[],E[z].push([w,I,V]),Q.addEventListener(z,V)}function W5(Q,z){return!z||!H0.call(z,function(w){return Q.indexOf(w)<0})}function a0(Q,z,w,I,V){var E=Q5(Q);if(!z)for(z in E)a0(Q,z,w,I,V);else if(E[z])E[z]=E[z].filter(function(f){var s=f[0],j0=f[1],q0=f[2];if(V&&q0.guid!==V.guid||!W5(s,w)||I&&I!==j0)return!0;Q.removeEventListener(z,q0)})}M.off=function(Q,z,w){var I=this;if(N(Q))this.each(function(E,f){if(!A(f)&&!L(f)&&!C(f))return;a0(f)});else if(!x(Q))for(var V in Q)this.off(V,Q[V]);else{if(g(z))w=z,z="";F($(Q),function(E,f){var s=A1(f),j0=s[0],q0=s[1],U0=E1(j0);I.each(function(b0,F0){if(!A(F0)&&!L(F0)&&!C(F0))return;a0(F0,U0,q0,z,w)})})}return this},M.remove=function(Q){return A0(this,Q).detach().off(),this},M.replaceWith=function(Q){return this.before(Q).remove()},M.replaceAll=function(Q){return j(Q).replaceWith(this),this};function G8(Q,z,w,I,V){var E=this;if(!x(Q)){for(var f in Q)this.on(f,z,w,Q[f],V);return this}if(!x(z))if(N(z)||_(z))z="";else if(N(w))w=z,z="";else I=w,w=z,z="";if(!g(I))I=w,w=void 0;if(!I)return this;return F($(Q),function(s,j0){var q0=A1(j0),U0=q0[0],b0=q0[1],F0=E1(U0),t0=U0 in Z5,$1=U0 in T1;if(!F0)return;E.each(function(S1,M0){if(!A(M0)&&!L(M0)&&!C(M0))return;var b1=function(z0){if(z0.target["___i".concat(z0.type)])return z0.stopImmediatePropagation();if(z0.namespace&&!W5(b0,z0.namespace.split(P1)))return;if(!z&&($1&&(z0.target!==M0||z0.___ot===F0)||t0&&z0.relatedTarget&&M0.contains(z0.relatedTarget)))return;var g1=M0;if(z){var f0=z0.target;while(!h0(f0,z)){if(f0===M0)return;if(f0=f0.parentNode,!f0)return}g1=f0}Object.defineProperty(z0,"currentTarget",{configurable:!0,get:function(){return g1}}),Object.defineProperty(z0,"delegateTarget",{configurable:!0,get:function(){return M0}}),Object.defineProperty(z0,"data",{configurable:!0,get:function(){return w}});var M8=I.call(g1,z0,z0.___td);if(V)a0(M0,F0,b0,z,b1);if(M8===!1)z0.preventDefault(),z0.stopPropagation()};b1.guid=I.guid=I.guid||j.guid++,z8(M0,F0,b0,z,b1)})}),this}M.on=G8;function B8(Q,z,w,I){return this.on(Q,z,w,I,!0)}M.one=B8;var Y8=/\r?\n/g;function w8(Q,z){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(z.replace(Y8,"\r\n")))}var U8=/file|reset|submit|button|image/i,X5=/radio|checkbox/i;if(M.serialize=function(){var Q="";return this.each(function(z,w){F(w.elements||[w],function(I,V){if(V.disabled||!V.name||V.tagName==="FIELDSET"||U8.test(V.type)||X5.test(V.type)&&!V.checked)return;var E=l1(V);if(!N(E)){var f=Y(E)?E:[E];F(f,function(s,j0){Q+=w8(V.name,j0)})}})}),Q.slice(1)},typeof q5!=="undefined")z5.exports=j;else Z.cash=Z.$=j})()});class J1{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 Z1{subscriptions=new Map;tick=new J1;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((Y,B)=>G.set(B,X(Y)));else if(Array.isArray(G))G.forEach((Y,B)=>G[B]=X(Y));else if(typeof G==="object")Object.entries(G).forEach(([Y,B])=>G[Y]=X(B));let U=new Proxy(G,{get(Y,B){if(B==="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((H0,r)=>t[typeof r==="object"?JSON.stringify(r):String(r)]=K(H0)),t}if(Array.isArray(m))return m.map((t)=>K(t));const e={};return Object.entries(m).forEach(([t,H0])=>e[t]=K(H0)),e}if(typeof S.toJSON==="function"&&!H.has(S))return S.toJSON();return S};return K(U)};if(B==="reset")return function(){U=null};const O=Y[B];if(G instanceof Map&&typeof O==="function")return function(...K){const S=B.toString();if(S==="set"&&K.length>=2)K[1]=X(K[1]);const m=O.apply(Y,K);return["set","delete","clear"].includes(S)&&W.queueUpdate(J),m};if(Array.isArray(G)&&typeof O==="function")return function(...K){const S=B.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=O.apply(Y,K);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(S)&&W.queueUpdate(J),m};return O},set(Y,B,O){if(Y[B]===O)return!0;if(O instanceof Map&&Y[B]instanceof Map){const K=Y[B];return K.clear(),O.forEach((S,m)=>K.set(m,X(S))),W.queueUpdate(J),!0}return Y[B]=X(O),W.queueUpdate(J),!0}});return H.set(U,G),U},X=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Z)}}class Q1{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 W1=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(W,H)=>{return Z[H]!==void 0?Z[H].toString():`{${H}}`})},H5=(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 U=W["*"];if(typeof U==="object")U=U[q||"*"];return W1(U,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 W1(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(U){console.warn(`Invalid <${Z}(${G})> condition expression`)}if(X===void 0)return;if(typeof X==="object")X=X[q||"*"];return W1(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 W1(X,H)}}};class X1{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 H5(X.type,J,X.value,Z,q)}}var E5=e0(p0(),1);var H1="comm",q1="rule",z1="decl";var G5="@import";var B5="@namespace",Y5="@keyframes";var w5="@layer";function G1(J){return J.trim()}function _0(J,Z,W){return J.replace(Z,W)}function U5(J,Z,W){return J.indexOf(Z,W)}function R0(J,Z){return J.charCodeAt(Z)|0}function P0(J,Z,W){return J.slice(Z,W)}function Y0(J){return J.length}function B1(J){return J.length}function y0(J,Z){return Z.push(J),J}var k1=Math.abs,s0=String.fromCharCode;function w1(J,Z,W,H,q,X,G,U){return{value:J,root:Z,parent:W,type:H,props:q,children:X,line:Y1,column:v0,length:G,return:"",siblings:U}}function K5(){return X0}function I5(){if(X0=I0>0?R0(m0,--I0):0,v0--,X0===10)v0=1,Y1--;return X0}function O0(){if(X0=I0<M5?R0(m0,I0++):0,v0++,X0===10)v0=1,Y1++;return X0}function T0(){return R0(m0,I0)}function l0(){return I0}function U1(J,Z){return P0(m0,J,Z)}function u0(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 O5(J){return Y1=v0=1,M5=Y0(m0=J),I0=0,[]}function D5(J){return m0="",J}function M1(J){return G1(U1(I0-1,h1(J===91?J+2:J===40?J+1:J)))}function j5(J){while(X0=T0())if(X0<33)O0();else break;return u0(J)>2||u0(X0)>3?"":" "}function F5(J,Z){while(--Z&&O0())if(X0<48||X0>102||X0>57&&X0<65||X0>70&&X0<97)break;return U1(J,l0()+(Z<6&&T0()==32&&O0()==32))}function h1(J){while(O0())switch(X0){case J:return I0;case 34:case 39:if(J!==34&&J!==39)h1(X0);break;case 40:if(J===41)h1(J);break;case 92:O0();break}return I0}function L5(J,Z){while(O0())if(J+X0===57)break;else if(J+X0===84&&T0()===47)break;return"/*"+U1(Z,I0-1)+"*"+s0(J===47?J:O0())}function V5(J){while(!u0(T0()))O0();return U1(J,I0)}var Y1=1,v0=1,M5=0,I0=0,X0=0,m0="";function R5(J){return D5(K1("",null,null,null,[""],J=O5(J),0,[0],J))}function K1(J,Z,W,H,q,X,G,U,Y){var B=0,O=0,K=G,S=0,m=0,e=0,t=1,H0=1,r=1,d=0,v="",c=q,p=X,J0=H,u=v;while(H0)switch(e=d,d=O0()){case 40:if(e!=108&&R0(u,K-1)==58){if(U5(u+=_0(M1(d),"&","&\f"),"&\f",k1(B?U[B-1]:0))!=-1)r=-1;break}case 34:case 39:case 91:u+=M1(d);break;case 9:case 10:case 13:case 32:u+=j5(e);break;case 92:u+=F5(l0()-1,7);continue;case 47:switch(T0()){case 42:case 47:if(y0(L8(L5(O0(),l0()),Z,W,Y),Y),(u0(e||1)==5||u0(T0()||1)==5)&&Y0(u)&&P0(u,-1,void 0)!==" ")u+=" ";break;default:u+="/"}break;case 123*t:U[B++]=Y0(u)*r;case 125*t:case 59:case 0:switch(d){case 0:case 125:H0=0;case 59+O:if(r==-1)u=_0(u,/\f/g,"");if(m>0&&(Y0(u)-K||t===0&&e===47))y0(m>32?C5(u+";",H,W,K-1,Y):C5(_0(u," ","")+";",H,W,K-2,Y),Y);break;case 59:u+=";";default:if(y0(J0=N5(u,Z,W,B,O,q,U,v,c=[],p=[],K,X),X),d===123)if(O===0)K1(u,Z,J0,J0,c,X,K,U,p);else{switch(S){case 99:if(R0(u,3)===110)break;case 108:if(R0(u,2)===97)break;default:O=0;case 100:case 109:case 115:}if(O)K1(J,J0,J0,H&&y0(N5(J,J0,J0,0,0,q,U,v,q,c=[],K,p),p),q,p,K,U,H?c:p);else K1(u,J0,J0,J0,[""],p,0,U,p)}}B=O=m=0,t=r=1,v=u="",K=G;break;case 58:K=1+Y0(u),m=e;default:if(t<1){if(d==123)--t;else if(d==125&&t++==0&&I5()==125)continue}switch(u+=s0(d),d*t){case 38:r=O>0?1:(u+="\f",-1);break;case 44:U[B++]=(Y0(u)-1)*r,r=1;break;case 64:if(T0()===45)u+=M1(O0());S=T0(),O=K=Y0(v=u+=V5(l0())),d++;break;case 45:if(e===45&&Y0(u)==2)t=0}}return X}function N5(J,Z,W,H,q,X,G,U,Y,B,O,K){var S=q-1,m=q===0?X:[""],e=B1(m);for(var t=0,H0=0,r=0;t<H;++t)for(var d=0,v=P0(J,S+1,S=k1(H0=G[t])),c=J;d<e;++d)if(c=G1(H0>0?m[d]+" "+v:_0(v,/&\f/g,m[d])))Y[r++]=c;return w1(J,Z,W,q===0?q1:U,Y,B,O,K)}function L8(J,Z,W,H){return w1(J,Z,W,H1,s0(K5()),P0(J,2,-2),0,H)}function C5(J,Z,W,H,q){return w1(J,Z,W,z1,P0(J,0,H),P0(J,H+1,-1),H,q)}function I1(J,Z){var W="";for(var H=0;H<J.length;H++)W+=Z(J[H],H,J,Z)||"";return W}function P5(J,Z,W,H){switch(J.type){case w5:if(J.children.length)break;case G5:case B5:case z1:return J.return=J.return||J.value;case H1:return"";case Y5:return J.return=J.value+"{"+I1(J.children,H)+"}";case q1:if(!Y0(J.value=J.props.join(",")))return""}return Y0(W=I1(J.children,H))?J.return=J.value+"{"+W+"}":""}function T5(J){var Z=B1(J);return function(W,H,q,X){var G="";for(var U=0;U<Z;U++)G+=J[U](W,H,q,X)||"";return G}}class d0{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=E5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return I1(R5(J),T5([P5]))}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 O1{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 D1{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 f1=e0(p0(),1);function G0(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(A5(J)&&A5(Z)){for(let G of J)if(!Z.has(G))return!0;return!1}const X=new WeakMap;for(let G of J){let U=!1;if(typeof G!=="object"){if(Z.has(G))U=!0}else for(let Y of Z){if(typeof Y!=="object")continue;if(!X.has(G))X.set(G,new WeakMap);const B=X.get(G);if(B.has(Y)){if(U=B.get(Y),U)break;continue}const O=!G0(G,Y);if(B.set(Y,O),O){U=!0;break}}if(!U)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,U]of J)if(Z.get(G)!==U)return!0;return!1}const X=new WeakMap;for(let[G,U]of J){if(typeof G!=="object"){if(!Z.has(G))return!0;const O=Z.get(G);if(typeof U!=="object"){if(U!==O)return!0;continue}if(typeof O!=="object"||G0(U,O))return!0;continue}let Y=!1,B=!1;for(let[O,K]of Z){if(typeof O!=="object")continue;if(!X.has(G))X.set(G,new WeakMap);const S=X.get(G);if(S.has(O)){const[m,e]=S.get(O);if(m){Y=!0,B=e;break}continue}if(!G0(G,O)){if(Y=!0,B=typeof U==="object"&&typeof K==="object"?!G0(U,K):U===K,S.set(O,[!0,B]),B)break}else S.set(O,[!1,!1])}if(!Y||!B)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],U=Z[X];if(G!==U&&(typeof G!=="object"||G0(G,U)))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],U=J[G],Y=Z[G];if(U===Y)continue;if(U instanceof Date){if(!(Y instanceof Date)||String(U)!==String(Y))return!0;continue}if(U instanceof RegExp){if(!(Y instanceof RegExp)||U.source!==Y.source||U.flags!==Y.flags)return!0;continue}if(U instanceof Map){if(!(Y instanceof Map)||G0(U,Y))return!0;continue}if(U instanceof Set){if(!(Y instanceof Set)||G0(U,Y))return!0;continue}if(U instanceof Function){if(!(Y instanceof Function))return!0;continue}if(typeof U==="object"){if(typeof Y!=="object")return!0;if(U===J){if(Y!==Z)return!0}else if(G0(U,Y))return!0}else return!0}return!1}function w0(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 U=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),Y=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let B=0;B<U.length;B++)if(U[B]!==Y[B])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!G0(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 U of X){if(!Object.prototype.hasOwnProperty.call(Z,U))return!1;if(!w0(J[U],Z[U]))return!1}if(q!==null&&q!==Object.prototype){const U=Object.getOwnPropertyNames(q),Y=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(U.length!==Y.length)return!1;for(let B of U){if(B==="constructor")continue;if(!w0(q[B],Object.getPrototypeOf(Z)[B]))return!1}}return!0}function A5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function $5(J){for(let[Z,W]of J)if(typeof Z==="object"&&Z!==null||typeof W==="object"&&W!==null)return!1;return!0}function W0(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(W0(G,Z),W0(X,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((X)=>q.add(W0(X,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let X=0;X<J.length;X++)q[X]=W0(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]=W0(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))W[q]=W0(J[q],Z);return W}function _5(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 U=X.split(/\.|\[|\]/).filter(Boolean);let Y=q;for(let B=0;B<U.length;B++){const O=U[B],K=!isNaN(Number(O)),S=B===U.length-1,m=!isNaN(Number(U[B+1]));if(S){Y[O]=G;continue}if(!(O in Y))Y[O]=m?[]:{};else if(m&&!Array.isArray(Y[O]))Y[O]=[];else if(!m&&Array.isArray(Y[O]))Y[O]={};Y=Y[O]}}const H=W0(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 F1(J){return JSON.parse(JSON.stringify(J))}var S0="i18n",E0="syn:",L0="fn:",g0="on-",K0=/^\.\.\./,j1=/^\[(.*?)\]$/,_1=/{\s*([^{}]+)\s*}/g,S5=["@html","@text","@format"],b5=["display","visibility","position","width","height"],g5=":n",y1=":pr",x5="m",k5="c",h5="x",o0="*",f5=100;f1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&f1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class L1{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=W0(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 W0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var Q0=e0(p0(),1);var V8=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,U=X;while(U<J.length&&G>0){if(J[U]==="(")G++;if(J[U]===")")G--;U++}if(G===0){const Y=J.slice(X,U-1).trim(),B=J.slice(0,H.index),O=`${g0}${q}="${Y}"`,K=J.slice(U);W=B+O+K,J=W,Z.lastIndex=B.length+O.length}}return W},N8=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],U=C8(G);H=H.replace(X,U)}return H},C8=function(J){let Z="",W=0,H=!1,q="",X=0,G=0,U=0;while(W<J.length){const Y=J[W];if((Y==='"'||Y==="'")&&(W===0||J[W-1]!=="\\")){if(!H)H=!0,q=Y;else if(Y===q)H=!1}if(!H){if(Y==="(")G++;else if(Y===")")G--;else if(Y==="{")U++;else if(Y==="}")U--}if(!H&&G===0&&U===0&&(Y===" "||W===J.length-1)){let B=W;if(W===J.length-1)B=W+1;const O=J.substring(X,B).trim();if(O){const K=R8(O);Z+=" "+K}X=W+1}W++}return Z},R8=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===S0||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=!S5.includes(W)?W.slice(1):W,`:${W}=${H}`;if(W.startsWith(L0)||W.startsWith(g0))return J;if(H.startsWith('"')&&H.endsWith('"')||H.startsWith("'")&&H.endsWith("'")){const q=H.substring(1,H.length-1);if(P8(q))return`:${W}="${q}"`;return J}else return`:${W}="${H}"`};function P8(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 v1(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 ${L0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Z=V8(Z),Z=N8(Z),Z}var T8=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},v5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function x0(J,Z={maxSize:100}){const W=new Set,H=[{value:J,timestamp:Date.now()}];let q=0;const X=()=>{const B=V1[V1.length-1];return B&&T8(B,W),H[q].value},G=()=>{const B=[...W];if(y5)for(let O of B)y5.add(O);else for(let O of B)O.execute()};return[X,(B,O)=>{if(Object.is(H[q].value,B))return;if(q<H.length-1)H.splice(q+1);if(H.push({value:B,timestamp:Date.now(),metadata:O}),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(B){if(B>=0&&B<H.length&&B!==q)q=B,G()},getHistory(){return[...H]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<H.length-1},clear(){const B=H[0];H.length=0,H.push(B),q=0,G()}}]}function r0(J){let Z=!1;const W=()=>{if(Z)throw new Error("Circular dependency detected");if(H.isDisposed)return;Z=!0,v5(H),V1.push(H);try{J()}finally{Z=!1,V1.pop()}},H={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{H.isDisposed=!0,v5(H)}}}var V1=[],y5=null;class k0 extends D1{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:U,macros:Y,declaration:B},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__=v1(Z),this.__boundaries__=O.boundaries,this.declaration=B||{name:J},this.input=W||{},this.static=X||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,H||{}),Y&&this.setMacros(Y),G&&this.setHandler(G),U&&this.setStylesheet(U),this.metrics=new L1(this.debug),this.metrics.inc("componentCount"),this.UQS=new O1(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:W0(this.state),input:W0(this.input),context:W0(this.context)};const[K,S]=x0(this.input),[m,e]=x0(this.state),[t,H0]=x0(this.context);this.__setInput=S,this.__setState=e,this.__getState=m,this.lips.IUC.register(this.__path__,()=>{G0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(r)=>{if(!G0(this.context,r))return;H0(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=r0(()=>{const r=m(),d=this.input=K(),v=this.context=t();if(!this.isRendered){if(this.metrics.reset(),!this.__template__.length||B?.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||Q0.default()}else{const{$log:c}=this.render("",void 0,void 0,this.FGUD);this.$=c}!B?.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:W0(d),state:W0(r),context:W0(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(!G0(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(_5(this.input,J),this.declaration.syntax?Z:void 0),this}setMacros(J){const Z=v1(J),W=Q0.default(Z);if(!W.length)return;const H=this;W.each(function(){const q=Q0.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 d0(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,U=[];this.metrics.startRender();let Y=Q0.default();function B(){return W0(W)}function O(M,j=!1){const D=K(M,j);return X.__inpathCounter__++,X.__inpath__?`${X.__inpath__}/${D}`:`${J?J+"/":""}${D}`}function K(M,j=!1){let D="";switch(M){case"component":D=j?h5:k5;break;case"macro":D=x5;break}return D+X.__inpathCounter__}function S(M){return M!==null&&typeof M==="object"&&typeof M.mesh==="function"&&typeof M.update==="function"}function m(M){return M!==null&&typeof M==="object"&&typeof M.default&&typeof M.default==="string"}function e(M){if(!M.attr(":dtag")||M.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const j=M.attr(":dtag"),D=X.__evaluate__(j,W);if(S(D)||D===null)return d(M,j,D);else if(m(D))return v(M,{template:D});else return v(M,{name:D})}function t(M){const j=M.attr(":args"),D=O("log");if(!j)return;const C=B();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:D,target:"argument",$fragment:null,update:(A)=>X.__evaluate__(`console.log(${j})`,A),syntax:!0}))}function H0(M){const j=O("var"),{attrs:D}=X.__getAttributes__(M);if(!D)return;Object.entries(D.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(D.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(D.map.beforeSpreadAttrs.includes(C))return;const g=X.__evaluate__(L,y);if(w0(y[C].value,g))return;return y[C]={value:g,type:"let"},X.__updateVarDepNodes__(C,j,y),F1({memo:y})};P.forEach((y)=>X.__trackDep__(G,y,B(),{nodetype:"let",nodepath:j,deppath:`${j}.${C}`,target:"attr",$fragment:null,update:A,syntax:!0}))}}),X.metrics.inc("elementCount")}function r(M){const{attrs:j}=X.__getAttributes__(M);if(!j)return;Object.entries(j.literals).forEach(([D,C])=>{if(W[D]&&W[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!C)return;W[D]={value:C,type:"const"}}),Object.entries(j.expressions).forEach(([D,C])=>{if(W[D]&&W[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!C)return;W[D]={value:X.__evaluate__(C,W),type:"const"}}),X.metrics.inc("elementCount")}function d(M,j,D){const{attrs:C}=X.__getAttributes__(M),L=O("element"),P=X.__getBoundaries__(L),A={},y={};let l=B(),g=Q0.default(P.start),x={},N=D;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(K0.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(K0.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(w0(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(M,{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(M,j){let D,C;if(j?.template)D=j.template,C=K("component",D.declaration?.syntax);else{if(C=j?.name||M.prop("tagName")?.toLowerCase(),!C)throw new Error("Invalid component");if(C===X.__name__)throw new Error("Render component within itself is forbidden");D=X.lips.import(C)}if(!D||!C)throw new Error(`<${C}> template not found`);const L=O("component",D.declaration?.syntax),P=`${L}#${C}`,A=X.__getBoundaries__(L),{argv:y,functions:l,attrs:g,events:x}=X.__getAttributes__(M),N={},_={};let R={},k=Q0.default(A.start),F=X.PCC.get(P),T=B();g.literals&&Object.entries(g.literals).forEach(([$,b])=>{if($=="key")return;R[$]=b}),l&&Object.entries(l).forEach(([$,b])=>{R[$]=X.__evaluateFunction__(b,[],T),D.declaration?.syntax?N[E0+L0+$]=b:N[L0+$]=b}),g.expressions&&Object.entries(g.expressions).forEach(([$,b])=>{if($=="key")return;if(K0.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;D.declaration?.syntax?N[E0+$]=b:N[$]=b});const h=M.contents();if(h.length){if(R={...R,...X.__meshwire__({$node:M,fragmentPath:L,fragmentBoundaries:A,meshPath:null,scope:T,argv:y,xmlns:q,useAttributes:!0,declaration:D.declaration},N)},D.declaration){if(D.declaration.tags){let $;Object.entries(D.declaration?.tags).forEach(([b,{type:o,many:i,alts:n}])=>{switch(o){case"nexted":{let Z0=M.next(b);if(!Z0.length&&Array.isArray(n)&&$?.length&&$.is(n.join(",")))Z0=$.next(b);if(!Z0.length)return;if(i){R[b]=[];let a=0,B0=!1;while(!B0){if(R[b].push(X.__meshwire__({$node:Z0,meshPath:`${b}[${a}]`,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:y,xmlns:q,useAttributes:!0,declaration:D.declaration},N)),!Z0.next(b).length){B0=!0;break}Z0=$=Z0.next(b),a++}}else R[b]=X.__meshwire__({$node:Z0,meshPath:b,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:y,xmlns:q,useAttributes:!0,declaration:D.declaration},N)}break;case"child":{const Z0=M.children(b);if(i)R[b]=[],Z0.each(function(a){const B0=Q0.default(this),{argv:D0}=X.__getAttributes__(B0);R[b].push(X.__meshwire__({$node:B0,meshPath:`${b}[${a}]`,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:D0,xmlns:q,useAttributes:!0,declaration:D.declaration},N))});else if(M.children(b).first().length){const a=M.children(b).first(),{argv:B0}=X.__getAttributes__(a);R[b]=X.__meshwire__({$node:a,meshPath:b,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:B0,xmlns:q,useAttributes:!0,declaration:D.declaration},N)}}break}})}else if(D.declaration.contents)R.__contents__=h}}if(F)F.setInput(W0(R)),k=k.add(F.node);else{const{declaration:$,state:b,_static:o,handler:i,context:n,default:Z0,stylesheet:a}=D;F=new k0(C,Z0||"",{state:W0(b),input:W0(R),context:n,_static:W0(o),handler:i,stylesheet:a,declaration:$},{debug:X.debug,lips:X.lips,prepath:L,boundaries:A}),k=k.add(F.node),!D.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(E0))o=!0,$=$.replace(E0,"");if($.startsWith(L0))i=!0,$=$.replace(L0,"");if(K0.test($)){if(X.__isReactive__($,T)){const n=(a)=>{const B0={};X.__evaluateSpreadAttr__($,{memo:a,get keystore(){return _[$]},set keystore(D0){if(!_[$])_[$]=[];_[$]=D0},each:(D0,h0)=>{if(g.map.afterSpreadAttrs.includes(D0))return;B0[D0]=h0},nullify:(D0)=>D0.forEach((h0)=>B0[h0]=void 0)}),F?.subInput(B0,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 B0=i?X.__evaluateFunction__(b,[],a):b?X.__evaluate__(b,a):!0;F?.subInput({[$]:B0},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(M){const j=M.prop("tagName")?.toLowerCase();if(!j)throw new Error("Invalid macro rendering call");const D=X.__macros.get(j);if(!D)throw new Error("Macro component not found");const C=O("macro"),L=X.__getBoundaries__(C),{attrs:P}=X.__getAttributes__(M),A={},y=B(),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(K0.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]=$,D.argv.includes(h))g[h]={value:$,type:"arg"}}}),A[F]=T;else{const h=T?X.__evaluate__(T,y):!0;if(l[F]=h,D.argv.includes(F))g[F]={value:h,type:"arg"},A[F]=T}D.argv.forEach((h)=>{if(g[h]!==void 0)return;g[h]={value:!1,type:"arg"}})}),g.__arguments__=l;let N=Q0.default(L.start);const _={$node:D.$node,meshPath:null,fragmentPath:C,fragmentBoundaries:L,argv:D.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(`^${E0}`).test(F))h=!0,F=F.replace(E0,"");if(K0.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(Z0){if(!x[F])x[F]=[];x[F]=Z0},each:(Z0,a)=>{if(P.map.afterSpreadAttrs.includes(Z0))return;if(w0(a,o[Z0]?.value))return;i[Z0]={value:a,type:"arg"},l[Z0]=a,n.push(Z0)},nullify:(Z0)=>{Z0.forEach((a)=>{i[a]={value:void 0,type:"arg"},delete l[a]}),n=Z0}}),n.length)X.__updateArgumentsDepNodes__(C,l),R.renderer.update(n,i,o);return F1({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),F1({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(M){if(!M.length||!M.prop("tagName"))return M;const j=M.is("svg")||q,D=j?Q0.default(document.createElementNS("http://www.w3.org/2000/svg",M.prop("tagName").toLowerCase())):Q0.default(`<${M.prop("tagName").toLowerCase()}/>`),C=M.contents(),L=O("element"),P=B();C.length&&D.append(X.__withPath__(L,()=>X.render(L+g5,C,P,G,j).$log));const{attrs:A,events:y}=X.__getAttributes__(M);A.literals&&Object.entries(A.literals).forEach(([g,x])=>{if(g===S0)return;const N=M.is(`[${S0}]`)&&["title","placeholder"].includes(g);D.attr(g,N?X.lips.i18n.translate(x).text:x);const _=(R)=>{D.attr(g,N?X.lips.i18n.translate(x).text:x),N&&X.__trackTranslationDep__(R,{nodetype:"element",nodepath:L,deppath:`${L}.${g}`,target:"attr",$fragment:D,update:_})};N&&X.__trackTranslationDep__(P,{nodetype:"element",nodepath:L,deppath:`${L}.${g}`,target:"attr",$fragment:D,update:_})});const l=(g,x=!1)=>{g&&Object.entries(g).forEach(([N,_])=>{switch(N){case"@html":{const R=(k)=>{D.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:D,update:R}))}break;case"@text":{const R=M.is(`[${S0}]`),k=(F)=>{D.text(X.__evaluate__(_,F,{translate:R})),R&&X.__trackTranslationDep__(F,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:D,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:D,update:k}));R&&X.__trackTranslationDep__(P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:D,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&&D.text($),X.__trackTranslationDep__(T,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:D,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:D,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&&D.attr("style",h)}else D.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:D,update:R}))}else D.attr("style",_);break;default:{const R=M.is(`[${S0}]`)&&["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)D.removeAttr(N);else D.attr(N,T),R&&X.__trackTranslationDep__(F,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"attr",$fragment:D,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:D,update:k}));R&&X.__trackTranslationDep__(P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"attr",$fragment:D,update:k})}}})};return A.expressions&&Object.keys(A.expressions).forEach((g)=>{if(!K0.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)=>D.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:D,update:N}))}),l(A.expressions,!0),y&&Object.entries(y).forEach(([g,x])=>{U.push({nodepath:L,element:D,_event:g,instruction:x,scope:P,get __dependencies__(){return G}})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),D}function J0(M){const j=M.text(),D=B(),C=O("element"),L=M.parent().is(`[${S0}]`),P=Q0.default(document.createTextNode(X.__interpolate__(j,D,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,D))X.__extractTextDeps__(j,D).forEach((l)=>X.__trackDep__(G,l,D,{nodetype:"text",nodepath:C,deppath:`${C}.${l}`,target:"value",$fragment:P,update:A}));return L&&X.__trackTranslationDep__(D,{nodetype:"text",nodepath:C,target:"value",$fragment:P,update:A}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),P}function u(M){if(M.get(0)?.nodeType===Node.COMMENT_NODE)return M;if(M.get(0)?.nodeType===Node.TEXT_NODE)return J0(M);if(M.is("let"))return H0(M);else if(M.is("const"))return r(M);else if(M.is("lips")&&M.attr(":dtag"))return e(M);else if(M.is("log"))return t(M);else if(X.__macros.has(M.prop("tagName")?.toLowerCase()))return c(M);else if(M.is("if, for, switch, async")||X.lips.has(M.prop("tagName")?.toLowerCase()))return v(M);else if(M.is("else-if, else"))return;return p(M)}try{this.__renderDepth__++,Z=!Z&&Q0.default(this.__template__).length>1?Q0.default("<template>").html(this.__template__).contents():Z||Q0.default(this.__template__),Z.each(function(){const M=u(Q0.default(this));if(M)Y=Y.add(M)}),U.forEach(this.__attachEvent__.bind(this)),X.metrics.inc("renderCount")}catch(M){console.error("Rendering Failed --",M),X.metrics.trackError(M)}finally{if(this.__renderDepth__--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth__===0)this.__inpath__="",this.__inpathCounter__=0}return{$log:Y,dependencies:G,events:U}}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)=>{Q0.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:U,xmlns:Y,declaration:B,useAttributes:O}=J;let K;const S=new Map,m=X+y1,e=(d,v,c)=>{if(K=H.contents(),!K?.length)return null;v=v||J.scope;const p=m+(c||""),{$log:J0,dependencies:u,events:M}=W.__withPath__(p,()=>{return W.render(p,K,{...v,...d},void 0,Y)}),j=c||o0;return!S.has(j)&&S.set(j,new Set),S.get(j)?.add(p),u?.forEach((D,C)=>{!W.FGUD?.has(C)&&W.FGUD.set(C,new Map),D.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"),J0},t=(d,v,c,p,J0)=>{if(!S.get(J0||o0)?.size)return;c=c||J.scope,p=p||G,W.metrics.startRender();const u=Array.from(S.get(J0||o0)||[]);d.forEach((M)=>{const j=W.FGUD.get(M);if(!j)return;j.forEach((D)=>{const C=u.find((A)=>{return D.partial?.find((y)=>A==y||W.__hasSamePathParent__(y,A))});if(!D.partial||!C)return;const L=D.deppath||D.nodepath,P=this.FGUDMemory.get(D.nodepath);if(D.garbage||p?.start&&!document.contains(p.start)){j.delete(L),W.__unbindMemo__(D);return}if(!P){console.warn(`unexpected occurence: <${L}> has no memo`);return}if(P.memo?.[M]&&v?.[M]&&!w0(P.memo[M],v[M]))P.memo={...c,...P.memo,...v};W.UQS.queue({dep:M,deppath:L,priority:D.priority}),W.metrics.inc("dependencyUpdateCount")}),!j.size&&W.FGUD.delete(M)}),W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},H0=(d,v)=>{if(W.FGUD.forEach((c,p)=>{c.forEach((J0,u)=>{if(!W.__hasSamePathParent__(u,m+(v||"")))return;W.__unbindMemo__(J0),J0.garbage=!0}),!c.size&&W.FGUD.delete(p)}),S.delete(typeof v==="string"&&v||o0),d=d||G,W.__emptyBoundaries__(d),v)d.start.remove(),d.end.remove()},r={renderer:{path:q,argv:U,mesh:e,update:t,cleanup:H0,fill(d,v){W.__fillBoundaries__(d,v||G)},demarcate(d,v){const c=W.__getBoundaries__(m+(v||""));let p=Q0.default(c.start);return p=p.add(d),p=p.add(c.end),{$partial:p,boundaries:c}}}};if(O&&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(K0.test(v)){let p=[];W.__evaluateSpreadAttr__(v,{memo:J.scope,get keystore(){return p},set keystore(J0){p=J0},each:(J0,u)=>r[J0]=u}),Z[`${B?.syntax?E0:""}${q}.${v}`]=c}else r[v]=c?W.__evaluate__(c,J.scope):!0,Z[`${B?.syntax?E0:""}${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;Q0.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&&Q0.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((Y)=>K0.test(Y));let G=[],U=!1;return Z&&Object.entries(Z).forEach(([Y,B])=>{if(Y==":dtag")return;if(Y.startsWith(":")||Y.startsWith(L0)||Y.startsWith(g0)||K0.test(Y)||j1.test(Y))if(j1.test(Y)){const[O,K]=Y.match(j1)||[];G=K.split(",")}else if(Y.startsWith(g0))W[Y.replace(g0,"")]=B;else if(Y.startsWith(L0))H[Y.replace(L0,"")]=B;else{if(Y.startsWith(":"))Y=Y.slice(1,Y.length);if(X)if(K0.test(Y))q.map.spreadAttrs.push(Y),U=!0;else q.map.explicitAttrs.push(Y),!U?q.map.beforeSpreadAttrs.push(Y):q.map.afterSpreadAttrs.push(Y);q.expressions[Y]=B||""}else if(q.literals[Y]=B,X)q.map.explicitAttrs.push(Y),!U?q.map.beforeSpreadAttrs.push(Y):q.map.afterSpreadAttrs.push(Y)}),{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+y1}`)}__evaluate__(J,Z,W){J=typeof J==="string"?J.trim():J;try{const H=(q)=>{const X=this.state.toJSON(),G=(Y,...B)=>{try{return Y(...B)}catch(O){!W?.mute&&console.error("Eval error --",O);return}};let U=`return ${q};`;if(Z){let Y={},B;for(let K in Z){if(K==="__arguments__")continue;Y[K]=Z[K].value}if(typeof Z.__arguments__==="object")B=Z.__arguments__;U=`with( scope ){ ${U} }`;const O=new Function("self","input","state","static","context","scope","arguments",U);return G(O,this,this.input,X,this.static,this.context,Y||{},B)}else{const Y=new Function("self","input","state","static","context",U);return G(Y,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(_1,(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 U=q.map((Y)=>this.__evaluate__(Y,W));if(Z.length)U=[...U,...Z];return X(...U)}}__evaluateSpreadAttr__(J,Z){const W=this.__evaluate__(J.replace(K0,""),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(_1,(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 U=X;if(Z.on(H,(...Y)=>this.__evaluateFunction__(q,Y,U)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(q,X))this.__extractExpressionDeps__(q,X).forEach((B)=>this.__trackDep__(G,B,X||{},{nodetype:"event",nodepath:W,deppath:`${W}.${H}`,target:"event-handler",$fragment:!(Z instanceof k0)?Z:null,boundaries:Z instanceof k0?Z.__boundaries__:void 0,update:(O)=>{U=O}}))}__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),U=`${Z}.${W}`;G.forEach((Y)=>{X.get(Y)?.delete(U),this.FGUD.get(Y)?.delete(U)})}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((U)=>W.add(U))}),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"),U=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");X=[...X,...Array.from(J.matchAll(G)),...Array.from(J.matchAll(U))]}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)=>b5.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*f5+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!w0(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"?Q0.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?Q0.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?Q0.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var u1={};c0(u1,{handler:()=>{{return $8}},declaration:()=>{{return E8}},_static:()=>{{return A8}}});var E8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},A8={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){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 m1={};c0(m1,{handler:()=>{{return g8}},declaration:()=>{{return S8}},_static:()=>{{return b8}}});var N0=e0(p0(),1);var S8={name:"for",syntax:!0},b8={lastIn:null,argvlist:null,initialized:!1,prevRenderer:null,processingBatch:!1},g8={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:U}=J.demarcate(X,q);return this.static.prevRenderer=J,this.static.argvlist.push({argvalues:W,boundaries:G}),U},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[Y]=J.argv;if(Y){let B=Z;if(this.static.argvlist.length===G){for(let K=0;K<this.static.argvlist.length;K++)this.static.argvlist[K].argvalues[Y].value!==B&&this.updateItem(J,H,{[Y]:{value:B,type:"arg"}},K),B=X?B+1:B-1;return}const O=Math.min(this.static.argvlist.length,G);for(let K=0;K<O;K++)this.updateItem(J,H,{[Y]:{value:K,type:"arg"}},K);if(G>this.static.argvlist.length)for(let K=this.static.argvlist.length;K<G;K++){const S={[Y]:{value:K,type:"arg"}};this.boundaries&&N0.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 U=N0.default();for(let Y=Z;X?Y<=W:Y>=W;X?Y++:Y--){const B={},[O]=J.argv;if(O)B[O]={value:Y,type:"arg"};U=U.add(this.addItem(J,H,B,Y))}if(!U?.length)return;if(q)return U;J.fill(U)},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,U]=J.argv;if(G){if(this.static.argvlist.length===Z.length){for(let B=0;B<this.static.argvlist.length;B++)!w0(this.static.argvlist[B].argvalues[G].value,Z[B])&&this.updateItem(J,W,{[G]:{value:Z[B],type:"arg"},[U]:{value:B,type:"arg"}},B);return}const Y=Math.min(this.static.argvlist.length,Z.length);for(let B=0;B<Y;B++)this.updateItem(J,W,{[G]:{value:Z[B],type:"arg"},[U]:{value:B,type:"arg"}},B);if(Z.length>this.static.argvlist.length)for(let B=this.static.argvlist.length;B<Z.length;B++){const O={[G]:{value:Z[B],type:"arg"},[U]:{value:B,type:"arg"}};this.boundaries&&N0.default(this.boundaries.end).before(this.addItem(J,W,O,B))}else if(Z.length<this.static.argvlist.length)for(let B=this.static.argvlist.length-1;B>=Z.length;B--)this.removeItem(J,B)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N0.default(),X=0;for(let G of Z){const U={},[Y,B]=J.argv;if(Y)U[Y]={value:G,type:"arg"};if(B)U[B]={value:X,type:"arg"};q=q.add(this.addItem(J,W,U,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,U,Y]=J.argv,B=Array.from(Z.entries());if(G){if(this.static.argvlist.length===B.length){for(let K=0;K<this.static.argvlist.length;K++)!w0(this.static.argvlist[K].argvalues[G].value,B[K][0])||!w0(this.static.argvlist[K].argvalues[U].value,B[K][1])&&this.updateItem(J,W,{[G]:{value:B[K][0],type:"arg"},[U]:{value:B[K][1],type:"arg"},[Y]:{value:K,type:"arg"}},K);return}const O=Math.min(this.static.argvlist.length,B.length);for(let K=0;K<O;K++)this.updateItem(J,W,{[G]:{value:B[K][0],type:"arg"},[U]:{value:B[K][1],type:"arg"},[Y]:{value:K,type:"arg"}},K);if(B.length>this.static.argvlist.length)for(let K=this.static.argvlist.length;K<B.length;K++){const S={[G]:{value:B[K][0],type:"arg"},[U]:{value:B[K][1],type:"arg"},[Y]:{value:K,type:"arg"}};this.boundaries&&N0.default(this.boundaries.end).before(this.addItem(J,W,S,K))}else if(B.length<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=B.length;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N0.default(),X=0;for(let[G,U]of Z){const Y={},[B,O,K]=J.argv;if(B)Y[B]={value:G,type:"arg"};if(O)Y[O]={value:U,type:"arg"};if(K)Y[K]={value:X,type:"arg"};q=q.add(this.addItem(J,W,Y,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,U,Y]=J.argv,B=Object.entries(Z);if(G){if(this.static.argvlist.length===B.length){for(let K=0;K<this.static.argvlist.length;K++)!w0(this.static.argvlist[K].argvalues[G].value,B[K][0])||!w0(this.static.argvlist[K].argvalues[U].value,B[K][1])&&this.updateItem(J,W,{[G]:{value:B[K][0],type:"arg"},[U]:{value:B[K][1],type:"arg"},[Y]:{value:K,type:"arg"}},K);return}const O=Math.min(this.static.argvlist.length,B.length);for(let K=0;K<O;K++)this.updateItem(J,W,{[G]:{value:B[K][0],type:"arg"},[U]:{value:B[K][1],type:"arg"},[Y]:{value:K,type:"arg"}},K);if(B.length>this.static.argvlist.length){let K=N0.default();for(let S=this.static.argvlist.length;S<B.length;S++){const m={[G]:{value:B[S][0],type:"arg"},[U]:{value:B[S][1],type:"arg"},[Y]:{value:S,type:"arg"}},e=this.addItem(J,W,m,S);K=K.add(e)}this.boundaries&&N0.default(this.boundaries.end).before(K)}else if(B.length<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=B.length;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N0.default(),X=0;for(let G in Z){const U={},[Y,B,O]=J.argv;if(Y)U[Y]={value:G,type:"arg"};if(B)U[B]={value:Z[G],type:"arg"};if(O)U[O]={value:X,type:"arg"};q=q.add(this.addItem(J,W,U,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 d1={};c0(d1,{handler:()=>{{return h8}},declaration:()=>{{return x8}},_static:()=>{{return k8}}});var x8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},k8={initialized:!1,finalized:!1,prevRenderer:null},h8={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 i1={};c0(i1,{handler:()=>{{return y8}},declaration:()=>{{return f8}},_static:()=>{{return _8}}});var f8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},_8={initialized:!1,prevRenderer:null},y8={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 c1={};c0(c1,{state:()=>{{return v8}},handler:()=>{{return i8}},default:()=>{{return c8}},context:()=>{{return m8}},_static:()=>{{return u8}}});var d8=function(J){const Z={};return J.split("&").map((H)=>{const[q,X]=H.split("=");Z[q]=X}),Z},v8={page:null,params:{},query:{}},u8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},m8=["navigate"],i8={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]?d8(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:U}=X;this.emit("after",{fromState:q,toState:{path:G.path,params:U,query:H}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=U,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 U=0;U+1<G.length&&U<q.length;U++)Z[q[U].replaceAll(/[\/:]/g,"")]=G[U+1];W=H;break}}return W?{route:W,params:Z}:!1}},c8="<{state.page} params=state.params query=state.query/>";class i0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new X1;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new Q1,this.IUC=new Z1;const[Z,W]=x0(this.i18n.lang),[H,q]=x0(J?.context||{});this.__setLang=W,this.__getLang=Z,this.__setContext=q,this.__getContext=H,this.register("if",u1),this.register("for",m1),this.register("async",d1),this.register("switch",i1),this.register("router",c1)}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 k0(J,H||"",{...q,input:W},X);return window.addEventListener("beforeunload",()=>{return this.dispose(),G.destroy(),null}),window.addEventListener("pagehide",(U)=>{!U.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 d0("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};G0(W,H)&&this.__setContext(H)}else if(!Array.isArray(J)){const H={...W,...J};G0(W,H)&&this.__setContext(H)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;r0(()=>{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){r0(()=>{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())}}function p8(J="body"){const Z={counter:0,counterHistory:[],updateFrequency:16,isRunning:!1,metrics:{fps:0,avgRenderTime:0,totalUpdates:0,memoryUsageMB:0,domOperations:0}},W={updateInterval:null,frameCountInterval:null,frameCount:0,lastFrameTimestamp:0,updateTimes:[]},H={onCreate(){console.log("Stress test component created")},onMount(){console.log("Stress test component mounted"),this.startPerformanceTracking()},onRender(){const Y=performance.now();if(this.static.lastFrameTimestamp){const B=Y-this.static.lastFrameTimestamp;if(B<1000){if(this.static.updateTimes.push(B),this.static.updateTimes.length>100)this.static.updateTimes.shift()}}this.static.lastFrameTimestamp=Y,this.static.frameCount++},startPerformanceTracking(){this.static.frameCountInterval=setInterval(()=>{if(this.state.metrics.fps=this.static.frameCount,this.static.frameCount=0,this.static.updateTimes.length){const Y=this.static.updateTimes.reduce((B,O)=>B+O,0)/this.static.updateTimes.length;this.state.metrics.avgRenderTime=Y}if(window.performance&&window.performance.memory)this.state.metrics.memoryUsageMB=window.performance.memory.usedJSHeapSize/1048576},1000)},startStressTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.counterHistory=[],this.static.updateInterval=setInterval(()=>{if(this.state.counter++,this.state.metrics.totalUpdates++,this.state.counterHistory.length>100)this.state.counterHistory.shift();this.state.counterHistory.push(this.state.counter)},this.state.updateFrequency)},stopStressTest(){if(!this.state.isRunning)return;clearInterval(this.static.updateInterval),this.state.isRunning=!1},setUpdateFrequency(Y){const B=parseFloat(Y.target.value);if(this.state.updateFrequency=B,this.state.isRunning)this.stopStressTest(),this.startStressTest()},resetCounter(){this.state.counter=0,this.state.counterHistory=[],this.state.metrics.totalUpdates=0},runHeavyComputation(){const Y=performance.now();let B=0;for(let O=0;O<1e7;O++)B+=Math.sqrt(O);console.log(`Heavy computation completed in ${performance.now()-Y}ms, result: ${B}`)},destroy(){clearInterval(this.static.updateInterval),clearInterval(this.static.frameCountInterval)}},U=new i0({debug:!0}).render("StressTestApp",{default:`
|
|
2
2
|
<div class="stress-test-container">
|
|
3
3
|
<h2>Lips Framework Stress Test</h2>
|
|
4
4
|
|
|
@@ -205,7 +205,7 @@ var K8=Object.create;var{defineProperty:g1,getPrototypeOf:O8,getOwnPropertyNames
|
|
|
205
205
|
font-size: 1.1em;
|
|
206
206
|
color: #1976d2;
|
|
207
207
|
}
|
|
208
|
-
`},{});return
|
|
208
|
+
`},{});return U.appendTo(J),U}function s8(J="body",Z=5000){console.log(`Running high frequency update test for ${Z}ms...`);const W={counter:0,elapsedTime:0,updatesPerSecond:0,totalUpdates:0,isRunning:!1,testComplete:!1,testResults:{totalUpdates:0,duration:0,updatesPerSecond:0,avgUpdateTime:0}},H={updateIntervalId:null,startTime:0,updateTimes:[]},q={startTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.testComplete=!1,this.state.counter=0,this.state.totalUpdates=0,this.state.elapsedTime=0,this.static.startTime=performance.now(),this.static.updateTimes=[];const B=()=>{if(!this.state.isRunning)return;const O=performance.now();if(this.state.counter++,this.state.totalUpdates++,this.state.elapsedTime=O-this.static.startTime,this.state.elapsedTime>0)this.state.updatesPerSecond=Math.round(this.state.totalUpdates/this.state.elapsedTime*1000);const K=performance.now();if(this.static.updateTimes.push(K-O),this.state.elapsedTime>=Z){this.finishTest();return}requestAnimationFrame(B)};requestAnimationFrame(B)},finishTest(){this.state.isRunning=!1,this.state.testComplete=!0;const B=this.static.updateTimes.reduce((O,K)=>O+K,0)/this.static.updateTimes.length;this.state.testResults={totalUpdates:this.state.totalUpdates,duration:this.state.elapsedTime,updatesPerSecond:this.state.updatesPerSecond,avgUpdateTime:B},console.log("High Frequency Test Results:",this.state.testResults)}},X=`
|
|
209
209
|
<div class="high-freq-test">
|
|
210
210
|
<h2>High Frequency Update Test</h2>
|
|
211
211
|
<p>This test measures how many state updates Lips can handle per second.</p>
|
|
@@ -250,7 +250,7 @@ var K8=Object.create;var{defineProperty:g1,getPrototypeOf:O8,getOwnPropertyNames
|
|
|
250
250
|
</else>
|
|
251
251
|
</div>
|
|
252
252
|
</div>
|
|
253
|
-
`,
|
|
253
|
+
`,G=`
|
|
254
254
|
.high-freq-test {
|
|
255
255
|
max-width: 600px;
|
|
256
256
|
margin: 20px auto;
|
|
@@ -316,7 +316,7 @@ var K8=Object.create;var{defineProperty:g1,getPrototypeOf:O8,getOwnPropertyNames
|
|
|
316
316
|
td:first-child {
|
|
317
317
|
font-weight: bold;
|
|
318
318
|
}
|
|
319
|
-
`,
|
|
319
|
+
`,Y=new i0({debug:!0}).render("HighFrequencyTest",{default:X,state:W,handler:q,stylesheet:G},{});return Y.appendTo(J),Y}function u5(J="body"){const Z={nodeCount:1000,renderTime:0,isRendering:!1,nodes:[]},W={createNodes(U){this.state.isRendering=!0;const Y=performance.now(),B=[];for(let O=0;O<U;O++)B.push({id:O,value:`Node ${O}: ${Math.random().toString(36).substring(2,15)}`});this.state.nodes=B,this.state.renderTime=performance.now()-Y,setTimeout(()=>{this.state.renderTime=performance.now()-Y,this.state.isRendering=!1},10)},shuffleNodes(){this.state.isRendering=!0;const U=performance.now(),Y=[...this.state.nodes];for(let B=Y.length-1;B>0;B--){const O=Math.floor(Math.random()*(B+1));[Y[B],Y[O]]=[Y[O],Y[B]]}this.state.nodes=Y,setTimeout(()=>{this.state.renderTime=performance.now()-U,this.state.isRendering=!1},10)},updateValues(){this.state.isRendering=!0;const U=performance.now(),Y=this.state.nodes.map((B)=>({...B,value:`Node ${B.id}: ${Math.random().toString(36).substring(2,15)}`}));this.state.nodes=Y,setTimeout(()=>{this.state.renderTime=performance.now()-U,this.state.isRendering=!1},10)},setNodeCount(U){this.state.nodeCount=parseInt(U.target.value,10)}},G=new i0({debug:!0}).render("DOMStressTest",{default:`
|
|
320
320
|
<div class="dom-stress-test">
|
|
321
321
|
<h2>DOM Stress Test</h2>
|
|
322
322
|
|
|
@@ -445,7 +445,7 @@ var K8=Object.create;var{defineProperty:g1,getPrototypeOf:O8,getOwnPropertyNames
|
|
|
445
445
|
.node:last-child {
|
|
446
446
|
border-bottom: none;
|
|
447
447
|
}
|
|
448
|
-
`},{});return
|
|
448
|
+
`},{});return G.appendTo(J),G}function a6(J="body"){const Z=document.createElement("div");Z.className="stress-tests-suite",Z.innerHTML=`
|
|
449
449
|
<h1>Lips Framework Stress Test Suite</h1>
|
|
450
450
|
|
|
451
451
|
<div class="test-section" id="stress-test"></div>
|
|
@@ -473,4 +473,4 @@ var K8=Object.create;var{defineProperty:g1,getPrototypeOf:O8,getOwnPropertyNames
|
|
|
473
473
|
}
|
|
474
474
|
`,document.head.appendChild(W),document.querySelector(J)?.appendChild(Z),p8("#stress-test"),s8("#high-frequency-test",3000),u5("#dom-stress-test"),{container:Z}}u5();export{s8 as runHighFrequencyTest,u5 as runDOMStressTest,a6 as runAllStressTests,p8 as createLipsStressTest};
|
|
475
475
|
|
|
476
|
-
//# debugId=
|
|
476
|
+
//# debugId=6F96B9EA6365CCED64756e2164756e21
|