@lipsjs/lips 0.0.15 → 0.1.1

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