mates 0.3.0-beta.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";
2
1
  /**
3
2
  * @license
4
3
  * Copyright 2017 Google LLC
5
4
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const t=globalThis,e=t.trustedTypes,n=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,s="$lit$",i=`lit$${Math.random().toFixed(9).slice(2)}$`,o="?"+i,r=`<${o}>`,a=document,l=()=>a.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,h=Array.isArray,u=t=>h(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,p=/-->/g,m=/>/g,_=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,y=/"/g,w=/^(?:script|style|textarea|title)$/i,v=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),b=v(1),S=v(2),x=Symbol.for("lit-noChange"),C=Symbol.for("lit-nothing"),E=new WeakMap,A=a.createTreeWalker(a,129);function k(t,e){if(!h(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==n?n.createHTML(e):e}const M=(t,e)=>{const n=t.length-1,o=[];let a,l=2===e?"<svg>":3===e?"<math>":"",c=f;for(let e=0;e<n;e++){const n=t[e];let h,u,d=-1,v=0;for(;v<n.length&&(c.lastIndex=v,u=c.exec(n),null!==u);)v=c.lastIndex,c===f?"!--"===u[1]?c=p:void 0!==u[1]?c=m:void 0!==u[2]?(w.test(u[2])&&(a=RegExp("</"+u[2],"g")),c=_):void 0!==u[3]&&(c=_):c===_?">"===u[0]?(c=a??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,h=u[1],c=void 0===u[3]?_:'"'===u[3]?y:g):c===y||c===g?c=_:c===p||c===m?c=f:(c=_,a=void 0);const b=c===_&&t[e+1].startsWith("/>")?" ":"";l+=c===f?n+r:d>=0?(o.push(h),n.slice(0,d)+s+n.slice(d)+i+b):n+i+(-2===d?e:b)}return[k(t,l+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]};class ${constructor({strings:t,_$litType$:n},r){let a;this.parts=[];let c=0,h=0;const u=t.length-1,d=this.parts,[f,p]=M(t,n);if(this.el=$.createElement(f,r),A.currentNode=this.el.content,2===n||3===n){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(a=A.nextNode())&&d.length<u;){if(1===a.nodeType){if(a.hasAttributes())for(const t of a.getAttributeNames())if(t.endsWith(s)){const e=p[h++],n=a.getAttribute(t).split(i),s=/([.?@])?(.*)/.exec(e);d.push({type:1,index:c,name:s[2],strings:n,ctor:"."===s[1]?I:"?"===s[1]?z:"@"===s[1]?D:P}),a.removeAttribute(t)}else t.startsWith(i)&&(d.push({type:6,index:c}),a.removeAttribute(t));if(w.test(a.tagName)){const t=a.textContent.split(i),n=t.length-1;if(n>0){a.textContent=e?e.emptyScript:"";for(let e=0;e<n;e++)a.append(t[e],l()),A.nextNode(),d.push({type:2,index:++c});a.append(t[n],l())}}}else if(8===a.nodeType)if(a.data===o)d.push({type:2,index:c});else{let t=-1;for(;-1!==(t=a.data.indexOf(i,t+1));)d.push({type:7,index:c}),t+=i.length-1}c++}}static createElement(t,e){const n=a.createElement("template");return n.innerHTML=t,n}}function T(t,e,n=t,s){if(e===x)return e;let i=void 0!==s?n._$Co?.[s]:n._$Cl;const o=c(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,n,s)),void 0!==s?(n._$Co??=[])[s]=i:n._$Cl=i),void 0!==i&&(e=T(t,i._$AS(t,e.values),i,s)),e}let R=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,s=(t?.creationScope??a).importNode(e,!0);A.currentNode=s;let i=A.nextNode(),o=0,r=0,l=n[0];for(;void 0!==l;){if(o===l.index){let e;2===l.type?e=new O(i,i.nextSibling,this,t):1===l.type?e=new l.ctor(i,l.name,l.strings,this,t):6===l.type&&(e=new L(i,this,t)),this._$AV.push(e),l=n[++r]}o!==l?.index&&(i=A.nextNode(),o++)}return A.currentNode=a,s}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}};class O{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,s){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=T(this,t,e),c(t)?t===C||null==t||""===t?(this._$AH!==C&&this._$AR(),this._$AH=C):t!==this._$AH&&t!==x&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==C&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(a.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,s="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=$.createElement(k(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new R(s,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=E.get(t.strings);return void 0===e&&E.set(t.strings,e=new $(t)),e}k(t){h(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,s=0;for(const i of t)s===e.length?e.push(n=new O(this.O(l()),this.O(l()),this,this.options)):n=e[s],n._$AI(i),s++;s<e.length&&(this._$AR(n&&n._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class P{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,s,i){this.type=1,this._$AH=C,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=C}_$AI(t,e=this,n,s){const i=this.strings;let o=!1;if(void 0===i)t=T(this,t,e,0),o=!c(t)||t!==this._$AH&&t!==x,o&&(this._$AH=t);else{const s=t;let r,a;for(t=i[0],r=0;r<i.length-1;r++)a=T(this,s[n+r],e,r),a===x&&(a=this._$AH[r]),o||=!c(a)||a!==this._$AH[r],a===C?t=C:t!==C&&(t+=(a??"")+i[r+1]),this._$AH[r]=a}o&&!s&&this.j(t)}j(t){t===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===C?void 0:t}}class z extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==C)}}class D extends P{constructor(t,e,n,s,i){super(t,e,n,s,i),this.type=5}_$AI(t,e=this){if((t=T(this,t,e,0)??C)===x)return;const n=this._$AH,s=t===C&&n!==C||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,i=t!==C&&(n===C||s);s&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class L{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){T(this,t)}}const N={M:s,P:i,A:o,C:1,L:M,R:R,D:u,V:T,I:O,H:P,N:z,U:D,B:I,F:L},j=t.litHtmlPolyfillSupport;j?.($,O),(t.litHtmlVersions??=[]).push("3.2.1");const U=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(void 0===i){const t=n?.renderBefore??null;s._$litPart$=i=new O(e.insertBefore(l(),t),t,void 0,n??{})}return i._$AI(t),i
5
+ */
6
+ const t=globalThis,e=t.trustedTypes,n=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,s="$lit$",i=`lit$${Math.random().toFixed(9).slice(2)}$`,o="?"+i,r=`<${o}>`,a=document,l=()=>a.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,h=Array.isArray,u=t=>h(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,p=/-->/g,m=/>/g,_=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,y=/"/g,w=/^(?:script|style|textarea|title)$/i,v=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),b=v(1),S=v(2),E=Symbol.for("lit-noChange"),C=Symbol.for("lit-nothing"),A=new WeakMap,k=a.createTreeWalker(a,129);function M(t,e){if(!h(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==n?n.createHTML(e):e}const $=(t,e)=>{const n=t.length-1,o=[];let a,l=2===e?"<svg>":3===e?"<math>":"",c=f;for(let e=0;e<n;e++){const n=t[e];let h,u,d=-1,v=0;for(;v<n.length&&(c.lastIndex=v,u=c.exec(n),null!==u);)v=c.lastIndex,c===f?"!--"===u[1]?c=p:void 0!==u[1]?c=m:void 0!==u[2]?(w.test(u[2])&&(a=RegExp("</"+u[2],"g")),c=_):void 0!==u[3]&&(c=_):c===_?">"===u[0]?(c=a??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,h=u[1],c=void 0===u[3]?_:'"'===u[3]?y:g):c===y||c===g?c=_:c===p||c===m?c=f:(c=_,a=void 0);const b=c===_&&t[e+1].startsWith("/>")?" ":"";l+=c===f?n+r:d>=0?(o.push(h),n.slice(0,d)+s+n.slice(d)+i+b):n+i+(-2===d?e:b)}return[M(t,l+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]};class T{constructor({strings:t,_$litType$:n},r){let a;this.parts=[];let c=0,h=0;const u=t.length-1,d=this.parts,[f,p]=$(t,n);if(this.el=T.createElement(f,r),k.currentNode=this.el.content,2===n||3===n){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(a=k.nextNode())&&d.length<u;){if(1===a.nodeType){if(a.hasAttributes())for(const t of a.getAttributeNames())if(t.endsWith(s)){const e=p[h++],n=a.getAttribute(t).split(i),s=/([.?@])?(.*)/.exec(e);d.push({type:1,index:c,name:s[2],strings:n,ctor:"."===s[1]?P:"?"===s[1]?z:"@"===s[1]?D:I}),a.removeAttribute(t)}else t.startsWith(i)&&(d.push({type:6,index:c}),a.removeAttribute(t));if(w.test(a.tagName)){const t=a.textContent.split(i),n=t.length-1;if(n>0){a.textContent=e?e.emptyScript:"";for(let e=0;e<n;e++)a.append(t[e],l()),k.nextNode(),d.push({type:2,index:++c});a.append(t[n],l())}}}else if(8===a.nodeType)if(a.data===o)d.push({type:2,index:c});else{let t=-1;for(;-1!==(t=a.data.indexOf(i,t+1));)d.push({type:7,index:c}),t+=i.length-1}c++}}static createElement(t,e){const n=a.createElement("template");return n.innerHTML=t,n}}function R(t,e,n=t,s){if(e===E)return e;let i=void 0!==s?n._$Co?.[s]:n._$Cl;const o=c(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,n,s)),void 0!==s?(n._$Co??=[])[s]=i:n._$Cl=i),void 0!==i&&(e=R(t,i._$AS(t,e.values),i,s)),e}let x=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,s=(t?.creationScope??a).importNode(e,!0);k.currentNode=s;let i=k.nextNode(),o=0,r=0,l=n[0];for(;void 0!==l;){if(o===l.index){let e;2===l.type?e=new O(i,i.nextSibling,this,t):1===l.type?e=new l.ctor(i,l.name,l.strings,this,t):6===l.type&&(e=new L(i,this,t)),this._$AV.push(e),l=n[++r]}o!==l?.index&&(i=k.nextNode(),o++)}return k.currentNode=a,s}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}};class O{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,s){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),c(t)?t===C||null==t||""===t?(this._$AH!==C&&this._$AR(),this._$AH=C):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==C&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(a.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,s="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=T.createElement(M(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new x(s,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=A.get(t.strings);return void 0===e&&A.set(t.strings,e=new T(t)),e}k(t){h(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,s=0;for(const i of t)s===e.length?e.push(n=new O(this.O(l()),this.O(l()),this,this.options)):n=e[s],n._$AI(i),s++;s<e.length&&(this._$AR(n&&n._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class I{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,s,i){this.type=1,this._$AH=C,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=C}_$AI(t,e=this,n,s){const i=this.strings;let o=!1;if(void 0===i)t=R(this,t,e,0),o=!c(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else{const s=t;let r,a;for(t=i[0],r=0;r<i.length-1;r++)a=R(this,s[n+r],e,r),a===E&&(a=this._$AH[r]),o||=!c(a)||a!==this._$AH[r],a===C?t=C:t!==C&&(t+=(a??"")+i[r+1]),this._$AH[r]=a}o&&!s&&this.j(t)}j(t){t===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class P extends I{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===C?void 0:t}}class z extends I{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==C)}}class D extends I{constructor(t,e,n,s,i){super(t,e,n,s,i),this.type=5}_$AI(t,e=this){if((t=R(this,t,e,0)??C)===E)return;const n=this._$AH,s=t===C&&n!==C||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,i=t!==C&&(n===C||s);s&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class L{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}}const N={M:s,P:i,A:o,C:1,L:$,R:x,D:u,V:R,I:O,H:I,N:z,U:D,B:P,F:L},j=t.litHtmlPolyfillSupport;j?.(T,O),(t.litHtmlVersions??=[]).push("3.2.1");const U=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(void 0===i){const t=n?.renderBefore??null;s._$litPart$=i=new O(e.insertBefore(l(),t),t,void 0,n??{})}return i._$AI(t),i
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
@@ -13,22 +13,22 @@
13
13
  * @license
14
14
  * Copyright 2020 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
- */const{I:X}=N,G=(t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e,Z=t=>void 0===t.strings,K=()=>document.createComment(""),J=(t,e,n)=>{const s=t._$AA.parentNode,i=void 0===e?t._$AB:e._$AA;if(void 0===n){const e=s.insertBefore(K(),i),o=s.insertBefore(K(),i);n=new X(e,o,t,t.options)}else{const e=n._$AB.nextSibling,o=n._$AM,r=o!==t;if(r){let e;n._$AQ?.(t),n._$AM=t,void 0!==n._$AP&&(e=t._$AU)!==o._$AU&&n._$AP(e)}if(e!==i||r){let t=n._$AA;for(;t!==e;){const e=t.nextSibling;s.insertBefore(t,i),t=e}}}return n},Q=(t,e,n=t)=>(t._$AI(e,n),t),tt={},et=(t,e=tt)=>t._$AH=e,nt=t=>t._$AH,st=t=>{t._$AP?.(!1,!0);let e=t._$AA;const n=t._$AB.nextSibling;for(;e!==n;){const t=e.nextSibling;e.remove(),e=t}},it=t=>{t._$AR()},ot=(t,e)=>{const n=t._$AN;if(void 0===n)return!1;for(const t of n)t._$AO?.(e,!1),ot(t,e);return!0},rt=t=>{let e,n;do{if(void 0===(e=t._$AM))break;n=e._$AN,n.delete(t),t=e}while(0===n?.size)},at=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(void 0===n)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),ht(e)}};
16
+ */const{I:X}=N,Z=(t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e,G=t=>void 0===t.strings,K=()=>document.createComment(""),J=(t,e,n)=>{const s=t._$AA.parentNode,i=void 0===e?t._$AB:e._$AA;if(void 0===n){const e=s.insertBefore(K(),i),o=s.insertBefore(K(),i);n=new X(e,o,t,t.options)}else{const e=n._$AB.nextSibling,o=n._$AM,r=o!==t;if(r){let e;n._$AQ?.(t),n._$AM=t,void 0!==n._$AP&&(e=t._$AU)!==o._$AU&&n._$AP(e)}if(e!==i||r){let t=n._$AA;for(;t!==e;){const e=t.nextSibling;s.insertBefore(t,i),t=e}}}return n},Q=(t,e,n=t)=>(t._$AI(e,n),t),tt={},et=(t,e=tt)=>t._$AH=e,nt=t=>t._$AH,st=t=>{t._$AP?.(!1,!0);let e=t._$AA;const n=t._$AB.nextSibling;for(;e!==n;){const t=e.nextSibling;e.remove(),e=t}},it=t=>{t._$AR()},ot=(t,e)=>{const n=t._$AN;if(void 0===n)return!1;for(const t of n)t._$AO?.(e,!1),ot(t,e);return!0},rt=t=>{let e,n;do{if(void 0===(e=t._$AM))break;n=e._$AN,n.delete(t),t=e}while(0===n?.size)},at=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(void 0===n)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),ht(e)}};
17
17
  /**
18
18
  * @license
19
19
  * Copyright 2017 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
21
- */function lt(t){void 0!==this._$AN?(rt(this),this._$AM=t,at(this)):this._$AM=t}function ct(t,e=!1,n=0){const s=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(s))for(let t=n;t<s.length;t++)ot(s[t],!1),rt(s[t]);else null!=s&&(ot(s,!1),rt(s));else ot(this,t)}const ht=t=>{t.type==V&&(t._$AP??=ct,t._$AQ??=lt)};class ut extends q{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,n){super._$AT(t,e,n),at(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ot(this,t),rt(this))}setValue(t){if(Z(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
21
+ */function lt(t){void 0!==this._$AN?(rt(this),this._$AM=t,at(this)):this._$AM=t}function ct(t,e=!1,n=0){const s=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(s))for(let t=n;t<s.length;t++)ot(s[t],!1),rt(s[t]);else null!=s&&(ot(s,!1),rt(s));else ot(this,t)}const ht=t=>{t.type==V&&(t._$AP??=ct,t._$AQ??=lt)};class ut extends q{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,n){super._$AT(t,e,n),at(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ot(this,t),rt(this))}setValue(t){if(G(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
22
22
  /**
23
23
  * @license
24
24
  * Copyright 2021 Google LLC
25
25
  * SPDX-License-Identifier: BSD-3-Clause
26
- */class dt{constructor(t){this.Y=t}disconnect(){this.Y=void 0}reconnect(t){this.Y=t}deref(){return this.Y}}let ft=class{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??=new Promise(t=>this.q=t)}resume(){this.q?.(),this.Z=this.q=void 0}},pt=class extends ut{constructor(){super(...arguments),this._$CK=new dt(this),this._$CX=new ft}render(t,e){return x}update(t,[e,n]){if(this.isConnected||this.disconnected(),e===this._$CJ)return x;this._$CJ=e;let s=0;const{_$CK:i,_$CX:o}=this;return(async(t,e)=>{for await(const n of t)if(!1===await e(n))return})(e,async t=>{for(;o.get();)await o.get();const r=i.deref();if(void 0!==r){if(r._$CJ!==e)return!1;void 0!==n&&(t=n(t,s)),r.commitValue(t,s),s++}return!0}),x}commitValue(t,e){this.setValue(t)}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}};
26
+ */class dt{constructor(t){this.Y=t}disconnect(){this.Y=void 0}reconnect(t){this.Y=t}deref(){return this.Y}}let ft=class{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??=new Promise(t=>this.q=t)}resume(){this.q?.(),this.Z=this.q=void 0}},pt=class extends ut{constructor(){super(...arguments),this._$CK=new dt(this),this._$CX=new ft}render(t,e){return E}update(t,[e,n]){if(this.isConnected||this.disconnected(),e===this._$CJ)return E;this._$CJ=e;let s=0;const{_$CK:i,_$CX:o}=this;return(async(t,e)=>{for await(const n of t)if(!1===await e(n))return})(e,async t=>{for(;o.get();)await o.get();const r=i.deref();if(void 0!==r){if(r._$CJ!==e)return!1;void 0!==n&&(t=n(t,s)),r.commitValue(t,s),s++}return!0}),E}commitValue(t,e){this.setValue(t)}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}};
27
27
  /**
28
28
  * @license
29
29
  * Copyright 2017 Google LLC
30
30
  * SPDX-License-Identifier: BSD-3-Clause
31
- */const mt=B(pt),_t=B(class extends pt{constructor(t){if(super(t),t.type!==V)throw Error("asyncAppend can only be used in child expressions")}update(t,e){return this._$Ctt=t,super.update(t,e)}commitValue(t,e){0===e&&it(this._$Ctt);const n=J(this._$Ctt);Q(n,t)}}),gt=t=>(t=>null!=t?._$litType$?.h)(t)?t._$litType$.h:t.strings,yt=B(class extends q{constructor(t){super(t),this.et=new WeakMap}render(t){return[t]}update(t,[e]){const n=G(this.it)?gt(this.it):null,s=G(e)?gt(e):null;if(null!==n&&(null===s||n!==s)){const e=nt(t).pop();let s=this.et.get(n);if(void 0===s){const t=document.createDocumentFragment();s=U(C,t),s.setConnected(!1),this.et.set(n,s)}et(s,[e]),J(s,void 0,e)}if(null!==s){if(null===n||n!==s){const e=this.et.get(s);if(void 0!==e){const n=nt(e).pop();it(t),J(t,void 0,n),et(t,[n])}}this.it=e}else this.it=void 0;return this.render(e)}}),wt=B(class extends q{constructor(t){if(super(t),t.type!==F||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return x}}),vt={},bt=B(class extends q{constructor(){super(...arguments),this.ot=vt}render(t,e){return e()}update(t,[e,n]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every((t,e)=>t===this.ot[e]))return x}else if(this.ot===e)return x;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,n)}});
31
+ */const mt=B(pt),_t=B(class extends pt{constructor(t){if(super(t),t.type!==V)throw Error("asyncAppend can only be used in child expressions")}update(t,e){return this._$Ctt=t,super.update(t,e)}commitValue(t,e){0===e&&it(this._$Ctt);const n=J(this._$Ctt);Q(n,t)}}),gt=t=>(t=>null!=t?._$litType$?.h)(t)?t._$litType$.h:t.strings,yt=B(class extends q{constructor(t){super(t),this.et=new WeakMap}render(t){return[t]}update(t,[e]){const n=Z(this.it)?gt(this.it):null,s=Z(e)?gt(e):null;if(null!==n&&(null===s||n!==s)){const e=nt(t).pop();let s=this.et.get(n);if(void 0===s){const t=document.createDocumentFragment();s=U(C,t),s.setConnected(!1),this.et.set(n,s)}et(s,[e]),J(s,void 0,e)}if(null!==s){if(null===n||n!==s){const e=this.et.get(s);if(void 0!==e){const n=nt(e).pop();it(t),J(t,void 0,n),et(t,[n])}}this.it=e}else this.it=void 0;return this.render(e)}}),wt=B(class extends q{constructor(t){if(super(t),t.type!==F||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return E}}),vt={},bt=B(class extends q{constructor(){super(...arguments),this.ot=vt}render(t,e){return e()}update(t,[e,n]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every((t,e)=>t===this.ot[e]))return E}else if(this.ot===e)return E;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,n)}}),St=t=>t??C;
32
32
  /**
33
33
  * @license
34
34
  * Copyright 2017 Google LLC
@@ -39,7 +39,12 @@
39
39
  * Copyright 2021 Google LLC
40
40
  * SPDX-License-Identifier: BSD-3-Clause
41
41
  */
42
- const St=B(class extends q{constructor(){super(...arguments),this.key=C}render(t,e){return this.key=t,e}update(t,[e,n]){return e!==this.key&&(et(t),this.key=e),n}}),xt=B(class extends q{constructor(t){if(super(t),t.type!==W&&t.type!==F&&t.type!==H)throw Error("The `live` directive is not allowed on child or event bindings");if(!Z(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===x||e===C)return e;const n=t.element,s=t.name;if(t.type===W){if(e===n[s])return x}else if(t.type===H){if(!!e===n.hasAttribute(s))return x}else if(t.type===F&&n.getAttribute(s)===e+"")return x;return et(t),e}});
42
+ function*Et(t,e){const n="function"==typeof e;if(void 0!==t){let s=-1;for(const i of t)s>-1&&(yield n?e(s):e),s++,yield i}}
43
+ /**
44
+ * @license
45
+ * Copyright 2021 Google LLC
46
+ * SPDX-License-Identifier: BSD-3-Clause
47
+ */const Ct=B(class extends q{constructor(){super(...arguments),this.key=C}render(t,e){return this.key=t,e}update(t,[e,n]){return e!==this.key&&(et(t),this.key=e),n}}),At=B(class extends q{constructor(t){if(super(t),t.type!==W&&t.type!==F&&t.type!==H)throw Error("The `live` directive is not allowed on child or event bindings");if(!G(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===E||e===C)return e;const n=t.element,s=t.name;if(t.type===W){if(e===n[s])return E}else if(t.type===H){if(!!e===n.hasAttribute(s))return E}else if(t.type===F&&n.getAttribute(s)===e+"")return E;return et(t),e}});
43
48
  /**
44
49
  * @license
45
50
  * Copyright 2020 Google LLC
@@ -47,10 +52,15 @@ const St=B(class extends q{constructor(){super(...arguments),this.key=C}render(t
47
52
  */
48
53
  /**
49
54
  * @license
50
- * Copyright 2017 Google LLC
55
+ * Copyright 2021 Google LLC
51
56
  * SPDX-License-Identifier: BSD-3-Clause
52
57
  */
53
- const Ct=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Et=B(class extends q{constructor(t){if(super(t),t.type!==V)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;void 0===n?n=e:void 0!==e&&(s=e);const i=[],o=[];let r=0;for(const e of t)i[r]=s?s(e,r):r,o[r]=n(e,r),r++;return{values:o,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=nt(t),{values:o,keys:r}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=r,o;const a=this.ut??=[],l=[];let c,h,u=0,d=i.length-1,f=0,p=o.length-1;for(;u<=d&&f<=p;)if(null===i[u])u++;else if(null===i[d])d--;else if(a[u]===r[f])l[f]=Q(i[u],o[f]),u++,f++;else if(a[d]===r[p])l[p]=Q(i[d],o[p]),d--,p--;else if(a[u]===r[p])l[p]=Q(i[u],o[p]),J(t,l[p+1],i[u]),u++,p--;else if(a[d]===r[f])l[f]=Q(i[d],o[f]),J(t,i[u],i[d]),d--,f++;else if(void 0===c&&(c=Ct(r,f,p),h=Ct(a,u,d)),c.has(a[u]))if(c.has(a[d])){const e=h.get(r[f]),n=void 0!==e?i[e]:null;if(null===n){const e=J(t,i[u]);Q(e,o[f]),l[f]=e}else l[f]=Q(n,o[f]),J(t,i[u],n),i[e]=null;f++}else st(i[d]),d--;else st(i[u]),u++;for(;f<=p;){const e=J(t,l[p+1]);Q(e,o[f]),l[f++]=e}for(;u<=d;){const t=i[u++];null!==t&&st(t)}return this.ut=r,et(t,l),x}}),At="important",kt=" !"+At,Mt=B(class extends q{constructor(t){if(super(t),t.type!==F||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,n)=>{const s=t[n];return null==s?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(t,[e]){const{style:n}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?n.removeProperty(t):n[t]=null);for(const t in e){const s=e[t];if(null!=s){this.ft.add(t);const e="string"==typeof s&&s.endsWith(kt);t.includes("-")||e?n.setProperty(t,e?s.slice(0,-11):s,e?At:""):n[t]=s}}return x}});
58
+ function*kt(t,e,n=1){const s=void 0===e?0:t;e??=t;for(let t=s;n>0?t<e:e<t;t+=n)yield t}
59
+ /**
60
+ * @license
61
+ * Copyright 2017 Google LLC
62
+ * SPDX-License-Identifier: BSD-3-Clause
63
+ */const Mt=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},$t=B(class extends q{constructor(t){if(super(t),t.type!==V)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;void 0===n?n=e:void 0!==e&&(s=e);const i=[],o=[];let r=0;for(const e of t)i[r]=s?s(e,r):r,o[r]=n(e,r),r++;return{values:o,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=nt(t),{values:o,keys:r}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=r,o;const a=this.ut??=[],l=[];let c,h,u=0,d=i.length-1,f=0,p=o.length-1;for(;u<=d&&f<=p;)if(null===i[u])u++;else if(null===i[d])d--;else if(a[u]===r[f])l[f]=Q(i[u],o[f]),u++,f++;else if(a[d]===r[p])l[p]=Q(i[d],o[p]),d--,p--;else if(a[u]===r[p])l[p]=Q(i[u],o[p]),J(t,l[p+1],i[u]),u++,p--;else if(a[d]===r[f])l[f]=Q(i[d],o[f]),J(t,i[u],i[d]),d--,f++;else if(void 0===c&&(c=Mt(r,f,p),h=Mt(a,u,d)),c.has(a[u]))if(c.has(a[d])){const e=h.get(r[f]),n=void 0!==e?i[e]:null;if(null===n){const e=J(t,i[u]);Q(e,o[f]),l[f]=e}else l[f]=Q(n,o[f]),J(t,i[u],n),i[e]=null;f++}else st(i[d]),d--;else st(i[u]),u++;for(;f<=p;){const e=J(t,l[p+1]);Q(e,o[f]),l[f++]=e}for(;u<=d;){const t=i[u++];null!==t&&st(t)}return this.ut=r,et(t,l),E}}),Tt="important",Rt=" !"+Tt,xt=B(class extends q{constructor(t){if(super(t),t.type!==F||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,n)=>{const s=t[n];return null==s?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(t,[e]){const{style:n}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?n.removeProperty(t):n[t]=null);for(const t in e){const s=e[t];if(null!=s){this.ft.add(t);const e="string"==typeof s&&s.endsWith(Rt);t.includes("-")||e?n.setProperty(t,e?s.slice(0,-11):s,e?Tt:""):n[t]=s}}return E}});
54
64
  /**
55
65
  * @license
56
66
  * Copyright 2018 Google LLC
@@ -61,17 +71,17 @@ const Ct=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},
61
71
  * Copyright 2017 Google LLC
62
72
  * SPDX-License-Identifier: BSD-3-Clause
63
73
  */
64
- class $t extends q{constructor(t){if(super(t),this.it=C,t.type!==V)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===C||null==t)return this._t=void 0,this.it=t;if(t===x)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}$t.directiveName="unsafeHTML",$t.resultType=1;const Tt=B($t),Rt=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then,Ot=1073741823;
74
+ class Ot extends q{constructor(t){if(super(t),this.it=C,t.type!==V)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===C||null==t)return this._t=void 0,this.it=t;if(t===E)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Ot.directiveName="unsafeHTML",Ot.resultType=1;const It=B(Ot),Pt=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then,zt=1073741823;
65
75
  /**
66
76
  * @license
67
77
  * Copyright 2017 Google LLC
68
78
  * SPDX-License-Identifier: BSD-3-Clause
69
- */const Pt=B(class extends ut{constructor(){super(...arguments),this._$Cwt=Ot,this._$Cbt=[],this._$CK=new dt(this),this._$CX=new ft}render(...t){return t.find(t=>!Rt(t))??x}update(t,e){const n=this._$Cbt;let s=n.length;this._$Cbt=e;const i=this._$CK,o=this._$CX;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cwt);t++){const r=e[t];if(!Rt(r))return this._$Cwt=t,r;t<s&&r===n[t]||(this._$Cwt=Ot,s=0,Promise.resolve(r).then(async t=>{for(;o.get();)await o.get();const e=i.deref();if(void 0!==e){const n=e._$Cbt.indexOf(r);n>-1&&n<e._$Cwt&&(e._$Cwt=n,e.setValue(t))}}))}return x}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}});
79
+ */const Dt=B(class extends ut{constructor(){super(...arguments),this._$Cwt=zt,this._$Cbt=[],this._$CK=new dt(this),this._$CX=new ft}render(...t){return t.find(t=>!Pt(t))??E}update(t,e){const n=this._$Cbt;let s=n.length;this._$Cbt=e;const i=this._$CK,o=this._$CX;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cwt);t++){const r=e[t];if(!Pt(r))return this._$Cwt=t,r;t<s&&r===n[t]||(this._$Cwt=zt,s=0,Promise.resolve(r).then(async t=>{for(;o.get();)await o.get();const e=i.deref();if(void 0!==e){const n=e._$Cbt.indexOf(r);n>-1&&n<e._$Cwt&&(e._$Cwt=n,e.setValue(t))}}))}return E}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}});
70
80
  /**
71
81
  * @license
72
82
  * Copyright 2021 Google LLC
73
83
  * SPDX-License-Identifier: BSD-3-Clause
74
- */const It=()=>{},zt={registerComponent:It,unregisterComponent:It,notifyRender:It,getComponentName:()=>"Anonymous",logComponentMount:It,logComponentRender:It,logComponentUnmount:It,logAtomSet:It,logAtomUpdate:It,logEventTrigger:It,logCleanupEventTrigger:It,logFetchRequest:It,logFetchResponse:It,logFetchError:It,recordRender:It};function Dt(t,e){zt.registerComponent(t,e)}function Lt(t){return zt.getComponentName(t)}function Nt(t,e){zt.logEventTrigger(t,e)}function jt(t,e,n){zt.recordRender(t,e,n)}function Ut(){return zt.registerComponent!==It}const Ft=Symbol.for("mates.readTracking");globalThis[Ft]||(globalThis[Ft]={enableReadTracking:!1,storesBeingRead:new Set,effectRunning:!1});const Vt=globalThis[Ft];function Wt(){return Vt.enableReadTracking}function Ht(){return Vt.effectRunning}function Yt(t){Vt.storesBeingRead.add(t)}function Bt(){Vt.effectRunning=!0}function qt(){Vt.effectRunning=!1}function Xt(){const t={prevEnabled:Vt.enableReadTracking,prevStores:Vt.storesBeingRead};return Vt.enableReadTracking=!0,Vt.storesBeingRead=new Set,t}function Gt(t){const e=Vt.storesBeingRead;return Vt.enableReadTracking=t.prevEnabled,Vt.storesBeingRead=t.prevStores,e}const Zt=Xt,Kt=Gt,Jt=Symbol.for("mates.componentRunningStatus");globalThis[Jt]||(globalThis[Jt]={setupInProgress:!1,templateInProgress:!1,viewOuterInProgress:!1,isHookRunning:!1});const Qt=globalThis[Jt];function te(t){if(!Qt.isHookRunning){if(Qt.templateInProgress)throw new Error(`${t} cannot be created during template function execution. Only scopes (useScope) are allowed in templates.`);if(Ht())throw new Error(`${t} cannot be created inside a memo() or effect(). They should only read state, not create new reactive primitives.`)}}function ee(t){if(!Qt.viewOuterInProgress){if(Qt.templateInProgress)throw new Error(`${t} cannot be called during template function execution. Move it to the component's outer function.`);if(Ht())throw new Error(`${t} cannot be called inside a memo() or effect(). Move it to the component's outer function.`);throw new Error(`${t} must be called inside a component's outer function. It cannot be used at module level or inside inner functions (e.g. event handlers, timers, or callbacks).`)}}function ne(t,e){(function(){if("undefined"==typeof window)return!0;const t=window.location.hostname;return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||t.startsWith("192.168.")||t.startsWith("10.")||t.endsWith(".local")})()&&(e?console.error(`[${e}]`,t):console.error(t))}function se(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)}function ie(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n}var oe,re,ae;"function"==typeof SuppressedError&&SuppressedError;class le{constructor(){oe.set(this,new Set),re.set(this,1)}subscribe(t){return se(this,oe,"f").add(t),()=>se(this,oe,"f").delete(t)}notify(){var t;ie(this,re,(t=se(this,re,"f"),++t),"f"),[...se(this,oe,"f")].forEach(t=>{try{t?.()}catch(t){console.error(t)}})}getVersion(){return se(this,re,"f")}get subscriberCount(){return se(this,oe,"f").size}clear(){se(this,oe,"f").clear()}}oe=new WeakMap,re=new WeakMap;class ce{constructor(){ae.set(this,new Set)}subscribe(t){return te("subscribe"),se(this,ae,"f").has(t)?()=>{}:(se(this,ae,"f").add(t),()=>se(this,ae,"f").delete(t))}trigger(t){se(this,ae,"f").forEach(e=>{try{e(t)}catch(t){console.error("Error in event handler:",t)}})}get handlerCount(){return se(this,ae,"f").size}clear(){se(this,ae,"f").clear()}}ae=new WeakMap;const he=Symbol.for("mates.hostStack");globalThis[he]||(globalThis[he]=[]);const ue=globalThis[he];function de(t,e){ue.push(t);let n=null;try{n=e()}finally{ue.pop()}return n}function fe(t){const e=ue[ue.length-1];if(!e){if(!1!==t)throw new Error("getCurrentHost(): No active host context");return null}return e}let pe=!1;function me(){return pe}function _e(t){t.DOMReadyEvent?.cleanupAndClearSubs(),t.PaintEvent?.cleanupAndClearSubs(),t.cleanups.forEach(t=>t.forEach(t=>{try{t()}catch(t){console.error("Error during cleanup:",t)}})),t.cleanups.clear(),t.onEachUpdateCallbacks.clear(),t.scopes=new Map,t._templateFn=null,t._xviewRender=()=>{},t._hasMounted=!1,t._errorState=null,t._errorHandlers=[]}const ge=new class{constructor(){this.pending=new Set,this.isScheduled=!1}scheduleDisconnect(t){this.pending.add(t),this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>this.flush()))}cancelDisconnect(t){this.pending.delete(t)}flush(){const t=Array.from(this.pending);this.pending.clear(),this.isScheduled=!1;for(const e of t)e&&e.isConnected||(_e(e),e._view=null,e._props={},e.oldView=void 0)}reset(){this.pending.clear(),this.isScheduled=!1}},ye=new class{constructor(){this.pendingEffects=new Set,this.isScheduled=!1,this._isFlushing=!1}get isFlushing(){return this._isFlushing}reset(){this.pendingEffects.clear(),this.isScheduled=!1,this._isFlushing=!1}schedule(t){this.pendingEffects.add(t),this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){this._isFlushing=!0;let t=0;for(;this.pendingEffects.size>0;){if(t++>=500){this.pendingEffects.clear(),console.error("EffectScheduler: Maximum iteration limit (500) reached. This likely means an effect is infinitely updating its own dependency. Remaining effects have been dropped.");break}const e=Array.from(this.pendingEffects);this.pendingEffects.clear();for(const t of e)try{t()}catch(t){ne(t,"Effect")}}this._isFlushing=!1,this.isScheduled=!1,we.flush()}},we=new class{constructor(){this.pendingComponents=new Set,this.nextPendingComponents=new Set,this._currentWave=new Set,this.isScheduled=!1,this._isFlushing=!1,this._flushVersion=0,this._onIdleCallbacks=[]}get flushVersion(){return this._flushVersion}onceIdle(t){this._onIdleCallbacks.push(t),this._isFlushing||this.isScheduled||queueMicrotask(()=>this._drainIdleCallbacks())}_drainIdleCallbacks(){if(this._isFlushing||this.isScheduled)return;if(this.pendingComponents.size>0||this.nextPendingComponents.size>0)return;const t=this._onIdleCallbacks.splice(0);for(const e of t)try{e()}catch(t){console.error(t)}}reset(){this.pendingComponents.clear(),this.nextPendingComponents.clear(),this._currentWave.clear(),this._onIdleCallbacks.length=0,this.isScheduled=!1,this._isFlushing=!1}schedule(t){if(this._isFlushing){if(this._currentWave.has(t)&&t._renderVersion!==this._flushVersion)return;this.nextPendingComponents.add(t)}else this.pendingComponents.add(t);this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>{ye.isScheduled||ye.isFlushing||this.flush()}))}flush(){for(this.nextPendingComponents.size>0&&(this.nextPendingComponents.forEach(t=>this.pendingComponents.add(t)),this.nextPendingComponents.clear()),this._isFlushing=!0,this._flushVersion++;this.pendingComponents.size>0;){const t=Array.from(this.pendingComponents);this.pendingComponents.clear(),t.sort((t,e)=>t._depth-e._depth),this._currentWave=new Set(t);for(const e of t)if(e.isConnected)try{e._render()}catch(t){ne(t,"Component render")}this._currentWave.clear()}this._isFlushing=!1,this.isScheduled=!1,this.nextPendingComponents.size>0?(this.isScheduled=!0,queueMicrotask(()=>{ye.isScheduled||ye.isFlushing||this.flush()})):this._drainIdleCallbacks()}},ve=()=>{if(Qt.templateInProgress&&!Qt.setupInProgress)throw Error("Providers such as atoms, units, bubbles, getters, setters and actions can't be created inside the template function, you can create them in view function. Because template function gets called everytime the view updates.")},be=()=>{},Se=t=>{ve(),t.__isOnMount__=!0;const e=fe();e.addToCleanUps(t,be);if("AsyncFunction"===t.constructor.name&&me())return e._asyncMountQueue=e._asyncMountQueue??[],void e._asyncMountQueue.push(t);let n=!1;e.DOMReadyEvent.__subscribe(()=>{if(n)return;n=!0;const s=t();if(s&&"object"==typeof s&&"function"==typeof s.then)return;const i=s;i&&e.addToCleanUps(t,i)})},xe=(t,e=!0)=>{if(e&&te("Setter"),Qt.setupInProgress&&e)throw new Error("Setter cannot be created inside setup function. Define setters as class properties before setup runs.");let n=t;const s=fe();e&&ve();const i=new Set;try{const t=(...t)=>{const e=n(...t);return[...i].forEach(t=>{try{ye.schedule(()=>t?.())}catch(t){console.error(t)}}),s?.isConnected&&we.schedule(s),e};return t.__subscribe=t=>(te("subscribe"),i.add(t),()=>i.delete(t)),t.__isSetter___=!0,t.set=t=>{n=t},Object.defineProperty(t,"__version__",{get:()=>0}),t}catch(t){throw new Error("You can only use setter or _ inside a scope or useState or view component's outer function")}},Ce=xe;function Ee(t,e=!0,n){if(Ht())return;const s=fe(e);if(s&&t&&!s.cleanups.has(t)){const e=n||t.__subscribe||t.subscribe,i=e?.(()=>{we.schedule(s)});s.addToCleanUps(t,i)}}const Ae=(t,e)=>{t.__isOn__=!0,te("on");const n=new Set;let s;const i=()=>{if(s){try{s()}catch(t){console.error("Error in on() cleanup:",t)}s=void 0}const e=t();"function"==typeof e&&(s=e)},o=()=>ye.schedule(i);e.forEach(t=>{n.add(t.__subscribe(o))});const r=()=>{if(n.forEach(t=>t()),s){try{s()}catch(t){console.error("Error in on() cleanup:",t)}s=void 0}};return ke(t,r),r};const ke=(t,e)=>{const n=fe(!1);n&&n.addToCleanUps(t,e)},Me=t=>{te("event");const e=t||Math.random().toString(36).substring(2,15),n=new ce;return{trigger:t=>{Nt(e,t),n.trigger(t)},__subscribe:t=>n.subscribe(t),name:e,__isEvent___:!0}},$e=t=>{te("cleanupEvent");const e=t||Math.random().toString(36).substring(2,15),n=new Map,s=()=>{n.forEach(t=>{if(t)try{t()}catch(t){ne(t,"cleanupEvent cleanup")}})},i={trigger:t=>{!function(t,e){zt.logCleanupEventTrigger(t,e)}(e,t),n.forEach((e,s)=>{if(e)try{e()}catch(t){ne(t,"cleanupEvent cleanup")}try{const e=s(t);n.set(s,e)}catch(t){ne(t,"cleanupEvent handler"),n.set(s,void 0)}})},__subscribe:t=>(n.set(t,void 0),()=>{const e=n.get(t);if(e)try{e()}catch(t){ne(t,"cleanupEvent unsubscribe")}n.delete(t)}),cleanup:s,cleanupAndClearSubs:()=>{s(),n.clear()},get hasSubscribers(){return n.size>0},name:e,__isCleanupEvent___:!0,__isEvent___:!0};return i};function Te(t){return!!t&&("AsyncFunction"===t.constructor?.name||t instanceof Promise||"object"==typeof t&&null!==t&&"then"in t||"function"==typeof t.then)}function Re(t){return"function"==typeof t?t():t}function Oe(t){return t.default||t}class Pe extends HTMLElement{addScope(t,e){this.scopes.set(t,e)}onEachUpdate(t){this.onEachUpdateCallbacks.add(t)}constructor(){super(),this.name="Anonymous",this.scopes=new Map,this._useStates=[],this.lastVersion=-1,this._depth=0,this._parentComponent=null,this._renderVersion=0,this._errorHandlers=[],this._errorState=null,this.onEachUpdateCallbacks=new Set,this.DOMReadyEvent=null,this.PaintEvent=null,this._isViewLoading=!1,this._onRequestParentScope=t=>{const e=t,n=e.detail?.ScopeClass;if(n&&this.scopes.has(n)){const t=this.scopes.get(n);t&&(e.stopPropagation(),e.detail.resolve(t))}},this._props={},this._propsFn=()=>this._props,this._view=null,this._templateFn=null,this._hasMounted=!1,this._renderScheduled=!1,this.componentId=Math.random(),this.cleanups=new Map,this._xviewRender=()=>{};const t=Qt.templateInProgress;Qt.templateInProgress=!1,de(this,()=>{this.DOMReadyEvent=$e("DOMReady"),this.PaintEvent=$e("Paint")}),Qt.templateInProgress=t}set props(t){this._props=t,we.schedule(this)}get props(){return this._props}_applyViewChange(t,e){this.oldView!==t&&(this.oldView=t,e(t),(this._hasMounted||this._errorState)&&_e(this))}set view(t){if(null!==t){if(Te(t))return this._isViewLoading=!0,void Re(t).then(t=>{this._isViewLoading=!1,this.view=Oe(t)},t=>{this._isViewLoading=!1,this._handleRenderError(t)});"function"==typeof t&&(this.name=t.name||"Anonymous"),this._applyViewChange(t,()=>{this._view=t}),we.schedule(this)}}get view(){return this._view}callOnEachUpdate(){this.onEachUpdateCallbacks.forEach(t=>t())}connectedCallback(){this.addEventListener("request-parent-scope",this._onRequestParentScope);let t=0,e=null,n=this.parentElement;for(;n;){if(n instanceof Pe){e=n,t=n._depth+1;break}n=n.parentElement}this._depth=t,this._parentComponent=e,ge.cancelDisconnect(this),this._hasMounted&&(Ut()&&!this._view?.skipDevToolsRender&&Dt(this,this._view),we.schedule(this))}disconnectedCallback(){var t,e,n;this.removeEventListener("request-parent-scope",this._onRequestParentScope),Ut()&&(this._view?.__devtools__||this._view?.skipDevToolsRender||(n=Lt(this),zt.logComponentUnmount(n)),this._view?.skipDevToolsRender||(t=this,e=this._view,zt.unregisterComponent(t,e))),ge.scheduleDisconnect(this)}addToCleanUps(t,e){const n=this.cleanups.get(t);n?n.push(e):this.cleanups.set(t,[e])}_render(){var t,e,n;if(!(this._errorState&&!this._view?.__isErrorView__||this._isViewLoading||this._renderScheduled)&&this._view)if(this._renderVersion=we.flushVersion,this._hasMounted){if(this._xviewRender){this.callOnEachUpdate();let s=0;if(Ut()){const i=this._view?.__devtools__,o=this._view?.skipDevToolsRender,r=performance.now();this._xviewRender(),s=performance.now()-r,i||o||(jt(Lt(this),this.componentId,s),e=Lt(this),n=s,zt.logComponentRender(e,n)),o||(t=this,zt.notifyRender(t))}else this._xviewRender()}}else this._mountComponent()}_mountComponent(){const t=this._view;U(b``,this),Qt.viewOuterInProgress=!0;try{this._templateFn=de(this,()=>t(this._propsFn))}catch(t){return Qt.viewOuterInProgress=!1,void this._handleRenderError(t)}if(Qt.viewOuterInProgress=!1,"function"==typeof this._templateFn){if(this._xviewRender=()=>{Qt.templateInProgress=!0;try{if(!this._templateFn)return;de(this,()=>{const t=this._templateFn(this._propsFn);U(t,this)}),this.DOMReadyEvent?.trigger(),this.PaintEvent?.hasSubscribers&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.isConnected&&this.PaintEvent?.trigger()})})}catch(t){this._handleRenderError(t)}finally{Qt.templateInProgress=!1}},this.callOnEachUpdate(),Ut()){const e=t?.__devtools__,n=t?.skipDevToolsRender,s=performance.now();this._xviewRender();const i=performance.now()-s;e||n||jt(t?.name||"Anonymous",this.componentId,i)}else this._xviewRender();this._view===t&&(this._hasMounted=!0,Ut()&&(t?.skipDevToolsRender||Dt(this,t),t?.__devtools__||t?.skipDevToolsRender||(e=t?.name||"Anonymous",zt.logComponentMount(e))))}else this._handleRenderError(new Error("inner function must be a template function that returns html result"));var e}_handleRenderError(t){this._errorState=t;for(const e of this._errorHandlers)try{e(t)}catch(t){}if(ne(t,`Component "${this.name}"`),this._view?.__isErrorView__)return;const e=this.name,n=t instanceof Error?t.message:String(t),s=t instanceof Error&&t.stack?t.stack.split("\n").slice(1).map(t=>t.trim()).filter(Boolean).join("\n"):null,i=()=>()=>b`
84
+ */function Lt(t,e,n){return t?e(t):n?.(t)}const Nt=()=>{},jt={registerComponent:Nt,unregisterComponent:Nt,notifyRender:Nt,getComponentName:()=>"Anonymous",logComponentMount:Nt,logComponentRender:Nt,logComponentUnmount:Nt,logAtomSet:Nt,logAtomUpdate:Nt,logEventTrigger:Nt,logCleanupEventTrigger:Nt,logFetchRequest:Nt,logFetchResponse:Nt,logFetchError:Nt,recordRender:Nt};function Ut(t,e){jt.registerComponent(t,e)}function Ft(t){return jt.getComponentName(t)}function Vt(t,e){jt.logEventTrigger(t,e)}function Wt(t,e,n){jt.recordRender(t,e,n)}function Ht(t){t.registerComponent&&(jt.registerComponent=t.registerComponent),t.unregisterComponent&&(jt.unregisterComponent=t.unregisterComponent),t.notifyRender&&(jt.notifyRender=t.notifyRender),t.getComponentName&&(jt.getComponentName=t.getComponentName),t.logComponentMount&&(jt.logComponentMount=t.logComponentMount),t.logComponentRender&&(jt.logComponentRender=t.logComponentRender),t.logComponentUnmount&&(jt.logComponentUnmount=t.logComponentUnmount),t.logAtomSet&&(jt.logAtomSet=t.logAtomSet),t.logAtomUpdate&&(jt.logAtomUpdate=t.logAtomUpdate),t.logEventTrigger&&(jt.logEventTrigger=t.logEventTrigger),t.logCleanupEventTrigger&&(jt.logCleanupEventTrigger=t.logCleanupEventTrigger),t.logFetchRequest&&(jt.logFetchRequest=t.logFetchRequest),t.logFetchResponse&&(jt.logFetchResponse=t.logFetchResponse),t.logFetchError&&(jt.logFetchError=t.logFetchError),t.recordRender&&(jt.recordRender=t.recordRender)}function Yt(){return jt.registerComponent!==Nt}const Bt=Symbol.for("mates.readTracking");globalThis[Bt]||(globalThis[Bt]={enableReadTracking:!1,storesBeingRead:new Set,effectRunning:!1});const qt=globalThis[Bt];function Xt(){return qt.enableReadTracking}function Zt(){return qt.storesBeingRead}function Gt(){return qt.effectRunning}function Kt(t){qt.storesBeingRead.add(t)}function Jt(){qt.effectRunning=!0}function Qt(){qt.effectRunning=!1}function te(){const t={prevEnabled:qt.enableReadTracking,prevStores:qt.storesBeingRead};return qt.enableReadTracking=!0,qt.storesBeingRead=new Set,t}function ee(t){const e=qt.storesBeingRead;return qt.enableReadTracking=t.prevEnabled,qt.storesBeingRead=t.prevStores,e}const ne=te,se=ee,ie=Symbol.for("mates.componentRunningStatus");globalThis[ie]||(globalThis[ie]={setupInProgress:!1,templateInProgress:!1,viewOuterInProgress:!1,isHookRunning:!1});const oe=globalThis[ie];function re(){return!oe.isHookRunning&&(oe.templateInProgress||Gt())}function ae(t){if(!oe.isHookRunning){if(oe.templateInProgress)throw new Error(`${t} cannot be created during template function execution. Only scopes (useScope) are allowed in templates.`);if(Gt())throw new Error(`${t} cannot be created inside a memo() or effect(). They should only read state, not create new reactive primitives.`)}}function le(t){if(!oe.viewOuterInProgress){if(oe.templateInProgress)throw new Error(`${t} cannot be called during template function execution. Move it to the component's outer function.`);if(Gt())throw new Error(`${t} cannot be called inside a memo() or effect(). Move it to the component's outer function.`);throw new Error(`${t} must be called inside a component's outer function. It cannot be used at module level or inside inner functions (e.g. event handlers, timers, or callbacks).`)}}function ce(t,e){(function(){if("undefined"==typeof window)return!0;const t=window.location.hostname;return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||t.startsWith("192.168.")||t.startsWith("10.")||t.endsWith(".local")})()&&(e?console.error(`[${e}]`,t):console.error(t))}function he(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)}function ue(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n}var de,fe,pe;"function"==typeof SuppressedError&&SuppressedError;class me{constructor(){de.set(this,new Set),fe.set(this,1)}subscribe(t){return he(this,de,"f").add(t),()=>he(this,de,"f").delete(t)}notify(){var t;ue(this,fe,(t=he(this,fe,"f"),++t),"f"),[...he(this,de,"f")].forEach(t=>{try{t?.()}catch(t){console.error(t)}})}getVersion(){return he(this,fe,"f")}get subscriberCount(){return he(this,de,"f").size}clear(){he(this,de,"f").clear()}}de=new WeakMap,fe=new WeakMap;class _e{constructor(){pe.set(this,new Set)}subscribe(t){return ae("subscribe"),he(this,pe,"f").has(t)?()=>{}:(he(this,pe,"f").add(t),()=>he(this,pe,"f").delete(t))}trigger(t){he(this,pe,"f").forEach(e=>{try{e(t)}catch(t){console.error("Error in event handler:",t)}})}get handlerCount(){return he(this,pe,"f").size}clear(){he(this,pe,"f").clear()}}pe=new WeakMap;const ge=Symbol.for("mates.hostStack");globalThis[ge]||(globalThis[ge]=[]);const ye=globalThis[ge];function we(t,e){ye.push(t);let n=null;try{n=e()}finally{ye.pop()}return n}function ve(t){const e=ye[ye.length-1];if(!e){if(!1!==t)throw new Error("getCurrentHost(): No active host context");return null}return e}let be=!1;function Se(t){be=t}function Ee(){return be}function Ce(t){t.DOMReadyEvent?.cleanupAndClearSubs(),t.PaintEvent?.cleanupAndClearSubs(),t.cleanups.forEach(t=>t.forEach(t=>{try{t()}catch(t){console.error("Error during cleanup:",t)}})),t.cleanups.clear(),t.onEachUpdateCallbacks.clear(),t.scopes=new Map,t._templateFn=null,t._xviewRender=()=>{},t._hasMounted=!1,t._errorState=null,t._errorHandlers=[]}const Ae=new class{constructor(){this.pending=new Set,this.isScheduled=!1}scheduleDisconnect(t){this.pending.add(t),this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>this.flush()))}cancelDisconnect(t){this.pending.delete(t)}flush(){const t=Array.from(this.pending);this.pending.clear(),this.isScheduled=!1;for(const e of t)e&&e.isConnected||(Ce(e),e._view=null,e._props={},e.oldView=void 0)}reset(){this.pending.clear(),this.isScheduled=!1}},ke=new class{constructor(){this.pendingEffects=new Set,this.isScheduled=!1,this._isFlushing=!1}get isFlushing(){return this._isFlushing}reset(){this.pendingEffects.clear(),this.isScheduled=!1,this._isFlushing=!1}schedule(t){this.pendingEffects.add(t),this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){this._isFlushing=!0;let t=0;for(;this.pendingEffects.size>0;){if(t++>=500){this.pendingEffects.clear(),console.error("EffectScheduler: Maximum iteration limit (500) reached. This likely means an effect is infinitely updating its own dependency. Remaining effects have been dropped.");break}const e=Array.from(this.pendingEffects);this.pendingEffects.clear();for(const t of e)try{t()}catch(t){ce(t,"Effect")}}this._isFlushing=!1,this.isScheduled=!1,Me.flush()}},Me=new class{constructor(){this.pendingComponents=new Set,this.nextPendingComponents=new Set,this._currentWave=new Set,this.isScheduled=!1,this._isFlushing=!1,this._flushVersion=0,this._onIdleCallbacks=[]}get flushVersion(){return this._flushVersion}onceIdle(t){this._onIdleCallbacks.push(t),this._isFlushing||this.isScheduled||queueMicrotask(()=>this._drainIdleCallbacks())}_drainIdleCallbacks(){if(this._isFlushing||this.isScheduled)return;if(this.pendingComponents.size>0||this.nextPendingComponents.size>0)return;const t=this._onIdleCallbacks.splice(0);for(const e of t)try{e()}catch(t){console.error(t)}}reset(){this.pendingComponents.clear(),this.nextPendingComponents.clear(),this._currentWave.clear(),this._onIdleCallbacks.length=0,this.isScheduled=!1,this._isFlushing=!1}schedule(t){if(this._isFlushing){if(this._currentWave.has(t)&&t._renderVersion!==this._flushVersion)return;this.nextPendingComponents.add(t)}else this.pendingComponents.add(t);this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>{ke.isScheduled||ke.isFlushing||this.flush()}))}flush(){for(this.nextPendingComponents.size>0&&(this.nextPendingComponents.forEach(t=>this.pendingComponents.add(t)),this.nextPendingComponents.clear()),this._isFlushing=!0,this._flushVersion++;this.pendingComponents.size>0;){const t=Array.from(this.pendingComponents);this.pendingComponents.clear(),t.sort((t,e)=>t._depth-e._depth),this._currentWave=new Set(t);for(const e of t)if(e.isConnected)try{e._render()}catch(t){ce(t,"Component render")}this._currentWave.clear()}this._isFlushing=!1,this.isScheduled=!1,this.nextPendingComponents.size>0?(this.isScheduled=!0,queueMicrotask(()=>{ke.isScheduled||ke.isFlushing||this.flush()})):this._drainIdleCallbacks()}},$e=()=>{if(oe.templateInProgress&&!oe.setupInProgress)throw Error("Providers such as atoms, units, bubbles, getters, setters and actions can't be created inside the template function, you can create them in view function. Because template function gets called everytime the view updates.")},Te=()=>{},Re=t=>{$e(),t.__isOnMount__=!0;const e=ve();e.addToCleanUps(t,Te);if("AsyncFunction"===t.constructor.name&&Ee())return e._asyncMountQueue=e._asyncMountQueue??[],void e._asyncMountQueue.push(t);let n=!1;e.DOMReadyEvent.__subscribe(()=>{if(n)return;n=!0;const s=t();if(s&&"object"==typeof s&&"function"==typeof s.then)return;const i=s;i&&e.addToCleanUps(t,i)})},xe=t=>{$e(),t.__isOnPaint__=!0;const e=ve();e.addToCleanUps(t,Te),e.PaintEvent.__subscribe(()=>t())},Oe=t=>{$e(),t.__isOnAllMount__=!0;const e=ve();e.addToCleanUps(t,Te),Me.onceIdle(()=>{if(!e.isConnected)return;const n=t();n&&e.addToCleanUps(t,n)})},Ie=t=>{$e(),t.__isOnCleanup__=!0;ve().addToCleanUps(t,t)},Pe=(t,e=!0)=>{if(e&&ae("Setter"),oe.setupInProgress&&e)throw new Error("Setter cannot be created inside setup function. Define setters as class properties before setup runs.");let n=t;const s=ve();e&&$e();const i=new Set;try{const t=(...t)=>{const e=n(...t);return[...i].forEach(t=>{try{ke.schedule(()=>t?.())}catch(t){console.error(t)}}),s?.isConnected&&Me.schedule(s),e};return t.__subscribe=t=>(ae("subscribe"),i.add(t),()=>i.delete(t)),t.__isSetter___=!0,t.set=t=>{n=t},Object.defineProperty(t,"__version__",{get:()=>0}),t}catch(t){throw new Error("You can only use setter or _ inside a scope or useState or view component's outer function")}},ze=Pe;function De(t,e=!0,n){if(Gt())return;const s=ve(e);if(s&&t&&!s.cleanups.has(t)){const e=n||t.__subscribe||t.subscribe,i=e?.(()=>{Me.schedule(s)});s.addToCleanUps(t,i)}}function Le(t){return De(t,!0),t}const Ne=(t,e)=>{t.__isOn__=!0,ae("on");const n=new Set;let s;const i=()=>{if(s){try{s()}catch(t){console.error("Error in on() cleanup:",t)}s=void 0}const e=t();"function"==typeof e&&(s=e)},o=()=>ke.schedule(i);e.forEach(t=>{n.add(t.__subscribe(o))});const r=()=>{if(n.forEach(t=>t()),s){try{s()}catch(t){console.error("Error in on() cleanup:",t)}s=void 0}};return Ue(t,r),r};function je(t){let e=null;const n=new CustomEvent("request-context",{bubbles:!0,composed:!0,detail:{context:t,resolve(t=null){e=t}}});return ve().dispatchEvent(n),e}const Ue=(t,e)=>{const n=ve(!1);n&&n.addToCleanUps(t,e)},Fe=t=>{ae("xTabEvent");const e=new Set,n=n=>{e.forEach(e=>{try{e(n)}catch(e){ce(e,`xTabEvent(${t}) handler`)}})},s="undefined"!=typeof BroadcastChannel?new BroadcastChannel(t):null;s&&(s.onmessage=t=>{n(t.data)});return{trigger:e=>{if(Vt(t,e),s)try{s.postMessage(e)}catch(e){ce(e,`xTabEvent(${t}) postMessage`)}n(e)},__subscribe:t=>{e.add(t);const n=()=>{e.delete(t)};return Ue(t,n),n},close:()=>{s&&s.close()},name:t,__isEvent___:!0,__isXTabEvent___:!0}},Ve=t=>{ae("event");const e=t||Math.random().toString(36).substring(2,15),n=new _e;return{trigger:t=>{Vt(e,t),n.trigger(t)},__subscribe:t=>n.subscribe(t),name:e,__isEvent___:!0}},We=t=>{ae("cleanupEvent");const e=t||Math.random().toString(36).substring(2,15),n=new Map,s=()=>{n.forEach(t=>{if(t)try{t()}catch(t){ce(t,"cleanupEvent cleanup")}})},i={trigger:t=>{!function(t,e){jt.logCleanupEventTrigger(t,e)}(e,t),n.forEach((e,s)=>{if(e)try{e()}catch(t){ce(t,"cleanupEvent cleanup")}try{const e=s(t);n.set(s,e)}catch(t){ce(t,"cleanupEvent handler"),n.set(s,void 0)}})},__subscribe:t=>(n.set(t,void 0),()=>{const e=n.get(t);if(e)try{e()}catch(t){ce(t,"cleanupEvent unsubscribe")}n.delete(t)}),cleanup:s,cleanupAndClearSubs:()=>{s(),n.clear()},get hasSubscribers(){return n.size>0},name:e,__isCleanupEvent___:!0,__isEvent___:!0};return i};function He(t){return!!t&&("AsyncFunction"===t.constructor?.name||t instanceof Promise||"object"==typeof t&&null!==t&&"then"in t||"function"==typeof t.then)}function Ye(t){return"function"==typeof t?t():t}function Be(t){return t.default||t}class qe extends HTMLElement{addScope(t,e){this.scopes.set(t,e)}onEachUpdate(t){this.onEachUpdateCallbacks.add(t)}constructor(){super(),this.name="Anonymous",this.scopes=new Map,this._useStates=[],this.lastVersion=-1,this._depth=0,this._parentComponent=null,this._renderVersion=0,this._errorHandlers=[],this._errorState=null,this.onEachUpdateCallbacks=new Set,this.DOMReadyEvent=null,this.PaintEvent=null,this._isViewLoading=!1,this._onRequestParentScope=t=>{const e=t,n=e.detail?.ScopeClass;if(n&&this.scopes.has(n)){const t=this.scopes.get(n);t&&(e.stopPropagation(),e.detail.resolve(t))}},this._props={},this._propsFn=()=>this._props,this._view=null,this._templateFn=null,this._hasMounted=!1,this._renderScheduled=!1,this.componentId=Math.random(),this.cleanups=new Map,this._xviewRender=()=>{};const t=oe.templateInProgress;oe.templateInProgress=!1,we(this,()=>{this.DOMReadyEvent=We("DOMReady"),this.PaintEvent=We("Paint")}),oe.templateInProgress=t}set props(t){this._props=t,Me.schedule(this)}get props(){return this._props}_applyViewChange(t,e){this.oldView!==t&&(this.oldView=t,e(t),(this._hasMounted||this._errorState)&&Ce(this))}set view(t){if(null!==t){if(He(t))return this._isViewLoading=!0,void Ye(t).then(t=>{this._isViewLoading=!1,this.view=Be(t)},t=>{this._isViewLoading=!1,this._handleRenderError(t)});"function"==typeof t&&(this.name=t.name||"Anonymous"),this._applyViewChange(t,()=>{this._view=t}),Me.schedule(this)}}get view(){return this._view}callOnEachUpdate(){this.onEachUpdateCallbacks.forEach(t=>t())}connectedCallback(){this.addEventListener("request-parent-scope",this._onRequestParentScope);let t=0,e=null,n=this.parentElement;for(;n;){if(n instanceof qe){e=n,t=n._depth+1;break}n=n.parentElement}this._depth=t,this._parentComponent=e,Ae.cancelDisconnect(this),this._hasMounted&&(Yt()&&!this._view?.skipDevToolsRender&&Ut(this,this._view),Me.schedule(this))}disconnectedCallback(){var t,e,n;this.removeEventListener("request-parent-scope",this._onRequestParentScope),Yt()&&(this._view?.__devtools__||this._view?.skipDevToolsRender||(n=Ft(this),jt.logComponentUnmount(n)),this._view?.skipDevToolsRender||(t=this,e=this._view,jt.unregisterComponent(t,e))),Ae.scheduleDisconnect(this)}addToCleanUps(t,e){const n=this.cleanups.get(t);n?n.push(e):this.cleanups.set(t,[e])}_render(){var t,e,n;if(!(this._errorState&&!this._view?.__isErrorView__||this._isViewLoading||this._renderScheduled)&&this._view)if(this._renderVersion=Me.flushVersion,this._hasMounted){if(this._xviewRender){this.callOnEachUpdate();let s=0;if(Yt()){const i=this._view?.__devtools__,o=this._view?.skipDevToolsRender,r=performance.now();this._xviewRender(),s=performance.now()-r,i||o||(Wt(Ft(this),this.componentId,s),e=Ft(this),n=s,jt.logComponentRender(e,n)),o||(t=this,jt.notifyRender(t))}else this._xviewRender()}}else this._mountComponent()}_mountComponent(){const t=this._view;U(b``,this),oe.viewOuterInProgress=!0;try{this._templateFn=we(this,()=>t(this._propsFn))}catch(t){return oe.viewOuterInProgress=!1,void this._handleRenderError(t)}if(oe.viewOuterInProgress=!1,"function"==typeof this._templateFn){if(this._xviewRender=()=>{oe.templateInProgress=!0;try{if(!this._templateFn)return;we(this,()=>{const t=this._templateFn(this._propsFn);U(t,this)}),this.DOMReadyEvent?.trigger(),this.PaintEvent?.hasSubscribers&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.isConnected&&this.PaintEvent?.trigger()})})}catch(t){this._handleRenderError(t)}finally{oe.templateInProgress=!1}},this.callOnEachUpdate(),Yt()){const e=t?.__devtools__,n=t?.skipDevToolsRender,s=performance.now();this._xviewRender();const i=performance.now()-s;e||n||Wt(t?.name||"Anonymous",this.componentId,i)}else this._xviewRender();this._view===t&&(this._hasMounted=!0,Yt()&&(t?.skipDevToolsRender||Ut(this,t),t?.__devtools__||t?.skipDevToolsRender||(e=t?.name||"Anonymous",jt.logComponentMount(e))))}else this._handleRenderError(new Error("inner function must be a template function that returns html result"));var e}_handleRenderError(t){this._errorState=t;for(const e of this._errorHandlers)try{e(t)}catch(t){}if(ce(t,`Component "${this.name}"`),this._view?.__isErrorView__)return;const e=this.name,n=t instanceof Error?t.message:String(t),s=t instanceof Error&&t.stack?t.stack.split("\n").slice(1).map(t=>t.trim()).filter(Boolean).join("\n"):null,i=()=>()=>b`
75
85
  <div
76
86
  style="padding:14px 16px;margin:4px;border:2px solid #e74c3c;border-radius:6px;background:#fdf0ef;color:#c0392b;font-family:monospace;font-size:13px;line-height:1.5"
77
87
  >
@@ -96,85 +106,72 @@ ${s}</pre
96
106
  >
97
107
  </details>`:null}
98
108
  </div>
99
- `;i.__isErrorView__=!0,i.skipDevToolsRender=!0,this.view=i,this.name=e,this._errorState=t}}customElements.get("x-view")||customElements.define("x-view",Pe);class Ie extends HTMLElement{constructor(){super(...arguments),this._onRequestContext=t=>{const e=t,n=e.detail?.context.id;n&&null!=this.id&&n===this.id&&(e.stopPropagation(),e.detail.resolve(this._value))}}connectedCallback(){this.addEventListener("request-context",this._onRequestContext)}set context(t){this.id=t.id}disconnectedCallback(){this.removeEventListener("request-context",this._onRequestContext)}set value(t){this._value=t}get value(){return this._value}}function ze(t){let e=-1===t.indexOf("\0")?t:t.replace(/\0/g,"");const n=function(t){const e=t.indexOf("{"),n=t.indexOf("}");return-1===e&&-1===n?-1:-1===e?n:-1===n?e:Math.min(e,n)}(e);return-1!==n&&(e=e.slice(0,n)),/url\s*\(/i.test(e)&&(e=e.replace(/\burl\s*\(\s*(['"]?)\s*(?:javascript:|vbscript:|data:text\/html[,;])/gi,"url($1")),e}function De(t){return t.length>0&&/^[a-zA-Z-]+$/.test(t)}customElements.get("x-provider")||customElements.define("x-provider",Ie);let Le=0;function Ne(){return`_m${(Le++).toString(36)}`}const je=Object.create(null),Ue={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function Fe(t){const e=je[t];if(void 0!==e)return e;const n=t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);return je[t]=n,n}function Ve(t,e,n){if(!n)return`.${t} {\n${e}}`;if(n.startsWith("&")){return`.${t}${n.slice(1)} {\n${e}}`}return`${n} {\n .${t} {\n${e.replace(/^ {2}/gm," ")} }\n}`}function We(t){return t.startsWith("&")||t.startsWith("@media")?t:Object.prototype.hasOwnProperty.call(Ue,t)?`@media (min-width: ${Ue[t]})`:null}function He(t,e,n){const s=Object.create(null);for(const i in t){const o=t[i];let r="",a=null;for(const t in o){const e=o[t];if(null!=e){if("object"==typeof e&&!Array.isArray(e)){const n=We(t);if(null===n)throw new Error(`[css-in-js] Unknown nested key "${t}" in block "${i}". Use "&:pseudo", "@media (...)", or a configured breakpoint key.`);let s="";const o=e;for(const t in o){const e=o[t];null!=e&&(De(t)?s+=` ${Fe(t)}: ${ze(String(e))};\n`:console.warn(`[css-in-js] invalid property name skipped: "${t}"`))}s.length>0&&(null===a&&(a=[]),a.push([s,n]));continue}De(t)?r+=` ${Fe(t)}: ${ze(String(e))};\n`:console.warn(`[css-in-js] invalid property name skipped: "${t}"`)}}if(0===r.length&&null===a){s[i]="";continue}const l=n?.literal?i:`${i}${Ne()}`;if(r.length>0&&e.push(Ve(l,r,"")),null!==a)for(let t=0;t<a.length;t++)e.push(Ve(l,a[t][0],a[t][1]));s[i]=l}return s}function Ye(t){return Object.freeze(t)}var Be,qe,Xe,Ge,Ze,Ke,Je,Qe;function tn(t){if(Qt.templateInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a template function.`);if(Qt.viewOuterInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a component outer function. Move it outside the component function.`);if(Qt.setupInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a setup function.`)}let en=0;function nn(t){return`${t}_kf${(en++).toString(36)}`}function sn(t,e){let n="";for(const t in e){const s=e[t];let i="";for(const t in s){const e=s[t];if(null==e)continue;const n=t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);i+=` ${n}: ${String(e)};\n`}i&&(n+=` ${t} {\n${i} }\n`)}return`@keyframes ${t} {\n${n}}`}const on=new Set;class rn{constructor(){Be.add(this),qe.set(this,""),Xe.set(this,0),Ge.set(this,null),Ze.set(this,[]),on.add(this)}keyframes(t,e){const n=nn(t);return this.appendRules(sn(n,e)),n}appendRules(t){""!==t&&(se(this,Ze,"f").push(t),se(this,Xe,"f")>0&&se(this,Be,"m",Ke).call(this))}mount(){var t;ie(this,Xe,(t=se(this,Xe,"f"),++t),"f"),1===se(this,Xe,"f")&&(se(this,Be,"m",Ke).call(this),se(this,Ge,"f")||se(this,Be,"m",Je).call(this))}unmount(){var t;se(this,Xe,"f")<=0||(ie(this,Xe,(t=se(this,Xe,"f"),--t),"f"),0===se(this,Xe,"f")&&se(this,Be,"m",Qe).call(this))}get refCount(){return se(this,Xe,"f")}get cssText(){return se(this,qe,"f")}get isMounted(){return se(this,Xe,"f")>0}get sheet(){return se(this,Ge,"f")}getAllCSS(){const t=[];return se(this,qe,"f")&&t.push(se(this,qe,"f")),se(this,Ze,"f").length>0&&t.push(se(this,Ze,"f").join("\n")),t.join("\n")}}qe=new WeakMap,Xe=new WeakMap,Ge=new WeakMap,Ze=new WeakMap,Be=new WeakSet,Ke=function(){if(0===se(this,Ze,"f").length)return;const t=se(this,Ze,"f").join("\n");ie(this,Ze,[],"f"),ie(this,qe,se(this,qe,"f")+(se(this,qe,"f")?"\n":"")+t,"f"),se(this,Be,"m",Je).call(this)},Je=function(){se(this,Ge,"f")||(ie(this,Ge,new CSSStyleSheet,"f"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,se(this,Ge,"f")]),se(this,Ge,"f").replaceSync(se(this,qe,"f"))},Qe=function(){se(this,Ge,"f")&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(t=>t!==se(this,Ge,"f")),ie(this,Ge,null,"f")),se(this,qe,"f")&&(se(this,Ze,"f").unshift(se(this,qe,"f")),ie(this,qe,"","f"))};let an=null,ln=!1;function cn(){return an||(an=new rn),an}function hn(){an||(an=new rn),ln||(ln=!0,queueMicrotask(()=>{ln=!1,an.mount()}))}function un(t,e){tn("globalCSS"),hn();const n=[],s=He(t,n,e);return n.length>0&&an.appendRules(n.join("\n")),Ye(s)}function dn(t){tn("globalRawCSS"),hn(),an.appendRules(t)}let fn=!1;function pn(){fn||(fn=!0,dn('\n[class*="mates-"] {\n --mates-duration : 300ms;\n --mates-easing : ease;\n --mates-distance : 24px;\n animation-duration : var(--mates-duration);\n animation-timing-function : var(--mates-easing);\n animation-fill-mode : both;\n}\n'),dn("\n@keyframes mates-kf-fade-in { from { opacity: 0 } to { opacity: 1 } }\n@keyframes mates-kf-fade-out { from { opacity: 1 } to { opacity: 0 } }\n\n@keyframes mates-kf-slide-in-up {\n from { opacity: 0; transform: translateY(var(--mates-distance)) }\n to { opacity: 1; transform: translateY(0) }\n}\n@keyframes mates-kf-slide-out-up {\n from { opacity: 1; transform: translateY(0) }\n to { opacity: 0; transform: translateY(calc(-1 * var(--mates-distance))) }\n}\n@keyframes mates-kf-slide-in-down {\n from { opacity: 0; transform: translateY(calc(-1 * var(--mates-distance))) }\n to { opacity: 1; transform: translateY(0) }\n}\n@keyframes mates-kf-slide-out-down {\n from { opacity: 1; transform: translateY(0) }\n to { opacity: 0; transform: translateY(var(--mates-distance)) }\n}\n@keyframes mates-kf-slide-in-left {\n from { opacity: 0; transform: translateX(var(--mates-distance)) }\n to { opacity: 1; transform: translateX(0) }\n}\n@keyframes mates-kf-slide-out-left {\n from { opacity: 1; transform: translateX(0) }\n to { opacity: 0; transform: translateX(calc(-1 * var(--mates-distance))) }\n}\n@keyframes mates-kf-slide-in-right {\n from { opacity: 0; transform: translateX(calc(-1 * var(--mates-distance))) }\n to { opacity: 1; transform: translateX(0) }\n}\n@keyframes mates-kf-slide-out-right {\n from { opacity: 1; transform: translateX(0) }\n to { opacity: 0; transform: translateX(var(--mates-distance)) }\n}\n\n@keyframes mates-kf-scale-in {\n from { opacity: 0; transform: scale(0.92) }\n to { opacity: 1; transform: scale(1) }\n}\n@keyframes mates-kf-scale-out {\n from { opacity: 1; transform: scale(1) }\n to { opacity: 0; transform: scale(0.92) }\n}\n\n@keyframes mates-kf-spring-in {\n from { opacity: 0; transform: scale(0.92) }\n to { opacity: 1; transform: scale(1) }\n}\n\n@keyframes mates-kf-flip-in-x {\n from { opacity: 0; transform: rotateX(90deg) }\n to { opacity: 1; transform: rotateX(0deg) }\n}\n@keyframes mates-kf-flip-in-y {\n from { opacity: 0; transform: rotateY(90deg) }\n to { opacity: 1; transform: rotateY(0deg) }\n}\n\n@keyframes mates-kf-blur-in {\n from { opacity: 0; filter: blur(10px) }\n to { opacity: 1; filter: blur(0) }\n}\n@keyframes mates-kf-blur-out {\n from { opacity: 1; filter: blur(0) }\n to { opacity: 0; filter: blur(10px) }\n}\n\n@keyframes mates-kf-shake {\n 0%, 100% { transform: translateX(0) }\n 15% { transform: translateX(calc(-1 * var(--mates-distance))) }\n 30% { transform: translateX(calc( 1 * var(--mates-distance))) }\n 45% { transform: translateX(calc(-0.6 * var(--mates-distance))) }\n 60% { transform: translateX(calc( 0.6 * var(--mates-distance))) }\n 75% { transform: translateX(calc(-0.3 * var(--mates-distance))) }\n 90% { transform: translateX(calc( 0.3 * var(--mates-distance))) }\n}\n\n@keyframes mates-kf-pulse {\n 0%, 100% { transform: scale(1) }\n 50% { transform: scale(1.08) }\n}\n\n@keyframes mates-kf-bounce {\n 0% { transform: translateY(0) }\n 20% { transform: translateY(calc(-0.40 * var(--mates-distance))) }\n 40% { transform: translateY(0) }\n 60% { transform: translateY(calc(-0.20 * var(--mates-distance))) }\n 80% { transform: translateY(0) }\n 90% { transform: translateY(calc(-0.08 * var(--mates-distance))) }\n 100% { transform: translateY(0) }\n}\n\n@keyframes mates-kf-spin {\n from { transform: rotate(0deg) }\n to { transform: rotate(360deg) }\n}\n"),un({"mates-fade-in":{animationName:"mates-kf-fade-in"},"mates-fade-out":{animationName:"mates-kf-fade-out"},"mates-slide-in-up":{animationName:"mates-kf-slide-in-up"},"mates-slide-out-up":{animationName:"mates-kf-slide-out-up"},"mates-slide-in-down":{animationName:"mates-kf-slide-in-down"},"mates-slide-out-down":{animationName:"mates-kf-slide-out-down"},"mates-slide-in-left":{animationName:"mates-kf-slide-in-left"},"mates-slide-out-left":{animationName:"mates-kf-slide-out-left"},"mates-slide-in-right":{animationName:"mates-kf-slide-in-right"},"mates-slide-out-right":{animationName:"mates-kf-slide-out-right"},"mates-scale-in":{animationName:"mates-kf-scale-in"},"mates-scale-out":{animationName:"mates-kf-scale-out"},"mates-spring-in":{animationName:"mates-kf-spring-in","--mates-easing":"cubic-bezier(0.34, 1.56, 0.64, 1)"},"mates-flip-in-x":{animationName:"mates-kf-flip-in-x"},"mates-flip-in-y":{animationName:"mates-kf-flip-in-y"},"mates-blur-in":{animationName:"mates-kf-blur-in"},"mates-blur-out":{animationName:"mates-kf-blur-out"},"mates-shake":{animationName:"mates-kf-shake","--mates-duration":"500ms","--mates-easing":"ease-in-out"},"mates-pulse":{animationName:"mates-kf-pulse","--mates-duration":"600ms","--mates-easing":"ease-in-out"},"mates-bounce":{animationName:"mates-kf-bounce","--mates-duration":"700ms"},"mates-spin":{animationName:"mates-kf-spin","--mates-easing":"linear"}},{literal:!0}))}function mn(t=300,e="ease"){return{keyframes:[{opacity:0},{opacity:1}],options:{duration:t,easing:e,fill:"both"}}}function _n(t=300,e="ease"){return{keyframes:[{opacity:1},{opacity:0}],options:{duration:t,easing:e,fill:"both"}}}pn();const gn={up:"translateY(-100%)",down:"translateY(100%)",left:"translateX(-100%)",right:"translateX(100%)"};function yn(t,e){switch(t){case"up":return`translateY(-${e})`;case"down":return`translateY(${e})`;case"left":return`translateX(-${e})`;case"right":return`translateX(${e})`}}function wn(t){if(null==t||"object"!=typeof t)return t;try{return Object.keys(t).forEach(e=>{"object"!=typeof t[e]||null===t[e]||Object.isFrozen(t[e])||wn(t[e])}),Object.freeze(t)}catch(t){console.error(t)}}function vn(t,e,n){const s=Zt();let i;Bt();try{i=t()}finally{qt();Kt(s).forEach(t=>{"function"==typeof t.__subscribe&&e(t,n)})}return i}function bn(t,e){if(te(t),"AsyncFunction"===e.constructor.name)throw new Error(`${t.toLowerCase()}() does not support async functions.`);if(Ht())throw new Error(`${t.toLowerCase()}() cannot be nested inside an effect() or memo().`)}function Sn(t){const{name:e,fn:n,onRun:s,supportsCleanup:i}=t;bn(e,n);const o=new Set;let r,a=!1;const l=()=>{if(i&&r){try{r()}catch(t){console.error("Error in effect cleanup:",t)}r=void 0}},c=()=>{if(a)return;l();const t=new Set(o);o.clear();const e=()=>{a||ye.schedule(c)};let h;try{h=vn(n,t=>{o.add(t.__subscribe(e))},e)}finally{t.forEach(t=>t())}if(a)return o.forEach(t=>t()),void o.clear();i&&"function"==typeof h&&(r=h),s(h)},h=()=>{a||(a=!0,l(),o.forEach(t=>t()),o.clear())};return c(),ke(n,h),h}let xn=0;function Cn(t,e){if("function"==typeof t){const e=t;let n;const s=Symbol("skip");return Sn({name:"Memo",fn:()=>{try{return e()}catch(t){return console.error("[atom] Error in derived function:",t),s}},onRun:t=>{t!==s&&(n?(n.unlock("initial"),n.set(()=>t),n.lock("initial")):(n=An(t,{skipRestrictedContextCheck:!0}),n.lock("initial")))}}),n}e?.skipRestrictedContextCheck||te("Atom");let n=t;const s=++xn,i=new le;function o(){return Ee(o,!1),Wt()&&Yt(o),n}return o.get=function(){return o()},o.set=function(t,e=!1){var r,a;n="function"==typeof t?t(n):t,o.skipDevToolsLog||(r=String(s),a=n,zt.logAtomSet(r,a)),e||i.notify()},o.update=function(t,e=!1){var r;"object"==typeof n&&null!==n&&(t(n),o.skipDevToolsLog||(r=String(s),zt.logAtomUpdate(r)),e||i.notify())},o.__subscribe=function(t){return i.subscribe(t)},o.toJSON=function(){return JSON.stringify(n)},Object.defineProperty(o,"name",{value:"atom",writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(o,"val",{get:()=>o(),set:t=>o.set(t),enumerable:!1,configurable:!0}),Object.defineProperty(o,"__version__",{get:()=>i.getVersion(),enumerable:!1}),Object.defineProperty(o,"__isAtom___",{value:!0,writable:!1,enumerable:!1}),Object.defineProperty(o,"__id__",{value:s,writable:!1,enumerable:!1}),o}function En(t,e){e?.skipRestrictedContextCheck||te("iAtom");const n=Cn(kn(t),{skipRestrictedContextCheck:!0}),s=n.set;n.set=function(t,e=!1){const i="function"==typeof t?t(n.get()):t;s(kn(i),e)};const i=n;return delete i.update,i.name="iAtom",i}function An(t,e={}){e.skipRestrictedContextCheck||te("superAtom"),ve();const n=e.freeze??!1,s=n?kn(Mn(t)):t;let i=!1,o="default";const r=Cn(n?kn(t):t,{skipRestrictedContextCheck:!0}),a=r.set;r.set=function(t,e=!1){if(i)return void ne("Cannot mutate a locked atom.","superAtom");const s="function"==typeof t?t(r.get()):t;a(n?kn(s):s,e)};const l=r.update;r.update=function(t,e=!1){if(i)ne("Cannot mutate a locked atom.","superAtom");else{if(n)throw new Error("update() is not supported when freeze is enabled — use set() with a new value.");l(t,e)}};const c=r;return c.lock=function(t="default"){i=!0,o=t},c.unlock=function(t="default"){if(o!==t)throw new Error("Incorrect passcode. Cannot unlock atom.");i=!1},c.reset=function(){i||r.set(n?kn(Mn(s)):s)},c.freeze=function(){wn(r.get())},c.name="superAtom",c}function kn(t){return"object"==typeof t&&null!==t?wn(t):t}function Mn(t){try{return structuredClone(t)}catch{return t}}function $n(t){const e=new Map,n=[],s=t=>JSON.stringify(t),i=t=>{e.delete(t);const s=n.indexOf(t);s>-1&&n.splice(s,1)};return{getCacheKey:s,removeCacheEntry:i,createCacheMethod:(o,r,a,l)=>async(...c)=>{const h=s(c),u=e.get(h);if(u){const e=Date.now();if(!(void 0!==t?.cacheDuration&&e-u.timestamp>t.cacheDuration)){const t=n.indexOf(h);return t>-1&&n.splice(t,1),n.push(h),o.set(u.result),r.set(null),a.set("success"),u.result}i(h)}const d=await l(this,c);e.set(h,{result:d,timestamp:Date.now()});const f=n.indexOf(h);if(f>-1&&n.splice(f,1),n.push(h),t?.cacheLimit&&n.length>t.cacheLimit){const t=n.shift();t&&e.delete(t)}return d},createClearCacheMethod:()=>(...t)=>{if(0===t.length)e.clear(),n.length=0;else{const e=s(t);i(e)}}}}function Tn(t){let e=null,n=null;const s=()=>{e&&(clearInterval(e),e=null,n=null)};return{createStartPollingMethod:i=>(...o)=>{t?.pollInterval?(s(),n=o,i(...o),e=setInterval(()=>{n&&i(...n)},t.pollInterval)):ne(new Error("pollInterval not specified in asyncAction options"))},createStopPollingMethod:()=>s,stopPolling:s}}function Rn(t,e){e?.allowInRestrictedContext||te("Async Action");const n={...{cacheLimit:10,pollInterval:5e3},...e};let s=t;const i=new Set;let o=null,r=null,a=null,l=null;const c=$n(n),h=Tn(n),u=Cn(null),d=Cn(null),f=Cn(!1),p=Cn("init"),m=t=>{i.forEach(e=>{if(void 0===e.filter||void 0===t||e.filter===t)try{e.fn()}catch(t){ne(t)}})},_=()=>{r?.isActive()&&(r.cancel(),r=null),o&&(o.abort(),o=null),f.set(!1),p.set("init")},g=async(t,e)=>{_(),f.set(!0),p.set("loading"),o=new AbortController;const n=o;try{let i;if(a){i=a((...e)=>s.call(t,...e),...e)}else i=s.call(t,...e);i?.__isZeroPromise__&&(r=i);let c=await i;if(n.signal.aborted||o!==n)throw new Error("Operation was cancelled");return l&&(c=l(c)),u.set(c),d.set(null),p.set("success"),m(!0),c}catch(t){if(n.signal.aborted||o!==n)throw t;const e=t instanceof Error?t:new Error(String(t));throw u.set(null),d.set(e),p.set("error"),m(!1),e}finally{o===n&&(o=null),f.set(!1),r&&!r.isActive()&&(r=null)}},y=async(...t)=>{const e=this;if(me()){const n=fe(!1);if(n?._ssrPromiseQueue){const s=g(e,t).catch(()=>{});return n._ssrPromiseQueue.push(s),s}}return g(e,t)},w=c.createCacheMethod(u,d,p,g),v=c.createClearCacheMethod(),b=h.createStartPollingMethod(y),S=h.createStopPollingMethod(),x=Object.assign(y,{data:u,error:d,isLoading:f,status:p,val:()=>s,set:t=>{s=t},params:{page:1},cancel:_,subscribe:(t,e)=>{te("subscribe");const n={fn:t,filter:e};i.add(n);const s=()=>i.delete(n);return ke(t,s),s},cache:w,clearCache:v,startPolling:b,stopPolling:S,interceptBefore:t=>{a=t},interceptAfter:t=>{l=t},__isAsyncAction___:!0,__isAction___:!1});return Object.defineProperty(x,"abortController",{get:()=>o,enumerable:!0,configurable:!0}),ke(x,()=>{i.clear(),h.stopPolling(),_()}),x}const On=(t,e,n)=>{const s="timeout"===n?setTimeout(()=>t(),e):setInterval(()=>t(),e);return ke(s,"timeout"===n?()=>clearTimeout(s):()=>clearInterval(s)),s};class Pn{constructor(){this.timeoutId=null,this.pendingArgs=null,this.pendingContext=null}clearPending(){this.pendingArgs=null,this.pendingContext=null}setPending(t,e){this.pendingArgs=t,this.pendingContext=e}clearTimer(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}setTimer(t,e){this.timeoutId=((t,e)=>On(t,e,"timeout"))(t,e)}executePending(t){return this.pendingArgs&&(this.lastResult=t.apply(this.pendingContext,this.pendingArgs),this.clearPending()),this.lastResult}}function In(t,e){return()=>{t.clearTimer(),t.clearPending(),e?.()}}function zn(t,e){return()=>{if(t.pendingArgs&&t.timeoutId){t.clearTimer();return t.executePending(e)}return t.lastResult}}function Dn(t,e){const n=new Pn,s=function(...s){return n.setPending(s,this),n.clearTimer(),n.setTimer(()=>{n.lastResult=n.executePending(t),n.timeoutId=null},e),n.lastResult};return s.cancel=In(n),s.flush=zn(n,t),s}function Ln(t,e){const n=new Pn;let s=0;const i=function(...i){const o=Date.now(),r=o-s;return r>=e?(s=o,n.lastResult=t.apply(this,i),n.clearPending(),n.clearTimer()):(n.setPending(i,this),n.timeoutId||n.setTimer(()=>{s=Date.now(),n.lastResult=n.executePending(t),n.timeoutId=null},e-r)),n.lastResult};return i.cancel=In(n,()=>{s=0}),i.flush=zn(n,t),i}function Nn(t,e){return"function"!=typeof t.animate?Promise.resolve():("function"==typeof t.getAnimations&&t.getAnimations().forEach(t=>t.cancel()),new Promise(n=>{const s=t.animate(e.keyframes,{duration:300,easing:"ease",fill:"both",...e.options});s.onfinish=()=>n(),s.oncancel=()=>n()}))}async function jn(t){const{el:e,exit:n,enter:s,swap:i,getEl:o,isStale:r}=t;if(!e)return void i();if(await Nn(e,n),r?.())return;if(i(),await("function"!=typeof requestAnimationFrame?Promise.resolve():new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(()=>t())))),r?.())return;const a=o?.()??e;a&&await Nn(a,s)}function Un(t){return t.__isEffect__=!0,Sn({name:"Effect",fn:t,onRun:()=>{},supportsCleanup:!0})}const Fn=new WeakMap,Vn=B(class extends ut{render(t){return C}update(t,[e]){const n=e!==this.Y;return n&&void 0!==this.Y&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),C}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.Y){const e=this.ht??globalThis;let n=Fn.get(e);void 0===n&&(n=new WeakMap,Fn.set(e,n)),void 0!==n.get(this.Y)&&this.Y.call(this.ht,void 0),n.set(this.Y,t),void 0!==t&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){return"function"==typeof this.Y?Fn.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Wn(){const t=new ce;let e;const n={get value(){return e},__subscribe:e=>t.subscribe(e),__isMatesRef__:!0,__set:n=>{e!==n&&(e=n,t.trigger(n))}};return n}function Hn(t){if(t&&t.__isMatesRef__){const e=t;return Vn(t=>{e.__set(t)})}return Vn(t)}const Yn=(t,e={})=>b`<x-view .view=${t} .props=${e}></x-view>`,Bn=Yn,qn=Yn,Xn=(t,e,n={})=>U(Yn(t,n),e),Gn=Xn,Zn=Cn("undefined"!=typeof window?window.history.state:null),Kn=Cn(!1),Jn=Me("router:navigation-request"),Qn=An("undefined"!=typeof window?window.location.pathname:"/");function ts(t){t.preventDefault(),t.returnValue=""}Un(()=>(Kn()?(Qn.lock(),"undefined"!=typeof window&&window.addEventListener("beforeunload",ts)):(Qn.unlock(),"undefined"!=typeof window&&window.removeEventListener("beforeunload",ts)),()=>{"undefined"!=typeof window&&window.removeEventListener("beforeunload",ts)})),"undefined"!=typeof window&&(window.addEventListener("popstate",t=>{if(Kn())return window.history.pushState(window.history.state,"",Qn.get()),void Zn.set(window.history.state??null);const e=window.location.pathname;if(e!==Qn.get()&&Jn.trigger({to:e,from:Qn.get()}),Kn())return window.history.pushState(window.history.state,"",Qn.get()),void Zn.set(window.history.state??null);Zn.set(t.state??null),e!==Qn.get()&&Qn.set(e)}),window.addEventListener("hashchange",()=>{if(Kn())return;const t=window.location.pathname;t!==Qn.get()&&Qn.set(t)}),window.addEventListener("navigate",()=>{if(Kn())return;const t=window.location.pathname;t!==Qn.get()&&Qn.set(t)}));const es=t=>{const e=Qn.get();if(e===t)return!0;const n=t.split("/").filter(Boolean),s=e.split("/").filter(Boolean);if(n.length!==s.length)return!1;for(let t=0;t<n.length;t++){const e=n[t],i=s[t];if(e.startsWith(":")){if(!i)return!1}else if(e!==i)return!1}return!0},ns=t=>{const e=Wn(),n=()=>t().options,s=t().options.notFound?{path:"*",component:t().options.notFound}:null,i=()=>{const{routes:e}=t(),n=e.find(t=>es(t.path));return n??s},o=i(),r=Cn(o),a=Cn(o);return Un(()=>{const t=a();if(t===r.get())return;const s=e.value;if(!s)return void r.set(t);const i=n(),o=r.get();jn({el:s,exit:o?.exit??i.exit??_n(200),enter:t?.enter??i.enter??mn(250),swap:()=>r.set(t),getEl:()=>e.value,isStale:()=>a.get()!==t})}),Un(()=>{Qn(),function(t){a.get()!==t&&a.set(t)}(i())}),Se(()=>{const t=e.value;if(!t)return;const s=r.get(),i=n();Nn(t,s?.enter??i.enter??mn(250))}),()=>{const t=r();return b`
109
+ `;i.__isErrorView__=!0,i.skipDevToolsRender=!0,this.view=i,this.name=e,this._errorState=t}}customElements.get("x-view")||customElements.define("x-view",qe);class Xe extends HTMLElement{constructor(){super(...arguments),this._onRequestContext=t=>{const e=t,n=e.detail?.context.id;n&&null!=this.id&&n===this.id&&(e.stopPropagation(),e.detail.resolve(this._value))}}connectedCallback(){this.addEventListener("request-context",this._onRequestContext)}set context(t){this.id=t.id}disconnectedCallback(){this.removeEventListener("request-context",this._onRequestContext)}set value(t){this._value=t}get value(){return this._value}}function Ze(t){let e=-1===t.indexOf("\0")?t:t.replace(/\0/g,"");const n=function(t){const e=t.indexOf("{"),n=t.indexOf("}");return-1===e&&-1===n?-1:-1===e?n:-1===n?e:Math.min(e,n)}(e);return-1!==n&&(e=e.slice(0,n)),/url\s*\(/i.test(e)&&(e=e.replace(/\burl\s*\(\s*(['"]?)\s*(?:javascript:|vbscript:|data:text\/html[,;])/gi,"url($1")),e}function Ge(t){return t.length>0&&/^[a-zA-Z-]+$/.test(t)}customElements.get("x-provider")||customElements.define("x-provider",Xe);let Ke=0;function Je(){return`_m${(Ke++).toString(36)}`}const Qe=Object.create(null),tn={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function en(t){t.breakpoints&&Object.assign(tn,t.breakpoints)}function nn(t){const e=Qe[t];if(void 0!==e)return e;const n=t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);return Qe[t]=n,n}function sn(t,e,n){if(!n)return`.${t} {\n${e}}`;if(n.startsWith("&")){return`.${t}${n.slice(1)} {\n${e}}`}return`${n} {\n .${t} {\n${e.replace(/^ {2}/gm," ")} }\n}`}function on(t){return t.startsWith("&")||t.startsWith("@media")?t:Object.prototype.hasOwnProperty.call(tn,t)?`@media (min-width: ${tn[t]})`:null}function rn(t,e,n){const s=Object.create(null);for(const i in t){const o=t[i];let r="",a=null;for(const t in o){const e=o[t];if(null!=e){if("object"==typeof e&&!Array.isArray(e)){const n=on(t);if(null===n)throw new Error(`[css-in-js] Unknown nested key "${t}" in block "${i}". Use "&:pseudo", "@media (...)", or a configured breakpoint key.`);let s="";const o=e;for(const t in o){const e=o[t];null!=e&&(Ge(t)?s+=` ${nn(t)}: ${Ze(String(e))};\n`:console.warn(`[css-in-js] invalid property name skipped: "${t}"`))}s.length>0&&(null===a&&(a=[]),a.push([s,n]));continue}Ge(t)?r+=` ${nn(t)}: ${Ze(String(e))};\n`:console.warn(`[css-in-js] invalid property name skipped: "${t}"`)}}if(0===r.length&&null===a){s[i]="";continue}const l=n?.literal?i:`${i}${Je()}`;if(r.length>0&&e.push(sn(l,r,"")),null!==a)for(let t=0;t<a.length;t++)e.push(sn(l,a[t][0],a[t][1]));s[i]=l}return s}function an(t){return Object.freeze(t)}var ln,cn,hn,un,dn,fn,pn,mn;function _n(t){if(oe.templateInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a template function.`);if(oe.viewOuterInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a component outer function. Move it outside the component function.`);if(oe.setupInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a setup function.`)}let gn=0;function yn(t){return`${t}_kf${(gn++).toString(36)}`}function wn(t,e){let n="";for(const t in e){const s=e[t];let i="";for(const t in s){const e=s[t];if(null==e)continue;const n=t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);i+=` ${n}: ${String(e)};\n`}i&&(n+=` ${t} {\n${i} }\n`)}return`@keyframes ${t} {\n${n}}`}const vn=new Set;function bn(){const t=[];for(const e of vn){const n=e.getAllCSS();n&&t.push(n)}return t.join("\n")}class Sn{constructor(){ln.add(this),cn.set(this,""),hn.set(this,0),un.set(this,null),dn.set(this,[]),vn.add(this)}keyframes(t,e){const n=yn(t);return this.appendRules(wn(n,e)),n}appendRules(t){""!==t&&(he(this,dn,"f").push(t),he(this,hn,"f")>0&&he(this,ln,"m",fn).call(this))}mount(){var t;ue(this,hn,(t=he(this,hn,"f"),++t),"f"),1===he(this,hn,"f")&&(he(this,ln,"m",fn).call(this),he(this,un,"f")||he(this,ln,"m",pn).call(this))}unmount(){var t;he(this,hn,"f")<=0||(ue(this,hn,(t=he(this,hn,"f"),--t),"f"),0===he(this,hn,"f")&&he(this,ln,"m",mn).call(this))}get refCount(){return he(this,hn,"f")}get cssText(){return he(this,cn,"f")}get isMounted(){return he(this,hn,"f")>0}get sheet(){return he(this,un,"f")}getAllCSS(){const t=[];return he(this,cn,"f")&&t.push(he(this,cn,"f")),he(this,dn,"f").length>0&&t.push(he(this,dn,"f").join("\n")),t.join("\n")}}function En(){_n("stylesheet");const t=new Sn;return{css:function(e){_n("css");const n=[],s=rn(e,n);return n.length>0&&t.appendRules(n.join("\n")),an(s)},mount:function(){if(function(t){if(oe.templateInProgress)throw new Error(`[css-in-js] ${t}() must not be called inside a template function. Call it in the component outer function or at module level.`)}("mount"),null===ve(!1))return t.mount(),()=>t.unmount();Re(()=>(t.mount(),()=>t.unmount()))},keyframes:function(e,n){return _n("keyframes"),t.keyframes(e,n)}}}cn=new WeakMap,hn=new WeakMap,un=new WeakMap,dn=new WeakMap,ln=new WeakSet,fn=function(){if(0===he(this,dn,"f").length)return;const t=he(this,dn,"f").join("\n");ue(this,dn,[],"f"),ue(this,cn,he(this,cn,"f")+(he(this,cn,"f")?"\n":"")+t,"f"),he(this,ln,"m",pn).call(this)},pn=function(){he(this,un,"f")||(ue(this,un,new CSSStyleSheet,"f"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,he(this,un,"f")]),he(this,un,"f").replaceSync(he(this,cn,"f"))},mn=function(){he(this,un,"f")&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(t=>t!==he(this,un,"f")),ue(this,un,null,"f")),he(this,cn,"f")&&(he(this,dn,"f").unshift(he(this,cn,"f")),ue(this,cn,"","f"))};let Cn=null,An=!1;function kn(){return Cn||(Cn=new Sn),Cn}function Mn(){Cn||(Cn=new Sn),An||(An=!0,queueMicrotask(()=>{An=!1,Cn.mount()}))}function $n(t,e){_n("keyframes"),Mn();const n=yn(t);return Cn.appendRules(wn(n,e)),n}function Tn(t,e){_n("globalCSS"),Mn();const n=[],s=rn(t,n,e);return n.length>0&&Cn.appendRules(n.join("\n")),an(s)}function Rn(t){_n("globalRawCSS"),Mn(),Cn.appendRules(t)}let xn=!1;function On(){xn||(xn=!0,Rn('\n[class*="mates-"] {\n --mates-duration : 300ms;\n --mates-easing : ease;\n --mates-distance : 24px;\n animation-duration : var(--mates-duration);\n animation-timing-function : var(--mates-easing);\n animation-fill-mode : both;\n}\n'),Rn("\n@keyframes mates-kf-fade-in { from { opacity: 0 } to { opacity: 1 } }\n@keyframes mates-kf-fade-out { from { opacity: 1 } to { opacity: 0 } }\n\n@keyframes mates-kf-slide-in-up {\n from { opacity: 0; transform: translateY(var(--mates-distance)) }\n to { opacity: 1; transform: translateY(0) }\n}\n@keyframes mates-kf-slide-out-up {\n from { opacity: 1; transform: translateY(0) }\n to { opacity: 0; transform: translateY(calc(-1 * var(--mates-distance))) }\n}\n@keyframes mates-kf-slide-in-down {\n from { opacity: 0; transform: translateY(calc(-1 * var(--mates-distance))) }\n to { opacity: 1; transform: translateY(0) }\n}\n@keyframes mates-kf-slide-out-down {\n from { opacity: 1; transform: translateY(0) }\n to { opacity: 0; transform: translateY(var(--mates-distance)) }\n}\n@keyframes mates-kf-slide-in-left {\n from { opacity: 0; transform: translateX(var(--mates-distance)) }\n to { opacity: 1; transform: translateX(0) }\n}\n@keyframes mates-kf-slide-out-left {\n from { opacity: 1; transform: translateX(0) }\n to { opacity: 0; transform: translateX(calc(-1 * var(--mates-distance))) }\n}\n@keyframes mates-kf-slide-in-right {\n from { opacity: 0; transform: translateX(calc(-1 * var(--mates-distance))) }\n to { opacity: 1; transform: translateX(0) }\n}\n@keyframes mates-kf-slide-out-right {\n from { opacity: 1; transform: translateX(0) }\n to { opacity: 0; transform: translateX(var(--mates-distance)) }\n}\n\n@keyframes mates-kf-scale-in {\n from { opacity: 0; transform: scale(0.92) }\n to { opacity: 1; transform: scale(1) }\n}\n@keyframes mates-kf-scale-out {\n from { opacity: 1; transform: scale(1) }\n to { opacity: 0; transform: scale(0.92) }\n}\n\n@keyframes mates-kf-spring-in {\n from { opacity: 0; transform: scale(0.92) }\n to { opacity: 1; transform: scale(1) }\n}\n\n@keyframes mates-kf-flip-in-x {\n from { opacity: 0; transform: rotateX(90deg) }\n to { opacity: 1; transform: rotateX(0deg) }\n}\n@keyframes mates-kf-flip-in-y {\n from { opacity: 0; transform: rotateY(90deg) }\n to { opacity: 1; transform: rotateY(0deg) }\n}\n\n@keyframes mates-kf-blur-in {\n from { opacity: 0; filter: blur(10px) }\n to { opacity: 1; filter: blur(0) }\n}\n@keyframes mates-kf-blur-out {\n from { opacity: 1; filter: blur(0) }\n to { opacity: 0; filter: blur(10px) }\n}\n\n@keyframes mates-kf-shake {\n 0%, 100% { transform: translateX(0) }\n 15% { transform: translateX(calc(-1 * var(--mates-distance))) }\n 30% { transform: translateX(calc( 1 * var(--mates-distance))) }\n 45% { transform: translateX(calc(-0.6 * var(--mates-distance))) }\n 60% { transform: translateX(calc( 0.6 * var(--mates-distance))) }\n 75% { transform: translateX(calc(-0.3 * var(--mates-distance))) }\n 90% { transform: translateX(calc( 0.3 * var(--mates-distance))) }\n}\n\n@keyframes mates-kf-pulse {\n 0%, 100% { transform: scale(1) }\n 50% { transform: scale(1.08) }\n}\n\n@keyframes mates-kf-bounce {\n 0% { transform: translateY(0) }\n 20% { transform: translateY(calc(-0.40 * var(--mates-distance))) }\n 40% { transform: translateY(0) }\n 60% { transform: translateY(calc(-0.20 * var(--mates-distance))) }\n 80% { transform: translateY(0) }\n 90% { transform: translateY(calc(-0.08 * var(--mates-distance))) }\n 100% { transform: translateY(0) }\n}\n\n@keyframes mates-kf-spin {\n from { transform: rotate(0deg) }\n to { transform: rotate(360deg) }\n}\n"),Tn({"mates-fade-in":{animationName:"mates-kf-fade-in"},"mates-fade-out":{animationName:"mates-kf-fade-out"},"mates-slide-in-up":{animationName:"mates-kf-slide-in-up"},"mates-slide-out-up":{animationName:"mates-kf-slide-out-up"},"mates-slide-in-down":{animationName:"mates-kf-slide-in-down"},"mates-slide-out-down":{animationName:"mates-kf-slide-out-down"},"mates-slide-in-left":{animationName:"mates-kf-slide-in-left"},"mates-slide-out-left":{animationName:"mates-kf-slide-out-left"},"mates-slide-in-right":{animationName:"mates-kf-slide-in-right"},"mates-slide-out-right":{animationName:"mates-kf-slide-out-right"},"mates-scale-in":{animationName:"mates-kf-scale-in"},"mates-scale-out":{animationName:"mates-kf-scale-out"},"mates-spring-in":{animationName:"mates-kf-spring-in","--mates-easing":"cubic-bezier(0.34, 1.56, 0.64, 1)"},"mates-flip-in-x":{animationName:"mates-kf-flip-in-x"},"mates-flip-in-y":{animationName:"mates-kf-flip-in-y"},"mates-blur-in":{animationName:"mates-kf-blur-in"},"mates-blur-out":{animationName:"mates-kf-blur-out"},"mates-shake":{animationName:"mates-kf-shake","--mates-duration":"500ms","--mates-easing":"ease-in-out"},"mates-pulse":{animationName:"mates-kf-pulse","--mates-duration":"600ms","--mates-easing":"ease-in-out"},"mates-bounce":{animationName:"mates-kf-bounce","--mates-duration":"700ms"},"mates-spin":{animationName:"mates-kf-spin","--mates-easing":"linear"}},{literal:!0}))}const In={fadeIn:"mates-fade-in",fadeOut:"mates-fade-out",slideInUp:"mates-slide-in-up",slideOutUp:"mates-slide-out-up",slideInDown:"mates-slide-in-down",slideOutDown:"mates-slide-out-down",slideInLeft:"mates-slide-in-left",slideOutLeft:"mates-slide-out-left",slideInRight:"mates-slide-in-right",slideOutRight:"mates-slide-out-right",scaleIn:"mates-scale-in",scaleOut:"mates-scale-out",springIn:"mates-spring-in",flipInX:"mates-flip-in-x",flipInY:"mates-flip-in-y",blurIn:"mates-blur-in",blurOut:"mates-blur-out",shake:"mates-shake",pulse:"mates-pulse",bounce:"mates-bounce",spin:"mates-spin"};function Pn(t){ae("Action");let e=t;const n=new Set;let s=null,i=null;const o=t=>{n.forEach(e=>{try{e(t)}catch(t){console.error(t)}})},r=Object.assign(function(...t){return((t,n)=>{try{let r;return r=s?s((...n)=>e.call(t,...n),...n):e.call(t,...n),i&&(r=i(r)),o(r),r}catch(t){const e=t instanceof Error?t:new Error(String(t));throw o(void 0),e}})(this,t)},{val:()=>e,set:t=>{e=t},__isAction___:!0,__subscribe:t=>(ae("subscribe"),n.add(t),()=>n.delete(t)),interceptBefore:t=>{s=t},interceptAfter:t=>{i=t}});return r}function zn(t=300,e="ease"){return{keyframes:[{opacity:0},{opacity:1}],options:{duration:t,easing:e,fill:"both"}}}function Dn(t=300,e="ease"){return{keyframes:[{opacity:1},{opacity:0}],options:{duration:t,easing:e,fill:"both"}}}On();const Ln={up:"translateY(-100%)",down:"translateY(100%)",left:"translateX(-100%)",right:"translateX(100%)"};function Nn(t="up",e,n=400,s="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:e?Un(t,e):Ln[t],opacity:0},{transform:"translate(0, 0)",opacity:1}],options:{duration:n,easing:s,fill:"both"}}}function jn(t="down",e,n=400,s="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:"translate(0, 0)",opacity:1},{transform:e?Un(t,e):Ln[t],opacity:0}],options:{duration:n,easing:s,fill:"both"}}}function Un(t,e){switch(t){case"up":return`translateY(-${e})`;case"down":return`translateY(${e})`;case"left":return`translateX(-${e})`;case"right":return`translateX(${e})`}}function Fn(t=0,e=300,n="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:`scale(${t})`,opacity:0},{transform:"scale(1)",opacity:1}],options:{duration:e,easing:n,fill:"both"}}}function Vn(t=0,e=300,n="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:"scale(1)",opacity:1},{transform:`scale(${t})`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}}function Wn(t=1,e=600,n="linear"){return{keyframes:[{transform:"rotate(0deg)"},{transform:`rotate(${360*t}deg)`}],options:{duration:e,easing:n,fill:"both"}}}function Hn(t=600){return{keyframes:[{transform:"translateY(0)",offset:0},{transform:"translateY(-30%)",offset:.3},{transform:"translateY(0)",offset:.5},{transform:"translateY(-15%)",offset:.7},{transform:"translateY(0)",offset:.85},{transform:"translateY(-5%)",offset:.95},{transform:"translateY(0)",offset:1}],options:{duration:t,easing:"ease",fill:"both"}}}function Yn(t=500,e="cubic-bezier(0.34, 1.56, 0.64, 1)"){return{keyframes:[{transform:"scale(0)",opacity:0},{transform:"scale(1)",opacity:1}],options:{duration:t,easing:e,fill:"both"}}}function Bn(t=10,e=400){return{keyframes:[{transform:"translateX(0)"},{transform:`translateX(-${t}px)`},{transform:`translateX(${t}px)`},{transform:`translateX(-${t}px)`},{transform:`translateX(${t}px)`},{transform:"translateX(0)"}],options:{duration:e,easing:"ease-in-out",fill:"both"}}}function qn(t=1.05,e=400){return{keyframes:[{transform:"scale(1)"},{transform:`scale(${t})`},{transform:"scale(1)"}],options:{duration:e,easing:"ease-in-out",fill:"both"}}}function Xn(t="y",e=500,n="ease-out"){const s="x"===t?"rotateX":"rotateY";return{keyframes:[{transform:`${s}(90deg)`,opacity:0},{transform:`${s}(0deg)`,opacity:1}],options:{duration:e,easing:n,fill:"both"}}}function Zn(t="y",e=500,n="ease-in"){const s="x"===t?"rotateX":"rotateY";return{keyframes:[{transform:`${s}(0deg)`,opacity:1},{transform:`${s}(90deg)`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}}function Gn(t=10,e=400,n="ease-out"){return{keyframes:[{filter:`blur(${t}px)`,opacity:0},{filter:"blur(0px)",opacity:1}],options:{duration:e,easing:n,fill:"both"}}}function Kn(t=10,e=400,n="ease-in"){return{keyframes:[{filter:"blur(0px)",opacity:1},{filter:`blur(${t}px)`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}}function Jn(t=500,e="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{width:"0",overflow:"hidden"},{width:"auto",overflow:"hidden"}],options:{duration:t,easing:e,fill:"both"}}}function Qn(t=500,e="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{width:"auto",overflow:"hidden"},{width:"0",overflow:"hidden"}],options:{duration:t,easing:e,fill:"both"}}}function ts(t,e,n=50){return{keyframes:t.keyframes,options:{...t.options,delay:(t.options.delay??0)+e*n}}}function es(t){if(null==t||"object"!=typeof t)return t;try{return Object.keys(t).forEach(e=>{"object"!=typeof t[e]||null===t[e]||Object.isFrozen(t[e])||es(t[e])}),Object.freeze(t)}catch(t){console.error(t)}}function ns(t,e,n){const s=ne();let i;Jt();try{i=t()}finally{Qt();se(s).forEach(t=>{"function"==typeof t.__subscribe&&e(t,n)})}return i}function ss(t,e){if(ae(t),"AsyncFunction"===e.constructor.name)throw new Error(`${t.toLowerCase()}() does not support async functions.`);if(Gt())throw new Error(`${t.toLowerCase()}() cannot be nested inside an effect() or memo().`)}function is(t){const{name:e,fn:n,onRun:s,supportsCleanup:i}=t;ss(e,n);const o=new Set;let r,a=!1;const l=()=>{if(i&&r){try{r()}catch(t){console.error("Error in effect cleanup:",t)}r=void 0}},c=()=>{if(a)return;l();const t=new Set(o);o.clear();const e=()=>{a||ke.schedule(c)};let h;try{h=ns(n,t=>{o.add(t.__subscribe(e))},e)}finally{t.forEach(t=>t())}if(a)return o.forEach(t=>t()),void o.clear();i&&"function"==typeof h&&(r=h),s(h)},h=()=>{a||(a=!0,l(),o.forEach(t=>t()),o.clear())};return c(),Ue(n,h),h}let os=0;function rs(t,e){if("function"==typeof t){const e=t;let n;const s=Symbol("skip");return is({name:"Memo",fn:()=>{try{return e()}catch(t){return console.error("[atom] Error in derived function:",t),s}},onRun:t=>{t!==s&&(n?(n.unlock("initial"),n.set(()=>t),n.lock("initial")):(n=ls(t,{skipRestrictedContextCheck:!0}),n.lock("initial")))}}),n}e?.skipRestrictedContextCheck||ae("Atom");let n=t;const s=++os,i=new me;function o(){return De(o,!1),Xt()&&Kt(o),n}return o.get=function(){return o()},o.set=function(t,e=!1){var r,a;n="function"==typeof t?t(n):t,o.skipDevToolsLog||(r=String(s),a=n,jt.logAtomSet(r,a)),e||i.notify()},o.update=function(t,e=!1){var r;"object"==typeof n&&null!==n&&(t(n),o.skipDevToolsLog||(r=String(s),jt.logAtomUpdate(r)),e||i.notify())},o.__subscribe=function(t){return i.subscribe(t)},o.toJSON=function(){return JSON.stringify(n)},Object.defineProperty(o,"name",{value:"atom",writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(o,"val",{get:()=>o(),set:t=>o.set(t),enumerable:!1,configurable:!0}),Object.defineProperty(o,"__version__",{get:()=>i.getVersion(),enumerable:!1}),Object.defineProperty(o,"__isAtom___",{value:!0,writable:!1,enumerable:!1}),Object.defineProperty(o,"__id__",{value:s,writable:!1,enumerable:!1}),o}function as(t,e){e?.skipRestrictedContextCheck||ae("iAtom");const n=rs(cs(t),{skipRestrictedContextCheck:!0}),s=n.set;n.set=function(t,e=!1){const i="function"==typeof t?t(n.get()):t;s(cs(i),e)};const i=n;return delete i.update,i.name="iAtom",i}function ls(t,e={}){e.skipRestrictedContextCheck||ae("superAtom"),$e();const n=e.freeze??!1,s=n?cs(hs(t)):t;let i=!1,o="default";const r=rs(n?cs(t):t,{skipRestrictedContextCheck:!0}),a=r.set;r.set=function(t,e=!1){if(i)return void ce("Cannot mutate a locked atom.","superAtom");const s="function"==typeof t?t(r.get()):t;a(n?cs(s):s,e)};const l=r.update;r.update=function(t,e=!1){if(i)ce("Cannot mutate a locked atom.","superAtom");else{if(n)throw new Error("update() is not supported when freeze is enabled — use set() with a new value.");l(t,e)}};const c=r;return c.lock=function(t="default"){i=!0,o=t},c.unlock=function(t="default"){if(o!==t)throw new Error("Incorrect passcode. Cannot unlock atom.");i=!1},c.reset=function(){i||r.set(n?cs(hs(s)):s)},c.freeze=function(){es(r.get())},c.name="superAtom",c}function cs(t){return"object"==typeof t&&null!==t?es(t):t}function hs(t){try{return structuredClone(t)}catch{return t}}function us(t){const e=new Map,n=[],s=t=>JSON.stringify(t),i=t=>{e.delete(t);const s=n.indexOf(t);s>-1&&n.splice(s,1)};return{getCacheKey:s,removeCacheEntry:i,createCacheMethod:(o,r,a,l)=>async(...c)=>{const h=s(c),u=e.get(h);if(u){const e=Date.now();if(!(void 0!==t?.cacheDuration&&e-u.timestamp>t.cacheDuration)){const t=n.indexOf(h);return t>-1&&n.splice(t,1),n.push(h),o.set(u.result),r.set(null),a.set("success"),u.result}i(h)}const d=await l(this,c);e.set(h,{result:d,timestamp:Date.now()});const f=n.indexOf(h);if(f>-1&&n.splice(f,1),n.push(h),t?.cacheLimit&&n.length>t.cacheLimit){const t=n.shift();t&&e.delete(t)}return d},createClearCacheMethod:()=>(...t)=>{if(0===t.length)e.clear(),n.length=0;else{const e=s(t);i(e)}}}}function ds(t){let e=null,n=null;const s=()=>{e&&(clearInterval(e),e=null,n=null)};return{createStartPollingMethod:i=>(...o)=>{t?.pollInterval?(s(),n=o,i(...o),e=setInterval(()=>{n&&i(...n)},t.pollInterval)):ce(new Error("pollInterval not specified in asyncAction options"))},createStopPollingMethod:()=>s,stopPolling:s}}function fs(t,e){e?.allowInRestrictedContext||ae("Async Action");const n={...{cacheLimit:10,pollInterval:5e3},...e};let s=t;const i=new Set;let o=null,r=null,a=null,l=null;const c=us(n),h=ds(n),u=rs(null),d=rs(null),f=rs(!1),p=rs("init"),m=t=>{i.forEach(e=>{if(void 0===e.filter||void 0===t||e.filter===t)try{e.fn()}catch(t){ce(t)}})},_=()=>{r?.isActive()&&(r.cancel(),r=null),o&&(o.abort(),o=null),f.set(!1),p.set("init")},g=async(t,e)=>{_(),f.set(!0),p.set("loading"),o=new AbortController;const n=o;try{let i;if(a){i=a((...e)=>s.call(t,...e),...e)}else i=s.call(t,...e);i?.__isZeroPromise__&&(r=i);let c=await i;if(n.signal.aborted||o!==n)throw new Error("Operation was cancelled");return l&&(c=l(c)),u.set(c),d.set(null),p.set("success"),m(!0),c}catch(t){if(n.signal.aborted||o!==n)throw t;const e=t instanceof Error?t:new Error(String(t));throw u.set(null),d.set(e),p.set("error"),m(!1),e}finally{o===n&&(o=null),f.set(!1),r&&!r.isActive()&&(r=null)}},y=async(...t)=>{const e=this;if(Ee()){const n=ve(!1);if(n?._ssrPromiseQueue){const s=g(e,t).catch(()=>{});return n._ssrPromiseQueue.push(s),s}}return g(e,t)},w=c.createCacheMethod(u,d,p,g),v=c.createClearCacheMethod(),b=h.createStartPollingMethod(y),S=h.createStopPollingMethod(),E=Object.assign(y,{data:u,error:d,isLoading:f,status:p,val:()=>s,set:t=>{s=t},params:{page:1},cancel:_,subscribe:(t,e)=>{ae("subscribe");const n={fn:t,filter:e};i.add(n);const s=()=>i.delete(n);return Ue(t,s),s},cache:w,clearCache:v,startPolling:b,stopPolling:S,interceptBefore:t=>{a=t},interceptAfter:t=>{l=t},__isAsyncAction___:!0,__isAction___:!1});return Object.defineProperty(E,"abortController",{get:()=>o,enumerable:!0,configurable:!0}),Ue(E,()=>{i.clear(),h.stopPolling(),_()}),E}const ps=(t,e,n)=>{const s="timeout"===n?setTimeout(()=>t(),e):setInterval(()=>t(),e);return Ue(s,"timeout"===n?()=>clearTimeout(s):()=>clearInterval(s)),s};class ms{constructor(){this.timeoutId=null,this.pendingArgs=null,this.pendingContext=null}clearPending(){this.pendingArgs=null,this.pendingContext=null}setPending(t,e){this.pendingArgs=t,this.pendingContext=e}clearTimer(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}setTimer(t,e){this.timeoutId=((t,e)=>ps(t,e,"timeout"))(t,e)}executePending(t){return this.pendingArgs&&(this.lastResult=t.apply(this.pendingContext,this.pendingArgs),this.clearPending()),this.lastResult}}function _s(t,e){return()=>{t.clearTimer(),t.clearPending(),e?.()}}function gs(t,e){return()=>{if(t.pendingArgs&&t.timeoutId){t.clearTimer();return t.executePending(e)}return t.lastResult}}function ys(t,e){const n=new ms,s=function(...s){return n.setPending(s,this),n.clearTimer(),n.setTimer(()=>{n.lastResult=n.executePending(t),n.timeoutId=null},e),n.lastResult};return s.cancel=_s(n),s.flush=gs(n,t),s}function ws(t,e){const n=!!e?.allowInRestrictedContext,s=fs(t,e),i=rs(1,{skipRestrictedContextCheck:n}),o=rs(-1,{skipRestrictedContextCheck:n});return Object.assign(s,{page:i,totalPages:o,next:(...t)=>{if(!(-1!==o.val&&i.val>=o.val))return i.update(t=>t+1),s(...t)}})}function vs(t){ae("taskAction");const e=[];let n=0,s=1,i=!1;const o={skipRestrictedContextCheck:!0},r=rs([],o),a=rs("idle",o),l=rs(0,o);function c(){if(r.set([...e]),0===e.length)return void l.set(0);let t=0;for(const n of e)"running"===n.status?t+=.5:"pending"!==n.status&&(t+=1);l.set(Math.round(t/e.length*100))}function h(){if(i){const t=e.some(t=>"running"===t.status);return void(t||a.set("idle"))}if("running"!==a.get())return;const n=e.filter(t=>"running"===t.status).length,o=e.filter(t=>"pending"===t.status);if(0===o.length&&0===n)return void a.set("idle");const r=-1===s?o.length:Math.max(0,s-n);0!==r&&o.slice(0,r).forEach(e=>function(e){const n=new AbortController;e.status="running",e.abortController=n;const s=t(e.input,n.signal);if(s?.__isZeroPromise__){const t=s;e.abortController={signal:t.signal,abort:()=>{t.cancel()}}}c(),Promise.resolve(s).then(t=>{"cancelled"===e.status||(e.status="success",e.result.data=t),e.abortController=null,c(),h()}).catch(t=>{if("cancelled"===e.status||!0===e.abortController?.signal?.aborted)e.status="cancelled",e.abortController=null;else{const n=t instanceof Error?t:new Error(String(t));e.status="failed",e.result.error=n,e.abortController=null,ce(n,"taskAction")}c(),h()})}(e))}function u(t){return{id:++n,input:t,status:"pending",result:{data:null,error:null},abortController:null}}function d(t){const n=Array.isArray(t)?t:[t];for(const t of n)e.push(u(t));c(),"running"!==a.get()||i||h()}function f(t=1){"running"!==a.get()&&(s=t,i=!1,a.set("running"),h())}function p(){i=!0,function(){for(const t of e)"running"===t.status&&(t.status="cancelled",t.abortController?.abort(),t.abortController=null)}(),a.set("idle"),c()}function m(t){p(),e.length=0,n=0,c(),d(t)}const _={add:d,start:f,pause:function(){i||(i=!0)},stop:p,delete:function(t){const n=Array.isArray(t)?t:[t],s=new Set(n.map(t=>t.id));for(let t=e.length-1;t>=0;t--){const n=e[t];s.has(n.id)&&("running"===n.status&&(n.status="cancelled",n.abortController?.abort(),n.abortController=null),e.splice(t,1))}c(),"running"!==a.get()||i||h()},clearAndAdd:m,addAndStart:function(t,e=1){d(t),f(e)},clearAndStart:function(t,e=1){m(t),f(e)},isRunning:function(){return"running"===a.val},progress:l,tasks:r,pendingTasks:function(){return r.val.filter(t=>"pending"===t.status)},runningTasks:function(){return r.val.filter(t=>"running"===t.status)},successTasks:function(){return r.val.filter(t=>"success"===t.status)},failedTasks:function(){return r.val.filter(t=>"failed"===t.status)},cancelledTasks:function(){return r.val.filter(t=>"cancelled"===t.status)},__isTaskAction__:!0};return Ue(_,p),_}function bs(t,e){const n=new ms;let s=0;const i=function(...i){const o=Date.now(),r=o-s;return r>=e?(s=o,n.lastResult=t.apply(this,i),n.clearPending(),n.clearTimer()):(n.setPending(i,this),n.timeoutId||n.setTimer(()=>{s=Date.now(),n.lastResult=n.executePending(t),n.timeoutId=null},e-r)),n.lastResult};return i.cancel=_s(n,()=>{s=0}),i.flush=gs(n,t),i}function Ss(t,e){return"function"!=typeof t.animate?Promise.resolve():("function"==typeof t.getAnimations&&t.getAnimations().forEach(t=>t.cancel()),new Promise(n=>{const s=t.animate(e.keyframes,{duration:300,easing:"ease",fill:"both",...e.options});s.onfinish=()=>n(),s.oncancel=()=>n()}))}async function Es(t){const{el:e,exit:n,enter:s,swap:i,getEl:o,isStale:r}=t;if(!e)return void i();if(await Ss(e,n),r?.())return;if(i(),await("function"!=typeof requestAnimationFrame?Promise.resolve():new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(()=>t())))),r?.())return;const a=o?.()??e;a&&await Ss(a,s)}function Cs(t){return t.__isEffect__=!0,is({name:"Effect",fn:t,onRun:()=>{},supportsCleanup:!0})}const As=new WeakMap,ks=B(class extends ut{render(t){return C}update(t,[e]){const n=e!==this.Y;return n&&void 0!==this.Y&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),C}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.Y){const e=this.ht??globalThis;let n=As.get(e);void 0===n&&(n=new WeakMap,As.set(e,n)),void 0!==n.get(this.Y)&&this.Y.call(this.ht,void 0),n.set(this.Y,t),void 0!==t&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){return"function"==typeof this.Y?As.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Ms(){const t=new _e;let e;const n={get value(){return e},__subscribe:e=>t.subscribe(e),__isMatesRef__:!0,__set:n=>{e!==n&&(e=n,t.trigger(n))}};return n}function $s(t){if(t&&t.__isMatesRef__){const e=t;return ks(t=>{e.__set(t)})}return ks(t)}const Ts=(t,e={})=>b`<x-view .view=${t} .props=${e}></x-view>`,Rs=Ts,xs=Ts,Os=(t,e,n={})=>U(Ts(t,n),e),Is=Os,Ps=rs("undefined"!=typeof window?window.history.state:null),zs=rs(!1),Ds=()=>zs.set(!0),Ls=()=>zs.set(!1),Ns=Ve("router:navigation-request"),js=t=>{Ee()||($e(),Ne(()=>{const e=t(Ns);return"function"==typeof e?e:void 0},[Ns]))},Us=ls("undefined"!=typeof window?window.location.pathname:"/");function Fs(t){t.preventDefault(),t.returnValue=""}Cs(()=>(zs()?(Us.lock(),"undefined"!=typeof window&&window.addEventListener("beforeunload",Fs)):(Us.unlock(),"undefined"!=typeof window&&window.removeEventListener("beforeunload",Fs)),()=>{"undefined"!=typeof window&&window.removeEventListener("beforeunload",Fs)})),"undefined"!=typeof window&&(window.addEventListener("popstate",t=>{if(zs())return window.history.pushState(window.history.state,"",Us.get()),void Ps.set(window.history.state??null);const e=window.location.pathname;if(e!==Us.get()&&Ns.trigger({to:e,from:Us.get()}),zs())return window.history.pushState(window.history.state,"",Us.get()),void Ps.set(window.history.state??null);Ps.set(t.state??null),e!==Us.get()&&Us.set(e)}),window.addEventListener("hashchange",()=>{if(zs())return;const t=window.location.pathname;t!==Us.get()&&Us.set(t)}),window.addEventListener("navigate",()=>{if(zs())return;const t=window.location.pathname;t!==Us.get()&&Us.set(t)}));const Vs=t=>{const e=Us.get();if(e===t)return!0;const n=t.split("/").filter(Boolean),s=e.split("/").filter(Boolean);if(n.length!==s.length)return!1;for(let t=0;t<n.length;t++){const e=n[t],i=s[t];if(e.startsWith(":")){if(!i)return!1}else if(e!==i)return!1}return!0},Ws=t=>{const e=Ms(),n=()=>t().options,s=t().options.notFound?{path:"*",component:t().options.notFound}:null,i=()=>{const{routes:e}=t(),n=e.find(t=>Vs(t.path));return n??s},o=i(),r=rs(o),a=rs(o);return Cs(()=>{const t=a();if(t===r.get())return;const s=e.value;if(!s)return void r.set(t);const i=n(),o=r.get();Es({el:s,exit:o?.exit??i.exit??Dn(200),enter:t?.enter??i.enter??zn(250),swap:()=>r.set(t),getEl:()=>e.value,isStale:()=>a.get()!==t})}),Cs(()=>{Us(),function(t){a.get()!==t&&a.set(t)}(i())}),Re(()=>{const t=e.value;if(!t)return;const s=r.get(),i=n();Ss(t,s?.enter??i.enter??zn(250))}),()=>{const t=r();return b`
100
110
  <div style="position:relative;overflow:hidden">
101
- <div ${Hn(e)}>
102
- ${t?Yn(t.component,t.props??{}):C}
111
+ <div ${$s(e)}>
112
+ ${t?Ts(t.component,t.props??{}):C}
103
113
  </div>
104
114
  </div>
105
- `}};function ss(...t){const[e,n]=t;return e.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g,(t,e)=>{if(!n||!(e in n))throw new Error(`Missing parameter: "${e}"`);return String(n[e])})}const is=()=>{if("undefined"==typeof window)return{};const t=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,e=new URLSearchParams(t),n={};for(const[t,s]of e)try{n[t]=JSON.parse(s)}catch{n[t]=s}return n},os=Cn(is());let rs=!1;Un(()=>{const t=os();rs||Kn()||(t=>{if("undefined"==typeof window)return;const e=new URLSearchParams;for(const n in t){const s=t[n];null!=s&&e.set(n,"object"==typeof s?JSON.stringify(s):String(s))}const n=e.toString(),s=window.location.pathname+window.location.search+(n?`#${n}`:"");window.history.replaceState(null,"",s)})(t)});const as=()=>{Kn()||(rs=!0,os.set(is()),rs=!1)};function ls(t,e,n){if(Kn())return;if(t===Qn.get())return;const s=t.includes("?"),i=t.includes("#");let o=t;if(s||i)if(i){if(!s){const e=t.indexOf("#");o=t.slice(0,e)+window.location.search+t.slice(e)}}else o=t+window.location.hash;else{o=t+window.location.search+window.location.hash}Jn.trigger({to:t,from:Qn.get()}),Kn()||(Zn.set(n??null),e?window.history.replaceState(n,"",o):window.history.pushState(n,"",o),Qn.set(t))}"undefined"!=typeof window&&window.addEventListener("hashchange",as);const cs=()=>{if("undefined"==typeof window)return{};const t=new URLSearchParams(window.location.search),e={};for(const[n,s]of t)try{e[n]=JSON.parse(s)}catch{e[n]=s}return e},hs=Cn(cs());let us=!1;Un(()=>{const t=hs();us||Kn()||(t=>{if("undefined"==typeof window)return;const e=new URLSearchParams;for(const n in t){const s=t[n];null!=s&&e.set(n,"object"==typeof s?JSON.stringify(s):String(s))}const n=e.toString(),s=window.location.pathname+(n?`?${n}`:"")+window.location.hash;window.history.replaceState(null,"",s)})(t)});const ds=()=>{Kn()||(us=!0,hs.set(cs()),us=!1)};"undefined"!=typeof window&&window.addEventListener("popstate",ds);const fs={get path(){return Qn.get()},get hash(){return os()},get qsObj(){return hs()}};let ps=null,ms=null;function _s(){return ps}function gs(){return ms}class ys{constructor(){this.state="idle",this.__isZeroPromise__=!0,this.toActive()}isActive(){return"active"===this.state}isResolved(){return"resolved"===this.state}isRejected(){return"rejected"===this.state}isCancelled(){return"cancelled"===this.state}get signal(){return this.controller.signal}toActive(){return"active"===this.state||(this.state="active",this.controller=new AbortController,this.promise=new Promise((t,e)=>{this.resolveFn=t,this.rejectFn=e,this.controller.signal.addEventListener("abort",()=>{"active"===this.state&&(this.state="cancelled",e(new DOMException("Cancelled","AbortError")))})})),this}resolve(t){this.isActive()&&(this.state="resolved",this.resolveFn(t))}reject(t){this.isActive()&&(this.state="rejected",this.rejectFn(t))}cancel(t){this.isActive()&&this.controller.abort(t)}then(t,e){return this.promise.then(t,e)}catch(t){return this.promise.catch(t)}finally(t){return this.promise.finally(t)}get[Symbol.toStringTag](){return"ZeroPromise"}}const ws={100:"CONTINUE",101:"SWITCHING_PROTOCOLS",102:"PROCESSING",103:"EARLY_HINTS",200:"OK",201:"CREATED",202:"ACCEPTED",203:"NON_AUTHORITATIVE_INFORMATION",204:"NO_CONTENT",205:"RESET_CONTENT",206:"PARTIAL_CONTENT",207:"MULTI_STATUS",208:"ALREADY_REPORTED",226:"IM_USED",300:"MULTIPLE_CHOICES",301:"MOVED_PERMANENTLY",302:"FOUND",303:"SEE_OTHER",304:"NOT_MODIFIED",305:"USE_PROXY",307:"TEMPORARY_REDIRECT",308:"PERMANENT_REDIRECT",400:"BAD_REQUEST",401:"UNAUTHORIZED",402:"PAYMENT_REQUIRED",403:"FORBIDDEN",404:"NOT_FOUND",405:"METHOD_NOT_ALLOWED",406:"NOT_ACCEPTABLE",407:"PROXY_AUTHENTICATION_REQUIRED",408:"REQUEST_TIMEOUT",409:"CONFLICT",410:"GONE",411:"LENGTH_REQUIRED",412:"PRECONDITION_FAILED",413:"PAYLOAD_TOO_LARGE",414:"URI_TOO_LONG",415:"UNSUPPORTED_MEDIA_TYPE",416:"RANGE_NOT_SATISFIABLE",417:"EXPECTATION_FAILED",418:"IM_A_TEAPOT",421:"MISDIRECTED_REQUEST",422:"UNPROCESSABLE_ENTITY",423:"LOCKED",424:"FAILED_DEPENDENCY",425:"TOO_EARLY",426:"UPGRADE_REQUIRED",428:"PRECONDITION_REQUIRED",429:"TOO_MANY_REQUESTS",431:"REQUEST_HEADER_FIELDS_TOO_LARGE",451:"UNAVAILABLE_FOR_LEGAL_REASONS",500:"INTERNAL_SERVER_ERROR",501:"NOT_IMPLEMENTED",502:"BAD_GATEWAY",503:"SERVICE_UNAVAILABLE",504:"GATEWAY_TIMEOUT",505:"HTTP_VERSION_NOT_SUPPORTED",506:"VARIANT_ALSO_NEGOTIATES",507:"INSUFFICIENT_STORAGE",508:"LOOP_DETECTED",510:"NOT_EXTENDED",511:"NETWORK_AUTHENTICATION_REQUIRED"};function vs(t){return"string"==typeof t?{url:t}:t}function bs(t){const{url:e="",host:n="",path:s,params:i={}}=t,o=e||s||"",r=/^https?:\/\//i.test(o)?o:`${n}${o}`,{pathParams:a,qsParams:l}=function(t,e){const n=new Set;for(const[,e]of t.matchAll(/:([a-zA-Z_][a-zA-Z0-9_]*)/g))n.add(e);const s={},i={};for(const[t,o]of Object.entries(e))n.has(t)?s[t]=o:i[t]=o;return{pathParams:s,qsParams:i}}(r,i),c=Object.keys(a).length>0?ss(r,a):r;if(0===Object.keys(l).length)return c;let h,u;if(/^https?:\/\//i.test(c)){const t=new URL(c);h=t.origin+t.pathname,u=t.search}else{const t=c.indexOf("?");h=-1===t?c:c.slice(0,t),u=-1===t?"":c.slice(t)}const d=new URLSearchParams(u);for(const[t,e]of Object.entries(l))null!=e&&(Array.isArray(e)?e.forEach(e=>d.append(t,String(e))):d.set(t,String(e)));const f=d.toString();return f?`${h}?${f}`:h}function Ss(t,e){return t.add(e),()=>t.delete(e)}const xs=new Set,Cs=new Set,Es=new Set;class As{constructor(t={}){this.instanceBeforeFns=[],this.instanceAfterFns=[],this.instanceErrorFns=[],this.baseRequest=t}interceptBefore(t){return this.instanceBeforeFns.push(t),()=>{const e=this.instanceBeforeFns.indexOf(t);-1!==e&&this.instanceBeforeFns.splice(e,1)}}interceptAfter(t){return this.instanceAfterFns.push(t),()=>{const e=this.instanceAfterFns.indexOf(t);-1!==e&&this.instanceAfterFns.splice(e,1)}}interceptError(t){return this.instanceErrorFns.push(t),()=>{const e=this.instanceErrorFns.indexOf(t);-1!==e&&this.instanceErrorFns.splice(e,1)}}clearInterceptors(){this.instanceBeforeFns.length=0,this.instanceAfterFns.length=0,this.instanceErrorFns.length=0}fetch(t){const e=new ys,n={...this.baseRequest,...t,headers:{...this.baseRequest.headers,...t.headers},params:{...this.baseRequest.params,...t.params}},{body:s,url:i,host:o,params:r,path:a,...l}=n,c=bs(n),h=function(t){return null==t?{}:"string"==typeof t||t instanceof FormData||t instanceof Blob||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof URLSearchParams||t instanceof ReadableStream?{body:t}:{body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}}(s),u=(n.method??"GET").toUpperCase(),d=_s(),f=gs();if(me()&&d){let t;try{t=c.startsWith("http")?new URL(c).pathname:c.split("?")[0]}catch{t=c.split("?")[0]}if(t.startsWith("/api")){const n=d(u,t);if(n){const t={"content-type":"application/json",...l.headers,...h.headers};if(f){const e=f.headers.get("cookie"),n=f.headers.get("authorization");e&&(t.cookie=e),n&&(t.authorization=n)}const s=new Request(c.startsWith("http")?c:`http://localhost${c}`,{method:u,headers:t,body:h.body??null});return n.handler(s,n.ctx).then(async t=>{if(!t.ok){const n=ws[t.status]||"UNKNOWN_ERROR";return void e.reject(new Error(`${n}: ${t.statusText}`))}const n=t.headers.get("content-type");n?.includes("application/json")?e.resolve(await t.json()):e.resolve(t)}).catch(t=>e.reject(t)),e}}}return(async()=>{let t,n=c,s={...l,method:u,...h,headers:{...l.headers,...h.headers}};0===Object.keys(s.headers).length&&delete s.headers;for(const t of this.instanceBeforeFns){const e=await t(n,s);n=e.url,s=e.options}for(const t of xs){const e=await t(n,s);n=e.url,s=e.options}try{t=await fetch(n,{...s,signal:e.signal})}catch(t){for(const e of this.instanceErrorFns)try{e(t)}catch(t){}for(const e of Es)try{e(t)}catch(t){}return void e.reject(t)}let i=t;for(const t of this.instanceAfterFns)i=await t(i);for(const t of Cs)i=await t(i);if(!i.ok){const t=ws[i.status]||"UNKNOWN_ERROR",n=new Error(`${t}: ${i.statusText}`);for(const t of this.instanceErrorFns)try{t(n)}catch(t){}for(const t of Es)try{t(n)}catch(t){}return void e.reject(n)}const o=i.headers.get("content-type");if(o?.includes("application/json")){const t=await i.json();e.resolve(t)}else e.resolve(i)})().catch(t=>e.reject(t)),e}Fetch(t){return this.fetch(t)}Get(t){return this.fetch({...t,method:"GET"})}Post(t){return this.fetch({...t,method:"POST"})}Put(t){return this.fetch({...t,method:"PUT"})}Patch(t){return this.fetch({...t,method:"PATCH"})}Delete(t){return this.fetch({...t,method:"DELETE"})}fetchAction(t){const{baseRequest:e,options:n}=function(t){if(!t)return{baseRequest:{},options:{}};const{cacheDuration:e,cacheLimit:n,pollInterval:s,allowInRestrictedContext:i,...o}=t;return{baseRequest:o,options:{...void 0!==e&&{cacheDuration:e},...void 0!==n&&{cacheLimit:n},...void 0!==s&&{pollInterval:s},...void 0!==i&&{allowInRestrictedContext:i}}}}(t);return Rn(t=>this.fetch({...e,params:{...e.params,...t}}),n)}getAction(t){return this.fetchAction({...t,method:"GET"})}postAction(t){return this.fetchAction({...t,method:"POST"})}putAction(t){return this.fetchAction({...t,method:"PUT"})}patchAction(t){return this.fetchAction({...t,method:"PATCH"})}deleteAction(t){return this.fetchAction({...t,method:"DELETE"})}}const ks=new As({});const Ms="mates-theme";function $s(t){return"auto"===t?function(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}():t}const Ts=function(){const t=Cn(function(){try{const t=localStorage.getItem(Ms);return"light"===t||"dark"===t||"auto"===t?t:null}catch{return null}}()??"auto",{skipRestrictedContextCheck:!0}),e=t;return e.setToLight=()=>{t.set("light")},e.setToDark=()=>{t.set("dark")},e.setToAuto=()=>{t.set("auto")},e.toggle=()=>{const e=$s(t.get());t.set("dark"===e?"light":"dark")},Object.defineProperty(e,"resolved",{get:()=>$s(t.get()),enumerable:!1,configurable:!0}),Object.defineProperty(e,"name",{value:"themeAtom",writable:!0,configurable:!0,enumerable:!1}),Un(()=>{const e=t.get();!function(t){try{document.documentElement.setAttribute("data-theme",$s(t))}catch{}}(e),function(t){try{"auto"===t?localStorage.removeItem(Ms):localStorage.setItem(Ms,t)}catch{}}(e)}),"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{"auto"===t.get()&&t.set("auto")}),e}();function Rs(t){return t.startsWith("--")?t:`--${t}`}function Os(t,e){let n="";for(const t in e){n+=` ${Rs(t)}: ${e[t]};\n`}return n?`${t} {\n${n}}`:""}function Ps(t){if(null==t)return{action:"remove"};if("boolean"==typeof t)return t?{action:"set",value:""}:{action:"remove"};if("string"==typeof t)return{action:"set",value:t};if("number"==typeof t)return{action:"set",value:String(t)};if(Array.isArray(t)){if(2===t.length){const[e,n]=t;return e?"boolean"==typeof n?n?{action:"set",value:""}:{action:"remove"}:{action:"set",value:String(n)}:{action:"remove"}}if(3===t.length){const[e,n,s]=t,i=e?n:s;return"boolean"==typeof i?i?{action:"set",value:""}:{action:"remove"}:{action:"set",value:String(i)}}}return{action:"remove"}}function Is(t){return t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function zs(t){if(null==t||!1===t)return null;if("string"==typeof t)return t;if("number"==typeof t)return String(t);if(Array.isArray(t)){if(2===t.length){const[e,n]=t;return e?String(n):null}if(3===t.length){const[e,n,s]=t;return String(e?n:s)}}return null}const Ds=new WeakMap,Ls=new WeakMap,Ns=new WeakMap,js=new WeakMap;class Us{constructor(t){this.el=t}attr(t){const e=this.el;Ds.has(e)||Ds.set(e,new Map);const n=Ds.get(e),s=new Map;for(const[i,o]of Object.entries(t)){const t=Ps(o);"set"===t.action?(n.get(i)!==t.value&&e.setAttribute(i,t.value),s.set(i,t.value)):n.has(i)&&e.removeAttribute(i)}for(const t of n.keys())s.has(t)||e.removeAttribute(t);return Ds.set(e,s),this}updateAttr(t){const e=this.el;Ds.has(e)||Ds.set(e,new Map);const n=Ds.get(e),s=Object.fromEntries(n);t(s);const i=new Map;for(const[t,o]of Object.entries(s))n.get(t)!==o&&e.setAttribute(t,o),i.set(t,o);for(const t of n.keys())i.has(t)||e.removeAttribute(t);return Ds.set(e,i),this}style(t){const e=this.el;Ls.has(e)||Ls.set(e,new Map);const n=Ls.get(e),s=new Map;for(const[i,o]of Object.entries(t)){const t=zs(o),r=Is(i);null!==t?(n.get(r)!==t&&e.style.setProperty(r,t),s.set(r,t)):n.has(r)&&e.style.removeProperty(r)}for(const t of n.keys())s.has(t)||e.style.removeProperty(t);return Ls.set(e,s),this}classes(t){const e=this.el;Ns.has(e)||Ns.set(e,new Set);const n=Ns.get(e),s=function(t){const e=new Set,n=t=>{for(const n of t.split(/\s+/))n&&e.add(n)};if("string"==typeof t)return n(t),e;if(Array.isArray(t)){for(const e of t)if(e||0===e)if("string"!=typeof e){if(Array.isArray(e))if(2===e.length){const[t,s]=e;t&&s&&n(s)}else if(3===e.length){const[t,s,i]=e;n(t?s:i)}}else n(e);return e}if("object"==typeof t&&null!==t)for(const[e,s]of Object.entries(t))s&&n(e);return e}(t);for(const t of s)n.has(t)||e.classList.add(t);for(const t of n)s.has(t)||e.classList.remove(t);return Ns.set(e,s),this}addClass(t){const e=this.el;for(const n of t.split(/\s+/))n&&e.classList.add(n);return this}removeClass(t){const e=this.el;for(const n of t.split(/\s+/))n&&e.classList.remove(n);return this}toggleClass(t,e){const n=this.el;for(const s of t.split(/\s+/))s&&n.classList.toggle(s,e);return this}html(t){if(null==t)throw new Error("$(el).html() — the factory function must return a lit-html TemplateResult (e.g. () => html`<span>${value}</span>`).");return U(t,this.el),this}text(t){return this.el.textContent=String(t),this}focus(t){return this.el.focus(t),this}blur(){return this.el.blur(),this}scroll(t){const e=this.el;return"string"==typeof t?e.scrollTo({top:0,behavior:t}):t?e.scrollTo(t):e.scrollTo({top:0}),this}scrollIntoView(t){return this.el.scrollIntoView(t),this}measure(t){const e=this.el.getBoundingClientRect();return t({width:e.width,height:e.height,top:e.top,left:e.left,right:e.right,bottom:e.bottom,x:e.x,y:e.y}),this}on(t,e,n){const s=this.el;js.has(s)||js.set(s,new Map);const i=js.get(s),o=i.get(t);o&&s.removeEventListener(t,o.handler,o.options);const r=e;return s.addEventListener(t,r,n),i.set(t,{handler:r,options:n}),this}off(t,e){const n=this.el,s=js.get(n);if(!s)return this;if(e){const i=s.get(t);i&&i.handler===e&&(n.removeEventListener(t,i.handler,i.options),s.delete(t))}else{const e=s.get(t);e&&(n.removeEventListener(t,e.handler,e.options),s.delete(t))}return this}once(t,e,n){const s="object"==typeof n?{...n,once:!0}:{once:!0};return this.el.addEventListener(t,e,s),this}delegate(t,e,n,s){const i=t=>{const s=t.target?.closest(e);s&&this.el.contains(s)&&n(t,s)};return this.el.addEventListener(t,i,s),js.has(this.el)||js.set(this.el,new Map),js.get(this.el).set(`${t}:delegate:${e}`,{handler:i,options:s}),this}aria(t){const e=this.el;for(const[n,s]of Object.entries(t)){const t=n.startsWith("aria-")?n:`aria-${n}`;null==s||!1===s?e.removeAttribute(t):e.setAttribute(t,String(s))}return this}getAttr(t){return this.el.getAttribute(t)}data(t){const e=this.el;for(const[n,s]of Object.entries(t)){const t=n.startsWith("data-")?n.slice(5):n,i=n.startsWith("data-")?n:`data-${n}`;null==s?e.removeAttribute(i):e.setAttribute(i,String(s));const o=t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase());null==s?delete e.dataset[o]:e.dataset[o]=String(s)}return this}}function Fs(t){if(null!==t&&"object"==typeof t&&!0===t.__isMatesRef__){const e=t;if(void 0===e.value)throw new Error("$(ref): the ref has no element attached yet (ref.value is undefined).\nDOM manipulation via $() must happen after the element has mounted.\nUse one of the lifecycle hooks where the element is guaranteed to exist:\n • onMount() — runs once after the component's first render\n • onPaint() — runs after the browser has painted\n • onUpdate() — runs after every subsequent re-render\n\nExample:\n const inputRef = ref<HTMLInputElement>();\n onMount(() => { $(inputRef).focus(); });");return new Us(e.value)}return new Us(t)}const Vs=t=>{const e=Wn(),n=t().condition,s=Cn(n),i=Cn(n);return Un(()=>{const n=i();if(n===s.get())return;const o=e.value;if(!o)return void s.set(n);const r=t().config;jn({el:o,exit:r?.exit??_n(200),enter:r?.enter??mn(250),swap:()=>s.set(n),getEl:()=>e.value,isStale:()=>i.get()!==n})}),Se(()=>{const n=e.value;if(!n)return;const s=t().config;Nn(n,s?.enter??mn(250))}),()=>{const n=s(),{condition:o,trueTpl:r,falseTpl:a}=t();return i.get()!==o&&i.set(o),b`
106
- <div ${Hn(e)} style="position:relative">
115
+ `}};function Hs(t,e={}){return Ts(Ws,{routes:t,options:e})}function Ys(...t){const[e,n]=t;return e.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g,(t,e)=>{if(!n||!(e in n))throw new Error(`Missing parameter: "${e}"`);return String(n[e])})}const Bs=()=>{if("undefined"==typeof window)return{};const t=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,e=new URLSearchParams(t),n={};for(const[t,s]of e)try{n[t]=JSON.parse(s)}catch{n[t]=s}return n},qs=rs(Bs());let Xs=!1;Cs(()=>{const t=qs();Xs||zs()||(t=>{if("undefined"==typeof window)return;const e=new URLSearchParams;for(const n in t){const s=t[n];null!=s&&e.set(n,"object"==typeof s?JSON.stringify(s):String(s))}const n=e.toString(),s=window.location.pathname+window.location.search+(n?`#${n}`:"");window.history.replaceState(null,"",s)})(t)});const Zs=()=>{zs()||(Xs=!0,qs.set(Bs()),Xs=!1)};function Gs(t,e,n){if(zs())return;if(t===Us.get())return;const s=t.includes("?"),i=t.includes("#");let o=t;if(s||i)if(i){if(!s){const e=t.indexOf("#");o=t.slice(0,e)+window.location.search+t.slice(e)}}else o=t+window.location.hash;else{o=t+window.location.search+window.location.hash}Ns.trigger({to:t,from:Us.get()}),zs()||(Ps.set(n??null),e?window.history.replaceState(n,"",o):window.history.pushState(n,"",o),Us.set(t))}function Ks(t,e){if("undefined"==typeof window)return;const n=Us.get(),s=t.split("/"),i=n.split("/");if(s.length!==i.length)return void console.warn(`replaceParams: pattern "${t}" has ${s.length} segments but current path "${n}" has ${i.length}. No-op.`);const o=new Set(s.filter(t=>t.startsWith(":")).map(t=>t.slice(1)));for(const n of Object.keys(e))o.has(n)||console.warn(`replaceParams: param "${n}" not found in pattern "${t}".`);const r=i.map((t,n)=>{const i=s[n];if(!i.startsWith(":"))return t;const o=i.slice(1);return o in e?String(e[o]):t}),a=r.join("/");a!==n&&Gs(a,!0)}"undefined"!=typeof window&&window.addEventListener("hashchange",Zs);const Js=()=>{if("undefined"==typeof window)return{};const t=new URLSearchParams(window.location.search),e={};for(const[n,s]of t)try{e[n]=JSON.parse(s)}catch{e[n]=s}return e},Qs=rs(Js());let ti=!1;Cs(()=>{const t=Qs();ti||zs()||(t=>{if("undefined"==typeof window)return;const e=new URLSearchParams;for(const n in t){const s=t[n];null!=s&&e.set(n,"object"==typeof s?JSON.stringify(s):String(s))}const n=e.toString(),s=window.location.pathname+(n?`?${n}`:"")+window.location.hash;window.history.replaceState(null,"",s)})(t)});const ei=()=>{zs()||(ti=!0,Qs.set(Js()),ti=!1)};"undefined"!=typeof window&&window.addEventListener("popstate",ei);const ni={get path(){return Us.get()},get hash(){return qs()},get qsObj(){return Qs()}},si=(t,{view:e})=>Vs(t)?e?Rs(e,{}):C:null,ii=(t,e)=>{const n=t.find(t=>Vs(t.path));if(void 0===n)return e?()=>Ts(e):()=>C;const{component:s}=n;return He(s),()=>Ts(s)};let oi=null,ri=null;function ai(t){oi=t}function li(t){ri=t}function ci(){return oi}function hi(){return ri}class ui{constructor(){this.state="idle",this.__isZeroPromise__=!0,this.toActive()}isActive(){return"active"===this.state}isResolved(){return"resolved"===this.state}isRejected(){return"rejected"===this.state}isCancelled(){return"cancelled"===this.state}get signal(){return this.controller.signal}toActive(){return"active"===this.state||(this.state="active",this.controller=new AbortController,this.promise=new Promise((t,e)=>{this.resolveFn=t,this.rejectFn=e,this.controller.signal.addEventListener("abort",()=>{"active"===this.state&&(this.state="cancelled",e(new DOMException("Cancelled","AbortError")))})})),this}resolve(t){this.isActive()&&(this.state="resolved",this.resolveFn(t))}reject(t){this.isActive()&&(this.state="rejected",this.rejectFn(t))}cancel(t){this.isActive()&&this.controller.abort(t)}then(t,e){return this.promise.then(t,e)}catch(t){return this.promise.catch(t)}finally(t){return this.promise.finally(t)}get[Symbol.toStringTag](){return"ZeroPromise"}}const di={100:"CONTINUE",101:"SWITCHING_PROTOCOLS",102:"PROCESSING",103:"EARLY_HINTS",200:"OK",201:"CREATED",202:"ACCEPTED",203:"NON_AUTHORITATIVE_INFORMATION",204:"NO_CONTENT",205:"RESET_CONTENT",206:"PARTIAL_CONTENT",207:"MULTI_STATUS",208:"ALREADY_REPORTED",226:"IM_USED",300:"MULTIPLE_CHOICES",301:"MOVED_PERMANENTLY",302:"FOUND",303:"SEE_OTHER",304:"NOT_MODIFIED",305:"USE_PROXY",307:"TEMPORARY_REDIRECT",308:"PERMANENT_REDIRECT",400:"BAD_REQUEST",401:"UNAUTHORIZED",402:"PAYMENT_REQUIRED",403:"FORBIDDEN",404:"NOT_FOUND",405:"METHOD_NOT_ALLOWED",406:"NOT_ACCEPTABLE",407:"PROXY_AUTHENTICATION_REQUIRED",408:"REQUEST_TIMEOUT",409:"CONFLICT",410:"GONE",411:"LENGTH_REQUIRED",412:"PRECONDITION_FAILED",413:"PAYLOAD_TOO_LARGE",414:"URI_TOO_LONG",415:"UNSUPPORTED_MEDIA_TYPE",416:"RANGE_NOT_SATISFIABLE",417:"EXPECTATION_FAILED",418:"IM_A_TEAPOT",421:"MISDIRECTED_REQUEST",422:"UNPROCESSABLE_ENTITY",423:"LOCKED",424:"FAILED_DEPENDENCY",425:"TOO_EARLY",426:"UPGRADE_REQUIRED",428:"PRECONDITION_REQUIRED",429:"TOO_MANY_REQUESTS",431:"REQUEST_HEADER_FIELDS_TOO_LARGE",451:"UNAVAILABLE_FOR_LEGAL_REASONS",500:"INTERNAL_SERVER_ERROR",501:"NOT_IMPLEMENTED",502:"BAD_GATEWAY",503:"SERVICE_UNAVAILABLE",504:"GATEWAY_TIMEOUT",505:"HTTP_VERSION_NOT_SUPPORTED",506:"VARIANT_ALSO_NEGOTIATES",507:"INSUFFICIENT_STORAGE",508:"LOOP_DETECTED",510:"NOT_EXTENDED",511:"NETWORK_AUTHENTICATION_REQUIRED"};function fi(t){return t>=200&&t<300}function pi(t){return"string"==typeof t?{url:t}:t}function mi(t){const{url:e="",host:n="",path:s,params:i={}}=t,o=e||s||"",r=/^https?:\/\//i.test(o)?o:`${n}${o}`,{pathParams:a,qsParams:l}=function(t,e){const n=new Set;for(const[,e]of t.matchAll(/:([a-zA-Z_][a-zA-Z0-9_]*)/g))n.add(e);const s={},i={};for(const[t,o]of Object.entries(e))n.has(t)?s[t]=o:i[t]=o;return{pathParams:s,qsParams:i}}(r,i),c=Object.keys(a).length>0?Ys(r,a):r;if(0===Object.keys(l).length)return c;let h,u;if(/^https?:\/\//i.test(c)){const t=new URL(c);h=t.origin+t.pathname,u=t.search}else{const t=c.indexOf("?");h=-1===t?c:c.slice(0,t),u=-1===t?"":c.slice(t)}const d=new URLSearchParams(u);for(const[t,e]of Object.entries(l))null!=e&&(Array.isArray(e)?e.forEach(e=>d.append(t,String(e))):d.set(t,String(e)));const f=d.toString();return f?`${h}?${f}`:h}function _i(t,e){return t.add(e),()=>t.delete(e)}const gi=new Set,yi=new Set,wi=new Set,vi=t=>_i(gi,t),bi=t=>_i(yi,t),Si=t=>_i(wi,t),Ei=()=>{gi.clear(),yi.clear(),wi.clear()};class Ci{constructor(t={}){this.instanceBeforeFns=[],this.instanceAfterFns=[],this.instanceErrorFns=[],this.baseRequest=t}interceptBefore(t){return this.instanceBeforeFns.push(t),()=>{const e=this.instanceBeforeFns.indexOf(t);-1!==e&&this.instanceBeforeFns.splice(e,1)}}interceptAfter(t){return this.instanceAfterFns.push(t),()=>{const e=this.instanceAfterFns.indexOf(t);-1!==e&&this.instanceAfterFns.splice(e,1)}}interceptError(t){return this.instanceErrorFns.push(t),()=>{const e=this.instanceErrorFns.indexOf(t);-1!==e&&this.instanceErrorFns.splice(e,1)}}clearInterceptors(){this.instanceBeforeFns.length=0,this.instanceAfterFns.length=0,this.instanceErrorFns.length=0}fetch(t){const e=new ui,n={...this.baseRequest,...t,headers:{...this.baseRequest.headers,...t.headers},params:{...this.baseRequest.params,...t.params}},{body:s,url:i,host:o,params:r,path:a,...l}=n,c=mi(n),h=function(t){return null==t?{}:"string"==typeof t||t instanceof FormData||t instanceof Blob||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof URLSearchParams||t instanceof ReadableStream?{body:t}:{body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}}(s),u=(n.method??"GET").toUpperCase(),d=ci(),f=hi();if(Ee()&&d){let t;try{t=c.startsWith("http")?new URL(c).pathname:c.split("?")[0]}catch{t=c.split("?")[0]}if(t.startsWith("/api")){const n=d(u,t);if(n){const t={"content-type":"application/json",...l.headers,...h.headers};if(f){const e=f.headers.get("cookie"),n=f.headers.get("authorization");e&&(t.cookie=e),n&&(t.authorization=n)}const s=new Request(c.startsWith("http")?c:`http://localhost${c}`,{method:u,headers:t,body:h.body??null});return n.handler(s,n.ctx).then(async t=>{if(!t.ok){const n=di[t.status]||"UNKNOWN_ERROR";return void e.reject(new Error(`${n}: ${t.statusText}`))}const n=t.headers.get("content-type");n?.includes("application/json")?e.resolve(await t.json()):e.resolve(t)}).catch(t=>e.reject(t)),e}}}return(async()=>{let t,n=c,s={...l,method:u,...h,headers:{...l.headers,...h.headers}};0===Object.keys(s.headers).length&&delete s.headers;for(const t of this.instanceBeforeFns){const e=await t(n,s);n=e.url,s=e.options}for(const t of gi){const e=await t(n,s);n=e.url,s=e.options}try{t=await fetch(n,{...s,signal:e.signal})}catch(t){for(const e of this.instanceErrorFns)try{e(t)}catch(t){}for(const e of wi)try{e(t)}catch(t){}return void e.reject(t)}let i=t;for(const t of this.instanceAfterFns)i=await t(i);for(const t of yi)i=await t(i);if(!i.ok){const t=di[i.status]||"UNKNOWN_ERROR",n=new Error(`${t}: ${i.statusText}`);for(const t of this.instanceErrorFns)try{t(n)}catch(t){}for(const t of wi)try{t(n)}catch(t){}return void e.reject(n)}const o=i.headers.get("content-type");if(o?.includes("application/json")){const t=await i.json();e.resolve(t)}else e.resolve(i)})().catch(t=>e.reject(t)),e}Fetch(t){return this.fetch(t)}Get(t){return this.fetch({...t,method:"GET"})}Post(t){return this.fetch({...t,method:"POST"})}Put(t){return this.fetch({...t,method:"PUT"})}Patch(t){return this.fetch({...t,method:"PATCH"})}Delete(t){return this.fetch({...t,method:"DELETE"})}fetchAction(t){const{baseRequest:e,options:n}=function(t){if(!t)return{baseRequest:{},options:{}};const{cacheDuration:e,cacheLimit:n,pollInterval:s,allowInRestrictedContext:i,...o}=t;return{baseRequest:o,options:{...void 0!==e&&{cacheDuration:e},...void 0!==n&&{cacheLimit:n},...void 0!==s&&{pollInterval:s},...void 0!==i&&{allowInRestrictedContext:i}}}}(t);return fs(t=>this.fetch({...e,params:{...e.params,...t}}),n)}getAction(t){return this.fetchAction({...t,method:"GET"})}postAction(t){return this.fetchAction({...t,method:"POST"})}putAction(t){return this.fetchAction({...t,method:"PUT"})}patchAction(t){return this.fetchAction({...t,method:"PATCH"})}deleteAction(t){return this.fetchAction({...t,method:"DELETE"})}}const Ai=new Ci({});async function ki(t,e){let n,s=t,i=e;for(const t of gi){const e=await t(s,i);s=e.url,i=e.options}try{n=await fetch(s,i)}catch(t){for(const e of wi)try{e(t)}catch{}throw t}for(const t of yi)n=await t(n);if(!n.ok){const t=new Error(`${n.status} ${n.statusText}`);for(const e of wi)try{e(t)}catch{}}return n}function Mi(t){return async(e,n)=>({url:e,options:{...n,headers:{...n.headers,Authorization:"string"==typeof t?t:await t()}}})}function $i(t){return(e,n)=>({url:e.startsWith("http")?e:`${t}${e}`,options:n})}function Ti(t=console.log){return e=>(t(`[fetch] ${e.status} ${e.url}`),e)}const Ri=t=>Ai.fetch(pi(t)),xi=t=>Ai.Get(pi(t)),Oi=t=>Ai.Post(pi(t)),Ii=t=>Ai.Put(pi(t)),Pi=t=>Ai.Patch(pi(t)),zi=t=>Ai.Delete(pi(t)),Di=t=>Ai.fetchAction(t),Li=t=>Ai.getAction(t),Ni=t=>Ai.postAction(t),ji=t=>Ai.putAction(t),Ui=t=>Ai.patchAction(t),Fi=t=>Ai.deleteAction(t),Vi="mates-theme";function Wi(t){return"auto"===t?function(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}():t}const Hi=function(){const t=rs(function(){try{const t=localStorage.getItem(Vi);return"light"===t||"dark"===t||"auto"===t?t:null}catch{return null}}()??"auto",{skipRestrictedContextCheck:!0}),e=t;return e.setToLight=()=>{t.set("light")},e.setToDark=()=>{t.set("dark")},e.setToAuto=()=>{t.set("auto")},e.toggle=()=>{const e=Wi(t.get());t.set("dark"===e?"light":"dark")},Object.defineProperty(e,"resolved",{get:()=>Wi(t.get()),enumerable:!1,configurable:!0}),Object.defineProperty(e,"name",{value:"themeAtom",writable:!0,configurable:!0,enumerable:!1}),Cs(()=>{const e=t.get();!function(t){try{document.documentElement.setAttribute("data-theme",Wi(t))}catch{}}(e),function(t){try{"auto"===t?localStorage.removeItem(Vi):localStorage.setItem(Vi,t)}catch{}}(e)}),"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{"auto"===t.get()&&t.set("auto")}),e}();function Yi(t){return t.startsWith("--")?t:`--${t}`}function Bi(t,e){let n="";for(const t in e){n+=` ${Yi(t)}: ${e[t]};\n`}return n?`${t} {\n${n}}`:""}function qi(t){const e=Object.keys(t);if(0===e.length)throw new Error("[globalTheme] themes object must have at least one entry.");const n=e[0],s=e[1],i=t[n],o=[];o.push(Bi(":root",i));for(const n of e)o.push(Bi(`[data-theme="${n}"]`,t[n]));void 0!==s&&o.push(function(t){let e="";for(const n in t)e+=` ${Yi(n)}: ${t[n]};\n`;return e?`@media (prefers-color-scheme: dark) {\n :root:not([data-theme]) {\n${e} }\n}`:""}(t[s])),Mn();const r=kn(),a=o.filter(Boolean).join("\n");a&&r.appendRules(a);const l=Object.create(null);for(const t in i)l[t]=Yi(t);return{cssVars:Object.freeze(l),themeAtom:Hi}}function Xi(t){Mn();const e=kn(),n=Bi(":root",t);return n&&e.appendRules(n),t}function Zi(t){if(null==t)return{action:"remove"};if("boolean"==typeof t)return t?{action:"set",value:""}:{action:"remove"};if("string"==typeof t)return{action:"set",value:t};if("number"==typeof t)return{action:"set",value:String(t)};if(Array.isArray(t)){if(2===t.length){const[e,n]=t;return e?"boolean"==typeof n?n?{action:"set",value:""}:{action:"remove"}:{action:"set",value:String(n)}:{action:"remove"}}if(3===t.length){const[e,n,s]=t,i=e?n:s;return"boolean"==typeof i?i?{action:"set",value:""}:{action:"remove"}:{action:"set",value:String(i)}}}return{action:"remove"}}function Gi(t){return t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Ki(t){if(null==t||!1===t)return null;if("string"==typeof t)return t;if("number"==typeof t)return String(t);if(Array.isArray(t)){if(2===t.length){const[e,n]=t;return e?String(n):null}if(3===t.length){const[e,n,s]=t;return String(e?n:s)}}return null}const Ji=new WeakMap,Qi=new WeakMap,to=new WeakMap,eo=new WeakMap;class no{constructor(t){this.el=t}attr(t){const e=this.el;Ji.has(e)||Ji.set(e,new Map);const n=Ji.get(e),s=new Map;for(const[i,o]of Object.entries(t)){const t=Zi(o);"set"===t.action?(n.get(i)!==t.value&&e.setAttribute(i,t.value),s.set(i,t.value)):n.has(i)&&e.removeAttribute(i)}for(const t of n.keys())s.has(t)||e.removeAttribute(t);return Ji.set(e,s),this}updateAttr(t){const e=this.el;Ji.has(e)||Ji.set(e,new Map);const n=Ji.get(e),s=Object.fromEntries(n);t(s);const i=new Map;for(const[t,o]of Object.entries(s))n.get(t)!==o&&e.setAttribute(t,o),i.set(t,o);for(const t of n.keys())i.has(t)||e.removeAttribute(t);return Ji.set(e,i),this}style(t){const e=this.el;Qi.has(e)||Qi.set(e,new Map);const n=Qi.get(e),s=new Map;for(const[i,o]of Object.entries(t)){const t=Ki(o),r=Gi(i);null!==t?(n.get(r)!==t&&e.style.setProperty(r,t),s.set(r,t)):n.has(r)&&e.style.removeProperty(r)}for(const t of n.keys())s.has(t)||e.style.removeProperty(t);return Qi.set(e,s),this}classes(t){const e=this.el;to.has(e)||to.set(e,new Set);const n=to.get(e),s=function(t){const e=new Set,n=t=>{for(const n of t.split(/\s+/))n&&e.add(n)};if("string"==typeof t)return n(t),e;if(Array.isArray(t)){for(const e of t)if(e||0===e)if("string"!=typeof e){if(Array.isArray(e))if(2===e.length){const[t,s]=e;t&&s&&n(s)}else if(3===e.length){const[t,s,i]=e;n(t?s:i)}}else n(e);return e}if("object"==typeof t&&null!==t)for(const[e,s]of Object.entries(t))s&&n(e);return e}(t);for(const t of s)n.has(t)||e.classList.add(t);for(const t of n)s.has(t)||e.classList.remove(t);return to.set(e,s),this}addClass(t){const e=this.el;for(const n of t.split(/\s+/))n&&e.classList.add(n);return this}removeClass(t){const e=this.el;for(const n of t.split(/\s+/))n&&e.classList.remove(n);return this}toggleClass(t,e){const n=this.el;for(const s of t.split(/\s+/))s&&n.classList.toggle(s,e);return this}html(t){if(null==t)throw new Error("$(el).html() — the factory function must return a lit-html TemplateResult (e.g. () => html`<span>${value}</span>`).");return U(t,this.el),this}text(t){return this.el.textContent=String(t),this}focus(t){return this.el.focus(t),this}blur(){return this.el.blur(),this}scroll(t){const e=this.el;return"string"==typeof t?e.scrollTo({top:0,behavior:t}):t?e.scrollTo(t):e.scrollTo({top:0}),this}scrollIntoView(t){return this.el.scrollIntoView(t),this}measure(t){const e=this.el.getBoundingClientRect();return t({width:e.width,height:e.height,top:e.top,left:e.left,right:e.right,bottom:e.bottom,x:e.x,y:e.y}),this}on(t,e,n){const s=this.el;eo.has(s)||eo.set(s,new Map);const i=eo.get(s),o=i.get(t);o&&s.removeEventListener(t,o.handler,o.options);const r=e;return s.addEventListener(t,r,n),i.set(t,{handler:r,options:n}),this}off(t,e){const n=this.el,s=eo.get(n);if(!s)return this;if(e){const i=s.get(t);i&&i.handler===e&&(n.removeEventListener(t,i.handler,i.options),s.delete(t))}else{const e=s.get(t);e&&(n.removeEventListener(t,e.handler,e.options),s.delete(t))}return this}once(t,e,n){const s="object"==typeof n?{...n,once:!0}:{once:!0};return this.el.addEventListener(t,e,s),this}delegate(t,e,n,s){const i=t=>{const s=t.target?.closest(e);s&&this.el.contains(s)&&n(t,s)};return this.el.addEventListener(t,i,s),eo.has(this.el)||eo.set(this.el,new Map),eo.get(this.el).set(`${t}:delegate:${e}`,{handler:i,options:s}),this}aria(t){const e=this.el;for(const[n,s]of Object.entries(t)){const t=n.startsWith("aria-")?n:`aria-${n}`;null==s||!1===s?e.removeAttribute(t):e.setAttribute(t,String(s))}return this}getAttr(t){return this.el.getAttribute(t)}data(t){const e=this.el;for(const[n,s]of Object.entries(t)){const t=n.startsWith("data-")?n.slice(5):n,i=n.startsWith("data-")?n:`data-${n}`;null==s?e.removeAttribute(i):e.setAttribute(i,String(s));const o=t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase());null==s?delete e.dataset[o]:e.dataset[o]=String(s)}return this}}function so(t){if(null!==t&&"object"==typeof t&&!0===t.__isMatesRef__){const e=t;if(void 0===e.value)throw new Error("$(ref): the ref has no element attached yet (ref.value is undefined).\nDOM manipulation via $() must happen after the element has mounted.\nUse one of the lifecycle hooks where the element is guaranteed to exist:\n • onMount() — runs once after the component's first render\n • onPaint() — runs after the browser has painted\n • onUpdate() — runs after every subsequent re-render\n\nExample:\n const inputRef = ref<HTMLInputElement>();\n onMount(() => { $(inputRef).focus(); });");return new no(e.value)}return new no(t)}const io=t=>{const e=Ms(),n=t().condition,s=rs(n),i=rs(n);return Cs(()=>{const n=i();if(n===s.get())return;const o=e.value;if(!o)return void s.set(n);const r=t().config;Es({el:o,exit:r?.exit??Dn(200),enter:r?.enter??zn(250),swap:()=>s.set(n),getEl:()=>e.value,isStale:()=>i.get()!==n})}),Re(()=>{const n=e.value;if(!n)return;const s=t().config;Ss(n,s?.enter??zn(250))}),()=>{const n=s(),{condition:o,trueTpl:r,falseTpl:a}=t();return i.get()!==o&&i.set(o),b`
116
+ <div ${$s(e)} style="position:relative">
107
117
  ${n?r:a}
108
118
  </div>
109
- `}};function Ws(t,e,n=C,s){return Yn(Vs,{condition:t,trueTpl:e,falseTpl:n,config:s})}function Hs(t){const e=Qt.isHookRunning;Qt.isHookRunning=!0;try{return t()}finally{Qt.isHookRunning=e}}function Ys(t){var e,n,s,i,o;e=new WeakMap,n=new WeakMap,s=new WeakMap,i=new WeakMap,o=new WeakMap;const r=B(class extends ut{constructor(t){if(super(t),e.set(this,null),n.set(this,!1),s.set(this,null),i.set(this,!1),o.set(this,null),t.type!==Y)throw new Error("eleHook() must be used as an element expression, e.g. html`<div ${myHook()}>`")}update(r,a){const l=r.element;if(!se(this,i,"f")||l.isConnected){if(!se(this,n,"f")){ie(this,s,l,"f"),ie(this,i,!1,"f");const r=Fs(se(this,s,"f")),c=Hs(()=>t(r,...a));return ie(this,e,c??null,"f"),ie(this,n,!0,"f"),void ie(this,o,a,"f")}se(this,e,"f")?.onUpdate&&Hs(()=>se(this,e,"f").onUpdate(...a)),ie(this,o,a,"f")}else console.log("[eleHook] UPDATE SKIPPED — disconnected & host detached, el:",l)}render(...t){}disconnected(){ie(this,i,!0,"f"),console.log("[eleHook] DISCONNECTED — el:",se(this,s,"f"),"mounted:",se(this,n,"f"),"hasCleanup:",!!se(this,e,"f")?.onCleanup),se(this,e,"f")?.onCleanup&&se(this,e,"f").onCleanup(),ie(this,e,null,"f"),ie(this,n,!1,"f")}reconnected(){if(console.log("[eleHook] RECONNECTED — el:",se(this,s,"f"),"was disconnected:",se(this,i,"f"),"will re-mount:",!(!se(this,i,"f")||se(this,n,"f")||!se(this,s,"f")||!se(this,o,"f"))),ie(this,i,!1,"f"),!se(this,n,"f")&&se(this,s,"f")&&se(this,o,"f")){const i=Fs(se(this,s,"f")),r=Hs(()=>t(i,...se(this,o,"f")));ie(this,e,r??null,"f"),ie(this,n,!0,"f"),console.log("[eleHook] RE-MOUNTED after reconnect — el:",se(this,s,"f"))}}});return(...t)=>r(...t)}const Bs=Ys((t,e)=>(t.attr(e),{onUpdate(e){t.attr(e)},onCleanup(){t.attr({})}}));const qs=Ys((t,e)=>{const n=t.el;let s=new Set;const i=t=>{const e=(t=>{const e=new Set;if(Array.isArray(t))for(const n of t)if(Array.isArray(n)){if(2===n.length){const[t,s]=n;t&&s&&e.add(s)}else if(3===n.length){const[t,s,i]=n,o=t?s:i;o&&e.add(o)}}else"string"==typeof n&&n&&e.add(n);else for(const[n,s]of Object.entries(t))s&&e.add(n);return e})(t);for(const t of s)e.has(t)||n.classList.remove(t);for(const t of e)s.has(t)||n.classList.add(t);s=e};return i(e),{onUpdate(t){i(t)},onCleanup(){for(const t of s)n.classList.remove(t);s=new Set}}});const Xs=Ys((t,e,n)=>{const s=t.el;let i=n;const o=t=>{const e=t;i(e.detail,e)};return s.addEventListener(e,o),{onUpdate(t,e){i=e},onCleanup(){s.removeEventListener(e,o)}}});function Gs(t,e){if(e<=0)return{start(){t()},pause(){},resume(){},stop(){},get state(){return"stopped"},get remaining(){return 0}};let n="idle",s=e,i=0,o=null;function r(){null!==o&&(clearTimeout(o),o=null)}function a(){const t=performance.now()-i;return Math.max(0,s-t)}function l(){r(),o=setTimeout(()=>{o=null,n="stopped",s=0,t()},s)}return{start(){"running"!==n&&(s=e,i=performance.now(),n="running",l())},pause(){"running"===n&&(s=a(),r(),n="paused")},resume(){if("paused"===n){if(s<=0)return n="stopped",s=0,void t();i=performance.now(),n="running",l()}},stop(){r(),n="stopped",s=e},get state(){return n},get remaining(){return"running"===n?a():s}}}const Zs=Ys((t,e)=>{const n=t.el;let s=Gs(()=>{n.remove()},e);return s.start(),{onUpdate(t){t!==e&&(e=t,s.stop(),s=Gs(()=>{n.remove()},e),s.start())},onCleanup(){s.stop()}}});function Ks(t){const e=Qt.isHookRunning;Qt.isHookRunning=!0;try{return t()}finally{Qt.isHookRunning=e}}function Js(t){var e,n,s,i,o,r;e=new WeakMap,n=new WeakMap,s=new WeakMap,i=new WeakMap,o=new WeakMap,r=new WeakMap;const a=B(class extends ut{constructor(t){if(super(t),e.set(this,null),n.set(this,!1),s.set(this,!1),i.set(this,!1),o.set(this,null),r.set(this,t=>{se(this,i,"f")?ie(this,o,t,"f"):this.setValue(t)}),t.type!==V)throw new Error("htmlHook() must be used as a child expression, e.g. html`<div>${myHook()}</div>`")}update(a,l){if(!se(this,s,"f")||this.isConnected){if(ie(this,i,!0,"f"),ie(this,o,null,"f"),se(this,n,"f"))se(this,e,"f")?.onUpdate&&Ks(()=>se(this,e,"f").onUpdate(...l));else{const s=Ks(()=>t(se(this,r,"f"),...l));ie(this,e,s??null,"f"),ie(this,n,!0,"f")}if(ie(this,i,!1,"f"),null!==se(this,o,"f")){const t=se(this,o,"f");return ie(this,o,null,"f"),t}}else console.log("[htmlHook] UPDATE SKIPPED — disconnected & part detached")}render(...t){}disconnected(){ie(this,s,!0,"f"),se(this,e,"f")?.onCleanup&&se(this,e,"f").onCleanup(),ie(this,n,!1,"f"),ie(this,e,null,"f")}reconnected(){se(this,s,"f")&&(ie(this,s,!1,"f"),ie(this,n,!1,"f"),ie(this,e,null,"f"))}});return(...t)=>a(...t)}const Qs=Ys((t,e)=>{let n=e;const s=new IntersectionObserver(t=>{for(const e of t)e.isIntersecting?n.onVisible?.():n.onHidden?.()},{rootMargin:e.rootMargin??"0px",threshold:e.threshold??0});return s.observe(t.el),{onUpdate(t){n=t},onCleanup(){s.disconnect()}}});const ti=Ys((t,e,n)=>{let s=e,i=!1,o=!0;const r=new IntersectionObserver(t=>{for(const e of t){const t=e.isIntersecting;if(o)return o=!1,void(i=t);t&&!i&&s(),i=t}},{rootMargin:n?.rootMargin??"0px",threshold:n?.threshold??0});return r.observe(t.el),{onUpdate(t,e){s=t},onCleanup(){r.disconnect(),i=!1,o=!0}}});const ei=Ys((t,e)=>{e(t.el)}),ni=Ys((t,e)=>{let n=e;return{onUpdate(t){n=t},onCleanup(){n(t.el)}}});Ys((t,e)=>({onUpdate(e){e(t.el)}}));const si=Js((t,e,n,s,i)=>{function o(t,e,n){return"function"==typeof e?{keyFn:t,template:e,opts:n??{}}:{keyFn:null,template:t,opts:e??{}}}function r(t,e,n,s){const i=s.columns??3,o=s.gap??12,r=s.containerClass??"",a=[`column-count:${i}`,`column-gap:${o}px`,s.containerStyle??""].filter(Boolean).join(";"),l=["break-inside:avoid",`margin-bottom:${o}px`,"display:inline-block","width:100%","box-sizing:border-box"].join(";"),c=t,h=Et(c,e||((t,e)=>e),(t,e)=>b`
119
+ `}};function oo(t,e,n=C,s){return Ts(io,{condition:t,trueTpl:e,falseTpl:n,config:s})}function ro(t,e,n){const{show:s,...i}=n;return oo(s,b`<x-view .view=${t} .props=${e}></x-view>`,C,i)}function ao(t){const e=oe.isHookRunning;oe.isHookRunning=!0;try{return t()}finally{oe.isHookRunning=e}}function lo(t){var e,n,s,i,o;e=new WeakMap,n=new WeakMap,s=new WeakMap,i=new WeakMap,o=new WeakMap;const r=B(class extends ut{constructor(t){if(super(t),e.set(this,null),n.set(this,!1),s.set(this,null),i.set(this,!1),o.set(this,null),t.type!==Y)throw new Error("eleHook() must be used as an element expression, e.g. html`<div ${myHook()}>`")}update(r,a){const l=r.element;if(!he(this,i,"f")||l.isConnected){if(!he(this,n,"f")){ue(this,s,l,"f"),ue(this,i,!1,"f");const r=so(he(this,s,"f")),c=ao(()=>t(r,...a));return ue(this,e,c??null,"f"),ue(this,n,!0,"f"),void ue(this,o,a,"f")}he(this,e,"f")?.onUpdate&&ao(()=>he(this,e,"f").onUpdate(...a)),ue(this,o,a,"f")}else console.log("[eleHook] UPDATE SKIPPED — disconnected & host detached, el:",l)}render(...t){}disconnected(){ue(this,i,!0,"f"),console.log("[eleHook] DISCONNECTED — el:",he(this,s,"f"),"mounted:",he(this,n,"f"),"hasCleanup:",!!he(this,e,"f")?.onCleanup),he(this,e,"f")?.onCleanup&&he(this,e,"f").onCleanup(),ue(this,e,null,"f"),ue(this,n,!1,"f")}reconnected(){if(console.log("[eleHook] RECONNECTED — el:",he(this,s,"f"),"was disconnected:",he(this,i,"f"),"will re-mount:",!(!he(this,i,"f")||he(this,n,"f")||!he(this,s,"f")||!he(this,o,"f"))),ue(this,i,!1,"f"),!he(this,n,"f")&&he(this,s,"f")&&he(this,o,"f")){const i=so(he(this,s,"f")),r=ao(()=>t(i,...he(this,o,"f")));ue(this,e,r??null,"f"),ue(this,n,!0,"f"),console.log("[eleHook] RE-MOUNTED after reconnect — el:",he(this,s,"f"))}}});return(...t)=>r(...t)}const co=lo((t,e)=>(t.attr(e),{onUpdate(e){t.attr(e)},onCleanup(){t.attr({})}}));function ho(t){return co(t)}function uo(t){}const fo=lo((t,e)=>{const n=t.el;let s=new Set;const i=t=>{const e=(t=>{const e=new Set;if(Array.isArray(t))for(const n of t)if(Array.isArray(n)){if(2===n.length){const[t,s]=n;t&&s&&e.add(s)}else if(3===n.length){const[t,s,i]=n,o=t?s:i;o&&e.add(o)}}else"string"==typeof n&&n&&e.add(n);else for(const[n,s]of Object.entries(t))s&&e.add(n);return e})(t);for(const t of s)e.has(t)||n.classList.remove(t);for(const t of e)s.has(t)||n.classList.add(t);s=e};return i(e),{onUpdate(t){i(t)},onCleanup(){for(const t of s)n.classList.remove(t);s=new Set}}});function po(t){return fo(t)}function mo(t){}const _o=lo((t,e,n)=>{const s=t.el;let i=n;const o=t=>{const e=t;i(e.detail,e)};return s.addEventListener(e,o),{onUpdate(t,e){i=e},onCleanup(){s.removeEventListener(e,o)}}});function go(t,e){return _o(t,e)}function yo(){const t=ve(!1);return{dispatch(e,n){t&&t.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}}}function wo(t,e){if(e<=0)return{start(){t()},pause(){},resume(){},stop(){},get state(){return"stopped"},get remaining(){return 0}};let n="idle",s=e,i=0,o=null;function r(){null!==o&&(clearTimeout(o),o=null)}function a(){const t=performance.now()-i;return Math.max(0,s-t)}function l(){r(),o=setTimeout(()=>{o=null,n="stopped",s=0,t()},s)}return{start(){"running"!==n&&(s=e,i=performance.now(),n="running",l())},pause(){"running"===n&&(s=a(),r(),n="paused")},resume(){if("paused"===n){if(s<=0)return n="stopped",s=0,void t();i=performance.now(),n="running",l()}},stop(){r(),n="stopped",s=e},get state(){return n},get remaining(){return"running"===n?a():s}}}const vo=lo((t,e)=>{const n=t.el;let s=wo(()=>{n.remove()},e);return s.start(),{onUpdate(t){t!==e&&(e=t,s.stop(),s=wo(()=>{n.remove()},e),s.start())},onCleanup(){s.stop()}}});function bo(t){const e=oe.isHookRunning;oe.isHookRunning=!0;try{return t()}finally{oe.isHookRunning=e}}function So(t){var e,n,s,i,o,r;e=new WeakMap,n=new WeakMap,s=new WeakMap,i=new WeakMap,o=new WeakMap,r=new WeakMap;const a=B(class extends ut{constructor(t){if(super(t),e.set(this,null),n.set(this,!1),s.set(this,!1),i.set(this,!1),o.set(this,null),r.set(this,t=>{he(this,i,"f")?ue(this,o,t,"f"):this.setValue(t)}),t.type!==V)throw new Error("htmlHook() must be used as a child expression, e.g. html`<div>${myHook()}</div>`")}update(a,l){if(!he(this,s,"f")||this.isConnected){if(ue(this,i,!0,"f"),ue(this,o,null,"f"),he(this,n,"f"))he(this,e,"f")?.onUpdate&&bo(()=>he(this,e,"f").onUpdate(...l));else{const s=bo(()=>t(he(this,r,"f"),...l));ue(this,e,s??null,"f"),ue(this,n,!0,"f")}if(ue(this,i,!1,"f"),null!==he(this,o,"f")){const t=he(this,o,"f");return ue(this,o,null,"f"),t}}else console.log("[htmlHook] UPDATE SKIPPED — disconnected & part detached")}render(...t){}disconnected(){ue(this,s,!0,"f"),he(this,e,"f")?.onCleanup&&he(this,e,"f").onCleanup(),ue(this,n,!1,"f"),ue(this,e,null,"f")}reconnected(){he(this,s,"f")&&(ue(this,s,!1,"f"),ue(this,n,!1,"f"),ue(this,e,null,"f"))}});return(...t)=>a(...t)}const Eo=lo((t,e)=>{let n=e;const s=new IntersectionObserver(t=>{for(const e of t)e.isIntersecting?n.onVisible?.():n.onHidden?.()},{rootMargin:e.rootMargin??"0px",threshold:e.threshold??0});return s.observe(t.el),{onUpdate(t){n=t},onCleanup(){s.disconnect()}}});function Co(t){return Eo(t)}function Ao(t,e){return Eo({onVisible:t,...e})}function ko(t,e){return Eo({onHidden:t,...e})}const Mo=lo((t,e,n)=>{let s=e,i=!1,o=!0;const r=new IntersectionObserver(t=>{for(const e of t){const t=e.isIntersecting;if(o)return o=!1,void(i=t);t&&!i&&s(),i=t}},{rootMargin:n?.rootMargin??"0px",threshold:n?.threshold??0});return r.observe(t.el),{onUpdate(t,e){s=t},onCleanup(){r.disconnect(),i=!1,o=!0}}});function $o(t,e){return Mo(t,e)}function To(t,e){return Mo(t,e)}const Ro=lo((t,e)=>{e(t.el)}),xo=lo((t,e)=>{let n=e;return{onUpdate(t){n=t},onCleanup(){n(t.el)}}});function Oo(t){return Ro(t)}function Io(t){return xo(t)}lo((t,e)=>({onUpdate(e){e(t.el)}}));const Po=So((t,e,n,s,i)=>{function o(t,e,n){return"function"==typeof e?{keyFn:t,template:e,opts:n??{}}:{keyFn:null,template:t,opts:e??{}}}function r(t,e,n,s){const i=s.columns??3,o=s.gap??12,r=s.containerClass??"",a=[`column-count:${i}`,`column-gap:${o}px`,s.containerStyle??""].filter(Boolean).join(";"),l=["break-inside:avoid",`margin-bottom:${o}px`,"display:inline-block","width:100%","box-sizing:border-box"].join(";"),c=t,h=$t(c,e||((t,e)=>e),(t,e)=>b`
110
120
  <div style="${l}">${n(t,e)}</div>
111
121
  `);return b`
112
122
  <div class="${r}" style="${a}">
113
123
  ${h}
114
124
  </div>
115
- `}const{keyFn:a,template:l,opts:c}=o(n,s,i);return t(r(e,a,l,c)),{onUpdate(e,n,s,i){const{keyFn:a,template:l,opts:c}=o(n,s,i);t(r(e,a,l,c))}}});var ii,oi;ii=new WeakMap,oi=new WeakMap;const ri=B(class extends ut{constructor(t){if(super(t),ii.set(this,null),oi.set(this,null),t.type!==V)throw new Error("memoTemplate() must be used as a child expression, e.g. html`<div>${memoTemplate(keys, () => html`...`)}</div>`")}update(t,[e,n]){return null!==se(this,ii,"f")&&function(t,e){if(t.length!==e.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(t[n],e[n]))return!1;return!0}(se(this,ii,"f"),e)||(ie(this,oi,n(),"f"),ie(this,ii,e.slice(),"f")),se(this,oi,"f")}render(t,e){return e()}disconnected(){}reconnected(){}});function ai(t,e,n){const s={current:n},i=t=>{s.current?.(t)};return t.addEventListener(e,i),{handler:n,handlerRef:s,cleanup:()=>t.removeEventListener(e,i)}}function li(t){t.cleanup()}function ci(t){for(const e of t.values())e.cleanup();t.clear()}function hi(t,e){const n={current:e},s=e=>{const s=e.target;s&&!t.contains(s)&&n.current?.(e)};return document.addEventListener("mousedown",s,!0),{handler:e,cleanup:()=>document.removeEventListener("mousedown",s,!0),handlerRef:n}}const ui="__viewport__",di=new WeakMap;function fi(t,e,n){const s=new Set;let i,o,r=!1;for(const[a,l]of Object.entries(e)){if(!l)continue;if("enterViewport"===a){i=l,r=!0;continue}if("exitViewport"===a){o=l,r=!0;continue}s.add(a);const e=n.get(a);e?e.handler!==l&&(e.handlerRef&&(e.handlerRef.current=l),e.handler=l):n.set(a,"clickOutside"===a?hi(t,l):ai(t,a,l))}if(r){s.add(ui);const e=n.get(ui);if(e){const t=e;t.enterRef&&(t.enterRef.current=i),t.exitRef&&(t.exitRef.current=o)}else n.set(ui,function(t,e,n){const s={current:e},i={current:n},o=new IntersectionObserver(t=>{for(const e of t)e.isIntersecting?s.current?.(e):i.current?.(e)},{threshold:0});return o.observe(t),{handler:e??n??(()=>{}),cleanup:()=>o.disconnect(),enterRef:s,exitRef:i}}(t,i,o))}for(const[t,e]of n)s.has(t)||(li(e),n.delete(t))}const pi=Ys((t,e)=>{const n=new Map,s=t.el;fi(s,e,n);const i=()=>{ci(n),di.delete(s)};return di.set(s,i),{onUpdate(t){fi(s,t,n)},onCleanup(){i()}}});const mi=Ys((t,e,n)=>{const s=new Map;let i=null,o=n;const r=(t,e)=>{t!==i&&(ci(s),i=t),function(t,e,n){const s=new Set;for(const[i,o]of Object.entries(e)){if(!o)continue;s.add(i);const e=n.get(i);e?e.handler!==o&&(e.handlerRef&&(e.handlerRef.current=o),e.handler=o):n.set(i,ai(t,i,o))}for(const[t,e]of n)s.has(t)||(li(e),n.delete(t))}(t,e,s)},a=()=>{ci(s),i=null},l=e.__subscribe(t=>{t?r(t,o):a()});return e.value&&r(e.value,n),{onUpdate(t,n){o=n,e.value&&r(e.value,n)},onCleanup(){a(),l()}}});const _i=Ys((t,e)=>(t.style(e),{onUpdate(e){t.style(e)}}));const gi=Js((t,e,n)=>{if(n<16)throw new Error(`timerTemplate() ms must be at least 16ms (one frame at 60fps), got ${n}`);let s=e,i=n,o=null;const r=()=>t(s()),a=()=>{o=setInterval(r,i)};return r(),a(),{onUpdate(t,e){s=t,e!==i&&(i=e,null!==o&&(clearInterval(o),o=null),a())},onCleanup(){null!==o&&(clearInterval(o),o=null)}}});
125
+ `}const{keyFn:a,template:l,opts:c}=o(n,s,i);return t(r(e,a,l,c)),{onUpdate(e,n,s,i){const{keyFn:a,template:l,opts:c}=o(n,s,i);t(r(e,a,l,c))}}});function zo(t,e,n,s){return Po(t,e,n,s)}var Do,Lo;Do=new WeakMap,Lo=new WeakMap;const No=B(class extends ut{constructor(t){if(super(t),Do.set(this,null),Lo.set(this,null),t.type!==V)throw new Error("memoTemplate() must be used as a child expression, e.g. html`<div>${memoTemplate(keys, () => html`...`)}</div>`")}update(t,[e,n]){return null!==he(this,Do,"f")&&function(t,e){if(t.length!==e.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(t[n],e[n]))return!1;return!0}(he(this,Do,"f"),e)||(ue(this,Lo,n(),"f"),ue(this,Do,e.slice(),"f")),he(this,Lo,"f")}render(t,e){return e()}disconnected(){}reconnected(){}});function jo(t,e){return No(t,e)}function Uo(t,e,n){const s={current:n},i=t=>{s.current?.(t)};return t.addEventListener(e,i),{handler:n,handlerRef:s,cleanup:()=>t.removeEventListener(e,i)}}function Fo(t){t.cleanup()}function Vo(t){for(const e of t.values())e.cleanup();t.clear()}function Wo(t,e){const n={current:e},s=e=>{const s=e.target;s&&!t.contains(s)&&n.current?.(e)};return document.addEventListener("mousedown",s,!0),{handler:e,cleanup:()=>document.removeEventListener("mousedown",s,!0),handlerRef:n}}const Ho="__viewport__",Yo=new WeakMap;function Bo(t,e,n){const s=new Set;let i,o,r=!1;for(const[a,l]of Object.entries(e)){if(!l)continue;if("enterViewport"===a){i=l,r=!0;continue}if("exitViewport"===a){o=l,r=!0;continue}s.add(a);const e=n.get(a);e?e.handler!==l&&(e.handlerRef&&(e.handlerRef.current=l),e.handler=l):n.set(a,"clickOutside"===a?Wo(t,l):Uo(t,a,l))}if(r){s.add(Ho);const e=n.get(Ho);if(e){const t=e;t.enterRef&&(t.enterRef.current=i),t.exitRef&&(t.exitRef.current=o)}else n.set(Ho,function(t,e,n){const s={current:e},i={current:n},o=new IntersectionObserver(t=>{for(const e of t)e.isIntersecting?s.current?.(e):i.current?.(e)},{threshold:0});return o.observe(t),{handler:e??n??(()=>{}),cleanup:()=>o.disconnect(),enterRef:s,exitRef:i}}(t,i,o))}for(const[t,e]of n)s.has(t)||(Fo(e),n.delete(t))}const qo=lo((t,e)=>{const n=new Map,s=t.el;Bo(s,e,n);const i=()=>{Vo(n),Yo.delete(s)};return Yo.set(s,i),{onUpdate(t){Bo(s,t,n)},onCleanup(){i()}}});function Xo(t){return qo(t)}function Zo(t){Yo.get(t)?.()}const Go=lo((t,e,n)=>{const s=new Map;let i=null,o=n;const r=(t,e)=>{t!==i&&(Vo(s),i=t),function(t,e,n){const s=new Set;for(const[i,o]of Object.entries(e)){if(!o)continue;s.add(i);const e=n.get(i);e?e.handler!==o&&(e.handlerRef&&(e.handlerRef.current=o),e.handler=o):n.set(i,Uo(t,i,o))}for(const[t,e]of n)s.has(t)||(Fo(e),n.delete(t))}(t,e,s)},a=()=>{Vo(s),i=null},l=e.__subscribe(t=>{t?r(t,o):a()});return e.value&&r(e.value,n),{onUpdate(t,n){o=n,e.value&&r(e.value,n)},onCleanup(){a(),l()}}});function Ko(t,e){return Go(t,e)}function Jo(t){for(const e of t){if(!Array.isArray(e))return e;{const[t,n]=e;if(t)return n}}return C}const Qo=lo((t,e)=>(t.style(e),{onUpdate(e){t.style(e)}}));function tr(t){return Qo(t)}function er(t){}const nr=So((t,e,n)=>{if(n<16)throw new Error(`timerTemplate() ms must be at least 16ms (one frame at 60fps), got ${n}`);let s=e,i=n,o=null;const r=()=>t(s()),a=()=>{o=setInterval(r,i)};return r(),a(),{onUpdate(t,e){s=t,e!==i&&(i=e,null!==o&&(clearInterval(o),o=null),a())},onCleanup(){null!==o&&(clearInterval(o),o=null)}}});function sr(t,e){return nr(t,e)}
116
126
  /**
117
127
  * @license
118
128
  * Copyright 2021 Google LLC
119
129
  * SPDX-License-Identifier: BSD-3-Clause
120
- */
121
- function yi(t){return"horizontal"===t?"width":"height"}class wi{_updateOverhang(){this._overhang=Math.max(200,2*this._viewDim1)}_getDefaultConfig(){return{direction:"vertical"}}constructor(t,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){(t="horizontal"===t?t:"vertical")!==this._direction&&(this._direction=t,this._sizeDim="horizontal"===t?"width":"height",this._secondarySizeDim="horizontal"===t?"height":"width",this._positionDim="horizontal"===t?"left":"top",this._secondaryPositionDim="horizontal"===t?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){const{_viewDim1:e,_viewDim2:n}=this;Object.assign(this._viewportSize,t),n!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds(),this._updateOverhang()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);const e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:t,block:e}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[yi(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const t=this._scrollPosition,{index:e,block:n}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:n||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){const{block:e}=t,n=Math.min(this.items.length,Math.max(0,t.index)),s=this._getItemPosition(n)[this._positionDim];let i=s;if("start"!==e){const t=this._getItemSize(n)[this._sizeDim];if("center"===e)i=s-.5*this._viewDim1+.5*t;else{const n=s-this._viewDim1+t;if("end"===e)i=n;else{const t=this._scrollPosition;i=Math.abs(t-s)<Math.abs(t-n)?s:n}}}return i+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(i)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const t=new Map;if(-1!==this._first&&-1!==this._last)for(let e=this._first;e<=this._last;e++)t.set(e,this._getItemPosition(e));const e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(-1===this._first||-1===this._last)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let n=this._last;for(;n>this._first&&Math.round(this._getItemPosition(n)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)n--;e===this._firstVisible&&n===this._lastVisible||(this._firstVisible=e,this._lastVisible=n,t?.emit&&this._sendVisibilityChangedMessage())}}
130
+ */function ir(t){return"horizontal"===t?"width":"height"}class or{_updateOverhang(){this._overhang=Math.max(200,2*this._viewDim1)}_getDefaultConfig(){return{direction:"vertical"}}constructor(t,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){(t="horizontal"===t?t:"vertical")!==this._direction&&(this._direction=t,this._sizeDim="horizontal"===t?"width":"height",this._secondarySizeDim="horizontal"===t?"height":"width",this._positionDim="horizontal"===t?"left":"top",this._secondaryPositionDim="horizontal"===t?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){const{_viewDim1:e,_viewDim2:n}=this;Object.assign(this._viewportSize,t),n!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds(),this._updateOverhang()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);const e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:t,block:e}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[ir(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const t=this._scrollPosition,{index:e,block:n}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:n||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){const{block:e}=t,n=Math.min(this.items.length,Math.max(0,t.index)),s=this._getItemPosition(n)[this._positionDim];let i=s;if("start"!==e){const t=this._getItemSize(n)[this._sizeDim];if("center"===e)i=s-.5*this._viewDim1+.5*t;else{const n=s-this._viewDim1+t;if("end"===e)i=n;else{const t=this._scrollPosition;i=Math.abs(t-s)<Math.abs(t-n)?s:n}}}return i+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(i)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const t=new Map;if(-1!==this._first&&-1!==this._last)for(let e=this._first;e<=this._last;e++)t.set(e,this._getItemPosition(e));const e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(-1===this._first||-1===this._last)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let n=this._last;for(;n>this._first&&Math.round(this._getItemPosition(n)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)n--;e===this._firstVisible&&n===this._lastVisible||(this._firstVisible=e,this._lastVisible=n,t?.emit&&this._sendVisibilityChangedMessage())}}
122
131
  /**
123
132
  * @license
124
133
  * Copyright 2021 Google LLC
125
134
  * SPDX-License-Identifier: BSD-3-Clause
126
- */class vi{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===t?.roundAverageSize&&(this._roundAverageSize=!0)}set(t,e){const n=this._map.get(t)||0;this._map.set(t,e),this.totalSize+=e-n}get averageSize(){if(this._map.size>0){const t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}
135
+ */class rr{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===t?.roundAverageSize&&(this._roundAverageSize=!0)}set(t,e){const n=this._map.get(t)||0;this._map.set(t,e),this.totalSize+=e-n}get averageSize(){if(this._map.size>0){const t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}
127
136
  /**
128
137
  * @license
129
138
  * Copyright 2021 Google LLC
130
139
  * SPDX-License-Identifier: BSD-3-Clause
131
- */const bi=t=>Object.assign({type:ki},t);function Si(t){return"horizontal"===t?"marginLeft":"marginTop"}function xi(t){return"horizontal"===t?"marginRight":"marginBottom"}function Ci(t){return"horizontal"===t?"xOffset":"yOffset"}function Ei(t,e){const n=[t,e].sort();return n[1]<=0?Math.min(...n):n[0]>=0?Math.max(...n):n[0]+n[1]}class Ai{constructor(){this._childSizeCache=new vi,this._marginSizeCache=new vi,this._metricsCache=new Map}update(t,e){const n=new Set;Object.keys(t).forEach(s=>{const i=Number(s);this._metricsCache.set(i,t[i]),this._childSizeCache.set(i,t[i][yi(e)]),n.add(i),n.add(i+1)});for(const t of n){const n=this._metricsCache.get(t)?.[Si(e)]||0,s=this._metricsCache.get(t-1)?.[xi(e)]||0;this._marginSizeCache.set(t,Ei(n,s))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,e){return this._metricsCache.get(t)?.[Si(e)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}class ki extends wi{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Ai,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){return this._newPhysicalItems.get(t)??this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(t){const e=this._metricsCache;if(-1===this._first||-1===this._last)return e.averageMarginSize+t*(e.averageMarginSize+this._getAverageSize());if(t<this._first){const n=this._first-t;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(n*e.averageChildSize+(n-1)*e.averageMarginSize)}{const n=t-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+n*(e.averageChildSize+e.averageMarginSize)}}_getPosition(t){const e=this._getPhysicalItem(t),{averageMarginSize:n}=this._metricsCache;return 0===t?this._metricsCache.getMarginSize(0)??n:e?e.pos:this._estimatePosition(t)}_calculateAnchor(t,e){return t<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+e)/2/this._delta)))}_getAnchor(t,e){if(0===this._physicalItems.size)return this._calculateAnchor(t,e);if(this._first<0)return this._calculateAnchor(t,e);if(this._last<0)return this._calculateAnchor(t,e);const n=this._getPhysicalItem(this._first),s=this._getPhysicalItem(this._last),i=n.pos;if(s.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,e);if(i>e)return this._calculateAnchor(t,e);let o=this._firstVisible-1,r=-1/0;for(;r<t;){r=this._getPhysicalItem(++o).pos+this._metricsCache.getChildSize(o)}return o}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){const t=this._newPhysicalItems;let e,n;if(this._stable=!0,null!==this.pin){const{index:t}=this.pin;this._anchorIdx=t,this._anchorPos=this._getPosition(t)}if(e=this._scrollPosition-this._overhang,n=this._scrollPosition+this._viewDim1+this._overhang,n<0||e>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(e,n),this._anchorPos=this._getPosition(this._anchorIdx));let s=this._getSize(this._anchorIdx);void 0===s&&(this._stable=!1,s=this._getAverageSize());const i=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=i),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-s);let r=0;for(this._anchorPos+s+o<e&&(r=e-(this._anchorPos+s+o)),this._anchorPos-i>n&&(r=n-(this._anchorPos-i)),r&&(this._scrollPosition-=r,e-=r,n-=r,this._scrollError+=r),t.set(this._anchorIdx,{pos:this._anchorPos,size:s}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-i,this._physicalMax=this._anchorPos+s+o;this._physicalMin>e&&this._first>0;){let e=this._getSize(--this._first);void 0===e&&(this._stable=!1,e=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._first);void 0===n&&(this._stable=!1,n=this._metricsCache.averageMarginSize),this._physicalMin-=e;const s=this._physicalMin;if(t.set(this._first,{pos:s,size:e}),this._physicalMin-=n,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<n&&this._last<this.items.length-1;){let e=this._getSize(++this._last);void 0===e&&(this._stable=!1,e=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._last);void 0===n&&(this._stable=!1,n=this._metricsCache.averageMarginSize);const s=this._physicalMax;if(t.set(this._last,{pos:s,size:e}),this._physicalMax+=e+n,!this._stable&&!this._estimate)break}const a=this._calculateError();a&&(this._physicalMin-=a,this._physicalMax-=a,this._anchorPos-=a,this._scrollPosition-=a,t.forEach(t=>t.pos-=a),this._scrollError+=a),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:t,_last:e}=this;super._reflow(),(-1===this._first&&-1===this._last||this._first===t&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:t}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t)}get _delta(){const{averageMarginSize:t}=this._metricsCache;return this._getAverageSize()+t}_getItemPosition(t){return{[this._positionDim]:this._getPosition(t),[this._secondaryPositionDim]:0,[Ci(this.direction)]:-(this._metricsCache.getLeadingMarginValue(t,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(t){return{[this._sizeDim]:this._getSize(t)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}var Mi=Object.freeze({__proto__:null,FlowLayout:ki,flow:bi});
140
+ */const ar=t=>Object.assign({type:fr},t);function lr(t){return"horizontal"===t?"marginLeft":"marginTop"}function cr(t){return"horizontal"===t?"marginRight":"marginBottom"}function hr(t){return"horizontal"===t?"xOffset":"yOffset"}function ur(t,e){const n=[t,e].sort();return n[1]<=0?Math.min(...n):n[0]>=0?Math.max(...n):n[0]+n[1]}class dr{constructor(){this._childSizeCache=new rr,this._marginSizeCache=new rr,this._metricsCache=new Map}update(t,e){const n=new Set;Object.keys(t).forEach(s=>{const i=Number(s);this._metricsCache.set(i,t[i]),this._childSizeCache.set(i,t[i][ir(e)]),n.add(i),n.add(i+1)});for(const t of n){const n=this._metricsCache.get(t)?.[lr(e)]||0,s=this._metricsCache.get(t-1)?.[cr(e)]||0;this._marginSizeCache.set(t,ur(n,s))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,e){return this._metricsCache.get(t)?.[lr(e)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}class fr extends or{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new dr,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){return this._newPhysicalItems.get(t)??this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(t){const e=this._metricsCache;if(-1===this._first||-1===this._last)return e.averageMarginSize+t*(e.averageMarginSize+this._getAverageSize());if(t<this._first){const n=this._first-t;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(n*e.averageChildSize+(n-1)*e.averageMarginSize)}{const n=t-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+n*(e.averageChildSize+e.averageMarginSize)}}_getPosition(t){const e=this._getPhysicalItem(t),{averageMarginSize:n}=this._metricsCache;return 0===t?this._metricsCache.getMarginSize(0)??n:e?e.pos:this._estimatePosition(t)}_calculateAnchor(t,e){return t<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+e)/2/this._delta)))}_getAnchor(t,e){if(0===this._physicalItems.size)return this._calculateAnchor(t,e);if(this._first<0)return this._calculateAnchor(t,e);if(this._last<0)return this._calculateAnchor(t,e);const n=this._getPhysicalItem(this._first),s=this._getPhysicalItem(this._last),i=n.pos;if(s.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,e);if(i>e)return this._calculateAnchor(t,e);let o=this._firstVisible-1,r=-1/0;for(;r<t;){r=this._getPhysicalItem(++o).pos+this._metricsCache.getChildSize(o)}return o}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){const t=this._newPhysicalItems;let e,n;if(this._stable=!0,null!==this.pin){const{index:t}=this.pin;this._anchorIdx=t,this._anchorPos=this._getPosition(t)}if(e=this._scrollPosition-this._overhang,n=this._scrollPosition+this._viewDim1+this._overhang,n<0||e>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(e,n),this._anchorPos=this._getPosition(this._anchorIdx));let s=this._getSize(this._anchorIdx);void 0===s&&(this._stable=!1,s=this._getAverageSize());const i=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=i),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-s);let r=0;for(this._anchorPos+s+o<e&&(r=e-(this._anchorPos+s+o)),this._anchorPos-i>n&&(r=n-(this._anchorPos-i)),r&&(this._scrollPosition-=r,e-=r,n-=r,this._scrollError+=r),t.set(this._anchorIdx,{pos:this._anchorPos,size:s}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-i,this._physicalMax=this._anchorPos+s+o;this._physicalMin>e&&this._first>0;){let e=this._getSize(--this._first);void 0===e&&(this._stable=!1,e=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._first);void 0===n&&(this._stable=!1,n=this._metricsCache.averageMarginSize),this._physicalMin-=e;const s=this._physicalMin;if(t.set(this._first,{pos:s,size:e}),this._physicalMin-=n,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<n&&this._last<this.items.length-1;){let e=this._getSize(++this._last);void 0===e&&(this._stable=!1,e=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._last);void 0===n&&(this._stable=!1,n=this._metricsCache.averageMarginSize);const s=this._physicalMax;if(t.set(this._last,{pos:s,size:e}),this._physicalMax+=e+n,!this._stable&&!this._estimate)break}const a=this._calculateError();a&&(this._physicalMin-=a,this._physicalMax-=a,this._anchorPos-=a,this._scrollPosition-=a,t.forEach(t=>t.pos-=a),this._scrollError+=a),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:t,_last:e}=this;super._reflow(),(-1===this._first&&-1===this._last||this._first===t&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:t}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t)}get _delta(){const{averageMarginSize:t}=this._metricsCache;return this._getAverageSize()+t}_getItemPosition(t){return{[this._positionDim]:this._getPosition(t),[this._secondaryPositionDim]:0,[hr(this.direction)]:-(this._metricsCache.getLeadingMarginValue(t,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(t){return{[this._sizeDim]:this._getSize(t)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}var pr=Object.freeze({__proto__:null,FlowLayout:fr,flow:ar});
132
141
  /**
133
142
  * @license
134
143
  * Copyright 2021 Google LLC
135
144
  * SPDX-License-Identifier: BSD-3-Clause
136
- */function $i(t){return"horizontal"===t?"row":"column"}class Ti extends wi{constructor(){super(...arguments),this._itemSize={},this._gaps={},this._padding={}}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{itemSize:{width:"300px",height:"300px"},gap:"8px",padding:"match-gap"})}get _gap(){return this._gaps.row}get _idealSize(){return this._itemSize[yi(this.direction)]}get _idealSize1(){return this._itemSize[yi(this.direction)]}get _idealSize2(){return this._itemSize[(t=this.direction,"horizontal"===t?"height":"width")];var t}get _gap1(){return this._gaps[(t=this.direction,"horizontal"===t?"column":"row")];var t}get _gap2(){return this._gaps[$i(this.direction)]}get _padding1(){const t=this._padding,[e,n]="horizontal"===this.direction?["left","right"]:["top","bottom"];return[t[e],t[n]]}get _padding2(){const t=this._padding,[e,n]="horizontal"===this.direction?["top","bottom"]:["left","right"];return[t[e],t[n]]}set itemSize(t){const e=this._itemSize;"string"==typeof t&&(t={width:t,height:t});const n=parseInt(t.width,10),s=parseInt(t.height,10);n!==e.width&&(e.width=n,this._triggerReflow()),s!==e.height&&(e.height=s,this._triggerReflow())}set gap(t){this._setGap(t)}_setGap(t){const e=t.split(" ").map(t=>function(t){return"auto"===t?1/0:parseInt(t,10)}(t)),n=this._gaps;e[0]!==n.row&&(n.row=e[0],this._triggerReflow()),void 0===e[1]?e[0]!==n.column&&(n.column=e[0],this._triggerReflow()):e[1]!==n.column&&(n.column=e[1],this._triggerReflow())}set padding(t){const e=this._padding,n=t.split(" ").map(t=>function(t){return"match-gap"===t?1/0:parseInt(t,10)}(t));1===n.length?(e.top=e.right=e.bottom=e.left=n[0],this._triggerReflow()):2===n.length?(e.top=e.bottom=n[0],e.right=e.left=n[1],this._triggerReflow()):3===n.length?(e.top=n[0],e.right=e.left=n[1],e.bottom=n[2],this._triggerReflow()):4===n.length&&(["top","right","bottom","left"].forEach((t,s)=>e[t]=n[s]),this._triggerReflow())}}
145
+ */function mr(t){return"horizontal"===t?"row":"column"}class _r extends or{constructor(){super(...arguments),this._itemSize={},this._gaps={},this._padding={}}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{itemSize:{width:"300px",height:"300px"},gap:"8px",padding:"match-gap"})}get _gap(){return this._gaps.row}get _idealSize(){return this._itemSize[ir(this.direction)]}get _idealSize1(){return this._itemSize[ir(this.direction)]}get _idealSize2(){return this._itemSize[(t=this.direction,"horizontal"===t?"height":"width")];var t}get _gap1(){return this._gaps[(t=this.direction,"horizontal"===t?"column":"row")];var t}get _gap2(){return this._gaps[mr(this.direction)]}get _padding1(){const t=this._padding,[e,n]="horizontal"===this.direction?["left","right"]:["top","bottom"];return[t[e],t[n]]}get _padding2(){const t=this._padding,[e,n]="horizontal"===this.direction?["top","bottom"]:["left","right"];return[t[e],t[n]]}set itemSize(t){const e=this._itemSize;"string"==typeof t&&(t={width:t,height:t});const n=parseInt(t.width,10),s=parseInt(t.height,10);n!==e.width&&(e.width=n,this._triggerReflow()),s!==e.height&&(e.height=s,this._triggerReflow())}set gap(t){this._setGap(t)}_setGap(t){const e=t.split(" ").map(t=>function(t){return"auto"===t?1/0:parseInt(t,10)}(t)),n=this._gaps;e[0]!==n.row&&(n.row=e[0],this._triggerReflow()),void 0===e[1]?e[0]!==n.column&&(n.column=e[0],this._triggerReflow()):e[1]!==n.column&&(n.column=e[1],this._triggerReflow())}set padding(t){const e=this._padding,n=t.split(" ").map(t=>function(t){return"match-gap"===t?1/0:parseInt(t,10)}(t));1===n.length?(e.top=e.right=e.bottom=e.left=n[0],this._triggerReflow()):2===n.length?(e.top=e.bottom=n[0],e.right=e.left=n[1],this._triggerReflow()):3===n.length?(e.top=n[0],e.right=e.left=n[1],e.bottom=n[2],this._triggerReflow()):4===n.length&&(["top","right","bottom","left"].forEach((t,s)=>e[t]=n[s]),this._triggerReflow())}}
137
146
  /**
138
147
  * @license
139
148
  * Copyright 2021 Google LLC
140
149
  * SPDX-License-Identifier: BSD-3-Clause
141
- */class Ri extends Ti{constructor(){super(...arguments),this._metrics=null,this.flex=null,this.justify=null}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{flex:!1,justify:"start"})}set gap(t){super._setGap(t)}_updateLayout(){const t=this.justify,[e,n]=this._padding1,[s,i]=this._padding2;["_gap1","_gap2"].forEach(e=>{const n=this[e];if(n===1/0&&!["space-between","space-around","space-evenly"].includes(t))throw new Error("grid layout: gap can only be set to 'auto' when justify is set to 'space-between', 'space-around' or 'space-evenly'");if(n===1/0&&"_gap2"===e)throw new Error(`grid layout: ${$i(this.direction)}-gap cannot be set to 'auto' when direction is set to ${this.direction}`)});const o=this.flex||["start","center","end"].includes(t),r={rolumns:-1,itemSize1:-1,itemSize2:-1,gap1:this._gap1===1/0?-1:this._gap1,gap2:o?this._gap2:0,padding1:{start:e===1/0?this._gap1:e,end:n===1/0?this._gap1:n},padding2:o?{start:s===1/0?this._gap2:s,end:i===1/0?this._gap2:i}:{start:0,end:0},positions:[]},a=this._viewDim2-r.padding2.start-r.padding2.end;if(a<=0)r.rolumns=0;else{const s=o?r.gap2:0;let i,l=0,c=0;if(a>=this._idealSize2&&(l=Math.floor((a-this._idealSize2)/(this._idealSize2+s))+1,c=l*this._idealSize2+(l-1)*s),this.flex){(a-c)/(this._idealSize2+s)>=.5&&(l+=1),r.rolumns=l,r.itemSize2=Math.round((a-s*(l-1))/l);switch(!0===this.flex?"area":this.flex.preserve){case"aspect-ratio":r.itemSize1=Math.round(this._idealSize1/this._idealSize2*r.itemSize2);break;case yi(this.direction):r.itemSize1=Math.round(this._idealSize1);break;default:r.itemSize1=Math.round(this._idealSize1*this._idealSize2/r.itemSize2)}}else r.itemSize1=this._idealSize1,r.itemSize2=this._idealSize2,r.rolumns=l;if(o){const e=r.rolumns*r.itemSize2+(r.rolumns-1)*r.gap2;i=this.flex||"start"===t?r.padding2.start:"end"===t?this._viewDim2-r.padding2.end-e:Math.round(this._viewDim2/2-e/2)}else{const s=a-r.rolumns*r.itemSize2;"space-between"===t?(r.gap2=Math.round(s/(r.rolumns-1)),i=0):"space-around"===t?(r.gap2=Math.round(s/r.rolumns),i=Math.round(r.gap2/2)):(r.gap2=Math.round(s/(r.rolumns+1)),i=r.gap2),this._gap1===1/0&&(r.gap1=r.gap2,e===1/0&&(r.padding1.start=i),n===1/0&&(r.padding1.end=i))}for(let t=0;t<r.rolumns;t++)r.positions.push(i),i+=r.itemSize2+r.gap2}this._metrics=r}}
150
+ */class gr extends _r{constructor(){super(...arguments),this._metrics=null,this.flex=null,this.justify=null}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{flex:!1,justify:"start"})}set gap(t){super._setGap(t)}_updateLayout(){const t=this.justify,[e,n]=this._padding1,[s,i]=this._padding2;["_gap1","_gap2"].forEach(e=>{const n=this[e];if(n===1/0&&!["space-between","space-around","space-evenly"].includes(t))throw new Error("grid layout: gap can only be set to 'auto' when justify is set to 'space-between', 'space-around' or 'space-evenly'");if(n===1/0&&"_gap2"===e)throw new Error(`grid layout: ${mr(this.direction)}-gap cannot be set to 'auto' when direction is set to ${this.direction}`)});const o=this.flex||["start","center","end"].includes(t),r={rolumns:-1,itemSize1:-1,itemSize2:-1,gap1:this._gap1===1/0?-1:this._gap1,gap2:o?this._gap2:0,padding1:{start:e===1/0?this._gap1:e,end:n===1/0?this._gap1:n},padding2:o?{start:s===1/0?this._gap2:s,end:i===1/0?this._gap2:i}:{start:0,end:0},positions:[]},a=this._viewDim2-r.padding2.start-r.padding2.end;if(a<=0)r.rolumns=0;else{const s=o?r.gap2:0;let i,l=0,c=0;if(a>=this._idealSize2&&(l=Math.floor((a-this._idealSize2)/(this._idealSize2+s))+1,c=l*this._idealSize2+(l-1)*s),this.flex){(a-c)/(this._idealSize2+s)>=.5&&(l+=1),r.rolumns=l,r.itemSize2=Math.round((a-s*(l-1))/l);switch(!0===this.flex?"area":this.flex.preserve){case"aspect-ratio":r.itemSize1=Math.round(this._idealSize1/this._idealSize2*r.itemSize2);break;case ir(this.direction):r.itemSize1=Math.round(this._idealSize1);break;default:r.itemSize1=Math.round(this._idealSize1*this._idealSize2/r.itemSize2)}}else r.itemSize1=this._idealSize1,r.itemSize2=this._idealSize2,r.rolumns=l;if(o){const e=r.rolumns*r.itemSize2+(r.rolumns-1)*r.gap2;i=this.flex||"start"===t?r.padding2.start:"end"===t?this._viewDim2-r.padding2.end-e:Math.round(this._viewDim2/2-e/2)}else{const s=a-r.rolumns*r.itemSize2;"space-between"===t?(r.gap2=Math.round(s/(r.rolumns-1)),i=0):"space-around"===t?(r.gap2=Math.round(s/r.rolumns),i=Math.round(r.gap2/2)):(r.gap2=Math.round(s/(r.rolumns+1)),i=r.gap2),this._gap1===1/0&&(r.gap1=r.gap2,e===1/0&&(r.padding1.start=i),n===1/0&&(r.padding1.end=i))}for(let t=0;t<r.rolumns;t++)r.positions.push(i),i+=r.itemSize2+r.gap2}this._metrics=r}}
142
151
  /**
143
152
  * @license
144
153
  * Copyright 2021 Google LLC
145
154
  * SPDX-License-Identifier: BSD-3-Clause
146
- */const Oi="MIN";class Pi extends Ri{constructor(){super(...arguments),this._RANGE_MAP_GRANULARITY=100,this._positions=new Map,this._rangeMap=new Map}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{getAspectRatio:()=>1})}set getAspectRatio(t){this._getAspectRatio=t}_setItems(t){t!==this._items&&this._scheduleLayoutUpdate(),super._setItems(t)}_getItemSize(t){return{[this._sizeDim]:this._metrics.itemSize1,[this._secondarySizeDim]:this._metrics.itemSize2}}_updateLayout(){super._updateLayout(),this._layOutChildren()}_getRangeMapKey(t,e){const n=this._RANGE_MAP_GRANULARITY;return e===Oi?Math.floor(t/n)*n:Math.ceil(t/n)*n}_layOutChildren(){const t=this._RANGE_MAP_GRANULARITY;this._positions.clear(),this._rangeMap.clear();const{rolumns:e,padding1:n,itemSize2:s,gap1:i,positions:o}=this._metrics;let r=n.start;const a=new Array(e).fill(null).map(t=>r);let l=0,c=0,h=1/0,u=-1/0;if(this.items.forEach((e,d)=>{const f=this._getAspectRatio(e),p="horizontal"===this.direction?s*f:s/f,m=a[l],_=o[l];this._positions.set(d,{[this._positionDim]:m,[this._secondaryPositionDim]:_,[this._sizeDim]:p,[this._secondarySizeDim]:s});const g=m+p,y=this._getRangeMapKey(m,Oi);y<h&&(h=y);const w=this._getRangeMapKey(g,"MAX");w>u&&(u=w);for(let e=y;e<=w;e+=t){const[t,n]=this._rangeMap.get(e)??[1/0,-1/0];this._rangeMap.set(e,[Math.min(d,t),Math.max(d,n)])}c=Math.max(c,g+n.end),a[l]+=p+i,r=1/0,a.forEach((t,e)=>{t<r&&(r=t,l=e)})}),h!==1/0)for(let e=0;e<h;e+=t)this._rangeMap.set(e,[-1,-1]);if(u!==-1/0){const e=this._rangeMap.get(u);for(let n=u+t;n<c+t;n+=t)this._rangeMap.set(n,e)}this._scrollSize=c}_getActiveItems(){const t=this._metrics,{rolumns:e}=t;if(0===e||0===this._rangeMap.size)this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;else{const t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang),n=this.items.length-1,s=this._getRangeMapKey(t,Oi),i=this._getRangeMapKey(e,"MAX");let o=n,r=0;for(let t=s;t<=i;t+=this._RANGE_MAP_GRANULARITY){const[e,s]=this._rangeMap.get(t)??[n,0];o=Math.min(o,e),r=Math.max(r,s)}this._first=o,this._last=r}}_getItemPosition(t){return this._positions.get(t)}_updateScrollSize(){}}
155
+ */const yr="MIN";class wr extends gr{constructor(){super(...arguments),this._RANGE_MAP_GRANULARITY=100,this._positions=new Map,this._rangeMap=new Map}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{getAspectRatio:()=>1})}set getAspectRatio(t){this._getAspectRatio=t}_setItems(t){t!==this._items&&this._scheduleLayoutUpdate(),super._setItems(t)}_getItemSize(t){return{[this._sizeDim]:this._metrics.itemSize1,[this._secondarySizeDim]:this._metrics.itemSize2}}_updateLayout(){super._updateLayout(),this._layOutChildren()}_getRangeMapKey(t,e){const n=this._RANGE_MAP_GRANULARITY;return e===yr?Math.floor(t/n)*n:Math.ceil(t/n)*n}_layOutChildren(){const t=this._RANGE_MAP_GRANULARITY;this._positions.clear(),this._rangeMap.clear();const{rolumns:e,padding1:n,itemSize2:s,gap1:i,positions:o}=this._metrics;let r=n.start;const a=new Array(e).fill(null).map(t=>r);let l=0,c=0,h=1/0,u=-1/0;if(this.items.forEach((e,d)=>{const f=this._getAspectRatio(e),p="horizontal"===this.direction?s*f:s/f,m=a[l],_=o[l];this._positions.set(d,{[this._positionDim]:m,[this._secondaryPositionDim]:_,[this._sizeDim]:p,[this._secondarySizeDim]:s});const g=m+p,y=this._getRangeMapKey(m,yr);y<h&&(h=y);const w=this._getRangeMapKey(g,"MAX");w>u&&(u=w);for(let e=y;e<=w;e+=t){const[t,n]=this._rangeMap.get(e)??[1/0,-1/0];this._rangeMap.set(e,[Math.min(d,t),Math.max(d,n)])}c=Math.max(c,g+n.end),a[l]+=p+i,r=1/0,a.forEach((t,e)=>{t<r&&(r=t,l=e)})}),h!==1/0)for(let e=0;e<h;e+=t)this._rangeMap.set(e,[-1,-1]);if(u!==-1/0){const e=this._rangeMap.get(u);for(let n=u+t;n<c+t;n+=t)this._rangeMap.set(n,e)}this._scrollSize=c}_getActiveItems(){const t=this._metrics,{rolumns:e}=t;if(0===e||0===this._rangeMap.size)this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;else{const t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang),n=this.items.length-1,s=this._getRangeMapKey(t,yr),i=this._getRangeMapKey(e,"MAX");let o=n,r=0;for(let t=s;t<=i;t+=this._RANGE_MAP_GRANULARITY){const[e,s]=this._rangeMap.get(t)??[n,0];o=Math.min(o,e),r=Math.max(r,s)}this._first=o,this._last=r}}_getItemPosition(t){return this._positions.get(t)}_updateScrollSize(){}}
147
156
  /**
148
157
  * @license
149
158
  * Copyright 2021 Google LLC
150
159
  * SPDX-License-Identifier: BSD-3-Clause
151
- */class Ii extends Event{constructor(t){super(Ii.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}Ii.eventName="rangeChanged";class zi extends Event{constructor(t){super(zi.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}zi.eventName="visibilityChanged";class Di extends Event{constructor(){super(Di.eventName,{bubbles:!1})}}Di.eventName="unpinned";
160
+ */class vr extends Event{constructor(t){super(vr.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}vr.eventName="rangeChanged";class br extends Event{constructor(t){super(br.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}br.eventName="visibilityChanged";class Sr extends Event{constructor(){super(Sr.eventName,{bubbles:!1})}}Sr.eventName="unpinned";
152
161
  /**
153
162
  * @license
154
163
  * Copyright 2021 Google LLC
155
164
  * SPDX-License-Identifier: BSD-3-Clause
156
165
  */
157
- class Li{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}}class Ni extends Li{constructor(t,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);const n=this._node;this._originalScrollTo=n.scrollTo,this._originalScrollBy=n.scrollBy,this._originalScroll=n.scroll,this._attach(t)}get _destination(){return this.__destination}get scrolling(){return null!==this._destination}scrollTo(t,e){const n="number"==typeof t&&"number"==typeof e?{left:t,top:e}:t;this._scrollTo(n)}scrollBy(t,e){const n="number"==typeof t&&"number"==typeof e?{left:t,top:e}:t;void 0!==n.top&&(n.top+=this.scrollTop),void 0!==n.left&&(n.left+=this.scrollLeft),this._scrollTo(n)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,e=null,n=null){null!==this._end&&this._end(),"smooth"===t.behavior?(this._setDestination(t),this._retarget=e,this._end=n):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:e,left:n}=t;return e=void 0===e?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),n=void 0===n?void 0:Math.max(0,Math.min(n,this.maxScrollLeft)),(null===this._destination||n!==this._destination.left||e!==this._destination.top)&&(this.__destination={top:e,left:n,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,e,n){return this._scrollTo(t,e,n),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(null!==this._destination){const{scrollTop:t,scrollLeft:e}=this;let{top:n,left:s}=this._destination;n=Math.min(n||0,this.maxScrollTop),s=Math.min(s||0,this.maxScrollLeft);const i=Math.abs(n-t),o=Math.abs(s-e);i<1&&o<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),0===this._clients.size&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),1===this._clients.size&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}}
158
- /**
159
- * @license
160
- * Copyright 2021 Google LLC
161
- * SPDX-License-Identifier: BSD-3-Clause
162
- */let ji="undefined"!=typeof window?window.ResizeObserver:void 0;const Ui=Symbol("virtualizerRef"),Fi="virtualizer-sizer";let Vi;class Wi{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEndRafId=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new Map,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!t)throw new Error("Virtualizer constructor requires a configuration object");if(!t.hostElement)throw new Error('Virtualizer configuration requires the "hostElement" property');this._init(t)}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);const e=t.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new ji(()=>this._hostElementSizeChanged()),this._childrenRO=new ji(this._childrenSizeChanged.bind(this))}_initHostElement(t){this._hostElement=t.hostElement;const e=this._hostElement;this._applyVirtualizerStyles(),e[Ui]=this}connected(){this._initObservers();const t=this._isScroller;this._clippingAncestors=function(t,e=!1){let n=!1;return function(t,e=!1){const n=[];let s=e?t:Yi(t);for(;null!==s;)n.push(s),s=Yi(s);return n}(t,e).filter(t=>{if(n)return!1;const e=getComputedStyle(t);return n="fixed"===e.position,"visible"!==e.overflow})}
166
+ class Er{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}}class Cr extends Er{constructor(t,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);const n=this._node;this._originalScrollTo=n.scrollTo,this._originalScrollBy=n.scrollBy,this._originalScroll=n.scroll,this._attach(t)}get _destination(){return this.__destination}get scrolling(){return null!==this._destination}scrollTo(t,e){const n="number"==typeof t&&"number"==typeof e?{left:t,top:e}:t;this._scrollTo(n)}scrollBy(t,e){const n="number"==typeof t&&"number"==typeof e?{left:t,top:e}:t;void 0!==n.top&&(n.top+=this.scrollTop),void 0!==n.left&&(n.left+=this.scrollLeft),this._scrollTo(n)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,e=null,n=null){null!==this._end&&this._end(),"smooth"===t.behavior?(this._setDestination(t),this._retarget=e,this._end=n):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:e,left:n}=t;return e=void 0===e?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),n=void 0===n?void 0:Math.max(0,Math.min(n,this.maxScrollLeft)),(null===this._destination||n!==this._destination.left||e!==this._destination.top)&&(this.__destination={top:e,left:n,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,e,n){return this._scrollTo(t,e,n),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(null!==this._destination){const{scrollTop:t,scrollLeft:e}=this;let{top:n,left:s}=this._destination;n=Math.min(n||0,this.maxScrollTop),s=Math.min(s||0,this.maxScrollLeft);const i=Math.abs(n-t),o=Math.abs(s-e);i<1&&o<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),0===this._clients.size&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),1===this._clients.size&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}}
163
167
  /**
164
168
  * @license
165
169
  * Copyright 2021 Google LLC
166
170
  * SPDX-License-Identifier: BSD-3-Clause
167
- */(this._hostElement,t),this._scrollerController=new Ni(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions)),null!==this._scrollEndRafId&&(cancelAnimationFrame(this._scrollEndRafId),this._scrollEndRafId=null),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const t=this._hostElement.style;t.display=t.display||"block",t.position=t.position||"relative",t.contain=t.contain||"size layout",this._isScroller&&(t.overflow=t.overflow||"auto",t.minHeight=t.minHeight||"150px")}_getSizer(){const t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${Fi}]`);e||(e=document.createElement("div"),e.setAttribute(Fi,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent="&nbsp;",e.setAttribute(Fi,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;const e=t.type||Vi;if("function"==typeof e&&this._layout instanceof e){const e={...t};return delete e.type,this._layout.config=e,!0}return!1}async _initLayout(t){let e,n;if("function"==typeof t.type){n=t.type;const s={...t};delete s.type,e=s}else e=t;void 0===n&&(Vi=n=(await Promise.resolve().then(function(){return Mi})).FlowLayout),this._layout=new n(t=>this._handleLayoutMessage(t),e),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const t=window.performance.now(),e=t-this._benchmarkStart,n=performance.getEntriesByName("uv-virtualizing","measure").filter(e=>e.startTime>=this._benchmarkStart&&e.startTime<t).reduce((t,e)=>t+e.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:n}}return null}_measureChildren(){const t={},e=this._children,n=this._measureChildOverride||this._measureChild;for(let s=0;s<e.length;s++){const i=e[s],o=this._first+s;(this._itemsChanged||this._toBeMeasured.has(i))&&(t[o]=n.call(this,i,this._items[o]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){const{width:e,height:n}=t.getBoundingClientRect();return Object.assign({width:e,height:n},function(t){const e=window.getComputedStyle(t);return{marginTop:Hi(e.marginTop),marginRight:Hi(e.marginRight),marginBottom:Hi(e.marginBottom),marginLeft:Hi(e.marginLeft)}}(t))}_schedule(t){const e=this._scheduled.get(t);void 0!==e&&cancelAnimationFrame(e);const n=requestAnimationFrame(()=>{this._scheduled.delete(t),t.call(this)});this._scheduled.set(t,n)}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;const{_rangeChanged:e,_itemsChanged:n}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||n)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout),null!==this._scrollEndRafId&&cancelAnimationFrame(this._scrollEndRafId),this._scrollEndRafId=requestAnimationFrame(()=>{this._scrollEndRafId=null,this._connected&&this._updateLayout()})}handleEvent(t){if("scroll"===t.type)(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",t)}_handleLayoutMessage(t){"stateChanged"===t.type?this._updateDOM(t):"visibilityChanged"===t.type?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):"unpinned"===t.type&&this._hostElement.dispatchEvent(new Di)}get _children(){const t=[];let e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(Fi)||t.push(e),e=e.nextElementSibling;return t}_updateView(){const t=this._hostElement,e=this._scrollerController?.element,n=this._layout;if(t&&e&&n){let s,i,o,r;const a=t.getBoundingClientRect();s=0,i=0,o=window.innerHeight,r=window.innerWidth;const l=this._clippingAncestors.map(t=>t.getBoundingClientRect());l.unshift(a);for(const t of l)s=Math.max(s,t.top),i=Math.max(i,t.left),o=Math.min(o,t.bottom),r=Math.min(r,t.right);const c=e.getBoundingClientRect(),h={left:a.left-c.left,top:a.top-c.top},u={width:e.scrollWidth,height:e.scrollHeight},d=s-a.top+t.scrollTop,f=i-a.left+t.scrollLeft,p=Math.max(0,o-s),m=Math.max(0,r-i);n.viewportSize={width:m,height:p},n.viewportScroll={top:d,left:f},n.totalScrollSize=u,n.offsetWithinScroller=h}}_sizeHostElement(t){const e=82e5,n=t&&null!==t.width?Math.min(e,t.width):0,s=t&&null!==t.height?Math.min(e,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${n}px, ${s}px)`;else{const t=this._hostElement.style;t.minWidth=n?`${n}px`:"100%",t.minHeight=s?`${s}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:t,left:e,width:n,height:s,xOffset:i,yOffset:o},r)=>{const a=this._children[r-this._first];a&&(a.style.position="absolute",a.style.boxSizing="border-box",a.style.transform=`translate(${e}px, ${t}px)`,void 0!==n&&(a.style.width=`${n}px`),void 0!==s&&(a.style.height=`${s}px`),a.style.left=void 0===i?null:`${i}px`,a.style.top=void 0===o?null:`${o}px`)})}async _adjustRange(t){const{_first:e,_last:n,_firstVisible:s,_lastVisible:i}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==n,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==s||this._lastVisible!==i}_correctScrollError(){if(this._scrollError){const{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:n,left:s}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-n,left:e-s})}}element(t){return t===1/0&&(t=this._items.length-1),void 0===this._items?.[t]?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),"smooth"===t.behavior){const e=this._layout.getScrollIntoViewCoordinates(t),{behavior:n}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:n}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){const{index:e}=this._scrollIntoViewTarget||{};e&&t?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new Ii({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new zi({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(const e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function Hi(t){const e=t?parseFloat(t):NaN;return Number.isNaN(e)?0:e}function Yi(t){if(null!==t.assignedSlot)return t.assignedSlot;if(null!==t.parentElement)return t.parentElement;const e=t.parentNode;return e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host||null}const Bi=B(class extends ut{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(t,e)=>((t,e)=>b`${e}: ${JSON.stringify(t,null,2)}`)(t,e+this._first),this._keyFunction=(t,e)=>(t=>t)(t,this._first),this._items=[],t.type!==V)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);const e=[];if(this._first>=0&&this._last>=this._first)for(let t=this._first;t<=this._last;t++)e.push(this._items[t]);return Et(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);const n=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),n?x:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){const n=t.parentNode;this._makeVirtualizer(n,e)}this._virtualizer.items=this._items}_setFunctions(t){const{renderItem:e,keyFunction:n}=t;e&&(this._renderItem=(t,n)=>e(t,n+this._first)),n&&(this._keyFunction=(t,e)=>n(t,e+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();const{layout:n,scroller:s,items:i}=e;this._virtualizer=new Wi({hostElement:t,layout:n,scroller:s}),this._virtualizer.items=i,this._virtualizer.connected()}_initialize(t,e){const n=t.parentNode;n&&1===n.nodeType&&(n.addEventListener("rangeChanged",t=>{this._first=t.first,this._last=t.last,this.setValue(this.render())}),this._makeVirtualizer(n,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});function qi(t,e,n){return"function"==typeof e?{keyFn:t,template:e,opts:n}:{keyFn:void 0,template:t,opts:e}}const Xi=t=>"function"==typeof t&&!0===t.__isAtom___&&"function"==typeof t.set&&"function"==typeof t.__subscribe,Gi=t=>"function"==typeof t,Zi=t=>"AsyncFunction"===t.constructor.name,Ki=(t,e,n,s)=>{if(Xi(t)){const i=t,o=Cn(i(),s),r=n(o.set,e),a=n(o.update,e);return o.set=r,o.update=a,i.__subscribe(()=>{ye.schedule(()=>o.set(i()))}),ke(o,()=>{r.cancel(),a.cancel()}),o}const i=Cn(t,s),o=n(i.set,e),r=n(i.update,e);return i.set=o,i.update=r,ke(i,()=>{o.cancel(),r.cancel()}),i};const Ji="mates";function Qi(t,e){try{null===e?t.removeItem(Ji):t.setItem(Ji,JSON.stringify(e))}catch{}}function to(t,e){const n=Cn((()=>{try{return function(t){try{const e=t.getItem(Ji);if(e)return JSON.parse(e)}catch{}return null}(t())}catch{return null}})()),s=n.set;n.set=function(e,i=!1){s(e,i);try{Qi(t(),n.get())}catch{}};const i=n.update;return n.update=function(e,s=!1){if(null!==n.get()){i(e,s);try{Qi(t(),n.get())}catch{}}},e(t=>{if(t.key===Ji)if(t.newValue)try{s(JSON.parse(t.newValue))}catch{}else s(null)}),Object.defineProperty(n,"name",{value:"storageAtom",writable:!0,configurable:!0,enumerable:!1}),n}function eo(t){"undefined"!=typeof window&&window.addEventListener("storage",t)}const no=to(()=>localStorage,t=>eo(e=>{e.storageArea===localStorage&&t(e)})),so=to(()=>sessionStorage,t=>eo(e=>{e.storageArea===sessionStorage&&t(e)})),io=Cn("undefined"!=typeof document?document.title:"");Un(()=>{var t;t=io.get(),"undefined"!=typeof document&&(document.title=t)});function oo(t,e=2){let n=parseFloat(String(t).trim());Number.isFinite(n)||(n=0);const s=10**e;return Math.round(n*s)/s}function ro(t,e,n){const s=Cn(t,n),i=Cn([],n);function o(){const t=s.get(),n=e.map(e=>e(t)).filter(t=>null!=t&&""!==t);return i.set(n),n}const r=s.set;s.set=function(t,e=!1){r(t,e),o()};const a=s.update;s.update=function(t,e=!1){a(t,e),o()};const l=s;return Object.defineProperty(l,"__isFormAtom__",{value:!0,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(l,"errors",{get:()=>i.get(),enumerable:!1,configurable:!0}),Object.defineProperty(l,"isValid",{get:()=>0===i.get().length,enumerable:!1,configurable:!0}),l.validate=o,l.toFloat=()=>oo(s.get()),l.toFloatString=()=>oo(s.get()).toString(),l.toValidNumber=()=>function(t){const e=Number(t);return Number.isFinite(e)?e:0}(s.get()),Object.defineProperty(l,"name",{value:"formAtom",writable:!0,configurable:!0,enumerable:!1}),l}function ao(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function lo(t){return null==t||("string"==typeof t||Array.isArray(t)?0===t.length:t instanceof Map||t instanceof Set?0===t.size:"object"==typeof t&&0===Object.keys(t).length)}function co(t){const e=new Set,n=[Object.prototype,Array.prototype,Function.prototype,String.prototype,Number.prototype,Boolean.prototype,Symbol.prototype,Date.prototype,RegExp.prototype,Map.prototype,Set.prototype,WeakMap.prototype,WeakSet.prototype,Promise.prototype,Error.prototype];let s=t;for(;s&&!n.includes(s);){for(const t of Reflect.ownKeys(s))"constructor"!==t&&e.add(t);s=Object.getPrototypeOf(s)}return Array.from(e)}const ho=t=>{const e=fe();if(e&&e.scopes.has(t))throw new Error("Scope already exists for the same class for this component");let n;Qt.viewOuterInProgress=!0;try{n=new t}finally{Qt.viewOuterInProgress=!1}const s=Qt.setupInProgress;try{if((()=>{co(n).forEach(t=>{const e=Object.getOwnPropertyDescriptor(n,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),t);if(e&&(e.get||e.set))return;const s=n[t];"function"!=typeof s||s.__version__||(n[t]=s.bind(n))})})(),"function"==typeof n.setup){Zi(n.setup)&&console.warn("Async setup functions are not supported. Please ensure the setup function is synchronous."),Qt.setupInProgress=!0;try{n.setup(e?._propsFn||(()=>({})))}catch(t){console.error(t)}finally{Qt.setupInProgress=s}}e&&e.addScope(t,n),n.__isScope___=!0}catch(t){console.error(t)}finally{Qt.setupInProgress=s}return n},uo=t=>{let e=null;const n=new CustomEvent("request-parent-scope",{bubbles:!0,composed:!0,detail:{ScopeClass:t,resolve:t=>{e=t}}});if(fe().dispatchEvent(n),e)return e;throw new Error(`No parent scope found for ${t.name}`)};function fo(t,e){let n=t;for(;n&&n!==Object.prototype;){const t=Object.getOwnPropertyDescriptor(n,e);if(t)return t;n=Object.getPrototypeOf(n)}}const po=(t,e,n)=>{const s=co(t);s.forEach(s=>{const i=fo(t,s);if(i?.get){let n,o=-1;const r=i.get;Object.defineProperty(t,s,{get(){const s=e.__version__;return s!==o&&(o=s,n=r.call(t)),n},configurable:!0,enumerable:i.enumerable})}else if(Gi(t[s])){if(Zi(t[s]))throw new Error(`Async functions are not supported inside ${n}`);const i=t[s];t[s]=(...n)=>{e.update(()=>i.apply(t,n))}}});const i=Object.create(t);return s.forEach(n=>{const s=fo(t,n);if(!s)return;const o=!!s.get,r=!o&&Gi(s.value);o||r||Object.defineProperty(i,n,{get:()=>e()[n],set(t){e.update(e=>{e[n]=t})},enumerable:!0,configurable:!0})}),i};function mo(t,e,n,s=!1){document.addEventListener(t,e,{capture:s}),n.addToCleanUps(e,()=>{document.removeEventListener(t,e,{capture:s})})}function _o(t,e,n,s){let i;if("wheelUp"===t||"wheelDown"===t){const o="wheelUp"===t,r=e,a=t=>{(o?t.deltaY>=0:t.deltaY<=0)||(i&&i(),i=r(t))};return window.addEventListener("wheel",a,{capture:n,passive:!0}),void s.addToCleanUps(e,()=>{window.removeEventListener("wheel",a,{capture:n}),i&&i()})}const o="scroll"===t||"touchstart"===t||"touchmove"===t,r=e,a=t=>{i&&i(),i=r(t)};window.addEventListener(t,a,{capture:n,passive:o}),s.addToCleanUps(e,()=>{window.removeEventListener(t,a,{capture:n}),i&&i()})}function go(t,e){me()||(ve(),_o(t,e,!1,fe()))}function yo(t,e){me()||(ve(),_o(t,e,!0,fe()))}const wo=Js((t,e,n)=>{const s=document.createElement("div");Object.assign(s.style,{position:"fixed",inset:"0",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0, 0, 0, 0.5)"}),n?.style&&Object.assign(s.style,n.style),n?.onBackdropClick&&s.addEventListener("click",t=>{t.target===s&&n.onBackdropClick()});const i=document.createElement("div");n?.dialogStyle&&Object.assign(i.style,n.dialogStyle),i.addEventListener("click",t=>t.stopPropagation()),U(e,i),s.appendChild(i),document.body.appendChild(s);const o=document.body.style.overflow;return document.body.style.overflow="hidden",{onUpdate(t){U(t,i)},onCleanup(){s.remove(),document.body.style.overflow=o}}});const vo={position:"fixed",display:"none",margin:"0"},bo="9999";function So(t={}){const{style:e,target:n,zIndex:s=bo}=t,i=document.createElement("div");for(const[t,e]of Object.entries(vo))i.style[t]=e;i.style.zIndex=String(s),e&&Object.assign(i.style,e);return{el:i,attach:()=>{i.isConnected||function(t){return t?"string"==typeof t?document.querySelector(t)??document.body:t:document.body}(n).appendChild(i)},detach:()=>{i.isConnected&&i.remove()},isAttached:()=>i.isConnected}}function xo(t,e,n,s,i,o,r){return t.startsWith("top")?s>=n:t.startsWith("bottom")?i>=n:t.startsWith("left")?o>=e:!!t.startsWith("right")&&r>=e}function Co(t,e,n,s,i,o){const r=window.innerWidth,a=function(t){let e=t.parentElement;for(;e&&e!==document.documentElement;){const{overflowY:t}=window.getComputedStyle(e),n="auto"===t||"scroll"===t,s=e.scrollHeight>e.clientHeight;if(n&&s)return e;e=e.parentElement}return null}(t);let l,c;if(a){const t=a.getBoundingClientRect(),n=a.scrollHeight-a.scrollTop-a.clientHeight;c=t.bottom-e.bottom+n-i;const s=a.scrollTop;l=e.top-t.top+s-i}else{const t=window.scrollY||document.documentElement.scrollTop,n=document.documentElement.scrollHeight;l=e.top+t-i,c=n-(e.bottom+t)-i}const h=e.left-i,u=r-e.right-i;if("auto"===o){const t=["bottom-start","top-start","right","left"];for(const e of t)if(xo(e,n,s,l,c,h,u))return e;return"bottom-start"}if(xo(o,n,s,l,c,h,u))return o;const d=function(t){return t.startsWith("top")?t.replace("top","bottom"):t.startsWith("bottom")?t.replace("bottom","top"):t.startsWith("left")?t.replace("left","right"):t.startsWith("right")?t.replace("right","left"):t}(o);return xo(d,n,s,l,c,h,u)?d:o}const Eo=Ys((t,e,n)=>{const s=t.el;let i=!1,o=e,r=n;console.log("[popup] MOUNT — anchor:",s,"destroyOnClose:",!!n.destroyOnClose);const a=So({style:{background:"var(--md-color-surface-raised,#fff)",boxShadow:"var(--md-shadow-dropdown,0 5px 5px -3px rgba(0,0,0,.20),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12))",minWidth:"160px",...r.style??{}}}),l=a.el;r.destroyOnClose;const c=()=>{const t=s.getBoundingClientRect();l.style.visibility="hidden",l.style.display="block",r.matchAnchorWidth&&(l.style.width=`${t.width}px`);const e=l.offsetWidth,n=l.offsetHeight,i=Co(s,t,e,n,r.gap??4,r.position??"bottom-start");!function(t,e,n,s,i,o){const r=window.innerWidth,a=window.innerHeight;let l=0,c=0;n.startsWith("bottom")?l=e.bottom+o:n.startsWith("top")?l=e.top-o-i:"right"===n||"left"===n?l=e.top+e.height/2-i/2:n.endsWith("-start")?l=e.top:n.endsWith("-end")&&(l=e.bottom-i),"bottom"===n||"top"===n?c=e.left+e.width/2-s/2:n.endsWith("-start")?c=n.startsWith("right")?e.right+o:n.startsWith("left")?e.left-o-s:e.left:n.endsWith("-end")?c=n.startsWith("right")?e.right+o:n.startsWith("left")?e.left-o-s:e.right-s:n.startsWith("right")?c=e.right+o:n.startsWith("left")&&(c=e.left-o-s);const h=Math.max(4,Math.min(c,r-s-4)),u=Math.max(4,Math.min(l,a-i-4)),d=parseInt(String(h),10),f=parseInt(String(u),10);t.style.left=`${d}px`,t.style.top=`${f}px`}(l,t,i,e,n,r.gap??4),l.style.visibility=""},h=()=>{i&&c()};let u=null;const d=()=>{u?.disconnect(),u=null},f=t=>{const e=t.target;l.contains(e)||s.contains(e)||g()},p=t=>{"Escape"===t.key&&g()},m=()=>void 0!==r.open,_=()=>{i||(i=!0,a.isAttached()||(a.attach(),U(o,l),console.log("[popup] LAZY-ATTACHED to body on open — floating:",l)),c(),r.onOpen?.(l),m()||(document.addEventListener("click",f,{capture:!0}),document.addEventListener("keydown",p)),window.addEventListener("scroll",h,{passive:!0,capture:!0}),window.addEventListener("resize",h,{passive:!0}),r.matchAnchorWidth&&(u=new ResizeObserver(t=>{if(!i)return;const e=t[0]?.borderBoxSize?.[0]?.inlineSize??t[0]?.contentRect.width;null!=e&&(l.style.width=`${e}px`,l.style.minWidth=`${e}px`,h())}),u.observe(s)))},g=()=>{i&&(console.log("[popup] CLOSE — destroyOnClose:",r.destroyOnClose,"floating.isConnected:",l.isConnected,"floating:",l),i=!1,r.destroyOnClose||(l.style.display="none"),r.onClose?.(s,l),r.destroyOnClose&&a.isAttached()&&(console.log("[popup] REMOVED from body in close() — floating:",l),a.detach()),m()||(document.removeEventListener("click",f,{capture:!0}),document.removeEventListener("keydown",p)),window.removeEventListener("scroll",h,{capture:!0}),window.removeEventListener("resize",h),d())},y=t=>{t.stopPropagation(),i?g():_()};return m()?r.open()&&_():s.addEventListener("click",y),{onUpdate(t,e){console.log("[popup] UPDATE — isOpen:",i,"anchor:",s);const n=m();if(o=t,r=e,l.isConnected&&U(t,l),e.style&&Object.assign(l.style,e.style),m()){n||s.removeEventListener("click",y);const t=e.open();t&&!i?_():!t&&i?g():i&&c()}else n&&s.addEventListener("click",y),i&&c()},onCleanup(){console.log("[popup] CLEANUP — isOpen:",i,"floating.parentNode:",l.parentNode??"NO PARENT","floating.isConnected:",l.isConnected,"floating:",l,"anchor.isConnected:",s.isConnected),i&&g(),d(),m()||s.removeEventListener("click",y),a.detach(),console.log("[popup] CLEANUP DONE — floating still in body?",a.isAttached())}}});const Ao=Js((t,e,n)=>{const s=document.createElement("div");if(n?.style&&Object.assign(s.style,n.style),n?.on)for(const[t,e]of Object.entries(n.on))s.addEventListener(t,e);return function(t){return t?"string"==typeof t?document.querySelector(t)??document.body:t:document.body}(n?.target).appendChild(s),U(e,s),{onUpdate(t){U(t,s)},onCleanup(){s.remove()}}});const ko=1e3,Mo=3e4,$o=1/0;var To,Ro,Oo,Po,Io,zo;function Do(t){return"number"==typeof t?`${t}px`:t}Ro=new WeakMap,Oo=new WeakMap,Po=new WeakMap,Io=new WeakMap,To=new WeakSet,zo=function(t){se(this,Ro,"f")?.remove(),ie(this,Ro,null,"f"),ie(this,Oo,"","f"),ie(this,Po,"","f"),ie(this,Io,new Set,"f");const e=t.endNode;if(e?.parentNode){const n=t.startNode,s=document.createRange();s.setStartAfter(n),s.setEndBefore(e),s.deleteContents()}};const Lo=B(class extends q{constructor(t){if(super(t),To.add(this),Ro.set(this,null),Oo.set(this,""),Po.set(this,""),Io.set(this,new Set),t.type!==V)throw new Error("safeSVG() must be used as a child expression, e.g. html`<div>${safeSVG(markup)}</div>`")}update(t,[e,n]){if(console.log("update"),!e.trimStart().startsWith("<svg"))return console.warn("safeSVG: input does not start with <svg — nothing rendered"),se(this,To,"m",zo).call(this,t),x;const s=JSON.stringify(n);if(null===se(this,Ro,"f")||e!==se(this,Oo,"f")){const n=function(t){const e=document.createElement("template");e.innerHTML=t;const n=e.content.firstElementChild;return n instanceof SVGElement?n:null}(e);if(null===n)return console.warn("safeSVG: failed to parse SVG markup — nothing rendered"),se(this,To,"m",zo).call(this,t),x;se(this,Ro,"f")?.remove(),ie(this,Ro,n,"f"),ie(this,Oo,e,"f"),ie(this,Po,"","f"),ie(this,Io,new Set,"f");const s=t.endNode;s.parentNode.insertBefore(se(this,Ro,"f"),s)}if(s!==se(this,Po,"f")){const t=function(t,e){const n=new Set,s=(e,s)=>{t.setAttribute(e,s),n.add(e)},i=e.width??e.size,o=e.height??e.size;void 0!==i&&s("width",Do(i)),void 0!==o&&s("height",Do(o)),void 0!==e.fill&&s("fill",e.fill),void 0!==e.stroke&&s("stroke",e.stroke),void 0!==e.strokeWidth&&s("stroke-width",String(e.strokeWidth)),void 0!==e.strokeLinecap&&s("stroke-linecap",e.strokeLinecap),void 0!==e.strokeLinejoin&&s("stroke-linejoin",e.strokeLinejoin),void 0!==e.opacity&&s("opacity",String(e.opacity)),void 0!==e.viewBox&&s("viewBox",e.viewBox),void 0!==e.transform&&s("transform",e.transform);const r=[],a=e.width??e.size,l=e.height??e.size;void 0!==a&&r.push(`width:${Do(a)}`),void 0!==l&&r.push(`height:${Do(l)}`),void 0!==e.color&&r.push(`color:${e.color}`),r.push("display:inline-block"),r.push("vertical-align:middle"),e.style&&r.push(e.style),s("style",r.join(";")),e.class&&s("class",e.class);const c=e.ariaHidden??!0;return e.ariaLabel?(s("aria-label",e.ariaLabel),s("role","img")):c&&s("aria-hidden","true"),n}(se(this,Ro,"f"),n);for(const e of se(this,Io,"f"))t.has(e)||se(this,Ro,"f").removeAttribute(e);ie(this,Io,t,"f"),ie(this,Po,s,"f")}return x}render(t,e){return x}});function No(t,e={}){return Lo(t,e)}function jo(){const t=new Uint8Array(16);if("undefined"!=typeof crypto&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<16;e++)t[e]=256*Math.random()|0;t[6]=15&t[6]|64,t[8]=63&t[8]|128;const e=Array.from(t).map(t=>t.toString(16).padStart(2,"0")).join("");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}let Uo=null,Fo=null,Vo=null;function Wo(t){Uo=t}function Ho(t){Fo=t}function Yo(){return Fo}function Bo(){return Uo??-(new Date).getTimezoneOffset()}function qo(){return Vo??("undefined"!=typeof navigator?navigator.language:null)??"en"}function Xo(t,e){const n={};for(const s of new Intl.DateTimeFormat("en",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date(e)))"literal"!==s.type&&(n[s.type]=parseInt(s.value,10));const s=24===n.hour?0:n.hour,i=Date.UTC(n.year,n.month-1,n.day,s,n.minute,n.second);return Math.round((i-e)/6e4)||0}function Go(t,e){try{const n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"short"}).formatToParts(new Date(e)).find(t=>"timeZoneName"===t.type);return n?n.value:t}catch{return t}}function Zo(t,e){try{const n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"long"}).formatToParts(new Date(e)).find(t=>"timeZoneName"===t.type);return n?n.value:t}catch{return t}}function Ko(t,e){const n=new Date(t+6e4*e);return{Y:n.getUTCFullYear(),M:n.getUTCMonth()+1,D:n.getUTCDate(),h:n.getUTCHours(),m:n.getUTCMinutes(),s:n.getUTCSeconds(),ms:n.getUTCMilliseconds(),wd:n.getUTCDay()}}const Jo=t=>String(t).padStart(2,"0");function Qo(t,e,n){const s={[n]:e};return Fo?s.timeZone=Fo:(s.timeZone="UTC",t+=6e4*Bo()),new Intl.DateTimeFormat(qo(),s).format(new Date(t))}function tr(t,e){const n=t>=0?"+":"-",s=Math.abs(t);return e?`${n}${Jo(Math.floor(s/60))}:${Jo(s%60)}`:`${n}${Jo(Math.floor(s/60))}${Jo(s%60)}`}function er(t){const e=t.replace(/s$/,"");if("millisecond"===e||"m"===e)return"ms";if("minute"===e)return"min";if(!new Set(["year","month","week","day","hour","min","second","ms"]).has(e))throw new RangeError(`Invalid date unit: "${t}"`);return e}function nr(){try{const t=new Intl.Locale(qo()),e=t.weekInfo?.firstDay??t.getWeekInfo?.()?.firstDay;if(void 0!==e)return e%7}catch{}return 0}const sr=/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|H|hh|h|mm|ss|SSS|ZZ|Z|A|a/g,ir=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function or(t){try{const e=new Date(Date.UTC(2024,0,7+t,12,0,0));return new Intl.DateTimeFormat(qo(),{weekday:"long",timeZone:"UTC"}).format(e)}catch{return ir[t]||""}}function rr(t){try{const e=new Date(Date.UTC(2024,t-1,15,12,0,0));return new Intl.DateTimeFormat(qo(),{month:"long",timeZone:"UTC"}).format(e)}catch{return""}}function ar(t){if(t instanceof Number)return t.valueOf();if("number"==typeof t)return t;if("string"==typeof t)return new Date(t).getTime();if(t instanceof Date)return t.getTime();if("object"==typeof t&&null!==t){const{year:e=1970,month:n=1,day:s=1,hour:i=0,minute:o=0,second:r=0,ms:a=0}=t;return Date.UTC(e,n-1,s,i,o,r,a)-6e4*Bo()}return NaN}function lr(t,e,n){const s=er(n);if("hour"===s)return t+36e5*e;if("min"===s)return t+6e4*e;if("second"===s)return t+1e3*e;if("ms"===s)return t+e;const i=Bo(),o=Ko(t,i);let r=o.Y,a=o.M,l=o.D;if("year"===s)r+=e;else if("month"===s){const t=a-1+e;r+=Math.floor(t/12),a=(t%12+12)%12+1,l=Math.min(l,new Date(r,a,0).getDate())}else l+="week"===s?7*e:e;return Date.UTC(r,a-1,l,o.h,o.m,o.s,o.ms)-6e4*i}function cr(t,e){const n=Bo(),s=Ko(t,n),i=Ko(e,n);return s.Y===i.Y&&s.M===i.M&&s.D===i.D}function hr(t){const e=Bo(),n=Ko(t,e);return Date.UTC(n.Y,n.M-1,n.D,0,0,0,0)-6e4*e}function ur(t,e){const n=Bo(),s=Ko(t,n),i=s.h%12||12,o=[],r=e.replace(/\[([^\]]*)\]/g,(t,e)=>(o.push(e),`\0${o.length-1}\0`));sr.lastIndex=0;const a=r.replace(sr,e=>{switch(e){case"YYYY":return String(s.Y);case"YY":return String(s.Y).slice(-2);case"MMMM":return Qo(t,"long","month");case"MMM":return Qo(t,"short","month");case"MM":return Jo(s.M);case"M":return String(s.M);case"DD":return Jo(s.D);case"D":return String(s.D);case"dddd":return Qo(t,"long","weekday");case"ddd":return Qo(t,"short","weekday");case"HH":return Jo(s.h);case"H":return String(s.h);case"hh":return Jo(i);case"h":return String(i);case"mm":return Jo(s.m);case"ss":return Jo(s.s);case"SSS":return(t=>String(t).padStart(3,"0"))(s.ms);case"A":return s.h>=12?"PM":"AM";case"a":return s.h>=12?"pm":"am";case"Z":return tr(n,!0);case"ZZ":return tr(n,!1);default:return e}});return a.replace(/\0(\d+)\0/g,(t,e)=>o[+e])}const dr=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]];const fr=Symbol("ts"),pr=Object.create(Number.prototype);function mr(t){return function(t){const e=Object.create(pr);return e[fr]=t,e}(void 0===t?Date.now():ar(t))}Object.defineProperties(pr,{valueOf:{value(){return this[fr]},writable:!1,configurable:!1},values:{get(){const t=this[fr],e=Ko(t,Bo());return{year:e.Y,month:e.M,monthName:rr(e.M),dayName:or(e.wd),date:e.D,weekStartDayName:or(nr()),numberOfDaysOfTheMonth:new Date(e.Y,e.M,0).getDate(),hours:e.h,minutes:e.m,seconds:e.s,milliSeconds:e.ms,timestamp:t,iso:new Date(t).toISOString()}},configurable:!1},toJSON:{value(){const t=this[fr];return Number.isFinite(t)?new Date(t).toISOString():"Invalid Date"},writable:!1,configurable:!1},toString:{value(){const t=this[fr];return Number.isFinite(t)?new Intl.DateTimeFormat(qo(),{dateStyle:"medium",...Yo()?{timeZone:Yo()}:{timeZone:"UTC"}}).format(new Date(Yo()?t:t+6e4*Bo())):"Invalid Date"},writable:!1,configurable:!1},format:{value(t){return ur(this[fr],t)},writable:!1,configurable:!1},formatLongAgo:{value(t){return function(t,e={}){const{numeric:n="auto",style:s="long"}=e,i=((void 0!==e.now?ar(e.now):Date.now())-t)/1e3,o=Math.abs(i),r=i>=0?-1:1,a=new Intl.RelativeTimeFormat(qo(),{numeric:n,style:s});for(const[t,e]of dr)if(o>=e)return a.format(r*Math.round(o/e),t);return a.format(0,"second")}(this[fr],t)},writable:!1,configurable:!1},add:{value(t,e){return this[fr]=lr(this[fr],t,e),this},writable:!1,configurable:!1},subtract:{value(t,e){return this[fr]=lr(this[fr],-t,e),this},writable:!1,configurable:!1},isBefore:{value(t){return this[fr]<ar(t)},writable:!1,configurable:!1},isAfter:{value(t){return this[fr]>ar(t)},writable:!1,configurable:!1},isFuture:{value(){return this[fr]>Date.now()},writable:!1,configurable:!1},isPresent:{value(){return cr(this[fr],Date.now())},writable:!1,configurable:!1},isToday:{value(){return cr(this[fr],Date.now())},writable:!1,configurable:!1},isYesterday:{value(){const t=lr(hr(Date.now()),-1,"day");return cr(this[fr],t)},writable:!1,configurable:!1},isTomorrow:{value(){const t=lr(hr(Date.now()),1,"day");return cr(this[fr],t)},writable:!1,configurable:!1},getDifference:{value(t,e){return function(t,e,n){const s=er(n),i=t-e;if("ms"===s)return i;if("second"===s)return Math.trunc(i/1e3);if("min"===s)return Math.trunc(i/6e4);if("hour"===s)return Math.trunc(i/36e5);const o=Bo(),r=Ko(t,o),a=Ko(e,o);if("day"===s||"week"===s){const n=Math.floor((t+6e4*o)/864e5)-Math.floor((e+6e4*o)/864e5);return"week"===s?Math.trunc(n/7):n}return"month"===s?12*(r.Y-a.Y)+(r.M-a.M):r.Y-a.Y}(this[fr],ar(t),e)},writable:!1,configurable:!1},getAge:{value(t){return function(t,e){const n=Bo(),s=Ko(t,n),i=Ko(e,n);let o=i.Y-s.Y,r=s.M,a=s.D;if(2===r&&29===a){const t=t=>t%4==0&&t%100!=0||t%400==0;t(i.Y)||(r=3,a=1)}return(i.M<r||i.M===r&&i.D<a)&&o--,Math.max(0,o)}(this[fr],void 0!==t?ar(t):Date.now())},writable:!1,configurable:!1}}),exports.$=Fs,exports.Context=class{constructor(){this.id=Math.random().toString(36).substring(2,15),this.context=null}},exports.Delete=t=>ks.Delete(vs(t)),exports.ErrorTypes=ws,exports.Fetch=t=>ks.fetch(vs(t)),exports.FetchClient=As,exports.Get=t=>ks.Get(vs(t)),exports.MA={fadeIn:"mates-fade-in",fadeOut:"mates-fade-out",slideInUp:"mates-slide-in-up",slideOutUp:"mates-slide-out-up",slideInDown:"mates-slide-in-down",slideOutDown:"mates-slide-out-down",slideInLeft:"mates-slide-in-left",slideOutLeft:"mates-slide-out-left",slideInRight:"mates-slide-in-right",slideOutRight:"mates-slide-out-right",scaleIn:"mates-scale-in",scaleOut:"mates-scale-out",springIn:"mates-spring-in",flipInX:"mates-flip-in-x",flipInY:"mates-flip-in-y",blurIn:"mates-blur-in",blurOut:"mates-blur-out",shake:"mates-shake",pulse:"mates-pulse",bounce:"mates-bounce",spin:"mates-spin"},exports.NotificationManager=le,exports.Patch=t=>ks.Patch(vs(t)),exports.Post=t=>ks.Post(vs(t)),exports.Put=t=>ks.Put(vs(t)),exports.Router=(t,e)=>{const n=t.find(t=>es(t.path));if(void 0===n)return e?()=>Yn(e):()=>C;const{component:s}=n;return Te(s),()=>Yn(s)},exports.SyncNotificationManager=ce,exports.ZeroPromise=ys,exports._=Ce,exports._subToView=Ee,exports.action=function(t){te("Action");let e=t;const n=new Set;let s=null,i=null;const o=t=>{n.forEach(e=>{try{e(t)}catch(t){console.error(t)}})};return Object.assign(function(...t){return((t,n)=>{try{let r;return r=s?s((...n)=>e.call(t,...n),...n):e.call(t,...n),i&&(r=i(r)),o(r),r}catch(t){const e=t instanceof Error?t:new Error(String(t));throw o(void 0),e}})(this,t)},{val:()=>e,set:t=>{e=t},__isAction___:!0,__subscribe:t=>(te("subscribe"),n.add(t),()=>n.delete(t)),interceptBefore:t=>{s=t},interceptAfter:t=>{i=t}})},exports.addStoreBeingRead=Yt,exports.animatedIf=Ws,exports.animatedRouter=function(t,e={}){return Yn(ns,{routes:t,options:e})},exports.animatedX=function(t,e,n){const{show:s,...i}=n;return Ws(s,b`<x-view .view=${t} .props=${e}></x-view>`,C,i)},exports.arrayRange=function(t,e,n){if(void 0===e&&(e=t,t=0),void 0===n&&(n=t<=e?1:-1),0===n)return[];const s=[];if(n>0)for(let i=t;i<e;i+=n)s.push(i);else for(let i=t;i>e;i+=n)s.push(i);return s},exports.assertComponentOuterContext=ee,exports.assertNotInRestrictedContext=te,exports.asyncAction=Rn,exports.asyncAppend=_t,exports.asyncReplace=mt,exports.atom=Cn,exports.attr=function(t){return Bs(t)},exports.blurInPreset=function(t=10,e=400,n="ease-out"){return{keyframes:[{filter:`blur(${t}px)`,opacity:0},{filter:"blur(0px)",opacity:1}],options:{duration:e,easing:n,fill:"both"}}},exports.blurOutPreset=function(t=10,e=400,n="ease-in"){return{keyframes:[{filter:"blur(0px)",opacity:1},{filter:`blur(${t}px)`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}},exports.bouncePreset=function(t=600){return{keyframes:[{transform:"translateY(0)",offset:0},{transform:"translateY(-30%)",offset:.3},{transform:"translateY(0)",offset:.5},{transform:"translateY(-15%)",offset:.7},{transform:"translateY(0)",offset:.85},{transform:"translateY(-5%)",offset:.95},{transform:"translateY(0)",offset:1}],options:{duration:t,easing:"ease",fill:"both"}}},exports.buildPath=ss,exports.buildRequestUrl=bs,exports.cacheAtom=function(t){const e=new Map,n=new Map,s=Cn(e,t),i=s.get.bind(s),o=s;return o.add=(t,i,o)=>{if(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),s.update(e=>{e.set(t,i)}),void 0!==o&&-1!==o&&o>0){const i=setTimeout(()=>{e.delete(t),n.delete(t),s.update(()=>{})},o);n.set(t,i)}},o.get=t=>(i(),e.get(t)),o.remove=t=>!!e.has(t)&&(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),e.delete(t),s.update(()=>{}),!0),o.has=t=>(i(),e.has(t)),o.getAll=()=>(i(),Array.from(e.values())),o.clearAll=()=>{n.forEach(t=>clearTimeout(t)),n.clear(),e.clear(),s.update(()=>{})},Object.defineProperty(o,"size",{get:()=>(i(),e.size),enumerable:!0,configurable:!0}),Object.defineProperty(o,"name",{get:()=>"cacheAtom",enumerable:!0,configurable:!0}),ke(s,o.clearAll),o},exports.cacheFn=$n,exports.changeFlagAtom=function(t=0,e){const n=Cn(t,e),s=n;return s.change=t=>{n.set(void 0!==t?t:Math.random())},s.name="changeFlagAtom",s},exports.chunk=function(t,e){if(e<1)return[];const n=[];for(let s=0;s<t.length;s+=e)n.push(t.slice(s,s+e));return n},exports.clamp=function(t,e,n){return Math.min(Math.max(t,e),n)},exports.classMap=wt,exports.classes=function(t){return qs(t)},exports.cleanupScheduler=ge,exports.clearInterceptors=()=>{xs.clear(),Cs.clear(),Es.clear()},exports.collapseWidthPreset=function(t=500,e="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{width:"auto",overflow:"hidden"},{width:"0",overflow:"hidden"}],options:{duration:t,easing:e,fill:"both"}}},exports.collectSSRStyles=function(){const t=[];for(const e of on){const n=e.getAllCSS();n&&t.push(n)}return t.join("\n")},exports.componentRunningStatus=Qt,exports.computeAutoPlacement=function(t,e,n,s){const i=window.innerHeight-t.bottom-s,o=t.top-s,r=window.innerWidth-t.right-s,a=t.left-s;return i>=n?"bottom":o>=n?"top":r>=e?"right":a>=e?"left":[["bottom",i],["top",o],["right",r],["left",a]].reduce((t,e)=>e[1]>t[1]?e:t)[0]},exports.configureCSS=function(t){t.breakpoints&&Object.assign(Ue,t.breakpoints)},exports.countdown=Gs,exports.createCacheManager=$n,exports.createFloatingContainer=So,exports.createManagedTimer=On,exports.createPollingManager=Tn,exports.createReactiveRunner=Sn,exports.createTimedAtom=Ki,exports.date=mr,exports.debounce=Dn,exports.debouncedAtom=(t,e,n)=>Ki(t,e,Dn,n),exports.deepClone=function t(e,n=new WeakMap){if("function"==typeof structuredClone)return structuredClone(e);if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){const s=new Map;return n.set(e,s),e.forEach((e,i)=>s.set(t(i,n),t(e,n))),s}if(e instanceof Set){const s=new Set;return n.set(e,s),e.forEach(e=>s.add(t(e,n))),s}if(Array.isArray(e)){const s=[];n.set(e,s);for(let i=0;i<e.length;i++)s[i]=t(e[i],n);return s}const s=n.get(e);if(s)return s;const i={};n.set(e,i);for(const s of Object.keys(e))i[s]=t(e[s],n);return i},exports.deepFreeze=wn,exports.delayAtom=function(t,e,n){const s=new Set;function i(t){const n=setTimeout(()=>{s.delete(n),t()},e);s.add(n)}function o(){for(const t of s)clearTimeout(t);s.clear()}if(Xi(t)){const e=t,s=Cn(e(),n),r=s.set.bind(s),a=s.update.bind(s);return s.set=(t,e)=>{i(()=>r(t,e))},s.update=(t,e)=>{i(()=>a(t,e))},e.__subscribe(()=>{const t=e();i(()=>r(t))}),ke(s,o),s}const r=Cn(t,n),a=r.set.bind(r),l=r.update.bind(r);return r.set=(t,e)=>{i(()=>a(t,e))},r.update=(t,e)=>{i(()=>l(t,e))},ke(r,o),r},exports.deleteAction=t=>ks.deleteAction(t),exports.df=wn,exports.dialog=function(t,e){return wo(t,e)},exports.disappear=Zs,exports.effect=Un,exports.effectScheduler=ye,exports.eleHook=Ys,exports.event=Me,exports.expandWidthPreset=function(t=500,e="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{width:"0",overflow:"hidden"},{width:"auto",overflow:"hidden"}],options:{duration:t,easing:e,fill:"both"}}},exports.fadeInPreset=mn,exports.fadeOutPreset=_n,exports.fetchAction=t=>ks.fetchAction(t),exports.fetchClient=ks,exports.flipInPreset=function(t="y",e=500,n="ease-out"){const s="x"===t?"rotateX":"rotateY";return{keyframes:[{transform:`${s}(90deg)`,opacity:0},{transform:`${s}(0deg)`,opacity:1}],options:{duration:e,easing:n,fill:"both"}}},exports.flipOutPreset=function(t="y",e=500,n="ease-in"){const s="x"===t?"rotateX":"rotateY";return{keyframes:[{transform:`${s}(0deg)`,opacity:1},{transform:`${s}(90deg)`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}},exports.formAtom=(t,e=[],n)=>ro(t,e,n),exports.get=function(t,e,n){const s=e.replace(/\[(\d+)]/g,".$1").split(".");let i=t;for(const t of s){if(null==i)return n;i=i[t]}return void 0===i?n:i},exports.getAction=t=>ks.getAction(t),exports.getAllProps=co,exports.getAllTimezones=function(){let t;try{t=Intl.supportedValuesOf("timeZone")}catch{return[]}const e=Date.now();return t.map(t=>({name:t,longName:Zo(t,e),shortName:Go(t,e),offset:Xo(t,e)}))},exports.getCalendar=function(t,e){if(!Number.isInteger(t)||!Number.isInteger(e)||e<1||e>12)throw new RangeError("getCalendar(year, month): month must be integer 1–12");const n=mr({year:t,month:e,day:1}),{year:s,month:i,numberOfDaysOfTheMonth:o}=n.values,r=[];for(let t=Ko(n.valueOf(),Bo()).wd;t>0;t--)r.push(mr({year:s,month:i,day:1-t}));for(let t=1;t<=o;t++)r.push(mr({year:s,month:i,day:t}));const a=r.length%7,l=0===a?0:7-a,c=mr({year:s,month:i,day:o});for(let t=0;t<l;t++)c.add(1,"day"),r.push(mr(c.valueOf()));const h=[];for(let t=0;t<r.length;t+=7)h.push(r.slice(t,t+7));return h},exports.getCoords=function(t,e,n){const s=t=>parseInt(String(t),10);switch(e){case"top":case"top-start":return{top:s(t.top-n),left:s(t.left)};case"top-end":return{top:s(t.top-n),left:s(t.right)};case"bottom":case"bottom-start":default:return{top:s(t.bottom+n),left:s(t.left)};case"bottom-end":return{top:s(t.bottom+n),left:s(t.right)};case"right":case"right-start":return{top:s(t.top),left:s(t.right+n)};case"right-end":return{top:s(t.bottom),left:s(t.right+n)};case"left":case"left-start":return{top:s(t.top),left:s(t.left-n)};case"left-end":return{top:s(t.bottom),left:s(t.left-n)}}},exports.getCurrentHost=fe,exports.getLocale=function(){return qo()},exports.getMonths=function(t){const e=t??qo(),n=new Intl.DateTimeFormat(e,{month:"long",timeZone:"UTC"}),s=new Intl.DateTimeFormat(e,{month:"short",timeZone:"UTC"}),i=[];for(let t=1;t<=12;t++){const e=new Date(Date.UTC(2024,t-1,15,12,0,0));i.push({number:t,name:n.format(e),shortName:s.format(e)})}return i},exports.getParentScope=uo,exports.getScope=uo,exports.getStoresBeingRead=function(){return Vt.storesBeingRead},exports.getTimezoneOffset=function(){return Bo()},exports.globalCSS=un,exports.globalScheduler=we,exports.globalTheme=function(t){const e=Object.keys(t);if(0===e.length)throw new Error("[globalTheme] themes object must have at least one entry.");const n=e[0],s=e[1],i=t[n],o=[];o.push(Os(":root",i));for(const n of e)o.push(Os(`[data-theme="${n}"]`,t[n]));void 0!==s&&o.push(function(t){let e="";for(const n in t)e+=` ${Rs(n)}: ${t[n]};\n`;return e?`@media (prefers-color-scheme: dark) {\n :root:not([data-theme]) {\n${e} }\n}`:""}(t[s])),hn();const r=cn(),a=o.filter(Boolean).join("\n");a&&r.appendRules(a);const l=Object.create(null);for(const t in i)l[t]=Rs(t);return{cssVars:Object.freeze(l),themeAtom:Ts}},exports.groupBy=function(t,e){const n={};for(const s of t){const t=String(e(s));n[t]||(n[t]=[]),n[t].push(s)}return n},exports.guard=bt,exports.hashAtom=os,exports.historyStateAtom=Zn,exports.html=b,exports.htmlHook=Js,exports.iAtom=En,exports.ifDefined=t=>t??C,exports.injectMatesAnimations=pn,exports.installDevToolsHooks=function(t){t.registerComponent&&(zt.registerComponent=t.registerComponent),t.unregisterComponent&&(zt.unregisterComponent=t.unregisterComponent),t.notifyRender&&(zt.notifyRender=t.notifyRender),t.getComponentName&&(zt.getComponentName=t.getComponentName),t.logComponentMount&&(zt.logComponentMount=t.logComponentMount),t.logComponentRender&&(zt.logComponentRender=t.logComponentRender),t.logComponentUnmount&&(zt.logComponentUnmount=t.logComponentUnmount),t.logAtomSet&&(zt.logAtomSet=t.logAtomSet),t.logAtomUpdate&&(zt.logAtomUpdate=t.logAtomUpdate),t.logEventTrigger&&(zt.logEventTrigger=t.logEventTrigger),t.logCleanupEventTrigger&&(zt.logCleanupEventTrigger=t.logCleanupEventTrigger),t.logFetchRequest&&(zt.logFetchRequest=t.logFetchRequest),t.logFetchResponse&&(zt.logFetchResponse=t.logFetchResponse),t.logFetchError&&(zt.logFetchError=t.logFetchError),t.recordRender&&(zt.recordRender=t.recordRender)},exports.interceptAfter=t=>Ss(Cs,t),exports.interceptBefore=t=>Ss(xs,t),exports.interceptError=t=>Ss(Es,t),exports.isAction=t=>"function"==typeof t&&!0===t.__isAction___&&"function"==typeof t.__subscribe,exports.isApiResponseSuccess=function(t){return t>=200&&t<300},exports.isAsyncAction=t=>"function"==typeof t&&!0===t.__isAsyncAction___&&"function"==typeof t.subscribe,exports.isAsyncFunction=Zi,exports.isAsyncValue=Te,exports.isAtom=Xi,exports.isChannel=t=>"object"==typeof t&&null!==t&&!0===t.__isChannel___&&"function"==typeof t.join,exports.isConfirmationEvent=t=>"object"==typeof t&&null!==t&&!0===t.__isConfirmationEvent___&&"function"==typeof t.requestConfirmation&&"function"==typeof t.onConfirmRequest,exports.isDefinedAsGetter=function(t,e){let n=Object.getOwnPropertyDescriptor(t,e),s=Object.getPrototypeOf(t);for(;!n&&s&&s!==Object.prototype;)n=Object.getOwnPropertyDescriptor(s,e),s=Object.getPrototypeOf(s);return n?.get&&"function"==typeof n.get?n.get:null},exports.isDevToolsInstalled=Ut,exports.isEffectRunning=Ht,exports.isEmail=t=>(t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))(t)?null:"Invalid email",exports.isEmpty=lo,exports.isEvent=t=>"object"==typeof t&&null!==t&&!0===t.__isEvent___&&"function"==typeof t.__subscribe&&"function"==typeof t.trigger,exports.isFunction=Gi,exports.isGetter=t=>"function"==typeof t&&!0===t.__isSelector___&&"function"==typeof t.areVersionsChanged,exports.isInRestrictedContext=function(){return!Qt.isHookRunning&&(Qt.templateInProgress||Ht())},exports.isMax=t=>e=>((t,e)=>t<=e)(e,t)?null:`Max is ${t}`,exports.isMin=t=>e=>((t,e)=>t>=e)(e,t)?null:`Min is ${t}`,exports.isPathMatching=es,exports.isPattern=(t,e="Invalid format")=>n=>((t,e)=>e.test(t))(n,t)?null:e,exports.isReadTrackingEnabled=Wt,exports.isRequired=t=>(t=>"number"==typeof t||"boolean"==typeof t||!lo(t))(t)?null:"Required",exports.isSSR=me,exports.isSetter=t=>"function"==typeof t&&!0===t.__isSetter___&&"function"==typeof t.__subscribe,exports.isUnit=t=>"object"==typeof t&&null!==t&&!0===t.__isUnit___&&"function"==typeof t.__subscribe&&"function"==typeof t.__reset,exports.iterateDeeply=function t(e,n){if(null==e||"object"!=typeof e)return;const s=Array.isArray(e)?e.map((t,e)=>e):Object.keys(e);for(const i of s){const s=n(i,e[i],e);void 0!==s&&(e[i]=s);const o=e[i];null!==o&&"object"==typeof o&&t(o,n)}},exports.join=
171
+ */let Ar="undefined"!=typeof window?window.ResizeObserver:void 0;const kr=Symbol("virtualizerRef"),Mr="virtualizer-sizer";let $r;class Tr{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEndRafId=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new Map,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!t)throw new Error("Virtualizer constructor requires a configuration object");if(!t.hostElement)throw new Error('Virtualizer configuration requires the "hostElement" property');this._init(t)}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);const e=t.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new Ar(()=>this._hostElementSizeChanged()),this._childrenRO=new Ar(this._childrenSizeChanged.bind(this))}_initHostElement(t){this._hostElement=t.hostElement;const e=this._hostElement;this._applyVirtualizerStyles(),e[kr]=this}connected(){this._initObservers();const t=this._isScroller;this._clippingAncestors=function(t,e=!1){let n=!1;return function(t,e=!1){const n=[];let s=e?t:xr(t);for(;null!==s;)n.push(s),s=xr(s);return n}(t,e).filter(t=>{if(n)return!1;const e=getComputedStyle(t);return n="fixed"===e.position,"visible"!==e.overflow})}
168
172
  /**
169
173
  * @license
170
174
  * Copyright 2021 Google LLC
171
175
  * SPDX-License-Identifier: BSD-3-Clause
172
- */
173
- function*(t,e){const n="function"==typeof e;if(void 0!==t){let s=-1;for(const i of t)s>-1&&(yield n?e(s):e),s++,yield i}},exports.keyed=St,exports.keyframes=function(t,e){tn("keyframes"),hn();const n=nn(t);return an.appendRules(sn(n,e)),n},exports.lazyLoad=function(t,e){return ti(t,e)},exports.litCache=yt,exports.live=xt,exports.location=fs,exports.lockNavigation=()=>Kn.set(!0),exports.logError=ne,exports.lsAtom=no,exports.mapAtom=(t=[],e)=>{const n=new Map(t),s=Cn(n,e),i=n.set.bind(n);n.set=(t,e)=>(i(t,e),s.update(()=>{}),n);const o=n.delete.bind(n);n.delete=t=>{const e=o(t);return s.update(()=>{}),e};const r=n.clear.bind(n);n.clear=()=>{r(),s.update(()=>{})};const a=n.get.bind(n);n.get=t=>(s.get(),a(t));const l=n.has.bind(n);n.has=t=>(s.get(),l(t));const c=Object.getOwnPropertyDescriptor(Map.prototype,"size");Object.defineProperty(n,"size",{get:()=>(s.get(),c.get.call(n))});const h=n.entries.bind(n);n.entries=()=>(s.get(),h());const u=n.values.bind(n);n.values=()=>(s.get(),u());const d=n.keys.bind(n);n.keys=()=>(s.get(),d());const f=n.forEach.bind(n);n.forEach=(t,e)=>(s.get(),f(t,e));const p=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(s.get(),p()),n.update=t=>{const e={set:(t,n)=>(i(t,n),e),delete:t=>o(t),clear:()=>{r()},get:t=>a(t),has:t=>l(t),entries:()=>h(),values:()=>u(),keys:()=>d(),forEach:(t,e)=>f(t,e),[Symbol.iterator]:()=>p(),get size(){return c.get.call(n)}};return t(e),s.update(()=>{}),n},n.updateItem=(t,e)=>{const i=a(t);return null==i||"object"!=typeof i||(e(i),s.update(()=>{})),n},Object.defineProperty(n,"__isAtom___",{value:s,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>s.__version__,enumerable:!1}),n},exports.masonryGrid=function(t,e,n,s){return si(t,e,n,s)},exports.maxLength=t=>e=>((t,e)=>t.length<=e)(e,t)?null:`Max ${t} characters`,exports.memo=function(t){let e;return Sn({name:"Memo",fn:t,onRun:t=>{e?e.set(()=>t):(e=Cn(void 0,{skipRestrictedContextCheck:!0}),e.set(()=>t,!0))}}),e},exports.memoTemplate=function(t,e){return ri(t,e)},exports.merge=function t(e,...n){const s={...e};for(const e of n)for(const n of Object.keys(e))ao(s[n])&&ao(e[n])?s[n]=t(s[n],e[n]):s[n]=e[n];return s},exports.minLength=t=>e=>((t,e)=>t.length>=e)(e,t)?null:`Min ${t} characters`,exports.navigateTo=ls,exports.navigationLocked=Kn,exports.navigationRequestEvent=Jn,exports.noChange=x,exports.nothing=C,exports.omit=function(t,e){const n={...t};for(const t of e)delete n[t];return n},exports.on=Ae,exports.onAllMount=t=>{ve(),t.__isOnAllMount__=!0;const e=fe();e.addToCleanUps(t,be),we.onceIdle(()=>{if(!e.isConnected)return;const n=t();n&&e.addToCleanUps(t,n)})},exports.onBlur=t=>{go("blur",t)},exports.onCleanup=t=>{ve(),t.__isOnCleanup__=!0;fe().addToCleanUps(t,t)},exports.onClickAway=t=>{if(me())return;ve();const e=fe(!0),n=n=>{const s=n.target;s&&!e.contains(s)&&t(n)};document.addEventListener("mousedown",n,!0),e.addToCleanUps(t,()=>{document.removeEventListener("mousedown",n,!0)})},exports.onConnect=function(t){return ei(t)},exports.onCopy=t=>{go("copy",t)},exports.onCut=t=>{go("cut",t)},exports.onDOMReady=t=>{const e=fe();if(!e)throw new Error("onDOMReady must be called within a component context");return e.DOMReadyEvent.__subscribe(t)},exports.onDisconnect=function(t){return ni(t)},exports.onEleEvent=function(t,e){return Xs(t,e)},exports.onError=t=>{ve();const e=fe();e._errorHandlers||(e._errorHandlers=[]),e._errorHandlers.push(t)},exports.onEvent=function(t){return pi(t)},exports.onFileDrop=t=>{if(me())return;ve();const e=fe();let n;const s=t=>t.preventDefault(),i=e=>{e.preventDefault(),n&&n(),n=t(e)};window.addEventListener("dragover",s),window.addEventListener("drop",i),e.addToCleanUps(t,()=>{window.removeEventListener("dragover",s),window.removeEventListener("drop",i),n&&n()})},exports.onFocus=t=>{go("focus",t)},exports.onHidden=function(t,e){return Qs({onHidden:t,...e})},exports.onIntersect=function(t){return Qs(t)},exports.onInterval=(t,e)=>{if(me())return;ve();const n=fe();let s;const i=setInterval(()=>{s&&s(),s=t()},e);n.addToCleanUps(t,()=>{clearInterval(i),s&&s()})},exports.onKeyDown=t=>{go("keydown",t)},exports.onKeyUp=t=>{go("keyup",t)},exports.onMount=Se,exports.onNavigate=t=>{if(me())return;ve();const e=fe();let n;const s=Qn.__subscribe(()=>{n&&n(),n=t(Qn.get())||null});e.addToCleanUps(t,()=>{s(),n&&n()})},exports.onNavigationRequest=t=>{me()||(ve(),Ae(()=>{const e=t(Jn);return"function"==typeof e?e:void 0},[Jn]))},exports.onOffline=t=>{go("offline",t)},exports.onOnline=t=>{go("online",t)},exports.onPaint=t=>{ve(),t.__isOnPaint__=!0;const e=fe();e.addToCleanUps(t,be),e.PaintEvent.__subscribe(()=>t())},exports.onParent=function(t,e){return mi(t,e)},exports.onPaste=t=>{go("paste",t)},exports.onReferenceChange=(t,e)=>{const n=fe();if(ve(),!n)throw new Error("onReferenceChange must be called inside a component");let s=[];t(),s=e(),n.onEachUpdate(()=>{const n=e();s.some((t,e)=>t!==n[e])&&(t(),s=n)})},exports.onResize=(t,e)=>{if(me())return;ve();const n=fe();let s;const i=new ResizeObserver(e=>{for(const n of e)s&&s(),s=t(n)}),o=e||n;i.observe(o),n.addToCleanUps(t,()=>{i.disconnect(),s&&s()})},exports.onScroll=(t,e=window)=>{if(me())return;ve();const n=fe();let s;const i=e=>{s&&s(),s=t(e)};e.addEventListener("scroll",i,{passive:!0}),n.addToCleanUps(t,()=>{e.removeEventListener("scroll",i),s&&s()})},exports.onScrolledIntoView=function(t,e){return ti(t,e)},exports.onSelectionChange=t=>{if(me())return;ve();let e;mo("selectionchange",()=>{e&&e(),e=t(window.getSelection())},fe())},exports.onSocket=function(t,e){ve();const n=fe(),s=e.map(e=>e.__subscribe(t));n.addToCleanUps(t,()=>{s.forEach(t=>t())})},exports.onStorageChange=t=>{go("storage",t)},exports.onTimeout=(t,e)=>{if(me())return;ve();const n=fe();let s;const i=setTimeout(()=>{s=t()},e);n.addToCleanUps(t,()=>{clearTimeout(i),s&&s()})},exports.onUpdate=t=>{ve();const e=fe();let n;e.onEachUpdate(()=>{n&&n(),n=t()}),e.addToCleanUps(t,()=>{n&&n()})},exports.onVisibilityChange=t=>{if(me())return;ve();let e;mo("visibilitychange",()=>{e&&e(),e=t(document.hidden)},fe())},exports.onVisible=function(t,e){return Qs({onVisible:t,...e})},exports.onWindow=go,exports.onWindowCapture=yo,exports.onWindowResize=t=>{go("resize",t)},exports.onWindowScroll=t=>{yo("scroll",t)},exports.paginatedAsyncAction=function(t,e){const n=!!e?.allowInRestrictedContext,s=Rn(t,e),i=Cn(1,{skipRestrictedContextCheck:n}),o=Cn(-1,{skipRestrictedContextCheck:n});return Object.assign(s,{page:i,totalPages:o,next:(...t)=>{if(!(-1!==o.val&&i.val>=o.val))return i.update(t=>t+1),s(...t)}})},exports.paginationAtom=(t=1,e)=>{const n=Cn(t,e),s=n;return s.next=()=>{n.set(t=>t+1)},s.prev=()=>{n.set(t=>t>1?t-1:t)},s.reset=()=>{n.set(1)},Object.defineProperty(s,"currentPage",{get:()=>n.get(),enumerable:!1,configurable:!0}),Object.defineProperty(s,"name",{value:"paginationAtom",writable:!0,configurable:!0,enumerable:!1}),s},exports.patchAction=t=>ks.patchAction(t),exports.pathAtom=Qn,exports.pick=function(t,e){const n={};for(const s of e)s in t&&(n[s]=t[s]);return n},exports.placementTransform=function(t){return"top"===t||"top-start"===t||"top-end"===t?"translateY(-100%)":"left"===t||"left-start"===t||"left-end"===t?"translateX(-100%)":""},exports.popEffect=qt,exports.popup=function(t,e){return Eo(t,"string"==typeof e?{position:e}:e??{})},exports.portal=function(t,e){return Ao(t,e)},exports.postAction=t=>ks.postAction(t),exports.pulsePreset=function(t=1.05,e=400){return{keyframes:[{transform:"scale(1)"},{transform:`scale(${t})`},{transform:"scale(1)"}],options:{duration:e,easing:"ease-in-out",fill:"both"}}},exports.pushEffect=Bt,exports.putAction=t=>ks.putAction(t),exports.qsAtom=hs,exports.randomId=jo,exports.range=
174
- /**
175
- * @license
176
- * Copyright 2021 Google LLC
177
- * SPDX-License-Identifier: BSD-3-Clause
178
- */
179
- function*(t,e,n=1){const s=void 0===e?0:t;e??=t;for(let t=s;n>0?t<e:e<t;t+=n)yield t},exports.ref=Wn,exports.registerCleanup=ke,exports.removeAttr=function(t){},exports.removeClasses=function(t){},exports.removeOn=function(t){di.get(t)?.()},exports.removeStyle=function(t){},exports.render=U,exports.renderSwitch=function(t){for(const e of t){if(!Array.isArray(e))return e;{const[t,n]=e;if(t)return n}}return C},exports.renderTemplate=Gn,exports.renderX=Xn,exports.repeat=Et,exports.replaceParams=function(t,e){if("undefined"==typeof window)return;const n=Qn.get(),s=t.split("/"),i=n.split("/");if(s.length!==i.length)return void console.warn(`replaceParams: pattern "${t}" has ${s.length} segments but current path "${n}" has ${i.length}. No-op.`);const o=new Set(s.filter(t=>t.startsWith(":")).map(t=>t.slice(1)));for(const n of Object.keys(e))o.has(n)||console.warn(`replaceParams: param "${n}" not found in pattern "${t}".`);const r=i.map((t,n)=>{const i=s[n];if(!i.startsWith(":"))return t;const o=i.slice(1);return o in e?String(e[o]):t}),a=r.join("/");a!==n&&ls(a,!0)},exports.resetComponentState=_e,exports.resolveAsyncValue=Re,exports.restoreTracking=Gt,exports.rootCSS=function(t){hn();const e=cn(),n=Os(":root",t);return n&&e.appendRules(n),t},exports.route=(t,{view:e})=>es(t)?e?Bn(e,{}):C:null,exports.runWithGlobalInterceptors=async function(t,e){let n,s=t,i=e;for(const t of xs){const e=await t(s,i);s=e.url,i=e.options}try{n=await fetch(s,i)}catch(t){for(const e of Es)try{e(t)}catch{}throw t}for(const t of Cs)n=await t(n);if(!n.ok){const t=new Error(`${n.status} ${n.statusText}`);for(const e of Es)try{e(t)}catch{}}return n},exports.safeSVG=No,exports.safetyCheck=ve,exports.saveAndEnableTracking=Xt,exports.scaleInPreset=function(t=0,e=300,n="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:`scale(${t})`,opacity:0},{transform:"scale(1)",opacity:1}],options:{duration:e,easing:n,fill:"both"}}},exports.scaleOutPreset=function(t=0,e=300,n="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:"scale(1)",opacity:1},{transform:`scale(${t})`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}},exports.scope=ho,exports.setAtom=(t=[],e)=>{const n=new Set(t),s=Cn(n,e),i=n.add.bind(n);n.add=t=>(i(t),s.update(()=>{}),n);const o=n.delete.bind(n);n.delete=t=>{const e=o(t);return s.update(()=>{}),e};const r=n.clear.bind(n);n.clear=()=>{r(),s.update(()=>{})};const a=n.has.bind(n);n.has=t=>(s.get(),a(t));const l=Object.getOwnPropertyDescriptor(Set.prototype,"size");Object.defineProperty(n,"size",{get:()=>(s.get(),l.get.call(n))});const c=n.entries.bind(n);n.entries=()=>(s.get(),c());const h=n.values.bind(n);n.values=()=>(s.get(),h());const u=n.keys.bind(n);n.keys=()=>(s.get(),u());const d=n.forEach.bind(n);n.forEach=(t,e)=>(s.get(),d(t,e));const f=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(s.get(),f()),n.update=t=>{const e={add:t=>(i(t),e),delete:t=>o(t),clear:()=>{r()},has:t=>a(t),entries:()=>c(),values:()=>h(),keys:()=>u(),forEach:(t,e)=>d(t,e),[Symbol.iterator]:()=>f(),get size(){return l.get.call(n)}};return t(e),s.update(()=>{}),n},n.updateItem=(t,e)=>(null==t||"object"!=typeof t||(e(t),s.update(()=>{})),n),Object.defineProperty(n,"__isAtom___",{value:s,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>s.__version__,enumerable:!1}),n},exports.setLocale=function(t){!function(t){Vo=t}(t??null)},exports.setRef=Hn,exports.setSSRApiLookup=function(t){ps=t},exports.setSSRMode=function(t){pe=t},exports.setSSRRequest=function(t){ms=t},exports.setTimezone=function(t){null==t?(Wo(null),Ho(null)):(Wo(t.offset),Ho(t.name))},exports.setTimezoneOffset=function(t){Wo(t),Ho(null)},exports.setter=xe,exports.shakePreset=function(t=10,e=400){return{keyframes:[{transform:"translateX(0)"},{transform:`translateX(-${t}px)`},{transform:`translateX(${t}px)`},{transform:`translateX(-${t}px)`},{transform:`translateX(${t}px)`},{transform:"translateX(0)"}],options:{duration:e,easing:"ease-in-out",fill:"both"}}},exports.signal=En,exports.slideInPreset=function(t="up",e,n=400,s="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:e?yn(t,e):gn[t],opacity:0},{transform:"translate(0, 0)",opacity:1}],options:{duration:n,easing:s,fill:"both"}}},exports.slideOutPreset=function(t="down",e,n=400,s="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:"translate(0, 0)",opacity:1},{transform:e?yn(t,e):gn[t],opacity:0}],options:{duration:n,easing:s,fill:"both"}}},exports.spinPreset=function(t=1,e=600,n="linear"){return{keyframes:[{transform:"rotate(0deg)"},{transform:`rotate(${360*t}deg)`}],options:{duration:e,easing:n,fill:"both"}}},exports.springInPreset=function(t=500,e="cubic-bezier(0.34, 1.56, 0.64, 1)"){return{keyframes:[{transform:"scale(0)",opacity:0},{transform:"scale(1)",opacity:1}],options:{duration:t,easing:e,fill:"both"}}},exports.ssAtom=so,exports.startTracking=Zt,exports.stopTracking=Kt,exports.store=t=>{if("object"!=typeof t||null===t)throw new Error("initial state must be an object");const e=Cn(t),n=po(t,e,"store");return()=>[n,e.update]},exports.style=function(t){return _i(t)},exports.styleMap=Mt,exports.stylesheet=function(){tn("stylesheet");const t=new rn;return{css:function(e){tn("css");const n=[],s=He(e,n);return n.length>0&&t.appendRules(n.join("\n")),Ye(s)},mount:function(){if(function(t){if(Qt.templateInProgress)throw new Error(`[css-in-js] ${t}() must not be called inside a template function. Call it in the component outer function or at module level.`)}("mount"),null===fe(!1))return t.mount(),()=>t.unmount();Se(()=>(t.mount(),()=>t.unmount()))},keyframes:function(e,n){return tn("keyframes"),t.keyframes(e,n)}}},exports.superAtom=An,exports.svg=S,exports.taskAction=function(t){te("taskAction");const e=[];let n=0,s=1,i=!1;const o={skipRestrictedContextCheck:!0},r=Cn([],o),a=Cn("idle",o),l=Cn(0,o);function c(){if(r.set([...e]),0===e.length)return void l.set(0);let t=0;for(const n of e)"running"===n.status?t+=.5:"pending"!==n.status&&(t+=1);l.set(Math.round(t/e.length*100))}function h(){if(i){const t=e.some(t=>"running"===t.status);return void(t||a.set("idle"))}if("running"!==a.get())return;const n=e.filter(t=>"running"===t.status).length,o=e.filter(t=>"pending"===t.status);if(0===o.length&&0===n)return void a.set("idle");const r=-1===s?o.length:Math.max(0,s-n);0!==r&&o.slice(0,r).forEach(e=>function(e){const n=new AbortController;e.status="running",e.abortController=n;const s=t(e.input,n.signal);if(s?.__isZeroPromise__){const t=s;e.abortController={signal:t.signal,abort:()=>{t.cancel()}}}c(),Promise.resolve(s).then(t=>{"cancelled"===e.status||(e.status="success",e.result.data=t),e.abortController=null,c(),h()}).catch(t=>{if("cancelled"===e.status||!0===e.abortController?.signal?.aborted)e.status="cancelled",e.abortController=null;else{const n=t instanceof Error?t:new Error(String(t));e.status="failed",e.result.error=n,e.abortController=null,ne(n,"taskAction")}c(),h()})}(e))}function u(t){return{id:++n,input:t,status:"pending",result:{data:null,error:null},abortController:null}}function d(t){const n=Array.isArray(t)?t:[t];for(const t of n)e.push(u(t));c(),"running"!==a.get()||i||h()}function f(t=1){"running"!==a.get()&&(s=t,i=!1,a.set("running"),h())}function p(){i=!0,function(){for(const t of e)"running"===t.status&&(t.status="cancelled",t.abortController?.abort(),t.abortController=null)}(),a.set("idle"),c()}function m(t){p(),e.length=0,n=0,c(),d(t)}const _={add:d,start:f,pause:function(){i||(i=!0)},stop:p,delete:function(t){const n=Array.isArray(t)?t:[t],s=new Set(n.map(t=>t.id));for(let t=e.length-1;t>=0;t--){const n=e[t];s.has(n.id)&&("running"===n.status&&(n.status="cancelled",n.abortController?.abort(),n.abortController=null),e.splice(t,1))}c(),"running"!==a.get()||i||h()},clearAndAdd:m,addAndStart:function(t,e=1){d(t),f(e)},clearAndStart:function(t,e=1){m(t),f(e)},isRunning:function(){return"running"===a.val},progress:l,tasks:r,pendingTasks:function(){return r.val.filter(t=>"pending"===t.status)},runningTasks:function(){return r.val.filter(t=>"running"===t.status)},successTasks:function(){return r.val.filter(t=>"success"===t.status)},failedTasks:function(){return r.val.filter(t=>"failed"===t.status)},cancelledTasks:function(){return r.val.filter(t=>"cancelled"===t.status)},__isTaskAction__:!0};return ke(_,p),_},exports.template=qn,exports.themeAtom=Ts,exports.throttle=Ln,exports.throttledAtom=(t,e,n)=>Ki(t,e,Ln,n),exports.timerTemplate=function(t,e){return gi(t,e)},exports.titleAtom=io,exports.trackAndSubscribe=vn,exports.uniqBy=function(t,e){const n=new Set,s=[];for(const i of t){const t=e(i);n.has(t)||(n.add(t),s.push(i))}return s},exports.unlockNavigation=()=>Kn.set(!1),exports.unsafeHTML=Tt,exports.unsafeSVG=No,exports.until=Pt,exports.unwrapModule=Oe,exports.useContext=function(t){let e=null;const n=new CustomEvent("request-context",{bubbles:!0,composed:!0,detail:{context:t,resolve(t=null){e=t}}});return fe().dispatchEvent(n),e},exports.useEleEvent=function(){const t=fe(!1);return{dispatch(e,n){t&&t.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}}},exports.useScope=ho,exports.useState=t=>{const e=fe();if("object"!=typeof t||null===t)throw new Error("stateObj must be an object");const n=Cn(t),s=po(t,n,"useState");return e?._useStates&&e._useStates.push({state:t,atom:n}),[s,n.update]},exports.useStore=function(t){return Ee(t,!0),t},exports.uuid=jo,exports.validateAll=function(t){const e=[],n={},s=new WeakSet;return function t(i,o){if(null==i)return;const r=typeof i;if("object"!==r&&"function"!==r)return;if(s.has(i))return;if(s.add(i),function(t){if(null==t)return!1;const e=typeof t;return("object"===e||"function"===e)&&!0===t.__isFormAtom__}(i)){const t=i.validate();return void(t.length>0&&(e.push(...t),n[o]=t))}if(Array.isArray(i)){for(let e=0;e<i.length;e++){const n=o?`${o}[${e}]`:`[${e}]`;t(i[e],n)}return}const a=Object.keys(i);for(const e of a){const n=o?`${o}.${e}`:e;t(i[e],n)}}(t,""),{isValid:0===e.length,errors:e,errorsByField:n}},exports.validateReactiveFunction=bn,exports.view=Bn,exports.virtualList=function(t,e,n,s){const{keyFn:i,template:o,opts:r}=qi(e,n,s),a={direction:r?.direction??"vertical",...r?.pin?{pin:r.pin}:{}};return Bi({items:t,renderItem:o,keyFunction:i,scroller:r?.scroller,layout:bi(a)})},exports.virtualMasonry=function(t,e,n,s){const{keyFn:i,template:o,opts:r}=qi(e,n,s),a={direction:r.direction??"vertical",getAspectRatio:r.getAspectRatio,gap:r.gap??"8px",flex:!0,...r.itemSize?{itemSize:r.itemSize}:{},...r.pin?{pin:r.pin}:{}};return Bi({items:t,renderItem:o,keyFunction:i,scroller:r.scroller,layout:(l=a,Object.assign({type:Pi},l))});var l},exports.watch=Ae,exports.when=function(t,e,n){return t?e(t):n?.(t)},exports.withAuth=function(t){return async(e,n)=>({url:e,options:{...n,headers:{...n.headers,Authorization:"string"==typeof t?t:await t()}}})},exports.withBaseUrl=function(t){return(e,n)=>({url:e.startsWith("http")?e:`${t}${e}`,options:n})},exports.withHost=de,exports.withLogging=function(t=console.log){return e=>(t(`[fetch] ${e.status} ${e.url}`),e)},exports.withStaggerPreset=function(t,e,n=50){return{keyframes:t.keyframes,options:{...t.options,delay:(t.options.delay??0)+e*n}}},exports.ws=function(t,e={}){ee("ws");const{reconnect:n=!0,reconnectDelay:s=ko,reconnectMaxDelay:i=Mo,reconnectMaxAttempts:o=$o,protocols:r,auth:a,autoConnect:l=!0}=e,c=Cn("connecting",{skipRestrictedContextCheck:!0}),h=new Set;let u=null,d=0,f=s,p=null,m=!1;const _=[];function g(){null!==p&&(clearTimeout(p),p=null)}function y(){let e;m=!1,g(),c.set("connecting");try{e=function(){if(!a)return t;const e=a(),n=Object.entries(e);if(0===n.length)return t;const s=n.map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&");return t.includes("?")?`${t}&${s}`:`${t}?${s}`}()}catch(t){return ne(t),void c.set("error")}try{u=r?new WebSocket(e,r):new WebSocket(e)}catch(t){return ne(t),c.set("error"),void w()}u.onopen=()=>{m?u?.close():(d=0,f=s,c.set("connected"),function(){for(;_.length>0;){const t=_.shift();u?.readyState===WebSocket.OPEN&&u.send(t)}}())},u.onmessage=t=>{if(m)return;const e="string"==typeof t.data?t.data:String(t.data);let n;try{n=JSON.parse(e)}catch{n=e}var s;s=n,h.forEach(t=>{try{t(s)}catch(t){ne(t)}})},u.onerror=()=>{c.set("error")},u.onclose=()=>{m||(c.set("disconnected"),w())}}function w(){if(!n||m)return;if(d>=o)return;d++;const t=f;f=Math.min(2*f,i),p=setTimeout(()=>{m||y()},t)}function v(){m=!0,g(),u&&(u.onopen=null,u.onmessage=null,u.onerror=null,u.onclose=null,u.readyState!==WebSocket.OPEN&&u.readyState!==WebSocket.CONNECTING||u.close(1e3,"client disconnect"),u=null),c.set("disconnected"),h.clear(),_.length=0}const b={send:function(t){const e="string"==typeof t?t:JSON.stringify(t);u?.readyState===WebSocket.OPEN?u.send(e):_.push(e)},__subscribe:function(t){return h.add(t),()=>h.delete(t)},status:c,connect:y,disconnect:v,__isWs___:!0};return l?y():c.set("disconnected"),ke(b,v),b},exports.x=Yn,exports.xTabEvent=t=>{te("xTabEvent");const e=new Set,n=n=>{e.forEach(e=>{try{e(n)}catch(e){ne(e,`xTabEvent(${t}) handler`)}})},s="undefined"!=typeof BroadcastChannel?new BroadcastChannel(t):null;s&&(s.onmessage=t=>{n(t.data)});return{trigger:e=>{if(Nt(t,e),s)try{s.postMessage(e)}catch(e){ne(e,`xTabEvent(${t}) postMessage`)}n(e)},__subscribe:t=>{e.add(t);const n=()=>{e.delete(t)};return ke(t,n),n},close:()=>{s&&s.close()},name:t,__isEvent___:!0,__isXTabEvent___:!0}};
176
+ */(this._hostElement,t),this._scrollerController=new Cr(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions)),null!==this._scrollEndRafId&&(cancelAnimationFrame(this._scrollEndRafId),this._scrollEndRafId=null),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const t=this._hostElement.style;t.display=t.display||"block",t.position=t.position||"relative",t.contain=t.contain||"size layout",this._isScroller&&(t.overflow=t.overflow||"auto",t.minHeight=t.minHeight||"150px")}_getSizer(){const t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${Mr}]`);e||(e=document.createElement("div"),e.setAttribute(Mr,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent="&nbsp;",e.setAttribute(Mr,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;const e=t.type||$r;if("function"==typeof e&&this._layout instanceof e){const e={...t};return delete e.type,this._layout.config=e,!0}return!1}async _initLayout(t){let e,n;if("function"==typeof t.type){n=t.type;const s={...t};delete s.type,e=s}else e=t;void 0===n&&($r=n=(await Promise.resolve().then(function(){return pr})).FlowLayout),this._layout=new n(t=>this._handleLayoutMessage(t),e),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const t=window.performance.now(),e=t-this._benchmarkStart,n=performance.getEntriesByName("uv-virtualizing","measure").filter(e=>e.startTime>=this._benchmarkStart&&e.startTime<t).reduce((t,e)=>t+e.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:n}}return null}_measureChildren(){const t={},e=this._children,n=this._measureChildOverride||this._measureChild;for(let s=0;s<e.length;s++){const i=e[s],o=this._first+s;(this._itemsChanged||this._toBeMeasured.has(i))&&(t[o]=n.call(this,i,this._items[o]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){const{width:e,height:n}=t.getBoundingClientRect();return Object.assign({width:e,height:n},function(t){const e=window.getComputedStyle(t);return{marginTop:Rr(e.marginTop),marginRight:Rr(e.marginRight),marginBottom:Rr(e.marginBottom),marginLeft:Rr(e.marginLeft)}}(t))}_schedule(t){const e=this._scheduled.get(t);void 0!==e&&cancelAnimationFrame(e);const n=requestAnimationFrame(()=>{this._scheduled.delete(t),t.call(this)});this._scheduled.set(t,n)}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;const{_rangeChanged:e,_itemsChanged:n}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||n)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout),null!==this._scrollEndRafId&&cancelAnimationFrame(this._scrollEndRafId),this._scrollEndRafId=requestAnimationFrame(()=>{this._scrollEndRafId=null,this._connected&&this._updateLayout()})}handleEvent(t){if("scroll"===t.type)(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",t)}_handleLayoutMessage(t){"stateChanged"===t.type?this._updateDOM(t):"visibilityChanged"===t.type?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):"unpinned"===t.type&&this._hostElement.dispatchEvent(new Sr)}get _children(){const t=[];let e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(Mr)||t.push(e),e=e.nextElementSibling;return t}_updateView(){const t=this._hostElement,e=this._scrollerController?.element,n=this._layout;if(t&&e&&n){let s,i,o,r;const a=t.getBoundingClientRect();s=0,i=0,o=window.innerHeight,r=window.innerWidth;const l=this._clippingAncestors.map(t=>t.getBoundingClientRect());l.unshift(a);for(const t of l)s=Math.max(s,t.top),i=Math.max(i,t.left),o=Math.min(o,t.bottom),r=Math.min(r,t.right);const c=e.getBoundingClientRect(),h={left:a.left-c.left,top:a.top-c.top},u={width:e.scrollWidth,height:e.scrollHeight},d=s-a.top+t.scrollTop,f=i-a.left+t.scrollLeft,p=Math.max(0,o-s),m=Math.max(0,r-i);n.viewportSize={width:m,height:p},n.viewportScroll={top:d,left:f},n.totalScrollSize=u,n.offsetWithinScroller=h}}_sizeHostElement(t){const e=82e5,n=t&&null!==t.width?Math.min(e,t.width):0,s=t&&null!==t.height?Math.min(e,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${n}px, ${s}px)`;else{const t=this._hostElement.style;t.minWidth=n?`${n}px`:"100%",t.minHeight=s?`${s}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:t,left:e,width:n,height:s,xOffset:i,yOffset:o},r)=>{const a=this._children[r-this._first];a&&(a.style.position="absolute",a.style.boxSizing="border-box",a.style.transform=`translate(${e}px, ${t}px)`,void 0!==n&&(a.style.width=`${n}px`),void 0!==s&&(a.style.height=`${s}px`),a.style.left=void 0===i?null:`${i}px`,a.style.top=void 0===o?null:`${o}px`)})}async _adjustRange(t){const{_first:e,_last:n,_firstVisible:s,_lastVisible:i}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==n,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==s||this._lastVisible!==i}_correctScrollError(){if(this._scrollError){const{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:n,left:s}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-n,left:e-s})}}element(t){return t===1/0&&(t=this._items.length-1),void 0===this._items?.[t]?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),"smooth"===t.behavior){const e=this._layout.getScrollIntoViewCoordinates(t),{behavior:n}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:n}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){const{index:e}=this._scrollIntoViewTarget||{};e&&t?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new vr({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new br({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(const e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function Rr(t){const e=t?parseFloat(t):NaN;return Number.isNaN(e)?0:e}function xr(t){if(null!==t.assignedSlot)return t.assignedSlot;if(null!==t.parentElement)return t.parentElement;const e=t.parentNode;return e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host||null}const Or=B(class extends ut{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(t,e)=>((t,e)=>b`${e}: ${JSON.stringify(t,null,2)}`)(t,e+this._first),this._keyFunction=(t,e)=>(t=>t)(t,this._first),this._items=[],t.type!==V)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);const e=[];if(this._first>=0&&this._last>=this._first)for(let t=this._first;t<=this._last;t++)e.push(this._items[t]);return $t(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);const n=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),n?E:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){const n=t.parentNode;this._makeVirtualizer(n,e)}this._virtualizer.items=this._items}_setFunctions(t){const{renderItem:e,keyFunction:n}=t;e&&(this._renderItem=(t,n)=>e(t,n+this._first)),n&&(this._keyFunction=(t,e)=>n(t,e+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();const{layout:n,scroller:s,items:i}=e;this._virtualizer=new Tr({hostElement:t,layout:n,scroller:s}),this._virtualizer.items=i,this._virtualizer.connected()}_initialize(t,e){const n=t.parentNode;n&&1===n.nodeType&&(n.addEventListener("rangeChanged",t=>{this._first=t.first,this._last=t.last,this.setValue(this.render())}),this._makeVirtualizer(n,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});function Ir(t,e,n,s){const{keyFn:i,template:o,opts:r}=zr(e,n,s),a={direction:r?.direction??"vertical",...r?.pin?{pin:r.pin}:{}};return Or({items:t,renderItem:o,keyFunction:i,scroller:r?.scroller,layout:ar(a)})}function Pr(t,e,n,s){const{keyFn:i,template:o,opts:r}=zr(e,n,s),a={direction:r.direction??"vertical",getAspectRatio:r.getAspectRatio,gap:r.gap??"8px",flex:!0,...r.itemSize?{itemSize:r.itemSize}:{},...r.pin?{pin:r.pin}:{}};return Or({items:t,renderItem:o,keyFunction:i,scroller:r.scroller,layout:(l=a,Object.assign({type:wr},l))});var l}function zr(t,e,n){return"function"==typeof e?{keyFn:t,template:e,opts:n}:{keyFn:void 0,template:t,opts:e}}const Dr=t=>"function"==typeof t&&!0===t.__isAtom___&&"function"==typeof t.set&&"function"==typeof t.__subscribe,Lr=t=>"object"==typeof t&&null!==t&&!0===t.__isUnit___&&"function"==typeof t.__subscribe&&"function"==typeof t.__reset,Nr=t=>"function"==typeof t&&!0===t.__isAction___&&"function"==typeof t.__subscribe,jr=t=>"function"==typeof t&&!0===t.__isAsyncAction___&&"function"==typeof t.subscribe,Ur=t=>"function"==typeof t&&!0===t.__isSetter___&&"function"==typeof t.__subscribe,Fr=t=>"object"==typeof t&&null!==t&&!0===t.__isEvent___&&"function"==typeof t.__subscribe&&"function"==typeof t.trigger,Vr=t=>"object"==typeof t&&null!==t&&!0===t.__isConfirmationEvent___&&"function"==typeof t.requestConfirmation&&"function"==typeof t.onConfirmRequest,Wr=t=>"object"==typeof t&&null!==t&&!0===t.__isChannel___&&"function"==typeof t.join,Hr=t=>"function"==typeof t&&!0===t.__isSelector___&&"function"==typeof t.areVersionsChanged,Yr=t=>"function"==typeof t,Br=t=>"AsyncFunction"===t.constructor.name,qr=(t,e,n,s)=>{if(Dr(t)){const i=t,o=rs(i(),s),r=n(o.set,e),a=n(o.update,e);return o.set=r,o.update=a,i.__subscribe(()=>{ke.schedule(()=>o.set(i()))}),Ue(o,()=>{r.cancel(),a.cancel()}),o}const i=rs(t,s),o=n(i.set,e),r=n(i.update,e);return i.set=o,i.update=r,Ue(i,()=>{o.cancel(),r.cancel()}),i},Xr=(t,e,n)=>qr(t,e,ys,n);function Zr(t,e,n){const s=new Set;function i(t){const n=setTimeout(()=>{s.delete(n),t()},e);s.add(n)}function o(){for(const t of s)clearTimeout(t);s.clear()}if(Dr(t)){const e=t,s=rs(e(),n),r=s.set.bind(s),a=s.update.bind(s);return s.set=(t,e)=>{i(()=>r(t,e))},s.update=(t,e)=>{i(()=>a(t,e))},e.__subscribe(()=>{const t=e();i(()=>r(t))}),Ue(s,o),s}const r=rs(t,n),a=r.set.bind(r),l=r.update.bind(r);return r.set=(t,e)=>{i(()=>a(t,e))},r.update=(t,e)=>{i(()=>l(t,e))},Ue(r,o),r}const Gr=(t=[],e)=>{const n=new Map(t),s=rs(n,e),i=n.set.bind(n);n.set=(t,e)=>(i(t,e),s.update(()=>{}),n);const o=n.delete.bind(n);n.delete=t=>{const e=o(t);return s.update(()=>{}),e};const r=n.clear.bind(n);n.clear=()=>{r(),s.update(()=>{})};const a=n.get.bind(n);n.get=t=>(s.get(),a(t));const l=n.has.bind(n);n.has=t=>(s.get(),l(t));const c=Object.getOwnPropertyDescriptor(Map.prototype,"size");Object.defineProperty(n,"size",{get:()=>(s.get(),c.get.call(n))});const h=n.entries.bind(n);n.entries=()=>(s.get(),h());const u=n.values.bind(n);n.values=()=>(s.get(),u());const d=n.keys.bind(n);n.keys=()=>(s.get(),d());const f=n.forEach.bind(n);n.forEach=(t,e)=>(s.get(),f(t,e));const p=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(s.get(),p()),n.update=t=>{const e={set:(t,n)=>(i(t,n),e),delete:t=>o(t),clear:()=>{r()},get:t=>a(t),has:t=>l(t),entries:()=>h(),values:()=>u(),keys:()=>d(),forEach:(t,e)=>f(t,e),[Symbol.iterator]:()=>p(),get size(){return c.get.call(n)}};return t(e),s.update(()=>{}),n},n.updateItem=(t,e)=>{const i=a(t);return null==i||"object"!=typeof i||(e(i),s.update(()=>{})),n},Object.defineProperty(n,"__isAtom___",{value:s,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>s.__version__,enumerable:!1}),n},Kr=(t=[],e)=>{const n=new Set(t),s=rs(n,e),i=n.add.bind(n);n.add=t=>(i(t),s.update(()=>{}),n);const o=n.delete.bind(n);n.delete=t=>{const e=o(t);return s.update(()=>{}),e};const r=n.clear.bind(n);n.clear=()=>{r(),s.update(()=>{})};const a=n.has.bind(n);n.has=t=>(s.get(),a(t));const l=Object.getOwnPropertyDescriptor(Set.prototype,"size");Object.defineProperty(n,"size",{get:()=>(s.get(),l.get.call(n))});const c=n.entries.bind(n);n.entries=()=>(s.get(),c());const h=n.values.bind(n);n.values=()=>(s.get(),h());const u=n.keys.bind(n);n.keys=()=>(s.get(),u());const d=n.forEach.bind(n);n.forEach=(t,e)=>(s.get(),d(t,e));const f=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(s.get(),f()),n.update=t=>{const e={add:t=>(i(t),e),delete:t=>o(t),clear:()=>{r()},has:t=>a(t),entries:()=>c(),values:()=>h(),keys:()=>u(),forEach:(t,e)=>d(t,e),[Symbol.iterator]:()=>f(),get size(){return l.get.call(n)}};return t(e),s.update(()=>{}),n},n.updateItem=(t,e)=>(null==t||"object"!=typeof t||(e(t),s.update(()=>{})),n),Object.defineProperty(n,"__isAtom___",{value:s,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>s.__version__,enumerable:!1}),n},Jr="mates";function Qr(t,e){try{null===e?t.removeItem(Jr):t.setItem(Jr,JSON.stringify(e))}catch{}}function ta(t,e){const n=rs((()=>{try{return function(t){try{const e=t.getItem(Jr);if(e)return JSON.parse(e)}catch{}return null}(t())}catch{return null}})()),s=n.set;n.set=function(e,i=!1){s(e,i);try{Qr(t(),n.get())}catch{}};const i=n.update;return n.update=function(e,s=!1){if(null!==n.get()){i(e,s);try{Qr(t(),n.get())}catch{}}},e(t=>{if(t.key===Jr)if(t.newValue)try{s(JSON.parse(t.newValue))}catch{}else s(null)}),Object.defineProperty(n,"name",{value:"storageAtom",writable:!0,configurable:!0,enumerable:!1}),n}function ea(t){"undefined"!=typeof window&&window.addEventListener("storage",t)}const na=ta(()=>localStorage,t=>ea(e=>{e.storageArea===localStorage&&t(e)})),sa=ta(()=>sessionStorage,t=>ea(e=>{e.storageArea===sessionStorage&&t(e)})),ia=(t,e,n)=>qr(t,e,bs,n),oa=rs("undefined"!=typeof document?document.title:"");function ra(t){const e=new Map,n=new Map,s=rs(e,t),i=s.get.bind(s),o=s;return o.add=(t,i,o)=>{if(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),s.update(e=>{e.set(t,i)}),void 0!==o&&-1!==o&&o>0){const i=setTimeout(()=>{e.delete(t),n.delete(t),s.update(()=>{})},o);n.set(t,i)}},o.get=t=>(i(),e.get(t)),o.remove=t=>!!e.has(t)&&(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),e.delete(t),s.update(()=>{}),!0),o.has=t=>(i(),e.has(t)),o.getAll=()=>(i(),Array.from(e.values())),o.clearAll=()=>{n.forEach(t=>clearTimeout(t)),n.clear(),e.clear(),s.update(()=>{})},Object.defineProperty(o,"size",{get:()=>(i(),e.size),enumerable:!0,configurable:!0}),Object.defineProperty(o,"name",{get:()=>"cacheAtom",enumerable:!0,configurable:!0}),Ue(s,o.clearAll),o}function aa(t=0,e){const n=rs(t,e),s=n;return s.change=t=>{n.set(void 0!==t?t:Math.random())},s.name="changeFlagAtom",s}Cs(()=>{var t;t=oa.get(),"undefined"!=typeof document&&(document.title=t)});const la=(t=1,e)=>{const n=rs(t,e),s=n;return s.next=()=>{n.set(t=>t+1)},s.prev=()=>{n.set(t=>t>1?t-1:t)},s.reset=()=>{n.set(1)},Object.defineProperty(s,"currentPage",{get:()=>n.get(),enumerable:!1,configurable:!0}),Object.defineProperty(s,"name",{value:"paginationAtom",writable:!0,configurable:!0,enumerable:!1}),s};function ca(t,e=2){let n=parseFloat(String(t).trim());Number.isFinite(n)||(n=0);const s=10**e;return Math.round(n*s)/s}function ha(t,e,n){const s=rs(t,n),i=rs([],n);function o(){const t=s.get(),n=e.map(e=>e(t)).filter(t=>null!=t&&""!==t);return i.set(n),n}const r=s.set;s.set=function(t,e=!1){r(t,e),o()};const a=s.update;s.update=function(t,e=!1){a(t,e),o()};const l=s;return Object.defineProperty(l,"__isFormAtom__",{value:!0,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(l,"errors",{get:()=>i.get(),enumerable:!1,configurable:!0}),Object.defineProperty(l,"isValid",{get:()=>0===i.get().length,enumerable:!1,configurable:!0}),l.validate=o,l.toFloat=()=>ca(s.get()),l.toFloatString=()=>ca(s.get()).toString(),l.toValidNumber=()=>function(t){const e=Number(t);return Number.isFinite(e)?e:0}(s.get()),Object.defineProperty(l,"name",{value:"formAtom",writable:!0,configurable:!0,enumerable:!1}),l}const ua=(t,e=[],n)=>ha(t,e,n);function da(t){const e=[],n={},s=new WeakSet;return function t(i,o){if(null==i)return;const r=typeof i;if("object"!==r&&"function"!==r)return;if(s.has(i))return;if(s.add(i),function(t){if(null==t)return!1;const e=typeof t;return("object"===e||"function"===e)&&!0===t.__isFormAtom__}(i)){const t=i.validate();return void(t.length>0&&(e.push(...t),n[o]=t))}if(Array.isArray(i)){for(let e=0;e<i.length;e++){const n=o?`${o}[${e}]`:`[${e}]`;t(i[e],n)}return}const a=Object.keys(i);for(const e of a){const n=o?`${o}.${e}`:e;t(i[e],n)}}(t,""),{isValid:0===e.length,errors:e,errorsByField:n}}function fa(t,e,n){const s=e.replace(/\[(\d+)]/g,".$1").split(".");let i=t;for(const t of s){if(null==i)return n;i=i[t]}return void 0===i?n:i}function pa(t,e){const n={};for(const s of e)s in t&&(n[s]=t[s]);return n}function ma(t,e){const n={...t};for(const t of e)delete n[t];return n}function _a(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function ga(t,...e){const n={...t};for(const t of e)for(const e of Object.keys(t))_a(n[e])&&_a(t[e])?n[e]=ga(n[e],t[e]):n[e]=t[e];return n}function ya(t,e,n){return Math.min(Math.max(t,e),n)}function wa(t,e,n){if(void 0===e&&(e=t,t=0),void 0===n&&(n=t<=e?1:-1),0===n)return[];const s=[];if(n>0)for(let i=t;i<e;i+=n)s.push(i);else for(let i=t;i>e;i+=n)s.push(i);return s}function va(t,e){if(e<1)return[];const n=[];for(let s=0;s<t.length;s+=e)n.push(t.slice(s,s+e));return n}function ba(t,e){const n=new Set,s=[];for(const i of t){const t=e(i);n.has(t)||(n.add(t),s.push(i))}return s}function Sa(t,e){const n={};for(const s of t){const t=String(e(s));n[t]||(n[t]=[]),n[t].push(s)}return n}function Ea(t){return null==t||("string"==typeof t||Array.isArray(t)?0===t.length:t instanceof Map||t instanceof Set?0===t.size:"object"==typeof t&&0===Object.keys(t).length)}function Ca(t,e){if(null==t||"object"!=typeof t)return;const n=Array.isArray(t)?t.map((t,e)=>e):Object.keys(t);for(const s of n){const n=e(s,t[s],t);void 0!==n&&(t[s]=n);const i=t[s];null!==i&&"object"==typeof i&&Ca(i,e)}}const Aa=t=>(t=>"number"==typeof t||"boolean"==typeof t||!Ea(t))(t)?null:"Required",ka=t=>(t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))(t)?null:"Invalid email",Ma=t=>e=>((t,e)=>t.length>=e)(e,t)?null:`Min ${t} characters`,$a=t=>e=>((t,e)=>t.length<=e)(e,t)?null:`Max ${t} characters`,Ta=(t,e="Invalid format")=>n=>((t,e)=>e.test(t))(n,t)?null:e,Ra=t=>e=>((t,e)=>t>=e)(e,t)?null:`Min is ${t}`,xa=t=>e=>((t,e)=>t<=e)(e,t)?null:`Max is ${t}`;function Oa(t){let e;return is({name:"Memo",fn:t,onRun:t=>{e?e.set(()=>t):(e=rs(void 0,{skipRestrictedContextCheck:!0}),e.set(()=>t,!0))}}),e}function Ia(t){const e=new Set,n=[Object.prototype,Array.prototype,Function.prototype,String.prototype,Number.prototype,Boolean.prototype,Symbol.prototype,Date.prototype,RegExp.prototype,Map.prototype,Set.prototype,WeakMap.prototype,WeakSet.prototype,Promise.prototype,Error.prototype];let s=t;for(;s&&!n.includes(s);){for(const t of Reflect.ownKeys(s))"constructor"!==t&&e.add(t);s=Object.getPrototypeOf(s)}return Array.from(e)}const Pa=t=>{const e=ve();if(e&&e.scopes.has(t))throw new Error("Scope already exists for the same class for this component");let n;oe.viewOuterInProgress=!0;try{n=new t}finally{oe.viewOuterInProgress=!1}const s=oe.setupInProgress;try{if((()=>{Ia(n).forEach(t=>{const e=Object.getOwnPropertyDescriptor(n,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),t);if(e&&(e.get||e.set))return;const s=n[t];"function"!=typeof s||s.__version__||(n[t]=s.bind(n))})})(),"function"==typeof n.setup){Br(n.setup)&&console.warn("Async setup functions are not supported. Please ensure the setup function is synchronous."),oe.setupInProgress=!0;try{n.setup(e?._propsFn||(()=>({})))}catch(t){console.error(t)}finally{oe.setupInProgress=s}}e&&e.addScope(t,n),n.__isScope___=!0}catch(t){console.error(t)}finally{oe.setupInProgress=s}return n},za=t=>{let e=null;const n=new CustomEvent("request-parent-scope",{bubbles:!0,composed:!0,detail:{ScopeClass:t,resolve:t=>{e=t}}});if(ve().dispatchEvent(n),e)return e;throw new Error(`No parent scope found for ${t.name}`)};function Da(t,e){let n=t;for(;n&&n!==Object.prototype;){const t=Object.getOwnPropertyDescriptor(n,e);if(t)return t;n=Object.getPrototypeOf(n)}}const La=(t,e,n)=>{const s=Ia(t);s.forEach(s=>{const i=Da(t,s);if(i?.get){let n,o=-1;const r=i.get;Object.defineProperty(t,s,{get(){const s=e.__version__;return s!==o&&(o=s,n=r.call(t)),n},configurable:!0,enumerable:i.enumerable})}else if(Yr(t[s])){if(Br(t[s]))throw new Error(`Async functions are not supported inside ${n}`);const i=t[s];t[s]=(...n)=>{e.update(()=>i.apply(t,n))}}});const i=Object.create(t);return s.forEach(n=>{const s=Da(t,n);if(!s)return;const o=!!s.get,r=!o&&Yr(s.value);o||r||Object.defineProperty(i,n,{get:()=>e()[n],set(t){e.update(e=>{e[n]=t})},enumerable:!0,configurable:!0})}),i},Na=t=>{if("object"!=typeof t||null===t)throw new Error("initial state must be an object");const e=rs(t),n=La(t,e,"store");return()=>[n,e.update]},ja=t=>{const e=ve();if("object"!=typeof t||null===t)throw new Error("stateObj must be an object");const n=rs(t),s=La(t,n,"useState");return e?._useStates&&e._useStates.push({state:t,atom:n}),[s,n.update]},Ua=t=>{$e();const e=ve();e._errorHandlers||(e._errorHandlers=[]),e._errorHandlers.push(t)},Fa=(t,e)=>{const n=ve();if($e(),!n)throw new Error("onReferenceChange must be called inside a component");let s=[];t(),s=e(),n.onEachUpdate(()=>{const n=e();s.some((t,e)=>t!==n[e])&&(t(),s=n)})};function Va(t,e,n,s=!1){document.addEventListener(t,e,{capture:s}),n.addToCleanUps(e,()=>{document.removeEventListener(t,e,{capture:s})})}function Wa(t,e,n,s){let i;if("wheelUp"===t||"wheelDown"===t){const o="wheelUp"===t,r=e,a=t=>{(o?t.deltaY>=0:t.deltaY<=0)||(i&&i(),i=r(t))};return window.addEventListener("wheel",a,{capture:n,passive:!0}),void s.addToCleanUps(e,()=>{window.removeEventListener("wheel",a,{capture:n}),i&&i()})}const o="scroll"===t||"touchstart"===t||"touchmove"===t,r=e,a=t=>{i&&i(),i=r(t)};window.addEventListener(t,a,{capture:n,passive:o}),s.addToCleanUps(e,()=>{window.removeEventListener(t,a,{capture:n}),i&&i()})}function Ha(t,e){Ee()||($e(),Wa(t,e,!1,ve()))}function Ya(t,e){Ee()||($e(),Wa(t,e,!0,ve()))}const Ba=t=>{Ya("scroll",t)},qa=t=>{Ha("blur",t)},Xa=t=>{Ha("focus",t)},Za=t=>{Ha("online",t)},Ga=t=>{Ha("offline",t)},Ka=t=>{Ha("resize",t)},Ja=t=>{Ha("paste",t)},Qa=t=>{Ha("copy",t)},tl=t=>{Ha("cut",t)},el=t=>{Ha("keydown",t)},nl=t=>{Ha("keyup",t)},sl=t=>{if(Ee())return;$e();let e;Va("visibilitychange",()=>{e&&e(),e=t(document.hidden)},ve())},il=t=>{if(Ee())return;$e();let e;Va("selectionchange",()=>{e&&e(),e=t(window.getSelection())},ve())},ol=t=>{Ha("storage",t)},rl=t=>{if(Ee())return;$e();const e=ve();let n;const s=t=>t.preventDefault(),i=e=>{e.preventDefault(),n&&n(),n=t(e)};window.addEventListener("dragover",s),window.addEventListener("drop",i),e.addToCleanUps(t,()=>{window.removeEventListener("dragover",s),window.removeEventListener("drop",i),n&&n()})},al=t=>{if(Ee())return;$e();const e=ve(!0),n=n=>{const s=n.target;s&&!e.contains(s)&&t(n)};document.addEventListener("mousedown",n,!0),e.addToCleanUps(t,()=>{document.removeEventListener("mousedown",n,!0)})},ll=(t,e=window)=>{if(Ee())return;$e();const n=ve();let s;const i=e=>{s&&s(),s=t(e)};e.addEventListener("scroll",i,{passive:!0}),n.addToCleanUps(t,()=>{e.removeEventListener("scroll",i),s&&s()})},cl=(t,e)=>{if(Ee())return;$e();const n=ve();let s;const i=new ResizeObserver(e=>{for(const n of e)s&&s(),s=t(n)}),o=e||n;i.observe(o),n.addToCleanUps(t,()=>{i.disconnect(),s&&s()})},hl=t=>{if(Ee())return;$e();const e=ve();let n;const s=Us.__subscribe(()=>{n&&n(),n=t(Us.get())||null});e.addToCleanUps(t,()=>{s(),n&&n()})},ul=(t,e)=>{if(Ee())return;$e();const n=ve();let s;const i=setInterval(()=>{s&&s(),s=t()},e);n.addToCleanUps(t,()=>{clearInterval(i),s&&s()})},dl=(t,e)=>{if(Ee())return;$e();const n=ve();let s;const i=setTimeout(()=>{s=t()},e);n.addToCleanUps(t,()=>{clearTimeout(i),s&&s()})};function fl(t,e){$e();const n=ve(),s=e.map(e=>e.__subscribe(t));n.addToCleanUps(t,()=>{s.forEach(t=>t())})}const pl=t=>{$e();const e=ve();let n;e.onEachUpdate(()=>{n&&n(),n=t()}),e.addToCleanUps(t,()=>{n&&n()})},ml=t=>{const e=ve();if(!e)throw new Error("onDOMReady must be called within a component context");return e.DOMReadyEvent.__subscribe(t)},_l=So((t,e,n)=>{const s=document.createElement("div");Object.assign(s.style,{position:"fixed",inset:"0",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0, 0, 0, 0.5)"}),n?.style&&Object.assign(s.style,n.style),n?.onBackdropClick&&s.addEventListener("click",t=>{t.target===s&&n.onBackdropClick()});const i=document.createElement("div");n?.dialogStyle&&Object.assign(i.style,n.dialogStyle),i.addEventListener("click",t=>t.stopPropagation()),U(e,i),s.appendChild(i),document.body.appendChild(s);const o=document.body.style.overflow;return document.body.style.overflow="hidden",{onUpdate(t){U(t,i)},onCleanup(){s.remove(),document.body.style.overflow=o}}});function gl(t,e){return _l(t,e)}const yl={position:"fixed",display:"none",margin:"0"},wl="9999";function vl(t={}){const{style:e,target:n,zIndex:s=wl}=t,i=document.createElement("div");for(const[t,e]of Object.entries(yl))i.style[t]=e;i.style.zIndex=String(s),e&&Object.assign(i.style,e);return{el:i,attach:()=>{i.isConnected||function(t){return t?"string"==typeof t?document.querySelector(t)??document.body:t:document.body}(n).appendChild(i)},detach:()=>{i.isConnected&&i.remove()},isAttached:()=>i.isConnected}}function bl(t,e,n,s,i,o,r){return t.startsWith("top")?s>=n:t.startsWith("bottom")?i>=n:t.startsWith("left")?o>=e:!!t.startsWith("right")&&r>=e}function Sl(t,e,n,s,i,o){const r=window.innerWidth,a=function(t){let e=t.parentElement;for(;e&&e!==document.documentElement;){const{overflowY:t}=window.getComputedStyle(e),n="auto"===t||"scroll"===t,s=e.scrollHeight>e.clientHeight;if(n&&s)return e;e=e.parentElement}return null}(t);let l,c;if(a){const t=a.getBoundingClientRect(),n=a.scrollHeight-a.scrollTop-a.clientHeight;c=t.bottom-e.bottom+n-i;const s=a.scrollTop;l=e.top-t.top+s-i}else{const t=window.scrollY||document.documentElement.scrollTop,n=document.documentElement.scrollHeight;l=e.top+t-i,c=n-(e.bottom+t)-i}const h=e.left-i,u=r-e.right-i;if("auto"===o){const t=["bottom-start","top-start","right","left"];for(const e of t)if(bl(e,n,s,l,c,h,u))return e;return"bottom-start"}if(bl(o,n,s,l,c,h,u))return o;const d=function(t){return t.startsWith("top")?t.replace("top","bottom"):t.startsWith("bottom")?t.replace("bottom","top"):t.startsWith("left")?t.replace("left","right"):t.startsWith("right")?t.replace("right","left"):t}(o);return bl(d,n,s,l,c,h,u)?d:o}const El=lo((t,e,n)=>{const s=t.el;let i=!1,o=e,r=n;console.log("[popup] MOUNT — anchor:",s,"destroyOnClose:",!!n.destroyOnClose);const a=vl({...void 0!==r.zIndex?{zIndex:r.zIndex}:{},style:{background:"var(--md-color-surface-raised,#fff)",boxShadow:"var(--md-shadow-dropdown,0 5px 5px -3px rgba(0,0,0,.20),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12))",minWidth:"160px",...r.style??{}}}),l=a.el;r.destroyOnClose;const c=()=>{const t=s.getBoundingClientRect();l.style.visibility="hidden",l.style.display="block",r.matchAnchorWidth&&(l.style.width=`${t.width}px`);const e=l.offsetWidth,n=l.offsetHeight,i=Sl(s,t,e,n,r.gap??4,r.position??"bottom-start");!function(t,e,n,s,i,o){const r=window.innerWidth,a=window.innerHeight;let l=0,c=0;n.startsWith("bottom")?l=e.bottom+o:n.startsWith("top")?l=e.top-o-i:"right"===n||"left"===n?l=e.top+e.height/2-i/2:n.endsWith("-start")?l=e.top:n.endsWith("-end")&&(l=e.bottom-i),"bottom"===n||"top"===n?c=e.left+e.width/2-s/2:n.endsWith("-start")?c=n.startsWith("right")?e.right+o:n.startsWith("left")?e.left-o-s:e.left:n.endsWith("-end")?c=n.startsWith("right")?e.right+o:n.startsWith("left")?e.left-o-s:e.right-s:n.startsWith("right")?c=e.right+o:n.startsWith("left")&&(c=e.left-o-s);const h=Math.max(4,Math.min(c,r-s-4)),u=Math.max(4,Math.min(l,a-i-4)),d=parseInt(String(h),10),f=parseInt(String(u),10);t.style.left=`${d}px`,t.style.top=`${f}px`}(l,t,i,e,n,r.gap??4),l.style.visibility=""},h=()=>{i&&c()};let u=null;const d=()=>{u?.disconnect(),u=null},f=t=>{const e=t.target;l.contains(e)||s.contains(e)||y()},p=t=>{"Escape"===t.key&&y()},m=t=>"boolean"==typeof t?t:t(),_=()=>void 0!==r.open,g=()=>{i||(i=!0,a.isAttached()||(a.attach(),U(o,l),console.log("[popup] LAZY-ATTACHED to body on open — floating:",l)),c(),r.onOpen?.(l),_()||(document.addEventListener("click",f,{capture:!0}),document.addEventListener("keydown",p)),window.addEventListener("scroll",h,{passive:!0,capture:!0}),window.addEventListener("resize",h,{passive:!0}),r.matchAnchorWidth&&(u=new ResizeObserver(t=>{if(!i)return;const e=t[0]?.borderBoxSize?.[0]?.inlineSize??t[0]?.contentRect.width;null!=e&&(l.style.width=`${e}px`,l.style.minWidth=`${e}px`,h())}),u.observe(s)))},y=()=>{i&&(console.log("[popup] CLOSE — destroyOnClose:",r.destroyOnClose,"floating.isConnected:",l.isConnected,"floating:",l),i=!1,r.destroyOnClose||(l.style.display="none"),r.onClose?.(s,l),r.destroyOnClose&&a.isAttached()&&(console.log("[popup] REMOVED from body in close() — floating:",l),a.detach()),_()||(document.removeEventListener("click",f,{capture:!0}),document.removeEventListener("keydown",p)),window.removeEventListener("scroll",h,{capture:!0}),window.removeEventListener("resize",h),d())},w=t=>{t.stopPropagation(),i?y():g()};return _()?m(r.open)&&g():s.addEventListener("click",w),{onUpdate(t,e){console.log("[popup] UPDATE — isOpen:",i,"anchor:",s);const n=_();if(o=t,r=e,l.isConnected&&U(t,l),e.style&&Object.assign(l.style,e.style),_()){n||s.removeEventListener("click",w);const t=m(e.open);t&&!i?g():!t&&i?y():i&&c()}else n&&s.addEventListener("click",w),i&&c()},onCleanup(){console.log("[popup] CLEANUP — isOpen:",i,"floating.parentNode:",l.parentNode??"NO PARENT","floating.isConnected:",l.isConnected,"floating:",l,"anchor.isConnected:",s.isConnected),i&&y(),d(),_()||s.removeEventListener("click",w),a.detach(),console.log("[popup] CLEANUP DONE — floating still in body?",a.isAttached())}}});function Cl(t,e){return El(t,"string"==typeof e?{position:e}:e??{})}function Al(t,e,n){const s=t=>parseInt(String(t),10);switch(e){case"top":case"top-start":return{top:s(t.top-n),left:s(t.left)};case"top-end":return{top:s(t.top-n),left:s(t.right)};case"bottom":case"bottom-start":default:return{top:s(t.bottom+n),left:s(t.left)};case"bottom-end":return{top:s(t.bottom+n),left:s(t.right)};case"right":case"right-start":return{top:s(t.top),left:s(t.right+n)};case"right-end":return{top:s(t.bottom),left:s(t.right+n)};case"left":case"left-start":return{top:s(t.top),left:s(t.left-n)};case"left-end":return{top:s(t.bottom),left:s(t.left-n)}}}function kl(t){return"top"===t||"top-start"===t||"top-end"===t?"translateY(-100%)":"left"===t||"left-start"===t||"left-end"===t?"translateX(-100%)":""}function Ml(t,e,n,s){const i=window.innerHeight-t.bottom-s,o=t.top-s,r=window.innerWidth-t.right-s,a=t.left-s;if(i>=n)return"bottom";if(o>=n)return"top";if(r>=e)return"right";if(a>=e)return"left";return[["bottom",i],["top",o],["right",r],["left",a]].reduce((t,e)=>e[1]>t[1]?e:t)[0]}const $l=So((t,e,n)=>{const s=document.createElement("div");if(n?.style&&Object.assign(s.style,n.style),n?.on)for(const[t,e]of Object.entries(n.on))s.addEventListener(t,e);return function(t){return t?"string"==typeof t?document.querySelector(t)??document.body:t:document.body}(n?.target).appendChild(s),U(e,s),{onUpdate(t){U(t,s)},onCleanup(){s.remove()}}});function Tl(t,e){return $l(t,e)}const Rl=1e3,xl=3e4,Ol=1/0;function Il(t,e={}){le("ws");const{reconnect:n=!0,reconnectDelay:s=Rl,reconnectMaxDelay:i=xl,reconnectMaxAttempts:o=Ol,protocols:r,auth:a,autoConnect:l=!0}=e,c=rs("connecting",{skipRestrictedContextCheck:!0}),h=new Set;let u=null,d=0,f=s,p=null,m=!1;const _=[];function g(){null!==p&&(clearTimeout(p),p=null)}function y(){let e;m=!1,g(),c.set("connecting");try{e=function(){if(!a)return t;const e=a(),n=Object.entries(e);if(0===n.length)return t;const s=n.map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&");return t.includes("?")?`${t}&${s}`:`${t}?${s}`}()}catch(t){return ce(t),void c.set("error")}try{u=r?new WebSocket(e,r):new WebSocket(e)}catch(t){return ce(t),c.set("error"),void w()}u.onopen=()=>{m?u?.close():(d=0,f=s,c.set("connected"),function(){for(;_.length>0;){const t=_.shift();u?.readyState===WebSocket.OPEN&&u.send(t)}}())},u.onmessage=t=>{if(m)return;const e="string"==typeof t.data?t.data:String(t.data);let n;try{n=JSON.parse(e)}catch{n=e}var s;s=n,h.forEach(t=>{try{t(s)}catch(t){ce(t)}})},u.onerror=()=>{c.set("error")},u.onclose=()=>{m||(c.set("disconnected"),w())}}function w(){if(!n||m)return;if(d>=o)return;d++;const t=f;f=Math.min(2*f,i),p=setTimeout(()=>{m||y()},t)}function v(){m=!0,g(),u&&(u.onopen=null,u.onmessage=null,u.onerror=null,u.onclose=null,u.readyState!==WebSocket.OPEN&&u.readyState!==WebSocket.CONNECTING||u.close(1e3,"client disconnect"),u=null),c.set("disconnected"),h.clear(),_.length=0}const b={send:function(t){const e="string"==typeof t?t:JSON.stringify(t);u?.readyState===WebSocket.OPEN?u.send(e):_.push(e)},__subscribe:function(t){return h.add(t),()=>h.delete(t)},status:c,connect:y,disconnect:v,__isWs___:!0};return l?y():c.set("disconnected"),Ue(b,v),b}class Pl{constructor(){this.id=Math.random().toString(36).substring(2,15),this.context=null}}function zl(t,e=new WeakMap){if("function"==typeof structuredClone)return structuredClone(t);if(null===t||"object"!=typeof t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);if(t instanceof Map){const n=new Map;return e.set(t,n),t.forEach((t,s)=>n.set(zl(s,e),zl(t,e))),n}if(t instanceof Set){const n=new Set;return e.set(t,n),t.forEach(t=>n.add(zl(t,e))),n}if(Array.isArray(t)){const n=[];e.set(t,n);for(let s=0;s<t.length;s++)n[s]=zl(t[s],e);return n}const n=e.get(t);if(n)return n;const s={};e.set(t,s);for(const n of Object.keys(t))s[n]=zl(t[n],e);return s}function Dl(t,e){let n=Object.getOwnPropertyDescriptor(t,e),s=Object.getPrototypeOf(t);for(;!n&&s&&s!==Object.prototype;)n=Object.getOwnPropertyDescriptor(s,e),s=Object.getPrototypeOf(s);return n?.get&&"function"==typeof n.get?n.get:null}var Ll,Nl,jl,Ul,Fl,Vl;function Wl(t){return"number"==typeof t?`${t}px`:t}Nl=new WeakMap,jl=new WeakMap,Ul=new WeakMap,Fl=new WeakMap,Ll=new WeakSet,Vl=function(t){he(this,Nl,"f")?.remove(),ue(this,Nl,null,"f"),ue(this,jl,"","f"),ue(this,Ul,"","f"),ue(this,Fl,new Set,"f");const e=t.endNode;if(e?.parentNode){const n=t.startNode,s=document.createRange();s.setStartAfter(n),s.setEndBefore(e),s.deleteContents()}};const Hl=B(class extends q{constructor(t){if(super(t),Ll.add(this),Nl.set(this,null),jl.set(this,""),Ul.set(this,""),Fl.set(this,new Set),t.type!==V)throw new Error("safeSVG() must be used as a child expression, e.g. html`<div>${safeSVG(markup)}</div>`")}update(t,[e,n]){if(console.log("update"),!e.trimStart().startsWith("<svg"))return console.warn("safeSVG: input does not start with <svg — nothing rendered"),he(this,Ll,"m",Vl).call(this,t),E;const s=JSON.stringify(n);if(null===he(this,Nl,"f")||e!==he(this,jl,"f")){const n=function(t){const e=document.createElement("template");e.innerHTML=t;const n=e.content.firstElementChild;return n instanceof SVGElement?n:null}(e);if(null===n)return console.warn("safeSVG: failed to parse SVG markup — nothing rendered"),he(this,Ll,"m",Vl).call(this,t),E;he(this,Nl,"f")?.remove(),ue(this,Nl,n,"f"),ue(this,jl,e,"f"),ue(this,Ul,"","f"),ue(this,Fl,new Set,"f");const s=t.endNode;s.parentNode.insertBefore(he(this,Nl,"f"),s)}if(s!==he(this,Ul,"f")){const t=function(t,e){const n=new Set,s=(e,s)=>{t.setAttribute(e,s),n.add(e)},i=e.width??e.size,o=e.height??e.size;void 0!==i&&s("width",Wl(i)),void 0!==o&&s("height",Wl(o)),void 0!==e.fill&&s("fill",e.fill),void 0!==e.stroke&&s("stroke",e.stroke),void 0!==e.strokeWidth&&s("stroke-width",String(e.strokeWidth)),void 0!==e.strokeLinecap&&s("stroke-linecap",e.strokeLinecap),void 0!==e.strokeLinejoin&&s("stroke-linejoin",e.strokeLinejoin),void 0!==e.opacity&&s("opacity",String(e.opacity)),void 0!==e.viewBox&&s("viewBox",e.viewBox),void 0!==e.transform&&s("transform",e.transform);const r=[],a=e.width??e.size,l=e.height??e.size;void 0!==a&&r.push(`width:${Wl(a)}`),void 0!==l&&r.push(`height:${Wl(l)}`),void 0!==e.color&&r.push(`color:${e.color}`),r.push("display:inline-block"),r.push("vertical-align:middle"),e.style&&r.push(e.style),s("style",r.join(";")),e.class&&s("class",e.class);const c=e.ariaHidden??!0;return e.ariaLabel?(s("aria-label",e.ariaLabel),s("role","img")):c&&s("aria-hidden","true"),n}(he(this,Nl,"f"),n);for(const e of he(this,Fl,"f"))t.has(e)||he(this,Nl,"f").removeAttribute(e);ue(this,Fl,t,"f"),ue(this,Ul,s,"f")}return E}render(t,e){return E}});function Yl(t,e={}){return Hl(t,e)}function Bl(){const t=new Uint8Array(16);if("undefined"!=typeof crypto&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<16;e++)t[e]=256*Math.random()|0;t[6]=15&t[6]|64,t[8]=63&t[8]|128;const e=Array.from(t).map(t=>t.toString(16).padStart(2,"0")).join("");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}let ql=null,Xl=null,Zl=null;function Gl(t){ql=t}function Kl(t){Xl=t}function Jl(){return Xl}function Ql(){return ql??-(new Date).getTimezoneOffset()}function tc(){return Zl??("undefined"!=typeof navigator?navigator.language:null)??"en"}function ec(t,e){const n={};for(const s of new Intl.DateTimeFormat("en",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date(e)))"literal"!==s.type&&(n[s.type]=parseInt(s.value,10));const s=24===n.hour?0:n.hour,i=Date.UTC(n.year,n.month-1,n.day,s,n.minute,n.second);return Math.round((i-e)/6e4)||0}function nc(t,e){try{const n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"short"}).formatToParts(new Date(e)).find(t=>"timeZoneName"===t.type);return n?n.value:t}catch{return t}}function sc(t,e){try{const n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"long"}).formatToParts(new Date(e)).find(t=>"timeZoneName"===t.type);return n?n.value:t}catch{return t}}function ic(t,e){const n=new Date(t+6e4*e);return{Y:n.getUTCFullYear(),M:n.getUTCMonth()+1,D:n.getUTCDate(),h:n.getUTCHours(),m:n.getUTCMinutes(),s:n.getUTCSeconds(),ms:n.getUTCMilliseconds(),wd:n.getUTCDay()}}const oc=t=>String(t).padStart(2,"0");function rc(t,e,n){const s={[n]:e};return Xl?s.timeZone=Xl:(s.timeZone="UTC",t+=6e4*Ql()),new Intl.DateTimeFormat(tc(),s).format(new Date(t))}function ac(t,e){const n=t>=0?"+":"-",s=Math.abs(t);return e?`${n}${oc(Math.floor(s/60))}:${oc(s%60)}`:`${n}${oc(Math.floor(s/60))}${oc(s%60)}`}function lc(t){const e=t.replace(/s$/,"");if("millisecond"===e||"m"===e)return"ms";if("minute"===e)return"min";if(!new Set(["year","month","week","day","hour","min","second","ms"]).has(e))throw new RangeError(`Invalid date unit: "${t}"`);return e}function cc(){try{const t=new Intl.Locale(tc()),e=t.weekInfo?.firstDay??t.getWeekInfo?.()?.firstDay;if(void 0!==e)return e%7}catch{}return 0}const hc=/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|H|hh|h|mm|ss|SSS|ZZ|Z|A|a/g,uc=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function dc(t){try{const e=new Date(Date.UTC(2024,0,7+t,12,0,0));return new Intl.DateTimeFormat(tc(),{weekday:"long",timeZone:"UTC"}).format(e)}catch{return uc[t]||""}}function fc(t){try{const e=new Date(Date.UTC(2024,t-1,15,12,0,0));return new Intl.DateTimeFormat(tc(),{month:"long",timeZone:"UTC"}).format(e)}catch{return""}}function pc(t){if(t instanceof Number)return t.valueOf();if("number"==typeof t)return t;if("string"==typeof t)return new Date(t).getTime();if(t instanceof Date)return t.getTime();if("object"==typeof t&&null!==t){const{year:e=1970,month:n=1,day:s=1,hour:i=0,minute:o=0,second:r=0,ms:a=0}=t;return Date.UTC(e,n-1,s,i,o,r,a)-6e4*Ql()}return NaN}function mc(t,e,n){const s=lc(n);if("hour"===s)return t+36e5*e;if("min"===s)return t+6e4*e;if("second"===s)return t+1e3*e;if("ms"===s)return t+e;const i=Ql(),o=ic(t,i);let r=o.Y,a=o.M,l=o.D;if("year"===s)r+=e;else if("month"===s){const t=a-1+e;r+=Math.floor(t/12),a=(t%12+12)%12+1,l=Math.min(l,new Date(r,a,0).getDate())}else l+="week"===s?7*e:e;return Date.UTC(r,a-1,l,o.h,o.m,o.s,o.ms)-6e4*i}function _c(t,e){const n=Ql(),s=ic(t,n),i=ic(e,n);return s.Y===i.Y&&s.M===i.M&&s.D===i.D}function gc(t){const e=Ql(),n=ic(t,e);return Date.UTC(n.Y,n.M-1,n.D,0,0,0,0)-6e4*e}function yc(t,e){const n=Ql(),s=ic(t,n),i=s.h%12||12,o=[],r=e.replace(/\[([^\]]*)\]/g,(t,e)=>(o.push(e),`\0${o.length-1}\0`));hc.lastIndex=0;const a=r.replace(hc,e=>{switch(e){case"YYYY":return String(s.Y);case"YY":return String(s.Y).slice(-2);case"MMMM":return rc(t,"long","month");case"MMM":return rc(t,"short","month");case"MM":return oc(s.M);case"M":return String(s.M);case"DD":return oc(s.D);case"D":return String(s.D);case"dddd":return rc(t,"long","weekday");case"ddd":return rc(t,"short","weekday");case"HH":return oc(s.h);case"H":return String(s.h);case"hh":return oc(i);case"h":return String(i);case"mm":return oc(s.m);case"ss":return oc(s.s);case"SSS":return(t=>String(t).padStart(3,"0"))(s.ms);case"A":return s.h>=12?"PM":"AM";case"a":return s.h>=12?"pm":"am";case"Z":return ac(n,!0);case"ZZ":return ac(n,!1);default:return e}});return a.replace(/\0(\d+)\0/g,(t,e)=>o[+e])}const wc=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]];const vc=Symbol("ts"),bc=Object.create(Number.prototype);function Sc(t){return function(t){const e=Object.create(bc);return e[vc]=t,e}(void 0===t?Date.now():pc(t))}function Ec(t){null==t?(Gl(null),Kl(null)):(Gl(t.offset),Kl(t.name))}function Cc(t){Gl(t),Kl(null)}function Ac(){return Ql()}function kc(t){!function(t){Zl=t}(t??null)}function Mc(){return tc()}function $c(){let t;try{t=Intl.supportedValuesOf("timeZone")}catch{return[]}const e=Date.now();return t.map(t=>({name:t,longName:sc(t,e),shortName:nc(t,e),offset:ec(t,e)}))}function Tc(t){const e=t??tc(),n=new Intl.DateTimeFormat(e,{month:"long",timeZone:"UTC"}),s=new Intl.DateTimeFormat(e,{month:"short",timeZone:"UTC"}),i=[];for(let t=1;t<=12;t++){const e=new Date(Date.UTC(2024,t-1,15,12,0,0));i.push({number:t,name:n.format(e),shortName:s.format(e)})}return i}function Rc(t,e){if(!Number.isInteger(t)||!Number.isInteger(e)||e<1||e>12)throw new RangeError("getCalendar(year, month): month must be integer 1–12");const n=Sc({year:t,month:e,day:1}),{year:s,month:i,numberOfDaysOfTheMonth:o}=n.values,r=[];for(let t=ic(n.valueOf(),Ql()).wd;t>0;t--)r.push(Sc({year:s,month:i,day:1-t}));for(let t=1;t<=o;t++)r.push(Sc({year:s,month:i,day:t}));const a=r.length%7,l=0===a?0:7-a,c=Sc({year:s,month:i,day:o});for(let t=0;t<l;t++)c.add(1,"day"),r.push(Sc(c.valueOf()));const h=[];for(let t=0;t<r.length;t+=7)h.push(r.slice(t,t+7));return h}Object.defineProperties(bc,{valueOf:{value(){return this[vc]},writable:!1,configurable:!1},values:{get(){const t=this[vc],e=ic(t,Ql());return{year:e.Y,month:e.M,monthName:fc(e.M),dayName:dc(e.wd),date:e.D,weekStartDayName:dc(cc()),numberOfDaysOfTheMonth:new Date(e.Y,e.M,0).getDate(),hours:e.h,minutes:e.m,seconds:e.s,milliSeconds:e.ms,timestamp:t,iso:new Date(t).toISOString()}},configurable:!1},toJSON:{value(){const t=this[vc];return Number.isFinite(t)?new Date(t).toISOString():"Invalid Date"},writable:!1,configurable:!1},toString:{value(){const t=this[vc];return Number.isFinite(t)?new Intl.DateTimeFormat(tc(),{dateStyle:"medium",...Jl()?{timeZone:Jl()}:{timeZone:"UTC"}}).format(new Date(Jl()?t:t+6e4*Ql())):"Invalid Date"},writable:!1,configurable:!1},format:{value(t){return yc(this[vc],t)},writable:!1,configurable:!1},formatLongAgo:{value(t){return function(t,e={}){const{numeric:n="auto",style:s="long"}=e,i=((void 0!==e.now?pc(e.now):Date.now())-t)/1e3,o=Math.abs(i),r=i>=0?-1:1,a=new Intl.RelativeTimeFormat(tc(),{numeric:n,style:s});for(const[t,e]of wc)if(o>=e)return a.format(r*Math.round(o/e),t);return a.format(0,"second")}(this[vc],t)},writable:!1,configurable:!1},add:{value(t,e){return this[vc]=mc(this[vc],t,e),this},writable:!1,configurable:!1},subtract:{value(t,e){return this[vc]=mc(this[vc],-t,e),this},writable:!1,configurable:!1},isBefore:{value(t){return this[vc]<pc(t)},writable:!1,configurable:!1},isAfter:{value(t){return this[vc]>pc(t)},writable:!1,configurable:!1},isFuture:{value(){return this[vc]>Date.now()},writable:!1,configurable:!1},isPresent:{value(){return _c(this[vc],Date.now())},writable:!1,configurable:!1},isToday:{value(){return _c(this[vc],Date.now())},writable:!1,configurable:!1},isYesterday:{value(){const t=mc(gc(Date.now()),-1,"day");return _c(this[vc],t)},writable:!1,configurable:!1},isTomorrow:{value(){const t=mc(gc(Date.now()),1,"day");return _c(this[vc],t)},writable:!1,configurable:!1},getDifference:{value(t,e){return function(t,e,n){const s=lc(n),i=t-e;if("ms"===s)return i;if("second"===s)return Math.trunc(i/1e3);if("min"===s)return Math.trunc(i/6e4);if("hour"===s)return Math.trunc(i/36e5);const o=Ql(),r=ic(t,o),a=ic(e,o);if("day"===s||"week"===s){const n=Math.floor((t+6e4*o)/864e5)-Math.floor((e+6e4*o)/864e5);return"week"===s?Math.trunc(n/7):n}return"month"===s?12*(r.Y-a.Y)+(r.M-a.M):r.Y-a.Y}(this[vc],pc(t),e)},writable:!1,configurable:!1},getAge:{value(t){return function(t,e){const n=Ql(),s=ic(t,n),i=ic(e,n);let o=i.Y-s.Y,r=s.M,a=s.D;if(2===r&&29===a){const t=t=>t%4==0&&t%100!=0||t%400==0;t(i.Y)||(r=3,a=1)}return(i.M<r||i.M===r&&i.D<a)&&o--,Math.max(0,o)}(this[vc],void 0!==t?pc(t):Date.now())},writable:!1,configurable:!1}});export{so as $,Pl as Context,zi as Delete,di as ErrorTypes,Ri as Fetch,Ci as FetchClient,xi as Get,In as MA,me as NotificationManager,Pi as Patch,Oi as Post,Ii as Put,ii as Router,_e as SyncNotificationManager,ui as ZeroPromise,ze as _,De as _subToView,Pn as action,Kt as addStoreBeingRead,oo as animatedIf,Hs as animatedRouter,ro as animatedX,wa as arrayRange,le as assertComponentOuterContext,ae as assertNotInRestrictedContext,fs as asyncAction,_t as asyncAppend,mt as asyncReplace,rs as atom,ho as attr,Gn as blurInPreset,Kn as blurOutPreset,Hn as bouncePreset,Ys as buildPath,mi as buildRequestUrl,ra as cacheAtom,us as cacheFn,aa as changeFlagAtom,va as chunk,ya as clamp,wt as classMap,po as classes,Ae as cleanupScheduler,Ei as clearInterceptors,Qn as collapseWidthPreset,bn as collectSSRStyles,oe as componentRunningStatus,Ml as computeAutoPlacement,en as configureCSS,wo as countdown,us as createCacheManager,vl as createFloatingContainer,ps as createManagedTimer,ds as createPollingManager,is as createReactiveRunner,qr as createTimedAtom,Sc as date,ys as debounce,Xr as debouncedAtom,zl as deepClone,es as deepFreeze,Zr as delayAtom,Fi as deleteAction,es as df,gl as dialog,vo as disappear,Cs as effect,ke as effectScheduler,lo as eleHook,Ve as event,Jn as expandWidthPreset,zn as fadeInPreset,Dn as fadeOutPreset,Di as fetchAction,Ai as fetchClient,Xn as flipInPreset,Zn as flipOutPreset,ua as formAtom,fa as get,Li as getAction,Ia as getAllProps,$c as getAllTimezones,Rc as getCalendar,Al as getCoords,ve as getCurrentHost,Mc as getLocale,Tc as getMonths,za as getParentScope,za as getScope,Zt as getStoresBeingRead,Ac as getTimezoneOffset,Tn as globalCSS,Me as globalScheduler,qi as globalTheme,Sa as groupBy,bt as guard,qs as hashAtom,Ps as historyStateAtom,b as html,So as htmlHook,as as iAtom,St as ifDefined,On as injectMatesAnimations,Ht as installDevToolsHooks,bi as interceptAfter,vi as interceptBefore,Si as interceptError,Nr as isAction,fi as isApiResponseSuccess,jr as isAsyncAction,Br as isAsyncFunction,He as isAsyncValue,Dr as isAtom,Wr as isChannel,Vr as isConfirmationEvent,Dl as isDefinedAsGetter,Yt as isDevToolsInstalled,Gt as isEffectRunning,ka as isEmail,Ea as isEmpty,Fr as isEvent,Yr as isFunction,Hr as isGetter,re as isInRestrictedContext,xa as isMax,Ra as isMin,Vs as isPathMatching,Ta as isPattern,Xt as isReadTrackingEnabled,Aa as isRequired,Ee as isSSR,Ur as isSetter,Lr as isUnit,Ca as iterateDeeply,Et as join,Ct as keyed,$n as keyframes,To as lazyLoad,yt as litCache,At as live,ni as location,Ds as lockNavigation,ce as logError,na as lsAtom,Gr as mapAtom,zo as masonryGrid,$a as maxLength,Oa as memo,jo as memoTemplate,ga as merge,Ma as minLength,Gs as navigateTo,zs as navigationLocked,Ns as navigationRequestEvent,E as noChange,C as nothing,ma as omit,Ne as on,Oe as onAllMount,qa as onBlur,Ie as onCleanup,al as onClickAway,Oo as onConnect,Qa as onCopy,tl as onCut,ml as onDOMReady,Io as onDisconnect,go as onEleEvent,Ua as onError,Xo as onEvent,rl as onFileDrop,Xa as onFocus,ko as onHidden,Co as onIntersect,ul as onInterval,el as onKeyDown,nl as onKeyUp,Re as onMount,hl as onNavigate,js as onNavigationRequest,Ga as onOffline,Za as onOnline,xe as onPaint,Ko as onParent,Ja as onPaste,Fa as onReferenceChange,cl as onResize,ll as onScroll,$o as onScrolledIntoView,il as onSelectionChange,fl as onSocket,ol as onStorageChange,dl as onTimeout,pl as onUpdate,sl as onVisibilityChange,Ao as onVisible,Ha as onWindow,Ya as onWindowCapture,Ka as onWindowResize,Ba as onWindowScroll,ws as paginatedAsyncAction,la as paginationAtom,Ui as patchAction,Us as pathAtom,pa as pick,kl as placementTransform,Qt as popEffect,Cl as popup,Tl as portal,Ni as postAction,qn as pulsePreset,Jt as pushEffect,ji as putAction,Qs as qsAtom,Bl as randomId,kt as range,Ms as ref,Ue as registerCleanup,uo as removeAttr,mo as removeClasses,Zo as removeOn,er as removeStyle,U as render,Jo as renderSwitch,Is as renderTemplate,Os as renderX,$t as repeat,Ks as replaceParams,Ce as resetComponentState,Ye as resolveAsyncValue,ee as restoreTracking,Xi as rootCSS,si as route,ki as runWithGlobalInterceptors,Yl as safeSVG,$e as safetyCheck,te as saveAndEnableTracking,Fn as scaleInPreset,Vn as scaleOutPreset,Pa as scope,Kr as setAtom,kc as setLocale,$s as setRef,ai as setSSRApiLookup,Se as setSSRMode,li as setSSRRequest,Ec as setTimezone,Cc as setTimezoneOffset,Pe as setter,Bn as shakePreset,as as signal,Nn as slideInPreset,jn as slideOutPreset,Wn as spinPreset,Yn as springInPreset,sa as ssAtom,ne as startTracking,se as stopTracking,Na as store,tr as style,xt as styleMap,En as stylesheet,ls as superAtom,S as svg,vs as taskAction,xs as template,Hi as themeAtom,bs as throttle,ia as throttledAtom,sr as timerTemplate,oa as titleAtom,ns as trackAndSubscribe,ba as uniqBy,Ls as unlockNavigation,It as unsafeHTML,Yl as unsafeSVG,Dt as until,Be as unwrapModule,je as useContext,yo as useEleEvent,Pa as useScope,ja as useState,Le as useStore,Bl as uuid,da as validateAll,ss as validateReactiveFunction,Rs as view,Ir as virtualList,Pr as virtualMasonry,Ne as watch,Lt as when,Mi as withAuth,$i as withBaseUrl,we as withHost,Ti as withLogging,ts as withStaggerPreset,Il as ws,Ts as x,Fe as xTabEvent};
180
177
  //# sourceMappingURL=index.esm.js.map