@lipsjs/lips 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/lips.min.js +2 -2
- package/dist/lips.min.js.map +11 -11
- package/dist/test.component.min.js +2 -282
- package/dist/test.component.min.js.map +12 -12
- package/dist/test.stress.min.js +7 -7
- package/dist/test.stress.min.js.map +11 -11
- package/dist/types/constants.d.ts +23 -0
- package/dist/types/lips.d.ts +2 -0
- package/dist/types/tps.d.ts +11 -0
- package/dist/types/utils.d.ts +0 -20
- package/package.json +1 -1
|
@@ -1,283 +1,3 @@
|
|
|
1
|
-
var K8=Object.create;var{defineProperty:x1,getPrototypeOf:U8,getOwnPropertyNames:O8}=Object;var j8=Object.prototype.hasOwnProperty;var e0=(J,Z,X)=>{X=J!=null?K8(U8(J)):{};const H=Z||!J||!J.__esModule?x1(X,"default",{value:J,enumerable:!0}):X;for(let q of O8(J))if(!j8.call(H,q))x1(H,q,{get:()=>J[q],enumerable:!0});return H};var D8=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var i0=(J,Z)=>{for(var X in Z)x1(J,X,{get:Z[X],enumerable:!0,configurable:!0,set:(H)=>Z[X]=()=>H})};var c0=D8((q5,G5)=>{(function(){var J=document,Z=window,X=J.documentElement,H=J.createElement.bind(J),q=H("div"),Q=H("table"),B=H("tbody"),Y=H("tr"),M=Array.isArray,z=Array.prototype,j=z.concat,U=z.filter,b=z.indexOf,f=z.map,T=z.push,p=z.slice,X0=z.some,s=z.splice,i=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,m=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,o=/<.+>/,l=/^\w+$/;function J0(W,G){var w=P(G);return!W||!w&&!V(G)&&!$(G)?[]:!w&&m.test(W)?G.getElementsByClassName(W.slice(1).replace(/\\/g,"")):!w&&l.test(W)?G.getElementsByTagName(W):G.querySelectorAll(W)}var d=function(){function W(G,w){if(!G)return;if(D(G))return G;var O=G;if(k(G)){var L=w||J;if(O=i.test(G)&&V(L)?L.getElementById(G.slice(1).replace(/\\/g,"")):o.test(G)?s1(G):D(L)?L.find(G):k(L)?I(L).find(G):J0(G,L),!O)return}else if(x(G))return this.ready(G);if(O.nodeType||O===Z)O=[O];this.length=O.length;for(var A=0,y=this.length;A<y;A++)this[A]=O[A]}return W.prototype.init=function(G,w){return new W(G,w)},W}(),K=d.prototype,I=K.init;if(I.fn=I.prototype=K,K.length=0,K.splice=s,typeof Symbol==="function")K[Symbol.iterator]=z[Symbol.iterator];function D(W){return W instanceof d}function N(W){return!!W&&W===W.window}function V(W){return!!W&&W.nodeType===9}function P(W){return!!W&&W.nodeType===11}function $(W){return!!W&&W.nodeType===1}function u(W){return!!W&&W.nodeType===3}function n(W){return typeof W==="boolean"}function x(W){return typeof W==="function"}function k(W){return typeof W==="string"}function C(W){return W===void 0}function v(W){return W===null}function R(W){return!isNaN(parseFloat(W))&&isFinite(W)}function h(W){if(typeof W!=="object"||W===null)return!1;var G=Object.getPrototypeOf(W);return G===null||G===Object.prototype}I.isWindow=N,I.isFunction=x,I.isArray=M,I.isNumeric=R,I.isPlainObject=h;function F(W,G,w){if(w){var O=W.length;while(O--)if(G.call(W[O],O,W[O])===!1)return W}else if(h(W)){var L=Object.keys(W);for(var O=0,A=L.length;O<A;O++){var y=L[O];if(G.call(W[y],y,W[y])===!1)return W}}else for(var O=0,A=W.length;O<A;O++)if(G.call(W[O],O,W[O])===!1)return W;return W}I.each=F,K.each=function(W){return F(this,W)},K.empty=function(){return this.each(function(W,G){while(G.firstChild)G.removeChild(G.firstChild)})};function E(){var W=[];for(var G=0;G<arguments.length;G++)W[G]=arguments[G];var w=n(W[0])?W.shift():!1,O=W.shift(),L=W.length;if(!O)return{};if(!L)return E(w,I,O);for(var A=0;A<L;A++){var y=W[A];for(var r in y)if(w&&(M(y[r])||h(y[r]))){if(!O[r]||O[r].constructor!==y[r].constructor)O[r]=new y[r].constructor;E(w,O[r],y[r])}else O[r]=y[r]}return O}I.extend=E,K.extend=function(W){return E(K,W)};var _=/\S+/g;function S(W){return k(W)?W.match(_)||[]:[]}K.toggleClass=function(W,G){var w=S(W),O=!C(G);return this.each(function(L,A){if(!$(A))return;F(w,function(y,r){if(O)G?A.classList.add(r):A.classList.remove(r);else A.classList.toggle(r)})})},K.addClass=function(W){return this.toggleClass(W,!0)},K.removeAttr=function(W){var G=S(W);return this.each(function(w,O){if(!$(O))return;F(G,function(L,A){O.removeAttribute(A)})})};function g(W,G){if(!W)return;if(k(W)){if(arguments.length<2){if(!this[0]||!$(this[0]))return;var w=this[0].getAttribute(W);return v(w)?void 0:w}if(C(G))return this;if(v(G))return this.removeAttr(W);return this.each(function(L,A){if(!$(A))return;A.setAttribute(W,G)})}for(var O in W)this.attr(O,W[O]);return this}K.attr=g,K.removeClass=function(W){if(arguments.length)return this.toggleClass(W,!1);return this.attr("class","")},K.hasClass=function(W){return!!W&&X0.call(this,function(G){return $(G)&&G.classList.contains(W)})},K.get=function(W){if(C(W))return p.call(this);return W=Number(W),this[W<0?W+this.length:W]},K.eq=function(W){return I(this.get(W))},K.first=function(){return this.eq(0)},K.last=function(){return this.eq(-1)};function a(W){if(C(W))return this.get().map(function(G){return $(G)||u(G)?G.textContent:""}).join("");return this.each(function(G,w){if(!$(w))return;w.textContent=W})}K.text=a;function c(W,G,w){if(!$(W))return;var O=Z.getComputedStyle(W,null);return w?O.getPropertyValue(G)||void 0:O[G]||W.style[G]}function t(W,G){return parseInt(c(W,G),10)||0}function Z0(W,G){return t(W,"border".concat(G?"Left":"Top","Width"))+t(W,"padding".concat(G?"Left":"Top"))+t(W,"padding".concat(G?"Right":"Bottom"))+t(W,"border".concat(G?"Right":"Bottom","Width"))}var e={};function z0(W){if(e[W])return e[W];var G=H(W);J.body.insertBefore(G,null);var w=c(G,"display");return J.body.removeChild(G),e[W]=w!=="none"?w:"block"}function D0(W){return c(W,"display")==="none"}function f0(W,G){var w=W&&(W.matches||W.webkitMatchesSelector||W.msMatchesSelector);return!!w&&!!G&&w.call(W,G)}function n0(W){return k(W)?function(G,w){return f0(w,W)}:x(W)?W:D(W)?function(G,w){return W.is(w)}:!W?function(){return!1}:function(G,w){return w===W}}K.filter=function(W){var G=n0(W);return I(U.call(this,function(w,O){return G.call(w,O,w)}))};function A0(W,G){return!G?W:W.filter(G)}K.detach=function(W){return A0(this,W).each(function(G,w){if(w.parentNode)w.parentNode.removeChild(w)}),this};var u5=/^\s*<(\w+)[^>]*>/,m5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p1={"*":q,tr:B,td:Y,th:Y,thead:Q,tbody:Q,tfoot:Q};function s1(W){if(!k(W))return[];if(m5.test(W))return[H(RegExp.$1)];var G=u5.test(W)&&RegExp.$1,w=p1[G]||p1["*"];return w.innerHTML=W,I(w.childNodes).detach().get()}I.parseHTML=s1,K.has=function(W){var G=k(W)?function(w,O){return J0(W,O).length}:function(w,O){return O.contains(W)};return this.filter(G)},K.not=function(W){var G=n0(W);return this.filter(function(w,O){return(!k(W)||$(O))&&!G.call(O,w,O)})};function N0(W,G,w,O){var L=[],A=x(G),y=O&&n0(O);for(var r=0,I0=W.length;r<I0;r++)if(A){var q0=G(W[r]);if(q0.length)T.apply(L,q0)}else{var M0=W[r][G];while(M0!=null){if(O&&y(-1,M0))break;L.push(M0),M0=w?M0[G]:null}}return L}function o1(W){if(W.multiple&&W.options)return N0(U.call(W.options,function(G){return G.selected&&!G.disabled&&!G.parentNode.disabled}),"value");return W.value||""}function d5(W){if(!arguments.length)return this[0]&&o1(this[0]);return this.each(function(G,w){var O=w.multiple&&w.options;if(O||X5.test(w.type)){var L=M(W)?f.call(W,String):v(W)?[]:[String(W)];if(O)F(w.options,function(A,y){y.selected=L.indexOf(y.value)>=0},!0);else w.checked=L.indexOf(w.value)>=0}else w.value=C(W)||v(W)?"":W})}K.val=d5,K.is=function(W){var G=n0(W);return X0.call(this,function(w,O){return G.call(w,O,w)})},I.guid=1;function L0(W){return W.length>1?U.call(W,function(G,w,O){return b.call(O,G)===w}):W}I.unique=L0,K.add=function(W,G){return I(L0(this.get().concat(I(W,G).get())))},K.children=function(W){return A0(I(L0(N0(this,function(G){return G.children}))),W)},K.parent=function(W){return A0(I(L0(N0(this,"parentNode"))),W)},K.index=function(W){var G=W?I(W)[0]:this[0],w=W?this:I(G).parent().children();return b.call(w,G)},K.closest=function(W){var G=this.filter(W);if(G.length)return G;var w=this.parent();if(!w.length)return G;return w.closest(W)},K.siblings=function(W){return A0(I(L0(N0(this,function(G){return I(G).parent().children().not(G)}))),W)},K.find=function(W){return I(L0(N0(this,function(G){return J0(W,G)})))};var i5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,c5=/^$|^module$|\/(java|ecma)script/i,p5=["type","src","nonce","noModule"];function s5(W,G){var w=I(W);w.filter("script").add(w.find("script")).each(function(O,L){if(c5.test(L.type)&&X.contains(L)){var A=H("script");A.text=L.textContent.replace(i5,""),F(p5,function(y,r){if(L[r])A[r]=L[r]}),G.head.insertBefore(A,null),G.head.removeChild(A)}})}function o5(W,G,w,O,L){if(O)W.insertBefore(G,w?W.firstChild:null);else if(W.nodeName==="HTML")W.parentNode.replaceChild(G,W);else W.parentNode.insertBefore(G,w?W:W.nextSibling);if(L)s5(G,W.ownerDocument)}function $0(W,G,w,O,L,A,y,r){return F(W,function(I0,q0){F(I(q0),function(M0,b0){F(I(G),function(F0,t0){var $1=w?b0:t0,S1=w?t0:b0,K0=w?M0:F0;o5($1,!K0?S1:S1.cloneNode(!0),O,L,!K0)},r)},y)},A),G}K.after=function(){return $0(arguments,this,!1,!1,!1,!0,!0)},K.append=function(){return $0(arguments,this,!1,!1,!0)};function l5(W){if(!arguments.length)return this[0]&&this[0].innerHTML;if(C(W))return this;var G=/<script[\s>]/.test(W);return this.each(function(w,O){if(!$(O))return;if(G)I(O).empty().append(W);else O.innerHTML=W})}K.html=l5,K.appendTo=function(W){return $0(arguments,this,!0,!1,!0)},K.wrapInner=function(W){return this.each(function(G,w){var O=I(w),L=O.contents();L.length?L.wrapAll(W):O.append(W)})},K.before=function(){return $0(arguments,this,!1,!0)},K.wrapAll=function(W){var G=I(W),w=G[0];while(w.children.length)w=w.firstElementChild;return this.first().before(G),this.appendTo(w)},K.wrap=function(W){return this.each(function(G,w){var O=I(W)[0];I(w).wrapAll(!G?O:O.cloneNode(!0))})},K.insertAfter=function(W){return $0(arguments,this,!0,!1,!1,!1,!1,!0)},K.insertBefore=function(W){return $0(arguments,this,!0,!0)},K.prepend=function(){return $0(arguments,this,!1,!0,!0,!0,!0)},K.prependTo=function(W){return $0(arguments,this,!0,!0,!0,!1,!1,!0)},K.contents=function(){return I(L0(N0(this,function(W){return W.tagName==="IFRAME"?[W.contentDocument]:W.tagName==="TEMPLATE"?W.content.childNodes:W.childNodes})))},K.next=function(W,G,w){return A0(I(L0(N0(this,"nextElementSibling",G,w))),W)},K.nextAll=function(W){return this.next(W,!0)},K.nextUntil=function(W,G){return this.next(G,!0,W)},K.parents=function(W,G){return A0(I(L0(N0(this,"parentElement",!0,G))),W)},K.parentsUntil=function(W,G){return this.parents(G,W)},K.prev=function(W,G,w){return A0(I(L0(N0(this,"previousElementSibling",G,w))),W)},K.prevAll=function(W){return this.prev(W,!0)},K.prevUntil=function(W,G){return this.prev(G,!0,W)},K.map=function(W){return I(j.apply([],f.call(this,function(G,w){return W.call(G,w,G)})))},K.clone=function(){return this.map(function(W,G){return G.cloneNode(!0)})},K.offsetParent=function(){return this.map(function(W,G){var w=G.offsetParent;while(w&&c(w,"position")==="static")w=w.offsetParent;return w||X})},K.slice=function(W,G){return I(p.call(this,W,G))};var r5=/-([a-z])/g;function C1(W){return W.replace(r5,function(G,w){return w.toUpperCase()})}K.ready=function(W){var G=function(){return setTimeout(W,0,I)};if(J.readyState!=="loading")G();else J.addEventListener("DOMContentLoaded",G);return this},K.unwrap=function(){return this.parent().each(function(W,G){if(G.tagName==="BODY")return;var w=I(G);w.replaceWith(w.children())}),this},K.offset=function(){var W=this[0];if(!W)return;var G=W.getBoundingClientRect();return{top:G.top+Z.pageYOffset,left:G.left+Z.pageXOffset}},K.position=function(){var W=this[0];if(!W)return;var G=c(W,"position")==="fixed",w=G?W.getBoundingClientRect():this.offset();if(!G){var O=W.ownerDocument,L=W.offsetParent||O.documentElement;while((L===O.body||L===O.documentElement)&&c(L,"position")==="static")L=L.parentNode;if(L!==W&&$(L)){var A=I(L).offset();w.top-=A.top+t(L,"borderTopWidth"),w.left-=A.left+t(L,"borderLeftWidth")}}return{top:w.top-t(W,"marginTop"),left:w.left-t(W,"marginLeft")}};var l1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};K.prop=function(W,G){if(!W)return;if(k(W)){if(W=l1[W]||W,arguments.length<2)return this[0]&&this[0][W];return this.each(function(O,L){L[W]=G})}for(var w in W)this.prop(w,W[w]);return this},K.removeProp=function(W){return this.each(function(G,w){delete w[l1[W]||W]})};var n5=/^--/;function N1(W){return n5.test(W)}var R1={},a5=q.style,t5=["webkit","moz","ms"];function e5(W,G){if(G===void 0)G=N1(W);if(G)return W;if(!R1[W]){var w=C1(W),O="".concat(w[0].toUpperCase()).concat(w.slice(1)),L="".concat(w," ").concat(t5.join("".concat(O," "))).concat(O).split(" ");F(L,function(A,y){if(y in a5)return R1[W]=y,!1})}return R1[W]}var J8={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function r1(W,G,w){if(w===void 0)w=N1(W);return!w&&!J8[W]&&R(G)?"".concat(G,"px"):G}function Z8(W,G){if(k(W)){var w=N1(W);if(W=e5(W,w),arguments.length<2)return this[0]&&c(this[0],W,w);if(!W)return this;return G=r1(W,G,w),this.each(function(L,A){if(!$(A))return;if(w)A.style.setProperty(W,G);else A.style[W]=G})}for(var O in W)this.css(O,W[O]);return this}K.css=Z8;function n1(W,G){try{return W(G)}catch(w){return G}}var Q8=/^\s+|\s+$/;function a1(W,G){var w=W.dataset[G]||W.dataset[C1(G)];if(Q8.test(w))return w;return n1(JSON.parse,w)}function W8(W,G,w){w=n1(JSON.stringify,w),W.dataset[C1(G)]=w}function X8(W,G){if(!W){if(!this[0])return;var w={};for(var O in this[0].dataset)w[O]=a1(this[0],O);return w}if(k(W)){if(arguments.length<2)return this[0]&&a1(this[0],W);if(C(G))return this;return this.each(function(L,A){W8(A,W,G)})}for(var O in W)this.data(O,W[O]);return this}K.data=X8;function t1(W,G){var w=W.documentElement;return Math.max(W.body["scroll".concat(G)],w["scroll".concat(G)],W.body["offset".concat(G)],w["offset".concat(G)],w["client".concat(G)])}F([!0,!1],function(W,G){F(["Width","Height"],function(w,O){var L="".concat(G?"outer":"inner").concat(O);K[L]=function(A){if(!this[0])return;if(N(this[0]))return G?this[0]["inner".concat(O)]:this[0].document.documentElement["client".concat(O)];if(V(this[0]))return t1(this[0],O);return this[0]["".concat(G?"offset":"client").concat(O)]+(A&&G?t(this[0],"margin".concat(w?"Top":"Left"))+t(this[0],"margin".concat(w?"Bottom":"Right")):0)}})}),F(["Width","Height"],function(W,G){var w=G.toLowerCase();K[w]=function(O){if(!this[0])return C(O)?void 0:this;if(!arguments.length){if(N(this[0]))return this[0].document.documentElement["client".concat(G)];if(V(this[0]))return t1(this[0],G);return this[0].getBoundingClientRect()[w]-Z0(this[0],!W)}var L=parseInt(O,10);return this.each(function(A,y){if(!$(y))return;var r=c(y,"boxSizing");y.style[w]=r1(w,L+(r==="border-box"?Z0(y,!W):0))})}});var e1="___cd";K.toggle=function(W){return this.each(function(G,w){if(!$(w))return;var O=D0(w),L=C(W)?O:W;if(L){if(w.style.display=w[e1]||"",D0(w))w.style.display=z0(w.tagName)}else if(!O)w[e1]=c(w,"display"),w.style.display="none"})},K.hide=function(){return this.toggle(!1)},K.show=function(){return this.toggle(!0)};var J5="___ce",P1=".",E1={focus:"focusin",blur:"focusout"},Z5={mouseenter:"mouseover",mouseleave:"mouseout"},H8=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function T1(W){return Z5[W]||E1[W]||W}function A1(W){var G=W.split(P1);return[G[0],G.slice(1).sort()]}K.trigger=function(W,G){if(k(W)){var w=A1(W),O=w[0],L=w[1],A=T1(O);if(!A)return this;var y=H8.test(A)?"MouseEvents":"HTMLEvents";W=J.createEvent(y),W.initEvent(A,!0,!0),W.namespace=L.join(P1),W.___ot=O}W.___td=G;var r=W.___ot in E1;return this.each(function(I0,q0){if(r&&x(q0[W.___ot]))q0["___i".concat(W.type)]=!0,q0[W.___ot](),q0["___i".concat(W.type)]=!1;q0.dispatchEvent(W)})};function Q5(W){return W[J5]=W[J5]||{}}function q8(W,G,w,O,L){var A=Q5(W);A[G]=A[G]||[],A[G].push([w,O,L]),W.addEventListener(G,L)}function W5(W,G){return!G||!X0.call(G,function(w){return W.indexOf(w)<0})}function a0(W,G,w,O,L){var A=Q5(W);if(!G)for(G in A)a0(W,G,w,O,L);else if(A[G])A[G]=A[G].filter(function(y){var r=y[0],I0=y[1],q0=y[2];if(L&&q0.guid!==L.guid||!W5(r,w)||O&&O!==I0)return!0;W.removeEventListener(G,q0)})}K.off=function(W,G,w){var O=this;if(C(W))this.each(function(A,y){if(!$(y)&&!V(y)&&!N(y))return;a0(y)});else if(!k(W))for(var L in W)this.off(L,W[L]);else{if(x(G))w=G,G="";F(S(W),function(A,y){var r=A1(y),I0=r[0],q0=r[1],M0=T1(I0);O.each(function(b0,F0){if(!$(F0)&&!V(F0)&&!N(F0))return;a0(F0,M0,q0,G,w)})})}return this},K.remove=function(W){return A0(this,W).detach().off(),this},K.replaceWith=function(W){return this.before(W).remove()},K.replaceAll=function(W){return I(W).replaceWith(this),this};function G8(W,G,w,O,L){var A=this;if(!k(W)){for(var y in W)this.on(y,G,w,W[y],L);return this}if(!k(G))if(C(G)||v(G))G="";else if(C(w))w=G,G="";else O=w,w=G,G="";if(!x(O))O=w,w=void 0;if(!O)return this;return F(S(W),function(r,I0){var q0=A1(I0),M0=q0[0],b0=q0[1],F0=T1(M0),t0=M0 in Z5,$1=M0 in E1;if(!F0)return;A.each(function(S1,K0){if(!$(K0)&&!V(K0)&&!N(K0))return;var b1=function(G0){if(G0.target["___i".concat(G0.type)])return G0.stopImmediatePropagation();if(G0.namespace&&!W5(b0,G0.namespace.split(P1)))return;if(!G&&($1&&(G0.target!==K0||G0.___ot===F0)||t0&&G0.relatedTarget&&K0.contains(G0.relatedTarget)))return;var g1=K0;if(G){var h0=G0.target;while(!f0(h0,G)){if(h0===K0)return;if(h0=h0.parentNode,!h0)return}g1=h0}Object.defineProperty(G0,"currentTarget",{configurable:!0,get:function(){return g1}}),Object.defineProperty(G0,"delegateTarget",{configurable:!0,get:function(){return K0}}),Object.defineProperty(G0,"data",{configurable:!0,get:function(){return w}});var M8=O.call(g1,G0,G0.___td);if(L)a0(K0,F0,b0,G,b1);if(M8===!1)G0.preventDefault(),G0.stopPropagation()};b1.guid=O.guid=O.guid||I.guid++,q8(K0,F0,b0,G,b1)})}),this}K.on=G8;function B8(W,G,w,O){return this.on(W,G,w,O,!0)}K.one=B8;var z8=/\r?\n/g;function Y8(W,G){return"&".concat(encodeURIComponent(W),"=").concat(encodeURIComponent(G.replace(z8,"\r\n")))}var w8=/file|reset|submit|button|image/i,X5=/radio|checkbox/i;if(K.serialize=function(){var W="";return this.each(function(G,w){F(w.elements||[w],function(O,L){if(L.disabled||!L.name||L.tagName==="FIELDSET"||w8.test(L.type)||X5.test(L.type)&&!L.checked)return;var A=o1(L);if(!C(A)){var y=M(A)?A:[A];F(y,function(r,I0){W+=Y8(L.name,I0)})}})}),W.slice(1)},typeof q5!=="undefined")G5.exports=I;else Z.cash=Z.$=I})()});class J1{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,Z){this.callbacks.set(J,Z)}unregister(J){this.callbacks.delete(J)}queue(J){if(!this.callbacks.has(J))return;if(this.pendingComponents.add(J),!this.isPending)this.isPending=!0,this.schedule()}schedule(){Promise.resolve().then(()=>this.process())}process(){const J=Array.from(this.pendingComponents);this.pendingComponents.clear(),this.isPending=!1,J.forEach((Z)=>{try{const X=this.callbacks.get(Z);if(X)X()}catch(X){console.error(`Error updating component ${Z}:`,X)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class Z1{subscriptions=new Map;tick=new J1;register(J,Z){this.subscriptions.set(J,Z),this.tick.register(J,Z)}unregister(J){this.subscriptions.delete(J),this.tick.unregister(J)}queueUpdate(J){this.tick.queue(J)}dispose(){this.subscriptions.clear(),this.tick.dispose()}prepareForPotentialUnload(){this.tick.clear(),this.subscriptions.forEach((J,Z)=>{this.subscriptions.set(Z,()=>{})})}proxyState(J,Z){const X=this,H=new WeakMap,q=(B)=>{if(typeof B.toJSON==="function")return B;if(B instanceof Map)B.forEach((M,z)=>B.set(z,Q(M)));else if(Array.isArray(B))B.forEach((M,z)=>B[z]=Q(M));else if(typeof B==="object")Object.entries(B).forEach(([M,z])=>B[M]=Q(z));let Y=new Proxy(B,{get(M,z){if(z==="toJSON")return function(){const U=(b)=>{if(!b||typeof b!=="object")return b;if(H.has(b)){const f=H.get(b);if(f instanceof Map){const p={};return f.forEach((X0,s)=>p[typeof s==="object"?JSON.stringify(s):String(s)]=U(X0)),p}if(Array.isArray(f))return f.map((p)=>U(p));const T={};return Object.entries(f).forEach(([p,X0])=>T[p]=U(X0)),T}if(typeof b.toJSON==="function"&&!H.has(b))return b.toJSON();return b};return U(Y)};if(z==="reset")return function(){Y=null};const j=M[z];if(B instanceof Map&&typeof j==="function")return function(...U){const b=z.toString();if(b==="set"&&U.length>=2)U[1]=Q(U[1]);const f=j.apply(M,U);return["set","delete","clear"].includes(b)&&X.queueUpdate(J),f};if(Array.isArray(B)&&typeof j==="function")return function(...U){const b=z.toString();if(["push","unshift"].includes(b))U=U.map((T)=>Q(T));else if(b==="splice"&&U.length>2)U=[U[0],U[1],...U.slice(2).map((T)=>Q(T))];const f=j.apply(M,U);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(b)&&X.queueUpdate(J),f};return j},set(M,z,j){if(M[z]===j)return!0;if(j instanceof Map&&M[z]instanceof Map){const U=M[z];return U.clear(),j.forEach((b,f)=>U.set(f,Q(b))),X.queueUpdate(J),!0}return M[z]=Q(j),X.queueUpdate(J),!0}});return H.set(Y,B),Y},Q=(B)=>{if(!B)return B;return B instanceof Map||Array.isArray(B)||typeof B==="object"?q(B):B};return q(Z)}}class Q1{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Z)=>{try{const X=Z.node;if(!X){this.unwatch(Z);return}if(J.type==="attach"&&document.contains(X[0]))this.unwatch(Z),Z.emit("component:attached"),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();else if(J.type==="detach"&&!document.contains(X[0]))this.unwatch(Z),Z.emit("component:detached"),typeof Z.onDetach=="function"&&Z.onDetach.bind(Z)()}catch(X){console.log("DWS error --",X)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Z="attach"){const X=J.node;if(!X)return;if(Z==="attach"&&document.contains(X[0])){J.emit("component:attached"),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Z==="detach"&&!document.contains(X[0])){J.emit("component:detached"),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const H=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Z}ment-timeout`)},this.TIMEOUT);this.observedComponents.set(J,{timeout:H,type:Z}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Z==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const Z=this.observedComponents.get(J);if(Z)clearTimeout(Z.timeout),this.observedComponents.delete(J);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((J)=>clearTimeout(J.timeout)),this.observedComponents.clear()}}var W1=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(X,H)=>{return Z[H]!==void 0?Z[H].toString():`{${H}}`})},H5=(J,Z,X,H,q)=>{switch(J){case"plural":{if(typeof X==="string"){console.warn("Plural format value cannot be a string");return}if(H.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let Y=X["*"];if(typeof Y==="object")Y=Y[q||"*"];return W1(Y,H)}if(typeof H.count==="string")H.count=Number(H.count);let Q="*";if(H.count.toString()in X)Q=H.count.toString();let B=X[Q]||X["*"];if(typeof B==="object")B=B[q||"*"];return W1(B,H)}case"condition":{if(typeof X==="string"){console.warn("Condition format value cannot be a string");return}let Q;for(let B in X)try{if(new Function("params",`with( params ){ return ${B}; }`)(H||{})){Q=X[B];break}}catch(Y){console.warn(`Invalid <${Z}(${B})> condition expression`)}if(Q===void 0)return;if(typeof Q==="object")Q=Q[q||"*"];return W1(Q,H)}case"variable":default:{const Q=typeof X==="object"?X[q||"*"]:X;if(typeof Q==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return W1(Q,H)}}};class X1{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,Z){this.DICTIONARIES[J]=Z}translate(J,Z){if(Z&&this.currentLang===Z)return{text:J,lang:this.currentLang};Z=Z||this.currentLang;const[X,H]=Z.split("-");if(this.DICTIONARIES[X]&&J in this.DICTIONARIES[X]){if(typeof this.DICTIONARIES[X][J]==="object"){const q=this.DICTIONARIES[X][J];J=q[H||"*"]||q["*"]}else if(typeof this.DICTIONARIES[X][J]==="string")J=this.DICTIONARIES[X][J]}return{text:J,lang:Z}}format(J,Z,X){X=X||this.currentLang;const[H,q]=X.split("-");if(!this.DICTIONARIES[H]){console.warn(`Undefined <${X}> format dictionary`);return}if(!this.DICTIONARIES[H][J]){console.warn(`Undefined <${X}[${J}]> format reference`);return}const Q=this.DICTIONARIES[H][J];if(typeof Q==="string"){console.warn(`Invalid <${X}[${J}]> format reference. Expected object`);return}if(typeof Q!=="object"||Q===null||Array.isArray(Q)){console.warn(`Invalid <${X}[${J}]> format value`);return}return H5(Q.type,J,Q.value,Z,q)}}var T5=e0(c0(),1);var H1="comm",q1="rule",G1="decl";var B5="@import";var z5="@namespace",Y5="@keyframes";var w5="@layer";function B1(J){return J.trim()}function _0(J,Z,X){return J.replace(Z,X)}function M5(J,Z,X){return J.indexOf(Z,X)}function R0(J,Z){return J.charCodeAt(Z)|0}function P0(J,Z,X){return J.slice(Z,X)}function Y0(J){return J.length}function z1(J){return J.length}function y0(J,Z){return Z.push(J),J}var k1=Math.abs,p0=String.fromCharCode;function w1(J,Z,X,H,q,Q,B,Y){return{value:J,root:Z,parent:X,type:H,props:q,children:Q,line:Y1,column:v0,length:B,return:"",siblings:Y}}function U5(){return H0}function O5(){if(H0=O0>0?R0(m0,--O0):0,v0--,H0===10)v0=1,Y1--;return H0}function j0(){if(H0=O0<K5?R0(m0,O0++):0,v0++,H0===10)v0=1,Y1++;return H0}function E0(){return R0(m0,O0)}function s0(){return O0}function M1(J,Z){return P0(m0,J,Z)}function u0(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function j5(J){return Y1=v0=1,K5=Y0(m0=J),O0=0,[]}function D5(J){return m0="",J}function K1(J){return B1(M1(O0-1,f1(J===91?J+2:J===40?J+1:J)))}function I5(J){while(H0=E0())if(H0<33)j0();else break;return u0(J)>2||u0(H0)>3?"":" "}function F5(J,Z){while(--Z&&j0())if(H0<48||H0>102||H0>57&&H0<65||H0>70&&H0<97)break;return M1(J,s0()+(Z<6&&E0()==32&&j0()==32))}function f1(J){while(j0())switch(H0){case J:return O0;case 34:case 39:if(J!==34&&J!==39)f1(H0);break;case 40:if(J===41)f1(J);break;case 92:j0();break}return O0}function V5(J,Z){while(j0())if(J+H0===57)break;else if(J+H0===84&&E0()===47)break;return"/*"+M1(Z,O0-1)+"*"+p0(J===47?J:j0())}function L5(J){while(!u0(E0()))j0();return M1(J,O0)}var Y1=1,v0=1,K5=0,O0=0,H0=0,m0="";function R5(J){return D5(U1("",null,null,null,[""],J=j5(J),0,[0],J))}function U1(J,Z,X,H,q,Q,B,Y,M){var z=0,j=0,U=B,b=0,f=0,T=0,p=1,X0=1,s=1,i=0,m="",o=q,l=Q,J0=H,d=m;while(X0)switch(T=i,i=j0()){case 40:if(T!=108&&R0(d,U-1)==58){if(M5(d+=_0(K1(i),"&","&\f"),"&\f",k1(z?Y[z-1]:0))!=-1)s=-1;break}case 34:case 39:case 91:d+=K1(i);break;case 9:case 10:case 13:case 32:d+=I5(T);break;case 92:d+=F5(s0()-1,7);continue;case 47:switch(E0()){case 42:case 47:if(y0(F8(V5(j0(),s0()),Z,X,M),M),(u0(T||1)==5||u0(E0()||1)==5)&&Y0(d)&&P0(d,-1,void 0)!==" ")d+=" ";break;default:d+="/"}break;case 123*p:Y[z++]=Y0(d)*s;case 125*p:case 59:case 0:switch(i){case 0:case 125:X0=0;case 59+j:if(s==-1)d=_0(d,/\f/g,"");if(f>0&&(Y0(d)-U||p===0&&T===47))y0(f>32?N5(d+";",H,X,U-1,M):N5(_0(d," ","")+";",H,X,U-2,M),M);break;case 59:d+=";";default:if(y0(J0=C5(d,Z,X,z,j,q,Y,m,o=[],l=[],U,Q),Q),i===123)if(j===0)U1(d,Z,J0,J0,o,Q,U,Y,l);else{switch(b){case 99:if(R0(d,3)===110)break;case 108:if(R0(d,2)===97)break;default:j=0;case 100:case 109:case 115:}if(j)U1(J,J0,J0,H&&y0(C5(J,J0,J0,0,0,q,Y,m,q,o=[],U,l),l),q,l,U,Y,H?o:l);else U1(d,J0,J0,J0,[""],l,0,Y,l)}}z=j=f=0,p=s=1,m=d="",U=B;break;case 58:U=1+Y0(d),f=T;default:if(p<1){if(i==123)--p;else if(i==125&&p++==0&&O5()==125)continue}switch(d+=p0(i),i*p){case 38:s=j>0?1:(d+="\f",-1);break;case 44:Y[z++]=(Y0(d)-1)*s,s=1;break;case 64:if(E0()===45)d+=K1(j0());b=E0(),j=U=Y0(m=d+=L5(s0())),i++;break;case 45:if(T===45&&Y0(d)==2)p=0}}return Q}function C5(J,Z,X,H,q,Q,B,Y,M,z,j,U){var b=q-1,f=q===0?Q:[""],T=z1(f);for(var p=0,X0=0,s=0;p<H;++p)for(var i=0,m=P0(J,b+1,b=k1(X0=B[p])),o=J;i<T;++i)if(o=B1(X0>0?f[i]+" "+m:_0(m,/&\f/g,f[i])))M[s++]=o;return w1(J,Z,X,q===0?q1:Y,M,z,j,U)}function F8(J,Z,X,H){return w1(J,Z,X,H1,p0(U5()),P0(J,2,-2),0,H)}function N5(J,Z,X,H,q){return w1(J,Z,X,G1,P0(J,0,H),P0(J,H+1,-1),H,q)}function O1(J,Z){var X="";for(var H=0;H<J.length;H++)X+=Z(J[H],H,J,Z)||"";return X}function P5(J,Z,X,H){switch(J.type){case w5:if(J.children.length)break;case B5:case z5:case G1:return J.return=J.return||J.value;case H1:return"";case Y5:return J.return=J.value+"{"+O1(J.children,H)+"}";case q1:if(!Y0(J.value=J.props.join(",")))return""}return Y0(X=O1(J.children,H))?J.return=J.value+"{"+X+"}":""}function E5(J){var Z=z1(J);return function(X,H,q,Q){var B="";for(var Y=0;Y<Z;Y++)B+=J[Y](X,H,q,Q)||"";return B}}class d0{nsp;settings;$head;constructor(J,Z){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=T5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return O1(R5(J),E5([P5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const X=new MutationObserver(()=>{const H=document.querySelector(J);if(H&&getComputedStyle(H).cssText)X.disconnect(),Z()});X.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(J){if(!J)throw new Error("Invalid injection arguments");const Z=`rel="${this.settings.meta?"@":""}${this.nsp}"`;J=this.settings.meta?J:`[rel="${this.nsp}"] { ${J} }`;try{const X=this.compile(J);if(!X)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const H=document.createElement("style");H.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),H.textContent=X;let q=0;const Q=this.$head.find(`style[${Z}]`);if(Q.length)q=parseInt(Q.attr("dindex"))+1,Q.remove();return H.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(H):document.head.appendChild(H),H}catch(X){throw new Error(`Style injection failed: ${X.message}`)}}async load(J){if(this.settings=J,typeof this.settings!=="object")throw new Error("Undefined styles settings");if(this.settings.sheet){const Z=await this.inject(this.settings.sheet);await this.waitForStyles(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`)}}get(){}async clear(){const J=this.$head.find(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`);if(!J.length)return;const Z=parseInt(J.attr("dindex"));Z===0?J.remove():J.attr("dindex",String(Z-1))}async custom(){return{}}async style(){return{}}}class j1{pending=new Map;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){const Z=J.priority??2;if(!this.pending.has(Z))this.pending.set(Z,new Set);if(this.pending.get(Z)?.add(J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}apply({dep:J,deppath:Z},X="batch-updator"){try{const H=this.component.FGUD.get(J)?.get(Z);if(!H){console.warn(`[batch update]: <${Z}> dependency not found`);return}if(H.garbage){this.component.FGUD.get(J)?.delete(Z),!this.component.FGUD.get(J)?.size&&this.component.FGUD.delete(J);return}const q=this.component.FGUDMemory.get(H.nodepath);if(!q)return;const Q=H.update(q.memo||{},X);if(Q){if(typeof Q.memo==="object")q.memo=Q.memo;typeof Q.cleanup==="function"&&Q.cleanup()}}catch(H){console.error("Failed to update dependency --",H)}}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=new Map;this.pending.forEach((H,q)=>J.set(q,new Set(H))),this.pending.clear(),this.isPending=!1;const Z=(H)=>{const q=Array.from(H);this.component.metrics.trackBatch(q.length),this.metrics.batchCount++,this.metrics.lastBatchSize=q.length,this.metrics.updatesProcessed+=q.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),q.forEach((Q)=>this.apply(Q))},X=Array.from(J.keys()).sort((H,q)=>H-q);for(let H of X){const q=J.get(H);q&&q.size&&Z(q)}if(this.pending.size>0&&!this.isPending)this.isPending=!0,this.scheduleProcessing()}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class D1{options={emit:!0};__events={};__once_events={};constructor(J){if(J)this.options=J}on(J,Z){if(!Array.isArray(this.__events[J]))this.__events[J]=[];return this.__events[J].push(Z),this}once(J,Z){if(!Array.isArray(this.__once_events[J]))this.__once_events[J]=[];return this.__once_events[J].push(Z),this}off(J){return delete this.__events[J],delete this.__once_events[J],this}emit(J,...Z){if(!this.options.emit)return;const X=(q)=>{if(typeof q.toJSON==="function")return q.toJSON();if(Array.isArray(q))return q.map(X);if(typeof q==="object")for(let Q in q)q[Q]=X(q[Q]);return q},H=Z.map(X);this.__events[J]?.forEach((q)=>q(...H)),this.__once_events[J]?.forEach((q)=>q(...H)),delete this.__once_events[J]}}var h1=e0(c0(),1);function B0(J,Z){if(J===Z)return!1;if(typeof J!=="object"||typeof Z!=="object")return!1;if(J===null||Z===null)return!0;if(J instanceof Set){if(!(Z instanceof Set))return!0;if(J.size!==Z.size)return!0;if(A5(J)&&A5(Z)){for(let B of J)if(!Z.has(B))return!0;return!1}const Q=new WeakMap;for(let B of J){let Y=!1;if(typeof B!=="object"){if(Z.has(B))Y=!0}else for(let M of Z){if(typeof M!=="object")continue;if(!Q.has(B))Q.set(B,new WeakMap);const z=Q.get(B);if(z.has(M)){if(Y=z.get(M),Y)break;continue}const j=!B0(B,M);if(z.set(M,j),j){Y=!0;break}}if(!Y)return!0}return!1}if(J instanceof Map){if(!(Z instanceof Map))return!0;if(J.size!==Z.size)return!0;if($5(J)&&$5(Z)){for(let[B,Y]of J)if(Z.get(B)!==Y)return!0;return!1}const Q=new WeakMap;for(let[B,Y]of J){if(typeof B!=="object"){if(!Z.has(B))return!0;const j=Z.get(B);if(typeof Y!=="object"){if(Y!==j)return!0;continue}if(typeof j!=="object"||B0(Y,j))return!0;continue}let M=!1,z=!1;for(let[j,U]of Z){if(typeof j!=="object")continue;if(!Q.has(B))Q.set(B,new WeakMap);const b=Q.get(B);if(b.has(j)){const[f,T]=b.get(j);if(f){M=!0,z=T;break}continue}if(!B0(B,j)){if(M=!0,z=typeof Y==="object"&&typeof U==="object"?!B0(Y,U):Y===U,b.set(j,[!0,z]),z)break}else b.set(j,[!1,!1])}if(!M||!z)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Z))return!0;if(J.length!==Z.length)return!0;for(let Q=0;Q<J.length;Q++){const B=J[Q],Y=Z[Q];if(B!==Y&&(typeof B!=="object"||B0(B,Y)))return!0}return!1}const X=Object.keys(J),H=Object.keys(Z);if(X.length!==H.length)return!0;X.sort(),H.sort();const q=X.length;for(let Q=0;Q<q;Q++)if(X[Q]!==H[Q])return!0;for(let Q=0;Q<q;Q++){const B=X[Q],Y=J[B],M=Z[B];if(Y===M)continue;if(Y instanceof Date){if(!(M instanceof Date)||String(Y)!==String(M))return!0;continue}if(Y instanceof RegExp){if(!(M instanceof RegExp)||Y.source!==M.source||Y.flags!==M.flags)return!0;continue}if(Y instanceof Map){if(!(M instanceof Map)||B0(Y,M))return!0;continue}if(Y instanceof Set){if(!(M instanceof Set)||B0(Y,M))return!0;continue}if(Y instanceof Function){if(!(M instanceof Function))return!0;continue}if(typeof Y==="object"){if(typeof M!=="object")return!0;if(Y===J){if(M!==Z)return!0}else if(B0(Y,M))return!0}else return!0}return!1}function w0(J,Z){if(J===Z)return!0;if(J==null||Z==null)return J===Z;const X=typeof J;if(X!==typeof Z)return!1;if(X!=="object"){if(X==="number"&&isNaN(J)&&isNaN(Z))return!0;return!1}if(J instanceof Date)return Z instanceof Date&&J.getTime()===Z.getTime();if(J instanceof RegExp)return Z instanceof RegExp&&J.source===Z.source&&J.flags===Z.flags;if(J instanceof Error)return Z instanceof Error&&J.name===Z.name&&J.message===Z.message&&(J.stack===Z.stack||!J.stack&&!Z.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(Z))return!1;if(J.byteLength!==Z.byteLength)return!1;const Y=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),M=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let z=0;z<Y.length;z++)if(Y[z]!==M[z])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!B0(J,Z);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Z))return!1;const Q=Object.getOwnPropertyNames(J),B=Object.getOwnPropertyNames(Z);if(Q.length!==B.length)return!1;for(let Y of Q){if(!Object.prototype.hasOwnProperty.call(Z,Y))return!1;if(!w0(J[Y],Z[Y]))return!1}if(q!==null&&q!==Object.prototype){const Y=Object.getOwnPropertyNames(q),M=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(Y.length!==M.length)return!1;for(let z of Y){if(z==="constructor")continue;if(!w0(q[z],Object.getPrototypeOf(Z)[z]))return!1}}return!0}function A5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function $5(J){for(let[Z,X]of J)if(typeof Z==="object"&&Z!==null||typeof X==="object"&&X!==null)return!1;return!0}function W0(J,Z=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Z.has(J))return Z.get(J);if(J instanceof Date)return new Date(J.getTime());if(J instanceof RegExp)return new RegExp(J.source,J.flags);if(J instanceof Map){const q=new Map;return Z.set(J,q),J.forEach((Q,B)=>q.set(W0(B,Z),W0(Q,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((Q)=>q.add(W0(Q,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let Q=0;Q<J.length;Q++)q[Q]=W0(J[Q],Z);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const X=Object.create(Object.getPrototypeOf(J));Z.set(J,X);const H=Object.getOwnPropertySymbols(J);for(let q of H)X[q]=W0(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))X[q]=W0(J[q],Z);return X}function _5(J,Z){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!Z||typeof Z!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Z).length)return{...J};function X(q,Q,B){const Y=Q.split(/\.|\[|\]/).filter(Boolean);let M=q;for(let z=0;z<Y.length;z++){const j=Y[z],U=!isNaN(Number(j)),b=z===Y.length-1,f=!isNaN(Number(Y[z+1]));if(b){M[j]=B;continue}if(!(j in M))M[j]=f?[]:{};else if(f&&!Array.isArray(M[j]))M[j]=[];else if(!f&&Array.isArray(M[j]))M[j]={};M=M[j]}}const H=W0(J);try{for(let[q,Q]of Object.entries(Z)){if(typeof q!=="string")throw new TypeError(`Invalid path: ${q}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(q))throw new Error(`Invalid path format: ${q}`);X(H,q,Q)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return H}function F1(J){return JSON.parse(JSON.stringify(J))}var S0="i18n",T0="syn:",V0="fn:",g0="on-",U0=/^\.\.\./,I1=/^\[(.*?)\]$/,_1=/{\s*([^{}]+)\s*}/g,S5=["@html","@text","@format"],b5=["display","visibility","position","width","height"],g5=":n",y1=":pr",x5="m",k5="c",f5="x",o0="*",h5=100;h1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&h1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class V1{debug;initialStats={renderCount:0,elementCount:0,renderTime:0,avgRenderTime:0,maxRenderTime:0,componentCount:0,componentUpdateCount:0,partialCount:0,partialUpdateCount:0,memoryUsage:void 0,domOperations:0,domInsertsCount:0,domUpdatesCount:0,domRemovalsCount:0,i18nTrackCount:0,i18nUpdateCount:0,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(J=!1){if(this.debug=J,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const J=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");J.push({timestamp:Date.now(),metrics:{...this.stats}}),J.length>100&&J.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(J))}catch(J){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const J=performance.now()-this.renderStartTime;this.stats.renderTime=J,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,J),this.renderTimes.push(J),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((Z,X)=>Z+X,0)/this.renderTimes.length,this.renderStartTime=0,this.measurementCount++}inc(J){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]++}dec(J){if(!this.debug)return;if(typeof this.stats[J]==="number"&&this.stats[J]>0)this.stats[J]--}record(J,Z){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=Z}add(J,Z){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=Z}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=W0(this.initialStats)}log(){if(!this.debug)return;if(this.loggingInterval>1&&this.measurementCount%this.loggingInterval!==0)return;const J={"Render Count":this.stats.renderCount,"Element Count":this.stats.elementCount,"Avg Render Time (ms)":this.stats.avgRenderTime.toFixed(2),"Max Render Time (ms)":this.stats.maxRenderTime.toFixed(2)},Z={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},X={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},H={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},q={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},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(X),console.table(H),console.table(q),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 W0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var Q0=e0(c0(),1);var V8=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let X=J,H;while((H=Z.exec(J))!==null){const q=H[1],Q=H.index+H[0].length;let B=1,Y=Q;while(Y<J.length&&B>0){if(J[Y]==="(")B++;if(J[Y]===")")B--;Y++}if(B===0){const M=J.slice(Q,Y-1).trim(),z=J.slice(0,H.index),j=`${g0}${q}="${M}"`,U=J.slice(Y);X=z+j+U,J=X,Z.lastIndex=z.length+j.length}}return X},L8=function(J){const Z=[];let H=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,Q,B)=>{return Z.push(B),`<${Q}##TAG_ATTRS_${Z.length-1}##>`});for(let q=0;q<Z.length;q++){const Q=`##TAG_ATTRS_${q}##`,B=Z[q],Y=C8(B);H=H.replace(Q,Y)}return H},C8=function(J){let Z="",X=0,H=!1,q="",Q=0,B=0,Y=0;while(X<J.length){const M=J[X];if((M==='"'||M==="'")&&(X===0||J[X-1]!=="\\")){if(!H)H=!0,q=M;else if(M===q)H=!1}if(!H){if(M==="(")B++;else if(M===")")B--;else if(M==="{")Y++;else if(M==="}")Y--}if(!H&&B===0&&Y===0&&(M===" "||X===J.length-1)){let z=X;if(X===J.length-1)z=X+1;const j=J.substring(Q,z).trim();if(j){const U=N8(j);Z+=" "+U}Q=X+1}X++}return Z},N8=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===S0||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let X=J.substring(0,Z).trim(),H=J.substring(Z+1).trim();if(X.startsWith("@"))return X=!S5.includes(X)?X.slice(1):X,`:${X}=${H}`;if(X.startsWith(V0)||X.startsWith(g0))return J;if(H.startsWith('"')&&H.endsWith('"')||H.startsWith("'")&&H.endsWith("'")){const q=H.substring(1,H.length-1);if(R8(q))return`:${X}="${q}"`;return J}else return`:${X}="${H}"`};function R8(J){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(J))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(J))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(J))return!0;if(J.includes("{")&&J.includes("}"))return!0;return!1}function v1(J){let Z=(J||"").trim().replace(/>\s*</g,"><").replace(/\s{2,}/g," ").replace(/[\r\n\t]/g,"").replace(/<([a-zA-Z0-9_-]+)([^>]*?)\s*\/>/g,"<$1$2></$1>").replace(/<\{([^}]+)\}\s*(.*?)(\/)>/g,(X,H,q)=>{return q.endsWith("<")?`<lips dtag="${H}" ${q}/lips>`:`<lips dtag="${H}" ${q}></lips>`}).replace(/(<>)([\s\S]*?)(<\/>)/g,'<lips fragment="true">$2</lips>').replace(/<if\(\s*(.*?)\s*\)>/g,'<if @by="$1">').replace(/<else-if\(\s*(.*?)\s*\)>/g,'<else-if @by="$1">').replace(/<switch\(\s*(.*?)\s*\)>/g,'<switch @by="$1">').replace(/<async await\(\s*(.*?)\s*\)>/g,`<async ${V0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(X)=>X.replace(/\s+/g,""));return Z=V8(Z),Z=L8(Z),Z}var P8=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},v5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function x0(J,Z={maxSize:100}){const X=new Set,H=[{value:J,timestamp:Date.now()}];let q=0;const Q=()=>{const z=L1[L1.length-1];return z&&P8(z,X),H[q].value},B=()=>{const z=[...X];if(y5)for(let j of z)y5.add(j);else for(let j of z)j.execute()};return[Q,(z,j)=>{if(Object.is(H[q].value,z))return;if(q<H.length-1)H.splice(q+1);if(H.push({value:z,timestamp:Date.now(),metadata:j}),H.length>Z.maxSize)H.shift(),q=Math.max(0,q-1);else q++;B()},{undo(){if(q>0)q--,B()},redo(){if(q<H.length-1)q++,B()},jumpTo(z){if(z>=0&&z<H.length&&z!==q)q=z,B()},getHistory(){return[...H]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<H.length-1},clear(){const z=H[0];H.length=0,H.push(z),q=0,B()}}]}function l0(J){let Z=!1;const X=()=>{if(Z)throw new Error("Circular dependency detected");if(H.isDisposed)return;Z=!0,v5(H),L1.push(H);try{J()}finally{Z=!1,L1.pop()}},H={execute:X,dependencies:new Set,isDisposed:!1};return X(),{dispose:()=>{H.isDisposed=!0,v5(H)}}}var L1=[],y5=null;class k0 extends D1{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=new Map;FGUD=new Map;FGUDMemory=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;metrics;stylesheet;__inpath__="";__inpathCounter__=0;__renderDepth__=0;__boundaries__;constructor(J,Z,{input:X,state:H,context:q,_static:Q,handler:B,stylesheet:Y,macros:M,declaration:z},j){super();if(this.lips=j.lips,j?.debug)this.debug=j.debug||this.lips.debug;if(j?.prepath)this.prepath=j.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=this.__inpath__=`${this.prepath}:${this.__name__}`,this.__template__=v1(Z),this.__boundaries__=j.boundaries,this.declaration=z||{name:J},this.input=X||{},this.static=Q||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,H||{}),M&&this.setMacros(M),B&&this.setHandler(B),Y&&this.setStylesheet(Y),this.metrics=new V1(this.debug),this.metrics.inc("componentCount"),this.UQS=new j1(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create"),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(),this.emit("component:input");this.__previous={state:W0(this.state),input:W0(this.input),context:W0(this.context)};const[U,b]=x0(this.input),[f,T]=x0(this.state),[p,X0]=x0(this.context);this.__setInput=b,this.__setState=T,this.__getState=f,this.lips.IUC.register(this.__path__,()=>{B0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(s)=>{if(!B0(this.context,s))return;X0(s),this.context=s,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context")}),this.lips.useTranslator("*",(s)=>{if(s===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=s}),this.ICE=l0(()=>{const s=f(),i=this.input=U(),m=this.context=p();if(!this.isRendered){if(this.metrics.reset(),!this.__template__.length||z?.syntax&&typeof this.onSelfRender=="function"){const o=this.onSelfRender.bind(this)(this.input);if(!this.__boundaries__?.start||!this.__boundaries__?.end)throw new Error(`Undefined <${this.__name__} syntax component boundaries`);this.$=o||Q0.default()}else{const{$log:o}=this.render("",void 0,void 0,this.FGUD);this.$=o}!z?.syntax&&this.$?.each((o,l)=>{typeof l.setAttribute=="function"&&l.setAttribute("rel",this.__name__)}),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount"),this.lips.watcher.watch(this)}else this.__updateDepNodes__(),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update"),this.__previous={input:W0(i),state:W0(s),context:W0(m)};typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render")})}setContext(J,Z){this.lips.setContext(J,Z)}setInput(J,Z){if(!B0(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(this.declaration.syntax?Z:void 0)}subInput(J,Z){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(_5(this.input,J),this.declaration.syntax?Z:void 0),this}setMacros(J){const Z=v1(J),X=Q0.default(Z);if(!X.length)return;const H=this;X.each(function(){const q=Q0.default(this),{argv:Q,attrs:B}=H.__getAttributes__(q);if(!Object.keys(B))throw new Error("Invalid macro component definition");if(!B.literals.name)throw new Error("Undefined macro `name` attribute.");if(H.__macros.get(B.literals.name))console.warn(`Duplicate macro <${B.literals.name}> will be override`);if(!q.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");H.__macros.set(B.literals.name,{argv:Q,$node:q})})}setHandler(J){Object.entries(J).map(([Z,X])=>this[Z]=X?.bind(this))}setStylesheet(J){const Z={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new d0(this.__name__,Z)}get node(){if(!this.isRendered)throw new Error("node() is expected to be call after component get rendered");return this.$}get boundaries(){return this.__boundaries__}render(J,Z,X={},H,q){if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:H||new Map};const Q=this,B=H||new Map,Y=[];this.metrics.startRender();let M=Q0.default();function z(){return W0(X)}function j(K,I=!1){const D=U(K,I);return Q.__inpathCounter__++,Q.__inpath__?`${Q.__inpath__}/${D}`:`${J?J+"/":""}${D}`}function U(K,I=!1){let D="";switch(K){case"component":D=I?f5:k5;break;case"macro":D=x5;break}return D+Q.__inpathCounter__}function b(K){return K!==null&&typeof K==="object"&&typeof K.mesh==="function"&&typeof K.update==="function"}function f(K){return K!==null&&typeof K==="object"&&typeof K.default&&typeof K.default==="string"}function T(K){if(!K.attr(":dtag")||K.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const I=K.attr(":dtag"),D=Q.__evaluate__(I,X);if(b(D)||D===null)return i(K,I,D);else if(f(D))return m(K,{template:D});else return m(K,{name:D})}function p(K){const I=K.attr(":args"),D=j("log");if(!I)return;const N=z();if(Q.__evaluate__(`console.log(${I})`,N),Q.__isReactive__(I,N))Q.__extractExpressionDeps__(I,N).forEach((P)=>Q.__trackDep__(B,P,N,{nodetype:"log",nodepath:D,target:"argument",$fragment:null,update:($)=>Q.__evaluate__(`console.log(${I})`,$),syntax:!0}))}function X0(K){const I=j("var"),{attrs:D}=Q.__getAttributes__(K);if(!D)return;Object.entries(D.literals).forEach(([N,V])=>{if(X[N]&&X[N].type==="const")throw new Error(`Cannot override <const ${N}=[value]/> variable`);X[N]={value:V,type:"let"}}),Object.entries(D.expressions).forEach(([N,V])=>{if(X[N]&&X[N].type==="const")throw new Error(`Cannot override <const ${N}=[value]/> variable`);if(X[N]={value:Q.__evaluate__(V,X),type:"let"},Q.__isReactive__(V,X)){const P=Q.__extractExpressionDeps__(V,X),$=(u,n)=>{if(u[N]&&u[N].type==="const")throw new Error(`Cannot override <const ${N}=[value]/> variable`);if(D.map.beforeSpreadAttrs.includes(N))return;const x=Q.__evaluate__(V,u);if(w0(u[N].value,x))return;return u[N]={value:x,type:"let"},Q.__updateVarDepNodes__(N,I,u),F1({memo:u})};P.forEach((u)=>Q.__trackDep__(B,u,z(),{nodetype:"let",nodepath:I,deppath:`${I}.${N}`,target:"attr",$fragment:null,update:$,syntax:!0}))}}),Q.metrics.inc("elementCount")}function s(K){const{attrs:I}=Q.__getAttributes__(K);if(!I)return;Object.entries(I.literals).forEach(([D,N])=>{if(X[D]&&X[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!N)return;X[D]={value:N,type:"const"}}),Object.entries(I.expressions).forEach(([D,N])=>{if(X[D]&&X[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!N)return;X[D]={value:Q.__evaluate__(N,X),type:"const"}}),Q.metrics.inc("elementCount")}function i(K,I,D){const{attrs:N}=Q.__getAttributes__(K),V=j("element"),P=Q.__getBoundaries__(V),$={},u={};let n=z(),x=Q0.default(P.start),k={},C=D;if(C){N.literals&&Object.entries(N.literals).forEach(([R,h])=>{$[R]=h,k[R]={type:"arg",value:h}}),N.expressions&&Object.entries(N.expressions).forEach(([R,h])=>{if(!C)return;if(U0.test(R))Q.__evaluateSpreadAttr__(R,{memo:n,get keystore(){return u[R]},set keystore(F){if(!u[R])u[R]=[];u[R]=F},each:(F,E)=>{if($[F]=E,!C?.argv.includes(F))return;k[F]={type:"arg",value:E}}});else{const F=h?Q.__evaluate__(h,n):!0;if($[R]=F,!C.argv.includes(R))return;k[R]={type:"arg",value:F}}}),n.__arguments__=$;const v=C.mesh(k);if(v&&v.length)x=x.add(v);N.expressions&&Object.entries(N.expressions).forEach(([R,h])=>{if(!C)return;if(U0.test(R)&&Q.__isReactive__(R,n)){const F=Q.__extractExpressionDeps__(R,n),E=(_,S)=>{if(!C)return;const g={};let a=[];if(Q.__evaluateSpreadAttr__(R,{memo:_,get keystore(){return u[R]},set keystore(c){if(!u[R])u[R]=[];u[R]=c},each:(c,t)=>{if(N.map.afterSpreadAttrs.includes(c))return;if(!C?.argv.includes(c))return;if(w0(t,_[c]?.value))return;k[c]=g[c]={value:t,type:"arg"},$[c]=t,a.push(c)},nullify:(c)=>{c.forEach((t)=>{g[t]={value:void 0,type:"arg"},delete $[t]}),a=c}}),a.length)C.argv.length&&Q.__updateArgumentsDepNodes__(V,$),C.update(a,g,_,P)};F.forEach((_)=>Q.__trackDep__(B,_,n,{nodetype:"dynamic",nodepath:V,deppath:`${V}.${R}`,target:"spread-attr",$fragment:null,boundaries:P,update:E}))}else if(C.argv.includes(R)&&Q.__isReactive__(h,n)){const F=Q.__extractExpressionDeps__(h,n),E=(_,S)=>{if(!C)return;if(N.map.beforeSpreadAttrs.includes(R))return;const g=h?Q.__evaluate__(h,_):!0,a={type:"arg",value:g};if(k[R]=a,C.argv.length)$[R]=g,Q.__updateArgumentsDepNodes__(V,$);C.update([R],{[R]:a},_,P)};F.forEach((_)=>Q.__trackDep__(B,_,n,{nodetype:"dynamic",nodepath:V,deppath:`${V}.${R}`,target:"attr",$fragment:null,boundaries:P,update:E}))}})}if(Q.__isReactive__(I,n)){const v=(h,F)=>{const E=Q.__evaluate__(I,h);let _;if(f(E))_=m(K,{template:E}),Q.__fillBoundaries__(_,P);else if(b(E)){if(Object.entries(k).forEach(([S,g])=>{if(typeof g==="function")return;$[S]=g.value}),C?.cleanup(P),C=E,C)C.argv.length&&Q.__updateArgumentsDepNodes__(V,$),_=C.mesh(k),_?.length&&C.fill(_,P)}else if(C)C.cleanup(P),C=null};Q.__extractExpressionDeps__(I,n).forEach((h)=>Q.__trackDep__(B,h,{...n,...k},{nodetype:"dynamic",nodepath:V,deppath:`${V}.dtag`,target:"dtag",$fragment:null,boundaries:P,update:v}))}return x=x.add(P.end),x}function m(K,I){let D,N;if(I?.template)D=I.template,N=U("component",D.declaration?.syntax);else{if(N=I?.name||K.prop("tagName")?.toLowerCase(),!N)throw new Error("Invalid component");if(N===Q.__name__)throw new Error("Render component within itself is forbidden");D=Q.lips.import(N)}if(!D||!N)throw new Error(`<${N}> template not found`);const V=j("component",D.declaration?.syntax),P=`${V}#${N}`,$=Q.__getBoundaries__(V),{argv:u,functions:n,attrs:x,events:k}=Q.__getAttributes__(K),C={},v={};let R={},h=Q0.default($.start),F=Q.PCC.get(P),E=z();x.literals&&Object.entries(x.literals).forEach(([S,g])=>{if(S=="key")return;R[S]=g}),n&&Object.entries(n).forEach(([S,g])=>{R[S]=Q.__evaluateFunction__(g,[],E),D.declaration?.syntax?C[T0+V0+S]=g:C[V0+S]=g}),x.expressions&&Object.entries(x.expressions).forEach(([S,g])=>{if(S=="key")return;if(U0.test(S))Q.__evaluateSpreadAttr__(S,{memo:E,get keystore(){return v[S]},set keystore(a){if(!v[S])v[S]=[];v[S]=a},each:(a,c)=>R[a]=c});else R[S]=g?Q.__evaluate__(g,E):!0;D.declaration?.syntax?C[T0+S]=g:C[S]=g});const _=K.contents();if(_.length){if(R={...R,...Q.__meshwire__({$node:K,fragmentPath:V,fragmentBoundaries:$,meshPath:null,scope:E,argv:u,xmlns:q,useAttributes:!0,declaration:D.declaration},C)},D.declaration){if(D.declaration.tags){let S;Object.entries(D.declaration?.tags).forEach(([g,{type:a,many:c,alts:t}])=>{switch(a){case"nexted":{let Z0=K.next(g);if(!Z0.length&&Array.isArray(t)&&S?.length&&S.is(t.join(",")))Z0=S.next(g);if(!Z0.length)return;if(c){R[g]=[];let e=0,z0=!1;while(!z0){if(R[g].push(Q.__meshwire__({$node:Z0,meshPath:`${g}[${e}]`,fragmentPath:V,fragmentBoundaries:$,scope:E,argv:u,xmlns:q,useAttributes:!0,declaration:D.declaration},C)),!Z0.next(g).length){z0=!0;break}Z0=S=Z0.next(g),e++}}else R[g]=Q.__meshwire__({$node:Z0,meshPath:g,fragmentPath:V,fragmentBoundaries:$,scope:E,argv:u,xmlns:q,useAttributes:!0,declaration:D.declaration},C)}break;case"child":{const Z0=K.children(g);if(c)R[g]=[],Z0.each(function(e){const z0=Q0.default(this),{argv:D0}=Q.__getAttributes__(z0);R[g].push(Q.__meshwire__({$node:z0,meshPath:`${g}[${e}]`,fragmentPath:V,fragmentBoundaries:$,scope:E,argv:D0,xmlns:q,useAttributes:!0,declaration:D.declaration},C))});else if(K.children(g).first().length){const e=K.children(g).first(),{argv:z0}=Q.__getAttributes__(e);R[g]=Q.__meshwire__({$node:e,meshPath:g,fragmentPath:V,fragmentBoundaries:$,scope:E,argv:z0,xmlns:q,useAttributes:!0,declaration:D.declaration},C)}}break}})}else if(D.declaration.contents)R.__contents__=_}}if(F)F.setInput(W0(R)),h=h.add(F.node);else{const{declaration:S,state:g,_static:a,handler:c,context:t,default:Z0,stylesheet:e}=D;F=new k0(N,Z0||"",{state:W0(g),input:W0(R),context:t,_static:W0(a),handler:c,stylesheet:e,declaration:S},{debug:Q.debug,lips:Q.lips,prepath:V,boundaries:$}),h=h.add(F.node),!D.declaration?.syntax&&Q.PCC.set(P,F)}return h=h.add($.end),Object.entries(k).forEach(([S,g])=>{Q.__attachEvent__({nodepath:V,element:F,_event:S,instruction:g,scope:E,get __dependencies__(){return B}})}),C&&Object.entries(C).forEach(([S,g])=>{let a=!1,c=!1;if(S.startsWith(T0))a=!0,S=S.replace(T0,"");if(S.startsWith(V0))c=!0,S=S.replace(V0,"");if(U0.test(S)){if(Q.__isReactive__(S,E)){const t=(e)=>{const z0={};Q.__evaluateSpreadAttr__(S,{memo:e,get keystore(){return v[S]},set keystore(D0){if(!v[S])v[S]=[];v[S]=D0},each:(D0,f0)=>{if(x.map.afterSpreadAttrs.includes(D0))return;z0[D0]=f0},nullify:(D0)=>D0.forEach((f0)=>z0[f0]=void 0)}),F?.subInput(z0,e)};Q.__extractExpressionDeps__(S,E).forEach((e)=>Q.__trackDep__(B,e,E,{nodetype:"component",nodepath:V,deppath:`${V}.${S}`,target:"spread-attr",$fragment:null,boundaries:$,update:t,syntax:a}))}}else if(Q.__isReactive__(g,E)){const t=(e)=>{if(x.map.beforeSpreadAttrs.includes(S))return;const z0=c?Q.__evaluateFunction__(g,[],e):g?Q.__evaluate__(g,e):!0;F?.subInput({[S]:z0},e)};Q.__extractExpressionDeps__(g,E).forEach((e)=>Q.__trackDep__(B,e,E,{nodetype:"component",nodepath:V,deppath:`${V}.${S}`,target:"attr",$fragment:null,boundaries:$,update:t,syntax:a}))}}),Q.metrics.inc("componentCount"),h}function o(K){const I=K.prop("tagName")?.toLowerCase();if(!I)throw new Error("Invalid macro rendering call");const D=Q.__macros.get(I);if(!D)throw new Error("Macro component not found");const N=j("macro"),V=Q.__getBoundaries__(N),{attrs:P}=Q.__getAttributes__(K),$={},u=z(),n={},x={};P.literals&&Object.entries(P.literals).forEach(([F,E])=>{n[F]=E,x[F]={value:E,type:"arg"}});const k={};P.expressions&&Object.entries(P.expressions).forEach(([F,E])=>{if(U0.test(F))Q.__evaluateSpreadAttr__(F,{memo:u,get keystore(){return k[F]},set keystore(_){if(!k[F])k[F]=[];k[F]=_},each:(_,S)=>{if(n[_]=S,D.argv.includes(_))x[_]={value:S,type:"arg"}}}),$[F]=E;else{const _=E?Q.__evaluate__(E,u):!0;if(n[F]=_,D.argv.includes(F))x[F]={value:_,type:"arg"},$[F]=E}D.argv.forEach((_)=>{if(x[_]!==void 0)return;x[_]={value:!1,type:"arg"}})}),x.__arguments__=n;let C=Q0.default(V.start);const v={$node:D.$node,meshPath:null,fragmentPath:N,fragmentBoundaries:V,argv:D.argv,scope:u,xmlns:q,useAttributes:!0},R=Q.__meshwire__(v,$),h=R.renderer.mesh(x,u);return C=C.add(h),$&&Object.entries($).forEach(([F,E])=>{let _=!1;if(new RegExp(`^${T0}`).test(F))_=!0,F=F.replace(T0,"");if(U0.test(F)){if(!Q.__isReactive__(F,u))return;const S=Q.__extractExpressionDeps__(F,u),g=(a)=>{const c={};let t=[];if(Q.__evaluateSpreadAttr__(F,{memo:a,get keystore(){return k[F]},set keystore(Z0){if(!k[F])k[F]=[];k[F]=Z0},each:(Z0,e)=>{if(P.map.afterSpreadAttrs.includes(Z0))return;if(w0(e,a[Z0]?.value))return;c[Z0]={value:e,type:"arg"},n[Z0]=e,t.push(Z0)},nullify:(Z0)=>{Z0.forEach((e)=>{c[e]={value:void 0,type:"arg"},delete n[e]}),t=Z0}}),t.length)Q.__updateArgumentsDepNodes__(N,n),R.renderer.update(t,c,a);return F1({memo:{...a,...c}})};S.forEach((a)=>Q.__trackDep__(B,a,{...u,...x},{nodetype:"macro",nodepath:N,deppath:`${N}.${F}`,target:"spread-attr",$fragment:null,boundaries:V,update:g,syntax:_}))}else if(Q.__isReactive__(E,u)){const S=Q.__extractExpressionDeps__(E,u),g=(a)=>{if(P.map.beforeSpreadAttrs.includes(F))return;const c=E?Q.__evaluate__(E,a):!0;return n[F]=c,Q.__updateArgumentsDepNodes__(N,n),R.renderer.update([F],{[F]:{value:c,type:"arg"}},a),F1({memo:a})};S.forEach((a)=>Q.__trackDep__(B,a,{...u,...x},{nodetype:"macro",nodepath:N,deppath:`${N}.${F}`,target:"attr",$fragment:null,boundaries:V,update:g,syntax:_}))}}),C=C.add(V.end),Q.metrics.inc("elementCount"),C}function l(K){if(!K.length||!K.prop("tagName"))return K;const I=K.is("svg")||q,D=I?Q0.default(document.createElementNS("http://www.w3.org/2000/svg",K.prop("tagName").toLowerCase())):Q0.default(`<${K.prop("tagName").toLowerCase()}/>`),N=K.contents(),V=j("element"),P=z();N.length&&D.append(Q.__withPath__(V,()=>Q.render(V+g5,N,P,B,I).$log));const{attrs:$,events:u}=Q.__getAttributes__(K);$.literals&&Object.entries($.literals).forEach(([x,k])=>{if(x===S0)return;const C=K.is(`[${S0}]`)&&["title","placeholder"].includes(x);D.attr(x,C?Q.lips.i18n.translate(k).text:k);const v=(R)=>{D.attr(x,C?Q.lips.i18n.translate(k).text:k),C&&Q.__trackTranslationDep__(R,{nodetype:"element",nodepath:V,deppath:`${V}.${x}`,target:"attr",$fragment:D,update:v})};C&&Q.__trackTranslationDep__(P,{nodetype:"element",nodepath:V,deppath:`${V}.${x}`,target:"attr",$fragment:D,update:v})});const n=(x,k=!1)=>{x&&Object.entries(x).forEach(([C,v])=>{switch(C){case"@html":{const R=(h)=>{D.html(Q.__evaluate__(v,h))};if(R(P),k&&Q.__isReactive__(v,P))Q.__extractExpressionDeps__(v,P).forEach((F)=>Q.__trackDep__(B,F,P,{nodetype:"element",nodepath:V,deppath:`${V}.${C}`,target:"meta-attr",$fragment:D,update:R}))}break;case"@text":{const R=K.is(`[${S0}]`),h=(F)=>{D.text(Q.__evaluate__(v,F,{translate:R})),R&&Q.__trackTranslationDep__(F,{nodetype:"element",nodepath:V,deppath:`${V}.${C}`,target:"meta-attr",$fragment:D,update:h})};if(h(P),k&&Q.__isReactive__(v,P))Q.__extractExpressionDeps__(v,P).forEach((E)=>Q.__trackDep__(B,E,P,{nodetype:"element",nodepath:V,deppath:`${V}.${C}`,target:"meta-attr",$fragment:D,update:h}));R&&Q.__trackTranslationDep__(P,{nodetype:"element",nodepath:V,deppath:`${V}.${C}`,target:"meta-attr",$fragment:D,update:h})}break;case"@format":{const[R,h]=v.split(",").map((E)=>E.trim());if(!R)throw new Error("Invalid @format reference");if(!h)throw new Error("Invalid @format parameters");const F=(E)=>{const _=Q.__evaluate__(`!${h.trim()}`,E);if(typeof _!=="object")throw new Error("Invalid @format parameters");const S=Q.lips.i18n.format(R,_);S!==void 0&&D.text(S),Q.__trackTranslationDep__(E,{nodetype:"element",nodepath:V,deppath:`${V}.${C}`,target:"meta-attr",$fragment:D,update:F})};F(P),Q.__extractExpressionDeps__(h,P).forEach((E)=>Q.__trackDep__(B,E,P,{nodetype:"element",nodepath:V,deppath:`${V}.${C}`,target:"meta-attr",$fragment:D,update:F}))}break;case"style":if(k&&Q.__isReactive__(v,P)){const R=(F)=>{const E=Q.__evaluate__(v,F);if(typeof E==="object"){let _="";Object.entries(E).forEach(([S,g])=>_+=`${S}:${g};`),_.length&&D.attr("style",_)}else D.attr("style",E)};R(P),Q.__extractExpressionDeps__(v,P).forEach((F)=>Q.__trackDep__(B,F,P,{nodetype:"element",nodepath:V,deppath:`${V}.${C}`,target:"attr",$fragment:D,update:R}))}else D.attr("style",v);break;default:{const R=K.is(`[${S0}]`)&&["title","placeholder"].includes(C),h=(F)=>{const E=v&&Q.__isReactive__(v,P)?Q.__evaluate__(v,F,{translate:R}):v!==void 0?v:!0;if(E===void 0||E===!1)D.removeAttr(C);else D.attr(C,E),R&&Q.__trackTranslationDep__(F,{nodetype:"element",nodepath:V,deppath:`${V}.${C}`,target:"attr",$fragment:D,update:h})};if(h(P),k&&Q.__isReactive__(v,P))Q.__extractExpressionDeps__(v,P).forEach((E)=>Q.__trackDep__(B,E,P,{nodetype:"element",nodepath:V,deppath:`${V}.${C}`,target:"attr",$fragment:D,update:h}));R&&Q.__trackTranslationDep__(P,{nodetype:"element",nodepath:V,deppath:`${V}.${C}`,target:"attr",$fragment:D,update:h})}}})};return $.expressions&&Object.keys($.expressions).forEach((x)=>{if(!U0.test(x))return;let k=[];const C=(v,R,h=!1)=>{const F={};Q.__evaluateSpreadAttr__(x,{memo:v,get keystore(){return k},set keystore(E){k=E},each:(E,_)=>{if(!h&&$.map.afterSpreadAttrs.includes(E))return;F[E]=_},nullify:(E)=>E.forEach((_)=>D.removeAttr(_))}),Object.keys(F).length&&n(F)};if(delete $.expressions[x],C(P,"",!0),x&&Q.__isReactive__(x,P))Q.__extractExpressionDeps__(x,P).forEach((R)=>Q.__trackDep__(B,R,P,{nodetype:"element",nodepath:V,deppath:`${V}.${x}`,target:"spread-attr",$fragment:D,update:C}))}),n($.expressions,!0),u&&Object.entries(u).forEach(([x,k])=>{Y.push({nodepath:V,element:D,_event:x,instruction:k,scope:P,get __dependencies__(){return B}})}),Q.metrics.inc("elementCount"),Q.metrics.inc("domInsertsCount"),D}function J0(K){const I=K.text(),D=z(),N=j("element"),V=K.parent().is(`[${S0}]`),P=Q0.default(document.createTextNode(Q.__interpolate__(I,D,V))),$=(u)=>{const n=Q.__interpolate__(I,u,V);if(!P[0])return;P[0].textContent=n,V&&Q.__trackTranslationDep__(u,{nodetype:"text",nodepath:N,target:"value",$fragment:P,update:$})};if(I&&Q.__isReactive__(I,D))Q.__extractTextDeps__(I,D).forEach((n)=>Q.__trackDep__(B,n,D,{nodetype:"text",nodepath:N,deppath:`${N}.${n}`,target:"value",$fragment:P,update:$}));return V&&Q.__trackTranslationDep__(D,{nodetype:"text",nodepath:N,target:"value",$fragment:P,update:$}),Q.metrics.inc("elementCount"),Q.metrics.inc("domInsertsCount"),P}function d(K){if(K.get(0)?.nodeType===Node.COMMENT_NODE)return K;if(K.get(0)?.nodeType===Node.TEXT_NODE)return J0(K);if(K.is("let"))return X0(K);else if(K.is("const"))return s(K);else if(K.is("lips")&&K.attr(":dtag"))return T(K);else if(K.is("log"))return p(K);else if(Q.__macros.has(K.prop("tagName")?.toLowerCase()))return o(K);else if(K.is("if, for, switch, async")||Q.lips.has(K.prop("tagName")?.toLowerCase()))return m(K);else if(K.is("else-if, else"))return;return l(K)}try{this.__renderDepth__++,Z=!Z&&Q0.default(this.__template__).length>1?Q0.default("<template>").html(this.__template__).contents():Z||Q0.default(this.__template__),Z.each(function(){const K=d(Q0.default(this));if(K)M=M.add(K)}),Y.forEach(this.__attachEvent__.bind(this)),Q.metrics.inc("renderCount")}catch(K){console.error("Rendering Failed --",K),Q.metrics.trackError(K)}finally{if(this.__renderDepth__--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth__===0)this.__inpath__="",this.__inpathCounter__=0}return{$log:M,dependencies:B,events:Y}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(this.__detachEvent__.bind(this)),this.VER=[];for(let J in this.PCC){const Z=this.PCC.get(J);Z?.destroy(),Z?.delete(J)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.FGUDMemory?.clear(),this.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Z)=>{Q0.default(Z).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy")}__meshwire__(J,Z){const X=this,{$node:H,meshPath:q,fragmentPath:Q,fragmentBoundaries:B,argv:Y,xmlns:M,declaration:z,useAttributes:j}=J;let U;const b=new Map,f=Q+y1,T=(i,m,o)=>{if(U=H.contents(),!U?.length)return null;m=m||J.scope;const l=f+(o||""),{$log:J0,dependencies:d,events:K}=X.__withPath__(l,()=>{return X.render(l,U,{...m,...i},void 0,M)}),I=o||o0;return!b.has(I)&&b.set(I,new Set),b.get(I)?.add(l),d?.forEach((D,N)=>{!X.FGUD?.has(N)&&X.FGUD.set(N,new Map),D.forEach((V,P)=>{if(V.garbage)return;V.partial?.length?V.partial.push(l):V.partial=[l],X.FGUD.get(N)?.set(P,V)})}),X.metrics.inc("partialCount"),J0},p=(i,m,o,l,J0)=>{if(!b.get(J0||o0)?.size)return;o=o||J.scope,l=l||B,X.metrics.startRender();const d=Array.from(b.get(J0||o0)||[]);i.forEach((K)=>{const I=X.FGUD.get(K);if(!I)return;I.forEach((D)=>{const N=d.find(($)=>{return D.partial?.find((u)=>$==u||X.__hasSamePathParent__(u,$))});if(!D.partial||!N)return;const V=D.deppath||D.nodepath,P=this.FGUDMemory.get(D.nodepath);if(D.garbage||l?.start&&!document.contains(l.start)){I.delete(V),X.__unbindMemo__(D);return}if(!P){console.warn(`unexpected occurence: <${V}> has no memo`);return}if(P.memo?.[K]&&m?.[K]&&!w0(P.memo[K],m[K]))P.memo={...o,...P.memo,...m};X.UQS.queue({dep:K,deppath:V,priority:D.priority}),X.metrics.inc("dependencyUpdateCount")}),!I.size&&X.FGUD.delete(K)}),X.metrics.inc("partialUpdateCount"),X.metrics.endRender()},X0=(i,m)=>{if(X.FGUD.forEach((o,l)=>{o.forEach((J0,d)=>{if(!X.__hasSamePathParent__(d,f+(m||"")))return;X.__unbindMemo__(J0),J0.garbage=!0}),!o.size&&X.FGUD.delete(l)}),b.delete(typeof m==="string"&&m||o0),i=i||B,X.__emptyBoundaries__(i),m)i.start.remove(),i.end.remove()},s={renderer:{path:q,argv:Y,mesh:T,update:p,cleanup:X0,fill(i,m){X.__fillBoundaries__(i,m||B)},demarcate(i,m){const o=X.__getBoundaries__(f+(m||""));let l=Q0.default(o.start);return l=l.add(i),l=l.add(o.end),{$partial:l,boundaries:o}}}};if(j&&q){const{attrs:i}=X.__getAttributes__(H);i.literals&&Object.entries(i.literals).forEach(([m,o])=>s[m]=o),i.expressions&&Object.entries(i.expressions).forEach(([m,o])=>{if(U0.test(m)){let l=[];X.__evaluateSpreadAttr__(m,{memo:J.scope,get keystore(){return l},set keystore(J0){l=J0},each:(J0,d)=>s[J0]=d}),Z[`${z?.syntax?T0:""}${q}.${m}`]=o}else s[m]=o?X.__evaluate__(o,J.scope):!0,Z[`${z?.syntax?T0:""}${q}.${m}`]=o})}return s}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${J}`),end:document.createComment(`e:${J}`)}}__emptyBoundaries__(J){const Z=[];let X=J.start.nextSibling;while(X&&X!==J.end)Z.push(X),X=X.nextSibling;Q0.default(Z).remove()}__fillBoundaries__(J,Z){if(!document.contains(Z.start)||!document.contains(Z.end)){console.warn("Dynamic element boundaries not found");return}this.__emptyBoundaries__(Z),J.length&&Q0.default(Z.start).after(J)}__getAttributes__(J){const Z=J.attrs(),X={},H={},q={literals:{},expressions:{},map:{explicitAttrs:[],spreadAttrs:[],beforeSpreadAttrs:[],afterSpreadAttrs:[],metaAttrs:[]}},Q=Object.keys(Z).find((M)=>U0.test(M));let B=[],Y=!1;return Z&&Object.entries(Z).forEach(([M,z])=>{if(M==":dtag")return;if(M.startsWith(":")||M.startsWith(V0)||M.startsWith(g0)||U0.test(M)||I1.test(M))if(I1.test(M)){const[j,U]=M.match(I1)||[];B=U.split(",")}else if(M.startsWith(g0))X[M.replace(g0,"")]=z;else if(M.startsWith(V0))H[M.replace(V0,"")]=z;else{if(M.startsWith(":"))M=M.slice(1,M.length);if(Q)if(U0.test(M))q.map.spreadAttrs.push(M),Y=!0;else q.map.explicitAttrs.push(M),!Y?q.map.beforeSpreadAttrs.push(M):q.map.afterSpreadAttrs.push(M);q.expressions[M]=z||""}else if(q.literals[M]=z,Q)q.map.explicitAttrs.push(M),!Y?q.map.beforeSpreadAttrs.push(M):q.map.afterSpreadAttrs.push(M)}),{argv:B,events:X,functions:H,attrs:q}}__withPath__(J,Z){const X=this.__inpath__;this.__inpath__=J;const H=Z();return this.__inpath__=X,H}__getPathParent__(J){const Z=J.split("/");if(Z.length>1)Z.pop();return Z.join("/")}__hasSamePathParent__(J,Z){return J.startsWith(Z)&&!J.replace(Z,"").startsWith(".")||J.startsWith(`${Z+y1}`)}__evaluate__(J,Z,X){J=typeof J==="string"?J.trim():J;try{const H=(q)=>{const Q=this.state.toJSON(),B=(M,...z)=>{try{return M(...z)}catch(j){!X?.mute&&console.error("Eval error --",j);return}};let Y=`return ${q};`;if(Z){let M={},z;for(let U in Z){if(U==="__arguments__")continue;M[U]=Z[U].value}if(typeof Z.__arguments__==="object")z=Z.__arguments__;Y=`with( scope ){ ${Y} }`;const j=new Function("self","input","state","static","context","scope","arguments",Y);return B(j,this,this.input,Q,this.static,this.context,M||{},z)}else{const M=new Function("self","input","state","static","context",Y);return B(M,this,this.input,Q,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return H(J.slice(1));return J.replace(_1,(q,Q)=>H(Q))}return H(J)}catch(H){!X?.mute&&console.error("Expression evaluation error --",H);return}}__evaluateFunction__(J,Z,X){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,X)(...Z);else{let[H,...q]=J.split(/\s*,\s*/),Q;const B=this.__evaluate__(H,X,{mute:!0});if(typeof B==="function")Q=B;else{if(typeof this[H]!=="function")throw new Error(`Undefined <${H}> handler method`);Q=this[H].bind(this)}if(typeof Q!=="function")throw new Error(`Expected <${H}> to be a function or handler method`);let Y=q.map((M)=>this.__evaluate__(M,X));if(Z.length)Y=[...Y,...Z];return Q(...Y)}}__evaluateSpreadAttr__(J,Z){const X=this.__evaluate__(J.replace(U0,""),Z.memo);if(!X){if(!Z.keystore.length)throw new Error(`Undefined spread operator ${J}`);typeof Z.nullify==="function"&&Z.nullify(Z.keystore);return}if(typeof X!=="object"||Array.isArray(X))throw new Error(`Invalid spread operator ${J}`);if(Z.keystore=Object.keys(X)||[],typeof Z.each==="function")for(let H in X)Z.each(H,X[H])}__interpolate__(J,Z,X){if(J=J.replace(_1,(H,q)=>this.__evaluate__(q,Z)),X)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J){const{element:Z,nodepath:X,_event:H,instruction:q,scope:Q,__dependencies__:B}=J;let Y=Q;if(Z.on(H,(...M)=>this.__evaluateFunction__(q,M,Y)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(q,Q))this.__extractExpressionDeps__(q,Q).forEach((z)=>this.__trackDep__(B,z,Q||{},{nodetype:"event",nodepath:X,deppath:`${X}.${H}`,target:"event-handler",$fragment:!(Z instanceof k0)?Z:null,boundaries:Z instanceof k0?Z.__boundaries__:void 0,update:(j)=>{Y=j}}))}__detachEvent__({element:J,nodepath:Z,_event:X,instruction:H,scope:q,__dependencies__:Q}){if(J.off(X),this.__isReactive__(H,q)){const B=this.__extractExpressionDeps__(H,q),Y=`${Z}.${X}`;B.forEach((M)=>{Q.get(M)?.delete(Y),this.FGUD.get(M)?.delete(Y)})}this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const X=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const Q=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(Q,Z).forEach((Y)=>X.add(Y))}),Array.from(X)}__extractExpressionDeps__(J,Z){const X=/\b(state|input|context|arguments)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,H=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g,q=/\b(arguments)((?:\.[a-zA-Z_]\w*)+)?(?=\[|\.|$|\s|;|,|\))/g;let Q=[...Array.from(J.matchAll(X)),...Array.from(J.matchAll(H)),...Array.from(J.matchAll(q))];if(Z&&Object.keys(Z).length){const B=new RegExp(`\\b(?<!\\.)(${Object.keys(Z).join("|")})`,"g"),Y=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");Q=[...Q,...Array.from(J.matchAll(B)),...Array.from(J.matchAll(Y))]}return[...new Set(Q.map((B)=>B[0]))]}__isReactive__(J,Z){if(/(self|state|input|context|arguments)(\.[\w.]+)?/.test(J))return!0;if(Z&&Object.keys(Z).length&&new RegExp(Object.keys(Z).join("|")).test(J))return!0;return!1}__bindMemo__(J,Z){const X=Z.deppath||Z.nodepath,H=this.FGUDMemory.get(Z.nodepath);if(H)H.tracks.set(X,Z.priority||2),H.memo=J,this.FGUDMemory.set(Z.nodepath,H);else{const q=new Map;q.set(X,Z.priority),this.FGUDMemory.set(Z.nodepath,{tracks:q,memo:J})}}__unbindMemo__(J){const Z=J.deppath||J.nodepath,X=this.FGUDMemory.get(J.nodepath);if(!X||!X.tracks.get(Z))return;X.tracks.delete(Z),!X.tracks.size&&this.FGUDMemory.delete(J.nodepath)}__trackDep__(J,Z,X,H){if(X&&X[Z]&&X[Z].type==="let")H.haslet=!0;if(H.priority===void 0)if(H.target==="attr"&&Z.split(".").find((Q)=>b5.includes(Q)))H.priority=0;else if(H.syntax)H.priority=1;else if(["event"].includes(H.nodetype))H.priority=3;else H.priority=2;const q=H.deppath||H.nodepath;H.level=q.split(/\//g).length,H.priority=H.level*h5+H.priority,!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(q,H),this.__bindMemo__(X,H),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J,Z){this.__i18nDeps.set(Z.deppath||Z.nodepath,Z),this.__bindMemo__(J,Z),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Z){return Z.reduce((X,H)=>X?.[H],J)}__shouldUpdate__(J,Z){if(J==="self")return!0;const X={state:this.state,input:this.input,context:this.context},H=this.__valueDep__(this.__previous[J],Z),q=this.__valueDep__(X[J],Z);return!w0(H,q)}__updateDepNodes__(){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((J,Z)=>{const[X,...H]=Z.split(".");if(!this.__shouldUpdate__(X,H))return;J.forEach((q)=>{try{const Q=q.deppath||q.nodepath;if(q.garbage||q.boundaries?.start&&!document.contains(q.boundaries.start)||q.$fragment!==null&&!q.$fragment.closest("body").length){J.delete(Q),this.__unbindMemo__(q);return}this.UQS.queue({dep:Z,deppath:Q,priority:q.priority}),this.metrics.inc("dependencyUpdateCount")}catch(Q){console.error("failed to update dependency nodes --",Q);return}}),!J.size&&this.FGUD?.delete(Z)}),this.metrics.endRender()}__updateVarDepNodes__(J,Z,X){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((H,q)=>{if(!H.haslet||!this.__hasSamePathParent__(q,this.__getPathParent__(Z)))return;const Q=H.deppath||H.nodepath,B=this.FGUDMemory.get(H.nodepath);if(!B){console.warn(`unexpected occurence: <${Q}> has no memo`);return}B.memo={...B.memo,...X},this.UQS.queue({dep:J,deppath:Q,priority:H.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateArgumentsDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender();const X="arguments";this.FGUD.get(X)?.forEach((H,q)=>{if(!this.__hasSamePathParent__(q,J))return;const Q=H.deppath||H.nodepath,B=this.FGUDMemory.get(H.nodepath);if(!B){console.warn(`unexpected occurence: <${Q}> has no memo`);return}B.memo.__arguments__=Z,this.UQS.queue({dep:X,deppath:Q,priority:H.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Z)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Z);return}const X=this.FGUDMemory.get(J.nodepath);if(!X){console.warn(`unexpected occurence: <${J.deppath||J.nodepath}> has no memo`);return}J.update(X.memo,"i18n-partial-updator"),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?Q0.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?Q0.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?Q0.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var u1={};i0(u1,{handler:()=>{{return A8}},declaration:()=>{{return E8}},_static:()=>{{return T8}}});var E8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},T8={initialized:!1,prevRenderer:null},A8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,X=!1){if(!J.renderer)return;if(J.by){this.static.prevRenderer?.cleanup();const H=J.renderer.mesh({},Z);if(this.static.prevRenderer=J.renderer,!H?.length)return;if(X)return H;J.renderer.fill(H)}else{this.static.prevRenderer?.cleanup();let H=!1,q;if(Array.isArray(J["else-if"])&&J["else-if"].length)for(let Q of J["else-if"]){if(!Q.by)continue;if(q=Q.renderer.mesh({},Z),this.static.prevRenderer=Q.renderer,!q?.length)return;if(X)return q;q?.length&&Q.renderer.fill(q),H=!0;break}if(!H&&J.else){const Q=J.else.renderer.mesh({},Z);if(this.static.prevRenderer=J.else.renderer,!Q?.length)return;if(X)return Q;J.else.renderer.fill(Q)}}}};var m1={};i0(m1,{handler:()=>{{return b8}},declaration:()=>{{return $8}},_static:()=>{{return S8}}});var C0=e0(c0(),1);var $8={name:"for",syntax:!0},S8={lastIn:null,argvlist:null,initialized:!1,prevRenderer:null,processingBatch:!1},b8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,X=!1){if(this.static.processingBatch)return;if(!J.renderer)throw new Error("Undefined mesh renderer");let{in:H,from:q,to:Q}=J;if(H===void 0&&q===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(q!==void 0)return this.asFromTo(J.renderer,q,Q,Z,X);else if(Array.isArray(H))return this.asArray(J.renderer,H,Z,X);else if(H instanceof Map)return this.asMap(J.renderer,H,Z,X);else if(typeof H=="object")return this.asObject(J.renderer,H,Z,X)}finally{this.static.processingBatch=!1}},addItem(J,Z,X,H){if(!this.static.argvlist)this.static.argvlist=[];const q=`[${H}]`,Q=J.mesh(X,Z,q);if(!Q)return;const{boundaries:B,$partial:Y}=J.demarcate(Q,q);return this.static.prevRenderer=J,this.static.argvlist.push({argvalues:X,boundaries:B}),Y},updateItem(J,Z,X,H){if(!this.static.argvlist?.[H])return;this.static.argvlist[H].argvalues=X,J.update(Object.keys(X),X,Z,this.static.argvlist[H].boundaries,`[${H}]`)},removeItem(J,Z){if(!this.static.argvlist?.[Z])return;J.cleanup(this.static.argvlist[Z].boundaries,`[${Z}]`),this.static.argvlist.splice(Z,1)},asFromTo(J,Z,X,H,q){if(Z=parseFloat(String(Z)),X==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");X=parseFloat(String(X));const Q=Z<X,B=Math.abs(X-Z)+1;if(Array.isArray(this.static.argvlist)){const[M]=J.argv;if(M){let z=Z;if(this.static.argvlist.length===B){for(let U=0;U<this.static.argvlist.length;U++)this.static.argvlist[U].argvalues[M].value!==z&&this.updateItem(J,H,{[M]:{value:z,type:"arg"}},U),z=Q?z+1:z-1;return}const j=Math.min(this.static.argvlist.length,B);for(let U=0;U<j;U++)this.updateItem(J,H,{[M]:{value:U,type:"arg"}},U);if(B>this.static.argvlist.length)for(let U=this.static.argvlist.length;U<B;U++){const b={[M]:{value:U,type:"arg"}};this.boundaries&&C0.default(this.boundaries.end).before(this.addItem(J,H,b,U))}else if(B<this.static.argvlist.length)for(let U=this.static.argvlist.length-1;U>=B;U--)this.removeItem(J,U)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let Y=C0.default();for(let M=Z;Q?M<=X:M>=X;Q?M++:M--){const z={},[j]=J.argv;if(j)z[j]={value:M,type:"arg"};Y=Y.add(this.addItem(J,H,z,M))}if(!Y?.length)return;if(q)return Y;J.fill(Y)},asArray(J,Z,X,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Z.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[B,Y]=J.argv;if(B){if(this.static.argvlist.length===Z.length){for(let z=0;z<this.static.argvlist.length;z++)!w0(this.static.argvlist[z].argvalues[B].value,Z[z])&&this.updateItem(J,X,{[B]:{value:Z[z],type:"arg"},[Y]:{value:z,type:"arg"}},z);return}const M=Math.min(this.static.argvlist.length,Z.length);for(let z=0;z<M;z++)this.updateItem(J,X,{[B]:{value:Z[z],type:"arg"},[Y]:{value:z,type:"arg"}},z);if(Z.length>this.static.argvlist.length)for(let z=this.static.argvlist.length;z<Z.length;z++){const j={[B]:{value:Z[z],type:"arg"},[Y]:{value:z,type:"arg"}};this.boundaries&&C0.default(this.boundaries.end).before(this.addItem(J,X,j,z))}else if(Z.length<this.static.argvlist.length)for(let z=this.static.argvlist.length-1;z>=Z.length;z--)this.removeItem(J,z)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=C0.default(),Q=0;for(let B of Z){const Y={},[M,z]=J.argv;if(M)Y[M]={value:B,type:"arg"};if(z)Y[z]={value:Q,type:"arg"};q=q.add(this.addItem(J,X,Y,Q)),Q++}if(!q?.length)return;if(H)return q;J.fill(q)},asMap(J,Z,X,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Z.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[B,Y,M]=J.argv,z=Array.from(Z.entries());if(B){if(this.static.argvlist.length===z.length){for(let U=0;U<this.static.argvlist.length;U++)!w0(this.static.argvlist[U].argvalues[B].value,z[U][0])||!w0(this.static.argvlist[U].argvalues[Y].value,z[U][1])&&this.updateItem(J,X,{[B]:{value:z[U][0],type:"arg"},[Y]:{value:z[U][1],type:"arg"},[M]:{value:U,type:"arg"}},U);return}const j=Math.min(this.static.argvlist.length,z.length);for(let U=0;U<j;U++)this.updateItem(J,X,{[B]:{value:z[U][0],type:"arg"},[Y]:{value:z[U][1],type:"arg"},[M]:{value:U,type:"arg"}},U);if(z.length>this.static.argvlist.length)for(let U=this.static.argvlist.length;U<z.length;U++){const b={[B]:{value:z[U][0],type:"arg"},[Y]:{value:z[U][1],type:"arg"},[M]:{value:U,type:"arg"}};this.boundaries&&C0.default(this.boundaries.end).before(this.addItem(J,X,b,U))}else if(z.length<this.static.argvlist.length)for(let U=this.static.argvlist.length-1;U>=z.length;U--)this.removeItem(J,U)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=C0.default(),Q=0;for(let[B,Y]of Z){const M={},[z,j,U]=J.argv;if(z)M[z]={value:B,type:"arg"};if(j)M[j]={value:Y,type:"arg"};if(U)M[U]={value:Q,type:"arg"};q=q.add(this.addItem(J,X,M,Q)),Q++}if(!q?.length)return;if(H)return q;J.fill(q)},asObject(J,Z,X,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Object.keys(Z).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[B,Y,M]=J.argv,z=Object.entries(Z);if(B){if(this.static.argvlist.length===z.length){for(let U=0;U<this.static.argvlist.length;U++)!w0(this.static.argvlist[U].argvalues[B].value,z[U][0])||!w0(this.static.argvlist[U].argvalues[Y].value,z[U][1])&&this.updateItem(J,X,{[B]:{value:z[U][0],type:"arg"},[Y]:{value:z[U][1],type:"arg"},[M]:{value:U,type:"arg"}},U);return}const j=Math.min(this.static.argvlist.length,z.length);for(let U=0;U<j;U++)this.updateItem(J,X,{[B]:{value:z[U][0],type:"arg"},[Y]:{value:z[U][1],type:"arg"},[M]:{value:U,type:"arg"}},U);if(z.length>this.static.argvlist.length){let U=C0.default();for(let b=this.static.argvlist.length;b<z.length;b++){const f={[B]:{value:z[b][0],type:"arg"},[Y]:{value:z[b][1],type:"arg"},[M]:{value:b,type:"arg"}},T=this.addItem(J,X,f,b);U=U.add(T)}this.boundaries&&C0.default(this.boundaries.end).before(U)}else if(z.length<this.static.argvlist.length)for(let U=this.static.argvlist.length-1;U>=z.length;U--)this.removeItem(J,U)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=C0.default(),Q=0;for(let B in Z){const Y={},[M,z,j]=J.argv;if(M)Y[M]={value:B,type:"arg"};if(z)Y[z]={value:Z[B],type:"arg"};if(j)Y[j]={value:Q,type:"arg"};q=q.add(this.addItem(J,X,Y,Q)),Q++}if(!q?.length)return;if(H)return q;J.fill(q)},onDestroy(){this.static.prevRenderer?.cleanup(void 0,!0),this.static.prevRenderer=null,this.static.argvlist=null,this.static.lastIn=null}};var d1={};i0(d1,{handler:()=>{{return k8}},declaration:()=>{{return g8}},_static:()=>{{return x8}}});var g8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},x8={initialized:!1,finalized:!1,prevRenderer:null},k8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,X=!1){if(!J.await)throw new Error("Undefined async <await> attribute");if(!(J.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(this.static.finalized=!1,J.loading){this.static.prevRenderer?.cleanup();const H=J.loading.renderer.mesh({},Z);if(this.static.prevRenderer=J.loading.renderer,this.execute(J,Z,!0),this.static.finalized)return;if(!H?.length)return;if(X)return H;J.loading.renderer.fill(H)}else this.execute(J,Z)},execute(J,Z,X=!1){J.await.then((H)=>{if(this.static.prevRenderer?.cleanup(),!J.then)return;const[q]=J.then.renderer.argv,Q={[q]:{value:H,type:"arg"}},B=J.then.renderer.mesh(Q,Z);if(this.static.prevRenderer=J.then.renderer,!B?.length)return;if(!X)return B;J.then.renderer.fill(B)}).catch((H)=>{if(this.static.prevRenderer?.cleanup(),!J.catch)return;const[q]=J.catch.renderer.argv,Q={[q]:{value:H,type:"arg"}},B=J.catch.renderer.mesh(Q,Z);if(this.static.prevRenderer=J.catch.renderer,!B?.length)return;if(!X)return B;J.catch.renderer.fill(B)}).finally(()=>this.static.finalized=!0)}};var i1={};i0(i1,{handler:()=>{{return _8}},declaration:()=>{{return f8}},_static:()=>{{return h8}}});var f8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},h8={initialized:!1,prevRenderer:null},_8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,X=!1){let H=[];this.static.prevRenderer?.cleanup();for(let q of J.case)if(q.is==J.by||Array.isArray(q.is)&&q.is.includes(J.by)){Array.isArray(q.is)?H=[...new Set([...H,...q.is])]:H.push(q.is);const Q=q.renderer.mesh({},Z);if(this.static.prevRenderer=q.renderer,!Q?.length)return;if(X)return Q;q.renderer.fill(Q)}if(H.includes(J.by))return;if(J.default){const q=J.default.renderer.mesh({},Z);if(this.static.prevRenderer=J.default.renderer,!q?.length)return;if(X)return q;J.default.renderer.fill(q)}else this.static.prevRenderer=null}};var c1={};i0(c1,{state:()=>{{return y8}},handler:()=>{{return d8}},default:()=>{{return i8}},context:()=>{{return u8}},_static:()=>{{return v8}}});var m8=function(J){const Z={};return J.split("&").map((H)=>{const[q,Q]=H.split("=");Z[q]=Q}),Z},y8={page:null,params:{},query:{}},v8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},u8=["navigate"],d8={onInput(){this.processor(this.input)},processor(J){if(!J.routes)return;if(J.global)this.static.global=J.global;if(this.static.routes=J.routes.map(({path:Z,template:X,default:H})=>{if(H)this.static.defaultPath=Z;const q=Z.match(/:[^\/]*(\/|$)/gi)||[],Q=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:X,default:H,pathVars:q,pathRegex:new RegExp(`${Q}\$`,"i")}}),J.global){const Z=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&Z=="/"&&Z!==this.static.defaultPath?this.static.defaultPath:Z?Z+window.location.search:this.static.routes[0].path}},onAttach(){if(this.input.global)window.navigate=this.navigate.bind(this),window.addEventListener("popstate",(J)=>J.state&&this.navigate(J.state.path,!0));this.setContext("navigate",this.navigate.bind(this)),this.static.defaultPath&&this.navigate(this.static.defaultPath)},navigate(J,Z){!Z&&this.static.global&&history.pushState({path:J},"",J);const X=J.split("?");J=X[0];const H=X[1]?m8(X[1]):{};let q=null;if(this.static.currentRoute)q={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:q,toState:{path:J,query:H}});const Q=this.match(J);if(!Q){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:B,params:Y}=Q;this.emit("after",{fromState:q,toState:{path:B.path,params:Y,query:H}}),this.static.currentPath=J,this.static.currentRoute=B,this.state.params=Y,this.state.query=H,this.state.page=B.template},match(J){const Z={};let X=!1;for(let H of this.static.routes){const{pathVars:q,pathRegex:Q}=H,B=J.match(Q);if(B!==null&&B.index===0){for(let Y=0;Y+1<B.length&&Y<q.length;Y++)Z[q[Y].replaceAll(/[\/:]/g,"")]=B[Y+1];X=H;break}}return X?{route:X,params:Z}:!1}},i8="<{state.page} params=state.params query=state.query/>";class r0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new X1;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new Q1,this.IUC=new Z1;const[Z,X]=x0(this.i18n.lang),[H,q]=x0(J?.context||{});this.__setLang=X,this.__getLang=Z,this.__setContext=q,this.__getContext=H,this.register("if",u1),this.register("for",m1),this.register("async",d1),this.register("switch",i1),this.register("router",c1)}register(J,Z){return this.store[J]=Z,this}unregister(J){return delete this.store[J],this}has(J){return J in this.store}import(J){if(!this.has(J))throw new Error(`<${J}> component not found`);if(!this.store[J].declaration?.syntax&&!this.store[J].default)throw new Error(`Invalid <${J}> component`);return this.store[J]}render(J,Z,X){const{default:H,...q}=Z,Q={debug:this.debug,prepath:"0",lips:this},B=new k0(J,H||"",{...q,input:X},Q);return window.addEventListener("beforeunload",()=>{return this.dispose(),B.destroy(),null}),window.addEventListener("pagehide",(Y)=>{!Y.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),B}root(J,Z){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Z),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((X)=>new d0("root",{sheet:X,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Z){const X=this.__getContext();if(typeof J==="string"){const H={...X,[J]:Z};B0(X,H)&&this.__setContext(H)}else if(!Array.isArray(J)){const H={...X,...J};B0(X,H)&&this.__setContext(H)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;l0(()=>{const X=this.__getContext();if(!X)return;const H=Object.fromEntries(J.map((q)=>[q,X[q]]));H&&typeof Z==="function"&&Object.keys(H).length&&Z(H)})}useTranslator(J,Z){l0(()=>{const X=this.__getLang();if(!X)return;(J==="*"||Array.isArray(J)&&J.includes(X))&&typeof Z==="function"&&Z(X)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}var c8=function(){const J={rainbow:[],fire:[],ocean:[],grayscale:[]};for(let Q=0;Q<360;Q++)J.rainbow.push(`hsl(${Q}, 80%, 60%)`);for(let Q=0;Q<60;Q++)J.fire.push(`hsl(${Q+10}, 90%, 60%)`);for(let Q=0;Q<60;Q++)J.ocean.push(`hsl(${Q+180}, 85%, 55%)`);for(let Q=0;Q<200;Q++){const B=Q+55;J.grayscale.push(`rgb(${B}, ${B}, ${B})`)}const Z={title:"Interactive Particle System",width:800,height:500,particleCount:200,maxParticleSize:15,minParticleSize:2,speedFactor:1,colorScheme:"rainbow",interactive:!0,showStats:!0,useGravity:!0},X={_static:{animationFrame:0},state:{particles:[],particlePool:[],isRunning:!1,mouseX:0,mouseY:0,hasMouseInput:!1,emissionRate:3,frameCount:0,lastFrameTime:0,lastUpdateTime:0,fps:0,statsUpdateCounter:0,emitterX:0,emitterY:0,gravity:0.1,wind:0,turbulence:0.05},handler:{onCreate(){if(!this.input.width)this.input.width=Z.width;if(!this.input.height)this.input.height=Z.height;if(!this.input.title)this.input.title=Z.title;if(!this.input.particleCount)this.input.particleCount=Z.particleCount;if(!this.input.maxParticleSize)this.input.maxParticleSize=Z.maxParticleSize;if(!this.input.minParticleSize)this.input.minParticleSize=Z.minParticleSize;if(!this.input.speedFactor)this.input.speedFactor=Z.speedFactor;if(!this.input.colorScheme)this.input.colorScheme=Z.colorScheme;if(this.input.interactive===void 0)this.input.interactive=Z.interactive;if(this.input.showStats===void 0)this.input.showStats=Z.showStats;if(this.input.useGravity===void 0)this.input.useGravity=Z.useGravity;if(this.input.width&&this.input.height)this.state.emitterX=this.input.width/2,this.state.emitterY=this.input.height/2;this.initializeParticlePool(this.input.particleCount||200)},initializeParticlePool(Q){for(let B=0;B<Q;B++)this.state.particlePool.push(this.createInactiveParticle())},createInactiveParticle(){const Q=this.input.minParticleSize||2,B=this.input.maxParticleSize||15,Y=Q+Math.random()*(B-Q);let M;if(Y<5)M="circle";else if(Y<10)M="rect";else M="polygon";return{id:Math.random()*1e5|0,x:0,y:0,size:Y,vx:0,vy:0,color:"",alpha:0,rotation:0,rotationSpeed:0,life:Number.MAX_SAFE_INTEGER,maxLife:0,type:M}},onMount(){if(this.input.interactive){const Q=document.querySelector(".particle-system-container");if(Q)this.boundMouseMove=this.handleMouseMove.bind(this),this.boundMouseLeave=this.handleMouseLeave.bind(this),Q.addEventListener("mousemove",this.boundMouseMove),Q.addEventListener("mouseleave",this.boundMouseLeave)}},onDestroy(){if(this.stopAnimation(),this.input.interactive){const Q=document.querySelector(".particle-system-container");if(Q)Q.removeEventListener("mousemove",this.boundMouseMove),Q.removeEventListener("mouseleave",this.boundMouseLeave)}this.state.particles=[],this.state.particlePool=[]},handleMouseMove(Q){const Y=Q.currentTarget.getBoundingClientRect();this.state.mouseX=Q.clientX-Y.left,this.state.mouseY=Q.clientY-Y.top,this.state.hasMouseInput=!0,this.state.emitterX=this.state.mouseX,this.state.emitterY=this.state.mouseY},handleMouseLeave(){if(this.state.hasMouseInput=!1,this.input.width&&this.input.height)this.state.emitterX=this.input.width/2,this.state.emitterY=this.input.height/2},getRandomColor(){const Q=this.input.colorScheme||"rainbow",B=J[Q];if(!B||B.length===0){if(Q==="rainbow")return`hsl(${Math.random()*360}, 80%, 60%)`;else if(Q==="fire"){const Y=Math.random()*60+10,M=80+Math.random()*20,z=50+Math.random()*20;return`hsl(${Y}, ${M}%, ${z}%)`}else if(Q==="ocean"){const Y=Math.random()*60+180,M=70+Math.random()*30,z=40+Math.random()*30;return`hsl(${Y}, ${M}%, ${z}%)`}else if(Q==="grayscale"){const Y=Math.floor(Math.random()*200+55);return`rgb(${Y}, ${Y}, ${Y})`}return`hsl(${Math.random()*360}, 80%, 60%)`}return B[Math.floor(Math.random()*B.length)]},activateParticle(){let Q;for(let z=0;z<this.state.particlePool.length;z++)if(this.state.particlePool[z].life>this.state.particlePool[z].maxLife){Q=this.state.particlePool[z];break}if(!Q){if(Q=this.createInactiveParticle(),!Q)return null;this.state.particlePool.push(Q)}if(!Q||!this.input.width||!this.input.height)return null;Q.x=this.state.emitterX,Q.y=this.state.emitterY;const B=this.input.speedFactor||1,Y=Math.random()*Math.PI*2,M=(0.5+Math.random()*2)*B;return Q.vx=Math.cos(Y)*M,Q.vy=Math.sin(Y)*M,Q.rotation=Math.random()*Math.PI*2,Q.rotationSpeed=(Math.random()-0.5)*0.1,Q.maxLife=50+Math.random()*100,Q.life=0,Q.alpha=0.7+Math.random()*0.3,Q.color=this.getRandomColor(),Q},updateParticles(){if(!this.input.width||!this.input.height)return;const Q=performance.now(),B=(Q-this.state.lastUpdateTime)/1000;this.state.lastUpdateTime=Q;const Y=0.016666666666666666,M=this.input.useGravity?this.state.gravity:0,z=this.state.wind,j=this.state.turbulence,U=[],b=Math.min(this.state.emissionRate,(this.input.particleCount||200)-this.state.particles.length);for(let f=0;f<b;f++){const T=this.activateParticle();if(T)this.state.particles.push(T)}for(let f=0;f<this.state.particles.length;f++){const T=this.state.particles[f];if(T.life>=T.maxLife)continue;const p=Math.min(B,0.1);T.x+=T.vx*p*60,T.y+=T.vy*p*60,T.vy+=M*p*60,T.vx+=z*p*60,T.vx+=(Math.random()-0.5)*j*p*60,T.vy+=(Math.random()-0.5)*j*p*60,T.rotation+=T.rotationSpeed*p*60,T.life+=p*60;const X0=T.life/T.maxLife;T.alpha=1-Math.pow(X0,2);const s=T.size/2;if(T.x-s<0)T.x=s,T.vx=-T.vx*0.5;else if(T.x+s>this.input.width)T.x=this.input.width-s,T.vx=-T.vx*0.5;if(T.y+s>this.input.height)if(T.y=this.input.height-s,Math.abs(T.vy)>0.5)T.vy=-T.vy*0.4;else T.vy=0,T.vx*=0.95;if(T.life<T.maxLife)U.push(T)}if(this.state.particles.length!==U.length)this.state.particles=U},getParticlePoints(Q){const B=[],M=Q.size/2,z=Q.size/4;for(let j=0;j<10;j++){const U=j%2===0?M:z,b=Math.PI/5*j,f=Q.x+U*Math.sin(b),T=Q.y+U*Math.cos(b);B.push(`${f},${T}`)}return B.join(" ")},startAnimation(){if(this.state.isRunning)return;if(this.state.isRunning=!0,this.state.lastFrameTime=performance.now(),this.state.lastUpdateTime=performance.now(),!this.boundAnimate)this.boundAnimate=this.animate.bind(this);this.static.animationFrame=requestAnimationFrame(this.boundAnimate)},animate(){if(!this.state.isRunning)return;const Q=performance.now(),B=Q-this.state.lastFrameTime;if(this.state.lastFrameTime=Q,this.state.statsUpdateCounter++,this.state.statsUpdateCounter>=10)this.state.fps=Math.round(1000/B),this.state.statsUpdateCounter=0;this.updateParticles(),this.state.frameCount++;const Y=this.state.frameCount%628,M=Math.sin(Y*0.01),z=Math.sin(Y*0.005);this.state.wind=M*0.05,this.state.turbulence=0.03+z*0.02,this.static.animationFrame=requestAnimationFrame(this.boundAnimate)},stopAnimation(){this.state.isRunning=!1,cancelAnimationFrame(this.static.animationFrame)},toggleAnimation(){if(this.state.isRunning)this.stopAnimation();else this.startAnimation()},changeColorScheme(Q){this.input.colorScheme=Q},increaseParticleCount(){if(this.input.particleCount){const Q=Math.min(1000,this.input.particleCount+50);if(Q>this.state.particlePool.length){const B=Q-this.state.particlePool.length;for(let Y=0;Y<B;Y++)this.state.particlePool.push(this.createInactiveParticle())}this.input.particleCount=Q}},decreaseParticleCount(){if(this.input.particleCount){if(this.input.particleCount=Math.max(50,this.input.particleCount-50),this.state.particles.length>this.input.particleCount)this.state.particles.length=this.input.particleCount}},toggleGravity(){if(this.input.useGravity=!this.input.useGravity,!this.input.useGravity)for(let Q=0;Q<this.state.particles.length;Q++)this.state.particles[Q].vy*=0.5},increaseEmissionRate(){this.state.emissionRate=Math.min(20,this.state.emissionRate+1)},decreaseEmissionRate(){this.state.emissionRate=Math.max(1,this.state.emissionRate-1)}},default:`
|
|
2
|
-
<div class="particle-system-container" style="width: {Number(input.width) + 40}px; height: {Number(input.height) + 280}px">
|
|
3
|
-
<h2 class="particle-system-title">{input.title}</h2>
|
|
4
|
-
|
|
5
|
-
<svg class="particle-system-svg"
|
|
6
|
-
width=input.width
|
|
7
|
-
height=input.height
|
|
8
|
-
viewBox="0 0 {input.width} {input.height}">
|
|
9
|
-
|
|
10
|
-
<!-- Background gradient -->
|
|
11
|
-
<defs>
|
|
12
|
-
<linearGradient id="bg-gradient" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
13
|
-
<stop offset="0%" style="stop-color:#111122;stop-opacity:1" />
|
|
14
|
-
<stop offset="100%" style="stop-color:#222244;stop-opacity:1" />
|
|
15
|
-
</linearGradient>
|
|
16
|
-
</defs>
|
|
17
|
-
|
|
18
|
-
<!-- Background -->
|
|
19
|
-
<rect width=input.width height=input.height fill="url(#bg-gradient)" />
|
|
20
|
-
|
|
21
|
-
<!-- Emitter -->
|
|
22
|
-
<if(state.hasMouseInput || input.interactive)>
|
|
23
|
-
<circle
|
|
24
|
-
cx=state.emitterX
|
|
25
|
-
cy=state.emitterY
|
|
26
|
-
r="10"
|
|
27
|
-
fill="rgba(255, 255, 255, 0.5)"
|
|
28
|
-
stroke="white"
|
|
29
|
-
stroke-width="2"
|
|
30
|
-
/>
|
|
31
|
-
</if>
|
|
32
|
-
|
|
33
|
-
<!-- Particles - Using pre-computed particle type for faster rendering decisions -->
|
|
34
|
-
<if( state.particles.length )>
|
|
35
|
-
<for [particle] in=state.particles>
|
|
36
|
-
<if( particle.type === 'circle' )>
|
|
37
|
-
<circle
|
|
38
|
-
cx=particle.x
|
|
39
|
-
cy=particle.y
|
|
40
|
-
r=(particle.size/2)
|
|
41
|
-
fill=particle.color
|
|
42
|
-
opacity=particle.alpha.toFixed(2)
|
|
43
|
-
transform="rotate({particle.rotation * 180 / Math.PI}, {particle.x}, {particle.y})"/>
|
|
44
|
-
</if>
|
|
45
|
-
<else-if( particle.type === 'rect' )>
|
|
46
|
-
<rect
|
|
47
|
-
x=(particle.x - particle.size/2)
|
|
48
|
-
y=(particle.y - particle.size/2)
|
|
49
|
-
width=particle.size
|
|
50
|
-
height=particle.size
|
|
51
|
-
fill=particle.color
|
|
52
|
-
opacity=particle.alpha.toFixed(2)
|
|
53
|
-
transform="rotate({particle.rotation * 180 / Math.PI}, {particle.x}, {particle.y})"/>
|
|
54
|
-
</else-if>
|
|
55
|
-
<else>
|
|
56
|
-
<polygon
|
|
57
|
-
points=self.getParticlePoints(particle)
|
|
58
|
-
fill=particle.color
|
|
59
|
-
opacity=particle.alpha.toFixed(2)
|
|
60
|
-
transform="rotate({particle.rotation * 180 / Math.PI}, {particle.x}, {particle.y})"/>
|
|
61
|
-
</else>
|
|
62
|
-
</for>
|
|
63
|
-
</if>
|
|
64
|
-
</svg>
|
|
65
|
-
|
|
66
|
-
<div class="particle-system-controls">
|
|
67
|
-
<button class="particle-system-button {state.isRunning ? 'stop' : ''}"
|
|
68
|
-
on-click(toggleAnimation)>
|
|
69
|
-
{state.isRunning ? 'Pause' : 'Start'} Animation
|
|
70
|
-
</button>
|
|
71
|
-
|
|
72
|
-
<button class="particle-system-button" on-click(increaseParticleCount)>
|
|
73
|
-
More Particles
|
|
74
|
-
</button>
|
|
75
|
-
|
|
76
|
-
<button class="particle-system-button" on-click(decreaseParticleCount)>
|
|
77
|
-
Less Particles
|
|
78
|
-
</button>
|
|
79
|
-
|
|
80
|
-
<button class="particle-system-button" on-click(toggleGravity)>
|
|
81
|
-
{input.useGravity ? 'Disable' : 'Enable'} Gravity
|
|
82
|
-
</button>
|
|
83
|
-
|
|
84
|
-
<button class="particle-system-button" on-click(increaseEmissionRate)>
|
|
85
|
-
Faster Emission
|
|
86
|
-
</button>
|
|
87
|
-
|
|
88
|
-
<button class="particle-system-button" on-click(decreaseEmissionRate)>
|
|
89
|
-
Slower Emission
|
|
90
|
-
</button>
|
|
91
|
-
|
|
92
|
-
<div class="particle-system-color-controls">
|
|
93
|
-
<span>Color: </span>
|
|
94
|
-
<button class="color-button rainbow" on-click(changeColorScheme, 'rainbow')></button>
|
|
95
|
-
<button class="color-button fire" on-click(changeColorScheme, 'fire')></button>
|
|
96
|
-
<button class="color-button ocean" on-click(changeColorScheme, 'ocean')></button>
|
|
97
|
-
<button class="color-button grayscale" on-click(changeColorScheme, 'grayscale')></button>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
<if(input.showStats)>
|
|
102
|
-
<div class="particle-system-stats">
|
|
103
|
-
<div class="stat-item">Status: <b>{state.isRunning ? 'Running' : 'Paused'}</b></div>
|
|
104
|
-
<div class="stat-item">FPS: <b>{state.fps}</b></div>
|
|
105
|
-
<div class="stat-item">Particles: <b>{state.particles.length} / {input.particleCount}</b></div>
|
|
106
|
-
<div class="stat-item">Emission Rate: <b>{state.emissionRate}/frame</b></div>
|
|
107
|
-
<div class="stat-item">Color Scheme: <b>{input.colorScheme}</b></div>
|
|
108
|
-
<div class="stat-item">Gravity: <b>{input.useGravity ? 'On' : 'Off'}</b></div>
|
|
109
|
-
</div>
|
|
110
|
-
</if>
|
|
111
|
-
</div>
|
|
112
|
-
`,stylesheet:`
|
|
113
|
-
.particle-system-container {
|
|
114
|
-
font-family: Arial, sans-serif;
|
|
115
|
-
padding: 20px;
|
|
116
|
-
border-radius: 8px;
|
|
117
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
|
|
118
|
-
margin: 20px auto;
|
|
119
|
-
background-color: #1a1a2e;
|
|
120
|
-
color: white;
|
|
121
|
-
overflow: hidden;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.particle-system-title {
|
|
125
|
-
font-size: 20px;
|
|
126
|
-
margin-bottom: 15px;
|
|
127
|
-
color: #eee;
|
|
128
|
-
text-align: center;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.particle-system-svg {
|
|
132
|
-
display: block;
|
|
133
|
-
border-radius: 4px;
|
|
134
|
-
margin-bottom: 15px;
|
|
135
|
-
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.particle-system-controls {
|
|
139
|
-
display: flex;
|
|
140
|
-
flex-wrap: wrap;
|
|
141
|
-
gap: 10px;
|
|
142
|
-
margin-bottom: 15px;
|
|
143
|
-
justify-content: center;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.particle-system-button {
|
|
147
|
-
padding: 8px 16px;
|
|
148
|
-
border: none;
|
|
149
|
-
border-radius: 4px;
|
|
150
|
-
background-color: #4a5bf7;
|
|
151
|
-
color: white;
|
|
152
|
-
font-size: 14px;
|
|
153
|
-
cursor: pointer;
|
|
154
|
-
transition: background-color 0.2s, transform 0.1s;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.particle-system-button:hover {
|
|
158
|
-
background-color: #6979ff;
|
|
159
|
-
transform: translateY(-2px);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.particle-system-button:active {
|
|
163
|
-
transform: translateY(0);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.particle-system-button.stop {
|
|
167
|
-
background-color: #f75a5a;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.particle-system-button.stop:hover {
|
|
171
|
-
background-color: #ff7979;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.particle-system-stats {
|
|
175
|
-
background-color: rgba(0, 0, 0, 0.2);
|
|
176
|
-
padding: 15px;
|
|
177
|
-
border-radius: 4px;
|
|
178
|
-
font-size: 14px;
|
|
179
|
-
display: grid;
|
|
180
|
-
grid-template-columns: repeat(3, 1fr);
|
|
181
|
-
gap: 8px;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.stat-item {
|
|
185
|
-
margin-bottom: 5px;
|
|
186
|
-
color: white;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.particle-system-color-controls {
|
|
190
|
-
display: flex;
|
|
191
|
-
align-items: center;
|
|
192
|
-
gap: 8px;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.color-button {
|
|
196
|
-
width: 24px;
|
|
197
|
-
height: 24px;
|
|
198
|
-
border-radius: 50%;
|
|
199
|
-
border: 2px solid white;
|
|
200
|
-
cursor: pointer;
|
|
201
|
-
transition: transform 0.2s;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.color-button:hover {
|
|
205
|
-
transform: scale(1.2);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.color-button.rainbow {
|
|
209
|
-
background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.color-button.fire {
|
|
213
|
-
background: linear-gradient(to bottom, yellow, orange, red);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.color-button.ocean {
|
|
217
|
-
background: linear-gradient(to bottom, #00e1ff, #0077ff, #0033cc);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.color-button.grayscale {
|
|
221
|
-
background: linear-gradient(to bottom, white, gray, black);
|
|
222
|
-
}
|
|
223
|
-
`},H=new r0({debug:!1});H.register("particle-system",X);const q={default:`
|
|
224
|
-
<div style="max-width: 1200px; margin: 0 auto; padding: 20px; background-color: #121212;">
|
|
225
|
-
<h1 style="color: white; text-align: center;">Particle System Performance Test</h1>
|
|
226
|
-
<p style="color: #ccc; text-align: center;">This demo creates multiple particle systems with different configurations to test Lips performance.</p>
|
|
227
|
-
|
|
228
|
-
<div style="display: flex; flex-direction: column; gap: 30px;">
|
|
229
|
-
<!-- High-performance particle system -->
|
|
230
|
-
<particle-system
|
|
231
|
-
title="High-Performance System - 500 particles"
|
|
232
|
-
width="600"
|
|
233
|
-
height="400"
|
|
234
|
-
particleCount="500"
|
|
235
|
-
maxParticleSize="12"
|
|
236
|
-
minParticleSize="2"
|
|
237
|
-
speedFactor="1.2"
|
|
238
|
-
colorScheme="rainbow"
|
|
239
|
-
interactive="true"
|
|
240
|
-
showStats="true"
|
|
241
|
-
useGravity="true"/>
|
|
242
|
-
|
|
243
|
-
<!-- Medium-performance systems side by side -->
|
|
244
|
-
<div style="display: flex; gap: 20px; flex-wrap: wrap; justify-content: center;">
|
|
245
|
-
<particle-system
|
|
246
|
-
title="Fire Effect"
|
|
247
|
-
width="400"
|
|
248
|
-
height="300"
|
|
249
|
-
particleCount="200"
|
|
250
|
-
speedFactor="0.8"
|
|
251
|
-
colorScheme="fire"
|
|
252
|
-
interactive="true"
|
|
253
|
-
showStats="true"
|
|
254
|
-
useGravity="true"/>
|
|
255
|
-
|
|
256
|
-
<particle-system
|
|
257
|
-
title="Ocean Effect"
|
|
258
|
-
width="400"
|
|
259
|
-
height="300"
|
|
260
|
-
particleCount="200"
|
|
261
|
-
speedFactor="0.8"
|
|
262
|
-
colorScheme="ocean"
|
|
263
|
-
interactive="true"
|
|
264
|
-
showStats="true"
|
|
265
|
-
useGravity="false"/>
|
|
266
|
-
</div>
|
|
267
|
-
|
|
268
|
-
<!-- Small particle system for comparison -->
|
|
269
|
-
<particle-system
|
|
270
|
-
title="Low-Performance System - 50 particles"
|
|
271
|
-
width="300"
|
|
272
|
-
height="200"
|
|
273
|
-
particleCount="50"
|
|
274
|
-
speedFactor="0.5"
|
|
275
|
-
colorScheme="grayscale"
|
|
276
|
-
interactive="true"
|
|
277
|
-
showStats="true"
|
|
278
|
-
useGravity="true"/>
|
|
279
|
-
</div>
|
|
280
|
-
</div>
|
|
281
|
-
`};H.render("ParticleSystemDemo",q).appendTo("body")},X4=new r0({debug:!0});c8();
|
|
1
|
+
var D8=Object.create;var{defineProperty:_1,getPrototypeOf:I8,getOwnPropertyNames:F8}=Object;var L8=Object.prototype.hasOwnProperty;var J1=(J,Z,X)=>{X=J!=null?D8(I8(J)):{};const H=Z||!J||!J.__esModule?_1(X,"default",{value:J,enumerable:!0}):X;for(let q of F8(J))if(!L8.call(H,q))_1(H,q,{get:()=>J[q],enumerable:!0});return H};var V8=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var s0=(J,Z)=>{for(var X in Z)_1(J,X,{get:Z[X],enumerable:!0,configurable:!0,set:(H)=>Z[X]=()=>H})};var o0=V8((D5,I5)=>{(function(){var J=document,Z=window,X=J.documentElement,H=J.createElement.bind(J),q=H("div"),W=H("table"),z=H("tbody"),K=H("tr"),U=Array.isArray,w=Array.prototype,D=w.concat,O=w.filter,x=w.indexOf,d=w.map,J0=w.push,a=w.slice,q0=w.some,n=w.splice,v=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,i=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,o=/<.+>/,r=/^\w+$/;function Z0(Q,B){var G=g(B);return!Q||!G&&!F(B)&&!N(B)?[]:!G&&i.test(Q)?B.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!G&&r.test(Q)?B.getElementsByTagName(Q):B.querySelectorAll(Q)}var p=function(){function Q(B,G){if(!B)return;if(S(B))return B;var M=B;if(s(B)){var V=G||J;if(M=v.test(B)&&F(V)?V.getElementById(B.slice(1).replace(/\\/g,"")):o.test(B)?n1(B):S(V)?V.find(B):s(V)?j(V).find(B):Z0(B,V),!M)return}else if(h(B))return this.ready(B);if(M.nodeType||M===Z)M=[M];this.length=M.length;for(var $=0,y=this.length;$<y;$++)this[$]=M[$]}return Q.prototype.init=function(B,G){return new Q(B,G)},Q}(),Y=p.prototype,j=Y.init;if(j.fn=j.prototype=Y,Y.length=0,Y.splice=n,typeof Symbol==="function")Y[Symbol.iterator]=w[Symbol.iterator];function S(Q){return Q instanceof p}function L(Q){return!!Q&&Q===Q.window}function F(Q){return!!Q&&Q.nodeType===9}function g(Q){return!!Q&&Q.nodeType===11}function N(Q){return!!Q&&Q.nodeType===1}function P(Q){return!!Q&&Q.nodeType===3}function m(Q){return typeof Q==="boolean"}function h(Q){return typeof Q==="function"}function s(Q){return typeof Q==="string"}function k(Q){return Q===void 0}function _(Q){return Q===null}function b(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function C(Q){if(typeof Q!=="object"||Q===null)return!1;var B=Object.getPrototypeOf(Q);return B===null||B===Object.prototype}j.isWindow=L,j.isFunction=h,j.isArray=U,j.isNumeric=b,j.isPlainObject=C;function R(Q,B,G){if(G){var M=Q.length;while(M--)if(B.call(Q[M],M,Q[M])===!1)return Q}else if(C(Q)){var V=Object.keys(Q);for(var M=0,$=V.length;M<$;M++){var y=V[M];if(B.call(Q[y],y,Q[y])===!1)return Q}}else for(var M=0,$=Q.length;M<$;M++)if(B.call(Q[M],M,Q[M])===!1)return Q;return Q}j.each=R,Y.each=function(Q){return R(this,Q)},Y.empty=function(){return this.each(function(Q,B){while(B.firstChild)B.removeChild(B.firstChild)})};function I(){var Q=[];for(var B=0;B<arguments.length;B++)Q[B]=arguments[B];var G=m(Q[0])?Q.shift():!1,M=Q.shift(),V=Q.length;if(!M)return{};if(!V)return I(G,j,M);for(var $=0;$<V;$++){var y=Q[$];for(var l in y)if(G&&(U(y[l])||C(y[l]))){if(!M[l]||M[l].constructor!==y[l].constructor)M[l]=new y[l].constructor;I(G,M[l],y[l])}else M[l]=y[l]}return M}j.extend=I,Y.extend=function(Q){return I(Y,Q)};var A=/\S+/g;function T(Q){return s(Q)?Q.match(A)||[]:[]}Y.toggleClass=function(Q,B){var G=T(Q),M=!k(B);return this.each(function(V,$){if(!N($))return;R(G,function(y,l){if(M)B?$.classList.add(l):$.classList.remove(l);else $.classList.toggle(l)})})},Y.addClass=function(Q){return this.toggleClass(Q,!0)},Y.removeAttr=function(Q){var B=T(Q);return this.each(function(G,M){if(!N(M))return;R(B,function(V,$){M.removeAttribute($)})})};function E(Q,B){if(!Q)return;if(s(Q)){if(arguments.length<2){if(!this[0]||!N(this[0]))return;var G=this[0].getAttribute(Q);return _(G)?void 0:G}if(k(B))return this;if(_(B))return this.removeAttr(Q);return this.each(function(V,$){if(!N($))return;$.setAttribute(Q,B)})}for(var M in Q)this.attr(M,Q[M]);return this}Y.attr=E,Y.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},Y.hasClass=function(Q){return!!Q&&q0.call(this,function(B){return N(B)&&B.classList.contains(Q)})},Y.get=function(Q){if(k(Q))return a.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},Y.eq=function(Q){return j(this.get(Q))},Y.first=function(){return this.eq(0)},Y.last=function(){return this.eq(-1)};function f(Q){if(k(Q))return this.get().map(function(B){return N(B)||P(B)?B.textContent:""}).join("");return this.each(function(B,G){if(!N(G))return;G.textContent=Q})}Y.text=f;function u(Q,B,G){if(!N(Q))return;var M=Z.getComputedStyle(Q,null);return G?M.getPropertyValue(B)||void 0:M[B]||Q.style[B]}function c(Q,B){return parseInt(u(Q,B),10)||0}function Q0(Q,B){return c(Q,"border".concat(B?"Left":"Top","Width"))+c(Q,"padding".concat(B?"Left":"Top"))+c(Q,"padding".concat(B?"Right":"Bottom"))+c(Q,"border".concat(B?"Right":"Bottom","Width"))}var t={};function e(Q){if(t[Q])return t[Q];var B=H(Q);J.body.insertBefore(B,null);var G=u(B,"display");return J.body.removeChild(B),t[Q]=G!=="none"?G:"block"}function G0(Q){return u(Q,"display")==="none"}function I0(Q,B){var G=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!G&&!!B&&G.call(Q,B)}function T0(Q){return s(Q)?function(B,G){return I0(G,Q)}:h(Q)?Q:S(Q)?function(B,G){return Q.is(G)}:!Q?function(){return!1}:function(B,G){return G===Q}}Y.filter=function(Q){var B=T0(Q);return j(O.call(this,function(G,M){return B.call(G,M,G)}))};function A0(Q,B){return!B?Q:Q.filter(B)}Y.detach=function(Q){return A0(this,Q).each(function(B,G){if(G.parentNode)G.parentNode.removeChild(G)}),this};var c5=/^\s*<(\w+)[^>]*>/,p5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,r1={"*":q,tr:z,td:K,th:K,thead:W,tbody:W,tfoot:W};function n1(Q){if(!s(Q))return[];if(p5.test(Q))return[H(RegExp.$1)];var B=c5.test(Q)&&RegExp.$1,G=r1[B]||r1["*"];return G.innerHTML=Q,j(G.childNodes).detach().get()}j.parseHTML=n1,Y.has=function(Q){var B=s(Q)?function(G,M){return Z0(Q,M).length}:function(G,M){return M.contains(Q)};return this.filter(B)},Y.not=function(Q){var B=T0(Q);return this.filter(function(G,M){return(!s(Q)||N(M))&&!B.call(M,G,M)})};function R0(Q,B,G,M){var V=[],$=h(B),y=M&&T0(M);for(var l=0,F0=Q.length;l<F0;l++)if($){var B0=B(Q[l]);if(B0.length)J0.apply(V,B0)}else{var U0=Q[l][B];while(U0!=null){if(M&&y(-1,U0))break;V.push(U0),U0=G?U0[B]:null}}return V}function a1(Q){if(Q.multiple&&Q.options)return R0(O.call(Q.options,function(B){return B.selected&&!B.disabled&&!B.parentNode.disabled}),"value");return Q.value||""}function s5(Q){if(!arguments.length)return this[0]&&a1(this[0]);return this.each(function(B,G){var M=G.multiple&&G.options;if(M||z5.test(G.type)){var V=U(Q)?d.call(Q,String):_(Q)?[]:[String(Q)];if(M)R(G.options,function($,y){y.selected=V.indexOf(y.value)>=0},!0);else G.checked=V.indexOf(G.value)>=0}else G.value=k(Q)||_(Q)?"":Q})}Y.val=s5,Y.is=function(Q){var B=T0(Q);return q0.call(this,function(G,M){return B.call(G,M,G)})},j.guid=1;function C0(Q){return Q.length>1?O.call(Q,function(B,G,M){return x.call(M,B)===G}):Q}j.unique=C0,Y.add=function(Q,B){return j(C0(this.get().concat(j(Q,B).get())))},Y.children=function(Q){return A0(j(C0(R0(this,function(B){return B.children}))),Q)},Y.parent=function(Q){return A0(j(C0(R0(this,"parentNode"))),Q)},Y.index=function(Q){var B=Q?j(Q)[0]:this[0],G=Q?this:j(B).parent().children();return x.call(G,B)},Y.closest=function(Q){var B=this.filter(Q);if(B.length)return B;var G=this.parent();if(!G.length)return B;return G.closest(Q)},Y.siblings=function(Q){return A0(j(C0(R0(this,function(B){return j(B).parent().children().not(B)}))),Q)},Y.find=function(Q){return j(C0(R0(this,function(B){return Z0(Q,B)})))};var l5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,o5=/^$|^module$|\/(java|ecma)script/i,r5=["type","src","nonce","noModule"];function n5(Q,B){var G=j(Q);G.filter("script").add(G.find("script")).each(function(M,V){if(o5.test(V.type)&&X.contains(V)){var $=H("script");$.text=V.textContent.replace(l5,""),R(r5,function(y,l){if(V[l])$[l]=V[l]}),B.head.insertBefore($,null),B.head.removeChild($)}})}function a5(Q,B,G,M,V){if(M)Q.insertBefore(B,G?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(B,Q);else Q.parentNode.insertBefore(B,G?Q:Q.nextSibling);if(V)n5(B,Q.ownerDocument)}function b0(Q,B,G,M,V,$,y,l){return R(Q,function(F0,B0){R(j(B0),function(U0,f0){R(j(B),function(L0,e0){var x1=G?f0:e0,k1=G?e0:f0,O0=G?U0:L0;a5(x1,!O0?k1:k1.cloneNode(!0),M,V,!O0)},l)},y)},$),B}Y.after=function(){return b0(arguments,this,!1,!1,!1,!0,!0)},Y.append=function(){return b0(arguments,this,!1,!1,!0)};function t5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if(k(Q))return this;var B=/<script[\s>]/.test(Q);return this.each(function(G,M){if(!N(M))return;if(B)j(M).empty().append(Q);else M.innerHTML=Q})}Y.html=t5,Y.appendTo=function(Q){return b0(arguments,this,!0,!1,!0)},Y.wrapInner=function(Q){return this.each(function(B,G){var M=j(G),V=M.contents();V.length?V.wrapAll(Q):M.append(Q)})},Y.before=function(){return b0(arguments,this,!1,!0)},Y.wrapAll=function(Q){var B=j(Q),G=B[0];while(G.children.length)G=G.firstElementChild;return this.first().before(B),this.appendTo(G)},Y.wrap=function(Q){return this.each(function(B,G){var M=j(Q)[0];j(G).wrapAll(!B?M:M.cloneNode(!0))})},Y.insertAfter=function(Q){return b0(arguments,this,!0,!1,!1,!1,!1,!0)},Y.insertBefore=function(Q){return b0(arguments,this,!0,!0)},Y.prepend=function(){return b0(arguments,this,!1,!0,!0,!0,!0)},Y.prependTo=function(Q){return b0(arguments,this,!0,!0,!0,!1,!1,!0)},Y.contents=function(){return j(C0(R0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},Y.next=function(Q,B,G){return A0(j(C0(R0(this,"nextElementSibling",B,G))),Q)},Y.nextAll=function(Q){return this.next(Q,!0)},Y.nextUntil=function(Q,B){return this.next(B,!0,Q)},Y.parents=function(Q,B){return A0(j(C0(R0(this,"parentElement",!0,B))),Q)},Y.parentsUntil=function(Q,B){return this.parents(B,Q)},Y.prev=function(Q,B,G){return A0(j(C0(R0(this,"previousElementSibling",B,G))),Q)},Y.prevAll=function(Q){return this.prev(Q,!0)},Y.prevUntil=function(Q,B){return this.prev(B,!0,Q)},Y.map=function(Q){return j(D.apply([],d.call(this,function(B,G){return Q.call(B,G,B)})))},Y.clone=function(){return this.map(function(Q,B){return B.cloneNode(!0)})},Y.offsetParent=function(){return this.map(function(Q,B){var G=B.offsetParent;while(G&&u(G,"position")==="static")G=G.offsetParent;return G||X})},Y.slice=function(Q,B){return j(a.call(this,Q,B))};var e5=/-([a-z])/g;function E1(Q){return Q.replace(e5,function(B,G){return G.toUpperCase()})}Y.ready=function(Q){var B=function(){return setTimeout(Q,0,j)};if(J.readyState!=="loading")B();else J.addEventListener("DOMContentLoaded",B);return this},Y.unwrap=function(){return this.parent().each(function(Q,B){if(B.tagName==="BODY")return;var G=j(B);G.replaceWith(G.children())}),this},Y.offset=function(){var Q=this[0];if(!Q)return;var B=Q.getBoundingClientRect();return{top:B.top+Z.pageYOffset,left:B.left+Z.pageXOffset}},Y.position=function(){var Q=this[0];if(!Q)return;var B=u(Q,"position")==="fixed",G=B?Q.getBoundingClientRect():this.offset();if(!B){var M=Q.ownerDocument,V=Q.offsetParent||M.documentElement;while((V===M.body||V===M.documentElement)&&u(V,"position")==="static")V=V.parentNode;if(V!==Q&&N(V)){var $=j(V).offset();G.top-=$.top+c(V,"borderTopWidth"),G.left-=$.left+c(V,"borderLeftWidth")}}return{top:G.top-c(Q,"marginTop"),left:G.left-c(Q,"marginLeft")}};var t1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};Y.prop=function(Q,B){if(!Q)return;if(s(Q)){if(Q=t1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(M,V){V[Q]=B})}for(var G in Q)this.prop(G,Q[G]);return this},Y.removeProp=function(Q){return this.each(function(B,G){delete G[t1[Q]||Q]})};var J8=/^--/;function $1(Q){return J8.test(Q)}var S1={},Z8=q.style,Q8=["webkit","moz","ms"];function W8(Q,B){if(B===void 0)B=$1(Q);if(B)return Q;if(!S1[Q]){var G=E1(Q),M="".concat(G[0].toUpperCase()).concat(G.slice(1)),V="".concat(G," ").concat(Q8.join("".concat(M," "))).concat(M).split(" ");R(V,function($,y){if(y in Z8)return S1[Q]=y,!1})}return S1[Q]}var X8={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function e1(Q,B,G){if(G===void 0)G=$1(Q);return!G&&!X8[Q]&&b(B)?"".concat(B,"px"):B}function H8(Q,B){if(s(Q)){var G=$1(Q);if(Q=W8(Q,G),arguments.length<2)return this[0]&&u(this[0],Q,G);if(!Q)return this;return B=e1(Q,B,G),this.each(function(V,$){if(!N($))return;if(G)$.style.setProperty(Q,B);else $.style[Q]=B})}for(var M in Q)this.css(M,Q[M]);return this}Y.css=H8;function J5(Q,B){try{return Q(B)}catch(G){return B}}var q8=/^\s+|\s+$/;function Z5(Q,B){var G=Q.dataset[B]||Q.dataset[E1(B)];if(q8.test(G))return G;return J5(JSON.parse,G)}function B8(Q,B,G){G=J5(JSON.stringify,G),Q.dataset[E1(B)]=G}function z8(Q,B){if(!Q){if(!this[0])return;var G={};for(var M in this[0].dataset)G[M]=Z5(this[0],M);return G}if(s(Q)){if(arguments.length<2)return this[0]&&Z5(this[0],Q);if(k(B))return this;return this.each(function(V,$){B8($,Q,B)})}for(var M in Q)this.data(M,Q[M]);return this}Y.data=z8;function Q5(Q,B){var G=Q.documentElement;return Math.max(Q.body["scroll".concat(B)],G["scroll".concat(B)],Q.body["offset".concat(B)],G["offset".concat(B)],G["client".concat(B)])}R([!0,!1],function(Q,B){R(["Width","Height"],function(G,M){var V="".concat(B?"outer":"inner").concat(M);Y[V]=function($){if(!this[0])return;if(L(this[0]))return B?this[0]["inner".concat(M)]:this[0].document.documentElement["client".concat(M)];if(F(this[0]))return Q5(this[0],M);return this[0]["".concat(B?"offset":"client").concat(M)]+($&&B?c(this[0],"margin".concat(G?"Top":"Left"))+c(this[0],"margin".concat(G?"Bottom":"Right")):0)}})}),R(["Width","Height"],function(Q,B){var G=B.toLowerCase();Y[G]=function(M){if(!this[0])return k(M)?void 0:this;if(!arguments.length){if(L(this[0]))return this[0].document.documentElement["client".concat(B)];if(F(this[0]))return Q5(this[0],B);return this[0].getBoundingClientRect()[G]-Q0(this[0],!Q)}var V=parseInt(M,10);return this.each(function($,y){if(!N(y))return;var l=u(y,"boxSizing");y.style[G]=e1(G,V+(l==="border-box"?Q0(y,!Q):0))})}});var W5="___cd";Y.toggle=function(Q){return this.each(function(B,G){if(!N(G))return;var M=G0(G),V=k(Q)?M:Q;if(V){if(G.style.display=G[W5]||"",G0(G))G.style.display=e(G.tagName)}else if(!M)G[W5]=u(G,"display"),G.style.display="none"})},Y.hide=function(){return this.toggle(!1)},Y.show=function(){return this.toggle(!0)};var X5="___ce",T1=".",A1={focus:"focusin",blur:"focusout"},H5={mouseenter:"mouseover",mouseleave:"mouseout"},G8=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function b1(Q){return H5[Q]||A1[Q]||Q}function g1(Q){var B=Q.split(T1);return[B[0],B.slice(1).sort()]}Y.trigger=function(Q,B){if(s(Q)){var G=g1(Q),M=G[0],V=G[1],$=b1(M);if(!$)return this;var y=G8.test($)?"MouseEvents":"HTMLEvents";Q=J.createEvent(y),Q.initEvent($,!0,!0),Q.namespace=V.join(T1),Q.___ot=M}Q.___td=B;var l=Q.___ot in A1;return this.each(function(F0,B0){if(l&&h(B0[Q.___ot]))B0["___i".concat(Q.type)]=!0,B0[Q.___ot](),B0["___i".concat(Q.type)]=!1;B0.dispatchEvent(Q)})};function q5(Q){return Q[X5]=Q[X5]||{}}function w8(Q,B,G,M,V){var $=q5(Q);$[B]=$[B]||[],$[B].push([G,M,V]),Q.addEventListener(B,V)}function B5(Q,B){return!B||!q0.call(B,function(G){return Q.indexOf(G)<0})}function t0(Q,B,G,M,V){var $=q5(Q);if(!B)for(B in $)t0(Q,B,G,M,V);else if($[B])$[B]=$[B].filter(function(y){var l=y[0],F0=y[1],B0=y[2];if(V&&B0.guid!==V.guid||!B5(l,G)||M&&M!==F0)return!0;Q.removeEventListener(B,B0)})}Y.off=function(Q,B,G){var M=this;if(k(Q))this.each(function($,y){if(!N(y)&&!F(y)&&!L(y))return;t0(y)});else if(!s(Q))for(var V in Q)this.off(V,Q[V]);else{if(h(B))G=B,B="";R(T(Q),function($,y){var l=g1(y),F0=l[0],B0=l[1],U0=b1(F0);M.each(function(f0,L0){if(!N(L0)&&!F(L0)&&!L(L0))return;t0(L0,U0,B0,B,G)})})}return this},Y.remove=function(Q){return A0(this,Q).detach().off(),this},Y.replaceWith=function(Q){return this.before(Q).remove()},Y.replaceAll=function(Q){return j(Q).replaceWith(this),this};function Y8(Q,B,G,M,V){var $=this;if(!s(Q)){for(var y in Q)this.on(y,B,G,Q[y],V);return this}if(!s(B))if(k(B)||_(B))B="";else if(k(G))G=B,B="";else M=G,G=B,B="";if(!h(M))M=G,G=void 0;if(!M)return this;return R(T(Q),function(l,F0){var B0=g1(F0),U0=B0[0],f0=B0[1],L0=b1(U0),e0=U0 in H5,x1=U0 in A1;if(!L0)return;$.each(function(k1,O0){if(!N(O0)&&!F(O0)&&!L(O0))return;var f1=function(z0){if(z0.target["___i".concat(z0.type)])return z0.stopImmediatePropagation();if(z0.namespace&&!B5(f0,z0.namespace.split(T1)))return;if(!B&&(x1&&(z0.target!==O0||z0.___ot===L0)||e0&&z0.relatedTarget&&O0.contains(z0.relatedTarget)))return;var h1=O0;if(B){var v0=z0.target;while(!I0(v0,B)){if(v0===O0)return;if(v0=v0.parentNode,!v0)return}h1=v0}Object.defineProperty(z0,"currentTarget",{configurable:!0,get:function(){return h1}}),Object.defineProperty(z0,"delegateTarget",{configurable:!0,get:function(){return O0}}),Object.defineProperty(z0,"data",{configurable:!0,get:function(){return G}});var j8=M.call(h1,z0,z0.___td);if(V)t0(O0,L0,f0,B,f1);if(j8===!1)z0.preventDefault(),z0.stopPropagation()};f1.guid=M.guid=M.guid||j.guid++,w8(O0,L0,f0,B,f1)})}),this}Y.on=Y8;function K8(Q,B,G,M){return this.on(Q,B,G,M,!0)}Y.one=K8;var U8=/\r?\n/g;function O8(Q,B){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(B.replace(U8,"\r\n")))}var M8=/file|reset|submit|button|image/i,z5=/radio|checkbox/i;if(Y.serialize=function(){var Q="";return this.each(function(B,G){R(G.elements||[G],function(M,V){if(V.disabled||!V.name||V.tagName==="FIELDSET"||M8.test(V.type)||z5.test(V.type)&&!V.checked)return;var $=a1(V);if(!k($)){var y=U($)?$:[$];R(y,function(l,F0){Q+=O8(V.name,F0)})}})}),Q.slice(1)},typeof D5!=="undefined")I5.exports=j;else Z.cash=Z.$=j})()});var g0="i18n",P0="syn:",V0="fn:",h0="on-",M0=/^\.\.\./,Z1=/^\[(.*?)\]$/,y1=/{\s*([^{}]+)\s*}/g,G5=["@html","@text","@format"],Q1=["if","for","switch","async","router"],w5=["display","visibility","position","width","height"],Y5=":n",v1=":pr",K5="m",U5="c",O5="x",l0="*",x0=":xtag",k0=":dtag",M5=100;var u1=new Map;class W1{templateStore;constructor(J){this.templateStore=J}parse(J,Z){if(u1.has(J))return u1.get(J);let X=(J||"").trim().replace(/>\s*</g,"><").replace(/\s{2,}/g," ").replace(/[\r\n\t]/g,"").replace(/<([a-zA-Z0-9_-]+)([^>]*?)\s*\/>/g,"<$1$2></$1>").replace(/<\{([^}]+)\}\s*(.*?)(\/)>/g,(H,q,W)=>{return W.endsWith("<")?`<lips ${k0}="${q}" ${W}/lips>`:`<lips ${k0}="${q}" ${W}></lips>`}).replace(/(<>)([\s\S]*?)(<\/>)/g,'<lips fragment="true">$2</lips>').replace(/<if\(\s*(.*?)\s*\)>/g,'<if @by="$1">').replace(/<else-if\(\s*(.*?)\s*\)>/g,'<else-if @by="$1">').replace(/<switch\(\s*(.*?)\s*\)>/g,'<switch @by="$1">').replace(/<async await\(\s*(.*?)\s*\)>/g,`<async ${V0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(H)=>H.replace(/\s+/g,""));return X=this.matchEventHandlers(X),X=this.markExpressionAttributes(X,Z),u1.set(J,X),X}isExpression(J){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(J))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(J))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(J))return!0;if(J.includes("{")&&J.includes("}"))return!0;return!1}matchEventHandlers(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let X=J,H;while((H=Z.exec(J))!==null){const q=H[1],W=H.index+H[0].length;let z=1,K=W;while(K<J.length&&z>0){if(J[K]==="(")z++;if(J[K]===")")z--;K++}if(z===0){const U=J.slice(W,K-1).trim(),w=J.slice(0,H.index),D=`${h0}${q}="${U}"`,O=J.slice(K);X=w+D+O,J=X,Z.lastIndex=w.length+D.length}}return X}markExpressionAttributes(J,Z){const X=[];let q=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(W,z,K)=>{if(!Q1.includes(z)&&(this.templateStore.has(z)||Z?.has(z)))K+=` ${x0}="${z}"`;return X.push(K),`<${z}##TAG_ATTRS_${X.length-1}##>`});for(let W=0;W<X.length;W++){const z=`##TAG_ATTRS_${W}##`,K=X[W],U=this.processAttributes(K);q=q.replace(z,U)}return q}processAttributes(J){let Z="",X=0,H=!1,q="",W=0,z=0,K=0;while(X<J.length){const U=J[X];if((U==='"'||U==="'")&&(X===0||J[X-1]!=="\\")){if(!H)H=!0,q=U;else if(U===q)H=!1}if(!H){if(U==="(")z++;else if(U===")")z--;else if(U==="{")K++;else if(U==="}")K--}if(!H&&z===0&&K===0&&(U===" "||X===J.length-1)){let w=X;if(X===J.length-1)w=X+1;const D=J.substring(W,w).trim();if(D){const O=this.processAttribute(D);Z+=" "+O}W=X+1}X++}return Z}processAttribute(J){const Z=J.indexOf("=");if(Z===-1){if(J===g0||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let X=J.substring(0,Z).trim(),H=J.substring(Z+1).trim();if(X.startsWith("@"))return X=!G5.includes(X)?X.slice(1):X,`:${X}=${H}`;if(X.startsWith(":")||X.startsWith(V0)||X.startsWith(h0))return J;if(H.startsWith('"')&&H.endsWith('"')||H.startsWith("'")&&H.endsWith("'")){const q=H.substring(1,H.length-1);if(this.isExpression(q))return`:${X}="${q}"`;return J}else return`:${X}="${H}"`}}class X1{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,Z){this.callbacks.set(J,Z)}unregister(J){this.callbacks.delete(J)}queue(J){if(!this.callbacks.has(J))return;if(this.pendingComponents.add(J),!this.isPending)this.isPending=!0,this.schedule()}schedule(){Promise.resolve().then(()=>this.process())}process(){const J=Array.from(this.pendingComponents);this.pendingComponents.clear(),this.isPending=!1,J.forEach((Z)=>{try{const X=this.callbacks.get(Z);if(X)X()}catch(X){console.error(`Error updating component ${Z}:`,X)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class H1{subscriptions=new Map;tick=new X1;register(J,Z){this.subscriptions.set(J,Z),this.tick.register(J,Z)}unregister(J){this.subscriptions.delete(J),this.tick.unregister(J)}queueUpdate(J){this.tick.queue(J)}dispose(){this.subscriptions.clear(),this.tick.dispose()}prepareForPotentialUnload(){this.tick.clear(),this.subscriptions.forEach((J,Z)=>{this.subscriptions.set(Z,()=>{})})}proxyState(J,Z){const X=this,H=new WeakMap,q=(z)=>{if(typeof z.toJSON==="function")return z;if(z instanceof Map)z.forEach((U,w)=>z.set(w,W(U)));else if(Array.isArray(z))z.forEach((U,w)=>z[w]=W(U));else if(typeof z==="object")Object.entries(z).forEach(([U,w])=>z[U]=W(w));let K=new Proxy(z,{get(U,w){if(w==="toJSON")return function(){const O=(x)=>{if(!x||typeof x!=="object")return x;if(H.has(x)){const d=H.get(x);if(d instanceof Map){const a={};return d.forEach((q0,n)=>a[typeof n==="object"?JSON.stringify(n):String(n)]=O(q0)),a}if(Array.isArray(d))return d.map((a)=>O(a));const J0={};return Object.entries(d).forEach(([a,q0])=>J0[a]=O(q0)),J0}if(typeof x.toJSON==="function"&&!H.has(x))return x.toJSON();return x};return O(K)};if(w==="reset")return function(){K=null};const D=U[w];if(z instanceof Map&&typeof D==="function")return function(...O){const x=w.toString();if(x==="set"&&O.length>=2)O[1]=W(O[1]);const d=D.apply(U,O);return["set","delete","clear"].includes(x)&&X.queueUpdate(J),d};if(Array.isArray(z)&&typeof D==="function")return function(...O){const x=w.toString();if(["push","unshift"].includes(x))O=O.map((J0)=>W(J0));else if(x==="splice"&&O.length>2)O=[O[0],O[1],...O.slice(2).map((J0)=>W(J0))];const d=D.apply(U,O);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(x)&&X.queueUpdate(J),d};return D},set(U,w,D){if(U[w]===D)return!0;if(D instanceof Map&&U[w]instanceof Map){const O=U[w];return O.clear(),D.forEach((x,d)=>O.set(d,W(x))),X.queueUpdate(J),!0}return U[w]=W(D),X.queueUpdate(J),!0}});return H.set(K,z),K},W=(z)=>{if(!z)return z;return z instanceof Map||Array.isArray(z)||typeof z==="object"?q(z):z};return q(Z)}}class q1{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Z)=>{try{const X=Z.node;if(!X){this.unwatch(Z);return}if(J.type==="attach"&&document.contains(X[0]))this.unwatch(Z),Z.emit("component:attached"),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();else if(J.type==="detach"&&!document.contains(X[0]))this.unwatch(Z),Z.emit("component:detached"),typeof Z.onDetach=="function"&&Z.onDetach.bind(Z)()}catch(X){console.log("DWS error --",X)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Z="attach"){const X=J.node;if(!X)return;if(Z==="attach"&&document.contains(X[0])){J.emit("component:attached"),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Z==="detach"&&!document.contains(X[0])){J.emit("component:detached"),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const H=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Z}ment-timeout`)},this.TIMEOUT);this.observedComponents.set(J,{timeout:H,type:Z}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Z==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const Z=this.observedComponents.get(J);if(Z)clearTimeout(Z.timeout),this.observedComponents.delete(J);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((J)=>clearTimeout(J.timeout)),this.observedComponents.clear()}}var B1=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(X,H)=>{return Z[H]!==void 0?Z[H].toString():`{${H}}`})},j5=(J,Z,X,H,q)=>{switch(J){case"plural":{if(typeof X==="string"){console.warn("Plural format value cannot be a string");return}if(H.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let K=X["*"];if(typeof K==="object")K=K[q||"*"];return B1(K,H)}if(typeof H.count==="string")H.count=Number(H.count);let W="*";if(H.count.toString()in X)W=H.count.toString();let z=X[W]||X["*"];if(typeof z==="object")z=z[q||"*"];return B1(z,H)}case"condition":{if(typeof X==="string"){console.warn("Condition format value cannot be a string");return}let W;for(let z in X)try{if(new Function("params",`with( params ){ return ${z}; }`)(H||{})){W=X[z];break}}catch(K){console.warn(`Invalid <${Z}(${z})> condition expression`)}if(W===void 0)return;if(typeof W==="object")W=W[q||"*"];return B1(W,H)}case"variable":default:{const W=typeof X==="object"?X[q||"*"]:X;if(typeof W==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return B1(W,H)}}};class z1{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,Z){this.DICTIONARIES[J]=Z}translate(J,Z){if(Z&&this.currentLang===Z)return{text:J,lang:this.currentLang};Z=Z||this.currentLang;const[X,H]=Z.split("-");if(this.DICTIONARIES[X]&&J in this.DICTIONARIES[X]){if(typeof this.DICTIONARIES[X][J]==="object"){const q=this.DICTIONARIES[X][J];J=q[H||"*"]||q["*"]}else if(typeof this.DICTIONARIES[X][J]==="string")J=this.DICTIONARIES[X][J]}return{text:J,lang:Z}}format(J,Z,X){X=X||this.currentLang;const[H,q]=X.split("-");if(!this.DICTIONARIES[H]){console.warn(`Undefined <${X}> format dictionary`);return}if(!this.DICTIONARIES[H][J]){console.warn(`Undefined <${X}[${J}]> format reference`);return}const W=this.DICTIONARIES[H][J];if(typeof W==="string"){console.warn(`Invalid <${X}[${J}]> format reference. Expected object`);return}if(typeof W!=="object"||W===null||Array.isArray(W)){console.warn(`Invalid <${X}[${J}]> format value`);return}return j5(W.type,J,W.value,Z,q)}}var y5=J1(o0(),1);var G1="comm",w1="rule",Y1="decl";var F5="@import";var L5="@namespace",V5="@keyframes";var C5="@layer";function K1(J){return J.trim()}function u0(J,Z,X){return J.replace(Z,X)}function N5(J,Z,X){return J.indexOf(Z,X)}function E0(J,Z){return J.charCodeAt(Z)|0}function $0(J,Z,X){return J.slice(Z,X)}function Y0(J){return J.length}function U1(J){return J.length}function m0(J,Z){return Z.push(J),J}var m1=Math.abs,r0=String.fromCharCode;function M1(J,Z,X,H,q,W,z,K){return{value:J,root:Z,parent:X,type:H,props:q,children:W,line:O1,column:d0,length:z,return:"",siblings:K}}function P5(){return H0}function E5(){if(H0=j0>0?E0(c0,--j0):0,d0--,H0===10)d0=1,O1--;return H0}function D0(){if(H0=j0<R5?E0(c0,j0++):0,d0++,H0===10)d0=1,O1++;return H0}function S0(){return E0(c0,j0)}function n0(){return j0}function j1(J,Z){return $0(c0,J,Z)}function i0(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $5(J){return O1=d0=1,R5=Y0(c0=J),j0=0,[]}function S5(J){return c0="",J}function D1(J){return K1(j1(j0-1,d1(J===91?J+2:J===40?J+1:J)))}function T5(J){while(H0=S0())if(H0<33)D0();else break;return i0(J)>2||i0(H0)>3?"":" "}function A5(J,Z){while(--Z&&D0())if(H0<48||H0>102||H0>57&&H0<65||H0>70&&H0<97)break;return j1(J,n0()+(Z<6&&S0()==32&&D0()==32))}function d1(J){while(D0())switch(H0){case J:return j0;case 34:case 39:if(J!==34&&J!==39)d1(H0);break;case 40:if(J===41)d1(J);break;case 92:D0();break}return j0}function b5(J,Z){while(D0())if(J+H0===57)break;else if(J+H0===84&&S0()===47)break;return"/*"+j1(Z,j0-1)+"*"+r0(J===47?J:D0())}function g5(J){while(!i0(S0()))D0();return j1(J,j0)}var O1=1,d0=1,R5=0,j0=0,H0=0,c0="";function f5(J){return S5(I1("",null,null,null,[""],J=$5(J),0,[0],J))}function I1(J,Z,X,H,q,W,z,K,U){var w=0,D=0,O=z,x=0,d=0,J0=0,a=1,q0=1,n=1,v=0,i="",o=q,r=W,Z0=H,p=i;while(q0)switch(J0=v,v=D0()){case 40:if(J0!=108&&E0(p,O-1)==58){if(N5(p+=u0(D1(v),"&","&\f"),"&\f",m1(w?K[w-1]:0))!=-1)n=-1;break}case 34:case 39:case 91:p+=D1(v);break;case 9:case 10:case 13:case 32:p+=T5(J0);break;case 92:p+=A5(n0()-1,7);continue;case 47:switch(S0()){case 42:case 47:if(m0(N8(b5(D0(),n0()),Z,X,U),U),(i0(J0||1)==5||i0(S0()||1)==5)&&Y0(p)&&$0(p,-1,void 0)!==" ")p+=" ";break;default:p+="/"}break;case 123*a:K[w++]=Y0(p)*n;case 125*a:case 59:case 0:switch(v){case 0:case 125:q0=0;case 59+D:if(n==-1)p=u0(p,/\f/g,"");if(d>0&&(Y0(p)-O||a===0&&J0===47))m0(d>32?k5(p+";",H,X,O-1,U):k5(u0(p," ","")+";",H,X,O-2,U),U);break;case 59:p+=";";default:if(m0(Z0=x5(p,Z,X,w,D,q,K,i,o=[],r=[],O,W),W),v===123)if(D===0)I1(p,Z,Z0,Z0,o,W,O,K,r);else{switch(x){case 99:if(E0(p,3)===110)break;case 108:if(E0(p,2)===97)break;default:D=0;case 100:case 109:case 115:}if(D)I1(J,Z0,Z0,H&&m0(x5(J,Z0,Z0,0,0,q,K,i,q,o=[],O,r),r),q,r,O,K,H?o:r);else I1(p,Z0,Z0,Z0,[""],r,0,K,r)}}w=D=d=0,a=n=1,i=p="",O=z;break;case 58:O=1+Y0(p),d=J0;default:if(a<1){if(v==123)--a;else if(v==125&&a++==0&&E5()==125)continue}switch(p+=r0(v),v*a){case 38:n=D>0?1:(p+="\f",-1);break;case 44:K[w++]=(Y0(p)-1)*n,n=1;break;case 64:if(S0()===45)p+=D1(D0());x=S0(),D=O=Y0(i=p+=g5(n0())),v++;break;case 45:if(J0===45&&Y0(p)==2)a=0}}return W}function x5(J,Z,X,H,q,W,z,K,U,w,D,O){var x=q-1,d=q===0?W:[""],J0=U1(d);for(var a=0,q0=0,n=0;a<H;++a)for(var v=0,i=$0(J,x+1,x=m1(q0=z[a])),o=J;v<J0;++v)if(o=K1(q0>0?d[v]+" "+i:u0(i,/&\f/g,d[v])))U[n++]=o;return M1(J,Z,X,q===0?w1:K,U,w,D,O)}function N8(J,Z,X,H){return M1(J,Z,X,G1,r0(P5()),$0(J,2,-2),0,H)}function k5(J,Z,X,H,q){return M1(J,Z,X,Y1,$0(J,0,H),$0(J,H+1,-1),H,q)}function F1(J,Z){var X="";for(var H=0;H<J.length;H++)X+=Z(J[H],H,J,Z)||"";return X}function h5(J,Z,X,H){switch(J.type){case C5:if(J.children.length)break;case F5:case L5:case Y1:return J.return=J.return||J.value;case G1:return"";case V5:return J.return=J.value+"{"+F1(J.children,H)+"}";case w1:if(!Y0(J.value=J.props.join(",")))return""}return Y0(X=F1(J.children,H))?J.return=J.value+"{"+X+"}":""}function _5(J){var Z=U1(J);return function(X,H,q,W){var z="";for(var K=0;K<Z;K++)z+=J[K](X,H,q,W)||"";return z}}class p0{nsp;settings;$head;constructor(J,Z){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=y5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return F1(f5(J),_5([h5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const X=new MutationObserver(()=>{const H=document.querySelector(J);if(H&&getComputedStyle(H).cssText)X.disconnect(),Z()});X.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(J){if(!J)throw new Error("Invalid injection arguments");const Z=`rel="${this.settings.meta?"@":""}${this.nsp}"`;J=this.settings.meta?J:`[rel="${this.nsp}"] { ${J} }`;try{const X=this.compile(J);if(!X)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const H=document.createElement("style");H.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),H.textContent=X;let q=0;const W=this.$head.find(`style[${Z}]`);if(W.length)q=parseInt(W.attr("dindex"))+1,W.remove();return H.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(H):document.head.appendChild(H),H}catch(X){throw new Error(`Style injection failed: ${X.message}`)}}async load(J){if(this.settings=J,typeof this.settings!=="object")throw new Error("Undefined styles settings");if(this.settings.sheet){const Z=await this.inject(this.settings.sheet);await this.waitForStyles(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`)}}get(){}async clear(){const J=this.$head.find(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`);if(!J.length)return;const Z=parseInt(J.attr("dindex"));Z===0?J.remove():J.attr("dindex",String(Z-1))}async custom(){return{}}async style(){return{}}}class L1{pending=new Map;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){const Z=J.priority??2;if(!this.pending.has(Z))this.pending.set(Z,new Set);if(this.pending.get(Z)?.add(J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}apply({dep:J,deppath:Z},X="batch-updator"){try{const H=this.component.FGUD.get(J)?.get(Z);if(!H){console.warn(`[batch update]: <${Z}> dependency not found`);return}if(H.garbage){this.component.FGUD.get(J)?.delete(Z),!this.component.FGUD.get(J)?.size&&this.component.FGUD.delete(J);return}const q=this.component.FGUDMemory.get(H.nodepath);if(!q)return;const W=H.update(q.memo||{},X);if(W){if(typeof W.memo==="object")q.memo=W.memo;typeof W.cleanup==="function"&&W.cleanup()}}catch(H){console.error("Failed to update dependency --",H)}}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=new Map;this.pending.forEach((H,q)=>J.set(q,new Set(H))),this.pending.clear(),this.isPending=!1;const Z=(H)=>{const q=Array.from(H);this.component.metrics.trackBatch(q.length),this.metrics.batchCount++,this.metrics.lastBatchSize=q.length,this.metrics.updatesProcessed+=q.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),q.forEach((W)=>this.apply(W))},X=Array.from(J.keys()).sort((H,q)=>H-q);for(let H of X){const q=J.get(H);q&&q.size&&Z(q)}if(this.pending.size>0&&!this.isPending)this.isPending=!0,this.scheduleProcessing()}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class V1{options={emit:!0};__events={};__once_events={};constructor(J){if(J)this.options=J}on(J,Z){if(!Array.isArray(this.__events[J]))this.__events[J]=[];return this.__events[J].push(Z),this}once(J,Z){if(!Array.isArray(this.__once_events[J]))this.__once_events[J]=[];return this.__once_events[J].push(Z),this}off(J){return delete this.__events[J],delete this.__once_events[J],this}emit(J,...Z){if(!this.options.emit)return;const X=(q)=>{if(typeof q.toJSON==="function")return q.toJSON();if(Array.isArray(q))return q.map(X);if(typeof q==="object")for(let W in q)q[W]=X(q[W]);return q},H=Z.map(X);this.__events[J]?.forEach((q)=>q(...H)),this.__once_events[J]?.forEach((q)=>q(...H)),delete this.__once_events[J]}}var i1=J1(o0(),1);function w0(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(v5(J)&&v5(Z)){for(let z of J)if(!Z.has(z))return!0;return!1}const W=new WeakMap;for(let z of J){let K=!1;if(typeof z!=="object"){if(Z.has(z))K=!0}else for(let U of Z){if(typeof U!=="object")continue;if(!W.has(z))W.set(z,new WeakMap);const w=W.get(z);if(w.has(U)){if(K=w.get(U),K)break;continue}const D=!w0(z,U);if(w.set(U,D),D){K=!0;break}}if(!K)return!0}return!1}if(J instanceof Map){if(!(Z instanceof Map))return!0;if(J.size!==Z.size)return!0;if(u5(J)&&u5(Z)){for(let[z,K]of J)if(Z.get(z)!==K)return!0;return!1}const W=new WeakMap;for(let[z,K]of J){if(typeof z!=="object"){if(!Z.has(z))return!0;const D=Z.get(z);if(typeof K!=="object"){if(K!==D)return!0;continue}if(typeof D!=="object"||w0(K,D))return!0;continue}let U=!1,w=!1;for(let[D,O]of Z){if(typeof D!=="object")continue;if(!W.has(z))W.set(z,new WeakMap);const x=W.get(z);if(x.has(D)){const[d,J0]=x.get(D);if(d){U=!0,w=J0;break}continue}if(!w0(z,D)){if(U=!0,w=typeof K==="object"&&typeof O==="object"?!w0(K,O):K===O,x.set(D,[!0,w]),w)break}else x.set(D,[!1,!1])}if(!U||!w)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Z))return!0;if(J.length!==Z.length)return!0;for(let W=0;W<J.length;W++){const z=J[W],K=Z[W];if(z!==K&&(typeof z!=="object"||w0(z,K)))return!0}return!1}const X=Object.keys(J),H=Object.keys(Z);if(X.length!==H.length)return!0;X.sort(),H.sort();const q=X.length;for(let W=0;W<q;W++)if(X[W]!==H[W])return!0;for(let W=0;W<q;W++){const z=X[W],K=J[z],U=Z[z];if(K===U)continue;if(K instanceof Date){if(!(U instanceof Date)||String(K)!==String(U))return!0;continue}if(K instanceof RegExp){if(!(U instanceof RegExp)||K.source!==U.source||K.flags!==U.flags)return!0;continue}if(K instanceof Map){if(!(U instanceof Map)||w0(K,U))return!0;continue}if(K instanceof Set){if(!(U instanceof Set)||w0(K,U))return!0;continue}if(K instanceof Function){if(!(U instanceof Function))return!0;continue}if(typeof K==="object"){if(typeof U!=="object")return!0;if(K===J){if(U!==Z)return!0}else if(w0(K,U))return!0}else return!0}return!1}function K0(J,Z){if(J===Z)return!0;if(J==null||Z==null)return J===Z;const X=typeof J;if(X!==typeof Z)return!1;if(X!=="object"){if(X==="number"&&isNaN(J)&&isNaN(Z))return!0;return!1}if(J instanceof Date)return Z instanceof Date&&J.getTime()===Z.getTime();if(J instanceof RegExp)return Z instanceof RegExp&&J.source===Z.source&&J.flags===Z.flags;if(J instanceof Error)return Z instanceof Error&&J.name===Z.name&&J.message===Z.message&&(J.stack===Z.stack||!J.stack&&!Z.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(Z))return!1;if(J.byteLength!==Z.byteLength)return!1;const K=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),U=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let w=0;w<K.length;w++)if(K[w]!==U[w])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!w0(J,Z);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Z))return!1;const W=Object.getOwnPropertyNames(J),z=Object.getOwnPropertyNames(Z);if(W.length!==z.length)return!1;for(let K of W){if(!Object.prototype.hasOwnProperty.call(Z,K))return!1;if(!K0(J[K],Z[K]))return!1}if(q!==null&&q!==Object.prototype){const K=Object.getOwnPropertyNames(q),U=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(K.length!==U.length)return!1;for(let w of K){if(w==="constructor")continue;if(!K0(q[w],Object.getPrototypeOf(Z)[w]))return!1}}return!0}function v5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function u5(J){for(let[Z,X]of J)if(typeof Z==="object"&&Z!==null||typeof X==="object"&&X!==null)return!1;return!0}function X0(J,Z=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Z.has(J))return Z.get(J);if(J instanceof Date)return new Date(J.getTime());if(J instanceof RegExp)return new RegExp(J.source,J.flags);if(J instanceof Map){const q=new Map;return Z.set(J,q),J.forEach((W,z)=>q.set(X0(z,Z),X0(W,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((W)=>q.add(X0(W,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let W=0;W<J.length;W++)q[W]=X0(J[W],Z);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const X=Object.create(Object.getPrototypeOf(J));Z.set(J,X);const H=Object.getOwnPropertySymbols(J);for(let q of H)X[q]=X0(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))X[q]=X0(J[q],Z);return X}function m5(J,Z){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!Z||typeof Z!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Z).length)return{...J};function X(q,W,z){const K=W.split(/\.|\[|\]/).filter(Boolean);let U=q;for(let w=0;w<K.length;w++){const D=K[w],O=!isNaN(Number(D)),x=w===K.length-1,d=!isNaN(Number(K[w+1]));if(x){U[D]=z;continue}if(!(D in U))U[D]=d?[]:{};else if(d&&!Array.isArray(U[D]))U[D]=[];else if(!d&&Array.isArray(U[D]))U[D]={};U=U[D]}}const H=X0(J);try{for(let[q,W]of Object.entries(Z)){if(typeof q!=="string")throw new TypeError(`Invalid path: ${q}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(q))throw new Error(`Invalid path format: ${q}`);X(H,q,W)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return H}function C1(J){return JSON.parse(JSON.stringify(J))}i1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&i1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class N1{debug;initialStats={renderCount:0,elementCount:0,renderTime:0,avgRenderTime:0,maxRenderTime:0,componentCount:0,componentUpdateCount:0,partialCount:0,partialUpdateCount:0,memoryUsage:void 0,domOperations:0,domInsertsCount:0,domUpdatesCount:0,domRemovalsCount:0,i18nTrackCount:0,i18nUpdateCount:0,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(J=!1){if(this.debug=J,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const J=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");J.push({timestamp:Date.now(),metrics:{...this.stats}}),J.length>100&&J.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(J))}catch(J){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const J=performance.now()-this.renderStartTime;this.stats.renderTime=J,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,J),this.renderTimes.push(J),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((Z,X)=>Z+X,0)/this.renderTimes.length,this.renderStartTime=0,this.measurementCount++}inc(J){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]++}dec(J){if(!this.debug)return;if(typeof this.stats[J]==="number"&&this.stats[J]>0)this.stats[J]--}record(J,Z){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=Z}add(J,Z){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=Z}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=X0(this.initialStats)}log(){if(!this.debug)return;if(this.loggingInterval>1&&this.measurementCount%this.loggingInterval!==0)return;const J={"Render Count":this.stats.renderCount,"Element Count":this.stats.elementCount,"Avg Render Time (ms)":this.stats.avgRenderTime.toFixed(2),"Max Render Time (ms)":this.stats.maxRenderTime.toFixed(2)},Z={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},X={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},H={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},q={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},W={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},z={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(J),console.table(Z),console.table(X),console.table(H),console.table(q),console.table(W),console.table(z),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return X0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var W0=J1(o0(),1);var R8=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},i5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function _0(J,Z={maxSize:100}){const X=new Set,H=[{value:J,timestamp:Date.now()}];let q=0;const W=()=>{const w=R1[R1.length-1];return w&&R8(w,X),H[q].value},z=()=>{const w=[...X];if(d5)for(let D of w)d5.add(D);else for(let D of w)D.execute()};return[W,(w,D)=>{if(Object.is(H[q].value,w))return;if(q<H.length-1)H.splice(q+1);if(H.push({value:w,timestamp:Date.now(),metadata:D}),H.length>Z.maxSize)H.shift(),q=Math.max(0,q-1);else q++;z()},{undo(){if(q>0)q--,z()},redo(){if(q<H.length-1)q++,z()},jumpTo(w){if(w>=0&&w<H.length&&w!==q)q=w,z()},getHistory(){return[...H]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<H.length-1},clear(){const w=H[0];H.length=0,H.push(w),q=0,z()}}]}function a0(J){let Z=!1;const X=()=>{if(Z)throw new Error("Circular dependency detected");if(H.isDisposed)return;Z=!0,i5(H),R1.push(H);try{J()}finally{Z=!1,R1.pop()}},H={execute:X,dependencies:new Set,isDisposed:!1};return X(),{dispose:()=>{H.isDisposed=!0,i5(H)}}}var R1=[],d5=null;class y0 extends V1{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=new Map;FGUD=new Map;FGUDMemory=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;metrics;stylesheet;__inpath__="";__inpathCounter__=0;__renderDepth__=0;__boundaries__;constructor(J,Z,{input:X,state:H,context:q,_static:W,handler:z,stylesheet:K,macros:U,declaration:w},D){super();if(this.lips=D.lips,D?.debug)this.debug=D.debug||this.lips.debug;if(D?.prepath)this.prepath=D.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=this.__inpath__=`${this.prepath}:${this.__name__}`,this.__boundaries__=D.boundaries,this.declaration=w||{name:J},this.input=X||{},this.static=W||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,H||{}),U&&this.setMacros(U),z&&this.setHandler(z),K&&this.setStylesheet(K),this.__template__=this.lips.preprocessor.parse(Z,this.__macros),this.metrics=new N1(this.debug),this.metrics.inc("componentCount"),this.UQS=new L1(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create"),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(),this.emit("component:input");this.__previous={state:X0(this.state),input:X0(this.input),context:X0(this.context)};const[O,x]=_0(this.input),[d,J0]=_0(this.state),[a,q0]=_0(this.context);this.__setInput=x,this.__setState=J0,this.__getState=d,this.lips.IUC.register(this.__path__,()=>{w0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(n)=>{if(!w0(this.context,n))return;q0(n),this.context=n,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context")}),this.lips.useTranslator("*",(n)=>{if(n===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=n}),this.ICE=a0(()=>{const n=d(),v=this.input=O(),i=this.context=a();if(!this.isRendered){if(this.metrics.reset(),!this.__template__.length||w?.syntax&&typeof this.onSelfRender=="function"){const o=this.onSelfRender.bind(this)(this.input);if(!this.__boundaries__?.start||!this.__boundaries__?.end)throw new Error(`Undefined <${this.__name__} syntax component boundaries`);this.$=o||W0.default()}else{const{$log:o}=this.render("",void 0,void 0,this.FGUD);this.$=o}!w?.syntax&&this.$?.each((o,r)=>{typeof r.setAttribute=="function"&&r.setAttribute("rel",this.__name__)}),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount"),this.lips.watcher.watch(this)}else this.__updateDepNodes__(),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update"),this.__previous={input:X0(v),state:X0(n),context:X0(i)};typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render")})}setContext(J,Z){this.lips.setContext(J,Z)}setInput(J,Z){if(!w0(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(this.declaration.syntax?Z:void 0)}subInput(J,Z){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(m5(this.input,J),this.declaration.syntax?Z:void 0),this}setMacros(J){const Z=this.lips.preprocessor.parse(J),X=W0.default(Z);if(!X.length)return;const H=this;X.each(function(){const q=W0.default(this),{argv:W,attrs:z}=H.__getAttributes__(q);if(!Object.keys(z))throw new Error("Invalid macro component definition");if(!z.literals.name)throw new Error("Undefined macro `name` attribute.");if(H.__macros.get(z.literals.name))console.warn(`Duplicate macro <${z.literals.name}> will be override`);if(!q.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");H.__macros.set(z.literals.name,{argv:W,$node:q})})}setHandler(J){Object.entries(J).map(([Z,X])=>this[Z]=X?.bind(this))}setStylesheet(J){const Z={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new p0(this.__name__,Z)}get node(){if(!this.isRendered)throw new Error("node() is expected to be call after component get rendered");return this.$}get boundaries(){return this.__boundaries__}render(J,Z,X={},H,q){if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:H||new Map};const W=this,z=H||new Map,K=[];this.metrics.startRender();let U=W0.default();function w(){return X0(X)}function D(Y,j=!1){const S=O(Y,j);return W.__inpathCounter__++,W.__inpath__?`${W.__inpath__}/${S}`:`${J?J+"/":""}${S}`}function O(Y,j=!1){let S="";switch(Y){case"component":S=j?O5:U5;break;case"macro":S=K5;break}return S+W.__inpathCounter__}function x(Y){return Y===null||typeof Y==="object"&&typeof Y.mesh==="function"&&typeof Y.fill==="function"&&typeof Y.update==="function"&&typeof Y.cleanup==="function"}function d(Y){return Y!==null&&typeof Y==="object"&&typeof Y.default&&typeof Y.default==="string"}function J0(Y){const j=Y.attr(":args"),S=D("log");if(!j)return;const L=w();if(W.__evaluate__(`console.log(${j})`,L),W.__isReactive__(j,L))W.__extractExpressionDeps__(j,L).forEach((g)=>W.__trackDep__(z,g,L,{nodetype:"log",nodepath:S,target:"argument",$fragment:null,update:(N)=>W.__evaluate__(`console.log(${j})`,N),syntax:!0}))}function a(Y){const j=D("var"),{attrs:S}=W.__getAttributes__(Y);if(!S)return;Object.entries(S.literals).forEach(([L,F])=>{if(X[L]&&X[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);X[L]={value:F,type:"let"}}),Object.entries(S.expressions).forEach(([L,F])=>{if(X[L]&&X[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);if(X[L]={value:W.__evaluate__(F,X),type:"let"},W.__isReactive__(F,X)){const g=W.__extractExpressionDeps__(F,X),N=(P,m)=>{if(P[L]&&P[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);if(S.map.beforeSpreadAttrs.includes(L))return;const h=W.__evaluate__(F,P);if(K0(P[L].value,h))return;return P[L]={value:h,type:"let"},W.__updateVarDepNodes__(L,j,P),C1({memo:P})};g.forEach((P)=>W.__trackDep__(z,P,w(),{nodetype:"let",nodepath:j,deppath:`${j}.${L}`,target:"attr",$fragment:null,update:N,syntax:!0}))}}),W.metrics.inc("elementCount")}function q0(Y){const{attrs:j}=W.__getAttributes__(Y);if(!j)return;Object.entries(j.literals).forEach(([S,L])=>{if(X[S]&&X[S].type==="const")throw new Error(`<const ${S}=[value]/> variable already defined`);if(!L)return;X[S]={value:L,type:"const"}}),Object.entries(j.expressions).forEach(([S,L])=>{if(X[S]&&X[S].type==="const")throw new Error(`<const ${S}=[value]/> variable already defined`);if(!L)return;X[S]={value:W.__evaluate__(L,X),type:"const"}}),W.metrics.inc("elementCount")}function n(Y,j,S){const{attrs:L}=W.__getAttributes__(Y),F=D("element"),g=W.__getBoundaries__(F),N={};let P=w(),m=W0.default(g.start),h;const s=(k)=>{const _={},b={};return L.literals&&Object.entries(L.literals).forEach(([C,R])=>{b[C]=R,_[C]={type:"arg",value:R}}),L.expressions&&Object.entries(L.expressions).forEach(([C,R])=>{if(!h)return;if(M0.test(C))W.__evaluateSpreadAttr__(C,{memo:k,get keystore(){return N[C]},set keystore(I){if(!N[C])N[C]=[];N[C]=I},each:(I,A)=>{if(b[I]=A,!h?.argv.includes(I))return;_[I]={type:"arg",value:A}}});else{const I=R?W.__evaluate__(R,k):!0;if(b[C]=I,!h.argv.includes(C))return;_[C]={type:"arg",value:I}}}),L.expressions&&Object.entries(L.expressions).forEach(([C,R])=>{if(!h)return;if(M0.test(C)&&W.__isReactive__(C,k)){const I=W.__extractExpressionDeps__(C,k),A=(T,E)=>{if(!h)return;const f={};let u=[];if(W.__evaluateSpreadAttr__(C,{memo:T,get keystore(){return N[C]},set keystore(c){if(!N[C])N[C]=[];N[C]=c},each:(c,Q0)=>{if(L.map.afterSpreadAttrs.includes(c))return;if(!h?.argv.includes(c))return;if(K0(Q0,T[c]?.value))return;_[c]=f[c]={value:Q0,type:"arg"},b[c]=Q0,u.push(c)},nullify:(c)=>{c.forEach((Q0)=>{f[Q0]={value:void 0,type:"arg"},delete b[Q0]}),u=c}}),u.length)h.argv.length&&W.__updateArgumentsDepNodes__(F,b),h.update(u,f,T,g)};I.forEach((T)=>W.__trackDep__(z,T,k,{nodetype:"dynamic",nodepath:F,deppath:`${F}.${C}`,target:"spread-attr",$fragment:null,boundaries:g,update:A}))}else if(h.argv.includes(C)&&W.__isReactive__(R,k)){const I=W.__extractExpressionDeps__(R,k),A=(T,E)=>{if(!h)return;if(L.map.beforeSpreadAttrs.includes(C))return;const f=R?W.__evaluate__(R,T):!0,u={type:"arg",value:f};if(_[C]=u,h.argv.length)b[C]=f,W.__updateArgumentsDepNodes__(F,b);h.update([C],{[C]:u},T,g)};I.forEach((T)=>W.__trackDep__(z,T,k,{nodetype:"dynamic",nodepath:F,deppath:`${F}.${C}`,target:"attr",$fragment:null,boundaries:g,update:A}))}}),{argvalues:_,__arguments__:b}};if(x(S)){h=S;const{argvalues:k,__arguments__:_}=s(P);P.__arguments__=_;const b=h.mesh(k);if(b&&b.length)m=m.add(b)}else if(typeof S==="string")if(W.__macros.has(S))m=m.add(i(Y,S));else if(W.lips.has(S))m=m.add(v(Y,{name:S}));else m=m.add(o(Y,S));if(W.__isReactive__(j,P)){const k=(b,C)=>{const R=W.__evaluate__(j,b);let I;if(h)h.cleanup(g),h=null;else W.__emptyBoundaries__(g,F);if(x(R)){h=R;const{argvalues:A,__arguments__:T}=s(b);h.argv.length&&W.__updateArgumentsDepNodes__(F,T),I=h.mesh(A,b),I?.length&&h.fill(I,g)}else if(d(R))I=v(Y,{template:R},b),W.__fillBoundaries__(I,g);else if(typeof R==="string"&&W.__macros.has(R))I=i(Y,R,b),W.__fillBoundaries__(I,g);else if(typeof R==="string"&&W.lips.has(R))I=v(Y,{name:R},b),W.__fillBoundaries__(I,g);else if(typeof R==="string")I=o(Y,R,b),W.__fillBoundaries__(I,g)};W.__extractExpressionDeps__(j,P).forEach((b)=>W.__trackDep__(z,b,P,{nodetype:"dynamic",nodepath:F,deppath:`${F}.dtag`,target:"dtag",$fragment:null,boundaries:g,update:k}))}return m=m.add(g.end),m}function v(Y,j,S){let L,F;if(j?.template)L=j.template,F=O("component",L.declaration?.syntax);else{if(F=j?.name||Y.attr(x0)||Y.prop("tagName")?.toLowerCase(),!F)throw new Error("Invalid component");if(F===W.__name__)throw new Error("Render component within itself is forbidden");L=W.lips.import(F)}if(!L||!F)throw new Error(`<${F}> template not found`);const g=D("component",L.declaration?.syntax),N=`${g}#${F}`,P=W.__getBoundaries__(g),{argv:m,functions:h,attrs:s,events:k}=W.__getAttributes__(Y),_={},b={};let C={},R=W0.default(P.start),I=W.PCC.get(N),A=S||w();s.literals&&Object.entries(s.literals).forEach(([E,f])=>{if(E=="key")return;C[E]=f}),h&&Object.entries(h).forEach(([E,f])=>{C[E]=W.__evaluateFunction__(f,[],A),L.declaration?.syntax?_[P0+V0+E]=f:_[V0+E]=f}),s.expressions&&Object.entries(s.expressions).forEach(([E,f])=>{if(E=="key")return;if(M0.test(E))W.__evaluateSpreadAttr__(E,{memo:A,get keystore(){return b[E]},set keystore(u){if(!b[E])b[E]=[];b[E]=u},each:(u,c)=>C[u]=c});else C[E]=f?W.__evaluate__(f,A):!0;L.declaration?.syntax?_[P0+E]=f:_[E]=f});const T=Y.contents();if(T.length){if(C={...C,...W.__meshwire__({$node:Y,fragmentPath:g,fragmentBoundaries:P,meshPath:null,scope:A,argv:m,xmlns:q,useAttributes:!0,declaration:L.declaration},_)},L.declaration){if(L.declaration.tags){let E;Object.entries(L.declaration?.tags).forEach(([f,{type:u,many:c,alts:Q0}])=>{switch(u){case"nexted":{let t=Y.next(f);if(!t.length&&Array.isArray(Q0)&&E?.length&&E.is(Q0.join(",")))t=E.next(f);if(!t.length)return;if(c){C[f]=[];let e=0,G0=!1;while(!G0){if(C[f].push(W.__meshwire__({$node:t,meshPath:`${f}[${e}]`,fragmentPath:g,fragmentBoundaries:P,scope:A,argv:m,xmlns:q,useAttributes:!0,declaration:L.declaration},_)),!t.next(f).length){G0=!0;break}t=E=t.next(f),e++}}else C[f]=W.__meshwire__({$node:t,meshPath:f,fragmentPath:g,fragmentBoundaries:P,scope:A,argv:m,xmlns:q,useAttributes:!0,declaration:L.declaration},_)}break;case"child":{const t=Y.children(f);if(c)C[f]=[],t.each(function(e){const G0=W0.default(this),{argv:I0}=W.__getAttributes__(G0);C[f].push(W.__meshwire__({$node:G0,meshPath:`${f}[${e}]`,fragmentPath:g,fragmentBoundaries:P,scope:A,argv:I0,xmlns:q,useAttributes:!0,declaration:L.declaration},_))});else if(Y.children(f).first().length){const e=Y.children(f).first(),{argv:G0}=W.__getAttributes__(e);C[f]=W.__meshwire__({$node:e,meshPath:f,fragmentPath:g,fragmentBoundaries:P,scope:A,argv:G0,xmlns:q,useAttributes:!0,declaration:L.declaration},_)}}break}})}else if(L.declaration.contents)C.__contents__=T}}if(I)I.setInput(X0(C)),R=R.add(I.node);else{const{declaration:E,state:f,_static:u,handler:c,context:Q0,default:t,stylesheet:e}=L;I=new y0(F,t||"",{state:X0(f),input:X0(C),context:Q0,_static:X0(u),handler:c,stylesheet:e,declaration:E},{debug:W.debug,lips:W.lips,prepath:g,boundaries:P}),R=R.add(I.node),!L.declaration?.syntax&&W.PCC.set(N,I)}return R=R.add(P.end),Object.entries(k).forEach(([E,f])=>{W.__attachEvent__({nodepath:g,element:I,_event:E,instruction:f,scope:A,get __dependencies__(){return z}})}),_&&Object.entries(_).forEach(([E,f])=>{let u=!1,c=!1;if(E.startsWith(P0))u=!0,E=E.replace(P0,"");if(E.startsWith(V0))c=!0,E=E.replace(V0,"");if(M0.test(E)){if(W.__isReactive__(E,A)){const Q0=(e)=>{const G0={};W.__evaluateSpreadAttr__(E,{memo:e,get keystore(){return b[E]},set keystore(I0){if(!b[E])b[E]=[];b[E]=I0},each:(I0,T0)=>{if(s.map.afterSpreadAttrs.includes(I0))return;G0[I0]=T0},nullify:(I0)=>I0.forEach((T0)=>G0[T0]=void 0)}),I?.subInput(G0,e)};W.__extractExpressionDeps__(E,A).forEach((e)=>W.__trackDep__(z,e,A,{nodetype:"component",nodepath:g,deppath:`${g}.${E}`,target:"spread-attr",$fragment:null,boundaries:P,update:Q0,syntax:u}))}}else if(W.__isReactive__(f,A)){const Q0=(e)=>{if(s.map.beforeSpreadAttrs.includes(E))return;const G0=c?W.__evaluateFunction__(f,[],e):f?W.__evaluate__(f,e):!0;I?.subInput({[E]:G0},e)};W.__extractExpressionDeps__(f,A).forEach((e)=>W.__trackDep__(z,e,A,{nodetype:"component",nodepath:g,deppath:`${g}.${E}`,target:"attr",$fragment:null,boundaries:P,update:Q0,syntax:u}))}}),W.metrics.inc("componentCount"),R}function i(Y,j,S){if(j=j||Y.attr(x0),!j)throw new Error("Invalid macro rendering call");const L=W.__macros.get(j);if(!L)throw new Error("Macro component not found");const F=D("macro"),g=W.__getBoundaries__(F),{attrs:N}=W.__getAttributes__(Y),P={},m=S||w(),h={},s={};N.literals&&Object.entries(N.literals).forEach(([I,A])=>{h[I]=A,s[I]={value:A,type:"arg"}});const k={};N.expressions&&Object.entries(N.expressions).forEach(([I,A])=>{if(M0.test(I))W.__evaluateSpreadAttr__(I,{memo:m,get keystore(){return k[I]},set keystore(T){if(!k[I])k[I]=[];k[I]=T},each:(T,E)=>{if(h[T]=E,L.argv.includes(T))s[T]={value:E,type:"arg"}}}),P[I]=A;else{const T=A?W.__evaluate__(A,m):!0;if(h[I]=T,L.argv.includes(I))s[I]={value:T,type:"arg"},P[I]=A}L.argv.forEach((T)=>{if(s[T]!==void 0)return;s[T]={value:!1,type:"arg"}})}),s.__arguments__=h;let _=W0.default(g.start);const b={$node:L.$node,meshPath:null,fragmentPath:F,fragmentBoundaries:g,argv:L.argv,scope:m,xmlns:q,useAttributes:!0},C=W.__meshwire__(b,P),R=C.renderer.mesh(s,m);return _=_.add(R),P&&Object.entries(P).forEach(([I,A])=>{let T=!1;if(new RegExp(`^${P0}`).test(I))T=!0,I=I.replace(P0,"");if(M0.test(I)){if(!W.__isReactive__(I,m))return;const E=W.__extractExpressionDeps__(I,m),f=(u)=>{const c={};let Q0=[];if(W.__evaluateSpreadAttr__(I,{memo:u,get keystore(){return k[I]},set keystore(t){if(!k[I])k[I]=[];k[I]=t},each:(t,e)=>{if(N.map.afterSpreadAttrs.includes(t))return;if(K0(e,u[t]?.value))return;c[t]={value:e,type:"arg"},h[t]=e,Q0.push(t)},nullify:(t)=>{t.forEach((e)=>{c[e]={value:void 0,type:"arg"},delete h[e]}),Q0=t}}),Q0.length)W.__updateArgumentsDepNodes__(F,h),C.renderer.update(Q0,c,u);return C1({memo:{...u,...c}})};E.forEach((u)=>W.__trackDep__(z,u,{...m,...s},{nodetype:"macro",nodepath:F,deppath:`${F}.${I}`,target:"spread-attr",$fragment:null,boundaries:g,update:f,syntax:T}))}else if(W.__isReactive__(A,m)){const E=W.__extractExpressionDeps__(A,m),f=(u)=>{if(N.map.beforeSpreadAttrs.includes(I))return;const c=A?W.__evaluate__(A,u):!0;return h[I]=c,W.__updateArgumentsDepNodes__(F,h),C.renderer.update([I],{[I]:{value:c,type:"arg"}},u),C1({memo:u})};E.forEach((u)=>W.__trackDep__(z,u,{...m,...s},{nodetype:"macro",nodepath:F,deppath:`${F}.${I}`,target:"attr",$fragment:null,boundaries:g,update:f,syntax:T}))}}),_=_.add(g.end),W.metrics.inc("elementCount"),_}function o(Y,j,S){if(!Y.length||!Y.prop("tagName")&&!j)return Y;j=j||Y.prop("tagName").toLowerCase();const L=Y.is("svg")||q,F=L?W0.default(document.createElementNS("http://www.w3.org/2000/svg",j)):W0.default(`<${j}/>`),g=Y.contents(),N=D("element"),P=S||w();g.length&&F.append(W.__withPath__(N,()=>W.render(N+Y5,g,P,z,L).$log));const{attrs:m,events:h}=W.__getAttributes__(Y);m.literals&&Object.entries(m.literals).forEach(([k,_])=>{if(k===g0)return;const b=Y.is(`[${g0}]`)&&["title","placeholder"].includes(k);F.attr(k,b?W.lips.i18n.translate(_).text:_);const C=(R)=>{F.attr(k,b?W.lips.i18n.translate(_).text:_),b&&W.__trackTranslationDep__(R,{nodetype:"element",nodepath:N,deppath:`${N}.${k}`,target:"attr",$fragment:F,update:C})};b&&W.__trackTranslationDep__(P,{nodetype:"element",nodepath:N,deppath:`${N}.${k}`,target:"attr",$fragment:F,update:C})});const s=(k,_=!1)=>{k&&Object.entries(k).forEach(([b,C])=>{switch(b){case"@html":{const R=(I)=>{F.html(W.__evaluate__(C,I))};if(R(P),_&&W.__isReactive__(C,P))W.__extractExpressionDeps__(C,P).forEach((A)=>W.__trackDep__(z,A,P,{nodetype:"element",nodepath:N,deppath:`${N}.${b}`,target:"meta-attr",$fragment:F,update:R}))}break;case"@text":{const R=Y.is(`[${g0}]`),I=(A)=>{F.text(W.__evaluate__(C,A,{translate:R})),R&&W.__trackTranslationDep__(A,{nodetype:"element",nodepath:N,deppath:`${N}.${b}`,target:"meta-attr",$fragment:F,update:I})};if(I(P),_&&W.__isReactive__(C,P))W.__extractExpressionDeps__(C,P).forEach((T)=>W.__trackDep__(z,T,P,{nodetype:"element",nodepath:N,deppath:`${N}.${b}`,target:"meta-attr",$fragment:F,update:I}));R&&W.__trackTranslationDep__(P,{nodetype:"element",nodepath:N,deppath:`${N}.${b}`,target:"meta-attr",$fragment:F,update:I})}break;case"@format":{const[R,I]=C.split(",").map((T)=>T.trim());if(!R)throw new Error("Invalid @format reference");if(!I)throw new Error("Invalid @format parameters");const A=(T)=>{const E=W.__evaluate__(`!${I.trim()}`,T);if(typeof E!=="object")throw new Error("Invalid @format parameters");const f=W.lips.i18n.format(R,E);f!==void 0&&F.text(f),W.__trackTranslationDep__(T,{nodetype:"element",nodepath:N,deppath:`${N}.${b}`,target:"meta-attr",$fragment:F,update:A})};A(P),W.__extractExpressionDeps__(I,P).forEach((T)=>W.__trackDep__(z,T,P,{nodetype:"element",nodepath:N,deppath:`${N}.${b}`,target:"meta-attr",$fragment:F,update:A}))}break;case"style":if(_&&W.__isReactive__(C,P)){const R=(A)=>{const T=W.__evaluate__(C,A);if(typeof T==="object"){let E="";Object.entries(T).forEach(([f,u])=>E+=`${f}:${u};`),E.length&&F.attr("style",E)}else F.attr("style",T)};R(P),W.__extractExpressionDeps__(C,P).forEach((A)=>W.__trackDep__(z,A,P,{nodetype:"element",nodepath:N,deppath:`${N}.${b}`,target:"attr",$fragment:F,update:R}))}else F.attr("style",C);break;default:{const R=Y.is(`[${g0}]`)&&["title","placeholder"].includes(b),I=(A)=>{const T=C&&W.__isReactive__(C,P)?W.__evaluate__(C,A,{translate:R}):C!==void 0?C:!0;if(T===void 0||T===!1)F.removeAttr(b);else F.attr(b,T),R&&W.__trackTranslationDep__(A,{nodetype:"element",nodepath:N,deppath:`${N}.${b}`,target:"attr",$fragment:F,update:I})};if(I(P),_&&W.__isReactive__(C,P))W.__extractExpressionDeps__(C,P).forEach((T)=>W.__trackDep__(z,T,P,{nodetype:"element",nodepath:N,deppath:`${N}.${b}`,target:"attr",$fragment:F,update:I}));R&&W.__trackTranslationDep__(P,{nodetype:"element",nodepath:N,deppath:`${N}.${b}`,target:"attr",$fragment:F,update:I})}}})};return m.expressions&&Object.keys(m.expressions).forEach((k)=>{if(!M0.test(k))return;let _=[];const b=(C,R,I=!1)=>{const A={};W.__evaluateSpreadAttr__(k,{memo:C,get keystore(){return _},set keystore(T){_=T},each:(T,E)=>{if(!I&&m.map.afterSpreadAttrs.includes(T))return;A[T]=E},nullify:(T)=>T.forEach((E)=>F.removeAttr(E))}),Object.keys(A).length&&s(A)};if(delete m.expressions[k],b(P,"",!0),k&&W.__isReactive__(k,P))W.__extractExpressionDeps__(k,P).forEach((R)=>W.__trackDep__(z,R,P,{nodetype:"element",nodepath:N,deppath:`${N}.${k}`,target:"spread-attr",$fragment:F,update:b}))}),s(m.expressions,!0),h&&Object.entries(h).forEach(([k,_])=>{K.push({nodepath:N,element:F,_event:k,instruction:_,scope:P,get __dependencies__(){return z}})}),W.metrics.inc("elementCount"),W.metrics.inc("domInsertsCount"),F}function r(Y){const j=Y.text(),S=w(),L=D("element"),F=Y.parent().is(`[${g0}]`),g=W0.default(document.createTextNode(W.__interpolate__(j,S,F))),N=(P)=>{const m=W.__interpolate__(j,P,F);if(!g[0])return;g[0].textContent=m,F&&W.__trackTranslationDep__(P,{nodetype:"text",nodepath:L,target:"value",$fragment:g,update:N})};if(j&&W.__isReactive__(j,S))W.__extractTextDeps__(j,S).forEach((m)=>W.__trackDep__(z,m,S,{nodetype:"text",nodepath:L,deppath:`${L}.${m}`,target:"value",$fragment:g,update:N}));return F&&W.__trackTranslationDep__(S,{nodetype:"text",nodepath:L,target:"value",$fragment:g,update:N}),W.metrics.inc("elementCount"),W.metrics.inc("domInsertsCount"),g}function Z0(Y){if(!Y.attr(k0)||Y.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const j=Y.attr(k0),S=W.__evaluate__(j,X);if(d(S))return v(Y,{template:S});else return n(Y,j,S)}function p(Y){if(Y.get(0)?.nodeType===Node.COMMENT_NODE)return Y;if(Y.get(0)?.nodeType===Node.TEXT_NODE)return r(Y);if(Y.is("let"))return a(Y);else if(Y.is("const"))return q0(Y);else if(Y.is("lips")&&Y.attr(k0))return Z0(Y);else if(Y.is("log"))return J0(Y);else if(W.__macros.has(Y.attr(x0)))return i(Y);else if(Y.is(Q1.join(","))||W.lips.has(Y.attr(x0)))return v(Y);else if(Y.is("else-if, else"))return;return o(Y)}try{this.__renderDepth__++,Z=!Z&&W0.default(this.__template__).length>1?W0.default("<template>").html(this.__template__).contents():Z||W0.default(this.__template__),Z.each(function(){const Y=p(W0.default(this));if(Y)U=U.add(Y)}),K.forEach(this.__attachEvent__.bind(this)),W.metrics.inc("renderCount")}catch(Y){console.error("Rendering Failed --",Y),W.metrics.trackError(Y)}finally{if(this.__renderDepth__--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth__===0)this.__inpath__="",this.__inpathCounter__=0}return{$log:U,dependencies:z,events:K}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(this.__detachEvent__.bind(this)),this.VER=[];for(let J in this.PCC){const Z=this.PCC.get(J);Z?.destroy(),Z?.delete(J)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.FGUDMemory?.clear(),this.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Z)=>{W0.default(Z).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy")}__meshwire__(J,Z){const X=this,{$node:H,meshPath:q,fragmentPath:W,fragmentBoundaries:z,argv:K,xmlns:U,declaration:w,useAttributes:D}=J;let O;const x=new Map,d=W+v1,J0=(v,i,o)=>{if(O=H.contents(),!O?.length)return null;i=i||J.scope;const r=d+(o||""),{$log:Z0,dependencies:p,events:Y}=X.__withPath__(r,()=>{return X.render(r,O,{...i,...v},void 0,U)}),j=o||l0;return!x.has(j)&&x.set(j,new Set),x.get(j)?.add(r),p?.forEach((S,L)=>{!X.FGUD?.has(L)&&X.FGUD.set(L,new Map),S.forEach((F,g)=>{if(F.garbage)return;F.partial?.length?F.partial.push(r):F.partial=[r],X.FGUD.get(L)?.set(g,F)})}),X.metrics.inc("partialCount"),Z0},a=(v,i,o,r,Z0)=>{if(!x.get(Z0||l0)?.size)return;o=o||J.scope,r=r||z,X.metrics.startRender();const p=Array.from(x.get(Z0||l0)||[]);v.forEach((Y)=>{const j=X.FGUD.get(Y);if(!j)return;j.forEach((S)=>{const L=p.find((N)=>{return S.partial?.find((P)=>N==P||X.__hasSamePathParent__(P,N))});if(!S.partial||!L)return;const F=S.deppath||S.nodepath,g=this.FGUDMemory.get(S.nodepath);if(S.garbage||r?.start&&!document.contains(r.start)){j.delete(F),X.__unbindMemo__(S);return}if(!g){console.warn(`unexpected occurence: <${F}> has no memo`);return}if(g.memo?.[Y]&&i?.[Y]&&!K0(g.memo[Y],i[Y]))g.memo={...o,...g.memo,...i};X.UQS.queue({dep:Y,deppath:F,priority:S.priority}),X.metrics.inc("dependencyUpdateCount")}),!j.size&&X.FGUD.delete(Y)}),X.metrics.inc("partialUpdateCount"),X.metrics.endRender()},q0=(v,i)=>{if(x.delete(typeof i==="string"&&i||l0),v=v||z,X.__emptyBoundaries__(v,d+(i||"")),i)v.start.remove(),v.end.remove()},n={renderer:{path:q,argv:K,mesh:J0,update:a,cleanup:q0,fill(v,i){X.__fillBoundaries__(v,i||z)},demarcate(v,i){const o=X.__getBoundaries__(d+(i||""));let r=W0.default(o.start);return r=r.add(v),r=r.add(o.end),{$partial:r,boundaries:o}}}};if(D&&q){const{attrs:v}=X.__getAttributes__(H);v.literals&&Object.entries(v.literals).forEach(([i,o])=>n[i]=o),v.expressions&&Object.entries(v.expressions).forEach(([i,o])=>{if(M0.test(i)){let r=[];X.__evaluateSpreadAttr__(i,{memo:J.scope,get keystore(){return r},set keystore(Z0){r=Z0},each:(Z0,p)=>n[Z0]=p}),Z[`${w?.syntax?P0:""}${q}.${i}`]=o}else n[i]=o?X.__evaluate__(o,J.scope):!0,Z[`${w?.syntax?P0:""}${q}.${i}`]=o})}return n}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${J}`),end:document.createComment(`e:${J}`)}}__emptyBoundaries__(J,Z){this.FGUD.forEach((q,W)=>{q.forEach((z,K)=>{if(!this.__hasSamePathParent__(K,Z))return;this.__unbindMemo__(z),z.garbage=!0}),!q.size&&this.FGUD.delete(W)});const X=[];let H=J.start.nextSibling;while(H&&H!==J.end)X.push(H),H=H.nextSibling;W0.default(X).remove()}__fillBoundaries__(J,Z){if(!document.contains(Z.start)||!document.contains(Z.end)){console.warn("Dynamic element boundaries not found");return}J.length&&W0.default(Z.start).after(J)}__getAttributes__(J){const Z=J.attrs(),X={},H={},q={literals:{},expressions:{},map:{explicitAttrs:[],spreadAttrs:[],beforeSpreadAttrs:[],afterSpreadAttrs:[],metaAttrs:[]}},W=Object.keys(Z).find((U)=>M0.test(U));let z=[],K=!1;return Z&&Object.entries(Z).forEach(([U,w])=>{if([x0,k0].includes(U))return;if(U.startsWith(":")||U.startsWith(V0)||U.startsWith(h0)||M0.test(U)||Z1.test(U))if(Z1.test(U)){const[D,O]=U.match(Z1)||[];z=O.split(",")}else if(U.startsWith(h0))X[U.replace(h0,"")]=w;else if(U.startsWith(V0))H[U.replace(V0,"")]=w;else{if(U.startsWith(":"))U=U.slice(1,U.length);if(W)if(M0.test(U))q.map.spreadAttrs.push(U),K=!0;else q.map.explicitAttrs.push(U),!K?q.map.beforeSpreadAttrs.push(U):q.map.afterSpreadAttrs.push(U);q.expressions[U]=w||""}else if(q.literals[U]=w,W)q.map.explicitAttrs.push(U),!K?q.map.beforeSpreadAttrs.push(U):q.map.afterSpreadAttrs.push(U)}),{argv:z,events:X,functions:H,attrs:q}}__withPath__(J,Z){const X=this.__inpath__;this.__inpath__=J;const H=Z();return this.__inpath__=X,H}__getPathParent__(J){const Z=J.split("/");if(Z.length>1)Z.pop();return Z.join("/")}__hasSamePathParent__(J,Z){return J.startsWith(Z)&&!J.replace(Z,"").startsWith(".")||J.startsWith(`${Z+v1}`)}__evaluate__(J,Z,X){J=typeof J==="string"?J.trim():J;try{const H=(q)=>{const W=this.state.toJSON(),z=(U,...w)=>{try{return U(...w)}catch(D){!X?.mute&&console.error("Eval error --",D);return}};let K=`return ${q};`;if(Z){let U={},w;for(let O in Z){if(O==="__arguments__")continue;U[O]=Z[O].value}if(typeof Z.__arguments__==="object")w=Z.__arguments__;K=`with( scope ){ ${K} }`;const D=new Function("self","input","state","static","context","scope","arguments",K);return z(D,this,this.input,W,this.static,this.context,U||{},w)}else{const U=new Function("self","input","state","static","context",K);return z(U,this,this.input,W,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return H(J.slice(1));return J.replace(y1,(q,W)=>H(W))}return H(J)}catch(H){!X?.mute&&console.error("Expression evaluation error --",H);return}}__evaluateFunction__(J,Z,X){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,X)(...Z);else{let[H,...q]=J.split(/\s*,\s*/),W;const z=this.__evaluate__(H,X,{mute:!0});if(typeof z==="function")W=z;else{if(typeof this[H]!=="function")throw new Error(`Undefined <${H}> handler method`);W=this[H].bind(this)}if(typeof W!=="function")throw new Error(`Expected <${H}> to be a function or handler method`);let K=q.map((U)=>this.__evaluate__(U,X));if(Z.length)K=[...K,...Z];return W(...K)}}__evaluateSpreadAttr__(J,Z){const X=this.__evaluate__(J.replace(M0,""),Z.memo);if(!X){if(!Z.keystore.length)throw new Error(`Undefined spread operator ${J}`);typeof Z.nullify==="function"&&Z.nullify(Z.keystore);return}if(typeof X!=="object"||Array.isArray(X))throw new Error(`Invalid spread operator ${J}`);if(Z.keystore=Object.keys(X)||[],typeof Z.each==="function")for(let H in X)Z.each(H,X[H])}__interpolate__(J,Z,X){if(J=J.replace(y1,(H,q)=>this.__evaluate__(q,Z)),X)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J){const{element:Z,nodepath:X,_event:H,instruction:q,scope:W,__dependencies__:z}=J;let K=W;if(Z.on(H,(...U)=>this.__evaluateFunction__(q,U,K)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(q,W))this.__extractExpressionDeps__(q,W).forEach((w)=>this.__trackDep__(z,w,W||{},{nodetype:"event",nodepath:X,deppath:`${X}.${H}`,target:"event-handler",$fragment:!(Z instanceof y0)?Z:null,boundaries:Z instanceof y0?Z.__boundaries__:void 0,update:(D)=>{K=D}}))}__detachEvent__({element:J,nodepath:Z,_event:X,instruction:H,scope:q,__dependencies__:W}){if(J.off(X),this.__isReactive__(H,q)){const z=this.__extractExpressionDeps__(H,q),K=`${Z}.${X}`;z.forEach((U)=>{W.get(U)?.delete(K),this.FGUD.get(U)?.delete(K)})}this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const X=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const W=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(W,Z).forEach((K)=>X.add(K))}),Array.from(X)}__extractExpressionDeps__(J,Z){const X=/\b(state|input|context|arguments)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,H=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g,q=/\b(arguments)((?:\.[a-zA-Z_]\w*)+)?(?=\[|\.|$|\s|;|,|\))/g;let W=[...Array.from(J.matchAll(X)),...Array.from(J.matchAll(H)),...Array.from(J.matchAll(q))];if(Z&&Object.keys(Z).length){const z=new RegExp(`\\b(?<!\\.)(${Object.keys(Z).join("|")})`,"g"),K=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");W=[...W,...Array.from(J.matchAll(z)),...Array.from(J.matchAll(K))]}return[...new Set(W.map((z)=>z[0]))]}__isReactive__(J,Z){if(/(self|state|input|context|arguments)(\.[\w.]+)?/.test(J))return!0;if(Z&&Object.keys(Z).length&&new RegExp(Object.keys(Z).join("|")).test(J))return!0;return!1}__bindMemo__(J,Z){const X=Z.deppath||Z.nodepath,H=this.FGUDMemory.get(Z.nodepath);if(H)H.tracks.set(X,Z.priority||2),H.memo=J,this.FGUDMemory.set(Z.nodepath,H);else{const q=new Map;q.set(X,Z.priority),this.FGUDMemory.set(Z.nodepath,{tracks:q,memo:J})}}__unbindMemo__(J){const Z=J.deppath||J.nodepath,X=this.FGUDMemory.get(J.nodepath);if(!X||!X.tracks.get(Z))return;X.tracks.delete(Z),!X.tracks.size&&this.FGUDMemory.delete(J.nodepath)}__trackDep__(J,Z,X,H){if(X&&X[Z]&&X[Z].type==="let")H.haslet=!0;if(H.priority===void 0)if(H.target==="attr"&&Z.split(".").find((W)=>w5.includes(W)))H.priority=0;else if(H.syntax)H.priority=1;else if(["event"].includes(H.nodetype))H.priority=3;else H.priority=2;const q=H.deppath||H.nodepath;H.level=q.split(/\//g).length,H.priority=H.level*M5+H.priority,!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(q,H),this.__bindMemo__(X,H),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J,Z){this.__i18nDeps.set(Z.deppath||Z.nodepath,Z),this.__bindMemo__(J,Z),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Z){return Z.reduce((X,H)=>X?.[H],J)}__shouldUpdate__(J,Z){if(J==="self")return!0;const X={state:this.state,input:this.input,context:this.context},H=this.__valueDep__(this.__previous[J],Z),q=this.__valueDep__(X[J],Z);return!K0(H,q)}__updateDepNodes__(){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((J,Z)=>{const[X,...H]=Z.split(".");if(!this.__shouldUpdate__(X,H))return;J.forEach((q)=>{try{const W=q.deppath||q.nodepath;if(q.garbage||q.boundaries?.start&&!document.contains(q.boundaries.start)||q.$fragment!==null&&!q.$fragment.closest("body").length){J.delete(W),this.__unbindMemo__(q);return}this.UQS.queue({dep:Z,deppath:W,priority:q.priority}),this.metrics.inc("dependencyUpdateCount")}catch(W){console.error("failed to update dependency nodes --",W);return}}),!J.size&&this.FGUD?.delete(Z)}),this.metrics.endRender()}__updateVarDepNodes__(J,Z,X){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((H,q)=>{if(!H.haslet||!this.__hasSamePathParent__(q,this.__getPathParent__(Z)))return;const W=H.deppath||H.nodepath,z=this.FGUDMemory.get(H.nodepath);if(!z){console.warn(`unexpected occurence: <${W}> has no memo`);return}z.memo={...z.memo,...X},this.UQS.queue({dep:J,deppath:W,priority:H.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateArgumentsDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender();const X="arguments";this.FGUD.get(X)?.forEach((H,q)=>{if(!this.__hasSamePathParent__(q,J))return;const W=H.deppath||H.nodepath,z=this.FGUDMemory.get(H.nodepath);if(!z){console.warn(`unexpected occurence: <${W}> has no memo`);return}z.memo.__arguments__=Z,this.UQS.queue({dep:X,deppath:W,priority:H.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Z)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Z);return}const X=this.FGUDMemory.get(J.nodepath);if(!X){console.warn(`unexpected occurence: <${J.deppath||J.nodepath}> has no memo`);return}J.update(X.memo,"i18n-partial-updator"),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?W0.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?W0.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?W0.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var c1={};s0(c1,{handler:()=>{{return $8}},declaration:()=>{{return P8}},_static:()=>{{return E8}}});var P8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},E8={initialized:!1,prevRenderer:null},$8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,X=!1){if(!J.renderer)return;if(J.by){this.static.prevRenderer?.cleanup();const H=J.renderer.mesh({},Z);if(this.static.prevRenderer=J.renderer,!H?.length)return;if(X)return H;J.renderer.fill(H)}else{this.static.prevRenderer?.cleanup();let H=!1,q;if(Array.isArray(J["else-if"])&&J["else-if"].length)for(let W of J["else-if"]){if(!W.by)continue;if(q=W.renderer.mesh({},Z),this.static.prevRenderer=W.renderer,!q?.length)return;if(X)return q;q?.length&&W.renderer.fill(q),H=!0;break}if(!H&&J.else){const W=J.else.renderer.mesh({},Z);if(this.static.prevRenderer=J.else.renderer,!W?.length)return;if(X)return W;J.else.renderer.fill(W)}}}};var p1={};s0(p1,{handler:()=>{{return A8}},declaration:()=>{{return S8}},_static:()=>{{return T8}}});var N0=J1(o0(),1);var S8={name:"for",syntax:!0},T8={lastIn:null,argvlist:null,initialized:!1,prevRenderer:null,processingBatch:!1},A8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,X=!1){if(this.static.processingBatch)return;if(!J.renderer)throw new Error("Undefined mesh renderer");let{in:H,from:q,to:W}=J;if(H===void 0&&q===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(q!==void 0)return this.asFromTo(J.renderer,q,W,Z,X);else if(Array.isArray(H))return this.asArray(J.renderer,H,Z,X);else if(H instanceof Map)return this.asMap(J.renderer,H,Z,X);else if(typeof H=="object")return this.asObject(J.renderer,H,Z,X)}finally{this.static.processingBatch=!1}},addItem(J,Z,X,H){if(!this.static.argvlist)this.static.argvlist=[];const q=`[${H}]`,W=J.mesh(X,Z,q);if(!W)return;const{boundaries:z,$partial:K}=J.demarcate(W,q);return this.static.prevRenderer=J,this.static.argvlist.push({argvalues:X,boundaries:z}),K},updateItem(J,Z,X,H){if(!this.static.argvlist?.[H])return;this.static.argvlist[H].argvalues=X,J.update(Object.keys(X),X,Z,this.static.argvlist[H].boundaries,`[${H}]`)},removeItem(J,Z){if(!this.static.argvlist?.[Z])return;J.cleanup(this.static.argvlist[Z].boundaries,`[${Z}]`),this.static.argvlist.splice(Z,1)},asFromTo(J,Z,X,H,q){if(Z=parseFloat(String(Z)),X==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");X=parseFloat(String(X));const W=Z<X,z=Math.abs(X-Z)+1;if(Array.isArray(this.static.argvlist)){const[U]=J.argv;if(U){let w=Z;if(this.static.argvlist.length===z){for(let O=0;O<this.static.argvlist.length;O++)this.static.argvlist[O].argvalues[U].value!==w&&this.updateItem(J,H,{[U]:{value:w,type:"arg"}},O),w=W?w+1:w-1;return}const D=Math.min(this.static.argvlist.length,z);for(let O=0;O<D;O++)this.updateItem(J,H,{[U]:{value:O,type:"arg"}},O);if(z>this.static.argvlist.length)for(let O=this.static.argvlist.length;O<z;O++){const x={[U]:{value:O,type:"arg"}};this.boundaries&&N0.default(this.boundaries.end).before(this.addItem(J,H,x,O))}else if(z<this.static.argvlist.length)for(let O=this.static.argvlist.length-1;O>=z;O--)this.removeItem(J,O)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let K=N0.default();for(let U=Z;W?U<=X:U>=X;W?U++:U--){const w={},[D]=J.argv;if(D)w[D]={value:U,type:"arg"};K=K.add(this.addItem(J,H,w,U))}if(!K?.length)return;if(q)return K;J.fill(K)},asArray(J,Z,X,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Z.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[z,K]=J.argv;if(z){if(this.static.argvlist.length===Z.length){for(let w=0;w<this.static.argvlist.length;w++)!K0(this.static.argvlist[w].argvalues[z].value,Z[w])&&this.updateItem(J,X,{[z]:{value:Z[w],type:"arg"},[K]:{value:w,type:"arg"}},w);return}const U=Math.min(this.static.argvlist.length,Z.length);for(let w=0;w<U;w++)this.updateItem(J,X,{[z]:{value:Z[w],type:"arg"},[K]:{value:w,type:"arg"}},w);if(Z.length>this.static.argvlist.length)for(let w=this.static.argvlist.length;w<Z.length;w++){const D={[z]:{value:Z[w],type:"arg"},[K]:{value:w,type:"arg"}};this.boundaries&&N0.default(this.boundaries.end).before(this.addItem(J,X,D,w))}else if(Z.length<this.static.argvlist.length)for(let w=this.static.argvlist.length-1;w>=Z.length;w--)this.removeItem(J,w)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N0.default(),W=0;for(let z of Z){const K={},[U,w]=J.argv;if(U)K[U]={value:z,type:"arg"};if(w)K[w]={value:W,type:"arg"};q=q.add(this.addItem(J,X,K,W)),W++}if(!q?.length)return;if(H)return q;J.fill(q)},asMap(J,Z,X,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Z.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[z,K,U]=J.argv,w=Array.from(Z.entries());if(z){if(this.static.argvlist.length===w.length){for(let O=0;O<this.static.argvlist.length;O++)!K0(this.static.argvlist[O].argvalues[z].value,w[O][0])||!K0(this.static.argvlist[O].argvalues[K].value,w[O][1])&&this.updateItem(J,X,{[z]:{value:w[O][0],type:"arg"},[K]:{value:w[O][1],type:"arg"},[U]:{value:O,type:"arg"}},O);return}const D=Math.min(this.static.argvlist.length,w.length);for(let O=0;O<D;O++)this.updateItem(J,X,{[z]:{value:w[O][0],type:"arg"},[K]:{value:w[O][1],type:"arg"},[U]:{value:O,type:"arg"}},O);if(w.length>this.static.argvlist.length)for(let O=this.static.argvlist.length;O<w.length;O++){const x={[z]:{value:w[O][0],type:"arg"},[K]:{value:w[O][1],type:"arg"},[U]:{value:O,type:"arg"}};this.boundaries&&N0.default(this.boundaries.end).before(this.addItem(J,X,x,O))}else if(w.length<this.static.argvlist.length)for(let O=this.static.argvlist.length-1;O>=w.length;O--)this.removeItem(J,O)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N0.default(),W=0;for(let[z,K]of Z){const U={},[w,D,O]=J.argv;if(w)U[w]={value:z,type:"arg"};if(D)U[D]={value:K,type:"arg"};if(O)U[O]={value:W,type:"arg"};q=q.add(this.addItem(J,X,U,W)),W++}if(!q?.length)return;if(H)return q;J.fill(q)},asObject(J,Z,X,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Object.keys(Z).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[z,K,U]=J.argv,w=Object.entries(Z);if(z){if(this.static.argvlist.length===w.length){for(let O=0;O<this.static.argvlist.length;O++)!K0(this.static.argvlist[O].argvalues[z].value,w[O][0])||!K0(this.static.argvlist[O].argvalues[K].value,w[O][1])&&this.updateItem(J,X,{[z]:{value:w[O][0],type:"arg"},[K]:{value:w[O][1],type:"arg"},[U]:{value:O,type:"arg"}},O);return}const D=Math.min(this.static.argvlist.length,w.length);for(let O=0;O<D;O++)this.updateItem(J,X,{[z]:{value:w[O][0],type:"arg"},[K]:{value:w[O][1],type:"arg"},[U]:{value:O,type:"arg"}},O);if(w.length>this.static.argvlist.length){let O=N0.default();for(let x=this.static.argvlist.length;x<w.length;x++){const d={[z]:{value:w[x][0],type:"arg"},[K]:{value:w[x][1],type:"arg"},[U]:{value:x,type:"arg"}},J0=this.addItem(J,X,d,x);O=O.add(J0)}this.boundaries&&N0.default(this.boundaries.end).before(O)}else if(w.length<this.static.argvlist.length)for(let O=this.static.argvlist.length-1;O>=w.length;O--)this.removeItem(J,O)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N0.default(),W=0;for(let z in Z){const K={},[U,w,D]=J.argv;if(U)K[U]={value:z,type:"arg"};if(w)K[w]={value:Z[z],type:"arg"};if(D)K[D]={value:W,type:"arg"};q=q.add(this.addItem(J,X,K,W)),W++}if(!q?.length)return;if(H)return q;J.fill(q)},onDestroy(){this.static.prevRenderer?.cleanup(void 0,!0),this.static.prevRenderer=null,this.static.argvlist=null,this.static.lastIn=null}};var s1={};s0(s1,{handler:()=>{{return x8}},declaration:()=>{{return b8}},_static:()=>{{return g8}}});var b8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},g8={initialized:!1,finalized:!1,prevRenderer:null},x8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,X=!1){if(!J.await)throw new Error("Undefined async <await> attribute");if(!(J.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(this.static.finalized=!1,J.loading){this.static.prevRenderer?.cleanup();const H=J.loading.renderer.mesh({},Z);if(this.static.prevRenderer=J.loading.renderer,this.execute(J,Z,!0),this.static.finalized)return;if(!H?.length)return;if(X)return H;J.loading.renderer.fill(H)}else this.execute(J,Z)},execute(J,Z,X=!1){J.await.then((H)=>{if(this.static.prevRenderer?.cleanup(),!J.then)return;const[q]=J.then.renderer.argv,W={[q]:{value:H,type:"arg"}},z=J.then.renderer.mesh(W,Z);if(this.static.prevRenderer=J.then.renderer,!z?.length)return;if(!X)return z;J.then.renderer.fill(z)}).catch((H)=>{if(this.static.prevRenderer?.cleanup(),!J.catch)return;const[q]=J.catch.renderer.argv,W={[q]:{value:H,type:"arg"}},z=J.catch.renderer.mesh(W,Z);if(this.static.prevRenderer=J.catch.renderer,!z?.length)return;if(!X)return z;J.catch.renderer.fill(z)}).finally(()=>this.static.finalized=!0)}};var l1={};s0(l1,{handler:()=>{{return h8}},declaration:()=>{{return k8}},_static:()=>{{return f8}}});var k8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},f8={initialized:!1,prevRenderer:null},h8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,X=!1){let H=[];this.static.prevRenderer?.cleanup();for(let q of J.case)if(q.is==J.by||Array.isArray(q.is)&&q.is.includes(J.by)){Array.isArray(q.is)?H=[...new Set([...H,...q.is])]:H.push(q.is);const W=q.renderer.mesh({},Z);if(this.static.prevRenderer=q.renderer,!W?.length)return;if(X)return W;q.renderer.fill(W)}if(H.includes(J.by))return;if(J.default){const q=J.default.renderer.mesh({},Z);if(this.static.prevRenderer=J.default.renderer,!q?.length)return;if(X)return q;J.default.renderer.fill(q)}else this.static.prevRenderer=null}};var o1={};s0(o1,{state:()=>{{return _8}},handler:()=>{{return m8}},default:()=>{{return d8}},context:()=>{{return v8}},_static:()=>{{return y8}}});var u8=function(J){const Z={};return J.split("&").map((H)=>{const[q,W]=H.split("=");Z[q]=W}),Z},_8={page:null,params:{},query:{}},y8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},v8=["navigate"],m8={onInput(){this.processor(this.input)},processor(J){if(!J.routes)return;if(J.global)this.static.global=J.global;if(this.static.routes=J.routes.map(({path:Z,template:X,default:H})=>{if(H)this.static.defaultPath=Z;const q=Z.match(/:[^\/]*(\/|$)/gi)||[],W=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:X,default:H,pathVars:q,pathRegex:new RegExp(`${W}\$`,"i")}}),J.global){const Z=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&Z=="/"&&Z!==this.static.defaultPath?this.static.defaultPath:Z?Z+window.location.search:this.static.routes[0].path}},onAttach(){if(this.input.global)window.navigate=this.navigate.bind(this),window.addEventListener("popstate",(J)=>J.state&&this.navigate(J.state.path,!0));this.setContext("navigate",this.navigate.bind(this)),this.static.defaultPath&&this.navigate(this.static.defaultPath)},navigate(J,Z){!Z&&this.static.global&&history.pushState({path:J},"",J);const X=J.split("?");J=X[0];const H=X[1]?u8(X[1]):{};let q=null;if(this.static.currentRoute)q={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:q,toState:{path:J,query:H}});const W=this.match(J);if(!W){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:z,params:K}=W;this.emit("after",{fromState:q,toState:{path:z.path,params:K,query:H}}),this.static.currentPath=J,this.static.currentRoute=z,this.state.params=K,this.state.query=H,this.state.page=z.template},match(J){const Z={};let X=!1;for(let H of this.static.routes){const{pathVars:q,pathRegex:W}=H,z=J.match(W);if(z!==null&&z.index===0){for(let K=0;K+1<z.length&&K<q.length;K++)Z[q[K].replaceAll(/[\/:]/g,"")]=z[K+1];X=H;break}}return X?{route:X,params:Z}:!1}},d8="<{state.page} params=state.params query=state.query/>";class P1{debug=!1;stylesheets=[];config={};store=new Map;__root;preprocessor;i18n=new z1;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.preprocessor=new W1(this.store),this.watcher=new q1,this.IUC=new H1;const[Z,X]=_0(this.i18n.lang),[H,q]=_0(J?.context||{});this.__setLang=X,this.__getLang=Z,this.__setContext=q,this.__getContext=H,this.register("if",c1),this.register("for",p1),this.register("async",s1),this.register("switch",l1),this.register("router",o1)}register(J,Z){return this.store.set(J,Z),this}unregister(J){return this.store.delete(J),this}has(J){return this.store.has(J)}import(J){if(!this.has(J))throw new Error(`<${J}> component not found`);const Z=this.store.get(J);if(!Z?.declaration?.syntax&&!Z?.default)throw new Error(`Invalid <${J}> component`);return Z}render(J,Z,X){const{default:H,...q}=Z,W={debug:this.debug,prepath:"0",lips:this},z=new y0(J,H||"",{...q,input:X},W);return window.addEventListener("beforeunload",()=>{return this.dispose(),z.destroy(),null}),window.addEventListener("pagehide",(K)=>{!K.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),z}root(J,Z){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Z),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((X)=>new p0("root",{sheet:X,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Z){const X=this.__getContext();if(typeof J==="string"){const H={...X,[J]:Z};w0(X,H)&&this.__setContext(H)}else if(!Array.isArray(J)){const H={...X,...J};w0(X,H)&&this.__setContext(H)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;a0(()=>{const X=this.__getContext();if(!X)return;const H=Object.fromEntries(J.map((q)=>[q,X[q]]));H&&typeof Z==="function"&&Object.keys(H).length&&Z(H)})}useTranslator(J,Z){a0(()=>{const X=this.__getLang();if(!X)return;(J==="*"||Array.isArray(J)&&J.includes(X))&&typeof Z==="function"&&Z(X)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}var X7=new P1({debug:!0});
|
|
282
2
|
|
|
283
|
-
//# debugId=
|
|
3
|
+
//# debugId=DA84E427104CBA4564756e2164756e21
|