import{r as u}from"./CTjT7uj6.js";import{g as se,u as ie,c as G,s as V,a as ae}from"./Bldd7KYq.js";import{g as ce,m as ge}from"./QKzYQIAD.js";import{o as H}from"./AxSM_HGB.js";import{o as j}from"./DW-IO8s5.js";import{a as X,b as _}from"./Bylaj1Lj.js";import{c as ee}from"./BO_9K8Jh.js";import{u as Y,e as Ee}from"./CLyLeslp.js";import{j as N}from"./a85KCWpP.js";import{T as xe,g as le,a as te,r as ye,P as Re}from"./BpFyFnHT.js";import{u as Te}from"./ChkIRQGH.js";function ve(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}const Pe={entering:{opacity:1},entered:{opacity:1}},ke=u.forwardRef(function(t,o){const n=Te(),s={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:r,appear:i=!0,children:a,easing:f,in:E,onEnter:P,onEntered:g,onEntering:T,onExit:h,onExited:p,onExiting:I,style:x,timeout:v=s,TransitionComponent:k=xe,...c}=t,m=u.useRef(null),C=X(m,le(a),o),y=b=>l=>{if(b){const d=m.current;l===void 0?b(d):b(d,l)}},R=y(T),S=y((b,l)=>{ye(b);const d=te({style:x,timeout:v,easing:f},{mode:"enter"});b.style.webkitTransition=n.transitions.create("opacity",d),b.style.transition=n.transitions.create("opacity",d),P&&P(b,l)}),w=y(g),F=y(I),O=y(b=>{const l=te({style:x,timeout:v,easing:f},{mode:"exit"});b.style.webkitTransition=n.transitions.create("opacity",l),b.style.transition=n.transitions.create("opacity",l),h&&h(b)}),B=y(p),D=b=>{r&&r(m.current,b)};return N.jsx(k,{appear:i,in:E,nodeRef:m,onEnter:S,onEntered:w,onEntering:R,onExit:O,onExited:B,onExiting:F,addEndListener:D,timeout:v,...c,children:(b,{ownerState:l,...d})=>u.cloneElement(a,{style:{opacity:0,visibility:b==="exited"&&!E?"hidden":void 0,...Pe[b],...x,...a.props.style},ref:C,...d})})});function Ce(e){return se("MuiBackdrop",e)}ce("MuiBackdrop",["root","invisible"]);const Se=e=>{const{classes:t,invisible:o}=e;return ae({root:["root",o&&"invisible"]},Ce,t)},we=V("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),Ie=u.forwardRef(function(t,o){const n=ie({props:t,name:"MuiBackdrop"}),{children:s,className:r,component:i="div",invisible:a=!1,open:f,components:E={},componentsProps:P={},slotProps:g={},slots:T={},TransitionComponent:h,transitionDuration:p,...I}=n,x={...n,component:i,invisible:a},v=Se(x),k={transition:h,root:E.Root,...T},c={...P,...g},m={slots:k,slotProps:c},[C,y]=Y("root",{elementType:we,externalForwardedProps:m,className:G(v.root,r),ownerState:x}),[R,S]=Y("transition",{elementType:ke,externalForwardedProps:m,ownerState:x});return N.jsx(R,{in:f,timeout:p,...I,...S,children:N.jsx(C,{"aria-hidden":!0,...y,classes:v,ref:o,children:s})})});function Me(e){const t=j(e);return t.body===e?H(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function K(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function ne(e){return parseInt(H(e).getComputedStyle(e).paddingRight,10)||0}function Ne(e){const o=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return o||n}function oe(e,t,o,n,s){const r=[t,o,...n];[].forEach.call(e.children,i=>{const a=!r.includes(i),f=!Ne(i);a&&f&&K(i,s)})}function q(e,t){let o=-1;return e.some((n,s)=>t(n)?(o=s,!0):!1),o}function Fe(e,t){const o=[],n=e.container;if(!t.disableScrollLock){if(Me(n)){const i=ve(H(n));o.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${ne(n)+i}px`;const a=j(n).querySelectorAll(".mui-fixed");[].forEach.call(a,f=>{o.push({value:f.style.paddingRight,property:"padding-right",el:f}),f.style.paddingRight=`${ne(f)+i}px`})}let r;if(n.parentNode instanceof DocumentFragment)r=j(n).body;else{const i=n.parentElement,a=H(n);r=(i==null?void 0:i.nodeName)==="HTML"&&a.getComputedStyle(i).overflowY==="scroll"?i:n}o.push({value:r.style.overflow,property:"overflow",el:r},{value:r.style.overflowX,property:"overflow-x",el:r},{value:r.style.overflowY,property:"overflow-y",el:r}),r.style.overflow="hidden"}return()=>{o.forEach(({value:r,el:i,property:a})=>{r?i.style.setProperty(a,r):i.style.removeProperty(a)})}}function Ae(e){const t=[];return[].forEach.call(e.children,o=>{o.getAttribute("aria-hidden")==="true"&&t.push(o)}),t}class Oe{constructor(){this.modals=[],this.containers=[]}add(t,o){let n=this.modals.indexOf(t);if(n!==-1)return n;n=this.modals.length,this.modals.push(t),t.modalRef&&K(t.modalRef,!1);const s=Ae(o);oe(o,t.mount,t.modalRef,s,!0);const r=q(this.containers,i=>i.container===o);return r!==-1?(this.containers[r].modals.push(t),n):(this.containers.push({modals:[t],container:o,restore:null,hiddenSiblings:s}),n)}mount(t,o){const n=q(this.containers,r=>r.modals.includes(t)),s=this.containers[n];s.restore||(s.restore=Fe(s,o))}remove(t,o=!0){const n=this.modals.indexOf(t);if(n===-1)return n;const s=q(this.containers,i=>i.modals.includes(t)),r=this.containers[s];if(r.modals.splice(r.modals.indexOf(t),1),this.modals.splice(n,1),r.modals.length===0)r.restore&&r.restore(),t.modalRef&&K(t.modalRef,o),oe(r.container,t.mount,t.modalRef,r.hiddenSiblings,!1),this.containers.splice(s,1);else{const i=r.modals[r.modals.length-1];i.modalRef&&K(i.modalRef,!1)}return n}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}const Be=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Le(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function De(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=n=>e.ownerDocument.querySelector(`input[type="radio"]${n}`);let o=t(`[name="${e.name}"]:checked`);return o||(o=t(`[name="${e.name}"]`)),o!==e}function je(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||De(e))}function Ue(e){const t=[],o=[];return Array.from(e.querySelectorAll(Be)).forEach((n,s)=>{const r=Le(n);r===-1||!je(n)||(r===0?t.push(n):o.push({documentOrder:s,tabIndex:r,node:n}))}),o.sort((n,s)=>n.tabIndex===s.tabIndex?n.documentOrder-s.documentOrder:n.tabIndex-s.tabIndex).map(n=>n.node).concat(t)}function Ke(){return!0}function We(e){const{children:t,disableAutoFocus:o=!1,disableEnforceFocus:n=!1,disableRestoreFocus:s=!1,getTabbable:r=Ue,isEnabled:i=Ke,open:a}=e,f=u.useRef(!1),E=u.useRef(null),P=u.useRef(null),g=u.useRef(null),T=u.useRef(null),h=u.useRef(!1),p=u.useRef(null),I=X(le(t),p),x=u.useRef(null);u.useEffect(()=>{!a||!p.current||(h.current=!o)},[o,a]),u.useEffect(()=>{if(!a||!p.current)return;const c=j(p.current);return p.current.contains(c.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{s||(g.current&&g.current.focus&&(f.current=!0,g.current.focus()),g.current=null)}},[a]),u.useEffect(()=>{if(!a||!p.current)return;const c=j(p.current),m=R=>{x.current=R,!(n||!i()||R.key!=="Tab")&&c.activeElement===p.current&&R.shiftKey&&(f.current=!0,P.current&&P.current.focus())},C=()=>{var w,F;const R=p.current;if(R===null)return;if(!c.hasFocus()||!i()||f.current){f.current=!1;return}if(R.contains(c.activeElement)||n&&c.activeElement!==E.current&&c.activeElement!==P.current)return;if(c.activeElement!==T.current)T.current=null;else if(T.current!==null)return;if(!h.current)return;let S=[];if((c.activeElement===E.current||c.activeElement===P.current)&&(S=r(p.current)),S.length>0){const O=!!((w=x.current)!=null&&w.shiftKey&&((F=x.current)==null?void 0:F.key)==="Tab"),B=S[0],D=S[S.length-1];typeof B!="string"&&typeof D!="string"&&(O?D.focus():B.focus())}else R.focus()};c.addEventListener("focusin",C),c.addEventListener("keydown",m,!0);const y=setInterval(()=>{c.activeElement&&c.activeElement.tagName==="BODY"&&C()},50);return()=>{clearInterval(y),c.removeEventListener("focusin",C),c.removeEventListener("keydown",m,!0)}},[o,n,s,i,a,r]);const v=c=>{g.current===null&&(g.current=c.relatedTarget),h.current=!0,T.current=c.target;const m=t.props.onFocus;m&&m(c)},k=c=>{g.current===null&&(g.current=c.relatedTarget),h.current=!0};return N.jsxs(u.Fragment,{children:[N.jsx("div",{tabIndex:a?0:-1,onFocus:k,ref:E,"data-testid":"sentinelStart"}),u.cloneElement(t,{ref:I,onFocus:v}),N.jsx("div",{tabIndex:a?0:-1,onFocus:k,ref:P,"data-testid":"sentinelEnd"})]})}function ze(e){return typeof e=="function"?e():e}function $e(e){return e?e.props.hasOwnProperty("in"):!1}const re=()=>{},$=new Oe;function He(e){const{container:t,disableEscapeKeyDown:o=!1,disableScrollLock:n=!1,closeAfterTransition:s=!1,onTransitionEnter:r,onTransitionExited:i,children:a,onClose:f,open:E,rootRef:P}=e,g=u.useRef({}),T=u.useRef(null),h=u.useRef(null),p=X(h,P),[I,x]=u.useState(!E),v=$e(a);let k=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(k=!1);const c=()=>j(T.current),m=()=>(g.current.modalRef=h.current,g.current.mount=T.current,g.current),C=()=>{$.mount(m(),{disableScrollLock:n}),h.current&&(h.current.scrollTop=0)},y=_(()=>{const l=ze(t)||c().body;$.add(m(),l),h.current&&C()}),R=()=>$.isTopModal(m()),S=_(l=>{T.current=l,l&&(E&&R()?C():h.current&&K(h.current,k))}),w=u.useCallback(()=>{$.remove(m(),k)},[k]);u.useEffect(()=>()=>{w()},[w]),u.useEffect(()=>{E?y():(!v||!s)&&w()},[E,w,v,s,y]);const F=l=>d=>{var M;(M=l.onKeyDown)==null||M.call(l,d),!(d.key!=="Escape"||d.which===229||!R())&&(o||(d.stopPropagation(),f&&f(d,"escapeKeyDown")))},O=l=>d=>{var M;(M=l.onClick)==null||M.call(l,d),d.target===d.currentTarget&&f&&f(d,"backdropClick")};return{getRootProps:(l={})=>{const d=Ee(e);delete d.onTransitionEnter,delete d.onTransitionExited;const M={...d,...l};return{role:"presentation",...M,onKeyDown:F(M),ref:p}},getBackdropProps:(l={})=>{const d=l;return{"aria-hidden":!0,...d,onClick:O(d),open:E}},getTransitionProps:()=>{const l=()=>{x(!1),r&&r()},d=()=>{x(!0),i&&i(),s&&w()};return{onEnter:ee(l,(a==null?void 0:a.props.onEnter)??re),onExited:ee(d,(a==null?void 0:a.props.onExited)??re)}},rootRef:p,portalRef:S,isTopModal:R,exited:I,hasTransition:v}}function Ye(e){return se("MuiModal",e)}ce("MuiModal",["root","hidden","backdrop"]);const qe=e=>{const{open:t,exited:o,classes:n}=e;return ae({root:["root",!t&&o&&"hidden"],backdrop:["backdrop"]},Ye,n)},Ge=V("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,!o.open&&o.exited&&t.hidden]}})(ge(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),Ve=V(Ie,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),it=u.forwardRef(function(t,o){const n=ie({name:"MuiModal",props:t}),{BackdropComponent:s=Ve,BackdropProps:r,classes:i,className:a,closeAfterTransition:f=!1,children:E,container:P,component:g,components:T={},componentsProps:h={},disableAutoFocus:p=!1,disableEnforceFocus:I=!1,disableEscapeKeyDown:x=!1,disablePortal:v=!1,disableRestoreFocus:k=!1,disableScrollLock:c=!1,hideBackdrop:m=!1,keepMounted:C=!1,onBackdropClick:y,onClose:R,onTransitionEnter:S,onTransitionExited:w,open:F,slotProps:O={},slots:B={},theme:D,...b}=n,l={...n,closeAfterTransition:f,disableAutoFocus:p,disableEnforceFocus:I,disableEscapeKeyDown:x,disablePortal:v,disableRestoreFocus:k,disableScrollLock:c,hideBackdrop:m,keepMounted:C},{getRootProps:d,getBackdropProps:M,getTransitionProps:de,portalRef:ue,isTopModal:fe,exited:J,hasTransition:Q}=He({...l,rootRef:o}),U={...l,exited:J},A=qe(U),W={};if(E.props.tabIndex===void 0&&(W.tabIndex="-1"),Q){const{onEnter:L,onExited:z}=de();W.onEnter=L,W.onExited=z}const Z={slots:{root:T.Root,backdrop:T.Backdrop,...B},slotProps:{...h,...O}},[pe,me]=Y("root",{ref:o,elementType:Ge,externalForwardedProps:{...Z,...b,component:g},getSlotProps:d,ownerState:U,className:G(a,A==null?void 0:A.root,!U.open&&U.exited&&(A==null?void 0:A.hidden))}),[he,be]=Y("backdrop",{ref:r==null?void 0:r.ref,elementType:s,externalForwardedProps:Z,shouldForwardComponentProp:!0,additionalProps:r,getSlotProps:L=>M({...L,onClick:z=>{y&&y(z),L!=null&&L.onClick&&L.onClick(z)}}),className:G(r==null?void 0:r.className,A==null?void 0:A.backdrop),ownerState:U});return!C&&!F&&(!Q||J)?null:N.jsx(Re,{ref:ue,container:P,disablePortal:v,children:N.jsxs(pe,{...me,children:[!m&&s?N.jsx(he,{...be}):null,N.jsx(We,{disableEnforceFocus:I,disableAutoFocus:p,disableRestoreFocus:k,isEnabled:fe,open:F,children:u.cloneElement(E,W)})]})})});export{Ie as B,ke as F,it as M,We as a,ve as g};