@nation-a/ui 0.16.7 → 0.16.9

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.
Files changed (38) hide show
  1. package/dist/ark-ui-BakX7_HR.cjs +2 -0
  2. package/dist/ark-ui-BakX7_HR.cjs.map +1 -0
  3. package/dist/ark-ui-BitYUtmQ.js +6713 -0
  4. package/dist/ark-ui-BitYUtmQ.js.map +1 -0
  5. package/dist/index-B4n-XEbJ.js +26 -0
  6. package/dist/index-B4n-XEbJ.js.map +1 -0
  7. package/dist/index-BroabscA.cjs +2 -0
  8. package/dist/index-BroabscA.cjs.map +1 -0
  9. package/dist/index.cjs +7 -21879
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.js +5212 -17641
  12. package/dist/index.js.map +1 -1
  13. package/dist/react-hot-toast-BQTk3w2h.cjs +178 -0
  14. package/dist/react-hot-toast-BQTk3w2h.cjs.map +1 -0
  15. package/dist/react-hot-toast-CPO7pUT3.js +389 -0
  16. package/dist/react-hot-toast-CPO7pUT3.js.map +1 -0
  17. package/dist/react-lottie-DTf3gNPc.cjs +29 -0
  18. package/dist/react-lottie-DTf3gNPc.cjs.map +1 -0
  19. package/dist/react-lottie-DygynGMG.js +9490 -0
  20. package/dist/react-lottie-DygynGMG.js.map +1 -0
  21. package/dist/react-spring-Co4cRp9i.js +3 -0
  22. package/dist/react-spring-Co4cRp9i.js.map +1 -0
  23. package/dist/react-spring-DG-m_AyL.cjs +2 -0
  24. package/dist/react-spring-DG-m_AyL.cjs.map +1 -0
  25. package/dist/stats.html +4949 -0
  26. package/dist/styled-system/styles.css +2 -2
  27. package/dist/styled-system/tokens/index.mjs +2 -2
  28. package/dist/types/components/Checkbox/checkbox.test.d.ts +1 -0
  29. package/dist/types/components/Fab/Fab.test.d.ts +1 -0
  30. package/dist/types/components/IconButton/IconButton.test.d.ts +1 -0
  31. package/dist/types/components/Select/select.test.d.ts +1 -0
  32. package/dist/types/components/Tag/tag.test.d.ts +1 -0
  33. package/dist/types/components/Toast/index.d.ts +4 -1
  34. package/package.json +3 -2
  35. package/dist/index-BMY7nH3O.js +0 -19167
  36. package/dist/index-BMY7nH3O.js.map +0 -1
  37. package/dist/index-Bi0nQr7e.cjs +0 -19166
  38. package/dist/index-Bi0nQr7e.cjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";const y=require("react"),C=require("react/jsx-runtime"),Ft=require("react-dom");function Oi(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function U(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:i,defaultValue:s}=e,a=y.createContext(s);a.displayName=t;function d(){var f;const l=y.useContext(a);if(!l&&n){const g=new Error(i!=null?i:Oi(r,o));throw g.name="ContextError",(f=Error.captureStackTrace)==null||f.call(Error,g,d),g}return l}return[a.Provider,d,a]}function Ri(e){return e?Array.isArray(e)?e:[e]:[]}var ki=e=>e[0],Si=e=>e[e.length-1],Ni=(e,t)=>e.indexOf(t)!==-1,Ai=(e,...t)=>e.concat(t),Vi=(e,...t)=>e.filter(n=>!t.includes(n)),er=(e,t)=>Ni(e,t)?Vi(e,t):Ai(e,t),tr=e=>(e==null?void 0:e.constructor.name)==="Array",Fi=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Lt(e[n],t[n]))return!1;return!0},Lt=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof(e==null?void 0:e.isEqual)=="function"&&typeof(t==null?void 0:t.isEqual)=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(tr(e)&&tr(t))return Fi(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t!=null?t:Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Lt(e[i],t[i]))return!1}return!0},Li=e=>Array.isArray(e),Di=e=>e!=null&&typeof e=="object",Jt=e=>Di(e)&&!Li(e),ot=e=>typeof e=="string",$e=e=>typeof e=="function",$i=e=>e==null,Zt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Mi=Function.prototype.toString;Mi.call(Object);var Gi=(e,...t)=>{const n=typeof e=="function"?e(...t):e;return n!=null?n:void 0},Bi=e=>e(),Hi=()=>{},cn=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})};function kn(e){if(!_i(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=kn(o))}return n}var _i=e=>e&&typeof e=="object"&&e.constructor===Object;function ln(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function Vr(e,t){if(e==null)throw new Error(t())}var ji=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]),Qt=(...e)=>t=>e.reduce((n,r)=>r(n),t),Me=()=>{},Dt=e=>typeof e=="object"&&e!==null,x=e=>e?"":void 0,Wi=e=>e?"true":void 0,Ki=1,Ui=9,qi=11,W=e=>Dt(e)&&e.nodeType===Ki&&typeof e.nodeName=="string",Sn=e=>Dt(e)&&e.nodeType===Ui,Xi=e=>Dt(e)&&e===e.window,Fr=e=>W(e)?e.localName||"":"#document";function Yi(e){return["html","body","#document"].includes(Fr(e))}var zi=e=>Dt(e)&&e.nodeType!==void 0,He=e=>zi(e)&&e.nodeType===qi&&"host"in e,Ji=e=>W(e)&&e.localName==="input",Zi=e=>!!(e!=null&&e.matches("a[href]")),Qi=e=>W(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1,es=/(textarea|select)/;function Lr(e){if(e==null||!W(e))return!1;try{return Ji(e)&&e.selectionStart!=null||es.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch(t){return!1}}function _e(e,t){var r;if(!e||!t||!W(e)||!W(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&He(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function ee(e){var t;return Sn(e)?e:Xi(e)?e.document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function ts(e){return ee(e).documentElement}function X(e){var t,n,r;return He(e)?X(e.host):Sn(e)?(t=e.defaultView)!=null?t:window:W(e)&&(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function Dr(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}function ns(e){if(Fr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||He(e)&&e.host||ts(e);return He(t)?t.host:t}var en=new WeakMap;function Nn(e){return en.has(e)||en.set(e,X(e).getComputedStyle(e)),en.get(e)}var $t=()=>typeof document!="undefined";function rs(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}function os(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}var An=e=>$t()&&e.test(rs()),$r=e=>$t()&&e.test(os()),is=e=>$t()&&e.test(navigator.vendor),nr=()=>$t()&&!!navigator.maxTouchPoints,ss=()=>An(/^iPhone/i),as=()=>An(/^iPad/i)||Mt()&&navigator.maxTouchPoints>1,Mr=()=>ss()||as(),cs=()=>Mt()||Mr(),Mt=()=>An(/^Mac/i),Vn=()=>cs()&&is(/apple/i),ls=()=>$r(/Firefox/i),us=()=>$r(/Android/i);function ds(e){var t,n,r,o;return(o=(t=e.composedPath)==null?void 0:t.call(e))!=null?o:(r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function K(e){var n;const t=ds(e);return(n=t==null?void 0:t[0])!=null?n:e.target}var Gr=e=>_e(e.currentTarget,K(e));function fs(e){return vs(e).isComposing||e.keyCode===229}function hs(e){return e.mozInputSource===0&&e.isTrusted?!0:us()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}var gs=e=>e.button===2||Mt()&&e.ctrlKey&&e.button===0,ps=e=>"touches"in e&&e.touches.length>0,ms={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},rr={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function un(e,t={}){var s;const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=(s=ms[o])!=null?s:o,n==="rtl"&&r==="horizontal"&&o in rr&&(o=rr[o]),o}function vs(e){var t;return(t=e.nativeEvent)!=null?t:e}function ys(e,t="client"){const n=ps(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var j=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o==null||o.addEventListener(t,n,r),()=>{o==null||o.removeEventListener(t,n,r)}};function bs(e,t){var i;const{type:n="HTMLInputElement",property:r="value"}=t,o=X(e)[n].prototype;return(i=Object.getOwnPropertyDescriptor(o,r))!=null?i:{}}function Fn(e,t){var r;if(!e)return;(r=bs(e,{type:"HTMLInputElement",property:"checked"}).set)==null||r.call(e,t),t?e.setAttribute("checked",""):e.removeAttribute("checked")}function Ln(e,t){const{checked:n,bubbles:r=!0}=t;if(!e)return;const o=X(e);e instanceof o.HTMLInputElement&&(Fn(e,n),e.dispatchEvent(new o.Event("click",{bubbles:r})))}function Es(e){return Is(e)?e.form:e.closest("form")}function Is(e){return e.matches("textarea, input, select, button")}function Cs(e,t){if(!e)return;const n=Es(e),r=o=>{o.defaultPrevented||t()};return n==null||n.addEventListener("reset",r,{passive:!0}),()=>n==null?void 0:n.removeEventListener("reset",r)}function Ts(e,t){const n=e==null?void 0:e.closest("fieldset");if(!n)return;t(n.disabled);const r=X(n),o=new r.MutationObserver(()=>t(n.disabled));return o.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>o.disconnect()}function Gt(e,t){if(!e)return;const{onFieldsetDisabledChange:n,onFormReset:r}=t,o=[Cs(e,r),Ts(e,n)];return()=>o.forEach(i=>i==null?void 0:i())}var Br=e=>W(e)&&e.tagName==="IFRAME",ws=e=>!Number.isNaN(parseInt(e.getAttribute("tabindex")||"0",10)),xs=e=>parseInt(e.getAttribute("tabindex")||"0",10)<0,Dn="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",$n=(e,t=!1)=>{if(!e)return[];const n=Array.from(e.querySelectorAll(Dn));(t==!0||t=="if-empty"&&n.length===0)&&W(e)&&ve(e)&&n.unshift(e);const o=n.filter(ve);return o.forEach((i,s)=>{if(Br(i)&&i.contentDocument){const a=i.contentDocument.body;o.splice(s,1,...$n(a))}}),o};function ve(e){return!e||e.closest("[inert]")?!1:e.matches(Dn)&&Qi(e)}function Bt(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll(Dn)).filter(Te);return r.forEach((o,i)=>{if(Br(o)&&o.contentDocument){const s=o.contentDocument.body,a=Bt(s);r.splice(i,1,...a)}}),r.length,r}function Te(e){return e!=null&&e.tabIndex>0?!0:ve(e)&&!xs(e)}function Ps(e,t){const n=Bt(e,t),r=n[0]||null,o=n[n.length-1]||null;return[r,o]}function Ye(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||Lr(e))&&!ws(e)?0:e.tabIndex}function Os(e){const{root:t,getInitialEl:n,filter:r,enabled:o=!0}=e;if(!o)return;let i=null;if(i||(i=typeof n=="function"?n():n),i||(i=t==null?void 0:t.querySelector("[data-autofocus],[autofocus]")),!i){const s=Bt(t);i=r?s.filter(r)[0]:s[0]}return i||t||void 0}function Rs(e){const t=e.currentTarget;if(!t)return!1;const[n,r]=Ps(t),o=t.ownerDocument||document;return!(o.activeElement===n&&e.shiftKey||o.activeElement===r&&!e.shiftKey||!n&&!r)}function Hr(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function H(e){let t;const n=globalThis.requestAnimationFrame(()=>{t=e()});return()=>{globalThis.cancelAnimationFrame(n),t==null||t()}}function ks(e,t,n){const r=H(()=>{e.removeEventListener(t,o,!0),n()}),o=()=>{r(),n()};return e.addEventListener(t,o,{once:!0,capture:!0}),r}function Ss(e,t){if(!e)return;const{attributes:n,callback:r}=t,o=e.ownerDocument.defaultView||window,i=new o.MutationObserver(s=>{for(const a of s)a.type==="attributes"&&a.attributeName&&n.includes(a.attributeName)&&r(a)});return i.observe(e,{attributes:!0,attributeFilter:n}),()=>i.disconnect()}function Ns(e,t){const n=H,r=[];return r.push(n(()=>{const o=typeof e=="function"?e():e;r.push(Ss(o,t))})),()=>{r.forEach(o=>o==null?void 0:o())}}function As(e){const t=()=>e.click();ls()?ks(e,"keyup",t):queueMicrotask(t)}function dn(e){const t=ns(e);return Yi(t)?ee(t).body:W(t)&&_r(t)?t:dn(t)}var Vs=/auto|scroll|overlay|hidden|clip/;function _r(e){const t=X(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return Vs.test(n+o+r)&&!["inline","contents"].includes(i)}function Fs(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Ls(e,t){const{rootEl:n,...r}=t||{};!e||!n||!_r(n)||!Fs(n)||e.scrollIntoView(r)}function jr(e){const{pointerNode:t,keyboardNode:n=t,onPress:r,onPressStart:o,onPressEnd:i,isValidKey:s=I=>I.key==="Enter"}=e;if(!t)return Me;const a=X(t),d=ee(t);let l=Me,f=Me,g=Me;const u=I=>({point:ys(I),event:I});function c(I){o==null||o(u(I))}function h(I){i==null||i(u(I))}const m=j(t,"pointerdown",I=>{f();const R=j(a,"pointerup",L=>{const b=K(L);_e(t,b)?r==null||r(u(L)):i==null||i(u(L))},{passive:!r,once:!0}),k=j(a,"pointercancel",h,{passive:!i,once:!0});f=Qt(R,k),d.activeElement===n&&I.pointerType==="mouse"&&I.preventDefault(),c(I)},{passive:!o}),v=j(n,"focus",E);l=Qt(m,v);function E(){const I=L=>{if(!s(L))return;const b=A=>{if(!s(A))return;const G=new a.PointerEvent("pointerup"),$=u(G);r==null||r($),i==null||i($)};f(),f=j(n,"keyup",b);const w=new a.PointerEvent("pointerdown");c(w)},T=()=>{const L=new a.PointerEvent("pointercancel");h(L)},R=j(n,"keydown",I),k=j(n,"blur",T);g=Qt(R,k)}return()=>{l(),f(),g()}}function Wr(e,t){var n;return Array.from((n=e==null?void 0:e.querySelectorAll(t))!=null?n:[])}var Mn=e=>e.id;function Kr(e,t,n=Mn){return e.find(r=>n(r)===t)}function Gn(e,t,n=Mn){const r=Kr(e,t,n);return r?e.indexOf(r):-1}function Ds(e,t,n=!0){let r=Gn(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}function $s(e,t,n=!0){let r=Gn(e,t);return r===-1?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}function Ur(e,t){const{onEntry:n,measure:r,box:o="border-box"}=t,i=(Array.isArray(e)?e:[e]).filter(W),s=X(i[0]),a=l=>{const f=i.map(g=>r(g));n({rects:f,entries:l})};a([]);const d=new s.ResizeObserver(a);return i.forEach(l=>d.observe(l,{box:o})),()=>d.disconnect()}var Ms=e=>e.split("").map(t=>{const n=t.charCodeAt(0);return n>0&&n<128?t:n>=128&&n<=255?`/x${n.toString(16)}`.replace("/","\\"):""}).join("").trim(),Gs=e=>{var t,n,r;return Ms((r=(n=(t=e.dataset)==null?void 0:t.valuetext)!=null?n:e.textContent)!=null?r:"")},Bs=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function Hs(e,t,n,r=Mn){const o=n?Gn(e,n,r):-1;let i=n?ji(e,o):e;return t.length===1&&(i=i.filter(a=>r(a)!==n)),i.find(a=>Bs(Gs(a),t))}function Ot(e,t){if(!e)return Me;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function _s(e,t,n){if(!e)return Me;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function js(e,t){const{state:n,activeId:r,key:o,timeout:i=350,itemToId:s}=t,a=n.keysSoFar+o,l=a.length>1&&Array.from(a).every(h=>h===a[0])?a[0]:a;let f=e.slice();const g=Hs(f,l,r,s);function u(){clearTimeout(n.timer),n.timer=-1}function c(h){n.keysSoFar=h,u(),h!==""&&(n.timer=+setTimeout(()=>{c(""),u()},i))}return c(a),g}var fn=Object.assign(js,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:Ws});function Ws(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Ht={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},Ks=1e3/60;function Us(e,t){const n=e();if(W(n)&&n.isConnected)return t(n),()=>{};{const r=setInterval(()=>{const o=e();W(o)&&o.isConnected&&(t(o),clearInterval(r))},Ks);return()=>clearInterval(r)}}function qs(e,t){const n=[];return e==null||e.forEach(r=>{const o=Us(r,t);n.push(o)}),()=>{n.forEach(r=>r())}}var Xs=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),Ys=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,or=e=>{const t={};let n;for(;n=Ys.exec(e);)t[n[1]]=n[2];return t},zs=(e,t)=>{if(ot(e)){if(ot(t))return`${e};${t}`;e=or(e)}else ot(t)&&(t=or(t));return Object.assign({},e!=null?e:{},t!=null?t:{})};function S(...e){let t={};for(let n of e){for(let r in t){if(r.startsWith("on")&&typeof t[r]=="function"&&typeof n[r]=="function"){t[r]=cn(n[r],t[r]);continue}if(r==="className"||r==="class"){t[r]=Xs(t[r],n[r]);continue}if(r==="style"){t[r]=zs(t[r],n[r]);continue}t[r]=n[r]!==void 0?n[r]:t[r]}for(let r in n)t[r]===void 0&&(t[r]=n[r])}return t}function ut(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}var De=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(De||{}),tn="__init__";function Js(e){const t=()=>{var a,d;return(d=(a=e.getRootNode)==null?void 0:a.call(e))!=null?d:document},n=()=>ee(t()),r=()=>{var a;return(a=n().defaultView)!=null?a:window},o=()=>Dr(t());return{...e,getRootNode:t,getDoc:n,getWin:r,getActiveElement:o,isActiveElement:a=>a===o(),getById:a=>t().getElementById(a)}}function Zs(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var te=()=>e=>Array.from(new Set(e)),qr=typeof globalThis.document!="undefined"?y.useLayoutEffect:y.useEffect;function Rt(e){var g,u;const t=(g=e().value)!=null?g:e().defaultValue,n=(u=e().isEqual)!=null?u:Object.is,[r]=y.useState(t),[o,i]=y.useState(r),s=e().value!==void 0,a=y.useRef(o);a.current=s?e().value:o;const d=y.useRef(a.current);qr(()=>{d.current=a.current},[o,e().value]);const l=c=>{var m,v;const h=d.current,p=$e(c)?c(h):c;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:p,prev:h}),s||i(p),n(p,h)||(v=(m=e()).onChange)==null||v.call(m,p,h)};function f(){return s?e().value:o}return{initial:r,ref:a,get:f,set(c){(e().sync?Ft.flushSync:Bi)(()=>l(c))},invoke(c,h){var p,m;(m=(p=e()).onChange)==null||m.call(p,c,h)},hash(c){var h,p,m;return(m=(p=(h=e()).hash)==null?void 0:p.call(h,c))!=null?m:String(c)}}}Rt.cleanup=e=>{y.useEffect(()=>e,[])};Rt.ref=e=>{const t=y.useRef(e);return{get:()=>t.current,set:n=>{t.current=n}}};function Qs(e){const t=y.useRef(e);return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}var ea=(e,t)=>{const n=y.useRef(!1),r=y.useRef(!1);y.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e!=null?e:[]).map(o=>typeof o=="function"?o():o)]),y.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function Re(e,t={}){var G,$,z,_,fe,ne;const n=y.useMemo(()=>{const{id:O,ids:P,getRootNode:N}=t;return Js({id:O,ids:P,getRootNode:N})},[t]),r=(...O)=>{e.debug&&console.log(...O)},o=($=(G=e.props)==null?void 0:G.call(e,{props:kn(t),scope:n}))!=null?$:t,i=ta(o),s=(z=e.context)==null?void 0:z.call(e,{prop:i,bindable:Rt,scope:n,flush:ir,getContext(){return d},getComputed(){return R},getRefs(){return p}}),a=Xr(s),d={get(O){var P;return(P=a.current)==null?void 0:P[O].ref.current},set(O,P){var N;(N=a.current)==null||N[O].set(P)},initial(O){var P;return(P=a.current)==null?void 0:P[O].initial},hash(O){var N,D;const P=(N=a.current)==null?void 0:N[O].get();return(D=a.current)==null?void 0:D[O].hash(P)}},l=y.useRef(new Map),f=y.useRef(null),g=y.useRef(null),u=y.useRef({type:""}),c=()=>({...u.current,current(){return u.current},previous(){return g.current}}),h=()=>({...k,matches(...O){return O.includes(k.ref.current)},hasTag(O){var P,N;return!!((N=(P=e.states[k.ref.current])==null?void 0:P.tags)!=null&&N.includes(O))}}),p=Qs((fe=(_=e.refs)==null?void 0:_.call(e,{prop:i,context:d}))!=null?fe:{}),m=()=>({state:h(),context:d,event:c(),prop:i,send:A,action:v,guard:E,track:ea,refs:p,computed:R,flush:ir,scope:n,choose:T}),v=O=>{const P=$e(O)?O(m()):O;if(!P)return;const N=P.map(D=>{var J,ie;const B=(ie=(J=e.implementations)==null?void 0:J.actions)==null?void 0:ie[D];return B||ln(`[zag-js] No implementation found for action "${JSON.stringify(D)}"`),B});for(const D of N)D==null||D(m())},E=O=>{var P,N;return $e(O)?O(m()):(N=(P=e.implementations)==null?void 0:P.guards)==null?void 0:N[O](m())},I=O=>{const P=$e(O)?O(m()):O;if(!P)return;const N=P.map(B=>{var ie,re;const J=(re=(ie=e.implementations)==null?void 0:ie.effects)==null?void 0:re[B];return J||ln(`[zag-js] No implementation found for effect "${JSON.stringify(B)}"`),J}),D=[];for(const B of N){const J=B==null?void 0:B(m());J&&D.push(J)}return()=>D.forEach(B=>B==null?void 0:B())},T=O=>Ri(O).find(P=>{let N=!P.guard;return ot(P.guard)?N=!!E(P.guard):$e(P.guard)&&(N=P.guard(m())),N}),R=O=>{Vr(e.computed,()=>"[zag-js] No computed object found on machine");const P=e.computed[O];return P({context:d,event:c(),prop:i,refs:p,scope:n,computed:R})},k=Rt(()=>({defaultValue:e.initialState({prop:i}),onChange(O,P){var D,B,J,ie;if(P){const re=l.current.get(P);re==null||re(),l.current.delete(P)}P&&v((D=e.states[P])==null?void 0:D.exit),v((B=f.current)==null?void 0:B.actions);const N=I((J=e.states[O])==null?void 0:J.effects);if(N&&l.current.set(O,N),P===tn){v(e.entry);const re=I(e.effects);re&&l.current.set(tn,re)}v((ie=e.states[O])==null?void 0:ie.entry)}})),L=y.useRef(void 0),b=y.useRef(De.NotStarted);qr(()=>{queueMicrotask(()=>{var B;const N=b.current===De.Started;b.current=De.Started,r(N?"rehydrating...":"initializing...");const D=(B=L.current)!=null?B:k.initial;k.invoke(D,N?k.get():tn)});const O=l.current,P=k.ref.current;return()=>{r("unmounting..."),L.current=P,b.current=De.Stopped,O.forEach(N=>N==null?void 0:N()),l.current=new Map,f.current=null,queueMicrotask(()=>{v(e.exit)})}},[]);const w=()=>"ref"in k?k.ref.current:k.get(),A=O=>{queueMicrotask(()=>{var ie,re,Jn,Zn,Qn;if(b.current!==De.Started)return;g.current=u.current,u.current=O,r("send",O);let P=w();const N=(Jn=(ie=e.states[P].on)==null?void 0:ie[O.type])!=null?Jn:(re=e.on)==null?void 0:re[O.type],D=T(N);if(!D)return;f.current=D;const B=(Zn=D.target)!=null?Zn:P;r("transition",D);const J=B!==P;J?Ft.flushSync(()=>k.set(B)):D.reenter&&!J?k.invoke(P,P):v((Qn=D.actions)!=null?Qn:[])})};return(ne=e.watch)==null||ne.call(e,m()),{state:h(),send:A,context:d,prop:i,scope:n,refs:p,computed:R,event:c(),getStatus:()=>b.current}}function Xr(e){const t=y.useRef(e);return t.current=e,t}function ta(e){const t=Xr(e);return function(r){return t.current[r]}}function ir(e){queueMicrotask(()=>{Ft.flushSync(()=>e())})}var We=Zs(e=>e);function dt(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const o=r(t);typeof o=="function"&&n.push(o)}else r&&(r.current=t);if(n.length)return()=>{for(const r of n)r()}}}function na(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const nn=e=>{const t=y.memo(y.forwardRef((n,r)=>{const{asChild:o,children:i,...s}=n;if(!o)return y.createElement(e,{...s,ref:r},i);const a=y.Children.only(i);if(!y.isValidElement(a))return null;const d=na(a);return y.cloneElement(a,{...S(s,a.props),ref:r?dt(r,d):d})}));return t.displayName=e.displayName||e.name,t},ra=()=>{const e=new Map;return new Proxy(nn,{apply(t,n,r){return nn(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,nn(r)),e.get(r)}})},V=ra(),Y=()=>(e,t)=>t.reduce((n,r)=>{const[o,i]=n,s=r;return i[s]!==void 0&&(o[s]=i[s]),delete i[s],[o,i]},[{},{...e}]);var ge=(e,t=[])=>({parts:(...n)=>{if(oa(t))return ge(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>ge(e,[...t,...n]),rename:n=>ge(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Ve(e)}"][data-part="${Ve(r)}"]`,`& [data-scope="${Ve(e)}"][data-part="${Ve(r)}"]`].join(", "),attrs:{"data-scope":Ve(e),"data-part":Ve(r)}}}),{})}),Ve=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),oa=e=>e.length===0;const[bu,ke]=U({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[Eu,Ke]=U({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),ia=["top","right","bottom","left"],ye=Math.min,Z=Math.max,kt=Math.round,mt=Math.floor,le=e=>({x:e,y:e}),sa={left:"right",right:"left",bottom:"top",top:"bottom"},aa={start:"end",end:"start"};function hn(e,t,n){return Z(e,ye(t,n))}function pe(e,t){return typeof e=="function"?e(t):e}function me(e){return e.split("-")[0]}function Ue(e){return e.split("-")[1]}function Bn(e){return e==="x"?"y":"x"}function Hn(e){return e==="y"?"height":"width"}function be(e){return["top","bottom"].includes(me(e))?"y":"x"}function _n(e){return Bn(be(e))}function ca(e,t,n){n===void 0&&(n=!1);const r=Ue(e),o=_n(e),i=Hn(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=St(s)),[s,St(s)]}function la(e){const t=St(e);return[gn(e),t,gn(t)]}function gn(e){return e.replace(/start|end/g,t=>aa[t])}function ua(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function da(e,t,n,r){const o=Ue(e);let i=ua(me(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(gn)))),i}function St(e){return e.replace(/left|right|bottom|top/g,t=>sa[t])}function fa(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yr(e){return typeof e!="number"?fa(e):{top:e,right:e,bottom:e,left:e}}function Nt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function sr(e,t,n){let{reference:r,floating:o}=e;const i=be(t),s=_n(t),a=Hn(s),d=me(t),l=i==="y",f=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,u=r[a]/2-o[a]/2;let c;switch(d){case"top":c={x:f,y:r.y-o.height};break;case"bottom":c={x:f,y:r.y+r.height};break;case"right":c={x:r.x+r.width,y:g};break;case"left":c={x:r.x-o.width,y:g};break;default:c={x:r.x,y:r.y}}switch(Ue(t)){case"start":c[s]-=u*(n&&l?-1:1);break;case"end":c[s]+=u*(n&&l?-1:1);break}return c}const ha=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:g}=sr(l,r,d),u=r,c={},h=0;for(let p=0;p<a.length;p++){const{name:m,fn:v}=a[p],{x:E,y:I,data:T,reset:R}=await v({x:f,y:g,initialPlacement:r,placement:u,strategy:o,middlewareData:c,rects:l,platform:s,elements:{reference:e,floating:t}});f=E!=null?E:f,g=I!=null?I:g,c={...c,[m]:{...c[m],...T}},R&&h<=50&&(h++,typeof R=="object"&&(R.placement&&(u=R.placement),R.rects&&(l=R.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:f,y:g}=sr(l,u,d)),p=-1)}return{x:f,y:g,placement:u,strategy:o,middlewareData:c}};async function at(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:d}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:u=!1,padding:c=0}=pe(t,e),h=Yr(c),m=a[u?g==="floating"?"reference":"floating":g],v=Nt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:f,strategy:d})),E=g==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),T=await(i.isElement==null?void 0:i.isElement(I))?await(i.getScale==null?void 0:i.getScale(I))||{x:1,y:1}:{x:1,y:1},R=Nt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:I,strategy:d}):E);return{top:(v.top-R.top+h.top)/T.y,bottom:(R.bottom-v.bottom+h.bottom)/T.y,left:(v.left-R.left+h.left)/T.x,right:(R.right-v.right+h.right)/T.x}}const ga=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:d}=t,{element:l,padding:f=0}=pe(e,t)||{};if(l==null)return{};const g=Yr(f),u={x:n,y:r},c=_n(o),h=Hn(c),p=await s.getDimensions(l),m=c==="y",v=m?"top":"left",E=m?"bottom":"right",I=m?"clientHeight":"clientWidth",T=i.reference[h]+i.reference[c]-u[c]-i.floating[h],R=u[c]-i.reference[c],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let L=k?k[I]:0;(!L||!await(s.isElement==null?void 0:s.isElement(k)))&&(L=a.floating[I]||i.floating[h]);const b=T/2-R/2,w=L/2-p[h]/2-1,A=ye(g[v],w),G=ye(g[E],w),$=A,z=L-p[h]-G,_=L/2-p[h]/2+b,fe=hn($,_,z),ne=!d.arrow&&Ue(o)!=null&&_!==fe&&i.reference[h]/2-(_<$?A:G)-p[h]/2<0,O=ne?_<$?_-$:_-z:0;return{[c]:u[c]+O,data:{[c]:fe,centerOffset:_-fe-O,...ne&&{alignmentOffset:O}},reset:ne}}}),pa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:d,elements:l}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:u,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...m}=pe(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=me(o),E=be(a),I=me(a)===a,T=await(d.isRTL==null?void 0:d.isRTL(l.floating)),R=u||(I||!p?[St(a)]:la(a)),k=h!=="none";!u&&k&&R.push(...da(a,p,h,T));const L=[a,...R],b=await at(t,m),w=[];let A=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&w.push(b[v]),g){const _=ca(o,s,T);w.push(b[_[0]],b[_[1]])}if(A=[...A,{placement:o,overflows:w}],!w.every(_=>_<=0)){var G,$;const _=(((G=i.flip)==null?void 0:G.index)||0)+1,fe=L[_];if(fe)return{data:{index:_,overflows:A},reset:{placement:fe}};let ne=($=A.filter(O=>O.overflows[0]<=0).sort((O,P)=>O.overflows[1]-P.overflows[1])[0])==null?void 0:$.placement;if(!ne)switch(c){case"bestFit":{var z;const O=(z=A.filter(P=>{if(k){const N=be(P.placement);return N===E||N==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(N=>N>0).reduce((N,D)=>N+D,0)]).sort((P,N)=>P[1]-N[1])[0])==null?void 0:z[0];O&&(ne=O);break}case"initialPlacement":ne=a;break}if(o!==ne)return{reset:{placement:ne}}}return{}}}};function ar(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cr(e){return ia.some(t=>e[t]>=0)}const ma=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=pe(e,t);switch(r){case"referenceHidden":{const i=await at(t,{...o,elementContext:"reference"}),s=ar(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:cr(s)}}}case"escaped":{const i=await at(t,{...o,altBoundary:!0}),s=ar(i,n.floating);return{data:{escapedOffsets:s,escaped:cr(s)}}}default:return{}}}}};async function va(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=me(n),a=Ue(n),d=be(n)==="y",l=["left","top"].includes(s)?-1:1,f=i&&d?-1:1,g=pe(t,e);let{mainAxis:u,crossAxis:c,alignmentAxis:h}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof h=="number"&&(c=a==="end"?h*-1:h),d?{x:c*f,y:u*l}:{x:u*l,y:c*f}}const ya=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,d=await va(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+d.x,y:i+d.y,data:{...d,placement:s}}}}},ba=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:v,y:E}=m;return{x:v,y:E}}},...d}=pe(e,t),l={x:n,y:r},f=await at(t,d),g=be(me(o)),u=Bn(g);let c=l[u],h=l[g];if(i){const m=u==="y"?"top":"left",v=u==="y"?"bottom":"right",E=c+f[m],I=c-f[v];c=hn(E,c,I)}if(s){const m=g==="y"?"top":"left",v=g==="y"?"bottom":"right",E=h+f[m],I=h-f[v];h=hn(E,h,I)}const p=a.fn({...t,[u]:c,[g]:h});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[u]:i,[g]:s}}}}}},Ea=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:d=!0,crossAxis:l=!0}=pe(e,t),f={x:n,y:r},g=be(o),u=Bn(g);let c=f[u],h=f[g];const p=pe(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(d){const I=u==="y"?"height":"width",T=i.reference[u]-i.floating[I]+m.mainAxis,R=i.reference[u]+i.reference[I]-m.mainAxis;c<T?c=T:c>R&&(c=R)}if(l){var v,E;const I=u==="y"?"width":"height",T=["top","left"].includes(me(o)),R=i.reference[g]-i.floating[I]+(T&&((v=s.offset)==null?void 0:v[g])||0)+(T?0:m.crossAxis),k=i.reference[g]+i.reference[I]+(T?0:((E=s.offset)==null?void 0:E[g])||0)-(T?m.crossAxis:0);h<R?h=R:h>k&&(h=k)}return{[u]:c,[g]:h}}}},Ia=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:d=()=>{},...l}=pe(e,t),f=await at(t,l),g=me(o),u=Ue(o),c=be(o)==="y",{width:h,height:p}=i.floating;let m,v;g==="top"||g==="bottom"?(m=g,v=u===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=g,m=u==="end"?"top":"bottom");const E=p-f.top-f.bottom,I=h-f.left-f.right,T=ye(p-f[m],E),R=ye(h-f[v],I),k=!t.middlewareData.shift;let L=T,b=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(b=I),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=E),k&&!u){const A=Z(f.left,0),G=Z(f.right,0),$=Z(f.top,0),z=Z(f.bottom,0);c?b=h-2*(A!==0||G!==0?A+G:Z(f.left,f.right)):L=p-2*($!==0||z!==0?$+z:Z(f.top,f.bottom))}await d({...t,availableWidth:b,availableHeight:L});const w=await s.getDimensions(a.floating);return h!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function _t(){return typeof window!="undefined"}function qe(e){return zr(e)?(e.nodeName||"").toLowerCase():"#document"}function Q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function de(e){var t;return(t=(zr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zr(e){return _t()?e instanceof Node||e instanceof Q(e).Node:!1}function ae(e){return _t()?e instanceof Element||e instanceof Q(e).Element:!1}function ue(e){return _t()?e instanceof HTMLElement||e instanceof Q(e).HTMLElement:!1}function lr(e){return!_t()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Q(e).ShadowRoot}function ft(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ca(e){return["table","td","th"].includes(qe(e))}function jt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function jn(e){const t=Wn(),n=ae(e)?ce(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ta(e){let t=Ee(e);for(;ue(t)&&!je(t);){if(jn(t))return t;if(jt(t))return null;t=Ee(t)}return null}function Wn(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function je(e){return["html","body","#document"].includes(qe(e))}function ce(e){return Q(e).getComputedStyle(e)}function Wt(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ee(e){if(qe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lr(e)&&e.host||de(e);return lr(t)?t.host:t}function Jr(e){const t=Ee(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:ue(t)&&ft(t)?t:Jr(t)}function ct(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Jr(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Q(o);if(i){const a=pn(s);return t.concat(s,s.visualViewport||[],ft(o)?o:[],a&&n?ct(a):[])}return t.concat(o,ct(o,[],n))}function pn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zr(e){const t=ce(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ue(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=kt(n)!==i||kt(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Kn(e){return ae(e)?e:e.contextElement}function Be(e){const t=Kn(e);if(!ue(t))return le(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Zr(t);let s=(i?kt(n.width):n.width)/r,a=(i?kt(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const wa=le(0);function Qr(e){const t=Q(e);return!Wn()||!t.visualViewport?wa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xa(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Q(e)?!1:t}function Pe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Kn(e);let s=le(1);t&&(r?ae(r)&&(s=Be(r)):s=Be(e));const a=xa(i,n,r)?Qr(i):le(0);let d=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,f=o.width/s.x,g=o.height/s.y;if(i){const u=Q(i),c=r&&ae(r)?Q(r):r;let h=u,p=pn(h);for(;p&&r&&c!==h;){const m=Be(p),v=p.getBoundingClientRect(),E=ce(p),I=v.left+(p.clientLeft+parseFloat(E.paddingLeft))*m.x,T=v.top+(p.clientTop+parseFloat(E.paddingTop))*m.y;d*=m.x,l*=m.y,f*=m.x,g*=m.y,d+=I,l+=T,h=Q(p),p=pn(h)}}return Nt({width:f,height:g,x:d,y:l})}function Un(e,t){const n=Wt(e).scrollLeft;return t?t.left+n:Pe(de(e)).left+n}function eo(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Un(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Pa(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=de(r),a=t?jt(t.floating):!1;if(r===s||a&&i)return n;let d={scrollLeft:0,scrollTop:0},l=le(1);const f=le(0),g=ue(r);if((g||!g&&!i)&&((qe(r)!=="body"||ft(s))&&(d=Wt(r)),ue(r))){const c=Pe(r);l=Be(r),f.x=c.x+r.clientLeft,f.y=c.y+r.clientTop}const u=s&&!g&&!i?eo(s,d,!0):le(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-d.scrollLeft*l.x+f.x+u.x,y:n.y*l.y-d.scrollTop*l.y+f.y+u.y}}function Oa(e){return Array.from(e.getClientRects())}function Ra(e){const t=de(e),n=Wt(e),r=e.ownerDocument.body,o=Z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Un(e);const a=-n.scrollTop;return ce(r).direction==="rtl"&&(s+=Z(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function ka(e,t){const n=Q(e),r=de(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,d=0;if(o){i=o.width,s=o.height;const l=Wn();(!l||l&&t==="fixed")&&(a=o.offsetLeft,d=o.offsetTop)}return{width:i,height:s,x:a,y:d}}function Sa(e,t){const n=Pe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ue(e)?Be(e):le(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,d=o*i.x,l=r*i.y;return{width:s,height:a,x:d,y:l}}function ur(e,t,n){let r;if(t==="viewport")r=ka(e,n);else if(t==="document")r=Ra(de(e));else if(ae(t))r=Sa(t,n);else{const o=Qr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Nt(r)}function to(e,t){const n=Ee(e);return n===t||!ae(n)||je(n)?!1:ce(n).position==="fixed"||to(n,t)}function Na(e,t){const n=t.get(e);if(n)return n;let r=ct(e,[],!1).filter(a=>ae(a)&&qe(a)!=="body"),o=null;const i=ce(e).position==="fixed";let s=i?Ee(e):e;for(;ae(s)&&!je(s);){const a=ce(s),d=jn(s);!d&&a.position==="fixed"&&(o=null),(i?!d&&!o:!d&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ft(s)&&!d&&to(e,s))?r=r.filter(f=>f!==s):o=a,s=Ee(s)}return t.set(e,r),r}function Aa(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?jt(t)?[]:Na(t,this._c):[].concat(n),r],a=s[0],d=s.reduce((l,f)=>{const g=ur(t,f,o);return l.top=Z(g.top,l.top),l.right=ye(g.right,l.right),l.bottom=ye(g.bottom,l.bottom),l.left=Z(g.left,l.left),l},ur(t,a,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Va(e){const{width:t,height:n}=Zr(e);return{width:t,height:n}}function Fa(e,t,n){const r=ue(t),o=de(t),i=n==="fixed",s=Pe(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const d=le(0);if(r||!r&&!i)if((qe(t)!=="body"||ft(o))&&(a=Wt(t)),r){const u=Pe(t,!0,i,t);d.x=u.x+t.clientLeft,d.y=u.y+t.clientTop}else o&&(d.x=Un(o));const l=o&&!r&&!i?eo(o,a):le(0),f=s.left+a.scrollLeft-d.x-l.x,g=s.top+a.scrollTop-d.y-l.y;return{x:f,y:g,width:s.width,height:s.height}}function rn(e){return ce(e).position==="static"}function dr(e,t){if(!ue(e)||ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return de(e)===n&&(n=n.ownerDocument.body),n}function no(e,t){const n=Q(e);if(jt(e))return n;if(!ue(e)){let o=Ee(e);for(;o&&!je(o);){if(ae(o)&&!rn(o))return o;o=Ee(o)}return n}let r=dr(e,t);for(;r&&Ca(r)&&rn(r);)r=dr(r,t);return r&&je(r)&&rn(r)&&!jn(r)?n:r||Ta(e)||n}const La=async function(e){const t=this.getOffsetParent||no,n=this.getDimensions,r=await n(e.floating);return{reference:Fa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Da(e){return ce(e).direction==="rtl"}const $a={convertOffsetParentRelativeRectToViewportRelativeRect:Pa,getDocumentElement:de,getClippingRect:Aa,getOffsetParent:no,getElementRects:La,getClientRects:Oa,getDimensions:Va,getScale:Be,isElement:ae,isRTL:Da};function ro(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ma(e,t){let n=null,r;const o=de(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,d){a===void 0&&(a=!1),d===void 0&&(d=1),i();const l=e.getBoundingClientRect(),{left:f,top:g,width:u,height:c}=l;if(a||t(),!u||!c)return;const h=mt(g),p=mt(o.clientWidth-(f+u)),m=mt(o.clientHeight-(g+c)),v=mt(f),I={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Z(0,ye(1,d))||1};let T=!0;function R(k){const L=k[0].intersectionRatio;if(L!==d){if(!T)return s();L?s(!1,L):r=setTimeout(()=>{s(!1,1e-7)},1e3)}L===1&&!ro(l,e.getBoundingClientRect())&&s(),T=!1}try{n=new IntersectionObserver(R,{...I,root:o.ownerDocument})}catch(k){n=new IntersectionObserver(R,I)}n.observe(e)}return s(!0),i}function Ga(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,l=Kn(e),f=o||i?[...l?ct(l):[],...ct(t)]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const g=l&&a?Ma(l,n):null;let u=-1,c=null;s&&(c=new ResizeObserver(v=>{let[E]=v;E&&E.target===l&&c&&(c.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var I;(I=c)==null||I.observe(t)})),n()}),l&&!d&&c.observe(l),c.observe(t));let h,p=d?Pe(e):null;d&&m();function m(){const v=Pe(e);p&&!ro(p,v)&&n(),p=v,h=requestAnimationFrame(m)}return n(),()=>{var v;f.forEach(E=>{o&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),g==null||g(),(v=c)==null||v.disconnect(),c=null,d&&cancelAnimationFrame(h)}}const Ba=ya,Ha=ba,_a=pa,ja=Ia,Wa=ma,Ka=ga,Ua=Ea,qa=(e,t,n)=>{const r=new Map,o={platform:$a,...n},i={...o.platform,_c:r};return ha(e,t,{...o,platform:i})};function fr(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function Xa(e){if(!e)return fr();const{x:t,y:n,width:r,height:o}=e;return fr(t,n,r,o)}function Ya(e,t){return{contextElement:W(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?Xa(r):n.getBoundingClientRect()}}}var ze=e=>({variable:e,reference:`var(${e})`}),he={arrowSize:ze("--arrow-size"),arrowSizeHalf:ze("--arrow-size-half"),arrowBg:ze("--arrow-background"),transformOrigin:ze("--transform-origin"),arrowOffset:ze("--arrow-offset")},za=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),Ja={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){const{arrow:r}=n,o=za(r)[e],{floating:i}=t;return i.style.setProperty(he.transformOrigin.variable,o),{data:{transformOrigin:o}}}},Za={name:"rects",fn({rects:e}){return{data:e}}},Qa=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${he.arrowOffset.reference})`}),{}}}};function ec(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var tc={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function hr(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function oo(e){return Gi(e.boundary)}function nc(e,t){if(e)return Ka({element:e,padding:t.arrowPadding})}function rc(e,t){var n;if(!$i((n=t.offset)!=null?n:t.gutter))return Ba(({placement:r})=>{var f,g,u,c;const o=((e==null?void 0:e.clientHeight)||0)/2,i=(g=(f=t.offset)==null?void 0:f.mainAxis)!=null?g:t.gutter,s=typeof i=="number"?i+o:i!=null?i:o,{hasAlign:a}=ec(r),d=a?void 0:t.shift,l=(c=(u=t.offset)==null?void 0:u.crossAxis)!=null?c:d;return kn({crossAxis:l,mainAxis:s,alignmentAxis:t.shift})})}function oc(e){if(e.flip)return _a({boundary:oo(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function ic(e){if(!(!e.slide&&!e.overlap))return Ha({boundary:oo(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Ua()})}function sc(e){return ja({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:o}){const i=t.floating,s=Math.round(n.reference.width);o=Math.floor(o),r=Math.floor(r),i.style.setProperty("--reference-width",`${s}px`),i.style.setProperty("--available-width",`${o}px`),i.style.setProperty("--available-height",`${r}px`)}})}function ac(e){var t,n;if(e.hideWhenDetached)return Wa({strategy:"referenceHidden",boundary:(n=(t=e.boundary)==null?void 0:t.call(e))!=null?n:"clippingAncestors"})}function cc(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function lc(e,t,n={}){const r=Ya(e,n.getAnchorRect);if(!t||!r)return;const o=Object.assign({},tc,n),i=t.querySelector("[data-part=arrow]"),s=[rc(i,o),oc(o),ic(o),nc(i,o),Qa(i),Ja,sc(o),ac(o),Za],{placement:a,strategy:d,onComplete:l,onPositioned:f}=o,g=async()=>{var T;if(!r||!t)return;const p=await qa(r,t,{placement:a,middleware:s,strategy:d});l==null||l(p),f==null||f({placed:!0});const m=X(t),v=hr(m,p.x),E=hr(m,p.y);t.style.setProperty("--x",`${v}px`),t.style.setProperty("--y",`${E}px`),o.hideWhenDetached&&(((T=p.middlewareData.hide)==null?void 0:T.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const I=t.firstElementChild;if(I){const R=Nn(I);t.style.setProperty("--z-index",R.zIndex)}},u=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:g}),f==null||f({placed:!0})):await g()},c=cc(o.listeners),h=o.listeners?Ga(r,t,u,c):Hi;return u(),()=>{h==null||h(),f==null||f({placed:!1})}}function gr(e,t,n={}){const{defer:r,...o}=n,i=r?H:a=>a(),s=[];return s.push(i(()=>{const a=typeof e=="function"?e():e,d=typeof t=="function"?t():t;s.push(lc(a,d,o))})),()=>{s.forEach(a=>a==null?void 0:a())}}var uc={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function dc(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:he.arrowSize.reference,height:he.arrowSize.reference,[he.arrowSizeHalf.variable]:`calc(${he.arrowSize.reference} / 2)`,[he.arrowOffset.variable]:`calc(${he.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?uc[t.split("-")[0]]:void 0,background:he.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function fc(e){const t={each(n){var r;for(let o=0;o<((r=e.frames)==null?void 0:r.length);o+=1){const i=e.frames[o];i&&n(i)}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch(s){}}),()=>{try{t.removeEventListener(n,r,o)}catch(i){}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch(s){}})}};return t}function hc(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t==null||t.addEventListener(n,r,o)}catch(i){}return()=>{try{t==null||t.removeEventListener(n,r,o)}catch(i){}}},removeEventListener:(n,r,o)=>{try{t==null||t.removeEventListener(n,r,o)}catch(i){}}}}var pr="pointerdown.outside",mr="focus.outside";function gc(e){for(const t of e)if(W(t)&&ve(t))return!0;return!1}var io=e=>"clientY"in e;function pc(e,t){if(!io(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function mc(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function vr(e,t){if(!t||!io(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,s={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},a={x:e.clientX,y:e.clientY};return mc(s,a)?r||i:!1}function vc(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s}=t;if(!e)return;const a=ee(e),d=X(e),l=fc(d),f=hc(d);function g(E,I){if(!W(I)||!I.isConnected||_e(e,I)||pc(e,E))return!1;const T=a.querySelector(`[aria-controls="${e.id}"]`);if(T){const k=dn(T);if(vr(E,k))return!1}const R=dn(e);return vr(E,R)?!1:!(n!=null&&n(I))}const u=new Set,c=He(e==null?void 0:e.getRootNode());function h(E){function I(T){var b,w;const R=s&&!nr()?H:A=>A(),k=T!=null?T:E,L=(w=(b=k==null?void 0:k.composedPath)==null?void 0:b.call(k))!=null?w:[k==null?void 0:k.target];R(()=>{const A=c?L[0]:K(E);if(!(!e||!g(E,A))){if(o||i){const G=cn(o,i);e.addEventListener(pr,G,{once:!0})}yr(e,pr,{bubbles:!1,cancelable:!0,detail:{originalEvent:k,contextmenu:gs(k),focusable:gc(L),target:A}})}})}E.pointerType==="touch"?(u.forEach(T=>T()),u.add(j(a,"click",I,{once:!0})),u.add(f.addEventListener("click",I,{once:!0})),u.add(l.addEventListener("click",I,{once:!0}))):I()}const p=new Set,m=setTimeout(()=>{p.add(j(a,"pointerdown",h,!0)),p.add(f.addEventListener("pointerdown",h,!0)),p.add(l.addEventListener("pointerdown",h,!0))},0);function v(E){(s?H:T=>T())(()=>{const T=K(E);if(!(!e||!g(E,T))){if(r||i){const R=cn(r,i);e.addEventListener(mr,R,{once:!0})}yr(e,mr,{bubbles:!1,cancelable:!0,detail:{originalEvent:E,contextmenu:!1,focusable:ve(T),target:T}})}})}return nr()||(p.add(j(a,"focusin",v,!0)),p.add(f.addEventListener("focusin",v,!0)),p.add(l.addEventListener("focusin",v,!0))),()=>{clearTimeout(m),u.forEach(E=>E()),p.forEach(E=>E())}}function yc(e,t){const{defer:n}=t,r=n?H:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(vc(i,t))})),()=>{o.forEach(i=>i==null?void 0:i())}}function yr(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function bc(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return j(ee(e),"keydown",n,{capture:!0})}var se={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var r;const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf((r=this.topMostPointerBlockingLayer())==null?void 0:r.node):-1;return t<n},isTopMost(e){const t=this.layers[this.count()-1];return(t==null?void 0:t.node)===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>_e(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>_e(t,e))},add(e){const t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>r.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){var t;(t=this.layers[this.indexOf(e)])==null||t.dismiss()},clear(){this.remove(this.layers[0].node)}},br;function Er(){se.layers.forEach(({node:e})=>{e.style.pointerEvents=se.isBelowPointerBlockingLayer(e)?"none":"auto"})}function Ec(e){e.style.pointerEvents=""}function Ic(e,t){const n=ee(e),r=[];if(se.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(br=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){const o=qs(t,i=>{r.push(Ot(i,{pointerEvents:"auto"}))});r.push(o)}return()=>{se.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=br,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(o=>o()))}}function Cc(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){ln("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,pointerBlocking:o,exclude:i,debug:s}=t,a={dismiss:r,node:e,pointerBlocking:o};se.add(a),Er();function d(c){var p,m;const h=K(c.detail.originalEvent);se.isBelowPointerBlockingLayer(e)||se.isInBranch(h)||((p=t.onPointerDownOutside)==null||p.call(t,c),(m=t.onInteractOutside)==null||m.call(t,c),!c.defaultPrevented&&(s&&console.log("onPointerDownOutside:",c.detail.originalEvent),r==null||r()))}function l(c){var p,m;const h=K(c.detail.originalEvent);se.isInBranch(h)||((p=t.onFocusOutside)==null||p.call(t,c),(m=t.onInteractOutside)==null||m.call(t,c),!c.defaultPrevented&&(s&&console.log("onFocusOutside:",c.detail.originalEvent),r==null||r()))}function f(c){var h;se.isTopMost(e)&&((h=t.onEscapeKeyDown)==null||h.call(t,c),!c.defaultPrevented&&r&&(c.preventDefault(),r()))}function g(c){var v;if(!e)return!1;const h=typeof i=="function"?i():i,p=Array.isArray(h)?h:[h],m=(v=t.persistentElements)==null?void 0:v.map(E=>E()).filter(W);return m&&p.push(...m),p.some(E=>_e(E,c))||se.isInNestedLayer(e,c)}const u=[o?Ic(e,t.persistentElements):void 0,bc(e,f),yc(e,{exclude:g,onFocusOutside:l,onPointerDownOutside:d,defer:t.defer})];return()=>{se.remove(e),Er(),Ec(e),u.forEach(c=>c==null?void 0:c())}}function so(e,t){const{defer:n}=t,r=n?H:i=>i(),o=[];return o.push(r(()=>{const i=$e(e)?e():e;o.push(Cc(i,t))})),()=>{o.forEach(i=>i==null?void 0:i())}}const[ao,co]=U({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),lo=e=>Y()(e,["lazyMount","unmountOnExit"]),[uo,Kt]=U({name:"CheckboxContext",hookName:"useCheckboxContext",providerName:"<CheckboxProvider />"}),fo=y.forwardRef((e,t)=>{const n=Kt(),r=S(n.getControlProps(),e);return C.jsx(V.div,{...r,ref:t})});fo.displayName="CheckboxControl";function Tc(e){return!(e.metaKey||!Mt()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}var wc=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function xc(e,t,n){const r=n?K(n):null,o=X(r);return e=e||r instanceof o.HTMLInputElement&&!wc.has(r==null?void 0:r.type)||r instanceof o.HTMLTextAreaElement||r instanceof o.HTMLElement&&r.isContentEditable,!(e&&t==="keyboard"&&n instanceof o.KeyboardEvent&&!Reflect.has(Pc,n.key))}var Se=null,mn=new Set,it=new Map,Oe=!1,vn=!1,Pc={Tab:!0,Escape:!0};function Ut(e,t){for(let n of mn)n(e,t)}function At(e){Oe=!0,Tc(e)&&(Se="keyboard",Ut("keyboard",e))}function oe(e){Se="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Oe=!0,Ut("pointer",e))}function ho(e){hs(e)&&(Oe=!0,Se="virtual")}function go(e){const t=K(e);t===X(t)||t===ee(t)||(!Oe&&!vn&&(Se="virtual",Ut("virtual",e)),Oe=!1,vn=!1)}function po(){Oe=!1,vn=!0}function Oc(e){if(typeof window=="undefined"||it.get(X(e)))return;const t=X(e),n=ee(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Se="virtual",Ut("virtual",null),Oe=!0,r.apply(this,arguments)},n.addEventListener("keydown",At,!0),n.addEventListener("keyup",At,!0),n.addEventListener("click",ho,!0),t.addEventListener("focus",go,!0),t.addEventListener("blur",po,!1),typeof t.PointerEvent!="undefined"?(n.addEventListener("pointerdown",oe,!0),n.addEventListener("pointermove",oe,!0),n.addEventListener("pointerup",oe,!0)):(n.addEventListener("mousedown",oe,!0),n.addEventListener("mousemove",oe,!0),n.addEventListener("mouseup",oe,!0)),t.addEventListener("beforeunload",()=>{Rc(e)},{once:!0}),it.set(t,{focus:r})}var Rc=(e,t)=>{const n=X(e),r=ee(e);it.has(n)&&(n.HTMLElement.prototype.focus=it.get(n).focus,r.removeEventListener("keydown",At,!0),r.removeEventListener("keyup",At,!0),r.removeEventListener("click",ho,!0),n.removeEventListener("focus",go,!0),n.removeEventListener("blur",po,!1),typeof n.PointerEvent!="undefined"?(r.removeEventListener("pointerdown",oe,!0),r.removeEventListener("pointermove",oe,!0),r.removeEventListener("pointerup",oe,!0)):(r.removeEventListener("mousedown",oe,!0),r.removeEventListener("mousemove",oe,!0),r.removeEventListener("mouseup",oe,!0)),it.delete(n))};function lt(){return Se==="keyboard"}function qn(e={}){const{isTextInput:t,autoFocus:n,onChange:r,root:o}=e;Oc(o),r==null||r({isFocusVisible:n||lt(),modality:Se});const i=(s,a)=>{xc(!!t,s,a)&&(r==null||r({isFocusVisible:lt(),modality:s}))};return mn.add(i),()=>{mn.delete(i)}}var mo=ge("checkbox").parts("root","label","control","indicator"),vt=mo.build(),vo=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`checkbox:${e.id}`},Ir=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.label)!=null?n:`checkbox:${e.id}:label`},kc=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.control)!=null?n:`checkbox:${e.id}:control`},yn=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.hiddenInput)!=null?n:`checkbox:${e.id}:input`},Sc=e=>e.getById(vo(e)),rt=e=>e.getById(yn(e));function Nc(e,t){const{send:n,context:r,prop:o,computed:i,scope:s}=e,a=o("disabled"),d=o("readOnly"),l=o("invalid"),f=!a&&r.get("focused"),g=!a&&r.get("focusVisible"),u=i("checked"),c=i("indeterminate"),h={"data-active":x(r.get("active")),"data-focus":x(f),"data-focus-visible":x(g),"data-readonly":x(d),"data-hover":x(r.get("hovered")),"data-disabled":x(a),"data-state":c?"indeterminate":u?"checked":"unchecked","data-invalid":x(l)};return{checked:u,disabled:a,indeterminate:c,focused:f,checkedState:u,setChecked(p){n({type:"CHECKED.SET",checked:p,isTrusted:!1})},toggleChecked(){n({type:"CHECKED.TOGGLE",checked:u,isTrusted:!1})},getRootProps(){return t.label({...vt.root.attrs,...h,dir:o("dir"),id:vo(s),htmlFor:yn(s),onPointerMove(){a||n({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){a||n({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(p){K(p)===rt(s)&&p.stopPropagation()}})},getLabelProps(){return t.element({...vt.label.attrs,...h,dir:o("dir"),id:Ir(s)})},getControlProps(){return t.element({...vt.control.attrs,...h,dir:o("dir"),id:kc(s),"aria-hidden":!0})},getIndicatorProps(){return t.element({...vt.indicator.attrs,...h,dir:o("dir"),hidden:!c&&!u})},getHiddenInputProps(){return t.input({id:yn(s),type:"checkbox",required:o("required"),defaultChecked:u,disabled:a,"aria-labelledby":Ir(s),"aria-invalid":l,name:o("name"),form:o("form"),value:o("value"),style:Ht,onFocus(){const p=lt();n({type:"CONTEXT.SET",context:{focused:!0,focusVisible:p}})},onBlur(){n({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(p){if(d){p.preventDefault();return}const m=p.currentTarget.checked;n({type:"CHECKED.SET",checked:m,isTrusted:!0})}})}}}var{not:Cr}=ut(),Ac={props({props:e}){return{value:"on",...e,defaultChecked:!!e.defaultChecked}},initialState(){return"ready"},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e("defaultChecked"),value:e("checked"),onChange(n){var r;(r=e("onCheckedChange"))==null||r({checked:n})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},watch({track:e,context:t,prop:n,action:r}){e([()=>n("disabled")],()=>{r(["removeFocusIfNeeded"])}),e([()=>t.get("checked")],()=>{r(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:Cr("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:Cr("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{indeterminate:({context:e})=>wt(e.get("checked")),checked:({context:e})=>Vc(e.get("checked")),disabled:({context:e,prop:t})=>!!t("disabled")||e.get("fieldsetDisabled")},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({context:e,computed:t,scope:n}){if(!t("disabled"))return jr({pointerNode:Sc(n),keyboardNode:rt(n),isValidKey:r=>r.key===" ",onPress:()=>e.set("active",!1),onPressStart:()=>e.set("active",!0),onPressEnd:()=>e.set("active",!1)})},trackFocusVisible({computed:e,scope:t}){var n;if(!e("disabled"))return qn({root:(n=t.getRootNode)==null?void 0:n.call(t)})},trackFormControlState({context:e,scope:t}){return Gt(rt(t),{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){e.set("checked",e.initial("checked"))}})}},actions:{setContext({context:e,event:t}){for(const n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,computed:t,scope:n}){const r=rt(n);r&&(Fn(r,t("checked")),r.indeterminate=wt(e.get("checked")))},removeFocusIfNeeded({context:e,prop:t}){t("disabled")&&e.get("focused")&&(e.set("focused",!1),e.set("focusVisible",!1))},setChecked({context:e,event:t}){e.set("checked",t.checked)},toggleChecked({context:e,computed:t}){const n=wt(t("checked"))?!0:!t("checked");e.set("checked",n)},dispatchChangeEvent({computed:e,scope:t}){queueMicrotask(()=>{const n=rt(t);Ln(n,{checked:e("checked")})})}}}};function wt(e){return e==="indeterminate"}function Vc(e){return wt(e)?!1:!!e}te()(["defaultChecked","checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);const yo=mo.extendWith("group");function Fc(e){const{value:t,onChange:n,defaultValue:r}=e,[o,i]=y.useState(r),s=t!==void 0,a=s?t:o,d=y.useCallback(l=>(s||i(l),n==null?void 0:n(l)),[s,n]);return[a,d]}function bo(e,t={}){const{sync:n=!1}=t,r=Lc(e);return y.useCallback((...o)=>{var i;return n?queueMicrotask(()=>{var s;return(s=r.current)==null?void 0:s.call(r,...o)}):(i=r.current)==null?void 0:i.call(r,...o)},[n,r])}function Lc(e){const t=y.useRef(e);return t.current=e,t}function Dc(e={}){const{defaultValue:t,value:n,onValueChange:r,disabled:o,readOnly:i,name:s,invalid:a}=e,d=!(o||i),l=bo(r,{sync:!0}),[f,g]=Fc({value:n,defaultValue:t||[],onChange:l}),u=v=>f.some(E=>String(E)===String(v)),c=v=>{u(v)?p(v):h(v)},h=v=>{d&&(u(v)||g(f.concat(v)))},p=v=>{d&&g(f.filter(E=>String(E)!==String(v)))};return{isChecked:u,value:f,name:s,disabled:!!o,readOnly:!!i,invalid:!!a,setValue:g,addValue:h,toggleValue:c,getItemProps:v=>({checked:v.value!=null?u(v.value):void 0,onCheckedChange(){v.value!=null&&c(v.value)},name:s,disabled:o,readOnly:i,invalid:a})}}const[$c,Mc]=U({name:"CheckboxGroupContext",hookName:"useCheckboxGroupContext",providerName:"<CheckboxGroupProvider />",strict:!1}),Eo=y.forwardRef((e,t)=>{const[n,r]=Y()(e,["defaultValue","value","onValueChange","disabled","invalid","readOnly","name"]),o=Dc(n);return C.jsx($c,{value:o,children:C.jsx(V.div,{ref:t,role:"group",...r,...yo.build().group.attrs})})});Eo.displayName="CheckboxGroup";const[Iu,ht]=U({name:"FieldContext",hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1}),Io=y.forwardRef((e,t)=>{const n=Kt(),r=S(n.getHiddenInputProps(),e),o=ht();return C.jsx(V.input,{"aria-describedby":o==null?void 0:o.ariaDescribedby,...r,ref:t})});Io.displayName="CheckboxHiddenInput";const Co=y.forwardRef((e,t)=>{const{indeterminate:n,...r}=e,o=Kt(),i=S(o.getIndicatorProps(),r),s=n?o.indeterminate:o.checked;return C.jsx(V.div,{...i,hidden:!s,ref:t})});Co.displayName="CheckboxIndicator";const To=y.forwardRef((e,t)=>{const n=Kt(),r=S(n.getLabelProps(),e);return C.jsx(V.span,{...r,ref:t})});To.displayName="CheckboxLabel";const Gc=(e={})=>{const t=Mc(),n=ht(),r=y.useMemo(()=>{var l;return S(e,(l=t==null?void 0:t.getItemProps({value:e.value}))!=null?l:{})},[e,t]),o=y.useId(),{getRootNode:i}=ke(),{dir:s}=Ke(),a={id:o,ids:{label:n==null?void 0:n.ids.label,hiddenInput:n==null?void 0:n.ids.control},dir:s,disabled:n==null?void 0:n.disabled,readOnly:n==null?void 0:n.readOnly,invalid:n==null?void 0:n.invalid,required:n==null?void 0:n.required,getRootNode:i,...r},d=Re(Ac,a);return Nc(d,We)},wo=y.forwardRef((e,t)=>{const[n,r]=Y()(e,["checked","defaultChecked","disabled","form","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]),o=Gc(n),i=S(o.getRootProps(),r);return C.jsx(uo,{value:o,children:C.jsx(V.label,{...i,ref:t})})});wo.displayName="CheckboxRoot";const xo=y.forwardRef((e,t)=>{const[{value:n},r]=Y()(e,["value"]),o=S(n.getRootProps(),r);return C.jsx(uo,{value:n,children:C.jsx(V.label,{...o,ref:t})})});xo.displayName="CheckboxRootProvider";const[Xn,gt]=U({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),Po=e=>Y()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function Bc(e,t){const{state:n,send:r,context:o}=e,i=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(s){s&&r({type:"NODE.SET",node:s})},unmount(){r({type:"UNMOUNT"})}}}var Hc={props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,action:t,prop:n}){e([()=>n("present")],()=>{t(["setInitial","syncPresence"])})},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},setNode:({refs:e,event:t})=>{e.set("node",t.node)},setStyles:({refs:e,event:t})=>{e.set("styles",Nn(t.node))},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const i=t.get("node");if(!o&&(i==null?void 0:i.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});H(()=>{var a,d;const s=yt(t.get("styles"));e.set("unmountAnimationName",s),s==="none"||s===e.get("prevAnimationName")||((a=t.get("styles"))==null?void 0:a.display)==="none"||((d=t.get("styles"))==null?void 0:d.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{H(()=>{e.set("prevAnimationName",yt(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n})=>{const r=t.get("node");if(!r)return;const o=a=>{var l,f,g;((g=(f=(l=a.composedPath)==null?void 0:l.call(a))==null?void 0:f[0])!=null?g:a.target)===r&&e.set("prevAnimationName",yt(t.get("styles")))},i=a=>{const d=yt(t.get("styles"));K(a)===r&&d===e.get("unmountAnimationName")&&n({type:"UNMOUNT",src:"animationend"})};r.addEventListener("animationstart",o),r.addEventListener("animationcancel",i),r.addEventListener("animationend",i);const s=Ot(r,{animationFillMode:"forwards"});return()=>{r.removeEventListener("animationstart",o),r.removeEventListener("animationcancel",i),r.removeEventListener("animationend",i),Hr(()=>s())}}}}};function yt(e){return(e==null?void 0:e.animationName)||"none"}te()(["onExitComplete","present","immediate"]);const qt=(e={})=>{const{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:o=!1,...i}=e,s=y.useRef(!1),a={...i,present:r,onExitComplete:bo(e.onExitComplete)},d=Re(Hc,a),l=Bc(d);l.present&&(s.current=!0);const f=!l.present&&!s.current&&t||n&&!l.present&&s.current,g=()=>({"data-state":l.skip&&o?void 0:r?"open":"closed",hidden:!l.present});return{ref:l.setNode,getPresenceProps:g,present:l.present,unmounted:f}};var _c=Object.defineProperty,jc=(e,t,n)=>t in e?_c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F=(e,t,n)=>jc(e,typeof t!="symbol"?t+"":t,n),xt={itemToValue(e){return typeof e=="string"?e:Jt(e)&&Zt(e,"value")?e.value:""},itemToString(e){return typeof e=="string"?e:Jt(e)&&Zt(e,"label")?e.label:xt.itemToValue(e)},isItemDisabled(e){return Jt(e)&&Zt(e,"disabled")?!!e.disabled:!1}},Yn=class Oo{constructor(t){this.options=t,F(this,"items"),F(this,"copy",n=>new Oo({...this.options,items:n!=null?n:[...this.items]})),F(this,"isEqual",n=>Lt(this.items,n.items)),F(this,"setItems",n=>this.copy(n)),F(this,"getValues",(n=this.items)=>Array.from(n).map(r=>this.getItemValue(r)).filter(Boolean)),F(this,"find",n=>{if(n==null)return null;const r=this.items.findIndex(o=>this.getItemValue(o)===n);return r!=null?this.items[r]:null}),F(this,"findMany",n=>Array.from(n).map(r=>this.find(r)).filter(r=>r!=null)),F(this,"at",n=>{var r;return(r=this.items[n])!=null?r:null}),F(this,"sortFn",(n,r)=>{const o=this.indexOf(n),i=this.indexOf(r);return(o!=null?o:0)-(i!=null?i:0)}),F(this,"sort",n=>[...n].sort(this.sortFn.bind(this))),F(this,"getItemValue",n=>{var r,o,i;return n==null?null:(i=(o=(r=this.options).itemToValue)==null?void 0:o.call(r,n))!=null?i:xt.itemToValue(n)}),F(this,"getItemDisabled",n=>{var r,o,i;return n==null?!1:(i=(o=(r=this.options).isItemDisabled)==null?void 0:o.call(r,n))!=null?i:xt.isItemDisabled(n)}),F(this,"stringifyItem",n=>{var r,o,i;return n==null?null:(i=(o=(r=this.options).itemToString)==null?void 0:o.call(r,n))!=null?i:xt.itemToString(n)}),F(this,"stringify",n=>n==null?null:this.stringifyItem(this.find(n))),F(this,"stringifyItems",(n,r=", ")=>Array.from(n).map(o=>this.stringifyItem(o)).filter(Boolean).join(r)),F(this,"stringifyMany",(n,r)=>this.stringifyItems(this.findMany(n),r)),F(this,"has",n=>this.indexOf(n)!==-1),F(this,"hasItem",n=>n==null?!1:this.has(this.getItemValue(n))),F(this,"getNextValue",(n,r=1,o=!1)=>{let i=this.indexOf(n);if(i===-1)return null;for(i=o?Math.min(i+r,this.size-1):i+r;i<=this.size&&this.getItemDisabled(this.at(i));)i++;return this.getItemValue(this.at(i))}),F(this,"getPreviousValue",(n,r=1,o=!1)=>{let i=this.indexOf(n);if(i===-1)return null;for(i=o?Math.max(i-r,0):i-r;i>=0&&this.getItemDisabled(this.at(i));)i--;return this.getItemValue(this.at(i))}),F(this,"indexOf",n=>n==null?-1:this.items.findIndex(r=>this.getItemValue(r)===n)),F(this,"getByText",(n,r)=>{let o=r!=null?Kc(this.items,this.indexOf(r)):this.items;return n.length===1&&(o=o.filter(s=>this.getItemValue(s)!==r)),o.find(s=>Wc(this.stringifyItem(s),n))}),F(this,"search",(n,r)=>{const{state:o,currentValue:i,timeout:s=350}=r,a=o.keysSoFar+n,l=a.length>1&&Array.from(a).every(h=>h===a[0])?a[0]:a,f=this.getByText(l,i),g=this.getItemValue(f);function u(){clearTimeout(o.timer),o.timer=-1}function c(h){o.keysSoFar=h,u(),h!==""&&(o.timer=+setTimeout(()=>{c(""),u()},s))}return c(a),g}),F(this,"update",(n,r)=>{let o=this.items.findIndex(i=>this.getItemValue(i)===n);return o===-1?this:this.copy([...this.items.slice(0,o),r,...this.items.slice(o+1)])}),F(this,"insert",(n,...r)=>this.copy(Je(this.items,n,...r))),F(this,"insertBefore",(n,...r)=>{let o=this.indexOf(n);if(o===-1)if(this.items.length===0)o=0;else return this;return this.copy(Je(this.items,o,...r))}),F(this,"insertAfter",(n,...r)=>{let o=this.indexOf(n);if(o===-1)if(this.items.length===0)o=0;else return this;return this.copy(Je(this.items,o+1,...r))}),F(this,"prepend",(...n)=>this.copy(Je(this.items,0,...n))),F(this,"append",(...n)=>this.copy(Je(this.items,this.items.length,...n))),F(this,"remove",(...n)=>{const r=n.map(o=>typeof o=="string"?o:this.getItemValue(o));return this.copy(this.items.filter(o=>{const i=this.getItemValue(o);return i==null?!1:!r.includes(i)}))}),F(this,"move",(n,r)=>{const o=this.indexOf(n);return o===-1?this:this.copy(Tr(this.items,[o],r))}),F(this,"reorder",(n,r)=>this.copy(Tr(this.items,[n],r))),F(this,"compareValue",(n,r)=>{const o=this.indexOf(n),i=this.indexOf(r);return o<i?-1:o>i?1:0}),F(this,"range",(n,r)=>{let o=[],i=n;for(;i!=null;){if(this.find(i)&&o.push(i),i===r)return o;i=this.getNextValue(i)}return[]}),F(this,"getValueRange",(n,r)=>n&&r?this.compareValue(n,r)<=0?this.range(n,r):this.range(r,n):[]),F(this,"toString",()=>{let n="";for(const r of this.items){const o=this.getItemValue(r),i=this.stringifyItem(r),s=this.getItemDisabled(r),a=[o,i,s].filter(Boolean).join(":");n+=a+","}return n}),F(this,"toJSON",()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let t=0;for(;this.getItemDisabled(this.at(t));)t++;return this.getItemValue(this.at(t))}get lastValue(){let t=this.size-1;for(;this.getItemDisabled(this.at(t));)t--;return this.getItemValue(this.at(t))}*[Symbol.iterator](){yield*this.items}},Wc=(e,t)=>!!(e!=null&&e.toLowerCase().startsWith(t.toLowerCase())),Kc=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]);function Je(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function Tr(e,t,n){t=[...t].sort((o,i)=>o-i);const r=t.map(o=>e[o]);for(let o=t.length-1;o>=0;o--)e=[...e.slice(0,t[o]),...e.slice(t[o]+1)];return n=Math.max(0,n-t.filter(o=>o<n).length),[...e.slice(0,n),...r,...e.slice(n)]}const Uc=e=>new Yn(e);var Fe=new WeakMap,bt=new WeakMap,Et={},on=0,Ro=e=>e&&(e.host||Ro(e.parentNode)),qc=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ro(n);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),Xc=e=>e.localName==="next-route-announcer"||e.localName==="script"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),Yc=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:o}=t,i=qc(n,Array.isArray(e)?e:[e]);Et[r]||(Et[r]=new WeakMap);const s=Et[r],a=[],d=new Set,l=new Set(i),f=u=>{!u||d.has(u)||(d.add(u),f(u.parentNode))};i.forEach(f);const g=u=>{!u||l.has(u)||Array.prototype.forEach.call(u.children,c=>{if(d.has(c))g(c);else try{if(Xc(c))return;const p=c.getAttribute(o)==="true",m=(Fe.get(c)||0)+1,v=(s.get(c)||0)+1;Fe.set(c,m),s.set(c,v),a.push(c),m===1&&p&&bt.set(c,!0),v===1&&c.setAttribute(r,""),p||c.setAttribute(o,"true")}catch(h){console.error("[zag-js > ariaHidden] cannot operate on ",c,h)}})};return g(n),d.clear(),on++,()=>{a.forEach(u=>{const c=Fe.get(u)-1,h=s.get(u)-1;Fe.set(u,c),s.set(u,h),c||(bt.has(u)||u.removeAttribute(o),bt.delete(u)),h||u.removeAttribute(r)}),on--,on||(Fe=new WeakMap,Fe=new WeakMap,bt=new WeakMap,Et={})}},zc=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,Jc=(e,t=zc(e),n="data-aria-hidden")=>{if(t)return Yc(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden"})},Zc=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function Qc(e,t={}){const{defer:n=!0}=t,r=n?Zc:i=>i(),o=[];return o.push(r(()=>{const s=(typeof e=="function"?e():e).filter(Boolean);s.length!==0&&o.push(Jc(s))})),()=>{o.forEach(i=>i==null?void 0:i())}}const[el,Ne]=U({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),ko=y.forwardRef((e,t)=>{const n=Ne(),r=co(),o=qt({...r,present:n.open}),i=S(n.getBackdropProps(),o.getPresenceProps(),e);return o.unmounted?null:C.jsx(V.div,{...i,ref:dt(o.ref,t)})});ko.displayName="DialogBackdrop";const So=y.forwardRef((e,t)=>{const n=Ne(),r=S(n.getCloseTriggerProps(),e);return C.jsx(V.button,{...r,ref:t})});So.displayName="DialogCloseTrigger";const No=y.forwardRef((e,t)=>{const n=Ne(),r=gt(),o=S(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:C.jsx(V.div,{...o,ref:dt(r.ref,t)})});No.displayName="DialogContent";const Ao=y.forwardRef((e,t)=>{const n=Ne(),r=S(n.getDescriptionProps(),e);return C.jsx(V.div,{...r,ref:t})});Ao.displayName="DialogDescription";const Vo=y.forwardRef((e,t)=>{const n=Ne(),r=S(n.getPositionerProps(),e);return gt().unmounted?null:C.jsx(V.div,{...r,ref:t})});Vo.displayName="DialogPositioner";var tl=Object.defineProperty,nl=(e,t,n)=>t in e?tl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t,n)=>nl(e,typeof t!="symbol"?t+"":t,n),wr={activateTrap(e,t){if(e.length>0){const r=e[e.length-1];r!==t&&r.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},rl=[],ol=class{constructor(e,t){M(this,"trapStack"),M(this,"config"),M(this,"doc"),M(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),M(this,"listenerCleanups",[]),M(this,"handleFocus",r=>{const o=K(r),i=this.findContainerIndex(o,r)>=0;if(i||Sn(o))i&&(this.state.mostRecentlyFocusedNode=o);else{r.stopImmediatePropagation();let s,a=!0;if(this.state.mostRecentlyFocusedNode)if(Ye(this.state.mostRecentlyFocusedNode)>0){const d=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:l}=this.state.containerGroups[d];if(l.length>0){const f=l.findIndex(g=>g===this.state.mostRecentlyFocusedNode);f>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?f+1<l.length&&(s=l[f+1],a=!1):f-1>=0&&(s=l[f-1],a=!1))}}else this.state.containerGroups.some(d=>d.tabbableNodes.some(l=>Ye(l)>0))||(a=!1);else a=!1;a&&(s=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),s?this.tryFocus(s):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),M(this,"handlePointerDown",r=>{const o=K(r);if(!(this.findContainerIndex(o,r)>=0)){if(Qe(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}Qe(this.config.allowOutsideClick,r)||r.preventDefault()}}),M(this,"handleClick",r=>{const o=K(r);this.findContainerIndex(o,r)>=0||Qe(this.config.clickOutsideDeactivates,r)||Qe(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),M(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const o=this.config.isKeyBackward(r),i=this.findNextNavNode({event:r,isBackward:o});if(!i)return;Ze(r)&&r.preventDefault(),this.tryFocus(i)}}),M(this,"handleEscapeKey",r=>{il(r)&&Qe(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),M(this,"_mutationObserver"),M(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(o=>{o.some(s=>Array.from(s.removedNodes).some(d=>d===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode())})}),M(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map(o=>{var i;(i=this._mutationObserver)==null||i.observe(o,{subtree:!0,childList:!0})})}),M(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!ve(r))if(this.findContainerIndex(this.doc.activeElement)>=0)r=this.doc.activeElement;else{const o=this.state.tabbableGroups[0];r=o&&o.firstTabbableNode||this.getNodeForOption("fallbackFocus")}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),M(this,"tryFocus",r=>{if(r!==!1&&r!==Dr(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,sl(r)&&r.select()}}),M(this,"deactivate",r=>{if(!this.state.active)return this;const o={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...r};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),wr.deactivateTrap(this.trapStack,this);const i=this.getOption(o,"onDeactivate"),s=this.getOption(o,"onPostDeactivate"),a=this.getOption(o,"checkCanReturnFocus"),d=this.getOption(o,"returnFocus","returnFocusOnDeactivate");i==null||i();const l=()=>{xr(()=>{if(d){const f=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(f)}s==null||s()})};if(d&&a){const f=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return a(f).then(l,l),this}return l(),this}),M(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const o=this.getOption(r,"onPause"),i=this.getOption(r,"onPostPause");return this.state.paused=!0,o==null||o(),this.removeListeners(),this.updateObservedNodes(),i==null||i(),this}),M(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const o=this.getOption(r,"onUnpause"),i=this.getOption(r,"onPostUnpause");return this.state.paused=!1,o==null||o(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),i==null||i(),this}),M(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),M(this,"getReturnFocusNode",r=>{const o=this.getNodeForOption("setReturnFocus",{params:[r]});return o||(o===!1?!1:r)}),M(this,"getOption",(r,o,i)=>r&&r[o]!==void 0?r[o]:this.config[i||o]),M(this,"getNodeForOption",(r,{hasFallback:o=!1,params:i=[]}={})=>{let s=this.config[r];if(typeof s=="function"&&(s=s(...i)),s===!0&&(s=void 0),!s){if(s===void 0||s===!1)return s;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let a=s;if(typeof s=="string"){try{a=this.doc.querySelector(s)}catch(d){throw new Error(`\`${r}\` appears to be an invalid selector; error="${d.message}"`)}if(!a&&!o)throw new Error(`\`${r}\` as selector refers to no known node`)}return a}),M(this,"findNextNavNode",r=>{const{event:o,isBackward:i=!1}=r,s=r.target||K(o);this.updateTabbableNodes();let a=null;if(this.state.tabbableGroups.length>0){const d=this.findContainerIndex(s,o),l=d>=0?this.state.containerGroups[d]:void 0;if(d<0)i?a=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:a=this.state.tabbableGroups[0].firstTabbableNode;else if(i){let f=this.state.tabbableGroups.findIndex(({firstTabbableNode:g})=>s===g);if(f<0&&((l==null?void 0:l.container)===s||ve(s)&&!Te(s)&&!(l!=null&&l.nextTabbableNode(s,!1)))&&(f=d),f>=0){const g=f===0?this.state.tabbableGroups.length-1:f-1,u=this.state.tabbableGroups[g];a=Ye(s)>=0?u.lastTabbableNode:u.lastDomTabbableNode}else Ze(o)||(a=l==null?void 0:l.nextTabbableNode(s,!1))}else{let f=this.state.tabbableGroups.findIndex(({lastTabbableNode:g})=>s===g);if(f<0&&((l==null?void 0:l.container)===s||ve(s)&&!Te(s)&&!(l!=null&&l.nextTabbableNode(s)))&&(f=d),f>=0){const g=f===this.state.tabbableGroups.length-1?0:f+1,u=this.state.tabbableGroups[g];a=Ye(s)>=0?u.firstTabbableNode:u.firstDomTabbableNode}else Ze(o)||(a=l==null?void 0:l.nextTabbableNode(s))}}else a=this.getNodeForOption("fallbackFocus");return a}),this.trapStack=t.trapStack||rl;const n={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward(r){return Ze(r)&&!r.shiftKey},isKeyBackward(r){return Ze(r)&&r.shiftKey},...t};this.doc=n.document||ee(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n=typeof(t==null?void 0:t.composedPath)=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:o})=>r.contains(e)||(n==null?void 0:n.includes(r))||o.find(i=>i===e))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=Bt(e),n=$n(e),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,i=n.find(l=>Te(l)),s=n.slice().reverse().find(l=>Te(l)),a=!!t.find(l=>Ye(l)>0);function d(l,f=!0){const g=t.indexOf(l);return g<0?f?n.slice(n.indexOf(l)+1).find(u=>Te(u)):n.slice(0,n.indexOf(l)).reverse().find(u=>Te(u)):t[g+(f?1:-1)]}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:a,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:i,lastDomTabbableNode:s,nextTabbableNode:d}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return wr.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?xr(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(j(this.doc,"focusin",this.handleFocus,!0),j(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),j(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),j(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),j(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),j(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const t=this.getOption(e,"onActivate"),n=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=this.doc.activeElement||null,t==null||t();const o=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(o,o),this):(o(),this)}},Ze=e=>e.key==="Tab",Qe=(e,...t)=>typeof e=="function"?e(...t):e,il=e=>!e.isComposing&&e.key==="Escape",xr=e=>setTimeout(e,0),sl=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function al(e,t={}){let n;const r=H(()=>{const o=typeof e=="function"?e():e;if(o){n=new ol(o,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:o,...t,document:ee(o)});try{n.activate()}catch(i){}}});return function(){n==null||n.deactivate(),r()}}var sn="data-scroll-lock";function cl(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function ll(e){var u;const t=e!=null?e:document,n=(u=t.defaultView)!=null?u:window,{documentElement:r,body:o}=t;if(o.hasAttribute(sn))return;o.setAttribute(sn,"");const s=n.innerWidth-r.clientWidth,a=()=>_s(r,"--scrollbar-width",`${s}px`),d=cl(r),l=()=>Ot(o,{overflow:"hidden",[d]:`${s}px`}),f=()=>{var I,T;const{scrollX:c,scrollY:h,visualViewport:p}=n,m=(I=p==null?void 0:p.offsetLeft)!=null?I:0,v=(T=p==null?void 0:p.offsetTop)!=null?T:0,E=Ot(o,{position:"fixed",overflow:"hidden",top:`${-(h-Math.floor(v))}px`,left:`${-(c-Math.floor(m))}px`,right:"0",[d]:`${s}px`});return()=>{E==null||E(),n.scrollTo({left:c,top:h,behavior:"instant"})}},g=[a(),Mr()?f():l()];return()=>{g.forEach(c=>c==null?void 0:c()),o.removeAttribute(sn)}}var Fo=ge("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Ie=Fo.build(),Lo=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},Do=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},bn=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},$o=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},En=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},In=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},Mo=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},It=e=>e.getById(bn(e)),ul=e=>e.getById(Lo(e)),dl=e=>e.getById(Do(e)),fl=e=>e.getById($o(e)),hl=e=>e.getById(En(e)),gl=e=>e.getById(In(e)),pl=e=>e.getById(Mo(e));function ml(e,t){const{state:n,send:r,context:o,prop:i,scope:s}=e,a=i("aria-label"),d=n.matches("open");return{open:d,setOpen(l){n.matches("open")!==l&&r({type:l?"OPEN":"CLOSE"})},getTriggerProps(){return t.button({...Ie.trigger.attrs,dir:i("dir"),id:$o(s),"aria-haspopup":"dialog",type:"button","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":bn(s),onClick(l){l.defaultPrevented||r({type:"TOGGLE"})}})},getBackdropProps(){return t.element({...Ie.backdrop.attrs,dir:i("dir"),hidden:!d,id:Do(s),"data-state":d?"open":"closed"})},getPositionerProps(){return t.element({...Ie.positioner.attrs,dir:i("dir"),id:Lo(s),style:{pointerEvents:d?void 0:"none"}})},getContentProps(){const l=o.get("rendered");return t.element({...Ie.content.attrs,dir:i("dir"),role:i("role"),hidden:!d,id:bn(s),tabIndex:-1,"data-state":d?"open":"closed","aria-modal":!0,"aria-label":a||void 0,"aria-labelledby":a||!l.title?void 0:En(s),"aria-describedby":l.description?In(s):void 0})},getTitleProps(){return t.element({...Ie.title.attrs,dir:i("dir"),id:En(s)})},getDescriptionProps(){return t.element({...Ie.description.attrs,dir:i("dir"),id:In(s)})},getCloseTriggerProps(){return t.button({...Ie.closeTrigger.attrs,dir:i("dir"),id:Mo(s),type:"button",onClick(l){l.defaultPrevented||(l.stopPropagation(),r({type:"CLOSE"}))}})}}}var vl={props({props:e,scope:t}){const n=e.role==="alertdialog";return{role:"dialog",modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:n?()=>pl(t):void 0,...e}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return so(()=>It(e),{defer:!0,pointerBlocking:n("modal"),exclude:[fl(e)],onInteractOutside(o){var i;(i=n("onInteractOutside"))==null||i(o),n("closeOnInteractOutside")||o.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onEscapeKeyDown(o){var i;(i=n("onEscapeKeyDown"))==null||i(o),n("closeOnEscape")||o.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return ll(e.getDoc())},trapFocus({scope:e,prop:t}){return!t("trapFocus")||!t("modal")?void 0:al(()=>It(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var o,i;return(i=(o=t("finalFocusEl"))==null?void 0:o())!=null?i:r}})},hideContentBelow({scope:e,prop:t}){return t("modal")?Qc(()=>[It(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){H(()=>{e.set("rendered",{title:!!hl(t),description:!!gl(t)})})},syncZIndex({scope:e}){H(()=>{const t=It(e);if(!t)return;const n=Nn(t);[ul(e),dl(e)].forEach(o=>{o==null||o.style.setProperty("--z-index",n.zIndex)})})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};te()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const yl=e=>{const t=y.useId(),{getRootNode:n}=ke(),{dir:r}=Ke(),o={id:t,getRootNode:n,dir:r,...e},i=Re(vl,o);return ml(i,We)},bl=e=>{const[t,{children:n,...r}]=Po(e),[o]=lo(t),i=yl(r),s=qt(S({present:i.open},t));return C.jsx(el,{value:i,children:C.jsx(ao,{value:o,children:C.jsx(Xn,{value:s,children:n})})})},Go=y.forwardRef((e,t)=>{const n=Ne(),r=S(n.getTitleProps(),e);return C.jsx(V.h2,{...r,ref:t})});Go.displayName="DialogTitle";const Bo=y.forwardRef((e,t)=>{const n=Ne(),r=gt(),o=S({...n.getTriggerProps(),"aria-controls":r.unmounted?void 0:n.getTriggerProps()["aria-controls"]},e);return C.jsx(V.button,{...o,ref:t})});Bo.displayName="DialogTrigger";const El=e=>{var d;const{children:t,disabled:n}=e,[r,o]=y.useState((d=e.container)==null?void 0:d.current),i=y.useSyncExternalStore(Cl,()=>!1,()=>!0),{getRootNode:s}=ke();if(y.useEffect(()=>{o(()=>{var l;return(l=e.container)==null?void 0:l.current})},[e.container]),i||n)return C.jsx(C.Fragment,{children:t});const a=r!=null?r:Il(s);return C.jsx(C.Fragment,{children:y.Children.map(t,l=>Ft.createPortal(l,a))})},Il=e=>{const t=e==null?void 0:e(),n=t.getRootNode();return He(n)?n:ee(t).body},Cl=()=>()=>{},[Ho,Xe]=U({name:"RadioGroupContext",hookName:"useRadioGroupContext",providerName:"<RadioGroupProvider />"}),Tl=e=>e.children(Xe()),[wl,Cu]=U({name:"RadioGroupItemContext",hookName:"useRadioGroupItemContext",providerName:"<RadioGroupItemProvider />"}),[xl,zn]=U({name:"RadioGroupItemPropsContext",hookName:"useRadioGroupItemPropsContext",providerName:"<RadioGroupItemPropsProvider />"}),_o=y.forwardRef((e,t)=>{const[n,r]=Y()(e,["value","disabled","invalid"]),o=Xe(),i=S(o.getItemProps(n),r),s=o.getItemState(n);return C.jsx(wl,{value:s,children:C.jsx(xl,{value:n,children:C.jsx(V.label,{...i,ref:t})})})});_o.displayName="RadioGroupItem";const jo=y.forwardRef((e,t)=>{const n=Xe(),r=zn(),o=S(n.getItemControlProps(r),e);return C.jsx(V.div,{...o,ref:t})});jo.displayName="RadioGroupItemControl";const Wo=y.forwardRef((e,t)=>{const n=Xe(),r=zn(),o=S(n.getItemHiddenInputProps(r),e);return C.jsx(V.input,{...o,ref:t})});Wo.displayName="RadioGroupItemHiddenInput";const Ko=y.forwardRef((e,t)=>{const n=Xe(),r=zn(),o=S(n.getItemTextProps(r),e);return C.jsx(V.span,{...o,ref:t})});Ko.displayName="RadioGroupItemText";const Uo=y.forwardRef((e,t)=>{const n=Xe(),r=S(n.getLabelProps(),e);return C.jsx(V.label,{...r,ref:t})});Uo.displayName="RadioGroupLabel";var qo=ge("radio-group").parts("root","label","item","itemText","itemControl","indicator"),Le=qo.build(),Vt=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`radio-group:${e.id}`},Pr=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.label)!=null?n:`radio-group:${e.id}:label`},Xo=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?o:`radio-group:${e.id}:radio:${t}`},Cn=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.itemHiddenInput)==null?void 0:r.call(n,t))!=null?o:`radio-group:${e.id}:radio:input:${t}`},Pl=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.itemControl)==null?void 0:r.call(n,t))!=null?o:`radio-group:${e.id}:radio:control:${t}`},Ol=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.itemLabel)==null?void 0:r.call(n,t))!=null?o:`radio-group:${e.id}:radio:label:${t}`},Yo=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicator)!=null?n:`radio-group:${e.id}:indicator`},Xt=e=>e.getById(Vt(e)),Rl=(e,t)=>e.getById(Cn(e,t)),kl=e=>e.getById(Yo(e)),Sl=e=>{var t;return(t=Xt(e))==null?void 0:t.querySelector("input:not(:disabled)")},Nl=e=>{var t;return(t=Xt(e))==null?void 0:t.querySelector("input:not(:disabled):checked")},Or=e=>{const n=`input[type=radio][data-ownedby='${CSS.escape(Vt(e))}']:not([disabled])`;return Wr(Xt(e),n)},Al=(e,t)=>{if(t)return e.getById(Xo(e,t))},Vl=e=>{var t,n,r,o;return{left:(t=e==null?void 0:e.offsetLeft)!=null?t:0,top:(n=e==null?void 0:e.offsetTop)!=null?n:0,width:(r=e==null?void 0:e.offsetWidth)!=null?r:0,height:(o=e==null?void 0:e.offsetHeight)!=null?o:0}},Fl=e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`});function Ll(e,t){const{context:n,send:r,computed:o,prop:i,scope:s}=e,a=o("isDisabled"),d=i("readOnly");function l(u){const c=n.get("focusedValue")===u.value,h=c&&lt();return{value:u.value,invalid:!!u.invalid,disabled:!!u.disabled||a,checked:n.get("value")===u.value,focused:c,focusVisible:h,hovered:n.get("hoveredValue")===u.value,active:n.get("activeValue")===u.value}}function f(u){const c=l(u);return{"data-focus":x(c.focused),"data-focus-visible":x(c.focusVisible),"data-disabled":x(c.disabled),"data-readonly":x(d),"data-state":c.checked?"checked":"unchecked","data-hover":x(c.hovered),"data-invalid":x(c.invalid),"data-orientation":i("orientation"),"data-ssr":x(n.get("ssr"))}}const g=()=>{var c;const u=(c=Nl(s))!=null?c:Sl(s);u==null||u.focus()};return{focus:g,value:n.get("value"),setValue(u){r({type:"SET_VALUE",value:u,isTrusted:!1})},clearValue(){r({type:"SET_VALUE",value:null,isTrusted:!1})},getRootProps(){return t.element({...Le.root.attrs,role:"radiogroup",id:Vt(s),"aria-labelledby":Pr(s),"data-orientation":i("orientation"),"data-disabled":x(a),"aria-orientation":i("orientation"),dir:i("dir"),style:{position:"relative"}})},getLabelProps(){return t.element({...Le.label.attrs,dir:i("dir"),"data-orientation":i("orientation"),"data-disabled":x(a),id:Pr(s),onClick:g})},getItemState:l,getItemProps(u){const c=l(u);return t.label({...Le.item.attrs,dir:i("dir"),id:Xo(s,u.value),htmlFor:Cn(s,u.value),...f(u),onPointerMove(){c.disabled||c.hovered||r({type:"SET_HOVERED",value:u.value,hovered:!0})},onPointerLeave(){c.disabled||r({type:"SET_HOVERED",value:null})},onPointerDown(h){c.disabled||(c.focused&&h.pointerType==="mouse"&&h.preventDefault(),r({type:"SET_ACTIVE",value:u.value,active:!0}))},onPointerUp(){c.disabled||r({type:"SET_ACTIVE",value:null})},onClick(){var h;!c.disabled&&Vn()&&((h=Rl(s,u.value))==null||h.focus())}})},getItemTextProps(u){return t.element({...Le.itemText.attrs,dir:i("dir"),id:Ol(s,u.value),...f(u)})},getItemControlProps(u){const c=l(u);return t.element({...Le.itemControl.attrs,dir:i("dir"),id:Pl(s,u.value),"data-active":x(c.active),"aria-hidden":!0,...f(u)})},getItemHiddenInputProps(u){const c=l(u);return t.input({"data-ownedby":Vt(s),id:Cn(s,u.value),type:"radio",name:i("name")||i("id"),form:i("form"),value:u.value,onClick(h){if(d){h.preventDefault();return}h.currentTarget.checked&&r({type:"SET_VALUE",value:u.value,isTrusted:!0})},onBlur(){r({type:"SET_FOCUSED",value:null,focused:!1})},onFocus(){r({type:"SET_FOCUSED",value:u.value,focused:!0})},onKeyDown(h){h.defaultPrevented||h.key===" "&&r({type:"SET_ACTIVE",value:u.value,active:!0})},onKeyUp(h){h.defaultPrevented||h.key===" "&&r({type:"SET_ACTIVE",value:null})},disabled:c.disabled,defaultChecked:c.checked,style:Ht})},getIndicatorProps(){const u=n.get("indicatorRect");return t.element({id:Yo(s),...Le.indicator.attrs,dir:i("dir"),hidden:n.get("value")==null,"data-disabled":x(a),"data-orientation":i("orientation"),style:{"--transition-property":"left, top, width, height","--left":u==null?void 0:u.left,"--top":u==null?void 0:u.top,"--width":u==null?void 0:u.width,"--height":u==null?void 0:u.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:n.get("canIndicatorTransition")?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[i("orientation")==="horizontal"?"left":"top"]:i("orientation")==="horizontal"?"var(--left)":"var(--top)"}})}}}var{not:Dl}=ut(),$l={props({props:e}){return{orientation:"vertical",...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(n){var r;(r=e("onValueChange"))==null||r({value:n})}})),activeValue:t(()=>({defaultValue:null})),focusedValue:t(()=>({defaultValue:null})),hoveredValue:t(()=>({defaultValue:null})),indicatorRect:t(()=>({defaultValue:{}})),canIndicatorTransition:t(()=>({defaultValue:!1})),fieldsetDisabled:t(()=>({defaultValue:!1})),ssr:t(()=>({defaultValue:!0}))}},refs(){return{indicatorCleanup:null}},computed:{isDisabled:({prop:e,context:t})=>!!e("disabled")||t.get("fieldsetDisabled")},entry:["syncIndicatorRect","syncSsr"],exit:["cleanupObserver"],effects:["trackFormControlState","trackFocusVisible"],watch({track:e,action:t,context:n}){e([()=>n.get("value")],()=>{t(["setIndicatorTransition","syncIndicatorRect","syncInputElements"])})},on:{SET_VALUE:[{guard:Dl("isTrusted"),actions:["setValue","dispatchChangeEvent"]},{actions:["setValue"]}],SET_HOVERED:{actions:["setHovered"]},SET_ACTIVE:{actions:["setActive"]},SET_FOCUSED:{actions:["setFocused"]}},states:{idle:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackFormControlState({context:e,scope:t}){return Gt(Xt(t),{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){e.set("value",e.initial("value"))}})},trackFocusVisible({scope:e}){var t;return qn({root:(t=e.getRootNode)==null?void 0:t.call(e)})}},actions:{setValue({context:e,event:t}){e.set("value",t.value)},setHovered({context:e,event:t}){e.set("hoveredValue",t.value)},setActive({context:e,event:t}){e.set("activeValue",t.value)},setFocused({context:e,event:t}){e.set("focusedValue",t.value)},syncInputElements({context:e,scope:t}){Or(t).forEach(r=>{r.checked=r.value===e.get("value")})},setIndicatorTransition({context:e}){e.set("canIndicatorTransition",ot(e.get("value")))},cleanupObserver({refs:e}){var t;(t=e.get("indicatorCleanup"))==null||t()},syncSsr({context:e}){e.set("ssr",!1)},syncIndicatorRect({context:e,scope:t,refs:n}){var s;if((s=n.get("indicatorCleanup"))==null||s(),!kl(t))return;const r=e.get("value"),o=Al(t,r);if(r==null||!o){e.set("canIndicatorTransition",!1),e.set("indicatorRect",{});return}const i=Ur([o],{measure(a){return Vl(a)},onEntry({rects:a}){e.set("indicatorRect",Fl(a[0]))}});n.set("indicatorCleanup",i)},dispatchChangeEvent({context:e,scope:t}){Or(t).forEach(r=>{const o=r.value===e.get("value");o!==r.checked&&Ln(r,{checked:o})})}}}};te()(["dir","disabled","form","getRootNode","id","ids","name","onValueChange","orientation","readOnly","value","defaultValue"]);te()(["value","disabled","invalid"]);const Ml=e=>{const t=y.useId(),{getRootNode:n}=ke(),{dir:r}=Ke(),o={id:t,dir:r,getRootNode:n,...e},i=Re($l,o);return Ll(i,We)},zo=y.forwardRef((e,t)=>{const[n,r]=Y()(e,["defaultValue","disabled","form","id","ids","name","onValueChange","orientation","readOnly","value"]),o=Ml(n),i=S(o.getRootProps(),r);return C.jsx(Ho,{value:o,children:C.jsx(V.div,{...i,ref:t})})});zo.displayName="RadioGroupRoot";const Jo=y.forwardRef((e,t)=>{const[{value:n},r]=Y()(e,["value"]),o=S(n.getRootProps(),r);return C.jsx(Ho,{value:n,children:C.jsx(V.div,{...o,ref:t})})});Jo.displayName="RadioGroupRootProvider";const[Gl,Ae]=U({name:"SelectContext",hookName:"useSelectContext",providerName:"<SelectProvider />"}),Zo=y.forwardRef((e,t)=>{const n=Ae(),r=gt(),o=S(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:C.jsx(V.div,{...o,ref:dt(r.ref,t)})});Zo.displayName="SelectContent";const Qo=y.forwardRef((e,t)=>{const n=Ae(),r=S(n.getControlProps(),e);return C.jsx(V.div,{...r,ref:t})});Qo.displayName="SelectControl";const[Bl,Tu]=U({name:"SelectItemContext",hookName:"useSelectItemContext",providerName:"<SelectItemProvider />"}),[Hl,wu]=U({name:"SelectItemPropsContext",hookName:"useSelectItemPropsContext",providerName:"<SelectItemPropsProvider />"}),ei=y.forwardRef((e,t)=>{const[n,r]=Y()(e,["item","persistFocus"]),o=Ae(),i=S(o.getItemProps(n),r),s=o.getItemState(n);return C.jsx(Hl,{value:n,children:C.jsx(Bl,{value:s,children:C.jsx(V.div,{...i,ref:t})})})});ei.displayName="SelectItem";const ti=y.forwardRef((e,t)=>{const n=Ae(),r=S(n.getLabelProps(),e);return C.jsx(V.label,{...r,ref:t})});ti.displayName="SelectLabel";const ni=y.forwardRef((e,t)=>{const n=Ae(),r=S(n.getPositionerProps(),e);return gt().unmounted?null:C.jsx(V.div,{...r,ref:t})});ni.displayName="SelectPositioner";var ri=ge("select").parts("label","positioner","trigger","indicator","clearTrigger","item","itemText","itemIndicator","itemGroup","itemGroupLabel","list","content","root","control","valueText"),q=ri.build(),oi=e=>new Yn(e);oi.empty=()=>new Yn({items:[]});var _l=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`select:${e.id}`},Tn=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`select:${e.id}:content`},wn=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`select:${e.id}:trigger`},ii=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.clearTrigger)!=null?n:`select:${e.id}:clear-trigger`},Ct=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.label)!=null?n:`select:${e.id}:label`},jl=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.control)!=null?n:`select:${e.id}:control`},xn=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?o:`select:${e.id}:option:${t}`},Pn=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.hiddenSelect)!=null?n:`select:${e.id}:select`},si=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`select:${e.id}:positioner`},Wl=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.itemGroup)==null?void 0:r.call(n,t))!=null?o:`select:${e.id}:optgroup:${t}`},Rr=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.itemGroupLabel)==null?void 0:r.call(n,t))!=null?o:`select:${e.id}:optgroup-label:${t}`},an=e=>e.getById(Pn(e)),et=e=>e.getById(Tn(e)),we=e=>e.getById(wn(e)),Kl=e=>e.getById(ii(e)),kr=e=>e.getById(si(e)),Ul=(e,t)=>e.getById(xn(e,t));function ql(e,t){const{context:n,prop:r,scope:o,state:i,computed:s,send:a}=e,d=r("disabled")||n.get("fieldsetDisabled"),l=r("invalid"),f=r("readOnly"),g=r("composite"),u=r("collection"),c=i.hasTag("open"),h=i.matches("focused"),p=n.get("highlightedValue"),m=n.get("highlightedItem"),v=n.get("selectedItems"),E=n.get("currentPlacement"),I=s("isTypingAhead"),T=s("isInteractive"),R=p?xn(o,p):void 0;function k(b){const w=u.getItemDisabled(b.item),A=u.getItemValue(b.item);return Vr(A,()=>`[zag-js] No value found for item ${JSON.stringify(b.item)}`),{value:A,disabled:!!(d||w),highlighted:p===A,selected:n.get("value").includes(A)}}const L=dc({...r("positioning"),placement:E});return{open:c,focused:h,empty:n.get("value").length===0,highlightedItem:m,highlightedValue:p,selectedItems:v,hasSelectedItems:s("hasSelectedItems"),value:n.get("value"),valueAsString:n.get("valueAsString"),collection:u,multiple:!!r("multiple"),disabled:!!d,reposition(b={}){a({type:"POSITIONING.SET",options:b})},focus(){var b;(b=we(o))==null||b.focus({preventScroll:!0})},setOpen(b){i.hasTag("open")!==b&&a({type:b?"OPEN":"CLOSE"})},selectValue(b){a({type:"ITEM.SELECT",value:b})},setValue(b){a({type:"VALUE.SET",value:b})},selectAll(){a({type:"VALUE.SET",value:u.getValues()})},highlightValue(b){a({type:"HIGHLIGHTED_VALUE.SET",value:b})},clearValue(b){a(b?{type:"ITEM.CLEAR",value:b}:{type:"VALUE.CLEAR"})},getItemState:k,getRootProps(){return t.element({...q.root.attrs,dir:r("dir"),id:_l(o),"data-invalid":x(l),"data-readonly":x(f)})},getLabelProps(){return t.label({dir:r("dir"),id:Ct(o),...q.label.attrs,"data-disabled":x(d),"data-invalid":x(l),"data-readonly":x(f),htmlFor:Pn(o),onClick(b){var w;b.defaultPrevented||d||(w=we(o))==null||w.focus({preventScroll:!0})}})},getControlProps(){return t.element({...q.control.attrs,dir:r("dir"),id:jl(o),"data-state":c?"open":"closed","data-focus":x(h),"data-disabled":x(d),"data-invalid":x(l)})},getValueTextProps(){return t.element({...q.valueText.attrs,dir:r("dir"),"data-disabled":x(d),"data-invalid":x(l),"data-focus":x(h)})},getTriggerProps(){return t.button({id:wn(o),disabled:d,dir:r("dir"),type:"button",role:"combobox","aria-controls":Tn(o),"aria-expanded":c,"aria-haspopup":"listbox","data-state":c?"open":"closed","aria-invalid":l,"aria-labelledby":Ct(o),...q.trigger.attrs,"data-disabled":x(d),"data-invalid":x(l),"data-readonly":x(f),"data-placement":E,"data-placeholder-shown":x(!s("hasSelectedItems")),onClick(b){T&&(b.defaultPrevented||a({type:"TRIGGER.CLICK"}))},onFocus(){a({type:"TRIGGER.FOCUS"})},onBlur(){a({type:"TRIGGER.BLUR"})},onKeyDown(b){if(b.defaultPrevented||!T)return;const A={ArrowUp(){a({type:"TRIGGER.ARROW_UP"})},ArrowDown(G){a({type:G.altKey?"OPEN":"TRIGGER.ARROW_DOWN"})},ArrowLeft(){a({type:"TRIGGER.ARROW_LEFT"})},ArrowRight(){a({type:"TRIGGER.ARROW_RIGHT"})},Home(){a({type:"TRIGGER.HOME"})},End(){a({type:"TRIGGER.END"})},Enter(){a({type:"TRIGGER.ENTER"})},Space(G){a(I?{type:"TRIGGER.TYPEAHEAD",key:G.key}:{type:"TRIGGER.ENTER"})}}[un(b,{dir:r("dir"),orientation:"vertical"})];if(A){A(b),b.preventDefault();return}fn.isValidEvent(b)&&(a({type:"TRIGGER.TYPEAHEAD",key:b.key}),b.preventDefault())}})},getIndicatorProps(){return t.element({...q.indicator.attrs,dir:r("dir"),"aria-hidden":!0,"data-state":c?"open":"closed","data-disabled":x(d),"data-invalid":x(l),"data-readonly":x(f)})},getItemProps(b){const w=k(b);return t.element({id:xn(o,w.value),role:"option",...q.item.attrs,dir:r("dir"),"data-value":w.value,"aria-selected":w.selected,"data-state":w.selected?"checked":"unchecked","data-highlighted":x(w.highlighted),"data-disabled":x(w.disabled),"aria-disabled":Wi(w.disabled),onPointerMove(A){w.disabled||A.pointerType!=="mouse"||w.value!==p&&a({type:"ITEM.POINTER_MOVE",value:w.value})},onClick(A){A.defaultPrevented||w.disabled||a({type:"ITEM.CLICK",src:"pointerup",value:w.value})},onPointerLeave(A){var $;w.disabled||b.persistFocus||A.pointerType!=="mouse"||!(($=e.event.previous())!=null&&$.type.includes("POINTER"))||a({type:"ITEM.POINTER_LEAVE"})}})},getItemTextProps(b){const w=k(b);return t.element({...q.itemText.attrs,"data-state":w.selected?"checked":"unchecked","data-disabled":x(w.disabled),"data-highlighted":x(w.highlighted)})},getItemIndicatorProps(b){const w=k(b);return t.element({"aria-hidden":!0,...q.itemIndicator.attrs,"data-state":w.selected?"checked":"unchecked",hidden:!w.selected})},getItemGroupLabelProps(b){const{htmlFor:w}=b;return t.element({...q.itemGroupLabel.attrs,id:Rr(o,w),dir:r("dir"),role:"presentation"})},getItemGroupProps(b){const{id:w}=b;return t.element({...q.itemGroup.attrs,"data-disabled":x(d),id:Wl(o,w),"aria-labelledby":Rr(o,w),role:"group",dir:r("dir")})},getClearTriggerProps(){return t.button({...q.clearTrigger.attrs,id:ii(o),type:"button","aria-label":"Clear value","data-invalid":x(l),disabled:d,hidden:!s("hasSelectedItems"),dir:r("dir"),onClick(b){b.defaultPrevented||a({type:"CLEAR.CLICK"})}})},getHiddenSelectProps(){const b=n.get("value"),w=r("multiple")?b:b==null?void 0:b[0];return t.select({name:r("name"),form:r("form"),disabled:d,multiple:r("multiple"),required:r("required"),"aria-hidden":!0,id:Pn(o),defaultValue:w,style:Ht,tabIndex:-1,onFocus(){var A;(A=we(o))==null||A.focus({preventScroll:!0})},"aria-labelledby":Ct(o)})},getPositionerProps(){return t.element({...q.positioner.attrs,dir:r("dir"),id:si(o),style:L.floating})},getContentProps(){return t.element({hidden:!c,dir:r("dir"),id:Tn(o),role:g?"listbox":"dialog",...q.content.attrs,"data-state":c?"open":"closed","data-placement":E,"data-activedescendant":R,"aria-activedescendant":g?R:void 0,"aria-multiselectable":r("multiple")&&g?!0:void 0,"aria-labelledby":Ct(o),tabIndex:0,onKeyDown(b){if(!T||!Gr(b))return;if(b.key==="Tab"&&!Rs(b)){b.preventDefault();return}const w={ArrowUp(){a({type:"CONTENT.ARROW_UP"})},ArrowDown(){a({type:"CONTENT.ARROW_DOWN"})},Home(){a({type:"CONTENT.HOME"})},End(){a({type:"CONTENT.END"})},Enter(){a({type:"ITEM.CLICK",src:"keydown.enter"})},Space($){var z;I?a({type:"CONTENT.TYPEAHEAD",key:$.key}):(z=w.Enter)==null||z.call(w,$)}},A=w[un(b)];if(A){A(b),b.preventDefault();return}const G=K(b);Lr(G)||fn.isValidEvent(b)&&(a({type:"CONTENT.TYPEAHEAD",key:b.key}),b.preventDefault())}})},getListProps(){return t.element({...q.list.attrs,tabIndex:0,role:g?void 0:"listbox","aria-labelledby":wn(o),"aria-activedescendant":g?void 0:R,"aria-multiselectable":!g&&r("multiple")?!0:void 0})}}}var{and:tt,not:Ce,or:Xl}=ut(),Yl={props({props:e}){var t;return{loopFocus:!1,closeOnSelect:!e.multiple,composite:!0,defaultValue:[],...e,collection:(t=e.collection)!=null?t:oi.empty(),positioning:{placement:"bottom-start",gutter:8,...e.positioning}}},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:Lt,onChange(n){var o;const r=e("collection").findMany(n);return(o=e("onValueChange"))==null?void 0:o({value:n,items:r})}})),highlightedValue:t(()=>({defaultValue:e("defaultHighlightedValue")||null,value:e("highlightedValue"),onChange(n){var r;(r=e("onHighlightChange"))==null||r({highlightedValue:n,highlightedItem:e("collection").find(n),highlightedIndex:e("collection").indexOf(n)})}})),currentPlacement:t(()=>({defaultValue:void 0})),fieldsetDisabled:t(()=>({defaultValue:!1})),highlightedItem:t(()=>({defaultValue:null})),selectedItems:t(()=>{var o,i;const n=(i=(o=e("value"))!=null?o:e("defaultValue"))!=null?i:[];return{defaultValue:e("collection").findMany(n)}}),valueAsString:t(()=>{var r,o;const n=(o=(r=e("value"))!=null?r:e("defaultValue"))!=null?o:[];return{defaultValue:e("collection").stringifyMany(n)}})}},refs(){return{typeahead:{...fn.defaultOptions}}},computed:{hasSelectedItems:({context:e})=>e.get("value").length>0,isTypingAhead:({refs:e})=>e.get("typeahead").keysSoFar!=="",isDisabled:({prop:e,context:t})=>!!e("disabled")||!!t.get("fieldsetDisabled"),isInteractive:({prop:e})=>!(e("disabled")||e("readOnly"))},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"idle"},entry:["syncSelectElement"],watch({context:e,prop:t,track:n,action:r}){n([()=>e.get("value").toString()],()=>{r(["syncSelectedItems","syncSelectElement","dispatchChangeEvent"])}),n([()=>t("open")],()=>{r(["toggleVisibility"])}),n([()=>e.get("highlightedValue")],()=>{r(["syncHighlightedItem"])}),n([()=>t("collection").toString()],()=>{r(["syncCollection"])})},on:{"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedItem"]},"ITEM.SELECT":{actions:["selectItem"]},"ITEM.CLEAR":{actions:["clearItem"]},"VALUE.SET":{actions:["setSelectedItems"]},"VALUE.CLEAR":{actions:["clearSelectedItems"]},"CLEAR.CLICK":{actions:["clearSelectedItems","focusTriggerEl"]}},effects:["trackFormControlState"],states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":[{guard:"isTriggerClickEvent",target:"open",actions:["setInitialFocus","highlightFirstSelectedItem"]},{target:"open",actions:["setInitialFocus"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus","highlightFirstSelectedItem"]}],"TRIGGER.FOCUS":{target:"focused"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":[{guard:"isTriggerClickEvent",target:"open",actions:["setInitialFocus","highlightFirstSelectedItem"]},{guard:"isTriggerArrowUpEvent",target:"open",actions:["setInitialFocus","highlightComputedLastItem"]},{guard:Xl("isTriggerArrowDownEvent","isTriggerEnterEvent"),target:"open",actions:["setInitialFocus","highlightComputedFirstItem"]},{target:"open",actions:["setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen"]}],"TRIGGER.BLUR":{target:"idle"},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightFirstSelectedItem"]}],"TRIGGER.ENTER":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedFirstItem"]}],"TRIGGER.ARROW_UP":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedLastItem"]}],"TRIGGER.ARROW_DOWN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedFirstItem"]}],"TRIGGER.ARROW_LEFT":[{guard:tt(Ce("multiple"),"hasSelectedItems"),actions:["selectPreviousItem"]},{guard:Ce("multiple"),actions:["selectLastItem"]}],"TRIGGER.ARROW_RIGHT":[{guard:tt(Ce("multiple"),"hasSelectedItems"),actions:["selectNextItem"]},{guard:Ce("multiple"),actions:["selectFirstItem"]}],"TRIGGER.HOME":{guard:Ce("multiple"),actions:["selectFirstItem"]},"TRIGGER.END":{guard:Ce("multiple"),actions:["selectLastItem"]},"TRIGGER.TYPEAHEAD":{guard:Ce("multiple"),actions:["selectMatchingItem"]}}},open:{tags:["open"],exit:["scrollContentToTop"],effects:["trackDismissableElement","computePlacement","scrollToHighlightedItem"],on:{"CONTROLLED.CLOSE":{target:"focused",actions:["focusTriggerEl","clearHighlightedItem"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","focusTriggerEl","clearHighlightedItem"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","clearHighlightedItem"]}],"ITEM.CLICK":[{guard:tt("closeOnSelect","isOpenControlled"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","focusTriggerEl","clearHighlightedItem"]},{actions:["selectHighlightedItem"]}],"CONTENT.HOME":{actions:["highlightFirstItem"]},"CONTENT.END":{actions:["highlightLastItem"]},"CONTENT.ARROW_DOWN":[{guard:tt("hasHighlightedItem","loop","isLastItemHighlighted"),actions:["highlightFirstItem"]},{guard:"hasHighlightedItem",actions:["highlightNextItem"]},{actions:["highlightFirstItem"]}],"CONTENT.ARROW_UP":[{guard:tt("hasHighlightedItem","loop","isFirstItemHighlighted"),actions:["highlightLastItem"]},{guard:"hasHighlightedItem",actions:["highlightPreviousItem"]},{actions:["highlightLastItem"]}],"CONTENT.TYPEAHEAD":{actions:["highlightMatchingItem"]},"ITEM.POINTER_MOVE":{actions:["highlightItem"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedItem"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{loop:({prop:e})=>!!e("loopFocus"),multiple:({prop:e})=>!!e("multiple"),hasSelectedItems:({computed:e})=>!!e("hasSelectedItems"),hasHighlightedItem:({context:e})=>e.get("highlightedValue")!=null,isFirstItemHighlighted:({context:e,prop:t})=>e.get("highlightedValue")===t("collection").firstValue,isLastItemHighlighted:({context:e,prop:t})=>e.get("highlightedValue")===t("collection").lastValue,closeOnSelect:({prop:e,event:t})=>{var n;return!!((n=t.closeOnSelect)!=null?n:e("closeOnSelect"))},isOpenControlled:({prop:e})=>e("open")!==void 0,isTriggerClickEvent:({event:e})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="TRIGGER.CLICK"},isTriggerEnterEvent:({event:e})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="TRIGGER.ENTER"},isTriggerArrowUpEvent:({event:e})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="TRIGGER.ARROW_UP"},isTriggerArrowDownEvent:({event:e})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="TRIGGER.ARROW_DOWN"}},effects:{trackFormControlState({context:e,scope:t}){return Gt(an(t),{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){const n=e.initial("value");e.set("value",n)}})},trackDismissableElement({scope:e,send:t,prop:n}){const r=()=>et(e);let o=!0;return so(r,{defer:!0,exclude:[we(e),Kl(e)],onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onInteractOutside(i){var s;(s=n("onInteractOutside"))==null||s(i),o=!(i.detail.focusable||i.detail.contextmenu)},onDismiss(){t({type:"CLOSE",src:"interact-outside",restoreFocus:o})}})},computePlacement({context:e,prop:t,scope:n}){const r=t("positioning");return e.set("currentPlacement",r.placement),gr(()=>we(n),()=>kr(n),{defer:!0,...r,onComplete(s){e.set("currentPlacement",s.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n,event:r}){const o=s=>{const a=e.get("highlightedValue");if(a==null||r.current().type.includes("POINTER"))return;const d=Ul(n,a),l=et(n),f=t("scrollToIndexFn");if(f){const g=t("collection").indexOf(a);f==null||f({index:g,immediate:s});return}Ls(d,{rootEl:l,block:"nearest"})};return H(()=>o(!0)),Ns(()=>et(n),{attributes:["data-activedescendant"],callback(){o(!1)}})}},actions:{reposition({context:e,prop:t,scope:n,event:r}){const o=()=>kr(n);gr(we(n),o,{...t("positioning"),...r.options,defer:!0,listeners:!1,onComplete(i){e.set("currentPlacement",i.placement)}})},toggleVisibility({send:e,prop:t,event:n}){e({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})},highlightPreviousItem({context:e,prop:t}){const n=e.get("highlightedValue");if(n==null)return;const r=t("collection").getPreviousValue(n,1,t("loopFocus"));e.set("highlightedValue",r)},highlightNextItem({context:e,prop:t}){const n=e.get("highlightedValue");if(n==null)return;const r=t("collection").getNextValue(n,1,t("loopFocus"));e.set("highlightedValue",r)},highlightFirstItem({context:e,prop:t}){const n=t("collection").firstValue;e.set("highlightedValue",n)},highlightLastItem({context:e,prop:t}){const n=t("collection").lastValue;e.set("highlightedValue",n)},setInitialFocus({scope:e}){H(()=>{const t=Os({root:et(e)});t==null||t.focus({preventScroll:!0})})},focusTriggerEl({event:e,scope:t}){var r,o;const n=(o=e.restoreFocus)!=null?o:(r=e.previousEvent)==null?void 0:r.restoreFocus;n!=null&&!n||H(()=>{const i=we(t);i==null||i.focus({preventScroll:!0})})},selectHighlightedItem({context:e,prop:t,event:n}){var i;let r=(i=n.value)!=null?i:e.get("highlightedValue");if(r==null)return;r=t("deselectable")&&!t("multiple")&&e.get("value").includes(r)?null:r,e.set("value",s=>r==null?[]:t("multiple")?er(s,r):[r])},highlightComputedFirstItem({context:e,prop:t,computed:n}){const r=t("collection"),o=n("hasSelectedItems")?r.sort(e.get("value"))[0]:r.firstValue;e.set("highlightedValue",o)},highlightComputedLastItem({context:e,prop:t,computed:n}){const r=t("collection"),o=n("hasSelectedItems")?r.sort(e.get("value"))[0]:r.lastValue;e.set("highlightedValue",o)},highlightFirstSelectedItem({context:e,prop:t,computed:n}){if(!n("hasSelectedItems"))return;const r=t("collection").sort(e.get("value"))[0];e.set("highlightedValue",r)},highlightItem({context:e,event:t}){e.set("highlightedValue",t.value)},highlightMatchingItem({context:e,prop:t,event:n,refs:r}){const o=t("collection").search(n.key,{state:r.get("typeahead"),currentValue:e.get("highlightedValue")});o!=null&&e.set("highlightedValue",o)},setHighlightedItem({context:e,event:t}){e.set("highlightedValue",t.value)},clearHighlightedItem({context:e}){e.set("highlightedValue",null)},selectItem({context:e,prop:t,event:n}){const o=t("deselectable")&&!t("multiple")&&e.get("value").includes(n.value)?null:n.value;e.set("value",i=>o==null?[]:t("multiple")?er(i,o):[o])},clearItem({context:e,event:t}){e.set("value",n=>n.filter(r=>r!==t.value))},setSelectedItems({context:e,event:t}){e.set("value",t.value)},clearSelectedItems({context:e}){e.set("value",[])},selectPreviousItem({context:e,prop:t}){const[n]=e.get("value"),r=t("collection").getPreviousValue(n);r&&e.set("value",[r])},selectNextItem({context:e,prop:t}){const[n]=e.get("value"),r=t("collection").getNextValue(n);r&&e.set("value",[r])},selectFirstItem({context:e,prop:t}){const n=t("collection").firstValue;n&&e.set("value",[n])},selectLastItem({context:e,prop:t}){const n=t("collection").lastValue;n&&e.set("value",[n])},selectMatchingItem({context:e,prop:t,event:n,refs:r}){const o=t("collection").search(n.key,{state:r.get("typeahead"),currentValue:e.get("value")[0]});o!=null&&e.set("value",[o])},scrollContentToTop({prop:e,scope:t}){var n,r;e("scrollToIndexFn")?(n=e("scrollToIndexFn"))==null||n({index:0,immediate:!0}):(r=et(t))==null||r.scrollTo(0,0)},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},syncSelectElement({context:e,prop:t,scope:n}){const r=an(n);if(r){if(e.get("value").length===0&&!t("multiple")){r.selectedIndex=-1;return}for(const o of r.options)o.selected=e.get("value").includes(o.value)}},syncCollection({context:e,prop:t}){const n=t("collection"),r=n.find(e.get("highlightedValue"));r&&e.set("highlightedItem",r);const o=n.findMany(e.get("value"));e.set("selectedItems",o);const i=n.stringifyItems(o);e.set("valueAsString",i)},syncSelectedItems({context:e,prop:t}){const n=t("collection"),r=e.get("selectedItems"),i=e.get("value").map(s=>r.find(d=>n.getItemValue(d)===s)||n.find(s));e.set("selectedItems",i),e.set("valueAsString",n.stringifyItems(i))},syncHighlightedItem({context:e,prop:t}){const n=t("collection"),r=e.get("highlightedValue"),o=r?n.find(r):null;e.set("highlightedItem",o)},dispatchChangeEvent({scope:e}){queueMicrotask(()=>{const t=an(e);if(!t)return;const n=e.getWin(),r=new n.Event("change",{bubbles:!0,composed:!0});t.dispatchEvent(r)})}}}};te()(["closeOnSelect","collection","dir","disabled","deselectable","form","getRootNode","highlightedValue","id","ids","invalid","loopFocus","multiple","name","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onValueChange","defaultOpen","open","composite","positioning","required","readOnly","scrollToIndexFn","value","defaultValue","defaultHighlightedValue"]);te()(["item","persistFocus"]);te()(["id"]);te()(["htmlFor"]);const zl=e=>{const t=y.useId(),{dir:n}=Ke(),{getRootNode:r}=ke(),o=ht(),i={id:t,ids:{label:o==null?void 0:o.ids.label,hiddenSelect:o==null?void 0:o.ids.control},disabled:o==null?void 0:o.disabled,readOnly:o==null?void 0:o.readOnly,invalid:o==null?void 0:o.invalid,required:o==null?void 0:o.required,dir:n,getRootNode:r,...e},s=Re(Yl,i);return ql(s,We)},Jl=(e,t)=>{const[n,r]=Po(e),[o,i]=Y()(r,["closeOnSelect","collection","composite","defaultHighlightedValue","defaultOpen","defaultValue","deselectable","disabled","form","highlightedValue","id","ids","invalid","loopFocus","multiple","name","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onValueChange","open","positioning","readOnly","required","scrollToIndexFn","value"]),s=zl(o),a=qt(S({present:s.open},n)),d=S(s.getRootProps(),i);return C.jsx(Gl,{value:s,children:C.jsx(Xn,{value:a,children:C.jsx(V.div,{...d,ref:t})})})},Zl=y.forwardRef(Jl),ai=y.forwardRef((e,t)=>{const n=Ae(),r=S(n.getTriggerProps(),e);return C.jsx(V.button,{...r,ref:t})});ai.displayName="SelectTrigger";const ci=y.forwardRef((e,t)=>{const{children:n,placeholder:r,...o}=e,i=Ae(),s=S(i.getValueTextProps(),o);return C.jsx(V.span,{...s,ref:t,children:n||i.valueAsString||r})});ci.displayName="SelectValueText";const[li,Yt]=U({name:"SwitchContext",hookName:"useSwitchContext",providerName:"<SwitchProvider />"}),ui=y.forwardRef((e,t)=>{const n=Yt(),r=S(n.getControlProps(),e);return C.jsx(V.span,{...r,ref:t})});ui.displayName="SwitchControl";const di=y.forwardRef((e,t)=>{const n=Yt(),r=S(n.getHiddenInputProps(),e),o=ht();return C.jsx(V.input,{"aria-describedby":o==null?void 0:o.ariaDescribedby,...r,ref:t})});di.displayName="SwitchHiddenInput";const fi=y.forwardRef((e,t)=>{const n=Yt(),r=S(n.getLabelProps(),e);return C.jsx(V.span,{...r,ref:t})});fi.displayName="SwitchLabel";var hi=ge("switch").parts("root","label","control","thumb"),Tt=hi.build(),gi=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`switch:${e.id}`},Sr=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.label)!=null?n:`switch:${e.id}:label`},Ql=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.thumb)!=null?n:`switch:${e.id}:thumb`},eu=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.control)!=null?n:`switch:${e.id}:control`},On=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.hiddenInput)!=null?n:`switch:${e.id}:input`},tu=e=>e.getById(gi(e)),Ge=e=>e.getById(On(e));function nu(e,t){const{context:n,send:r,prop:o,scope:i}=e,s=o("disabled"),a=o("readOnly"),d=!!n.get("checked"),l=!s&&n.get("focused"),f=!s&&n.get("focusVisible"),g={"data-active":x(n.get("active")),"data-focus":x(l),"data-focus-visible":x(f),"data-readonly":x(a),"data-hover":x(n.get("hovered")),"data-disabled":x(s),"data-state":d?"checked":"unchecked","data-invalid":x(o("invalid"))};return{checked:d,disabled:s,focused:l,setChecked(u){r({type:"CHECKED.SET",checked:u,isTrusted:!1})},toggleChecked(){r({type:"CHECKED.TOGGLE",checked:d,isTrusted:!1})},getRootProps(){return t.label({...Tt.root.attrs,...g,dir:o("dir"),id:gi(i),htmlFor:On(i),onPointerMove(){s||r({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){s||r({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(u){var h;if(s)return;K(u)===Ge(i)&&u.stopPropagation(),Vn()&&((h=Ge(i))==null||h.focus())}})},getLabelProps(){return t.element({...Tt.label.attrs,...g,dir:o("dir"),id:Sr(i)})},getThumbProps(){return t.element({...Tt.thumb.attrs,...g,dir:o("dir"),id:Ql(i),"aria-hidden":!0})},getControlProps(){return t.element({...Tt.control.attrs,...g,dir:o("dir"),id:eu(i),"aria-hidden":!0})},getHiddenInputProps(){return t.input({id:On(i),type:"checkbox",required:o("required"),defaultChecked:d,disabled:s,"aria-labelledby":Sr(i),"aria-invalid":o("invalid"),name:o("name"),form:o("form"),value:o("value"),style:Ht,onFocus(){const u=lt();r({type:"CONTEXT.SET",context:{focused:!0,focusVisible:u}})},onBlur(){r({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(u){if(a){u.preventDefault();return}const c=u.currentTarget.checked;r({type:"CHECKED.SET",checked:c,isTrusted:!0})}})}}}var{not:Nr}=ut(),ru={props({props:e}){return{defaultChecked:!1,label:"switch",value:"on",...e}},initialState(){return"ready"},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e("defaultChecked"),value:e("checked"),onChange(n){var r;(r=e("onCheckedChange"))==null||r({checked:n})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},computed:{isDisabled:({context:e,prop:t})=>t("disabled")||e.get("fieldsetDisabled")},watch({track:e,prop:t,context:n,action:r}){e([()=>t("disabled")],()=>{r(["removeFocusIfNeeded"])}),e([()=>n.get("checked")],()=>{r(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:Nr("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:Nr("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({computed:e,scope:t,context:n}){if(!e("isDisabled"))return jr({pointerNode:tu(t),keyboardNode:Ge(t),isValidKey:r=>r.key===" ",onPress:()=>n.set("active",!1),onPressStart:()=>n.set("active",!0),onPressEnd:()=>n.set("active",!1)})},trackFocusVisible({computed:e,scope:t}){if(!e("isDisabled"))return qn({root:t.getRootNode()})},trackFormControlState({context:e,send:t,scope:n}){return Gt(Ge(n),{onFieldsetDisabledChange(r){e.set("fieldsetDisabled",r)},onFormReset(){const r=e.initial("checked");t({type:"CHECKED.SET",checked:!!r,src:"form-reset"})}})}},actions:{setContext({context:e,event:t}){for(const n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,scope:t}){const n=Ge(t);n&&Fn(n,!!e.get("checked"))},removeFocusIfNeeded({context:e,prop:t}){t("disabled")&&e.set("focused",!1)},setChecked({context:e,event:t}){e.set("checked",t.checked)},toggleChecked({context:e}){e.set("checked",!e.get("checked"))},dispatchChangeEvent({context:e,scope:t}){const n=Ge(t);Ln(n,{checked:e.get("checked")})}}}};te()(["checked","defaultChecked","dir","disabled","form","getRootNode","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]);const ou=e=>{const t=y.useId(),{getRootNode:n}=ke(),{dir:r}=Ke(),o=ht(),i={id:t,ids:{label:o==null?void 0:o.ids.label,hiddenInput:o==null?void 0:o.ids.control},dir:r,disabled:o==null?void 0:o.disabled,readOnly:o==null?void 0:o.readOnly,invalid:o==null?void 0:o.invalid,required:o==null?void 0:o.required,getRootNode:n,...e},s=Re(ru,i);return nu(s,We)},pi=y.forwardRef((e,t)=>{const[n,r]=Y()(e,["checked","defaultChecked","disabled","form","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]),o=ou(n),i=S(o.getRootProps(),r);return C.jsx(li,{value:o,children:C.jsx(V.label,{...i,ref:t})})});pi.displayName="SwitchRoot";const mi=y.forwardRef((e,t)=>{const[{value:n},r]=Y()(e,["value"]),o=S(n.getRootProps(),r);return C.jsx(li,{value:n,children:C.jsx(V.label,{...o,ref:t})})});mi.displayName="SwitchRootProvider";const vi=y.forwardRef((e,t)=>{const n=Yt(),r=S(n.getThumbProps(),e);return C.jsx(V.span,{...r,ref:t})});vi.displayName="SwitchThumb";function iu(e,t){const[n,r]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}const[su,zt]=U({name:"TabsContext",hookName:"useTabsContext",providerName:"<TabsProvider />"}),yi=y.forwardRef((e,t)=>{const[n,r]=Y()(e,["value"]),o=zt(),i=co(),s=qt({...i,present:iu(o.value===e.value,0),immediate:!0}),a=S(o.getContentProps(n),s.getPresenceProps(),r);return C.jsx(Xn,{value:s,children:s.unmounted?null:C.jsx(V.div,{...a,ref:dt(s.ref,t)})})});yi.displayName="TabContent";const bi=y.forwardRef((e,t)=>{const n=zt(),r=S(n.getIndicatorProps(),e);return C.jsx(V.div,{...r,ref:t})});bi.displayName="TabIndicator";const Ei=y.forwardRef((e,t)=>{const n=zt(),r=S(n.getListProps(),e);return C.jsx(V.div,{...r,ref:t})});Ei.displayName="TabList";const Ii=y.forwardRef((e,t)=>{const[n,r]=Y()(e,["disabled","value"]),o=zt(),i=S(o.getTriggerProps(n),r);return C.jsx(V.button,{...i,ref:t})});Ii.displayName="TabTrigger";var Ci=ge("tabs").parts("root","list","trigger","content","indicator"),nt=Ci.build(),au=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`tabs:${e.id}`},st=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.list)!=null?n:`tabs:${e.id}:list`},Rn=(e,t)=>{var n,r;return(r=(n=e.ids)==null?void 0:n.content)!=null?r:`tabs:${e.id}:content-${t}`},xe=(e,t)=>{var n,r;return(r=(n=e.ids)==null?void 0:n.trigger)!=null?r:`tabs:${e.id}:trigger-${t}`},Ti=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicator)!=null?n:`tabs:${e.id}:indicator`},cu=e=>e.getById(st(e)),lu=(e,t)=>e.getById(Rn(e,t)),Pt=(e,t)=>e.getById(xe(e,t)),Ar=e=>e.getById(Ti(e)),pt=e=>{const n=`[role=tab][data-ownedby='${CSS.escape(st(e))}']:not([disabled])`;return Wr(cu(e),n)},uu=e=>ki(pt(e)),du=e=>Si(pt(e)),fu=(e,t)=>Ds(pt(e),xe(e,t.value),t.loopFocus),hu=(e,t)=>$s(pt(e),xe(e,t.value),t.loopFocus),wi=e=>{var t,n,r,o;return{left:(t=e==null?void 0:e.offsetLeft)!=null?t:0,top:(n=e==null?void 0:e.offsetTop)!=null?n:0,width:(r=e==null?void 0:e.offsetWidth)!=null?r:0,height:(o=e==null?void 0:e.offsetHeight)!=null?o:0}},gu=(e,t)=>{const n=Kr(pt(e),xe(e,t));return xi(wi(n))},xi=e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`});function pu(e,t){const{state:n,send:r,context:o,prop:i,scope:s}=e,a=i("translations"),d=n.matches("focused"),l=i("orientation")==="vertical",f=i("orientation")==="horizontal",g=i("composite");function u(c){return{selected:o.get("value")===c.value,focused:o.get("focusedValue")===c.value,disabled:!!c.disabled}}return{value:o.get("value"),focusedValue:o.get("focusedValue"),setValue(c){r({type:"SET_VALUE",value:c})},clearValue(){r({type:"CLEAR_VALUE"})},setIndicatorRect(c){const h=xe(s,c);r({type:"SET_INDICATOR_RECT",id:h})},syncTabIndex(){r({type:"SYNC_TAB_INDEX"})},selectNext(c){r({type:"TAB_FOCUS",value:c,src:"selectNext"}),r({type:"ARROW_NEXT",src:"selectNext"})},selectPrev(c){r({type:"TAB_FOCUS",value:c,src:"selectPrev"}),r({type:"ARROW_PREV",src:"selectPrev"})},focus(){var h;const c=o.get("value");c&&((h=Pt(s,c))==null||h.focus())},getRootProps(){return t.element({...nt.root.attrs,id:au(s),"data-orientation":i("orientation"),"data-focus":x(d),dir:i("dir")})},getListProps(){return t.element({...nt.list.attrs,id:st(s),role:"tablist",dir:i("dir"),"data-focus":x(d),"aria-orientation":i("orientation"),"data-orientation":i("orientation"),"aria-label":a==null?void 0:a.listLabel,onKeyDown(c){if(c.defaultPrevented||!Gr(c)||fs(c))return;const h={ArrowDown(){f||r({type:"ARROW_NEXT",key:"ArrowDown"})},ArrowUp(){f||r({type:"ARROW_PREV",key:"ArrowUp"})},ArrowLeft(){l||r({type:"ARROW_PREV",key:"ArrowLeft"})},ArrowRight(){l||r({type:"ARROW_NEXT",key:"ArrowRight"})},Home(){r({type:"HOME"})},End(){r({type:"END"})},Enter(){r({type:"ENTER"})}};let p=un(c,{dir:i("dir"),orientation:i("orientation")});const m=h[p];m&&(c.preventDefault(),m(c))}})},getTriggerState:u,getTriggerProps(c){const{value:h,disabled:p}=c,m=u(c);return t.button({...nt.trigger.attrs,role:"tab",type:"button",disabled:p,dir:i("dir"),"data-orientation":i("orientation"),"data-disabled":x(p),"aria-disabled":p,"data-value":h,"aria-selected":m.selected,"data-selected":x(m.selected),"data-focus":x(m.focused),"aria-controls":m.selected?Rn(s,h):void 0,"data-ownedby":st(s),"data-ssr":x(o.get("ssr")),id:xe(s,h),tabIndex:m.selected&&g?0:-1,onFocus(){r({type:"TAB_FOCUS",value:h})},onBlur(v){const E=v.relatedTarget;(E==null?void 0:E.getAttribute("role"))!=="tab"&&r({type:"TAB_BLUR"})},onClick(v){v.defaultPrevented||p||(Vn()&&v.currentTarget.focus(),r({type:"TAB_CLICK",value:h}))}})},getContentProps(c){const{value:h}=c,p=o.get("value")===h;return t.element({...nt.content.attrs,dir:i("dir"),id:Rn(s,h),tabIndex:g?0:-1,"aria-labelledby":xe(s,h),role:"tabpanel","data-ownedby":st(s),"data-selected":x(p),"data-orientation":i("orientation"),hidden:!p})},getIndicatorProps(){const c=o.get("indicatorRect"),h=o.get("indicatorTransition");return t.element({id:Ti(s),...nt.indicator.attrs,dir:i("dir"),"data-orientation":i("orientation"),style:{"--transition-property":"left, right, top, bottom, width, height","--left":c.left,"--top":c.top,"--width":c.width,"--height":c.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:h?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[f?"left":"top"]:f?"var(--left)":"var(--top)"}})}}}var{not:mu}=ut(),vu={props({props:e}){return{dir:"ltr",orientation:"horizontal",activationMode:"automatic",loopFocus:!0,composite:!0,navigate(t){As(t.node)},defaultValue:null,...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(n){var r;(r=e("onValueChange"))==null||r({value:n})}})),focusedValue:t(()=>({defaultValue:e("value")||e("defaultValue"),sync:!0,onChange(n){var r;(r=e("onFocusChange"))==null||r({focusedValue:n})}})),ssr:t(()=>({defaultValue:!0})),indicatorTransition:t(()=>({defaultValue:!1})),indicatorRect:t(()=>({defaultValue:{left:"0px",top:"0px",width:"0px",height:"0px"}}))}},watch({context:e,prop:t,track:n,action:r}){n([()=>e.get("value")],()=>{r(["allowIndicatorTransition","syncIndicatorRect","syncTabIndex","navigateIfNeeded"])}),n([()=>t("dir"),()=>t("orientation")],()=>{r(["syncIndicatorRect"])})},on:{SET_VALUE:{actions:["setValue"]},CLEAR_VALUE:{actions:["clearValue"]},SET_INDICATOR_RECT:{actions:["setIndicatorRect"]},SYNC_TAB_INDEX:{actions:["syncTabIndex"]}},entry:["syncIndicatorRect","syncTabIndex","syncSsr"],exit:["cleanupObserver"],states:{idle:{on:{TAB_FOCUS:{target:"focused",actions:["setFocusedValue"]},TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]}}},focused:{on:{TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]},ARROW_PREV:[{guard:"selectOnFocus",actions:["focusPrevTab","selectFocusedTab"]},{actions:["focusPrevTab"]}],ARROW_NEXT:[{guard:"selectOnFocus",actions:["focusNextTab","selectFocusedTab"]},{actions:["focusNextTab"]}],HOME:[{guard:"selectOnFocus",actions:["focusFirstTab","selectFocusedTab"]},{actions:["focusFirstTab"]}],END:[{guard:"selectOnFocus",actions:["focusLastTab","selectFocusedTab"]},{actions:["focusLastTab"]}],ENTER:{guard:mu("selectOnFocus"),actions:["selectFocusedTab"]},TAB_FOCUS:{actions:["setFocusedValue"]},TAB_BLUR:{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{selectOnFocus:({prop:e})=>e("activationMode")==="automatic"},actions:{selectFocusedTab({context:e,prop:t}){H(()=>{const n=e.get("focusedValue");if(!n)return;const o=t("deselectable")&&e.get("value")===n?null:n;e.set("value",o)})},setFocusedValue({context:e,event:t,flush:n}){t.value!=null&&n(()=>{e.set("focusedValue",t.value)})},clearFocusedValue({context:e}){e.set("focusedValue",null)},setValue({context:e,event:t,prop:n}){const r=n("deselectable")&&e.get("value")===e.get("focusedValue");e.set("value",r?null:t.value)},clearValue({context:e}){e.set("value",null)},focusFirstTab({scope:e}){H(()=>{var t;(t=uu(e))==null||t.focus()})},focusLastTab({scope:e}){H(()=>{var t;(t=du(e))==null||t.focus()})},focusNextTab({context:e,prop:t,scope:n,event:r}){var s;const o=(s=r.value)!=null?s:e.get("focusedValue");if(!o)return;const i=fu(n,{value:o,loopFocus:t("loopFocus")});H(()=>{t("composite")?i==null||i.focus():(i==null?void 0:i.dataset.value)!=null&&e.set("focusedValue",i.dataset.value)})},focusPrevTab({context:e,prop:t,scope:n,event:r}){var s;const o=(s=r.value)!=null?s:e.get("focusedValue");if(!o)return;const i=hu(n,{value:o,loopFocus:t("loopFocus")});H(()=>{t("composite")?i==null||i.focus():(i==null?void 0:i.dataset.value)!=null&&e.set("focusedValue",i.dataset.value)})},syncTabIndex({context:e,scope:t}){H(()=>{const n=e.get("value");if(!n)return;const r=lu(t,n);if(!r)return;$n(r).length>0?r.removeAttribute("tabindex"):r.setAttribute("tabindex","0")})},cleanupObserver({refs:e}){const t=e.get("indicatorCleanup");t&&t()},allowIndicatorTransition({context:e}){e.set("indicatorTransition",!0)},setIndicatorRect({context:e,event:t,scope:n}){var s;const r=(s=t.id)!=null?s:e.get("value");if(!Ar(n))return;if(!r){e.set("indicatorTransition",!1);return}Pt(n,r)&&(e.set("indicatorRect",gu(n,r)),Hr(()=>{e.set("indicatorTransition",!1)}))},syncSsr({context:e}){e.set("ssr",!1)},syncIndicatorRect({context:e,refs:t,scope:n}){const r=t.get("indicatorCleanup");r&&r();const o=e.get("value");if(!o){e.set("indicatorTransition",!1);return}const i=Pt(n,o),s=Ar(n);if(!i||!s)return;const a=Ur([i],{measure(d){return wi(d)},onEntry({rects:d}){const[l]=d;e.set("indicatorRect",xi(l))}});t.set("indicatorCleanup",a)},navigateIfNeeded({context:e,prop:t,scope:n}){var i;const r=e.get("value");if(!r)return;const o=Pt(n,r);Zi(o)&&((i=t("navigate"))==null||i({value:r,node:o}))}}}};te()(["activationMode","composite","deselectable","dir","getRootNode","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value","defaultValue"]);te()(["disabled","value"]);te()(["value"]);const yu=e=>{const t=y.useId(),{getRootNode:n}=ke(),{dir:r}=Ke(),o={id:t,dir:r,getRootNode:n,...e},i=Re(vu,o);return pu(i,We)},Pi=y.forwardRef((e,t)=>{const[n,r]=lo(e),[o,i]=Y()(r,["activationMode","composite","defaultValue","deselectable","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value"]),s=yu(o),a=S(s.getRootProps(),i);return C.jsx(su,{value:s,children:C.jsx(ao,{value:n,children:C.jsx(V.div,{...a,ref:t})})})});Pi.displayName="TabsRoot";exports.CheckboxControl=fo;exports.CheckboxGroup=Eo;exports.CheckboxHiddenInput=Io;exports.CheckboxIndicator=Co;exports.CheckboxLabel=To;exports.CheckboxRoot=wo;exports.CheckboxRootProvider=xo;exports.DialogBackdrop=ko;exports.DialogCloseTrigger=So;exports.DialogContent=No;exports.DialogDescription=Ao;exports.DialogPositioner=Vo;exports.DialogRoot=bl;exports.DialogTitle=Go;exports.DialogTrigger=Bo;exports.Portal=El;exports.RadioGroupContext=Tl;exports.RadioGroupItem=_o;exports.RadioGroupItemControl=jo;exports.RadioGroupItemHiddenInput=Wo;exports.RadioGroupItemText=Ko;exports.RadioGroupLabel=Uo;exports.RadioGroupRoot=zo;exports.RadioGroupRootProvider=Jo;exports.SelectContent=Zo;exports.SelectControl=Qo;exports.SelectItem=ei;exports.SelectLabel=ti;exports.SelectPositioner=ni;exports.SelectRoot=Zl;exports.SelectTrigger=ai;exports.SelectValueText=ci;exports.SwitchControl=ui;exports.SwitchHiddenInput=di;exports.SwitchLabel=fi;exports.SwitchRoot=pi;exports.SwitchRootProvider=mi;exports.SwitchThumb=vi;exports.TabContent=yi;exports.TabIndicator=bi;exports.TabList=Ei;exports.TabTrigger=Ii;exports.TabsRoot=Pi;exports.anatomy=Fo;exports.anatomy$1=Ci;exports.anatomy$2=ri;exports.anatomy$3=qo;exports.anatomy$4=hi;exports.ark=V;exports.checkboxAnatomy=yo;exports.createListCollection=Uc;
2
+ //# sourceMappingURL=ark-ui-BakX7_HR.cjs.map