"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[348],{12744:(e,t,n)=>{n.d(t,{Zx:()=>A,bv:()=>_,vW:()=>O,we:()=>S});var r,l=n(96540),u=n(33533),o=n(80692),c=n(61266),i=n(40961),f=n(51710),s=n(17997);let a={...r||(r=n.t(l,2))},m=a.useInsertionEffect||(e=>e());function d(e){let t=l.useRef(()=>{});return m(()=>{t.current=e}),l.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r"floating-ui-"+Math.random().toString(36).slice(2,6)+v++,C=a.useId||function(){let[e,t]=l.useState(()=>h?p():void 0);return g(()=>{null==e&&t(p())},[]),l.useEffect(()=>{h=!0},[]),e},x=l.createContext(null),y=l.createContext(null),M=()=>{var e;return(null==(e=l.useContext(x))?void 0:e.id)||null},b=()=>l.useContext(y),R=()=>{},w=e=>e&&(e.host||w(e.parentNode)),E=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function S(e){void 0===e&&(e={});let{nodeId:t}=e,n=function(e){let{open:t=!1,onOpenChange:n,elements:r}=e,u=C(),o=l.useRef({}),[c]=l.useState(()=>(function(){let 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))||[])}}})()),i=null!=M(),[f,s]=l.useState(r.reference),a=d((e,t,r)=>{o.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:r,nested:i}),null==n||n(e,t,r)}),m=l.useMemo(()=>({setPositionReference:s}),[]),g=l.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return l.useMemo(()=>({dataRef:o,open:t,onOpenChange:a,elements:g,events:c,floatingId:u,refs:m}),[t,a,g,c,u,m])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,u=r.elements,[o,i]=l.useState(null),[s,a]=l.useState(null),m=(null==u?void 0:u.reference)||o,h=l.useRef(null),v=b();g(()=>{m&&(h.current=m)},[m]);let p=(0,f.we)({...e,elements:{...u,...s&&{reference:s}}}),x=l.useCallback(e=>{let t=(0,c.vq)(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),p.refs.setReference(t)},[p.refs]),y=l.useCallback(e=>{((0,c.vq)(e)||null===e)&&(h.current=e,i(e)),((0,c.vq)(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!(0,c.vq)(e))&&p.refs.setReference(e)},[p.refs]),R=l.useMemo(()=>({...p.refs,setReference:y,setPositionReference:x,domReference:h}),[p.refs,y,x]),w=l.useMemo(()=>({...p.elements,domReference:m}),[p.elements,m]),E=l.useMemo(()=>({...p,...r,refs:R,elements:w,nodeId:t}),[p,R,w,t,r]);return g(()=>{r.dataRef.current.floatingContext=E;let e=null==v?void 0:v.nodesRef.current.find(e=>e.id===t);e&&(e.context=E)}),l.useMemo(()=>({...p,context:E,refs:R,elements:w}),[p,R,w,E])}let T="active",k="selected";function H(e,t,n){let r=new Map,l="item"===n,u=e;if(l&&e){let{[T]:t,[k]:n,...r}=e;u=r}return{..."floating"===n&&{tabIndex:-1,"data-floating-ui-focusable":""},...u,...t.map(t=>{let 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;if(!(l&&[T,k].includes(n))){if(0===n.indexOf("on")){if(r.has(n)||r.set(n,[]),"function"==typeof u){var o;null==(o=r.get(n))||o.push(u),e[n]=function(){for(var e,t=arguments.length,l=Array(t),u=0;ue(...l)).find(e=>void 0!==e)}}}else e[n]=u}}),e),{})}}function _(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),u=l.useCallback(t=>H(t,e,"reference"),t),o=l.useCallback(t=>H(t,e,"floating"),n),c=l.useCallback(t=>H(t,e,"item"),r);return l.useMemo(()=>({getReferenceProps:u,getFloatingProps:o,getItemProps:c}),[u,o,c])}function q(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}let O=e=>({name:"inner",options:e,async fn(t){let{listRef:n,overflowRef:r,onFallbackChange:l,offset:u=0,index:c=0,minItemsVisible:a=4,referenceOverflowThreshold:m=0,scrollRef:d,...g}=(0,o._3)(e,t),{rects:h,elements:{floating:v}}=t,p=n.current[c],C=(null==d?void 0:d.current)||v,x=v.clientTop||C.clientTop,y=0!==v.clientTop,M=0!==C.clientTop,b=v===C;if(!p)return{};let R={...t,...await (0,f.cY)(-p.offsetTop-v.clientTop-h.reference.height/2-p.offsetHeight/2-u).fn(t)},w=await (0,s.__)(q(R,C.scrollHeight+x+v.clientTop),g),E=await (0,s.__)(R,{...g,elementContext:"reference"}),S=Math.max(0,w.top),T=R.y+S,k=Math.max(0,C.scrollHeight+(y&&b||M?2*x:0)-S-Math.max(0,w.bottom));return C.style.maxHeight=k+"px",C.scrollTop=S,l&&(C.offsetHeight=-m||E.bottom>=-m?i.flushSync(()=>l(!0)):i.flushSync(()=>l(!1))),r&&(r.current=await (0,s.__)(q({...R,y:T},C.offsetHeight+x+v.clientTop),g)),{y:T}}});function A(e,t){let{open:n,elements:r}=e,{enabled:o=!0,overflowRef:c,scrollRef:f,onChange:s}=t,a=d(s),m=l.useRef(!1),g=l.useRef(null),h=l.useRef(null);l.useEffect(()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;let n=e.deltaY,r=c.current.top>=-.5,l=c.current.bottom>=-.5,o=t.scrollHeight-t.clientHeight,f=n<0?-1:1,s=n<0?"max":"min";!(t.scrollHeight<=t.clientHeight)&&(!r&&n>0||!l&&n<0?(e.preventDefault(),i.flushSync(()=>{a(e=>e+Math[s](n,o*f))})):/firefox/i.test((0,u.$t)())&&(t.scrollTop+=n))}let t=(null==f?void 0:f.current)||r.floating;if(n&&t)return t.addEventListener("wheel",e),requestAnimationFrame(()=>{g.current=t.scrollTop,null!=c.current&&(h.current={...c.current})}),()=>{g.current=null,h.current=null,t.removeEventListener("wheel",e)}},[o,n,r.floating,c,f,a]);let v=l.useMemo(()=>({onKeyDown(){m.current=!0},onWheel(){m.current=!1},onPointerMove(){m.current=!1},onScroll(){let e=(null==f?void 0:f.current)||r.floating;if(c.current&&e&&m.current){if(null!==g.current){let t=e.scrollTop-g.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&i.flushSync(()=>a(e=>e+t))}requestAnimationFrame(()=>{g.current=e.scrollTop})}}}),[r.floating,a,c,f]);return l.useMemo(()=>o?{floating:v}:{},[o,v])}}}]);