File "index.js"
Full Path: /home/fresvfqn/waterdamagerestorationandrepairsmithtown.com/wp-content/plugins/surerank/build/vendor-77ff0bac/index.js
File size: 53.8 KB
MIME-type: text/plain
Charset: utf-8
"use strict";(globalThis.webpackChunksurerank=globalThis.webpackChunksurerank||[]).push([[426],{34743:(e,t,n)=>{n.d(t,{BN:()=>v,Ej:()=>g,RK:()=>h,UE:()=>b,UU:()=>p,cY:()=>m,we:()=>f});var r=n(46885),o=n(51609),u=n(75795),c="undefined"!==typeof document?o.useLayoutEffect:function(){};function i(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if("function"===typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"===typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!i(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!i(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function l(e){return"undefined"===typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s(e,t){const n=l(e);return Math.round(t*n)/n}function a(e){const t=o.useRef(e);return c(()=>{t.current=e}),t}function f(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:f=[],platform:d,elements:{reference:m,floating:v}={},transform:p=!0,whileElementsMounted:g,open:h}=e,[b,y]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[w,E]=o.useState(f);i(w,f)||E(f);const[R,x]=o.useState(null),[k,M]=o.useState(null),I=o.useCallback(e=>{e!==O.current&&(O.current=e,x(e))},[]),C=o.useCallback(e=>{e!==S.current&&(S.current=e,M(e))},[]),T=m||R,L=v||k,O=o.useRef(null),S=o.useRef(null),P=o.useRef(b),A=null!=g,D=a(g),N=a(d),q=a(h),F=o.useCallback(()=>{if(!O.current||!S.current)return;const e={placement:t,strategy:n,middleware:w};N.current&&(e.platform=N.current),(0,r.rD)(O.current,S.current,e).then(e=>{const t={...e,isPositioned:!1!==q.current};K.current&&!i(P.current,t)&&(P.current=t,u.flushSync(()=>{y(t)}))})},[w,t,n,N,q]);c(()=>{!1===h&&P.current.isPositioned&&(P.current.isPositioned=!1,y(e=>({...e,isPositioned:!1})))},[h]);const K=o.useRef(!1);c(()=>(K.current=!0,()=>{K.current=!1}),[]),c(()=>{if(T&&(O.current=T),L&&(S.current=L),T&&L){if(D.current)return D.current(T,L,F);F()}},[T,L,F,D,A]);const j=o.useMemo(()=>({reference:O,floating:S,setReference:I,setFloating:C}),[I,C]),_=o.useMemo(()=>({reference:T,floating:L}),[T,L]),W=o.useMemo(()=>{const e={position:n,left:0,top:0};if(!_.floating)return e;const t=s(_.floating,b.x),r=s(_.floating,b.y);return p?{...e,transform:"translate("+t+"px, "+r+"px)",...l(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,p,_.floating,b.x,b.y]);return o.useMemo(()=>({...b,update:F,refs:j,elements:_,floatingStyles:W}),[b,F,j,_,W])}const d=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:o}="function"===typeof e?e(t):e;return n&&{}.hasOwnProperty.call(n,"current")?null!=n.current?(0,r.UE)({element:n.current,padding:o}).fn(t):{}:n?(0,r.UE)({element:n,padding:o}).fn(t):{}}}),m=(e,t)=>({...(0,r.cY)(e),options:[e,t]}),v=(e,t)=>({...(0,r.BN)(e),options:[e,t]}),p=(e,t)=>({...(0,r.UU)(e),options:[e,t]}),g=(e,t)=>({...(0,r.Ej)(e),options:[e,t]}),h=(e,t)=>({...(0,r.RK)(e),options:[e,t]}),b=(e,t)=>({...d(e),options:[e,t]})},83505:(e,t,n)=>{n.d(t,{ie:()=>J,s3:()=>_e,ph:()=>Y,zR:()=>Ue,XF:()=>Se,iB:()=>gt,kp:()=>ze,s9:()=>$e,we:()=>Ge,iQ:()=>Je,Mk:()=>ie,bv:()=>nt,rm:()=>z,C1:()=>lt,It:()=>at,DL:()=>mt,lY:()=>vt});var r=n(51609),o=n.t(r,2),u=n(86635);function c(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function i(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&(0,u.Ng)(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function l(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function s(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function a(e){return!(0!==e.mozInputSource||!e.isTrusted)||(m()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function f(e){return!s().includes("jsdom/")&&(!m()&&0===e.width&&0===e.height||m()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function d(){return/apple/i.test(navigator.vendor)}function m(){const e=/android/i;return e.test(l())||e.test(s())}function v(){return l().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function p(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function g(e){return(null==e?void 0:e.ownerDocument)||document}function h(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function b(e){return"composedPath"in e?e.composedPath()[0]:e.target}const y="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function w(e){return(0,u.sb)(e)&&e.matches(y)}function E(e){e.preventDefault(),e.stopPropagation()}function R(e){return!!e&&"combobox"===e.getAttribute("role")&&w(e)}var x=n(97193),k=n(49054),M=n(75795),I=n(34743);const C={...o},T=C.useInsertionEffect||(e=>e());function L(e){const t=r.useRef(()=>{});return T(()=>{t.current=e}),r.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)},[])}const O="ArrowUp",S="ArrowDown",P="ArrowLeft",A="ArrowRight";function D(e,t,n){return Math.floor(e/t)!==n}function N(e,t){return t<0||t>=e.current.length}function q(e,t){return K(e,{disabledIndices:t})}function F(e,t){return K(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function K(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{i+=r?-u:u}while(i>=0&&i<=c.length-1&&W(c,i,o));return i}function j(e,t,n,r,o){if(-1===e)return-1;const u=n.indexOf(e),c=t[e];switch(o){case"tl":return u;case"tr":return c?u+c.width-1:u;case"bl":return c?u+(c.height-1)*r:u;case"br":return n.lastIndexOf(e)}}function _(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function W(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}var B="undefined"!==typeof document?r.useLayoutEffect:r.useEffect;function U(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const H=r.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Y(e){const{children:t,elementsRef:n,labelsRef:o}=e,[u,c]=r.useState(()=>new Map),i=r.useCallback(e=>{c(t=>new Map(t).set(e,null))},[]),l=r.useCallback(e=>{c(t=>{const n=new Map(t);return n.delete(e),n})},[]);return B(()=>{const e=new Map(u);Array.from(e.keys()).sort(U).forEach((t,n)=>{e.set(t,n)}),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(u,e)||c(e)},[u]),r.createElement(H.Provider,{value:r.useMemo(()=>({register:i,unregister:l,map:u,elementsRef:n,labelsRef:o}),[i,l,u,n,o])},t)}function z(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:o,map:u,elementsRef:c,labelsRef:i}=r.useContext(H),[l,s]=r.useState(null),a=r.useRef(null),f=r.useCallback(e=>{var n;a.current=e,null!==l&&(c.current[l]=e,i)&&(i.current[l]=void 0!==t?t:null!=(n=null==e?void 0:e.textContent)?n:null)},[l,c,i,t]);return B(()=>{const e=a.current;if(e)return n(e),()=>{o(e)}},[n,o]),B(()=>{const e=a.current?u.get(a.current):null;null!=e&&s(e)},[u]),r.useMemo(()=>({ref:f,index:null==l?-1:l}),[l,f])}function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(this,arguments)}let X=!1,Z=0;const $=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Z++,G=C.useId||function(){const[e,t]=r.useState(()=>X?$():void 0);return B(()=>{null==e&&t($())},[]),r.useEffect(()=>{X=!0},[]),e},J=r.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:o},middlewareData:{arrow:c,shift:i}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:f=0,staticOffset:d,stroke:m,d:v,style:{transform:p,...g}={},...h}=e,b=G(),[y,w]=r.useState(!1);if(B(()=>{o&&"rtl"===(0,u.L9)(o).direction&&w(!0)},[o]),!o)return null;const[E,R]=n.split("-"),x="top"===E||"bottom"===E;let k=d;(x&&null!=i&&i.x||!x&&null!=i&&i.y)&&(k=null);const M=2*f,I=M/2,C=l/2*(a/-8+1),T=s/2*a/4,L=!!v,O=k&&"end"===R?"bottom":"top";let S=k&&"end"===R?"right":"left";k&&y&&(S="end"===R?"left":"right");const P=null!=(null==c?void 0:c.x)?k||c.x:"",A=null!=(null==c?void 0:c.y)?k||c.y:"",D=v||"M0,0 H"+l+" L"+(l-C)+","+(s-T)+" Q"+l/2+","+s+" "+C+","+(s-T)+" Z",N={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[E];return r.createElement("svg",V({},h,{"aria-hidden":!0,ref:t,width:L?l:l+M,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[S]:P,[O]:A,[E]:x||L?"100%":"calc(100% - "+M/2+"px)",transform:[N,p].filter(e=>!!e).join(" "),...g}}),M>0&&r.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:m,strokeWidth:M+(v?0:1),d:D}),r.createElement("path",{stroke:M&&!v?h.fill:"none",d:D}),r.createElement("clipPath",{id:b},r.createElement("rect",{x:-I,y:I*(L?-1:1),width:l+M,height:l})))}),Q=r.createContext(null),ee=r.createContext(null),te=()=>{var e;return(null==(e=r.useContext(Q))?void 0:e.id)||null},ne=()=>r.useContext(ee);function re(e){return"data-floating-ui-"+e}function oe(e){const t=(0,r.useRef)(e);return B(()=>{t.current=e}),t}const ue=re("safe-polygon");function ce(e,t,n){return n&&!p(n)?0:"number"===typeof e?e:null==e?void 0:e[t]}function ie(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:c,events:l,elements:s}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:m=!1,restMs:v=0,move:h=!0}=t,b=ne(),y=te(),w=oe(d),E=oe(f),R=oe(n),x=r.useRef(),k=r.useRef(-1),M=r.useRef(),I=r.useRef(-1),C=r.useRef(!0),T=r.useRef(!1),O=r.useRef(()=>{}),S=r.useRef(!1),P=r.useCallback(()=>{var e;const t=null==(e=c.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t},[c]);r.useEffect(()=>{if(a)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(k.current),clearTimeout(I.current),C.current=!0,S.current=!1)}},[a,l]),r.useEffect(()=>{if(!a)return;if(!w.current)return;if(!n)return;function e(e){P()&&o(!1,e,"hover")}const t=g(s.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[s.floating,n,o,a,w,P]);const A=r.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=ce(E.current,"close",x.current);r&&!M.current?(clearTimeout(k.current),k.current=window.setTimeout(()=>o(!1,e,n),r)):t&&(clearTimeout(k.current),o(!1,e,n))},[E,o]),D=L(()=>{O.current(),M.current=void 0}),N=L(()=>{if(T.current){const e=g(s.floating).body;e.style.pointerEvents="",e.removeAttribute(ue),T.current=!1}}),q=L(()=>!!c.current.openEvent&&["click","mousedown"].includes(c.current.openEvent.type));r.useEffect(()=>{if(a&&(0,u.vq)(s.domReference)){var e;const o=s.domReference;return n&&o.addEventListener("mouseleave",l),null==(e=s.floating)||e.addEventListener("mouseleave",l),h&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",r),()=>{var e;n&&o.removeEventListener("mouseleave",l),null==(e=s.floating)||e.removeEventListener("mouseleave",l),h&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",r)}}function t(e){if(clearTimeout(k.current),C.current=!1,m&&!p(x.current)||v>0&&!ce(E.current,"open"))return;const t=ce(E.current,"open",x.current);t?k.current=window.setTimeout(()=>{R.current||o(!0,e,"hover")},t):n||o(!0,e,"hover")}function r(e){if(q())return;O.current();const t=g(s.floating);if(clearTimeout(I.current),S.current=!1,w.current&&c.current.floatingContext){n||clearTimeout(k.current),M.current=w.current({...c.current.floatingContext,tree:b,x:e.clientX,y:e.clientY,onClose(){N(),D(),q()||A(e,!0,"safe-polygon")}});const r=M.current;return t.addEventListener("mousemove",r),void(O.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==x.current||!i(s.floating,e.relatedTarget))&&A(e)}function l(e){q()||c.current.floatingContext&&(null==w.current||w.current({...c.current.floatingContext,tree:b,x:e.clientX,y:e.clientY,onClose(){N(),D(),q()||A(e)}})(e))}},[s,a,e,m,v,h,A,D,N,o,n,R,b,E,w,c,q]),B(()=>{var e;if(a&&n&&null!=(e=w.current)&&e.__options.blockPointerEvents&&P()){T.current=!0;const e=s.floating;if((0,u.vq)(s.domReference)&&e){var t;const n=g(s.floating).body;n.setAttribute(ue,"");const r=s.domReference,o=null==b||null==(t=b.nodesRef.current.find(e=>e.id===y))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[a,n,y,s,b,w,P]),B(()=>{n||(x.current=void 0,S.current=!1,D(),N())},[n,D,N]),r.useEffect(()=>()=>{D(),clearTimeout(k.current),clearTimeout(I.current),N()},[a,s.domReference,D,N]);const F=r.useMemo(()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function r(){C.current||R.current||o(!0,t,"hover")}m&&!p(x.current)||n||0===v||S.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(I.current),"touch"===x.current?r():(S.current=!0,I.current=window.setTimeout(r,v)))}}},[m,o,n,R,v]),K=r.useMemo(()=>({onMouseEnter(){clearTimeout(k.current)},onMouseLeave(e){q()||A(e.nativeEvent,!1)}}),[A,q]);return r.useMemo(()=>a?{reference:F,floating:K}:{},[a,F,K])}let le=0;function se(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(le);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():le=requestAnimationFrame(u)}function ae(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),r=n;for(;r.length;)r=e.filter(e=>{var t;return null==(t=r)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(r);return n}let fe=new WeakMap,de=new WeakSet,me={},ve=0;const pe=()=>"undefined"!==typeof HTMLElement&&"inert"in HTMLElement.prototype,ge=e=>e&&(e.host||ge(e.parentNode)),he=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=ge(t);return e.contains(n)?n:null}).filter(e=>null!=e);function be(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=g(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",c=r?"inert":n?"aria-hidden":null,i=he(t,e),l=new Set,s=new Set(i),a=[];me[o]||(me[o]=new WeakMap);const f=me[o];return i.forEach(function e(t){t&&!l.has(t)&&(l.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!s.has(t)&&[].forEach.call(t.children,t=>{if("script"!==(0,u.mq)(t))if(l.has(t))e(t);else{const e=c?t.getAttribute(c):null,n=null!==e&&"false"!==e,r=(fe.get(t)||0)+1,u=(f.get(t)||0)+1;fe.set(t,r),f.set(t,u),a.push(t),1===r&&n&&de.add(t),1===u&&t.setAttribute(o,""),!n&&c&&t.setAttribute(c,"true")}})}(t),l.clear(),ve++,()=>{a.forEach(e=>{const t=(fe.get(e)||0)-1,n=(f.get(e)||0)-1;fe.set(e,t),f.set(e,n),t||(!de.has(e)&&c&&e.removeAttribute(c),de.delete(e)),n||e.removeAttribute(o)}),ve--,ve||(fe=new WeakMap,fe=new WeakMap,de=new WeakSet,me={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const ye=()=>({getShadowRoot:!0,displayCheck:"function"===typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function we(e,t){const n=(0,k.Kr)(e,ye());"prev"===t&&n.reverse();const r=n.indexOf(c(g(e)));return n.slice(r+1)[0]}function Ee(){return we(document.body,"next")}function Re(){return we(document.body,"prev")}function xe(e,t){const n=e.relatedTarget;return!n||!i(t||e.currentTarget,n)}function ke(e){(0,k.Kr)(e,ye()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function Me(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const Ie={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Ce(e){"Tab"===e.key&&clearTimeout(void 0)}const Te=r.forwardRef(function(e,t){const[n,o]=r.useState();B(()=>(d()&&o("button"),document.addEventListener("keydown",Ce),()=>{document.removeEventListener("keydown",Ce)}),[]);const u={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[re("focus-guard")]:"",style:Ie};return r.createElement("span",V({},e,u))}),Le=r.createContext(null),Oe=re("portal");function Se(e){const{children:t,id:n,root:o,preserveTabOrder:c=!0}=e,i=function(e){void 0===e&&(e={});const{id:t,root:n}=e,o=G(),c=Pe(),[i,l]=r.useState(null),s=r.useRef(null);return B(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{s.current=null})},[i]),B(()=>{if(!o)return;if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=o,n.setAttribute(Oe,""),e.appendChild(n),s.current=n,l(n)},[t,o]),B(()=>{if(null===n)return;if(!o)return;if(s.current)return;let e=n||(null==c?void 0:c.portalNode);e&&!(0,u.vq)(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const i=document.createElement("div");i.id=o,i.setAttribute(Oe,""),e=r||e,e.appendChild(i),s.current=i,l(i)},[t,n,o,c]),i}({id:n,root:o}),[l,s]=r.useState(null),a=r.useRef(null),f=r.useRef(null),d=r.useRef(null),m=r.useRef(null),v=null==l?void 0:l.modal,p=null==l?void 0:l.open,g=!!l&&!l.modal&&l.open&&c&&!(!o&&!i);return r.useEffect(()=>{if(i&&c&&!v)return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){i&&xe(e)&&("focusin"===e.type?Me:ke)(i)}},[i,c,v]),r.useEffect(()=>{i&&(p||Me(i))},[p,i]),r.createElement(Le.Provider,{value:r.useMemo(()=>({preserveTabOrder:c,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:i,setFocusManagerState:s}),[c,i])},g&&i&&r.createElement(Te,{"data-type":"outside",ref:a,onFocus:e=>{if(xe(e,i)){var t;null==(t=d.current)||t.focus()}else{const e=Re()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),g&&i&&r.createElement("span",{"aria-owns":i.id,style:Ie}),i&&M.createPortal(t,i),g&&i&&r.createElement(Te,{"data-type":"outside",ref:f,onFocus:e=>{if(xe(e,i)){var t;null==(t=m.current)||t.focus()}else{const t=Ee()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Pe=()=>r.useContext(Le),Ae="data-floating-ui-focusable";function De(e){return e?e.hasAttribute(Ae)?e:e.querySelector("["+Ae+"]")||e:null}const Ne=20;let qe=[];function Fe(e){qe=qe.filter(e=>e.isConnected);let t=e;if(t&&"body"!==(0,u.mq)(t)){if(!(0,k.AO)(t,ye())){const e=(0,k.Kr)(t,ye())[0];e&&(t=e)}qe.push(t),qe.length>Ne&&(qe=qe.slice(-Ne))}}function Ke(){return qe.slice().reverse().find(e=>e.isConnected)}const je=r.forwardRef(function(e,t){return r.createElement("button",V({},e,{type:"button",ref:t,tabIndex:-1,style:Ie}))});function _e(e){const{context:t,children:n,disabled:o=!1,order:l=["content"],guards:s=!0,initialFocus:d=0,returnFocus:m=!0,restoreFocus:v=!1,modal:p=!0,visuallyHiddenDismiss:h=!1,closeOnFocusOut:y=!0}=e,{open:w,refs:x,nodeId:M,onOpenChange:I,events:C,dataRef:T,elements:{domReference:O,floating:S}}=t,P="number"===typeof d&&d<0,A=R(O)&&P,D=!pe()||s,N=oe(l),q=oe(d),F=oe(m),K=ne(),j=Pe(),_=r.useRef(null),W=r.useRef(null),U=r.useRef(!1),H=r.useRef(!1),Y=r.useRef(-1),z=null!=j,V=De(S),X=L(function(e){return void 0===e&&(e=V),e?(0,k.Kr)(e,ye()):[]}),Z=L(e=>{const t=X(e);return N.current.map(e=>O&&"reference"===e?O:V&&"floating"===e?V:t).filter(Boolean).flat()});function $(e){return!o&&h&&p?r.createElement(je,{ref:"start"===e?_:W,onClick:e=>I(!1,e.nativeEvent)},"string"===typeof h?h:"Dismiss"):null}r.useEffect(()=>{if(o)return;if(!p)return;function e(e){if("Tab"===e.key){i(V,c(g(V)))&&0===X().length&&!A&&E(e);const t=Z(),n=b(e);"reference"===N.current[0]&&n===O&&(E(e),se(e.shiftKey?t[t.length-1]:t[1])),"floating"===N.current[1]&&n===V&&e.shiftKey&&(E(e),se(t[0]))}}const t=g(V);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[o,O,V,p,N,A,X,Z]),r.useEffect(()=>{if(!o&&S)return S.addEventListener("focusin",e),()=>{S.removeEventListener("focusin",e)};function e(e){const t=b(e),n=X().indexOf(t);-1!==n&&(Y.current=n)}},[o,S,X]),r.useEffect(()=>{if(!o&&y)return S&&(0,u.sb)(O)?(O.addEventListener("focusout",t),O.addEventListener("pointerdown",e),S.addEventListener("focusout",t),()=>{O.removeEventListener("focusout",t),O.removeEventListener("pointerdown",e),S.removeEventListener("focusout",t)}):void 0;function e(){H.current=!0,setTimeout(()=>{H.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(i(O,t)||i(S,t)||i(t,S)||i(null==j?void 0:j.portalNode,t)||null!=t&&t.hasAttribute(re("focus-guard"))||K&&(ae(K.nodesRef.current,M).find(e=>{var n,r;return i(null==(n=e.context)?void 0:n.elements.floating,t)||i(null==(r=e.context)?void 0:r.elements.domReference,t)})||function(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(K.nodesRef.current,M).find(e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t})));if(v&&n&&c(g(V))===g(V).body){(0,u.sb)(V)&&V.focus();const e=Y.current,t=X(),n=t[e]||t[t.length-1]||V;(0,u.sb)(n)&&n.focus()}!A&&p||!t||!n||H.current||t===Ke()||(U.current=!0,I(!1,e,"focus-out"))})}},[o,O,S,V,p,M,K,j,I,y,v,X,A]),r.useEffect(()=>{var e;if(o)return;const t=Array.from((null==j||null==(e=j.portalNode)?void 0:e.querySelectorAll("["+re("portal")+"]"))||[]);if(S){const e=[S,...t,_.current,W.current,N.current.includes("reference")||A?O:null].filter(e=>null!=e),n=p||A?be(e,D,!D):be(e);return()=>{n()}}},[o,O,S,p,N,j,A,D]),B(()=>{if(o||!(0,u.sb)(V))return;const e=c(g(V));queueMicrotask(()=>{const t=Z(V),n=q.current,r=("number"===typeof n?t[n]:n.current)||V,o=i(V,e);P||o||!w||se(r,{preventScroll:r===V})})},[o,w,V,P,Z,q]),B(()=>{if(o||!V)return;let e=!1;const t=g(V),n=c(t);let r=T.current.openEvent;function l(t){let{open:n,reason:o,event:u,nested:c}=t;n&&(r=u),"escape-key"===o&&x.domReference.current&&Fe(x.domReference.current),"hover"===o&&"mouseleave"===u.type&&(U.current=!0),"outside-press"===o&&(c?(U.current=!1,e=!0):U.current=!(a(u)||f(u)))}Fe(n),C.on("openchange",l);const s=t.createElement("span");return s.setAttribute("tabindex","-1"),s.setAttribute("aria-hidden","true"),Object.assign(s.style,Ie),z&&O&&O.insertAdjacentElement("afterend",s),()=>{C.off("openchange",l);const n=c(t),o=i(S,n)||K&&ae(K.nodesRef.current,M).some(e=>{var t;return i(null==(t=e.context)?void 0:t.elements.floating,n)});(o||r&&["click","mousedown"].includes(r.type))&&x.domReference.current&&Fe(x.domReference.current);const a="boolean"===typeof F.current?Ke()||s:F.current.current||s;queueMicrotask(()=>{F.current&&!U.current&&(0,u.sb)(a)&&(a===n||n===t.body||o)&&a.focus({preventScroll:e}),s.remove()})}},[o,S,V,F,T,x,C,K,M,z,O]),r.useEffect(()=>{queueMicrotask(()=>{U.current=!1})},[o]),B(()=>{if(!o&&j)return j.setFocusManagerState({modal:p,closeOnFocusOut:y,open:w,onOpenChange:I,refs:x}),()=>{j.setFocusManagerState(null)}},[o,j,p,w,I,x,y]),B(()=>{if(o)return;if(!V)return;if("function"!==typeof MutationObserver)return;if(P)return;const e=()=>{const e=V.getAttribute("tabindex"),t=X(),n=c(g(S)),r=t.indexOf(n);-1!==r&&(Y.current=r),N.current.includes("floating")||n!==x.domReference.current&&0===t.length?"0"!==e&&V.setAttribute("tabindex","0"):"-1"!==e&&V.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(V,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[o,S,V,x,N,X,P]);const G=!o&&D&&(!p||!A)&&(z||p);return r.createElement(r.Fragment,null,G&&r.createElement(Te,{"data-type":"inside",ref:null==j?void 0:j.beforeInsideRef,onFocus:e=>{if(p){const e=Z();se("reference"===l[0]?e[0]:e[e.length-1])}else if(null!=j&&j.preserveTabOrder&&j.portalNode)if(U.current=!1,xe(e,j.portalNode)){const e=Ee()||O;null==e||e.focus()}else{var t;null==(t=j.beforeOutsideRef.current)||t.focus()}}}),!A&&$("start"),n,$("end"),G&&r.createElement(Te,{"data-type":"inside",ref:null==j?void 0:j.afterInsideRef,onFocus:e=>{if(p)se(Z()[0]);else if(null!=j&&j.preserveTabOrder&&j.portalNode)if(y&&(U.current=!0),xe(e,j.portalNode)){const e=Re()||O;null==e||e.focus()}else{var t;null==(t=j.afterOutsideRef.current)||t.focus()}}}))}let We=0,Be=()=>{};const Ue=r.forwardRef(function(e,t){const{lockScroll:n=!1,...o}=e;return B(()=>{if(n)return We++,1===We&&(Be=function(){const e=/iP(hone|ad|od)|iOS/.test(l()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,u=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var c,i;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,n=(null==(i=window.visualViewport)?void 0:i.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(u-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,u))}}()),()=>{We--,0===We&&Be()}},[n]),r.createElement("div",V({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function He(e){return(0,u.sb)(e.target)&&"BUTTON"===e.target.tagName}function Ye(e){return w(e)}function ze(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:u,elements:{domReference:c}}=e,{enabled:i=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0,stickIfOpen:d=!0}=t,m=r.useRef(),v=r.useRef(!1),g=r.useMemo(()=>({onPointerDown(e){m.current=e.pointerType},onMouseDown(e){0===e.button&&"click"!==l&&(p(m.current,!0)&&a||(!n||!s||u.current.openEvent&&d&&"mousedown"!==u.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent,"click")):o(!1,e.nativeEvent,"click")))},onClick(e){const t=m.current;"mousedown"===l&&m.current?m.current=void 0:p(t,!0)&&a||o(!(n&&s&&(!u.current.openEvent||!d||"click"===u.current.openEvent.type)),e.nativeEvent,"click")},onKeyDown(e){m.current=void 0,e.defaultPrevented||!f||He(e)||(" "!==e.key||Ye(c)||(e.preventDefault(),v.current=!0),"Enter"===e.key&&o(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||He(e)||Ye(c)||" "===e.key&&v.current&&(v.current=!1,o(!n||!s,e.nativeEvent,"click"))}}),[u,c,l,a,f,o,n,d,s]);return r.useMemo(()=>i?{reference:g}:{},[i,g])}const Ve={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Xe={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ze=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 $e(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,elements:c,dataRef:l}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:v="pointerdown",ancestorScroll:p=!1,bubbles:y,capture:w}=t,E=ne(),R=L("function"===typeof f?f:()=>!1),x="function"===typeof f?R:f,k=r.useRef(!1),M=r.useRef(!1),{escapeKey:I,outsidePress:C}=Ze(y),{escapeKey:T,outsidePress:O}=Ze(w),S=r.useRef(!1),P=L(e=>{var t;if(!n||!s||!a||"Escape"!==e.key)return;if(S.current)return;const r=null==(t=l.current.floatingContext)?void 0:t.nodeId,u=E?ae(E.nodesRef.current,r):[];if(!I&&(e.stopPropagation(),u.length>0)){let e=!0;if(u.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),A=L(e=>{var t;const n=()=>{var t;P(e),null==(t=b(e))||t.removeEventListener("keydown",n)};null==(t=b(e))||t.addEventListener("keydown",n)}),D=L(e=>{var t;const n=k.current;k.current=!1;const r=M.current;if(M.current=!1,"click"===d&&r)return;if(n)return;if("function"===typeof x&&!x(e))return;const s=b(e),a="["+re("inert")+"]",f=g(c.floating).querySelectorAll(a);let m=(0,u.vq)(s)?s:null;for(;m&&!(0,u.eu)(m);){const e=(0,u.$4)(m);if((0,u.eu)(e)||!(0,u.vq)(e))break;m=e}if(f.length&&(0,u.vq)(s)&&!s.matches("html,body")&&!i(s,c.floating)&&Array.from(f).every(e=>!i(m,e)))return;if((0,u.sb)(s)&&F){const t=s.clientWidth>0&&s.scrollWidth>s.clientWidth,n=s.clientHeight>0&&s.scrollHeight>s.clientHeight;let r=n&&e.offsetX>s.clientWidth;if(n&&"rtl"===(0,u.L9)(s).direction&&(r=e.offsetX<=s.offsetWidth-s.clientWidth),r||t&&e.offsetY>s.clientHeight)return}const v=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=E&&ae(E.nodesRef.current,v).some(t=>{var n;return h(e,null==(n=t.context)?void 0:n.elements.floating)});if(h(e,c.floating)||h(e,c.domReference)||p)return;const y=E?ae(E.nodesRef.current,v):[];if(y.length>0){let e=!0;if(y.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}o(!1,e,"outside-press")}),N=L(e=>{var t;const n=()=>{var t;D(e),null==(t=b(e))||t.removeEventListener(d,n)};null==(t=b(e))||t.addEventListener(d,n)});r.useEffect(()=>{if(!n||!s)return;l.current.__escapeKeyBubbles=I,l.current.__outsidePressBubbles=C;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function r(){window.clearTimeout(e),S.current=!0}function i(){e=window.setTimeout(()=>{S.current=!1},(0,u.Tc)()?5:0)}const f=g(c.floating);a&&(f.addEventListener("keydown",T?A:P,T),f.addEventListener("compositionstart",r),f.addEventListener("compositionend",i)),x&&f.addEventListener(d,O?N:D,O);let m=[];return p&&((0,u.vq)(c.domReference)&&(m=(0,u.v9)(c.domReference)),(0,u.vq)(c.floating)&&(m=m.concat((0,u.v9)(c.floating))),!(0,u.vq)(c.reference)&&c.reference&&c.reference.contextElement&&(m=m.concat((0,u.v9)(c.reference.contextElement)))),m=m.filter(e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)}),m.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{a&&(f.removeEventListener("keydown",T?A:P,T),f.removeEventListener("compositionstart",r),f.removeEventListener("compositionend",i)),x&&f.removeEventListener(d,O?N:D,O),m.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[l,c,a,x,d,n,o,p,s,I,C,P,T,A,D,O,N]),r.useEffect(()=>{k.current=!1},[x,d]);const q=r.useMemo(()=>({onKeyDown:P,[Ve[v]]:e=>{m&&o(!1,e.nativeEvent,"reference-press")}}),[P,o,m,v]),F=r.useMemo(()=>({onKeyDown:P,onMouseDown(){M.current=!0},onMouseUp(){M.current=!0},[Xe[d]]:()=>{k.current=!0}}),[P,d]);return r.useMemo(()=>s?{reference:q,floating:F}:{},[s,q,F])}function Ge(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:o}=e,u=G(),c=r.useRef({}),[i]=r.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),l=null!=te(),[s,a]=r.useState(o.reference),f=L((e,t,r)=>{c.current.openEvent=e?t:void 0,i.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)}),d=r.useMemo(()=>({setPositionReference:a}),[]),m=r.useMemo(()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference}),[s,o.reference,o.floating]);return r.useMemo(()=>({dataRef:c,open:t,onOpenChange:f,elements:m,events:i,floatingId:u,refs:d}),[t,f,m,i,u,d])}({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,c=o.elements,[i,l]=r.useState(null),[s,a]=r.useState(null),f=(null==c?void 0:c.domReference)||i,d=r.useRef(null),m=ne();B(()=>{f&&(d.current=f)},[f]);const v=(0,I.we)({...e,elements:{...c,...s&&{reference:s}}}),p=r.useCallback(e=>{const t=(0,u.vq)(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),v.refs.setReference(t)},[v.refs]),g=r.useCallback(e=>{((0,u.vq)(e)||null===e)&&(d.current=e,l(e)),((0,u.vq)(v.refs.reference.current)||null===v.refs.reference.current||null!==e&&!(0,u.vq)(e))&&v.refs.setReference(e)},[v.refs]),h=r.useMemo(()=>({...v.refs,setReference:g,setPositionReference:p,domReference:d}),[v.refs,g,p]),b=r.useMemo(()=>({...v.elements,domReference:f}),[v.elements,f]),y=r.useMemo(()=>({...v,...o,refs:h,elements:b,nodeId:t}),[v,h,b,t,o]);return B(()=>{o.dataRef.current.floatingContext=y;const e=null==m?void 0:m.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),r.useMemo(()=>({...v,context:y,refs:h,elements:b}),[v,h,b,y])}function Je(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,events:l,dataRef:s,elements:a}=e,{enabled:m=!0,visibleOnly:p=!0}=t,h=r.useRef(!1),y=r.useRef(),E=r.useRef(!0);r.useEffect(()=>{if(!m)return;const e=(0,u.zk)(a.domReference);function t(){!n&&(0,u.sb)(a.domReference)&&a.domReference===c(g(a.domReference))&&(h.current=!0)}function r(){E.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}},[a.domReference,n,m]),r.useEffect(()=>{if(m)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(h.current=!0)}},[l,m]),r.useEffect(()=>()=>{clearTimeout(y.current)},[]);const R=r.useMemo(()=>({onPointerDown(e){f(e.nativeEvent)||(E.current=!1)},onMouseLeave(){h.current=!1},onFocus(e){if(h.current)return;const t=b(e.nativeEvent);if(p&&(0,u.vq)(t))try{if(d()&&v())throw Error();if(!t.matches(":focus-visible"))return}catch(n){if(!E.current&&!w(t))return}o(!0,e.nativeEvent,"focus")},onBlur(e){h.current=!1;const t=e.relatedTarget,n=e.nativeEvent,r=(0,u.vq)(t)&&t.hasAttribute(re("focus-guard"))&&"outside"===t.getAttribute("data-type");y.current=window.setTimeout(()=>{var e;const u=c(a.domReference?a.domReference.ownerDocument:document);(t||u!==a.domReference)&&(i(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,u)||i(a.domReference,u)||r||o(!1,n,"focus"))})}}),[s,a.domReference,o,p]);return r.useMemo(()=>m?{reference:R}:{},[m,R])}const Qe="active",et="selected";function tt(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[Qe]:t,[et]:n,...r}=e;u=r}return{..."floating"===n&&{tabIndex:-1,[Ae]:""},...u,...t.map(t=>{const r=t?t[n]:null;return"function"===typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,u]=t;var c;o&&[Qe,et].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"===typeof u&&(null==(c=r.get(n))||c.push(u),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=u)}),e):e,{})}}function nt(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),o=e.map(e=>null==e?void 0:e.item),u=r.useCallback(t=>tt(t,e,"reference"),t),c=r.useCallback(t=>tt(t,e,"floating"),n),i=r.useCallback(t=>tt(t,e,"item"),o);return r.useMemo(()=>({getReferenceProps:u,getFloatingProps:c,getItemProps:i}),[u,c,i])}let rt=!1;function ot(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ut(e,t){return ot(t,e===O||e===S,e===P||e===A)}function ct(e,t,n){return ot(t,e===S,n?e===P:e===A)||"Enter"===e||" "===e||""===e}function it(e,t,n){return ot(t,n?e===A:e===P,e===O)}function lt(e,t){const{open:n,onOpenChange:o,elements:l}=e,{listRef:s,activeIndex:m,onNavigate:p=()=>{},enabled:h=!0,selectedIndex:b=null,allowEscape:y=!1,loop:w=!1,nested:k=!1,rtl:M=!1,virtual:I=!1,focusItemOnOpen:C="auto",focusItemOnHover:T=!0,openOnArrowKeyDown:U=!0,disabledIndices:H,orientation:Y="vertical",cols:z=1,scrollItemIntoView:V=!0,virtualItemRef:X,itemSizes:Z,dense:$=!1}=t,G=oe(De(l.floating)),J=te(),Q=ne(),ee=L(p),re=R(l.domReference),ue=r.useRef(C),ce=r.useRef(null!=b?b:-1),ie=r.useRef(null),le=r.useRef(!0),fe=r.useRef(ee),de=r.useRef(!!l.floating),me=r.useRef(n),ve=r.useRef(!1),pe=r.useRef(!1),ge=oe(H),he=oe(n),be=oe(V),ye=oe(b),[we,Ee]=r.useState(),[Re,xe]=r.useState(),ke=L(function(e,t,n){function r(e){I?(Ee(e.id),null==Q||Q.events.emit("virtualfocus",e),X&&(X.current=e)):se(e,{preventScroll:!0,sync:!(!v()||!d())&&(rt||ve.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame(()=>{const u=e.current[t.current]||o;if(!u)return;o||r(u);const c=be.current;c&&Ie&&(n||!le.current)&&(null==u.scrollIntoView||u.scrollIntoView("boolean"===typeof c?{block:"nearest",inline:"nearest"}:c))})});B(()=>{document.createElement("div").focus({get preventScroll(){return rt=!0,!1}})},[]),B(()=>{h&&(n&&l.floating?ue.current&&null!=b&&(pe.current=!0,ce.current=b,ee(b)):de.current&&(ce.current=-1,fe.current(null)))},[h,n,l.floating,b,ee]),B(()=>{if(h&&n&&l.floating)if(null==m){if(ve.current=!1,null!=ye.current)return;if(de.current&&(ce.current=-1,ke(s,ce)),(!me.current||!de.current)&&ue.current&&(null!=ie.current||!0===ue.current&&null==ie.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(ce.current=null==ie.current||ct(ie.current,Y,M)||k?q(s,ge.current):F(s,ge.current),ie.current=null,ee(ce.current))};t()}}else N(s,m)||(ce.current=m,ke(s,ce,pe.current),pe.current=!1)},[h,n,l.floating,m,ye,k,s,Y,M,ee,ke,ge]),B(()=>{var e;if(!h||l.floating||!Q||I||!de.current)return;const t=Q.nodesRef.current,n=null==(e=t.find(e=>e.id===J))||null==(e=e.context)?void 0:e.elements.floating,r=c(g(l.floating)),o=t.some(e=>e.context&&i(e.context.elements.floating,r));n&&!o&&le.current&&n.focus({preventScroll:!0})},[h,l.floating,Q,J,I]),B(()=>{if(h&&Q&&I&&!J)return Q.events.on("virtualfocus",e),()=>{Q.events.off("virtualfocus",e)};function e(e){xe(e.id),X&&(X.current=e)}},[h,Q,I,J,X]),B(()=>{fe.current=ee,de.current=!!l.floating}),B(()=>{n||(ie.current=null)},[n]),B(()=>{me.current=n},[n]);const Me=null!=m,Ie=r.useMemo(()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&ee(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...T&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;le.current&&"touch"!==t&&(ce.current=-1,ke(s,ce),ee(null),I||se(G.current,{preventScroll:!0}))}}}},[n,G,ke,T,s,ee,I]),Ce=L(e=>{if(le.current=!1,ve.current=!0,229===e.which)return;if(!he.current&&e.currentTarget===G.current)return;if(k&&it(e.key,Y,M))return E(e),o(!1,e.nativeEvent,"list-navigation"),void((0,u.sb)(l.domReference)&&(I?null==Q||Q.events.emit("virtualfocus",l.domReference):l.domReference.focus()));const t=ce.current,r=q(s,H),i=F(s,H);if(re||("Home"===e.key&&(E(e),ce.current=r,ee(ce.current)),"End"===e.key&&(E(e),ce.current=i,ee(ce.current))),z>1){const t=Z||Array.from({length:s.current.length},()=>({width:1,height:1})),n=function(e,t,n){const r=[];let o=0;return e.forEach((e,u)=>{let{width:c,height:i}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<c;n++)for(let r=0;r<i;r++)e.push(o+n+r*t);o%t+c<=t&&e.every(e=>null==r[e])?(e.forEach(e=>{r[e]=u}),l=!0):o++}}),[...r]}(t,z,$),o=n.findIndex(e=>null!=e&&!W(s.current,e,H)),u=n.reduce((e,t,n)=>null==t||W(s.current,t,H)?e:n,-1),c=n[function(e,t){let{event:n,orientation:r,loop:o,rtl:u,cols:c,disabledIndices:i,minIndex:l,maxIndex:s,prevIndex:a,stopEvent:f=!1}=t,d=a;if(n.key===O){if(f&&E(n),-1===a)d=s;else if(d=K(e,{startingIndex:d,amount:c,decrement:!0,disabledIndices:i}),o&&(a-c<l||d<0)){const e=a%c,t=s%c,n=s-(t-e);d=t===e?s:t>e?n:n-c}N(e,d)&&(d=a)}if(n.key===S&&(f&&E(n),-1===a?d=l:(d=K(e,{startingIndex:a,amount:c,disabledIndices:i}),o&&a+c>s&&(d=K(e,{startingIndex:a%c-c,amount:c,disabledIndices:i}))),N(e,d)&&(d=a)),"both"===r){const t=(0,x.RI)(a/c);n.key===(u?P:A)&&(f&&E(n),a%c!==c-1?(d=K(e,{startingIndex:a,disabledIndices:i}),o&&D(d,c,t)&&(d=K(e,{startingIndex:a-a%c-1,disabledIndices:i}))):o&&(d=K(e,{startingIndex:a-a%c-1,disabledIndices:i})),D(d,c,t)&&(d=a)),n.key===(u?A:P)&&(f&&E(n),a%c!==0?(d=K(e,{startingIndex:a,decrement:!0,disabledIndices:i}),o&&D(d,c,t)&&(d=K(e,{startingIndex:a+(c-a%c),decrement:!0,disabledIndices:i}))):o&&(d=K(e,{startingIndex:a+(c-a%c),decrement:!0,disabledIndices:i})),D(d,c,t)&&(d=a));const r=(0,x.RI)(s/c)===t;N(e,d)&&(d=o&&r?n.key===(u?A:P)?s:K(e,{startingIndex:a-a%c-1,disabledIndices:i}):a)}return d}({current:n.map(e=>null!=e?s.current[e]:null)},{event:e,orientation:Y,loop:w,rtl:M,cols:z,disabledIndices:_([...H||s.current.map((e,t)=>W(s.current,t)?t:void 0),void 0],n),minIndex:o,maxIndex:u,prevIndex:j(ce.current>i?r:ce.current,t,n,z,e.key===S?"bl":e.key===(M?P:A)?"tr":"tl"),stopEvent:!0})];if(null!=c&&(ce.current=c,ee(ce.current)),"both"===Y)return}if(ut(e.key,Y)){if(E(e),n&&!I&&c(e.currentTarget.ownerDocument)===e.currentTarget)return ce.current=ct(e.key,Y,M)?r:i,void ee(ce.current);ce.current=ct(e.key,Y,M)?w?t>=i?y&&t!==s.current.length?-1:r:K(s,{startingIndex:t,disabledIndices:H}):Math.min(i,K(s,{startingIndex:t,disabledIndices:H})):w?t<=r?y&&-1!==t?s.current.length:i:K(s,{startingIndex:t,decrement:!0,disabledIndices:H}):Math.max(r,K(s,{startingIndex:t,decrement:!0,disabledIndices:H})),N(s,ce.current)?ee(null):ee(ce.current)}}),Te=r.useMemo(()=>I&&n&&Me&&{"aria-activedescendant":Re||we},[I,n,Me,Re,we]),Le=r.useMemo(()=>({"aria-orientation":"both"===Y?void 0:Y,...!R(l.domReference)&&Te,onKeyDown:Ce,onPointerMove(){le.current=!0}}),[Te,Ce,l.domReference,Y]),Oe=r.useMemo(()=>{function e(e){"auto"===C&&a(e.nativeEvent)&&(ue.current=!0)}return{...Te,onKeyDown(e){le.current=!1;const t=e.key.startsWith("Arrow"),r=["Home","End"].includes(e.key),u=t||r,c=function(e,t,n){return ot(t,n?e===P:e===A,e===S)}(e.key,Y,M),i=it(e.key,Y,M),l=ut(e.key,Y),a=(k?c:l)||"Enter"===e.key||""===e.key.trim();if(I&&n){const t=null==Q?void 0:Q.nodesRef.current.find(e=>null==e.parentId),n=Q&&t?function(e,t){let n,r=-1;return function t(o,u){u>r&&(n=o,r=u),ae(e,o).forEach(e=>{t(e.id,u+1)})}(t,0),e.find(e=>e.id===n)}(Q.nodesRef.current,t.id):null;if(u&&n&&X){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(c||i){var f,d;const r=(null==(f=n.context)?void 0:f.elements.domReference)===e.currentTarget,o=i&&!r?null==(d=n.context)?void 0:d.elements.domReference:c?s.current.find(e=>(null==e?void 0:e.id)===we):null;o&&(E(e),o.dispatchEvent(t),xe(void 0))}var m;if((l||r)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return E(e),void(null==(m=n.context.elements.domReference)||m.dispatchEvent(t))}return Ce(e)}(n||U||!t)&&(a&&(ie.current=k&&l?null:e.key),k?c&&(E(e),n?(ce.current=q(s,ge.current),ee(ce.current)):o(!0,e.nativeEvent,"list-navigation")):l&&(null!=b&&(ce.current=b),E(e),!n&&U?o(!0,e.nativeEvent,"list-navigation"):Ce(e),n&&ee(ce.current)))},onFocus(){n&&!I&&ee(null)},onPointerDown:function(e){ue.current=C,"auto"===C&&f(e.nativeEvent)&&(ue.current=!0)},onMouseDown:e,onClick:e}},[we,Te,Ce,ge,C,s,k,ee,o,n,U,Y,M,b,Q,I,X]);return r.useMemo(()=>h?{reference:Oe,floating:Le,item:Ie}:{},[h,Oe,Le,Ie])}const st=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function at(e,t){var n;void 0===t&&(t={});const{open:o,floatingId:u}=e,{enabled:c=!0,role:i="dialog"}=t,l=null!=(n=st.get(i))?n:i,s=G(),a=null!=te(),f=r.useMemo(()=>"tooltip"===l||"label"===i?{["aria-"+("label"===i?"labelledby":"describedby")]:o?u:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":o?u:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:s},..."menu"===l&&a&&{role:"menuitem"},..."select"===i&&{"aria-autocomplete":"none"},..."combobox"===i&&{"aria-autocomplete":"list"}},[l,u,a,o,s,i]),d=r.useMemo(()=>{const e={id:u,...l&&{role:l}};return"tooltip"===l||"label"===i?e:{...e,..."menu"===l&&{"aria-labelledby":s}}},[l,u,s,i]),m=r.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:u+"-option"}};switch(i){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}},[u,i]);return r.useMemo(()=>c?{reference:f,floating:d,item:m}:{},[c,f,d,m])}const ft=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function dt(e,t){return"function"===typeof e?e(t):e}function mt(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:u,common:c,duration:i=250}=t,l=e.placement,s=l.split("-")[0],a=r.useMemo(()=>({side:s,placement:l}),[s,l]),f="number"===typeof i,d=(f?i:i.open)||0,m=(f?i:i.close)||0,[v,p]=r.useState(()=>({...dt(c,a),...dt(n,a)})),{isMounted:g,status:h}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:u=250}=t,c=("number"===typeof u?u:u.close)||0,[i,l]=r.useState("unmounted"),s=function(e,t){const[n,o]=r.useState(e);return e&&!n&&o(!0),r.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>o(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,c);return s||"close"!==i||l("unmounted"),B(()=>{if(o){if(n){l("initial");const e=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(e)}}l("close")}},[n,o]),{isMounted:s,status:i}}(e,{duration:i}),b=oe(n),y=oe(o),w=oe(u),E=oe(c);return B(()=>{const e=dt(b.current,a),t=dt(w.current,a),n=dt(E.current,a),r=dt(y.current,a)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===h&&p(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===h&&p({transitionProperty:Object.keys(r).map(ft).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(ft).join(","),transitionDuration:m+"ms",...n,...r})}},[m,w,b,y,E,d,h,a]),{isMounted:g,styles:v}}function vt(e,t){var n;const{open:o,dataRef:u}=e,{listRef:c,activeIndex:i,onMatch:l,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:v=null}=t,p=r.useRef(),g=r.useRef(""),h=r.useRef(null!=(n=null!=v?v:i)?n:-1),b=r.useRef(null),y=L(l),w=L(s),R=oe(f),x=oe(m);B(()=>{o&&(clearTimeout(p.current),b.current=null,g.current="")},[o]),B(()=>{var e;o&&""===g.current&&(h.current=null!=(e=null!=v?v:i)?e:-1)},[o,v,i]);const k=L(e=>{e?u.current.typing||(u.current.typing=e,w(e)):u.current.typing&&(u.current.typing=e,w(e))}),M=L(e=>{function t(e,t,n){const r=R.current?R.current(t,n):t.find(e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())));return r?e.indexOf(r):-1}const n=c.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?k(!1):" "===e.key&&E(e)),null==n||x.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;o&&" "!==e.key&&(E(e),k(!0)),n.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&g.current===e.key&&(g.current="",h.current=b.current),g.current+=e.key,clearTimeout(p.current),p.current=setTimeout(()=>{g.current="",h.current=b.current,k(!1)},d);const r=h.current,u=t(n,[...n.slice((r||0)+1),...n.slice(0,(r||0)+1)],g.current);-1!==u?(y(u),b.current=u):" "!==e.key&&(g.current="",k(!1))}),I=r.useMemo(()=>({onKeyDown:M}),[M]),C=r.useMemo(()=>({onKeyDown:M,onKeyUp(e){" "===e.key&&k(!1)}}),[M,k]);return r.useMemo(()=>a?{reference:I,floating:C}:{},[a,I,C])}function pt(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let c=0,i=u-1;c<u;i=c++){const[e,u]=t[c]||[0,0],[l,s]=t[i]||[0,0];u>=r!==s>=r&&n<=(l-e)*(r-u)/(s-u)+e&&(o=!o)}return o}function gt(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,c=!1,l=null,s=null,a=performance.now();const f=e=>{let{x:n,y:f,placement:d,elements:m,onClose:v,nodeId:p,tree:g}=e;return function(e){function h(){clearTimeout(o),v()}if(clearTimeout(o),!m.domReference||!m.floating||null==d||null==n||null==f)return;const{clientX:y,clientY:w}=e,E=[y,w],R=b(e),x="mouseleave"===e.type,k=i(m.floating,R),M=i(m.domReference,R),I=m.domReference.getBoundingClientRect(),C=m.floating.getBoundingClientRect(),T=d.split("-")[0],L=n>C.right-C.width/2,O=f>C.bottom-C.height/2,S=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(E,I),P=C.width>I.width,A=C.height>I.height,D=(P?I:C).left,N=(P?I:C).right,q=(A?I:C).top,F=(A?I:C).bottom;if(k&&(c=!0,!x))return;if(M&&(c=!1),M&&!x)return void(c=!0);if(x&&(0,u.vq)(e.relatedTarget)&&i(m.floating,e.relatedTarget))return;if(g&&ae(g.nodesRef.current,p).some(e=>{let{context:t}=e;return null==t?void 0:t.open}))return;if("top"===T&&f>=I.bottom-1||"bottom"===T&&f<=I.top+1||"left"===T&&n>=I.right-1||"right"===T&&n<=I.left+1)return h();let K=[];switch(T){case"top":K=[[D,I.top+1],[D,C.bottom-1],[N,C.bottom-1],[N,I.top+1]];break;case"bottom":K=[[D,C.top+1],[D,I.bottom-1],[N,I.bottom-1],[N,C.top+1]];break;case"left":K=[[C.right-1,F],[C.right-1,q],[I.left+1,q],[I.left+1,F]];break;case"right":K=[[I.right-1,F],[I.right-1,q],[C.left+1,q],[C.left+1,F]]}if(!pt([y,w],K)){if(c&&!S)return h();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-a;if(null===l||null===s||0===r)return l=e,s=t,a=n,null;const o=e-l,u=t-s,c=Math.sqrt(o*o+u*u);return l=e,s=t,a=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return h()}pt([y,w],function(e){let[n,r]=e;switch(T){case"top":return[[P?n+t/2:L?n+4*t:n-4*t,r+t+1],[P?n-t/2:L?n+4*t:n-4*t,r+t+1],[C.left,L||P?C.bottom-t:C.top],[C.right,L?P?C.bottom-t:C.top:C.bottom-t]];case"bottom":return[[P?n+t/2:L?n+4*t:n-4*t,r-t],[P?n-t/2:L?n+4*t:n-4*t,r-t],[C.left,L||P?C.top+t:C.bottom],[C.right,L?P?C.top+t:C.bottom:C.top+t]];case"left":return[[O||A?C.right-t:C.left,C.top],[O?A?C.right-t:C.left:C.right-t,C.bottom],[n+t+1,A?r+t/2:O?r+4*t:r-4*t],[n+t+1,A?r-t/2:O?r+4*t:r-4*t]];case"right":return[[n-t,A?r+t/2:O?r+4*t:r-4*t],[n-t,A?r-t/2:O?r+4*t:r-4*t],[O||A?C.left+t:C.right,C.top],[O?A?C.left+t:C.right:C.left+t,C.bottom]]}}([n,f]))?!c&&r&&(o=window.setTimeout(h,40)):h()}}};return f.__options={blockPointerEvents:n},f}},86635:(e,t,n)=>{function r(){return"undefined"!==typeof window}function o(e){return i(e)?(e.nodeName||"").toLowerCase():"#document"}function u(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function c(e){var t;return null==(t=(i(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function i(e){return!!r()&&(e instanceof Node||e instanceof u(e).Node)}function l(e){return!!r()&&(e instanceof Element||e instanceof u(e).Element)}function s(e){return!!r()&&(e instanceof HTMLElement||e instanceof u(e).HTMLElement)}function a(e){return!(!r()||"undefined"===typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof u(e).ShadowRoot)}n.d(t,{$4:()=>C,CP:()=>I,L9:()=>M,Lv:()=>v,Ng:()=>a,Tc:()=>R,Tf:()=>g,ZU:()=>d,_m:()=>O,ep:()=>c,eu:()=>k,gJ:()=>E,mq:()=>o,sQ:()=>w,sb:()=>s,v9:()=>L,vq:()=>l,zk:()=>u});const f=new Set(["inline","contents"]);function d(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=M(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!f.has(o)}const m=new Set(["table","td","th"]);function v(e){return m.has(o(e))}const p=[":popover-open",":modal"];function g(e){return p.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const h=["transform","translate","scale","rotate","perspective"],b=["transform","translate","scale","rotate","perspective","filter"],y=["paint","layout","strict","content"];function w(e){const t=R(),n=l(e)?M(e):e;return h.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||b.some(e=>(n.willChange||"").includes(e))||y.some(e=>(n.contain||"").includes(e))}function E(e){let t=C(e);for(;s(t)&&!k(t);){if(w(t))return t;if(g(t))return null;t=C(t)}return null}function R(){return!("undefined"===typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const x=new Set(["html","body","#document"]);function k(e){return x.has(o(e))}function M(e){return u(e).getComputedStyle(e)}function I(e){return l(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function C(e){if("html"===o(e))return e;const t=e.assignedSlot||e.parentNode||a(e)&&e.host||c(e);return a(t)?t.host:t}function T(e){const t=C(e);return k(t)?e.ownerDocument?e.ownerDocument.body:e.body:s(t)&&d(t)?t:T(t)}function L(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=T(e),c=o===(null==(r=e.ownerDocument)?void 0:r.body),i=u(o);if(c){const e=O(i);return t.concat(i,i.visualViewport||[],d(o)?o:[],e&&n?L(e):[])}return t.concat(o,L(o,[],n))}function O(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}},97193:(e,t,n)=>{n.d(t,{B1:()=>S,C0:()=>v,DD:()=>o,Dz:()=>w,Jx:()=>s,LI:()=>i,PG:()=>g,RI:()=>l,Sg:()=>p,T9:()=>c,TV:()=>y,WJ:()=>R,_3:()=>m,aD:()=>x,bV:()=>L,jk:()=>u,lP:()=>T,nI:()=>O,qE:()=>d,sq:()=>h,w7:()=>E});const r=["start","end"],o=["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-"+r[0],t+"-"+r[1]),[]),u=Math.min,c=Math.max,i=Math.round,l=Math.floor,s=e=>({x:e,y:e}),a={left:"right",right:"left",bottom:"top",top:"bottom"},f={start:"end",end:"start"};function d(e,t,n){return c(e,u(t,n))}function m(e,t){return"function"===typeof e?e(t):e}function v(e){return e.split("-")[0]}function p(e){return e.split("-")[1]}function g(e){return"x"===e?"y":"x"}function h(e){return"y"===e?"height":"width"}const b=new Set(["top","bottom"]);function y(e){return b.has(v(e))?"y":"x"}function w(e){return g(y(e))}function E(e,t,n){void 0===n&&(n=!1);const r=p(e),o=w(e),u=h(o);let c="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[u]>t.floating[u]&&(c=L(c)),[c,L(c)]}function R(e){const t=L(e);return[x(e),t,x(t)]}function x(e){return e.replace(/start|end/g,e=>f[e])}const k=["left","right"],M=["right","left"],I=["top","bottom"],C=["bottom","top"];function T(e,t,n,r){const o=p(e);let u=function(e,t,n){switch(e){case"top":case"bottom":return n?t?M:k:t?k:M;case"left":case"right":return t?I:C;default:return[]}}(v(e),"start"===n,r);return o&&(u=u.map(e=>e+"-"+o),t&&(u=u.concat(u.map(x)))),u}function L(e){return e.replace(/left|right|bottom|top/g,e=>a[e])}function O(e){return"number"!==typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function S(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}}}]);