@vireo-ai/trellis-ui 0.1.5 → 0.1.7
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/package.json +29 -19
- package/src/components/app/styles.css +30 -0
- package/src/styles/components.css +21 -0
- package/src/styles/generated-sources.css +3 -0
- package/src/styles/static.css +2 -0
- package/src/{theme.css → styles/theme.css} +2 -8
- package/trellis_ui/static/trellis_ui/{css/styles.css → assets/css/trellis.css} +14 -612
- package/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +2 -0
- package/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cally-TZl4LpyH.js.map +1 -0
- package/trellis_ui/static/trellis_ui/assets/js/esm/index.js.map +1 -0
- package/trellis_ui/static/trellis_ui/{js/index.js → assets/js/trellis.js} +1 -1
- package/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +10 -0
- package/types/cdn.d.ts +5 -0
- package/src/components.css +0 -20
- package/trellis_ui/static/trellis_ui/js/esm/chunks/cally-TZl4LpyH.js.map +0 -1
- package/trellis_ui/static/trellis_ui/js/esm/index.js.map +0 -1
- /package/trellis_ui/static/trellis_ui/{js → assets/js}/esm/chunks/cally-TZl4LpyH.js +0 -0
- /package/trellis_ui/static/trellis_ui/{js → assets/js}/esm/index.js +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var TrellisUI=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.defineProperty,n=(e,t)=>()=>(e&&(t=e(e=0)),t),r=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),i=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},a={headers:{},mergeStrategy:`replace`,transitions:!1,mapDelimiter:`:`},o=()=>{console.error(`You can't use the "morph" merge without first installing the Alpine "morph" plugin here: https://alpinejs.dev/plugins/morph`)};function s(e){e.morph&&(o=e.morph),e.addInitSelector(()=>`[${e.prefixed(`target`)}]`),e.addInitSelector(()=>`[${e.prefixed(`target\\.push`)}]`),e.addInitSelector(()=>`[${e.prefixed(`target\\.replace`)}]`),e.directive(`target`,(e,{value:t,modifiers:n,expression:r},{evaluateLater:i,effect:a})=>{let o=t=>{e._ajax_target=e._ajax_target||{};let r={ids:x(e,t),sync:!0,focus:!n.includes(`nofocus`),history:n.includes(`push`)?`push`:n.includes(`replace`)?`replace`:!1},i=n.filter(e=>[`back`,`away`,`error`].includes(e)||parseInt(e));i=i.length?i:[`xxx`],i.forEach(t=>{t.charAt(0)===`3`&&(t=`3xx`),e._ajax_target[t]=r})};if(t===`dynamic`){let e=i(r);a(()=>e(o))}else o(r)}),e.directive(`headers`,(e,{expression:t},{evaluateLater:n,effect:r})=>{let i=n(t||`{}`);r(()=>{i(t=>{e._ajax_headers=t})})}),e.addInitSelector(()=>`[${e.prefixed(`merge`)}]`),e.addInitSelector(()=>`[${e.prefixed(`merge\\.transition`)}]`),e.directive(`merge`,(e,{value:t,modifiers:n,expression:r},{evaluateLater:i,effect:o})=>{let s=t=>{e._ajax_strategy=t,e._ajax_transition=a.transitions||n.includes(`transition`)};if(t===`dynamic`){let e=i(r);o(()=>e(s))}else s(r)}),e.magic(`ajax`,e=>async(t,n={})=>{let r={el:e,target:{xxx:{ids:x(e,n.targets||n.target),sync:!!n.sync,history:`history`in n?n.history:!1,focus:`focus`in n?n.focus:!0}},headers:n.headers||{}},i=n.method?n.method.toUpperCase():`GET`,a=n.body;return h(r,t,i,a)});let t=!1;e.ajax={start(){t||=(document.addEventListener(`submit`,d),document.addEventListener(`click`,u),window.addEventListener(`popstate`,l),!0)},configure:s.configure,stop(){document.removeEventListener(`submit`,d),document.removeEventListener(`click`,u),window.removeEventListener(`popstate`,l),t=!1}},e.ajax.start()}s.configure=e=>(a=Object.assign(a,e),s);var c=s;function l(e){!e.state||!e.state.__ajax||window.location.reload(!0)}async function u(e){if(e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=e?.target.closest(`a[href]:not([download]):not([noajax])`);if(!t||!t._ajax_target||t.isContentEditable||t.origin!==window.location.origin||t.getAttribute(`href`).startsWith(`#`)||t.hash&&C(t,new URL(document.baseURI)))return;e.preventDefault(),e.stopImmediatePropagation();let n={el:t,target:t._ajax_target,headers:t._ajax_headers||{}},r=t.getAttribute(`href`);try{return await h(n,r)}catch(e){if(e.name===`RenderError`){console.warn(e.message),window.location.href=t.href;return}throw e}}async function d(e){if(e.defaultPrevented)return;let t=e.target,n=e.submitter,r=(n?.getAttribute(`formmethod`)||t.getAttribute(`method`)||`GET`).toUpperCase();if(!t||!t._ajax_target||r===`DIALOG`||n?.hasAttribute(`formnoajax`)||n?.hasAttribute(`formtarget`)||t.hasAttribute(`noajax`)||t.hasAttribute(`target`))return;e.preventDefault(),e.stopImmediatePropagation();let i={el:t,target:t._ajax_target,headers:t._ajax_headers||{}},a=new FormData(t),o=t.getAttribute(`enctype`),s=t.getAttribute(`action`);n&&(o=n.getAttribute(`formenctype`)||o,s=n.getAttribute(`formaction`)||s,n.name&&a.append(n.name,n.value));try{return await f(n,()=>h(i,s,r,a,o))}catch(e){if(e.name===`RenderError`){console.warn(e.message),t.setAttribute(`noajax`,`true`),t.requestSubmit(n);return}throw e}}async function f(e,t){if(!e)return await t();let n=e=>e.preventDefault();e.setAttribute(`aria-disabled`,`true`),e.addEventListener(`click`,n);let r;try{r=await t()}finally{e.removeAttribute(`aria-disabled`),e.removeEventListener(`click`,n)}return r}var p={store:new Map,plan(e,t){if(e.ids.forEach(e=>{let n=e[0],r=[`_self`,`_top`,`_none`].includes(n)?document.documentElement:document.getElementById(n);if(!r)return console.warn(`Target [#${n}] was not found in current document.`);r._ajax_id=e[1],this.set(r,t)}),e.sync){let n=e.ids.flat();document.querySelectorAll(`[x-sync]`).forEach(e=>{let r=e.getAttribute(`id`);if(!r)throw new T(e);n.includes(r)||(e._ajax_id=r,e._ajax_sync=!0,this.set(e,t))})}},purge(e){this.store.forEach((t,n)=>e===t&&this.delete(n))},get(e){let t=[];return this.store.forEach((n,r)=>e===n&&t.push(r)),t},set(e,t){e.querySelectorAll(`[aria-busy]`).forEach(e=>{this.delete(e)}),e.setAttribute(`aria-busy`,`true`),this.store.set(e,t)},delete(e){e.removeAttribute(`aria-busy`),this.store.delete(e)}},m=new Map;async function h(e,t=``,n=`GET`,r=null,i=`application/x-www-form-urlencoded`){if(!S(e.el,`ajax:before`))return;let o=e.target.xxx,s={ok:!1,redirected:!1,url:``,status:``,html:``,raw:``};p.plan(o,s);let c=new URL(e.el.closest(`[data-source]`)?.dataset.source||``,document.baseURI);t=new URL(t||c,document.baseURI),r&&(r=g(r),n===`GET`?(t.search=_(r).toString(),r=null):i!==`multipart/form-data`&&r instanceof FormData?r=_(r):i=null);let l={action:t.toString(),method:n,body:r,enctype:i,referrer:c.toString(),headers:Object.assign({"X-Alpine-Request":!0,"X-Alpine-Target":p.get(s).map(e=>e._ajax_id).join(` `)},a.headers,e.headers)};l.enctype||delete l.enctype,S(e.el,`ajax:send`,l);let u;if(l.method===`GET`&&m.has(l.action)?u=m.get(l.action):(u=fetch(l.action,l).then(async e=>{let t=await e.text();return e.html=document.createRange().createContextualFragment(`<template>`+t+`</template>`).firstElementChild.content,e.raw=t,e}),m.set(l.action,u)),await u.then(e=>{s.ok=e.ok,s.redirected=e.redirected,s.url=e.url,s.status=e.status,s.html=e.html,s.raw=e.raw,s.headers=e.headers}),s.ok?(s.redirected&&(S(e.el,`ajax:redirect`,s),m.set(s.url,u),setTimeout(()=>{m.delete(s.url)},5)),S(e.el,`ajax:success`,s)):S(e.el,`ajax:error`,s),S(e.el,`ajax:sent`,s),m.delete(l.action),!s.html){p.purge(s);return}let d=s.redirected?`3xx`:s.status.toString(),f=C(new URL(s.url),new URL(l.referrer,document.baseURI)),h=[s.redirected?f?`back`:`away`:null,d,d.charAt(0)+`xx`,s.ok?`xxx`:`error`,`xxx`].find(t=>t in e.target);h!==`xxx`&&(o=e.target[h],(!s.redirected||!f||!o.ids.flat().includes(`_self`))&&(p.purge(s),p.plan(o,s))),o.history&&b(o.history,s.url);let x=!o.focus,w=p.get(s).map(async t=>{if(!t.isConnected||t._ajax_id===`_none`){p.delete(t);return}if(t===document.documentElement){window.location.href=s.url;return}let n=s.html.getElementById(t._ajax_id);if(!n){if(t._ajax_sync||!S(e.el,`ajax:missing`,{target:t,response:s}))return;if(s.ok)return t.remove();throw new ee(t,s.status)}let r=t._ajax_strategy||a.mergeStrategy,i=async()=>{if(t=await v(r,t,n),t){t.dataset.source=s.url,p.delete(t);let e=[`[x-autofocus]`,`[autofocus]`];for(;!x&&e.length;){let n=e.shift();t.matches(n)&&(x=y(t)),x||=Array.from(t.querySelectorAll(n)).some(e=>y(e))}}return S(t,`ajax:merged`),t};if(S(t,`ajax:merge`,{strategy:r,content:n,merge:i}))return i()}),T=await Promise.all(w);return e.el&&e.el.isConnected?S(e.el,`ajax:after`,{response:s,render:T}):S(window,`ajax:after`,{response:s,render:T}),T}function g(e){if(e instanceof FormData)return e;if(e instanceof HTMLFormElement)return new FormData(e);if(typeof e==`string`||e instanceof ArrayBuffer||e instanceof DataView||e instanceof Blob||e instanceof File||e instanceof URLSearchParams||e instanceof ReadableStream)return e;let t=new FormData;for(let n in e)typeof e[n]==`object`?t.append(n,JSON.stringify(e[n])):t.append(n,e[n]);return t}function _(e){let t=Array.from(e.entries()).filter(([e,t])=>!(t instanceof File));return new URLSearchParams(t)}async function v(e,t,n){let r={before(e,t){return e.before(...t.childNodes),e},replace(e,t){return e.replaceWith(t),t},update(e,t){return e.replaceChildren(...t.childNodes),e},prepend(e,t){return e.prepend(...t.childNodes),e},append(e,t){return e.append(...t.childNodes),e},after(e,t){return e.after(...t.childNodes),e},morph(e,t){return o(e,t),document.getElementById(t.getAttribute(`id`))}};return!t._ajax_transition||!document.startViewTransition?r[e](t,n):(await document.startViewTransition(()=>(t=r[e](t,n),Promise.resolve())).updateCallbackDone,t)}function y(e){return!e||!e.getClientRects().length?!1:(setTimeout(()=>{e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`0`),e.focus()},0),!0)}function b(e,t){return{push:()=>window.history.pushState({__ajax:!0},``,t),replace:()=>window.history.replaceState({__ajax:!0},``,t)}[e]()}function x(e,t=null){let n=e.getAttribute(`id`),r=[n];if(t&&(r=Array.isArray(t)?t:t.split(` `)),r=r.filter(e=>e).map(e=>{let t=e.split(a.mapDelimiter).map(e=>e||n);return t[1]=t[1]||t[0],t}),r.length===0)throw new T(e);return r}function S(e,t,n){return e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function C(e,t){return w(e.pathname)===w(t.pathname)}function w(e){return e.replace(/\/$/,``)}var T=class extends DOMException{constructor(e){let t=(e.outerHTML.match(/<[^>]+>/)??[])[0]??`[Element]`;super(`${t} is missing an ID to target.`,`IDError`)}},ee=class extends DOMException{constructor(e,t){let n=e.getAttribute(`id`);super(`Target [#${n}] was not found in response with status [${t}].`,`RenderError`)}},te=c;function ne(e,t,n){fe();let r=ie(n),i=typeof t==`string`?ce(t):t;return window.Alpine&&window.Alpine.closestDataStack&&!e._x_dataStack&&(i._x_dataStack=window.Alpine.closestDataStack(e),i._x_dataStack&&window.Alpine.cloneNode(e,i)),r.patch(e,i),e}function re(e,t,n,r={}){fe();let i=ie(r),a=e.parentNode,o=new ue(e,t),s=typeof n==`string`?(()=>{let e=document.createElement(`div`);return e.insertAdjacentHTML(`beforeend`,n),e})():n,c=document.createComment(`[morph-start]`),l=document.createComment(`[morph-end]`);s.insertBefore(c,s.firstChild),s.appendChild(l);let u=new ue(c,l);window.Alpine&&window.Alpine.closestDataStack&&(s._x_dataStack=window.Alpine.closestDataStack(a),s._x_dataStack&&window.Alpine.cloneNode(a,s)),i.patchChildren(o,u)}function ie(e={}){let t=e=>e.getAttribute(`key`),n=()=>{},r={key:e.key||t,lookahead:e.lookahead||!1,updating:e.updating||n,updated:e.updated||n,removing:e.removing||n,removed:e.removed||n,adding:e.adding||n,added:e.added||n};return r.patch=function(e,t){if(r.differentElementNamesTypesOrKeys(e,t))return r.swapElements(e,t);let n=!1,i=!1;if(!oe(r.updating,()=>i=!0,e=>r.skipUntilCondition=e,e,t,()=>n=!0)){if(e.nodeType===1&&window.Alpine&&(window.Alpine.cloneNode(e,t),e._x_teleport&&t._x_teleport&&r.patch(e._x_teleport,t._x_teleport)),le(t)){r.patchNodeValue(e,t),r.updated(e,t);return}n||r.patchAttributes(e,t),r.updated(e,t),i||r.patchChildren(e,t)}},r.differentElementNamesTypesOrKeys=function(e,t){return e.nodeType!=t.nodeType||e.nodeName!=t.nodeName||r.getKey(e)!=r.getKey(t)},r.swapElements=function(e,t){if(ae(r.removing,e))return;let n=t.cloneNode(!0);ae(r.adding,n)||(e.replaceWith(n),r.removed(e),r.added(n))},r.patchNodeValue=function(e,t){let n=t.nodeValue;e.nodeValue!==n&&(e.nodeValue=n)},r.patchAttributes=function(e,t){if(e._x_transitioning||e._x_isShown&&!t._x_isShown||!e._x_isShown&&t._x_isShown)return;let n=Array.from(e.attributes),r=Array.from(t.attributes);for(let r=n.length-1;r>=0;r--){let i=n[r].name;t.hasAttribute(i)||(i===`open`&&e.nodeName===`DIALOG`&&e.open?e.close():e.removeAttribute(i))}for(let t=r.length-1;t>=0;t--){let n=r[t].name,i=r[t].value;e.getAttribute(n)!==i&&e.setAttribute(n,i)}},r.patchChildren=function(e,t){let n=r.keyToMap(e.children),i={},a=de(t),o=de(e);for(;a;){pe(a,o);let s=r.getKey(a),c=r.getKey(o);if(r.skipUntilCondition){let n=!o||r.skipUntilCondition(o),i=!a||r.skipUntilCondition(a);if(n&&i)r.skipUntilCondition=null;else{n||(o&&=E(e,o)),i||(a&&=E(t,a));continue}}if(!o)if(s&&i[s]){let t=i[s];e.appendChild(t),o=t,c=r.getKey(o)}else{if(!ae(r.adding,a)){let t=a.cloneNode(!0);e.appendChild(t),r.added(t)}a=E(t,a);continue}let l=e=>e&&e.nodeType===8&&e.textContent===`[if BLOCK]><![endif]`,u=e=>e&&e.nodeType===8&&e.textContent===`[if ENDBLOCK]><![endif]`;if(l(a)&&l(o)){let n=0,i=o;for(;o;){let t=E(e,o);if(l(t))n++;else if(u(t)&&n>0)n--;else if(u(t)&&n===0){o=t;break}o=t}let s=o;n=0;let c=a;for(;a;){let e=E(t,a);if(l(e))n++;else if(u(e)&&n>0)n--;else if(u(e)&&n===0){a=e;break}a=e}let d=a,f=new ue(i,s),p=new ue(c,d);r.patchChildren(f,p);continue}if(o.nodeType===1&&r.lookahead&&!o.isEqualNode(a)){let n=E(t,a),i=!1;for(;!i&&n;)n.nodeType===1&&o.isEqualNode(n)&&(i=!0,o=r.addNodeBefore(e,a,o),c=r.getKey(o)),n=E(t,n)}if(s!==c){if(!s&&c){i[c]=o,o=r.addNodeBefore(e,a,o),i[c].remove(),o=E(e,o),a=E(t,a);continue}if(s&&!c&&n[s]&&(o.replaceWith(n[s]),o=n[s],c=r.getKey(o)),s&&c){let l=n[s];if(l)i[c]=o,o.replaceWith(l),o=l,c=r.getKey(o);else{i[c]=o,o=r.addNodeBefore(e,a,o),i[c].remove(),o=E(e,o),a=E(t,a);continue}}}let d=o&&E(e,o);r.patch(o,a),a&&=E(t,a),o=d}let s=[];for(;o;)ae(r.removing,o)||s.push(o),o=E(e,o);for(;s.length;){let e=s.shift();e.remove(),r.removed(e)}},r.getKey=function(e){return e&&e.nodeType===1&&r.key(e)},r.keyToMap=function(e){let t={};for(let n of e){let e=r.getKey(n);e&&(t[e]=n)}return t},r.addNodeBefore=function(e,t,n){if(!ae(r.adding,t)){let i=t.cloneNode(!0);return e.insertBefore(i,n),r.added(i),i}return t},r}ne.step=()=>{},ne.log=()=>{};function ae(e,...t){let n=!1;return e(...t,()=>n=!0),n}function oe(e,t,n,...r){let i=!1;return e(...r,()=>i=!0,t,n),i}var se=!1;function ce(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content.firstElementChild}function le(e){return e.nodeType===3||e.nodeType===8}var ue=class{constructor(e,t){this.startComment=e,this.endComment=t}get children(){let e=[],t=this.startComment.nextSibling;for(;t&&t!==this.endComment;)e.push(t),t=t.nextSibling;return e}appendChild(e){this.endComment.before(e)}get firstChild(){let e=this.startComment.nextSibling;if(e!==this.endComment)return e}nextNode(e){let t=e.nextSibling;if(t!==this.endComment)return t}insertBefore(e,t){return t.before(e),e}};function de(e){return e.firstChild}function E(e,t){let n;return n=e instanceof ue?e.nextNode(t):t.nextSibling,n}function fe(){if(se)return;se=!0;let e=Element.prototype.setAttribute,t=document.createElement(`div`);Element.prototype.setAttribute=function(n,r){if(!n.includes(`@`))return e.call(this,n,r);t.innerHTML=`<span ${n}="${r.replace(/&/g,`&`).replace(/"/g,`"`)}"></span>`;let i=t.firstElementChild.getAttributeNode(n);t.firstElementChild.removeAttributeNode(i),this.setAttributeNode(i)}}function pe(e,t){let n=t&&t._x_bindings&&t._x_bindings.id;n&&e.setAttribute&&(e.setAttribute(`id`,n),e.id=n)}function me(e){e.morph=ne,e.morphBetween=re}var he=me,ge=e=>{e.bind(`UiDisclosureRoot`,function(){let e=this;return{":data-state"(){return e.isOpen?`open`:`closed`}}}),e.bind(`UiDisclosureTrigger`,function(){let e=this;return{type:`button`,":id"(){return e.triggerId},":aria-controls"(){return e.contentId},":aria-expanded"(){return e.isOpen?`true`:`false`},":data-state"(){return e.isOpen?`open`:`closed`},"@click"(t){e.toggle(t)},"@keydown.enter.prevent"(t){e.toggle(t)},"@keydown.space.prevent"(t){e.toggle(t)},"@keydown.escape.stop"(t){e.close(t)}}}),e.bind(`UiDisclosureContent`,function(){let e=this;return{":id"(){return e.contentId},":data-state"(){return e.isOpen?`open`:`closed`},"@keydown.escape.stop"(t){e.close(t)}}})};function _e(e,t){e.indexOf(t)===-1&&e.push(t)}function ve(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var ye=(e,t,n)=>n>t?t:n<e?e:n;function be(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var xe={},Se=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ce=e=>typeof e==`object`&&!!e,we=e=>/^0[^.\s]+$/u.test(e);function Te(e){let t;return()=>(t===void 0&&(t=e()),t)}var Ee=e=>e,De=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Oe=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ke=class{constructor(){this.subscriptions=[]}add(e){return _e(this.subscriptions,e),()=>ve(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},D=e=>e*1e3,O=e=>e/1e3,Ae=(e,t)=>t?1e3/t*e:0,je=new Set;function Me(e,t,n){e||je.has(t)||(console.warn(be(t,n)),je.add(t))}var Ne=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},Pe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Fe=1e-7,Ie=12;function Le(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Pe(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Fe&&++s<Ie);return o}function Re(e,t,n,r){if(e===t&&n===r)return Ee;let i=t=>Le(t,0,1,e,n);return e=>e===0||e===1?e:Pe(i(e),t,r)}var ze=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Be=e=>t=>1-e(1-t),Ve=Re(.33,1.53,.69,.99),He=Be(Ve),Ue=ze(He),We=e=>e>=1?1:(e*=2)<1?.5*He(e):.5*(2-2**(-10*(e-1))),Ge=e=>1-Math.sin(Math.acos(e)),Ke=Be(Ge),qe=ze(Ge),Je=Re(.42,0,1,1),Ye=Re(0,0,.58,1),Xe=Re(.42,0,.58,1),Ze=e=>Array.isArray(e)&&typeof e[0]!=`number`;function Qe(e,t){return Ze(e)?e[Ne(0,e.length,t)]:e}var $e=e=>Array.isArray(e)&&typeof e[0]==`number`,et={linear:Ee,easeIn:Je,easeInOut:Xe,easeOut:Ye,circIn:Ge,circInOut:qe,circOut:Ke,backIn:He,backInOut:Ue,backOut:Ve,anticipate:We},tt=e=>typeof e==`string`,nt=e=>{if($e(e)){e.length;let[t,n,r,i]=e;return Re(t,n,r,i)}else if(tt(e))return et[e],`${e}`,et[e];return e},rt=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function it(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var at=40;function ot(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=rt.reduce((e,t)=>(e[t]=it(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=xe.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,at),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:rt.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<rt.length;t++)o[rt[t]].cancel(e)},state:i,steps:o}}var{schedule:st,cancel:ct,state:lt,steps:ut}=ot(typeof requestAnimationFrame<`u`?requestAnimationFrame:Ee,!0),dt;function ft(){dt=void 0}var k={now:()=>(dt===void 0&&k.set(lt.isProcessing||xe.useManualTiming?lt.timestamp:performance.now()),dt),set:e=>{dt=e,queueMicrotask(ft)}},pt=e=>t=>typeof t==`string`&&t.startsWith(e),mt=pt(`--`),ht=pt(`var(--`),gt=e=>ht(e)?_t.test(e.split(`/*`)[0].trim()):!1,_t=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vt(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var yt={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},bt={...yt,transform:e=>ye(0,1,e)},xt={...yt,default:1},St=e=>Math.round(e*1e5)/1e5,Ct=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wt(e){return e==null}var Tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Et=(e,t)=>n=>!!(typeof n==`string`&&Tt.test(n)&&n.startsWith(e)||t&&!wt(n)&&Object.prototype.hasOwnProperty.call(n,t)),Dt=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Ct);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Ot=e=>ye(0,255,e),kt={...yt,transform:e=>Math.round(Ot(e))},At={test:Et(`rgb`,`red`),parse:Dt(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+kt.transform(e)+`, `+kt.transform(t)+`, `+kt.transform(n)+`, `+St(bt.transform(r))+`)`};function jt(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Mt={test:Et(`#`),parse:jt,transform:At.transform},Nt=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pt=Nt(`deg`),Ft=Nt(`%`),A=Nt(`px`),It=Nt(`vh`),Lt=Nt(`vw`),Rt={...Ft,parse:e=>Ft.parse(e)/100,transform:e=>Ft.transform(e*100)},zt={test:Et(`hsl`,`hue`),parse:Dt(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Ft.transform(St(t))+`, `+Ft.transform(St(n))+`, `+St(bt.transform(r))+`)`},j={test:e=>At.test(e)||Mt.test(e)||zt.test(e),parse:e=>At.test(e)?At.parse(e):zt.test(e)?zt.parse(e):Mt.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?At.transform(e):zt.transform(e),getAnimatableNone:e=>{let t=j.parse(e);return t.alpha=0,j.transform(t)}},Bt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Vt(e){return isNaN(e)&&typeof e==`string`&&(e.match(Ct)?.length||0)+(e.match(Bt)?.length||0)>0}var Ht=`number`,Ut=`color`,Wt=`var`,Gt=`var(`,Kt="${}",qt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Jt(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(qt,e=>(j.test(e)?(r.color.push(a),i.push(Ut),n.push(j.parse(e))):e.startsWith(Gt)?(r.var.push(a),i.push(Wt),n.push(e)):(r.number.push(a),i.push(Ht),n.push(parseFloat(e))),++a,Kt)).split(Kt),indexes:r,types:i}}function Yt(e){return Jt(e).values}function Xt({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===Ht?i+=St(r[a]):e===Ut?i+=j.transform(r[a]):i+=r[a]}return i}}function Zt(e){return Xt(Jt(e))}var Qt=e=>typeof e==`number`?0:j.test(e)?j.getAnimatableNone(e):e,$t=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Qt(e);function en(e){let t=Jt(e);return Xt(t)(t.values.map((e,n)=>$t(e,t.split[n])))}var M={test:Vt,parse:Yt,createTransformer:Zt,getAnimatableNone:en};function tn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function nn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=tn(s,r,e+1/3),a=tn(s,r,e),o=tn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function rn(e,t){return n=>n>0?t:e}var an=(e,t,n)=>e+(t-e)*n,on=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},sn=[Mt,At,zt],cn=e=>sn.find(t=>t.test(e));function ln(e){let t=cn(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===zt&&(n=nn(n)),n}var un=(e,t)=>{let n=ln(e),r=ln(t);if(!n||!r)return rn(e,t);let i={...n};return e=>(i.red=on(n.red,r.red,e),i.green=on(n.green,r.green,e),i.blue=on(n.blue,r.blue,e),i.alpha=an(n.alpha,r.alpha,e),At.transform(i))},dn=new Set([`none`,`hidden`]);function fn(e,t){return dn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function pn(e,t){return n=>an(e,t,n)}function mn(e){return typeof e==`number`?pn:typeof e==`string`?gt(e)?rn:j.test(e)?un:vn:Array.isArray(e)?hn:typeof e==`object`?j.test(e)?un:gn:rn}function hn(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>mn(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function gn(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=mn(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function _n(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var vn=(e,t)=>{let n=M.createTransformer(t),r=Jt(e),i=Jt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?dn.has(e)&&!i.values.length||dn.has(t)&&!r.values.length?fn(e,t):De(hn(_n(r,i),i.values),n):(`${e}${t}`,rn(e,t))};function yn(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?an(e,t,n):mn(e)(e,t)}var bn=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>st.update(t,e),stop:()=>ct(t),now:()=>lt.isProcessing?lt.timestamp:k.now()}},xn=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Sn=2e4;function Cn(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function wn(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Cn(r),Sn);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:O(i)}}var N={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Tn(e,t){return e*Math.sqrt(1-t*t)}var En=12;function Dn(e,t,n){let r=n;for(let n=1;n<En;n++)r-=e(r)/t(r);return r}var On=.001;function kn({duration:e=N.duration,bounce:t=N.bounce,velocity:n=N.velocity,mass:r=N.mass}){let i,a;N.maxDuration;let o=1-t;o=ye(N.minDamping,N.maxDamping,o),e=ye(N.minDuration,N.maxDuration,O(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Tn(t,o),c=Math.exp(-i);return On-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Tn(t**2,o);return(-i(t)+On>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Dn(i,a,s);if(e=D(e),isNaN(c))return{stiffness:N.stiffness,damping:N.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var An=[`duration`,`bounce`],jn=[`stiffness`,`damping`,`mass`];function Mn(e,t){return t.some(t=>e[t]!==void 0)}function Nn(e){let t={velocity:N.velocity,stiffness:N.stiffness,damping:N.damping,mass:N.mass,isResolvedFromDuration:!1,...e};if(!Mn(e,jn)&&Mn(e,An))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*ye(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:N.mass,stiffness:i,damping:a}}else{let n=kn({...e,velocity:0});t={...t,...n,mass:N.mass},t.isResolvedFromDuration=!0}return t}function Pn(e=N.visualDuration,t=N.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Nn({...n,velocity:-O(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=O(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?N.restSpeed.granular:N.restSpeed.default,i||=v?N.restDelta.granular:N.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Tn(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>D(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=D(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=D(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Cn(T),Sn),t=xn(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Pn.applyToOptions=e=>{let t=wn(e,100,Pn);return e.ease=t.ease,e.duration=D(t.duration),e.type=`keyframes`,e};var Fn=5;function In(e,t,n){let r=Math.max(t-Fn,0);return Ae(n-e(r),t-r)}function Ln({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Pn({keyframes:[f.value,m(f.value)],velocity:In(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Rn(e,t,n){let r=[],i=n||xe.mix||yn,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=De(Array.isArray(t)?t[n]||Ee:t,a)),r.push(a)}return r}function zn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Rn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Oe(e[r],e[r+1],n);return s[r](i)};return n?t=>l(ye(e[0],e[a-1],t)):l}function Bn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Oe(0,t,r);e.push(an(n,1,i))}}function Vn(e){let t=[0];return Bn(t,e.length-1),t}function Hn(e,t){return e.map(e=>e*t)}function Un(e,t){return e.map(()=>t||Xe).splice(0,e.length-1)}function Wn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Ze(r)?r.map(nt):nt(r),a={done:!1,value:t[0]},o=zn(Hn(n&&n.length===t.length?n:Vn(t),e),t,{ease:Array.isArray(i)?i:Un(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Gn=e=>e!==null;function Kn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Gn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var qn={decay:Ln,inertia:Ln,tween:Wn,keyframes:Wn,spring:Pn};function Jn(e){typeof e.type==`string`&&(e.type=qn[e.type])}var Yn=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Xn=e=>e/100,Zn=class extends Yn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==k.now()&&this.tick(k.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Jn(e);let{type:t=Wn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Wn;s!==Wn&&typeof o[0]!=`number`&&(this.mixKeyframes=De(Xn,yn(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Cn(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=ye(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Ln&&(b.value=Kn(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return O(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+O(e)}get time(){return O(this.currentTime)}set time(e){e=D(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return In(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(k.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=O(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=bn,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(k.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Qn(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var $n=e=>e*180/Math.PI,er=e=>nr($n(Math.atan2(e[1],e[0]))),tr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:er,rotateZ:er,skewX:e=>$n(Math.atan(e[1])),skewY:e=>$n(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},nr=e=>(e%=360,e<0&&(e+=360),e),rr=er,ir=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ar=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),or={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ir,scaleY:ar,scale:e=>(ir(e)+ar(e))/2,rotateX:e=>nr($n(Math.atan2(e[6],e[5]))),rotateY:e=>nr($n(Math.atan2(-e[2],e[0]))),rotateZ:rr,rotate:rr,skewX:e=>$n(Math.atan(e[4])),skewY:e=>$n(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function sr(e){return+!!e.includes(`scale`)}function cr(e,t){if(!e||e===`none`)return sr(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=or,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=tr,i=t}if(!i)return sr(t);let a=r[t],o=i[1].split(`,`).map(ur);return typeof a==`function`?a(o):o[a]}var lr=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return cr(n,t)};function ur(e){return parseFloat(e.trim())}var dr=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],fr=new Set([...dr,`pathRotation`]),pr=e=>e===yt||e===A,mr=new Set([`x`,`y`,`z`]),hr=dr.filter(e=>!mr.has(e));function gr(e){let t=[];return hr.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var _r={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>cr(t,`x`),y:(e,{transform:t})=>cr(t,`y`)};_r.translateX=_r.x,_r.translateY=_r.y;var vr=new Set,yr=!1,br=!1,xr=!1;function Sr(){if(br){let e=Array.from(vr).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=gr(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}br=!1,yr=!1,vr.forEach(e=>e.complete(xr)),vr.clear()}function Cr(){vr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(br=!0)})}function wr(){xr=!0,Cr(),Sr(),xr=!1}var Tr=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(vr.add(this),yr||(yr=!0,st.read(Cr),st.resolveKeyframes(Sr))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Qn(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),vr.delete(this)}cancel(){this.state===`scheduled`&&(vr.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Er=e=>e.startsWith(`--`);function Dr(e,t,n){Er(t)?e.style.setProperty(t,n):e.style[t]=n}var Or={};function kr(e,t){let n=Te(e);return()=>Or[t]??n()}var Ar=kr(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),jr=kr(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Mr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Nr={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Mr([0,.65,.55,1]),circOut:Mr([.55,0,1,.45]),backIn:Mr([.31,.01,.66,-.59]),backOut:Mr([.33,1.53,.69,.99])};function Pr(e,t){if(e)return typeof e==`function`?jr()?xn(e,t):`ease-out`:$e(e)?Mr(e):Array.isArray(e)?e.map(e=>Pr(e,t)||Nr.easeOut):Nr[e]}function Fr(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Pr(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Ir(e){return typeof e==`function`&&`applyToOptions`in e}function Lr({type:e,...t}){return Ir(e)&&jr()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Rr=class extends Yn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Lr(e);this.animation=Fr(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Kn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Dr(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return O(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+O(e)}get time(){return O(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=D(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Ar()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Ee):r(this)}},zr={anticipate:We,backInOut:Ue,circInOut:qe};function Br(e){return e in zr}function Vr(e){typeof e.ease==`string`&&Br(e.ease)&&(e.ease=zr[e.ease])}var Hr=10,Ur=class extends Rr{constructor(e){Vr(e),Jn(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Zn({...a,autoplay:!1}),s=Math.max(Hr,k.now()-this.startTime),c=ye(0,Hr,s-Hr),l=o.sample(s).value,{name:u}=this.options;i&&u&&Dr(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Wr=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(M.test(e)||e===`0`)&&!e.startsWith(`url(`));function Gr(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Kr(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Wr(i,t),s=Wr(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Gr(e)||(n===`spring`||Ir(n))&&r}function qr(e){e.duration=0,e.type=`keyframes`}var Jr=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Yr=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Xr(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Yr.test(e[t]))return!0;return!1}var Zr=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Qr=Te(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function $r(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return Qr()&&n&&(Jr.has(n)||Zr.has(n)&&Xr(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var ei=40,ti=class extends Yn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=k.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Tr;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=k.now();let u=!0;Kr(e,i,a,o)||(u=!1,(xe.instantAnimations||!s)&&l?.(Kn(e,n,t)),e[0]=e[e.length-1],qr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>ei?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&$r(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Ur({...d,element:p})}catch{m=new Zn(d)}else m=new Zn(d);m.finished.then(()=>{this.notifyFinished()}).catch(Ee),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),wr()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},ni=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return ri(this.animations,`duration`)}get iterationDuration(){return ri(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function ri(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var ii=class extends ni{then(e,t){return this.finished.finally(e).then(()=>{})}},ai=class extends Rr{constructor(e){super(),this.animation=e,e.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}},oi=30,si=e=>!isNaN(parseFloat(e)),ci={current:void 0},li=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=k.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=k.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=si(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new ke);let n=this.events[e].add(t);return e===`change`?()=>{n(),st.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return ci.current&&ci.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=k.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>oi)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,oi);return Ae(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function ui(e,t){return new li(e,t)}function di(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function fi(e,t){let n=e?.[t]??e?.default??e;return n===e?n:di(n,e)}var pi={type:`spring`,stiffness:500,damping:25,restSpeed:10},mi=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),hi={type:`keyframes`,duration:.8},gi={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},_i=(e,{keyframes:t})=>t.length>2?hi:fr.has(e)?e.startsWith(`scale`)?mi(t[1]):pi:gi,vi=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function yi(e){for(let t in e)if(!vi.has(t))return!0;return!1}var bi=(e,t,n,r={},i,a)=>o=>{let s=fi(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=D(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};yi(s)||Object.assign(u,_i(e,u)),u.duration&&=D(u.duration),u.repeatDelay&&=D(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(qr(u),u.delay===0&&(d=!0)),(xe.instantAnimations||xe.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,qr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Kn(u.keyframes,s);if(e!==void 0){st.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Zn(u):new ti(u)},xi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Si(e){let t=xi.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ci(e,t,n=1){`${e}`;let[r,i]=Si(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Se(e)?parseFloat(e):e}return gt(i)?Ci(i,t,n+1):i}function wi(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ti(e,t,n,r){if(typeof t==`function`){let[i,a]=wi(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=wi(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Ei(e,t,n){let r=e.getProps();return Ti(r,t,n===void 0?r.custom:n,e)}var Di=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...dr]),Oi=e=>Array.isArray(e);function ki(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ui(n))}function Ai(e){return Oi(e)?e[e.length-1]||0:e}function ji(e,t){let{transitionEnd:n={},transition:r={},...i}=Ei(e,t)||{};i={...i,...n};for(let t in i)ki(e,t,Ai(i[t]))}var P=e=>!!(e&&e.getVelocity);function Mi(e){return!!(P(e)&&e.add)}function Ni(e,t){let n=e.getValue(`willChange`);if(Mi(n))return n.add(t);if(!n&&xe.WillChange){let n=new xe.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Pi(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Fi=`data-`+Pi(`framerAppearId`);function Ii(e){return e.props[Fi]}function Li({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ri(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?di(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Li(f,t))continue;let o={delay:n,...fi(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){st.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=Ii(e);if(n){let e=window.MotionHandoffAnimation(n,t,st);e!==null&&(o.startTime=e,p=!0)}}Ni(e,t);let m=l??e.shouldReduceMotion;r.start(bi(t,r,i,m&&Di.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>st.update(()=>{o&&ji(e,o)});d.length?Promise.all(d).then(t):t()}return d}var zi={test:e=>e===`auto`,parse:e=>e},Bi=e=>t=>t.test(e),Vi=[yt,A,Ft,Pt,Lt,It,zi],Hi=e=>Vi.find(Bi(e));function Ui(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||we(e)}var Wi=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Gi(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Ct)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Wi.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Ki=/\b([a-z-]*)\(.*?\)/gu,qi={...M,getAnimatableNone:e=>{let t=e.match(Ki);return t?t.map(Gi).join(` `):e}},Ji={...M,getAnimatableNone:e=>{let t=M.parse(e);return M.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Yi={...yt,transform:Math.round},Xi={borderWidth:A,borderTopWidth:A,borderRightWidth:A,borderBottomWidth:A,borderLeftWidth:A,borderRadius:A,borderTopLeftRadius:A,borderTopRightRadius:A,borderBottomRightRadius:A,borderBottomLeftRadius:A,width:A,maxWidth:A,height:A,maxHeight:A,top:A,right:A,bottom:A,left:A,inset:A,insetBlock:A,insetBlockStart:A,insetBlockEnd:A,insetInline:A,insetInlineStart:A,insetInlineEnd:A,padding:A,paddingTop:A,paddingRight:A,paddingBottom:A,paddingLeft:A,paddingBlock:A,paddingBlockStart:A,paddingBlockEnd:A,paddingInline:A,paddingInlineStart:A,paddingInlineEnd:A,margin:A,marginTop:A,marginRight:A,marginBottom:A,marginLeft:A,marginBlock:A,marginBlockStart:A,marginBlockEnd:A,marginInline:A,marginInlineStart:A,marginInlineEnd:A,fontSize:A,backgroundPositionX:A,backgroundPositionY:A,rotate:Pt,pathRotation:Pt,rotateX:Pt,rotateY:Pt,rotateZ:Pt,scale:xt,scaleX:xt,scaleY:xt,scaleZ:xt,skew:Pt,skewX:Pt,skewY:Pt,distance:A,translateX:A,translateY:A,translateZ:A,x:A,y:A,z:A,perspective:A,transformPerspective:A,opacity:bt,originX:Rt,originY:Rt,originZ:A,zIndex:Yi,fillOpacity:bt,strokeOpacity:bt,numOctaves:Yi},Zi={...Xi,color:j,backgroundColor:j,outlineColor:j,fill:j,stroke:j,borderColor:j,borderTopColor:j,borderRightColor:j,borderBottomColor:j,borderLeftColor:j,filter:qi,WebkitFilter:qi,mask:Ji,WebkitMask:Ji},Qi=e=>Zi[e],$i=new Set([qi,Ji]);function ea(e,t){let n=Qi(e);return $i.has(n)||(n=M),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var ta=new Set([`auto`,`none`,`0`]);function na(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ta.has(t)&&Jt(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=ea(n,i)}var ra=class extends Tr{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),gt(r))){let i=Ci(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Di.has(n)||e.length!==2)return;let[r,i]=e,a=Hi(r),o=Hi(i);if(vt(r)!==vt(i)&&_r[n]){this.needsMeasurement=!0;return}if(a!==o)if(pr(a)&&pr(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else _r[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Ui(e[t]))&&n.push(t);n.length&&na(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_r[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=_r[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function ia(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var aa=(e,t)=>t&&typeof e==`number`?t.transform(e):e,{schedule:oa,cancel:sa}=ot(queueMicrotask,!1);function ca(e){return Ce(e)&&`ownerSVGElement`in e}function la(e){return ca(e)&&e.tagName===`svg`}var ua=[...Vi,j,M],da=e=>ua.find(Bi(e)),fa=0,pa=()=>`motion-view-${fa++}`,ma=e=>e.startsWith(`motion-view-`);function ha(e,t,n){t&&(e.style?.setProperty(`view-transition-class`,t),n.push(e))}function ga(e,t,n,r,i){if(n&&(e.style?.setProperty(`view-transition-group`,n),r.push(e),n!==`none`&&i)){let n=getComputedStyle(e);(n.overflowX!==`visible`||n.overflowY!==`visible`)&&i.add(t)}}function _a(e,t,n,r,i,a=[],o,s=[],c){let l=ia(e);if(r)return l.map((e,l)=>{let u=t.get(e);if(u)return u;let d=r[l]??pa();return e.style?.setProperty(`view-transition-name`,d),n.push(e),t.set(e,d),ha(e,i,a),ga(e,d,o,s,c),d});let u=l.map(e=>t.has(e)?void 0:getComputedStyle(e).getPropertyValue(`view-transition-name`));return l.map((e,r)=>{let l=t.get(e);if(l)return l;let d=u[r],f;return d&&d!==`none`&&d!==`auto`&&d!==`match-element`&&!ma(d)?f=d:(f=pa(),e.style?.setProperty(`view-transition-name`,f),n.push(e)),t.set(e,f),ha(e,i,a),ga(e,f,o,s,c),f})}function va(e,t=[],n=[]){for(let t of e)t.style?.removeProperty(`view-transition-name`);for(let e of t)e.style?.removeProperty(`view-transition-class`);for(let e of n)e.style?.removeProperty(`view-transition-group`)}function ya(e){return e===`layout`?`group`:e===`enter`||e===`new`?`new`:`old`}var ba={},xa=null,Sa={set:(e,t)=>{ba[e]=t},commit:()=>{xa||(xa=document.createElement(`style`),xa.id=`motion-view`);let e=``;for(let t in ba){let n=ba[t];e+=`${t} {\n`;for(let[t,r]of Object.entries(n))e+=` ${t}: ${r};\n`;e+=`}
|
|
2
|
+
`}xa.textContent=e,document.head.appendChild(xa),ba={}},remove:()=>{xa&&xa.parentElement&&xa.parentElement.removeChild(xa)}};function Ca(e){let t=e.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return t?{layer:t[2],type:t[1]}:null}function wa(){return document.getAnimations().filter(e=>{let{effect:t}=e;return!!t&&t.target===document.documentElement&&t.pseudoElement?.startsWith(`::view-transition`)})}function Ta(e,t){return t.has(e)&&Object.keys(t.get(e)).length>0}var Ea=[`layout`,`enter`,`exit`,`new`,`old`],Da={group:[`layout`],new:[`new`,`enter`],old:[`old`,`exit`]},Oa={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}},ka=.2;function Aa(e){let{update:t,targets:n,resolveDefs:r,cropOverride:i,pairs:a,classNames:o,flatGroups:s,options:c}=e;if(!document.startViewTransition)return(async()=>(await t(),new ni([])))();let l=new Map,u=[],d=[],f=[],p=new Set,m=new Map,h=new Set,g=new Map,_=new Map,v=new Map,y=new Map,b=e=>{n.forEach((t,n)=>{let c=o.get(n),h=n===`root`||!r.has(n)?void 0:s.has(n)?`none`:`contain`,b;if(n===`root`||!r.has(n))b=[n];else if(a.has(n))if(e===`old`)y.set(n,ia(n)),b=_a(n,l,u,void 0,c,d,h,f,p),v.set(n,b);else{for(let e of y.get(n)??[])e.style?.removeProperty(`view-transition-name`),l.delete(e);b=_a(a.get(n),l,u,v.get(n),c,d,h,f,p)}else b=_a(n,l,u,void 0,c,d,h,f,p);let x=i.get(n);b.forEach((n,r)=>{let i=m.get(n);m.set(n,i&&i!==t?{...i,...t}:t),x!==void 0&&g.set(n,x);let a=_.get(n)??{};a[e]=[r,b.length],_.set(n,a)})})},x=(e,t)=>{let n=_.get(e);return(t===`old`?n?.old:t===`new`?n?.new:n?.new??n?.old)??[-1,1]},S=(e,t,n,r,i)=>{let a=Ma(fi(c,n),fi(ja(e,t)??{},n));return typeof a.delay==`function`&&(a.delay=a.delay(r,i)),a},C=new Map,w=e=>l.forEach((t,n)=>{let r=n.getBoundingClientRect?.();if(r&&r.height){let n=C.get(t)??{};n[e]={width:r.width,height:r.height},C.set(t,n)}}),T=()=>{h.clear();for(let e of _.keys())e!==`root`&&(g.get(e)??ee(e))&&h.add(e)},ee=e=>{let t=C.get(e);return!t?.old||!t?.new||!t.old.height||!t.new.height?!1:Math.abs(t.old.width/t.old.height-t.new.width/t.new.height)>ka},te=()=>{Ta(`root`,n)||Sa.set(`:root`,{"view-transition-name":`none`}),Sa.set(`::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)`,{"animation-timing-function":`linear !important`}),h.forEach(e=>{Sa.set(`::view-transition-group(${e})`,{overflow:`clip`}),Sa.set(`::view-transition-old(${e}), ::view-transition-new(${e})`,{width:`100%`,height:`100%`,"object-fit":`cover`})}),p.forEach(e=>{Sa.set(`::view-transition-group-children(${e})`,{overflow:`clip`})}),Sa.commit()},ne=()=>{va(u,d,f),Sa.remove()},re=async()=>{await t(),b(`new`),w(`new`),T(),te()},ie;try{b(`old`),w(`old`),te(),ie=document.startViewTransition(re)}catch(e){return ne(),Promise.reject(e)}return ie.finished.finally(ne),new Promise((e,t)=>{ie.ready.then(()=>{let t=wa(),n=[],r=new Set,i=new Set;m.forEach((e,t)=>{let a=_.get(t),o=!!a?.new&&!a?.old,s=!!a?.old&&!a?.new;for(let a of Ea){if(!e[a]||a===`enter`&&!o||a===`exit`&&!s)continue;let l=ya(a),[u,d]=x(t,l);if(u===-1)continue;let{keyframes:f,options:p}=e[a];for(let[m,h]of Object.entries(f)){if(h==null)continue;if(m===`x`||m===`y`){Me(!1,`animateView() animates view-transition layers with CSS properties; the "${m}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if(a===`new`&&o&&e.enter?.keyframes[m]!=null||a===`old`&&s&&e.exit?.keyframes[m]!=null)continue;let f=Ma(fi(c,m),fi(p,m));if(!Array.isArray(h)){let t=a===`enter`?e.exit?.keyframes[m]:void 0,n=t==null?m===`opacity`||(l===`new`?o:s)?Oa[l]?.[m]:void 0:Array.isArray(t)?t[t.length-1]:t;n!==void 0&&(h=[n,h])}typeof f.delay==`function`&&(f.delay=f.delay(u,d)),f.duration&&=D(f.duration),f.delay&&=D(f.delay),n.push(new Rr({...f,element:document.documentElement,name:m,pseudoElement:`::view-transition-${l}(${t})`,keyframes:h})),r.add(`${t}:${l}`),m===`opacity`&&i.add(`${t}:${l}`)}}});for(let e of t){if(e.playState===`finished`)continue;let{effect:t}=e;if(!t||!(t instanceof KeyframeEffect))continue;let{pseudoElement:a}=t;if(!a)continue;let o=Ca(a);if(!o)continue;let s=m.get(o.layer);if(r.has(`${o.layer}:${o.type}`)){i.has(`${o.layer}:new`)&&i.has(`${o.layer}:old`)&&t.getKeyframes().some(e=>e.mixBlendMode)?n.push(new ai(e)):e.cancel();continue}let c=_.get(o.layer),l=(o.type===`old`||o.type===`new`)&&!!c?.old&&!!c?.new,u=o.type.startsWith(`group`)||l?`group`:o.type,[d,f]=x(o.layer,u),p=S(s,u,u===`group`?`layout`:``,d===-1?0:d,f),h=p.visualDuration;p.duration&&=D(p.duration),p=Lr(p);let g=l&&h!==void 0?D(h):p.duration,v=l?`linear`:Pr(p.ease,p.duration);t.updateTiming({delay:D(p.delay??0),duration:g,easing:v}),n.push(new ai(e))}e(new ni(n))}).catch(()=>ie.updateCallbackDone.then(()=>e(new ni([])),t))})}function ja(e,t){for(let n of Da[t]??[]){let t=e?.[n]?.options;if(t)return t}}function Ma(e,t){let n={...e,...t};return t.duration!==void 0&&(t.visualDuration===void 0&&delete n.visualDuration,t.type===void 0&&delete n.type),n}var Na=[],Pa=null;function Fa(){Pa=null;let[e]=Na;e&&Ia(e)}function Ia(e){ve(Na,e),Pa=e,Aa(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(Fa)}function La(){for(let e=Na.length-1;e>=0;e--){let t=Na[e],{interrupt:n}=t.options;if(n===`immediate`){let n=Na.slice(0,e+1).map(e=>e.update),r=Na.slice(e+1);t.update=()=>{n.forEach(e=>e())},Na=[t,...r];break}}(!Pa||Na[0]?.options.interrupt===`immediate`)&&Fa()}function Ra(e){Na.push(e),oa.render(La)}var za=class{constructor(e,t={}){this.currentSubject=`root`,this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=Ee,this.notifyReject=Ee,this.readyPromise=new Promise((e,t)=>{this.notifyReady=e,this.notifyReject=t}),this.update=e,this.options={interrupt:`wait`,...t},this.readyPromise.catch(Ee),Ra(this)}add(e,t){return this.currentSubject=e,this.resolveDefs.add(e),t!==void 0&&this.pairs.set(e,t),this.targets.has(e)||this.targets.set(e,{}),this}crop(e=!0){return this.cropOverride.set(this.currentSubject,e),this}group(e=!0){return e?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(e){return this.classNames.set(this.currentSubject,e),this}layout(e={}){return this.updateTarget(`layout`,{},e),this}enter(e,t){return this.updateTarget(`enter`,e,t),this}exit(e,t){return this.updateTarget(`exit`,e,t),this}new(e,t){return this.updateTarget(`new`,e,t),this}old(e,t){return this.updateTarget(`old`,e,t),this}updateTarget(e,t,n={}){let{currentSubject:r,targets:i}=this;i.has(r)||i.set(r,{});let a=i.get(r);a[e]={keyframes:t,options:n}}then(e,t){return this.readyPromise.then(e,t)}};function Ba(e,t={}){return new za(e,t)}var Va=()=>({min:0,max:0}),Ha=()=>({x:Va(),y:Va()}),Ua=new WeakMap;function Wa(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Ga(e){return typeof e==`string`||Array.isArray(e)}var Ka=[`initial`,`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`];function qa(e){return Wa(e.animate)||Ka.some(t=>Ga(e[t]))}function Ja(e){return!!(qa(e)||e.variants)}function Ya(e,t,n){for(let r in t){let i=t[r],a=n[r];if(P(i))e.addValue(r,i);else if(P(a))e.addValue(r,ui(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,ui(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Xa={current:null},Za={current:!1},Qa=typeof window<`u`;function $a(){if(Za.current=!0,Qa)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Xa.current=e.matches;e.addEventListener(`change`,t),t()}else Xa.current=!1}var eo=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],to={},no=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Tr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=k.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,st.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=qa(t),this.isVariantNode=Ja(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&P(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Ua.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Za.current||$a(),this.shouldReduceMotion=Xa.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),ct(this.notifyUpdate),ct(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Jr.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Rr({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:D(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=fr.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&st.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in to){let t=to[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ha()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<eo.length;t++){let n=eo[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Ya(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=ui(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Se(n)||we(n))?n=parseFloat(n):!da(n)&&M.test(t)&&(n=ea(e,t)),this.setBaseTarget(e,P(n)?n.get():n)),P(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Ti(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!P(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ke),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){oa.render(this.render)}},ro=class extends no{constructor(){super(...arguments),this.KeyframeResolver=ra}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;P(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function io({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ao(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function oo(e,t){return io(ao(e.getBoundingClientRect(),t))}var so={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},co=dr.length;function lo(e,t,n){let r=``,i=!0;for(let a=0;a<co;a++){let o=dr[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=aa(s,Xi[o]);if(!c){i=!1;let t=so[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${aa(a,Xi.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function uo(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(fr.has(e)){o=!0;continue}else if(mt(e)){i[e]=n;continue}else{let t=aa(n,Xi[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=lo(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function fo(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function po(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var mo={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(A.test(e))e=parseFloat(e);else return e;return`${po(e,t.target.x)}% ${po(e,t.target.y)}%`}},ho={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=M.parse(e);if(i.length>5)return r;let a=M.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=an(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},go={borderRadius:{...mo,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:mo,borderTopRightRadius:mo,borderBottomLeftRadius:mo,borderBottomRightRadius:mo,boxShadow:ho};function _o(e,{layout:t,layoutId:n}){return fr.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!go[e]||e===`opacity`)}function vo(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(P(r[t])||i&&P(i[t])||_o(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function yo(e){return window.getComputedStyle(e)}var bo=class extends ro{constructor(){super(...arguments),this.type=`html`,this.renderInstance=fo}readValueFromInstance(e,t){if(fr.has(t))return this.projection?.isProjecting?sr(t):lr(e,t);{let n=yo(e),r=(mt(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return oo(e,t)}build(e,t,n){uo(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return vo(e,t,n)}};function xo(e,t){return e in t}var So=class extends no{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(xo(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Ha()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},Co={offset:`stroke-dashoffset`,array:`stroke-dasharray`},wo={offset:`strokeDashoffset`,array:`strokeDasharray`};function To(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Co:wo;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Eo=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Do(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(uo(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Eo)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&To(d,i,a,o,!1)}var Oo=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),ko=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Ao(e,t,n,r){fo(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Oo.has(n)?n:Pi(n),t.attrs[n])}function jo(e,t,n){let r=vo(e,t,n);for(let n in e)if(P(e[n])||P(t[n])){let t=dr.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Mo=class extends ro{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Ha}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(fr.has(t)){let e=Qi(t);return e&&e.default||0}return t=Oo.has(t)?t:Pi(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return jo(e,t,n)}build(e,t,n){Do(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Ao(e,t,n,r)}mount(e){this.isSVGTag=ko(e.tagName),super.mount(e)}};function No(e,t,n){let r=P(e)?e:ui(e);return r.start(bi(``,r,t,n)),r.animation}function Po(e){return typeof e==`object`&&!Array.isArray(e)}function Fo(e,t,n,r){return e==null?[]:typeof e==`string`&&Po(t)?ia(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Io(e,t,n){return e*(t+1)+n*t}function Lo(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function Ro(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(ve(e,i),r--)}}function zo(e,t,n,r,i,a){Ro(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:an(i,a,r[o]),easing:Qe(n,o)})}function Bo(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Vo(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Ho=`easeInOut`,Uo=20;function Wo(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,Lo(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Lo(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=qo(e),{delay:l=0,times:u=Vn(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Ir(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Xo(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=D(b));let r=wn(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Bn(u,T),c.length===1&&c.unshift(null),m&&`${m}${Uo}`,m&&m<Uo){let e=b>0?_/b:0;b=Io(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Be(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:Qe(f,e-1))}Bo(u,m,e)}let ee=w+b;zo(r,c,y,u,w,ee),g=Math.max(x+b,g),f=Math.max(ee,f)};if(P(p)){let e=Go(p,s);_(m,h,Ko(`default`,e))}else{let e=Fo(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Go(r,s);for(let e in m)_(m[e],Jo(h,e),Ko(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Vo);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Oe(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Ho)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Go(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Ko(e,t){return t[e]||(t[e]=[]),t[e]}function qo(e){return Array.isArray(e)?e:[e]}function Jo(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Yo=e=>typeof e==`number`,Xo=e=>e.every(Yo);function Zo(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ca(e)&&!la(e)?new Mo(t):new bo(t);n.mount(e),Ua.set(e,n)}function Qo(e){let t=new So({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),Ua.set(e,t)}function $o(e,t){return P(e)||typeof e==`number`||typeof e==`string`&&!Po(t)}function es(e,t,n,r){let i=[];if($o(e,t))i.push(No(e,Po(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Fo(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Zo:Qo;Ua.has(r)||s(r);let c=Ua.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ri(c,{...t,transition:l},{}))}}return i}function ts(e,t,n){let r=[];return Wo(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=ui(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Pn}).forEach(({keyframes:e,transition:t},n)=>{r.push(...es(n,e,t))}),r}function ns(e){return Array.isArray(e)&&e.some(Array.isArray)}function rs(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),ns(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=ts(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=es(e,i,{...c,...r},t)}let l=new ii(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{ve(t.animations,l)})),l}return i}var is=rs(),as=e=>({finished:(async()=>{await e?.()})(),cancel(){},stop(){},complete(){}}),os=(e,t)=>{let n=!1,r=()=>{n||(n=!0,t?.())};return{finished:e.finished.then(()=>{},()=>{}).finally(r),cancel(){e.cancel(),r()},stop(){e.stop(),r()},complete(){e.complete(),r()}}},ss=(e,t)=>{let n=typeof e==`object`&&e&&`get`in e?e:ui(e);return{value:n,animateTo(e,r){return os(is(n,e,{...t,...r}))}}},cs=(...e)=>({finished:Promise.allSettled(e.map(e=>e.finished)).then(()=>{}),cancel(){e.forEach(e=>e.cancel())},stop(){e.forEach(e=>e.stop())},complete(){e.forEach(e=>e.complete())}}),ls=(...e)=>{let t=!1,n=null;return{finished:(async()=>{for(let r of e){if(t)break;n=r(),await n.finished.catch(()=>{})}})(),cancel(){t=!0,n?.cancel()},stop(){t=!0,n?.stop()},complete(){n?.complete()}}},us=(e,t,n,r=e=>String(e))=>{let i=n=>{e.style[t]=r(n)};return i(n.get()),n.on(`change`,i)},ds=(e,t,n)=>{let r=()=>{e.style.transform=n(t)},i=Object.values(t).map(e=>e.on(`change`,r));return r(),()=>i.forEach(e=>e())},F={fast:.14,normal:.18,slow:.24},I={out:[.23,1,.32,1],inOut:[.77,0,.175,1]},fs={popover:{duration:F.fast,ease:I.out},modal:{duration:F.slow,ease:I.out},toast:{duration:F.normal,ease:I.out},sidebar:{duration:F.slow,ease:I.out},sheet:{duration:F.slow,ease:I.out}},ps=`(prefers-reduced-motion: reduce)`,ms=()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(ps).matches,hs=(e=`user`)=>e===`always`?!0:e===`never`?!1:ms(),gs=(e,t={},n=`user`)=>hs(n)?{...e,duration:0,...t}:e,_s=e=>{let t={};return`opacity`in e&&(t.opacity=e.opacity),t},vs=`data-ui-motion-key`,ys=`data-ui-motion-layout`,bs=`data-ui-motion-temp`,xs=`data-ui-motion-active`,Ss=e=>typeof e==`object`&&!!e&&Symbol.iterator in e,Cs=e=>{let t=globalThis.CSS;return typeof t?.escape==`function`?t.escape(e):e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)},ws=(e=document)=>typeof e==`string`?Array.from(document.querySelectorAll(e)):e instanceof Document||e instanceof Element?[e]:Ss(e)?Array.from(e):[document],Ts=(e,t)=>ws(e).flatMap(e=>Array.from(e.querySelectorAll(t))),Es=e=>`[${vs}="${Cs(e)}"]`,Ds=e=>`[data-ui-${Cs(e)}]`,Os=e=>e instanceof Element?null:typeof e==`string`?e:`selector`in e?e.selector:`part`in e?Ds(e.part):`key`in e?Es(e.key):null,ks=(e=document,t)=>{if(!t)return[];let n=(Array.isArray(t)?t:[t]).flatMap(t=>{if(t instanceof Element)return[t];if(typeof t==`object`&&`from`in t)return[...ks(e,t.from),...ks(e,t.to)];let n=Os(t);return n?Ts(e,n):[]});return Array.from(new Set(n))},As=(e,t)=>{if(e instanceof Element)return[e];let n=Os(e);return n?typeof e==`string`||`selector`in e||`key`in e||`part`in e?[n]:ks(t,e):[]},js=(e=document,t)=>t?(Array.isArray(t)?t:[t]).flatMap(t=>{if(t instanceof Element)return[{subject:t}];if(typeof t==`object`&&`from`in t){let n=As(t.from,e),r=As(t.to,e);return n.flatMap((e,t)=>{let n=r[t]??r[0];return n?[{subject:e,newSubject:n}]:[]})}let n=Os(t);return n?[{subject:n}]:[]}):[],Ms=(e=document,t={})=>{let n=ws(e).filter(e=>e instanceof Element),r=[],i=(e,t,n)=>{r.push({element:e,attr:t,previous:e.getAttribute(t)}),e.setAttribute(t,n)};return n.forEach(e=>{let n=!1;(t.layout??!0)&&i(e,ys,``),t.key&&!e.hasAttribute(`data-ui-motion-key`)&&(i(e,vs,t.key),n=!0),n&&i(e,bs,``)}),()=>{r.reverse().forEach(({element:e,attr:t,previous:n})=>{if(n===null){e.removeAttribute(t);return}e.setAttribute(t,n)})}},Ns=e=>{let t=e.getAttribute(`data-side`),n=e.getAttribute(`data-align`);return`${t===`left`?`right`:t===`right`?`left`:n===`end`?`right`:n===`start`?`left`:`center`} ${t===`top`?`bottom`:t===`bottom`?`top`:`center`}`},Ps=e=>typeof e==`string`,Fs=(e,t,n)=>{if(t===`fade`)return{opacity:e===`enter`?[0,1]:[1,0]};if(t===`sidebar`){let t=n?.dataset.side===`right`?`translateX(100%)`:`translateX(-100%)`;return e===`enter`?{transform:[t,`translateX(0)`]}:{transform:[`translateX(0)`,t]}}if(t===`sheet`){let t=n?.dataset.side,r=t===`right`?`inset(0 0 0 100%)`:t===`left`?`inset(0 100% 0 0)`:t===`bottom`?`inset(100% 0 0 0)`:`inset(0 0 100% 0)`;return e===`enter`?{clipPath:[r,`inset(0 0 0 0)`]}:{clipPath:[`inset(0 0 0 0)`,r]}}if(t===`toast`){let t=n?.style,r=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-offset`)||`0`)||0,i=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-scale`)||`1`)||1,a=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-direction`)||`1`)||1,o=Number.parseFloat(t?.getPropertyValue(`--ui-toast-stack-opacity`)||`1`)||1,s=(e,t)=>`translateY(${r+e*a}px) scale(${i*t})`;return e===`enter`?{opacity:[0,o],transform:[s(8,.98),s(0,1)]}:{opacity:[o,0],transform:[s(0,1),s(-4,.98)]}}return t===`modal`?e===`enter`?{opacity:[0,1],transform:[`translateY(8px) scale(0.98)`,`translateY(0) scale(1)`]}:{opacity:[1,0],transform:[`translateY(0) scale(1)`,`translateY(4px) scale(0.98)`]}:e===`enter`?{opacity:[0,1],transform:[`scale(0.97)`,`scale(1)`]}:{opacity:[1,0],transform:[`scale(1)`,`scale(0.97)`]}},Is=(e,t,n=`fade`,r={})=>{if(!(e instanceof HTMLElement))return{finished:Promise.resolve(),cancel(){},stop(){},complete(){}};let{reducedMotion:i,...a}=r,o=e.style.transformOrigin;(n===`popover`||n===`menu`)&&(e.style.transformOrigin=Ns(e)),e.setAttribute(xs,t);let s=hs(i),c=Ps(n)?Fs(t,n,e):n,l=s?_s(c):c,u=!Ps(n)||n===`menu`?`popover`:n,d=u===`fade`?{duration:F.fast,ease:I.out}:fs[u];return os(is(e,l,{...d,duration:s?.08:d.duration,...a}),()=>{e.style.transformOrigin=o,e.getAttribute(`data-ui-motion-active`)===t&&e.removeAttribute(xs)})},Ls=({element:e,preset:t=`fade`,enter:n,exit:r,options:i,enterOptions:a,exitOptions:o,owner:s=`component`})=>{let c=null,l=0,u=(u,d={})=>{let f=++l;c?.cancel(),c=null,d.before?.();let p=e();if(!(p instanceof Element))return d.after?.(),{finished:Promise.resolve(),cancel(){},stop(){},complete(){}};s===`component`&&p.setAttribute(`data-ui-motion-owner`,`component`);let m=u===`enter`?n??t:r??t,h=u===`enter`?a:o,g=Is(p,u,m,{...i,...h});return c=g,g.finished.finally(()=>{f!==l||c!==g||(c=null,d.after?.())}),g},d=()=>{l+=1,c?.cancel(),c=null};return{get runId(){return l},enter(e){return u(`enter`,e)},exit(e){return u(`exit`,e)},cancel:d,destroy:d}},Rs={duration:F.slow,ease:I.inOut},zs={transform:[`none`,`none`]},Bs=`[${vs}], [${ys}]`,Vs=(e,t,n={})=>{if(typeof document.startViewTransition!=`function`||hs(n.reducedMotion))return as(e);let r=t??(n.layout||n.preset===`layout`?Bs:null),i=js(n.scope??document,r),a=Ba(e,{duration:F.normal,ease:I.inOut,interrupt:`immediate`,...n.transition});return i.forEach(({subject:e,newSubject:t})=>{a.add(e,t),n.className&&a.class(n.className),typeof n.crop==`boolean`&&a.crop(n.crop),typeof n.group==`boolean`&&a.group(n.group),n.layout!==!1&&n.preset!==`none`&&a.layout(typeof n.layout==`object`?n.layout:Rs);let r=n.newView??(n.preset===`stream`?zs:void 0),i=n.oldView??(n.preset===`stream`?zs:void 0),o=n.enter,s=n.exit;r&&a.new(r,{duration:F.fast,ease:I.out}),i&&a.old(i,{duration:F.fast,ease:I.out}),o&&a.enter(o,{duration:F.fast,ease:I.out}),s&&a.exit(s,{duration:F.fast,ease:I.out})}),{finished:Promise.resolve(a.then(()=>{},()=>{})),cancel(){wa().forEach(e=>e.cancel())},stop(){wa().forEach(e=>e.pause())},complete(){wa().forEach(e=>{try{e.finish()}catch{e.cancel()}})}}},Hs=e=>e.selector?e.selector:e.target?e.target.startsWith(`#`)?e.target:`#${Cs(e.target)}`:null,Us=e=>{let t=getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>e&&e!==`visible`)},Ws=e=>{let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){if(Us(t))return t;t=t.parentElement}return null},Gs=e=>e.width===0&&e.height===0&&e.top===0&&e.left===0,Ks=e=>{let t=Ws(e);if(!t)return!0;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(Gs(n)&&Gs(r))return!0;let i=Math.min(n.height,160);return n.top>=r.top&&n.left<r.right&&n.right>r.left&&n.bottom+i<=r.bottom},qs=e=>{let t=[];return e.forEach(e=>{let n=Hs(e),r=n?document.querySelector(n):null;if(!r)return;let i=[],a=r.getAttribute(`data-ui-motion-key`);if(r.querySelectorAll(`[data-ui-motion-key]`).forEach(e=>{let t=e.getAttribute(`data-ui-motion-key`);if(t&&Ks(e)){let e=Es(t);i.push({from:{selector:e},to:{selector:e}})}}),(a||r.hasAttribute(`data-ui-motion-layout`))&&Ks(r)){let e=a?Es(a):n;i.unshift({from:{selector:e},to:{selector:e}})}t.push(...i)}),t},Js=(e,t,n={})=>{let r=n.update;if(!r)return as();let i=qs(Array.isArray(t)?t:[t]);if(i.length===0||hs(n.reducedMotion))return as(r);let a={...n,preset:`stream`};return n.scope&&n.scope!==`target`&&(a.scope=n.scope),Vs(r,i,a)},Ys={createAnimator:ss,parallel:cs,sequential:ls,bindTransform:ds,bindStyle:us,withReducedMotion:gs,resolveTargets:ks,applyViewKeys:Ms,animateView:Vs,animatePresence:Is,createPresenceLifecycle:Ls,animateStreamPatch:Js},Xs=(e,t)=>{if(!(!e||typeof t.evaluate!=`function`))return t.evaluate(e)},Zs=e=>{if(typeof e==`string`)return{key:e};if(typeof e==`object`&&e){let t=e.key??e.id;return t?{key:t}:{}}return{}},Qs=e=>{e.directive(`ui-layout`,(e,{expression:t},n)=>{if(!(e instanceof Element))return;let r=Ms(e,Zs(Xs(t,n)));n.cleanup?.(()=>{r()})})},$s=e=>{e.bind(`UiDisabled`,function(){let e=this;return{":aria-disabled"(){return e.props.disabled?`true`:null},":data-disabled"(){return e.props.disabled?`true`:null}}}),e.bind(`UiInvalid`,function(){let e=this;return{":aria-invalid"(){return e.props.invalid?`true`:null},":aria-describedby"(){return e.describedBy||null},":data-invalid"(){return e.props.invalid?`true`:null}}}),e.bind(`UiInteractive`,function(){let e=this;return{":data-ui-interactive"(){return e.isInteractive??e.props?.interactive?e.interactiveKind||`true`:null}}}),e.bind(`UiSelected`,function(){let e=this;return{":aria-selected"(){return e.isSelected?`true`:`false`},":data-selected"(){return e.isSelected?`true`:null}}}),e.bind(`UiActiveDescendant`,function(){let e=this;return{":aria-activedescendant"(){return e.activeId}}})},ec=e=>{ge(e),Qs(e),$s(e)},tc=Math.min,nc=Math.max,rc=Math.round,ic=Math.floor,ac=e=>({x:e,y:e}),oc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function sc(e,t,n){return nc(e,tc(t,n))}function cc(e,t){return typeof e==`function`?e(t):e}function lc(e){return e.split(`-`)[0]}function uc(e){return e.split(`-`)[1]}function dc(e){return e===`x`?`y`:`x`}function fc(e){return e===`y`?`height`:`width`}function pc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function mc(e){return dc(pc(e))}function hc(e,t,n){n===void 0&&(n=!1);let r=uc(e),i=mc(e),a=fc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=wc(o)),[o,wc(o)]}function gc(e){let t=wc(e);return[_c(e),t,_c(t)]}function _c(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var vc=[`left`,`right`],yc=[`right`,`left`],bc=[`top`,`bottom`],xc=[`bottom`,`top`];function Sc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?yc:vc:t?vc:yc;case`left`:case`right`:return t?bc:xc;default:return[]}}function Cc(e,t,n,r){let i=uc(e),a=Sc(lc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_c)))),a}function wc(e){let t=lc(e);return oc[t]+e.slice(t.length)}function Tc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ec(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Tc(e)}function Dc(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Oc(e,t,n){let{reference:r,floating:i}=e,a=pc(t),o=mc(t),s=fc(o),c=lc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(uc(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function kc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=cc(t,e),p=Ec(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Dc(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Dc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ac=50,jc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:kc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Oc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ac&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Oc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Mc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=cc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=lc(r),_=pc(o),v=lc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[wc(o)]:gc(o)),x=p!==`none`;!d&&x&&b.push(...Cc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=hc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==pc(t))||T.every(e=>pc(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=pc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Nc=new Set([`left`,`top`]);async function Pc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=lc(n),s=uc(n),c=pc(n)===`y`,l=Nc.has(o)?-1:1,u=a&&c?-1:1,d=cc(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Fc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Pc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ic=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=cc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=pc(lc(i)),p=dc(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=sc(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=sc(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}};function Lc(){return typeof window<`u`}function Rc(e){return Bc(e)?(e.nodeName||``).toLowerCase():`#document`}function L(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zc(e){return((Bc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Bc(e){return Lc()?e instanceof Node||e instanceof L(e).Node:!1}function Vc(e){return Lc()?e instanceof Element||e instanceof L(e).Element:!1}function Hc(e){return Lc()?e instanceof HTMLElement||e instanceof L(e).HTMLElement:!1}function Uc(e){return!Lc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof L(e).ShadowRoot}function Wc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Gc(e){return/^(table|td|th)$/.test(Rc(e))}function Kc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var qc=/transform|translate|scale|rotate|perspective|filter/,Jc=/paint|layout|strict|content/,Yc=e=>!!e&&e!==`none`,Xc;function Zc(e){let t=Vc(e)?R(e):e;return Yc(t.transform)||Yc(t.translate)||Yc(t.scale)||Yc(t.rotate)||Yc(t.perspective)||!$c()&&(Yc(t.backdropFilter)||Yc(t.filter))||qc.test(t.willChange||``)||Jc.test(t.contain||``)}function Qc(e){let t=nl(e);for(;Hc(t)&&!el(t);){if(Zc(t))return t;if(Kc(t))return null;t=nl(t)}return null}function $c(){return Xc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Xc}function el(e){return/^(html|body|#document)$/.test(Rc(e))}function R(e){return L(e).getComputedStyle(e)}function tl(e){return Vc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nl(e){if(Rc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Uc(e)&&e.host||zc(e);return Uc(t)?t.host:t}function rl(e){let t=nl(e);return el(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hc(t)&&Wc(t)?t:rl(t)}function il(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=rl(e),i=r===e.ownerDocument?.body,a=L(r);if(i){let e=al(a);return t.concat(a,a.visualViewport||[],Wc(r)?r:[],e&&n?il(e):[])}else return t.concat(r,il(r,[],n))}function al(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ol(e){let t=R(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Hc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=rc(n)!==a||rc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function sl(e){return Vc(e)?e:e.contextElement}function cl(e){let t=sl(e);if(!Hc(t))return ac(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ol(t),o=(a?rc(n.width):n.width)/r,s=(a?rc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ll=ac(0);function ul(e){let t=L(e);return!$c()||!t.visualViewport?ll:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==L(e)?!1:t}function fl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=sl(e),o=ac(1);t&&(r?Vc(r)&&(o=cl(r)):o=cl(e));let s=dl(a,n,r)?ul(a):ac(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=L(a),t=r&&Vc(r)?L(r):r,n=e,i=al(n);for(;i&&r&&t!==n;){let e=cl(i),t=i.getBoundingClientRect(),r=R(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=L(i),i=al(n)}}return Dc({width:u,height:d,x:c,y:l})}function pl(e,t){let n=tl(e).scrollLeft;return t?t.left+n:fl(zc(e)).left+n}function ml(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-pl(e,n),y:n.top+t.scrollTop}}function hl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zc(r),s=t?Kc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ac(1),u=ac(0),d=Hc(r);if((d||!d&&!a)&&((Rc(r)!==`body`||Wc(o))&&(c=tl(r)),d)){let e=fl(r);l=cl(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ml(o,c):ac(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function gl(e){return Array.from(e.getClientRects())}function _l(e){let t=zc(e),n=tl(e),r=e.ownerDocument.body,i=nc(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=nc(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+pl(e),s=-n.scrollTop;return R(r).direction===`rtl`&&(o+=nc(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var vl=25;function yl(e,t){let n=L(e),r=zc(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=$c();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=pl(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=vl&&(a-=o)}else l<=vl&&(a+=l);return{width:a,height:o,x:s,y:c}}function bl(e,t){let n=fl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Hc(e)?cl(e):ac(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function xl(e,t,n){let r;if(t===`viewport`)r=yl(e,n);else if(t===`document`)r=_l(zc(e));else if(Vc(t))r=bl(t,n);else{let n=ul(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Dc(r)}function Sl(e,t){let n=nl(e);return n===t||!Vc(n)||el(n)?!1:R(n).position===`fixed`||Sl(n,t)}function Cl(e,t){let n=t.get(e);if(n)return n;let r=il(e,[],!1).filter(e=>Vc(e)&&Rc(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?nl(e):e;for(;Vc(o)&&!el(o);){let t=R(o),n=Zc(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Wc(o)&&!n&&Sl(e,o))?r=r.filter(e=>e!==o):i=t,o=nl(o)}return t.set(e,r),r}function wl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Kc(t)?[]:Cl(t,this._c):[].concat(n),r],o=xl(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=xl(t,a[e],i);s=nc(n.top,s),c=tc(n.right,c),l=tc(n.bottom,l),u=nc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Tl(e){let{width:t,height:n}=ol(e);return{width:t,height:n}}function El(e,t,n){let r=Hc(t),i=zc(t),a=n===`fixed`,o=fl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ac(0);function l(){c.x=pl(i)}if(r||!r&&!a)if((Rc(t)!==`body`||Wc(i))&&(s=tl(t)),r){let e=fl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?ml(i,s):ac(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Dl(e){return R(e).position===`static`}function Ol(e,t){if(!Hc(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zc(e)===n&&(n=n.ownerDocument.body),n}function kl(e,t){let n=L(e);if(Kc(e))return n;if(!Hc(e)){let t=nl(e);for(;t&&!el(t);){if(Vc(t)&&!Dl(t))return t;t=nl(t)}return n}let r=Ol(e,t);for(;r&&Gc(r)&&Dl(r);)r=Ol(r,t);return r&&el(r)&&Dl(r)&&!Zc(r)?n:r||Qc(e)||n}var Al=async function(e){let t=this.getOffsetParent||kl,n=this.getDimensions,r=await n(e.floating);return{reference:El(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jl(e){return R(e).direction===`rtl`}var Ml={convertOffsetParentRelativeRectToViewportRelativeRect:hl,getDocumentElement:zc,getClippingRect:wl,getOffsetParent:kl,getElementRects:Al,getClientRects:gl,getDimensions:Tl,getScale:cl,isElement:Vc,isRTL:jl};function Nl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Pl(e,t){let n=null,r,i=zc(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=ic(d),h=ic(i.clientWidth-(u+f)),g=ic(i.clientHeight-(d+p)),_=ic(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:nc(0,tc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Nl(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Fl(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=sl(e),u=i||a?[...l?il(l):[],...t?il(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Pl(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?fl(e):null;c&&g();function g(){let t=fl(e);h&&!Nl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Il=Fc,Ll=Ic,Rl=Mc,zl=(e,t,n)=>{let r=new Map,i={platform:Ml,...n},a={...i.platform,_c:r};return jc(e,t,{...i,platform:a})},Bl=(e,t)=>t===`center`?e:`${e}-${t}`,Vl=({reference:e,floating:t,position:n,align:r,gap:i,offset:a,matchReferenceWidth:o=!1})=>{let s=null,c=e=>`${e.getBoundingClientRect().width}px`,l=()=>{let s=e(),l=t();o&&(l.style.width=c(s)),zl(s,l,{placement:Bl(n(),r()),middleware:[Il({mainAxis:i(),crossAxis:a()}),Rl(),Ll({padding:5})]}).then(({x:e,y:t,strategy:n,placement:r})=>{let[i=`bottom`,a=`center`]=r.split(`-`);Object.assign(l.style,{position:n,inset:`${t}px auto auto ${e}px`,...o?{width:c(s)}:{}}),l.dataset.side=i,l.dataset.align=a})};return{mounted(){return s!==null},mount(){if(s){l();return}s=Fl(e(),t(),l)},unmount(){s?.(),s=null},sync(){this.unmount(),this.mount()}}};function Hl(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Hl(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ul(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Hl(e))&&(r&&(r+=` `),r+=t);return r}var Wl=({values:e})=>Ul(e),Gl=Wl,Kl=e=>e.dataset.disabled===`true`||e.hasAttribute(`disabled`),ql=e=>typeof e==`function`?e():e!==!1,Jl=({root:e,itemSelector:t,activeAttribute:n=`data-active`,isDisabled:r=Kl,loop:i})=>{let a=()=>{let n=e();return n?Array.from(n.querySelectorAll(t)):[]},o=()=>a().filter(e=>!r(e)),s=()=>{a().forEach(e=>{e.removeAttribute(n)})},c=({items:e=o()}={})=>{let t=e.find(e=>e.getAttribute(n)===`true`);if(t)return e.indexOf(t);let r=document.activeElement,i=r instanceof HTMLElement?e.find(e=>e===r||e.contains(r)):void 0;return i?e.indexOf(i):-1},l=({el:e})=>{o().includes(e)&&(s(),e.setAttribute(n,`true`))},u=({el:e})=>{l({el:e}),e.focus()},d=(e,t)=>e<0?0:e<t-1?e+1:ql(i)?0:t-1,f=(e,t)=>e<0?t-1:e>0?e-1:ql(i)?t-1:0,p=e=>{let t=o()[e];t&&u({el:t})},m=()=>{let e=o();e.length!==0&&u({el:e[d(c({items:e}),e.length)]})},h=()=>{let e=o();e.length!==0&&u({el:e[f(c({items:e}),e.length)]})},g=()=>p(0),_=()=>{p(o().length-1)};return{allItems:a,items:o,currentActiveIndex:c,activateItem:l,clearActiveItem:s,focusItem:u,focusNext:m,focusPrevious:h,focusFirst:g,focusLast:_,handleKeydown:({event:e})=>e.key===`ArrowDown`?(e.preventDefault(),m(),!0):e.key===`ArrowUp`?(e.preventDefault(),h(),!0):e.key===`Home`?(e.preventDefault(),g(),!0):e.key===`End`?(e.preventDefault(),_(),!0):!1}},Yl=`Are you sure?`,Xl=null,Zl=new WeakSet,Ql=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement,$l=({form:e,submitter:t})=>{let n=t?.dataset.uiConfirm;if(n!==void 0)return n||Yl;let r=e.dataset.uiConfirm;return r===void 0?null:r||Yl},eu=({form:e,submitter:t})=>{if(Zl.add(e),t){e.requestSubmit(t);return}e.requestSubmit()},tu=e=>{let t=e.target;if(!(t instanceof HTMLFormElement))return;if(Zl.has(t)){Zl.delete(t);return}let n=Ql(e.submitter)?e.submitter:null,r=$l({form:t,submitter:n});if(r===null)return;e.preventDefault();let i=!1,a=()=>{i||(i=!0,eu({form:t,submitter:n}))},o=()=>{i=!0},s=new CustomEvent(`ui:confirm`,{bubbles:!0,cancelable:!0,detail:{form:t,message:r,submitter:n,triggeringEvent:e,proceed:a,cancel:o}});t.dispatchEvent(s),!s.defaultPrevented&&(window.confirm(r)?a():o())},nu=({root:e=document}={})=>{Xl||=(e.addEventListener(`submit`,tu,{capture:!0}),()=>e.removeEventListener(`submit`,tu,{capture:!0}))},ru=()=>{Xl?.(),Xl=null},iu=e=>typeof e!=`object`||!e?e:(Object.freeze(e),Object.values(e).forEach(e=>{iu(e)}),e),au=({definition:e})=>iu(e),ou=[`:`,`@`,`x-`,`data-`,`aria-`],su=e=>typeof e==`object`&&!!e&&!Array.isArray(e),cu=e=>Object.keys(e).some(e=>e===`class`||e===`style`||e===`id`||e===`role`||e===`type`||e===`tabindex`||ou.some(t=>e.startsWith(t))),lu=(e,t,n)=>{Object.entries(t).forEach(([t,r])=>{if(t===`class`){n.push(r);return}if(r==null||r===!1){delete e[t];return}e[t]=r})},uu=({inputs:e})=>{let t={},n=[];e.forEach(e=>{if(e){if(su(e)&&cu(e)){lu(t,e,n);return}n.push(e)}});let r=Wl({values:n});return r&&(t.class=r),t},du=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase(),fu=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase().replace(/[\s_]+/g,`-`),pu=e=>e.replace(/[-_\s]+([a-z])/g,(e,t)=>t.toUpperCase()),mu=e=>e.replace(/([A-Z])/g,`_$1`).toLowerCase().replace(/[\s-]+/g,`_`),hu=(e,t)=>e.dataset[t],gu=(e,t)=>e.hasAttribute(`data-${du(t)}`),_u=(e,t)=>(Object.defineProperty(e,"meta",{value:Object.freeze(t),enumerable:!1}),e);function z(e,t,n=`default`){let r=((r,i)=>{let a=hu(r,i);return a===void 0||a===``&&n==="default"?t:e.reduce((e,t)=>t(e),a)});return Object.defineProperties(r,{trim:{get:()=>z([...e,e=>e.trim()],t,n)},lower:{get:()=>z([...e,e=>e.toLowerCase()],t,n)},upper:{get:()=>z([...e,e=>e.toUpperCase()],t,n)},kebab:{get:()=>z([...e,fu],t,n)},camel:{get:()=>z([...e,pu],t,n)},snake:{get:()=>z([...e,mu],t,n)},default:{value:t=>z(e,t,n)},emptyAsValue:{get:()=>z(e,t,`value`)},emptyAsDefault:{get:()=>z(e,t,`default`)},maxLength:{value:r=>z([...e,e=>e.slice(0,r)],t,n)},prefix:{value:r=>z([...e,e=>e.startsWith(r)?e:`${r}${e}`],t,n)},suffix:{value:r=>z([...e,e=>e.endsWith(r)?e:`${e}${r}`],t,n)}}),_u(r,{type:`string`,default:t,emptyString:n})}function vu(e,t){let n=((n,r)=>{let i=hu(n,r);if(i===void 0||i===``)return t;let a=Number(i);return Number.isFinite(a)?e.reduce((e,t)=>t(e),a):t});return Object.defineProperties(n,{clamp:{value:(n,r)=>vu([...e,e=>Math.min(r,Math.max(n,e))],t)},min:{value:n=>vu([...e,e=>Math.max(n,e)],t)},max:{value:n=>vu([...e,e=>Math.min(n,e)],t)},step:{value:n=>vu([...e,e=>Math.round(e/n)*n],t)},default:{value:t=>vu(e,t)}}),_u(n,{type:`number`,default:t})}function yu(e){let t=((t,n)=>{let r=hu(t,n);return r===void 0?gu(t,n)||e:r===``?!0:[`true`,`1`,`yes`,`on`].includes(r.toLowerCase())});return Object.defineProperties(t,{default:{value:e=>yu(e)}}),_u(t,{type:`boolean`,default:e})}function bu(e,t){let n=((n,r)=>{let i=hu(n,r);return i!==void 0&&e.includes(i)?i:t});return Object.defineProperties(n,{default:{value:t=>bu(e,t)}}),_u(n,{type:`enum`,default:t,values:e})}function xu(e){let t=((t,n)=>{let r=hu(t,n);if(r===void 0||r===``)return e;try{return JSON.parse(r)}catch{return e}});return Object.defineProperties(t,{default:{value:e=>xu(e)}}),_u(t,{type:`json`,default:e})}var Su=(e,t)=>Object.fromEntries(Object.entries(t).map(([t,n])=>[t,n(e,t)])),Cu=(e,t)=>{let n=[];return Object.keys(t).forEach(r=>{let i=r;if(!Object.is(e[i],t[i])){let r=e[i];e[i]=t[i],n.push({key:i,previous:r,value:t[i]})}}),n},wu=e=>e,Tu=e=>{wu=e},B=({el:e,schema:t,onChange:n})=>{let r=new Set(Object.keys(t)),i=wu(Su(e,t)),a=null,o=!1,s=e=>{e.length>0&&n?.(a,e)};a=new Proxy(i,{set(e,t,n,i){if(typeof t!=`string`||!r.has(t))return Reflect.set(e,t,n,i);let a=t,c=e[a];if(Object.is(c,n))return!0;let l=Reflect.set(e,t,n,i);return l&&!o&&s([{key:a,previous:c,value:e[a],source:`property`}]),l}});let c=new MutationObserver(()=>{o=!0;let n=Cu(i,Su(e,t)).map(e=>({...e,source:`attribute`}));o=!1,s(n)});return c.observe(e,{attributes:!0,attributeFilter:Object.keys(t).map(e=>`data-${du(e)}`)}),Object.defineProperty(a,"disconnect",{value:()=>c.disconnect(),enumerable:!1}),a},V=z([],``),H=vu([],0),U=yu(!1),Eu=Object.assign(e=>xu(e),{object:e=>xu(e),array:e=>xu(e)}),W=(e,t)=>bu(e,t),Du=e=>typeof e==`string`?{type:e}:e,Ou=e=>e===void 0?[]:Array.isArray(e)?e:[e],ku=e=>e.split(`.`).at(-1)??e,Au=({enter:e=`enter`,exit:t=`exit`}={})=>({initial:`closed`,states:{closed:{on:{OPEN:`opening`}},opening:{tags:[`visible`,`interactive`,`animating`],entry:e,on:{ANIMATION_END:`open`,CLOSE:`closing`}},open:{tags:[`visible`,`interactive`],on:{CLOSE:`closing`}},closing:{tags:[`visible`,`animating`],entry:t,on:{ANIMATION_END:`closed`,OPEN:`opening`}}}}),ju=(e,t)=>{let n=new Map,r=new Map,i=new Map,a=!1,o=(e,t)=>{Object.entries(e).forEach(([e,i])=>{let a=t?`${t}.${e}`:e,s={key:e,path:a,tags:new Set(i.tags??[]),entry:Ou(i.entry),exit:Ou(i.exit),on:i.on??{}};i.id&&(s.id=i.id),t&&(s.parent=t),i.initial&&(s.initial=i.initial),n.set(a,s),s.id&&r.set(s.id,a),i.states&&o(i.states,a)})};o(e.states);let s=e=>{let t=n.get(e);if(!t)throw Error(`Unknown machine state: ${e}`);return t},c=e=>{let t=[],n=e;for(;n;){let e=s(n);t.push(e),n=e.parent}return t},l=(e,t)=>{let i=e;if(e.startsWith(`#`)){let t=r.get(e.slice(1));if(!t)throw Error(`Unknown machine state id: ${e}`);i=t}else !n.has(e)&&t?.parent&&(i=`${t.parent}.${e}`);let a=s(i);for(;a.initial;)a=s(`${a.path}.${a.initial}`);return a.path},u=e=>({context:t.context,event:e,state:v.state}),d=(e,t)=>{if(typeof t!=`function`)return;let n=i.get(e)??[];n.push(t),i.set(e,n)},f=(e,n,r)=>{e.forEach(e=>{let i=u(n);if(typeof e==`function`){d(r,e(i));return}let a=t.actions?.[e];if(a){a(i);return}let o=t.effects?.[e];o&&d(r,o(i))})},p=e=>{let t=i.get(e);t&&(t.splice(0).reverse().forEach(e=>e()),i.delete(e))},m=(e,n)=>{if(!e)return!0;let r=u(n);return typeof e==`function`?e(r):t.guards?.[e]?.(r)??!1},h=e=>{let t=c(v.state);for(let n of t){let t=Ou(n.on[e.type]);for(let r of t){if(typeof r==`string`)return{source:n,target:r,actions:[]};if(m(r.guard,e)){let e={source:n,actions:Ou(r.actions)};return r.target&&(e.target=r.target),e}}}return null},g=(e,t)=>{let n=v.state,r=e.target?l(e.target,e.source):n,i=c(n),a=c(r),o=new Set(a.map(e=>e.path)),s=i.filter(e=>!o.has(e.path)),u=i.find(e=>o.has(e.path)),d=a.filter(e=>e.path!==u?.path&&!i.some(t=>t.path===e.path)).reverse();s.forEach(e=>{p(e.path),f(e.exit,t,e.path)}),f(e.actions,t,e.source.path),v.state=r,d.forEach(e=>f(e.entry,t,e.path))},_=l(e.initial),v={state:_,context:t.context,send(e){if(a)return;let t=Du(e),n=h(t);n&&g(n,t)},matches(e){return v.state===e||ku(v.state)===e},hasTag(e){return c(v.state).some(t=>t.tags.has(e))},stop(){a||=(c(v.state).forEach(e=>p(e.path)),!0)}};return c(_).reverse().forEach(e=>f(e.entry,{type:`@@init`},e.path)),v},Mu=[`true`,`1`,`yes`,`on`],Nu=({value:e})=>e!==void 0&&(e===``||Mu.includes(e.toLowerCase())),Pu=({el:e,name:t,detail:n})=>{let r={bubbles:!0};n!==void 0&&(r.detail=n),e.dispatchEvent(new CustomEvent(t,r))},Fu=({target:e,event:t,handler:n,cleanup:r,options:i})=>{e.addEventListener(t,n,i);let a=()=>e.removeEventListener(t,n,i);return r?.push(a),a},Iu=({el:e,attr:t,present:n,value:r=``})=>{if(n){e.getAttribute(t)!==r&&e.setAttribute(t,r);return}e.removeAttribute(t)},Lu=({el:e,attr:t,value:n})=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},Ru=({el:e,attr:t})=>{e.hasAttribute(t)&&e.removeAttribute(t)},zu=({el:e})=>(e.closest(`[dir]`)?.dir||document.dir).toLowerCase()===`rtl`,Bu=(e,t)=>e.includes(t),Vu=({isEnabled:e,roots:t,onDismiss:n})=>{let r=r=>{if(!e())return;let i=r.composedPath();t().filter(e=>e!=null).some(e=>Bu(i,e))||n(r)};return document.addEventListener(`pointerdown`,r,{capture:!0}),()=>{document.removeEventListener(`pointerdown`,r,{capture:!0})}},Hu=({el:e,state:t,value:n=``})=>{Iu({el:e,attr:`data-disabled`,present:t.disabled??!1,value:n}),Iu({el:e,attr:`data-required`,present:t.required??!1,value:n}),Iu({el:e,attr:`data-invalid`,present:t.invalid??!1,value:n})},Uu=({input:e,state:t})=>{t.name!==void 0&&t.name!==``&&(e.name=t.name),t.value!==void 0&&(e.value=t.value),e.disabled=t.disabled??!1,e.required=t.nativeRequired??t.required??!1,`readOnly`in e&&(e.readOnly=t.readonly??!1),t.ariaRequired!==void 0&&e.setAttribute(`aria-required`,t.ariaRequired?`true`:`false`),t.invalid?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`)},Wu=e=>JSON.stringify({name:e.name,values:e.values,required:e.required??!1,form:e.form??``,marker:e.marker??`data-ui-hidden-input`}),Gu=({container:e,state:t,currentKey:n=``})=>{let r=t.marker??`data-ui-hidden-input`,i=Wu({...t,marker:r});return i===n?n:(e.replaceChildren(),t.name&&t.values.forEach(n=>{let i=document.createElement(`input`);i.type=`hidden`,i.name=t.name,i.value=n,i.setAttribute(r,``),t.required&&(i.required=!0),t.form&&i.setAttribute(`form`,t.form),e.append(i)}),i)},Ku=({container:e,fallback:t,marker:n})=>{let r=e?.querySelector(`input[${n}]`)??t;r.dispatchEvent(new Event(`input`,{bubbles:!0})),r.dispatchEvent(new Event(`change`,{bubbles:!0}))},qu=e=>e.trim().toLowerCase(),Ju=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),Yu=e=>{if(e)try{return JSON.parse(e)}catch{return}},Xu=(e,t)=>{if(!(!t||e==null))return t.split(`.`).reduce((e,t)=>{if(!(typeof e!=`object`||!e))return e[t]},e)};function Zu(e){if(Array.isArray(e))return e}function Qu(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function $u(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ed(e,t){if(e){if(typeof e==`string`)return $u(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$u(e,t):void 0}}function td(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nd(e,t){return Zu(e)||Qu(e,t)||ed(e,t)||td()}var rd=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bind=void 0;function t(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}e.bind=t})),id=r((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var n=rd();function r(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function i(e,n){return n==null?e:t(t({},e),{options:t(t({},r(n)),r(e.options))})}function a(e,t,r){var a=t.map(function(t){var a=i(t,r);return(0,n.bind)(e,a)});return function(){a.forEach(function(e){return e()})}}e.bindAll=a})),ad=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=rd();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=id();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}))(),od=`data-pdnd-honey-pot`;function sd(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function cd(e){var t=nd(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?sd(n)?r??null:n:null}function ld(e){"@babel/helpers - typeof";return ld=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ld(e)}function ud(e,t){if(ld(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ld(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dd(e){var t=ud(e,`string`);return ld(t)==`symbol`?t:t+``}function fd(e,t,n){return(t=dd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pd=2147483647,md={inset:`unset`,border:`none`,padding:0,margin:0,overflow:`visible`,color:`inherit`,background:`transparent`,width:`auto`,height:`auto`};function hd(e){var t=null;return function(){if(!t){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];t={result:e.apply(this,r)}}return t.result}}var gd=hd(function(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`});function _d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_d(Object(n),!0).forEach(function(t){fd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var yd=2,bd=yd/2;function xd(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function Sd(e){return{x:e.x-bd,y:e.y-bd}}function Cd(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function wd(e){return{x:Math.min(e.x,window.innerWidth-yd),y:Math.min(e.y,window.innerHeight-yd)}}function Td(e){var t=e.client,n=wd(Cd(Sd(xd(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:yd,height:yd})}function Ed(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function Dd(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function Od(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(od,`true`),gd()&&n.setAttribute(`popover`,`manual`);var r=Td({client:t});Object.assign(n.style,vd(vd({position:`fixed`},gd()?md:{zIndex:pd}),{},{backgroundColor:`transparent`,padding:0,margin:0,boxSizing:`border-box`,pointerEvents:`auto`},Ed({clientRect:r}))),document.body.appendChild(n),gd()&&n.showPopover();var i=(0,ad.bind)(window,{type:`pointermove`,listener:function(e){r=Td({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,Ed({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),Dd({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,ad.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function kd(){var e=null;function t(){return e=null,(0,ad.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=Od({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function Ad(e){if(Array.isArray(e))return $u(e)}function jd(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Md(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nd(e){return Ad(e)||jd(e)||ed(e)||Md()}var Pd=hd(function(){return navigator.userAgent.includes(`Firefox`)}),Fd=hd(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)}),Id={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};function Ld(e){var t=e.dragEnter;return Fd()?t.hasOwnProperty(Id.isEnteringWindow):!1}function Rd(e){var t=e.dragLeave;return Fd()?t.hasOwnProperty(Id.isLeavingWindow):!1}(function(){if(typeof window>`u`||!Fd())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,ad.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[Id.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[Id.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function zd(e){return`nodeName`in e}function Bd(e){return zd(e)&&e.ownerDocument!==document}function Vd(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?Fd()?Rd({dragLeave:t}):r==null?!0:Pd()?Bd(r):r instanceof HTMLIFrameElement:!1}function Hd(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){if(e<20){e++;return}t()}}()},{type:`pointerdown`,listener:t}]}function Ud(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var Wd=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];t=i,!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&=(cancelAnimationFrame(n),null)},r}(function(e){return e()}),Gd=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function Kd(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),Gd.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;Gd.flush(),Wd.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;Wd(function(){Gd.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;Gd.flush(),Wd.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var qd={isActive:!1};function Jd(){return!qd.isActive}function Yd(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function Xd(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function Zd(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!Jd())return;var a=$d({event:t,dragType:n,getDropTargetsOver:r});qd.isActive=!0;var o={current:a};Qd({event:t,current:a.dropTargets});var s=Kd({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=Xd({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=Ud(e),i=r({target:sd(e.target)?cd({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:o.current.dropTargets});i.length&&(e.preventDefault(),Qd({event:e,current:i})),c({dropTargets:i,input:t})}function u(){o.current.dropTargets.length&&c({dropTargets:[],input:o.current.input}),s.drop({current:o.current,updatedSourcePayload:null}),d()}function d(){qd.isActive=!1,f()}var f=(0,ad.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){Vd({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){if(o.current={dropTargets:o.current.dropTargets,input:Ud(e)},!o.current.dropTargets.length){u();return}e.preventDefault(),Qd({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:Ud(e)},u()}}].concat(Nd(Hd({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:Yd(t)})}function Qd(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function $d(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=Ud(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,current:[]})}}var ef={canStart:Jd,start:Zd},tf=new Map;function nf(e){var t=e.typeKey,n=e.mount,r=tf.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return tf.set(t,i),i}function rf(e){var t=nf(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),tf.delete(e.typeKey))}}function af(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(e){return e()})}}function of(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function sf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?sf(Object(n),!0).forEach(function(t){fd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lf(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=uf(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
5
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function uf(e,t){if(e){if(typeof e==`string`)return df(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?df(e,t):void 0}}function df(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ff(e){return e.slice(0).reverse()}function pf(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i=`data-drop-target-for-${t}`,a=`[${i}]`;function o(e){return r.set(e.element,e),function(){return r.delete(e.element)}}function s(e){return hd(af(of(e.element,{attribute:i,value:`true`}),o(e)))}function c(e){var t=e.source,i=e.target,o=e.input,s=e.result,l=s===void 0?[]:s;if(i==null)return l;if(!(i instanceof Element))return i instanceof Node?c({source:t,target:i.parentElement,input:o,result:l}):l;var u=i.closest(a);if(u==null)return l;var d=r.get(u);if(d==null)return l;var f={input:o,source:t,element:d.element};if(d.canDrop&&!d.canDrop(f))return c({source:t,target:d.element.parentElement,input:o,result:l});var p=d.getData?.call(d,f)??{},m=d.getDropEffect?.call(d,f)??n,h={data:p,element:d.element,dropEffect:m,isActiveDueToStickiness:!1};return c({source:t,target:d.element.parentElement,input:o,result:[].concat(Nd(l),[h])})}function l(e){var t=e.eventName,n=e.payload,i=lf(n.location.current.dropTargets),a;try{for(i.s();!(a=i.n()).done;){var o,s=a.value,c=r.get(s.element),l=cf(cf({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){i.e(e)}finally{i.f()}}var u={onGenerateDragPreview:l,onDrag:l,onDragStart:l,onDrop:l,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),i=new Set,a=lf(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;i.add(c.element);var l=r.get(c.element),u=n.has(c.element),d=cf(cf({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=lf(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!i.has(_.element)){var v=cf(cf({},t),{},{self:_}),y=r.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function d(e){u[e.eventName](e)}function f(e){var t=e.source,n=e.target,i=e.input,a=e.current,o=c({source:t,target:n,input:i});if(o.length>=a.length)return o;for(var s=ff(a),l=ff(o),u=[],d=0;d<s.length;d++){var f,p=s[d],m=l[d];if(m!=null){u.push(m);continue}var h=u[d-1],g=s[d-1];if(h?.element!==g?.element)break;var _=r.get(p.element);if(!_)break;var v={input:i,source:t,element:_.element};if(_.canDrop&&!_.canDrop(v)||!((f=_.getIsSticky)!=null&&f.call(_,v)))break;u.push(cf(cf({},p),{},{isActiveDueToStickiness:!0}))}return ff(u)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function mf(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=hf(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
6
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function hf(e,t){if(e){if(typeof e==`string`)return gf(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gf(e,t):void 0}}function gf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_f(Object(n),!0).forEach(function(t){fd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yf(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=vf({},r);e.add(i),n(i);function a(){e.delete(i),t&&t.active.delete(i)}return hd(a)}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var o=mf(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function bf(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=yf(),s=pf({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;ef.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:ef.canStart,start:l})}return rf({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var xf=hd(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),Sf=`pdnd:android-fallback`,Cf=`text/plain`,wf=`application/vnd.pdnd`,Tf=new WeakMap;function Ef(e){return Tf.set(e.element,e),function(){Tf.delete(e.element)}}var Df=kd(),Of=bf({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return af(Df.bindEvents(),(0,ad.bind)(document,{type:`dragstart`,listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n=t.target;if(n instanceof HTMLElement){var r=Tf.get(n);if(r){var i=Ud(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a)){t.preventDefault();return}if(r.dragHandle){var o=cd({x:i.clientX,y:i.clientY});if(!r.dragHandle.contains(o)){t.preventDefault();return}}var s=r.getInitialDataForExternal?.call(r,a)??null;if(s)for(var c=0,l=Object.entries(s);c<l.length;c++){var u=nd(l[c],2),d=u[0],f=u[1];t.dataTransfer.setData(d,f??``)}xf()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(Cf,Sf),t.dataTransfer.setData(wf,``);var p={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:p})}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=Tf.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:Df.getOnPostDispatch()});Of.dropTarget,Of.monitor;function kf(e){return hd(af(Of.registerUsage(),Ef(e),of(e.element,{attribute:`draggable`,value:`true`})))}var Af=function(){if(typeof window>`u`)return null;var e=new Image;return e.src=`data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==`,e}();function jf(e){var t=e.nativeSetDragImage;t&&Af&&t(Af,0,0)}var Mf=60,Nf=1,Pf=8,Ff=24,If=`[x-ui-resizable\\:handle], [data-ui-resize-handle]`,Lf=`data-ui-resizable-managed-disabled`,Rf=(e,t,n)=>{let r=Math.max(e,t);return n===null?r:Math.min(r,n)},zf=(e,t)=>!Number.isFinite(t)||t<=1?e:Math.round(e/t)*t,Bf=(e,t,n,r)=>Rf(zf(e,r),t,n),Vf=(e,t)=>{if(e===void 0||e.trim()===``)return t;let n=Number(e);return Number.isFinite(n)?n:t},Hf=e=>e===`onEnd`?`onEnd`:`onChange`,Uf=e=>e===`y`?`y`:`x`,Wf=({value:e,element:t,axis:n,fallback:r})=>{if(e===void 0||e.trim()===``)return r;let i=Number(e);if(Number.isFinite(i))return i;if(e.endsWith(`px`)){let t=Number(e.slice(0,-2));if(Number.isFinite(t))return t}if(e.endsWith(`rem`)){let t=Number(e.slice(0,-3)),n=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||`16`);if(Number.isFinite(t)&&Number.isFinite(n))return t*n}if(e.endsWith(`em`)){let n=Number(e.slice(0,-2)),r=Number.parseFloat(getComputedStyle(t).fontSize||`16`);if(Number.isFinite(n)&&Number.isFinite(r))return n*r}if(typeof document>`u`)return r;let a=document.createElement(`div`);a.style.position=`absolute`,a.style.visibility=`hidden`,a.style.pointerEvents=`none`,a.style.width=n===`x`?e:`0`,a.style.height=n===`y`?e:`0`,t.append(a);let o=a.getBoundingClientRect();a.remove();let s=n===`x`?o.width:o.height;return s>0?s:r},Gf=e=>({clientX:e.location.current.input.clientX,clientY:e.location.current.input.clientY}),Kf=e=>({clientX:e.location.initial.input.clientX,clientY:e.location.initial.input.clientY}),qf=e=>({$width:e.width,$height:e.height,$delta:e.delta,$axis:e.axis,$phase:e.phase,$previewWidth:e.previewWidth,$previewHeight:e.previewHeight}),Jf=({el:e,name:t,event:n})=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))},Yf=({element:e,handle:t,axis:n=`x`,min:r=Mf,max:i=null,step:a=Nf,mode:o=`onChange`,hitArea:s=Pf,coarseHitArea:c=Ff,disabled:l=()=>!1,onStart:u,onResize:d,onEnd:f})=>{let p=null,m=[],h=()=>{let n=l();return n?(e.setAttribute(`data-disabled`,``),e.setAttribute(Lf,``),t.setAttribute(`data-disabled`,``),t.setAttribute(Lf,``)):(e.hasAttribute(Lf)&&(e.removeAttribute(`data-disabled`),e.removeAttribute(Lf)),t.hasAttribute(Lf)&&(t.removeAttribute(`data-disabled`),t.removeAttribute(Lf))),t.setAttribute(`aria-disabled`,n?`true`:`false`),n},g=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches?c:s,_=()=>{e.setAttribute(`data-ui-resizable`,``),e.dataset.resizeAxis=n,e.dataset.resizeMode=o,t.setAttribute(`data-ui-resize-handle`,``),t.setAttribute(`role`,`separator`),t.setAttribute(`tabindex`,t.getAttribute(`tabindex`)??`0`),t.setAttribute(`aria-orientation`,n===`x`?`vertical`:`horizontal`),t.style.touchAction=`none`,n===`x`?t.style.minWidth=`${g()}px`:t.style.minHeight=`${g()}px`},v=n=>{Iu({el:e,attr:`data-resizing`,present:n}),Iu({el:t,attr:`data-resizing`,present:n})},y=({phase:t,delta:o,input:s,previewOnly:c=!1})=>{let l=e.getBoundingClientRect(),u=p??{width:l.width,height:l.height,startWidth:l.width,startHeight:l.height,startClientX:s.clientX,startClientY:s.clientY},d=n===`x`?Bf(u.startWidth+o,r,i,a):u.startWidth,f=n===`y`?Bf(u.startHeight+o,r,i,a):u.startHeight;return{width:c?u.width:d,height:c?u.height:f,previewWidth:d,previewHeight:f,delta:o,axis:n,phase:t,input:s}},b=e=>{let a=n===`x`?e.previewWidth:e.previewHeight;t.setAttribute(`aria-valuenow`,String(Math.round(a))),t.setAttribute(`aria-valuemin`,String(Math.round(r))),i===null?t.removeAttribute(`aria-valuemax`):t.setAttribute(`aria-valuemax`,String(Math.round(i)))},x=t=>{let n=e.getBoundingClientRect();p={width:n.width,height:n.height,startWidth:n.width,startHeight:n.height,startClientX:t.clientX,startClientY:t.clientY};let r=y({phase:`start`,delta:0,input:t});return b(r),v(!0),u?.(r),r},S=e=>{if(!p)return null;let t=y({phase:`resize`,delta:n===`x`?e.clientX-p.startClientX:e.clientY-p.startClientY,input:e,previewOnly:o===`onEnd`});return b(t),d?.(t),o===`onChange`&&(p.width=t.width,p.height=t.height),t},C=e=>{if(!p)return null;let t=y({phase:`end`,delta:n===`x`?e.clientX-p.startClientX:e.clientY-p.startClientY,input:e});return b(t),f?.(t),p=null,v(!1),t};_(),h(),b(y({phase:`start`,delta:0,input:{clientX:0,clientY:0}})),m.push(kf({element:e,dragHandle:t,canDrag:()=>!h(),getInitialData:()=>({type:`ui-resizable`}),onGenerateDragPreview:({nativeSetDragImage:e})=>jf({nativeSetDragImage:e}),onDragStart:e=>{h()||x(Kf(e))},onDrag:e=>{h()||S(Gf(e))},onDrop:e=>{C(Gf(e))}}));let w=t=>{if(h())return;let o=a*(t.shiftKey?10:1),s=null;if(n===`x`&&t.key===`ArrowRight`&&(s=o),n===`x`&&t.key===`ArrowLeft`&&(s=-o),n===`y`&&t.key===`ArrowDown`&&(s=o),n===`y`&&t.key===`ArrowUp`&&(s=-o),t.key===`Home`&&(s=r-e.getBoundingClientRect()[n===`x`?`width`:`height`]),t.key===`End`&&i!==null&&(s=i-e.getBoundingClientRect()[n===`x`?`width`:`height`]),s!==null&&(t.preventDefault(),x({clientX:0,clientY:0}),p)){p.startClientX=0,p.startClientY=0;let e=n===`x`?{clientX:s,clientY:0}:{clientX:0,clientY:s};S(e),C(e)}};return t.addEventListener(`keydown`,w),m.push(()=>t.removeEventListener(`keydown`,w)),()=>{m.forEach(e=>e()),v(!1)}},Xf=e=>{typeof e.directive==`function`&&e.directive(`ui-resizable`,(t,{value:n,expression:r},{cleanup:i})=>{if(!(t instanceof HTMLElement)||n===`handle`)return;let a=t,o=a.querySelector(If);if(!o)return;let s=Uf(a.dataset.resizeAxis),c=Wf({value:a.dataset.resizeMin??a.dataset.minWidth,element:a,axis:s,fallback:Mf}),l=a.dataset.resizeMax??a.dataset.maxWidth,u=l?Wf({value:l,element:a,axis:s,fallback:1/0}):null,d=Hf(a.dataset.resizeMode),f=r?e.evaluateLater(a,r):null,p=e=>{Jf({el:a,name:e.phase===`start`?`ui:resize-start`:e.phase===`end`?`ui:resize-end`:`ui:resize`,event:e}),f&&(d===`onEnd`&&e.phase===`resize`||f(void 0,qf(e)))};i(Yf({element:a,handle:o,axis:s,min:c,max:u===1/0?null:u,step:Vf(a.dataset.resizeStep,Nf),mode:d,hitArea:Vf(a.dataset.resizeHitArea,Pf),coarseHitArea:Vf(a.dataset.resizeCoarseHitArea,Ff),disabled:()=>a.hasAttribute(`data-disabled`)&&!a.hasAttribute(Lf)||a.hasAttribute(`data-resize-disabled`)||a.dataset.disabled===`true`&&!a.hasAttribute(Lf),onStart:p,onResize:p,onEnd:p}))})},Zf=e=>e.replace(/([A-Z])/g,`_$1`).toLowerCase(),Qf=({manifest:e})=>Object.freeze(e),$f=({schema:e,details:t})=>Object.fromEntries(Object.entries(e).map(([e,n])=>{let r=t[e]??{},i=n.meta,a={type:i.type,default:i.default};return i.values&&(a.values=i.values),r.description&&(a.description=r.description),r.initialOnly&&(a.initialOnly=!0),[r.name??Zf(e),a]})),G=({definition:e})=>Object.freeze(e),ep=e=>e===!0?`true`:e===!1||e==null?`false`:String(e),tp=(e,t,n)=>ep(t[n]??e.defaults?.[n]),np=(e,t,n)=>Object.entries(n.when).every(([n,r])=>tp(e,t,n)===ep(r)),K=({part:e,props:t={},className:n})=>{let r=[e.base];return Object.entries(e.variants??{}).forEach(([n,i])=>{r.push(i[tp(e,t,n)])}),e.compounds?.forEach(n=>{np(e,t,n)&&r.push(n.class)}),r.push(n),Ul(r)},rp=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,ip=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,ap=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function op(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){sp(e);return}return t}function sp(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function cp(e,t={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!ap.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(rp.test(e)||ip.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,op)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}String.fromCharCode;var lp=/#/g,up=/&/g,dp=/\//g,fp=/=/g,pp=/\+/g,mp=/%5e/gi,hp=/%60/gi,gp=/%7c/gi,_p=/%20/gi;function vp(e){return encodeURI(``+e).replace(gp,`|`)}function yp(e){return vp(typeof e==`string`?e:JSON.stringify(e)).replace(pp,`%2B`).replace(_p,`+`).replace(lp,`%23`).replace(up,`%26`).replace(hp,"`").replace(mp,`^`).replace(dp,`%2F`)}function bp(e){return yp(e).replace(fp,`%3D`)}function xp(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function Sp(e){return xp(e.replace(pp,` `))}function Cp(e){return xp(e.replace(pp,` `))}function wp(e=``){let t=Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=Sp(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=Cp(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function Tp(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${bp(e)}=${yp(t)}`).join(`&`):`${bp(e)}=${yp(t)}`:bp(e)}function Ep(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>Tp(t,e[t])).filter(Boolean).join(`&`)}var Dp=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Op=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,kp=/^([/\\]\s*){2,}[^/\\]/,Ap=/\/$|\/\?|\/#/,jp=/^\.?\//;function Mp(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?Dp.test(e):Op.test(e)||(t.acceptRelative?kp.test(e):!1)}function Np(e=``,t){return t?Ap.test(e):e.endsWith(`/`)}function Pp(e=``,t){if(!t)return(Np(e)?e.slice(0,-1):e)||`/`;if(!Np(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function Fp(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(Np(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function Ip(e,t){if(Rp(t)||Mp(e))return e;let n=Pp(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return Bp(n,e)}function Lp(e,t){let n=Hp(e);return n.search=Ep({...wp(n.search),...t}),Wp(n)}function Rp(e){return!e||e===`/`}function zp(e){return e&&e!==`/`}function Bp(e,...t){let n=e||``;for(let e of t.filter(e=>zp(e)))if(n){let t=e.replace(jp,``);n=Fp(n)+t}else n=e;return n}var Vp=Symbol.for(`ufo:protocolRelative`);function Hp(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!Mp(e,{acceptRelative:!0}))return t?Hp(t+e):Up(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=Up(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[Vp]:!r}}function Up(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function Wp(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[Vp]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var Gp=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}};function Kp(e){let t=e.error?.message||e.error?.toString()||``,n=e.request?.method||e.options?.method||`GET`,r=e.request?.url||String(e.request)||`/`,i=new Gp(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response?`${e.response.status} ${e.response.statusText}`:`<no response>`}${t?` ${t}`:``}`,e.error?{cause:e.error}:void 0);for(let t of[`request`,`options`,`response`])Object.defineProperty(i,t,{get(){return e[t]}});for(let[t,n]of[[`data`,`_data`],[`status`,`status`],[`statusCode`,`status`],[`statusText`,`statusText`],[`statusMessage`,`statusText`]])Object.defineProperty(i,t,{get(){return e.response&&e.response[n]}});return i}var qp=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`]));function Jp(e=`GET`){return qp.has(e.toUpperCase())}function Yp(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}var Xp=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),Zp=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function Qp(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return Zp.test(t)?`json`:t===`text/event-stream`?`stream`:Xp.has(t)||t.startsWith(`text/`)?`text`:`blob`}function $p(e,t,n,r){let i=em(t?.headers??e?.headers,n?.headers,r),a;return(n?.query||n?.params||t?.params||t?.query)&&(a={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:a,params:a,headers:i}}function em(e,t,n){if(!t)return new n(e);let r=new n(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(t,i);return r}async function tm(e,t){if(t)if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}var nm=new Set([408,409,425,429,500,502,503,504]),rm=new Set([101,204,205,304]);function im(e={}){let{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=e;async function i(e){let t=e.error&&e.error.name===`AbortError`&&!e.options.timeout||!1;if(e.options.retry!==!1&&!t){let t;t=typeof e.options.retry==`number`?e.options.retry:+!Jp(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):nm.has(n))){let n=typeof e.options.retryDelay==`function`?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,{...e.options,retry:t-1})}}let n=Kp(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,o={}){let s={request:a,options:$p(a,o,e.defaults,n),response:void 0,error:void 0};if(s.options.method&&(s.options.method=s.options.method.toUpperCase()),s.options.onRequest&&(await tm(s,s.options.onRequest),s.options.headers instanceof n||(s.options.headers=new n(s.options.headers||{}))),typeof s.request==`string`&&(s.options.baseURL&&(s.request=Ip(s.request,s.options.baseURL)),s.options.query&&(s.request=Lp(s.request,s.options.query),delete s.options.query),`query`in s.options&&delete s.options.query,`params`in s.options&&delete s.options.params),s.options.body&&Jp(s.options.method))if(Yp(s.options.body)){let e=s.options.headers.get(`content-type`);typeof s.options.body!=`string`&&(s.options.body=e===`application/x-www-form-urlencoded`?new URLSearchParams(s.options.body).toString():JSON.stringify(s.options.body)),e||s.options.headers.set(`content-type`,`application/json`),s.options.headers.has(`accept`)||s.options.headers.set(`accept`,`application/json`)}else (`pipeTo`in s.options.body&&typeof s.options.body.pipeTo==`function`||typeof s.options.body.pipe==`function`)&&(`duplex`in s.options||(s.options.duplex=`half`));let c;if(!s.options.signal&&s.options.timeout){let e=new r;c=setTimeout(()=>{let t=Error(`[TimeoutError]: The operation was aborted due to timeout`);t.name=`TimeoutError`,t.code=23,e.abort(t)},s.options.timeout),s.options.signal=e.signal}try{s.response=await t(s.request,s.options)}catch(e){return s.error=e,s.options.onRequestError&&await tm(s,s.options.onRequestError),await i(s)}finally{c&&clearTimeout(c)}if((s.response.body||s.response._bodyInit)&&!rm.has(s.response.status)&&s.options.method!==`HEAD`){let e=(s.options.parseResponse?`json`:s.options.responseType)||Qp(s.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await s.response.text(),t=s.options.parseResponse||cp;s.response._data=t(e);break}case`stream`:s.response._data=s.response.body||s.response._bodyInit;break;default:s.response._data=await s.response[e]()}}return s.options.onResponse&&await tm(s,s.options.onResponse),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await tm(s,s.options.onResponseError),await i(s)):s.response},o=async function(e,t){return(await a(e,t))._data};return o.raw=a,o.native=(...e)=>t(...e),o.create=(t={},n={})=>im({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),o}var am=(function(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`unable to locate global object`)})(),om=am.fetch?(...e)=>am.fetch(...e):()=>Promise.reject(Error(`[ofetch] global.fetch is not supported!`)),sm=am.Headers,cm=am.AbortController,lm=im({fetch:om,Headers:sm,AbortController:cm});async function um(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}function dm(e){let t=[],n=``,r=!1,i,a,o,s,c,l=0,u=!1;function d(e){let r=fm(n);i=r.data??i,a=r.id??a,o=r.event??o,s=r.retry??s,u&&(typeof i==`string`&&t.push({id:a,data:i,event:o??`message`,retry:s}),a=void 0,i=void 0,o=void 0,s=void 0,l=e),n=``}for(let t=0;t<e.length;t++){let i=e[t];switch(i){case`\r`:u=c===`
|
|
7
|
+
`||c===`\r`,r=!0,d(e[t+1]===`
|
|
8
|
+
`?t+2:t+1);break;case`
|
|
9
|
+
`:if(r){r=!1;break}u=c===`
|
|
10
|
+
`,d(t+1);break;default:n+=i;break}c=i}return{messages:t,leftoverData:e.substring(l)}}function fm(e){if(e.startsWith(`data:`))return{data:e.substring(5).trim()};if(e.startsWith(`id:`))return{id:e.substring(3).trim()};if(e.startsWith(`event:`))return{event:e.substring(6).trim()};if(e.startsWith(`retry:`)){let t=Number(e.substring(6).trim());if(!Number.isNaN(t))return Number.isInteger(t)?{retry:t}:{retry:Math.round(t)}}return{}}async function pm(e,t,n){let r=t.getReader(),i;for(;!e.signal.aborted&&!(i=await r.read()).done;)n(i.value)}var mm=`text/event-stream`,hm=`last-event-id`,gm=class{url;lastEventId;options;retryCount=0;retryInterval=0;maxRetryCount;maxRetryInterval;fetch;timeoutDurationMs;timeout;constructor(e,t={}){this.url=e,this.options=t,this.maxRetryCount=t.maxRetryCount,this.maxRetryInterval=t.maxRetryInterval??3e4,this.fetch=im({fetch:t.fetch})??lm,this.timeoutDurationMs=t.timeout}async _handleRetry(e,t){if(this.retryCount++,typeof this.maxRetryCount==`number`&&this.retryCount>=this.maxRetryCount){e._emitEvent({type:`error`,reason:`max retry count reached`});return}this.retryInterval===0?this.retryInterval=2:this.retryInterval>0&&(this.retryInterval*=2,this.retryInterval>=this.maxRetryInterval&&(this.retryInterval=this.maxRetryInterval)),await um(this.retryInterval),e._abortController.abort(),e._abortController=new AbortController,await this._handleConnection(e,t)}async _handleConnection(e,t){let n,r=e._abortController.signal;if(typeof this.options.headers==`function`){let e=this.options.headers();n=`then`in e&&typeof e.then==`function`?new Headers(await e.then(e=>e)):new Headers(e)}else n=new Headers(this.options.headers??{});typeof n.get(`accept`)!=`string`&&n.set(`accept`,mm),typeof this.lastEventId==`string`&&n.set(hm,this.lastEventId);let i,a={...this.options,method:this.options.method??`get`,responseType:`stream`,headers:n,signal:r,retry:!1,onRequest:n=>{if(!(e.signal.aborted||r.aborted)&&!_m(n.error))return t.onRequest?.(n)},onRequestError:async n=>{if(!(e.signal.aborted||r.aborted)&&!_m(n.error))return t.onRequestError?.(n)},onResponse:async e=>(i=e,ym(e,t)),onResponseError:async e=>{if(!r.aborted&&!_m(e.error))throw e.error===void 0&&(e.error=new Gp(`${e.response.status} ${e.response.statusText}`)),await t.onResponseError?.(e),e.error}};try{this.timeoutDurationMs&&(this.timeout=setTimeout(()=>{e._emitEvent({type:`error`,reason:`Timeout of ${this.timeoutDurationMs}ms exceeded`})},this.timeoutDurationMs));let n=await this.fetch.raw(this.url,a);clearTimeout(this.timeout),this.timeout=void 0,this.retryCount=0,this.retryInterval=0;let r=new TextDecoder,o=``,s=n.body;if(!s){let e=Error(`Expected response body to contain ReadableStream`);throw i.response=n,i.error=e,await t.onResponseError?.(i),e}await pm(e,s,e=>{let n=dm(o+r.decode(e,{stream:!0}));o=n.leftoverData??``;for(let e of n.messages)typeof e.id==`string`&&e.id.length>0&&(this.lastEventId=e.id),t.onMessage(e)})}catch(n){return r.aborted||e.signal.aborted||_m(n)?void 0:this._handleRetry(e,t)}if(!(e.signal.aborted||r.aborted)){if(this.options.retryStrategy===`on-error`){e._emitEvent({type:`end-of-stream`,reason:`Stream has ended`});return}return this._handleRetry(e,t)}}listen(e){let t=new vm(new AbortController,n=>{if(n===void 0){this._handleConnection(t,e);return}this._handleConnection(t,{...e,...n})});return this._handleConnection(t,e),t}};function _m(e){return e instanceof DOMException&&e.name===`AbortError`}var vm=class{didAbort=!1;_abortController;_connect;constructor(e,t){this._abortController=e??new AbortController,this._connect=t}abort(e){this._emitEvent({type:`manual`,reason:e})}reconnect(e){this.didAbort=!1,this._abortController.abort(),this._abortController=new AbortController,this._connect?.(e)}_abortHook;_emitEvent(e){this.didAbort||(this.didAbort=!0,this._abortHook?.(e),this._abortController.abort(e.reason))}onAbort(e){this._abortHook=e}get signal(){return this._abortController.signal}};async function ym(e,t){if(typeof t.onResponse==`function`&&await t.onResponse(e),!e.response.ok)return;let n=e.response.headers.get(`Content-Type`);if(typeof n!=`string`||!n.includes(`text/event-stream`)){let r=Error(`Expected server to response with Content-Type: '${mm}'. Got '${n}'`);throw e.error=r,typeof t.onResponseError==`function`&&await t.onResponseError(e),r}}var bm=!1,xm=!1,Sm=`__trellisUi`,Cm=(e,...t)=>{typeof console<`u`&&console.warn(e,...t)},wm=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t},Tm=e=>Array.from(wm(e).content.children).filter(e=>e instanceof HTMLElement),Em=(e,t)=>{t.forEach(t=>e.initTree(t))},Dm=(e,t)=>t||e.getAttribute(`x-merge`)||`replace`,Om=e=>{if(e.selector)return document.querySelector(e.selector);if(!e.target)return null;let t=e.target.startsWith(`#`)?e.target.slice(1):e.target;return document.getElementById(t)},km=(e,t,n)=>{let r=Dm(t,n.mode);if(r===`remove`){t.remove();return}if(!n.html){Cm(`x-ui-stream: received patch with no html`);return}if(r===`morph`||r===`outer`){if(typeof e.morph==`function`){e.morph(t,n.html,{key(e){return e.getAttribute(`data-ui-key`)||e.id||null}});return}Cm(`x-ui-stream: morph mode requires @alpinejs/morph; falling back to replace`)}if(r===`replace`||r===`morph`||r===`outer`){let[r]=Tm(n.html);if(!r){Cm(`x-ui-stream: replace mode produced no element`);return}t.replaceWith(r),e.initTree(r);return}if(r===`update`){let r=Tm(n.html);t.innerHTML=n.html,Em(e,Array.from(t.children).filter(e=>e instanceof HTMLElement)),r.length===0&&n.html.trim()&&e.initTree(t);return}let i=wm(n.html),a=Array.from(i.content.children).filter(e=>e instanceof HTMLElement);if(r===`append`){t.append(i.content),Em(e,a);return}if(r===`prepend`){t.prepend(i.content),Em(e,a);return}if(r===`before`){t.before(i.content),Em(e,a);return}r===`after`&&(t.after(i.content),Em(e,a))},Am=(e,t)=>{let n=Om(t);if(n){km(e,n,t);return}if(t.selector||t.target){Cm(`x-ui-stream: target not found`,t.selector??t.target);return}if(!t.html){Cm(`x-ui-stream: received patch with no html`);return}Tm(t.html).forEach(n=>{if(!n.id){Cm(`x-ui-stream: top-level element has no id, skipping`,n);return}let r=document.getElementById(n.id);r&&km(e,r,{...t,html:n.outerHTML})})},jm=(e,t)=>{let n=Array.isArray(t)?t:[t];Js(e,n,{scope:`target`,update:()=>{n.forEach(t=>Am(e,t))}})},Mm=(e,t)=>{Am(e,t)},Nm=e=>{document.dispatchEvent(new CustomEvent(e.event,{detail:e.detail??{},bubbles:!0,composed:!0}))},Pm=e=>typeof e==`object`&&!!e,Fm=e=>({...Pm(e)?e:{},[Sm]:!0}),Im=e=>Pm(e)&&e[Sm]===!0,Lm=()=>{Im(window.history.state)||window.history.replaceState(Fm(window.history.state),``,window.location.href)},Rm=e=>{Im(e.state)&&window.location.reload()},zm=e=>{if(!(e instanceof Element))return!1;let t=e._ajax_target;return!!(t&&Object.values(t).some(e=>e?.history===`push`))},Bm=e=>{zm(e.target)&&Lm()},Vm=()=>{xm||=(window.addEventListener(`popstate`,Rm),!0)},Hm=e=>{let t=e.mode??`push`;if(t===`assign`){window.location.assign(e.url);return}Vm(),Lm();let n=Fm(window.history.state);if(t===`replace`){window.history.replaceState(n,``,e.url);return}window.history.pushState(n,``,e.url)},Um=(e,t)=>{if(t.type===`patch`){let{type:n,...r}=t;jm(e,r);return}if(t.type===`dispatch`){let{type:e,...n}=t;Nm(n);return}if(t.type===`location`){Hm(t);return}Cm(`x-ui-stream: unknown UI effect`,t)},Wm=(e,t)=>{(Array.isArray(t)?t:[t]).forEach(t=>Um(e,t))},Gm=e=>typeof e==`object`&&!!e&&Array.isArray(e.events),Km=e=>{let t=e instanceof CustomEvent?e.detail:null,n=t?.headers;if(!n)return null;let r=n.get(`X-Trellis-UI-Events`);if(r)try{let e=JSON.parse(r);return Array.isArray(e)?e:null}catch{return Cm(`x-ui-stream: received invalid UI effect header`,r),null}if(n.get(`X-Trellis-UI-Response`)!==`events`)return null;try{let e=JSON.parse(t?.raw??`{}`);return Gm(e)?e.events??[]:null}catch{return Cm(`x-ui-stream: received invalid UI effect response`,t?.raw),null}},qm=e=>{try{return JSON.parse(e.data)}catch{return Cm(`x-ui-stream: received invalid JSON`,e.data),null}},Jm=(e,t)=>new gm(t).listen({onMessage(t){if(t.event===`trellis-ui-patch`){let n=qm(t);n&&jm(e,n);return}if(t.event===`trellis-ui-event`){let e=qm(t);e&&Nm(e);return}if(t.event===`trellis-ui-effects`){let n=qm(t);n&&Wm(e,n)}}}),Ym=e=>{typeof e.directive==`function`&&(Vm(),e.directive(`ui-stream`,(t,{expression:n},{cleanup:r})=>{if(!n)return;let i=null;i=Jm(e,n),r(()=>{i?.abort(),i=null})}),bm||=(document.addEventListener(`ajax:success`,t=>{Bm(t);let n=Km(t);n&&Wm(e,n)}),!0))},Xm=[`light`,`dark`,`system`],Zm=e=>typeof e==`string`&&Xm.includes(e),Qm=e=>Zm(e)?e:`system`,$m=()=>document.documentElement.dataset.themeStorageKey||`trellis-ui-theme`,eh=()=>Qm(document.documentElement.dataset.theme),th=()=>{try{return Qm(window.localStorage.getItem($m())||eh())}catch{return eh()}},nh=e=>{try{window.localStorage.setItem($m(),e)}catch{}},rh=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches,ih=e=>e===`dark`||e===`system`&&rh(),ah=e=>{let t=ih(e),n=t?`dark`:`light`,r=document.documentElement;return r.classList.toggle(`dark`,t),r.dataset.theme=e,r.dataset.resolvedTheme=n,r.dispatchEvent(new CustomEvent(`ui:theme-change`,{detail:{mode:e,resolved:n,dark:t,on:t},bubbles:!0})),{mode:e,resolved:n,dark:t,on:t}},oh=()=>{let e=ah(th());return{mode:e.mode,resolved:e.resolved,dark:e.dark,on:e.on,set(e){let t=Qm(e);nh(t);let n=ah(t);this.mode=n.mode,this.resolved=n.resolved,this.dark=n.dark,this.on=n.on},toggle(){this.set(this.dark?`light`:`dark`)}}},sh=e=>{if(typeof e.store!=`function`)return;let t=e.store(`theme`)??oh();e.store(`theme`,t),window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{if(t.mode!==`system`)return;let e=ah(`system`);t.mode=e.mode,t.resolved=e.resolved,t.dark=e.dark,t.on=e.on})},ch=0,lh=null,uh=()=>{if(ch===0){let e=document.documentElement,t=document.body,n=Math.max(0,window.innerWidth-e.clientWidth);lh={bodyOverflow:t.style.overflow,bodyPaddingRight:t.style.paddingRight,rootOverflow:e.style.overflow},e.style.overflow=`hidden`,t.style.overflow=`hidden`,n>0&&(t.style.paddingRight=`${n}px`),e.setAttribute(`data-ui-scroll-locked`,``)}ch+=1},dh=()=>{if(ch===0||(--ch,ch>0))return;let e=document.documentElement,t=document.body;t.style.overflow=lh?.bodyOverflow??``,t.style.paddingRight=lh?.bodyPaddingRight??``,e.style.overflow=lh?.rootOverflow??``,e.removeAttribute(`data-ui-scroll-locked`),lh=null},q={createAnchoredPopover:Vl,createCollectionNavigation:Jl,create:au,addDismissableLayer:Vu,addListener:Fu,asBool:Nu,dispatch:Pu,dispatchNativeControlChange:Ku,isRtl:zu,removeAttribute:Ru,setAttribute:Lu,setPresence:Iu,syncControlPresence:Hu,syncNativeControl:Uu,syncRepeatedHiddenInputs:Gu,getPathValue:Xu,normalizeOptionText:qu,parseItemData:Yu,splitControlValues:Ju,createResizable:Yf,mergeBindings:uu,createMachine:ju,createVisibilityMachine:Au,propsFromSchema:$f,resolveStyle:K,className:Wl,cx:Gl,motion:Ys,applyStreamPatch:Mm,applyStreamPatches:jm,applyUiEffect:Um,applyUiEffects:Wm,connectStream:Jm,dispatchStreamEvent:Nm,applyThemeMode:ah,createThemeStore:oh,lockDocumentScroll:uh,registerConfirm:nu,registerResizable:Xf,registerStream:Ym,registerThemeStore:sh,unregisterConfirm:ru,unlockDocumentScroll:dh},fh=[`xs`,`sm`,`md`,`lg`,`xlg`],ph=[`outline`,`filled`],mh=[`outline`,`solid`,`mini`,`micro`],hh=[`button`,`submit`,`reset`],gh=[`start`,`center`,`end`],_h=[`bottom`,`top`,`left`,`right`],vh=[`top`,`right`,`bottom`,`left`],yh=[`vertical`,`horizontal`],bh=[`leading`,`trailing`,`center`,`top-leading`,`top-trailing`,`bottom-leading`,`bottom-trailing`],xh=[`default`],Sh=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],Ch={inherit:`text-inherit`,muted:`text-foreground-muted`,subtle:`text-foreground-subtle`,accent:`text-accent-text`,danger:`text-danger-text`};Ch.muted,Ch.subtle,Ch.accent,Ch.danger;var wh=[`none`,`xs`,`sm`,`md`,`lg`,`full`],Th=[`solid`,`alpha`],Eh={none:`bg-transparent text-inherit`,app:`bg-app text-foreground`,chrome:`bg-chrome text-foreground`,subtle:`bg-surface-subtle text-foreground`,panel:`bg-surface-panel text-foreground`,raised:`bg-surface-raised text-foreground`,overlay:`bg-surface-overlay text-foreground`,accent:`bg-surface-accent text-surface-accent-fg`,inverse:`bg-surface-inverse text-surface-inverse-fg`},Dh={solid:``,alpha:``},Oh={xs:{none:``,xs:`rounded-1`,sm:`rounded-1`,md:`rounded-2`,lg:`rounded-3`,full:`rounded-full`},sm:{none:``,xs:`rounded-1`,sm:`rounded-2`,md:`rounded-2`,lg:`rounded-3`,full:`rounded-full`},md:{none:``,xs:`rounded-1`,sm:`rounded-2`,md:`rounded-3`,lg:`rounded-4`,full:`rounded-full`},lg:{none:``,xs:`rounded-2`,sm:`rounded-3`,md:`rounded-4`,lg:`rounded-5`,full:`rounded-full`},xlg:{none:``,xs:`rounded-2`,sm:`rounded-3`,md:`rounded-4`,lg:`rounded-5`,full:`rounded-full`}},kh=(e=>fh.flatMap(t=>wh.map(n=>({when:{size:t,radius:n},class:e[t][n]}))))(Oh),Ah=[`flex w-full min-w-0 items-center gap-control text-control-fg outline-none`],jh=[`flex w-full min-w-0 gap-control text-control-fg outline-none`],Mh=[`data-invalid:focus-within:shadow-danger-focus data-invalid:data-[state=open]:shadow-danger-focus`],Nh={xs:`min-h-control-xs px-1.5 text-xs`,sm:`min-h-control-sm px-2 text-xs`,md:`min-h-control-md px-3 text-sm`,lg:`min-h-control-lg px-3 text-sm`,xlg:`min-h-control-xlg px-4 text-sm`},Ph={xs:`min-h-control-lg px-1.5 py-1 text-xs`,sm:`min-h-control-xlg px-2 py-1.5 text-xs`,md:`min-h-12 px-3 py-2 text-sm`,lg:`min-h-20 px-3 py-2 text-sm`,xlg:`min-h-24 px-4 py-2 text-sm`},Fh={outline:`bg-control shadow-control`,filled:`bg-control-hover shadow-none hover:bg-control-active data-invalid:shadow-control data-disabled:bg-control-hover data-disabled:hover:bg-control-hover`},Ih=[`border-0 bg-transparent p-0 text-inherit text-control-fg outline-none`,`placeholder:text-control-placeholder`],Lh=[`inline-flex size-control-xs shrink-0 items-center justify-center rounded-2 border-0 bg-transparent`,`text-icon outline-none hover:bg-control-hover hover:text-control-fg`,`focus-visible:ring-2 focus-visible:ring-focus`],Rh=[`w-full bg-control text-control-fg shadow-control outline-none`],zh=[`absolute left-0 top-0 z-popover m-0 grid`,`rounded-3 bg-popover text-popover-fg shadow-popover outline-none`],Bh=[`ui-interactive:hover:bg-interactive-hover`,`ui-interactive:ui-active:bg-interactive-active`,`ui-interactive:ui-selected:bg-interactive-selected`,`ui-interactive:ui-selected:hover:bg-interactive-selected-hover`];[...Bh];var Vh=[`flex h-menu-item w-full cursor-default select-none items-center gap-2 rounded-2 px-menu-item-x`,`text-left text-sm font-normal text-menu-item-fg outline-none`,Bh,`data-disabled:pointer-events-none data-disabled:opacity-50`],Hh=`size-icon shrink-0 fill-current text-current opacity-70`,Uh=`ml-auto size-icon shrink-0 fill-current text-current opacity-0 data-selected:opacity-100`,Wh=[`single`,`multiple`],Gh=yh,Kh=[`trailing`,`leading`];[...Kh];var qh=Sh;[...qh];var Jh={mode:W(Wh,`single`),collapsible:U,disabled:U,orientation:W(Gh,`vertical`),defaultValue:V,defaultValues:V,value:V,values:V,loop:U.default(!0),iconPosition:W(Kh,`trailing`),headingAs:W(qh,`h3`),class:V},Yh=G({definition:{component:`ui.accordion`,parts:{root:{base:`grid w-full min-w-0 gap-0`,variants:{orientation:{vertical:``,horizontal:`gap-2 md:grid-flow-col md:auto-cols-fr`}},defaults:{orientation:`vertical`}},item:{base:`min-w-0 border-b border-border last:border-b-0 data-disabled:opacity-50`},heading:{base:`block text-foreground`},trigger:{base:[`flex min-h-control-xlg w-full min-w-0 items-center gap-2 rounded-2 border border-transparent px-3 py-2`,`text-left text-sm font-medium text-foreground outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`]},triggerLabel:{base:`min-w-0 flex-1`},icon:{base:`size-icon shrink-0 fill-current text-icon`},content:{base:`overflow-hidden text-sm text-foreground-muted`},contentInner:{base:`min-w-0 px-3 pb-3 pt-1`}}}}),Xh=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),Zh=e=>e?`open`:`closed`,Qh=e=>e instanceof HTMLButtonElement,$h=()=>({props:null,openValues:new Set,collection:null,cleanup:[],init(){this.props=B({el:this.$el,schema:Jh,onChange:(e,t)=>this.applyProps(t.map(e=>e.key))}),this.openValues=new Set(this.initialValues()),this.setupTriggers(),this.syncAll()},destroy(){this.props.disconnect(),this.teardown()},get root(){return q.mergeBindings({inputs:[q.resolveStyle({part:Yh.parts.root,props:this.props,className:this.props.class}),{"data-ui-accordion":``,":data-orientation":()=>this.props.orientation,":data-disabled":()=>this.props.disabled?``:void 0}]})},items(){return Array.from(this.$el.querySelectorAll(`[data-ui-accordion-item]`)).map((e,t)=>{let n=e.querySelector(`[data-ui-accordion-trigger]`),r=e.querySelector(`[data-ui-accordion-content]`);return!Qh(n)||!r?null:(e.dataset.value||(e.dataset.value=`item-${t+1}`),{item:e,heading:e.querySelector(`[data-ui-accordion-heading]`),trigger:n,content:r,value:e.dataset.value,isDisabled:this.props.disabled||q.asBool({value:e.dataset.disabled})})}).filter(e=>e!==null)},itemFromTrigger(e){return this.items().find(t=>t.trigger===e)??null},initialValues(){let e=this.propValues();return e.length>0?e:this.props.mode===`multiple`&&this.props.defaultValues?this.normalizeValues(Xh(this.props.defaultValues)):this.props.mode===`single`&&this.props.defaultValue?this.normalizeValues([this.props.defaultValue]):this.normalizeValues(this.items().filter(e=>q.asBool({value:e.item.dataset.open})||e.item.dataset.state===`open`).map(e=>e.value))},propValues(){return this.props.mode===`multiple`?this.normalizeValues(Xh(this.props.values||this.props.value)):this.props.value?this.normalizeValues([this.props.value]):[]},normalizeValues(e){let t=Array.from(new Set(e.filter(Boolean)));return this.props.mode===`single`?t.slice(0,1):t},applyProps(e=[]){if(e.includes(`value`)||e.includes(`values`)){this.setOpenValues(this.propValues(),!1);return}e.includes(`mode`)&&(this.openValues=new Set(this.normalizeValues(Array.from(this.openValues)))),this.syncAll()},isItemOpen(e){return this.openValues.has(e.value)},isItemDisabled(e){return e.isDisabled},canCollapseOpenItem(e){return this.props.mode===`multiple`||this.props.collapsible||!this.isItemOpen(e)},toggleItem(e,t){if(t?.preventDefault(),this.isItemDisabled(e)||!this.canCollapseOpenItem(e))return;if(this.props.mode===`single`){this.setOpenValues(this.isItemOpen(e)?[]:[e.value]);return}let n=new Set(this.openValues);n.has(e.value)?n.delete(e.value):n.add(e.value),this.setOpenValues(Array.from(n))},setOpenValues(e,t=!0){this.openValues=new Set(this.normalizeValues(e)),this.syncAll(),t&&this.dispatchChange()},syncAll(){this.syncRoot(),this.items().forEach(e=>this.syncItem(e))},syncRoot(){this.$el.dataset.orientation=this.props.orientation,this.$el.dataset.iconPosition=this.props.iconPosition,this.$el.dataset.mode=this.props.mode,this.props.disabled?this.$el.setAttribute(`data-disabled`,``):this.$el.removeAttribute(`data-disabled`)},syncItem(e){let t=this.isItemOpen(e),n=Zh(t),r=this.isItemDisabled(e),i=t&&!this.canCollapseOpenItem(e);if(e.item.dataset.state=n,e.item.dataset.orientation=this.props.orientation,e.item.className=q.resolveStyle({part:Yh.parts.item,props:this.props,className:e.item.dataset.class??``}),e.heading?.setAttribute(`data-state`,n),e.heading?.setAttribute(`data-orientation`,this.props.orientation),e.trigger.id||=this.$id(`accordion-trigger-${e.value}`),e.content.id||=this.$id(`accordion-content-${e.value}`),e.trigger.type=`button`,e.trigger.dataset.state=n,e.trigger.dataset.orientation=this.props.orientation,e.trigger.className=q.resolveStyle({part:Yh.parts.trigger,props:this.props,className:e.trigger.dataset.class??``}),e.trigger.setAttribute(`aria-expanded`,t?`true`:`false`),e.trigger.setAttribute(`aria-controls`,e.content.id),e.content.dataset.state=n,e.content.dataset.orientation=this.props.orientation,e.content.setAttribute(`aria-labelledby`,e.trigger.id),this.syncContent(e.content,t),r){e.item.setAttribute(`data-disabled`,``),e.heading?.setAttribute(`data-disabled`,``),e.trigger.setAttribute(`data-disabled`,``),e.trigger.setAttribute(`aria-disabled`,`true`),e.trigger.disabled=!0,e.content.setAttribute(`data-disabled`,``);return}e.item.removeAttribute(`data-disabled`),e.heading?.removeAttribute(`data-disabled`),e.trigger.removeAttribute(`data-disabled`),e.trigger.disabled=!1,e.content.removeAttribute(`data-disabled`),i?e.trigger.setAttribute(`aria-disabled`,`true`):e.trigger.removeAttribute(`aria-disabled`)},syncContent(e,t){e.hidden=!t},setupTriggers(){this.items().forEach(e=>{q.addListener({target:e.trigger,event:`click`,handler:t=>this.toggleItem(e,t),cleanup:this.cleanup}),q.addListener({target:e.trigger,event:`keydown`,handler:t=>{t instanceof KeyboardEvent&&this.handleTriggerKeydown(e.trigger,t)},cleanup:this.cleanup}),q.addListener({target:e.trigger,event:`focus`,handler:()=>this.collectionNav().activateItem({el:e.trigger}),cleanup:this.cleanup})})},teardown(){this.cleanup.forEach(e=>e()),this.cleanup=[]},collectionNav(){return this.collection||=q.createCollectionNavigation({root:()=>this.$el,itemSelector:`[data-ui-accordion-trigger]`,isDisabled:e=>q.asBool({value:e.dataset.disabled})||e.hasAttribute(`disabled`),loop:()=>this.props.loop}),this.collection},handleTriggerKeydown(e,t){let n=this.itemFromTrigger(e);if(!n)return;if(t.key===`Enter`||t.key===` `){this.toggleItem(n,t);return}let r=this.props.orientation;if(t.key===`Home`){t.preventDefault(),this.focusFirst();return}if(t.key===`End`){t.preventDefault(),this.focusLast();return}if(r===`vertical`){if(t.key===`ArrowDown`){t.preventDefault(),this.focusNext();return}t.key===`ArrowUp`&&(t.preventDefault(),this.focusPrevious());return}if(t.key===`ArrowRight`){t.preventDefault(),q.isRtl({el:this.$el})?this.focusPrevious():this.focusNext();return}t.key===`ArrowLeft`&&(t.preventDefault(),q.isRtl({el:this.$el})?this.focusNext():this.focusPrevious())},focusNext(){this.collectionNav().focusNext()},focusPrevious(){this.collectionNav().focusPrevious()},focusFirst(){this.collectionNav().focusFirst()},focusLast(){this.collectionNav().focusLast()},dispatchChange(){let e=Array.from(this.openValues),t={value:this.props.mode===`single`?e[0]??``:``,values:e};q.dispatch({el:this.$el,name:`ui:change`,detail:t})}}),eg=e=>{e.data(`UiAccordion`,()=>$h())};G({definition:{component:`ui.button`,parts:{root:{base:[`relative inline-flex min-w-0 shrink-0 select-none items-center gap-2 whitespace-nowrap font-normal outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`],variants:{align:{start:`justify-start`,center:`justify-center`,end:`justify-end`},size:{xs:`h-control-xs text-xs`,sm:`h-control-sm text-xs`,md:`h-control-md text-sm`,lg:`h-control-lg text-sm`,xlg:`h-control-xlg text-sm`},padded:{true:``,false:``},variant:{ghost:`bg-transparent shadow-none`,soft:`shadow-none`,surface:`shadow-border hover:shadow-border-hover`,outline:`bg-transparent shadow-none ring-1 ring-inset`,solid:`shadow-none`,link:`bg-transparent px-0 shadow-none`},color:{neutral:``,accent:``,danger:``},insetLeft:{true:``,false:``},insetRight:{true:``,false:``},insetTop:{true:`-mt-1`,false:``},insetBottom:{true:`-mb-1`,false:``}},compounds:[{when:{padded:!0,size:`xs`},class:`px-2`},{when:{padded:!0,size:`sm`},class:`px-2`},{when:{padded:!0,size:`md`},class:`px-3`},{when:{padded:!0,size:`lg`},class:`px-3`},{when:{padded:!0,size:`xlg`},class:`px-4`},{when:{padded:!1,size:`xs`},class:`w-control-xs px-0`},{when:{padded:!1,size:`sm`},class:`w-control-sm px-0`},{when:{padded:!1,size:`md`},class:`w-control-md px-0`},{when:{padded:!1,size:`lg`},class:`w-control-lg px-0`},{when:{padded:!1,size:`xlg`},class:`w-control-xlg px-0`},...kh,{when:{insetLeft:!0,size:`xs`},class:`-ml-2`},{when:{insetLeft:!0,size:`sm`},class:`-ml-2`},{when:{insetLeft:!0,size:`md`},class:`-ml-3`},{when:{insetLeft:!0,size:`lg`},class:`-ml-3`},{when:{insetLeft:!0,size:`xlg`},class:`-ml-4`},{when:{insetRight:!0,size:`xs`},class:`-mr-2`},{when:{insetRight:!0,size:`sm`},class:`-mr-2`},{when:{insetRight:!0,size:`md`},class:`-mr-3`},{when:{insetRight:!0,size:`lg`},class:`-mr-3`},{when:{insetRight:!0,size:`xlg`},class:`-mr-4`},{when:{variant:`ghost`,color:`neutral`},class:`text-foreground`},{when:{variant:`ghost`,color:`accent`},class:`text-accent-text`},{when:{variant:`ghost`,color:`danger`},class:`text-danger-text`},{when:{variant:`soft`,color:`neutral`},class:`bg-base-a2 text-foreground`},{when:{variant:`soft`,color:`accent`},class:`bg-accent-surface text-accent-text`},{when:{variant:`soft`,color:`danger`},class:`bg-danger-surface text-danger-text`},{when:{variant:`surface`,color:`neutral`},class:`bg-control text-foreground`},{when:{variant:`surface`,color:`accent`},class:`bg-control text-accent-text`},{when:{variant:`surface`,color:`danger`},class:`bg-control text-danger-text`},{when:{variant:`outline`,color:`neutral`},class:`text-foreground ring-border-interactive`},{when:{variant:`outline`,color:`accent`},class:`text-accent-text ring-accent-border`},{when:{variant:`outline`,color:`danger`},class:`text-danger-text ring-danger-border`},{when:{variant:`solid`,color:`neutral`},class:`bg-base-12 text-base-1 shadow-1`},{when:{variant:`solid`,color:`accent`},class:`bg-accent-solid text-accent-contrast shadow-1`},{when:{variant:`solid`,color:`danger`},class:`bg-danger-solid text-danger-contrast shadow-1`},{when:{variant:`link`,color:`neutral`},class:`text-foreground hover:text-foreground`},{when:{variant:`link`,color:`accent`},class:`text-accent-text hover:text-accent-12`},{when:{variant:`link`,color:`danger`},class:`text-danger-text hover:text-danger-12`}],defaults:{align:`center`,size:`md`,radius:`md`,padded:!0,variant:`surface`,color:`neutral`,insetLeft:!1,insetRight:!1,insetTop:!1,insetBottom:!1}},group:{base:`inline-flex items-center isolate`},content:{base:`flex min-w-0 flex-1 items-center gap-2`,variants:{align:{start:`justify-start`,center:`justify-center`,end:`justify-end`}},defaults:{align:`center`}},label:{base:`min-w-0`},loadingIndicator:{base:`pointer-events-none absolute inset-0 flex items-center justify-center`},icon:{base:`size-icon shrink-0 fill-current text-current`,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}}}}});var tg=`[data-ui-button]:not([data-ui-loading-mode="false"])`,ng=[`data-on`,`data-bind`,`data-ref`,`data-show`,`data-action`,`data-request`,`data-ui-request`,`wire:`],rg=[`ui:request-complete`,`ui:loading-complete`],ig=null,ag=e=>e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement,og=e=>{if(!(e instanceof Element))return null;let t=e.closest(tg);return ag(t)?t:null},sg=e=>e.getAttributeNames().some(e=>ng.some(t=>e.startsWith(t))),cg=e=>e instanceof HTMLButtonElement&&e.type===`submit`,lg=e=>e instanceof HTMLButtonElement&&(e.dataset.uiConfirm!==void 0||e.form?.dataset.uiConfirm!==void 0),ug=(e,t)=>t?.dataset.uiConfirm!==void 0||e?.dataset.uiConfirm!==void 0,dg=e=>e.dataset.uiLoadingMode===`true`||cg(e)||sg(e),fg=e=>e.dataset.uiSubmitting===`true`||e.getAttribute(`aria-disabled`)===`true`||e.hasAttribute(`disabled`),pg=e=>e.dataset.uiSubmitting===`true`||e.hasAttribute(`disabled`),mg=e=>{e.dataset.uiSubmitting=`true`,e.setAttribute(`data-ui-loading`,``),e.setAttribute(`aria-disabled`,`true`),e.setAttribute(`aria-busy`,`true`),e.dispatchEvent(new CustomEvent(`ui:loading-start`,{bubbles:!0})),e instanceof HTMLButtonElement?e.disabled=!0:e.tabIndex=-1},hg=e=>{e.dataset.initialLoading!==`true`&&(delete e.dataset.uiSubmitting,e.removeAttribute(`data-ui-loading`),e.removeAttribute(`aria-busy`),e.dataset.initialDisabled!==`true`&&(e.removeAttribute(`aria-disabled`),e instanceof HTMLButtonElement?e.disabled=!1:e.removeAttribute(`tabindex`),e.dispatchEvent(new CustomEvent(`ui:loading-end`,{bubbles:!0}))))},gg=(e,t)=>{window.setTimeout(()=>{!e.isConnected||pg(e)||mg(e)},0)},_g=e=>{let t=og(e.target);if(!(!t||!dg(t))){if(fg(t)){e.preventDefault(),e.stopImmediatePropagation();return}t instanceof HTMLButtonElement&&t.form&&!t.form.checkValidity()||lg(t)||gg(t,e)}},vg=e=>{let t=e,n=t.submitter instanceof HTMLElement?t.submitter:null,r=ag(n)?n:null,i=e.target instanceof HTMLFormElement?e.target:null,a=r?r.matches(tg)?r:null:i?.querySelector(tg)??null;e.defaultPrevented&&ug(i,n)||!a||!cg(a)||gg(a,e)},yg=()=>{document.querySelectorAll(`[data-ui-button][data-ui-submitting="true"]`).forEach(e=>hg(e))},bg=()=>{ig||=(document.addEventListener(`click`,_g,!0),document.addEventListener(`submit`,vg,!0),rg.forEach(e=>document.addEventListener(e,yg)),()=>{document.removeEventListener(`click`,_g,!0),document.removeEventListener(`submit`,vg,!0),rg.forEach(e=>document.removeEventListener(e,yg)),ig=null})},xg=yh,Sg=xh,Cg=bh,wg=fh,Tg=xh,Eg={value:V.default(`on`),name:V,label:V,description:V,checked:U,indeterminate:U,disabled:U,required:U,invalid:U,indicator:U.default(!0),placement:W(Cg,`leading`),icon:V,variant:W(Tg,`default`),size:W(wg,`md`),inputClass:V,indicatorClass:V,indicatorIconClass:V,iconClass:V,contentClass:V,labelClass:V,descriptionClass:V,class:V};({...Eg});var Dg={name:V,orientation:W(xg,`vertical`),variant:W(Sg,`default`),indicator:U.default(!0),placement:W(Cg,`leading`),disabled:U,required:U,invalid:U,class:V};W(wg,`md`);var Og=e=>{let t=e.querySelector(`[data-ui-checkbox-input]`);return t?{root:e,input:t,indicator:e.querySelector(`[data-ui-checkbox-indicator]`),checkedIcon:e.querySelector(`[data-ui-checkbox-indicator-icon="checked"]`),indeterminateIcon:e.querySelector(`[data-ui-checkbox-indicator-icon="indeterminate"]`),name:e.dataset.name||t.name||``,disabled:e.hasAttribute(`data-disabled`)||t.disabled,required:e.hasAttribute(`data-required`)||t.required,invalid:e.hasAttribute(`data-invalid`)||t.getAttribute(`aria-invalid`)===`true`}:null},kg=(e,t={})=>{let n=t.disabled??e.disabled,r=t.required??e.required,i=t.invalid??e.invalid,a=e.input.indeterminate||e.root.hasAttribute(`data-indeterminate`),o=e.input.checked&&!a,s=a?`indeterminate`:o?`checked`:`unchecked`;e.input.indeterminate=a,q.syncNativeControl({input:e.input,state:{disabled:n,required:r,invalid:i}}),a?e.input.setAttribute(`aria-checked`,`mixed`):e.input.removeAttribute(`aria-checked`),q.setAttribute({el:e.root,attr:`data-state`,value:s}),q.setPresence({el:e.root,attr:`data-checked`,present:o}),q.setPresence({el:e.root,attr:`data-indeterminate`,present:a}),q.syncControlPresence({el:e.root,state:{disabled:n,required:r,invalid:i}}),q.setPresence({el:e.input,attr:`data-checked`,present:o}),q.setPresence({el:e.input,attr:`data-indeterminate`,present:a}),e.indicator&&(q.setAttribute({el:e.indicator,attr:`data-state`,value:s}),q.setPresence({el:e.indicator,attr:`data-checked`,present:o}),q.setPresence({el:e.indicator,attr:`data-indeterminate`,present:a}),q.setPresence({el:e.indicator,attr:`data-disabled`,present:n}),q.setPresence({el:e.indicator,attr:`data-invalid`,present:i})),e.checkedIcon&&(q.setPresence({el:e.checkedIcon,attr:`data-checked`,present:o}),q.removeAttribute({el:e.checkedIcon,attr:`data-indeterminate`})),e.indeterminateIcon&&(q.setPresence({el:e.indeterminateIcon,attr:`data-indeterminate`,present:a}),q.removeAttribute({el:e.indeterminateIcon,attr:`data-checked`}))},Ag=()=>({props:null,listeners:[],init(){this.props=B({el:this.$el,schema:Eg,onChange:()=>this.sync()});let e=this.input();(this.props.indeterminate||this.$el.hasAttribute(`data-indeterminate`))&&(e.indeterminate=!0),q.addListener({target:e,event:`change`,handler:()=>{e.indeterminate=!1,this.$el.removeAttribute(`data-indeterminate`),this.sync()},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},input(){let e=this.$el.querySelector(`[data-ui-checkbox-input]`);if(!e)throw Error(`Checkbox requires a native checkbox input.`);return e},item(){let e=Og(this.$el);if(!e)throw Error(`Checkbox requires a native checkbox input.`);return e},sync(){let e=this.item();this.props.name&&(e.input.name=this.props.name),this.props.value&&(e.input.value=this.props.value),kg(e,{disabled:this.props.disabled||e.disabled,required:this.props.required||e.required,invalid:this.props.invalid||e.invalid})}}),jg=()=>({props:null,listeners:[],observer:null,init(){this.props=B({el:this.$el,schema:Dg,onChange:()=>this.sync()}),q.addListener({target:this.$el,event:`change`,handler:e=>{let t=e.target;!(t instanceof HTMLInputElement)||t.type!==`checkbox`||(t.indeterminate=!1,t.closest(`[data-ui-checkbox]`)?.removeAttribute(`data-indeterminate`),this.sync())},cleanup:this.listeners}),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this.$el,{childList:!0,subtree:!0}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect()},items(){return Array.from(this.$el.querySelectorAll(`[data-ui-checkbox]`)).map(Og).filter(e=>e!==null)},sync(){let e=this.$el;q.setAttribute({el:e,attr:`data-orientation`,value:this.props.orientation}),q.setAttribute({el:e,attr:`data-variant`,value:this.props.variant}),q.syncControlPresence({el:e,state:this.props}),this.items().forEach(e=>this.syncItem(e))},syncItem(e){this.props.name&&!e.name&&(e.input.name=this.props.name),kg(e,{disabled:this.props.disabled||e.disabled,required:this.props.required||e.required,invalid:this.props.invalid||e.invalid})}}),Mg=e=>{e.data(`UiCheckbox`,()=>Ag()),e.data(`UiCheckboxGroup`,()=>jg())},Ng=fh,Pg=ph,Fg=wh,Ig=_h,Lg=gh,Rg=mh,zg={name:V,value:V,values:V,placeholder:V,multiple:U,open:U,disabled:U,readonly:U,required:U,invalid:U,clearable:U,autoHighlight:U,filter:U.default(!0),path:V,loop:U.default(!0),size:W(Ng,`lg`),variant:W(Pg,`outline`),radius:W(Fg,`md`),side:W(Ig,`bottom`),align:W(Lg,`start`),offset:H.clamp(-100,100).default(0),gap:H.clamp(0,50).default(4),icon:V,iconTrailing:V.default(`chevron__down`),iconVariant:W(Rg,`outline`),inputClass:V,listboxClass:V,chipClass:V,class:V};W(Rg,`outline`);var Bg=G({definition:{component:`ui.combobox`,parts:{root:{base:`relative inline-grid w-full min-w-0`},control:{base:Ah,variants:{size:Nh,variant:Fh},defaults:{size:`lg`,variant:`outline`,radius:`md`},compounds:kh},chips:{base:`-ml-1.5 flex min-w-0 flex-wrap items-center gap-1`},chip:{base:[`inline-flex h-control-sm max-w-48 min-w-0 items-center gap-1 rounded-2 border border-border bg-current/10 px-2`,`text-sm font-normal text-foreground`]},chipLabel:{base:`min-w-0 flex-1`},chipRemove:{base:[`-mr-1 inline-flex size-control-xs shrink-0 items-center justify-center rounded-2 border-0 bg-transparent`,`text-icon outline-none hover:bg-base-a3 hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-focus`]},input:{base:[`w-full min-w-16 flex-1`,Ih]},icon:{base:`size-icon shrink-0 fill-current text-icon`,variants:{position:{leading:``,trailing:``}},defaults:{position:`leading`}},clear:{base:Lh},listbox:{base:[zh,`auto-rows-min content-start max-h-combobox-listbox min-w-48 gap-1 overflow-auto p-popover`]},option:{base:Vh},optionLabel:{base:`min-w-0 flex-1`},optionMeta:{base:`ml-auto text-menu-item-muted`},optionIcon:{base:Hh,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},optionIndicator:{base:Uh},group:{base:`grid auto-rows-min content-start gap-1`},label:{base:`px-menu-item-x py-1 text-menu-heading-fg`},empty:{base:`px-menu-item-x py-2 text-sm text-foreground-muted`},separatorRoot:{base:`-mx-popover my-popover h-px`},separatorRule:{base:`h-px w-full border-0 bg-menu-separator`}}}}),Vg=()=>({query:``,selectedValues:[],selectedLabels:[],activeValue:``,inputId:``,listboxId:``,props:null,machine:null,popover:null,listboxMotion:null,listeners:[],observer:null,renderedChipsKey:``,renderedHiddenInputsKey:``,init(){this.props=B({el:this.$el,schema:zg,onChange:(e,t)=>this.applyProps(t.map(e=>e.key))}),this.inputId=this.$id(`combobox-input`),this.listboxId=this.$id(`combobox-listbox`),this.machine=q.createMachine(q.createVisibilityMachine({enter:`enterListbox`,exit:`exitListbox`}),{context:{},actions:{enterListbox:()=>{this.props.autoHighlight&&!this.activeValue&&this.setActive(this.enabledVisibleOptions()[0]??null),this.sync(),this.listboxMotion?.enter({before:()=>{let e=this.listbox();e.hidden=!1,e.showPopover?.(),this.mount()},after:()=>{this.machine.matches(`opening`)&&this.machine.send(`ANIMATION_END`)}}),this.listboxMotion||this.machine.send(`ANIMATION_END`),q.dispatch({el:this.$el,name:`ui:open`})},exitListbox:()=>{this.activeValue=``,!this.props.multiple&&this.hasSelection()&&(this.query=this.selectedLabels[0]??``),this.syncClosedState(),this.exitListbox()}}});let e=this.options(),t=this.props.multiple?[...q.splitControlValues(this.props.values),...q.splitControlValues(this.props.value)]:q.splitControlValues(this.props.value).slice(0,1),n=e.filter(e=>q.asBool({value:e.el.dataset.selected})).map(e=>e.value);this.selectedValues=t.length>0?t:n,this.props.multiple||(this.selectedValues=this.selectedValues.slice(0,1)),this.selectedLabels=this.selectedValues.map(t=>e.find(e=>e.value===t)?.label??t),this.query=this.props.multiple?``:this.selectedLabels[0]??``,this.popover=q.createAnchoredPopover({reference:()=>this.control(),floating:()=>this.listbox(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset,matchReferenceWidth:!0}),this.listboxMotion=q.motion.createPresenceLifecycle({element:()=>this.listbox(),preset:`popover`}),this.setup(),this.sync(),this.props.open&&!this.props.disabled&&!this.props.readonly&&this.machine.send(`OPEN`)},destroy(){this.props.disconnect(),this.machine.stop(),this.listboxMotion?.destroy(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect(),this.unmount()},get isOpen(){return this.machine?.hasTag(`interactive`)??!1},get root(){return q.mergeBindings({inputs:[K({part:Bg.parts.root,props:this.props,className:this.props.class}),{"data-ui-combobox":``,":data-state":()=>this.isOpen?`open`:`closed`}]})},control(){let e=this.$el.querySelector(`[data-ui-combobox-control]`);if(!e)throw Error(`Combobox requires a control element.`);return e},input(){let e=this.$el.querySelector(`[data-ui-combobox-input]`);if(!e)throw Error(`Combobox requires an input element.`);return e},listbox(){let e=this.$el.querySelector(`[data-ui-combobox-listbox]`);if(!e)throw Error(`Combobox requires a listbox element.`);return e},chipsEl(){return this.$el.querySelector(`[data-ui-combobox-chips]`)},hiddenInputsEl(){return this.$el.querySelector(`[data-ui-combobox-hidden-inputs]`)},options(){let e=q.normalizeOptionText(this.query);return Array.from(this.$el.querySelectorAll(`[data-ui-combobox-option]`)).map((t,n)=>{let r=this.resolveOptionLabel(t),i=this.optionValue(t,r),a=q.asBool({value:t.dataset.disabled}),o=this.selectedValues.includes(i),s=!this.props.filter||e===``||q.normalizeOptionText(`${r} ${t.dataset.suffix??``}`).includes(e);return{el:t,id:t.id||`${this.listboxId}-option-${n}`,value:i,label:r,disabled:a,selected:o,visible:s}})},enabledVisibleOptions(){return this.options().filter(e=>e.visible&&!e.disabled)},hasSelection(){return this.selectedValues.length>0},hasClearValue(){return this.query.length>0||this.hasSelection()},valuesFromProps(){let e=this.props.multiple?[...q.splitControlValues(this.props.values),...q.splitControlValues(this.props.value)]:q.splitControlValues(this.props.value).slice(0,1);return this.props.multiple?Array.from(new Set(e)):e.slice(0,1)},applyProps(e=[]){if(e.includes(`value`)||e.includes(`values`)||e.includes(`multiple`)){let e=this.options();this.selectedValues=this.valuesFromProps(),this.selectedLabels=this.selectedValues.map(t=>e.find(e=>e.value===t)?.label??t),this.query=this.props.multiple?``:this.selectedLabels[0]??``}e.includes(`open`)&&(this.props.open&&!this.props.disabled&&!this.props.readonly?this.machine.send(`OPEN`):this.machine.send(`CLOSE`)),(e.includes(`disabled`)||e.includes(`readonly`))&&(this.props.disabled||this.props.readonly)&&this.machine.send(`CLOSE`),this.sync()},open(e){e?.preventDefault(),!this.props.disabled&&this.machine.send(`OPEN`)},close(e){e?.preventDefault(),this.machine.send(`CLOSE`)},toggle(e){if(e?.preventDefault(),!(this.props.readonly||this.props.disabled)){if(this.isOpen){this.close();return}this.open(),this.input().focus({preventScroll:!0})}},clear(e){e?.preventDefault(),!(this.props.disabled||this.props.readonly)&&(this.query=``,this.selectedValues=[],this.selectedLabels=[],this.activeValue=``,this.sync(),this.input().focus({preventScroll:!0}),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-combobox-hidden-input`}),q.dispatch({el:this.$el,name:`ui:clear`}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:``,values:[],labels:[]}}))},removeValue(e){if(this.props.disabled||this.props.readonly)return;let t=this.options();this.selectedValues=this.selectedValues.filter(t=>t!==e),this.selectedLabels=this.selectedValues.map(e=>t.find(t=>t.value===e)?.label??e),this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-combobox-hidden-input`}),this.input().focus({preventScroll:!0}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],labels:[...this.selectedLabels]}})},removeLastValue(e){!this.props.multiple||this.query!==``||this.selectedValues.length===0||(e?.preventDefault(),this.removeValue(this.selectedValues[this.selectedValues.length-1]))},selectOption(e,t){if(t?.preventDefault(),!(this.props.disabled||this.props.readonly||e.disabled)){if(this.props.multiple){this.selectedValues.includes(e.value)?this.selectedValues=this.selectedValues.filter(t=>t!==e.value):this.selectedValues=[...this.selectedValues,e.value];let t=this.options();this.selectedLabels=this.selectedValues.map(e=>t.find(t=>t.value===e)?.label??e),this.query=``,this.open()}else this.selectedValues=[e.value],this.selectedLabels=[e.label],this.query=e.label,this.input().focus({preventScroll:!0}),this.close();this.sync(),this.props.multiple&&this.input().focus({preventScroll:!0}),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-combobox-hidden-input`}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],label:this.selectedLabels[0]??``,labels:[...this.selectedLabels]}})}},setActive(e){(e?.value??``)!==this.activeValue&&(this.activeValue=e?.value??``,this.syncOptions(),this.syncInput())},moveActive(e){let t=this.enabledVisibleOptions();if(t.length===0)return;let n=t.findIndex(e=>e.value===this.activeValue),r=n+e;n<0&&(r=e>0?0:t.length-1),r>=t.length&&(r=this.props.loop?0:t.length-1),r<0&&(r=this.props.loop?t.length-1:0),this.setActive(t[r]??null)},focusFirst(){this.setActive(this.enabledVisibleOptions()[0]??null)},focusLast(){let e=this.enabledVisibleOptions();this.setActive(e[e.length-1]??null)},handleInput(e){if(this.props.readonly||this.props.disabled)return;let t=e.target;t instanceof HTMLInputElement&&(this.query=t.value,!this.props.multiple&&this.selectedLabels[0]!==this.query&&(this.selectedValues=[],this.selectedLabels=[]),this.open(),this.props.autoHighlight?this.focusFirst():this.setActive(null),this.sync())},handleKeydown(e){if(e.key===`ArrowDown`){e.preventDefault(),this.isOpen||this.open(),this.moveActive(1);return}if(e.key===`ArrowUp`){e.preventDefault(),this.isOpen||this.open(),this.moveActive(-1);return}if(this.isOpen&&e.key===`Home`){e.preventDefault(),this.focusFirst();return}if(this.isOpen&&e.key===`End`){e.preventDefault(),this.focusLast();return}if(e.key===`Enter`&&this.isOpen&&this.activeValue){let t=this.options().find(e=>e.value===this.activeValue);t&&this.selectOption(t,e);return}if((e.key===`Backspace`||e.key===`Delete`)&&this.props.multiple&&this.query===``){let t=this.input();t.selectionStart===0&&t.selectionEnd===0&&this.removeLastValue(e);return}e.key===`Escape`&&this.isOpen&&this.close(e)},handleFocusout(e){let t=e.relatedTarget;if(!(t instanceof Node)){this.close();return}this.$el.contains(t)||this.listbox().contains(t)||this.close()},sync(){this.syncControl(),this.syncInput(),this.syncListbox(),this.syncOptions(),this.syncHiddenInputs(),this.syncChips()},syncOptions(){let e=this.options(),t=this.$el.querySelector(`[data-ui-combobox-empty]`),n=e.some(e=>e.visible);e.forEach(e=>{e.el.id=e.id,e.el.hidden=!e.visible,e.el.setAttribute(`role`,`option`),e.el.setAttribute(`aria-selected`,e.selected?`true`:`false`),e.el.dataset.value=e.value,e.el.dataset.label=e.label,q.setPresence({el:e.el,attr:`data-selected`,present:e.selected,value:`true`}),q.setPresence({el:e.el,attr:`data-highlighted`,present:e.value===this.activeValue,value:`true`}),q.setPresence({el:e.el,attr:`data-disabled`,present:e.disabled,value:`true`}),e.el.querySelectorAll(`[data-ui-combobox-option-indicator]`).forEach(t=>{q.setPresence({el:t,attr:`data-selected`,present:e.selected,value:`true`})}),e.disabled?e.el.setAttribute(`aria-disabled`,`true`):e.el.removeAttribute(`aria-disabled`)}),t&&(t.hidden=n)},syncInput(){let e=this.input();e.id||=this.inputId,e.value!==this.query&&(e.value=this.query),e.setAttribute(`role`,`combobox`),e.setAttribute(`autocomplete`,`off`),e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.listboxId),q.syncNativeControl({input:e,state:{disabled:this.props.disabled,readonly:this.props.readonly,required:this.props.required,nativeRequired:this.props.required&&!this.props.multiple,invalid:this.props.invalid,ariaRequired:this.props.required}});let t=this.options().find(e=>e.value===this.activeValue);t?e.setAttribute(`aria-activedescendant`,t.id):e.removeAttribute(`aria-activedescendant`)},syncControl(){let e=this.control(),t=K({part:Bg.parts.control,props:this.props});e.setAttribute(`class`,t),e.setAttribute(`data-ui-control`,``),e.setAttribute(`data-ui-combobox-control`,``),e.dataset.state=this.isOpen?`open`:`closed`,e.dataset.variant=this.props.variant,q.syncControlPresence({el:e,state:{disabled:this.props.disabled,invalid:this.props.invalid},value:`true`})},syncListbox(){let e=this.listbox(),t=K({part:Bg.parts.listbox,props:this.props,className:this.props.listboxClass});e.id=this.listboxId,e.setAttribute(`class`,t),e.setAttribute(`role`,`listbox`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`popover`,`manual`),e.setAttribute(`data-ui-combobox-listbox`,``),e.dataset.state=this.isOpen?`open`:`closed`,e.hidden=!this.isOpen,this.props.multiple?e.setAttribute(`aria-multiselectable`,`true`):e.removeAttribute(`aria-multiselectable`)},syncClosedState(){this.syncControl(),this.syncInput(),this.syncOptions(),this.syncHiddenInputs(),this.syncChips()},syncHiddenInputs(){let e=this.hiddenInputsEl();e&&(this.renderedHiddenInputsKey=q.syncRepeatedHiddenInputs({container:e,state:{name:this.props.name,required:this.props.required,values:this.selectedValues,form:this.$el.dataset.form??``,marker:`data-ui-combobox-hidden-input`},currentKey:this.renderedHiddenInputsKey}))},syncChips(){let e=this.chipsEl();if(!e)return;let t=!this.props.multiple||this.selectedValues.length===0;e.hidden=t;let n=JSON.stringify({hidden:t,values:this.selectedValues,labels:this.selectedLabels,chipClass:this.props.chipClass});if(n===this.renderedChipsKey||(this.renderedChipsKey=n,e.replaceChildren(),e.hidden))return;let r=K({part:Bg.parts.chip,props:{},className:this.props.chipClass}),i=K({part:Bg.parts.chipLabel}),a=K({part:Bg.parts.chipRemove});this.selectedValues.forEach((t,n)=>{let o=this.selectedLabels[n]??t,s=document.createElement(`span`);s.className=r,s.setAttribute(`data-ui-combobox-chip`,``);let c=document.createElement(`span`);c.className=i,c.setAttribute(`data-ui-combobox-chip-label`,``),c.textContent=o,s.append(c);let l=document.createElement(`button`);l.type=`button`,l.className=a,l.setAttribute(`data-ui-combobox-chip-remove`,``),l.setAttribute(`aria-label`,`Remove ${o}`);let u=this.$el.querySelector(`[data-ui-combobox-chip-remove-icon]`);u?l.append(u.content.cloneNode(!0)):l.textContent=`x`,l.addEventListener(`click`,()=>this.removeValue(t)),s.append(l),e.append(s)})},syncPosition(){this.popover?.sync()},mount(){this.popover?.mount()},unmount(){this.popover?.unmount()},exitListbox(){let e=()=>{let e=this.listbox();e.dataset.state=`closed`,e.hidden=!1};if(!this.listboxMotion){e(),this.finishClose(),this.machine.send(`ANIMATION_END`);return}this.listboxMotion.exit({before:e,after:()=>{this.machine.matches(`closing`)&&(this.finishClose(),this.machine.send(`ANIMATION_END`))}})},finishClose(){this.isOpen||(this.listbox().hidePopover?.(),this.unmount(),this.syncListbox(),q.dispatch({el:this.$el,name:`ui:close`}))},setup(){let e=this.input(),t=this.control(),n=this.listbox();q.addListener({target:e,event:`focus`,handler:()=>this.open(),cleanup:this.listeners}),q.addListener({target:e,event:`input`,handler:e=>this.handleInput(e),cleanup:this.listeners}),q.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners}),q.addListener({target:this.$el,event:`focusout`,handler:e=>{e instanceof FocusEvent&&this.handleFocusout(e)},cleanup:this.listeners}),q.addListener({target:t,event:`click`,handler:t=>{let n=t.target;n instanceof Element&&n.closest(`[data-ui-combobox-clear], [data-ui-combobox-toggle]`)||document.activeElement!==e&&e.focus({preventScroll:!0})},cleanup:this.listeners}),q.addListener({target:t,event:`click`,handler:e=>{let t=e.target;t instanceof Element&&(t.closest(`[data-ui-combobox-clear]`)&&this.clear(e),t.closest(`[data-ui-combobox-toggle]`)&&this.toggle(e))},cleanup:this.listeners}),q.addListener({target:n,event:`pointerdown`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(`[data-ui-combobox-option]`)&&e.preventDefault()},cleanup:this.listeners}),q.addListener({target:n,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-combobox-option]`),r=n?this.options().find(e=>e.el===n):void 0;r&&this.selectOption(r,e)},cleanup:this.listeners}),q.addListener({target:n,event:`pointermove`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-combobox-option]`),r=n?this.options().find(e=>e.el===n):void 0;r&&!r.disabled&&this.setActive(r)},cleanup:this.listeners}),q.addListener({target:n,event:`pointerleave`,handler:()=>{this.setActive(null)},cleanup:this.listeners}),this.listeners.push(q.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,n],onDismiss:()=>this.close()})),this.observer=new MutationObserver(()=>{this.sync(),this.props.autoHighlight&&this.isOpen&&!this.activeValue&&this.focusFirst()}),this.observer.observe(n,{childList:!0,subtree:!0})},resolveOptionLabel(e){let t=q.parseItemData(e.dataset.item),n=q.getPathValue(t,this.props.path);return n==null?(e.querySelector(`[data-ui-combobox-option-label]`)?.textContent??e.textContent??``).trim():String(n)},optionValue(e,t){return e.dataset.value||t}}),Hg=e=>{e.data(`UiCombobox`,()=>Vg())},Ug=[`single`,`range`],Wg=[`enhanced`,`native`],Gg=[`popover`,`modal`,`native`],Kg=[`select`,`confirm`],qg=[`neutral`,`accent`],Jg=wh,Yg=[`left`,`right`,`top`,`bottom`],Xg={name:V,value:V,startName:V,endName:V,mode:W(Ug,`single`),placeholder:V,min:V,max:V,today:V,openTo:V,forceOpenTo:U,months:H.clamp(0,12).default(0),firstDayOfWeek:H.clamp(-1,6).default(0),locale:V,showOutsideDays:U,showWeekNumbers:U,fixedWeeks:U.default(!0),selectableHeader:U,withToday:U,clearable:U,disabled:U,readonly:U,required:U,invalid:U,side:W(_h,`bottom`),align:W(gh,`start`),offset:H.clamp(-100,100).default(0),gap:H.clamp(0,50).default(4),mobile:W(Gg,`modal`),variant:W(Wg,`enhanced`),color:W(qg,`neutral`),radius:W(Jg,`md`),close:W(Kg,`select`),presets:Eu.array([]),presetsPosition:W(Yg,`left`),preset:V,presetName:V,triggerClass:V,inputClass:V,popoverClass:V,calendarClass:V,presetsClass:V,presetClass:V,class:V,form:V};W(Yg,`left`);var Zg=G({definition:{component:`ui.date-picker`,parts:{root:{base:`relative inline-grid w-full min-w-0`},trigger:{base:[Ah,Mh,Nh.lg,Fh.outline,`text-left`],variants:{radius:Oh.lg},defaults:{radius:`md`}},customTrigger:{base:[`inline-flex min-h-control-lg min-w-control-lg shrink-0 items-center justify-center gap-control bg-control px-2 text-sm text-control-fg shadow-control outline-none`,`hover:bg-control-hover hover:text-control-fg`,`focus-visible:ring-2 focus-visible:ring-focus`,`data-disabled:bg-control-disabled data-disabled:text-control-disabled-fg data-disabled:shadow-control-disabled`,`data-disabled:hover:bg-control-disabled data-disabled:hover:text-control-disabled-fg`],variants:{radius:Oh.lg},defaults:{radius:`md`}},input:{base:[`min-w-0 flex-1 text-sm`,Ih]},icon:{base:`size-icon shrink-0 fill-current text-icon`},action:{base:Lh},popover:{base:[zh,`max-h-lg overflow-hidden`]},panel:{base:`grid min-w-72 max-w-[calc(100vw-2rem)] gap-0 overflow-hidden`,variants:{hasPresets:{true:``,false:``},presetsPosition:{left:``,right:``,top:``,bottom:``}},compounds:[{when:{hasPresets:!0,presetsPosition:`left`},class:`sm:grid-cols-[minmax(9rem,11rem)_auto]`},{when:{hasPresets:!0,presetsPosition:`right`},class:`sm:grid-cols-[auto_minmax(9rem,11rem)]`}],defaults:{hasPresets:!1,presetsPosition:`left`}},calendarWrap:{base:`relative grid size-full place-items-center overflow-x-auto overflow-y-auto p-popover`},calendar:{base:`grid max-w-full gap-2 text-sm text-foreground`},presets:{base:[`grid content-start gap-1 border-popover-border p-popover`,`sm:data-[position=left]:border-r sm:data-[position=right]:border-l data-[position=top]:border-b data-[position=bottom]:border-t`]},preset:{base:Vh},footer:{base:`flex items-center justify-end gap-2 border-t border-popover-border p-popover`},nativeWrapper:{base:`relative w-full min-w-0`},native:{base:[Rh,Nh.lg],variants:{radius:Oh.lg},defaults:{radius:`md`}}}}}),Qg=i({CalendarDate:()=>fy,CalendarMonth:()=>oy,CalendarMulti:()=>vy,CalendarRange:()=>_y,CalendarSelectMonth:()=>hy,CalendarSelectYear:()=>my});function $g(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function e_(e,t){let n,r=e=>{let{length:i}=e;for(let a=0;a<i;a++){let i=e[a];if(i&&Array.isArray(i))r(i);else{let e=typeof i;if(i==null||e===`function`||e===`boolean`)continue;e===`string`||e===`number`?(n??=``,n+=i):(n!=null&&(t(n),n=null),t(i))}}};r(e),n!=null&&t(n)}function t_(e,t,n,r,i){let{type:a,reflect:o,event:s,value:c,attr:l=sv(t)}=n?.name!=rv&&X_(n)&&n!=iv?n:{type:n},u=a?.name===rv&&a.map,d=c==null?null:a==Function||!Y(c)?()=>c:c;Object.defineProperty(e,t,{configurable:!0,set(e){let n=this[t];d&&a!=Boolean&&e==null&&(e=d());let{error:r,value:i}=(u?uv:dv)(a,e);if(r&&i!=null)throw new tv(this,`The value defined for prop '${t}' must be of type '${a.name}'`,i);n!=i&&(this._props[t]=i??void 0,this.update(),s&&ov(this,s),this.updated.then(()=>{o&&(this._ignoreAttr=l,cv(this,a,l,this[t]),this._ignoreAttr=null)}))},get(){return this._props[t]}}),d&&(i[t]=d()),r[l]={prop:t,type:a}}function n_(e){let{styles:t}=e.constructor,{shadowRoot:n}=e;if(n&&t.length){let e=[];e_(t,t=>{t&&(t instanceof Element?n.appendChild(t.cloneNode(!0)):e.push(t))}),e.length&&(n.adoptedStyleSheets=e)}}function r_(e,t,n){return i_(this,e,t,n)}function i_(e,t,n=jv,r,i){let a;if(t&&t[n]&&t[n].vnode==e||e[Mv]!=Pv)return t;(e||!t)&&(i||=e.type==`svg`,a=e.type!=`host`&&(e.raw==1?(t&&e.clone?t[Nv]:t)!=e.type:e.raw==2?!(t instanceof e.type):t?t[Nv]||t.localName!=e.type:!t),a&&e.type!=null&&(e.raw==1&&e.clone?(r=!0,t=e.type.cloneNode(!0),t[Nv]=e.type):t=e.raw==1?e.type:e.raw==2?new e.type:i?document.createElementNS(`http://www.w3.org/2000/svg`,e.type):document.createElement(e.type,e.is?{is:e.is}:void 0)));let o=t[n]?t[n]:Ov,{vnode:s=Ov,cycle:c=0}=o,{fragment:l,handlers:u}=o,{children:d=kv,props:f=Ov}=s;if(u=a?{}:u||{},e.static&&!a)return t;if(e.shadow&&!t.shadowRoot&&t.attachShadow({mode:`open`,...e.shadow}),e.props!=f&&s_(t,f,e.props,u,i),e.children!==d){let a=e.shadow?t.shadowRoot:t;l=o_(e.children,l,a,n,!c&&r,i&&e.type==`foreignObject`?!1:i)}return t[n]={vnode:e,handlers:u,fragment:l,cycle:c+1},t}function a_(e,t){let n=new Av(``),r=new Av(``),i;if(e[t?`prepend`:`append`](n),t){let{lastElementChild:t}=e;for(;t;){let{previousElementSibling:e}=t;if(Q_(t,!0)&&!Q_(e,!0)){i=t;break}t=e}}return i?i.before(r):e.append(r),{markStart:n,markEnd:r}}function o_(e,t,n,r,i,a){e=e==null?null:Z_(e)?e:[e];let o=t||a_(n,i),{markStart:s,markEnd:c,keyes:l}=o,u,d=l&&new Set,f=s;if(e&&e_(e,e=>{if(typeof e==`object`&&!e[Mv])return;let t=e[Mv]&&e.key,o=l&&t!=null&&l.get(t);f!=c&&f===o?d.delete(f):f=f==c?c:f.nextSibling;let s=l?o:f,p=s;if(e[Mv])p=i_(e,s,r,i,a);else{let t=e+``;!(p instanceof Text)||p instanceof Av?p=new Text(t):p.data!=t&&(p.data=t)}p!=f&&(l&&d.delete(p),!s||l?(n.insertBefore(p,f),l&&f!=c&&d.add(f)):s==c?n.insertBefore(p,c):(n.replaceChild(p,s),f=p)),t!=null&&(u||=new Map,u.set(t,p))}),f=f==c?c:f.nextSibling,t&&f!=c)for(;f!=c;){let e=f;f=f.nextSibling,e.remove()}return d&&d.forEach(e=>e.remove()),o.keyes=u,o}function s_(e,t,n,r,i){for(let a in t)!(a in n)&&c_(e,a,t[a],null,i,r);for(let a in n)c_(e,a,t[a],n[a],i,r)}function c_(e,t,n,r,i,a){if(t=t==`class`&&!i?`className`:t,n??=null,r??=null,t in e&&Tv[t]&&(n=e[t]),!(r===n||Dv[t]||t[0]==`_`))if(e.localName===`slot`&&t===`assignNode`&&`assign`in e)e.assign(r);else if(t[0]==`o`&&t[1]==`n`&&(Y(r)||Y(n)))l_(e,t.slice(2),r,a);else if(t==`ref`)r&&(Y(r)?r(e):r.current=e);else if(t==`style`){let{style:t}=e;n||=``,r||=``;let i=X_(n),a=X_(r);if(i)for(let e in n)if(a)!(e in r)&&u_(t,e,null);else break;if(a)for(let e in r){let a=r[e];i&&n[e]===a||u_(t,e,a)}else t.cssText=r}else{let a=t[0]==`$`?t.slice(1):t;a===t&&(!i&&!Ev[t]&&t in e||Y(r)||Y(n))?e[t]=r??``:r==null?e.removeAttribute(a):e.setAttribute(a,X_(r)?JSON.stringify(r):r)}}function l_(e,t,n,r){if(r.handleEvent||=t=>r[t.type].call(e,t),n){if(!r[t]){let i=n.capture||n.once||n.passive?Object.assign({},n):null;e.addEventListener(t,r,i)}r[t]=n}else r[t]&&(e.removeEventListener(t,r),delete r[t])}function u_(e,t,n){let r=`setProperty`;n??=(r=`removeProperty`,null),~t.indexOf(`-`)?e[r](t,n):e[t]=n}function d_(e,...t){let n=(e.raw||e).reduce((e,n,r)=>e+n+(t[r]||``),``);return Hv[n]=Hv[n]||f_(n)}function f_(e){if(Cv.sheet){let t=new CSSStyleSheet;return t.replaceSync(e),t}else{let t=document.createElement(`style`);return t.textContent=e,t}}function p_(){let e=new Date;return new Q(e.getFullYear(),e.getMonth()+1,e.getDate())}function m_(e){let t=J(e);t.setUTCDate(t.getUTCDate()+3-(t.getUTCDay()+6)%7);let n=new Date(Date.UTC(t.getUTCFullYear(),0,4));return 1+Math.round(((t.getTime()-n.getTime())/Kv-3+(n.getUTCDay()+6)%7)/7)}function h_(e,t=0){let n=J(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),Q.from(n)}function g_(e,t=0){return h_(e,t).add({days:6})}function __(e){return Q.from(new Date(Date.UTC(e.year,e.month,0)))}function v_(e,t,n){return t&&Q.compare(e,t)<0?t:n&&Q.compare(e,n)>0?n:e}function y_(e,t=0){let n=h_(e.toPlainDate(),t),r=g_(__(e),t),i=[];for(;Q.compare(n,r)<0;){let e=[];for(let t=0;t<7;t++)e.push(n),n=n.add(qv);i.push(e)}return i}function J(e){return new Date(Date.UTC(e.year,e.month-1,e.day??1))}function b_(e,t){if(t)try{return e.from(t)}catch{}}function x_(e){let[t,n]=bv(e);return[X(()=>b_(Q,t),[t]),e=>n(e?.toString())]}function S_(e){let[t=``,n]=bv(e);return[X(()=>{let[e,n]=t.split(`/`),r=b_(Q,e),i=b_(Q,n);return r&&i?[r,i]:[]},[t]),e=>n(`${e[0]}/${e[1]}`)]}function C_(e){let[t=``,n]=bv(e);return[X(()=>{let e=[];for(let n of t.trim().split(/\s+/)){let t=b_(Q,n);t&&e.push(t)}return e},[t]),e=>n(e.join(` `))]}function w_(e,t){return X(()=>new Intl.DateTimeFormat(t,{timeZone:`UTC`,...e}),[t,e])}function T_(e,t,n){let r=w_(e,n);return X(()=>{let e=[],n=new Date;for(var i=0;i<7;i++){let i=(n.getUTCDay()-t+7)%7;e[i]=r.format(n),n.setUTCDate(n.getUTCDate()+1)}return e},[t,r])}function E_({props:e,context:t}){let{offset:n}=e,{firstDayOfWeek:r,isDateDisallowed:i,min:a,max:o,today:s,page:c,locale:l,focusedDate:u,formatWeekday:d}=t,f=s??p_(),p=T_(ty,r,l),m=T_(X(()=>({weekday:d}),[d]),r,l),h=w_($v,l),g=w_(ey,l),_=X(()=>c.start.add({months:n}),[c,n]),v=X(()=>y_(_,r),[_,r]),y=xv(`focusday`,ny),b=xv(`selectday`,ny),x=xv(`hoverday`,ny);function S(e){y(v_(e,a,o))}function C(e){let t;switch(e.key){case`ArrowRight`:t=u.add({days:Qv(e)?1:-1});break;case`ArrowLeft`:t=u.add({days:Qv(e)?-1:1});break;case`ArrowDown`:t=u.add({days:7});break;case`ArrowUp`:t=u.add({days:-7});break;case`PageUp`:t=u.add(e.shiftKey?{years:-1}:{months:-1});break;case`PageDown`:t=u.add(e.shiftKey?{years:1}:{months:1});break;case`Home`:t=h_(u,r);break;case`End`:t=g_(u,r);break;default:return}S(t),e.preventDefault()}function w(e){let n=_.equals(e);if(!t.showOutsideDays&&!n)return;let r=e.equals(u),s=e.equals(f),c=J(e),l=i?.(c),d=!Zv(e,a,o),p=``,m;if(t.type===`range`){let[n,r]=t.value,i=n?.equals(e),a=r?.equals(e);m=n&&r&&Zv(e,n,r),p=`${i?`range-start`:``} ${a?`range-end`:``} ${m&&!i&&!a?`range-inner`:``}`}else m=t.type===`multi`?t.value.some(t=>t.equals(e)):t.value?.equals(e);return{part:`${`button day day-${c.getUTCDay()} ${n?m?`selected`:``:`outside`} ${l?`disallowed`:``} ${s?`today`:``} ${t.getDayParts?.(c)??``}`} ${p}`,tabindex:n&&r?0:-1,disabled:d,"aria-disabled":l?`true`:void 0,"aria-pressed":n&&m,"aria-current":s?`date`:void 0,"aria-label":h.format(c),onkeydown:C,onclick(){l||b(e),S(e)},onmouseover(){!l&&!d&&x(e)}}}return{weeks:v,yearMonth:_,daysLong:p,daysVisible:m,formatter:g,getDayProps:w}}function D_(e){return Z(`button`,{part:`button ${e.name} ${e.onclick?``:`disabled`}`,onclick:e.onclick,"aria-disabled":e.onclick?null:`true`,children:Z(`slot`,{name:e.name,children:e.children})})}function O_(e){let t=J(e.page.start),n=J(e.page.end);return Z(iy,{value:e,onselectday:e.onSelect,onfocusday:e.onFocus,onhoverday:e.onHover,children:Uv(`div`,{role:`group`,"aria-labelledby":`h`,part:`container`,children:[Z(`div`,{id:`h`,class:`vh`,"aria-live":`polite`,"aria-atomic":`true`,children:e.formatVerbose.formatRange(t,n)}),Uv(`div`,{part:`header`,children:[Z(D_,{name:`previous`,onclick:e.previous,children:`Previous`}),Z(`slot`,{part:`heading`,name:`heading`,children:Z(`div`,{"aria-hidden":`true`,children:e.format.formatRange(t,n)})}),Z(D_,{name:`next`,onclick:e.next,children:`Next`})]}),Z(`slot`,{part:`months`})]})})}function k_(e,t){return(t.year-e.year)*12+t.month-e.month}function A_({pageBy:e,focusedDate:t,months:n,max:r,min:i,goto:a}){let o=e===`single`?1:n,[s,c]=yv(()=>dy(t.toPlainYearMonth(),n)),l=e=>c(dy(s.start.add({months:e}),n)),u=e=>{let t=k_(s.start,e.toPlainYearMonth());return t>=0&&t<n};return gv(()=>{if(u(t))return;let e=k_(t.toPlainYearMonth(),s.start);a(t.add({months:e}))},[s.start]),gv(()=>{if(u(t))return;let e=k_(s.start,t.toPlainYearMonth());l(e===-1?-o:e===n?o:Math.floor(e/n)*n)},[t,o,n]),{page:s,previous:!i||!u(i)?()=>l(-o):void 0,next:!r||!u(r)?()=>l(o):void 0}}function j_({months:e,pageBy:t,locale:n,focusedDate:r,setFocusedDate:i}){let[a]=x_(`min`),[o]=x_(`max`),[s]=x_(`today`),c=xv(`focusday`),l=xv(`change`),u=X(()=>v_(r??s??p_(),a,o),[r,s,a,o]);function d(e){i(e),c(J(e))}let{next:f,previous:p,page:m}=A_({pageBy:t,focusedDate:u,months:e,min:a,max:o,goto:d}),h=K_();function g(e){let t=e?.target??`day`;t===`day`?h.current.querySelectorAll(`calendar-month`).forEach(t=>t.focus(e)):h.current.shadowRoot.querySelector(`[part~='${t}']`).focus(e)}return{format:w_(ly,n),formatVerbose:w_(uy,n),page:m,focusedDate:u,dispatch:l,onFocus(e){e.stopPropagation(),d(e.detail),setTimeout(g)},min:a,max:o,today:s,next:f,previous:p,focus:g}}function M_(e){return Uv(Fv,{children:[Z(`label`,{part:`label`,for:`s`,children:Z(`slot`,{name:`label`,children:e.label})}),Z(`select`,{id:`s`,part:`select`,onchange:e.onChange,children:e.options.map(e=>Z(`option`,{part:`option`,...e}))})]})}function N_(e,t){return Array.from({length:e},(e,n)=>t(n))}function P_(e){let{min:t,max:n,focusedDate:r}=Bv(iy),i=xv(`focusday`,{bubbles:!0}),a=r.toPlainYearMonth(),o=a.year,s=Math.floor(e.maxYears/2),c=o-s,l=o+(e.maxYears-s-1),u=Math.max(c,t?.year??-1/0),d=N_(Math.min(l,n?.year??1/0)-u+1,e=>{let t=u+e;return{label:`${t}`,value:`${t}`,selected:t===a.year}});function f(e){let t=parseInt(e.currentTarget.value)-a.year;i(r.add({years:t}))}return{options:d,onChange:f}}function F_(e){let{min:t,max:n,focusedDate:r,locale:i}=Bv(iy),a=xv(`focusday`,{bubbles:!0}),o=w_(X(()=>({month:e.formatMonth}),[e.formatMonth]),i),s=X(()=>{let e=[],t=new Date;t.setUTCDate(1);for(var n=0;n<12;n++){let n=(t.getUTCMonth()+12)%12;e[n]=o.format(t),t.setUTCMonth(t.getUTCMonth()+1)}return e},[o]),c=r.toPlainYearMonth(),l=s.map((e,r)=>{let i=r+1,a=c.add({months:i-c.month}),o=t!=null&&Xv.compare(a,t)<0||n!=null&&Xv.compare(a,n)>0;return{label:e,value:`${i}`,disabled:o,selected:i===c.month}});function u(e){let t=parseInt(e.currentTarget.value)-c.month;a(r.add({months:t}))}return{options:l,onChange:u}}var I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,Y,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv,uv,dv,fv,pv,mv,hv,gv,_v,vv,yv,X,bv,xv,Sv,Cv,wv,Tv,Ev,Dv,Ov,kv,Av,jv,Mv,Nv,Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Z,Uv,Wv,Gv,Kv,qv,Jv,Yv,Q,Xv,Zv,Qv,$v,ey,ty,ny,ry,iy,ay,oy,sy,cy,ly,uy,dy,fy,py,my,hy,gy,_y,vy,yy=n((()=>{I_=class{#e;#t=new Set;constructor(e){this.#e=e}get current(){return this.#e}set current(e){this.#e!=e&&(this.#e=e,this.#t.forEach(t=>t(e)))}on(e){return this.#t.add(e),()=>this.#t.delete(e)}},L_=e=>new I_(e),R_=Symbol.for(`atomico.hooks`),globalThis[R_]=globalThis[R_]||{},z_=globalThis[R_],B_=Symbol.for(`Atomico.suspense`),V_=Symbol.for(`Atomico.effect`),H_=Symbol.for(`Atomico.layoutEffect`),U_=Symbol.for(`Atomico.insertionEffect`),W_=(e,t,n)=>{let{i:r,hooks:i}=z_.c,a=i[r]=i[r]||{};return a.value=e(a.value),a.effect=t,a.tag=n,z_.c.i++,i[r].value},G_=e=>W_((t=L_(e))=>t),K_=()=>W_((e=L_(z_.c.host))=>e),q_=()=>z_.c.update,J_=(e,t,n=0)=>{let r={},i=!1,a=()=>i,o=(e,t)=>{for(let n in r){let i=r[n];i.effect&&i.tag===e&&(i.value=i.effect(i.value,t))}};return{load:a=>{z_.c={host:t,hooks:r,update:e,i:0,id:n};let o;try{i=!1,o=a()}catch(e){if(e!==B_)throw e;i=!0}finally{z_.c=null}return o},cleanEffects:e=>(o(U_,e),()=>(o(H_,e),()=>{o(V_,e)})),isSuspense:a}},Y_=Symbol.for,Y=e=>typeof e==`function`,X_=e=>typeof e==`object`,{isArray:Z_}=Array,Q_=(e,t)=>(t?e instanceof HTMLStyleElement:!0)&&`hydrate`in(e?.dataset||{}),$_=(e,t,n)=>(e.addEventListener(t,n),()=>e.removeEventListener(t,n)),ev=class{constructor(e,t,n){this.message=t,this.target=e,this.value=n}},tv=class extends ev{},nv=class extends ev{},rv=`Custom`,iv=null,av={true:1,"":1,1:1},ov=(e,{type:t,base:n=CustomEvent,...r})=>e.dispatchEvent(new n(t,r)),sv=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase(),cv=(e,t,n,r)=>r==null||t==Boolean&&!r?e.removeAttribute(n):e.setAttribute(n,t?.name===rv&&t?.serialize?t?.serialize(r):X_(r)?JSON.stringify(r):t==Boolean?``:r),lv=(e,t)=>e==Boolean?!!av[t]:e==Number?Number(t):e==String?t:e==Array||e==Object?JSON.parse(t):e.name==rv?t:new e(t),uv=({map:e},t)=>{try{return{value:e(t),error:!1}}catch{return{value:t,error:!0}}},dv=(e,t)=>e==null||t==null?{value:t,error:!1}:e!=String&&t===``?{value:void 0,error:!1}:e==Object||e==Array||e==Symbol?{value:t,error:{}.toString.call(t)!==`[object ${e.name}]`}:t instanceof e?{value:t,error:e==Number&&Number.isNaN(t.valueOf())}:e==String||e==Number||e==Boolean?{value:t,error:e==Number?typeof t==`number`?Number.isNaN(t):!0:e==String?typeof t!=`string`:typeof t!=`boolean`}:{value:t,error:!0},fv=0,pv=e=>(e?.dataset||{})?.hydrate||`c`+ fv++,mv=(e,t=HTMLElement)=>{let n={},r={},i=`prototype`in t&&t.prototype instanceof Element,a=i?t:`base`in t?t.base:HTMLElement,{props:o,styles:s}=i?e:t;class c extends a{constructor(){super(),this._setup(),this._render=()=>e({...this._props});for(let e in r)this[e]=r[e]}static get styles(){return[super.styles,s]}async _setup(){if(this._props)return;this._props={};let e,t;this.mounted=new Promise(n=>this.mount=()=>{n(),e!=this.parentNode&&(t==e?this.update():this.unmounted.then(this.update)),e=this.parentNode}),this.unmounted=new Promise(r=>this.unmount=()=>{r(),(e!=this.parentNode||!this.isConnected)&&(n.cleanEffects(!0)()(),t=this.parentNode,e=null)}),this.symbolId=this.symbolId||Symbol(),this.symbolIdParent=Symbol();let n=J_(()=>this.update(),this,pv(this)),r,i=!0,a=Q_(this);this.update=()=>(r||(r=!0,this.updated=(this.updated||this.mounted).then(()=>{try{let e=n.load(this._render),t=n.cleanEffects();return e&&e.render(this,this.symbolId,a),r=!1,i&&!n.isSuspense()&&(i=!1,!a&&n_(this)),t()}finally{r=!1}}).then(e=>{e&&e()})),this.updated),this.update()}connectedCallback(){this.mount(),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),this.unmount()}attributeChangedCallback(e,t,r){if(n[e]){if(e===this._ignoreAttr||t===r)return;let{prop:i,type:a}=n[e];try{this[i]=lv(a,r)}catch{throw new nv(this,`The value defined as attr '${e}' cannot be parsed by type '${a.name}'`,r)}}else super.attributeChangedCallback(e,t,r)}static get props(){return{...super.props,...o}}static get observedAttributes(){let e=super.observedAttributes||[];for(let e in o)t_(this.prototype,e,o[e],n,r);return Object.keys(n).concat(e)}}return c},hv=e=>(t,n)=>{W_(([e,t]=[])=>((t||!t)&&(t&&$g(t,n)?e||=!0:(Y(e)&&e(),e=null)),[e,n]),([e,n],r)=>r?(Y(e)&&e(),[]):[e||t(),n],e)},gv=hv(V_),_v=hv(U_),vv=class extends Array{constructor(e,t){let n=!0,r=e=>{try{t(e,this,n)}finally{n=!1}};super(void 0,r,t),r(e)}},yv=e=>{let t=q_();return W_((n=new vv(e,(e,n,r)=>{e=Y(e)?e(n[0]):e,e!==n[0]&&(n[0]=e,r||t())}))=>n)},X=(e,t)=>{let[n]=W_(([n,r,i=0]=[])=>((!r||r&&!$g(r,t))&&(n=e()),[n,t,i]));return n},bv=e=>{let{current:t}=K_();if(!(e in t))throw new tv(t,`For useProp("${e}"), the prop does not exist on the host.`,e);return W_((n=new vv(t[e],(n,r)=>{n=Y(n)?n(t[e]):n,t[e]=n}))=>(n[0]=t[e],n))},xv=(e,t={})=>{let n=K_();return n[e]||(n[e]=(r=t.detail)=>ov(n.current,{type:e,...t,detail:r})),n[e]},Sv=Y_(`atomico/options`),globalThis[Sv]=globalThis[Sv]||{sheet:!!document.adoptedStyleSheets},Cv=globalThis[Sv],wv=new Promise(e=>{Cv.ssr||(document.readyState===`loading`?$_(document,`DOMContentLoaded`,e):e())}),Tv={checked:1,value:1,selected:1},Ev={list:1,type:1,size:1,form:1,width:1,height:1,src:1,href:1,slot:1},Dv={shadowDom:1,staticNode:1,cloneNode:1,children:1,key:1},Ov={},kv=[],Av=class extends Text{},jv=Y_(`atomico/id`),Mv=Y_(`atomico/type`),Nv=Y_(`atomico/ref`),Pv=Y_(`atomico/vnode`),Fv=()=>{},Iv=(e,t,...n)=>{let r=t||Ov,{children:i}=r;if(i??=n.length?n:kv,e===Fv)return i;let a=e?e instanceof Node?1:e.prototype instanceof HTMLElement&&2:0;if(a===!1&&e instanceof Function)return e(i==kv?r:{children:i,...r});let o=Cv.render||r_;return{[Mv]:Pv,type:e,props:r,children:i,key:r.key,shadow:r.shadowDom,static:r.staticNode,raw:a,is:r.is,clone:r.cloneNode,render:o}},Lv=Iv(`host`,{style:`display: contents`}),Rv=`value`,zv=(e,t)=>{let n=K_(),r=G_();_v(()=>$_(n.current,`ConnectContext`,t=>{t.composedPath().at(0)!==t.currentTarget&&e===t.detail.id&&(t.stopPropagation(),t.detail.connect(r))}),[e]),r.current=t},Bv=e=>{let t=xv(`ConnectContext`,{bubbles:!0,composed:!0}),[n,r]=yv(()=>{if(Cv.ssr)return;let n;return t({id:e,connect(e){n=e}}),n}),i=q_();return gv(()=>{wv.then(()=>t({id:e,connect:r}))},[e]),gv(()=>{if(n)return n.on(i)},[n]),n?.current||e[Rv]},Vv=e=>{let t=mv(({value:e})=>(zv(t,e),Lv),{props:{value:{type:Object,value:()=>e}}});return t[Rv]=e,t},Vv({dispatch(e,t){}}),Hv={},Z=(e,t,n)=>(t==null?t={key:n}:t.key=n,Iv(e,t)),Uv=Z,Wv=d_`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`,Gv=d_`.vh{position:absolute;transform:scale(0)}`,Kv=864e5,qv={days:1},Jv=/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/,Yv=(e,t)=>e.toString().padStart(t,`0`),Q=class e{constructor(e,t,n){this.year=e,this.month=t,this.day=n}add(t){let n=J(this);if(`days`in t)return n.setUTCDate(this.day+t.days),e.from(n);let{year:r,month:i}=this;`months`in t?(i=this.month+t.months,n.setUTCMonth(i-1)):(r=this.year+t.years,n.setUTCFullYear(r));let a=e.from(J({year:r,month:i,day:1}));return v_(e.from(n),a,__(a))}toString(){return`${Yv(this.year,4)}-${Yv(this.month,2)}-${Yv(this.day,2)}`}toPlainYearMonth(){return new Xv(this.year,this.month)}equals(t){return e.compare(this,t)===0}static compare(e,t){return e.year<t.year?-1:e.year>t.year?1:e.month<t.month?-1:e.month>t.month?1:e.day<t.day?-1:+(e.day>t.day)}static from(t){if(typeof t==`string`){let n=t.match(Jv);if(!n)throw TypeError(t);let[,r,i,a]=n;return new e(parseInt(r,10),parseInt(i,10),parseInt(a,10))}return new e(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate())}},Xv=class e{constructor(e,t){this.year=e,this.month=t}add(t){let n=J(this),r=(t.months??0)+(t.years??0)*12;return n.setUTCMonth(n.getUTCMonth()+r),new e(n.getUTCFullYear(),n.getUTCMonth()+1)}equals(e){return this.year===e.year&&this.month===e.month}toPlainDate(){return new Q(this.year,this.month,1)}static compare(e,t){return e.year<t.year?-1:e.year>t.year?1:e.month<t.month?-1:+(e.month>t.month)}},Zv=(e,t,n)=>v_(e,t,n)===e,Qv=e=>e.target.matches(`:dir(ltr)`),$v={month:`long`,day:`numeric`},ey={month:`long`},ty={weekday:`long`},ny={bubbles:!0},ry=p_(),iy=Vv({type:`date`,firstDayOfWeek:1,focusedDate:ry,page:{start:ry.toPlainYearMonth(),end:ry.toPlainYearMonth()}}),customElements.define(`calendar-ctx`,iy),ay=(e,t)=>(t+e)%7,oy=mv(e=>{let t=Bv(iy),n=G_(),r=E_({props:e,context:t});function i(){n.current.querySelector(`button[tabindex='0']`)?.focus()}return Uv(`host`,{shadowDom:!0,focus:i,children:[Z(`div`,{id:`h`,part:`heading`,children:r.formatter.format(J(r.yearMonth))}),Uv(`table`,{ref:n,"aria-labelledby":`h`,part:`table`,children:[Uv(`colgroup`,{children:[t.showWeekNumbers&&Z(`col`,{part:`col-weeknumber`}),Z(`col`,{part:`col-1`}),Z(`col`,{part:`col-2`}),Z(`col`,{part:`col-3`}),Z(`col`,{part:`col-4`}),Z(`col`,{part:`col-5`}),Z(`col`,{part:`col-6`}),Z(`col`,{part:`col-7`})]}),Z(`thead`,{children:Uv(`tr`,{part:`tr head`,children:[t.showWeekNumbers&&Z(`th`,{part:`th weeknumber`,children:Uv(`slot`,{name:`weeknumber`,children:[Z(`span`,{class:`vh`,children:`Week`}),Z(`span`,{"aria-hidden":`true`,children:`#`})]})}),r.daysLong.map((e,n)=>Uv(`th`,{part:`th day day-${ay(t.firstDayOfWeek,n)}`,scope:`col`,children:[Z(`span`,{class:`vh`,children:e}),Z(`span`,{"aria-hidden":`true`,children:r.daysVisible[n]})]}))]})}),Z(`tbody`,{children:r.weeks.map((e,n)=>Uv(`tr`,{part:`tr week`,children:[t.showWeekNumbers&&Z(`th`,{class:`num`,part:`th weeknumber`,scope:`row`,children:m_(e[0])}),e.map((e,t)=>{let n=r.getDayProps(e);return Z(`td`,{part:`td`,children:n&&Z(`button`,{class:`num`,...n,children:e.day})},t)})]},n))})]})]})},{props:{offset:{type:Number,value:0}},styles:[Wv,Gv,d_`:host{--color-accent: black;--color-text-on-accent: white;display:flex;flex-direction:column;gap:.25rem;text-align:center;inline-size:fit-content}table{border-collapse:collapse;font-size:.875rem}th{inline-size:2.25rem;block-size:2.25rem}td{padding-inline:0}.num{font-variant-numeric:tabular-nums}button{color:inherit;font-size:inherit;background:transparent;border:0;block-size:2.25rem;inline-size:2.25rem}button:hover:where(:not(:disabled,[aria-disabled])){background:#0000000d}button:is([aria-pressed=true],:focus-visible){background:var(--color-accent);color:var(--color-text-on-accent)}button:focus-visible{outline:1px solid var(--color-text-on-accent);outline-offset:-2px}button:disabled,:host::part(outside),:host::part(disallowed){cursor:default;opacity:.5}`]}),customElements.define(`calendar-month`,oy),sy={value:{type:String,value:``},min:{type:String,value:``},max:{type:String,value:``},today:{type:String,value:``},isDateDisallowed:{type:Function,value:e=>!1},formatWeekday:{type:String,value:()=>`narrow`},getDayParts:{type:Function,value:e=>``},firstDayOfWeek:{type:Number,value:()=>1},showOutsideDays:{type:Boolean,value:!1},locale:{type:String,value:()=>{}},months:{type:Number,value:1},focusedDate:{type:String,value:()=>{}},pageBy:{type:String,value:()=>`months`},showWeekNumbers:{type:Boolean,value:!1}},cy=[Wv,Gv,d_`:host{display:block;inline-size:fit-content}:host::part(container){display:flex;flex-direction:column;gap:1em}:host::part(header){display:flex;align-items:center;justify-content:space-between}:host::part(heading){font-weight:700;font-size:1.25em}:host::part(button){display:flex;align-items:center;justify-content:center}:host::part(button disabled){cursor:default;opacity:.5}`],ly={year:`numeric`},uy={year:`numeric`,month:`long`},dy=(e,t)=>(e=t===12?new Xv(e.year,1):e,{start:e,end:e.add({months:t-1})}),fy=mv(e=>{let[t,n]=x_(`value`),[r=t,i]=x_(`focusedDate`),a=j_({...e,focusedDate:r,setFocusedDate:i});function o(e){n(e.detail),a.dispatch()}return Z(`host`,{shadowDom:!0,focus:a.focus,children:Z(O_,{...e,...a,type:`date`,value:t,onSelect:o})})},{props:sy,styles:cy}),customElements.define(`calendar-date`,fy),py=[Wv,Gv],my=mv(e=>Z(`host`,{shadowDom:!0,children:Z(M_,{label:`Year`,...P_(e)})}),{props:{maxYears:{type:Number,value:20}},styles:py}),customElements.define(`calendar-select-year`,my),hy=mv(e=>Z(`host`,{shadowDom:!0,children:Z(M_,{label:`Month`,...F_(e)})}),{props:{formatMonth:{type:String,value:()=>`long`}},styles:py}),customElements.define(`calendar-select-month`,hy),gy=(e,t)=>Q.compare(e,t)<0?[e,t]:[t,e],_y=mv(e=>{let[t,n]=S_(`value`),[r=t[0],i]=x_(`focusedDate`),a=j_({...e,focusedDate:r,setFocusedDate:i}),o=xv(`rangestart`),s=xv(`rangeend`),[c,l]=x_(`tentative`),[u,d]=yv();gv(()=>d(void 0),[c]);function f(e){a.onFocus(e),p(e)}function p(e){e.stopPropagation(),c&&d(e.detail)}function m(e){let t=e.detail;e.stopPropagation(),c?(n(gy(c,t)),l(void 0),s(J(t)),a.dispatch()):(l(t),o(J(t)))}let h=c?gy(c,u??c):t;return Z(`host`,{shadowDom:!0,focus:a.focus,children:Z(O_,{...e,...a,type:`range`,value:h,onFocus:f,onHover:p,onSelect:m})})},{props:{...sy,tentative:{type:String,value:``}},styles:cy}),customElements.define(`calendar-range`,_y),vy=mv(e=>{let[t,n]=C_(`value`),[r=t[0],i]=x_(`focusedDate`),a=j_({...e,focusedDate:r,setFocusedDate:i});function o(e){let r=[...t],i=t.findIndex(t=>t.equals(e.detail));i<0?r.push(e.detail):r.splice(i,1),n(r),a.dispatch()}return Z(`host`,{shadowDom:!0,focus:a.focus,children:Z(O_,{...e,...a,type:`multi`,value:t,onSelect:o})})},{props:sy,styles:cy}),customElements.define(`calendar-multi`,vy)})),by=/^\d{4}-\d{2}-\d{2}$/,xy=/^\d{4}-\d{2}-\d{2}\/\d{4}-\d{2}-\d{2}$/,Sy=100,Cy=10,wy=null,Ty=()=>typeof customElements>`u`||customElements.get(`calendar-ctx`)?Promise.resolve():(wy??=Promise.resolve().then(()=>(yy(),Qg)).then(()=>void 0).catch(e=>{if(!customElements.get(`calendar-ctx`))throw e}),wy),Ey=e=>{let[t=``,n=``]=e.split(`/`);return[t,n]},Dy=(e,t)=>e===``||(t?xy.test(e):by.test(e)),Oy=()=>new Date().getFullYear(),ky=()=>`${Oy()-Sy}-01-01`,Ay=()=>`${Oy()+Cy}-12-31`,jy=()=>new Date().toISOString().slice(0,10),My=(e,t)=>{if(!e.match(by))return``;let n=new Date(`${e}T00:00:00.000Z`);return new Intl.DateTimeFormat(t||void 0,{month:`long`,timeZone:`UTC`,year:`numeric`}).format(n)},Ny=e=>({value:e.dataset.value??``,label:e.dataset.label??e.textContent?.trim()??``,start:e.dataset.start??``,end:e.dataset.end??``,disabled:q.asBool({value:e.dataset.disabled})}),Py=()=>({value:``,pendingValue:``,presetValue:``,triggerId:``,popoverId:``,liveMessage:``,props:null,machine:null,popover:null,popoverMotion:null,listeners:[],hiddenInputsKey:``,presetInputKey:``,init(){this.props=B({el:this.$el,schema:Xg,onChange:()=>this.sync()}),this.value=this.props.value,this.pendingValue=this.value,this.presetValue=this.props.preset,this.triggerId=this.$id(`date-picker-trigger`),this.popoverId=this.$id(`date-picker-popover`),this.machine=q.createMachine(q.createVisibilityMachine({enter:`enterPopover`,exit:`exitPopover`}),{context:{},actions:{enterPopover:()=>{this.pendingValue=this.value,this.sync(),this.popoverMotion?.enter({before:()=>{let e=this.popoverEl();e.hidden=!1,e.showPopover?.(),this.popover?.mount()},after:()=>{this.machine.matches(`opening`)&&this.machine.send(`ANIMATION_END`)}}),this.popoverMotion||this.machine.send(`ANIMATION_END`),q.dispatch({el:this.$el,name:`ui:open`})},exitPopover:()=>{if(this.pendingValue=this.value,this.sync(),this.trigger().focus({preventScroll:!0}),this.popoverMotion?.exit({before:()=>{let e=this.popoverEl();e.dataset.state=`closed`,e.hidden=!1},after:()=>{if(!this.machine.matches(`closing`))return;let e=this.popoverEl();e.hidePopover?.(),e.hidden=!0,this.popover?.unmount(),q.dispatch({el:this.$el,name:`ui:close`}),this.machine.send(`ANIMATION_END`)}}),!this.popoverMotion){let e=this.popoverEl();e.hidePopover?.(),e.hidden=!0,this.popover?.unmount(),q.dispatch({el:this.$el,name:`ui:close`}),this.machine.send(`ANIMATION_END`)}}}}),this.popover=q.createAnchoredPopover({reference:()=>this.trigger(),floating:()=>this.popoverEl(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset,matchReferenceWidth:!1}),this.popoverMotion=q.motion.createPresenceLifecycle({element:()=>this.popoverEl(),preset:`popover`}),this.setup(),this.sync(),Ty().then(()=>this.sync())},destroy(){this.props.disconnect(),this.machine.stop(),this.popoverMotion?.destroy(),this.listeners.forEach(e=>e()),this.listeners=[],this.popover?.unmount()},get isOpen(){return this.machine?.hasTag(`interactive`)??!1},get root(){return q.mergeBindings({inputs:[K({part:Zg.parts.root,props:this.props,className:this.props.class}),{"data-ui-date-picker":``,":data-state":()=>this.isOpen?`open`:`closed`}]})},trigger(){let e=this.$el.querySelector(`[data-ui-date-picker-trigger]`);if(!e)throw Error(`Date picker requires a trigger.`);return e},input(){let e=this.$el.querySelector(`[data-ui-date-picker-input]`);if(!e)throw Error(`Date picker requires an input.`);return e},toggleButton(){return this.$el.querySelector(`[data-ui-date-picker-toggle]`)},popoverEl(){let e=this.$el.querySelector(`[data-ui-date-picker-popover]`);if(!e)throw Error(`Date picker requires a popover.`);return e},calendar(){return this.$el.querySelector(`[data-ui-date-picker-calendar]`)},hiddenInputsEl(){return this.$el.querySelector(`[data-ui-date-picker-hidden-inputs]`)},presetInputsEl(){return this.$el.querySelector(`[data-ui-date-picker-preset-inputs]`)},presetItems(){let e=Array.from(this.$el.querySelectorAll(`[data-ui-date-picker-preset]`)).map(Ny).filter(e=>e.value&&e.start&&e.end);return e.length?e:this.props.presets},isRange(){return this.props.mode===`range`},closeMode(){return this.props.close===`confirm`?`confirm`:`select`},displayValue(){if(!this.value)return``;if(!this.isRange())return this.value;let[e,t]=Ey(this.value);return e&&t?`${e} to ${t}`:this.value},effectivePlaceholder(){return this.props.placeholder?this.props.placeholder:this.isRange()?`YYYY-MM-DD to YYYY-MM-DD`:`YYYY-MM-DD`},effectiveMonths(){return this.props.months>0?this.props.months:this.isRange()?2:1},open(e){e?.preventDefault(),!(this.props.disabled||this.props.readonly)&&(this.machine.send(`OPEN`),e instanceof KeyboardEvent&&Ty().then(()=>{queueMicrotask(()=>this.calendar()?.focus({preventScroll:!0}))}))},close(e){e?.preventDefault(),this.machine.send(`CLOSE`)},toggle(e){this.isOpen?this.close(e):this.open(e)},clear(e){e?.preventDefault(),!(this.props.disabled||this.props.readonly)&&(this.value=``,this.pendingValue=``,this.presetValue=``,this.liveMessage=`Date cleared`,this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.input(),marker:`data-ui-date-picker-hidden-input`}),q.dispatch({el:this.$el,name:`ui:clear`}))},cancel(e){e?.preventDefault(),this.close()},apply(e){e?.preventDefault(),this.commitValue(this.pendingValue),this.close()},commitValue(e){this.value=e,this.pendingValue=e,this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.input(),marker:`data-ui-date-picker-hidden-input`}),q.dispatch({el:this.$el,name:`ui:change`})},selectToday(e){e?.preventDefault();let t=this.props.today||new Date().toISOString().slice(0,10),n=this.isRange()?`${t}/${t}`:t;this.commitValue(n),this.close()},selectPreset(e,t){t?.preventDefault();let n=Ny(e);if(n.disabled)return;let r=this.isRange()?`${n.start}/${n.end}`:n.start;this.presetValue=n.value,this.commitValue(r),this.close()},handleInput(e){let t=e.target;if(!(t instanceof HTMLInputElement))return;let n=t.value.trim(),r=this.isRange()?n.replace(/\s+to\s+/i,`/`):n;Dy(r,this.isRange())&&r!==this.value&&this.commitValue(r)},handleKeydown(e){if((e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&!this.isOpen){this.open(e);return}e.key===`Escape`&&this.isOpen&&this.close(e)},handleCalendarChange(e){let t=e.currentTarget;this.pendingValue=t.value,this.isRange()&&(this.liveMessage=this.pendingValue.includes(`/`)?`Range selected`:`Start date selected`),this.closeMode()===`select`&&(!this.isRange()||xy.test(this.pendingValue))?(this.commitValue(this.pendingValue),this.close()):this.sync()},handleCalendarFocus(e){let t=e.detail;t instanceof Date&&this.syncCalendarHeading(t.toISOString().slice(0,10))},sync(){this.syncControl(),this.syncCalendar(),this.syncCalendarHeading(),this.syncTodayButton(),this.syncHiddenInputs(),this.syncPresetInput(),this.syncPresets(),this.syncPosition()},syncControl(){let e=this.trigger(),t=this.input(),n=this.popoverEl(),r=this.$el.querySelector(`[data-ui-date-picker-live]`);e.id=this.triggerId,n.id=this.popoverId,n.dataset.state=this.isOpen?`open`:`closed`,n.hidden=!this.isOpen,e.setAttribute(`data-state`,this.isOpen?`open`:`closed`),q.syncControlPresence({el:e,state:this.props,value:`true`});let i=this.toggleButton();i?(i.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),i.setAttribute(`aria-controls`,this.popoverId)):(e.setAttribute(`aria-haspopup`,`dialog`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.popoverId)),e instanceof HTMLButtonElement&&(e.disabled=this.props.disabled),q.syncNativeControl({input:t,state:{name:this.isRange()?``:this.props.name,value:this.displayValue(),disabled:this.props.disabled,readonly:this.props.readonly,required:this.props.required,invalid:this.props.invalid}}),t.placeholder=this.effectivePlaceholder(),r&&(r.textContent=this.liveMessage)},syncCalendar(){let e=this.calendar();if(!e)return;e.setAttribute(`value`,this.pendingValue),this.isRange()&&!this.pendingValue&&e.setAttribute(`tentative`,``),e.setAttribute(`months`,String(this.effectiveMonths())),e.style.setProperty(`--ui-date-picker-month-columns`,String(this.effectiveMonths())),e.setAttribute(`format-weekday`,`short`),e.setAttribute(`min`,this.props.min||ky()),e.setAttribute(`max`,this.props.max||Ay()),this.props.today&&e.setAttribute(`today`,this.props.today);let t=this.props.forceOpenTo?this.props.openTo:this.value||this.props.openTo||this.props.today||jy();e.setAttribute(`focused-date`,Ey(t)[0]),this.props.locale&&e.setAttribute(`locale`,this.props.locale),this.props.firstDayOfWeek>=0&&e.setAttribute(`first-day-of-week`,String(this.props.firstDayOfWeek));let n=!this.props.selectableHeader&&this.effectiveMonths()===1;q.setPresence({el:e,attr:`data-inline-heading`,present:n,value:`true`}),q.setPresence({el:e,attr:`data-hide-month-heading`,present:this.props.selectableHeader&&!this.isRange()||n,value:`true`}),q.setPresence({el:e,attr:`data-fixed-weeks`,present:this.props.fixedWeeks,value:`true`}),q.setPresence({el:e,attr:`show-outside-days`,present:this.props.showOutsideDays||this.props.fixedWeeks}),q.setPresence({el:e,attr:`show-week-numbers`,present:this.props.showWeekNumbers})},syncCalendarHeading(e){let t=this.$el.querySelector(`[data-ui-date-picker-calendar-heading]`);t&&(t.textContent=My(e||Ey(this.value||this.props.openTo||this.props.today||jy())[0],this.props.locale))},syncTodayButton(){let e=this.$el.querySelector(`[data-ui-date-picker-calendar-today]`),t=this.$el.querySelector(`[data-ui-date-picker-today-day]`);if(!e||!t)return;let n=this.props.today||jy(),r=n.match(by)?String(Number(n.slice(-2))):``;t.textContent=r,e.setAttribute(`aria-label`,r?`Go to today, ${n}`:`Go to today`)},syncHiddenInputs(){let e=this.hiddenInputsEl();if(!e)return;if(!this.isRange()){this.hiddenInputsKey=q.syncRepeatedHiddenInputs({container:e,currentKey:this.hiddenInputsKey,state:{name:``,values:[],form:this.props.form,marker:`data-ui-date-picker-hidden-input`}});return}let[t,n]=Ey(this.value);if(this.props.startName||this.props.endName){let r=JSON.stringify({startName:this.props.startName,endName:this.props.endName,start:t,end:n,form:this.props.form});if(r===this.hiddenInputsKey)return;e.replaceChildren(),[[this.props.startName,t],[this.props.endName,n]].forEach(([t,n])=>{if(!t)return;let r=document.createElement(`input`);r.type=`hidden`,r.name=t,r.value=n,r.setAttribute(`data-ui-date-picker-hidden-input`,``),this.props.form&&r.setAttribute(`form`,this.props.form),e.append(r)}),this.hiddenInputsKey=r;return}this.hiddenInputsKey=q.syncRepeatedHiddenInputs({container:e,currentKey:this.hiddenInputsKey,state:{name:this.props.name,values:this.value?[this.value]:[],required:this.props.required,form:this.props.form,marker:`data-ui-date-picker-hidden-input`}})},syncPresetInput(){let e=this.presetInputsEl();if(!e)return;let t=this.presetItems().find(e=>(this.isRange()?`${e.start}/${e.end}`:e.start)===this.value),n=this.presetItems().find(e=>e.value===`custom`),r=t?.value??(this.value&&n?`custom`:``);this.presetValue=r,this.presetInputKey=q.syncRepeatedHiddenInputs({container:e,currentKey:this.presetInputKey,state:{name:this.props.presetName,values:r?[r]:[],form:this.props.form,marker:`data-ui-date-picker-preset-input`}})},syncPresets(){let e=this.pendingValue||this.value;Array.from(this.$el.querySelectorAll(`[data-ui-date-picker-preset]`)).forEach(t=>{let n=Ny(t),r=this.isRange()?`${n.start}/${n.end}`:n.start;q.setPresence({el:t,attr:`data-selected`,present:r===e,value:`true`}),q.setPresence({el:t,attr:`data-disabled`,present:n.disabled??!1,value:`true`})})},syncPosition(){this.isOpen&&this.popover?.sync()},setup(){let e=this.trigger(),t=this.input(),n=this.popoverEl();q.addListener({target:e,event:`click`,handler:e=>{let t=e.target;if(t instanceof Element&&t.closest(`[data-ui-date-picker-clear]`)){this.clear(e);return}this.toggle(e)},cleanup:this.listeners}),q.addListener({target:e,event:`keydown`,handler:e=>this.handleKeydown(e),cleanup:this.listeners}),q.addListener({target:t,event:`input`,handler:e=>this.handleInput(e),cleanup:this.listeners}),q.addListener({target:n,event:`pointerdown`,handler:e=>e.stopPropagation(),cleanup:this.listeners}),q.addListener({target:n,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-date-picker-preset]`);n&&this.selectPreset(n,e),t.closest(`[data-ui-date-picker-clear]`)&&this.clear(e),t.closest(`[data-ui-date-picker-cancel]`)&&this.cancel(e),t.closest(`[data-ui-date-picker-apply]`)&&this.apply(e),t.closest(`[data-ui-date-picker-today]`)&&this.selectToday(e)},cleanup:this.listeners});let r=this.calendar();r&&(q.addListener({target:r,event:`change`,handler:e=>this.handleCalendarChange(e),cleanup:this.listeners}),q.addListener({target:r,event:`focusday`,handler:e=>this.handleCalendarFocus(e),cleanup:this.listeners}),q.addListener({target:r,event:`rangestart`,handler:()=>{this.liveMessage=`Start date selected`},cleanup:this.listeners}),q.addListener({target:r,event:`rangeend`,handler:()=>{this.liveMessage=`Range selected`},cleanup:this.listeners})),this.listeners.push(q.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,n],onDismiss:()=>this.close()}))}}),Fy=e=>{e.data(`UiDatePicker`,()=>Py())},Iy=G({definition:{component:`ui.menu`,parts:{menu:{base:[zh,`auto-rows-min content-start min-w-48 gap-1 overflow-hidden p-popover`]},item:{base:[Vh],variants:{variant:{default:``,subtle:`bg-base-a2`,filled:`bg-base-a3`,ghost:`bg-transparent`},color:{neutral:``,accent:``,success:``,warning:``,danger:`text-menu-item-danger-fg ui-interactive:hover:bg-menu-item-danger-hover ui-interactive:ui-active:bg-menu-item-danger-hover`}},defaults:{variant:`default`,color:`neutral`}},itemLabel:{base:`min-w-0 flex-1`},itemMeta:{base:`ml-auto text-menu-item-muted`},itemIcon:{base:Hh,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},group:{base:`grid auto-rows-min content-start gap-1`},label:{base:`px-menu-item-x py-1 text-menu-heading-fg`},separatorRoot:{variants:{orientation:{vertical:`self-stretch self-center`,horizontal:`-mx-popover my-popover h-px`}},defaults:{orientation:`horizontal`}},separatorRule:{variants:{orientation:{vertical:`h-full w-px border-0 bg-menu-separator`,horizontal:`h-px w-full border-0 bg-menu-separator`}},defaults:{orientation:`horizontal`}}}}}),Ly=_h,Ry=gh,zy={side:W(Ly,`bottom`),align:W(Ry,`start`),offset:H.clamp(-100,100).default(0),gap:H.clamp(0,50).default(4),open:U,disabled:U,class:V},By=G({definition:{component:`ui.dropdown`,parts:{root:{base:`contents`}}}}),Vy=()=>({machine:null,menuMotion:null,triggerId:``,menuId:``,props:null,collection:null,popover:null,triggerCleanup:[],menuCleanup:[],init(){this.props=B({el:this.$el,schema:zy,onChange:(e,t)=>this.applyProps(t.map(e=>e.key))}),this.triggerId=this.$id(`dropdown-trigger`),this.menuId=this.$id(`dropdown-menu`),this.collection=q.createCollectionNavigation({root:()=>this.menuEl(),itemSelector:`[data-ui-menu-item]`,isDisabled:e=>q.asBool({value:e.dataset.disabled})||e.hasAttribute(`disabled`),loop:()=>q.asBool({value:this.menuEl().dataset.loop})}),this.popover=q.createAnchoredPopover({reference:()=>this.triggerEl(),floating:()=>this.menuEl(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset}),this.menuMotion=q.motion.createPresenceLifecycle({element:()=>this.menuEl(),preset:`menu`}),this.machine=q.createMachine(q.createVisibilityMachine({enter:`enterMenu`,exit:`exitMenu`}),{context:{},actions:{enterMenu:()=>{let e=this.menuEl();this.syncTriggerAttributes(),this.menuMotion?.enter({before:()=>{this.syncMenuAttributes();try{e.showPopover()}catch{}this.mount()},after:()=>{this.machine.matches(`opening`)&&this.machine.send(`ANIMATION_END`)}}),this.menuMotion||this.machine.send(`ANIMATION_END`),queueMicrotask(()=>e.focus({preventScroll:!0})),q.dispatch({el:this.$el,name:`ui:open`})},exitMenu:()=>{let e=this.menuEl();if(this.syncTriggerAttributes(),this.menuMotion?.exit({before:()=>{e.dataset.state=`closed`,e.hidden=!1},after:()=>{this.machine.matches(`closing`)&&(this.machine.send(`ANIMATION_END`),this.finishClose())}}),!this.menuMotion){if(e.dataset.state=`closed`,e.hidden=!1,!this.machine.matches(`closing`))return;this.machine.send(`ANIMATION_END`),this.finishClose()}}}}),this.setupTrigger(),this.setupMenu(),this.props.open&&queueMicrotask(()=>this.open())},destroy(){this.props.disconnect(),this.machine.stop(),this.menuMotion?.destroy(),this.teardownTrigger(),this.teardownMenu(),this.unmount()},get isOpen(){return this.machine?.hasTag(`visible`)??!1},get root(){return q.mergeBindings({inputs:[K({part:By.parts.root,props:this.props,className:this.props.class}),{"data-ui-dropdown":``,":data-state":()=>this.machine.hasTag(`interactive`)?`open`:`closed`,"@keydown.escape.stop":e=>this.close(e)}]})},menu(e){return q.mergeBindings({inputs:[K({part:Iy.parts.menu,props:{},className:e.dataset.class}),{id:this.menuId,popover:`manual`,role:`menu`,tabindex:`-1`,hidden:()=>!this.isOpen,"data-ui-menu":``,":data-state":()=>this.machine.hasTag(`interactive`)?`open`:`closed`}]})},menuItem(e){let t=e.dataset.variant||`default`,n=e.dataset.color||`neutral`,r=q.asBool({value:e.dataset.disabled}),i=e instanceof HTMLButtonElement?e.getAttribute(`type`)||e.dataset.type||`button`:void 0;return q.mergeBindings({inputs:[K({part:Iy.parts.item,props:{variant:t,color:n},className:e.dataset.class}),{role:`menuitem`,tabindex:r?`-1`:`0`,type:i,disabled:e.tagName===`BUTTON`&&r,"data-ui-menu-item":``,"data-variant":t,"data-color":n,"data-disabled":r?`true`:void 0,"aria-disabled":r?`true`:void 0}]})},open(e){e?.preventDefault(),!this.props.disabled&&this.machine.send(`OPEN`)},close(e){e?.preventDefault(),this.machine.send(`CLOSE`),this.clearActiveItem(),e?.type===`keydown`&&this.triggerEl().focus()},toggle(e){e?.preventDefault(),!this.props.disabled&&this.machine.send(this.machine.hasTag(`interactive`)?`CLOSE`:`OPEN`)},triggerEl(){let e=Array.from(this.$el.children).find(e=>e instanceof HTMLElement&&!e.matches(`[data-ui-menu]`));if(!(e instanceof HTMLElement))throw Error(`Dropdown requires a trigger element before the menu.`);return e},menuEl(){let e=this.$el.querySelector(`[data-ui-menu]`);if(!(e instanceof HTMLElement))throw Error(`Dropdown requires a menu element.`);return e},allItemEls(){return this.collectionNav().allItems()},itemEls(){return this.collectionNav().items()},focusNext(){this.collectionNav().focusNext()},focusPrevious(){this.collectionNav().focusPrevious()},focusFirst(){this.collectionNav().focusFirst()},focusLast(){this.collectionNav().focusLast()},focusItem(e){this.collectionNav().focusItem({el:e})},activateItem(e){this.collectionNav().activateItem({el:e})},clearActiveItem(){this.collectionNav().clearActiveItem()},collectionNav(){return this.collection||=q.createCollectionNavigation({root:()=>this.menuEl(),itemSelector:`[data-ui-menu-item]`,isDisabled:e=>q.asBool({value:e.dataset.disabled})||e.hasAttribute(`disabled`),loop:()=>q.asBool({value:this.menuEl().dataset.loop})}),this.collection},mount(){this.popover?.mount()},unmount(){this.popover?.unmount()},applyProps(e=[]){if(this.props.disabled&&this.isOpen){this.close();return}if(e.includes(`open`)&&this.props.open!==this.isOpen){this.props.open?this.open():this.close();return}this.syncTriggerAttributes(),this.syncMenuAttributes(),this.syncPosition()},syncFromPopover(e){this.machine.send(e.newState===`open`?`OPEN`:`CLOSE`)},syncPosition(){this.popover?.sync()},syncMenuAttributes(){let e=this.menuEl();e.hidden=!this.isOpen,e.dataset.state=this.isOpen?`open`:`closed`},syncTriggerAttributes(){let e=this.triggerEl();e.id||=this.triggerId;let t=this.machine.hasTag(`interactive`);if(e.setAttribute(`data-ui-dropdown-trigger`,``),e.setAttribute(`aria-expanded`,t?`true`:`false`),e.setAttribute(`aria-controls`,this.menuId),e.setAttribute(`data-state`,t?`open`:`closed`),this.props.disabled){e.setAttribute(`aria-disabled`,`true`),e.setAttribute(`tabindex`,`-1`),e instanceof HTMLButtonElement&&(e.disabled=!0);return}e.removeAttribute(`aria-disabled`),e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`0`)},finishClose(){if(!this.machine.hasTag(`interactive`)){try{this.menuEl().hidePopover()}catch{}this.unmount(),this.syncMenuAttributes(),q.dispatch({el:this.$el,name:`ui:close`})}},setupTrigger(){let e=this.triggerEl();this.syncTriggerAttributes(),q.addListener({target:e,event:`click`,handler:e=>this.toggle(e),cleanup:this.triggerCleanup}),q.addListener({target:e,event:`keydown`,handler:e=>{if(e instanceof KeyboardEvent){if(e.key===`Enter`||e.key===` `){this.toggle(e);return}e.key===`ArrowDown`&&(e.preventDefault(),this.open(e),queueMicrotask(()=>this.focusFirst()))}},cleanup:this.triggerCleanup})},setupMenu(){let e=this.menuEl(),t=this.menu(e).class;typeof t==`string`&&e.setAttribute(`class`,t),e.id=this.menuId,e.setAttribute(`popover`,`manual`),e.setAttribute(`role`,`menu`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-ui-menu`,``),e.setAttribute(`data-ui-motion-owner`,`component`),this.syncMenuAttributes(),q.addListener({target:e,event:`toggle`,handler:e=>this.syncFromPopover(e),cleanup:this.menuCleanup}),this.menuCleanup.push(q.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,e],onDismiss:e=>this.close(e)})),q.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.collectionNav().handleKeydown({event:e})},cleanup:this.menuCleanup}),this.allItemEls().forEach(e=>{let t=this.menuItem(e),n=t.class,r=t.disabled===!0;typeof n==`string`&&e.setAttribute(`class`,n),e.setAttribute(`role`,`menuitem`),e.setAttribute(`tabindex`,r?`-1`:`0`),e.setAttribute(`data-ui-menu-item`,``),e instanceof HTMLButtonElement&&!e.hasAttribute(`type`)&&e.setAttribute(`type`,e.dataset.type||`button`),r&&(e.setAttribute(`aria-disabled`,`true`),e instanceof HTMLButtonElement&&(e.disabled=!0)),q.addListener({target:e,event:`click`,handler:t=>this.selectItem(e,t),cleanup:this.menuCleanup}),q.addListener({target:e,event:`focus`,handler:()=>this.activateItem(e),cleanup:this.menuCleanup}),q.addListener({target:e,event:`pointerenter`,handler:()=>{q.asBool({value:e.dataset.disabled})||this.activateItem(e)},cleanup:this.menuCleanup})})},teardownTrigger(){this.triggerCleanup.forEach(e=>e()),this.triggerCleanup=[]},teardownMenu(){this.menuCleanup.forEach(e=>e()),this.menuCleanup=[]},selectItem(e,t){if(q.asBool({value:e.dataset.disabled})){t.preventDefault();return}let n=q.asBool({value:this.menuEl().dataset.keepOpen});(e.dataset.keepOpen===void 0||e.dataset.keepOpen===``?n:q.asBool({value:e.dataset.keepOpen}))||this.close()}}),Hy=e=>{e.data(`UiDropdown`,()=>Vy())},Uy=`input:not([type="hidden"]), textarea, select, button, [data-ui-control-target]`,Wy=(e,t)=>{let n=new Set((e??``).split(/\s+/).filter(Boolean));return n.add(t),Array.from(n).join(` `)},Gy=(e,t)=>(e.id||=`ui-${t}-${crypto.randomUUID()}`,e.id),Ky=()=>({observer:null,listeners:[],init(){this.sync(),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this.$el,{attributes:!0,attributeFilter:[`data-invalid`],childList:!0,subtree:!0})},destroy(){this.observer?.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},sync(){let e=this.$el,t=Array.from(e.querySelectorAll(Uy)).filter(t=>!t.closest(`[data-ui-field], [data-ui-fieldset]`)||t.closest(`[data-ui-field], [data-ui-fieldset]`)===e)[0],n=e.querySelector(`:scope > [data-ui-field-label]`),r=e.querySelector(`:scope > [data-ui-fieldset-legend]`),i=Array.from(e.querySelectorAll(`:scope > [data-ui-field-description]`)),a=Array.from(e.querySelectorAll(`:scope > [data-ui-field-error]`)),o=[...i,...a].filter(e=>!e.hasAttribute(`hidden`)).map(e=>Gy(e,e.hasAttribute(`data-ui-field-error`)?`field-error`:`field-description`));if(t){let i=Gy(t,`control`);if(n&&!n.htmlFor&&(n.htmlFor=i),r){let e=Gy(r,`fieldset-legend`);q.setAttribute({el:t,attr:`aria-labelledby`,value:Wy(t.getAttribute(`aria-labelledby`),e)})}o.forEach(e=>{q.setAttribute({el:t,attr:`aria-describedby`,value:Wy(t.getAttribute(`aria-describedby`),e)})}),e.hasAttribute(`data-invalid`)?(t.setAttribute(`aria-invalid`,`true`),t.setAttribute(`data-ui-field-aria-invalid`,``)):t.hasAttribute(`data-ui-field-aria-invalid`)&&(t.removeAttribute(`aria-invalid`),t.removeAttribute(`data-ui-field-aria-invalid`))}e.matches(`fieldset`)&&o.length>0&&o.forEach(t=>{q.setAttribute({el:e,attr:`aria-describedby`,value:Wy(e.getAttribute(`aria-describedby`),t)})})}}),qy=e=>{e.data(`UiField`,Ky)};function Jy(e){return e.source.types.includes(`Files`)}function Yy(e){return e.source.items.filter(function(e){return e.kind===`file`}).map(function(e){return e.getAsFile()}).filter(function(e){return e!=null})}function Xy(e){var t=e.dragEnter,n=t.type,r=t.relatedTarget;return n===`dragenter`?Fd()?Ld({dragEnter:t}):r==null?!0:Pd()?Bd(r):r instanceof HTMLIFrameElement:!1}function Zy(e){var t=e.type,n=e.value;return!(t===`application/vnd.pdnd`||t===`text/plain`&&n===`pdnd:android-fallback`)}function Qy(e){return Array.from(e.types).filter(function(t){return Zy({type:t,value:e.getData(t)})})}function $y(e){return Array.from(e.items).filter(function(t){return t.kind===`file`||Zy({type:t.type,value:e.getData(t.type)})})}var eb=!1,tb=bf({typeKey:`external`,defaultDropEffect:`copy`,mount:function(e){return(0,ad.bind)(window,{type:`dragenter`,listener:function(t){if(!eb&&t.dataTransfer&&e.canStart(t)&&Xy({dragEnter:t})){var n=Qy(t.dataTransfer);if(n.length){var r={types:n,items:[],getStringData:function(){return null}};e.start({event:t,dragType:{type:`external`,startedFrom:`external`,payload:r,getDropPayload:function(e){if(!e.dataTransfer)return r;var t=$y(e.dataTransfer),i=e.dataTransfer.getData.bind(e.dataTransfer);return{types:n,items:t,getStringData:function(e){if(!n.includes(e))return null;var t=i(e);return Zy({type:e,value:t})?t:null}}}}})}}}})}});function nb(e){return tb.dropTarget(e)}function rb(e){return tb.monitor(e)}(function(){if(typeof window>`u`)return;tb.registerUsage();var e={type:`idle`},t=e;function n(){t.type===`dragging`&&(eb=!1,t.cleanup(),t=e)}function r(){return(0,ad.bindAll)(window,[{type:`dragend`,listener:n}].concat(Nd(Hd({onDragEnd:n}))),{capture:!0})}(0,ad.bind)(window,{type:`dragstart`,listener:function(){t.type===`idle`&&(eb=!0,t={type:`dragging`,cleanup:r()})},options:{capture:!0}})})();var ib=[`stack`,`inline`],ab=[`auto`,`image`,`none`],ob=[`sm`,`md`,`lg`],sb={name:V,accept:V,capture:V,multiple:U,required:U,disabled:U,invalid:U,preview:W(ab,`auto`),layout:W(ib,`stack`),size:W(ob,`md`),heading:V.default(`Drop files here or browse`),text:V,browseLabel:V,empty:V,maxItems:H.min(0).default(0),clearable:U.default(!0),rootClass:V,dropzoneClass:V,listClass:V,itemClass:V,class:V};V.default(`Drop files here or browse`),V.default(`cloud__upload`),W(ib,`stack`),W(ob,`md`),V.default(`document__blank`),V.default(`Remove file`);var cb=G({definition:{component:`ui.file-upload`,parts:{root:{base:[`grid w-full min-w-0 gap-3`]},control:{base:`relative grid min-w-0 gap-3`},input:{base:`sr-only`},dropzone:{base:[`relative grid min-w-0 overflow-hidden rounded-4 bg-surface-panel text-foreground shadow-control outline-none`,`hover:bg-base-a2 data-dragging:bg-base-a3`,`data-disabled:pointer-events-none data-disabled:bg-control-disabled data-disabled:text-control-disabled-fg data-disabled:shadow-control-disabled data-disabled:hover:bg-control-disabled`,`[&[data-disabled]_[data-ui-file-upload-heading]]:text-control-disabled-fg [&[data-disabled]_[data-ui-file-upload-text]]:text-control-disabled-fg`,`[&[data-disabled]_[data-ui-file-upload-browse]]:bg-control-disabled [&[data-disabled]_[data-ui-file-upload-browse]]:text-control-disabled-fg [&[data-disabled]_[data-ui-file-upload-browse]]:shadow-control-disabled`],variants:{layout:{stack:`justify-items-center text-center`,inline:`grid-cols-[auto_minmax(0,1fr)_auto] items-center text-left`},size:{sm:`gap-2 p-3`,md:`gap-3 p-4`,lg:`gap-3 p-5`}},defaults:{layout:`stack`,size:`md`}},icon:{base:`size-icon-lg shrink-0 fill-current text-icon`},body:{base:`grid min-w-0 gap-1`},heading:{base:`text-sm font-medium text-foreground`},text:{base:`text-xs font-normal text-foreground-muted`},browse:{base:[`inline-flex min-w-0 items-center justify-center rounded-3 bg-base-a2 px-2 py-1 text-xs font-medium text-foreground`,`shadow-border`]},list:{base:`grid min-w-0 gap-2`},empty:{base:`text-xs text-foreground-muted`},item:{base:[`grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-3 bg-surface-panel px-3 py-2 shadow-border`,`hover:shadow-border-hover`,`data-invalid:shadow-danger-focus`]},preview:{base:`flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-2 bg-base-a2 text-icon`},previewImage:{base:`size-full`},itemIcon:{base:`size-icon fill-current`},itemBody:{base:`grid min-w-0 gap-0.5`},itemName:{base:`truncate text-sm font-medium text-foreground`},itemMeta:{base:`truncate text-xs font-normal text-foreground-muted`},itemError:{base:`truncate text-xs font-normal text-danger-text`},remove:{base:[`relative z-20 inline-flex size-control-sm shrink-0 items-center justify-center rounded-3 border-0 bg-transparent`,`text-icon outline-none hover:bg-base-a2 hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-focus`]},removeIcon:{base:`size-icon-xs fill-current leading-none`},clear:{base:`sr-only`}}}}),lb=e=>{if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1),r=e/1024**n;return`${r>=10||n===0?Math.round(r):Number(r.toFixed(1))} ${t[n]}`},ub=(e,t)=>[t,e.name,e.size,e.lastModified].join(`:`),db=e=>e.type.startsWith(`image/`),fb=(e,t)=>t!==`none`&&(t===`image`||db(e)),pb=e=>e?Array.from(e):[],mb=(e,t)=>{let n=t.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(n.length===0)return!0;let r=e.name.toLowerCase(),i=e.type.toLowerCase();return n.some(e=>e.startsWith(`.`)?r.endsWith(e):e.endsWith(`/*`)?i.startsWith(`${e.slice(0,-1)}`):e.includes(`/`)?i===e:!1)},hb=(e,t)=>e.filter(e=>mb(e,t)),gb=(e,t)=>e.maxItems>0&&t>=e.maxItems,_b=e=>{if(typeof DataTransfer>`u`)return null;let t=new DataTransfer;return e.forEach(e=>t.items.add(e)),t.files},vb=(e,t)=>{let n=_b(t);if(!n)return!1;try{return e.files=n,!0}catch{return!1}},yb=e=>{e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},bb=e=>{let t=`http://www.w3.org/2000/svg`,n=document.createElementNS(t,`svg`),r=document.createElementNS(t,`polygon`);return n.setAttribute(`viewBox`,`0 0 32 32`),n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`class`,e),r.setAttribute(`points`,`17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16`),n.append(r),n},xb=()=>({props:null,listeners:[],files:[],limitReached:!1,emptyInputChangeClears:!1,init(){this.props=B({el:this.$el,schema:sb,onChange:()=>this.sync()});let e=this.input(),t=this.dropzone();q.addListener({target:e,event:`change`,handler:()=>this.syncFromInput(),cleanup:this.listeners}),q.addListener({target:e,event:`click`,handler:e=>{this.isInputUnavailable()&&(e.preventDefault(),e.stopPropagation())},cleanup:this.listeners}),q.addListener({target:e,event:`keydown`,handler:e=>{!(e instanceof KeyboardEvent)||!this.isInputUnavailable()||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),e.stopPropagation())},cleanup:this.listeners}),q.addListener({target:this.$el,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-ui-file-upload-remove][data-file-index]`);if(n){e.preventDefault(),this.removePending(Number(n.dataset.fileIndex));return}let r=t.closest(`[data-ui-file-upload-remove][data-existing-file]`);r&&(e.preventDefault(),this.clearExisting(r))},cleanup:this.listeners}),t&&(this.listeners.push(nb({element:t,canDrop:({source:e})=>!this.isInputUnavailable()&&Jy({source:e}),getDropEffect:()=>`copy`,onDragEnter:()=>this.setDragging(!0),onDragLeave:()=>this.setDragging(!1),onDrop:({source:e})=>{this.setDragging(!1),!(this.isInputUnavailable()||!Jy({source:e}))&&this.addFiles(Yy({source:e}))}})),this.listeners.push(rb({canMonitor:({source:e})=>Jy({source:e}),onDrop:()=>this.setDragging(!1)}))),this.syncFromInput(),this.sync()},destroy(){this.files.forEach(e=>{e.previewUrl&&URL.revokeObjectURL(e.previewUrl)}),this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},root(){return this.$el},input(){let e=this.$el.querySelector(`[data-ui-file-upload-input]`);if(!e)throw Error(`File upload requires a native file input.`);return e},dropzone(){return this.$el.querySelector(`[data-ui-file-upload-dropzone]`)},list(){return this.$el.querySelector(`[data-ui-file-upload-list]`)},isInputUnavailable(){return this.props.disabled||gb(this.props,pb(this.input().files).length)},sync(){let e=this.root(),t=this.dropzone(),n=!!e.querySelector(`[data-ui-file-upload-item][data-existing-file]:not([hidden])`),r=this.files.length>0||n,i=this.isInputUnavailable();this.syncInputAttributes(),this.syncFormEncoding(),q.syncControlPresence({el:e,state:this.props,value:`true`}),q.setPresence({el:e,attr:`data-empty`,present:!r,value:`true`}),q.setPresence({el:e,attr:`data-has-files`,present:r,value:`true`}),q.setPresence({el:e,attr:`data-multiple`,present:this.props.multiple,value:`true`}),q.setPresence({el:e,attr:`data-max-items-reached`,present:this.limitReached,value:`true`}),q.setPresence({el:e,attr:`data-has-existing-file`,present:n,value:`true`}),t&&(q.syncControlPresence({el:t,state:{disabled:i,invalid:this.props.invalid},value:`true`}),q.setPresence({el:t,attr:`data-multiple`,present:this.props.multiple,value:`true`}),q.setPresence({el:t,attr:`data-has-files`,present:r,value:`true`}),q.setPresence({el:t,attr:`data-max-items-reached`,present:this.limitReached,value:`true`}))},syncFormEncoding(){let e=this.input().form;e&&(e.enctype=`multipart/form-data`)},syncInputAttributes(){let e=this.input();q.syncNativeControl({input:e,state:{name:this.props.name,disabled:this.props.disabled,required:this.props.required,invalid:this.props.invalid}}),e.multiple=this.props.multiple,this.props.accept?e.accept=this.props.accept:e.removeAttribute(`accept`),this.props.capture?e.setAttribute(`capture`,this.props.capture):e.removeAttribute(`capture`),this.isInputUnavailable()&&!this.props.disabled?(e.setAttribute(`aria-disabled`,`true`),e.tabIndex=-1):this.props.disabled||(e.removeAttribute(`aria-disabled`),e.removeAttribute(`tabindex`))},syncFromInput(){let e=this.input(),t=pb(e.files),n=this.emptyInputChangeClears;if(this.emptyInputChangeClears=!1,t.length===0&&this.files.length>0&&!n){vb(e,this.files.map(({file:e})=>e)),this.sync();return}let r=hb(t,this.props.accept),i=this.props.multiple?this.props.maxItems:1,a=i>0?r.slice(0,i):r,o=t.length-r.length,s=r.length-a.length,c=o+s;this.limitReached=gb(this.props,a.length),c>0&&(vb(e,a),s>0&&q.dispatch({el:this.root(),name:`ui:file-upload-limit`,detail:{rejectedCount:s}})),this.files.forEach(e=>{e.previewUrl&&URL.revokeObjectURL(e.previewUrl)}),this.files=a.map((e,t)=>({id:ub(e,t),file:e,name:e.name,size:lb(e.size),type:e.type||`File`,previewUrl:fb(e,this.props.preview)?URL.createObjectURL(e):``})),this.renderFiles(),this.sync(),q.dispatch({el:this.root(),name:`ui:file-upload-change`,detail:{files:this.files.map(({name:e,size:t,type:n})=>({name:e,size:t,type:n}))}})},addFiles(e){if(this.isInputUnavailable()||e.length===0)return;let t=this.input(),n=hb(e,this.props.accept),r=this.props.multiple?pb(t.files):[],i=this.props.maxItems>0?Math.max(this.props.maxItems-r.length,0):n.length,a=this.props.multiple?n.slice(0,i):n.slice(0,1),o=n.length-a.length,s=this.props.multiple?[...r,...a]:a;if(o>0&&q.dispatch({el:this.root(),name:`ui:file-upload-limit`,detail:{rejectedCount:o}}),this.props.maxItems>0?this.limitReached=gb(this.props,s.length):this.limitReached=!1,s.length===0){this.sync();return}if(!vb(t,s)){t.click();return}yb(t)},removePending(e){if(this.props.disabled||!Number.isInteger(e))return;let t=this.input(),n=pb(t.files).filter((t,n)=>n!==e);if(n.length===0){this.emptyInputChangeClears=!0,vb(t,[])||(t.value=``),yb(t);return}vb(t,n)||(t.value=``),yb(t)},clearExisting(e){if(this.props.disabled||!this.props.clearable)return;let t=this.root().querySelector(`[data-ui-file-upload-clear]`);t&&(t.checked=!0,t.dispatchEvent(new Event(`change`,{bubbles:!0})));let n=e.closest(`[data-ui-file-upload-item][data-existing-file]`);n&&(n.hidden=!0),this.sync()},renderFiles(){let e=this.list();if(!e)return;e.querySelectorAll(`[data-ui-file-upload-pending]`).forEach(e=>e.remove());let t=e.querySelector(`[data-ui-file-upload-empty]`);t&&(t.hidden=this.files.length>0||!!e.querySelector(`[data-existing-file]:not([hidden])`));let n=K({part:cb.parts.item,props:{},className:this.props.itemClass}),r=K({part:cb.parts.preview}),i=[`relative block overflow-hidden ui-image-outline`,K({part:cb.parts.previewImage})].filter(Boolean).join(` `),a=K({part:cb.parts.itemBody}),o=K({part:cb.parts.itemName}),s=K({part:cb.parts.itemMeta}),c=K({part:cb.parts.remove}),l=K({part:cb.parts.removeIcon});this.files.forEach((t,u)=>{let d=document.createElement(`li`);d.dataset.uiFileUploadItem=``,d.dataset.uiFileUploadPending=``,d.dataset.fileIndex=String(u),d.className=n;let f=document.createElement(`span`);if(f.dataset.uiFileUploadPreview=``,f.className=r,f.setAttribute(`aria-hidden`,`true`),t.previewUrl){let e=document.createElement(`span`);e.dataset.uiImage=``,e.className=i;let n=document.createElement(`img`);n.src=t.previewUrl,n.alt=``,n.loading=`lazy`,n.decoding=`async`,n.dataset.uiImageImg=``,n.className=`outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10 block size-full object-cover`,e.append(n),f.append(e)}else f.textContent=t.name.slice(0,1).toUpperCase();let p=document.createElement(`span`);p.className=a;let m=document.createElement(`span`);m.dataset.uiFileUploadItemName=``,m.className=o,m.textContent=t.name;let h=document.createElement(`span`);h.dataset.uiFileUploadItemMeta=``,h.className=s,h.textContent=[t.size,t.type].filter(Boolean).join(` · `),p.append(m,h);let g=document.createElement(`button`);g.type=`button`,g.dataset.uiFileUploadRemove=``,g.dataset.fileIndex=String(u),g.className=c,g.setAttribute(`aria-label`,`Remove ${t.name}`),g.append(bb(l)),d.append(f,p,g),e.append(d)})},setDragging(e){let t=this.root(),n=this.dropzone();q.setPresence({el:t,attr:`data-dragging`,present:e,value:`true`}),n&&q.setPresence({el:n,attr:`data-dragging`,present:e,value:`true`})}}),Sb=e=>{e.data(`UiFileUpload`,()=>xb())},Cb=fh,wb=ph,Tb=wh,Eb=mh,Db={type:V.default(`text`),name:V,value:V,placeholder:V,size:W(Cb,`lg`),variant:W(wb,`outline`),radius:W(Tb,`md`),disabled:U,readonly:U,required:U,invalid:U,icon:V,iconTrailing:V,iconVariant:W(Eb,`outline`),clearable:U,copyable:U,kbd:V,prefix:V,suffix:V,rootClass:V,controlClass:V,class:V};W(Cb,`lg`),W(wb,`outline`),W(Tb,`md`);var Ob=()=>({props:null,listeners:[],copiedTimer:null,init(){this.props=B({el:this.$el,schema:Db,onChange:()=>this.sync()});let e=this.input();q.addListener({target:e,event:`input`,handler:()=>this.sync(),cleanup:this.listeners}),q.addListener({target:this.$el,event:`click`,handler:e=>{let t=e.target;t instanceof Element&&(t.closest(`[data-ui-input-clear]`)&&this.clear(e),t.closest(`[data-ui-input-copy]`)&&this.copy(e))},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[],this.copiedTimer!==null&&window.clearTimeout(this.copiedTimer)},input(){let e=this.$el.querySelector(`[data-ui-input]`);if(!e)throw Error(`Input requires a native input element.`);return e},root(){return this.$el},syncControlState(){let e=this.$el.querySelector(`[data-ui-input-control]`);q.syncControlPresence({el:this.root(),state:{disabled:this.props.disabled,required:this.props.required,invalid:this.props.invalid},value:`true`}),e&&q.syncControlPresence({el:e,state:{disabled:this.props.disabled,invalid:this.props.invalid},value:`true`})},sync(){this.syncControlState();let e=this.input().value.length>0;this.$el.querySelectorAll(`[data-ui-input-clear]`).forEach(t=>{t.hidden=!e,t instanceof HTMLButtonElement&&(t.disabled=this.props.disabled||this.props.readonly)}),this.$el.querySelectorAll(`[data-ui-input-copy]`).forEach(e=>{e instanceof HTMLButtonElement&&(e.disabled=this.props.disabled)})},clear(e){e?.preventDefault();let t=this.input();t.disabled||t.readOnly||(t.value=``,t.dispatchEvent(new InputEvent(`input`,{bubbles:!0,inputType:`deleteContentBackward`})),t.dispatchEvent(new Event(`change`,{bubbles:!0})),t.focus({preventScroll:!0}),this.sync())},async copy(e){e?.preventDefault();let t=this.input();if(t.disabled)return;navigator.clipboard?.writeText&&await navigator.clipboard.writeText(t.value);let n=this.root();q.setPresence({el:n,attr:`data-copied`,present:!0,value:`true`}),this.$el.querySelectorAll(`[data-ui-input-copy]`).forEach(e=>{q.setPresence({el:e,attr:`data-copied`,present:!0,value:`true`})}),this.copiedTimer!==null&&window.clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{q.setPresence({el:n,attr:`data-copied`,present:!1,value:`true`}),this.$el.querySelectorAll(`[data-ui-input-copy]`).forEach(e=>{q.setPresence({el:e,attr:`data-copied`,present:!1,value:`true`})})},1200)}}),kb=e=>{e.data(`UiInput`,()=>Ob())},Ab=[`modal`,`sheet`],jb=vh,Mb=[`sm`,`md`,`lg`,`xl`,`full`],Nb=[`overlay`,`panel`,`inverse`],Pb=Th,Fb=Sh,Ib={name:V,open:U,mode:W(Ab,`modal`),side:W(jb,`right`),size:W(Mb,`md`),surface:W(Nb,`overlay`),tone:W(Pb,`solid`),dismissible:U.default(!0),closable:U.default(!0),disabled:U,autofocusTitle:U,label:V,descriptionId:V,panelClass:V,overlayClass:V,class:V},Lb={name:V,disabled:U,class:V};V.default(`ui-modal-root`),W(Fb,`h2`),V.default(`Close`);var Rb={overlay:Eh.overlay,panel:Eh.panel,inverse:Eh.inverse},zb=[`grid-rows-[auto_auto_minmax(0,1fr)_auto]`,`[&>[data-ui-modal-body]]:-mx-1 [&>[data-ui-modal-body]]:min-h-0 [&>[data-ui-modal-body]]:content-start`,`[&>[data-ui-modal-body]]:overflow-x-hidden [&>[data-ui-modal-body]]:overflow-y-auto [&>[data-ui-modal-body]]:px-1`,`[&>[data-ui-modal-footer]]:self-end`],Bb=G({definition:{component:`ui.modal`,parts:{instance:{base:`contents`},root:{base:[`fixed inset-0 z-dialog m-0 h-auto max-h-none w-auto max-w-none overflow-visible border-0 bg-transparent p-0 text-foreground`,`backdrop:bg-transparent`]},viewport:{base:`fixed inset-0 z-dialog flex min-h-dvh`,variants:{mode:{modal:`items-center justify-center overflow-y-auto p-4`,sheet:``},side:{top:``,right:``,bottom:``,left:``}},compounds:[{when:{mode:`sheet`,side:`top`},class:`items-start justify-center`},{when:{mode:`sheet`,side:`right`},class:`items-center justify-end overflow-hidden`},{when:{mode:`sheet`,side:`bottom`},class:`items-end justify-center`},{when:{mode:`sheet`,side:`left`},class:`items-center justify-start overflow-hidden`}],defaults:{mode:`modal`,side:`right`}},overlay:{base:`fixed inset-0 bg-overlay transition-opacity duration-150 data-[state=closed]:opacity-0`},panel:{base:[`relative z-dialog grid w-full min-w-0 gap-4 overflow-auto p-5 shadow-modal outline-none`,`max-h-full`],variants:{surface:Rb,tone:Dh,mode:{modal:`rounded-4`,sheet:``},side:{top:``,right:``,bottom:``,left:``},size:{sm:`max-w-sm`,md:`max-w-lg`,lg:`max-w-2xl`,xl:`max-w-4xl`,full:`max-w-full`}},compounds:[{when:{mode:`sheet`,side:`right`},class:[`min-h-dvh max-w-lg`,zb]},{when:{mode:`sheet`,side:`left`},class:[`min-h-dvh max-w-lg`,zb]},{when:{mode:`sheet`,side:`top`},class:`max-w-full`},{when:{mode:`sheet`,side:`bottom`},class:`max-w-full`},{when:{surface:`overlay`,tone:`alpha`},class:`bg-surface-overlay-alpha`},{when:{surface:`panel`,tone:`alpha`},class:`bg-surface-panel-alpha`}],defaults:{surface:`overlay`,tone:`solid`,mode:`modal`,side:`right`,size:`md`}},trigger:{base:`contents`},outlet:{base:``},title:{base:`pr-8`},description:{base:`-mt-3 pr-8`},body:{base:`grid min-w-0 gap-3 text-sm text-foreground`},footer:{base:`flex min-w-0 items-center justify-end gap-2 pt-1`},close:{base:[`absolute right-3 top-3 inline-flex size-control-md items-center justify-center rounded-2 border border-transparent text-icon outline-none`,`hover:bg-base-a2 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`]},closeIcon:{base:`size-icon fill-current`}}}}),Vb=new Set,Hb=new Set,Ub=[`a[href]`,`area[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`,`[contenteditable="true"]`].join(`,`),Wb=e=>e?`open`:`closed`,Gb=e=>(e.side===`left`||e.side===`right`)&&e.mode===`sheet`?`sheet`:`modal`,Kb=e=>Array.from(Vb).find(t=>t.name===e)??null,qb=e=>Array.from(Hb).filter(t=>t.name===e),Jb=e=>{let t=e.detail;t?.name&&Kb(t.name)?.close(e)},Yb=e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-disabled`)!==`true`&&!e.hidden&&e.tabIndex!==-1,Xb=e=>e.matches(Ub)&&Yb(e)?e:e.querySelector(Ub)??e,Zb=(e,t)=>{let n=Wb(t);e.setAttribute(`data-state`,n),e.setAttribute(`aria-expanded`,t?`true`:`false`)},Qb=()=>({props:null,machine:null,dialogId:``,activeTrigger:null,cleanup:[],localTriggerCleanup:[],isRegistered:!1,didShowModal:!1,hasScrollLock:!1,modalMotionRun:0,overlayMotion:null,panelMotion:null,get name(){return this.props?.name??``},init(){this.props=B({el:this.$el,schema:Ib,onChange:(e,t)=>this.applyProps(t.map(e=>e.key))}),this.dialogId=this.dialogEl().id||this.$id(`modal${this.props.name?`-${this.props.name}`:``}`),this.register(),this.mountLocalTrigger(),this.setupDialog(),this.overlayMotion=q.motion.createPresenceLifecycle({element:()=>this.overlayEl(),preset:`fade`}),this.panelMotion=q.motion.createPresenceLifecycle({element:()=>this.panelEl(),preset:Gb(this.props)}),this.machine=q.createMachine(q.createVisibilityMachine({enter:`applyOpenState`,exit:`applyClosedState`}),{context:{},actions:{applyOpenState:()=>this.applyOpenState(),applyClosedState:()=>this.applyClosedState()}}),this.syncAll(),this.props.open&&queueMicrotask(()=>this.open())},destroy(){this.props.disconnect(),this.machine.stop(),this.overlayMotion?.destroy(),this.panelMotion?.destroy(),this.hasScrollLock&&=(dh(),!1),this.unregister(),this.teardownLocalTrigger(),this.teardown()},get root(){return q.mergeBindings({inputs:[q.resolveStyle({part:Bb.parts.instance,props:{},className:``}),{"data-ui-modal-instance":``}]})},get isOpen(){return this.machine?.hasTag(`interactive`)??!1},dialogEl(){let e=this.$el.querySelector(`[data-ui-modal]`);if(!(e instanceof HTMLDialogElement))throw Error(`Modal requires a dialog element.`);return e},viewportEl(){let e=this.$el.querySelector(`[data-ui-modal-viewport]`);if(!e)throw Error(`Modal requires a viewport element.`);return e},overlayEl(){let e=this.$el.querySelector(`[data-ui-modal-overlay]`);if(!e)throw Error(`Modal requires an overlay element.`);return e},panelEl(){let e=this.$el.querySelector(`[data-ui-modal-panel]`);if(!e)throw Error(`Modal requires a panel element.`);return e},titleEl(){return this.$el.querySelector(`[data-ui-modal-title]`)},descriptionEl(){return this.$el.querySelector(`[data-ui-modal-description]`)},closeEls(){return Array.from(this.$el.querySelectorAll(`[data-ui-modal-close]`))},localTriggerEl(){return Array.from(this.$el.children).find(e=>e instanceof HTMLElement&&e.matches(`[data-ui-modal-trigger]`))??null},triggerTarget(e){return Xb(e)},focusableEls(){return Array.from(this.panelEl().querySelectorAll(Ub)).filter(Yb)},firstAutofocusEl(){return this.panelEl().querySelector(`[autofocus]`)},mountLocalTrigger(){let e=this.dialogEl(),t=e.querySelector(`[data-ui-modal-trigger]`);!t||t.dataset.name||(this.$el.insertBefore(t,e),this.setupLocalTrigger(t))},setupLocalTrigger(e){let t=this.triggerTarget(e);this.teardownLocalTrigger(),this.syncExternalTrigger(t,this.props.disabled),q.addListener({target:t,event:`click`,handler:e=>this.openFrom(t),cleanup:this.localTriggerCleanup}),q.addListener({target:t,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&(t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement||e.key!==`Enter`&&e.key!==` `||this.open(e))},cleanup:this.localTriggerCleanup})},setupDialog(){let e=this.dialogEl();q.addListener({target:e,event:`cancel`,handler:t=>{t.target===e&&(t.preventDefault(),this.cancel(`escape`,t))},cleanup:this.cleanup}),q.addListener({target:e,event:`close`,handler:()=>{this.isOpen&&this.close()},cleanup:this.cleanup}),q.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.cleanup}),this.closeEls().forEach(e=>{q.addListener({target:e,event:`click`,handler:e=>this.close(e),cleanup:this.cleanup})}),this.cleanup.push(q.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.panelEl(),this.activeTrigger,this.localTriggerEl()],onDismiss:e=>this.cancel(`outside`,e)}))},register(){this.isRegistered||=(Vb.add(this),!0)},unregister(){Vb.delete(this),this.isRegistered=!1},open(e){if(e?.preventDefault(),this.props.disabled)return;let t=this.localTriggerEl();this.activeTrigger=t?this.triggerTarget(t):this.activeTrigger,this.machine.send(`OPEN`)},openFrom(e){this.props.disabled||(this.activeTrigger=e,this.machine.send(`OPEN`))},close(e){e?.preventDefault(),this.machine.send(`CLOSE`)},cancel(e,t){if(!this.props.dismissible){t?.preventDefault();return}this.close(t),q.dispatch({el:this.dialogEl(),name:`ui:cancel`,detail:{reason:e}})},applyProps(e=[]){if((e.includes(`mode`)||e.includes(`side`))&&(this.panelMotion?.destroy(),this.panelMotion=q.motion.createPresenceLifecycle({element:()=>this.panelEl(),preset:Gb(this.props)})),e.includes(`open`)){this.props.open?this.open():this.close();return}if(e.includes(`disabled`)&&this.props.disabled&&this.isOpen){this.close();return}this.syncAll()},syncExternalTrigger(e,t){if(Zb(e,this.isOpen),e.setAttribute(`aria-controls`,this.dialogId),e.setAttribute(`data-ui-modal-trigger-target`,this.dialogId),e.setAttribute(`data-state`,Wb(this.isOpen)),t||this.props.disabled){e.setAttribute(`aria-disabled`,`true`),e.setAttribute(`data-disabled`,``),e instanceof HTMLButtonElement&&(e.disabled=!0),e.matches(Ub)||(e.tabIndex=-1);return}e.removeAttribute(`aria-disabled`),e.removeAttribute(`data-disabled`),e instanceof HTMLButtonElement&&(e.disabled=!1),e.matches(Ub)||(e.tabIndex=0)},syncAll(){this.syncDialog(),this.syncLocalTrigger(),this.syncNamedTriggers()},syncDialog(){let e=this.dialogEl(),t=this.viewportEl(),n=this.overlayEl(),r=this.panelEl(),i=this.titleEl(),a=this.descriptionEl(),o=Wb(this.isOpen);e.id=this.dialogId,e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.setAttribute(`data-state`,o),e.dataset.mode=this.props.mode,e.dataset.side=this.props.side,e.dataset.size=this.props.size,e.dataset.surface=this.props.surface,e.dataset.tone=this.props.tone,e.className=q.resolveStyle({part:Bb.parts.root,props:this.props,className:this.props.class}),t.setAttribute(`data-state`,o),t.dataset.mode=this.props.mode,t.dataset.side=this.props.side,t.className=q.resolveStyle({part:Bb.parts.viewport,props:this.props}),n.setAttribute(`data-state`,o),n.className=q.resolveStyle({part:Bb.parts.overlay,props:this.props,className:this.props.overlayClass}),r.id||=this.$id(`modal-panel${this.props.name?`-${this.props.name}`:``}`),r.setAttribute(`data-state`,o),r.dataset.mode=this.props.mode,r.dataset.side=this.props.side,r.dataset.size=this.props.size,r.dataset.surface=this.props.surface,r.dataset.tone=this.props.tone,r.tabIndex=-1,r.className=q.resolveStyle({part:Bb.parts.panel,props:this.props,className:this.props.panelClass}),i?(i.id||=this.$id(`modal-title${this.props.name?`-${this.props.name}`:``}`),e.setAttribute(`aria-labelledby`,i.id),e.removeAttribute(`aria-label`),this.props.autofocusTitle&&(i.tabIndex=-1)):this.props.label&&(e.setAttribute(`aria-label`,this.props.label),e.removeAttribute(`aria-labelledby`)),a&&(a.id||=this.$id(`modal-description${this.props.name?`-${this.props.name}`:``}`)),this.props.descriptionId===`none`?e.removeAttribute(`aria-describedby`):this.props.descriptionId?e.setAttribute(`aria-describedby`,this.props.descriptionId):a&&e.setAttribute(`aria-describedby`,a.id)},syncLocalTrigger(){let e=this.localTriggerEl();e&&this.syncExternalTrigger(this.triggerTarget(e),this.props.disabled)},syncNamedTriggers(){this.props.name&&qb(this.props.name).forEach(e=>e.sync())},applyOpenState(){this.modalMotionRun+=1;let e=this.dialogEl();typeof e.showModal==`function`?this.didShowModal||=(e.open&&e.removeAttribute(`open`),e.showModal(),!0):e.open||e.setAttribute(`open`,``),this.hasScrollLock||=(uh(),!0),this.syncAll();let t=this.overlayMotion?.enter(),n=this.panelMotion?.enter();Promise.allSettled([t?.finished??Promise.resolve(),n?.finished??Promise.resolve()]).then(()=>{this.machine.matches(`opening`)&&this.machine.send(`ANIMATION_END`)}),queueMicrotask(()=>this.focusInitial()),q.dispatch({el:e,name:`ui:open`})},applyClosedState(){let e=++this.modalMotionRun;this.syncAll();let t=this.overlayMotion?.exit(),n=this.panelMotion?.exit();Promise.allSettled([t?.finished??Promise.resolve(),n?.finished??Promise.resolve()]).then(()=>{this.finishClosedState(e),this.machine.matches(`closing`)&&this.machine.send(`ANIMATION_END`)})},finishClosedState(e){if(e!==this.modalMotionRun||this.isOpen)return;let t=this.dialogEl();t.open&&t.close(),this.didShowModal=!1,this.hasScrollLock&&=(dh(),!1),this.restoreFocus(),q.dispatch({el:t,name:`ui:close`})},focusInitial(){let e=this.firstAutofocusEl();if(e&&Yb(e)){e.focus({preventScroll:!0});return}let t=this.titleEl();if(this.props.autofocusTitle&&t){t.focus({preventScroll:!0});return}let n=this.focusableEls()[0];if(n){n.focus({preventScroll:!0});return}this.panelEl().focus({preventScroll:!0})},restoreFocus(){!this.activeTrigger||!document.contains(this.activeTrigger)||this.activeTrigger.focus({preventScroll:!0})},handleKeydown(e){e.key===`Tab`&&this.trapFocus(e)},trapFocus(e){let t=this.focusableEls();if(t.length===0){e.preventDefault(),this.panelEl().focus({preventScroll:!0});return}let n=t[0],r=t[t.length-1];if(!(!n||!r)){if(e.shiftKey&&document.activeElement===n){e.preventDefault(),r.focus({preventScroll:!0});return}!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus({preventScroll:!0}))}},teardownLocalTrigger(){this.localTriggerCleanup.forEach(e=>e()),this.localTriggerCleanup=[]},teardown(){this.cleanup.forEach(e=>e()),this.cleanup=[]}}),$b=()=>({props:null,target:null,cleanup:[],get name(){return this.props?.name??``},init(){this.props=B({el:this.$el,schema:Lb,onChange:()=>this.sync()}),this.target=this.targetEl(),Hb.add(this),this.sync(),q.addListener({target:this.target,event:`click`,handler:e=>this.open(e),cleanup:this.cleanup}),q.addListener({target:this.target,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&(this.target instanceof HTMLButtonElement||this.target instanceof HTMLAnchorElement||e.key!==`Enter`&&e.key!==` `||this.open(e))},cleanup:this.cleanup})},destroy(){this.props.disconnect(),Hb.delete(this),this.cleanup.forEach(e=>e()),this.cleanup=[]},get root(){return q.mergeBindings({inputs:[q.resolveStyle({part:Bb.parts.trigger,props:{},className:this.props.class}),{"data-ui-modal-trigger":``,":data-name":()=>this.props.name||void 0,":data-disabled":()=>this.props.disabled?``:void 0}]})},sync(){let e=this.modal();if(e){e.syncExternalTrigger(this.target,this.props.disabled);return}Zb(this.target,!1),this.props.disabled?(this.target.setAttribute(`aria-disabled`,`true`),this.target.setAttribute(`data-disabled`,``)):(this.target.removeAttribute(`aria-disabled`),this.target.removeAttribute(`data-disabled`))},modal(){return this.props.name?Kb(this.props.name):null},open(e){e?.preventDefault(),!this.props.disabled&&this.modal()?.openFrom(this.target)},targetEl(){return Xb(this.$el)}}),ex=e=>{e.data(`UiModal`,()=>Qb()),e.data(`UiModalTrigger`,()=>$b()),document.addEventListener(`ui:modal-close`,Jb)},tx=yh,nx=[`default`,`cards`,`pills`],rx=bh,ix=fh,ax=[`default`,`cards`,`pills`],ox={name:V,value:V,orientation:W(tx,`vertical`),variant:W(nx,`default`),indicator:U.default(!0),placement:W(rx,`leading`),disabled:U,required:U,invalid:U,loop:U.default(!0),class:V};U.default(!0),W(rx,`leading`),W(ax,`default`),W(ix,`md`),W(ix,`md`);var sx=(e,t)=>t.value||e.dataset.value||e.textContent?.trim()||``,cx=()=>({props:null,value:``,listeners:[],observer:null,init(){this.props=B({el:this.$el,schema:ox,onChange:()=>this.sync()});let e=this.items().find(e=>e.input.checked);this.value=this.props.value||e?.value||``,q.addListener({target:this.$el,event:`change`,handler:e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`radio`)return;let n=this.items().find(e=>e.input===t);n&&this.select(n,e)},cleanup:this.listeners}),q.addListener({target:this.$el,event:`keydown`,handler:e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`radio`)return;let n=this.items().find(e=>e.input===t);n&&e instanceof KeyboardEvent&&this.handleKeydown(n,e)},cleanup:this.listeners}),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this.$el,{childList:!0,subtree:!0}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect()},items(){return Array.from(this.$el.querySelectorAll(`[data-ui-radio]`)).map(e=>{let t=e.querySelector(`[data-ui-radio-input]`);if(!t)return null;let n=this.props.disabled||e.hasAttribute(`data-disabled`);return{root:e,input:t,indicator:e.querySelector(`[data-ui-radio-indicator]`),dot:e.querySelector(`[data-ui-radio-indicator-dot]`),value:sx(e,t),disabled:n}}).filter(e=>e!==null)},enabledItems(){return this.items().filter(e=>!e.disabled)},select(e,t){e.disabled||(this.value=e.value,this.sync(),t?.type!==`change`&&(e.input.dispatchEvent(new Event(`input`,{bubbles:!0})),e.input.dispatchEvent(new Event(`change`,{bubbles:!0}))))},move(e,t){let n=this.enabledItems(),r=n.findIndex(t=>t.input===e.input);if(r<0)return;let i=r+t;if(i<0||i>=n.length){if(!this.props.loop)return;i=i<0?n.length-1:0}let a=n[i];a&&(this.select(a),a.input.focus({preventScroll:!0}))},sync(){let e=this.$el;q.setAttribute({el:e,attr:`data-orientation`,value:this.props.orientation}),q.setAttribute({el:e,attr:`data-variant`,value:this.props.variant}),q.setAttribute({el:e,attr:`data-placement`,value:this.props.placement}),q.setAttribute({el:e,attr:`aria-orientation`,value:this.props.orientation}),this.props.indicator?e.removeAttribute(`data-indicator`):q.setAttribute({el:e,attr:`data-indicator`,value:`false`}),q.syncControlPresence({el:e,state:this.props});let t=this.items();this.value||=t.find(e=>e.input.checked)?.value||``,t.forEach(e=>this.syncItem(e))},syncItem(e){let t=e.value===this.value,n=this.enabledItems()[0],r=t||!this.value&&n?.input===e.input;e.input.checked=t,q.syncNativeControl({input:e.input,state:{name:this.props.name,value:e.value,disabled:e.disabled,required:this.props.required||e.root.hasAttribute(`data-required`),invalid:this.props.invalid||e.root.hasAttribute(`data-invalid`)}}),e.input.tabIndex=e.disabled?-1:r?0:-1,q.setPresence({el:e.root,attr:`data-ui-interactive`,present:this.props.variant===`cards`||e.root.dataset.variant===`cards`,value:`surface`}),q.setAttribute({el:e.root,attr:`data-state`,value:t?`checked`:`unchecked`}),q.setPresence({el:e.root,attr:`data-checked`,present:t}),q.setPresence({el:e.root,attr:`data-disabled`,present:e.disabled});let i=this.props.invalid||e.root.hasAttribute(`data-invalid`);q.setPresence({el:e.root,attr:`data-invalid`,present:i}),q.setPresence({el:e.input,attr:`data-checked`,present:t}),e.indicator&&(q.setPresence({el:e.indicator,attr:`data-checked`,present:t}),q.setPresence({el:e.indicator,attr:`data-disabled`,present:e.disabled}),q.setPresence({el:e.indicator,attr:`data-invalid`,present:i})),e.dot&&q.setPresence({el:e.dot,attr:`data-checked`,present:t})},handleKeydown(e,t){if(t.key===` `||t.key===`Spacebar`){t.preventDefault(),this.select(e);return}[`ArrowUp`,`ArrowLeft`].includes(t.key)&&(t.preventDefault(),this.move(e,-1)),[`ArrowDown`,`ArrowRight`].includes(t.key)&&(t.preventDefault(),this.move(e,1))}}),lx=e=>{e.data(`UiRadioGroup`,()=>cx())},ux={orientation:W([`vertical`,`horizontal`,`both`],`vertical`),type:W([`hover`,`always`,`scroll`],`hover`),size:W([`sm`,`md`],`sm`),fill:U,hideNative:U.default(!0),disabled:U,class:V,viewportClass:V,scrollbarClass:V,thumbClass:V,cornerClass:V},dx=G({definition:{component:`ui.scroll-area`,parts:{root:{base:[`relative min-w-0 overflow-hidden text-foreground`,`data-disabled:opacity-60`],variants:{fill:{true:`flex min-h-0 flex-1 flex-col`,false:``},size:{sm:``,md:``}},defaults:{fill:!1,size:`sm`}},viewport:{base:[`min-h-0 min-w-0 outline-none`,`focus-visible:shadow-focus`],variants:{orientation:{vertical:`h-full w-full overflow-x-hidden overflow-y-auto`,horizontal:`h-full w-full overflow-x-auto overflow-y-hidden`,both:`size-full overflow-auto`},fill:{true:`flex-1`,false:``}},defaults:{orientation:`vertical`,fill:!1}},content:{base:`min-w-0`,variants:{orientation:{vertical:``,horizontal:`w-max min-w-full`,both:`min-w-full`}},defaults:{orientation:`vertical`}},scrollbar:{base:[`pointer-events-none absolute z-10 rounded-scrollbar-thumb opacity-0`,`data-visible:pointer-events-auto data-visible:opacity-100 data-disabled:pointer-events-none`],variants:{orientation:{vertical:`bottom-scrollbar-inset right-scrollbar-inset top-scrollbar-inset w-scrollbar`,horizontal:`bottom-scrollbar-inset left-scrollbar-inset right-scrollbar-inset h-scrollbar`}},defaults:{orientation:`vertical`}},thumb:{base:[`absolute rounded-scrollbar-thumb bg-scrollbar-thumb`,`hover:bg-scrollbar-thumb-hover data-dragging:bg-scrollbar-thumb-hover`],variants:{orientation:{vertical:`left-0 top-0 w-full`,horizontal:`left-0 top-0 h-full`}},defaults:{orientation:`vertical`}},corner:{base:[`pointer-events-none absolute bottom-scrollbar-inset right-scrollbar-inset z-10 size-scrollbar rounded-scrollbar-thumb`,`bg-transparent opacity-0`,`data-visible:opacity-100`]}}}}),fx=18,px=1e3,mx=null,hx=(e,t,n)=>Math.min(n,Math.max(t,e)),gx=(e,t)=>e===`both`||e===`horizontal`&&t===`x`||e===`vertical`&&t===`y`,_x=()=>{if(mx)return mx;let e=document.createElement(`div`),t=document.createElement(`div`);return e.dir=`rtl`,e.style.cssText=`position:absolute;left:-9999px;width:4px;height:1px;overflow:scroll;`,t.style.cssText=`width:8px;height:1px;`,e.append(t),document.body.append(e),e.scrollLeft=1,e.scrollLeft===0?mx=`negative`:(e.scrollLeft=0,mx=e.scrollLeft===0?`reverse`:`default`),e.remove(),mx},vx=e=>{let t=Math.max(0,e.scrollWidth-e.clientWidth);if(!q.isRtl({el:e}))return e.scrollLeft;let n=_x();return n===`negative`?-e.scrollLeft:n===`reverse`?t-e.scrollLeft:e.scrollLeft},yx=(e,t)=>{let n=Math.max(0,e.scrollWidth-e.clientWidth),r=hx(t,0,n);if(!q.isRtl({el:e})){e.scrollLeft=r;return}let i=_x();i===`negative`?e.scrollLeft=-r:i===`reverse`?e.scrollLeft=n-r:e.scrollLeft=r},bx=e=>e.dataset.orientation===`horizontal`?`x`:`y`,xx=e=>e instanceof HTMLElement,Sx=(e,t)=>{let n=e.querySelector(`:scope > ${t}`);return xx(n)?n:null},Cx=()=>({props:null,listeners:[],resizeObserver:null,mutationObserver:null,frame:0,positionFrame:0,fadeTimer:0,isHovered:!1,isFocused:!1,isScrolling:!1,dragging:null,overflowX:!1,overflowY:!1,verticalGeometry:null,horizontalGeometry:null,init(){this.props=B({el:this.$el,schema:ux,onChange:()=>this.scheduleSync()});let e=this.elements();this.resizeObserver=new ResizeObserver(()=>this.scheduleSync()),this.resizeObserver.observe(e.viewport),e.content&&this.resizeObserver.observe(e.content),this.mutationObserver=new MutationObserver(()=>this.scheduleSync()),e.content&&this.mutationObserver.observe(e.content,{childList:!0,subtree:!0,characterData:!0}),q.addListener({target:e.viewport,event:`scroll`,handler:()=>this.onScroll(),cleanup:this.listeners,options:{passive:!0}}),q.addListener({target:this.$el,event:`pointerenter`,handler:()=>{this.isHovered=!0,this.sync()},cleanup:this.listeners}),q.addListener({target:this.$el,event:`pointerleave`,handler:()=>{this.isHovered=!1,this.updateVisibility(this.elements())},cleanup:this.listeners}),q.addListener({target:this.$el,event:`focusin`,handler:()=>{this.isFocused=!0,this.sync()},cleanup:this.listeners}),q.addListener({target:this.$el,event:`focusout`,handler:()=>{this.isFocused=this.$el.contains(document.activeElement),this.updateVisibility(this.elements())},cleanup:this.listeners}),q.addListener({target:document,event:`pointermove`,handler:e=>this.onPointerMove(e),cleanup:this.listeners}),q.addListener({target:document,event:`pointerup`,handler:e=>this.onPointerUp(e),cleanup:this.listeners}),q.addListener({target:document,event:`pointercancel`,handler:e=>this.onPointerUp(e),cleanup:this.listeners}),e.verticalThumb&&q.addListener({target:e.verticalThumb,event:`pointerdown`,handler:e=>{e.preventDefault(),this.onPointerDown(e,`y`)},cleanup:this.listeners}),e.horizontalThumb&&q.addListener({target:e.horizontalThumb,event:`pointerdown`,handler:e=>{e.preventDefault(),this.onPointerDown(e,`x`)},cleanup:this.listeners}),this.scheduleSync()},destroy(){this.props.disconnect(),this.listeners.splice(0).forEach(e=>e()),this.resizeObserver?.disconnect(),this.mutationObserver?.disconnect(),this.clearFadeTimer(),this.frame&&cancelAnimationFrame(this.frame),this.positionFrame&&cancelAnimationFrame(this.positionFrame),this.frame=0,this.positionFrame=0,this.dragging=null},get root(){return q.mergeBindings({inputs:[K({part:dx.parts.root,props:{fill:this.props.fill,size:this.props.size},className:this.props.class}),{"data-ui-scroll-area":``,":data-orientation":()=>this.props.orientation,":data-type":()=>this.props.type,":data-size":()=>this.props.size,":data-fill":()=>this.props.fill?``:void 0,":data-disabled":()=>this.props.disabled?``:void 0}]})},viewport(e){return q.mergeBindings({inputs:[K({part:dx.parts.viewport,props:{orientation:this.props.orientation,fill:this.props.fill},className:e.dataset.class}),{tabindex:`0`,"data-ui-scroll-area-viewport":``,":data-orientation":()=>this.props.orientation,":data-hide-native":()=>this.props.hideNative?``:void 0}]})},scrollbar(e){let t=bx(e)===`x`?`horizontal`:`vertical`;return q.mergeBindings({inputs:[K({part:dx.parts.scrollbar,props:{orientation:t},className:e.dataset.class}),{"data-ui-scroll-area-scrollbar":``,"aria-hidden":`true`,":data-disabled":()=>this.props.disabled?``:void 0}]})},thumb(e){let t=bx(e),n=t===`x`?`horizontal`:`vertical`;return q.mergeBindings({inputs:[K({part:dx.parts.thumb,props:{orientation:n},className:e.dataset.class}),{"data-ui-scroll-area-thumb":``,"aria-hidden":`true`,"@pointerdown.prevent":e=>this.onPointerDown(e,t),":data-dragging":()=>this.dragging?.axis===t?``:void 0}]})},corner(e){return q.mergeBindings({inputs:[K({part:dx.parts.corner,className:e.dataset.class}),{"data-ui-scroll-area-corner":``,"aria-hidden":`true`}]})},elements(){let e=this.$el,t=Sx(e,`[data-ui-scroll-area-viewport]`)??e;return{root:e,viewport:t,content:Sx(t,`[data-ui-scroll-area-content]`),verticalScrollbar:Sx(e,`[data-ui-scroll-area-scrollbar][data-orientation="vertical"]`),horizontalScrollbar:Sx(e,`[data-ui-scroll-area-scrollbar][data-orientation="horizontal"]`),verticalThumb:Sx(e,`[data-ui-scroll-area-scrollbar][data-orientation="vertical"] > [data-ui-scroll-area-thumb][data-orientation="vertical"]`),horizontalThumb:Sx(e,`[data-ui-scroll-area-scrollbar][data-orientation="horizontal"] > [data-ui-scroll-area-thumb][data-orientation="horizontal"]`),corner:Sx(e,`[data-ui-scroll-area-corner]`)}},scheduleSync(){this.frame||=requestAnimationFrame(()=>{this.frame=0,this.sync()})},schedulePositionSync(){this.positionFrame||=requestAnimationFrame(()=>{this.positionFrame=0,this.updateThumbPositions(this.elements())})},sync(){let e=this.elements(),{viewport:t}=e;this.overflowX=gx(this.props.orientation,`x`)&&t.scrollWidth>t.clientWidth+1,this.overflowY=gx(this.props.orientation,`y`)&&t.scrollHeight>t.clientHeight+1,q.setPresence({el:this.$el,attr:`data-overflow-x`,present:this.overflowX}),q.setPresence({el:this.$el,attr:`data-overflow-y`,present:this.overflowY}),q.setPresence({el:this.$el,attr:`data-scrolling`,present:this.isScrolling}),q.setPresence({el:this.$el,attr:`data-dragging`,present:this.dragging!==null}),q.setPresence({el:this.$el,attr:`data-disabled`,present:this.props.disabled}),q.setAttribute({el:t,attr:`data-orientation`,value:this.props.orientation}),q.setPresence({el:t,attr:`data-hide-native`,present:this.props.hideNative}),this.updateGeometry(e),this.updateVisibility(e)},updateGeometry(e){let{viewport:t}=e,n=(e,n,r,i)=>{if(!n||!r||!i)return r&&(r.style.width=``,r.style.height=``,r.style.transform=``),null;let a=e===`y`?n.clientHeight:n.clientWidth,o=e===`y`?t.clientHeight:t.clientWidth,s=e===`y`?t.scrollHeight:t.scrollWidth,c=Math.max(1,s-o),l=Math.min(a,Math.max(fx,o/s*a)),u=Math.max(0,a-l);return e===`y`?(r.style.height=`${l}px`,r.style.width=``):(r.style.width=`${l}px`,r.style.height=``),{trackLength:a,thumbLength:l,maxOffset:u,maxScroll:c}};this.verticalGeometry=n(`y`,e.verticalScrollbar,e.verticalThumb,this.overflowY),this.horizontalGeometry=n(`x`,e.horizontalScrollbar,e.horizontalThumb,this.overflowX),this.updateThumbPositions(e)},updateThumbPositions(e){let{viewport:t}=e;if(e.verticalThumb&&this.verticalGeometry){let{maxOffset:n,maxScroll:r}=this.verticalGeometry,i=n*hx(t.scrollTop/r,0,1);e.verticalThumb.style.transform=`translate3d(0, ${i}px, 0)`}if(e.horizontalThumb&&this.horizontalGeometry){let{maxOffset:n,maxScroll:r}=this.horizontalGeometry,i=n*hx(vx(t)/r,0,1);e.horizontalThumb.style.transform=`translate3d(${i}px, 0, 0)`}},updateVisibility(e){let t=this.isHovered||this.isFocused||this.isScrolling||this.dragging!==null,n=e=>e?this.props.type===`always`?!0:this.props.type===`scroll`?this.isScrolling||this.dragging!==null:t:!1,r=n(this.overflowY),i=n(this.overflowX);[e.verticalScrollbar,e.verticalThumb].forEach(e=>{e&&q.setPresence({el:e,attr:`data-visible`,present:r})}),[e.horizontalScrollbar,e.horizontalThumb].forEach(e=>{e&&q.setPresence({el:e,attr:`data-visible`,present:i})}),[e.verticalScrollbar,e.horizontalScrollbar].forEach(e=>{e&&q.setPresence({el:e,attr:`data-disabled`,present:this.props.disabled})}),[e.verticalThumb,e.horizontalThumb].forEach(e=>{e&&q.setPresence({el:e,attr:`data-dragging`,present:this.dragging?.axis===bx(e)})}),e.corner&&q.setPresence({el:e.corner,attr:`data-visible`,present:r&&i})},startFadeTimer(){this.clearFadeTimer(),this.fadeTimer=window.setTimeout(()=>{this.isScrolling=!1,q.setPresence({el:this.$el,attr:`data-scrolling`,present:!1}),this.updateVisibility(this.elements())},px)},clearFadeTimer(){this.fadeTimer&&=(window.clearTimeout(this.fadeTimer),0)},onScroll(){let e=this.isScrolling;this.isScrolling=!0,e||(q.setPresence({el:this.$el,attr:`data-scrolling`,present:!0}),this.updateVisibility(this.elements())),this.overflowY&&!this.verticalGeometry||this.overflowX&&!this.horizontalGeometry?this.scheduleSync():this.schedulePositionSync(),this.startFadeTimer()},onPointerDown(e,t){if(this.props.disabled)return;let n=this.elements(),r=n.viewport,i=t===`y`?n.verticalScrollbar:n.horizontalScrollbar,a=t===`y`?n.verticalThumb:n.horizontalThumb,o=t===`y`?this.overflowY:this.overflowX;if(!i||!a||!o)return;let s=t===`y`?i.clientHeight:i.clientWidth,c=t===`y`?a.offsetHeight:a.offsetWidth,l=t===`y`?Math.max(0,r.scrollHeight-r.clientHeight):Math.max(0,r.scrollWidth-r.clientWidth),u=t===`y`?r.scrollTop:vx(r);this.dragging={axis:t,pointerId:e.pointerId,startPointer:t===`y`?e.clientY:e.clientX,startScroll:u,trackLength:s,thumbLength:c,maxScroll:l};try{a.setPointerCapture?.(e.pointerId)}catch{}this.isScrolling=!0,this.clearFadeTimer(),this.sync()},onPointerMove(e){if(!this.dragging||this.dragging.pointerId!==e.pointerId)return;e.preventDefault();let t=this.elements().viewport,n=(this.dragging.axis===`y`?e.clientY:e.clientX)-this.dragging.startPointer,r=Math.max(1,this.dragging.trackLength-this.dragging.thumbLength),i=this.dragging.startScroll+n/r*this.dragging.maxScroll;this.dragging.axis===`y`?t.scrollTop=hx(i,0,this.dragging.maxScroll):yx(t,i),this.schedulePositionSync()},onPointerUp(e){if(!this.dragging||this.dragging.pointerId!==e.pointerId)return;let t=this.elements(),n=this.dragging.axis===`y`?t.verticalThumb:t.horizontalThumb;try{n?.releasePointerCapture?.(e.pointerId)}catch{}this.dragging=null,this.startFadeTimer(),this.sync()}}),wx=e=>{e.data(`UiScrollArea`,()=>Cx())},Tx=G({definition:{component:`ui.badge`,parts:{root:{base:[`inline-flex min-w-0 shrink-0 select-none items-center justify-center gap-1 whitespace-nowrap font-medium outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`],variants:{variant:{soft:`bg-current/10 text-foreground-muted`,surface:`bg-surface-panel text-foreground shadow-border`,outline:`border border-border bg-transparent text-foreground-muted`,solid:`bg-base-12 text-base-1 shadow-1`},color:{neutral:``,accent:``,success:``,warning:``,danger:``},size:{xs:`min-h-control-xs px-1.5 text-xs`,sm:`min-h-control-sm px-2 text-xs`,md:`min-h-control-md px-2.5 text-sm`,lg:`min-h-control-lg px-3 text-sm`,xlg:`min-h-control-xlg px-4 text-sm`},insetLeft:{true:``,false:``},insetRight:{true:``,false:``},insetTop:{true:`-mt-1`,false:``},insetBottom:{true:`-mb-1`,false:``}},compounds:[{when:{variant:`soft`,color:`accent`},class:`text-accent-text`},{when:{variant:`soft`,color:`success`},class:`text-success-text`},{when:{variant:`soft`,color:`warning`},class:`text-warning-text`},{when:{variant:`soft`,color:`danger`},class:`text-danger-text`},{when:{variant:`surface`,color:`accent`},class:`border border-accent-border bg-surface-panel text-accent-text shadow-none`},{when:{variant:`surface`,color:`success`},class:`border border-success-border bg-surface-panel text-success-text shadow-none`},{when:{variant:`surface`,color:`warning`},class:`border border-warning-border bg-surface-panel text-warning-text shadow-none`},{when:{variant:`surface`,color:`danger`},class:`border border-danger-border bg-surface-panel text-danger-text shadow-none`},{when:{variant:`outline`,color:`accent`},class:`border border-accent-border bg-transparent text-accent-text`},{when:{variant:`outline`,color:`success`},class:`border border-success-border bg-transparent text-success-text`},{when:{variant:`outline`,color:`warning`},class:`border border-warning-border bg-transparent text-warning-text`},{when:{variant:`outline`,color:`danger`},class:`border border-danger-border bg-transparent text-danger-text`},{when:{variant:`solid`,color:`accent`},class:`bg-accent-solid text-accent-contrast shadow-1`},{when:{variant:`solid`,color:`success`},class:`bg-success-solid text-success-contrast shadow-1`},{when:{variant:`solid`,color:`warning`},class:`bg-warning-solid text-warning-contrast shadow-1`},{when:{variant:`solid`,color:`danger`},class:`bg-danger-solid text-danger-contrast shadow-1`},...kh,{when:{insetLeft:!0,size:`xs`},class:`-ml-1.5`},{when:{insetLeft:!0,size:`sm`},class:`-ml-2`},{when:{insetLeft:!0,size:`md`},class:`-ml-2.5`},{when:{insetRight:!0,size:`xs`},class:`-mr-1.5`},{when:{insetRight:!0,size:`sm`},class:`-mr-2`},{when:{insetRight:!0,size:`md`},class:`-mr-2.5`}],defaults:{variant:`soft`,color:`neutral`,size:`sm`,radius:`sm`,insetLeft:!1,insetRight:!1,insetTop:!1,insetBottom:!1}},label:{base:`contents`},icon:{base:`shrink-0 fill-current text-current`,variants:{size:{xs:`size-icon-xs`,sm:`size-icon-xs`,md:`size-icon-sm`,lg:`size-icon-sm`,xlg:`size-icon`},position:{leading:``,trailing:``}},defaults:{size:`sm`,position:`leading`}},close:{base:[`-mr-1 inline-flex shrink-0 items-center justify-center rounded-full text-current outline-none`,`hover:bg-current/10 focus-visible:bg-current/10`,`focus-visible:ring-1 focus-visible:ring-current data-disabled:pointer-events-none data-disabled:opacity-50`],variants:{size:{xs:`size-4`,sm:`size-4`,md:`size-5`,lg:`size-5`,xlg:`size-6`}},defaults:{size:`sm`}},closeIcon:{base:`size-icon-xs shrink-0 fill-current text-current`}}}}),Ex=[`soft`,`surface`,`outline`,`solid`],Dx=[`neutral`,`accent`,`success`,`warning`,`danger`],Ox=fh,kx=[`span`,`button`],Ax=hh,jx=mh,Mx=wh;W(Ex,`soft`),W(Dx,`neutral`),W(Ox,`sm`),W(Mx,`sm`),W(kx,`span`),W(Ax,`button`),W(jx,`mini`),W(Ax,`button`),V.default(`close`),W(jx,`mini`),W(Ox,`sm`),V.default(`Remove`);var Nx=[`listbox`,`combobox`,`pillbox`,`native`],Px=ph,Fx=fh,Ix=wh,Lx=_h,Rx=gh,zx=mh,Bx={name:V,value:V,values:V,placeholder:V,mode:W(Nx,`listbox`),multiple:U,searchable:U,filter:U.default(!0),clearable:U,clear:W([`stay`,`close`],`stay`),suffix:V.default(`selected`),mark:W([`check`,`checkbox`,`none`],`check`),open:U,disabled:U,readonly:U,required:U,invalid:U,autoHighlight:U.default(!0),loop:U.default(!0),path:V,size:W(Fx,`lg`),variant:W(Px,`outline`),radius:W(Ix,`md`),side:W(Lx,`bottom`),align:W(Rx,`start`),offset:H.clamp(-100,100).default(0),gap:H.clamp(0,50).default(4),empty:V.default(`No results found.`),searchPlaceholder:V.default(`Search...`),searchIcon:V.default(`search`),icon:V,iconTrailing:V.default(`chevron__down`),iconVariant:W(zx,`outline`),buttonClass:V,inputClass:V,searchClass:V,listboxClass:V,optionClass:V,chipVariant:W(Ex,`soft`),chipColor:W(Dx,`neutral`),chipClass:V,class:V};W(zx,`outline`),H.clamp(0,100).default(0);var Vx=G({definition:{component:`ui.select`,parts:{root:{base:`relative inline-grid w-full min-w-0`},control:{base:[Ah,Mh],variants:{size:Nh,variant:Fh,mode:{listbox:``,combobox:``,pillbox:`flex-wrap gap-1 py-0.5`,native:``},empty:{true:``,false:``}},compounds:[{when:{mode:`pillbox`,empty:!1},class:`!pl-1.5`},...kh],defaults:{size:`lg`,variant:`outline`,radius:`md`,mode:`listbox`,empty:!1}},button:{base:[`flex min-w-0 flex-1 items-center gap-2 border-0 bg-transparent p-0 text-left text-inherit outline-none`]},value:{base:`min-w-0 flex-1`},placeholder:{base:`min-w-0 flex-1 text-foreground`},input:{base:[`w-full min-w-16 flex-1`,Ih]},search:{base:[`flex min-h-control-xlg shrink-0 items-center gap-2 border-b border-popover-border px-3`,`text-sm text-foreground`]},searchInput:{base:[`min-w-0 flex-1 text-sm`,Ih]},chips:{base:`flex min-w-0 flex-wrap items-center gap-1`},chip:{base:[`max-w-64`]},chipLabel:{base:`block min-w-0 flex-1 truncate`},chipRemove:{base:``},icon:{base:`size-icon shrink-0 fill-current text-icon`,variants:{position:{leading:``,trailing:``}},defaults:{position:`leading`}},action:{base:Lh},popover:{base:[zh,`overflow-hidden`]},viewport:{base:`grid auto-rows-min content-start max-h-combobox-listbox gap-1 overflow-x-hidden overflow-y-auto p-popover`},option:{base:[Vh,`[&:has([data-ui-select-option-label]>*+*)]:h-auto`,`[&:has([data-ui-select-option-label]>*+*)]:items-start`,`[&:has([data-ui-select-option-label]>*+*)]:py-2`]},optionLabel:{base:`min-w-0 flex-1 truncate`},optionMeta:{base:`ml-auto text-menu-item-muted`},optionIcon:{base:Hh,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},optionIndicator:{base:Uh},optionCheckbox:{base:[`ml-auto inline-flex size-icon-sm shrink-0 items-center justify-center rounded-1 border border-border bg-surface-panel text-accent-contrast`,`data-selected:border-accent-solid data-selected:bg-accent-solid`]},group:{base:`grid auto-rows-min content-start gap-1`},label:{base:`px-menu-item-x py-1 text-menu-heading-fg`},empty:{base:`px-menu-item-x py-2 text-sm text-foreground-muted`},separatorRoot:{base:`-mx-popover my-popover h-px`},separatorRule:{base:`h-px w-full border-0 bg-menu-separator`},nativeWrapper:{base:`relative w-full min-w-0`},native:{base:[Rh,`appearance-none pe-10`],variants:{size:Nh},compounds:kh,defaults:{size:`lg`,radius:`md`}},nativeIcon:{base:`pointer-events-none absolute right-3 top-1/2 size-icon -translate-y-1/2 fill-current text-icon`}}}}),Hx=`[data-ui-select-option], [data-ui-select-option-create]`,Ux=`template[data-ui-select-option-selected-template]`,Wx=new WeakSet,Gx=(e,t)=>e.composedPath().some(e=>e instanceof Element&&e.matches(t)),Kx=e=>{if(!(e instanceof Element)){e.childNodes.forEach(e=>Kx(e));return}Array.from(e.attributes).forEach(t=>{let n=t.name;(n===`id`||n===`role`||n===`tabindex`||n.startsWith(`aria-selected`)||n.startsWith(`aria-disabled`)||n.startsWith(`data-ui-select-option`)||n.startsWith(`data-selected`)||n.startsWith(`data-highlighted`)||n.startsWith(`data-disabled`)||n.startsWith(`x-`)||n.startsWith(`@`)||n.startsWith(`:`)||n.startsWith(`on`))&&e.removeAttribute(n)}),e.childNodes.forEach(e=>Kx(e)),e.setAttribute(`x-ignore`,`true`)},qx=e=>{let t=document.createDocumentFragment();return Array.from(e).forEach(e=>{if(e instanceof HTMLTemplateElement&&e.matches(Ux))return;let n=e.cloneNode(!0);Kx(n),t.append(n)}),t},Jx=()=>({search:``,selectedValues:[],selectedLabels:[],activeValue:``,inputSearching:!1,buttonId:``,inputId:``,listboxId:``,props:null,machine:null,popover:null,popoverMotion:null,listeners:[],observer:null,renderedChipsKey:``,renderedHiddenInputsKey:``,init(){this.props=B({el:this.$el,schema:Bx,onChange:(e,t)=>this.applyProps(t.map(e=>e.key))}),this.buttonId=this.$id(`select-button`),this.inputId=this.$id(`select-input`),this.listboxId=this.$id(`select-listbox`),this.machine=q.createMachine(q.createVisibilityMachine({enter:`enterPopover`,exit:`exitPopover`}),{context:{},actions:{enterPopover:()=>{this.props.autoHighlight&&!this.activeValue&&this.setActive(this.enabledVisibleOptions()[0]??null),this.sync(),this.popoverMotion?.enter({before:()=>{let e=this.popoverEl();e.hidden=!1,e.showPopover?.(),this.mount()},after:()=>{this.machine.matches(`opening`)&&this.machine.send(`ANIMATION_END`)}}),this.popoverMotion||this.machine.send(`ANIMATION_END`);let e=this.searchInput();this.props.searchable&&e&&e.focus({preventScroll:!0}),q.dispatch({el:this.$el,name:`ui:open`})},exitPopover:()=>{this.activeValue=``,this.search=``,this.inputSearching=!1,this.syncClosedState(),this.exitPopover()}}});let e=this.options(),t=this.props.multiple?[...q.splitControlValues(this.props.values),...q.splitControlValues(this.props.value)]:q.splitControlValues(this.props.value).slice(0,1),n=e.filter(e=>q.asBool({value:e.el.dataset.selected})).map(e=>e.value);this.selectedValues=t.length>0?t:n,this.props.multiple||(this.selectedValues=this.selectedValues.slice(0,1)),this.selectedLabels=this.selectedValues.map(t=>e.find(e=>e.value===t)?.selectedLabel??t),this.popover=q.createAnchoredPopover({reference:()=>this.control(),floating:()=>this.popoverEl(),position:()=>this.props.side,align:()=>this.props.align,gap:()=>this.props.gap,offset:()=>this.props.offset,matchReferenceWidth:!0}),this.popoverMotion=q.motion.createPresenceLifecycle({element:()=>this.popoverEl(),preset:`popover`}),this.setup(),this.sync(),this.props.open&&!this.props.disabled&&!this.props.readonly&&this.machine.send(`OPEN`)},destroy(){this.props.disconnect(),this.machine.stop(),this.popoverMotion?.destroy(),this.listeners.forEach(e=>e()),this.listeners=[],this.observer?.disconnect(),this.unmount()},get isOpen(){return this.machine?.hasTag(`interactive`)??!1},get root(){return q.mergeBindings({inputs:[K({part:Vx.parts.root,props:this.props,className:this.props.class}),{"data-ui-select":``,":data-state":()=>this.isOpen?`open`:`closed`}]})},control(){let e=this.$el.querySelector(`[data-ui-select-control]`);if(!e)throw Error(`Select requires a control element.`);return e},trigger(){let e=this.$el.querySelector(`[data-ui-select-trigger], [data-ui-select-button], [data-ui-select-input]`);if(!e)throw Error(`Select requires a trigger element.`);return e},input(){return this.$el.querySelector(`[data-ui-select-input]`)},searchInput(){return this.$el.querySelector(`[data-ui-select-search-input]`)},popoverEl(){let e=this.$el.querySelector(`[data-ui-select-popover]`);if(!e)throw Error(`Select requires a popover element.`);return e},listbox(){let e=this.$el.querySelector(`[data-ui-select-listbox]`);if(!e)throw Error(`Select requires a listbox element.`);return e},chipsEl(){return this.$el.querySelector(`[data-ui-select-chips]`)},hiddenInputsEl(){return this.$el.querySelector(`[data-ui-select-hidden-inputs]`)},options(){let e=q.normalizeOptionText(this.search),t=Array.from(this.$el.querySelectorAll(Hx)).map((t,n)=>{let r=this.resolveOptionLabel(t),i=this.optionValue(t,r),a=this.resolveSelectedLabel(t,r),o=q.asBool({value:t.dataset.disabled}),s=this.selectedValues.includes(i),c=t.hasAttribute(`data-ui-select-option-create`),l=!this.props.filter||e===``||q.normalizeOptionText(`${r} ${t.dataset.suffix??``}`).includes(e),u=e!==``&&q.normalizeOptionText(r)===e,d=Number(t.dataset.minLength??`0`),f=c?e.length>=d&&!u:l;return{el:t,id:t.id||`${this.listboxId}-option-${n}`,value:i,label:r,selectedLabel:a,disabled:o,selected:s,visible:f,create:c}}),n=t.some(t=>!t.create&&q.normalizeOptionText(t.label)===e);return t.map(e=>e.create&&n?{...e,visible:!1}:e)},enabledVisibleOptions(){return this.options().filter(e=>e.visible&&!e.disabled)},hasSelection(){return this.selectedValues.length>0},hasClearValue(){return this.search.length>0||this.hasSelection()},isPillbox(){return this.props.mode===`pillbox`&&this.props.multiple},controlLayoutMode(){return this.isPillbox()?`pillbox`:this.props.mode===`combobox`?`combobox`:`listbox`},valuesFromProps(){let e=this.props.multiple?[...q.splitControlValues(this.props.values),...q.splitControlValues(this.props.value)]:q.splitControlValues(this.props.value).slice(0,1);return this.props.multiple?Array.from(new Set(e)):e.slice(0,1)},applyProps(e=[]){if(e.includes(`value`)||e.includes(`values`)||e.includes(`multiple`)){let e=this.options();this.selectedValues=this.valuesFromProps(),this.selectedLabels=this.selectedValues.map(t=>e.find(e=>e.value===t)?.selectedLabel??t)}e.includes(`open`)&&(this.props.open&&!this.props.disabled&&!this.props.readonly?this.machine.send(`OPEN`):this.machine.send(`CLOSE`)),(e.includes(`disabled`)||e.includes(`readonly`))&&(this.props.disabled||this.props.readonly)&&this.machine.send(`CLOSE`),this.sync()},selectedSummary(){return!this.hasSelection()||this.isPillbox()?``:this.props.multiple&&this.selectedValues.length>1?`${this.selectedValues.length} ${this.props.suffix}`:this.selectedLabels[0]??this.selectedValues[0]??``},openSelect(e){e?.preventDefault(),!(this.props.disabled||this.props.readonly)&&this.machine.send(`OPEN`)},closeSelect(e){e?.preventDefault(),this.machine.send(`CLOSE`)},toggle(e){if(e?.preventDefault(),this.isOpen){this.closeSelect();return}this.openSelect()},clear(e){e?.preventDefault(),e?.stopPropagation(),!(this.props.disabled||this.props.readonly)&&(this.search=``,this.inputSearching=!1,this.selectedValues=[],this.selectedLabels=[],this.activeValue=``,this.props.clear===`close`?this.closeSelect(e):this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-select-hidden-input`}),q.dispatch({el:this.$el,name:`ui:clear`}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:``,values:[],labels:[]}}))},select(e,t){let n=typeof e==`string`?this.options().find(t=>t.value===e):e;n&&this.selectOption(n,t)},deselect(e,t){if(t?.preventDefault(),this.props.disabled||this.props.readonly)return;let n=this.options();n.find(t=>t.value===e)?.disabled||(this.selectedValues=this.selectedValues.filter(t=>t!==e),this.selectedLabels=this.selectedValues.map(e=>n.find(t=>t.value===e)?.selectedLabel??e),this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-select-hidden-input`}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],labels:[...this.selectedLabels]}}))},removeLastValue(e){if(!this.isPillbox()||this.search!==``||this.selectedValues.length===0)return;let t=this.options(),n=[...this.selectedValues].reverse().find(e=>!t.find(t=>t.value===e)?.disabled);n&&(e?.preventDefault(),this.deselect(n,e))},setSearch(e){this.props.disabled||this.props.readonly||(this.search=e,this.isOpen||this.machine.send(`OPEN`),this.props.autoHighlight&&this.focusFirst(),this.sync(),q.dispatch({el:this.$el,name:`ui:search`,detail:{search:this.search}}))},refreshOptions(){this.syncOptions(),this.syncTrigger()},selectOption(e,t){if(t?.preventDefault(),this.props.disabled||this.props.readonly||e.disabled)return;let n=this.isOpen;if(e.create){q.dispatch({el:this.$el,name:`ui:create`,detail:{search:this.search,value:e.value||this.search}}),this.closeSelect();return}if(this.props.multiple){this.selectedValues.includes(e.value)?this.selectedValues=this.selectedValues.filter(t=>t!==e.value):this.selectedValues=[...this.selectedValues,e.value];let t=this.options();this.selectedLabels=this.selectedValues.map(e=>t.find(t=>t.value===e)?.selectedLabel??e),this.search=``,this.inputSearching=!1,this.machine.send(`OPEN`)}else this.selectedValues=[e.value],this.selectedLabels=[e.selectedLabel],this.search=``,this.inputSearching=!1,this.machine.send(`CLOSE`);n&&!this.isOpen?this.syncClosedState():this.sync(),q.dispatchNativeControlChange({container:this.hiddenInputsEl(),fallback:this.$el,marker:`data-ui-select-hidden-input`}),q.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.selectedValues[0]??``,values:[...this.selectedValues],label:this.selectedLabels[0]??``,labels:[...this.selectedLabels],option:e.el}})},setActive(e){(e?.value??``)!==this.activeValue&&(this.activeValue=e?.value??``,this.syncOptions(),this.syncInputs(),q.dispatch({el:this.$el,name:`ui:highlight`,detail:{value:this.activeValue,option:e?.el??null}}))},moveActive(e){let t=this.enabledVisibleOptions();if(t.length===0)return;let n=t.findIndex(e=>e.value===this.activeValue),r=n+e;n<0&&(r=e>0?0:t.length-1),r>=t.length&&(r=this.props.loop?0:t.length-1),r<0&&(r=this.props.loop?t.length-1:0),this.setActive(t[r]??null)},focusFirst(){this.setActive(this.enabledVisibleOptions()[0]??null)},focusLast(){let e=this.enabledVisibleOptions();this.setActive(e[e.length-1]??null)},handleSearchInput(e){let t=e.target;t instanceof HTMLInputElement&&this.setSearch(t.value)},handleInput(e){let t=e.target;t instanceof HTMLInputElement&&(this.inputSearching=!0,this.setSearch(t.value))},handleKeydown(e){if(e.key===`ArrowDown`){e.preventDefault(),this.isOpen||this.openSelect(),this.moveActive(1);return}if(e.key===`ArrowUp`){e.preventDefault(),this.isOpen||this.openSelect(),this.moveActive(-1);return}if(this.isOpen&&e.key===`Home`){e.preventDefault(),this.focusFirst();return}if(this.isOpen&&e.key===`End`){e.preventDefault(),this.focusLast();return}if((e.key===`Enter`||e.key===` `)&&this.isOpen&&this.activeValue){let t=this.options().find(e=>e.value===this.activeValue);t&&this.selectOption(t,e);return}if((e.key===`Backspace`||e.key===`Delete`)&&this.isPillbox()&&this.search===``){let t=this.input();(!t||t.selectionStart===0&&t.selectionEnd===0)&&this.removeLastValue(e);return}e.key===`Escape`&&this.isOpen&&(this.closeSelect(e),this.trigger().focus({preventScroll:!0}))},handleFocusout(e){let t=e.relatedTarget;if(!(t instanceof Node)){this.closeSelect();return}this.$el.contains(t)||this.popoverEl().contains(t)||this.closeSelect()},sync(){this.syncRoot(),this.syncControl(),this.syncTrigger(),this.syncInputs(),this.syncListbox(),this.syncOptions(),this.syncChips(),this.syncHiddenInputs()},syncRoot(){this.$el.dataset.state=this.isOpen?`open`:`closed`,q.syncControlPresence({el:this.$el,state:{disabled:this.props.disabled,required:this.props.required,invalid:this.props.invalid},value:`true`})},syncControl(){let e=this.control();e.setAttribute(`class`,K({part:Vx.parts.control,props:{...this.props,mode:this.controlLayoutMode(),empty:this.isPillbox()&&!this.hasSelection()}})),e.dataset.state=this.isOpen?`open`:`closed`,e.dataset.mode=this.controlLayoutMode(),q.setPresence({el:e,attr:`data-ui-select-pillbox-control`,present:this.isPillbox(),value:``}),q.setPresence({el:e,attr:`data-empty`,present:this.isPillbox()&&!this.hasSelection(),value:`true`}),q.syncControlPresence({el:e,state:{disabled:this.props.disabled,invalid:this.props.invalid},value:`true`})},syncTrigger(){let e=this.trigger();e.id||=this.buttonId,e.dataset.state=this.isOpen?`open`:`closed`,e.setAttribute(`aria-haspopup`,`listbox`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.listboxId),this.props.invalid?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`),this.props.disabled?e.setAttribute(`disabled`,``):e.removeAttribute(`disabled`);let t=this.selectedSummary(),n=this.$el.querySelector(`[data-ui-select-button-value]`),r=this.$el.querySelector(`[data-ui-select-button-placeholder]`);if(n){n.replaceChildren();let e=(!this.props.multiple||this.selectedValues.length===1)&&t?this.selectedOption():null;e?n.append(this.selectedContent(e)):n.textContent=t,n.hidden=t===``}r&&(r.hidden=t!==``),this.$el.querySelectorAll(`[data-ui-select-clear], [data-ui-select-button-clear], [data-ui-select-search-clear]`).forEach(e=>{e.hidden=this.props.disabled||!this.props.clearable||!this.hasClearValue(),e instanceof HTMLButtonElement&&(e.disabled=this.props.disabled)})},syncInputs(){let e=this.input();if(e){e.id||=this.inputId;let t=this.selectedSummary();e.className=K({part:Vx.parts.input,className:this.props.inputClass}),this.isPillbox()?(e.value=this.search,e.placeholder=this.hasSelection()?``:this.props.placeholder):(e.value=this.isOpen&&this.inputSearching?this.search:t,e.placeholder=this.props.placeholder),e.setAttribute(`role`,`combobox`),e.setAttribute(`autocomplete`,`off`),e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-expanded`,this.isOpen?`true`:`false`),e.setAttribute(`aria-controls`,this.listboxId),q.syncNativeControl({input:e,state:{disabled:this.props.disabled,readonly:this.props.readonly,required:this.props.required,nativeRequired:!1,invalid:this.props.invalid,ariaRequired:this.props.required}})}let t=this.searchInput();t&&(t.value=this.search,t.disabled=this.props.disabled);let n=this.options().find(e=>e.value===this.activeValue)?.id??``;[e,t].forEach(e=>{e&&(n?e.setAttribute(`aria-activedescendant`,n):e.removeAttribute(`aria-activedescendant`))})},syncListbox(){let e=this.popoverEl(),t=this.listbox();e.id=`${this.listboxId}-popover`,e.setAttribute(`class`,K({part:Vx.parts.popover,props:this.props,className:this.props.listboxClass})),e.setAttribute(`popover`,`manual`),e.dataset.state=this.isOpen?`open`:`closed`,e.hidden=!this.isOpen,t.id=this.listboxId,t.setAttribute(`role`,`listbox`),t.setAttribute(`tabindex`,`-1`),t.setAttribute(`aria-labelledby`,this.trigger().id),this.props.multiple?t.setAttribute(`aria-multiselectable`,`true`):t.removeAttribute(`aria-multiselectable`)},syncClosedState(){this.syncRoot(),this.syncControl(),this.syncTrigger(),this.syncInputs(),this.syncOptions(),this.syncChips(),this.syncHiddenInputs()},syncOptions(){let e=this.options(),t=this.$el.querySelector(`[data-ui-select-option-empty]`),n=e.some(e=>e.visible&&!e.create);e.forEach(e=>{e.el.id=e.id,e.el.hidden=!e.visible,e.el.setAttribute(`role`,`option`),e.el.setAttribute(`aria-selected`,e.selected?`true`:`false`),e.el.dataset.value=e.value,e.el.dataset.label=e.label,q.setPresence({el:e.el,attr:`data-selected`,present:e.selected,value:`true`}),q.setPresence({el:e.el,attr:`data-highlighted`,present:e.value===this.activeValue,value:`true`}),q.setPresence({el:e.el,attr:`data-disabled`,present:e.disabled,value:`true`}),e.el.querySelectorAll(`[data-ui-select-option-indicator]`).forEach(t=>{q.setPresence({el:t,attr:`data-selected`,present:e.selected,value:`true`})}),e.disabled?e.el.setAttribute(`aria-disabled`,`true`):e.el.removeAttribute(`aria-disabled`)}),t&&(t.hidden=n)},syncChips(){let e=this.chipsEl();if(!e)return;let t=!this.isPillbox()||this.selectedValues.length===0;e.hidden=t;let n=this.options(),r=this.selectedValues.map((e,t)=>{let r=n.find(t=>t.value===e);return{value:e,label:this.selectedLabels[t]??r?.selectedLabel??e,disabled:r?.disabled??!1}}),i=JSON.stringify({hidden:t,chips:r,disabled:this.props.disabled,readonly:this.props.readonly,chipVariant:this.props.chipVariant,chipColor:this.props.chipColor,chipClass:this.props.chipClass});if(i===this.renderedChipsKey||(this.renderedChipsKey=i,e.replaceChildren(),e.hidden))return;let a=K({part:Tx.parts.root,props:{variant:this.props.chipVariant,color:this.props.chipColor,size:`sm`,radius:`sm`},className:K({part:Vx.parts.chip,props:{},className:this.props.chipClass})}),o=K({part:Vx.parts.chipLabel}),s=K({part:Tx.parts.close,props:{size:`sm`},className:K({part:Vx.parts.chipRemove})});r.forEach(t=>{let n=document.createElement(`span`);n.className=a,n.setAttribute(`data-ui-badge`,``),n.setAttribute(`data-ui-select-chip`,``),n.dataset.variant=this.props.chipVariant,n.dataset.color=this.props.chipColor,n.dataset.size=`sm`,n.dataset.radius=`sm`,n.dataset.value=t.value,q.setPresence({el:n,attr:`data-disabled`,present:t.disabled,value:`true`});let r=document.createElement(`span`);r.className=o,r.setAttribute(`data-ui-badge-label`,``),r.setAttribute(`data-ui-select-chip-label`,``),r.textContent=t.label,n.append(r);let i=document.createElement(`button`);i.type=`button`,i.className=s,i.setAttribute(`data-ui-badge-close`,``),i.setAttribute(`data-ui-select-chip-remove`,``),i.setAttribute(`aria-label`,`Remove ${t.label}`),i.disabled=this.props.disabled||this.props.readonly||t.disabled,q.setPresence({el:i,attr:`data-disabled`,present:i.disabled,value:`true`}),i.disabled&&i.setAttribute(`aria-disabled`,`true`);let c=this.$el.querySelector(`[data-ui-select-chip-remove-icon]`);c?(i.append(c.content.cloneNode(!0)),i.querySelectorAll(`[aria-hidden="true"]`).forEach(e=>{e.setAttribute(`data-ui-badge-close-icon`,``)})):i.textContent=`x`,i.addEventListener(`click`,e=>this.deselect(t.value,e)),n.append(i),e.append(n)})},syncHiddenInputs(){let e=this.hiddenInputsEl();e&&(this.renderedHiddenInputsKey=q.syncRepeatedHiddenInputs({container:e,state:{name:this.props.name,required:this.props.required,values:this.selectedValues,form:this.$el.dataset.form??``,marker:`data-ui-select-hidden-input`},currentKey:this.renderedHiddenInputsKey}))},mount(){this.popover?.mount()},unmount(){this.popover?.unmount()},exitPopover(){let e=()=>{let e=this.popoverEl();e.dataset.state=`closed`,e.hidden=!1};if(!this.popoverMotion){e(),this.finishClose(),this.machine.send(`ANIMATION_END`);return}this.popoverMotion.exit({before:e,after:()=>{this.machine.matches(`closing`)&&(this.finishClose(),this.machine.send(`ANIMATION_END`))}})},finishClose(){this.isOpen||(this.popoverEl().hidePopover?.(),this.unmount(),this.syncListbox(),q.dispatch({el:this.$el,name:`ui:close`}))},setup(){let e=this.control(),t=this.trigger(),n=this.popoverEl(),r=this.listbox(),i=this.input(),a=this.searchInput();q.addListener({target:t,event:`click`,handler:e=>{Wx.add(e);let n=e.target;if(n instanceof Element&&n.closest(`[data-ui-select-clear], [data-ui-select-button-clear]`)){this.clear(e);return}if(!(n instanceof Element&&n.closest(`[data-ui-select-chip-remove]`))){if(this.trigger().focus({preventScroll:!0}),t instanceof HTMLInputElement){this.isOpen||this.openSelect(e);return}this.toggle(e)}},cleanup:this.listeners}),q.addListener({target:t,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners}),q.addListener({target:e,event:`pointerdown`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(`[data-ui-select-icon="trailing"]`)&&e.preventDefault()},cleanup:this.listeners}),q.addListener({target:e,event:`click`,handler:e=>{let n=e.target;if(!(n instanceof Element))return;if(n.closest(`[data-ui-select-clear], [data-ui-select-button-clear]`)){this.clear(e);return}if(n.closest(`[data-ui-select-chip-remove]`))return;if(Gx(e,`[data-ui-select-trigger]`)){if(Wx.has(e))return;if(this.trigger().focus({preventScroll:!0}),t instanceof HTMLInputElement){this.isOpen||this.openSelect(e);return}this.toggle(e);return}if(n.closest(`[data-ui-select-icon="trailing"]`)){let t=this.isOpen;this.trigger().focus({preventScroll:!0}),t?this.closeSelect(e):this.openSelect(e);return}if(this.isPillbox()){this.trigger().focus({preventScroll:!0}),this.isOpen||this.openSelect(e);return}let r=this.isOpen;this.trigger().focus({preventScroll:!0}),r?this.closeSelect(e):this.openSelect(e)},cleanup:this.listeners}),i&&(q.addListener({target:i,event:`focus`,handler:()=>this.openSelect(),cleanup:this.listeners}),q.addListener({target:i,event:`input`,handler:e=>this.handleInput(e),cleanup:this.listeners})),a&&(q.addListener({target:a,event:`input`,handler:e=>this.handleSearchInput(e),cleanup:this.listeners}),q.addListener({target:a,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners})),q.addListener({target:this.$el,event:`focusout`,handler:e=>{e instanceof FocusEvent&&this.handleFocusout(e)},cleanup:this.listeners}),q.addListener({target:n,event:`pointerdown`,handler:e=>{let t=e.target;t instanceof Element&&t.closest(Hx)&&e.preventDefault()},cleanup:this.listeners}),q.addListener({target:n,event:`click`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;if(t.closest(`[data-ui-select-search-clear]`)){this.setSearch(``);return}let n=t.closest(Hx),r=n?this.options().find(e=>e.el===n):void 0;r&&this.selectOption(r,e)},cleanup:this.listeners}),q.addListener({target:n,event:`pointermove`,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(Hx),r=n?this.options().find(e=>e.el===n):void 0;r&&!r.disabled&&this.setActive(r)},cleanup:this.listeners}),q.addListener({target:n,event:`pointerleave`,handler:()=>{this.setActive(null)},cleanup:this.listeners}),this.listeners.push(q.addDismissableLayer({isEnabled:()=>this.isOpen,roots:()=>[this.$el,n],onDismiss:()=>this.closeSelect()})),this.observer=new MutationObserver(()=>{this.sync(),this.props.autoHighlight&&this.isOpen&&!this.activeValue&&this.focusFirst()}),this.observer.observe(r,{childList:!0,subtree:!0})},selectedOption(){let e=this.selectedValues[0]??``;return e?this.options().find(t=>t.value===e)??null:null},selectedContent(e){let t=e.el.querySelector(Ux);if(t)return qx(t.content.childNodes);let n=e.el.querySelector(`[data-ui-select-option-selected-content]`)??e.el.querySelector(`[data-ui-select-option-label]`);if(n)return qx(n.childNodes);let r=document.createDocumentFragment();return r.append(document.createTextNode(e.selectedLabel)),r},resolveOptionLabel(e){let t=e.dataset.label||e.getAttribute(`aria-label`)||``;if(t)return t;let n=e.dataset.textValue??``;if(n)return n;let r=q.parseItemData(e.dataset.item),i=q.getPathValue(r,this.props.path);return i==null?(e.querySelector(`[data-ui-select-option-label]`)?.textContent??e.textContent??``).trim():String(i)},resolveSelectedLabel(e,t){return e.dataset.selectedLabel||t},optionValue(e,t){return e.dataset.value||t}}),Yx=e=>{e.data(`UiSelect`,()=>Jx())},Xx=[`left`,`right`],Zx=[`none`,`mobile`,`desktop`,`both`],Qx=[`toggle`,`open`,`close`,`stash`,`expand`],$x=[`a`,`button`],eS=[`ghost`,`surface`],tS=[`neutral`,`accent`],nS={id:V.default(`ui-sidebar`),side:W(Xx,`left`),sticky:U.default(!0),collapse:W(Zx,`mobile`),open:U,stashed:U,persist:U.default(!0),width:V.default(`16rem`),minWidth:V.default(`12rem`),maxWidth:V.default(`28rem`),mobile:V.default(`18rem`),breakpoint:V.default(`lg`),edgeReveal:U.default(!0),resizable:U,class:V};W($x,`a`),W(eS,`ghost`),W(tS,`neutral`),U.default(!0);var rS={target:V,icon:V.default(`side_panel`),label:V.default(`Toggle sidebar`),action:W(Qx,`toggle`),class:V},iS=G({definition:{component:`ui.sidebar`,parts:{root:{base:[`fixed inset-y-0 z-dialog flex min-h-0 w-[var(--ui-sidebar-mobile-width)] flex-col overflow-hidden`,`border-base-a3 bg-chrome text-foreground shadow-2 outline-none`,`data-[mobile-state=closed]:-translate-x-full data-[mobile-state=open]:translate-x-0`,`lg:top-0 lg:z-auto lg:w-[var(--ui-sidebar-width)] lg:translate-x-0 lg:data-[mobile-state=closed]:translate-x-0 lg:data-[mobile-state=open]:translate-x-0 lg:shadow-none`,`lg:data-[desktop-state=stashed]:data-[drawer-state=closed]:data-[sidebar-exiting=false]:hidden`,`lg:data-[desktop-state=stashed]:data-[drawer-state=open]:fixed lg:data-[desktop-state=stashed]:data-[drawer-state=open]:inset-y-2`,`lg:data-[desktop-state=stashed]:data-[drawer-state=open]:z-dialog lg:data-[desktop-state=stashed]:data-[drawer-state=open]:h-auto lg:data-[desktop-state=stashed]:data-[drawer-state=open]:rounded-4 lg:data-[desktop-state=stashed]:data-[drawer-state=open]:border lg:data-[desktop-state=stashed]:data-[drawer-state=open]:shadow-2`,`[grid-area:sidebar]`],variants:{side:{left:`left-0 border-r lg:left-auto lg:data-[desktop-state=stashed]:data-[drawer-state=open]:left-2`,right:`right-0 border-l data-[mobile-state=closed]:translate-x-full data-[mobile-state=open]:translate-x-0 lg:right-auto lg:data-[desktop-state=stashed]:data-[drawer-state=open]:right-2`},sticky:{true:`lg:sticky lg:h-screen`,false:`lg:relative lg:h-auto lg:data-[sticky=false]:relative lg:data-[sticky=False]:relative lg:data-[sticky=false]:h-auto lg:data-[sticky=False]:h-auto`}},defaults:{side:`left`,sticky:!0}},header:{base:`flex min-h-control-xlg shrink-0 items-center gap-2 px-3 py-2`},content:{base:[`min-h-0 flex-1 overflow-hidden`]},contentInner:{base:[`grid min-w-0 content-start gap-1 px-2 py-2`,`[&>[data-ui-separator]]:-mx-2 [&>[data-ui-separator]]:w-auto`]},footer:{base:`grid shrink-0 gap-1 px-2 py-2`},nav:{base:`grid gap-1`},item:{base:[`group/sidebar-item flex h-control-md w-full min-w-0 select-none items-center gap-2 rounded-3 px-2`,`border border-transparent text-left text-sm font-medium text-foreground outline-none`,`cursor-default`,Bh,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`],variants:{variant:{ghost:``,surface:`data-current:border-transparent data-current:shadow-none`},color:{neutral:`[--color-interactive-selected:var(--color-base-a3)] [--color-interactive-selected-hover:var(--color-base-a4)]`,accent:`[--color-interactive-selected:var(--color-accent-surface)] [--color-interactive-selected-hover:var(--color-accent-surface-hover)]`},withActions:{true:`pr-9`,false:``}},defaults:{variant:`ghost`,color:`neutral`,withActions:!1}},itemRow:{base:`group/sidebar-item-row relative min-w-0`},itemIcon:{base:`size-icon-xs shrink-0 fill-current text-icon`,variants:{position:{leading:``,trailing:`ml-auto`}},defaults:{position:`leading`}},itemLabel:{base:`min-w-0 flex-1`},itemBadge:{base:`ml-auto shrink-0 rounded-2 bg-base-a3 px-1.5 py-0.5 text-xs text-foreground-muted`},itemActions:{base:`absolute right-1 top-1/2 z-10 flex -translate-y-1/2 items-center gap-1`},group:{base:`relative grid gap-1`},groupSummary:{base:[`block h-control-md cursor-default select-none list-none rounded-3 text-xs font-medium text-foreground-muted outline-none`,`hover:bg-base-a2 hover:text-foreground focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`[&::-webkit-details-marker]:hidden`],variants:{hasActions:{true:``,false:``}},defaults:{hasActions:!1}},groupSummaryInner:{base:`flex h-full min-w-0 items-center gap-2 px-2`},groupHeading:{base:`flex min-h-control-md min-w-0 select-none items-center gap-2 px-2 py-1 cursor-default`},groupIcon:{base:`size-icon-xs shrink-0 fill-current text-icon group-open/sidebar-group:rotate-90`},groupLabel:{base:`min-w-0 flex-1`},groupHeadingLabel:{base:`min-w-0 flex-1`},groupActions:{base:`ml-auto flex shrink-0 items-center gap-1`},groupContent:{base:`grid gap-1`},toggle:{base:[`inline-flex h-control-md w-control-md shrink-0 items-center justify-center rounded-3 text-foreground-muted outline-none`,`hover:bg-base-a2 hover:text-foreground focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`]},toggleIcon:{base:`size-icon fill-current text-current`},edge:{base:[`fixed inset-y-0 z-30 hidden w-2 bg-transparent outline-none lg:block`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-[state=hidden]:hidden`],variants:{side:{left:`left-0`,right:`right-0`}},defaults:{side:`left`}},resizeHandle:{base:[`absolute inset-y-0 z-10 hidden w-3 cursor-col-resize touch-none border-transparent outline-none lg:block`,`hover:border-border-interactive`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:hidden`],variants:{side:{left:`right-0 border-r`,right:`left-0 border-l`}},defaults:{side:`left`}}}}}),aS={target:rS.target,action:rS.action,class:rS.class},oS={target:rS.target,action:rS.action,class:rS.class},sS=new Set,cS={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},lS=(e,t)=>!t?.id||t.id===e.id,uS=e=>{let t=cS[e];return t?`(min-width: ${t}px)`:/^\d+$/.test(e)?`(min-width: ${e}px)`:/^\d+(\.\d+)?(px|rem|em)$/.test(e)?`(min-width: ${e})`:`(min-width: ${cS.lg}px)`},dS=e=>e instanceof CustomEvent&&typeof e.detail==`object`&&e.detail!==null?e.detail:{},fS=e=>e.target instanceof Element&&e.target.hasAttribute(`data-ui-sidebar`),pS=(e,t)=>{if(fS(e))return;let n=dS(e);sS.forEach(e=>{lS(e,n)&&e.perform(n.action??t,n.trigger??null)})},mS=(()=>{let e=!1;return()=>{e||typeof document>`u`||(document.addEventListener(`ui:sidebar-open`,e=>pS(e,`open`)),document.addEventListener(`ui:sidebar-close`,e=>pS(e,`close`)),document.addEventListener(`ui:sidebar-toggle`,e=>pS(e,`toggle`)),e=!0)}})(),hS=()=>({props:null,machine:null,sidebarExitFreezeCleanup:null,drawerMotionRun:0,desktopMode:!1,renderedExpanded:!1,renderedDrawerOpen:!1,lastPointer:null,activeTrigger:null,currentWidth:`16rem`,cleanup:[],drawerMotion:null,backdropMotion:null,hasScrollLock:!1,mediaQuery:null,mediaQueryCleanup:null,get id(){return this.$el.id||this.props.id||`ui-sidebar`},init(){mS(),this.props=B({el:this.$el,schema:nS,onChange:(e,t)=>this.applyProps(t.map(e=>e.key))});let e=this.storedStashed();this.currentWidth=this.props.width,this.setupMediaQuery(),this.desktopMode=this.isDesktop();let t=e??this.props.stashed;this.machine=q.createMachine({initial:this.desktopMode?t?`desktop.stashed.closed`:`desktop.expanded.idle`:this.props.open?`mobile.open`:`mobile.closed`,states:{desktop:{tags:[`desktop`],states:{expanded:{initial:`idle`,states:{idle:{id:`desktopExpanded`,tags:[`expanded`],entry:[`rememberExpanded`],on:{CLOSE:`stashing`,STASH:`stashing`,OPEN:{actions:[`dispatchOpen`]},EXPAND:{actions:[`dispatchOpen`]},BREAKPOINT_MOBILE_CLOSED:`#mobileExiting`,BREAKPOINT_MOBILE_OPEN:`#mobileOpen`}},entering:{id:`desktopEntering`,tags:[`expanded`,`entering`],entry:[`rememberExpanded`,`beginSidebarEnter`,`dispatchOpen`],on:{ANIMATION_END:`idle`,CLOSE:`stashing`,STASH:`stashing`,BREAKPOINT_MOBILE_CLOSED:`#mobileExiting`,BREAKPOINT_MOBILE_OPEN:`#mobileOpen`}},stashing:{tags:[`desktopStashed`,`sidebarExiting`,`exiting`],entry:[`rememberStashed`,`beginSidebarExit`,`dispatchClose`],on:{ANIMATION_END:`#desktopStashedClosed`,OPEN:`#desktopStashedOpening`,EXPAND:`#desktopEntering`,BREAKPOINT_MOBILE_CLOSED:`#mobileExiting`,BREAKPOINT_MOBILE_OPEN:`#mobileOpen`}}}},stashed:{tags:[`desktopStashed`],states:{closed:{id:`desktopStashedClosed`,entry:[`rememberStashed`],on:{OPEN:`opening`,EXPAND:`#desktopEntering`,BREAKPOINT_MOBILE_CLOSED:`#mobileClosed`,BREAKPOINT_MOBILE_OPEN:`#mobileOpen`}},opening:{id:`desktopStashedOpening`,tags:[`expanded`,`drawerOpen`,`desktopDrawerOpen`,`drawerVisible`,`entering`],entry:[`rememberStashed`,`beginDrawerEnter`,`dispatchOpen`],on:{ANIMATION_END:`open`,CLOSE:`closing`,STASH:`closing`,EXPAND:`#desktopExpanded`,BREAKPOINT_MOBILE_CLOSED:`#mobileExiting`,BREAKPOINT_MOBILE_OPEN:`#mobileOpen`}},open:{tags:[`expanded`,`drawerOpen`,`desktopDrawerOpen`,`drawerVisible`],on:{CLOSE:`closing`,STASH:`closing`,EXPAND:`#desktopExpanded`,BREAKPOINT_MOBILE_CLOSED:`#mobileExiting`,BREAKPOINT_MOBILE_OPEN:`#mobileOpen`}},closing:{tags:[`drawerVisible`,`drawerExiting`,`exiting`],entry:[`rememberStashed`,`beginDrawerExit`,`dispatchClose`],on:{ANIMATION_END:`closed`,OPEN:`opening`,EXPAND:`#desktopEntering`,BREAKPOINT_MOBILE_CLOSED:`#mobileExiting`,BREAKPOINT_MOBILE_OPEN:`#mobileOpen`}}}}}},mobile:{states:{closed:{id:`mobileClosed`,on:{OPEN:`opening`,EXPAND:`opening`,BREAKPOINT_DESKTOP_EXPANDED:`#desktopEntering`,BREAKPOINT_DESKTOP_STASHED:`#desktopStashedClosed`}},opening:{tags:[`expanded`,`mobileOpen`,`drawerOpen`,`drawerVisible`,`entering`],entry:[`beginDrawerEnter`,`dispatchOpen`],on:{ANIMATION_END:`open`,CLOSE:`closing`,STASH:`closing`,BREAKPOINT_DESKTOP_EXPANDED:`#desktopEntering`,BREAKPOINT_DESKTOP_STASHED:`#desktopStashedClosed`}},open:{id:`mobileOpen`,tags:[`expanded`,`mobileOpen`,`drawerOpen`,`drawerVisible`],on:{CLOSE:`closing`,STASH:`closing`,BREAKPOINT_DESKTOP_EXPANDED:`#desktopEntering`,BREAKPOINT_DESKTOP_STASHED:`#desktopStashedClosed`}},closing:{tags:[`drawerVisible`,`drawerExiting`,`exiting`],entry:[`beginDrawerExit`,`dispatchClose`],on:{ANIMATION_END:`closed`,OPEN:`opening`,EXPAND:`opening`,BREAKPOINT_DESKTOP_EXPANDED:`#desktopEntering`,BREAKPOINT_DESKTOP_STASHED:`#desktopStashedClosed`}},exiting:{id:`mobileExiting`,tags:[`sidebarExiting`,`exiting`],entry:[`beginBreakpointExit`],on:{ANIMATION_END:`closed`,OPEN:`opening`,EXPAND:`opening`,BREAKPOINT_DESKTOP_EXPANDED:`#desktopEntering`,BREAKPOINT_DESKTOP_STASHED:`#desktopStashedClosed`}}}}}},{context:{desktopStashed:t},actions:{rememberExpanded:({context:e})=>{e.desktopStashed=!1},rememberStashed:({context:e})=>{e.desktopStashed=!0},beginDrawerEnter:()=>{this.clearSidebarExitFreeze(),this.drawerMotionRun+=1,this.syncAll(),this.animateDrawerEnter()},beginDrawerExit:()=>{let e=++this.drawerMotionRun;this.syncAll(),this.animateDrawerExit(e)},beginSidebarEnter:()=>{this.clearSidebarExitFreeze();let e=++this.drawerMotionRun;this.syncAll(),this.animateSidebarEnter(e)},beginSidebarExit:()=>{let e=this.freezeSidebarForExit(),t=++this.drawerMotionRun;this.syncAll(),this.animateSidebarExit(t,e)},beginBreakpointExit:({event:e})=>{let t=this.freezeSidebarForExit(),n=++this.drawerMotionRun;this.syncAll(),this.animateSidebarExit(n,t,e.withBackdrop===!0)},dispatchOpen:()=>{q.dispatch({el:this.$el,name:`ui:sidebar-open`,detail:{id:this.id}})},dispatchClose:()=>{q.dispatch({el:this.$el,name:`ui:sidebar-close`,detail:{id:this.id}})}}}),this.drawerMotion=q.motion.createPresenceLifecycle({element:()=>this.$el,preset:`sidebar`}),this.backdropMotion=q.motion.createPresenceLifecycle({element:()=>this.backdropEl(),preset:`fade`}),sS.add(this),q.addListener({target:document,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&this.hasOpenDrawer()&&this.close()},cleanup:this.cleanup}),q.addListener({target:document,event:`pointermove`,handler:e=>this.handlePointerMove(e),cleanup:this.cleanup}),q.addListener({target:document,event:`mousemove`,handler:e=>this.handlePointerMove(e),cleanup:this.cleanup});let n=this.backdropEl();n&&(q.addListener({target:n,event:`pointerenter`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup}),q.addListener({target:n,event:`mouseenter`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup}),q.addListener({target:n,event:`pointermove`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup}),q.addListener({target:n,event:`mousemove`,handler:e=>this.closeTemporaryDrawer(null,e),cleanup:this.cleanup})),q.addListener({target:this.$el,event:`ui:resize`,handler:e=>this.handleResize(e),cleanup:this.cleanup}),q.addListener({target:this.$el,event:`ui:resize-end`,handler:e=>this.handleResize(e),cleanup:this.cleanup}),this.cleanup.push(q.addDismissableLayer({isEnabled:()=>this.hasOpenDrawer(),roots:()=>[this.$el,this.activeTrigger],onDismiss:()=>this.close()})),this.setupGroups(),this.syncAll()},destroy(){this.props.disconnect(),this.machine.stop(),this.drawerMotion?.destroy(),this.backdropMotion?.destroy(),this.clearSidebarExitFreeze(),sS.delete(this),this.cleanup.forEach(e=>e()),this.cleanup=[],this.hasScrollLock&&=(dh(),!1)},get mobileOpen(){return this.machine?.hasTag(`mobileOpen`)??!1},get desktopStashed(){return this.machine?this.machine.hasTag(`desktop`)?this.machine.hasTag(`desktopStashed`):this.machine.context.desktopStashed:!1},get desktopDrawerOpen(){return this.machine?.hasTag(`desktopDrawerOpen`)??!1},get drawerExiting(){return this.machine?.hasTag(`drawerExiting`)??!1},get sidebarExiting(){return this.machine?.hasTag(`sidebarExiting`)??!1},get drawerMotionPhase(){return this.machine?this.machine.hasTag(`entering`)?`enter`:this.machine.hasTag(`exiting`)?`exit`:null:null},get root(){return q.mergeBindings({inputs:[q.resolveStyle({part:iS.parts.root,props:this.props,className:this.props.class}),{"data-ui-sidebar":``,"@pointerleave":e=>this.closeTemporaryDrawer(null,e),"@mouseleave":e=>this.closeTemporaryDrawer(null,e)}]})},isDesktop(){return this.mediaQuery?.matches??!1},setupMediaQuery(){this.mediaQueryCleanup?.(),this.mediaQuery=window.matchMedia(uS(this.props.breakpoint)),this.mediaQueryCleanup=q.addListener({target:this.mediaQuery,event:`change`,handler:()=>this.handleBreakpointChange(),cleanup:this.cleanup})},applyProps(e=[]){if(e.includes(`breakpoint`)&&(this.setupMediaQuery(),this.desktopMode=this.isDesktop()),e.includes(`width`)&&(this.currentWidth=this.props.width,this.$el.style.setProperty(`--ui-sidebar-width`,this.currentWidth)),e.includes(`open`)){this.props.open?this.open():this.close();return}if(e.includes(`stashed`)){this.machine.context.desktopStashed=this.props.stashed,this.isDesktop()&&this.isDesktopCollapsible()&&this.machine.send(this.props.stashed?`STASH`:`EXPAND`),this.syncAll();return}this.syncAll()},isMobileCollapsible(){return this.props.collapse===`mobile`||this.props.collapse===`both`},isDesktopCollapsible(){return this.props.collapse===`desktop`||this.props.collapse===`both`},hasOpenDrawer(){return this.isDesktop()?this.desktopStashed&&this.desktopDrawerOpen:this.mobileOpen},isExpanded(){return this.isDesktop()?!this.desktopStashed||this.desktopDrawerOpen:this.mobileOpen},perform(e,t){if(e===`expand`){if(this.activeTrigger=t??this.activeTrigger,this.isDesktop()&&!this.isDesktopCollapsible()||!this.isDesktop()&&!this.isMobileCollapsible())return;this.machine.send(`EXPAND`);return}if(e===`open`){this.open(t);return}if(e===`close`||e===`stash`){this.close(t);return}this.toggle(t)},open(e){this.activeTrigger=e??this.activeTrigger,!(this.isDesktop()&&!this.isDesktopCollapsible())&&(!this.isDesktop()&&!this.isMobileCollapsible()||this.machine.send(`OPEN`))},close(e){if(this.activeTrigger=e??this.activeTrigger,this.isDesktop()&&!this.isDesktopCollapsible()||!this.isDesktop()&&!this.isMobileCollapsible())return;let t=document.activeElement,n=t instanceof HTMLElement&&this.$el.contains(t),r=n?this.focusRestoreTarget(e):null;n&&this.moveFocusBeforeHide(r),this.machine.send(`CLOSE`),n&&r&&document.contains(r)&&r.focus({preventScroll:!0})},closeTemporaryDrawer(e,t){t instanceof MouseEvent&&(this.lastPointer={clientX:t.clientX,clientY:t.clientY},this.pointerWithinRevealArea(t))||this.drawerMotionPhase===`enter`&&!t||this.isDesktop()&&this.desktopStashed&&this.desktopDrawerOpen&&this.close(e)},handlePointerMove(e){if(!(!(e instanceof MouseEvent)||!this.isDesktop())){if(this.lastPointer={clientX:e.clientX,clientY:e.clientY},!this.hasOpenDrawer()){this.props.edgeReveal&&this.isDesktopCollapsible()&&this.desktopStashed&&!this.desktopDrawerOpen&&this.pointerWithinEdge(e)&&this.open();return}if(!this.pointerWithinRevealArea(e)){if(this.drawerMotionPhase===`enter`){this.closeTemporaryDrawer(null,e);return}this.closeTemporaryDrawer()}}},pointerWithinEdge(e){return this.edgeEls().some(t=>{if(t.hidden)return!1;let n=t.getBoundingClientRect();return e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom})},pointerWithinRevealArea(e){return this.pointerWithinDrawer(e)},pointerWithinDrawer(e){let t=this.$el.getBoundingClientRect(),n=e.clientY>=t.top&&e.clientY<=t.bottom;return n&&e.clientX>=t.left&&e.clientX<=t.right?!0:this.props.side===`right`?n&&e.clientX>=t.right&&e.clientX<=window.innerWidth:n&&e.clientX>=0&&e.clientX<=t.left},toggle(e){if(this.isDesktop()&&this.isDesktopCollapsible()){if(this.desktopDrawerOpen||!this.desktopStashed){this.close(e);return}this.perform(`expand`,e);return}this.isExpanded()?this.close(e):this.open(e)},handleBreakpointChange(){let e=this.renderedExpanded,t=this.renderedDrawerOpen;if(this.desktopMode=this.isDesktop(),this.desktopMode){this.machine.send(this.machine.context.desktopStashed?`BREAKPOINT_DESKTOP_STASHED`:`BREAKPOINT_DESKTOP_EXPANDED`);return}if(this.props.open){this.machine.send(`BREAKPOINT_MOBILE_OPEN`);return}this.machine.send({type:`BREAKPOINT_MOBILE_CLOSED`,withBackdrop:e&&t})},syncAll(){this.syncRoot(),this.syncApp(),this.syncBackdrop(),this.syncEdge(),this.syncToggles(),this.persistStashed()},syncRoot(){let e=this.isExpanded(),t=this.isDesktop(),n=this.mobileOpen?`open`:`closed`,r=this.desktopStashed?`stashed`:`expanded`,i=this.hasOpenDrawer()?`open`:`closed`,a=e?`open`:`closed`,o=this.hasOpenDrawer()||this.drawerExiting,s=this.sidebarExiting;this.$el.dataset.state=a,this.$el.dataset.mobileState=n,this.$el.dataset.desktopState=r,this.$el.dataset.drawerState=i,this.$el.dataset.sidebarExiting=this.sidebarExiting?`true`:`false`,this.$el.dataset.side=this.props.side,this.$el.dataset.collapse=this.props.collapse,this.$el.hidden=t&&this.desktopStashed&&!this.desktopDrawerOpen&&!this.drawerExiting&&!s,q.setPresence({el:this.$el,attr:`data-resize-disabled`,present:this.props.resizable&&(!t||this.desktopStashed||this.desktopDrawerOpen),value:`true`}),e?(this.$el.removeAttribute(`inert`),this.$el.removeAttribute(`aria-hidden`)):(this.$el.setAttribute(`inert`,``),this.$el.setAttribute(`aria-hidden`,`true`)),o&&!this.hasScrollLock?(uh(),this.hasScrollLock=!0):!o&&this.hasScrollLock&&(dh(),this.hasScrollLock=!1),this.renderedExpanded=e,this.renderedDrawerOpen=this.hasOpenDrawer()},syncBackdrop(){let e=this.backdropEl();if(!e)return;let t=this.hasOpenDrawer();e.hidden=!(t||this.drawerExiting),e.dataset.state=t?`open`:`closed`,e.dataset.sidebarState=this.isDesktop()&&this.desktopStashed?`stashed`:`expanded`},syncApp(){let e=this.appEl();e&&(e.style.setProperty(`--ui-app-sidebar-width`,this.currentWidth),e.dataset.sidebarState=this.isDesktop()&&this.desktopStashed?`stashed`:`expanded`,e.dataset.sidebarSide=this.props.side)},handleResize(e){let t=(e instanceof CustomEvent?e.detail:void 0)?.width;Number.isFinite(t)&&(this.currentWidth=`${Math.round(t)}px`,this.$el.style.setProperty(`--ui-sidebar-width`,this.currentWidth),this.syncApp())},syncEdge(){let e=this.props.edgeReveal&&this.isDesktop()&&this.isDesktopCollapsible()&&this.desktopStashed&&!this.desktopDrawerOpen;this.edgeEls().forEach(t=>{t.hidden=!e,t.dataset.state=e?`visible`:`hidden`,t.dataset.side=this.props.side,t.setAttribute(`aria-controls`,this.id),t.setAttribute(`aria-expanded`,this.isExpanded()?`true`:`false`)})},syncToggles(){let e=this.isExpanded();Array.from(document.querySelectorAll(`[data-ui-sidebar-toggle]`)).filter(e=>!e.dataset.target||e.dataset.target===this.id).forEach(t=>{t.setAttribute(`aria-controls`,this.id),t.setAttribute(`aria-expanded`,e?`true`:`false`),t.dataset.state=e?`open`:`closed`}),this.syncStateIcons()},syncStateIcons(){let e=this.isExpanded();Array.from(document.querySelectorAll(`[data-ui-sidebar-state-icon]`)).filter(e=>!e.dataset.target||e.dataset.target===this.id).forEach(t=>{t.dataset.state=e?`open`:`closed`})},animateDrawerEnter(){let e=this.drawerMotionRun;(this.drawerMotion?.enter({before:()=>{this.$el.hidden=!1},after:()=>{e!==this.drawerMotionRun||!this.hasOpenDrawer()||(this.machine.send(`ANIMATION_END`),this.isDesktop()&&this.desktopStashed&&this.lastPointer&&!this.pointerWithinDrawer(this.lastPointer)&&this.closeTemporaryDrawer())}})?.finished??Promise.resolve()).finally(()=>{e!==this.drawerMotionRun||this.drawerMotionPhase!==`enter`||(this.machine.send(`ANIMATION_END`),this.hasOpenDrawer()&&this.isDesktop()&&this.desktopStashed&&this.lastPointer&&!this.pointerWithinDrawer(this.lastPointer)&&this.closeTemporaryDrawer())}),this.backdropMotion?.enter({before:()=>{let e=this.backdropEl();e&&(e.hidden=!1)}})},animateDrawerExit(e){this.animateSidebarExit(e,null,!0)},animateSidebarEnter(e){(this.drawerMotion?.enter({before:()=>{this.$el.hidden=!1},after:()=>{e!==this.drawerMotionRun||this.drawerMotionPhase!==`enter`||this.machine.send(`ANIMATION_END`)}})?.finished??Promise.resolve()).finally(()=>{e!==this.drawerMotionRun||this.drawerMotionPhase!==`enter`||this.machine.send(`ANIMATION_END`)})},animateSidebarExit(e,t=null,n=!1){let r=this.drawerMotion?.exit({before:()=>{this.$el.hidden=!1}}),i=n?this.backdropMotion?.exit({before:()=>{let e=this.backdropEl();e&&(e.hidden=!1)}}):null;Promise.allSettled([r?.finished??Promise.resolve(),i?.finished??Promise.resolve()]).then(()=>this.finishSidebarExit(e,t))},finishSidebarExit(e,t=null){if(e!==this.drawerMotionRun||this.hasOpenDrawer()){this.clearSidebarExitFreeze(t);return}this.clearSidebarExitFreeze(t),this.machine.send(`ANIMATION_END`),this.syncRoot(),this.syncBackdrop()},freezeSidebarForExit(){this.clearSidebarExitFreeze();let e=this.$el.getBoundingClientRect();if(e.width<=0||e.height<=0)return null;let t={position:this.$el.style.position,top:this.$el.style.top,right:this.$el.style.right,bottom:this.$el.style.bottom,left:this.$el.style.left,width:this.$el.style.width,height:this.$el.style.height,zIndex:this.$el.style.zIndex,transform:this.$el.style.transform,pointerEvents:this.$el.style.pointerEvents};this.$el.dataset.sidebarFrozen=`true`,this.$el.style.position=`fixed`,this.$el.style.top=`${e.top}px`,this.$el.style.right=`auto`,this.$el.style.bottom=`auto`,this.$el.style.left=`${e.left}px`,this.$el.style.width=`${e.width}px`,this.$el.style.height=`${e.height}px`,this.$el.style.zIndex=`var(--z-dialog, 60)`,this.$el.style.transform=`translateX(0)`,this.$el.style.pointerEvents=`none`;let n=()=>{this.$el.style.position=t.position,this.$el.style.top=t.top,this.$el.style.right=t.right,this.$el.style.bottom=t.bottom,this.$el.style.left=t.left,this.$el.style.width=t.width,this.$el.style.height=t.height,this.$el.style.zIndex=t.zIndex,this.$el.style.transform=t.transform,this.$el.style.pointerEvents=t.pointerEvents,delete this.$el.dataset.sidebarFrozen};return this.sidebarExitFreezeCleanup=n,n},clearSidebarExitFreeze(e=null){let t=e??this.sidebarExitFreezeCleanup;t&&(t(),(!e||e===this.sidebarExitFreezeCleanup)&&(this.sidebarExitFreezeCleanup=null))},setupGroups(){Array.from(this.$el.querySelectorAll(`details[data-ui-sidebar-group]`)).forEach(e=>{Array.from(e.querySelectorAll(`[data-ui-sidebar-group-actions]`)).forEach(e=>{q.addListener({target:e,event:`click`,handler:e=>e.stopPropagation(),cleanup:this.cleanup}),q.addListener({target:e,event:`keydown`,handler:e=>e.stopPropagation(),cleanup:this.cleanup})}),q.addListener({target:e,event:`toggle`,handler:()=>{let t=e.open;e.dataset.state=t?`open`:`closed`,q.dispatch({el:e,name:`ui:sidebar-group-change`,detail:{open:t}})},cleanup:this.cleanup})})},backdropEl(){return this.appEl()?.querySelector(`[data-ui-app-backdrop]`)??null},appEl(){return this.$el.closest(`[data-ui-app]`)},edgeEls(){return Array.from(document.querySelectorAll(`[data-ui-sidebar-edge]`)).filter(e=>!e.dataset.target||e.dataset.target===this.id)},focusRestoreTarget(e){return e&&document.contains(e)&&!this.$el.contains(e)?e:Array.from(document.querySelectorAll(`[data-ui-sidebar-toggle]`)).find(t=>t!==e&&!this.$el.contains(t)&&(!t.dataset.target||t.dataset.target===this.id)&&!t.hasAttribute(`disabled`)&&!t.hidden)??null},moveFocusBeforeHide(e){let t=document.activeElement;if(!(!(t instanceof HTMLElement)||!this.$el.contains(t))){if(e&&document.contains(e)){e.focus({preventScroll:!0});return}t.blur()}},storageKey(){return`trellis-ui-sidebar:${this.id}:stashed`},storedStashed(){if(!this.props.persist)return null;try{let e=window.localStorage.getItem(this.storageKey());return e===null?null:e===`true`}catch{return null}},persistStashed(){if(!(!this.props.persist||!this.isDesktopCollapsible()))try{window.localStorage.setItem(this.storageKey(),this.desktopStashed?`true`:`false`)}catch{}}}),gS=()=>({props:null,init(){this.props=B({el:this.$el,schema:aS})},destroy(){this.props.disconnect()},get root(){return q.mergeBindings({inputs:[q.resolveStyle({part:iS.parts.toggle,props:{},className:this.props.class}),{"data-ui-sidebar-toggle":``,":data-target":()=>this.props.target,":data-action":()=>this.props.action,"@click":e=>this.trigger(e)}]})},targetId(){return this.props.target||`ui-sidebar`},trigger(e){e?.preventDefault(),document.dispatchEvent(new CustomEvent(`ui:sidebar-toggle`,{bubbles:!0,detail:{id:this.targetId(),action:this.props.action,trigger:this.$el}}))}}),_S=()=>({props:null,init(){this.props=B({el:this.$el,schema:oS})},destroy(){this.props.disconnect()},get root(){return q.mergeBindings({inputs:[q.resolveStyle({part:iS.parts.edge,props:{side:this.$el.dataset.side||`left`},className:this.props.class}),{"data-ui-sidebar-edge":``,":data-target":()=>this.props.target,":data-action":()=>this.props.action,"@pointerenter":e=>this.trigger(e),"@pointermove":e=>this.trigger(e),"@focus":e=>this.trigger(e),"@click":e=>this.trigger(e)}]})},targetId(){return this.props.target||`ui-sidebar`},trigger(e){e?.preventDefault(),document.dispatchEvent(new CustomEvent(`ui:sidebar-open`,{bubbles:!0,detail:{id:this.targetId(),action:this.props.action,trigger:this.$el}}))}}),vS=e=>{e.data(`UiSidebar`,()=>hS()),e.data(`UiSidebarEdge`,()=>_S()),e.data(`UiSidebarToggle`,()=>gS())},yS=fh,bS=xh,xS=yh,SS={name:V,value:V.default(`0`),defaultValue:V,min:H.default(0),max:H.default(100),step:H.default(1),bigStep:H.default(10),minStepsBetween:H.default(0),range:U,orientation:W(xS,`horizontal`),size:W(yS,`md`),variant:W(bS,`default`),disabled:U,required:U,invalid:U,label:V,description:V,descriptionTrailing:V,error:V,errors:V,badge:V,valueText:V,lowerLabel:V.default(`Minimum`),upperLabel:V.default(`Maximum`),lowerValueText:V,upperValueText:V,showValue:U,format:W([`number`,`percent`],`number`),fieldClass:V,rootClass:V,trackClass:V,rangeClass:V,thumbClass:V,tickClass:V,class:V};H.default(0);var CS=(e,t,n)=>{if(!Number.isFinite(n)||n<=0)return e;let r=Math.round((e-t)/n)*n+t,i=Math.max(0,`${n}`.split(`.`)[1]?.length??0);return Number(r.toFixed(i))},wS=(e,t,n)=>Math.min(n,Math.max(t,e)),TS=e=>{let t=Math.min(e.min,e.max),n=Math.max(e.min,e.max),r=e.step>0?e.step:1;return{min:t,max:n,step:r,bigStep:e.bigStep>0?e.bigStep:r*10}},ES=(e,t)=>{let n=Number(e);return Number.isFinite(n)?n:t},DS=(e,t)=>{let{min:n,max:r,step:i}=TS(e),a=(e.value||e.defaultValue||``).split(`,`).map(e=>e.trim()),o=t.lowerInput??t.singleInput,s=t.upperInput,c=(e.range,o?.value||a[0]||`${n}`),l=e.range?s?.value||a[1]||`${r}`:c,u=CS(wS(ES(c,n),n,r),n,i),d=CS(wS(ES(l,r),n,r),n,i);if(!e.range)return{lower:u,upper:u};u>d&&([u,d]=[d,u]);let f=Math.max(0,e.minStepsBetween)*i;return d-u<f&&(d=wS(CS(u+f,n,i),n,r),d-u<f&&(u=wS(CS(d-f,n,i),n,r))),{lower:u,upper:d}},OS=(e,t,n)=>n<=t?0:wS((e-t)/(n-t)*100,0,100),kS=(e,t)=>{let n=t=>e.format===`percent`?`${Math.round(t)}%`:String(t);return e.range?`${n(t.lower)} - ${n(t.upper)}`:n(t.lower)},AS=(e,t,n)=>{let{min:r,max:i,step:a}=TS(n),o=e.getBoundingClientRect();return CS(wS(r+wS(n.orientation===`vertical`?1-(t.clientY-o.top)/Math.max(o.height,1):(t.clientX-o.left)/Math.max(o.width,1),0,1)*(i-r),r,i),r,a)},jS=(e,t)=>Math.abs(e-t.lower)<=Math.abs(e-t.upper)?`lower`:`upper`,MS=(e,t,n,r)=>{e&&(q.setPresence({el:e,attr:`data-focus`,present:t}),q.setPresence({el:e,attr:`data-disabled`,present:n}),q.setPresence({el:e,attr:`data-invalid`,present:r}))},NS=({input:e,props:t,value:n,min:r,max:i,label:a,valueText:o,nativeRequired:s})=>{e&&(e.min=String(r),e.max=String(i),e.step=String(t.step>0?t.step:1),q.syncNativeControl({input:e,state:{name:t.range?``:t.name,value:String(n),disabled:t.disabled,required:t.required,nativeRequired:s,invalid:t.invalid}}),e.setAttribute(`aria-valuemin`,String(r)),e.setAttribute(`aria-valuemax`,String(i)),e.setAttribute(`aria-valuenow`,String(n)),o?e.setAttribute(`aria-valuetext`,o):e.removeAttribute(`aria-valuetext`),a&&e.setAttribute(`aria-label`,a),t.orientation===`vertical`?e.setAttribute(`aria-orientation`,`vertical`):e.removeAttribute(`aria-orientation`))},PS=(e,t,n)=>{let{min:r,max:i}=TS(e),a=OS(n.lower,r,i),o=OS(n.upper,r,i),s=e.range?a:0,c=e.range?o:a;t.root.style.setProperty(`--ui-slider-lower-percent`,`${a}%`),t.root.style.setProperty(`--ui-slider-upper-percent`,`${o}%`),e.orientation===`vertical`?(t.range&&(t.range.style.bottom=`${s}%`,t.range.style.height=`${Math.max(0,c-s)}%`,t.range.style.left=``,t.range.style.width=``),t.singleThumb&&(t.singleThumb.style.bottom=`${a}%`),t.lowerThumb&&(t.lowerThumb.style.bottom=`${a}%`),t.upperThumb&&(t.upperThumb.style.bottom=`${o}%`)):(t.range&&(t.range.style.left=`${s}%`,t.range.style.width=`${Math.max(0,c-s)}%`,t.range.style.bottom=``,t.range.style.height=``),t.singleThumb&&(t.singleThumb.style.left=`${a}%`),t.lowerThumb&&(t.lowerThumb.style.left=`${a}%`),t.upperThumb&&(t.upperThumb.style.left=`${o}%`)),t.ticks.forEach(t=>{let n=OS(ES(t.dataset.value??``,r),r,i);e.orientation===`vertical`?(t.style.bottom=`${n}%`,t.style.left=``):(t.style.left=`${n}%`,t.style.bottom=``)})},FS=(e,t,n,r)=>{let{min:i,max:a,step:o}=TS(e),s=e.range?Math.max(0,e.minStepsBetween)*o:0,c=CS(wS(n.lower,i,a),i,o),l=CS(wS(n.upper,i,a),i,o);e.range?(c>l&&([c,l]=[l,c]),l-c<s&&(r?.dataset.thumb===`lower`?c=wS(CS(l-s,i,o),i,a):l=wS(CS(c+s,i,o),i,a))):l=c,NS({input:t.singleInput,props:e,value:c,min:i,max:a,label:e.label,valueText:e.valueText,nativeRequired:e.required}),NS({input:t.lowerInput,props:e,value:c,min:i,max:e.range?l:a,label:e.lowerLabel,valueText:e.lowerValueText,nativeRequired:!1}),NS({input:t.upperInput,props:e,value:l,min:e.range?c:i,max:a,label:e.upperLabel,valueText:e.upperValueText,nativeRequired:!1});let u={lower:c,upper:l};return PS(e,t,u),t.value&&(t.value.textContent=kS(e,u)),q.syncControlPresence({el:t.root,state:e}),t.track&&q.syncControlPresence({el:t.track,state:{disabled:e.disabled,invalid:e.invalid}}),t.range&&q.syncControlPresence({el:t.range,state:{disabled:e.disabled,invalid:e.invalid}}),MS(t.singleThumb,t.singleInput===document.activeElement,e.disabled,e.invalid),MS(t.lowerThumb,t.lowerInput===document.activeElement,e.disabled,e.invalid),MS(t.upperThumb,t.upperInput===document.activeElement,e.disabled,e.invalid),u},IS=()=>({props:null,listeners:[],hiddenInputsKey:``,draggingThumb:null,init(){this.props=B({el:this.$el,schema:SS,onChange:(e,t)=>this.applyProps(t.map(e=>e.key))});let e=this.elements();[e.singleInput,e.lowerInput,e.upperInput].forEach(e=>{e&&(q.addListener({target:e,event:`input`,handler:e=>this.syncFromInput(e),cleanup:this.listeners}),q.addListener({target:e,event:`change`,handler:e=>this.commitFromInput(e),cleanup:this.listeners}),q.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.listeners}),q.addListener({target:e,event:`focus`,handler:()=>this.sync(),cleanup:this.listeners}),q.addListener({target:e,event:`blur`,handler:()=>this.sync(),cleanup:this.listeners}))}),q.addListener({target:e.root,event:`pointerdown`,handler:e=>{e instanceof PointerEvent&&this.handlePointerDown(e)},cleanup:this.listeners}),q.addListener({target:e.root,event:`pointermove`,handler:e=>{e instanceof PointerEvent&&this.handlePointerMove(e)},cleanup:this.listeners}),q.addListener({target:e.root,event:`pointerup`,handler:e=>{e instanceof PointerEvent&&this.handlePointerUp(e)},cleanup:this.listeners}),q.addListener({target:e.root,event:`pointercancel`,handler:e=>{e instanceof PointerEvent&&this.handlePointerUp(e)},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},elements(){let e=this.$el,t=e.querySelector(`[data-ui-slider-root]`);if(!t)throw Error(`Slider requires a root element.`);return{root:t,track:t.querySelector(`[data-ui-slider-track]`),range:t.querySelector(`[data-ui-slider-range]`),lowerInput:t.querySelector(`[data-ui-slider-input][data-thumb="lower"]`),upperInput:t.querySelector(`[data-ui-slider-input][data-thumb="upper"]`),singleInput:t.querySelector(`[data-ui-slider-input][data-thumb="single"]`),lowerThumb:t.querySelector(`[data-ui-slider-thumb][data-thumb="lower"]`),upperThumb:t.querySelector(`[data-ui-slider-thumb][data-thumb="upper"]`),singleThumb:t.querySelector(`[data-ui-slider-thumb][data-thumb="single"]`),value:e.querySelector(`[data-ui-slider-value]`),hiddenInputs:e.querySelector(`[data-ui-slider-hidden-inputs]`),ticks:Array.from(e.querySelectorAll(`[data-ui-slider-tick]`))}},applyProps(e=[]){e.length===1&&e[0]===`defaultValue`||this.sync()},sync(){let e=this.elements(),t=FS(this.props,e,DS(this.props,e));this.props.range&&e.hiddenInputs?this.hiddenInputsKey=q.syncRepeatedHiddenInputs({container:e.hiddenInputs,currentKey:this.hiddenInputsKey,state:{name:this.props.name,values:[String(t.lower),String(t.upper)],required:this.props.required,marker:`data-ui-slider-hidden-input`}}):e.hiddenInputs&&(this.hiddenInputsKey=q.syncRepeatedHiddenInputs({container:e.hiddenInputs,currentKey:this.hiddenInputsKey,state:{name:``,values:[],marker:`data-ui-slider-hidden-input`}}))},syncFromInput(e){let t=e.target instanceof HTMLInputElement?e.target:null,n=this.elements(),r=DS(this.props,n);t?.dataset.thumb===`upper`?r.upper=ES(t.value,r.upper):r.lower=ES(t?.value??``,r.lower),FS(this.props,n,r,t),this.sync()},commitFromInput(e){this.syncFromInput(e)},handleKeydown(e){if(!(e.target instanceof HTMLInputElement)||![`PageUp`,`PageDown`].includes(e.key)&&!(e.shiftKey&&e.key.startsWith(`Arrow`)))return;e.preventDefault();let t=e.target,n=[`PageDown`,`ArrowDown`,`ArrowLeft`].includes(e.key)?-1:1,{bigStep:r}=TS(this.props);t.value=String(ES(t.value,this.props.min)+n*r),t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0}))},handlePointerDown(e){if(this.props.disabled)return;let t=this.elements(),n=AS(t.root,e,this.props),r=DS(this.props,t);this.draggingThumb=this.props.range?jS(n,r):`single`,this.draggingThumb===`upper`?r.upper=n:r.lower=n;let i=this.draggingThumb===`upper`?t.upperInput:this.props.range?t.lowerInput:t.singleInput;i?.focus(),FS(this.props,t,r,i),this.sync(),t.root.setPointerCapture?.(e.pointerId),e.preventDefault()},handlePointerMove(e){if(!this.draggingThumb||this.props.disabled)return;let t=this.elements(),n=DS(this.props,t),r=AS(t.root,e,this.props);this.draggingThumb===`upper`?n.upper=r:n.lower=r;let i=this.draggingThumb===`upper`?t.upperInput:this.props.range?t.lowerInput:t.singleInput;FS(this.props,t,n,i),i?.dispatchEvent(new Event(`input`,{bubbles:!0}))},handlePointerUp(e){if(!this.draggingThumb)return;let t=this.elements();(this.draggingThumb===`upper`?t.upperInput:this.props.range?t.lowerInput:t.singleInput)?.dispatchEvent(new Event(`change`,{bubbles:!0})),t.root.releasePointerCapture?.(e.pointerId),this.draggingThumb=null}}),LS=e=>{e.data(`UiSlider`,()=>IS())},RS=[`trailing`,`leading`],zS=fh,BS=xh,VS={value:V.default(`on`),name:V,label:V,description:V,checked:U,disabled:U,required:U,invalid:U,placement:W(RS,`trailing`),variant:W(BS,`default`),size:W(zS,`md`),inputClass:V,trackClass:V,thumbClass:V,contentClass:V,labelClass:V,descriptionClass:V,class:V};({...VS});var HS=e=>{let t=e.querySelector(`[data-ui-switch-input]`);return t?{root:e,input:t,track:e.querySelector(`[data-ui-switch-track]`),thumb:e.querySelector(`[data-ui-switch-thumb]`),disabled:e.hasAttribute(`data-disabled`)||t.disabled,required:e.hasAttribute(`data-required`)||t.required,invalid:e.hasAttribute(`data-invalid`)||t.getAttribute(`aria-invalid`)===`true`}:null},US=(e,t={})=>{let n=t.disabled??e.disabled,r=t.required??e.required,i=t.invalid??e.invalid,a=e.input.checked,o=a?`checked`:`unchecked`;q.syncNativeControl({input:e.input,state:{disabled:n,required:r,invalid:i}}),e.input.setAttribute(`role`,`switch`),e.input.setAttribute(`aria-checked`,a?`true`:`false`),q.setAttribute({el:e.root,attr:`data-state`,value:o}),q.setPresence({el:e.root,attr:`data-checked`,present:a}),q.syncControlPresence({el:e.root,state:{disabled:n,required:r,invalid:i}}),q.setAttribute({el:e.input,attr:`data-state`,value:o}),q.setPresence({el:e.input,attr:`data-checked`,present:a}),e.track&&(q.setAttribute({el:e.track,attr:`data-state`,value:o}),q.setPresence({el:e.track,attr:`data-checked`,present:a}),q.syncControlPresence({el:e.track,state:{disabled:n,invalid:i}})),e.thumb&&(q.setAttribute({el:e.thumb,attr:`data-state`,value:o}),q.setPresence({el:e.thumb,attr:`data-checked`,present:a}),q.setPresence({el:e.thumb,attr:`data-disabled`,present:n}),q.setPresence({el:e.thumb,attr:`data-invalid`,present:i}))},WS=()=>({props:null,listeners:[],init(){this.props=B({el:this.$el,schema:VS,onChange:()=>this.sync()});let e=this.input();q.addListener({target:e,event:`change`,handler:()=>this.sync(),cleanup:this.listeners}),q.addListener({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.toggleFromEnter(e)},cleanup:this.listeners}),this.sync()},destroy(){this.props.disconnect(),this.listeners.forEach(e=>e()),this.listeners=[]},input(){let e=this.$el.querySelector(`[data-ui-switch-input]`);if(!e)throw Error(`Switch requires a native checkbox input.`);return e},item(){let e=HS(this.$el);if(!e)throw Error(`Switch requires a native checkbox input.`);return e},sync(){let e=this.item();this.props.name&&(e.input.name=this.props.name),this.props.value&&(e.input.value=this.props.value),US(e,{disabled:this.props.disabled||e.disabled,required:this.props.required||e.required,invalid:this.props.invalid||e.invalid})},toggleFromEnter(e){if(e.key!==`Enter`)return;let t=this.input();t.disabled||(e.preventDefault(),t.checked=!t.checked,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0})))}}),GS=e=>{e.data(`UiSwitch`,()=>WS())},KS=[`manual`,`automatic`],qS=yh;[...qS];var JS={id:V.default(`ui-tabs`),defaultValue:V,value:V,activation:W(KS,`manual`),orientation:W(qS,`horizontal`),loop:U.default(!0),panels:V,class:V},YS=G({definition:{component:`ui.tabs`,parts:{root:{base:`grid min-w-0 gap-3`,variants:{orientation:{horizontal:``,vertical:`md:grid-cols-[max-content_minmax(0,1fr)] md:items-start`}},defaults:{orientation:`horizontal`}},list:{base:`flex min-w-0 items-center`,variants:{variant:{subtle:`gap-1`,line:`gap-4 border-b border-border`,segmented:`gap-0.5 rounded-3 bg-base-a2 p-0.5 shadow-inset`,pills:`gap-1`},orientation:{horizontal:`flex-row`,vertical:`flex-col items-stretch`},size:{sm:``,md:``},scrollable:{true:`overflow-x-auto`,false:``}},compounds:[{when:{variant:`line`,orientation:`vertical`},class:`gap-1 border-b-0 border-l border-border`},{when:{variant:`segmented`,orientation:`vertical`},class:`w-full`}],defaults:{variant:`line`,orientation:`horizontal`,size:`md`,scrollable:!1}},tab:{base:[`group/tabs-tab relative inline-flex min-w-0 shrink-0 select-none items-center gap-2 whitespace-nowrap`,`text-sm font-normal text-foreground outline-none`,`focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`ui-selected:text-foreground`],variants:{variant:{subtle:`rounded-2 px-2 hover:bg-base-a2 ui-selected:font-medium`,line:[`-mb-px rounded-none border-x-0 border-b-2 border-t-0 border-transparent px-0`,`ui-selected:border-foreground ui-selected:font-medium`],segmented:[`rounded-2 px-3 hover:bg-base-a2`,`ui-selected:bg-surface-panel ui-selected:font-medium ui-selected:shadow-border`],pills:[`rounded-full bg-surface-panel px-3 shadow-border hover:bg-base-a2`,`ui-selected:bg-base-a3 ui-selected:font-medium ui-selected:shadow-border-hover`]},size:{sm:`h-control-sm text-xs`,md:`h-control-md text-sm`},orientation:{horizontal:`justify-center`,vertical:`w-full justify-start`},selectedIcon:{true:``,false:``}},compounds:[{when:{variant:`line`,orientation:`vertical`},class:`-ml-px mb-0 border-b-0 border-l-2 px-2`},{when:{variant:`subtle`,selectedIcon:!0},class:`ps-2`}],defaults:{variant:`line`,size:`md`,orientation:`horizontal`,selectedIcon:!1}},tabLabel:{base:`min-w-0`},tabIcon:{base:`size-icon shrink-0 fill-current text-icon`},tabSelectedIcon:{base:`size-icon shrink-0 fill-current text-icon`},panels:{base:`min-w-0`},panel:{base:`min-w-0 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`},panelInner:{base:`min-w-0`}}}}),XS=`ui-tabs`,ZS=e=>e?`active`:`inactive`,QS=e=>e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement,$S=e=>Array.from(new Set(e)),eC=e=>e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``)||`tab`,tC=(e,t)=>`${e}-tab-${eC(t)}`,nC=(e,t)=>`${e}-panel-${eC(t)}`,rC=e=>q.asBool({value:e}),iC=()=>({props:null,activeValue:``,collection:null,cleanup:[],init(){this.props=B({el:this.$el,schema:JS,onChange:(e,t)=>this.applyProps(t.map(e=>e.key))}),this.activeValue=this.initialValue(),this.setupEvents(),this.syncAll()},destroy(){this.props.disconnect(),this.teardown()},get root(){return q.mergeBindings({inputs:[q.resolveStyle({part:YS.parts.root,props:this.props,className:this.props.class}),{"data-ui-tabs":``,":data-orientation":()=>this.props.orientation,":data-activation":()=>this.props.activation}]})},owner(){return this.$el.id||this.props.id||this.$el.dataset.owner||XS},ownsElement(e){return e.closest(`[data-ui-tabs]`)===this.$el},lists(){return Array.from(this.$el.querySelectorAll(`[data-ui-tabs-list]`)).filter(e=>this.ownsElement(e))},primaryList(){return this.lists()[0]??null},listVariant(){let e=this.primaryList()?.dataset.variant;return e===`subtle`||e===`segmented`||e===`pills`?e:`line`},listSize(){return this.primaryList()?.dataset.size===`sm`?`sm`:`md`},listOrientation(e){let t=(e??this.primaryList())?.dataset.orientation;return t===`vertical`||t===`horizontal`?t:this.props.orientation},tabs(){return Array.from(this.$el.querySelectorAll(`[data-ui-tabs-tab]`)).filter(e=>this.ownsElement(e)).map((e,t)=>QS(e)?(e.dataset.value||(e.dataset.value=`tab-${t+1}`),{tab:e,value:e.dataset.value,isDisabled:rC(e.dataset.disabled)||e.hasAttribute(`disabled`),panel:this.panelForValue(e.dataset.value)}):null).filter(e=>e!==null)},panels(){let e=this.owner(),t=`[data-ui-tabs-panel][data-ui-tabs-owner="${e}"]`,n=t=>{let n=t.closest(`[data-ui-tabs]`);return(!n||n===this.$el)&&(t.dataset.uiTabsOwner===e||t.dataset.owner===e)},r=Array.from(this.$el.querySelectorAll(`[data-ui-tabs-panel]`)).filter(e=>this.ownsElement(e));if(this.props.panels){let e=document.querySelector(this.props.panels);e&&r.push(...Array.from(e.querySelectorAll(`[data-ui-tabs-panel]`)).filter(n))}return r.push(...Array.from(document.querySelectorAll(t)).filter(n)),$S(r)},panelForValue(e){return this.panels().find(t=>t.dataset.value===e)??null},initialValue(){if(this.props.value)return this.props.value;if(this.props.defaultValue)return this.props.defaultValue;let e=this.tabs().find(e=>rC(e.tab.dataset.selected)||e.tab.getAttribute(`aria-selected`)===`true`);return e?e.value:this.panels().find(e=>rC(e.dataset.selected))?.dataset.value||this.fallbackValue()},fallbackValue(){return this.tabs().find(e=>!e.isDisabled)?.value??``},applyProps(e=[]){e.includes(`value`)&&(this.activeValue=this.props.value||this.fallbackValue()),this.syncAll()},setActiveValue(e,t){if(!e||this.activeValue===e){this.syncAll();return}this.activeValue=e,this.syncAll(),this.dispatchChange(),t&&this.dispatchActivate(t,this.panelForValue(e))},syncAll(){this.activeValue||=this.fallbackValue(),this.syncRoot(),this.lists().forEach(e=>this.syncList(e)),this.tabs().forEach(e=>this.syncTab(e)),this.panels().forEach(e=>this.syncPanel(e))},syncRoot(){!this.$el.id&&this.props.id&&(this.$el.id=this.props.id),this.$el.dataset.orientation=this.props.orientation,this.$el.dataset.activation=this.props.activation,this.$el.dataset.value=this.activeValue},syncList(e){let t=this.listOrientation(e);e.setAttribute(`role`,`tablist`),e.dataset.orientation=t,e.className=q.resolveStyle({part:YS.parts.list,props:{variant:e.dataset.variant||`line`,size:e.dataset.size||`md`,orientation:t,scrollable:rC(e.dataset.scrollable)},className:e.dataset.class??``}),t===`vertical`?e.setAttribute(`aria-orientation`,`vertical`):e.removeAttribute(`aria-orientation`)},syncTab(e){let t=e.value===this.activeValue,n=e.tab.getAttribute(`data-active`)===`true`||document.activeElement===e.tab,r=ZS(t),i=e.tab.dataset.uiTabsOwner||e.tab.dataset.owner||this.owner(),a=e.panel?.id||nC(i,e.value),o=this.listOrientation(e.tab.closest(`[data-ui-tabs-list]`)),s=e.tab.closest(`[data-ui-tabs-list]`)?.dataset.variant||this.listVariant(),c=e.tab.closest(`[data-ui-tabs-list]`)?.dataset.size||this.listSize(),l=e.tab.querySelector(`[data-ui-tabs-tab-selected-icon]`);if(e.tab.id||=tC(i,e.value),e.tab.dataset.state=r,e.tab.dataset.orientation=o,e.tab.dataset.variant=s,e.tab.dataset.size=c,e.tab.setAttribute(`role`,`tab`),e.tab.setAttribute(`aria-selected`,t?`true`:`false`),e.tab.setAttribute(`aria-controls`,a),e.tab.tabIndex=t||n?0:-1,e.tab.className=q.resolveStyle({part:YS.parts.tab,props:{variant:s,size:c,orientation:o,selectedIcon:!!l},className:e.tab.dataset.class??``}),q.setPresence({el:e.tab,attr:`data-selected`,present:t}),l&&(l.style.visibility=t?`visible`:`hidden`),e.isDisabled){e.tab.setAttribute(`data-disabled`,``),e.tab.setAttribute(`aria-disabled`,`true`),e.tab.tabIndex=-1,e.tab instanceof HTMLButtonElement&&(e.tab.disabled=!0);return}e.tab.removeAttribute(`data-disabled`),e.tab.removeAttribute(`aria-disabled`),e.tab instanceof HTMLButtonElement&&(e.tab.disabled=!1)},syncPanel(e){let t=e.dataset.value||``,n=t===this.activeValue,r=e.dataset.uiTabsOwner||e.dataset.owner||this.owner(),i=tC(r,t),a=nC(r,t);t&&!e.id&&(e.id=a),!e.getAttribute(`data-ui-key`)&&t&&e.setAttribute(`data-ui-key`,e.id||a),e.dataset.state=ZS(n),e.dataset.orientation=this.props.orientation,e.setAttribute(`role`,`tabpanel`),e.setAttribute(`aria-labelledby`,i),e.hasAttribute(`tabindex`)||(e.tabIndex=0),e.hidden=!n,e.className=q.resolveStyle({part:YS.parts.panel,props:this.props,className:e.dataset.class??``}),q.setPresence({el:e,attr:`data-selected`,present:n})},setupEvents(){q.addListener({target:this.$el,event:`click`,handler:e=>this.handleClick(e),cleanup:this.cleanup}),q.addListener({target:this.$el,event:`focusin`,handler:e=>this.handleFocus(e),cleanup:this.cleanup}),q.addListener({target:this.$el,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&this.handleKeydown(e)},cleanup:this.cleanup})},teardown(){this.cleanup.forEach(e=>e()),this.cleanup=[]},tabFromEvent(e){let t=(e.target instanceof Element?e.target:null)?.closest(`[data-ui-tabs-tab]`)??null;return!QS(t)||!this.ownsElement(t)?null:t},itemFromTab(e){return this.tabs().find(t=>t.tab===e)??null},collectionNav(){return this.collection||=q.createCollectionNavigation({root:()=>this.$el,itemSelector:`[data-ui-tabs-tab]`,isDisabled:e=>!this.ownsElement(e)||rC(e.dataset.disabled)||e.hasAttribute(`disabled`),loop:()=>this.props.loop}),this.collection},handleClick(e){let t=this.tabFromEvent(e);if(!t)return;let n=this.itemFromTab(t);if(n){if(n.isDisabled){e.preventDefault();return}this.setActiveValue(n.value,t)}},handleFocus(e){let t=this.tabFromEvent(e);if(t)if(this.collectionNav().activateItem({el:t}),this.props.activation===`automatic`){let e=this.itemFromTab(t);e&&!e.isDisabled&&this.setActiveValue(e.value,t)}else this.syncAll()},handleKeydown(e){let t=this.tabFromEvent(e);if(!t)return;if(e.key===`Enter`||e.key===` `){e.preventDefault();let n=this.itemFromTab(t);n&&!n.isDisabled&&this.setActiveValue(n.value,t);return}let n=this.listOrientation(t.closest(`[data-ui-tabs-list]`));if(e.key===`Home`){e.preventDefault(),this.focusFirst();return}if(e.key===`End`){e.preventDefault(),this.focusLast();return}if(n===`vertical`){if(e.key===`ArrowDown`){e.preventDefault(),this.focusNext();return}e.key===`ArrowUp`&&(e.preventDefault(),this.focusPrevious());return}if(e.key===`ArrowRight`){e.preventDefault(),q.isRtl({el:this.$el})?this.focusPrevious():this.focusNext();return}e.key===`ArrowLeft`&&(e.preventDefault(),q.isRtl({el:this.$el})?this.focusNext():this.focusPrevious())},focusNext(){this.collectionNav().focusNext(),this.activateFocused()},focusPrevious(){this.collectionNav().focusPrevious(),this.activateFocused()},focusFirst(){this.collectionNav().focusFirst(),this.activateFocused()},focusLast(){this.collectionNav().focusLast(),this.activateFocused()},activateFocused(){if(this.props.activation!==`automatic`)return;let e=document.activeElement;if(!QS(e))return;let t=this.itemFromTab(e);t&&!t.isDisabled&&this.setActiveValue(t.value,e)},dispatchChange(){q.dispatch({el:this.$el,name:`ui:change`,detail:{value:this.activeValue}})},dispatchActivate(e,t){q.dispatch({el:e,name:`ui:tabs:activate`,detail:{value:this.activeValue,panelId:t?.id??``}})}}),aC=e=>{e.data(`UiTabs`,()=>iC())},oC={name:V,value:V.emptyAsValue,placeholder:V,size:W(Cb,`lg`),variant:W(wb,`outline`),radius:W(Tb,`md`),rows:H.default(4).min(1),resize:W([`vertical`,`horizontal`,`both`,`none`],`vertical`),disabled:U,readonly:U,required:U,invalid:U,rootClass:V,controlClass:V,class:V},sC=G({definition:{component:`ui.textarea`,parts:{root:{base:`inline-grid w-full min-w-0`},control:{base:jh,variants:{size:Ph,variant:Fh},defaults:{size:`lg`,variant:`outline`,radius:`md`},compounds:kh},textarea:{base:[`min-h-0 w-full min-w-0`,Ih],variants:{resize:{vertical:`resize-y`,horizontal:`resize-x`,both:`resize`,none:`resize-none`}},defaults:{resize:`vertical`}}}}}),cC=()=>({props:null,init(){this.props=B({el:this.$el,schema:oC,onChange:()=>this.sync()}),this.sync()},destroy(){this.props.disconnect()},control(){let e=this.$el.querySelector(`[data-ui-textarea-control]`);if(!e)throw Error(`Textarea requires a control element.`);return e},textarea(){let e=this.$el.querySelector(`[data-ui-textarea]`);if(!e)throw Error(`Textarea requires a native textarea element.`);return e},sync(){let e=this.$el,t=this.control(),n=this.textarea();e.dataset.size=this.props.size,e.dataset.variant=this.props.variant,e.dataset.radius=this.props.radius,e.dataset.rows=String(this.props.rows),e.dataset.resize=this.props.resize,q.syncControlPresence({el:e,state:{disabled:this.props.disabled,required:this.props.required,invalid:this.props.invalid},value:`true`}),t.dataset.variant=this.props.variant,t.dataset.radius=this.props.radius,t.setAttribute(`class`,K({part:sC.parts.control,props:this.props,className:this.props.controlClass})),q.syncControlPresence({el:t,state:{disabled:this.props.disabled,invalid:this.props.invalid},value:`true`}),n.dataset.size=this.props.size,n.dataset.resize=this.props.resize,n.rows=this.props.rows,n.setAttribute(`class`,K({part:sC.parts.textarea,props:this.props,className:this.props.class})),q.syncNativeControl({input:n,state:{name:this.props.name,disabled:this.props.disabled,readonly:this.props.readonly,required:this.props.required,invalid:this.props.invalid}}),this.props.placeholder?n.placeholder=this.props.placeholder:n.removeAttribute(`placeholder`)}}),lC=e=>{e.data(`UiTextarea`,()=>cC())},uC=[`info`,`success`,`warning`,`danger`,`debug`],dC=[`auto`,`neutral`,`accent`,`success`,`warning`,`danger`],fC=[`default`,`soft`,`surface`,`solid`,`outline`],pC=[`top-right`,`top-left`,`top-center`,`bottom-right`,`bottom-left`,`bottom-center`],mC={level:W(uC,`info`),color:W(dC,`auto`),variant:W(fC,`default`),title:V,description:V,duration:H.default(5e3).min(0),dismissible:U.default(!0),class:V,contentClass:V,closeClass:V},hC={id:V.default(`ui-toast-root`),position:W(pC,`top-right`),duration:H.default(5e3).min(0),includeMessages:U.default(!0),class:V},$=G({definition:{component:`ui.toast`,parts:{root:{base:[`group/toast pointer-events-auto relative grid w-full min-w-0 items-center gap-x-3 gap-y-1 overflow-hidden rounded-4 border px-3 py-2.5 text-foreground outline-none`,`data-[state=closed]:pointer-events-none data-[state=closed]:opacity-0`],variants:{variant:{default:`border-transparent bg-toast shadow-popover`,soft:`border-transparent bg-base-a2 shadow-popover`,surface:`border-border bg-toast text-foreground shadow-popover`,solid:`border-transparent bg-base-12 text-base-1 shadow-popover`,outline:`border-border bg-transparent shadow-none`},color:{neutral:``,accent:``,success:``,warning:``,danger:``},hasMarker:{true:`grid-cols-[auto_minmax(0,1fr)_auto]`,false:`grid-cols-[minmax(0,1fr)_auto]`},hasDescription:{true:``,false:``}},compounds:[{when:{variant:`soft`,color:`accent`},class:`bg-accent-surface text-accent-text shadow-popover`},{when:{variant:`soft`,color:`success`},class:`bg-success-surface text-success-text shadow-popover`},{when:{variant:`soft`,color:`warning`},class:`bg-warning-surface text-warning-text shadow-popover`},{when:{variant:`soft`,color:`danger`},class:`bg-danger-surface text-danger-text shadow-popover`},{when:{variant:`surface`,color:`accent`},class:`border-accent-border bg-toast text-foreground shadow-popover`},{when:{variant:`surface`,color:`success`},class:`border-success-border bg-toast text-foreground shadow-popover`},{when:{variant:`surface`,color:`warning`},class:`border-warning-border bg-toast text-foreground shadow-popover`},{when:{variant:`surface`,color:`danger`},class:`border-danger-border bg-toast text-foreground shadow-popover`},{when:{variant:`outline`,color:`accent`},class:`border-accent-border text-accent-text shadow-none`},{when:{variant:`outline`,color:`success`},class:`border-success-border text-success-text shadow-none`},{when:{variant:`outline`,color:`warning`},class:`border-warning-border text-warning-text shadow-none`},{when:{variant:`outline`,color:`danger`},class:`border-danger-border text-danger-text shadow-none`},{when:{variant:`solid`,color:`accent`},class:`border-transparent bg-accent-solid text-accent-contrast shadow-popover`},{when:{variant:`solid`,color:`success`},class:`border-transparent bg-success-solid text-success-contrast shadow-popover`},{when:{variant:`solid`,color:`warning`},class:`border-transparent bg-warning-solid text-warning-contrast shadow-popover`},{when:{variant:`solid`,color:`danger`},class:`border-transparent bg-danger-solid text-danger-contrast shadow-popover`}],defaults:{variant:`default`,color:`neutral`,hasMarker:!1,hasDescription:!1}},marker:{base:`size-2 self-center rounded-full`,variants:{color:{neutral:`hidden`,accent:`bg-accent-solid`,success:`bg-success-solid`,warning:`bg-warning-solid`,danger:`bg-danger-solid`},variant:{default:`hidden`,soft:``,surface:``,solid:`hidden`,outline:``}},defaults:{color:`neutral`,variant:`default`}},content:{base:`grid min-w-0 gap-0.5 self-center`},title:{base:`min-w-0`,variants:{variant:{default:``,soft:`text-current`,surface:``,solid:`text-current`,outline:`text-current`}},defaults:{variant:`default`}},description:{base:`min-w-0`,variants:{variant:{default:``,soft:`text-current opacity-80`,surface:``,solid:`text-current opacity-80`,outline:`text-current opacity-80`}},defaults:{variant:`default`}},close:{base:[`-mr-1 inline-flex size-control-md shrink-0 items-center justify-center self-center rounded-2 text-icon outline-none`,`hover:bg-base-a2 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app`],variants:{variant:{default:``,soft:`text-current hover:bg-current/10 focus-visible:ring-current focus-visible:ring-offset-transparent`,surface:``,solid:`text-current hover:bg-current/10 focus-visible:ring-current focus-visible:ring-offset-transparent`,outline:`text-current hover:bg-current/10 focus-visible:ring-current focus-visible:ring-offset-transparent`}},defaults:{variant:`default`}},closeIcon:{base:`size-icon fill-current`},outlet:{base:[`pointer-events-none fixed z-toast flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-2`],variants:{position:{"top-right":`right-4 top-4 justify-items-end`,"top-left":`left-4 top-4 justify-items-start`,"top-center":`left-1/2 top-4 -translate-x-1/2 justify-items-center`,"bottom-right":`bottom-4 right-4 justify-items-end`,"bottom-left":`bottom-4 left-4 justify-items-start`,"bottom-center":`bottom-4 left-1/2 -translate-x-1/2 justify-items-center`}},defaults:{position:`top-right`}}}}}),gC=e=>e===`info`||e===`success`||e===`warning`||e===`danger`||e===`debug`,_C=e=>e===`auto`||e===`neutral`||e===`accent`||e===`success`||e===`warning`||e===`danger`,vC=e=>e==="default"||e===`soft`||e===`surface`||e===`solid`||e===`outline`,yC=e=>e===`info`?`accent`:e===`success`||e===`warning`||e===`danger`?e:`neutral`,bC=(e,t)=>_C(e)&&e!==`auto`?e:yC(t),xC=(e,t)=>{let n=typeof e==`number`?e:Number(e);return Number.isFinite(n)&&n>=0?n:t},SC=e=>Math.min(e,3),CC=new WeakMap,wC=e=>{let t=Array.from(e.querySelectorAll(`:scope > [data-ui-toast]`));e.dataset.stack=t.length>1?`collapsed`:`single`;let n=window.getComputedStyle(e),r=Number.parseFloat(n.rowGap||n.gap||`0`)||0,i=t.map(e=>Math.ceil(e.scrollHeight||e.getBoundingClientRect().height)),a=i[0]??0,o=Number.parseFloat(n.getPropertyValue(`--ui-toast-stack-peek`))||8,s=e.dataset.position?.startsWith(`bottom`)?-1:1,c=SC(Math.max(0,t.length-1)),l=i.reduce((e,t)=>e+t,0)+Math.max(0,t.length-1)*r,u=a+c*o;e.style.setProperty(`--ui-toast-front-height`,`${a}px`),e.style.setProperty(`--ui-toast-stack-height`,`${u}px`),e.style.setProperty(`--ui-toast-stack-expanded-height`,`${l}px`),t.forEach((e,n)=>{let r=SC(n),i=Math.max(.91,1-r*.03),a=Math.max(.72,1-r*.08);e.dataset.state!==`closed`&&(e.style.removeProperty(`opacity`),e.style.removeProperty(`transform`)),e.dataset.stackIndex=String(n),e.style.setProperty(`--ui-toast-stack-index`,String(n)),e.style.setProperty(`--ui-toast-stack-depth`,String(r)),e.style.setProperty(`--ui-toast-stack-direction`,String(s)),e.style.setProperty(`--ui-toast-stack-offset`,`${r*o*s}px`),e.style.setProperty(`--ui-toast-stack-scale`,String(i)),e.style.setProperty(`--ui-toast-stack-opacity`,String(a)),e.style.zIndex=String(t.length-n)})},TC=e=>{let t=e.parentElement instanceof HTMLElement?e.parentElement:null;e.dataset.state=`closed`,e.remove(),t?.matches(`[data-ui-toast-outlet]`)&&wC(t)},EC=e=>{CC.get(e)?.cancel();let t=q.motion.animatePresence(e,`enter`,`toast`);CC.set(e,t),t.finished.finally(()=>{if(CC.get(e)!==t)return;CC.delete(e),e.style.removeProperty(`opacity`),e.style.removeProperty(`transform`);let n=e.parentElement instanceof HTMLElement&&e.parentElement.matches(`[data-ui-toast-outlet]`)?e.parentElement:null;n&&wC(n)})},DC=e=>{if(!e.isConnected)return;e.dataset.state=`closed`,CC.get(e)?.cancel();let t=q.motion.animatePresence(e,`exit`,`toast`);CC.set(e,t),t.finished.finally(()=>{CC.get(e)===t&&(CC.delete(e),TC(e))})},OC=e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);t.setAttribute(`viewBox`,`0 0 32 32`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`data-ui-toast-close-icon`,``),t.setAttribute(`class`,e);let n=document.createElementNS(`http://www.w3.org/2000/svg`,`polygon`);return n.setAttribute(`points`,`17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16`),t.append(n),t},kC=()=>({props:null,cleanup:[],timer:null,init(){this.props=B({el:this.$el,schema:mC,onChange:(e,t)=>this.applyProps(t.map(e=>e.key))});let e=this.$el,t=e.parentElement instanceof HTMLElement&&e.parentElement.matches(`[data-ui-toast-outlet]`)?e.parentElement:null;e.dataset.state=`open`,e.setAttribute(`data-ui-motion-owner`,`component`),t&&wC(t),EC(e),q.addListener({target:e,event:`click`,handler:e=>{let t=e.target;this.props.dismissible&&t instanceof Element&&t.closest(`[data-ui-toast-close]`)&&this.dismiss()},cleanup:this.cleanup}),this.sync(),this.resetTimer()},destroy(){this.props.disconnect(),this.cleanup.forEach(e=>e()),this.cleanup=[],this.timer!==null&&window.clearTimeout(this.timer),CC.get(this.$el)?.cancel()},applyProps(e=[]){this.sync(),e.includes(`duration`)&&this.resetTimer()},sync(){let e=this.$el,t=bC(this.props.color,this.props.level),n=e.dataset.description===`true`||!!this.props.description.trim(),r=t!==`neutral`&&this.props.variant!==`solid`&&this.props.variant!=="default",i=this.props.level===`danger`||this.props.level===`warning`;e.dataset.level=this.props.level,e.dataset.color=t,e.dataset.variant=this.props.variant,e.dataset.duration=String(this.props.duration),e.dataset.dismissible=String(this.props.dismissible),e.setAttribute(`role`,i?`alert`:`status`),e.setAttribute(`aria-live`,i?`assertive`:`polite`),e.className=q.resolveStyle({part:$.parts.root,props:{variant:this.props.variant,color:t,hasDescription:n,hasMarker:r},className:this.props.class}),e.querySelector(`[data-ui-toast-marker]`)?.setAttribute(`class`,q.resolveStyle({part:$.parts.marker,props:{variant:this.props.variant,color:t}})),e.querySelectorAll(`[data-ui-toast-content]`).forEach(e=>{e.className=q.resolveStyle({part:$.parts.content,className:this.props.contentClass})}),e.querySelectorAll(`[data-ui-toast-title]`).forEach(e=>{e.className=`text-sm font-medium text-foreground ${q.resolveStyle({part:$.parts.title,props:{variant:this.props.variant}})}`}),e.querySelectorAll(`[data-ui-toast-description]`).forEach(e=>{e.className=`text-sm text-foreground-muted ${q.resolveStyle({part:$.parts.description,props:{variant:this.props.variant}})}`}),e.querySelectorAll(`[data-ui-toast-close]`).forEach(e=>{e.hidden=!this.props.dismissible,e.className=q.resolveStyle({part:$.parts.close,props:{variant:this.props.variant},className:this.props.closeClass})});let a=e.parentElement instanceof HTMLElement&&e.parentElement.matches(`[data-ui-toast-outlet]`)?e.parentElement:null;a&&wC(a)},resetTimer(){this.timer!==null&&window.clearTimeout(this.timer),this.timer=this.props.duration>0?window.setTimeout(()=>this.dismiss(),this.props.duration):null},dismiss(){let e=this.$el;this.timer!==null&&window.clearTimeout(this.timer),q.dispatch({el:e,name:`ui:dismiss`}),DC(e)}}),AC=(e,t)=>{let n=gC(e.level)?e.level:`info`,r=bC(e.color,n),i=vC(e.variant)?e.variant:`default`,a=typeof e.title==`string`?e.title:``,o=typeof e.description==`string`?e.description:``,s=o.trim().length>0,c=r!==`neutral`&&i!==`solid`&&i!=="default",l=xC(e.duration,t),u=typeof e.dismissible==`boolean`?e.dismissible:!0,d=n===`danger`||n===`warning`,f=document.createElement(`div`);f.dataset.uiToast=``,f.dataset.level=n,f.dataset.color=r,f.dataset.variant=i,f.dataset.duration=String(l),f.dataset.dismissible=String(u),f.dataset.description=String(s),f.dataset.state=`open`,f.setAttribute(`role`,d?`alert`:`status`),f.setAttribute(`aria-live`,d?`assertive`:`polite`),f.setAttribute(`aria-atomic`,`true`),f.className=q.resolveStyle({part:$.parts.root,props:{variant:i,color:r,hasDescription:s,hasMarker:c}});let p=document.createElement(`span`);p.dataset.uiToastMarker=``,p.setAttribute(`aria-hidden`,`true`),p.className=q.resolveStyle({part:$.parts.marker,props:{variant:i,color:r}}),f.append(p);let m=document.createElement(`div`);if(m.dataset.uiToastContent=``,m.className=q.resolveStyle({part:$.parts.content}),a){let e=document.createElement(`strong`);e.dataset.uiToastTitle=``,e.className=`text-sm font-medium text-foreground ${q.resolveStyle({part:$.parts.title,props:{variant:i}})}`,e.textContent=a,m.append(e)}if(s){let e=document.createElement(`div`);e.dataset.uiToastDescription=``,e.className=`text-sm text-foreground-muted ${q.resolveStyle({part:$.parts.description,props:{variant:i}})}`,e.textContent=o,m.append(e)}if(f.append(m),u){let e=document.createElement(`button`);e.type=`button`,e.dataset.uiToastClose=``,e.setAttribute(`aria-label`,`Dismiss notification`),e.className=q.resolveStyle({part:$.parts.close,props:{variant:i}}),e.append(OC(q.resolveStyle({part:$.parts.closeIcon}))),e.addEventListener(`click`,()=>DC(f)),f.append(e)}return l>0&&window.setTimeout(()=>DC(f),l),f},jC=()=>({props:null,cleanup:[],init(){this.props=B({el:this.$el,schema:hC,onChange:()=>this.sync()});let e=this.$el;this.sync(),wC(e),q.addListener({target:e,event:`pointerover`,handler:()=>{e.dataset.stackExpanded=`true`},cleanup:this.cleanup}),q.addListener({target:e,event:`pointerout`,handler:t=>{let n=`relatedTarget`in t?t.relatedTarget:null;(!(n instanceof Node)||!e.contains(n))&&delete e.dataset.stackExpanded},cleanup:this.cleanup}),q.addListener({target:e,event:`focusin`,handler:()=>{e.dataset.stackExpanded=`true`},cleanup:this.cleanup}),q.addListener({target:e,event:`focusout`,handler:()=>{window.requestAnimationFrame(()=>{e.contains(document.activeElement)||delete e.dataset.stackExpanded})},cleanup:this.cleanup}),q.addListener({target:document,event:`ui:toast`,handler:e=>{let t=e instanceof CustomEvent?e.detail:{};this.add(t)},cleanup:this.cleanup})},destroy(){this.props.disconnect(),this.cleanup.forEach(e=>e()),this.cleanup=[]},sync(){let e=this.$el;e.id=this.props.id,e.dataset.position=this.props.position,e.dataset.duration=String(this.props.duration),e.className=q.resolveStyle({part:$.parts.outlet,props:{position:this.props.position},className:this.props.class}),wC(e)},add(e){let t=typeof e.title==`string`?e.title:``,n=typeof e.description==`string`?e.description:``;if(!t.trim()&&!n.trim())return;let r=this.$el,i=AC(e,this.props.duration);i.setAttribute(`data-ui-motion-owner`,`component`),r.append(i),wC(r),EC(i)}}),MC=e=>{e.data(`UiToast`,()=>kC()),e.data(`UiToastOutlet`,()=>jC())},NC={bool:U,className:Wl,create:au,createMachine:ju,createVisibilityMachine:Au,createResizable:Yf,cx:Gl,defineManifest:Qf,defineProps:B,defineStyles:G,json:Eu,mergeBindings:uu,motion:Ys,number:H,oneOf:W,propsFromSchema:$f,resolveStyle:K,string:V},PC=e=>{if(e.ajax)return;let t={},n=document.querySelector(`meta[name="csrf-token"]`);n&&(t.headers={"X-CSRFToken":n.content}),e.plugin(he),e.plugin(te.configure(t))},FC=e=>{Tu(e.reactive),PC(e),ec(e),sh(e),nu(),bg(),eg(e),Mg(e),Hg(e),Fy(e),Hy(e),qy(e),Sb(e),kb(e),ex(e),lx(e),wx(e),Yx(e),vS(e),LS(e),Xf(e),Ym(e),GS(e),aC(e),lC(e),MC(e)},IC=window;document.addEventListener(`alpine:init`,()=>{IC.Alpine?.plugin(FC)});var LC=FC;return e.bool=U,e.className=Wl,e.create=au,e.createMachine=ju,e.createResizable=Yf,e.createVisibilityMachine=Au,e.cx=Gl,e.default=LC,e.defineManifest=Qf,e.defineProps=B,e.defineStyles=G,e.json=Eu,e.mergeBindings=uu,e.motion=Ys,e.number=H,e.oneOf=W,e.propsFromSchema=$f,e.resolveStyle=K,e.string=V,e.trellisUi=FC,e.ui=NC,e})({});
|