Module 716263

37,393 characters · in no known chunk
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{Mk:()=>ev,bv:()=>e5,s3:()=>eq,we:()=>e6,fI:()=>eg,zR:()=>eJ,DL:()=>e9,iB:()=>tt,s9:()=>e3,$c:()=>eA,XF:()=>eB,P6:()=>eI,R1:()=>em});var i=n(64700),r=n.t(i,2),s=n(84157),a='input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])',o="u"<typeof Element,l=o?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,u=!o&&Element.prototype.getRootNode?function(e){var t;return null==e||null==(t=e.getRootNode)?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},c=function e(t,n){void 0===n&&(n=!0);var i,r=null==t||null==(i=t.getAttribute)?void 0:i.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},d=function(e){var t,n=null==e||null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===n||"true"===n},_=function(e,t,n){if(c(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(a));return t&&l.call(e,a)&&i.unshift(e),i=i.filter(n)},h=function e(t,n,i){for(var r=[],s=Array.from(t);s.length;){var o=s.shift();if(!c(o,!1))if("SLOT"===o.tagName){var u=o.assignedElements(),d=e(u.length?u:o.children,!0,i);i.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else{l.call(o,a)&&i.filter(o)&&(n||!t.includes(o))&&r.push(o);var _=o.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(o),h=!c(_,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(o));if(_&&h){var f=e(!0===_?o.children:_.children,!0,i);i.flatten?r.push.apply(r,f):r.push({scopeParent:o,candidates:f})}else s.unshift.apply(s,o.children)}}return r},f=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},p=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||d(e))&&!f(e)?0:e.tabIndex},E=function(e,t){var n=p(e);return n<0&&t&&!f(e)?0:n},m=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},g=function(e){return"INPUT"===e.tagName},A=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},I=function(e){if(!e.name)return!0;var t,n=e.form||u(e),i=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("u">typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=i(window.CSS.escape(e.name));else try{t=i(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=A(t,e.form);return!r||r===e},T=function(e){return g(e)&&"radio"===e.type&&!I(e)},S=function(e){var t,n,i,r,s,a,o,l=e&&u(e),c=null==(t=l)?void 0:t.host,d=!1;if(l&&l!==e)for(d=!!(null!=(n=c)&&null!=(i=n.ownerDocument)&&i.contains(c)||null!=e&&null!=(r=e.ownerDocument)&&r.contains(e));!d&&c;)d=!!(null!=(a=c=null==(s=l=u(c))?void 0:s.host)&&null!=(o=a.ownerDocument)&&o.contains(c));return d},y=function(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return 0===n&&0===i},C=function(e,t){var n=t.displayCheck,i=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=l.call(e,"details>summary:first-of-type")?e.parentElement:e;if(l.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return y(e)}else{if("function"==typeof i){for(var s=e;e;){var a=e.parentElement,o=u(e);if(a&&!a.shadowRoot&&!0===i(a))return y(e);e=e.assignedSlot?e.assignedSlot:a||o===e.ownerDocument?a:o.host}e=s}if(S(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},N=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var i=t.children.item(n);if("LEGEND"===i.tagName)return!!l.call(t,"fieldset[disabled] *")||!i.contains(e)}return!0}t=t.parentElement}return!1},v=function(e,t){return!(t.disabled||c(t)||g(t)&&"hidden"===t.type||C(t,e)||"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(e){return"SUMMARY"===e.tagName})||N(t))},R=function(e,t){return!(T(t)||0>p(t))&&!!v(e,t)},O=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||!!(t>=0)},b=function e(t){var n=[],i=[];return t.forEach(function(t,r){var s=!!t.scopeParent,a=s?t.scopeParent:t,o=E(a,s),l=s?e(t.candidates):a;0===o?s?n.push.apply(n,l):n.push(a):i.push({documentOrder:r,tabIndex:o,item:t,isScope:s,content:l})}),i.sort(m).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},D=function(e,t){return b((t=t||{}).getShadowRoot?h([e],t.includeContainer,{filter:R.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:O}):_(e,t.includeContainer,R.bind(null,t)))},L=function(e,t){return(t=t||{}).getShadowRoot?h([e],t.includeContainer,{filter:v.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):_(e,t.includeContainer,v.bind(null,t))},w=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==l.call(e,a)&&R(t,e)};function M(){let e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function P(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function x(){let e=/android/i;return e.test(M())||e.test(P())}let k="data-floating-ui-focusable";function U(e){let t=e.activeElement;for(;(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function G(e,t){if(!e||!t)return!1;let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&(0,s.Ng)(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function F(e){return"composedPath"in e?e.composedPath()[0]:e.target}function V(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function B(e){return(null==e?void 0:e.ownerDocument)||document}function j(e){return!!e&&"combobox"===e.getAttribute("role")&&(0,s.sb)(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function H(e){return e?e.hasAttribute(k)?e:e.querySelector("["+k+"]")||e:null}function Y(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var i;return e.parentId===t&&(!n||(null==(i=e.context)?void 0:i.open))}).flatMap(t=>[t,...Y(e,t.id,n)])}function W(e,t){var n;let i=[],r=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;r;){let t=e.find(e=>e.id===r);r=null==t?void 0:t.parentId,t&&(i=i.concat(t))}return i}function K(e){e.preventDefault(),e.stopPropagation()}function $(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var z="u">typeof document?i.useLayoutEffect:function(){};function q(e){let t=i.useRef(e);return z(()=>{t.current=e}),t}let Z={...r}.useInsertionEffect||(e=>e());function X(e){let t=i.useRef(()=>{});return Z(()=>{t.current=e}),i.useCallback(function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return null==t.current?void 0:t.current(...n)},[])}let Q=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function J(e,t){let n=D(e,Q()),i=n.length;if(0===i)return;let r=U(B(e)),s=n.indexOf(r);return n[-1===s?1===t?0:i-1:s+t]}function ee(e){return J(B(e).body,1)||e}function et(e){return J(B(e).body,-1)||e}function en(e,t){let n=t||e.currentTarget,i=e.relatedTarget;return!i||!G(n,i)}function ei(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var er=n(627968),es=n(340287),ea=n(879821);let eo="active",el="selected",eu={...r},ec=!1,ed=0,e_=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ed++,eh=eu.useId||function(){let[e,t]=i.useState(()=>ec?e_():void 0);return z(()=>{null==e&&t(e_())},[]),i.useEffect(()=>{ec=!0},[]),e};function ef(){let e=new Map;return{emit(t,n){var i;null==(i=e.get(t))||i.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;null==(i=e.get(t))||i.delete(n)}}}let ep=i.createContext(null),eE=i.createContext(null),em=()=>{var e;return(null==(e=i.useContext(ep))?void 0:e.id)||null};function eg(e){let t=eh(),n=i.useContext(eE),r=em(),s=e||r;return z(()=>{if(!t)return;let e={id:t,parentId:s};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}},[n,t,s]),t}function eA(e){let{children:t,id:n}=e,r=em();return(0,er.jsx)(ep.Provider,{value:i.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function eI(e){let{children:t}=e,n=i.useRef([]),r=i.useCallback(e=>{n.current=[...n.current,e]},[]),s=i.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[a]=i.useState(()=>ef());return(0,er.jsx)(eE.Provider,{value:i.useMemo(()=>({nodesRef:n,addNode:r,removeNode:s,events:a}),[r,s,a]),children:t})}function eT(e){return"data-floating-ui-"+e}function eS(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}let ey=eT("safe-polygon");function eC(e,t,n){if(n&&!$(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){let n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function eN(e){return"function"==typeof e?e():e}function ev(e,t){void 0===t&&(t={});let{open:n,onOpenChange:r,dataRef:a,events:o,elements:l}=e,{enabled:u=!0,delay:c=0,handleClose:d=null,mouseOnly:_=!1,restMs:h=0,move:f=!0}=t,p=i.useContext(eE),E=em(),m=q(d),g=q(c),A=q(n),I=q(h),T=i.useRef(),S=i.useRef(-1),y=i.useRef(),C=i.useRef(-1),N=i.useRef(!0),v=i.useRef(!1),R=i.useRef(()=>{}),O=i.useRef(!1),b=X(()=>{var e;let t=null==(e=a.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});i.useEffect(()=>{if(u)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{open:t}=e;t||(eS(S),eS(C),N.current=!0,O.current=!1)}},[u,o]),i.useEffect(()=>{if(!u||!m.current||!n)return;function e(e){b()&&r(!1,e,"hover")}let t=B(l.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[l.floating,n,r,u,m,b]);let D=i.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");let i=eC(g.current,"close",T.current);i&&!y.current?(eS(S),S.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(eS(S),r(!1,e,n))},[g,r]),L=X(()=>{R.current(),y.current=void 0}),w=X(()=>{if(v.current){let e=B(l.floating).body;e.style.pointerEvents="",e.removeAttribute(ey),v.current=!1}}),M=X(()=>!!a.current.openEvent&&["click","mousedown"].includes(a.current.openEvent.type));i.useEffect(()=>{if(u&&(0,s.vq)(l.domReference)){let r=l.domReference,s=l.floating;return n&&r.addEventListener("mouseleave",i),f&&r.addEventListener("mousemove",e,{once:!0}),r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",t),s&&(s.addEventListener("mouseleave",i),s.addEventListener("mouseenter",o),s.addEventListener("mouseleave",c)),()=>{n&&r.removeEventListener("mouseleave",i),f&&r.removeEventListener("mousemove",e),r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",t),s&&(s.removeEventListener("mouseleave",i),s.removeEventListener("mouseenter",o),s.removeEventListener("mouseleave",c))}}function e(e){if(eS(S),N.current=!1,_&&!$(T.current)||eN(I.current)>0&&!eC(g.current,"open"))return;let t=eC(g.current,"open",T.current);t?S.current=window.setTimeout(()=>{A.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(M())return void w();R.current();let t=B(l.floating);if(eS(C),O.current=!1,m.current&&a.current.floatingContext){n||eS(S),y.current=m.current({...a.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){w(),L(),M()||D(e,!0,"safe-polygon")}});let i=y.current;t.addEventListener("mousemove",i),R.current=()=>{t.removeEventListener("mousemove",i)};return}"touch"===T.current&&G(l.floating,e.relatedTarget)||D(e)}function i(e){M()||a.current.floatingContext&&(null==m.current||m.current({...a.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){w(),L(),M()||D(e)}})(e))}function o(){eS(S)}function c(e){M()||D(e,!1)}},[l,u,e,_,f,D,L,w,r,n,A,p,g,m,a,M,I]),z(()=>{var e,t;if(u&&n&&null!=(e=m.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&b()){v.current=!0;let e=l.floating;if((0,s.vq)(l.domReference)&&e){let n=B(l.floating).body;n.setAttribute(ey,"");let i=l.domReference,r=null==p||null==(t=p.nodesRef.current.find(e=>e.id===E))||null==(t=t.context)?void 0:t.elements.floating;return r&&(r.style.pointerEvents=""),n.style.pointerEvents="none",i.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",i.style.pointerEvents="",e.style.pointerEvents=""}}}},[u,n,E,l,p,m,b]),z(()=>{n||(T.current=void 0,O.current=!1,L(),w())},[n,L,w]),i.useEffect(()=>()=>{L(),eS(S),eS(C),w()},[u,l.domReference,L,w]);let P=i.useMemo(()=>{function e(e){T.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){N.current||A.current||r(!0,t,"hover")}_&&!$(T.current)||n||0===eN(I.current)||O.current&&e.movementX**2+e.movementY**2<2||(eS(C),"touch"===T.current?i():(O.current=!0,C.current=window.setTimeout(i,eN(I.current))))}}},[_,r,n,A,I]);return i.useMemo(()=>u?{reference:P}:{},[u,P])}let eR=0;function eO(e,t){void 0===t&&(t={});let{preventScroll:n=!1,cancelPrevious:i=!0,sync:r=!1}=t;i&&cancelAnimationFrame(eR);let s=()=>null==e?void 0:e.focus({preventScroll:n});r?s():eR=requestAnimationFrame(s)}function eb(e,t){if(!e||!t)return!1;let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&(0,s.Ng)(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}let eD={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function eL(e){return"inert"===e?eD.inert:"aria-hidden"===e?eD["aria-hidden"]:eD.none}let ew=new WeakSet,eM={},eP=0,ex=e=>e&&(e.host||ex(e.parentNode));function ek(e,t,n){var i,r,a;let o,l,u,c,d,_,h;void 0===t&&(t=!1),void 0===n&&(n=!1);let f=((null==(i=e[0])?void 0:i.ownerDocument)||document).body;return r=e.concat(Array.from(f.querySelectorAll('[aria-live],[role="status"],output'))),a=t,o="data-floating-ui-inert",l=n?"inert":a?"aria-hidden":null,u=r.map(e=>{if(f.contains(e))return e;let t=ex(e);return f.contains(t)?t:null}).filter(e=>null!=e),c=new Set,d=new Set(u),_=[],eM[o]||(eM[o]=new WeakMap),h=eM[o],u.forEach(function e(t){!(!t||c.has(t))&&(c.add(t),t.parentNode&&e(t.parentNode))}),function e(t){!t||d.has(t)||[].forEach.call(t.children,t=>{if("script"!==(0,s.mq)(t))if(c.has(t))e(t);else{let e=l?t.getAttribute(l):null,n=null!==e&&"false"!==e,i=eL(l),r=(i.get(t)||0)+1,s=(h.get(t)||0)+1;i.set(t,r),h.set(t,s),_.push(t),1===r&&n&&ew.add(t),1===s&&t.setAttribute(o,""),!n&&l&&t.setAttribute(l,"inert"===l?"":"true")}})}(f),c.clear(),eP++,()=>{_.forEach(e=>{let t=eL(l),n=(t.get(e)||0)-1,i=(h.get(e)||0)-1;t.set(e,n),h.set(e,i),n||(!ew.has(e)&&l&&e.removeAttribute(l),ew.delete(e)),i||e.removeAttribute(o)}),--eP||(eD.inert=new WeakMap,eD["aria-hidden"]=new WeakMap,eD.none=new WeakMap,ew=new WeakSet,eM={})}}let eU={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},eG=i.forwardRef(function(e,t){let[n,r]=i.useState();z(()=>{/apple/i.test(navigator.vendor)&&r("button")},[]);let s={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[eT("focus-guard")]:"",style:eU};return(0,er.jsx)("span",{...e,...s})}),eF=i.createContext(null),eV=eT("portal");function eB(e){let{children:t,id:n,root:r,preserveTabOrder:a=!0}=e,o=function(e){void 0===e&&(e={});let{id:t,root:n}=e,r=eh(),a=ej(),[o,l]=i.useState(null),u=i.useRef(null);return z(()=>()=>{null==o||o.remove(),queueMicrotask(()=>{u.current=null})},[o]),z(()=>{if(!r||u.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement("div");n.id=r,n.setAttribute(eV,""),e.appendChild(n),u.current=n,l(n)},[t,r]),z(()=>{if(null===n||!r||u.current)return;let e=n||(null==a?void 0:a.portalNode);e&&!(0,s.Ll)(e)&&(e=e.current),e=e||document.body;let i=null;t&&((i=document.createElement("div")).id=t,e.appendChild(i));let o=document.createElement("div");o.id=r,o.setAttribute(eV,""),(e=i||e).appendChild(o),u.current=o,l(o)},[t,n,r,a]),o}({id:n,root:r}),[l,u]=i.useState(null),c=i.useRef(null),d=i.useRef(null),_=i.useRef(null),h=i.useRef(null),f=null==l?void 0:l.modal,p=null==l?void 0:l.open,E=!!l&&!l.modal&&l.open&&a&&!!(r||o);return i.useEffect(()=>{if(o&&a&&!f)return o.addEventListener("focusin",e,!0),o.addEventListener("focusout",e,!0),()=>{o.removeEventListener("focusin",e,!0),o.removeEventListener("focusout",e,!0)};function e(e){o&&en(e)&&("focusin"===e.type?ei:function(e){D(e,Q()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})})(o)}},[o,a,f]),i.useEffect(()=>{!o||p||ei(o)},[p,o]),(0,er.jsxs)(eF.Provider,{value:i.useMemo(()=>({preserveTabOrder:a,beforeOutsideRef:c,afterOutsideRef:d,beforeInsideRef:_,afterInsideRef:h,portalNode:o,setFocusManagerState:u}),[a,o]),children:[E&&o&&(0,er.jsx)(eG,{"data-type":"outside",ref:c,onFocus:e=>{if(en(e,o)){var t;null==(t=_.current)||t.focus()}else{let e=et(l?l.domReference:null);null==e||e.focus()}}}),E&&o&&(0,er.jsx)("span",{"aria-owns":o.id,style:eU}),o&&es.createPortal(t,o),E&&o&&(0,er.jsx)(eG,{"data-type":"outside",ref:d,onFocus:e=>{if(en(e,o)){var t;null==(t=h.current)||t.focus()}else{let t=ee(l?l.domReference:null);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}let ej=()=>i.useContext(eF);function eH(e){return i.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let eY=[];function eW(){eY=eY.filter(e=>e.isConnected)}function eK(){return eW(),eY[eY.length-1]}function e$(e,t){var n;if(!t.current.includes("floating")&&!(null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;let i=Q(),r=L(e,i).filter(e=>{let t=e.getAttribute("data-tabindex")||"";return w(e,i)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||0===r.length?"0"!==s&&e.setAttribute("tabindex","0"):("-1"!==s||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}let ez=i.forwardRef(function(e,t){return(0,er.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:eU})});function eq(e){let{context:t,children:n,disabled:r=!1,order:a=["content"],guards:o=!0,initialFocus:l=0,returnFocus:u=!0,restoreFocus:c=!1,modal:d=!0,visuallyHiddenDismiss:_=!1,closeOnFocusOut:h=!0,outsideElementsInert:f=!1,getInsideElements:p=()=>[]}=e,{open:E,onOpenChange:m,events:g,dataRef:A,elements:{domReference:I,floating:T}}=t,S=X(()=>{var e;return null==(e=A.current.floatingContext)?void 0:e.nodeId}),y=X(p),C="number"==typeof l&&l<0,N=j(I)&&C,v="u">typeof HTMLElement&&"inert"in HTMLElement.prototype,R=!v||o,O=!R||v&&f,b=q(a),L=q(l),M=q(u),k=i.useContext(eE),V=ej(),$=i.useRef(null),Z=i.useRef(null),J=i.useRef(!1),ei=i.useRef(!1),es=i.useRef(-1),ea=i.useRef(-1),eo=null!=V,el=H(T),eu=X(function(e){return void 0===e&&(e=el),e?D(e,Q()):[]}),ec=X(e=>{let t=eu(e);return b.current.map(e=>I&&"reference"===e?I:el&&"floating"===e?el:t).filter(Boolean).flat()});i.useEffect(()=>{if(r||!d)return;function e(e){if("Tab"===e.key){G(el,U(B(el)))&&0===eu().length&&!N&&K(e);let t=ec(),n=F(e);"reference"===b.current[0]&&n===I&&(K(e),e.shiftKey?eO(t[t.length-1]):eO(t[1])),"floating"===b.current[1]&&n===el&&e.shiftKey&&(K(e),eO(t[0]))}}let t=B(el);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,I,el,d,b,N,eu,ec]),i.useEffect(()=>{if(!r&&T)return T.addEventListener("focusin",e),()=>{T.removeEventListener("focusin",e)};function e(e){let t=F(e),n=eu().indexOf(t);-1!==n&&(es.current=n)}},[r,T,eu]),i.useEffect(()=>{if(r||!h)return;function e(){ei.current=!0,setTimeout(()=>{ei.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,i=F(e);queueMicrotask(()=>{let r=S(),a=!(G(I,t)||G(T,t)||G(t,T)||G(null==V?void 0:V.portalNode,t)||null!=t&&t.hasAttribute(eT("focus-guard"))||k&&(Y(k.nodesRef.current,r).find(e=>{var n,i;return G(null==(n=e.context)?void 0:n.elements.floating,t)||G(null==(i=e.context)?void 0:i.elements.domReference,t)})||W(k.nodesRef.current,r).find(e=>{var n,i,r;return[null==(n=e.context)?void 0:n.elements.floating,H(null==(i=e.context)?void 0:i.elements.floating)].includes(t)||(null==(r=e.context)?void 0:r.elements.domReference)===t})));if(n===I&&el&&e$(el,b),c&&n!==I&&!(null!=i&&i.isConnected)&&U(B(el))===B(el).body){(0,s.sb)(el)&&el.focus();let e=es.current,t=eu(),n=t[e]||t[t.length-1]||el;(0,s.sb)(n)&&n.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(N||!d)&&t&&a&&!ei.current&&t!==eK()&&(J.current=!0,m(!1,e,"focus-out"))})}let n=!!(!k&&V);function i(){eS(ea),A.current.insideReactTree=!0,ea.current=window.setTimeout(()=>{A.current.insideReactTree=!1})}if(T&&(0,s.sb)(I))return I.addEventListener("focusout",t),I.addEventListener("pointerdown",e),T.addEventListener("focusout",t),n&&T.addEventListener("focusout",i,!0),()=>{I.removeEventListener("focusout",t),I.removeEventListener("pointerdown",e),T.removeEventListener("focusout",t),n&&T.removeEventListener("focusout",i,!0)}},[r,I,T,el,d,k,V,m,h,c,eu,N,S,b,A]);let ed=i.useRef(null),e_=i.useRef(null),eh=eH([ed,null==V?void 0:V.beforeInsideRef]),ef=eH([e_,null==V?void 0:V.afterInsideRef]);function ep(e){return!r&&_&&d?(0,er.jsx)(ez,{ref:"start"===e?$:Z,onClick:e=>m(!1,e.nativeEvent),children:"string"==typeof _?_:"Dismiss"}):null}i.useEffect(()=>{var e,t;if(r||!T)return;let n=Array.from((null==V||null==(e=V.portalNode)?void 0:e.querySelectorAll("["+eT("portal")+"]"))||[]),i=[T,null==(t=(k?W(k.nodesRef.current,S()):[]).find(e=>{var t;return j((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,...n,...y(),$.current,Z.current,ed.current,e_.current,null==V?void 0:V.beforeOutsideRef.current,null==V?void 0:V.afterOutsideRef.current,b.current.includes("reference")||N?I:null].filter(e=>null!=e),s=d||N?ek(i,!O,O):ek(i);return()=>{s()}},[r,I,T,d,b,V,N,R,O,k,S,y]),z(()=>{if(r||!(0,s.sb)(el))return;let e=U(B(el));queueMicrotask(()=>{let t=ec(el),n=L.current,i=("number"==typeof n?t[n]:n.current)||el,r=G(el,e);C||r||!E||eO(i,{preventScroll:i===el})})},[r,E,el,C,ec,L]),z(()=>{var e;if(r||!el)return;let t=B(el);function n(e){let{reason:t,event:n,nested:i}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&(J.current=!0),"outside-press"===t)if(i)J.current=!1;else if(0===n.mozInputSource&&n.isTrusted||(x()&&n.pointerType?"click"===n.type&&1===n.buttons:0===n.detail&&!n.pointerType)||!P().includes("jsdom/")&&(!x()&&0===n.width&&0===n.height||x()&&1===n.width&&1===n.height&&0===n.pressure&&0===n.detail&&"mouse"===n.pointerType||n.width<1&&n.height<1&&0===n.pressure&&0===n.detail&&"touch"===n.pointerType))J.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),e?J.current=!1:J.current=!0}}e=U(t),eW(),e&&"body"!==(0,s.mq)(e)&&(eY.push(e),eY.length>20&&(eY=eY.slice(-20))),g.on("openchange",n);let i=t.createElement("span");return i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),Object.assign(i.style,eU),eo&&I&&I.insertAdjacentElement("afterend",i),()=>{g.off("openchange",n);let e=U(t),r=G(T,e)||k&&Y(k.nodesRef.current,S(),!1).some(t=>{var n;return G(null==(n=t.context)?void 0:n.elements.floating,e)}),a=function(){if("boolean"==typeof M.current){let e=I||eK();return e&&e.isConnected?e:i}return M.current.current||i}();queueMicrotask(()=>{let n,o=w(a,n=Q())?a:D(a,n)[0]||a;M.current&&!J.current&&(0,s.sb)(o)&&(o===e||e===t.body||r)&&o.focus({preventScroll:!0}),i.remove()})}},[r,T,el,M,A,g,k,eo,I,S]),i.useEffect(()=>(queueMicrotask(()=>{J.current=!1}),()=>{queueMicrotask(eW)}),[r]),z(()=>{if(!r&&V)return V.setFocusManagerState({modal:d,closeOnFocusOut:h,open:E,onOpenChange:m,domReference:I}),()=>{V.setFocusManagerState(null)}},[r,V,d,E,m,h,I]),z(()=>{r||el&&e$(el,b)},[r,el,b]);let em=!r&&R&&(!d||!N)&&(eo||d);return(0,er.jsxs)(er.Fragment,{children:[em&&(0,er.jsx)(eG,{"data-type":"inside",ref:eh,onFocus:e=>{if(d){let e=ec();eO("reference"===a[0]?e[0]:e[e.length-1])}else if(null!=V&&V.preserveTabOrder&&V.portalNode)if(J.current=!1,en(e,V.portalNode)){let e=ee(I);null==e||e.focus()}else{var t;null==(t=V.beforeOutsideRef.current)||t.focus()}}}),!N&&ep("start"),n,ep("end"),em&&(0,er.jsx)(eG,{"data-type":"inside",ref:ef,onFocus:e=>{if(d)eO(ec()[0]);else if(null!=V&&V.preserveTabOrder&&V.portalNode)if(h&&(J.current=!0),en(e,V.portalNode)){let e=et(I);null==e||e.focus()}else{var t;null==(t=V.afterOutsideRef.current)||t.focus()}}})]})}let eZ=0,eX="--floating-ui-scrollbar-width",eQ=()=>{},eJ=i.forwardRef(function(e,t){let{lockScroll:n=!1,...i}=e;return z(()=>{if(n)return 1==++eZ&&(eQ=function(){let e=M(),t=/iP(hone|ad|od)|iOS/.test(e)||"MacIntel"===e&&navigator.maxTouchPoints>1,n=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,s=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(eX,r+"px"),r&&(n[i]=r+"px"),t){var o,l;let e=(null==(o=window.visualViewport)?void 0:o.offsetLeft)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor((null==(l=window.visualViewport)?void 0:l.offsetTop)||0))+"px",left:-(s-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[i]:""}),n.removeProperty(eX),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(s,a))}}()),()=>{0==--eZ&&eQ()}},[n]),(0,er.jsx)("div",{ref:t,...i,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}})}),e0={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},e1={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},e2=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function e3(e,t){void 0===t&&(t={});let{open:n,onOpenChange:r,elements:a,dataRef:o}=e,{enabled:l=!0,escapeKey:u=!0,outsidePress:c=!0,outsidePressEvent:d="pointerdown",referencePress:_=!1,referencePressEvent:h="pointerdown",ancestorScroll:f=!1,bubbles:p,capture:E}=t,m=i.useContext(eE),g=X("function"==typeof c?c:()=>!1),A="function"==typeof c?g:c,I=i.useRef(!1),{escapeKey:T,outsidePress:S}=e2(p),{escapeKey:y,outsidePress:C}=e2(E),N=i.useRef(!1),v=X(e=>{var t;if(!n||!l||!u||"Escape"!==e.key||N.current)return;let i=null==(t=o.current.floatingContext)?void 0:t.nodeId,s=m?Y(m.nodesRef.current,i):[];if(!T&&(e.stopPropagation(),s.length>0)){let e=!0;if(s.forEach(t=>{var n;if(null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,"nativeEvent"in e?e.nativeEvent:e,"escape-key")}),R=X(e=>{var t;let n=()=>{var t;v(e),null==(t=F(e))||t.removeEventListener("keydown",n)};null==(t=F(e))||t.addEventListener("keydown",n)}),O=X(e=>{var t;let n=o.current.insideReactTree;o.current.insideReactTree=!1;let i=I.current;if(I.current=!1,"click"===d&&i||n||"function"==typeof A&&!A(e))return;let l=F(e),u="["+eT("inert")+"]",c=B(a.floating).querySelectorAll(u),_=(0,s.vq)(l)?l:null;for(;_&&!(0,s.eu)(_);){let e=(0,s.$4)(_);if((0,s.eu)(e)||!(0,s.vq)(e))break;_=e}if(c.length&&(0,s.vq)(l)&&!l.matches("html,body")&&!G(l,a.floating)&&Array.from(c).every(e=>!G(_,e)))return;if((0,s.sb)(l)&&L){let t=(0,s.eu)(l),n=(0,s.L9)(l),i=/auto|scroll/,r=t||i.test(n.overflowX),a=t||i.test(n.overflowY),o=r&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,u=a&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,c="rtl"===n.direction,d=u&&(c?e.offsetX<=l.offsetWidth-l.clientWidth:e.offsetX>l.clientWidth),_=o&&e.offsetY>l.clientHeight;if(d||_)return}let h=null==(t=o.current.floatingContext)?void 0:t.nodeId,f=m&&Y(m.nodesRef.current,h).some(t=>{var n;return V(e,null==(n=t.context)?void 0:n.elements.floating)});if(V(e,a.floating)||V(e,a.domReference)||f)return;let p=m?Y(m.nodesRef.current,h):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if(null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,"outside-press")}),b=X(e=>{var t;let n=()=>{var t;O(e),null==(t=F(e))||t.removeEventListener(d,n)};null==(t=F(e))||t.addEventListener(d,n)});i.useEffect(()=>{if(!n||!l)return;o.current.__escapeKeyBubbles=T,o.current.__outsidePressBubbles=S;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function i(){window.clearTimeout(e),N.current=!0}function c(){e=window.setTimeout(()=>{N.current=!1},5*!!(0,s.Tc)())}let _=B(a.floating);u&&(_.addEventListener("keydown",y?R:v,y),_.addEventListener("compositionstart",i),_.addEventListener("compositionend",c)),A&&_.addEventListener(d,C?b:O,C);let h=[];return f&&((0,s.vq)(a.domReference)&&(h=(0,s.v9)(a.domReference)),(0,s.vq)(a.floating)&&(h=h.concat((0,s.v9)(a.floating))),!(0,s.vq)(a.reference)&&a.reference&&a.reference.contextElement&&(h=h.concat((0,s.v9)(a.reference.contextElement)))),(h=h.filter(e=>{var t;return e!==(null==(t=_.defaultView)?void 0:t.visualViewport)})).forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{u&&(_.removeEventListener("keydown",y?R:v,y),_.removeEventListener("compositionstart",i),_.removeEventListener("compositionend",c)),A&&_.removeEventListener(d,C?b:O,C),h.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[o,a,u,A,d,n,r,f,l,T,S,v,y,R,O,C,b]),i.useEffect(()=>{o.current.insideReactTree=!1},[o,A,d]);let D=i.useMemo(()=>({onKeyDown:v,..._&&{[e0[h]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==h&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[v,r,_,h]),L=i.useMemo(()=>({onKeyDown:v,onMouseDown(){I.current=!0},onMouseUp(){I.current=!0},[e1[d]]:()=>{o.current.insideReactTree=!0}}),[v,d,o]);return i.useMemo(()=>l?{reference:D,floating:L}:{},[l,D,L])}function e6(e){void 0===e&&(e={});let{nodeId:t}=e,n=function(e){let{open:t=!1,onOpenChange:n,elements:r}=e,s=eh(),a=i.useRef({}),[o]=i.useState(()=>ef()),l=null!=em(),[u,c]=i.useState(r.reference),d=X((e,t,i)=>{a.current.openEvent=e?t:void 0,o.emit("openchange",{open:e,event:t,reason:i,nested:l}),null==n||n(e,t,i)}),_=i.useMemo(()=>({setPositionReference:c}),[]),h=i.useMemo(()=>({reference:u||r.reference||null,floating:r.floating||null,domReference:r.reference}),[u,r.reference,r.floating]);return i.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:h,events:o,floatingId:s,refs:_}),[t,d,h,o,s,_])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,a=r.elements,[o,l]=i.useState(null),[u,c]=i.useState(null),d=(null==a?void 0:a.domReference)||o,_=i.useRef(null),h=i.useContext(eE);z(()=>{d&&(_.current=d)},[d]);let f=(0,ea.we)({...e,elements:{...a,...u&&{reference:u}}}),p=i.useCallback(e=>{let t=(0,s.vq)(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),E=i.useCallback(e=>{((0,s.vq)(e)||null===e)&&(_.current=e,l(e)),((0,s.vq)(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!(0,s.vq)(e))&&f.refs.setReference(e)},[f.refs]),m=i.useMemo(()=>({...f.refs,setReference:E,setPositionReference:p,domReference:_}),[f.refs,E,p]),g=i.useMemo(()=>({...f.elements,domReference:d}),[f.elements,d]),A=i.useMemo(()=>({...f,...r,refs:m,elements:g,nodeId:t}),[f,m,g,t,r]);return z(()=>{r.dataRef.current.floatingContext=A;let e=null==h?void 0:h.nodesRef.current.find(e=>e.id===t);e&&(e.context=A)}),i.useMemo(()=>({...f,context:A,refs:m,elements:g}),[f,m,g,A])}function e4(e,t,n){let i=new Map,r="item"===n,s=e;if(r&&e){let{[eo]:t,[el]:n,...i}=e;s=i}return{..."floating"===n&&{tabIndex:-1,"data-floating-ui-focusable":""},...s,...t.map(t=>{let i=t?t[n]:null;return"function"==typeof i?e?i(e):null:i}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,s]=t;if(!(r&&[eo,el].includes(n)))if(0===n.indexOf("on")){if(i.has(n)||i.set(n,[]),"function"==typeof s){var a;null==(a=i.get(n))||a.push(s),e[n]=function(){for(var e,t=arguments.length,r=Array(t),s=0;s<t;s++)r[s]=arguments[s];return null==(e=i.get(n))?void 0:e.map(e=>e(...r)).find(e=>void 0!==e)}}}else e[n]=s}),e),{})}}function e5(e){void 0===e&&(e=[]);let t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),s=i.useCallback(t=>e4(t,e,"reference"),t),a=i.useCallback(t=>e4(t,e,"floating"),n),o=i.useCallback(t=>e4(t,e,"item"),r);return i.useMemo(()=>({getReferenceProps:s,getFloatingProps:a,getItemProps:o}),[s,a,o])}let e7=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function e8(e,t){return"function"==typeof e?e(t):e}function e9(e,t){void 0===t&&(t={});let{initial:n={opacity:0},open:r,close:s,common:a,duration:o=250}=t,l=e.placement,u=l.split("-")[0],c=i.useMemo(()=>({side:u,placement:l}),[u,l]),d="number"==typeof o,_=(d?o:o.open)||0,h=(d?o:o.close)||0,[f,p]=i.useState(()=>({...e8(a,c),...e8(n,c)})),{isMounted:E,status:m}=function(e,t){void 0===t&&(t={});let{open:n,elements:{floating:r}}=e,{duration:s=250}=t,a=("number"==typeof s?s:s.close)||0,[o,l]=i.useState("unmounted"),u=function(e,t){let[n,r]=i.useState(e);return e&&!n&&r(!0),i.useEffect(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,a);return u||"close"!==o||l("unmounted"),z(()=>{if(r){if(n){l("initial");let e=requestAnimationFrame(()=>{es.flushSync(()=>{l("open")})});return()=>{cancelAnimationFrame(e)}}l("close")}},[n,r]),{isMounted:u,status:o}}(e,{duration:o}),g=q(n),A=q(r),I=q(s),T=q(a);return z(()=>{let e=e8(g.current,c),t=e8(I.current,c),n=e8(T.current,c),i=e8(A.current,c)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===m&&p(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===m&&p({transitionProperty:Object.keys(i).map(e7).join(","),transitionDuration:_+"ms",...n,...i}),"close"===m){let i=t||e;p({transitionProperty:Object.keys(i).map(e7).join(","),transitionDuration:h+"ms",...n,...i})}},[h,I,g,A,T,_,m,c]),{isMounted:E,styles:f}}function te(e,t){let[n,i]=e,r=!1,s=t.length;for(let e=0,a=s-1;e<s;a=e++){let[s,o]=t[e]||[0,0],[l,u]=t[a]||[0,0];o>=i!=u>=i&&n<=(l-s)*(i-o)/(u-o)+s&&(r=!r)}return r}function tt(e){void 0===e&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:i=!0}=e,r={current:-1},a=!1,o=null,l=null,u="u">typeof performance?performance.now():0,c=e=>{let{x:n,y:c,placement:d,elements:_,onClose:h,nodeId:f,tree:p}=e;return function(e){function E(){eS(r),h()}if(eS(r),!_.domReference||!_.floating||null==d||null==n||null==c)return;let{clientX:m,clientY:g}=e,A=[m,g],I="composedPath"in e?e.composedPath()[0]:e.target,T="mouseleave"===e.type,S=eb(_.floating,I),y=eb(_.domReference,I),C=_.domReference.getBoundingClientRect(),N=_.floating.getBoundingClientRect(),v=d.split("-")[0],R=n>N.right-N.width/2,O=c>N.bottom-N.height/2,b=A[0]>=C.x&&A[0]<=C.x+C.width&&A[1]>=C.y&&A[1]<=C.y+C.height,D=N.width>C.width,L=N.height>C.height,w=(D?C:N).left,M=(D?C:N).right,P=(L?C:N).top,x=(L?C:N).bottom;if(S&&(a=!0,!T))return;if(y&&(a=!1),y&&!T){a=!0;return}if(T&&(0,s.vq)(e.relatedTarget)&&eb(_.floating,e.relatedTarget)||p&&function e(t,n,i){return void 0===i&&(i=!0),t.filter(e=>{var t;return e.parentId===n&&(!i||(null==(t=e.context)?void 0:t.open))}).flatMap(n=>[n,...e(t,n.id,i)])}(p.nodesRef.current,f).length)return;if("top"===v&&c>=C.bottom-1||"bottom"===v&&c<=C.top+1||"left"===v&&n>=C.right-1||"right"===v&&n<=C.left+1)return E();let k=[];switch(v){case"top":k=[[w,C.top+1],[w,N.bottom-1],[M,N.bottom-1],[M,C.top+1]];break;case"bottom":k=[[w,N.top+1],[w,C.bottom-1],[M,C.bottom-1],[M,N.top+1]];break;case"left":k=[[N.right-1,x],[N.right-1,P],[C.left+1,P],[C.left+1,x]];break;case"right":k=[[C.right-1,x],[C.right-1,P],[N.left+1,P],[N.left+1,x]]}if(!te([m,g],k)){if(a&&!b)return E();if(!T&&i){let t=function(e,t){let n=performance.now(),i=n-u;if(null===o||null===l||0===i)return o=e,l=t,u=n,null;let r=e-o,s=t-l,a=Math.sqrt(r*r+s*s);return o=e,l=t,u=n,a/i}(e.clientX,e.clientY);if(null!==t&&t<.1)return E()}te([m,g],function(e){let[n,i]=e;switch(v){case"top":{let e=[[N.left,R||D?N.bottom-t:N.top],[N.right,R?D?N.bottom-t:N.top:N.bottom-t]];return[[D?n+t/2:R?n+4*t:n-4*t,i+t+1],[D?n-t/2:R?n+4*t:n-4*t,i+t+1],...e]}case"bottom":{let e=[[N.left,R||D?N.top+t:N.bottom],[N.right,R?D?N.top+t:N.bottom:N.top+t]];return[[D?n+t/2:R?n+4*t:n-4*t,i-t],[D?n-t/2:R?n+4*t:n-4*t,i-t],...e]}case"left":return[[O||L?N.right-t:N.left,N.top],[O?L?N.right-t:N.left:N.right-t,N.bottom],[n+t+1,L?i+t/2:O?i+4*t:i-4*t],[n+t+1,L?i-t/2:O?i+4*t:i-4*t]];case"right":{let e=[[O||L?N.left+t:N.right,N.top],[O?L?N.left+t:N.right:N.left+t,N.bottom]];return[[n-t,L?i+t/2:O?i+4*t:i-4*t],[n-t,L?i-t/2:O?i+4*t:i-4*t],...e]}}}([n,c]))?!a&&i&&(r.current=window.setTimeout(E,40)):E()}}};return c.__options={blockPointerEvents:n},c}}