"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8176],{84039:(e,n,t)=>{t.d(n,{NI:()=>D,YF:()=>P,bQ:()=>K});var r,o=t(46212),l=t(34126),u=t(92711);t(65765);var i=t(54556);let c={...r||(r=t.t(o,2))},f=c.useInsertionEffect||(e=>e());function s(e){let n=o.useRef(()=>{});return f(()=>{n.current=e}),o.useCallback(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)},[])}var a="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;let d=!1,v=0,p=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+v++,m=c.useId||function(){let[e,n]=o.useState(()=>d?p():void 0);return a(()=>{null==e&&n(p())},[]),o.useEffect(()=>{d=!0},[]),e},g=o.createContext(null),h=o.createContext(null),k=()=>{var e;return(null==(e=o.useContext(g))?void 0:e.id)||null},y=()=>o.useContext(h),E=()=>{};function x(e,n){let t=e.filter(e=>{var t;return e.parentId===n&&(null==(t=e.context)?void 0:t.open)}),r=t;for(;r.length;)r=e.filter(e=>{var n;return null==(n=r)?void 0:n.some(n=>{var t;return e.parentId===n.id&&(null==(t=e.context)?void 0:t.open)})}),t=t.concat(r);return t}let R=e=>e&&(e.host||R(e.parentNode)),w=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"}),C={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},b={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},M=e=>{var n,t;return{escapeKey:"boolean"==typeof e?e:null!=(n=null==e?void 0:e.escapeKey)&&n,outsidePress:"boolean"==typeof e?e:null==(t=null==e?void 0:e.outsidePress)||t}};function K(e,n){void 0===n&&(n={});let{open:t,onOpenChange:r,elements:i,dataRef:c}=e,{enabled:f=!0,escapeKey:a=!0,outsidePress:d=!0,outsidePressEvent:v="pointerdown",referencePress:p=!1,referencePressEvent:m="pointerdown",ancestorScroll:g=!1,bubbles:h,capture:k}=n,E=y(),R=s("function"==typeof d?d:()=>!1),w="function"==typeof d?R:d,K=o.useRef(!1),P=o.useRef(!1),{escapeKey:_,outsidePress:L}=M(h),{escapeKey:S,outsidePress:D}=M(k),I=s(e=>{var n;if(!t||!f||!a||"Escape"!==e.key)return;let o=null==(n=c.current.floatingContext)?void 0:n.nodeId,u=E?x(E.nodesRef.current,o):[];if(!_&&(e.stopPropagation(),u.length>0)){let e=!0;if(u.forEach(n=>{var t;if(null!=(t=n.context)&&t.open&&!n.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,(0,l.MM)(e)?e.nativeEvent:e,"escape-key")}),B=s(e=>{var n;let t=()=>{var n;I(e),null==(n=(0,l.U9)(e))||n.removeEventListener("keydown",t)};null==(n=(0,l.U9)(e))||n.addEventListener("keydown",t)}),O=s(e=>{var n;let t=K.current;K.current=!1;let o=P.current;if(P.current=!1,"click"===v&&o||t||"function"==typeof w&&!w(e))return;let f=(0,l.U9)(e),s=(0,l.Me)(i.floating).querySelectorAll("[data-floating-ui-inert]"),a=(0,u.kK)(f)?f:null;for(;a&&!(0,u.Py)(a);){let e=(0,u.Ow)(a);if((0,u.Py)(e)||!(0,u.kK)(e))break;a=e}if(s.length&&(0,u.kK)(f)&&!(0,l.ex)(f)&&!(0,l.r3)(f,i.floating)&&Array.from(s).every(e=>!(0,l.r3)(a,e)))return;if((0,u.Re)(f)&&A){let n=f.clientWidth>0&&f.scrollWidth>f.clientWidth,t=f.clientHeight>0&&f.scrollHeight>f.clientHeight,r=t&&e.offsetX>f.clientWidth;if(t&&"rtl"===(0,u.Dx)(f).direction&&(r=e.offsetX<=f.offsetWidth-f.clientWidth),r||n&&e.offsetY>f.clientHeight)return}let d=null==(n=c.current.floatingContext)?void 0:n.nodeId,p=E&&x(E.nodesRef.current,d).some(n=>{var t;return(0,l.Pe)(e,null==(t=n.context)?void 0:t.elements.floating)});if((0,l.Pe)(e,i.floating)||(0,l.Pe)(e,i.domReference)||p)return;let m=E?x(E.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach(n=>{var t;if(null!=(t=n.context)&&t.open&&!n.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,"outside-press")}),U=s(e=>{var n;let t=()=>{var n;O(e),null==(n=(0,l.U9)(e))||n.removeEventListener(v,t)};null==(n=(0,l.U9)(e))||n.addEventListener(v,t)});o.useEffect(()=>{if(!t||!f)return;function e(e){r(!1,e,"ancestor-scroll")}c.current.__escapeKeyBubbles=_,c.current.__outsidePressBubbles=L;let n=(0,l.Me)(i.floating);a&&n.addEventListener("keydown",S?B:I,S),w&&n.addEventListener(v,D?U:O,D);let o=[];return g&&((0,u.kK)(i.domReference)&&(o=(0,u.Kx)(i.domReference)),(0,u.kK)(i.floating)&&(o=o.concat((0,u.Kx)(i.floating))),!(0,u.kK)(i.reference)&&i.reference&&i.reference.contextElement&&(o=o.concat((0,u.Kx)(i.reference.contextElement)))),(o=o.filter(e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})).forEach(n=>{n.addEventListener("scroll",e,{passive:!0})}),()=>{a&&n.removeEventListener("keydown",S?B:I,S),w&&n.removeEventListener(v,D?U:O,D),o.forEach(n=>{n.removeEventListener("scroll",e)})}},[c,i,a,w,v,t,r,g,f,_,L,I,S,B,O,D,U]),o.useEffect(()=>{K.current=!1},[w,v]);let W=o.useMemo(()=>({onKeyDown:I,[C[m]]:e=>{p&&r(!1,e.nativeEvent,"reference-press")}}),[I,r,p,m]),A=o.useMemo(()=>({onKeyDown:I,onMouseDown(){P.current=!0},onMouseUp(){P.current=!0},[b[v]]:()=>{K.current=!0}}),[I,v]);return o.useMemo(()=>f?{reference:W,floating:A}:{},[f,W,A])}function P(e){void 0===e&&(e={});let{nodeId:n}=e,t=function(e){let{open:n=!1,onOpenChange:t,elements:r}=e,l=m(),u=o.useRef({}),[i]=o.useState(()=>(function(){let e=new Map;return{emit(n,t){var r;null==(r=e.get(n))||r.forEach(e=>e(t))},on(n,t){e.set(n,[...e.get(n)||[],t])},off(n,t){var r;e.set(n,(null==(r=e.get(n))?void 0:r.filter(e=>e!==t))||[])}}})()),c=null!=k(),[f,a]=o.useState(r.reference),d=s((e,n,r)=>{u.current.openEvent=e?n:void 0,i.emit("openchange",{open:e,event:n,reason:r,nested:c}),null==t||t(e,n,r)}),v=o.useMemo(()=>({setPositionReference:a}),[]),p=o.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return o.useMemo(()=>({dataRef:u,open:n,onOpenChange:d,elements:p,events:i,floatingId:l,refs:v}),[n,d,p,i,l,v])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||t,l=r.elements,[c,f]=o.useState(null),[d,v]=o.useState(null),p=(null==l?void 0:l.reference)||c,g=o.useRef(null),h=y();a(()=>{p&&(g.current=p)},[p]);let E=(0,i.YF)({...e,elements:{...l,...d&&{reference:d}}}),x=o.useCallback(e=>{let n=(0,u.kK)(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;v(n),E.refs.setReference(n)},[E.refs]),R=o.useCallback(e=>{((0,u.kK)(e)||null===e)&&(g.current=e,f(e)),((0,u.kK)(E.refs.reference.current)||null===E.refs.reference.current||null!==e&&!(0,u.kK)(e))&&E.refs.setReference(e)},[E.refs]),w=o.useMemo(()=>({...E.refs,setReference:R,setPositionReference:x,domReference:g}),[E.refs,R,x]),C=o.useMemo(()=>({...E.elements,domReference:p}),[E.elements,p]),b=o.useMemo(()=>({...E,...r,refs:w,elements:C,nodeId:n}),[E,w,C,n,r]);return a(()=>{r.dataRef.current.floatingContext=b;let e=null==h?void 0:h.nodesRef.current.find(e=>e.id===n);e&&(e.context=b)}),o.useMemo(()=>({...E,context:b,refs:w,elements:C}),[E,w,C,b])}let _="active",L="selected";function S(e,n,t){let r=new Map,o="item"===t,l=e;if(o&&e){let{[_]:n,[L]:t,...r}=e;l=r}return{..."floating"===t&&{tabIndex:-1},...l,...n.map(n=>{let r=n?n[t]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,n)=>(n&&Object.entries(n).forEach(n=>{let[t,l]=n;if(!(o&&[_,L].includes(t))){if(0===t.indexOf("on")){if(r.has(t)||r.set(t,[]),"function"==typeof l){var u;null==(u=r.get(t))||u.push(l),e[t]=function(){for(var e,n=arguments.length,o=Array(n),l=0;l<n;l++)o[l]=arguments[l];return null==(e=r.get(t))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)}}}else e[t]=l}}),e),{})}}function D(e){void 0===e&&(e=[]);let n=e.map(e=>null==e?void 0:e.reference),t=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),l=o.useCallback(n=>S(n,e,"reference"),n),u=o.useCallback(n=>S(n,e,"floating"),t),i=o.useCallback(n=>S(n,e,"item"),r);return o.useMemo(()=>({getReferenceProps:l,getFloatingProps:u,getItemProps:i}),[l,u,i])}}}]);