buildgrid-ui 1.1.0-dev.6 → 1.1.0-dev.7

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.
@@ -5789,7 +5789,7 @@ function lf(e) {
5789
5789
  b(!1);
5790
5790
  };
5791
5791
  return /* @__PURE__ */ m.jsxs(Kl, { open: v, children: [
5792
- /* @__PURE__ */ m.jsx(Hl, { asChild: !0, children: /* @__PURE__ */ m.jsx("div", { className: "relative w-fit", children: /* @__PURE__ */ m.jsx(
5792
+ /* @__PURE__ */ m.jsx(Hl, { asChild: !0, children: /* @__PURE__ */ m.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ m.jsx(
5793
5793
  Ur,
5794
5794
  {
5795
5795
  type: "text",
@@ -7402,7 +7402,7 @@ function yf(e) {
7402
7402
  var y;
7403
7403
  l(w.target.value), (y = e.onChange) == null || y.call(e, w);
7404
7404
  };
7405
- return /* @__PURE__ */ m.jsxs("div", { className: "w-fit space-y-4", children: [
7405
+ return /* @__PURE__ */ m.jsxs("div", { className: "w-full space-y-4", children: [
7406
7406
  /* @__PURE__ */ m.jsxs("div", { className: "relative", children: [
7407
7407
  /* @__PURE__ */ m.jsx(
7408
7408
  Sn,
@@ -118,9 +118,9 @@ Check the top-level render call using <`+h+">."),A}var S=H,C=Symbol.for("react.t
118
118
  `)},Co=function(){var e=parseInt(document.body.getAttribute(nt)||"0",10);return isFinite(e)?e:0},$l=function(){c.useEffect(function(){return document.body.setAttribute(nt,(Co()+1).toString()),function(){var e=Co()-1;e<=0?document.body.removeAttribute(nt):document.body.setAttribute(nt,e.toString())}},[])},Wl=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;$l();var s=c.useMemo(function(){return Dl(o)},[o]);return c.createElement(Ll,{styles:Fl(s,!t,o,n?"":"!important")})},Dn=!1;if(typeof window<"u")try{var Ut=Object.defineProperty({},"passive",{get:function(){return Dn=!0,!0}});window.addEventListener("test",Ut,Ut),window.removeEventListener("test",Ut,Ut)}catch{Dn=!1}var rt=Dn?{passive:!1}:!1,zl=function(e){return e.tagName==="TEXTAREA"},Eo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zl(e)&&n[t]==="visible")},Bl=function(e){return Eo(e,"overflowY")},Gl=function(e){return Eo(e,"overflowX")},So=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ro(e,r);if(o){var s=Po(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Vl=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ul=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ro=function(e,t){return e==="v"?Bl(t):Gl(t)},Po=function(e,t){return e==="v"?Vl(t):Ul(t)},Kl=function(e,t){return e==="h"&&t==="rtl"?-1:1},Hl=function(e,t,n,r,o){var s=Kl(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,u=t.contains(a),l=!1,f=i>0,d=0,p=0;do{var v=Po(e,a),b=v[0],g=v[1],y=v[2],w=g-y-s*b;(b||w)&&Ro(e,a)&&(d+=w,p+=b),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(f&&(Math.abs(d)<1||!o)||!f&&(Math.abs(p)<1||!o))&&(l=!0),l},Kt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ao=function(e){return[e.deltaX,e.deltaY]},Mo=function(e){return e&&"current"in e?e.current:e},Yl=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Xl=function(e){return`
119
119
  .block-interactivity-`.concat(e,` {pointer-events: none;}
120
120
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
121
- `)},ql=0,ot=[];function Zl(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(ql++)[0],s=c.useState(xo)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=bl([e.lockRef.current],(e.shards||[]).map(Mo),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var w=Kt(g),x=n.current,S="deltaX"in g?g.deltaX:x[0]-w[0],C="deltaY"in g?g.deltaY:x[1]-w[1],E,N=g.target,P=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in g&&P==="h"&&N.type==="range")return!1;var _=So(P,N);if(!_)return!0;if(_?E=P:(E=P==="v"?"h":"v",_=So(P,N)),!_)return!1;if(!r.current&&"changedTouches"in g&&(S||C)&&(r.current=E),!E)return!0;var W=r.current||E;return Hl(W,y,g,W==="h"?S:C,!0)},[]),u=c.useCallback(function(g){var y=g;if(!(!ot.length||ot[ot.length-1]!==s)){var w="deltaY"in y?Ao(y):Kt(y),x=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&Yl(E.delta,w)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var S=(i.current.shards||[]).map(Mo).filter(Boolean).filter(function(E){return E.contains(y.target)}),C=S.length>0?a(y,S[0]):!i.current.noIsolation;C&&y.cancelable&&y.preventDefault()}}},[]),l=c.useCallback(function(g,y,w,x){var S={name:g,delta:y,target:w,should:x,shadowParent:Jl(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),f=c.useCallback(function(g){n.current=Kt(g),r.current=void 0},[]),d=c.useCallback(function(g){l(g.type,Ao(g),g.target,a(g,e.lockRef.current))},[]),p=c.useCallback(function(g){l(g.type,Kt(g),g.target,a(g,e.lockRef.current))},[]);c.useEffect(function(){return ot.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",u,rt),document.addEventListener("touchmove",u,rt),document.addEventListener("touchstart",f,rt),function(){ot=ot.filter(function(g){return g!==s}),document.removeEventListener("wheel",u,rt),document.removeEventListener("touchmove",u,rt),document.removeEventListener("touchstart",f,rt)}},[]);var v=e.removeScrollBar,b=e.inert;return c.createElement(c.Fragment,null,b?c.createElement(s,{styles:Xl(o)}):null,v?c.createElement(Wl,{gapMode:e.gapMode}):null)}function Jl(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ql=Al(yo,Zl);var Ln=c.forwardRef(function(e,t){return c.createElement(Vt,ve({},e,{ref:t,sideCar:Ql}))});Ln.classNames=Vt.classNames;var Fn="Popover",[No,pf]=pe(Fn,[Ft]),gt=Ft(),[eu,Te]=No(Fn),ko=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=gt(t),u=c.useRef(null),[l,f]=c.useState(!1),[d=!1,p]=et({prop:r,defaultProp:o,onChange:s});return m.jsx(Nn,{...a,children:m.jsx(eu,{scope:t,contentId:Xe(),triggerRef:u,open:d,onOpenChange:p,onOpenToggle:c.useCallback(()=>p(v=>!v),[p]),hasCustomAnchor:l,onCustomAnchorAdd:c.useCallback(()=>f(!0),[]),onCustomAnchorRemove:c.useCallback(()=>f(!1),[]),modal:i,children:n})})};ko.displayName=Fn;var _o="PopoverAnchor",Oo=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Te(_o,n),s=gt(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return c.useEffect(()=>(i(),()=>a()),[i,a]),m.jsx(kn,{...s,...r,ref:t})});Oo.displayName=_o;var To="PopoverTrigger",Io=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Te(To,n),s=gt(n),i=Q(t,o.triggerRef),a=m.jsx(Y.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":$o(o.open),...r,ref:i,onClick:I(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:m.jsx(kn,{asChild:!0,...s,children:a})});Io.displayName=To;var $n="PopoverPortal",[tu,nu]=No($n,{forceMount:void 0}),jo=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Te($n,t);return m.jsx(tu,{scope:t,forceMount:n,children:m.jsx(Oe,{present:n||s.open,children:m.jsx(_n,{asChild:!0,container:o,children:r})})})};jo.displayName=$n;var st="PopoverContent",Do=c.forwardRef((e,t)=>{const n=nu(st,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Te(st,e.__scopePopover);return m.jsx(Oe,{present:r||s.open,children:s.modal?m.jsx(ru,{...o,ref:t}):m.jsx(ou,{...o,ref:t})})});Do.displayName=st;var ru=c.forwardRef((e,t)=>{const n=Te(st,e.__scopePopover),r=c.useRef(null),o=Q(t,r),s=c.useRef(!1);return c.useEffect(()=>{const i=r.current;if(i)return go(i)},[]),m.jsx(Ln,{as:We,allowPinchZoom:!0,children:m.jsx(Lo,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:I(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:I(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,l=a.button===2||u;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:I(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),ou=c.forwardRef((e,t)=>{const n=Te(st,e.__scopePopover),r=c.useRef(!1),o=c.useRef(!1);return m.jsx(Lo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var u,l;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Lo=c.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:f,...d}=e,p=Te(st,n),v=gt(n);return Or(),m.jsx(pn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:m.jsx(ln,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),children:m.jsx(po,{"data-state":$o(p.open),role:"dialog",id:p.contentId,...v,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Fo="PopoverClose",su=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Te(Fo,n);return m.jsx(Y.button,{type:"button",...r,ref:t,onClick:I(e.onClick,()=>o.onOpenChange(!1))})});su.displayName=Fo;var au="PopoverArrow",iu=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=gt(n);return m.jsx(mo,{...o,...r,ref:t})});iu.displayName=au;function $o(e){return e?"open":"closed"}var cu=ko,lu=Oo,uu=Io,du=jo,Wo=Do;const zo=cu,Bo=uu,fu=lu,Wn=c.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>m.jsx(du,{children:m.jsx(Wo,{ref:o,align:t,sideOffset:n,className:B("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Wn.displayName=Wo.displayName;function pu(e){const{value:t="",onChange:n,options:r,className:o,placeholder:s="Search...",emptyMessage:i="Nothing found"}=e,[a,u]=H.useState(t),[l,f]=H.useState(r),[d,p]=H.useState(-1),[v,b]=H.useState(!1),g=C=>{const E=C.target.value;u(E),n==null||n(E),p(-1),b(!0),E.trim()===""?f(r):f(r.filter(N=>N.label.toLowerCase().includes(E.toLowerCase())))},y=C=>{if(C.key==="ArrowDown")C.preventDefault(),p(E=>E<l.length-1?E+1:E);else if(C.key==="ArrowUp")C.preventDefault(),p(E=>E>0?E-1:-1);else if(C.key==="Enter"&&d>=0){const E=l[d];u(E.label),n==null||n(E.value),f([]),p(-1),b(!1)}else C.key==="Escape"&&(f([]),p(-1))},w=C=>{b(!1),u(C.label),n==null||n(C.value),f(r),p(-1)},x=()=>{b(!0)},S=()=>{b(!1)};return m.jsxs(zo,{open:v,children:[m.jsx(Bo,{asChild:!0,children:m.jsx("div",{className:"relative w-fit",children:m.jsx(sn,{type:"text",placeholder:s,value:a,onChange:g,onKeyDown:y,onClick:x,onFocus:x,onBlur:S,className:B("pr-10",o),"aria-label":"Search field","aria-autocomplete":"list","aria-controls":"suggestions-list","aria-expanded":l.length>0,leftIcon:m.jsx(ji,{className:"w-4 h-4"})})})}),m.jsx(Wn,{className:"p-0 w-[var(--radix-popover-trigger-width)] max-h-96 overflow-y-auto",children:l.length>0?m.jsx("ul",{id:"suggestions-list",role:"listbox",children:l.map((C,E)=>m.jsx("li",{className:`px-4 py-2 cursor-pointer hover:bg-muted ${E===d?"bg-muted":""}`,onClick:()=>w(C),role:"option","aria-selected":E===d,children:C.label},C.value))}):m.jsx("span",{className:"px-4 py-2 block",children:i})})]})}var zn="Avatar",[mu,mf]=pe(zn),[hu,Go]=mu(zn),Vo=c.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,s]=c.useState("idle");return m.jsx(hu,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:m.jsx(Y.span,{...r,ref:t})})});Vo.displayName=zn;var Uo="AvatarImage",Ko=c.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...s}=e,i=Go(Uo,n),a=gu(r,s.referrerPolicy),u=oe(l=>{o(l),i.onImageLoadingStatusChange(l)});return ye(()=>{a!=="idle"&&u(a)},[a,u]),a==="loaded"?m.jsx(Y.img,{...s,ref:t,src:r}):null});Ko.displayName=Uo;var Ho="AvatarFallback",Yo=c.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,s=Go(Ho,n),[i,a]=c.useState(r===void 0);return c.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(u)}},[r]),i&&s.imageLoadingStatus!=="loaded"?m.jsx(Y.span,{...o,ref:t}):null});Yo.displayName=Ho;function gu(e,t){const[n,r]=c.useState("idle");return ye(()=>{if(!e){r("error");return}let o=!0;const s=new window.Image,i=a=>()=>{o&&r(a)};return r("loading"),s.onload=i("loaded"),s.onerror=i("error"),s.src=e,t&&(s.referrerPolicy=t),()=>{o=!1}},[e,t]),n}var Xo=Vo,qo=Ko,Zo=Yo;const Jo=c.forwardRef(({className:e,...t},n)=>m.jsx(Xo,{ref:n,className:B("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Jo.displayName=Xo.displayName;const Qo=c.forwardRef(({className:e,...t},n)=>m.jsx(qo,{ref:n,className:B("aspect-square h-full w-full",e),...t}));Qo.displayName=qo.displayName;const es=c.forwardRef(({className:e,...t},n)=>m.jsx(Zo,{ref:n,className:B("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));es.displayName=Zo.displayName;const ts=on("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function vu({className:e,variant:t,...n}){return m.jsx("div",{className:B(ts({variant:t}),e),...n})}const ns=on("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",xl:"h-12 rounded-md px-10 text-xl",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Bn=c.forwardRef(({className:e,variant:t,size:n,isLoading:r=!1,asChild:o=!1,...s},i)=>{const a=o?We:"button";return m.jsxs(a,{className:B(ns({variant:t,size:n,className:e})),ref:i,...s,disabled:r||s.disabled,children:[r&&m.jsxs("svg",{className:"animate-spin -ml-1 h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[m.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),m.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),s.children]})});Bn.displayName="Button";const rs=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("rounded-xl border bg-card text-card-foreground shadow",e),...t}));rs.displayName="Card";const os=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("flex flex-col space-y-1.5 p-6",e),...t}));os.displayName="CardHeader";const ss=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("font-semibold leading-none tracking-tight pb-4",e),...t}));ss.displayName="CardTitle";const as=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("text-sm text-muted-foreground",e),...t}));as.displayName="CardDescription";const is=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("p-6 py-0",e),...t}));is.displayName="CardContent";const cs=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("flex items-center p-6 pt-6",e),...t}));cs.displayName="CardFooter";function ls(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Gn="Checkbox",[bu,hf]=pe(Gn),[wu,yu]=bu(Gn),us=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:l,form:f,...d}=e,[p,v]=c.useState(null),b=Q(t,C=>v(C)),g=c.useRef(!1),y=p?f||!!p.closest("form"):!0,[w=!1,x]=et({prop:o,defaultProp:s,onChange:l}),S=c.useRef(w);return c.useEffect(()=>{const C=p==null?void 0:p.form;if(C){const E=()=>x(S.current);return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[p,x]),m.jsxs(wu,{scope:n,state:w,disabled:a,children:[m.jsx(Y.button,{type:"button",role:"checkbox","aria-checked":Ie(w)?"mixed":w,"aria-required":i,"data-state":ps(w),"data-disabled":a?"":void 0,disabled:a,value:u,...d,ref:b,onKeyDown:I(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:I(e.onClick,C=>{x(E=>Ie(E)?!0:!E),y&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})}),y&&m.jsx(xu,{control:p,bubbles:!g.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Ie(s)?!1:s})]})});us.displayName=Gn;var ds="CheckboxIndicator",fs=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=yu(ds,n);return m.jsx(Oe,{present:r||Ie(s.state)||s.state===!0,children:m.jsx(Y.span,{"data-state":ps(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});fs.displayName=ds;var xu=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=c.useRef(null),a=ls(n),u=Pn(t);c.useEffect(()=>{const f=i.current,d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&v){const b=new Event("click",{bubbles:r});f.indeterminate=Ie(n),v.call(f,Ie(n)?!1:n),f.dispatchEvent(b)}},[a,n,r]);const l=c.useRef(Ie(n)?!1:n);return m.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??l.current,...s,tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ie(e){return e==="indeterminate"}function ps(e){return Ie(e)?"indeterminate":e?"checked":"unchecked"}var ms=us,Cu=fs;const hs=c.forwardRef(({className:e,...t},n)=>m.jsx(ms,{ref:n,className:B("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:m.jsx(Cu,{className:B("flex items-center justify-center text-current"),children:m.jsx(Rr,{className:"h-4 w-4"})})}));hs.displayName=ms.displayName;function gs(e){const t=e+"CollectionProvider",[n,r]=pe(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:b,children:g}=v,y=H.useRef(null),w=H.useRef(new Map).current;return m.jsx(o,{scope:b,itemMap:w,collectionRef:y,children:g})};i.displayName=t;const a=e+"CollectionSlot",u=H.forwardRef((v,b)=>{const{scope:g,children:y}=v,w=s(a,g),x=Q(b,w.collectionRef);return m.jsx(We,{ref:x,children:y})});u.displayName=a;const l=e+"CollectionItemSlot",f="data-radix-collection-item",d=H.forwardRef((v,b)=>{const{scope:g,children:y,...w}=v,x=H.useRef(null),S=Q(b,x),C=s(l,g);return H.useEffect(()=>(C.itemMap.set(x,{ref:x,...w}),()=>void C.itemMap.delete(x))),m.jsx(We,{[f]:"",ref:S,children:y})});d.displayName=l;function p(v){const b=s(e+"CollectionConsumer",v);return H.useCallback(()=>{const y=b.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((C,E)=>w.indexOf(C.ref.current)-w.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:u,ItemSlot:d},p,r]}var Eu=c.createContext(void 0);function vs(e){const t=c.useContext(Eu);return e||t||"ltr"}var Vn="rovingFocusGroup.onEntryFocus",Su={bubbles:!1,cancelable:!0},Ht="RovingFocusGroup",[Un,bs,Ru]=gs(Ht),[Pu,ws]=pe(Ht,[Ru]),[Au,Mu]=Pu(Ht),ys=c.forwardRef((e,t)=>m.jsx(Un.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(Un.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(Nu,{...e,ref:t})})}));ys.displayName=Ht;var Nu=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...d}=e,p=c.useRef(null),v=Q(t,p),b=vs(s),[g=null,y]=et({prop:i,defaultProp:a,onChange:u}),[w,x]=c.useState(!1),S=oe(l),C=bs(n),E=c.useRef(!1),[N,P]=c.useState(0);return c.useEffect(()=>{const _=p.current;if(_)return _.addEventListener(Vn,S),()=>_.removeEventListener(Vn,S)},[S]),m.jsx(Au,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:g,onItemFocus:c.useCallback(_=>y(_),[y]),onItemShiftTab:c.useCallback(()=>x(!0),[]),onFocusableItemAdd:c.useCallback(()=>P(_=>_+1),[]),onFocusableItemRemove:c.useCallback(()=>P(_=>_-1),[]),children:m.jsx(Y.div,{tabIndex:w||N===0?-1:0,"data-orientation":r,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:I(e.onMouseDown,()=>{E.current=!0}),onFocus:I(e.onFocus,_=>{const W=!E.current;if(_.target===_.currentTarget&&W&&!w){const L=new CustomEvent(Vn,Su);if(_.currentTarget.dispatchEvent(L),!L.defaultPrevented){const U=C().filter(F=>F.focusable),k=U.find(F=>F.active),G=U.find(F=>F.id===g),Z=[k,G,...U].filter(Boolean).map(F=>F.ref.current);Es(Z,f)}}E.current=!1}),onBlur:I(e.onBlur,()=>x(!1))})})}),xs="RovingFocusGroupItem",Cs=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Xe(),u=s||a,l=Mu(xs,n),f=l.currentTabStopId===u,d=bs(n),{onFocusableItemAdd:p,onFocusableItemRemove:v}=l;return c.useEffect(()=>{if(r)return p(),()=>v()},[r,p,v]),m.jsx(Un.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:m.jsx(Y.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...i,ref:t,onMouseDown:I(e.onMouseDown,b=>{r?l.onItemFocus(u):b.preventDefault()}),onFocus:I(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:I(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){l.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=Ou(b,l.orientation,l.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=d().filter(x=>x.focusable).map(x=>x.ref.current);if(g==="last")w.reverse();else if(g==="prev"||g==="next"){g==="prev"&&w.reverse();const x=w.indexOf(b.currentTarget);w=l.loop?Tu(w,x+1):w.slice(x+1)}setTimeout(()=>Es(w))}})})})});Cs.displayName=xs;var ku={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _u(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ou(e,t,n){const r=_u(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ku[r]}function Es(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Tu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Iu=ys,ju=Cs,Kn=["Enter"," "],Du=["ArrowDown","PageUp","Home"],Ss=["ArrowUp","PageDown","End"],Lu=[...Du,...Ss],Fu={ltr:[...Kn,"ArrowRight"],rtl:[...Kn,"ArrowLeft"]},$u={ltr:["ArrowLeft"],rtl:["ArrowRight"]},vt="Menu",[bt,Wu,zu]=gs(vt),[Be,Rs]=pe(vt,[zu,Ft,ws]),wt=Ft(),Ps=ws(),[As,je]=Be(vt),[Bu,yt]=Be(vt),Ms=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=wt(t),[u,l]=c.useState(null),f=c.useRef(!1),d=oe(s),p=vs(o);return c.useEffect(()=>{const v=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),m.jsx(Nn,{...a,children:m.jsx(As,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:l,children:m.jsx(Bu,{scope:t,onClose:c.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:p,modal:i,children:r})})})};Ms.displayName=vt;var Gu="MenuAnchor",Hn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=wt(n);return m.jsx(kn,{...o,...r,ref:t})});Hn.displayName=Gu;var Yn="MenuPortal",[Vu,Ns]=Be(Yn,{forceMount:void 0}),ks=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=je(Yn,t);return m.jsx(Vu,{scope:t,forceMount:n,children:m.jsx(Oe,{present:n||s.open,children:m.jsx(_n,{asChild:!0,container:o,children:r})})})};ks.displayName=Yn;var ie="MenuContent",[Uu,Xn]=Be(ie),_s=c.forwardRef((e,t)=>{const n=Ns(ie,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=je(ie,e.__scopeMenu),i=yt(ie,e.__scopeMenu);return m.jsx(bt.Provider,{scope:e.__scopeMenu,children:m.jsx(Oe,{present:r||s.open,children:m.jsx(bt.Slot,{scope:e.__scopeMenu,children:i.modal?m.jsx(Ku,{...o,ref:t}):m.jsx(Hu,{...o,ref:t})})})})}),Ku=c.forwardRef((e,t)=>{const n=je(ie,e.__scopeMenu),r=c.useRef(null),o=Q(t,r);return c.useEffect(()=>{const s=r.current;if(s)return go(s)},[]),m.jsx(qn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:I(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Hu=c.forwardRef((e,t)=>{const n=je(ie,e.__scopeMenu);return m.jsx(qn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),qn=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:v,disableOutsideScroll:b,...g}=e,y=je(ie,n),w=yt(ie,n),x=wt(n),S=Ps(n),C=Wu(n),[E,N]=c.useState(null),P=c.useRef(null),_=Q(t,P,y.onContentChange),W=c.useRef(0),L=c.useRef(""),U=c.useRef(0),k=c.useRef(null),G=c.useRef("right"),$=c.useRef(0),Z=b?Ln:c.Fragment,F=b?{as:We,allowPinchZoom:!0}:void 0,X=R=>{var le,De;const K=L.current+R,z=C().filter(ne=>!ne.disabled),ce=document.activeElement,Ee=(le=z.find(ne=>ne.ref.current===ce))==null?void 0:le.textValue,fe=z.map(ne=>ne.textValue),Ge=sd(fe,K,Ee),be=(De=z.find(ne=>ne.textValue===Ge))==null?void 0:De.ref.current;(function ne(Le){L.current=Le,window.clearTimeout(W.current),Le!==""&&(W.current=window.setTimeout(()=>ne(""),1e3))})(K),be&&setTimeout(()=>be.focus())};c.useEffect(()=>()=>window.clearTimeout(W.current),[]),Or();const T=c.useCallback(R=>{var z,ce;return G.current===((z=k.current)==null?void 0:z.side)&&id(R,(ce=k.current)==null?void 0:ce.area)},[]);return m.jsx(Uu,{scope:n,searchRef:L,onItemEnter:c.useCallback(R=>{T(R)&&R.preventDefault()},[T]),onItemLeave:c.useCallback(R=>{var K;T(R)||((K=P.current)==null||K.focus(),N(null))},[T]),onTriggerLeave:c.useCallback(R=>{T(R)&&R.preventDefault()},[T]),pointerGraceTimerRef:U,onPointerGraceIntentChange:c.useCallback(R=>{k.current=R},[]),children:m.jsx(Z,{...F,children:m.jsx(pn,{asChild:!0,trapped:o,onMountAutoFocus:I(s,R=>{var K;R.preventDefault(),(K=P.current)==null||K.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:m.jsx(ln,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:v,children:m.jsx(Iu,{asChild:!0,...S,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:N,onEntryFocus:I(u,R=>{w.isUsingKeyboardRef.current||R.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(po,{role:"menu","aria-orientation":"vertical","data-state":Xs(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...g,ref:_,style:{outline:"none",...g.style},onKeyDown:I(g.onKeyDown,R=>{const z=R.target.closest("[data-radix-menu-content]")===R.currentTarget,ce=R.ctrlKey||R.altKey||R.metaKey,Ee=R.key.length===1;z&&(R.key==="Tab"&&R.preventDefault(),!ce&&Ee&&X(R.key));const fe=P.current;if(R.target!==fe||!Lu.includes(R.key))return;R.preventDefault();const be=C().filter(le=>!le.disabled).map(le=>le.ref.current);Ss.includes(R.key)&&be.reverse(),rd(be)}),onBlur:I(e.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(W.current),L.current="")}),onPointerMove:I(e.onPointerMove,Ct(R=>{const K=R.target,z=$.current!==R.clientX;if(R.currentTarget.contains(K)&&z){const ce=R.clientX>$.current?"right":"left";G.current=ce,$.current=R.clientX}}))})})})})})})});_s.displayName=ie;var Yu="MenuGroup",Zn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Y.div,{role:"group",...r,ref:t})});Zn.displayName=Yu;var Xu="MenuLabel",Os=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Y.div,{...r,ref:t})});Os.displayName=Xu;var Yt="MenuItem",Ts="menu.itemSelect",Xt=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=c.useRef(null),i=yt(Yt,e.__scopeMenu),a=Xn(Yt,e.__scopeMenu),u=Q(t,s),l=c.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const p=new CustomEvent(Ts,{bubbles:!0,cancelable:!0});d.addEventListener(Ts,v=>r==null?void 0:r(v),{once:!0}),Ar(d,p),p.defaultPrevented?l.current=!1:i.onClose()}};return m.jsx(Is,{...o,ref:u,disabled:n,onClick:I(e.onClick,f),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),l.current=!0},onPointerUp:I(e.onPointerUp,d=>{var p;l.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:I(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||Kn.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Xt.displayName=Yt;var Is=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Xn(Yt,n),a=Ps(n),u=c.useRef(null),l=Q(t,u),[f,d]=c.useState(!1),[p,v]=c.useState("");return c.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[s.children]),m.jsx(bt.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:m.jsx(ju,{asChild:!0,...a,focusable:!r,children:m.jsx(Y.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:I(e.onPointerMove,Ct(b=>{r?i.onItemLeave(b):(i.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:I(e.onPointerLeave,Ct(b=>i.onItemLeave(b))),onFocus:I(e.onFocus,()=>d(!0)),onBlur:I(e.onBlur,()=>d(!1))})})})}),qu="MenuCheckboxItem",js=c.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.jsx(Ws,{scope:e.__scopeMenu,checked:n,children:m.jsx(Xt,{role:"menuitemcheckbox","aria-checked":qt(n)?"mixed":n,...o,ref:t,"data-state":er(n),onSelect:I(o.onSelect,()=>r==null?void 0:r(qt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});js.displayName=qu;var Ds="MenuRadioGroup",[Zu,Ju]=Be(Ds,{value:void 0,onValueChange:()=>{}}),Ls=c.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=oe(r);return m.jsx(Zu,{scope:e.__scopeMenu,value:n,onValueChange:s,children:m.jsx(Zn,{...o,ref:t})})});Ls.displayName=Ds;var Fs="MenuRadioItem",$s=c.forwardRef((e,t)=>{const{value:n,...r}=e,o=Ju(Fs,e.__scopeMenu),s=n===o.value;return m.jsx(Ws,{scope:e.__scopeMenu,checked:s,children:m.jsx(Xt,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":er(s),onSelect:I(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});$s.displayName=Fs;var Jn="MenuItemIndicator",[Ws,Qu]=Be(Jn,{checked:!1}),zs=c.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Qu(Jn,n);return m.jsx(Oe,{present:r||qt(s.checked)||s.checked===!0,children:m.jsx(Y.span,{...o,ref:t,"data-state":er(s.checked)})})});zs.displayName=Jn;var ed="MenuSeparator",Bs=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Y.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Bs.displayName=ed;var td="MenuArrow",Gs=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=wt(n);return m.jsx(mo,{...o,...r,ref:t})});Gs.displayName=td;var Qn="MenuSub",[nd,Vs]=Be(Qn),Us=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=je(Qn,t),i=wt(t),[a,u]=c.useState(null),[l,f]=c.useState(null),d=oe(o);return c.useEffect(()=>(s.open===!1&&d(!1),()=>d(!1)),[s.open,d]),m.jsx(Nn,{...i,children:m.jsx(As,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:f,children:m.jsx(nd,{scope:t,contentId:Xe(),triggerId:Xe(),trigger:a,onTriggerChange:u,children:n})})})};Us.displayName=Qn;var xt="MenuSubTrigger",Ks=c.forwardRef((e,t)=>{const n=je(xt,e.__scopeMenu),r=yt(xt,e.__scopeMenu),o=Vs(xt,e.__scopeMenu),s=Xn(xt,e.__scopeMenu),i=c.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=s,l={__scopeMenu:e.__scopeMenu},f=c.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return c.useEffect(()=>f,[f]),c.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),u(null)}},[a,u]),m.jsx(Hn,{asChild:!0,...l,children:m.jsx(Is,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Xs(n.open),...e,ref:Mt(t,o.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:I(e.onPointerMove,Ct(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:I(e.onPointerLeave,Ct(d=>{var v,b;f();const p=(v=n.content)==null?void 0:v.getBoundingClientRect();if(p){const g=(b=n.content)==null?void 0:b.dataset.side,y=g==="right",w=y?-5:5,x=p[y?"left":"right"],S=p[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+w,y:d.clientY},{x,y:p.top},{x:S,y:p.top},{x:S,y:p.bottom},{x,y:p.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:I(e.onKeyDown,d=>{var v;const p=s.searchRef.current!=="";e.disabled||p&&d.key===" "||Fu[r.dir].includes(d.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),d.preventDefault())})})})});Ks.displayName=xt;var Hs="MenuSubContent",Ys=c.forwardRef((e,t)=>{const n=Ns(ie,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=je(ie,e.__scopeMenu),i=yt(ie,e.__scopeMenu),a=Vs(Hs,e.__scopeMenu),u=c.useRef(null),l=Q(t,u);return m.jsx(bt.Provider,{scope:e.__scopeMenu,children:m.jsx(Oe,{present:r||s.open,children:m.jsx(bt.Slot,{scope:e.__scopeMenu,children:m.jsx(qn,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var d;i.isUsingKeyboardRef.current&&((d=u.current)==null||d.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:I(e.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:I(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:I(e.onKeyDown,f=>{var v;const d=f.currentTarget.contains(f.target),p=$u[i.dir].includes(f.key);d&&p&&(s.onOpenChange(!1),(v=a.trigger)==null||v.focus(),f.preventDefault())})})})})})});Ys.displayName=Hs;function Xs(e){return e?"open":"closed"}function qt(e){return e==="indeterminate"}function er(e){return qt(e)?"indeterminate":e?"checked":"unchecked"}function rd(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function od(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function sd(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=od(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const u=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function ad(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,u=t[s].y,l=t[i].x,f=t[i].y;u>r!=f>r&&n<(l-a)*(r-u)/(f-u)+a&&(o=!o)}return o}function id(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ad(n,t)}function Ct(e){return t=>t.pointerType==="mouse"?e(t):void 0}var cd=Ms,ld=Hn,ud=ks,dd=_s,fd=Zn,pd=Os,md=Xt,hd=js,gd=Ls,vd=$s,bd=zs,wd=Bs,yd=Gs,xd=Us,Cd=Ks,Ed=Ys,tr="DropdownMenu",[Sd,gf]=pe(tr,[Rs]),ee=Rs(),[Rd,qs]=Sd(tr),Zs=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,u=ee(t),l=c.useRef(null),[f=!1,d]=et({prop:o,defaultProp:s,onChange:i});return m.jsx(Rd,{scope:t,triggerId:Xe(),triggerRef:l,contentId:Xe(),open:f,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(p=>!p),[d]),modal:a,children:m.jsx(cd,{...u,open:f,onOpenChange:d,dir:r,modal:a,children:n})})};Zs.displayName=tr;var Js="DropdownMenuTrigger",Qs=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=qs(Js,n),i=ee(n);return m.jsx(ld,{asChild:!0,...i,children:m.jsx(Y.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Mt(t,s.triggerRef),onPointerDown:I(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:I(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Qs.displayName=Js;var Pd="DropdownMenuPortal",ea=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ee(t);return m.jsx(ud,{...r,...n})};ea.displayName=Pd;var ta="DropdownMenuContent",na=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qs(ta,n),s=ee(n),i=c.useRef(!1);return m.jsx(dd,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:I(e.onCloseAutoFocus,a=>{var u;i.current||(u=o.triggerRef.current)==null||u.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:I(e.onInteractOutside,a=>{const u=a.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,f=u.button===2||l;(!o.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});na.displayName=ta;var Ad="DropdownMenuGroup",ra=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(fd,{...o,...r,ref:t})});ra.displayName=Ad;var Md="DropdownMenuLabel",oa=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(pd,{...o,...r,ref:t})});oa.displayName=Md;var Nd="DropdownMenuItem",sa=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(md,{...o,...r,ref:t})});sa.displayName=Nd;var kd="DropdownMenuCheckboxItem",aa=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(hd,{...o,...r,ref:t})});aa.displayName=kd;var _d="DropdownMenuRadioGroup",ia=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(gd,{...o,...r,ref:t})});ia.displayName=_d;var Od="DropdownMenuRadioItem",ca=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(vd,{...o,...r,ref:t})});ca.displayName=Od;var Td="DropdownMenuItemIndicator",la=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(bd,{...o,...r,ref:t})});la.displayName=Td;var Id="DropdownMenuSeparator",ua=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(wd,{...o,...r,ref:t})});ua.displayName=Id;var jd="DropdownMenuArrow",Dd=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(yd,{...o,...r,ref:t})});Dd.displayName=jd;var Ld=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=ee(t),[a=!1,u]=et({prop:r,defaultProp:s,onChange:o});return m.jsx(xd,{...i,open:a,onOpenChange:u,children:n})},Fd="DropdownMenuSubTrigger",da=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(Cd,{...o,...r,ref:t})});da.displayName=Fd;var $d="DropdownMenuSubContent",fa=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(Ed,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fa.displayName=$d;var Wd=Zs,zd=Qs,pa=ea,ma=na,Bd=ra,ha=oa,ga=sa,va=aa,Gd=ia,ba=ca,wa=la,ya=ua,Vd=Ld,xa=da,Ca=fa;const Ud=Wd,Kd=zd,Hd=Bd,Yd=pa,Xd=Vd,qd=Gd,Ea=c.forwardRef(({className:e,inset:t,children:n,...r},o)=>m.jsxs(xa,{ref:o,className:B("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,m.jsx(_i,{className:"ml-auto"})]}));Ea.displayName=xa.displayName;const Sa=c.forwardRef(({className:e,...t},n)=>m.jsx(Ca,{ref:n,className:B("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Sa.displayName=Ca.displayName;const Ra=c.forwardRef(({className:e,sideOffset:t=4,...n},r)=>m.jsx(pa,{children:m.jsx(ma,{ref:r,sideOffset:t,className:B("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ra.displayName=ma.displayName;const Pa=c.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(ga,{ref:r,className:B("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));Pa.displayName=ga.displayName;const Aa=c.forwardRef(({className:e,children:t,checked:n,...r},o)=>m.jsxs(va,{ref:o,className:B("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(wa,{children:m.jsx(Rr,{className:"h-4 w-4"})})}),t]}));Aa.displayName=va.displayName;const Ma=c.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(ba,{ref:r,className:B("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(wa,{children:m.jsx(Oi,{className:"h-2 w-2 fill-current"})})}),t]}));Ma.displayName=ba.displayName;const Na=c.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(ha,{ref:r,className:B("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Na.displayName=ha.displayName;const ka=c.forwardRef(({className:e,...t},n)=>m.jsx(ya,{ref:n,className:B("-mx-1 my-1 h-px bg-muted",e),...t}));ka.displayName=ya.displayName;const _a=({className:e,...t})=>m.jsx("span",{className:B("ml-auto text-xs tracking-widest opacity-60",e),...t});_a.displayName="DropdownMenuShortcut";var nr="Progress",rr=100,[Zd,vf]=pe(nr),[Jd,Qd]=Zd(nr),Oa=c.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:s=ef,...i}=e;(o||o===0)&&!Da(o)&&console.error(tf(`${o}`,"Progress"));const a=Da(o)?o:rr;r!==null&&!La(r,a)&&console.error(nf(`${r}`,"Progress"));const u=La(r,a)?r:null,l=Zt(u)?s(u,a):void 0;return m.jsx(Jd,{scope:n,value:u,max:a,children:m.jsx(Y.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Zt(u)?u:void 0,"aria-valuetext":l,role:"progressbar","data-state":ja(u,a),"data-value":u??void 0,"data-max":a,...i,ref:t})})});Oa.displayName=nr;var Ta="ProgressIndicator",Ia=c.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=Qd(Ta,n);return m.jsx(Y.div,{"data-state":ja(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});Ia.displayName=Ta;function ef(e,t){return`${Math.round(e/t*100)}%`}function ja(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Zt(e){return typeof e=="number"}function Da(e){return Zt(e)&&!isNaN(e)&&e>0}function La(e,t){return Zt(e)&&!isNaN(e)&&e<=t&&e>=0}function tf(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${rr}\`.`}function nf(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
121
+ `)},ql=0,ot=[];function Zl(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(ql++)[0],s=c.useState(xo)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=bl([e.lockRef.current],(e.shards||[]).map(Mo),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var w=Kt(g),x=n.current,S="deltaX"in g?g.deltaX:x[0]-w[0],C="deltaY"in g?g.deltaY:x[1]-w[1],E,N=g.target,P=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in g&&P==="h"&&N.type==="range")return!1;var _=So(P,N);if(!_)return!0;if(_?E=P:(E=P==="v"?"h":"v",_=So(P,N)),!_)return!1;if(!r.current&&"changedTouches"in g&&(S||C)&&(r.current=E),!E)return!0;var W=r.current||E;return Hl(W,y,g,W==="h"?S:C,!0)},[]),u=c.useCallback(function(g){var y=g;if(!(!ot.length||ot[ot.length-1]!==s)){var w="deltaY"in y?Ao(y):Kt(y),x=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&Yl(E.delta,w)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var S=(i.current.shards||[]).map(Mo).filter(Boolean).filter(function(E){return E.contains(y.target)}),C=S.length>0?a(y,S[0]):!i.current.noIsolation;C&&y.cancelable&&y.preventDefault()}}},[]),l=c.useCallback(function(g,y,w,x){var S={name:g,delta:y,target:w,should:x,shadowParent:Jl(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),f=c.useCallback(function(g){n.current=Kt(g),r.current=void 0},[]),d=c.useCallback(function(g){l(g.type,Ao(g),g.target,a(g,e.lockRef.current))},[]),p=c.useCallback(function(g){l(g.type,Kt(g),g.target,a(g,e.lockRef.current))},[]);c.useEffect(function(){return ot.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",u,rt),document.addEventListener("touchmove",u,rt),document.addEventListener("touchstart",f,rt),function(){ot=ot.filter(function(g){return g!==s}),document.removeEventListener("wheel",u,rt),document.removeEventListener("touchmove",u,rt),document.removeEventListener("touchstart",f,rt)}},[]);var v=e.removeScrollBar,b=e.inert;return c.createElement(c.Fragment,null,b?c.createElement(s,{styles:Xl(o)}):null,v?c.createElement(Wl,{gapMode:e.gapMode}):null)}function Jl(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ql=Al(yo,Zl);var Ln=c.forwardRef(function(e,t){return c.createElement(Vt,ve({},e,{ref:t,sideCar:Ql}))});Ln.classNames=Vt.classNames;var Fn="Popover",[No,pf]=pe(Fn,[Ft]),gt=Ft(),[eu,Te]=No(Fn),ko=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=gt(t),u=c.useRef(null),[l,f]=c.useState(!1),[d=!1,p]=et({prop:r,defaultProp:o,onChange:s});return m.jsx(Nn,{...a,children:m.jsx(eu,{scope:t,contentId:Xe(),triggerRef:u,open:d,onOpenChange:p,onOpenToggle:c.useCallback(()=>p(v=>!v),[p]),hasCustomAnchor:l,onCustomAnchorAdd:c.useCallback(()=>f(!0),[]),onCustomAnchorRemove:c.useCallback(()=>f(!1),[]),modal:i,children:n})})};ko.displayName=Fn;var _o="PopoverAnchor",Oo=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Te(_o,n),s=gt(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return c.useEffect(()=>(i(),()=>a()),[i,a]),m.jsx(kn,{...s,...r,ref:t})});Oo.displayName=_o;var To="PopoverTrigger",Io=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Te(To,n),s=gt(n),i=Q(t,o.triggerRef),a=m.jsx(Y.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":$o(o.open),...r,ref:i,onClick:I(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:m.jsx(kn,{asChild:!0,...s,children:a})});Io.displayName=To;var $n="PopoverPortal",[tu,nu]=No($n,{forceMount:void 0}),jo=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Te($n,t);return m.jsx(tu,{scope:t,forceMount:n,children:m.jsx(Oe,{present:n||s.open,children:m.jsx(_n,{asChild:!0,container:o,children:r})})})};jo.displayName=$n;var st="PopoverContent",Do=c.forwardRef((e,t)=>{const n=nu(st,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Te(st,e.__scopePopover);return m.jsx(Oe,{present:r||s.open,children:s.modal?m.jsx(ru,{...o,ref:t}):m.jsx(ou,{...o,ref:t})})});Do.displayName=st;var ru=c.forwardRef((e,t)=>{const n=Te(st,e.__scopePopover),r=c.useRef(null),o=Q(t,r),s=c.useRef(!1);return c.useEffect(()=>{const i=r.current;if(i)return go(i)},[]),m.jsx(Ln,{as:We,allowPinchZoom:!0,children:m.jsx(Lo,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:I(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:I(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,l=a.button===2||u;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:I(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),ou=c.forwardRef((e,t)=>{const n=Te(st,e.__scopePopover),r=c.useRef(!1),o=c.useRef(!1);return m.jsx(Lo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var u,l;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Lo=c.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:f,...d}=e,p=Te(st,n),v=gt(n);return Or(),m.jsx(pn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:m.jsx(ln,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),children:m.jsx(po,{"data-state":$o(p.open),role:"dialog",id:p.contentId,...v,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Fo="PopoverClose",su=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Te(Fo,n);return m.jsx(Y.button,{type:"button",...r,ref:t,onClick:I(e.onClick,()=>o.onOpenChange(!1))})});su.displayName=Fo;var au="PopoverArrow",iu=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=gt(n);return m.jsx(mo,{...o,...r,ref:t})});iu.displayName=au;function $o(e){return e?"open":"closed"}var cu=ko,lu=Oo,uu=Io,du=jo,Wo=Do;const zo=cu,Bo=uu,fu=lu,Wn=c.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>m.jsx(du,{children:m.jsx(Wo,{ref:o,align:t,sideOffset:n,className:B("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Wn.displayName=Wo.displayName;function pu(e){const{value:t="",onChange:n,options:r,className:o,placeholder:s="Search...",emptyMessage:i="Nothing found"}=e,[a,u]=H.useState(t),[l,f]=H.useState(r),[d,p]=H.useState(-1),[v,b]=H.useState(!1),g=C=>{const E=C.target.value;u(E),n==null||n(E),p(-1),b(!0),E.trim()===""?f(r):f(r.filter(N=>N.label.toLowerCase().includes(E.toLowerCase())))},y=C=>{if(C.key==="ArrowDown")C.preventDefault(),p(E=>E<l.length-1?E+1:E);else if(C.key==="ArrowUp")C.preventDefault(),p(E=>E>0?E-1:-1);else if(C.key==="Enter"&&d>=0){const E=l[d];u(E.label),n==null||n(E.value),f([]),p(-1),b(!1)}else C.key==="Escape"&&(f([]),p(-1))},w=C=>{b(!1),u(C.label),n==null||n(C.value),f(r),p(-1)},x=()=>{b(!0)},S=()=>{b(!1)};return m.jsxs(zo,{open:v,children:[m.jsx(Bo,{asChild:!0,children:m.jsx("div",{className:"relative w-full",children:m.jsx(sn,{type:"text",placeholder:s,value:a,onChange:g,onKeyDown:y,onClick:x,onFocus:x,onBlur:S,className:B("pr-10",o),"aria-label":"Search field","aria-autocomplete":"list","aria-controls":"suggestions-list","aria-expanded":l.length>0,leftIcon:m.jsx(ji,{className:"w-4 h-4"})})})}),m.jsx(Wn,{className:"p-0 w-[var(--radix-popover-trigger-width)] max-h-96 overflow-y-auto",children:l.length>0?m.jsx("ul",{id:"suggestions-list",role:"listbox",children:l.map((C,E)=>m.jsx("li",{className:`px-4 py-2 cursor-pointer hover:bg-muted ${E===d?"bg-muted":""}`,onClick:()=>w(C),role:"option","aria-selected":E===d,children:C.label},C.value))}):m.jsx("span",{className:"px-4 py-2 block",children:i})})]})}var zn="Avatar",[mu,mf]=pe(zn),[hu,Go]=mu(zn),Vo=c.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,s]=c.useState("idle");return m.jsx(hu,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:m.jsx(Y.span,{...r,ref:t})})});Vo.displayName=zn;var Uo="AvatarImage",Ko=c.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...s}=e,i=Go(Uo,n),a=gu(r,s.referrerPolicy),u=oe(l=>{o(l),i.onImageLoadingStatusChange(l)});return ye(()=>{a!=="idle"&&u(a)},[a,u]),a==="loaded"?m.jsx(Y.img,{...s,ref:t,src:r}):null});Ko.displayName=Uo;var Ho="AvatarFallback",Yo=c.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,s=Go(Ho,n),[i,a]=c.useState(r===void 0);return c.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(u)}},[r]),i&&s.imageLoadingStatus!=="loaded"?m.jsx(Y.span,{...o,ref:t}):null});Yo.displayName=Ho;function gu(e,t){const[n,r]=c.useState("idle");return ye(()=>{if(!e){r("error");return}let o=!0;const s=new window.Image,i=a=>()=>{o&&r(a)};return r("loading"),s.onload=i("loaded"),s.onerror=i("error"),s.src=e,t&&(s.referrerPolicy=t),()=>{o=!1}},[e,t]),n}var Xo=Vo,qo=Ko,Zo=Yo;const Jo=c.forwardRef(({className:e,...t},n)=>m.jsx(Xo,{ref:n,className:B("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Jo.displayName=Xo.displayName;const Qo=c.forwardRef(({className:e,...t},n)=>m.jsx(qo,{ref:n,className:B("aspect-square h-full w-full",e),...t}));Qo.displayName=qo.displayName;const es=c.forwardRef(({className:e,...t},n)=>m.jsx(Zo,{ref:n,className:B("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));es.displayName=Zo.displayName;const ts=on("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function vu({className:e,variant:t,...n}){return m.jsx("div",{className:B(ts({variant:t}),e),...n})}const ns=on("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",xl:"h-12 rounded-md px-10 text-xl",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Bn=c.forwardRef(({className:e,variant:t,size:n,isLoading:r=!1,asChild:o=!1,...s},i)=>{const a=o?We:"button";return m.jsxs(a,{className:B(ns({variant:t,size:n,className:e})),ref:i,...s,disabled:r||s.disabled,children:[r&&m.jsxs("svg",{className:"animate-spin -ml-1 h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[m.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),m.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),s.children]})});Bn.displayName="Button";const rs=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("rounded-xl border bg-card text-card-foreground shadow",e),...t}));rs.displayName="Card";const os=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("flex flex-col space-y-1.5 p-6",e),...t}));os.displayName="CardHeader";const ss=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("font-semibold leading-none tracking-tight pb-4",e),...t}));ss.displayName="CardTitle";const as=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("text-sm text-muted-foreground",e),...t}));as.displayName="CardDescription";const is=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("p-6 py-0",e),...t}));is.displayName="CardContent";const cs=c.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:B("flex items-center p-6 pt-6",e),...t}));cs.displayName="CardFooter";function ls(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Gn="Checkbox",[bu,hf]=pe(Gn),[wu,yu]=bu(Gn),us=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:l,form:f,...d}=e,[p,v]=c.useState(null),b=Q(t,C=>v(C)),g=c.useRef(!1),y=p?f||!!p.closest("form"):!0,[w=!1,x]=et({prop:o,defaultProp:s,onChange:l}),S=c.useRef(w);return c.useEffect(()=>{const C=p==null?void 0:p.form;if(C){const E=()=>x(S.current);return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[p,x]),m.jsxs(wu,{scope:n,state:w,disabled:a,children:[m.jsx(Y.button,{type:"button",role:"checkbox","aria-checked":Ie(w)?"mixed":w,"aria-required":i,"data-state":ps(w),"data-disabled":a?"":void 0,disabled:a,value:u,...d,ref:b,onKeyDown:I(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:I(e.onClick,C=>{x(E=>Ie(E)?!0:!E),y&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})}),y&&m.jsx(xu,{control:p,bubbles:!g.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Ie(s)?!1:s})]})});us.displayName=Gn;var ds="CheckboxIndicator",fs=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=yu(ds,n);return m.jsx(Oe,{present:r||Ie(s.state)||s.state===!0,children:m.jsx(Y.span,{"data-state":ps(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});fs.displayName=ds;var xu=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=c.useRef(null),a=ls(n),u=Pn(t);c.useEffect(()=>{const f=i.current,d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&v){const b=new Event("click",{bubbles:r});f.indeterminate=Ie(n),v.call(f,Ie(n)?!1:n),f.dispatchEvent(b)}},[a,n,r]);const l=c.useRef(Ie(n)?!1:n);return m.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??l.current,...s,tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ie(e){return e==="indeterminate"}function ps(e){return Ie(e)?"indeterminate":e?"checked":"unchecked"}var ms=us,Cu=fs;const hs=c.forwardRef(({className:e,...t},n)=>m.jsx(ms,{ref:n,className:B("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:m.jsx(Cu,{className:B("flex items-center justify-center text-current"),children:m.jsx(Rr,{className:"h-4 w-4"})})}));hs.displayName=ms.displayName;function gs(e){const t=e+"CollectionProvider",[n,r]=pe(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:b,children:g}=v,y=H.useRef(null),w=H.useRef(new Map).current;return m.jsx(o,{scope:b,itemMap:w,collectionRef:y,children:g})};i.displayName=t;const a=e+"CollectionSlot",u=H.forwardRef((v,b)=>{const{scope:g,children:y}=v,w=s(a,g),x=Q(b,w.collectionRef);return m.jsx(We,{ref:x,children:y})});u.displayName=a;const l=e+"CollectionItemSlot",f="data-radix-collection-item",d=H.forwardRef((v,b)=>{const{scope:g,children:y,...w}=v,x=H.useRef(null),S=Q(b,x),C=s(l,g);return H.useEffect(()=>(C.itemMap.set(x,{ref:x,...w}),()=>void C.itemMap.delete(x))),m.jsx(We,{[f]:"",ref:S,children:y})});d.displayName=l;function p(v){const b=s(e+"CollectionConsumer",v);return H.useCallback(()=>{const y=b.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((C,E)=>w.indexOf(C.ref.current)-w.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:u,ItemSlot:d},p,r]}var Eu=c.createContext(void 0);function vs(e){const t=c.useContext(Eu);return e||t||"ltr"}var Vn="rovingFocusGroup.onEntryFocus",Su={bubbles:!1,cancelable:!0},Ht="RovingFocusGroup",[Un,bs,Ru]=gs(Ht),[Pu,ws]=pe(Ht,[Ru]),[Au,Mu]=Pu(Ht),ys=c.forwardRef((e,t)=>m.jsx(Un.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(Un.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(Nu,{...e,ref:t})})}));ys.displayName=Ht;var Nu=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...d}=e,p=c.useRef(null),v=Q(t,p),b=vs(s),[g=null,y]=et({prop:i,defaultProp:a,onChange:u}),[w,x]=c.useState(!1),S=oe(l),C=bs(n),E=c.useRef(!1),[N,P]=c.useState(0);return c.useEffect(()=>{const _=p.current;if(_)return _.addEventListener(Vn,S),()=>_.removeEventListener(Vn,S)},[S]),m.jsx(Au,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:g,onItemFocus:c.useCallback(_=>y(_),[y]),onItemShiftTab:c.useCallback(()=>x(!0),[]),onFocusableItemAdd:c.useCallback(()=>P(_=>_+1),[]),onFocusableItemRemove:c.useCallback(()=>P(_=>_-1),[]),children:m.jsx(Y.div,{tabIndex:w||N===0?-1:0,"data-orientation":r,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:I(e.onMouseDown,()=>{E.current=!0}),onFocus:I(e.onFocus,_=>{const W=!E.current;if(_.target===_.currentTarget&&W&&!w){const L=new CustomEvent(Vn,Su);if(_.currentTarget.dispatchEvent(L),!L.defaultPrevented){const U=C().filter(F=>F.focusable),k=U.find(F=>F.active),G=U.find(F=>F.id===g),Z=[k,G,...U].filter(Boolean).map(F=>F.ref.current);Es(Z,f)}}E.current=!1}),onBlur:I(e.onBlur,()=>x(!1))})})}),xs="RovingFocusGroupItem",Cs=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Xe(),u=s||a,l=Mu(xs,n),f=l.currentTabStopId===u,d=bs(n),{onFocusableItemAdd:p,onFocusableItemRemove:v}=l;return c.useEffect(()=>{if(r)return p(),()=>v()},[r,p,v]),m.jsx(Un.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:m.jsx(Y.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...i,ref:t,onMouseDown:I(e.onMouseDown,b=>{r?l.onItemFocus(u):b.preventDefault()}),onFocus:I(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:I(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){l.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=Ou(b,l.orientation,l.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=d().filter(x=>x.focusable).map(x=>x.ref.current);if(g==="last")w.reverse();else if(g==="prev"||g==="next"){g==="prev"&&w.reverse();const x=w.indexOf(b.currentTarget);w=l.loop?Tu(w,x+1):w.slice(x+1)}setTimeout(()=>Es(w))}})})})});Cs.displayName=xs;var ku={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _u(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ou(e,t,n){const r=_u(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ku[r]}function Es(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Tu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Iu=ys,ju=Cs,Kn=["Enter"," "],Du=["ArrowDown","PageUp","Home"],Ss=["ArrowUp","PageDown","End"],Lu=[...Du,...Ss],Fu={ltr:[...Kn,"ArrowRight"],rtl:[...Kn,"ArrowLeft"]},$u={ltr:["ArrowLeft"],rtl:["ArrowRight"]},vt="Menu",[bt,Wu,zu]=gs(vt),[Be,Rs]=pe(vt,[zu,Ft,ws]),wt=Ft(),Ps=ws(),[As,je]=Be(vt),[Bu,yt]=Be(vt),Ms=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=wt(t),[u,l]=c.useState(null),f=c.useRef(!1),d=oe(s),p=vs(o);return c.useEffect(()=>{const v=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),m.jsx(Nn,{...a,children:m.jsx(As,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:l,children:m.jsx(Bu,{scope:t,onClose:c.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:p,modal:i,children:r})})})};Ms.displayName=vt;var Gu="MenuAnchor",Hn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=wt(n);return m.jsx(kn,{...o,...r,ref:t})});Hn.displayName=Gu;var Yn="MenuPortal",[Vu,Ns]=Be(Yn,{forceMount:void 0}),ks=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=je(Yn,t);return m.jsx(Vu,{scope:t,forceMount:n,children:m.jsx(Oe,{present:n||s.open,children:m.jsx(_n,{asChild:!0,container:o,children:r})})})};ks.displayName=Yn;var ie="MenuContent",[Uu,Xn]=Be(ie),_s=c.forwardRef((e,t)=>{const n=Ns(ie,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=je(ie,e.__scopeMenu),i=yt(ie,e.__scopeMenu);return m.jsx(bt.Provider,{scope:e.__scopeMenu,children:m.jsx(Oe,{present:r||s.open,children:m.jsx(bt.Slot,{scope:e.__scopeMenu,children:i.modal?m.jsx(Ku,{...o,ref:t}):m.jsx(Hu,{...o,ref:t})})})})}),Ku=c.forwardRef((e,t)=>{const n=je(ie,e.__scopeMenu),r=c.useRef(null),o=Q(t,r);return c.useEffect(()=>{const s=r.current;if(s)return go(s)},[]),m.jsx(qn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:I(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Hu=c.forwardRef((e,t)=>{const n=je(ie,e.__scopeMenu);return m.jsx(qn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),qn=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:v,disableOutsideScroll:b,...g}=e,y=je(ie,n),w=yt(ie,n),x=wt(n),S=Ps(n),C=Wu(n),[E,N]=c.useState(null),P=c.useRef(null),_=Q(t,P,y.onContentChange),W=c.useRef(0),L=c.useRef(""),U=c.useRef(0),k=c.useRef(null),G=c.useRef("right"),$=c.useRef(0),Z=b?Ln:c.Fragment,F=b?{as:We,allowPinchZoom:!0}:void 0,X=R=>{var le,De;const K=L.current+R,z=C().filter(ne=>!ne.disabled),ce=document.activeElement,Ee=(le=z.find(ne=>ne.ref.current===ce))==null?void 0:le.textValue,fe=z.map(ne=>ne.textValue),Ge=sd(fe,K,Ee),be=(De=z.find(ne=>ne.textValue===Ge))==null?void 0:De.ref.current;(function ne(Le){L.current=Le,window.clearTimeout(W.current),Le!==""&&(W.current=window.setTimeout(()=>ne(""),1e3))})(K),be&&setTimeout(()=>be.focus())};c.useEffect(()=>()=>window.clearTimeout(W.current),[]),Or();const T=c.useCallback(R=>{var z,ce;return G.current===((z=k.current)==null?void 0:z.side)&&id(R,(ce=k.current)==null?void 0:ce.area)},[]);return m.jsx(Uu,{scope:n,searchRef:L,onItemEnter:c.useCallback(R=>{T(R)&&R.preventDefault()},[T]),onItemLeave:c.useCallback(R=>{var K;T(R)||((K=P.current)==null||K.focus(),N(null))},[T]),onTriggerLeave:c.useCallback(R=>{T(R)&&R.preventDefault()},[T]),pointerGraceTimerRef:U,onPointerGraceIntentChange:c.useCallback(R=>{k.current=R},[]),children:m.jsx(Z,{...F,children:m.jsx(pn,{asChild:!0,trapped:o,onMountAutoFocus:I(s,R=>{var K;R.preventDefault(),(K=P.current)==null||K.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:m.jsx(ln,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:v,children:m.jsx(Iu,{asChild:!0,...S,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:N,onEntryFocus:I(u,R=>{w.isUsingKeyboardRef.current||R.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(po,{role:"menu","aria-orientation":"vertical","data-state":Xs(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...g,ref:_,style:{outline:"none",...g.style},onKeyDown:I(g.onKeyDown,R=>{const z=R.target.closest("[data-radix-menu-content]")===R.currentTarget,ce=R.ctrlKey||R.altKey||R.metaKey,Ee=R.key.length===1;z&&(R.key==="Tab"&&R.preventDefault(),!ce&&Ee&&X(R.key));const fe=P.current;if(R.target!==fe||!Lu.includes(R.key))return;R.preventDefault();const be=C().filter(le=>!le.disabled).map(le=>le.ref.current);Ss.includes(R.key)&&be.reverse(),rd(be)}),onBlur:I(e.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(W.current),L.current="")}),onPointerMove:I(e.onPointerMove,Ct(R=>{const K=R.target,z=$.current!==R.clientX;if(R.currentTarget.contains(K)&&z){const ce=R.clientX>$.current?"right":"left";G.current=ce,$.current=R.clientX}}))})})})})})})});_s.displayName=ie;var Yu="MenuGroup",Zn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Y.div,{role:"group",...r,ref:t})});Zn.displayName=Yu;var Xu="MenuLabel",Os=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Y.div,{...r,ref:t})});Os.displayName=Xu;var Yt="MenuItem",Ts="menu.itemSelect",Xt=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=c.useRef(null),i=yt(Yt,e.__scopeMenu),a=Xn(Yt,e.__scopeMenu),u=Q(t,s),l=c.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const p=new CustomEvent(Ts,{bubbles:!0,cancelable:!0});d.addEventListener(Ts,v=>r==null?void 0:r(v),{once:!0}),Ar(d,p),p.defaultPrevented?l.current=!1:i.onClose()}};return m.jsx(Is,{...o,ref:u,disabled:n,onClick:I(e.onClick,f),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),l.current=!0},onPointerUp:I(e.onPointerUp,d=>{var p;l.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:I(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||Kn.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Xt.displayName=Yt;var Is=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Xn(Yt,n),a=Ps(n),u=c.useRef(null),l=Q(t,u),[f,d]=c.useState(!1),[p,v]=c.useState("");return c.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[s.children]),m.jsx(bt.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:m.jsx(ju,{asChild:!0,...a,focusable:!r,children:m.jsx(Y.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:I(e.onPointerMove,Ct(b=>{r?i.onItemLeave(b):(i.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:I(e.onPointerLeave,Ct(b=>i.onItemLeave(b))),onFocus:I(e.onFocus,()=>d(!0)),onBlur:I(e.onBlur,()=>d(!1))})})})}),qu="MenuCheckboxItem",js=c.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.jsx(Ws,{scope:e.__scopeMenu,checked:n,children:m.jsx(Xt,{role:"menuitemcheckbox","aria-checked":qt(n)?"mixed":n,...o,ref:t,"data-state":er(n),onSelect:I(o.onSelect,()=>r==null?void 0:r(qt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});js.displayName=qu;var Ds="MenuRadioGroup",[Zu,Ju]=Be(Ds,{value:void 0,onValueChange:()=>{}}),Ls=c.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=oe(r);return m.jsx(Zu,{scope:e.__scopeMenu,value:n,onValueChange:s,children:m.jsx(Zn,{...o,ref:t})})});Ls.displayName=Ds;var Fs="MenuRadioItem",$s=c.forwardRef((e,t)=>{const{value:n,...r}=e,o=Ju(Fs,e.__scopeMenu),s=n===o.value;return m.jsx(Ws,{scope:e.__scopeMenu,checked:s,children:m.jsx(Xt,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":er(s),onSelect:I(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});$s.displayName=Fs;var Jn="MenuItemIndicator",[Ws,Qu]=Be(Jn,{checked:!1}),zs=c.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Qu(Jn,n);return m.jsx(Oe,{present:r||qt(s.checked)||s.checked===!0,children:m.jsx(Y.span,{...o,ref:t,"data-state":er(s.checked)})})});zs.displayName=Jn;var ed="MenuSeparator",Bs=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Y.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Bs.displayName=ed;var td="MenuArrow",Gs=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=wt(n);return m.jsx(mo,{...o,...r,ref:t})});Gs.displayName=td;var Qn="MenuSub",[nd,Vs]=Be(Qn),Us=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=je(Qn,t),i=wt(t),[a,u]=c.useState(null),[l,f]=c.useState(null),d=oe(o);return c.useEffect(()=>(s.open===!1&&d(!1),()=>d(!1)),[s.open,d]),m.jsx(Nn,{...i,children:m.jsx(As,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:f,children:m.jsx(nd,{scope:t,contentId:Xe(),triggerId:Xe(),trigger:a,onTriggerChange:u,children:n})})})};Us.displayName=Qn;var xt="MenuSubTrigger",Ks=c.forwardRef((e,t)=>{const n=je(xt,e.__scopeMenu),r=yt(xt,e.__scopeMenu),o=Vs(xt,e.__scopeMenu),s=Xn(xt,e.__scopeMenu),i=c.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=s,l={__scopeMenu:e.__scopeMenu},f=c.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return c.useEffect(()=>f,[f]),c.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),u(null)}},[a,u]),m.jsx(Hn,{asChild:!0,...l,children:m.jsx(Is,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Xs(n.open),...e,ref:Mt(t,o.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:I(e.onPointerMove,Ct(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:I(e.onPointerLeave,Ct(d=>{var v,b;f();const p=(v=n.content)==null?void 0:v.getBoundingClientRect();if(p){const g=(b=n.content)==null?void 0:b.dataset.side,y=g==="right",w=y?-5:5,x=p[y?"left":"right"],S=p[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+w,y:d.clientY},{x,y:p.top},{x:S,y:p.top},{x:S,y:p.bottom},{x,y:p.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:I(e.onKeyDown,d=>{var v;const p=s.searchRef.current!=="";e.disabled||p&&d.key===" "||Fu[r.dir].includes(d.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),d.preventDefault())})})})});Ks.displayName=xt;var Hs="MenuSubContent",Ys=c.forwardRef((e,t)=>{const n=Ns(ie,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=je(ie,e.__scopeMenu),i=yt(ie,e.__scopeMenu),a=Vs(Hs,e.__scopeMenu),u=c.useRef(null),l=Q(t,u);return m.jsx(bt.Provider,{scope:e.__scopeMenu,children:m.jsx(Oe,{present:r||s.open,children:m.jsx(bt.Slot,{scope:e.__scopeMenu,children:m.jsx(qn,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var d;i.isUsingKeyboardRef.current&&((d=u.current)==null||d.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:I(e.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:I(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:I(e.onKeyDown,f=>{var v;const d=f.currentTarget.contains(f.target),p=$u[i.dir].includes(f.key);d&&p&&(s.onOpenChange(!1),(v=a.trigger)==null||v.focus(),f.preventDefault())})})})})})});Ys.displayName=Hs;function Xs(e){return e?"open":"closed"}function qt(e){return e==="indeterminate"}function er(e){return qt(e)?"indeterminate":e?"checked":"unchecked"}function rd(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function od(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function sd(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=od(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const u=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function ad(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,u=t[s].y,l=t[i].x,f=t[i].y;u>r!=f>r&&n<(l-a)*(r-u)/(f-u)+a&&(o=!o)}return o}function id(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ad(n,t)}function Ct(e){return t=>t.pointerType==="mouse"?e(t):void 0}var cd=Ms,ld=Hn,ud=ks,dd=_s,fd=Zn,pd=Os,md=Xt,hd=js,gd=Ls,vd=$s,bd=zs,wd=Bs,yd=Gs,xd=Us,Cd=Ks,Ed=Ys,tr="DropdownMenu",[Sd,gf]=pe(tr,[Rs]),ee=Rs(),[Rd,qs]=Sd(tr),Zs=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,u=ee(t),l=c.useRef(null),[f=!1,d]=et({prop:o,defaultProp:s,onChange:i});return m.jsx(Rd,{scope:t,triggerId:Xe(),triggerRef:l,contentId:Xe(),open:f,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(p=>!p),[d]),modal:a,children:m.jsx(cd,{...u,open:f,onOpenChange:d,dir:r,modal:a,children:n})})};Zs.displayName=tr;var Js="DropdownMenuTrigger",Qs=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=qs(Js,n),i=ee(n);return m.jsx(ld,{asChild:!0,...i,children:m.jsx(Y.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Mt(t,s.triggerRef),onPointerDown:I(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:I(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Qs.displayName=Js;var Pd="DropdownMenuPortal",ea=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ee(t);return m.jsx(ud,{...r,...n})};ea.displayName=Pd;var ta="DropdownMenuContent",na=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qs(ta,n),s=ee(n),i=c.useRef(!1);return m.jsx(dd,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:I(e.onCloseAutoFocus,a=>{var u;i.current||(u=o.triggerRef.current)==null||u.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:I(e.onInteractOutside,a=>{const u=a.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,f=u.button===2||l;(!o.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});na.displayName=ta;var Ad="DropdownMenuGroup",ra=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(fd,{...o,...r,ref:t})});ra.displayName=Ad;var Md="DropdownMenuLabel",oa=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(pd,{...o,...r,ref:t})});oa.displayName=Md;var Nd="DropdownMenuItem",sa=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(md,{...o,...r,ref:t})});sa.displayName=Nd;var kd="DropdownMenuCheckboxItem",aa=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(hd,{...o,...r,ref:t})});aa.displayName=kd;var _d="DropdownMenuRadioGroup",ia=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(gd,{...o,...r,ref:t})});ia.displayName=_d;var Od="DropdownMenuRadioItem",ca=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(vd,{...o,...r,ref:t})});ca.displayName=Od;var Td="DropdownMenuItemIndicator",la=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(bd,{...o,...r,ref:t})});la.displayName=Td;var Id="DropdownMenuSeparator",ua=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(wd,{...o,...r,ref:t})});ua.displayName=Id;var jd="DropdownMenuArrow",Dd=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(yd,{...o,...r,ref:t})});Dd.displayName=jd;var Ld=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=ee(t),[a=!1,u]=et({prop:r,defaultProp:s,onChange:o});return m.jsx(xd,{...i,open:a,onOpenChange:u,children:n})},Fd="DropdownMenuSubTrigger",da=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(Cd,{...o,...r,ref:t})});da.displayName=Fd;var $d="DropdownMenuSubContent",fa=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ee(n);return m.jsx(Ed,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fa.displayName=$d;var Wd=Zs,zd=Qs,pa=ea,ma=na,Bd=ra,ha=oa,ga=sa,va=aa,Gd=ia,ba=ca,wa=la,ya=ua,Vd=Ld,xa=da,Ca=fa;const Ud=Wd,Kd=zd,Hd=Bd,Yd=pa,Xd=Vd,qd=Gd,Ea=c.forwardRef(({className:e,inset:t,children:n,...r},o)=>m.jsxs(xa,{ref:o,className:B("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,m.jsx(_i,{className:"ml-auto"})]}));Ea.displayName=xa.displayName;const Sa=c.forwardRef(({className:e,...t},n)=>m.jsx(Ca,{ref:n,className:B("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Sa.displayName=Ca.displayName;const Ra=c.forwardRef(({className:e,sideOffset:t=4,...n},r)=>m.jsx(pa,{children:m.jsx(ma,{ref:r,sideOffset:t,className:B("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ra.displayName=ma.displayName;const Pa=c.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(ga,{ref:r,className:B("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));Pa.displayName=ga.displayName;const Aa=c.forwardRef(({className:e,children:t,checked:n,...r},o)=>m.jsxs(va,{ref:o,className:B("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(wa,{children:m.jsx(Rr,{className:"h-4 w-4"})})}),t]}));Aa.displayName=va.displayName;const Ma=c.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(ba,{ref:r,className:B("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(wa,{children:m.jsx(Oi,{className:"h-2 w-2 fill-current"})})}),t]}));Ma.displayName=ba.displayName;const Na=c.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(ha,{ref:r,className:B("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Na.displayName=ha.displayName;const ka=c.forwardRef(({className:e,...t},n)=>m.jsx(ya,{ref:n,className:B("-mx-1 my-1 h-px bg-muted",e),...t}));ka.displayName=ya.displayName;const _a=({className:e,...t})=>m.jsx("span",{className:B("ml-auto text-xs tracking-widest opacity-60",e),...t});_a.displayName="DropdownMenuShortcut";var nr="Progress",rr=100,[Zd,vf]=pe(nr),[Jd,Qd]=Zd(nr),Oa=c.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:s=ef,...i}=e;(o||o===0)&&!Da(o)&&console.error(tf(`${o}`,"Progress"));const a=Da(o)?o:rr;r!==null&&!La(r,a)&&console.error(nf(`${r}`,"Progress"));const u=La(r,a)?r:null,l=Zt(u)?s(u,a):void 0;return m.jsx(Jd,{scope:n,value:u,max:a,children:m.jsx(Y.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Zt(u)?u:void 0,"aria-valuetext":l,role:"progressbar","data-state":ja(u,a),"data-value":u??void 0,"data-max":a,...i,ref:t})})});Oa.displayName=nr;var Ta="ProgressIndicator",Ia=c.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=Qd(Ta,n);return m.jsx(Y.div,{"data-state":ja(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});Ia.displayName=Ta;function ef(e,t){return`${Math.round(e/t*100)}%`}function ja(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Zt(e){return typeof e=="number"}function Da(e){return Zt(e)&&!isNaN(e)&&e>0}function La(e,t){return Zt(e)&&!isNaN(e)&&e<=t&&e>=0}function tf(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${rr}\`.`}function nf(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
122
122
  - a positive number
123
123
  - less than the value passed to \`max\` (or ${rr} if no \`max\` prop is set)
124
124
  - \`null\` or \`undefined\` if the progress is indeterminate.
125
125
 
126
- Defaulting to \`null\`.`}var Fa=Oa,rf=Ia;const or=c.forwardRef(({className:e,value:t,...n},r)=>m.jsx(Fa,{ref:r,className:B("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:m.jsx(rf,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));or.displayName=Fa.displayName;function of(e){const{showStrengthMeter:t=!0,className:n,strengthLabels:r={veryWeak:"Very weak",weak:"Weak",medium:"Medium",strong:"Strong",veryStrong:"Very strong"},showPasswordLabel:o="Show password",hidePasswordLabel:s="Hide password",strengthTitle:i="Password strength",...a}=e,[u,l]=H.useState(""),[f,d]=H.useState(!1),p=w=>{let x=0;return w.length>=8&&(x+=25),w.match(/[a-z]/)&&(x+=25),w.match(/[A-Z]/)&&(x+=25),w.match(/[0-9]/)&&(x+=25),x},v=w=>w===0?r.veryWeak:w<=25?r.weak:w<=50?r.medium:w<=75?r.strong:r.veryStrong,b=p(u),g=v(b),y=w=>{var x;l(w.target.value),(x=e.onChange)==null||x.call(e,w)};return m.jsxs("div",{className:"w-fit space-y-4",children:[m.jsxs("div",{className:"relative",children:[m.jsx(At,{...a,type:f?"text":"password",value:u,onChange:y,className:`pr-10 ${n||""}`}),m.jsx(Bn,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full",onClick:()=>d(!f),"aria-label":f?s:o,children:f?m.jsx(Ti,{className:"h-4 w-4"}):m.jsx(Ii,{className:"h-4 w-4"})})]}),t&&m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex justify-between text-sm",children:[m.jsxs("span",{children:[i,":"]}),m.jsx("span",{children:g})]}),m.jsx(or,{value:b,className:"h-2"})]})]})}const sf=({className:e,repeat:t=1,...n})=>m.jsx(m.Fragment,{children:Array.from({length:t??1}).map((r,o)=>m.jsx("div",{className:B("animate-pulse rounded-md bg-gray-700/10",e),...n},o))});var sr="Switch",[af,bf]=pe(sr),[cf,lf]=af(sr),$a=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:l,form:f,...d}=e,[p,v]=c.useState(null),b=Q(t,S=>v(S)),g=c.useRef(!1),y=p?f||!!p.closest("form"):!0,[w=!1,x]=et({prop:o,defaultProp:s,onChange:l});return m.jsxs(cf,{scope:n,checked:w,disabled:a,children:[m.jsx(Y.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":Ba(w),"data-disabled":a?"":void 0,disabled:a,value:u,...d,ref:b,onClick:I(e.onClick,S=>{x(C=>!C),y&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})}),y&&m.jsx(uf,{control:p,bubbles:!g.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});$a.displayName=sr;var Wa="SwitchThumb",za=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=lf(Wa,n);return m.jsx(Y.span,{"data-state":Ba(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});za.displayName=Wa;var uf=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,s=c.useRef(null),i=ls(n),a=Pn(t);return c.useEffect(()=>{const u=s.current,l=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(l,"checked").set;if(i!==n&&d){const p=new Event("click",{bubbles:r});d.call(u,n),u.dispatchEvent(p)}},[i,n,r]),m.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ba(e){return e?"checked":"unchecked"}var Ga=$a,df=za;const Va=c.forwardRef(({className:e,...t},n)=>m.jsx(Ga,{className:B("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:m.jsx(df,{className:B("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Va.displayName=Ga.displayName,O.AdaptiveInput=sn,O.Autocomplete=pu,O.Avatar=Jo,O.AvatarFallback=es,O.AvatarImage=Qo,O.Badge=vu,O.Button=Bn,O.Card=rs,O.CardContent=is,O.CardDescription=as,O.CardFooter=cs,O.CardHeader=os,O.CardTitle=ss,O.Checkbox=hs,O.DropdownMenu=Ud,O.DropdownMenuCheckboxItem=Aa,O.DropdownMenuContent=Ra,O.DropdownMenuGroup=Hd,O.DropdownMenuItem=Pa,O.DropdownMenuLabel=Na,O.DropdownMenuPortal=Yd,O.DropdownMenuRadioGroup=qd,O.DropdownMenuRadioItem=Ma,O.DropdownMenuSeparator=ka,O.DropdownMenuShortcut=_a,O.DropdownMenuSub=Xd,O.DropdownMenuSubContent=Sa,O.DropdownMenuSubTrigger=Ea,O.DropdownMenuTrigger=Kd,O.Input=At,O.PasswordInput=of,O.Popover=zo,O.PopoverAnchor=fu,O.PopoverContent=Wn,O.PopoverTrigger=Bo,O.Progress=or,O.Skeleton=sf,O.Switch=Va,O.badgeVariants=ts,O.buttonVariants=ns,O.cn=B,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
126
+ Defaulting to \`null\`.`}var Fa=Oa,rf=Ia;const or=c.forwardRef(({className:e,value:t,...n},r)=>m.jsx(Fa,{ref:r,className:B("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:m.jsx(rf,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));or.displayName=Fa.displayName;function of(e){const{showStrengthMeter:t=!0,className:n,strengthLabels:r={veryWeak:"Very weak",weak:"Weak",medium:"Medium",strong:"Strong",veryStrong:"Very strong"},showPasswordLabel:o="Show password",hidePasswordLabel:s="Hide password",strengthTitle:i="Password strength",...a}=e,[u,l]=H.useState(""),[f,d]=H.useState(!1),p=w=>{let x=0;return w.length>=8&&(x+=25),w.match(/[a-z]/)&&(x+=25),w.match(/[A-Z]/)&&(x+=25),w.match(/[0-9]/)&&(x+=25),x},v=w=>w===0?r.veryWeak:w<=25?r.weak:w<=50?r.medium:w<=75?r.strong:r.veryStrong,b=p(u),g=v(b),y=w=>{var x;l(w.target.value),(x=e.onChange)==null||x.call(e,w)};return m.jsxs("div",{className:"w-full space-y-4",children:[m.jsxs("div",{className:"relative",children:[m.jsx(At,{...a,type:f?"text":"password",value:u,onChange:y,className:`pr-10 ${n||""}`}),m.jsx(Bn,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full",onClick:()=>d(!f),"aria-label":f?s:o,children:f?m.jsx(Ti,{className:"h-4 w-4"}):m.jsx(Ii,{className:"h-4 w-4"})})]}),t&&m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex justify-between text-sm",children:[m.jsxs("span",{children:[i,":"]}),m.jsx("span",{children:g})]}),m.jsx(or,{value:b,className:"h-2"})]})]})}const sf=({className:e,repeat:t=1,...n})=>m.jsx(m.Fragment,{children:Array.from({length:t??1}).map((r,o)=>m.jsx("div",{className:B("animate-pulse rounded-md bg-gray-700/10",e),...n},o))});var sr="Switch",[af,bf]=pe(sr),[cf,lf]=af(sr),$a=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:l,form:f,...d}=e,[p,v]=c.useState(null),b=Q(t,S=>v(S)),g=c.useRef(!1),y=p?f||!!p.closest("form"):!0,[w=!1,x]=et({prop:o,defaultProp:s,onChange:l});return m.jsxs(cf,{scope:n,checked:w,disabled:a,children:[m.jsx(Y.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":Ba(w),"data-disabled":a?"":void 0,disabled:a,value:u,...d,ref:b,onClick:I(e.onClick,S=>{x(C=>!C),y&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})}),y&&m.jsx(uf,{control:p,bubbles:!g.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});$a.displayName=sr;var Wa="SwitchThumb",za=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=lf(Wa,n);return m.jsx(Y.span,{"data-state":Ba(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});za.displayName=Wa;var uf=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,s=c.useRef(null),i=ls(n),a=Pn(t);return c.useEffect(()=>{const u=s.current,l=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(l,"checked").set;if(i!==n&&d){const p=new Event("click",{bubbles:r});d.call(u,n),u.dispatchEvent(p)}},[i,n,r]),m.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ba(e){return e?"checked":"unchecked"}var Ga=$a,df=za;const Va=c.forwardRef(({className:e,...t},n)=>m.jsx(Ga,{className:B("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:m.jsx(df,{className:B("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Va.displayName=Ga.displayName,O.AdaptiveInput=sn,O.Autocomplete=pu,O.Avatar=Jo,O.AvatarFallback=es,O.AvatarImage=Qo,O.Badge=vu,O.Button=Bn,O.Card=rs,O.CardContent=is,O.CardDescription=as,O.CardFooter=cs,O.CardHeader=os,O.CardTitle=ss,O.Checkbox=hs,O.DropdownMenu=Ud,O.DropdownMenuCheckboxItem=Aa,O.DropdownMenuContent=Ra,O.DropdownMenuGroup=Hd,O.DropdownMenuItem=Pa,O.DropdownMenuLabel=Na,O.DropdownMenuPortal=Yd,O.DropdownMenuRadioGroup=qd,O.DropdownMenuRadioItem=Ma,O.DropdownMenuSeparator=ka,O.DropdownMenuShortcut=_a,O.DropdownMenuSub=Xd,O.DropdownMenuSubContent=Sa,O.DropdownMenuSubTrigger=Ea,O.DropdownMenuTrigger=Kd,O.Input=At,O.PasswordInput=of,O.Popover=zo,O.PopoverAnchor=fu,O.PopoverContent=Wn,O.PopoverTrigger=Bo,O.Progress=or,O.Skeleton=sf,O.Switch=Va,O.badgeVariants=ts,O.buttonVariants=ns,O.cn=B,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buildgrid-ui",
3
- "version": "1.1.0-dev.6",
3
+ "version": "1.1.0-dev.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -6,7 +6,7 @@ import { AdaptiveInput } from './adaptative-input'
6
6
  import { HelpCircle, Phone, User } from 'lucide-react'
7
7
 
8
8
  const meta: Meta<typeof AdaptiveInput> = {
9
- title: 'Components/Input/AdaptiveInput',
9
+ title: 'Components/input/adaptiveInput',
10
10
  component: AdaptiveInput,
11
11
  }
12
12
 
@@ -15,12 +15,13 @@ type Story = StoryObj<typeof AdaptiveInput>
15
15
 
16
16
  const Template = () => {
17
17
  return (
18
- <AdaptiveInput
19
- className="w-64"
20
- leftIcon={<Phone className="w-4 h-4" />}
21
- rightIcon={<HelpCircle className="w-4 h-4" />}
22
- mask="+00 0000-0000"
23
- />
18
+ <div className="w-64">
19
+ <AdaptiveInput
20
+ leftIcon={<Phone className="w-4 h-4" />}
21
+ rightIcon={<HelpCircle className="w-4 h-4" />}
22
+ mask="+00 0000-0000"
23
+ />
24
+ </div>
24
25
  )
25
26
  }
26
27
 
@@ -5,7 +5,7 @@ import type { Meta, StoryObj } from '@storybook/react'
5
5
  import { Autocomplete } from './autocomplete'
6
6
 
7
7
  const meta: Meta<typeof Autocomplete> = {
8
- title: 'Components/Input/Autocomplete',
8
+ title: 'Components/input/autocomplete',
9
9
  component: Autocomplete,
10
10
  }
11
11
 
@@ -67,15 +67,14 @@ const options = [
67
67
  const Template = () => {
68
68
  const [value, setValue] = React.useState('')
69
69
  return (
70
- <>
70
+ <div className="w-80">
71
71
  <Autocomplete
72
72
  value={value}
73
73
  onChange={(value) => setValue(value)}
74
- className="w-80"
75
74
  options={options.map((option) => ({ value: option, label: option }))}
76
75
  />
77
76
  <p className="mt-4">Selected value: {value}</p>
78
- </>
77
+ </div>
79
78
  )
80
79
  }
81
80
 
@@ -91,7 +91,7 @@ export function Autocomplete(props: AutoCompleteProps) {
91
91
  return (
92
92
  <Popover open={isFocused}>
93
93
  <PopoverTrigger asChild>
94
- <div className="relative w-fit">
94
+ <div className="relative w-full">
95
95
  <AdaptiveInput
96
96
  type="text"
97
97
  placeholder={placeholder}
@@ -5,7 +5,7 @@ import type { Meta, StoryObj } from '@storybook/react'
5
5
  import { Input } from './input'
6
6
 
7
7
  const meta: Meta<typeof Input> = {
8
- title: 'Components/Input/Simple',
8
+ title: 'Components/input/simple',
9
9
  component: Input,
10
10
  }
11
11
 
@@ -5,7 +5,7 @@ import type { Meta, StoryObj } from '@storybook/react'
5
5
  import { PasswordInput } from './password-input'
6
6
 
7
7
  const meta: Meta<typeof PasswordInput> = {
8
- title: 'Components/Input/Password',
8
+ title: 'Components/input/password',
9
9
  component: PasswordInput,
10
10
  }
11
11
 
@@ -13,7 +13,11 @@ export default meta
13
13
  type Story = StoryObj<typeof PasswordInput>
14
14
 
15
15
  const Template = () => {
16
- return <PasswordInput className="w-96" />
16
+ return (
17
+ <div className="w-96">
18
+ <PasswordInput />
19
+ </div>
20
+ )
17
21
  }
18
22
 
19
23
  export const Default: Story = {
@@ -64,7 +64,7 @@ export function PasswordInput(props: PasswordInputProps) {
64
64
  }
65
65
 
66
66
  return (
67
- <div className="w-fit space-y-4">
67
+ <div className="w-full space-y-4">
68
68
  <div className="relative">
69
69
  <Input
70
70
  {...rest}