@ontoui/react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ontoui
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs ADDED
@@ -0,0 +1,34 @@
1
+ "use strict";var io=Object.defineProperty;var co=(e,t,n)=>t in e?io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var U=(e,t,n)=>co(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),De=require("react"),uo=require("react-dom");function jn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const a=jn(De),Gt=jn(uo);function mt(){return typeof window<"u"}function de(e){return Ht(e)?(e.nodeName||"").toLowerCase():"#document"}function Re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ao(e){var t;return(t=(Ht(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ht(e){return mt()?e instanceof Node||e instanceof Re(e).Node:!1}function qe(e){return mt()?e instanceof Element||e instanceof Re(e).Element:!1}function ce(e){return mt()?e instanceof HTMLElement||e instanceof Re(e).HTMLElement:!1}function We(e){return!mt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Re(e).ShadowRoot}function Yt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ht(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}let St;function lo(){return St==null&&(St=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),St}function Rt(e){return/^(html|body|#document)$/.test(de(e))}function ht(e){return Re(e).getComputedStyle(e)}function fo(e){if(de(e)==="html")return e;const t=e.assignedSlot||e.parentNode||We(e)&&e.host||ao(e);return We(t)?t.host:t}const pn={};function we(e,t){const n=a.useRef(pn);return n.current===pn&&(n.current=e(t)),n}const vt=a[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],po=vt&&vt!==a.useLayoutEffect?vt:e=>e();function X(e){const t=we(go).current;return t.next=e,po(t.effect),t.trampoline}function go(){const e={next:void 0,callback:mo,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function mo(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}let At;process.env.NODE_ENV!=="production"&&(At=new Set);function gn(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");At.has(t)||(At.add(t),console.error(`Base UI: ${t}`))}}const Pe={...a},ho=()=>{},q=typeof document<"u"?a.useLayoutEffect:ho;function Bt(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const qt={};function Xt(e,t,n,r,o){if(!n&&!r&&!e)return ft(t);let s=ft(e);return t&&(s=lt(s,t)),n&&(s=lt(s,n)),r&&(s=lt(s,r)),s}function bo(e){if(e.length===0)return qt;if(e.length===1)return ft(e[0]);let t=ft(e[0]);for(let n=1;n<e.length;n+=1)t=lt(t,e[n]);return t}function ft(e){return zt(e)?{...Wn(e,qt)}:Eo(e)}function lt(e,t){return zt(t)?Wn(t,e):yo(e,t)}function Eo(e){const t={...e};for(const n in t){const r=t[n];$n(n,r)&&(t[n]=Un(r))}return t}function yo(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Bt(e.style,r);break}case"className":{e[n]=Kn(e.className,r);break}default:$n(n,r)?e[n]=So(e[n],r):e[n]=r}}return e}function $n(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function zt(e){return typeof e=="function"}function Wn(e,t){return zt(e)?e(t):e??qt}function So(e,t){return t?e?(...n)=>{const r=n[0];if(Gn(r)){const s=r;dt(s);const i=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),i}const o=t(...n);return e==null||e(...n),o}:Un(t):e}function Un(e){return e&&((...t)=>{const n=t[0];return Gn(n)&&dt(n),e(...t)})}function dt(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Kn(e,t){return t?e?t+" "+e:t:e}function Gn(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ro(e,t){return function(r,...o){const s=new URL(e);return s.searchParams.set("code",r.toString()),o.forEach(i=>s.searchParams.append("args[]",i)),`${t} error #${r}; visit ${s} for the full message.`}}const Ue=Ro("https://base-ui.com/production-error","Base UI"),Hn=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Hn.displayName="CompositeRootContext");function vo(e=!1){const t=a.useContext(Hn);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Ue(16));return t}function Oo(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,i=r&&t!==!1,c=r&&t===!1;return{props:a.useMemo(()=>{const u={onKeyDown(f){n&&t&&f.key!=="Tab"&&f.preventDefault()}};return r||(u.tabIndex=o,!s&&n&&(u.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||c)&&(u.disabled=n),u},[r,n,t,i,c,s,o])}}function Zt(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0,composite:s}=e,i=a.useRef(null),c=vo(!0),d=s??c!==void 0,{props:u}=Oo({focusableWhenDisabled:n,disabled:t,composite:d,tabIndex:r,isNativeButton:o});process.env.NODE_ENV!=="production"&&a.useEffect(()=>{var p,l;if(!i.current)return;const h=nt(i.current);if(o){if(!h){const g=((p=Pe.captureOwnerStack)==null?void 0:p.call(Pe))||"";gn(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${g}`)}}else if(h){const g=((l=Pe.captureOwnerStack)==null?void 0:l.call(Pe))||"";gn(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${g}`)}},[o]);const f=a.useCallback(()=>{const h=i.current;nt(h)&&d&&t&&u.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,u.disabled,d]);q(f,[f]);const m=a.useCallback((h={})=>{const{onClick:p,onMouseDown:l,onKeyUp:g,onKeyDown:y,onPointerDown:E,..._}=h;return Xt({type:o?"button":void 0,onClick(b){if(t){b.preventDefault();return}p==null||p(b)},onMouseDown(b){t||l==null||l(b)},onKeyDown(b){if(t||(dt(b),y==null||y(b),b.baseUIHandlerPrevented))return;const I=b.target===b.currentTarget,O=b.currentTarget,w=nt(O),A=!o&&To(O),G=I&&(o?w:!A),F=b.key==="Enter",B=b.key===" ",S=O.getAttribute("role"),Q=(S==null?void 0:S.startsWith("menuitem"))||S==="option"||S==="gridcell";if(I&&d&&B){if(b.defaultPrevented&&Q)return;b.preventDefault(),A||o&&w?(O.click(),b.preventBaseUIHandler()):G&&(p==null||p(b),b.preventBaseUIHandler());return}G&&(!o&&(B||F)&&b.preventDefault(),!o&&F&&(p==null||p(b)))},onKeyUp(b){if(!t){if(dt(b),g==null||g(b),b.target===b.currentTarget&&o&&d&&nt(b.currentTarget)&&b.key===" "){b.preventDefault();return}b.baseUIHandlerPrevented||b.target===b.currentTarget&&!o&&!d&&b.key===" "&&(p==null||p(b))}},onPointerDown(b){if(t){b.preventDefault();return}E==null||E(b)}},o?void 0:{role:"button"},u,_)},[t,u,d,o]),v=X(h=>{i.current=h,f()});return{getButtonProps:m,buttonRef:v}}function nt(e){return ce(e)&&e.tagName==="BUTTON"}function To(e){return!!((e==null?void 0:e.tagName)==="A"&&(e!=null&&e.href))}function pt(e,t,n,r){const o=we(Yn).current;return Co(o,e,t,n,r)&&qn(o,[e,t,n,r]),o.callback}function wo(e){const t=we(Yn).current;return Io(t,e)&&qn(t,e),t.callback}function Yn(){return{callback:null,cleanup:null,refs:[]}}function Co(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function Io(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function qn(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(r[o]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=r[o];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const _o=parseInt(a.version,10);function Jt(e){return _o>=e}function mn(e){if(!a.isValidElement(e))return null;const t=e,n=t.props;return(Jt(19)?n==null?void 0:n.ref:t.ref)??null}let Vt;process.env.NODE_ENV!=="production"&&(Vt=new Set);function Po(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Vt.has(t)||(Vt.add(t),console.warn(`Base UI: ${t}`))}}function Qt(){}const fe=Object.freeze({});function No(e,t){const n={};for(const r in e){const o=e[r];if(t!=null&&t.hasOwnProperty(r)){const s=t[r](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function xo(e,t){return typeof e=="function"?e(t):e}function Do(e,t){return typeof e=="function"?e(t):e}function Ce(e,t,n={}){const r=t.render,o=ko(t,n);if(n.enabled===!1)return null;const s=n.state??fe;return Fo(e,r,o,s)}function ko(e,t={}){const{className:n,style:r,render:o}=e,{state:s=fe,ref:i,props:c,stateAttributesMapping:d,enabled:u=!0}=t,f=u?xo(n,s):void 0,m=u?Do(r,s):void 0,v=u?No(s,d):fe,h=u&&c?Mo(c):void 0,p=u?Bt(v,h)??{}:fe;return typeof document<"u"&&(u?Array.isArray(i)?p.ref=wo([p.ref,mn(o),...i]):p.ref=pt(p.ref,mn(o),i):pt(null,null)),u?(f!==void 0&&(p.className=Kn(p.className,f)),m!==void 0&&(p.style=Bt(p.style,m)),p):fe}function Mo(e){return Array.isArray(e)?bo(e):Xt(void 0,e)}const Ao=Symbol.for("react.lazy"),Bo=/^[A-Z][A-Za-z0-9$]*$/,Vo=/[a-z]/;function Fo(e,t,n,r){if(t){if(typeof t=="function")return process.env.NODE_ENV!=="production"&&Lo(t),t(n,r);const o=Xt(n,t.props);o.ref=n.ref;let s=t;if((s==null?void 0:s.$$typeof)===Ao&&(s=a.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!a.isValidElement(s))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
2
+ `));return a.cloneElement(s,o)}if(e&&typeof e=="string")return jo(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Ue(8))}function Lo(e){const t=e.name;t.length!==0&&Bo.test(t)&&Vo.test(t)&&Po(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.","If this is an intentional render callback, rename it to start with a lowercase letter.","Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.","https://base-ui.com/r/invalid-render-prop")}function jo(e,t){return e==="button"?De.createElement("button",{type:"button",...t,key:t.key}):e==="img"?De.createElement("img",{alt:"",...t,key:t.key}):a.createElement(e,t)}const Xn=a.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,focusableWhenDisabled:i=!1,nativeButton:c=!0,style:d,...u}=t,{getButtonProps:f,buttonRef:m}=Zt({disabled:s,focusableWhenDisabled:i,native:c});return Ce("button",t,{state:{disabled:s},ref:[n,m],props:[u,f]})});process.env.NODE_ENV!=="production"&&(Xn.displayName="Button");const $o="_Button_tp3a5_1",Wo="_Button_variant_primary_tp3a5_34",Uo="_Button_variant_secondary_tp3a5_47",hn={Button:$o,Button_variant_primary:Wo,Button_variant_secondary:Uo},bt=a.forwardRef(function({children:t,id:n,className:r,variant:o="primary",disabled:s=!1,onClick:i,onFocus:c,onBlur:d},u){const f=[hn.Button,hn[`Button_variant_${o}`],r].filter(Boolean).join(" ");return j.jsx(Xn,{ref:u,id:n,className:f,disabled:s,onClick:i,onFocus:c,onBlur:d,children:t})});bt.displayName="Button";const en=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(en.displayName="DialogRootContext");function Ie(e){const t=a.useContext(en);if(e===!1&&t===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.":Ue(27));return t}let ze=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Ko={[ze.startingStyle]:""},Go={[ze.endingStyle]:""},zn={transitionStatus(e){return e==="starting"?Ko:e==="ending"?Go:null}};let xe=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ze.startingStyle]="startingStyle",e[e.endingStyle=ze.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Ho=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Yo={[Ho.popupOpen]:""},qo={[xe.open]:""},Xo={[xe.closed]:""},zo={[xe.anchorHidden]:""},Zo={open(e){return e?Yo:null}},Zn={open(e){return e?qo:Xo},anchorHidden(e){return e?zo:null}},Jo={...Zn,...zn},Jn=a.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...c}=t,{store:d}=Ie(),u=d.useState("open"),f=d.useState("nested"),m=d.useState("mounted"),v=d.useState("transitionStatus");return Ce("div",t,{state:{open:u,transitionStatus:v},ref:[d.context.backdropRef,n],stateAttributesMapping:Jo,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:i||!f})});process.env.NODE_ENV!=="production"&&(Jn.displayName="DialogBackdrop");const Ft="trigger-press",Qo="trigger-hover",Qn="outside-press",es="close-press",er="focus-out",ts="escape-key",ns="imperative-action";function he(e,t,n,r){let o=!1,s=!1;const i=fe;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...i}}const tr=a.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,style:c,...d}=t,{store:u}=Ie(),f=u.useState("open");function m(l){f&&u.setOpen(!1,he(es,l.nativeEvent))}const{getButtonProps:v,buttonRef:h}=Zt({disabled:s,native:i});return Ce("button",t,{state:{disabled:s},ref:[n,h],props:[{onClick:m},d,v]})});process.env.NODE_ENV!=="production"&&(tr.displayName="DialogClose");let bn=0;function rs(e,t="mui"){const[n,r]=a.useState(e),o=e||n;return a.useEffect(()=>{n==null&&(bn+=1,r(`${t}-${bn}`))},[n,t]),o}const En=Pe.useId;function Et(e,t){if(En!==void 0){const n=En();return e??(t?`${t}-${n}`:n)}return rs(e,t)}function tn(e){return Et(e,"base-ui")}const nr=a.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...c}=t,{store:d}=Ie(),u=tn(i);return d.useSyncedValueWithCleanup("descriptionElementId",u),Ce("p",t,{ref:n,props:[{id:u},c]})});process.env.NODE_ENV!=="production"&&(nr.displayName="DialogDescription");const os=[];function rr(e){a.useEffect(e,os)}const He=0;class ke{constructor(){U(this,"currentId",He);U(this,"clear",()=>{this.currentId!==He&&(clearTimeout(this.currentId),this.currentId=He)});U(this,"disposeEffect",()=>this.clear)}static create(){return new ke}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=He,n()},t)}isStarted(){return this.currentId!==He}}function Ze(){const e=we(ke.create).current;return rr(e.disposeEffect),e}const Ke=typeof navigator<"u",Ot=cs(),or=as(),sr=us(),ir=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),cr=Ot.platform==="MacIntel"&&Ot.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Ot.platform),ss=Ke&&/apple/i.test(navigator.vendor),Lt=Ke&&/android/i.test(or)||/android/i.test(sr);Ke&&or.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const is=sr.includes("jsdom/");function cs(){if(!Ke)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function us(){if(!Ke)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function as(){if(!Ke)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function ls(e){e.preventDefault(),e.stopPropagation()}function fs(e){return"nativeEvent"in e}function ds(e){return e.pointerType===""&&e.isTrusted?!0:Lt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ps(e){return is?!1:!Lt&&e.width===0&&e.height===0||Lt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function yn(e,t){return["mouse","pen"].includes(e)}function ur(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function W(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function je(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Tt(e){const t=we(gs,e).current;return t.next=e,q(t.effect),t}function gs(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const rt=null;let Sn=globalThis.requestAnimationFrame;class ms{constructor(){U(this,"callbacks",[]);U(this,"callbacksCount",0);U(this,"nextId",1);U(this,"startId",1);U(this,"isScheduled",!1);U(this,"tick",t=>{var o;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)(o=n[s])==null||o.call(n,t)})}request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV!=="production"&&Sn!==requestAnimationFrame&&(Sn=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const ot=new ms;class Ee{constructor(){U(this,"currentId",rt);U(this,"cancel",()=>{this.currentId!==rt&&(ot.cancel(this.currentId),this.currentId=rt)});U(this,"disposeEffect",()=>this.cancel)}static create(){return new Ee}static request(t){return ot.request(t)}static cancel(t){return ot.cancel(t)}request(t){this.cancel(),this.currentId=ot.request(()=>{this.currentId=rt,t()})}}function nn(){const e=we(Ee.create).current;return rr(e.disposeEffect),e}function Z(e){return(e==null?void 0:e.ownerDocument)||document}const hs={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},bs={...hs,position:"fixed",top:0,left:0},Je=a.forwardRef(function(t,n){const[r,o]=a.useState();q(()=>{ss&&o("button")},[]);const s={tabIndex:0,role:r};return j.jsx("span",{...t,ref:n,style:bs,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(Je.displayName="FocusGuard");const jt="data-base-ui-focusable",ar="active",lr="selected",Es="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ne(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function K(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&We(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Se(e){return"composedPath"in e?e.composedPath()[0]:e.target}function me(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function ys(e){return e.matches("html,body")}function rn(e){return ce(e)&&e.matches(Es)}function Rn(e){return e?e.getAttribute("role")==="combobox"&&rn(e):!1}function $t(e){return e?e.hasAttribute(jt)?e:e.querySelector(`[${jt}]`)||e:null}function Ss(e){return e.visibility==="hidden"||e.visibility==="collapse"}function fr(e,t=e?ht(e):null){return!e||!e.isConnected||!t||Ss(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Rs='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function vs(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return We(n)?n.host:null}function Wt(e){for(const t of Array.from(e.children))if(de(t)==="summary")return t;return null}function Os(e,t){const n=Wt(t);return!!n&&(e===n||K(n,e))}function dr(e){const t=e?de(e):"";return e!=null&&e.matches(Rs)&&(t!=="summary"||e.parentElement!=null&&de(e.parentElement)==="details"&&Wt(e.parentElement)===e)&&(t!=="details"||Wt(e)==null)&&(t!=="input"||e.type!=="hidden")}function pr(e){if(!dr(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=vs(t)){const n=t!==e,r=de(t)==="slot";if(t.hasAttribute("inert")||n&&de(t)==="details"&&!t.open&&!Os(e,t)||t.hasAttribute("hidden")||!r&&!Ts(t,n))return!1}return!0}function Ts(e,t){const n=ht(e);return t?n.display!=="none":fr(e,n)}function gr(e){const t=e.tabIndex;if(t<0){const n=de(e);if(n==="details"||n==="audio"||n==="video"||ce(e)&&e.isContentEditable)return 0}return t}function wt(e){if(de(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function ws(e,t){const n=wt(e);if(!n)return!0;const r=t.find(o=>{const s=wt(o);return(s==null?void 0:s.name)===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=wt(o);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function mr(e){if(ce(e)&&de(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return ce(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function hr(e,t){mr(e).forEach(n=>{dr(n)&&t.push(n),hr(n,t)})}function br(e,t,n){mr(e).forEach(r=>{ce(r)&&r.matches(t)&&n.push(r),br(r,t,n)})}function on(e){return pr(e)&&gr(e)>=0}function Er(e){const t=[];return hr(e,t),t.filter(pr)}function yt(e){const t=Er(e);return t.filter(n=>gr(n)>=0&&ws(n,t))}function yr(e,t){const n=yt(e),r=n.length;if(r===0)return;const o=Ne(Z(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function Sr(e){return yr(Z(e).body,1)||e}function Rr(e){return yr(Z(e).body,-1)||e}function Xe(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!K(n,r)}function Cs(e){yt(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function vn(e){const t=[];br(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function $e(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>{var s;return[...!n||(s=o.context)!=null&&s.open?[o]:[],...$e(e,o.id,n)]})}function On(e,t){var o;let n=[],r=(o=e.find(s=>s.id===t))==null?void 0:o.parentId;for(;r;){const s=e.find(i=>i.id===r);r=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function gt(e){return`data-base-ui-${e}`}let st=0;function Ct(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(st);const s=()=>e==null?void 0:e.focus({preventScroll:n});if(o)return s(),Qt;const i=requestAnimationFrame(s);return st=i,()=>{st===i&&(cancelAnimationFrame(i),st=0)}}const It={inert:new WeakMap,"aria-hidden":new WeakMap},Tn="data-base-ui-inert",Ut={inert:new WeakSet,"aria-hidden":new WeakSet};let Ye=new WeakMap,_t=0;function Is(e){return Ut[e]}function vr(e){return e?We(e)?e.host:vr(e.parentNode):null}const Pt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=vr(n);return e.contains(r)?r:null}).filter(n=>n!=null),wn=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Cn=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{de(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function _s(e,t,n,r,{mark:o=!0,markerIgnoreElements:s=[]}){const i=r?"inert":n?"aria-hidden":null;let c=null,d=null;const u=Pt(t,e),f=o?Pt(t,s):[],m=new Set(f),v=o?Cn(t,wn(u),new Set(u)).filter(l=>!m.has(l)):[],h=[],p=[];if(i){const l=It[i],g=Is(i);d=g,c=l;const y=Pt(t,Array.from(t.querySelectorAll("[aria-live]"))),E=u.concat(y);Cn(t,wn(E),new Set(E)).forEach(C=>{const b=C.getAttribute(i),I=b!==null&&b!=="false",O=(l.get(C)||0)+1;l.set(C,O),h.push(C),O===1&&I&&g.add(C),I||C.setAttribute(i,i==="inert"?"":"true")})}return o&&v.forEach(l=>{const g=(Ye.get(l)||0)+1;Ye.set(l,g),p.push(l),g===1&&l.setAttribute(Tn,"")}),_t+=1,()=>{c&&h.forEach(l=>{const y=(c.get(l)||0)-1;c.set(l,y),y||(!(d!=null&&d.has(l))&&i&&l.removeAttribute(i),d==null||d.delete(l))}),o&&p.forEach(l=>{const g=(Ye.get(l)||0)-1;Ye.set(l,g),g||l.removeAttribute(Tn)}),_t-=1,_t||(It.inert=new WeakMap,It["aria-hidden"]=new WeakMap,Ut.inert=new WeakSet,Ut["aria-hidden"]=new WeakSet,Ye=new WeakMap)}}function In(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0,markerIgnoreElements:s=[]}=t,i=Z(e[0]).body;return _s(e,i,n,r,{mark:o,markerIgnoreElements:s})}const Or="data-base-ui-click-trigger",Ps={clipPath:"inset(50%)",position:"fixed",top:0,left:0},sn=a.createContext(null);process.env.NODE_ENV!=="production"&&(sn.displayName="PortalContext");const Tr=()=>a.useContext(sn),Ns=gt("portal");function xs(e={}){const{ref:t,container:n,componentProps:r=fe,elementProps:o}=e,s=Et(),i=Tr(),c=i==null?void 0:i.portalNode,[d,u]=a.useState(null),[f,m]=a.useState(null),v=X(g=>{g!==null&&m(g)}),h=a.useRef(null);q(()=>{if(n===null){h.current&&(h.current=null,m(null),u(null));return}if(s==null)return;const g=(n&&(Ht(n)?n:n.current))??c??document.body;if(g==null){h.current&&(h.current=null,m(null),u(null));return}h.current!==g&&(h.current=g,m(null),u(g))},[n,c,s]);const p=Ce("div",r,{ref:[t,v],props:[{id:s,[Ns]:""},o]});return{portalNode:f,portalSubtree:d&&p?Gt.createPortal(p,d):null}}const wr=a.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,renderGuards:c,style:d,...u}=t,{portalNode:f,portalSubtree:m}=xs({container:o,ref:n,componentProps:t,elementProps:u}),v=a.useRef(null),h=a.useRef(null),p=a.useRef(null),l=a.useRef(null),[g,y]=a.useState(null),E=a.useRef(!1),_=g==null?void 0:g.modal,C=g==null?void 0:g.open,b=typeof c=="boolean"?c:!!g&&!g.modal&&g.open&&!!f;a.useEffect(()=>{if(!f||_)return;function O(w){f&&w.relatedTarget&&Xe(w)&&(w.type==="focusin"?E.current&&(vn(f),E.current=!1):(Cs(f),E.current=!0))}return je(W(f,"focusin",O,!0),W(f,"focusout",O,!0))},[f,_]),a.useEffect(()=>{!f||C!==!1||(vn(f),E.current=!1)},[C,f]);const I=a.useMemo(()=>({beforeOutsideRef:v,afterOutsideRef:h,beforeInsideRef:p,afterInsideRef:l,portalNode:f,setFocusManagerState:y}),[f]);return j.jsxs(a.Fragment,{children:[m,j.jsxs(sn.Provider,{value:I,children:[b&&f&&j.jsx(Je,{"data-type":"outside",ref:v,onFocus:O=>{var w;if(Xe(O,f))(w=p.current)==null||w.focus();else{const A=g?g.domReference:null,G=Rr(A);G==null||G.focus()}}}),b&&f&&j.jsx("span",{"aria-owns":f.id,style:Ps}),f&&Gt.createPortal(r,f),b&&f&&j.jsx(Je,{"data-type":"outside",ref:h,onFocus:O=>{var w;if(Xe(O,f))(w=l.current)==null||w.focus();else{const A=g?g.domReference:null,G=Sr(A);G==null||G.focus(),g!=null&&g.closeOnFocusOut&&(g==null||g.onOpenChange(!1,he(er,O.nativeEvent)))}}})]})]})});process.env.NODE_ENV!=="production"&&(wr.displayName="FloatingPortal");function Ds(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const Cr=a.createContext(null);process.env.NODE_ENV!=="production"&&(Cr.displayName="FloatingNodeContext");const Ir=a.createContext(null);process.env.NODE_ENV!=="production"&&(Ir.displayName="FloatingTreeContext");const _r=()=>{var e;return((e=a.useContext(Cr))==null?void 0:e.id)||null},Pr=e=>{const t=a.useContext(Ir);return e??t};function ye(e){return e==null?e:"current"in e?e.current:e}function ks(e,t){const n=Re(Se(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const _n=20;let Te=[];function cn(){Te=Te.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function Ms(e){cn(),e&&de(e)!=="body"&&(Te.push(new WeakRef(e)),Te.length>_n&&(Te=Te.slice(-_n)))}function Nt(){var e;return cn(),(e=Te[Te.length-1])==null?void 0:e.deref()}function As(e){return e?on(e)?e:yt(e)[0]||e:null}function Pn(e,t){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!t.current.includes("floating")&&!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const r=Er(e).filter(i=>{const c=i.getAttribute("data-tabindex")||"";return on(i)||i.hasAttribute("data-tabindex")&&!c.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Bs(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:d=!0,openInteractionType:u="",nextFocusableElement:f,previousFocusableElement:m,beforeContentFocusGuardRef:v,externalTree:h,getInsideElements:p}=e,l="rootStore"in t?t.rootStore:t,g=l.useState("open"),y=l.useState("domReferenceElement"),E=l.useState("floatingElement"),{events:_,dataRef:C}=l.context,b=X(()=>{var N;return(N=C.current.floatingContext)==null?void 0:N.nodeId}),I=o===!1,O=Rn(y)&&I,w=a.useRef(["content"]),A=Tt(o),G=Tt(s),F=Tt(u),B=Pr(h),S=Tr(),Q=a.useRef(!1),pe=a.useRef(!1),ge=a.useRef(!1),Me=a.useRef(null),Ae=a.useRef(""),_e=a.useRef(""),Be=a.useRef(null),L=a.useRef(null),be=pt(Be,v,S==null?void 0:S.beforeInsideRef),Ve=pt(L,S==null?void 0:S.afterInsideRef),Fe=Ze(),ve=Ze(),Oe=nn(),ue=S!=null,x=$t(E),re=X((N=x)=>N?yt(N):[]),se=X(()=>(p==null?void 0:p().filter(N=>N!=null))??[]);a.useEffect(()=>{if(r||!c)return;function N(V){V.key==="Tab"&&K(x,Ne(Z(x)))&&re().length===0&&!O&&ls(V)}const Y=Z(x);return W(Y,"keydown",N)},[r,y,x,c,w,O,re]),a.useEffect(()=>{if(r||!g)return;const N=Z(x);function Y(){ge.current=!1}function V(k){const D=Se(k),z=se(),P=K(E,D)||K(y,D)||K(S==null?void 0:S.portalNode,D)||z.some(ae=>ae===D||K(ae,D));ge.current=!P,_e.current=k.pointerType||"keyboard",D!=null&&D.closest(`[${Or}]`)&&(pe.current=!0)}function J(){_e.current="keyboard"}return je(W(N,"pointerdown",V,!0),W(N,"pointerup",Y,!0),W(N,"pointercancel",Y,!0),W(N,"keydown",J,!0))},[r,E,y,x,g,S,se]),a.useEffect(()=>{if(r||!d)return;const N=Z(x);function Y(){pe.current=!0,ve.start(0,()=>{pe.current=!1})}function V(z){const P=Se(z);on(P)&&(Me.current=P)}function J(z){const P=z.relatedTarget,ae=z.currentTarget,$=Se(z);queueMicrotask(()=>{const le=b(),R=l.context.triggerElements,T=se(),te=(P==null?void 0:P.hasAttribute(gt("focus-guard")))&&[Be.current,L.current,S==null?void 0:S.beforeInsideRef.current,S==null?void 0:S.afterInsideRef.current,S==null?void 0:S.beforeOutsideRef.current,S==null?void 0:S.afterOutsideRef.current,ye(m),ye(f)].includes(P),ee=!(K(y,P)||K(E,P)||K(P,E)||K(S==null?void 0:S.portalNode,P)||T.some(H=>H===P||K(H,P))||P!=null&&R.hasElement(P)||R.hasMatchingElement(H=>K(H,P))||te||B&&($e(B.nodesRef.current,le).find(H=>{var ne,oe;return K((ne=H.context)==null?void 0:ne.elements.floating,P)||K((oe=H.context)==null?void 0:oe.elements.domReference,P)})||On(B.nodesRef.current,le).find(H=>{var ne,oe,tt;return[(ne=H.context)==null?void 0:ne.elements.floating,$t((oe=H.context)==null?void 0:oe.elements.floating)].includes(P)||((tt=H.context)==null?void 0:tt.elements.domReference)===P})));if(ae===y&&x&&Pn(x,w),i&&ae!==y&&!fr($)&&Ne(N)===N.body){if(ce(x)&&(x.focus(),i==="popup")){Oe.request(()=>{x.focus()});return}const H=re(),ne=Me.current,oe=(ne&&H.includes(ne)?ne:null)||H[H.length-1]||x;ce(oe)&&oe.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(O||!c)&&P&&ee&&!pe.current&&(O||P!==Nt())&&(Q.current=!0,l.setOpen(!1,he(er,z)))})}function k(){ge.current||(C.current.insideReactTree=!0,Fe.start(0,()=>{C.current.insideReactTree=!1}))}const D=ce(y)?y:null;if(!(!E&&!D))return je(D&&W(D,"focusout",J),D&&W(D,"pointerdown",Y),E&&W(E,"focusin",V),E&&W(E,"focusout",J),E&&S&&W(E,"focusout",k,!0))},[r,y,E,x,c,B,S,l,d,i,re,O,b,w,C,Fe,ve,Oe,f,m,se]),a.useEffect(()=>{var ae,$,le;if(r||!E||!g)return;const N=Array.from(((ae=S==null?void 0:S.portalNode)==null?void 0:ae.querySelectorAll(`[${gt("portal")}]`))||[]),V=(le=($=(B?On(B.nodesRef.current,b()):[]).find(R=>{var T;return Rn(((T=R.context)==null?void 0:T.elements.domReference)||null)}))==null?void 0:$.context)==null?void 0:le.elements.domReference,k=[...[E,...N,Be.current,L.current,S==null?void 0:S.beforeOutsideRef.current,S==null?void 0:S.afterOutsideRef.current,...se()],V,ye(m),ye(f),O?y:null].filter(R=>R!=null),D=In(k,{ariaHidden:c||O,mark:!1}),z=[E,...N].filter(R=>R!=null),P=In(z);return()=>{P(),D()}},[g,r,y,E,c,w,S,O,B,b,f,m,se]),q(()=>{if(!g||r||!ce(x))return;const N=Z(x),Y=Ne(N);queueMicrotask(()=>{const V=A.current,J=typeof V=="function"?V(F.current||""):V;if(J===void 0||J===!1||K(x,Y))return;let D=null;const z=()=>(D==null&&(D=re(x)),D[0]||x);let P;J===!0||J===null?P=z():P=ye(J),P=P||z(),Ct(P,{preventScroll:P===x})})},[r,g,x,I,re,A,F]),q(()=>{if(r||!x)return;const N=Z(x),Y=Ne(N);Ms(Y);function V(k){if(k.open||(Ae.current=ks(k.nativeEvent,_e.current)),k.reason===Qo&&k.nativeEvent.type==="mouseleave"&&(Q.current=!0),k.reason===Qn)if(k.nested)Q.current=!1;else if(ds(k.nativeEvent)||ps(k.nativeEvent))Q.current=!1;else{let D=!1;Z(x).createElement("div").focus({get preventScroll(){return D=!0,!1}}),D?Q.current=!1:Q.current=!0}}_.on("openchange",V);function J(){const k=G.current;let D=typeof k=="function"?k(Ae.current):k;if(D===void 0||D===!1)return null;if(D===null&&(D=!0),typeof D=="boolean"){const P=y||Nt();return P&&P.isConnected?P:null}const z=y||Nt();return ye(D)||z||null}return()=>{_.off("openchange",V);const k=Ne(N),D=se(),z=K(E,k)||D.some($=>$===k||K($,k))||B&&$e(B.nodesRef.current,b(),!1).some($=>{var le;return K((le=$.context)==null?void 0:le.elements.floating,k)}),P=G.current,ae=J();queueMicrotask(()=>{const $=As(ae),le=typeof P!="boolean";P&&!Q.current&&ce($)&&(!(!le&&$!==k&&k!==N.body)||z)&&$.focus({preventScroll:!0}),Q.current=!1})}},[r,E,x,G,C,_,B,y,b,se]),q(()=>{if(!ir||g||!E)return;const N=Ne(Z(E));!ce(N)||!rn(N)||K(E,N)&&N.blur()},[g,E]),q(()=>{if(!(r||!S))return S.setFocusManagerState({modal:c,closeOnFocusOut:d,open:g,onOpenChange:l.setOpen,domReference:y}),()=>{S.setFocusManagerState(null)}},[r,S,c,g,l,d,y]),q(()=>{if(!(r||!x))return Pn(x,w),()=>{queueMicrotask(cn)}},[r,x,w]);const et=!r&&(c?!O:!0)&&(ue||c);return j.jsxs(a.Fragment,{children:[et&&j.jsx(Je,{"data-type":"inside",ref:be,onFocus:N=>{var Y;if(c){const V=re();Ct(V[V.length-1])}else if(S!=null&&S.portalNode)if(Q.current=!1,Xe(N,S.portalNode)){const V=Sr(y);V==null||V.focus()}else(Y=ye(m??S.beforeOutsideRef))==null||Y.focus()}}),n,et&&j.jsx(Je,{"data-type":"inside",ref:Ve,onFocus:N=>{var Y;if(c)Ct(re()[0]);else if(S!=null&&S.portalNode)if(d&&(Q.current=!0),Xe(N,S.portalNode)){const V=Rr(y);V==null||V.focus()}else(Y=ye(f??S.afterOutsideRef))==null||Y.focus()}})]})}function Vs(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:d=!0,touchOpenDelay:u=0,reason:f=Ft}=t,m=a.useRef(void 0),v=nn(),h=Ze(),p=a.useMemo(()=>({onPointerDown(l){m.current=l.pointerType},onMouseDown(l){const g=m.current,y=l.nativeEvent,E=n.select("open");if(l.button!==0||s==="click"||yn(g)&&c)return;const _=r.current.openEvent,C=_==null?void 0:_.type,b=n.select("domReferenceElement")!==l.currentTarget,I=E&&b||!(E&&i&&(!(_&&d)||C==="click"||C==="mousedown")),O=Se(y);if(rn(O)){const A=he(f,y,O);I&&g==="touch"&&u>0?h.start(u,()=>{n.setOpen(!0,A)}):n.setOpen(I,A);return}const w=l.currentTarget;v.request(()=>{const A=he(f,y,w);I&&g==="touch"&&u>0?h.start(u,()=>{n.setOpen(!0,A)}):n.setOpen(I,A)})},onClick(l){if(s==="mousedown-only")return;const g=m.current;if(s==="mousedown"&&g){m.current=void 0;return}if(yn(g)&&c)return;const y=n.select("open"),E=r.current.openEvent,_=n.select("domReferenceElement")!==l.currentTarget,C=y&&_||!(y&&i&&(!(E&&d)||ur(E))),b=he(f,l.nativeEvent,l.currentTarget);C&&g==="touch"&&u>0?h.start(u,()=>{n.setOpen(!0,b)}):n.setOpen(C,b)},onKeyDown(){m.current=void 0}}),[r,s,c,n,d,i,v,h,u,f]);return a.useMemo(()=>o?{reference:p}:fe,[o,p])}const Fs={intentional:"onClick",sloppy:"onPointerDown"};function Ls(){return!1}function js(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function $s(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),{dataRef:s}=n.context,{enabled:i=!0,escapeKey:c=!0,outsidePress:d=!0,outsidePressEvent:u="sloppy",referencePress:f=Ls,referencePressEvent:m="sloppy",bubbles:v,externalTree:h}=t,p=Pr(h),l=X(typeof d=="function"?d:()=>!1),g=typeof d=="function"?l:d,y=g!==!1,E=X(()=>u),_=a.useRef(!1),C=a.useRef(!1),b=a.useRef(!1),{escapeKey:I,outsidePress:O}=js(v),w=a.useRef(null),A=Ze(),G=Ze(),F=X(()=>{G.clear(),s.current.insideReactTree=!1}),B=a.useRef(!1),S=a.useRef(""),Q=X(f),pe=X(L=>{var Oe;if(!r||!i||!c||L.key!=="Escape"||B.current)return;const be=(Oe=s.current.floatingContext)==null?void 0:Oe.nodeId,Ve=p?$e(p.nodesRef.current,be):[];if(!I&&Ve.length>0){let ue=!0;if(Ve.forEach(x=>{var re;(re=x.context)!=null&&re.open&&!x.context.dataRef.current.__escapeKeyBubbles&&(ue=!1)}),!ue)return}const Fe=fs(L)?L.nativeEvent:L,ve=he(ts,Fe);n.setOpen(!1,ve),!I&&!ve.isPropagationAllowed&&L.stopPropagation()}),ge=X(()=>{s.current.insideReactTree=!0,G.start(0,F)});a.useEffect(()=>{if(!r||!i)return;s.current.__escapeKeyBubbles=I,s.current.__outsidePressBubbles=O;const L=new ke,be=new ke;function Ve(){L.clear(),B.current=!0}function Fe(){L.start(lo()?5:0,()=>{B.current=!1})}function ve(){b.current=!0,be.start(0,()=>{b.current=!1})}function Oe(){_.current=!1,C.current=!1}function ue(){const R=S.current,T=R==="pen"||!R?"mouse":R,te=E(),ee=typeof te=="function"?te():te;return typeof ee=="string"?ee:ee[T]}function x(R){const T=ue();return T==="intentional"&&R.type!=="click"||T==="sloppy"&&R.type==="click"}function re(R){var ee;const T=(ee=s.current.floatingContext)==null?void 0:ee.nodeId,te=p&&$e(p.nodesRef.current,T).some(H=>{var ne;return me(R,(ne=H.context)==null?void 0:ne.elements.floating)});return me(R,n.select("floatingElement"))||me(R,n.select("domReferenceElement"))||te}function se(R){var dn;if(x(R)){F();return}if(s.current.insideReactTree){F();return}const T=Se(R),te=`[${gt("inert")}]`,ee=qe(T)?T.getRootNode():null,H=Array.from((We(ee)?ee:Z(n.select("floatingElement"))).querySelectorAll(te)),ne=n.context.triggerElements;if(T&&(ne.hasElement(T)||ne.hasMatchingElement(ie=>K(ie,T))))return;let oe=qe(T)?T:null;for(;oe&&!Rt(oe);){const ie=fo(oe);if(Rt(ie)||!qe(ie))break;oe=ie}if(H.length&&qe(T)&&!ys(T)&&!K(T,n.select("floatingElement"))&&H.every(ie=>!K(oe,ie)))return;if(ce(T)&&!("touches"in R)){const ie=Rt(T),Le=ht(T),Ge=/auto|scroll/,Qr=ie||Ge.test(Le.overflowX),eo=ie||Ge.test(Le.overflowY),to=Qr&&T.clientWidth>0&&T.scrollWidth>T.clientWidth,no=eo&&T.clientHeight>0&&T.scrollHeight>T.clientHeight,ro=Le.direction==="rtl",oo=no&&(ro?R.offsetX<=T.offsetWidth-T.clientWidth:R.offsetX>T.clientWidth),so=to&&R.offsetY>T.clientHeight;if(oo||so)return}if(re(R))return;if(ue()==="intentional"&&b.current){be.clear(),b.current=!1;return}if(typeof g=="function"&&!g(R))return;const tt=(dn=s.current.floatingContext)==null?void 0:dn.nodeId,fn=p?$e(p.nodesRef.current,tt):[];if(fn.length>0){let ie=!0;if(fn.forEach(Le=>{var Ge;(Ge=Le.context)!=null&&Ge.open&&!Le.context.dataRef.current.__outsidePressBubbles&&(ie=!1)}),!ie)return}n.setOpen(!1,he(Qn,R)),F()}function et(R){ue()!=="sloppy"||R.pointerType==="touch"||!n.select("open")||!i||me(R,n.select("floatingElement"))||me(R,n.select("domReferenceElement"))||se(R)}function N(R){if(ue()!=="sloppy"||!n.select("open")||!i||me(R,n.select("floatingElement"))||me(R,n.select("domReferenceElement")))return;const T=R.touches[0];T&&(w.current={startTime:Date.now(),startX:T.clientX,startY:T.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},A.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}function Y(R,T){const te=Se(R);if(!te)return;const ee=W(te,R.type,()=>{T(R),ee()})}function V(R){S.current="touch",Y(R,N)}function J(R){A.clear(),R.type==="pointerdown"&&(S.current=R.pointerType),!(R.type==="mousedown"&&w.current&&!w.current.dismissOnMouseDown)&&Y(R,T=>{T.type==="pointerdown"?et(T):se(T)})}function k(R){if(!_.current)return;const T=C.current;if(Oe(),ue()==="intentional"){if(R.type==="pointercancel"){T&&ve();return}if(!re(R)){if(T){ve();return}typeof g=="function"&&!g(R)||(be.clear(),b.current=!0,F())}}}function D(R){if(ue()!=="sloppy"||!w.current||me(R,n.select("floatingElement"))||me(R,n.select("domReferenceElement")))return;const T=R.touches[0];if(!T)return;const te=Math.abs(T.clientX-w.current.startX),ee=Math.abs(T.clientY-w.current.startY),H=Math.sqrt(te*te+ee*ee);H>5&&(w.current.dismissOnTouchEnd=!0),H>10&&(se(R),A.clear(),w.current=null)}function z(R){Y(R,D)}function P(R){ue()!=="sloppy"||!w.current||me(R,n.select("floatingElement"))||me(R,n.select("domReferenceElement"))||(w.current.dismissOnTouchEnd&&se(R),A.clear(),w.current=null)}function ae(R){Y(R,P)}const $=Z(o),le=je(c&&je(W($,"keydown",pe),W($,"compositionstart",Ve),W($,"compositionend",Fe)),y&&je(W($,"click",J,!0),W($,"pointerdown",J,!0),W($,"pointerup",k,!0),W($,"pointercancel",k,!0),W($,"mousedown",J,!0),W($,"mouseup",k,!0),W($,"touchstart",V,!0),W($,"touchmove",z,!0),W($,"touchend",ae,!0)));return()=>{le(),L.clear(),be.clear(),Oe(),b.current=!1}},[s,o,c,y,g,r,i,I,O,pe,F,E,p,n,A]),a.useEffect(F,[g,F]);const Me=a.useMemo(()=>({onKeyDown:pe,[Fs[m]]:L=>{Q()&&n.setOpen(!1,he(Ft,L.nativeEvent))},...m!=="intentional"&&{onClick(L){Q()&&n.setOpen(!1,he(Ft,L.nativeEvent))}}}),[pe,n,m,Q]),Ae=X(L=>{if(!r||!i||L.button!==0)return;const be=Se(L.nativeEvent);K(n.select("floatingElement"),be)&&(_.current||(_.current=!0,C.current=!1))}),_e=X(L=>{!r||!i||(L.defaultPrevented||L.nativeEvent.defaultPrevented)&&_.current&&(C.current=!0)}),Be=a.useMemo(()=>({onKeyDown:pe,onPointerDown:_e,onMouseDown:_e,onClickCapture:ge,onMouseDownCapture(L){ge(),Ae(L)},onPointerDownCapture(L){ge(),Ae(L)},onMouseUpCapture:ge,onTouchEndCapture:ge,onTouchMoveCapture:ge}),[pe,ge,Ae,_e]);return a.useMemo(()=>i?{reference:Me,floating:Be,trigger:Me}:{},[i,Me,Be])}const M=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":Ue(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var it={exports:{}},xt={};/**
3
+ * @license React
4
+ * use-sync-external-store-shim.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var Nn;function Ws(){if(Nn)return xt;Nn=1;var e=De;function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function c(m,v){var h=v(),p=r({inst:{value:h,getSnapshot:v}}),l=p[0].inst,g=p[1];return s(function(){l.value=h,l.getSnapshot=v,d(l)&&g({inst:l})},[m,h,v]),o(function(){return d(l)&&g({inst:l}),m(function(){d(l)&&g({inst:l})})},[m]),i(h),h}function d(m){var v=m.getSnapshot;m=m.value;try{var h=v();return!n(m,h)}catch{return!0}}function u(m,v){return v()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:c;return xt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,xt}var Dt={};/**
11
+ * @license React
12
+ * use-sync-external-store-shim.development.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var xn;function Us(){return xn||(xn=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}function t(h,p){f||o.startTransition===void 0||(f=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var l=p();if(!m){var g=p();s(l,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),m=!0)}g=i({inst:{value:l,getSnapshot:p}});var y=g[0].inst,E=g[1];return d(function(){y.value=l,y.getSnapshot=p,n(y)&&E({inst:y})},[h,l,p]),c(function(){return n(y)&&E({inst:y}),h(function(){n(y)&&E({inst:y})})},[h]),u(l),l}function n(h){var p=h.getSnapshot;h=h.value;try{var l=p();return!s(h,l)}catch{return!0}}function r(h,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=De,s=typeof Object.is=="function"?Object.is:e,i=o.useState,c=o.useEffect,d=o.useLayoutEffect,u=o.useDebugValue,f=!1,m=!1,v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Dt.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Dt}var Dn;function un(){return Dn||(Dn=1,process.env.NODE_ENV==="production"?it.exports=Ws():it.exports=Us()),it.exports}var Ks=un(),ct={exports:{}},kt={};/**
19
+ * @license React
20
+ * use-sync-external-store-shim/with-selector.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var kn;function Gs(){if(kn)return kt;kn=1;var e=De,t=un();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,c=e.useMemo,d=e.useDebugValue;return kt.useSyncExternalStoreWithSelector=function(u,f,m,v,h){var p=s(null);if(p.current===null){var l={hasValue:!1,value:null};p.current=l}else l=p.current;p=c(function(){function y(I){if(!E){if(E=!0,_=I,I=v(I),h!==void 0&&l.hasValue){var O=l.value;if(h(O,I))return C=O}return C=I}if(O=C,r(_,I))return O;var w=v(I);return h!==void 0&&h(O,w)?(_=I,O):(_=I,C=w)}var E=!1,_,C,b=m===void 0?null:m;return[function(){return y(f())},b===null?void 0:function(){return y(b())}]},[f,m,v,h]);var g=o(u,p[0],p[1]);return i(function(){l.hasValue=!0,l.value=g},[g]),d(g),g},kt}var Mt={};/**
27
+ * @license React
28
+ * use-sync-external-store-shim/with-selector.development.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var Mn;function Hs(){return Mn||(Mn=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=De,n=un(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,c=t.useMemo,d=t.useDebugValue;Mt.useSyncExternalStoreWithSelector=function(u,f,m,v,h){var p=s(null);if(p.current===null){var l={hasValue:!1,value:null};p.current=l}else l=p.current;p=c(function(){function y(I){if(!E){if(E=!0,_=I,I=v(I),h!==void 0&&l.hasValue){var O=l.value;if(h(O,I))return C=O}return C=I}if(O=C,r(_,I))return O;var w=v(I);return h!==void 0&&h(O,w)?(_=I,O):(_=I,C=w)}var E=!1,_,C,b=m===void 0?null:m;return[function(){return y(f())},b===null?void 0:function(){return y(b())}]},[f,m,v,h]);var g=o(u,p[0],p[1]);return i(function(){l.hasValue=!0,l.value=g},[g]),d(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Mt}var An;function Ys(){return An||(An=1,process.env.NODE_ENV==="production"?ct.exports=Gs():ct.exports=Hs()),ct.exports}var qs=Ys();const Xs=Jt(19),zs=Xs?Js:Qs;function Nr(e,t,n,r,o){return zs(e,t,n,r,o)}function Zs(e,t,n,r,o){const s=a.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Ks.useSyncExternalStore(e.subscribe,s,s)}function Js(e,t,n,r,o){return Zs(e,t,n,r,o)}function Qs(e,t,n,r,o){return qs.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class ei{constructor(t){U(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));U(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Nr(this,t,n,r,o)}}class xr extends ei{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){a.useDebugValue(t),q(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;q(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this;if(process.env.NODE_ENV!=="production"){a.useDebugValue(t,i=>Object.keys(i));const o=a.useRef(Object.keys(t)).current,s=Object.keys(t);(o.length!==s.length||o.some((i,c)=>i!==s[c]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const r=Object.values(t);q(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){a.useDebugValue(t);const r=n!==void 0;if(q(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r]),process.env.NODE_ENV!=="production"){const o=this.controlledValues??(this.controlledValues=new Map);o.has(t)||o.set(t,r);const s=o.get(t);s!==void 0&&s!==r&&console.error(`A component is changing the ${r?"":"un"}controlled state of ${t.toString()} to be ${r?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return a.useDebugValue(t),Nr(this,this.selectors[t],n,r,o)}useContextCallback(t,n){a.useDebugValue(t);const r=X(n??Qt);this.context[t]=r}useStateSetter(t){const n=a.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const c=o;o=i,n(i,c,this)}})}}const ti={open:M(e=>e.open),transitionStatus:M(e=>e.transitionStatus),domReferenceElement:M(e=>e.domReferenceElement),referenceElement:M(e=>e.positionReference??e.referenceElement),floatingElement:M(e=>e.floatingElement),floatingId:M(e=>e.floatingId)};class Dr extends xr{constructor(n){const{syncOnly:r,nested:o,onOpenChange:s,triggerElements:i,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:Ds(),nested:o,triggerElements:i},ti);U(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&ur(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});U(this,"dispatchOpenChange",(n,r)=>{this.syncOpenEvent(n,r.event);const o={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",o)});U(this,"setOpen",(n,r)=>{var o,s,i,c;if(this.syncOnly){(s=(o=this.context).onOpenChange)==null||s.call(o,n,r);return}this.dispatchOpenChange(n,r),(c=(i=this.context).onOpenChange)==null||c.call(i,n,r)});this.syncOnly=r}}function ni(e,t=!1,n=!1){const[r,o]=a.useState(e&&t?"idle":void 0),[s,i]=a.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),q(()=>{if(!e&&s&&r!=="ending"&&n){const c=Ee.request(()=>{o("ending")});return()=>{Ee.cancel(c)}}},[e,s,r,n]),q(()=>{if(!e||t)return;const c=Ee.request(()=>{o(void 0)});return()=>{Ee.cancel(c)}},[t,e]),q(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const c=Ee.request(()=>{o("idle")});return()=>{Ee.cancel(c)}},[t,e,s,r]),{mounted:s,setMounted:i,transitionStatus:r}}function ri(e,t=!1,n=!0){const r=nn();return X((o,s=null)=>{r.cancel();const i=ye(e);if(i==null)return;const c=i,d=()=>{Gt.flushSync(o)};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){o();return}function u(){Promise.all(c.getAnimations().map(f=>f.finished)).then(()=>{s!=null&&s.aborted||d()}).catch(()=>{if(n){s!=null&&s.aborted||d();return}const f=c.getAnimations();!(s!=null&&s.aborted)&&f.length>0&&f.some(m=>m.pending||m.playState!=="finished")&&u()})}if(t){const f=ze.startingStyle;if(!c.hasAttribute(f)){r.request(u);return}const m=new MutationObserver(()=>{c.hasAttribute(f)||(m.disconnect(),u())});m.observe(c,{attributes:!0,attributeFilter:[f]}),s==null||s.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(u)})}function kr(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=X(o),i=ri(r,n,!1);a.useEffect(()=>{if(!t)return;const c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,n,s,i])}function oi(e,t){const n=a.useRef(null),r=a.useRef(null);return a.useCallback(o=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=r.current,c=t.context.triggerElements.getById(s);i&&c===i&&t.context.triggerElements.delete(s),n.current=null,r.current=null}o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function si(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=oi(e,n),i=X(c=>{if(s(c),!c||!n.select("open"))return;const d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:c,...r});return}d==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return q(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:o}}function ii(e){const t=e.useState("open");q(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function ci(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=ni(e);t.useSyncedValues({mounted:r,transitionStatus:s});const i=X(()=>{var d,u;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),(u=(d=t.context).onOpenChangeComplete)==null||u.call(d,!1)}),c=t.useState("preventUnmountingOnClose");return kr({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class Mr{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);if(r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elementsSet.size!==this.idMap.size))throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.")}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function ui(){return new Dr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Mr,floatingId:"",syncOnly:!1,nested:!1,onOpenChange:void 0})}function ai(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:ui(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:fe,inactiveTriggerProps:fe,popupProps:fe}}const ut=M(e=>e.triggerIdProp??e.activeTriggerId),li={open:M(e=>e.openProp??e.open),mounted:M(e=>e.mounted),transitionStatus:M(e=>e.transitionStatus),floatingRootContext:M(e=>e.floatingRootContext),preventUnmountingOnClose:M(e=>e.preventUnmountingOnClose),payload:M(e=>e.payload),activeTriggerId:ut,activeTriggerElement:M(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:M((e,t)=>t!==void 0&&ut(e)===t),isOpenedByTrigger:M((e,t)=>t!==void 0&&ut(e)===t&&e.open),isMountedByTrigger:M((e,t)=>t!==void 0&&ut(e)===t&&e.mounted),triggerProps:M((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:M(e=>e.popupProps),popupElement:M(e=>e.popupElement),positionerElement:M(e=>e.positionerElement)};function fi(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,o=Et(),s=_r()!=null,i=t.useState("open"),c=t.useState("activeTriggerElement"),d=t.useState(n?"popupElement":"positionerElement"),u=t.context.triggerElements,f=we(()=>new Dr({open:i,transitionStatus:void 0,referenceElement:c,floatingElement:d,triggerElements:u,onOpenChange:r,floatingId:o,syncOnly:!0,nested:s})).current;return q(()=>{const m={open:i,floatingId:o,referenceElement:c,floatingElement:d};qe(c)&&(m.domReferenceElement=c),f.state.positionReference===f.state.referenceElement&&(m.positionReference=c),f.update(m)},[i,o,c,d,f]),f.context.onOpenChange=r,f.context.nested=s,f}function Ar(e=[]){const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=e.map(u=>u==null?void 0:u.trigger),s=a.useCallback(u=>at(u,e,"reference"),t),i=a.useCallback(u=>at(u,e,"floating"),n),c=a.useCallback(u=>at(u,e,"item"),r),d=a.useCallback(u=>at(u,e,"trigger"),o);return a.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:c,getTriggerProps:d}),[s,i,c,d])}function at(e,t,n){var i;const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[jt]="");for(const c in e)o&&e&&(c===ar||c===lr)||(s[c]=e[c]);for(let c=0;c<t.length;c+=1){let d;const u=(i=t[c])==null?void 0:i[n];typeof u=="function"?d=e?u(e):null:d=u,d&&Bn(s,d,o,r)}return Bn(s,e,o,r),s}function Bn(e,t,n,r){var o;for(const s in t){const i=t[s];n&&(s===ar||s===lr)||(s.startsWith("on")?(r.has(s)||r.set(s,[]),typeof i=="function"&&((o=r.get(s))==null||o.push(i),e[s]=(...c)=>{var d;return(d=r.get(s))==null?void 0:d.map(u=>u(...c)).find(u=>u!==void 0)})):e[s]=i)}}const di=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function pi(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{role:c="dialog"}=t,d=Et(),u=(s==null?void 0:s.id)||d,f=a.useMemo(()=>{var E;return((E=$t(i))==null?void 0:E.id)||o},[i,o]),m=di.get(c)??c,h=_r()!=null,p=a.useMemo(()=>m==="tooltip"||c==="label"?fe:{"aria-haspopup":m==="alertdialog"?"dialog":m,"aria-expanded":"false",...m==="listbox"&&{role:"combobox"},...m==="menu"&&h&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[m,h,c]),l=a.useMemo(()=>m==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:r?f:void 0}:{...p,"aria-expanded":r?"true":"false","aria-controls":r?f:void 0,...m==="menu"&&{id:u}},[m,f,r,u,c,p]),g=a.useMemo(()=>{const E={id:f,...m&&{role:m}};return m==="tooltip"||c==="label"?E:{...E,...m==="menu"&&{"aria-labelledby":u}}},[m,f,u,c]),y=a.useCallback(({active:E,selected:_})=>{const C={role:"option",...E&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...C,"aria-selected":_}}return{}},[f,c]);return a.useMemo(()=>({reference:l,floating:g,item:y,trigger:p}),[l,g,p,y])}let gi=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),mi=(function(e){return e[e.open=xe.open]="open",e[e.closed=xe.closed]="closed",e[e.startingStyle=xe.startingStyle]="startingStyle",e[e.endingStyle=xe.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const an=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(an.displayName="DialogPortalContext");function hi(){const e=a.useContext(an);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Portal> is missing.":Ue(26));return e}const Br="ArrowUp",Vr="ArrowDown",Fr="ArrowLeft",Lr="ArrowRight",jr="Home",$r="End",bi=new Set([Fr,Lr]),Ei=new Set([Br,Vr]),yi=new Set([...bi,...Ei]);[...yi];const Si=new Set([Br,Vr,Fr,Lr,jr,$r]),Ri={...Zn,...zn,nestedDialogOpen(e){return e?{[mi.nestedDialogOpen]:""}:null}},Wr=a.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,style:c,...d}=t,{store:u}=Ie(),f=u.useState("descriptionElementId"),m=u.useState("disablePointerDismissal"),v=u.useState("floatingRootContext"),h=u.useState("popupProps"),p=u.useState("modal"),l=u.useState("mounted"),g=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),E=u.useState("open"),_=u.useState("openMethod"),C=u.useState("titleElementId"),b=u.useState("transitionStatus"),I=u.useState("role");hi(),kr({open:E,ref:u.context.popupRef,onComplete(){var B,S;E&&((S=(B=u.context).onOpenChangeComplete)==null||S.call(B,!0))}});function O(B){return B==="touch"?u.context.popupRef.current:!0}const w=s===void 0?O:s,A=y>0,F=Ce("div",t,{state:{open:E,nested:g,transitionStatus:b,nestedDialogOpen:A},props:[h,{"aria-labelledby":C??void 0,"aria-describedby":f??void 0,role:I,tabIndex:-1,hidden:!l,onKeyDown(B){Si.has(B.key)&&B.stopPropagation()},style:{[gi.nestedDialogs]:y}},d],ref:[n,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:Ri});return j.jsx(Bs,{context:v,openInteractionType:_,disabled:!l,closeOnFocusOut:!m,initialFocus:w,returnFocus:o,modal:p!==!1,restoreFocus:"popup",children:F})});process.env.NODE_ENV!=="production"&&(Wr.displayName="DialogPopup");function vi(e){return Jt(19)?e:e?"true":void 0}const Ur=a.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return j.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(Ur.displayName="InternalBackdrop");const Kr=a.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=Ie(),i=s.useState("mounted"),c=s.useState("modal"),d=s.useState("open");return i||r?j.jsx(an.Provider,{value:r,children:j.jsxs(wr,{ref:n,...o,children:[i&&c===!0&&j.jsx(Ur,{ref:s.context.internalBackdropRef,inert:vi(!d)}),t.children]})}):null});process.env.NODE_ENV!=="production"&&(Kr.displayName="DialogPortal");function Oi(e){const t=a.useRef(!0);t.current&&(t.current=!1,e())}let Vn={},Fn={},Ln="";function Ti(e){if(typeof document>"u")return!1;const t=Z(e);return Re(t).innerWidth-t.documentElement.clientWidth>0}function wi(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Z(e),r=n.documentElement,o=n.body,s=Yt(r)?r:o,i=s.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const d=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=c,d===u}function Ci(e){const t=Z(e),n=t.documentElement,r=t.body,o=Yt(n)?n:r,s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Ii(e){var h;const t=Z(e),n=t.documentElement,r=t.body,o=Re(n);let s=0,i=0,c=!1;const d=Ee.create();if(ir&&(((h=o.visualViewport)==null?void 0:h.scale)??1)!==1)return()=>{};function u(){const p=o.getComputedStyle(n),l=o.getComputedStyle(r),E=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Vn={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ln=n.style.scrollBehavior,Fn={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const _=n.scrollHeight>n.clientHeight,C=n.scrollWidth>n.clientWidth,b=p.overflowY==="scroll"||l.overflowY==="scroll",I=p.overflowX==="scroll"||l.overflowX==="scroll",O=Math.max(0,o.innerWidth-r.clientWidth),w=Math.max(0,o.innerHeight-r.clientHeight),A=parseFloat(l.marginTop)+parseFloat(l.marginBottom),G=parseFloat(l.marginLeft)+parseFloat(l.marginRight),F=Yt(n)?n:r;if(c=wi(e),c){n.style.scrollbarGutter=E,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(_||b)&&(n.style.overflowY="scroll"),(C||I)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:A||w?`calc(100dvh - ${A+w}px)`:"100dvh",width:G||O?`calc(100vw - ${G+O}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,Vn),Object.assign(r.style,Fn),c||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Ln)}function m(){f(),d.request(u)}u();const v=W(o,"resize",m);return()=>{d.cancel(),f(),typeof o.removeEventListener=="function"&&v()}}class _i{constructor(){U(this,"lockCount",0);U(this,"restore",null);U(this,"timeoutLock",ke.create());U(this,"timeoutUnlock",ke.create());U(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});U(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Z(t).documentElement,o=Re(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=Qt;return}const s=cr||!Ti(t);this.restore=s?Ci(t):Ii(t)}}const Pi=new _i;function Ni(e=!0,t=null){q(()=>{if(e)return Pi.acquire(t)},[e,t])}function xi(e){const t=a.useRef(""),n=a.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:a.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function Di(e,t){const n=a.useRef(e),r=X(t);q(()=>{n.current!==e&&r(n.current)},[e,r]),q(()=>{n.current=e},[e])}function ki(e){const[t,n]=a.useState(null),r=X((i,c)=>{e||n(c||(cr?"touch":""))});Di(e,i=>{i&&!e&&n(null)});const{onClick:o,onPointerDown:s}=xi(r);return a.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:s}}),[t,o,s])}function Mi(e){const{store:t,parentContext:n,actionsRef:r,isDrawer:o}=e,s=t.useState("open"),i=t.useState("disablePointerDismissal"),c=t.useState("modal"),d=t.useState("popupElement"),{openMethod:u,triggerProps:f}=ki(s);ii(t);const{forceUnmount:m}=ci(s,t),v=a.useCallback(()=>{t.setOpen(!1,he(ns))},[t]);a.useImperativeHandle(r,()=>({unmount:m,close:v}),[m,v]);const h=fi({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[p,l]=a.useState(0),[g,y]=a.useState(0),E=p===0,_=pi(h),C=$s(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:c==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(F){if(!t.context.outsidePressEnabledRef.current||"button"in F&&F.button!==0||"touches"in F&&F.touches.length!==1)return!1;const B=Se(F);if(E&&!i){const S=B;return c&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===S||t.context.backdropRef.current===S||K(S,d)&&!(S!=null&&S.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:E});Ni(s&&c===!0,d);const{getReferenceProps:b,getFloatingProps:I,getTriggerProps:O}=Ar([_,C]);t.useContextCallback("onNestedDialogOpen",(F,B)=>{l(F),y(B)}),t.useContextCallback("onNestedDialogClose",()=>{l(0),y(0)}),a.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&s&&n.onNestedDialogOpen(p+1,g+(o?1:0)),n!=null&&n.onNestedDialogClose&&!s&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&s&&n.onNestedDialogClose()}),[o,s,p,g,n]);const w=a.useMemo(()=>b(f),[b,f]),A=a.useMemo(()=>O(f),[O,f]),G=a.useMemo(()=>I(),[I]);t.useSyncedValues({openMethod:u,activeTriggerProps:w,inactiveTriggerProps:A,popupProps:G,floatingRootContext:h,nestedOpenDialogCount:p,nestedOpenDrawerCount:g})}const Ai={...li,modal:M(e=>e.modal),nested:M(e=>e.nested),nestedOpenDialogCount:M(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:M(e=>e.nestedOpenDrawerCount),disablePointerDismissal:M(e=>e.disablePointerDismissal),openMethod:M(e=>e.openMethod),descriptionElementId:M(e=>e.descriptionElementId),titleElementId:M(e=>e.titleElementId),viewportElement:M(e=>e.viewportElement),role:M(e=>e.role)};class ln extends xr{constructor(n){super(Bi(n),{popupRef:a.createRef(),backdropRef:a.createRef(),internalBackdropRef:a.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Mr,onOpenChange:void 0,onOpenChangeComplete:void 0},Ai);U(this,"setOpen",(n,r)=>{var i,c,d;if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(c=(i=this.context).onOpenChange)==null||c.call(i,n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const o={open:n},s=((d=r.trigger)==null?void 0:d.id)??null;(s||n)&&(o.activeTriggerId=s,o.activeTriggerElement=r.trigger??null),this.update(o)})}static useStore(n,r){const o=we(()=>new ln(r)).current;return n??o}}function Bi(e={}){return{...ai(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}const Kt=a.createContext(!1);process.env.NODE_ENV!=="production"&&(Kt.displayName="IsDrawerContext");function Vi(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:d,handle:u,triggerId:f,defaultTriggerId:m=null}=e,v=Ie(!0),h=a.useContext(Kt),p=!!v,l=ln.useStore(u==null?void 0:u.store,{open:r,openProp:n,activeTriggerId:m,triggerIdProp:f,modal:c,disablePointerDismissal:i,nested:p});Oi(()=>{n===void 0&&l.state.open===!1&&r===!0&&l.update({open:!0,activeTriggerId:m})}),l.useControlledProp("openProp",n),l.useControlledProp("triggerIdProp",f),l.useSyncedValues({disablePointerDismissal:i,nested:p,modal:c}),l.useContextCallback("onOpenChange",o),l.useContextCallback("onOpenChangeComplete",s);const g=l.useState("payload");Mi({store:l,actionsRef:d,parentContext:v==null?void 0:v.store.context,isDrawer:h});const y=a.useMemo(()=>({store:l}),[l]);return j.jsx(Kt.Provider,{value:!1,children:j.jsx(en.Provider,{value:y,children:typeof t=="function"?t({payload:g}):t})})}const Gr=a.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...c}=t,{store:d}=Ie(),u=tn(i);return d.useSyncedValueWithCleanup("titleElementId",u),Ce("h2",t,{ref:n,props:[{id:u},c]})});process.env.NODE_ENV!=="production"&&(Gr.displayName="DialogTitle");const Hr=a.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,id:c,payload:d,handle:u,style:f,...m}=t,v=Ie(!0),h=(u==null?void 0:u.store)??(v==null?void 0:v.store);if(!h)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.":Ue(79));const p=tn(c),l=h.useState("floatingRootContext"),g=h.useState("isOpenedByTrigger",p),y=a.useRef(null),{registerTrigger:E,isMountedByThisTrigger:_}=si(p,y,h,{payload:d}),{getButtonProps:C,buttonRef:b}=Zt({disabled:s,native:i}),I=Vs(l,{enabled:l!=null}),O=Ar([I]),w={disabled:s,open:g},A=h.useState("triggerProps",_);return Ce("button",t,{state:w,ref:[b,n,E,y],props:[O.getReferenceProps(),A,{[Or]:"",id:p},m,C],stateAttributesMapping:Zo})});process.env.NODE_ENV!=="production"&&(Hr.displayName="DialogTrigger");const Qe={"Modal-Backdrop":"_Modal-Backdrop_1gbjc_1","Modal-Panel":"_Modal-Panel_1gbjc_17","Modal-Title":"_Modal-Title_1gbjc_53","Modal-Description":"_Modal-Description_1gbjc_62"},Yr=function({children:t,open:n,onOpenChange:r}){return j.jsx(Vi,{open:n,onOpenChange:r,children:t})};Yr.displayName="Modal.Root";const qr=function({children:t,render:n=j.jsx(bt,{})}){return j.jsx(Hr,{render:n,children:t})};qr.displayName="Modal.Trigger";const Xr=a.forwardRef(function({children:t,className:n,...r},o){return j.jsxs(Kr,{children:[j.jsx(Jn,{className:[Qe["Modal-Backdrop"]].filter(Boolean).join(" ")}),j.jsx(Wr,{ref:o,className:[Qe["Modal-Panel"],n].filter(Boolean).join(" "),...r,children:t})]})});Xr.displayName="Modal.Panel";const zr=a.forwardRef(function({children:t,className:n,...r},o){return j.jsx(Gr,{ref:o,className:[Qe["Modal-Title"],n].filter(Boolean).join(" "),...r,children:t})});zr.displayName="Modal.Title";const Zr=a.forwardRef(function({children:t,className:n,...r},o){return j.jsx(nr,{ref:o,className:[Qe["Modal-Description"],n].filter(Boolean).join(" "),...r,children:t})});Zr.displayName="Modal.Description";const Jr=a.forwardRef(function({children:t,className:n,render:r=j.jsx(bt,{variant:"secondary"}),...o},s){return j.jsx(tr,{ref:s,className:[Qe["Modal-Close"],n].filter(Boolean).join(" "),render:r,...o,children:t})});Jr.displayName="Modal.Close";const Fi={Root:Yr,Trigger:qr,Panel:Xr,Title:zr,Description:Zr,Close:Jr};exports.Button=bt;exports.Modal=Fi;
@@ -0,0 +1,67 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import * as React_2 from 'react';
3
+
4
+ export declare const Button: React_2.ForwardRefExoticComponent<ButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
5
+
6
+ export declare interface ButtonProps {
7
+ children?: string | string[];
8
+ id?: string;
9
+ className?: string;
10
+ variant?: ButtonVariant;
11
+ disabled?: boolean;
12
+ onClick?: (event: React_2.MouseEvent<HTMLButtonElement>) => void;
13
+ onFocus?: (event: React_2.FocusEvent<HTMLButtonElement>) => void;
14
+ onBlur?: (event: React_2.FocusEvent<HTMLButtonElement>) => void;
15
+ }
16
+
17
+ export declare type ButtonVariant = 'primary' | 'secondary';
18
+
19
+ export declare const Modal: {
20
+ Root: {
21
+ ({ children, open, onOpenChange }: ModalRootProps): JSX.Element;
22
+ displayName: string;
23
+ };
24
+ Trigger: {
25
+ ({ children, render }: ModalTriggerProps): JSX.Element;
26
+ displayName: string;
27
+ };
28
+ Panel: React_2.ForwardRefExoticComponent<ModalPanelProps & React_2.RefAttributes<HTMLDivElement>>;
29
+ Title: React_2.ForwardRefExoticComponent<ModalTitleProps & React_2.RefAttributes<HTMLHeadingElement>>;
30
+ Description: React_2.ForwardRefExoticComponent<ModalDescriptionProps & React_2.RefAttributes<HTMLParagraphElement>>;
31
+ Close: React_2.ForwardRefExoticComponent<ModalCloseProps & React_2.RefAttributes<HTMLButtonElement>>;
32
+ };
33
+
34
+ export declare interface ModalCloseProps {
35
+ children?: React_2.ReactNode;
36
+ className?: string;
37
+ render?: React_2.ReactElement;
38
+ }
39
+
40
+ export declare interface ModalDescriptionProps {
41
+ children?: React_2.ReactNode;
42
+ className?: string;
43
+ }
44
+
45
+ export declare interface ModalPanelProps {
46
+ children?: React_2.ReactNode;
47
+ className?: string;
48
+ }
49
+
50
+ export declare interface ModalRootProps {
51
+ children?: React_2.ReactNode;
52
+ open?: boolean;
53
+ onOpenChange?: (open: boolean) => void;
54
+ }
55
+
56
+ export declare interface ModalTitleProps {
57
+ children?: React_2.ReactNode;
58
+ className?: string;
59
+ }
60
+
61
+ export declare interface ModalTriggerProps {
62
+ children?: React_2.ReactNode;
63
+ /** @default <Button /> */
64
+ render?: React_2.ReactElement;
65
+ }
66
+
67
+ export { }