Socket
Socket
Sign inDemoInstall

@floating-ui/react-dom-interactions

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@floating-ui/react-dom-interactions - npm Package Compare versions

Comparing version 0.10.1 to 0.10.2

2

dist/floating-ui.react-dom-interactions.esm.min.js

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

import{useFloating as e,offset as t,detectOverflow as n,getOverflowAncestors as r}from"@floating-ui/react-dom";export*from"@floating-ui/react-dom";import*as o from"react";import{useLayoutEffect as u,useEffect as c,useRef as i}from"react";import{createPortal as l,flushSync as s}from"react-dom";import{hideOthers as a}from"aria-hidden";var f="undefined"!=typeof document?u:c;function d(){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){e.set(t,(e.get(t)||[]).filter((e=>e!==n)))}}}let m=!1,v=0;const g=()=>"floating-ui-"+v++;const p=o["useId".toString()],h=null!=p?p:function(){const[e,t]=o.useState((()=>m?g():void 0));return f((()=>{null==e&&t(g())}),[]),o.useEffect((()=>{m||(m=!0)}),[]),e},b=o.createContext(null),y=o.createContext(null),w=()=>{var e,t;return null!=(e=null==(t=o.useContext(b))?void 0:t.id)?e:null},E=()=>o.useContext(y),R=()=>{const e=h(),t=E(),n=w();return f((()=>{const r={id:e,parentId:n};return null==t||t.addNode(r),()=>{null==t||t.removeNode(r)}}),[t,e,n]),e},x=e=>{let{children:t,id:n}=e;const r=w();return o.createElement(b.Provider,{value:o.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},I=e=>{let{children:t}=e;const n=o.useRef([]),r=o.useCallback((e=>{n.current=[...n.current,e]}),[]),u=o.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),c=o.useState((()=>d()))[0];return o.createElement(y.Provider,{value:o.useMemo((()=>({nodesRef:n,addNode:r,removeNode:u,events:c})),[n,r,u,c])},t)};function k(e){var t;return null!=(t=null==e?void 0:e.ownerDocument)?t:document}function L(e){var t;return null!=(t=k(e).defaultView)?t:window}function C(e){return!!e&&e instanceof L(e).Element}function T(e){return!!e&&e instanceof L(e).HTMLElement}const A=o["useInsertionEffect".toString()];function M(e){const t=o.useRef((()=>{}));return A?A((()=>{t.current=e})):t.current=e,o.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 O(t){let{open:n=!1,onOpenChange:r,whileElementsMounted:u,placement:c,middleware:i,strategy:l,nodeId:s}=void 0===t?{}:t;const[a,m]=o.useState(null),v=E(),g=o.useRef(null),p=o.useRef({}),h=o.useState((()=>d()))[0],b=e({placement:c,middleware:i,strategy:l,whileElementsMounted:u}),y=M(r),w=o.useMemo((()=>({...b.refs,domReference:g})),[b.refs]),R=o.useMemo((()=>({...b,refs:w,dataRef:p,nodeId:s,events:h,open:n,onOpenChange:y,_:{domReference:a}})),[b,s,h,n,y,w,a]);f((()=>{const e=null==v?void 0:v.nodesRef.current.find((e=>e.id===s));e&&(e.context=R)}));const{reference:x}=b,I=o.useCallback((e=>{(C(e)||null===e)&&(R.refs.domReference.current=e,m(e)),x(e)}),[x,R.refs]);return o.useMemo((()=>({...b,context:R,refs:w,reference:I})),[b,w,R,I])}function P(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];null==(e=r.get(n))||e.forEach((e=>e(...o)))})):e[n]=o})),e):e),{})}}const D=function(e){return void 0===e&&(e=[]),{getReferenceProps:t=>P(t,e,"reference"),getFloatingProps:t=>P(t,e,"floating"),getItemProps:t=>P(t,e,"item")}};function S(e,t){var n;let r=null!=(n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})))?n:[],o=r;for(;o.length;){var u;o=null!=(u=e.filter((e=>{var t;return null==(t=o)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})))?u:[],r=r.concat(o)}return r}function H(e){let t,{restMs:n=0,buffer:r=.5,blockPointerEvents:o=!0,debug:u=null}=void 0===e?{}:e,c=!1;const i=e=>{let{x:o,y:u,placement:i,refs:l,onClose:s,nodeId:a,tree:f,leave:d=!1}=e;return function(e){var m,v;function g(){clearTimeout(t),s()}if(clearTimeout(t),e.pointerType&&"mouse"!==e.pointerType)return;const{clientX:p,clientY:h}=e,b="composedPath"in e?e.composedPath()[0]:e.target;if("pointermove"===e.type&&null!=(m=l.domReference.current)&&m.contains(b))return;if(f&&S(f.nodesRef.current,a).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if(null!=(v=l.floating.current)&&v.contains(b)&&!d)return void(c=!0);if(!l.domReference.current||!l.floating.current||null==i||null==o||null==u)return;const y=l.domReference.current.getBoundingClientRect(),w=l.floating.current.getBoundingClientRect(),E=i.split("-")[0],R=o>w.right-w.width/2,x=u>w.bottom-w.height/2;if("top"===E&&u>=y.bottom-1||"bottom"===E&&u<=y.top+1||"left"===E&&o>=y.right-1||"right"===E&&o<=y.left+1)return g();switch(E){case"top":if(p>=w.left&&p<=w.right&&h>=w.top&&h<=y.top+1)return;break;case"bottom":if(p>=w.left&&p<=w.right&&h>=y.bottom-1&&h<=w.bottom)return;break;case"left":if(p>=w.left&&p<=y.left+1&&h>=w.top&&h<=w.bottom)return;break;case"right":if(p>=y.right-1&&p<=w.right&&h>=w.top&&h<=w.bottom)return}if(c)return g();const I=function(e){let[t,n]=e;const o=w.width>y.width,u=w.height>y.height;switch(E){case"top":return[[o?t+r/2:R?t+4*r:t-4*r,n+r+1],[o?t-r/2:R?t+4*r:t-4*r,n+r+1],...[[w.left,R||o?w.bottom-r:w.top],[w.right,R?o?w.bottom-r:w.top:w.bottom-r]]];case"bottom":return[[o?t+r/2:R?t+4*r:t-4*r,n-r],[o?t-r/2:R?t+4*r:t-4*r,n-r],...[[w.left,R||o?w.top+r:w.bottom],[w.right,R?o?w.top+r:w.bottom:w.top+r]]];case"left":{const e=[t+r+1,u?n+r/2:x?n+4*r:n-4*r],o=[t+r+1,u?n-r/2:x?n+4*r:n-4*r];return[...[[x||u?w.right-r:w.left,w.top],[x?u?w.right-r:w.left:w.right-r,w.bottom]],e,o]}case"right":return[[t-r,u?n+r/2:x?n+4*r:n-4*r],[t-r,u?n-r/2:x?n+4*r:n-4*r],...[[x||u?w.left+r:w.right,w.top],[x?u?w.left+r:w.right:w.left+r,w.bottom]]]}}([o,u]);!function(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,c=u-1;e<u;c=e++){const[u,i]=t[e]||[0,0],[l,s]=t[c]||[0,0];i>=r!=s>=r&&n<=(l-u)*(r-i)/(s-i)+u&&(o=!o)}return o}([p,h],I)?g():n&&(t=setTimeout(s,n))}};return i.__options={blockPointerEvents:o},i}const F="floating-ui-root",K=function(e){let{id:t=F,enabled:n=!0}=void 0===e?{}:e;const[r,u]=o.useState(null);return f((()=>{if(!n)return;const e=document.getElementById(t);if(e)u(e);else{const e=document.createElement("div");e.id=t,u(e),document.body.contains(e)||document.body.appendChild(e)}}),[t,n]),r},j=e=>{let{children:t,id:n=F,root:r=null}=e;const o=K({id:n,enabled:!r});return r?l(t,r):o?l(t,o):null};function N(){return N=Object.assign||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},N.apply(this,arguments)}const V="data-floating-ui-scroll-lock",W=o.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return f((()=>{var e,t,r,o;if(!n)return;if(document.body.hasAttribute(V))return;document.body.setAttribute(V,"");const u=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",c=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()))return Object.assign(document.body.style,{overflow:"hidden",[u]:c+"px"}),()=>{document.body.removeAttribute(V),Object.assign(document.body.style,{overflow:"",[u]:""})};const i=null!=(e=null==(t=window.visualViewport)?void 0:t.offsetLeft)?e:0,l=null!=(r=null==(o=window.visualViewport)?void 0:o.offsetTop)?r:0,s=window.pageXOffset,a=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(a-Math.floor(l))+"px",left:-(s-Math.floor(i))+"px",right:"0",[u]:c+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[u]:""}),document.body.removeAttribute(V),window.scrollTo(s,a)}}),[n]),o.createElement("div",N({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function q(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}function B(e){return"composedPath"in e?e.composedPath()[0]:e.target}const X="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Y(e){return T(e)&&e.matches(X)}function _(e){e.preventDefault(),e.stopPropagation()}function U(e){const t=i(e);return f((()=>{t.current=e})),t}function z(e,t){void 0===t&&(t=!1),requestAnimationFrame((()=>{null==e||e.focus({preventScroll:t})}))}const G=o.forwardRef((function(e,t){return o.createElement("span",N({},e,{ref:t,tabIndex:0,style:{position:"fixed",opacity:"0",pointerEvents:"none",outline:"0"}}))}));function J(e){let{context:{refs:t,nodeId:n,onOpenChange:r,dataRef:u,events:c},children:i,order:l=["content"],endGuard:s=!0,initialFocus:f=0,returnFocus:d=!0,modal:m=!0}=e;const v=U(l),g=E(),p=o.useCallback((()=>v.current.map((e=>{return"reference"===e?t.domReference.current:t.floating.current&&"floating"===e?t.floating.current:"content"===e?Array.from(null!=(n=null==(r=t.floating.current)?void 0:r.querySelectorAll("select:not([disabled]),a[href],button:not([disabled]),[tabindex],iframe,object,embed,area[href],audio[controls],video[controls],input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"))?n:[]):null;var n,r})).flat().filter((e=>{if(e===t.floating.current||e===t.domReference.current)return!0;if(T(e)){var n;return"-"!==(null!=(n=e.getAttribute("tabindex"))?n:"0")[0].trim()}}))),[v,t]);o.useEffect((()=>{if(!m)return;const e=0===p().filter((e=>e!==t.floating.current&&e!==t.domReference.current)).length;function n(n){if("Tab"===n.key){e&&_(n);const r=p(),o=B(n);"reference"===v.current[0]&&o===t.domReference.current&&(_(n),n.shiftKey?z(r[r.length-1]):z(r[1])),"floating"===v.current[1]&&o===t.floating.current&&n.shiftKey&&(_(n),z(r[0]))}}const r=k(t.floating.current);return r.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",n)}}),[m,p,v,t]),o.useEffect((()=>{let e=!1;function o(o){var u,c;const i=o.relatedTarget,l=!(null!=(u=t.floating.current)&&u.contains(i)),s=C(t.domReference.current)&&!t.domReference.current.contains(i),a=g&&S(g.nodesRef.current,n).length>0,f=g&&o.currentTarget===t.domReference.current&&(null==(c=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}(g.nodesRef.current,n))?void 0:c.some((e=>{var t,n;return null==(t=e.context)||null==(n=t.refs.floating.current)?void 0:n.contains(i)})));!l||!s||a||f||e||r(!1)}function u(){e=!0,setTimeout((()=>{e=!1}))}const c=t.floating.current,i=t.domReference.current;if(c&&T(i)){let e;return m||(c.addEventListener("focusout",o),i.addEventListener("focusout",o),i.addEventListener("pointerdown",u)),m&&(e=v.current.includes("reference")?a([i,c]):a(c)),()=>{m||(c.removeEventListener("focusout",o),i.removeEventListener("focusout",o),i.removeEventListener("pointerdown",u)),null==e||e()}}}),[n,g,m,r,v,u,p,t]),o.useEffect((()=>{const e=t.floating.current,n=k(e);let r=d,o=!1,u=q(n);if(u===n.body&&t.domReference.current&&(u=t.domReference.current),"number"==typeof f){var i;const t=null!=(i=p()[f])?i:e;z(t,t===e)}else if(T(f.current)){var l;const t=null!=(l=f.current)?l:e;z(t,t===e)}function s(e){void 0===e&&(e=!1),"object"==typeof e?(r=!0,o=e.preventScroll):r=e}return c.on("dismiss",s),()=>{c.off("dismiss",s),r&&T(u)&&z(u,o)}}),[p,f,d,t,c]);const h=()=>{var e;return"combobox"===(null==(e=t.domReference.current)?void 0:e.getAttribute("role"))&&Y(t.domReference.current)};return o.createElement(o.Fragment,null,m&&o.createElement(G,{onFocus:e=>{if(h())return;_(e);const t=p();"reference"===l[0]?z(t[0]):z(t[t.length-1])}}),o.cloneElement(i,l.includes("floating")?{tabIndex:0}:{}),m&&s&&o.createElement(G,{onFocus:e=>{h()||(_(e),z(p()[0]))}}))}function Q(e){const t=i();return f((()=>{t.current=e}),[e]),t.current}function Z(e,t,n){return n&&"mouse"!==n?0:"number"==typeof e?e:null==e?void 0:e[t]}const $=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:u=null,mouseOnly:c=!1,restMs:i=0,move:l=!0}=void 0===t?{}:t;const{open:s,onOpenChange:a,dataRef:d,events:m,refs:v,_:g}=e,p=E(),h=w(),b=U(u),y=U(r),R=Q(s),x=o.useRef(),I=o.useRef(),L=o.useRef(),T=o.useRef(),A=o.useRef(!0),M=o.useRef(!1),O=o.useCallback((()=>{var e;const t=null==(e=d.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[d]);o.useEffect((()=>{if(n)return m.on("dismiss",e),()=>{m.off("dismiss",e)};function e(){clearTimeout(I.current),clearTimeout(T.current),A.current=!0}}),[n,m,v]),o.useEffect((()=>{if(!n||!b.current)return;function e(){O()&&a(!1)}const t=k(v.floating.current).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[v,a,n,b,d,O]);const P=o.useCallback((function(e){void 0===e&&(e=!0);const t=Z(y.current,"close",x.current);t&&!L.current?(clearTimeout(I.current),I.current=setTimeout((()=>a(!1)),t)):e&&(clearTimeout(I.current),a(!1))}),[y,a]),D=o.useCallback((()=>{L.current&&(k(v.floating.current).removeEventListener("pointermove",L.current),L.current=void 0)}),[v]),S=o.useCallback((()=>{k(v.floating.current).body.style.pointerEvents="",M.current=!1}),[v]);if(o.useEffect((()=>{if(!n)return;function t(){return!!d.current.openEvent&&["click","mousedown"].includes(d.current.openEvent.type)}function r(e){if(clearTimeout(I.current),A.current=!1,c&&"mouse"!==x.current||i>0&&0===Z(y.current,"open"))return;d.current.openEvent=e;const t=Z(y.current,"open",x.current);t?I.current=setTimeout((()=>{a(!0)}),t):a(!0)}function o(n){if(t())return;const r=k(v.floating.current);if(clearTimeout(T.current),b.current)return clearTimeout(I.current),L.current&&r.removeEventListener("pointermove",L.current),L.current=b.current({...e,tree:p,x:n.clientX,y:n.clientY,onClose(){S(),D(),P()}}),void r.addEventListener("pointermove",L.current);P()}function u(n){t()||null==b.current||b.current({...e,tree:p,x:n.clientX,y:n.clientY,leave:!0,onClose(){S(),D(),P()}})(n)}const f=v.floating.current,m=v.domReference.current;return C(m)?(s&&m.addEventListener("mouseleave",u),null==f||f.addEventListener("mouseleave",u),l&&m.addEventListener("mousemove",r,{once:!0}),m.addEventListener("mouseenter",r),m.addEventListener("mouseleave",o),()=>{s&&m.removeEventListener("mouseleave",u),null==f||f.removeEventListener("mouseleave",u),l&&m.removeEventListener("mousemove",r),m.removeEventListener("mouseenter",r),m.removeEventListener("mouseleave",o)}):void 0}),[g.domReference,n,e,c,i,l,P,D,S,a,s,p,v,y,b,d]),f((()=>{if(n&&s&&b.current&&b.current.__options.blockPointerEvents&&O()){k(v.floating.current).body.style.pointerEvents="none",M.current=!0;const n=v.domReference.current,r=v.floating.current;if(C(n)&&r){var e,t;const o=null==p||null==(e=p.nodesRef.current.find((e=>e.id===h)))||null==(t=e.context)?void 0:t.refs.floating.current;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="auto",r.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents=""}}}}),[n,s,h,v,p,b,d,O]),f((()=>{R&&!s&&(x.current=void 0,D(),S())})),o.useEffect((()=>()=>{D(),clearTimeout(I.current),clearTimeout(T.current),M.current&&S()}),[n,D,S]),!n)return{};function H(e){x.current=e.pointerType}return{reference:{onPointerDown:H,onPointerEnter:H,onMouseMove(){s||0===i||(clearTimeout(T.current),T.current=setTimeout((()=>{A.current||a(!0)}),i))}},floating:{onMouseEnter(){clearTimeout(I.current)},onMouseLeave(){P(!1)}}}},ee=o.createContext({delay:1e3,initialDelay:1e3,currentId:null,setCurrentId:()=>{},setState:()=>{}}),te=()=>o.useContext(ee),ne=e=>{let{children:t,delay:n}=e;const[r,u]=o.useState({delay:n,initialDelay:n,currentId:null}),c=o.useCallback((e=>{u((t=>({...t,currentId:e})))}),[]);return o.createElement(ee.Provider,{value:o.useMemo((()=>({...r,setState:u,setCurrentId:c})),[r,u,c])},t)},re=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:u}=t;const{currentId:c,initialDelay:i,setState:l}=te();o.useEffect((()=>{c&&(l((e=>({...e,delay:{open:1,close:Z(i,"close")}}))),c!==u&&r(!1))}),[u,r,l,c,i]),o.useEffect((()=>{n||c!==u||(r(!1),l((e=>({...e,delay:i,currentId:null}))))}),[n,l,c,u,r,i])};function oe(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:e.elements.floating[t]}}}}const ue=e=>({name:"inner",options:e,async fn(r){const{listRef:o,overflowRef:u,onFallbackChange:c,offset:i=0,index:l=0,minItemsVisible:a=4,referenceOverflowThreshold:f=0,...d}=e,{rects:m,elements:{floating:v}}=r,g=o.current[l];if(!g)return{};const p={...r,...await t(-g.offsetTop-m.reference.height/2-g.offsetHeight/2-i).fn(r)},h=await n(oe(p,"scrollHeight"),d),b=await n(p,{...d,elementContext:"reference"}),y=Math.max(0,h.top),w=p.y+y,E=Math.max(0,v.scrollHeight-y-Math.max(0,h.bottom));return v.style.maxHeight=E+"px",v.scrollTop=y,c&&(v.offsetHeight<g.offsetHeight*Math.min(a,o.current.length-1)-1||b.top>=-f||b.bottom>=-f?s((()=>c(!0))):s((()=>c(!1)))),u&&(u.current=await n(oe({...p,y:w},"offsetHeight"),d)),{y:w}}}),ce=(e,t)=>{let{open:n,refs:r}=e,{enabled:u=!0,overflowRef:c,onChange:i}=t;const l=U(i),a=o.useRef(!1),f=o.useRef(null),d=o.useRef(null);return o.useEffect((()=>{if(!u)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,r=c.current.top>=-.5,o=c.current.bottom>=-.5,u=t.scrollHeight-t.clientHeight,i=n<0?-1:1,a=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),s((()=>{l.current((e=>e+Math[a](n,u*i)))}))):/firefox/i.test(function(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}())&&(t.scrollTop+=n))}const t=r.floating.current;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=c.current&&(d.current={...c.current})})),()=>{f.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0}),[u,n,r,c,l]),u?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=r.floating.current;if(c.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&s((()=>i((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}},ie=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=void 0===t?{}:t;const u=h(),c=h(),i={id:u,role:o};return r?"tooltip"===o?{reference:{"aria-describedby":n?u:void 0},floating:i}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":n?u:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:c}},floating:{...i,..."menu"===o&&{"aria-labelledby":c}}}:{}};function le(e){return T(e.target)&&"BUTTON"===e.target.tagName}const se=function(e,t){let{open:n,onOpenChange:r,dataRef:u,refs:c}=e,{enabled:i=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=void 0===t?{}:t;const d=o.useRef();function m(){return Y(c.domReference.current)}return i?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&("mouse"===d.current&&a||"click"!==l&&(n?!s||u.current.openEvent&&"mousedown"!==u.current.openEvent.type||r(!1):r(!0),u.current.openEvent=e.nativeEvent))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:"mouse"===d.current&&a||(n?!s||u.current.openEvent&&"click"!==u.current.openEvent.type||r(!1):r(!0),u.current.openEvent=e.nativeEvent)},onKeyDown(e){d.current=void 0,f&&(le(e)||(" "!==e.key||m()||e.preventDefault(),"Enter"===e.key&&(n?s&&r(!1):r(!0))))},onKeyUp(e){f&&(le(e)||m()||" "===e.key&&(n?s&&r(!1):r(!0)))}}}:{}};function ae(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)}const fe={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},de={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},me=function(e,t){let{open:n,onOpenChange:u,refs:c,events:i,nodeId:l}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:v="pointerdown",ancestorScroll:g=!1,bubbles:p=!0}=void 0===t?{}:t;const h=E(),b=null!=w(),y=o.useRef(!1);return o.useEffect((()=>{if(!n||!s)return;function e(e){if("Escape"===e.key){if(!p&&h&&S(h.nodesRef.current,l).length>0)return;i.emit("dismiss",{preventScroll:!1}),u(!1)}}function t(e){const t=y.current;if(y.current=!1,t)return;const n=B(e);if(C(n)&&c.floating.current){var r;const t=null!=(r=c.floating.current.ownerDocument.defaultView)?r:window,o=n.scrollWidth>n.clientWidth,u=n.scrollHeight>n.clientHeight;let i=u&&e.offsetX>n.clientWidth;if(u){"rtl"===t.getComputedStyle(n).direction&&(i=e.offsetX<=n.offsetWidth-n.clientWidth)}if(i||o&&e.offsetY>n.clientHeight)return}const o=h&&S(h.nodesRef.current,l).some((t=>{var n;return ae(e,null==(n=t.context)?void 0:n.refs.floating.current)}));ae(e,c.floating.current)||ae(e,c.domReference.current)||o||!p&&h&&S(h.nodesRef.current,l).length>0||(i.emit("dismiss",!!b&&{preventScroll:!0}),u(!1))}function o(){u(!1)}const m=k(c.floating.current);a&&m.addEventListener("keydown",e),f&&m.addEventListener(d,t);const v=(g?[...C(c.reference.current)?r(c.reference.current):[],...C(c.floating.current)?r(c.floating.current):[]]:[]).filter((e=>{var t;return e!==(null==(t=m.defaultView)?void 0:t.visualViewport)}));return v.forEach((e=>e.addEventListener("scroll",o,{passive:!0}))),()=>{a&&m.removeEventListener("keydown",e),f&&m.removeEventListener(d,t),v.forEach((e=>e.removeEventListener("scroll",o)))}}),[a,f,d,i,h,l,n,u,g,s,p,c,b]),s?{reference:{[fe[v]]:()=>{m&&(i.emit("dismiss"),u(!1))}},floating:{[de[d]]:()=>{y.current=!0}}}:{}},ve=function(e,t){let{open:n,onOpenChange:r,dataRef:u,refs:c,events:i}=e,{enabled:l=!0,keyboardOnly:s=!0}=void 0===t?{}:t;const a=o.useRef(""),f=o.useRef(!1),d=o.useRef();return o.useEffect((()=>{var e;if(!l)return;const t=null!=(e=k(c.floating.current).defaultView)?e:window;function r(){!n&&T(c.domReference.current)&&c.domReference.current.blur()}return t.addEventListener("blur",r),()=>{t.removeEventListener("blur",r)}}),[c,n,l]),o.useEffect((()=>{if(l)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){f.current=!0}}),[i,l]),o.useEffect((()=>()=>{clearTimeout(d.current)}),[]),l?{reference:{onPointerDown(e){let{pointerType:t}=e;a.current=t,f.current=!(!t||!s)},onPointerLeave(){f.current=!1},onFocus(e){var t,n,o;f.current||"focus"===e.type&&"mousedown"===(null==(t=u.current.openEvent)?void 0:t.type)&&null!=(n=c.domReference.current)&&n.contains(null==(o=u.current.openEvent)?void 0:o.target)||(u.current.openEvent=e.nativeEvent,r(!0))},onBlur(e){const t=e.relatedTarget;d.current=setTimeout((()=>{var e,n;null!=(e=c.floating.current)&&e.contains(t)||null!=(n=c.domReference.current)&&n.contains(t)||(f.current=!1,r(!1))}))}}}:{}};function ge(e,t,n){return Math.floor(e/t)!==n}function pe(e,t){return t<0||t>=e.current.length}function he(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const c=e.current;let i=n;do{var l,s;i+=r?-u:u}while(i>=0&&i<=c.length-1&&(o?o.includes(i):null==c[i]||(null==(l=c[i])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=c[i])?void 0:s.getAttribute("aria-disabled"))));return i}function be(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ye(e,t){return be(t,"ArrowUp"===e||"ArrowDown"===e,"ArrowLeft"===e||"ArrowRight"===e)}function we(e,t,n){return be(t,"ArrowDown"===e,n?"ArrowLeft"===e:"ArrowRight"===e)||"Enter"===e||" "==e||""===e}function Ee(e,t){return he(e,{disabledIndices:t})}function Re(e,t){return he(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const xe=function(e,t){let{open:n,onOpenChange:r,refs:u}=e,{listRef:c,activeIndex:i,onNavigate:l=(()=>{}),enabled:s=!0,selectedIndex:a=null,allowEscape:d=!1,loop:m=!1,nested:v=!1,rtl:g=!1,virtual:p=!1,focusItemOnOpen:h="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:y=!0,disabledIndices:R,orientation:x="vertical",cols:I=1}=void 0===t?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;const L=w(),C=E(),A=Q(n),O=M(l),P=M(Q(l)),D=o.useRef(h),S=o.useRef(null!=a?a:-1),H=o.useRef(null),F=U(R),K=o.useRef(!1),j=o.useRef(-1),[N,V]=o.useState(),W=o.useCallback(((e,t)=>{j.current=requestAnimationFrame((()=>{var n,r;p?V(null==(n=e.current[t.current])?void 0:n.id):null==(r=e.current[t.current])||r.focus({preventScroll:!0})}))}),[p]);function B(e){if(K.current=!0,v&&function(e,t,n){return be(t,n?"ArrowRight"===e:"ArrowLeft"===e,"ArrowUp"===e)}(e.key,x,g))return _(e),r(!1),void(T(u.domReference.current)&&u.domReference.current.focus());const t=S.current,o=Ee(c,R),i=Re(c,R);if("Home"===e.key&&(S.current=o,O(S.current)),"End"===e.key&&(S.current=i,O(S.current)),I>1){const t=S.current;if("ArrowUp"===e.key){if(_(e),-1===t)S.current=i;else if(S.current=he(c,{startingIndex:t,amount:I,decrement:!0,disabledIndices:R}),m&&(t-I<o||S.current<0)){const e=t%I,n=i%I,r=i-(n-e);S.current=n===e?i:n>e?r:r-I}pe(c,S.current)&&(S.current=t),O(S.current)}if("ArrowDown"===e.key&&(_(e),-1===t?S.current=o:(S.current=he(c,{startingIndex:t,amount:I,disabledIndices:R}),m&&t+I>i&&(S.current=he(c,{startingIndex:t%I-I,amount:I,disabledIndices:R}))),pe(c,S.current)&&(S.current=t),O(S.current)),"both"===x){const n=Math.floor(t/I);"ArrowRight"===e.key&&(_(e),t%I!=I-1?(S.current=he(c,{startingIndex:t,disabledIndices:R}),m&&ge(S.current,I,n)&&(S.current=he(c,{startingIndex:t-t%I-1,disabledIndices:R}))):m&&(S.current=he(c,{startingIndex:t-t%I-1,disabledIndices:R})),ge(S.current,I,n)&&(S.current=t)),"ArrowLeft"===e.key&&(_(e),t%I!=0?(S.current=he(c,{startingIndex:t,disabledIndices:R,decrement:!0}),m&&ge(S.current,I,n)&&(S.current=he(c,{startingIndex:t+(I-t%I),decrement:!0,disabledIndices:R}))):m&&(S.current=he(c,{startingIndex:t+(I-t%I),decrement:!0,disabledIndices:R})),ge(S.current,I,n)&&(S.current=t));const r=Math.floor(i/I)===n;return pe(c,S.current)&&(S.current=m&&r?"ArrowLeft"===e.key?i:he(c,{startingIndex:t-t%I-1,disabledIndices:R}):t),void O(S.current)}}if(ye(e.key,x)){if(_(e),n&&!p&&q(e.currentTarget.ownerDocument)===e.currentTarget)return S.current=we(e.key,x,g)?o:i,void O(S.current);we(e.key,x,g)?S.current=m?t>=i?d&&t!==c.current.length?-1:o:he(c,{startingIndex:t,disabledIndices:R}):Math.min(i,he(c,{startingIndex:t,disabledIndices:R})):S.current=m?t<=o?d&&-1!==t?c.current.length:i:he(c,{startingIndex:t,decrement:!0,disabledIndices:R}):Math.max(o,he(c,{startingIndex:t,decrement:!0,disabledIndices:R})),pe(c,S.current)?O(null):O(S.current)}}return f((()=>{s&&(!A&&n&&D.current&&null!=a&&O(a),A&&!n&&(cancelAnimationFrame(j.current),S.current=-1,P(null)))}),[n,A,a,c,W,s,O,P]),f((()=>{if(s&&n)if(null==i){if(null!=a)return;A&&(S.current=-1,W(c,S)),!A&&D.current&&(null!=H.current||!0===D.current&&null==H.current)&&(S.current=null==H.current||we(H.current,x,g)||v?Ee(c,F.current):Re(c,F.current),O(S.current),W(c,S))}else pe(c,i)||(S.current=i,W(c,S))}),[n,A,i,a,v,c,O,W,s,d,x,g,p,F]),f((()=>{if(s&&!n&&A){var e,t;const n=null==C||null==(e=C.nodesRef.current.find((e=>e.id===L)))||null==(t=e.context)?void 0:t.refs.floating.current;n&&!n.contains(q(k(n)))&&n.focus({preventScroll:!0})}}),[s,n,A,C,L]),f((()=>{H.current=null})),s?{reference:{...p&&n&&null!=i&&{"aria-activedescendant":N},onKeyDown(e){if(K.current=!0,p&&n)return B(e);(0===e.key.indexOf("Arrow")||"Enter"===e.key||" "===e.key||""===e.key)&&(H.current=e.key),v?function(e,t,n){return be(t,n?"ArrowLeft"===e:"ArrowRight"===e,"ArrowDown"===e)}(e.key,x,g)&&(_(e),n?(S.current=Ee(c,R),O(S.current)):r(!0)):ye(e.key,x)&&(null!=a&&(S.current=a),_(e),!n&&y?r(!0):B(e),n&&O(S.current))}},floating:{"aria-orientation":"both"===x?void 0:x,...p&&null!=i&&{"aria-activedescendant":N},onKeyDown:B,onPointerMove(){K.current=!1}},item:{onFocus(e){let{currentTarget:t}=e;const n=c.current.indexOf(t);-1!==n&&O(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...b&&{onMouseMove(e){let{currentTarget:t}=e;const n=t;if(n){const e=c.current.indexOf(n);-1!==e&&O(e)}},onPointerLeave(){K.current||(S.current=-1,W(c,S),O(null),p||requestAnimationFrame((()=>{var e;null==(e=u.floating.current)||e.focus({preventScroll:!0})})))}}}}:{}},Ie=function(e,t){var n;let{open:r,dataRef:u}=e,{listRef:c,activeIndex:i,onMatch:l=(()=>{}),enabled:s=!0,findMatch:a=null,resetMs:d=1e3,ignoreKeys:m=[],selectedIndex:v=null}=void 0===t?{listRef:{current:[]},activeIndex:null}:t;const g=o.useRef(),p=o.useRef(""),h=o.useRef(null!=(n=null!=v?v:i)?n:-1),b=o.useRef(null);function y(e){const t=B(e.nativeEvent);if(C(t)&&q(k(t))!==e.currentTarget&&t.closest('[role="dialog"],[role="menu"],[role="listbox"],[role="tree"],[role="grid"]')!==e.currentTarget)return;p.current.length>0&&" "!==p.current[0]&&(u.current.typing=!0," "===e.key&&_(e));const n=c.current;if(null==n||m.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&p.current===e.key&&(p.current="",h.current=b.current),p.current+=e.key,clearTimeout(g.current),g.current=setTimeout((()=>{p.current="",h.current=b.current,u.current.typing=!1}),d);const r=h.current,o=[...n.slice((null!=r?r:0)+1),...n.slice(0,(null!=r?r:0)+1)],i=a?a(o,p.current):o.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(p.current.toLocaleLowerCase())))),s=i?n.indexOf(i):-1;-1!==s&&(l(s),b.current=s)}return f((()=>{r&&(clearTimeout(g.current),b.current=null,p.current="")}),[r]),f((()=>{var e;r&&""===p.current&&(h.current=null!=(e=null!=v?v:i)?e:-1)}),[r,v,i]),s?{reference:{onKeyDown:y},floating:{onKeyDown:y}}:{}};export{ne as FloatingDelayGroup,J as FloatingFocusManager,x as FloatingNode,W as FloatingOverlay,j as FloatingPortal,I as FloatingTree,ue as inner,H as safePolygon,se as useClick,re as useDelayGroup,te as useDelayGroupContext,me as useDismiss,O as useFloating,R as useFloatingNodeId,w as useFloatingParentNodeId,K as useFloatingPortalNode,E as useFloatingTree,ve as useFocus,$ as useHover,h as useId,ce as useInnerOffset,D as useInteractions,xe as useListNavigation,ie as useRole,Ie as useTypeahead};
import{useFloating as e,offset as t,detectOverflow as n,getOverflowAncestors as r}from"@floating-ui/react-dom";export*from"@floating-ui/react-dom";import*as o from"react";import{useLayoutEffect as u,useEffect as c,useRef as i}from"react";import{createPortal as l,flushSync as s}from"react-dom";import{hideOthers as a}from"aria-hidden";var f="undefined"!=typeof document?u:c;function d(){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){e.set(t,(e.get(t)||[]).filter((e=>e!==n)))}}}let m=!1,v=0;const g=()=>"floating-ui-"+v++;const p=o["useId".toString()],h=null!=p?p:function(){const[e,t]=o.useState((()=>m?g():void 0));return f((()=>{null==e&&t(g())}),[]),o.useEffect((()=>{m||(m=!0)}),[]),e},b=o.createContext(null),y=o.createContext(null),w=()=>{var e,t;return null!=(e=null==(t=o.useContext(b))?void 0:t.id)?e:null},E=()=>o.useContext(y),R=()=>{const e=h(),t=E(),n=w();return f((()=>{const r={id:e,parentId:n};return null==t||t.addNode(r),()=>{null==t||t.removeNode(r)}}),[t,e,n]),e},x=e=>{let{children:t,id:n}=e;const r=w();return o.createElement(b.Provider,{value:o.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},I=e=>{let{children:t}=e;const n=o.useRef([]),r=o.useCallback((e=>{n.current=[...n.current,e]}),[]),u=o.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),c=o.useState((()=>d()))[0];return o.createElement(y.Provider,{value:o.useMemo((()=>({nodesRef:n,addNode:r,removeNode:u,events:c})),[n,r,u,c])},t)};function k(e){var t;return null!=(t=null==e?void 0:e.ownerDocument)?t:document}function L(e){var t;return null!=(t=k(e).defaultView)?t:window}function T(e){return!!e&&e instanceof L(e).Element}function C(e){return!!e&&e instanceof L(e).HTMLElement}const A=o["useInsertionEffect".toString()];function M(e){const t=o.useRef((()=>{}));return A?A((()=>{t.current=e})):t.current=e,o.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 O(t){let{open:n=!1,onOpenChange:r,whileElementsMounted:u,placement:c,middleware:i,strategy:l,nodeId:s}=void 0===t?{}:t;const[a,m]=o.useState(null),v=E(),g=o.useRef(null),p=o.useRef({}),h=o.useState((()=>d()))[0],b=e({placement:c,middleware:i,strategy:l,whileElementsMounted:u}),y=M(r),w=o.useMemo((()=>({...b.refs,domReference:g})),[b.refs]),R=o.useMemo((()=>({...b,refs:w,dataRef:p,nodeId:s,events:h,open:n,onOpenChange:y,_:{domReference:a}})),[b,s,h,n,y,w,a]);f((()=>{const e=null==v?void 0:v.nodesRef.current.find((e=>e.id===s));e&&(e.context=R)}));const{reference:x}=b,I=o.useCallback((e=>{(T(e)||null===e)&&(R.refs.domReference.current=e,m(e)),x(e)}),[x,R.refs]);return o.useMemo((()=>({...b,context:R,refs:w,reference:I})),[b,w,R,I])}function P(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];null==(e=r.get(n))||e.forEach((e=>e(...o)))})):e[n]=o})),e):e),{})}}const D=function(e){return void 0===e&&(e=[]),{getReferenceProps:t=>P(t,e,"reference"),getFloatingProps:t=>P(t,e,"floating"),getItemProps:t=>P(t,e,"item")}};function S(e,t){var n;let r=null!=(n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})))?n:[],o=r;for(;o.length;){var u;o=null!=(u=e.filter((e=>{var t;return null==(t=o)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})))?u:[],r=r.concat(o)}return r}function H(e){let t,{restMs:n=0,buffer:r=.5,blockPointerEvents:o=!0,debug:u=null}=void 0===e?{}:e,c=!1;const i=e=>{let{x:o,y:u,placement:i,refs:l,onClose:s,nodeId:a,tree:f,leave:d=!1}=e;return function(e){var m,v,g;function p(){clearTimeout(t),s()}if(clearTimeout(t),e.pointerType&&"mouse"!==e.pointerType)return;const{clientX:h,clientY:b}=e,y="composedPath"in e?e.composedPath()[0]:e.target;if("pointermove"===e.type&&null!=(m=l.domReference.current)&&m.contains(y))return;if("mouseleave"===e.type&&T(e.relatedTarget)&&null!=(v=l.floating.current)&&v.contains(e.relatedTarget))return;if(f&&S(f.nodesRef.current,a).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if(null!=(g=l.floating.current)&&g.contains(y)&&!d)return void(c=!0);if(!l.domReference.current||!l.floating.current||null==i||null==o||null==u)return;const w=l.domReference.current.getBoundingClientRect(),E=l.floating.current.getBoundingClientRect(),R=i.split("-")[0],x=o>E.right-E.width/2,I=u>E.bottom-E.height/2;if("top"===R&&u>=w.bottom-1||"bottom"===R&&u<=w.top+1||"left"===R&&o>=w.right-1||"right"===R&&o<=w.left+1)return p();switch(R){case"top":if(h>=E.left&&h<=E.right&&b>=E.top&&b<=w.top+1)return;break;case"bottom":if(h>=E.left&&h<=E.right&&b>=w.bottom-1&&b<=E.bottom)return;break;case"left":if(h>=E.left&&h<=w.left+1&&b>=E.top&&b<=E.bottom)return;break;case"right":if(h>=w.right-1&&h<=E.right&&b>=E.top&&b<=E.bottom)return}if(c)return p();const k=function(e){let[t,n]=e;const o=E.width>w.width,u=E.height>w.height;switch(R){case"top":return[[o?t+r/2:x?t+4*r:t-4*r,n+r+1],[o?t-r/2:x?t+4*r:t-4*r,n+r+1],...[[E.left,x||o?E.bottom-r:E.top],[E.right,x?o?E.bottom-r:E.top:E.bottom-r]]];case"bottom":return[[o?t+r/2:x?t+4*r:t-4*r,n-r],[o?t-r/2:x?t+4*r:t-4*r,n-r],...[[E.left,x||o?E.top+r:E.bottom],[E.right,x?o?E.top+r:E.bottom:E.top+r]]];case"left":{const e=[t+r+1,u?n+r/2:I?n+4*r:n-4*r],o=[t+r+1,u?n-r/2:I?n+4*r:n-4*r];return[...[[I||u?E.right-r:E.left,E.top],[I?u?E.right-r:E.left:E.right-r,E.bottom]],e,o]}case"right":return[[t-r,u?n+r/2:I?n+4*r:n-4*r],[t-r,u?n-r/2:I?n+4*r:n-4*r],...[[I||u?E.left+r:E.right,E.top],[I?u?E.left+r:E.right:E.left+r,E.bottom]]]}}([o,u]);!function(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,c=u-1;e<u;c=e++){const[u,i]=t[e]||[0,0],[l,s]=t[c]||[0,0];i>=r!=s>=r&&n<=(l-u)*(r-i)/(s-i)+u&&(o=!o)}return o}([h,b],k)?p():n&&(t=setTimeout(s,n))}};return i.__options={blockPointerEvents:o},i}const F="floating-ui-root",K=function(e){let{id:t=F,enabled:n=!0}=void 0===e?{}:e;const[r,u]=o.useState(null);return f((()=>{if(!n)return;const e=document.getElementById(t);if(e)u(e);else{const e=document.createElement("div");e.id=t,u(e),document.body.contains(e)||document.body.appendChild(e)}}),[t,n]),r},j=e=>{let{children:t,id:n=F,root:r=null}=e;const o=K({id:n,enabled:!r});return r?l(t,r):o?l(t,o):null};function N(){return N=Object.assign||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},N.apply(this,arguments)}const V="data-floating-ui-scroll-lock",W=o.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return f((()=>{var e,t,r,o;if(!n)return;if(document.body.hasAttribute(V))return;document.body.setAttribute(V,"");const u=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",c=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()))return Object.assign(document.body.style,{overflow:"hidden",[u]:c+"px"}),()=>{document.body.removeAttribute(V),Object.assign(document.body.style,{overflow:"",[u]:""})};const i=null!=(e=null==(t=window.visualViewport)?void 0:t.offsetLeft)?e:0,l=null!=(r=null==(o=window.visualViewport)?void 0:o.offsetTop)?r:0,s=window.pageXOffset,a=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(a-Math.floor(l))+"px",left:-(s-Math.floor(i))+"px",right:"0",[u]:c+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[u]:""}),document.body.removeAttribute(V),window.scrollTo(s,a)}}),[n]),o.createElement("div",N({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function q(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}function B(e){return"composedPath"in e?e.composedPath()[0]:e.target}const X="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Y(e){return C(e)&&e.matches(X)}function _(e){e.preventDefault(),e.stopPropagation()}function U(e){const t=i(e);return f((()=>{t.current=e})),t}function z(e,t){void 0===t&&(t=!1),requestAnimationFrame((()=>{null==e||e.focus({preventScroll:t})}))}const G=o.forwardRef((function(e,t){return o.createElement("span",N({},e,{ref:t,tabIndex:0,style:{position:"fixed",opacity:"0",pointerEvents:"none",outline:"0"}}))}));function J(e){let{context:{refs:t,nodeId:n,onOpenChange:r,dataRef:u,events:c},children:i,order:l=["content"],endGuard:s=!0,initialFocus:f=0,returnFocus:d=!0,modal:m=!0}=e;const v=U(l),g=E(),p=o.useCallback((()=>v.current.map((e=>{return"reference"===e?t.domReference.current:t.floating.current&&"floating"===e?t.floating.current:"content"===e?Array.from(null!=(n=null==(r=t.floating.current)?void 0:r.querySelectorAll("select:not([disabled]),a[href],button:not([disabled]),[tabindex],iframe,object,embed,area[href],audio[controls],video[controls],input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"))?n:[]):null;var n,r})).flat().filter((e=>{if(e===t.floating.current||e===t.domReference.current)return!0;if(C(e)){var n;return"-"!==(null!=(n=e.getAttribute("tabindex"))?n:"0")[0].trim()}}))),[v,t]);o.useEffect((()=>{if(!m)return;const e=0===p().filter((e=>e!==t.floating.current&&e!==t.domReference.current)).length;function n(n){if("Tab"===n.key){e&&_(n);const r=p(),o=B(n);"reference"===v.current[0]&&o===t.domReference.current&&(_(n),n.shiftKey?z(r[r.length-1]):z(r[1])),"floating"===v.current[1]&&o===t.floating.current&&n.shiftKey&&(_(n),z(r[0]))}}const r=k(t.floating.current);return r.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",n)}}),[m,p,v,t]),o.useEffect((()=>{let e=!1;function o(o){var u,c;const i=o.relatedTarget,l=!(null!=(u=t.floating.current)&&u.contains(i)),s=T(t.domReference.current)&&!t.domReference.current.contains(i),a=g&&S(g.nodesRef.current,n).length>0,f=g&&o.currentTarget===t.domReference.current&&(null==(c=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}(g.nodesRef.current,n))?void 0:c.some((e=>{var t,n;return null==(t=e.context)||null==(n=t.refs.floating.current)?void 0:n.contains(i)})));!l||!s||a||f||e||r(!1)}function u(){e=!0,setTimeout((()=>{e=!1}))}const c=t.floating.current,i=t.domReference.current;if(c&&C(i)){let e;return m||(c.addEventListener("focusout",o),i.addEventListener("focusout",o),i.addEventListener("pointerdown",u)),m&&(e=v.current.includes("reference")?a([i,c]):a(c)),()=>{m||(c.removeEventListener("focusout",o),i.removeEventListener("focusout",o),i.removeEventListener("pointerdown",u)),null==e||e()}}}),[n,g,m,r,v,u,p,t]),o.useEffect((()=>{const e=t.floating.current,n=k(e);let r=d,o=!1,u=q(n);if(u===n.body&&t.domReference.current&&(u=t.domReference.current),"number"==typeof f){var i;const t=null!=(i=p()[f])?i:e;z(t,t===e)}else if(C(f.current)){var l;const t=null!=(l=f.current)?l:e;z(t,t===e)}function s(e){void 0===e&&(e=!1),"object"==typeof e?(r=!0,o=e.preventScroll):r=e}return c.on("dismiss",s),()=>{c.off("dismiss",s),r&&C(u)&&z(u,o)}}),[p,f,d,t,c]);const h=()=>{var e;return"combobox"===(null==(e=t.domReference.current)?void 0:e.getAttribute("role"))&&Y(t.domReference.current)};return o.createElement(o.Fragment,null,m&&o.createElement(G,{onFocus:e=>{if(h())return;_(e);const t=p();"reference"===l[0]?z(t[0]):z(t[t.length-1])}}),o.cloneElement(i,l.includes("floating")?{tabIndex:0}:{}),m&&s&&o.createElement(G,{onFocus:e=>{h()||(_(e),z(p()[0]))}}))}function Q(e){const t=i();return f((()=>{t.current=e}),[e]),t.current}function Z(e,t,n){return n&&"mouse"!==n?0:"number"==typeof e?e:null==e?void 0:e[t]}const $=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:u=null,mouseOnly:c=!1,restMs:i=0,move:l=!0}=void 0===t?{}:t;const{open:s,onOpenChange:a,dataRef:d,events:m,refs:v,_:g}=e,p=E(),h=w(),b=U(u),y=U(r),R=Q(s),x=o.useRef(),I=o.useRef(),L=o.useRef(),C=o.useRef(),A=o.useRef(!0),M=o.useRef(!1),O=o.useCallback((()=>{var e;const t=null==(e=d.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[d]);o.useEffect((()=>{if(n)return m.on("dismiss",e),()=>{m.off("dismiss",e)};function e(){clearTimeout(I.current),clearTimeout(C.current),A.current=!0}}),[n,m,v]),o.useEffect((()=>{if(!n||!b.current)return;function e(){O()&&a(!1)}const t=k(v.floating.current).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[v,a,n,b,d,O]);const P=o.useCallback((function(e){void 0===e&&(e=!0);const t=Z(y.current,"close",x.current);t&&!L.current?(clearTimeout(I.current),I.current=setTimeout((()=>a(!1)),t)):e&&(clearTimeout(I.current),a(!1))}),[y,a]),D=o.useCallback((()=>{L.current&&(k(v.floating.current).removeEventListener("pointermove",L.current),L.current=void 0)}),[v]),S=o.useCallback((()=>{k(v.floating.current).body.style.pointerEvents="",M.current=!1}),[v]);if(o.useEffect((()=>{if(!n)return;function t(){return!!d.current.openEvent&&["click","mousedown"].includes(d.current.openEvent.type)}function r(e){if(clearTimeout(I.current),A.current=!1,c&&"mouse"!==x.current||i>0&&0===Z(y.current,"open"))return;d.current.openEvent=e;const t=Z(y.current,"open",x.current);t?I.current=setTimeout((()=>{a(!0)}),t):a(!0)}function o(n){if(t())return;const r=k(v.floating.current);if(clearTimeout(C.current),b.current)return clearTimeout(I.current),L.current&&r.removeEventListener("pointermove",L.current),L.current=b.current({...e,tree:p,x:n.clientX,y:n.clientY,onClose(){S(),D(),P()}}),void r.addEventListener("pointermove",L.current);P()}function u(n){t()||null==b.current||b.current({...e,tree:p,x:n.clientX,y:n.clientY,leave:!0,onClose(){S(),D(),P()}})(n)}const f=v.floating.current,m=v.domReference.current;return T(m)?(s&&m.addEventListener("mouseleave",u),null==f||f.addEventListener("mouseleave",u),l&&m.addEventListener("mousemove",r,{once:!0}),m.addEventListener("mouseenter",r),m.addEventListener("mouseleave",o),()=>{s&&m.removeEventListener("mouseleave",u),null==f||f.removeEventListener("mouseleave",u),l&&m.removeEventListener("mousemove",r),m.removeEventListener("mouseenter",r),m.removeEventListener("mouseleave",o)}):void 0}),[g.domReference,n,e,c,i,l,P,D,S,a,s,p,v,y,b,d]),f((()=>{if(n&&s&&b.current&&b.current.__options.blockPointerEvents&&O()){k(v.floating.current).body.style.pointerEvents="none",M.current=!0;const n=v.domReference.current,r=v.floating.current;if(T(n)&&r){var e,t;const o=null==p||null==(e=p.nodesRef.current.find((e=>e.id===h)))||null==(t=e.context)?void 0:t.refs.floating.current;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="auto",r.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents=""}}}}),[n,s,h,v,p,b,d,O]),f((()=>{R&&!s&&(x.current=void 0,D(),S())})),o.useEffect((()=>()=>{D(),clearTimeout(I.current),clearTimeout(C.current),M.current&&S()}),[n,D,S]),!n)return{};function H(e){x.current=e.pointerType}return{reference:{onPointerDown:H,onPointerEnter:H,onMouseMove(){s||0===i||(clearTimeout(C.current),C.current=setTimeout((()=>{A.current||a(!0)}),i))}},floating:{onMouseEnter(){clearTimeout(I.current)},onMouseLeave(){P(!1)}}}},ee=o.createContext({delay:1e3,initialDelay:1e3,currentId:null,setCurrentId:()=>{},setState:()=>{}}),te=()=>o.useContext(ee),ne=e=>{let{children:t,delay:n}=e;const[r,u]=o.useState({delay:n,initialDelay:n,currentId:null}),c=o.useCallback((e=>{u((t=>({...t,currentId:e})))}),[]);return o.createElement(ee.Provider,{value:o.useMemo((()=>({...r,setState:u,setCurrentId:c})),[r,u,c])},t)},re=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:u}=t;const{currentId:c,initialDelay:i,setState:l}=te();o.useEffect((()=>{c&&(l((e=>({...e,delay:{open:1,close:Z(i,"close")}}))),c!==u&&r(!1))}),[u,r,l,c,i]),o.useEffect((()=>{n||c!==u||(r(!1),l((e=>({...e,delay:i,currentId:null}))))}),[n,l,c,u,r,i])};function oe(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:e.elements.floating[t]}}}}const ue=e=>({name:"inner",options:e,async fn(r){const{listRef:o,overflowRef:u,onFallbackChange:c,offset:i=0,index:l=0,minItemsVisible:a=4,referenceOverflowThreshold:f=0,...d}=e,{rects:m,elements:{floating:v}}=r,g=o.current[l];if(!g)return{};const p={...r,...await t(-g.offsetTop-m.reference.height/2-g.offsetHeight/2-i).fn(r)},h=await n(oe(p,"scrollHeight"),d),b=await n(p,{...d,elementContext:"reference"}),y=Math.max(0,h.top),w=p.y+y,E=Math.max(0,v.scrollHeight-y-Math.max(0,h.bottom));return v.style.maxHeight=E+"px",v.scrollTop=y,c&&(v.offsetHeight<g.offsetHeight*Math.min(a,o.current.length-1)-1||b.top>=-f||b.bottom>=-f?s((()=>c(!0))):s((()=>c(!1)))),u&&(u.current=await n(oe({...p,y:w},"offsetHeight"),d)),{y:w}}}),ce=(e,t)=>{let{open:n,refs:r}=e,{enabled:u=!0,overflowRef:c,onChange:i}=t;const l=U(i),a=o.useRef(!1),f=o.useRef(null),d=o.useRef(null);return o.useEffect((()=>{if(!u)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,r=c.current.top>=-.5,o=c.current.bottom>=-.5,u=t.scrollHeight-t.clientHeight,i=n<0?-1:1,a=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),s((()=>{l.current((e=>e+Math[a](n,u*i)))}))):/firefox/i.test(function(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}())&&(t.scrollTop+=n))}const t=r.floating.current;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=c.current&&(d.current={...c.current})})),()=>{f.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0}),[u,n,r,c,l]),u?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=r.floating.current;if(c.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&s((()=>i((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}},ie=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=void 0===t?{}:t;const u=h(),c=h(),i={id:u,role:o};return r?"tooltip"===o?{reference:{"aria-describedby":n?u:void 0},floating:i}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":n?u:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:c}},floating:{...i,..."menu"===o&&{"aria-labelledby":c}}}:{}};function le(e){return C(e.target)&&"BUTTON"===e.target.tagName}const se=function(e,t){let{open:n,onOpenChange:r,dataRef:u,refs:c}=e,{enabled:i=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=void 0===t?{}:t;const d=o.useRef();function m(){return Y(c.domReference.current)}return i?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&("mouse"===d.current&&a||"click"!==l&&(n?!s||u.current.openEvent&&"mousedown"!==u.current.openEvent.type||r(!1):r(!0),u.current.openEvent=e.nativeEvent))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:"mouse"===d.current&&a||(n?!s||u.current.openEvent&&"click"!==u.current.openEvent.type||r(!1):r(!0),u.current.openEvent=e.nativeEvent)},onKeyDown(e){d.current=void 0,f&&(le(e)||(" "!==e.key||m()||e.preventDefault(),"Enter"===e.key&&(n?s&&r(!1):r(!0))))},onKeyUp(e){f&&(le(e)||m()||" "===e.key&&(n?s&&r(!1):r(!0)))}}}:{}};function ae(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)}const fe={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},de={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},me=function(e,t){let{open:n,onOpenChange:u,refs:c,events:i,nodeId:l}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:v="pointerdown",ancestorScroll:g=!1,bubbles:p=!0}=void 0===t?{}:t;const h=E(),b=null!=w(),y=o.useRef(!1);return o.useEffect((()=>{if(!n||!s)return;function e(e){if("Escape"===e.key){if(!p&&h&&S(h.nodesRef.current,l).length>0)return;i.emit("dismiss",{preventScroll:!1}),u(!1)}}function t(e){const t=y.current;if(y.current=!1,t)return;const n=B(e);if(T(n)&&c.floating.current){var r;const t=null!=(r=c.floating.current.ownerDocument.defaultView)?r:window,o=n.scrollWidth>n.clientWidth,u=n.scrollHeight>n.clientHeight;let i=u&&e.offsetX>n.clientWidth;if(u){"rtl"===t.getComputedStyle(n).direction&&(i=e.offsetX<=n.offsetWidth-n.clientWidth)}if(i||o&&e.offsetY>n.clientHeight)return}const o=h&&S(h.nodesRef.current,l).some((t=>{var n;return ae(e,null==(n=t.context)?void 0:n.refs.floating.current)}));ae(e,c.floating.current)||ae(e,c.domReference.current)||o||!p&&h&&S(h.nodesRef.current,l).length>0||(i.emit("dismiss",!!b&&{preventScroll:!0}),u(!1))}function o(){u(!1)}const m=k(c.floating.current);a&&m.addEventListener("keydown",e),f&&m.addEventListener(d,t);const v=(g?[...T(c.reference.current)?r(c.reference.current):[],...T(c.floating.current)?r(c.floating.current):[]]:[]).filter((e=>{var t;return e!==(null==(t=m.defaultView)?void 0:t.visualViewport)}));return v.forEach((e=>e.addEventListener("scroll",o,{passive:!0}))),()=>{a&&m.removeEventListener("keydown",e),f&&m.removeEventListener(d,t),v.forEach((e=>e.removeEventListener("scroll",o)))}}),[a,f,d,i,h,l,n,u,g,s,p,c,b]),s?{reference:{[fe[v]]:()=>{m&&(i.emit("dismiss"),u(!1))}},floating:{[de[d]]:()=>{y.current=!0}}}:{}},ve=function(e,t){let{open:n,onOpenChange:r,dataRef:u,refs:c,events:i}=e,{enabled:l=!0,keyboardOnly:s=!0}=void 0===t?{}:t;const a=o.useRef(""),f=o.useRef(!1),d=o.useRef();return o.useEffect((()=>{var e;if(!l)return;const t=null!=(e=k(c.floating.current).defaultView)?e:window;function r(){!n&&C(c.domReference.current)&&c.domReference.current.blur()}return t.addEventListener("blur",r),()=>{t.removeEventListener("blur",r)}}),[c,n,l]),o.useEffect((()=>{if(l)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){f.current=!0}}),[i,l]),o.useEffect((()=>()=>{clearTimeout(d.current)}),[]),l?{reference:{onPointerDown(e){let{pointerType:t}=e;a.current=t,f.current=!(!t||!s)},onPointerLeave(){f.current=!1},onFocus(e){var t,n,o;f.current||"focus"===e.type&&"mousedown"===(null==(t=u.current.openEvent)?void 0:t.type)&&null!=(n=c.domReference.current)&&n.contains(null==(o=u.current.openEvent)?void 0:o.target)||(u.current.openEvent=e.nativeEvent,r(!0))},onBlur(e){const t=e.relatedTarget;d.current=setTimeout((()=>{var e,n;null!=(e=c.floating.current)&&e.contains(t)||null!=(n=c.domReference.current)&&n.contains(t)||(f.current=!1,r(!1))}))}}}:{}};function ge(e,t,n){return Math.floor(e/t)!==n}function pe(e,t){return t<0||t>=e.current.length}function he(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const c=e.current;let i=n;do{var l,s;i+=r?-u:u}while(i>=0&&i<=c.length-1&&(o?o.includes(i):null==c[i]||(null==(l=c[i])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=c[i])?void 0:s.getAttribute("aria-disabled"))));return i}function be(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ye(e,t){return be(t,"ArrowUp"===e||"ArrowDown"===e,"ArrowLeft"===e||"ArrowRight"===e)}function we(e,t,n){return be(t,"ArrowDown"===e,n?"ArrowLeft"===e:"ArrowRight"===e)||"Enter"===e||" "==e||""===e}function Ee(e,t){return he(e,{disabledIndices:t})}function Re(e,t){return he(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const xe=function(e,t){let{open:n,onOpenChange:r,refs:u}=e,{listRef:c,activeIndex:i,onNavigate:l=(()=>{}),enabled:s=!0,selectedIndex:a=null,allowEscape:d=!1,loop:m=!1,nested:v=!1,rtl:g=!1,virtual:p=!1,focusItemOnOpen:h="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:y=!0,disabledIndices:R,orientation:x="vertical",cols:I=1}=void 0===t?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;const L=w(),T=E(),A=Q(n),O=M(l),P=M(Q(l)),D=o.useRef(h),S=o.useRef(null!=a?a:-1),H=o.useRef(null),F=U(R),K=o.useRef(!1),j=o.useRef(-1),[N,V]=o.useState(),W=o.useCallback(((e,t)=>{j.current=requestAnimationFrame((()=>{var n,r;p?V(null==(n=e.current[t.current])?void 0:n.id):null==(r=e.current[t.current])||r.focus({preventScroll:!0})}))}),[p]);function B(e){if(K.current=!0,v&&function(e,t,n){return be(t,n?"ArrowRight"===e:"ArrowLeft"===e,"ArrowUp"===e)}(e.key,x,g))return _(e),r(!1),void(C(u.domReference.current)&&u.domReference.current.focus());const t=S.current,o=Ee(c,R),i=Re(c,R);if("Home"===e.key&&(S.current=o,O(S.current)),"End"===e.key&&(S.current=i,O(S.current)),I>1){const t=S.current;if("ArrowUp"===e.key){if(_(e),-1===t)S.current=i;else if(S.current=he(c,{startingIndex:t,amount:I,decrement:!0,disabledIndices:R}),m&&(t-I<o||S.current<0)){const e=t%I,n=i%I,r=i-(n-e);S.current=n===e?i:n>e?r:r-I}pe(c,S.current)&&(S.current=t),O(S.current)}if("ArrowDown"===e.key&&(_(e),-1===t?S.current=o:(S.current=he(c,{startingIndex:t,amount:I,disabledIndices:R}),m&&t+I>i&&(S.current=he(c,{startingIndex:t%I-I,amount:I,disabledIndices:R}))),pe(c,S.current)&&(S.current=t),O(S.current)),"both"===x){const n=Math.floor(t/I);"ArrowRight"===e.key&&(_(e),t%I!=I-1?(S.current=he(c,{startingIndex:t,disabledIndices:R}),m&&ge(S.current,I,n)&&(S.current=he(c,{startingIndex:t-t%I-1,disabledIndices:R}))):m&&(S.current=he(c,{startingIndex:t-t%I-1,disabledIndices:R})),ge(S.current,I,n)&&(S.current=t)),"ArrowLeft"===e.key&&(_(e),t%I!=0?(S.current=he(c,{startingIndex:t,disabledIndices:R,decrement:!0}),m&&ge(S.current,I,n)&&(S.current=he(c,{startingIndex:t+(I-t%I),decrement:!0,disabledIndices:R}))):m&&(S.current=he(c,{startingIndex:t+(I-t%I),decrement:!0,disabledIndices:R})),ge(S.current,I,n)&&(S.current=t));const r=Math.floor(i/I)===n;return pe(c,S.current)&&(S.current=m&&r?"ArrowLeft"===e.key?i:he(c,{startingIndex:t-t%I-1,disabledIndices:R}):t),void O(S.current)}}if(ye(e.key,x)){if(_(e),n&&!p&&q(e.currentTarget.ownerDocument)===e.currentTarget)return S.current=we(e.key,x,g)?o:i,void O(S.current);we(e.key,x,g)?S.current=m?t>=i?d&&t!==c.current.length?-1:o:he(c,{startingIndex:t,disabledIndices:R}):Math.min(i,he(c,{startingIndex:t,disabledIndices:R})):S.current=m?t<=o?d&&-1!==t?c.current.length:i:he(c,{startingIndex:t,decrement:!0,disabledIndices:R}):Math.max(o,he(c,{startingIndex:t,decrement:!0,disabledIndices:R})),pe(c,S.current)?O(null):O(S.current)}}return f((()=>{s&&(!A&&n&&D.current&&null!=a&&O(a),A&&!n&&(cancelAnimationFrame(j.current),S.current=-1,P(null)))}),[n,A,a,c,W,s,O,P]),f((()=>{if(s&&n)if(null==i){if(null!=a)return;A&&(S.current=-1,W(c,S)),!A&&D.current&&(null!=H.current||!0===D.current&&null==H.current)&&(S.current=null==H.current||we(H.current,x,g)||v?Ee(c,F.current):Re(c,F.current),O(S.current),W(c,S))}else pe(c,i)||(S.current=i,W(c,S))}),[n,A,i,a,v,c,O,W,s,d,x,g,p,F]),f((()=>{if(s&&!n&&A){var e,t;const n=null==T||null==(e=T.nodesRef.current.find((e=>e.id===L)))||null==(t=e.context)?void 0:t.refs.floating.current;n&&!n.contains(q(k(n)))&&n.focus({preventScroll:!0})}}),[s,n,A,T,L]),f((()=>{H.current=null})),s?{reference:{...p&&n&&null!=i&&{"aria-activedescendant":N},onKeyDown(e){if(K.current=!0,p&&n)return B(e);(0===e.key.indexOf("Arrow")||"Enter"===e.key||" "===e.key||""===e.key)&&(H.current=e.key),v?function(e,t,n){return be(t,n?"ArrowLeft"===e:"ArrowRight"===e,"ArrowDown"===e)}(e.key,x,g)&&(_(e),n?(S.current=Ee(c,R),O(S.current)):r(!0)):ye(e.key,x)&&(null!=a&&(S.current=a),_(e),!n&&y?r(!0):B(e),n&&O(S.current))}},floating:{"aria-orientation":"both"===x?void 0:x,...p&&null!=i&&{"aria-activedescendant":N},onKeyDown:B,onPointerMove(){K.current=!1}},item:{onFocus(e){let{currentTarget:t}=e;const n=c.current.indexOf(t);-1!==n&&O(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...b&&{onMouseMove(e){let{currentTarget:t}=e;const n=t;if(n){const e=c.current.indexOf(n);-1!==e&&O(e)}},onPointerLeave(){K.current||(S.current=-1,W(c,S),O(null),p||requestAnimationFrame((()=>{var e;null==(e=u.floating.current)||e.focus({preventScroll:!0})})))}}}}:{}},Ie=function(e,t){var n;let{open:r,dataRef:u}=e,{listRef:c,activeIndex:i,onMatch:l=(()=>{}),enabled:s=!0,findMatch:a=null,resetMs:d=1e3,ignoreKeys:m=[],selectedIndex:v=null}=void 0===t?{listRef:{current:[]},activeIndex:null}:t;const g=o.useRef(),p=o.useRef(""),h=o.useRef(null!=(n=null!=v?v:i)?n:-1),b=o.useRef(null);function y(e){const t=B(e.nativeEvent);if(T(t)&&q(k(t))!==e.currentTarget&&t.closest('[role="dialog"],[role="menu"],[role="listbox"],[role="tree"],[role="grid"]')!==e.currentTarget)return;p.current.length>0&&" "!==p.current[0]&&(u.current.typing=!0," "===e.key&&_(e));const n=c.current;if(null==n||m.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&p.current===e.key&&(p.current="",h.current=b.current),p.current+=e.key,clearTimeout(g.current),g.current=setTimeout((()=>{p.current="",h.current=b.current,u.current.typing=!1}),d);const r=h.current,o=[...n.slice((null!=r?r:0)+1),...n.slice(0,(null!=r?r:0)+1)],i=a?a(o,p.current):o.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(p.current.toLocaleLowerCase())))),s=i?n.indexOf(i):-1;-1!==s&&(l(s),b.current=s)}return f((()=>{r&&(clearTimeout(g.current),b.current=null,p.current="")}),[r]),f((()=>{var e;r&&""===p.current&&(h.current=null!=(e=null!=v?v:i)?e:-1)}),[r,v,i]),s?{reference:{onKeyDown:y},floating:{onKeyDown:y}}:{}};export{ne as FloatingDelayGroup,J as FloatingFocusManager,x as FloatingNode,W as FloatingOverlay,j as FloatingPortal,I as FloatingTree,ue as inner,H as safePolygon,se as useClick,re as useDelayGroup,te as useDelayGroupContext,me as useDismiss,O as useFloating,R as useFloatingNodeId,w as useFloatingParentNodeId,K as useFloatingPortalNode,E as useFloatingTree,ve as useFocus,$ as useHover,h as useId,ce as useInnerOffset,D as useInteractions,xe as useListNavigation,ie as useRole,Ie as useTypeahead};

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/react-dom"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/react-dom","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReactDOM={},e.FloatingUIReactDOM,e.React,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(n),c="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function i(){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){e.set(t,(e.get(t)||[]).filter((e=>e!==n)))}}}let l=!1,s=0;const a=()=>"floating-ui-"+s++;const f=u["useId".toString()],d=null!=f?f:function(){const[e,t]=u.useState((()=>l?a():void 0));return c((()=>{null==e&&t(a())}),[]),u.useEffect((()=>{l||(l=!0)}),[]),e},v=u.createContext(null),m=u.createContext(null),g=()=>{var e,t;return null!=(e=null==(t=u.useContext(v))?void 0:t.id)?e:null},p=()=>u.useContext(m);function h(e){var t;return null!=(t=null==e?void 0:e.ownerDocument)?t:document}function b(e){var t;return null!=(t=h(e).defaultView)?t:window}function y(e){return!!e&&e instanceof b(e).Element}function w(e){return!!e&&e instanceof b(e).HTMLElement}const E=u["useInsertionEffect".toString()];function R(e){const t=u.useRef((()=>{}));return E?E((()=>{t.current=e})):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 x(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];null==(e=r.get(n))||e.forEach((e=>e(...o)))})):e[n]=o})),e):e),{})}}function I(e,t){var n;let r=null!=(n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})))?n:[],o=r;for(;o.length;){var u;o=null!=(u=e.filter((e=>{var t;return null==(t=o)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})))?u:[],r=r.concat(o)}return r}const k="floating-ui-root",T=function(e){let{id:t=k,enabled:n=!0}=void 0===e?{}:e;const[r,o]=u.useState(null);return c((()=>{if(!n)return;const e=document.getElementById(t);if(e)o(e);else{const e=document.createElement("div");e.id=t,o(e),document.body.contains(e)||document.body.appendChild(e)}}),[t,n]),r};function O(){return O=Object.assign||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},O.apply(this,arguments)}const C="data-floating-ui-scroll-lock",M=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return c((()=>{var e,t,r,o;if(!n)return;if(document.body.hasAttribute(C))return;document.body.setAttribute(C,"");const u=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",c=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()))return Object.assign(document.body.style,{overflow:"hidden",[u]:c+"px"}),()=>{document.body.removeAttribute(C),Object.assign(document.body.style,{overflow:"",[u]:""})};const i=null!=(e=null==(t=window.visualViewport)?void 0:t.offsetLeft)?e:0,l=null!=(r=null==(o=window.visualViewport)?void 0:o.offsetTop)?r:0,s=window.pageXOffset,a=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(a-Math.floor(l))+"px",left:-(s-Math.floor(i))+"px",right:"0",[u]:c+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[u]:""}),document.body.removeAttribute(C),window.scrollTo(s,a)}}),[n]),u.createElement("div",O({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));var L=new WeakMap,P=new WeakMap,A={},D=0,F=function(e,t,n){void 0===t&&(t=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e)),void 0===n&&(n="data-aria-hidden");var r=Array.isArray(e)?e:[e];A[n]||(A[n]=new WeakMap);var o=A[n],u=[],c=new Set,i=function(e){e&&!c.has(e)&&(c.add(e),i(e.parentNode))};r.forEach(i);var l=function(e){!e||r.indexOf(e)>=0||Array.prototype.forEach.call(e.children,(function(e){if(c.has(e))l(e);else{var t=e.getAttribute("aria-hidden"),r=null!==t&&"false"!==t,i=(L.get(e)||0)+1,s=(o.get(e)||0)+1;L.set(e,i),o.set(e,s),u.push(e),1===i&&r&&P.set(e,!0),1===s&&e.setAttribute(n,"true"),r||e.setAttribute("aria-hidden","true")}}))};return l(t),c.clear(),D++,function(){u.forEach((function(e){var t=L.get(e)-1,r=o.get(e)-1;L.set(e,t),o.set(e,r),t||(P.has(e)||e.removeAttribute("aria-hidden"),P.delete(e)),r||e.removeAttribute(n)})),--D||(L=new WeakMap,L=new WeakMap,P=new WeakMap,A={})}};function S(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}function j(e){return"composedPath"in e?e.composedPath()[0]:e.target}const H="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function K(e){return w(e)&&e.matches(H)}function N(e){e.preventDefault(),e.stopPropagation()}function W(e){const t=n.useRef(e);return c((()=>{t.current=e})),t}function _(e,t){void 0===t&&(t=!1),requestAnimationFrame((()=>{null==e||e.focus({preventScroll:t})}))}const q=u.forwardRef((function(e,t){return u.createElement("span",O({},e,{ref:t,tabIndex:0,style:{position:"fixed",opacity:"0",pointerEvents:"none",outline:"0"}}))}));function V(e){const t=n.useRef();return c((()=>{t.current=e}),[e]),t.current}function B(e,t,n){return n&&"mouse"!==n?0:"number"==typeof e?e:null==e?void 0:e[t]}const X=u.createContext({delay:1e3,initialDelay:1e3,currentId:null,setCurrentId:()=>{},setState:()=>{}}),Y=()=>u.useContext(X);function U(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:e.elements.floating[t]}}}}function G(e){return w(e.target)&&"BUTTON"===e.target.tagName}function z(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)}const J={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Q={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Z="ArrowUp",$="ArrowDown",ee="ArrowLeft",te="ArrowRight";function ne(e,t,n){return Math.floor(e/t)!==n}function re(e,t){return t<0||t>=e.current.length}function oe(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const c=e.current;let i=n;do{var l,s;i+=r?-u:u}while(i>=0&&i<=c.length-1&&(o?o.includes(i):null==c[i]||(null==(l=c[i])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=c[i])?void 0:s.getAttribute("aria-disabled"))));return i}function ue(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ce(e,t){return ue(t,e===Z||e===$,e===ee||e===te)}function ie(e,t,n){return ue(t,e===$,n?e===ee:e===te)||"Enter"===e||" "==e||""===e}function le(e,t){return oe(e,{disabledIndices:t})}function se(e,t){return oe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}e.FloatingDelayGroup=e=>{let{children:t,delay:n}=e;const[r,o]=u.useState({delay:n,initialDelay:n,currentId:null}),c=u.useCallback((e=>{o((t=>({...t,currentId:e})))}),[]);return u.createElement(X.Provider,{value:u.useMemo((()=>({...r,setState:o,setCurrentId:c})),[r,o,c])},t)},e.FloatingFocusManager=function(e){let{context:{refs:t,nodeId:n,onOpenChange:r,dataRef:o,events:c},children:i,order:l=["content"],endGuard:s=!0,initialFocus:a=0,returnFocus:f=!0,modal:d=!0}=e;const v=W(l),m=p(),g=u.useCallback((()=>v.current.map((e=>{return"reference"===e?t.domReference.current:t.floating.current&&"floating"===e?t.floating.current:"content"===e?Array.from(null!=(n=null==(r=t.floating.current)?void 0:r.querySelectorAll("select:not([disabled]),a[href],button:not([disabled]),[tabindex],iframe,object,embed,area[href],audio[controls],video[controls],input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"))?n:[]):null;var n,r})).flat().filter((e=>{if(e===t.floating.current||e===t.domReference.current)return!0;if(w(e)){var n;return"-"!==(null!=(n=e.getAttribute("tabindex"))?n:"0")[0].trim()}}))),[v,t]);u.useEffect((()=>{if(!d)return;const e=0===g().filter((e=>e!==t.floating.current&&e!==t.domReference.current)).length;function n(n){if("Tab"===n.key){e&&N(n);const r=g(),o=j(n);"reference"===v.current[0]&&o===t.domReference.current&&(N(n),n.shiftKey?_(r[r.length-1]):_(r[1])),"floating"===v.current[1]&&o===t.floating.current&&n.shiftKey&&(N(n),_(r[0]))}}const r=h(t.floating.current);return r.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",n)}}),[d,g,v,t]),u.useEffect((()=>{let e=!1;function o(o){var u,c;const i=o.relatedTarget,l=!(null!=(u=t.floating.current)&&u.contains(i)),s=y(t.domReference.current)&&!t.domReference.current.contains(i),a=m&&I(m.nodesRef.current,n).length>0,f=m&&o.currentTarget===t.domReference.current&&(null==(c=function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(m.nodesRef.current,n))?void 0:c.some((e=>{var t,n;return null==(t=e.context)||null==(n=t.refs.floating.current)?void 0:n.contains(i)})));!l||!s||a||f||e||r(!1)}function u(){e=!0,setTimeout((()=>{e=!1}))}const c=t.floating.current,i=t.domReference.current;if(c&&w(i)){let e;return d||(c.addEventListener("focusout",o),i.addEventListener("focusout",o),i.addEventListener("pointerdown",u)),d&&(e=v.current.includes("reference")?F([i,c]):F(c)),()=>{d||(c.removeEventListener("focusout",o),i.removeEventListener("focusout",o),i.removeEventListener("pointerdown",u)),null==e||e()}}}),[n,m,d,r,v,o,g,t]),u.useEffect((()=>{const e=t.floating.current,n=h(e);let r=f,o=!1,u=S(n);if(u===n.body&&t.domReference.current&&(u=t.domReference.current),"number"==typeof a){var i;const t=null!=(i=g()[a])?i:e;_(t,t===e)}else if(w(a.current)){var l;const t=null!=(l=a.current)?l:e;_(t,t===e)}function s(e){void 0===e&&(e=!1),"object"==typeof e?(r=!0,o=e.preventScroll):r=e}return c.on("dismiss",s),()=>{c.off("dismiss",s),r&&w(u)&&_(u,o)}}),[g,a,f,t,c]);const b=()=>{var e;return"combobox"===(null==(e=t.domReference.current)?void 0:e.getAttribute("role"))&&K(t.domReference.current)};return u.createElement(u.Fragment,null,d&&u.createElement(q,{onFocus:e=>{if(b())return;N(e);const t=g();"reference"===l[0]?_(t[0]):_(t[t.length-1])}}),u.cloneElement(i,l.includes("floating")?{tabIndex:0}:{}),d&&s&&u.createElement(q,{onFocus:e=>{b()||(N(e),_(g()[0]))}}))},e.FloatingNode=e=>{let{children:t,id:n}=e;const r=g();return u.createElement(v.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=M,e.FloatingPortal=e=>{let{children:t,id:n=k,root:o=null}=e;const u=T({id:n,enabled:!o});return o?r.createPortal(t,o):u?r.createPortal(t,u):null},e.FloatingTree=e=>{let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),c=u.useState((()=>i()))[0];return u.createElement(m.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:c})),[n,r,o,c])},t)},e.inner=e=>({name:"inner",options:e,async fn(n){const{listRef:o,overflowRef:u,onFallbackChange:c,offset:i=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,...f}=e,{rects:d,elements:{floating:v}}=n,m=o.current[l];if(!m)return{};const g={...n,...await t.offset(-m.offsetTop-d.reference.height/2-m.offsetHeight/2-i).fn(n)},p=await t.detectOverflow(U(g,"scrollHeight"),f),h=await t.detectOverflow(g,{...f,elementContext:"reference"}),b=Math.max(0,p.top),y=g.y+b,w=Math.max(0,v.scrollHeight-b-Math.max(0,p.bottom));return v.style.maxHeight=w+"px",v.scrollTop=b,c&&(v.offsetHeight<m.offsetHeight*Math.min(s,o.current.length-1)-1||h.top>=-a||h.bottom>=-a?r.flushSync((()=>c(!0))):r.flushSync((()=>c(!1)))),u&&(u.current=await t.detectOverflow(U({...g,y:y},"offsetHeight"),f)),{y:y}}}),e.safePolygon=function(e){let t,{restMs:n=0,buffer:r=.5,blockPointerEvents:o=!0,debug:u=null}=void 0===e?{}:e,c=!1;const i=e=>{let{x:o,y:u,placement:i,refs:l,onClose:s,nodeId:a,tree:f,leave:d=!1}=e;return function(e){var v,m;function g(){clearTimeout(t),s()}if(clearTimeout(t),e.pointerType&&"mouse"!==e.pointerType)return;const{clientX:p,clientY:h}=e,b="composedPath"in e?e.composedPath()[0]:e.target;if("pointermove"===e.type&&null!=(v=l.domReference.current)&&v.contains(b))return;if(f&&I(f.nodesRef.current,a).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if(null!=(m=l.floating.current)&&m.contains(b)&&!d)return void(c=!0);if(!l.domReference.current||!l.floating.current||null==i||null==o||null==u)return;const y=l.domReference.current.getBoundingClientRect(),w=l.floating.current.getBoundingClientRect(),E=i.split("-")[0],R=o>w.right-w.width/2,x=u>w.bottom-w.height/2;if("top"===E&&u>=y.bottom-1||"bottom"===E&&u<=y.top+1||"left"===E&&o>=y.right-1||"right"===E&&o<=y.left+1)return g();switch(E){case"top":if(p>=w.left&&p<=w.right&&h>=w.top&&h<=y.top+1)return;break;case"bottom":if(p>=w.left&&p<=w.right&&h>=y.bottom-1&&h<=w.bottom)return;break;case"left":if(p>=w.left&&p<=y.left+1&&h>=w.top&&h<=w.bottom)return;break;case"right":if(p>=y.right-1&&p<=w.right&&h>=w.top&&h<=w.bottom)return}if(c)return g();const k=function(e){let[t,n]=e;const o=w.width>y.width,u=w.height>y.height;switch(E){case"top":return[[o?t+r/2:R?t+4*r:t-4*r,n+r+1],[o?t-r/2:R?t+4*r:t-4*r,n+r+1],...[[w.left,R||o?w.bottom-r:w.top],[w.right,R?o?w.bottom-r:w.top:w.bottom-r]]];case"bottom":return[[o?t+r/2:R?t+4*r:t-4*r,n-r],[o?t-r/2:R?t+4*r:t-4*r,n-r],...[[w.left,R||o?w.top+r:w.bottom],[w.right,R?o?w.top+r:w.bottom:w.top+r]]];case"left":{const e=[t+r+1,u?n+r/2:x?n+4*r:n-4*r],o=[t+r+1,u?n-r/2:x?n+4*r:n-4*r];return[...[[x||u?w.right-r:w.left,w.top],[x?u?w.right-r:w.left:w.right-r,w.bottom]],e,o]}case"right":return[[t-r,u?n+r/2:x?n+4*r:n-4*r],[t-r,u?n-r/2:x?n+4*r:n-4*r],...[[x||u?w.left+r:w.right,w.top],[x?u?w.left+r:w.right:w.left+r,w.bottom]]]}}([o,u]);!function(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,c=u-1;e<u;c=e++){const[u,i]=t[e]||[0,0],[l,s]=t[c]||[0,0];i>=r!=s>=r&&n<=(l-u)*(r-i)/(s-i)+u&&(o=!o)}return o}([p,h],k)?g():n&&(t=setTimeout(s,n))}};return i.__options={blockPointerEvents:o},i},e.useClick=function(e,t){let{open:n,onOpenChange:r,dataRef:o,refs:c}=e,{enabled:i=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=void 0===t?{}:t;const d=u.useRef();function v(){return K(c.domReference.current)}return i?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&("mouse"===d.current&&a||"click"!==l&&(n?!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||r(!1):r(!0),o.current.openEvent=e.nativeEvent))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:"mouse"===d.current&&a||(n?!s||o.current.openEvent&&"click"!==o.current.openEvent.type||r(!1):r(!0),o.current.openEvent=e.nativeEvent)},onKeyDown(e){d.current=void 0,f&&(G(e)||(" "!==e.key||v()||e.preventDefault(),"Enter"===e.key&&(n?s&&r(!1):r(!0))))},onKeyUp(e){f&&(G(e)||v()||" "===e.key&&(n?s&&r(!1):r(!0)))}}}:{}},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:c,initialDelay:i,setState:l}=Y();u.useEffect((()=>{c&&(l((e=>({...e,delay:{open:1,close:B(i,"close")}}))),c!==o&&r(!1))}),[o,r,l,c,i]),u.useEffect((()=>{n||c!==o||(r(!1),l((e=>({...e,delay:i,currentId:null}))))}),[n,l,c,o,r,i])},e.useDelayGroupContext=Y,e.useDismiss=function(e,n){let{open:r,onOpenChange:o,refs:c,events:i,nodeId:l}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:v=!1,referencePressEvent:m="pointerdown",ancestorScroll:b=!1,bubbles:w=!0}=void 0===n?{}:n;const E=p(),R=null!=g(),x=u.useRef(!1);return u.useEffect((()=>{if(!r||!s)return;function e(e){if("Escape"===e.key){if(!w&&E&&I(E.nodesRef.current,l).length>0)return;i.emit("dismiss",{preventScroll:!1}),o(!1)}}function n(e){const t=x.current;if(x.current=!1,t)return;const n=j(e);if(y(n)&&c.floating.current){var r;const t=null!=(r=c.floating.current.ownerDocument.defaultView)?r:window,o=n.scrollWidth>n.clientWidth,u=n.scrollHeight>n.clientHeight;let i=u&&e.offsetX>n.clientWidth;if(u){"rtl"===t.getComputedStyle(n).direction&&(i=e.offsetX<=n.offsetWidth-n.clientWidth)}if(i||o&&e.offsetY>n.clientHeight)return}const u=E&&I(E.nodesRef.current,l).some((t=>{var n;return z(e,null==(n=t.context)?void 0:n.refs.floating.current)}));z(e,c.floating.current)||z(e,c.domReference.current)||u||!w&&E&&I(E.nodesRef.current,l).length>0||(i.emit("dismiss",!!R&&{preventScroll:!0}),o(!1))}function u(){o(!1)}const v=h(c.floating.current);a&&v.addEventListener("keydown",e),f&&v.addEventListener(d,n);const m=(b?[...y(c.reference.current)?t.getOverflowAncestors(c.reference.current):[],...y(c.floating.current)?t.getOverflowAncestors(c.floating.current):[]]:[]).filter((e=>{var t;return e!==(null==(t=v.defaultView)?void 0:t.visualViewport)}));return m.forEach((e=>e.addEventListener("scroll",u,{passive:!0}))),()=>{a&&v.removeEventListener("keydown",e),f&&v.removeEventListener(d,n),m.forEach((e=>e.removeEventListener("scroll",u)))}}),[a,f,d,i,E,l,r,o,b,s,w,c,R]),s?{reference:{[J[m]]:()=>{v&&(i.emit("dismiss"),o(!1))}},floating:{[Q[d]]:()=>{x.current=!0}}}:{}},e.useFloating=function(e){let{open:n=!1,onOpenChange:r,whileElementsMounted:o,placement:l,middleware:s,strategy:a,nodeId:f}=void 0===e?{}:e;const[d,v]=u.useState(null),m=p(),g=u.useRef(null),h=u.useRef({}),b=u.useState((()=>i()))[0],w=t.useFloating({placement:l,middleware:s,strategy:a,whileElementsMounted:o}),E=R(r),x=u.useMemo((()=>({...w.refs,domReference:g})),[w.refs]),I=u.useMemo((()=>({...w,refs:x,dataRef:h,nodeId:f,events:b,open:n,onOpenChange:E,_:{domReference:d}})),[w,f,b,n,E,x,d]);c((()=>{const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===f));e&&(e.context=I)}));const{reference:k}=w,T=u.useCallback((e=>{(y(e)||null===e)&&(I.refs.domReference.current=e,v(e)),k(e)}),[k,I.refs]);return u.useMemo((()=>({...w,context:I,refs:x,reference:T})),[w,x,I,T])},e.useFloatingNodeId=()=>{const e=d(),t=p(),n=g();return c((()=>{const r={id:e,parentId:n};return null==t||t.addNode(r),()=>{null==t||t.removeNode(r)}}),[t,e,n]),e},e.useFloatingParentNodeId=g,e.useFloatingPortalNode=T,e.useFloatingTree=p,e.useFocus=function(e,t){let{open:n,onOpenChange:r,dataRef:o,refs:c,events:i}=e,{enabled:l=!0,keyboardOnly:s=!0}=void 0===t?{}:t;const a=u.useRef(""),f=u.useRef(!1),d=u.useRef();return u.useEffect((()=>{var e;if(!l)return;const t=null!=(e=h(c.floating.current).defaultView)?e:window;function r(){!n&&w(c.domReference.current)&&c.domReference.current.blur()}return t.addEventListener("blur",r),()=>{t.removeEventListener("blur",r)}}),[c,n,l]),u.useEffect((()=>{if(l)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){f.current=!0}}),[i,l]),u.useEffect((()=>()=>{clearTimeout(d.current)}),[]),l?{reference:{onPointerDown(e){let{pointerType:t}=e;a.current=t,f.current=!(!t||!s)},onPointerLeave(){f.current=!1},onFocus(e){var t,n,u;f.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&null!=(n=c.domReference.current)&&n.contains(null==(u=o.current.openEvent)?void 0:u.target)||(o.current.openEvent=e.nativeEvent,r(!0))},onBlur(e){const t=e.relatedTarget;d.current=setTimeout((()=>{var e,n;null!=(e=c.floating.current)&&e.contains(t)||null!=(n=c.domReference.current)&&n.contains(t)||(f.current=!1,r(!1))}))}}}:{}},e.useHover=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:l=0,move:s=!0}=void 0===t?{}:t;const{open:a,onOpenChange:f,dataRef:d,events:v,refs:m,_:b}=e,w=p(),E=g(),R=W(o),x=W(r),I=V(a),k=u.useRef(),T=u.useRef(),O=u.useRef(),C=u.useRef(),M=u.useRef(!0),L=u.useRef(!1),P=u.useCallback((()=>{var e;const t=null==(e=d.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[d]);u.useEffect((()=>{if(n)return v.on("dismiss",e),()=>{v.off("dismiss",e)};function e(){clearTimeout(T.current),clearTimeout(C.current),M.current=!0}}),[n,v,m]),u.useEffect((()=>{if(!n||!R.current)return;function e(){P()&&f(!1)}const t=h(m.floating.current).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[m,f,n,R,d,P]);const A=u.useCallback((function(e){void 0===e&&(e=!0);const t=B(x.current,"close",k.current);t&&!O.current?(clearTimeout(T.current),T.current=setTimeout((()=>f(!1)),t)):e&&(clearTimeout(T.current),f(!1))}),[x,f]),D=u.useCallback((()=>{O.current&&(h(m.floating.current).removeEventListener("pointermove",O.current),O.current=void 0)}),[m]),F=u.useCallback((()=>{h(m.floating.current).body.style.pointerEvents="",L.current=!1}),[m]);if(u.useEffect((()=>{if(!n)return;function t(){return!!d.current.openEvent&&["click","mousedown"].includes(d.current.openEvent.type)}function r(e){if(clearTimeout(T.current),M.current=!1,i&&"mouse"!==k.current||l>0&&0===B(x.current,"open"))return;d.current.openEvent=e;const t=B(x.current,"open",k.current);t?T.current=setTimeout((()=>{f(!0)}),t):f(!0)}function o(n){if(t())return;const r=h(m.floating.current);if(clearTimeout(C.current),R.current)return clearTimeout(T.current),O.current&&r.removeEventListener("pointermove",O.current),O.current=R.current({...e,tree:w,x:n.clientX,y:n.clientY,onClose(){F(),D(),A()}}),void r.addEventListener("pointermove",O.current);A()}function u(n){t()||null==R.current||R.current({...e,tree:w,x:n.clientX,y:n.clientY,leave:!0,onClose(){F(),D(),A()}})(n)}const c=m.floating.current,v=m.domReference.current;return y(v)?(a&&v.addEventListener("mouseleave",u),null==c||c.addEventListener("mouseleave",u),s&&v.addEventListener("mousemove",r,{once:!0}),v.addEventListener("mouseenter",r),v.addEventListener("mouseleave",o),()=>{a&&v.removeEventListener("mouseleave",u),null==c||c.removeEventListener("mouseleave",u),s&&v.removeEventListener("mousemove",r),v.removeEventListener("mouseenter",r),v.removeEventListener("mouseleave",o)}):void 0}),[b.domReference,n,e,i,l,s,A,D,F,f,a,w,m,x,R,d]),c((()=>{if(n&&a&&R.current&&R.current.__options.blockPointerEvents&&P()){h(m.floating.current).body.style.pointerEvents="none",L.current=!0;const n=m.domReference.current,r=m.floating.current;if(y(n)&&r){var e,t;const o=null==w||null==(e=w.nodesRef.current.find((e=>e.id===E)))||null==(t=e.context)?void 0:t.refs.floating.current;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="auto",r.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents=""}}}}),[n,a,E,m,w,R,d,P]),c((()=>{I&&!a&&(k.current=void 0,D(),F())})),u.useEffect((()=>()=>{D(),clearTimeout(T.current),clearTimeout(C.current),L.current&&F()}),[n,D,F]),!n)return{};function S(e){k.current=e.pointerType}return{reference:{onPointerDown:S,onPointerEnter:S,onMouseMove(){a||0===l||(clearTimeout(C.current),C.current=setTimeout((()=>{M.current||f(!0)}),l))}},floating:{onMouseEnter(){clearTimeout(T.current)},onMouseLeave(){A(!1)}}}},e.useId=d,e.useInnerOffset=(e,t)=>{let{open:n,refs:o}=e,{enabled:c=!0,overflowRef:i,onChange:l}=t;const s=W(l),a=u.useRef(!1),f=u.useRef(null),d=u.useRef(null);return u.useEffect((()=>{if(!c)return;function e(e){if(e.ctrlKey||!t||null==i.current)return;const n=e.deltaY,o=i.current.top>=-.5,u=i.current.bottom>=-.5,c=t.scrollHeight-t.clientHeight,l=n<0?-1:1,a=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{s.current((e=>e+Math[a](n,c*l)))}))):/firefox/i.test(function(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}())&&(t.scrollTop+=n))}const t=o.floating.current;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=i.current&&(d.current={...i.current})})),()=>{f.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0}),[c,n,o,i,s]),c?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=o.floating.current;if(i.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(i.current.bottom<-.5&&t<-1||i.current.top<-.5&&t>1)&&r.flushSync((()=>l((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}},e.useInteractions=function(e){return void 0===e&&(e=[]),{getReferenceProps:t=>x(t,e,"reference"),getFloatingProps:t=>x(t,e,"floating"),getItemProps:t=>x(t,e,"item")}},e.useListNavigation=function(e,t){let{open:n,onOpenChange:r,refs:o}=e,{listRef:i,activeIndex:l,onNavigate:s=(()=>{}),enabled:a=!0,selectedIndex:f=null,allowEscape:d=!1,loop:v=!1,nested:m=!1,rtl:b=!1,virtual:y=!1,focusItemOnOpen:E="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:I=!0,disabledIndices:k,orientation:T="vertical",cols:O=1}=void 0===t?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;const C=g(),M=p(),L=V(n),P=R(s),A=R(V(s)),D=u.useRef(E),F=u.useRef(null!=f?f:-1),j=u.useRef(null),H=W(k),K=u.useRef(!1),_=u.useRef(-1),[q,B]=u.useState(),X=u.useCallback(((e,t)=>{_.current=requestAnimationFrame((()=>{var n,r;y?B(null==(n=e.current[t.current])?void 0:n.id):null==(r=e.current[t.current])||r.focus({preventScroll:!0})}))}),[y]);function Y(e){if(K.current=!0,m&&function(e,t,n){return ue(t,n?e===te:e===ee,e===Z)}(e.key,T,b))return N(e),r(!1),void(w(o.domReference.current)&&o.domReference.current.focus());const t=F.current,u=le(i,k),c=se(i,k);if("Home"===e.key&&(F.current=u,P(F.current)),"End"===e.key&&(F.current=c,P(F.current)),O>1){const t=F.current;if(e.key===Z){if(N(e),-1===t)F.current=c;else if(F.current=oe(i,{startingIndex:t,amount:O,decrement:!0,disabledIndices:k}),v&&(t-O<u||F.current<0)){const e=t%O,n=c%O,r=c-(n-e);F.current=n===e?c:n>e?r:r-O}re(i,F.current)&&(F.current=t),P(F.current)}if(e.key===$&&(N(e),-1===t?F.current=u:(F.current=oe(i,{startingIndex:t,amount:O,disabledIndices:k}),v&&t+O>c&&(F.current=oe(i,{startingIndex:t%O-O,amount:O,disabledIndices:k}))),re(i,F.current)&&(F.current=t),P(F.current)),"both"===T){const n=Math.floor(t/O);e.key===te&&(N(e),t%O!=O-1?(F.current=oe(i,{startingIndex:t,disabledIndices:k}),v&&ne(F.current,O,n)&&(F.current=oe(i,{startingIndex:t-t%O-1,disabledIndices:k}))):v&&(F.current=oe(i,{startingIndex:t-t%O-1,disabledIndices:k})),ne(F.current,O,n)&&(F.current=t)),e.key===ee&&(N(e),t%O!=0?(F.current=oe(i,{startingIndex:t,disabledIndices:k,decrement:!0}),v&&ne(F.current,O,n)&&(F.current=oe(i,{startingIndex:t+(O-t%O),decrement:!0,disabledIndices:k}))):v&&(F.current=oe(i,{startingIndex:t+(O-t%O),decrement:!0,disabledIndices:k})),ne(F.current,O,n)&&(F.current=t));const r=Math.floor(c/O)===n;return re(i,F.current)&&(F.current=v&&r?e.key===ee?c:oe(i,{startingIndex:t-t%O-1,disabledIndices:k}):t),void P(F.current)}}if(ce(e.key,T)){if(N(e),n&&!y&&S(e.currentTarget.ownerDocument)===e.currentTarget)return F.current=ie(e.key,T,b)?u:c,void P(F.current);ie(e.key,T,b)?F.current=v?t>=c?d&&t!==i.current.length?-1:u:oe(i,{startingIndex:t,disabledIndices:k}):Math.min(c,oe(i,{startingIndex:t,disabledIndices:k})):F.current=v?t<=u?d&&-1!==t?i.current.length:c:oe(i,{startingIndex:t,decrement:!0,disabledIndices:k}):Math.max(u,oe(i,{startingIndex:t,decrement:!0,disabledIndices:k})),re(i,F.current)?P(null):P(F.current)}}return c((()=>{a&&(!L&&n&&D.current&&null!=f&&P(f),L&&!n&&(cancelAnimationFrame(_.current),F.current=-1,A(null)))}),[n,L,f,i,X,a,P,A]),c((()=>{if(a&&n)if(null==l){if(null!=f)return;L&&(F.current=-1,X(i,F)),!L&&D.current&&(null!=j.current||!0===D.current&&null==j.current)&&(F.current=null==j.current||ie(j.current,T,b)||m?le(i,H.current):se(i,H.current),P(F.current),X(i,F))}else re(i,l)||(F.current=l,X(i,F))}),[n,L,l,f,m,i,P,X,a,d,T,b,y,H]),c((()=>{if(a&&!n&&L){var e,t;const n=null==M||null==(e=M.nodesRef.current.find((e=>e.id===C)))||null==(t=e.context)?void 0:t.refs.floating.current;n&&!n.contains(S(h(n)))&&n.focus({preventScroll:!0})}}),[a,n,L,M,C]),c((()=>{j.current=null})),a?{reference:{...y&&n&&null!=l&&{"aria-activedescendant":q},onKeyDown(e){if(K.current=!0,y&&n)return Y(e);(0===e.key.indexOf("Arrow")||"Enter"===e.key||" "===e.key||""===e.key)&&(j.current=e.key),m?function(e,t,n){return ue(t,n?e===ee:e===te,e===$)}(e.key,T,b)&&(N(e),n?(F.current=le(i,k),P(F.current)):r(!0)):ce(e.key,T)&&(null!=f&&(F.current=f),N(e),!n&&I?r(!0):Y(e),n&&P(F.current))}},floating:{"aria-orientation":"both"===T?void 0:T,...y&&null!=l&&{"aria-activedescendant":q},onKeyDown:Y,onPointerMove(){K.current=!1}},item:{onFocus(e){let{currentTarget:t}=e;const n=i.current.indexOf(t);-1!==n&&P(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...x&&{onMouseMove(e){let{currentTarget:t}=e;const n=t;if(n){const e=i.current.indexOf(n);-1!==e&&P(e)}},onPointerLeave(){K.current||(F.current=-1,X(i,F),P(null),y||requestAnimationFrame((()=>{var e;null==(e=o.floating.current)||e.focus({preventScroll:!0})})))}}}}:{}},e.useRole=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=void 0===t?{}:t;const u=d(),c=d(),i={id:u,role:o};return r?"tooltip"===o?{reference:{"aria-describedby":n?u:void 0},floating:i}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":n?u:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:c}},floating:{...i,..."menu"===o&&{"aria-labelledby":c}}}:{}},e.useTypeahead=function(e,t){var n;let{open:r,dataRef:o}=e,{listRef:i,activeIndex:l,onMatch:s=(()=>{}),enabled:a=!0,findMatch:f=null,resetMs:d=1e3,ignoreKeys:v=[],selectedIndex:m=null}=void 0===t?{listRef:{current:[]},activeIndex:null}:t;const g=u.useRef(),p=u.useRef(""),b=u.useRef(null!=(n=null!=m?m:l)?n:-1),w=u.useRef(null);function E(e){const t=j(e.nativeEvent);if(y(t)&&S(h(t))!==e.currentTarget&&t.closest('[role="dialog"],[role="menu"],[role="listbox"],[role="tree"],[role="grid"]')!==e.currentTarget)return;p.current.length>0&&" "!==p.current[0]&&(o.current.typing=!0," "===e.key&&N(e));const n=i.current;if(null==n||v.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&p.current===e.key&&(p.current="",b.current=w.current),p.current+=e.key,clearTimeout(g.current),g.current=setTimeout((()=>{p.current="",b.current=w.current,o.current.typing=!1}),d);const r=b.current,u=[...n.slice((null!=r?r:0)+1),...n.slice(0,(null!=r?r:0)+1)],c=f?f(u,p.current):u.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(p.current.toLocaleLowerCase())))),l=c?n.indexOf(c):-1;-1!==l&&(s(l),w.current=l)}return c((()=>{r&&(clearTimeout(g.current),w.current=null,p.current="")}),[r]),c((()=>{var e;r&&""===p.current&&(b.current=null!=(e=null!=m?m:l)?e:-1)}),[r,m,l]),a?{reference:{onKeyDown:E},floating:{onKeyDown:E}}:{}},Object.keys(t).forEach((function(n){"default"===n||e.hasOwnProperty(n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/react-dom"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/react-dom","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReactDOM={},e.FloatingUIReactDOM,e.React,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(n),c="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function i(){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){e.set(t,(e.get(t)||[]).filter((e=>e!==n)))}}}let l=!1,s=0;const a=()=>"floating-ui-"+s++;const f=u["useId".toString()],d=null!=f?f:function(){const[e,t]=u.useState((()=>l?a():void 0));return c((()=>{null==e&&t(a())}),[]),u.useEffect((()=>{l||(l=!0)}),[]),e},v=u.createContext(null),m=u.createContext(null),g=()=>{var e,t;return null!=(e=null==(t=u.useContext(v))?void 0:t.id)?e:null},p=()=>u.useContext(m);function h(e){var t;return null!=(t=null==e?void 0:e.ownerDocument)?t:document}function b(e){var t;return null!=(t=h(e).defaultView)?t:window}function y(e){return!!e&&e instanceof b(e).Element}function w(e){return!!e&&e instanceof b(e).HTMLElement}const E=u["useInsertionEffect".toString()];function R(e){const t=u.useRef((()=>{}));return E?E((()=>{t.current=e})):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 x(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];null==(e=r.get(n))||e.forEach((e=>e(...o)))})):e[n]=o})),e):e),{})}}function I(e,t){var n;let r=null!=(n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})))?n:[],o=r;for(;o.length;){var u;o=null!=(u=e.filter((e=>{var t;return null==(t=o)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})))?u:[],r=r.concat(o)}return r}const k="floating-ui-root",T=function(e){let{id:t=k,enabled:n=!0}=void 0===e?{}:e;const[r,o]=u.useState(null);return c((()=>{if(!n)return;const e=document.getElementById(t);if(e)o(e);else{const e=document.createElement("div");e.id=t,o(e),document.body.contains(e)||document.body.appendChild(e)}}),[t,n]),r};function O(){return O=Object.assign||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},O.apply(this,arguments)}const C="data-floating-ui-scroll-lock",M=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return c((()=>{var e,t,r,o;if(!n)return;if(document.body.hasAttribute(C))return;document.body.setAttribute(C,"");const u=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",c=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()))return Object.assign(document.body.style,{overflow:"hidden",[u]:c+"px"}),()=>{document.body.removeAttribute(C),Object.assign(document.body.style,{overflow:"",[u]:""})};const i=null!=(e=null==(t=window.visualViewport)?void 0:t.offsetLeft)?e:0,l=null!=(r=null==(o=window.visualViewport)?void 0:o.offsetTop)?r:0,s=window.pageXOffset,a=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(a-Math.floor(l))+"px",left:-(s-Math.floor(i))+"px",right:"0",[u]:c+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[u]:""}),document.body.removeAttribute(C),window.scrollTo(s,a)}}),[n]),u.createElement("div",O({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));var L=new WeakMap,P=new WeakMap,A={},D=0,F=function(e,t,n){void 0===t&&(t=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e)),void 0===n&&(n="data-aria-hidden");var r=Array.isArray(e)?e:[e];A[n]||(A[n]=new WeakMap);var o=A[n],u=[],c=new Set,i=function(e){e&&!c.has(e)&&(c.add(e),i(e.parentNode))};r.forEach(i);var l=function(e){!e||r.indexOf(e)>=0||Array.prototype.forEach.call(e.children,(function(e){if(c.has(e))l(e);else{var t=e.getAttribute("aria-hidden"),r=null!==t&&"false"!==t,i=(L.get(e)||0)+1,s=(o.get(e)||0)+1;L.set(e,i),o.set(e,s),u.push(e),1===i&&r&&P.set(e,!0),1===s&&e.setAttribute(n,"true"),r||e.setAttribute("aria-hidden","true")}}))};return l(t),c.clear(),D++,function(){u.forEach((function(e){var t=L.get(e)-1,r=o.get(e)-1;L.set(e,t),o.set(e,r),t||(P.has(e)||e.removeAttribute("aria-hidden"),P.delete(e)),r||e.removeAttribute(n)})),--D||(L=new WeakMap,L=new WeakMap,P=new WeakMap,A={})}};function S(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}function j(e){return"composedPath"in e?e.composedPath()[0]:e.target}const H="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function K(e){return w(e)&&e.matches(H)}function N(e){e.preventDefault(),e.stopPropagation()}function W(e){const t=n.useRef(e);return c((()=>{t.current=e})),t}function _(e,t){void 0===t&&(t=!1),requestAnimationFrame((()=>{null==e||e.focus({preventScroll:t})}))}const q=u.forwardRef((function(e,t){return u.createElement("span",O({},e,{ref:t,tabIndex:0,style:{position:"fixed",opacity:"0",pointerEvents:"none",outline:"0"}}))}));function V(e){const t=n.useRef();return c((()=>{t.current=e}),[e]),t.current}function B(e,t,n){return n&&"mouse"!==n?0:"number"==typeof e?e:null==e?void 0:e[t]}const X=u.createContext({delay:1e3,initialDelay:1e3,currentId:null,setCurrentId:()=>{},setState:()=>{}}),Y=()=>u.useContext(X);function U(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:e.elements.floating[t]}}}}function G(e){return w(e.target)&&"BUTTON"===e.target.tagName}function z(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)}const J={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Q={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Z="ArrowUp",$="ArrowDown",ee="ArrowLeft",te="ArrowRight";function ne(e,t,n){return Math.floor(e/t)!==n}function re(e,t){return t<0||t>=e.current.length}function oe(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const c=e.current;let i=n;do{var l,s;i+=r?-u:u}while(i>=0&&i<=c.length-1&&(o?o.includes(i):null==c[i]||(null==(l=c[i])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=c[i])?void 0:s.getAttribute("aria-disabled"))));return i}function ue(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ce(e,t){return ue(t,e===Z||e===$,e===ee||e===te)}function ie(e,t,n){return ue(t,e===$,n?e===ee:e===te)||"Enter"===e||" "==e||""===e}function le(e,t){return oe(e,{disabledIndices:t})}function se(e,t){return oe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}e.FloatingDelayGroup=e=>{let{children:t,delay:n}=e;const[r,o]=u.useState({delay:n,initialDelay:n,currentId:null}),c=u.useCallback((e=>{o((t=>({...t,currentId:e})))}),[]);return u.createElement(X.Provider,{value:u.useMemo((()=>({...r,setState:o,setCurrentId:c})),[r,o,c])},t)},e.FloatingFocusManager=function(e){let{context:{refs:t,nodeId:n,onOpenChange:r,dataRef:o,events:c},children:i,order:l=["content"],endGuard:s=!0,initialFocus:a=0,returnFocus:f=!0,modal:d=!0}=e;const v=W(l),m=p(),g=u.useCallback((()=>v.current.map((e=>{return"reference"===e?t.domReference.current:t.floating.current&&"floating"===e?t.floating.current:"content"===e?Array.from(null!=(n=null==(r=t.floating.current)?void 0:r.querySelectorAll("select:not([disabled]),a[href],button:not([disabled]),[tabindex],iframe,object,embed,area[href],audio[controls],video[controls],input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"))?n:[]):null;var n,r})).flat().filter((e=>{if(e===t.floating.current||e===t.domReference.current)return!0;if(w(e)){var n;return"-"!==(null!=(n=e.getAttribute("tabindex"))?n:"0")[0].trim()}}))),[v,t]);u.useEffect((()=>{if(!d)return;const e=0===g().filter((e=>e!==t.floating.current&&e!==t.domReference.current)).length;function n(n){if("Tab"===n.key){e&&N(n);const r=g(),o=j(n);"reference"===v.current[0]&&o===t.domReference.current&&(N(n),n.shiftKey?_(r[r.length-1]):_(r[1])),"floating"===v.current[1]&&o===t.floating.current&&n.shiftKey&&(N(n),_(r[0]))}}const r=h(t.floating.current);return r.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",n)}}),[d,g,v,t]),u.useEffect((()=>{let e=!1;function o(o){var u,c;const i=o.relatedTarget,l=!(null!=(u=t.floating.current)&&u.contains(i)),s=y(t.domReference.current)&&!t.domReference.current.contains(i),a=m&&I(m.nodesRef.current,n).length>0,f=m&&o.currentTarget===t.domReference.current&&(null==(c=function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(m.nodesRef.current,n))?void 0:c.some((e=>{var t,n;return null==(t=e.context)||null==(n=t.refs.floating.current)?void 0:n.contains(i)})));!l||!s||a||f||e||r(!1)}function u(){e=!0,setTimeout((()=>{e=!1}))}const c=t.floating.current,i=t.domReference.current;if(c&&w(i)){let e;return d||(c.addEventListener("focusout",o),i.addEventListener("focusout",o),i.addEventListener("pointerdown",u)),d&&(e=v.current.includes("reference")?F([i,c]):F(c)),()=>{d||(c.removeEventListener("focusout",o),i.removeEventListener("focusout",o),i.removeEventListener("pointerdown",u)),null==e||e()}}}),[n,m,d,r,v,o,g,t]),u.useEffect((()=>{const e=t.floating.current,n=h(e);let r=f,o=!1,u=S(n);if(u===n.body&&t.domReference.current&&(u=t.domReference.current),"number"==typeof a){var i;const t=null!=(i=g()[a])?i:e;_(t,t===e)}else if(w(a.current)){var l;const t=null!=(l=a.current)?l:e;_(t,t===e)}function s(e){void 0===e&&(e=!1),"object"==typeof e?(r=!0,o=e.preventScroll):r=e}return c.on("dismiss",s),()=>{c.off("dismiss",s),r&&w(u)&&_(u,o)}}),[g,a,f,t,c]);const b=()=>{var e;return"combobox"===(null==(e=t.domReference.current)?void 0:e.getAttribute("role"))&&K(t.domReference.current)};return u.createElement(u.Fragment,null,d&&u.createElement(q,{onFocus:e=>{if(b())return;N(e);const t=g();"reference"===l[0]?_(t[0]):_(t[t.length-1])}}),u.cloneElement(i,l.includes("floating")?{tabIndex:0}:{}),d&&s&&u.createElement(q,{onFocus:e=>{b()||(N(e),_(g()[0]))}}))},e.FloatingNode=e=>{let{children:t,id:n}=e;const r=g();return u.createElement(v.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=M,e.FloatingPortal=e=>{let{children:t,id:n=k,root:o=null}=e;const u=T({id:n,enabled:!o});return o?r.createPortal(t,o):u?r.createPortal(t,u):null},e.FloatingTree=e=>{let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),c=u.useState((()=>i()))[0];return u.createElement(m.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:c})),[n,r,o,c])},t)},e.inner=e=>({name:"inner",options:e,async fn(n){const{listRef:o,overflowRef:u,onFallbackChange:c,offset:i=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,...f}=e,{rects:d,elements:{floating:v}}=n,m=o.current[l];if(!m)return{};const g={...n,...await t.offset(-m.offsetTop-d.reference.height/2-m.offsetHeight/2-i).fn(n)},p=await t.detectOverflow(U(g,"scrollHeight"),f),h=await t.detectOverflow(g,{...f,elementContext:"reference"}),b=Math.max(0,p.top),y=g.y+b,w=Math.max(0,v.scrollHeight-b-Math.max(0,p.bottom));return v.style.maxHeight=w+"px",v.scrollTop=b,c&&(v.offsetHeight<m.offsetHeight*Math.min(s,o.current.length-1)-1||h.top>=-a||h.bottom>=-a?r.flushSync((()=>c(!0))):r.flushSync((()=>c(!1)))),u&&(u.current=await t.detectOverflow(U({...g,y:y},"offsetHeight"),f)),{y:y}}}),e.safePolygon=function(e){let t,{restMs:n=0,buffer:r=.5,blockPointerEvents:o=!0,debug:u=null}=void 0===e?{}:e,c=!1;const i=e=>{let{x:o,y:u,placement:i,refs:l,onClose:s,nodeId:a,tree:f,leave:d=!1}=e;return function(e){var v,m,g;function p(){clearTimeout(t),s()}if(clearTimeout(t),e.pointerType&&"mouse"!==e.pointerType)return;const{clientX:h,clientY:b}=e,w="composedPath"in e?e.composedPath()[0]:e.target;if("pointermove"===e.type&&null!=(v=l.domReference.current)&&v.contains(w))return;if("mouseleave"===e.type&&y(e.relatedTarget)&&null!=(m=l.floating.current)&&m.contains(e.relatedTarget))return;if(f&&I(f.nodesRef.current,a).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if(null!=(g=l.floating.current)&&g.contains(w)&&!d)return void(c=!0);if(!l.domReference.current||!l.floating.current||null==i||null==o||null==u)return;const E=l.domReference.current.getBoundingClientRect(),R=l.floating.current.getBoundingClientRect(),x=i.split("-")[0],k=o>R.right-R.width/2,T=u>R.bottom-R.height/2;if("top"===x&&u>=E.bottom-1||"bottom"===x&&u<=E.top+1||"left"===x&&o>=E.right-1||"right"===x&&o<=E.left+1)return p();switch(x){case"top":if(h>=R.left&&h<=R.right&&b>=R.top&&b<=E.top+1)return;break;case"bottom":if(h>=R.left&&h<=R.right&&b>=E.bottom-1&&b<=R.bottom)return;break;case"left":if(h>=R.left&&h<=E.left+1&&b>=R.top&&b<=R.bottom)return;break;case"right":if(h>=E.right-1&&h<=R.right&&b>=R.top&&b<=R.bottom)return}if(c)return p();const O=function(e){let[t,n]=e;const o=R.width>E.width,u=R.height>E.height;switch(x){case"top":return[[o?t+r/2:k?t+4*r:t-4*r,n+r+1],[o?t-r/2:k?t+4*r:t-4*r,n+r+1],...[[R.left,k||o?R.bottom-r:R.top],[R.right,k?o?R.bottom-r:R.top:R.bottom-r]]];case"bottom":return[[o?t+r/2:k?t+4*r:t-4*r,n-r],[o?t-r/2:k?t+4*r:t-4*r,n-r],...[[R.left,k||o?R.top+r:R.bottom],[R.right,k?o?R.top+r:R.bottom:R.top+r]]];case"left":{const e=[t+r+1,u?n+r/2:T?n+4*r:n-4*r],o=[t+r+1,u?n-r/2:T?n+4*r:n-4*r];return[...[[T||u?R.right-r:R.left,R.top],[T?u?R.right-r:R.left:R.right-r,R.bottom]],e,o]}case"right":return[[t-r,u?n+r/2:T?n+4*r:n-4*r],[t-r,u?n-r/2:T?n+4*r:n-4*r],...[[T||u?R.left+r:R.right,R.top],[T?u?R.left+r:R.right:R.left+r,R.bottom]]]}}([o,u]);!function(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,c=u-1;e<u;c=e++){const[u,i]=t[e]||[0,0],[l,s]=t[c]||[0,0];i>=r!=s>=r&&n<=(l-u)*(r-i)/(s-i)+u&&(o=!o)}return o}([h,b],O)?p():n&&(t=setTimeout(s,n))}};return i.__options={blockPointerEvents:o},i},e.useClick=function(e,t){let{open:n,onOpenChange:r,dataRef:o,refs:c}=e,{enabled:i=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=void 0===t?{}:t;const d=u.useRef();function v(){return K(c.domReference.current)}return i?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&("mouse"===d.current&&a||"click"!==l&&(n?!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||r(!1):r(!0),o.current.openEvent=e.nativeEvent))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:"mouse"===d.current&&a||(n?!s||o.current.openEvent&&"click"!==o.current.openEvent.type||r(!1):r(!0),o.current.openEvent=e.nativeEvent)},onKeyDown(e){d.current=void 0,f&&(G(e)||(" "!==e.key||v()||e.preventDefault(),"Enter"===e.key&&(n?s&&r(!1):r(!0))))},onKeyUp(e){f&&(G(e)||v()||" "===e.key&&(n?s&&r(!1):r(!0)))}}}:{}},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:c,initialDelay:i,setState:l}=Y();u.useEffect((()=>{c&&(l((e=>({...e,delay:{open:1,close:B(i,"close")}}))),c!==o&&r(!1))}),[o,r,l,c,i]),u.useEffect((()=>{n||c!==o||(r(!1),l((e=>({...e,delay:i,currentId:null}))))}),[n,l,c,o,r,i])},e.useDelayGroupContext=Y,e.useDismiss=function(e,n){let{open:r,onOpenChange:o,refs:c,events:i,nodeId:l}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:v=!1,referencePressEvent:m="pointerdown",ancestorScroll:b=!1,bubbles:w=!0}=void 0===n?{}:n;const E=p(),R=null!=g(),x=u.useRef(!1);return u.useEffect((()=>{if(!r||!s)return;function e(e){if("Escape"===e.key){if(!w&&E&&I(E.nodesRef.current,l).length>0)return;i.emit("dismiss",{preventScroll:!1}),o(!1)}}function n(e){const t=x.current;if(x.current=!1,t)return;const n=j(e);if(y(n)&&c.floating.current){var r;const t=null!=(r=c.floating.current.ownerDocument.defaultView)?r:window,o=n.scrollWidth>n.clientWidth,u=n.scrollHeight>n.clientHeight;let i=u&&e.offsetX>n.clientWidth;if(u){"rtl"===t.getComputedStyle(n).direction&&(i=e.offsetX<=n.offsetWidth-n.clientWidth)}if(i||o&&e.offsetY>n.clientHeight)return}const u=E&&I(E.nodesRef.current,l).some((t=>{var n;return z(e,null==(n=t.context)?void 0:n.refs.floating.current)}));z(e,c.floating.current)||z(e,c.domReference.current)||u||!w&&E&&I(E.nodesRef.current,l).length>0||(i.emit("dismiss",!!R&&{preventScroll:!0}),o(!1))}function u(){o(!1)}const v=h(c.floating.current);a&&v.addEventListener("keydown",e),f&&v.addEventListener(d,n);const m=(b?[...y(c.reference.current)?t.getOverflowAncestors(c.reference.current):[],...y(c.floating.current)?t.getOverflowAncestors(c.floating.current):[]]:[]).filter((e=>{var t;return e!==(null==(t=v.defaultView)?void 0:t.visualViewport)}));return m.forEach((e=>e.addEventListener("scroll",u,{passive:!0}))),()=>{a&&v.removeEventListener("keydown",e),f&&v.removeEventListener(d,n),m.forEach((e=>e.removeEventListener("scroll",u)))}}),[a,f,d,i,E,l,r,o,b,s,w,c,R]),s?{reference:{[J[m]]:()=>{v&&(i.emit("dismiss"),o(!1))}},floating:{[Q[d]]:()=>{x.current=!0}}}:{}},e.useFloating=function(e){let{open:n=!1,onOpenChange:r,whileElementsMounted:o,placement:l,middleware:s,strategy:a,nodeId:f}=void 0===e?{}:e;const[d,v]=u.useState(null),m=p(),g=u.useRef(null),h=u.useRef({}),b=u.useState((()=>i()))[0],w=t.useFloating({placement:l,middleware:s,strategy:a,whileElementsMounted:o}),E=R(r),x=u.useMemo((()=>({...w.refs,domReference:g})),[w.refs]),I=u.useMemo((()=>({...w,refs:x,dataRef:h,nodeId:f,events:b,open:n,onOpenChange:E,_:{domReference:d}})),[w,f,b,n,E,x,d]);c((()=>{const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===f));e&&(e.context=I)}));const{reference:k}=w,T=u.useCallback((e=>{(y(e)||null===e)&&(I.refs.domReference.current=e,v(e)),k(e)}),[k,I.refs]);return u.useMemo((()=>({...w,context:I,refs:x,reference:T})),[w,x,I,T])},e.useFloatingNodeId=()=>{const e=d(),t=p(),n=g();return c((()=>{const r={id:e,parentId:n};return null==t||t.addNode(r),()=>{null==t||t.removeNode(r)}}),[t,e,n]),e},e.useFloatingParentNodeId=g,e.useFloatingPortalNode=T,e.useFloatingTree=p,e.useFocus=function(e,t){let{open:n,onOpenChange:r,dataRef:o,refs:c,events:i}=e,{enabled:l=!0,keyboardOnly:s=!0}=void 0===t?{}:t;const a=u.useRef(""),f=u.useRef(!1),d=u.useRef();return u.useEffect((()=>{var e;if(!l)return;const t=null!=(e=h(c.floating.current).defaultView)?e:window;function r(){!n&&w(c.domReference.current)&&c.domReference.current.blur()}return t.addEventListener("blur",r),()=>{t.removeEventListener("blur",r)}}),[c,n,l]),u.useEffect((()=>{if(l)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){f.current=!0}}),[i,l]),u.useEffect((()=>()=>{clearTimeout(d.current)}),[]),l?{reference:{onPointerDown(e){let{pointerType:t}=e;a.current=t,f.current=!(!t||!s)},onPointerLeave(){f.current=!1},onFocus(e){var t,n,u;f.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&null!=(n=c.domReference.current)&&n.contains(null==(u=o.current.openEvent)?void 0:u.target)||(o.current.openEvent=e.nativeEvent,r(!0))},onBlur(e){const t=e.relatedTarget;d.current=setTimeout((()=>{var e,n;null!=(e=c.floating.current)&&e.contains(t)||null!=(n=c.domReference.current)&&n.contains(t)||(f.current=!1,r(!1))}))}}}:{}},e.useHover=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:l=0,move:s=!0}=void 0===t?{}:t;const{open:a,onOpenChange:f,dataRef:d,events:v,refs:m,_:b}=e,w=p(),E=g(),R=W(o),x=W(r),I=V(a),k=u.useRef(),T=u.useRef(),O=u.useRef(),C=u.useRef(),M=u.useRef(!0),L=u.useRef(!1),P=u.useCallback((()=>{var e;const t=null==(e=d.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[d]);u.useEffect((()=>{if(n)return v.on("dismiss",e),()=>{v.off("dismiss",e)};function e(){clearTimeout(T.current),clearTimeout(C.current),M.current=!0}}),[n,v,m]),u.useEffect((()=>{if(!n||!R.current)return;function e(){P()&&f(!1)}const t=h(m.floating.current).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[m,f,n,R,d,P]);const A=u.useCallback((function(e){void 0===e&&(e=!0);const t=B(x.current,"close",k.current);t&&!O.current?(clearTimeout(T.current),T.current=setTimeout((()=>f(!1)),t)):e&&(clearTimeout(T.current),f(!1))}),[x,f]),D=u.useCallback((()=>{O.current&&(h(m.floating.current).removeEventListener("pointermove",O.current),O.current=void 0)}),[m]),F=u.useCallback((()=>{h(m.floating.current).body.style.pointerEvents="",L.current=!1}),[m]);if(u.useEffect((()=>{if(!n)return;function t(){return!!d.current.openEvent&&["click","mousedown"].includes(d.current.openEvent.type)}function r(e){if(clearTimeout(T.current),M.current=!1,i&&"mouse"!==k.current||l>0&&0===B(x.current,"open"))return;d.current.openEvent=e;const t=B(x.current,"open",k.current);t?T.current=setTimeout((()=>{f(!0)}),t):f(!0)}function o(n){if(t())return;const r=h(m.floating.current);if(clearTimeout(C.current),R.current)return clearTimeout(T.current),O.current&&r.removeEventListener("pointermove",O.current),O.current=R.current({...e,tree:w,x:n.clientX,y:n.clientY,onClose(){F(),D(),A()}}),void r.addEventListener("pointermove",O.current);A()}function u(n){t()||null==R.current||R.current({...e,tree:w,x:n.clientX,y:n.clientY,leave:!0,onClose(){F(),D(),A()}})(n)}const c=m.floating.current,v=m.domReference.current;return y(v)?(a&&v.addEventListener("mouseleave",u),null==c||c.addEventListener("mouseleave",u),s&&v.addEventListener("mousemove",r,{once:!0}),v.addEventListener("mouseenter",r),v.addEventListener("mouseleave",o),()=>{a&&v.removeEventListener("mouseleave",u),null==c||c.removeEventListener("mouseleave",u),s&&v.removeEventListener("mousemove",r),v.removeEventListener("mouseenter",r),v.removeEventListener("mouseleave",o)}):void 0}),[b.domReference,n,e,i,l,s,A,D,F,f,a,w,m,x,R,d]),c((()=>{if(n&&a&&R.current&&R.current.__options.blockPointerEvents&&P()){h(m.floating.current).body.style.pointerEvents="none",L.current=!0;const n=m.domReference.current,r=m.floating.current;if(y(n)&&r){var e,t;const o=null==w||null==(e=w.nodesRef.current.find((e=>e.id===E)))||null==(t=e.context)?void 0:t.refs.floating.current;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="auto",r.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents=""}}}}),[n,a,E,m,w,R,d,P]),c((()=>{I&&!a&&(k.current=void 0,D(),F())})),u.useEffect((()=>()=>{D(),clearTimeout(T.current),clearTimeout(C.current),L.current&&F()}),[n,D,F]),!n)return{};function S(e){k.current=e.pointerType}return{reference:{onPointerDown:S,onPointerEnter:S,onMouseMove(){a||0===l||(clearTimeout(C.current),C.current=setTimeout((()=>{M.current||f(!0)}),l))}},floating:{onMouseEnter(){clearTimeout(T.current)},onMouseLeave(){A(!1)}}}},e.useId=d,e.useInnerOffset=(e,t)=>{let{open:n,refs:o}=e,{enabled:c=!0,overflowRef:i,onChange:l}=t;const s=W(l),a=u.useRef(!1),f=u.useRef(null),d=u.useRef(null);return u.useEffect((()=>{if(!c)return;function e(e){if(e.ctrlKey||!t||null==i.current)return;const n=e.deltaY,o=i.current.top>=-.5,u=i.current.bottom>=-.5,c=t.scrollHeight-t.clientHeight,l=n<0?-1:1,a=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{s.current((e=>e+Math[a](n,c*l)))}))):/firefox/i.test(function(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}())&&(t.scrollTop+=n))}const t=o.floating.current;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=i.current&&(d.current={...i.current})})),()=>{f.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0}),[c,n,o,i,s]),c?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=o.floating.current;if(i.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(i.current.bottom<-.5&&t<-1||i.current.top<-.5&&t>1)&&r.flushSync((()=>l((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}},e.useInteractions=function(e){return void 0===e&&(e=[]),{getReferenceProps:t=>x(t,e,"reference"),getFloatingProps:t=>x(t,e,"floating"),getItemProps:t=>x(t,e,"item")}},e.useListNavigation=function(e,t){let{open:n,onOpenChange:r,refs:o}=e,{listRef:i,activeIndex:l,onNavigate:s=(()=>{}),enabled:a=!0,selectedIndex:f=null,allowEscape:d=!1,loop:v=!1,nested:m=!1,rtl:b=!1,virtual:y=!1,focusItemOnOpen:E="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:I=!0,disabledIndices:k,orientation:T="vertical",cols:O=1}=void 0===t?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;const C=g(),M=p(),L=V(n),P=R(s),A=R(V(s)),D=u.useRef(E),F=u.useRef(null!=f?f:-1),j=u.useRef(null),H=W(k),K=u.useRef(!1),_=u.useRef(-1),[q,B]=u.useState(),X=u.useCallback(((e,t)=>{_.current=requestAnimationFrame((()=>{var n,r;y?B(null==(n=e.current[t.current])?void 0:n.id):null==(r=e.current[t.current])||r.focus({preventScroll:!0})}))}),[y]);function Y(e){if(K.current=!0,m&&function(e,t,n){return ue(t,n?e===te:e===ee,e===Z)}(e.key,T,b))return N(e),r(!1),void(w(o.domReference.current)&&o.domReference.current.focus());const t=F.current,u=le(i,k),c=se(i,k);if("Home"===e.key&&(F.current=u,P(F.current)),"End"===e.key&&(F.current=c,P(F.current)),O>1){const t=F.current;if(e.key===Z){if(N(e),-1===t)F.current=c;else if(F.current=oe(i,{startingIndex:t,amount:O,decrement:!0,disabledIndices:k}),v&&(t-O<u||F.current<0)){const e=t%O,n=c%O,r=c-(n-e);F.current=n===e?c:n>e?r:r-O}re(i,F.current)&&(F.current=t),P(F.current)}if(e.key===$&&(N(e),-1===t?F.current=u:(F.current=oe(i,{startingIndex:t,amount:O,disabledIndices:k}),v&&t+O>c&&(F.current=oe(i,{startingIndex:t%O-O,amount:O,disabledIndices:k}))),re(i,F.current)&&(F.current=t),P(F.current)),"both"===T){const n=Math.floor(t/O);e.key===te&&(N(e),t%O!=O-1?(F.current=oe(i,{startingIndex:t,disabledIndices:k}),v&&ne(F.current,O,n)&&(F.current=oe(i,{startingIndex:t-t%O-1,disabledIndices:k}))):v&&(F.current=oe(i,{startingIndex:t-t%O-1,disabledIndices:k})),ne(F.current,O,n)&&(F.current=t)),e.key===ee&&(N(e),t%O!=0?(F.current=oe(i,{startingIndex:t,disabledIndices:k,decrement:!0}),v&&ne(F.current,O,n)&&(F.current=oe(i,{startingIndex:t+(O-t%O),decrement:!0,disabledIndices:k}))):v&&(F.current=oe(i,{startingIndex:t+(O-t%O),decrement:!0,disabledIndices:k})),ne(F.current,O,n)&&(F.current=t));const r=Math.floor(c/O)===n;return re(i,F.current)&&(F.current=v&&r?e.key===ee?c:oe(i,{startingIndex:t-t%O-1,disabledIndices:k}):t),void P(F.current)}}if(ce(e.key,T)){if(N(e),n&&!y&&S(e.currentTarget.ownerDocument)===e.currentTarget)return F.current=ie(e.key,T,b)?u:c,void P(F.current);ie(e.key,T,b)?F.current=v?t>=c?d&&t!==i.current.length?-1:u:oe(i,{startingIndex:t,disabledIndices:k}):Math.min(c,oe(i,{startingIndex:t,disabledIndices:k})):F.current=v?t<=u?d&&-1!==t?i.current.length:c:oe(i,{startingIndex:t,decrement:!0,disabledIndices:k}):Math.max(u,oe(i,{startingIndex:t,decrement:!0,disabledIndices:k})),re(i,F.current)?P(null):P(F.current)}}return c((()=>{a&&(!L&&n&&D.current&&null!=f&&P(f),L&&!n&&(cancelAnimationFrame(_.current),F.current=-1,A(null)))}),[n,L,f,i,X,a,P,A]),c((()=>{if(a&&n)if(null==l){if(null!=f)return;L&&(F.current=-1,X(i,F)),!L&&D.current&&(null!=j.current||!0===D.current&&null==j.current)&&(F.current=null==j.current||ie(j.current,T,b)||m?le(i,H.current):se(i,H.current),P(F.current),X(i,F))}else re(i,l)||(F.current=l,X(i,F))}),[n,L,l,f,m,i,P,X,a,d,T,b,y,H]),c((()=>{if(a&&!n&&L){var e,t;const n=null==M||null==(e=M.nodesRef.current.find((e=>e.id===C)))||null==(t=e.context)?void 0:t.refs.floating.current;n&&!n.contains(S(h(n)))&&n.focus({preventScroll:!0})}}),[a,n,L,M,C]),c((()=>{j.current=null})),a?{reference:{...y&&n&&null!=l&&{"aria-activedescendant":q},onKeyDown(e){if(K.current=!0,y&&n)return Y(e);(0===e.key.indexOf("Arrow")||"Enter"===e.key||" "===e.key||""===e.key)&&(j.current=e.key),m?function(e,t,n){return ue(t,n?e===ee:e===te,e===$)}(e.key,T,b)&&(N(e),n?(F.current=le(i,k),P(F.current)):r(!0)):ce(e.key,T)&&(null!=f&&(F.current=f),N(e),!n&&I?r(!0):Y(e),n&&P(F.current))}},floating:{"aria-orientation":"both"===T?void 0:T,...y&&null!=l&&{"aria-activedescendant":q},onKeyDown:Y,onPointerMove(){K.current=!1}},item:{onFocus(e){let{currentTarget:t}=e;const n=i.current.indexOf(t);-1!==n&&P(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...x&&{onMouseMove(e){let{currentTarget:t}=e;const n=t;if(n){const e=i.current.indexOf(n);-1!==e&&P(e)}},onPointerLeave(){K.current||(F.current=-1,X(i,F),P(null),y||requestAnimationFrame((()=>{var e;null==(e=o.floating.current)||e.focus({preventScroll:!0})})))}}}}:{}},e.useRole=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=void 0===t?{}:t;const u=d(),c=d(),i={id:u,role:o};return r?"tooltip"===o?{reference:{"aria-describedby":n?u:void 0},floating:i}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":n?u:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:c}},floating:{...i,..."menu"===o&&{"aria-labelledby":c}}}:{}},e.useTypeahead=function(e,t){var n;let{open:r,dataRef:o}=e,{listRef:i,activeIndex:l,onMatch:s=(()=>{}),enabled:a=!0,findMatch:f=null,resetMs:d=1e3,ignoreKeys:v=[],selectedIndex:m=null}=void 0===t?{listRef:{current:[]},activeIndex:null}:t;const g=u.useRef(),p=u.useRef(""),b=u.useRef(null!=(n=null!=m?m:l)?n:-1),w=u.useRef(null);function E(e){const t=j(e.nativeEvent);if(y(t)&&S(h(t))!==e.currentTarget&&t.closest('[role="dialog"],[role="menu"],[role="listbox"],[role="tree"],[role="grid"]')!==e.currentTarget)return;p.current.length>0&&" "!==p.current[0]&&(o.current.typing=!0," "===e.key&&N(e));const n=i.current;if(null==n||v.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&p.current===e.key&&(p.current="",b.current=w.current),p.current+=e.key,clearTimeout(g.current),g.current=setTimeout((()=>{p.current="",b.current=w.current,o.current.typing=!1}),d);const r=b.current,u=[...n.slice((null!=r?r:0)+1),...n.slice(0,(null!=r?r:0)+1)],c=f?f(u,p.current):u.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(p.current.toLocaleLowerCase())))),l=c?n.indexOf(c):-1;-1!==l&&(s(l),w.current=l)}return c((()=>{r&&(clearTimeout(g.current),w.current=null,p.current="")}),[r]),c((()=>{var e;r&&""===p.current&&(b.current=null!=(e=null!=m?m:l)?e:-1)}),[r,m,l]),a?{reference:{onKeyDown:E},floating:{onKeyDown:E}}:{}},Object.keys(t).forEach((function(n){"default"===n||e.hasOwnProperty(n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "@floating-ui/react-dom-interactions",
"version": "0.10.1",
"version": "0.10.2",
"@rollingversions": {

@@ -5,0 +5,0 @@ "baseVersion": [

@@ -10,2 +10,2 @@ import * as React from 'react';

lockScroll?: boolean | undefined;
}, "start" | "name" | "data" | "width" | "height" | "size" | "style" | "open" | "className" | "id" | "prefix" | "slot" | "children" | "value" | "cite" | "form" | "label" | "span" | "summary" | "title" | "pattern" | "list" | "step" | "key" | "dir" | "lockScroll" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
}, "start" | "name" | "data" | "width" | "height" | "size" | "content" | "open" | "className" | "id" | "prefix" | "slot" | "children" | "value" | "cite" | "form" | "label" | "span" | "style" | "summary" | "title" | "pattern" | "list" | "step" | "key" | "dir" | "lockScroll" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc