"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2377],{1373:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(12115);function o(){let e=(0,n.useRef)(new Map),t=(0,n.useCallback)((t,r,n,o)=>{let i=o?.once?(...t)=>{e.current.delete(n),n(...t)}:n;e.current.set(n,{type:r,eventTarget:t,fn:i,options:o}),t.addEventListener(r,i,o)},[]),r=(0,n.useCallback)((t,r,n,o)=>{let i=e.current.get(n)?.fn||n;t.removeEventListener(r,i,o),e.current.delete(n)},[]),o=(0,n.useCallback)(()=>{e.current.forEach((e,t)=>{r(e.eventTarget,e.type,t,e.options)})},[r]);return(0,n.useEffect)(()=>o,[o]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:o}}},9091:(e,t,r)=>{r.d(t,{F:()=>n});let n=r(12115).createContext({register:()=>{}});n.displayName="PressResponderContext"},10628:(e,t,r)=>{r.d(t,{b:()=>o});var n=r(78160);function o(e,t){let{id:r,"aria-label":o,"aria-labelledby":i}=e;return r=(0,n.Bi)(r),i&&o?i=[...new Set([r,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),o||i||!t||(o=t),{id:r,"aria-label":o,"aria-labelledby":i}}},14818:(e,t,r)=>{r.d(t,{hJ:()=>f,Se:()=>h});var n=r(12115);let o=(0,n.createContext)({});var i=r(9091);function s({children:e}){let t=(0,n.useMemo)(()=>({register:()=>{}}),[]);return n.createElement(i.F.Provider,{value:t},e)}var l=r(77729),a=r(47650),u=r(14408),c=r(98288);let d=n.createContext(null);function f(e){var t;let r=(0,u.wR)(),{portalContainer:i=r?null:document.body,isExiting:c}=e,[f,h]=(0,n.useState)(!1),p=(0,n.useMemo)(()=>({contain:f,setContain:h}),[f,h]),{getContainer:m}=null!=(t=(0,n.useContext)(o))?t:{};if(!e.portalContainer&&m&&(i=m()),!i)return null;let v=e.children;return e.disableFocusManagement||(v=n.createElement(l.n1,{restoreFocus:!0,contain:(e.shouldContainFocus||f)&&!c},v)),v=n.createElement(d.Provider,{value:p},n.createElement(s,null,v)),a.createPortal(v,i)}function h(){let e=(0,n.useContext)(d),t=null==e?void 0:e.setContain;(0,c.N)(()=>{null==t||t(!0)},[t])}},23318:(e,t,r)=>{r.d(t,{xf:()=>n,zF:()=>o});var n={ease:[.36,.66,.4,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1],spring:[.155,1.105,.295,1.12],springOut:[.57,-.15,.62,.07],softSpring:[.16,1.11,.3,1.02]};n.easeOut,n.easeIn;var o={scaleSpring:{enter:{transform:"scale(1)",opacity:1,transition:{type:"spring",bounce:0,duration:.2}},exit:{transform:"scale(0.85)",opacity:0,transition:{type:"easeOut",duration:.15}}},scaleSpringOpacity:{initial:{opacity:0,transform:"scale(0.8)"},enter:{opacity:1,transform:"scale(1)",transition:{type:"spring",bounce:0,duration:.3}},exit:{opacity:0,transform:"scale(0.96)",transition:{type:"easeOut",bounce:0,duration:.15}}},scale:{enter:{scale:1},exit:{scale:.95}},scaleFadeIn:{enter:{transform:"scale(1)",opacity:1,transition:{duration:.25,ease:n.easeIn}},exit:{transform:"scale(0.95)",opacity:0,transition:{duration:.2,ease:n.easeOut}}},scaleInOut:{enter:{transform:"scale(1)",opacity:1,transition:{duration:.4,ease:n.ease}},exit:{transform:"scale(1.03)",opacity:0,transition:{duration:.3,ease:n.ease}}},fade:{enter:{opacity:1,transition:{duration:.4,ease:n.ease}},exit:{opacity:0,transition:{duration:.3,ease:n.ease}}},collapse:{enter:{opacity:1,height:"auto",transition:{height:{type:"spring",bounce:0,duration:.3},opacity:{easings:"ease",duration:.4}}},exit:{opacity:0,height:0,transition:{easings:"ease",duration:.3}}}}},23406:(e,t,r)=>{r.d(t,{R:()=>a});var n=r(70261),o=r(20406),i=r(5589),s=r(1373),l=r(12115);function a(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:a,onFocusWithinChange:u}=e,c=(0,l.useRef)({isFocusWithin:!1}),{addGlobalListener:d,removeAllGlobalListeners:f}=(0,s.A)(),h=(0,l.useCallback)(e=>{(0,o.sD)(e.currentTarget,(0,o.wt)(e))&&c.current.isFocusWithin&&!(0,o.sD)(e.currentTarget,e.relatedTarget)&&(c.current.isFocusWithin=!1,f(),r&&r(e),u&&u(!1))},[r,u,c,f]),p=(0,n.yB)(h),m=(0,l.useCallback)(e=>{if(!(0,o.sD)(e.currentTarget,(0,o.wt)(e)))return;let t=(0,o.wt)(e),r=(0,i.TW)(t),s=(0,o.bq)(r);if(!c.current.isFocusWithin&&s===t){a&&a(e),u&&u(!0),c.current.isFocusWithin=!0,p(e);let t=e.currentTarget;d(r,"focus",e=>{let i=(0,o.wt)(e);if(c.current.isFocusWithin&&!(0,o.sD)(t,i)){let e=new r.defaultView.FocusEvent("blur",{relatedTarget:i});(0,n.o1)(e,t),h((0,n.eg)(e))}},{capture:!0})}},[a,u,p,d,h]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:m,onBlur:h}}}},33441:(e,t,r)=>{r.d(t,{B:()=>o,o:()=>s});var n=r(51451);function o(e){return(0,n.cX)()?e.metaKey:e.ctrlKey}let i=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function s(e){return e instanceof HTMLInputElement&&!i.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}},35761:(e,t,r)=>{r.d(t,{P:()=>v});var n=r(96673),o=r(12115);function i(e,t){return!!e&&!!t&&t.some(t=>(0,n.sD)(t,e))}class s{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,r){let n=this.fastMap.get(null!=t?t:null);if(!n)return;let o=new l({scopeRef:e});n.addChild(o),o.parent=n,this.fastMap.set(e,o),r&&(o.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let r=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&i(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let n=t.children;r&&(r.removeChild(t),n.size>0&&n.forEach(e=>r&&r.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){var e,t;let r=new s;for(let n of this.traverse())r.addTreeNode(n.scopeRef,null!=(t=null==(e=n.parent)?void 0:e.scopeRef)?t:null,n.nodeToRestore);return r}constructor(){this.fastMap=new Map,this.root=new l({scopeRef:null}),this.fastMap.set(null,this.root)}}class l{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}let a=new s;var u=r(25272),c=r(54309);function d(e,t){if(e.button>0)return!1;let r=(0,n.wt)(e);if(r){let e=r.ownerDocument;if(!e||!(0,n.sD)(e.documentElement,r)||r.closest("[data-react-aria-top-layer]"))return!1}return!!t.current&&!e.composedPath().includes(t.current)}var f=r(98288);function h(e){return e.nativeEvent=e,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}var p=r(5325),m=[];function v(e,t){let{disableOutsideEvents:r=!0,isDismissable:s=!1,isKeyboardDismissDisabled:l=!1,isOpen:v,onClose:b,shouldCloseOnBlur:g,shouldCloseOnInteractOutside:E}=e;(0,o.useEffect)(()=>{if(v&&!m.includes(t))return m.push(t),()=>{let e=m.indexOf(t);e>=0&&m.splice(e,1)}},[v,t]);let N=()=>{m[m.length-1]===t&&b&&b()};!function(e){let{ref:t,onInteractOutside:r,isDisabled:n,onInteractOutsideStart:i}=e,s=(0,o.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),l=(0,u.J)(e=>{r&&d(e,t)&&(i&&i(e),s.current.isPointerDown=!0)}),a=(0,u.J)(e=>{r&&r(e)});(0,o.useEffect)(()=>{let e=s.current;if(n)return;let r=t.current,o=(0,c.TW)(r);if("undefined"!=typeof PointerEvent){let r=r=>{e.isPointerDown&&d(r,t)&&a(r),e.isPointerDown=!1};return o.addEventListener("pointerdown",l,!0),o.addEventListener("click",r,!0),()=>{o.removeEventListener("pointerdown",l,!0),o.removeEventListener("click",r,!0)}}},[t,n])}({isDisabled:!(s&&v),onInteractOutside:s&&v?e=>{(!E||E(e.target))&&(m[m.length-1]===t&&r&&(e.stopPropagation(),e.preventDefault()),N())}:void 0,onInteractOutsideStart:e=>{(!E||E(e.target))&&(m[m.length-1]===t&&r&&(e.stopPropagation(),e.preventDefault()),"pressEnd"!==function(e){let t=e.current;if(!t)return"unknown";let r=(t.getAttribute("role")||"").toLowerCase(),n=t.getAttribute("aria-modal");return("dialog"===r||"alertdialog"===r)&&(null===n||"true"===n.toLowerCase())?"pressEnd":["listbox","menu","tree","grid","combobox"].includes(r)?"pressStart":"unknown"}(t)&&N())},ref:t});let{focusWithinProps:T}=function(e){let t,{isDisabled:r,onBlurWithin:i,onFocusWithin:s,onFocusWithinChange:l}=e,a=(0,o.useRef)({isFocusWithin:!1}),{addGlobalListener:u,removeAllGlobalListeners:d}=(0,p.A)(),m=(0,o.useCallback)(e=>{(0,n.sD)(e.currentTarget,(0,n.wt)(e))&&a.current.isFocusWithin&&!(0,n.sD)(e.currentTarget,e.relatedTarget)&&(a.current.isFocusWithin=!1,d(),i&&i(e),l&&l(!1))},[i,l,a,d]),v=(t=(0,o.useRef)({isFocused:!1,observer:null}),(0,f.N)(()=>{let e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]),(0,o.useCallback)(e=>{let r=(0,n.wt)(e);(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)&&(t.current.isFocused=!0,r.addEventListener("focusout",e=>{if(t.current.isFocused=!1,r.disabled){let t=h(e);null==m||m(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){var e;null==(e=t.current.observer)||e.disconnect();let o=r===(0,n.bq)()?null:(0,n.bq)();r.dispatchEvent(new FocusEvent("blur",{relatedTarget:o})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:o}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]}))},[m])),b=(0,o.useCallback)(e=>{if(!(0,n.sD)(e.currentTarget,(0,n.wt)(e)))return;let t=(0,n.wt)(e),r=(0,c.TW)(t),o=(0,n.bq)(r);if(!a.current.isFocusWithin&&o===t){s&&s(e),l&&l(!0),a.current.isFocusWithin=!0,v(e);let t=e.currentTarget;u(r,"focus",e=>{let o=(0,n.wt)(e);if(a.current.isFocusWithin&&!(0,n.sD)(t,o)){let e=new r.defaultView.FocusEvent("blur",{relatedTarget:o});Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t}),m(h(e))}},{capture:!0})}},[s,l,v,u,m]);return r?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:b,onBlur:m}}}({isDisabled:!g,onBlurWithin:e=>{!(!e.relatedTarget||function(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of a.traverse(a.getTreeNode(t)))if(r&&i(e,r.current))return!0;return!1}(e.relatedTarget,null))&&(!E||E(e.relatedTarget))&&N()}});return{overlayProps:{onKeyDown:e=>{"Escape"!==e.key||l||e.nativeEvent.isComposing||(e.stopPropagation(),e.preventDefault(),N())},...T},underlayProps:{onPointerDown:e=>{e.target===e.currentTarget&&e.preventDefault()}}}}},43457:(e,t,r)=>{r.d(t,{o:()=>n});function n(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return e===n&&"hidden"!==r.overflow&&(o=!0),o&&t&&(o=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),o}},43701:(e,t,r)=>{r.d(t,{T:()=>i});var n=r(12115),o=r(37269);function i(e){let[t,r]=(0,o.P)(e.isOpen,e.defaultOpen||!1,e.onOpenChange),i=(0,n.useCallback)(()=>{r(!0)},[r]),s=(0,n.useCallback)(()=>{r(!1)},[r]),l=(0,n.useCallback)(()=>{r(!t)},[r,t]);return{isOpen:t,setOpen:r,open:i,close:s,toggle:l}}},52192:(e,t,r)=>{r.d(t,{s:()=>u});var n=r(78160),o=r(96673),i=r(32354),s=r(64544),l=r(12115),a=r(14818);function u(e,t){let{role:r="dialog"}=e,u=(0,n.X1)();u=e["aria-label"]?void 0:u;let c=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{if(t.current&&!(0,o.ae)(t.current)){(0,s.l)(t.current);let e=setTimeout(()=>{((0,o.bq)()===t.current||(0,o.bq)()===document.body)&&(c.current=!0,t.current&&(t.current.blur(),(0,s.l)(t.current)),c.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),(0,a.Se)(),{dialogProps:{...(0,i.$)(e,{labelable:!0}),role:r,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||u,onBlur:e=>{c.current&&e.stopPropagation()}},titleProps:{id:u}}}},66872:(e,t,r)=>{let n;r.d(t,{o:()=>h});var o=r(74854);let i=Symbol.for("react-aria.i18n.locale"),s=Symbol.for("react-aria.i18n.strings");class l{constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}getStringForLocale(e,t){let r=this.getStringsForLocale(t)[e];if(!r)throw Error(`Could not find intl message ${e} in ${t} locale`);return r}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,r="en-US"){var n;if(t[e])return t[e];let o=(n=e,Intl.Locale?new Intl.Locale(n).language:n.split("-")[0]);if(t[o])return t[o];for(let e in t)if(e.startsWith(o+"-"))return t[e];return t[r]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if("undefined"==typeof window)return null;let t=window[i];if(void 0===n){let e=window[s];if(!e)return null;for(let r in n={},e)n[r]=new l({[t]:e[r]},t)}let r=n?.[e];if(!r)throw Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}}let a=new Map,u=new Map;class c{constructor(e,t){this.locale=e,this.strings=t}format(e,t){let r=this.strings.getStringForLocale(e,this.locale);return"function"==typeof r?r(t,this):r}plural(e,t,r="cardinal"){let n=t["="+e];if(n)return"function"==typeof n?n():n;let o=this.locale+":"+r,i=a.get(o);return i||(i=new Intl.PluralRules(this.locale,{type:r}),a.set(o,i)),"function"==typeof(n=t[i.select(e)]||t.other)?n():n}number(e){let t=u.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),u.set(this.locale,t)),t.format(e)}select(e,t){let r=e[t]||e.other;return"function"==typeof r?r():r}}var d=r(12115);let f=new WeakMap;function h(e,t){let r,{locale:n}=(0,o.Y)(),i=t&&l.getGlobalDictionaryForPackage(t)||((r=f.get(e))||(r=new l(e),f.set(e,r)),r);return(0,d.useMemo)(()=>new c(n,i),[n,i])}},77729:(e,t,r)=>{r.d(t,{n1:()=>v,N$:()=>S});var n=r(20406),o=r(34540);class i{constructor(e,t,r,n){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.shadowRoot;if(t){let e=this._doc.createTreeWalker(t,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(e),NodeFilter.FILTER_ACCEPT}if("function"==typeof this.filter)return this.filter(e);if(this.filter?.acceptNode)return this.filter.acceptNode(e);else if(null===this.filter)return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=n??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,r,this._acceptNode));let o=t.shadowRoot;if(o){let e=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(e)}}get currentNode(){return this._currentNode}set currentNode(e){if(!(0,n.sD)(this.root,e))throw Error("Cannot set currentNode to a node that is not contained by the root node.");let t=[],r=e,o=e;for(this._currentNode=e;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=r,n=this._doc.createTreeWalker(e,this.whatToShow,{acceptNode:this._acceptNode});t.push(n),n.currentNode=o,this._currentSetFor.add(n),r=o=e.host}else r=r.parentNode;let i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=o,this._currentSetFor.add(i),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return(0,n.sD)(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let t;if("function"==typeof this.filter?t=this.filter(e):this.filter?.acceptNode&&(t=this.filter.acceptNode(e)),t===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let r=this.nextNode();return r&&(this.currentNode=r),r}return e&&(this.currentNode=e),e}if(!(this._walkerStack.length>1))return null;{this._walkerStack.shift();let e=this.nextNode();return e&&(this.currentNode=e),e}}previousNode(){let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e)&&(this._currentSetFor.delete(e),this._walkerStack.length>1)){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}return null}let t=e.previousNode();if(t){if(t.shadowRoot){let e;if("function"==typeof this.filter?e=this.filter(t):this.filter?.acceptNode&&(e=this.filter.acceptNode(t)),e===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let r=this.lastChild();return r&&(this.currentNode=r),r}return t&&(this.currentNode=t),t}if(!(this._walkerStack.length>1))return null;{this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}var s=r(64544),l=r(21357),a=r(5589),u=r(80875),c=r(70704),d=r(24096),f=r(12115);let h=f.createContext(null),p="react-aria-focus-scope-restore",m=null;function v(e){var t,r,o,i,s;let c,v,{children:F,contain:x,restoreFocus:M,autoFocus:P}=e,W=(0,f.useRef)(null),_=(0,f.useRef)(null),I=(0,f.useRef)([]),{parentNode:O}=(0,f.useContext)(h)||{},A=(0,f.useMemo)(()=>new k({scopeRef:I}),[I]);(0,d.N)(()=>{let e=O||D.root;if(D.getTreeNode(e.scopeRef)&&m&&!T(m,e.scopeRef)){let t=D.getTreeNode(m);t&&(e=t)}e.addChild(A),D.addNode(A)},[A,O]),(0,d.N)(()=>{let e=D.getTreeNode(I);e&&(e.contain=!!x)},[x]),(0,d.N)(()=>{let e=W.current?.nextSibling,t=[],r=e=>e.stopPropagation();for(;e&&e!==_.current;)t.push(e),e.addEventListener(p,r),e=e.nextSibling;return I.current=t,()=>{for(let e of t)e.removeEventListener(p,r)}},[F]),t=I,r=M,o=x,(0,d.N)(()=>{if(r||o)return;let e=t.current,i=(0,a.TW)(e?e[0]:void 0),s=e=>{let r=(0,n.wt)(e);E(r,t.current)?m=t:N(r)||(m=null)};return i.addEventListener("focusin",s,!1),e?.forEach(e=>e.addEventListener("focusin",s,!1)),()=>{i.removeEventListener("focusin",s,!1),e?.forEach(e=>e.removeEventListener("focusin",s,!1))}},[t,r,o]),i=I,s=x,c=(0,f.useRef)(void 0),v=(0,f.useRef)(void 0),(0,d.N)(()=>{let e=i.current;if(!s){v.current&&(cancelAnimationFrame(v.current),v.current=void 0);return}let t=(0,a.TW)(e?e[0]:void 0),r=e=>{if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey||!g(i)||e.isComposing)return;let r=(0,n.bq)(t),o=i.current;if(!o||!E(r,o))return;let s=S(b(o),{tabbable:!0},o);if(!r)return;s.currentNode=r;let l=e.shiftKey?s.previousNode():s.nextNode();l||(s.currentNode=e.shiftKey?o[o.length-1].nextElementSibling:o[0].previousElementSibling,l=e.shiftKey?s.previousNode():s.nextNode()),e.preventDefault(),l&&(w(l,!0),l instanceof(0,a.mD)(l).HTMLInputElement&&l.select())},o=e=>{(!m||T(m,i))&&E((0,n.wt)(e),i.current)?(m=i,c.current=(0,n.wt)(e)):g(i)&&!N((0,n.wt)(e),i)?c.current?c.current.focus():m&&m.current&&R(m.current):g(i)&&(c.current=(0,n.wt)(e))},d=e=>{v.current&&cancelAnimationFrame(v.current),v.current=requestAnimationFrame(()=>{let r=(0,l.ME)(),o=("virtual"===r||null===r)&&(0,u.m0)()&&(0,u.H8)(),s=(0,n.bq)(t);if(!o&&s&&g(i)&&!N(s,i)){m=i;let t=(0,n.wt)(e);t&&t.isConnected?(c.current=t,c.current?.focus()):m.current&&R(m.current)}})};return t.addEventListener("keydown",r,!1),t.addEventListener("focusin",o,!1),e?.forEach(e=>e.addEventListener("focusin",o,!1)),e?.forEach(e=>e.addEventListener("focusout",d,!1)),()=>{t.removeEventListener("keydown",r,!1),t.removeEventListener("focusin",o,!1),e?.forEach(e=>e.removeEventListener("focusin",o,!1)),e?.forEach(e=>e.removeEventListener("focusout",d,!1))}},[i,s]),(0,d.N)(()=>()=>{v.current&&cancelAnimationFrame(v.current)},[v]),function(e,t,r){let o=(0,f.useRef)("undefined"!=typeof document?(0,n.bq)((0,a.TW)(e.current?e.current[0]:void 0)):null);(0,d.N)(()=>{let o=e.current,i=(0,a.TW)(o?o[0]:void 0);if(!t||r)return;let s=()=>{(!m||T(m,e))&&E((0,n.bq)(i),e.current)&&(m=e)};return i.addEventListener("focusin",s,!1),o?.forEach(e=>e.addEventListener("focusin",s,!1)),()=>{i.removeEventListener("focusin",s,!1),o?.forEach(e=>e.removeEventListener("focusin",s,!1))}},[e,r]),(0,d.N)(()=>{let n=(0,a.TW)(e.current?e.current[0]:void 0);if(!t)return;let o=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!g(e)||t.isComposing)return;let r=n.activeElement;if(!N(r,e)||!C(e))return;let o=D.getTreeNode(e);if(!o)return;let i=o.nodeToRestore,s=S(n.body,{tabbable:!0});s.currentNode=r;let l=t.shiftKey?s.previousNode():s.nextNode();if(i&&i.isConnected&&i!==n.body||(i=void 0,o.nodeToRestore=void 0),(!l||!N(l,e))&&i){s.currentNode=i;do l=t.shiftKey?s.previousNode():s.nextNode();while(N(l,e));(t.preventDefault(),t.stopPropagation(),l)?w(l,!0):N(i)?w(i,!0):r.blur()}};return r||n.addEventListener("keydown",o,!0),()=>{r||n.removeEventListener("keydown",o,!0)}},[e,t,r]),(0,d.N)(()=>{let r=(0,a.TW)(e.current?e.current[0]:void 0);if(!t)return;let i=D.getTreeNode(e);if(i)return i.nodeToRestore=o.current??void 0,()=>{let o=D.getTreeNode(e);if(!o)return;let i=o.nodeToRestore,s=(0,n.bq)(r);if(t&&i&&(s&&N(s,e)||s===r.body&&C(e))){let t=D.clone();requestAnimationFrame(()=>{if(r.activeElement===r.body){let r=t.getTreeNode(e);for(;r;){if(r.nodeToRestore&&r.nodeToRestore.isConnected)return void L(r.nodeToRestore);r=r.parent}for(r=t.getTreeNode(e);r;){if(r.scopeRef&&r.scopeRef.current&&D.getTreeNode(r.scopeRef))return void L(y(r.scopeRef.current,!0));r=r.parent}}})}}},[e,t])}(I,M,x),function(e,t){let r=f.useRef(t);(0,f.useEffect)(()=>{if(r.current){m=e;let t=(0,a.TW)(e.current?e.current[0]:void 0);!E((0,n.bq)(t),m.current)&&e.current&&R(e.current)}r.current=!1},[e])}(I,P),(0,f.useEffect)(()=>{let e=(0,n.bq)((0,a.TW)(I.current?I.current[0]:void 0)),t=null;if(E(e,I.current)){for(let r of D.traverse())r.scopeRef&&E(e,r.scopeRef.current)&&(t=r);t===D.getTreeNode(I)&&(m=t.scopeRef)}},[I]),(0,d.N)(()=>()=>{let e=D.getTreeNode(I)?.parent?.scopeRef??null;(I===m||T(I,m))&&(!e||D.getTreeNode(e))&&(m=e),D.removeTreeNode(I)},[I]);let H=(0,f.useMemo)(()=>{var e;return e=I,{focusNext(t={}){let r=e.current,{from:o,tabbable:i,wrap:s,accept:l}=t,u=o||(0,n.bq)((0,a.TW)(r[0]??void 0)),c=r[0].previousElementSibling,d=S(b(r),{tabbable:i,accept:l},r);d.currentNode=E(u,r)?u:c;let f=d.nextNode();return!f&&s&&(d.currentNode=c,f=d.nextNode()),f&&w(f,!0),f},focusPrevious(t={}){let r=e.current,{from:o,tabbable:i,wrap:s,accept:l}=t,u=o||(0,n.bq)((0,a.TW)(r[0]??void 0)),c=r[r.length-1].nextElementSibling,d=S(b(r),{tabbable:i,accept:l},r);d.currentNode=E(u,r)?u:c;let f=d.previousNode();return!f&&s&&(d.currentNode=c,f=d.previousNode()),f&&w(f,!0),f},focusFirst(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=S(b(r),{tabbable:n,accept:o},r);i.currentNode=r[0].previousElementSibling;let s=i.nextNode();return s&&w(s,!0),s},focusLast(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=S(b(r),{tabbable:n,accept:o},r);i.currentNode=r[r.length-1].nextElementSibling;let s=i.previousNode();return s&&w(s,!0),s}}},[]),B=(0,f.useMemo)(()=>({focusManager:H,parentNode:A}),[A,H]);return f.createElement(h.Provider,{value:B},f.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:W}),F,f.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:_}))}function b(e){return e[0].parentElement}function g(e){let t=D.getTreeNode(m);for(;t&&t.scopeRef