@qodo/design-system 0.20.18 → 0.20.19

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.js CHANGED
@@ -147,7 +147,7 @@ React keys must be passed directly to JSX without using spread:
147
147
  *
148
148
  * This source code is licensed under the ISC license.
149
149
  * See the LICENSE file in the root directory of this source tree.
150
- */const ih=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ao=Ce("x",ih);function K(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ki(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ae(...e){return t=>{let r=!1;const n=e.map(o=>{const a=ki(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){const a=n[o];typeof a=="function"?a():ki(e[o],null)}}}}function ce(...e){return d.useCallback(Ae(...e),e)}function lh(e,t){const r=d.createContext(t),n=a=>{const{children:s,...i}=a,c=d.useMemo(()=>i,Object.values(i));return l.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(a){const s=d.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,o]}function je(e,t=[]){let r=[];function n(a,s){const i=d.createContext(s),c=r.length;r=[...r,s];const u=p=>{var b;const{scope:m,children:g,...h}=p,v=((b=m==null?void 0:m[e])==null?void 0:b[c])||i,x=d.useMemo(()=>h,Object.values(h));return l.jsx(v.Provider,{value:x,children:g})};u.displayName=a+"Provider";function f(p,m){var v;const g=((v=m==null?void 0:m[e])==null?void 0:v[c])||i,h=d.useContext(g);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[u,f]}const o=()=>{const a=r.map(s=>d.createContext(s));return function(i){const c=(i==null?void 0:i[e])||a;return d.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[n,ch(o,...t)]}function ch(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=n.reduce((i,{useScope:c,scopeName:u})=>{const p=c(a)[`__scope${u}`];return{...i,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function uh(e){const t=dh(e),r=d.forwardRef((n,o)=>{const{children:a,...s}=n,i=d.Children.toArray(a),c=i.find(ph);if(c){const u=c.props.children,f=i.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...s,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function dh(e){const t=d.forwardRef((r,n)=>{const{children:o,...a}=r;if(d.isValidElement(o)){const s=gh(o),i=mh(a,o.props);return o.type!==d.Fragment&&(i.ref=n?Ae(n,s):s),d.cloneElement(o,i)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fh=Symbol("radix.slottable");function ph(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fh}function mh(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function gh(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var vh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=vh.reduce((e,t)=>{const r=uh(`Primitive.${t}`),n=d.forwardRef((o,a)=>{const{asChild:s,...i}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lc(e,t){e&&no.flushSync(()=>e.dispatchEvent(t))}function ze(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function hh(e,t=globalThis==null?void 0:globalThis.document){const r=ze(e);d.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var xh="DismissableLayer",ga="dismissableLayer.update",bh="dismissableLayer.pointerDownOutside",yh="dismissableLayer.focusOutside",Ni,cc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gr=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:i,...c}=e,u=d.useContext(cc),[f,p]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),h=ce(t,k=>p(k)),v=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(x),y=f?v.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,C=y>=b,R=Sh(k=>{const N=k.target,$=[...u.branches].some(B=>B.contains(N));!C||$||(o==null||o(k),s==null||s(k),k.defaultPrevented||i==null||i())},m),j=Eh(k=>{const N=k.target;[...u.branches].some(B=>B.contains(N))||(a==null||a(k),s==null||s(k),k.defaultPrevented||i==null||i())},m);return hh(k=>{y===u.layers.size-1&&(n==null||n(k),!k.defaultPrevented&&i&&(k.preventDefault(),i()))},m),d.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ni=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),ji(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ni)}},[f,m,r,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),ji())},[f,u]),d.useEffect(()=>{const k=()=>g({});return document.addEventListener(ga,k),()=>document.removeEventListener(ga,k)},[]),l.jsx(ne.div,{...c,ref:h,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:K(e.onFocusCapture,j.onFocusCapture),onBlurCapture:K(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,R.onPointerDownCapture)})});gr.displayName=xh;var wh="DismissableLayerBranch",Ch=d.forwardRef((e,t)=>{const r=d.useContext(cc),n=d.useRef(null),o=ce(t,n);return d.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),l.jsx(ne.div,{...e,ref:o})});Ch.displayName=wh;function Sh(e,t=globalThis==null?void 0:globalThis.document){const r=ze(e),n=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const a=i=>{if(i.target&&!n.current){let c=function(){uc(bh,r,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Eh(e,t=globalThis==null?void 0:globalThis.document){const r=ze(e),n=d.useRef(!1);return d.useEffect(()=>{const o=a=>{a.target&&!n.current&&uc(yh,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ji(){const e=new CustomEvent(ga);document.dispatchEvent(e)}function uc(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?lc(o,a):o.dispatchEvent(a)}var Ne=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},Rh=d[" useId ".trim().toString()]||(()=>{}),kh=0;function be(e){const[t,r]=d.useState(Rh());return Ne(()=>{r(n=>n??String(kh++))},[e]),t?`radix-${t}`:""}const Nh=["top","right","bottom","left"],vt=Math.min,De=Math.max,Vn=Math.round,kn=Math.floor,et=e=>({x:e,y:e}),jh={left:"right",right:"left",bottom:"top",top:"bottom"},Ph={start:"end",end:"start"};function va(e,t,r){return De(e,vt(t,r))}function lt(e,t){return typeof e=="function"?e(t):e}function ct(e){return e.split("-")[0]}function vr(e){return e.split("-")[1]}function Wa(e){return e==="x"?"y":"x"}function za(e){return e==="y"?"height":"width"}const Th=new Set(["top","bottom"]);function Qe(e){return Th.has(ct(e))?"y":"x"}function qa(e){return Wa(Qe(e))}function Ih(e,t,r){r===void 0&&(r=!1);const n=vr(e),o=qa(e),a=za(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Bn(s)),[s,Bn(s)]}function Ah(e){const t=Bn(e);return[ha(e),t,ha(t)]}function ha(e){return e.replace(/start|end/g,t=>Ph[t])}const Pi=["left","right"],Ti=["right","left"],_h=["top","bottom"],Oh=["bottom","top"];function Mh(e,t,r){switch(e){case"top":case"bottom":return r?t?Ti:Pi:t?Pi:Ti;case"left":case"right":return t?_h:Oh;default:return[]}}function Dh(e,t,r,n){const o=vr(e);let a=Mh(ct(e),r==="start",n);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map(ha)))),a}function Bn(e){return e.replace(/left|right|bottom|top/g,t=>jh[t])}function $h(e){return{top:0,right:0,bottom:0,left:0,...e}}function dc(e){return typeof e!="number"?$h(e):{top:e,right:e,bottom:e,left:e}}function Gn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Ii(e,t,r){let{reference:n,floating:o}=e;const a=Qe(t),s=qa(t),i=za(s),c=ct(t),u=a==="y",f=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[i]/2-o[i]/2;let g;switch(c){case"top":g={x:f,y:n.y-o.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(vr(t)){case"start":g[s]-=m*(r&&u?-1:1);break;case"end":g[s]+=m*(r&&u?-1:1);break}return g}const Lh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:s}=r,i=a.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=Ii(u,n,c),m=n,g={},h=0;for(let v=0;v<i.length;v++){const{name:x,fn:b}=i[v],{x:y,y:w,data:C,reset:R}=await b({x:f,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:u,platform:s,elements:{reference:e,floating:t}});f=y??f,p=w??p,g={...g,[x]:{...g[x],...C}},R&&h<=50&&(h++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(u=R.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:f,y:p}=Ii(u,m,c)),v=-1)}return{x:f,y:p,placement:m,strategy:o,middlewareData:g}};async function Wr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:s,elements:i,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=lt(t,e),h=dc(g),x=i[m?p==="floating"?"reference":"floating":p],b=Gn(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(x)))==null||r?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:u,rootBoundary:f,strategy:c})),y=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),C=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},R=Gn(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:w,strategy:c}):y);return{top:(b.top-R.top+h.top)/C.y,bottom:(R.bottom-b.bottom+h.bottom)/C.y,left:(b.left-R.left+h.left)/C.x,right:(R.right-b.right+h.right)/C.x}}const Fh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:s,elements:i,middlewareData:c}=t,{element:u,padding:f=0}=lt(e,t)||{};if(u==null)return{};const p=dc(f),m={x:r,y:n},g=qa(o),h=za(g),v=await s.getDimensions(u),x=g==="y",b=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",C=a.reference[h]+a.reference[g]-m[g]-a.floating[h],R=m[g]-a.reference[g],j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let k=j?j[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(j)))&&(k=i.floating[w]||a.floating[h]);const N=C/2-R/2,$=k/2-v[h]/2-1,B=vt(p[b],$),G=vt(p[y],$),Q=B,ee=k-v[h]-G,W=k/2-v[h]/2+N,M=va(Q,W,ee),_=!c.arrow&&vr(o)!=null&&W!==M&&a.reference[h]/2-(W<Q?B:G)-v[h]/2<0,D=_?W<Q?W-Q:W-ee:0;return{[g]:m[g]+D,data:{[g]:M,centerOffset:W-M-D,..._&&{alignmentOffset:D}},reset:_}}}),Vh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:s,initialPlacement:i,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...x}=lt(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const b=ct(o),y=Qe(i),w=ct(i)===i,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),R=m||(w||!v?[Bn(i)]:Ah(i)),j=h!=="none";!m&&j&&R.push(...Dh(i,v,h,C));const k=[i,...R],N=await Wr(t,x),$=[];let B=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&$.push(N[b]),p){const W=Ih(o,s,C);$.push(N[W[0]],N[W[1]])}if(B=[...B,{placement:o,overflows:$}],!$.every(W=>W<=0)){var G,Q;const W=(((G=a.flip)==null?void 0:G.index)||0)+1,M=k[W];if(M&&(!(p==="alignment"?y!==Qe(M):!1)||B.every(T=>Qe(T.placement)===y?T.overflows[0]>0:!0)))return{data:{index:W,overflows:B},reset:{placement:M}};let _=(Q=B.filter(D=>D.overflows[0]<=0).sort((D,T)=>D.overflows[1]-T.overflows[1])[0])==null?void 0:Q.placement;if(!_)switch(g){case"bestFit":{var ee;const D=(ee=B.filter(T=>{if(j){const O=Qe(T.placement);return O===y||O==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(O=>O>0).reduce((O,U)=>O+U,0)]).sort((T,O)=>T[1]-O[1])[0])==null?void 0:ee[0];D&&(_=D);break}case"initialPlacement":_=i;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function Ai(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _i(e){return Nh.some(t=>e[t]>=0)}const Bh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=lt(e,t);switch(n){case"referenceHidden":{const a=await Wr(t,{...o,elementContext:"reference"}),s=Ai(a,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:_i(s)}}}case"escaped":{const a=await Wr(t,{...o,altBoundary:!0}),s=Ai(a,r.floating);return{data:{escapedOffsets:s,escaped:_i(s)}}}default:return{}}}}},fc=new Set(["left","top"]);async function Gh(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ct(r),i=vr(r),c=Qe(r)==="y",u=fc.has(s)?-1:1,f=a&&c?-1:1,p=lt(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof h=="number"&&(g=i==="end"?h*-1:h),c?{x:g*f,y:m*u}:{x:m*u,y:g*f}}const Wh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:s,middlewareData:i}=t,c=await Gh(t,e);return s===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:s}}}}},zh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:i={fn:x=>{let{x:b,y}=x;return{x:b,y}}},...c}=lt(e,t),u={x:r,y:n},f=await Wr(t,c),p=Qe(ct(o)),m=Wa(p);let g=u[m],h=u[p];if(a){const x=m==="y"?"top":"left",b=m==="y"?"bottom":"right",y=g+f[x],w=g-f[b];g=va(y,g,w)}if(s){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",y=h+f[x],w=h-f[b];h=va(y,h,w)}const v=i.fn({...t,[m]:g,[p]:h});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[m]:a,[p]:s}}}}}},qh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:s}=t,{offset:i=0,mainAxis:c=!0,crossAxis:u=!0}=lt(e,t),f={x:r,y:n},p=Qe(o),m=Wa(p);let g=f[m],h=f[p];const v=lt(i,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const w=m==="y"?"height":"width",C=a.reference[m]-a.floating[w]+x.mainAxis,R=a.reference[m]+a.reference[w]-x.mainAxis;g<C?g=C:g>R&&(g=R)}if(u){var b,y;const w=m==="y"?"width":"height",C=fc.has(ct(o)),R=a.reference[p]-a.floating[w]+(C&&((b=s.offset)==null?void 0:b[p])||0)+(C?0:x.crossAxis),j=a.reference[p]+a.reference[w]+(C?0:((y=s.offset)==null?void 0:y[p])||0)-(C?x.crossAxis:0);h<R?h=R:h>j&&(h=j)}return{[m]:g,[p]:h}}}},Hh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:s,elements:i}=t,{apply:c=()=>{},...u}=lt(e,t),f=await Wr(t,u),p=ct(o),m=vr(o),g=Qe(o)==="y",{width:h,height:v}=a.floating;let x,b;p==="top"||p==="bottom"?(x=p,b=m===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(b=p,x=m==="end"?"top":"bottom");const y=v-f.top-f.bottom,w=h-f.left-f.right,C=vt(v-f[x],y),R=vt(h-f[b],w),j=!t.middlewareData.shift;let k=C,N=R;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(N=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=y),j&&!m){const B=De(f.left,0),G=De(f.right,0),Q=De(f.top,0),ee=De(f.bottom,0);g?N=h-2*(B!==0||G!==0?B+G:De(f.left,f.right)):k=v-2*(Q!==0||ee!==0?Q+ee:De(f.top,f.bottom))}await c({...t,availableWidth:N,availableHeight:k});const $=await s.getDimensions(i.floating);return h!==$.width||v!==$.height?{reset:{rects:!0}}:{}}}};function so(){return typeof window<"u"}function hr(e){return pc(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rt(e){var t;return(t=(pc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pc(e){return so()?e instanceof Node||e instanceof $e(e).Node:!1}function qe(e){return so()?e instanceof Element||e instanceof $e(e).Element:!1}function tt(e){return so()?e instanceof HTMLElement||e instanceof $e(e).HTMLElement:!1}function Oi(e){return!so()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}const Uh=new Set(["inline","contents"]);function Jr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=He(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Uh.has(o)}const Kh=new Set(["table","td","th"]);function Yh(e){return Kh.has(hr(e))}const Xh=[":popover-open",":modal"];function io(e){return Xh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Zh=["transform","translate","scale","rotate","perspective"],Jh=["transform","translate","scale","rotate","perspective","filter"],Qh=["paint","layout","strict","content"];function Ha(e){const t=Ua(),r=qe(e)?He(e):e;return Zh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Jh.some(n=>(r.willChange||"").includes(n))||Qh.some(n=>(r.contain||"").includes(n))}function ex(e){let t=ht(e);for(;tt(t)&&!cr(t);){if(Ha(t))return t;if(io(t))return null;t=ht(t)}return null}function Ua(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tx=new Set(["html","body","#document"]);function cr(e){return tx.has(hr(e))}function He(e){return $e(e).getComputedStyle(e)}function lo(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ht(e){if(hr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Oi(e)&&e.host||rt(e);return Oi(t)?t.host:t}function mc(e){const t=ht(e);return cr(t)?e.ownerDocument?e.ownerDocument.body:e.body:tt(t)&&Jr(t)?t:mc(t)}function zr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=mc(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),s=$e(o);if(a){const i=xa(s);return t.concat(s,s.visualViewport||[],Jr(o)?o:[],i&&r?zr(i):[])}return t.concat(o,zr(o,[],r))}function xa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gc(e){const t=He(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=tt(e),a=o?e.offsetWidth:r,s=o?e.offsetHeight:n,i=Vn(r)!==a||Vn(n)!==s;return i&&(r=a,n=s),{width:r,height:n,$:i}}function Ka(e){return qe(e)?e:e.contextElement}function ir(e){const t=Ka(e);if(!tt(t))return et(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=gc(t);let s=(a?Vn(r.width):r.width)/n,i=(a?Vn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const rx=et(0);function vc(e){const t=$e(e);return!Ua()||!t.visualViewport?rx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nx(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==$e(e)?!1:t}function _t(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=Ka(e);let s=et(1);t&&(n?qe(n)&&(s=ir(n)):s=ir(e));const i=nx(a,r,n)?vc(a):et(0);let c=(o.left+i.x)/s.x,u=(o.top+i.y)/s.y,f=o.width/s.x,p=o.height/s.y;if(a){const m=$e(a),g=n&&qe(n)?$e(n):n;let h=m,v=xa(h);for(;v&&n&&g!==h;){const x=ir(v),b=v.getBoundingClientRect(),y=He(v),w=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*x.x,C=b.top+(v.clientTop+parseFloat(y.paddingTop))*x.y;c*=x.x,u*=x.y,f*=x.x,p*=x.y,c+=w,u+=C,h=$e(v),v=xa(h)}}return Gn({width:f,height:p,x:c,y:u})}function co(e,t){const r=lo(e).scrollLeft;return t?t.left+r:_t(rt(e)).left+r}function hc(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-co(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function ox(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",s=rt(n),i=t?io(t.floating):!1;if(n===s||i&&a)return r;let c={scrollLeft:0,scrollTop:0},u=et(1);const f=et(0),p=tt(n);if((p||!p&&!a)&&((hr(n)!=="body"||Jr(s))&&(c=lo(n)),tt(n))){const g=_t(n);u=ir(n),f.x=g.x+n.clientLeft,f.y=g.y+n.clientTop}const m=s&&!p&&!a?hc(s,c):et(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+f.x+m.x,y:r.y*u.y-c.scrollTop*u.y+f.y+m.y}}function ax(e){return Array.from(e.getClientRects())}function sx(e){const t=rt(e),r=lo(e),n=e.ownerDocument.body,o=De(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=De(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+co(e);const i=-r.scrollTop;return He(n).direction==="rtl"&&(s+=De(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:s,y:i}}const Mi=25;function ix(e,t){const r=$e(e),n=rt(e),o=r.visualViewport;let a=n.clientWidth,s=n.clientHeight,i=0,c=0;if(o){a=o.width,s=o.height;const f=Ua();(!f||f&&t==="fixed")&&(i=o.offsetLeft,c=o.offsetTop)}const u=co(n);if(u<=0){const f=n.ownerDocument,p=f.body,m=getComputedStyle(p),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(n.clientWidth-p.clientWidth-g);h<=Mi&&(a-=h)}else u<=Mi&&(a+=u);return{width:a,height:s,x:i,y:c}}const lx=new Set(["absolute","fixed"]);function cx(e,t){const r=_t(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=tt(e)?ir(e):et(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,c=o*a.x,u=n*a.y;return{width:s,height:i,x:c,y:u}}function Di(e,t,r){let n;if(t==="viewport")n=ix(e,r);else if(t==="document")n=sx(rt(e));else if(qe(t))n=cx(t,r);else{const o=vc(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Gn(n)}function xc(e,t){const r=ht(e);return r===t||!qe(r)||cr(r)?!1:He(r).position==="fixed"||xc(r,t)}function ux(e,t){const r=t.get(e);if(r)return r;let n=zr(e,[],!1).filter(i=>qe(i)&&hr(i)!=="body"),o=null;const a=He(e).position==="fixed";let s=a?ht(e):e;for(;qe(s)&&!cr(s);){const i=He(s),c=Ha(s);!c&&i.position==="fixed"&&(o=null),(a?!c&&!o:!c&&i.position==="static"&&!!o&&lx.has(o.position)||Jr(s)&&!c&&xc(e,s))?n=n.filter(f=>f!==s):o=i,s=ht(s)}return t.set(e,n),n}function dx(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?io(t)?[]:ux(t,this._c):[].concat(r),n],i=s[0],c=s.reduce((u,f)=>{const p=Di(t,f,o);return u.top=De(p.top,u.top),u.right=vt(p.right,u.right),u.bottom=vt(p.bottom,u.bottom),u.left=De(p.left,u.left),u},Di(t,i,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function fx(e){const{width:t,height:r}=gc(e);return{width:t,height:r}}function px(e,t,r){const n=tt(t),o=rt(t),a=r==="fixed",s=_t(e,!0,a,t);let i={scrollLeft:0,scrollTop:0};const c=et(0);function u(){c.x=co(o)}if(n||!n&&!a)if((hr(t)!=="body"||Jr(o))&&(i=lo(t)),n){const g=_t(t,!0,a,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&u();a&&!n&&o&&u();const f=o&&!n&&!a?hc(o,i):et(0),p=s.left+i.scrollLeft-c.x-f.x,m=s.top+i.scrollTop-c.y-f.y;return{x:p,y:m,width:s.width,height:s.height}}function Yo(e){return He(e).position==="static"}function $i(e,t){if(!tt(e)||He(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return rt(e)===r&&(r=r.ownerDocument.body),r}function bc(e,t){const r=$e(e);if(io(e))return r;if(!tt(e)){let o=ht(e);for(;o&&!cr(o);){if(qe(o)&&!Yo(o))return o;o=ht(o)}return r}let n=$i(e,t);for(;n&&Yh(n)&&Yo(n);)n=$i(n,t);return n&&cr(n)&&Yo(n)&&!Ha(n)?r:n||ex(e)||r}const mx=async function(e){const t=this.getOffsetParent||bc,r=this.getDimensions,n=await r(e.floating);return{reference:px(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function gx(e){return He(e).direction==="rtl"}const vx={convertOffsetParentRelativeRectToViewportRelativeRect:ox,getDocumentElement:rt,getClippingRect:dx,getOffsetParent:bc,getElementRects:mx,getClientRects:ax,getDimensions:fx,getScale:ir,isElement:qe,isRTL:gx};function yc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hx(e,t){let r=null,n;const o=rt(e);function a(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function s(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:f,top:p,width:m,height:g}=u;if(i||t(),!m||!g)return;const h=kn(p),v=kn(o.clientWidth-(f+m)),x=kn(o.clientHeight-(p+g)),b=kn(f),w={rootMargin:-h+"px "+-v+"px "+-x+"px "+-b+"px",threshold:De(0,vt(1,c))||1};let C=!0;function R(j){const k=j[0].intersectionRatio;if(k!==c){if(!C)return s();k?s(!1,k):n=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!yc(u,e.getBoundingClientRect())&&s(),C=!1}try{r=new IntersectionObserver(R,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(R,w)}r.observe(e)}return s(!0),a}function xx(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Ka(e),f=o||a?[...u?zr(u):[],...zr(t)]:[];f.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),a&&b.addEventListener("resize",r)});const p=u&&i?hx(u,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(b=>{let[y]=b;y&&y.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),u&&!c&&g.observe(u),g.observe(t));let h,v=c?_t(e):null;c&&x();function x(){const b=_t(e);v&&!yc(v,b)&&r(),v=b,h=requestAnimationFrame(x)}return r(),()=>{var b;f.forEach(y=>{o&&y.removeEventListener("scroll",r),a&&y.removeEventListener("resize",r)}),p==null||p(),(b=g)==null||b.disconnect(),g=null,c&&cancelAnimationFrame(h)}}const bx=Wh,yx=zh,wx=Vh,Cx=Hh,Sx=Bh,Li=Fh,Ex=qh,Rx=(e,t,r)=>{const n=new Map,o={platform:vx,...r},a={...o.platform,_c:n};return Lh(e,t,{...o,platform:a})};var kx=typeof document<"u",Nx=function(){},On=kx?E.useLayoutEffect:Nx;function Wn(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 r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Wn(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!Wn(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function wc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fi(e,t){const r=wc(e);return Math.round(t*r)/r}function Xo(e){const t=d.useRef(e);return On(()=>{t.current=e}),t}function jx(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[f,p]=d.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=d.useState(n);Wn(m,n)||g(n);const[h,v]=d.useState(null),[x,b]=d.useState(null),y=d.useCallback(T=>{T!==j.current&&(j.current=T,v(T))},[]),w=d.useCallback(T=>{T!==k.current&&(k.current=T,b(T))},[]),C=a||h,R=s||x,j=d.useRef(null),k=d.useRef(null),N=d.useRef(f),$=c!=null,B=Xo(c),G=Xo(o),Q=Xo(u),ee=d.useCallback(()=>{if(!j.current||!k.current)return;const T={placement:t,strategy:r,middleware:m};G.current&&(T.platform=G.current),Rx(j.current,k.current,T).then(O=>{const U={...O,isPositioned:Q.current!==!1};W.current&&!Wn(N.current,U)&&(N.current=U,no.flushSync(()=>{p(U)}))})},[m,t,r,G,Q]);On(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,p(T=>({...T,isPositioned:!1})))},[u]);const W=d.useRef(!1);On(()=>(W.current=!0,()=>{W.current=!1}),[]),On(()=>{if(C&&(j.current=C),R&&(k.current=R),C&&R){if(B.current)return B.current(C,R,ee);ee()}},[C,R,ee,B,$]);const M=d.useMemo(()=>({reference:j,floating:k,setReference:y,setFloating:w}),[y,w]),_=d.useMemo(()=>({reference:C,floating:R}),[C,R]),D=d.useMemo(()=>{const T={position:r,left:0,top:0};if(!_.floating)return T;const O=Fi(_.floating,f.x),U=Fi(_.floating,f.y);return i?{...T,transform:"translate("+O+"px, "+U+"px)",...wc(_.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:O,top:U}},[r,i,_.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:ee,refs:M,elements:_,floatingStyles:D}),[f,ee,M,_,D])}const Px=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Li({element:n.current,padding:o}).fn(r):{}:n?Li({element:n,padding:o}).fn(r):{}}}},Tx=(e,t)=>({...bx(e),options:[e,t]}),Ix=(e,t)=>({...yx(e),options:[e,t]}),Ax=(e,t)=>({...Ex(e),options:[e,t]}),_x=(e,t)=>({...wx(e),options:[e,t]}),Ox=(e,t)=>({...Cx(e),options:[e,t]}),Mx=(e,t)=>({...Sx(e),options:[e,t]}),Dx=(e,t)=>({...Px(e),options:[e,t]});var $x="Arrow",Cc=d.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return l.jsx(ne.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Cc.displayName=$x;var Lx=Cc;function uo(e){const[t,r]=d.useState(void 0);return Ne(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,i;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;s=u.inlineSize,i=u.blockSize}else s=e.offsetWidth,i=e.offsetHeight;r({width:s,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ya="Popper",[Sc,bt]=je(Ya),[Fx,Ec]=Sc(Ya),Rc=e=>{const{__scopePopper:t,children:r}=e,[n,o]=d.useState(null);return l.jsx(Fx,{scope:t,anchor:n,onAnchorChange:o,children:r})};Rc.displayName=Ya;var kc="PopperAnchor",Nc=d.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=Ec(kc,r),s=d.useRef(null),i=ce(t,s),c=d.useRef(null);return d.useEffect(()=>{const u=c.current;c.current=(n==null?void 0:n.current)||s.current,u!==c.current&&a.onAnchorChange(c.current)}),n?null:l.jsx(ne.div,{...o,ref:i})});Nc.displayName=kc;var Xa="PopperContent",[Vx,Bx]=Sc(Xa),jc=d.forwardRef((e,t)=>{var A,z,Z,H,te,L;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:h,...v}=e,x=Ec(Xa,r),[b,y]=d.useState(null),w=ce(t,se=>y(se)),[C,R]=d.useState(null),j=uo(C),k=(j==null?void 0:j.width)??0,N=(j==null?void 0:j.height)??0,$=n+(a!=="center"?"-"+a:""),B=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},G=Array.isArray(u)?u:[u],Q=G.length>0,ee={padding:B,boundary:G.filter(Wx),altBoundary:Q},{refs:W,floatingStyles:M,placement:_,isPositioned:D,middlewareData:T}=jx({strategy:"fixed",placement:$,whileElementsMounted:(...se)=>xx(...se,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[Tx({mainAxis:o+N,alignmentAxis:s}),c&&Ix({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Ax():void 0,...ee}),c&&_x({...ee}),Ox({...ee,apply:({elements:se,rects:le,availableWidth:me,availableHeight:ve})=>{const{width:Ee,height:Le}=le.reference,Re=se.floating.style;Re.setProperty("--radix-popper-available-width",`${me}px`),Re.setProperty("--radix-popper-available-height",`${ve}px`),Re.setProperty("--radix-popper-anchor-width",`${Ee}px`),Re.setProperty("--radix-popper-anchor-height",`${Le}px`)}}),C&&Dx({element:C,padding:i}),zx({arrowWidth:k,arrowHeight:N}),m&&Mx({strategy:"referenceHidden",...ee})]}),[O,U]=Ic(_),J=ze(h);Ne(()=>{D&&(J==null||J())},[D,J]);const I=(A=T.arrow)==null?void 0:A.x,q=(z=T.arrow)==null?void 0:z.y,X=((Z=T.arrow)==null?void 0:Z.centerOffset)!==0,[Y,F]=d.useState();return Ne(()=>{b&&F(window.getComputedStyle(b).zIndex)},[b]),l.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:D?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(H=T.transformOrigin)==null?void 0:H.x,(te=T.transformOrigin)==null?void 0:te.y].join(" "),...((L=T.hide)==null?void 0:L.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Vx,{scope:r,placedSide:O,onArrowChange:R,arrowX:I,arrowY:q,shouldHideArrow:X,children:l.jsx(ne.div,{"data-side":O,"data-align":U,...v,ref:w,style:{...v.style,animation:D?void 0:"none"}})})})});jc.displayName=Xa;var Pc="PopperArrow",Gx={top:"bottom",right:"left",bottom:"top",left:"right"},Tc=d.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=Bx(Pc,n),s=Gx[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(Lx,{...o,ref:r,style:{...o.style,display:"block"}})})});Tc.displayName=Pc;function Wx(e){return e!==null}var zx=e=>({name:"transformOrigin",options:e,fn(t){var x,b,y;const{placement:r,rects:n,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,i=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[u,f]=Ic(r),p={start:"0%",center:"50%",end:"100%"}[f],m=(((b=o.arrow)==null?void 0:b.x)??0)+i/2,g=(((y=o.arrow)==null?void 0:y.y)??0)+c/2;let h="",v="";return u==="bottom"?(h=s?p:`${m}px`,v=`${-c}px`):u==="top"?(h=s?p:`${m}px`,v=`${n.floating.height+c}px`):u==="right"?(h=`${-c}px`,v=s?p:`${g}px`):u==="left"&&(h=`${n.floating.width+c}px`,v=s?p:`${g}px`),{data:{x:h,y:v}}}});function Ic(e){const[t,r="center"]=e.split("-");return[t,r]}var Qr=Rc,en=Nc,fo=jc,po=Tc,qx="Portal",xr=d.forwardRef((e,t)=>{var i;const{container:r,...n}=e,[o,a]=d.useState(!1);Ne(()=>a(!0),[]);const s=r||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return s?Zr.createPortal(l.jsx(ne.div,{...n,ref:t}),s):null});xr.displayName=qx;function Hx(e,t){return d.useReducer((r,n)=>t[r][n]??r,e)}var Pe=e=>{const{present:t,children:r}=e,n=Ux(t),o=typeof r=="function"?r({present:n.isPresent}):d.Children.only(r),a=ce(n.ref,Kx(o));return typeof r=="function"||n.isPresent?d.cloneElement(o,{ref:a}):null};Pe.displayName="Presence";function Ux(e){const[t,r]=d.useState(),n=d.useRef(null),o=d.useRef(e),a=d.useRef("none"),s=e?"mounted":"unmounted",[i,c]=Hx(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const u=Nn(n.current);a.current=i==="mounted"?u:"none"},[i]),Ne(()=>{const u=n.current,f=o.current;if(f!==e){const m=a.current,g=Nn(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ne(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,p=g=>{const v=Nn(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=g=>{g.target===t&&(a.current=Nn(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:d.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Nn(e){return(e==null?void 0:e.animationName)||"none"}function Kx(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Yx=Symbol("radix.slottable");function Xx(e){const t=({children:r})=>l.jsx(l.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Yx,t}var Zx=d[" useInsertionEffect ".trim().toString()]||Ne;function ke({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,s]=Jx({defaultProp:t,onChange:r}),i=e!==void 0,c=i?e:o;{const f=d.useRef(e!==void 0);d.useEffect(()=>{const p=f.current;p!==i&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${i?"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.`),f.current=i},[i,n])}const u=d.useCallback(f=>{var p;if(i){const m=Qx(f)?f(e):f;m!==e&&((p=s.current)==null||p.call(s,m))}else a(f)},[i,e,a,s]);return[c,u]}function Jx({defaultProp:e,onChange:t}){const[r,n]=d.useState(e),o=d.useRef(r),a=d.useRef(t);return Zx(()=>{a.current=t},[t]),d.useEffect(()=>{var s;o.current!==r&&((s=a.current)==null||s.call(a,r),o.current=r)},[r,o]),[r,n,a]}function Qx(e){return typeof e=="function"}var Ac=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),eb="VisuallyHidden",_c=d.forwardRef((e,t)=>l.jsx(ne.span,{...e,ref:t,style:{...Ac,...e.style}}));_c.displayName=eb;var tb=_c,[mo]=je("Tooltip",[bt]),go=bt(),Oc="TooltipProvider",rb=700,ba="tooltip.open",[nb,Za]=mo(Oc),Mc=e=>{const{__scopeTooltip:t,delayDuration:r=rb,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,s=d.useRef(!0),i=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(nb,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:d.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:d.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:i,onPointerInTransitChange:d.useCallback(u=>{i.current=u},[]),disableHoverableContent:o,children:a})};Mc.displayName=Oc;var qr="Tooltip",[ob,tn]=mo(qr),Dc=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:i}=e,c=Za(qr,e.__scopeTooltip),u=go(t),[f,p]=d.useState(null),m=be(),g=d.useRef(0),h=s??c.disableHoverableContent,v=i??c.delayDuration,x=d.useRef(!1),[b,y]=ke({prop:n,defaultProp:o??!1,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(ba))):c.onClose(),a==null||a(k)},caller:qr}),w=d.useMemo(()=>b?x.current?"delayed-open":"instant-open":"closed",[b]),C=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,y(!0)},[y]),R=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y(!1)},[y]),j=d.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,y(!0),g.current=0},v)},[v,y]);return d.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),l.jsx(Qr,{...u,children:l.jsx(ob,{scope:t,contentId:m,open:b,stateAttribute:w,trigger:f,onTriggerChange:p,onTriggerEnter:d.useCallback(()=>{c.isOpenDelayedRef.current?j():C()},[c.isOpenDelayedRef,j,C]),onTriggerLeave:d.useCallback(()=>{h?R():(window.clearTimeout(g.current),g.current=0)},[R,h]),onOpen:C,onClose:R,disableHoverableContent:h,children:r})})};Dc.displayName=qr;var ya="TooltipTrigger",$c=d.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=tn(ya,r),a=Za(ya,r),s=go(r),i=d.useRef(null),c=ce(t,i,o.onTriggerChange),u=d.useRef(!1),f=d.useRef(!1),p=d.useCallback(()=>u.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),l.jsx(en,{asChild:!0,...s,children:l.jsx(ne.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:c,onPointerMove:K(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:K(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:K(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:K(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:K(e.onBlur,o.onClose),onClick:K(e.onClick,o.onClose)})})});$c.displayName=ya;var Ja="TooltipPortal",[ab,sb]=mo(Ja,{forceMount:void 0}),Lc=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=tn(Ja,t);return l.jsx(ab,{scope:t,forceMount:r,children:l.jsx(Pe,{present:r||a.open,children:l.jsx(xr,{asChild:!0,container:o,children:n})})})};Lc.displayName=Ja;var ur="TooltipContent",Fc=d.forwardRef((e,t)=>{const r=sb(ur,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,s=tn(ur,e.__scopeTooltip);return l.jsx(Pe,{present:n||s.open,children:s.disableHoverableContent?l.jsx(Vc,{side:o,...a,ref:t}):l.jsx(ib,{side:o,...a,ref:t})})}),ib=d.forwardRef((e,t)=>{const r=tn(ur,e.__scopeTooltip),n=Za(ur,e.__scopeTooltip),o=d.useRef(null),a=ce(t,o),[s,i]=d.useState(null),{trigger:c,onClose:u}=r,f=o.current,{onPointerInTransitChange:p}=n,m=d.useCallback(()=>{i(null),p(!1)},[p]),g=d.useCallback((h,v)=>{const x=h.currentTarget,b={x:h.clientX,y:h.clientY},y=db(b,x.getBoundingClientRect()),w=fb(b,y),C=pb(v.getBoundingClientRect()),R=gb([...w,...C]);i(R),p(!0)},[p]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(c&&f){const h=x=>g(x,f),v=x=>g(x,c);return c.addEventListener("pointerleave",h),f.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",v)}}},[c,f,g,m]),d.useEffect(()=>{if(s){const h=v=>{const x=v.target,b={x:v.clientX,y:v.clientY},y=(c==null?void 0:c.contains(x))||(f==null?void 0:f.contains(x)),w=!mb(b,s);y?m():w&&(m(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[c,f,s,u,m]),l.jsx(Vc,{...e,ref:a})}),[lb,cb]=mo(qr,{isInside:!1}),ub=Xx("TooltipContent"),Vc=d.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...i}=e,c=tn(ur,r),u=go(r),{onClose:f}=c;return d.useEffect(()=>(document.addEventListener(ba,f),()=>document.removeEventListener(ba,f)),[f]),d.useEffect(()=>{if(c.trigger){const p=m=>{const g=m.target;g!=null&&g.contains(c.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,f]),l.jsx(gr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:l.jsxs(fo,{"data-state":c.stateAttribute,...u,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(ub,{children:n}),l.jsx(lb,{scope:r,isInside:!0,children:l.jsx(tb,{id:c.contentId,role:"tooltip",children:o||n})})]})})});Fc.displayName=ur;var Bc="TooltipArrow",Gc=d.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=go(r);return cb(Bc,r).isInside?null:l.jsx(po,{...o,...n,ref:t})});Gc.displayName=Bc;function db(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function fb(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function pb(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function mb(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const i=t[a],c=t[s],u=i.x,f=i.y,p=c.x,m=c.y;f>n!=m>n&&r<(p-u)*(n-f)/(m-f)+u&&(o=!o)}return o}function gb(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),vb(t)}function vb(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],s=r[r.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var hb=Mc,xb=Dc,bb=$c,yb=Lc,wb=Fc,Cb=Gc;function Wc({delayDuration:e=0,...t}){return l.jsx(hb,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Qa({...e}){return l.jsx(Wc,{children:l.jsx(xb,{"data-slot":"tooltip",...e})})}function es({...e}){return l.jsx(bb,{"data-slot":"tooltip-trigger",...e})}function ts({className:e,sideOffset:t=0,children:r,disableArrow:n=!1,...o}){return l.jsx(yb,{children:l.jsxs(wb,{"data-slot":"tooltip-content",sideOffset:t,className:P("qodo qodo-tooltip-content bg-purple-muted-700 border border-purple-muted-600 text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e,{"py-2.5":n}),...o,children:[r,!n&&l.jsx(Cb,{className:"bg-purple-muted-700 fill-purple-muted-700 z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const zc=Bt("qodo qodo-button inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-normal ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none cursor-pointer",{variants:{variant:{default:"bg-[var(--fill-action-emphasis-idle)] text-[var(--text-action-on-emphasis-idle)] hover:bg-[var(--fill-action-emphasis-hover)] focus:bg-[var(--fill-action-emphasis-hover)] active:bg-[var(--fill-action-emphasis-hover)] disabled:bg-[var(--fill-action-emphasis-disabled)]",secondary:"bg-[var(--fill-action-neutral-idle)] text-[var(--text-action-neutral-idle)] hover:bg-[var(--fill-action-neutral-hover)] active:bg-[var(--fill-action-neutral-active)] disabled:bg-[var(--fill-action-neutral-disabled)] disabled:text-[var(--text-action-neutral-disabled)]",outline:"border border-[var(--border-action-neutral-idle)] text-[var(--text-action-neutral-idle)] hover:bg-[var(--fill-action-neutral-hover)] active:bg-[var(--fill-action-neutral-active)] disabled:bg-none disabled:text-[var(--text-action-neutral-disabled)]",ghost:"text-[var(--text-action-neutral-idle)] hover:text-[var(--text-action-neutral-hover)] active:bg-[var(--fill-action-neutral-active)] disabled:bg-none disabled:text-[var(--text-action-neutral-disabled)]",link:"text-[var(--text-action-emphasis-idle)] hover:text-[var(--text-action-emphasis-hover)] active:bg-[var(--fill-action-emphasis-active)] disabled:bg-none disabled:text-[var(--text-action-emphasis-disabled)]",danger:"border border-[var(--border-action-negative-idle)] text-[var(--icon-action-negative-idle)] hover:bg-[var(--fill-action-negative-hover)] active:bg-[var(--fill-action-negative-active)] disabled:border-[var(--border-action-negative-disabled)] disabled:text-[var(--icon-action-negative-disabled)]"},size:{default:"h-10 px-4 py-2",xs:"h-fit rounded-md text-xs px-2 py-1.5",sm:"h-8 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10","icon-sm":"h-7 w-7 p-1.5 rounded-md","icon-md":"h-8 w-8 p-1.5 rounded-md","icon-lg":"h-[45px] w-[45px] p-3 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),Be=d.forwardRef(({className:e,variant:t,size:r,loading:n,children:o,disabled:a,icon:s,iconPosition:i="left",tooltip:c,tooltipProps:u,...f},p)=>{const m={lg:"w-[18px] h-[18px]",default:"w-[18px] h-[18px]",sm:"w-[18px] h-[18px]",xs:"w-3.5 h-3.5",icon:"w-[18px] h-[18px]","icon-sm":"w-3.5 h-3.5","icon-md":"w-[18px] h-[18px]","icon-lg":"w-[18px] h-[18px]"}[r??"default"],g=s&&l.jsx(s,{className:P(m,"transition-opacity",{"mr-2":o&&i==="left","ml-2":o&&i!=="left","opacity-50":a||n})}),h=l.jsxs("button",{className:P(zc({variant:t,size:r,className:e})),ref:p,disabled:a||n,...f,children:[i==="left"&&g,o,i==="right"&&g,n&&l.jsx(sc,{className:P("ml-2 animate-spin",m)})]});return c?l.jsxs(Qa,{children:[l.jsx(es,{asChild:!0,children:l.jsx("span",{className:"inline-flex",children:h})}),l.jsx(ts,{...u,children:c})]}):h});Be.displayName="Button";const Sb=Bt("qodo qodo-input file:text-foreground placeholder:text-purple-muted-400 selection:bg-primary selection:text-primary-foreground border-input-neutral-idle flex h-9 w-full min-w-0 rounded-md border bg-purple-muted-900 px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-none focus-visible:ring-none aria-invalid:border-red-600 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:bg-[var(--fill-input-neutral-idle)] disabled:border-purple-muted-500 disabled:text-purple-muted-400 read-only:cursor-default md:text-sm dark:border-input-neutral-idle dark:bg-purple-muted-900 dark:text-foreground dark:placeholder:text-[var(--color-purple-muted-400)] [:not(:placeholder-shown)]:bg-purple-muted-700 [&[readonly]]:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:border-0 [&[readonly]]:text-[var(--text-input-neutral-idle)] [&[readonly]]:hover:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:hover:border-[var(--border-input-neutral-idle)] [&[readonly]]:focus:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:focus:border-[var(--border-input-neutral-idle)] [&[readonly]]:focus-visible:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:focus-visible:border-[var(--border-input-neutral-idle)] [&[readonly][disabled]]:opacity-100 [&[readonly][disabled]]:cursor-default [&[readonly][disabled]]:bg-[var(--fill-input-neutral-idle)] [&[readonly][disabled]]:border-0 [&[readonly][disabled]]:text-[var(--text-input-neutral-idle)] [&[readonly][disabled]]:hover:bg-[var(--fill-input-neutral-idle)] [&[readonly][disabled]]:hover:border-0 [&[readonly][disabled]]:focus:bg-[var(--fill-input-neutral-idle)] [&[readonly][disabled]]:focus:border-0 [&[readonly][disabled]]:focus-visible:bg-[var(--fill-input-neutral-idle)] [&[readonly][disabled]]:focus-visible:border-0",{variants:{variant:{default:"dark:focus-visible:bg-fill-input-neutral-idle dark:hover:bg-purple-muted-700 border-purple-muted-600 hover:bg-fill-input-neutral-hover focus:bg-purple-muted-700 focus:border-purple-muted-600 focus-visible:ring-none focus-visible:ring-none [&[readonly]]:hover:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:hover:border-0 [&[readonly]]:focus:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:focus:border-0 [&[readonly]]:focus-visible:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:focus-visible:border-0",secondary:"bg-secondary border-secondary text-secondary-foreground placeholder:text-color-purple-muted-400 dark:bg-secondary dark:border-secondary dark:text-secondary-foreground dark:placeholder:text-purple-muted-400",accent:"bg-accent border-accent text-accent-foreground placeholder:text-color-purple-muted-400 dark:bg-accent dark:border-accent dark:text-accent-foreground dark:placeholder:text-purple-muted-400",success:"bg-success border-success text-success-foreground placeholder:text-success-foreground/70 dark:bg-success dark:border-success dark:text-success-foreground dark:placeholder:text-success-foreground/70",warning:"bg-warning border-warning text-warning-foreground placeholder:text-warning-foreground/70 dark:bg-warning dark:border-warning dark:text-warning-foreground dark:placeholder:text-warning-foreground/70",destructive:"border-destructive bg-purple-muted-700 text-[--var(text-input-neutral-idle)] placeholder:text-destructive-foreground/70 dark:border-destructive dark:placeholder:text-destructive-foreground/70",ghost:"bg-transparent border-purple-muted-600 focus:border-purple-muted-600 focus-visible:ring-none focus-visible:ring-none [:not(:placeholder-shown)]:bg-transparent"}},defaultVariants:{variant:"default"}}),rn=d.forwardRef(({className:e,variant:t,type:r,error:n,...o},a)=>l.jsx("input",{ref:a,type:r,"data-slot":"input","aria-invalid":n||void 0,className:P(Sb({variant:t,className:e})),...o}));rn.displayName="Input";function Vi(e,[t,r]){return Math.min(r,Math.max(t,e))}function Bi(e){const t=Eb(e),r=d.forwardRef((n,o)=>{const{children:a,...s}=n,i=d.Children.toArray(a),c=i.find(kb);if(c){const u=c.props.children,f=i.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...s,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Eb(e){const t=d.forwardRef((r,n)=>{const{children:o,...a}=r;if(d.isValidElement(o)){const s=jb(o),i=Nb(a,o.props);return o.type!==d.Fragment&&(i.ref=n?Ae(n,s):s),d.cloneElement(o,i)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Rb=Symbol("radix.slottable");function kb(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rb}function Nb(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function jb(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function vo(e){const t=e+"CollectionProvider",[r,n]=je(t),[o,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:x,children:b}=v,y=E.useRef(null),w=E.useRef(new Map).current;return l.jsx(o,{scope:x,itemMap:w,collectionRef:y,children:b})};s.displayName=t;const i=e+"CollectionSlot",c=Bi(i),u=E.forwardRef((v,x)=>{const{scope:b,children:y}=v,w=a(i,b),C=ce(x,w.collectionRef);return l.jsx(c,{ref:C,children:y})});u.displayName=i;const f=e+"CollectionItemSlot",p="data-radix-collection-item",m=Bi(f),g=E.forwardRef((v,x)=>{const{scope:b,children:y,...w}=v,C=E.useRef(null),R=ce(x,C),j=a(f,b);return E.useEffect(()=>(j.itemMap.set(C,{ref:C,...w}),()=>void j.itemMap.delete(C))),l.jsx(m,{[p]:"",ref:R,children:y})});g.displayName=f;function h(v){const x=a(e+"CollectionConsumer",v);return E.useCallback(()=>{const y=x.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((j,k)=>w.indexOf(j.ref.current)-w.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:g},h,n]}var Pb=d.createContext(void 0);function Gt(e){const t=d.useContext(Pb);return e||t||"ltr"}var Zo=0;function ho(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gi()),document.body.insertAdjacentElement("beforeend",e[1]??Gi()),Zo++,()=>{Zo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zo--}},[])}function Gi(){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 Jo="focusScope.autoFocusOnMount",Qo="focusScope.autoFocusOnUnmount",Wi={bubbles:!1,cancelable:!0},Tb="FocusScope",nn=d.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[i,c]=d.useState(null),u=ze(o),f=ze(a),p=d.useRef(null),m=ce(t,v=>c(v)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(n){let v=function(w){if(g.paused||!i)return;const C=w.target;i.contains(C)?p.current=C:pt(p.current,{select:!0})},x=function(w){if(g.paused||!i)return;const C=w.relatedTarget;C!==null&&(i.contains(C)||pt(p.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&pt(i)};document.addEventListener("focusin",v),document.addEventListener("focusout",x);const y=new MutationObserver(b);return i&&y.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),y.disconnect()}}},[n,i,g.paused]),d.useEffect(()=>{if(i){qi.add(g);const v=document.activeElement;if(!i.contains(v)){const b=new CustomEvent(Jo,Wi);i.addEventListener(Jo,u),i.dispatchEvent(b),b.defaultPrevented||(Ib(Db(qc(i)),{select:!0}),document.activeElement===v&&pt(i))}return()=>{i.removeEventListener(Jo,u),setTimeout(()=>{const b=new CustomEvent(Qo,Wi);i.addEventListener(Qo,f),i.dispatchEvent(b),b.defaultPrevented||pt(v??document.body,{select:!0}),i.removeEventListener(Qo,f),qi.remove(g)},0)}}},[i,u,f,g]);const h=d.useCallback(v=>{if(!r&&!n||g.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(x&&b){const y=v.currentTarget,[w,C]=Ab(y);w&&C?!v.shiftKey&&b===C?(v.preventDefault(),r&&pt(w,{select:!0})):v.shiftKey&&b===w&&(v.preventDefault(),r&&pt(C,{select:!0})):b===y&&v.preventDefault()}},[r,n,g.paused]);return l.jsx(ne.div,{tabIndex:-1,...s,ref:m,onKeyDown:h})});nn.displayName=Tb;function Ib(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(pt(n,{select:t}),document.activeElement!==r)return}function Ab(e){const t=qc(e),r=zi(t,e),n=zi(t.reverse(),e);return[r,n]}function qc(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function zi(e,t){for(const r of e)if(!_b(r,{upTo:t}))return r}function _b(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 Ob(e){return e instanceof HTMLInputElement&&"select"in e}function pt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Ob(e)&&t&&e.select()}}var qi=Mb();function Mb(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Hi(e,t),e.unshift(t)},remove(t){var r;e=Hi(e,t),(r=e[0])==null||r.resume()}}}function Hi(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Db(e){return e.filter(t=>t.tagName!=="A")}function $b(e){const t=Lb(e),r=d.forwardRef((n,o)=>{const{children:a,...s}=n,i=d.Children.toArray(a),c=i.find(Vb);if(c){const u=c.props.children,f=i.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...s,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Lb(e){const t=d.forwardRef((r,n)=>{const{children:o,...a}=r;if(d.isValidElement(o)){const s=Gb(o),i=Bb(a,o.props);return o.type!==d.Fragment&&(i.ref=n?Ae(n,s):s),d.cloneElement(o,i)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fb=Symbol("radix.slottable");function Vb(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fb}function Bb(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function Gb(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function xo(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Wb=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Qt=new WeakMap,jn=new WeakMap,Pn={},ea=0,Hc=function(e){return e&&(e.host||Hc(e.parentNode))},zb=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Hc(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},qb=function(e,t,r,n){var o=zb(t,Array.isArray(e)?e:[e]);Pn[r]||(Pn[r]=new WeakMap);var a=Pn[r],s=[],i=new Set,c=new Set(o),u=function(p){!p||i.has(p)||(i.add(p),u(p.parentNode))};o.forEach(u);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(i.has(m))f(m);else try{var g=m.getAttribute(n),h=g!==null&&g!=="false",v=(Qt.get(m)||0)+1,x=(a.get(m)||0)+1;Qt.set(m,v),a.set(m,x),s.push(m),v===1&&h&&jn.set(m,!0),x===1&&m.setAttribute(r,"true"),h||m.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",m,b)}})};return f(t),i.clear(),ea++,function(){s.forEach(function(p){var m=Qt.get(p)-1,g=a.get(p)-1;Qt.set(p,m),a.set(p,g),m||(jn.has(p)||p.removeAttribute(n),jn.delete(p)),g||p.removeAttribute(r)}),ea--,ea||(Qt=new WeakMap,Qt=new WeakMap,jn=new WeakMap,Pn={})}},bo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Wb(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),qb(n,o,r,"aria-hidden")):function(){return null}},Je=function(){return Je=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Je.apply(this,arguments)};function Uc(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Hb(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var Mn="right-scroll-bar-position",Dn="width-before-scroll-bar",Ub="with-scroll-bars-hidden",Kb="--removed-body-scroll-bar-size";function ta(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yb(e,t){var r=E.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Xb=typeof window<"u"?d.useLayoutEffect:d.useEffect,Ui=new WeakMap;function Zb(e,t){var r=Yb(null,function(n){return e.forEach(function(o){return ta(o,n)})});return Xb(function(){var n=Ui.get(r);if(n){var o=new Set(n),a=new Set(e),s=r.current;o.forEach(function(i){a.has(i)||ta(i,null)}),a.forEach(function(i){o.has(i)||ta(i,s)})}Ui.set(r,e)},[e]),r}function Jb(e){return e}function Qb(e,t){t===void 0&&(t=Jb);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var s=t(a,n);return r.push(s),function(){r=r.filter(function(i){return i!==s})}},assignSyncMedium:function(a){for(n=!0;r.length;){var s=r;r=[],s.forEach(a)}r={push:function(i){return a(i)},filter:function(){return r}}},assignMedium:function(a){n=!0;var s=[];if(r.length){var i=r;r=[],i.forEach(a),s=r}var c=function(){var f=s;s=[],f.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),r}}}};return o}function ey(e){e===void 0&&(e={});var t=Qb(null);return t.options=Je({async:!0,ssr:!1},e),t}var Kc=function(e){var t=e.sideCar,r=Uc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return d.createElement(n,Je({},r))};Kc.isSideCarExport=!0;function ty(e,t){return e.useMedium(t),Kc}var Yc=ey(),ra=function(){},yo=d.forwardRef(function(e,t){var r=d.useRef(null),n=d.useState({onScrollCapture:ra,onWheelCapture:ra,onTouchMoveCapture:ra}),o=n[0],a=n[1],s=e.forwardProps,i=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,h=e.noIsolation,v=e.inert,x=e.allowPinchZoom,b=e.as,y=b===void 0?"div":b,w=e.gapMode,C=Uc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,j=Zb([r,t]),k=Je(Je({},C),o);return d.createElement(d.Fragment,null,f&&d.createElement(R,{sideCar:Yc,removeScrollBar:u,shards:p,noRelative:g,noIsolation:h,inert:v,setCallbacks:a,allowPinchZoom:!!x,lockRef:r,gapMode:w}),s?d.cloneElement(d.Children.only(i),Je(Je({},k),{ref:j})):d.createElement(y,Je({},k,{className:c,ref:j}),i))});yo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yo.classNames={fullWidth:Dn,zeroRight:Mn};var ry=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ny(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ry();return t&&e.setAttribute("nonce",t),e}function oy(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ay(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sy=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ny())&&(oy(t,r),ay(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},iy=function(){var e=sy();return function(t,r){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Xc=function(){var e=iy(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},ly={left:0,top:0,right:0,gap:0},na=function(e){return parseInt(e||"",10)||0},cy=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[na(r),na(n),na(o)]},uy=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ly;var t=cy(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},dy=Xc(),lr="data-scroll-locked",fy=function(e,t,r,n){var o=e.left,a=e.top,s=e.right,i=e.gap;return r===void 0&&(r="margin"),`
150
+ */const ih=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ao=Ce("x",ih);function K(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ki(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ae(...e){return t=>{let r=!1;const n=e.map(o=>{const a=ki(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){const a=n[o];typeof a=="function"?a():ki(e[o],null)}}}}function ce(...e){return d.useCallback(Ae(...e),e)}function lh(e,t){const r=d.createContext(t),n=a=>{const{children:s,...i}=a,c=d.useMemo(()=>i,Object.values(i));return l.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(a){const s=d.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,o]}function je(e,t=[]){let r=[];function n(a,s){const i=d.createContext(s),c=r.length;r=[...r,s];const u=p=>{var b;const{scope:m,children:g,...h}=p,v=((b=m==null?void 0:m[e])==null?void 0:b[c])||i,x=d.useMemo(()=>h,Object.values(h));return l.jsx(v.Provider,{value:x,children:g})};u.displayName=a+"Provider";function f(p,m){var v;const g=((v=m==null?void 0:m[e])==null?void 0:v[c])||i,h=d.useContext(g);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[u,f]}const o=()=>{const a=r.map(s=>d.createContext(s));return function(i){const c=(i==null?void 0:i[e])||a;return d.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[n,ch(o,...t)]}function ch(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=n.reduce((i,{useScope:c,scopeName:u})=>{const p=c(a)[`__scope${u}`];return{...i,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function uh(e){const t=dh(e),r=d.forwardRef((n,o)=>{const{children:a,...s}=n,i=d.Children.toArray(a),c=i.find(ph);if(c){const u=c.props.children,f=i.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...s,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function dh(e){const t=d.forwardRef((r,n)=>{const{children:o,...a}=r;if(d.isValidElement(o)){const s=gh(o),i=mh(a,o.props);return o.type!==d.Fragment&&(i.ref=n?Ae(n,s):s),d.cloneElement(o,i)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fh=Symbol("radix.slottable");function ph(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fh}function mh(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function gh(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var vh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=vh.reduce((e,t)=>{const r=uh(`Primitive.${t}`),n=d.forwardRef((o,a)=>{const{asChild:s,...i}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lc(e,t){e&&no.flushSync(()=>e.dispatchEvent(t))}function ze(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function hh(e,t=globalThis==null?void 0:globalThis.document){const r=ze(e);d.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var xh="DismissableLayer",ga="dismissableLayer.update",bh="dismissableLayer.pointerDownOutside",yh="dismissableLayer.focusOutside",Ni,cc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gr=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:i,...c}=e,u=d.useContext(cc),[f,p]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),h=ce(t,k=>p(k)),v=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(x),y=f?v.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,C=y>=b,R=Sh(k=>{const N=k.target,$=[...u.branches].some(B=>B.contains(N));!C||$||(o==null||o(k),s==null||s(k),k.defaultPrevented||i==null||i())},m),j=Eh(k=>{const N=k.target;[...u.branches].some(B=>B.contains(N))||(a==null||a(k),s==null||s(k),k.defaultPrevented||i==null||i())},m);return hh(k=>{y===u.layers.size-1&&(n==null||n(k),!k.defaultPrevented&&i&&(k.preventDefault(),i()))},m),d.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ni=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),ji(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ni)}},[f,m,r,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),ji())},[f,u]),d.useEffect(()=>{const k=()=>g({});return document.addEventListener(ga,k),()=>document.removeEventListener(ga,k)},[]),l.jsx(ne.div,{...c,ref:h,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:K(e.onFocusCapture,j.onFocusCapture),onBlurCapture:K(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,R.onPointerDownCapture)})});gr.displayName=xh;var wh="DismissableLayerBranch",Ch=d.forwardRef((e,t)=>{const r=d.useContext(cc),n=d.useRef(null),o=ce(t,n);return d.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),l.jsx(ne.div,{...e,ref:o})});Ch.displayName=wh;function Sh(e,t=globalThis==null?void 0:globalThis.document){const r=ze(e),n=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const a=i=>{if(i.target&&!n.current){let c=function(){uc(bh,r,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Eh(e,t=globalThis==null?void 0:globalThis.document){const r=ze(e),n=d.useRef(!1);return d.useEffect(()=>{const o=a=>{a.target&&!n.current&&uc(yh,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ji(){const e=new CustomEvent(ga);document.dispatchEvent(e)}function uc(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?lc(o,a):o.dispatchEvent(a)}var Ne=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},Rh=d[" useId ".trim().toString()]||(()=>{}),kh=0;function be(e){const[t,r]=d.useState(Rh());return Ne(()=>{r(n=>n??String(kh++))},[e]),t?`radix-${t}`:""}const Nh=["top","right","bottom","left"],vt=Math.min,De=Math.max,Vn=Math.round,kn=Math.floor,et=e=>({x:e,y:e}),jh={left:"right",right:"left",bottom:"top",top:"bottom"},Ph={start:"end",end:"start"};function va(e,t,r){return De(e,vt(t,r))}function lt(e,t){return typeof e=="function"?e(t):e}function ct(e){return e.split("-")[0]}function vr(e){return e.split("-")[1]}function Wa(e){return e==="x"?"y":"x"}function za(e){return e==="y"?"height":"width"}const Th=new Set(["top","bottom"]);function Qe(e){return Th.has(ct(e))?"y":"x"}function qa(e){return Wa(Qe(e))}function Ih(e,t,r){r===void 0&&(r=!1);const n=vr(e),o=qa(e),a=za(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Bn(s)),[s,Bn(s)]}function Ah(e){const t=Bn(e);return[ha(e),t,ha(t)]}function ha(e){return e.replace(/start|end/g,t=>Ph[t])}const Pi=["left","right"],Ti=["right","left"],_h=["top","bottom"],Oh=["bottom","top"];function Mh(e,t,r){switch(e){case"top":case"bottom":return r?t?Ti:Pi:t?Pi:Ti;case"left":case"right":return t?_h:Oh;default:return[]}}function Dh(e,t,r,n){const o=vr(e);let a=Mh(ct(e),r==="start",n);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map(ha)))),a}function Bn(e){return e.replace(/left|right|bottom|top/g,t=>jh[t])}function $h(e){return{top:0,right:0,bottom:0,left:0,...e}}function dc(e){return typeof e!="number"?$h(e):{top:e,right:e,bottom:e,left:e}}function Gn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Ii(e,t,r){let{reference:n,floating:o}=e;const a=Qe(t),s=qa(t),i=za(s),c=ct(t),u=a==="y",f=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[i]/2-o[i]/2;let g;switch(c){case"top":g={x:f,y:n.y-o.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(vr(t)){case"start":g[s]-=m*(r&&u?-1:1);break;case"end":g[s]+=m*(r&&u?-1:1);break}return g}const Lh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:s}=r,i=a.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=Ii(u,n,c),m=n,g={},h=0;for(let v=0;v<i.length;v++){const{name:x,fn:b}=i[v],{x:y,y:w,data:C,reset:R}=await b({x:f,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:u,platform:s,elements:{reference:e,floating:t}});f=y??f,p=w??p,g={...g,[x]:{...g[x],...C}},R&&h<=50&&(h++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(u=R.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:f,y:p}=Ii(u,m,c)),v=-1)}return{x:f,y:p,placement:m,strategy:o,middlewareData:g}};async function Wr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:s,elements:i,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=lt(t,e),h=dc(g),x=i[m?p==="floating"?"reference":"floating":p],b=Gn(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(x)))==null||r?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:u,rootBoundary:f,strategy:c})),y=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),C=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},R=Gn(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:w,strategy:c}):y);return{top:(b.top-R.top+h.top)/C.y,bottom:(R.bottom-b.bottom+h.bottom)/C.y,left:(b.left-R.left+h.left)/C.x,right:(R.right-b.right+h.right)/C.x}}const Fh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:s,elements:i,middlewareData:c}=t,{element:u,padding:f=0}=lt(e,t)||{};if(u==null)return{};const p=dc(f),m={x:r,y:n},g=qa(o),h=za(g),v=await s.getDimensions(u),x=g==="y",b=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",C=a.reference[h]+a.reference[g]-m[g]-a.floating[h],R=m[g]-a.reference[g],j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let k=j?j[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(j)))&&(k=i.floating[w]||a.floating[h]);const N=C/2-R/2,$=k/2-v[h]/2-1,B=vt(p[b],$),G=vt(p[y],$),Q=B,ee=k-v[h]-G,W=k/2-v[h]/2+N,M=va(Q,W,ee),_=!c.arrow&&vr(o)!=null&&W!==M&&a.reference[h]/2-(W<Q?B:G)-v[h]/2<0,D=_?W<Q?W-Q:W-ee:0;return{[g]:m[g]+D,data:{[g]:M,centerOffset:W-M-D,..._&&{alignmentOffset:D}},reset:_}}}),Vh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:s,initialPlacement:i,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...x}=lt(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const b=ct(o),y=Qe(i),w=ct(i)===i,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),R=m||(w||!v?[Bn(i)]:Ah(i)),j=h!=="none";!m&&j&&R.push(...Dh(i,v,h,C));const k=[i,...R],N=await Wr(t,x),$=[];let B=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&$.push(N[b]),p){const W=Ih(o,s,C);$.push(N[W[0]],N[W[1]])}if(B=[...B,{placement:o,overflows:$}],!$.every(W=>W<=0)){var G,Q;const W=(((G=a.flip)==null?void 0:G.index)||0)+1,M=k[W];if(M&&(!(p==="alignment"?y!==Qe(M):!1)||B.every(T=>Qe(T.placement)===y?T.overflows[0]>0:!0)))return{data:{index:W,overflows:B},reset:{placement:M}};let _=(Q=B.filter(D=>D.overflows[0]<=0).sort((D,T)=>D.overflows[1]-T.overflows[1])[0])==null?void 0:Q.placement;if(!_)switch(g){case"bestFit":{var ee;const D=(ee=B.filter(T=>{if(j){const O=Qe(T.placement);return O===y||O==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(O=>O>0).reduce((O,U)=>O+U,0)]).sort((T,O)=>T[1]-O[1])[0])==null?void 0:ee[0];D&&(_=D);break}case"initialPlacement":_=i;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function Ai(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _i(e){return Nh.some(t=>e[t]>=0)}const Bh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=lt(e,t);switch(n){case"referenceHidden":{const a=await Wr(t,{...o,elementContext:"reference"}),s=Ai(a,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:_i(s)}}}case"escaped":{const a=await Wr(t,{...o,altBoundary:!0}),s=Ai(a,r.floating);return{data:{escapedOffsets:s,escaped:_i(s)}}}default:return{}}}}},fc=new Set(["left","top"]);async function Gh(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ct(r),i=vr(r),c=Qe(r)==="y",u=fc.has(s)?-1:1,f=a&&c?-1:1,p=lt(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof h=="number"&&(g=i==="end"?h*-1:h),c?{x:g*f,y:m*u}:{x:m*u,y:g*f}}const Wh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:s,middlewareData:i}=t,c=await Gh(t,e);return s===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:s}}}}},zh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:i={fn:x=>{let{x:b,y}=x;return{x:b,y}}},...c}=lt(e,t),u={x:r,y:n},f=await Wr(t,c),p=Qe(ct(o)),m=Wa(p);let g=u[m],h=u[p];if(a){const x=m==="y"?"top":"left",b=m==="y"?"bottom":"right",y=g+f[x],w=g-f[b];g=va(y,g,w)}if(s){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",y=h+f[x],w=h-f[b];h=va(y,h,w)}const v=i.fn({...t,[m]:g,[p]:h});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[m]:a,[p]:s}}}}}},qh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:s}=t,{offset:i=0,mainAxis:c=!0,crossAxis:u=!0}=lt(e,t),f={x:r,y:n},p=Qe(o),m=Wa(p);let g=f[m],h=f[p];const v=lt(i,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const w=m==="y"?"height":"width",C=a.reference[m]-a.floating[w]+x.mainAxis,R=a.reference[m]+a.reference[w]-x.mainAxis;g<C?g=C:g>R&&(g=R)}if(u){var b,y;const w=m==="y"?"width":"height",C=fc.has(ct(o)),R=a.reference[p]-a.floating[w]+(C&&((b=s.offset)==null?void 0:b[p])||0)+(C?0:x.crossAxis),j=a.reference[p]+a.reference[w]+(C?0:((y=s.offset)==null?void 0:y[p])||0)-(C?x.crossAxis:0);h<R?h=R:h>j&&(h=j)}return{[m]:g,[p]:h}}}},Hh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:s,elements:i}=t,{apply:c=()=>{},...u}=lt(e,t),f=await Wr(t,u),p=ct(o),m=vr(o),g=Qe(o)==="y",{width:h,height:v}=a.floating;let x,b;p==="top"||p==="bottom"?(x=p,b=m===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(b=p,x=m==="end"?"top":"bottom");const y=v-f.top-f.bottom,w=h-f.left-f.right,C=vt(v-f[x],y),R=vt(h-f[b],w),j=!t.middlewareData.shift;let k=C,N=R;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(N=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=y),j&&!m){const B=De(f.left,0),G=De(f.right,0),Q=De(f.top,0),ee=De(f.bottom,0);g?N=h-2*(B!==0||G!==0?B+G:De(f.left,f.right)):k=v-2*(Q!==0||ee!==0?Q+ee:De(f.top,f.bottom))}await c({...t,availableWidth:N,availableHeight:k});const $=await s.getDimensions(i.floating);return h!==$.width||v!==$.height?{reset:{rects:!0}}:{}}}};function so(){return typeof window<"u"}function hr(e){return pc(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rt(e){var t;return(t=(pc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pc(e){return so()?e instanceof Node||e instanceof $e(e).Node:!1}function qe(e){return so()?e instanceof Element||e instanceof $e(e).Element:!1}function tt(e){return so()?e instanceof HTMLElement||e instanceof $e(e).HTMLElement:!1}function Oi(e){return!so()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}const Uh=new Set(["inline","contents"]);function Jr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=He(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Uh.has(o)}const Kh=new Set(["table","td","th"]);function Yh(e){return Kh.has(hr(e))}const Xh=[":popover-open",":modal"];function io(e){return Xh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Zh=["transform","translate","scale","rotate","perspective"],Jh=["transform","translate","scale","rotate","perspective","filter"],Qh=["paint","layout","strict","content"];function Ha(e){const t=Ua(),r=qe(e)?He(e):e;return Zh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Jh.some(n=>(r.willChange||"").includes(n))||Qh.some(n=>(r.contain||"").includes(n))}function ex(e){let t=ht(e);for(;tt(t)&&!cr(t);){if(Ha(t))return t;if(io(t))return null;t=ht(t)}return null}function Ua(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tx=new Set(["html","body","#document"]);function cr(e){return tx.has(hr(e))}function He(e){return $e(e).getComputedStyle(e)}function lo(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ht(e){if(hr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Oi(e)&&e.host||rt(e);return Oi(t)?t.host:t}function mc(e){const t=ht(e);return cr(t)?e.ownerDocument?e.ownerDocument.body:e.body:tt(t)&&Jr(t)?t:mc(t)}function zr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=mc(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),s=$e(o);if(a){const i=xa(s);return t.concat(s,s.visualViewport||[],Jr(o)?o:[],i&&r?zr(i):[])}return t.concat(o,zr(o,[],r))}function xa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gc(e){const t=He(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=tt(e),a=o?e.offsetWidth:r,s=o?e.offsetHeight:n,i=Vn(r)!==a||Vn(n)!==s;return i&&(r=a,n=s),{width:r,height:n,$:i}}function Ka(e){return qe(e)?e:e.contextElement}function ir(e){const t=Ka(e);if(!tt(t))return et(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=gc(t);let s=(a?Vn(r.width):r.width)/n,i=(a?Vn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const rx=et(0);function vc(e){const t=$e(e);return!Ua()||!t.visualViewport?rx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nx(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==$e(e)?!1:t}function _t(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=Ka(e);let s=et(1);t&&(n?qe(n)&&(s=ir(n)):s=ir(e));const i=nx(a,r,n)?vc(a):et(0);let c=(o.left+i.x)/s.x,u=(o.top+i.y)/s.y,f=o.width/s.x,p=o.height/s.y;if(a){const m=$e(a),g=n&&qe(n)?$e(n):n;let h=m,v=xa(h);for(;v&&n&&g!==h;){const x=ir(v),b=v.getBoundingClientRect(),y=He(v),w=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*x.x,C=b.top+(v.clientTop+parseFloat(y.paddingTop))*x.y;c*=x.x,u*=x.y,f*=x.x,p*=x.y,c+=w,u+=C,h=$e(v),v=xa(h)}}return Gn({width:f,height:p,x:c,y:u})}function co(e,t){const r=lo(e).scrollLeft;return t?t.left+r:_t(rt(e)).left+r}function hc(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-co(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function ox(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",s=rt(n),i=t?io(t.floating):!1;if(n===s||i&&a)return r;let c={scrollLeft:0,scrollTop:0},u=et(1);const f=et(0),p=tt(n);if((p||!p&&!a)&&((hr(n)!=="body"||Jr(s))&&(c=lo(n)),tt(n))){const g=_t(n);u=ir(n),f.x=g.x+n.clientLeft,f.y=g.y+n.clientTop}const m=s&&!p&&!a?hc(s,c):et(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+f.x+m.x,y:r.y*u.y-c.scrollTop*u.y+f.y+m.y}}function ax(e){return Array.from(e.getClientRects())}function sx(e){const t=rt(e),r=lo(e),n=e.ownerDocument.body,o=De(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=De(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+co(e);const i=-r.scrollTop;return He(n).direction==="rtl"&&(s+=De(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:s,y:i}}const Mi=25;function ix(e,t){const r=$e(e),n=rt(e),o=r.visualViewport;let a=n.clientWidth,s=n.clientHeight,i=0,c=0;if(o){a=o.width,s=o.height;const f=Ua();(!f||f&&t==="fixed")&&(i=o.offsetLeft,c=o.offsetTop)}const u=co(n);if(u<=0){const f=n.ownerDocument,p=f.body,m=getComputedStyle(p),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(n.clientWidth-p.clientWidth-g);h<=Mi&&(a-=h)}else u<=Mi&&(a+=u);return{width:a,height:s,x:i,y:c}}const lx=new Set(["absolute","fixed"]);function cx(e,t){const r=_t(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=tt(e)?ir(e):et(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,c=o*a.x,u=n*a.y;return{width:s,height:i,x:c,y:u}}function Di(e,t,r){let n;if(t==="viewport")n=ix(e,r);else if(t==="document")n=sx(rt(e));else if(qe(t))n=cx(t,r);else{const o=vc(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Gn(n)}function xc(e,t){const r=ht(e);return r===t||!qe(r)||cr(r)?!1:He(r).position==="fixed"||xc(r,t)}function ux(e,t){const r=t.get(e);if(r)return r;let n=zr(e,[],!1).filter(i=>qe(i)&&hr(i)!=="body"),o=null;const a=He(e).position==="fixed";let s=a?ht(e):e;for(;qe(s)&&!cr(s);){const i=He(s),c=Ha(s);!c&&i.position==="fixed"&&(o=null),(a?!c&&!o:!c&&i.position==="static"&&!!o&&lx.has(o.position)||Jr(s)&&!c&&xc(e,s))?n=n.filter(f=>f!==s):o=i,s=ht(s)}return t.set(e,n),n}function dx(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?io(t)?[]:ux(t,this._c):[].concat(r),n],i=s[0],c=s.reduce((u,f)=>{const p=Di(t,f,o);return u.top=De(p.top,u.top),u.right=vt(p.right,u.right),u.bottom=vt(p.bottom,u.bottom),u.left=De(p.left,u.left),u},Di(t,i,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function fx(e){const{width:t,height:r}=gc(e);return{width:t,height:r}}function px(e,t,r){const n=tt(t),o=rt(t),a=r==="fixed",s=_t(e,!0,a,t);let i={scrollLeft:0,scrollTop:0};const c=et(0);function u(){c.x=co(o)}if(n||!n&&!a)if((hr(t)!=="body"||Jr(o))&&(i=lo(t)),n){const g=_t(t,!0,a,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&u();a&&!n&&o&&u();const f=o&&!n&&!a?hc(o,i):et(0),p=s.left+i.scrollLeft-c.x-f.x,m=s.top+i.scrollTop-c.y-f.y;return{x:p,y:m,width:s.width,height:s.height}}function Yo(e){return He(e).position==="static"}function $i(e,t){if(!tt(e)||He(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return rt(e)===r&&(r=r.ownerDocument.body),r}function bc(e,t){const r=$e(e);if(io(e))return r;if(!tt(e)){let o=ht(e);for(;o&&!cr(o);){if(qe(o)&&!Yo(o))return o;o=ht(o)}return r}let n=$i(e,t);for(;n&&Yh(n)&&Yo(n);)n=$i(n,t);return n&&cr(n)&&Yo(n)&&!Ha(n)?r:n||ex(e)||r}const mx=async function(e){const t=this.getOffsetParent||bc,r=this.getDimensions,n=await r(e.floating);return{reference:px(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function gx(e){return He(e).direction==="rtl"}const vx={convertOffsetParentRelativeRectToViewportRelativeRect:ox,getDocumentElement:rt,getClippingRect:dx,getOffsetParent:bc,getElementRects:mx,getClientRects:ax,getDimensions:fx,getScale:ir,isElement:qe,isRTL:gx};function yc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hx(e,t){let r=null,n;const o=rt(e);function a(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function s(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:f,top:p,width:m,height:g}=u;if(i||t(),!m||!g)return;const h=kn(p),v=kn(o.clientWidth-(f+m)),x=kn(o.clientHeight-(p+g)),b=kn(f),w={rootMargin:-h+"px "+-v+"px "+-x+"px "+-b+"px",threshold:De(0,vt(1,c))||1};let C=!0;function R(j){const k=j[0].intersectionRatio;if(k!==c){if(!C)return s();k?s(!1,k):n=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!yc(u,e.getBoundingClientRect())&&s(),C=!1}try{r=new IntersectionObserver(R,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(R,w)}r.observe(e)}return s(!0),a}function xx(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Ka(e),f=o||a?[...u?zr(u):[],...zr(t)]:[];f.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),a&&b.addEventListener("resize",r)});const p=u&&i?hx(u,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(b=>{let[y]=b;y&&y.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),u&&!c&&g.observe(u),g.observe(t));let h,v=c?_t(e):null;c&&x();function x(){const b=_t(e);v&&!yc(v,b)&&r(),v=b,h=requestAnimationFrame(x)}return r(),()=>{var b;f.forEach(y=>{o&&y.removeEventListener("scroll",r),a&&y.removeEventListener("resize",r)}),p==null||p(),(b=g)==null||b.disconnect(),g=null,c&&cancelAnimationFrame(h)}}const bx=Wh,yx=zh,wx=Vh,Cx=Hh,Sx=Bh,Li=Fh,Ex=qh,Rx=(e,t,r)=>{const n=new Map,o={platform:vx,...r},a={...o.platform,_c:n};return Lh(e,t,{...o,platform:a})};var kx=typeof document<"u",Nx=function(){},On=kx?E.useLayoutEffect:Nx;function Wn(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 r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Wn(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!Wn(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function wc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fi(e,t){const r=wc(e);return Math.round(t*r)/r}function Xo(e){const t=d.useRef(e);return On(()=>{t.current=e}),t}function jx(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[f,p]=d.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=d.useState(n);Wn(m,n)||g(n);const[h,v]=d.useState(null),[x,b]=d.useState(null),y=d.useCallback(T=>{T!==j.current&&(j.current=T,v(T))},[]),w=d.useCallback(T=>{T!==k.current&&(k.current=T,b(T))},[]),C=a||h,R=s||x,j=d.useRef(null),k=d.useRef(null),N=d.useRef(f),$=c!=null,B=Xo(c),G=Xo(o),Q=Xo(u),ee=d.useCallback(()=>{if(!j.current||!k.current)return;const T={placement:t,strategy:r,middleware:m};G.current&&(T.platform=G.current),Rx(j.current,k.current,T).then(O=>{const U={...O,isPositioned:Q.current!==!1};W.current&&!Wn(N.current,U)&&(N.current=U,no.flushSync(()=>{p(U)}))})},[m,t,r,G,Q]);On(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,p(T=>({...T,isPositioned:!1})))},[u]);const W=d.useRef(!1);On(()=>(W.current=!0,()=>{W.current=!1}),[]),On(()=>{if(C&&(j.current=C),R&&(k.current=R),C&&R){if(B.current)return B.current(C,R,ee);ee()}},[C,R,ee,B,$]);const M=d.useMemo(()=>({reference:j,floating:k,setReference:y,setFloating:w}),[y,w]),_=d.useMemo(()=>({reference:C,floating:R}),[C,R]),D=d.useMemo(()=>{const T={position:r,left:0,top:0};if(!_.floating)return T;const O=Fi(_.floating,f.x),U=Fi(_.floating,f.y);return i?{...T,transform:"translate("+O+"px, "+U+"px)",...wc(_.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:O,top:U}},[r,i,_.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:ee,refs:M,elements:_,floatingStyles:D}),[f,ee,M,_,D])}const Px=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Li({element:n.current,padding:o}).fn(r):{}:n?Li({element:n,padding:o}).fn(r):{}}}},Tx=(e,t)=>({...bx(e),options:[e,t]}),Ix=(e,t)=>({...yx(e),options:[e,t]}),Ax=(e,t)=>({...Ex(e),options:[e,t]}),_x=(e,t)=>({...wx(e),options:[e,t]}),Ox=(e,t)=>({...Cx(e),options:[e,t]}),Mx=(e,t)=>({...Sx(e),options:[e,t]}),Dx=(e,t)=>({...Px(e),options:[e,t]});var $x="Arrow",Cc=d.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return l.jsx(ne.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Cc.displayName=$x;var Lx=Cc;function uo(e){const[t,r]=d.useState(void 0);return Ne(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,i;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;s=u.inlineSize,i=u.blockSize}else s=e.offsetWidth,i=e.offsetHeight;r({width:s,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ya="Popper",[Sc,bt]=je(Ya),[Fx,Ec]=Sc(Ya),Rc=e=>{const{__scopePopper:t,children:r}=e,[n,o]=d.useState(null);return l.jsx(Fx,{scope:t,anchor:n,onAnchorChange:o,children:r})};Rc.displayName=Ya;var kc="PopperAnchor",Nc=d.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=Ec(kc,r),s=d.useRef(null),i=ce(t,s),c=d.useRef(null);return d.useEffect(()=>{const u=c.current;c.current=(n==null?void 0:n.current)||s.current,u!==c.current&&a.onAnchorChange(c.current)}),n?null:l.jsx(ne.div,{...o,ref:i})});Nc.displayName=kc;var Xa="PopperContent",[Vx,Bx]=Sc(Xa),jc=d.forwardRef((e,t)=>{var A,z,Z,H,te,L;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:h,...v}=e,x=Ec(Xa,r),[b,y]=d.useState(null),w=ce(t,se=>y(se)),[C,R]=d.useState(null),j=uo(C),k=(j==null?void 0:j.width)??0,N=(j==null?void 0:j.height)??0,$=n+(a!=="center"?"-"+a:""),B=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},G=Array.isArray(u)?u:[u],Q=G.length>0,ee={padding:B,boundary:G.filter(Wx),altBoundary:Q},{refs:W,floatingStyles:M,placement:_,isPositioned:D,middlewareData:T}=jx({strategy:"fixed",placement:$,whileElementsMounted:(...se)=>xx(...se,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[Tx({mainAxis:o+N,alignmentAxis:s}),c&&Ix({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Ax():void 0,...ee}),c&&_x({...ee}),Ox({...ee,apply:({elements:se,rects:le,availableWidth:me,availableHeight:ve})=>{const{width:Ee,height:Le}=le.reference,Re=se.floating.style;Re.setProperty("--radix-popper-available-width",`${me}px`),Re.setProperty("--radix-popper-available-height",`${ve}px`),Re.setProperty("--radix-popper-anchor-width",`${Ee}px`),Re.setProperty("--radix-popper-anchor-height",`${Le}px`)}}),C&&Dx({element:C,padding:i}),zx({arrowWidth:k,arrowHeight:N}),m&&Mx({strategy:"referenceHidden",...ee})]}),[O,U]=Ic(_),J=ze(h);Ne(()=>{D&&(J==null||J())},[D,J]);const I=(A=T.arrow)==null?void 0:A.x,q=(z=T.arrow)==null?void 0:z.y,X=((Z=T.arrow)==null?void 0:Z.centerOffset)!==0,[Y,F]=d.useState();return Ne(()=>{b&&F(window.getComputedStyle(b).zIndex)},[b]),l.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:D?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(H=T.transformOrigin)==null?void 0:H.x,(te=T.transformOrigin)==null?void 0:te.y].join(" "),...((L=T.hide)==null?void 0:L.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Vx,{scope:r,placedSide:O,onArrowChange:R,arrowX:I,arrowY:q,shouldHideArrow:X,children:l.jsx(ne.div,{"data-side":O,"data-align":U,...v,ref:w,style:{...v.style,animation:D?void 0:"none"}})})})});jc.displayName=Xa;var Pc="PopperArrow",Gx={top:"bottom",right:"left",bottom:"top",left:"right"},Tc=d.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=Bx(Pc,n),s=Gx[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(Lx,{...o,ref:r,style:{...o.style,display:"block"}})})});Tc.displayName=Pc;function Wx(e){return e!==null}var zx=e=>({name:"transformOrigin",options:e,fn(t){var x,b,y;const{placement:r,rects:n,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,i=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[u,f]=Ic(r),p={start:"0%",center:"50%",end:"100%"}[f],m=(((b=o.arrow)==null?void 0:b.x)??0)+i/2,g=(((y=o.arrow)==null?void 0:y.y)??0)+c/2;let h="",v="";return u==="bottom"?(h=s?p:`${m}px`,v=`${-c}px`):u==="top"?(h=s?p:`${m}px`,v=`${n.floating.height+c}px`):u==="right"?(h=`${-c}px`,v=s?p:`${g}px`):u==="left"&&(h=`${n.floating.width+c}px`,v=s?p:`${g}px`),{data:{x:h,y:v}}}});function Ic(e){const[t,r="center"]=e.split("-");return[t,r]}var Qr=Rc,en=Nc,fo=jc,po=Tc,qx="Portal",xr=d.forwardRef((e,t)=>{var i;const{container:r,...n}=e,[o,a]=d.useState(!1);Ne(()=>a(!0),[]);const s=r||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return s?Zr.createPortal(l.jsx(ne.div,{...n,ref:t}),s):null});xr.displayName=qx;function Hx(e,t){return d.useReducer((r,n)=>t[r][n]??r,e)}var Pe=e=>{const{present:t,children:r}=e,n=Ux(t),o=typeof r=="function"?r({present:n.isPresent}):d.Children.only(r),a=ce(n.ref,Kx(o));return typeof r=="function"||n.isPresent?d.cloneElement(o,{ref:a}):null};Pe.displayName="Presence";function Ux(e){const[t,r]=d.useState(),n=d.useRef(null),o=d.useRef(e),a=d.useRef("none"),s=e?"mounted":"unmounted",[i,c]=Hx(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const u=Nn(n.current);a.current=i==="mounted"?u:"none"},[i]),Ne(()=>{const u=n.current,f=o.current;if(f!==e){const m=a.current,g=Nn(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ne(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,p=g=>{const v=Nn(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=g=>{g.target===t&&(a.current=Nn(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:d.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Nn(e){return(e==null?void 0:e.animationName)||"none"}function Kx(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Yx=Symbol("radix.slottable");function Xx(e){const t=({children:r})=>l.jsx(l.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Yx,t}var Zx=d[" useInsertionEffect ".trim().toString()]||Ne;function ke({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,s]=Jx({defaultProp:t,onChange:r}),i=e!==void 0,c=i?e:o;{const f=d.useRef(e!==void 0);d.useEffect(()=>{const p=f.current;p!==i&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${i?"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.`),f.current=i},[i,n])}const u=d.useCallback(f=>{var p;if(i){const m=Qx(f)?f(e):f;m!==e&&((p=s.current)==null||p.call(s,m))}else a(f)},[i,e,a,s]);return[c,u]}function Jx({defaultProp:e,onChange:t}){const[r,n]=d.useState(e),o=d.useRef(r),a=d.useRef(t);return Zx(()=>{a.current=t},[t]),d.useEffect(()=>{var s;o.current!==r&&((s=a.current)==null||s.call(a,r),o.current=r)},[r,o]),[r,n,a]}function Qx(e){return typeof e=="function"}var Ac=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),eb="VisuallyHidden",_c=d.forwardRef((e,t)=>l.jsx(ne.span,{...e,ref:t,style:{...Ac,...e.style}}));_c.displayName=eb;var tb=_c,[mo]=je("Tooltip",[bt]),go=bt(),Oc="TooltipProvider",rb=700,ba="tooltip.open",[nb,Za]=mo(Oc),Mc=e=>{const{__scopeTooltip:t,delayDuration:r=rb,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,s=d.useRef(!0),i=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(nb,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:d.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:d.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:i,onPointerInTransitChange:d.useCallback(u=>{i.current=u},[]),disableHoverableContent:o,children:a})};Mc.displayName=Oc;var qr="Tooltip",[ob,tn]=mo(qr),Dc=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:i}=e,c=Za(qr,e.__scopeTooltip),u=go(t),[f,p]=d.useState(null),m=be(),g=d.useRef(0),h=s??c.disableHoverableContent,v=i??c.delayDuration,x=d.useRef(!1),[b,y]=ke({prop:n,defaultProp:o??!1,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(ba))):c.onClose(),a==null||a(k)},caller:qr}),w=d.useMemo(()=>b?x.current?"delayed-open":"instant-open":"closed",[b]),C=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,y(!0)},[y]),R=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y(!1)},[y]),j=d.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,y(!0),g.current=0},v)},[v,y]);return d.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),l.jsx(Qr,{...u,children:l.jsx(ob,{scope:t,contentId:m,open:b,stateAttribute:w,trigger:f,onTriggerChange:p,onTriggerEnter:d.useCallback(()=>{c.isOpenDelayedRef.current?j():C()},[c.isOpenDelayedRef,j,C]),onTriggerLeave:d.useCallback(()=>{h?R():(window.clearTimeout(g.current),g.current=0)},[R,h]),onOpen:C,onClose:R,disableHoverableContent:h,children:r})})};Dc.displayName=qr;var ya="TooltipTrigger",$c=d.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=tn(ya,r),a=Za(ya,r),s=go(r),i=d.useRef(null),c=ce(t,i,o.onTriggerChange),u=d.useRef(!1),f=d.useRef(!1),p=d.useCallback(()=>u.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),l.jsx(en,{asChild:!0,...s,children:l.jsx(ne.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:c,onPointerMove:K(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:K(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:K(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:K(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:K(e.onBlur,o.onClose),onClick:K(e.onClick,o.onClose)})})});$c.displayName=ya;var Ja="TooltipPortal",[ab,sb]=mo(Ja,{forceMount:void 0}),Lc=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=tn(Ja,t);return l.jsx(ab,{scope:t,forceMount:r,children:l.jsx(Pe,{present:r||a.open,children:l.jsx(xr,{asChild:!0,container:o,children:n})})})};Lc.displayName=Ja;var ur="TooltipContent",Fc=d.forwardRef((e,t)=>{const r=sb(ur,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,s=tn(ur,e.__scopeTooltip);return l.jsx(Pe,{present:n||s.open,children:s.disableHoverableContent?l.jsx(Vc,{side:o,...a,ref:t}):l.jsx(ib,{side:o,...a,ref:t})})}),ib=d.forwardRef((e,t)=>{const r=tn(ur,e.__scopeTooltip),n=Za(ur,e.__scopeTooltip),o=d.useRef(null),a=ce(t,o),[s,i]=d.useState(null),{trigger:c,onClose:u}=r,f=o.current,{onPointerInTransitChange:p}=n,m=d.useCallback(()=>{i(null),p(!1)},[p]),g=d.useCallback((h,v)=>{const x=h.currentTarget,b={x:h.clientX,y:h.clientY},y=db(b,x.getBoundingClientRect()),w=fb(b,y),C=pb(v.getBoundingClientRect()),R=gb([...w,...C]);i(R),p(!0)},[p]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(c&&f){const h=x=>g(x,f),v=x=>g(x,c);return c.addEventListener("pointerleave",h),f.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",v)}}},[c,f,g,m]),d.useEffect(()=>{if(s){const h=v=>{const x=v.target,b={x:v.clientX,y:v.clientY},y=(c==null?void 0:c.contains(x))||(f==null?void 0:f.contains(x)),w=!mb(b,s);y?m():w&&(m(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[c,f,s,u,m]),l.jsx(Vc,{...e,ref:a})}),[lb,cb]=mo(qr,{isInside:!1}),ub=Xx("TooltipContent"),Vc=d.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...i}=e,c=tn(ur,r),u=go(r),{onClose:f}=c;return d.useEffect(()=>(document.addEventListener(ba,f),()=>document.removeEventListener(ba,f)),[f]),d.useEffect(()=>{if(c.trigger){const p=m=>{const g=m.target;g!=null&&g.contains(c.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,f]),l.jsx(gr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:l.jsxs(fo,{"data-state":c.stateAttribute,...u,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(ub,{children:n}),l.jsx(lb,{scope:r,isInside:!0,children:l.jsx(tb,{id:c.contentId,role:"tooltip",children:o||n})})]})})});Fc.displayName=ur;var Bc="TooltipArrow",Gc=d.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=go(r);return cb(Bc,r).isInside?null:l.jsx(po,{...o,...n,ref:t})});Gc.displayName=Bc;function db(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function fb(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function pb(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function mb(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const i=t[a],c=t[s],u=i.x,f=i.y,p=c.x,m=c.y;f>n!=m>n&&r<(p-u)*(n-f)/(m-f)+u&&(o=!o)}return o}function gb(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),vb(t)}function vb(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],s=r[r.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var hb=Mc,xb=Dc,bb=$c,yb=Lc,wb=Fc,Cb=Gc;function Wc({delayDuration:e=0,...t}){return l.jsx(hb,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Qa({...e}){return l.jsx(Wc,{children:l.jsx(xb,{"data-slot":"tooltip",...e})})}function es({...e}){return l.jsx(bb,{"data-slot":"tooltip-trigger",...e})}function ts({className:e,sideOffset:t=0,children:r,disableArrow:n=!1,...o}){return l.jsx(yb,{children:l.jsxs(wb,{"data-slot":"tooltip-content",sideOffset:t,className:P("qodo qodo-tooltip-content bg-purple-muted-700 border border-purple-muted-600 text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e,{"py-2.5":n}),...o,children:[r,!n&&l.jsx(Cb,{className:"bg-purple-muted-700 fill-purple-muted-700 z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const zc=Bt("qodo qodo-button inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-normal ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none cursor-pointer border border-transparent",{variants:{variant:{default:"bg-[var(--fill-action-emphasis-idle)] text-[var(--text-action-on-emphasis-idle)] hover:bg-[var(--fill-action-emphasis-hover)] focus:bg-[var(--fill-action-emphasis-hover)] active:bg-[var(--fill-action-emphasis-hover)] disabled:bg-[var(--fill-action-emphasis-disabled)]",secondary:"bg-[var(--fill-action-neutral-idle)] text-[var(--text-action-neutral-idle)] hover:bg-[var(--fill-action-neutral-hover)] active:bg-[var(--fill-action-neutral-active)] disabled:bg-[var(--fill-action-neutral-disabled)] disabled:text-[var(--text-action-neutral-disabled)]",outline:"border border-[var(--border-action-neutral-idle)] text-[var(--text-action-neutral-idle)] hover:bg-[var(--fill-action-neutral-hover)] active:bg-[var(--fill-action-neutral-active)] disabled:bg-none disabled:text-[var(--text-action-neutral-disabled)]",ghost:"text-[var(--text-action-neutral-idle)] hover:text-[var(--text-action-neutral-hover)] active:bg-[var(--fill-action-neutral-active)] disabled:bg-none disabled:text-[var(--text-action-neutral-disabled)]",link:"text-[var(--text-action-emphasis-idle)] hover:text-[var(--text-action-emphasis-hover)] active:bg-[var(--fill-action-emphasis-active)] disabled:bg-none disabled:text-[var(--text-action-emphasis-disabled)]",danger:"border border-[var(--border-action-negative-idle)] text-[var(--icon-action-negative-idle)] hover:bg-[var(--fill-action-negative-hover)] active:bg-[var(--fill-action-negative-active)] disabled:border-[var(--border-action-negative-disabled)] disabled:text-[var(--icon-action-negative-disabled)]"},size:{default:"h-10 px-4 py-2",xs:"h-fit rounded-md text-xs px-2 py-1.5",sm:"h-8 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10","icon-sm":"h-7 w-7 p-1.5 rounded-md","icon-md":"h-8 w-8 p-1.5 rounded-md","icon-lg":"h-[45px] w-[45px] p-3 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),Be=d.forwardRef(({className:e,variant:t,size:r,loading:n,children:o,disabled:a,icon:s,iconPosition:i="left",tooltip:c,tooltipProps:u,...f},p)=>{const m={lg:"w-[18px] h-[18px]",default:"w-[18px] h-[18px]",sm:"w-[18px] h-[18px]",xs:"w-3.5 h-3.5",icon:"w-[18px] h-[18px]","icon-sm":"w-3.5 h-3.5","icon-md":"w-[18px] h-[18px]","icon-lg":"w-[18px] h-[18px]"}[r??"default"],g=s&&l.jsx(s,{className:P(m,"transition-opacity",{"mr-2":o&&i==="left","ml-2":o&&i!=="left","opacity-50":a||n})}),h=l.jsxs("button",{className:P(zc({variant:t,size:r,className:e})),ref:p,disabled:a||n,...f,children:[i==="left"&&g,o,i==="right"&&g,n&&l.jsx(sc,{className:P("ml-2 animate-spin",m)})]});return c?l.jsxs(Qa,{children:[l.jsx(es,{asChild:!0,children:l.jsx("span",{className:"inline-flex",children:h})}),l.jsx(ts,{...u,children:c})]}):h});Be.displayName="Button";const Sb=Bt("qodo qodo-input file:text-foreground placeholder:text-purple-muted-400 selection:bg-primary selection:text-primary-foreground border-input-neutral-idle flex h-9 w-full min-w-0 rounded-md border bg-purple-muted-900 px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-none focus-visible:ring-none aria-invalid:border-red-600 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:bg-[var(--fill-input-neutral-idle)] disabled:border-purple-muted-500 disabled:text-purple-muted-400 read-only:cursor-default md:text-sm dark:border-input-neutral-idle dark:bg-purple-muted-900 dark:text-foreground dark:placeholder:text-[var(--color-purple-muted-400)] [:not(:placeholder-shown)]:bg-purple-muted-700 [&[readonly]]:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:border-0 [&[readonly]]:text-[var(--text-input-neutral-idle)] [&[readonly]]:hover:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:hover:border-[var(--border-input-neutral-idle)] [&[readonly]]:focus:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:focus:border-[var(--border-input-neutral-idle)] [&[readonly]]:focus-visible:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:focus-visible:border-[var(--border-input-neutral-idle)] [&[readonly][disabled]]:opacity-100 [&[readonly][disabled]]:cursor-default [&[readonly][disabled]]:bg-[var(--fill-input-neutral-idle)] [&[readonly][disabled]]:border-0 [&[readonly][disabled]]:text-[var(--text-input-neutral-idle)] [&[readonly][disabled]]:hover:bg-[var(--fill-input-neutral-idle)] [&[readonly][disabled]]:hover:border-0 [&[readonly][disabled]]:focus:bg-[var(--fill-input-neutral-idle)] [&[readonly][disabled]]:focus:border-0 [&[readonly][disabled]]:focus-visible:bg-[var(--fill-input-neutral-idle)] [&[readonly][disabled]]:focus-visible:border-0",{variants:{variant:{default:"dark:focus-visible:bg-fill-input-neutral-idle dark:hover:bg-purple-muted-700 border-purple-muted-600 hover:bg-fill-input-neutral-hover focus:bg-purple-muted-700 focus:border-purple-muted-600 focus-visible:ring-none focus-visible:ring-none [&[readonly]]:hover:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:hover:border-0 [&[readonly]]:focus:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:focus:border-0 [&[readonly]]:focus-visible:bg-[var(--fill-input-neutral-idle)] [&[readonly]]:focus-visible:border-0",secondary:"bg-secondary border-secondary text-secondary-foreground placeholder:text-color-purple-muted-400 dark:bg-secondary dark:border-secondary dark:text-secondary-foreground dark:placeholder:text-purple-muted-400",accent:"bg-accent border-accent text-accent-foreground placeholder:text-color-purple-muted-400 dark:bg-accent dark:border-accent dark:text-accent-foreground dark:placeholder:text-purple-muted-400",success:"bg-success border-success text-success-foreground placeholder:text-success-foreground/70 dark:bg-success dark:border-success dark:text-success-foreground dark:placeholder:text-success-foreground/70",warning:"bg-warning border-warning text-warning-foreground placeholder:text-warning-foreground/70 dark:bg-warning dark:border-warning dark:text-warning-foreground dark:placeholder:text-warning-foreground/70",destructive:"border-destructive bg-purple-muted-700 text-[--var(text-input-neutral-idle)] placeholder:text-destructive-foreground/70 dark:border-destructive dark:placeholder:text-destructive-foreground/70",ghost:"bg-transparent border-purple-muted-600 focus:border-purple-muted-600 focus-visible:ring-none focus-visible:ring-none [:not(:placeholder-shown)]:bg-transparent"}},defaultVariants:{variant:"default"}}),rn=d.forwardRef(({className:e,variant:t,type:r,error:n,...o},a)=>l.jsx("input",{ref:a,type:r,"data-slot":"input","aria-invalid":n||void 0,className:P(Sb({variant:t,className:e})),...o}));rn.displayName="Input";function Vi(e,[t,r]){return Math.min(r,Math.max(t,e))}function Bi(e){const t=Eb(e),r=d.forwardRef((n,o)=>{const{children:a,...s}=n,i=d.Children.toArray(a),c=i.find(kb);if(c){const u=c.props.children,f=i.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...s,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Eb(e){const t=d.forwardRef((r,n)=>{const{children:o,...a}=r;if(d.isValidElement(o)){const s=jb(o),i=Nb(a,o.props);return o.type!==d.Fragment&&(i.ref=n?Ae(n,s):s),d.cloneElement(o,i)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Rb=Symbol("radix.slottable");function kb(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rb}function Nb(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function jb(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function vo(e){const t=e+"CollectionProvider",[r,n]=je(t),[o,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:x,children:b}=v,y=E.useRef(null),w=E.useRef(new Map).current;return l.jsx(o,{scope:x,itemMap:w,collectionRef:y,children:b})};s.displayName=t;const i=e+"CollectionSlot",c=Bi(i),u=E.forwardRef((v,x)=>{const{scope:b,children:y}=v,w=a(i,b),C=ce(x,w.collectionRef);return l.jsx(c,{ref:C,children:y})});u.displayName=i;const f=e+"CollectionItemSlot",p="data-radix-collection-item",m=Bi(f),g=E.forwardRef((v,x)=>{const{scope:b,children:y,...w}=v,C=E.useRef(null),R=ce(x,C),j=a(f,b);return E.useEffect(()=>(j.itemMap.set(C,{ref:C,...w}),()=>void j.itemMap.delete(C))),l.jsx(m,{[p]:"",ref:R,children:y})});g.displayName=f;function h(v){const x=a(e+"CollectionConsumer",v);return E.useCallback(()=>{const y=x.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((j,k)=>w.indexOf(j.ref.current)-w.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:g},h,n]}var Pb=d.createContext(void 0);function Gt(e){const t=d.useContext(Pb);return e||t||"ltr"}var Zo=0;function ho(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gi()),document.body.insertAdjacentElement("beforeend",e[1]??Gi()),Zo++,()=>{Zo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zo--}},[])}function Gi(){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 Jo="focusScope.autoFocusOnMount",Qo="focusScope.autoFocusOnUnmount",Wi={bubbles:!1,cancelable:!0},Tb="FocusScope",nn=d.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[i,c]=d.useState(null),u=ze(o),f=ze(a),p=d.useRef(null),m=ce(t,v=>c(v)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(n){let v=function(w){if(g.paused||!i)return;const C=w.target;i.contains(C)?p.current=C:pt(p.current,{select:!0})},x=function(w){if(g.paused||!i)return;const C=w.relatedTarget;C!==null&&(i.contains(C)||pt(p.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&pt(i)};document.addEventListener("focusin",v),document.addEventListener("focusout",x);const y=new MutationObserver(b);return i&&y.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),y.disconnect()}}},[n,i,g.paused]),d.useEffect(()=>{if(i){qi.add(g);const v=document.activeElement;if(!i.contains(v)){const b=new CustomEvent(Jo,Wi);i.addEventListener(Jo,u),i.dispatchEvent(b),b.defaultPrevented||(Ib(Db(qc(i)),{select:!0}),document.activeElement===v&&pt(i))}return()=>{i.removeEventListener(Jo,u),setTimeout(()=>{const b=new CustomEvent(Qo,Wi);i.addEventListener(Qo,f),i.dispatchEvent(b),b.defaultPrevented||pt(v??document.body,{select:!0}),i.removeEventListener(Qo,f),qi.remove(g)},0)}}},[i,u,f,g]);const h=d.useCallback(v=>{if(!r&&!n||g.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(x&&b){const y=v.currentTarget,[w,C]=Ab(y);w&&C?!v.shiftKey&&b===C?(v.preventDefault(),r&&pt(w,{select:!0})):v.shiftKey&&b===w&&(v.preventDefault(),r&&pt(C,{select:!0})):b===y&&v.preventDefault()}},[r,n,g.paused]);return l.jsx(ne.div,{tabIndex:-1,...s,ref:m,onKeyDown:h})});nn.displayName=Tb;function Ib(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(pt(n,{select:t}),document.activeElement!==r)return}function Ab(e){const t=qc(e),r=zi(t,e),n=zi(t.reverse(),e);return[r,n]}function qc(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function zi(e,t){for(const r of e)if(!_b(r,{upTo:t}))return r}function _b(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 Ob(e){return e instanceof HTMLInputElement&&"select"in e}function pt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Ob(e)&&t&&e.select()}}var qi=Mb();function Mb(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Hi(e,t),e.unshift(t)},remove(t){var r;e=Hi(e,t),(r=e[0])==null||r.resume()}}}function Hi(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Db(e){return e.filter(t=>t.tagName!=="A")}function $b(e){const t=Lb(e),r=d.forwardRef((n,o)=>{const{children:a,...s}=n,i=d.Children.toArray(a),c=i.find(Vb);if(c){const u=c.props.children,f=i.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return l.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return l.jsx(t,{...s,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Lb(e){const t=d.forwardRef((r,n)=>{const{children:o,...a}=r;if(d.isValidElement(o)){const s=Gb(o),i=Bb(a,o.props);return o.type!==d.Fragment&&(i.ref=n?Ae(n,s):s),d.cloneElement(o,i)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fb=Symbol("radix.slottable");function Vb(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fb}function Bb(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const c=a(...i);return o(...i),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function Gb(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function xo(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Wb=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Qt=new WeakMap,jn=new WeakMap,Pn={},ea=0,Hc=function(e){return e&&(e.host||Hc(e.parentNode))},zb=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Hc(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},qb=function(e,t,r,n){var o=zb(t,Array.isArray(e)?e:[e]);Pn[r]||(Pn[r]=new WeakMap);var a=Pn[r],s=[],i=new Set,c=new Set(o),u=function(p){!p||i.has(p)||(i.add(p),u(p.parentNode))};o.forEach(u);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(i.has(m))f(m);else try{var g=m.getAttribute(n),h=g!==null&&g!=="false",v=(Qt.get(m)||0)+1,x=(a.get(m)||0)+1;Qt.set(m,v),a.set(m,x),s.push(m),v===1&&h&&jn.set(m,!0),x===1&&m.setAttribute(r,"true"),h||m.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",m,b)}})};return f(t),i.clear(),ea++,function(){s.forEach(function(p){var m=Qt.get(p)-1,g=a.get(p)-1;Qt.set(p,m),a.set(p,g),m||(jn.has(p)||p.removeAttribute(n),jn.delete(p)),g||p.removeAttribute(r)}),ea--,ea||(Qt=new WeakMap,Qt=new WeakMap,jn=new WeakMap,Pn={})}},bo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Wb(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),qb(n,o,r,"aria-hidden")):function(){return null}},Je=function(){return Je=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Je.apply(this,arguments)};function Uc(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Hb(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var Mn="right-scroll-bar-position",Dn="width-before-scroll-bar",Ub="with-scroll-bars-hidden",Kb="--removed-body-scroll-bar-size";function ta(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yb(e,t){var r=E.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Xb=typeof window<"u"?d.useLayoutEffect:d.useEffect,Ui=new WeakMap;function Zb(e,t){var r=Yb(null,function(n){return e.forEach(function(o){return ta(o,n)})});return Xb(function(){var n=Ui.get(r);if(n){var o=new Set(n),a=new Set(e),s=r.current;o.forEach(function(i){a.has(i)||ta(i,null)}),a.forEach(function(i){o.has(i)||ta(i,s)})}Ui.set(r,e)},[e]),r}function Jb(e){return e}function Qb(e,t){t===void 0&&(t=Jb);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var s=t(a,n);return r.push(s),function(){r=r.filter(function(i){return i!==s})}},assignSyncMedium:function(a){for(n=!0;r.length;){var s=r;r=[],s.forEach(a)}r={push:function(i){return a(i)},filter:function(){return r}}},assignMedium:function(a){n=!0;var s=[];if(r.length){var i=r;r=[],i.forEach(a),s=r}var c=function(){var f=s;s=[],f.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),r}}}};return o}function ey(e){e===void 0&&(e={});var t=Qb(null);return t.options=Je({async:!0,ssr:!1},e),t}var Kc=function(e){var t=e.sideCar,r=Uc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return d.createElement(n,Je({},r))};Kc.isSideCarExport=!0;function ty(e,t){return e.useMedium(t),Kc}var Yc=ey(),ra=function(){},yo=d.forwardRef(function(e,t){var r=d.useRef(null),n=d.useState({onScrollCapture:ra,onWheelCapture:ra,onTouchMoveCapture:ra}),o=n[0],a=n[1],s=e.forwardProps,i=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,h=e.noIsolation,v=e.inert,x=e.allowPinchZoom,b=e.as,y=b===void 0?"div":b,w=e.gapMode,C=Uc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,j=Zb([r,t]),k=Je(Je({},C),o);return d.createElement(d.Fragment,null,f&&d.createElement(R,{sideCar:Yc,removeScrollBar:u,shards:p,noRelative:g,noIsolation:h,inert:v,setCallbacks:a,allowPinchZoom:!!x,lockRef:r,gapMode:w}),s?d.cloneElement(d.Children.only(i),Je(Je({},k),{ref:j})):d.createElement(y,Je({},k,{className:c,ref:j}),i))});yo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yo.classNames={fullWidth:Dn,zeroRight:Mn};var ry=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ny(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ry();return t&&e.setAttribute("nonce",t),e}function oy(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ay(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sy=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ny())&&(oy(t,r),ay(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},iy=function(){var e=sy();return function(t,r){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Xc=function(){var e=iy(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},ly={left:0,top:0,right:0,gap:0},na=function(e){return parseInt(e||"",10)||0},cy=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[na(r),na(n),na(o)]},uy=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ly;var t=cy(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},dy=Xc(),lr="data-scroll-locked",fy=function(e,t,r,n){var o=e.left,a=e.top,s=e.right,i=e.gap;return r===void 0&&(r="margin"),`
151
151
  .`.concat(Ub,` {
152
152
  overflow: hidden `).concat(n,`;
153
153
  padding-right: `).concat(i,"px ").concat(n,`;