"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[15],{45(n,e,t){t.d(e,{a:()=>o});var r=t(0);function o({size:n,iconClass:e}){return(0,r.jsx)("div",{"aria-hidden":"true",role:"presentation",class:e,style:{width:n||"",height:n||"",backgroundImage:"var(--icon-close)",backgroundSize:"contain",cursor:"pointer",backgroundRepeat:"no-repeat",backgroundOrigin:"content-box"}})}},162(n,e,t){var r=t(0),o=t(12),c=t(1);const u='\n a[href],\n area[href],\n input:not([type="hidden"]):not([disabled]):not([tabindex="-1"]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]):not([tabindex="-1"]),\n iframe,\n object,\n embed,\n [tabindex]:not([tabindex="-1"]),\n [contenteditable]:not([contenteditable="false"]),\n audio[controls],\n video[controls],\n summary',i=(0,o.forwardRef)((({children:n,disabled:e=!1,isActive:t,autoFocus:o=!0,restoreFocus:i=!0,as:a="div",className:d,style:s,"aria-label":l,"aria-labelledby":f,"aria-modal":b,role:m,id:v,"data-testid":y,onTransitionEnd:p,onAnimationEnd:h},x)=>{const g=(0,c.j)(null),E=(0,c.j)(null),k=(0,c.j)(null),j=(0,c.j)(null),w=(0,c.j)(null),L=(0,c.j)(!e);(0,c.g)((()=>{L.current=!e}),[e]);const A=(0,c.a)((()=>void 0!==t?t():L.current),[t]),S=(0,c.a)((n=>{g.current=n,"function"==typeof x?x(n):x&&(x.current=n)}),[x]),F=(0,c.a)((()=>{const n=g.current;if(!n)return null;const e=Array.from(n.querySelectorAll(u));for(const n of e)if(n!==E.current&&n!==k.current)return n;return null}),[]),I=(0,c.a)((()=>{const n=g.current;if(!n)return null;const e=Array.from(n.querySelectorAll(u));for(let n=e.length-1;n>=0;n--){const t=e[n];if(t!==E.current&&t!==k.current)return t}return null}),[]),T=(0,c.a)((()=>{var n;if(!A())return;const e=I();e?e.focus():null===(n=g.current)||void 0===n||n.focus()}),[A,I]),C=(0,c.a)((()=>{var n;if(!A())return;const e=F();e?e.focus():null===(n=g.current)||void 0===n||n.focus()}),[A,F]);(0,c.c)((()=>{if("undefined"==typeof document)return;const n=n=>{const e=n.target;if(!e||e===document.body)return;const t=g.current;t&&t.contains(e)||(w.current=e)};return document.addEventListener("focusin",n,!0),()=>{document.removeEventListener("focusin",n,!0)}}),[]),(0,c.c)((()=>{var n;if("undefined"!=typeof document&&!e){if(i){w.current&&!document.body.contains(w.current)&&(w.current=null);let n=document.activeElement;n&&n!==document.body||(n=w.current),n&&n!==document.body&&document.body.contains(n)?j.current=n:j.current=null}return o&&(null===(n=g.current)||void 0===n||n.focus({preventScroll:!0})),()=>{i&&j.current instanceof HTMLElement&&j.current!==document.body&&document.body.contains(j.current)&&j.current.focus({preventScroll:!0}),j.current=null}}}),[e,o,i]),(0,c.c)((()=>{if("undefined"==typeof document)return;const n=g.current,e=e=>{if(A()&&"Tab"===e.key&&n&&document.activeElement===n)if(e.preventDefault(),e.shiftKey){const n=I();null==n||n.focus()}else{const n=F();null==n||n.focus()}},t=e=>{if(!A()||!n)return;const t=e.target;if(t!==E.current&&t!==k.current&&!n.contains(t)){e.stopPropagation();const t=F();t?t.focus():n.focus()}};return document.addEventListener("keydown",e,!0),document.addEventListener("focusin",t,!0),()=>{document.removeEventListener("keydown",e,!0),document.removeEventListener("focusin",t,!0)}}),[A,F,I]);const N={position:"fixed",top:0,left:0,width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"},q=void 0!==t?0:e?-1:0;return(0,r.b)(r.a,{children:[(0,r.jsx)("div",{ref:E,style:N,tabIndex:q,onFocus:T,"aria-hidden":"true"}),(0,r.jsx)(a,{ref:S,id:v,tabIndex:-1,className:d,style:s,role:m,"aria-label":l,"aria-labelledby":f,"aria-modal":b,"data-testid":y,onTransitionEnd:p,onAnimationEnd:h,children:n}),(0,r.jsx)("div",{ref:k,style:N,tabIndex:q,onFocus:C,"aria-hidden":"true"})]})}));i.displayName="FocusLock",t.d(e,["a",0,i])},87(n,e,t){t.d(e,{a:()=>r.a});var r=t(162)}}]);