mates 0.1.0-beta.5 → 0.1.0-beta.6
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 +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/on/hooks.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -114,5 +114,5 @@ class As{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
|
|
|
114
114
|
* can change height dynamically.
|
|
115
115
|
* - `virtualGrid` and `virtualMasonry` still accept explicit sizes since
|
|
116
116
|
* the grid/masonry layouts need them for position pre-computation.
|
|
117
|
-
*/function Ns(t,e,n,i){const{keyFn:s,template:r,opts:o}=Fs(e,n,i),a={direction:o?.direction??"vertical",...o?.pin?{pin:o.pin}:{}};return js({items:t,renderItem:r,keyFunction:s,scroller:o?.scroller,layout:us(a)})}function $s(t,e,n,i){const{keyFn:s,template:r,opts:o}=Fs(e,n,i),a={direction:o.direction??"vertical",itemSize:{width:o.itemWidth,height:o.itemHeight},gap:o.gap??"8px",flex:o.flex??!1,...o.pin?{pin:o.pin}:{}};return js({items:t,renderItem:r,keyFunction:s,scroller:o.scroller,layout:(l=a,Object.assign({type:Ss},l))});var l}function Us(t,e,n,i){const{keyFn:s,template:r,opts:o}=Fs(e,n,i),a={direction:o.direction??"vertical",getAspectRatio:o.getAspectRatio,gap:o.gap??"8px",flex:!0,...o.itemSize?{itemSize:o.itemSize}:{},...o.pin?{pin:o.pin}:{}};return js({items:t,renderItem:r,keyFunction:s,scroller:o.scroller,layout:(l=a,Object.assign({type:Cs},l))});var l}function Fs(t,e,n){return"function"==typeof e?{keyFn:t,template:e,opts:n}:{keyFn:void 0,template:t,opts:e}}const Vs=t=>"function"==typeof t&&!0===t.__isAtom___&&"function"==typeof t.set&&"function"==typeof t.__subscribe,Ws=t=>"object"==typeof t&&null!==t&&!0===t.__isUnit___&&"function"==typeof t.__subscribe&&"function"==typeof t.__reset,Ys=t=>"function"==typeof t&&!0===t.__isAction___&&"function"==typeof t.__subscribe,Hs=t=>"function"==typeof t&&!0===t.__isAsyncAction___&&"function"==typeof t.subscribe,Bs=t=>"function"==typeof t&&!0===t.__isSetter___&&"function"==typeof t.__subscribe,qs=t=>"object"==typeof t&&null!==t&&!0===t.__isEvent___&&"function"==typeof t.__subscribe&&"function"==typeof t.trigger,Gs=t=>"object"==typeof t&&null!==t&&!0===t.__isConfirmationEvent___&&"function"==typeof t.requestConfirmation&&"function"==typeof t.onConfirmRequest,Xs=t=>"object"==typeof t&&null!==t&&!0===t.__isChannel___&&"function"==typeof t.join,Zs=t=>"function"==typeof t&&!0===t.__isSelector___&&"function"==typeof t.areVersionsChanged,Js=t=>"function"==typeof t,Qs=t=>"AsyncFunction"===t.constructor.name,Ks=(t,e,n,i)=>{if(Vs(t)){const s=t,r=ze(s(),i),o=n(r.set,e),a=n(r.update,e);return r.set=o,r.update=a,s.__subscribe(()=>{J.schedule(()=>r.set(s()))}),ut(r,()=>{o.cancel(),a.cancel()}),r}const s=ze(t,i),r=n(s.set,e),o=n(s.update,e);return s.set=r,s.update=o,ut(s,()=>{r.cancel(),o.cancel()}),s},tr=(t,e,n)=>Ks(t,e,Ve,n),er=(t=[],e)=>{const n=new Map(t),i=ze(n,e),s=n.set.bind(n);n.set=(t,e)=>(s(t,e),i.update(()=>{}),n);const r=n.delete.bind(n);n.delete=t=>{const e=r(t);return i.update(()=>{}),e};const o=n.clear.bind(n);n.clear=()=>{o(),i.update(()=>{})};const a=n.get.bind(n);n.get=t=>(i.get(),a(t));const l=n.has.bind(n);n.has=t=>(i.get(),l(t));const c=Object.getOwnPropertyDescriptor(Map.prototype,"size");Object.defineProperty(n,"size",{get:()=>(i.get(),c.get.call(n))});const h=n.entries.bind(n);n.entries=()=>(i.get(),h());const u=n.values.bind(n);n.values=()=>(i.get(),u());const d=n.keys.bind(n);n.keys=()=>(i.get(),d());const f=n.forEach.bind(n);n.forEach=(t,e)=>(i.get(),f(t,e));const p=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(i.get(),p()),n.update=t=>{const e={set:(t,n)=>(s(t,n),e),delete:t=>r(t),clear:()=>{o()},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),i.update(()=>{}),n},n.updateItem=(t,e)=>{const s=a(t);return null==s||"object"!=typeof s||(e(s),i.update(()=>{})),n},Object.defineProperty(n,"__isAtom___",{value:i,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>i.__version__,enumerable:!1}),n},nr=(t=[],e)=>{const n=new Set(t),i=ze(n,e),s=n.add.bind(n);n.add=t=>(s(t),i.update(()=>{}),n);const r=n.delete.bind(n);n.delete=t=>{const e=r(t);return i.update(()=>{}),e};const o=n.clear.bind(n);n.clear=()=>{o(),i.update(()=>{})};const a=n.has.bind(n);n.has=t=>(i.get(),a(t));const l=Object.getOwnPropertyDescriptor(Set.prototype,"size");Object.defineProperty(n,"size",{get:()=>(i.get(),l.get.call(n))});const c=n.entries.bind(n);n.entries=()=>(i.get(),c());const h=n.values.bind(n);n.values=()=>(i.get(),h());const u=n.keys.bind(n);n.keys=()=>(i.get(),u());const d=n.forEach.bind(n);n.forEach=(t,e)=>(i.get(),d(t,e));const f=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(i.get(),f()),n.update=t=>{const e={add:t=>(s(t),e),delete:t=>r(t),clear:()=>{o()},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),i.update(()=>{}),n},n.updateItem=(t,e)=>(null==t||"object"!=typeof t||(e(t),i.update(()=>{})),n),Object.defineProperty(n,"__isAtom___",{value:i,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>i.__version__,enumerable:!1}),n},ir="mates_storage";function sr(t,e){try{null===e?t.removeItem(ir):t.setItem(ir,JSON.stringify(e))}catch{}}function rr(t,e){const n=ze((()=>{try{return function(t){try{const e=t.getItem(ir);if(e)return JSON.parse(e)}catch{}return null}(t())}catch{return null}})()),i=n.set;n.set=function(e,s=!1){i(e,s);try{sr(t(),n.get())}catch{}};const s=n.update;return n.update=function(e,i=!1){if(null!==n.get()){s(e,i);try{sr(t(),n.get())}catch{}}},e(t=>{if(t.key===ir)if(t.newValue)try{i(JSON.parse(t.newValue))}catch{}else i(null)}),Object.defineProperty(n,"name",{value:"storageAtom",writable:!0,configurable:!0,enumerable:!1}),n}function or(t){"undefined"!=typeof window&&window.addEventListener("storage",t)}const ar=rr(()=>localStorage,t=>or(e=>{e.storageArea===localStorage&&t(e)})),lr=rr(()=>sessionStorage,t=>or(e=>{e.storageArea===sessionStorage&&t(e)})),cr=(t,e,n)=>Ks(t,e,He,n),hr=ze("undefined"!=typeof document?document.title:"");function ur(t){const e=new Map,n=new Map,i=ze(e,t),s=i.get.bind(i),r=i;return r.add=(t,s,r)=>{if(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),i.update(e=>{e.set(t,s)}),void 0!==r&&-1!==r&&r>0){const s=setTimeout(()=>{e.delete(t),n.delete(t),i.update(()=>{})},r);n.set(t,s)}},r.get=t=>(s(),e.get(t)),r.remove=t=>!!e.has(t)&&(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),e.delete(t),i.update(()=>{}),!0),r.has=t=>(s(),e.has(t)),r.getAll=()=>(s(),Array.from(e.values())),r.clearAll=()=>{n.forEach(t=>clearTimeout(t)),n.clear(),e.clear(),i.update(()=>{})},Object.defineProperty(r,"size",{get:()=>(s(),e.size),enumerable:!0,configurable:!0}),Object.defineProperty(r,"name",{get:()=>"cacheAtom",enumerable:!0,configurable:!0}),ut(i,r.clearAll),r}Ge(()=>{var t;t=hr.get(),"undefined"!=typeof document&&(document.title=t)});const dr=(t=1,e)=>{const n=ze(t,e),i=n;return i.next=()=>{n.set(t=>t+1)},i.prev=()=>{n.set(t=>t>1?t-1:t)},i.reset=()=>{n.set(1)},Object.defineProperty(i,"currentPage",{get:()=>n.get(),enumerable:!1,configurable:!0}),Object.defineProperty(i,"name",{value:"paginationAtom",writable:!0,configurable:!0,enumerable:!1}),i},fr="mates-theme";function pr(t){return"auto"===t?function(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}():t}let mr=null;function _r(){if(mr)return mr;const t=ze(function(){try{const t=localStorage.getItem(fr);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=pr(t.get());t.set("dark"===e?"light":"dark")},Object.defineProperty(e,"resolved",{get:()=>pr(t.get()),enumerable:!1,configurable:!0}),Object.defineProperty(e,"name",{value:"themeAtom",writable:!0,configurable:!0,enumerable:!1}),Ge(()=>{const e=t.get();!function(t){try{document.documentElement.setAttribute("data-theme",pr(t))}catch{}}(e),function(t){try{"auto"===t?localStorage.removeItem(fr):localStorage.setItem(fr,t)}catch{}}(e)}),"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{"auto"===t.get()&&t.set("auto")}),mr=e,e}function gr(t,e=2){let n=parseFloat(String(t).trim());Number.isFinite(n)||(n=0);const i=10**e;return Math.round(n*i)/i}function yr(t,e,n){const i=ze(t,n),s=ze([],n);function r(){const t=i.get(),n=e.map(e=>e(t)).filter(t=>null!=t&&""!==t);return s.set(n),n}const o=i.set;i.set=function(t,e=!1){o(t,e),r()};const a=i.update;i.update=function(t,e=!1){a(t,e),r()};const l=i;return Object.defineProperty(l,"__isFormAtom__",{value:!0,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(l,"errors",{get:()=>s.get(),enumerable:!1,configurable:!0}),Object.defineProperty(l,"isValid",{get:()=>0===s.get().length,enumerable:!1,configurable:!0}),l.validate=r,l.toFloat=()=>gr(i.get()),l.toFloatString=()=>gr(i.get()).toString(),l.toValidNumber=()=>function(t){const e=Number(t);return Number.isFinite(e)?e:0}(i.get()),Object.defineProperty(l,"name",{value:"formAtom",writable:!0,configurable:!0,enumerable:!1}),l}const wr=(t,e=[],n)=>yr(t,e,n);function vr(t){const e=[],n={},i=new WeakSet;return function t(s,r){if(null==s)return;const o=typeof s;if("object"!==o&&"function"!==o)return;if(i.has(s))return;if(i.add(s),function(t){if(null==t)return!1;const e=typeof t;return("object"===e||"function"===e)&&!0===t.__isFormAtom__}(s)){const t=s.validate();return void(t.length>0&&(e.push(...t),n[r]=t))}if(Array.isArray(s)){for(let e=0;e<s.length;e++){const n=r?`${r}[${e}]`:`[${e}]`;t(s[e],n)}return}const a=Object.keys(s);for(const e of a){const n=r?`${r}.${e}`:e;t(s[e],n)}}(t,""),{isValid:0===e.length,errors:e,errorsByField:n}}function br(t,e,n){const i=e.replace(/\[(\d+)]/g,".$1").split(".");let s=t;for(const t of i){if(null==s)return n;s=s[t]}return void 0===s?n:s}function Sr(t,e){const n={};for(const i of e)i in t&&(n[i]=t[i]);return n}function Er(t,e){const n={...t};for(const t of e)delete n[t];return n}function Cr(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function Mr(t,...e){const n={...t};for(const t of e)for(const e of Object.keys(t))Cr(n[e])&&Cr(t[e])?n[e]=Mr(n[e],t[e]):n[e]=t[e];return n}function kr(t,e,n){return Math.min(Math.max(t,e),n)}function xr(t,e,n){if(void 0===e&&(e=t,t=0),void 0===n&&(n=t<=e?1:-1),0===n)return[];const i=[];if(n>0)for(let s=t;s<e;s+=n)i.push(s);else for(let s=t;s>e;s+=n)i.push(s);return i}function Ar(t,e){if(e<1)return[];const n=[];for(let i=0;i<t.length;i+=e)n.push(t.slice(i,i+e));return n}function Rr(t,e){const n=new Set,i=[];for(const s of t){const t=e(s);n.has(t)||(n.add(t),i.push(s))}return i}function Or(t,e){const n={};for(const i of t){const t=String(e(i));n[t]||(n[t]=[]),n[t].push(i)}return n}function zr(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 Tr(t,e){if(null==t||"object"!=typeof t)return;const n=Array.isArray(t)?t.map((t,e)=>e):Object.keys(t);for(const i of n){const n=e(i,t[i],t);void 0!==n&&(t[i]=n);const s=t[i];null!==s&&"object"==typeof s&&Tr(s,e)}}const Ir=t=>(t=>"number"==typeof t||"boolean"==typeof t||!zr(t))(t)?null:"Required",Pr=t=>(t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))(t)?null:"Invalid email",Dr=t=>e=>((t,e)=>t.length>=e)(e,t)?null:`Min ${t} characters`,Lr=t=>e=>((t,e)=>t.length<=e)(e,t)?null:`Max ${t} characters`,jr=(t,e="Invalid format")=>n=>((t,e)=>e.test(t))(n,t)?null:e,Nr=t=>e=>((t,e)=>t>=e)(e,t)?null:`Min is ${t}`,$r=t=>e=>((t,e)=>t<=e)(e,t)?null:`Max is ${t}`;function Ur(t){let e;return Re({name:"Memo",fn:t,onRun:t=>{e?e.set(()=>t):(e=ze(void 0,{skipRestrictedContextCheck:!0}),e.set(()=>t,!0))}}),e}function Fr(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 i=t;for(;i&&!n.includes(i);){for(const t of Reflect.ownKeys(i))"constructor"!==t&&e.add(t);i=Object.getPrototypeOf(i)}return Array.from(e)}const Vr=t=>{const e=H();if(e&&e.scopes.has(t))throw new Error("Scope already exists for the same class for this component");let n;z.viewOuterInProgress=!0;try{n=new t}finally{z.viewOuterInProgress=!1}const i=z.setupInProgress;try{if((()=>{Fr(n).forEach(t=>{const e=Object.getOwnPropertyDescriptor(n,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),t);if(e&&(e.get||e.set))return;const i=n[t];"function"!=typeof i||i.__version__||(n[t]=i.bind(n))})})(),"function"==typeof n.setup){Qs(n.setup)&&console.warn("Async setup functions are not supported. Please ensure the setup function is synchronous."),z.setupInProgress=!0;try{n.setup(e?._propsFn||(()=>({})))}catch(t){console.error(t)}finally{z.setupInProgress=i}}e&&e.addScope(t,n),n.__isScope___=!0}catch(t){console.error(t)}finally{z.setupInProgress=i}return n},Wr=t=>{let e=null;const n=new CustomEvent("request-parent-scope",{bubbles:!0,composed:!0,detail:{ScopeClass:t,resolve:t=>{e=t}}});if(H().dispatchEvent(n),e)return e;throw new Error(`No parent scope found for ${t.name}`)};function Yr(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 Hr=t=>{const e=H();if("object"!=typeof t||null===t)throw new Error("stateObj must be an object");const n=ze(t),i=((t,e,n)=>{const i=Fr(t);i.forEach(i=>{const s=Yr(t,i);if(s?.get){let n,r=-1;const o=s.get;Object.defineProperty(t,i,{get(){const i=e.__version__;return i!==r&&(r=i,n=o.call(t)),n},configurable:!0,enumerable:s.enumerable})}else if(Js(t[i])){if(Qs(t[i]))throw new Error(`Async functions are not supported inside ${n}`);const s=t[i];t[i]=(...n)=>{e.update(()=>s.apply(t,n))}}});const s=Object.create(t);return i.forEach(n=>{const i=Yr(t,n);if(!i)return;const r=!!i.get,o=!r&&Js(i.value);r||o||Object.defineProperty(s,n,{get:()=>e()[n],set(t){e.update(e=>{e[n]=t})},enumerable:!0,configurable:!0})}),s})(t,n,"useState");return e?._useStates&&e._useStates.push({state:t,atom:n}),[i,n.update]},Br=t=>{K();const e=H();e._errorHandlers||(e._errorHandlers=[]),e._errorHandlers.push(t)},qr=(t,e)=>{const n=H();if(K(),!n)throw new Error("onReferenceChange must be called inside a component");let i=[];t(),i=e(),n.onEachUpdate(()=>{const n=e();i.some((t,e)=>t!==n[e])&&(t(),i=n)})};function Gr(t,e,n,i=!1){document.addEventListener(t,e,{capture:i}),n.addToCleanUps(e,()=>{document.removeEventListener(t,e,{capture:i})})}function Xr(t,e,n,i){let s;if("wheelUp"===t||"wheelDown"===t){const r="wheelUp"===t,o=e,a=t=>{(r?t.deltaY>=0:t.deltaY<=0)||(s&&s(),s=o(t))};return window.addEventListener("wheel",a,{capture:n,passive:!0}),void i.addToCleanUps(e,()=>{window.removeEventListener("wheel",a,{capture:n}),s&&s()})}const r="scroll"===t||"touchstart"===t||"touchmove"===t,o=e,a=t=>{s&&s(),s=o(t)};window.addEventListener(t,a,{capture:n,passive:r}),i.addToCleanUps(e,()=>{window.removeEventListener(t,a,{capture:n}),s&&s()})}function Zr(t,e){G()||(K(),Xr(t,e,!1,H()))}function Jr(t,e){G()||(K(),Xr(t,e,!0,H()))}const Qr=t=>{Jr("scroll",t)},Kr=t=>{Zr("blur",t)},to=t=>{Zr("focus",t)},eo=t=>{Zr("online",t)},no=t=>{Zr("offline",t)},io=t=>{Zr("resize",t)},so=t=>{Zr("paste",t)},ro=t=>{Zr("copy",t)},oo=t=>{Zr("cut",t)},ao=t=>{Zr("keydown",t)},lo=t=>{Zr("keyup",t)},co=t=>{if(G())return;K();let e;Gr("visibilitychange",()=>{e&&e(),e=t(document.hidden)},H())},ho=t=>{if(G())return;K();let e;Gr("selectionchange",()=>{e&&e(),e=t(window.getSelection())},H())},uo=t=>{Zr("storage",t)},fo=t=>{if(G())return;K();const e=H();let n;const i=t=>t.preventDefault(),s=e=>{e.preventDefault(),n&&n(),n=t(e)};window.addEventListener("dragover",i),window.addEventListener("drop",s),e.addToCleanUps(t,()=>{window.removeEventListener("dragover",i),window.removeEventListener("drop",s),n&&n()})},po=t=>{if(G())return;K();const e=H(!0),n=n=>{const i=n.target;i&&!e.contains(i)&&t(n)};document.addEventListener("mousedown",n,!0),e.addToCleanUps(t,()=>{document.removeEventListener("mousedown",n,!0)})},mo=(t,e=window)=>{if(G())return;K();const n=H();let i;const s=e=>{i&&i(),i=t(e)};e.addEventListener("scroll",s,{passive:!0}),n.addToCleanUps(t,()=>{e.removeEventListener("scroll",s),i&&i()})},_o=(t,e)=>{if(G())return;K();const n=H();let i;const s=new ResizeObserver(e=>{for(const n of e)i&&i(),i=t(n)}),r=e||n;s.observe(r),n.addToCleanUps(t,()=>{s.disconnect(),i&&i()})},go=t=>{K();const e=H();let n;const i=sn.__subscribe(()=>{n&&n(),n=t(sn.get())||null});e.addToCleanUps(t,()=>{i(),n&&n()})},yo=(t,e)=>{if(G())return;K();const n=H();let i;const s=setInterval(()=>{i&&i(),i=t()},e);n.addToCleanUps(t,()=>{clearInterval(s),i&&i()})},wo=(t,e)=>{if(G())return;K();const n=H();let i;const s=setTimeout(()=>{i=t()},e);n.addToCleanUps(t,()=>{clearTimeout(s),i&&i()})};function vo(t,e){K();const n=H(),i=e.map(e=>e.__subscribe(t));n.addToCleanUps(t,()=>{i.forEach(t=>t())})}const bo=t=>{K();const e=H();let n;e.onEachUpdate(()=>{n&&n(),n=t()}),e.addToCleanUps(t,()=>{n&&n()})},So=t=>{const e=H();if(!e)throw new Error("onDOMReady must be called within a component context");return e.DOMReadyEvent.__subscribe(t)},Eo=Mi((e,n,i)=>{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)"}),i?.style&&Object.assign(s.style,i.style),i?.onBackdropClick&&s.addEventListener("click",t=>{t.target===s&&i.onBackdropClick()});const r=document.createElement("div");i?.dialogStyle&&Object.assign(r.style,i.dialogStyle),r.addEventListener("click",t=>t.stopPropagation()),t(n,r),s.appendChild(r),document.body.appendChild(s);const o=document.body.style.overflow;return document.body.style.overflow="hidden",{onUpdate(e){t(e,r)},onCleanup(){s.remove(),document.body.style.overflow=o}}});function Co(t,e){return Eo(t,e)}function Mo(t,e,n,i,s,r,o){return t.startsWith("top")?i>=n:t.startsWith("bottom")?s>=n:t.startsWith("left")?r>=e:!!t.startsWith("right")&&o>=e}const ko=gi((e,n,i)=>{const s=e.el;let r=!1,o=n,a=i;const l=document.createElement("div");l.style.cssText="position:fixed;z-index:9999;margin:0;display:none;background:var(--md-color-surface-raised,#fff);box-shadow: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));min-width:160px;",a.style&&Object.assign(l.style,a.style),document.body.appendChild(l),t(o,l);const c=()=>{const t=s.getBoundingClientRect();l.style.visibility="hidden",l.style.display="block",a.matchAnchorWidth&&(l.style.width=`${t.width}px`);const e=l.offsetWidth,n=l.offsetHeight,i=function(t,e,n,i,s){const r=window.innerWidth,o=window.innerHeight,a=t.top-i,l=o-t.bottom-i,c=t.left-i,h=r-t.right-i;if("auto"===s){const t=["bottom-start","top-start","right","left"];for(const i of t)if(Mo(i,e,n,a,l,c,h))return i;return"bottom-start"}if(Mo(s,e,n,a,l,c,h))return s;const u=(d=s).startsWith("top")?d.replace("top","bottom"):d.startsWith("bottom")?d.replace("bottom","top"):d.startsWith("left")?d.replace("left","right"):d.startsWith("right")?d.replace("right","left"):d;var d;return Mo(u,e,n,a,l,c,h)?u:s}(t,e,n,a.gap??4,a.position??"bottom-start");!function(t,e,n,i,s,r){const o=window.innerWidth,a=window.innerHeight;let l=0,c=0;n.startsWith("bottom")?l=e.bottom+r:n.startsWith("top")?l=e.top-r-s:"right"===n||"left"===n?l=e.top+e.height/2-s/2:n.endsWith("-start")?l=e.top:n.endsWith("-end")&&(l=e.bottom-s),"bottom"===n||"top"===n?c=e.left+e.width/2-i/2:n.endsWith("-start")?c=n.startsWith("right")?e.right+r:n.startsWith("left")?e.left-r-i:e.left:n.endsWith("-end")?c=n.startsWith("right")?e.right+r:n.startsWith("left")?e.left-r-i:e.right-i:n.startsWith("right")?c=e.right+r:n.startsWith("left")&&(c=e.left-r-i),t.style.left=`${Math.max(4,Math.min(c,o-i-4))}px`,t.style.top=`${Math.max(4,Math.min(l,a-s-4))}px`}(l,t,i,e,n,a.gap??4),l.style.visibility=""},h=()=>{r&&c()},u=t=>{const e=t.target;l.contains(e)||s.contains(e)||f()},d=t=>{"Escape"===t.key&&f()},f=()=>{r=!1,l.style.display="none",a.onClose?.(s),document.removeEventListener("click",u,{capture:!0}),document.removeEventListener("keydown",d),window.removeEventListener("scroll",h,{capture:!0}),window.removeEventListener("resize",h)},p=t=>{t.stopPropagation(),r?f():(r=!0,c(),a.onOpen?.(l),document.addEventListener("click",u,{capture:!0}),document.addEventListener("keydown",d),window.addEventListener("scroll",h,{passive:!0,capture:!0}),window.addEventListener("resize",h,{passive:!0}))};return s.addEventListener("click",p),{onUpdate(e,n){o=e,a=n,t(e,l),n.style&&Object.assign(l.style,n.style),r&&c()},onCleanup(){r&&f(),s.removeEventListener("click",p),l.remove()}}});function xo(t,e){return ko(t,"string"==typeof e?{position:e}:e??{})}function Ao(t,e,n){switch(e){case"top":case"top-start":return{top:t.top-n,left:t.left};case"top-end":return{top:t.top-n,left:t.right};case"bottom":case"bottom-start":default:return{top:t.bottom+n,left:t.left};case"bottom-end":return{top:t.bottom+n,left:t.right};case"right":case"right-start":return{top:t.top,left:t.right+n};case"right-end":return{top:t.bottom,left:t.right+n};case"left":case"left-start":return{top:t.top,left:t.left-n};case"left-end":return{top:t.bottom,left:t.left-n}}}function Ro(t){return"top"===t||"top-start"===t||"top-end"===t?"translateY(-100%)":"left"===t||"left-start"===t||"left-end"===t?"translateX(-100%)":""}function Oo(t,e,n,i){const s=window.innerHeight-t.bottom-i,r=t.top-i,o=window.innerWidth-t.right-i,a=t.left-i;if(s>=n)return"bottom";if(r>=n)return"top";if(o>=e)return"right";if(a>=e)return"left";return[["bottom",s],["top",r],["right",o],["left",a]].reduce((t,e)=>e[1]>t[1]?e:t)[0]}const zo=Mi((e,n,i)=>{const s=document.createElement("div");if(s.style.position="fixed",s.style.zIndex="9999",i?.style&&Object.assign(s.style,i.style),i?.on)for(const[t,e]of Object.entries(i.on))s.addEventListener(t,e);return function(t){return t?"string"==typeof t?document.querySelector(t)??document.body:t:document.body}(i?.target).appendChild(s),t(n,s),{onUpdate(e){t(e,s)},onCleanup(){s.remove()}}});function To(t,e){return zo(t,e)}let Io=null,Po=null,Do=null;function Lo(){return Io||(Io=document.createElement("div"),Io.id="mates-tip",Io.setAttribute("role","tooltip"),Io.style.cssText="position:fixed;z-index:10000;pointer-events:none;padding:6px 12px;border-radius:4px;font-size:0.8rem;font-family:system-ui,-apple-system,sans-serif;font-weight:500;line-height:1.4;max-width:300px;width:max-content;background:var(--md-sys-color-inverse-surface,#2e3036);color:var(--md-sys-color-inverse-on-surface,#f0f0f8);box-shadow:0 1px 3px rgba(0,0,0,.20),0 2px 6px rgba(0,0,0,.14);letter-spacing:0.01em;white-space:nowrap;display:none;",document.body.appendChild(Io)),Io}const jo=["maxWidth","padding","borderRadius","fontSize","whiteSpace"];function No(t,e){if(e.maxWidth&&(t.style.maxWidth=e.maxWidth),e.padding&&(t.style.padding=e.padding),e.borderRadius&&(t.style.borderRadius=e.borderRadius),e.fontSize&&(t.style.fontSize=e.fontSize),e.whiteSpace&&(t.style.whiteSpace=e.whiteSpace),e.style)for(const[n,i]of Object.entries(e.style))void 0!==i&&(t.style[n]=i)}function $o(t,e){const n={maxWidth:"300px",padding:"6px 12px",borderRadius:"4px",fontSize:"0.8rem",whiteSpace:"nowrap"};for(const i of jo)void 0!==e[i]&&(t.style[i]=n[i]);if(e.style){for(const n of Object.keys(e.style))t.style[n]="";t.style.background="var(--md-sys-color-inverse-surface,#2e3036)",t.style.color="var(--md-sys-color-inverse-on-surface,#f0f0f8)"}}function Uo(n,i){t("string"==typeof i?e`${i}`:i,n)}function Fo(t,e){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect(),s=i.width,r=i.height,o=window.innerWidth,a=window.innerHeight;let l;n.top-8-r>=0?(l=n.top-8-r,e.style.transformOrigin="bottom center"):(l=n.bottom+8,e.style.transformOrigin="top center");let c=n.left+n.width/2-s/2;c=Math.max(4,Math.min(c,o-s-4)),l=Math.max(4,Math.min(l,a-r-4)),e.style.left=`${c}px`,e.style.top=`${l}px`}const Vo=gi((t,e,n)=>{const i=t.el;let s=e,r=n,o=null;const a=()=>{null!==Do&&(cancelAnimationFrame(Do),Do=null),null!==o&&(clearTimeout(o),o=null);const t=r.delay??150;o=setTimeout(()=>{o=null;const t=Lo();Uo(t,s),No(t,r),t.style.visibility="hidden",t.style.opacity="0",t.style.transform="scale(0.94) translateY(3px)",t.style.transition="none",t.style.display="block",Fo(i,t),requestAnimationFrame(()=>{t.style.transition="opacity 0.14s ease, transform 0.14s cubic-bezier(0.22,1,0.36,1)",t.style.visibility="visible",t.style.opacity="1",t.style.transform="scale(1) translateY(0)",Po=i})},t)},l=()=>{if(null!==o&&(clearTimeout(o),o=null),Po!==i)return;const t=Lo();t.style.transition="opacity 0.12s ease, transform 0.12s ease",t.style.opacity="0",t.style.transform="scale(0.94) translateY(3px)",Do=requestAnimationFrame(()=>{Do=requestAnimationFrame(()=>{Do=null,Po===i&&($o(t,r),t.style.display="none",Po=null)})})};return i.addEventListener("mouseenter",a),i.addEventListener("mouseleave",l),i.addEventListener("focusin",a),i.addEventListener("focusout",l),i.setAttribute("aria-describedby","mates-tip"),{onUpdate(t,e){if(s=t,r=e,Po===i){const n=Lo();Uo(n,t),No(n,e),Fo(i,n)}},onCleanup(){if(null!==o&&(clearTimeout(o),o=null),Po===i){null!==Do&&(cancelAnimationFrame(Do),Do=null);const t=Lo();$o(t,r),t.style.display="none",Po=null}i.removeEventListener("mouseenter",a),i.removeEventListener("mouseleave",l),i.removeEventListener("focusin",a),i.removeEventListener("focusout",l)}}});function Wo(t,e={}){return Vo(t,e)}const Yo=Wo,Ho=1e3,Bo=3e4,qo=1/0;function Go(t,e={}){P("ws");const{reconnect:n=!0,reconnectDelay:i=Ho,reconnectMaxDelay:s=Bo,reconnectMaxAttempts:r=qo,protocols:o,auth:a,autoConnect:l=!0}=e,c=ze("connecting",{skipRestrictedContextCheck:!0}),h=new Set;let u=null,d=0,f=i,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 i=n.map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&");return t.includes("?")?`${t}&${i}`:`${t}?${i}`}()}catch(t){return D(t),void c.set("error")}try{u=o?new WebSocket(e,o):new WebSocket(e)}catch(t){return D(t),c.set("error"),void w()}u.onopen=()=>{m?u?.close():(d=0,f=i,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 i;i=n,h.forEach(t=>{try{t(i)}catch(t){D(t)}})},u.onerror=()=>{c.set("error")},u.onclose=()=>{m||(c.set("disconnected"),w())}}function w(){if(!n||m)return;if(d>=r)return;d++;const t=f;f=Math.min(2*f,s),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"),ut(b,v),b}class Xo{constructor(){this.id=Math.random().toString(36).substring(2,15),this.context=null}}function Zo(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,i)=>n.set(Zo(i,e),Zo(t,e))),n}if(t instanceof Set){const n=new Set;return e.set(t,n),t.forEach(t=>n.add(Zo(t,e))),n}if(Array.isArray(t)){const n=[];e.set(t,n);for(let i=0;i<t.length;i++)n[i]=Zo(t[i],e);return n}const n=e.get(t);if(n)return n;const i={};e.set(t,i);for(const n of Object.keys(t))i[n]=Zo(t[n],e);return i}function Jo(t,e){let n=Object.getOwnPropertyDescriptor(t,e),i=Object.getPrototypeOf(t);for(;!n&&i&&i!==Object.prototype;)n=Object.getOwnPropertyDescriptor(i,e),i=Object.getPrototypeOf(i);return n?.get&&"function"==typeof n.get?n.get:null}var Qo,Ko,ta,ea,na,ia;function sa(t){return"number"==typeof t?`${t}px`:t}Ko=new WeakMap,ta=new WeakMap,ea=new WeakMap,na=new WeakMap,Qo=new WeakSet,ia=function(t){L(this,Ko,"f")?.remove(),j(this,Ko,null,"f"),j(this,ta,"","f"),j(this,ea,"","f"),j(this,na,new Set,"f");const e=t.endNode;if(e?.parentNode){const n=t.startNode,i=document.createRange();i.setStartAfter(n),i.setEndBefore(e),i.deleteContents()}};const ra=a(class extends c{constructor(t){if(super(t),Qo.add(this),Ko.set(this,null),ta.set(this,""),ea.set(this,""),na.set(this,new Set),t.type!==l.CHILD)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"),L(this,Qo,"m",ia).call(this,t),i;const s=JSON.stringify(n);if(null===L(this,Ko,"f")||e!==L(this,ta,"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"),L(this,Qo,"m",ia).call(this,t),i;L(this,Ko,"f")?.remove(),j(this,Ko,n,"f"),j(this,ta,e,"f"),j(this,ea,"","f"),j(this,na,new Set,"f");const s=t.endNode;s.parentNode.insertBefore(L(this,Ko,"f"),s)}if(s!==L(this,ea,"f")){const t=function(t,e){const n=new Set,i=(e,i)=>{t.setAttribute(e,i),n.add(e)},s=e.width??e.size,r=e.height??e.size;void 0!==s&&i("width",sa(s)),void 0!==r&&i("height",sa(r)),void 0!==e.fill&&i("fill",e.fill),void 0!==e.stroke&&i("stroke",e.stroke),void 0!==e.strokeWidth&&i("stroke-width",String(e.strokeWidth)),void 0!==e.strokeLinecap&&i("stroke-linecap",e.strokeLinecap),void 0!==e.strokeLinejoin&&i("stroke-linejoin",e.strokeLinejoin),void 0!==e.opacity&&i("opacity",String(e.opacity)),void 0!==e.viewBox&&i("viewBox",e.viewBox),void 0!==e.transform&&i("transform",e.transform);const o=[],a=e.width??e.size,l=e.height??e.size;void 0!==a&&o.push(`width:${sa(a)}`),void 0!==l&&o.push(`height:${sa(l)}`),void 0!==e.color&&o.push(`color:${e.color}`),o.push("display:inline-block"),o.push("vertical-align:middle"),e.style&&o.push(e.style),i("style",o.join(";")),e.class&&i("class",e.class);const c=e.ariaHidden??!0;return e.ariaLabel?(i("aria-label",e.ariaLabel),i("role","img")):c&&i("aria-hidden","true"),n}(L(this,Ko,"f"),n);for(const e of L(this,na,"f"))t.has(e)||L(this,Ko,"f").removeAttribute(e);j(this,na,t,"f"),j(this,ea,s,"f")}return i}render(t,e){return i}});function oa(t,e={}){return ra(t,e)}function aa(){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 la=null,ca=null,ha=null;function ua(t){la=t}function da(t){ca=t}function fa(){return ca}function pa(){return la??-(new Date).getTimezoneOffset()}function ma(){return ha??("undefined"!=typeof navigator?navigator.language:null)??"en"}function _a(t,e){const n={};for(const i 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"!==i.type&&(n[i.type]=parseInt(i.value,10));const i=24===n.hour?0:n.hour,s=Date.UTC(n.year,n.month-1,n.day,i,n.minute,n.second);return Math.round((s-e)/6e4)||0}function ga(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 ya(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 wa(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 va=t=>String(t).padStart(2,"0");function ba(t,e,n){const i={[n]:e};return ca?i.timeZone=ca:(i.timeZone="UTC",t+=6e4*pa()),new Intl.DateTimeFormat(ma(),i).format(new Date(t))}function Sa(t,e){const n=t>=0?"+":"-",i=Math.abs(t);return e?`${n}${va(Math.floor(i/60))}:${va(i%60)}`:`${n}${va(Math.floor(i/60))}${va(i%60)}`}function Ea(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 Ca(){try{const t=new Intl.Locale(ma()),e=t.weekInfo?.firstDay??t.getWeekInfo?.()?.firstDay;if(void 0!==e)return e%7}catch{}return 0}const Ma=/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|H|hh|h|mm|ss|SSS|ZZ|Z|A|a/g,ka=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function xa(t){try{const e=new Date(Date.UTC(2024,0,7+t,12,0,0));return new Intl.DateTimeFormat(ma(),{weekday:"long",timeZone:"UTC"}).format(e)}catch{return ka[t]||""}}function Aa(t){try{const e=new Date(Date.UTC(2024,t-1,15,12,0,0));return new Intl.DateTimeFormat(ma(),{month:"long",timeZone:"UTC"}).format(e)}catch{return""}}function Ra(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:i=1,hour:s=0,minute:r=0,second:o=0,ms:a=0}=t;return Date.UTC(e,n-1,i,s,r,o,a)-6e4*pa()}return NaN}function Oa(t,e,n){const i=Ea(n);if("hour"===i)return t+36e5*e;if("min"===i)return t+6e4*e;if("second"===i)return t+1e3*e;if("ms"===i)return t+e;const s=pa(),r=wa(t,s);let o=r.Y,a=r.M,l=r.D;if("year"===i)o+=e;else if("month"===i){const t=a-1+e;o+=Math.floor(t/12),a=(t%12+12)%12+1,l=Math.min(l,new Date(o,a,0).getDate())}else l+="week"===i?7*e:e;return Date.UTC(o,a-1,l,r.h,r.m,r.s,r.ms)-6e4*s}function za(t,e){const n=pa(),i=wa(t,n),s=wa(e,n);return i.Y===s.Y&&i.M===s.M&&i.D===s.D}function Ta(t){const e=pa(),n=wa(t,e);return Date.UTC(n.Y,n.M-1,n.D,0,0,0,0)-6e4*e}function Ia(t,e){const n=pa(),i=wa(t,n),s=i.h%12||12,r=[],o=e.replace(/\[([^\]]*)\]/g,(t,e)=>(r.push(e),`\0${r.length-1}\0`));Ma.lastIndex=0;return o.replace(Ma,e=>{switch(e){case"YYYY":return String(i.Y);case"YY":return String(i.Y).slice(-2);case"MMMM":return ba(t,"long","month");case"MMM":return ba(t,"short","month");case"MM":return va(i.M);case"M":return String(i.M);case"DD":return va(i.D);case"D":return String(i.D);case"dddd":return ba(t,"long","weekday");case"ddd":return ba(t,"short","weekday");case"HH":return va(i.h);case"H":return String(i.h);case"hh":return va(s);case"h":return String(s);case"mm":return va(i.m);case"ss":return va(i.s);case"SSS":return r=i.ms,String(r).padStart(3,"0");case"A":return i.h>=12?"PM":"AM";case"a":return i.h>=12?"pm":"am";case"Z":return Sa(n,!0);case"ZZ":return Sa(n,!1);default:return e}var r}).replace(/\0(\d+)\0/g,(t,e)=>r[+e])}const Pa=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]];const Da=Symbol("ts"),La=Object.create(Number.prototype);function ja(t){return function(t){const e=Object.create(La);return e[Da]=t,e}(void 0===t?Date.now():Ra(t))}function Na(t){null==t?(ua(null),da(null)):(ua(t.offset),da(t.name))}function $a(t){ua(t),da(null)}function Ua(){return pa()}function Fa(t){ha=t??null}function Va(){return ma()}function Wa(){let t;try{t=Intl.supportedValuesOf("timeZone")}catch{return[]}const e=Date.now();return t.map(t=>({name:t,longName:ya(t,e),shortName:ga(t,e),offset:_a(t,e)}))}function Ya(t){const e=t??ma(),n=new Intl.DateTimeFormat(e,{month:"long",timeZone:"UTC"}),i=new Intl.DateTimeFormat(e,{month:"short",timeZone:"UTC"}),s=[];for(let t=1;t<=12;t++){const e=new Date(Date.UTC(2024,t-1,15,12,0,0));s.push({number:t,name:n.format(e),shortName:i.format(e)})}return s}function Ha(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=ja({year:t,month:e,day:1}),{year:i,month:s,numberOfDaysOfTheMonth:r}=n.values,o=[];for(let t=wa(n.valueOf(),pa()).wd;t>0;t--)o.push(ja({year:i,month:s,day:1-t}));for(let t=1;t<=r;t++)o.push(ja({year:i,month:s,day:t}));const a=o.length%7,l=0===a?0:7-a,c=ja({year:i,month:s,day:r});for(let t=0;t<l;t++)c.add(1,"day"),o.push(ja(c.valueOf()));const h=[];for(let t=0;t<o.length;t+=7)h.push(o.slice(t,t+7));return h}Object.defineProperties(La,{valueOf:{value(){return this[Da]},writable:!1,configurable:!1},values:{get(){const t=this[Da],e=wa(t,pa());return{year:e.Y,month:e.M,monthName:Aa(e.M),dayName:xa(e.wd),date:e.D,weekStartDayName:xa(Ca()),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[Da];return Number.isFinite(t)?new Date(t).toISOString():"Invalid Date"},writable:!1,configurable:!1},toString:{value(){const t=this[Da];return Number.isFinite(t)?new Intl.DateTimeFormat(ma(),{dateStyle:"medium",...fa()?{timeZone:fa()}:{timeZone:"UTC"}}).format(new Date(fa()?t:t+6e4*pa())):"Invalid Date"},writable:!1,configurable:!1},format:{value(t){return Ia(this[Da],t)},writable:!1,configurable:!1},formatLongAgo:{value(t){return function(t,e={}){const{numeric:n="auto",style:i="long"}=e,s=((void 0!==e.now?Ra(e.now):Date.now())-t)/1e3,r=Math.abs(s),o=s>=0?-1:1,a=new Intl.RelativeTimeFormat(ma(),{numeric:n,style:i});for(const[t,e]of Pa)if(r>=e)return a.format(o*Math.round(r/e),t);return a.format(0,"second")}(this[Da],t)},writable:!1,configurable:!1},add:{value(t,e){return this[Da]=Oa(this[Da],t,e),this},writable:!1,configurable:!1},subtract:{value(t,e){return this[Da]=Oa(this[Da],-t,e),this},writable:!1,configurable:!1},isBefore:{value(t){return this[Da]<Ra(t)},writable:!1,configurable:!1},isAfter:{value(t){return this[Da]>Ra(t)},writable:!1,configurable:!1},isFuture:{value(){return this[Da]>Date.now()},writable:!1,configurable:!1},isPresent:{value(){return za(this[Da],Date.now())},writable:!1,configurable:!1},isToday:{value(){return za(this[Da],Date.now())},writable:!1,configurable:!1},isYesterday:{value(){const t=Oa(Ta(Date.now()),-1,"day");return za(this[Da],t)},writable:!1,configurable:!1},isTomorrow:{value(){const t=Oa(Ta(Date.now()),1,"day");return za(this[Da],t)},writable:!1,configurable:!1},getDifference:{value(t,e){return function(t,e,n){const i=Ea(n),s=t-e;if("ms"===i)return s;if("second"===i)return Math.trunc(s/1e3);if("min"===i)return Math.trunc(s/6e4);if("hour"===i)return Math.trunc(s/36e5);const r=pa(),o=wa(t,r),a=wa(e,r);if("day"===i||"week"===i){const n=Math.floor((t+6e4*r)/864e5)-Math.floor((e+6e4*r)/864e5);return"week"===i?Math.trunc(n/7):n}return"month"===i?12*(o.Y-a.Y)+(o.M-a.M):o.Y-a.Y}(this[Da],Ra(t),e)},writable:!1,configurable:!1},getAge:{value(t){return function(t,e){const n=pa(),i=wa(t,n),s=wa(e,n);let r=s.Y-i.Y,o=i.M,a=i.D;2===o&&29===a&&((l=s.Y)%4==0&&l%100!=0||l%400==0||(o=3,a=1));var l;return(s.M<o||s.M===o&&s.D<a)&&r--,Math.max(0,r)}(this[Da],void 0!==t?Ra(t):Date.now())},writable:!1,configurable:!1}});export{di as $,Xo as Context,Bn as Delete,xn as ErrorTypes,Fn as Fetch,$n as FetchClient,Vn as Get,ne as MA,F as NotificationManager,Hn as Patch,Wn as Post,Yn as Put,vn as Router,V as SyncNotificationManager,ie as ZeroPromise,ot as _,at as _subToView,re as action,C as addStoreBeingRead,pi as animatedIf,an as animatedRouter,mi as animatedX,xr as arrayRange,P as assertComponentOuterContext,I as assertNotInRestrictedContext,Ne as asyncAction,ze as atom,wi as attr,be as blurInPreset,Se as blurOutPreset,me as bouncePreset,ln as buildPath,On as buildRequestUrl,ur as cacheAtom,Le as cacheFn,Ar as chunk,kr as clamp,Si as classes,Z as cleanupScheduler,Nn as clearInterceptors,Ce as collapseWidthPreset,z as componentRunningStatus,Oo as computeAutoPlacement,xt as configureCSS,Le as createCacheManager,se as createManagedTimer,je as createPollingManager,Re as createReactiveRunner,Ks as createTimedAtom,ja as date,Ve as debounce,tr as debouncedAtom,Zo as deepClone,ke as deepFreeze,Qn as deleteAction,ke as df,Co as dialog,Ge as effect,J as effectScheduler,gi as eleHook,ft as event,Ee as expandWidthPreset,oe as fadeInPreset,ae as fadeOutPreset,qn as fetchAction,Un as fetchClient,we as flipInPreset,ve as flipOutPreset,wr as formAtom,br as get,Gn as getAction,Fr as getAllProps,Wa as getAllTimezones,Ha as getCalendar,Ao as getCoords,H as getCurrentHost,Va as getLocale,Ya as getMonths,Wr as getParentScope,Wr as getScope,S as getStoresBeingRead,Ua as getTimezoneOffset,Qt as globalCSS,Q as globalScheduler,ni as globalTheme,Or as groupBy,hn as hashAtom,Mi as htmlHook,Te as iAtom,ee as injectMatesAnimations,_ as installDevToolsHooks,Ln as interceptAfter,Dn as interceptBefore,jn as interceptError,Ys as isAction,An as isApiResponseSuccess,Hs as isAsyncAction,Qs as isAsyncFunction,mt as isAsyncValue,Vs as isAtom,Xs as isChannel,Gs as isConfirmationEvent,Jo as isDefinedAsGetter,g as isDevToolsInstalled,E as isEffectRunning,Pr as isEmail,zr as isEmpty,qs as isEvent,Js as isFunction,Zs as isGetter,T as isInRestrictedContext,$r as isMax,Nr as isMin,rn as isPathMatching,jr as isPattern,b as isReadTrackingEnabled,Ir as isRequired,G as isSSR,Bs as isSetter,Ws as isUnit,Tr as iterateDeeply,Jt as keyframes,Ti as lazyLoad,gn as location,en as lockNavigation,D as logError,ar as lsAtom,er as mapAtom,Ni as masonryGrid,Lr as maxLength,Ur as memo,Vi as memoTemplate,Mr as merge,Dr as minLength,yn as navigateTo,tn as navigationLocked,Er as omit,Ji as on,it as onAllMount,Kr as onBlur,st as onCleanup,po as onClickAway,Di as onConnect,ro as onCopy,oo as onCut,So as onDOMReady,Li as onDisconnect,Br as onError,fo as onFileDrop,to as onFocus,Ri as onHidden,xi as onIntersect,yo as onInterval,ao as onKeyDown,lo as onKeyUp,et as onMount,go as onNavigate,no as onOffline,eo as onOnline,nt as onPaint,ts as onParent,so as onPaste,qr as onReferenceChange,_o as onResize,mo as onScroll,zi as onScrolledIntoView,ho as onSelectionChange,vo as onSocket,uo as onStorageChange,wo as onTimeout,bo as onUpdate,co as onVisibilityChange,Ai as onVisible,Zr as onWindow,Jr as onWindowCapture,io as onWindowResize,Qr as onWindowScroll,We as paginatedAsyncAction,dr as paginationAtom,Jn as patchAction,sn as pathAtom,Sr as pick,Ro as placementTransform,k as popEffect,xo as popup,To as portal,Xn as postAction,ye as pulsePreset,M as pushEffect,Zn as putAction,pn as qsAtom,aa as randomId,Xe as ref,ut as registerCleanup,vi as removeAttr,Ei as removeClasses,Qi as removeOn,ss as removeStyle,es as renderSwitch,Ke as renderX,X as resetComponentState,_t as resolveAsyncValue,A as restoreTracking,ii as rootCSS,wn as route,oa as safeSVG,K as safetyCheck,x as saveAndEnableTracking,de as scaleInPreset,fe as scaleOutPreset,Vr as scope,nr as setAtom,Fa as setLocale,Ze as setRef,En as setSSRApiLookup,q as setSSRMode,Cn as setSSRRequest,Na as setTimezone,$a as setTimezoneOffset,rt as setter,ge as shakePreset,Te as signal,ce as slideInPreset,he as slideOutPreset,pe as spinPreset,_e as springInPreset,lr as ssAtom,R as startTracking,O as stopTracking,is as style,Bt as stylesheet,Ie as superAtom,Ye as taskAction,_r as themeAtom,He as throttle,cr as throttledAtom,os as timer,Yo as tip,hr as titleAtom,Wo as tooltip,xe as trackAndSubscribe,Rr as uniqBy,nn as unlockNavigation,oa as unsafeSVG,gt as unwrapModule,ht as useContext,Vr as useScope,Hr as useState,lt as useStore,aa as uuid,vr as validateAll,Ae as validateReactiveFunction,Qe as view,$s as virtualGrid,Ns as virtualList,Us as virtualMasonry,ct as watch,Y as withHost,Me as withStaggerPreset,Go as ws,Je as x,dt as xTabEvent};
|
|
117
|
+
*/function Ns(t,e,n,i){const{keyFn:s,template:r,opts:o}=Fs(e,n,i),a={direction:o?.direction??"vertical",...o?.pin?{pin:o.pin}:{}};return js({items:t,renderItem:r,keyFunction:s,scroller:o?.scroller,layout:us(a)})}function $s(t,e,n,i){const{keyFn:s,template:r,opts:o}=Fs(e,n,i),a={direction:o.direction??"vertical",itemSize:{width:o.itemWidth,height:o.itemHeight},gap:o.gap??"8px",flex:o.flex??!1,...o.pin?{pin:o.pin}:{}};return js({items:t,renderItem:r,keyFunction:s,scroller:o.scroller,layout:(l=a,Object.assign({type:Ss},l))});var l}function Us(t,e,n,i){const{keyFn:s,template:r,opts:o}=Fs(e,n,i),a={direction:o.direction??"vertical",getAspectRatio:o.getAspectRatio,gap:o.gap??"8px",flex:!0,...o.itemSize?{itemSize:o.itemSize}:{},...o.pin?{pin:o.pin}:{}};return js({items:t,renderItem:r,keyFunction:s,scroller:o.scroller,layout:(l=a,Object.assign({type:Cs},l))});var l}function Fs(t,e,n){return"function"==typeof e?{keyFn:t,template:e,opts:n}:{keyFn:void 0,template:t,opts:e}}const Vs=t=>"function"==typeof t&&!0===t.__isAtom___&&"function"==typeof t.set&&"function"==typeof t.__subscribe,Ws=t=>"object"==typeof t&&null!==t&&!0===t.__isUnit___&&"function"==typeof t.__subscribe&&"function"==typeof t.__reset,Ys=t=>"function"==typeof t&&!0===t.__isAction___&&"function"==typeof t.__subscribe,Hs=t=>"function"==typeof t&&!0===t.__isAsyncAction___&&"function"==typeof t.subscribe,Bs=t=>"function"==typeof t&&!0===t.__isSetter___&&"function"==typeof t.__subscribe,qs=t=>"object"==typeof t&&null!==t&&!0===t.__isEvent___&&"function"==typeof t.__subscribe&&"function"==typeof t.trigger,Gs=t=>"object"==typeof t&&null!==t&&!0===t.__isConfirmationEvent___&&"function"==typeof t.requestConfirmation&&"function"==typeof t.onConfirmRequest,Xs=t=>"object"==typeof t&&null!==t&&!0===t.__isChannel___&&"function"==typeof t.join,Zs=t=>"function"==typeof t&&!0===t.__isSelector___&&"function"==typeof t.areVersionsChanged,Js=t=>"function"==typeof t,Qs=t=>"AsyncFunction"===t.constructor.name,Ks=(t,e,n,i)=>{if(Vs(t)){const s=t,r=ze(s(),i),o=n(r.set,e),a=n(r.update,e);return r.set=o,r.update=a,s.__subscribe(()=>{J.schedule(()=>r.set(s()))}),ut(r,()=>{o.cancel(),a.cancel()}),r}const s=ze(t,i),r=n(s.set,e),o=n(s.update,e);return s.set=r,s.update=o,ut(s,()=>{r.cancel(),o.cancel()}),s},tr=(t,e,n)=>Ks(t,e,Ve,n),er=(t=[],e)=>{const n=new Map(t),i=ze(n,e),s=n.set.bind(n);n.set=(t,e)=>(s(t,e),i.update(()=>{}),n);const r=n.delete.bind(n);n.delete=t=>{const e=r(t);return i.update(()=>{}),e};const o=n.clear.bind(n);n.clear=()=>{o(),i.update(()=>{})};const a=n.get.bind(n);n.get=t=>(i.get(),a(t));const l=n.has.bind(n);n.has=t=>(i.get(),l(t));const c=Object.getOwnPropertyDescriptor(Map.prototype,"size");Object.defineProperty(n,"size",{get:()=>(i.get(),c.get.call(n))});const h=n.entries.bind(n);n.entries=()=>(i.get(),h());const u=n.values.bind(n);n.values=()=>(i.get(),u());const d=n.keys.bind(n);n.keys=()=>(i.get(),d());const f=n.forEach.bind(n);n.forEach=(t,e)=>(i.get(),f(t,e));const p=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(i.get(),p()),n.update=t=>{const e={set:(t,n)=>(s(t,n),e),delete:t=>r(t),clear:()=>{o()},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),i.update(()=>{}),n},n.updateItem=(t,e)=>{const s=a(t);return null==s||"object"!=typeof s||(e(s),i.update(()=>{})),n},Object.defineProperty(n,"__isAtom___",{value:i,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>i.__version__,enumerable:!1}),n},nr=(t=[],e)=>{const n=new Set(t),i=ze(n,e),s=n.add.bind(n);n.add=t=>(s(t),i.update(()=>{}),n);const r=n.delete.bind(n);n.delete=t=>{const e=r(t);return i.update(()=>{}),e};const o=n.clear.bind(n);n.clear=()=>{o(),i.update(()=>{})};const a=n.has.bind(n);n.has=t=>(i.get(),a(t));const l=Object.getOwnPropertyDescriptor(Set.prototype,"size");Object.defineProperty(n,"size",{get:()=>(i.get(),l.get.call(n))});const c=n.entries.bind(n);n.entries=()=>(i.get(),c());const h=n.values.bind(n);n.values=()=>(i.get(),h());const u=n.keys.bind(n);n.keys=()=>(i.get(),u());const d=n.forEach.bind(n);n.forEach=(t,e)=>(i.get(),d(t,e));const f=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(i.get(),f()),n.update=t=>{const e={add:t=>(s(t),e),delete:t=>r(t),clear:()=>{o()},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),i.update(()=>{}),n},n.updateItem=(t,e)=>(null==t||"object"!=typeof t||(e(t),i.update(()=>{})),n),Object.defineProperty(n,"__isAtom___",{value:i,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>i.__version__,enumerable:!1}),n},ir="mates_storage";function sr(t,e){try{null===e?t.removeItem(ir):t.setItem(ir,JSON.stringify(e))}catch{}}function rr(t,e){const n=ze((()=>{try{return function(t){try{const e=t.getItem(ir);if(e)return JSON.parse(e)}catch{}return null}(t())}catch{return null}})()),i=n.set;n.set=function(e,s=!1){i(e,s);try{sr(t(),n.get())}catch{}};const s=n.update;return n.update=function(e,i=!1){if(null!==n.get()){s(e,i);try{sr(t(),n.get())}catch{}}},e(t=>{if(t.key===ir)if(t.newValue)try{i(JSON.parse(t.newValue))}catch{}else i(null)}),Object.defineProperty(n,"name",{value:"storageAtom",writable:!0,configurable:!0,enumerable:!1}),n}function or(t){"undefined"!=typeof window&&window.addEventListener("storage",t)}const ar=rr(()=>localStorage,t=>or(e=>{e.storageArea===localStorage&&t(e)})),lr=rr(()=>sessionStorage,t=>or(e=>{e.storageArea===sessionStorage&&t(e)})),cr=(t,e,n)=>Ks(t,e,He,n),hr=ze("undefined"!=typeof document?document.title:"");function ur(t){const e=new Map,n=new Map,i=ze(e,t),s=i.get.bind(i),r=i;return r.add=(t,s,r)=>{if(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),i.update(e=>{e.set(t,s)}),void 0!==r&&-1!==r&&r>0){const s=setTimeout(()=>{e.delete(t),n.delete(t),i.update(()=>{})},r);n.set(t,s)}},r.get=t=>(s(),e.get(t)),r.remove=t=>!!e.has(t)&&(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),e.delete(t),i.update(()=>{}),!0),r.has=t=>(s(),e.has(t)),r.getAll=()=>(s(),Array.from(e.values())),r.clearAll=()=>{n.forEach(t=>clearTimeout(t)),n.clear(),e.clear(),i.update(()=>{})},Object.defineProperty(r,"size",{get:()=>(s(),e.size),enumerable:!0,configurable:!0}),Object.defineProperty(r,"name",{get:()=>"cacheAtom",enumerable:!0,configurable:!0}),ut(i,r.clearAll),r}Ge(()=>{var t;t=hr.get(),"undefined"!=typeof document&&(document.title=t)});const dr=(t=1,e)=>{const n=ze(t,e),i=n;return i.next=()=>{n.set(t=>t+1)},i.prev=()=>{n.set(t=>t>1?t-1:t)},i.reset=()=>{n.set(1)},Object.defineProperty(i,"currentPage",{get:()=>n.get(),enumerable:!1,configurable:!0}),Object.defineProperty(i,"name",{value:"paginationAtom",writable:!0,configurable:!0,enumerable:!1}),i},fr="mates-theme";function pr(t){return"auto"===t?function(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}():t}let mr=null;function _r(){if(mr)return mr;const t=ze(function(){try{const t=localStorage.getItem(fr);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=pr(t.get());t.set("dark"===e?"light":"dark")},Object.defineProperty(e,"resolved",{get:()=>pr(t.get()),enumerable:!1,configurable:!0}),Object.defineProperty(e,"name",{value:"themeAtom",writable:!0,configurable:!0,enumerable:!1}),Ge(()=>{const e=t.get();!function(t){try{document.documentElement.setAttribute("data-theme",pr(t))}catch{}}(e),function(t){try{"auto"===t?localStorage.removeItem(fr):localStorage.setItem(fr,t)}catch{}}(e)}),"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{"auto"===t.get()&&t.set("auto")}),mr=e,e}function gr(t,e=2){let n=parseFloat(String(t).trim());Number.isFinite(n)||(n=0);const i=10**e;return Math.round(n*i)/i}function yr(t,e,n){const i=ze(t,n),s=ze([],n);function r(){const t=i.get(),n=e.map(e=>e(t)).filter(t=>null!=t&&""!==t);return s.set(n),n}const o=i.set;i.set=function(t,e=!1){o(t,e),r()};const a=i.update;i.update=function(t,e=!1){a(t,e),r()};const l=i;return Object.defineProperty(l,"__isFormAtom__",{value:!0,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(l,"errors",{get:()=>s.get(),enumerable:!1,configurable:!0}),Object.defineProperty(l,"isValid",{get:()=>0===s.get().length,enumerable:!1,configurable:!0}),l.validate=r,l.toFloat=()=>gr(i.get()),l.toFloatString=()=>gr(i.get()).toString(),l.toValidNumber=()=>function(t){const e=Number(t);return Number.isFinite(e)?e:0}(i.get()),Object.defineProperty(l,"name",{value:"formAtom",writable:!0,configurable:!0,enumerable:!1}),l}const wr=(t,e=[],n)=>yr(t,e,n);function vr(t){const e=[],n={},i=new WeakSet;return function t(s,r){if(null==s)return;const o=typeof s;if("object"!==o&&"function"!==o)return;if(i.has(s))return;if(i.add(s),function(t){if(null==t)return!1;const e=typeof t;return("object"===e||"function"===e)&&!0===t.__isFormAtom__}(s)){const t=s.validate();return void(t.length>0&&(e.push(...t),n[r]=t))}if(Array.isArray(s)){for(let e=0;e<s.length;e++){const n=r?`${r}[${e}]`:`[${e}]`;t(s[e],n)}return}const a=Object.keys(s);for(const e of a){const n=r?`${r}.${e}`:e;t(s[e],n)}}(t,""),{isValid:0===e.length,errors:e,errorsByField:n}}function br(t,e,n){const i=e.replace(/\[(\d+)]/g,".$1").split(".");let s=t;for(const t of i){if(null==s)return n;s=s[t]}return void 0===s?n:s}function Sr(t,e){const n={};for(const i of e)i in t&&(n[i]=t[i]);return n}function Er(t,e){const n={...t};for(const t of e)delete n[t];return n}function Cr(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function Mr(t,...e){const n={...t};for(const t of e)for(const e of Object.keys(t))Cr(n[e])&&Cr(t[e])?n[e]=Mr(n[e],t[e]):n[e]=t[e];return n}function kr(t,e,n){return Math.min(Math.max(t,e),n)}function xr(t,e,n){if(void 0===e&&(e=t,t=0),void 0===n&&(n=t<=e?1:-1),0===n)return[];const i=[];if(n>0)for(let s=t;s<e;s+=n)i.push(s);else for(let s=t;s>e;s+=n)i.push(s);return i}function Ar(t,e){if(e<1)return[];const n=[];for(let i=0;i<t.length;i+=e)n.push(t.slice(i,i+e));return n}function Rr(t,e){const n=new Set,i=[];for(const s of t){const t=e(s);n.has(t)||(n.add(t),i.push(s))}return i}function Or(t,e){const n={};for(const i of t){const t=String(e(i));n[t]||(n[t]=[]),n[t].push(i)}return n}function zr(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 Tr(t,e){if(null==t||"object"!=typeof t)return;const n=Array.isArray(t)?t.map((t,e)=>e):Object.keys(t);for(const i of n){const n=e(i,t[i],t);void 0!==n&&(t[i]=n);const s=t[i];null!==s&&"object"==typeof s&&Tr(s,e)}}const Ir=t=>(t=>"number"==typeof t||"boolean"==typeof t||!zr(t))(t)?null:"Required",Pr=t=>(t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))(t)?null:"Invalid email",Dr=t=>e=>((t,e)=>t.length>=e)(e,t)?null:`Min ${t} characters`,Lr=t=>e=>((t,e)=>t.length<=e)(e,t)?null:`Max ${t} characters`,jr=(t,e="Invalid format")=>n=>((t,e)=>e.test(t))(n,t)?null:e,Nr=t=>e=>((t,e)=>t>=e)(e,t)?null:`Min is ${t}`,$r=t=>e=>((t,e)=>t<=e)(e,t)?null:`Max is ${t}`;function Ur(t){let e;return Re({name:"Memo",fn:t,onRun:t=>{e?e.set(()=>t):(e=ze(void 0,{skipRestrictedContextCheck:!0}),e.set(()=>t,!0))}}),e}function Fr(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 i=t;for(;i&&!n.includes(i);){for(const t of Reflect.ownKeys(i))"constructor"!==t&&e.add(t);i=Object.getPrototypeOf(i)}return Array.from(e)}const Vr=t=>{const e=H();if(e&&e.scopes.has(t))throw new Error("Scope already exists for the same class for this component");let n;z.viewOuterInProgress=!0;try{n=new t}finally{z.viewOuterInProgress=!1}const i=z.setupInProgress;try{if((()=>{Fr(n).forEach(t=>{const e=Object.getOwnPropertyDescriptor(n,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),t);if(e&&(e.get||e.set))return;const i=n[t];"function"!=typeof i||i.__version__||(n[t]=i.bind(n))})})(),"function"==typeof n.setup){Qs(n.setup)&&console.warn("Async setup functions are not supported. Please ensure the setup function is synchronous."),z.setupInProgress=!0;try{n.setup(e?._propsFn||(()=>({})))}catch(t){console.error(t)}finally{z.setupInProgress=i}}e&&e.addScope(t,n),n.__isScope___=!0}catch(t){console.error(t)}finally{z.setupInProgress=i}return n},Wr=t=>{let e=null;const n=new CustomEvent("request-parent-scope",{bubbles:!0,composed:!0,detail:{ScopeClass:t,resolve:t=>{e=t}}});if(H().dispatchEvent(n),e)return e;throw new Error(`No parent scope found for ${t.name}`)};function Yr(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 Hr=t=>{const e=H();if("object"!=typeof t||null===t)throw new Error("stateObj must be an object");const n=ze(t),i=((t,e,n)=>{const i=Fr(t);i.forEach(i=>{const s=Yr(t,i);if(s?.get){let n,r=-1;const o=s.get;Object.defineProperty(t,i,{get(){const i=e.__version__;return i!==r&&(r=i,n=o.call(t)),n},configurable:!0,enumerable:s.enumerable})}else if(Js(t[i])){if(Qs(t[i]))throw new Error(`Async functions are not supported inside ${n}`);const s=t[i];t[i]=(...n)=>{e.update(()=>s.apply(t,n))}}});const s=Object.create(t);return i.forEach(n=>{const i=Yr(t,n);if(!i)return;const r=!!i.get,o=!r&&Js(i.value);r||o||Object.defineProperty(s,n,{get:()=>e()[n],set(t){e.update(e=>{e[n]=t})},enumerable:!0,configurable:!0})}),s})(t,n,"useState");return e?._useStates&&e._useStates.push({state:t,atom:n}),[i,n.update]},Br=t=>{K();const e=H();e._errorHandlers||(e._errorHandlers=[]),e._errorHandlers.push(t)},qr=(t,e)=>{const n=H();if(K(),!n)throw new Error("onReferenceChange must be called inside a component");let i=[];t(),i=e(),n.onEachUpdate(()=>{const n=e();i.some((t,e)=>t!==n[e])&&(t(),i=n)})};function Gr(t,e,n,i=!1){document.addEventListener(t,e,{capture:i}),n.addToCleanUps(e,()=>{document.removeEventListener(t,e,{capture:i})})}function Xr(t,e,n,i){let s;if("wheelUp"===t||"wheelDown"===t){const r="wheelUp"===t,o=e,a=t=>{(r?t.deltaY>=0:t.deltaY<=0)||(s&&s(),s=o(t))};return window.addEventListener("wheel",a,{capture:n,passive:!0}),void i.addToCleanUps(e,()=>{window.removeEventListener("wheel",a,{capture:n}),s&&s()})}const r="scroll"===t||"touchstart"===t||"touchmove"===t,o=e,a=t=>{s&&s(),s=o(t)};window.addEventListener(t,a,{capture:n,passive:r}),i.addToCleanUps(e,()=>{window.removeEventListener(t,a,{capture:n}),s&&s()})}function Zr(t,e){G()||(K(),Xr(t,e,!1,H()))}function Jr(t,e){G()||(K(),Xr(t,e,!0,H()))}const Qr=t=>{Jr("scroll",t)},Kr=t=>{Zr("blur",t)},to=t=>{Zr("focus",t)},eo=t=>{Zr("online",t)},no=t=>{Zr("offline",t)},io=t=>{Zr("resize",t)},so=t=>{Zr("paste",t)},ro=t=>{Zr("copy",t)},oo=t=>{Zr("cut",t)},ao=t=>{Zr("keydown",t)},lo=t=>{Zr("keyup",t)},co=t=>{if(G())return;K();let e;Gr("visibilitychange",()=>{e&&e(),e=t(document.hidden)},H())},ho=t=>{if(G())return;K();let e;Gr("selectionchange",()=>{e&&e(),e=t(window.getSelection())},H())},uo=t=>{Zr("storage",t)},fo=t=>{if(G())return;K();const e=H();let n;const i=t=>t.preventDefault(),s=e=>{e.preventDefault(),n&&n(),n=t(e)};window.addEventListener("dragover",i),window.addEventListener("drop",s),e.addToCleanUps(t,()=>{window.removeEventListener("dragover",i),window.removeEventListener("drop",s),n&&n()})},po=t=>{if(G())return;K();const e=H(!0),n=n=>{const i=n.target;i&&!e.contains(i)&&t(n)};document.addEventListener("mousedown",n,!0),e.addToCleanUps(t,()=>{document.removeEventListener("mousedown",n,!0)})},mo=(t,e=window)=>{if(G())return;K();const n=H();let i;const s=e=>{i&&i(),i=t(e)};e.addEventListener("scroll",s,{passive:!0}),n.addToCleanUps(t,()=>{e.removeEventListener("scroll",s),i&&i()})},_o=(t,e)=>{if(G())return;K();const n=H();let i;const s=new ResizeObserver(e=>{for(const n of e)i&&i(),i=t(n)}),r=e||n;s.observe(r),n.addToCleanUps(t,()=>{s.disconnect(),i&&i()})},go=t=>{if(G())return;K();const e=H();let n;const i=sn.__subscribe(()=>{n&&n(),n=t(sn.get())||null});e.addToCleanUps(t,()=>{i(),n&&n()})},yo=(t,e)=>{if(G())return;K();const n=H();let i;const s=setInterval(()=>{i&&i(),i=t()},e);n.addToCleanUps(t,()=>{clearInterval(s),i&&i()})},wo=(t,e)=>{if(G())return;K();const n=H();let i;const s=setTimeout(()=>{i=t()},e);n.addToCleanUps(t,()=>{clearTimeout(s),i&&i()})};function vo(t,e){K();const n=H(),i=e.map(e=>e.__subscribe(t));n.addToCleanUps(t,()=>{i.forEach(t=>t())})}const bo=t=>{K();const e=H();let n;e.onEachUpdate(()=>{n&&n(),n=t()}),e.addToCleanUps(t,()=>{n&&n()})},So=t=>{const e=H();if(!e)throw new Error("onDOMReady must be called within a component context");return e.DOMReadyEvent.__subscribe(t)},Eo=Mi((e,n,i)=>{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)"}),i?.style&&Object.assign(s.style,i.style),i?.onBackdropClick&&s.addEventListener("click",t=>{t.target===s&&i.onBackdropClick()});const r=document.createElement("div");i?.dialogStyle&&Object.assign(r.style,i.dialogStyle),r.addEventListener("click",t=>t.stopPropagation()),t(n,r),s.appendChild(r),document.body.appendChild(s);const o=document.body.style.overflow;return document.body.style.overflow="hidden",{onUpdate(e){t(e,r)},onCleanup(){s.remove(),document.body.style.overflow=o}}});function Co(t,e){return Eo(t,e)}function Mo(t,e,n,i,s,r,o){return t.startsWith("top")?i>=n:t.startsWith("bottom")?s>=n:t.startsWith("left")?r>=e:!!t.startsWith("right")&&o>=e}const ko=gi((e,n,i)=>{const s=e.el;let r=!1,o=n,a=i;const l=document.createElement("div");l.style.cssText="position:fixed;z-index:9999;margin:0;display:none;background:var(--md-color-surface-raised,#fff);box-shadow: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));min-width:160px;",a.style&&Object.assign(l.style,a.style),document.body.appendChild(l),t(o,l);const c=()=>{const t=s.getBoundingClientRect();l.style.visibility="hidden",l.style.display="block",a.matchAnchorWidth&&(l.style.width=`${t.width}px`);const e=l.offsetWidth,n=l.offsetHeight,i=function(t,e,n,i,s){const r=window.innerWidth,o=window.innerHeight,a=t.top-i,l=o-t.bottom-i,c=t.left-i,h=r-t.right-i;if("auto"===s){const t=["bottom-start","top-start","right","left"];for(const i of t)if(Mo(i,e,n,a,l,c,h))return i;return"bottom-start"}if(Mo(s,e,n,a,l,c,h))return s;const u=(d=s).startsWith("top")?d.replace("top","bottom"):d.startsWith("bottom")?d.replace("bottom","top"):d.startsWith("left")?d.replace("left","right"):d.startsWith("right")?d.replace("right","left"):d;var d;return Mo(u,e,n,a,l,c,h)?u:s}(t,e,n,a.gap??4,a.position??"bottom-start");!function(t,e,n,i,s,r){const o=window.innerWidth,a=window.innerHeight;let l=0,c=0;n.startsWith("bottom")?l=e.bottom+r:n.startsWith("top")?l=e.top-r-s:"right"===n||"left"===n?l=e.top+e.height/2-s/2:n.endsWith("-start")?l=e.top:n.endsWith("-end")&&(l=e.bottom-s),"bottom"===n||"top"===n?c=e.left+e.width/2-i/2:n.endsWith("-start")?c=n.startsWith("right")?e.right+r:n.startsWith("left")?e.left-r-i:e.left:n.endsWith("-end")?c=n.startsWith("right")?e.right+r:n.startsWith("left")?e.left-r-i:e.right-i:n.startsWith("right")?c=e.right+r:n.startsWith("left")&&(c=e.left-r-i),t.style.left=`${Math.max(4,Math.min(c,o-i-4))}px`,t.style.top=`${Math.max(4,Math.min(l,a-s-4))}px`}(l,t,i,e,n,a.gap??4),l.style.visibility=""},h=()=>{r&&c()},u=t=>{const e=t.target;l.contains(e)||s.contains(e)||f()},d=t=>{"Escape"===t.key&&f()},f=()=>{r=!1,l.style.display="none",a.onClose?.(s),document.removeEventListener("click",u,{capture:!0}),document.removeEventListener("keydown",d),window.removeEventListener("scroll",h,{capture:!0}),window.removeEventListener("resize",h)},p=t=>{t.stopPropagation(),r?f():(r=!0,c(),a.onOpen?.(l),document.addEventListener("click",u,{capture:!0}),document.addEventListener("keydown",d),window.addEventListener("scroll",h,{passive:!0,capture:!0}),window.addEventListener("resize",h,{passive:!0}))};return s.addEventListener("click",p),{onUpdate(e,n){o=e,a=n,t(e,l),n.style&&Object.assign(l.style,n.style),r&&c()},onCleanup(){r&&f(),s.removeEventListener("click",p),l.remove()}}});function xo(t,e){return ko(t,"string"==typeof e?{position:e}:e??{})}function Ao(t,e,n){switch(e){case"top":case"top-start":return{top:t.top-n,left:t.left};case"top-end":return{top:t.top-n,left:t.right};case"bottom":case"bottom-start":default:return{top:t.bottom+n,left:t.left};case"bottom-end":return{top:t.bottom+n,left:t.right};case"right":case"right-start":return{top:t.top,left:t.right+n};case"right-end":return{top:t.bottom,left:t.right+n};case"left":case"left-start":return{top:t.top,left:t.left-n};case"left-end":return{top:t.bottom,left:t.left-n}}}function Ro(t){return"top"===t||"top-start"===t||"top-end"===t?"translateY(-100%)":"left"===t||"left-start"===t||"left-end"===t?"translateX(-100%)":""}function Oo(t,e,n,i){const s=window.innerHeight-t.bottom-i,r=t.top-i,o=window.innerWidth-t.right-i,a=t.left-i;if(s>=n)return"bottom";if(r>=n)return"top";if(o>=e)return"right";if(a>=e)return"left";return[["bottom",s],["top",r],["right",o],["left",a]].reduce((t,e)=>e[1]>t[1]?e:t)[0]}const zo=Mi((e,n,i)=>{const s=document.createElement("div");if(s.style.position="fixed",s.style.zIndex="9999",i?.style&&Object.assign(s.style,i.style),i?.on)for(const[t,e]of Object.entries(i.on))s.addEventListener(t,e);return function(t){return t?"string"==typeof t?document.querySelector(t)??document.body:t:document.body}(i?.target).appendChild(s),t(n,s),{onUpdate(e){t(e,s)},onCleanup(){s.remove()}}});function To(t,e){return zo(t,e)}let Io=null,Po=null,Do=null;function Lo(){return Io||(Io=document.createElement("div"),Io.id="mates-tip",Io.setAttribute("role","tooltip"),Io.style.cssText="position:fixed;z-index:10000;pointer-events:none;padding:6px 12px;border-radius:4px;font-size:0.8rem;font-family:system-ui,-apple-system,sans-serif;font-weight:500;line-height:1.4;max-width:300px;width:max-content;background:var(--md-sys-color-inverse-surface,#2e3036);color:var(--md-sys-color-inverse-on-surface,#f0f0f8);box-shadow:0 1px 3px rgba(0,0,0,.20),0 2px 6px rgba(0,0,0,.14);letter-spacing:0.01em;white-space:nowrap;display:none;",document.body.appendChild(Io)),Io}const jo=["maxWidth","padding","borderRadius","fontSize","whiteSpace"];function No(t,e){if(e.maxWidth&&(t.style.maxWidth=e.maxWidth),e.padding&&(t.style.padding=e.padding),e.borderRadius&&(t.style.borderRadius=e.borderRadius),e.fontSize&&(t.style.fontSize=e.fontSize),e.whiteSpace&&(t.style.whiteSpace=e.whiteSpace),e.style)for(const[n,i]of Object.entries(e.style))void 0!==i&&(t.style[n]=i)}function $o(t,e){const n={maxWidth:"300px",padding:"6px 12px",borderRadius:"4px",fontSize:"0.8rem",whiteSpace:"nowrap"};for(const i of jo)void 0!==e[i]&&(t.style[i]=n[i]);if(e.style){for(const n of Object.keys(e.style))t.style[n]="";t.style.background="var(--md-sys-color-inverse-surface,#2e3036)",t.style.color="var(--md-sys-color-inverse-on-surface,#f0f0f8)"}}function Uo(n,i){t("string"==typeof i?e`${i}`:i,n)}function Fo(t,e){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect(),s=i.width,r=i.height,o=window.innerWidth,a=window.innerHeight;let l;n.top-8-r>=0?(l=n.top-8-r,e.style.transformOrigin="bottom center"):(l=n.bottom+8,e.style.transformOrigin="top center");let c=n.left+n.width/2-s/2;c=Math.max(4,Math.min(c,o-s-4)),l=Math.max(4,Math.min(l,a-r-4)),e.style.left=`${c}px`,e.style.top=`${l}px`}const Vo=gi((t,e,n)=>{const i=t.el;let s=e,r=n,o=null;const a=()=>{null!==Do&&(cancelAnimationFrame(Do),Do=null),null!==o&&(clearTimeout(o),o=null);const t=r.delay??150;o=setTimeout(()=>{o=null;const t=Lo();Uo(t,s),No(t,r),t.style.visibility="hidden",t.style.opacity="0",t.style.transform="scale(0.94) translateY(3px)",t.style.transition="none",t.style.display="block",Fo(i,t),requestAnimationFrame(()=>{t.style.transition="opacity 0.14s ease, transform 0.14s cubic-bezier(0.22,1,0.36,1)",t.style.visibility="visible",t.style.opacity="1",t.style.transform="scale(1) translateY(0)",Po=i})},t)},l=()=>{if(null!==o&&(clearTimeout(o),o=null),Po!==i)return;const t=Lo();t.style.transition="opacity 0.12s ease, transform 0.12s ease",t.style.opacity="0",t.style.transform="scale(0.94) translateY(3px)",Do=requestAnimationFrame(()=>{Do=requestAnimationFrame(()=>{Do=null,Po===i&&($o(t,r),t.style.display="none",Po=null)})})};return i.addEventListener("mouseenter",a),i.addEventListener("mouseleave",l),i.addEventListener("focusin",a),i.addEventListener("focusout",l),i.setAttribute("aria-describedby","mates-tip"),{onUpdate(t,e){if(s=t,r=e,Po===i){const n=Lo();Uo(n,t),No(n,e),Fo(i,n)}},onCleanup(){if(null!==o&&(clearTimeout(o),o=null),Po===i){null!==Do&&(cancelAnimationFrame(Do),Do=null);const t=Lo();$o(t,r),t.style.display="none",Po=null}i.removeEventListener("mouseenter",a),i.removeEventListener("mouseleave",l),i.removeEventListener("focusin",a),i.removeEventListener("focusout",l)}}});function Wo(t,e={}){return Vo(t,e)}const Yo=Wo,Ho=1e3,Bo=3e4,qo=1/0;function Go(t,e={}){P("ws");const{reconnect:n=!0,reconnectDelay:i=Ho,reconnectMaxDelay:s=Bo,reconnectMaxAttempts:r=qo,protocols:o,auth:a,autoConnect:l=!0}=e,c=ze("connecting",{skipRestrictedContextCheck:!0}),h=new Set;let u=null,d=0,f=i,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 i=n.map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&");return t.includes("?")?`${t}&${i}`:`${t}?${i}`}()}catch(t){return D(t),void c.set("error")}try{u=o?new WebSocket(e,o):new WebSocket(e)}catch(t){return D(t),c.set("error"),void w()}u.onopen=()=>{m?u?.close():(d=0,f=i,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 i;i=n,h.forEach(t=>{try{t(i)}catch(t){D(t)}})},u.onerror=()=>{c.set("error")},u.onclose=()=>{m||(c.set("disconnected"),w())}}function w(){if(!n||m)return;if(d>=r)return;d++;const t=f;f=Math.min(2*f,s),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"),ut(b,v),b}class Xo{constructor(){this.id=Math.random().toString(36).substring(2,15),this.context=null}}function Zo(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,i)=>n.set(Zo(i,e),Zo(t,e))),n}if(t instanceof Set){const n=new Set;return e.set(t,n),t.forEach(t=>n.add(Zo(t,e))),n}if(Array.isArray(t)){const n=[];e.set(t,n);for(let i=0;i<t.length;i++)n[i]=Zo(t[i],e);return n}const n=e.get(t);if(n)return n;const i={};e.set(t,i);for(const n of Object.keys(t))i[n]=Zo(t[n],e);return i}function Jo(t,e){let n=Object.getOwnPropertyDescriptor(t,e),i=Object.getPrototypeOf(t);for(;!n&&i&&i!==Object.prototype;)n=Object.getOwnPropertyDescriptor(i,e),i=Object.getPrototypeOf(i);return n?.get&&"function"==typeof n.get?n.get:null}var Qo,Ko,ta,ea,na,ia;function sa(t){return"number"==typeof t?`${t}px`:t}Ko=new WeakMap,ta=new WeakMap,ea=new WeakMap,na=new WeakMap,Qo=new WeakSet,ia=function(t){L(this,Ko,"f")?.remove(),j(this,Ko,null,"f"),j(this,ta,"","f"),j(this,ea,"","f"),j(this,na,new Set,"f");const e=t.endNode;if(e?.parentNode){const n=t.startNode,i=document.createRange();i.setStartAfter(n),i.setEndBefore(e),i.deleteContents()}};const ra=a(class extends c{constructor(t){if(super(t),Qo.add(this),Ko.set(this,null),ta.set(this,""),ea.set(this,""),na.set(this,new Set),t.type!==l.CHILD)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"),L(this,Qo,"m",ia).call(this,t),i;const s=JSON.stringify(n);if(null===L(this,Ko,"f")||e!==L(this,ta,"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"),L(this,Qo,"m",ia).call(this,t),i;L(this,Ko,"f")?.remove(),j(this,Ko,n,"f"),j(this,ta,e,"f"),j(this,ea,"","f"),j(this,na,new Set,"f");const s=t.endNode;s.parentNode.insertBefore(L(this,Ko,"f"),s)}if(s!==L(this,ea,"f")){const t=function(t,e){const n=new Set,i=(e,i)=>{t.setAttribute(e,i),n.add(e)},s=e.width??e.size,r=e.height??e.size;void 0!==s&&i("width",sa(s)),void 0!==r&&i("height",sa(r)),void 0!==e.fill&&i("fill",e.fill),void 0!==e.stroke&&i("stroke",e.stroke),void 0!==e.strokeWidth&&i("stroke-width",String(e.strokeWidth)),void 0!==e.strokeLinecap&&i("stroke-linecap",e.strokeLinecap),void 0!==e.strokeLinejoin&&i("stroke-linejoin",e.strokeLinejoin),void 0!==e.opacity&&i("opacity",String(e.opacity)),void 0!==e.viewBox&&i("viewBox",e.viewBox),void 0!==e.transform&&i("transform",e.transform);const o=[],a=e.width??e.size,l=e.height??e.size;void 0!==a&&o.push(`width:${sa(a)}`),void 0!==l&&o.push(`height:${sa(l)}`),void 0!==e.color&&o.push(`color:${e.color}`),o.push("display:inline-block"),o.push("vertical-align:middle"),e.style&&o.push(e.style),i("style",o.join(";")),e.class&&i("class",e.class);const c=e.ariaHidden??!0;return e.ariaLabel?(i("aria-label",e.ariaLabel),i("role","img")):c&&i("aria-hidden","true"),n}(L(this,Ko,"f"),n);for(const e of L(this,na,"f"))t.has(e)||L(this,Ko,"f").removeAttribute(e);j(this,na,t,"f"),j(this,ea,s,"f")}return i}render(t,e){return i}});function oa(t,e={}){return ra(t,e)}function aa(){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 la=null,ca=null,ha=null;function ua(t){la=t}function da(t){ca=t}function fa(){return ca}function pa(){return la??-(new Date).getTimezoneOffset()}function ma(){return ha??("undefined"!=typeof navigator?navigator.language:null)??"en"}function _a(t,e){const n={};for(const i 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"!==i.type&&(n[i.type]=parseInt(i.value,10));const i=24===n.hour?0:n.hour,s=Date.UTC(n.year,n.month-1,n.day,i,n.minute,n.second);return Math.round((s-e)/6e4)||0}function ga(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 ya(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 wa(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 va=t=>String(t).padStart(2,"0");function ba(t,e,n){const i={[n]:e};return ca?i.timeZone=ca:(i.timeZone="UTC",t+=6e4*pa()),new Intl.DateTimeFormat(ma(),i).format(new Date(t))}function Sa(t,e){const n=t>=0?"+":"-",i=Math.abs(t);return e?`${n}${va(Math.floor(i/60))}:${va(i%60)}`:`${n}${va(Math.floor(i/60))}${va(i%60)}`}function Ea(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 Ca(){try{const t=new Intl.Locale(ma()),e=t.weekInfo?.firstDay??t.getWeekInfo?.()?.firstDay;if(void 0!==e)return e%7}catch{}return 0}const Ma=/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|H|hh|h|mm|ss|SSS|ZZ|Z|A|a/g,ka=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function xa(t){try{const e=new Date(Date.UTC(2024,0,7+t,12,0,0));return new Intl.DateTimeFormat(ma(),{weekday:"long",timeZone:"UTC"}).format(e)}catch{return ka[t]||""}}function Aa(t){try{const e=new Date(Date.UTC(2024,t-1,15,12,0,0));return new Intl.DateTimeFormat(ma(),{month:"long",timeZone:"UTC"}).format(e)}catch{return""}}function Ra(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:i=1,hour:s=0,minute:r=0,second:o=0,ms:a=0}=t;return Date.UTC(e,n-1,i,s,r,o,a)-6e4*pa()}return NaN}function Oa(t,e,n){const i=Ea(n);if("hour"===i)return t+36e5*e;if("min"===i)return t+6e4*e;if("second"===i)return t+1e3*e;if("ms"===i)return t+e;const s=pa(),r=wa(t,s);let o=r.Y,a=r.M,l=r.D;if("year"===i)o+=e;else if("month"===i){const t=a-1+e;o+=Math.floor(t/12),a=(t%12+12)%12+1,l=Math.min(l,new Date(o,a,0).getDate())}else l+="week"===i?7*e:e;return Date.UTC(o,a-1,l,r.h,r.m,r.s,r.ms)-6e4*s}function za(t,e){const n=pa(),i=wa(t,n),s=wa(e,n);return i.Y===s.Y&&i.M===s.M&&i.D===s.D}function Ta(t){const e=pa(),n=wa(t,e);return Date.UTC(n.Y,n.M-1,n.D,0,0,0,0)-6e4*e}function Ia(t,e){const n=pa(),i=wa(t,n),s=i.h%12||12,r=[],o=e.replace(/\[([^\]]*)\]/g,(t,e)=>(r.push(e),`\0${r.length-1}\0`));Ma.lastIndex=0;return o.replace(Ma,e=>{switch(e){case"YYYY":return String(i.Y);case"YY":return String(i.Y).slice(-2);case"MMMM":return ba(t,"long","month");case"MMM":return ba(t,"short","month");case"MM":return va(i.M);case"M":return String(i.M);case"DD":return va(i.D);case"D":return String(i.D);case"dddd":return ba(t,"long","weekday");case"ddd":return ba(t,"short","weekday");case"HH":return va(i.h);case"H":return String(i.h);case"hh":return va(s);case"h":return String(s);case"mm":return va(i.m);case"ss":return va(i.s);case"SSS":return r=i.ms,String(r).padStart(3,"0");case"A":return i.h>=12?"PM":"AM";case"a":return i.h>=12?"pm":"am";case"Z":return Sa(n,!0);case"ZZ":return Sa(n,!1);default:return e}var r}).replace(/\0(\d+)\0/g,(t,e)=>r[+e])}const Pa=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]];const Da=Symbol("ts"),La=Object.create(Number.prototype);function ja(t){return function(t){const e=Object.create(La);return e[Da]=t,e}(void 0===t?Date.now():Ra(t))}function Na(t){null==t?(ua(null),da(null)):(ua(t.offset),da(t.name))}function $a(t){ua(t),da(null)}function Ua(){return pa()}function Fa(t){ha=t??null}function Va(){return ma()}function Wa(){let t;try{t=Intl.supportedValuesOf("timeZone")}catch{return[]}const e=Date.now();return t.map(t=>({name:t,longName:ya(t,e),shortName:ga(t,e),offset:_a(t,e)}))}function Ya(t){const e=t??ma(),n=new Intl.DateTimeFormat(e,{month:"long",timeZone:"UTC"}),i=new Intl.DateTimeFormat(e,{month:"short",timeZone:"UTC"}),s=[];for(let t=1;t<=12;t++){const e=new Date(Date.UTC(2024,t-1,15,12,0,0));s.push({number:t,name:n.format(e),shortName:i.format(e)})}return s}function Ha(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=ja({year:t,month:e,day:1}),{year:i,month:s,numberOfDaysOfTheMonth:r}=n.values,o=[];for(let t=wa(n.valueOf(),pa()).wd;t>0;t--)o.push(ja({year:i,month:s,day:1-t}));for(let t=1;t<=r;t++)o.push(ja({year:i,month:s,day:t}));const a=o.length%7,l=0===a?0:7-a,c=ja({year:i,month:s,day:r});for(let t=0;t<l;t++)c.add(1,"day"),o.push(ja(c.valueOf()));const h=[];for(let t=0;t<o.length;t+=7)h.push(o.slice(t,t+7));return h}Object.defineProperties(La,{valueOf:{value(){return this[Da]},writable:!1,configurable:!1},values:{get(){const t=this[Da],e=wa(t,pa());return{year:e.Y,month:e.M,monthName:Aa(e.M),dayName:xa(e.wd),date:e.D,weekStartDayName:xa(Ca()),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[Da];return Number.isFinite(t)?new Date(t).toISOString():"Invalid Date"},writable:!1,configurable:!1},toString:{value(){const t=this[Da];return Number.isFinite(t)?new Intl.DateTimeFormat(ma(),{dateStyle:"medium",...fa()?{timeZone:fa()}:{timeZone:"UTC"}}).format(new Date(fa()?t:t+6e4*pa())):"Invalid Date"},writable:!1,configurable:!1},format:{value(t){return Ia(this[Da],t)},writable:!1,configurable:!1},formatLongAgo:{value(t){return function(t,e={}){const{numeric:n="auto",style:i="long"}=e,s=((void 0!==e.now?Ra(e.now):Date.now())-t)/1e3,r=Math.abs(s),o=s>=0?-1:1,a=new Intl.RelativeTimeFormat(ma(),{numeric:n,style:i});for(const[t,e]of Pa)if(r>=e)return a.format(o*Math.round(r/e),t);return a.format(0,"second")}(this[Da],t)},writable:!1,configurable:!1},add:{value(t,e){return this[Da]=Oa(this[Da],t,e),this},writable:!1,configurable:!1},subtract:{value(t,e){return this[Da]=Oa(this[Da],-t,e),this},writable:!1,configurable:!1},isBefore:{value(t){return this[Da]<Ra(t)},writable:!1,configurable:!1},isAfter:{value(t){return this[Da]>Ra(t)},writable:!1,configurable:!1},isFuture:{value(){return this[Da]>Date.now()},writable:!1,configurable:!1},isPresent:{value(){return za(this[Da],Date.now())},writable:!1,configurable:!1},isToday:{value(){return za(this[Da],Date.now())},writable:!1,configurable:!1},isYesterday:{value(){const t=Oa(Ta(Date.now()),-1,"day");return za(this[Da],t)},writable:!1,configurable:!1},isTomorrow:{value(){const t=Oa(Ta(Date.now()),1,"day");return za(this[Da],t)},writable:!1,configurable:!1},getDifference:{value(t,e){return function(t,e,n){const i=Ea(n),s=t-e;if("ms"===i)return s;if("second"===i)return Math.trunc(s/1e3);if("min"===i)return Math.trunc(s/6e4);if("hour"===i)return Math.trunc(s/36e5);const r=pa(),o=wa(t,r),a=wa(e,r);if("day"===i||"week"===i){const n=Math.floor((t+6e4*r)/864e5)-Math.floor((e+6e4*r)/864e5);return"week"===i?Math.trunc(n/7):n}return"month"===i?12*(o.Y-a.Y)+(o.M-a.M):o.Y-a.Y}(this[Da],Ra(t),e)},writable:!1,configurable:!1},getAge:{value(t){return function(t,e){const n=pa(),i=wa(t,n),s=wa(e,n);let r=s.Y-i.Y,o=i.M,a=i.D;2===o&&29===a&&((l=s.Y)%4==0&&l%100!=0||l%400==0||(o=3,a=1));var l;return(s.M<o||s.M===o&&s.D<a)&&r--,Math.max(0,r)}(this[Da],void 0!==t?Ra(t):Date.now())},writable:!1,configurable:!1}});export{di as $,Xo as Context,Bn as Delete,xn as ErrorTypes,Fn as Fetch,$n as FetchClient,Vn as Get,ne as MA,F as NotificationManager,Hn as Patch,Wn as Post,Yn as Put,vn as Router,V as SyncNotificationManager,ie as ZeroPromise,ot as _,at as _subToView,re as action,C as addStoreBeingRead,pi as animatedIf,an as animatedRouter,mi as animatedX,xr as arrayRange,P as assertComponentOuterContext,I as assertNotInRestrictedContext,Ne as asyncAction,ze as atom,wi as attr,be as blurInPreset,Se as blurOutPreset,me as bouncePreset,ln as buildPath,On as buildRequestUrl,ur as cacheAtom,Le as cacheFn,Ar as chunk,kr as clamp,Si as classes,Z as cleanupScheduler,Nn as clearInterceptors,Ce as collapseWidthPreset,z as componentRunningStatus,Oo as computeAutoPlacement,xt as configureCSS,Le as createCacheManager,se as createManagedTimer,je as createPollingManager,Re as createReactiveRunner,Ks as createTimedAtom,ja as date,Ve as debounce,tr as debouncedAtom,Zo as deepClone,ke as deepFreeze,Qn as deleteAction,ke as df,Co as dialog,Ge as effect,J as effectScheduler,gi as eleHook,ft as event,Ee as expandWidthPreset,oe as fadeInPreset,ae as fadeOutPreset,qn as fetchAction,Un as fetchClient,we as flipInPreset,ve as flipOutPreset,wr as formAtom,br as get,Gn as getAction,Fr as getAllProps,Wa as getAllTimezones,Ha as getCalendar,Ao as getCoords,H as getCurrentHost,Va as getLocale,Ya as getMonths,Wr as getParentScope,Wr as getScope,S as getStoresBeingRead,Ua as getTimezoneOffset,Qt as globalCSS,Q as globalScheduler,ni as globalTheme,Or as groupBy,hn as hashAtom,Mi as htmlHook,Te as iAtom,ee as injectMatesAnimations,_ as installDevToolsHooks,Ln as interceptAfter,Dn as interceptBefore,jn as interceptError,Ys as isAction,An as isApiResponseSuccess,Hs as isAsyncAction,Qs as isAsyncFunction,mt as isAsyncValue,Vs as isAtom,Xs as isChannel,Gs as isConfirmationEvent,Jo as isDefinedAsGetter,g as isDevToolsInstalled,E as isEffectRunning,Pr as isEmail,zr as isEmpty,qs as isEvent,Js as isFunction,Zs as isGetter,T as isInRestrictedContext,$r as isMax,Nr as isMin,rn as isPathMatching,jr as isPattern,b as isReadTrackingEnabled,Ir as isRequired,G as isSSR,Bs as isSetter,Ws as isUnit,Tr as iterateDeeply,Jt as keyframes,Ti as lazyLoad,gn as location,en as lockNavigation,D as logError,ar as lsAtom,er as mapAtom,Ni as masonryGrid,Lr as maxLength,Ur as memo,Vi as memoTemplate,Mr as merge,Dr as minLength,yn as navigateTo,tn as navigationLocked,Er as omit,Ji as on,it as onAllMount,Kr as onBlur,st as onCleanup,po as onClickAway,Di as onConnect,ro as onCopy,oo as onCut,So as onDOMReady,Li as onDisconnect,Br as onError,fo as onFileDrop,to as onFocus,Ri as onHidden,xi as onIntersect,yo as onInterval,ao as onKeyDown,lo as onKeyUp,et as onMount,go as onNavigate,no as onOffline,eo as onOnline,nt as onPaint,ts as onParent,so as onPaste,qr as onReferenceChange,_o as onResize,mo as onScroll,zi as onScrolledIntoView,ho as onSelectionChange,vo as onSocket,uo as onStorageChange,wo as onTimeout,bo as onUpdate,co as onVisibilityChange,Ai as onVisible,Zr as onWindow,Jr as onWindowCapture,io as onWindowResize,Qr as onWindowScroll,We as paginatedAsyncAction,dr as paginationAtom,Jn as patchAction,sn as pathAtom,Sr as pick,Ro as placementTransform,k as popEffect,xo as popup,To as portal,Xn as postAction,ye as pulsePreset,M as pushEffect,Zn as putAction,pn as qsAtom,aa as randomId,Xe as ref,ut as registerCleanup,vi as removeAttr,Ei as removeClasses,Qi as removeOn,ss as removeStyle,es as renderSwitch,Ke as renderX,X as resetComponentState,_t as resolveAsyncValue,A as restoreTracking,ii as rootCSS,wn as route,oa as safeSVG,K as safetyCheck,x as saveAndEnableTracking,de as scaleInPreset,fe as scaleOutPreset,Vr as scope,nr as setAtom,Fa as setLocale,Ze as setRef,En as setSSRApiLookup,q as setSSRMode,Cn as setSSRRequest,Na as setTimezone,$a as setTimezoneOffset,rt as setter,ge as shakePreset,Te as signal,ce as slideInPreset,he as slideOutPreset,pe as spinPreset,_e as springInPreset,lr as ssAtom,R as startTracking,O as stopTracking,is as style,Bt as stylesheet,Ie as superAtom,Ye as taskAction,_r as themeAtom,He as throttle,cr as throttledAtom,os as timer,Yo as tip,hr as titleAtom,Wo as tooltip,xe as trackAndSubscribe,Rr as uniqBy,nn as unlockNavigation,oa as unsafeSVG,gt as unwrapModule,ht as useContext,Vr as useScope,Hr as useState,lt as useStore,aa as uuid,vr as validateAll,Ae as validateReactiveFunction,Qe as view,$s as virtualGrid,Ns as virtualList,Us as virtualMasonry,ct as watch,Y as withHost,Me as withStaggerPreset,Go as ws,Je as x,dt as xTabEvent};
|
|
118
118
|
//# sourceMappingURL=index.esm.js.map
|