@lipsjs/lips 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,68 +1,283 @@
1
- var Y6=Object.create;var{defineProperty:T1,getPrototypeOf:U6,getOwnPropertyNames:K6}=Object;var j6=Object.prototype.hasOwnProperty;var S1=(J,Z,H)=>{H=J!=null?Y6(U6(J)):{};const X=Z||!J||!J.__esModule?T1(H,"default",{value:J,enumerable:!0}):H;for(let q of K6(J))if(!j6.call(X,q))T1(X,q,{get:()=>J[q],enumerable:!0});return X};var O6=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var m0=(J,Z)=>{for(var H in Z)T1(J,H,{get:Z[H],enumerable:!0,configurable:!0,set:(X)=>Z[H]=()=>X})};var e0=O6((W5,H5)=>{(function(){var J=document,Z=window,H=J.documentElement,X=J.createElement.bind(J),q=X("div"),W=X("table"),G=X("tbody"),Y=X("tr"),M=Array.isArray,U=Array.prototype,D=U.concat,N=U.filter,b=U.indexOf,i=U.map,e=U.push,r=U.slice,H0=U.some,t=U.splice,J0=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,_=/<.+>/,u=/^\w+$/;function v(Q,z){var B=V(z);return!Q||!B&&!F(z)&&!S(z)?[]:!B&&d.test(Q)?z.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!B&&u.test(Q)?z.getElementsByTagName(Q):z.querySelectorAll(Q)}var A=function(){function Q(z,B){if(!z)return;if(O(z))return z;var K=z;if(T(z)){var C=B||J;if(K=J0.test(z)&&F(C)?C.getElementById(z.slice(1).replace(/\\/g,"")):_.test(z)?i1(z):O(C)?C.find(z):T(C)?j(C).find(z):v(z,C),!K)return}else if(h(z))return this.ready(z);if(K.nodeType||K===Z)K=[K];this.length=K.length;for(var E=0,y=this.length;E<y;E++)this[E]=K[E]}return Q.prototype.init=function(z,B){return new Q(z,B)},Q}(),w=A.prototype,j=w.init;if(j.fn=j.prototype=w,w.length=0,w.splice=t,typeof Symbol==="function")w[Symbol.iterator]=U[Symbol.iterator];function O(Q){return Q instanceof A}function P(Q){return!!Q&&Q===Q.window}function F(Q){return!!Q&&Q.nodeType===9}function V(Q){return!!Q&&Q.nodeType===11}function S(Q){return!!Q&&Q.nodeType===1}function m(Q){return!!Q&&Q.nodeType===3}function c(Q){return typeof Q==="boolean"}function h(Q){return typeof Q==="function"}function T(Q){return typeof Q==="string"}function $(Q){return Q===void 0}function k(Q){return Q===null}function R(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function f(Q){if(typeof Q!=="object"||Q===null)return!1;var z=Object.getPrototypeOf(Q);return z===null||z===Object.prototype}j.isWindow=P,j.isFunction=h,j.isArray=M,j.isNumeric=R,j.isPlainObject=f;function L(Q,z,B){if(B){var K=Q.length;while(K--)if(z.call(Q[K],K,Q[K])===!1)return Q}else if(f(Q)){var C=Object.keys(Q);for(var K=0,E=C.length;K<E;K++){var y=C[K];if(z.call(Q[y],y,Q[y])===!1)return Q}}else for(var K=0,E=Q.length;K<E;K++)if(z.call(Q[K],K,Q[K])===!1)return Q;return Q}j.each=L,w.each=function(Q){return L(this,Q)},w.empty=function(){return this.each(function(Q,z){while(z.firstChild)z.removeChild(z.firstChild)})};function x(){var Q=[];for(var z=0;z<arguments.length;z++)Q[z]=arguments[z];var B=c(Q[0])?Q.shift():!1,K=Q.shift(),C=Q.length;if(!K)return{};if(!C)return x(B,j,K);for(var E=0;E<C;E++){var y=Q[E];for(var o in y)if(B&&(M(y[o])||f(y[o]))){if(!K[o]||K[o].constructor!==y[o].constructor)K[o]=new y[o].constructor;x(B,K[o],y[o])}else K[o]=y[o]}return K}j.extend=x,w.extend=function(Q){return x(w,Q)};var I=/\S+/g;function g(Q){return T(Q)?Q.match(I)||[]:[]}w.toggleClass=function(Q,z){var B=g(Q),K=!$(z);return this.each(function(C,E){if(!S(E))return;L(B,function(y,o){if(K)z?E.classList.add(o):E.classList.remove(o);else E.classList.toggle(o)})})},w.addClass=function(Q){return this.toggleClass(Q,!0)},w.removeAttr=function(Q){var z=g(Q);return this.each(function(B,K){if(!S(K))return;L(z,function(C,E){K.removeAttribute(E)})})};function a(Q,z){if(!Q)return;if(T(Q)){if(arguments.length<2){if(!this[0]||!S(this[0]))return;var B=this[0].getAttribute(Q);return k(B)?void 0:B}if($(z))return this;if(k(z))return this.removeAttr(Q);return this.each(function(C,E){if(!S(E))return;E.setAttribute(Q,z)})}for(var K in Q)this.attr(K,Q[K]);return this}w.attr=a,w.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},w.hasClass=function(Q){return!!Q&&H0.call(this,function(z){return S(z)&&z.classList.contains(Q)})},w.get=function(Q){if($(Q))return r.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},w.eq=function(Q){return j(this.get(Q))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)};function n(Q){if($(Q))return this.get().map(function(z){return S(z)||m(z)?z.textContent:""}).join("");return this.each(function(z,B){if(!S(B))return;B.textContent=Q})}w.text=n;function p(Q,z,B){if(!S(Q))return;var K=Z.getComputedStyle(Q,null);return B?K.getPropertyValue(z)||void 0:K[z]||Q.style[z]}function s(Q,z){return parseInt(p(Q,z),10)||0}function l(Q,z){return s(Q,"border".concat(z?"Left":"Top","Width"))+s(Q,"padding".concat(z?"Left":"Top"))+s(Q,"padding".concat(z?"Right":"Bottom"))+s(Q,"border".concat(z?"Right":"Bottom","Width"))}var Q0={};function L0(Q){if(Q0[Q])return Q0[Q];var z=X(Q);J.body.insertBefore(z,null);var B=p(z,"display");return J.body.removeChild(z),Q0[Q]=B!=="none"?B:"block"}function x0(Q){return p(Q,"display")==="none"}function m1(Q,z){var B=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!B&&!!z&&B.call(Q,z)}function p0(Q){return T(Q)?function(z,B){return m1(B,Q)}:h(Q)?Q:O(Q)?function(z,B){return Q.is(B)}:!Q?function(){return!1}:function(z,B){return B===Q}}w.filter=function(Q){var z=p0(Q);return j(N.call(this,function(B,K){return z.call(B,K,B)}))};function R0(Q,z){return!z?Q:Q.filter(z)}w.detach=function(Q){return R0(this,Q).each(function(z,B){if(B.parentNode)B.parentNode.removeChild(B)}),this};var v5=/^\s*<(\w+)[^>]*>/,u5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,d1={"*":q,tr:G,td:Y,th:Y,thead:W,tbody:W,tfoot:W};function i1(Q){if(!T(Q))return[];if(u5.test(Q))return[X(RegExp.$1)];var z=v5.test(Q)&&RegExp.$1,B=d1[z]||d1["*"];return B.innerHTML=Q,j(B.childNodes).detach().get()}j.parseHTML=i1,w.has=function(Q){var z=T(Q)?function(B,K){return v(Q,K).length}:function(B,K){return K.contains(Q)};return this.filter(z)},w.not=function(Q){var z=p0(Q);return this.filter(function(B,K){return(!T(Q)||S(K))&&!z.call(K,B,K)})};function I0(Q,z,B,K){var C=[],E=h(z),y=K&&p0(K);for(var o=0,j0=Q.length;o<j0;o++)if(E){var q0=z(Q[o]);if(q0.length)e.apply(C,q0)}else{var w0=Q[o][z];while(w0!=null){if(K&&y(-1,w0))break;C.push(w0),w0=B?w0[z]:null}}return C}function c1(Q){if(Q.multiple&&Q.options)return I0(N.call(Q.options,function(z){return z.selected&&!z.disabled&&!z.parentNode.disabled}),"value");return Q.value||""}function m5(Q){if(!arguments.length)return this[0]&&c1(this[0]);return this.each(function(z,B){var K=B.multiple&&B.options;if(K||Z5.test(B.type)){var C=M(Q)?i.call(Q,String):k(Q)?[]:[String(Q)];if(K)L(B.options,function(E,y){y.selected=C.indexOf(y.value)>=0},!0);else B.checked=C.indexOf(B.value)>=0}else B.value=$(Q)||k(Q)?"":Q})}w.val=m5,w.is=function(Q){var z=p0(Q);return H0.call(this,function(B,K){return z.call(B,K,B)})},j.guid=1;function F0(Q){return Q.length>1?N.call(Q,function(z,B,K){return b.call(K,z)===B}):Q}j.unique=F0,w.add=function(Q,z){return j(F0(this.get().concat(j(Q,z).get())))},w.children=function(Q){return R0(j(F0(I0(this,function(z){return z.children}))),Q)},w.parent=function(Q){return R0(j(F0(I0(this,"parentNode"))),Q)},w.index=function(Q){var z=Q?j(Q)[0]:this[0],B=Q?this:j(z).parent().children();return b.call(B,z)},w.closest=function(Q){var z=this.filter(Q);if(z.length)return z;var B=this.parent();if(!B.length)return z;return B.closest(Q)},w.siblings=function(Q){return R0(j(F0(I0(this,function(z){return j(z).parent().children().not(z)}))),Q)},w.find=function(Q){return j(F0(I0(this,function(z){return v(Q,z)})))};var d5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,i5=/^$|^module$|\/(java|ecma)script/i,c5=["type","src","nonce","noModule"];function p5(Q,z){var B=j(Q);B.filter("script").add(B.find("script")).each(function(K,C){if(i5.test(C.type)&&H.contains(C)){var E=X("script");E.text=C.textContent.replace(d5,""),L(c5,function(y,o){if(C[o])E[o]=C[o]}),z.head.insertBefore(E,null),z.head.removeChild(E)}})}function s5(Q,z,B,K,C){if(K)Q.insertBefore(z,B?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(z,Q);else Q.parentNode.insertBefore(z,B?Q:Q.nextSibling);if(C)p5(z,Q.ownerDocument)}function E0(Q,z,B,K,C,E,y,o){return L(Q,function(j0,q0){L(j(q0),function(w0,T0){L(j(z),function(O0,o0){var $1=B?T0:o0,R1=B?o0:T0,M0=B?w0:O0;s5($1,!M0?R1:R1.cloneNode(!0),K,C,!M0)},o)},y)},E),z}w.after=function(){return E0(arguments,this,!1,!1,!1,!0,!0)},w.append=function(){return E0(arguments,this,!1,!1,!0)};function o5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if($(Q))return this;var z=/<script[\s>]/.test(Q);return this.each(function(B,K){if(!S(K))return;if(z)j(K).empty().append(Q);else K.innerHTML=Q})}w.html=o5,w.appendTo=function(Q){return E0(arguments,this,!0,!1,!0)},w.wrapInner=function(Q){return this.each(function(z,B){var K=j(B),C=K.contents();C.length?C.wrapAll(Q):K.append(Q)})},w.before=function(){return E0(arguments,this,!1,!0)},w.wrapAll=function(Q){var z=j(Q),B=z[0];while(B.children.length)B=B.firstElementChild;return this.first().before(z),this.appendTo(B)},w.wrap=function(Q){return this.each(function(z,B){var K=j(Q)[0];j(B).wrapAll(!z?K:K.cloneNode(!0))})},w.insertAfter=function(Q){return E0(arguments,this,!0,!1,!1,!1,!1,!0)},w.insertBefore=function(Q){return E0(arguments,this,!0,!0)},w.prepend=function(){return E0(arguments,this,!1,!0,!0,!0,!0)},w.prependTo=function(Q){return E0(arguments,this,!0,!0,!0,!1,!1,!0)},w.contents=function(){return j(F0(I0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},w.next=function(Q,z,B){return R0(j(F0(I0(this,"nextElementSibling",z,B))),Q)},w.nextAll=function(Q){return this.next(Q,!0)},w.nextUntil=function(Q,z){return this.next(z,!0,Q)},w.parents=function(Q,z){return R0(j(F0(I0(this,"parentElement",!0,z))),Q)},w.parentsUntil=function(Q,z){return this.parents(z,Q)},w.prev=function(Q,z,B){return R0(j(F0(I0(this,"previousElementSibling",z,B))),Q)},w.prevAll=function(Q){return this.prev(Q,!0)},w.prevUntil=function(Q,z){return this.prev(z,!0,Q)},w.map=function(Q){return j(D.apply([],i.call(this,function(z,B){return Q.call(z,B,z)})))},w.clone=function(){return this.map(function(Q,z){return z.cloneNode(!0)})},w.offsetParent=function(){return this.map(function(Q,z){var B=z.offsetParent;while(B&&p(B,"position")==="static")B=B.offsetParent;return B||H})},w.slice=function(Q,z){return j(r.call(this,Q,z))};var l5=/-([a-z])/g;function L1(Q){return Q.replace(l5,function(z,B){return B.toUpperCase()})}w.ready=function(Q){var z=function(){return setTimeout(Q,0,j)};if(J.readyState!=="loading")z();else J.addEventListener("DOMContentLoaded",z);return this},w.unwrap=function(){return this.parent().each(function(Q,z){if(z.tagName==="BODY")return;var B=j(z);B.replaceWith(B.children())}),this},w.offset=function(){var Q=this[0];if(!Q)return;var z=Q.getBoundingClientRect();return{top:z.top+Z.pageYOffset,left:z.left+Z.pageXOffset}},w.position=function(){var Q=this[0];if(!Q)return;var z=p(Q,"position")==="fixed",B=z?Q.getBoundingClientRect():this.offset();if(!z){var K=Q.ownerDocument,C=Q.offsetParent||K.documentElement;while((C===K.body||C===K.documentElement)&&p(C,"position")==="static")C=C.parentNode;if(C!==Q&&S(C)){var E=j(C).offset();B.top-=E.top+s(C,"borderTopWidth"),B.left-=E.left+s(C,"borderLeftWidth")}}return{top:B.top-s(Q,"marginTop"),left:B.left-s(Q,"marginLeft")}};var p1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};w.prop=function(Q,z){if(!Q)return;if(T(Q)){if(Q=p1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(K,C){C[Q]=z})}for(var B in Q)this.prop(B,Q[B]);return this},w.removeProp=function(Q){return this.each(function(z,B){delete B[p1[Q]||Q]})};var r5=/^--/;function F1(Q){return r5.test(Q)}var I1={},n5=q.style,a5=["webkit","moz","ms"];function t5(Q,z){if(z===void 0)z=F1(Q);if(z)return Q;if(!I1[Q]){var B=L1(Q),K="".concat(B[0].toUpperCase()).concat(B.slice(1)),C="".concat(B," ").concat(a5.join("".concat(K," "))).concat(K).split(" ");L(C,function(E,y){if(y in n5)return I1[Q]=y,!1})}return I1[Q]}var e5={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 s1(Q,z,B){if(B===void 0)B=F1(Q);return!B&&!e5[Q]&&R(z)?"".concat(z,"px"):z}function J6(Q,z){if(T(Q)){var B=F1(Q);if(Q=t5(Q,B),arguments.length<2)return this[0]&&p(this[0],Q,B);if(!Q)return this;return z=s1(Q,z,B),this.each(function(C,E){if(!S(E))return;if(B)E.style.setProperty(Q,z);else E.style[Q]=z})}for(var K in Q)this.css(K,Q[K]);return this}w.css=J6;function o1(Q,z){try{return Q(z)}catch(B){return z}}var Z6=/^\s+|\s+$/;function l1(Q,z){var B=Q.dataset[z]||Q.dataset[L1(z)];if(Z6.test(B))return B;return o1(JSON.parse,B)}function Q6(Q,z,B){B=o1(JSON.stringify,B),Q.dataset[L1(z)]=B}function W6(Q,z){if(!Q){if(!this[0])return;var B={};for(var K in this[0].dataset)B[K]=l1(this[0],K);return B}if(T(Q)){if(arguments.length<2)return this[0]&&l1(this[0],Q);if($(z))return this;return this.each(function(C,E){Q6(E,Q,z)})}for(var K in Q)this.data(K,Q[K]);return this}w.data=W6;function r1(Q,z){var B=Q.documentElement;return Math.max(Q.body["scroll".concat(z)],B["scroll".concat(z)],Q.body["offset".concat(z)],B["offset".concat(z)],B["client".concat(z)])}L([!0,!1],function(Q,z){L(["Width","Height"],function(B,K){var C="".concat(z?"outer":"inner").concat(K);w[C]=function(E){if(!this[0])return;if(P(this[0]))return z?this[0]["inner".concat(K)]:this[0].document.documentElement["client".concat(K)];if(F(this[0]))return r1(this[0],K);return this[0]["".concat(z?"offset":"client").concat(K)]+(E&&z?s(this[0],"margin".concat(B?"Top":"Left"))+s(this[0],"margin".concat(B?"Bottom":"Right")):0)}})}),L(["Width","Height"],function(Q,z){var B=z.toLowerCase();w[B]=function(K){if(!this[0])return $(K)?void 0:this;if(!arguments.length){if(P(this[0]))return this[0].document.documentElement["client".concat(z)];if(F(this[0]))return r1(this[0],z);return this[0].getBoundingClientRect()[B]-l(this[0],!Q)}var C=parseInt(K,10);return this.each(function(E,y){if(!S(y))return;var o=p(y,"boxSizing");y.style[B]=s1(B,C+(o==="border-box"?l(y,!Q):0))})}});var n1="___cd";w.toggle=function(Q){return this.each(function(z,B){if(!S(B))return;var K=x0(B),C=$(Q)?K:Q;if(C){if(B.style.display=B[n1]||"",x0(B))B.style.display=L0(B.tagName)}else if(!K)B[n1]=p(B,"display"),B.style.display="none"})},w.hide=function(){return this.toggle(!1)},w.show=function(){return this.toggle(!0)};var a1="___ce",V1=".",C1={focus:"focusin",blur:"focusout"},t1={mouseenter:"mouseover",mouseleave:"mouseout"},H6=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function N1(Q){return t1[Q]||C1[Q]||Q}function P1(Q){var z=Q.split(V1);return[z[0],z.slice(1).sort()]}w.trigger=function(Q,z){if(T(Q)){var B=P1(Q),K=B[0],C=B[1],E=N1(K);if(!E)return this;var y=H6.test(E)?"MouseEvents":"HTMLEvents";Q=J.createEvent(y),Q.initEvent(E,!0,!0),Q.namespace=C.join(V1),Q.___ot=K}Q.___td=z;var o=Q.___ot in C1;return this.each(function(j0,q0){if(o&&h(q0[Q.___ot]))q0["___i".concat(Q.type)]=!0,q0[Q.___ot](),q0["___i".concat(Q.type)]=!1;q0.dispatchEvent(Q)})};function e1(Q){return Q[a1]=Q[a1]||{}}function X6(Q,z,B,K,C){var E=e1(Q);E[z]=E[z]||[],E[z].push([B,K,C]),Q.addEventListener(z,C)}function J5(Q,z){return!z||!H0.call(z,function(B){return Q.indexOf(B)<0})}function s0(Q,z,B,K,C){var E=e1(Q);if(!z)for(z in E)s0(Q,z,B,K,C);else if(E[z])E[z]=E[z].filter(function(y){var o=y[0],j0=y[1],q0=y[2];if(C&&q0.guid!==C.guid||!J5(o,B)||K&&K!==j0)return!0;Q.removeEventListener(z,q0)})}w.off=function(Q,z,B){var K=this;if($(Q))this.each(function(E,y){if(!S(y)&&!F(y)&&!P(y))return;s0(y)});else if(!T(Q))for(var C in Q)this.off(C,Q[C]);else{if(h(z))B=z,z="";L(g(Q),function(E,y){var o=P1(y),j0=o[0],q0=o[1],w0=N1(j0);K.each(function(T0,O0){if(!S(O0)&&!F(O0)&&!P(O0))return;s0(O0,w0,q0,z,B)})})}return this},w.remove=function(Q){return R0(this,Q).detach().off(),this},w.replaceWith=function(Q){return this.before(Q).remove()},w.replaceAll=function(Q){return j(Q).replaceWith(this),this};function q6(Q,z,B,K,C){var E=this;if(!T(Q)){for(var y in Q)this.on(y,z,B,Q[y],C);return this}if(!T(z))if($(z)||k(z))z="";else if($(B))B=z,z="";else K=B,B=z,z="";if(!h(K))K=B,B=void 0;if(!K)return this;return L(g(Q),function(o,j0){var q0=P1(j0),w0=q0[0],T0=q0[1],O0=N1(w0),o0=w0 in t1,$1=w0 in C1;if(!O0)return;E.each(function(R1,M0){if(!S(M0)&&!F(M0)&&!P(M0))return;var E1=function(z0){if(z0.target["___i".concat(z0.type)])return z0.stopImmediatePropagation();if(z0.namespace&&!J5(T0,z0.namespace.split(V1)))return;if(!z&&($1&&(z0.target!==M0||z0.___ot===O0)||o0&&z0.relatedTarget&&M0.contains(z0.relatedTarget)))return;var A1=M0;if(z){var k0=z0.target;while(!m1(k0,z)){if(k0===M0)return;if(k0=k0.parentNode,!k0)return}A1=k0}Object.defineProperty(z0,"currentTarget",{configurable:!0,get:function(){return A1}}),Object.defineProperty(z0,"delegateTarget",{configurable:!0,get:function(){return M0}}),Object.defineProperty(z0,"data",{configurable:!0,get:function(){return B}});var M6=K.call(A1,z0,z0.___td);if(C)s0(M0,O0,T0,z,E1);if(M6===!1)z0.preventDefault(),z0.stopPropagation()};E1.guid=K.guid=K.guid||j.guid++,X6(M0,O0,T0,z,E1)})}),this}w.on=q6;function z6(Q,z,B,K){return this.on(Q,z,B,K,!0)}w.one=z6;var B6=/\r?\n/g;function G6(Q,z){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(z.replace(B6,"\r\n")))}var w6=/file|reset|submit|button|image/i,Z5=/radio|checkbox/i;if(w.serialize=function(){var Q="";return this.each(function(z,B){L(B.elements||[B],function(K,C){if(C.disabled||!C.name||C.tagName==="FIELDSET"||w6.test(C.type)||Z5.test(C.type)&&!C.checked)return;var E=c1(C);if(!$(E)){var y=M(E)?E:[E];L(y,function(o,j0){Q+=G6(C.name,j0)})}})}),Q.slice(1)},typeof W5!=="undefined")H5.exports=j;else Z.cash=Z.$=j})()});class l0{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 H=this.callbacks.get(Z);if(H)H()}catch(H){console.error(`Error updating component ${Z}:`,H)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class r0{subscriptions=new Map;tick=new l0;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 H=this,X=new WeakMap,q=(G)=>{if(typeof G.toJSON==="function")return G;if(G instanceof Map)G.forEach((M,U)=>G.set(U,W(M)));else if(Array.isArray(G))G.forEach((M,U)=>G[U]=W(M));else if(typeof G==="object")Object.entries(G).forEach(([M,U])=>G[M]=W(U));let Y=new Proxy(G,{get(M,U){if(U==="toJSON")return function(){const N=(b)=>{if(!b||typeof b!=="object")return b;if(X.has(b)){const i=X.get(b);if(i instanceof Map){const r={};return i.forEach((H0,t)=>r[typeof t==="object"?JSON.stringify(t):String(t)]=N(H0)),r}if(Array.isArray(i))return i.map((r)=>N(r));const e={};return Object.entries(i).forEach(([r,H0])=>e[r]=N(H0)),e}if(typeof b.toJSON==="function"&&!X.has(b))return b.toJSON();return b};return N(Y)};if(U==="reset")return function(){Y=null};const D=M[U];if(G instanceof Map&&typeof D==="function")return function(...N){const b=U.toString();if(b==="set"&&N.length>=2)N[1]=W(N[1]);const i=D.apply(M,N);return["set","delete","clear"].includes(b)&&H.queueUpdate(J),i};if(Array.isArray(G)&&typeof D==="function")return function(...N){const b=U.toString();if(["push","unshift"].includes(b))N=N.map((e)=>W(e));else if(b==="splice"&&N.length>2)N=[N[0],N[1],...N.slice(2).map((e)=>W(e))];const i=D.apply(M,N);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(b)&&H.queueUpdate(J),i};return D},set(M,U,D){if(M[U]===D)return!0;if(D instanceof Map&&M[U]instanceof Map){const N=M[U];return N.clear(),D.forEach((b,i)=>N.set(i,W(b))),H.queueUpdate(J),!0}return M[U]=W(D),H.queueUpdate(J),!0}});return X.set(Y,G),Y},W=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Z)}}class n0{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Z)=>{try{const H=Z.node;if(!H){this.unwatch(Z);return}if(J.type==="attach"&&document.contains(H[0]))this.unwatch(Z),Z.emit("component:attached"),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();else if(J.type==="detach"&&!document.contains(H[0]))this.unwatch(Z),Z.emit("component:detached"),typeof Z.onDetach=="function"&&Z.onDetach.bind(Z)()}catch(H){console.log("DWS error --",H)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Z="attach"){const H=J.node;if(!H)return;if(Z==="attach"&&document.contains(H[0])){J.emit("component:attached"),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Z==="detach"&&!document.contains(H[0])){J.emit("component:detached"),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const X=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Z}ment-timeout`)},this.TIMEOUT);this.observedComponents.set(J,{timeout:X,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 a0=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(H,X)=>{return Z[X]!==void 0?Z[X].toString():`{${X}}`})},Q5=(J,Z,H,X,q)=>{switch(J){case"plural":{if(typeof H==="string"){console.warn("Plural format value cannot be a string");return}if(X.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let Y=H["*"];if(typeof Y==="object")Y=Y[q||"*"];return a0(Y,X)}if(typeof X.count==="string")X.count=Number(X.count);let W="*";if(X.count.toString()in H)W=X.count.toString();let G=H[W]||H["*"];if(typeof G==="object")G=G[q||"*"];return a0(G,X)}case"condition":{if(typeof H==="string"){console.warn("Condition format value cannot be a string");return}let W;for(let G in H)try{if(new Function("params",`with( params ){ return ${G}; }`)(X||{})){W=H[G];break}}catch(Y){console.warn(`Invalid <${Z}(${G})> condition expression`)}if(W===void 0)return;if(typeof W==="object")W=W[q||"*"];return a0(W,X)}case"variable":default:{const W=typeof H==="object"?H[q||"*"]:H;if(typeof W==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return a0(W,X)}}};class t0{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,Z){this.DICTIONARIES[J]=Z}translate(J,Z){if(Z&&this.currentLang===Z)return{text:J,lang:this.currentLang};Z=Z||this.currentLang;const[H,X]=Z.split("-");if(this.DICTIONARIES[H]&&J in this.DICTIONARIES[H]){if(typeof this.DICTIONARIES[H][J]==="object"){const q=this.DICTIONARIES[H][J];J=q[X||"*"]||q["*"]}else if(typeof this.DICTIONARIES[H][J]==="string")J=this.DICTIONARIES[H][J]}return{text:J,lang:Z}}format(J,Z,H){H=H||this.currentLang;const[X,q]=H.split("-");if(!this.DICTIONARIES[X]){console.warn(`Undefined <${H}> format dictionary`);return}if(!this.DICTIONARIES[X][J]){console.warn(`Undefined <${H}[${J}]> format reference`);return}const W=this.DICTIONARIES[X][J];if(typeof W==="string"){console.warn(`Invalid <${H}[${J}]> format reference. Expected object`);return}if(typeof W!=="object"||W===null||Array.isArray(W)){console.warn(`Invalid <${H}[${J}]> format value`);return}return Q5(W.type,J,W.value,Z,q)}}var P5=S1(e0(),1);var J1="comm",Z1="rule",Q1="decl";var X5="@import";var q5="@namespace",z5="@keyframes";var B5="@layer";function W1(J){return J.trim()}function f0(J,Z,H){return J.replace(Z,H)}function G5(J,Z,H){return J.indexOf(Z,H)}function V0(J,Z){return J.charCodeAt(Z)|0}function C0(J,Z,H){return J.slice(Z,H)}function G0(J){return J.length}function H1(J){return J.length}function _0(J,Z){return Z.push(J),J}var b1=Math.abs,d0=String.fromCharCode;function q1(J,Z,H,X,q,W,G,Y){return{value:J,root:Z,parent:H,type:X,props:q,children:W,line:X1,column:h0,length:G,return:"",siblings:Y}}function M5(){return X0}function Y5(){if(X0=U0>0?V0(v0,--U0):0,h0--,X0===10)h0=1,X1--;return X0}function K0(){if(X0=U0<w5?V0(v0,U0++):0,h0++,X0===10)h0=1,X1++;return X0}function N0(){return V0(v0,U0)}function i0(){return U0}function z1(J,Z){return C0(v0,J,Z)}function y0(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function U5(J){return X1=h0=1,w5=G0(v0=J),U0=0,[]}function K5(J){return v0="",J}function B1(J){return W1(z1(U0-1,g1(J===91?J+2:J===40?J+1:J)))}function j5(J){while(X0=N0())if(X0<33)K0();else break;return y0(J)>2||y0(X0)>3?"":" "}function O5(J,Z){while(--Z&&K0())if(X0<48||X0>102||X0>57&&X0<65||X0>70&&X0<97)break;return z1(J,i0()+(Z<6&&N0()==32&&K0()==32))}function g1(J){while(K0())switch(X0){case J:return U0;case 34:case 39:if(J!==34&&J!==39)g1(X0);break;case 40:if(J===41)g1(J);break;case 92:K0();break}return U0}function D5(J,Z){while(K0())if(J+X0===57)break;else if(J+X0===84&&N0()===47)break;return"/*"+z1(Z,U0-1)+"*"+d0(J===47?J:K0())}function L5(J){while(!y0(N0()))K0();return z1(J,U0)}var X1=1,h0=1,w5=0,U0=0,X0=0,v0="";function V5(J){return K5(G1("",null,null,null,[""],J=U5(J),0,[0],J))}function G1(J,Z,H,X,q,W,G,Y,M){var U=0,D=0,N=G,b=0,i=0,e=0,r=1,H0=1,t=1,J0=0,d="",_=q,u=W,v=X,A=d;while(H0)switch(e=J0,J0=K0()){case 40:if(e!=108&&V0(A,N-1)==58){if(G5(A+=f0(B1(J0),"&","&\f"),"&\f",b1(U?Y[U-1]:0))!=-1)t=-1;break}case 34:case 39:case 91:A+=B1(J0);break;case 9:case 10:case 13:case 32:A+=j5(e);break;case 92:A+=O5(i0()-1,7);continue;case 47:switch(N0()){case 42:case 47:if(_0(L6(D5(K0(),i0()),Z,H,M),M),(y0(e||1)==5||y0(N0()||1)==5)&&G0(A)&&C0(A,-1,void 0)!==" ")A+=" ";break;default:A+="/"}break;case 123*r:Y[U++]=G0(A)*t;case 125*r:case 59:case 0:switch(J0){case 0:case 125:H0=0;case 59+D:if(t==-1)A=f0(A,/\f/g,"");if(i>0&&(G0(A)-N||r===0&&e===47))_0(i>32?I5(A+";",X,H,N-1,M):I5(f0(A," ","")+";",X,H,N-2,M),M);break;case 59:A+=";";default:if(_0(v=F5(A,Z,H,U,D,q,Y,d,_=[],u=[],N,W),W),J0===123)if(D===0)G1(A,Z,v,v,_,W,N,Y,u);else{switch(b){case 99:if(V0(A,3)===110)break;case 108:if(V0(A,2)===97)break;default:D=0;case 100:case 109:case 115:}if(D)G1(J,v,v,X&&_0(F5(J,v,v,0,0,q,Y,d,q,_=[],N,u),u),q,u,N,Y,X?_:u);else G1(A,v,v,v,[""],u,0,Y,u)}}U=D=i=0,r=t=1,d=A="",N=G;break;case 58:N=1+G0(A),i=e;default:if(r<1){if(J0==123)--r;else if(J0==125&&r++==0&&Y5()==125)continue}switch(A+=d0(J0),J0*r){case 38:t=D>0?1:(A+="\f",-1);break;case 44:Y[U++]=(G0(A)-1)*t,t=1;break;case 64:if(N0()===45)A+=B1(K0());b=N0(),D=N=G0(d=A+=L5(i0())),J0++;break;case 45:if(e===45&&G0(A)==2)r=0}}return W}function F5(J,Z,H,X,q,W,G,Y,M,U,D,N){var b=q-1,i=q===0?W:[""],e=H1(i);for(var r=0,H0=0,t=0;r<X;++r)for(var J0=0,d=C0(J,b+1,b=b1(H0=G[r])),_=J;J0<e;++J0)if(_=W1(H0>0?i[J0]+" "+d:f0(d,/&\f/g,i[J0])))M[t++]=_;return q1(J,Z,H,q===0?Z1:Y,M,U,D,N)}function L6(J,Z,H,X){return q1(J,Z,H,J1,d0(M5()),C0(J,2,-2),0,X)}function I5(J,Z,H,X,q){return q1(J,Z,H,Q1,C0(J,0,X),C0(J,X+1,-1),X,q)}function w1(J,Z){var H="";for(var X=0;X<J.length;X++)H+=Z(J[X],X,J,Z)||"";return H}function C5(J,Z,H,X){switch(J.type){case B5:if(J.children.length)break;case X5:case q5:case Q1:return J.return=J.return||J.value;case J1:return"";case z5:return J.return=J.value+"{"+w1(J.children,X)+"}";case Z1:if(!G0(J.value=J.props.join(",")))return""}return G0(H=w1(J.children,X))?J.return=J.value+"{"+H+"}":""}function N5(J){var Z=H1(J);return function(H,X,q,W){var G="";for(var Y=0;Y<Z;Y++)G+=J[Y](H,X,q,W)||"";return G}}class u0{nsp;settings;$head;constructor(J,Z){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=P5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return w1(V5(J),N5([C5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const H=new MutationObserver(()=>{const X=document.querySelector(J);if(X&&getComputedStyle(X).cssText)H.disconnect(),Z()});H.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 H=this.compile(J);if(!H)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const X=document.createElement("style");X.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),X.textContent=H;let q=0;const W=this.$head.find(`style[${Z}]`);if(W.length)q=parseInt(W.attr("dindex"))+1,W.remove();return X.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(X):document.head.appendChild(X),X}catch(H){throw new Error(`Style injection failed: ${H.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 M1{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},H="batch-updator"){try{const X=this.component.FGUD.get(J)?.get(Z);if(!X){console.warn(`[batch update]: <${Z}> dependency not found`);return}if(X.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(X.nodepath);if(!q)return;const W=X.update(q.memo||{},H);if(W){if(typeof W.memo==="object")q.memo=W.memo;typeof W.cleanup==="function"&&W.cleanup()}}catch(X){console.error("Failed to update dependency --",X)}}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=new Map;this.pending.forEach((X,q)=>J.set(q,new Set(X))),this.pending.clear(),this.isPending=!1;const Z=(X)=>{const q=Array.from(X);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))},H=Array.from(J.keys()).sort((X,q)=>X-q);for(let X of H){const q=J.get(X);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 Y1{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 H=(q)=>{if(typeof q.toJSON==="function")return q.toJSON();if(Array.isArray(q))return q.map(H);if(typeof q==="object")for(let W in q)q[W]=H(q[W]);return q},X=Z.map(H);this.__events[J]?.forEach((q)=>q(...X)),this.__once_events[J]?.forEach((q)=>q(...X)),delete this.__once_events[J]}}var x1=S1(e0(),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($5(J)&&$5(Z)){for(let G of J)if(!Z.has(G))return!0;return!1}const W=new WeakMap;for(let G of J){let Y=!1;if(typeof G!=="object"){if(Z.has(G))Y=!0}else for(let M of Z){if(typeof M!=="object")continue;if(!W.has(G))W.set(G,new WeakMap);const U=W.get(G);if(U.has(M)){if(Y=U.get(M),Y)break;continue}const D=!B0(G,M);if(U.set(M,D),D){Y=!0;break}}if(!Y)return!0}return!1}if(J instanceof Map){if(!(Z instanceof Map))return!0;if(J.size!==Z.size)return!0;if(R5(J)&&R5(Z)){for(let[G,Y]of J)if(Z.get(G)!==Y)return!0;return!1}const W=new WeakMap;for(let[G,Y]of J){if(typeof G!=="object"){if(!Z.has(G))return!0;const D=Z.get(G);if(typeof Y!=="object"){if(Y!==D)return!0;continue}if(typeof D!=="object"||B0(Y,D))return!0;continue}let M=!1,U=!1;for(let[D,N]of Z){if(typeof D!=="object")continue;if(!W.has(G))W.set(G,new WeakMap);const b=W.get(G);if(b.has(D)){const[i,e]=b.get(D);if(i){M=!0,U=e;break}continue}if(!B0(G,D)){if(M=!0,U=typeof Y==="object"&&typeof N==="object"?!B0(Y,N):Y===N,b.set(D,[!0,U]),U)break}else b.set(D,[!1,!1])}if(!M||!U)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Z))return!0;if(J.length!==Z.length)return!0;for(let W=0;W<J.length;W++){const G=J[W],Y=Z[W];if(G!==Y&&(typeof G!=="object"||B0(G,Y)))return!0}return!1}const H=Object.keys(J),X=Object.keys(Z);if(H.length!==X.length)return!0;H.sort(),X.sort();const q=H.length;for(let W=0;W<q;W++)if(H[W]!==X[W])return!0;for(let W=0;W<q;W++){const G=H[W],Y=J[G],M=Z[G];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 P0(J,Z){if(J===Z)return!0;if(J==null||Z==null)return J===Z;const H=typeof J;if(H!==typeof Z)return!1;if(H!=="object"){if(H==="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 U=0;U<Y.length;U++)if(Y[U]!==M[U])return!1;return!0}if(J instanceof Promise||J instanceof WeakMap||J instanceof WeakSet)return J===Z;if(typeof J==="function"){if(typeof Z!=="function")return!1;return J.toString()===Z.toString()&&J.name===Z.name}if(J.constructor!==Z.constructor)return!1;if(J instanceof Map||J instanceof Set||Array.isArray(J)||Object.getPrototypeOf(J)===Object.prototype)return!B0(J,Z);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Z))return!1;const W=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(Z);if(W.length!==G.length)return!1;for(let Y of W){if(!Object.prototype.hasOwnProperty.call(Z,Y))return!1;if(!P0(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 U of Y){if(U==="constructor")continue;if(!P0(q[U],Object.getPrototypeOf(Z)[U]))return!1}}return!0}function $5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function R5(J){for(let[Z,H]of J)if(typeof Z==="object"&&Z!==null||typeof H==="object"&&H!==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((W,G)=>q.set(W0(G,Z),W0(W,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((W)=>q.add(W0(W,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let W=0;W<J.length;W++)q[W]=W0(J[W],Z);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const H=Object.create(Object.getPrototypeOf(J));Z.set(J,H);const X=Object.getOwnPropertySymbols(J);for(let q of X)H[q]=W0(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))H[q]=W0(J[q],Z);return H}function k5(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 H(q,W,G){const Y=W.split(/\.|\[|\]/).filter(Boolean);let M=q;for(let U=0;U<Y.length;U++){const D=Y[U],N=!isNaN(Number(D)),b=U===Y.length-1,i=!isNaN(Number(Y[U+1]));if(b){M[D]=G;continue}if(!(D in M))M[D]=i?[]:{};else if(i&&!Array.isArray(M[D]))M[D]=[];else if(!i&&Array.isArray(M[D]))M[D]={};M=M[D]}}const X=W0(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}`);H(X,q,W)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return X}function f5(J){return JSON.parse(JSON.stringify(J))}var A0="i18n",$0="syn:",D0="fn:",S0="on-",Y0=/^\.\.\./,U1=/^\[(.*?)\]$/,k1=/{\s*([^{}]+)\s*}/g,E5=["@html","@text","@format"],A5=["display","visibility","position","width","height"],K1=":r",T5=":n",S5="m",b5="c",g5="x",x5=100;x1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&x1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class j1{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,H)=>Z+H,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},H={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},X={"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},G={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(J),console.table(Z),console.table(H),console.table(X),console.table(q),console.table(W),console.table(G),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return W0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var Z0=S1(e0(),1);var F6=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let H=J,X;while((X=Z.exec(J))!==null){const q=X[1],W=X.index+X[0].length;let G=1,Y=W;while(Y<J.length&&G>0){if(J[Y]==="(")G++;if(J[Y]===")")G--;Y++}if(G===0){const M=J.slice(W,Y-1).trim(),U=J.slice(0,X.index),D=`${S0}${q}="${M}"`,N=J.slice(Y);H=U+D+N,J=H,Z.lastIndex=U.length+D.length}}return H},I6=function(J){const Z=[];let X=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,W,G)=>{return Z.push(G),`<${W}##TAG_ATTRS_${Z.length-1}##>`});for(let q=0;q<Z.length;q++){const W=`##TAG_ATTRS_${q}##`,G=Z[q],Y=V6(G);X=X.replace(W,Y)}return X},V6=function(J){let Z="",H=0,X=!1,q="",W=0,G=0,Y=0;while(H<J.length){const M=J[H];if((M==='"'||M==="'")&&(H===0||J[H-1]!=="\\")){if(!X)X=!0,q=M;else if(M===q)X=!1}if(!X){if(M==="(")G++;else if(M===")")G--;else if(M==="{")Y++;else if(M==="}")Y--}if(!X&&G===0&&Y===0&&(M===" "||H===J.length-1)){let U=H;if(H===J.length-1)U=H+1;const D=J.substring(W,U).trim();if(D){const N=C6(D);Z+=" "+N}W=H+1}H++}return Z},C6=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===A0||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let H=J.substring(0,Z).trim(),X=J.substring(Z+1).trim();if(H.startsWith("@"))return H=!E5.includes(H)?H.slice(1):H,`:${H}=${X}`;if(H.startsWith(D0)||H.startsWith(S0))return J;if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'")){const q=X.substring(1,X.length-1);if(N6(q))return`:${H}="${q}"`;return J}else return`:${H}="${X}"`};function N6(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 f1(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,(H,X,q)=>{return q.endsWith("<")?`<lips dtag="${X}" ${q}/lips>`:`<lips dtag="${X}" ${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 ${D0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(H)=>H.replace(/\s+/g,""));return Z=F6(Z),Z=I6(Z),Z}var P6=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},h5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function b0(J,Z={maxSize:100}){const H=new Set,X=[{value:J,timestamp:Date.now()}];let q=0;const W=()=>{const U=O1[O1.length-1];return U&&P6(U,H),X[q].value},G=()=>{const U=[...H];if(_5)for(let D of U)_5.add(D);else for(let D of U)D.execute()};return[W,(U,D)=>{if(Object.is(X[q].value,U))return;if(q<X.length-1)X.splice(q+1);if(X.push({value:U,timestamp:Date.now(),metadata:D}),X.length>Z.maxSize)X.shift(),q=Math.max(0,q-1);else q++;G()},{undo(){if(q>0)q--,G()},redo(){if(q<X.length-1)q++,G()},jumpTo(U){if(U>=0&&U<X.length&&U!==q)q=U,G()},getHistory(){return[...X]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<X.length-1},clear(){const U=X[0];X.length=0,X.push(U),q=0,G()}}]}function c0(J){let Z=!1;const H=()=>{if(Z)throw new Error("Circular dependency detected");if(X.isDisposed)return;Z=!0,h5(X),O1.push(X);try{J()}finally{Z=!1,O1.pop()}},X={execute:H,dependencies:new Set,isDisposed:!1};return H(),{dispose:()=>{X.isDisposed=!0,h5(X)}}}var O1=[],_5=null;class g0 extends Y1{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:H,state:X,context:q,_static:W,handler:G,stylesheet:Y,macros:M,declaration:U},D){super();if(this.lips=D.lips,D?.debug)this.debug=D.debug||this.lips.debug;if(D?.prepath)this.prepath=D.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=this.__inpath__=`${this.prepath}:${this.__name__}`,this.__template__=f1(Z),this.__boundaries__=D.boundaries,this.declaration=U||{name:J},this.input=H||{},this.static=W||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,X||{}),M&&this.setMacros(M),G&&this.setHandler(G),Y&&this.setStylesheet(Y),this.metrics=new j1(this.debug),this.metrics.inc("componentCount"),this.UQS=new M1(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[N,b]=b0(this.input),[i,e]=b0(this.state),[r,H0]=b0(this.context);this.__setInput=b,this.__setState=e,this.__getState=i,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,(t)=>{if(!B0(this.context,t))return;H0(t),this.context=t,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context")}),this.lips.useTranslator("*",(t)=>{if(t===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=t}),this.ICE=c0(()=>{const t=i(),J0=this.input=N(),d=this.context=r();if(!this.isRendered){if(this.metrics.reset(),!this.__template__.length||U?.syntax&&typeof this.onSelfRender=="function"){const _=this.onSelfRender.bind(this)(this.input);if(!this.__boundaries__?.start||!this.__boundaries__?.end)throw new Error(`Undefined <${this.__name__} syntax component boundaries`);this.$=_||Z0.default()}else{const{$log:_}=this.render("",void 0,void 0,this.FGUD);this.$=_}!U?.syntax&&this.$?.each((_,u)=>{typeof u.setAttribute=="function"&&u.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(J0),state:W0(t),context:W0(d)};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(k5(this.input,J),this.declaration.syntax?Z:void 0),this}setMacros(J){const Z=f1(J),H=Z0.default(Z);if(!H.length)return;const X=this;H.each(function(){const q=Z0.default(this),{argv:W,attrs:G}=X.__getAttributes__(q);if(!Object.keys(G))throw new Error("Invalid macro component definition");if(!G.literals.name)throw new Error("Undefined macro `name` attribute.");if(X.__macros.get(G.literals.name))console.warn(`Duplicate macro <${G.literals.name}> will be override`);if(!q.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");X.__macros.set(G.literals.name,{argv:W,$node:q})})}setHandler(J){Object.entries(J).map(([Z,H])=>this[Z]=H?.bind(this))}setStylesheet(J){const Z={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new u0(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,H={},X,q){if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:X||new Map};const W=this,G=X||new Map,Y=[];this.metrics.startRender();let M=Z0.default();function U(){return W0(H)}function D(w,j=!1){const O=N(w,j);return W.__inpathCounter__++,W.__inpath__?`${W.__inpath__}/${O}`:`${J?J+"/":""}${O}`}function N(w,j=!1){let O="";switch(w){case"component":O=j?g5:b5;break;case"macro":O=S5;break}return O+W.__inpathCounter__}function b(w){return w!==null&&typeof w==="object"&&typeof w.mesh==="function"&&typeof w.update==="function"}function i(w){return w!==null&&typeof w==="object"&&typeof w.default&&typeof w.default==="string"}function e(w){if(!w.attr(":dtag")||w.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const j=w.attr(":dtag"),O=W.__evaluate__(j,H);if(b(O)||O===null)return J0(w,j,O);else if(i(O))return d(w,{template:O});else return d(w,{name:O})}function r(w){const j=w.attr(":args"),O=D("log");if(!j)return;const P=U();if(W.__evaluate__(`console.log(${j})`,P),W.__isReactive__(j,P))W.__extractExpressionDeps__(j,P).forEach((V)=>W.__trackDep__(G,V,P,{nodetype:"log",nodepath:O,target:"argument",$fragment:null,update:(S)=>W.__evaluate__(`console.log(${j})`,S),syntax:!0}))}function H0(w){const j=D("var"),{attrs:O}=W.__getAttributes__(w);if(!O)return;Object.entries(O.literals).forEach(([P,F])=>{if(H[P]&&H[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);H[P]={value:F,type:"let"}}),Object.entries(O.expressions).forEach(([P,F])=>{if(H[P]&&H[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);if(H[P]={value:W.__evaluate__(F,H),type:"let"},W.__isReactive__(F,H)){const V=W.__extractExpressionDeps__(F,H),S=(m,c)=>{if(m[P]&&m[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);if(O.map.beforeSpreadAttrs.includes(P))return;const h=W.__evaluate__(F,m);if(P0(m[P].value,h))return;return m[P]={value:h,type:"let"},W.__updateVarDepNodes__(P,j,m),f5({memo:m})};V.forEach((m)=>W.__trackDep__(G,m,U(),{nodetype:"let",nodepath:j,deppath:`${j}.${P}`,target:"attr",$fragment:null,update:S,syntax:!0}))}}),W.metrics.inc("elementCount")}function t(w){const{attrs:j}=W.__getAttributes__(w);if(!j)return;Object.entries(j.literals).forEach(([O,P])=>{if(H[O]&&H[O].type==="const")throw new Error(`<const ${O}=[value]/> variable already defined`);if(!P)return;H[O]={value:P,type:"const"}}),Object.entries(j.expressions).forEach(([O,P])=>{if(H[O]&&H[O].type==="const")throw new Error(`<const ${O}=[value]/> variable already defined`);if(!P)return;H[O]={value:W.__evaluate__(P,H),type:"const"}}),W.metrics.inc("elementCount")}function J0(w,j,O){const{attrs:P}=W.__getAttributes__(w),F=D("element"),V=W.__getBoundaries__(F),S={},m={};let c=U(),h=Z0.default(V.start),T={},$=O;if($){P.literals&&Object.entries(P.literals).forEach(([R,f])=>{S[R]=f,T[R]={type:"arg",value:f}}),P.expressions&&Object.entries(P.expressions).forEach(([R,f])=>{if(!$)return;if(Y0.test(R))W.__evaluateSpreadAttr__(R,{memo:c,get keystore(){return m[R]},set keystore(L){if(!m[R])m[R]=[];m[R]=L},each:(L,x)=>{if(S[L]=x,L!=="#"&&!$?.argv.includes(L))return;T[L]={type:"arg",value:x}}});else{const L=f?W.__evaluate__(f,c):!0;if(S[R]=L,R!=="#"&&!$.argv.includes(R))return;T[R]={type:"arg",value:L}}}),c.__arguments__=S;const k=$.mesh(T);if(k&&k.length)h=h.add(k);P.expressions&&Object.entries(P.expressions).forEach(([R,f])=>{if(!$)return;if(Y0.test(R)&&W.__isReactive__(R,c)){const L=W.__extractExpressionDeps__(R,c),x=(I,g)=>{if(!$)return;const a={};let n=[];if(W.__evaluateSpreadAttr__(R,{memo:I,get keystore(){return m[R]},set keystore(p){if(!m[R])m[R]=[];m[R]=p},each:(p,s)=>{if(P.map.afterSpreadAttrs.includes(p))return;if(p!=="#"&&!$?.argv.includes(p))return;if(P0(s,I[p]?.value))return;T[p]=a[p]={value:s,type:"arg"},S[p]=s,n.push(p)},nullify:(p)=>{p.forEach((s)=>{a[s]={value:void 0,type:"arg"},delete S[s]}),n=p}}),n.length)$.argv.length&&W.__updateArgumentsDepNodes__(F,S),$.update(n,a,I,V)};L.forEach((I)=>W.__trackDep__(G,I,c,{nodetype:"dynamic",nodepath:F,deppath:`${F}.${R}`,target:"spread-attr",$fragment:null,boundaries:V,update:x}))}else if((R==="#"||$.argv.includes(R))&&W.__isReactive__(f,c)){const L=W.__extractExpressionDeps__(f,c),x=(I,g)=>{if(!$)return;if(P.map.beforeSpreadAttrs.includes(R))return;const a=f?W.__evaluate__(f,I):!0,n={type:"arg",value:a};if(T[R]=n,$.argv.length)S[R]=a,W.__updateArgumentsDepNodes__(F,S);$.update([R],{[R]:n},I,V)};L.forEach((I)=>W.__trackDep__(G,I,c,{nodetype:"dynamic",nodepath:F,deppath:`${F}.${R}`,target:"attr",$fragment:null,boundaries:V,update:x}))}})}if(W.__isReactive__(j,c)){const k=(f,L)=>{const x=W.__evaluate__(j,f);let I;if(i(x))I=d(w,{template:x}),W.__fillBoundaries__(I,V);else if(b(x)){if("#"in T)T=T["#"].value;else Object.entries(T).forEach(([g,a])=>{if(typeof a==="function")return;S[g]=a.value});if($?.cleanup(V),$=x,$)$.argv.length&&W.__updateArgumentsDepNodes__(F,S),I=$.mesh(T),I?.length&&$.fill(I,V)}else if($)$.cleanup(V),$=null};W.__extractExpressionDeps__(j,c).forEach((f)=>W.__trackDep__(G,f,{...c,...T},{nodetype:"dynamic",nodepath:F,deppath:`${F}.dtag`,target:"dtag",$fragment:null,boundaries:V,update:k}))}return h=h.add(V.end),h}function d(w,j){let O,P;if(j?.template)O=j.template,P=N("component",O.declaration?.syntax);else{if(P=j?.name||w.prop("tagName")?.toLowerCase(),!P)throw new Error("Invalid component");if(P===W.__name__)throw new Error("Render component within itself is forbidden");O=W.lips.import(P)}if(!O||!P)throw new Error(`<${P}> template not found`);const F=D("component",O.declaration?.syntax),V=W.__getBoundaries__(F),{argv:S,functions:m,attrs:c,events:h}=W.__getAttributes__(w),T={},$={};let k={},R=Z0.default(V.start),f=W.PCC.get(F),L=U();c.literals&&Object.entries(c.literals).forEach(([I,g])=>{if(I=="key")return;k[I]=g}),m&&Object.entries(m).forEach(([I,g])=>{k[I]=W.__evaluateFunction__(g,[],L),O.declaration?.syntax?T[$0+D0+I]=g:T[D0+I]=g}),c.expressions&&Object.entries(c.expressions).forEach(([I,g])=>{if(I=="key")return;if(Y0.test(I))W.__evaluateSpreadAttr__(I,{memo:L,get keystore(){return $[I]},set keystore(a){if(!$[I])$[I]=[];$[I]=a},each:(a,n)=>k[a]=n});else k[I]=g?W.__evaluate__(g,L):!0;O.declaration?.syntax?T[$0+I]=g:T[I]=g});const x=w.contents();if(x.length){if(k={...k,...W.__meshwire__({$node:w,fragmentPath:F,fragmentBoundaries:V,meshPath:null,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:O.declaration},T)},O.declaration){if(O.declaration.tags){let I;Object.entries(O.declaration?.tags).forEach(([g,{type:a,many:n,alts:p}])=>{switch(a){case"nexted":{let s=w.next(g);if(!s.length&&Array.isArray(p)&&I?.length&&I.is(p.join(",")))s=I.next(g);if(!s.length)return;if(n){k[g]=[];let l=0,Q0=!1;while(!Q0){if(k[g].push(W.__meshwire__({$node:s,meshPath:`${g}[${l}]`,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:O.declaration},T)),!s.next(g).length){Q0=!0;break}s=I=s.next(g),l++}}else k[g]=W.__meshwire__({$node:s,meshPath:g,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:O.declaration},T)}break;case"child":{const s=w.children(g);if(n)k[g]=[],s.each(function(l){const Q0=Z0.default(this),{argv:L0}=W.__getAttributes__(Q0);k[g].push(W.__meshwire__({$node:Q0,meshPath:`${g}[${l}]`,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:L0,xmlns:q,useAttributes:!0,declaration:O.declaration},T))});else if(w.children(g).first().length){const l=w.children(g).first(),{argv:Q0}=W.__getAttributes__(l);k[g]=W.__meshwire__({$node:l,meshPath:g,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:Q0,xmlns:q,useAttributes:!0,declaration:O.declaration},T)}}break}})}else if(O.declaration.contents)k.__contents__=x}}if(f)f.setInput(W0(k)),R=R.add(f.node);else{const{declaration:I,state:g,_static:a,handler:n,context:p,default:s,stylesheet:l}=O;f=new g0(P,s||"",{state:W0(g),input:W0(k),context:p,_static:W0(a),handler:n,stylesheet:l,declaration:I},{debug:W.debug,lips:W.lips,prepath:F,boundaries:V}),R=R.add(f.node),!O.declaration?.syntax&&W.PCC.set(F,f)}return R=R.add(V.end),Object.entries(h).forEach(([I,g])=>{W.__attachEvent__({nodepath:F,element:f,_event:I,instruction:g,scope:L,get __dependencies__(){return G}})}),T&&Object.entries(T).forEach(([I,g])=>{let a=!1,n=!1;if(I.startsWith($0))a=!0,I=I.replace($0,"");if(I.startsWith(D0))n=!0,I=I.replace(D0,"");if(Y0.test(I)){if(W.__isReactive__(I,L)){const p=(l)=>{const Q0={};W.__evaluateSpreadAttr__(I,{memo:l,get keystore(){return $[I]},set keystore(L0){if(!$[I])$[I]=[];$[I]=L0},each:(L0,x0)=>{if(c.map.afterSpreadAttrs.includes(L0))return;Q0[L0]=x0},nullify:(L0)=>L0.forEach((x0)=>Q0[x0]=void 0)}),f?.subInput(Q0,l)};W.__extractExpressionDeps__(I,L).forEach((l)=>W.__trackDep__(G,l,L,{nodetype:"component",nodepath:F,deppath:`${F}.${I}`,target:"spread-attr",$fragment:null,boundaries:V,update:p,syntax:a}))}}else if(W.__isReactive__(g,L)){const p=(l)=>{if(c.map.beforeSpreadAttrs.includes(I))return;const Q0=n?W.__evaluateFunction__(g,[],l):g?W.__evaluate__(g,l):!0;f?.subInput({[I]:Q0},l)};W.__extractExpressionDeps__(g,L).forEach((l)=>W.__trackDep__(G,l,L,{nodetype:"component",nodepath:F,deppath:`${F}.${I}`,target:"attr",$fragment:null,boundaries:V,update:p,syntax:a}))}}),W.metrics.inc("componentCount"),R}function _(w){const j=w.prop("tagName")?.toLowerCase();if(!j)throw new Error("Invalid macro rendering call");const O=W.__macros.get(j);if(!O)throw new Error("Macro component not found");const P=D("macro"),F=W.__getBoundaries__(P),{attrs:V}=W.__getAttributes__(w),S={},m=U(),c={},h={};V.literals&&Object.entries(V.literals).forEach(([L,x])=>{c[L]=x,h[L]={value:x,type:"arg"}});const T={};V.expressions&&Object.entries(V.expressions).forEach(([L,x])=>{if(Y0.test(L))W.__evaluateSpreadAttr__(L,{memo:m,get keystore(){return T[L]},set keystore(I){if(!T[L])T[L]=[];T[L]=I},each:(I,g)=>{if(c[I]=g,O.argv.includes(I))h[I]={value:g,type:"arg"}}}),S[L]=x;else{const I=x?W.__evaluate__(x,m):!0;if(c[L]=I,O.argv.includes(L))h[L]={value:I,type:"arg"},S[L]=x}O.argv.forEach((I)=>{if(h[I]!==void 0)return;h[I]={value:!1,type:"arg"}})}),h.__arguments__=c;let $=Z0.default(F.start);const k={$node:O.$node,meshPath:null,fragmentPath:P,fragmentBoundaries:F,argv:O.argv,scope:m,xmlns:q,useAttributes:!0},R=W.__meshwire__(k,S),f=R.renderer.mesh(h,m);return $=$.add(f),S&&Object.entries(S).forEach(([L,x])=>{let I=!1;if(new RegExp(`^${$0}`).test(L))I=!0,L=L.replace($0,"");if(Y0.test(L)){if(!W.__isReactive__(L,m))return;const g=W.__extractExpressionDeps__(L,m),a=(n)=>{const p={};let s=[];if(W.__evaluateSpreadAttr__(L,{memo:n,get keystore(){return T[L]},set keystore(l){if(!T[L])T[L]=[];T[L]=l},each:(l,Q0)=>{if(V.map.afterSpreadAttrs.includes(l))return;if(P0(Q0,n[l]?.value))return;p[l]={value:Q0,type:"arg"},c[l]=Q0,s.push(l)},nullify:(l)=>{l.forEach((Q0)=>{p[Q0]={value:void 0,type:"arg"},delete c[Q0]}),s=l}}),s.length)W.__updateArgumentsDepNodes__(P,c),R.renderer.update(s,p,n)};g.forEach((n)=>W.__trackDep__(G,n,{...m,...h},{nodetype:"macro",nodepath:P,deppath:`${P}.${L}`,target:"spread-attr",$fragment:null,boundaries:F,update:a,syntax:I}))}else if(W.__isReactive__(x,m)){const g=W.__extractExpressionDeps__(x,m),a=(n)=>{if(V.map.beforeSpreadAttrs.includes(L))return;const p=x?W.__evaluate__(x,n):!0;c[L]=p,W.__updateArgumentsDepNodes__(P,c),R.renderer.update([L],{[L]:{value:p,type:"arg"}},n)};g.forEach((n)=>W.__trackDep__(G,n,{...m,...h},{nodetype:"macro",nodepath:P,deppath:`${P}.${L}`,target:"attr",$fragment:null,boundaries:F,update:a,syntax:I}))}}),$=$.add(F.end),W.metrics.inc("elementCount"),$}function u(w){if(!w.length||!w.prop("tagName"))return w;const j=w.is("svg")||q,O=j?Z0.default(document.createElementNS("http://www.w3.org/2000/svg",w.prop("tagName").toLowerCase())):Z0.default(`<${w.prop("tagName").toLowerCase()}/>`),P=w.contents(),F=D("element"),V=U();P.length&&O.append(W.__withPath__(F,()=>W.render(F+T5,P,V,G,j).$log));const{attrs:S,events:m}=W.__getAttributes__(w);S.literals&&Object.entries(S.literals).forEach(([h,T])=>{if(h===A0)return;const $=w.is(`[${A0}]`)&&["title","placeholder"].includes(h);O.attr(h,$?W.lips.i18n.translate(T).text:T);const k=(R)=>{O.attr(h,$?W.lips.i18n.translate(T).text:T),$&&W.__trackTranslationDep__(R,{nodetype:"element",nodepath:F,deppath:`${F}.${h}`,target:"attr",$fragment:O,update:k})};$&&W.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${h}`,target:"attr",$fragment:O,update:k})});const c=(h,T=!1)=>{h&&Object.entries(h).forEach(([$,k])=>{switch($){case"@html":{const R=(f)=>{O.html(W.__evaluate__(k,f))};if(R(V),T&&W.__isReactive__(k,V))W.__extractExpressionDeps__(k,V).forEach((L)=>W.__trackDep__(G,L,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:R}))}break;case"@text":{const R=w.is(`[${A0}]`),f=(L)=>{O.text(W.__evaluate__(k,L,{translate:R})),R&&W.__trackTranslationDep__(L,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:f})};if(f(V),T&&W.__isReactive__(k,V))W.__extractExpressionDeps__(k,V).forEach((x)=>W.__trackDep__(G,x,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:f}));R&&W.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:f})}break;case"@format":{const[R,f]=k.split(",").map((x)=>x.trim());if(!R)throw new Error("Invalid @format reference");if(!f)throw new Error("Invalid @format parameters");const L=(x)=>{const I=W.__evaluate__(`!${f.trim()}`,x);if(typeof I!=="object")throw new Error("Invalid @format parameters");const g=W.lips.i18n.format(R,I);g!==void 0&&O.text(g),W.__trackTranslationDep__(x,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:L})};L(V),W.__extractExpressionDeps__(f,V).forEach((x)=>W.__trackDep__(G,x,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:L}))}break;case"style":if(T&&W.__isReactive__(k,V)){const R=(L)=>{const x=W.__evaluate__(k,L);if(typeof x==="object"){let I="";Object.entries(x).forEach(([g,a])=>I+=`${g}:${a};`),I.length&&O.attr("style",I)}else O.attr("style",x)};R(V),W.__extractExpressionDeps__(k,V).forEach((L)=>W.__trackDep__(G,L,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:O,update:R}))}else O.attr("style",k);break;default:{const R=w.is(`[${A0}]`)&&["title","placeholder"].includes($),f=(L)=>{const x=k&&W.__isReactive__(k,V)?W.__evaluate__(k,L,{translate:R}):k!==void 0?k:!0;if(x===void 0||x===!1)O.removeAttr($);else O.attr($,x),R&&W.__trackTranslationDep__(L,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:O,update:f})};if(f(V),T&&W.__isReactive__(k,V))W.__extractExpressionDeps__(k,V).forEach((x)=>W.__trackDep__(G,x,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:O,update:f}));R&&W.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:O,update:f})}}})};return S.expressions&&Object.keys(S.expressions).forEach((h)=>{if(!Y0.test(h))return;let T=[];const $=(k,R,f=!1)=>{const L={};W.__evaluateSpreadAttr__(h,{memo:k,get keystore(){return T},set keystore(x){T=x},each:(x,I)=>{if(!f&&S.map.afterSpreadAttrs.includes(x))return;L[x]=I},nullify:(x)=>x.forEach((I)=>O.removeAttr(I))}),Object.keys(L).length&&c(L)};if(delete S.expressions[h],$(V,"",!0),h&&W.__isReactive__(h,V))W.__extractExpressionDeps__(h,V).forEach((R)=>W.__trackDep__(G,R,V,{nodetype:"element",nodepath:F,deppath:`${F}.${h}`,target:"spread-attr",$fragment:O,update:$}))}),c(S.expressions,!0),m&&Object.entries(m).forEach(([h,T])=>{Y.push({nodepath:F,element:O,_event:h,instruction:T,scope:V,get __dependencies__(){return G}})}),W.metrics.inc("elementCount"),W.metrics.inc("domInsertsCount"),O}function v(w){const j=w.text(),O=U(),P=D("element"),F=w.parent().is(`[${A0}]`),V=Z0.default(document.createTextNode(W.__interpolate__(j,O,F))),S=(m)=>{const c=W.__interpolate__(j,m,F);if(!V[0])return;V[0].textContent=c,F&&W.__trackTranslationDep__(m,{nodetype:"text",nodepath:P,target:"value",$fragment:V,update:S})};if(j&&W.__isReactive__(j,O))W.__extractTextDeps__(j,O).forEach((c)=>W.__trackDep__(G,c,O,{nodetype:"text",nodepath:P,deppath:`${P}.${c}`,target:"value",$fragment:V,update:S}));return F&&W.__trackTranslationDep__(O,{nodetype:"text",nodepath:P,target:"value",$fragment:V,update:S}),W.metrics.inc("elementCount"),W.metrics.inc("domInsertsCount"),V}function A(w){if(w.get(0)?.nodeType===Node.COMMENT_NODE)return w;if(w.get(0)?.nodeType===Node.TEXT_NODE)return v(w);if(w.is("let"))return H0(w);else if(w.is("const"))return t(w);else if(w.is("lips")&&w.attr(":dtag"))return e(w);else if(w.is("log"))return r(w);else if(W.__macros.has(w.prop("tagName")?.toLowerCase()))return _(w);else if(w.is("if, for, switch, async")||W.lips.has(w.prop("tagName")?.toLowerCase()))return d(w);else if(w.is("else-if, else"))return;return u(w)}try{this.__renderDepth__++,Z=!Z&&Z0.default(this.__template__).length>1?Z0.default("<template>").html(this.__template__).contents():Z||Z0.default(this.__template__),Z.each(function(){const w=A(Z0.default(this));if(w)M=M.add(w)}),Y.forEach(this.__attachEvent__.bind(this)),W.metrics.inc("renderCount")}catch(w){console.error("Rendering Failed --",w),W.metrics.trackError(w)}finally{if(this.__renderDepth__--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth__===0)this.__inpath__="",this.__inpathCounter__=0}return{$log:M,dependencies:G,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)=>{Z0.default(Z).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy")}__meshwire__(J,Z){const H=this,{$node:X,meshPath:q,fragmentPath:W,fragmentBoundaries:G,argv:Y,xmlns:M,declaration:U,useAttributes:D}=J;let N,b=[];const i=[],e=W+K1,r=(d,_,u,v)=>{const A=`${e}${v!==void 0?`[${v}]`:""}`,{$log:w,dependencies:j,events:O}=H.__withPath__(A,()=>{return H.render(A,d,{..._,...u},void 0,M)});if(i.push(A),j?.forEach((P,F)=>{if(!H.FGUD?.has(F))H.FGUD.set(F,new Map);P.forEach((V,S)=>{if(V.garbage)return;V.partial?.length?V.partial.push(A):V.partial=[A],H.FGUD.get(F)?.set(S,V)})}),H.metrics.inc("partialCount"),v!==void 0){const P=H.__getBoundaries__(A);b[v]={argvalues:u,boundaries:P};let F=Z0.default(P.start);return F=F.add(w),F=F.add(P.end),F}return w},H0=(d,_,u,v)=>{H.metrics.startRender();const A=v!==void 0?i.filter((w)=>w.endsWith(`${K1}[${v}]`)):i;if(d.forEach((w)=>{const j=H.FGUD.get(w);if(!j)return;j.forEach((O)=>{const P=A.find((S)=>{return O.partial?.find((m)=>S==m||H.__hasSamePathParent__(m,S))});if(!O.partial||!P)return;const F=O.deppath||O.nodepath,V=this.FGUDMemory.get(O.nodepath);if(O.garbage||G?.start&&!document.contains(G.start)){j.delete(F),H.__unbindMemo__(O);return}if(!V){console.warn(`unexpected occurence: <${F}> has no memo`);return}if(V.memo?.[w]&&u?.[w]&&!P0(V.memo[w],u[w]))V.memo={..._,...V.memo,...u};H.UQS.queue({dep:w,deppath:F,priority:O.priority}),H.metrics.inc("dependencyUpdateCount")}),!j.size&&H.FGUD.delete(w)}),v!==void 0&&b[v])b[v].argvalues=u;H.metrics.inc("partialUpdateCount"),H.metrics.endRender()},t=(d)=>{if(!b[d])return;const _=b[d].boundaries;if(b.splice(d,1),!document.contains(_.start)||!document.contains(_.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const u=[];let v=_.start.nextSibling;while(v&&v!==_.end)u.push(v),v=v.nextSibling;Z0.default(u).remove(),_.start.remove(),_.end.remove()},J0={renderer:{path:q,argv:Y,mesh(d,_){if(N=X.contents(),!N?.length)return null;if(_=_||J.scope,U?.iterator){const u=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!u.length)return null;let v=Z0.default();return u.forEach((A,w)=>{if(!N?.length)return null;v=v.add(r(N,_,A,w))}),v}else return r(N,_,d)},update(d,_,u,v){if(!i.length)return;if(u=u||J.scope,v=v||G,U?.iterator){const A=_?.["#"].value;if(!Array.isArray(A))return;if(Array.isArray(b)){if(b.length===A.length){for(let j=0;j<A.length;j++)!P0(b[j].argvalues,A[j])&&H0(Object.keys(A[j]),u,A[j],j);return}const w=Math.min(b.length,A.length);for(let j=0;j<w;j++)H0(Object.keys(A[j]),u,A[j],j);if(A.length>b.length){if(!N?.length)return;for(let j=b.length;j<A.length;j++){const O=r(N,u,A[j],j);Z0.default(v.end).before(O)}}else if(A.length<b.length)for(let j=b.length-1;j>=A.length;j--)t(j)}}else H0(d,u,_)},fill(d,_){console.log("fill",_||G),H.__fillBoundaries__(d,_||G)},cleanup(d){console.log("cleanup"),H.FGUD.forEach((_,u)=>{_.forEach((v,A)=>{if(!H.__hasSamePathParent__(A,e))return;H.__unbindMemo__(v),v.garbage=!0}),!_.size&&H.FGUD.delete(u)}),H.__emptyBoundaries__(d||G)}}};if(D&&q){const{attrs:d}=H.__getAttributes__(X);d.literals&&Object.entries(d.literals).forEach(([_,u])=>J0[_]=u),d.expressions&&Object.entries(d.expressions).forEach(([_,u])=>{if(Y0.test(_)){let v=[];H.__evaluateSpreadAttr__(_,{memo:J.scope,get keystore(){return v},set keystore(A){v=A},each:(A,w)=>J0[A]=w}),Z[`${U?.syntax?$0:""}${q}.${_}`]=u}else J0[_]=u?H.__evaluate__(u,J.scope):!0,Z[`${U?.syntax?$0:""}${q}.${_}`]=u})}return J0}__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 H=J.start.nextSibling;while(H&&H!==J.end)Z.push(H),H=H.nextSibling;Z0.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&&Z0.default(Z.start).after(J)}__getAttributes__(J){const Z=J.attrs(),H={},X={},q={literals:{},expressions:{},map:{explicitAttrs:[],spreadAttrs:[],beforeSpreadAttrs:[],afterSpreadAttrs:[],metaAttrs:[]}},W=Object.keys(Z).find((M)=>Y0.test(M));let G=[],Y=!1;return Z&&Object.entries(Z).forEach(([M,U])=>{if(M==":dtag")return;if(M.startsWith(":")||M.startsWith(D0)||M.startsWith(S0)||Y0.test(M)||U1.test(M))if(U1.test(M)){const[D,N]=M.match(U1)||[];G=N.split(",")}else if(M.startsWith(S0))H[M.replace(S0,"")]=U;else if(M.startsWith(D0))X[M.replace(D0,"")]=U;else{if(M.startsWith(":"))M=M.slice(1,M.length);if(W)if(Y0.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]=U||""}else if(q.literals[M]=U,W)q.map.explicitAttrs.push(M),!Y?q.map.beforeSpreadAttrs.push(M):q.map.afterSpreadAttrs.push(M)}),{argv:G,events:H,functions:X,attrs:q}}__withPath__(J,Z){const H=this.__inpath__;this.__inpath__=J;const X=Z();return this.__inpath__=H,X}__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+K1}`)}__evaluate__(J,Z,H){J=typeof J==="string"?J.trim():J;try{const X=(q)=>{const W=this.state.toJSON(),G=(M,...U)=>{try{return M(...U)}catch(D){!H?.mute&&console.error("Eval error --",D);return}};let Y=`return ${q};`;if(Z){let M={},U;for(let N in Z){if(N==="__arguments__")continue;M[N]=Z[N].value}if(typeof Z.__arguments__==="object")U=Z.__arguments__;Y=`with( scope ){ ${Y} }`;const D=new Function("self","input","state","static","context","scope","arguments",Y);return G(D,this,this.input,W,this.static,this.context,M||{},U)}else{const M=new Function("self","input","state","static","context",Y);return G(M,this,this.input,W,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return X(J.slice(1));return J.replace(k1,(q,W)=>X(W))}return X(J)}catch(X){!H?.mute&&console.error("Expression evaluation error --",X);return}}__evaluateFunction__(J,Z,H){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,H)(...Z);else{let[X,...q]=J.split(/\s*,\s*/),W;const G=this.__evaluate__(X,H,{mute:!0});if(typeof G==="function")W=G;else{if(typeof this[X]!=="function")throw new Error(`Undefined <${X}> handler method`);W=this[X].bind(this)}if(typeof W!=="function")throw new Error(`Expected <${X}> to be a function or handler method`);let Y=q.map((M)=>this.__evaluate__(M,H));if(Z.length)Y=[...Y,...Z];return W(...Y)}}__evaluateSpreadAttr__(J,Z){const H=this.__evaluate__(J.replace(Y0,""),Z.memo);if(!H){if(!Z.keystore.length)throw new Error(`Undefined spread operator ${J}`);typeof Z.nullify==="function"&&Z.nullify(Z.keystore);return}if(typeof H!=="object"||Array.isArray(H))throw new Error(`Invalid spread operator ${J}`);if(Z.keystore=Object.keys(H)||[],typeof Z.each==="function")for(let X in H)Z.each(X,H[X])}__interpolate__(J,Z,H){if(J=J.replace(k1,(X,q)=>this.__evaluate__(q,Z)),H)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J){const{element:Z,nodepath:H,_event:X,instruction:q,scope:W,__dependencies__:G}=J;let Y=W;if(Z.on(X,(...M)=>this.__evaluateFunction__(q,M,Y)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(q,W))this.__extractExpressionDeps__(q,W).forEach((U)=>this.__trackDep__(G,U,W||{},{nodetype:"event",nodepath:H,deppath:`${H}.${X}`,target:"event-handler",$fragment:!(Z instanceof g0)?Z:null,boundaries:Z instanceof g0?Z.__boundaries__:void 0,update:(D)=>{Y=D}}))}__detachEvent__({element:J,nodepath:Z,_event:H,instruction:X,scope:q,__dependencies__:W}){if(J.off(H),this.__isReactive__(X,q)){const G=this.__extractExpressionDeps__(X,q),Y=`${Z}.${H}`;G.forEach((M)=>{W.get(M)?.delete(Y),this.FGUD.get(M)?.delete(Y)})}this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const H=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const W=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(W,Z).forEach((Y)=>H.add(Y))}),Array.from(H)}__extractExpressionDeps__(J,Z){const H=/\b(state|input|context|arguments)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,X=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g,q=/\b(arguments)((?:\.[a-zA-Z_]\w*)+)?(?=\[|\.|$|\s|;|,|\))/g;let W=[...Array.from(J.matchAll(H)),...Array.from(J.matchAll(X)),...Array.from(J.matchAll(q))];if(Z&&Object.keys(Z).length){const G=new RegExp(`\\b(?<!\\.)(${Object.keys(Z).join("|")})`,"g"),Y=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");W=[...W,...Array.from(J.matchAll(G)),...Array.from(J.matchAll(Y))]}return[...new Set(W.map((G)=>G[0]))]}__isReactive__(J,Z){if(/(self|state|input|context|arguments)(\.[\w.]+)?/.test(J))return!0;if(Z&&Object.keys(Z).length&&new RegExp(Object.keys(Z).join("|")).test(J))return!0;return!1}__bindMemo__(J,Z){const H=Z.deppath||Z.nodepath,X=this.FGUDMemory.get(Z.nodepath);if(X)X.tracks.set(H,Z.priority||2),X.memo=J,this.FGUDMemory.set(Z.nodepath,X);else{const q=new Map;q.set(H,Z.priority),this.FGUDMemory.set(Z.nodepath,{tracks:q,memo:J})}}__unbindMemo__(J){const Z=J.deppath||J.nodepath,H=this.FGUDMemory.get(J.nodepath);if(!H||!H.tracks.get(Z))return;H.tracks.delete(Z),!H.tracks.size&&this.FGUDMemory.delete(J.nodepath)}__trackDep__(J,Z,H,X){if(H&&H[Z]&&H[Z].type==="let")X.haslet=!0;if(X.priority===void 0)if(X.target==="attr"&&Z.split(".").find((W)=>A5.includes(W)))X.priority=0;else if(X.syntax)X.priority=1;else if(["event"].includes(X.nodetype))X.priority=3;else X.priority=2;const q=X.deppath||X.nodepath;X.level=q.split(/\//g).length,X.priority=X.level*x5+X.priority,!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(q,X),this.__bindMemo__(H,X),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((H,X)=>H?.[X],J)}__shouldUpdate__(J,Z){if(J==="self")return!0;const H={state:this.state,input:this.input,context:this.context},X=this.__valueDep__(this.__previous[J],Z),q=this.__valueDep__(H[J],Z);return!P0(X,q)}__updateDepNodes__(){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((J,Z)=>{const[H,...X]=Z.split(".");if(!this.__shouldUpdate__(H,X))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,H){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((X,q)=>{if(!X.haslet||!this.__hasSamePathParent__(q,this.__getPathParent__(Z)))return;const W=X.deppath||X.nodepath,G=this.FGUDMemory.get(X.nodepath);if(!G){console.warn(`unexpected occurence: <${W}> has no memo`);return}G.memo={...G.memo,...H},this.UQS.queue({dep:J,deppath:W,priority:X.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateArgumentsDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender();const H="arguments";this.FGUD.get(H)?.forEach((X,q)=>{if(!this.__hasSamePathParent__(q,J))return;const W=X.deppath||X.nodepath,G=this.FGUDMemory.get(X.nodepath);if(!G){console.warn(`unexpected occurence: <${W}> has no memo`);return}G.memo.__arguments__=Z,this.UQS.queue({dep:H,deppath:W,priority:X.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 H=this.FGUDMemory.get(J.nodepath);if(!H){console.warn(`unexpected occurence: <${J.deppath||J.nodepath}> has no memo`);return}J.update(H.memo,"i18n-partial-updator"),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?Z0.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?Z0.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?Z0.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var _1={};m0(_1,{handler:()=>{{return E6}},declaration:()=>{{return $6}},_static:()=>{{return R6}}});var $6={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},R6={initialized:!1,prevRenderer:null},E6={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,H=!1){if(!J.renderer)return;if(J.by){this.static.prevRenderer?.cleanup();const X=J.renderer.mesh({},Z);if(this.static.prevRenderer=J.renderer,!X?.length)return;if(H)return X;J.renderer.fill(X)}else{this.static.prevRenderer?.cleanup();let X=!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(H)return q;q?.length&&W.renderer.fill(q),X=!0;break}if(!X&&J.else){const W=J.else.renderer.mesh({},Z);if(this.static.prevRenderer=J.else.renderer,!W?.length)return;if(H)return W;J.else.renderer.fill(W)}}}};var h1={};m0(h1,{state:()=>{{return T6}},handler:()=>{{return b6}},default:()=>{{return g6}},declaration:()=>{{return A6}},_static:()=>{{return S6}}});var A6={name:"for",syntax:!0,iterator:!0},T6={argvlist:null},S6={lastIn:null,processingBatch:!1},b6={onInput(){this.processor(this.input)},processor(J){if(this.static.processingBatch)return;if(!J.renderer)throw new Error("Undefined mesh renderer");let{in:Z,from:H,to:X}=J;if(Z===void 0&&H===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(H!==void 0){if(H=parseFloat(String(H)),X==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");X=parseFloat(String(X));const q=H<X,W=Math.abs(X-H)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===W){const[Y]=J.renderer.argv;if(Y){let M=H,U=!0;for(let D=0;D<this.state.argvlist.length;D++){if(this.state.argvlist[D][Y].value!==M){U=!1;break}M=q?M+1:M-1}if(U)return;M=H;for(let D=0;D<this.state.argvlist.length;D++)this.state.argvlist[D][Y].value=M,M=q?M+1:M-1;return}}const G=[];for(let Y=H;q?Y<=X:Y>=X;q?Y++:Y--){const M={},[U]=J.renderer.argv;if(U)M[U]={value:Y,type:"arg"};G.push(M)}this.state.argvlist=G}else if(Array.isArray(Z)){if(this.state.argvlist&&this.static.lastIn&&J.in===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");this.state.argvlist=[];return}if(this.static.lastIn=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.length){const[G,Y]=J.renderer.argv;for(let M=0;M<Z.length;M++){const U=this.state.argvlist[M];if(G)U[G].value=Z[M]}return}const q=[];let W=0;for(let G of Z){const Y={},[M,U]=J.renderer.argv;if(M)Y[M]={value:G,type:"arg"};if(U)Y[U]={value:W,type:"arg"};q.push(Y),W++}this.state.argvlist=q}else if(Z instanceof Map){if(this.state.argvlist&&this.static.lastIn&&J.in===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");this.state.argvlist=[];return}if(this.static.lastIn=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.size){const[G,Y,M]=J.renderer.argv;let U=0;for(let[D,N]of Z){const b=this.state.argvlist[U];if(G)b[G].value=D;if(Y)b[Y].value=N;U++}return}const q=[];let W=0;for(let[G,Y]of Z){const M={},[U,D,N]=J.renderer.argv;if(U)M[U]={value:G,type:"arg"};if(D)M[D]={value:Y,type:"arg"};if(N)M[N]={value:W,type:"arg"};q.push(M),W++}this.state.argvlist=q}else if(typeof Z=="object"){if(this.state.argvlist&&this.static.lastIn&&J.in===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");this.state.argvlist=[];return}this.static.lastIn=Z;const q=Object.keys(Z);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q.length){const[Y,M,U]=J.renderer.argv;for(let D=0;D<q.length;D++){const N=q[D],b=this.state.argvlist[D];if(Y)b[Y].value=N;if(M)b[M].value=Z[N]}return}const W=[];let G=0;for(let Y in Z){const M={},[U,D,N]=J.renderer.argv;if(U)M[U]={value:Y,type:"arg"};if(D)M[D]={value:Z[Y],type:"arg"};if(N)M[N]={value:G,type:"arg"};W.push(M),G++}this.state.argvlist=W}}finally{this.static.processingBatch=!1}}},g6="<{input.renderer} #=state.argvlist/>";var y1={};m0(y1,{state:()=>{{return k6}},handler:()=>{{return f6}},default:()=>{{return _6}},declaration:()=>{{return x6}}});var x6={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},k6={renderer:null,props:{}},f6={onInput(){this.processor(this.input)},processor(J){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(J.loading)this.state.renderer=J.loading.renderer,this.state.props={};J.await.then((Z)=>{if(!J.then)return;this.state.renderer=J.then.renderer;const[H]=J.then.renderer.argv;this.state.props={[H]:{value:Z,type:"arg"}}}).catch((Z)=>{if(!J.catch)return;this.state.renderer=J.catch.renderer;const[H]=J.then.renderer.argv;this.state.props={[H]:{value:Z,type:"arg"}}})}},_6="<{state.renderer} #=state.props/>";var v1={};m0(v1,{handler:()=>{{return v6}},declaration:()=>{{return h6}},_static:()=>{{return y6}}});var h6={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},y6={initialized:!1,prevRenderer:null},v6={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,H=!1){let X=[];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)?X=[...new Set([...X,...q.is])]:X.push(q.is);const W=q.renderer.mesh({},Z);if(this.static.prevRenderer=q.renderer,!W?.length)return;if(H)return W;q.renderer.fill(W)}if(X.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(H)return q;J.default.renderer.fill(q)}else this.static.prevRenderer=null}};var u1={};m0(u1,{state:()=>{{return u6}},handler:()=>{{return c6}},default:()=>{{return p6}},context:()=>{{return d6}},_static:()=>{{return m6}}});var i6=function(J){const Z={};return J.split("&").map((X)=>{const[q,W]=X.split("=");Z[q]=W}),Z},u6={page:null,params:{},query:{}},m6={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},d6=["navigate"],c6={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:H,default:X})=>{if(X)this.static.defaultPath=Z;const q=Z.match(/:[^\/]*(\/|$)/gi)||[],W=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:H,default:X,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 H=J.split("?");J=H[0];const X=H[1]?i6(H[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:X}});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:G,params:Y}=W;this.emit("after",{fromState:q,toState:{path:G.path,params:Y,query:X}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=Y,this.state.query=X,this.state.page=G.template},match(J){const Z={};let H=!1;for(let X of this.static.routes){const{pathVars:q,pathRegex:W}=X,G=J.match(W);if(G!==null&&G.index===0){for(let Y=0;Y+1<G.length&&Y<q.length;Y++)Z[q[Y].replaceAll(/[\/:]/g,"")]=G[Y+1];H=X;break}}return H?{route:H,params:Z}:!1}},p6="<{state.page} params=state.params query=state.query/>";class D1{debug=!1;stylesheets=[];config={};store={};__root;i18n=new t0;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new n0,this.IUC=new r0;const[Z,H]=b0(this.i18n.lang),[X,q]=b0(J?.context||{});this.__setLang=H,this.__getLang=Z,this.__setContext=q,this.__getContext=X,this.register("if",_1),this.register("for",h1),this.register("async",y1),this.register("switch",v1),this.register("router",u1)}register(J,Z){return this.store[J]=Z,this}unregister(J){return delete this.store[J],this}has(J){return J in this.store}import(J){if(!this.has(J))throw new Error(`<${J}> component not found`);if(!this.store[J].declaration?.syntax&&!this.store[J].default)throw new Error(`Invalid <${J}> component`);return this.store[J]}render(J,Z,H){const{default:X,...q}=Z,W={debug:this.debug,prepath:"0",lips:this},G=new g0(J,X||"",{...q,input:H},W);return window.addEventListener("beforeunload",()=>{return this.dispose(),G.destroy(),null}),window.addEventListener("pagehide",(Y)=>{!Y.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),G}root(J,Z){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Z),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((H)=>new u0("root",{sheet:H,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Z){const H=this.__getContext();if(typeof J==="string"){const X={...H,[J]:Z};B0(H,X)&&this.__setContext(X)}else if(!Array.isArray(J)){const X={...H,...J};B0(H,X)&&this.__setContext(X)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;c0(()=>{const H=this.__getContext();if(!H)return;const X=Object.fromEntries(J.map((q)=>[q,H[q]]));X&&typeof Z==="function"&&Object.keys(X).length&&Z(X)})}useTranslator(J,Z){c0(()=>{const H=this.__getLang();if(!H)return;(J==="*"||Array.isArray(J)&&J.includes(H))&&typeof Z==="function"&&Z(H)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}var s6=function(){return{state:{count:0},handler:{onInput(){console.log("spec input --",this.input)}},default:`
2
- <fieldset on-click( () => self.emit('select') )>
3
- <h2 style="margin-top: 0">
4
- <span style="color: {input.active ? 'turquoise' : 'unset'}">{input.name}</span>
5
- <if( input.deprecated )><small style="color: orange"> (Deprecated)</small></if>
6
- </h2>
7
- <!-- <const ...static.vars></const> -->
8
-
9
- <ul>
10
- <li>Type: {input.type}</li>
11
- <li>Size: {input.size || '-'}</li>
12
- <li>Version: {input.version}</li>
13
- <li>
14
- Installed:
15
- <if( input.installed )>
16
- <span style="color: green">Yes</span>
17
- </if>
18
- <else><span style="color: gray">No</span></else>
19
- </li>
20
- </ul>
21
- </fieldset>
22
- `}};var o6=function(){y5.register("spec",s6());const J={specs:[{type:"Lib",name:"Request",version:"2.2.0",latest:"2.88.2",deprecated:!0},{type:"Framework",name:"Lips",version:"1.0.0",size:"86kb",installed:!0,active:!0},{type:"Framework",name:"React",version:"4.9.0",latest:"19.1.0",size:"156kb",installed:!1},{type:"App",name:"Chrome",version:"24.2.0",latest:"26.1.11",size:"132Mb",deprecated:!1},{type:"OS",name:"Ubuntu",size:"2.4Gb",deprecated:!0}],version:"10.10.1",selected:null},Z={onSelect(X){this.state.selected=X},getSpecs(X){return this.state.specs[X]},onInstall(X,q){this.state.specs[X].installed=!0,this.state.version=q},onUninstall(X,q){this.state.specs[X].installed=!1,this.state.version=null},onUpgrade(X,q=!1){if(this.state.version=this.state.specs[X].latest,q===!1)this.state.specs[X].version=this.state.specs[X].latest,this.state.specs[X].upgraded=!0}},H=`
23
- <ul style="list-type: none">
24
- <for [index] from=0 to=(state.specs.length - 1)>
25
- <li style="border: 4px solid {state.selected === index ? 'turquoise' : 'black'}; margin: 5px 0;">
26
- <let specs=self.getSpecs( index )/>
27
-
28
- <spec version=state.version
29
- ...specs
30
- active=(state.selected === index)
31
- on-select( onSelect, index )/>
32
-
33
- <div style="display: flex; align-items: center; justify-content: between;padding: 10px;">
34
- <let version=state.version active=(state.selected === index)/>
35
-
36
- <log('installed --', specs.installed )/>
37
- <if( !specs.installed )>
38
- <button on-click( onInstall, index, specs.version )>Install {specs.name +(specs.version ? '~'+ specs.version : '')}</button>
39
- </if>
40
- <else>
41
- <button on-click( onUninstall, index, specs.version )>Uninstall {specs.name +(specs.version ? '~'+ specs.version : '')}</button>
42
- </else>
43
-
44
- <if( active )>
45
- <small style="padding: 0 10px;">Selected</small>
46
- </if>
1
+ var U4=Object.create;var{defineProperty:g1,getPrototypeOf:K4,getOwnPropertyNames:O4}=Object;var j4=Object.prototype.hasOwnProperty;var t0=(J,Z,X)=>{X=J!=null?U4(K4(J)):{};const H=Z||!J||!J.__esModule?g1(X,"default",{value:J,enumerable:!0}):X;for(let G of O4(J))if(!j4.call(H,G))g1(H,G,{get:()=>J[G],enumerable:!0});return H};var I4=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var d0=(J,Z)=>{for(var X in Z)g1(J,X,{get:Z[X],enumerable:!0,configurable:!0,set:(H)=>Z[X]=()=>H})};var i0=I4((G5,q5)=>{(function(){var J=document,Z=window,X=J.documentElement,H=J.createElement.bind(J),G=H("div"),W=H("table"),B=H("tbody"),Y=H("tr"),M=Array.isArray,z=Array.prototype,j=z.concat,K=z.filter,A=z.indexOf,f=z.map,E=z.push,p=z.slice,X0=z.some,s=z.splice,d=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,u=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,o=/<.+>/,l=/^\w+$/;function J0(Q,q){var w=C(q);return!Q||!w&&!L(q)&&!b(q)?[]:!w&&u.test(Q)?q.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!w&&l.test(Q)?q.getElementsByTagName(Q):q.querySelectorAll(Q)}var m=function(){function Q(q,w){if(!q)return;if(I(q))return q;var O=q;if(S(q)){var N=w||J;if(O=d.test(q)&&L(N)?N.getElementById(q.slice(1).replace(/\\/g,"")):o.test(q)?s1(q):I(N)?N.find(q):S(N)?F(N).find(q):J0(q,N),!O)return}else if(_(q))return this.ready(q);if(O.nodeType||O===Z)O=[O];this.length=O.length;for(var $=0,y=this.length;$<y;$++)this[$]=O[$]}return Q.prototype.init=function(q,w){return new Q(q,w)},Q}(),U=m.prototype,F=U.init;if(F.fn=F.prototype=U,U.length=0,U.splice=s,typeof Symbol==="function")U[Symbol.iterator]=z[Symbol.iterator];function I(Q){return Q instanceof m}function R(Q){return!!Q&&Q===Q.window}function L(Q){return!!Q&&Q.nodeType===9}function C(Q){return!!Q&&Q.nodeType===11}function b(Q){return!!Q&&Q.nodeType===1}function v(Q){return!!Q&&Q.nodeType===3}function i(Q){return typeof Q==="boolean"}function _(Q){return typeof Q==="function"}function S(Q){return typeof Q==="string"}function P(Q){return Q===void 0}function k(Q){return Q===null}function T(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function h(Q){if(typeof Q!=="object"||Q===null)return!1;var q=Object.getPrototypeOf(Q);return q===null||q===Object.prototype}F.isWindow=R,F.isFunction=_,F.isArray=M,F.isNumeric=T,F.isPlainObject=h;function D(Q,q,w){if(w){var O=Q.length;while(O--)if(q.call(Q[O],O,Q[O])===!1)return Q}else if(h(Q)){var N=Object.keys(Q);for(var O=0,$=N.length;O<$;O++){var y=N[O];if(q.call(Q[y],y,Q[y])===!1)return Q}}else for(var O=0,$=Q.length;O<$;O++)if(q.call(Q[O],O,Q[O])===!1)return Q;return Q}F.each=D,U.each=function(Q){return D(this,Q)},U.empty=function(){return this.each(function(Q,q){while(q.firstChild)q.removeChild(q.firstChild)})};function x(){var Q=[];for(var q=0;q<arguments.length;q++)Q[q]=arguments[q];var w=i(Q[0])?Q.shift():!1,O=Q.shift(),N=Q.length;if(!O)return{};if(!N)return x(w,F,O);for(var $=0;$<N;$++){var y=Q[$];for(var n in y)if(w&&(M(y[n])||h(y[n]))){if(!O[n]||O[n].constructor!==y[n].constructor)O[n]=new y[n].constructor;x(w,O[n],y[n])}else O[n]=y[n]}return O}F.extend=x,U.extend=function(Q){return x(U,Q)};var V=/\S+/g;function g(Q){return S(Q)?Q.match(V)||[]:[]}U.toggleClass=function(Q,q){var w=g(Q),O=!P(q);return this.each(function(N,$){if(!b($))return;D(w,function(y,n){if(O)q?$.classList.add(n):$.classList.remove(n);else $.classList.toggle(n)})})},U.addClass=function(Q){return this.toggleClass(Q,!0)},U.removeAttr=function(Q){var q=g(Q);return this.each(function(w,O){if(!b(O))return;D(q,function(N,$){O.removeAttribute($)})})};function e(Q,q){if(!Q)return;if(S(Q)){if(arguments.length<2){if(!this[0]||!b(this[0]))return;var w=this[0].getAttribute(Q);return k(w)?void 0:w}if(P(q))return this;if(k(q))return this.removeAttr(Q);return this.each(function(N,$){if(!b($))return;$.setAttribute(Q,q)})}for(var O in Q)this.attr(O,Q[O]);return this}U.attr=e,U.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},U.hasClass=function(Q){return!!Q&&X0.call(this,function(q){return b(q)&&q.classList.contains(Q)})},U.get=function(Q){if(P(Q))return p.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},U.eq=function(Q){return F(this.get(Q))},U.first=function(){return this.eq(0)},U.last=function(){return this.eq(-1)};function t(Q){if(P(Q))return this.get().map(function(q){return b(q)||v(q)?q.textContent:""}).join("");return this.each(function(q,w){if(!b(w))return;w.textContent=Q})}U.text=t;function c(Q,q,w){if(!b(Q))return;var O=Z.getComputedStyle(Q,null);return w?O.getPropertyValue(q)||void 0:O[q]||Q.style[q]}function r(Q,q){return parseInt(c(Q,q),10)||0}function a(Q,q){return r(Q,"border".concat(q?"Left":"Top","Width"))+r(Q,"padding".concat(q?"Left":"Top"))+r(Q,"padding".concat(q?"Right":"Bottom"))+r(Q,"border".concat(q?"Right":"Bottom","Width"))}var Z0={};function F0(Q){if(Z0[Q])return Z0[Q];var q=H(Q);J.body.insertBefore(q,null);var w=c(q,"display");return J.body.removeChild(q),Z0[Q]=w!=="none"?w:"block"}function k0(Q){return c(Q,"display")==="none"}function c1(Q,q){var w=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!w&&!!q&&w.call(Q,q)}function r0(Q){return S(Q)?function(q,w){return c1(w,Q)}:_(Q)?Q:I(Q)?function(q,w){return Q.is(w)}:!Q?function(){return!1}:function(q,w){return w===Q}}U.filter=function(Q){var q=r0(Q);return F(K.call(this,function(w,O){return q.call(w,O,w)}))};function T0(Q,q){return!q?Q:Q.filter(q)}U.detach=function(Q){return T0(this,Q).each(function(q,w){if(w.parentNode)w.parentNode.removeChild(w)}),this};var u5=/^\s*<(\w+)[^>]*>/,m5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p1={"*":G,tr:B,td:Y,th:Y,thead:W,tbody:W,tfoot:W};function s1(Q){if(!S(Q))return[];if(m5.test(Q))return[H(RegExp.$1)];var q=u5.test(Q)&&RegExp.$1,w=p1[q]||p1["*"];return w.innerHTML=Q,F(w.childNodes).detach().get()}F.parseHTML=s1,U.has=function(Q){var q=S(Q)?function(w,O){return J0(Q,O).length}:function(w,O){return O.contains(Q)};return this.filter(q)},U.not=function(Q){var q=r0(Q);return this.filter(function(w,O){return(!S(Q)||b(O))&&!q.call(O,w,O)})};function N0(Q,q,w,O){var N=[],$=_(q),y=O&&r0(O);for(var n=0,j0=Q.length;n<j0;n++)if($){var G0=q(Q[n]);if(G0.length)E.apply(N,G0)}else{var w0=Q[n][q];while(w0!=null){if(O&&y(-1,w0))break;N.push(w0),w0=w?w0[q]:null}}return N}function o1(Q){if(Q.multiple&&Q.options)return N0(K.call(Q.options,function(q){return q.selected&&!q.disabled&&!q.parentNode.disabled}),"value");return Q.value||""}function d5(Q){if(!arguments.length)return this[0]&&o1(this[0]);return this.each(function(q,w){var O=w.multiple&&w.options;if(O||X5.test(w.type)){var N=M(Q)?f.call(Q,String):k(Q)?[]:[String(Q)];if(O)D(w.options,function($,y){y.selected=N.indexOf(y.value)>=0},!0);else w.checked=N.indexOf(w.value)>=0}else w.value=P(Q)||k(Q)?"":Q})}U.val=d5,U.is=function(Q){var q=r0(Q);return X0.call(this,function(w,O){return q.call(w,O,w)})},F.guid=1;function L0(Q){return Q.length>1?K.call(Q,function(q,w,O){return A.call(O,q)===w}):Q}F.unique=L0,U.add=function(Q,q){return F(L0(this.get().concat(F(Q,q).get())))},U.children=function(Q){return T0(F(L0(N0(this,function(q){return q.children}))),Q)},U.parent=function(Q){return T0(F(L0(N0(this,"parentNode"))),Q)},U.index=function(Q){var q=Q?F(Q)[0]:this[0],w=Q?this:F(q).parent().children();return A.call(w,q)},U.closest=function(Q){var q=this.filter(Q);if(q.length)return q;var w=this.parent();if(!w.length)return q;return w.closest(Q)},U.siblings=function(Q){return T0(F(L0(N0(this,function(q){return F(q).parent().children().not(q)}))),Q)},U.find=function(Q){return F(L0(N0(this,function(q){return J0(Q,q)})))};var i5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,c5=/^$|^module$|\/(java|ecma)script/i,p5=["type","src","nonce","noModule"];function s5(Q,q){var w=F(Q);w.filter("script").add(w.find("script")).each(function(O,N){if(c5.test(N.type)&&X.contains(N)){var $=H("script");$.text=N.textContent.replace(i5,""),D(p5,function(y,n){if(N[n])$[n]=N[n]}),q.head.insertBefore($,null),q.head.removeChild($)}})}function o5(Q,q,w,O,N){if(O)Q.insertBefore(q,w?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(q,Q);else Q.parentNode.insertBefore(q,w?Q:Q.nextSibling);if(N)s5(q,Q.ownerDocument)}function $0(Q,q,w,O,N,$,y,n){return D(Q,function(j0,G0){D(F(G0),function(w0,S0){D(F(q),function(I0,a0){var $1=w?S0:a0,A1=w?a0:S0,M0=w?w0:I0;o5($1,!M0?A1:A1.cloneNode(!0),O,N,!M0)},n)},y)},$),q}U.after=function(){return $0(arguments,this,!1,!1,!1,!0,!0)},U.append=function(){return $0(arguments,this,!1,!1,!0)};function l5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if(P(Q))return this;var q=/<script[\s>]/.test(Q);return this.each(function(w,O){if(!b(O))return;if(q)F(O).empty().append(Q);else O.innerHTML=Q})}U.html=l5,U.appendTo=function(Q){return $0(arguments,this,!0,!1,!0)},U.wrapInner=function(Q){return this.each(function(q,w){var O=F(w),N=O.contents();N.length?N.wrapAll(Q):O.append(Q)})},U.before=function(){return $0(arguments,this,!1,!0)},U.wrapAll=function(Q){var q=F(Q),w=q[0];while(w.children.length)w=w.firstElementChild;return this.first().before(q),this.appendTo(w)},U.wrap=function(Q){return this.each(function(q,w){var O=F(Q)[0];F(w).wrapAll(!q?O:O.cloneNode(!0))})},U.insertAfter=function(Q){return $0(arguments,this,!0,!1,!1,!1,!1,!0)},U.insertBefore=function(Q){return $0(arguments,this,!0,!0)},U.prepend=function(){return $0(arguments,this,!1,!0,!0,!0,!0)},U.prependTo=function(Q){return $0(arguments,this,!0,!0,!0,!1,!1,!0)},U.contents=function(){return F(L0(N0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},U.next=function(Q,q,w){return T0(F(L0(N0(this,"nextElementSibling",q,w))),Q)},U.nextAll=function(Q){return this.next(Q,!0)},U.nextUntil=function(Q,q){return this.next(q,!0,Q)},U.parents=function(Q,q){return T0(F(L0(N0(this,"parentElement",!0,q))),Q)},U.parentsUntil=function(Q,q){return this.parents(q,Q)},U.prev=function(Q,q,w){return T0(F(L0(N0(this,"previousElementSibling",q,w))),Q)},U.prevAll=function(Q){return this.prev(Q,!0)},U.prevUntil=function(Q,q){return this.prev(q,!0,Q)},U.map=function(Q){return F(j.apply([],f.call(this,function(q,w){return Q.call(q,w,q)})))},U.clone=function(){return this.map(function(Q,q){return q.cloneNode(!0)})},U.offsetParent=function(){return this.map(function(Q,q){var w=q.offsetParent;while(w&&c(w,"position")==="static")w=w.offsetParent;return w||X})},U.slice=function(Q,q){return F(p.call(this,Q,q))};var r5=/-([a-z])/g;function V1(Q){return Q.replace(r5,function(q,w){return w.toUpperCase()})}U.ready=function(Q){var q=function(){return setTimeout(Q,0,F)};if(J.readyState!=="loading")q();else J.addEventListener("DOMContentLoaded",q);return this},U.unwrap=function(){return this.parent().each(function(Q,q){if(q.tagName==="BODY")return;var w=F(q);w.replaceWith(w.children())}),this},U.offset=function(){var Q=this[0];if(!Q)return;var q=Q.getBoundingClientRect();return{top:q.top+Z.pageYOffset,left:q.left+Z.pageXOffset}},U.position=function(){var Q=this[0];if(!Q)return;var q=c(Q,"position")==="fixed",w=q?Q.getBoundingClientRect():this.offset();if(!q){var O=Q.ownerDocument,N=Q.offsetParent||O.documentElement;while((N===O.body||N===O.documentElement)&&c(N,"position")==="static")N=N.parentNode;if(N!==Q&&b(N)){var $=F(N).offset();w.top-=$.top+r(N,"borderTopWidth"),w.left-=$.left+r(N,"borderLeftWidth")}}return{top:w.top-r(Q,"marginTop"),left:w.left-r(Q,"marginLeft")}};var l1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};U.prop=function(Q,q){if(!Q)return;if(S(Q)){if(Q=l1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(O,N){N[Q]=q})}for(var w in Q)this.prop(w,Q[w]);return this},U.removeProp=function(Q){return this.each(function(q,w){delete w[l1[Q]||Q]})};var n5=/^--/;function N1(Q){return n5.test(Q)}var C1={},a5=G.style,t5=["webkit","moz","ms"];function e5(Q,q){if(q===void 0)q=N1(Q);if(q)return Q;if(!C1[Q]){var w=V1(Q),O="".concat(w[0].toUpperCase()).concat(w.slice(1)),N="".concat(w," ").concat(t5.join("".concat(O," "))).concat(O).split(" ");D(N,function($,y){if(y in a5)return C1[Q]=y,!1})}return C1[Q]}var J4={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function r1(Q,q,w){if(w===void 0)w=N1(Q);return!w&&!J4[Q]&&T(q)?"".concat(q,"px"):q}function Z4(Q,q){if(S(Q)){var w=N1(Q);if(Q=e5(Q,w),arguments.length<2)return this[0]&&c(this[0],Q,w);if(!Q)return this;return q=r1(Q,q,w),this.each(function(N,$){if(!b($))return;if(w)$.style.setProperty(Q,q);else $.style[Q]=q})}for(var O in Q)this.css(O,Q[O]);return this}U.css=Z4;function n1(Q,q){try{return Q(q)}catch(w){return q}}var W4=/^\s+|\s+$/;function a1(Q,q){var w=Q.dataset[q]||Q.dataset[V1(q)];if(W4.test(w))return w;return n1(JSON.parse,w)}function Q4(Q,q,w){w=n1(JSON.stringify,w),Q.dataset[V1(q)]=w}function X4(Q,q){if(!Q){if(!this[0])return;var w={};for(var O in this[0].dataset)w[O]=a1(this[0],O);return w}if(S(Q)){if(arguments.length<2)return this[0]&&a1(this[0],Q);if(P(q))return this;return this.each(function(N,$){Q4($,Q,q)})}for(var O in Q)this.data(O,Q[O]);return this}U.data=X4;function t1(Q,q){var w=Q.documentElement;return Math.max(Q.body["scroll".concat(q)],w["scroll".concat(q)],Q.body["offset".concat(q)],w["offset".concat(q)],w["client".concat(q)])}D([!0,!1],function(Q,q){D(["Width","Height"],function(w,O){var N="".concat(q?"outer":"inner").concat(O);U[N]=function($){if(!this[0])return;if(R(this[0]))return q?this[0]["inner".concat(O)]:this[0].document.documentElement["client".concat(O)];if(L(this[0]))return t1(this[0],O);return this[0]["".concat(q?"offset":"client").concat(O)]+($&&q?r(this[0],"margin".concat(w?"Top":"Left"))+r(this[0],"margin".concat(w?"Bottom":"Right")):0)}})}),D(["Width","Height"],function(Q,q){var w=q.toLowerCase();U[w]=function(O){if(!this[0])return P(O)?void 0:this;if(!arguments.length){if(R(this[0]))return this[0].document.documentElement["client".concat(q)];if(L(this[0]))return t1(this[0],q);return this[0].getBoundingClientRect()[w]-a(this[0],!Q)}var N=parseInt(O,10);return this.each(function($,y){if(!b(y))return;var n=c(y,"boxSizing");y.style[w]=r1(w,N+(n==="border-box"?a(y,!Q):0))})}});var e1="___cd";U.toggle=function(Q){return this.each(function(q,w){if(!b(w))return;var O=k0(w),N=P(Q)?O:Q;if(N){if(w.style.display=w[e1]||"",k0(w))w.style.display=F0(w.tagName)}else if(!O)w[e1]=c(w,"display"),w.style.display="none"})},U.hide=function(){return this.toggle(!1)},U.show=function(){return this.toggle(!0)};var J5="___ce",R1=".",P1={focus:"focusin",blur:"focusout"},Z5={mouseenter:"mouseover",mouseleave:"mouseout"},H4=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function E1(Q){return Z5[Q]||P1[Q]||Q}function T1(Q){var q=Q.split(R1);return[q[0],q.slice(1).sort()]}U.trigger=function(Q,q){if(S(Q)){var w=T1(Q),O=w[0],N=w[1],$=E1(O);if(!$)return this;var y=H4.test($)?"MouseEvents":"HTMLEvents";Q=J.createEvent(y),Q.initEvent($,!0,!0),Q.namespace=N.join(R1),Q.___ot=O}Q.___td=q;var n=Q.___ot in P1;return this.each(function(j0,G0){if(n&&_(G0[Q.___ot]))G0["___i".concat(Q.type)]=!0,G0[Q.___ot](),G0["___i".concat(Q.type)]=!1;G0.dispatchEvent(Q)})};function W5(Q){return Q[J5]=Q[J5]||{}}function G4(Q,q,w,O,N){var $=W5(Q);$[q]=$[q]||[],$[q].push([w,O,N]),Q.addEventListener(q,N)}function Q5(Q,q){return!q||!X0.call(q,function(w){return Q.indexOf(w)<0})}function n0(Q,q,w,O,N){var $=W5(Q);if(!q)for(q in $)n0(Q,q,w,O,N);else if($[q])$[q]=$[q].filter(function(y){var n=y[0],j0=y[1],G0=y[2];if(N&&G0.guid!==N.guid||!Q5(n,w)||O&&O!==j0)return!0;Q.removeEventListener(q,G0)})}U.off=function(Q,q,w){var O=this;if(P(Q))this.each(function($,y){if(!b(y)&&!L(y)&&!R(y))return;n0(y)});else if(!S(Q))for(var N in Q)this.off(N,Q[N]);else{if(_(q))w=q,q="";D(g(Q),function($,y){var n=T1(y),j0=n[0],G0=n[1],w0=E1(j0);O.each(function(S0,I0){if(!b(I0)&&!L(I0)&&!R(I0))return;n0(I0,w0,G0,q,w)})})}return this},U.remove=function(Q){return T0(this,Q).detach().off(),this},U.replaceWith=function(Q){return this.before(Q).remove()},U.replaceAll=function(Q){return F(Q).replaceWith(this),this};function q4(Q,q,w,O,N){var $=this;if(!S(Q)){for(var y in Q)this.on(y,q,w,Q[y],N);return this}if(!S(q))if(P(q)||k(q))q="";else if(P(w))w=q,q="";else O=w,w=q,q="";if(!_(O))O=w,w=void 0;if(!O)return this;return D(g(Q),function(n,j0){var G0=T1(j0),w0=G0[0],S0=G0[1],I0=E1(w0),a0=w0 in Z5,$1=w0 in P1;if(!I0)return;$.each(function(A1,M0){if(!b(M0)&&!L(M0)&&!R(M0))return;var S1=function(q0){if(q0.target["___i".concat(q0.type)])return q0.stopImmediatePropagation();if(q0.namespace&&!Q5(S0,q0.namespace.split(R1)))return;if(!q&&($1&&(q0.target!==M0||q0.___ot===I0)||a0&&q0.relatedTarget&&M0.contains(q0.relatedTarget)))return;var b1=M0;if(q){var f0=q0.target;while(!c1(f0,q)){if(f0===M0)return;if(f0=f0.parentNode,!f0)return}b1=f0}Object.defineProperty(q0,"currentTarget",{configurable:!0,get:function(){return b1}}),Object.defineProperty(q0,"delegateTarget",{configurable:!0,get:function(){return M0}}),Object.defineProperty(q0,"data",{configurable:!0,get:function(){return w}});var M4=O.call(b1,q0,q0.___td);if(N)n0(M0,I0,S0,q,S1);if(M4===!1)q0.preventDefault(),q0.stopPropagation()};S1.guid=O.guid=O.guid||F.guid++,G4(M0,I0,S0,q,S1)})}),this}U.on=q4;function B4(Q,q,w,O){return this.on(Q,q,w,O,!0)}U.one=B4;var z4=/\r?\n/g;function Y4(Q,q){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(q.replace(z4,"\r\n")))}var w4=/file|reset|submit|button|image/i,X5=/radio|checkbox/i;if(U.serialize=function(){var Q="";return this.each(function(q,w){D(w.elements||[w],function(O,N){if(N.disabled||!N.name||N.tagName==="FIELDSET"||w4.test(N.type)||X5.test(N.type)&&!N.checked)return;var $=o1(N);if(!P($)){var y=M($)?$:[$];D(y,function(n,j0){Q+=Y4(N.name,j0)})}})}),Q.slice(1)},typeof G5!=="undefined")q5.exports=F;else Z.cash=Z.$=F})()});class e0{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,Z){this.callbacks.set(J,Z)}unregister(J){this.callbacks.delete(J)}queue(J){if(!this.callbacks.has(J))return;if(this.pendingComponents.add(J),!this.isPending)this.isPending=!0,this.schedule()}schedule(){Promise.resolve().then(()=>this.process())}process(){const J=Array.from(this.pendingComponents);this.pendingComponents.clear(),this.isPending=!1,J.forEach((Z)=>{try{const 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 J1{subscriptions=new Map;tick=new e0;register(J,Z){this.subscriptions.set(J,Z),this.tick.register(J,Z)}unregister(J){this.subscriptions.delete(J),this.tick.unregister(J)}queueUpdate(J){this.tick.queue(J)}dispose(){this.subscriptions.clear(),this.tick.dispose()}prepareForPotentialUnload(){this.tick.clear(),this.subscriptions.forEach((J,Z)=>{this.subscriptions.set(Z,()=>{})})}proxyState(J,Z){const X=this,H=new WeakMap,G=(B)=>{if(typeof B.toJSON==="function")return B;if(B instanceof Map)B.forEach((M,z)=>B.set(z,W(M)));else if(Array.isArray(B))B.forEach((M,z)=>B[z]=W(M));else if(typeof B==="object")Object.entries(B).forEach(([M,z])=>B[M]=W(z));let Y=new Proxy(B,{get(M,z){if(z==="toJSON")return function(){const K=(A)=>{if(!A||typeof A!=="object")return A;if(H.has(A)){const f=H.get(A);if(f instanceof Map){const p={};return f.forEach((X0,s)=>p[typeof s==="object"?JSON.stringify(s):String(s)]=K(X0)),p}if(Array.isArray(f))return f.map((p)=>K(p));const E={};return Object.entries(f).forEach(([p,X0])=>E[p]=K(X0)),E}if(typeof A.toJSON==="function"&&!H.has(A))return A.toJSON();return A};return K(Y)};if(z==="reset")return function(){Y=null};const j=M[z];if(B instanceof Map&&typeof j==="function")return function(...K){const A=z.toString();if(A==="set"&&K.length>=2)K[1]=W(K[1]);const f=j.apply(M,K);return["set","delete","clear"].includes(A)&&X.queueUpdate(J),f};if(Array.isArray(B)&&typeof j==="function")return function(...K){const A=z.toString();if(["push","unshift"].includes(A))K=K.map((E)=>W(E));else if(A==="splice"&&K.length>2)K=[K[0],K[1],...K.slice(2).map((E)=>W(E))];const f=j.apply(M,K);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(A)&&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 K=M[z];return K.clear(),j.forEach((A,f)=>K.set(f,W(A))),X.queueUpdate(J),!0}return M[z]=W(j),X.queueUpdate(J),!0}});return H.set(Y,B),Y},W=(B)=>{if(!B)return B;return B instanceof Map||Array.isArray(B)||typeof B==="object"?G(B):B};return G(Z)}}class Z1{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,G)=>{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[G||"*"];return W1(Y,H)}if(typeof H.count==="string")H.count=Number(H.count);let W="*";if(H.count.toString()in X)W=H.count.toString();let B=X[W]||X["*"];if(typeof B==="object")B=B[G||"*"];return W1(B,H)}case"condition":{if(typeof X==="string"){console.warn("Condition format value cannot be a string");return}let W;for(let B in X)try{if(new Function("params",`with( params ){ return ${B}; }`)(H||{})){W=X[B];break}}catch(Y){console.warn(`Invalid <${Z}(${B})> condition expression`)}if(W===void 0)return;if(typeof W==="object")W=W[G||"*"];return W1(W,H)}case"variable":default:{const W=typeof X==="object"?X[G||"*"]:X;if(typeof W==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return W1(W,H)}}};class Q1{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 G=this.DICTIONARIES[X][J];J=G[H||"*"]||G["*"]}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,G]=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 H5(W.type,J,W.value,Z,G)}}var T5=t0(i0(),1);var X1="comm",H1="rule",G1="decl";var B5="@import";var z5="@namespace",Y5="@keyframes";var w5="@layer";function q1(J){return J.trim()}function h0(J,Z,X){return J.replace(Z,X)}function M5(J,Z,X){return J.indexOf(Z,X)}function C0(J,Z){return J.charCodeAt(Z)|0}function R0(J,Z,X){return J.slice(Z,X)}function z0(J){return J.length}function B1(J){return J.length}function _0(J,Z){return Z.push(J),J}var x1=Math.abs,c0=String.fromCharCode;function Y1(J,Z,X,H,G,W,B,Y){return{value:J,root:Z,parent:X,type:H,props:G,children:W,line:z1,column:y0,length:B,return:"",siblings:Y}}function K5(){return H0}function O5(){if(H0=K0>0?C0(u0,--K0):0,y0--,H0===10)y0=1,z1--;return H0}function O0(){if(H0=K0<U5?C0(u0,K0++):0,y0++,H0===10)y0=1,z1++;return H0}function P0(){return C0(u0,K0)}function p0(){return K0}function w1(J,Z){return R0(u0,J,Z)}function v0(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function j5(J){return z1=y0=1,U5=z0(u0=J),K0=0,[]}function I5(J){return u0="",J}function M1(J){return q1(w1(K0-1,k1(J===91?J+2:J===40?J+1:J)))}function D5(J){while(H0=P0())if(H0<33)O0();else break;return v0(J)>2||v0(H0)>3?"":" "}function F5(J,Z){while(--Z&&O0())if(H0<48||H0>102||H0>57&&H0<65||H0>70&&H0<97)break;return w1(J,p0()+(Z<6&&P0()==32&&O0()==32))}function k1(J){while(O0())switch(H0){case J:return K0;case 34:case 39:if(J!==34&&J!==39)k1(H0);break;case 40:if(J===41)k1(J);break;case 92:O0();break}return K0}function L5(J,Z){while(O0())if(J+H0===57)break;else if(J+H0===84&&P0()===47)break;return"/*"+w1(Z,K0-1)+"*"+c0(J===47?J:O0())}function V5(J){while(!v0(P0()))O0();return w1(J,K0)}var z1=1,y0=1,U5=0,K0=0,H0=0,u0="";function R5(J){return I5(U1("",null,null,null,[""],J=j5(J),0,[0],J))}function U1(J,Z,X,H,G,W,B,Y,M){var z=0,j=0,K=B,A=0,f=0,E=0,p=1,X0=1,s=1,d=0,u="",o=G,l=W,J0=H,m=u;while(X0)switch(E=d,d=O0()){case 40:if(E!=108&&C0(m,K-1)==58){if(M5(m+=h0(M1(d),"&","&\f"),"&\f",x1(z?Y[z-1]:0))!=-1)s=-1;break}case 34:case 39:case 91:m+=M1(d);break;case 9:case 10:case 13:case 32:m+=D5(E);break;case 92:m+=F5(p0()-1,7);continue;case 47:switch(P0()){case 42:case 47:if(_0(F4(L5(O0(),p0()),Z,X,M),M),(v0(E||1)==5||v0(P0()||1)==5)&&z0(m)&&R0(m,-1,void 0)!==" ")m+=" ";break;default:m+="/"}break;case 123*p:Y[z++]=z0(m)*s;case 125*p:case 59:case 0:switch(d){case 0:case 125:X0=0;case 59+j:if(s==-1)m=h0(m,/\f/g,"");if(f>0&&(z0(m)-K||p===0&&E===47))_0(f>32?C5(m+";",H,X,K-1,M):C5(h0(m," ","")+";",H,X,K-2,M),M);break;case 59:m+=";";default:if(_0(J0=N5(m,Z,X,z,j,G,Y,u,o=[],l=[],K,W),W),d===123)if(j===0)U1(m,Z,J0,J0,o,W,K,Y,l);else{switch(A){case 99:if(C0(m,3)===110)break;case 108:if(C0(m,2)===97)break;default:j=0;case 100:case 109:case 115:}if(j)U1(J,J0,J0,H&&_0(N5(J,J0,J0,0,0,G,Y,u,G,o=[],K,l),l),G,l,K,Y,H?o:l);else U1(m,J0,J0,J0,[""],l,0,Y,l)}}z=j=f=0,p=s=1,u=m="",K=B;break;case 58:K=1+z0(m),f=E;default:if(p<1){if(d==123)--p;else if(d==125&&p++==0&&O5()==125)continue}switch(m+=c0(d),d*p){case 38:s=j>0?1:(m+="\f",-1);break;case 44:Y[z++]=(z0(m)-1)*s,s=1;break;case 64:if(P0()===45)m+=M1(O0());A=P0(),j=K=z0(u=m+=V5(p0())),d++;break;case 45:if(E===45&&z0(m)==2)p=0}}return W}function N5(J,Z,X,H,G,W,B,Y,M,z,j,K){var A=G-1,f=G===0?W:[""],E=B1(f);for(var p=0,X0=0,s=0;p<H;++p)for(var d=0,u=R0(J,A+1,A=x1(X0=B[p])),o=J;d<E;++d)if(o=q1(X0>0?f[d]+" "+u:h0(u,/&\f/g,f[d])))M[s++]=o;return Y1(J,Z,X,G===0?H1:Y,M,z,j,K)}function F4(J,Z,X,H){return Y1(J,Z,X,X1,c0(K5()),R0(J,2,-2),0,H)}function C5(J,Z,X,H,G){return Y1(J,Z,X,G1,R0(J,0,H),R0(J,H+1,-1),H,G)}function K1(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 X1:return"";case Y5:return J.return=J.value+"{"+K1(J.children,H)+"}";case H1:if(!z0(J.value=J.props.join(",")))return""}return z0(X=K1(J.children,H))?J.return=J.value+"{"+X+"}":""}function E5(J){var Z=B1(J);return function(X,H,G,W){var B="";for(var Y=0;Y<Z;Y++)B+=J[Y](X,H,G,W)||"";return B}}class m0{nsp;settings;$head;constructor(J,Z){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=T5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return K1(R5(J),E5([P5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const 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 G=0;const W=this.$head.find(`style[${Z}]`);if(W.length)G=parseInt(W.attr("dindex"))+1,W.remove();return H.setAttribute("dindex",String(G)),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 O1{pending=new Map;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){const Z=J.priority??2;if(!this.pending.has(Z))this.pending.set(Z,new Set);if(this.pending.get(Z)?.add(J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}apply({dep:J,deppath:Z},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 G=this.component.FGUDMemory.get(H.nodepath);if(!G)return;const W=H.update(G.memo||{},X);if(W){if(typeof W.memo==="object")G.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,G)=>J.set(G,new Set(H))),this.pending.clear(),this.isPending=!1;const Z=(H)=>{const G=Array.from(H);this.component.metrics.trackBatch(G.length),this.metrics.batchCount++,this.metrics.lastBatchSize=G.length,this.metrics.updatesProcessed+=G.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),G.forEach((W)=>this.apply(W))},X=Array.from(J.keys()).sort((H,G)=>H-G);for(let H of X){const G=J.get(H);G&&G.size&&Z(G)}if(this.pending.size>0&&!this.isPending)this.isPending=!0,this.scheduleProcessing()}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class j1{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=(G)=>{if(typeof G.toJSON==="function")return G.toJSON();if(Array.isArray(G))return G.map(X);if(typeof G==="object")for(let W in G)G[W]=X(G[W]);return G},H=Z.map(X);this.__events[J]?.forEach((G)=>G(...H)),this.__once_events[J]?.forEach((G)=>G(...H)),delete this.__once_events[J]}}var f1=t0(i0(),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($5(J)&&$5(Z)){for(let B of J)if(!Z.has(B))return!0;return!1}const W=new WeakMap;for(let B of J){let Y=!1;if(typeof B!=="object"){if(Z.has(B))Y=!0}else for(let M of Z){if(typeof M!=="object")continue;if(!W.has(B))W.set(B,new WeakMap);const z=W.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(A5(J)&&A5(Z)){for(let[B,Y]of J)if(Z.get(B)!==Y)return!0;return!1}const W=new WeakMap;for(let[B,Y]of J){if(typeof B!=="object"){if(!Z.has(B))return!0;const 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,K]of Z){if(typeof j!=="object")continue;if(!W.has(B))W.set(B,new WeakMap);const A=W.get(B);if(A.has(j)){const[f,E]=A.get(j);if(f){M=!0,z=E;break}continue}if(!B0(B,j)){if(M=!0,z=typeof Y==="object"&&typeof K==="object"?!B0(Y,K):Y===K,A.set(j,[!0,z]),z)break}else A.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 W=0;W<J.length;W++){const B=J[W],Y=Z[W];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 G=X.length;for(let W=0;W<G;W++)if(X[W]!==H[W])return!0;for(let W=0;W<G;W++){const B=X[W],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 Y0(J,Z){if(J===Z)return!0;if(J==null||Z==null)return J===Z;const X=typeof J;if(X!==typeof Z)return!1;if(X!=="object"){if(X==="number"&&isNaN(J)&&isNaN(Z))return!0;return!1}if(J instanceof Date)return Z instanceof Date&&J.getTime()===Z.getTime();if(J instanceof RegExp)return Z instanceof RegExp&&J.source===Z.source&&J.flags===Z.flags;if(J instanceof Error)return Z instanceof Error&&J.name===Z.name&&J.message===Z.message&&(J.stack===Z.stack||!J.stack&&!Z.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(Z))return!1;if(J.byteLength!==Z.byteLength)return!1;const Y=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),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 G=Object.getPrototypeOf(J);if(G!==Object.getPrototypeOf(Z))return!1;const W=Object.getOwnPropertyNames(J),B=Object.getOwnPropertyNames(Z);if(W.length!==B.length)return!1;for(let Y of W){if(!Object.prototype.hasOwnProperty.call(Z,Y))return!1;if(!Y0(J[Y],Z[Y]))return!1}if(G!==null&&G!==Object.prototype){const Y=Object.getOwnPropertyNames(G),M=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(Y.length!==M.length)return!1;for(let z of Y){if(z==="constructor")continue;if(!Y0(G[z],Object.getPrototypeOf(Z)[z]))return!1}}return!0}function $5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function A5(J){for(let[Z,X]of J)if(typeof Z==="object"&&Z!==null||typeof X==="object"&&X!==null)return!1;return!0}function Q0(J,Z=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Z.has(J))return Z.get(J);if(J instanceof Date)return new Date(J.getTime());if(J instanceof RegExp)return new RegExp(J.source,J.flags);if(J instanceof Map){const G=new Map;return Z.set(J,G),J.forEach((W,B)=>G.set(Q0(B,Z),Q0(W,Z))),G}if(J instanceof Set){const G=new Set;return Z.set(J,G),J.forEach((W)=>G.add(Q0(W,Z))),G}if(Array.isArray(J)){const G=[];Z.set(J,G);for(let W=0;W<J.length;W++)G[W]=Q0(J[W],Z);return G}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 G of H)X[G]=Q0(J[G],Z);for(let G in J)if(Object.prototype.hasOwnProperty.call(J,G))X[G]=Q0(J[G],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(G,W,B){const Y=W.split(/\.|\[|\]/).filter(Boolean);let M=G;for(let z=0;z<Y.length;z++){const j=Y[z],K=!isNaN(Number(j)),A=z===Y.length-1,f=!isNaN(Number(Y[z+1]));if(A){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=Q0(J);try{for(let[G,W]of Object.entries(Z)){if(typeof G!=="string")throw new TypeError(`Invalid path: ${G}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(G))throw new Error(`Invalid path format: ${G}`);X(H,G,W)}}catch(G){throw new Error(`Failed to assign value: ${G.message}`)}return H}function D1(J){return JSON.parse(JSON.stringify(J))}var A0="i18n",E0="syn:",D0="fn:",b0="on-",U0=/^\.\.\./,I1=/^\[(.*?)\]$/,h1=/{\s*([^{}]+)\s*}/g,S5=["@html","@text","@format"],b5=["display","visibility","position","width","height"],g5=":n",_1=":pr",x5="m",k5="c",f5="x",s0="*",h5=100;f1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&f1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class F1{debug;initialStats={renderCount:0,elementCount:0,renderTime:0,avgRenderTime:0,maxRenderTime:0,componentCount:0,componentUpdateCount:0,partialCount:0,partialUpdateCount:0,memoryUsage:void 0,domOperations:0,domInsertsCount:0,domUpdatesCount:0,domRemovalsCount:0,i18nTrackCount:0,i18nUpdateCount:0,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(J=!1){if(this.debug=J,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const J=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");J.push({timestamp:Date.now(),metrics:{...this.stats}}),J.length>100&&J.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(J))}catch(J){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const J=performance.now()-this.renderStartTime;this.stats.renderTime=J,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,J),this.renderTimes.push(J),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((Z,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=Q0(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},G={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},W={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},B={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(J),console.table(Z),console.table(X),console.table(H),console.table(G),console.table(W),console.table(B),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return Q0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var W0=t0(i0(),1);var L4=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let X=J,H;while((H=Z.exec(J))!==null){const G=H[1],W=H.index+H[0].length;let B=1,Y=W;while(Y<J.length&&B>0){if(J[Y]==="(")B++;if(J[Y]===")")B--;Y++}if(B===0){const M=J.slice(W,Y-1).trim(),z=J.slice(0,H.index),j=`${b0}${G}="${M}"`,K=J.slice(Y);X=z+j+K,J=X,Z.lastIndex=z.length+j.length}}return X},V4=function(J){const Z=[];let H=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(G,W,B)=>{return Z.push(B),`<${W}##TAG_ATTRS_${Z.length-1}##>`});for(let G=0;G<Z.length;G++){const W=`##TAG_ATTRS_${G}##`,B=Z[G],Y=N4(B);H=H.replace(W,Y)}return H},N4=function(J){let Z="",X=0,H=!1,G="",W=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,G=M;else if(M===G)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(W,z).trim();if(j){const K=C4(j);Z+=" "+K}W=X+1}X++}return Z},C4=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===A0||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(D0)||X.startsWith(b0))return J;if(H.startsWith('"')&&H.endsWith('"')||H.startsWith("'")&&H.endsWith("'")){const G=H.substring(1,H.length-1);if(R4(G))return`:${X}="${G}"`;return J}else return`:${X}="${H}"`};function R4(J){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(J))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(J))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(J))return!0;if(J.includes("{")&&J.includes("}"))return!0;return!1}function y1(J){let Z=(J||"").trim().replace(/>\s*</g,"><").replace(/\s{2,}/g," ").replace(/[\r\n\t]/g,"").replace(/<([a-zA-Z0-9_-]+)([^>]*?)\s*\/>/g,"<$1$2></$1>").replace(/<\{([^}]+)\}\s*(.*?)(\/)>/g,(X,H,G)=>{return G.endsWith("<")?`<lips dtag="${H}" ${G}/lips>`:`<lips dtag="${H}" ${G}></lips>`}).replace(/(<>)([\s\S]*?)(<\/>)/g,'<lips fragment="true">$2</lips>').replace(/<if\(\s*(.*?)\s*\)>/g,'<if @by="$1">').replace(/<else-if\(\s*(.*?)\s*\)>/g,'<else-if @by="$1">').replace(/<switch\(\s*(.*?)\s*\)>/g,'<switch @by="$1">').replace(/<async await\(\s*(.*?)\s*\)>/g,`<async ${D0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(X)=>X.replace(/\s+/g,""));return Z=L4(Z),Z=V4(Z),Z}var P4=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},v5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function g0(J,Z={maxSize:100}){const X=new Set,H=[{value:J,timestamp:Date.now()}];let G=0;const W=()=>{const z=L1[L1.length-1];return z&&P4(z,X),H[G].value},B=()=>{const z=[...X];if(y5)for(let j of z)y5.add(j);else for(let j of z)j.execute()};return[W,(z,j)=>{if(Object.is(H[G].value,z))return;if(G<H.length-1)H.splice(G+1);if(H.push({value:z,timestamp:Date.now(),metadata:j}),H.length>Z.maxSize)H.shift(),G=Math.max(0,G-1);else G++;B()},{undo(){if(G>0)G--,B()},redo(){if(G<H.length-1)G++,B()},jumpTo(z){if(z>=0&&z<H.length&&z!==G)G=z,B()},getHistory(){return[...H]},getCurrentIndex(){return G},canUndo(){return G>0},canRedo(){return G<H.length-1},clear(){const z=H[0];H.length=0,H.push(z),G=0,B()}}]}function o0(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 x0 extends j1{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:G,_static:W,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__=y1(Z),this.__boundaries__=j.boundaries,this.declaration=z||{name:J},this.input=X||{},this.static=W||{},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 F1(this.debug),this.metrics.inc("componentCount"),this.UQS=new O1(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create"),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(),this.emit("component:input");this.__previous={state:Q0(this.state),input:Q0(this.input),context:Q0(this.context)};const[K,A]=g0(this.input),[f,E]=g0(this.state),[p,X0]=g0(this.context);this.__setInput=A,this.__setState=E,this.__getState=f,this.lips.IUC.register(this.__path__,()=>{B0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(G)&&G.length&&this.lips.useContext(G,(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=o0(()=>{const s=f(),d=this.input=K(),u=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||W0.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:Q0(d),state:Q0(s),context:Q0(u)};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=y1(J),X=W0.default(Z);if(!X.length)return;const H=this;X.each(function(){const G=W0.default(this),{argv:W,attrs:B}=H.__getAttributes__(G);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(!G.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");H.__macros.set(B.literals.name,{argv:W,$node:G})})}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 m0(this.__name__,Z)}get node(){if(!this.isRendered)throw new Error("node() is expected to be call after component get rendered");return this.$}get boundaries(){return this.__boundaries__}render(J,Z,X={},H,G){if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:H||new Map};const W=this,B=H||new Map,Y=[];this.metrics.startRender();let M=W0.default();function z(){return Q0(X)}function j(U,F=!1){const I=K(U,F);return W.__inpathCounter__++,W.__inpath__?`${W.__inpath__}/${I}`:`${J?J+"/":""}${I}`}function K(U,F=!1){let I="";switch(U){case"component":I=F?f5:k5;break;case"macro":I=x5;break}return I+W.__inpathCounter__}function A(U){return U!==null&&typeof U==="object"&&typeof U.mesh==="function"&&typeof U.update==="function"}function f(U){return U!==null&&typeof U==="object"&&typeof U.default&&typeof U.default==="string"}function E(U){if(!U.attr(":dtag")||U.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const F=U.attr(":dtag"),I=W.__evaluate__(F,X);if(A(I)||I===null)return d(U,F,I);else if(f(I))return u(U,{template:I});else return u(U,{name:I})}function p(U){const F=U.attr(":args"),I=j("log");if(!F)return;const R=z();if(W.__evaluate__(`console.log(${F})`,R),W.__isReactive__(F,R))W.__extractExpressionDeps__(F,R).forEach((C)=>W.__trackDep__(B,C,R,{nodetype:"log",nodepath:I,target:"argument",$fragment:null,update:(b)=>W.__evaluate__(`console.log(${F})`,b),syntax:!0}))}function X0(U){const F=j("var"),{attrs:I}=W.__getAttributes__(U);if(!I)return;Object.entries(I.literals).forEach(([R,L])=>{if(X[R]&&X[R].type==="const")throw new Error(`Cannot override <const ${R}=[value]/> variable`);X[R]={value:L,type:"let"}}),Object.entries(I.expressions).forEach(([R,L])=>{if(X[R]&&X[R].type==="const")throw new Error(`Cannot override <const ${R}=[value]/> variable`);if(X[R]={value:W.__evaluate__(L,X),type:"let"},W.__isReactive__(L,X)){const C=W.__extractExpressionDeps__(L,X),b=(v,i)=>{if(v[R]&&v[R].type==="const")throw new Error(`Cannot override <const ${R}=[value]/> variable`);if(I.map.beforeSpreadAttrs.includes(R))return;const _=W.__evaluate__(L,v);if(Y0(v[R].value,_))return;return v[R]={value:_,type:"let"},W.__updateVarDepNodes__(R,F,v),D1({memo:v})};C.forEach((v)=>W.__trackDep__(B,v,z(),{nodetype:"let",nodepath:F,deppath:`${F}.${R}`,target:"attr",$fragment:null,update:b,syntax:!0}))}}),W.metrics.inc("elementCount")}function s(U){const{attrs:F}=W.__getAttributes__(U);if(!F)return;Object.entries(F.literals).forEach(([I,R])=>{if(X[I]&&X[I].type==="const")throw new Error(`<const ${I}=[value]/> variable already defined`);if(!R)return;X[I]={value:R,type:"const"}}),Object.entries(F.expressions).forEach(([I,R])=>{if(X[I]&&X[I].type==="const")throw new Error(`<const ${I}=[value]/> variable already defined`);if(!R)return;X[I]={value:W.__evaluate__(R,X),type:"const"}}),W.metrics.inc("elementCount")}function d(U,F,I){const{attrs:R}=W.__getAttributes__(U),L=j("element"),C=W.__getBoundaries__(L),b={},v={};let i=z(),_=W0.default(C.start),S={},P=I;if(P){R.literals&&Object.entries(R.literals).forEach(([T,h])=>{b[T]=h,S[T]={type:"arg",value:h}}),R.expressions&&Object.entries(R.expressions).forEach(([T,h])=>{if(!P)return;if(U0.test(T))W.__evaluateSpreadAttr__(T,{memo:i,get keystore(){return v[T]},set keystore(D){if(!v[T])v[T]=[];v[T]=D},each:(D,x)=>{if(b[D]=x,!P?.argv.includes(D))return;S[D]={type:"arg",value:x}}});else{const D=h?W.__evaluate__(h,i):!0;if(b[T]=D,!P.argv.includes(T))return;S[T]={type:"arg",value:D}}}),i.__arguments__=b;const k=P.mesh(S);if(k&&k.length)_=_.add(k);R.expressions&&Object.entries(R.expressions).forEach(([T,h])=>{if(!P)return;if(U0.test(T)&&W.__isReactive__(T,i)){const D=W.__extractExpressionDeps__(T,i),x=(V,g)=>{if(!P)return;const e={};let t=[];if(W.__evaluateSpreadAttr__(T,{memo:V,get keystore(){return v[T]},set keystore(c){if(!v[T])v[T]=[];v[T]=c},each:(c,r)=>{if(R.map.afterSpreadAttrs.includes(c))return;if(!P?.argv.includes(c))return;if(Y0(r,V[c]?.value))return;S[c]=e[c]={value:r,type:"arg"},b[c]=r,t.push(c)},nullify:(c)=>{c.forEach((r)=>{e[r]={value:void 0,type:"arg"},delete b[r]}),t=c}}),t.length)P.argv.length&&W.__updateArgumentsDepNodes__(L,b),P.update(t,e,V,C)};D.forEach((V)=>W.__trackDep__(B,V,i,{nodetype:"dynamic",nodepath:L,deppath:`${L}.${T}`,target:"spread-attr",$fragment:null,boundaries:C,update:x}))}else if(P.argv.includes(T)&&W.__isReactive__(h,i)){const D=W.__extractExpressionDeps__(h,i),x=(V,g)=>{if(!P)return;if(R.map.beforeSpreadAttrs.includes(T))return;const e=h?W.__evaluate__(h,V):!0,t={type:"arg",value:e};if(S[T]=t,P.argv.length)b[T]=e,W.__updateArgumentsDepNodes__(L,b);P.update([T],{[T]:t},V,C)};D.forEach((V)=>W.__trackDep__(B,V,i,{nodetype:"dynamic",nodepath:L,deppath:`${L}.${T}`,target:"attr",$fragment:null,boundaries:C,update:x}))}})}if(W.__isReactive__(F,i)){const k=(h,D)=>{const x=W.__evaluate__(F,h);let V;if(f(x))V=u(U,{template:x}),W.__fillBoundaries__(V,C);else if(A(x)){if(Object.entries(S).forEach(([g,e])=>{if(typeof e==="function")return;b[g]=e.value}),P?.cleanup(C),P=x,P)P.argv.length&&W.__updateArgumentsDepNodes__(L,b),V=P.mesh(S),V?.length&&P.fill(V,C)}else if(P)P.cleanup(C),P=null};W.__extractExpressionDeps__(F,i).forEach((h)=>W.__trackDep__(B,h,{...i,...S},{nodetype:"dynamic",nodepath:L,deppath:`${L}.dtag`,target:"dtag",$fragment:null,boundaries:C,update:k}))}return _=_.add(C.end),_}function u(U,F){let I,R;if(F?.template)I=F.template,R=K("component",I.declaration?.syntax);else{if(R=F?.name||U.prop("tagName")?.toLowerCase(),!R)throw new Error("Invalid component");if(R===W.__name__)throw new Error("Render component within itself is forbidden");I=W.lips.import(R)}if(!I||!R)throw new Error(`<${R}> template not found`);const L=j("component",I.declaration?.syntax),C=W.__getBoundaries__(L),{argv:b,functions:v,attrs:i,events:_}=W.__getAttributes__(U),S={},P={};let k={},T=W0.default(C.start),h=W.PCC.get(L),D=z();i.literals&&Object.entries(i.literals).forEach(([V,g])=>{if(V=="key")return;k[V]=g}),v&&Object.entries(v).forEach(([V,g])=>{k[V]=W.__evaluateFunction__(g,[],D),I.declaration?.syntax?S[E0+D0+V]=g:S[D0+V]=g}),i.expressions&&Object.entries(i.expressions).forEach(([V,g])=>{if(V=="key")return;if(U0.test(V))W.__evaluateSpreadAttr__(V,{memo:D,get keystore(){return P[V]},set keystore(e){if(!P[V])P[V]=[];P[V]=e},each:(e,t)=>k[e]=t});else k[V]=g?W.__evaluate__(g,D):!0;I.declaration?.syntax?S[E0+V]=g:S[V]=g});const x=U.contents();if(x.length){if(k={...k,...W.__meshwire__({$node:U,fragmentPath:L,fragmentBoundaries:C,meshPath:null,scope:D,argv:b,xmlns:G,useAttributes:!0,declaration:I.declaration},S)},I.declaration){if(I.declaration.tags){let V;Object.entries(I.declaration?.tags).forEach(([g,{type:e,many:t,alts:c}])=>{switch(e){case"nexted":{let r=U.next(g);if(!r.length&&Array.isArray(c)&&V?.length&&V.is(c.join(",")))r=V.next(g);if(!r.length)return;if(t){k[g]=[];let a=0,Z0=!1;while(!Z0){if(k[g].push(W.__meshwire__({$node:r,meshPath:`${g}[${a}]`,fragmentPath:L,fragmentBoundaries:C,scope:D,argv:b,xmlns:G,useAttributes:!0,declaration:I.declaration},S)),!r.next(g).length){Z0=!0;break}r=V=r.next(g),a++}}else k[g]=W.__meshwire__({$node:r,meshPath:g,fragmentPath:L,fragmentBoundaries:C,scope:D,argv:b,xmlns:G,useAttributes:!0,declaration:I.declaration},S)}break;case"child":{const r=U.children(g);if(t)k[g]=[],r.each(function(a){const Z0=W0.default(this),{argv:F0}=W.__getAttributes__(Z0);k[g].push(W.__meshwire__({$node:Z0,meshPath:`${g}[${a}]`,fragmentPath:L,fragmentBoundaries:C,scope:D,argv:F0,xmlns:G,useAttributes:!0,declaration:I.declaration},S))});else if(U.children(g).first().length){const a=U.children(g).first(),{argv:Z0}=W.__getAttributes__(a);k[g]=W.__meshwire__({$node:a,meshPath:g,fragmentPath:L,fragmentBoundaries:C,scope:D,argv:Z0,xmlns:G,useAttributes:!0,declaration:I.declaration},S)}}break}})}else if(I.declaration.contents)k.__contents__=x}}if(h)h.setInput(Q0(k)),T=T.add(h.node);else{const{declaration:V,state:g,_static:e,handler:t,context:c,default:r,stylesheet:a}=I;h=new x0(R,r||"",{state:Q0(g),input:Q0(k),context:c,_static:Q0(e),handler:t,stylesheet:a,declaration:V},{debug:W.debug,lips:W.lips,prepath:L,boundaries:C}),T=T.add(h.node),!I.declaration?.syntax&&W.PCC.set(L,h)}return T=T.add(C.end),Object.entries(_).forEach(([V,g])=>{W.__attachEvent__({nodepath:L,element:h,_event:V,instruction:g,scope:D,get __dependencies__(){return B}})}),S&&Object.entries(S).forEach(([V,g])=>{let e=!1,t=!1;if(V.startsWith(E0))e=!0,V=V.replace(E0,"");if(V.startsWith(D0))t=!0,V=V.replace(D0,"");if(U0.test(V)){if(W.__isReactive__(V,D)){const c=(a)=>{const Z0={};W.__evaluateSpreadAttr__(V,{memo:a,get keystore(){return P[V]},set keystore(F0){if(!P[V])P[V]=[];P[V]=F0},each:(F0,k0)=>{if(i.map.afterSpreadAttrs.includes(F0))return;Z0[F0]=k0},nullify:(F0)=>F0.forEach((k0)=>Z0[k0]=void 0)}),h?.subInput(Z0,a)};W.__extractExpressionDeps__(V,D).forEach((a)=>W.__trackDep__(B,a,D,{nodetype:"component",nodepath:L,deppath:`${L}.${V}`,target:"spread-attr",$fragment:null,boundaries:C,update:c,syntax:e}))}}else if(W.__isReactive__(g,D)){const c=(a)=>{if(i.map.beforeSpreadAttrs.includes(V))return;const Z0=t?W.__evaluateFunction__(g,[],a):g?W.__evaluate__(g,a):!0;h?.subInput({[V]:Z0},a)};W.__extractExpressionDeps__(g,D).forEach((a)=>W.__trackDep__(B,a,D,{nodetype:"component",nodepath:L,deppath:`${L}.${V}`,target:"attr",$fragment:null,boundaries:C,update:c,syntax:e}))}}),W.metrics.inc("componentCount"),T}function o(U){const F=U.prop("tagName")?.toLowerCase();if(!F)throw new Error("Invalid macro rendering call");const I=W.__macros.get(F);if(!I)throw new Error("Macro component not found");const R=j("macro"),L=W.__getBoundaries__(R),{attrs:C}=W.__getAttributes__(U),b={},v=z(),i={},_={};C.literals&&Object.entries(C.literals).forEach(([D,x])=>{i[D]=x,_[D]={value:x,type:"arg"}});const S={};C.expressions&&Object.entries(C.expressions).forEach(([D,x])=>{if(U0.test(D))W.__evaluateSpreadAttr__(D,{memo:v,get keystore(){return S[D]},set keystore(V){if(!S[D])S[D]=[];S[D]=V},each:(V,g)=>{if(i[V]=g,I.argv.includes(V))_[V]={value:g,type:"arg"}}}),b[D]=x;else{const V=x?W.__evaluate__(x,v):!0;if(i[D]=V,I.argv.includes(D))_[D]={value:V,type:"arg"},b[D]=x}I.argv.forEach((V)=>{if(_[V]!==void 0)return;_[V]={value:!1,type:"arg"}})}),_.__arguments__=i;let P=W0.default(L.start);const k={$node:I.$node,meshPath:null,fragmentPath:R,fragmentBoundaries:L,argv:I.argv,scope:v,xmlns:G,useAttributes:!0},T=W.__meshwire__(k,b),h=T.renderer.mesh(_,v);return P=P.add(h),b&&Object.entries(b).forEach(([D,x])=>{let V=!1;if(new RegExp(`^${E0}`).test(D))V=!0,D=D.replace(E0,"");if(U0.test(D)){if(!W.__isReactive__(D,v))return;const g=W.__extractExpressionDeps__(D,v),e=(t)=>{const c={};let r=[];if(W.__evaluateSpreadAttr__(D,{memo:t,get keystore(){return S[D]},set keystore(a){if(!S[D])S[D]=[];S[D]=a},each:(a,Z0)=>{if(C.map.afterSpreadAttrs.includes(a))return;if(Y0(Z0,t[a]?.value))return;c[a]={value:Z0,type:"arg"},i[a]=Z0,r.push(a)},nullify:(a)=>{a.forEach((Z0)=>{c[Z0]={value:void 0,type:"arg"},delete i[Z0]}),r=a}}),r.length)W.__updateArgumentsDepNodes__(R,i),T.renderer.update(r,c,t);return D1({memo:{...t,...c}})};g.forEach((t)=>W.__trackDep__(B,t,{...v,..._},{nodetype:"macro",nodepath:R,deppath:`${R}.${D}`,target:"spread-attr",$fragment:null,boundaries:L,update:e,syntax:V}))}else if(W.__isReactive__(x,v)){const g=W.__extractExpressionDeps__(x,v),e=(t)=>{if(C.map.beforeSpreadAttrs.includes(D))return;const c=x?W.__evaluate__(x,t):!0;return i[D]=c,W.__updateArgumentsDepNodes__(R,i),T.renderer.update([D],{[D]:{value:c,type:"arg"}},t),D1({memo:t})};g.forEach((t)=>W.__trackDep__(B,t,{...v,..._},{nodetype:"macro",nodepath:R,deppath:`${R}.${D}`,target:"attr",$fragment:null,boundaries:L,update:e,syntax:V}))}}),P=P.add(L.end),W.metrics.inc("elementCount"),P}function l(U){if(!U.length||!U.prop("tagName"))return U;const F=U.is("svg")||G,I=F?W0.default(document.createElementNS("http://www.w3.org/2000/svg",U.prop("tagName").toLowerCase())):W0.default(`<${U.prop("tagName").toLowerCase()}/>`),R=U.contents(),L=j("element"),C=z();R.length&&I.append(W.__withPath__(L,()=>W.render(L+g5,R,C,B,F).$log));const{attrs:b,events:v}=W.__getAttributes__(U);b.literals&&Object.entries(b.literals).forEach(([_,S])=>{if(_===A0)return;const P=U.is(`[${A0}]`)&&["title","placeholder"].includes(_);I.attr(_,P?W.lips.i18n.translate(S).text:S);const k=(T)=>{I.attr(_,P?W.lips.i18n.translate(S).text:S),P&&W.__trackTranslationDep__(T,{nodetype:"element",nodepath:L,deppath:`${L}.${_}`,target:"attr",$fragment:I,update:k})};P&&W.__trackTranslationDep__(C,{nodetype:"element",nodepath:L,deppath:`${L}.${_}`,target:"attr",$fragment:I,update:k})});const i=(_,S=!1)=>{_&&Object.entries(_).forEach(([P,k])=>{switch(P){case"@html":{const T=(h)=>{I.html(W.__evaluate__(k,h))};if(T(C),S&&W.__isReactive__(k,C))W.__extractExpressionDeps__(k,C).forEach((D)=>W.__trackDep__(B,D,C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:I,update:T}))}break;case"@text":{const T=U.is(`[${A0}]`),h=(D)=>{I.text(W.__evaluate__(k,D,{translate:T})),T&&W.__trackTranslationDep__(D,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:I,update:h})};if(h(C),S&&W.__isReactive__(k,C))W.__extractExpressionDeps__(k,C).forEach((x)=>W.__trackDep__(B,x,C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:I,update:h}));T&&W.__trackTranslationDep__(C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:I,update:h})}break;case"@format":{const[T,h]=k.split(",").map((x)=>x.trim());if(!T)throw new Error("Invalid @format reference");if(!h)throw new Error("Invalid @format parameters");const D=(x)=>{const V=W.__evaluate__(`!${h.trim()}`,x);if(typeof V!=="object")throw new Error("Invalid @format parameters");const g=W.lips.i18n.format(T,V);g!==void 0&&I.text(g),W.__trackTranslationDep__(x,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:I,update:D})};D(C),W.__extractExpressionDeps__(h,C).forEach((x)=>W.__trackDep__(B,x,C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"meta-attr",$fragment:I,update:D}))}break;case"style":if(S&&W.__isReactive__(k,C)){const T=(D)=>{const x=W.__evaluate__(k,D);if(typeof x==="object"){let V="";Object.entries(x).forEach(([g,e])=>V+=`${g}:${e};`),V.length&&I.attr("style",V)}else I.attr("style",x)};T(C),W.__extractExpressionDeps__(k,C).forEach((D)=>W.__trackDep__(B,D,C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"attr",$fragment:I,update:T}))}else I.attr("style",k);break;default:{const T=U.is(`[${A0}]`)&&["title","placeholder"].includes(P),h=(D)=>{const x=k&&W.__isReactive__(k,C)?W.__evaluate__(k,D,{translate:T}):k!==void 0?k:!0;if(x===void 0||x===!1)I.removeAttr(P);else I.attr(P,x),T&&W.__trackTranslationDep__(D,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"attr",$fragment:I,update:h})};if(h(C),S&&W.__isReactive__(k,C))W.__extractExpressionDeps__(k,C).forEach((x)=>W.__trackDep__(B,x,C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"attr",$fragment:I,update:h}));T&&W.__trackTranslationDep__(C,{nodetype:"element",nodepath:L,deppath:`${L}.${P}`,target:"attr",$fragment:I,update:h})}}})};return b.expressions&&Object.keys(b.expressions).forEach((_)=>{if(!U0.test(_))return;let S=[];const P=(k,T,h=!1)=>{const D={};W.__evaluateSpreadAttr__(_,{memo:k,get keystore(){return S},set keystore(x){S=x},each:(x,V)=>{if(!h&&b.map.afterSpreadAttrs.includes(x))return;D[x]=V},nullify:(x)=>x.forEach((V)=>I.removeAttr(V))}),Object.keys(D).length&&i(D)};if(delete b.expressions[_],P(C,"",!0),_&&W.__isReactive__(_,C))W.__extractExpressionDeps__(_,C).forEach((T)=>W.__trackDep__(B,T,C,{nodetype:"element",nodepath:L,deppath:`${L}.${_}`,target:"spread-attr",$fragment:I,update:P}))}),i(b.expressions,!0),v&&Object.entries(v).forEach(([_,S])=>{Y.push({nodepath:L,element:I,_event:_,instruction:S,scope:C,get __dependencies__(){return B}})}),W.metrics.inc("elementCount"),W.metrics.inc("domInsertsCount"),I}function J0(U){const F=U.text(),I=z(),R=j("element"),L=U.parent().is(`[${A0}]`),C=W0.default(document.createTextNode(W.__interpolate__(F,I,L))),b=(v)=>{const i=W.__interpolate__(F,v,L);if(!C[0])return;C[0].textContent=i,L&&W.__trackTranslationDep__(v,{nodetype:"text",nodepath:R,target:"value",$fragment:C,update:b})};if(F&&W.__isReactive__(F,I))W.__extractTextDeps__(F,I).forEach((i)=>W.__trackDep__(B,i,I,{nodetype:"text",nodepath:R,deppath:`${R}.${i}`,target:"value",$fragment:C,update:b}));return L&&W.__trackTranslationDep__(I,{nodetype:"text",nodepath:R,target:"value",$fragment:C,update:b}),W.metrics.inc("elementCount"),W.metrics.inc("domInsertsCount"),C}function m(U){if(U.get(0)?.nodeType===Node.COMMENT_NODE)return U;if(U.get(0)?.nodeType===Node.TEXT_NODE)return J0(U);if(U.is("let"))return X0(U);else if(U.is("const"))return s(U);else if(U.is("lips")&&U.attr(":dtag"))return E(U);else if(U.is("log"))return p(U);else if(W.__macros.has(U.prop("tagName")?.toLowerCase()))return o(U);else if(U.is("if, for, switch, async")||W.lips.has(U.prop("tagName")?.toLowerCase()))return u(U);else if(U.is("else-if, else"))return;return l(U)}try{this.__renderDepth__++,Z=!Z&&W0.default(this.__template__).length>1?W0.default("<template>").html(this.__template__).contents():Z||W0.default(this.__template__),Z.each(function(){const U=m(W0.default(this));if(U)M=M.add(U)}),Y.forEach(this.__attachEvent__.bind(this)),W.metrics.inc("renderCount")}catch(U){console.error("Rendering Failed --",U),W.metrics.trackError(U)}finally{if(this.__renderDepth__--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth__===0)this.__inpath__="",this.__inpathCounter__=0}return{$log: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)=>{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:G,fragmentPath:W,fragmentBoundaries:B,argv:Y,xmlns:M,declaration:z,useAttributes:j}=J;let K;const A=new Map,f=W+_1,E=(d,u,o)=>{if(K=H.contents(),!K?.length)return null;u=u||J.scope;const l=f+(o||""),{$log:J0,dependencies:m,events:U}=X.__withPath__(l,()=>{return X.render(l,K,{...u,...d},void 0,M)}),F=o||s0;return!A.has(F)&&A.set(F,new Set),A.get(F)?.add(l),m?.forEach((I,R)=>{!X.FGUD?.has(R)&&X.FGUD.set(R,new Map),I.forEach((L,C)=>{if(L.garbage)return;L.partial?.length?L.partial.push(l):L.partial=[l],X.FGUD.get(R)?.set(C,L)})}),X.metrics.inc("partialCount"),J0},p=(d,u,o,l,J0)=>{if(!A.get(J0||s0)?.size)return;o=o||J.scope,l=l||B,X.metrics.startRender();const m=Array.from(A.get(J0||s0)||[]);d.forEach((U)=>{const F=X.FGUD.get(U);if(!F)return;F.forEach((I)=>{const R=m.find((b)=>{return I.partial?.find((v)=>b==v||X.__hasSamePathParent__(v,b))});if(!I.partial||!R)return;const L=I.deppath||I.nodepath,C=this.FGUDMemory.get(I.nodepath);if(I.garbage||l?.start&&!document.contains(l.start)){F.delete(L),X.__unbindMemo__(I);return}if(!C){console.warn(`unexpected occurence: <${L}> has no memo`);return}if(C.memo?.[U]&&u?.[U]&&!Y0(C.memo[U],u[U]))C.memo={...o,...C.memo,...u};X.UQS.queue({dep:U,deppath:L,priority:I.priority}),X.metrics.inc("dependencyUpdateCount")}),!F.size&&X.FGUD.delete(U)}),X.metrics.inc("partialUpdateCount"),X.metrics.endRender()},X0=(d,u)=>{if(X.FGUD.forEach((o,l)=>{o.forEach((J0,m)=>{if(!X.__hasSamePathParent__(m,f+(u||"")))return;X.__unbindMemo__(J0),J0.garbage=!0}),!o.size&&X.FGUD.delete(l)}),A.delete(typeof u==="string"&&u||s0),d=d||B,X.__emptyBoundaries__(d),u)d.start.remove(),d.end.remove()},s={renderer:{path:G,argv:Y,mesh:E,update:p,cleanup:X0,fill(d,u){X.__fillBoundaries__(d,u||B)},demarcate(d,u){const o=X.__getBoundaries__(f+(u||""));let l=W0.default(o.start);return l=l.add(d),l=l.add(o.end),{$partial:l,boundaries:o}}}};if(j&&G){const{attrs:d}=X.__getAttributes__(H);d.literals&&Object.entries(d.literals).forEach(([u,o])=>s[u]=o),d.expressions&&Object.entries(d.expressions).forEach(([u,o])=>{if(U0.test(u)){let l=[];X.__evaluateSpreadAttr__(u,{memo:J.scope,get keystore(){return l},set keystore(J0){l=J0},each:(J0,m)=>s[J0]=m}),Z[`${z?.syntax?E0:""}${G}.${u}`]=o}else s[u]=o?X.__evaluate__(o,J.scope):!0,Z[`${z?.syntax?E0:""}${G}.${u}`]=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;W0.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&&W0.default(Z.start).after(J)}__getAttributes__(J){const Z=J.attrs(),X={},H={},G={literals:{},expressions:{},map:{explicitAttrs:[],spreadAttrs:[],beforeSpreadAttrs:[],afterSpreadAttrs:[],metaAttrs:[]}},W=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(D0)||M.startsWith(b0)||U0.test(M)||I1.test(M))if(I1.test(M)){const[j,K]=M.match(I1)||[];B=K.split(",")}else if(M.startsWith(b0))X[M.replace(b0,"")]=z;else if(M.startsWith(D0))H[M.replace(D0,"")]=z;else{if(M.startsWith(":"))M=M.slice(1,M.length);if(W)if(U0.test(M))G.map.spreadAttrs.push(M),Y=!0;else G.map.explicitAttrs.push(M),!Y?G.map.beforeSpreadAttrs.push(M):G.map.afterSpreadAttrs.push(M);G.expressions[M]=z||""}else if(G.literals[M]=z,W)G.map.explicitAttrs.push(M),!Y?G.map.beforeSpreadAttrs.push(M):G.map.afterSpreadAttrs.push(M)}),{argv:B,events:X,functions:H,attrs:G}}__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+_1}`)}__evaluate__(J,Z,X){J=typeof J==="string"?J.trim():J;try{const H=(G)=>{const W=this.state.toJSON(),B=(M,...z)=>{try{return M(...z)}catch(j){!X?.mute&&console.error("Eval error --",j);return}};let Y=`return ${G};`;if(Z){let M={},z;for(let K in Z){if(K==="__arguments__")continue;M[K]=Z[K].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,W,this.static,this.context,M||{},z)}else{const M=new Function("self","input","state","static","context",Y);return B(M,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(h1,(G,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,...G]=J.split(/\s*,\s*/),W;const B=this.__evaluate__(H,X,{mute:!0});if(typeof B==="function")W=B;else{if(typeof this[H]!=="function")throw new Error(`Undefined <${H}> handler method`);W=this[H].bind(this)}if(typeof W!=="function")throw new Error(`Expected <${H}> to be a function or handler method`);let Y=G.map((M)=>this.__evaluate__(M,X));if(Z.length)Y=[...Y,...Z];return W(...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(h1,(H,G)=>this.__evaluate__(G,Z)),X)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J){const{element:Z,nodepath:X,_event:H,instruction:G,scope:W,__dependencies__:B}=J;let Y=W;if(Z.on(H,(...M)=>this.__evaluateFunction__(G,M,Y)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(G,W))this.__extractExpressionDeps__(G,W).forEach((z)=>this.__trackDep__(B,z,W||{},{nodetype:"event",nodepath:X,deppath:`${X}.${H}`,target:"event-handler",$fragment:!(Z instanceof x0)?Z:null,boundaries:Z instanceof x0?Z.__boundaries__:void 0,update:(j)=>{Y=j}}))}__detachEvent__({element:J,nodepath:Z,_event:X,instruction:H,scope:G,__dependencies__:W}){if(J.off(X),this.__isReactive__(H,G)){const B=this.__extractExpressionDeps__(H,G),Y=`${Z}.${X}`;B.forEach((M)=>{W.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((G)=>{const W=G.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(W,Z).forEach((Y)=>X.add(Y))}),Array.from(X)}__extractExpressionDeps__(J,Z){const X=/\b(state|input|context|arguments)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,H=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g,G=/\b(arguments)((?:\.[a-zA-Z_]\w*)+)?(?=\[|\.|$|\s|;|,|\))/g;let W=[...Array.from(J.matchAll(X)),...Array.from(J.matchAll(H)),...Array.from(J.matchAll(G))];if(Z&&Object.keys(Z).length){const B=new RegExp(`\\b(?<!\\.)(${Object.keys(Z).join("|")})`,"g"),Y=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");W=[...W,...Array.from(J.matchAll(B)),...Array.from(J.matchAll(Y))]}return[...new Set(W.map((B)=>B[0]))]}__isReactive__(J,Z){if(/(self|state|input|context|arguments)(\.[\w.]+)?/.test(J))return!0;if(Z&&Object.keys(Z).length&&new RegExp(Object.keys(Z).join("|")).test(J))return!0;return!1}__bindMemo__(J,Z){const X=Z.deppath||Z.nodepath,H=this.FGUDMemory.get(Z.nodepath);if(H)H.tracks.set(X,Z.priority||2),H.memo=J,this.FGUDMemory.set(Z.nodepath,H);else{const G=new Map;G.set(X,Z.priority),this.FGUDMemory.set(Z.nodepath,{tracks:G,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)=>b5.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 G=H.deppath||H.nodepath;H.level=G.split(/\//g).length,H.priority=H.level*h5+H.priority,!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(G,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),G=this.__valueDep__(X[J],Z);return!Y0(H,G)}__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((G)=>{try{const W=G.deppath||G.nodepath;if(G.garbage||G.boundaries?.start&&!document.contains(G.boundaries.start)||G.$fragment!==null&&!G.$fragment.closest("body").length){J.delete(W),this.__unbindMemo__(G);return}this.UQS.queue({dep:Z,deppath:W,priority:G.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,G)=>{if(!H.haslet||!this.__hasSamePathParent__(G,this.__getPathParent__(Z)))return;const W=H.deppath||H.nodepath,B=this.FGUDMemory.get(H.nodepath);if(!B){console.warn(`unexpected occurence: <${W}> has no memo`);return}B.memo={...B.memo,...X},this.UQS.queue({dep:J,deppath:W,priority:H.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateArgumentsDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender();const X="arguments";this.FGUD.get(X)?.forEach((H,G)=>{if(!this.__hasSamePathParent__(G,J))return;const W=H.deppath||H.nodepath,B=this.FGUDMemory.get(H.nodepath);if(!B){console.warn(`unexpected occurence: <${W}> has no memo`);return}B.memo.__arguments__=Z,this.UQS.queue({dep:X,deppath:W,priority:H.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Z)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Z);return}const X=this.FGUDMemory.get(J.nodepath);if(!X){console.warn(`unexpected occurence: <${J.deppath||J.nodepath}> has no memo`);return}J.update(X.memo,"i18n-partial-updator"),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?W0.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?W0.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?W0.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var v1={};d0(v1,{handler:()=>{{return $4}},declaration:()=>{{return E4}},_static:()=>{{return T4}}});var E4={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},T4={initialized:!1,prevRenderer:null},$4={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,G;if(Array.isArray(J["else-if"])&&J["else-if"].length)for(let W of J["else-if"]){if(!W.by)continue;if(G=W.renderer.mesh({},Z),this.static.prevRenderer=W.renderer,!G?.length)return;if(X)return G;G?.length&&W.renderer.fill(G),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 u1={};d0(u1,{handler:()=>{{return b4}},declaration:()=>{{return A4}},_static:()=>{{return S4}}});var V0=t0(i0(),1);var A4={name:"for",syntax:!0},S4={lastIn:null,argvlist:null,initialized:!1,prevRenderer:null,processingBatch:!1},b4={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:G,to:W}=J;if(H===void 0&&G===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(G!==void 0)return this.asFromTo(J.renderer,G,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 G=`[${H}]`,W=J.mesh(X,Z,G);if(!W)return;const{boundaries:B,$partial:Y}=J.demarcate(W,G);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,G){if(Z=parseFloat(String(Z)),X==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");X=parseFloat(String(X));const W=Z<X,B=Math.abs(X-Z)+1;if(Array.isArray(this.static.argvlist)){const[M]=J.argv;if(M){let z=Z;if(this.static.argvlist.length===B){for(let K=0;K<this.static.argvlist.length;K++)this.static.argvlist[K].argvalues[M].value!==z&&this.updateItem(J,H,{[M]:{value:z,type:"arg"}},K),z=W?z+1:z-1;return}const j=Math.min(this.static.argvlist.length,B);for(let K=0;K<j;K++)this.updateItem(J,H,{[M]:{value:K,type:"arg"}},K);if(B>this.static.argvlist.length)for(let K=this.static.argvlist.length;K<B;K++){const A={[M]:{value:K,type:"arg"}};this.boundaries&&V0.default(this.boundaries.end).before(this.addItem(J,H,A,K))}else if(B<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=B;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let Y=V0.default();for(let M=Z;W?M<=X:M>=X;W?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(G)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++)!Y0(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&&V0.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 G=V0.default(),W=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:W,type:"arg"};G=G.add(this.addItem(J,X,Y,W)),W++}if(!G?.length)return;if(H)return G;J.fill(G)},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 K=0;K<this.static.argvlist.length;K++)!Y0(this.static.argvlist[K].argvalues[B].value,z[K][0])||!Y0(this.static.argvlist[K].argvalues[Y].value,z[K][1])&&this.updateItem(J,X,{[B]:{value:z[K][0],type:"arg"},[Y]:{value:z[K][1],type:"arg"},[M]:{value:K,type:"arg"}},K);return}const j=Math.min(this.static.argvlist.length,z.length);for(let K=0;K<j;K++)this.updateItem(J,X,{[B]:{value:z[K][0],type:"arg"},[Y]:{value:z[K][1],type:"arg"},[M]:{value:K,type:"arg"}},K);if(z.length>this.static.argvlist.length)for(let K=this.static.argvlist.length;K<z.length;K++){const A={[B]:{value:z[K][0],type:"arg"},[Y]:{value:z[K][1],type:"arg"},[M]:{value:K,type:"arg"}};this.boundaries&&V0.default(this.boundaries.end).before(this.addItem(J,X,A,K))}else if(z.length<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=z.length;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let G=V0.default(),W=0;for(let[B,Y]of Z){const M={},[z,j,K]=J.argv;if(z)M[z]={value:B,type:"arg"};if(j)M[j]={value:Y,type:"arg"};if(K)M[K]={value:W,type:"arg"};G=G.add(this.addItem(J,X,M,W)),W++}if(!G?.length)return;if(H)return G;J.fill(G)},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 K=0;K<this.static.argvlist.length;K++)!Y0(this.static.argvlist[K].argvalues[B].value,z[K][0])||!Y0(this.static.argvlist[K].argvalues[Y].value,z[K][1])&&this.updateItem(J,X,{[B]:{value:z[K][0],type:"arg"},[Y]:{value:z[K][1],type:"arg"},[M]:{value:K,type:"arg"}},K);return}const j=Math.min(this.static.argvlist.length,z.length);for(let K=0;K<j;K++)this.updateItem(J,X,{[B]:{value:z[K][0],type:"arg"},[Y]:{value:z[K][1],type:"arg"},[M]:{value:K,type:"arg"}},K);if(z.length>this.static.argvlist.length){let K=V0.default();for(let A=this.static.argvlist.length;A<z.length;A++){const f={[B]:{value:z[A][0],type:"arg"},[Y]:{value:z[A][1],type:"arg"},[M]:{value:A,type:"arg"}},E=this.addItem(J,X,f,A);K=K.add(E)}this.boundaries&&V0.default(this.boundaries.end).before(K)}else if(z.length<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=z.length;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let G=V0.default(),W=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:W,type:"arg"};G=G.add(this.addItem(J,X,Y,W)),W++}if(!G?.length)return;if(H)return G;J.fill(G)},onDestroy(){this.static.prevRenderer?.cleanup(void 0,!0),this.static.prevRenderer=null,this.static.argvlist=null,this.static.lastIn=null}};var m1={};d0(m1,{handler:()=>{{return k4}},declaration:()=>{{return g4}},_static:()=>{{return x4}}});var g4={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},x4={initialized:!1,finalized:!1,prevRenderer:null},k4={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[G]=J.then.renderer.argv,W={[G]:{value:H,type:"arg"}},B=J.then.renderer.mesh(W,Z);if(this.static.prevRenderer=J.then.renderer,!B?.length)return;if(!X)return B;J.then.renderer.fill(B)}).catch((H)=>{if(this.static.prevRenderer?.cleanup(),!J.catch)return;const[G]=J.catch.renderer.argv,W={[G]:{value:H,type:"arg"}},B=J.catch.renderer.mesh(W,Z);if(this.static.prevRenderer=J.catch.renderer,!B?.length)return;if(!X)return B;J.catch.renderer.fill(B)}).finally(()=>this.static.finalized=!0)}};var d1={};d0(d1,{handler:()=>{{return _4}},declaration:()=>{{return f4}},_static:()=>{{return h4}}});var f4={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},h4={initialized:!1,prevRenderer:null},_4={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 G of J.case)if(G.is==J.by||Array.isArray(G.is)&&G.is.includes(J.by)){Array.isArray(G.is)?H=[...new Set([...H,...G.is])]:H.push(G.is);const W=G.renderer.mesh({},Z);if(this.static.prevRenderer=G.renderer,!W?.length)return;if(X)return W;G.renderer.fill(W)}if(H.includes(J.by))return;if(J.default){const G=J.default.renderer.mesh({},Z);if(this.static.prevRenderer=J.default.renderer,!G?.length)return;if(X)return G;J.default.renderer.fill(G)}else this.static.prevRenderer=null}};var i1={};d0(i1,{state:()=>{{return y4}},handler:()=>{{return d4}},default:()=>{{return i4}},context:()=>{{return u4}},_static:()=>{{return v4}}});var m4=function(J){const Z={};return J.split("&").map((H)=>{const[G,W]=H.split("=");Z[G]=W}),Z},y4={page:null,params:{},query:{}},v4={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},u4=["navigate"],d4={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 G=Z.match(/:[^\/]*(\/|$)/gi)||[],W=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:X,default:H,pathVars:G,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]?m4(X[1]):{};let G=null;if(this.static.currentRoute)G={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:G,toState:{path:J,query:H}});const W=this.match(J);if(!W){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:B,params:Y}=W;this.emit("after",{fromState:G,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:G,pathRegex:W}=H,B=J.match(W);if(B!==null&&B.index===0){for(let Y=0;Y+1<B.length&&Y<G.length;Y++)Z[G[Y].replaceAll(/[\/:]/g,"")]=B[Y+1];X=H;break}}return X?{route:X,params:Z}:!1}},i4="<{state.page} params=state.params query=state.query/>";class l0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new Q1;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new Z1,this.IUC=new J1;const[Z,X]=g0(this.i18n.lang),[H,G]=g0(J?.context||{});this.__setLang=X,this.__getLang=Z,this.__setContext=G,this.__getContext=H,this.register("if",v1),this.register("for",u1),this.register("async",m1),this.register("switch",d1),this.register("router",i1)}register(J,Z){return this.store[J]=Z,this}unregister(J){return delete this.store[J],this}has(J){return J in this.store}import(J){if(!this.has(J))throw new Error(`<${J}> component not found`);if(!this.store[J].declaration?.syntax&&!this.store[J].default)throw new Error(`Invalid <${J}> component`);return this.store[J]}render(J,Z,X){const{default:H,...G}=Z,W={debug:this.debug,prepath:"0",lips:this},B=new x0(J,H||"",{...G,input:X},W);return window.addEventListener("beforeunload",()=>{return this.dispose(),B.destroy(),null}),window.addEventListener("pagehide",(Y)=>{!Y.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),B}root(J,Z){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Z),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((X)=>new m0("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;o0(()=>{const X=this.__getContext();if(!X)return;const H=Object.fromEntries(J.map((G)=>[G,X[G]]));H&&typeof Z==="function"&&Object.keys(H).length&&Z(H)})}useTranslator(J,Z){o0(()=>{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 c4=function(){const J={rainbow:[],fire:[],ocean:[],grayscale:[]};for(let W=0;W<360;W++)J.rainbow.push(`hsl(${W}, 80%, 60%)`);for(let W=0;W<60;W++)J.fire.push(`hsl(${W+10}, 90%, 60%)`);for(let W=0;W<60;W++)J.ocean.push(`hsl(${W+180}, 85%, 55%)`);for(let W=0;W<200;W++){const B=W+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(W){for(let B=0;B<W;B++)this.state.particlePool.push(this.createInactiveParticle())},createInactiveParticle(){const W=this.input.minParticleSize||2,B=this.input.maxParticleSize||15,Y=W+Math.random()*(B-W);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 W=document.querySelector(".particle-system-container");if(W)this.boundMouseMove=this.handleMouseMove.bind(this),this.boundMouseLeave=this.handleMouseLeave.bind(this),W.addEventListener("mousemove",this.boundMouseMove),W.addEventListener("mouseleave",this.boundMouseLeave)}},onDestroy(){if(this.stopAnimation(),this.input.interactive){const W=document.querySelector(".particle-system-container");if(W)W.removeEventListener("mousemove",this.boundMouseMove),W.removeEventListener("mouseleave",this.boundMouseLeave)}this.state.particles=[],this.state.particlePool=[]},handleMouseMove(W){const Y=W.currentTarget.getBoundingClientRect();this.state.mouseX=W.clientX-Y.left,this.state.mouseY=W.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 W=this.input.colorScheme||"rainbow",B=J[W];if(!B||B.length===0){if(W==="rainbow")return`hsl(${Math.random()*360}, 80%, 60%)`;else if(W==="fire"){const Y=Math.random()*60+10,M=80+Math.random()*20,z=50+Math.random()*20;return`hsl(${Y}, ${M}%, ${z}%)`}else if(W==="ocean"){const Y=Math.random()*60+180,M=70+Math.random()*30,z=40+Math.random()*30;return`hsl(${Y}, ${M}%, ${z}%)`}else if(W==="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 W;for(let z=0;z<this.state.particlePool.length;z++)if(this.state.particlePool[z].life>this.state.particlePool[z].maxLife){W=this.state.particlePool[z];break}if(!W){if(W=this.createInactiveParticle(),!W)return null;this.state.particlePool.push(W)}if(!W||!this.input.width||!this.input.height)return null;W.x=this.state.emitterX,W.y=this.state.emitterY;const B=this.input.speedFactor||1,Y=Math.random()*Math.PI*2,M=(0.5+Math.random()*2)*B;return W.vx=Math.cos(Y)*M,W.vy=Math.sin(Y)*M,W.rotation=Math.random()*Math.PI*2,W.rotationSpeed=(Math.random()-0.5)*0.1,W.maxLife=50+Math.random()*100,W.life=0,W.alpha=0.7+Math.random()*0.3,W.color=this.getRandomColor(),W},updateParticles(){if(!this.input.width||!this.input.height)return;const W=performance.now(),B=(W-this.state.lastUpdateTime)/1000;this.state.lastUpdateTime=W;const Y=0.016666666666666666,M=this.input.useGravity?this.state.gravity:0,z=this.state.wind,j=this.state.turbulence,K=[],A=Math.min(this.state.emissionRate,(this.input.particleCount||200)-this.state.particles.length);for(let f=0;f<A;f++){const E=this.activateParticle();if(E)this.state.particles.push(E)}for(let f=0;f<this.state.particles.length;f++){const E=this.state.particles[f];if(E.life>=E.maxLife)continue;const p=Math.min(B,0.1);E.x+=E.vx*p*60,E.y+=E.vy*p*60,E.vy+=M*p*60,E.vx+=z*p*60,E.vx+=(Math.random()-0.5)*j*p*60,E.vy+=(Math.random()-0.5)*j*p*60,E.rotation+=E.rotationSpeed*p*60,E.life+=p*60;const X0=E.life/E.maxLife;E.alpha=1-Math.pow(X0,2);const s=E.size/2;if(E.x-s<0)E.x=s,E.vx=-E.vx*0.5;else if(E.x+s>this.input.width)E.x=this.input.width-s,E.vx=-E.vx*0.5;if(E.y+s>this.input.height)if(E.y=this.input.height-s,Math.abs(E.vy)>0.5)E.vy=-E.vy*0.4;else E.vy=0,E.vx*=0.95;if(E.life<E.maxLife)K.push(E)}if(this.state.particles.length!==K.length)this.state.particles=K},getParticlePoints(W){const B=[],M=W.size/2,z=W.size/4;for(let j=0;j<10;j++){const K=j%2===0?M:z,A=Math.PI/5*j,f=W.x+K*Math.sin(A),E=W.y+K*Math.cos(A);B.push(`${f},${E}`)}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 W=performance.now(),B=W-this.state.lastFrameTime;if(this.state.lastFrameTime=W,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(W){this.input.colorScheme=W},increaseParticleCount(){if(this.input.particleCount){const W=Math.min(1000,this.input.particleCount+50);if(W>this.state.particlePool.length){const B=W-this.state.particlePool.length;for(let Y=0;Y<B;Y++)this.state.particlePool.push(this.createInactiveParticle())}this.input.particleCount=W}},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 W=0;W<this.state.particles.length;W++)this.state.particles[W].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 l0({debug:!1});H.register("particle-system",X);const G={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"/>
47
242
 
48
- <if( specs.installed && !specs.upgraded && specs.latest )>
49
- <div style="padding: 0 100px">
50
- <span>Version {specs.latest} available!</span>
51
-
52
- <if( state.version === specs.latest )>
53
- <span style="padding: 0 10px;color: orange">Mounted</span>
54
- </if>
55
- <else>
56
- <button style="margin: 0 10px" on-click( onUpgrade, index, true )>Mount</button>
57
- </else>
58
-
59
- <button style="margin: 0 10px" on-click( onUpgrade, index, false )>Upgrade</button>
60
- </div>
61
- </if>
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"/>
62
266
  </div>
63
- </li>
64
- </for>
65
- </ul>
66
- `;y5.root({default:H,state:J,handler:Z},"body")};var y5=new D1({debug:!0});o6();
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",G).appendTo("body")},X8=new l0({debug:!0});c4();
67
282
 
68
- //# debugId=E96F2290554DAF5B64756e2164756e21
283
+ //# debugId=3281710AEE33312164756e2164756e21