react-multiselect-ui 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,45 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),$t=require("react"),_n=require("react-dom");function Fn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=Fn($t),Wn=Fn(_n);function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function ln(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ee(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ln(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ln(e[o],null)}}}}function re(...e){return c.useCallback(Ee(...e),e)}function ho(e,t){const n=c.createContext(t),r=i=>{const{children:a,...s}=i,u=c.useMemo(()=>s,Object.values(s));return b.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function o(i){const a=c.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Bt(e,t=[]){let n=[];function r(i,a){const s=c.createContext(a),u=n.length;n=[...n,a];const l=f=>{const{scope:h,children:m,...v}=f,p=h?.[e]?.[u]||s,g=c.useMemo(()=>v,Object.values(v));return b.jsx(p.Provider,{value:g,children:m})};l.displayName=i+"Provider";function d(f,h){const m=h?.[e]?.[u]||s,v=c.useContext(m);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[l,d]}const o=()=>{const i=n.map(a=>c.createContext(a));return function(s){const u=s?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return o.scopeName=e,[r,go(o,...t)]}function go(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(i)[`__scope${l}`];return{...s,...f}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ht(e){const t=vo(e),n=c.forwardRef((r,o)=>{const{children:i,...a}=r,s=c.Children.toArray(i),u=s.find(yo);if(u){const l=u.props.children,d=s.map(f=>f===u?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:f);return b.jsx(t,{...a,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,d):null})}return b.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function vo(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const a=wo(o),s=xo(i,o.props);return o.type!==c.Fragment&&(s.ref=r?Ee(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bo=Symbol("radix.slottable");function yo(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bo}function xo(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const u=i(...s);return o(...s),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function wo(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Co=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],G=Co.reduce((e,t)=>{const n=Ht(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:a,...s}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(u,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Eo(e,t){e&&Wn.flushSync(()=>e.dispatchEvent(t))}function Le(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function So(e,t=globalThis?.document){const n=Le(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ro="DismissableLayer",Tt="dismissableLayer.update",Ao="dismissableLayer.pointerDownOutside",Po="dismissableLayer.focusOutside",un,$n=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vt=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...u}=e,l=c.useContext($n),[d,f]=c.useState(null),h=d?.ownerDocument??globalThis?.document,[,m]=c.useState({}),v=re(t,S=>f(S)),p=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(g),E=d?p.indexOf(d):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,C=E>=y,A=No(S=>{const I=S.target,_=[...l.branches].some(j=>j.contains(I));!C||_||(o?.(S),a?.(S),S.defaultPrevented||s?.())},h),R=Mo(S=>{const I=S.target;[...l.branches].some(j=>j.contains(I))||(i?.(S),a?.(S),S.defaultPrevented||s?.())},h);return So(S=>{E===l.layers.size-1&&(r?.(S),!S.defaultPrevented&&s&&(S.preventDefault(),s()))},h),c.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(un=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),dn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=un)}},[d,h,n,l]),c.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),dn())},[d,l]),c.useEffect(()=>{const S=()=>m({});return document.addEventListener(Tt,S),()=>document.removeEventListener(Tt,S)},[]),b.jsx(G.div,{...u,ref:v,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,R.onFocusCapture),onBlurCapture:J(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,A.onPointerDownCapture)})});Vt.displayName=Ro;var Oo="DismissableLayerBranch",ko=c.forwardRef((e,t)=>{const n=c.useContext($n),r=c.useRef(null),o=re(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),b.jsx(G.div,{...e,ref:o})});ko.displayName=Oo;function No(e,t=globalThis?.document){const n=Le(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let u=function(){Bn(Ao,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Mo(e,t=globalThis?.document){const n=Le(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&Bn(Po,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function dn(){const e=new CustomEvent(Tt);document.dispatchEvent(e)}function Bn(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Eo(o,i):o.dispatchEvent(i)}var yt=0;function Hn(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fn()),document.body.insertAdjacentElement("beforeend",e[1]??fn()),yt++,()=>{yt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),yt--}},[])}function fn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xt="focusScope.autoFocusOnMount",wt="focusScope.autoFocusOnUnmount",pn={bubbles:!1,cancelable:!0},Do="FocusScope",Ut=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,u]=c.useState(null),l=Le(o),d=Le(i),f=c.useRef(null),h=re(t,p=>u(p)),m=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let p=function(x){if(m.paused||!s)return;const C=x.target;s.contains(C)?f.current=C:ge(f.current,{select:!0})},g=function(x){if(m.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||ge(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const A of x)A.removedNodes.length>0&&ge(s)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const E=new MutationObserver(y);return s&&E.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),E.disconnect()}}},[r,s,m.paused]),c.useEffect(()=>{if(s){hn.add(m);const p=document.activeElement;if(!s.contains(p)){const y=new CustomEvent(xt,pn);s.addEventListener(xt,l),s.dispatchEvent(y),y.defaultPrevented||(To(_o(Vn(s)),{select:!0}),document.activeElement===p&&ge(s))}return()=>{s.removeEventListener(xt,l),setTimeout(()=>{const y=new CustomEvent(wt,pn);s.addEventListener(wt,d),s.dispatchEvent(y),y.defaultPrevented||ge(p??document.body,{select:!0}),s.removeEventListener(wt,d),hn.remove(m)},0)}}},[s,l,d,m]);const v=c.useCallback(p=>{if(!n&&!r||m.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(g&&y){const E=p.currentTarget,[x,C]=Io(E);x&&C?!p.shiftKey&&y===C?(p.preventDefault(),n&&ge(x,{select:!0})):p.shiftKey&&y===x&&(p.preventDefault(),n&&ge(C,{select:!0})):y===E&&p.preventDefault()}},[n,r,m.paused]);return b.jsx(G.div,{tabIndex:-1,...a,ref:h,onKeyDown:v})});Ut.displayName=Do;function To(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ge(r,{select:t}),document.activeElement!==n)return}function Io(e){const t=Vn(e),n=mn(t,e),r=mn(t.reverse(),e);return[n,r]}function Vn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mn(e,t){for(const n of e)if(!jo(n,{upTo:t}))return n}function jo(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Lo(e){return e instanceof HTMLInputElement&&"select"in e}function ge(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Lo(e)&&t&&e.select()}}var hn=zo();function zo(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=gn(e,t),e.unshift(t)},remove(t){e=gn(e,t),e[0]?.resume()}}}function gn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _o(e){return e.filter(t=>t.tagName!=="A")}var ve=globalThis?.document?c.useLayoutEffect:()=>{},Fo=c[" useId ".trim().toString()]||(()=>{}),Wo=0;function ae(e){const[t,n]=c.useState(Fo());return ve(()=>{n(r=>r??String(Wo++))},[e]),e||(t?`radix-${t}`:"")}const $o=["top","right","bottom","left"],be=Math.min,Q=Math.max,st=Math.round,Ze=Math.floor,ce=e=>({x:e,y:e}),Bo={left:"right",right:"left",bottom:"top",top:"bottom"};function It(e,t,n){return Q(e,be(t,n))}function de(e,t){return typeof e=="function"?e(t):e}function fe(e){return e.split("-")[0]}function Fe(e){return e.split("-")[1]}function Gt(e){return e==="x"?"y":"x"}function Kt(e){return e==="y"?"height":"width"}function se(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Xt(e){return Gt(se(e))}function Ho(e,t,n){n===void 0&&(n=!1);const r=Fe(e),o=Xt(e),i=Kt(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=at(a)),[a,at(a)]}function Vo(e){const t=at(e);return[jt(e),t,jt(t)]}function jt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vn=["left","right"],bn=["right","left"],Uo=["top","bottom"],Go=["bottom","top"];function Ko(e,t,n){switch(e){case"top":case"bottom":return n?t?bn:vn:t?vn:bn;case"left":case"right":return t?Uo:Go;default:return[]}}function Xo(e,t,n,r){const o=Fe(e);let i=Ko(fe(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(jt)))),i}function at(e){const t=fe(e);return Bo[t]+e.slice(t.length)}function Yo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Un(e){return typeof e!="number"?Yo(e):{top:e,right:e,bottom:e,left:e}}function ct(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}}function yn(e,t,n){let{reference:r,floating:o}=e;const i=se(t),a=Xt(t),s=Kt(a),u=fe(t),l=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let m;switch(u){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Fe(t)){case"start":m[a]-=h*(n&&l?-1:1);break;case"end":m[a]+=h*(n&&l?-1:1);break}return m}async function qo(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=de(t,e),v=Un(m),g=s[h?f==="floating"?"reference":"floating":f],y=ct(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:d,strategy:u})),E=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),C=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},A=ct(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:x,strategy:u}):E);return{top:(y.top-A.top+v.top)/C.y,bottom:(A.bottom-y.bottom+v.bottom)/C.y,left:(y.left-A.left+v.left)/C.x,right:(A.right-y.right+v.right)/C.x}}const Zo=50,Qo=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:qo},u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=yn(l,r,u),h=r,m=0;const v={};for(let p=0;p<i.length;p++){const g=i[p];if(!g)continue;const{name:y,fn:E}=g,{x,y:C,data:A,reset:R}=await E({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:v,rects:l,platform:s,elements:{reference:e,floating:t}});d=x??d,f=C??f,v[y]={...v[y],...A},R&&m<Zo&&(m++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(l=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:d,y:f}=yn(l,h,u)),p=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:v}},Jo=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:u}=t,{element:l,padding:d=0}=de(e,t)||{};if(l==null)return{};const f=Un(d),h={x:n,y:r},m=Xt(o),v=Kt(m),p=await a.getDimensions(l),g=m==="y",y=g?"top":"left",E=g?"bottom":"right",x=g?"clientHeight":"clientWidth",C=i.reference[v]+i.reference[m]-h[m]-i.floating[v],A=h[m]-i.reference[m],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let S=R?R[x]:0;(!S||!await(a.isElement==null?void 0:a.isElement(R)))&&(S=s.floating[x]||i.floating[v]);const I=C/2-A/2,_=S/2-p[v]/2-1,j=be(f[y],_),F=be(f[E],_),O=j,B=S-p[v]-F,T=S/2-p[v]/2+I,U=It(O,T,B),W=!u.arrow&&Fe(o)!=null&&T!==U&&i.reference[v]/2-(T<O?j:F)-p[v]/2<0,$=W?T<O?T-O:T-B:0;return{[m]:h[m]+$,data:{[m]:U,centerOffset:T-U-$,...W&&{alignmentOffset:$}},reset:W}}}),ei=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:u,elements:l}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:p=!0,...g}=de(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=fe(o),E=se(s),x=fe(s)===s,C=await(u.isRTL==null?void 0:u.isRTL(l.floating)),A=h||(x||!p?[at(s)]:Vo(s)),R=v!=="none";!h&&R&&A.push(...Xo(s,p,v,C));const S=[s,...A],I=await u.detectOverflow(t,g),_=[];let j=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&_.push(I[y]),f){const T=Ho(o,a,C);_.push(I[T[0]],I[T[1]])}if(j=[...j,{placement:o,overflows:_}],!_.every(T=>T<=0)){var F,O;const T=(((F=i.flip)==null?void 0:F.index)||0)+1,U=S[T];if(U&&(!(f==="alignment"?E!==se(U):!1)||j.every(N=>se(N.placement)===E?N.overflows[0]>0:!0)))return{data:{index:T,overflows:j},reset:{placement:U}};let W=(O=j.filter($=>$.overflows[0]<=0).sort(($,N)=>$.overflows[1]-N.overflows[1])[0])==null?void 0:O.placement;if(!W)switch(m){case"bestFit":{var B;const $=(B=j.filter(N=>{if(R){const H=se(N.placement);return H===E||H==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(H=>H>0).reduce((H,X)=>H+X,0)]).sort((N,H)=>N[1]-H[1])[0])==null?void 0:B[0];$&&(W=$);break}case"initialPlacement":W=s;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function xn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wn(e){return $o.some(t=>e[t]>=0)}const ti=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=de(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...i,elementContext:"reference"}),s=xn(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:wn(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...i,altBoundary:!0}),s=xn(a,n.floating);return{data:{escapedOffsets:s,escaped:wn(s)}}}default:return{}}}}},Gn=new Set(["left","top"]);async function ni(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=fe(n),s=Fe(n),u=se(n)==="y",l=Gn.has(a)?-1:1,d=i&&u?-1:1,f=de(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof v=="number"&&(m=s==="end"?v*-1:v),u?{x:m*d,y:h*l}:{x:h*l,y:m*d}}const ri=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,u=await ni(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:a}}}}},oi=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:u={fn:y=>{let{x:E,y:x}=y;return{x:E,y:x}}},...l}=de(e,t),d={x:n,y:r},f=await i.detectOverflow(t,l),h=se(fe(o)),m=Gt(h);let v=d[m],p=d[h];if(a){const y=m==="y"?"top":"left",E=m==="y"?"bottom":"right",x=v+f[y],C=v-f[E];v=It(x,v,C)}if(s){const y=h==="y"?"top":"left",E=h==="y"?"bottom":"right",x=p+f[y],C=p-f[E];p=It(x,p,C)}const g=u.fn({...t,[m]:v,[h]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[m]:a,[h]:s}}}}}},ii=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=de(e,t),d={x:n,y:r},f=se(o),h=Gt(f);let m=d[h],v=d[f];const p=de(s,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(u){const x=h==="y"?"height":"width",C=i.reference[h]-i.floating[x]+g.mainAxis,A=i.reference[h]+i.reference[x]-g.mainAxis;m<C?m=C:m>A&&(m=A)}if(l){var y,E;const x=h==="y"?"width":"height",C=Gn.has(fe(o)),A=i.reference[f]-i.floating[x]+(C&&((y=a.offset)==null?void 0:y[f])||0)+(C?0:g.crossAxis),R=i.reference[f]+i.reference[x]+(C?0:((E=a.offset)==null?void 0:E[f])||0)-(C?g.crossAxis:0);v<A?v=A:v>R&&(v=R)}return{[h]:m,[f]:v}}}},si=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:u=()=>{},...l}=de(e,t),d=await a.detectOverflow(t,l),f=fe(o),h=Fe(o),m=se(o)==="y",{width:v,height:p}=i.floating;let g,y;f==="top"||f==="bottom"?(g=f,y=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=f,g=h==="end"?"top":"bottom");const E=p-d.top-d.bottom,x=v-d.left-d.right,C=be(p-d[g],E),A=be(v-d[y],x),R=!t.middlewareData.shift;let S=C,I=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=E),R&&!h){const j=Q(d.left,0),F=Q(d.right,0),O=Q(d.top,0),B=Q(d.bottom,0);m?I=v-2*(j!==0||F!==0?j+F:Q(d.left,d.right)):S=p-2*(O!==0||B!==0?O+B:Q(d.top,d.bottom))}await u({...t,availableWidth:I,availableHeight:S});const _=await a.getDimensions(s.floating);return v!==_.width||p!==_.height?{reset:{rects:!0}}:{}}}};function dt(){return typeof window<"u"}function We(e){return Kn(e)?(e.nodeName||"").toLowerCase():"#document"}function ee(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function le(e){var t;return(t=(Kn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kn(e){return dt()?e instanceof Node||e instanceof ee(e).Node:!1}function te(e){return dt()?e instanceof Element||e instanceof ee(e).Element:!1}function pe(e){return dt()?e instanceof HTMLElement||e instanceof ee(e).HTMLElement:!1}function Cn(e){return!dt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ee(e).ShadowRoot}function Ke(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function ai(e){return/^(table|td|th)$/.test(We(e))}function ft(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ci=/transform|translate|scale|rotate|perspective|filter/,li=/paint|layout|strict|content/,Ce=e=>!!e&&e!=="none";let Ct;function Yt(e){const t=te(e)?ne(e):e;return Ce(t.transform)||Ce(t.translate)||Ce(t.scale)||Ce(t.rotate)||Ce(t.perspective)||!qt()&&(Ce(t.backdropFilter)||Ce(t.filter))||ci.test(t.willChange||"")||li.test(t.contain||"")}function ui(e){let t=ye(e);for(;pe(t)&&!ze(t);){if(Yt(t))return t;if(ft(t))return null;t=ye(t)}return null}function qt(){return Ct==null&&(Ct=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ct}function ze(e){return/^(html|body|#document)$/.test(We(e))}function ne(e){return ee(e).getComputedStyle(e)}function pt(e){return te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ye(e){if(We(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cn(e)&&e.host||le(e);return Cn(t)?t.host:t}function Xn(e){const t=ye(e);return ze(t)?e.ownerDocument?e.ownerDocument.body:e.body:pe(t)&&Ke(t)?t:Xn(t)}function Ge(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Xn(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=ee(o);if(i){const s=Lt(a);return t.concat(a,a.visualViewport||[],Ke(o)?o:[],s&&n?Ge(s):[])}else return t.concat(o,Ge(o,[],n))}function Lt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yn(e){const t=ne(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pe(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=st(n)!==i||st(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Zt(e){return te(e)?e:e.contextElement}function Te(e){const t=Zt(e);if(!pe(t))return ce(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Yn(t);let a=(i?st(n.width):n.width)/r,s=(i?st(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const di=ce(0);function qn(e){const t=ee(e);return!qt()||!t.visualViewport?di:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ee(e)?!1:t}function Se(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Zt(e);let a=ce(1);t&&(r?te(r)&&(a=Te(r)):a=Te(e));const s=fi(i,n,r)?qn(i):ce(0);let u=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(i){const h=ee(i),m=r&&te(r)?ee(r):r;let v=h,p=Lt(v);for(;p&&r&&m!==v;){const g=Te(p),y=p.getBoundingClientRect(),E=ne(p),x=y.left+(p.clientLeft+parseFloat(E.paddingLeft))*g.x,C=y.top+(p.clientTop+parseFloat(E.paddingTop))*g.y;u*=g.x,l*=g.y,d*=g.x,f*=g.y,u+=x,l+=C,v=ee(p),p=Lt(v)}}return ct({width:d,height:f,x:u,y:l})}function mt(e,t){const n=pt(e).scrollLeft;return t?t.left+n:Se(le(e)).left+n}function Zn(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function pi(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=le(r),s=t?ft(t.floating):!1;if(r===a||s&&i)return n;let u={scrollLeft:0,scrollTop:0},l=ce(1);const d=ce(0),f=pe(r);if((f||!f&&!i)&&((We(r)!=="body"||Ke(a))&&(u=pt(r)),f)){const m=Se(r);l=Te(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=a&&!f&&!i?Zn(a,u):ce(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+d.x+h.x,y:n.y*l.y-u.scrollTop*l.y+d.y+h.y}}function mi(e){return Array.from(e.getClientRects())}function hi(e){const t=le(e),n=pt(e),r=e.ownerDocument.body,o=Q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+mt(e);const s=-n.scrollTop;return ne(r).direction==="rtl"&&(a+=Q(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}const En=25;function gi(e,t){const n=ee(e),r=le(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;const d=qt();(!d||d&&t==="fixed")&&(s=o.offsetLeft,u=o.offsetTop)}const l=mt(r);if(l<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-m);v<=En&&(i-=v)}else l<=En&&(i+=l);return{width:i,height:a,x:s,y:u}}function vi(e,t){const n=Se(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=pe(e)?Te(e):ce(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,u=o*i.x,l=r*i.y;return{width:a,height:s,x:u,y:l}}function Sn(e,t,n){let r;if(t==="viewport")r=gi(e,n);else if(t==="document")r=hi(le(e));else if(te(t))r=vi(t,n);else{const o=qn(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ct(r)}function Qn(e,t){const n=ye(e);return n===t||!te(n)||ze(n)?!1:ne(n).position==="fixed"||Qn(n,t)}function bi(e,t){const n=t.get(e);if(n)return n;let r=Ge(e,[],!1).filter(s=>te(s)&&We(s)!=="body"),o=null;const i=ne(e).position==="fixed";let a=i?ye(e):e;for(;te(a)&&!ze(a);){const s=ne(a),u=Yt(a);!u&&s.position==="fixed"&&(o=null),(i?!u&&!o:!u&&s.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ke(a)&&!u&&Qn(e,a))?r=r.filter(d=>d!==a):o=s,a=ye(a)}return t.set(e,r),r}function yi(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?ft(t)?[]:bi(t,this._c):[].concat(n),r],s=Sn(t,a[0],o);let u=s.top,l=s.right,d=s.bottom,f=s.left;for(let h=1;h<a.length;h++){const m=Sn(t,a[h],o);u=Q(m.top,u),l=be(m.right,l),d=be(m.bottom,d),f=Q(m.left,f)}return{width:l-f,height:d-u,x:f,y:u}}function xi(e){const{width:t,height:n}=Yn(e);return{width:t,height:n}}function wi(e,t,n){const r=pe(t),o=le(t),i=n==="fixed",a=Se(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const u=ce(0);function l(){u.x=mt(o)}if(r||!r&&!i)if((We(t)!=="body"||Ke(o))&&(s=pt(t)),r){const m=Se(t,!0,i,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&l();i&&!r&&o&&l();const d=o&&!r&&!i?Zn(o,s):ce(0),f=a.left+s.scrollLeft-u.x-d.x,h=a.top+s.scrollTop-u.y-d.y;return{x:f,y:h,width:a.width,height:a.height}}function Et(e){return ne(e).position==="static"}function Rn(e,t){if(!pe(e)||ne(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return le(e)===n&&(n=n.ownerDocument.body),n}function Jn(e,t){const n=ee(e);if(ft(e))return n;if(!pe(e)){let o=ye(e);for(;o&&!ze(o);){if(te(o)&&!Et(o))return o;o=ye(o)}return n}let r=Rn(e,t);for(;r&&ai(r)&&Et(r);)r=Rn(r,t);return r&&ze(r)&&Et(r)&&!Yt(r)?n:r||ui(e)||n}const Ci=async function(e){const t=this.getOffsetParent||Jn,n=this.getDimensions,r=await n(e.floating);return{reference:wi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ei(e){return ne(e).direction==="rtl"}const Si={convertOffsetParentRelativeRectToViewportRelativeRect:pi,getDocumentElement:le,getClippingRect:yi,getOffsetParent:Jn,getElementRects:Ci,getClientRects:mi,getDimensions:xi,getScale:Te,isElement:te,isRTL:Ei};function er(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ri(e,t){let n=null,r;const o=le(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),i();const l=e.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=l;if(s||t(),!h||!m)return;const v=Ze(f),p=Ze(o.clientWidth-(d+h)),g=Ze(o.clientHeight-(f+m)),y=Ze(d),x={rootMargin:-v+"px "+-p+"px "+-g+"px "+-y+"px",threshold:Q(0,be(1,u))||1};let C=!0;function A(R){const S=R[0].intersectionRatio;if(S!==u){if(!C)return a();S?a(!1,S):r=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!er(l,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(A,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(e)}return a(!0),i}function Ai(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=Zt(e),d=o||i?[...l?Ge(l):[],...t?Ge(t):[]]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=l&&s?Ri(l,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[E]=y;E&&E.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),l&&!u&&m.observe(l),t&&m.observe(t));let v,p=u?Se(e):null;u&&g();function g(){const y=Se(e);p&&!er(p,y)&&n(),p=y,v=requestAnimationFrame(g)}return n(),()=>{var y;d.forEach(E=>{o&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),f?.(),(y=m)==null||y.disconnect(),m=null,u&&cancelAnimationFrame(v)}}const Pi=ri,Oi=oi,ki=ei,Ni=si,Mi=ti,An=Jo,Di=ii,Ti=(e,t,n)=>{const r=new Map,o={platform:Si,...n},i={...o.platform,_c:r};return Qo(e,t,{...o,platform:i})};var Ii=typeof document<"u",ji=function(){},rt=Ii?$t.useLayoutEffect:ji;function lt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!lt(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;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!lt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function tr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pn(e,t){const n=tr(e);return Math.round(t*n)/n}function St(e){const t=c.useRef(e);return rt(()=>{t.current=e}),t}function Li(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:u,open:l}=e,[d,f]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=c.useState(r);lt(h,r)||m(r);const[v,p]=c.useState(null),[g,y]=c.useState(null),E=c.useCallback(N=>{N!==R.current&&(R.current=N,p(N))},[]),x=c.useCallback(N=>{N!==S.current&&(S.current=N,y(N))},[]),C=i||v,A=a||g,R=c.useRef(null),S=c.useRef(null),I=c.useRef(d),_=u!=null,j=St(u),F=St(o),O=St(l),B=c.useCallback(()=>{if(!R.current||!S.current)return;const N={placement:t,strategy:n,middleware:h};F.current&&(N.platform=F.current),Ti(R.current,S.current,N).then(H=>{const X={...H,isPositioned:O.current!==!1};T.current&&!lt(I.current,X)&&(I.current=X,Wn.flushSync(()=>{f(X)}))})},[h,t,n,F,O]);rt(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[l]);const T=c.useRef(!1);rt(()=>(T.current=!0,()=>{T.current=!1}),[]),rt(()=>{if(C&&(R.current=C),A&&(S.current=A),C&&A){if(j.current)return j.current(C,A,B);B()}},[C,A,B,j,_]);const U=c.useMemo(()=>({reference:R,floating:S,setReference:E,setFloating:x}),[E,x]),W=c.useMemo(()=>({reference:C,floating:A}),[C,A]),$=c.useMemo(()=>{const N={position:n,left:0,top:0};if(!W.floating)return N;const H=Pn(W.floating,d.x),X=Pn(W.floating,d.y);return s?{...N,transform:"translate("+H+"px, "+X+"px)",...tr(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:X}},[n,s,W.floating,d.x,d.y]);return c.useMemo(()=>({...d,update:B,refs:U,elements:W,floatingStyles:$}),[d,B,U,W,$])}const zi=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?An({element:r.current,padding:o}).fn(n):{}:r?An({element:r,padding:o}).fn(n):{}}}},_i=(e,t)=>{const n=Pi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fi=(e,t)=>{const n=Oi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wi=(e,t)=>({fn:Di(e).fn,options:[e,t]}),$i=(e,t)=>{const n=ki(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bi=(e,t)=>{const n=Ni(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hi=(e,t)=>{const n=Mi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vi=(e,t)=>{const n=zi(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ui="Arrow",nr=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return b.jsx(G.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});nr.displayName=Ui;var Gi=nr;function Ki(e){const[t,n]=c.useState(void 0);return ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const u=i.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Qt="Popper",[rr,or]=Bt(Qt),[Xi,ir]=rr(Qt),sr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return b.jsx(Xi,{scope:t,anchor:r,onAnchorChange:o,children:n})};sr.displayName=Qt;var ar="PopperAnchor",cr=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=ir(ar,n),a=c.useRef(null),s=re(t,a),u=c.useRef(null);return c.useEffect(()=>{const l=u.current;u.current=r?.current||a.current,l!==u.current&&i.onAnchorChange(u.current)}),r?null:b.jsx(G.div,{...o,ref:s})});cr.displayName=ar;var Jt="PopperContent",[Yi,qi]=rr(Jt),lr=c.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:v,...p}=e,g=ir(Jt,n),[y,E]=c.useState(null),x=re(t,z=>E(z)),[C,A]=c.useState(null),R=Ki(C),S=R?.width??0,I=R?.height??0,_=r+(i!=="center"?"-"+i:""),j=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(l)?l:[l],O=F.length>0,B={padding:j,boundary:F.filter(Qi),altBoundary:O},{refs:T,floatingStyles:U,placement:W,isPositioned:$,middlewareData:N}=Li({strategy:"fixed",placement:_,whileElementsMounted:(...z)=>Ai(...z,{animationFrame:m==="always"}),elements:{reference:g.anchor},middleware:[_i({mainAxis:o+I,alignmentAxis:a}),u&&Fi({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Wi():void 0,...B}),u&&$i({...B}),Bi({...B,apply:({elements:z,rects:Y,availableWidth:K,availableHeight:Pe})=>{const{width:po,height:mo}=Y.reference,qe=z.floating.style;qe.setProperty("--radix-popper-available-width",`${K}px`),qe.setProperty("--radix-popper-available-height",`${Pe}px`),qe.setProperty("--radix-popper-anchor-width",`${po}px`),qe.setProperty("--radix-popper-anchor-height",`${mo}px`)}}),C&&Vi({element:C,padding:s}),Ji({arrowWidth:S,arrowHeight:I}),h&&Hi({strategy:"referenceHidden",...B})]}),[H,X]=fr(W),q=Le(v);ve(()=>{$&&q?.()},[$,q]);const w=N.arrow?.x,k=N.arrow?.y,D=N.arrow?.centerOffset!==0,[P,L]=c.useState();return ve(()=>{y&&L(window.getComputedStyle(y).zIndex)},[y]),b.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:$?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:P,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(Yi,{scope:n,placedSide:H,onArrowChange:A,arrowX:w,arrowY:k,shouldHideArrow:D,children:b.jsx(G.div,{"data-side":H,"data-align":X,...p,ref:x,style:{...p.style,animation:$?void 0:"none"}})})})});lr.displayName=Jt;var ur="PopperArrow",Zi={top:"bottom",right:"left",bottom:"top",left:"right"},dr=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=qi(ur,r),a=Zi[i.placedSide];return b.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:b.jsx(Gi,{...o,ref:n,style:{...o.style,display:"block"}})})});dr.displayName=ur;function Qi(e){return e!==null}var Ji=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,d]=fr(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(o.arrow?.x??0)+s/2,m=(o.arrow?.y??0)+u/2;let v="",p="";return l==="bottom"?(v=a?f:`${h}px`,p=`${-u}px`):l==="top"?(v=a?f:`${h}px`,p=`${r.floating.height+u}px`):l==="right"?(v=`${-u}px`,p=a?f:`${m}px`):l==="left"&&(v=`${r.floating.width+u}px`,p=a?f:`${m}px`),{data:{x:v,y:p}}}});function fr(e){const[t,n="center"]=e.split("-");return[t,n]}var es=sr,pr=cr,ts=lr,ns=dr,rs="Portal",en=c.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=c.useState(!1);ve(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?_n.createPortal(b.jsx(G.div,{...r,ref:t}),a):null});en.displayName=rs;function os(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var $e=e=>{const{present:t,children:n}=e,r=is(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=re(r.ref,ss(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};$e.displayName="Presence";function is(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),i=c.useRef("none"),a=e?"mounted":"unmounted",[s,u]=os(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=Qe(r.current);i.current=s==="mounted"?l:"none"},[s]),ve(()=>{const l=r.current,d=o.current;if(d!==e){const h=i.current,m=Qe(l);e?u("MOUNT"):m==="none"||l?.display==="none"?u("UNMOUNT"):u(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ve(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,f=m=>{const p=Qe(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&p&&(u("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=m=>{m.target===t&&(i.current=Qe(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Qe(e){return e?.animationName||"none"}function ss(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var as=c[" useInsertionEffect ".trim().toString()]||ve;function mr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=cs({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:o;{const d=c.useRef(e!==void 0);c.useEffect(()=>{const f=d.current;f!==s&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,r])}const l=c.useCallback(d=>{if(s){const f=ls(d)?d(e):d;f!==e&&a.current?.(f)}else i(d)},[s,e,i,a]);return[u,l]}function cs({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return as(()=>{i.current=t},[t]),c.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function ls(e){return typeof e=="function"}var us=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,Je=new WeakMap,et={},Rt=0,hr=function(e){return e&&(e.host||hr(e.parentNode))},ds=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},fs=function(e,t,n,r){var o=ds(t,Array.isArray(e)?e:[e]);et[n]||(et[n]=new WeakMap);var i=et[n],a=[],s=new Set,u=new Set(o),l=function(f){!f||s.has(f)||(s.add(f),l(f.parentNode))};o.forEach(l);var d=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(h){if(s.has(h))d(h);else try{var m=h.getAttribute(r),v=m!==null&&m!=="false",p=(Oe.get(h)||0)+1,g=(i.get(h)||0)+1;Oe.set(h,p),i.set(h,g),a.push(h),p===1&&v&&Je.set(h,!0),g===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),s.clear(),Rt++,function(){a.forEach(function(f){var h=Oe.get(f)-1,m=i.get(f)-1;Oe.set(f,h),i.set(f,m),h||(Je.has(f)||f.removeAttribute(r),Je.delete(f)),m||f.removeAttribute(n)}),Rt--,Rt||(Oe=new WeakMap,Oe=new WeakMap,Je=new WeakMap,et={})}},gr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=us(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),fs(r,o,n,"aria-hidden")):function(){return null}},ie=function(){return ie=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ie.apply(this,arguments)};function vr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ps(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ot="right-scroll-bar-position",it="width-before-scroll-bar",ms="with-scroll-bars-hidden",hs="--removed-body-scroll-bar-size";function At(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gs(e,t){var n=$t.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var vs=typeof window<"u"?c.useLayoutEffect:c.useEffect,On=new WeakMap;function bs(e,t){var n=gs(null,function(r){return e.forEach(function(o){return At(o,r)})});return vs(function(){var r=On.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||At(s,null)}),i.forEach(function(s){o.has(s)||At(s,a)})}On.set(n,e)},[e]),n}function ys(e){return e}function xs(e,t){t===void 0&&(t=ys);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var u=function(){var d=a;a=[],d.forEach(i)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(d){a.push(d),l()},filter:function(d){return a=a.filter(d),n}}}};return o}function ws(e){e===void 0&&(e={});var t=xs(null);return t.options=ie({async:!0,ssr:!1},e),t}var br=function(e){var t=e.sideCar,n=vr(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,ie({},n))};br.isSideCarExport=!0;function Cs(e,t){return e.useMedium(t),br}var yr=ws(),Pt=function(){},ht=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Pt,onWheelCapture:Pt,onTouchMoveCapture:Pt}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noRelative,v=e.noIsolation,p=e.inert,g=e.allowPinchZoom,y=e.as,E=y===void 0?"div":y,x=e.gapMode,C=vr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=h,R=bs([n,t]),S=ie(ie({},C),o);return c.createElement(c.Fragment,null,d&&c.createElement(A,{sideCar:yr,removeScrollBar:l,shards:f,noRelative:m,noIsolation:v,inert:p,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:x}),a?c.cloneElement(c.Children.only(s),ie(ie({},S),{ref:R})):c.createElement(E,ie({},S,{className:u,ref:R}),s))});ht.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ht.classNames={fullWidth:it,zeroRight:ot};var Es=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ss(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Es();return t&&e.setAttribute("nonce",t),e}function Rs(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function As(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ps=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ss())&&(Rs(t,n),As(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Os=function(){var e=Ps();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xr=function(){var e=Os(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ks={left:0,top:0,right:0,gap:0},Ot=function(e){return parseInt(e||"",10)||0},Ns=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ot(n),Ot(r),Ot(o)]},Ms=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ks;var t=Ns(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ds=xr(),Ie="data-scroll-locked",Ts=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
2
+ .`.concat(ms,` {
3
+ overflow: hidden `).concat(r,`;
4
+ padding-right: `).concat(s,"px ").concat(r,`;
5
+ }
6
+ body[`).concat(Ie,`] {
7
+ overflow: hidden `).concat(r,`;
8
+ overscroll-behavior: contain;
9
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
10
+ padding-left: `.concat(o,`px;
11
+ padding-top: `).concat(i,`px;
12
+ padding-right: `).concat(a,`px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: `).concat(s,"px ").concat(r,`;
16
+ `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
17
+ }
18
+
19
+ .`).concat(ot,` {
20
+ right: `).concat(s,"px ").concat(r,`;
21
+ }
22
+
23
+ .`).concat(it,` {
24
+ margin-right: `).concat(s,"px ").concat(r,`;
25
+ }
26
+
27
+ .`).concat(ot," .").concat(ot,` {
28
+ right: 0 `).concat(r,`;
29
+ }
30
+
31
+ .`).concat(it," .").concat(it,` {
32
+ margin-right: 0 `).concat(r,`;
33
+ }
34
+
35
+ body[`).concat(Ie,`] {
36
+ `).concat(hs,": ").concat(s,`px;
37
+ }
38
+ `)},kn=function(){var e=parseInt(document.body.getAttribute(Ie)||"0",10);return isFinite(e)?e:0},Is=function(){c.useEffect(function(){return document.body.setAttribute(Ie,(kn()+1).toString()),function(){var e=kn()-1;e<=0?document.body.removeAttribute(Ie):document.body.setAttribute(Ie,e.toString())}},[])},js=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Is();var i=c.useMemo(function(){return Ms(o)},[o]);return c.createElement(Ds,{styles:Ts(i,!t,o,n?"":"!important")})},zt=!1;if(typeof window<"u")try{var tt=Object.defineProperty({},"passive",{get:function(){return zt=!0,!0}});window.addEventListener("test",tt,tt),window.removeEventListener("test",tt,tt)}catch{zt=!1}var ke=zt?{passive:!1}:!1,Ls=function(e){return e.tagName==="TEXTAREA"},wr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ls(e)&&n[t]==="visible")},zs=function(e){return wr(e,"overflowY")},_s=function(e){return wr(e,"overflowX")},Nn=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Cr(e,r);if(o){var i=Er(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Fs=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ws=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Cr=function(e,t){return e==="v"?zs(t):_s(t)},Er=function(e,t){return e==="v"?Fs(t):Ws(t)},$s=function(e,t){return e==="h"&&t==="rtl"?-1:1},Bs=function(e,t,n,r,o){var i=$s(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,u=t.contains(s),l=!1,d=a>0,f=0,h=0;do{if(!s)break;var m=Er(e,s),v=m[0],p=m[1],g=m[2],y=p-g-i*v;(v||y)&&Cr(e,s)&&(f+=y,h+=v);var E=s.parentNode;s=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(l=!0),l},nt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mn=function(e){return[e.deltaX,e.deltaY]},Dn=function(e){return e&&"current"in e?e.current:e},Hs=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vs=function(e){return`
39
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
40
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
+ `)},Us=0,Ne=[];function Gs(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(Us++)[0],i=c.useState(xr)[0],a=c.useRef(e);c.useEffect(function(){a.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=ps([e.lockRef.current],(e.shards||[]).map(Dn),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var y=nt(p),E=n.current,x="deltaX"in p?p.deltaX:E[0]-y[0],C="deltaY"in p?p.deltaY:E[1]-y[1],A,R=p.target,S=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in p&&S==="h"&&R.type==="range")return!1;var I=window.getSelection(),_=I&&I.anchorNode,j=_?_===R||_.contains(R):!1;if(j)return!1;var F=Nn(S,R);if(!F)return!0;if(F?A=S:(A=S==="v"?"h":"v",F=Nn(S,R)),!F)return!1;if(!r.current&&"changedTouches"in p&&(x||C)&&(r.current=A),!A)return!0;var O=r.current||A;return Bs(O,g,p,O==="h"?x:C)},[]),u=c.useCallback(function(p){var g=p;if(!(!Ne.length||Ne[Ne.length-1]!==i)){var y="deltaY"in g?Mn(g):nt(g),E=t.current.filter(function(A){return A.name===g.type&&(A.target===g.target||g.target===A.shadowParent)&&Hs(A.delta,y)})[0];if(E&&E.should){g.cancelable&&g.preventDefault();return}if(!E){var x=(a.current.shards||[]).map(Dn).filter(Boolean).filter(function(A){return A.contains(g.target)}),C=x.length>0?s(g,x[0]):!a.current.noIsolation;C&&g.cancelable&&g.preventDefault()}}},[]),l=c.useCallback(function(p,g,y,E){var x={name:p,delta:g,target:y,should:E,shadowParent:Ks(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),d=c.useCallback(function(p){n.current=nt(p),r.current=void 0},[]),f=c.useCallback(function(p){l(p.type,Mn(p),p.target,s(p,e.lockRef.current))},[]),h=c.useCallback(function(p){l(p.type,nt(p),p.target,s(p,e.lockRef.current))},[]);c.useEffect(function(){return Ne.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,ke),document.addEventListener("touchmove",u,ke),document.addEventListener("touchstart",d,ke),function(){Ne=Ne.filter(function(p){return p!==i}),document.removeEventListener("wheel",u,ke),document.removeEventListener("touchmove",u,ke),document.removeEventListener("touchstart",d,ke)}},[]);var m=e.removeScrollBar,v=e.inert;return c.createElement(c.Fragment,null,v?c.createElement(i,{styles:Vs(o)}):null,m?c.createElement(js,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ks(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Xs=Cs(yr,Gs);var tn=c.forwardRef(function(e,t){return c.createElement(ht,ie({},e,{ref:t,sideCar:Xs}))});tn.classNames=ht.classNames;var gt="Popover",[Sr]=Bt(gt,[or]),Xe=or(),[Ys,we]=Sr(gt),Rr=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=Xe(t),u=c.useRef(null),[l,d]=c.useState(!1),[f,h]=mr({prop:r,defaultProp:o??!1,onChange:i,caller:gt});return b.jsx(es,{...s,children:b.jsx(Ys,{scope:t,contentId:ae(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:c.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:l,onCustomAnchorAdd:c.useCallback(()=>d(!0),[]),onCustomAnchorRemove:c.useCallback(()=>d(!1),[]),modal:a,children:n})})};Rr.displayName=gt;var Ar="PopoverAnchor",qs=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=we(Ar,n),i=Xe(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return c.useEffect(()=>(a(),()=>s()),[a,s]),b.jsx(pr,{...i,...r,ref:t})});qs.displayName=Ar;var Pr="PopoverTrigger",Or=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=we(Pr,n),i=Xe(n),a=re(t,o.triggerRef),s=b.jsx(G.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Tr(o.open),...r,ref:a,onClick:J(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:b.jsx(pr,{asChild:!0,...i,children:s})});Or.displayName=Pr;var nn="PopoverPortal",[Zs,Qs]=Sr(nn,{forceMount:void 0}),kr=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=we(nn,t);return b.jsx(Zs,{scope:t,forceMount:n,children:b.jsx($e,{present:n||i.open,children:b.jsx(en,{asChild:!0,container:o,children:r})})})};kr.displayName=nn;var _e="PopoverContent",Nr=c.forwardRef((e,t)=>{const n=Qs(_e,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=we(_e,e.__scopePopover);return b.jsx($e,{present:r||i.open,children:i.modal?b.jsx(ea,{...o,ref:t}):b.jsx(ta,{...o,ref:t})})});Nr.displayName=_e;var Js=Ht("PopoverContent.RemoveScroll"),ea=c.forwardRef((e,t)=>{const n=we(_e,e.__scopePopover),r=c.useRef(null),o=re(t,r),i=c.useRef(!1);return c.useEffect(()=>{const a=r.current;if(a)return gr(a)},[]),b.jsx(tn,{as:Js,allowPinchZoom:!0,children:b.jsx(Mr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,a=>{a.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,l=s.button===2||u;i.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ta=c.forwardRef((e,t)=>{const n=we(_e,e.__scopePopover),r=c.useRef(!1),o=c.useRef(!1);return b.jsx(Mr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Mr=c.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:d,...f}=e,h=we(_e,n),m=Xe(n);return Hn(),b.jsx(Ut,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:b.jsx(Vt,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:b.jsx(ts,{"data-state":Tr(h.open),role:"dialog",id:h.contentId,...m,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Dr="PopoverClose",na=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=we(Dr,n);return b.jsx(G.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});na.displayName=Dr;var ra="PopoverArrow",oa=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xe(n);return b.jsx(ns,{...o,...r,ref:t})});oa.displayName=ra;function Tr(e){return e?"open":"closed"}var ia=Rr,sa=Or,aa=kr,ca=Nr,Tn=1,la=.9,ua=.8,da=.17,kt=.1,Nt=.999,fa=.9999,pa=.99,ma=/[\\\/_+.#"@\[\(\{&]/,ha=/[\\\/_+.#"@\[\(\{&]/g,ga=/[\s-]/,Ir=/[\s-]/g;function _t(e,t,n,r,o,i,a){if(i===t.length)return o===e.length?Tn:pa;var s=`${o},${i}`;if(a[s]!==void 0)return a[s];for(var u=r.charAt(i),l=n.indexOf(u,o),d=0,f,h,m,v;l>=0;)f=_t(e,t,n,r,l+1,i+1,a),f>d&&(l===o?f*=Tn:ma.test(e.charAt(l-1))?(f*=ua,m=e.slice(o,l-1).match(ha),m&&o>0&&(f*=Math.pow(Nt,m.length))):ga.test(e.charAt(l-1))?(f*=la,v=e.slice(o,l-1).match(Ir),v&&o>0&&(f*=Math.pow(Nt,v.length))):(f*=da,o>0&&(f*=Math.pow(Nt,l-o))),e.charAt(l)!==t.charAt(i)&&(f*=fa)),(f<kt&&n.charAt(l-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(l-1)!==r.charAt(i))&&(h=_t(e,t,n,r,l+1,i+2,a),h*kt>f&&(f=h*kt)),f>d&&(d=f),l=n.indexOf(u,l+1);return a[s]=d,d}function In(e){return e.toLowerCase().replace(Ir," ")}function va(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,_t(e,t,In(e),In(t),0,0,{})}var vt="Dialog",[jr]=Bt(vt),[ba,oe]=jr(vt),Lr=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=c.useRef(null),u=c.useRef(null),[l,d]=mr({prop:r,defaultProp:o??!1,onChange:i,caller:vt});return b.jsx(ba,{scope:t,triggerRef:s,contentRef:u,contentId:ae(),titleId:ae(),descriptionId:ae(),open:l,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(f=>!f),[d]),modal:a,children:n})};Lr.displayName=vt;var zr="DialogTrigger",ya=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(zr,n),i=re(t,o.triggerRef);return b.jsx(G.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":sn(o.open),...r,ref:i,onClick:J(e.onClick,o.onOpenToggle)})});ya.displayName=zr;var rn="DialogPortal",[xa,_r]=jr(rn,{forceMount:void 0}),Fr=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=oe(rn,t);return b.jsx(xa,{scope:t,forceMount:n,children:c.Children.map(r,a=>b.jsx($e,{present:n||i.open,children:b.jsx(en,{asChild:!0,container:o,children:a})}))})};Fr.displayName=rn;var ut="DialogOverlay",Wr=c.forwardRef((e,t)=>{const n=_r(ut,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=oe(ut,e.__scopeDialog);return i.modal?b.jsx($e,{present:r||i.open,children:b.jsx(Ca,{...o,ref:t})}):null});Wr.displayName=ut;var wa=Ht("DialogOverlay.RemoveScroll"),Ca=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(ut,n);return b.jsx(tn,{as:wa,allowPinchZoom:!0,shards:[o.contentRef],children:b.jsx(G.div,{"data-state":sn(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Re="DialogContent",$r=c.forwardRef((e,t)=>{const n=_r(Re,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=oe(Re,e.__scopeDialog);return b.jsx($e,{present:r||i.open,children:i.modal?b.jsx(Ea,{...o,ref:t}):b.jsx(Sa,{...o,ref:t})})});$r.displayName=Re;var Ea=c.forwardRef((e,t)=>{const n=oe(Re,e.__scopeDialog),r=c.useRef(null),o=re(t,n.contentRef,r);return c.useEffect(()=>{const i=r.current;if(i)return gr(i)},[]),b.jsx(Br,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:J(e.onFocusOutside,i=>i.preventDefault())})}),Sa=c.forwardRef((e,t)=>{const n=oe(Re,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return b.jsx(Br,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Br=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=oe(Re,n),u=c.useRef(null),l=re(t,u);return Hn(),b.jsxs(b.Fragment,{children:[b.jsx(Ut,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:b.jsx(Vt,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":sn(s.open),...a,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),b.jsxs(b.Fragment,{children:[b.jsx(Oa,{titleId:s.titleId}),b.jsx(Na,{contentRef:u,descriptionId:s.descriptionId})]})]})}),on="DialogTitle",Ra=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(on,n);return b.jsx(G.h2,{id:o.titleId,...r,ref:t})});Ra.displayName=on;var Hr="DialogDescription",Aa=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(Hr,n);return b.jsx(G.p,{id:o.descriptionId,...r,ref:t})});Aa.displayName=Hr;var Vr="DialogClose",Pa=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(Vr,n);return b.jsx(G.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});Pa.displayName=Vr;function sn(e){return e?"open":"closed"}var Ur="DialogTitleWarning",[Nc,Gr]=ho(Ur,{contentName:Re,titleName:on,docsSlug:"dialog"}),Oa=({titleId:e})=>{const t=Gr(Ur),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
+
43
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
+
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ka="DialogDescriptionWarning",Na=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gr(ka).contentName}}.`;return c.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ma=Lr,Da=Fr,Ta=Wr,Ia=$r,He='[cmdk-group=""]',Mt='[cmdk-group-items=""]',ja='[cmdk-group-heading=""]',Kr='[cmdk-item=""]',jn=`${Kr}:not([aria-disabled="true"])`,Ft="cmdk-item-select",Me="data-value",La=(e,t,n)=>va(e,t,n),Xr=c.createContext(void 0),Ye=()=>c.useContext(Xr),Yr=c.createContext(void 0),an=()=>c.useContext(Yr),qr=c.createContext(void 0),Zr=c.forwardRef((e,t)=>{let n=De(()=>{var w,k;return{search:"",value:(k=(w=e.value)!=null?w:e.defaultValue)!=null?k:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=De(()=>new Set),o=De(()=>new Map),i=De(()=>new Map),a=De(()=>new Set),s=ro(e),{label:u,children:l,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:v,disablePointerSelection:p=!1,vimBindings:g=!0,...y}=e,E=ae(),x=ae(),C=ae(),A=c.useRef(null),R=Ha();Ae(()=>{if(d!==void 0){let w=d.trim();n.current.value=w,S.emit()}},[d]),Ae(()=>{R(6,B)},[]);let S=c.useMemo(()=>({subscribe:w=>(a.current.add(w),()=>a.current.delete(w)),snapshot:()=>n.current,setState:(w,k,D)=>{var P,L,z,Y;if(!Object.is(n.current[w],k)){if(n.current[w]=k,w==="search")O(),j(),R(1,F);else if(w==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let K=document.getElementById(C);K?K.focus():(P=document.getElementById(E))==null||P.focus()}if(R(7,()=>{var K;n.current.selectedItemId=(K=T())==null?void 0:K.id,S.emit()}),D||R(5,B),((L=s.current)==null?void 0:L.value)!==void 0){let K=k??"";(Y=(z=s.current).onValueChange)==null||Y.call(z,K);return}}S.emit()}},emit:()=>{a.current.forEach(w=>w())}}),[]),I=c.useMemo(()=>({value:(w,k,D)=>{var P;k!==((P=i.current.get(w))==null?void 0:P.value)&&(i.current.set(w,{value:k,keywords:D}),n.current.filtered.items.set(w,_(k,D)),R(2,()=>{j(),S.emit()}))},item:(w,k)=>(r.current.add(w),k&&(o.current.has(k)?o.current.get(k).add(w):o.current.set(k,new Set([w]))),R(3,()=>{O(),j(),n.current.value||F(),S.emit()}),()=>{i.current.delete(w),r.current.delete(w),n.current.filtered.items.delete(w);let D=T();R(4,()=>{O(),D?.getAttribute("id")===w&&F(),S.emit()})}),group:w=>(o.current.has(w)||o.current.set(w,new Set),()=>{i.current.delete(w),o.current.delete(w)}),filter:()=>s.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:E,inputId:C,labelId:x,listInnerRef:A}),[]);function _(w,k){var D,P;let L=(P=(D=s.current)==null?void 0:D.filter)!=null?P:La;return w?L(w,n.current.search,k):0}function j(){if(!n.current.search||s.current.shouldFilter===!1)return;let w=n.current.filtered.items,k=[];n.current.filtered.groups.forEach(P=>{let L=o.current.get(P),z=0;L.forEach(Y=>{let K=w.get(Y);z=Math.max(K,z)}),k.push([P,z])});let D=A.current;U().sort((P,L)=>{var z,Y;let K=P.getAttribute("id"),Pe=L.getAttribute("id");return((z=w.get(Pe))!=null?z:0)-((Y=w.get(K))!=null?Y:0)}).forEach(P=>{let L=P.closest(Mt);L?L.appendChild(P.parentElement===L?P:P.closest(`${Mt} > *`)):D.appendChild(P.parentElement===D?P:P.closest(`${Mt} > *`))}),k.sort((P,L)=>L[1]-P[1]).forEach(P=>{var L;let z=(L=A.current)==null?void 0:L.querySelector(`${He}[${Me}="${encodeURIComponent(P[0])}"]`);z?.parentElement.appendChild(z)})}function F(){let w=U().find(D=>D.getAttribute("aria-disabled")!=="true"),k=w?.getAttribute(Me);S.setState("value",k||void 0)}function O(){var w,k,D,P;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let L=0;for(let z of r.current){let Y=(k=(w=i.current.get(z))==null?void 0:w.value)!=null?k:"",K=(P=(D=i.current.get(z))==null?void 0:D.keywords)!=null?P:[],Pe=_(Y,K);n.current.filtered.items.set(z,Pe),Pe>0&&L++}for(let[z,Y]of o.current)for(let K of Y)if(n.current.filtered.items.get(K)>0){n.current.filtered.groups.add(z);break}n.current.filtered.count=L}function B(){var w,k,D;let P=T();P&&(((w=P.parentElement)==null?void 0:w.firstChild)===P&&((D=(k=P.closest(He))==null?void 0:k.querySelector(ja))==null||D.scrollIntoView({block:"nearest"})),P.scrollIntoView({block:"nearest"}))}function T(){var w;return(w=A.current)==null?void 0:w.querySelector(`${Kr}[aria-selected="true"]`)}function U(){var w;return Array.from(((w=A.current)==null?void 0:w.querySelectorAll(jn))||[])}function W(w){let k=U()[w];k&&S.setState("value",k.getAttribute(Me))}function $(w){var k;let D=T(),P=U(),L=P.findIndex(Y=>Y===D),z=P[L+w];(k=s.current)!=null&&k.loop&&(z=L+w<0?P[P.length-1]:L+w===P.length?P[0]:P[L+w]),z&&S.setState("value",z.getAttribute(Me))}function N(w){let k=T(),D=k?.closest(He),P;for(;D&&!P;)D=w>0?$a(D,He):Ba(D,He),P=D?.querySelector(jn);P?S.setState("value",P.getAttribute(Me)):$(w)}let H=()=>W(U().length-1),X=w=>{w.preventDefault(),w.metaKey?H():w.altKey?N(1):$(1)},q=w=>{w.preventDefault(),w.metaKey?W(0):w.altKey?N(-1):$(-1)};return c.createElement(G.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:w=>{var k;(k=y.onKeyDown)==null||k.call(y,w);let D=w.nativeEvent.isComposing||w.keyCode===229;if(!(w.defaultPrevented||D))switch(w.key){case"n":case"j":{g&&w.ctrlKey&&X(w);break}case"ArrowDown":{X(w);break}case"p":case"k":{g&&w.ctrlKey&&q(w);break}case"ArrowUp":{q(w);break}case"Home":{w.preventDefault(),W(0);break}case"End":{w.preventDefault(),H();break}case"Enter":{w.preventDefault();let P=T();if(P){let L=new Event(Ft);P.dispatchEvent(L)}}}}},c.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:Ua},u),bt(e,w=>c.createElement(Yr.Provider,{value:S},c.createElement(Xr.Provider,{value:I},w))))}),Qr=c.forwardRef((e,t)=>{var n,r;let o=ae(),i=c.useRef(null),a=c.useContext(qr),s=Ye(),u=ro(e),l=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;Ae(()=>{if(!l)return s.item(o,a?.id)},[l]);let d=oo(o,i,[e.value,e.children,i],e.keywords),f=an(),h=xe(R=>R.value&&R.value===d.current),m=xe(R=>l||s.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);c.useEffect(()=>{let R=i.current;if(!(!R||e.disabled))return R.addEventListener(Ft,v),()=>R.removeEventListener(Ft,v)},[m,e.onSelect,e.disabled]);function v(){var R,S;p(),(S=(R=u.current).onSelect)==null||S.call(R,d.current)}function p(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:g,value:y,onSelect:E,forceMount:x,keywords:C,...A}=e;return c.createElement(G.div,{ref:Ee(i,t),...A,id:o,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!h,"data-disabled":!!g,"data-selected":!!h,onPointerMove:g||s.getDisablePointerSelection()?void 0:p,onClick:g?void 0:v},e.children)}),Jr=c.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,a=ae(),s=c.useRef(null),u=c.useRef(null),l=ae(),d=Ye(),f=xe(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);Ae(()=>d.group(a),[]),oo(a,s,[e.value,e.heading,u]);let h=c.useMemo(()=>({id:a,forceMount:o}),[o]);return c.createElement(G.div,{ref:Ee(s,t),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&c.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),bt(e,m=>c.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},c.createElement(qr.Provider,{value:h},m))))}),za=c.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=c.useRef(null),i=xe(a=>!a.search);return!n&&!i?null:c.createElement(G.div,{ref:Ee(o,t),...r,"cmdk-separator":"",role:"separator"})}),eo=c.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=an(),a=xe(l=>l.search),s=xe(l=>l.selectedItemId),u=Ye();return c.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),c.createElement(G.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":s,id:u.inputId,type:"text",value:o?e.value:a,onChange:l=>{o||i.setState("search",l.target.value),n?.(l.target.value)}})}),to=c.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=c.useRef(null),a=c.useRef(null),s=xe(l=>l.selectedItemId),u=Ye();return c.useEffect(()=>{if(a.current&&i.current){let l=a.current,d=i.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=l.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(l),()=>{cancelAnimationFrame(f),h.unobserve(l)}}},[]),c.createElement(G.div,{ref:Ee(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:u.listId},bt(e,l=>c.createElement("div",{ref:Ee(a,u.listInnerRef),"cmdk-list-sizer":""},l)))}),_a=c.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=e;return c.createElement(Ma,{open:n,onOpenChange:r},c.createElement(Da,{container:a},c.createElement(Ta,{"cmdk-overlay":"",className:o}),c.createElement(Ia,{"aria-label":e.label,"cmdk-dialog":"",className:i},c.createElement(Zr,{ref:t,...s}))))}),no=c.forwardRef((e,t)=>xe(n=>n.filtered.count===0)?c.createElement(G.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Fa=c.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return c.createElement(G.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},bt(e,a=>c.createElement("div",{"aria-hidden":!0},a)))}),Wa=Object.assign(Zr,{List:to,Item:Qr,Input:eo,Group:Jr,Separator:za,Dialog:_a,Empty:no,Loading:Fa});function $a(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ba(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ro(e){let t=c.useRef(e);return Ae(()=>{t.current=e}),t}var Ae=typeof window>"u"?c.useEffect:c.useLayoutEffect;function De(e){let t=c.useRef();return t.current===void 0&&(t.current=e()),t}function xe(e){let t=an(),n=()=>e(t.snapshot());return c.useSyncExternalStore(t.subscribe,n,n)}function oo(e,t,n,r=[]){let o=c.useRef(),i=Ye();return Ae(()=>{var a;let s=(()=>{var l;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(l=d.current.textContent)==null?void 0:l.trim():o.current}})(),u=r.map(l=>l.trim());i.value(e,s,u),(a=t.current)==null||a.setAttribute(Me,s),o.current=s}),o}var Ha=()=>{let[e,t]=c.useState(),n=De(()=>new Map);return Ae(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function Va(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function bt({asChild:e,children:t},n){return e&&c.isValidElement(t)?c.cloneElement(Va(t),{ref:t.ref},n(t.props.children)):n(t)}var Ua={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function io(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=io(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ga(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=io(e))&&(r&&(r+=" "),r+=t);return r}const cn="-",Ka=e=>{const t=Ya(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(cn);return s[0]===""&&s.length!==1&&s.shift(),so(s,t)||Xa(a)},getConflictingClassGroupIds:(a,s)=>{const u=n[a]||[];return s&&r[a]?[...u,...r[a]]:u}}},so=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?so(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(cn);return t.validators.find(({validator:a})=>a(i))?.classGroupId},Ln=/^\[(.+)\]$/,Xa=e=>{if(Ln.test(e)){const t=Ln.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ya=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Za(Object.entries(e.classGroups),n).forEach(([i,a])=>{Wt(a,r,i,t)}),r},Wt=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:zn(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(qa(o)){Wt(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{Wt(a,zn(t,i),n,r)})})},zn=(e,t)=>{let n=e;return t.split(cn).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},qa=e=>e.isThemeGetter,Za=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[n,o]}):e,Qa=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},ao="!",Ja=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,a=s=>{const u=[];let l=0,d=0,f;for(let g=0;g<s.length;g++){let y=s[g];if(l===0){if(y===o&&(r||s.slice(g,g+i)===t)){u.push(s.slice(d,g)),d=g+i;continue}if(y==="/"){f=g;continue}}y==="["?l++:y==="]"&&l--}const h=u.length===0?s:s.substring(d),m=h.startsWith(ao),v=m?h.substring(1):h,p=f&&f>d?f-d:void 0;return{modifiers:u,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:a}):a},ec=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},tc=e=>({cache:Qa(e.cacheSize),parseClassName:Ja(e),...Ka(e)}),nc=/\s+/,rc=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(nc);let s="";for(let u=a.length-1;u>=0;u-=1){const l=a[u],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:m}=n(l);let v=!!m,p=r(v?h.substring(0,m):h);if(!p){if(!v){s=l+(s.length>0?" "+s:s);continue}if(p=r(h),!p){s=l+(s.length>0?" "+s:s);continue}v=!1}const g=ec(d).join(":"),y=f?g+ao:g,E=y+p;if(i.includes(E))continue;i.push(E);const x=o(p,v);for(let C=0;C<x.length;++C){const A=x[C];i.push(y+A)}s=l+(s.length>0?" "+s:s)}return s};function oc(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=co(t))&&(r&&(r+=" "),r+=n);return r}const co=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=co(e[r]))&&(n&&(n+=" "),n+=t);return n};function ic(e,...t){let n,r,o,i=a;function a(u){const l=t.reduce((d,f)=>f(d),e());return n=tc(l),r=n.cache.get,o=n.cache.set,i=s,s(u)}function s(u){const l=r(u);if(l)return l;const d=rc(u,n);return o(u,d),d}return function(){return i(oc.apply(null,arguments))}}const V=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},lo=/^\[(?:([a-z-]+):)?(.+)\]$/i,sc=/^\d+\/\d+$/,ac=new Set(["px","full","screen"]),cc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ue=e=>je(e)||ac.has(e)||sc.test(e),me=e=>Be(e,"length",xc),je=e=>!!e&&!Number.isNaN(Number(e)),Dt=e=>Be(e,"number",je),Ve=e=>!!e&&Number.isInteger(Number(e)),pc=e=>e.endsWith("%")&&je(e.slice(0,-1)),M=e=>lo.test(e),he=e=>cc.test(e),mc=new Set(["length","size","percentage"]),hc=e=>Be(e,mc,uo),gc=e=>Be(e,"position",uo),vc=new Set(["image","url"]),bc=e=>Be(e,vc,Cc),yc=e=>Be(e,"",wc),Ue=()=>!0,Be=(e,t,n)=>{const r=lo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},xc=e=>lc.test(e)&&!uc.test(e),uo=()=>!1,wc=e=>dc.test(e),Cc=e=>fc.test(e),Ec=()=>{const e=V("colors"),t=V("spacing"),n=V("blur"),r=V("brightness"),o=V("borderColor"),i=V("borderRadius"),a=V("borderSpacing"),s=V("borderWidth"),u=V("contrast"),l=V("grayscale"),d=V("hueRotate"),f=V("invert"),h=V("gap"),m=V("gradientColorStops"),v=V("gradientColorStopPositions"),p=V("inset"),g=V("margin"),y=V("opacity"),E=V("padding"),x=V("saturate"),C=V("scale"),A=V("sepia"),R=V("skew"),S=V("space"),I=V("translate"),_=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",M,t],O=()=>[M,t],B=()=>["",ue,me],T=()=>["auto",je,M],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",M],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[je,M];return{cacheSize:500,separator:":",theme:{colors:[Ue],spacing:[ue,me],blur:["none","",he,M],brightness:q(),borderColor:[e],borderRadius:["none","","full",he,M],borderSpacing:O(),borderWidth:B(),contrast:q(),grayscale:H(),hueRotate:q(),invert:H(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[pc,me],inset:F(),margin:F(),opacity:q(),padding:O(),saturate:q(),scale:q(),sepia:H(),skew:q(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",M]}],container:["container"],columns:[{columns:[he]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),M]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ve,M]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",M]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Ve,M]}],"grid-cols":[{"grid-cols":[Ue]}],"col-start-end":[{col:["auto",{span:["full",Ve,M]},M]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[Ue]}],"row-start-end":[{row:["auto",{span:[Ve,M]},M]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",M]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",M]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",M,t]}],"min-w":[{"min-w":[M,t,"min","max","fit"]}],"max-w":[{"max-w":[M,t,"none","full","min","max","fit","prose",{screen:[he]},he]}],h:[{h:[M,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[M,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[M,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[M,t,"auto","min","max","fit"]}],"font-size":[{text:["base",he,me]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dt]}],"font-family":[{font:[Ue]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",M]}],"line-clamp":[{"line-clamp":["none",je,Dt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ue,M]}],"list-image":[{"list-image":["none",M]}],"list-style-type":[{list:["none","disc","decimal",M]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ue,me]}],"underline-offset":[{"underline-offset":["auto",ue,M]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",M]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",M]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),gc]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hc]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},bc]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:W()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[ue,M]}],"outline-w":[{outline:[ue,me]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ue,me]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",he,yc]}],"shadow-color":[{shadow:[Ue]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",he,M]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",M]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",M]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",M]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Ve,M]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",M]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",M]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",M]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ue,me,Dt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Sc=ic(Ec);function Z(...e){return Sc(Ga(e))}const fo=({size:e=12})=>b.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[b.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Rc=({size:e=12})=>b.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:b.jsx("polyline",{points:"20 6 9 17 4 12"})}),Ac=({size:e=14})=>b.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[b.jsx("polyline",{points:"7 15 12 20 17 15"}),b.jsx("polyline",{points:"7 9 12 4 17 9"})]}),Pc=({size:e=14})=>b.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[b.jsx("circle",{cx:"11",cy:"11",r:"8"}),b.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),Oc=({label:e,onRemove:t,disabled:n})=>b.jsxs("span",{className:Z("inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5","text-xs font-medium transition-colors","border-zinc-200 bg-zinc-100 text-zinc-800","dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-200",n&&"opacity-60"),children:[e,!n&&b.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:r=>{r.stopPropagation(),t()},className:Z("ml-0.5 flex items-center justify-center rounded-sm","text-zinc-500 transition-colors","hover:bg-zinc-200 hover:text-zinc-900","dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-100","focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400"),children:b.jsx(fo,{size:10})})]}),kc=c.forwardRef(({options:e,value:t=[],onValueChange:n,placeholder:r="Select options...",searchPlaceholder:o="Search...",emptyText:i="No options found.",disabled:a=!1,maxCount:s,clearable:u=!0,className:l,contentClassName:d,"aria-label":f},h)=>{const[m,v]=c.useState(!1),p=c.useMemo(()=>new Set(t),[t]),g=c.useCallback(x=>{if(n)if(p.has(x))n(t.filter(C=>C!==x));else{if(s!==void 0&&t.length>=s)return;n([...t,x])}},[t,p,n,s]),y=c.useMemo(()=>e.filter(x=>p.has(x.value)),[e,p]),E=t.length>0;return b.jsxs(ia,{open:m,onOpenChange:v,children:[b.jsx(sa,{asChild:!0,children:b.jsxs("button",{ref:h,type:"button",role:"combobox","aria-expanded":m,"aria-haspopup":"listbox","aria-label":f??r,disabled:a,className:Z("flex min-h-9 w-full flex-wrap items-center gap-1.5","rounded-md border px-3 py-1.5 text-sm shadow-sm","transition-colors duration-150","border-zinc-200 bg-white","hover:border-zinc-300","focus:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950","disabled:cursor-not-allowed disabled:opacity-50","dark:border-zinc-800 dark:bg-zinc-950","dark:hover:border-zinc-700","dark:focus-visible:ring-zinc-300",l),children:[E?y.map(x=>b.jsx(Oc,{label:x.label,onRemove:()=>g(x.value),disabled:a},x.value)):b.jsx("span",{className:"select-none text-zinc-400 dark:text-zinc-500",children:r}),b.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1 pl-1",children:[E&&u&&!a&&b.jsx("span",{role:"button","aria-label":"Clear all selections",onClick:x=>{x.stopPropagation(),n?.([])},className:Z("flex items-center justify-center rounded-sm p-0.5","text-zinc-400 transition-colors","hover:bg-zinc-100 hover:text-zinc-700","dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-300"),children:b.jsx(fo,{size:13})}),b.jsx("span",{className:Z("text-zinc-400 transition-transform duration-200 dark:text-zinc-500",m&&"rotate-180"),children:b.jsx(Ac,{size:14})})]})]})}),b.jsx(aa,{children:b.jsx(ca,{align:"start",sideOffset:6,className:Z("z-50 w-[var(--radix-popover-trigger-width)] min-w-48","overflow-hidden rounded-md border shadow-md","border-zinc-200 bg-white","dark:border-zinc-800 dark:bg-zinc-950","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=top]:slide-in-from-bottom-2",d),children:b.jsxs(Wa,{shouldFilter:!0,children:[b.jsxs("div",{className:Z("flex items-center gap-2 border-b px-3","border-zinc-100 dark:border-zinc-800"),children:[b.jsx("span",{className:"text-zinc-400 dark:text-zinc-500",children:b.jsx(Pc,{size:14})}),b.jsx(eo,{placeholder:o,className:Z("flex h-9 w-full bg-transparent py-2 text-sm outline-none","text-zinc-900 placeholder:text-zinc-400","dark:text-zinc-100 dark:placeholder:text-zinc-500")})]}),b.jsxs(to,{className:"max-h-56 overflow-y-auto overflow-x-hidden py-1",children:[b.jsx(no,{className:Z("py-6 text-center text-sm","text-zinc-500 dark:text-zinc-400"),children:i}),b.jsx(Jr,{children:e.map(x=>{const C=p.has(x.value),A=s!==void 0&&t.length>=s,R=x.disabled||!C&&A;return b.jsxs(Qr,{value:x.value,disabled:R,onSelect:()=>g(x.value),className:Z("relative flex cursor-pointer select-none items-center gap-2","rounded-sm px-2 py-1.5 text-sm outline-none","transition-colors duration-100","text-zinc-700 dark:text-zinc-300","data-[selected=true]:bg-zinc-100 data-[selected=true]:text-zinc-900","dark:data-[selected=true]:bg-zinc-800 dark:data-[selected=true]:text-zinc-100","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-40"),children:[b.jsx("span",{className:Z("flex h-4 w-4 shrink-0 items-center justify-center","rounded border transition-colors",C?"border-zinc-900 bg-zinc-900 text-white dark:border-zinc-100 dark:bg-zinc-100 dark:text-zinc-900":"border-zinc-300 dark:border-zinc-600"),children:C&&b.jsx(Rc,{size:10})}),b.jsx("span",{className:"flex-1 truncate",children:x.label})]},x.value)})})]}),(E||s!==void 0)&&b.jsxs("div",{className:Z("flex items-center justify-between","border-t px-3 py-1.5","border-zinc-100 dark:border-zinc-800"),children:[b.jsxs("span",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:[t.length," selected",s!==void 0&&` / ${s} max`]}),E&&u&&b.jsx("button",{type:"button",onClick:()=>n?.([]),className:Z("text-xs underline-offset-2 transition-colors","text-zinc-400 hover:text-zinc-700 hover:underline","dark:text-zinc-500 dark:hover:text-zinc-300"),children:"Clear all"})]})]})})})]})});exports.MultiSelect=kc;
@@ -0,0 +1 @@
1
+ export {}