
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d9f587cc-622b-5127-b2b2-9e504b55f5d3")}catch(e){}}();
import{r as s,e as f,R as J}from"./index-D6da9p6-.js";import{p as Be,r as xe}from"./bugs-DVQzBh-s.js";import{o as b,U as P,y as C,f as fe,u as A,C as O,t as pe,b as me,l as ee,O as ue,I as H,a as Ie}from"./keyboard-CaEu2o0u.js";import{n as Ne,s as _,c as We,E as ge,e as Ye,N as Ue,l as K,t as Q}from"./use-root-containers-DAbWL8gl.js";import{O as V,M as R,a as ve,y as D,N as _e}from"./use-is-mounted-BaHv16bB.js";import{n as he,t as je,u as Ve,d as j,y as qe}from"./transition-y-5XFFuu.js";import{f as se,s as ce}from"./hidden-KuoXmiN5.js";import{G as Ge,w as ze}from"./description-BklOXbF-.js";function te(e,t){let n=s.useRef([]),r=b(e);s.useEffect(()=>{let o=[...n.current];for(let[l,i]of t.entries())if(n.current[l]!==i){let a=r(t,o);return n.current=t,a}},[r,...t])}function Xe(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let T=[];Xe(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&T[0]!==t.target&&(T.unshift(t.target),T=T.filter(n=>n!=null&&n.isConnected),T.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Ee(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let Je="div";var we=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(we||{});function Ke(e,t){let n=s.useRef(null),r=C(n,t),{initialFocus:o,containers:l,features:i=30,...a}=e;fe()||(i=1);let u=he(n);et({ownerDocument:u},!!(i&16));let p=tt({ownerDocument:u,container:n,initialFocus:o},!!(i&2));nt({ownerDocument:u,container:n,containers:l,previousActiveElement:p},!!(i&8));let d=Ne(),k=b(h=>{let m=n.current;m&&($=>$())(()=>{A(d.current,{[_.Forwards]:()=>{V(m,R.First,{skipElements:[h.relatedTarget]})},[_.Backwards]:()=>{V(m,R.Last,{skipElements:[h.relatedTarget]})}})})}),x=Be(),w=s.useRef(!1),E={ref:r,onKeyDown(h){h.key=="Tab"&&(w.current=!0,x.requestAnimationFrame(()=>{w.current=!1}))},onBlur(h){let m=Ee(l);n.current instanceof HTMLElement&&m.add(n.current);let $=h.relatedTarget;$ instanceof HTMLElement&&$.dataset.headlessuiFocusGuard!=="true"&&(ye(m,$)||(w.current?V(n.current,A(d.current,{[_.Forwards]:()=>R.Next,[_.Backwards]:()=>R.Previous})|R.WrapAround,{relativeTo:h.target}):h.target instanceof HTMLElement&&D(h.target)))}};return f.createElement(f.Fragment,null,!!(i&4)&&f.createElement(se,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:k,features:ce.Focusable}),O({ourProps:E,theirProps:a,defaultTag:Je,name:"FocusTrap"}),!!(i&4)&&f.createElement(se,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:k,features:ce.Focusable}))}let Qe=P(Ke),M=Object.assign(Qe,{features:we});function Ze(e=!0){let t=s.useRef(T.slice());return te(([n],[r])=>{r===!0&&n===!1&&pe(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=T.slice())},[e,T,t]),b(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function et({ownerDocument:e},t){let n=Ze(t);te(()=>{t||e?.activeElement===e?.body&&D(n())},[t]),We(()=>{t&&D(n())})}function tt({ownerDocument:e,container:t,initialFocus:n},r){let o=s.useRef(null),l=ve();return te(()=>{if(!r)return;let i=t.current;i&&pe(()=>{if(!l.current)return;let a=e?.activeElement;if(n!=null&&n.current){if(n?.current===a){o.current=a;return}}else if(i.contains(a)){o.current=a;return}n!=null&&n.current?D(n.current):V(i,R.First)===_e.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.current=e?.activeElement})},[r]),o}function nt({ownerDocument:e,container:t,containers:n,previousActiveElement:r},o){let l=ve();ge(e?.defaultView,"focus",i=>{if(!o||!l.current)return;let a=Ee(n);t.current instanceof HTMLElement&&a.add(t.current);let u=r.current;if(!u)return;let p=i.target;p&&p instanceof HTMLElement?ye(a,p)?(r.current=p,D(p)):(i.preventDefault(),i.stopPropagation(),D(u)):D(r.current)},!0)}function ye(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function rt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const ot=typeof Object.is=="function"?Object.is:rt,{useState:at,useEffect:lt,useLayoutEffect:it,useDebugValue:ut}=J;function st(e,t,n){const r=t(),[{inst:o},l]=at({inst:{value:r,getSnapshot:t}});return it(()=>{o.value=r,o.getSnapshot=t,z(o)&&l({inst:o})},[e,r,t]),lt(()=>(z(o)&&l({inst:o}),e(()=>{z(o)&&l({inst:o})})),[e]),ut(r),r}function z(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!ot(n,r)}catch{return!0}}function ct(e,t,n){return t()}const dt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ft=!dt,pt=ft?ct:st,mt="useSyncExternalStore"in J?(e=>e.useSyncExternalStore)(J):pt;function gt(e){return mt(e.subscribe,e.getSnapshot,e.getSnapshot)}function vt(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...l){let i=t[o].call(n,...l);i&&(n=i,r.forEach(a=>a()))}}}function ht(){let e;return{before({doc:t}){var n;let r=t.documentElement;e=((n=t.defaultView)!=null?n:window).innerWidth-r.clientWidth},after({doc:t,d:n}){let r=t.documentElement,o=r.clientWidth-r.offsetWidth,l=e-o;n.style(r,"paddingRight",`${l}px`)}}}function Et(){return je()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(l=>l()).some(l=>l.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=me();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let l=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let u=a.target.closest("a");if(!u)return;let{hash:p}=new URL(u.href),d=e.querySelector(p);d&&!r(d)&&(i=d)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let u=a.target;for(;u.parentElement&&r(u.parentElement);)u=u.parentElement;t.style(u,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let u=a.target;for(;u.parentElement&&u.dataset.headlessuiPortal!==""&&!(u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth);)u=u.parentElement;u.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()},{passive:!1}),t.add(()=>{var a;let u=(a=window.scrollY)!=null?a:window.pageYOffset;l!==u&&window.scrollTo(0,l),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function wt(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function yt(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let L=vt(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:me(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:yt(n)},o=[Et(),ht(),wt()];o.forEach(({before:l})=>l?.(r)),o.forEach(({after:l})=>l?.(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});L.subscribe(()=>{let e=L.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&L.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&L.dispatch("TEARDOWN",n)}});function bt(e,t,n){let r=gt(L),o=e?r.get(e):void 0,l=o?o.count>0:!1;return ee(()=>{if(!(!e||!t))return L.dispatch("PUSH",e,n),()=>L.dispatch("POP",e,n)},[t,e]),l}let X=new Map,F=new Map;function de(e,t=!0){ee(()=>{var n;if(!t)return;let r=typeof e=="function"?e():e.current;if(!r)return;function o(){var i;if(!r)return;let a=(i=F.get(r))!=null?i:1;if(a===1?F.delete(r):F.set(r,a-1),a!==1)return;let u=X.get(r);u&&(u["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",u["aria-hidden"]),r.inert=u.inert,X.delete(r))}let l=(n=F.get(r))!=null?n:0;return F.set(r,l+1),l!==0||(X.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),o},[e,t])}let ne=s.createContext(()=>{});ne.displayName="StackContext";var Z=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Z||{});function $t(){return s.useContext(ne)}function Tt({children:e,onUpdate:t,type:n,element:r,enabled:o}){let l=$t(),i=b((...a)=>{t?.(...a),l(...a)});return ee(()=>{let a=o===void 0||o===!0;return a&&i(0,n,r),()=>{a&&i(1,n,r)}},[i,n,r,o]),f.createElement(ne.Provider,{value:i},e)}var Lt=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Lt||{}),Dt=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Dt||{});let St={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},q=s.createContext(null);q.displayName="DialogContext";function B(e){let t=s.useContext(q);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,B),n}return t}function Rt(e,t,n=()=>[document.body]){bt(e,t,r=>{var o;return{containers:[...(o=r.containers)!=null?o:[],n]}})}function Pt(e,t){return A(t.type,St,e,t)}let Ct="div",Ot=ue.RenderStrategy|ue.Static;function kt(e,t){let n=H(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:l,initialFocus:i,role:a="dialog",__demoMode:u=!1,...p}=e,[d,k]=s.useState(0),x=s.useRef(!1);a=function(){return a==="dialog"||a==="alertdialog"?a:(x.current||(x.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let w=Ve();o===void 0&&w!==null&&(o=(w&j.Open)===j.Open);let E=s.useRef(null),h=C(E,t),m=he(E),$=e.hasOwnProperty("open")||w!==null,re=e.hasOwnProperty("onClose");if(!$&&!re)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!$)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!re)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof o!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${o}`);if(typeof l!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${l}`);let g=o?0:1,[I,be]=s.useReducer(Pt,{titleId:null,descriptionId:null,panelRef:s.createRef()}),S=b(()=>l(!1)),oe=b(c=>be({type:0,id:c})),N=fe()?u?!1:g===0:!1,W=d>1,ae=s.useContext(q)!==null,[$e,Te]=Ye(),Le={get current(){var c;return(c=I.panelRef.current)!=null?c:E.current}},{resolveContainers:G,mainTreeNodeRef:Y,MainTreeNode:De}=Ue({portals:$e,defaultContainers:[Le]}),Se=W?"parent":"leaf",le=w!==null?(w&j.Closing)===j.Closing:!1,Re=ae||le?!1:N,Pe=s.useCallback(()=>{var c,y;return(y=Array.from((c=m?.querySelectorAll("body > *"))!=null?c:[]).find(v=>v.id==="headlessui-portal-root"?!1:v.contains(Y.current)&&v instanceof HTMLElement))!=null?y:null},[Y]);de(Pe,Re);let Ce=W?!0:N,Oe=s.useCallback(()=>{var c,y;return(y=Array.from((c=m?.querySelectorAll("[data-headlessui-portal]"))!=null?c:[]).find(v=>v.contains(Y.current)&&v instanceof HTMLElement))!=null?y:null},[Y]);de(Oe,Ce),qe(G,S,!(!N||W));let ke=!(W||g!==0);ge(m?.defaultView,"keydown",c=>{ke&&(c.defaultPrevented||c.key===Ie.Escape&&(c.preventDefault(),c.stopPropagation(),S()))}),Rt(m,!(le||g!==0||ae),G),s.useEffect(()=>{if(g!==0||!E.current)return;let c=new ResizeObserver(y=>{for(let v of y){let U=v.target.getBoundingClientRect();U.x===0&&U.y===0&&U.width===0&&U.height===0&&S()}});return c.observe(E.current),()=>c.disconnect()},[g,E,S]);let[Me,Fe]=ze(),Ae=s.useMemo(()=>[{dialogState:g,close:S,setTitleId:oe},I],[g,I,S,oe]),ie=s.useMemo(()=>({open:g===0}),[g]),He={ref:h,id:r,role:a,"aria-modal":g===0?!0:void 0,"aria-labelledby":I.titleId,"aria-describedby":Me};return f.createElement(Tt,{type:"Dialog",enabled:g===0,element:E,onUpdate:b((c,y)=>{y==="Dialog"&&A(c,{[Z.Add]:()=>k(v=>v+1),[Z.Remove]:()=>k(v=>v-1)})})},f.createElement(K,{force:!0},f.createElement(Q,null,f.createElement(q.Provider,{value:Ae},f.createElement(Q.Group,{target:E},f.createElement(K,{force:!1},f.createElement(Fe,{slot:ie,name:"Dialog.Description"},f.createElement(M,{initialFocus:i,containers:G,features:N?A(Se,{parent:M.features.RestoreFocus,leaf:M.features.All&~M.features.FocusLock}):M.features.None},f.createElement(Te,null,O({ourProps:He,theirProps:p,slot:ie,defaultTag:Ct,features:Ot,visible:g===0,name:"Dialog"}))))))))),f.createElement(De,null))}let Mt="div";function Ft(e,t){let n=H(),{id:r=`headlessui-dialog-overlay-${n}`,...o}=e,[{dialogState:l,close:i}]=B("Dialog.Overlay"),a=C(t),u=b(d=>{if(d.target===d.currentTarget){if(xe(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),i()}}),p=s.useMemo(()=>({open:l===0}),[l]);return O({ourProps:{ref:a,id:r,"aria-hidden":!0,onClick:u},theirProps:o,slot:p,defaultTag:Mt,name:"Dialog.Overlay"})}let At="div";function Ht(e,t){let n=H(),{id:r=`headlessui-dialog-backdrop-${n}`,...o}=e,[{dialogState:l},i]=B("Dialog.Backdrop"),a=C(t);s.useEffect(()=>{if(i.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[i.panelRef]);let u=s.useMemo(()=>({open:l===0}),[l]);return f.createElement(K,{force:!0},f.createElement(Q,null,O({ourProps:{ref:a,id:r,"aria-hidden":!0},theirProps:o,slot:u,defaultTag:At,name:"Dialog.Backdrop"})))}let Bt="div";function xt(e,t){let n=H(),{id:r=`headlessui-dialog-panel-${n}`,...o}=e,[{dialogState:l},i]=B("Dialog.Panel"),a=C(t,i.panelRef),u=s.useMemo(()=>({open:l===0}),[l]),p=b(d=>{d.stopPropagation()});return O({ourProps:{ref:a,id:r,onClick:p},theirProps:o,slot:u,defaultTag:Bt,name:"Dialog.Panel"})}let It="h2";function Nt(e,t){let n=H(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:l,setTitleId:i}]=B("Dialog.Title"),a=C(t);s.useEffect(()=>(i(r),()=>i(null)),[r,i]);let u=s.useMemo(()=>({open:l===0}),[l]);return O({ourProps:{ref:a,id:r},theirProps:o,slot:u,defaultTag:It,name:"Dialog.Title"})}let Wt=P(kt),Yt=P(Ht),Ut=P(xt),_t=P(Ft),jt=P(Nt),tn=Object.assign(Wt,{Backdrop:Yt,Panel:Ut,Overlay:_t,Title:jt,Description:Ge});export{tn as _};
//# sourceMappingURL=dialog-kI6JNLZ5.js.map

//# debugId=d9f587cc-622b-5127-b2b2-9e504b55f5d3
