@lipsjs/lips 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -4
- package/dist/lips.min.js +2 -2
- package/dist/lips.min.js.map +12 -13
- package/dist/test.component.min.js +28 -2
- package/dist/test.component.min.js.map +16 -14
- package/dist/test.stress.min.js +11 -11
- package/dist/test.stress.min.js.map +13 -14
- package/dist/types/component.d.ts +6 -4
- package/dist/types/i18n.d.ts +1 -2
- package/dist/types/index.d.ts +4 -2
- package/dist/types/lips.d.ts +7 -4
- package/dist/types/metrics.d.ts +48 -0
- package/dist/types/utils.d.ts +16 -0
- package/package.json +3 -3
package/dist/test.stress.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var J8=Object.create;var{defineProperty:T1,getPrototypeOf:Q8,getOwnPropertyNames:W8}=Object;var X8=Object.prototype.hasOwnProperty;var l0=(Z,J,W)=>{W=Z!=null?J8(Q8(Z)):{};const z=J||!Z||!Z.__esModule?T1(W,"default",{value:Z,enumerable:!0}):W;for(let q of W8(Z))if(!X8.call(z,q))T1(z,q,{get:()=>Z[q],enumerable:!0});return z};var H8=(Z,J)=>()=>(J||Z((J={exports:{}}).exports,J),J.exports);var u0=(Z,J)=>{for(var W in J)T1(Z,W,{get:J[W],enumerable:!0,configurable:!0,set:(z)=>J[W]=()=>z})};var d0=H8((a1,e1)=>{(function(){var Z=document,J=window,W=Z.documentElement,z=Z.createElement.bind(Z),q=z("div"),B=z("table"),G=z("tbody"),X=z("tr"),U=Array.isArray,K=Array.prototype,F=K.concat,N=K.filter,_=K.indexOf,A=K.map,u=K.push,i=K.slice,e=K.some,r=K.splice,c=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,f=/<.+>/,y=/^\w+$/;function $(Q,H){var Y=o(H);return!Q||!Y&&!R(H)&&!S(H)?[]:!Y&&d.test(Q)?H.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!Y&&y.test(Q)?H.getElementsByTagName(Q):H.querySelectorAll(Q)}var M=function(){function Q(H,Y){if(!H)return;if(L(H))return H;var D=H;if(E(H)){var I=Y||Z;if(D=c.test(H)&&R(I)?I.getElementById(H.slice(1).replace(/\\/g,"")):f.test(H)?v1(H):L(I)?I.find(H):E(I)?O(I).find(H):$(H,I),!D)return}else if(V(H))return this.ready(H);if(D.nodeType||D===J)D=[D];this.length=D.length;for(var C=0,g=this.length;C<g;C++)this[C]=D[C]}return Q.prototype.init=function(H,Y){return new Q(H,Y)},Q}(),w=M.prototype,O=w.init;if(O.fn=O.prototype=w,w.length=0,w.splice=r,typeof Symbol==="function")w[Symbol.iterator]=K[Symbol.iterator];function L(Q){return Q instanceof M}function P(Q){return!!Q&&Q===Q.window}function R(Q){return!!Q&&Q.nodeType===9}function o(Q){return!!Q&&Q.nodeType===11}function S(Q){return!!Q&&Q.nodeType===1}function h(Q){return!!Q&&Q.nodeType===3}function v(Q){return typeof Q==="boolean"}function V(Q){return typeof Q==="function"}function E(Q){return typeof Q==="string"}function x(Q){return Q===void 0}function T(Q){return Q===null}function j(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function k(Q){if(typeof Q!=="object"||Q===null)return!1;var H=Object.getPrototypeOf(Q);return H===null||H===Object.prototype}O.isWindow=P,O.isFunction=V,O.isArray=U,O.isNumeric=j,O.isPlainObject=k;function b(Q,H,Y){if(Y){var D=Q.length;while(D--)if(H.call(Q[D],D,Q[D])===!1)return Q}else if(k(Q)){var I=Object.keys(Q);for(var D=0,C=I.length;D<C;D++){var g=I[D];if(H.call(Q[g],g,Q[g])===!1)return Q}}else for(var D=0,C=Q.length;D<C;D++)if(H.call(Q[D],D,Q[D])===!1)return Q;return Q}O.each=b,w.each=function(Q){return b(this,Q)},w.empty=function(){return this.each(function(Q,H){while(H.firstChild)H.removeChild(H.firstChild)})};function s(){var Q=[];for(var H=0;H<arguments.length;H++)Q[H]=arguments[H];var Y=v(Q[0])?Q.shift():!1,D=Q.shift(),I=Q.length;if(!D)return{};if(!I)return s(Y,O,D);for(var C=0;C<I;C++){var g=Q[C];for(var m in g)if(Y&&(U(g[m])||k(g[m]))){if(!D[m]||D[m].constructor!==g[m].constructor)D[m]=new g[m].constructor;s(Y,D[m],g[m])}else D[m]=g[m]}return D}O.extend=s,w.extend=function(Q){return s(w,Q)};var l=/\S+/g;function p(Q){return E(Q)?Q.match(l)||[]:[]}w.toggleClass=function(Q,H){var Y=p(Q),D=!x(H);return this.each(function(I,C){if(!S(C))return;b(Y,function(g,m){if(D)H?C.classList.add(m):C.classList.remove(m);else C.classList.toggle(m)})})},w.addClass=function(Q){return this.toggleClass(Q,!0)},w.removeAttr=function(Q){var H=p(Q);return this.each(function(Y,D){if(!S(D))return;b(H,function(I,C){D.removeAttribute(C)})})};function D0(Q,H){if(!Q)return;if(E(Q)){if(arguments.length<2){if(!this[0]||!S(this[0]))return;var Y=this[0].getAttribute(Q);return T(Y)?void 0:Y}if(x(H))return this;if(T(H))return this.removeAttr(Q);return this.each(function(I,C){if(!S(C))return;C.setAttribute(Q,H)})}for(var D in Q)this.attr(D,Q[D]);return this}w.attr=D0,w.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},w.hasClass=function(Q){return!!Q&&e.call(this,function(H){return S(H)&&H.classList.contains(Q)})},w.get=function(Q){if(x(Q))return i.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},w.eq=function(Q){return O(this.get(Q))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)};function Z0(Q){if(x(Q))return this.get().map(function(H){return S(H)||h(H)?H.textContent:""}).join("");return this.each(function(H,Y){if(!S(Y))return;Y.textContent=Q})}w.text=Z0;function n(Q,H,Y){if(!S(Q))return;var D=J.getComputedStyle(Q,null);return Y?D.getPropertyValue(H)||void 0:D[H]||Q.style[H]}function z0(Q,H){return parseInt(n(Q,H),10)||0}function m0(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 C0(Q){if(R0[Q])return R0[Q];var H=z(Q);Z.body.insertBefore(H,null);var Y=n(H,"display");return Z.body.removeChild(H),R0[Q]=Y!=="none"?Y:"block"}function K0(Q){return n(Q,"display")==="none"}function x0(Q,H){var Y=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!Y&&!!H&&Y.call(Q,H)}function T0(Q){return E(Q)?function(H,Y){return x0(Y,Q)}:V(Q)?Q:L(Q)?function(H,Y){return Q.is(Y)}:!Q?function(){return!1}:function(H,Y){return Y===Q}}w.filter=function(Q){var H=T0(Q);return O(N.call(this,function(Y,D){return H.call(Y,D,Y)}))};function P0(Q,H){return!H?Q:Q.filter(H)}w.detach=function(Q){return P0(this,Q).each(function(H,Y){if(Y.parentNode)Y.parentNode.removeChild(Y)}),this};var T5=/^\s*<(\w+)[^>]*>/,$5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,y1={"*":q,tr:G,td:X,th:X,thead:B,tbody:B,tfoot:B};function v1(Q){if(!E(Q))return[];if($5.test(Q))return[z(RegExp.$1)];var H=T5.test(Q)&&RegExp.$1,Y=y1[H]||y1["*"];return Y.innerHTML=Q,O(Y.childNodes).detach().get()}O.parseHTML=v1,w.has=function(Q){var H=E(Q)?function(Y,D){return $(Q,D).length}:function(Y,D){return D.contains(Q)};return this.filter(H)},w.not=function(Q){var H=T0(Q);return this.filter(function(Y,D){return(!E(Q)||S(D))&&!H.call(D,Y,D)})};function j0(Q,H,Y,D){var I=[],C=V(H),g=D&&T0(D);for(var m=0,U0=Q.length;m<U0;m++)if(C){var W0=H(Q[m]);if(W0.length)u.apply(I,W0)}else{var q0=Q[m][H];while(q0!=null){if(D&&g(-1,q0))break;I.push(q0),q0=Y?q0[H]:null}}return I}function m1(Q){if(Q.multiple&&Q.options)return j0(N.call(Q.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return Q.value||""}function A5(Q){if(!arguments.length)return this[0]&&m1(this[0]);return this.each(function(H,Y){var D=Y.multiple&&Y.options;if(D||t1.test(Y.type)){var I=U(Q)?A.call(Q,String):T(Q)?[]:[String(Q)];if(D)b(Y.options,function(C,g){g.selected=I.indexOf(g.value)>=0},!0);else Y.checked=I.indexOf(Y.value)>=0}else Y.value=x(Q)||T(Q)?"":Q})}w.val=A5,w.is=function(Q){var H=T0(Q);return e.call(this,function(Y,D){return H.call(Y,D,Y)})},O.guid=1;function F0(Q){return Q.length>1?N.call(Q,function(H,Y,D){return _.call(D,H)===Y}):Q}O.unique=F0,w.add=function(Q,H){return O(F0(this.get().concat(O(Q,H).get())))},w.children=function(Q){return P0(O(F0(j0(this,function(H){return H.children}))),Q)},w.parent=function(Q){return P0(O(F0(j0(this,"parentNode"))),Q)},w.index=function(Q){var H=Q?O(Q)[0]:this[0],Y=Q?this:O(H).parent().children();return _.call(Y,H)},w.closest=function(Q){var H=this.filter(Q);if(H.length)return H;var Y=this.parent();if(!Y.length)return H;return Y.closest(Q)},w.siblings=function(Q){return P0(O(F0(j0(this,function(H){return O(H).parent().children().not(H)}))),Q)},w.find=function(Q){return O(F0(j0(this,function(H){return $(Q,H)})))};var x5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,_5=/^$|^module$|\/(java|ecma)script/i,b5=["type","src","nonce","noModule"];function h5(Q,H){var Y=O(Q);Y.filter("script").add(Y.find("script")).each(function(D,I){if(_5.test(I.type)&&W.contains(I)){var C=z("script");C.text=I.textContent.replace(x5,""),b(b5,function(g,m){if(I[m])C[m]=I[m]}),H.head.insertBefore(C,null),H.head.removeChild(C)}})}function g5(Q,H,Y,D,I){if(D)Q.insertBefore(H,Y?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(H,Q);else Q.parentNode.insertBefore(H,Y?Q:Q.nextSibling);if(I)h5(H,Q.ownerDocument)}function S0(Q,H,Y,D,I,C,g,m){return b(Q,function(U0,W0){b(O(W0),function(q0,$0){b(O(H),function(M0,s0){var P1=Y?$0:s0,S1=Y?s0:$0,B0=Y?q0:M0;g5(P1,!B0?S1:S1.cloneNode(!0),D,I,!B0)},m)},g)},C),H}w.after=function(){return S0(arguments,this,!1,!1,!1,!0,!0)},w.append=function(){return S0(arguments,this,!1,!1,!0)};function k5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if(x(Q))return this;var H=/<script[\s>]/.test(Q);return this.each(function(Y,D){if(!S(D))return;if(H)O(D).empty().append(Q);else D.innerHTML=Q})}w.html=k5,w.appendTo=function(Q){return S0(arguments,this,!0,!1,!0)},w.wrapInner=function(Q){return this.each(function(H,Y){var D=O(Y),I=D.contents();I.length?I.wrapAll(Q):D.append(Q)})},w.before=function(){return S0(arguments,this,!1,!0)},w.wrapAll=function(Q){var H=O(Q),Y=H[0];while(Y.children.length)Y=Y.firstElementChild;return this.first().before(H),this.appendTo(Y)},w.wrap=function(Q){return this.each(function(H,Y){var D=O(Q)[0];O(Y).wrapAll(!H?D:D.cloneNode(!0))})},w.insertAfter=function(Q){return S0(arguments,this,!0,!1,!1,!1,!1,!0)},w.insertBefore=function(Q){return S0(arguments,this,!0,!0)},w.prepend=function(){return S0(arguments,this,!1,!0,!0,!0,!0)},w.prependTo=function(Q){return S0(arguments,this,!0,!0,!0,!1,!1,!0)},w.contents=function(){return O(F0(j0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},w.next=function(Q,H,Y){return P0(O(F0(j0(this,"nextElementSibling",H,Y))),Q)},w.nextAll=function(Q){return this.next(Q,!0)},w.nextUntil=function(Q,H){return this.next(H,!0,Q)},w.parents=function(Q,H){return P0(O(F0(j0(this,"parentElement",!0,H))),Q)},w.parentsUntil=function(Q,H){return this.parents(H,Q)},w.prev=function(Q,H,Y){return P0(O(F0(j0(this,"previousElementSibling",H,Y))),Q)},w.prevAll=function(Q){return this.prev(Q,!0)},w.prevUntil=function(Q,H){return this.prev(H,!0,Q)},w.map=function(Q){return O(F.apply([],A.call(this,function(H,Y){return Q.call(H,Y,H)})))},w.clone=function(){return this.map(function(Q,H){return H.cloneNode(!0)})},w.offsetParent=function(){return this.map(function(Q,H){var Y=H.offsetParent;while(Y&&n(Y,"position")==="static")Y=Y.offsetParent;return Y||W})},w.slice=function(Q,H){return O(i.call(this,Q,H))};var f5=/-([a-z])/g;function F1(Q){return Q.replace(f5,function(H,Y){return Y.toUpperCase()})}w.ready=function(Q){var H=function(){return setTimeout(Q,0,O)};if(Z.readyState!=="loading")H();else Z.addEventListener("DOMContentLoaded",H);return this},w.unwrap=function(){return this.parent().each(function(Q,H){if(H.tagName==="BODY")return;var Y=O(H);Y.replaceWith(Y.children())}),this},w.offset=function(){var Q=this[0];if(!Q)return;var H=Q.getBoundingClientRect();return{top:H.top+J.pageYOffset,left:H.left+J.pageXOffset}},w.position=function(){var Q=this[0];if(!Q)return;var H=n(Q,"position")==="fixed",Y=H?Q.getBoundingClientRect():this.offset();if(!H){var D=Q.ownerDocument,I=Q.offsetParent||D.documentElement;while((I===D.body||I===D.documentElement)&&n(I,"position")==="static")I=I.parentNode;if(I!==Q&&S(I)){var C=O(I).offset();Y.top-=C.top+z0(I,"borderTopWidth"),Y.left-=C.left+z0(I,"borderLeftWidth")}}return{top:Y.top-z0(Q,"marginTop"),left:Y.left-z0(Q,"marginLeft")}};var u1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};w.prop=function(Q,H){if(!Q)return;if(E(Q)){if(Q=u1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(D,I){I[Q]=H})}for(var Y in Q)this.prop(Y,Q[Y]);return this},w.removeProp=function(Q){return this.each(function(H,Y){delete Y[u1[Q]||Q]})};var y5=/^--/;function j1(Q){return y5.test(Q)}var I1={},v5=q.style,m5=["webkit","moz","ms"];function u5(Q,H){if(H===void 0)H=j1(Q);if(H)return Q;if(!I1[Q]){var Y=F1(Q),D="".concat(Y[0].toUpperCase()).concat(Y.slice(1)),I="".concat(Y," ").concat(m5.join("".concat(D," "))).concat(D).split(" ");b(I,function(C,g){if(g in v5)return I1[Q]=g,!1})}return I1[Q]}var d5={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 d1(Q,H,Y){if(Y===void 0)Y=j1(Q);return!Y&&!d5[Q]&&j(H)?"".concat(H,"px"):H}function i5(Q,H){if(E(Q)){var Y=j1(Q);if(Q=u5(Q,Y),arguments.length<2)return this[0]&&n(this[0],Q,Y);if(!Q)return this;return H=d1(Q,H,Y),this.each(function(I,C){if(!S(C))return;if(Y)C.style.setProperty(Q,H);else C.style[Q]=H})}for(var D in Q)this.css(D,Q[D]);return this}w.css=i5;function i1(Q,H){try{return Q(H)}catch(Y){return H}}var c5=/^\s+|\s+$/;function c1(Q,H){var Y=Q.dataset[H]||Q.dataset[F1(H)];if(c5.test(Y))return Y;return i1(JSON.parse,Y)}function p5(Q,H,Y){Y=i1(JSON.stringify,Y),Q.dataset[F1(H)]=Y}function o5(Q,H){if(!Q){if(!this[0])return;var Y={};for(var D in this[0].dataset)Y[D]=c1(this[0],D);return Y}if(E(Q)){if(arguments.length<2)return this[0]&&c1(this[0],Q);if(x(H))return this;return this.each(function(I,C){p5(C,Q,H)})}for(var D in Q)this.data(D,Q[D]);return this}w.data=o5;function p1(Q,H){var Y=Q.documentElement;return Math.max(Q.body["scroll".concat(H)],Y["scroll".concat(H)],Q.body["offset".concat(H)],Y["offset".concat(H)],Y["client".concat(H)])}b([!0,!1],function(Q,H){b(["Width","Height"],function(Y,D){var I="".concat(H?"outer":"inner").concat(D);w[I]=function(C){if(!this[0])return;if(P(this[0]))return H?this[0]["inner".concat(D)]:this[0].document.documentElement["client".concat(D)];if(R(this[0]))return p1(this[0],D);return this[0]["".concat(H?"offset":"client").concat(D)]+(C&&H?z0(this[0],"margin".concat(Y?"Top":"Left"))+z0(this[0],"margin".concat(Y?"Bottom":"Right")):0)}})}),b(["Width","Height"],function(Q,H){var Y=H.toLowerCase();w[Y]=function(D){if(!this[0])return x(D)?void 0:this;if(!arguments.length){if(P(this[0]))return this[0].document.documentElement["client".concat(H)];if(R(this[0]))return p1(this[0],H);return this[0].getBoundingClientRect()[Y]-m0(this[0],!Q)}var I=parseInt(D,10);return this.each(function(C,g){if(!S(g))return;var m=n(g,"boxSizing");g.style[Y]=d1(Y,I+(m==="border-box"?m0(g,!Q):0))})}});var o1="___cd";w.toggle=function(Q){return this.each(function(H,Y){if(!S(Y))return;var D=K0(Y),I=x(Q)?D:Q;if(I){if(Y.style.display=Y[o1]||"",K0(Y))Y.style.display=C0(Y.tagName)}else if(!D)Y[o1]=n(Y,"display"),Y.style.display="none"})},w.hide=function(){return this.toggle(!1)},w.show=function(){return this.toggle(!0)};var s1="___ce",L1=".",V1={focus:"focusin",blur:"focusout"},l1={mouseenter:"mouseover",mouseleave:"mouseout"},s5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function N1(Q){return l1[Q]||V1[Q]||Q}function C1(Q){var H=Q.split(L1);return[H[0],H.slice(1).sort()]}w.trigger=function(Q,H){if(E(Q)){var Y=C1(Q),D=Y[0],I=Y[1],C=N1(D);if(!C)return this;var g=s5.test(C)?"MouseEvents":"HTMLEvents";Q=Z.createEvent(g),Q.initEvent(C,!0,!0),Q.namespace=I.join(L1),Q.___ot=D}Q.___td=H;var m=Q.___ot in V1;return this.each(function(U0,W0){if(m&&V(W0[Q.___ot]))W0["___i".concat(Q.type)]=!0,W0[Q.___ot](),W0["___i".concat(Q.type)]=!1;W0.dispatchEvent(Q)})};function r1(Q){return Q[s1]=Q[s1]||{}}function l5(Q,H,Y,D,I){var C=r1(Q);C[H]=C[H]||[],C[H].push([Y,D,I]),Q.addEventListener(H,I)}function n1(Q,H){return!H||!e.call(H,function(Y){return Q.indexOf(Y)<0})}function o0(Q,H,Y,D,I){var C=r1(Q);if(!H)for(H in C)o0(Q,H,Y,D,I);else if(C[H])C[H]=C[H].filter(function(g){var m=g[0],U0=g[1],W0=g[2];if(I&&W0.guid!==I.guid||!n1(m,Y)||D&&D!==U0)return!0;Q.removeEventListener(H,W0)})}w.off=function(Q,H,Y){var D=this;if(x(Q))this.each(function(C,g){if(!S(g)&&!R(g)&&!P(g))return;o0(g)});else if(!E(Q))for(var I in Q)this.off(I,Q[I]);else{if(V(H))Y=H,H="";b(p(Q),function(C,g){var m=C1(g),U0=m[0],W0=m[1],q0=N1(U0);D.each(function($0,M0){if(!S(M0)&&!R(M0)&&!P(M0))return;o0(M0,q0,W0,H,Y)})})}return this},w.remove=function(Q){return P0(this,Q).detach().off(),this},w.replaceWith=function(Q){return this.before(Q).remove()},w.replaceAll=function(Q){return O(Q).replaceWith(this),this};function r5(Q,H,Y,D,I){var C=this;if(!E(Q)){for(var g in Q)this.on(g,H,Y,Q[g],I);return this}if(!E(H))if(x(H)||T(H))H="";else if(x(Y))Y=H,H="";else D=Y,Y=H,H="";if(!V(D))D=Y,Y=void 0;if(!D)return this;return b(p(Q),function(m,U0){var W0=C1(U0),q0=W0[0],$0=W0[1],M0=N1(q0),s0=q0 in l1,P1=q0 in V1;if(!M0)return;C.each(function(S1,B0){if(!S(B0)&&!R(B0)&&!P(B0))return;var E1=function(X0){if(X0.target["___i".concat(X0.type)])return X0.stopImmediatePropagation();if(X0.namespace&&!n1($0,X0.namespace.split(L1)))return;if(!H&&(P1&&(X0.target!==B0||X0.___ot===M0)||s0&&X0.relatedTarget&&B0.contains(X0.relatedTarget)))return;var R1=B0;if(H){var _0=X0.target;while(!x0(_0,H)){if(_0===B0)return;if(_0=_0.parentNode,!_0)return}R1=_0}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 Y}});var Z8=D.call(R1,X0,X0.___td);if(I)o0(B0,M0,$0,H,E1);if(Z8===!1)X0.preventDefault(),X0.stopPropagation()};E1.guid=D.guid=D.guid||O.guid++,l5(B0,M0,$0,H,E1)})}),this}w.on=r5;function n5(Q,H,Y,D){return this.on(Q,H,Y,D,!0)}w.one=n5;var t5=/\r?\n/g;function a5(Q,H){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(H.replace(t5,"\r\n")))}var e5=/file|reset|submit|button|image/i,t1=/radio|checkbox/i;if(w.serialize=function(){var Q="";return this.each(function(H,Y){b(Y.elements||[Y],function(D,I){if(I.disabled||!I.name||I.tagName==="FIELDSET"||e5.test(I.type)||t1.test(I.type)&&!I.checked)return;var C=m1(I);if(!x(C)){var g=U(C)?C:[C];b(g,function(m,U0){Q+=a5(I.name,U0)})}})}),Q.slice(1)},typeof a1!=="undefined")e1.exports=O;else J.cash=J.$=O})()});var Z5=l0(d0(),1);class r0{default=window.navigator.language;LANGUAGE_DICTIONARIES={};setLang(Z){if(this.default!==Z)return this.default=Z,!0;return!1}setDictionary(Z,J){this.LANGUAGE_DICTIONARIES[Z]=J}translate(Z,J){if(J&&this.default==J)return{text:Z,lang:this.default};J=J||this.default;const[W,z]=J.split("-");if(this.LANGUAGE_DICTIONARIES[W]&&Z in this.LANGUAGE_DICTIONARIES[W]){if(typeof this.LANGUAGE_DICTIONARIES[W][Z]==="object"){const q=this.LANGUAGE_DICTIONARIES[W][Z];Z=q[z||"*"]||q["*"]}else if(typeof this.LANGUAGE_DICTIONARIES[W][Z]==="string")Z=this.LANGUAGE_DICTIONARIES[W][Z]}return{text:Z,lang:J}}propagate(Z){const J=this;function W(){const z=Z5.default(this),q=z.html(),B=z.attr("title"),G=z.attr("placeholder");let X;if(!/<\//.test(q)&&z.text()){const{text:U,lang:K}=J.translate(z.text());z.text(U),X=K}if(B){const{text:U,lang:K}=J.translate(B);z.attr("title",U),X=K}if(G){const{text:U,lang:K}=J.translate(G);z.attr("placeholder",U),X=K}X&&z.attr("lang",X)}return Z.children().each(W),Z}}class n0{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(Z,J){this.callbacks.set(Z,J)}unregister(Z){this.callbacks.delete(Z)}queue(Z){if(!this.callbacks.has(Z))return;if(this.pendingComponents.add(Z),!this.isPending)this.isPending=!0,this.schedule()}schedule(){Promise.resolve().then(()=>this.process())}process(){const Z=Array.from(this.pendingComponents);this.pendingComponents.clear(),this.isPending=!1,Z.forEach((J)=>{try{const W=this.callbacks.get(J);if(W)W()}catch(W){console.error(`Error updating component ${J}:`,W)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class t0{subscriptions=new Map;tick=new n0;register(Z,J){this.subscriptions.set(Z,J),this.tick.register(Z,J)}unregister(Z){this.subscriptions.delete(Z),this.tick.unregister(Z)}queueUpdate(Z){this.tick.queue(Z)}dispose(){this.subscriptions.clear(),this.tick.dispose()}prepareForPotentialUnload(){this.tick.clear(),this.subscriptions.forEach((Z,J)=>{this.subscriptions.set(J,()=>{})})}proxyState(Z,J){const W=this,z=new WeakMap,q=(G)=>{if(G instanceof Map)G.forEach((U,K)=>G.set(K,B(U)));else if(Array.isArray(G))G.forEach((U,K)=>G[K]=B(U));else if(typeof G==="object")Object.entries(G).forEach(([U,K])=>G[U]=B(K));let X=new Proxy(G,{get(U,K){if(K==="toJSON")return function(){const N=(_)=>{if(!_||typeof _!=="object")return _;if(z.has(_)){const A=z.get(_);if(A instanceof Map){const i={};return A.forEach((e,r)=>i[typeof r==="object"?JSON.stringify(r):String(r)]=N(e)),i}if(Array.isArray(A))return A.map((i)=>N(i));const u={};return Object.entries(A).forEach(([i,e])=>u[i]=N(e)),u}if(typeof _.toJSON==="function"&&!z.has(_))return _.toJSON();return _};return N(X)};if(K==="reset")return function(){X=null};const F=U[K];if(G instanceof Map&&typeof F==="function")return function(...N){const _=K.toString();if(_==="set"&&N.length>=2)N[1]=B(N[1]);const A=F.apply(U,N);return["set","delete","clear"].includes(_)&&W.queueUpdate(Z),A};if(Array.isArray(G)&&typeof F==="function")return function(...N){const _=K.toString();if(["push","unshift"].includes(_))N=N.map((u)=>B(u));else if(_==="splice"&&N.length>2)N=[N[0],N[1],...N.slice(2).map((u)=>B(u))];const A=F.apply(U,N);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(_)&&W.queueUpdate(Z),A};return F},set(U,K,F){if(U[K]===F)return!0;if(F instanceof Map&&U[K]instanceof Map){const N=U[K];return N.clear(),F.forEach((_,A)=>N.set(A,B(_))),W.queueUpdate(Z),!0}return U[K]=B(F),W.queueUpdate(Z),!0}});return z.set(X,G),X},B=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(J)}}class a0{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((Z,J)=>{try{const W=J.node;if(!W){this.unwatch(J);return}if(Z.type==="attach"&&document.contains(W[0]))this.unwatch(J),J.emit("component:attached",J),typeof J.onAttach=="function"&&J.onAttach.bind(J)();else if(Z.type==="detach"&&!document.contains(W[0]))this.unwatch(J),J.emit("component:detached",J),typeof J.onDetach=="function"&&J.onDetach.bind(J)()}catch(W){console.log("DWS error --",W)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(Z,J="attach"){const W=Z.node;if(!W)return;if(J==="attach"&&document.contains(W[0])){Z.emit("component:attached",Z),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();return}if(J==="detach"&&!document.contains(W[0])){Z.emit("component:detached",Z),typeof Z.onDetach=="function"&&Z.onDetach.bind(Z)();return}this.unwatch(Z);const z=setTimeout(()=>{this.unwatch(Z),Z.emit(`component:${J}ment-timeout`,Z)},this.TIMEOUT);this.observedComponents.set(Z,{timeout:z,type:J}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),J==="attach"&&Z.once("component:attached",()=>this.watch(Z,"detach"))}unwatch(Z){const J=this.observedComponents.get(Z);if(J)clearTimeout(J.timeout),this.observedComponents.delete(Z);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((Z)=>clearTimeout(Z.timeout)),this.observedComponents.clear()}}class e0{pending=new Set;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(Z){this.component=Z}queue(Z){if(this.pending.add(Z),this.component.benchmark.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const Z=Array.from(this.pending);if(this.metrics.batchCount++,this.metrics.lastBatchSize=Z.length,this.metrics.updatesProcessed+=Z.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),this.pending.clear(),this.component.benchmark.trackBatch(Z.length),this.applyUpdates(Z),this.isPending=!1,this.pending.size>0)this.isPending=!0,this.scheduleProcessing()}applyUpdates(Z){Z.forEach(({dep:J,dependent:W})=>{try{const z=W.update(W.memo,"batch-updator");if(z)typeof z.memo==="object"&&this.component.FGUD.get(J)?.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 Z1{options={emit:!0};__events={};__once_events={};constructor(Z){if(Z)this.options=Z}on(Z,J){if(!Array.isArray(this.__events[Z]))this.__events[Z]=[];return this.__events[Z].push(J),this}once(Z,J){if(!Array.isArray(this.__once_events[Z]))this.__once_events[Z]=[];return this.__once_events[Z].push(J),this}off(Z){return delete this.__events[Z],delete this.__once_events[Z],this}emit(Z,...J){if(!this.options.emit)return;const W=J.map((z)=>typeof z.toJSON==="function"?z.toJSON():z);this.__events[Z]?.forEach((z)=>z(...W)),this.__once_events[Z]?.forEach((z)=>z(...W)),delete this.__once_events[Z]}}var t=l0(d0(),1);var $1=l0(d0(),1);function H0(Z,J){if(Z===J)return!1;if(typeof Z!=="object"||typeof J!=="object")return!1;if(Z===null||J===null)return!0;if(Z instanceof Set){if(!(J instanceof Set))return!0;if(Z.size!==J.size)return!0;if(J5(Z)&&J5(J)){for(let G of Z)if(!J.has(G))return!0;return!1}const B=new WeakMap;for(let G of Z){let X=!1;if(typeof G!=="object"){if(J.has(G))X=!0}else for(let U of J){if(typeof U!=="object")continue;if(!B.has(G))B.set(G,new WeakMap);const K=B.get(G);if(K.has(U)){if(X=K.get(U),X)break;continue}const F=!H0(G,U);if(K.set(U,F),F){X=!0;break}}if(!X)return!0}return!1}if(Z instanceof Map){if(!(J instanceof Map))return!0;if(Z.size!==J.size)return!0;if(Q5(Z)&&Q5(J)){for(let[G,X]of Z)if(J.get(G)!==X)return!0;return!1}const B=new WeakMap;for(let[G,X]of Z){if(typeof G!=="object"){if(!J.has(G))return!0;const F=J.get(G);if(typeof X!=="object"){if(X!==F)return!0;continue}if(typeof F!=="object"||H0(X,F))return!0;continue}let U=!1,K=!1;for(let[F,N]of J){if(typeof F!=="object")continue;if(!B.has(G))B.set(G,new WeakMap);const _=B.get(G);if(_.has(F)){const[A,u]=_.get(F);if(A){U=!0,K=u;break}continue}if(!H0(G,F)){if(U=!0,K=typeof X==="object"&&typeof N==="object"?!H0(X,N):X===N,_.set(F,[!0,K]),K)break}else _.set(F,[!1,!1])}if(!U||!K)return!0}return!1}if(Array.isArray(Z)){if(!Array.isArray(J))return!0;if(Z.length!==J.length)return!0;for(let B=0;B<Z.length;B++){const G=Z[B],X=J[B];if(G!==X&&(typeof G!=="object"||H0(G,X)))return!0}return!1}const W=Object.keys(Z),z=Object.keys(J);if(W.length!==z.length)return!0;W.sort(),z.sort();const q=W.length;for(let B=0;B<q;B++)if(W[B]!==z[B])return!0;for(let B=0;B<q;B++){const G=W[B],X=Z[G],U=J[G];if(X===U)continue;if(X instanceof Date){if(!(U instanceof Date)||String(X)!==String(U))return!0;continue}if(X instanceof RegExp){if(!(U instanceof RegExp)||X.source!==U.source||X.flags!==U.flags)return!0;continue}if(X instanceof Map){if(!(U instanceof Map)||H0(X,U))return!0;continue}if(X instanceof Set){if(!(U instanceof Set)||H0(X,U))return!0;continue}if(X instanceof Function){if(!(U instanceof Function))return!0;continue}if(typeof X==="object"){if(typeof U!=="object")return!0;if(X===Z){if(U!==J)return!0}else if(H0(X,U))return!0}else return!0}return!1}function E0(Z,J){if(Z===J)return!0;if(Z==null||J==null)return Z===J;const W=typeof Z;if(W!==typeof J)return!1;if(W!=="object"){if(W==="number"&&isNaN(Z)&&isNaN(J))return!0;return!1}if(Z instanceof Date)return J instanceof Date&&Z.getTime()===J.getTime();if(Z instanceof RegExp)return J instanceof RegExp&&Z.source===J.source&&Z.flags===J.flags;if(Z instanceof Error)return J instanceof Error&&Z.name===J.name&&Z.message===J.message&&(Z.stack===J.stack||!Z.stack&&!J.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(Z)){if(!ArrayBuffer.isView(J))return!1;if(Z.byteLength!==J.byteLength)return!1;const X=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),U=new Uint8Array(J.buffer,J.byteOffset,J.byteLength);for(let K=0;K<X.length;K++)if(X[K]!==U[K])return!1;return!0}if(Z instanceof Promise||Z instanceof WeakMap||Z instanceof WeakSet)return Z===J;if(typeof Z==="function"){if(typeof J!=="function")return!1;return Z.toString()===J.toString()&&Z.name===J.name}if(Z.constructor!==J.constructor)return!1;if(Z instanceof Map||Z instanceof Set||Array.isArray(Z)||Object.getPrototypeOf(Z)===Object.prototype)return!H0(Z,J);const q=Object.getPrototypeOf(Z);if(q!==Object.getPrototypeOf(J))return!1;const B=Object.getOwnPropertyNames(Z),G=Object.getOwnPropertyNames(J);if(B.length!==G.length)return!1;for(let X of B){if(!Object.prototype.hasOwnProperty.call(J,X))return!1;if(!E0(Z[X],J[X]))return!1}if(q!==null&&q!==Object.prototype){const X=Object.getOwnPropertyNames(q),U=Object.getOwnPropertyNames(Object.getPrototypeOf(J));if(X.length!==U.length)return!1;for(let K of X){if(K==="constructor")continue;if(!E0(q[K],Object.getPrototypeOf(J)[K]))return!1}}return!0}var J5=function(Z){for(let J of Z)if(typeof J==="object"&&J!==null)return!1;return!0},Q5=function(Z){for(let[J,W]of Z)if(typeof J==="object"&&J!==null||typeof W==="object"&&W!==null)return!1;return!0};function J0(Z,J=new WeakMap){if(Z===null||typeof Z!=="object"||Z instanceof Promise)return Z;if(J.has(Z))return J.get(Z);if(Z instanceof Date)return new Date(Z.getTime());if(Z instanceof RegExp)return new RegExp(Z.source,Z.flags);if(Z instanceof Map){const q=new Map;return J.set(Z,q),Z.forEach((B,G)=>q.set(J0(G,J),J0(B,J))),q}if(Z instanceof Set){const q=new Set;return J.set(Z,q),Z.forEach((B)=>q.add(J0(B,J))),q}if(Array.isArray(Z)){const q=[];J.set(Z,q);for(let B=0;B<Z.length;B++)q[B]=J0(Z[B],J);return q}if(ArrayBuffer.isView(Z))return new Z.constructor(Z);const W=Object.create(Object.getPrototypeOf(Z));J.set(Z,W);const z=Object.getOwnPropertySymbols(Z);for(let q of z)W[q]=J0(Z[q],J);for(let q in Z)if(Object.prototype.hasOwnProperty.call(Z,q))W[q]=J0(Z[q],J);return W}function X5(Z,J){if(!Z||typeof Z!=="object")throw new TypeError("Original argument must be an object");if(!J||typeof J!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(J).length)return{...Z};function W(q,B,G){const X=B.split(/\.|\[|\]/).filter(Boolean);let U=q;for(let K=0;K<X.length;K++){const F=X[K],N=!isNaN(Number(F)),_=K===X.length-1,A=!isNaN(Number(X[K+1]));if(_){U[F]=G;continue}if(!(F in U))U[F]=A?[]:{};else if(A&&!Array.isArray(U[F]))U[F]=[];else if(!A&&Array.isArray(U[F]))U[F]={};U=U[F]}}const z=J0(Z);try{for(let[q,B]of Object.entries(J)){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,B)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return z}$1.default.fn.extend({attrs:function(){const Z={},J=this[0];return J&&J.nodeType!==Node.TEXT_NODE&&$1.default.each(J.attributes,function(){Z[this.name]=this.value}),Z}});var I0="syn:",O0="fn:",A0="on-",a=/^\.\.\./,J1=/^\[(.*?)\]$/,W5=["@html","@text"];class Q1{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,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(Z=!1){if(this.debug=Z,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const Z=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");Z.push({timestamp:Date.now(),metrics:{...this.stats}}),Z.length>100&&Z.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(Z))}catch(Z){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const Z=performance.now()-this.renderStartTime;this.stats.renderTime=Z,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,Z),this.renderTimes.push(Z),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((J,W)=>J+W,0)/this.renderTimes.length,this.renderStartTime=0,this.measurementCount++}inc(Z){if(!this.debug)return;if(typeof this.stats[Z]==="number")this.stats[Z]++}dec(Z){if(!this.debug)return;if(typeof this.stats[Z]==="number"&&this.stats[Z]>0)this.stats[Z]--}record(Z,J){if(!this.debug)return;if(typeof this.stats[Z]!=="undefined")this.stats[Z]=J}add(Z,J){if(!this.debug)return;if(typeof this.stats[Z]==="number")this.stats[Z]+=J}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 Z={"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)},J={"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={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},B={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(Z),console.table(J),console.table(W),console.table(z),console.table(q),console.table(B),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(Z){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=Z}trackError(Z){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",Z)}setLoggingInterval(Z){if(!this.debug)return;this.loggingInterval=Z}getSnapshot(){return J0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var P5=l0(d0(),1);var W1="comm",X1="rule",H1="decl";var H5="@import";var z5="@namespace",Y5="@keyframes";var q5="@layer";function z1(Z){return Z.trim()}function b0(Z,J,W){return Z.replace(J,W)}function B5(Z,J,W){return Z.indexOf(J,W)}function L0(Z,J){return Z.charCodeAt(J)|0}function V0(Z,J,W){return Z.slice(J,W)}function Y0(Z){return Z.length}function Y1(Z){return Z.length}function h0(Z,J){return J.push(Z),Z}var A1=Math.abs,i0=String.fromCharCode;function B1(Z,J,W,z,q,B,G,X){return{value:Z,root:J,parent:W,type:z,props:q,children:B,line:q1,column:g0,length:G,return:"",siblings:X}}function w5(){return Q0}function K5(){if(Q0=G0>0?L0(f0,--G0):0,g0--,Q0===10)g0=1,q1--;return Q0}function w0(){if(Q0=G0<G5?L0(f0,G0++):0,g0++,Q0===10)g0=1,q1++;return Q0}function N0(){return L0(f0,G0)}function c0(){return G0}function G1(Z,J){return V0(f0,Z,J)}function k0(Z){switch(Z){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 U5(Z){return q1=g0=1,G5=Y0(f0=Z),G0=0,[]}function M5(Z){return f0="",Z}function w1(Z){return z1(G1(G0-1,x1(Z===91?Z+2:Z===40?Z+1:Z)))}function O5(Z){while(Q0=N0())if(Q0<33)w0();else break;return k0(Z)>2||k0(Q0)>3?"":" "}function D5(Z,J){while(--J&&w0())if(Q0<48||Q0>102||Q0>57&&Q0<65||Q0>70&&Q0<97)break;return G1(Z,c0()+(J<6&&N0()==32&&w0()==32))}function x1(Z){while(w0())switch(Q0){case Z:return G0;case 34:case 39:if(Z!==34&&Z!==39)x1(Q0);break;case 40:if(Z===41)x1(Z);break;case 92:w0();break}return G0}function F5(Z,J){while(w0())if(Z+Q0===57)break;else if(Z+Q0===84&&N0()===47)break;return"/*"+G1(J,G0-1)+"*"+i0(Z===47?Z:w0())}function j5(Z){while(!k0(N0()))w0();return G1(Z,G0)}var q1=1,g0=1,G5=0,G0=0,Q0=0,f0="";function V5(Z){return M5(K1("",null,null,null,[""],Z=U5(Z),0,[0],Z))}function K1(Z,J,W,z,q,B,G,X,U){var K=0,F=0,N=G,_=0,A=0,u=0,i=1,e=1,r=1,c=0,d="",f=q,y=B,$=z,M=d;while(e)switch(u=c,c=w0()){case 40:if(u!=108&&L0(M,N-1)==58){if(B5(M+=b0(w1(c),"&","&\f"),"&\f",A1(K?X[K-1]:0))!=-1)r=-1;break}case 34:case 39:case 91:M+=w1(c);break;case 9:case 10:case 13:case 32:M+=O5(u);break;case 92:M+=D5(c0()-1,7);continue;case 47:switch(N0()){case 42:case 47:if(h0(Y8(F5(w0(),c0()),J,W,U),U),(k0(u||1)==5||k0(N0()||1)==5)&&Y0(M)&&V0(M,-1,void 0)!==" ")M+=" ";break;default:M+="/"}break;case 123*i:X[K++]=Y0(M)*r;case 125*i:case 59:case 0:switch(c){case 0:case 125:e=0;case 59+F:if(r==-1)M=b0(M,/\f/g,"");if(A>0&&(Y0(M)-N||i===0&&u===47))h0(A>32?L5(M+";",z,W,N-1,U):L5(b0(M," ","")+";",z,W,N-2,U),U);break;case 59:M+=";";default:if(h0($=I5(M,J,W,K,F,q,X,d,f=[],y=[],N,B),B),c===123)if(F===0)K1(M,J,$,$,f,B,N,X,y);else{switch(_){case 99:if(L0(M,3)===110)break;case 108:if(L0(M,2)===97)break;default:F=0;case 100:case 109:case 115:}if(F)K1(Z,$,$,z&&h0(I5(Z,$,$,0,0,q,X,d,q,f=[],N,y),y),q,y,N,X,z?f:y);else K1(M,$,$,$,[""],y,0,X,y)}}K=F=A=0,i=r=1,d=M="",N=G;break;case 58:N=1+Y0(M),A=u;default:if(i<1){if(c==123)--i;else if(c==125&&i++==0&&K5()==125)continue}switch(M+=i0(c),c*i){case 38:r=F>0?1:(M+="\f",-1);break;case 44:X[K++]=(Y0(M)-1)*r,r=1;break;case 64:if(N0()===45)M+=w1(w0());_=N0(),F=N=Y0(d=M+=j5(c0())),c++;break;case 45:if(u===45&&Y0(M)==2)i=0}}return B}function I5(Z,J,W,z,q,B,G,X,U,K,F,N){var _=q-1,A=q===0?B:[""],u=Y1(A);for(var i=0,e=0,r=0;i<z;++i)for(var c=0,d=V0(Z,_+1,_=A1(e=G[i])),f=Z;c<u;++c)if(f=z1(e>0?A[c]+" "+d:b0(d,/&\f/g,A[c])))U[r++]=f;return B1(Z,J,W,q===0?X1:X,U,K,F,N)}function Y8(Z,J,W,z){return B1(Z,J,W,W1,i0(w5()),V0(Z,2,-2),0,z)}function L5(Z,J,W,z,q){return B1(Z,J,W,H1,V0(Z,0,z),V0(Z,z+1,-1),z,q)}function U1(Z,J){var W="";for(var z=0;z<Z.length;z++)W+=J(Z[z],z,Z,J)||"";return W}function N5(Z,J,W,z){switch(Z.type){case q5:if(Z.children.length)break;case H5:case z5:case H1:return Z.return=Z.return||Z.value;case W1:return"";case Y5:return Z.return=Z.value+"{"+U1(Z.children,z)+"}";case X1:if(!Y0(Z.value=Z.props.join(",")))return""}return Y0(W=U1(Z.children,z))?Z.return=Z.value+"{"+W+"}":""}function C5(Z){var J=Y1(Z);return function(W,z,q,B){var G="";for(var X=0;X<J;X++)G+=Z[X](W,z,q,B)||"";return G}}class M1{nsp;settings;$head;constructor(Z,J){if(typeof Z!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=Z,this.$head=P5.default("head"),this.settings=J||{},this.settings&&this.load(this.settings)}compile(Z){try{return U1(V5(Z),C5([N5]))}catch(J){throw new Error(`Style compilation failed: ${J.message}`)}}waitForStyles(Z){return new Promise((J)=>{const W=new MutationObserver(()=>{const z=document.querySelector(Z);if(z&&getComputedStyle(z).cssText)W.disconnect(),J()});W.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(Z){if(!Z)throw new Error("Invalid injection arguments");const J=`rel="${this.settings.meta?"@":""}${this.nsp}"`;Z=this.settings.meta?Z:`[rel="${this.nsp}"] { ${Z} }`;try{const W=this.compile(Z);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 B=this.$head.find(`style[${J}]`);if(B.length)q=parseInt(B.attr("dindex"))+1,B.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(Z){if(this.settings=Z,typeof this.settings!=="object")throw new Error("Undefined styles settings");if(this.settings.sheet){const J=await this.inject(this.settings.sheet);await this.waitForStyles(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`)}}get(){}async clear(){const Z=this.$head.find(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`);if(!Z.length)return;const J=parseInt(Z.attr("dindex"));J===0?Z.remove():Z.attr("dindex",String(J-1))}async custom(){return{}}async style(){return{}}}var q8=function(Z){const J=/on-([a-zA-Z-]+)\s*\(/g;let W=Z,z;while((z=J.exec(Z))!==null){const q=z[1],B=z.index+z[0].length;let G=1,X=B;while(X<Z.length&&G>0){if(Z[X]==="(")G++;if(Z[X]===")")G--;X++}if(G===0){const U=Z.slice(B,X-1).trim(),K=Z.slice(0,z.index),F=`${A0}${q}="${U}"`,N=Z.slice(X);W=K+F+N,Z=W,J.lastIndex=K.length+F.length}}return W},B8=function(Z){const J=[];let z=Z.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,B,G)=>{return J.push(G),`<${B}##TAG_ATTRS_${J.length-1}##>`});for(let q=0;q<J.length;q++){const B=`##TAG_ATTRS_${q}##`,G=J[q],X=G8(G);z=z.replace(B,X)}return z},G8=function(Z){let J="",W=0,z=!1,q="",B=0,G=0,X=0;while(W<Z.length){const U=Z[W];if((U==='"'||U==="'")&&(W===0||Z[W-1]!=="\\")){if(!z)z=!0,q=U;else if(U===q)z=!1}if(!z){if(U==="(")G++;else if(U===")")G--;else if(U==="{")X++;else if(U==="}")X--}if(!z&&G===0&&X===0&&(U===" "||W===Z.length-1)){let K=W;if(W===Z.length-1)K=W+1;const F=Z.substring(B,K).trim();if(F){const N=w8(F);J+=" "+N}B=W+1}W++}return J},w8=function(Z){const J=Z.indexOf("=");if(J===-1){if(Z.startsWith("...")||Z.startsWith("["))return Z;return`:${Z}="${!Z.startsWith("!")}"`}let W=Z.substring(0,J).trim(),z=Z.substring(J+1).trim();if(W.startsWith("@"))return W=!W5.includes(W)?W.slice(1):W,`:${W}=${z}`;if(W.startsWith(O0)||W.startsWith(A0))return Z;if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'")){const q=z.substring(1,z.length-1);if(K8(q))return`:${W}="${q}"`;return Z}else return`:${W}="${z}"`};function K8(Z){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(Z))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(Z))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(Z))return!0;if(Z.includes("{")&&Z.includes("}"))return!0;return!1}function _1(Z){let J=(Z||"").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,'<lips dtag="$1" $2></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 J=q8(J),J=B8(J),J}var U8=function(Z,J){if(Z.isDisposed)return;J.add(Z),Z.dependencies.add(J)},E5=function(Z){for(let J of Z.dependencies)J.delete(Z);Z.dependencies.clear()};function y0(Z,J={maxSize:100}){const W=new Set,z=[{value:Z,timestamp:Date.now()}];let q=0;const B=()=>{const K=O1[O1.length-1];return K&&U8(K,W),z[q].value},G=()=>{const K=[...W];if(S5)for(let F of K)S5.add(F);else for(let F of K)F.execute()};return[B,(K,F)=>{if(Object.is(z[q].value,K))return;if(q<z.length-1)z.splice(q+1);if(z.push({value:K,timestamp:Date.now(),metadata:F}),z.length>J.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(K){if(K>=0&&K<z.length&&K!==q)q=K,G()},getHistory(){return[...z]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<z.length-1},clear(){const K=z[0];z.length=0,z.push(K),q=0,G()}}]}function D1(Z){let J=!1;const W=()=>{if(J)throw new Error("Circular dependency detected");if(z.isDisposed)return;J=!0,E5(z),O1.push(z);try{Z()}finally{J=!1,O1.pop()}},z={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{z.isDisposed=!0,E5(z)}}}var O1=[],S5=null;class p0 extends Z1{declaration;$=null;input;state;static;context;__name__;__path__;__template__;__previous;__stylesheet;__macros=new Map;__renderCache=new Map;FGUD=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;benchmark;__path="";__pathCounter=0;__renderDepth=0;constructor(Z,J,{input:W,state:z,context:q,_static:B,handler:G,stylesheet:X,macros:U,declaration:K},F){super();if(this.lips=F.lips,F?.debug)this.debug=F.debug;if(F?.prepath)this.prepath=F.prepath;if(this.__name__=Z,this.__path__=`${this.prepath}/${this.__name__}`,this.__template__=_1(J),this.declaration=K||{name:Z},this.input=W||{},this.static=B||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,z||{}),U&&this.setMacros(U),G&&this.setHandler(G),X&&this.setStylesheet(X),this.benchmark=new Q1(this.debug),this.benchmark.inc("componentCount"),this.UQS=new e0(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[N,_]=y0(this.input),[A,u]=y0(this.state),[i,e]=y0(this.context);this.__setInput=_,this.__setState=u,this.__getState=A,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,(r)=>{if(!H0(this.context,r))return;e(r),this.context=r,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context",this)}),this.ICE=D1(()=>{const r=N(),c=A(),d=this.context=i();if(!this.isRendered){this.benchmark.reset();const{$log:f}=this.render("",void 0,void 0,this.FGUD);this.$=f,!K?.syntax&&this.$?.each((y,$)=>typeof $.setAttribute=="function"&&$.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:c,input:r,context:d},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update",this),this.__previous={input:J0(r),state:J0(c),context:J0(d)},this.input=r;this.benchmark.log(),typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render",this)})}setContext(Z,J){this.lips.setContext(Z,J)}setInput(Z){if(!H0(this.input,Z))return;this.__setInput(Z),typeof this.onInput=="function"&&this.onInput.bind(this)(Z)}subInput(Z){if(typeof Z!=="object")throw new Error("Invalid sub input data argument");return this.setInput(X5(this.input,Z)),this}setMacros(Z){const J=_1(Z),W=t.default(J);if(!W.length)return;const z=this;W.each(function(){const q=t.default(this),{argv:B,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:B,$node:q})})}setHandler(Z){Object.entries(Z).map(([J,W])=>this[J]=W.bind(this))}setStylesheet(Z){const J={sheet:Z,meta:this.__name__==="__ROOT__"};this.__stylesheet=new M1(this.__name__,J)}get node(){if(!this.$)throw new Error("node() is expected to be call after component get rendered");return this.$}find(Z){return this.$?.find(Z)}render(Z,J,W={},z,q){const B=z||new Map,G=[];if(J&&!J.length)return console.warn("Undefined node element to render"),{$log:J,dependencies:B};this.benchmark.startRender();const X=this;let U=t.default();function K(M){const w=F(M);return X.__pathCounter++,X.__path?`${X.__path}/${w}`:`${Z?Z+"/":"#"}${w}`}function F(M){return(M==="component"?"c":"")+X.__pathCounter}function N(M){return M!==null&&typeof M==="object"&&typeof M.mesh==="function"&&typeof M.update==="function"}function _(M){return M!==null&&typeof M==="object"&&typeof M.default&&typeof M.default==="string"}function A(M){if(!M.attr(":dtag")||M.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const w=M.attr(":dtag"),O=X.__evaluate__(w,W);if(N(O)||O===null)return r(M,w,O);else if(_(O))return c(M,{template:O});else return c(M,{name:O})}function u(M){const w=M.attr(":args"),O=K("log");if(!w)return;if(X.__evaluate__(`console.log(${w})`,W),X.__isReactive__(w,W))X.__extractExpressionDeps__(w,W).forEach((P)=>X.__trackDep__(B,P,{$fragment:null,path:O,update:(R)=>X.__evaluate__(`console.log(${w})`,R),memo:W,batch:!0}))}function i(M){const w=K("var"),{attrs:O}=X.__getAttributes__(M);if(!O)return;Object.entries(O.literals).forEach(([L,P])=>{if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);W[L]={value:P,type:"let"}}),Object.entries(O.expressions).forEach(([L,P])=>{if(a.test(L)){const R=(S,h)=>{const v=X.__evaluate__(L.replace(a,""),h||W);if(typeof v!=="object")throw new Error(`Invalid spread operator ${L}`);for(let V in v){if(W[V]&&W[V].type==="const")throw new Error(`Cannot override <const ${V}=[value]/> variable`);if(W[V]={value:v[V],type:"let"},h)h[V]=W[V],X.__updateVarDepNodes__(V,w,h)}if(S)return{memo:h}};X.__extractExpressionDeps__(L,W).forEach((S)=>X.__trackDep__(B,S,{$fragment:null,path:`${w}.${L}`,update:(h)=>R(!0,h),memo:W,batch:!0})),R()}else if(P){if(X.__isReactive__(P,W)){const R=X.__extractExpressionDeps__(P,W),o=(S,h)=>{if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);return S[L]=W[L]={value:X.__evaluate__(P,S),type:"let"},X.__updateVarDepNodes__(L,w,S),{memo:S}};R.forEach((S)=>X.__trackDep__(B,S,{$fragment:null,path:`${w}.${L}`,update:o,memo:W,batch:!0}))}if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);W[L]={value:X.__evaluate__(P,W),type:"let"}}}),X.benchmark.inc("elementCount")}function e(M){const{attrs:w}=X.__getAttributes__(M);if(!w)return;Object.entries(w.literals).forEach(([O,L])=>{if(W[O]&&W[O].type==="const")throw new Error(`<const ${O}=[value]/> variable already defined`);if(!L)return;W[O]={value:L,type:"const"}}),Object.entries(w.expressions).forEach(([O,L])=>{if(a.test(O)){const P=X.__evaluate__(O.replace(a,""),W);if(typeof P!=="object")throw new Error(`Invalid spread operator ${O}`);for(let R in P){if(W[R]&&W[R].type==="const")throw new Error(`<const ${R}=[value]/> by spread operator ${O}. [${R}] variable already defined`);W[R]={value:P[R],type:"const"}}}else{if(W[O]&&W[O].type==="const")throw new Error(`<const ${O}=[value]/> variable already defined`);if(!L)return;W[O]={value:X.__evaluate__(L,W),type:"const"}}}),X.benchmark.inc("elementCount")}function r(M,w,O){const{attrs:L}=X.__getAttributes__(M),P=K("element"),R=X.__getBoundaries__(P);let o=t.default(R.start),S={},h=O;if(h){L.literals&&Object.entries(L.literals).forEach(([V,E])=>S[V]={type:"arg",value:E}),L.expressions&&Object.entries(L.expressions).forEach(([V,E])=>{if(!h)return;if(a.test(V)){const x=X.__evaluate__(V.replace(a,""),W);if(typeof x!=="object")throw new Error(`Invalid spread operator ${V}`);for(let T in x){if(T!=="#"&&!h.argv.includes(T))continue;S[T]={type:"arg",value:x[T]}}}else{if(V!=="#"&&!h.argv.includes(V))return;S[V]={type:"arg",value:E?X.__evaluate__(E,W):!0}}});const v=h.mesh(S);if(v&&v.length)o=o.add(v);L.expressions&&Object.entries(L.expressions).forEach(([V,E])=>{if(!h)return;if(a.test(V)&&X.__isReactive__(V,W)){const x=X.__extractExpressionDeps__(V,W),T=(j,k)=>{if(!h)return;const b={},s=X.__evaluate__(V.replace(a,""),j);if(typeof s!=="object")throw new Error(`Invalid spread operator ${V}`);const l=[];for(let p in s){if(p!=="#"&&!h.argv.includes(p))continue;S[p]=b[p]={type:"arg",value:s[p]},(!j[p]||!E0(s[p],j[p].value))&&l.push(p)}l.length&&h.update(l,b,R)};x.forEach((j)=>X.__trackDep__(B,j,{$fragment:null,boundaries:R,path:`${P}.${V}`,update:T,memo:W,batch:!0}))}else if((V==="#"||h.argv.includes(V))&&X.__isReactive__(E,W)){const x=X.__extractExpressionDeps__(E,W),T=(j,k)=>{if(!h)return;const b=S[V]={type:"arg",value:E?X.__evaluate__(E,j):!0};h.update([V],{[V]:b},R)};x.forEach((j)=>X.__trackDep__(B,j,{$fragment:null,boundaries:R,path:`${P}.${V}`,update:T,memo:W,batch:!0}))}})}if(X.__isReactive__(w,W)){const v=(E,x)=>{const T=X.__evaluate__(w,E);let j;if(_(T))j=c(M,{template:T});else if(N(T))S="#"in S?{...E,...S["#"].value}:{...E,...S},h=T,j=h?h.mesh(S):null;if(!document.contains(R.start)||!document.contains(R.end))throw new Error("Dynamic element boundaries not found");const k=[];let b=R.start.nextSibling;while(b&&b!==R.end)k.push(b),b=b.nextSibling;t.default(k).remove(),j&&t.default(R.start).after(j)};X.__extractExpressionDeps__(w,W).forEach((E)=>X.__trackDep__(B,E,{$fragment:null,boundaries:R,path:P,update:v,batch:!0,memo:{...W,...S}}))}return o=o.add(R.end),o}function c(M,w){let O,L;if(w?.template)O=w.template,L=F("component");else{if(L=w?.name||M.prop("tagName")?.toLowerCase(),!L)throw new Error("Invalid component");if(L===X.__name__)throw new Error("Render component within itself is forbidden");O=X.lips.import(L)}if(!O||!L)throw new Error(`<${L}> template not found`);const P=K("component"),R=X.__getBoundaries__(P),{argv:o,attrs:S,events:h}=X.__getAttributes__(M),v={};let V={},E=t.default(R.start),x=X.PCC.get(P);S.literals&&Object.entries(S.literals).forEach(([j,k])=>{if(j=="key")return;V[j]=k}),S.functions&&Object.entries(S.functions).forEach(([j,k])=>{V[j]=X.__evaluateFunction__(k,[],W),O.declaration?.syntax?v[I0+O0+j]=k:v[O0+j]=k}),S.expressions&&Object.entries(S.expressions).forEach(([j,k])=>{if(j=="key")return;if(a.test(j)){const b=X.__evaluate__(j.replace(a,""),W);if(typeof b!=="object")throw new Error(`Invalid spread operator ${j}`);for(let s in b)V[s]=b[s]}else V[j]=k?X.__evaluate__(k,W):!0;O.declaration?.syntax?v[I0+j]=k:v[j]=k});const T=M.contents();if(T.length){if(V={...V,...X.__meshwire__({$node:M,fragmentPath:P,fragmentBoundaries:R,meshPath:null,argv:o,scope:W,xmlns:q,useAttributes:!0,declaration:O.declaration},v)},O.declaration){if(O.declaration.tags)Object.entries(O.declaration?.tags).forEach(([j,{type:k,many:b}])=>{switch(k){case"nexted":{let s=M.next(j);if(!s.length)return;if(b){V[j]=[];let l=0,p=!1;while(!p){if(V[j].push(X.__meshwire__({$node:s,meshPath:`${j}[${l}]`,fragmentPath:P,fragmentBoundaries:R,argv:o,scope:W,xmlns:q,useAttributes:!0,declaration:O.declaration},v)),!s.next(j).length){p=!0;break}s=s.next(j),l++}}else V[j]=X.__meshwire__({$node:s,meshPath:j,fragmentPath:P,fragmentBoundaries:R,argv:o,scope:W,xmlns:q,useAttributes:!0,declaration:O.declaration},v)}break;case"child":{const s=M.children(j);if(b)V[j]=[],s.each(function(l){const p=t.default(this),{argv:D0}=X.__getAttributes__(p);V[j].push(X.__meshwire__({$node:p,meshPath:`${j}[${l}]`,fragmentPath:P,fragmentBoundaries:R,argv:D0,scope:W,xmlns:q,useAttributes:!0,declaration:O.declaration},v))});else if(M.children(j).first().length){const l=M.children(j).first(),{argv:p}=X.__getAttributes__(l);V[j]=X.__meshwire__({$node:l,meshPath:j,fragmentPath:P,fragmentBoundaries:R,argv:p,scope:W,xmlns:q,useAttributes:!0,declaration:O.declaration},v)}}break}});else if(O.declaration.contents)V.__contents__=T}}if(x)x.setInput(J0(V)),E=E.add(x.node);else{const{declaration:j,state:k,_static:b,handler:s,context:l,default:p,stylesheet:D0}=O;x=new p0(L,p||"",{state:J0(k),input:J0(V),context:l,_static:J0(b),handler:s,stylesheet:D0,declaration:j},{debug:X.debug,lips:X.lips,prepath:P}),E=E.add(x.node),X.PCC.set(P,x),Object.entries(h).forEach(([Z0,n])=>!!x&&X.__attachEvent__(x,Z0,n,W)),v&&Object.entries(v).forEach(([Z0,n])=>{let z0=!1,m0=!1;if(Z0.startsWith(I0))z0=!0,Z0=Z0.replace(I0,"");if(Z0.startsWith(O0))m0=!0,Z0=Z0.replace(O0,"");if(a.test(Z0)){const R0=(C0)=>{const K0={},x0=X.__evaluate__(Z0.replace(a,""),C0);if(typeof x0!=="object")throw new Error(`Invalid spread operator ${Z0}`);for(let T0 in x0)K0[T0]=x0[T0];x?.subInput(K0)};if(X.__isReactive__(Z0,W))X.__extractExpressionDeps__(n,W).forEach((K0)=>X.__trackDep__(B,K0,{$fragment:null,boundaries:R,path:`${P}.${Z0}`,update:R0,syntax:z0,memo:W,batch:!0}))}else{const R0=(C0)=>{const K0=m0?X.__evaluateFunction__(n,[],C0):n?X.__evaluate__(n,C0):!0;x?.subInput({[Z0]:K0})};if(X.__isReactive__(n,W))X.__extractExpressionDeps__(n,W).forEach((K0)=>X.__trackDep__(B,K0,{$fragment:null,boundaries:R,path:`${P}.${Z0}`,update:R0,syntax:z0,memo:W,batch:!0}))}}),E=E.add(R.end)}return X.benchmark.inc("componentCount"),E}function d(M){const w=M.prop("tagName")?.toLowerCase();if(!w)throw new Error("Invalid macro rendering call");const O=X.__macros.get(w);if(!O)throw new Error("Macro component not found");const L=K("macro"),P=X.__getBoundaries__(L),{attrs:R}=X.__getAttributes__(M),o={};let S={},h={},v=t.default(P.start);if(R.literals&&Object.entries(R.literals).forEach(([T,j])=>S[T]={value:j,type:"arg"}),R.expressions&&Object.entries(R.expressions).forEach(([T,j])=>{if(a.test(T)){const k=X.__evaluate__(T.replace(a,""),W);if(typeof k!=="object")throw new Error(`Invalid spread operator ${T}`);for(let b in k)if(h[b]=k[b],O.argv.includes(b))S[b]={value:k[b],type:"arg"};o[T]=j}else{const k=j?X.__evaluate__(j,W):!0;if(h[T]=k,O.argv.includes(T))S[T]={value:k,type:"arg"};if(O.argv.includes(T))o[T]=j}O.argv.forEach((k)=>{if(S[k]!==void 0)return;S[k]={value:!1,type:"arg"}})}),O.argv.includes("__"))S.__={value:h,type:"arg"};const V={$node:O.$node,meshPath:null,fragmentPath:L,fragmentBoundaries:P,argv:O.argv,scope:W,xmlns:q,useAttributes:!0},E=X.__meshwire__(V,o),x=E.renderer.mesh(S);return v=v.add(x),o&&Object.entries(o).forEach(([T,j])=>{let k=!1;if(new RegExp(`^${I0}`).test(T))k=!0,T=T.replace(I0,"");if(a.test(T)){if(!X.__isReactive__(T,W))return;const b=X.__extractExpressionDeps__(T,W),s=(l)=>{const p={},D0=X.__evaluate__(T.replace(a,""),l);if(typeof D0!=="object")throw new Error(`Invalid spread operator ${T}`);const Z0=[];for(let n in D0)p[n]={value:D0[n],type:"arg"},(!l[n]||!E0(D0[n],l[n].value))&&Z0.push(n);return Z0.length&&E.renderer.update(Z0,p),{memo:{...l,...p}}};b.forEach((l)=>X.__trackDep__(B,l,{$fragment:null,boundaries:P,path:`${L}.${T}`,update:s,syntax:k,memo:{...W,...S},batch:!0}))}else if(X.__isReactive__(j,W)){const b=X.__extractExpressionDeps__(j,W),s=(l)=>{const p=l[T]={value:j?X.__evaluate__(j,l):!0,type:"arg"};return E.renderer.update([T],{[T]:p}),{memo:l}};b.forEach((l)=>X.__trackDep__(B,l,{$fragment:null,boundaries:P,path:`${L}.${T}`,update:s,syntax:k,memo:{...W,...S},batch:!0}))}}),v=v.add(P.end),X.benchmark.inc("elementCount"),v}function f(M){if(!M.length||!M.prop("tagName"))return M;const w=M.is("svg")||q,O=w?t.default(document.createElementNS("http://www.w3.org/2000/svg",M.prop("tagName").toLowerCase())):t.default(`<${M.prop("tagName").toLowerCase()}/>`),L=M.contents(),P=K("element");L.length&&O.append(X.__withPath__(P,()=>X.render(P+".n",L,W,B,w).$log));const{attrs:R,events:o}=X.__getAttributes__(M);R.literals&&Object.entries(R.literals).forEach(([h,v])=>O.attr(h,v));const S=(h,v=!1)=>{h&&Object.entries(h).forEach(([V,E])=>{switch(V){case"@html":{const x=(T)=>{O.html(X.__evaluate__(E,T))};if(x(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((j)=>X.__trackDep__(B,j,{$fragment:O,path:`${P}.${V}`,update:x,memo:W,batch:!0}))}break;case"@text":{const x=(T)=>{let j=X.__evaluate__(E,T);if(!M.is("[no-translate]")){const{text:k}=X.lips.i18n.translate(j);j=k}O.text(j)};if(x(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((j)=>X.__trackDep__(B,j,{$fragment:O,path:`${P}.${V}`,update:x,memo:W,batch:!0}))}break;case"style":{const x=(T)=>{const j=X.__evaluate__(E,T);if(typeof j==="object"){let k="";Object.entries(j).forEach(([b,s])=>k+=`${b}:${s};`),k.length&&O.attr("style",k)}else O.attr("style",j)};if(x(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((j)=>X.__trackDep__(B,j,{$fragment:O,path:`${P}.${V}`,update:x,memo:W,batch:!0}))}break;default:{const x=(T)=>{const j=E?X.__evaluate__(E,T):E!==void 0?E:!0;j===void 0||j===!1?O.removeAttr(V):O.attr(V,j)};if(x(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((j)=>X.__trackDep__(B,j,{$fragment:O,path:`${P}.${V}`,update:x,memo:W,batch:!0}))}}})};return R.expressions&&Object.keys(R.expressions).forEach((h)=>{if(!a.test(h))return;const v=(V)=>{const E={},x=X.__evaluate__(h.replace(a,""),V);if(typeof x!=="object")throw new Error(`Invalid spread operator ${h}`);for(let T in x)E[T]=x[T];S(E)};if(delete R.expressions[h],v(W),h&&X.__isReactive__(h,W))X.__extractExpressionDeps__(h,W).forEach((E)=>X.__trackDep__(B,E,{$fragment:O,path:`${P}.${h}`,update:v,memo:W,batch:!0}))}),S(R.expressions,!0),o&&Object.entries(o).forEach(([h,v])=>{G.push({_event:h,$fragment:O,instruction:v,scope:W})}),X.benchmark.inc("elementCount"),X.benchmark.inc("domInsertsCount"),O}function y(M){const w=K("element"),O=M.text(),L=t.default(document.createTextNode(X.__interpolate__(O,W)));if(O&&X.__isReactive__(O,W)){const P=X.__extractTextDeps__(O,W),R=(o)=>{const S=X.__interpolate__(O,o);if(!L[0])return;L[0].textContent=S};P.forEach((o)=>X.__trackDep__(B,o,{path:w,$fragment:L,update:R,memo:W,batch:P.length>1}))}return X.benchmark.inc("elementCount"),X.benchmark.inc("domInsertsCount"),L}function $(M){if(M.get(0)?.nodeType===Node.COMMENT_NODE)return M;if(M.get(0)?.nodeType===Node.TEXT_NODE)return y(M);if(M.is("let"))return i(M);else if(M.is("const"))return e(M);else if(M.is("lips")&&M.attr(":dtag"))return A(M);else if(M.is("log"))return u(M);else if(X.__macros.has(M.prop("tagName")?.toLowerCase()))return d(M);else if(M.is("if, for, switch, async")||X.lips.has(M.prop("tagName")?.toLowerCase()))return c(M);else if(M.is("else-if, else"))return;return f(M)}try{this.__renderDepth++,J=J||t.default(this.__template__),J.each(function(){const M=$(t.default(this));if(M)U=U.add(M)}),G.forEach(({$fragment:M,_event:w,instruction:O,scope:L})=>{this.__attachEvent__(M,w,O,L)}),X.benchmark.inc("renderCount")}catch(M){console.error("Rendering Failed --",M),X.benchmark.trackError(M)}finally{if(this.__renderDepth--,this.benchmark.endRender(),this.benchmark.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:U,dependencies:B,events:G}}destroy(){this.ICE.dispose(),this.benchmark.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(({element:Z,_event:J})=>this.__detachEvent__(Z,J)),this.VER=[];for(let Z in this.PCC){const J=this.PCC.get(Z);J?.destroy(),J?.delete(Z)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.state.reset(),this.__macros.clear(),this.__stylesheet?.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((Z,J)=>{t.default(J).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy",this)}__meshwire__(Z,J){const W=this,{$node:z,meshPath:q,fragmentPath:B,fragmentBoundaries:G,argv:X,scope:U,xmlns:K,declaration:F,useAttributes:N}=Z;let _,A=[];const u=[],i=(d,f,y)=>{const $=`${B}.${q||"r"}${y!==void 0?`[${y}]`:""}`,{$log:M,dependencies:w,events:O}=W.render($,d,{...U,...f},void 0,K);if(u.push($),w?.forEach((L,P)=>{if(!W.FGUD?.has(P))W.FGUD.set(P,new Map);L.forEach((R,o)=>{R.partial?.length?R.partial.push($):R.partial=[$],W.FGUD.get(P)?.set(o,R)})}),W.benchmark.inc("partialCount"),y!==void 0){const L=W.__getBoundaries__($);A[y]={argvalues:f,boundaries:L};let P=t.default(L.start);return P=P.add(M),P=P.add(L.end),P}return M},e=(d,f,y)=>{if(W.benchmark.startRender(),d.forEach(($)=>{const M=W.FGUD.get($);if(!M)return;M.forEach((w)=>{const O=u.find((L)=>w.partial?.find((P)=>L==P));if(!w.partial||!O)return;if(y!==void 0&&!O.endsWith(`r[${y}]`))return;if(G?.start&&!document.contains(G.start)){console.warn(`${q} -- partial boundaries missing in the DOM`),M.delete(w.path);return}if(w.memo?.[$]&&f?.[$]&&E0(w.memo[$],f[$]))return;if(w.memo={...U,...w.memo,...f},w.batch)W.UQS.queue({dep:$,dependent:w});else{const L=w.update(w.memo,"mesh-partial-updator");if(L)typeof L.memo==="object"&&M.set(w.path,{...w,memo:L.memo}),typeof L.cleanup==="function"&&L.cleanup()}W.benchmark.inc("dependencyUpdateCount")}),!M.size&&W.FGUD.delete($)}),y!==void 0&&A[y])A[y].argvalues=f;W.benchmark.inc("partialUpdateCount"),W.benchmark.endRender()},r=(d)=>{if(!A[d])return;const f=A[d].boundaries;if(delete A[d],!document.contains(f.start)||!document.contains(f.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const y=[];let $=f.start.nextSibling;while($&&$!==f.end)y.push($),$=$.nextSibling;t.default(y).remove(),f.start.remove(),f.end.remove()},c={renderer:{path:q,argv:X,mesh(d,f=!1){if(_=z.contents(),!_?.length)return null;if(F?.iterator){const y=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!y.length)return null;let $=t.default();return y.forEach((M,w)=>{if(!_?.length)return null;$=$.add(i(_,M,w))}),$}else return i(_,d)},update(d,f,y){if(!u.length)return;if(y=y||G,F?.iterator){const $=f?.["#"].value;if(!Array.isArray($))return;if(Array.isArray(A)){if(A.length===$.length){for(let w=0;w<$.length;w++)!E0(A[w].argvalues,$[w])&&e(Object.keys($[w]),$[w],w);return}const M=Math.min(A.length,$.length);for(let w=0;w<M;w++)e(Object.keys($[w]),$[w],w);if($.length>A.length){if(!_?.length)return;for(let w=A.length;w<$.length;w++){const O=i(_,$[w],w);t.default(y.end).before(O)}}else if($.length<A.length)for(let w=$.length;w<A.length;w++)r(w)}}else e(d,f)}}};if(N&&q){const{attrs:d}=W.__getAttributes__(z);d.literals&&Object.entries(d.literals).forEach(([f,y])=>c[f]=y),d.expressions&&Object.entries(d.expressions).forEach(([f,y])=>{if(a.test(f)){const $=W.__evaluate__(f.replace(a,""),U);if(typeof $!=="object")throw new Error(`Invalid spread operator ${f}`);for(let M in $)c[M]=$[M];J[`${F?.syntax?I0:""}${q}.${f}`]=y}else c[f]=y?W.__evaluate__(y,U):!0,J[`${F?.syntax?I0:""}${q}.${f}`]=y})}return c}__getBoundaries__(Z){return this.benchmark.inc("domOperations"),this.benchmark.inc("domInsertsCount"),{start:document.createComment(`s:${this.prepath}.${Z}`),end:document.createComment(`e:${this.prepath}.${Z}`)}}__getAttributes__(Z){const J=Z.attrs(),W={},z={literals:{},functions:{},expressions:{}};let q=[];return J&&Object.entries(J).forEach(([B,G])=>{if(B==":dtag")return;if(B.startsWith(":")||B.startsWith(O0)||B.startsWith(A0)||a.test(B)||J1.test(B))if(J1.test(B)){const[X,U]=B.match(J1)||[];q=U.split(",")}else if(B.startsWith(A0))W[B.replace(A0,"")]=G;else if(B.startsWith(O0))z.functions[B.replace(O0,"")]=G;else{if(B.startsWith(":"))B=B.slice(1,B.length);z.expressions[B]=G||""}else z.literals[B]=G}),{argv:q,events:W,attrs:z}}__withPath__(Z,J){const W=this.__path;this.__path=Z;const z=J();return this.__path=W,z}__getPathParent__(Z){const J=Z.split("/");return J.pop(),J.join("/")}__hasSamePathParent__(Z,J){return Z.startsWith(J)}__evaluate__(Z,J){try{Z=Z.trim();const W=this.state.toJSON();if(J){const z={};for(let G in J)z[G]=J[G].value;const q=`with( scope ){ return ${Z}; }`;return new Function("self","input","state","static","context","scope",q)(this,this.input,W,this.static,this.context,z||{})}else{const z=`return ${Z}`;return new Function("self","input","state","static","context",z)(this,this.input,W,this.static,this.context)}}catch(W){return Z}}__evaluateFunction__(Z,J,W){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(Z))return this.__evaluate__(Z,W)(...J);else{let[z,...q]=Z.split(/\s*,\s*/),B;if(z=this.__evaluate__(z,W),typeof z==="function")B=z;else{if(typeof this[z]!=="function")throw new Error(`Undefined <${z}> handler method`);B=this[z].bind(this)}if(typeof B!=="function")throw new Error(`Expected <${z}> to be a function or handler method`);let G=q.map((X)=>this.__evaluate__(X,W));if(J.length)G=[...G,...J];return B(...G)}}__interpolate__(Z,J){return Z.replace(/{\s*([^{}]+)\s*}/g,(W,z)=>this.__evaluate__(z,J))}__attachEvent__(Z,J,W,z){Z.on(J,(...q)=>this.__evaluateFunction__(W,q,z)),this.VER.push({element:Z,_event:J}),this.benchmark.inc("domUpdatesCount"),this.benchmark.inc("domRemovalsCount")}__detachEvent__(Z,J){Z.off(J),this.benchmark.inc("domOperations"),this.benchmark.inc("domRemovalsCount")}__extractTextDeps__(Z,J){const W=new Set;return(Z.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const B=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(B,J).forEach((X)=>W.add(X))}),Array.from(W)}__extractExpressionDeps__(Z,J){const W=/\b(state|input|context)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,z=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g;let q=[...Array.from(Z.matchAll(W)),...Array.from(Z.matchAll(z))];if(J&&Object.keys(J).length){const B=new RegExp(`\\b(${Object.keys(J).join("|")})`,"g");q=[...q,...Array.from(Z.matchAll(B))]}return[...new Set(q.map((B)=>B[0]))]}__isReactive__(Z,J){if(/(state|input|context|self)\.[\w.]+/.test(Z))return!0;if(J&&Object.keys(J).length&&new RegExp(Object.keys(J).join("|")).test(Z))return!0;return!1}__trackDep__(Z,J,W){if(W.memo&&W.memo[J]&&W.memo[J].type==="let")W.haslet=!0;!Z.has(J)&&Z.set(J,new Map),Z.get(J)?.set(W.path,W),this.benchmark.inc("dependencyTrackCount")}__valueDep__(Z,J){return J.reduce((W,z)=>W?.[z],Z)}__shouldUpdate__(Z,J,W,z){if(Z==="self")return!0;const q=this.__valueDep__(z[Z],J),B=this.__valueDep__(W[Z],J);return!E0(q,B)}__updateDepNodes__(Z,J){if(!this.FGUD?.size)return;this.benchmark.inc("componentUpdateCount"),this.benchmark.startRender(),this.FGUD.forEach((W,z)=>{const[q,...B]=z.split(".");if(!this.__shouldUpdate__(q,B,Z,J))return;W.forEach((G)=>{const{path:X,batch:U,$fragment:K,boundaries:F,update:N,memo:_,syntax:A}=G;try{if(!A&&(F?.start&&!document.contains(F.start))||K!==null&&!K.closest("body").length){W.delete(X);return}if(U)this.UQS.queue({dep:z,dependent:G});else{const u=N(_,"main-updator");if(u)typeof u.memo==="object"&&W.set(X,{...G,memo:u.memo}),typeof u.cleanup==="function"&&u.cleanup()}this.benchmark.inc("dependencyUpdateCount")}catch(u){console.error("failed to update dependency nodes --",u);return}}),!W.size&&this.FGUD?.delete(z)}),this.benchmark.endRender()}__updateVarDepNodes__(Z,J,W){if(!this.FGUD?.size)return;this.benchmark.inc("partialUpdateCount"),this.benchmark.startRender(),this.FGUD.get(Z)?.forEach((q,B)=>{if(!q.haslet||!this.__hasSamePathParent__(B,this.__getPathParent__(J)))return;if(q.memo={...q.memo,...W},q.batch)this.UQS.queue({dep:Z,dependent:q});else{const G=q.update(q.memo,"var-partial-updator");typeof G?.cleanup==="function"&&G.cleanup()}}),this.benchmark.endRender()}appendTo(Z){const J=typeof Z=="string"?t.default(Z):Z;return this.$?.length&&J.append(this.$),this.benchmark.inc("domOperations"),this}prependTo(Z){const J=typeof Z=="string"?t.default(Z):Z;return this.$?.length&&J.prepend(this.$),this.benchmark.inc("domOperations"),this}replaceWith(Z){const J=typeof Z=="string"?t.default(Z):Z;return this.$?.length&&J.replaceWith(this.$),this.benchmark.inc("domOperations"),this}}var b1={};u0(b1,{state:()=>{{return O8}},handler:()=>{{return D8}},default:()=>{{return F8}},declaration:()=>{{return M8}}});var M8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},O8={renderer:null},D8={onInput(){if(!this.input.renderer)return;if(this.input.by)this.state.renderer=this.input.renderer;else{let Z=!1;if(Array.isArray(this.input["else-if"])&&this.input["else-if"].length)this.input["else-if"].forEach((J)=>{if(Z||!J.by)return;this.state.renderer=J.renderer,Z=!0});if(!Z)this.state.renderer=this.input.else?this.input.else.renderer:null}}},F8="<{state.renderer}/>";var h1={};u0(h1,{state:()=>{{return I8}},handler:()=>{{return V8}},default:()=>{{return N8}},declaration:()=>{{return j8}},_static:()=>{{return L8}}});var j8={name:"for",syntax:!0,iterator:!0},I8={argvlist:null},L8={lastInput:null,processingBatch:!1},V8={onInput(){if(this.static.processingBatch)return;if(!this.input.renderer)throw new Error("Undefined mesh renderer");let{in:Z,from:J,to:W}=this.input;if(Z===void 0&&J===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(J!==void 0){if(J=parseFloat(String(J)),W==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");if(W=parseFloat(String(W)),J===W)throw new Error("<from> and <to> attribute cannot have the same value");const z=J<W,q=Math.abs(W-J)+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=J,U=!0;for(let K=0;K<this.state.argvlist.length;K++){if(this.state.argvlist[K][G].value!==X){U=!1;break}X=z?X+1:X-1}if(U)return;X=J;for(let K=0;K<this.state.argvlist.length;K++)this.state.argvlist[K][G].value=X,X=z?X+1:X-1;return}}const B=[];for(let G=J;z?G<=W:G>=W;z?G++:G--){const X={},[U]=this.input.renderer.argv;if(U)X[U]={value:G,type:"arg"};B.push(X)}this.state.argvlist=B}else if(Array.isArray(Z)){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!Z.length){console.warn("empty for loop <in> attribute Array value"),this.state.argvlist=[];return}if(this.static.lastInput=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.length){const[B,G]=this.input.renderer.argv;for(let X=0;X<Z.length;X++){const U=this.state.argvlist[X];if(B)U[B].value=Z[X]}return}const z=[];let q=0;for(let B of Z){const G={},[X,U]=this.input.renderer.argv;if(X)G[X]={value:B,type:"arg"};if(U)G[U]={value:q,type:"arg"};z.push(G),q++}this.state.argvlist=z}else if(Z instanceof Map){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!Z.size){console.warn("empty for loop <in> attribute Map value"),this.state.argvlist=[];return}if(this.static.lastInput=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.size){const[B,G,X]=this.input.renderer.argv;let U=0;for(let[K,F]of Z){const N=this.state.argvlist[U];if(B)N[B].value=K;if(G)N[G].value=F;U++}return}const z=[];let q=0;for(let[B,G]of Z){const X={},[U,K,F]=this.input.renderer.argv;if(U)X[U]={value:B,type:"arg"};if(K)X[K]={value:G,type:"arg"};if(F)X[F]={value:q,type:"arg"};z.push(X),q++}this.state.argvlist=z}else if(typeof Z=="object"){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!Object.keys(Z).length){console.warn("empty for loop <in> attribute Object value"),this.state.argvlist=[];return}this.static.lastInput=Z;const z=Object.keys(Z);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===z.length){const[G,X,U]=this.input.renderer.argv;for(let K=0;K<z.length;K++){const F=z[K],N=this.state.argvlist[K];if(G)N[G].value=F;if(X)N[X].value=Z[F]}return}const q=[];let B=0;for(let G in Z){const X={},[U,K,F]=this.input.renderer.argv;if(U)X[U]={value:G,type:"arg"};if(K)X[K]={value:Z[G],type:"arg"};if(F)X[F]={value:B,type:"arg"};q.push(X),B++}this.state.argvlist=q}}finally{this.static.processingBatch=!1}},updateItems(Z){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!Array.isArray(Z)||!this.state.argvlist)return;this.static.processingBatch=!0;try{const[J]=this.input.renderer?.argv;if(!J)return;for(let{index:W,value:z}of Z)if(W>=0&&W<this.state.argvlist.length)this.state.argvlist[W][J].value=z}finally{this.static.processingBatch=!1}},updateProperty(Z,J){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[Z])z[Z].value=typeof J==="function"?J(z[Z].value,W):J}}finally{this.static.processingBatch=!1}}},N8="<{input.renderer} #=state.argvlist/>";var g1={};u0(g1,{state:()=>{{return P8}},handler:()=>{{return S8}},default:()=>{{return E8}},declaration:()=>{{return C8}}});var C8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},P8={renderer:null,props:{}},S8={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((Z)=>{if(!this.input.then)return;this.state.renderer=this.input.then.renderer;const[J]=this.input.then.renderer.argv;this.state.props={[J]:{value:Z,type:"arg"}}}).catch((Z)=>{if(!this.input.catch)return;this.state.renderer=this.input.catch.renderer;const[J]=this.input.then.renderer.argv;this.state.props={[J]:{value:Z,type:"arg"}}})}},E8="<{state.renderer} #=state.props/>";var k1={};u0(k1,{state:()=>{{return T8}},handler:()=>{{return $8}},default:()=>{{return A8}},declaration:()=>{{return R8}}});var R8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},T8={renderer:null},$8={onInput(){let Z=[];for(let J of this.input.case)if(J.is==this.input.by||Array.isArray(J.is)&&J.is.includes(this.input.by))Array.isArray(J.is)?Z=[...new Set([...Z,...J.is])]:Z.push(J.is),this.state.renderer=J.renderer;if(!Z.includes(this.input.by))this.state.renderer=this.input.default?this.input.default.renderer:null}},A8="<{state.renderer}/>";var f1={};u0(f1,{state:()=>{{return x8}},handler:()=>{{return g8}},default:()=>{{return k8}},context:()=>{{return b8}},_static:()=>{{return _8}}});var h8=function(Z){const J={};return Z.split("&").map((z)=>{const[q,B]=z.split("=");J[q]=B}),J},x8={page:null,params:{},query:{}},_8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},b8=["navigate"],g8={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:Z,template:J,default:W})=>{if(W)this.static.defaultPath=Z;const z=Z.match(/:[^\/]*(\/|$)/gi)||[],q=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:J,default:W,pathVars:z,pathRegex:new RegExp(`${q}\$`,"i")}}),this.input.global){const Z=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&Z=="/"&&Z!==this.static.defaultPath?this.static.defaultPath:Z?Z+window.location.search:this.static.routes[0].path}},onAttach(){if(this.input.global)window.navigate=this.navigate.bind(this),window.addEventListener("popstate",(Z)=>Z.state&&this.navigate(Z.state.path,!0));this.setContext("navigate",this.navigate.bind(this)),this.static.defaultPath&&this.navigate(this.static.defaultPath)},navigate(Z,J){!J&&this.static.global&&history.pushState({path:Z},"",Z);const W=Z.split("?");Z=W[0];const z=W[1]?h8(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:Z,query:z}});const B=this.match(Z);if(!B){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",Z);return}const{route:G,params:X}=B;this.emit("after",{fromState:q,toState:{path:G.path,params:X,query:z}}),this.static.currentPath=Z,this.static.currentRoute=G,this.state.params=X,this.state.query=z,this.state.page=G.template},match(Z){const J={};let W=!1;for(let z of this.static.routes){const{pathVars:q,pathRegex:B}=z,G=Z.match(B);if(G!==null&&G.index===0){for(let X=0;X+1<G.length&&X<q.length;X++)J[q[X].replaceAll(/[\/:]/g,"")]=G[X+1];W=z;break}}return W?{route:W,params:J}:!1}},k8="<{state.page} params=state.params query=state.query/>";class v0{debug=!1;store={};__root;i18n=new r0;watcher;IUC;__setContext;__getContext;constructor(Z){if(Z?.debug)this.debug=Z.debug;this.watcher=new a0,this.IUC=new t0;const[J,W]=y0(Z?.context||{});this.__setContext=W,this.__getContext=J,this.register("if",b1),this.register("for",h1),this.register("async",g1),this.register("switch",k1),this.register("router",f1)}register(Z,J){return this.store[Z]=J,this}unregister(Z){return delete this.store[Z],this}has(Z){return Z in this.store}import(Z){if(!this.has(Z))throw new Error(`<${Z}> component not found`);if(!this.store[Z].declaration?.syntax&&!this.store[Z].default)throw new Error(`Invalid <${Z}> component`);return this.store[Z]}render(Z,J,W){const{default:z,...q}=J,B={debug:this.debug,prepath:"0",lips:this},G=new p0(Z,z||"",{...q,input:W},B);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(Z,J){return this.__root=this.render("__ROOT__",Z),this.__root.appendTo(J),this.__root}language(Z){this.i18n.setLang(Z)&&this.__root?.rerender()}setContext(Z,J){const W=this.__getContext();if(typeof Z==="string"){const z={...W,[Z]:J};H0(W,z)&&this.__setContext(z)}else if(!Array.isArray(Z)){const z={...W,...Z};H0(W,z)&&this.__setContext(z)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(Z,J){if(!Z.length)return;D1(()=>{const W=this.__getContext();if(!W)return;const z=Object.fromEntries(Z.map((q)=>[q,W[q]]));z&&typeof J==="function"&&Object.keys(z).length&&J(z)})}dispose(){this.watcher?.dispose(),this.__root?.destroy()}}function f8(Z="body"){const J={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 U=performance.now();if(this.static.lastFrameTimestamp){const K=U-this.static.lastFrameTimestamp;if(K<1000){if(this.static.updateTimes.push(K),this.static.updateTimes.length>100)this.static.updateTimes.shift()}}this.static.lastFrameTimestamp=U,this.static.frameCount++},startPerformanceTracking(){this.static.frameCountInterval=setInterval(()=>{if(this.state.metrics.fps=this.static.frameCount,this.static.frameCount=0,this.static.updateTimes.length){const U=this.static.updateTimes.reduce((K,F)=>K+F,0)/this.static.updateTimes.length;this.state.metrics.avgRenderTime=U}if(window.performance&&window.performance.memory)this.state.metrics.memoryUsageMB=window.performance.memory.usedJSHeapSize/1048576},1000)},startStressTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.counterHistory=[],this.static.updateInterval=setInterval(()=>{if(this.state.counter++,this.state.metrics.totalUpdates++,this.state.counterHistory.length>100)this.state.counterHistory.shift();this.state.counterHistory.push(this.state.counter)},this.state.updateFrequency)},stopStressTest(){if(!this.state.isRunning)return;clearInterval(this.static.updateInterval),this.state.isRunning=!1},setUpdateFrequency(U){const K=parseFloat(U.target.value);if(this.state.updateFrequency=K,this.state.isRunning)this.stopStressTest(),this.startStressTest()},resetCounter(){this.state.counter=0,this.state.counterHistory=[],this.state.metrics.totalUpdates=0},runHeavyComputation(){const U=performance.now();let K=0;for(let F=0;F<1e7;F++)K+=Math.sqrt(F);console.log(`Heavy computation completed in ${performance.now()-U}ms, result: ${K}`)},destroy(){clearInterval(this.static.updateInterval),clearInterval(this.static.frameCountInterval)}},X=new v0({debug:!0}).render("StressTestApp",{default:`
|
|
1
|
+
var JJ=Object.create;var{defineProperty:$1,getPrototypeOf:ZJ,getOwnPropertyNames:QJ}=Object;var WJ=Object.prototype.hasOwnProperty;var R1=(J,Z,W)=>{W=J!=null?JJ(ZJ(J)):{};const z=Z||!J||!J.__esModule?$1(W,"default",{value:J,enumerable:!0}):W;for(let q of QJ(J))if(!WJ.call(z,q))$1(z,q,{get:()=>J[q],enumerable:!0});return z};var XJ=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var d0=(J,Z)=>{for(var W in Z)$1(J,W,{get:Z[W],enumerable:!0,configurable:!0,set:(z)=>Z[W]=()=>z})};var J1=XJ((a1,e1)=>{(function(){var J=document,Z=window,W=J.documentElement,z=J.createElement.bind(J),q=z("div"),B=z("table"),G=z("tbody"),X=z("tr"),U=Array.isArray,K=Array.prototype,j=K.concat,C=K.filter,b=K.indexOf,A=K.map,u=K.push,i=K.slice,e=K.some,l=K.splice,c=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,k=/<.+>/,y=/^\w+$/;function T(Q,H){var Y=r(H);return!Q||!Y&&!E(H)&&!P(H)?[]:!Y&&d.test(Q)?H.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!Y&&y.test(Q)?H.getElementsByTagName(Q):H.querySelectorAll(Q)}var O=function(){function Q(H,Y){if(!H)return;if(L(H))return H;var M=H;if($(H)){var I=Y||J;if(M=c.test(H)&&E(I)?I.getElementById(H.slice(1).replace(/\\/g,"")):k.test(H)?v1(H):L(I)?I.find(H):$(I)?D(I).find(H):T(H,I),!M)return}else if(N(H))return this.ready(H);if(M.nodeType||M===Z)M=[M];this.length=M.length;for(var S=0,g=this.length;S<g;S++)this[S]=M[S]}return Q.prototype.init=function(H,Y){return new Q(H,Y)},Q}(),w=O.prototype,D=w.init;if(D.fn=D.prototype=w,w.length=0,w.splice=l,typeof Symbol==="function")w[Symbol.iterator]=K[Symbol.iterator];function L(Q){return Q instanceof O}function V(Q){return!!Q&&Q===Q.window}function E(Q){return!!Q&&Q.nodeType===9}function r(Q){return!!Q&&Q.nodeType===11}function P(Q){return!!Q&&Q.nodeType===1}function x(Q){return!!Q&&Q.nodeType===3}function v(Q){return typeof Q==="boolean"}function N(Q){return typeof Q==="function"}function $(Q){return typeof Q==="string"}function _(Q){return Q===void 0}function R(Q){return Q===null}function F(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function f(Q){if(typeof Q!=="object"||Q===null)return!1;var H=Object.getPrototypeOf(Q);return H===null||H===Object.prototype}D.isWindow=V,D.isFunction=N,D.isArray=U,D.isNumeric=F,D.isPlainObject=f;function h(Q,H,Y){if(Y){var M=Q.length;while(M--)if(H.call(Q[M],M,Q[M])===!1)return Q}else if(f(Q)){var I=Object.keys(Q);for(var M=0,S=I.length;M<S;M++){var g=I[M];if(H.call(Q[g],g,Q[g])===!1)return Q}}else for(var M=0,S=Q.length;M<S;M++)if(H.call(Q[M],M,Q[M])===!1)return Q;return Q}D.each=h,w.each=function(Q){return h(this,Q)},w.empty=function(){return this.each(function(Q,H){while(H.firstChild)H.removeChild(H.firstChild)})};function o(){var Q=[];for(var H=0;H<arguments.length;H++)Q[H]=arguments[H];var Y=v(Q[0])?Q.shift():!1,M=Q.shift(),I=Q.length;if(!M)return{};if(!I)return o(Y,D,M);for(var S=0;S<I;S++){var g=Q[S];for(var m in g)if(Y&&(U(g[m])||f(g[m]))){if(!M[m]||M[m].constructor!==g[m].constructor)M[m]=new g[m].constructor;o(Y,M[m],g[m])}else M[m]=g[m]}return M}D.extend=o,w.extend=function(Q){return o(w,Q)};var s=/\S+/g;function p(Q){return $(Q)?Q.match(s)||[]:[]}w.toggleClass=function(Q,H){var Y=p(Q),M=!_(H);return this.each(function(I,S){if(!P(S))return;h(Y,function(g,m){if(M)H?S.classList.add(m):S.classList.remove(m);else S.classList.toggle(m)})})},w.addClass=function(Q){return this.toggleClass(Q,!0)},w.removeAttr=function(Q){var H=p(Q);return this.each(function(Y,M){if(!P(M))return;h(H,function(I,S){M.removeAttribute(S)})})};function D0(Q,H){if(!Q)return;if($(Q)){if(arguments.length<2){if(!this[0]||!P(this[0]))return;var Y=this[0].getAttribute(Q);return R(Y)?void 0:Y}if(_(H))return this;if(R(H))return this.removeAttr(Q);return this.each(function(I,S){if(!P(S))return;S.setAttribute(Q,H)})}for(var M in Q)this.attr(M,Q[M]);return this}w.attr=D0,w.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},w.hasClass=function(Q){return!!Q&&e.call(this,function(H){return P(H)&&H.classList.contains(Q)})},w.get=function(Q){if(_(Q))return i.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},w.eq=function(Q){return D(this.get(Q))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)};function J0(Q){if(_(Q))return this.get().map(function(H){return P(H)||x(H)?H.textContent:""}).join("");return this.each(function(H,Y){if(!P(Y))return;Y.textContent=Q})}w.text=J0;function n(Q,H,Y){if(!P(Q))return;var M=Z.getComputedStyle(Q,null);return Y?M.getPropertyValue(H)||void 0:M[H]||Q.style[H]}function z0(Q,H){return parseInt(n(Q,H),10)||0}function u0(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 $0={};function C0(Q){if($0[Q])return $0[Q];var H=z(Q);J.body.insertBefore(H,null);var Y=n(H,"display");return J.body.removeChild(H),$0[Q]=Y!=="none"?Y:"block"}function K0(Q){return n(Q,"display")==="none"}function _0(Q,H){var Y=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!Y&&!!H&&Y.call(Q,H)}function R0(Q){return $(Q)?function(H,Y){return _0(Y,Q)}:N(Q)?Q:L(Q)?function(H,Y){return Q.is(Y)}:!Q?function(){return!1}:function(H,Y){return Y===Q}}w.filter=function(Q){var H=R0(Q);return D(C.call(this,function(Y,M){return H.call(Y,M,Y)}))};function S0(Q,H){return!H?Q:Q.filter(H)}w.detach=function(Q){return S0(this,Q).each(function(H,Y){if(Y.parentNode)Y.parentNode.removeChild(Y)}),this};var $5=/^\s*<(\w+)[^>]*>/,R5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,y1={"*":q,tr:G,td:X,th:X,thead:B,tbody:B,tfoot:B};function v1(Q){if(!$(Q))return[];if(R5.test(Q))return[z(RegExp.$1)];var H=$5.test(Q)&&RegExp.$1,Y=y1[H]||y1["*"];return Y.innerHTML=Q,D(Y.childNodes).detach().get()}D.parseHTML=v1,w.has=function(Q){var H=$(Q)?function(Y,M){return T(Q,M).length}:function(Y,M){return M.contains(Q)};return this.filter(H)},w.not=function(Q){var H=R0(Q);return this.filter(function(Y,M){return(!$(Q)||P(M))&&!H.call(M,Y,M)})};function F0(Q,H,Y,M){var I=[],S=N(H),g=M&&R0(M);for(var m=0,U0=Q.length;m<U0;m++)if(S){var W0=H(Q[m]);if(W0.length)u.apply(I,W0)}else{var Y0=Q[m][H];while(Y0!=null){if(M&&g(-1,Y0))break;I.push(Y0),Y0=Y?Y0[H]:null}}return I}function m1(Q){if(Q.multiple&&Q.options)return F0(C.call(Q.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return Q.value||""}function T5(Q){if(!arguments.length)return this[0]&&m1(this[0]);return this.each(function(H,Y){var M=Y.multiple&&Y.options;if(M||t1.test(Y.type)){var I=U(Q)?A.call(Q,String):R(Q)?[]:[String(Q)];if(M)h(Y.options,function(S,g){g.selected=I.indexOf(g.value)>=0},!0);else Y.checked=I.indexOf(Y.value)>=0}else Y.value=_(Q)||R(Q)?"":Q})}w.val=T5,w.is=function(Q){var H=R0(Q);return e.call(this,function(Y,M){return H.call(Y,M,Y)})},D.guid=1;function j0(Q){return Q.length>1?C.call(Q,function(H,Y,M){return b.call(M,H)===Y}):Q}D.unique=j0,w.add=function(Q,H){return D(j0(this.get().concat(D(Q,H).get())))},w.children=function(Q){return S0(D(j0(F0(this,function(H){return H.children}))),Q)},w.parent=function(Q){return S0(D(j0(F0(this,"parentNode"))),Q)},w.index=function(Q){var H=Q?D(Q)[0]:this[0],Y=Q?this:D(H).parent().children();return b.call(Y,H)},w.closest=function(Q){var H=this.filter(Q);if(H.length)return H;var Y=this.parent();if(!Y.length)return H;return Y.closest(Q)},w.siblings=function(Q){return S0(D(j0(F0(this,function(H){return D(H).parent().children().not(H)}))),Q)},w.find=function(Q){return D(j0(F0(this,function(H){return T(Q,H)})))};var A5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,_5=/^$|^module$|\/(java|ecma)script/i,x5=["type","src","nonce","noModule"];function b5(Q,H){var Y=D(Q);Y.filter("script").add(Y.find("script")).each(function(M,I){if(_5.test(I.type)&&W.contains(I)){var S=z("script");S.text=I.textContent.replace(A5,""),h(x5,function(g,m){if(I[m])S[m]=I[m]}),H.head.insertBefore(S,null),H.head.removeChild(S)}})}function h5(Q,H,Y,M,I){if(M)Q.insertBefore(H,Y?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(H,Q);else Q.parentNode.insertBefore(H,Y?Q:Q.nextSibling);if(I)b5(H,Q.ownerDocument)}function P0(Q,H,Y,M,I,S,g,m){return h(Q,function(U0,W0){h(D(W0),function(Y0,T0){h(D(H),function(O0,s0){var C1=Y?T0:s0,S1=Y?s0:T0,B0=Y?Y0:O0;h5(C1,!B0?S1:S1.cloneNode(!0),M,I,!B0)},m)},g)},S),H}w.after=function(){return P0(arguments,this,!1,!1,!1,!0,!0)},w.append=function(){return P0(arguments,this,!1,!1,!0)};function g5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if(_(Q))return this;var H=/<script[\s>]/.test(Q);return this.each(function(Y,M){if(!P(M))return;if(H)D(M).empty().append(Q);else M.innerHTML=Q})}w.html=g5,w.appendTo=function(Q){return P0(arguments,this,!0,!1,!0)},w.wrapInner=function(Q){return this.each(function(H,Y){var M=D(Y),I=M.contents();I.length?I.wrapAll(Q):M.append(Q)})},w.before=function(){return P0(arguments,this,!1,!0)},w.wrapAll=function(Q){var H=D(Q),Y=H[0];while(Y.children.length)Y=Y.firstElementChild;return this.first().before(H),this.appendTo(Y)},w.wrap=function(Q){return this.each(function(H,Y){var M=D(Q)[0];D(Y).wrapAll(!H?M:M.cloneNode(!0))})},w.insertAfter=function(Q){return P0(arguments,this,!0,!1,!1,!1,!1,!0)},w.insertBefore=function(Q){return P0(arguments,this,!0,!0)},w.prepend=function(){return P0(arguments,this,!1,!0,!0,!0,!0)},w.prependTo=function(Q){return P0(arguments,this,!0,!0,!0,!1,!1,!0)},w.contents=function(){return D(j0(F0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},w.next=function(Q,H,Y){return S0(D(j0(F0(this,"nextElementSibling",H,Y))),Q)},w.nextAll=function(Q){return this.next(Q,!0)},w.nextUntil=function(Q,H){return this.next(H,!0,Q)},w.parents=function(Q,H){return S0(D(j0(F0(this,"parentElement",!0,H))),Q)},w.parentsUntil=function(Q,H){return this.parents(H,Q)},w.prev=function(Q,H,Y){return S0(D(j0(F0(this,"previousElementSibling",H,Y))),Q)},w.prevAll=function(Q){return this.prev(Q,!0)},w.prevUntil=function(Q,H){return this.prev(H,!0,Q)},w.map=function(Q){return D(j.apply([],A.call(this,function(H,Y){return Q.call(H,Y,H)})))},w.clone=function(){return this.map(function(Q,H){return H.cloneNode(!0)})},w.offsetParent=function(){return this.map(function(Q,H){var Y=H.offsetParent;while(Y&&n(Y,"position")==="static")Y=Y.offsetParent;return Y||W})},w.slice=function(Q,H){return D(i.call(this,Q,H))};var f5=/-([a-z])/g;function D1(Q){return Q.replace(f5,function(H,Y){return Y.toUpperCase()})}w.ready=function(Q){var H=function(){return setTimeout(Q,0,D)};if(J.readyState!=="loading")H();else J.addEventListener("DOMContentLoaded",H);return this},w.unwrap=function(){return this.parent().each(function(Q,H){if(H.tagName==="BODY")return;var Y=D(H);Y.replaceWith(Y.children())}),this},w.offset=function(){var Q=this[0];if(!Q)return;var H=Q.getBoundingClientRect();return{top:H.top+Z.pageYOffset,left:H.left+Z.pageXOffset}},w.position=function(){var Q=this[0];if(!Q)return;var H=n(Q,"position")==="fixed",Y=H?Q.getBoundingClientRect():this.offset();if(!H){var M=Q.ownerDocument,I=Q.offsetParent||M.documentElement;while((I===M.body||I===M.documentElement)&&n(I,"position")==="static")I=I.parentNode;if(I!==Q&&P(I)){var S=D(I).offset();Y.top-=S.top+z0(I,"borderTopWidth"),Y.left-=S.left+z0(I,"borderLeftWidth")}}return{top:Y.top-z0(Q,"marginTop"),left:Y.left-z0(Q,"marginLeft")}};var u1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};w.prop=function(Q,H){if(!Q)return;if($(Q)){if(Q=u1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(M,I){I[Q]=H})}for(var Y in Q)this.prop(Y,Q[Y]);return this},w.removeProp=function(Q){return this.each(function(H,Y){delete Y[u1[Q]||Q]})};var k5=/^--/;function j1(Q){return k5.test(Q)}var F1={},y5=q.style,v5=["webkit","moz","ms"];function m5(Q,H){if(H===void 0)H=j1(Q);if(H)return Q;if(!F1[Q]){var Y=D1(Q),M="".concat(Y[0].toUpperCase()).concat(Y.slice(1)),I="".concat(Y," ").concat(v5.join("".concat(M," "))).concat(M).split(" ");h(I,function(S,g){if(g in y5)return F1[Q]=g,!1})}return F1[Q]}var u5={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 d1(Q,H,Y){if(Y===void 0)Y=j1(Q);return!Y&&!u5[Q]&&F(H)?"".concat(H,"px"):H}function d5(Q,H){if($(Q)){var Y=j1(Q);if(Q=m5(Q,Y),arguments.length<2)return this[0]&&n(this[0],Q,Y);if(!Q)return this;return H=d1(Q,H,Y),this.each(function(I,S){if(!P(S))return;if(Y)S.style.setProperty(Q,H);else S.style[Q]=H})}for(var M in Q)this.css(M,Q[M]);return this}w.css=d5;function i1(Q,H){try{return Q(H)}catch(Y){return H}}var i5=/^\s+|\s+$/;function c1(Q,H){var Y=Q.dataset[H]||Q.dataset[D1(H)];if(i5.test(Y))return Y;return i1(JSON.parse,Y)}function c5(Q,H,Y){Y=i1(JSON.stringify,Y),Q.dataset[D1(H)]=Y}function p5(Q,H){if(!Q){if(!this[0])return;var Y={};for(var M in this[0].dataset)Y[M]=c1(this[0],M);return Y}if($(Q)){if(arguments.length<2)return this[0]&&c1(this[0],Q);if(_(H))return this;return this.each(function(I,S){c5(S,Q,H)})}for(var M in Q)this.data(M,Q[M]);return this}w.data=p5;function p1(Q,H){var Y=Q.documentElement;return Math.max(Q.body["scroll".concat(H)],Y["scroll".concat(H)],Q.body["offset".concat(H)],Y["offset".concat(H)],Y["client".concat(H)])}h([!0,!1],function(Q,H){h(["Width","Height"],function(Y,M){var I="".concat(H?"outer":"inner").concat(M);w[I]=function(S){if(!this[0])return;if(V(this[0]))return H?this[0]["inner".concat(M)]:this[0].document.documentElement["client".concat(M)];if(E(this[0]))return p1(this[0],M);return this[0]["".concat(H?"offset":"client").concat(M)]+(S&&H?z0(this[0],"margin".concat(Y?"Top":"Left"))+z0(this[0],"margin".concat(Y?"Bottom":"Right")):0)}})}),h(["Width","Height"],function(Q,H){var Y=H.toLowerCase();w[Y]=function(M){if(!this[0])return _(M)?void 0:this;if(!arguments.length){if(V(this[0]))return this[0].document.documentElement["client".concat(H)];if(E(this[0]))return p1(this[0],H);return this[0].getBoundingClientRect()[Y]-u0(this[0],!Q)}var I=parseInt(M,10);return this.each(function(S,g){if(!P(g))return;var m=n(g,"boxSizing");g.style[Y]=d1(Y,I+(m==="border-box"?u0(g,!Q):0))})}});var o1="___cd";w.toggle=function(Q){return this.each(function(H,Y){if(!P(Y))return;var M=K0(Y),I=_(Q)?M:Q;if(I){if(Y.style.display=Y[o1]||"",K0(Y))Y.style.display=C0(Y.tagName)}else if(!M)Y[o1]=n(Y,"display"),Y.style.display="none"})},w.hide=function(){return this.toggle(!1)},w.show=function(){return this.toggle(!0)};var s1="___ce",I1=".",L1={focus:"focusin",blur:"focusout"},l1={mouseenter:"mouseover",mouseleave:"mouseout"},o5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function V1(Q){return l1[Q]||L1[Q]||Q}function N1(Q){var H=Q.split(I1);return[H[0],H.slice(1).sort()]}w.trigger=function(Q,H){if($(Q)){var Y=N1(Q),M=Y[0],I=Y[1],S=V1(M);if(!S)return this;var g=o5.test(S)?"MouseEvents":"HTMLEvents";Q=J.createEvent(g),Q.initEvent(S,!0,!0),Q.namespace=I.join(I1),Q.___ot=M}Q.___td=H;var m=Q.___ot in L1;return this.each(function(U0,W0){if(m&&N(W0[Q.___ot]))W0["___i".concat(Q.type)]=!0,W0[Q.___ot](),W0["___i".concat(Q.type)]=!1;W0.dispatchEvent(Q)})};function r1(Q){return Q[s1]=Q[s1]||{}}function s5(Q,H,Y,M,I){var S=r1(Q);S[H]=S[H]||[],S[H].push([Y,M,I]),Q.addEventListener(H,I)}function n1(Q,H){return!H||!e.call(H,function(Y){return Q.indexOf(Y)<0})}function o0(Q,H,Y,M,I){var S=r1(Q);if(!H)for(H in S)o0(Q,H,Y,M,I);else if(S[H])S[H]=S[H].filter(function(g){var m=g[0],U0=g[1],W0=g[2];if(I&&W0.guid!==I.guid||!n1(m,Y)||M&&M!==U0)return!0;Q.removeEventListener(H,W0)})}w.off=function(Q,H,Y){var M=this;if(_(Q))this.each(function(S,g){if(!P(g)&&!E(g)&&!V(g))return;o0(g)});else if(!$(Q))for(var I in Q)this.off(I,Q[I]);else{if(N(H))Y=H,H="";h(p(Q),function(S,g){var m=N1(g),U0=m[0],W0=m[1],Y0=V1(U0);M.each(function(T0,O0){if(!P(O0)&&!E(O0)&&!V(O0))return;o0(O0,Y0,W0,H,Y)})})}return this},w.remove=function(Q){return S0(this,Q).detach().off(),this},w.replaceWith=function(Q){return this.before(Q).remove()},w.replaceAll=function(Q){return D(Q).replaceWith(this),this};function l5(Q,H,Y,M,I){var S=this;if(!$(Q)){for(var g in Q)this.on(g,H,Y,Q[g],I);return this}if(!$(H))if(_(H)||R(H))H="";else if(_(Y))Y=H,H="";else M=Y,Y=H,H="";if(!N(M))M=Y,Y=void 0;if(!M)return this;return h(p(Q),function(m,U0){var W0=N1(U0),Y0=W0[0],T0=W0[1],O0=V1(Y0),s0=Y0 in l1,C1=Y0 in L1;if(!O0)return;S.each(function(S1,B0){if(!P(B0)&&!E(B0)&&!V(B0))return;var P1=function(X0){if(X0.target["___i".concat(X0.type)])return X0.stopImmediatePropagation();if(X0.namespace&&!n1(T0,X0.namespace.split(I1)))return;if(!H&&(C1&&(X0.target!==B0||X0.___ot===O0)||s0&&X0.relatedTarget&&B0.contains(X0.relatedTarget)))return;var E1=B0;if(H){var x0=X0.target;while(!_0(x0,H)){if(x0===B0)return;if(x0=x0.parentNode,!x0)return}E1=x0}Object.defineProperty(X0,"currentTarget",{configurable:!0,get:function(){return E1}}),Object.defineProperty(X0,"delegateTarget",{configurable:!0,get:function(){return B0}}),Object.defineProperty(X0,"data",{configurable:!0,get:function(){return Y}});var e5=M.call(E1,X0,X0.___td);if(I)o0(B0,O0,T0,H,P1);if(e5===!1)X0.preventDefault(),X0.stopPropagation()};P1.guid=M.guid=M.guid||D.guid++,s5(B0,O0,T0,H,P1)})}),this}w.on=l5;function r5(Q,H,Y,M){return this.on(Q,H,Y,M,!0)}w.one=r5;var n5=/\r?\n/g;function t5(Q,H){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(H.replace(n5,"\r\n")))}var a5=/file|reset|submit|button|image/i,t1=/radio|checkbox/i;if(w.serialize=function(){var Q="";return this.each(function(H,Y){h(Y.elements||[Y],function(M,I){if(I.disabled||!I.name||I.tagName==="FIELDSET"||a5.test(I.type)||t1.test(I.type)&&!I.checked)return;var S=m1(I);if(!_(S)){var g=U(S)?S:[S];h(g,function(m,U0){Q+=t5(I.name,U0)})}})}),Q.slice(1)},typeof a1!=="undefined")e1.exports=D;else Z.cash=Z.$=D})()});class l0{default=window.navigator.language;LANGUAGE_DICTIONARIES={};setLang(J){if(this.default!==J)return this.default=J,!0;return!1}setDictionary(J,Z){this.LANGUAGE_DICTIONARIES[J]=Z}translate(J,Z){if(Z&&this.default==Z)return{text:J,lang:this.default};Z=Z||this.default;const[W,z]=Z.split("-");if(this.LANGUAGE_DICTIONARIES[W]&&J in this.LANGUAGE_DICTIONARIES[W]){if(typeof this.LANGUAGE_DICTIONARIES[W][J]==="object"){const q=this.LANGUAGE_DICTIONARIES[W][J];J=q[z||"*"]||q["*"]}else if(typeof this.LANGUAGE_DICTIONARIES[W][J]==="string")J=this.LANGUAGE_DICTIONARIES[W][J]}return{text:J,lang:Z}}format(J,Z,W){const{text:z}=this.translate(J,W);return z.replace(/{(\w+)}/g,(q,B)=>Z[B]||"")}}class r0{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 n0{subscriptions=new Map;tick=new r0;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((U,K)=>G.set(K,B(U)));else if(Array.isArray(G))G.forEach((U,K)=>G[K]=B(U));else if(typeof G==="object")Object.entries(G).forEach(([U,K])=>G[U]=B(K));let X=new Proxy(G,{get(U,K){if(K==="toJSON")return function(){const C=(b)=>{if(!b||typeof b!=="object")return b;if(z.has(b)){const A=z.get(b);if(A instanceof Map){const i={};return A.forEach((e,l)=>i[typeof l==="object"?JSON.stringify(l):String(l)]=C(e)),i}if(Array.isArray(A))return A.map((i)=>C(i));const u={};return Object.entries(A).forEach(([i,e])=>u[i]=C(e)),u}if(typeof b.toJSON==="function"&&!z.has(b))return b.toJSON();return b};return C(X)};if(K==="reset")return function(){X=null};const j=U[K];if(G instanceof Map&&typeof j==="function")return function(...C){const b=K.toString();if(b==="set"&&C.length>=2)C[1]=B(C[1]);const A=j.apply(U,C);return["set","delete","clear"].includes(b)&&W.queueUpdate(J),A};if(Array.isArray(G)&&typeof j==="function")return function(...C){const b=K.toString();if(["push","unshift"].includes(b))C=C.map((u)=>B(u));else if(b==="splice"&&C.length>2)C=[C[0],C[1],...C.slice(2).map((u)=>B(u))];const A=j.apply(U,C);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(b)&&W.queueUpdate(J),A};return j},set(U,K,j){if(U[K]===j)return!0;if(j instanceof Map&&U[K]instanceof Map){const C=U[K];return C.clear(),j.forEach((b,A)=>C.set(A,B(b))),W.queueUpdate(J),!0}return U[K]=B(j),W.queueUpdate(J),!0}});return z.set(X,G),X},B=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Z)}}class t0{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 a0{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 e0{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 T1=R1(J1(),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(J5(J)&&J5(Z)){for(let G of J)if(!Z.has(G))return!0;return!1}const B=new WeakMap;for(let G of J){let X=!1;if(typeof G!=="object"){if(Z.has(G))X=!0}else for(let U of Z){if(typeof U!=="object")continue;if(!B.has(G))B.set(G,new WeakMap);const K=B.get(G);if(K.has(U)){if(X=K.get(U),X)break;continue}const j=!H0(G,U);if(K.set(U,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(Z5(J)&&Z5(Z)){for(let[G,X]of J)if(Z.get(G)!==X)return!0;return!1}const B=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 U=!1,K=!1;for(let[j,C]of Z){if(typeof j!=="object")continue;if(!B.has(G))B.set(G,new WeakMap);const b=B.get(G);if(b.has(j)){const[A,u]=b.get(j);if(A){U=!0,K=u;break}continue}if(!H0(G,j)){if(U=!0,K=typeof X==="object"&&typeof C==="object"?!H0(X,C):X===C,b.set(j,[!0,K]),K)break}else b.set(j,[!1,!1])}if(!U||!K)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Z))return!0;if(J.length!==Z.length)return!0;for(let B=0;B<J.length;B++){const G=J[B],X=Z[B];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 B=0;B<q;B++)if(W[B]!==z[B])return!0;for(let B=0;B<q;B++){const G=W[B],X=J[G],U=Z[G];if(X===U)continue;if(X instanceof Date){if(!(U instanceof Date)||String(X)!==String(U))return!0;continue}if(X instanceof RegExp){if(!(U instanceof RegExp)||X.source!==U.source||X.flags!==U.flags)return!0;continue}if(X instanceof Map){if(!(U instanceof Map)||H0(X,U))return!0;continue}if(X instanceof Set){if(!(U instanceof Set)||H0(X,U))return!0;continue}if(X instanceof Function){if(!(U instanceof Function))return!0;continue}if(typeof X==="object"){if(typeof U!=="object")return!0;if(X===J){if(U!==Z)return!0}else if(H0(X,U))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),U=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let K=0;K<X.length;K++)if(X[K]!==U[K])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 B=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(Z);if(B.length!==G.length)return!1;for(let X of B){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),U=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(X.length!==U.length)return!1;for(let K of X){if(K==="constructor")continue;if(!E0(q[K],Object.getPrototypeOf(Z)[K]))return!1}}return!0}function J5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function Z5(J){for(let[Z,W]of J)if(typeof Z==="object"&&Z!==null||typeof W==="object"&&W!==null)return!1;return!0}function Z0(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((B,G)=>q.set(Z0(G,Z),Z0(B,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((B)=>q.add(Z0(B,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let B=0;B<J.length;B++)q[B]=Z0(J[B],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]=Z0(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))W[q]=Z0(J[q],Z);return W}function W5(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,B,G){const X=B.split(/\.|\[|\]/).filter(Boolean);let U=q;for(let K=0;K<X.length;K++){const j=X[K],C=!isNaN(Number(j)),b=K===X.length-1,A=!isNaN(Number(X[K+1]));if(b){U[j]=G;continue}if(!(j in U))U[j]=A?[]:{};else if(A&&!Array.isArray(U[j]))U[j]=[];else if(!A&&Array.isArray(U[j]))U[j]={};U=U[j]}}const z=Z0(J);try{for(let[q,B]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,B)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return z}var I0="syn:",M0="fn:",A0="on-",a=/^\.\.\./,Z1=/^\[(.*?)\]$/,Q5=["@html","@text"];T1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&T1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class Q1{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,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=Z0(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={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},B={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(J),console.table(Z),console.table(W),console.table(z),console.table(q),console.table(B),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return Z0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var t=R1(J1(),1);var C5=R1(J1(),1);var W1="comm",X1="rule",H1="decl";var X5="@import";var H5="@namespace",z5="@keyframes";var q5="@layer";function z1(J){return J.trim()}function b0(J,Z,W){return J.replace(Z,W)}function Y5(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 q1(J){return J.length}function h0(J,Z){return Z.push(J),J}var A1=Math.abs,i0=String.fromCharCode;function B1(J,Z,W,z,q,B,G,X){return{value:J,root:Z,parent:W,type:z,props:q,children:B,line:Y1,column:g0,length:G,return:"",siblings:X}}function G5(){return Q0}function w5(){if(Q0=G0>0?L0(k0,--G0):0,g0--,Q0===10)g0=1,Y1--;return Q0}function w0(){if(Q0=G0<B5?L0(k0,G0++):0,g0++,Q0===10)g0=1,Y1++;return Q0}function N0(){return L0(k0,G0)}function c0(){return G0}function G1(J,Z){return V0(k0,J,Z)}function f0(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 K5(J){return Y1=g0=1,B5=q0(k0=J),G0=0,[]}function U5(J){return k0="",J}function w1(J){return z1(G1(G0-1,_1(J===91?J+2:J===40?J+1:J)))}function O5(J){while(Q0=N0())if(Q0<33)w0();else break;return f0(J)>2||f0(Q0)>3?"":" "}function M5(J,Z){while(--Z&&w0())if(Q0<48||Q0>102||Q0>57&&Q0<65||Q0>70&&Q0<97)break;return G1(J,c0()+(Z<6&&N0()==32&&w0()==32))}function _1(J){while(w0())switch(Q0){case J:return G0;case 34:case 39:if(J!==34&&J!==39)_1(Q0);break;case 40:if(J===41)_1(J);break;case 92:w0();break}return G0}function D5(J,Z){while(w0())if(J+Q0===57)break;else if(J+Q0===84&&N0()===47)break;return"/*"+G1(Z,G0-1)+"*"+i0(J===47?J:w0())}function j5(J){while(!f0(N0()))w0();return G1(J,G0)}var Y1=1,g0=1,B5=0,G0=0,Q0=0,k0="";function L5(J){return U5(K1("",null,null,null,[""],J=K5(J),0,[0],J))}function K1(J,Z,W,z,q,B,G,X,U){var K=0,j=0,C=G,b=0,A=0,u=0,i=1,e=1,l=1,c=0,d="",k=q,y=B,T=z,O=d;while(e)switch(u=c,c=w0()){case 40:if(u!=108&&L0(O,C-1)==58){if(Y5(O+=b0(w1(c),"&","&\f"),"&\f",A1(K?X[K-1]:0))!=-1)l=-1;break}case 34:case 39:case 91:O+=w1(c);break;case 9:case 10:case 13:case 32:O+=O5(u);break;case 92:O+=M5(c0()-1,7);continue;case 47:switch(N0()){case 42:case 47:if(h0(zJ(D5(w0(),c0()),Z,W,U),U),(f0(u||1)==5||f0(N0()||1)==5)&&q0(O)&&V0(O,-1,void 0)!==" ")O+=" ";break;default:O+="/"}break;case 123*i:X[K++]=q0(O)*l;case 125*i:case 59:case 0:switch(c){case 0:case 125:e=0;case 59+j:if(l==-1)O=b0(O,/\f/g,"");if(A>0&&(q0(O)-C||i===0&&u===47))h0(A>32?I5(O+";",z,W,C-1,U):I5(b0(O," ","")+";",z,W,C-2,U),U);break;case 59:O+=";";default:if(h0(T=F5(O,Z,W,K,j,q,X,d,k=[],y=[],C,B),B),c===123)if(j===0)K1(O,Z,T,T,k,B,C,X,y);else{switch(b){case 99:if(L0(O,3)===110)break;case 108:if(L0(O,2)===97)break;default:j=0;case 100:case 109:case 115:}if(j)K1(J,T,T,z&&h0(F5(J,T,T,0,0,q,X,d,q,k=[],C,y),y),q,y,C,X,z?k:y);else K1(O,T,T,T,[""],y,0,X,y)}}K=j=A=0,i=l=1,d=O="",C=G;break;case 58:C=1+q0(O),A=u;default:if(i<1){if(c==123)--i;else if(c==125&&i++==0&&w5()==125)continue}switch(O+=i0(c),c*i){case 38:l=j>0?1:(O+="\f",-1);break;case 44:X[K++]=(q0(O)-1)*l,l=1;break;case 64:if(N0()===45)O+=w1(w0());b=N0(),j=C=q0(d=O+=j5(c0())),c++;break;case 45:if(u===45&&q0(O)==2)i=0}}return B}function F5(J,Z,W,z,q,B,G,X,U,K,j,C){var b=q-1,A=q===0?B:[""],u=q1(A);for(var i=0,e=0,l=0;i<z;++i)for(var c=0,d=V0(J,b+1,b=A1(e=G[i])),k=J;c<u;++c)if(k=z1(e>0?A[c]+" "+d:b0(d,/&\f/g,A[c])))U[l++]=k;return B1(J,Z,W,q===0?X1:X,U,K,j,C)}function zJ(J,Z,W,z){return B1(J,Z,W,W1,i0(G5()),V0(J,2,-2),0,z)}function I5(J,Z,W,z,q){return B1(J,Z,W,H1,V0(J,0,z),V0(J,z+1,-1),z,q)}function U1(J,Z){var W="";for(var z=0;z<J.length;z++)W+=Z(J[z],z,J,Z)||"";return W}function V5(J,Z,W,z){switch(J.type){case q5:if(J.children.length)break;case X5:case H5:case H1:return J.return=J.return||J.value;case W1:return"";case z5:return J.return=J.value+"{"+U1(J.children,z)+"}";case X1:if(!q0(J.value=J.props.join(",")))return""}return q0(W=U1(J.children,z))?J.return=J.value+"{"+W+"}":""}function N5(J){var Z=q1(J);return function(W,z,q,B){var G="";for(var X=0;X<Z;X++)G+=J[X](W,z,q,B)||"";return G}}class y0{nsp;settings;$head;constructor(J,Z){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=C5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return U1(L5(J),N5([V5]))}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 B=this.$head.find(`style[${Z}]`);if(B.length)q=parseInt(B.attr("dindex"))+1,B.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 qJ=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let W=J,z;while((z=Z.exec(J))!==null){const q=z[1],B=z.index+z[0].length;let G=1,X=B;while(X<J.length&&G>0){if(J[X]==="(")G++;if(J[X]===")")G--;X++}if(G===0){const U=J.slice(B,X-1).trim(),K=J.slice(0,z.index),j=`${A0}${q}="${U}"`,C=J.slice(X);W=K+j+C,J=W,Z.lastIndex=K.length+j.length}}return W},YJ=function(J){const Z=[];let z=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,B,G)=>{return Z.push(G),`<${B}##TAG_ATTRS_${Z.length-1}##>`});for(let q=0;q<Z.length;q++){const B=`##TAG_ATTRS_${q}##`,G=Z[q],X=BJ(G);z=z.replace(B,X)}return z},BJ=function(J){let Z="",W=0,z=!1,q="",B=0,G=0,X=0;while(W<J.length){const U=J[W];if((U==='"'||U==="'")&&(W===0||J[W-1]!=="\\")){if(!z)z=!0,q=U;else if(U===q)z=!1}if(!z){if(U==="(")G++;else if(U===")")G--;else if(U==="{")X++;else if(U==="}")X--}if(!z&&G===0&&X===0&&(U===" "||W===J.length-1)){let K=W;if(W===J.length-1)K=W+1;const j=J.substring(B,K).trim();if(j){const C=GJ(j);Z+=" "+C}B=W+1}W++}return Z},GJ=function(J){const Z=J.indexOf("=");if(Z===-1){if(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=!Q5.includes(W)?W.slice(1):W,`:${W}=${z}`;if(W.startsWith(M0)||W.startsWith(A0))return J;if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'")){const q=z.substring(1,z.length-1);if(wJ(q))return`:${W}="${q}"`;return J}else return`:${W}="${z}"`};function wJ(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 x1(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 ${M0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Z=qJ(Z),Z=YJ(Z),Z}var KJ=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},P5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function v0(J,Z={maxSize:100}){const W=new Set,z=[{value:J,timestamp:Date.now()}];let q=0;const B=()=>{const K=O1[O1.length-1];return K&&KJ(K,W),z[q].value},G=()=>{const K=[...W];if(S5)for(let j of K)S5.add(j);else for(let j of K)j.execute()};return[B,(K,j)=>{if(Object.is(z[q].value,K))return;if(q<z.length-1)z.splice(q+1);if(z.push({value:K,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(K){if(K>=0&&K<z.length&&K!==q)q=K,G()},getHistory(){return[...z]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<z.length-1},clear(){const K=z[0];z.length=0,z.push(K),q=0,G()}}]}function M1(J){let Z=!1;const W=()=>{if(Z)throw new Error("Circular dependency detected");if(z.isDisposed)return;Z=!0,P5(z),O1.push(z);try{J()}finally{Z=!1,O1.pop()}},z={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{z.isDisposed=!0,P5(z)}}}var O1=[],S5=null;class p0 extends e0{declaration;$=null;input;state;static;context;__name__;__path__;__template__;__previous;__macros=new Map;__translations=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:B,handler:G,stylesheet:X,macros:U,declaration:K},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.__path__=`${this.prepath}/${this.__name__}`,this.__template__=x1(Z),console.log(this.__template__),this.declaration=K||{name:J},this.input=W||{},this.static=B||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,z||{}),U&&this.setMacros(U),G&&this.setHandler(G),X&&this.setStylesheet(X),this.metrics=new Q1(this.debug),this.metrics.inc("componentCount"),this.UQS=new a0(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:Z0(this.input),state:Z0(this.state),context:Z0(this.context)};const[C,b]=v0(this.input),[A,u]=v0(this.state),[i,e]=v0(this.context);this.__setInput=b,this.__setState=u,this.__getState=A,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,(l)=>{if(!H0(this.context,l))return;e(l),this.context=l,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context",this)}),this.ICE=M1(()=>{const l=C(),c=A(),d=this.context=i();if(!this.isRendered){this.metrics.reset();const{$log:k}=this.render("",void 0,void 0,this.FGUD);this.$=k,!K?.syntax&&this.$?.each((y,T)=>typeof T.setAttribute=="function"&&T.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:c,input:l,context:d},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update",this),this.__previous={input:Z0(l),state:Z0(c),context:Z0(d)},this.input=l;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(W5(this.input,J)),this}setMacros(J){const Z=x1(J),W=t.default(Z);if(!W.length)return;const z=this;W.each(function(){const q=t.default(this),{argv:B,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:B,$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 y0(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 B=z||new Map,G=[];if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:B};this.metrics.startRender();const X=this;let U=t.default();function K(O){const w=j(O);return X.__pathCounter++,X.__path?`${X.__path}/${w}`:`${J?J+"/":"#"}${w}`}function j(O){return(O==="component"?"c":"")+X.__pathCounter}function C(O){return O!==null&&typeof O==="object"&&typeof O.mesh==="function"&&typeof O.update==="function"}function b(O){return O!==null&&typeof O==="object"&&typeof O.default&&typeof O.default==="string"}function A(O){if(!O.attr(":dtag")||O.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const w=O.attr(":dtag"),D=X.__evaluate__(w,W);if(C(D)||D===null)return l(O,w,D);else if(b(D))return c(O,{template:D});else return c(O,{name:D})}function u(O){const w=O.attr(":args"),D=K("log");if(!w)return;if(X.__evaluate__(`console.log(${w})`,W),X.__isReactive__(w,W))X.__extractExpressionDeps__(w,W).forEach((V)=>X.__trackDep__(B,V,{$fragment:null,path:D,update:(E)=>X.__evaluate__(`console.log(${w})`,E),memo:W,batch:!0}))}function i(O){const w=K("var"),{attrs:D}=X.__getAttributes__(O);if(!D)return;Object.entries(D.literals).forEach(([L,V])=>{if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);W[L]={value:V,type:"let"}}),Object.entries(D.expressions).forEach(([L,V])=>{if(a.test(L)){const E=(P,x)=>{const v=X.__evaluate__(L.replace(a,""),x||W);if(typeof v!=="object")throw new Error(`Invalid spread operator ${L}`);for(let N in v){if(W[N]&&W[N].type==="const")throw new Error(`Cannot override <const ${N}=[value]/> variable`);if(W[N]={value:v[N],type:"let"},x)x[N]=W[N],X.__updateVarDepNodes__(N,w,x)}if(P)return{memo:x}};X.__extractExpressionDeps__(L,W).forEach((P)=>X.__trackDep__(B,P,{$fragment:null,path:`${w}.${L}`,update:(x)=>E(!0,x),memo:W,batch:!0})),E()}else if(V){if(X.__isReactive__(V,W)){const E=X.__extractExpressionDeps__(V,W),r=(P,x)=>{if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);return P[L]=W[L]={value:X.__evaluate__(V,P),type:"let"},X.__updateVarDepNodes__(L,w,P),{memo:P}};E.forEach((P)=>X.__trackDep__(B,P,{$fragment:null,path:`${w}.${L}`,update:r,memo:W,batch:!0}))}if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);W[L]={value:X.__evaluate__(V,W),type:"let"}}}),X.metrics.inc("elementCount")}function e(O){const{attrs:w}=X.__getAttributes__(O);if(!w)return;Object.entries(w.literals).forEach(([D,L])=>{if(W[D]&&W[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!L)return;W[D]={value:L,type:"const"}}),Object.entries(w.expressions).forEach(([D,L])=>{if(a.test(D)){const V=X.__evaluate__(D.replace(a,""),W);if(typeof V!=="object")throw new Error(`Invalid spread operator ${D}`);for(let E in V){if(W[E]&&W[E].type==="const")throw new Error(`<const ${E}=[value]/> by spread operator ${D}. [${E}] variable already defined`);W[E]={value:V[E],type:"const"}}}else{if(W[D]&&W[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!L)return;W[D]={value:X.__evaluate__(L,W),type:"const"}}}),X.metrics.inc("elementCount")}function l(O,w,D){const{attrs:L}=X.__getAttributes__(O),V=K("element"),E=X.__getBoundaries__(V);let r=t.default(E.start),P={},x=D;if(x){L.literals&&Object.entries(L.literals).forEach(([N,$])=>P[N]={type:"arg",value:$}),L.expressions&&Object.entries(L.expressions).forEach(([N,$])=>{if(!x)return;if(a.test(N)){const _=X.__evaluate__(N.replace(a,""),W);if(typeof _!=="object")throw new Error(`Invalid spread operator ${N}`);for(let R in _){if(R!=="#"&&!x.argv.includes(R))continue;P[R]={type:"arg",value:_[R]}}}else{if(N!=="#"&&!x.argv.includes(N))return;P[N]={type:"arg",value:$?X.__evaluate__($,W):!0}}});const v=x.mesh(P);if(v&&v.length)r=r.add(v);L.expressions&&Object.entries(L.expressions).forEach(([N,$])=>{if(!x)return;if(a.test(N)&&X.__isReactive__(N,W)){const _=X.__extractExpressionDeps__(N,W),R=(F,f)=>{if(!x)return;const h={},o=X.__evaluate__(N.replace(a,""),F);if(typeof o!=="object")throw new Error(`Invalid spread operator ${N}`);const s=[];for(let p in o){if(p!=="#"&&!x.argv.includes(p))continue;P[p]=h[p]={type:"arg",value:o[p]},(!F[p]||!E0(o[p],F[p].value))&&s.push(p)}s.length&&x.update(s,h,E)};_.forEach((F)=>X.__trackDep__(B,F,{$fragment:null,boundaries:E,path:`${V}.${N}`,update:R,memo:W,batch:!0}))}else if((N==="#"||x.argv.includes(N))&&X.__isReactive__($,W)){const _=X.__extractExpressionDeps__($,W),R=(F,f)=>{if(!x)return;const h=P[N]={type:"arg",value:$?X.__evaluate__($,F):!0};x.update([N],{[N]:h},E)};_.forEach((F)=>X.__trackDep__(B,F,{$fragment:null,boundaries:E,path:`${V}.${N}`,update:R,memo:W,batch:!0}))}})}if(X.__isReactive__(w,W)){const v=($,_)=>{const R=X.__evaluate__(w,$);let F;if(b(R))F=c(O,{template:R});else if(C(R))P="#"in P?{...$,...P["#"].value}:{...$,...P},x=R,F=x?x.mesh(P):null;if(!document.contains(E.start)||!document.contains(E.end))throw new Error("Dynamic element boundaries not found");const f=[];let h=E.start.nextSibling;while(h&&h!==E.end)f.push(h),h=h.nextSibling;t.default(f).remove(),F&&t.default(E.start).after(F)};X.__extractExpressionDeps__(w,W).forEach(($)=>X.__trackDep__(B,$,{$fragment:null,boundaries:E,path:V,update:v,batch:!0,memo:{...W,...P}}))}return r=r.add(E.end),r}function c(O,w){let D,L;if(w?.template)D=w.template,L=j("component");else{if(L=w?.name||O.prop("tagName")?.toLowerCase(),!L)throw new Error("Invalid component");if(L===X.__name__)throw new Error("Render component within itself is forbidden");D=X.lips.import(L)}if(!D||!L)throw new Error(`<${L}> template not found`);const V=K("component"),E=X.__getBoundaries__(V),{argv:r,attrs:P,events:x}=X.__getAttributes__(O),v={};let N={},$=t.default(E.start),_=X.PCC.get(V);P.literals&&Object.entries(P.literals).forEach(([F,f])=>{if(F=="key")return;N[F]=f}),P.functions&&Object.entries(P.functions).forEach(([F,f])=>{N[F]=X.__evaluateFunction__(f,[],W),D.declaration?.syntax?v[I0+M0+F]=f:v[M0+F]=f}),P.expressions&&Object.entries(P.expressions).forEach(([F,f])=>{if(F=="key")return;if(a.test(F)){const h=X.__evaluate__(F.replace(a,""),W);if(typeof h!=="object")throw new Error(`Invalid spread operator ${F}`);for(let o in h)N[o]=h[o]}else N[F]=f?X.__evaluate__(f,W):!0;D.declaration?.syntax?v[I0+F]=f:v[F]=f});const R=O.contents();if(R.length){if(N={...N,...X.__meshwire__({$node:O,fragmentPath:V,fragmentBoundaries:E,meshPath:null,argv:r,scope:W,xmlns:q,useAttributes:!0,declaration:D.declaration},v)},D.declaration){if(D.declaration.tags)Object.entries(D.declaration?.tags).forEach(([F,{type:f,many:h}])=>{switch(f){case"nexted":{let o=O.next(F);if(!o.length)return;if(h){N[F]=[];let s=0,p=!1;while(!p){if(N[F].push(X.__meshwire__({$node:o,meshPath:`${F}[${s}]`,fragmentPath:V,fragmentBoundaries:E,argv:r,scope:W,xmlns:q,useAttributes:!0,declaration:D.declaration},v)),!o.next(F).length){p=!0;break}o=o.next(F),s++}}else N[F]=X.__meshwire__({$node:o,meshPath:F,fragmentPath:V,fragmentBoundaries:E,argv:r,scope:W,xmlns:q,useAttributes:!0,declaration:D.declaration},v)}break;case"child":{const o=O.children(F);if(h)N[F]=[],o.each(function(s){const p=t.default(this),{argv:D0}=X.__getAttributes__(p);N[F].push(X.__meshwire__({$node:p,meshPath:`${F}[${s}]`,fragmentPath:V,fragmentBoundaries:E,argv:D0,scope:W,xmlns:q,useAttributes:!0,declaration:D.declaration},v))});else if(O.children(F).first().length){const s=O.children(F).first(),{argv:p}=X.__getAttributes__(s);N[F]=X.__meshwire__({$node:s,meshPath:F,fragmentPath:V,fragmentBoundaries:E,argv:p,scope:W,xmlns:q,useAttributes:!0,declaration:D.declaration},v)}}break}});else if(D.declaration.contents)N.__contents__=R}}if(_)_.setInput(Z0(N)),$=$.add(_.node);else{const{declaration:F,state:f,_static:h,handler:o,context:s,default:p,stylesheet:D0}=D;_=new p0(L,p||"",{state:Z0(f),input:Z0(N),context:s,_static:Z0(h),handler:o,stylesheet:D0,declaration:F},{debug:X.debug,lips:X.lips,prepath:V}),$=$.add(_.node),X.PCC.set(V,_),Object.entries(x).forEach(([J0,n])=>!!_&&X.__attachEvent__(_,J0,n,W)),v&&Object.entries(v).forEach(([J0,n])=>{let z0=!1,u0=!1;if(J0.startsWith(I0))z0=!0,J0=J0.replace(I0,"");if(J0.startsWith(M0))u0=!0,J0=J0.replace(M0,"");if(a.test(J0)){const $0=(C0)=>{const K0={},_0=X.__evaluate__(J0.replace(a,""),C0);if(typeof _0!=="object")throw new Error(`Invalid spread operator ${J0}`);for(let R0 in _0)K0[R0]=_0[R0];_?.subInput(K0)};if(X.__isReactive__(J0,W))X.__extractExpressionDeps__(n,W).forEach((K0)=>X.__trackDep__(B,K0,{$fragment:null,boundaries:E,path:`${V}.${J0}`,update:$0,syntax:z0,memo:W,batch:!0}))}else{const $0=(C0)=>{const K0=u0?X.__evaluateFunction__(n,[],C0):n?X.__evaluate__(n,C0):!0;_?.subInput({[J0]:K0})};if(X.__isReactive__(n,W))X.__extractExpressionDeps__(n,W).forEach((K0)=>X.__trackDep__(B,K0,{$fragment:null,boundaries:E,path:`${V}.${J0}`,update:$0,syntax:z0,memo:W,batch:!0}))}}),$=$.add(E.end)}return X.metrics.inc("componentCount"),$}function d(O){const w=O.prop("tagName")?.toLowerCase();if(!w)throw new Error("Invalid macro rendering call");const D=X.__macros.get(w);if(!D)throw new Error("Macro component not found");const L=K("macro"),V=X.__getBoundaries__(L),{attrs:E}=X.__getAttributes__(O),r={};let P={},x={},v=t.default(V.start);if(E.literals&&Object.entries(E.literals).forEach(([R,F])=>P[R]={value:F,type:"arg"}),E.expressions&&Object.entries(E.expressions).forEach(([R,F])=>{if(a.test(R)){const f=X.__evaluate__(R.replace(a,""),W);if(typeof f!=="object")throw new Error(`Invalid spread operator ${R}`);for(let h in f)if(x[h]=f[h],D.argv.includes(h))P[h]={value:f[h],type:"arg"};r[R]=F}else{const f=F?X.__evaluate__(F,W):!0;if(x[R]=f,D.argv.includes(R))P[R]={value:f,type:"arg"};if(D.argv.includes(R))r[R]=F}D.argv.forEach((f)=>{if(P[f]!==void 0)return;P[f]={value:!1,type:"arg"}})}),D.argv.includes("__"))P.__={value:x,type:"arg"};const N={$node:D.$node,meshPath:null,fragmentPath:L,fragmentBoundaries:V,argv:D.argv,scope:W,xmlns:q,useAttributes:!0},$=X.__meshwire__(N,r),_=$.renderer.mesh(P);return v=v.add(_),r&&Object.entries(r).forEach(([R,F])=>{let f=!1;if(new RegExp(`^${I0}`).test(R))f=!0,R=R.replace(I0,"");if(a.test(R)){if(!X.__isReactive__(R,W))return;const h=X.__extractExpressionDeps__(R,W),o=(s)=>{const p={},D0=X.__evaluate__(R.replace(a,""),s);if(typeof D0!=="object")throw new Error(`Invalid spread operator ${R}`);const J0=[];for(let n in D0)p[n]={value:D0[n],type:"arg"},(!s[n]||!E0(D0[n],s[n].value))&&J0.push(n);return J0.length&&$.renderer.update(J0,p),{memo:{...s,...p}}};h.forEach((s)=>X.__trackDep__(B,s,{$fragment:null,boundaries:V,path:`${L}.${R}`,update:o,syntax:f,memo:{...W,...P},batch:!0}))}else if(X.__isReactive__(F,W)){const h=X.__extractExpressionDeps__(F,W),o=(s)=>{const p=s[R]={value:F?X.__evaluate__(F,s):!0,type:"arg"};return $.renderer.update([R],{[R]:p}),{memo:s}};h.forEach((s)=>X.__trackDep__(B,s,{$fragment:null,boundaries:V,path:`${L}.${R}`,update:o,syntax:f,memo:{...W,...P},batch:!0}))}}),v=v.add(V.end),X.metrics.inc("elementCount"),v}function k(O){if(!O.length||!O.prop("tagName"))return O;const w=O.is("svg")||q,D=w?t.default(document.createElementNS("http://www.w3.org/2000/svg",O.prop("tagName").toLowerCase())):t.default(`<${O.prop("tagName").toLowerCase()}/>`),L=O.contents(),V=K("element");L.length&&D.append(X.__withPath__(V,()=>X.render(V+".n",L,W,B,w).$log));const{attrs:E,events:r}=X.__getAttributes__(O);E.literals&&Object.entries(E.literals).forEach(([x,v])=>D.attr(x,v));const P=(x,v=!1)=>{x&&Object.entries(x).forEach(([N,$])=>{switch(N){case"@html":{const _=(R)=>{D.html(X.__evaluate__($,R))};if(_(W),v&&X.__isReactive__($,W))X.__extractExpressionDeps__($,W).forEach((F)=>X.__trackDep__(B,F,{$fragment:D,path:`${V}.${N}`,update:_,memo:W,batch:!0}))}break;case"@text":{const _=(R)=>{let F=X.__evaluate__($,R);if(!O.is("[no-translate]")){const{text:f}=X.lips.i18n.translate(F);F=f}D.text(F)};if(_(W),v&&X.__isReactive__($,W))X.__extractExpressionDeps__($,W).forEach((F)=>X.__trackDep__(B,F,{$fragment:D,path:`${V}.${N}`,update:_,memo:W,batch:!0}))}break;case"style":{const _=(R)=>{const F=X.__evaluate__($,R);if(typeof F==="object"){let f="";Object.entries(F).forEach(([h,o])=>f+=`${h}:${o};`),f.length&&D.attr("style",f)}else D.attr("style",F)};if(_(W),v&&X.__isReactive__($,W))X.__extractExpressionDeps__($,W).forEach((F)=>X.__trackDep__(B,F,{$fragment:D,path:`${V}.${N}`,update:_,memo:W,batch:!0}))}break;default:{const _=(R)=>{const F=$?X.__evaluate__($,R):$!==void 0?$:!0;F===void 0||F===!1?D.removeAttr(N):D.attr(N,F)};if(_(W),v&&X.__isReactive__($,W))X.__extractExpressionDeps__($,W).forEach((F)=>X.__trackDep__(B,F,{$fragment:D,path:`${V}.${N}`,update:_,memo:W,batch:!0}))}}})};return E.expressions&&Object.keys(E.expressions).forEach((x)=>{if(!a.test(x))return;const v=(N)=>{const $={},_=X.__evaluate__(x.replace(a,""),N);if(typeof _!=="object")throw new Error(`Invalid spread operator ${x}`);for(let R in _)$[R]=_[R];P($)};if(delete E.expressions[x],v(W),x&&X.__isReactive__(x,W))X.__extractExpressionDeps__(x,W).forEach(($)=>X.__trackDep__(B,$,{$fragment:D,path:`${V}.${x}`,update:v,memo:W,batch:!0}))}),P(E.expressions,!0),r&&Object.entries(r).forEach(([x,v])=>{G.push({_event:x,$fragment:D,instruction:v,scope:W})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),D}function y(O){const w=O.text(),D=K("element"),L=!O.parent().is("[no-translate]"),V=t.default(document.createTextNode(X.__interpolate__(w,L,W)));if(w&&X.__isReactive__(w,W)){const E=X.__extractTextDeps__(w,W),r=(P)=>{const x=X.__interpolate__(w,L,P);if(!V[0])return;V[0].textContent=x};E.forEach((P)=>X.__trackDep__(B,P,{path:D,$fragment:V,update:r,memo:W,translate:L,batch:E.length>1}))}return X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),V}function T(O){if(O.get(0)?.nodeType===Node.COMMENT_NODE)return O;if(O.get(0)?.nodeType===Node.TEXT_NODE)return y(O);if(O.is("let"))return i(O);else if(O.is("const"))return e(O);else if(O.is("lips")&&O.attr(":dtag"))return A(O);else if(O.is("log"))return u(O);else if(X.__macros.has(O.prop("tagName")?.toLowerCase()))return d(O);else if(O.is("if, for, switch, async")||X.lips.has(O.prop("tagName")?.toLowerCase()))return c(O);else if(O.is("else-if, else"))return;return k(O)}try{this.__renderDepth++,Z=Z||t.default(this.__template__),Z.each(function(){const O=T(t.default(this));if(O)U=U.add(O)}),G.forEach(({$fragment:O,_event:w,instruction:D,scope:L})=>{this.__attachEvent__(O,w,D,L)}),X.metrics.inc("renderCount")}catch(O){console.error("Rendering Failed --",O),X.metrics.trackError(O)}finally{if(this.__renderDepth--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:U,dependencies:B,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.state.reset(),this.__macros.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Z)=>{t.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:B,fragmentBoundaries:G,argv:X,scope:U,xmlns:K,declaration:j,useAttributes:C}=J;let b,A=[];const u=[],i=(d,k,y)=>{const T=`${B}.${q||"r"}${y!==void 0?`[${y}]`:""}`,{$log:O,dependencies:w,events:D}=W.render(T,d,{...U,...k},void 0,K);if(u.push(T),w?.forEach((L,V)=>{if(!W.FGUD?.has(V))W.FGUD.set(V,new Map);L.forEach((E,r)=>{E.partial?.length?E.partial.push(T):E.partial=[T],W.FGUD.get(V)?.set(r,E)})}),W.metrics.inc("partialCount"),y!==void 0){const L=W.__getBoundaries__(T);A[y]={argvalues:k,boundaries:L};let V=t.default(L.start);return V=V.add(O),V=V.add(L.end),V}return O},e=(d,k,y)=>{if(W.metrics.startRender(),d.forEach((T)=>{const O=W.FGUD.get(T);if(!O)return;O.forEach((w)=>{const D=u.find((L)=>w.partial?.find((V)=>L==V));if(!w.partial||!D)return;if(y!==void 0&&!D.endsWith(`r[${y}]`))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?.[T]&&k?.[T]&&E0(w.memo[T],k[T]))return;if(w.memo={...U,...w.memo,...k},w.batch)W.UQS.queue({dep:T,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(T)}),y!==void 0&&A[y])A[y].argvalues=k;W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},l=(d)=>{if(!A[d])return;const k=A[d].boundaries;if(delete A[d],!document.contains(k.start)||!document.contains(k.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const y=[];let T=k.start.nextSibling;while(T&&T!==k.end)y.push(T),T=T.nextSibling;t.default(y).remove(),k.start.remove(),k.end.remove()},c={renderer:{path:q,argv:X,mesh(d,k=!1){if(b=z.contents(),!b?.length)return null;if(j?.iterator){const y=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!y.length)return null;let T=t.default();return y.forEach((O,w)=>{if(!b?.length)return null;T=T.add(i(b,O,w))}),T}else return i(b,d)},update(d,k,y){if(!u.length)return;if(y=y||G,j?.iterator){const T=k?.["#"].value;if(!Array.isArray(T))return;if(Array.isArray(A)){if(A.length===T.length){for(let w=0;w<T.length;w++)!E0(A[w].argvalues,T[w])&&e(Object.keys(T[w]),T[w],w);return}const O=Math.min(A.length,T.length);for(let w=0;w<O;w++)e(Object.keys(T[w]),T[w],w);if(T.length>A.length){if(!b?.length)return;for(let w=A.length;w<T.length;w++){const D=i(b,T[w],w);t.default(y.end).before(D)}}else if(T.length<A.length)for(let w=T.length;w<A.length;w++)l(w)}}else e(d,k)}}};if(C&&q){const{attrs:d}=W.__getAttributes__(z);d.literals&&Object.entries(d.literals).forEach(([k,y])=>c[k]=y),d.expressions&&Object.entries(d.expressions).forEach(([k,y])=>{if(a.test(k)){const T=W.__evaluate__(k.replace(a,""),U);if(typeof T!=="object")throw new Error(`Invalid spread operator ${k}`);for(let O in T)c[O]=T[O];Z[`${j?.syntax?I0:""}${q}.${k}`]=y}else c[k]=y?W.__evaluate__(y,U):!0,Z[`${j?.syntax?I0:""}${q}.${k}`]=y})}return c}__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(([B,G])=>{if(B==":dtag")return;if(B.startsWith(":")||B.startsWith(M0)||B.startsWith(A0)||a.test(B)||Z1.test(B))if(Z1.test(B)){const[X,U]=B.match(Z1)||[];q=U.split(",")}else if(B.startsWith(A0))W[B.replace(A0,"")]=G;else if(B.startsWith(M0))z.functions[B.replace(M0,"")]=G;else{if(B.startsWith(":"))B=B.slice(1,B.length);z.expressions[B]=G||""}else z.literals[B]=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){try{J=J.trim();const W=(z)=>{const q=this.state.toJSON();if(Z){const B={};for(let U in Z)B[U]=Z[U].value;const G=`with( scope ){ return ${z}; }`;return new Function("self","input","state","static","context","scope",G)(this,this.input,q,this.static,this.context,B||{})}else{const B=`return ${z}`;return new Function("self","input","state","static","context",B)(this,this.input,q,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J))return J.replace(/{\s*([^{}]+)\s*}/g,(z,q)=>W(q));return W(J)}catch(W){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*/),B;if(z=this.__evaluate__(z,W),typeof z==="function")B=z;else{if(typeof this[z]!=="function")throw new Error(`Undefined <${z}> handler method`);B=this[z].bind(this)}if(typeof B!=="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 B(...G)}}__interpolate__(J,Z,W){return J.replace(/{\s*([^{}]+)\s*}/g,(z,q)=>this.__evaluate__(q,W))}__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 B=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(B,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 B=new RegExp(`\\b(${Object.keys(Z).join("|")})`,"g");q=[...q,...Array.from(J.matchAll(B))]}return[...new Set(q.map((B)=>B[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,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")}__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),B=this.__valueDep__(W[J],Z);return!E0(q,B)}__updateDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((W,z)=>{const[q,...B]=z.split(".");if(!this.__shouldUpdate__(q,B,J,Z))return;W.forEach((G)=>{const{path:X,batch:U,$fragment:K,boundaries:j,update:C,memo:b,syntax:A}=G;try{if(!A&&(j?.start&&!document.contains(j.start))||K!==null&&!K.closest("body").length){W.delete(X);return}if(U)this.UQS.queue({dep:z,dependent:G});else{const u=C(b,"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,B)=>{if(!q.haslet||!this.__hasSamePathParent__(B,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()}appendTo(J){return(typeof J=="string"?t.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?t.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?t.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var b1={};d0(b1,{state:()=>{{return OJ}},handler:()=>{{return MJ}},default:()=>{{return DJ}},declaration:()=>{{return UJ}}});var UJ={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},OJ={renderer:null},MJ={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}}},DJ="<{state.renderer}/>";var h1={};d0(h1,{state:()=>{{return FJ}},handler:()=>{{return LJ}},default:()=>{{return VJ}},declaration:()=>{{return jJ}},_static:()=>{{return IJ}}});var jJ={name:"for",syntax:!0,iterator:!0},FJ={argvlist:null},IJ={lastInput:null,processingBatch:!1},LJ={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,U=!0;for(let K=0;K<this.state.argvlist.length;K++){if(this.state.argvlist[K][G].value!==X){U=!1;break}X=z?X+1:X-1}if(U)return;X=Z;for(let K=0;K<this.state.argvlist.length;K++)this.state.argvlist[K][G].value=X,X=z?X+1:X-1;return}}const B=[];for(let G=Z;z?G<=W:G>=W;z?G++:G--){const X={},[U]=this.input.renderer.argv;if(U)X[U]={value:G,type:"arg"};B.push(X)}this.state.argvlist=B}else if(Array.isArray(J)){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!J.length){console.warn("empty for loop <in> attribute Array value"),this.state.argvlist=[];return}if(this.static.lastInput=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.length){const[B,G]=this.input.renderer.argv;for(let X=0;X<J.length;X++){const U=this.state.argvlist[X];if(B)U[B].value=J[X]}return}const z=[];let q=0;for(let B of J){const G={},[X,U]=this.input.renderer.argv;if(X)G[X]={value:B,type:"arg"};if(U)G[U]={value:q,type:"arg"};z.push(G),q++}this.state.argvlist=z}else if(J instanceof Map){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!J.size){console.warn("empty for loop <in> attribute Map value"),this.state.argvlist=[];return}if(this.static.lastInput=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.size){const[B,G,X]=this.input.renderer.argv;let U=0;for(let[K,j]of J){const C=this.state.argvlist[U];if(B)C[B].value=K;if(G)C[G].value=j;U++}return}const z=[];let q=0;for(let[B,G]of J){const X={},[U,K,j]=this.input.renderer.argv;if(U)X[U]={value:B,type:"arg"};if(K)X[K]={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.lastInput&&this.input.in===this.static.lastInput)return;if(!Object.keys(J).length){console.warn("empty for loop <in> attribute Object value"),this.state.argvlist=[];return}this.static.lastInput=J;const z=Object.keys(J);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===z.length){const[G,X,U]=this.input.renderer.argv;for(let K=0;K<z.length;K++){const j=z[K],C=this.state.argvlist[K];if(G)C[G].value=j;if(X)C[X].value=J[j]}return}const q=[];let B=0;for(let G in J){const X={},[U,K,j]=this.input.renderer.argv;if(U)X[U]={value:G,type:"arg"};if(K)X[K]={value:J[G],type:"arg"};if(j)X[j]={value:B,type:"arg"};q.push(X),B++}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}}},VJ="<{input.renderer} #=state.argvlist/>";var g1={};d0(g1,{state:()=>{{return CJ}},handler:()=>{{return SJ}},default:()=>{{return PJ}},declaration:()=>{{return NJ}}});var NJ={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},CJ={renderer:null,props:{}},SJ={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"}}})}},PJ="<{state.renderer} #=state.props/>";var f1={};d0(f1,{state:()=>{{return $J}},handler:()=>{{return RJ}},default:()=>{{return TJ}},declaration:()=>{{return EJ}}});var EJ={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},$J={renderer:null},RJ={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}},TJ="<{state.renderer}/>";var k1={};d0(k1,{state:()=>{{return AJ}},handler:()=>{{return hJ}},default:()=>{{return gJ}},context:()=>{{return xJ}},_static:()=>{{return _J}}});var bJ=function(J){const Z={};return J.split("&").map((z)=>{const[q,B]=z.split("=");Z[q]=B}),Z},AJ={page:null,params:{},query:{}},_J={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},xJ=["navigate"],hJ={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]?bJ(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 B=this.match(J);if(!B){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:G,params:X}=B;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:B}=z,G=J.match(B);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}},gJ="<{state.page} params=state.params query=state.query/>";class m0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new l0;watcher;IUC;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new t0,this.IUC=new n0;const[Z,W]=v0(J?.context||{});this.__setContext=W,this.__getContext=Z,this.register("if",b1),this.register("for",h1),this.register("async",g1),this.register("switch",f1),this.register("router",k1)}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,B={debug:this.debug,prepath:"0",lips:this},G=new p0(J,z||"",{...q,input:W},B);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 y0("root",{sheet:W,meta:!0}));return this.__root}language(J){this.i18n.setLang(J)&&this.__root?.rerender()}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;M1(()=>{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)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}function fJ(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 U=performance.now();if(this.static.lastFrameTimestamp){const K=U-this.static.lastFrameTimestamp;if(K<1000){if(this.static.updateTimes.push(K),this.static.updateTimes.length>100)this.static.updateTimes.shift()}}this.static.lastFrameTimestamp=U,this.static.frameCount++},startPerformanceTracking(){this.static.frameCountInterval=setInterval(()=>{if(this.state.metrics.fps=this.static.frameCount,this.static.frameCount=0,this.static.updateTimes.length){const U=this.static.updateTimes.reduce((K,j)=>K+j,0)/this.static.updateTimes.length;this.state.metrics.avgRenderTime=U}if(window.performance&&window.performance.memory)this.state.metrics.memoryUsageMB=window.performance.memory.usedJSHeapSize/1048576},1000)},startStressTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.counterHistory=[],this.static.updateInterval=setInterval(()=>{if(this.state.counter++,this.state.metrics.totalUpdates++,this.state.counterHistory.length>100)this.state.counterHistory.shift();this.state.counterHistory.push(this.state.counter)},this.state.updateFrequency)},stopStressTest(){if(!this.state.isRunning)return;clearInterval(this.static.updateInterval),this.state.isRunning=!1},setUpdateFrequency(U){const K=parseFloat(U.target.value);if(this.state.updateFrequency=K,this.state.isRunning)this.stopStressTest(),this.startStressTest()},resetCounter(){this.state.counter=0,this.state.counterHistory=[],this.state.metrics.totalUpdates=0},runHeavyComputation(){const U=performance.now();let K=0;for(let j=0;j<1e7;j++)K+=Math.sqrt(j);console.log(`Heavy computation completed in ${performance.now()-U}ms, result: ${K}`)},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
|
|
|
@@ -10,7 +10,7 @@ var J8=Object.create;var{defineProperty:T1,getPrototypeOf:Q8,getOwnPropertyNames
|
|
|
10
10
|
id="update-frequency"
|
|
11
11
|
min="1"
|
|
12
12
|
max="100"
|
|
13
|
-
value=
|
|
13
|
+
value=state.updateFrequency
|
|
14
14
|
on-input(setUpdateFrequency)
|
|
15
15
|
/>
|
|
16
16
|
<span>{state.updateFrequency}ms</span>
|
|
@@ -65,7 +65,7 @@ var J8=Object.create;var{defineProperty:T1,getPrototypeOf:Q8,getOwnPropertyNames
|
|
|
65
65
|
</table>
|
|
66
66
|
</div>
|
|
67
67
|
</div>
|
|
68
|
-
`,state:
|
|
68
|
+
`,state:Z,_static:W,handler:z,stylesheet:`
|
|
69
69
|
.stress-test-container {
|
|
70
70
|
font-family: 'Arial', sans-serif;
|
|
71
71
|
max-width: 800px;
|
|
@@ -205,18 +205,18 @@ var J8=Object.create;var{defineProperty:T1,getPrototypeOf:Q8,getOwnPropertyNames
|
|
|
205
205
|
font-size: 1.1em;
|
|
206
206
|
color: #1976d2;
|
|
207
207
|
}
|
|
208
|
-
`},{});return X.appendTo(
|
|
208
|
+
`},{});return X.appendTo(J),X}function kJ(J="body",Z=5000){console.log(`Running high frequency update test for ${Z}ms...`);const W={counter:0,elapsedTime:0,updatesPerSecond:0,totalUpdates:0,isRunning:!1,testComplete:!1,testResults:{totalUpdates:0,duration:0,updatesPerSecond:0,avgUpdateTime:0}},z={updateIntervalId:null,startTime:0,updateTimes:[]},q={startTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.testComplete=!1,this.state.counter=0,this.state.totalUpdates=0,this.state.elapsedTime=0,this.static.startTime=performance.now(),this.static.updateTimes=[];const K=()=>{if(!this.state.isRunning)return;const j=performance.now();if(this.state.counter++,this.state.totalUpdates++,this.state.elapsedTime=j-this.static.startTime,this.state.elapsedTime>0)this.state.updatesPerSecond=Math.round(this.state.totalUpdates/this.state.elapsedTime*1000);const C=performance.now();if(this.static.updateTimes.push(C-j),this.state.elapsedTime>=Z){this.finishTest();return}requestAnimationFrame(K)};requestAnimationFrame(K)},finishTest(){this.state.isRunning=!1,this.state.testComplete=!0;const K=this.static.updateTimes.reduce((j,C)=>j+C,0)/this.static.updateTimes.length;this.state.testResults={totalUpdates:this.state.totalUpdates,duration:this.state.elapsedTime,updatesPerSecond:this.state.updatesPerSecond,avgUpdateTime:K},console.log("High Frequency Test Results:",this.state.testResults)}},B=`
|
|
209
209
|
<div class="high-freq-test">
|
|
210
210
|
<h2>High Frequency Update Test</h2>
|
|
211
211
|
<p>This test measures how many state updates Lips can handle per second.</p>
|
|
212
212
|
|
|
213
213
|
<div class="test-controls">
|
|
214
214
|
<if( !state.isRunning && !state.testComplete )>
|
|
215
|
-
<button on-click(startTest)>Start Test (${
|
|
215
|
+
<button on-click(startTest)>Start Test (${Z/1000}s)</button>
|
|
216
216
|
</if>
|
|
217
217
|
<else-if( state.isRunning )>
|
|
218
218
|
<div class="progress">
|
|
219
|
-
<div class="progress-bar" style="width: {(state.elapsedTime / ${
|
|
219
|
+
<div class="progress-bar" style="width: {(state.elapsedTime / ${Z}) * 100}%"></div>
|
|
220
220
|
</div>
|
|
221
221
|
<div class="stats">
|
|
222
222
|
<div>Counter: {state.counter}</div>
|
|
@@ -316,7 +316,7 @@ var J8=Object.create;var{defineProperty:T1,getPrototypeOf:Q8,getOwnPropertyNames
|
|
|
316
316
|
td:first-child {
|
|
317
317
|
font-weight: bold;
|
|
318
318
|
}
|
|
319
|
-
`,U=new
|
|
319
|
+
`,U=new m0({debug:!0}).render("HighFrequencyTest",{default:B,state:W,handler:q,stylesheet:G},{});return U.appendTo(J),U}function E5(J="body"){const Z={nodeCount:1000,renderTime:0,isRendering:!1,nodes:[]},W={createNodes(X){this.state.isRendering=!0;const U=performance.now(),K=[];for(let j=0;j<X;j++)K.push({id:j,value:`Node ${j}: ${Math.random().toString(36).substring(2,15)}`});this.state.nodes=K,this.state.renderTime=performance.now()-U,setTimeout(()=>{this.state.renderTime=performance.now()-U,this.state.isRendering=!1},10)},shuffleNodes(){this.state.isRendering=!0;const X=performance.now(),U=[...this.state.nodes];for(let K=U.length-1;K>0;K--){const j=Math.floor(Math.random()*(K+1));[U[K],U[j]]=[U[j],U[K]]}this.state.nodes=U,setTimeout(()=>{this.state.renderTime=performance.now()-X,this.state.isRendering=!1},10)},updateValues(){this.state.isRendering=!0;const X=performance.now(),U=this.state.nodes.map((K)=>({...K,value:`Node ${K.id}: ${Math.random().toString(36).substring(2,15)}`}));this.state.nodes=U,setTimeout(()=>{this.state.renderTime=performance.now()-X,this.state.isRendering=!1},10)},setNodeCount(X){this.state.nodeCount=parseInt(X.target.value,10)}},G=new m0({debug:!0}).render("DOMStressTest",{default:`
|
|
320
320
|
<div class="dom-stress-test">
|
|
321
321
|
<h2>DOM Stress Test</h2>
|
|
322
322
|
|
|
@@ -363,7 +363,7 @@ var J8=Object.create;var{defineProperty:T1,getPrototypeOf:Q8,getOwnPropertyNames
|
|
|
363
363
|
</if>
|
|
364
364
|
</div>
|
|
365
365
|
</div>
|
|
366
|
-
`,state:
|
|
366
|
+
`,state:Z,handler:W,stylesheet:`
|
|
367
367
|
.dom-stress-test {
|
|
368
368
|
max-width: 800px;
|
|
369
369
|
margin: 20px auto;
|
|
@@ -445,7 +445,7 @@ var J8=Object.create;var{defineProperty:T1,getPrototypeOf:Q8,getOwnPropertyNames
|
|
|
445
445
|
.node:last-child {
|
|
446
446
|
border-bottom: none;
|
|
447
447
|
}
|
|
448
|
-
`},{});return G.appendTo(
|
|
448
|
+
`},{});return G.appendTo(J),G}function g6(J="body"){const Z=document.createElement("div");Z.className="stress-tests-suite",Z.innerHTML=`
|
|
449
449
|
<h1>Lips Framework Stress Test Suite</h1>
|
|
450
450
|
|
|
451
451
|
<div class="test-section" id="stress-test"></div>
|
|
@@ -471,6 +471,6 @@ var J8=Object.create;var{defineProperty:T1,getPrototypeOf:Q8,getOwnPropertyNames
|
|
|
471
471
|
padding: 10px;
|
|
472
472
|
border-radius: 8px;
|
|
473
473
|
}
|
|
474
|
-
`,document.head.appendChild(W),document.querySelector(
|
|
474
|
+
`,document.head.appendChild(W),document.querySelector(J)?.appendChild(Z),fJ("#stress-test"),kJ("#high-frequency-test",3000),E5("#dom-stress-test"),{container:Z}}E5();export{kJ as runHighFrequencyTest,E5 as runDOMStressTest,g6 as runAllStressTests,fJ as createLipsStressTest};
|
|
475
475
|
|
|
476
|
-
//# debugId=
|
|
476
|
+
//# debugId=1A731F83C473EA5E64756e2164756e21
|