@floating-ui/react
Advanced tools
Comparing version 0.26.13 to 0.26.14
@@ -174,2 +174,3 @@ import { AlignedPlacement } from '@floating-ui/react-dom'; | ||
openEvent?: Event; | ||
floatingContext?: FloatingContext; | ||
/** @deprecated use `onTypingChange` prop in `useTypeahead` */ | ||
@@ -471,2 +472,18 @@ typing?: boolean; | ||
export declare interface FloatingRootContext<RT extends ReferenceType = ReferenceType> { | ||
dataRef: React.MutableRefObject<ContextData>; | ||
open: boolean; | ||
onOpenChange: (open: boolean, event?: Event, reason?: OpenChangeReason) => void; | ||
elements: { | ||
domReference: Element | null; | ||
reference: RT | null; | ||
floating: HTMLElement | null; | ||
}; | ||
events: FloatingEvents; | ||
floatingId: string; | ||
refs: { | ||
setPositionReference(node: ReferenceType | null): void; | ||
}; | ||
} | ||
/** | ||
@@ -658,3 +675,3 @@ * Provides context for nested floating elements when they are not children of | ||
*/ | ||
export declare function useClick(context: FloatingContext, props?: UseClickProps): ElementProps; | ||
export declare function useClick(context: FloatingRootContext, props?: UseClickProps): ElementProps; | ||
@@ -702,3 +719,3 @@ export declare interface UseClickProps { | ||
*/ | ||
export declare function useClientPoint(context: FloatingContext, props?: UseClientPointProps): ElementProps; | ||
export declare function useClientPoint(context: FloatingRootContext, props?: UseClientPointProps): ElementProps; | ||
@@ -736,3 +753,3 @@ export declare interface UseClientPointProps { | ||
*/ | ||
export declare function useDelayGroup(context: FloatingContext, options?: UseGroupOptions): GroupContext; | ||
export declare function useDelayGroup(context: FloatingRootContext, options?: UseGroupOptions): GroupContext; | ||
@@ -750,3 +767,3 @@ /** | ||
*/ | ||
export declare function useDismiss(context: FloatingContext, props?: UseDismissProps): ElementProps; | ||
export declare function useDismiss(context: FloatingRootContext, props?: UseDismissProps): ElementProps; | ||
@@ -840,2 +857,3 @@ export declare interface UseDismissProps { | ||
export declare interface UseFloatingOptions<RT extends ReferenceType = ReferenceType> extends Omit<UseFloatingOptions_2<RT>, 'elements'> { | ||
rootContext?: FloatingRootContext<RT>; | ||
/** | ||
@@ -891,2 +909,13 @@ * Object of external elements as an alternative to the `refs` object setters. | ||
export declare function useFloatingRootContext(options: UseFloatingRootContextOptions): FloatingRootContext; | ||
export declare interface UseFloatingRootContextOptions { | ||
open?: boolean; | ||
onOpenChange?: (open: boolean, event?: Event, reason?: OpenChangeReason) => void; | ||
elements: { | ||
reference: Element | null; | ||
floating: HTMLElement | null; | ||
}; | ||
} | ||
/** | ||
@@ -902,3 +931,3 @@ * Returns the nearest floating tree context, if available. | ||
*/ | ||
export declare function useFocus(context: FloatingContext, props?: UseFocusProps): ElementProps; | ||
export declare function useFocus(context: FloatingRootContext, props?: UseFocusProps): ElementProps; | ||
@@ -929,3 +958,3 @@ export declare interface UseFocusProps { | ||
*/ | ||
export declare function useHover(context: FloatingContext, props?: UseHoverProps): ElementProps; | ||
export declare function useHover(context: FloatingRootContext, props?: UseHoverProps): ElementProps; | ||
@@ -988,3 +1017,3 @@ export declare interface UseHoverProps { | ||
*/ | ||
export declare function useInnerOffset(context: FloatingContext, props: UseInnerOffsetProps): ElementProps; | ||
export declare function useInnerOffset(context: FloatingRootContext, props: UseInnerOffsetProps): ElementProps; | ||
@@ -1048,3 +1077,3 @@ export declare interface UseInnerOffsetProps { | ||
*/ | ||
export declare function useListNavigation(context: FloatingContext, props: UseListNavigationProps): ElementProps; | ||
export declare function useListNavigation(context: FloatingRootContext, props: UseListNavigationProps): ElementProps; | ||
@@ -1197,3 +1226,3 @@ export declare interface UseListNavigationProps { | ||
*/ | ||
export declare function useRole(context: FloatingContext, props?: UseRoleProps): ElementProps; | ||
export declare function useRole(context: FloatingRootContext, props?: UseRoleProps): ElementProps; | ||
@@ -1271,3 +1300,3 @@ export declare interface UseRoleProps { | ||
*/ | ||
export declare function useTypeahead(context: FloatingContext, props: UseTypeaheadProps): ElementProps; | ||
export declare function useTypeahead(context: FloatingRootContext, props: UseTypeaheadProps): ElementProps; | ||
@@ -1274,0 +1303,0 @@ export declare interface UseTypeaheadProps { |
@@ -6,2 +6,2 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/react-dom"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/react-dom","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.React,e.FloatingUIReactDOM,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(t);function i(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 c={...u},l=c.useInsertionEffect||(e=>e());function s(e){const t=u.useRef((()=>{}));return l((()=>{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 a(e){return d(e)?(e.nodeName||"").toLowerCase():"#document"}function f(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function d(e){return e instanceof Node||e instanceof f(e).Node}function v(e){return e instanceof Element||e instanceof f(e).Element}function m(e){return e instanceof HTMLElement||e instanceof f(e).HTMLElement}function p(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof f(e).ShadowRoot)}function g(e){return["html","body","#document"].includes(a(e))}function h(e){if("html"===a(e))return e;const t=e.assignedSlot||e.parentNode||p(e)&&e.host||function(e){var t;return null==(t=(d(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return p(t)?t.host:t}function y(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 b(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&p(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function w(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function E(){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 x(e){return!(0!==e.mozInputSource||!e.isTrusted)||(k()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function R(e){return!E().includes("jsdom/")&&(!k()&&0===e.width&&0===e.height||k()&&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 I(){return/apple/i.test(navigator.vendor)}function k(){const e=/android/i;return e.test(w())||e.test(E())}function O(){return w().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function C(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function M(e){return(null==e?void 0:e.ownerDocument)||document}function T(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function S(e){return"composedPath"in e?e.composedPath()[0]:e.target}const P="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function L(e){return m(e)&&e.matches(P)}function A(e){e.preventDefault(),e.stopPropagation()}function N(e){return!!e&&("combobox"===e.getAttribute("role")&&L(e))}const D=Math.floor,F="ArrowUp",j="ArrowDown",K="ArrowLeft",H="ArrowRight";function q(e,t,n){return Math.floor(e/t)!==n}function _(e,t){return t<0||t>=e.current.length}function B(e,t){return U(e,{disabledIndices:t})}function W(e,t){return U(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function U(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current,c=o?e=>o.includes(e):e=>{const t=i[e];return null==t||t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled")};let l=n;do{l+=r?-u:u}while(l>=0&&l<=i.length-1&&c(l));return l}function z(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===F){if(a&&A(n),-1===s)f=l;else if(f=U(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}_(e,f)&&(f=s)}if(n.key===j&&(a&&A(n),-1===s?f=c:(f=U(e,{startingIndex:s,amount:u,disabledIndices:i}),o&&s+u>l&&(f=U(e,{startingIndex:s%u-u,amount:u,disabledIndices:i}))),_(e,f)&&(f=s)),"both"===r){const t=D(s/u);n.key===H&&(a&&A(n),s%u!=u-1?(f=U(e,{startingIndex:s,disabledIndices:i}),o&&q(f,u,t)&&(f=U(e,{startingIndex:s-s%u-1,disabledIndices:i}))):o&&(f=U(e,{startingIndex:s-s%u-1,disabledIndices:i})),q(f,u,t)&&(f=s)),n.key===K&&(a&&A(n),s%u!=0?(f=U(e,{startingIndex:s,disabledIndices:i,decrement:!0}),o&&q(f,u,t)&&(f=U(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i}))):o&&(f=U(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i})),q(f,u,t)&&(f=s));const r=D(l/u)===t;_(e,f)&&(f=o&&r?n.key===K?l:U(e,{startingIndex:s-s%u-1,disabledIndices:i}):s)}return f}function X(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 Y(e,t,n,r,o){if(-1===e)return-1;const u=n.indexOf(e);switch(o){case"tl":return u;case"tr":return u+t[e].width-1;case"bl":return u+(t[e].height-1)*r;case"br":return n.lastIndexOf(e)}}function V(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}let G=0;function Z(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(G);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():G=requestAnimationFrame(u)}var $="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function Q(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 J=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function ee(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 $((()=>{const e=new Map(o);Array.from(e.keys()).sort(Q).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(J.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function te(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:i,labelsRef:c}=u.useContext(J),[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 $((()=>{const e=a.current;if(e)return n(e),()=>{r(e)}}),[n,r]),$((()=>{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 ne(e,t){return"function"==typeof e?e(t):e?u.cloneElement(e,t):u.createElement("div",t)}const re=u.createContext({activeIndex:0,onNavigate:()=>{}}),oe=[K,H],ue=[F,j],ie=[...oe,...ue],ce=u.forwardRef((function(e,t){const{render:n,orientation:r="both",loop:o=!0,cols:i=1,disabledIndices:c=[],activeIndex:l,onNavigate:a,itemSizes:f,dense:d=!1,...v}=e,[m,p]=u.useState(0),g=null!=l?l:m,h=s(null!=a?a:p),y=u.useRef([]),b=n&&"function"!=typeof n?n.props:{},w=u.useMemo((()=>({activeIndex:g,onNavigate:h})),[g,h]),E=i>1;const x={...v,...b,ref:t,"aria-orientation":"both"===r?void 0:r,onKeyDown(e){null==v.onKeyDown||v.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!ie.includes(e.key))return;let t=g;if(E){const n=f||Array.from({length:y.current.length},(()=>({width:1,height:1}))),u=X(n,i,d),l=u.findIndex((e=>null!=e&&!c.includes(e))),s=u.reduce(((e,t,n)=>null==t||null!=c&&c.includes(t)?e:n),-1);t=u[z({current:u.map((e=>e?y.current[e]:null))},{event:e,orientation:r,loop:o,cols:i,disabledIndices:V([...c,void 0],u),minIndex:l,maxIndex:s,prevIndex:Y(g,n,u,i,e.key===j?"bl":e.key===H?"tr":"tl")})]}const n=B(y,c),u=W(y,c),l={horizontal:[H],vertical:[j],both:[H,j]}[r],s={horizontal:[K],vertical:[F],both:[K,F]}[r],a=E?ie:{horizontal:oe,vertical:ue,both:ie}[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:U(y,{startingIndex:t,decrement:s.includes(e.key),disabledIndices:c})),t===g||_(y,t)||(e.stopPropagation(),a.includes(e.key)&&e.preventDefault(),h(t),queueMicrotask((()=>{Z(y.current[t])})))}(e)}};return u.createElement(re.Provider,{value:w},u.createElement(ee,{elementsRef:y},ne(n,x)))})),le=u.forwardRef((function(e,t){const{render:n,...r}=e,o=n&&"function"!=typeof n?n.props:{},{activeIndex:c,onNavigate:l}=u.useContext(re),{ref:s,index:a}=te(),f=i([s,t,o.ref]),d=c===a;return ne(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 se(){return se=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},se.apply(this,arguments)}let ae=!1,fe=0;const de=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fe++;const ve=c.useId||function(){const[e,t]=u.useState((()=>ae?de():void 0));return $((()=>{null==e&&t(de())}),[]),u.useEffect((()=>{ae=!0}),[]),e},me=u.forwardRef((function(e,t){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:c=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:v,style:{transform:m,...p}={},...g}=e,h=ve();if(!o)return null;const y=2*a,b=y/2,w=c/2*(s/-8+1),E=l/2*s/4,[x,R]=r.split("-"),I=n.platform.isRTL(o),k=!!v,O="top"===x||"bottom"===x,C=f&&"end"===R?"bottom":"top";let M=f&&"end"===R?"right":"left";f&&I&&(M="end"===R?"left":"right");const T=null!=(null==i?void 0:i.x)?f||i.x:"",S=null!=(null==i?void 0:i.y)?f||i.y:"",P=v||"M0,0 H"+c+" L"+(c-w)+","+(l-E)+" Q"+c/2+","+l+" "+w+","+(l-E)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",se({},g,{"aria-hidden":!0,ref:t,width:k?c:c+y,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[M]:T,[C]:S,[x]:O||k?"100%":"calc(100% - "+y/2+"px)",transform:""+L+(null!=m?m:""),...p}}),y>0&&u.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:y+(v?0:1),d:P}),u.createElement("path",{stroke:y&&!v?g.fill:"none",d:P}),u.createElement("clipPath",{id:h},u.createElement("rect",{x:-b,y:b*(k?-1:1),width:c+y,height:c})))}));function pe(){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 ge=u.createContext(null),he=u.createContext(null),ye=()=>{var e;return(null==(e=u.useContext(ge))?void 0:e.id)||null},be=()=>u.useContext(he);function we(e){return"data-floating-ui-"+e}function Ee(e){const n=t.useRef(e);return $((()=>{n.current=e})),n}const xe=we("safe-polygon");function Re(e,t,n){return n&&!C(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const Ie=()=>{},ke=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ie,setState:Ie,isInstantPhase:!1}),Oe=()=>u.useContext(ke); | ||
*/ | ||
var Ce=["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(","),Me="undefined"==typeof Element,Te=Me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Se=!Me&&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},Pe=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)},Le=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if(!Pe(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{Te.call(i,Ce)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!Pe(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},Ae=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ne=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))&&!Ae(e)?0:e.tabIndex},De=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Fe=function(e){return"INPUT"===e.tagName},je=function(e){return function(e){return Fe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Se(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)},Ke=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},He=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Te.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Te.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ke(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=Se(e);if(i&&!i.shadowRoot&&!0===r(i))return Ke(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&&Se(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=Se(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},qe=function(e,t){return!(t.disabled||Pe(t)||function(e){return Fe(e)&&"hidden"===e.type}(t)||He(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!!Te.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},_e=function(e,t){return!(je(t)||Ne(t)<0||!qe(e,t))},Be=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},We=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=Ne(e);return n<0&&t&&!Ae(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(De).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ue=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Le([e],t.includeContainer,{filter:_e.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Be}):function(e,t,n){if(Pe(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Ce));return t&&Te.call(e,Ce)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,_e.bind(null,t)),We(n)},ze=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Te.call(e,Ce)&&_e(t,e)};function Xe(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 Ye=new WeakMap,Ve=new WeakSet,Ge={},Ze=0;const $e=e=>e&&(e.host||$e(e.parentNode)),Qe=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=$e(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Je(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=M(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=Qe(t,e),c=new Set,l=new Set(i),s=[];Ge[o]||(Ge[o]=new WeakMap);const a=Ge[o];return i.forEach((function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&Array.prototype.forEach.call(t.children,(t=>{if(c.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(Ye.get(t)||0)+1,i=(a.get(t)||0)+1;Ye.set(t,r),a.set(t,i),s.push(t),1===r&&n&&Ve.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),c.clear(),Ze++,()=>{s.forEach((e=>{const t=(Ye.get(e)||0)-1,n=(a.get(e)||0)-1;Ye.set(e,t),a.set(e,n),t||(!Ve.has(e)&&u&&e.removeAttribute(u),Ve.delete(e)),n||e.removeAttribute(o)})),Ze--,Ze||(Ye=new WeakMap,Ye=new WeakMap,Ve=new WeakSet,Ge={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const et=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tt(e,t){const n=Ue(e,et());"prev"===t&&n.reverse();const r=n.indexOf(y(M(e)));return n.slice(r+1)[0]}function nt(){return tt(document.body,"next")}function rt(){return tt(document.body,"prev")}function ot(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!b(n,r)}function ut(e){Ue(e,et()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function it(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 ct={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 lt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const st=u.forwardRef((function(e,t){const[n,r]=u.useState();$((()=>(I()&&r("button"),document.addEventListener("keydown",lt),()=>{document.removeEventListener("keydown",lt)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[we("focus-guard")]:"",style:ct};return u.createElement("span",se({},e,o))})),at=u.createContext(null),ft=we("portal");function dt(e){void 0===e&&(e={});const{id:t,root:n}=e,r=ve(),o=vt(),[i,c]=u.useState(null),l=u.useRef(null);return $((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{l.current=null}))}),[i]),$((()=>{if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(ft,""),e.appendChild(n),l.current=n,c(n)}),[t,r]),$((()=>{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(ft,""),e=u||e,e.appendChild(i),l.current=i,c(i)}),[t,n,r,o]),i}const vt=()=>u.useContext(at),mt=20;let pt=[];function gt(e){pt=pt.filter((e=>e.isConnected));let t=e;if(t&&"body"!==a(t)){if(!ze(t,et())){const e=Ue(t,et())[0];e&&(t=e)}pt.push(t),pt.length>mt&&(pt=pt.slice(-mt))}}function ht(){return pt.slice().reverse().find((e=>e.isConnected))}const yt=u.forwardRef((function(e,t){return u.createElement("button",se({},e,{type:"button",ref:t,tabIndex:-1,style:ct}))}));const bt=new Set,wt=u.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e,o=ve();return $((()=>{if(!n)return;bt.add(o);const e=/iP(hone|ad|od)|iOS/.test(w()),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.pageXOffset,c=t.top?parseFloat(t.top):window.pageYOffset;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()=>{bt.delete(o),0===bt.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,c)))}}),[o,n]),u.createElement("div",se({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Et(e){return m(e.target)&&"BUTTON"===e.target.tagName}function xt(e){return L(e)}function Rt(e){return null!=e&&null!=e.clientX}const It={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},kt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ot=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}};const Ct="active",Mt="selected";function Tt(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[Ct]:t,[Mt]: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&&[Ct,Mt].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 St=!1;function Pt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Lt(e,t){return Pt(t,e===F||e===j,e===K||e===H)}function At(e,t,n){return Pt(t,e===j,n?e===K:e===H)||"Enter"===e||" "===e||""===e}function Nt(e,t,n){return Pt(t,n?e===H:e===K,e===F)}const Dt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const Ft=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function jt(e,t){return"function"==typeof e?e(t):e}function Kt(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(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return $((()=>{c&&!f&&a("unmounted")}),[c,f]),$((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function Ht(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function qt(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 n.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return n.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return n.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return n.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return n.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return n.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return n.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return n.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return n.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return n.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return n.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return n.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return n.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return n.size}}),e.Composite=ce,e.CompositeItem=le,e.FloatingArrow=me,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 $((()=>{o.currentId?null===c.current?c.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),c.current=null)}),[o.currentId]),u.createElement(ke.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,modal:s=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:v,nodeId:p,onOpenChange:g,events:h,dataRef:w,elements:{domReference:E,floating:I}}=t,k="number"==typeof c&&c<0,O=N(E)&&k,C="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,T=Ee(o),P=Ee(c),L=Ee(l),D=be(),F=vt(),j=u.useRef(null),K=u.useRef(null),H=u.useRef(!1),q=u.useRef(!1),_=null!=F,B=u.useCallback((function(e){return void 0===e&&(e=I),e?Ue(e,et()):[]}),[I]),W=u.useCallback((e=>{const t=B(e);return T.current.map((e=>E&&"reference"===e?E:I&&"floating"===e?I:t)).filter(Boolean).flat()}),[E,I,T,B]);function U(e){return!r&&a&&s?u.createElement(yt,{ref:"start"===e?j:K,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof a?a:"Dismiss"):null}u.useEffect((()=>{if(r||!s)return;function e(e){if("Tab"===e.key){b(I,y(M(I)))&&0===B().length&&!O&&A(e);const t=W(),n=S(e);"reference"===T.current[0]&&n===E&&(A(e),e.shiftKey?Z(t[t.length-1]):Z(t[1])),"floating"===T.current[1]&&n===I&&e.shiftKey&&(A(e),Z(t[0]))}}const t=M(I);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,E,I,s,T,O,B,W]),u.useEffect((()=>{if(!r&&f)return I&&m(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),!s&&I.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),!s&&I.removeEventListener("focusout",t)}):void 0;function e(){q.current=!0,setTimeout((()=>{q.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(b(E,t)||b(I,t)||b(t,I)||b(null==F?void 0:F.portalNode,t)||null!=t&&t.hasAttribute(we("focus-guard"))||D&&(Xe(D.nodesRef.current,p).find((e=>{var n,r;return b(null==(n=e.context)?void 0:n.elements.floating,t)||b(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}(D.nodesRef.current,p).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!q.current&&t!==ht()&&(H.current=!0,g(!1,e))}))}}),[r,E,I,s,p,D,F,g,f]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==F||null==(e=F.portalNode)?void 0:e.querySelectorAll("["+we("portal")+"]"))||[]);if(I){const e=[I,...t,j.current,K.current,T.current.includes("reference")||O?E:null].filter((e=>null!=e)),n=s||O?Je(e,C,!C):Je(e);return()=>{n()}}}),[r,E,I,s,T,F,O,C]),$((()=>{if(r||!I)return;const e=y(M(I));queueMicrotask((()=>{const t=W(I),n=P.current,r=("number"==typeof n?t[n]:n.current)||I,o=b(I,e);k||o||!d||Z(r,{preventScroll:r===I})}))}),[r,d,I,k,W,P]),$((()=>{if(r||!I)return;let e=!1;const t=M(I),n=y(t);let o=w.current.openEvent;function u(t){let{open:n,reason:r,event:u,nested:i}=t;n&&(o=u),"escape-key"===r&&v.domReference.current&>(v.domReference.current),"hover"===r&&"mouseleave"===u.type&&(H.current=!0),"outside-press"===r&&(i?(H.current=!1,e=!0):H.current=!(x(u)||R(u)))}return gt(n),h.on("openchange",u),()=>{h.off("openchange",u);const n=y(t),r=b(I,n)||D&&Xe(D.nodesRef.current,p).some((e=>{var t;return b(null==(t=e.context)?void 0:t.elements.floating,n)}));(r||o&&["click","mousedown"].includes(o.type))&&v.domReference.current&>(v.domReference.current);const i=ht();L.current&&!H.current&&m(i)&&(i===n||n===t.body||r)&&Z(i,{cancelPrevious:!1,preventScroll:e})}}),[r,I,L,w,v,h,D,p]),$((()=>{if(!r&&F)return F.setFocusManagerState({modal:s,closeOnFocusOut:f,open:d,onOpenChange:g,refs:v}),()=>{F.setFocusManagerState(null)}}),[r,F,s,d,g,v,f]),$((()=>{if(r||!I||"function"!=typeof MutationObserver||k)return;const e=()=>{const e=I.getAttribute("tabindex");T.current.includes("floating")||y(M(I))!==v.domReference.current&&0===B().length?"0"!==e&&I.setAttribute("tabindex","0"):"-1"!==e&&I.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(I,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,I,v,T,B,k]);const z=!r&&C&&(_||s);return u.createElement(u.Fragment,null,z&&u.createElement(st,{"data-type":"inside",ref:null==F?void 0:F.beforeInsideRef,onFocus:e=>{if(s){const e=W();Z("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(H.current=!1,ot(e,F.portalNode)){const e=nt()||E;null==e||e.focus()}else{var t;null==(t=F.beforeOutsideRef.current)||t.focus()}}}),!O&&U("start"),n,U("end"),z&&u.createElement(st,{"data-type":"inside",ref:null==F?void 0:F.afterInsideRef,onFocus:e=>{if(s)Z(W()[0]);else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(f&&(H.current=!0),ot(e,F.portalNode)){const e=rt()||E;null==e||e.focus()}else{var t;null==(t=F.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=ee,e.FloatingNode=function(e){const{children:t,id:n}=e,r=ye();return u.createElement(ge.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=wt,e.FloatingPortal=function(e){const{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e,c=dt({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),v=u.useRef(null),m=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&ot(e)){("focusin"===e.type?it:ut)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(at.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:v,portalNode:c,setFocusManagerState:s})),[i,c])},m&&c&&u.createElement(st,{"data-type":"outside",ref:a,onFocus:e=>{if(ot(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=rt()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),m&&c&&u.createElement("span",{"aria-owns":c.id,style:ct}),c&&r.createPortal(t,c),m&&c&&u.createElement(st,{"data-type":"outside",ref:f,onFocus:e=>{if(ot(e,c)){var t;null==(t=v.current)||t.focus()}else{const t=nt()||(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((()=>pe()))[0];return u.createElement(he.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:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:v,elements:{floating:m}}=t,p=o.current[l];if(!p)return{};const g={...t,...await n.offset(-p.offsetTop-m.clientTop-v.reference.height/2-p.offsetHeight/2-c).fn(t)},h=(null==f?void 0:f.current)||m,y=await n.detectOverflow(Ht(g,h.scrollHeight),d),b=await n.detectOverflow(g,{...d,elementContext:"reference"}),w=Math.max(0,y.top),E=g.y+w,x=Math.max(0,h.scrollHeight-w-Math.max(0,y.bottom));return h.style.maxHeight=x+"px",h.scrollTop=w,i&&(h.offsetHeight<p.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await n.detectOverflow(Ht({...g,y:E},h.offsetHeight),d)),{y:E}}}),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,w=[h,y],E=S(e),x="mouseleave"===e.type,R=b(f.floating,E),I=b(f.domReference,E),k=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],M=n>O.right-O.width/2,T=s>O.bottom-O.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(w,k),L=O.width>k.width,A=O.height>k.height,N=(L?k:O).left,D=(L?k:O).right,F=(A?k:O).top,j=(A?k:O).bottom;if(R&&(u=!0,!x))return;if(I&&(u=!1),I&&!x)return void(u=!0);if(x&&v(e.relatedTarget)&&b(f.floating,e.relatedTarget))return;if(p&&Xe(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===C&&s>=k.bottom-1||"bottom"===C&&s<=k.top+1||"left"===C&&n>=k.right-1||"right"===C&&n<=k.left+1)return g();let K=[];switch(C){case"top":K=[[N,k.top+1],[N,O.bottom-1],[D,O.bottom-1],[D,k.top+1]];break;case"bottom":K=[[N,O.top+1],[N,k.bottom-1],[D,k.bottom-1],[D,O.top+1]];break;case"left":K=[[O.right-1,j],[O.right-1,F],[k.left+1,F],[k.left+1,j]];break;case"right":K=[[k.right-1,j],[k.right-1,F],[O.left+1,F],[O.left+1,j]]}if(!qt([h,y],K)){if(u&&!P)return g();if(!x&&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()}qt([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[L?n+t/2:M?n+4*t:n-4*t,r+t+1],[L?n-t/2:M?n+4*t:n-4*t,r+t+1],...[[O.left,M||L?O.bottom-t:O.top],[O.right,M?L?O.bottom-t:O.top:O.bottom-t]]];case"bottom":return[[L?n+t/2:M?n+4*t:n-4*t,r-t],[L?n-t/2:M?n+4*t:n-4*t,r-t],...[[O.left,M||L?O.top+t:O.bottom],[O.right,M?L?O.top+t:O.bottom:O.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?O.right-t:O.left,O.top],[T?A?O.right-t:O.left:O.right-t,O.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?O.left+t:O.right,O.top],[T?A?O.left+t:O.right:O.left+t,O.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(),v=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(C(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:C(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Et(e)||(" "!==e.key||xt(i)||(e.preventDefault(),v.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||Et(e)||xt(i)||" "===e.key&&v.current&&(v.current=!1,r(!n||!s,e.nativeEvent,"click"))}}}:{}),[c,o,l,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:c=!0,axis:l="both",x:a=null,y:d=null}=t,v=u.useRef(!1),m=u.useRef(null),[p,g]=u.useState(),[h,y]=u.useState([]),w=s(((e,t)=>{v.current||o.current.openEvent&&!Rt(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,v=c.x,m=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),v-=n||0,m-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,v=l&&null!=t.x?t.x:v,m=s&&null!=t.y?t.y:m):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:v,y:m,top:m,right:v+f,bottom:m+d,left:v}}}}(r.domReference,{x:e,y:t,axis:l,dataRef:o,pointerType:p}))})),E=s((e=>{null==a&&null==d&&(n?m.current||y([]):w(e.clientX,e.clientY))})),x=C(p)?i:n,R=u.useCallback((()=>{if(!x||!c||null!=a||null!=d)return;const e=f(r.floating.current);function t(n){const o=S(n);b(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):w(n.clientX,n.clientY)}if(!o.current.openEvent||Rt(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,c,x,r,w,a,d]);return u.useEffect((()=>R()),[R,h]),u.useEffect((()=>{c&&!i&&(v.current=!1)}),[c,i]),u.useEffect((()=>{!c&&n&&(v.current=!0)}),[c,n]),$((()=>{!c||null==a&&null==d||(v.current=!1,w(a,d))}),[c,a,d,w]),u.useMemo((()=>{if(!c)return{};function e(e){let{pointerType:t}=e;g(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:E,onMouseEnter:E}}}),[c,E])},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=Oe(),{currentId:l,setCurrentId:s,initialDelay:a,setState:f,timeoutMs:d}=c;return $((()=>{l&&(f({delay:{open:1,close:Re(a,"close")}}),l!==i&&r(!1))}),[i,r,f,l,a]),$((()=>{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]),$((()=>{s!==Ie&&n&&s(i)}),[n,s,i]),c},e.useDelayGroupContext=Oe,e.useDismiss=function(e,t){void 0===t&&(t={});const{open:r,onOpenChange:o,nodeId:i,elements:{reference:c,domReference:l,floating:a},dataRef:d}=e,{enabled:p=!0,escapeKey:y=!0,outsidePress:w=!0,outsidePressEvent:E="pointerdown",referencePress:x=!1,referencePressEvent:R="pointerdown",ancestorScroll:I=!1,bubbles:k,capture:O}=t,C=be(),P=s("function"==typeof w?w:()=>!1),L="function"==typeof w?P:w,A=u.useRef(!1),N=u.useRef(!1),{escapeKey:D,outsidePress:F}=Ot(k),{escapeKey:j,outsidePress:K}=Ot(O),H=s((e=>{if(!r||!p||!y||"Escape"!==e.key)return;const t=C?Xe(C.nodesRef.current,i):[];if(!D&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),q=s((e=>{var t;const n=()=>{var t;H(e),null==(t=S(e))||t.removeEventListener("keydown",n)};null==(t=S(e))||t.addEventListener("keydown",n)})),_=s((e=>{const t=A.current;A.current=!1;const n=N.current;if(N.current=!1,"click"===E&&n)return;if(t)return;if("function"==typeof L&&!L(e))return;const r=S(e),u="["+we("inert")+"]",c=M(a).querySelectorAll(u);let s=v(r)?r:null;for(;s&&!g(s);){const e=h(s);if(g(e)||!v(e))break;s=e}if(c.length&&v(r)&&!r.matches("html,body")&&!b(r,a)&&Array.from(c).every((e=>!b(s,e))))return;if(m(r)&&a){const t=r.clientWidth>0&&r.scrollWidth>r.clientWidth,n=r.clientHeight>0&&r.scrollHeight>r.clientHeight;let o=n&&e.offsetX>r.clientWidth;if(n){const t="rtl"===function(e){return f(e).getComputedStyle(e)}(r).direction;t&&(o=e.offsetX<=r.offsetWidth-r.clientWidth)}if(o||t&&e.offsetY>r.clientHeight)return}const d=C&&Xe(C.nodesRef.current,i).some((t=>{var n;return T(e,null==(n=t.context)?void 0:n.elements.floating)}));if(T(e,a)||T(e,l)||d)return;const p=C?Xe(C.nodesRef.current,i):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),B=s((e=>{var t;const n=()=>{var t;_(e),null==(t=S(e))||t.removeEventListener(E,n)};null==(t=S(e))||t.addEventListener(E,n)}));return u.useEffect((()=>{if(!r||!p)return;function e(e){o(!1,e,"ancestor-scroll")}d.current.__escapeKeyBubbles=D,d.current.__outsidePressBubbles=F;const t=M(a);y&&t.addEventListener("keydown",j?q:H,j),L&&t.addEventListener(E,K?B:_,K);let u=[];return I&&(v(l)&&(u=n.getOverflowAncestors(l)),v(a)&&(u=u.concat(n.getOverflowAncestors(a))),!v(c)&&c&&c.contextElement&&(u=u.concat(n.getOverflowAncestors(c.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})})),()=>{y&&t.removeEventListener("keydown",j?q:H,j),L&&t.removeEventListener(E,K?B:_,K),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[d,a,l,c,y,L,E,r,o,I,p,D,F,H,j,q,_,K,B]),u.useEffect((()=>{A.current=!1}),[L,E]),u.useMemo((()=>p?{reference:{onKeyDown:H,[It[R]]:e=>{x&&o(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:H,onMouseDown(){N.current=!0},onMouseUp(){N.current=!0},[kt[E]]:()=>{A.current=!0}}}:{}),[p,x,E,R,o,H])},e.useFloating=function(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[c,l]=u.useState(null),[a,f]=u.useState(null),d=(null==(t=e.elements)?void 0:t.reference)||c;$((()=>{d&&(y.current=d)}),[d]);const m=n.useFloating({...e,elements:{...e.elements,...a&&{reference:a}}}),p=be(),g=null!=ye(),h=s(((e,t,n)=>{b.current.openEvent=e?t:void 0,w.emit("openchange",{open:e,event:t,reason:n,nested:g}),null==o||o(e,t,n)})),y=u.useRef(null),b=u.useRef({}),w=u.useState((()=>pe()))[0],E=ve(),x=u.useCallback((e=>{const t=v(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f(t),m.refs.setReference(t)}),[m.refs]),R=u.useCallback((e=>{(v(e)||null===e)&&(y.current=e,l(e)),(v(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!v(e))&&m.refs.setReference(e)}),[m.refs]),I=u.useMemo((()=>({...m.refs,setReference:R,setPositionReference:x,domReference:y})),[m.refs,R,x]),k=u.useMemo((()=>({...m.elements,domReference:d})),[m.elements,d]),O=u.useMemo((()=>({...m,refs:I,elements:k,dataRef:b,nodeId:i,floatingId:E,events:w,open:r,onOpenChange:h})),[m,i,E,w,r,h,I,k]);return $((()=>{const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===i));e&&(e.context=O)})),u.useMemo((()=>({...m,context:O,refs:I,elements:k})),[m,I,k,O])},e.useFloatingNodeId=function(e){const t=ve(),n=be(),r=ye(),o=e||r;return $((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=ye,e.useFloatingPortalNode=dt,e.useFloatingTree=be,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,refs:i,elements:{domReference:c}}=e,{enabled:l=!0,visibleOnly:s=!0}=t,a=u.useRef(!1),d=u.useRef(),p=u.useRef(!0);return u.useEffect((()=>{if(!l)return;const e=f(c);function t(){!n&&m(c)&&c===y(M(c))&&(a.current=!0)}function r(){p.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[c,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(d.current)}),[]),u.useMemo((()=>l?{reference:{onPointerDown(e){R(e.nativeEvent)||(p.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=S(e.nativeEvent);if(s&&v(t))try{if(I()&&O())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!p.current&&!L(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=v(t)&&t.hasAttribute(we("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{const o=y(c?c.ownerDocument:document);(t||o!==c)&&(b(i.floating.current,o)||b(c,o)||n||r(!1,e.nativeEvent,"focus"))}))}}}:{}),[l,s,c,i,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:c,floating:l},refs:s}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:m=!1,restMs:p=0,move:g=!0}=t,h=be(),y=ye(),w=Ee(d),E=Ee(f),x=u.useRef(),R=u.useRef(-1),I=u.useRef(),k=u.useRef(-1),O=u.useRef(!0),T=u.useRef(!1),S=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(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(R.current),clearTimeout(k.current),O.current=!0)}}),[a,i]),u.useEffect((()=>{if(!a||!w.current||!n)return;function e(e){P()&&r(!1,e,"hover")}const t=M(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,a,w,P]);const L=u.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Re(E.current,"close",x.current);o&&!I.current?(clearTimeout(R.current),R.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(R.current),r(!1,e,n))}),[E,r]),A=u.useCallback((()=>{S.current(),I.current=void 0}),[]),N=u.useCallback((()=>{if(T.current){const e=M(s.floating.current).body;e.style.pointerEvents="",e.removeAttribute(xe),T.current=!1}}),[s]);return u.useEffect((()=>{if(a&&v(c)){const e=c;return n&&e.addEventListener("mouseleave",s),null==l||l.addEventListener("mouseleave",s),g&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",s),null==l||l.removeEventListener("mouseleave",s),g&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(R.current),O.current=!1,m&&!C(x.current)||p>0&&!Re(E.current,"open"))return;const t=Re(E.current,"open",x.current);t?R.current=window.setTimeout((()=>{r(!0,e,"hover")}),t):r(!0,e,"hover")}function i(r){if(t())return;S.current();const o=M(l);if(clearTimeout(k.current),w.current){n||clearTimeout(R.current),I.current=w.current({...e,tree:h,x:r.clientX,y:r.clientY,onClose(){N(),A(),L(r,!0,"safe-polygon")}});const t=I.current;return o.addEventListener("mousemove",t),void(S.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==x.current||!b(l,r.relatedTarget))&&L(r)}function s(n){t()||null==w.current||w.current({...e,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),A(),L(n)}})(n)}}),[c,l,a,e,m,p,g,L,A,N,r,n,h,E,w,o]),$((()=>{var e;if(a&&n&&null!=(e=w.current)&&e.__options.blockPointerEvents&&P()){const e=M(l).body;if(e.setAttribute(xe,""),e.style.pointerEvents="none",T.current=!0,v(c)&&l){var t;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===y)))||null==(t=t.context)?void 0:t.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[a,n,y,l,c,h,w,P]),$((()=>{n||(x.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(R.current),clearTimeout(k.current),N()}),[a,c,A,N]),u.useMemo((()=>{if(!a)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){function t(){O.current||r(!0,e.nativeEvent,"hover")}m&&!C(x.current)||n||0===p||(clearTimeout(k.current),"touch"===x.current?t():k.current=window.setTimeout(t,p))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){L(e.nativeEvent,!1)}}}}),[a,m,n,p,r,L])},e.useId=ve,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:a}=t,f=s(a),d=u.useRef(!1),v=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{f((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(E())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{v.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{v.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,f]),u.useMemo((()=>i?{floating:{onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&d.current){if(null!==v.current){const t=e.scrollTop-v.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>f((e=>e+t))))}requestAnimationFrame((()=>{v.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,f])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>Tt(t,e,"reference")),t),r=u.useCallback((t=>Tt(t,e,"floating")),t),o=u.useCallback((t=>Tt(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=te,e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:c}}=e,{listRef:l,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:v=null,allowEscape:p=!1,loop:g=!1,nested:h=!1,rtl:w=!1,virtual:E=!1,focusItemOnOpen:k="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:T=!0,disabledIndices:S,orientation:P="vertical",cols:L=1,scrollItemIntoView:D=!0,virtualItemRef:F,itemSizes:q,dense:G=!1}=t,Q=ye(),J=be(),ee=s(f),te=u.useRef(k),ne=u.useRef(null!=v?v:-1),re=u.useRef(null),oe=u.useRef(!0),ue=u.useRef(ee),ie=u.useRef(!!c),ce=u.useRef(!1),le=u.useRef(!1),se=Ee(S),ae=Ee(n),fe=Ee(D),[de,ve]=u.useState(),[me,pe]=u.useState(),ge=s((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(E?(ve(r.id),null==J||J.events.emit("virtualfocus",r),F&&(F.current=r)):Z(r,{preventScroll:!0,sync:!(!O()||!I())&&(St||ce.current)}),requestAnimationFrame((()=>{const e=fe.current;e&&r&&(n||!oe.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));$((()=>{document.createElement("div").focus({get preventScroll(){return St=!0,!1}})}),[]),$((()=>{d&&(n&&c?te.current&&null!=v&&(le.current=!0,ne.current=v,ee(v)):ie.current&&(ne.current=-1,ue.current(null)))}),[d,n,c,v,ee]),$((()=>{if(d&&n&&c)if(null==a){if(ce.current=!1,null!=v)return;if(ie.current&&(ne.current=-1,ge(l,ne)),!ie.current&&te.current&&(null!=re.current||!0===te.current&&null==re.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else ne.current=null==re.current||At(re.current,P,w)||h?B(l,se.current):W(l,se.current),re.current=null,ee(ne.current)};t()}}else _(l,a)||(ne.current=a,ge(l,ne,le.current),le.current=!1)}),[d,n,c,a,v,h,l,P,w,ee,ge,se]),$((()=>{var e;if(!d||c||!J||E||!ie.current)return;const t=J.nodesRef.current,n=null==(e=t.find((e=>e.id===Q)))||null==(e=e.context)?void 0:e.elements.floating,r=y(M(c)),o=t.some((e=>e.context&&b(e.context.elements.floating,r)));n&&!o&&oe.current&&n.focus({preventScroll:!0})}),[d,c,J,Q,E]),$((()=>{if(d&&J&&E&&!Q)return J.events.on("virtualfocus",e),()=>{J.events.off("virtualfocus",e)};function e(e){pe(e.id),F&&(F.current=e)}}),[d,J,E,Q,F]),$((()=>{ue.current=ee,ie.current=!!c})),$((()=>{n||(re.current=null)}),[n]);const he=null!=a,we=u.useMemo((()=>{function e(e){if(!n)return;const t=l.current.indexOf(e);-1!==t&&ee(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...C&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;oe.current&&"touch"!==t&&(ne.current=-1,ge(l,ne),ee(null),E||Z(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ge,C,l,ee,E]);return u.useMemo((()=>{if(!d)return{};const e=se.current;function t(t){if(oe.current=!1,ce.current=!0,!ae.current&&t.currentTarget===o.floating.current)return;if(h&&Nt(t.key,P,w))return A(t),r(!1,t.nativeEvent,"list-navigation"),void(m(i)&&!E&&i.focus());const u=ne.current,c=B(l,e),s=W(l,e);if("Home"===t.key&&(A(t),ne.current=c,ee(ne.current)),"End"===t.key&&(A(t),ne.current=s,ee(ne.current)),L>1){const n=q||Array.from({length:l.current.length},(()=>({width:1,height:1}))),r=X(n,L,G),o=r.findIndex((t=>null!=t&&!(null!=e&&e.includes(t)))),u=r.reduce(((t,n,r)=>null==n||null!=e&&e.includes(n)?t:r),-1);if(ne.current=r[z({current:r.map((e=>null!=e?l.current[e]:null))},{event:t,orientation:P,loop:g,cols:L,disabledIndices:V([...e||[],void 0],r),minIndex:o,maxIndex:u,prevIndex:Y(ne.current,n,r,L,t.key===j?"bl":t.key===H?"tr":"tl"),stopEvent:!0})],ee(ne.current),"both"===P)return}if(Lt(t.key,P)){if(A(t),n&&!E&&y(t.currentTarget.ownerDocument)===t.currentTarget)return ne.current=At(t.key,P,w)?c:s,void ee(ne.current);At(t.key,P,w)?ne.current=g?u>=s?p&&u!==l.current.length?-1:c:U(l,{startingIndex:u,disabledIndices:e}):Math.min(s,U(l,{startingIndex:u,disabledIndices:e})):ne.current=g?u<=c?p&&-1!==u?l.current.length:s:U(l,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,U(l,{startingIndex:u,decrement:!0,disabledIndices:e})),_(l,ne.current)?ee(null):ee(ne.current)}}function u(e){"auto"===k&&x(e.nativeEvent)&&(te.current=!0)}const c=E&&n&&he&&{"aria-activedescendant":me||de},s=l.current.find((e=>(null==e?void 0:e.id)===de));return{reference:{...c,onKeyDown(o){oe.current=!1;const u=0===o.key.indexOf("Arrow"),i=function(e,t,n){return Pt(t,n?e===K:e===H,e===j)}(o.key,P,w),c=Nt(o.key,P,w),a=Lt(o.key,P),f=(h?i:a)||"Enter"===o.key||""===o.key.trim();if(E&&n){const e=null==J?void 0:J.nodesRef.current.find((e=>null==e.parentId)),n=J&&e?function(e,t){let n,r=-1;return function t(o,u){u>r&&(n=o,r=u),Xe(e,o).forEach((e=>{t(e.id,u+1)}))}(t,0),e.find((e=>e.id===n))}(J.nodesRef.current,e.id):null;if(u&&n&&F){const e=new KeyboardEvent("keydown",{key:o.key,bubbles:!0});if(i||c){var d,m;const t=(null==(d=n.context)?void 0:d.elements.domReference)===o.currentTarget,r=c&&!t?null==(m=n.context)?void 0:m.elements.domReference:i?s:null;r&&(A(o),r.dispatchEvent(e),pe(void 0))}var p;if(a&&n.context)if(n.context.open&&n.parentId&&o.currentTarget!==n.context.elements.domReference)return A(o),void(null==(p=n.context.elements.domReference)||p.dispatchEvent(e))}return t(o)}(n||T||!u)&&(f&&(re.current=h&&a?null:o.key),h?i&&(A(o),n?(ne.current=B(l,e),ee(ne.current)):r(!0,o.nativeEvent,"list-navigation")):a&&(null!=v&&(ne.current=v),A(o),!n&&T?r(!0,o.nativeEvent,"list-navigation"):t(o),n&&ee(ne.current)))},onFocus(){n&&ee(null)},onPointerDown:function(e){te.current=k,"auto"===k&&R(e.nativeEvent)&&(te.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===P?void 0:P,...!N(i)&&c,onKeyDown:t,onPointerMove(){oe.current=!0}},item:we}}),[i,o,de,me,se,ae,l,d,P,w,E,n,he,h,v,T,p,L,g,k,ee,r,we,J,F,q,G])},e.useMergeRefs=i,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=Dt.get(c))?n:c,s=ve(),a=null!=ye();return u.useMemo((()=>{if(!i)return{};const e={id:o,...l&&{role:l}};return"tooltip"===l||"label"===c?{reference:{["aria-"+("label"===c?"labelledby":"describedby")]:r?o:void 0},floating:e}:{reference:{"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"}},floating:{...e,..."menu"===l&&{"aria-labelledby":s}},item(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{}}}}),[i,c,l,r,o,s,a])},e.useTransitionStatus=Kt,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,v=(f?c:c.close)||0,[m,p]=u.useState((()=>({...jt(i,a),...jt(n,a)}))),{isMounted:g,status:h}=Kt(e,{duration:c}),y=Ee(n),b=Ee(r),w=Ee(o),E=Ee(i);return $((()=>{const e=jt(y.current,a),t=jt(w.current,a),n=jt(E.current,a),r=jt(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(Ft).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(Ft).join(","),transitionDuration:v+"ms",...n,...r})}}),[v,w,y,b,E,d,h,a]),{isMounted:g,styles:m}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:v=750,ignoreKeys:m=[],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=s(l),E=s(a),x=Ee(d),R=Ee(m);return $((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),$((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=p?p:c)?e:-1)}),[r,p,c]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,E(e)):o.current.typing&&(o.current.typing=e,E(e))}function t(e,t,n){const r=x.current?x.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&A(n)),null==o||R.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(A(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),v);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(w(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,v,R,x,w,E])}})); | ||
var Ce=["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(","),Me="undefined"==typeof Element,Te=Me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Se=!Me&&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},Pe=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)},Le=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if(!Pe(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{Te.call(i,Ce)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!Pe(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},Ae=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ne=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))&&!Ae(e)?0:e.tabIndex},De=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Fe=function(e){return"INPUT"===e.tagName},je=function(e){return function(e){return Fe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Se(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)},Ke=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},He=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Te.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Te.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ke(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=Se(e);if(i&&!i.shadowRoot&&!0===r(i))return Ke(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&&Se(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=Se(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},qe=function(e,t){return!(t.disabled||Pe(t)||function(e){return Fe(e)&&"hidden"===e.type}(t)||He(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!!Te.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},_e=function(e,t){return!(je(t)||Ne(t)<0||!qe(e,t))},Be=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},We=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=Ne(e);return n<0&&t&&!Ae(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(De).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ue=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Le([e],t.includeContainer,{filter:_e.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Be}):function(e,t,n){if(Pe(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Ce));return t&&Te.call(e,Ce)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,_e.bind(null,t)),We(n)},ze=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Te.call(e,Ce)&&_e(t,e)};function Xe(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 Ye=new WeakMap,Ve=new WeakSet,Ge={},Ze=0;const $e=e=>e&&(e.host||$e(e.parentNode)),Qe=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=$e(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Je(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=M(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=Qe(t,e),c=new Set,l=new Set(i),s=[];Ge[o]||(Ge[o]=new WeakMap);const a=Ge[o];return i.forEach((function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&Array.prototype.forEach.call(t.children,(t=>{if(c.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(Ye.get(t)||0)+1,i=(a.get(t)||0)+1;Ye.set(t,r),a.set(t,i),s.push(t),1===r&&n&&Ve.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),c.clear(),Ze++,()=>{s.forEach((e=>{const t=(Ye.get(e)||0)-1,n=(a.get(e)||0)-1;Ye.set(e,t),a.set(e,n),t||(!Ve.has(e)&&u&&e.removeAttribute(u),Ve.delete(e)),n||e.removeAttribute(o)})),Ze--,Ze||(Ye=new WeakMap,Ye=new WeakMap,Ve=new WeakSet,Ge={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const et=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tt(e,t){const n=Ue(e,et());"prev"===t&&n.reverse();const r=n.indexOf(y(M(e)));return n.slice(r+1)[0]}function nt(){return tt(document.body,"next")}function rt(){return tt(document.body,"prev")}function ot(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!b(n,r)}function ut(e){Ue(e,et()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function it(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 ct={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 lt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const st=u.forwardRef((function(e,t){const[n,r]=u.useState();$((()=>(I()&&r("button"),document.addEventListener("keydown",lt),()=>{document.removeEventListener("keydown",lt)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[we("focus-guard")]:"",style:ct};return u.createElement("span",se({},e,o))})),at=u.createContext(null),ft=we("portal");function dt(e){void 0===e&&(e={});const{id:t,root:n}=e,r=ve(),o=vt(),[i,c]=u.useState(null),l=u.useRef(null);return $((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{l.current=null}))}),[i]),$((()=>{if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(ft,""),e.appendChild(n),l.current=n,c(n)}),[t,r]),$((()=>{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(ft,""),e=u||e,e.appendChild(i),l.current=i,c(i)}),[t,n,r,o]),i}const vt=()=>u.useContext(at),mt=20;let pt=[];function gt(e){pt=pt.filter((e=>e.isConnected));let t=e;if(t&&"body"!==a(t)){if(!ze(t,et())){const e=Ue(t,et())[0];e&&(t=e)}pt.push(t),pt.length>mt&&(pt=pt.slice(-mt))}}function ht(){return pt.slice().reverse().find((e=>e.isConnected))}const yt=u.forwardRef((function(e,t){return u.createElement("button",se({},e,{type:"button",ref:t,tabIndex:-1,style:ct}))}));const bt=new Set,wt=u.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e,o=ve();return $((()=>{if(!n)return;bt.add(o);const e=/iP(hone|ad|od)|iOS/.test(w()),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.pageXOffset,c=t.top?parseFloat(t.top):window.pageYOffset;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()=>{bt.delete(o),0===bt.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,c)))}}),[o,n]),u.createElement("div",se({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Et(e){return m(e.target)&&"BUTTON"===e.target.tagName}function xt(e){return L(e)}function Rt(e){return null!=e&&null!=e.clientX}const It={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},kt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ot=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 Ct(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ve(),i=u.useRef({}),[c]=u.useState((()=>pe())),l=null!=ye(),[a,f]=u.useState(r.reference),d=s(((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)})),v=u.useMemo((()=>({setPositionReference:f})),[]),m=u.useMemo((()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference})),[a,r.reference,r.floating]);return u.useMemo((()=>({dataRef:i,open:t,onOpenChange:d,elements:m,events:c,floatingId:o,refs:v})),[t,d,m,c,o,v])}const Mt="active",Tt="selected";function St(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[Mt]:t,[Tt]: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&&[Mt,Tt].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 Pt=!1;function Lt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function At(e,t){return Lt(t,e===F||e===j,e===K||e===H)}function Nt(e,t,n){return Lt(t,e===j,n?e===K:e===H)||"Enter"===e||" "===e||""===e}function Dt(e,t,n){return Lt(t,n?e===H:e===K,e===F)}const Ft=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const jt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Kt(e,t){return"function"==typeof e?e(t):e}function Ht(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(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return $((()=>{c&&!f&&a("unmounted")}),[c,f]),$((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function qt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function _t(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 n.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return n.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return n.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return n.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return n.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return n.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return n.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return n.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return n.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return n.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return n.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return n.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return n.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return n.size}}),e.Composite=ce,e.CompositeItem=le,e.FloatingArrow=me,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 $((()=>{o.currentId?null===c.current?c.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),c.current=null)}),[o.currentId]),u.createElement(ke.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,modal:s=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:v,nodeId:p,onOpenChange:g,events:h,dataRef:w,elements:{domReference:E,floating:I}}=t,k="number"==typeof c&&c<0,O=N(E)&&k,C="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,T=Ee(o),P=Ee(c),L=Ee(l),D=be(),F=vt(),j=u.useRef(null),K=u.useRef(null),H=u.useRef(!1),q=u.useRef(!1),_=null!=F,B=u.useCallback((function(e){return void 0===e&&(e=I),e?Ue(e,et()):[]}),[I]),W=u.useCallback((e=>{const t=B(e);return T.current.map((e=>E&&"reference"===e?E:I&&"floating"===e?I:t)).filter(Boolean).flat()}),[E,I,T,B]);function U(e){return!r&&a&&s?u.createElement(yt,{ref:"start"===e?j:K,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof a?a:"Dismiss"):null}u.useEffect((()=>{if(r||!s)return;function e(e){if("Tab"===e.key){b(I,y(M(I)))&&0===B().length&&!O&&A(e);const t=W(),n=S(e);"reference"===T.current[0]&&n===E&&(A(e),e.shiftKey?Z(t[t.length-1]):Z(t[1])),"floating"===T.current[1]&&n===I&&e.shiftKey&&(A(e),Z(t[0]))}}const t=M(I);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,E,I,s,T,O,B,W]),u.useEffect((()=>{if(!r&&f)return I&&m(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),!s&&I.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),!s&&I.removeEventListener("focusout",t)}):void 0;function e(){q.current=!0,setTimeout((()=>{q.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(b(E,t)||b(I,t)||b(t,I)||b(null==F?void 0:F.portalNode,t)||null!=t&&t.hasAttribute(we("focus-guard"))||D&&(Xe(D.nodesRef.current,p).find((e=>{var n,r;return b(null==(n=e.context)?void 0:n.elements.floating,t)||b(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}(D.nodesRef.current,p).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!q.current&&t!==ht()&&(H.current=!0,g(!1,e))}))}}),[r,E,I,s,p,D,F,g,f]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==F||null==(e=F.portalNode)?void 0:e.querySelectorAll("["+we("portal")+"]"))||[]);if(I){const e=[I,...t,j.current,K.current,T.current.includes("reference")||O?E:null].filter((e=>null!=e)),n=s||O?Je(e,C,!C):Je(e);return()=>{n()}}}),[r,E,I,s,T,F,O,C]),$((()=>{if(r||!I)return;const e=y(M(I));queueMicrotask((()=>{const t=W(I),n=P.current,r=("number"==typeof n?t[n]:n.current)||I,o=b(I,e);k||o||!d||Z(r,{preventScroll:r===I})}))}),[r,d,I,k,W,P]),$((()=>{if(r||!I)return;let e=!1;const t=M(I),n=y(t);let o=w.current.openEvent;function u(t){let{open:n,reason:r,event:u,nested:i}=t;n&&(o=u),"escape-key"===r&&v.domReference.current&>(v.domReference.current),"hover"===r&&"mouseleave"===u.type&&(H.current=!0),"outside-press"===r&&(i?(H.current=!1,e=!0):H.current=!(x(u)||R(u)))}return gt(n),h.on("openchange",u),()=>{h.off("openchange",u);const n=y(t),r=b(I,n)||D&&Xe(D.nodesRef.current,p).some((e=>{var t;return b(null==(t=e.context)?void 0:t.elements.floating,n)}));(r||o&&["click","mousedown"].includes(o.type))&&v.domReference.current&>(v.domReference.current);const i=ht();L.current&&!H.current&&m(i)&&(i===n||n===t.body||r)&&Z(i,{cancelPrevious:!1,preventScroll:e})}}),[r,I,L,w,v,h,D,p]),$((()=>{if(!r&&F)return F.setFocusManagerState({modal:s,closeOnFocusOut:f,open:d,onOpenChange:g,refs:v}),()=>{F.setFocusManagerState(null)}}),[r,F,s,d,g,v,f]),$((()=>{if(r||!I||"function"!=typeof MutationObserver||k)return;const e=()=>{const e=I.getAttribute("tabindex");T.current.includes("floating")||y(M(I))!==v.domReference.current&&0===B().length?"0"!==e&&I.setAttribute("tabindex","0"):"-1"!==e&&I.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(I,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,I,v,T,B,k]);const z=!r&&C&&(_||s);return u.createElement(u.Fragment,null,z&&u.createElement(st,{"data-type":"inside",ref:null==F?void 0:F.beforeInsideRef,onFocus:e=>{if(s){const e=W();Z("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(H.current=!1,ot(e,F.portalNode)){const e=nt()||E;null==e||e.focus()}else{var t;null==(t=F.beforeOutsideRef.current)||t.focus()}}}),!O&&U("start"),n,U("end"),z&&u.createElement(st,{"data-type":"inside",ref:null==F?void 0:F.afterInsideRef,onFocus:e=>{if(s)Z(W()[0]);else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(f&&(H.current=!0),ot(e,F.portalNode)){const e=rt()||E;null==e||e.focus()}else{var t;null==(t=F.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=ee,e.FloatingNode=function(e){const{children:t,id:n}=e,r=ye();return u.createElement(ge.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=wt,e.FloatingPortal=function(e){const{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e,c=dt({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),v=u.useRef(null),m=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&ot(e)){("focusin"===e.type?it:ut)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(at.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:v,portalNode:c,setFocusManagerState:s})),[i,c])},m&&c&&u.createElement(st,{"data-type":"outside",ref:a,onFocus:e=>{if(ot(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=rt()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),m&&c&&u.createElement("span",{"aria-owns":c.id,style:ct}),c&&r.createPortal(t,c),m&&c&&u.createElement(st,{"data-type":"outside",ref:f,onFocus:e=>{if(ot(e,c)){var t;null==(t=v.current)||t.focus()}else{const t=nt()||(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((()=>pe()))[0];return u.createElement(he.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:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:v,elements:{floating:m}}=t,p=o.current[l];if(!p)return{};const g={...t,...await n.offset(-p.offsetTop-m.clientTop-v.reference.height/2-p.offsetHeight/2-c).fn(t)},h=(null==f?void 0:f.current)||m,y=await n.detectOverflow(qt(g,h.scrollHeight),d),b=await n.detectOverflow(g,{...d,elementContext:"reference"}),w=Math.max(0,y.top),E=g.y+w,x=Math.max(0,h.scrollHeight-w-Math.max(0,y.bottom));return h.style.maxHeight=x+"px",h.scrollTop=w,i&&(h.offsetHeight<p.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await n.detectOverflow(qt({...g,y:E},h.offsetHeight),d)),{y:E}}}),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,w=[h,y],E=S(e),x="mouseleave"===e.type,R=b(f.floating,E),I=b(f.domReference,E),k=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],M=n>O.right-O.width/2,T=s>O.bottom-O.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(w,k),L=O.width>k.width,A=O.height>k.height,N=(L?k:O).left,D=(L?k:O).right,F=(A?k:O).top,j=(A?k:O).bottom;if(R&&(u=!0,!x))return;if(I&&(u=!1),I&&!x)return void(u=!0);if(x&&v(e.relatedTarget)&&b(f.floating,e.relatedTarget))return;if(p&&Xe(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===C&&s>=k.bottom-1||"bottom"===C&&s<=k.top+1||"left"===C&&n>=k.right-1||"right"===C&&n<=k.left+1)return g();let K=[];switch(C){case"top":K=[[N,k.top+1],[N,O.bottom-1],[D,O.bottom-1],[D,k.top+1]];break;case"bottom":K=[[N,O.top+1],[N,k.bottom-1],[D,k.bottom-1],[D,O.top+1]];break;case"left":K=[[O.right-1,j],[O.right-1,F],[k.left+1,F],[k.left+1,j]];break;case"right":K=[[k.right-1,j],[k.right-1,F],[O.left+1,F],[O.left+1,j]]}if(!_t([h,y],K)){if(u&&!P)return g();if(!x&&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()}_t([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[L?n+t/2:M?n+4*t:n-4*t,r+t+1],[L?n-t/2:M?n+4*t:n-4*t,r+t+1],...[[O.left,M||L?O.bottom-t:O.top],[O.right,M?L?O.bottom-t:O.top:O.bottom-t]]];case"bottom":return[[L?n+t/2:M?n+4*t:n-4*t,r-t],[L?n-t/2:M?n+4*t:n-4*t,r-t],...[[O.left,M||L?O.top+t:O.bottom],[O.right,M?L?O.top+t:O.bottom:O.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?O.right-t:O.left,O.top],[T?A?O.right-t:O.left:O.right-t,O.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?O.left+t:O.right,O.top],[T?A?O.left+t:O.right:O.left+t,O.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(),v=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(C(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:C(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Et(e)||(" "!==e.key||xt(i)||(e.preventDefault(),v.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||Et(e)||xt(i)||" "===e.key&&v.current&&(v.current=!1,r(!n||!s,e.nativeEvent,"click"))}}}:{}),[c,o,l,a,f,i,s,n,r])},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:a="both",x:d=null,y:v=null}=t,m=u.useRef(!1),p=u.useRef(null),[g,h]=u.useState(),[y,w]=u.useState([]),E=s(((e,t)=>{m.current||r.current.openEvent&&!Rt(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,v=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,v-=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,v=l&&null!=t.y?t.y:v):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:v,top:v,right:d+a,bottom:v+f,left:d}}}}(i,{x:e,y:t,axis:a,dataRef:r,pointerType:g}))})),x=s((e=>{null==d&&null==v&&(n?p.current||w([]):E(e.clientX,e.clientY))})),R=C(g)?o:n,I=u.useCallback((()=>{if(!R||!l||null!=d||null!=v)return;const e=f(o);function t(n){const r=S(n);b(o,r)?(e.removeEventListener("mousemove",t),p.current=null):E(n.clientX,n.clientY)}if(!r.current.openEvent||Rt(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),p.current=null};return p.current=n,n}c.setPositionReference(i)}),[R,l,d,v,o,r,c,i,E]);return u.useEffect((()=>I()),[I,y]),u.useEffect((()=>{l&&!o&&(m.current=!1)}),[l,o]),u.useEffect((()=>{!l&&n&&(m.current=!0)}),[l,n]),$((()=>{!l||null==d&&null==v||(m.current=!1,E(d,v))}),[l,d,v,E]),u.useMemo((()=>{if(!l)return{};function e(e){let{pointerType:t}=e;h(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:x,onMouseEnter:x}}}),[l,x])},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=Oe(),{currentId:l,setCurrentId:s,initialDelay:a,setState:f,timeoutMs:d}=c;return $((()=>{l&&(f({delay:{open:1,close:Re(a,"close")}}),l!==i&&r(!1))}),[i,r,f,l,a]),$((()=>{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]),$((()=>{s!==Ie&&n&&s(i)}),[n,s,i]),c},e.useDelayGroupContext=Oe,e.useDismiss=function(e,t){void 0===t&&(t={});const{open:r,onOpenChange:o,elements:{reference:i,domReference:c,floating:l},dataRef:a}=e,{enabled:d=!0,escapeKey:p=!0,outsidePress:y=!0,outsidePressEvent:w="pointerdown",referencePress:E=!1,referencePressEvent:x="pointerdown",ancestorScroll:R=!1,bubbles:I,capture:k}=t,O=be(),C=s("function"==typeof y?y:()=>!1),P="function"==typeof y?C:y,L=u.useRef(!1),A=u.useRef(!1),{escapeKey:N,outsidePress:D}=Ot(I),{escapeKey:F,outsidePress:j}=Ot(k),K=s((e=>{var t;if(!r||!d||!p||"Escape"!==e.key)return;const n=null==(t=a.current.floatingContext)?void 0:t.nodeId,u=O?Xe(O.nodesRef.current,n):[];if(!N&&(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")})),H=s((e=>{var t;const n=()=>{var t;K(e),null==(t=S(e))||t.removeEventListener("keydown",n)};null==(t=S(e))||t.addEventListener("keydown",n)})),q=s((e=>{var t;const n=L.current;L.current=!1;const r=A.current;if(A.current=!1,"click"===w&&r)return;if(n)return;if("function"==typeof P&&!P(e))return;const u=S(e),i="["+we("inert")+"]",s=M(l).querySelectorAll(i);let d=v(u)?u:null;for(;d&&!g(d);){const e=h(d);if(g(e)||!v(e))break;d=e}if(s.length&&v(u)&&!u.matches("html,body")&&!b(u,l)&&Array.from(s).every((e=>!b(d,e))))return;if(m(u)&&l){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){const t="rtl"===function(e){return f(e).getComputedStyle(e)}(u).direction;t&&(r=e.offsetX<=u.offsetWidth-u.clientWidth)}if(r||t&&e.offsetY>u.clientHeight)return}const p=null==(t=a.current.floatingContext)?void 0:t.nodeId,y=O&&Xe(O.nodesRef.current,p).some((t=>{var n;return T(e,null==(n=t.context)?void 0:n.elements.floating)}));if(T(e,l)||T(e,c)||y)return;const E=O?Xe(O.nodesRef.current,p):[];if(E.length>0){let e=!0;if(E.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),_=s((e=>{var t;const n=()=>{var t;q(e),null==(t=S(e))||t.removeEventListener(w,n)};null==(t=S(e))||t.addEventListener(w,n)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e,"ancestor-scroll")}a.current.__escapeKeyBubbles=N,a.current.__outsidePressBubbles=D;const t=M(l);p&&t.addEventListener("keydown",F?H:K,F),P&&t.addEventListener(w,j?_:q,j);let u=[];return R&&(v(c)&&(u=n.getOverflowAncestors(c)),v(l)&&(u=u.concat(n.getOverflowAncestors(l))),!v(i)&&i&&i.contextElement&&(u=u.concat(n.getOverflowAncestors(i.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})})),()=>{p&&t.removeEventListener("keydown",F?H:K,F),P&&t.removeEventListener(w,j?_:q,j),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[a,l,c,i,p,P,w,r,o,R,d,N,D,K,F,H,q,j,_]),u.useEffect((()=>{L.current=!1}),[P,w]),u.useMemo((()=>d?{reference:{onKeyDown:K,[It[x]]:e=>{E&&o(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:K,onMouseDown(){A.current=!0},onMouseUp(){A.current=!0},[kt[w]]:()=>{L.current=!0}}}:{}),[d,E,w,x,o,K])},e.useFloating=function(e){void 0===e&&(e={});const{nodeId:t}=e,r=Ct({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||r,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=be();$((()=>{f&&(d.current=f)}),[f]);const p=n.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 $((()=>{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=ve(),n=be(),r=ye(),o=e||r;return $((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=ye,e.useFloatingPortalNode=dt,e.useFloatingRootContext=Ct,e.useFloatingTree=be,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:{domReference:c}}=e,{enabled:l=!0,visibleOnly:s=!0}=t,a=u.useRef(!1),d=u.useRef(),p=u.useRef(!0);return u.useEffect((()=>{if(!l)return;const e=f(c);function t(){!n&&m(c)&&c===y(M(c))&&(a.current=!0)}function r(){p.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[c,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(d.current)}),[]),u.useMemo((()=>l?{reference:{onPointerDown(e){R(e.nativeEvent)||(p.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=S(e.nativeEvent);if(s&&v(t))try{if(I()&&O())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!p.current&&!L(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=v(t)&&t.hasAttribute(we("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{var o;const u=y(c?c.ownerDocument:document);(t||u!==c)&&(b(null==(o=i.current.floatingContext)?void 0:o.refs.floating.current,u)||b(c,u)||n||r(!1,e.nativeEvent,"focus"))}))}}}:{}),[l,s,i,c,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:c,floating:l}}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:m=!1,restMs:p=0,move:g=!0}=t,h=be(),y=ye(),w=Ee(d),E=Ee(f),x=u.useRef(),R=u.useRef(-1),I=u.useRef(),k=u.useRef(-1),O=u.useRef(!0),T=u.useRef(!1),S=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(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(R.current),clearTimeout(k.current),O.current=!0)}}),[a,i]),u.useEffect((()=>{if(!a||!w.current||!n)return;function e(e){P()&&r(!1,e,"hover")}const t=M(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,a,w,P]);const L=u.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Re(E.current,"close",x.current);o&&!I.current?(clearTimeout(R.current),R.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(R.current),r(!1,e,n))}),[E,r]),A=s((()=>{S.current(),I.current=void 0})),N=s((()=>{if(T.current){const e=M(l).body;e.style.pointerEvents="",e.removeAttribute(xe),T.current=!1}}));return u.useEffect((()=>{if(a&&v(c)){const e=c;return n&&e.addEventListener("mouseleave",i),null==l||l.addEventListener("mouseleave",i),g&&e.addEventListener("mousemove",t,{once:!0}),e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",u),()=>{n&&e.removeEventListener("mouseleave",i),null==l||l.removeEventListener("mouseleave",i),g&&e.removeEventListener("mousemove",t),e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",u)}}function e(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function t(e){if(clearTimeout(R.current),O.current=!1,m&&!C(x.current)||p>0&&!Re(E.current,"open"))return;const t=Re(E.current,"open",x.current);t?R.current=window.setTimeout((()=>{r(!0,e,"hover")}),t):r(!0,e,"hover")}function u(t){if(e())return;S.current();const r=M(l);if(clearTimeout(k.current),w.current&&o.current.floatingContext){n||clearTimeout(R.current),I.current=w.current({...o.current.floatingContext,tree:h,x:t.clientX,y:t.clientY,onClose(){N(),A(),L(t,!0,"safe-polygon")}});const e=I.current;return r.addEventListener("mousemove",e),void(S.current=()=>{r.removeEventListener("mousemove",e)})}("touch"!==x.current||!b(l,t.relatedTarget))&&L(t)}function i(t){e()||o.current.floatingContext&&(null==w.current||w.current({...o.current.floatingContext,tree:h,x:t.clientX,y:t.clientY,onClose(){N(),A(),L(t)}})(t))}}),[c,l,a,e,m,p,g,L,A,N,r,n,h,E,w,o]),$((()=>{var e;if(a&&n&&null!=(e=w.current)&&e.__options.blockPointerEvents&&P()){const e=M(l).body;if(e.setAttribute(xe,""),e.style.pointerEvents="none",T.current=!0,v(c)&&l){var t;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===y)))||null==(t=t.context)?void 0:t.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[a,n,y,l,c,h,w,P]),$((()=>{n||(x.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(R.current),clearTimeout(k.current),N()}),[a,c,A,N]),u.useMemo((()=>{if(!a)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){function t(){O.current||r(!0,e.nativeEvent,"hover")}m&&!C(x.current)||n||0===p||(clearTimeout(k.current),"touch"===x.current?t():k.current=window.setTimeout(t,p))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){L(e.nativeEvent,!1)}}}}),[a,m,n,p,r,L])},e.useId=ve,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:a}=t,f=s(a),d=u.useRef(!1),v=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{f((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(E())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{v.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{v.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,f]),u.useMemo((()=>i?{floating:{onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&d.current){if(null!==v.current){const t=e.scrollTop-v.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>f((e=>e+t))))}requestAnimationFrame((()=>{v.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,f])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>St(t,e,"reference")),t),r=u.useCallback((t=>St(t,e,"floating")),t),o=u.useCallback((t=>St(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=te,e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,elements:{domReference:o,floating:i}}=e,{listRef:c,activeIndex:l,onNavigate:a=(()=>{}),enabled:f=!0,selectedIndex:d=null,allowEscape:v=!1,loop:p=!1,nested:g=!1,rtl:h=!1,virtual:w=!1,focusItemOnOpen:E="auto",focusItemOnHover:k=!0,openOnArrowKeyDown:C=!0,disabledIndices:T,orientation:S="vertical",cols:P=1,scrollItemIntoView:L=!0,virtualItemRef:D,itemSizes:F,dense:q=!1}=t,G=ye(),Q=be(),J=s(a),ee=u.useRef(E),te=u.useRef(null!=d?d:-1),ne=u.useRef(null),re=u.useRef(!0),oe=u.useRef(J),ue=u.useRef(!!i),ie=u.useRef(!1),ce=u.useRef(!1),le=Ee(T),se=Ee(n),ae=Ee(L),fe=Ee(i),[de,ve]=u.useState(),[me,pe]=u.useState(),ge=s((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(w?(ve(r.id),null==Q||Q.events.emit("virtualfocus",r),D&&(D.current=r)):Z(r,{preventScroll:!0,sync:!(!O()||!I())&&(Pt||ie.current)}),requestAnimationFrame((()=>{const e=ae.current;e&&r&&(n||!re.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));$((()=>{document.createElement("div").focus({get preventScroll(){return Pt=!0,!1}})}),[]),$((()=>{f&&(n&&i?ee.current&&null!=d&&(ce.current=!0,te.current=d,J(d)):ue.current&&(te.current=-1,oe.current(null)))}),[f,n,i,d,J]),$((()=>{if(f&&n&&i)if(null==l){if(ie.current=!1,null!=d)return;if(ue.current&&(te.current=-1,ge(c,te)),!ue.current&&ee.current&&(null!=ne.current||!0===ee.current&&null==ne.current)){let e=0;const t=()=>{if(null==c.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else te.current=null==ne.current||Nt(ne.current,S,h)||g?B(c,le.current):W(c,le.current),ne.current=null,J(te.current)};t()}}else _(c,l)||(te.current=l,ge(c,te,ce.current),ce.current=!1)}),[f,n,i,l,d,g,c,S,h,J,ge,le]),$((()=>{var e;if(!f||i||!Q||w||!ue.current)return;const t=Q.nodesRef.current,n=null==(e=t.find((e=>e.id===G)))||null==(e=e.context)?void 0:e.elements.floating,r=y(M(i)),o=t.some((e=>e.context&&b(e.context.elements.floating,r)));n&&!o&&re.current&&n.focus({preventScroll:!0})}),[f,i,Q,G,w]),$((()=>{if(f&&Q&&w&&!G)return Q.events.on("virtualfocus",e),()=>{Q.events.off("virtualfocus",e)};function e(e){pe(e.id),D&&(D.current=e)}}),[f,Q,w,G,D]),$((()=>{oe.current=J,ue.current=!!i})),$((()=>{n||(ne.current=null)}),[n]);const he=null!=l,we=u.useMemo((()=>{function e(e){if(!n)return;const t=c.current.indexOf(e);-1!==t&&J(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...k&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;re.current&&"touch"!==t&&(te.current=-1,ge(c,te),J(null),w||Z(fe.current,{preventScroll:!0}))}}}}),[n,fe,ge,k,c,J,w]);return u.useMemo((()=>{if(!f)return{};const e=le.current;function t(t){if(re.current=!1,ie.current=!0,!se.current&&t.currentTarget===fe.current)return;if(g&&Dt(t.key,S,h))return A(t),r(!1,t.nativeEvent,"list-navigation"),void(m(o)&&!w&&o.focus());const u=te.current,i=B(c,e),l=W(c,e);if("Home"===t.key&&(A(t),te.current=i,J(te.current)),"End"===t.key&&(A(t),te.current=l,J(te.current)),P>1){const n=F||Array.from({length:c.current.length},(()=>({width:1,height:1}))),r=X(n,P,q),o=r.findIndex((t=>null!=t&&!(null!=e&&e.includes(t)))),u=r.reduce(((t,n,r)=>null==n||null!=e&&e.includes(n)?t:r),-1);if(te.current=r[z({current:r.map((e=>null!=e?c.current[e]:null))},{event:t,orientation:S,loop:p,cols:P,disabledIndices:V([...e||[],void 0],r),minIndex:o,maxIndex:u,prevIndex:Y(te.current,n,r,P,t.key===j?"bl":t.key===H?"tr":"tl"),stopEvent:!0})],J(te.current),"both"===S)return}if(At(t.key,S)){if(A(t),n&&!w&&y(t.currentTarget.ownerDocument)===t.currentTarget)return te.current=Nt(t.key,S,h)?i:l,void J(te.current);Nt(t.key,S,h)?te.current=p?u>=l?v&&u!==c.current.length?-1:i:U(c,{startingIndex:u,disabledIndices:e}):Math.min(l,U(c,{startingIndex:u,disabledIndices:e})):te.current=p?u<=i?v&&-1!==u?c.current.length:l:U(c,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(i,U(c,{startingIndex:u,decrement:!0,disabledIndices:e})),_(c,te.current)?J(null):J(te.current)}}function u(e){"auto"===E&&x(e.nativeEvent)&&(ee.current=!0)}const i=w&&n&&he&&{"aria-activedescendant":me||de},l=c.current.find((e=>(null==e?void 0:e.id)===de));return{reference:{...i,onKeyDown(o){re.current=!1;const u=0===o.key.indexOf("Arrow"),i=function(e,t,n){return Lt(t,n?e===K:e===H,e===j)}(o.key,S,h),s=Dt(o.key,S,h),a=At(o.key,S),f=(g?i:a)||"Enter"===o.key||""===o.key.trim();if(w&&n){const e=null==Q?void 0:Q.nodesRef.current.find((e=>null==e.parentId)),n=Q&&e?function(e,t){let n,r=-1;return function t(o,u){u>r&&(n=o,r=u),Xe(e,o).forEach((e=>{t(e.id,u+1)}))}(t,0),e.find((e=>e.id===n))}(Q.nodesRef.current,e.id):null;if(u&&n&&D){const e=new KeyboardEvent("keydown",{key:o.key,bubbles:!0});if(i||s){var v,m;const t=(null==(v=n.context)?void 0:v.elements.domReference)===o.currentTarget,r=s&&!t?null==(m=n.context)?void 0:m.elements.domReference:i?l:null;r&&(A(o),r.dispatchEvent(e),pe(void 0))}var p;if(a&&n.context)if(n.context.open&&n.parentId&&o.currentTarget!==n.context.elements.domReference)return A(o),void(null==(p=n.context.elements.domReference)||p.dispatchEvent(e))}return t(o)}(n||C||!u)&&(f&&(ne.current=g&&a?null:o.key),g?i&&(A(o),n?(te.current=B(c,e),J(te.current)):r(!0,o.nativeEvent,"list-navigation")):a&&(null!=d&&(te.current=d),A(o),!n&&C?r(!0,o.nativeEvent,"list-navigation"):t(o),n&&J(te.current)))},onFocus(){n&&J(null)},onPointerDown:function(e){ee.current=E,"auto"===E&&R(e.nativeEvent)&&(ee.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===S?void 0:S,...!N(o)&&i,onKeyDown:t,onPointerMove(){re.current=!0}},item:we}}),[o,fe,de,me,le,se,c,f,S,h,w,n,he,g,d,C,v,P,p,E,J,r,we,Q,D,F,q])},e.useMergeRefs=i,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=Ft.get(c))?n:c,s=ve(),a=null!=ye();return u.useMemo((()=>{if(!i)return{};const e={id:o,...l&&{role:l}};return"tooltip"===l||"label"===c?{reference:{["aria-"+("label"===c?"labelledby":"describedby")]:r?o:void 0},floating:e}:{reference:{"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"}},floating:{...e,..."menu"===l&&{"aria-labelledby":s}},item(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{}}}}),[i,c,l,r,o,s,a])},e.useTransitionStatus=Ht,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,v=(f?c:c.close)||0,[m,p]=u.useState((()=>({...Kt(i,a),...Kt(n,a)}))),{isMounted:g,status:h}=Ht(e,{duration:c}),y=Ee(n),b=Ee(r),w=Ee(o),E=Ee(i);return $((()=>{const e=Kt(y.current,a),t=Kt(w.current,a),n=Kt(E.current,a),r=Kt(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(jt).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(jt).join(","),transitionDuration:v+"ms",...n,...r})}}),[v,w,y,b,E,d,h,a]),{isMounted:g,styles:m}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:v=750,ignoreKeys:m=[],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=s(l),E=s(a),x=Ee(d),R=Ee(m);return $((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),$((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=p?p:c)?e:-1)}),[r,p,c]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,E(e)):o.current.typing&&(o.current.typing=e,E(e))}function t(e,t,n){const r=x.current?x.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&A(n)),null==o||R.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(A(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),v);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(w(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,v,R,x,w,E])}})); |
{ | ||
"name": "@floating-ui/react", | ||
"version": "0.26.13", | ||
"version": "0.26.14", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
709724
16064