1import{I as e,t,z as n}from"./jsx-runtime-BKHn-iCA.js";import{d as r,r as i,t as a,v as o,y as s}from"./DefaultPropsProvider-CMKjvqNS.js";import{i as c,o as l}from"./Box-Bq47Rm6t.js";import{t as u}from"./getReactElementRef-B4NsN_RF.js";import{l as d,s as f}from"./ButtonBase-D5dqFqA6.js";import{n as p,t as m}from"./ownerWindow-CvXBYrUq.js";import{n as h,t as g}from"./getScrollbarSize-C5ts4AHK.js";import{t as _}from"./getActiveElement-CWegHuoV.js";import{r as v,t as y}from"./useSlot-DnLPhp11.js";import{t as b}from"./Fade-BjlquDCq.js";function x(...e){return e.reduce((e,t)=>t==null?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}var S=n(e());function C(e){return o(`MuiBackdrop`,e)}l(`MuiBackdrop`,[`root`,`invisible`]);var w=t(),T=e=>{let{classes:t,invisible:n}=e;return r({root:[`root`,n&&`invisible`]},C,t)},E=i(`div`,{name:`MuiBackdrop`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.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`}}]}),D=S.forwardRef(function(e,t){let n=a({props:e,name:`MuiBackdrop`}),{children:r,className:i,component:o=`div`,invisible:c=!1,open:l,components:u={},componentsProps:d={},slotProps:f={},slots:p={},TransitionComponent:m,transitionDuration:h,...g}=n,_={...n,component:o,invisible:c},v=T(_),x={component:o,slots:{transition:m,root:u.Root,...p},slotProps:{...d,...f}},[S,C]=y(`root`,{elementType:E,externalForwardedProps:x,className:s(v.root,i),ownerState:_}),[D,O]=y(`transition`,{elementType:b,externalForwardedProps:x,ownerState:_});return(0,w.jsx)(D,{in:l,timeout:h,...g,...O,children:(0,w.jsx)(S,{"aria-hidden":!0,...C,ref:t,children:r})})});function O(e){let t=p(e);return t.body===e?m(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function k(e,t){t?e.setAttribute(`aria-hidden`,`true`):e.removeAttribute(`aria-hidden`)}function A(e){return parseFloat(m(e).getComputedStyle(e).paddingRight)||0}function j(e){let t=[`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 t||n}function M(e,t,n,r,i){let a=[t,n,...r];[].forEach.call(e.children,e=>{let t=!a.includes(e),n=!j(e);t&&n&&k(e,i)})}function N(e,t){let n=-1;return e.some((e,r)=>t(e)?(n=r,!0):!1),n}function P(e,t){let n=[],r=e.container;if(!t.disableScrollLock){if(O(r)){let e=g(m(r));n.push({value:r.style.paddingRight,property:`padding-right`,el:r}),r.style.paddingRight=`${A(r)+e}px`;let t=p(r).querySelectorAll(`.mui-fixed`);[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:`padding-right`,el:t}),t.style.paddingRight=`${A(t)+e}px`})}let e;if(r.parentNode instanceof DocumentFragment)e=p(r).body;else{let t=r.parentElement,n=m(r);e=t?.nodeName===`HTML`&&n.getComputedStyle(t).overflowY===`scroll`?t:r}n.push({value:e.style.overflow,property:`overflow`,el:e},{value:e.style.overflowX,property:`overflow-x`,el:e},{value:e.style.overflowY,property:`overflow-y`,el:e}),e.style.overflow=`hidden`}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}function F(e){let t=[];return[].forEach.call(e.children,e=>{e.getAttribute(`aria-hidden`)===`true`&&t.push(e)}),t}var I=class{constructor(){this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(n!==-1)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&k(e.modalRef,!1);let r=F(t);M(t,e.mount,e.modalRef,r,!0);let i=N(this.containers,e=>e.container===t);return i===-1?(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n):(this.containers[i].modals.push(e),n)}mount(e,t){let n=N(this.containers,t=>t.modals.includes(e)),r=this.containers[n];r.restore||=P(r,t)}remove(e,t=!0){let n=this.modals.indexOf(e);if(n===-1)return n;let r=N(this.containers,t=>t.modals.includes(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(
1),e.modalRef&&k(e.modalRef,t),M(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{let e=i.modals[i.modals.length-1];e.modalRef&&k(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}},L=[`input`,`select`,`textarea`,`a[href]`,`button`,`[tabindex]`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable="false"])`].join(`,`);function R(e){let 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 z(e){if(e.tagName!==`INPUT`||e.type!==`radio`||!e.name)return!1;let t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`),n=t(`[name="${e.name}"]:checked`);return n||=t(`[name="${e.name}"]`),n!==e}function B(e){return!(e.disabled||e.tagName===`INPUT`&&e.type===`hidden`||z(e))}function V(e){let t=[],n=[];return Array.from(e.querySelectorAll(L)).forEach((e,r)=>{let i=R(e);i===-1||!B(e)||(i===0?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function H(){return!0}function U(e){let{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:a=V,isEnabled:o=H,open:s}=e,c=S.useRef(!1),l=S.useRef(null),d=S.useRef(null),m=S.useRef(null),h=S.useRef(null),g=S.useRef(!1),v=S.useRef(null),y=f(u(t),v),b=S.useRef(null);S.useEffect(()=>{!s||!v.current||(g.current=!n)},[n,s]),S.useEffect(()=>{if(!s||!v.current)return;let e=p(v.current),t=_(e);return v.current.contains(t)||(v.current.hasAttribute(`tabIndex`)||v.current.setAttribute(`tabIndex`,`-1`),g.current&&v.current.focus()),()=>{i||(m.current&&m.current.focus&&(c.current=!0,m.current.focus()),m.current=null)}},[s]),S.useEffect(()=>{if(!s||!v.current)return;let e=p(v.current),t=t=>{b.current=t,!(r||!o()||t.key!==`Tab`)&&_(e)===v.current&&t.shiftKey&&(c.current=!0,d.current&&d.current.focus())},n=()=>{let t=v.current;if(t===null)return;let n=_(e);if(!e.hasFocus()||!o()||c.current){c.current=!1;return}if(t.contains(n)||r&&n!==l.current&&n!==d.current)return;if(n!==h.current)h.current=null;else if(h.current!==null)return;if(!g.current)return;let i=[];if((n===l.current||n===d.current)&&(i=a(v.current)),i.length>0){let e=!!(b.current?.shiftKey&&b.current?.key===`Tab`),t=i[0],n=i[i.length-1];typeof t!=`string`&&typeof n!=`string`&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener(`focusin`,n),e.addEventListener(`keydown`,t,!0);let i=setInterval(()=>{let t=_(e);t&&t.tagName===`BODY`&&n()},50);return()=>{clearInterval(i),e.removeEventListener(`focusin`,n),e.removeEventListener(`keydown`,t,!0)}},[n,r,i,o,s,a]);let x=e=>{m.current===null&&(m.current=e.relatedTarget),g.current=!0,h.current=e.target;let n=t.props.onFocus;n&&n(e)},C=e=>{m.current===null&&(m.current=e.relatedTarget),g.current=!0};return(0,w.jsxs)(S.Fragment,{children:[(0,w.jsx)(`div`,{tabIndex:s?0:-1,onFocus:C,ref:l,"data-testid":`sentinelStart`}),S.cloneElement(t,{ref:y,onFocus:x}),(0,w.jsx)(`div`,{tabIndex:s?0:-1,onFocus:C,ref:d,"data-testid":`sentinelEnd`})]})}function W(e){return typeof e==`function`?e():e}function G(e){return e?e.props.hasOwnProperty(`in`):!1}var K=()=>{},q=new I;
1function J(e){let{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:a,onTransitionExited:o,children:s,onClose:c,open:l,rootRef:u}=e,m=S.useRef({}),h=S.useRef(null),g=S.useRef(null),_=f(g,u),[y,b]=S.useState(!l),C=G(s),w=!0;(e[`aria-hidden`]===`false`||e[`aria-hidden`]===!1)&&(w=!1);let T=()=>p(h.current),E=()=>(m.current.modalRef=g.current,m.current.mount=h.current,m.current),D=()=>{q.mount(E(),{disableScrollLock:r}),g.current&&(g.current.scrollTop=0)},O=d(()=>{let e=W(t)||T().body;q.add(E(),e),g.current&&D()}),A=()=>q.isTopModal(E()),j=d(e=>{h.current=e,e&&(l&&A()?D():g.current&&k(g.current,w))}),M=S.useCallback(()=>{q.remove(E(),w)},[w]);S.useEffect(()=>()=>{M()},[M]),S.useEffect(()=>{l?O():(!C||!i)&&M()},[l,M,C,i,O]);let N=e=>t=>{e.onKeyDown?.(t),!(t.key!==`Escape`||t.which===229||!A())&&(n||(t.stopPropagation(),c&&c(t,`escapeKeyDown`)))},P=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&c&&c(t,`backdropClick`)};return{getRootProps:(t={})=>{let n=v(e);delete n.onTransitionEnter,delete n.onTransitionExited;let r={...n,...t};return{role:`presentation`,...r,onKeyDown:N(r),ref:_}},getBackdropProps:(e={})=>{let t=e;return{"aria-hidden":!0,...t,onClick:P(t),open:l}},getTransitionProps:()=>({onEnter:x(()=>{b(!1),a&&a()},s?.props.onEnter??K),onExited:x(()=>{b(!0),o&&o(),i&&M()},s?.props.onExited??K)}),rootRef:_,portalRef:j,isTopModal:A,exited:y,hasTransition:C}}function Y(e){return o(`MuiModal`,e)}l(`MuiModal`,[`root`,`hidden`,`backdrop`]);var X=e=>{let{open:t,exited:n,classes:i}=e;return r({root:[`root`,!t&&n&&`hidden`],backdrop:[`backdrop`]},Y,i)},Z=i(`div`,{name:`MuiModal`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(c(({theme:e})=>({position:`fixed`,zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:`hidden`}}]}))),Q=i(D,{name:`MuiModal`,slot:`Backdrop`})({zIndex:-1}),$=S.forwardRef(function(e,t){let n=a({name:`MuiModal`,props:e}),{BackdropComponent:r=Q,BackdropProps:i,classes:o,className:c,closeAfterTransition:l=!1,children:u,container:d,component:f,components:p={},componentsProps:m={},disableAutoFocus:g=!1,disableEnforceFocus:_=!1,disableEscapeKeyDown:v=!1,disablePortal:b=!1,disableRestoreFocus:x=!1,disableScrollLock:C=!1,hideBackdrop:T=!1,keepMounted:E=!1,onClose:D,onTransitionEnter:O,onTransitionExited:k,open:A,slotProps:j={},slots:M={},theme:N,...P}=n,F={...n,closeAfterTransition:l,disableAutoFocus:g,disableEnforceFocus:_,disableEscapeKeyDown:v,disablePortal:b,disableRestoreFocus:x,disableScrollLock:C,hideBackdrop:T,keepMounted:E},{getRootProps:I,getBackdropProps:L,getTransitionProps:R,portalRef:z,isTopModal:B,exited:V,hasTransition:H}=J({...F,rootRef:t}),W={...F,exited:V},G=X(W),K={};if(u.props.tabIndex===void 0&&(K.tabIndex=`-1`),H){let{onEnter:e,onExited:t}=R();K.onEnter=e,K.onExited=t}let q={slots:{root:p.Root,backdrop:p.Backdrop,...M},slotProps:{...m,...j}},[Y,$]=y(`root`,{ref:t,elementType:Z,externalForwardedProps:{...q,...P,component:f},getSlotProps:I,ownerState:W,className:s(c,G?.root,!W.open&&W.exited&&G?.hidden)}),[ee,te]=y(`backdrop`,{ref:i?.ref,elementType:r,externalForwardedProps:q,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:e=>L({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:s(i?.className,G?.backdrop),ownerState:W});return!E&&!A&&(!H||V)?null:(0,w.jsx)(h,{ref:z,container:d,disablePortal:b,children:(0,w.jsxs)(Y,{...$,children:[!T&&r?(0,w.jsx)(ee,{...te}):null,(0,w.jsx)(U,{disableEnforceFocus:_,disableAutoFocus:g,disableRestoreFocus:x,isEnabled:B,open:A,children:S.cloneElement(u,K)})]})})});export{D as n,$ as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.