@floating-ui/react
Advanced tools
Comparing version 0.25.0 to 0.25.1
@@ -1,1 +0,1 @@ | ||
import{platform as e,getOverflowAncestors as t,useFloating as n,offset as r,detectOverflow as o}from"@floating-ui/react-dom";export{arrow,autoPlacement,autoUpdate,computePosition,detectOverflow,flip,getOverflowAncestors,hide,inline,limitShift,offset,platform,shift,size}from"@floating-ui/react-dom";import*as u from"react";import{useLayoutEffect as c,useEffect as i,useRef as l}from"react";import{isElement as s,isHTMLElement as a,getWindow as f,getComputedStyle as d}from"@floating-ui/utils/dom";import{getDocument as m,isMouseLikePointerType as v,contains as p,activeElement as g,isSafari as b,isTypeableElement as y,stopEvent as h,getTarget as E,getPlatform as R,isReactEvent as w,isEventTargetWithin as x,isVirtualClick as I,isVirtualPointerEvent as k,isMac as M,getUserAgent as C}from"@floating-ui/utils/react";import{supportsInert as T,hideOthers as O,suppressOthers as P}from"aria-hidden";import{tabbable as L}from"tabbable";import{createPortal as S,flushSync as A}from"react-dom";function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(this,arguments)}var F="undefined"!=typeof document?c:i;let N=!1,K=0;const B=()=>"floating-ui-"+K++;const _=u["useId".toString()]||function(){const[e,t]=u.useState((()=>N?B():void 0));return F((()=>{null==e&&t(B())}),[]),u.useEffect((()=>{N||(N=!0)}),[]),e},H=u.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:c}},width:i=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:m,style:{transform:v,...p}={},...g}=t;const b=_();if(!o)return null;a*=2;const y=a/2,h=i/2*(s/-8+1),E=l/2*s/4,[R,w]=r.split("-"),x=e.isRTL(o),I=!!m,k="top"===R||"bottom"===R,M=f&&"end"===w?"bottom":"top";let C=f&&"end"===w?"right":"left";f&&x&&(C="end"===w?"left":"right");const T=null!=(null==c?void 0:c.x)?f||c.x:"",O=null!=(null==c?void 0:c.y)?f||c.y:"",P=m||"M0,0 H"+i+" L"+(i-h)+","+(l-E)+" Q"+i/2+","+l+" "+h+","+(l-E)+" Z",L={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[R];return u.createElement("svg",D({},g,{"aria-hidden":!0,ref:n,width:I?i:i+a,height:i,viewBox:"0 0 "+i+" "+(l>i?l:i),style:{position:"absolute",pointerEvents:"none",[C]:T,[M]:O,[R]:k||I?"100%":"calc(100% - "+a/2+"px)",transform:""+L+(null!=v?v:""),...p}}),a>0&&u.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:d,strokeWidth:a+(m?0:1),d:P}),u.createElement("path",{stroke:a&&!m?g.fill:"none",d:P}),u.createElement("clipPath",{id:b},u.createElement("rect",{x:-y,y:y*(I?-1:1),width:i+a,height:i})))}));function q(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const j=u.createContext(null),W=u.createContext(null),X=()=>{var e;return(null==(e=u.useContext(j))?void 0:e.id)||null},Y=()=>u.useContext(W);function U(e){const t=_(),n=Y(),r=X(),o=e||r;return F((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function V(e){let{children:t,id:n}=e;const r=X();return u.createElement(j.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)}function z(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),c=u.useState((()=>q()))[0];return u.createElement(W.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:c})),[n,r,o,c])},t)}function Z(e){return"data-floating-ui-"+e}function G(e){const t=l(e);return F((()=>{t.current=e})),t}const Q=Z("safe-polygon");function J(e,t,n){return n&&!v(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function $(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:c,elements:{domReference:i,floating:l},refs:a}=e,{enabled:f=!0,delay:d=0,handleClose:g=null,mouseOnly:b=!1,restMs:y=0,move:h=!0}=t,E=Y(),R=X(),w=G(g),x=G(d),I=u.useRef(),k=u.useRef(),M=u.useRef(),C=u.useRef(),T=u.useRef(!0),O=u.useRef(!1),P=u.useRef((()=>{})),L=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(f)return c.on("dismiss",e),()=>{c.off("dismiss",e)};function e(){clearTimeout(k.current),clearTimeout(C.current),T.current=!0}}),[f,c]),u.useEffect((()=>{if(!f||!w.current||!n)return;function e(e){L()&&r(!1,e)}const t=m(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,f,w,o,L]);const S=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=J(x.current,"close",I.current);n&&!M.current?(clearTimeout(k.current),k.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(k.current),r(!1,e))}),[x,r]),A=u.useCallback((()=>{P.current(),M.current=void 0}),[]),D=u.useCallback((()=>{if(O.current){const e=m(a.floating.current).body;e.style.pointerEvents="",e.removeAttribute(Q),O.current=!1}}),[a]);return u.useEffect((()=>{if(f&&s(i)){const e=i;return n&&e.addEventListener("mouseleave",a),null==l||l.addEventListener("mouseleave",a),h&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",c),()=>{n&&e.removeEventListener("mouseleave",a),null==l||l.removeEventListener("mouseleave",a),h&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",c)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(k.current),T.current=!1,b&&!v(I.current)||y>0&&0===J(x.current,"open"))return;const t=J(x.current,"open",I.current);t?k.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function c(r){if(t())return;P.current();const o=m(l);if(clearTimeout(C.current),w.current){n||clearTimeout(k.current),M.current=w.current({...e,tree:E,x:r.clientX,y:r.clientY,onClose(){D(),A(),S(r)}});const t=M.current;return o.addEventListener("mousemove",t),void(P.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==I.current||!p(l,r.relatedTarget))&&S(r)}function a(n){t()||null==w.current||w.current({...e,tree:E,x:n.clientX,y:n.clientY,onClose(){D(),A(),S(n)}})(n)}}),[i,l,f,e,b,y,h,S,A,D,r,n,E,x,w,o]),F((()=>{var e;if(f&&n&&null!=(e=w.current)&&e.__options.blockPointerEvents&&L()){const e=m(l).body;if(e.setAttribute(Q,""),e.style.pointerEvents="none",O.current=!0,s(i)&&l){var t,r;const e=i,n=null==E||null==(t=E.nodesRef.current.find((e=>e.id===R)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[f,n,R,l,i,E,w,o,L]),F((()=>{n||(I.current=void 0,A(),D())}),[n,A,D]),u.useEffect((()=>()=>{A(),clearTimeout(k.current),clearTimeout(C.current),D()}),[f,i,A,D]),u.useMemo((()=>{if(!f)return{};function e(e){I.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===y||(clearTimeout(C.current),C.current=setTimeout((()=>{T.current||r(!0,e.nativeEvent)}),y))}},floating:{onMouseEnter(){clearTimeout(k.current)},onMouseLeave(e){c.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),S(e.nativeEvent,!1)}}}}),[c,f,y,n,r,S])}const ee=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),te=()=>u.useContext(ee),ne=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,c]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),i=u.useRef(null),l=u.useCallback((e=>{c({currentId:e})}),[]);return F((()=>{o.currentId?null===i.current?i.current=o.currentId:c({isInstantPhase:!0}):(c({isInstantPhase:!1}),i.current=null)}),[o.currentId]),u.createElement(ee.Provider,{value:u.useMemo((()=>({...o,setState:c,setCurrentId:l})),[o,c,l])},t)},re=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:c,initialDelay:i,setState:l,timeoutMs:s}=te();F((()=>{u&&(l({delay:{open:1,close:J(i,"close")}}),u!==o&&r(!1))}),[o,r,l,u,i]),F((()=>{function e(){r(!1),l({delay:i,currentId:null})}if(!n&&u===o){if(s){const t=window.setTimeout(e,s);return()=>{clearTimeout(t)}}e()}}),[n,l,u,o,r,i,s]),F((()=>{n&&c(o)}),[n,c,o])};let oe=0;function ue(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(oe);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():oe=requestAnimationFrame(u)}function ce(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}const ie=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function le(e,t){const n=L(e,ie());"prev"===t&&n.reverse();const r=n.indexOf(g(m(e)));return n.slice(r+1)[0]}function se(){return le(document.body,"next")}function ae(){return le(document.body,"prev")}function fe(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!p(n,r)}function de(e){L(e,ie()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function me(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const ve={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function pe(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const ge=u.forwardRef((function(e,t){const[n,r]=u.useState();F((()=>(b()&&r("button"),document.addEventListener("keydown",pe),()=>{document.removeEventListener("keydown",pe)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Z("focus-guard")]:"",style:ve};return u.createElement("span",D({},e,o))})),be=u.createContext(null);function ye(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),c=_(),i=Ee(),l=u.useMemo((()=>({id:t,root:n,portalContext:i,uniqueId:c})),[t,n,i,c]),a=u.useRef();return F((()=>()=>{null==r||r.remove()}),[r,l]),F((()=>{if(a.current===l)return;a.current=l;const{id:e,root:t,portalContext:n,uniqueId:r}=l,u=e?document.getElementById(e):null,c=Z("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(c,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!s(u)&&(u=u.current),u=u||document.body;let i=null;e&&(i=document.createElement("div"),i.id=e,u.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(c,""),u=i||u,u.appendChild(l),o(l)}}),[l]),r}function he(e){let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const c=ye({id:n,root:r}),[i,l]=u.useState(null),s=u.useRef(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=!!i&&!i.modal&&i.open&&o&&!(!r&&!c);return u.useEffect((()=>{if(c&&o&&(null==i||!i.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&fe(e)){("focusin"===e.type?me:de)(c)}}}),[c,o,null==i?void 0:i.modal]),u.createElement(be.Provider,{value:u.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:f,afterInsideRef:d,portalNode:c,setFocusManagerState:l})),[o,c])},m&&c&&u.createElement(ge,{"data-type":"outside",ref:s,onFocus:e=>{if(fe(e,c)){var t;null==(t=f.current)||t.focus()}else{const e=ae()||(null==i?void 0:i.refs.domReference.current);null==e||e.focus()}}}),m&&c&&u.createElement("span",{"aria-owns":c.id,style:ve}),c&&S(t,c),m&&c&&u.createElement(ge,{"data-type":"outside",ref:a,onFocus:e=>{if(fe(e,c)){var t;null==(t=d.current)||t.focus()}else{const t=se()||(null==i?void 0:i.refs.domReference.current);null==t||t.focus(),(null==i?void 0:i.closeOnFocusOut)&&(null==i||i.onOpenChange(!1,e.nativeEvent))}}}))}const Ee=()=>u.useContext(be),Re=u.forwardRef((function(e,t){return u.createElement("button",D({},e,{type:"button",ref:t,tabIndex:-1,style:ve}))}));function we(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:c=!0,initialFocus:i=0,returnFocus:l=!0,modal:s=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0}=e,{open:v,refs:b,nodeId:R,onOpenChange:w,events:x,dataRef:I,elements:{domReference:k,floating:M}}=t,C=!T()||c,S=G(o),A=G(i),D=G(l),N=Y(),K=Ee(),B="number"==typeof i&&i<0,_=u.useRef(null),H=u.useRef(null),q=u.useRef(!1),j=u.useRef(null),W=u.useRef(!1),X=null!=K,U=k&&"combobox"===k.getAttribute("role")&&y(k),V=u.useCallback((function(e){return void 0===e&&(e=M),e?L(e,ie()):[]}),[M]),z=u.useCallback((e=>{const t=V(e);return S.current.map((e=>k&&"reference"===e?k:M&&"floating"===e?M:t)).filter(Boolean).flat()}),[k,M,S,V]);function Q(e){return!r&&f&&s?u.createElement(Re,{ref:"start"===e?_:H,onClick:e=>w(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}u.useEffect((()=>{if(r||!s)return;function e(e){if("Tab"===e.key){p(M,g(m(M)))&&0===V().length&&!U&&h(e);const t=z(),n=E(e);"reference"===S.current[0]&&n===k&&(h(e),e.shiftKey?ue(t[t.length-1]):ue(t[1])),"floating"===S.current[1]&&n===M&&e.shiftKey&&(h(e),ue(t[0]))}}const t=m(M);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,k,M,s,S,b,U,V,z]),u.useEffect((()=>{if(!r&&d)return M&&a(k)?(k.addEventListener("focusout",t),k.addEventListener("pointerdown",e),!s&&M.addEventListener("focusout",t),()=>{k.removeEventListener("focusout",t),k.removeEventListener("pointerdown",e),!s&&M.removeEventListener("focusout",t)}):void 0;function e(){W.current=!0,setTimeout((()=>{W.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(p(k,t)||p(M,t)||p(t,M)||p(null==K?void 0:K.portalNode,t)||null!=t&&t.hasAttribute(Z("focus-guard"))||N&&(ce(N.nodesRef.current,R).find((e=>{var n,r;return p(null==(n=e.context)?void 0:n.elements.floating,t)||p(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(N.nodesRef.current,R).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!W.current&&t!==j.current&&(q.current=!0,w(!1,e))}))}}),[r,k,M,s,R,N,K,w,d]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==K||null==(e=K.portalNode)?void 0:e.querySelectorAll("["+Z("portal")+"]"))||[]);if(M&&s){const e=[M,...t,_.current,H.current].filter((e=>null!=e)),n=(C?O:P)(S.current.includes("reference")||U?e.concat(k||[]):e,void 0,Z("inert"));return()=>{n()}}}),[r,k,M,s,S,K,U,C]),F((()=>{if(r||!M)return;const e=m(M),t=g(e);queueMicrotask((()=>{const e=z(M),n=A.current,r=("number"==typeof n?e[n]:n.current)||M,o=p(M,t);B||o||!v||ue(r,{preventScroll:r===M})}))}),[r,v,M,B,z,A]),F((()=>{if(r||!M)return;let e=!1;const t=m(M),n=g(t),o=I.current;function u(t){if("escapeKey"===t.type&&b.domReference.current&&(j.current=b.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(q.current=!1,e=n.preventScroll):q.current=!n}return j.current=n,x.on("dismiss",u),()=>{x.off("dismiss",u);const n=g(t);(p(M,n)||N&&ce(N.nodesRef.current,R).some((e=>{var t;return p(null==(t=e.context)?void 0:t.elements.floating,n)}))||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&b.domReference.current&&(j.current=b.domReference.current),D.current&&a(j.current)&&!q.current&&ue(j.current,{cancelPrevious:!1,preventScroll:e})}}),[r,M,D,I,b,x,N,R]),F((()=>{if(!r&&K)return K.setFocusManagerState({...t,modal:s,closeOnFocusOut:d,open:v}),()=>{K.setFocusManagerState(null)}}),[r,K,s,v,d,t]),F((()=>{if(!r&&M&&"function"==typeof MutationObserver){const e=()=>{const e=M.getAttribute("tabindex");S.current.includes("floating")||g(m(M))!==b.domReference.current&&0===V().length?"0"!==e&&M.setAttribute("tabindex","0"):"-1"!==e&&M.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(M,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[r,M,b,S,V]);const J=!r&&C&&!U&&(X||s);return u.createElement(u.Fragment,null,J&&u.createElement(ge,{"data-type":"inside",ref:null==K?void 0:K.beforeInsideRef,onFocus:e=>{if(s){const e=z();ue("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=K&&K.preserveTabOrder&&K.portalNode)if(q.current=!1,fe(e,K.portalNode)){const e=se()||k;null==e||e.focus()}else{var t;null==(t=K.beforeOutsideRef.current)||t.focus()}}}),!U&&Q("start"),n,Q("end"),J&&u.createElement(ge,{"data-type":"inside",ref:null==K?void 0:K.afterInsideRef,onFocus:e=>{if(s)ue(z()[0]);else if(null!=K&&K.preserveTabOrder&&K.portalNode)if(d&&(q.current=!0),fe(e,K.portalNode)){const e=ae()||k;null==e||e.focus()}else{var t;null==(t=K.afterOutsideRef.current)||t.focus()}}}))}function xe(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Ie=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function ke(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,c]=u.useState((()=>new Map)),i=u.useCallback((e=>{c((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{c((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return F((()=>{const e=new Map(o);Array.from(e.keys()).sort(xe).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||c(e)}),[o]),u.createElement(Ie.Provider,{value:u.useMemo((()=>({register:i,unregister:l,map:o,elementsRef:n,labelsRef:r})),[i,l,o,n,r])},t)}function Me(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:c,unregister:i,map:l,elementsRef:s,labelsRef:a}=u.useContext(Ie),f=u.useCallback((e=>{if(o.current=e,null!==n&&(s.current[n]=e,a)){var r;const o=void 0!==t;a.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,s,a,t]);return F((()=>{const e=o.current;if(e)return c(e),()=>{i(e)}}),[c,i]),F((()=>{const e=o.current?l.get(o.current):null;null!=e&&r(e)}),[l]),u.useMemo((()=>({ref:f,index:null==n?-1:n})),[n,f])}const Ce=Z("scroll-lock"),Te=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return F((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Ce))return;document.body.setAttribute(Ce,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(R()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Ce),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,c=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,i=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(c))+"px",left:-(i-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(Ce),window.scrollTo(i,l)}}),[n]),u.createElement("div",D({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Oe(e){return a(e.target)&&"BUTTON"===e.target.tagName}function Pe(e){return y(e)}function Le(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:c}}=e,{enabled:i=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),m=u.useRef(!1);return u.useMemo((()=>i?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(v(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent)):r(!1,e.nativeEvent)))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:v(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent):r(!1,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Oe(e)||(" "!==e.key||Pe(c)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||Oe(e)||Pe(c)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,e.nativeEvent))}}}:{}),[i,o,l,a,f,c,s,n,r])}const Se=u["useInsertionEffect".toString()]||(e=>e());function Ae(e){const t=u.useRef((()=>{}));return Se((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function De(e){return null!=e&&null!=e.clientX}function Fe(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:c}}=e,{enabled:i=!0,axis:l="both",x:s=null,y:a=null}=t,d=u.useRef(!1),m=u.useRef(null),[g,b]=u.useState(),[y,h]=u.useState([]),R=Ae(((e,t)=>{d.current||o.current.openEvent&&!De(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,c;const i=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(c=t.dataRef.current.openEvent)?void 0:c.type)||"")&&"touch"!==t.pointerType;let f=i.width,d=i.height,m=i.x,v=i.y;return null==n&&t.x&&l&&(n=i.x-t.x),null==r&&t.y&&s&&(r=i.y-t.y),m-=n||0,v-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?i.width:0,d="x"===t.axis?i.height:0,m=l&&null!=t.x?t.x:m,v=s&&null!=t.y?t.y:v):o&&!a&&(d="x"===t.axis?i.height:d,f="y"===t.axis?i.width:f),o=!0,{width:f,height:d,x:m,y:v,top:v,right:m+f,bottom:v+d,left:m}}}}(r.domReference,{x:e,y:t,axis:l,dataRef:o,pointerType:g}))})),w=Ae((e=>{null==s&&null==a&&(n?m.current||h([]):R(e.clientX,e.clientY))})),x=v(g)?c:n,I=u.useCallback((()=>{if(!x||!i||null!=s||null!=a)return;const e=f(r.floating.current);function t(n){const o=E(n);p(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):R(n.clientX,n.clientY)}if(!o.current.openEvent||De(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,i,x,r,R,s,a]);return u.useEffect((()=>I()),[I,y]),u.useEffect((()=>{i&&!c&&(d.current=!1)}),[i,c]),u.useEffect((()=>{!i&&n&&(d.current=!0)}),[i,n]),F((()=>{!i||null==s&&null==a||(d.current=!1,R(s,a))}),[i,s,a,R]),u.useMemo((()=>{if(!i)return{};function e(e){let{pointerType:t}=e;b(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:w,onMouseEnter:w}}}),[i,w])}const Ne={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ke={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function Be(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:c,nodeId:i,elements:{reference:l,domReference:f,floating:v},dataRef:p}=e,{enabled:g=!0,escapeKey:b=!0,outsidePress:y=!0,outsidePressEvent:h="pointerdown",referencePress:R=!1,referencePressEvent:M="pointerdown",ancestorScroll:C=!1,bubbles:T}=n,O=Y(),P=null!=X(),L=Ae("function"==typeof y?y:()=>!1),S="function"==typeof y?L:y,A=u.useRef(!1),{escapeKeyBubbles:D,outsidePressBubbles:F}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(T),N=Ae((e=>{if(!r||!g||!b||"Escape"!==e.key)return;const t=O?ce(O.nodesRef.current,i):[];if(!D&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}c.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,w(e)?e.nativeEvent:e)})),K=Ae((e=>{const t=A.current;if(A.current=!1,t)return;if("function"==typeof S&&!S(e))return;const n=E(e);if(a(n)&&v){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===d(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=O&&ce(O.nodesRef.current,i).some((t=>{var n;return x(e,null==(n=t.context)?void 0:n.elements.floating)}));if(x(e,v)||x(e,f)||r)return;const u=O?ce(O.nodesRef.current,i):[];if(u.length>0){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}c.emit("dismiss",{type:"outsidePress",data:{returnFocus:P?{preventScroll:!0}:I(e)||k(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!g)return;function e(e){o(!1,e)}p.current.__escapeKeyBubbles=D,p.current.__outsidePressBubbles=F;const n=m(v);b&&n.addEventListener("keydown",N),S&&n.addEventListener(h,K);let u=[];return C&&(s(f)&&(u=t(f)),s(v)&&(u=u.concat(t(v))),!s(l)&&l&&l.contextElement&&(u=u.concat(t(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{b&&n.removeEventListener("keydown",N),S&&n.removeEventListener(h,K),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[p,v,f,l,b,S,h,r,o,C,g,D,F,N,K]),u.useEffect((()=>{A.current=!1}),[S,h]),u.useMemo((()=>g?{reference:{onKeyDown:N,[Ne[M]]:e=>{R&&(c.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:N,[Ke[h]]:()=>{A.current=!0}}}:{}),[g,c,R,h,M,o,N])}function _e(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:c}=e,[i,l]=u.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||i,f=n(e),d=Y(),m=Ae(((e,t)=>{e&&(p.current.openEvent=t),null==o||o(e,t)})),v=u.useRef(null),p=u.useRef({}),g=u.useState((()=>q()))[0],b=_(),y=u.useCallback((e=>{const t=s(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f.refs.setReference(t)}),[f.refs]),h=u.useCallback((e=>{(s(e)||null===e)&&(v.current=e,l(e)),(s(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!s(e))&&f.refs.setReference(e)}),[f.refs]),E=u.useMemo((()=>({...f.refs,setReference:h,setPositionReference:y,domReference:v})),[f.refs,h,y]),R=u.useMemo((()=>({...f.elements,domReference:a})),[f.elements,a]),w=u.useMemo((()=>({...f,refs:E,elements:R,dataRef:p,nodeId:c,floatingId:b,events:g,open:r,onOpenChange:m})),[f,c,b,g,r,m,E,R]);return F((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===c));e&&(e.context=w)})),u.useMemo((()=>({...f,context:w,refs:E,elements:R})),[f,E,R,w])}function He(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:c,refs:i,elements:{floating:l,domReference:f}}=e,{enabled:d=!0,keyboardOnly:v=!0}=t,b=u.useRef(""),y=u.useRef(!1),h=u.useRef();return u.useEffect((()=>{if(!d)return;const e=m(l).defaultView||window;function t(){!n&&a(f)&&f===g(m(f))&&(y.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,f,n,d]),u.useEffect((()=>{if(d)return c.on("dismiss",e),()=>{c.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(y.current=!0)}}),[c,d]),u.useEffect((()=>()=>{clearTimeout(h.current)}),[]),u.useMemo((()=>d?{reference:{onPointerDown(e){let{pointerType:t}=e;b.current=t,y.current=!(!t||!v)},onMouseLeave(){y.current=!1},onFocus(e){var t;y.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&x(o.current.openEvent,f)||r(!0,e.nativeEvent)},onBlur(e){y.current=!1;const t=e.relatedTarget,n=s(t)&&t.hasAttribute(Z("focus-guard"))&&"outside"===t.getAttribute("data-type");h.current=setTimeout((()=>{p(i.floating.current,t)||p(f,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[d,v,f,i,o,r])}function qe(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}function je(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>qe(t,e,"reference")),t),r=u.useCallback((t=>qe(t,e,"floating")),t),o=u.useCallback((t=>qe(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])}let We=!1;const Xe="ArrowUp",Ye="ArrowDown",Ue="ArrowLeft",Ve="ArrowRight";function ze(e,t,n){return Math.floor(e/t)!==n}function Ze(e,t){return t<0||t>=e.current.length}function Ge(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const c=e.current;let i=n;do{var l,s;i+=r?-u:u}while(i>=0&&i<=c.length-1&&(o?o.includes(i):null==c[i]||(null==(l=c[i])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=c[i])?void 0:s.getAttribute("aria-disabled"))));return i}function Qe(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Je(e,t){return Qe(t,e===Xe||e===Ye,e===Ue||e===Ve)}function $e(e,t,n){return Qe(t,e===Ye,n?e===Ue:e===Ve)||"Enter"===e||" "==e||""===e}function et(e,t){return Ge(e,{disabledIndices:t})}function tt(e,t){return Ge(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nt(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:c,floating:i}}=e,{listRef:l,activeIndex:s,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:v=null,allowEscape:y=!1,loop:E=!1,nested:R=!1,rtl:w=!1,virtual:x=!1,focusItemOnOpen:C="auto",focusItemOnHover:T=!0,openOnArrowKeyDown:O=!0,disabledIndices:P,orientation:L="vertical",cols:S=1,scrollItemIntoView:A=!0}=t,D=X(),N=Y(),K=Ae(f),B=u.useRef(C),_=u.useRef(null!=v?v:-1),H=u.useRef(null),q=u.useRef(!0),j=u.useRef(K),W=u.useRef(!!i),U=u.useRef(!1),V=u.useRef(!1),z=G(P),Z=G(n),Q=G(A),[J,$]=u.useState(),ee=Ae((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(x?$(r.id):ue(r,{preventScroll:!0,sync:!(!M()||!b())&&(We||U.current)}),requestAnimationFrame((()=>{const e=Q.current;e&&r&&(n||!q.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));F((()=>{document.createElement("div").focus({get preventScroll(){return We=!0,!1}})}),[]),F((()=>{d&&(n&&i?B.current&&null!=v&&(V.current=!0,K(v)):W.current&&(_.current=-1,j.current(null)))}),[d,n,i,v,K]),F((()=>{if(d&&n&&i)if(null==s){if(U.current=!1,null!=v)return;if(W.current&&(_.current=-1,ee(l,_)),!W.current&&B.current&&(null!=H.current||!0===B.current&&null==H.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else _.current=null==H.current||$e(H.current,L,w)||R?et(l,z.current):tt(l,z.current),H.current=null,K(_.current)};t()}}else Ze(l,s)||(_.current=s,ee(l,_,V.current),V.current=!1)}),[d,n,i,s,v,R,l,L,w,K,ee,z]),F((()=>{if(d&&W.current&&!i&&N){var e,t;const n=N.nodesRef.current,r=null==(e=n.find((e=>e.id===D)))||null==(t=e.context)?void 0:t.elements.floating,o=g(m(i)),u=n.some((e=>e.context&&p(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[d,i,N,D]),F((()=>{j.current=K,W.current=!!i})),F((()=>{n||(H.current=null)}),[n]);const te=null!=s,ne=u.useMemo((()=>{function e(e){if(!n)return;const t=l.current.indexOf(e);-1!==t&&K(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...T&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;q.current&&"touch"!==t&&(_.current=-1,ee(l,_),K(null),x||ue(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ee,T,l,K,x]);return u.useMemo((()=>{if(!d)return{};const e=z.current;function t(t){if(q.current=!1,U.current=!0,!Z.current&&t.currentTarget===o.floating.current)return;if(R&&function(e,t,n){return Qe(t,n?e===Ve:e===Ue,e===Xe)}(t.key,L,w))return h(t),r(!1,t.nativeEvent),void(a(c)&&c.focus());const u=_.current,i=et(l,e),s=tt(l,e);if("Home"===t.key&&(h(t),_.current=i,K(_.current)),"End"===t.key&&(h(t),_.current=s,K(_.current)),S>1){const n=_.current;if(t.key===Xe){if(h(t),-1===n)_.current=s;else if(_.current=Ge(l,{startingIndex:n,amount:S,decrement:!0,disabledIndices:e}),E&&(n-S<i||_.current<0)){const e=n%S,t=s%S,r=s-(t-e);_.current=t===e?s:t>e?r:r-S}Ze(l,_.current)&&(_.current=n),K(_.current)}if(t.key===Ye&&(h(t),-1===n?_.current=i:(_.current=Ge(l,{startingIndex:n,amount:S,disabledIndices:e}),E&&n+S>s&&(_.current=Ge(l,{startingIndex:n%S-S,amount:S,disabledIndices:e}))),Ze(l,_.current)&&(_.current=n),K(_.current)),"both"===L){const r=Math.floor(n/S);t.key===Ve&&(h(t),n%S!=S-1?(_.current=Ge(l,{startingIndex:n,disabledIndices:e}),E&&ze(_.current,S,r)&&(_.current=Ge(l,{startingIndex:n-n%S-1,disabledIndices:e}))):E&&(_.current=Ge(l,{startingIndex:n-n%S-1,disabledIndices:e})),ze(_.current,S,r)&&(_.current=n)),t.key===Ue&&(h(t),n%S!=0?(_.current=Ge(l,{startingIndex:n,disabledIndices:e,decrement:!0}),E&&ze(_.current,S,r)&&(_.current=Ge(l,{startingIndex:n+(S-n%S),decrement:!0,disabledIndices:e}))):E&&(_.current=Ge(l,{startingIndex:n+(S-n%S),decrement:!0,disabledIndices:e})),ze(_.current,S,r)&&(_.current=n));const o=Math.floor(s/S)===r;return Ze(l,_.current)&&(_.current=E&&o?t.key===Ue?s:Ge(l,{startingIndex:n-n%S-1,disabledIndices:e}):n),void K(_.current)}}if(Je(t.key,L)){if(h(t),n&&!x&&g(t.currentTarget.ownerDocument)===t.currentTarget)return _.current=$e(t.key,L,w)?i:s,void K(_.current);$e(t.key,L,w)?_.current=E?u>=s?y&&u!==l.current.length?-1:i:Ge(l,{startingIndex:u,disabledIndices:e}):Math.min(s,Ge(l,{startingIndex:u,disabledIndices:e})):_.current=E?u<=i?y&&-1!==u?l.current.length:s:Ge(l,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(i,Ge(l,{startingIndex:u,decrement:!0,disabledIndices:e})),Ze(l,_.current)?K(null):K(_.current)}}function u(e){"auto"===C&&I(e.nativeEvent)&&(B.current=!0)}const i=x&&n&&te&&{"aria-activedescendant":J};return{reference:{...i,onKeyDown(o){q.current=!1;const u=0===o.key.indexOf("Arrow");if(x&&n)return t(o);if(!n&&!O&&u)return;const c=u||"Enter"===o.key||""===o.key.trim(),i=Je(o.key,L),s=function(e,t,n){return Qe(t,n?e===Ue:e===Ve,e===Ye)}(o.key,L,w);c&&(H.current=R&&i?null:o.key),R?s&&(h(o),n?(_.current=et(l,e),K(_.current)):r(!0,o.nativeEvent)):i&&(null!=v&&(_.current=v),h(o),!n&&O?r(!0,o.nativeEvent):t(o),n&&K(_.current))},onFocus(){n&&K(null)},onPointerDown:function(e){B.current=C,"auto"===C&&k(e.nativeEvent)&&(B.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===L?void 0:L,...i,onKeyDown:t,onPointerMove(){q.current=!0}},item:ne}}),[c,o,J,z,Z,l,d,L,w,x,n,te,R,v,O,y,S,E,C,K,r,ne])}function rt(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}function ot(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:c="dialog"}=t,i=_();return u.useMemo((()=>{const e={id:r,role:c};return o?"tooltip"===c?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":n?r:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:i}},floating:{...e,..."menu"===c&&{"aria-labelledby":i}}}:{}}),[o,c,n,r,i])}const ut=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function ct(e,t){return"function"==typeof e?e(t):e}function it(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,c=("number"==typeof o?o:o.close)||0,[i,l]=u.useState(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,c);return F((()=>{i&&!f&&a("unmounted")}),[i,f]),F((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function lt(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:c,duration:i=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof i,d=(f?i:i.open)||0,m=(f?i:i.close)||0,[v,p]=u.useState((()=>({...ct(c,a),...ct(n,a)}))),{isMounted:g,status:b}=it(e,{duration:i}),y=G(n),h=G(r),E=G(o),R=G(c);return F((()=>{const e=ct(y.current,a),t=ct(E.current,a),n=ct(R.current,a),r=ct(h.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===b&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===b&&p({transitionProperty:Object.keys(r).map(ut).join(","),transitionDuration:d+"ms",...n,...r}),"close"===b){const r=t||e;p({transitionProperty:Object.keys(r).map(ut).join(","),transitionDuration:m+"ms",...n,...r})}}),[m,E,y,h,R,d,b,a]),{isMounted:g,styles:v}}function st(e,t){var n;const{open:r,dataRef:o}=e,{listRef:c,activeIndex:i,onMatch:l,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:v=null}=t,p=u.useRef(),g=u.useRef(""),b=u.useRef(null!=(n=null!=v?v:i)?n:-1),y=u.useRef(null),E=Ae(l),R=Ae(s),w=G(f),x=G(m);return F((()=>{r&&(clearTimeout(p.current),y.current=null,g.current="")}),[r]),F((()=>{var e;r&&""===g.current&&(b.current=null!=(e=null!=v?v:i)?e:-1)}),[r,v,i]),u.useMemo((()=>{if(!a)return{};function e(e){e?o.current.typing||(o.current.typing=e,R(e)):o.current.typing&&(o.current.typing=e,R(e))}function t(e,t,n){const r=w.current?w.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=c.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(o,o,g.current)?e(!1):" "===n.key&&h(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(h(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&g.current===n.key&&(g.current="",b.current=y.current),g.current+=n.key,clearTimeout(p.current),p.current=setTimeout((()=>{g.current="",b.current=y.current,e(!1)}),d);const u=b.current,i=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],g.current);-1!==i?(E(i),y.current=i):" "!==n.key&&(g.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[a,r,o,c,d,x,w,E,R])}function at(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const ft=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:u,onFallbackChange:c,offset:i=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:v}}=t,p=n.current[l];if(!p)return{};const g={...t,...await r(-p.offsetTop-v.clientTop-m.reference.height/2-p.offsetHeight/2-i).fn(t)},b=(null==f?void 0:f.current)||v,y=await o(at(g,b.scrollHeight),d),h=await o(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),R=g.y+E,w=Math.max(0,b.scrollHeight-E-Math.max(0,y.bottom));return b.style.maxHeight=w+"px",b.scrollTop=E,c&&(b.offsetHeight<p.offsetHeight*Math.min(s,n.current.length-1)-1||h.top>=-a||h.bottom>=-a?A((()=>c(!0))):A((()=>c(!1)))),u&&(u.current=await o(at({...g,y:R},b.offsetHeight),d)),{y:R}}});function dt(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:c,scrollRef:i,onChange:l}=t,s=Ae(l),a=u.useRef(!1),f=u.useRef(null),d=u.useRef(null);return u.useEffect((()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,r=c.current.top>=-.5,o=c.current.bottom>=-.5,u=t.scrollHeight-t.clientHeight,i=n<0?-1:1,l=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),A((()=>{s((e=>e+Math[l](n,u*i)))}))):/firefox/i.test(C())&&(t.scrollTop+=n))}const t=(null==i?void 0:i.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=c.current&&(d.current={...c.current})})),()=>{f.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0}),[o,n,r.floating,c,i,s]),u.useMemo((()=>o?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=(null==i?void 0:i.current)||r.floating;if(c.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&A((()=>s((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}),[o,c,r.floating,i,s])}function mt(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,c=u-1;e<u;c=e++){const[u,i]=t[e]||[0,0],[l,s]=t[c]||[0,0];i>=r!=s>=r&&n<=(l-u)*(r-i)/(s-i)+u&&(o=!o)}return o}function vt(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,c=null,i=null,l=performance.now();const a=e=>{let{x:n,y:a,placement:f,elements:d,onClose:m,nodeId:v,tree:g}=e;return function(e){function b(){clearTimeout(o),m()}if(clearTimeout(o),!d.domReference||!d.floating||null==f||null==n||null==a)return;const{clientX:y,clientY:h}=e,R=[y,h],w=E(e),x="mouseleave"===e.type,I=p(d.floating,w),k=p(d.domReference,w),M=d.domReference.getBoundingClientRect(),C=d.floating.getBoundingClientRect(),T=f.split("-")[0],O=n>C.right-C.width/2,P=a>C.bottom-C.height/2,L=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(R,M),S=C.width>M.width,A=C.height>M.height,D=(S?M:C).left,F=(S?M:C).right,N=(A?M:C).top,K=(A?M:C).bottom;if(I&&(u=!0,!x))return;if(k&&(u=!1),k&&!x)return void(u=!0);if(x&&s(e.relatedTarget)&&p(d.floating,e.relatedTarget))return;if(g&&ce(g.nodesRef.current,v).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===T&&a>=M.bottom-1||"bottom"===T&&a<=M.top+1||"left"===T&&n>=M.right-1||"right"===T&&n<=M.left+1)return b();let B=[];switch(T){case"top":B=[[D,M.top+1],[D,C.bottom-1],[F,C.bottom-1],[F,M.top+1]];break;case"bottom":B=[[D,C.top+1],[D,M.bottom-1],[F,M.bottom-1],[F,C.top+1]];break;case"left":B=[[C.right-1,K],[C.right-1,N],[M.left+1,N],[M.left+1,K]];break;case"right":B=[[M.right-1,K],[M.right-1,N],[C.left+1,N],[C.left+1,K]]}if(!mt([y,h],B)){if(u&&!L)return b();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===c||null===i||0===r)return c=e,i=t,l=n,null;const o=e-c,u=t-i,s=Math.sqrt(o*o+u*u);return c=e,i=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return b()}mt([y,h],function(e){let[n,r]=e;switch(T){case"top":return[[S?n+t/2:O?n+4*t:n-4*t,r+t+1],[S?n-t/2:O?n+4*t:n-4*t,r+t+1],...[[C.left,O||S?C.bottom-t:C.top],[C.right,O?S?C.bottom-t:C.top:C.bottom-t]]];case"bottom":return[[S?n+t/2:O?n+4*t:n-4*t,r-t],[S?n-t/2:O?n+4*t:n-4*t,r-t],...[[C.left,O||S?C.top+t:C.bottom],[C.right,O?S?C.top+t:C.bottom:C.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:P?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:P?r+4*t:r-4*t];return[...[[P||A?C.right-t:C.left,C.top],[P?A?C.right-t:C.left:C.right-t,C.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:P?r+4*t:r-4*t],[n-t,A?r-t/2:P?r+4*t:r-4*t],...[[P||A?C.left+t:C.right,C.top],[P?A?C.left+t:C.right:C.left+t,C.bottom]]]}}([n,a]))?!u&&r&&(o=window.setTimeout(b,40)):b()}}};return a.__options={blockPointerEvents:n},a}export{H as FloatingArrow,ne as FloatingDelayGroup,we as FloatingFocusManager,ke as FloatingList,V as FloatingNode,Te as FloatingOverlay,he as FloatingPortal,z as FloatingTree,ft as inner,vt as safePolygon,Le as useClick,Fe as useClientPoint,re as useDelayGroup,te as useDelayGroupContext,Be as useDismiss,_e as useFloating,U as useFloatingNodeId,X as useFloatingParentNodeId,ye as useFloatingPortalNode,Y as useFloatingTree,He as useFocus,$ as useHover,_ as useId,dt as useInnerOffset,je as useInteractions,Me as useListItem,nt as useListNavigation,rt as useMergeRefs,ot as useRole,it as useTransitionStatus,lt as useTransitionStyles,st as useTypeahead}; | ||
import{platform as e,getOverflowAncestors as t,useFloating as n,offset as r,detectOverflow as o}from"@floating-ui/react-dom";export{arrow,autoPlacement,autoUpdate,computePosition,detectOverflow,flip,getOverflowAncestors,hide,inline,limitShift,offset,platform,shift,size}from"@floating-ui/react-dom";import*as u from"react";import{useLayoutEffect as c,useEffect as i,useRef as l}from"react";import{isElement as s,isHTMLElement as a,getWindow as f,isLastTraversableNode as d,getParentNode as m,getComputedStyle as v}from"@floating-ui/utils/dom";import{getDocument as p,isMouseLikePointerType as g,contains as y,activeElement as b,isSafari as h,isTypeableElement as E,stopEvent as w,getTarget as R,getPlatform as x,isReactEvent as k,isRootElement as I,isEventTargetWithin as M,isVirtualClick as C,isVirtualPointerEvent as T,isMac as O,getUserAgent as L}from"@floating-ui/utils/react";import{tabbable as P}from"tabbable";import{createPortal as S,flushSync as A}from"react-dom";function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(this,arguments)}var N="undefined"!=typeof document?c:i;let F=!1,K=0;const H=()=>"floating-ui-"+K++;const B=u["useId".toString()]||function(){const[e,t]=u.useState((()=>F?H():void 0));return N((()=>{null==e&&t(H())}),[]),u.useEffect((()=>{F||(F=!0)}),[]),e},_=u.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:c}},width:i=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:m,style:{transform:v,...p}={},...g}=t;const y=B();if(!o)return null;a*=2;const b=a/2,h=i/2*(s/-8+1),E=l/2*s/4,[w,R]=r.split("-"),x=e.isRTL(o),k=!!m,I="top"===w||"bottom"===w,M=f&&"end"===R?"bottom":"top";let C=f&&"end"===R?"right":"left";f&&x&&(C="end"===R?"left":"right");const T=null!=(null==c?void 0:c.x)?f||c.x:"",O=null!=(null==c?void 0:c.y)?f||c.y:"",L=m||"M0,0 H"+i+" L"+(i-h)+","+(l-E)+" Q"+i/2+","+l+" "+h+","+(l-E)+" Z",P={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[w];return u.createElement("svg",D({},g,{"aria-hidden":!0,ref:n,width:k?i:i+a,height:i,viewBox:"0 0 "+i+" "+(l>i?l:i),style:{position:"absolute",pointerEvents:"none",[C]:T,[M]:O,[w]:I||k?"100%":"calc(100% - "+a/2+"px)",transform:""+P+(null!=v?v:""),...p}}),a>0&&u.createElement("path",{clipPath:"url(#"+y+")",fill:"none",stroke:d,strokeWidth:a+(m?0:1),d:L}),u.createElement("path",{stroke:a&&!m?g.fill:"none",d:L}),u.createElement("clipPath",{id:y},u.createElement("rect",{x:-b,y:b*(k?-1:1),width:i+a,height:i})))}));function W(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const q=u.createContext(null),j=u.createContext(null),X=()=>{var e;return(null==(e=u.useContext(q))?void 0:e.id)||null},Y=()=>u.useContext(j);function U(e){const t=B(),n=Y(),r=X(),o=e||r;return N((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function V(e){let{children:t,id:n}=e;const r=X();return u.createElement(q.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)}function z(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),c=u.useState((()=>W()))[0];return u.createElement(j.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:c})),[n,r,o,c])},t)}function Z(e){return"data-floating-ui-"+e}function G(e){const t=l(e);return N((()=>{t.current=e})),t}const Q=Z("safe-polygon");function J(e,t,n){return n&&!g(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function $(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:c,elements:{domReference:i,floating:l},refs:a}=e,{enabled:f=!0,delay:d=0,handleClose:m=null,mouseOnly:v=!1,restMs:b=0,move:h=!0}=t,E=Y(),w=X(),R=G(m),x=G(d),k=u.useRef(),I=u.useRef(),M=u.useRef(),C=u.useRef(),T=u.useRef(!0),O=u.useRef(!1),L=u.useRef((()=>{})),P=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(f)return c.on("dismiss",e),()=>{c.off("dismiss",e)};function e(){clearTimeout(I.current),clearTimeout(C.current),T.current=!0}}),[f,c]),u.useEffect((()=>{if(!f||!R.current||!n)return;function e(e){P()&&r(!1,e)}const t=p(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,f,R,o,P]);const S=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=J(x.current,"close",k.current);n&&!M.current?(clearTimeout(I.current),I.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(I.current),r(!1,e))}),[x,r]),A=u.useCallback((()=>{L.current(),M.current=void 0}),[]),D=u.useCallback((()=>{if(O.current){const e=p(a.floating.current).body;e.style.pointerEvents="",e.removeAttribute(Q),O.current=!1}}),[a]);return u.useEffect((()=>{if(f&&s(i)){const e=i;return n&&e.addEventListener("mouseleave",a),null==l||l.addEventListener("mouseleave",a),h&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",c),()=>{n&&e.removeEventListener("mouseleave",a),null==l||l.removeEventListener("mouseleave",a),h&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",c)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(I.current),T.current=!1,v&&!g(k.current)||b>0&&0===J(x.current,"open"))return;const t=J(x.current,"open",k.current);t?I.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function c(r){if(t())return;L.current();const o=p(l);if(clearTimeout(C.current),R.current){n||clearTimeout(I.current),M.current=R.current({...e,tree:E,x:r.clientX,y:r.clientY,onClose(){D(),A(),S(r)}});const t=M.current;return o.addEventListener("mousemove",t),void(L.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==k.current||!y(l,r.relatedTarget))&&S(r)}function a(n){t()||null==R.current||R.current({...e,tree:E,x:n.clientX,y:n.clientY,onClose(){D(),A(),S(n)}})(n)}}),[i,l,f,e,v,b,h,S,A,D,r,n,E,x,R,o]),N((()=>{var e;if(f&&n&&null!=(e=R.current)&&e.__options.blockPointerEvents&&P()){const e=p(l).body;if(e.setAttribute(Q,""),e.style.pointerEvents="none",O.current=!0,s(i)&&l){var t,r;const e=i,n=null==E||null==(t=E.nodesRef.current.find((e=>e.id===w)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[f,n,w,l,i,E,R,o,P]),N((()=>{n||(k.current=void 0,A(),D())}),[n,A,D]),u.useEffect((()=>()=>{A(),clearTimeout(I.current),clearTimeout(C.current),D()}),[f,i,A,D]),u.useMemo((()=>{if(!f)return{};function e(e){k.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===b||(clearTimeout(C.current),C.current=setTimeout((()=>{T.current||r(!0,e.nativeEvent)}),b))}},floating:{onMouseEnter(){clearTimeout(I.current)},onMouseLeave(e){c.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),S(e.nativeEvent,!1)}}}}),[c,f,b,n,r,S])}const ee=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),te=()=>u.useContext(ee),ne=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,c]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),i=u.useRef(null),l=u.useCallback((e=>{c({currentId:e})}),[]);return N((()=>{o.currentId?null===i.current?i.current=o.currentId:c({isInstantPhase:!0}):(c({isInstantPhase:!1}),i.current=null)}),[o.currentId]),u.createElement(ee.Provider,{value:u.useMemo((()=>({...o,setState:c,setCurrentId:l})),[o,c,l])},t)},re=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:c,initialDelay:i,setState:l,timeoutMs:s}=te();N((()=>{u&&(l({delay:{open:1,close:J(i,"close")}}),u!==o&&r(!1))}),[o,r,l,u,i]),N((()=>{function e(){r(!1),l({delay:i,currentId:null})}if(!n&&u===o){if(s){const t=window.setTimeout(e,s);return()=>{clearTimeout(t)}}e()}}),[n,l,u,o,r,i,s]),N((()=>{n&&c(o)}),[n,c,o])};let oe=0;function ue(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(oe);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():oe=requestAnimationFrame(u)}function ce(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let ie=new WeakMap,le=new WeakSet,se={},ae=0;const fe=e=>e&&(e.host||fe(e.parentNode)),de=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=fe(t);return e.contains(n)?n:null})).filter((e=>null!=e));function me(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=p(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,c=de(t,e),i=new Set,l=new Set(c),s=[];se[o]||(se[o]=new WeakMap);const a=se[o];return c.forEach((function e(t){t&&!i.has(t)&&(i.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&Array.prototype.forEach.call(t.children,(t=>{if(i.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(ie.get(t)||0)+1,c=(a.get(t)||0)+1;ie.set(t,r),a.set(t,c),s.push(t),1===r&&n&&le.add(t),1===c&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),i.clear(),ae++,()=>{s.forEach((e=>{const t=(ie.get(e)||0)-1,n=(a.get(e)||0)-1;ie.set(e,t),a.set(e,n),t||(!le.has(e)&&u&&e.removeAttribute(u),le.delete(e)),n||e.removeAttribute(o)})),ae--,ae||(ie=new WeakMap,ie=new WeakMap,le=new WeakSet,se={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const ve=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pe(e,t){const n=P(e,ve());"prev"===t&&n.reverse();const r=n.indexOf(b(p(e)));return n.slice(r+1)[0]}function ge(){return pe(document.body,"next")}function ye(){return pe(document.body,"prev")}function be(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!y(n,r)}function he(e){P(e,ve()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Ee(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const we={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Re(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const xe=u.forwardRef((function(e,t){const[n,r]=u.useState();N((()=>(h()&&r("button"),document.addEventListener("keydown",Re),()=>{document.removeEventListener("keydown",Re)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Z("focus-guard")]:"",style:we};return u.createElement("span",D({},e,o))})),ke=u.createContext(null);function Ie(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),c=B(),i=Ce(),l=u.useMemo((()=>({id:t,root:n,portalContext:i,uniqueId:c})),[t,n,i,c]),a=u.useRef();return N((()=>()=>{null==r||r.remove()}),[r,l]),N((()=>{if(a.current===l)return;a.current=l;const{id:e,root:t,portalContext:n,uniqueId:r}=l,u=e?document.getElementById(e):null,c=Z("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(c,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!s(u)&&(u=u.current),u=u||document.body;let i=null;e&&(i=document.createElement("div"),i.id=e,u.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(c,""),u=i||u,u.appendChild(l),o(l)}}),[l]),r}function Me(e){let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const c=Ie({id:n,root:r}),[i,l]=u.useState(null),s=u.useRef(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=!!i&&!i.modal&&i.open&&o&&!(!r&&!c);return u.useEffect((()=>{if(c&&o&&(null==i||!i.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&be(e)){("focusin"===e.type?Ee:he)(c)}}}),[c,o,null==i?void 0:i.modal]),u.createElement(ke.Provider,{value:u.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:f,afterInsideRef:d,portalNode:c,setFocusManagerState:l})),[o,c])},m&&c&&u.createElement(xe,{"data-type":"outside",ref:s,onFocus:e=>{if(be(e,c)){var t;null==(t=f.current)||t.focus()}else{const e=ye()||(null==i?void 0:i.refs.domReference.current);null==e||e.focus()}}}),m&&c&&u.createElement("span",{"aria-owns":c.id,style:we}),c&&S(t,c),m&&c&&u.createElement(xe,{"data-type":"outside",ref:a,onFocus:e=>{if(be(e,c)){var t;null==(t=d.current)||t.focus()}else{const t=ge()||(null==i?void 0:i.refs.domReference.current);null==t||t.focus(),(null==i?void 0:i.closeOnFocusOut)&&(null==i||i.onOpenChange(!1,e.nativeEvent))}}}))}const Ce=()=>u.useContext(ke),Te=u.forwardRef((function(e,t){return u.createElement("button",D({},e,{type:"button",ref:t,tabIndex:-1,style:we}))}));function Oe(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:c=!0,initialFocus:i=0,returnFocus:l=!0,modal:s=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0}=e,{open:m,refs:v,nodeId:g,onOpenChange:h,events:x,dataRef:k,elements:{domReference:I,floating:M}}=t,C="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||c,T=G(o),O=G(i),L=G(l),S=Y(),A=Ce(),D="number"==typeof i&&i<0,F=u.useRef(null),K=u.useRef(null),H=u.useRef(!1),B=u.useRef(null),_=u.useRef(!1),W=null!=A,q=I&&"combobox"===I.getAttribute("role")&&E(I),j=u.useCallback((function(e){return void 0===e&&(e=M),e?P(e,ve()):[]}),[M]),X=u.useCallback((e=>{const t=j(e);return T.current.map((e=>I&&"reference"===e?I:M&&"floating"===e?M:t)).filter(Boolean).flat()}),[I,M,T,j]);function U(e){return!r&&f&&s?u.createElement(Te,{ref:"start"===e?F:K,onClick:e=>h(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}u.useEffect((()=>{if(r||!s)return;function e(e){if("Tab"===e.key){y(M,b(p(M)))&&0===j().length&&!q&&w(e);const t=X(),n=R(e);"reference"===T.current[0]&&n===I&&(w(e),e.shiftKey?ue(t[t.length-1]):ue(t[1])),"floating"===T.current[1]&&n===M&&e.shiftKey&&(w(e),ue(t[0]))}}const t=p(M);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,I,M,s,T,v,q,j,X]),u.useEffect((()=>{if(!r&&d)return M&&a(I)?(I.addEventListener("focusout",t),I.addEventListener("pointerdown",e),!s&&M.addEventListener("focusout",t),()=>{I.removeEventListener("focusout",t),I.removeEventListener("pointerdown",e),!s&&M.removeEventListener("focusout",t)}):void 0;function e(){_.current=!0,setTimeout((()=>{_.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(y(I,t)||y(M,t)||y(t,M)||y(null==A?void 0:A.portalNode,t)||null!=t&&t.hasAttribute(Z("focus-guard"))||S&&(ce(S.nodesRef.current,g).find((e=>{var n,r;return y(null==(n=e.context)?void 0:n.elements.floating,t)||y(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(S.nodesRef.current,g).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!_.current&&t!==B.current&&(H.current=!0,h(!1,e))}))}}),[r,I,M,s,g,S,A,h,d]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==A||null==(e=A.portalNode)?void 0:e.querySelectorAll("["+Z("portal")+"]"))||[]);if(M){const e=[M,...t,F.current,K.current,T.current.includes("reference")||q?I:null].filter((e=>null!=e)),n=s?me(e,C,!C):me(e);return()=>{n()}}}),[r,I,M,s,T,A,q,C]),N((()=>{if(r||!M)return;const e=p(M),t=b(e);queueMicrotask((()=>{const e=X(M),n=O.current,r=("number"==typeof n?e[n]:n.current)||M,o=y(M,t);D||o||!m||ue(r,{preventScroll:r===M})}))}),[r,m,M,D,X,O]),N((()=>{if(r||!M)return;let e=!1;const t=p(M),n=b(t),o=k.current;function u(t){if("escapeKey"===t.type&&v.domReference.current&&(B.current=v.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(H.current=!1,e=n.preventScroll):H.current=!n}return B.current=n,x.on("dismiss",u),()=>{x.off("dismiss",u);const n=b(t);(y(M,n)||S&&ce(S.nodesRef.current,g).some((e=>{var t;return y(null==(t=e.context)?void 0:t.elements.floating,n)}))||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&v.domReference.current&&(B.current=v.domReference.current),L.current&&a(B.current)&&!H.current&&ue(B.current,{cancelPrevious:!1,preventScroll:e})}}),[r,M,L,k,v,x,S,g]),N((()=>{if(!r&&A)return A.setFocusManagerState({modal:s,closeOnFocusOut:d,open:m,onOpenChange:h,refs:v}),()=>{A.setFocusManagerState(null)}}),[r,A,s,m,h,v,d]),N((()=>{if(!r&&M&&"function"==typeof MutationObserver){const e=()=>{const e=M.getAttribute("tabindex");T.current.includes("floating")||b(p(M))!==v.domReference.current&&0===j().length?"0"!==e&&M.setAttribute("tabindex","0"):"-1"!==e&&M.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(M,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[r,M,v,T,j]);const V=!r&&C&&!q&&(W||s);return u.createElement(u.Fragment,null,V&&u.createElement(xe,{"data-type":"inside",ref:null==A?void 0:A.beforeInsideRef,onFocus:e=>{if(s){const e=X();ue("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(H.current=!1,be(e,A.portalNode)){const e=ge()||I;null==e||e.focus()}else{var t;null==(t=A.beforeOutsideRef.current)||t.focus()}}}),!q&&U("start"),n,U("end"),V&&u.createElement(xe,{"data-type":"inside",ref:null==A?void 0:A.afterInsideRef,onFocus:e=>{if(s)ue(X()[0]);else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(d&&(H.current=!0),be(e,A.portalNode)){const e=ye()||I;null==e||e.focus()}else{var t;null==(t=A.afterOutsideRef.current)||t.focus()}}}))}function Le(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Pe=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Se(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,c]=u.useState((()=>new Map)),i=u.useCallback((e=>{c((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{c((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return N((()=>{const e=new Map(o);Array.from(e.keys()).sort(Le).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||c(e)}),[o]),u.createElement(Pe.Provider,{value:u.useMemo((()=>({register:i,unregister:l,map:o,elementsRef:n,labelsRef:r})),[i,l,o,n,r])},t)}function Ae(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:c,unregister:i,map:l,elementsRef:s,labelsRef:a}=u.useContext(Pe),f=u.useCallback((e=>{if(o.current=e,null!==n&&(s.current[n]=e,a)){var r;const o=void 0!==t;a.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,s,a,t]);return N((()=>{const e=o.current;if(e)return c(e),()=>{i(e)}}),[c,i]),N((()=>{const e=o.current?l.get(o.current):null;null!=e&&r(e)}),[l]),u.useMemo((()=>({ref:f,index:null==n?-1:n})),[n,f])}const De=Z("scroll-lock"),Ne=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return N((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(De))return;document.body.setAttribute(De,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(x()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(De),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,c=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,i=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(c))+"px",left:-(i-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(De),window.scrollTo(i,l)}}),[n]),u.createElement("div",D({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Fe(e){return a(e.target)&&"BUTTON"===e.target.tagName}function Ke(e){return E(e)}function He(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:c}}=e,{enabled:i=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),m=u.useRef(!1);return u.useMemo((()=>i?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(g(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent)):r(!1,e.nativeEvent)))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:g(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent):r(!1,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Fe(e)||(" "!==e.key||Ke(c)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||Fe(e)||Ke(c)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,e.nativeEvent))}}}:{}),[i,o,l,a,f,c,s,n,r])}const Be=u["useInsertionEffect".toString()]||(e=>e());function _e(e){const t=u.useRef((()=>{}));return Be((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function We(e){return null!=e&&null!=e.clientX}function qe(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:c}}=e,{enabled:i=!0,axis:l="both",x:s=null,y:a=null}=t,d=u.useRef(!1),m=u.useRef(null),[v,p]=u.useState(),[b,h]=u.useState([]),E=_e(((e,t)=>{d.current||o.current.openEvent&&!We(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,c;const i=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(c=t.dataRef.current.openEvent)?void 0:c.type)||"")&&"touch"!==t.pointerType;let f=i.width,d=i.height,m=i.x,v=i.y;return null==n&&t.x&&l&&(n=i.x-t.x),null==r&&t.y&&s&&(r=i.y-t.y),m-=n||0,v-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?i.width:0,d="x"===t.axis?i.height:0,m=l&&null!=t.x?t.x:m,v=s&&null!=t.y?t.y:v):o&&!a&&(d="x"===t.axis?i.height:d,f="y"===t.axis?i.width:f),o=!0,{width:f,height:d,x:m,y:v,top:v,right:m+f,bottom:v+d,left:m}}}}(r.domReference,{x:e,y:t,axis:l,dataRef:o,pointerType:v}))})),w=_e((e=>{null==s&&null==a&&(n?m.current||h([]):E(e.clientX,e.clientY))})),x=g(v)?c:n,k=u.useCallback((()=>{if(!x||!i||null!=s||null!=a)return;const e=f(r.floating.current);function t(n){const o=R(n);y(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):E(n.clientX,n.clientY)}if(!o.current.openEvent||We(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,i,x,r,E,s,a]);return u.useEffect((()=>k()),[k,b]),u.useEffect((()=>{i&&!c&&(d.current=!1)}),[i,c]),u.useEffect((()=>{!i&&n&&(d.current=!0)}),[i,n]),N((()=>{!i||null==s&&null==a||(d.current=!1,E(s,a))}),[i,s,a,E]),u.useMemo((()=>{if(!i)return{};function e(e){let{pointerType:t}=e;p(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:w,onMouseEnter:w}}}),[i,w])}const je={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Xe={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function Ye(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:c,nodeId:i,elements:{reference:l,domReference:f,floating:g},dataRef:b}=e,{enabled:h=!0,escapeKey:E=!0,outsidePress:w=!0,outsidePressEvent:x="pointerdown",referencePress:O=!1,referencePressEvent:L="pointerdown",ancestorScroll:P=!1,bubbles:S}=n,A=Y(),D=null!=X(),N=_e("function"==typeof w?w:()=>!1),F="function"==typeof w?N:w,K=u.useRef(!1),{escapeKeyBubbles:H,outsidePressBubbles:B}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(S),_=_e((e=>{if(!r||!h||!E||"Escape"!==e.key)return;const t=A?ce(A.nodesRef.current,i):[];if(!H&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}c.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,k(e)?e.nativeEvent:e)})),W=_e((e=>{const t=K.current;if(K.current=!1,t)return;if("function"==typeof F&&!F(e))return;const n=R(e),r="["+Z("inert")+"]",u=p(g).querySelectorAll(r);let l=s(n)?n:null;for(;l&&!d(l);){const e=m(l);if(e===p(g).body||!s(e))break;l=e}if(u.length&&s(n)&&!I(n)&&!y(n,g)&&Array.from(u).every((e=>!y(l,e))))return;if(a(n)&&g){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===v(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const b=A&&ce(A.nodesRef.current,i).some((t=>{var n;return M(e,null==(n=t.context)?void 0:n.elements.floating)}));if(M(e,g)||M(e,f)||b)return;const h=A?ce(A.nodesRef.current,i):[];if(h.length>0){let e=!0;if(h.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}c.emit("dismiss",{type:"outsidePress",data:{returnFocus:D?{preventScroll:!0}:C(e)||T(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!h)return;function e(e){o(!1,e)}b.current.__escapeKeyBubbles=H,b.current.__outsidePressBubbles=B;const n=p(g);E&&n.addEventListener("keydown",_),F&&n.addEventListener(x,W);let u=[];return P&&(s(f)&&(u=t(f)),s(g)&&(u=u.concat(t(g))),!s(l)&&l&&l.contextElement&&(u=u.concat(t(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{E&&n.removeEventListener("keydown",_),F&&n.removeEventListener(x,W),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[b,g,f,l,E,F,x,r,o,P,h,H,B,_,W]),u.useEffect((()=>{K.current=!1}),[F,x]),u.useMemo((()=>h?{reference:{onKeyDown:_,[je[L]]:e=>{O&&(c.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:_,[Xe[x]]:()=>{K.current=!0}}}:{}),[h,c,O,x,L,o,_])}function Ue(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:c}=e,[i,l]=u.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||i,f=n(e),d=Y(),m=_e(((e,t)=>{e&&(p.current.openEvent=t),null==o||o(e,t)})),v=u.useRef(null),p=u.useRef({}),g=u.useState((()=>W()))[0],y=B(),b=u.useCallback((e=>{const t=s(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f.refs.setReference(t)}),[f.refs]),h=u.useCallback((e=>{(s(e)||null===e)&&(v.current=e,l(e)),(s(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!s(e))&&f.refs.setReference(e)}),[f.refs]),E=u.useMemo((()=>({...f.refs,setReference:h,setPositionReference:b,domReference:v})),[f.refs,h,b]),w=u.useMemo((()=>({...f.elements,domReference:a})),[f.elements,a]),R=u.useMemo((()=>({...f,refs:E,elements:w,dataRef:p,nodeId:c,floatingId:y,events:g,open:r,onOpenChange:m})),[f,c,y,g,r,m,E,w]);return N((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===c));e&&(e.context=R)})),u.useMemo((()=>({...f,context:R,refs:E,elements:w})),[f,E,w,R])}function Ve(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:c,refs:i,elements:{floating:l,domReference:f}}=e,{enabled:d=!0,keyboardOnly:m=!0}=t,v=u.useRef(""),g=u.useRef(!1),h=u.useRef();return u.useEffect((()=>{if(!d)return;const e=p(l).defaultView||window;function t(){!n&&a(f)&&f===b(p(f))&&(g.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,f,n,d]),u.useEffect((()=>{if(d)return c.on("dismiss",e),()=>{c.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(g.current=!0)}}),[c,d]),u.useEffect((()=>()=>{clearTimeout(h.current)}),[]),u.useMemo((()=>d?{reference:{onPointerDown(e){let{pointerType:t}=e;v.current=t,g.current=!(!t||!m)},onMouseLeave(){g.current=!1},onFocus(e){var t;g.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&M(o.current.openEvent,f)||r(!0,e.nativeEvent)},onBlur(e){g.current=!1;const t=e.relatedTarget,n=s(t)&&t.hasAttribute(Z("focus-guard"))&&"outside"===t.getAttribute("data-type");h.current=setTimeout((()=>{y(i.floating.current,t)||y(f,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[d,m,f,i,o,r])}function ze(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}function Ze(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>ze(t,e,"reference")),t),r=u.useCallback((t=>ze(t,e,"floating")),t),o=u.useCallback((t=>ze(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])}let Ge=!1;const Qe="ArrowUp",Je="ArrowDown",$e="ArrowLeft",et="ArrowRight";function tt(e,t,n){return Math.floor(e/t)!==n}function nt(e,t){return t<0||t>=e.current.length}function rt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const c=e.current;let i=n;do{var l,s;i+=r?-u:u}while(i>=0&&i<=c.length-1&&(o?o.includes(i):null==c[i]||(null==(l=c[i])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=c[i])?void 0:s.getAttribute("aria-disabled"))));return i}function ot(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ut(e,t){return ot(t,e===Qe||e===Je,e===$e||e===et)}function ct(e,t,n){return ot(t,e===Je,n?e===$e:e===et)||"Enter"===e||" "==e||""===e}function it(e,t){return rt(e,{disabledIndices:t})}function lt(e,t){return rt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function st(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:c,floating:i}}=e,{listRef:l,activeIndex:s,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:m=null,allowEscape:v=!1,loop:g=!1,nested:E=!1,rtl:R=!1,virtual:x=!1,focusItemOnOpen:k="auto",focusItemOnHover:I=!0,openOnArrowKeyDown:M=!0,disabledIndices:L,orientation:P="vertical",cols:S=1,scrollItemIntoView:A=!0}=t,D=X(),F=Y(),K=_e(f),H=u.useRef(k),B=u.useRef(null!=m?m:-1),_=u.useRef(null),W=u.useRef(!0),q=u.useRef(K),j=u.useRef(!!i),U=u.useRef(!1),V=u.useRef(!1),z=G(L),Z=G(n),Q=G(A),[J,$]=u.useState(),ee=_e((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(x?$(r.id):ue(r,{preventScroll:!0,sync:!(!O()||!h())&&(Ge||U.current)}),requestAnimationFrame((()=>{const e=Q.current;e&&r&&(n||!W.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));N((()=>{document.createElement("div").focus({get preventScroll(){return Ge=!0,!1}})}),[]),N((()=>{d&&(n&&i?H.current&&null!=m&&(V.current=!0,K(m)):j.current&&(B.current=-1,q.current(null)))}),[d,n,i,m,K]),N((()=>{if(d&&n&&i)if(null==s){if(U.current=!1,null!=m)return;if(j.current&&(B.current=-1,ee(l,B)),!j.current&&H.current&&(null!=_.current||!0===H.current&&null==_.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else B.current=null==_.current||ct(_.current,P,R)||E?it(l,z.current):lt(l,z.current),_.current=null,K(B.current)};t()}}else nt(l,s)||(B.current=s,ee(l,B,V.current),V.current=!1)}),[d,n,i,s,m,E,l,P,R,K,ee,z]),N((()=>{if(d&&j.current&&!i&&F){var e,t;const n=F.nodesRef.current,r=null==(e=n.find((e=>e.id===D)))||null==(t=e.context)?void 0:t.elements.floating,o=b(p(i)),u=n.some((e=>e.context&&y(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[d,i,F,D]),N((()=>{q.current=K,j.current=!!i})),N((()=>{n||(_.current=null)}),[n]);const te=null!=s,ne=u.useMemo((()=>{function e(e){if(!n)return;const t=l.current.indexOf(e);-1!==t&&K(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...I&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;W.current&&"touch"!==t&&(B.current=-1,ee(l,B),K(null),x||ue(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ee,I,l,K,x]);return u.useMemo((()=>{if(!d)return{};const e=z.current;function t(t){if(W.current=!1,U.current=!0,!Z.current&&t.currentTarget===o.floating.current)return;if(E&&function(e,t,n){return ot(t,n?e===et:e===$e,e===Qe)}(t.key,P,R))return w(t),r(!1,t.nativeEvent),void(a(c)&&c.focus());const u=B.current,i=it(l,e),s=lt(l,e);if("Home"===t.key&&(w(t),B.current=i,K(B.current)),"End"===t.key&&(w(t),B.current=s,K(B.current)),S>1){const n=B.current;if(t.key===Qe){if(w(t),-1===n)B.current=s;else if(B.current=rt(l,{startingIndex:n,amount:S,decrement:!0,disabledIndices:e}),g&&(n-S<i||B.current<0)){const e=n%S,t=s%S,r=s-(t-e);B.current=t===e?s:t>e?r:r-S}nt(l,B.current)&&(B.current=n),K(B.current)}if(t.key===Je&&(w(t),-1===n?B.current=i:(B.current=rt(l,{startingIndex:n,amount:S,disabledIndices:e}),g&&n+S>s&&(B.current=rt(l,{startingIndex:n%S-S,amount:S,disabledIndices:e}))),nt(l,B.current)&&(B.current=n),K(B.current)),"both"===P){const r=Math.floor(n/S);t.key===et&&(w(t),n%S!=S-1?(B.current=rt(l,{startingIndex:n,disabledIndices:e}),g&&tt(B.current,S,r)&&(B.current=rt(l,{startingIndex:n-n%S-1,disabledIndices:e}))):g&&(B.current=rt(l,{startingIndex:n-n%S-1,disabledIndices:e})),tt(B.current,S,r)&&(B.current=n)),t.key===$e&&(w(t),n%S!=0?(B.current=rt(l,{startingIndex:n,disabledIndices:e,decrement:!0}),g&&tt(B.current,S,r)&&(B.current=rt(l,{startingIndex:n+(S-n%S),decrement:!0,disabledIndices:e}))):g&&(B.current=rt(l,{startingIndex:n+(S-n%S),decrement:!0,disabledIndices:e})),tt(B.current,S,r)&&(B.current=n));const o=Math.floor(s/S)===r;return nt(l,B.current)&&(B.current=g&&o?t.key===$e?s:rt(l,{startingIndex:n-n%S-1,disabledIndices:e}):n),void K(B.current)}}if(ut(t.key,P)){if(w(t),n&&!x&&b(t.currentTarget.ownerDocument)===t.currentTarget)return B.current=ct(t.key,P,R)?i:s,void K(B.current);ct(t.key,P,R)?B.current=g?u>=s?v&&u!==l.current.length?-1:i:rt(l,{startingIndex:u,disabledIndices:e}):Math.min(s,rt(l,{startingIndex:u,disabledIndices:e})):B.current=g?u<=i?v&&-1!==u?l.current.length:s:rt(l,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(i,rt(l,{startingIndex:u,decrement:!0,disabledIndices:e})),nt(l,B.current)?K(null):K(B.current)}}function u(e){"auto"===k&&C(e.nativeEvent)&&(H.current=!0)}const i=x&&n&&te&&{"aria-activedescendant":J};return{reference:{...i,onKeyDown(o){W.current=!1;const u=0===o.key.indexOf("Arrow");if(x&&n)return t(o);if(!n&&!M&&u)return;const c=u||"Enter"===o.key||""===o.key.trim(),i=ut(o.key,P),s=function(e,t,n){return ot(t,n?e===$e:e===et,e===Je)}(o.key,P,R);c&&(_.current=E&&i?null:o.key),E?s&&(w(o),n?(B.current=it(l,e),K(B.current)):r(!0,o.nativeEvent)):i&&(null!=m&&(B.current=m),w(o),!n&&M?r(!0,o.nativeEvent):t(o),n&&K(B.current))},onFocus(){n&&K(null)},onPointerDown:function(e){H.current=k,"auto"===k&&T(e.nativeEvent)&&(H.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===P?void 0:P,...i,onKeyDown:t,onPointerMove(){W.current=!0}},item:ne}}),[c,o,J,z,Z,l,d,P,R,x,n,te,E,m,M,v,S,g,k,K,r,ne])}function at(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}function ft(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:c="dialog"}=t,i=B();return u.useMemo((()=>{const e={id:r,role:c};return o?"tooltip"===c?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":n?r:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:i}},floating:{...e,..."menu"===c&&{"aria-labelledby":i}}}:{}}),[o,c,n,r,i])}const dt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function mt(e,t){return"function"==typeof e?e(t):e}function vt(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,c=("number"==typeof o?o:o.close)||0,[i,l]=u.useState(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,c);return N((()=>{i&&!f&&a("unmounted")}),[i,f]),N((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function pt(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:c,duration:i=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof i,d=(f?i:i.open)||0,m=(f?i:i.close)||0,[v,p]=u.useState((()=>({...mt(c,a),...mt(n,a)}))),{isMounted:g,status:y}=vt(e,{duration:i}),b=G(n),h=G(r),E=G(o),w=G(c);return N((()=>{const e=mt(b.current,a),t=mt(E.current,a),n=mt(w.current,a),r=mt(h.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&p({transitionProperty:Object.keys(r).map(dt).join(","),transitionDuration:d+"ms",...n,...r}),"close"===y){const r=t||e;p({transitionProperty:Object.keys(r).map(dt).join(","),transitionDuration:m+"ms",...n,...r})}}),[m,E,b,h,w,d,y,a]),{isMounted:g,styles:v}}function gt(e,t){var n;const{open:r,dataRef:o}=e,{listRef:c,activeIndex:i,onMatch:l,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:v=null}=t,p=u.useRef(),g=u.useRef(""),y=u.useRef(null!=(n=null!=v?v:i)?n:-1),b=u.useRef(null),h=_e(l),E=_e(s),R=G(f),x=G(m);return N((()=>{r&&(clearTimeout(p.current),b.current=null,g.current="")}),[r]),N((()=>{var e;r&&""===g.current&&(y.current=null!=(e=null!=v?v:i)?e:-1)}),[r,v,i]),u.useMemo((()=>{if(!a)return{};function e(e){e?o.current.typing||(o.current.typing=e,E(e)):o.current.typing&&(o.current.typing=e,E(e))}function t(e,t,n){const r=R.current?R.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=c.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(o,o,g.current)?e(!1):" "===n.key&&w(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(w(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&g.current===n.key&&(g.current="",y.current=b.current),g.current+=n.key,clearTimeout(p.current),p.current=setTimeout((()=>{g.current="",y.current=b.current,e(!1)}),d);const u=y.current,i=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],g.current);-1!==i?(h(i),b.current=i):" "!==n.key&&(g.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[a,r,o,c,d,x,R,h,E])}function yt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const bt=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:u,onFallbackChange:c,offset:i=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:v}}=t,p=n.current[l];if(!p)return{};const g={...t,...await r(-p.offsetTop-v.clientTop-m.reference.height/2-p.offsetHeight/2-i).fn(t)},y=(null==f?void 0:f.current)||v,b=await o(yt(g,y.scrollHeight),d),h=await o(g,{...d,elementContext:"reference"}),E=Math.max(0,b.top),w=g.y+E,R=Math.max(0,y.scrollHeight-E-Math.max(0,b.bottom));return y.style.maxHeight=R+"px",y.scrollTop=E,c&&(y.offsetHeight<p.offsetHeight*Math.min(s,n.current.length-1)-1||h.top>=-a||h.bottom>=-a?A((()=>c(!0))):A((()=>c(!1)))),u&&(u.current=await o(yt({...g,y:w},y.offsetHeight),d)),{y:w}}});function ht(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:c,scrollRef:i,onChange:l}=t,s=_e(l),a=u.useRef(!1),f=u.useRef(null),d=u.useRef(null);return u.useEffect((()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,r=c.current.top>=-.5,o=c.current.bottom>=-.5,u=t.scrollHeight-t.clientHeight,i=n<0?-1:1,l=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),A((()=>{s((e=>e+Math[l](n,u*i)))}))):/firefox/i.test(L())&&(t.scrollTop+=n))}const t=(null==i?void 0:i.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=c.current&&(d.current={...c.current})})),()=>{f.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0}),[o,n,r.floating,c,i,s]),u.useMemo((()=>o?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=(null==i?void 0:i.current)||r.floating;if(c.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&A((()=>s((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}),[o,c,r.floating,i,s])}function Et(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,c=u-1;e<u;c=e++){const[u,i]=t[e]||[0,0],[l,s]=t[c]||[0,0];i>=r!=s>=r&&n<=(l-u)*(r-i)/(s-i)+u&&(o=!o)}return o}function wt(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,c=null,i=null,l=performance.now();const a=e=>{let{x:n,y:a,placement:f,elements:d,onClose:m,nodeId:v,tree:p}=e;return function(e){function g(){clearTimeout(o),m()}if(clearTimeout(o),!d.domReference||!d.floating||null==f||null==n||null==a)return;const{clientX:b,clientY:h}=e,E=[b,h],w=R(e),x="mouseleave"===e.type,k=y(d.floating,w),I=y(d.domReference,w),M=d.domReference.getBoundingClientRect(),C=d.floating.getBoundingClientRect(),T=f.split("-")[0],O=n>C.right-C.width/2,L=a>C.bottom-C.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(E,M),S=C.width>M.width,A=C.height>M.height,D=(S?M:C).left,N=(S?M:C).right,F=(A?M:C).top,K=(A?M:C).bottom;if(k&&(u=!0,!x))return;if(I&&(u=!1),I&&!x)return void(u=!0);if(x&&s(e.relatedTarget)&&y(d.floating,e.relatedTarget))return;if(p&&ce(p.nodesRef.current,v).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===T&&a>=M.bottom-1||"bottom"===T&&a<=M.top+1||"left"===T&&n>=M.right-1||"right"===T&&n<=M.left+1)return g();let H=[];switch(T){case"top":H=[[D,M.top+1],[D,C.bottom-1],[N,C.bottom-1],[N,M.top+1]];break;case"bottom":H=[[D,C.top+1],[D,M.bottom-1],[N,M.bottom-1],[N,C.top+1]];break;case"left":H=[[C.right-1,K],[C.right-1,F],[M.left+1,F],[M.left+1,K]];break;case"right":H=[[M.right-1,K],[M.right-1,F],[C.left+1,F],[C.left+1,K]]}if(!Et([b,h],H)){if(u&&!P)return g();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===c||null===i||0===r)return c=e,i=t,l=n,null;const o=e-c,u=t-i,s=Math.sqrt(o*o+u*u);return c=e,i=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return g()}Et([b,h],function(e){let[n,r]=e;switch(T){case"top":return[[S?n+t/2:O?n+4*t:n-4*t,r+t+1],[S?n-t/2:O?n+4*t:n-4*t,r+t+1],...[[C.left,O||S?C.bottom-t:C.top],[C.right,O?S?C.bottom-t:C.top:C.bottom-t]]];case"bottom":return[[S?n+t/2:O?n+4*t:n-4*t,r-t],[S?n-t/2:O?n+4*t:n-4*t,r-t],...[[C.left,O||S?C.top+t:C.bottom],[C.right,O?S?C.top+t:C.bottom:C.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:L?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:L?r+4*t:r-4*t];return[...[[L||A?C.right-t:C.left,C.top],[L?A?C.right-t:C.left:C.right-t,C.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:L?r+4*t:r-4*t],[n-t,A?r-t/2:L?r+4*t:r-4*t],...[[L||A?C.left+t:C.right,C.top],[L?A?C.left+t:C.right:C.left+t,C.bottom]]]}}([n,a]))?!u&&r&&(o=window.setTimeout(g,40)):g()}}};return a.__options={blockPointerEvents:n},a}export{_ as FloatingArrow,ne as FloatingDelayGroup,Oe as FloatingFocusManager,Se as FloatingList,V as FloatingNode,Ne as FloatingOverlay,Me as FloatingPortal,z as FloatingTree,bt as inner,wt as safePolygon,He as useClick,qe as useClientPoint,re as useDelayGroup,te as useDelayGroupContext,Ye as useDismiss,Ue as useFloating,U as useFloatingNodeId,X as useFloatingParentNodeId,Ie as useFloatingPortalNode,Y as useFloatingTree,Ve as useFocus,$ as useHover,B as useId,ht as useInnerOffset,Ze as useInteractions,Ae as useListItem,st as useListNavigation,at as useMergeRefs,ft as useRole,vt as useTransitionStatus,pt as useTransitionStyles,gt as useTypeahead}; |
@@ -1,1 +0,6 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/react-dom"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/react-dom","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.FloatingUIReactDOM,e.React,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(n);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var c="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;let l=!1,s=0;const a=()=>"floating-ui-"+s++;const f=u["useId".toString()]||function(){const[e,t]=u.useState((()=>l?a():void 0));return c((()=>{null==e&&t(a())}),[]),u.useEffect((()=>{l||(l=!0)}),[]),e},d=u.forwardRef((function(e,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:c}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:d=0,staticOffset:m,stroke:p,d:v,style:{transform:g,...h}={},...y}=e;const b=f();if(!o)return null;d*=2;const E=d/2,w=l/2*(a/-8+1),R=s/2*a/4,[x,I]=r.split("-"),O=t.platform.isRTL(o),k=!!v,T="top"===x||"bottom"===x,M=m&&"end"===I?"bottom":"top";let C=m&&"end"===I?"right":"left";m&&O&&(C="end"===I?"left":"right");const P=null!=(null==c?void 0:c.x)?m||c.x:"",S=null!=(null==c?void 0:c.y)?m||c.y:"",A=v||"M0,0 H"+l+" L"+(l-w)+","+(s-R)+" Q"+l/2+","+s+" "+w+","+(s-R)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",i({},y,{"aria-hidden":!0,ref:n,width:k?l:l+d,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[C]:P,[M]:S,[x]:T||k?"100%":"calc(100% - "+d/2+"px)",transform:""+L+(null!=g?g:""),...h}}),d>0&&u.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:p,strokeWidth:d+(v?0:1),d:A}),u.createElement("path",{stroke:d&&!v?y.fill:"none",d:A}),u.createElement("clipPath",{id:b},u.createElement("rect",{x:-E,y:E*(k?-1:1),width:l+d,height:l})))}));function m(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function p(e){return e instanceof Element||e instanceof m(e).Element}function v(e){return e instanceof HTMLElement||e instanceof m(e).HTMLElement}function g(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}function h(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof ShadowRoot||r instanceof m(r).ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function y(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function b(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function E(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(y())||t.test(b()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function w(e){return 0===e.width&&0===e.height||1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"!==e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail}function R(){return/apple/i.test(navigator.vendor)}function x(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function I(e){return(null==e?void 0:e.ownerDocument)||document}function O(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function k(e){return"composedPath"in e?e.composedPath()[0]:e.target}const T="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function M(e){return v(e)&&e.matches(T)}function C(e){e.preventDefault(),e.stopPropagation()}function P(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const S=u.createContext(null),A=u.createContext(null),L=()=>{var e;return(null==(e=u.useContext(S))?void 0:e.id)||null},D=()=>u.useContext(A);function N(e){return"data-floating-ui-"+e}function F(e){const t=n.useRef(e);return c((()=>{t.current=e})),t}const j=N("safe-polygon");function K(e,t,n){return n&&!x(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const H=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),B=()=>u.useContext(H);var q=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},_=new WeakMap,W=new WeakMap,U={},z=0,V=function(e){return e&&(e.host||V(e.parentNode))},X=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=V(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);U[n]||(U[n]=new WeakMap);var u=U[n],i=[],c=new Set,l=new Set(o),s=function(e){e&&!c.has(e)&&(c.add(e),s(e.parentNode))};o.forEach(s);var a=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(c.has(e))a(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(_.get(e)||0)+1,s=(u.get(e)||0)+1;_.set(e,l),u.set(e,s),i.push(e),1===l&&o&&W.set(e,!0),1===s&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return a(t),c.clear(),z++,function(){i.forEach((function(e){var t=_.get(e)-1,o=u.get(e)-1;_.set(e,t),u.set(e,o),t||(W.has(e)||e.removeAttribute(r),W.delete(e)),o||e.removeAttribute(n)})),--z||(_=new WeakMap,_=new WeakMap,W=new WeakMap,U={})}},Y=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||q(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),X(r,o,n,"aria-hidden")):function(){return null}},G=function(e,t,n){void 0===n&&(n="data-inert-ed");var r=t||q(e);return r?X(e,r,n,"inert"):function(){return null}},Z=function(){return"undefined"!=typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},$=function(e,t,n){return void 0===n&&(n="data-suppressed"),(Z()?G:Y)(e,t,n)},Q=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"].join(","),J="undefined"==typeof Element,ee=J?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,te=!J&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},ne=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if("SLOT"===i.tagName){var c=i.assignedElements(),l=e(c.length?c:i.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{ee.call(i,Q)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!r.shadowRootFilter||r.shadowRootFilter(i);if(s&&a){var f=e(!0===s?i.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else u.unshift.apply(u,i.children)}}return o},re=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},oe=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ue=function(e){return"INPUT"===e.tagName},ie=function(e){return function(e){return ue(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||te(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},ce=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},le=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ee.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ee.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ce(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=te(e);if(i&&!i.shadowRoot&&!0===r(i))return ce(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){for(var t,n=te(e).host,r=!!(null!==(t=n)&&void 0!==t&&t.ownerDocument.contains(n)||e.ownerDocument.contains(e));!r&&n;){var o;r=!(null===(o=n=te(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},se=function(e,t){return!(t.disabled||function(e){return ue(e)&&"hidden"===e.type}(t)||le(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!ee.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ae=function(e,t){return!(ie(t)||re(t)<0||!se(e,t))},fe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},de=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=re(i,u),l=u?e(t.candidates):i;0===c?u?n.push.apply(n,l):n.push(i):r.push({documentOrder:o,tabIndex:c,item:t,isScope:u,content:l})})),r.sort(oe).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},me=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ne([e],t.includeContainer,{filter:ae.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:fe}):function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(Q));return t&&ee.call(e,Q)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,ae.bind(null,t)),de(n)};let pe=0;function ve(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(pe);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():pe=requestAnimationFrame(u)}function ge(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}const he=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ye(e,t){const n=me(e,he());"prev"===t&&n.reverse();const r=n.indexOf(g(I(e)));return n.slice(r+1)[0]}function be(){return ye(document.body,"next")}function Ee(){return ye(document.body,"prev")}function we(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!h(n,r)}function Re(e){me(e,he()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function xe(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Ie={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Oe(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const ke=u.forwardRef((function(e,t){const[n,r]=u.useState();c((()=>(R()&&r("button"),document.addEventListener("keydown",Oe),()=>{document.removeEventListener("keydown",Oe)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[N("focus-guard")]:"",style:Ie};return u.createElement("span",i({},e,o))})),Te=u.createContext(null);function Me(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=f(),l=Ce(),s=u.useMemo((()=>({id:t,root:n,portalContext:l,uniqueId:i})),[t,n,l,i]),a=u.useRef();return c((()=>()=>{null==r||r.remove()}),[r,s]),c((()=>{if(a.current===s)return;a.current=s;const{id:e,root:t,portalContext:n,uniqueId:r}=s,u=e?document.getElementById(e):null,i=N("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!p(u)&&(u=u.current),u=u||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,u.appendChild(c));const l=document.createElement("div");l.id=r,l.setAttribute(i,""),u=c||u,u.appendChild(l),o(l)}}),[s]),r}const Ce=()=>u.useContext(Te),Pe=u.forwardRef((function(e,t){return u.createElement("button",i({},e,{type:"button",ref:t,tabIndex:-1,style:Ie}))}));function Se(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Ae=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});const Le=N("scroll-lock"),De=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return c((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Le))return;document.body.setAttribute(Le,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(y()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Le),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,i=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,c=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(i))+"px",left:-(c-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(Le),window.scrollTo(c,l)}}),[n]),u.createElement("div",i({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Ne(e){return v(e.target)&&"BUTTON"===e.target.tagName}function Fe(e){return M(e)}const je=u["useInsertionEffect".toString()]||(e=>e());function Ke(e){const t=u.useRef((()=>{}));return je((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function He(e){return null!=e&&null!=e.clientX}const Be={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qe={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function _e(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}let We=!1;const Ue="ArrowUp",ze="ArrowDown",Ve="ArrowLeft",Xe="ArrowRight";function Ye(e,t,n){return Math.floor(e/t)!==n}function Ge(e,t){return t<0||t>=e.current.length}function Ze(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current;let c=n;do{var l,s;c+=r?-u:u}while(c>=0&&c<=i.length-1&&(o?o.includes(c):null==i[c]||(null==(l=i[c])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=i[c])?void 0:s.getAttribute("aria-disabled"))));return c}function $e(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Qe(e,t){return $e(t,e===Ue||e===ze,e===Ve||e===Xe)}function Je(e,t,n){return $e(t,e===ze,n?e===Ve:e===Xe)||"Enter"===e||" "==e||""===e}function et(e,t){return Ze(e,{disabledIndices:t})}function tt(e,t){return Ze(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const nt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function rt(e,t){return"function"==typeof e?e(t):e}function ot(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[l,s]=u.useState(!1),[a,f]=u.useState("unmounted"),d=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return c((()=>{l&&!d&&f("unmounted")}),[l,d]),c((()=>{if(r){if(n){f("initial");const e=requestAnimationFrame((()=>{f("open")}));return()=>{cancelAnimationFrame(e)}}s(!0),f("close")}}),[n,r]),{isMounted:d,status:a}}function ut(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function it(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,i=u-1;e<u;i=e++){const[u,c]=t[e]||[0,0],[l,s]=t[i]||[0,0];c>=r!=s>=r&&n<=(l-u)*(r-c)/(s-c)+u&&(o=!o)}return o}Object.defineProperty(e,"arrow",{enumerable:!0,get:function(){return t.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return t.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return t.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return t.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return t.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return t.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return t.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return t.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return t.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return t.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return t.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return t.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return t.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return t.size}}),e.FloatingArrow=d,e.FloatingDelayGroup=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=u.useRef(null),s=u.useCallback((e=>{i({currentId:e})}),[]);return c((()=>{o.currentId?null===l.current?l.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),l.current=null)}),[o.currentId]),u.createElement(H.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:s})),[o,i,s])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:l=0,returnFocus:s=!0,modal:a=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0}=e,{open:m,refs:p,nodeId:y,onOpenChange:b,events:E,dataRef:w,elements:{domReference:R,floating:x}}=t,O=!Z()||i,T=F(o),P=F(l),S=F(s),A=D(),L=Ce(),j="number"==typeof l&&l<0,K=u.useRef(null),H=u.useRef(null),B=u.useRef(!1),q=u.useRef(null),_=u.useRef(!1),W=null!=L,U=R&&"combobox"===R.getAttribute("role")&&M(R),z=u.useCallback((function(e){return void 0===e&&(e=x),e?me(e,he()):[]}),[x]),V=u.useCallback((e=>{const t=z(e);return T.current.map((e=>R&&"reference"===e?R:x&&"floating"===e?x:t)).filter(Boolean).flat()}),[R,x,T,z]);function X(e){return!r&&f&&a?u.createElement(Pe,{ref:"start"===e?K:H,onClick:e=>b(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}u.useEffect((()=>{if(r||!a)return;function e(e){if("Tab"===e.key){h(x,g(I(x)))&&0===z().length&&!U&&C(e);const t=V(),n=k(e);"reference"===T.current[0]&&n===R&&(C(e),e.shiftKey?ve(t[t.length-1]):ve(t[1])),"floating"===T.current[1]&&n===x&&e.shiftKey&&(C(e),ve(t[0]))}}const t=I(x);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,R,x,a,T,p,U,z,V]),u.useEffect((()=>{if(!r&&d)return x&&v(R)?(R.addEventListener("focusout",t),R.addEventListener("pointerdown",e),!a&&x.addEventListener("focusout",t),()=>{R.removeEventListener("focusout",t),R.removeEventListener("pointerdown",e),!a&&x.removeEventListener("focusout",t)}):void 0;function e(){_.current=!0,setTimeout((()=>{_.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(h(R,t)||h(x,t)||h(t,x)||h(null==L?void 0:L.portalNode,t)||null!=t&&t.hasAttribute(N("focus-guard"))||A&&(ge(A.nodesRef.current,y).find((e=>{var n,r;return h(null==(n=e.context)?void 0:n.elements.floating,t)||h(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(A.nodesRef.current,y).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!_.current&&t!==q.current&&(B.current=!0,b(!1,e))}))}}),[r,R,x,a,y,A,L,b,d]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==L||null==(e=L.portalNode)?void 0:e.querySelectorAll("["+N("portal")+"]"))||[]);if(x&&a){const e=[x,...t,K.current,H.current].filter((e=>null!=e)),n=(O?Y:$)(T.current.includes("reference")||U?e.concat(R||[]):e,void 0,N("inert"));return()=>{n()}}}),[r,R,x,a,T,L,U,O]),c((()=>{if(r||!x)return;const e=g(I(x));queueMicrotask((()=>{const t=V(x),n=P.current,r=("number"==typeof n?t[n]:n.current)||x,o=h(x,e);j||o||!m||ve(r,{preventScroll:r===x})}))}),[r,m,x,j,V,P]),c((()=>{if(r||!x)return;let e=!1;const t=I(x),n=g(t),o=w.current;function u(t){if("escapeKey"===t.type&&p.domReference.current&&(q.current=p.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(B.current=!1,e=n.preventScroll):B.current=!n}return q.current=n,E.on("dismiss",u),()=>{E.off("dismiss",u);const n=g(t);(h(x,n)||A&&ge(A.nodesRef.current,y).some((e=>{var t;return h(null==(t=e.context)?void 0:t.elements.floating,n)}))||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&p.domReference.current&&(q.current=p.domReference.current),S.current&&v(q.current)&&!B.current&&ve(q.current,{cancelPrevious:!1,preventScroll:e})}}),[r,x,S,w,p,E,A,y]),c((()=>{if(!r&&L)return L.setFocusManagerState({...t,modal:a,closeOnFocusOut:d,open:m}),()=>{L.setFocusManagerState(null)}}),[r,L,a,m,d,t]),c((()=>{if(!r&&x&&"function"==typeof MutationObserver){const e=()=>{const e=x.getAttribute("tabindex");T.current.includes("floating")||g(I(x))!==p.domReference.current&&0===z().length?"0"!==e&&x.setAttribute("tabindex","0"):"-1"!==e&&x.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(x,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[r,x,p,T,z]);const G=!r&&O&&!U&&(W||a);return u.createElement(u.Fragment,null,G&&u.createElement(ke,{"data-type":"inside",ref:null==L?void 0:L.beforeInsideRef,onFocus:e=>{if(a){const e=V();ve("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=L&&L.preserveTabOrder&&L.portalNode)if(B.current=!1,we(e,L.portalNode)){const e=be()||R;null==e||e.focus()}else{var t;null==(t=L.beforeOutsideRef.current)||t.focus()}}}),!U&&X("start"),n,X("end"),G&&u.createElement(ke,{"data-type":"inside",ref:null==L?void 0:L.afterInsideRef,onFocus:e=>{if(a)ve(V()[0]);else if(null!=L&&L.preserveTabOrder&&L.portalNode)if(d&&(B.current=!0),we(e,L.portalNode)){const e=Ee()||R;null==e||e.focus()}else{var t;null==(t=L.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=function(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),l=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),s=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return c((()=>{const e=new Map(o);Array.from(e.keys()).sort(Se).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||i(e)}),[o]),u.createElement(Ae.Provider,{value:u.useMemo((()=>({register:l,unregister:s,map:o,elementsRef:n,labelsRef:r})),[l,s,o,n,r])},t)},e.FloatingNode=function(e){let{children:t,id:n}=e;const r=L();return u.createElement(S.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=De,e.FloatingPortal=function(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const c=Me({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=u.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&we(e)){("focusin"===e.type?xe:Re)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(Te.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:c,setFocusManagerState:s})),[i,c])},p&&c&&u.createElement(ke,{"data-type":"outside",ref:a,onFocus:e=>{if(we(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=Ee()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&c&&u.createElement("span",{"aria-owns":c.id,style:Ie}),c&&r.createPortal(t,c),p&&c&&u.createElement(ke,{"data-type":"outside",ref:f,onFocus:e=>{if(we(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=be()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>P()))[0];return u.createElement(A.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[n,r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(n){const{listRef:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:p}}=n,v=o.current[l];if(!v)return{};const g={...n,...await t.offset(-v.offsetTop-p.clientTop-m.reference.height/2-v.offsetHeight/2-c).fn(n)},h=(null==f?void 0:f.current)||p,y=await t.detectOverflow(ut(g,h.scrollHeight),d),b=await t.detectOverflow(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),w=g.y+E,R=Math.max(0,h.scrollHeight-E-Math.max(0,y.bottom));return h.style.maxHeight=R+"px",h.scrollTop=E,i&&(h.offsetHeight<v.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await t.detectOverflow(ut({...g,y:w},h.offsetHeight),d)),{y:w}}}),e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:v}=e;return function(e){function g(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:y,clientY:b}=e,E=[y,b],w=k(e),R="mouseleave"===e.type,x=h(f.floating,w),I=h(f.domReference,w),O=f.domReference.getBoundingClientRect(),T=f.floating.getBoundingClientRect(),M=a.split("-")[0],C=n>T.right-T.width/2,P=s>T.bottom-T.height/2,S=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(E,O),A=T.width>O.width,L=T.height>O.height,D=(A?O:T).left,N=(A?O:T).right,F=(L?O:T).top,j=(L?O:T).bottom;if(x&&(u=!0,!R))return;if(I&&(u=!1),I&&!R)return void(u=!0);if(R&&p(e.relatedTarget)&&h(f.floating,e.relatedTarget))return;if(v&&ge(v.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===M&&s>=O.bottom-1||"bottom"===M&&s<=O.top+1||"left"===M&&n>=O.right-1||"right"===M&&n<=O.left+1)return g();let K=[];switch(M){case"top":K=[[D,O.top+1],[D,T.bottom-1],[N,T.bottom-1],[N,O.top+1]];break;case"bottom":K=[[D,T.top+1],[D,O.bottom-1],[N,O.bottom-1],[N,T.top+1]];break;case"left":K=[[T.right-1,j],[T.right-1,F],[O.left+1,F],[O.left+1,j]];break;case"right":K=[[O.right-1,j],[O.right-1,F],[T.left+1,F],[T.left+1,j]]}if(!it([y,b],K)){if(u&&!S)return g();if(!R&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===c||0===r)return i=e,c=t,l=n,null;const o=e-i,u=t-c,s=Math.sqrt(o*o+u*u);return i=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return g()}it([y,b],function(e){let[n,r]=e;switch(M){case"top":return[[A?n+t/2:C?n+4*t:n-4*t,r+t+1],[A?n-t/2:C?n+4*t:n-4*t,r+t+1],...[[T.left,C||A?T.bottom-t:T.top],[T.right,C?A?T.bottom-t:T.top:T.bottom-t]]];case"bottom":return[[A?n+t/2:C?n+4*t:n-4*t,r-t],[A?n-t/2:C?n+4*t:n-4*t,r-t],...[[T.left,C||A?T.top+t:T.bottom],[T.right,C?A?T.top+t:T.bottom:T.top+t]]];case"left":{const e=[n+t+1,L?r+t/2:P?r+4*t:r-4*t],o=[n+t+1,L?r-t/2:P?r+4*t:r-4*t];return[...[[P||L?T.right-t:T.left,T.top],[P?L?T.right-t:T.left:T.right-t,T.bottom]],e,o]}case"right":return[[n-t,L?r+t/2:P?r+4*t:r-4*t],[n-t,L?r-t/2:P?r+4*t:r-4*t],...[[P||L?T.left+t:T.right,T.top],[P?L?T.left+t:T.right:T.left+t,T.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(g,40)):g()}}};return s.__options={blockPointerEvents:n},s},e.useClick=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),m=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(x(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent)):r(!1,e.nativeEvent)))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:x(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent):r(!1,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Ne(e)||(" "!==e.key||Fe(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||Ne(e)||Fe(i)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,e.nativeEvent))}}}:{}),[c,o,l,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:l=!0,axis:s="both",x:a=null,y:f=null}=t,d=u.useRef(!1),p=u.useRef(null),[v,g]=u.useState(),[y,b]=u.useState([]),E=Ke(((e,t)=>{d.current||o.current.openEvent&&!He(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,m=c.x,p=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),m-=n||0,p-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,m=l&&null!=t.x?t.x:m,p=s&&null!=t.y?t.y:p):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:m,y:p,top:p,right:m+f,bottom:p+d,left:m}}}}(r.domReference,{x:e,y:t,axis:s,dataRef:o,pointerType:v}))})),w=Ke((e=>{null==a&&null==f&&(n?p.current||b([]):E(e.clientX,e.clientY))})),R=x(v)?i:n,I=u.useCallback((()=>{if(!R||!l||null!=a||null!=f)return;const e=m(r.floating.current);function t(n){const o=k(n);h(r.floating.current,o)?(e.removeEventListener("mousemove",t),p.current=null):E(n.clientX,n.clientY)}if(!o.current.openEvent||He(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),p.current=null};return p.current=n,n}r.setPositionReference(r.domReference.current)}),[o,l,R,r,E,a,f]);return u.useEffect((()=>I()),[I,y]),u.useEffect((()=>{l&&!i&&(d.current=!1)}),[l,i]),u.useEffect((()=>{!l&&n&&(d.current=!0)}),[l,n]),c((()=>{!l||null==a&&null==f||(d.current=!1,E(a,f))}),[l,a,f,E]),u.useMemo((()=>{if(!l)return{};function e(e){let{pointerType:t}=e;g(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:w,onMouseEnter:w}}}),[l,w])},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:l,setState:s,timeoutMs:a}=B();c((()=>{u&&(s({delay:{open:1,close:K(l,"close")}}),u!==o&&r(!1))}),[o,r,s,u,l]),c((()=>{function e(){r(!1),s({delay:l,currentId:null})}if(!n&&u===o){if(a){const t=window.setTimeout(e,a);return()=>{clearTimeout(t)}}e()}}),[n,s,u,o,r,l,a]),c((()=>{n&&i(o)}),[n,i,o])},e.useDelayGroupContext=B,e.useDismiss=function(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:c,elements:{reference:l,domReference:s,floating:a},dataRef:f}=e,{enabled:d=!0,escapeKey:g=!0,outsidePress:h=!0,outsidePressEvent:y="pointerdown",referencePress:b=!1,referencePressEvent:R="pointerdown",ancestorScroll:x=!1,bubbles:T}=n,M=D(),C=null!=L(),P=Ke("function"==typeof h?h:()=>!1),S="function"==typeof h?P:h,A=u.useRef(!1),{escapeKeyBubbles:N,outsidePressBubbles:F}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(T),j=Ke((e=>{if(!r||!d||!g||"Escape"!==e.key)return;const t=M?ge(M.nodesRef.current,c):[];if(!N&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),K=Ke((e=>{const t=A.current;if(A.current=!1,t)return;if("function"==typeof S&&!S(e))return;const n=k(e);if(v(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,o=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let u=o&&e.offsetX>n.clientWidth;if(o){"rtl"===(r=n,m(r).getComputedStyle(r)).direction&&(u=e.offsetX<=n.offsetWidth-n.clientWidth)}if(u||t&&e.offsetY>n.clientHeight)return}var r;const u=M&&ge(M.nodesRef.current,c).some((t=>{var n;return O(e,null==(n=t.context)?void 0:n.elements.floating)}));if(O(e,a)||O(e,s)||u)return;const l=M?ge(M.nodesRef.current,c):[];if(l.length>0){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:C?{preventScroll:!0}:E(e)||w(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=N,f.current.__outsidePressBubbles=F;const n=I(a);g&&n.addEventListener("keydown",j),S&&n.addEventListener(y,K);let u=[];return x&&(p(s)&&(u=t.getOverflowAncestors(s)),p(a)&&(u=u.concat(t.getOverflowAncestors(a))),!p(l)&&l&&l.contextElement&&(u=u.concat(t.getOverflowAncestors(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{g&&n.removeEventListener("keydown",j),S&&n.removeEventListener(y,K),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,g,S,y,r,o,x,d,N,F,j,K]),u.useEffect((()=>{A.current=!1}),[S,y]),u.useMemo((()=>d?{reference:{onKeyDown:j,[Be[R]]:e=>{b&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:j,[qe[y]]:()=>{A.current=!0}}}:{}),[d,i,b,y,R,o,j])},e.useFloating=function(e){var n;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[l,s]=u.useState(null),a=(null==(n=e.elements)?void 0:n.reference)||l,d=t.useFloating(e),m=D(),v=Ke(((e,t)=>{e&&(h.current.openEvent=t),null==o||o(e,t)})),g=u.useRef(null),h=u.useRef({}),y=u.useState((()=>P()))[0],b=f(),E=u.useCallback((e=>{const t=p(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;d.refs.setReference(t)}),[d.refs]),w=u.useCallback((e=>{(p(e)||null===e)&&(g.current=e,s(e)),(p(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!p(e))&&d.refs.setReference(e)}),[d.refs]),R=u.useMemo((()=>({...d.refs,setReference:w,setPositionReference:E,domReference:g})),[d.refs,w,E]),x=u.useMemo((()=>({...d.elements,domReference:a})),[d.elements,a]),I=u.useMemo((()=>({...d,refs:R,elements:x,dataRef:h,nodeId:i,floatingId:b,events:y,open:r,onOpenChange:v})),[d,i,b,y,r,v,R,x]);return c((()=>{const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===i));e&&(e.context=I)})),u.useMemo((()=>({...d,context:I,refs:R,elements:x})),[d,R,x,I])},e.useFloatingNodeId=function(e){const t=f(),n=D(),r=L(),o=e||r;return c((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=L,e.useFloatingPortalNode=Me,e.useFloatingTree=D,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:c,elements:{floating:l,domReference:s}}=e,{enabled:a=!0,keyboardOnly:f=!0}=t,d=u.useRef(""),m=u.useRef(!1),y=u.useRef();return u.useEffect((()=>{if(!a)return;const e=I(l).defaultView||window;function t(){!n&&v(s)&&s===g(I(s))&&(m.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,s,n,a]),u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(m.current=!0)}}),[i,a]),u.useEffect((()=>()=>{clearTimeout(y.current)}),[]),u.useMemo((()=>a?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,m.current=!(!t||!f)},onMouseLeave(){m.current=!1},onFocus(e){var t;m.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&O(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=p(t)&&t.hasAttribute(N("focus-guard"))&&"outside"===t.getAttribute("data-type");y.current=setTimeout((()=>{h(c.floating.current,t)||h(s,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[a,f,s,c,o,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:l,floating:s},refs:a}=e,{enabled:f=!0,delay:d=0,handleClose:m=null,mouseOnly:v=!1,restMs:g=0,move:y=!0}=t,b=D(),E=L(),w=F(m),R=F(d),O=u.useRef(),k=u.useRef(),T=u.useRef(),M=u.useRef(),C=u.useRef(!0),P=u.useRef(!1),S=u.useRef((()=>{})),A=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(f)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){clearTimeout(k.current),clearTimeout(M.current),C.current=!0}}),[f,i]),u.useEffect((()=>{if(!f||!w.current||!n)return;function e(e){A()&&r(!1,e)}const t=I(s).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s,n,r,f,w,o,A]);const N=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=K(R.current,"close",O.current);n&&!T.current?(clearTimeout(k.current),k.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(k.current),r(!1,e))}),[R,r]),H=u.useCallback((()=>{S.current(),T.current=void 0}),[]),B=u.useCallback((()=>{if(P.current){const e=I(a.floating.current).body;e.style.pointerEvents="",e.removeAttribute(j),P.current=!1}}),[a]);return u.useEffect((()=>{if(f&&p(l)){const e=l;return n&&e.addEventListener("mouseleave",c),null==s||s.addEventListener("mouseleave",c),y&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",c),null==s||s.removeEventListener("mouseleave",c),y&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(k.current),C.current=!1,v&&!x(O.current)||g>0&&0===K(R.current,"open"))return;const t=K(R.current,"open",O.current);t?k.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;S.current();const o=I(s);if(clearTimeout(M.current),w.current){n||clearTimeout(k.current),T.current=w.current({...e,tree:b,x:r.clientX,y:r.clientY,onClose(){B(),H(),N(r)}});const t=T.current;return o.addEventListener("mousemove",t),void(S.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==O.current||!h(s,r.relatedTarget))&&N(r)}function c(n){t()||null==w.current||w.current({...e,tree:b,x:n.clientX,y:n.clientY,onClose(){B(),H(),N(n)}})(n)}}),[l,s,f,e,v,g,y,N,H,B,r,n,b,R,w,o]),c((()=>{var e;if(f&&n&&null!=(e=w.current)&&e.__options.blockPointerEvents&&A()){const e=I(s).body;if(e.setAttribute(j,""),e.style.pointerEvents="none",P.current=!0,p(l)&&s){var t,r;const e=l,n=null==b||null==(t=b.nodesRef.current.find((e=>e.id===E)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",s.style.pointerEvents="auto",()=>{e.style.pointerEvents="",s.style.pointerEvents=""}}}}),[f,n,E,s,l,b,w,o,A]),c((()=>{n||(O.current=void 0,H(),B())}),[n,H,B]),u.useEffect((()=>()=>{H(),clearTimeout(k.current),clearTimeout(M.current),B()}),[f,l,H,B]),u.useMemo((()=>{if(!f)return{};function e(e){O.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===g||(clearTimeout(M.current),M.current=setTimeout((()=>{C.current||r(!0,e.nativeEvent)}),g))}},floating:{onMouseEnter(){clearTimeout(k.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),N(e.nativeEvent,!1)}}}}),[i,f,g,n,r,N])},e.useId=f,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:s}=t,a=Ke(s),f=u.useRef(!1),d=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{a((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(b())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{d.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{d.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,a]),u.useMemo((()=>i?{floating:{onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&f.current){if(null!==d.current){const t=e.scrollTop-d.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>a((e=>e+t))))}requestAnimationFrame((()=>{d.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,a])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>_e(t,e,"reference")),t),r=u.useCallback((t=>_e(t,e,"floating")),t),o=u.useCallback((t=>_e(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=function(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:l,map:s,elementsRef:a,labelsRef:f}=u.useContext(Ae),d=u.useCallback((e=>{if(o.current=e,null!==n&&(a.current[n]=e,f)){var r;const o=void 0!==t;f.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,a,f,t]);return c((()=>{const e=o.current;if(e)return i(e),()=>{l(e)}}),[i,l]),c((()=>{const e=o.current?s.get(o.current):null;null!=e&&r(e)}),[s]),u.useMemo((()=>({ref:d,index:null==n?-1:n})),[n,d])},e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:l}}=e,{listRef:s,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:m=null,allowEscape:p=!1,loop:b=!1,nested:x=!1,rtl:O=!1,virtual:k=!1,focusItemOnOpen:T="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:P=!0,disabledIndices:S,orientation:A="vertical",cols:N=1,scrollItemIntoView:j=!0}=t,K=L(),H=D(),B=Ke(f),q=u.useRef(T),_=u.useRef(null!=m?m:-1),W=u.useRef(null),U=u.useRef(!0),z=u.useRef(B),V=u.useRef(!!l),X=u.useRef(!1),Y=u.useRef(!1),G=F(S),Z=F(n),$=F(j),[Q,J]=u.useState(),ee=Ke((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(k?J(r.id):ve(r,{preventScroll:!0,sync:!(!y().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!R())&&(We||X.current)}),requestAnimationFrame((()=>{const e=$.current;e&&r&&(n||!U.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));c((()=>{document.createElement("div").focus({get preventScroll(){return We=!0,!1}})}),[]),c((()=>{d&&(n&&l?q.current&&null!=m&&(Y.current=!0,B(m)):V.current&&(_.current=-1,z.current(null)))}),[d,n,l,m,B]),c((()=>{if(d&&n&&l)if(null==a){if(X.current=!1,null!=m)return;if(V.current&&(_.current=-1,ee(s,_)),!V.current&&q.current&&(null!=W.current||!0===q.current&&null==W.current)){let e=0;const t=()=>{if(null==s.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else _.current=null==W.current||Je(W.current,A,O)||x?et(s,G.current):tt(s,G.current),W.current=null,B(_.current)};t()}}else Ge(s,a)||(_.current=a,ee(s,_,Y.current),Y.current=!1)}),[d,n,l,a,m,x,s,A,O,B,ee,G]),c((()=>{if(d&&V.current&&!l&&H){var e,t;const n=H.nodesRef.current,r=null==(e=n.find((e=>e.id===K)))||null==(t=e.context)?void 0:t.elements.floating,o=g(I(l)),u=n.some((e=>e.context&&h(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[d,l,H,K]),c((()=>{z.current=B,V.current=!!l})),c((()=>{n||(W.current=null)}),[n]);const te=null!=a,ne=u.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&B(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...M&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;U.current&&"touch"!==t&&(_.current=-1,ee(s,_),B(null),k||ve(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ee,M,s,B,k]);return u.useMemo((()=>{if(!d)return{};const e=G.current;function t(t){if(U.current=!1,X.current=!0,!Z.current&&t.currentTarget===o.floating.current)return;if(x&&function(e,t,n){return $e(t,n?e===Xe:e===Ve,e===Ue)}(t.key,A,O))return C(t),r(!1,t.nativeEvent),void(v(i)&&i.focus());const u=_.current,c=et(s,e),l=tt(s,e);if("Home"===t.key&&(C(t),_.current=c,B(_.current)),"End"===t.key&&(C(t),_.current=l,B(_.current)),N>1){const n=_.current;if(t.key===Ue){if(C(t),-1===n)_.current=l;else if(_.current=Ze(s,{startingIndex:n,amount:N,decrement:!0,disabledIndices:e}),b&&(n-N<c||_.current<0)){const e=n%N,t=l%N,r=l-(t-e);_.current=t===e?l:t>e?r:r-N}Ge(s,_.current)&&(_.current=n),B(_.current)}if(t.key===ze&&(C(t),-1===n?_.current=c:(_.current=Ze(s,{startingIndex:n,amount:N,disabledIndices:e}),b&&n+N>l&&(_.current=Ze(s,{startingIndex:n%N-N,amount:N,disabledIndices:e}))),Ge(s,_.current)&&(_.current=n),B(_.current)),"both"===A){const r=Math.floor(n/N);t.key===Xe&&(C(t),n%N!=N-1?(_.current=Ze(s,{startingIndex:n,disabledIndices:e}),b&&Ye(_.current,N,r)&&(_.current=Ze(s,{startingIndex:n-n%N-1,disabledIndices:e}))):b&&(_.current=Ze(s,{startingIndex:n-n%N-1,disabledIndices:e})),Ye(_.current,N,r)&&(_.current=n)),t.key===Ve&&(C(t),n%N!=0?(_.current=Ze(s,{startingIndex:n,disabledIndices:e,decrement:!0}),b&&Ye(_.current,N,r)&&(_.current=Ze(s,{startingIndex:n+(N-n%N),decrement:!0,disabledIndices:e}))):b&&(_.current=Ze(s,{startingIndex:n+(N-n%N),decrement:!0,disabledIndices:e})),Ye(_.current,N,r)&&(_.current=n));const o=Math.floor(l/N)===r;return Ge(s,_.current)&&(_.current=b&&o?t.key===Ve?l:Ze(s,{startingIndex:n-n%N-1,disabledIndices:e}):n),void B(_.current)}}if(Qe(t.key,A)){if(C(t),n&&!k&&g(t.currentTarget.ownerDocument)===t.currentTarget)return _.current=Je(t.key,A,O)?c:l,void B(_.current);Je(t.key,A,O)?_.current=b?u>=l?p&&u!==s.current.length?-1:c:Ze(s,{startingIndex:u,disabledIndices:e}):Math.min(l,Ze(s,{startingIndex:u,disabledIndices:e})):_.current=b?u<=c?p&&-1!==u?s.current.length:l:Ze(s,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,Ze(s,{startingIndex:u,decrement:!0,disabledIndices:e})),Ge(s,_.current)?B(null):B(_.current)}}function u(e){"auto"===T&&E(e.nativeEvent)&&(q.current=!0)}const c=k&&n&&te&&{"aria-activedescendant":Q};return{reference:{...c,onKeyDown(o){U.current=!1;const u=0===o.key.indexOf("Arrow");if(k&&n)return t(o);if(!n&&!P&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=Qe(o.key,A),l=function(e,t,n){return $e(t,n?e===Ve:e===Xe,e===ze)}(o.key,A,O);i&&(W.current=x&&c?null:o.key),x?l&&(C(o),n?(_.current=et(s,e),B(_.current)):r(!0,o.nativeEvent)):c&&(null!=m&&(_.current=m),C(o),!n&&P?r(!0,o.nativeEvent):t(o),n&&B(_.current))},onFocus(){n&&B(null)},onPointerDown:function(e){q.current=T,"auto"===T&&w(e.nativeEvent)&&(q.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===A?void 0:A,...c,onKeyDown:t,onPointerMove(){U.current=!0}},item:ne}}),[i,o,Q,G,Z,s,d,A,O,k,n,te,x,m,P,p,N,b,T,B,r,ne])},e.useMergeRefs=function(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)},e.useRole=function(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,c=f();return u.useMemo((()=>{const e={id:r,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?r:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:c}},floating:{...e,..."menu"===i&&{"aria-labelledby":c}}}:{}}),[o,i,n,r,c])},e.useTransitionStatus=ot,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:l=250}=t,s=e.placement,a=s.split("-")[0],f=u.useMemo((()=>({side:a,placement:s})),[a,s]),d="number"==typeof l,m=(d?l:l.open)||0,p=(d?l:l.close)||0,[v,g]=u.useState((()=>({...rt(i,f),...rt(n,f)}))),{isMounted:h,status:y}=ot(e,{duration:l}),b=F(n),E=F(r),w=F(o),R=F(i);return c((()=>{const e=rt(b.current,f),t=rt(w.current,f),n=rt(R.current,f),r=rt(E.current,f)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&g({transitionProperty:Object.keys(r).map(nt).join(","),transitionDuration:m+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(nt).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,b,E,R,m,y,f]),{isMounted:h,styles:v}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:l,onMatch:s,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:m=750,ignoreKeys:p=[],selectedIndex:v=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=v?v:l)?n:-1),b=u.useRef(null),E=Ke(s),w=Ke(a),R=F(d),x=F(p);return c((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),c((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=v?v:l)?e:-1)}),[r,v,l]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=R.current?R.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&C(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(C(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),m);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,m,x,R,E,w])}})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/react-dom"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/react-dom","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.FloatingUIReactDOM,e.React,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(n);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var c="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;let l=!1,s=0;const a=()=>"floating-ui-"+s++;const f=u["useId".toString()]||function(){const[e,t]=u.useState((()=>l?a():void 0));return c((()=>{null==e&&t(a())}),[]),u.useEffect((()=>{l||(l=!0)}),[]),e},d=u.forwardRef((function(e,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:c}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:d=0,staticOffset:m,stroke:p,d:v,style:{transform:g,...h}={},...y}=e;const b=f();if(!o)return null;d*=2;const E=d/2,w=l/2*(a/-8+1),R=s/2*a/4,[x,I]=r.split("-"),O=t.platform.isRTL(o),k=!!v,C="top"===x||"bottom"===x,T=m&&"end"===I?"bottom":"top";let M=m&&"end"===I?"right":"left";m&&O&&(M="end"===I?"left":"right");const S=null!=(null==c?void 0:c.x)?m||c.x:"",P=null!=(null==c?void 0:c.y)?m||c.y:"",A=v||"M0,0 H"+l+" L"+(l-w)+","+(s-R)+" Q"+l/2+","+s+" "+w+","+(s-R)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",i({},y,{"aria-hidden":!0,ref:n,width:k?l:l+d,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[M]:S,[T]:P,[x]:C||k?"100%":"calc(100% - "+d/2+"px)",transform:""+L+(null!=g?g:""),...h}}),d>0&&u.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:p,strokeWidth:d+(v?0:1),d:A}),u.createElement("path",{stroke:d&&!v?y.fill:"none",d:A}),u.createElement("clipPath",{id:b},u.createElement("rect",{x:-E,y:E*(k?-1:1),width:l+d,height:l})))}));function m(e){return v(e)?(e.nodeName||"").toLowerCase():"#document"}function p(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function v(e){return e instanceof Node||e instanceof p(e).Node}function g(e){return e instanceof Element||e instanceof p(e).Element}function h(e){return e instanceof HTMLElement||e instanceof p(e).HTMLElement}function y(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof p(e).ShadowRoot)}function b(e){if("html"===m(e))return e;const t=e.assignedSlot||e.parentNode||y(e)&&e.host||function(e){var t;return null==(t=(v(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return y(t)?t.host:t}function E(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}function w(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&y(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function R(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function x(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function I(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(R())||t.test(x()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function O(e){return 0===e.width&&0===e.height||1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"!==e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail}function k(){return/apple/i.test(navigator.vendor)}function C(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function T(e){return(null==e?void 0:e.ownerDocument)||document}function M(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function S(e){return"composedPath"in e?e.composedPath()[0]:e.target}const P="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function A(e){return h(e)&&e.matches(P)}function L(e){e.preventDefault(),e.stopPropagation()}function N(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const D=u.createContext(null),F=u.createContext(null),j=()=>{var e;return(null==(e=u.useContext(D))?void 0:e.id)||null},K=()=>u.useContext(F);function H(e){return"data-floating-ui-"+e}function B(e){const t=n.useRef(e);return c((()=>{t.current=e})),t}const q=H("safe-polygon");function _(e,t,n){return n&&!C(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const W=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),U=()=>u.useContext(W); | ||
/*! | ||
* tabbable 6.0.1 | ||
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE | ||
*/ | ||
var z=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"].join(","),V="undefined"==typeof Element,X=V?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Y=!V&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},G=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if("SLOT"===i.tagName){var c=i.assignedElements(),l=e(c.length?c:i.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{X.call(i,z)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!r.shadowRootFilter||r.shadowRootFilter(i);if(s&&a){var f=e(!0===s?i.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else u.unshift.apply(u,i.children)}}return o},Z=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},$=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Q=function(e){return"INPUT"===e.tagName},J=function(e){return function(e){return Q(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Y(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},ee=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},te=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=X.call(e,"details>summary:first-of-type")?e.parentElement:e;if(X.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ee(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=Y(e);if(i&&!i.shadowRoot&&!0===r(i))return ee(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){for(var t,n=Y(e).host,r=!!(null!==(t=n)&&void 0!==t&&t.ownerDocument.contains(n)||e.ownerDocument.contains(e));!r&&n;){var o;r=!(null===(o=n=Y(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ne=function(e,t){return!(t.disabled||function(e){return Q(e)&&"hidden"===e.type}(t)||te(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!X.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},re=function(e,t){return!(J(t)||Z(t)<0||!ne(e,t))},oe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ue=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=Z(i,u),l=u?e(t.candidates):i;0===c?u?n.push.apply(n,l):n.push(i):r.push({documentOrder:o,tabIndex:c,item:t,isScope:u,content:l})})),r.sort($).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ie=function(e,t){var n;return n=(t=t||{}).getShadowRoot?G([e],t.includeContainer,{filter:re.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:oe}):function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(z));return t&&X.call(e,z)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,re.bind(null,t)),ue(n)};let ce=0;function le(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(ce);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():ce=requestAnimationFrame(u)}function se(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let ae=new WeakMap,fe=new WeakSet,de={},me=0;const pe=e=>e&&(e.host||pe(e.parentNode)),ve=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=pe(t);return e.contains(n)?n:null})).filter((e=>null!=e));function ge(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=T(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=ve(t,e),c=new Set,l=new Set(i),s=[];de[o]||(de[o]=new WeakMap);const a=de[o];return i.forEach((function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&Array.prototype.forEach.call(t.children,(t=>{if(c.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(ae.get(t)||0)+1,i=(a.get(t)||0)+1;ae.set(t,r),a.set(t,i),s.push(t),1===r&&n&&fe.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),c.clear(),me++,()=>{s.forEach((e=>{const t=(ae.get(e)||0)-1,n=(a.get(e)||0)-1;ae.set(e,t),a.set(e,n),t||(!fe.has(e)&&u&&e.removeAttribute(u),fe.delete(e)),n||e.removeAttribute(o)})),me--,me||(ae=new WeakMap,ae=new WeakMap,fe=new WeakSet,de={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const he=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ye(e,t){const n=ie(e,he());"prev"===t&&n.reverse();const r=n.indexOf(E(T(e)));return n.slice(r+1)[0]}function be(){return ye(document.body,"next")}function Ee(){return ye(document.body,"prev")}function we(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!w(n,r)}function Re(e){ie(e,he()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function xe(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Ie={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Oe(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const ke=u.forwardRef((function(e,t){const[n,r]=u.useState();c((()=>(k()&&r("button"),document.addEventListener("keydown",Oe),()=>{document.removeEventListener("keydown",Oe)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[H("focus-guard")]:"",style:Ie};return u.createElement("span",i({},e,o))})),Ce=u.createContext(null);function Te(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=f(),l=Me(),s=u.useMemo((()=>({id:t,root:n,portalContext:l,uniqueId:i})),[t,n,l,i]),a=u.useRef();return c((()=>()=>{null==r||r.remove()}),[r,s]),c((()=>{if(a.current===s)return;a.current=s;const{id:e,root:t,portalContext:n,uniqueId:r}=s,u=e?document.getElementById(e):null,i=H("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!g(u)&&(u=u.current),u=u||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,u.appendChild(c));const l=document.createElement("div");l.id=r,l.setAttribute(i,""),u=c||u,u.appendChild(l),o(l)}}),[s]),r}const Me=()=>u.useContext(Ce),Se=u.forwardRef((function(e,t){return u.createElement("button",i({},e,{type:"button",ref:t,tabIndex:-1,style:Ie}))}));function Pe(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Ae=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});const Le=H("scroll-lock"),Ne=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return c((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Le))return;document.body.setAttribute(Le,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(R()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Le),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,i=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,c=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(i))+"px",left:-(c-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(Le),window.scrollTo(c,l)}}),[n]),u.createElement("div",i({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function De(e){return h(e.target)&&"BUTTON"===e.target.tagName}function Fe(e){return A(e)}const je=u["useInsertionEffect".toString()]||(e=>e());function Ke(e){const t=u.useRef((()=>{}));return je((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function He(e){return null!=e&&null!=e.clientX}const Be={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qe={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function _e(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}let We=!1;const Ue="ArrowUp",ze="ArrowDown",Ve="ArrowLeft",Xe="ArrowRight";function Ye(e,t,n){return Math.floor(e/t)!==n}function Ge(e,t){return t<0||t>=e.current.length}function Ze(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current;let c=n;do{var l,s;c+=r?-u:u}while(c>=0&&c<=i.length-1&&(o?o.includes(c):null==i[c]||(null==(l=i[c])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=i[c])?void 0:s.getAttribute("aria-disabled"))));return c}function $e(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Qe(e,t){return $e(t,e===Ue||e===ze,e===Ve||e===Xe)}function Je(e,t,n){return $e(t,e===ze,n?e===Ve:e===Xe)||"Enter"===e||" "==e||""===e}function et(e,t){return Ze(e,{disabledIndices:t})}function tt(e,t){return Ze(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const nt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function rt(e,t){return"function"==typeof e?e(t):e}function ot(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[l,s]=u.useState(!1),[a,f]=u.useState("unmounted"),d=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return c((()=>{l&&!d&&f("unmounted")}),[l,d]),c((()=>{if(r){if(n){f("initial");const e=requestAnimationFrame((()=>{f("open")}));return()=>{cancelAnimationFrame(e)}}s(!0),f("close")}}),[n,r]),{isMounted:d,status:a}}function ut(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function it(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,i=u-1;e<u;i=e++){const[u,c]=t[e]||[0,0],[l,s]=t[i]||[0,0];c>=r!=s>=r&&n<=(l-u)*(r-c)/(s-c)+u&&(o=!o)}return o}Object.defineProperty(e,"arrow",{enumerable:!0,get:function(){return t.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return t.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return t.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return t.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return t.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return t.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return t.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return t.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return t.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return t.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return t.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return t.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return t.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return t.size}}),e.FloatingArrow=d,e.FloatingDelayGroup=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=u.useRef(null),s=u.useCallback((e=>{i({currentId:e})}),[]);return c((()=>{o.currentId?null===l.current?l.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),l.current=null)}),[o.currentId]),u.createElement(W.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:s})),[o,i,s])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:l=0,returnFocus:s=!0,modal:a=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0}=e,{open:m,refs:p,nodeId:v,onOpenChange:g,events:y,dataRef:b,elements:{domReference:R,floating:x}}=t,I="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,O=B(o),k=B(l),C=B(s),M=K(),P=Me(),N="number"==typeof l&&l<0,D=u.useRef(null),F=u.useRef(null),j=u.useRef(!1),q=u.useRef(null),_=u.useRef(!1),W=null!=P,U=R&&"combobox"===R.getAttribute("role")&&A(R),z=u.useCallback((function(e){return void 0===e&&(e=x),e?ie(e,he()):[]}),[x]),V=u.useCallback((e=>{const t=z(e);return O.current.map((e=>R&&"reference"===e?R:x&&"floating"===e?x:t)).filter(Boolean).flat()}),[R,x,O,z]);function X(e){return!r&&f&&a?u.createElement(Se,{ref:"start"===e?D:F,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}u.useEffect((()=>{if(r||!a)return;function e(e){if("Tab"===e.key){w(x,E(T(x)))&&0===z().length&&!U&&L(e);const t=V(),n=S(e);"reference"===O.current[0]&&n===R&&(L(e),e.shiftKey?le(t[t.length-1]):le(t[1])),"floating"===O.current[1]&&n===x&&e.shiftKey&&(L(e),le(t[0]))}}const t=T(x);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,R,x,a,O,p,U,z,V]),u.useEffect((()=>{if(!r&&d)return x&&h(R)?(R.addEventListener("focusout",t),R.addEventListener("pointerdown",e),!a&&x.addEventListener("focusout",t),()=>{R.removeEventListener("focusout",t),R.removeEventListener("pointerdown",e),!a&&x.removeEventListener("focusout",t)}):void 0;function e(){_.current=!0,setTimeout((()=>{_.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(w(R,t)||w(x,t)||w(t,x)||w(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(H("focus-guard"))||M&&(se(M.nodesRef.current,v).find((e=>{var n,r;return w(null==(n=e.context)?void 0:n.elements.floating,t)||w(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(M.nodesRef.current,v).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!_.current&&t!==q.current&&(j.current=!0,g(!1,e))}))}}),[r,R,x,a,v,M,P,g,d]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+H("portal")+"]"))||[]);if(x){const e=[x,...t,D.current,F.current,O.current.includes("reference")||U?R:null].filter((e=>null!=e)),n=a?ge(e,I,!I):ge(e);return()=>{n()}}}),[r,R,x,a,O,P,U,I]),c((()=>{if(r||!x)return;const e=E(T(x));queueMicrotask((()=>{const t=V(x),n=k.current,r=("number"==typeof n?t[n]:n.current)||x,o=w(x,e);N||o||!m||le(r,{preventScroll:r===x})}))}),[r,m,x,N,V,k]),c((()=>{if(r||!x)return;let e=!1;const t=T(x),n=E(t),o=b.current;function u(t){if("escapeKey"===t.type&&p.domReference.current&&(q.current=p.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(j.current=!1,e=n.preventScroll):j.current=!n}return q.current=n,y.on("dismiss",u),()=>{y.off("dismiss",u);const n=E(t);(w(x,n)||M&&se(M.nodesRef.current,v).some((e=>{var t;return w(null==(t=e.context)?void 0:t.elements.floating,n)}))||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&p.domReference.current&&(q.current=p.domReference.current),C.current&&h(q.current)&&!j.current&&le(q.current,{cancelPrevious:!1,preventScroll:e})}}),[r,x,C,b,p,y,M,v]),c((()=>{if(!r&&P)return P.setFocusManagerState({modal:a,closeOnFocusOut:d,open:m,onOpenChange:g,refs:p}),()=>{P.setFocusManagerState(null)}}),[r,P,a,m,g,p,d]),c((()=>{if(!r&&x&&"function"==typeof MutationObserver){const e=()=>{const e=x.getAttribute("tabindex");O.current.includes("floating")||E(T(x))!==p.domReference.current&&0===z().length?"0"!==e&&x.setAttribute("tabindex","0"):"-1"!==e&&x.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(x,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[r,x,p,O,z]);const Y=!r&&I&&!U&&(W||a);return u.createElement(u.Fragment,null,Y&&u.createElement(ke,{"data-type":"inside",ref:null==P?void 0:P.beforeInsideRef,onFocus:e=>{if(a){const e=V();le("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(j.current=!1,we(e,P.portalNode)){const e=be()||R;null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!U&&X("start"),n,X("end"),Y&&u.createElement(ke,{"data-type":"inside",ref:null==P?void 0:P.afterInsideRef,onFocus:e=>{if(a)le(V()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(d&&(j.current=!0),we(e,P.portalNode)){const e=Ee()||R;null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=function(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),l=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),s=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return c((()=>{const e=new Map(o);Array.from(e.keys()).sort(Pe).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||i(e)}),[o]),u.createElement(Ae.Provider,{value:u.useMemo((()=>({register:l,unregister:s,map:o,elementsRef:n,labelsRef:r})),[l,s,o,n,r])},t)},e.FloatingNode=function(e){let{children:t,id:n}=e;const r=j();return u.createElement(D.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=Ne,e.FloatingPortal=function(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const c=Te({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=u.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&we(e)){("focusin"===e.type?xe:Re)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(Ce.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:c,setFocusManagerState:s})),[i,c])},p&&c&&u.createElement(ke,{"data-type":"outside",ref:a,onFocus:e=>{if(we(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=Ee()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&c&&u.createElement("span",{"aria-owns":c.id,style:Ie}),c&&r.createPortal(t,c),p&&c&&u.createElement(ke,{"data-type":"outside",ref:f,onFocus:e=>{if(we(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=be()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>N()))[0];return u.createElement(F.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[n,r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(n){const{listRef:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:p}}=n,v=o.current[l];if(!v)return{};const g={...n,...await t.offset(-v.offsetTop-p.clientTop-m.reference.height/2-v.offsetHeight/2-c).fn(n)},h=(null==f?void 0:f.current)||p,y=await t.detectOverflow(ut(g,h.scrollHeight),d),b=await t.detectOverflow(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),w=g.y+E,R=Math.max(0,h.scrollHeight-E-Math.max(0,y.bottom));return h.style.maxHeight=R+"px",h.scrollTop=E,i&&(h.offsetHeight<v.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await t.detectOverflow(ut({...g,y:w},h.offsetHeight),d)),{y:w}}}),e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:p}=e;return function(e){function v(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:h,clientY:y}=e,b=[h,y],E=S(e),R="mouseleave"===e.type,x=w(f.floating,E),I=w(f.domReference,E),O=f.domReference.getBoundingClientRect(),k=f.floating.getBoundingClientRect(),C=a.split("-")[0],T=n>k.right-k.width/2,M=s>k.bottom-k.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(b,O),A=k.width>O.width,L=k.height>O.height,N=(A?O:k).left,D=(A?O:k).right,F=(L?O:k).top,j=(L?O:k).bottom;if(x&&(u=!0,!R))return;if(I&&(u=!1),I&&!R)return void(u=!0);if(R&&g(e.relatedTarget)&&w(f.floating,e.relatedTarget))return;if(p&&se(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===C&&s>=O.bottom-1||"bottom"===C&&s<=O.top+1||"left"===C&&n>=O.right-1||"right"===C&&n<=O.left+1)return v();let K=[];switch(C){case"top":K=[[N,O.top+1],[N,k.bottom-1],[D,k.bottom-1],[D,O.top+1]];break;case"bottom":K=[[N,k.top+1],[N,O.bottom-1],[D,O.bottom-1],[D,k.top+1]];break;case"left":K=[[k.right-1,j],[k.right-1,F],[O.left+1,F],[O.left+1,j]];break;case"right":K=[[O.right-1,j],[O.right-1,F],[k.left+1,F],[k.left+1,j]]}if(!it([h,y],K)){if(u&&!P)return v();if(!R&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===c||0===r)return i=e,c=t,l=n,null;const o=e-i,u=t-c,s=Math.sqrt(o*o+u*u);return i=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return v()}it([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[A?n+t/2:T?n+4*t:n-4*t,r+t+1],[A?n-t/2:T?n+4*t:n-4*t,r+t+1],...[[k.left,T||A?k.bottom-t:k.top],[k.right,T?A?k.bottom-t:k.top:k.bottom-t]]];case"bottom":return[[A?n+t/2:T?n+4*t:n-4*t,r-t],[A?n-t/2:T?n+4*t:n-4*t,r-t],...[[k.left,T||A?k.top+t:k.bottom],[k.right,T?A?k.top+t:k.bottom:k.top+t]]];case"left":{const e=[n+t+1,L?r+t/2:M?r+4*t:r-4*t],o=[n+t+1,L?r-t/2:M?r+4*t:r-4*t];return[...[[M||L?k.right-t:k.left,k.top],[M?L?k.right-t:k.left:k.right-t,k.bottom]],e,o]}case"right":return[[n-t,L?r+t/2:M?r+4*t:r-4*t],[n-t,L?r-t/2:M?r+4*t:r-4*t],...[[M||L?k.left+t:k.right,k.top],[M?L?k.left+t:k.right:k.left+t,k.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(v,40)):v()}}};return s.__options={blockPointerEvents:n},s},e.useClick=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),m=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(C(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent)):r(!1,e.nativeEvent)))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:C(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent):r(!1,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||De(e)||(" "!==e.key||Fe(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||De(e)||Fe(i)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,e.nativeEvent))}}}:{}),[c,o,l,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:l=!0,axis:s="both",x:a=null,y:f=null}=t,d=u.useRef(!1),m=u.useRef(null),[v,g]=u.useState(),[h,y]=u.useState([]),b=Ke(((e,t)=>{d.current||o.current.openEvent&&!He(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,m=c.x,p=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),m-=n||0,p-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,m=l&&null!=t.x?t.x:m,p=s&&null!=t.y?t.y:p):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:m,y:p,top:p,right:m+f,bottom:p+d,left:m}}}}(r.domReference,{x:e,y:t,axis:s,dataRef:o,pointerType:v}))})),E=Ke((e=>{null==a&&null==f&&(n?m.current||y([]):b(e.clientX,e.clientY))})),R=C(v)?i:n,x=u.useCallback((()=>{if(!R||!l||null!=a||null!=f)return;const e=p(r.floating.current);function t(n){const o=S(n);w(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):b(n.clientX,n.clientY)}if(!o.current.openEvent||He(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,l,R,r,b,a,f]);return u.useEffect((()=>x()),[x,h]),u.useEffect((()=>{l&&!i&&(d.current=!1)}),[l,i]),u.useEffect((()=>{!l&&n&&(d.current=!0)}),[l,n]),c((()=>{!l||null==a&&null==f||(d.current=!1,b(a,f))}),[l,a,f,b]),u.useMemo((()=>{if(!l)return{};function e(e){let{pointerType:t}=e;g(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:E,onMouseEnter:E}}}),[l,E])},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:l,setState:s,timeoutMs:a}=U();c((()=>{u&&(s({delay:{open:1,close:_(l,"close")}}),u!==o&&r(!1))}),[o,r,s,u,l]),c((()=>{function e(){r(!1),s({delay:l,currentId:null})}if(!n&&u===o){if(a){const t=window.setTimeout(e,a);return()=>{clearTimeout(t)}}e()}}),[n,s,u,o,r,l,a]),c((()=>{n&&i(o)}),[n,i,o])},e.useDelayGroupContext=U,e.useDismiss=function(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:c,elements:{reference:l,domReference:s,floating:a},dataRef:f}=e,{enabled:d=!0,escapeKey:v=!0,outsidePress:y=!0,outsidePressEvent:E="pointerdown",referencePress:R=!1,referencePressEvent:x="pointerdown",ancestorScroll:k=!1,bubbles:C}=n,P=K(),A=null!=j(),L=Ke("function"==typeof y?y:()=>!1),N="function"==typeof y?L:y,D=u.useRef(!1),{escapeKeyBubbles:F,outsidePressBubbles:B}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(C),q=Ke((e=>{if(!r||!d||!v||"Escape"!==e.key)return;const t=P?se(P.nodesRef.current,c):[];if(!F&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),_=Ke((e=>{const t=D.current;if(D.current=!1,t)return;if("function"==typeof N&&!N(e))return;const n=S(e),r="["+H("inert")+"]",u=T(a).querySelectorAll(r);let l=g(n)?n:null;for(;l&&!["html","body","#document"].includes(m(l));){const e=b(l);if(e===T(a).body||!g(e))break;l=e}if(u.length&&g(n)&&!n.matches("html,body")&&!w(n,a)&&Array.from(u).every((e=>!w(l,e))))return;if(h(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){const t="rtl"===function(e){return p(e).getComputedStyle(e)}(n).direction;t&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const f=P&&se(P.nodesRef.current,c).some((t=>{var n;return M(e,null==(n=t.context)?void 0:n.elements.floating)}));if(M(e,a)||M(e,s)||f)return;const d=P?se(P.nodesRef.current,c):[];if(d.length>0){let e=!0;if(d.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:A?{preventScroll:!0}:I(e)||O(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=F,f.current.__outsidePressBubbles=B;const n=T(a);v&&n.addEventListener("keydown",q),N&&n.addEventListener(E,_);let u=[];return k&&(g(s)&&(u=t.getOverflowAncestors(s)),g(a)&&(u=u.concat(t.getOverflowAncestors(a))),!g(l)&&l&&l.contextElement&&(u=u.concat(t.getOverflowAncestors(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{v&&n.removeEventListener("keydown",q),N&&n.removeEventListener(E,_),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,v,N,E,r,o,k,d,F,B,q,_]),u.useEffect((()=>{D.current=!1}),[N,E]),u.useMemo((()=>d?{reference:{onKeyDown:q,[Be[x]]:e=>{R&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:q,[qe[E]]:()=>{D.current=!0}}}:{}),[d,i,R,E,x,o,q])},e.useFloating=function(e){var n;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[l,s]=u.useState(null),a=(null==(n=e.elements)?void 0:n.reference)||l,d=t.useFloating(e),m=K(),p=Ke(((e,t)=>{e&&(h.current.openEvent=t),null==o||o(e,t)})),v=u.useRef(null),h=u.useRef({}),y=u.useState((()=>N()))[0],b=f(),E=u.useCallback((e=>{const t=g(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;d.refs.setReference(t)}),[d.refs]),w=u.useCallback((e=>{(g(e)||null===e)&&(v.current=e,s(e)),(g(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!g(e))&&d.refs.setReference(e)}),[d.refs]),R=u.useMemo((()=>({...d.refs,setReference:w,setPositionReference:E,domReference:v})),[d.refs,w,E]),x=u.useMemo((()=>({...d.elements,domReference:a})),[d.elements,a]),I=u.useMemo((()=>({...d,refs:R,elements:x,dataRef:h,nodeId:i,floatingId:b,events:y,open:r,onOpenChange:p})),[d,i,b,y,r,p,R,x]);return c((()=>{const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===i));e&&(e.context=I)})),u.useMemo((()=>({...d,context:I,refs:R,elements:x})),[d,R,x,I])},e.useFloatingNodeId=function(e){const t=f(),n=K(),r=j(),o=e||r;return c((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=j,e.useFloatingPortalNode=Te,e.useFloatingTree=K,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:c,elements:{floating:l,domReference:s}}=e,{enabled:a=!0,keyboardOnly:f=!0}=t,d=u.useRef(""),m=u.useRef(!1),p=u.useRef();return u.useEffect((()=>{if(!a)return;const e=T(l).defaultView||window;function t(){!n&&h(s)&&s===E(T(s))&&(m.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,s,n,a]),u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(m.current=!0)}}),[i,a]),u.useEffect((()=>()=>{clearTimeout(p.current)}),[]),u.useMemo((()=>a?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,m.current=!(!t||!f)},onMouseLeave(){m.current=!1},onFocus(e){var t;m.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&M(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=g(t)&&t.hasAttribute(H("focus-guard"))&&"outside"===t.getAttribute("data-type");p.current=setTimeout((()=>{w(c.floating.current,t)||w(s,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[a,f,s,c,o,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:l,floating:s},refs:a}=e,{enabled:f=!0,delay:d=0,handleClose:m=null,mouseOnly:p=!1,restMs:v=0,move:h=!0}=t,y=K(),b=j(),E=B(m),R=B(d),x=u.useRef(),I=u.useRef(),O=u.useRef(),k=u.useRef(),M=u.useRef(!0),S=u.useRef(!1),P=u.useRef((()=>{})),A=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(f)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){clearTimeout(I.current),clearTimeout(k.current),M.current=!0}}),[f,i]),u.useEffect((()=>{if(!f||!E.current||!n)return;function e(e){A()&&r(!1,e)}const t=T(s).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s,n,r,f,E,o,A]);const L=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=_(R.current,"close",x.current);n&&!O.current?(clearTimeout(I.current),I.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(I.current),r(!1,e))}),[R,r]),N=u.useCallback((()=>{P.current(),O.current=void 0}),[]),D=u.useCallback((()=>{if(S.current){const e=T(a.floating.current).body;e.style.pointerEvents="",e.removeAttribute(q),S.current=!1}}),[a]);return u.useEffect((()=>{if(f&&g(l)){const e=l;return n&&e.addEventListener("mouseleave",c),null==s||s.addEventListener("mouseleave",c),h&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",c),null==s||s.removeEventListener("mouseleave",c),h&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(I.current),M.current=!1,p&&!C(x.current)||v>0&&0===_(R.current,"open"))return;const t=_(R.current,"open",x.current);t?I.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;P.current();const o=T(s);if(clearTimeout(k.current),E.current){n||clearTimeout(I.current),O.current=E.current({...e,tree:y,x:r.clientX,y:r.clientY,onClose(){D(),N(),L(r)}});const t=O.current;return o.addEventListener("mousemove",t),void(P.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==x.current||!w(s,r.relatedTarget))&&L(r)}function c(n){t()||null==E.current||E.current({...e,tree:y,x:n.clientX,y:n.clientY,onClose(){D(),N(),L(n)}})(n)}}),[l,s,f,e,p,v,h,L,N,D,r,n,y,R,E,o]),c((()=>{var e;if(f&&n&&null!=(e=E.current)&&e.__options.blockPointerEvents&&A()){const e=T(s).body;if(e.setAttribute(q,""),e.style.pointerEvents="none",S.current=!0,g(l)&&s){var t,r;const e=l,n=null==y||null==(t=y.nodesRef.current.find((e=>e.id===b)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",s.style.pointerEvents="auto",()=>{e.style.pointerEvents="",s.style.pointerEvents=""}}}}),[f,n,b,s,l,y,E,o,A]),c((()=>{n||(x.current=void 0,N(),D())}),[n,N,D]),u.useEffect((()=>()=>{N(),clearTimeout(I.current),clearTimeout(k.current),D()}),[f,l,N,D]),u.useMemo((()=>{if(!f)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===v||(clearTimeout(k.current),k.current=setTimeout((()=>{M.current||r(!0,e.nativeEvent)}),v))}},floating:{onMouseEnter(){clearTimeout(I.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),L(e.nativeEvent,!1)}}}}),[i,f,v,n,r,L])},e.useId=f,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:s}=t,a=Ke(s),f=u.useRef(!1),d=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{a((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(x())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{d.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{d.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,a]),u.useMemo((()=>i?{floating:{onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&f.current){if(null!==d.current){const t=e.scrollTop-d.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>a((e=>e+t))))}requestAnimationFrame((()=>{d.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,a])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>_e(t,e,"reference")),t),r=u.useCallback((t=>_e(t,e,"floating")),t),o=u.useCallback((t=>_e(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=function(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:l,map:s,elementsRef:a,labelsRef:f}=u.useContext(Ae),d=u.useCallback((e=>{if(o.current=e,null!==n&&(a.current[n]=e,f)){var r;const o=void 0!==t;f.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,a,f,t]);return c((()=>{const e=o.current;if(e)return i(e),()=>{l(e)}}),[i,l]),c((()=>{const e=o.current?s.get(o.current):null;null!=e&&r(e)}),[s]),u.useMemo((()=>({ref:d,index:null==n?-1:n})),[n,d])},e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:l}}=e,{listRef:s,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:m=null,allowEscape:p=!1,loop:v=!1,nested:g=!1,rtl:y=!1,virtual:b=!1,focusItemOnOpen:x="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:M=!0,disabledIndices:S,orientation:P="vertical",cols:A=1,scrollItemIntoView:N=!0}=t,D=j(),F=K(),H=Ke(f),q=u.useRef(x),_=u.useRef(null!=m?m:-1),W=u.useRef(null),U=u.useRef(!0),z=u.useRef(H),V=u.useRef(!!l),X=u.useRef(!1),Y=u.useRef(!1),G=B(S),Z=B(n),$=B(N),[Q,J]=u.useState(),ee=Ke((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(b?J(r.id):le(r,{preventScroll:!0,sync:!(!R().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!k())&&(We||X.current)}),requestAnimationFrame((()=>{const e=$.current;e&&r&&(n||!U.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));c((()=>{document.createElement("div").focus({get preventScroll(){return We=!0,!1}})}),[]),c((()=>{d&&(n&&l?q.current&&null!=m&&(Y.current=!0,H(m)):V.current&&(_.current=-1,z.current(null)))}),[d,n,l,m,H]),c((()=>{if(d&&n&&l)if(null==a){if(X.current=!1,null!=m)return;if(V.current&&(_.current=-1,ee(s,_)),!V.current&&q.current&&(null!=W.current||!0===q.current&&null==W.current)){let e=0;const t=()=>{if(null==s.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else _.current=null==W.current||Je(W.current,P,y)||g?et(s,G.current):tt(s,G.current),W.current=null,H(_.current)};t()}}else Ge(s,a)||(_.current=a,ee(s,_,Y.current),Y.current=!1)}),[d,n,l,a,m,g,s,P,y,H,ee,G]),c((()=>{if(d&&V.current&&!l&&F){var e,t;const n=F.nodesRef.current,r=null==(e=n.find((e=>e.id===D)))||null==(t=e.context)?void 0:t.elements.floating,o=E(T(l)),u=n.some((e=>e.context&&w(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[d,l,F,D]),c((()=>{z.current=H,V.current=!!l})),c((()=>{n||(W.current=null)}),[n]);const te=null!=a,ne=u.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&H(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...C&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;U.current&&"touch"!==t&&(_.current=-1,ee(s,_),H(null),b||le(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ee,C,s,H,b]);return u.useMemo((()=>{if(!d)return{};const e=G.current;function t(t){if(U.current=!1,X.current=!0,!Z.current&&t.currentTarget===o.floating.current)return;if(g&&function(e,t,n){return $e(t,n?e===Xe:e===Ve,e===Ue)}(t.key,P,y))return L(t),r(!1,t.nativeEvent),void(h(i)&&i.focus());const u=_.current,c=et(s,e),l=tt(s,e);if("Home"===t.key&&(L(t),_.current=c,H(_.current)),"End"===t.key&&(L(t),_.current=l,H(_.current)),A>1){const n=_.current;if(t.key===Ue){if(L(t),-1===n)_.current=l;else if(_.current=Ze(s,{startingIndex:n,amount:A,decrement:!0,disabledIndices:e}),v&&(n-A<c||_.current<0)){const e=n%A,t=l%A,r=l-(t-e);_.current=t===e?l:t>e?r:r-A}Ge(s,_.current)&&(_.current=n),H(_.current)}if(t.key===ze&&(L(t),-1===n?_.current=c:(_.current=Ze(s,{startingIndex:n,amount:A,disabledIndices:e}),v&&n+A>l&&(_.current=Ze(s,{startingIndex:n%A-A,amount:A,disabledIndices:e}))),Ge(s,_.current)&&(_.current=n),H(_.current)),"both"===P){const r=Math.floor(n/A);t.key===Xe&&(L(t),n%A!=A-1?(_.current=Ze(s,{startingIndex:n,disabledIndices:e}),v&&Ye(_.current,A,r)&&(_.current=Ze(s,{startingIndex:n-n%A-1,disabledIndices:e}))):v&&(_.current=Ze(s,{startingIndex:n-n%A-1,disabledIndices:e})),Ye(_.current,A,r)&&(_.current=n)),t.key===Ve&&(L(t),n%A!=0?(_.current=Ze(s,{startingIndex:n,disabledIndices:e,decrement:!0}),v&&Ye(_.current,A,r)&&(_.current=Ze(s,{startingIndex:n+(A-n%A),decrement:!0,disabledIndices:e}))):v&&(_.current=Ze(s,{startingIndex:n+(A-n%A),decrement:!0,disabledIndices:e})),Ye(_.current,A,r)&&(_.current=n));const o=Math.floor(l/A)===r;return Ge(s,_.current)&&(_.current=v&&o?t.key===Ve?l:Ze(s,{startingIndex:n-n%A-1,disabledIndices:e}):n),void H(_.current)}}if(Qe(t.key,P)){if(L(t),n&&!b&&E(t.currentTarget.ownerDocument)===t.currentTarget)return _.current=Je(t.key,P,y)?c:l,void H(_.current);Je(t.key,P,y)?_.current=v?u>=l?p&&u!==s.current.length?-1:c:Ze(s,{startingIndex:u,disabledIndices:e}):Math.min(l,Ze(s,{startingIndex:u,disabledIndices:e})):_.current=v?u<=c?p&&-1!==u?s.current.length:l:Ze(s,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,Ze(s,{startingIndex:u,decrement:!0,disabledIndices:e})),Ge(s,_.current)?H(null):H(_.current)}}function u(e){"auto"===x&&I(e.nativeEvent)&&(q.current=!0)}const c=b&&n&&te&&{"aria-activedescendant":Q};return{reference:{...c,onKeyDown(o){U.current=!1;const u=0===o.key.indexOf("Arrow");if(b&&n)return t(o);if(!n&&!M&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=Qe(o.key,P),l=function(e,t,n){return $e(t,n?e===Ve:e===Xe,e===ze)}(o.key,P,y);i&&(W.current=g&&c?null:o.key),g?l&&(L(o),n?(_.current=et(s,e),H(_.current)):r(!0,o.nativeEvent)):c&&(null!=m&&(_.current=m),L(o),!n&&M?r(!0,o.nativeEvent):t(o),n&&H(_.current))},onFocus(){n&&H(null)},onPointerDown:function(e){q.current=x,"auto"===x&&O(e.nativeEvent)&&(q.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===P?void 0:P,...c,onKeyDown:t,onPointerMove(){U.current=!0}},item:ne}}),[i,o,Q,G,Z,s,d,P,y,b,n,te,g,m,M,p,A,v,x,H,r,ne])},e.useMergeRefs=function(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)},e.useRole=function(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,c=f();return u.useMemo((()=>{const e={id:r,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?r:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:c}},floating:{...e,..."menu"===i&&{"aria-labelledby":c}}}:{}}),[o,i,n,r,c])},e.useTransitionStatus=ot,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:l=250}=t,s=e.placement,a=s.split("-")[0],f=u.useMemo((()=>({side:a,placement:s})),[a,s]),d="number"==typeof l,m=(d?l:l.open)||0,p=(d?l:l.close)||0,[v,g]=u.useState((()=>({...rt(i,f),...rt(n,f)}))),{isMounted:h,status:y}=ot(e,{duration:l}),b=B(n),E=B(r),w=B(o),R=B(i);return c((()=>{const e=rt(b.current,f),t=rt(w.current,f),n=rt(R.current,f),r=rt(E.current,f)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&g({transitionProperty:Object.keys(r).map(nt).join(","),transitionDuration:m+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(nt).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,b,E,R,m,y,f]),{isMounted:h,styles:v}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:l,onMatch:s,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:m=750,ignoreKeys:p=[],selectedIndex:v=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=v?v:l)?n:-1),b=u.useRef(null),E=Ke(s),w=Ke(a),R=B(d),x=B(p);return c((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),c((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=v?v:l)?e:-1)}),[r,v,l]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=R.current?R.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&L(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(L(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),m);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,m,x,R,E,w])}})); |
{ | ||
"name": "@floating-ui/react", | ||
"version": "0.25.0", | ||
"version": "0.25.1", | ||
"@rollingversions": { | ||
@@ -23,3 +23,3 @@ "baseVersion": [ | ||
"import": { | ||
"types": "./src/types.d.mts", | ||
"types": "./src/types.d.ts", | ||
"default": "./dist/floating-ui.react.mjs" | ||
@@ -68,4 +68,3 @@ }, | ||
"@floating-ui/react-dom": "^2.0.1", | ||
"@floating-ui/utils": "^0.1.0", | ||
"aria-hidden": "^1.2.3", | ||
"@floating-ui/utils": "^0.1.1", | ||
"tabbable": "^6.0.1" | ||
@@ -72,0 +71,0 @@ }, |
import * as React from 'react'; | ||
import type { FloatingContext } from '../types'; | ||
export interface FloatingArrowProps extends React.SVGAttributes<SVGSVGElement> { | ||
context: FloatingContext; | ||
/** | ||
* The floating context. | ||
*/ | ||
context: Omit<FloatingContext, 'refs'> & { | ||
refs: any; | ||
}; | ||
/** | ||
* Width of the arrow. | ||
@@ -7,0 +12,0 @@ * @default 14 |
import * as React from 'react'; | ||
import { FloatingContext } from '../types'; | ||
type FocusManagerState = (FloatingContext & { | ||
import type { ExtendedRefs } from '../types'; | ||
type FocusManagerState = { | ||
modal: boolean; | ||
open: boolean; | ||
onOpenChange: (open: boolean, event: Event) => void; | ||
refs: ExtendedRefs<any>; | ||
closeOnFocusOut: boolean; | ||
}) | null; | ||
} | null; | ||
export declare function useFloatingPortalNode({ id, root, }?: { | ||
@@ -8,0 +11,0 @@ id?: string; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
12911
572950
42
- Removedaria-hidden@^1.2.3
- Removedaria-hidden@1.2.4(transitive)
- Removedtslib@2.8.1(transitive)
Updated@floating-ui/utils@^0.1.1