Socket
Socket
Sign inDemoInstall

@floating-ui/react

Package Overview
Dependencies
Maintainers
0
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@floating-ui/react - npm Package Compare versions

Comparing version 0.26.22 to 0.26.23

2

dist/floating-ui.react.d.ts

@@ -626,3 +626,3 @@ import { AlignedPlacement } from '@floating-ui/react-dom';

export declare type OpenChangeReason = 'outside-press' | 'escape-key' | 'ancestor-scroll' | 'reference-press' | 'click' | 'hover' | 'focus' | 'list-navigation' | 'safe-polygon';
export declare type OpenChangeReason = 'outside-press' | 'escape-key' | 'ancestor-scroll' | 'reference-press' | 'click' | 'hover' | 'focus' | 'focus-out' | 'list-navigation' | 'safe-polygon';

@@ -629,0 +629,0 @@ export { Padding }

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("@floating-ui/react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","@floating-ui/react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.React,e.ReactDOM,e.FloatingUIReactDOM)}(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(t),i=o(n);function c(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)}const l={...u},s=l.useInsertionEffect||(e=>e());function a(e){const t=u.useRef((()=>{}));return s((()=>{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 f(e){return m(e)?(e.nodeName||"").toLowerCase():"#document"}function d(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function m(e){return e instanceof Node||e instanceof d(e).Node}function v(e){return e instanceof Element||e instanceof d(e).Element}function p(e){return e instanceof HTMLElement||e instanceof d(e).HTMLElement}function g(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof d(e).ShadowRoot)}function h(e){return["html","body","#document"].includes(f(e))}function y(e){return d(e).getComputedStyle(e)}function b(e){if("html"===f(e))return e;const t=e.assignedSlot||e.parentNode||g(e)&&e.host||function(e){var t;return null==(t=(m(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return g(t)?t.host:t}function w(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function E(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&g(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){return!(0!==e.mozInputSource||!e.isTrusted)||(O()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function k(e){return!x().includes("jsdom/")&&(!O()&&0===e.width&&0===e.height||O()&&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&&"touch"===e.pointerType)}function M(){return/apple/i.test(navigator.vendor)}function O(){const e=/android/i;return e.test(R())||e.test(x())}function C(){return R().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function T(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function S(e){return(null==e?void 0:e.ownerDocument)||document}function P(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 L(e){return"composedPath"in e?e.composedPath()[0]:e.target}const A="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function N(e){return p(e)&&e.matches(A)}function D(e){e.preventDefault(),e.stopPropagation()}function F(e){return!!e&&("combobox"===e.getAttribute("role")&&N(e))}const j=Math.floor;const K="ArrowUp",H="ArrowDown",q="ArrowLeft",_="ArrowRight";function B(e,t,n){return Math.floor(e/t)!==n}function W(e,t){return t<0||t>=e.current.length}function U(e,t){return X(e,{disabledIndices:t})}function z(e,t){return X(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function X(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{c+=r?-u:u}while(c>=0&&c<=i.length-1&&$(i,c,o));return c}function Y(e,t){let{event:n,orientation:r,loop:o,cols:u,disabledIndices:i,minIndex:c,maxIndex:l,prevIndex:s,stopEvent:a=!1}=t,f=s;if(n.key===K){if(a&&D(n),-1===s)f=l;else if(f=X(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:i}),o&&(s-u<c||f<0)){const e=s%u,t=l%u,n=l-(t-e);f=t===e?l:t>e?n:n-u}W(e,f)&&(f=s)}if(n.key===H&&(a&&D(n),-1===s?f=c:(f=X(e,{startingIndex:s,amount:u,disabledIndices:i}),o&&s+u>l&&(f=X(e,{startingIndex:s%u-u,amount:u,disabledIndices:i}))),W(e,f)&&(f=s)),"both"===r){const t=j(s/u);n.key===_&&(a&&D(n),s%u!=u-1?(f=X(e,{startingIndex:s,disabledIndices:i}),o&&B(f,u,t)&&(f=X(e,{startingIndex:s-s%u-1,disabledIndices:i}))):o&&(f=X(e,{startingIndex:s-s%u-1,disabledIndices:i})),B(f,u,t)&&(f=s)),n.key===q&&(a&&D(n),s%u!=0?(f=X(e,{startingIndex:s,decrement:!0,disabledIndices:i}),o&&B(f,u,t)&&(f=X(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i}))):o&&(f=X(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i})),B(f,u,t)&&(f=s));const r=j(l/u)===t;W(e,f)&&(f=o&&r?n.key===q?l:X(e,{startingIndex:s-s%u-1,disabledIndices:i}):s)}return f}function V(e,t,n){const r=[];let o=0;return e.forEach(((e,u)=>{let{width:i,height:c}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<c;r++)e.push(o+n+r*t);o%t+i<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=u})),l=!0):o++}})),[...r]}function G(e,t,n,r,o){if(-1===e)return-1;const u=n.indexOf(e),i=t[e];switch(o){case"tl":return u;case"tr":return i?u+i.width-1:u;case"bl":return i?u+(i.height-1)*r:u;case"br":return n.lastIndexOf(e)}}function Z(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function $(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Q=0;function J(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Q);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():Q=requestAnimationFrame(u)}var ee="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function te(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 ne=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function re(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,i]=u.useState((()=>new Map)),c=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return ee((()=>{const e=new Map(o);Array.from(e.keys()).sort(te).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(ne.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function oe(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:i,labelsRef:c}=u.useContext(ne),[l,s]=u.useState(null),a=u.useRef(null),f=u.useCallback((e=>{if(a.current=e,null!==l&&(i.current[l]=e,c)){var n;const r=void 0!==t;c.current[l]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}}),[l,i,c,t]);return ee((()=>{const e=a.current;if(e)return n(e),()=>{r(e)}}),[n,r]),ee((()=>{const e=a.current?o.get(a.current):null;null!=e&&s(e)}),[o]),u.useMemo((()=>({ref:f,index:null==l?-1:l})),[l,f])}function ue(e,t){return"function"==typeof e?e(t):e?u.cloneElement(e,t):u.createElement("div",t)}const ie=u.createContext({activeIndex:0,onNavigate:()=>{}}),ce=[q,_],le=[K,H],se=[...ce,...le],ae=u.forwardRef((function(e,t){const{render:n,orientation:r="both",loop:o=!0,cols:i=1,disabledIndices:c,activeIndex:l,onNavigate:s,itemSizes:f,dense:d=!1,...m}=e,[v,p]=u.useState(0),g=null!=l?l:v,h=a(null!=s?s:p),y=u.useRef([]),b=n&&"function"!=typeof n?n.props:{},w=u.useMemo((()=>({activeIndex:g,onNavigate:h})),[g,h]),E=i>1;const R={...m,...b,ref:t,"aria-orientation":"both"===r?void 0:r,onKeyDown(e){null==m.onKeyDown||m.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!se.includes(e.key))return;let t=g;const n=U(y,c),u=z(y,c);if(E){const l=f||Array.from({length:y.current.length},(()=>({width:1,height:1}))),s=V(l,i,d),a=s.findIndex((e=>null!=e&&!$(y.current,e,c))),m=s.reduce(((e,t,n)=>null==t||$(y.current,t,c)?e:n),-1);t=s[Y({current:s.map((e=>e?y.current[e]:null))},{event:e,orientation:r,loop:o,cols:i,disabledIndices:Z([...c||y.current.map(((e,t)=>$(y.current,t)?t:void 0)),void 0],s),minIndex:a,maxIndex:m,prevIndex:G(g>u?n:g,l,s,i,e.key===H?"bl":e.key===_?"tr":"tl")})]}const l={horizontal:[_],vertical:[H],both:[_,H]}[r],s={horizontal:[q],vertical:[K],both:[q,K]}[r],a=E?se:{horizontal:ce,vertical:le,both:se}[r];t===g&&[...l,...s].includes(e.key)&&(t=o&&t===u&&l.includes(e.key)?n:o&&t===n&&s.includes(e.key)?u:X(y,{startingIndex:t,decrement:s.includes(e.key),disabledIndices:c})),t===g||W(y,t)||(e.stopPropagation(),a.includes(e.key)&&e.preventDefault(),h(t),queueMicrotask((()=>{J(y.current[t])})))}(e)}};return u.createElement(ie.Provider,{value:w},u.createElement(re,{elementsRef:y},ue(n,R)))})),fe=u.forwardRef((function(e,t){const{render:n,...r}=e,o=n&&"function"!=typeof n?n.props:{},{activeIndex:i,onNavigate:l}=u.useContext(ie),{ref:s,index:a}=oe(),f=c([s,t,o.ref]),d=i===a;return ue(n,{...r,...o,ref:f,tabIndex:d?0:-1,"data-active":d?"":void 0,onFocus(e){null==r.onFocus||r.onFocus(e),null==o.onFocus||o.onFocus(e),l(a)}})}));function de(){return de=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},de.apply(this,arguments)}let me=!1,ve=0;const pe=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ve++;const ge=l.useId||function(){const[e,t]=u.useState((()=>me?pe():void 0));return ee((()=>{null==e&&t(pe())}),[]),u.useEffect((()=>{me=!0}),[]),e},he=u.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o}},width:i=14,height:c=7,tipRadius:l=0,strokeWidth:s=0,staticOffset:a,stroke:f,d:d,style:{transform:m,...v}={},...p}=e,g=ge(),[h,b]=u.useState(!1);if(ee((()=>{if(!r)return;"rtl"===y(r).direction&&b(!0)}),[r]),!r)return null;const w=2*s,E=w/2,R=i/2*(l/-8+1),x=c/2*l/4,[I,k]=n.split("-"),M=!!d,O="top"===I||"bottom"===I,C=a&&"end"===k?"bottom":"top";let T=a&&"end"===k?"right":"left";a&&h&&(T="end"===k?"left":"right");const S=null!=(null==o?void 0:o.x)?a||o.x:"",P=null!=(null==o?void 0:o.y)?a||o.y:"",L=d||"M0,0 H"+i+" L"+(i-R)+","+(c-x)+" Q"+i/2+","+c+" "+R+","+(c-x)+" Z",A={top:M?"rotate(180deg)":"",left:M?"rotate(90deg)":"rotate(-90deg)",bottom:M?"":"rotate(180deg)",right:M?"rotate(-90deg)":"rotate(90deg)"}[I];return u.createElement("svg",de({},p,{"aria-hidden":!0,ref:t,width:M?i:i+w,height:i,viewBox:"0 0 "+i+" "+(c>i?c:i),style:{position:"absolute",pointerEvents:"none",[T]:S,[C]:P,[I]:O||M?"100%":"calc(100% - "+w/2+"px)",transform:""+A+(null!=m?m:""),...v}}),w>0&&u.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:f,strokeWidth:w+(d?0:1),d:L}),u.createElement("path",{stroke:w&&!d?p.fill:"none",d:L}),u.createElement("clipPath",{id:g},u.createElement("rect",{x:-E,y:E*(M?-1:1),width:i+w,height:i})))}));function ye(){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 be=u.createContext(null),we=u.createContext(null),Ee=()=>{var e;return(null==(e=u.useContext(be))?void 0:e.id)||null},Re=()=>u.useContext(we);function xe(e){return"data-floating-ui-"+e}function Ie(e){const n=t.useRef(e);return ee((()=>{n.current=e})),n}const ke=xe("safe-polygon");function Me(e,t,n){return n&&!T(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const Oe=()=>{},Ce=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Oe,setState:Oe,isInstantPhase:!1}),Te=()=>u.useContext(Ce);
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("@floating-ui/react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","@floating-ui/react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.React,e.ReactDOM,e.FloatingUIReactDOM)}(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(t),i=o(n);function c(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)}const l={...u},s=l.useInsertionEffect||(e=>e());function a(e){const t=u.useRef((()=>{}));return s((()=>{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 f(e){return m(e)?(e.nodeName||"").toLowerCase():"#document"}function d(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function m(e){return e instanceof Node||e instanceof d(e).Node}function v(e){return e instanceof Element||e instanceof d(e).Element}function p(e){return e instanceof HTMLElement||e instanceof d(e).HTMLElement}function g(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof d(e).ShadowRoot)}function h(e){return["html","body","#document"].includes(f(e))}function y(e){return d(e).getComputedStyle(e)}function b(e){if("html"===f(e))return e;const t=e.assignedSlot||e.parentNode||g(e)&&e.host||function(e){var t;return null==(t=(m(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return g(t)?t.host:t}function E(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function w(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&g(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){return!(0!==e.mozInputSource||!e.isTrusted)||(O()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function k(e){return!x().includes("jsdom/")&&(!O()&&0===e.width&&0===e.height||O()&&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&&"touch"===e.pointerType)}function M(){return/apple/i.test(navigator.vendor)}function O(){const e=/android/i;return e.test(R())||e.test(x())}function C(){return R().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function T(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function S(e){return(null==e?void 0:e.ownerDocument)||document}function P(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 L(e){return"composedPath"in e?e.composedPath()[0]:e.target}const A="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function N(e){return p(e)&&e.matches(A)}function D(e){e.preventDefault(),e.stopPropagation()}function F(e){return!!e&&("combobox"===e.getAttribute("role")&&N(e))}const j=Math.floor;const K="ArrowUp",H="ArrowDown",q="ArrowLeft",_="ArrowRight";function B(e,t,n){return Math.floor(e/t)!==n}function W(e,t){return t<0||t>=e.current.length}function U(e,t){return X(e,{disabledIndices:t})}function z(e,t){return X(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function X(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{c+=r?-u:u}while(c>=0&&c<=i.length-1&&$(i,c,o));return c}function Y(e,t){let{event:n,orientation:r,loop:o,cols:u,disabledIndices:i,minIndex:c,maxIndex:l,prevIndex:s,stopEvent:a=!1}=t,f=s;if(n.key===K){if(a&&D(n),-1===s)f=l;else if(f=X(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:i}),o&&(s-u<c||f<0)){const e=s%u,t=l%u,n=l-(t-e);f=t===e?l:t>e?n:n-u}W(e,f)&&(f=s)}if(n.key===H&&(a&&D(n),-1===s?f=c:(f=X(e,{startingIndex:s,amount:u,disabledIndices:i}),o&&s+u>l&&(f=X(e,{startingIndex:s%u-u,amount:u,disabledIndices:i}))),W(e,f)&&(f=s)),"both"===r){const t=j(s/u);n.key===_&&(a&&D(n),s%u!=u-1?(f=X(e,{startingIndex:s,disabledIndices:i}),o&&B(f,u,t)&&(f=X(e,{startingIndex:s-s%u-1,disabledIndices:i}))):o&&(f=X(e,{startingIndex:s-s%u-1,disabledIndices:i})),B(f,u,t)&&(f=s)),n.key===q&&(a&&D(n),s%u!=0?(f=X(e,{startingIndex:s,decrement:!0,disabledIndices:i}),o&&B(f,u,t)&&(f=X(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i}))):o&&(f=X(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i})),B(f,u,t)&&(f=s));const r=j(l/u)===t;W(e,f)&&(f=o&&r?n.key===q?l:X(e,{startingIndex:s-s%u-1,disabledIndices:i}):s)}return f}function V(e,t,n){const r=[];let o=0;return e.forEach(((e,u)=>{let{width:i,height:c}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<c;r++)e.push(o+n+r*t);o%t+i<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=u})),l=!0):o++}})),[...r]}function G(e,t,n,r,o){if(-1===e)return-1;const u=n.indexOf(e),i=t[e];switch(o){case"tl":return u;case"tr":return i?u+i.width-1:u;case"bl":return i?u+(i.height-1)*r:u;case"br":return n.lastIndexOf(e)}}function Z(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function $(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Q=0;function J(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Q);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():Q=requestAnimationFrame(u)}var ee="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function te(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 ne=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function re(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,i]=u.useState((()=>new Map)),c=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return ee((()=>{const e=new Map(o);Array.from(e.keys()).sort(te).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(ne.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function oe(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:i,labelsRef:c}=u.useContext(ne),[l,s]=u.useState(null),a=u.useRef(null),f=u.useCallback((e=>{if(a.current=e,null!==l&&(i.current[l]=e,c)){var n;const r=void 0!==t;c.current[l]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}}),[l,i,c,t]);return ee((()=>{const e=a.current;if(e)return n(e),()=>{r(e)}}),[n,r]),ee((()=>{const e=a.current?o.get(a.current):null;null!=e&&s(e)}),[o]),u.useMemo((()=>({ref:f,index:null==l?-1:l})),[l,f])}function ue(e,t){return"function"==typeof e?e(t):e?u.cloneElement(e,t):u.createElement("div",t)}const ie=u.createContext({activeIndex:0,onNavigate:()=>{}}),ce=[q,_],le=[K,H],se=[...ce,...le],ae=u.forwardRef((function(e,t){const{render:n,orientation:r="both",loop:o=!0,cols:i=1,disabledIndices:c,activeIndex:l,onNavigate:s,itemSizes:f,dense:d=!1,...m}=e,[v,p]=u.useState(0),g=null!=l?l:v,h=a(null!=s?s:p),y=u.useRef([]),b=n&&"function"!=typeof n?n.props:{},E=u.useMemo((()=>({activeIndex:g,onNavigate:h})),[g,h]),w=i>1;const R={...m,...b,ref:t,"aria-orientation":"both"===r?void 0:r,onKeyDown(e){null==m.onKeyDown||m.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!se.includes(e.key))return;let t=g;const n=U(y,c),u=z(y,c);if(w){const l=f||Array.from({length:y.current.length},(()=>({width:1,height:1}))),s=V(l,i,d),a=s.findIndex((e=>null!=e&&!$(y.current,e,c))),m=s.reduce(((e,t,n)=>null==t||$(y.current,t,c)?e:n),-1),v=s[Y({current:s.map((e=>e?y.current[e]:null))},{event:e,orientation:r,loop:o,cols:i,disabledIndices:Z([...c||y.current.map(((e,t)=>$(y.current,t)?t:void 0)),void 0],s),minIndex:a,maxIndex:m,prevIndex:G(g>u?n:g,l,s,i,e.key===H?"bl":e.key===_?"tr":"tl")})];null!=v&&(t=v)}const l={horizontal:[_],vertical:[H],both:[_,H]}[r],s={horizontal:[q],vertical:[K],both:[q,K]}[r],a=w?se:{horizontal:ce,vertical:le,both:se}[r];t===g&&[...l,...s].includes(e.key)&&(t=o&&t===u&&l.includes(e.key)?n:o&&t===n&&s.includes(e.key)?u:X(y,{startingIndex:t,decrement:s.includes(e.key),disabledIndices:c})),t===g||W(y,t)||(e.stopPropagation(),a.includes(e.key)&&e.preventDefault(),h(t),queueMicrotask((()=>{J(y.current[t])})))}(e)}};return u.createElement(ie.Provider,{value:E},u.createElement(re,{elementsRef:y},ue(n,R)))})),fe=u.forwardRef((function(e,t){const{render:n,...r}=e,o=n&&"function"!=typeof n?n.props:{},{activeIndex:i,onNavigate:l}=u.useContext(ie),{ref:s,index:a}=oe(),f=c([s,t,o.ref]),d=i===a;return ue(n,{...r,...o,ref:f,tabIndex:d?0:-1,"data-active":d?"":void 0,onFocus(e){null==r.onFocus||r.onFocus(e),null==o.onFocus||o.onFocus(e),l(a)}})}));function de(){return de=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},de.apply(this,arguments)}let me=!1,ve=0;const pe=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ve++;const ge=l.useId||function(){const[e,t]=u.useState((()=>me?pe():void 0));return ee((()=>{null==e&&t(pe())}),[]),u.useEffect((()=>{me=!0}),[]),e},he=u.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o,shift:i}},width:c=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:m,style:{transform:v,...p}={},...g}=e,h=ge(),[b,E]=u.useState(!1);if(ee((()=>{if(!r)return;"rtl"===y(r).direction&&E(!0)}),[r]),!r)return null;const[w,R]=n.split("-"),x="top"===w||"bottom"===w;let I=f;(x&&null!=i&&i.x||!x&&null!=i&&i.y)&&(I=null);const k=2*a,M=k/2,O=c/2*(s/-8+1),C=l/2*s/4,T=!!m,S=I&&"end"===R?"bottom":"top";let P=I&&"end"===R?"right":"left";I&&b&&(P="end"===R?"left":"right");const L=null!=(null==o?void 0:o.x)?I||o.x:"",A=null!=(null==o?void 0:o.y)?I||o.y:"",N=m||"M0,0 H"+c+" L"+(c-O)+","+(l-C)+" Q"+c/2+","+l+" "+O+","+(l-C)+" Z",D={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[w];return u.createElement("svg",de({},g,{"aria-hidden":!0,ref:t,width:T?c:c+k,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[P]:L,[S]:A,[w]:x||T?"100%":"calc(100% - "+k/2+"px)",transform:""+D+(null!=v?v:""),...p}}),k>0&&u.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:k+(m?0:1),d:N}),u.createElement("path",{stroke:k&&!m?g.fill:"none",d:N}),u.createElement("clipPath",{id:h},u.createElement("rect",{x:-M,y:M*(T?-1:1),width:c+k,height:c})))}));function ye(){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 be=u.createContext(null),Ee=u.createContext(null),we=()=>{var e;return(null==(e=u.useContext(be))?void 0:e.id)||null},Re=()=>u.useContext(Ee);function xe(e){return"data-floating-ui-"+e}function Ie(e){const n=t.useRef(e);return ee((()=>{n.current=e})),n}const ke=xe("safe-polygon");function Me(e,t,n){return n&&!T(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const Oe=()=>{},Ce=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Oe,setState:Oe,isInstantPhase:!1}),Te=()=>u.useContext(Ce);
/*!

@@ -6,2 +6,2 @@ * tabbable 6.2.0

*/
var Se=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Pe="undefined"==typeof Element,Le=Pe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ae=!Pe&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Ne=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},De=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if(!Ne(i,!1))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{Le.call(i,Se)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!Ne(s,!1)&&(!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},Fe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},je=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Fe(e)?0:e.tabIndex},Ke=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},He=function(e){return"INPUT"===e.tagName},qe=function(e){return function(e){return He(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ae(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)},_e=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Be=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Le.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Le.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return _e(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=Ae(e);if(i&&!i.shadowRoot&&!0===r(i))return _e(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){var t,n,r,o,u=e&&Ae(e),i=null===(t=u)||void 0===t?void 0:t.host,c=!1;if(u&&u!==e)for(c=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&i;){var l,s,a;c=!(null===(s=i=null===(l=u=Ae(i))||void 0===l?void 0:l.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(i))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},We=function(e,t){return!(t.disabled||Ne(t)||function(e){return He(e)&&"hidden"===e.type}(t)||Be(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!!Le.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ue=function(e,t){return!(qe(t)||je(t)<0||!We(e,t))},ze=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Xe=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=function(e,t){var n=je(e);return n<0&&t&&!Fe(e)?0:n}(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(Ke).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ye=function(e,t){var n;return n=(t=t||{}).getShadowRoot?De([e],t.includeContainer,{filter:Ue.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ze}):function(e,t,n){if(Ne(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Se));return t&&Le.call(e,Se)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Ue.bind(null,t)),Xe(n)},Ve=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Le.call(e,Se)&&Ue(t,e)};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}let Ze=new WeakMap,$e=new WeakSet,Qe={},Je=0;const et=e=>e&&(e.host||et(e.parentNode)),tt=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=et(t);return e.contains(n)?n:null})).filter((e=>null!=e));function nt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=S(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=tt(t,e),c=new Set,l=new Set(i),s=[];Qe[o]||(Qe[o]=new WeakMap);const a=Qe[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)&&[].forEach.call(t.children,(t=>{if("script"!==f(t))if(c.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(Ze.get(t)||0)+1,i=(a.get(t)||0)+1;Ze.set(t,r),a.set(t,i),s.push(t),1===r&&n&&$e.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),c.clear(),Je++,()=>{s.forEach((e=>{const t=(Ze.get(e)||0)-1,n=(a.get(e)||0)-1;Ze.set(e,t),a.set(e,n),t||(!$e.has(e)&&u&&e.removeAttribute(u),$e.delete(e)),n||e.removeAttribute(o)})),Je--,Je||(Ze=new WeakMap,Ze=new WeakMap,$e=new WeakSet,Qe={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const rt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ot(e,t){const n=Ye(e,rt());"prev"===t&&n.reverse();const r=n.indexOf(w(S(e)));return n.slice(r+1)[0]}function ut(){return ot(document.body,"next")}function it(){return ot(document.body,"prev")}function ct(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!E(n,r)}function lt(e){Ye(e,rt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function st(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 at={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 ft(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const dt=u.forwardRef((function(e,t){const[n,r]=u.useState();ee((()=>(M()&&r("button"),document.addEventListener("keydown",ft),()=>{document.removeEventListener("keydown",ft)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[xe("focus-guard")]:"",style:at};return u.createElement("span",de({},e,o))})),mt=u.createContext(null),vt=xe("portal");function pt(e){void 0===e&&(e={});const{id:t,root:n}=e,r=ge(),o=gt(),[i,c]=u.useState(null),l=u.useRef(null);return ee((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{l.current=null}))}),[i]),ee((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(vt,""),e.appendChild(n),l.current=n,c(n)}),[t,r]),ee((()=>{if(!r)return;if(l.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!v(e)&&(e=e.current),e=e||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,e.appendChild(u));const i=document.createElement("div");i.id=r,i.setAttribute(vt,""),e=u||e,e.appendChild(i),l.current=i,c(i)}),[t,n,r,o]),i}const gt=()=>u.useContext(mt),ht=20;let yt=[];function bt(e){yt=yt.filter((e=>e.isConnected));let t=e;if(t&&"body"!==f(t)){if(!Ve(t,rt())){const e=Ye(t,rt())[0];e&&(t=e)}yt.push(t),yt.length>ht&&(yt=yt.slice(-ht))}}function wt(){return yt.slice().reverse().find((e=>e.isConnected))}const Et=u.forwardRef((function(e,t){return u.createElement("button",de({},e,{type:"button",ref:t,tabIndex:-1,style:at}))}));const Rt=new Set,xt=u.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e,o=ge();return ee((()=>{if(!n)return;Rt.add(o);const e=/iP(hone|ad|od)|iOS/.test(R()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,i=t.left?parseFloat(t.left):window.scrollX,c=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",u&&(t[r]=u+"px"),e){var l,s;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(c-Math.floor(n))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{Rt.delete(o),0===Rt.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,c)))}}),[o,n]),u.createElement("div",de({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function It(e){return p(e.target)&&"BUTTON"===e.target.tagName}function kt(e){return N(e)}function Mt(e){return null!=e&&null!=e.clientX}const Ot={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ct={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Tt=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function St(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ge(),i=u.useRef({}),[c]=u.useState((()=>ye())),l=null!=Ee(),[s,f]=u.useState(r.reference),d=a(((e,t,r)=>{i.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),m=u.useMemo((()=>({setPositionReference:f})),[]),v=u.useMemo((()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference})),[s,r.reference,r.floating]);return u.useMemo((()=>({dataRef:i,open:t,onOpenChange:d,elements:v,events:c,floatingId:o,refs:m})),[t,d,v,c,o,m])}const Pt="active",Lt="selected";function At(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[Pt]:t,[Lt]:n,...r}=e;u=r}return{..."floating"===n&&{tabIndex:-1},...u,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,u]=t;var i;o&&[Pt,Lt].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof u&&(null==(i=r.get(n))||i.push(u),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]=u)})),e):e),{})}}let Nt=!1;function Dt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ft(e,t){return Dt(t,e===K||e===H,e===q||e===_)}function jt(e,t,n){return Dt(t,e===H,n?e===q:e===_)||"Enter"===e||" "===e||""===e}function Kt(e,t,n){return Dt(t,n?e===_:e===q,e===K)}const Ht=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const qt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function _t(e,t){return"function"==typeof e?e(t):e}function Bt(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,[c,l]=u.useState("unmounted"),s=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,i);return s||"close"!==c||l("unmounted"),ee((()=>{if(r){if(n){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[n,r]),{isMounted:s,status:c}}function Wt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function Ut(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 r.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return r.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return r.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return r.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return r.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return r.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return r.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return r.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return r.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return r.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return r.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return r.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return r.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return r.size}}),e.Composite=ae,e.CompositeItem=fe,e.FloatingArrow=he,e.FloatingDelayGroup=function(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=u.useRef(null),l=u.useCallback((e=>{i({currentId:e})}),[]);return ee((()=>{o.currentId?null===c.current?c.current=o.currentId:o.isInstantPhase||i({isInstantPhase:!0}):(o.isInstantPhase&&i({isInstantPhase:!1}),c.current=null)}),[o.currentId,o.isInstantPhase]),u.createElement(Ce.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:l})),[o,l])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:c=0,returnFocus:l=!0,restoreFocus:s=!1,modal:f=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:m=!0}=e,{open:v,refs:g,nodeId:h,onOpenChange:y,events:b,dataRef:R,floatingId:x,elements:{domReference:M,floating:O}}=t,C="number"==typeof c&&c<0,T=F(M)&&C,P="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,A=Ie(o),N=Ie(c),j=Ie(l),K=Re(),H=gt(),q=u.useRef(null),_=u.useRef(null),B=u.useRef(!1),W=u.useRef(!1),U=u.useRef(-1),z=null!=H,X=null==O?void 0:O.firstElementChild,Y=(null==X?void 0:X.id)===x?X:O,V=a((function(e){return void 0===e&&(e=Y),e?Ye(e,rt()):[]})),G=a((e=>{const t=V(e);return A.current.map((e=>M&&"reference"===e?M:Y&&"floating"===e?Y:t)).filter(Boolean).flat()}));function Z(e){return!r&&d&&f?u.createElement(Et,{ref:"start"===e?q:_,onClick:e=>y(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}u.useEffect((()=>{if(r)return;if(!f)return;function e(e){if("Tab"===e.key){E(Y,w(S(Y)))&&0===V().length&&!T&&D(e);const t=G(),n=L(e);"reference"===A.current[0]&&n===M&&(D(e),e.shiftKey?J(t[t.length-1]):J(t[1])),"floating"===A.current[1]&&n===Y&&e.shiftKey&&(D(e),J(t[0]))}}const t=S(Y);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,M,Y,f,A,T,V,G]),u.useEffect((()=>{if(!r&&O)return O.addEventListener("focusin",e),()=>{O.removeEventListener("focusin",e)};function e(e){const t=L(e),n=V().indexOf(t);-1!==n&&(U.current=n)}}),[r,O,V]),u.useEffect((()=>{if(!r&&m)return O&&p(M)?(M.addEventListener("focusout",t),M.addEventListener("pointerdown",e),O.addEventListener("focusout",t),()=>{M.removeEventListener("focusout",t),M.removeEventListener("pointerdown",e),O.removeEventListener("focusout",t)}):void 0;function e(){W.current=!0,setTimeout((()=>{W.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(E(M,t)||E(O,t)||E(t,O)||E(null==H?void 0:H.portalNode,t)||null!=t&&t.hasAttribute(xe("focus-guard"))||K&&(Ge(K.nodesRef.current,h).find((e=>{var n,r;return E(null==(n=e.context)?void 0:n.elements.floating,t)||E(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}(K.nodesRef.current,h).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}))));if(s&&n&&w(S(Y))===S(Y).body){p(Y)&&(null==Y||Y.focus());const e=U.current,t=V(),n=t[e]||t[t.length-1]||Y;p(n)&&n.focus()}!T&&f||!t||!n||W.current||t===wt()||(B.current=!0,y(!1,e))}))}}),[r,M,O,Y,f,h,K,H,y,m,s,V,T]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==H||null==(e=H.portalNode)?void 0:e.querySelectorAll("["+xe("portal")+"]"))||[]);if(O){const e=[O,...t,q.current,_.current,A.current.includes("reference")||T?M:null].filter((e=>null!=e)),n=f||T?nt(e,P,!P):nt(e);return()=>{n()}}}),[r,M,O,f,A,H,T,P]),ee((()=>{if(r||!p(Y))return;const e=w(S(Y));queueMicrotask((()=>{const t=G(Y),n=N.current,r=("number"==typeof n?t[n]:n.current)||Y,o=E(Y,e);C||o||!v||J(r,{preventScroll:r===Y})}))}),[r,v,Y,C,G,N]),ee((()=>{if(r||!Y)return;let e=!1;const t=S(Y),n=w(t);let o=R.current.openEvent;const u=g.domReference.current;function i(t){let{open:n,reason:r,event:u,nested:i}=t;n&&(o=u),"escape-key"===r&&g.domReference.current&&bt(g.domReference.current),"hover"===r&&"mouseleave"===u.type&&(B.current=!0),"outside-press"===r&&(i?(B.current=!1,e=!0):B.current=!(I(u)||k(u)))}return bt(n),b.on("openchange",i),()=>{b.off("openchange",i);const r=w(t),c=E(O,r)||K&&Ge(K.nodesRef.current,h).some((e=>{var t;return E(null==(t=e.context)?void 0:t.elements.floating,r)}));(c||o&&["click","mousedown"].includes(o.type))&&g.domReference.current&&bt(g.domReference.current);const l=u||n,s=Ye(S(l).body,rt());queueMicrotask((()=>{let n=wt();!n&&p(l)&&O&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=xe("focus-guard");let u=r+(t?1:0),i=e[u];for(;i&&(!i.isConnected||i.hasAttribute(o)||E(n,i));)t?u++:u--,i=e[u];return i}return o(!0)||o(!1)}(s,l,O)),j.current&&!B.current&&p(n)&&(n===r||r===t.body||c)&&n.focus({preventScroll:e})}))}}),[r,O,Y,j,R,g,b,K,h]),ee((()=>{if(!r&&H)return H.setFocusManagerState({modal:f,closeOnFocusOut:m,open:v,onOpenChange:y,refs:g}),()=>{H.setFocusManagerState(null)}}),[r,H,f,v,y,g,m]),ee((()=>{if(r)return;if(!Y)return;if("function"!=typeof MutationObserver)return;if(C)return;const e=()=>{const e=Y.getAttribute("tabindex"),t=V(),n=w(S(O)),r=t.indexOf(n);-1!==r&&(U.current=r),A.current.includes("floating")||n!==g.domReference.current&&0===t.length?"0"!==e&&Y.setAttribute("tabindex","0"):"-1"!==e&&Y.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(Y,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,O,Y,g,A,V,C]);const $=!r&&P&&(!f||!T)&&(z||f);return u.createElement(u.Fragment,null,$&&u.createElement(dt,{"data-type":"inside",ref:null==H?void 0:H.beforeInsideRef,onFocus:e=>{if(f){const e=G();J("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=H&&H.preserveTabOrder&&H.portalNode)if(B.current=!1,ct(e,H.portalNode)){const e=ut()||M;null==e||e.focus()}else{var t;null==(t=H.beforeOutsideRef.current)||t.focus()}}}),!T&&Z("start"),n,Z("end"),$&&u.createElement(dt,{"data-type":"inside",ref:null==H?void 0:H.afterInsideRef,onFocus:e=>{if(f)J(G()[0]);else if(null!=H&&H.preserveTabOrder&&H.portalNode)if(m&&(B.current=!0),ct(e,H.portalNode)){const e=it()||M;null==e||e.focus()}else{var t;null==(t=H.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=re,e.FloatingNode=function(e){const{children:t,id:n}=e,r=Ee();return u.createElement(be.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=xt,e.FloatingPortal=function(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,c=pt({id:n,root:r}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=u.useRef(null),v=!!l&&!l.modal&&l.open&&o&&!(!r&&!c);return u.useEffect((()=>{if(c&&o&&(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&&ct(e)){("focusin"===e.type?st:lt)(c)}}}),[c,o,null==l?void 0:l.modal]),u.createElement(mt.Provider,{value:u.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:c,setFocusManagerState:s})),[o,c])},v&&c&&u.createElement(dt,{"data-type":"outside",ref:a,onFocus:e=>{if(ct(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=it()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),v&&c&&u.createElement("span",{"aria-owns":c.id,style:at}),c&&i.createPortal(t,c),v&&c&&u.createElement(dt,{"data-type":"outside",ref:f,onFocus:e=>{if(ct(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=ut()||(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){const{children:t}=e,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((()=>ye()))[0];return u.createElement(we.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:o,onFallbackChange:u,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=(v=t,"function"==typeof(m=e)?m(v):m);var m,v;const{rects:p,elements:{floating:g}}=t,h=n.current[l];if(!h)return{};const y={...t,...await r.offset(-h.offsetTop-g.clientTop-p.reference.height/2-h.offsetHeight/2-c).fn(t)},b=(null==f?void 0:f.current)||g,w=await r.detectOverflow(Wt(y,b.scrollHeight),d),E=await r.detectOverflow(y,{...d,elementContext:"reference"}),R=Math.max(0,w.top),x=y.y+R,I=Math.max(0,b.scrollHeight-R-Math.max(0,w.bottom));return b.style.maxHeight=I+"px",b.scrollTop=R,u&&(b.offsetHeight<h.offsetHeight*Math.min(s,n.current.length-1)-1||E.top>=-a||E.bottom>=-a?i.flushSync((()=>u(!0))):i.flushSync((()=>u(!1)))),o&&(o.current=await r.detectOverflow(Wt({...y,y:x},b.offsetHeight),d)),{y:x}}}),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 g(){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],w=L(e),R="mouseleave"===e.type,x=E(f.floating,w),I=E(f.domReference,w),k=f.domReference.getBoundingClientRect(),M=f.floating.getBoundingClientRect(),O=a.split("-")[0],C=n>M.right-M.width/2,T=s>M.bottom-M.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}(b,k),P=M.width>k.width,A=M.height>k.height,N=(P?k:M).left,D=(P?k:M).right,F=(A?k:M).top,j=(A?k:M).bottom;if(x&&(u=!0,!R))return;if(I&&(u=!1),I&&!R)return void(u=!0);if(R&&v(e.relatedTarget)&&E(f.floating,e.relatedTarget))return;if(p&&Ge(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===O&&s>=k.bottom-1||"bottom"===O&&s<=k.top+1||"left"===O&&n>=k.right-1||"right"===O&&n<=k.left+1)return g();let K=[];switch(O){case"top":K=[[N,k.top+1],[N,M.bottom-1],[D,M.bottom-1],[D,k.top+1]];break;case"bottom":K=[[N,M.top+1],[N,k.bottom-1],[D,k.bottom-1],[D,M.top+1]];break;case"left":K=[[M.right-1,j],[M.right-1,F],[k.left+1,F],[k.left+1,j]];break;case"right":K=[[k.right-1,j],[k.right-1,F],[M.left+1,F],[M.left+1,j]]}if(!Ut([h,y],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()}Ut([h,y],function(e){let[n,r]=e;switch(O){case"top":return[[P?n+t/2:C?n+4*t:n-4*t,r+t+1],[P?n-t/2:C?n+4*t:n-4*t,r+t+1],...[[M.left,C||P?M.bottom-t:M.top],[M.right,C?P?M.bottom-t:M.top:M.bottom-t]]];case"bottom":return[[P?n+t/2:C?n+4*t:n-4*t,r-t],[P?n-t/2:C?n+4*t:n-4*t,r-t],...[[M.left,C||P?M.top+t:M.bottom],[M.right,C?P?M.top+t:M.bottom:M.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:T?r+4*t:r-4*t];return[...[[T||A?M.right-t:M.left,M.top],[T?A?M.right-t:M.left:M.right-t,M.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:T?r+4*t:r-4*t],[n-t,A?r-t/2:T?r+4*t:r-4*t],...[[T||A?M.left+t:M.right,M.top],[T?A?M.left+t:M.right:M.left+t,M.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),v=u.useMemo((()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==l&&(T(t,!0)&&a||(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=d.current;"mousedown"===l&&d.current?d.current=void 0:T(t,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||It(e)||(" "!==e.key||kt(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||It(e)||kt(i)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,e.nativeEvent,"click"))}})),[o,i,l,a,f,r,n,s]);return u.useMemo((()=>c?{reference:v}:{}),[c,v])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:c}=e,{enabled:l=!0,axis:s="both",x:f=null,y:m=null}=t,v=u.useRef(!1),p=u.useRef(null),[g,h]=u.useState(),[y,b]=u.useState([]),w=a(((e,t)=>{v.current||r.current.openEvent&&!Mt(r.current.openEvent)||c.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var u;const i=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c="x"===t.axis||"both"===t.axis,l="y"===t.axis||"both"===t.axis,s=["mouseenter","mousemove"].includes((null==(u=t.dataRef.current.openEvent)?void 0:u.type)||"")&&"touch"!==t.pointerType;let a=i.width,f=i.height,d=i.x,m=i.y;return null==n&&t.x&&c&&(n=i.x-t.x),null==r&&t.y&&l&&(r=i.y-t.y),d-=n||0,m-=r||0,a=0,f=0,!o||s?(a="y"===t.axis?i.width:0,f="x"===t.axis?i.height:0,d=c&&null!=t.x?t.x:d,m=l&&null!=t.y?t.y:m):o&&!s&&(f="x"===t.axis?i.height:f,a="y"===t.axis?i.width:a),o=!0,{width:a,height:f,x:d,y:m,top:m,right:d+a,bottom:m+f,left:d}}}}(i,{x:e,y:t,axis:s,dataRef:r,pointerType:g}))})),R=a((e=>{null==f&&null==m&&(n?p.current||b([]):w(e.clientX,e.clientY))})),x=T(g)?o:n,I=u.useCallback((()=>{if(!x||!l||null!=f||null!=m)return;const e=d(o);function t(n){const r=L(n);E(o,r)?(e.removeEventListener("mousemove",t),p.current=null):w(n.clientX,n.clientY)}if(!r.current.openEvent||Mt(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),p.current=null};return p.current=n,n}c.setPositionReference(i)}),[x,l,f,m,o,r,c,i,w]);u.useEffect((()=>I()),[I,y]),u.useEffect((()=>{l&&!o&&(v.current=!1)}),[l,o]),u.useEffect((()=>{!l&&n&&(v.current=!0)}),[l,n]),ee((()=>{!l||null==f&&null==m||(v.current=!1,w(f,m))}),[l,f,m,w]);const k=u.useMemo((()=>{function e(e){let{pointerType:t}=e;h(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:R,onMouseEnter:R}}),[R]);return u.useMemo((()=>l?{reference:k}:{}),[l,k])},e.useDelayGroup=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:u}=t,i=null!=u?u:o,c=Te(),{currentId:l,setCurrentId:s,initialDelay:a,setState:f,timeoutMs:d}=c;return ee((()=>{l&&(f({delay:{open:1,close:Me(a,"close")}}),l!==i&&r(!1))}),[i,r,f,l,a]),ee((()=>{function e(){r(!1),f({delay:a,currentId:null})}if(l&&!n&&l===i){if(d){const t=window.setTimeout(e,d);return()=>{clearTimeout(t)}}e()}}),[n,f,l,i,r,a,d]),ee((()=>{s!==Oe&&n&&s(i)}),[n,s,i]),c},e.useDelayGroupContext=Te,e.useDismiss=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,elements:i,dataRef:c}=e,{enabled:l=!0,escapeKey:s=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:w=!1,bubbles:R,capture:x}=t,I=Re(),k=a("function"==typeof f?f:()=>!1),M="function"==typeof f?k:f,O=u.useRef(!1),C=u.useRef(!1),{escapeKey:T,outsidePress:A}=Tt(R),{escapeKey:N,outsidePress:D}=Tt(x),F=a((e=>{var t;if(!n||!l||!s||"Escape"!==e.key)return;const r=null==(t=c.current.floatingContext)?void 0:t.nodeId,u=I?Ge(I.nodesRef.current,r):[];if(!T&&(e.stopPropagation(),u.length>0)){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),j=a((e=>{var t;const n=()=>{var t;F(e),null==(t=L(e))||t.removeEventListener("keydown",n)};null==(t=L(e))||t.addEventListener("keydown",n)})),K=a((e=>{var t;const n=O.current;O.current=!1;const r=C.current;if(C.current=!1,"click"===d&&r)return;if(n)return;if("function"==typeof M&&!M(e))return;const u=L(e),l="["+xe("inert")+"]",s=S(i.floating).querySelectorAll(l);let a=v(u)?u:null;for(;a&&!h(a);){const e=b(a);if(h(e)||!v(e))break;a=e}if(s.length&&v(u)&&!u.matches("html,body")&&!E(u,i.floating)&&Array.from(s).every((e=>!E(a,e))))return;if(p(u)&&_){const t=u.clientWidth>0&&u.scrollWidth>u.clientWidth,n=u.clientHeight>0&&u.scrollHeight>u.clientHeight;let r=n&&e.offsetX>u.clientWidth;if(n){"rtl"===y(u).direction&&(r=e.offsetX<=u.offsetWidth-u.clientWidth)}if(r||t&&e.offsetY>u.clientHeight)return}const f=null==(t=c.current.floatingContext)?void 0:t.nodeId,m=I&&Ge(I.nodesRef.current,f).some((t=>{var n;return P(e,null==(n=t.context)?void 0:n.elements.floating)}));if(P(e,i.floating)||P(e,i.domReference)||m)return;const g=I?Ge(I.nodesRef.current,f):[];if(g.length>0){let e=!0;if(g.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),H=a((e=>{var t;const n=()=>{var t;K(e),null==(t=L(e))||t.removeEventListener(d,n)};null==(t=L(e))||t.addEventListener(d,n)}));u.useEffect((()=>{if(!n||!l)return;function e(e){o(!1,e,"ancestor-scroll")}c.current.__escapeKeyBubbles=T,c.current.__outsidePressBubbles=A;const t=S(i.floating);s&&t.addEventListener("keydown",N?j:F,N),M&&t.addEventListener(d,D?H:K,D);let u=[];return w&&(v(i.domReference)&&(u=r.getOverflowAncestors(i.domReference)),v(i.floating)&&(u=u.concat(r.getOverflowAncestors(i.floating))),!v(i.reference)&&i.reference&&i.reference.contextElement&&(u=u.concat(r.getOverflowAncestors(i.reference.contextElement)))),u=u.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{s&&t.removeEventListener("keydown",N?j:F,N),M&&t.removeEventListener(d,D?H:K,D),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[c,i,s,M,d,n,o,w,l,T,A,F,N,j,K,D,H]),u.useEffect((()=>{O.current=!1}),[M,d]);const q=u.useMemo((()=>({onKeyDown:F,[Ot[g]]:e=>{m&&o(!1,e.nativeEvent,"reference-press")}})),[F,o,m,g]),_=u.useMemo((()=>({onKeyDown:F,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[Ct[d]]:()=>{O.current=!0}})),[F,d]);return u.useMemo((()=>l?{reference:q,floating:_}:{}),[l,q,_])},e.useFloating=function(e){void 0===e&&(e={});const{nodeId:t}=e,n=St({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,i=o.elements,[c,l]=u.useState(null),[s,a]=u.useState(null),f=(null==i?void 0:i.reference)||c,d=u.useRef(null),m=Re();ee((()=>{f&&(d.current=f)}),[f]);const p=r.useFloating({...e,elements:{...i,...s&&{reference:s}}}),g=u.useCallback((e=>{const t=v(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),p.refs.setReference(t)}),[p.refs]),h=u.useCallback((e=>{(v(e)||null===e)&&(d.current=e,l(e)),(v(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!v(e))&&p.refs.setReference(e)}),[p.refs]),y=u.useMemo((()=>({...p.refs,setReference:h,setPositionReference:g,domReference:d})),[p.refs,h,g]),b=u.useMemo((()=>({...p.elements,domReference:f})),[p.elements,f]),w=u.useMemo((()=>({...p,...o,refs:y,elements:b,nodeId:t})),[p,y,b,t,o]);return ee((()=>{o.dataRef.current.floatingContext=w;const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===t));e&&(e.context=w)})),u.useMemo((()=>({...p,context:w,refs:y,elements:b})),[p,y,b,w])},e.useFloatingNodeId=function(e){const t=ge(),n=Re(),r=Ee(),o=e||r;return ee((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=Ee,e.useFloatingPortalNode=pt,e.useFloatingRootContext=St,e.useFloatingTree=Re,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:c}=e,{enabled:l=!0,visibleOnly:s=!0}=t,a=u.useRef(!1),f=u.useRef(),m=u.useRef(!0);u.useEffect((()=>{if(!l)return;const e=d(c.domReference);function t(){!n&&p(c.domReference)&&c.domReference===w(S(c.domReference))&&(a.current=!0)}function r(){m.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[c.domReference,n,l]),u.useEffect((()=>{if(l)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}}),[o,l]),u.useEffect((()=>()=>{clearTimeout(f.current)}),[]);const g=u.useMemo((()=>({onPointerDown(e){k(e.nativeEvent)||(m.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=L(e.nativeEvent);if(s&&v(t))try{if(M()&&C())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!m.current&&!N(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=v(t)&&t.hasAttribute(xe("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout((()=>{var e;const u=w(c.domReference?c.domReference.ownerDocument:document);(t||u!==c.domReference)&&(E(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,u)||E(c.domReference,u)||o||r(!1,n,"focus"))}))}})),[i,c.domReference,r,s]);return u.useMemo((()=>l?{reference:g}:{}),[l,g])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:c}=e,{enabled:l=!0,delay:s=0,handleClose:f=null,mouseOnly:d=!1,restMs:m=0,move:p=!0}=t,g=Re(),h=Ee(),y=Ie(f),b=Ie(s),w=Ie(n),R=u.useRef(),x=u.useRef(-1),I=u.useRef(),k=u.useRef(-1),M=u.useRef(!0),O=u.useRef(!1),C=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(l)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(k.current),M.current=!0)}}),[l,i]),u.useEffect((()=>{if(!l)return;if(!y.current)return;if(!n)return;function e(e){P()&&r(!1,e,"hover")}const t=S(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,n,r,l,y,P]);const L=u.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Me(b.current,"close",R.current);o&&!I.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(x.current),r(!1,e,n))}),[b,r]),A=a((()=>{C.current(),I.current=void 0})),N=a((()=>{if(O.current){const e=S(c.floating).body;e.style.pointerEvents="",e.removeAttribute(ke),O.current=!1}}));u.useEffect((()=>{if(l&&v(c.domReference)){var e;const t=c.domReference;return n&&t.addEventListener("mouseleave",s),null==(e=c.floating)||e.addEventListener("mouseleave",s),p&&t.addEventListener("mousemove",u,{once:!0}),t.addEventListener("mouseenter",u),t.addEventListener("mouseleave",i),()=>{var e;n&&t.removeEventListener("mouseleave",s),null==(e=c.floating)||e.removeEventListener("mouseleave",s),p&&t.removeEventListener("mousemove",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(x.current),M.current=!1,d&&!T(R.current)||m>0&&!Me(b.current,"open"))return;const t=Me(b.current,"open",R.current);t?x.current=window.setTimeout((()=>{w.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function i(e){if(t())return;C.current();const r=S(c.floating);if(clearTimeout(k.current),y.current&&o.current.floatingContext){n||clearTimeout(x.current),I.current=y.current({...o.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),A(),L(e,!0,"safe-polygon")}});const t=I.current;return r.addEventListener("mousemove",t),void(C.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==R.current||!E(c.floating,e.relatedTarget))&&L(e)}function s(e){t()||o.current.floatingContext&&(null==y.current||y.current({...o.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),A(),L(e)}})(e))}}),[c,l,e,d,m,p,L,A,N,r,n,w,g,b,y,o]),ee((()=>{var e;if(l&&n&&null!=(e=y.current)&&e.__options.blockPointerEvents&&P()){const e=S(c.floating).body;e.setAttribute(ke,""),e.style.pointerEvents="none",O.current=!0;const n=c.floating;if(v(c.domReference)&&n){var t;const e=c.domReference,r=null==g||null==(t=g.nodesRef.current.find((e=>e.id===h)))||null==(t=t.context)?void 0:t.elements.floating;return r&&(r.style.pointerEvents=""),e.style.pointerEvents="auto",n.style.pointerEvents="auto",()=>{e.style.pointerEvents="",n.style.pointerEvents=""}}}}),[l,n,h,c,g,y,P]),ee((()=>{n||(R.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(x.current),clearTimeout(k.current),N()}),[l,c.domReference,A,N]);const D=u.useMemo((()=>{function e(e){R.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){M.current||w.current||r(!0,t,"hover")}d&&!T(R.current)||n||0===m||(clearTimeout(k.current),"touch"===R.current?o():k.current=window.setTimeout(o,m))}}}),[d,r,n,w,m]),F=u.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){L(e.nativeEvent,!1)}})),[L]);return u.useMemo((()=>l?{reference:D,floating:F}:{}),[l,D,F])},e.useId=ge,e.useInnerOffset=function(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:c,scrollRef:l,onChange:s}=t,f=a(s),d=u.useRef(!1),m=u.useRef(null),v=u.useRef(null);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,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),i.flushSync((()=>{f((e=>e+Math[s](n,u*l)))}))):/firefox/i.test(x())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{m.current=t.scrollTop,null!=c.current&&(v.current={...c.current})})),()=>{m.current=null,v.current=null,t.removeEventListener("wheel",e)}):void 0}),[o,n,r.floating,c,l,f]);const p=u.useMemo((()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||r.floating;if(c.current&&e&&d.current){if(null!==m.current){const t=e.scrollTop-m.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&i.flushSync((()=>f((e=>e+t))))}requestAnimationFrame((()=>{m.current=e.scrollTop}))}}})),[r.floating,f,c,l]);return u.useMemo((()=>o?{floating:p}:{}),[o,p])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=u.useCallback((t=>At(t,e,"reference")),t),i=u.useCallback((t=>At(t,e,"floating")),n),c=u.useCallback((t=>At(t,e,"item")),r);return u.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:c})),[o,i,c])},e.useListItem=oe,e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:i,activeIndex:c,onNavigate:l=(()=>{}),enabled:s=!0,selectedIndex:f=null,allowEscape:d=!1,loop:m=!1,nested:v=!1,rtl:g=!1,virtual:h=!1,focusItemOnOpen:y="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:R=!0,disabledIndices:x,orientation:O="vertical",cols:T=1,scrollItemIntoView:P=!0,virtualItemRef:L,itemSizes:A,dense:N=!1}=t,j=Ee(),K=Re(),B=a(l),Q=u.useRef(y),te=u.useRef(null!=f?f:-1),ne=u.useRef(null),re=u.useRef(!0),oe=u.useRef(B),ue=u.useRef(!!o.floating),ie=u.useRef(n),ce=u.useRef(!1),le=u.useRef(!1),se=Ie(x),ae=Ie(n),fe=Ie(P),de=Ie(o.floating),me=Ie(f),[ve,pe]=u.useState(),[ge,he]=u.useState(),ye=a((function(e,t,n){function r(e){h?(pe(e.id),null==K||K.events.emit("virtualfocus",e),L&&(L.current=e)):J(e,{preventScroll:!0,sync:!(!C()||!M())&&(Nt||ce.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame((()=>{const u=e.current[t.current]||o;if(!u)return;o||r(u);const i=fe.current;i&&we&&(n||!re.current)&&(null==u.scrollIntoView||u.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))}))}));ee((()=>{document.createElement("div").focus({get preventScroll(){return Nt=!0,!1}})}),[]),ee((()=>{s&&(n&&o.floating?Q.current&&null!=f&&(le.current=!0,te.current=f,B(f)):ue.current&&(te.current=-1,oe.current(null)))}),[s,n,o.floating,f,B]),ee((()=>{if(s&&n&&o.floating)if(null==c){if(ce.current=!1,null!=me.current)return;if(ue.current&&(te.current=-1,ye(i,te)),(!ie.current||!ue.current)&&Q.current&&(null!=ne.current||!0===Q.current&&null==ne.current)){let e=0;const t=()=>{if(null==i.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else te.current=null==ne.current||jt(ne.current,O,g)||v?U(i,se.current):z(i,se.current),ne.current=null,B(te.current)};t()}}else W(i,c)||(te.current=c,ye(i,te,le.current),le.current=!1)}),[s,n,o.floating,c,me,v,i,O,g,B,ye,se]),ee((()=>{var e;if(!s||o.floating||!K||h||!ue.current)return;const t=K.nodesRef.current,n=null==(e=t.find((e=>e.id===j)))||null==(e=e.context)?void 0:e.elements.floating,r=w(S(o.floating)),u=t.some((e=>e.context&&E(e.context.elements.floating,r)));n&&!u&&re.current&&n.focus({preventScroll:!0})}),[s,o.floating,K,j,h]),ee((()=>{if(s&&K&&h&&!j)return K.events.on("virtualfocus",e),()=>{K.events.off("virtualfocus",e)};function e(e){he(e.id),L&&(L.current=e)}}),[s,K,h,j,L]),ee((()=>{oe.current=B,ue.current=!!o.floating})),ee((()=>{n||(ne.current=null)}),[n]),ee((()=>{ie.current=n}),[n]);const be=null!=c,we=u.useMemo((()=>{function e(e){if(!n)return;const t=i.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})},...b&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;re.current&&"touch"!==t&&(te.current=-1,ye(i,te),B(null),h||J(de.current,{preventScroll:!0}))}}}}),[n,de,ye,b,i,B,h]),xe=a((e=>{if(re.current=!1,ce.current=!0,!ae.current&&e.currentTarget===de.current)return;if(v&&Kt(e.key,O,g))return D(e),r(!1,e.nativeEvent,"list-navigation"),void(p(o.domReference)&&!h&&o.domReference.focus());const t=te.current,u=U(i,x),c=z(i,x);if("Home"===e.key&&(D(e),te.current=u,B(te.current)),"End"===e.key&&(D(e),te.current=c,B(te.current)),T>1){const t=A||Array.from({length:i.current.length},(()=>({width:1,height:1}))),n=V(t,T,N),r=n.findIndex((e=>null!=e&&!$(i.current,e,x))),o=n.reduce(((e,t,n)=>null==t||$(i.current,t,x)?e:n),-1);if(te.current=n[Y({current:n.map((e=>null!=e?i.current[e]:null))},{event:e,orientation:O,loop:m,cols:T,disabledIndices:Z([...x||i.current.map(((e,t)=>$(i.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:o,prevIndex:G(te.current>c?u:te.current,t,n,T,e.key===H?"bl":e.key===_?"tr":"tl"),stopEvent:!0})],B(te.current),"both"===O)return}if(Ft(e.key,O)){if(D(e),n&&!h&&w(e.currentTarget.ownerDocument)===e.currentTarget)return te.current=jt(e.key,O,g)?u:c,void B(te.current);jt(e.key,O,g)?te.current=m?t>=c?d&&t!==i.current.length?-1:u:X(i,{startingIndex:t,disabledIndices:x}):Math.min(c,X(i,{startingIndex:t,disabledIndices:x})):te.current=m?t<=u?d&&-1!==t?i.current.length:c:X(i,{startingIndex:t,decrement:!0,disabledIndices:x}):Math.max(u,X(i,{startingIndex:t,decrement:!0,disabledIndices:x})),W(i,te.current)?B(null):B(te.current)}})),ke=u.useMemo((()=>h&&n&&be&&{"aria-activedescendant":ge||ve}),[h,n,be,ge,ve]),Me=u.useMemo((()=>({"aria-orientation":"both"===O?void 0:O,...!F(o.domReference)&&ke,onKeyDown:xe,onPointerMove(){re.current=!0}})),[ke,xe,o.domReference,O]),Oe=u.useMemo((()=>{function e(e){"auto"===y&&I(e.nativeEvent)&&(Q.current=!0)}return{...ke,onKeyDown(e){re.current=!1;const t=0===e.key.indexOf("Arrow"),o=function(e,t,n){return Dt(t,n?e===q:e===_,e===H)}(e.key,O,g),u=Kt(e.key,O,g),c=Ft(e.key,O),l=(v?o:c)||"Enter"===e.key||""===e.key.trim();if(h&&n){const n=null==K?void 0:K.nodesRef.current.find((e=>null==e.parentId)),r=K&&n?function(e,t){let n,r=-1;return function t(o,u){u>r&&(n=o,r=u),Ge(e,o).forEach((e=>{t(e.id,u+1)}))}(t,0),e.find((e=>e.id===n))}(K.nodesRef.current,n.id):null;if(t&&r&&L){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||u){var s,a;const n=(null==(s=r.context)?void 0:s.elements.domReference)===e.currentTarget,c=u&&!n?null==(a=r.context)?void 0:a.elements.domReference:o?i.current.find((e=>(null==e?void 0:e.id)===ve)):null;c&&(D(e),c.dispatchEvent(t),he(void 0))}var d;if(c&&r.context)if(r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return D(e),void(null==(d=r.context.elements.domReference)||d.dispatchEvent(t))}return xe(e)}(n||R||!t)&&(l&&(ne.current=v&&c?null:e.key),v?o&&(D(e),n?(te.current=U(i,se.current),B(te.current)):r(!0,e.nativeEvent,"list-navigation")):c&&(null!=f&&(te.current=f),D(e),!n&&R?r(!0,e.nativeEvent,"list-navigation"):xe(e),n&&B(te.current)))},onFocus(){n&&!h&&B(null)},onPointerDown:function(e){Q.current=y,"auto"===y&&k(e.nativeEvent)&&(Q.current=!0)},onMouseDown:e,onClick:e}}),[ve,ke,xe,se,y,i,v,B,r,n,R,O,g,f,K,h,L]);return u.useMemo((()=>s?{reference:Oe,floating:Me,item:we}:{}),[s,Oe,Me,we])},e.useMergeRefs=c,e.useRole=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:c="dialog"}=t,l=null!=(n=Ht.get(c))?n:c,s=ge(),a=null!=Ee(),f=u.useMemo((()=>"tooltip"===l||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?o:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:s},..."menu"===l&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[l,o,a,r,s,c]),d=u.useMemo((()=>{const e={id:o,...l&&{role:l}};return"tooltip"===l||"label"===c?e:{...e,..."menu"===l&&{"aria-labelledby":s}}}),[l,o,s,c]),m=u.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[o,c]);return u.useMemo((()=>i?{reference:f,floating:d,item:m}:{}),[i,f,d,m])},e.useTransitionStatus=Bt,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:c=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof c,d=(f?c:c.open)||0,m=(f?c:c.close)||0,[v,p]=u.useState((()=>({..._t(i,a),..._t(n,a)}))),{isMounted:g,status:h}=Bt(e,{duration:c}),y=Ie(n),b=Ie(r),w=Ie(o),E=Ie(i);return ee((()=>{const e=_t(y.current,a),t=_t(w.current,a),n=_t(E.current,a),r=_t(b.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===h&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===h&&p({transitionProperty:Object.keys(r).map(qt).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(qt).join(","),transitionDuration:m+"ms",...n,...r})}}),[m,w,y,b,E,d,h,a]),{isMounted:g,styles:v}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:s,enabled:f=!0,findMatch:d=null,resetMs:m=750,ignoreKeys:v=[],selectedIndex:p=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=p?p:c)?n:-1),b=u.useRef(null),w=a(l),E=a(s),R=Ie(d),x=Ie(v);ee((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),ee((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=p?p:c)?e:-1)}),[r,p,c]);const I=a((e=>{e?o.current.typing||(o.current.typing=e,E(e)):o.current.typing&&(o.current.typing=e,E(e))})),k=a((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}const n=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(n,n,h.current)?I(!1):" "===e.key&&D(e)),null==n||x.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(D(e),I(!0));n.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===e.key&&(h.current="",y.current=b.current),h.current+=e.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,I(!1)}),m);const o=y.current,u=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],h.current);-1!==u?(w(u),b.current=u):" "!==e.key&&(h.current="",I(!1))})),M=u.useMemo((()=>({onKeyDown:k})),[k]),O=u.useMemo((()=>({onKeyDown:k,onKeyUp(e){" "===e.key&&I(!1)}})),[k,I]);return u.useMemo((()=>f?{reference:M,floating:O}:{}),[f,M,O])}}));
var Se=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Pe="undefined"==typeof Element,Le=Pe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ae=!Pe&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Ne=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},De=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if(!Ne(i,!1))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{Le.call(i,Se)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!Ne(s,!1)&&(!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},Fe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},je=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Fe(e)?0:e.tabIndex},Ke=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},He=function(e){return"INPUT"===e.tagName},qe=function(e){return function(e){return He(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ae(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)},_e=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Be=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Le.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Le.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return _e(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=Ae(e);if(i&&!i.shadowRoot&&!0===r(i))return _e(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){var t,n,r,o,u=e&&Ae(e),i=null===(t=u)||void 0===t?void 0:t.host,c=!1;if(u&&u!==e)for(c=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&i;){var l,s,a;c=!(null===(s=i=null===(l=u=Ae(i))||void 0===l?void 0:l.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(i))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},We=function(e,t){return!(t.disabled||Ne(t)||function(e){return He(e)&&"hidden"===e.type}(t)||Be(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!!Le.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ue=function(e,t){return!(qe(t)||je(t)<0||!We(e,t))},ze=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Xe=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=function(e,t){var n=je(e);return n<0&&t&&!Fe(e)?0:n}(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(Ke).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ye=function(e,t){var n;return n=(t=t||{}).getShadowRoot?De([e],t.includeContainer,{filter:Ue.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ze}):function(e,t,n){if(Ne(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Se));return t&&Le.call(e,Se)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Ue.bind(null,t)),Xe(n)},Ve=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Le.call(e,Se)&&Ue(t,e)};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}let Ze=new WeakMap,$e=new WeakSet,Qe={},Je=0;const et=e=>e&&(e.host||et(e.parentNode)),tt=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=et(t);return e.contains(n)?n:null})).filter((e=>null!=e));function nt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=S(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=tt(t,e),c=new Set,l=new Set(i),s=[];Qe[o]||(Qe[o]=new WeakMap);const a=Qe[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)&&[].forEach.call(t.children,(t=>{if("script"!==f(t))if(c.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(Ze.get(t)||0)+1,i=(a.get(t)||0)+1;Ze.set(t,r),a.set(t,i),s.push(t),1===r&&n&&$e.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),c.clear(),Je++,()=>{s.forEach((e=>{const t=(Ze.get(e)||0)-1,n=(a.get(e)||0)-1;Ze.set(e,t),a.set(e,n),t||(!$e.has(e)&&u&&e.removeAttribute(u),$e.delete(e)),n||e.removeAttribute(o)})),Je--,Je||(Ze=new WeakMap,Ze=new WeakMap,$e=new WeakSet,Qe={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const rt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ot(e,t){const n=Ye(e,rt());"prev"===t&&n.reverse();const r=n.indexOf(E(S(e)));return n.slice(r+1)[0]}function ut(){return ot(document.body,"next")}function it(){return ot(document.body,"prev")}function ct(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!w(n,r)}function lt(e){Ye(e,rt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function st(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 at={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 ft(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const dt=u.forwardRef((function(e,t){const[n,r]=u.useState();ee((()=>(M()&&r("button"),document.addEventListener("keydown",ft),()=>{document.removeEventListener("keydown",ft)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[xe("focus-guard")]:"",style:at};return u.createElement("span",de({},e,o))})),mt=u.createContext(null),vt=xe("portal");function pt(e){void 0===e&&(e={});const{id:t,root:n}=e,r=ge(),o=gt(),[i,c]=u.useState(null),l=u.useRef(null);return ee((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{l.current=null}))}),[i]),ee((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(vt,""),e.appendChild(n),l.current=n,c(n)}),[t,r]),ee((()=>{if(!r)return;if(l.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!v(e)&&(e=e.current),e=e||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,e.appendChild(u));const i=document.createElement("div");i.id=r,i.setAttribute(vt,""),e=u||e,e.appendChild(i),l.current=i,c(i)}),[t,n,r,o]),i}const gt=()=>u.useContext(mt),ht="data-floating-ui-focusable";function yt(e){return e?e.hasAttribute(ht)?e:e.querySelector("["+ht+"]")||e:null}const bt=20;let Et=[];function wt(e){Et=Et.filter((e=>e.isConnected));let t=e;if(t&&"body"!==f(t)){if(!Ve(t,rt())){const e=Ye(t,rt())[0];e&&(t=e)}Et.push(t),Et.length>bt&&(Et=Et.slice(-bt))}}function Rt(){return Et.slice().reverse().find((e=>e.isConnected))}const xt=u.forwardRef((function(e,t){return u.createElement("button",de({},e,{type:"button",ref:t,tabIndex:-1,style:at}))}));const It=new Set,kt=u.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e,o=ge();return ee((()=>{if(!n)return;It.add(o);const e=/iP(hone|ad|od)|iOS/.test(R()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,i=t.left?parseFloat(t.left):window.scrollX,c=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",u&&(t[r]=u+"px"),e){var l,s;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(c-Math.floor(n))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{It.delete(o),0===It.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,c)))}}),[o,n]),u.createElement("div",de({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Mt(e){return p(e.target)&&"BUTTON"===e.target.tagName}function Ot(e){return N(e)}function Ct(e){return null!=e&&null!=e.clientX}const Tt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},St={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Pt=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Lt(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ge(),i=u.useRef({}),[c]=u.useState((()=>ye())),l=null!=we(),[s,f]=u.useState(r.reference),d=a(((e,t,r)=>{i.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),m=u.useMemo((()=>({setPositionReference:f})),[]),v=u.useMemo((()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference})),[s,r.reference,r.floating]);return u.useMemo((()=>({dataRef:i,open:t,onOpenChange:d,elements:v,events:c,floatingId:o,refs:m})),[t,d,v,c,o,m])}const At="active",Nt="selected";function Dt(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[At]:t,[Nt]:n,...r}=e;u=r}return{..."floating"===n&&{tabIndex:-1,[ht]:""},...u,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,u]=t;var i;o&&[At,Nt].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof u&&(null==(i=r.get(n))||i.push(u),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]=u)})),e):e),{})}}let Ft=!1;function jt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Kt(e,t){return jt(t,e===K||e===H,e===q||e===_)}function Ht(e,t,n){return jt(t,e===H,n?e===q:e===_)||"Enter"===e||" "===e||""===e}function qt(e,t,n){return jt(t,n?e===_:e===q,e===K)}const _t=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const Bt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Wt(e,t){return"function"==typeof e?e(t):e}function Ut(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,[c,l]=u.useState("unmounted"),s=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,i);return s||"close"!==c||l("unmounted"),ee((()=>{if(r){if(n){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[n,r]),{isMounted:s,status:c}}function zt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function Xt(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 r.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return r.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return r.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return r.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return r.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return r.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return r.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return r.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return r.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return r.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return r.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return r.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return r.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return r.size}}),e.Composite=ae,e.CompositeItem=fe,e.FloatingArrow=he,e.FloatingDelayGroup=function(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=u.useRef(null),l=u.useCallback((e=>{i({currentId:e})}),[]);return ee((()=>{o.currentId?null===c.current?c.current=o.currentId:o.isInstantPhase||i({isInstantPhase:!0}):(o.isInstantPhase&&i({isInstantPhase:!1}),c.current=null)}),[o.currentId,o.isInstantPhase]),u.createElement(Ce.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:l})),[o,l])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:c=0,returnFocus:l=!0,restoreFocus:s=!1,modal:f=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:m=!0}=e,{open:v,refs:g,nodeId:h,onOpenChange:y,events:b,dataRef:R,floatingId:x,elements:{domReference:M,floating:O}}=t,C="number"==typeof c&&c<0,T=F(M)&&C,P="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,A=Ie(o),N=Ie(c),j=Ie(l),K=Re(),H=gt(),q=u.useRef(null),_=u.useRef(null),B=u.useRef(!1),W=u.useRef(!1),U=u.useRef(-1),z=null!=H,X=yt(O),Y=a((function(e){return void 0===e&&(e=X),e?Ye(e,rt()):[]})),V=a((e=>{const t=Y(e);return A.current.map((e=>M&&"reference"===e?M:X&&"floating"===e?X:t)).filter(Boolean).flat()}));function G(e){return!r&&d&&f?u.createElement(xt,{ref:"start"===e?q:_,onClick:e=>y(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}u.useEffect((()=>{B.current=!1}),[r]),u.useEffect((()=>{if(r)return;if(!f)return;function e(e){if("Tab"===e.key){w(X,E(S(X)))&&0===Y().length&&!T&&D(e);const t=V(),n=L(e);"reference"===A.current[0]&&n===M&&(D(e),e.shiftKey?J(t[t.length-1]):J(t[1])),"floating"===A.current[1]&&n===X&&e.shiftKey&&(D(e),J(t[0]))}}const t=S(X);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,M,X,f,A,T,Y,V]),u.useEffect((()=>{if(!r&&O)return O.addEventListener("focusin",e),()=>{O.removeEventListener("focusin",e)};function e(e){const t=L(e),n=Y().indexOf(t);-1!==n&&(U.current=n)}}),[r,O,Y]),u.useEffect((()=>{if(!r&&m)return O&&p(M)?(M.addEventListener("focusout",t),M.addEventListener("pointerdown",e),O.addEventListener("focusout",t),()=>{M.removeEventListener("focusout",t),M.removeEventListener("pointerdown",e),O.removeEventListener("focusout",t)}):void 0;function e(){W.current=!0,setTimeout((()=>{W.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(w(M,t)||w(O,t)||w(t,O)||w(null==H?void 0:H.portalNode,t)||null!=t&&t.hasAttribute(xe("focus-guard"))||K&&(Ge(K.nodesRef.current,h).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}(K.nodesRef.current,h).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}))));if(s&&n&&E(S(X))===S(X).body){p(X)&&X.focus();const e=U.current,t=Y(),n=t[e]||t[t.length-1]||X;p(n)&&n.focus()}!T&&f||!t||!n||W.current||t===Rt()||(B.current=!0,y(!1,e,"focus-out"))}))}}),[r,M,O,X,f,h,K,H,y,m,s,Y,T]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==H||null==(e=H.portalNode)?void 0:e.querySelectorAll("["+xe("portal")+"]"))||[]);if(O){const e=[O,...t,q.current,_.current,A.current.includes("reference")||T?M:null].filter((e=>null!=e)),n=f||T?nt(e,P,!P):nt(e);return()=>{n()}}}),[r,M,O,f,A,H,T,P]),ee((()=>{if(r||!p(X))return;const e=E(S(X));queueMicrotask((()=>{const t=V(X),n=N.current,r=("number"==typeof n?t[n]:n.current)||X,o=w(X,e);C||o||!v||J(r,{preventScroll:r===X})}))}),[r,v,X,C,V,N]),ee((()=>{if(r||!X)return;let e=!1;const t=S(X),n=E(t);let o=R.current.openEvent;const u=g.domReference.current;function i(t){let{open:n,reason:r,event:u,nested:i}=t;n&&(o=u),"escape-key"===r&&g.domReference.current&&wt(g.domReference.current),"hover"===r&&"mouseleave"===u.type&&(B.current=!0),"outside-press"===r&&(i?(B.current=!1,e=!0):B.current=!(I(u)||k(u)))}return wt(n),b.on("openchange",i),()=>{b.off("openchange",i);const r=E(t),c=w(O,r)||K&&Ge(K.nodesRef.current,h).some((e=>{var t;return w(null==(t=e.context)?void 0:t.elements.floating,r)}));(c||o&&["click","mousedown"].includes(o.type))&&g.domReference.current&&wt(g.domReference.current);const l=u||n,s=Ye(S(l).body,rt());queueMicrotask((()=>{let n=Rt();!n&&p(l)&&O&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=xe("focus-guard");let u=r+(t?1:0),i=e[u];for(;i&&(!i.isConnected||i.hasAttribute(o)||w(n,i));)t?u++:u--,i=e[u];return i}return o(!0)||o(!1)}(s,l,O)),j.current&&!B.current&&p(n)&&(n===r||r===t.body||c)&&n.focus({preventScroll:e})}))}}),[r,O,X,j,R,g,b,K,h]),ee((()=>{if(!r&&H)return H.setFocusManagerState({modal:f,closeOnFocusOut:m,open:v,onOpenChange:y,refs:g}),()=>{H.setFocusManagerState(null)}}),[r,H,f,v,y,g,m]),ee((()=>{if(r)return;if(!X)return;if("function"!=typeof MutationObserver)return;if(C)return;const e=()=>{const e=X.getAttribute("tabindex"),t=Y(),n=E(S(O)),r=t.indexOf(n);-1!==r&&(U.current=r),A.current.includes("floating")||n!==g.domReference.current&&0===t.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,O,X,g,A,Y,C]);const Z=!r&&P&&(!f||!T)&&(z||f);return u.createElement(u.Fragment,null,Z&&u.createElement(dt,{"data-type":"inside",ref:null==H?void 0:H.beforeInsideRef,onFocus:e=>{if(f){const e=V();J("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=H&&H.preserveTabOrder&&H.portalNode)if(B.current=!1,ct(e,H.portalNode)){const e=ut()||M;null==e||e.focus()}else{var t;null==(t=H.beforeOutsideRef.current)||t.focus()}}}),!T&&G("start"),n,G("end"),Z&&u.createElement(dt,{"data-type":"inside",ref:null==H?void 0:H.afterInsideRef,onFocus:e=>{if(f)J(V()[0]);else if(null!=H&&H.preserveTabOrder&&H.portalNode)if(m&&(B.current=!0),ct(e,H.portalNode)){const e=it()||M;null==e||e.focus()}else{var t;null==(t=H.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=re,e.FloatingNode=function(e){const{children:t,id:n}=e,r=we();return u.createElement(be.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=kt,e.FloatingPortal=function(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,c=pt({id:n,root:r}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=u.useRef(null),v=null==l?void 0:l.modal,p=null==l?void 0:l.open,g=!!l&&!l.modal&&l.open&&o&&!(!r&&!c);return u.useEffect((()=>{if(c&&o&&!v)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&&ct(e)){("focusin"===e.type?st:lt)(c)}}}),[c,o,v]),u.useEffect((()=>{c&&(p||st(c))}),[p,c]),u.createElement(mt.Provider,{value:u.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:c,setFocusManagerState:s})),[o,c])},g&&c&&u.createElement(dt,{"data-type":"outside",ref:a,onFocus:e=>{if(ct(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=it()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),g&&c&&u.createElement("span",{"aria-owns":c.id,style:at}),c&&i.createPortal(t,c),g&&c&&u.createElement(dt,{"data-type":"outside",ref:f,onFocus:e=>{if(ct(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=ut()||(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,"focus-out"))}}}))},e.FloatingTree=function(e){const{children:t}=e,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((()=>ye()))[0];return u.createElement(Ee.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:o,onFallbackChange:u,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=(v=t,"function"==typeof(m=e)?m(v):m);var m,v;const{rects:p,elements:{floating:g}}=t,h=n.current[l],y=(null==f?void 0:f.current)||g,b=g.clientTop||y.clientTop,E=0!==g.clientTop,w=0!==y.clientTop,R=g===y;if(!h)return{};const x={...t,...await r.offset(-h.offsetTop-g.clientTop-p.reference.height/2-h.offsetHeight/2-c).fn(t)},I=await r.detectOverflow(zt(x,y.scrollHeight+b+g.clientTop),d),k=await r.detectOverflow(x,{...d,elementContext:"reference"}),M=Math.max(0,I.top),O=x.y+M,C=Math.max(0,y.scrollHeight+(E&&R||w?2*b:0)-M-Math.max(0,I.bottom));return y.style.maxHeight=C+"px",y.scrollTop=M,u&&(y.offsetHeight<h.offsetHeight*Math.min(s,n.current.length-1)-1||k.top>=-a||k.bottom>=-a?i.flushSync((()=>u(!0))):i.flushSync((()=>u(!1)))),o&&(o.current=await r.detectOverflow(zt({...x,y:O},y.offsetHeight+b+g.clientTop),d)),{y:O}}}),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 g(){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=L(e),R="mouseleave"===e.type,x=w(f.floating,E),I=w(f.domReference,E),k=f.domReference.getBoundingClientRect(),M=f.floating.getBoundingClientRect(),O=a.split("-")[0],C=n>M.right-M.width/2,T=s>M.bottom-M.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}(b,k),P=M.width>k.width,A=M.height>k.height,N=(P?k:M).left,D=(P?k:M).right,F=(A?k:M).top,j=(A?k:M).bottom;if(x&&(u=!0,!R))return;if(I&&(u=!1),I&&!R)return void(u=!0);if(R&&v(e.relatedTarget)&&w(f.floating,e.relatedTarget))return;if(p&&Ge(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===O&&s>=k.bottom-1||"bottom"===O&&s<=k.top+1||"left"===O&&n>=k.right-1||"right"===O&&n<=k.left+1)return g();let K=[];switch(O){case"top":K=[[N,k.top+1],[N,M.bottom-1],[D,M.bottom-1],[D,k.top+1]];break;case"bottom":K=[[N,M.top+1],[N,k.bottom-1],[D,k.bottom-1],[D,M.top+1]];break;case"left":K=[[M.right-1,j],[M.right-1,F],[k.left+1,F],[k.left+1,j]];break;case"right":K=[[k.right-1,j],[k.right-1,F],[M.left+1,F],[M.left+1,j]]}if(!Xt([h,y],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()}Xt([h,y],function(e){let[n,r]=e;switch(O){case"top":return[[P?n+t/2:C?n+4*t:n-4*t,r+t+1],[P?n-t/2:C?n+4*t:n-4*t,r+t+1],...[[M.left,C||P?M.bottom-t:M.top],[M.right,C?P?M.bottom-t:M.top:M.bottom-t]]];case"bottom":return[[P?n+t/2:C?n+4*t:n-4*t,r-t],[P?n-t/2:C?n+4*t:n-4*t,r-t],...[[M.left,C||P?M.top+t:M.bottom],[M.right,C?P?M.top+t:M.bottom:M.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:T?r+4*t:r-4*t];return[...[[T||A?M.right-t:M.left,M.top],[T?A?M.right-t:M.left:M.right-t,M.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:T?r+4*t:r-4*t],[n-t,A?r-t/2:T?r+4*t:r-4*t],...[[T||A?M.left+t:M.right,M.top],[T?A?M.left+t:M.right:M.left+t,M.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),v=u.useMemo((()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==l&&(T(t,!0)&&a||(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=d.current;"mousedown"===l&&d.current?d.current=void 0:T(t,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Mt(e)||(" "!==e.key||Ot(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||Mt(e)||Ot(i)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,e.nativeEvent,"click"))}})),[o,i,l,a,f,r,n,s]);return u.useMemo((()=>c?{reference:v}:{}),[c,v])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:c}=e,{enabled:l=!0,axis:s="both",x:f=null,y:m=null}=t,v=u.useRef(!1),p=u.useRef(null),[g,h]=u.useState(),[y,b]=u.useState([]),E=a(((e,t)=>{v.current||r.current.openEvent&&!Ct(r.current.openEvent)||c.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var u;const i=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c="x"===t.axis||"both"===t.axis,l="y"===t.axis||"both"===t.axis,s=["mouseenter","mousemove"].includes((null==(u=t.dataRef.current.openEvent)?void 0:u.type)||"")&&"touch"!==t.pointerType;let a=i.width,f=i.height,d=i.x,m=i.y;return null==n&&t.x&&c&&(n=i.x-t.x),null==r&&t.y&&l&&(r=i.y-t.y),d-=n||0,m-=r||0,a=0,f=0,!o||s?(a="y"===t.axis?i.width:0,f="x"===t.axis?i.height:0,d=c&&null!=t.x?t.x:d,m=l&&null!=t.y?t.y:m):o&&!s&&(f="x"===t.axis?i.height:f,a="y"===t.axis?i.width:a),o=!0,{width:a,height:f,x:d,y:m,top:m,right:d+a,bottom:m+f,left:d}}}}(i,{x:e,y:t,axis:s,dataRef:r,pointerType:g}))})),R=a((e=>{null==f&&null==m&&(n?p.current||b([]):E(e.clientX,e.clientY))})),x=T(g)?o:n,I=u.useCallback((()=>{if(!x||!l||null!=f||null!=m)return;const e=d(o);function t(n){const r=L(n);w(o,r)?(e.removeEventListener("mousemove",t),p.current=null):E(n.clientX,n.clientY)}if(!r.current.openEvent||Ct(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),p.current=null};return p.current=n,n}c.setPositionReference(i)}),[x,l,f,m,o,r,c,i,E]);u.useEffect((()=>I()),[I,y]),u.useEffect((()=>{l&&!o&&(v.current=!1)}),[l,o]),u.useEffect((()=>{!l&&n&&(v.current=!0)}),[l,n]),ee((()=>{!l||null==f&&null==m||(v.current=!1,E(f,m))}),[l,f,m,E]);const k=u.useMemo((()=>{function e(e){let{pointerType:t}=e;h(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:R,onMouseEnter:R}}),[R]);return u.useMemo((()=>l?{reference:k}:{}),[l,k])},e.useDelayGroup=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:u}=t,i=null!=u?u:o,c=Te(),{currentId:l,setCurrentId:s,initialDelay:a,setState:f,timeoutMs:d}=c;return ee((()=>{l&&(f({delay:{open:1,close:Me(a,"close")}}),l!==i&&r(!1))}),[i,r,f,l,a]),ee((()=>{function e(){r(!1),f({delay:a,currentId:null})}if(l&&!n&&l===i){if(d){const t=window.setTimeout(e,d);return()=>{clearTimeout(t)}}e()}}),[n,f,l,i,r,a,d]),ee((()=>{s!==Oe&&n&&s(i)}),[n,s,i]),c},e.useDelayGroupContext=Te,e.useDismiss=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,elements:i,dataRef:c}=e,{enabled:l=!0,escapeKey:s=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:E=!1,bubbles:R,capture:x}=t,I=Re(),k=a("function"==typeof f?f:()=>!1),M="function"==typeof f?k:f,O=u.useRef(!1),C=u.useRef(!1),{escapeKey:T,outsidePress:A}=Pt(R),{escapeKey:N,outsidePress:D}=Pt(x),F=a((e=>{var t;if(!n||!l||!s||"Escape"!==e.key)return;const r=null==(t=c.current.floatingContext)?void 0:t.nodeId,u=I?Ge(I.nodesRef.current,r):[];if(!T&&(e.stopPropagation(),u.length>0)){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),j=a((e=>{var t;const n=()=>{var t;F(e),null==(t=L(e))||t.removeEventListener("keydown",n)};null==(t=L(e))||t.addEventListener("keydown",n)})),K=a((e=>{var t;const n=O.current;O.current=!1;const r=C.current;if(C.current=!1,"click"===d&&r)return;if(n)return;if("function"==typeof M&&!M(e))return;const u=L(e),l="["+xe("inert")+"]",s=S(i.floating).querySelectorAll(l);let a=v(u)?u:null;for(;a&&!h(a);){const e=b(a);if(h(e)||!v(e))break;a=e}if(s.length&&v(u)&&!u.matches("html,body")&&!w(u,i.floating)&&Array.from(s).every((e=>!w(a,e))))return;if(p(u)&&_){const t=u.clientWidth>0&&u.scrollWidth>u.clientWidth,n=u.clientHeight>0&&u.scrollHeight>u.clientHeight;let r=n&&e.offsetX>u.clientWidth;if(n){"rtl"===y(u).direction&&(r=e.offsetX<=u.offsetWidth-u.clientWidth)}if(r||t&&e.offsetY>u.clientHeight)return}const f=null==(t=c.current.floatingContext)?void 0:t.nodeId,m=I&&Ge(I.nodesRef.current,f).some((t=>{var n;return P(e,null==(n=t.context)?void 0:n.elements.floating)}));if(P(e,i.floating)||P(e,i.domReference)||m)return;const g=I?Ge(I.nodesRef.current,f):[];if(g.length>0){let e=!0;if(g.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),H=a((e=>{var t;const n=()=>{var t;K(e),null==(t=L(e))||t.removeEventListener(d,n)};null==(t=L(e))||t.addEventListener(d,n)}));u.useEffect((()=>{if(!n||!l)return;function e(e){o(!1,e,"ancestor-scroll")}c.current.__escapeKeyBubbles=T,c.current.__outsidePressBubbles=A;const t=S(i.floating);s&&t.addEventListener("keydown",N?j:F,N),M&&t.addEventListener(d,D?H:K,D);let u=[];return E&&(v(i.domReference)&&(u=r.getOverflowAncestors(i.domReference)),v(i.floating)&&(u=u.concat(r.getOverflowAncestors(i.floating))),!v(i.reference)&&i.reference&&i.reference.contextElement&&(u=u.concat(r.getOverflowAncestors(i.reference.contextElement)))),u=u.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{s&&t.removeEventListener("keydown",N?j:F,N),M&&t.removeEventListener(d,D?H:K,D),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[c,i,s,M,d,n,o,E,l,T,A,F,N,j,K,D,H]),u.useEffect((()=>{O.current=!1}),[M,d]);const q=u.useMemo((()=>({onKeyDown:F,[Tt[g]]:e=>{m&&o(!1,e.nativeEvent,"reference-press")}})),[F,o,m,g]),_=u.useMemo((()=>({onKeyDown:F,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[St[d]]:()=>{O.current=!0}})),[F,d]);return u.useMemo((()=>l?{reference:q,floating:_}:{}),[l,q,_])},e.useFloating=function(e){void 0===e&&(e={});const{nodeId:t}=e,n=Lt({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,i=o.elements,[c,l]=u.useState(null),[s,a]=u.useState(null),f=(null==i?void 0:i.reference)||c,d=u.useRef(null),m=Re();ee((()=>{f&&(d.current=f)}),[f]);const p=r.useFloating({...e,elements:{...i,...s&&{reference:s}}}),g=u.useCallback((e=>{const t=v(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),p.refs.setReference(t)}),[p.refs]),h=u.useCallback((e=>{(v(e)||null===e)&&(d.current=e,l(e)),(v(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!v(e))&&p.refs.setReference(e)}),[p.refs]),y=u.useMemo((()=>({...p.refs,setReference:h,setPositionReference:g,domReference:d})),[p.refs,h,g]),b=u.useMemo((()=>({...p.elements,domReference:f})),[p.elements,f]),E=u.useMemo((()=>({...p,...o,refs:y,elements:b,nodeId:t})),[p,y,b,t,o]);return ee((()=>{o.dataRef.current.floatingContext=E;const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===t));e&&(e.context=E)})),u.useMemo((()=>({...p,context:E,refs:y,elements:b})),[p,y,b,E])},e.useFloatingNodeId=function(e){const t=ge(),n=Re(),r=we(),o=e||r;return ee((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=we,e.useFloatingPortalNode=pt,e.useFloatingRootContext=Lt,e.useFloatingTree=Re,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:c}=e,{enabled:l=!0,visibleOnly:s=!0}=t,a=u.useRef(!1),f=u.useRef(),m=u.useRef(!0);u.useEffect((()=>{if(!l)return;const e=d(c.domReference);function t(){!n&&p(c.domReference)&&c.domReference===E(S(c.domReference))&&(a.current=!0)}function r(){m.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[c.domReference,n,l]),u.useEffect((()=>{if(l)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}}),[o,l]),u.useEffect((()=>()=>{clearTimeout(f.current)}),[]);const g=u.useMemo((()=>({onPointerDown(e){k(e.nativeEvent)||(m.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=L(e.nativeEvent);if(s&&v(t))try{if(M()&&C())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!m.current&&!N(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=v(t)&&t.hasAttribute(xe("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout((()=>{var e;const u=E(c.domReference?c.domReference.ownerDocument:document);(t||u!==c.domReference)&&(w(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,u)||w(c.domReference,u)||o||r(!1,n,"focus"))}))}})),[i,c.domReference,r,s]);return u.useMemo((()=>l?{reference:g}:{}),[l,g])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:c}=e,{enabled:l=!0,delay:s=0,handleClose:f=null,mouseOnly:d=!1,restMs:m=0,move:p=!0}=t,g=Re(),h=we(),y=Ie(f),b=Ie(s),E=Ie(n),R=u.useRef(),x=u.useRef(-1),I=u.useRef(),k=u.useRef(-1),M=u.useRef(!0),O=u.useRef(!1),C=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(l)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(k.current),M.current=!0)}}),[l,i]),u.useEffect((()=>{if(!l)return;if(!y.current)return;if(!n)return;function e(e){P()&&r(!1,e,"hover")}const t=S(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,n,r,l,y,P]);const L=u.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Me(b.current,"close",R.current);o&&!I.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(x.current),r(!1,e,n))}),[b,r]),A=a((()=>{C.current(),I.current=void 0})),N=a((()=>{if(O.current){const e=S(c.floating).body;e.style.pointerEvents="",e.removeAttribute(ke),O.current=!1}}));u.useEffect((()=>{if(l&&v(c.domReference)){var e;const t=c.domReference;return n&&t.addEventListener("mouseleave",s),null==(e=c.floating)||e.addEventListener("mouseleave",s),p&&t.addEventListener("mousemove",u,{once:!0}),t.addEventListener("mouseenter",u),t.addEventListener("mouseleave",i),()=>{var e;n&&t.removeEventListener("mouseleave",s),null==(e=c.floating)||e.removeEventListener("mouseleave",s),p&&t.removeEventListener("mousemove",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(x.current),M.current=!1,d&&!T(R.current)||m>0&&!Me(b.current,"open"))return;const t=Me(b.current,"open",R.current);t?x.current=window.setTimeout((()=>{E.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function i(e){if(t())return;C.current();const r=S(c.floating);if(clearTimeout(k.current),y.current&&o.current.floatingContext){n||clearTimeout(x.current),I.current=y.current({...o.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),A(),L(e,!0,"safe-polygon")}});const t=I.current;return r.addEventListener("mousemove",t),void(C.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==R.current||!w(c.floating,e.relatedTarget))&&L(e)}function s(e){t()||o.current.floatingContext&&(null==y.current||y.current({...o.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),A(),L(e)}})(e))}}),[c,l,e,d,m,p,L,A,N,r,n,E,g,b,y,o]),ee((()=>{var e;if(l&&n&&null!=(e=y.current)&&e.__options.blockPointerEvents&&P()){O.current=!0;const e=c.floating;if(v(c.domReference)&&e){var t;const n=S(c.floating).body;n.setAttribute(ke,"");const r=c.domReference,o=null==g||null==(t=g.nodesRef.current.find((e=>e.id===h)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[l,n,h,c,g,y,P]),ee((()=>{n||(R.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(x.current),clearTimeout(k.current),N()}),[l,c.domReference,A,N]);const D=u.useMemo((()=>{function e(e){R.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){M.current||E.current||r(!0,t,"hover")}d&&!T(R.current)||n||0===m||(clearTimeout(k.current),"touch"===R.current?o():k.current=window.setTimeout(o,m))}}}),[d,r,n,E,m]),F=u.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){L(e.nativeEvent,!1)}})),[L]);return u.useMemo((()=>l?{reference:D,floating:F}:{}),[l,D,F])},e.useId=ge,e.useInnerOffset=function(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:c,scrollRef:l,onChange:s}=t,f=a(s),d=u.useRef(!1),m=u.useRef(null),v=u.useRef(null);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,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),i.flushSync((()=>{f((e=>e+Math[s](n,u*l)))}))):/firefox/i.test(x())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{m.current=t.scrollTop,null!=c.current&&(v.current={...c.current})})),()=>{m.current=null,v.current=null,t.removeEventListener("wheel",e)}):void 0}),[o,n,r.floating,c,l,f]);const p=u.useMemo((()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||r.floating;if(c.current&&e&&d.current){if(null!==m.current){const t=e.scrollTop-m.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&i.flushSync((()=>f((e=>e+t))))}requestAnimationFrame((()=>{m.current=e.scrollTop}))}}})),[r.floating,f,c,l]);return u.useMemo((()=>o?{floating:p}:{}),[o,p])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=u.useCallback((t=>Dt(t,e,"reference")),t),i=u.useCallback((t=>Dt(t,e,"floating")),n),c=u.useCallback((t=>Dt(t,e,"item")),r);return u.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:c})),[o,i,c])},e.useListItem=oe,e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:i,activeIndex:c,onNavigate:l=(()=>{}),enabled:s=!0,selectedIndex:f=null,allowEscape:d=!1,loop:m=!1,nested:v=!1,rtl:g=!1,virtual:h=!1,focusItemOnOpen:y="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:R=!0,disabledIndices:x,orientation:O="vertical",cols:T=1,scrollItemIntoView:P=!0,virtualItemRef:L,itemSizes:A,dense:N=!1}=t,j=Ie(yt(o.floating)),K=we(),B=Re(),Q=a(l),te=u.useRef(y),ne=u.useRef(null!=f?f:-1),re=u.useRef(null),oe=u.useRef(!0),ue=u.useRef(Q),ie=u.useRef(!!o.floating),ce=u.useRef(n),le=u.useRef(!1),se=u.useRef(!1),ae=Ie(x),fe=Ie(n),de=Ie(P),me=Ie(f),[ve,pe]=u.useState(),[ge,he]=u.useState(),ye=a((function(e,t,n){function r(e){h?(pe(e.id),null==B||B.events.emit("virtualfocus",e),L&&(L.current=e)):J(e,{preventScroll:!0,sync:!(!C()||!M())&&(Ft||le.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame((()=>{const u=e.current[t.current]||o;if(!u)return;o||r(u);const i=de.current;i&&Ee&&(n||!oe.current)&&(null==u.scrollIntoView||u.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))}))}));ee((()=>{document.createElement("div").focus({get preventScroll(){return Ft=!0,!1}})}),[]),ee((()=>{s&&(n&&o.floating?te.current&&null!=f&&(se.current=!0,ne.current=f,Q(f)):ie.current&&(ne.current=-1,ue.current(null)))}),[s,n,o.floating,f,Q]),ee((()=>{if(s&&n&&o.floating)if(null==c){if(le.current=!1,null!=me.current)return;if(ie.current&&(ne.current=-1,ye(i,ne)),(!ce.current||!ie.current)&&te.current&&(null!=re.current||!0===te.current&&null==re.current)){let e=0;const t=()=>{if(null==i.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else ne.current=null==re.current||Ht(re.current,O,g)||v?U(i,ae.current):z(i,ae.current),re.current=null,Q(ne.current)};t()}}else W(i,c)||(ne.current=c,ye(i,ne,se.current),se.current=!1)}),[s,n,o.floating,c,me,v,i,O,g,Q,ye,ae]),ee((()=>{var e;if(!s||o.floating||!B||h||!ie.current)return;const t=B.nodesRef.current,n=null==(e=t.find((e=>e.id===K)))||null==(e=e.context)?void 0:e.elements.floating,r=E(S(o.floating)),u=t.some((e=>e.context&&w(e.context.elements.floating,r)));n&&!u&&oe.current&&n.focus({preventScroll:!0})}),[s,o.floating,B,K,h]),ee((()=>{if(s&&B&&h&&!K)return B.events.on("virtualfocus",e),()=>{B.events.off("virtualfocus",e)};function e(e){he(e.id),L&&(L.current=e)}}),[s,B,h,K,L]),ee((()=>{ue.current=Q,ie.current=!!o.floating})),ee((()=>{n||(re.current=null)}),[n]),ee((()=>{ce.current=n}),[n]);const be=null!=c,Ee=u.useMemo((()=>{function e(e){if(!n)return;const t=i.current.indexOf(e);-1!==t&&Q(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...b&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;oe.current&&"touch"!==t&&(ne.current=-1,ye(i,ne),Q(null),h||J(j.current,{preventScroll:!0}))}}}}),[n,j,ye,b,i,Q,h]),xe=a((e=>{if(oe.current=!1,le.current=!0,!fe.current&&e.currentTarget===j.current)return;if(v&&qt(e.key,O,g))return D(e),r(!1,e.nativeEvent,"list-navigation"),void(p(o.domReference)&&!h&&o.domReference.focus());const t=ne.current,u=U(i,x),c=z(i,x);if("Home"===e.key&&(D(e),ne.current=u,Q(ne.current)),"End"===e.key&&(D(e),ne.current=c,Q(ne.current)),T>1){const t=A||Array.from({length:i.current.length},(()=>({width:1,height:1}))),n=V(t,T,N),r=n.findIndex((e=>null!=e&&!$(i.current,e,x))),o=n.reduce(((e,t,n)=>null==t||$(i.current,t,x)?e:n),-1),l=n[Y({current:n.map((e=>null!=e?i.current[e]:null))},{event:e,orientation:O,loop:m,cols:T,disabledIndices:Z([...x||i.current.map(((e,t)=>$(i.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:o,prevIndex:G(ne.current>c?u:ne.current,t,n,T,e.key===H?"bl":e.key===_?"tr":"tl"),stopEvent:!0})];if(null!=l&&(ne.current=l,Q(ne.current)),"both"===O)return}if(Kt(e.key,O)){if(D(e),n&&!h&&E(e.currentTarget.ownerDocument)===e.currentTarget)return ne.current=Ht(e.key,O,g)?u:c,void Q(ne.current);Ht(e.key,O,g)?ne.current=m?t>=c?d&&t!==i.current.length?-1:u:X(i,{startingIndex:t,disabledIndices:x}):Math.min(c,X(i,{startingIndex:t,disabledIndices:x})):ne.current=m?t<=u?d&&-1!==t?i.current.length:c:X(i,{startingIndex:t,decrement:!0,disabledIndices:x}):Math.max(u,X(i,{startingIndex:t,decrement:!0,disabledIndices:x})),W(i,ne.current)?Q(null):Q(ne.current)}})),ke=u.useMemo((()=>h&&n&&be&&{"aria-activedescendant":ge||ve}),[h,n,be,ge,ve]),Me=u.useMemo((()=>({"aria-orientation":"both"===O?void 0:O,...!F(o.domReference)&&ke,onKeyDown:xe,onPointerMove(){oe.current=!0}})),[ke,xe,o.domReference,O]),Oe=u.useMemo((()=>{function e(e){"auto"===y&&I(e.nativeEvent)&&(te.current=!0)}return{...ke,onKeyDown(e){oe.current=!1;const t=0===e.key.indexOf("Arrow"),o=function(e,t,n){return jt(t,n?e===q:e===_,e===H)}(e.key,O,g),u=qt(e.key,O,g),c=Kt(e.key,O),l=(v?o:c)||"Enter"===e.key||""===e.key.trim();if(h&&n){const n=null==B?void 0:B.nodesRef.current.find((e=>null==e.parentId)),r=B&&n?function(e,t){let n,r=-1;return function t(o,u){u>r&&(n=o,r=u),Ge(e,o).forEach((e=>{t(e.id,u+1)}))}(t,0),e.find((e=>e.id===n))}(B.nodesRef.current,n.id):null;if(t&&r&&L){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||u){var s,a;const n=(null==(s=r.context)?void 0:s.elements.domReference)===e.currentTarget,c=u&&!n?null==(a=r.context)?void 0:a.elements.domReference:o?i.current.find((e=>(null==e?void 0:e.id)===ve)):null;c&&(D(e),c.dispatchEvent(t),he(void 0))}var d;if(c&&r.context)if(r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return D(e),void(null==(d=r.context.elements.domReference)||d.dispatchEvent(t))}return xe(e)}(n||R||!t)&&(l&&(re.current=v&&c?null:e.key),v?o&&(D(e),n?(ne.current=U(i,ae.current),Q(ne.current)):r(!0,e.nativeEvent,"list-navigation")):c&&(null!=f&&(ne.current=f),D(e),!n&&R?r(!0,e.nativeEvent,"list-navigation"):xe(e),n&&Q(ne.current)))},onFocus(){n&&!h&&Q(null)},onPointerDown:function(e){te.current=y,"auto"===y&&k(e.nativeEvent)&&(te.current=!0)},onMouseDown:e,onClick:e}}),[ve,ke,xe,ae,y,i,v,Q,r,n,R,O,g,f,B,h,L]);return u.useMemo((()=>s?{reference:Oe,floating:Me,item:Ee}:{}),[s,Oe,Me,Ee])},e.useMergeRefs=c,e.useRole=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:c="dialog"}=t,l=null!=(n=_t.get(c))?n:c,s=ge(),a=null!=we(),f=u.useMemo((()=>"tooltip"===l||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?o:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:s},..."menu"===l&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[l,o,a,r,s,c]),d=u.useMemo((()=>{const e={id:o,...l&&{role:l}};return"tooltip"===l||"label"===c?e:{...e,..."menu"===l&&{"aria-labelledby":s}}}),[l,o,s,c]),m=u.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[o,c]);return u.useMemo((()=>i?{reference:f,floating:d,item:m}:{}),[i,f,d,m])},e.useTransitionStatus=Ut,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:c=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof c,d=(f?c:c.open)||0,m=(f?c:c.close)||0,[v,p]=u.useState((()=>({...Wt(i,a),...Wt(n,a)}))),{isMounted:g,status:h}=Ut(e,{duration:c}),y=Ie(n),b=Ie(r),E=Ie(o),w=Ie(i);return ee((()=>{const e=Wt(y.current,a),t=Wt(E.current,a),n=Wt(w.current,a),r=Wt(b.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===h&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===h&&p({transitionProperty:Object.keys(r).map(Bt).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(Bt).join(","),transitionDuration:m+"ms",...n,...r})}}),[m,E,y,b,w,d,h,a]),{isMounted:g,styles:v}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:s,enabled:f=!0,findMatch:d=null,resetMs:m=750,ignoreKeys:v=[],selectedIndex:p=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=p?p:c)?n:-1),b=u.useRef(null),E=a(l),w=a(s),R=Ie(d),x=Ie(v);ee((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),ee((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=p?p:c)?e:-1)}),[r,p,c]);const I=a((e=>{e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))})),k=a((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}const n=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(n,n,h.current)?I(!1):" "===e.key&&D(e)),null==n||x.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(D(e),I(!0));n.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===e.key&&(h.current="",y.current=b.current),h.current+=e.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,I(!1)}),m);const o=y.current,u=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],h.current);-1!==u?(E(u),b.current=u):" "!==e.key&&(h.current="",I(!1))})),M=u.useMemo((()=>({onKeyDown:k})),[k]),O=u.useMemo((()=>({onKeyDown:k,onKeyUp(e){" "===e.key&&I(!1)}})),[k,I]);return u.useMemo((()=>f?{reference:M,floating:O}:{}),[f,M,O])}}));
{
"name": "@floating-ui/react",
"version": "0.26.22",
"version": "0.26.23",
"description": "Floating UI for React",

@@ -5,0 +5,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc