@lipsjs/lips 0.0.6 → 0.0.8

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.
@@ -1,4 +1,4 @@
1
- var X6=Object.create;var{defineProperty:T1,getPrototypeOf:H6,getOwnPropertyNames:z6}=Object;var q6=Object.prototype.hasOwnProperty;var A1=(J,Z,W)=>{W=J!=null?X6(H6(J)):{};const z=Z||!J||!J.__esModule?T1(W,"default",{value:J,enumerable:!0}):W;for(let q of z6(J))if(!q6.call(z,q))T1(z,q,{get:()=>J[q],enumerable:!0});return z};var Y6=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var i0=(J,Z)=>{for(var W in Z)T1(J,W,{get:Z[W],enumerable:!0,configurable:!0,set:(z)=>Z[W]=()=>z})};var W1=Y6((Q5,W5)=>{(function(){var J=document,Z=window,W=J.documentElement,z=J.createElement.bind(J),q=z("div"),Y=z("table"),G=z("tbody"),X=z("tr"),M=Array.isArray,U=Array.prototype,j=U.concat,$=U.filter,g=U.indexOf,_=U.map,u=U.push,p=U.slice,a=U.some,i=U.splice,s=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,Z0=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/<.+>/,y=/^\w+$/;function k(Q,H){var B=m(H);return!Q||!B&&!C(H)&&!P(H)?[]:!B&&Z0.test(Q)?H.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!B&&y.test(Q)?H.getElementsByTagName(Q):H.querySelectorAll(Q)}var K=function(){function Q(H,B){if(!H)return;if(S(H))return H;var D=H;if(E(H)){var F=B||J;if(D=s.test(H)&&C(F)?F.getElementById(H.slice(1).replace(/\\/g,"")):d.test(H)?d1(H):S(F)?F.find(H):E(F)?w(F).find(H):k(H,F),!D)return}else if(V(H))return this.ready(H);if(D.nodeType||D===Z)D=[D];this.length=D.length;for(var R=0,h=this.length;R<h;R++)this[R]=D[R]}return Q.prototype.init=function(H,B){return new Q(H,B)},Q}(),O=K.prototype,w=O.init;if(w.fn=w.prototype=O,O.length=0,O.splice=i,typeof Symbol==="function")O[Symbol.iterator]=U[Symbol.iterator];function S(Q){return Q instanceof K}function L(Q){return!!Q&&Q===Q.window}function C(Q){return!!Q&&Q.nodeType===9}function m(Q){return!!Q&&Q.nodeType===11}function P(Q){return!!Q&&Q.nodeType===1}function x(Q){return!!Q&&Q.nodeType===3}function f(Q){return typeof Q==="boolean"}function V(Q){return typeof Q==="function"}function E(Q){return typeof Q==="string"}function T(Q){return Q===void 0}function N(Q){return Q===null}function I(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function A(Q){if(typeof Q!=="object"||Q===null)return!1;var H=Object.getPrototypeOf(Q);return H===null||H===Object.prototype}w.isWindow=L,w.isFunction=V,w.isArray=M,w.isNumeric=I,w.isPlainObject=A;function b(Q,H,B){if(B){var D=Q.length;while(D--)if(H.call(Q[D],D,Q[D])===!1)return Q}else if(A(Q)){var F=Object.keys(Q);for(var D=0,R=F.length;D<R;D++){var h=F[D];if(H.call(Q[h],h,Q[h])===!1)return Q}}else for(var D=0,R=Q.length;D<R;D++)if(H.call(Q[D],D,Q[D])===!1)return Q;return Q}w.each=b,O.each=function(Q){return b(this,Q)},O.empty=function(){return this.each(function(Q,H){while(H.firstChild)H.removeChild(H.firstChild)})};function c(){var Q=[];for(var H=0;H<arguments.length;H++)Q[H]=arguments[H];var B=f(Q[0])?Q.shift():!1,D=Q.shift(),F=Q.length;if(!D)return{};if(!F)return c(B,w,D);for(var R=0;R<F;R++){var h=Q[R];for(var v in h)if(B&&(M(h[v])||A(h[v]))){if(!D[v]||D[v].constructor!==h[v].constructor)D[v]=new h[v].constructor;c(B,D[v],h[v])}else D[v]=h[v]}return D}w.extend=c,O.extend=function(Q){return c(O,Q)};var l=/\S+/g;function o(Q){return E(Q)?Q.match(l)||[]:[]}O.toggleClass=function(Q,H){var B=o(Q),D=!T(H);return this.each(function(F,R){if(!P(R))return;b(B,function(h,v){if(D)H?R.classList.add(v):R.classList.remove(v);else R.classList.toggle(v)})})},O.addClass=function(Q){return this.toggleClass(Q,!0)},O.removeAttr=function(Q){var H=o(Q);return this.each(function(B,D){if(!P(D))return;b(H,function(F,R){D.removeAttribute(R)})})};function D0(Q,H){if(!Q)return;if(E(Q)){if(arguments.length<2){if(!this[0]||!P(this[0]))return;var B=this[0].getAttribute(Q);return N(B)?void 0:B}if(T(H))return this;if(N(H))return this.removeAttr(Q);return this.each(function(F,R){if(!P(R))return;R.setAttribute(Q,H)})}for(var D in Q)this.attr(D,Q[D]);return this}O.attr=D0,O.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},O.hasClass=function(Q){return!!Q&&a.call(this,function(H){return P(H)&&H.classList.contains(Q)})},O.get=function(Q){if(T(Q))return p.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},O.eq=function(Q){return w(this.get(Q))},O.first=function(){return this.eq(0)},O.last=function(){return this.eq(-1)};function e(Q){if(T(Q))return this.get().map(function(H){return P(H)||x(H)?H.textContent:""}).join("");return this.each(function(H,B){if(!P(B))return;B.textContent=Q})}O.text=e;function r(Q,H,B){if(!P(Q))return;var D=Z.getComputedStyle(Q,null);return B?D.getPropertyValue(H)||void 0:D[H]||Q.style[H]}function z0(Q,H){return parseInt(r(Q,H),10)||0}function d0(Q,H){return z0(Q,"border".concat(H?"Left":"Top","Width"))+z0(Q,"padding".concat(H?"Left":"Top"))+z0(Q,"padding".concat(H?"Right":"Bottom"))+z0(Q,"border".concat(H?"Right":"Bottom","Width"))}var R0={};function N0(Q){if(R0[Q])return R0[Q];var H=z(Q);J.body.insertBefore(H,null);var B=r(H,"display");return J.body.removeChild(H),R0[Q]=B!=="none"?B:"block"}function K0(Q){return r(Q,"display")==="none"}function x0(Q,H){var B=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!B&&!!H&&B.call(Q,H)}function T0(Q){return E(Q)?function(H,B){return x0(B,Q)}:V(Q)?Q:S(Q)?function(H,B){return Q.is(B)}:!Q?function(){return!1}:function(H,B){return B===Q}}O.filter=function(Q){var H=T0(Q);return w($.call(this,function(B,D){return H.call(B,D,B)}))};function S0(Q,H){return!H?Q:Q.filter(H)}O.detach=function(Q){return S0(this,Q).each(function(H,B){if(B.parentNode)B.parentNode.removeChild(B)}),this};var b5=/^\s*<(\w+)[^>]*>/,_5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,m1={"*":q,tr:G,td:X,th:X,thead:Y,tbody:Y,tfoot:Y};function d1(Q){if(!E(Q))return[];if(_5.test(Q))return[z(RegExp.$1)];var H=b5.test(Q)&&RegExp.$1,B=m1[H]||m1["*"];return B.innerHTML=Q,w(B.childNodes).detach().get()}w.parseHTML=d1,O.has=function(Q){var H=E(Q)?function(B,D){return k(Q,D).length}:function(B,D){return D.contains(Q)};return this.filter(H)},O.not=function(Q){var H=T0(Q);return this.filter(function(B,D){return(!E(Q)||P(D))&&!H.call(D,B,D)})};function I0(Q,H,B,D){var F=[],R=V(H),h=D&&T0(D);for(var v=0,U0=Q.length;v<U0;v++)if(R){var W0=H(Q[v]);if(W0.length)u.apply(F,W0)}else{var Y0=Q[v][H];while(Y0!=null){if(D&&h(-1,Y0))break;F.push(Y0),Y0=B?Y0[H]:null}}return F}function i1(Q){if(Q.multiple&&Q.options)return I0($.call(Q.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return Q.value||""}function x5(Q){if(!arguments.length)return this[0]&&i1(this[0]);return this.each(function(H,B){var D=B.multiple&&B.options;if(D||J5.test(B.type)){var F=M(Q)?_.call(Q,String):N(Q)?[]:[String(Q)];if(D)b(B.options,function(R,h){h.selected=F.indexOf(h.value)>=0},!0);else B.checked=F.indexOf(B.value)>=0}else B.value=T(Q)||N(Q)?"":Q})}O.val=x5,O.is=function(Q){var H=T0(Q);return a.call(this,function(B,D){return H.call(B,D,B)})},w.guid=1;function j0(Q){return Q.length>1?$.call(Q,function(H,B,D){return g.call(D,H)===B}):Q}w.unique=j0,O.add=function(Q,H){return w(j0(this.get().concat(w(Q,H).get())))},O.children=function(Q){return S0(w(j0(I0(this,function(H){return H.children}))),Q)},O.parent=function(Q){return S0(w(j0(I0(this,"parentNode"))),Q)},O.index=function(Q){var H=Q?w(Q)[0]:this[0],B=Q?this:w(H).parent().children();return g.call(B,H)},O.closest=function(Q){var H=this.filter(Q);if(H.length)return H;var B=this.parent();if(!B.length)return H;return B.closest(Q)},O.siblings=function(Q){return S0(w(j0(I0(this,function(H){return w(H).parent().children().not(H)}))),Q)},O.find=function(Q){return w(j0(I0(this,function(H){return k(Q,H)})))};var g5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,h5=/^$|^module$|\/(java|ecma)script/i,k5=["type","src","nonce","noModule"];function f5(Q,H){var B=w(Q);B.filter("script").add(B.find("script")).each(function(D,F){if(h5.test(F.type)&&W.contains(F)){var R=z("script");R.text=F.textContent.replace(g5,""),b(k5,function(h,v){if(F[v])R[v]=F[v]}),H.head.insertBefore(R,null),H.head.removeChild(R)}})}function y5(Q,H,B,D,F){if(D)Q.insertBefore(H,B?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(H,Q);else Q.parentNode.insertBefore(H,B?Q:Q.nextSibling);if(F)f5(H,Q.ownerDocument)}function P0(Q,H,B,D,F,R,h,v){return b(Q,function(U0,W0){b(w(W0),function(Y0,A0){b(w(H),function(M0,r0){var P1=B?A0:r0,E1=B?r0:A0,B0=B?Y0:M0;y5(P1,!B0?E1:E1.cloneNode(!0),D,F,!B0)},v)},h)},R),H}O.after=function(){return P0(arguments,this,!1,!1,!1,!0,!0)},O.append=function(){return P0(arguments,this,!1,!1,!0)};function v5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if(T(Q))return this;var H=/<script[\s>]/.test(Q);return this.each(function(B,D){if(!P(D))return;if(H)w(D).empty().append(Q);else D.innerHTML=Q})}O.html=v5,O.appendTo=function(Q){return P0(arguments,this,!0,!1,!0)},O.wrapInner=function(Q){return this.each(function(H,B){var D=w(B),F=D.contents();F.length?F.wrapAll(Q):D.append(Q)})},O.before=function(){return P0(arguments,this,!1,!0)},O.wrapAll=function(Q){var H=w(Q),B=H[0];while(B.children.length)B=B.firstElementChild;return this.first().before(H),this.appendTo(B)},O.wrap=function(Q){return this.each(function(H,B){var D=w(Q)[0];w(B).wrapAll(!H?D:D.cloneNode(!0))})},O.insertAfter=function(Q){return P0(arguments,this,!0,!1,!1,!1,!1,!0)},O.insertBefore=function(Q){return P0(arguments,this,!0,!0)},O.prepend=function(){return P0(arguments,this,!1,!0,!0,!0,!0)},O.prependTo=function(Q){return P0(arguments,this,!0,!0,!0,!1,!1,!0)},O.contents=function(){return w(j0(I0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},O.next=function(Q,H,B){return S0(w(j0(I0(this,"nextElementSibling",H,B))),Q)},O.nextAll=function(Q){return this.next(Q,!0)},O.nextUntil=function(Q,H){return this.next(H,!0,Q)},O.parents=function(Q,H){return S0(w(j0(I0(this,"parentElement",!0,H))),Q)},O.parentsUntil=function(Q,H){return this.parents(H,Q)},O.prev=function(Q,H,B){return S0(w(j0(I0(this,"previousElementSibling",H,B))),Q)},O.prevAll=function(Q){return this.prev(Q,!0)},O.prevUntil=function(Q,H){return this.prev(H,!0,Q)},O.map=function(Q){return w(j.apply([],_.call(this,function(H,B){return Q.call(H,B,H)})))},O.clone=function(){return this.map(function(Q,H){return H.cloneNode(!0)})},O.offsetParent=function(){return this.map(function(Q,H){var B=H.offsetParent;while(B&&r(B,"position")==="static")B=B.offsetParent;return B||W})},O.slice=function(Q,H){return w(p.call(this,Q,H))};var u5=/-([a-z])/g;function I1(Q){return Q.replace(u5,function(H,B){return B.toUpperCase()})}O.ready=function(Q){var H=function(){return setTimeout(Q,0,w)};if(J.readyState!=="loading")H();else J.addEventListener("DOMContentLoaded",H);return this},O.unwrap=function(){return this.parent().each(function(Q,H){if(H.tagName==="BODY")return;var B=w(H);B.replaceWith(B.children())}),this},O.offset=function(){var Q=this[0];if(!Q)return;var H=Q.getBoundingClientRect();return{top:H.top+Z.pageYOffset,left:H.left+Z.pageXOffset}},O.position=function(){var Q=this[0];if(!Q)return;var H=r(Q,"position")==="fixed",B=H?Q.getBoundingClientRect():this.offset();if(!H){var D=Q.ownerDocument,F=Q.offsetParent||D.documentElement;while((F===D.body||F===D.documentElement)&&r(F,"position")==="static")F=F.parentNode;if(F!==Q&&P(F)){var R=w(F).offset();B.top-=R.top+z0(F,"borderTopWidth"),B.left-=R.left+z0(F,"borderLeftWidth")}}return{top:B.top-z0(Q,"marginTop"),left:B.left-z0(Q,"marginLeft")}};var c1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};O.prop=function(Q,H){if(!Q)return;if(E(Q)){if(Q=c1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(D,F){F[Q]=H})}for(var B in Q)this.prop(B,Q[B]);return this},O.removeProp=function(Q){return this.each(function(H,B){delete B[c1[Q]||Q]})};var m5=/^--/;function F1(Q){return m5.test(Q)}var L1={},d5=q.style,i5=["webkit","moz","ms"];function c5(Q,H){if(H===void 0)H=F1(Q);if(H)return Q;if(!L1[Q]){var B=I1(Q),D="".concat(B[0].toUpperCase()).concat(B.slice(1)),F="".concat(B," ").concat(i5.join("".concat(D," "))).concat(D).split(" ");b(F,function(R,h){if(h in d5)return L1[Q]=h,!1})}return L1[Q]}var p5={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 p1(Q,H,B){if(B===void 0)B=F1(Q);return!B&&!p5[Q]&&I(H)?"".concat(H,"px"):H}function o5(Q,H){if(E(Q)){var B=F1(Q);if(Q=c5(Q,B),arguments.length<2)return this[0]&&r(this[0],Q,B);if(!Q)return this;return H=p1(Q,H,B),this.each(function(F,R){if(!P(R))return;if(B)R.style.setProperty(Q,H);else R.style[Q]=H})}for(var D in Q)this.css(D,Q[D]);return this}O.css=o5;function o1(Q,H){try{return Q(H)}catch(B){return H}}var s5=/^\s+|\s+$/;function s1(Q,H){var B=Q.dataset[H]||Q.dataset[I1(H)];if(s5.test(B))return B;return o1(JSON.parse,B)}function l5(Q,H,B){B=o1(JSON.stringify,B),Q.dataset[I1(H)]=B}function r5(Q,H){if(!Q){if(!this[0])return;var B={};for(var D in this[0].dataset)B[D]=s1(this[0],D);return B}if(E(Q)){if(arguments.length<2)return this[0]&&s1(this[0],Q);if(T(H))return this;return this.each(function(F,R){l5(R,Q,H)})}for(var D in Q)this.data(D,Q[D]);return this}O.data=r5;function l1(Q,H){var B=Q.documentElement;return Math.max(Q.body["scroll".concat(H)],B["scroll".concat(H)],Q.body["offset".concat(H)],B["offset".concat(H)],B["client".concat(H)])}b([!0,!1],function(Q,H){b(["Width","Height"],function(B,D){var F="".concat(H?"outer":"inner").concat(D);O[F]=function(R){if(!this[0])return;if(L(this[0]))return H?this[0]["inner".concat(D)]:this[0].document.documentElement["client".concat(D)];if(C(this[0]))return l1(this[0],D);return this[0]["".concat(H?"offset":"client").concat(D)]+(R&&H?z0(this[0],"margin".concat(B?"Top":"Left"))+z0(this[0],"margin".concat(B?"Bottom":"Right")):0)}})}),b(["Width","Height"],function(Q,H){var B=H.toLowerCase();O[B]=function(D){if(!this[0])return T(D)?void 0:this;if(!arguments.length){if(L(this[0]))return this[0].document.documentElement["client".concat(H)];if(C(this[0]))return l1(this[0],H);return this[0].getBoundingClientRect()[B]-d0(this[0],!Q)}var F=parseInt(D,10);return this.each(function(R,h){if(!P(h))return;var v=r(h,"boxSizing");h.style[B]=p1(B,F+(v==="border-box"?d0(h,!Q):0))})}});var r1="___cd";O.toggle=function(Q){return this.each(function(H,B){if(!P(B))return;var D=K0(B),F=T(Q)?D:Q;if(F){if(B.style.display=B[r1]||"",K0(B))B.style.display=N0(B.tagName)}else if(!D)B[r1]=r(B,"display"),B.style.display="none"})},O.hide=function(){return this.toggle(!1)},O.show=function(){return this.toggle(!0)};var n1="___ce",V1=".",C1={focus:"focusin",blur:"focusout"},t1={mouseenter:"mouseover",mouseleave:"mouseout"},n5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function N1(Q){return t1[Q]||C1[Q]||Q}function S1(Q){var H=Q.split(V1);return[H[0],H.slice(1).sort()]}O.trigger=function(Q,H){if(E(Q)){var B=S1(Q),D=B[0],F=B[1],R=N1(D);if(!R)return this;var h=n5.test(R)?"MouseEvents":"HTMLEvents";Q=J.createEvent(h),Q.initEvent(R,!0,!0),Q.namespace=F.join(V1),Q.___ot=D}Q.___td=H;var v=Q.___ot in C1;return this.each(function(U0,W0){if(v&&V(W0[Q.___ot]))W0["___i".concat(Q.type)]=!0,W0[Q.___ot](),W0["___i".concat(Q.type)]=!1;W0.dispatchEvent(Q)})};function a1(Q){return Q[n1]=Q[n1]||{}}function t5(Q,H,B,D,F){var R=a1(Q);R[H]=R[H]||[],R[H].push([B,D,F]),Q.addEventListener(H,F)}function e1(Q,H){return!H||!a.call(H,function(B){return Q.indexOf(B)<0})}function l0(Q,H,B,D,F){var R=a1(Q);if(!H)for(H in R)l0(Q,H,B,D,F);else if(R[H])R[H]=R[H].filter(function(h){var v=h[0],U0=h[1],W0=h[2];if(F&&W0.guid!==F.guid||!e1(v,B)||D&&D!==U0)return!0;Q.removeEventListener(H,W0)})}O.off=function(Q,H,B){var D=this;if(T(Q))this.each(function(R,h){if(!P(h)&&!C(h)&&!L(h))return;l0(h)});else if(!E(Q))for(var F in Q)this.off(F,Q[F]);else{if(V(H))B=H,H="";b(o(Q),function(R,h){var v=S1(h),U0=v[0],W0=v[1],Y0=N1(U0);D.each(function(A0,M0){if(!P(M0)&&!C(M0)&&!L(M0))return;l0(M0,Y0,W0,H,B)})})}return this},O.remove=function(Q){return S0(this,Q).detach().off(),this},O.replaceWith=function(Q){return this.before(Q).remove()},O.replaceAll=function(Q){return w(Q).replaceWith(this),this};function a5(Q,H,B,D,F){var R=this;if(!E(Q)){for(var h in Q)this.on(h,H,B,Q[h],F);return this}if(!E(H))if(T(H)||N(H))H="";else if(T(B))B=H,H="";else D=B,B=H,H="";if(!V(D))D=B,B=void 0;if(!D)return this;return b(o(Q),function(v,U0){var W0=S1(U0),Y0=W0[0],A0=W0[1],M0=N1(Y0),r0=Y0 in t1,P1=Y0 in C1;if(!M0)return;R.each(function(E1,B0){if(!P(B0)&&!C(B0)&&!L(B0))return;var $1=function(X0){if(X0.target["___i".concat(X0.type)])return X0.stopImmediatePropagation();if(X0.namespace&&!e1(A0,X0.namespace.split(V1)))return;if(!H&&(P1&&(X0.target!==B0||X0.___ot===M0)||r0&&X0.relatedTarget&&B0.contains(X0.relatedTarget)))return;var R1=B0;if(H){var g0=X0.target;while(!x0(g0,H)){if(g0===B0)return;if(g0=g0.parentNode,!g0)return}R1=g0}Object.defineProperty(X0,"currentTarget",{configurable:!0,get:function(){return R1}}),Object.defineProperty(X0,"delegateTarget",{configurable:!0,get:function(){return B0}}),Object.defineProperty(X0,"data",{configurable:!0,get:function(){return B}});var W6=D.call(R1,X0,X0.___td);if(F)l0(B0,M0,A0,H,$1);if(W6===!1)X0.preventDefault(),X0.stopPropagation()};$1.guid=D.guid=D.guid||w.guid++,t5(B0,M0,A0,H,$1)})}),this}O.on=a5;function e5(Q,H,B,D){return this.on(Q,H,B,D,!0)}O.one=e5;var J6=/\r?\n/g;function Z6(Q,H){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(H.replace(J6,"\r\n")))}var Q6=/file|reset|submit|button|image/i,J5=/radio|checkbox/i;if(O.serialize=function(){var Q="";return this.each(function(H,B){b(B.elements||[B],function(D,F){if(F.disabled||!F.name||F.tagName==="FIELDSET"||Q6.test(F.type)||J5.test(F.type)&&!F.checked)return;var R=i1(F);if(!T(R)){var h=M(R)?R:[R];b(h,function(v,U0){Q+=Z6(F.name,U0)})}})}),Q.slice(1)},typeof Q5!=="undefined")W5.exports=w;else Z.cash=Z.$=w})()});var n0=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(W,z)=>{return Z[z]!==void 0?Z[z].toString():`{${z}}`})},Z5=(J,Z,W,z,q)=>{switch(J){case"plural":{if(typeof W==="string"){console.warn("Plural format value cannot be a string");return}if(z.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let X=W["*"];if(typeof X==="object")X=X[q||"*"];return n0(X,z)}if(typeof z.count==="string")z.count=Number(z.count);let Y="*";if(z.count.toString()in W)Y=z.count.toString();let G=W[Y]||W["*"];if(typeof G==="object")G=G[q||"*"];return n0(G,z)}case"condition":{if(typeof W==="string"){console.warn("Condition format value cannot be a string");return}let Y;for(let G in W)try{if(new Function("params",`with( params ){ return ${G}; }`)(z||{})){Y=W[G];break}}catch(X){console.warn(`Invalid <${Z}(${G})> condition expression`)}if(Y===void 0)return;if(typeof Y==="object")Y=Y[q||"*"];return n0(Y,z)}case"variable":default:{const Y=typeof W==="object"?W[q||"*"]:W;if(typeof Y==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return n0(Y,z)}}};class t0{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,z]=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[z||"*"]||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[z,q]=W.split("-");if(!this.DICTIONARIES[z]){console.warn(`Undefined <${W}> format dictionary`);return}if(!this.DICTIONARIES[z][J]){console.warn(`Undefined <${W}[${J}]> format reference`);return}const Y=this.DICTIONARIES[z][J];if(typeof Y==="string"){console.warn(`Invalid <${W}[${J}]> format reference. Expected object`);return}if(typeof Y!=="object"||Y===null||Array.isArray(Y)){console.warn(`Invalid <${W}[${J}]> format value`);return}return Z5(Y.type,J,Y.value,Z,q)}}class a0{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 e0{subscriptions=new Map;tick=new a0;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,z=new WeakMap,q=(G)=>{if(G instanceof Map)G.forEach((M,U)=>G.set(U,Y(M)));else if(Array.isArray(G))G.forEach((M,U)=>G[U]=Y(M));else if(typeof G==="object")Object.entries(G).forEach(([M,U])=>G[M]=Y(U));let X=new Proxy(G,{get(M,U){if(U==="toJSON")return function(){const $=(g)=>{if(!g||typeof g!=="object")return g;if(z.has(g)){const _=z.get(g);if(_ instanceof Map){const p={};return _.forEach((a,i)=>p[typeof i==="object"?JSON.stringify(i):String(i)]=$(a)),p}if(Array.isArray(_))return _.map((p)=>$(p));const u={};return Object.entries(_).forEach(([p,a])=>u[p]=$(a)),u}if(typeof g.toJSON==="function"&&!z.has(g))return g.toJSON();return g};return $(X)};if(U==="reset")return function(){X=null};const j=M[U];if(G instanceof Map&&typeof j==="function")return function(...$){const g=U.toString();if(g==="set"&&$.length>=2)$[1]=Y($[1]);const _=j.apply(M,$);return["set","delete","clear"].includes(g)&&W.queueUpdate(J),_};if(Array.isArray(G)&&typeof j==="function")return function(...$){const g=U.toString();if(["push","unshift"].includes(g))$=$.map((u)=>Y(u));else if(g==="splice"&&$.length>2)$=[$[0],$[1],...$.slice(2).map((u)=>Y(u))];const _=j.apply(M,$);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(g)&&W.queueUpdate(J),_};return j},set(M,U,j){if(M[U]===j)return!0;if(j instanceof Map&&M[U]instanceof Map){const $=M[U];return $.clear(),j.forEach((g,_)=>$.set(_,Y(g))),W.queueUpdate(J),!0}return M[U]=Y(j),W.queueUpdate(J),!0}});return z.set(X,G),X},Y=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Z)}}class J1{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",Z),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();else if(J.type==="detach"&&!document.contains(W[0]))this.unwatch(Z),Z.emit("component:detached",Z),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",J),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Z==="detach"&&!document.contains(W[0])){J.emit("component:detached",J),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const z=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Z}ment-timeout`,J)},this.TIMEOUT);this.observedComponents.set(J,{timeout:z,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()}}class Z1{pending=new Set;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){if(this.pending.add(J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=Array.from(this.pending);if(this.metrics.batchCount++,this.metrics.lastBatchSize=J.length,this.metrics.updatesProcessed+=J.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),this.pending.clear(),this.component.metrics.trackBatch(J.length),this.applyUpdates(J),this.isPending=!1,this.pending.size>0)this.isPending=!0,this.scheduleProcessing()}applyUpdates(J){J.forEach(({dep:Z,dependent:W})=>{try{const z=W.update(W.memo,"batch-updator");if(z)typeof z.memo==="object"&&this.component.FGUD.get(Z)?.set(W.path,{...W,memo:z.memo}),typeof z.cleanup==="function"&&z.cleanup()}catch(z){console.error("Failed to update dependency --",z)}})}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class Q1{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=Z.map((z)=>typeof z.toJSON==="function"?z.toJSON():z);this.__events[J]?.forEach((z)=>z(...W)),this.__once_events[J]?.forEach((z)=>z(...W)),delete this.__once_events[J]}}var b1=A1(W1(),1);function H0(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(X5(J)&&X5(Z)){for(let G of J)if(!Z.has(G))return!0;return!1}const Y=new WeakMap;for(let G of J){let X=!1;if(typeof G!=="object"){if(Z.has(G))X=!0}else for(let M of Z){if(typeof M!=="object")continue;if(!Y.has(G))Y.set(G,new WeakMap);const U=Y.get(G);if(U.has(M)){if(X=U.get(M),X)break;continue}const j=!H0(G,M);if(U.set(M,j),j){X=!0;break}}if(!X)return!0}return!1}if(J instanceof Map){if(!(Z instanceof Map))return!0;if(J.size!==Z.size)return!0;if(H5(J)&&H5(Z)){for(let[G,X]of J)if(Z.get(G)!==X)return!0;return!1}const Y=new WeakMap;for(let[G,X]of J){if(typeof G!=="object"){if(!Z.has(G))return!0;const j=Z.get(G);if(typeof X!=="object"){if(X!==j)return!0;continue}if(typeof j!=="object"||H0(X,j))return!0;continue}let M=!1,U=!1;for(let[j,$]of Z){if(typeof j!=="object")continue;if(!Y.has(G))Y.set(G,new WeakMap);const g=Y.get(G);if(g.has(j)){const[_,u]=g.get(j);if(_){M=!0,U=u;break}continue}if(!H0(G,j)){if(M=!0,U=typeof X==="object"&&typeof $==="object"?!H0(X,$):X===$,g.set(j,[!0,U]),U)break}else g.set(j,[!1,!1])}if(!M||!U)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Z))return!0;if(J.length!==Z.length)return!0;for(let Y=0;Y<J.length;Y++){const G=J[Y],X=Z[Y];if(G!==X&&(typeof G!=="object"||H0(G,X)))return!0}return!1}const W=Object.keys(J),z=Object.keys(Z);if(W.length!==z.length)return!0;W.sort(),z.sort();const q=W.length;for(let Y=0;Y<q;Y++)if(W[Y]!==z[Y])return!0;for(let Y=0;Y<q;Y++){const G=W[Y],X=J[G],M=Z[G];if(X===M)continue;if(X instanceof Date){if(!(M instanceof Date)||String(X)!==String(M))return!0;continue}if(X instanceof RegExp){if(!(M instanceof RegExp)||X.source!==M.source||X.flags!==M.flags)return!0;continue}if(X instanceof Map){if(!(M instanceof Map)||H0(X,M))return!0;continue}if(X instanceof Set){if(!(M instanceof Set)||H0(X,M))return!0;continue}if(X instanceof Function){if(!(M instanceof Function))return!0;continue}if(typeof X==="object"){if(typeof M!=="object")return!0;if(X===J){if(M!==Z)return!0}else if(H0(X,M))return!0}else return!0}return!1}function E0(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 X=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),M=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let U=0;U<X.length;U++)if(X[U]!==M[U])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!H0(J,Z);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Z))return!1;const Y=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(Z);if(Y.length!==G.length)return!1;for(let X of Y){if(!Object.prototype.hasOwnProperty.call(Z,X))return!1;if(!E0(J[X],Z[X]))return!1}if(q!==null&&q!==Object.prototype){const X=Object.getOwnPropertyNames(q),M=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(X.length!==M.length)return!1;for(let U of X){if(U==="constructor")continue;if(!E0(q[U],Object.getPrototypeOf(Z)[U]))return!1}}return!0}function X5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function H5(J){for(let[Z,W]of J)if(typeof Z==="object"&&Z!==null||typeof W==="object"&&W!==null)return!1;return!0}function J0(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((Y,G)=>q.set(J0(G,Z),J0(Y,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((Y)=>q.add(J0(Y,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let Y=0;Y<J.length;Y++)q[Y]=J0(J[Y],Z);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const W=Object.create(Object.getPrototypeOf(J));Z.set(J,W);const z=Object.getOwnPropertySymbols(J);for(let q of z)W[q]=J0(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))W[q]=J0(J[q],Z);return W}function q5(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,Y,G){const X=Y.split(/\.|\[|\]/).filter(Boolean);let M=q;for(let U=0;U<X.length;U++){const j=X[U],$=!isNaN(Number(j)),g=U===X.length-1,_=!isNaN(Number(X[U+1]));if(g){M[j]=G;continue}if(!(j in M))M[j]=_?[]:{};else if(_&&!Array.isArray(M[j]))M[j]=[];else if(!_&&Array.isArray(M[j]))M[j]={};M=M[j]}}const z=J0(J);try{for(let[q,Y]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(z,q,Y)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return z}var $0="i18n",F0="syn:",O0="fn:",b0="on-",t=/^\.\.\./,X1=/^\[(.*?)\]$/,_1=/{\s*([^{}]+)\s*}/g,z5=["@html","@text","@format"];b1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&b1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class H1{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=J0(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},z={"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},Y={"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(z),console.table(q),console.table(Y),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 J0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var n=A1(W1(),1);var $5=A1(W1(),1);var z1="comm",q1="rule",Y1="decl";var Y5="@import";var B5="@namespace",G5="@keyframes";var w5="@layer";function B1(J){return J.trim()}function h0(J,Z,W){return J.replace(Z,W)}function K5(J,Z,W){return J.indexOf(Z,W)}function L0(J,Z){return J.charCodeAt(Z)|0}function V0(J,Z,W){return J.slice(Z,W)}function q0(J){return J.length}function G1(J){return J.length}function k0(J,Z){return Z.push(J),J}var x1=Math.abs,c0=String.fromCharCode;function K1(J,Z,W,z,q,Y,G,X){return{value:J,root:Z,parent:W,type:z,props:q,children:Y,line:w1,column:f0,length:G,return:"",siblings:X}}function M5(){return Q0}function O5(){if(Q0=G0>0?L0(v0,--G0):0,f0--,Q0===10)f0=1,w1--;return Q0}function w0(){if(Q0=G0<U5?L0(v0,G0++):0,f0++,Q0===10)f0=1,w1++;return Q0}function C0(){return L0(v0,G0)}function p0(){return G0}function U1(J,Z){return V0(v0,J,Z)}function y0(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 D5(J){return w1=f0=1,U5=q0(v0=J),G0=0,[]}function j5(J){return v0="",J}function M1(J){return B1(U1(G0-1,g1(J===91?J+2:J===40?J+1:J)))}function I5(J){while(Q0=C0())if(Q0<33)w0();else break;return y0(J)>2||y0(Q0)>3?"":" "}function F5(J,Z){while(--Z&&w0())if(Q0<48||Q0>102||Q0>57&&Q0<65||Q0>70&&Q0<97)break;return U1(J,p0()+(Z<6&&C0()==32&&w0()==32))}function g1(J){while(w0())switch(Q0){case J:return G0;case 34:case 39:if(J!==34&&J!==39)g1(Q0);break;case 40:if(J===41)g1(J);break;case 92:w0();break}return G0}function L5(J,Z){while(w0())if(J+Q0===57)break;else if(J+Q0===84&&C0()===47)break;return"/*"+U1(Z,G0-1)+"*"+c0(J===47?J:w0())}function V5(J){while(!y0(C0()))w0();return U1(J,G0)}var w1=1,f0=1,U5=0,G0=0,Q0=0,v0="";function S5(J){return j5(O1("",null,null,null,[""],J=D5(J),0,[0],J))}function O1(J,Z,W,z,q,Y,G,X,M){var U=0,j=0,$=G,g=0,_=0,u=0,p=1,a=1,i=1,s=0,Z0="",d=q,y=Y,k=z,K=Z0;while(a)switch(u=s,s=w0()){case 40:if(u!=108&&L0(K,$-1)==58){if(K5(K+=h0(M1(s),"&","&\f"),"&\f",x1(U?X[U-1]:0))!=-1)i=-1;break}case 34:case 39:case 91:K+=M1(s);break;case 9:case 10:case 13:case 32:K+=I5(u);break;case 92:K+=F5(p0()-1,7);continue;case 47:switch(C0()){case 42:case 47:if(k0(G6(L5(w0(),p0()),Z,W,M),M),(y0(u||1)==5||y0(C0()||1)==5)&&q0(K)&&V0(K,-1,void 0)!==" ")K+=" ";break;default:K+="/"}break;case 123*p:X[U++]=q0(K)*i;case 125*p:case 59:case 0:switch(s){case 0:case 125:a=0;case 59+j:if(i==-1)K=h0(K,/\f/g,"");if(_>0&&(q0(K)-$||p===0&&u===47))k0(_>32?N5(K+";",z,W,$-1,M):N5(h0(K," ","")+";",z,W,$-2,M),M);break;case 59:K+=";";default:if(k0(k=C5(K,Z,W,U,j,q,X,Z0,d=[],y=[],$,Y),Y),s===123)if(j===0)O1(K,Z,k,k,d,Y,$,X,y);else{switch(g){case 99:if(L0(K,3)===110)break;case 108:if(L0(K,2)===97)break;default:j=0;case 100:case 109:case 115:}if(j)O1(J,k,k,z&&k0(C5(J,k,k,0,0,q,X,Z0,q,d=[],$,y),y),q,y,$,X,z?d:y);else O1(K,k,k,k,[""],y,0,X,y)}}U=j=_=0,p=i=1,Z0=K="",$=G;break;case 58:$=1+q0(K),_=u;default:if(p<1){if(s==123)--p;else if(s==125&&p++==0&&O5()==125)continue}switch(K+=c0(s),s*p){case 38:i=j>0?1:(K+="\f",-1);break;case 44:X[U++]=(q0(K)-1)*i,i=1;break;case 64:if(C0()===45)K+=M1(w0());g=C0(),j=$=q0(Z0=K+=V5(p0())),s++;break;case 45:if(u===45&&q0(K)==2)p=0}}return Y}function C5(J,Z,W,z,q,Y,G,X,M,U,j,$){var g=q-1,_=q===0?Y:[""],u=G1(_);for(var p=0,a=0,i=0;p<z;++p)for(var s=0,Z0=V0(J,g+1,g=x1(a=G[p])),d=J;s<u;++s)if(d=B1(a>0?_[s]+" "+Z0:h0(Z0,/&\f/g,_[s])))M[i++]=d;return K1(J,Z,W,q===0?q1:X,M,U,j,$)}function G6(J,Z,W,z){return K1(J,Z,W,z1,c0(M5()),V0(J,2,-2),0,z)}function N5(J,Z,W,z,q){return K1(J,Z,W,Y1,V0(J,0,z),V0(J,z+1,-1),z,q)}function D1(J,Z){var W="";for(var z=0;z<J.length;z++)W+=Z(J[z],z,J,Z)||"";return W}function P5(J,Z,W,z){switch(J.type){case w5:if(J.children.length)break;case Y5:case B5:case Y1:return J.return=J.return||J.value;case z1:return"";case G5:return J.return=J.value+"{"+D1(J.children,z)+"}";case q1:if(!q0(J.value=J.props.join(",")))return""}return q0(W=D1(J.children,z))?J.return=J.value+"{"+W+"}":""}function E5(J){var Z=G1(J);return function(W,z,q,Y){var G="";for(var X=0;X<Z;X++)G+=J[X](W,z,q,Y)||"";return G}}class u0{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 D1(S5(J),E5([P5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const W=new MutationObserver(()=>{const z=document.querySelector(J);if(z&&getComputedStyle(z).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 z=document.createElement("style");z.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),z.textContent=W;let q=0;const Y=this.$head.find(`style[${Z}]`);if(Y.length)q=parseInt(Y.attr("dindex"))+1,Y.remove();return z.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(z):document.head.appendChild(z),z}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{}}}var w6=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let W=J,z;while((z=Z.exec(J))!==null){const q=z[1],Y=z.index+z[0].length;let G=1,X=Y;while(X<J.length&&G>0){if(J[X]==="(")G++;if(J[X]===")")G--;X++}if(G===0){const M=J.slice(Y,X-1).trim(),U=J.slice(0,z.index),j=`${b0}${q}="${M}"`,$=J.slice(X);W=U+j+$,J=W,Z.lastIndex=U.length+j.length}}return W},K6=function(J){const Z=[];let z=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,Y,G)=>{return Z.push(G),`<${Y}##TAG_ATTRS_${Z.length-1}##>`});for(let q=0;q<Z.length;q++){const Y=`##TAG_ATTRS_${q}##`,G=Z[q],X=U6(G);z=z.replace(Y,X)}return z},U6=function(J){let Z="",W=0,z=!1,q="",Y=0,G=0,X=0;while(W<J.length){const M=J[W];if((M==='"'||M==="'")&&(W===0||J[W-1]!=="\\")){if(!z)z=!0,q=M;else if(M===q)z=!1}if(!z){if(M==="(")G++;else if(M===")")G--;else if(M==="{")X++;else if(M==="}")X--}if(!z&&G===0&&X===0&&(M===" "||W===J.length-1)){let U=W;if(W===J.length-1)U=W+1;const j=J.substring(Y,U).trim();if(j){const $=M6(j);Z+=" "+$}Y=W+1}W++}return Z},M6=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===$0||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let W=J.substring(0,Z).trim(),z=J.substring(Z+1).trim();if(W.startsWith("@"))return W=!z5.includes(W)?W.slice(1):W,`:${W}=${z}`;if(W.startsWith(O0)||W.startsWith(b0))return J;if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'")){const q=z.substring(1,z.length-1);if(O6(q))return`:${W}="${q}"`;return J}else return`:${W}="${z}"`};function O6(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 h1(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,z,q)=>{return q.endsWith("<")?`<lips dtag="${z}" ${q}/lips>`:`<lips dtag="${z}" ${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 ${O0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Z=w6(Z),Z=K6(Z),Z}var D6=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},T5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function _0(J,Z={maxSize:100}){const W=new Set,z=[{value:J,timestamp:Date.now()}];let q=0;const Y=()=>{const U=j1[j1.length-1];return U&&D6(U,W),z[q].value},G=()=>{const U=[...W];if(R5)for(let j of U)R5.add(j);else for(let j of U)j.execute()};return[Y,(U,j)=>{if(Object.is(z[q].value,U))return;if(q<z.length-1)z.splice(q+1);if(z.push({value:U,timestamp:Date.now(),metadata:j}),z.length>Z.maxSize)z.shift(),q=Math.max(0,q-1);else q++;G()},{undo(){if(q>0)q--,G()},redo(){if(q<z.length-1)q++,G()},jumpTo(U){if(U>=0&&U<z.length&&U!==q)q=U,G()},getHistory(){return[...z]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<z.length-1},clear(){const U=z[0];z.length=0,z.push(U),q=0,G()}}]}function o0(J){let Z=!1;const W=()=>{if(Z)throw new Error("Circular dependency detected");if(z.isDisposed)return;Z=!0,T5(z),j1.push(z);try{J()}finally{Z=!1,j1.pop()}},z={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{z.isDisposed=!0,T5(z)}}}var j1=[],R5=null;class s0 extends Q1{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=new Map;__renderCache=new Map;FGUD=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;metrics;stylesheet;__path="";__pathCounter=0;__renderDepth=0;constructor(J,Z,{input:W,state:z,context:q,_static:Y,handler:G,stylesheet:X,macros:M,declaration:U},j){super();if(this.lips=j.lips,j?.debug)this.debug=j.debug||this.lips.debug;if(j?.prepath)this.prepath=j.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=`${this.prepath}/${this.__name__}`,this.__template__=h1(Z),this.declaration=U||{name:J},this.input=W||{},this.static=Y||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,z||{}),M&&this.setMacros(M),G&&this.setHandler(G),X&&this.setStylesheet(X),this.metrics=new H1(this.debug),this.metrics.inc("componentCount"),this.UQS=new Z1(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create",this),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(this.input),this.emit("component:input",this);this.__previous={input:J0(this.input),state:J0(this.state),context:J0(this.context)};const[$,g]=_0(this.input),[_,u]=_0(this.state),[p,a]=_0(this.context);this.__setInput=g,this.__setState=u,this.__getState=_,this.lips.IUC.register(this.__path__,()=>{H0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(i)=>{if(!H0(this.context,i))return;a(i),this.context=i,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context",this)}),this.lips.useTranslator("*",(i)=>{if(i===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=i}),this.ICE=o0(()=>{const i=$(),s=_(),Z0=this.context=p();if(!this.isRendered){this.metrics.reset();const{$log:d}=this.render("",void 0,void 0,this.FGUD);this.$=d,!U?.syntax&&this.$?.each((y,k)=>typeof k.setAttribute=="function"&&k.setAttribute("rel",this.__name__)),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount",this),this.lips.watcher.watch(this)}else this.__updateDepNodes__({state:s,input:i,context:Z0},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update",this),this.__previous={input:J0(i),state:J0(s),context:J0(Z0)},this.input=i;this.metrics.log(),typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render",this)})}setContext(J,Z){this.lips.setContext(J,Z)}setInput(J){if(!H0(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(J)}subInput(J){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(q5(this.input,J)),this}setMacros(J){const Z=h1(J),W=n.default(Z);if(!W.length)return;const z=this;W.each(function(){const q=n.default(this),{argv:Y,attrs:G}=z.__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(z.__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.");z.__macros.set(G.literals.name,{argv:Y,$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 u0(this.__name__,Z)}get node(){if(!this.$)throw new Error("node() is expected to be call after component get rendered");return this.$}render(J,Z,W={},z,q){const Y=z||new Map,G=[];if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:Y};this.metrics.startRender();const X=this;let M=n.default();function U(K){const O=j(K);return X.__pathCounter++,X.__path?`${X.__path}/${O}`:`${J?J+"/":"#"}${O}`}function j(K){return(K==="component"?"c":"")+X.__pathCounter}function $(K){return K!==null&&typeof K==="object"&&typeof K.mesh==="function"&&typeof K.update==="function"}function g(K){return K!==null&&typeof K==="object"&&typeof K.default&&typeof K.default==="string"}function _(K){if(!K.attr(":dtag")||K.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const O=K.attr(":dtag"),w=X.__evaluate__(O,W);if($(w)||w===null)return i(K,O,w);else if(g(w))return s(K,{template:w});else return s(K,{name:w})}function u(K){const O=K.attr(":args"),w=U("log");if(!O)return;if(X.__evaluate__(`console.log(${O})`,W),X.__isReactive__(O,W))X.__extractExpressionDeps__(O,W).forEach((L)=>X.__trackDep__(Y,L,{$fragment:null,path:w,update:(C)=>X.__evaluate__(`console.log(${O})`,C),memo:W,batch:!0}))}function p(K){const O=U("var"),{attrs:w}=X.__getAttributes__(K);if(!w)return;Object.entries(w.literals).forEach(([S,L])=>{if(W[S]&&W[S].type==="const")throw new Error(`Cannot override <const ${S}=[value]/> variable`);W[S]={value:L,type:"let"}}),Object.entries(w.expressions).forEach(([S,L])=>{if(t.test(S)){const C=(P,x)=>{const f=X.__evaluate__(S.replace(t,""),x||W);if(typeof f!=="object")throw new Error(`Invalid spread operator ${S}`);for(let V in f){if(W[V]&&W[V].type==="const")throw new Error(`Cannot override <const ${V}=[value]/> variable`);if(W[V]={value:f[V],type:"let"},x)x[V]=W[V],X.__updateVarDepNodes__(V,O,x)}if(P)return{memo:x}};X.__extractExpressionDeps__(S,W).forEach((P)=>X.__trackDep__(Y,P,{$fragment:null,path:`${O}.${S}`,update:(x)=>C(!0,x),memo:W,batch:!0})),C()}else if(L){if(X.__isReactive__(L,W)){const C=X.__extractExpressionDeps__(L,W),m=(P,x)=>{if(W[S]&&W[S].type==="const")throw new Error(`Cannot override <const ${S}=[value]/> variable`);return P[S]=W[S]={value:X.__evaluate__(L,P),type:"let"},X.__updateVarDepNodes__(S,O,P),{memo:P}};C.forEach((P)=>X.__trackDep__(Y,P,{$fragment:null,path:`${O}.${S}`,update:m,memo:W,batch:!0}))}if(W[S]&&W[S].type==="const")throw new Error(`Cannot override <const ${S}=[value]/> variable`);W[S]={value:X.__evaluate__(L,W),type:"let"}}}),X.metrics.inc("elementCount")}function a(K){const{attrs:O}=X.__getAttributes__(K);if(!O)return;Object.entries(O.literals).forEach(([w,S])=>{if(W[w]&&W[w].type==="const")throw new Error(`<const ${w}=[value]/> variable already defined`);if(!S)return;W[w]={value:S,type:"const"}}),Object.entries(O.expressions).forEach(([w,S])=>{if(t.test(w)){const L=X.__evaluate__(w.replace(t,""),W);if(typeof L!=="object")throw new Error(`Invalid spread operator ${w}`);for(let C in L){if(W[C]&&W[C].type==="const")throw new Error(`<const ${C}=[value]/> by spread operator ${w}. [${C}] variable already defined`);W[C]={value:L[C],type:"const"}}}else{if(W[w]&&W[w].type==="const")throw new Error(`<const ${w}=[value]/> variable already defined`);if(!S)return;W[w]={value:X.__evaluate__(S,W),type:"const"}}}),X.metrics.inc("elementCount")}function i(K,O,w){const{attrs:S}=X.__getAttributes__(K),L=U("element"),C=X.__getBoundaries__(L);let m=n.default(C.start),P={},x=w;if(x){S.literals&&Object.entries(S.literals).forEach(([V,E])=>P[V]={type:"arg",value:E}),S.expressions&&Object.entries(S.expressions).forEach(([V,E])=>{if(!x)return;if(t.test(V)){const T=X.__evaluate__(V.replace(t,""),W);if(typeof T!=="object")throw new Error(`Invalid spread operator ${V}`);for(let N in T){if(N!=="#"&&!x.argv.includes(N))continue;P[N]={type:"arg",value:T[N]}}}else{if(V!=="#"&&!x.argv.includes(V))return;P[V]={type:"arg",value:E?X.__evaluate__(E,W):!0}}});const f=x.mesh(P);if(f&&f.length)m=m.add(f);S.expressions&&Object.entries(S.expressions).forEach(([V,E])=>{if(!x)return;if(t.test(V)&&X.__isReactive__(V,W)){const T=X.__extractExpressionDeps__(V,W),N=(I,A)=>{if(!x)return;const b={},c=X.__evaluate__(V.replace(t,""),I);if(typeof c!=="object")throw new Error(`Invalid spread operator ${V}`);const l=[];for(let o in c){if(o!=="#"&&!x.argv.includes(o))continue;P[o]=b[o]={type:"arg",value:c[o]},(!I[o]||!E0(c[o],I[o].value))&&l.push(o)}l.length&&x.update(l,b,C)};T.forEach((I)=>X.__trackDep__(Y,I,{$fragment:null,boundaries:C,path:`${L}.${V}`,update:N,memo:W,batch:!0}))}else if((V==="#"||x.argv.includes(V))&&X.__isReactive__(E,W)){const T=X.__extractExpressionDeps__(E,W),N=(I,A)=>{if(!x)return;const b=P[V]={type:"arg",value:E?X.__evaluate__(E,I):!0};x.update([V],{[V]:b},C)};T.forEach((I)=>X.__trackDep__(Y,I,{$fragment:null,boundaries:C,path:`${L}.${V}`,update:N,memo:W,batch:!0}))}})}if(X.__isReactive__(O,W)){const f=(E,T)=>{const N=X.__evaluate__(O,E);let I;if(g(N))I=s(K,{template:N});else if($(N))P="#"in P?{...E,...P["#"].value}:{...E,...P},x=N,I=x?x.mesh(P):null;if(!document.contains(C.start)||!document.contains(C.end))throw new Error("Dynamic element boundaries not found");const A=[];let b=C.start.nextSibling;while(b&&b!==C.end)A.push(b),b=b.nextSibling;n.default(A).remove(),I&&n.default(C.start).after(I)};X.__extractExpressionDeps__(O,W).forEach((E)=>X.__trackDep__(Y,E,{$fragment:null,boundaries:C,path:L,update:f,batch:!0,memo:{...W,...P}}))}return m=m.add(C.end),m}function s(K,O){let w,S;if(O?.template)w=O.template,S=j("component");else{if(S=O?.name||K.prop("tagName")?.toLowerCase(),!S)throw new Error("Invalid component");if(S===X.__name__)throw new Error("Render component within itself is forbidden");w=X.lips.import(S)}if(!w||!S)throw new Error(`<${S}> template not found`);const L=U("component"),C=X.__getBoundaries__(L),{argv:m,attrs:P,events:x}=X.__getAttributes__(K),f={};let V={},E=n.default(C.start),T=X.PCC.get(L);P.literals&&Object.entries(P.literals).forEach(([I,A])=>{if(I=="key")return;V[I]=A}),P.functions&&Object.entries(P.functions).forEach(([I,A])=>{V[I]=X.__evaluateFunction__(A,[],W),w.declaration?.syntax?f[F0+O0+I]=A:f[O0+I]=A}),P.expressions&&Object.entries(P.expressions).forEach(([I,A])=>{if(I=="key")return;if(t.test(I)){const b=X.__evaluate__(I.replace(t,""),W);if(typeof b!=="object")throw new Error(`Invalid spread operator ${I}`);for(let c in b)V[c]=b[c]}else V[I]=A?X.__evaluate__(A,W):!0;w.declaration?.syntax?f[F0+I]=A:f[I]=A});const N=K.contents();if(N.length){if(V={...V,...X.__meshwire__({$node:K,fragmentPath:L,fragmentBoundaries:C,meshPath:null,argv:m,scope:W,xmlns:q,useAttributes:!0,declaration:w.declaration},f)},w.declaration){if(w.declaration.tags)Object.entries(w.declaration?.tags).forEach(([I,{type:A,many:b}])=>{switch(A){case"nexted":{let c=K.next(I);if(!c.length)return;if(b){V[I]=[];let l=0,o=!1;while(!o){if(V[I].push(X.__meshwire__({$node:c,meshPath:`${I}[${l}]`,fragmentPath:L,fragmentBoundaries:C,argv:m,scope:W,xmlns:q,useAttributes:!0,declaration:w.declaration},f)),!c.next(I).length){o=!0;break}c=c.next(I),l++}}else V[I]=X.__meshwire__({$node:c,meshPath:I,fragmentPath:L,fragmentBoundaries:C,argv:m,scope:W,xmlns:q,useAttributes:!0,declaration:w.declaration},f)}break;case"child":{const c=K.children(I);if(b)V[I]=[],c.each(function(l){const o=n.default(this),{argv:D0}=X.__getAttributes__(o);V[I].push(X.__meshwire__({$node:o,meshPath:`${I}[${l}]`,fragmentPath:L,fragmentBoundaries:C,argv:D0,scope:W,xmlns:q,useAttributes:!0,declaration:w.declaration},f))});else if(K.children(I).first().length){const l=K.children(I).first(),{argv:o}=X.__getAttributes__(l);V[I]=X.__meshwire__({$node:l,meshPath:I,fragmentPath:L,fragmentBoundaries:C,argv:o,scope:W,xmlns:q,useAttributes:!0,declaration:w.declaration},f)}}break}});else if(w.declaration.contents)V.__contents__=N}}if(T)T.setInput(J0(V)),E=E.add(T.node);else{const{declaration:I,state:A,_static:b,handler:c,context:l,default:o,stylesheet:D0}=w;T=new s0(S,o||"",{state:J0(A),input:J0(V),context:l,_static:J0(b),handler:c,stylesheet:D0,declaration:I},{debug:X.debug,lips:X.lips,prepath:L}),E=E.add(T.node),X.PCC.set(L,T),Object.entries(x).forEach(([e,r])=>!!T&&X.__attachEvent__(T,e,r,W)),f&&Object.entries(f).forEach(([e,r])=>{let z0=!1,d0=!1;if(e.startsWith(F0))z0=!0,e=e.replace(F0,"");if(e.startsWith(O0))d0=!0,e=e.replace(O0,"");if(t.test(e)){const R0=(N0)=>{const K0={},x0=X.__evaluate__(e.replace(t,""),N0);if(typeof x0!=="object")throw new Error(`Invalid spread operator ${e}`);for(let T0 in x0)K0[T0]=x0[T0];T?.subInput(K0)};if(X.__isReactive__(e,W))X.__extractExpressionDeps__(r,W).forEach((K0)=>X.__trackDep__(Y,K0,{$fragment:null,boundaries:C,path:`${L}.${e}`,update:R0,syntax:z0,memo:W,batch:!0}))}else{const R0=(N0)=>{const K0=d0?X.__evaluateFunction__(r,[],N0):r?X.__evaluate__(r,N0):!0;T?.subInput({[e]:K0})};if(X.__isReactive__(r,W))X.__extractExpressionDeps__(r,W).forEach((K0)=>X.__trackDep__(Y,K0,{$fragment:null,boundaries:C,path:`${L}.${e}`,update:R0,syntax:z0,memo:W,batch:!0}))}}),E=E.add(C.end)}return X.metrics.inc("componentCount"),E}function Z0(K){const O=K.prop("tagName")?.toLowerCase();if(!O)throw new Error("Invalid macro rendering call");const w=X.__macros.get(O);if(!w)throw new Error("Macro component not found");const S=U("macro"),L=X.__getBoundaries__(S),{attrs:C}=X.__getAttributes__(K),m={};let P={},x={},f=n.default(L.start);if(C.literals&&Object.entries(C.literals).forEach(([N,I])=>P[N]={value:I,type:"arg"}),C.expressions&&Object.entries(C.expressions).forEach(([N,I])=>{if(t.test(N)){const A=X.__evaluate__(N.replace(t,""),W);if(typeof A!=="object")throw new Error(`Invalid spread operator ${N}`);for(let b in A)if(x[b]=A[b],w.argv.includes(b))P[b]={value:A[b],type:"arg"};m[N]=I}else{const A=I?X.__evaluate__(I,W):!0;if(x[N]=A,w.argv.includes(N))P[N]={value:A,type:"arg"};if(w.argv.includes(N))m[N]=I}w.argv.forEach((A)=>{if(P[A]!==void 0)return;P[A]={value:!1,type:"arg"}})}),w.argv.includes("__"))P.__={value:x,type:"arg"};const V={$node:w.$node,meshPath:null,fragmentPath:S,fragmentBoundaries:L,argv:w.argv,scope:W,xmlns:q,useAttributes:!0},E=X.__meshwire__(V,m),T=E.renderer.mesh(P);return f=f.add(T),m&&Object.entries(m).forEach(([N,I])=>{let A=!1;if(new RegExp(`^${F0}`).test(N))A=!0,N=N.replace(F0,"");if(t.test(N)){if(!X.__isReactive__(N,W))return;const b=X.__extractExpressionDeps__(N,W),c=(l)=>{const o={},D0=X.__evaluate__(N.replace(t,""),l);if(typeof D0!=="object")throw new Error(`Invalid spread operator ${N}`);const e=[];for(let r in D0)o[r]={value:D0[r],type:"arg"},(!l[r]||!E0(D0[r],l[r].value))&&e.push(r);return e.length&&E.renderer.update(e,o),{memo:{...l,...o}}};b.forEach((l)=>X.__trackDep__(Y,l,{$fragment:null,boundaries:L,path:`${S}.${N}`,update:c,syntax:A,memo:{...W,...P},batch:!0}))}else if(X.__isReactive__(I,W)){const b=X.__extractExpressionDeps__(I,W),c=(l)=>{const o=l[N]={value:I?X.__evaluate__(I,l):!0,type:"arg"};return E.renderer.update([N],{[N]:o}),{memo:l}};b.forEach((l)=>X.__trackDep__(Y,l,{$fragment:null,boundaries:L,path:`${S}.${N}`,update:c,syntax:A,memo:{...W,...P},batch:!0}))}}),f=f.add(L.end),X.metrics.inc("elementCount"),f}function d(K){if(!K.length||!K.prop("tagName"))return K;const O=K.is("svg")||q,w=O?n.default(document.createElementNS("http://www.w3.org/2000/svg",K.prop("tagName").toLowerCase())):n.default(`<${K.prop("tagName").toLowerCase()}/>`),S=K.contents(),L=U("element");S.length&&w.append(X.__withPath__(L,()=>X.render(L+".n",S,W,Y,O).$log));const{attrs:C,events:m}=X.__getAttributes__(K);C.literals&&Object.entries(C.literals).forEach(([x,f])=>{if(x===$0)return;const V=K.is(`[${$0}]`)&&["title","placeholder"].includes(x);w.attr(x,V?X.lips.i18n.translate(f).text:f);const E=(T)=>{w.attr(x,V?X.lips.i18n.translate(f).text:f),V&&X.__trackTranslationDep__({path:L,$fragment:w,update:E,memo:T})};V&&X.__trackTranslationDep__({path:L,$fragment:w,update:E,memo:W})});const P=(x,f=!1)=>{x&&Object.entries(x).forEach(([V,E])=>{switch(V){case"@html":{const T=(N)=>{w.html(X.__evaluate__(E,N))};if(T(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((I)=>X.__trackDep__(Y,I,{$fragment:w,path:`${L}.${V}`,update:T,memo:W,batch:!0}))}break;case"@text":{const T=K.is(`[${$0}]`),N=(I)=>{w.text(X.__evaluate__(E,I,T)),T&&X.__trackTranslationDep__({path:L,$fragment:w,update:N,memo:I})};if(N(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((A)=>X.__trackDep__(Y,A,{$fragment:w,path:`${L}.${V}`,update:N,memo:W,batch:!0}));T&&X.__trackTranslationDep__({path:L,$fragment:w,update:N,memo:W})}break;case"@format":{const[T,N]=E.split(",").map((A)=>A.trim());if(!T)throw new Error("Invalid @format reference");if(!N)throw new Error("Invalid @format parameters");const I=(A)=>{const b=X.__evaluate__(`!${N.trim()}`,A);if(typeof b!=="object")throw new Error("Invalid @format parameters");const c=X.lips.i18n.format(T,b);c!==void 0&&w.text(c),X.__trackTranslationDep__({path:L,$fragment:w,update:I,memo:A})};I(W),X.__extractExpressionDeps__(N,W).forEach((A)=>X.__trackDep__(Y,A,{$fragment:w,path:`${L}.${V}`,update:I,memo:W,batch:!0}))}break;case"style":{const T=(N)=>{const I=X.__evaluate__(E,N);if(typeof I==="object"){let A="";Object.entries(I).forEach(([b,c])=>A+=`${b}:${c};`),A.length&&w.attr("style",A)}else w.attr("style",I)};if(T(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((I)=>X.__trackDep__(Y,I,{$fragment:w,path:`${L}.${V}`,update:T,memo:W,batch:!0}))}break;default:{const T=K.is(`[${$0}]`)&&["title","placeholder"].includes(V),N=(I)=>{const A=E?X.__evaluate__(E,I,T):E!==void 0?E:!0;if(A===void 0||A===!1)w.removeAttr(V);else w.attr(V,A),T&&X.__trackTranslationDep__({path:L,$fragment:w,update:N,memo:I})};if(N(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((A)=>X.__trackDep__(Y,A,{$fragment:w,path:`${L}.${V}`,update:N,memo:W,batch:!0}));T&&X.__trackTranslationDep__({path:L,$fragment:w,update:N,memo:W})}}})};return C.expressions&&Object.keys(C.expressions).forEach((x)=>{if(!t.test(x))return;const f=(V)=>{const E={},T=X.__evaluate__(x.replace(t,""),V);if(typeof T!=="object")throw new Error(`Invalid spread operator ${x}`);for(let N in T)E[N]=T[N];P(E)};if(delete C.expressions[x],f(W),x&&X.__isReactive__(x,W))X.__extractExpressionDeps__(x,W).forEach((E)=>X.__trackDep__(Y,E,{$fragment:w,path:`${L}.${x}`,update:f,memo:W,batch:!0}))}),P(C.expressions,!0),m&&Object.entries(m).forEach(([x,f])=>{G.push({_event:x,$fragment:w,instruction:f,scope:W})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),w}function y(K){const O=K.text(),w=U("element"),S=K.parent().is(`[${$0}]`),L=n.default(document.createTextNode(X.__interpolate__(O,W,S))),C=(m)=>{const P=X.__interpolate__(O,m,S);if(!L[0])return;L[0].textContent=P,S&&X.__trackTranslationDep__({path:w,$fragment:L,update:C,memo:m||W})};if(O&&X.__isReactive__(O,W)){const m=X.__extractTextDeps__(O,W);m.forEach((P)=>X.__trackDep__(Y,P,{path:w,$fragment:L,update:C,memo:W,batch:m.length>1}))}return S&&X.__trackTranslationDep__({path:w,$fragment:L,update:C,memo:W}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),L}function k(K){if(K.get(0)?.nodeType===Node.COMMENT_NODE)return K;if(K.get(0)?.nodeType===Node.TEXT_NODE)return y(K);if(K.is("let"))return p(K);else if(K.is("const"))return a(K);else if(K.is("lips")&&K.attr(":dtag"))return _(K);else if(K.is("log"))return u(K);else if(X.__macros.has(K.prop("tagName")?.toLowerCase()))return Z0(K);else if(K.is("if, for, switch, async")||X.lips.has(K.prop("tagName")?.toLowerCase()))return s(K);else if(K.is("else-if, else"))return;return d(K)}try{this.__renderDepth++,Z=Z||n.default(this.__template__),Z.each(function(){const K=k(n.default(this));if(K)M=M.add(K)}),G.forEach(({$fragment:K,_event:O,instruction:w,scope:S})=>{this.__attachEvent__(K,O,w,S)}),X.metrics.inc("renderCount")}catch(K){console.error("Rendering Failed --",K),X.metrics.trackError(K)}finally{if(this.__renderDepth--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:M,dependencies:Y,events:G}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(({element:J,_event:Z})=>this.__detachEvent__(J,Z)),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.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Z)=>{n.default(Z).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy",this)}__meshwire__(J,Z){const W=this,{$node:z,meshPath:q,fragmentPath:Y,fragmentBoundaries:G,argv:X,scope:M,xmlns:U,declaration:j,useAttributes:$}=J;let g,_=[],u=!1;const p=[],a=(d,y,k)=>{const K=`${Y}.${q||"r"}${k!==void 0?`[${k}]`:""}`,{$log:O,dependencies:w,events:S}=W.render(K,d,{...M,...y},void 0,U);if(p.push(K),w?.forEach((L,C)=>{if(!W.FGUD?.has(C))W.FGUD.set(C,new Map);L.forEach((m,P)=>{m.partial?.length?m.partial.push(K):m.partial=[K],W.FGUD.get(C)?.set(P,m)})}),W.metrics.inc("partialCount"),k!==void 0){const L=W.__getBoundaries__(K);_[k]={argvalues:y,boundaries:L};let C=n.default(L.start);return C=C.add(O),C=C.add(L.end),C}return O},i=(d,y,k)=>{if(W.metrics.startRender(),d.forEach((K)=>{const O=W.FGUD.get(K);if(!O)return;O.forEach((w)=>{const S=p.find((L)=>w.partial?.find((C)=>L==C));if(!w.partial||!S)return;if(k!==void 0&&!S.endsWith(`r[${k}]`))return;if(G?.start&&!document.contains(G.start)){console.warn(`${q} -- partial boundaries missing in the DOM`),O.delete(w.path);return}if(w.memo?.[K]&&y?.[K]&&E0(w.memo[K],y[K]))return;if(w.memo={...M,...w.memo,...y},w.batch)W.UQS.queue({dep:K,dependent:w});else{const L=w.update(w.memo,"mesh-partial-updator");if(L)typeof L.memo==="object"&&O.set(w.path,{...w,memo:L.memo}),typeof L.cleanup==="function"&&L.cleanup()}W.metrics.inc("dependencyUpdateCount")}),!O.size&&W.FGUD.delete(K)}),k!==void 0&&_[k])_[k].argvalues=y;W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},s=(d)=>{if(!_[d])return;const y=_[d].boundaries;if(_.splice(d,1),!document.contains(y.start)||!document.contains(y.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const k=[];let K=y.start.nextSibling;while(K&&K!==y.end)k.push(K),K=K.nextSibling;n.default(k).remove(),y.start.remove(),y.end.remove()},Z0={renderer:{path:q,argv:X,mesh(d,y=!1){if(g=z.contents(),!g?.length)return null;if(j?.iterator){const k=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!k.length)return null;let K=n.default();return k.forEach((O,w)=>{if(!g?.length)return null;K=K.add(a(g,O,w))}),K}else return a(g,d)},update(d,y,k){if(!p.length||u)return;u=!0;try{if(k=k||G,j?.iterator){const K=y?.["#"].value;if(!Array.isArray(K))return;if(Array.isArray(_)){if(_.length===K.length){for(let w=0;w<K.length;w++)!E0(_[w].argvalues,K[w])&&i(Object.keys(K[w]),K[w],w);return}const O=Math.min(_.length,K.length);for(let w=0;w<O;w++)i(Object.keys(K[w]),K[w],w);if(K.length>_.length){if(!g?.length)return;for(let w=_.length;w<K.length;w++){const S=a(g,K[w],w);n.default(k.end).before(S)}}else if(K.length<_.length)for(let w=_.length-1;w>=K.length;w--)s(w)}}else i(d,y)}finally{setTimeout(()=>u=!1,0)}}}};if($&&q){const{attrs:d}=W.__getAttributes__(z);d.literals&&Object.entries(d.literals).forEach(([y,k])=>Z0[y]=k),d.expressions&&Object.entries(d.expressions).forEach(([y,k])=>{if(t.test(y)){const K=W.__evaluate__(y.replace(t,""),M);if(typeof K!=="object")throw new Error(`Invalid spread operator ${y}`);for(let O in K)Z0[O]=K[O];Z[`${j?.syntax?F0:""}${q}.${y}`]=k}else Z0[y]=k?W.__evaluate__(k,M):!0,Z[`${j?.syntax?F0:""}${q}.${y}`]=k})}return Z0}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${this.prepath}.${J}`),end:document.createComment(`e:${this.prepath}.${J}`)}}__getAttributes__(J){const Z=J.attrs(),W={},z={literals:{},functions:{},expressions:{}};let q=[];return Z&&Object.entries(Z).forEach(([Y,G])=>{if(Y==":dtag")return;if(Y.startsWith(":")||Y.startsWith(O0)||Y.startsWith(b0)||t.test(Y)||X1.test(Y))if(X1.test(Y)){const[X,M]=Y.match(X1)||[];q=M.split(",")}else if(Y.startsWith(b0))W[Y.replace(b0,"")]=G;else if(Y.startsWith(O0))z.functions[Y.replace(O0,"")]=G;else{if(Y.startsWith(":"))Y=Y.slice(1,Y.length);z.expressions[Y]=G||""}else z.literals[Y]=G}),{argv:q,events:W,attrs:z}}__withPath__(J,Z){const W=this.__path;this.__path=J;const z=Z();return this.__path=W,z}__getPathParent__(J){const Z=J.split("/");return Z.pop(),Z.join("/")}__hasSamePathParent__(J,Z){return J.startsWith(Z)}__evaluate__(J,Z,W){try{J=J.trim();const z=(q)=>{const Y=this.state.toJSON();if(Z){const G={};for(let U in Z)G[U]=Z[U].value;const X=`with( scope ){ return ${q}; }`;return new Function("self","input","state","static","context","scope",X)(this,this.input,Y,this.static,this.context,G||{})}else{const G=`return ${q}`;return new Function("self","input","state","static","context",G)(this,this.input,Y,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return z(J.slice(1));return J.replace(_1,(q,Y)=>z(Y))}return z(J)}catch(z){return J}}__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[z,...q]=J.split(/\s*,\s*/),Y;if(z=this.__evaluate__(z,W),typeof z==="function")Y=z;else{if(typeof this[z]!=="function")throw new Error(`Undefined <${z}> handler method`);Y=this[z].bind(this)}if(typeof Y!=="function")throw new Error(`Expected <${z}> to be a function or handler method`);let G=q.map((X)=>this.__evaluate__(X,W));if(Z.length)G=[...G,...Z];return Y(...G)}}__interpolate__(J,Z,W){if(J=J.replace(_1,(z,q)=>this.__evaluate__(q,Z)),W)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J,Z,W,z){J.on(Z,(...q)=>this.__evaluateFunction__(W,q,z)),this.VER.push({element:J,_event:Z}),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount")}__detachEvent__(J,Z){J.off(Z),this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const W=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const Y=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(Y,Z).forEach((X)=>W.add(X))}),Array.from(W)}__extractExpressionDeps__(J,Z){const W=/\b(state|input|context)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,z=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g;let q=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(z))];if(Z&&Object.keys(Z).length){const Y=new RegExp(`\\b(${Object.keys(Z).join("|")})`,"g");q=[...q,...Array.from(J.matchAll(Y))]}return[...new Set(q.map((Y)=>Y[0]))]}__isReactive__(J,Z){if(/(state|input|context|self)\.[\w.]+/.test(J))return!0;if(Z&&Object.keys(Z).length&&new RegExp(Object.keys(Z).join("|")).test(J))return!0;return!1}__trackDep__(J,Z,W){if(W.memo&&W.memo[Z]&&W.memo[Z].type==="let")W.haslet=!0;!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(W.path,W),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J){this.__i18nDeps.set(J.path,J),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Z){return Z.reduce((W,z)=>W?.[z],J)}__shouldUpdate__(J,Z,W,z){if(J==="self")return!0;const q=this.__valueDep__(z[J],Z),Y=this.__valueDep__(W[J],Z);return!E0(q,Y)}__updateDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((W,z)=>{const[q,...Y]=z.split(".");if(!this.__shouldUpdate__(q,Y,J,Z))return;W.forEach((G)=>{const{path:X,batch:M,$fragment:U,boundaries:j,update:$,memo:g,syntax:_}=G;try{if(!_&&(j?.start&&!document.contains(j.start))||U!==null&&!U.closest("body").length){W.delete(X);return}if(M)this.UQS.queue({dep:z,dependent:G});else{const u=$(g,"main-updator");if(u)typeof u.memo==="object"&&W.set(X,{...G,memo:u.memo}),typeof u.cleanup==="function"&&u.cleanup()}this.metrics.inc("dependencyUpdateCount")}catch(u){console.error("failed to update dependency nodes --",u);return}}),!W.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((q,Y)=>{if(!q.haslet||!this.__hasSamePathParent__(Y,this.__getPathParent__(Z)))return;if(q.memo={...q.memo,...W},q.batch)this.UQS.queue({dep:J,dependent:q});else{const G=q.update(q.memo,"var-partial-updator");typeof G?.cleanup==="function"&&G.cleanup()}}),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}J.update(J.memo,"i18n-partial-updator")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?n.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?n.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?n.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var k1={};i0(k1,{state:()=>{{return I6}},handler:()=>{{return F6}},default:()=>{{return L6}},declaration:()=>{{return j6}}});var j6={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},I6={renderer:null},F6={onInput(){if(!this.input.renderer)return;if(this.input.by)this.state.renderer=this.input.renderer;else{let J=!1;if(Array.isArray(this.input["else-if"])&&this.input["else-if"].length)this.input["else-if"].forEach((Z)=>{if(J||!Z.by)return;this.state.renderer=Z.renderer,J=!0});if(!J)this.state.renderer=this.input.else?this.input.else.renderer:null}}},L6="<{state.renderer}/>";var f1={};i0(f1,{state:()=>{{return C6}},handler:()=>{{return S6}},default:()=>{{return P6}},declaration:()=>{{return V6}},_static:()=>{{return N6}}});var V6={name:"for",syntax:!0,iterator:!0},C6={argvlist:null},N6={lastIn:null,processingBatch:!1},S6={onInput(){if(this.static.processingBatch)return;if(!this.input.renderer)throw new Error("Undefined mesh renderer");let{in:J,from:Z,to:W}=this.input;if(J===void 0&&Z===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(Z!==void 0){if(Z=parseFloat(String(Z)),W==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");if(W=parseFloat(String(W)),Z===W)throw new Error("<from> and <to> attribute cannot have the same value");const z=Z<W,q=Math.abs(W-Z)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q){const[G]=this.input.renderer.argv;if(G){let X=Z,M=!0;for(let U=0;U<this.state.argvlist.length;U++){if(this.state.argvlist[U][G].value!==X){M=!1;break}X=z?X+1:X-1}if(M)return;X=Z;for(let U=0;U<this.state.argvlist.length;U++)this.state.argvlist[U][G].value=X,X=z?X+1:X-1;return}}const Y=[];for(let G=Z;z?G<=W:G>=W;z?G++:G--){const X={},[M]=this.input.renderer.argv;if(M)X[M]={value:G,type:"arg"};Y.push(X)}this.state.argvlist=Y}else if(Array.isArray(J)){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!J.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update");this.state.argvlist=[];return}if(this.static.lastIn=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.length){const[Y,G]=this.input.renderer.argv;for(let X=0;X<J.length;X++){const M=this.state.argvlist[X];if(Y)M[Y].value=J[X]}return}const z=[];let q=0;for(let Y of J){const G={},[X,M]=this.input.renderer.argv;if(X)G[X]={value:Y,type:"arg"};if(M)G[M]={value:q,type:"arg"};z.push(G),q++}this.state.argvlist=z}else if(J instanceof Map){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!J.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update");this.state.argvlist=[];return}if(this.static.lastIn=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.size){const[Y,G,X]=this.input.renderer.argv;let M=0;for(let[U,j]of J){const $=this.state.argvlist[M];if(Y)$[Y].value=U;if(G)$[G].value=j;M++}return}const z=[];let q=0;for(let[Y,G]of J){const X={},[M,U,j]=this.input.renderer.argv;if(M)X[M]={value:Y,type:"arg"};if(U)X[U]={value:G,type:"arg"};if(j)X[j]={value:q,type:"arg"};z.push(X),q++}this.state.argvlist=z}else if(typeof J=="object"){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!Object.keys(J).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update");this.state.argvlist=[];return}this.static.lastIn=J;const z=Object.keys(J);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===z.length){const[G,X,M]=this.input.renderer.argv;for(let U=0;U<z.length;U++){const j=z[U],$=this.state.argvlist[U];if(G)$[G].value=j;if(X)$[X].value=J[j]}return}const q=[];let Y=0;for(let G in J){const X={},[M,U,j]=this.input.renderer.argv;if(M)X[M]={value:G,type:"arg"};if(U)X[U]={value:J[G],type:"arg"};if(j)X[j]={value:Y,type:"arg"};q.push(X),Y++}this.state.argvlist=q}}finally{this.static.processingBatch=!1}},updateItems(J){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!Array.isArray(J)||!this.state.argvlist)return;this.static.processingBatch=!0;try{const[Z]=this.input.renderer?.argv;if(!Z)return;for(let{index:W,value:z}of J)if(W>=0&&W<this.state.argvlist.length)this.state.argvlist[W][Z].value=z}finally{this.static.processingBatch=!1}},updateProperty(J,Z){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!this.state.argvlist)return;this.static.processingBatch=!0;try{for(let W=0;W<this.state.argvlist.length;W++){const z=this.state.argvlist[W];if(z[J])z[J].value=typeof Z==="function"?Z(z[J].value,W):Z}}finally{this.static.processingBatch=!1}}},P6="<{input.renderer} #=state.argvlist/>";var y1={};i0(y1,{state:()=>{{return $6}},handler:()=>{{return R6}},default:()=>{{return T6}},declaration:()=>{{return E6}}});var E6={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},$6={renderer:null,props:{}},R6={onInput(){if(!this.input.await)throw new Error("Undefined async <await> attribute");if(!(this.input.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(this.input.loading)this.state.renderer=this.input.loading.renderer,this.state.props={};this.input.await.then((J)=>{if(!this.input.then)return;this.state.renderer=this.input.then.renderer;const[Z]=this.input.then.renderer.argv;this.state.props={[Z]:{value:J,type:"arg"}}}).catch((J)=>{if(!this.input.catch)return;this.state.renderer=this.input.catch.renderer;const[Z]=this.input.then.renderer.argv;this.state.props={[Z]:{value:J,type:"arg"}}})}},T6="<{state.renderer} #=state.props/>";var v1={};i0(v1,{state:()=>{{return b6}},handler:()=>{{return _6}},default:()=>{{return x6}},declaration:()=>{{return A6}}});var A6={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},b6={renderer:null},_6={onInput(){let J=[];for(let Z of this.input.case)if(Z.is==this.input.by||Array.isArray(Z.is)&&Z.is.includes(this.input.by))Array.isArray(Z.is)?J=[...new Set([...J,...Z.is])]:J.push(Z.is),this.state.renderer=Z.renderer;if(!J.includes(this.input.by))this.state.renderer=this.input.default?this.input.default.renderer:null}},x6="<{state.renderer}/>";var u1={};i0(u1,{state:()=>{{return g6}},handler:()=>{{return y6}},default:()=>{{return v6}},context:()=>{{return k6}},_static:()=>{{return h6}}});var f6=function(J){const Z={};return J.split("&").map((z)=>{const[q,Y]=z.split("=");Z[q]=Y}),Z},g6={page:null,params:{},query:{}},h6={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},k6=["navigate"],y6={onInput(){if(!this.input.routes)return;if(this.input.global)this.static.global=this.input.global;if(this.static.routes=this.input.routes.map(({path:J,template:Z,default:W})=>{if(W)this.static.defaultPath=J;const z=J.match(/:[^\/]*(\/|$)/gi)||[],q=J.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:J,template:Z,default:W,pathVars:z,pathRegex:new RegExp(`${q}\$`,"i")}}),this.input.global){const J=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&J=="/"&&J!==this.static.defaultPath?this.static.defaultPath:J?J+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 z=W[1]?f6(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:z}});const Y=this.match(J);if(!Y){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:G,params:X}=Y;this.emit("after",{fromState:q,toState:{path:G.path,params:X,query:z}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=X,this.state.query=z,this.state.page=G.template},match(J){const Z={};let W=!1;for(let z of this.static.routes){const{pathVars:q,pathRegex:Y}=z,G=J.match(Y);if(G!==null&&G.index===0){for(let X=0;X+1<G.length&&X<q.length;X++)Z[q[X].replaceAll(/[\/:]/g,"")]=G[X+1];W=z;break}}return W?{route:W,params:Z}:!1}},v6="<{state.page} params=state.params query=state.query/>";class m0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new t0;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new J1,this.IUC=new e0;const[Z,W]=_0(this.i18n.lang),[z,q]=_0(J?.context||{});this.__setLang=W,this.__getLang=Z,this.__setContext=q,this.__getContext=z,this.register("if",k1),this.register("for",f1),this.register("async",y1),this.register("switch",v1),this.register("router",u1)}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:z,...q}=Z,Y={debug:this.debug,prepath:"0",lips:this},G=new s0(J,z||"",{...q,input:W},Y);return window.addEventListener("beforeunload",()=>{return this.dispose(),G.destroy(),null}),window.addEventListener("pagehide",(X)=>{!X.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 u0("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 z={...W,[J]:Z};H0(W,z)&&this.__setContext(z)}else if(!Array.isArray(J)){const z={...W,...J};H0(W,z)&&this.__setContext(z)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;o0(()=>{const W=this.__getContext();if(!W)return;const z=Object.fromEntries(J.map((q)=>[q,W[q]]));z&&typeof Z==="function"&&Object.keys(z).length&&Z(z)})}useTranslator(J,Z){o0(()=>{const W=this.__getLang();if(!W)return;(J==="*"||Array.isArray(J)&&J.includes(W))&&typeof Z==="function"&&Z(W)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}function u6(J="body"){const Z={counter:0,counterHistory:[],updateFrequency:16,isRunning:!1,metrics:{fps:0,avgRenderTime:0,totalUpdates:0,memoryUsageMB:0,domOperations:0}},W={updateInterval:null,frameCountInterval:null,frameCount:0,lastFrameTimestamp:0,updateTimes:[]},z={onCreate(){console.log("Stress test component created")},onMount(){console.log("Stress test component mounted"),this.startPerformanceTracking()},onRender(){const M=performance.now();if(this.static.lastFrameTimestamp){const U=M-this.static.lastFrameTimestamp;if(U<1000){if(this.static.updateTimes.push(U),this.static.updateTimes.length>100)this.static.updateTimes.shift()}}this.static.lastFrameTimestamp=M,this.static.frameCount++},startPerformanceTracking(){this.static.frameCountInterval=setInterval(()=>{if(this.state.metrics.fps=this.static.frameCount,this.static.frameCount=0,this.static.updateTimes.length){const M=this.static.updateTimes.reduce((U,j)=>U+j,0)/this.static.updateTimes.length;this.state.metrics.avgRenderTime=M}if(window.performance&&window.performance.memory)this.state.metrics.memoryUsageMB=window.performance.memory.usedJSHeapSize/1048576},1000)},startStressTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.counterHistory=[],this.static.updateInterval=setInterval(()=>{if(this.state.counter++,this.state.metrics.totalUpdates++,this.state.counterHistory.length>100)this.state.counterHistory.shift();this.state.counterHistory.push(this.state.counter)},this.state.updateFrequency)},stopStressTest(){if(!this.state.isRunning)return;clearInterval(this.static.updateInterval),this.state.isRunning=!1},setUpdateFrequency(M){const U=parseFloat(M.target.value);if(this.state.updateFrequency=U,this.state.isRunning)this.stopStressTest(),this.startStressTest()},resetCounter(){this.state.counter=0,this.state.counterHistory=[],this.state.metrics.totalUpdates=0},runHeavyComputation(){const M=performance.now();let U=0;for(let j=0;j<1e7;j++)U+=Math.sqrt(j);console.log(`Heavy computation completed in ${performance.now()-M}ms, result: ${U}`)},destroy(){clearInterval(this.static.updateInterval),clearInterval(this.static.frameCountInterval)}},X=new m0({debug:!0}).render("StressTestApp",{default:`
1
+ var X6=Object.create;var{defineProperty:T1,getPrototypeOf:H6,getOwnPropertyNames:z6}=Object;var q6=Object.prototype.hasOwnProperty;var A1=(J,Z,W)=>{W=J!=null?X6(H6(J)):{};const z=Z||!J||!J.__esModule?T1(W,"default",{value:J,enumerable:!0}):W;for(let q of z6(J))if(!q6.call(z,q))T1(z,q,{get:()=>J[q],enumerable:!0});return z};var Y6=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var i0=(J,Z)=>{for(var W in Z)T1(J,W,{get:Z[W],enumerable:!0,configurable:!0,set:(z)=>Z[W]=()=>z})};var W1=Y6((Q5,W5)=>{(function(){var J=document,Z=window,W=J.documentElement,z=J.createElement.bind(J),q=z("div"),Y=z("table"),G=z("tbody"),X=z("tr"),M=Array.isArray,U=Array.prototype,j=U.concat,$=U.filter,g=U.indexOf,_=U.map,u=U.push,p=U.slice,a=U.some,i=U.splice,s=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,Z0=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/<.+>/,y=/^\w+$/;function k(Q,H){var B=m(H);return!Q||!B&&!C(H)&&!P(H)?[]:!B&&Z0.test(Q)?H.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!B&&y.test(Q)?H.getElementsByTagName(Q):H.querySelectorAll(Q)}var K=function(){function Q(H,B){if(!H)return;if(S(H))return H;var D=H;if(E(H)){var I=B||J;if(D=s.test(H)&&C(I)?I.getElementById(H.slice(1).replace(/\\/g,"")):d.test(H)?d1(H):S(I)?I.find(H):E(I)?w(I).find(H):k(H,I),!D)return}else if(V(H))return this.ready(H);if(D.nodeType||D===Z)D=[D];this.length=D.length;for(var R=0,h=this.length;R<h;R++)this[R]=D[R]}return Q.prototype.init=function(H,B){return new Q(H,B)},Q}(),O=K.prototype,w=O.init;if(w.fn=w.prototype=O,O.length=0,O.splice=i,typeof Symbol==="function")O[Symbol.iterator]=U[Symbol.iterator];function S(Q){return Q instanceof K}function L(Q){return!!Q&&Q===Q.window}function C(Q){return!!Q&&Q.nodeType===9}function m(Q){return!!Q&&Q.nodeType===11}function P(Q){return!!Q&&Q.nodeType===1}function x(Q){return!!Q&&Q.nodeType===3}function f(Q){return typeof Q==="boolean"}function V(Q){return typeof Q==="function"}function E(Q){return typeof Q==="string"}function T(Q){return Q===void 0}function N(Q){return Q===null}function F(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function A(Q){if(typeof Q!=="object"||Q===null)return!1;var H=Object.getPrototypeOf(Q);return H===null||H===Object.prototype}w.isWindow=L,w.isFunction=V,w.isArray=M,w.isNumeric=F,w.isPlainObject=A;function b(Q,H,B){if(B){var D=Q.length;while(D--)if(H.call(Q[D],D,Q[D])===!1)return Q}else if(A(Q)){var I=Object.keys(Q);for(var D=0,R=I.length;D<R;D++){var h=I[D];if(H.call(Q[h],h,Q[h])===!1)return Q}}else for(var D=0,R=Q.length;D<R;D++)if(H.call(Q[D],D,Q[D])===!1)return Q;return Q}w.each=b,O.each=function(Q){return b(this,Q)},O.empty=function(){return this.each(function(Q,H){while(H.firstChild)H.removeChild(H.firstChild)})};function c(){var Q=[];for(var H=0;H<arguments.length;H++)Q[H]=arguments[H];var B=f(Q[0])?Q.shift():!1,D=Q.shift(),I=Q.length;if(!D)return{};if(!I)return c(B,w,D);for(var R=0;R<I;R++){var h=Q[R];for(var v in h)if(B&&(M(h[v])||A(h[v]))){if(!D[v]||D[v].constructor!==h[v].constructor)D[v]=new h[v].constructor;c(B,D[v],h[v])}else D[v]=h[v]}return D}w.extend=c,O.extend=function(Q){return c(O,Q)};var l=/\S+/g;function o(Q){return E(Q)?Q.match(l)||[]:[]}O.toggleClass=function(Q,H){var B=o(Q),D=!T(H);return this.each(function(I,R){if(!P(R))return;b(B,function(h,v){if(D)H?R.classList.add(v):R.classList.remove(v);else R.classList.toggle(v)})})},O.addClass=function(Q){return this.toggleClass(Q,!0)},O.removeAttr=function(Q){var H=o(Q);return this.each(function(B,D){if(!P(D))return;b(H,function(I,R){D.removeAttribute(R)})})};function D0(Q,H){if(!Q)return;if(E(Q)){if(arguments.length<2){if(!this[0]||!P(this[0]))return;var B=this[0].getAttribute(Q);return N(B)?void 0:B}if(T(H))return this;if(N(H))return this.removeAttr(Q);return this.each(function(I,R){if(!P(R))return;R.setAttribute(Q,H)})}for(var D in Q)this.attr(D,Q[D]);return this}O.attr=D0,O.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},O.hasClass=function(Q){return!!Q&&a.call(this,function(H){return P(H)&&H.classList.contains(Q)})},O.get=function(Q){if(T(Q))return p.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},O.eq=function(Q){return w(this.get(Q))},O.first=function(){return this.eq(0)},O.last=function(){return this.eq(-1)};function e(Q){if(T(Q))return this.get().map(function(H){return P(H)||x(H)?H.textContent:""}).join("");return this.each(function(H,B){if(!P(B))return;B.textContent=Q})}O.text=e;function r(Q,H,B){if(!P(Q))return;var D=Z.getComputedStyle(Q,null);return B?D.getPropertyValue(H)||void 0:D[H]||Q.style[H]}function z0(Q,H){return parseInt(r(Q,H),10)||0}function d0(Q,H){return z0(Q,"border".concat(H?"Left":"Top","Width"))+z0(Q,"padding".concat(H?"Left":"Top"))+z0(Q,"padding".concat(H?"Right":"Bottom"))+z0(Q,"border".concat(H?"Right":"Bottom","Width"))}var R0={};function N0(Q){if(R0[Q])return R0[Q];var H=z(Q);J.body.insertBefore(H,null);var B=r(H,"display");return J.body.removeChild(H),R0[Q]=B!=="none"?B:"block"}function K0(Q){return r(Q,"display")==="none"}function x0(Q,H){var B=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!B&&!!H&&B.call(Q,H)}function T0(Q){return E(Q)?function(H,B){return x0(B,Q)}:V(Q)?Q:S(Q)?function(H,B){return Q.is(B)}:!Q?function(){return!1}:function(H,B){return B===Q}}O.filter=function(Q){var H=T0(Q);return w($.call(this,function(B,D){return H.call(B,D,B)}))};function S0(Q,H){return!H?Q:Q.filter(H)}O.detach=function(Q){return S0(this,Q).each(function(H,B){if(B.parentNode)B.parentNode.removeChild(B)}),this};var b5=/^\s*<(\w+)[^>]*>/,_5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,m1={"*":q,tr:G,td:X,th:X,thead:Y,tbody:Y,tfoot:Y};function d1(Q){if(!E(Q))return[];if(_5.test(Q))return[z(RegExp.$1)];var H=b5.test(Q)&&RegExp.$1,B=m1[H]||m1["*"];return B.innerHTML=Q,w(B.childNodes).detach().get()}w.parseHTML=d1,O.has=function(Q){var H=E(Q)?function(B,D){return k(Q,D).length}:function(B,D){return D.contains(Q)};return this.filter(H)},O.not=function(Q){var H=T0(Q);return this.filter(function(B,D){return(!E(Q)||P(D))&&!H.call(D,B,D)})};function F0(Q,H,B,D){var I=[],R=V(H),h=D&&T0(D);for(var v=0,U0=Q.length;v<U0;v++)if(R){var W0=H(Q[v]);if(W0.length)u.apply(I,W0)}else{var Y0=Q[v][H];while(Y0!=null){if(D&&h(-1,Y0))break;I.push(Y0),Y0=B?Y0[H]:null}}return I}function i1(Q){if(Q.multiple&&Q.options)return F0($.call(Q.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return Q.value||""}function x5(Q){if(!arguments.length)return this[0]&&i1(this[0]);return this.each(function(H,B){var D=B.multiple&&B.options;if(D||J5.test(B.type)){var I=M(Q)?_.call(Q,String):N(Q)?[]:[String(Q)];if(D)b(B.options,function(R,h){h.selected=I.indexOf(h.value)>=0},!0);else B.checked=I.indexOf(B.value)>=0}else B.value=T(Q)||N(Q)?"":Q})}O.val=x5,O.is=function(Q){var H=T0(Q);return a.call(this,function(B,D){return H.call(B,D,B)})},w.guid=1;function j0(Q){return Q.length>1?$.call(Q,function(H,B,D){return g.call(D,H)===B}):Q}w.unique=j0,O.add=function(Q,H){return w(j0(this.get().concat(w(Q,H).get())))},O.children=function(Q){return S0(w(j0(F0(this,function(H){return H.children}))),Q)},O.parent=function(Q){return S0(w(j0(F0(this,"parentNode"))),Q)},O.index=function(Q){var H=Q?w(Q)[0]:this[0],B=Q?this:w(H).parent().children();return g.call(B,H)},O.closest=function(Q){var H=this.filter(Q);if(H.length)return H;var B=this.parent();if(!B.length)return H;return B.closest(Q)},O.siblings=function(Q){return S0(w(j0(F0(this,function(H){return w(H).parent().children().not(H)}))),Q)},O.find=function(Q){return w(j0(F0(this,function(H){return k(Q,H)})))};var g5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,h5=/^$|^module$|\/(java|ecma)script/i,k5=["type","src","nonce","noModule"];function f5(Q,H){var B=w(Q);B.filter("script").add(B.find("script")).each(function(D,I){if(h5.test(I.type)&&W.contains(I)){var R=z("script");R.text=I.textContent.replace(g5,""),b(k5,function(h,v){if(I[v])R[v]=I[v]}),H.head.insertBefore(R,null),H.head.removeChild(R)}})}function y5(Q,H,B,D,I){if(D)Q.insertBefore(H,B?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(H,Q);else Q.parentNode.insertBefore(H,B?Q:Q.nextSibling);if(I)f5(H,Q.ownerDocument)}function P0(Q,H,B,D,I,R,h,v){return b(Q,function(U0,W0){b(w(W0),function(Y0,A0){b(w(H),function(M0,r0){var P1=B?A0:r0,E1=B?r0:A0,B0=B?Y0:M0;y5(P1,!B0?E1:E1.cloneNode(!0),D,I,!B0)},v)},h)},R),H}O.after=function(){return P0(arguments,this,!1,!1,!1,!0,!0)},O.append=function(){return P0(arguments,this,!1,!1,!0)};function v5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if(T(Q))return this;var H=/<script[\s>]/.test(Q);return this.each(function(B,D){if(!P(D))return;if(H)w(D).empty().append(Q);else D.innerHTML=Q})}O.html=v5,O.appendTo=function(Q){return P0(arguments,this,!0,!1,!0)},O.wrapInner=function(Q){return this.each(function(H,B){var D=w(B),I=D.contents();I.length?I.wrapAll(Q):D.append(Q)})},O.before=function(){return P0(arguments,this,!1,!0)},O.wrapAll=function(Q){var H=w(Q),B=H[0];while(B.children.length)B=B.firstElementChild;return this.first().before(H),this.appendTo(B)},O.wrap=function(Q){return this.each(function(H,B){var D=w(Q)[0];w(B).wrapAll(!H?D:D.cloneNode(!0))})},O.insertAfter=function(Q){return P0(arguments,this,!0,!1,!1,!1,!1,!0)},O.insertBefore=function(Q){return P0(arguments,this,!0,!0)},O.prepend=function(){return P0(arguments,this,!1,!0,!0,!0,!0)},O.prependTo=function(Q){return P0(arguments,this,!0,!0,!0,!1,!1,!0)},O.contents=function(){return w(j0(F0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},O.next=function(Q,H,B){return S0(w(j0(F0(this,"nextElementSibling",H,B))),Q)},O.nextAll=function(Q){return this.next(Q,!0)},O.nextUntil=function(Q,H){return this.next(H,!0,Q)},O.parents=function(Q,H){return S0(w(j0(F0(this,"parentElement",!0,H))),Q)},O.parentsUntil=function(Q,H){return this.parents(H,Q)},O.prev=function(Q,H,B){return S0(w(j0(F0(this,"previousElementSibling",H,B))),Q)},O.prevAll=function(Q){return this.prev(Q,!0)},O.prevUntil=function(Q,H){return this.prev(H,!0,Q)},O.map=function(Q){return w(j.apply([],_.call(this,function(H,B){return Q.call(H,B,H)})))},O.clone=function(){return this.map(function(Q,H){return H.cloneNode(!0)})},O.offsetParent=function(){return this.map(function(Q,H){var B=H.offsetParent;while(B&&r(B,"position")==="static")B=B.offsetParent;return B||W})},O.slice=function(Q,H){return w(p.call(this,Q,H))};var u5=/-([a-z])/g;function F1(Q){return Q.replace(u5,function(H,B){return B.toUpperCase()})}O.ready=function(Q){var H=function(){return setTimeout(Q,0,w)};if(J.readyState!=="loading")H();else J.addEventListener("DOMContentLoaded",H);return this},O.unwrap=function(){return this.parent().each(function(Q,H){if(H.tagName==="BODY")return;var B=w(H);B.replaceWith(B.children())}),this},O.offset=function(){var Q=this[0];if(!Q)return;var H=Q.getBoundingClientRect();return{top:H.top+Z.pageYOffset,left:H.left+Z.pageXOffset}},O.position=function(){var Q=this[0];if(!Q)return;var H=r(Q,"position")==="fixed",B=H?Q.getBoundingClientRect():this.offset();if(!H){var D=Q.ownerDocument,I=Q.offsetParent||D.documentElement;while((I===D.body||I===D.documentElement)&&r(I,"position")==="static")I=I.parentNode;if(I!==Q&&P(I)){var R=w(I).offset();B.top-=R.top+z0(I,"borderTopWidth"),B.left-=R.left+z0(I,"borderLeftWidth")}}return{top:B.top-z0(Q,"marginTop"),left:B.left-z0(Q,"marginLeft")}};var c1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};O.prop=function(Q,H){if(!Q)return;if(E(Q)){if(Q=c1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(D,I){I[Q]=H})}for(var B in Q)this.prop(B,Q[B]);return this},O.removeProp=function(Q){return this.each(function(H,B){delete B[c1[Q]||Q]})};var m5=/^--/;function I1(Q){return m5.test(Q)}var L1={},d5=q.style,i5=["webkit","moz","ms"];function c5(Q,H){if(H===void 0)H=I1(Q);if(H)return Q;if(!L1[Q]){var B=F1(Q),D="".concat(B[0].toUpperCase()).concat(B.slice(1)),I="".concat(B," ").concat(i5.join("".concat(D," "))).concat(D).split(" ");b(I,function(R,h){if(h in d5)return L1[Q]=h,!1})}return L1[Q]}var p5={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 p1(Q,H,B){if(B===void 0)B=I1(Q);return!B&&!p5[Q]&&F(H)?"".concat(H,"px"):H}function o5(Q,H){if(E(Q)){var B=I1(Q);if(Q=c5(Q,B),arguments.length<2)return this[0]&&r(this[0],Q,B);if(!Q)return this;return H=p1(Q,H,B),this.each(function(I,R){if(!P(R))return;if(B)R.style.setProperty(Q,H);else R.style[Q]=H})}for(var D in Q)this.css(D,Q[D]);return this}O.css=o5;function o1(Q,H){try{return Q(H)}catch(B){return H}}var s5=/^\s+|\s+$/;function s1(Q,H){var B=Q.dataset[H]||Q.dataset[F1(H)];if(s5.test(B))return B;return o1(JSON.parse,B)}function l5(Q,H,B){B=o1(JSON.stringify,B),Q.dataset[F1(H)]=B}function r5(Q,H){if(!Q){if(!this[0])return;var B={};for(var D in this[0].dataset)B[D]=s1(this[0],D);return B}if(E(Q)){if(arguments.length<2)return this[0]&&s1(this[0],Q);if(T(H))return this;return this.each(function(I,R){l5(R,Q,H)})}for(var D in Q)this.data(D,Q[D]);return this}O.data=r5;function l1(Q,H){var B=Q.documentElement;return Math.max(Q.body["scroll".concat(H)],B["scroll".concat(H)],Q.body["offset".concat(H)],B["offset".concat(H)],B["client".concat(H)])}b([!0,!1],function(Q,H){b(["Width","Height"],function(B,D){var I="".concat(H?"outer":"inner").concat(D);O[I]=function(R){if(!this[0])return;if(L(this[0]))return H?this[0]["inner".concat(D)]:this[0].document.documentElement["client".concat(D)];if(C(this[0]))return l1(this[0],D);return this[0]["".concat(H?"offset":"client").concat(D)]+(R&&H?z0(this[0],"margin".concat(B?"Top":"Left"))+z0(this[0],"margin".concat(B?"Bottom":"Right")):0)}})}),b(["Width","Height"],function(Q,H){var B=H.toLowerCase();O[B]=function(D){if(!this[0])return T(D)?void 0:this;if(!arguments.length){if(L(this[0]))return this[0].document.documentElement["client".concat(H)];if(C(this[0]))return l1(this[0],H);return this[0].getBoundingClientRect()[B]-d0(this[0],!Q)}var I=parseInt(D,10);return this.each(function(R,h){if(!P(h))return;var v=r(h,"boxSizing");h.style[B]=p1(B,I+(v==="border-box"?d0(h,!Q):0))})}});var r1="___cd";O.toggle=function(Q){return this.each(function(H,B){if(!P(B))return;var D=K0(B),I=T(Q)?D:Q;if(I){if(B.style.display=B[r1]||"",K0(B))B.style.display=N0(B.tagName)}else if(!D)B[r1]=r(B,"display"),B.style.display="none"})},O.hide=function(){return this.toggle(!1)},O.show=function(){return this.toggle(!0)};var n1="___ce",V1=".",C1={focus:"focusin",blur:"focusout"},t1={mouseenter:"mouseover",mouseleave:"mouseout"},n5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function N1(Q){return t1[Q]||C1[Q]||Q}function S1(Q){var H=Q.split(V1);return[H[0],H.slice(1).sort()]}O.trigger=function(Q,H){if(E(Q)){var B=S1(Q),D=B[0],I=B[1],R=N1(D);if(!R)return this;var h=n5.test(R)?"MouseEvents":"HTMLEvents";Q=J.createEvent(h),Q.initEvent(R,!0,!0),Q.namespace=I.join(V1),Q.___ot=D}Q.___td=H;var v=Q.___ot in C1;return this.each(function(U0,W0){if(v&&V(W0[Q.___ot]))W0["___i".concat(Q.type)]=!0,W0[Q.___ot](),W0["___i".concat(Q.type)]=!1;W0.dispatchEvent(Q)})};function a1(Q){return Q[n1]=Q[n1]||{}}function t5(Q,H,B,D,I){var R=a1(Q);R[H]=R[H]||[],R[H].push([B,D,I]),Q.addEventListener(H,I)}function e1(Q,H){return!H||!a.call(H,function(B){return Q.indexOf(B)<0})}function l0(Q,H,B,D,I){var R=a1(Q);if(!H)for(H in R)l0(Q,H,B,D,I);else if(R[H])R[H]=R[H].filter(function(h){var v=h[0],U0=h[1],W0=h[2];if(I&&W0.guid!==I.guid||!e1(v,B)||D&&D!==U0)return!0;Q.removeEventListener(H,W0)})}O.off=function(Q,H,B){var D=this;if(T(Q))this.each(function(R,h){if(!P(h)&&!C(h)&&!L(h))return;l0(h)});else if(!E(Q))for(var I in Q)this.off(I,Q[I]);else{if(V(H))B=H,H="";b(o(Q),function(R,h){var v=S1(h),U0=v[0],W0=v[1],Y0=N1(U0);D.each(function(A0,M0){if(!P(M0)&&!C(M0)&&!L(M0))return;l0(M0,Y0,W0,H,B)})})}return this},O.remove=function(Q){return S0(this,Q).detach().off(),this},O.replaceWith=function(Q){return this.before(Q).remove()},O.replaceAll=function(Q){return w(Q).replaceWith(this),this};function a5(Q,H,B,D,I){var R=this;if(!E(Q)){for(var h in Q)this.on(h,H,B,Q[h],I);return this}if(!E(H))if(T(H)||N(H))H="";else if(T(B))B=H,H="";else D=B,B=H,H="";if(!V(D))D=B,B=void 0;if(!D)return this;return b(o(Q),function(v,U0){var W0=S1(U0),Y0=W0[0],A0=W0[1],M0=N1(Y0),r0=Y0 in t1,P1=Y0 in C1;if(!M0)return;R.each(function(E1,B0){if(!P(B0)&&!C(B0)&&!L(B0))return;var $1=function(X0){if(X0.target["___i".concat(X0.type)])return X0.stopImmediatePropagation();if(X0.namespace&&!e1(A0,X0.namespace.split(V1)))return;if(!H&&(P1&&(X0.target!==B0||X0.___ot===M0)||r0&&X0.relatedTarget&&B0.contains(X0.relatedTarget)))return;var R1=B0;if(H){var g0=X0.target;while(!x0(g0,H)){if(g0===B0)return;if(g0=g0.parentNode,!g0)return}R1=g0}Object.defineProperty(X0,"currentTarget",{configurable:!0,get:function(){return R1}}),Object.defineProperty(X0,"delegateTarget",{configurable:!0,get:function(){return B0}}),Object.defineProperty(X0,"data",{configurable:!0,get:function(){return B}});var W6=D.call(R1,X0,X0.___td);if(I)l0(B0,M0,A0,H,$1);if(W6===!1)X0.preventDefault(),X0.stopPropagation()};$1.guid=D.guid=D.guid||w.guid++,t5(B0,M0,A0,H,$1)})}),this}O.on=a5;function e5(Q,H,B,D){return this.on(Q,H,B,D,!0)}O.one=e5;var J6=/\r?\n/g;function Z6(Q,H){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(H.replace(J6,"\r\n")))}var Q6=/file|reset|submit|button|image/i,J5=/radio|checkbox/i;if(O.serialize=function(){var Q="";return this.each(function(H,B){b(B.elements||[B],function(D,I){if(I.disabled||!I.name||I.tagName==="FIELDSET"||Q6.test(I.type)||J5.test(I.type)&&!I.checked)return;var R=i1(I);if(!T(R)){var h=M(R)?R:[R];b(h,function(v,U0){Q+=Z6(I.name,U0)})}})}),Q.slice(1)},typeof Q5!=="undefined")W5.exports=w;else Z.cash=Z.$=w})()});var n0=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(W,z)=>{return Z[z]!==void 0?Z[z].toString():`{${z}}`})},Z5=(J,Z,W,z,q)=>{switch(J){case"plural":{if(typeof W==="string"){console.warn("Plural format value cannot be a string");return}if(z.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let X=W["*"];if(typeof X==="object")X=X[q||"*"];return n0(X,z)}if(typeof z.count==="string")z.count=Number(z.count);let Y="*";if(z.count.toString()in W)Y=z.count.toString();let G=W[Y]||W["*"];if(typeof G==="object")G=G[q||"*"];return n0(G,z)}case"condition":{if(typeof W==="string"){console.warn("Condition format value cannot be a string");return}let Y;for(let G in W)try{if(new Function("params",`with( params ){ return ${G}; }`)(z||{})){Y=W[G];break}}catch(X){console.warn(`Invalid <${Z}(${G})> condition expression`)}if(Y===void 0)return;if(typeof Y==="object")Y=Y[q||"*"];return n0(Y,z)}case"variable":default:{const Y=typeof W==="object"?W[q||"*"]:W;if(typeof Y==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return n0(Y,z)}}};class t0{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,z]=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[z||"*"]||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[z,q]=W.split("-");if(!this.DICTIONARIES[z]){console.warn(`Undefined <${W}> format dictionary`);return}if(!this.DICTIONARIES[z][J]){console.warn(`Undefined <${W}[${J}]> format reference`);return}const Y=this.DICTIONARIES[z][J];if(typeof Y==="string"){console.warn(`Invalid <${W}[${J}]> format reference. Expected object`);return}if(typeof Y!=="object"||Y===null||Array.isArray(Y)){console.warn(`Invalid <${W}[${J}]> format value`);return}return Z5(Y.type,J,Y.value,Z,q)}}class a0{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 e0{subscriptions=new Map;tick=new a0;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,z=new WeakMap,q=(G)=>{if(G instanceof Map)G.forEach((M,U)=>G.set(U,Y(M)));else if(Array.isArray(G))G.forEach((M,U)=>G[U]=Y(M));else if(typeof G==="object")Object.entries(G).forEach(([M,U])=>G[M]=Y(U));let X=new Proxy(G,{get(M,U){if(U==="toJSON")return function(){const $=(g)=>{if(!g||typeof g!=="object")return g;if(z.has(g)){const _=z.get(g);if(_ instanceof Map){const p={};return _.forEach((a,i)=>p[typeof i==="object"?JSON.stringify(i):String(i)]=$(a)),p}if(Array.isArray(_))return _.map((p)=>$(p));const u={};return Object.entries(_).forEach(([p,a])=>u[p]=$(a)),u}if(typeof g.toJSON==="function"&&!z.has(g))return g.toJSON();return g};return $(X)};if(U==="reset")return function(){X=null};const j=M[U];if(G instanceof Map&&typeof j==="function")return function(...$){const g=U.toString();if(g==="set"&&$.length>=2)$[1]=Y($[1]);const _=j.apply(M,$);return["set","delete","clear"].includes(g)&&W.queueUpdate(J),_};if(Array.isArray(G)&&typeof j==="function")return function(...$){const g=U.toString();if(["push","unshift"].includes(g))$=$.map((u)=>Y(u));else if(g==="splice"&&$.length>2)$=[$[0],$[1],...$.slice(2).map((u)=>Y(u))];const _=j.apply(M,$);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(g)&&W.queueUpdate(J),_};return j},set(M,U,j){if(M[U]===j)return!0;if(j instanceof Map&&M[U]instanceof Map){const $=M[U];return $.clear(),j.forEach((g,_)=>$.set(_,Y(g))),W.queueUpdate(J),!0}return M[U]=Y(j),W.queueUpdate(J),!0}});return z.set(X,G),X},Y=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Z)}}class J1{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",Z),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();else if(J.type==="detach"&&!document.contains(W[0]))this.unwatch(Z),Z.emit("component:detached",Z),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",J),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Z==="detach"&&!document.contains(W[0])){J.emit("component:detached",J),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const z=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Z}ment-timeout`,J)},this.TIMEOUT);this.observedComponents.set(J,{timeout:z,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()}}class Z1{pending=new Set;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){if(this.pending.add(J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=Array.from(this.pending);if(this.metrics.batchCount++,this.metrics.lastBatchSize=J.length,this.metrics.updatesProcessed+=J.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),this.pending.clear(),this.component.metrics.trackBatch(J.length),this.applyUpdates(J),this.isPending=!1,this.pending.size>0)this.isPending=!0,this.scheduleProcessing()}applyUpdates(J){J.forEach(({dep:Z,dependent:W})=>{try{const z=W.update(W.memo,"batch-updator");if(z)typeof z.memo==="object"&&this.component.FGUD.get(Z)?.set(W.path,{...W,memo:z.memo}),typeof z.cleanup==="function"&&z.cleanup()}catch(z){console.error("Failed to update dependency --",z)}})}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class Q1{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=Z.map((z)=>typeof z.toJSON==="function"?z.toJSON():z);this.__events[J]?.forEach((z)=>z(...W)),this.__once_events[J]?.forEach((z)=>z(...W)),delete this.__once_events[J]}}var b1=A1(W1(),1);function H0(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(X5(J)&&X5(Z)){for(let G of J)if(!Z.has(G))return!0;return!1}const Y=new WeakMap;for(let G of J){let X=!1;if(typeof G!=="object"){if(Z.has(G))X=!0}else for(let M of Z){if(typeof M!=="object")continue;if(!Y.has(G))Y.set(G,new WeakMap);const U=Y.get(G);if(U.has(M)){if(X=U.get(M),X)break;continue}const j=!H0(G,M);if(U.set(M,j),j){X=!0;break}}if(!X)return!0}return!1}if(J instanceof Map){if(!(Z instanceof Map))return!0;if(J.size!==Z.size)return!0;if(H5(J)&&H5(Z)){for(let[G,X]of J)if(Z.get(G)!==X)return!0;return!1}const Y=new WeakMap;for(let[G,X]of J){if(typeof G!=="object"){if(!Z.has(G))return!0;const j=Z.get(G);if(typeof X!=="object"){if(X!==j)return!0;continue}if(typeof j!=="object"||H0(X,j))return!0;continue}let M=!1,U=!1;for(let[j,$]of Z){if(typeof j!=="object")continue;if(!Y.has(G))Y.set(G,new WeakMap);const g=Y.get(G);if(g.has(j)){const[_,u]=g.get(j);if(_){M=!0,U=u;break}continue}if(!H0(G,j)){if(M=!0,U=typeof X==="object"&&typeof $==="object"?!H0(X,$):X===$,g.set(j,[!0,U]),U)break}else g.set(j,[!1,!1])}if(!M||!U)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Z))return!0;if(J.length!==Z.length)return!0;for(let Y=0;Y<J.length;Y++){const G=J[Y],X=Z[Y];if(G!==X&&(typeof G!=="object"||H0(G,X)))return!0}return!1}const W=Object.keys(J),z=Object.keys(Z);if(W.length!==z.length)return!0;W.sort(),z.sort();const q=W.length;for(let Y=0;Y<q;Y++)if(W[Y]!==z[Y])return!0;for(let Y=0;Y<q;Y++){const G=W[Y],X=J[G],M=Z[G];if(X===M)continue;if(X instanceof Date){if(!(M instanceof Date)||String(X)!==String(M))return!0;continue}if(X instanceof RegExp){if(!(M instanceof RegExp)||X.source!==M.source||X.flags!==M.flags)return!0;continue}if(X instanceof Map){if(!(M instanceof Map)||H0(X,M))return!0;continue}if(X instanceof Set){if(!(M instanceof Set)||H0(X,M))return!0;continue}if(X instanceof Function){if(!(M instanceof Function))return!0;continue}if(typeof X==="object"){if(typeof M!=="object")return!0;if(X===J){if(M!==Z)return!0}else if(H0(X,M))return!0}else return!0}return!1}function E0(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 X=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),M=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let U=0;U<X.length;U++)if(X[U]!==M[U])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!H0(J,Z);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Z))return!1;const Y=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(Z);if(Y.length!==G.length)return!1;for(let X of Y){if(!Object.prototype.hasOwnProperty.call(Z,X))return!1;if(!E0(J[X],Z[X]))return!1}if(q!==null&&q!==Object.prototype){const X=Object.getOwnPropertyNames(q),M=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(X.length!==M.length)return!1;for(let U of X){if(U==="constructor")continue;if(!E0(q[U],Object.getPrototypeOf(Z)[U]))return!1}}return!0}function X5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function H5(J){for(let[Z,W]of J)if(typeof Z==="object"&&Z!==null||typeof W==="object"&&W!==null)return!1;return!0}function J0(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((Y,G)=>q.set(J0(G,Z),J0(Y,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((Y)=>q.add(J0(Y,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let Y=0;Y<J.length;Y++)q[Y]=J0(J[Y],Z);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const W=Object.create(Object.getPrototypeOf(J));Z.set(J,W);const z=Object.getOwnPropertySymbols(J);for(let q of z)W[q]=J0(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))W[q]=J0(J[q],Z);return W}function q5(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,Y,G){const X=Y.split(/\.|\[|\]/).filter(Boolean);let M=q;for(let U=0;U<X.length;U++){const j=X[U],$=!isNaN(Number(j)),g=U===X.length-1,_=!isNaN(Number(X[U+1]));if(g){M[j]=G;continue}if(!(j in M))M[j]=_?[]:{};else if(_&&!Array.isArray(M[j]))M[j]=[];else if(!_&&Array.isArray(M[j]))M[j]={};M=M[j]}}const z=J0(J);try{for(let[q,Y]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(z,q,Y)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return z}var $0="i18n",I0="syn:",O0="fn:",b0="on-",t=/^\.\.\./,X1=/^\[(.*?)\]$/,_1=/{\s*([^{}]+)\s*}/g,z5=["@html","@text","@format"];b1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&b1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class H1{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=J0(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},z={"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},Y={"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(z),console.table(q),console.table(Y),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 J0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var n=A1(W1(),1);var $5=A1(W1(),1);var z1="comm",q1="rule",Y1="decl";var Y5="@import";var B5="@namespace",G5="@keyframes";var w5="@layer";function B1(J){return J.trim()}function h0(J,Z,W){return J.replace(Z,W)}function K5(J,Z,W){return J.indexOf(Z,W)}function L0(J,Z){return J.charCodeAt(Z)|0}function V0(J,Z,W){return J.slice(Z,W)}function q0(J){return J.length}function G1(J){return J.length}function k0(J,Z){return Z.push(J),J}var x1=Math.abs,c0=String.fromCharCode;function K1(J,Z,W,z,q,Y,G,X){return{value:J,root:Z,parent:W,type:z,props:q,children:Y,line:w1,column:f0,length:G,return:"",siblings:X}}function M5(){return Q0}function O5(){if(Q0=G0>0?L0(v0,--G0):0,f0--,Q0===10)f0=1,w1--;return Q0}function w0(){if(Q0=G0<U5?L0(v0,G0++):0,f0++,Q0===10)f0=1,w1++;return Q0}function C0(){return L0(v0,G0)}function p0(){return G0}function U1(J,Z){return V0(v0,J,Z)}function y0(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 D5(J){return w1=f0=1,U5=q0(v0=J),G0=0,[]}function j5(J){return v0="",J}function M1(J){return B1(U1(G0-1,g1(J===91?J+2:J===40?J+1:J)))}function F5(J){while(Q0=C0())if(Q0<33)w0();else break;return y0(J)>2||y0(Q0)>3?"":" "}function I5(J,Z){while(--Z&&w0())if(Q0<48||Q0>102||Q0>57&&Q0<65||Q0>70&&Q0<97)break;return U1(J,p0()+(Z<6&&C0()==32&&w0()==32))}function g1(J){while(w0())switch(Q0){case J:return G0;case 34:case 39:if(J!==34&&J!==39)g1(Q0);break;case 40:if(J===41)g1(J);break;case 92:w0();break}return G0}function L5(J,Z){while(w0())if(J+Q0===57)break;else if(J+Q0===84&&C0()===47)break;return"/*"+U1(Z,G0-1)+"*"+c0(J===47?J:w0())}function V5(J){while(!y0(C0()))w0();return U1(J,G0)}var w1=1,f0=1,U5=0,G0=0,Q0=0,v0="";function S5(J){return j5(O1("",null,null,null,[""],J=D5(J),0,[0],J))}function O1(J,Z,W,z,q,Y,G,X,M){var U=0,j=0,$=G,g=0,_=0,u=0,p=1,a=1,i=1,s=0,Z0="",d=q,y=Y,k=z,K=Z0;while(a)switch(u=s,s=w0()){case 40:if(u!=108&&L0(K,$-1)==58){if(K5(K+=h0(M1(s),"&","&\f"),"&\f",x1(U?X[U-1]:0))!=-1)i=-1;break}case 34:case 39:case 91:K+=M1(s);break;case 9:case 10:case 13:case 32:K+=F5(u);break;case 92:K+=I5(p0()-1,7);continue;case 47:switch(C0()){case 42:case 47:if(k0(G6(L5(w0(),p0()),Z,W,M),M),(y0(u||1)==5||y0(C0()||1)==5)&&q0(K)&&V0(K,-1,void 0)!==" ")K+=" ";break;default:K+="/"}break;case 123*p:X[U++]=q0(K)*i;case 125*p:case 59:case 0:switch(s){case 0:case 125:a=0;case 59+j:if(i==-1)K=h0(K,/\f/g,"");if(_>0&&(q0(K)-$||p===0&&u===47))k0(_>32?N5(K+";",z,W,$-1,M):N5(h0(K," ","")+";",z,W,$-2,M),M);break;case 59:K+=";";default:if(k0(k=C5(K,Z,W,U,j,q,X,Z0,d=[],y=[],$,Y),Y),s===123)if(j===0)O1(K,Z,k,k,d,Y,$,X,y);else{switch(g){case 99:if(L0(K,3)===110)break;case 108:if(L0(K,2)===97)break;default:j=0;case 100:case 109:case 115:}if(j)O1(J,k,k,z&&k0(C5(J,k,k,0,0,q,X,Z0,q,d=[],$,y),y),q,y,$,X,z?d:y);else O1(K,k,k,k,[""],y,0,X,y)}}U=j=_=0,p=i=1,Z0=K="",$=G;break;case 58:$=1+q0(K),_=u;default:if(p<1){if(s==123)--p;else if(s==125&&p++==0&&O5()==125)continue}switch(K+=c0(s),s*p){case 38:i=j>0?1:(K+="\f",-1);break;case 44:X[U++]=(q0(K)-1)*i,i=1;break;case 64:if(C0()===45)K+=M1(w0());g=C0(),j=$=q0(Z0=K+=V5(p0())),s++;break;case 45:if(u===45&&q0(K)==2)p=0}}return Y}function C5(J,Z,W,z,q,Y,G,X,M,U,j,$){var g=q-1,_=q===0?Y:[""],u=G1(_);for(var p=0,a=0,i=0;p<z;++p)for(var s=0,Z0=V0(J,g+1,g=x1(a=G[p])),d=J;s<u;++s)if(d=B1(a>0?_[s]+" "+Z0:h0(Z0,/&\f/g,_[s])))M[i++]=d;return K1(J,Z,W,q===0?q1:X,M,U,j,$)}function G6(J,Z,W,z){return K1(J,Z,W,z1,c0(M5()),V0(J,2,-2),0,z)}function N5(J,Z,W,z,q){return K1(J,Z,W,Y1,V0(J,0,z),V0(J,z+1,-1),z,q)}function D1(J,Z){var W="";for(var z=0;z<J.length;z++)W+=Z(J[z],z,J,Z)||"";return W}function P5(J,Z,W,z){switch(J.type){case w5:if(J.children.length)break;case Y5:case B5:case Y1:return J.return=J.return||J.value;case z1:return"";case G5:return J.return=J.value+"{"+D1(J.children,z)+"}";case q1:if(!q0(J.value=J.props.join(",")))return""}return q0(W=D1(J.children,z))?J.return=J.value+"{"+W+"}":""}function E5(J){var Z=G1(J);return function(W,z,q,Y){var G="";for(var X=0;X<Z;X++)G+=J[X](W,z,q,Y)||"";return G}}class u0{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 D1(S5(J),E5([P5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const W=new MutationObserver(()=>{const z=document.querySelector(J);if(z&&getComputedStyle(z).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 z=document.createElement("style");z.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),z.textContent=W;let q=0;const Y=this.$head.find(`style[${Z}]`);if(Y.length)q=parseInt(Y.attr("dindex"))+1,Y.remove();return z.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(z):document.head.appendChild(z),z}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{}}}var w6=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let W=J,z;while((z=Z.exec(J))!==null){const q=z[1],Y=z.index+z[0].length;let G=1,X=Y;while(X<J.length&&G>0){if(J[X]==="(")G++;if(J[X]===")")G--;X++}if(G===0){const M=J.slice(Y,X-1).trim(),U=J.slice(0,z.index),j=`${b0}${q}="${M}"`,$=J.slice(X);W=U+j+$,J=W,Z.lastIndex=U.length+j.length}}return W},K6=function(J){const Z=[];let z=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,Y,G)=>{return Z.push(G),`<${Y}##TAG_ATTRS_${Z.length-1}##>`});for(let q=0;q<Z.length;q++){const Y=`##TAG_ATTRS_${q}##`,G=Z[q],X=U6(G);z=z.replace(Y,X)}return z},U6=function(J){let Z="",W=0,z=!1,q="",Y=0,G=0,X=0;while(W<J.length){const M=J[W];if((M==='"'||M==="'")&&(W===0||J[W-1]!=="\\")){if(!z)z=!0,q=M;else if(M===q)z=!1}if(!z){if(M==="(")G++;else if(M===")")G--;else if(M==="{")X++;else if(M==="}")X--}if(!z&&G===0&&X===0&&(M===" "||W===J.length-1)){let U=W;if(W===J.length-1)U=W+1;const j=J.substring(Y,U).trim();if(j){const $=M6(j);Z+=" "+$}Y=W+1}W++}return Z},M6=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===$0||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let W=J.substring(0,Z).trim(),z=J.substring(Z+1).trim();if(W.startsWith("@"))return W=!z5.includes(W)?W.slice(1):W,`:${W}=${z}`;if(W.startsWith(O0)||W.startsWith(b0))return J;if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'")){const q=z.substring(1,z.length-1);if(O6(q))return`:${W}="${q}"`;return J}else return`:${W}="${z}"`};function O6(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 h1(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,z,q)=>{return q.endsWith("<")?`<lips dtag="${z}" ${q}/lips>`:`<lips dtag="${z}" ${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 ${O0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Z=w6(Z),Z=K6(Z),Z}var D6=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},T5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function _0(J,Z={maxSize:100}){const W=new Set,z=[{value:J,timestamp:Date.now()}];let q=0;const Y=()=>{const U=j1[j1.length-1];return U&&D6(U,W),z[q].value},G=()=>{const U=[...W];if(R5)for(let j of U)R5.add(j);else for(let j of U)j.execute()};return[Y,(U,j)=>{if(Object.is(z[q].value,U))return;if(q<z.length-1)z.splice(q+1);if(z.push({value:U,timestamp:Date.now(),metadata:j}),z.length>Z.maxSize)z.shift(),q=Math.max(0,q-1);else q++;G()},{undo(){if(q>0)q--,G()},redo(){if(q<z.length-1)q++,G()},jumpTo(U){if(U>=0&&U<z.length&&U!==q)q=U,G()},getHistory(){return[...z]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<z.length-1},clear(){const U=z[0];z.length=0,z.push(U),q=0,G()}}]}function o0(J){let Z=!1;const W=()=>{if(Z)throw new Error("Circular dependency detected");if(z.isDisposed)return;Z=!0,T5(z),j1.push(z);try{J()}finally{Z=!1,j1.pop()}},z={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{z.isDisposed=!0,T5(z)}}}var j1=[],R5=null;class s0 extends Q1{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=new Map;__renderCache=new Map;FGUD=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;metrics;stylesheet;__path="";__pathCounter=0;__renderDepth=0;constructor(J,Z,{input:W,state:z,context:q,_static:Y,handler:G,stylesheet:X,macros:M,declaration:U},j){super();if(this.lips=j.lips,j?.debug)this.debug=j.debug||this.lips.debug;if(j?.prepath)this.prepath=j.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=`${this.prepath}/${this.__name__}`,this.__template__=h1(Z),this.declaration=U||{name:J},this.input=W||{},this.static=Y||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,z||{}),M&&this.setMacros(M),G&&this.setHandler(G),X&&this.setStylesheet(X),this.metrics=new H1(this.debug),this.metrics.inc("componentCount"),this.UQS=new Z1(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create",this),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(this.input),this.emit("component:input",this);this.__previous={input:J0(this.input),state:J0(this.state),context:J0(this.context)};const[$,g]=_0(this.input),[_,u]=_0(this.state),[p,a]=_0(this.context);this.__setInput=g,this.__setState=u,this.__getState=_,this.lips.IUC.register(this.__path__,()=>{H0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(i)=>{if(!H0(this.context,i))return;a(i),this.context=i,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context",this)}),this.lips.useTranslator("*",(i)=>{if(i===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=i}),this.ICE=o0(()=>{const i=$(),s=_(),Z0=this.context=p();if(!this.isRendered){this.metrics.reset();const{$log:d}=this.render("",void 0,void 0,this.FGUD);this.$=d,!U?.syntax&&this.$?.each((y,k)=>typeof k.setAttribute=="function"&&k.setAttribute("rel",this.__name__)),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount",this),this.lips.watcher.watch(this)}else this.__updateDepNodes__({state:s,input:i,context:Z0},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update",this),this.__previous={input:J0(i),state:J0(s),context:J0(Z0)},this.input=i;this.metrics.log(),typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render",this)})}setContext(J,Z){this.lips.setContext(J,Z)}setInput(J){if(!H0(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(J)}subInput(J){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(q5(this.input,J)),this}setMacros(J){const Z=h1(J),W=n.default(Z);if(!W.length)return;const z=this;W.each(function(){const q=n.default(this),{argv:Y,attrs:G}=z.__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(z.__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.");z.__macros.set(G.literals.name,{argv:Y,$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 u0(this.__name__,Z)}get node(){if(!this.$)throw new Error("node() is expected to be call after component get rendered");return this.$}render(J,Z,W={},z,q){const Y=z||new Map,G=[];if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:Y};this.metrics.startRender();const X=this;let M=n.default();function U(K){const O=j(K);return X.__pathCounter++,X.__path?`${X.__path}/${O}`:`${J?J+"/":"#"}${O}`}function j(K){return(K==="component"?"c":"")+X.__pathCounter}function $(K){return K!==null&&typeof K==="object"&&typeof K.mesh==="function"&&typeof K.update==="function"}function g(K){return K!==null&&typeof K==="object"&&typeof K.default&&typeof K.default==="string"}function _(K){if(!K.attr(":dtag")||K.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const O=K.attr(":dtag"),w=X.__evaluate__(O,W);if($(w)||w===null)return i(K,O,w);else if(g(w))return s(K,{template:w});else return s(K,{name:w})}function u(K){const O=K.attr(":args"),w=U("log");if(!O)return;if(X.__evaluate__(`console.log(${O})`,W),X.__isReactive__(O,W))X.__extractExpressionDeps__(O,W).forEach((L)=>X.__trackDep__(Y,L,{$fragment:null,path:w,update:(C)=>X.__evaluate__(`console.log(${O})`,C),memo:W,batch:!0}))}function p(K){const O=U("var"),{attrs:w}=X.__getAttributes__(K);if(!w)return;Object.entries(w.literals).forEach(([S,L])=>{if(W[S]&&W[S].type==="const")throw new Error(`Cannot override <const ${S}=[value]/> variable`);W[S]={value:L,type:"let"}}),Object.entries(w.expressions).forEach(([S,L])=>{if(t.test(S)){const C=(P,x)=>{const f=X.__evaluate__(S.replace(t,""),x||W);if(typeof f!=="object")throw new Error(`Invalid spread operator ${S}`);for(let V in f){if(W[V]&&W[V].type==="const")throw new Error(`Cannot override <const ${V}=[value]/> variable`);if(W[V]={value:f[V],type:"let"},x)x[V]=W[V],X.__updateVarDepNodes__(V,O,x)}if(P)return{memo:x}};X.__extractExpressionDeps__(S,W).forEach((P)=>X.__trackDep__(Y,P,{$fragment:null,path:`${O}.${S}`,update:(x)=>C(!0,x),memo:W,batch:!0})),C()}else if(L){if(X.__isReactive__(L,W)){const C=X.__extractExpressionDeps__(L,W),m=(P,x)=>{if(W[S]&&W[S].type==="const")throw new Error(`Cannot override <const ${S}=[value]/> variable`);return P[S]=W[S]={value:X.__evaluate__(L,P),type:"let"},X.__updateVarDepNodes__(S,O,P),{memo:P}};C.forEach((P)=>X.__trackDep__(Y,P,{$fragment:null,path:`${O}.${S}`,update:m,memo:W,batch:!0}))}if(W[S]&&W[S].type==="const")throw new Error(`Cannot override <const ${S}=[value]/> variable`);W[S]={value:X.__evaluate__(L,W),type:"let"}}}),X.metrics.inc("elementCount")}function a(K){const{attrs:O}=X.__getAttributes__(K);if(!O)return;Object.entries(O.literals).forEach(([w,S])=>{if(W[w]&&W[w].type==="const")throw new Error(`<const ${w}=[value]/> variable already defined`);if(!S)return;W[w]={value:S,type:"const"}}),Object.entries(O.expressions).forEach(([w,S])=>{if(t.test(w)){const L=X.__evaluate__(w.replace(t,""),W);if(typeof L!=="object")throw new Error(`Invalid spread operator ${w}`);for(let C in L){if(W[C]&&W[C].type==="const")throw new Error(`<const ${C}=[value]/> by spread operator ${w}. [${C}] variable already defined`);W[C]={value:L[C],type:"const"}}}else{if(W[w]&&W[w].type==="const")throw new Error(`<const ${w}=[value]/> variable already defined`);if(!S)return;W[w]={value:X.__evaluate__(S,W),type:"const"}}}),X.metrics.inc("elementCount")}function i(K,O,w){const{attrs:S}=X.__getAttributes__(K),L=U("element"),C=X.__getBoundaries__(L);let m=n.default(C.start),P={},x=w;if(x){S.literals&&Object.entries(S.literals).forEach(([V,E])=>P[V]={type:"arg",value:E}),S.expressions&&Object.entries(S.expressions).forEach(([V,E])=>{if(!x)return;if(t.test(V)){const T=X.__evaluate__(V.replace(t,""),W);if(typeof T!=="object")throw new Error(`Invalid spread operator ${V}`);for(let N in T){if(N!=="#"&&!x.argv.includes(N))continue;P[N]={type:"arg",value:T[N]}}}else{if(V!=="#"&&!x.argv.includes(V))return;P[V]={type:"arg",value:E?X.__evaluate__(E,W):!0}}});const f=x.mesh(P);if(f&&f.length)m=m.add(f);S.expressions&&Object.entries(S.expressions).forEach(([V,E])=>{if(!x)return;if(t.test(V)&&X.__isReactive__(V,W)){const T=X.__extractExpressionDeps__(V,W),N=(F,A)=>{if(!x)return;const b={},c=X.__evaluate__(V.replace(t,""),F);if(typeof c!=="object")throw new Error(`Invalid spread operator ${V}`);const l=[];for(let o in c){if(o!=="#"&&!x.argv.includes(o))continue;P[o]=b[o]={type:"arg",value:c[o]},(!F[o]||!E0(c[o],F[o].value))&&l.push(o)}l.length&&x.update(l,b,C)};T.forEach((F)=>X.__trackDep__(Y,F,{$fragment:null,boundaries:C,path:`${L}.${V}`,update:N,memo:W,batch:!0}))}else if((V==="#"||x.argv.includes(V))&&X.__isReactive__(E,W)){const T=X.__extractExpressionDeps__(E,W),N=(F,A)=>{if(!x)return;const b=P[V]={type:"arg",value:E?X.__evaluate__(E,F):!0};x.update([V],{[V]:b},C)};T.forEach((F)=>X.__trackDep__(Y,F,{$fragment:null,boundaries:C,path:`${L}.${V}`,update:N,memo:W,batch:!0}))}})}if(X.__isReactive__(O,W)){const f=(E,T)=>{const N=X.__evaluate__(O,E);let F;if(g(N))F=s(K,{template:N});else if($(N))P="#"in P?{...E,...P["#"].value}:{...E,...P},x=N,F=x?x.mesh(P):null;if(!document.contains(C.start)||!document.contains(C.end))throw new Error("Dynamic element boundaries not found");const A=[];let b=C.start.nextSibling;while(b&&b!==C.end)A.push(b),b=b.nextSibling;n.default(A).remove(),F&&n.default(C.start).after(F)};X.__extractExpressionDeps__(O,W).forEach((E)=>X.__trackDep__(Y,E,{$fragment:null,boundaries:C,path:L,update:f,batch:!0,memo:{...W,...P}}))}return m=m.add(C.end),m}function s(K,O){let w,S;if(O?.template)w=O.template,S=j("component");else{if(S=O?.name||K.prop("tagName")?.toLowerCase(),!S)throw new Error("Invalid component");if(S===X.__name__)throw new Error("Render component within itself is forbidden");w=X.lips.import(S)}if(!w||!S)throw new Error(`<${S}> template not found`);const L=U("component"),C=X.__getBoundaries__(L),{argv:m,attrs:P,events:x}=X.__getAttributes__(K),f={};let V={},E=n.default(C.start),T=X.PCC.get(L);P.literals&&Object.entries(P.literals).forEach(([F,A])=>{if(F=="key")return;V[F]=A}),P.functions&&Object.entries(P.functions).forEach(([F,A])=>{V[F]=X.__evaluateFunction__(A,[],W),w.declaration?.syntax?f[I0+O0+F]=A:f[O0+F]=A}),P.expressions&&Object.entries(P.expressions).forEach(([F,A])=>{if(F=="key")return;if(t.test(F)){const b=X.__evaluate__(F.replace(t,""),W);if(typeof b!=="object")throw new Error(`Invalid spread operator ${F}`);for(let c in b)V[c]=b[c]}else V[F]=A?X.__evaluate__(A,W):!0;w.declaration?.syntax?f[I0+F]=A:f[F]=A});const N=K.contents();if(N.length){if(V={...V,...X.__meshwire__({$node:K,fragmentPath:L,fragmentBoundaries:C,meshPath:null,argv:m,scope:W,xmlns:q,useAttributes:!0,declaration:w.declaration},f)},w.declaration){if(w.declaration.tags)Object.entries(w.declaration?.tags).forEach(([F,{type:A,many:b}])=>{switch(A){case"nexted":{let c=K.next(F);if(!c.length)return;if(b){V[F]=[];let l=0,o=!1;while(!o){if(V[F].push(X.__meshwire__({$node:c,meshPath:`${F}[${l}]`,fragmentPath:L,fragmentBoundaries:C,argv:m,scope:W,xmlns:q,useAttributes:!0,declaration:w.declaration},f)),!c.next(F).length){o=!0;break}c=c.next(F),l++}}else V[F]=X.__meshwire__({$node:c,meshPath:F,fragmentPath:L,fragmentBoundaries:C,argv:m,scope:W,xmlns:q,useAttributes:!0,declaration:w.declaration},f)}break;case"child":{const c=K.children(F);if(b)V[F]=[],c.each(function(l){const o=n.default(this),{argv:D0}=X.__getAttributes__(o);V[F].push(X.__meshwire__({$node:o,meshPath:`${F}[${l}]`,fragmentPath:L,fragmentBoundaries:C,argv:D0,scope:W,xmlns:q,useAttributes:!0,declaration:w.declaration},f))});else if(K.children(F).first().length){const l=K.children(F).first(),{argv:o}=X.__getAttributes__(l);V[F]=X.__meshwire__({$node:l,meshPath:F,fragmentPath:L,fragmentBoundaries:C,argv:o,scope:W,xmlns:q,useAttributes:!0,declaration:w.declaration},f)}}break}});else if(w.declaration.contents)V.__contents__=N}}if(T)T.setInput(J0(V)),E=E.add(T.node);else{const{declaration:F,state:A,_static:b,handler:c,context:l,default:o,stylesheet:D0}=w;T=new s0(S,o||"",{state:J0(A),input:J0(V),context:l,_static:J0(b),handler:c,stylesheet:D0,declaration:F},{debug:X.debug,lips:X.lips,prepath:L}),E=E.add(T.node),X.PCC.set(L,T),Object.entries(x).forEach(([e,r])=>!!T&&X.__attachEvent__(T,e,r,W)),f&&Object.entries(f).forEach(([e,r])=>{let z0=!1,d0=!1;if(e.startsWith(I0))z0=!0,e=e.replace(I0,"");if(e.startsWith(O0))d0=!0,e=e.replace(O0,"");if(t.test(e)){const R0=(N0)=>{const K0={},x0=X.__evaluate__(e.replace(t,""),N0);if(typeof x0!=="object")throw new Error(`Invalid spread operator ${e}`);for(let T0 in x0)K0[T0]=x0[T0];T?.subInput(K0)};if(X.__isReactive__(e,W))X.__extractExpressionDeps__(r,W).forEach((K0)=>X.__trackDep__(Y,K0,{$fragment:null,boundaries:C,path:`${L}.${e}`,update:R0,syntax:z0,memo:W,batch:!0}))}else{const R0=(N0)=>{const K0=d0?X.__evaluateFunction__(r,[],N0):r?X.__evaluate__(r,N0):!0;T?.subInput({[e]:K0})};if(X.__isReactive__(r,W))X.__extractExpressionDeps__(r,W).forEach((K0)=>X.__trackDep__(Y,K0,{$fragment:null,boundaries:C,path:`${L}.${e}`,update:R0,syntax:z0,memo:W,batch:!0}))}}),E=E.add(C.end)}return X.metrics.inc("componentCount"),E}function Z0(K){const O=K.prop("tagName")?.toLowerCase();if(!O)throw new Error("Invalid macro rendering call");const w=X.__macros.get(O);if(!w)throw new Error("Macro component not found");const S=U("macro"),L=X.__getBoundaries__(S),{attrs:C}=X.__getAttributes__(K),m={};let P={},x={},f=n.default(L.start);if(C.literals&&Object.entries(C.literals).forEach(([N,F])=>P[N]={value:F,type:"arg"}),C.expressions&&Object.entries(C.expressions).forEach(([N,F])=>{if(t.test(N)){const A=X.__evaluate__(N.replace(t,""),W);if(typeof A!=="object")throw new Error(`Invalid spread operator ${N}`);for(let b in A)if(x[b]=A[b],w.argv.includes(b))P[b]={value:A[b],type:"arg"};m[N]=F}else{const A=F?X.__evaluate__(F,W):!0;if(x[N]=A,w.argv.includes(N))P[N]={value:A,type:"arg"};if(w.argv.includes(N))m[N]=F}w.argv.forEach((A)=>{if(P[A]!==void 0)return;P[A]={value:!1,type:"arg"}})}),w.argv.includes("__"))P.__={value:x,type:"arg"};const V={$node:w.$node,meshPath:null,fragmentPath:S,fragmentBoundaries:L,argv:w.argv,scope:W,xmlns:q,useAttributes:!0},E=X.__meshwire__(V,m),T=E.renderer.mesh(P);return f=f.add(T),m&&Object.entries(m).forEach(([N,F])=>{let A=!1;if(new RegExp(`^${I0}`).test(N))A=!0,N=N.replace(I0,"");if(t.test(N)){if(!X.__isReactive__(N,W))return;const b=X.__extractExpressionDeps__(N,W),c=(l)=>{const o={},D0=X.__evaluate__(N.replace(t,""),l);if(typeof D0!=="object")throw new Error(`Invalid spread operator ${N}`);const e=[];for(let r in D0)o[r]={value:D0[r],type:"arg"},(!l[r]||!E0(D0[r],l[r].value))&&e.push(r);return e.length&&E.renderer.update(e,o),{memo:{...l,...o}}};b.forEach((l)=>X.__trackDep__(Y,l,{$fragment:null,boundaries:L,path:`${S}.${N}`,update:c,syntax:A,memo:{...W,...P},batch:!0}))}else if(X.__isReactive__(F,W)){const b=X.__extractExpressionDeps__(F,W),c=(l)=>{const o=l[N]={value:F?X.__evaluate__(F,l):!0,type:"arg"};return E.renderer.update([N],{[N]:o}),{memo:l}};b.forEach((l)=>X.__trackDep__(Y,l,{$fragment:null,boundaries:L,path:`${S}.${N}`,update:c,syntax:A,memo:{...W,...P},batch:!0}))}}),f=f.add(L.end),X.metrics.inc("elementCount"),f}function d(K){if(!K.length||!K.prop("tagName"))return K;const O=K.is("svg")||q,w=O?n.default(document.createElementNS("http://www.w3.org/2000/svg",K.prop("tagName").toLowerCase())):n.default(`<${K.prop("tagName").toLowerCase()}/>`),S=K.contents(),L=U("element");S.length&&w.append(X.__withPath__(L,()=>X.render(L+".n",S,W,Y,O).$log));const{attrs:C,events:m}=X.__getAttributes__(K);C.literals&&Object.entries(C.literals).forEach(([x,f])=>{if(x===$0)return;const V=K.is(`[${$0}]`)&&["title","placeholder"].includes(x);w.attr(x,V?X.lips.i18n.translate(f).text:f);const E=(T)=>{w.attr(x,V?X.lips.i18n.translate(f).text:f),V&&X.__trackTranslationDep__({path:L,$fragment:w,update:E,memo:T})};V&&X.__trackTranslationDep__({path:L,$fragment:w,update:E,memo:W})});const P=(x,f=!1)=>{x&&Object.entries(x).forEach(([V,E])=>{switch(V){case"@html":{const T=(N)=>{w.html(X.__evaluate__(E,N))};if(T(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((F)=>X.__trackDep__(Y,F,{$fragment:w,path:`${L}.${V}`,update:T,memo:W,batch:!0}))}break;case"@text":{const T=K.is(`[${$0}]`),N=(F)=>{w.text(X.__evaluate__(E,F,T)),T&&X.__trackTranslationDep__({path:L,$fragment:w,update:N,memo:F})};if(N(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((A)=>X.__trackDep__(Y,A,{$fragment:w,path:`${L}.${V}`,update:N,memo:W,batch:!0}));T&&X.__trackTranslationDep__({path:L,$fragment:w,update:N,memo:W})}break;case"@format":{const[T,N]=E.split(",").map((A)=>A.trim());if(!T)throw new Error("Invalid @format reference");if(!N)throw new Error("Invalid @format parameters");const F=(A)=>{const b=X.__evaluate__(`!${N.trim()}`,A);if(typeof b!=="object")throw new Error("Invalid @format parameters");const c=X.lips.i18n.format(T,b);c!==void 0&&w.text(c),X.__trackTranslationDep__({path:L,$fragment:w,update:F,memo:A})};F(W),X.__extractExpressionDeps__(N,W).forEach((A)=>X.__trackDep__(Y,A,{$fragment:w,path:`${L}.${V}`,update:F,memo:W,batch:!0}))}break;case"style":{const T=(N)=>{const F=X.__evaluate__(E,N);if(typeof F==="object"){let A="";Object.entries(F).forEach(([b,c])=>A+=`${b}:${c};`),A.length&&w.attr("style",A)}else w.attr("style",F)};if(T(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((F)=>X.__trackDep__(Y,F,{$fragment:w,path:`${L}.${V}`,update:T,memo:W,batch:!0}))}break;default:{const T=K.is(`[${$0}]`)&&["title","placeholder"].includes(V),N=(F)=>{const A=E?X.__evaluate__(E,F,T):E!==void 0?E:!0;if(A===void 0||A===!1)w.removeAttr(V);else w.attr(V,A),T&&X.__trackTranslationDep__({path:L,$fragment:w,update:N,memo:F})};if(N(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((A)=>X.__trackDep__(Y,A,{$fragment:w,path:`${L}.${V}`,update:N,memo:W,batch:!0}));T&&X.__trackTranslationDep__({path:L,$fragment:w,update:N,memo:W})}}})};return C.expressions&&Object.keys(C.expressions).forEach((x)=>{if(!t.test(x))return;const f=(V)=>{const E={},T=X.__evaluate__(x.replace(t,""),V);if(typeof T!=="object")throw new Error(`Invalid spread operator ${x}`);for(let N in T)E[N]=T[N];P(E)};if(delete C.expressions[x],f(W),x&&X.__isReactive__(x,W))X.__extractExpressionDeps__(x,W).forEach((E)=>X.__trackDep__(Y,E,{$fragment:w,path:`${L}.${x}`,update:f,memo:W,batch:!0}))}),P(C.expressions,!0),m&&Object.entries(m).forEach(([x,f])=>{G.push({_event:x,$fragment:w,instruction:f,scope:W})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),w}function y(K){const O=K.text(),w=U("element"),S=K.parent().is(`[${$0}]`),L=n.default(document.createTextNode(X.__interpolate__(O,W,S))),C=(m)=>{const P=X.__interpolate__(O,m,S);if(!L[0])return;L[0].textContent=P,S&&X.__trackTranslationDep__({path:w,$fragment:L,update:C,memo:m||W})};if(O&&X.__isReactive__(O,W)){const m=X.__extractTextDeps__(O,W);m.forEach((P)=>X.__trackDep__(Y,P,{path:w,$fragment:L,update:C,memo:W,batch:m.length>1}))}return S&&X.__trackTranslationDep__({path:w,$fragment:L,update:C,memo:W}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),L}function k(K){if(K.get(0)?.nodeType===Node.COMMENT_NODE)return K;if(K.get(0)?.nodeType===Node.TEXT_NODE)return y(K);if(K.is("let"))return p(K);else if(K.is("const"))return a(K);else if(K.is("lips")&&K.attr(":dtag"))return _(K);else if(K.is("log"))return u(K);else if(X.__macros.has(K.prop("tagName")?.toLowerCase()))return Z0(K);else if(K.is("if, for, switch, async")||X.lips.has(K.prop("tagName")?.toLowerCase()))return s(K);else if(K.is("else-if, else"))return;return d(K)}try{this.__renderDepth++,Z=Z||n.default(this.__template__),Z.each(function(){const K=k(n.default(this));if(K)M=M.add(K)}),G.forEach(({$fragment:K,_event:O,instruction:w,scope:S})=>{this.__attachEvent__(K,O,w,S)}),X.metrics.inc("renderCount")}catch(K){console.error("Rendering Failed --",K),X.metrics.trackError(K)}finally{if(this.__renderDepth--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:M,dependencies:Y,events:G}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(({element:J,_event:Z})=>this.__detachEvent__(J,Z)),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.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Z)=>{n.default(Z).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy",this)}__meshwire__(J,Z){const W=this,{$node:z,meshPath:q,fragmentPath:Y,fragmentBoundaries:G,argv:X,scope:M,xmlns:U,declaration:j,useAttributes:$}=J;let g,_=[],u=!1;const p=[],a=(d,y,k)=>{const K=`${Y}.${q||"r"}${k!==void 0?`[${k}]`:""}`,{$log:O,dependencies:w,events:S}=W.render(K,d,{...M,...y},void 0,U);if(p.push(K),w?.forEach((L,C)=>{if(!W.FGUD?.has(C))W.FGUD.set(C,new Map);L.forEach((m,P)=>{m.partial?.length?m.partial.push(K):m.partial=[K],W.FGUD.get(C)?.set(P,m)})}),W.metrics.inc("partialCount"),k!==void 0){const L=W.__getBoundaries__(K);_[k]={argvalues:y,boundaries:L};let C=n.default(L.start);return C=C.add(O),C=C.add(L.end),C}return O},i=(d,y,k)=>{if(W.metrics.startRender(),d.forEach((K)=>{const O=W.FGUD.get(K);if(!O)return;O.forEach((w)=>{const S=p.find((L)=>w.partial?.find((C)=>L==C));if(!w.partial||!S)return;if(k!==void 0&&!S.endsWith(`r[${k}]`))return;if(G?.start&&!document.contains(G.start)){console.warn(`${q} -- partial boundaries missing in the DOM`),O.delete(w.path);return}if(w.memo?.[K]&&y?.[K]&&E0(w.memo[K],y[K]))return;if(w.memo={...M,...w.memo,...y},w.batch)W.UQS.queue({dep:K,dependent:w});else{const L=w.update(w.memo,"mesh-partial-updator");if(L)typeof L.memo==="object"&&O.set(w.path,{...w,memo:L.memo}),typeof L.cleanup==="function"&&L.cleanup()}W.metrics.inc("dependencyUpdateCount")}),!O.size&&W.FGUD.delete(K)}),k!==void 0&&_[k])_[k].argvalues=y;W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},s=(d)=>{if(!_[d])return;const y=_[d].boundaries;if(_.splice(d,1),!document.contains(y.start)||!document.contains(y.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const k=[];let K=y.start.nextSibling;while(K&&K!==y.end)k.push(K),K=K.nextSibling;n.default(k).remove(),y.start.remove(),y.end.remove()},Z0={renderer:{path:q,argv:X,mesh(d,y=!1){if(g=z.contents(),!g?.length)return null;if(j?.iterator){const k=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!k.length)return null;let K=n.default();return k.forEach((O,w)=>{if(!g?.length)return null;K=K.add(a(g,O,w))}),K}else return a(g,d)},update(d,y,k){if(!p.length||u)return;u=!0;try{if(k=k||G,j?.iterator){const K=y?.["#"].value;if(!Array.isArray(K))return;if(Array.isArray(_)){if(_.length===K.length){for(let w=0;w<K.length;w++)!E0(_[w].argvalues,K[w])&&i(Object.keys(K[w]),K[w],w);return}const O=Math.min(_.length,K.length);for(let w=0;w<O;w++)i(Object.keys(K[w]),K[w],w);if(K.length>_.length){if(!g?.length)return;for(let w=_.length;w<K.length;w++){const S=a(g,K[w],w);n.default(k.end).before(S)}}else if(K.length<_.length)for(let w=_.length-1;w>=K.length;w--)s(w)}}else i(d,y)}finally{setTimeout(()=>u=!1,0)}}}};if($&&q){const{attrs:d}=W.__getAttributes__(z);d.literals&&Object.entries(d.literals).forEach(([y,k])=>Z0[y]=k),d.expressions&&Object.entries(d.expressions).forEach(([y,k])=>{if(t.test(y)){const K=W.__evaluate__(y.replace(t,""),M);if(typeof K!=="object")throw new Error(`Invalid spread operator ${y}`);for(let O in K)Z0[O]=K[O];Z[`${j?.syntax?I0:""}${q}.${y}`]=k}else Z0[y]=k?W.__evaluate__(k,M):!0,Z[`${j?.syntax?I0:""}${q}.${y}`]=k})}return Z0}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${this.prepath}.${J}`),end:document.createComment(`e:${this.prepath}.${J}`)}}__getAttributes__(J){const Z=J.attrs(),W={},z={literals:{},functions:{},expressions:{}};let q=[];return Z&&Object.entries(Z).forEach(([Y,G])=>{if(Y==":dtag")return;if(Y.startsWith(":")||Y.startsWith(O0)||Y.startsWith(b0)||t.test(Y)||X1.test(Y))if(X1.test(Y)){const[X,M]=Y.match(X1)||[];q=M.split(",")}else if(Y.startsWith(b0))W[Y.replace(b0,"")]=G;else if(Y.startsWith(O0))z.functions[Y.replace(O0,"")]=G;else{if(Y.startsWith(":"))Y=Y.slice(1,Y.length);z.expressions[Y]=G||""}else z.literals[Y]=G}),{argv:q,events:W,attrs:z}}__withPath__(J,Z){const W=this.__path;this.__path=J;const z=Z();return this.__path=W,z}__getPathParent__(J){const Z=J.split("/");return Z.pop(),Z.join("/")}__hasSamePathParent__(J,Z){return J.startsWith(Z)}__evaluate__(J,Z,W){try{J=J.trim();const z=(q)=>{const Y=this.state.toJSON();if(Z){const G={};for(let U in Z)G[U]=Z[U].value;const X=`with( scope ){ return ${q}; }`;return new Function("self","input","state","static","context","scope",X)(this,this.input,Y,this.static,this.context,G||{})}else{const G=`return ${q}`;return new Function("self","input","state","static","context",G)(this,this.input,Y,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return z(J.slice(1));return J.replace(_1,(q,Y)=>z(Y))}return z(J)}catch(z){return J}}__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[z,...q]=J.split(/\s*,\s*/),Y;if(z=this.__evaluate__(z,W),typeof z==="function")Y=z;else{if(typeof this[z]!=="function")throw new Error(`Undefined <${z}> handler method`);Y=this[z].bind(this)}if(typeof Y!=="function")throw new Error(`Expected <${z}> to be a function or handler method`);let G=q.map((X)=>this.__evaluate__(X,W));if(Z.length)G=[...G,...Z];return Y(...G)}}__interpolate__(J,Z,W){if(J=J.replace(_1,(z,q)=>this.__evaluate__(q,Z)),W)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J,Z,W,z){J.on(Z,(...q)=>this.__evaluateFunction__(W,q,z)),this.VER.push({element:J,_event:Z}),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount")}__detachEvent__(J,Z){J.off(Z),this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const W=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const Y=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(Y,Z).forEach((X)=>W.add(X))}),Array.from(W)}__extractExpressionDeps__(J,Z){const W=/\b(state|input|context)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,z=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g;let q=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(z))];if(Z&&Object.keys(Z).length){const Y=new RegExp(`\\b(${Object.keys(Z).join("|")})`,"g");q=[...q,...Array.from(J.matchAll(Y))]}return[...new Set(q.map((Y)=>Y[0]))]}__isReactive__(J,Z){if(/(state|input|context|self)\.[\w.]+/.test(J))return!0;if(Z&&Object.keys(Z).length&&new RegExp(Object.keys(Z).join("|")).test(J))return!0;return!1}__trackDep__(J,Z,W){if(W.memo&&W.memo[Z]&&W.memo[Z].type==="let")W.haslet=!0;!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(W.path,W),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J){this.__i18nDeps.set(J.path,J),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Z){return Z.reduce((W,z)=>W?.[z],J)}__shouldUpdate__(J,Z,W,z){if(J==="self")return!0;const q=this.__valueDep__(z[J],Z),Y=this.__valueDep__(W[J],Z);return!E0(q,Y)}__updateDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((W,z)=>{const[q,...Y]=z.split(".");if(!this.__shouldUpdate__(q,Y,J,Z))return;W.forEach((G)=>{const{path:X,batch:M,$fragment:U,boundaries:j,update:$,memo:g,syntax:_}=G;try{if(!_&&(j?.start&&!document.contains(j.start))||U!==null&&!U.closest("body").length){W.delete(X);return}if(M)this.UQS.queue({dep:z,dependent:G});else{const u=$(g,"main-updator");if(u)typeof u.memo==="object"&&W.set(X,{...G,memo:u.memo}),typeof u.cleanup==="function"&&u.cleanup()}this.metrics.inc("dependencyUpdateCount")}catch(u){console.error("failed to update dependency nodes --",u);return}}),!W.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((q,Y)=>{if(!q.haslet||!this.__hasSamePathParent__(Y,this.__getPathParent__(Z)))return;if(q.memo={...q.memo,...W},q.batch)this.UQS.queue({dep:J,dependent:q});else{const G=q.update(q.memo,"var-partial-updator");typeof G?.cleanup==="function"&&G.cleanup()}}),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}J.update(J.memo,"i18n-partial-updator")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?n.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?n.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?n.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var k1={};i0(k1,{state:()=>{{return F6}},handler:()=>{{return I6}},default:()=>{{return L6}},declaration:()=>{{return j6}}});var j6={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},F6={renderer:null},I6={onInput(){if(!this.input.renderer)return;if(this.input.by)this.state.renderer=this.input.renderer;else{let J=!1;if(Array.isArray(this.input["else-if"])&&this.input["else-if"].length)this.input["else-if"].forEach((Z)=>{if(J||!Z.by)return;this.state.renderer=Z.renderer,J=!0});if(!J)this.state.renderer=this.input.else?this.input.else.renderer:null}}},L6="<{state.renderer}/>";var f1={};i0(f1,{state:()=>{{return C6}},handler:()=>{{return S6}},default:()=>{{return P6}},declaration:()=>{{return V6}},_static:()=>{{return N6}}});var V6={name:"for",syntax:!0,iterator:!0},C6={argvlist:null},N6={lastIn:null,processingBatch:!1},S6={onInput(){if(this.static.processingBatch)return;if(!this.input.renderer)throw new Error("Undefined mesh renderer");let{in:J,from:Z,to:W}=this.input;if(J===void 0&&Z===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(Z!==void 0){if(Z=parseFloat(String(Z)),W==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");if(W=parseFloat(String(W)),Z===W)throw new Error("<from> and <to> attribute cannot have the same value");const z=Z<W,q=Math.abs(W-Z)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q){const[G]=this.input.renderer.argv;if(G){let X=Z,M=!0;for(let U=0;U<this.state.argvlist.length;U++){if(this.state.argvlist[U][G].value!==X){M=!1;break}X=z?X+1:X-1}if(M)return;X=Z;for(let U=0;U<this.state.argvlist.length;U++)this.state.argvlist[U][G].value=X,X=z?X+1:X-1;return}}const Y=[];for(let G=Z;z?G<=W:G>=W;z?G++:G--){const X={},[M]=this.input.renderer.argv;if(M)X[M]={value:G,type:"arg"};Y.push(X)}this.state.argvlist=Y}else if(Array.isArray(J)){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!J.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update");this.state.argvlist=[];return}if(this.static.lastIn=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.length){const[Y,G]=this.input.renderer.argv;for(let X=0;X<J.length;X++){const M=this.state.argvlist[X];if(Y)M[Y].value=J[X]}return}const z=[];let q=0;for(let Y of J){const G={},[X,M]=this.input.renderer.argv;if(X)G[X]={value:Y,type:"arg"};if(M)G[M]={value:q,type:"arg"};z.push(G),q++}this.state.argvlist=z}else if(J instanceof Map){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!J.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update");this.state.argvlist=[];return}if(this.static.lastIn=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.size){const[Y,G,X]=this.input.renderer.argv;let M=0;for(let[U,j]of J){const $=this.state.argvlist[M];if(Y)$[Y].value=U;if(G)$[G].value=j;M++}return}const z=[];let q=0;for(let[Y,G]of J){const X={},[M,U,j]=this.input.renderer.argv;if(M)X[M]={value:Y,type:"arg"};if(U)X[U]={value:G,type:"arg"};if(j)X[j]={value:q,type:"arg"};z.push(X),q++}this.state.argvlist=z}else if(typeof J=="object"){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!Object.keys(J).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update");this.state.argvlist=[];return}this.static.lastIn=J;const z=Object.keys(J);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===z.length){const[G,X,M]=this.input.renderer.argv;for(let U=0;U<z.length;U++){const j=z[U],$=this.state.argvlist[U];if(G)$[G].value=j;if(X)$[X].value=J[j]}return}const q=[];let Y=0;for(let G in J){const X={},[M,U,j]=this.input.renderer.argv;if(M)X[M]={value:G,type:"arg"};if(U)X[U]={value:J[G],type:"arg"};if(j)X[j]={value:Y,type:"arg"};q.push(X),Y++}this.state.argvlist=q}}finally{this.static.processingBatch=!1}},updateItems(J){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!Array.isArray(J)||!this.state.argvlist)return;this.static.processingBatch=!0;try{const[Z]=this.input.renderer?.argv;if(!Z)return;for(let{index:W,value:z}of J)if(W>=0&&W<this.state.argvlist.length)this.state.argvlist[W][Z].value=z}finally{this.static.processingBatch=!1}},updateProperty(J,Z){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!this.state.argvlist)return;this.static.processingBatch=!0;try{for(let W=0;W<this.state.argvlist.length;W++){const z=this.state.argvlist[W];if(z[J])z[J].value=typeof Z==="function"?Z(z[J].value,W):Z}}finally{this.static.processingBatch=!1}}},P6="<{input.renderer} #=state.argvlist/>";var y1={};i0(y1,{state:()=>{{return $6}},handler:()=>{{return R6}},default:()=>{{return T6}},declaration:()=>{{return E6}}});var E6={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},$6={renderer:null,props:{}},R6={onInput(){if(!this.input.await)throw new Error("Undefined async <await> attribute");if(!(this.input.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(this.input.loading)this.state.renderer=this.input.loading.renderer,this.state.props={};this.input.await.then((J)=>{if(!this.input.then)return;this.state.renderer=this.input.then.renderer;const[Z]=this.input.then.renderer.argv;this.state.props={[Z]:{value:J,type:"arg"}}}).catch((J)=>{if(!this.input.catch)return;this.state.renderer=this.input.catch.renderer;const[Z]=this.input.then.renderer.argv;this.state.props={[Z]:{value:J,type:"arg"}}})}},T6="<{state.renderer} #=state.props/>";var v1={};i0(v1,{state:()=>{{return b6}},handler:()=>{{return _6}},default:()=>{{return x6}},declaration:()=>{{return A6}}});var A6={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},b6={renderer:null},_6={onInput(){let J=[];for(let Z of this.input.case)if(Z.is==this.input.by||Array.isArray(Z.is)&&Z.is.includes(this.input.by))Array.isArray(Z.is)?J=[...new Set([...J,...Z.is])]:J.push(Z.is),this.state.renderer=Z.renderer;if(!J.includes(this.input.by))this.state.renderer=this.input.default?this.input.default.renderer:null}},x6="<{state.renderer}/>";var u1={};i0(u1,{state:()=>{{return g6}},handler:()=>{{return y6}},default:()=>{{return v6}},context:()=>{{return k6}},_static:()=>{{return h6}}});var f6=function(J){const Z={};return J.split("&").map((z)=>{const[q,Y]=z.split("=");Z[q]=Y}),Z},g6={page:null,params:{},query:{}},h6={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},k6=["navigate"],y6={onInput(){if(!this.input.routes)return;if(this.input.global)this.static.global=this.input.global;if(this.static.routes=this.input.routes.map(({path:J,template:Z,default:W})=>{if(W)this.static.defaultPath=J;const z=J.match(/:[^\/]*(\/|$)/gi)||[],q=J.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:J,template:Z,default:W,pathVars:z,pathRegex:new RegExp(`${q}\$`,"i")}}),this.input.global){const J=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&J=="/"&&J!==this.static.defaultPath?this.static.defaultPath:J?J+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 z=W[1]?f6(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:z}});const Y=this.match(J);if(!Y){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:G,params:X}=Y;this.emit("after",{fromState:q,toState:{path:G.path,params:X,query:z}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=X,this.state.query=z,this.state.page=G.template},match(J){const Z={};let W=!1;for(let z of this.static.routes){const{pathVars:q,pathRegex:Y}=z,G=J.match(Y);if(G!==null&&G.index===0){for(let X=0;X+1<G.length&&X<q.length;X++)Z[q[X].replaceAll(/[\/:]/g,"")]=G[X+1];W=z;break}}return W?{route:W,params:Z}:!1}},v6="<{state.page} params=state.params query=state.query/>";class m0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new t0;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new J1,this.IUC=new e0;const[Z,W]=_0(this.i18n.lang),[z,q]=_0(J?.context||{});this.__setLang=W,this.__getLang=Z,this.__setContext=q,this.__getContext=z,this.register("if",k1),this.register("for",f1),this.register("async",y1),this.register("switch",v1),this.register("router",u1)}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:z,...q}=Z,Y={debug:this.debug,prepath:"0",lips:this},G=new s0(J,z||"",{...q,input:W},Y);return window.addEventListener("beforeunload",()=>{return this.dispose(),G.destroy(),null}),window.addEventListener("pagehide",(X)=>{!X.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 u0("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 z={...W,[J]:Z};H0(W,z)&&this.__setContext(z)}else if(!Array.isArray(J)){const z={...W,...J};H0(W,z)&&this.__setContext(z)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;o0(()=>{const W=this.__getContext();if(!W)return;const z=Object.fromEntries(J.map((q)=>[q,W[q]]));z&&typeof Z==="function"&&Object.keys(z).length&&Z(z)})}useTranslator(J,Z){o0(()=>{const W=this.__getLang();if(!W)return;(J==="*"||Array.isArray(J)&&J.includes(W))&&typeof Z==="function"&&Z(W)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}function u6(J="body"){const Z={counter:0,counterHistory:[],updateFrequency:16,isRunning:!1,metrics:{fps:0,avgRenderTime:0,totalUpdates:0,memoryUsageMB:0,domOperations:0}},W={updateInterval:null,frameCountInterval:null,frameCount:0,lastFrameTimestamp:0,updateTimes:[]},z={onCreate(){console.log("Stress test component created")},onMount(){console.log("Stress test component mounted"),this.startPerformanceTracking()},onRender(){const M=performance.now();if(this.static.lastFrameTimestamp){const U=M-this.static.lastFrameTimestamp;if(U<1000){if(this.static.updateTimes.push(U),this.static.updateTimes.length>100)this.static.updateTimes.shift()}}this.static.lastFrameTimestamp=M,this.static.frameCount++},startPerformanceTracking(){this.static.frameCountInterval=setInterval(()=>{if(this.state.metrics.fps=this.static.frameCount,this.static.frameCount=0,this.static.updateTimes.length){const M=this.static.updateTimes.reduce((U,j)=>U+j,0)/this.static.updateTimes.length;this.state.metrics.avgRenderTime=M}if(window.performance&&window.performance.memory)this.state.metrics.memoryUsageMB=window.performance.memory.usedJSHeapSize/1048576},1000)},startStressTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.counterHistory=[],this.static.updateInterval=setInterval(()=>{if(this.state.counter++,this.state.metrics.totalUpdates++,this.state.counterHistory.length>100)this.state.counterHistory.shift();this.state.counterHistory.push(this.state.counter)},this.state.updateFrequency)},stopStressTest(){if(!this.state.isRunning)return;clearInterval(this.static.updateInterval),this.state.isRunning=!1},setUpdateFrequency(M){const U=parseFloat(M.target.value);if(this.state.updateFrequency=U,this.state.isRunning)this.stopStressTest(),this.startStressTest()},resetCounter(){this.state.counter=0,this.state.counterHistory=[],this.state.metrics.totalUpdates=0},runHeavyComputation(){const M=performance.now();let U=0;for(let j=0;j<1e7;j++)U+=Math.sqrt(j);console.log(`Heavy computation completed in ${performance.now()-M}ms, result: ${U}`)},destroy(){clearInterval(this.static.updateInterval),clearInterval(this.static.frameCountInterval)}},X=new m0({debug:!0}).render("StressTestApp",{default:`
2
2
  <div class="stress-test-container">
3
3
  <h2>Lips Framework Stress Test</h2>
4
4
 
@@ -473,4 +473,4 @@ var X6=Object.create;var{defineProperty:T1,getPrototypeOf:H6,getOwnPropertyNames
473
473
  }
474
474
  `,document.head.appendChild(W),document.querySelector(J)?.appendChild(Z),u6("#stress-test"),m6("#high-frequency-test",3000),A5("#dom-stress-test"),{container:Z}}A5();export{m6 as runHighFrequencyTest,A5 as runDOMStressTest,d8 as runAllStressTests,u6 as createLipsStressTest};
475
475
 
476
- //# debugId=7050923BB725C0D464756e2164756e21
476
+ //# debugId=0F538BC849DAEF1E64756e2164756e21