@moontra/moonui-pro 2.26.11 → 2.26.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.global.js +2 -2
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -117,7 +117,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
117
117
|
- less than the value passed to \`max\` (or ${sQ} if no \`max\` prop is set)
|
|
118
118
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
119
119
|
|
|
120
|
-
Defaulting to \`null\`.`}var lQ=YPe,eIe=ZPe;var cQ=E(me(),1),ps=tIe.forwardRef(({className:e,value:t,...r},n)=>(0,cQ.jsx)(lQ,{ref:n,className:B("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,cQ.jsx)(eIe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ps.displayName=lQ.displayName;var tp=E(de(),1);var jd=E(me(),1),Oz=mt("aspect-square border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-border bg-background text-primary",outline:"border-border bg-transparent text-primary",filled:"border-primary bg-primary/10 text-primary"},size:{sm:"h-3.5 w-3.5",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"default",size:"default"}}),JL=tp.createContext({}),fC=tp.forwardRef(({className:e,value:t,onValueChange:r,disabled:n,name:o,...a},i)=>(0,jd.jsx)(JL.Provider,{value:{value:t,onValueChange:r,disabled:n,name:o},children:(0,jd.jsx)("div",{ref:i,role:"radiogroup",className:B("grid gap-2",e),...a})}));fC.displayName="RadioGroupPro";var _v=tp.forwardRef(({className:e,variant:t,size:r,indicator:n,id:o,value:a,disabled:i,...s},l)=>{let c=tp.useContext(JL),u=tp.useId(),d=o||u,f=c.value===a,p=m=>{c.onValueChange&&c.onValueChange(m.target.value),s.onChange&&s.onChange(m)};return(0,jd.jsxs)("div",{className:"relative flex items-center",children:[(0,jd.jsx)("input",{type:"radio",id:d,ref:l,value:a,checked:f,disabled:i||c.disabled,name:c.name,onChange:p,className:"sr-only",...s}),(0,jd.jsx)("label",{htmlFor:d,className:B(Oz({variant:t,size:r}),"rounded-full","focus-visible:ring-primary/50","relative inline-flex shrink-0 cursor-pointer items-center justify-center overflow-hidden",i&&"cursor-not-allowed opacity-50",e),children:(0,jd.jsx)("span",{className:B("absolute inset-0 pointer-events-none",f&&"flex items-center justify-center"),children:f&&(n||(0,jd.jsx)(Lf,{className:"h-[60%] w-[60%] fill-current text-current"}))})})]})});_v.displayName="RadioGroupItemPro";var eE=tp.forwardRef(({className:e,htmlFor:t,children:r,disabled:n=!1,...o},a)=>(0,jd.jsx)("label",{ref:a,htmlFor:t,className:B("text-sm font-medium leading-none ml-2 text-foreground",n&&"cursor-not-allowed opacity-70",e),...o,children:r}));eE.displayName="RadioLabelPro";var _z=tp.forwardRef(({id:e,label:t,labelClassName:r,...n},o)=>{let a=tp.useId(),i=e||a;return(0,jd.jsxs)("div",{className:"flex items-center",children:[(0,jd.jsx)(_v,{ref:o,id:i,...n}),(0,jd.jsx)(eE,{htmlFor:i,disabled:n.disabled,className:r,children:t})]})});_z.displayName="RadioItemWithLabelPro";var hQ=E(de(),1);var sr=E(de(),1);var nIe=E(de(),1),lo=E(me(),1);function Cyt(e,t){return nIe.useReducer((r,n)=>t[r][n]??r,e)}var uQ="ScrollArea",[oIe,nHr]=Fn(uQ),[Syt,rp]=oIe(uQ),aIe=sr.forwardRef((e,t)=>{let{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:a=600,...i}=e,[s,l]=sr.useState(null),[c,u]=sr.useState(null),[d,f]=sr.useState(null),[p,m]=sr.useState(null),[h,g]=sr.useState(null),[v,y]=sr.useState(0),[x,C]=sr.useState(0),[b,w]=sr.useState(!1),[S,P]=sr.useState(!1),N=Gt(t,L=>l(L)),O=Af(o);return(0,lo.jsx)(Syt,{scope:r,type:n,dir:O,scrollHideDelay:a,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:b,onScrollbarXEnabledChange:w,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:S,onScrollbarYEnabledChange:P,onCornerWidthChange:y,onCornerHeightChange:C,children:(0,lo.jsx)(ot.div,{dir:O,...i,ref:N,style:{position:"relative",["--radix-scroll-area-corner-width"]:v+"px",["--radix-scroll-area-corner-height"]:x+"px",...e.style}})})});aIe.displayName=uQ;var iIe="ScrollAreaViewport",sIe=sr.forwardRef((e,t)=>{let{__scopeScrollArea:r,children:n,nonce:o,...a}=e,i=rp(iIe,r),s=sr.useRef(null),l=Gt(t,s,i.onViewportChange);return(0,lo.jsxs)(lo.Fragment,{children:[(0,lo.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,lo.jsx)(ot.div,{"data-radix-scroll-area-viewport":"",...a,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,lo.jsx)("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});sIe.displayName=iIe;var Uh="ScrollAreaScrollbar",Vz=sr.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rp(Uh,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:i}=o,s=e.orientation==="horizontal";return sr.useEffect(()=>(s?a(!0):i(!0),()=>{s?a(!1):i(!1)}),[s,a,i]),o.type==="hover"?(0,lo.jsx)(Pyt,{...n,ref:t,forceMount:r}):o.type==="scroll"?(0,lo.jsx)(Iyt,{...n,ref:t,forceMount:r}):o.type==="auto"?(0,lo.jsx)(lIe,{...n,ref:t,forceMount:r}):o.type==="always"?(0,lo.jsx)(dQ,{...n,ref:t}):null});Vz.displayName=Uh;var Pyt=sr.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rp(Uh,e.__scopeScrollArea),[a,i]=sr.useState(!1);return sr.useEffect(()=>{let s=o.scrollArea,l=0;if(s){let c=()=>{window.clearTimeout(l),i(!0)},u=()=>{l=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),(0,lo.jsx)(Ro,{present:r||a,children:(0,lo.jsx)(lIe,{"data-state":a?"visible":"hidden",...n,ref:t})})}),Iyt=sr.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rp(Uh,e.__scopeScrollArea),a=e.orientation==="horizontal",i=Uz(()=>l("SCROLL_END"),100),[s,l]=Cyt("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return sr.useEffect(()=>{if(s==="idle"){let c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,o.scrollHideDelay,l]),sr.useEffect(()=>{let c=o.viewport,u=a?"scrollLeft":"scrollTop";if(c){let d=c[u],f=()=>{let p=c[u];d!==p&&(l("SCROLL"),i()),d=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,a,l,i]),(0,lo.jsx)(Ro,{present:r||s!=="hidden",children:(0,lo.jsx)(dQ,{"data-state":s==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Ze(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Ze(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),lIe=sr.forwardRef((e,t)=>{let r=rp(Uh,e.__scopeScrollArea),{forceMount:n,...o}=e,[a,i]=sr.useState(!1),s=e.orientation==="horizontal",l=Uz(()=>{if(r.viewport){let c=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;i(s?c:u)}},10);return BI(r.viewport,l),BI(r.content,l),(0,lo.jsx)(Ro,{present:n||a,children:(0,lo.jsx)(dQ,{"data-state":a?"visible":"hidden",...o,ref:t})})}),dQ=sr.forwardRef((e,t)=>{let{orientation:r="vertical",...n}=e,o=rp(Uh,e.__scopeScrollArea),a=sr.useRef(null),i=sr.useRef(0),[s,l]=sr.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=fIe(s.viewport,s.content),u={...n,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>a.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function d(f,p){return Ayt(f,i.current,s,p)}return r==="horizontal"?(0,lo.jsx)(Ryt,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){let f=o.viewport.scrollLeft,p=rIe(f,s,o.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):r==="vertical"?(0,lo.jsx)(kyt,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){let f=o.viewport.scrollTop,p=rIe(f,s);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),Ryt=sr.forwardRef((e,t)=>{let{sizes:r,onSizesChange:n,...o}=e,a=rp(Uh,e.__scopeScrollArea),[i,s]=sr.useState(),l=sr.useRef(null),c=Gt(t,l,a.onScrollbarXChange);return sr.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,lo.jsx)(uIe,{"data-orientation":"horizontal",...o,ref:c,sizes:r,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,["--radix-scroll-area-thumb-width"]:zz(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(a.viewport){let f=a.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),mIe(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Bz(i.paddingLeft),paddingEnd:Bz(i.paddingRight)}})}})}),kyt=sr.forwardRef((e,t)=>{let{sizes:r,onSizesChange:n,...o}=e,a=rp(Uh,e.__scopeScrollArea),[i,s]=sr.useState(),l=sr.useRef(null),c=Gt(t,l,a.onScrollbarYChange);return sr.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,lo.jsx)(uIe,{"data-orientation":"vertical",...o,ref:c,sizes:r,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)",["--radix-scroll-area-thumb-height"]:zz(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(a.viewport){let f=a.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),mIe(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Bz(i.paddingTop),paddingEnd:Bz(i.paddingBottom)}})}})}),[Nyt,cIe]=oIe(Uh),uIe=sr.forwardRef((e,t)=>{let{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:a,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,p=rp(Uh,r),[m,h]=sr.useState(null),g=Gt(t,N=>h(N)),v=sr.useRef(null),y=sr.useRef(""),x=p.viewport,C=n.content-n.viewport,b=qn(u),w=qn(l),S=Uz(d,10);function P(N){if(v.current){let O=N.clientX-v.current.left,L=N.clientY-v.current.top;c({x:O,y:L})}}return sr.useEffect(()=>{let N=O=>{let L=O.target;m?.contains(L)&&b(O,C)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[x,m,C,b]),sr.useEffect(w,[n,w]),BI(m,S),BI(p.content,S),(0,lo.jsx)(Nyt,{scope:r,scrollbar:m,hasThumb:o,onThumbChange:qn(a),onThumbPointerUp:qn(i),onThumbPositionChange:w,onThumbPointerDown:qn(s),children:(0,lo.jsx)(ot.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:Ze(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),v.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),P(N))}),onPointerMove:Ze(e.onPointerMove,P),onPointerUp:Ze(e.onPointerUp,N=>{let O=N.target;O.hasPointerCapture(N.pointerId)&&O.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),Fz="ScrollAreaThumb",fQ=sr.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=cIe(Fz,e.__scopeScrollArea);return(0,lo.jsx)(Ro,{present:r||o.hasThumb,children:(0,lo.jsx)(Myt,{ref:t,...n})})}),Myt=sr.forwardRef((e,t)=>{let{__scopeScrollArea:r,style:n,...o}=e,a=rp(Fz,r),i=cIe(Fz,r),{onThumbPositionChange:s}=i,l=Gt(t,d=>i.onThumbChange(d)),c=sr.useRef(void 0),u=Uz(()=>{c.current&&(c.current(),c.current=void 0)},100);return sr.useEffect(()=>{let d=a.viewport;if(d){let f=()=>{if(u(),!c.current){let p=Lyt(d,s);c.current=p,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[a.viewport,u,s]),(0,lo.jsx)(ot.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Ze(e.onPointerDownCapture,d=>{let p=d.target.getBoundingClientRect(),m=d.clientX-p.left,h=d.clientY-p.top;i.onThumbPointerDown({x:m,y:h})}),onPointerUp:Ze(e.onPointerUp,i.onThumbPointerUp)})});fQ.displayName=Fz;var pQ="ScrollAreaCorner",dIe=sr.forwardRef((e,t)=>{let r=rp(pQ,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?(0,lo.jsx)(Tyt,{...e,ref:t}):null});dIe.displayName=pQ;var Tyt=sr.forwardRef((e,t)=>{let{__scopeScrollArea:r,...n}=e,o=rp(pQ,r),[a,i]=sr.useState(0),[s,l]=sr.useState(0),c=!!(a&&s);return BI(o.scrollbarX,()=>{let u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),BI(o.scrollbarY,()=>{let u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),i(u)}),c?(0,lo.jsx)(ot.div,{...n,ref:t,style:{width:a,height:s,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Bz(e){return e?parseInt(e,10):0}function fIe(e,t){let r=e/t;return isNaN(r)?0:r}function zz(e){let t=fIe(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Ayt(e,t,r,n="ltr"){let o=zz(r),a=o/2,i=t||a,s=o-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,u=r.content-r.viewport,d=n==="ltr"?[0,u]:[u*-1,0];return pIe([l,c],d)(e)}function rIe(e,t,r="ltr"){let n=zz(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-n,l=r==="ltr"?[0,i]:[i*-1,0],c=VL(e,l);return pIe([0,i],[0,s])(c)}function pIe(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function mIe(e,t){return e>0&&e<t}var Lyt=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){let a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,s=r.top!==a.top;(i||s)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function Uz(e,t){let r=qn(e),n=sr.useRef(0);return sr.useEffect(()=>()=>window.clearTimeout(n.current),[]),sr.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function BI(e,t){let r=qn(t);Un(()=>{let n=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var mQ=aIe,hIe=sIe;var gIe=dIe;var bb=E(me(),1),ic=hQ.forwardRef(({className:e,children:t,...r},n)=>(0,bb.jsxs)(mQ,{ref:n,className:B("relative overflow-hidden",e),...r,children:[(0,bb.jsx)(hIe,{className:"h-full w-full rounded-[inherit]",children:t}),(0,bb.jsx)(Hz,{}),(0,bb.jsx)(gIe,{})]}));ic.displayName=mQ.displayName;var Hz=hQ.forwardRef(({className:e,orientation:t="vertical",...r},n)=>(0,bb.jsx)(Vz,{ref:n,orientation:t,className:B("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,bb.jsx)(fQ,{className:"relative flex-1 rounded-full bg-border"})}));Hz.displayName=Vz.displayName;var wIe=E(de(),1);var yIe=E(de(),1);var xIe=E(me(),1),Dyt="Separator",vIe="horizontal",Oyt=["horizontal","vertical"],bIe=yIe.forwardRef((e,t)=>{let{decorative:r,orientation:n=vIe,...o}=e,a=_yt(n)?n:vIe,s=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return(0,xIe.jsx)(ot.div,{"data-orientation":a,...s,...o,ref:t})});bIe.displayName=Dyt;function _yt(e){return Oyt.includes(e)}var gQ=bIe;var CIe=E(me(),1),jz=mt("shrink-0 bg-border",{variants:{orientation:{horizontal:"h-[1px] w-full",vertical:"h-full w-[1px]"},variant:{default:"bg-border",dashed:"border-dashed border-border bg-transparent",dotted:"border-dotted border-border bg-transparent",gradient:"bg-gradient-to-r from-transparent via-border to-transparent"},size:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",variant:"dashed",className:"border-t h-0"},{orientation:"vertical",variant:"dashed",className:"border-l w-0"},{orientation:"horizontal",variant:"dotted",className:"border-t h-0"},{orientation:"vertical",variant:"dotted",className:"border-l w-0"},{orientation:"horizontal",size:"sm",variant:["dashed","dotted"],className:"border-t-[0.5px]"},{orientation:"horizontal",size:"lg",variant:["dashed","dotted"],className:"border-t-2"},{orientation:"vertical",size:"sm",variant:["dashed","dotted"],className:"border-l-[0.5px]"},{orientation:"vertical",size:"lg",variant:["dashed","dotted"],className:"border-l-2"},{orientation:"horizontal",size:"sm",variant:["default","gradient"],className:"h-[0.5px]"},{orientation:"horizontal",size:"lg",variant:["default","gradient"],className:"h-[2px]"},{orientation:"vertical",size:"sm",variant:["default","gradient"],className:"w-[0.5px]"},{orientation:"vertical",size:"lg",variant:["default","gradient"],className:"w-[2px]"}],defaultVariants:{orientation:"horizontal",variant:"default",size:"md"}}),ms=wIe.forwardRef(({className:e,orientation:t="horizontal",variant:r="default",size:n="md",decorative:o=!0,...a},i)=>(0,CIe.jsx)(gQ,{ref:i,decorative:o,orientation:t,className:B(jz({orientation:t,variant:r,size:n}),e),...a}));ms.displayName=gQ.displayName;var tE=E(de(),1);var qd=E(me(),1),wb=nb,qz=_3,SIe=PI,vQ=ob,$z=tE.forwardRef(({className:e,...t},r)=>(0,qd.jsx)(Th,{className:B("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));$z.displayName=Th.displayName;var Byt=mt("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Fv=tE.forwardRef(({side:e="right",className:t,children:r,...n},o)=>(0,qd.jsxs)(vQ,{children:[(0,qd.jsx)($z,{}),(0,qd.jsxs)(ab,{ref:o,className:B(Byt({side:e}),t),...n,children:[r,(0,qd.jsxs)(PI,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,qd.jsx)(Zt,{className:"h-4 w-4"}),(0,qd.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Fv.displayName=ab.displayName;var rE=({className:e,...t})=>(0,qd.jsx)("div",{className:B("flex flex-col space-y-2 text-center sm:text-left",e),...t});rE.displayName="SheetHeader";var yQ=({className:e,...t})=>(0,qd.jsx)("div",{className:B("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});yQ.displayName="SheetFooter";var nE=tE.forwardRef(({className:e,...t},r)=>(0,qd.jsx)(CI,{ref:r,className:B("text-lg font-semibold text-foreground",e),...t}));nE.displayName=CI.displayName;var oE=tE.forwardRef(({className:e,...t},r)=>(0,qd.jsx)(SI,{ref:r,className:B("text-sm text-muted-foreground",e),...t}));oE.displayName=SI.displayName;var PIe=E(me(),1);function ca({className:e,...t}){return(0,PIe.jsx)("div",{className:B("animate-pulse rounded-md bg-muted",e),...t})}var Cb=E(de(),1);var Hh=E(me(),1),Vyt=mt("relative flex w-full touch-none select-none items-center",{variants:{size:{sm:"h-5",default:"h-6",md:"h-8",lg:"h-10"}},defaultVariants:{size:"default"}}),zyt=mt("relative h-1.5 w-full grow overflow-hidden rounded-full",{variants:{variant:{default:"bg-muted",primary:"bg-primary/20",secondary:"bg-secondary/20",accent:"bg-accent/20",success:"bg-success/20",warning:"bg-warning/20",error:"bg-error/20"}},defaultVariants:{variant:"default"}}),Uyt=mt("absolute h-full",{variants:{variant:{default:"bg-foreground",primary:"bg-primary",secondary:"bg-secondary",accent:"bg-accent",success:"bg-success",warning:"bg-warning",error:"bg-error"}},defaultVariants:{variant:"primary"}}),Hyt=mt("block rounded-full border-2 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"border-foreground bg-background",primary:"border-primary bg-background",secondary:"border-secondary bg-background",accent:"border-accent bg-background",success:"border-success bg-background",warning:"border-warning bg-background",error:"border-error bg-background"},size:{sm:"h-3 w-3",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"primary",size:"default"}}),Sb=Cb.forwardRef(({className:e,size:t,trackVariant:r,rangeVariant:n,thumbVariant:o,thumbSize:a,showValueLabel:i=!1,valueLabelFormat:s,valueLabelClassName:l,value:c,defaultValue:u=[0],onValueChange:d,disabled:f,...p},m)=>{let[h,g]=Cb.useState(c||u||[0]);Cb.useEffect(()=>{c!==void 0&&g(c)},[c]);let v=O=>s?s(O):`${Math.round(O*100)/100}`,y=(O,L,A)=>(O-L)/(A-L)*100,x=Cb.useRef(null),C=p.min||0,b=p.max||100,w=p.step||1,S=O=>{let L=O.map(A=>{if(w<1){let U=w.toString().split(".")[1]?.length||0;return Math.round(A*Math.pow(10,U))/Math.pow(10,U)}return Math.round(A)});g(L),d&&d(L)},P=O=>{if(f)return;let L=x.current;if(!L)return;let A=L.getBoundingClientRect(),U=(O.clientX-A.left)/A.width,V=C+U*(b-C),R=Math.round(V/w)*w,I=Math.max(C,Math.min(b,R)),k=[...h];k[0]=I,S(k)},N=O=>L=>{if(f)return;L.preventDefault();let A=V=>{let R=x.current;if(!R)return;let I=R.getBoundingClientRect(),k=(V.clientX-I.left)/I.width,T=C+k*(b-C),D=Math.round(T/w)*w,F=Math.max(C,Math.min(b,D)),_=[...h];_[O]=F,S(_)},U=()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",U)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",U)};return(0,Hh.jsxs)("div",{className:"w-full",ref:m,...p,children:[i&&(0,Hh.jsx)("div",{className:B("flex justify-end mb-1 text-sm text-muted-foreground",l),children:h.length===1?(0,Hh.jsx)("span",{children:v(h[0])}):(0,Hh.jsxs)("span",{children:[v(h[0])," - ",v(h[h.length-1])]})}),(0,Hh.jsxs)("div",{className:B(Vyt({size:t}),e),"data-disabled":f?!0:void 0,children:[(0,Hh.jsx)("div",{ref:x,className:B(zyt({variant:r||o||"default"})),onClick:P,children:(0,Hh.jsx)("div",{className:B(Uyt({variant:n||o||"primary"})),style:{left:"0%",width:`${y(h[0],C,b)}%`}})}),h.map((O,L)=>(0,Hh.jsx)("div",{className:B(Hyt({variant:o||"primary",size:a})),style:{left:`${y(O,C,b)}%`,transform:"translateX(-50%)",position:"absolute",top:"50%",marginTop:a==="sm"?"-6px":a==="lg"?"-12px":"-8px",cursor:f?"not-allowed":"pointer"},onMouseDown:N(L),"aria-label":`Thumb ${L+1}`,tabIndex:f?-1:0,role:"slider","aria-valuemin":C,"aria-valuemax":b,"aria-valuenow":O,"aria-disabled":f},L))]})]})});Sb.displayName="MoonUISliderPro";var AIe=E(de(),1);var gm=E(de(),1);var pC=E(me(),1),Wz="Switch",[jyt,RHr]=Fn(Wz),[qyt,$yt]=jyt(Wz),IIe=gm.forwardRef((e,t)=>{let{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:i,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,p]=gm.useState(null),m=Gt(t,x=>p(x)),h=gm.useRef(!1),g=f?u||!!f.closest("form"):!0,[v,y]=qo({prop:o,defaultProp:a??!1,onChange:c,caller:Wz});return(0,pC.jsxs)(qyt,{scope:r,checked:v,disabled:s,children:[(0,pC.jsx)(ot.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":MIe(v),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:m,onClick:Ze(e.onClick,x=>{y(C=>!C),g&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})}),g&&(0,pC.jsx)(NIe,{control:f,bubbles:!h.current,name:n,value:l,checked:v,required:i,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});IIe.displayName=Wz;var RIe="SwitchThumb",kIe=gm.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,o=$yt(RIe,r);return(0,pC.jsx)(ot.span,{"data-state":MIe(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});kIe.displayName=RIe;var Wyt="SwitchBubbleInput",NIe=gm.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},a)=>{let i=gm.useRef(null),s=Gt(i,a),l=hI(r),c=gI(t);return gm.useEffect(()=>{let u=i.current;if(!u)return;let d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==r&&p){let m=new Event("click",{bubbles:n});p.call(u,r),u.dispatchEvent(m)}},[l,r,n]),(0,pC.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});NIe.displayName=Wyt;function MIe(e){return e?"checked":"unchecked"}var xQ=IIe,TIe=kIe;var jh=E(me(),1),qh=AIe.forwardRef(({className:e,size:t="md",variant:r="primary",loading:n,leftIcon:o,rightIcon:a,description:i,...s},l)=>(0,jh.jsxs)("div",{className:"inline-flex items-center gap-2",children:[o&&(0,jh.jsx)("span",{className:"text-muted-foreground",children:o}),(0,jh.jsxs)(xQ,{className:B("peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent 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 dark:data-[state=unchecked]:bg-gray-700/70 dark:focus-visible:ring-primary/40 dark:focus-visible:ring-offset-gray-950",t==="sm"&&"h-4 w-8",t==="md"&&"h-6 w-11",t==="lg"&&"h-7 w-14",r==="primary"&&"data-[state=checked]:bg-primary",r==="success"&&"data-[state=checked]:bg-success",r==="warning"&&"data-[state=checked]:bg-warning",r==="danger"&&"data-[state=checked]:bg-error",r==="secondary"&&"data-[state=checked]:bg-accent","data-[state=unchecked]:bg-input",n&&"opacity-80 cursor-wait",e),disabled:n||s.disabled,...s,ref:l,children:[n?(0,jh.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,jh.jsx)("div",{className:"h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-primary"})}):null,(0,jh.jsx)(TIe,{className:B("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",t==="sm"&&"h-3 w-3 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",t==="md"&&"h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",t==="lg"&&"h-6 w-6 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0")})]}),a&&(0,jh.jsx)("span",{className:"text-muted-foreground",children:a}),i&&(0,jh.jsx)("span",{className:"text-sm text-muted-foreground",children:i})]}));qh.displayName=xQ.displayName;var sc=E(de(),1);var $a=E(me(),1),Gz=mt("w-full caption-bottom text-sm",{variants:{variant:{default:"dark:text-gray-200",bordered:"border border-border dark:border-gray-700",striped:"dark:text-gray-200",card:"border border-border dark:border-gray-700 rounded-md shadow-sm dark:shadow-gray-900/20",minimal:"border-none dark:text-gray-200"},size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"default"}}),Kz=sc.forwardRef(({className:e,variant:t,size:r,loading:n,emptyContent:o,...a},i)=>{let s=t==="striped",l=sc.Children.map(a.children,c=>{if(sc.isValidElement(c)&&c.type==="tbody"){let u=c.props;return sc.cloneElement(c,{className:B(u.className,s&&"even:[&>tr]:bg-muted/50")})}return c});return(0,$a.jsxs)("div",{className:"relative w-full overflow-auto",children:[n&&(0,$a.jsx)("div",{className:"absolute inset-0 bg-background/60 flex items-center justify-center z-10",children:(0,$a.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),(0,$a.jsx)("table",{ref:i,className:B(Gz({variant:t,size:r}),n&&"opacity-70",e),...a,children:l})]})});Kz.displayName="TablePro";var Xz=sc.forwardRef(({className:e,...t},r)=>(0,$a.jsx)("thead",{ref:r,className:B("[&_tr]:border-b",e),...t}));Xz.displayName="TableHeaderPro";var Yz=sc.forwardRef(({className:e,emptyContent:t,emptyMessage:r="No data available",children:n,...o},a)=>{let i=sc.Children.count(n)>0;return(0,$a.jsx)("tbody",{ref:a,className:B("[&_tr:last-child]:border-0",e),...o,children:i?n:(0,$a.jsx)("tr",{children:(0,$a.jsx)("td",{colSpan:100,className:"h-24 text-center",children:t||(0,$a.jsx)("div",{className:"py-6 text-muted-foreground",children:(0,$a.jsx)("div",{className:"text-sm",children:r})})})})})});Yz.displayName="TableBodyPro";var Qz=sc.forwardRef(({className:e,...t},r)=>(0,$a.jsx)("tfoot",{ref:r,className:B("bg-primary text-primary-foreground font-medium",e),...t}));Qz.displayName="TableFooterPro";var Zz=sc.forwardRef(({className:e,...t},r)=>(0,$a.jsx)("tr",{ref:r,className:B("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Zz.displayName="TableRowPro";var Jz=sc.forwardRef(({className:e,sortable:t,sorted:r,onSort:n,children:o,...a},i)=>{let s=()=>t?r==="asc"?(0,$a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block",viewBox:"0 0 20 20",fill:"currentColor",children:(0,$a.jsx)("path",{fillRule:"evenodd",d:"M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):r==="desc"?(0,$a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block",viewBox:"0 0 20 20",fill:"currentColor",children:(0,$a.jsx)("path",{fillRule:"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})}):(0,$a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block opacity-30",viewBox:"0 0 20 20",fill:"currentColor",children:(0,$a.jsx)("path",{fillRule:"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})}):null;return(0,$a.jsx)("th",{ref:i,className:B("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t&&"cursor-pointer hover:text-foreground select-none",e),onClick:t?n:void 0,...a,children:(0,$a.jsxs)("div",{className:"flex items-center",children:[o,t&&s()]})})});Jz.displayName="TableHeadPro";var e5=sc.forwardRef(({className:e,...t},r)=>(0,$a.jsx)("td",{ref:r,className:B("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));e5.displayName="TableCellPro";var t5=sc.forwardRef(({className:e,...t},r)=>(0,$a.jsx)("caption",{ref:r,className:B("mt-4 text-sm text-muted-foreground",e),...t}));t5.displayName="TableCaptionPro";var o5=E(de(),1);var Vv=E(de(),1);var Bv=E(me(),1),r5="Tabs",[Kyt,zHr]=Fn(r5,[LI]),LIe=LI(),[Xyt,bQ]=Kyt(r5),EIe=Vv.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=Af(s),[d,f]=qo({prop:n,onChange:o,defaultProp:a??"",caller:r5});return(0,Bv.jsx)(Xyt,{scope:r,baseId:jn(),value:d,onValueChange:f,orientation:i,dir:u,activationMode:l,children:(0,Bv.jsx)(ot.div,{dir:u,"data-orientation":i,...c,ref:t})})});EIe.displayName=r5;var DIe="TabsList",OIe=Vv.forwardRef((e,t)=>{let{__scopeTabs:r,loop:n=!0,...o}=e,a=bQ(DIe,r),i=LIe(r);return(0,Bv.jsx)(pz,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:n,children:(0,Bv.jsx)(ot.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});OIe.displayName=DIe;var _Ie="TabsTrigger",FIe=Vv.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,disabled:o=!1,...a}=e,i=bQ(_Ie,r),s=LIe(r),l=zIe(i.baseId,n),c=UIe(i.baseId,n),u=n===i.value;return(0,Bv.jsx)(mz,{asChild:!0,...s,focusable:!o,active:u,children:(0,Bv.jsx)(ot.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...a,ref:t,onMouseDown:Ze(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?i.onValueChange(n):d.preventDefault()}),onKeyDown:Ze(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(n)}),onFocus:Ze(e.onFocus,()=>{let d=i.activationMode!=="manual";!u&&!o&&d&&i.onValueChange(n)})})})});FIe.displayName=_Ie;var BIe="TabsContent",VIe=Vv.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,forceMount:o,children:a,...i}=e,s=bQ(BIe,r),l=zIe(s.baseId,n),c=UIe(s.baseId,n),u=n===s.value,d=Vv.useRef(u);return Vv.useEffect(()=>{let f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),(0,Bv.jsx)(Ro,{present:o||u,children:({present:f})=>(0,Bv.jsx)(ot.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&a})})});VIe.displayName=BIe;function zIe(e,t){return`${e}-trigger-${t}`}function UIe(e,t){return`${e}-content-${t}`}var n5=EIe,VI=OIe,zI=FIe,mC=VIe;var a5=E(me(),1),Uu=n5,Xc=o5.forwardRef(({className:e,...t},r)=>(0,a5.jsx)(VI,{ref:r,className:B("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Xc.displayName=VI.displayName;var ko=o5.forwardRef(({className:e,...t},r)=>(0,a5.jsx)(zI,{ref:r,className:B("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));ko.displayName=zI.displayName;var ua=o5.forwardRef(({className:e,...t},r)=>(0,a5.jsx)(mC,{ref:r,className:B("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ua.displayName=mC.displayName;var ll=E(de(),1);var mn=E(me(),1),Yyt={fade:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},slide:{initial:{x:20,opacity:0},animate:{x:0,opacity:1},exit:{x:-20,opacity:0}},scale:{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:1.05,opacity:0}},flip:{initial:{rotateY:90,opacity:0},animate:{rotateY:0,opacity:1},exit:{rotateY:-90,opacity:0}},morph:{initial:{scale:.8,opacity:0,filter:"blur(10px)"},animate:{scale:1,opacity:1,filter:"blur(0px)"},exit:{scale:1.2,opacity:0,filter:"blur(10px)"}}},i5=ll.forwardRef(({variant:e="default",animationMode:t="fade",orientation:r="horizontal",closeable:n=!1,addable:o=!1,draggable:a=!1,persistKey:i,urlSync:s=!1,lazy:l=!1,items:c=[],onTabsChange:u,onTabClose:d,onTabAdd:f,loading:p=!1,swipeable:m=!1,scrollable:h=!1,onAnalytics:g,onBeforeChange:v,shortcuts:y=!1,maxTabs:x,groups:C,className:b,children:w,value:S,defaultValue:P,onValueChange:N,...O},L)=>{let[A,U]=ll.useState(c),[V,R]=ll.useState(()=>{if(i&&typeof window<"u"){let z=localStorage.getItem(`tabs-${i}`);if(z)return JSON.parse(z).activeTab||P||A[0]?.value}if(s&&typeof window<"u"){let G=new URLSearchParams(window.location.search).get("tab");if(G)return G}return P||A[0]?.value}),[I,k]=ll.useState(new Set),[T,D]=ll.useState(!1),F=ll.useRef(null),_=S!==void 0?S:V,M=ll.useCallback(async z=>{if(!(p||T)){if(v){D(!0);let G=await v(_||"",z);if(D(!1),!G)return}if(R(z),N?.(z),l&&!I.has(z)&&k(G=>new Set([...G,z])),g?.("tab_switch",{from:_,to:z}),i&&typeof window<"u"&&localStorage.setItem(`tabs-${i}`,JSON.stringify({activeTab:z,tabs:A})),s&&typeof window<"u"){let G=new URLSearchParams(window.location.search);G.set("tab",z),window.history.replaceState({},"",`${window.location.pathname}?${G}`)}}},[_,p,T,v,N,l,I,g,i,A,s]),j=ll.useCallback((z,G)=>{G.stopPropagation();let X=A.filter(Q=>Q.value!==z);U(X),u?.(X),d?.(z),g?.("tab_close",{value:z}),_===z&&X.length>0&&M(X[0].value)},[A,_,u,d,g,M]),H=ll.useCallback(()=>{if(x&&A.length>=x){g?.("tab_add_blocked",{reason:"max_tabs"});return}f?.(),g?.("tab_add",{count:A.length+1})},[A.length,x,f,g]);ll.useEffect(()=>{if(!y)return;let z=G=>{if((G.metaKey||G.ctrlKey)&&G.key>="1"&&G.key<="9"){G.preventDefault();let X=parseInt(G.key)-1;A[X]&&M(A[X].value)}(G.metaKey||G.ctrlKey)&&G.key==="w"&&n&&(G.preventDefault(),A.find(Q=>Q.value===_)?.closeable!==!1&&j(_||"",new MouseEvent("click"))),(G.metaKey||G.ctrlKey)&&G.key==="t"&&o&&(G.preventDefault(),H())};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[y,A,_,n,o,M,j,H]);let q=()=>{F.current&&F.current.scrollBy({left:-200,behavior:"smooth"})},W=()=>{F.current&&F.current.scrollBy({left:200,behavior:"smooth"})};return(0,mn.jsxs)("div",{className:B("relative w-full",e==="gradient"&&"bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg p-1",e==="glassmorphism"&&"backdrop-blur-xl bg-white/10 dark:bg-black/10 border border-white/20 dark:border-white/10 rounded-lg p-1",e==="neon"&&"bg-black rounded-lg p-1 shadow-[0_0_20px_rgba(139,92,246,0.3)]",b),children:[p&&(0,mn.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-lg",children:(0,mn.jsx)(Sr,{className:"h-6 w-6 animate-spin text-primary"})}),(0,mn.jsx)(n5,{ref:L,value:_,onValueChange:M,orientation:r,...O,children:A.length>0?(0,mn.jsxs)(mn.Fragment,{children:[(0,mn.jsxs)("div",{className:B("relative flex items-center",r==="vertical"&&"flex-col items-start"),children:[h&&r==="horizontal"&&(0,mn.jsx)(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 absolute left-0 z-10",onClick:q,children:(0,mn.jsx)(oa,{className:"h-4 w-4"})}),(0,mn.jsx)("div",{ref:F,className:B("flex-1 overflow-x-auto scrollbar-hide",h&&r==="horizontal"&&"mx-10"),children:(0,mn.jsxs)(VI,{className:B("flex items-center gap-1",r==="vertical"&&"flex-col items-start w-full",e==="underline"&&"border-b border-border"),children:[A.map((z,G)=>(0,mn.jsxs)(ie.div,{layout:!0,drag:a?r==="horizontal"?"x":"y":!1,dragConstraints:{left:0,right:0,top:0,bottom:0},dragElastic:.2,whileDrag:{scale:1.05,zIndex:50},className:"relative",children:[(0,mn.jsxs)(zI,{value:z.value,disabled:z.disabled,className:B("relative inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e==="default"&&"data-[state=active]:bg-background data-[state=active]:shadow-sm",e==="pills"&&"rounded-full data-[state=active]:bg-primary data-[state=active]:text-primary-foreground",e==="underline"&&"rounded-none border-b-2 border-transparent data-[state=active]:border-primary",e==="cards"&&"bg-muted/50 data-[state=active]:bg-background data-[state=active]:shadow-md",e==="minimal"&&"hover:bg-muted/50 data-[state=active]:bg-transparent data-[state=active]:underline",e==="gradient"&&"data-[state=active]:bg-gradient-to-r data-[state=active]:from-primary data-[state=active]:to-secondary data-[state=active]:text-white",e==="glassmorphism"&&"backdrop-blur-md data-[state=active]:bg-white/20 dark:data-[state=active]:bg-white/10",e==="neon"&&"text-purple-400 data-[state=active]:text-white data-[state=active]:shadow-[0_0_10px_rgba(139,92,246,0.8)]",r==="vertical"&&"w-full justify-start"),children:[z.icon&&(0,mn.jsx)("span",{className:"mr-2",children:z.icon}),z.label,z.badge&&(0,mn.jsx)("span",{className:"ml-2",children:z.badge}),n&&z.closeable!==!1&&(0,mn.jsx)("button",{onClick:X=>j(z.value,X),className:"ml-2 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:(0,mn.jsx)(Zt,{className:"h-3 w-3"})})]}),_===z.value&&t!=="none"&&(0,mn.jsx)(ie.div,{layoutId:"active-tab",className:B("absolute inset-0 -z-10",e==="default"&&"bg-background shadow-sm rounded-md",e==="pills"&&"bg-primary rounded-full",e==="underline"&&"bottom-0 h-0.5 bg-primary"),transition:{type:"spring",stiffness:500,damping:30}})]},z.value)),o&&(0,mn.jsx)(ne,{variant:"ghost",size:"sm",onClick:H,className:"h-8 w-8 p-0 ml-2",disabled:x?A.length>=x:!1,children:(0,mn.jsx)(si,{className:"h-4 w-4"})})]})}),h&&r==="horizontal"&&(0,mn.jsx)(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 absolute right-0 z-10",onClick:W,children:(0,mn.jsx)(Bn,{className:"h-4 w-4"})}),A.length>5&&(0,mn.jsxs)(Pr,{children:[(0,mn.jsx)(Ir,{asChild:!0,children:(0,mn.jsx)(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 ml-2",children:(0,mn.jsx)(za,{className:"h-4 w-4"})})}),(0,mn.jsx)(xr,{align:"end",children:A.slice(5).map(z=>(0,mn.jsxs)(Fe,{onClick:()=>M(z.value),children:[z.icon&&(0,mn.jsx)("span",{className:"mr-2",children:z.icon}),z.label]},z.value))})]})]}),t!=="none"?(0,mn.jsx)(Dt,{mode:"wait",children:A.map(z=>_!==z.value?null:(0,mn.jsx)(mC,{value:z.value,forceMount:!0,className:"mt-4 focus-visible:outline-none",children:(0,mn.jsx)(ie.div,{initial:"initial",animate:"animate",exit:"exit",variants:Yyt[t],transition:{duration:.3},children:z.content||w})},z.value))}):A.map(z=>(0,mn.jsx)(mC,{value:z.value,className:"mt-4 focus-visible:outline-none",children:z.content||w},z.value))]}):w})]})});i5.displayName="MoonUITabsPro";var wQ=ll.forwardRef(({className:e,...t},r)=>(0,mn.jsx)(VI,{ref:r,className:B("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));wQ.displayName="MoonUITabsListPro";var CQ=ll.forwardRef(({className:e,...t},r)=>(0,mn.jsx)(zI,{ref:r,className:B("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));CQ.displayName="MoonUITabsTriggerPro";var SQ=ll.forwardRef(({className:e,...t},r)=>(0,mn.jsx)(mC,{ref:r,className:B("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));SQ.displayName="MoonUITabsContentPro";var jIe=E(de(),1);var qIe=E(me(),1),Yc=jIe.default.forwardRef(({className:e,...t},r)=>(0,qIe.jsx)("textarea",{className:B("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Yc.displayName="MoonUITextareaPro";var Uv=E(de(),1);var Ur=E(de(),1),WIe=E(fh(),1);var co=E(me(),1),NQ="ToastProvider",[MQ,Qyt,Zyt]=ah("Toast"),[GIe,ljr]=Fn("Toast",[Zyt]),[Jyt,l5]=GIe(NQ),ext=e=>{let{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:i}=e,[s,l]=Ur.useState(null),[c,u]=Ur.useState(0),d=Ur.useRef(!1),f=Ur.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${NQ}\`. Expected non-empty \`string\`.`),(0,co.jsx)(MQ.Provider,{scope:t,children:(0,co.jsx)(Jyt,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:a,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:Ur.useCallback(()=>u(p=>p+1),[]),onToastRemove:Ur.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:i})})};ext.displayName=NQ;var KIe="ToastViewport",txt=["F8"],IQ="toast.viewportPause",RQ="toast.viewportResume",XIe=Ur.forwardRef((e,t)=>{let{__scopeToast:r,hotkey:n=txt,label:o="Notifications ({hotkey})",...a}=e,i=l5(KIe,r),s=Qyt(r),l=Ur.useRef(null),c=Ur.useRef(null),u=Ur.useRef(null),d=Ur.useRef(null),f=Gt(t,d,i.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=i.toastCount>0;Ur.useEffect(()=>{let g=v=>{n.length!==0&&n.every(x=>v[x]||v.code===x)&&d.current?.focus()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),Ur.useEffect(()=>{let g=l.current,v=d.current;if(m&&g&&v){let y=()=>{if(!i.isClosePausedRef.current){let w=new CustomEvent(IQ);v.dispatchEvent(w),i.isClosePausedRef.current=!0}},x=()=>{if(i.isClosePausedRef.current){let w=new CustomEvent(RQ);v.dispatchEvent(w),i.isClosePausedRef.current=!1}},C=w=>{!g.contains(w.relatedTarget)&&x()},b=()=>{g.contains(document.activeElement)||x()};return g.addEventListener("focusin",y),g.addEventListener("focusout",C),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",b),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",C),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",b),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[m,i.isClosePausedRef]);let h=Ur.useCallback(({tabbingDirection:g})=>{let y=s().map(x=>{let C=x.ref.current,b=[C,...mxt(C)];return g==="forwards"?b:b.reverse()});return(g==="forwards"?y.reverse():y).flat()},[s]);return Ur.useEffect(()=>{let g=d.current;if(g){let v=y=>{let x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){let b=document.activeElement,w=y.shiftKey;if(y.target===g&&w){c.current?.focus();return}let N=h({tabbingDirection:w?"backwards":"forwards"}),O=N.findIndex(L=>L===b);PQ(N.slice(O+1))?y.preventDefault():w?c.current?.focus():u.current?.focus()}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[s,h]),(0,co.jsxs)(b0e,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&(0,co.jsx)(kQ,{ref:c,onFocusFromOutsideViewport:()=>{let g=h({tabbingDirection:"forwards"});PQ(g)}}),(0,co.jsx)(MQ.Slot,{scope:r,children:(0,co.jsx)(ot.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,co.jsx)(kQ,{ref:u,onFocusFromOutsideViewport:()=>{let g=h({tabbingDirection:"backwards"});PQ(g)}})]})});XIe.displayName=KIe;var YIe="ToastFocusProxy",kQ=Ur.forwardRef((e,t)=>{let{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,a=l5(YIe,r);return(0,co.jsx)(_L,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{let s=i.relatedTarget;!a.viewport?.contains(s)&&n()}})});kQ.displayName=YIe;var aE="Toast",rxt="toast.swipeStart",nxt="toast.swipeMove",oxt="toast.swipeCancel",axt="toast.swipeEnd",QIe=Ur.forwardRef((e,t)=>{let{forceMount:r,open:n,defaultOpen:o,onOpenChange:a,...i}=e,[s,l]=qo({prop:n,defaultProp:o??!0,onChange:a,caller:aE});return(0,co.jsx)(Ro,{present:r||s,children:(0,co.jsx)(lxt,{open:s,...i,ref:t,onClose:()=>l(!1),onPause:qn(e.onPause),onResume:qn(e.onResume),onSwipeStart:Ze(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ze(e.onSwipeMove,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Ze(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ze(e.onSwipeEnd,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});QIe.displayName=aE;var[ixt,sxt]=GIe(aE,{onClose(){}}),lxt=Ur.forwardRef((e,t)=>{let{__scopeToast:r,type:n="foreground",duration:o,open:a,onClose:i,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=l5(aE,r),[g,v]=Ur.useState(null),y=Gt(t,V=>v(V)),x=Ur.useRef(null),C=Ur.useRef(null),b=o||h.duration,w=Ur.useRef(0),S=Ur.useRef(b),P=Ur.useRef(0),{onToastAdd:N,onToastRemove:O}=h,L=qn(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),i()}),A=Ur.useCallback(V=>{!V||V===1/0||(window.clearTimeout(P.current),w.current=new Date().getTime(),P.current=window.setTimeout(L,V))},[L]);Ur.useEffect(()=>{let V=h.viewport;if(V){let R=()=>{A(S.current),c?.()},I=()=>{let k=new Date().getTime()-w.current;S.current=S.current-k,window.clearTimeout(P.current),l?.()};return V.addEventListener(IQ,I),V.addEventListener(RQ,R),()=>{V.removeEventListener(IQ,I),V.removeEventListener(RQ,R)}}},[h.viewport,b,l,c,A]),Ur.useEffect(()=>{a&&!h.isClosePausedRef.current&&A(b)},[a,b,h.isClosePausedRef,A]),Ur.useEffect(()=>(N(),()=>O()),[N,O]);let U=Ur.useMemo(()=>g?oRe(g):null,[g]);return h.viewport?(0,co.jsxs)(co.Fragment,{children:[U&&(0,co.jsx)(cxt,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),(0,co.jsx)(ixt,{scope:r,onClose:L,children:WIe.createPortal((0,co.jsx)(MQ.ItemSlot,{scope:r,children:(0,co.jsx)(x0e,{asChild:!0,onEscapeKeyDown:Ze(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||L(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,co.jsx)(ot.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ze(e.onKeyDown,V=>{V.key==="Escape"&&(s?.(V.nativeEvent),V.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,L()))}),onPointerDown:Ze(e.onPointerDown,V=>{V.button===0&&(x.current={x:V.clientX,y:V.clientY})}),onPointerMove:Ze(e.onPointerMove,V=>{if(!x.current)return;let R=V.clientX-x.current.x,I=V.clientY-x.current.y,k=!!C.current,T=["left","right"].includes(h.swipeDirection),D=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,F=T?D(0,R):0,_=T?0:D(0,I),M=V.pointerType==="touch"?10:2,j={x:F,y:_},H={originalEvent:V,delta:j};k?(C.current=j,s5(nxt,d,H,{discrete:!1})):$Ie(j,h.swipeDirection,M)?(C.current=j,s5(rxt,u,H,{discrete:!1}),V.target.setPointerCapture(V.pointerId)):(Math.abs(R)>M||Math.abs(I)>M)&&(x.current=null)}),onPointerUp:Ze(e.onPointerUp,V=>{let R=C.current,I=V.target;if(I.hasPointerCapture(V.pointerId)&&I.releasePointerCapture(V.pointerId),C.current=null,x.current=null,R){let k=V.currentTarget,T={originalEvent:V,delta:R};$Ie(R,h.swipeDirection,h.swipeThreshold)?s5(axt,p,T,{discrete:!0}):s5(oxt,f,T,{discrete:!0}),k.addEventListener("click",D=>D.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),cxt=e=>{let{__scopeToast:t,children:r,...n}=e,o=l5(aE,t),[a,i]=Ur.useState(!1),[s,l]=Ur.useState(!1);return fxt(()=>i(!0)),Ur.useEffect(()=>{let c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:(0,co.jsx)(Bd,{asChild:!0,children:(0,co.jsx)(_L,{...n,children:a&&(0,co.jsxs)(co.Fragment,{children:[o.label," ",r]})})})},uxt="ToastTitle",ZIe=Ur.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e;return(0,co.jsx)(ot.div,{...n,ref:t})});ZIe.displayName=uxt;var dxt="ToastDescription",JIe=Ur.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e;return(0,co.jsx)(ot.div,{...n,ref:t})});JIe.displayName=dxt;var eRe="ToastAction",tRe=Ur.forwardRef((e,t)=>{let{altText:r,...n}=e;return r.trim()?(0,co.jsx)(nRe,{altText:r,asChild:!0,children:(0,co.jsx)(TQ,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${eRe}\`. Expected non-empty \`string\`.`),null)});tRe.displayName=eRe;var rRe="ToastClose",TQ=Ur.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e,o=sxt(rRe,r);return(0,co.jsx)(nRe,{asChild:!0,children:(0,co.jsx)(ot.button,{type:"button",...n,ref:t,onClick:Ze(e.onClick,o.onClose)})})});TQ.displayName=rRe;var nRe=Ur.forwardRef((e,t)=>{let{__scopeToast:r,altText:n,...o}=e;return(0,co.jsx)(ot.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function oRe(e){let t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),pxt(n)){let o=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!o)if(a){let i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...oRe(n))}}),t}function s5(e,t,r,{discrete:n}){let o=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?dP(o,a):o.dispatchEvent(a)}var $Ie=(e,t,r=0)=>{let n=Math.abs(e.x),o=Math.abs(e.y),a=n>o;return t==="left"||t==="right"?a&&n>r:!a&&o>r};function fxt(e=()=>{}){let t=qn(e);Un(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function pxt(e){return e.nodeType===e.ELEMENT_NODE}function mxt(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function PQ(e){let t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var AQ=XIe,LQ=QIe,EQ=ZIe,DQ=JIe,OQ=tRe,_Q=TQ;var zv=E(me(),1);var gxt=Uv.forwardRef(({className:e,...t},r)=>(0,zv.jsx)(AQ,{ref:r,className:B("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));gxt.displayName=AQ.displayName;var vxt=mt("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-8 shadow-sm transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-900/20 dark:text-green-100",warning:"border-orange-200 bg-orange-50 text-orange-900 dark:border-orange-800 dark:bg-orange-900/20 dark:text-orange-100",info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-900/20 dark:text-blue-100"}},defaultVariants:{variant:"default"}}),u5=Uv.forwardRef(({className:e,variant:t,...r},n)=>(0,zv.jsx)(LQ,{ref:n,className:B(vxt({variant:t}),e),...r}));u5.displayName=LQ.displayName;var yxt=Uv.forwardRef(({className:e,...t},r)=>(0,zv.jsx)(OQ,{ref:r,className:B("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));yxt.displayName=OQ.displayName;var xxt=Uv.forwardRef(({className:e,...t},r)=>(0,zv.jsx)(_Q,{ref:r,className:B("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,zv.jsx)(Zt,{className:"h-4 w-4"})}));xxt.displayName=_Q.displayName;var bxt=Uv.forwardRef(({className:e,...t},r)=>(0,zv.jsx)(EQ,{ref:r,className:B("text-sm font-semibold [&+div]:text-xs",e),...t}));bxt.displayName=EQ.displayName;var wxt=Uv.forwardRef(({className:e,...t},r)=>(0,zv.jsx)(DQ,{ref:r,className:B("text-sm opacity-90",e),...t}));wxt.displayName=DQ.displayName;var Cxt=5,Sxt=1e6,FQ=new Map,aRe=e=>{if(FQ.has(e))return;let t=setTimeout(()=>{FQ.delete(e),c5({type:"REMOVE_TOAST",toastId:e})},Sxt);FQ.set(e,t)},Pxt=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Cxt)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{let{toastId:r}=t;return r?aRe(r):e.toasts.forEach(n=>{aRe(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)};default:return e}},Ixt=[],BQ={toasts:[]},Rxt=0;function c5(e){BQ=Pxt(BQ,e),Ixt.forEach(t=>{t(BQ)})}function $d({...e}){let t=`toast-${Date.now()}-${++Rxt}`,r=o=>c5({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>c5({type:"DISMISS_TOAST",toastId:t});return c5({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}var dRe=E(de(),1);var sRe=E(it(),1);var mjr=!!(typeof window<"u"&&window.document&&window.document.createElement);function ze(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}var np=E(it(),1);var iRe=E(it(),1),En=globalThis?.document?iRe.useLayoutEffect:()=>{};var d5=E(it(),1);var kxt=np[" useInsertionEffect ".trim().toString()]||En;function $n({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[o,a,i]=Nxt({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:o;{let u=np.useRef(e!==void 0);np.useEffect(()=>{let d=u.current;d!==s&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}let c=np.useCallback(u=>{if(s){let d=Mxt(u)?u(e):u;d!==e&&i.current?.(d)}else a(u)},[s,e,a,i]);return[l,c]}function Nxt({defaultProp:e,onChange:t}){let[r,n]=np.useState(e),o=np.useRef(r),a=np.useRef(t);return kxt(()=>{a.current=t},[t]),np.useEffect(()=>{o.current!==r&&(a.current?.(r),o.current=r)},[r,o]),[r,n,a]}function Mxt(e){return typeof e=="function"}var yjr=Symbol("RADIX:SYNC_STATE");var lRe=E(Mr(),1),cRe="Toggle",uRe=sRe.forwardRef((e,t)=>{let{pressed:r,defaultPressed:n,onPressedChange:o,...a}=e,[i,s]=$n({prop:r,onChange:o,defaultProp:n??!1,caller:cRe});return(0,lRe.jsx)(et.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:ze(e.onClick,()=>{e.disabled||s(!i)})})});uRe.displayName=cRe;var VQ=uRe;var vm=E(me(),1),f5=mt("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"moonui-toggle-default bg-transparent hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:border-input dark:hover:bg-accent dark:hover:text-accent-foreground dark:data-[state=on]:bg-accent dark:data-[state=on]:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground data-[state=on]:bg-transparent data-[state=on]:text-accent-foreground dark:hover:bg-accent dark:hover:text-accent-foreground dark:data-[state=on]:text-accent-foreground",primary:"bg-transparent hover:bg-primary/10 hover:text-primary data-[state=on]:bg-primary data-[state=on]:text-primary-foreground dark:hover:bg-primary/20 dark:hover:text-primary dark:data-[state=on]:bg-primary dark:data-[state=on]:text-primary-foreground",secondary:"moonui-toggle-secondary bg-transparent hover:bg-secondary/10 hover:text-secondary data-[state=on]:bg-secondary data-[state=on]:text-secondary-foreground",success:"bg-transparent hover:bg-success/10 hover:text-success data-[state=on]:bg-success data-[state=on]:text-success-foreground dark:hover:bg-success/20 dark:hover:text-success dark:data-[state=on]:bg-success dark:data-[state=on]:text-success-foreground",warning:"bg-transparent hover:bg-warning/10 hover:text-warning data-[state=on]:bg-warning data-[state=on]:text-warning-foreground dark:hover:bg-warning/20 dark:hover:text-warning dark:data-[state=on]:bg-warning dark:data-[state=on]:text-warning-foreground",danger:"bg-transparent hover:bg-destructive/10 hover:text-destructive data-[state=on]:bg-destructive data-[state=on]:text-destructive-foreground dark:hover:bg-destructive/20 dark:hover:text-destructive dark:data-[state=on]:bg-destructive dark:data-[state=on]:text-destructive-foreground",gradient:"bg-transparent hover:bg-gradient-to-r hover:from-purple-500/10 hover:to-pink-500/10 hover:text-purple-600 data-[state=on]:bg-gradient-to-r data-[state=on]:from-purple-600 data-[state=on]:to-pink-600 data-[state=on]:text-white dark:hover:from-purple-500/20 dark:hover:to-pink-500/20 dark:hover:text-purple-400 dark:data-[state=on]:from-purple-600 dark:data-[state=on]:to-pink-600 dark:data-[state=on]:text-white"},size:{xs:"min-h-7 px-2 py-1 text-xs",sm:"min-h-8 px-2.5 py-1.5 text-xs",default:"min-h-9 px-3 py-2",md:"min-h-10 px-4 py-2.5",lg:"min-h-11 px-6 py-3",xl:"min-h-12 px-8 py-3.5 text-base"},shape:{default:"rounded-md",square:"rounded-none",rounded:"rounded-lg",pill:"rounded-full"}},defaultVariants:{variant:"default",size:"default",shape:"default"}}),p5=dRe.forwardRef(({className:e,variant:t,size:r,shape:n,loading:o,badge:a,badgeVariant:i="default",iconOn:s,iconOff:l,iconPosition:c="left",children:u,pressed:d,onPressedChange:f,defaultPressed:p,...m},h)=>{let g=d?s:l;return(0,vm.jsx)(VQ,{ref:h,className:B(f5({variant:t,size:r,shape:n}),e),pressed:d,onPressedChange:f,defaultPressed:p,disabled:o||m.disabled,...m,children:o?(0,vm.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,vm.jsx)("div",{className:"h-3 w-3 animate-spin rounded-full border-2 border-current border-t-transparent"}),u&&(0,vm.jsx)("span",{className:"text-center",children:u})]}):(0,vm.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[g&&c==="left"&&(0,vm.jsx)("span",{className:"flex-shrink-0",children:g}),u&&(0,vm.jsx)("span",{className:"text-center",children:u}),g&&c==="right"&&(0,vm.jsx)("span",{className:"flex-shrink-0",children:g}),a!==void 0&&(0,vm.jsx)("span",{className:B("ml-1 inline-flex items-center justify-center rounded-full px-1.5 text-xs font-semibold",i==="default"&&"bg-muted text-muted-foreground",i==="primary"&&"bg-primary text-primary-foreground",i==="secondary"&&"bg-secondary text-secondary-foreground dark:bg-accent dark:text-accent-foreground",i==="success"&&"bg-success text-success-foreground",i==="warning"&&"bg-warning text-warning-foreground",i==="danger"&&"bg-destructive text-destructive-foreground"),children:a})]})})});p5.displayName=VQ.displayName;var Uke=E(de(),1);var Li=E(it(),1);var ju=E(it(),1);var mRe=["top","right","bottom","left"];var $h=Math.min,Qc=Math.max,sE=Math.round,lE=Math.floor,ym=e=>({x:e,y:e}),Axt={left:"right",right:"left",bottom:"top",top:"bottom"},Lxt={start:"end",end:"start"};function h5(e,t,r){return Qc(e,$h(t,r))}function Wh(e,t){return typeof e=="function"?e(t):e}function Gh(e){return e.split("-")[0]}function hC(e){return e.split("-")[1]}function g5(e){return e==="x"?"y":"x"}function v5(e){return e==="y"?"height":"width"}var Ext=new Set(["top","bottom"]);function xm(e){return Ext.has(Gh(e))?"y":"x"}function y5(e){return g5(xm(e))}function hRe(e,t,r){r===void 0&&(r=!1);let n=hC(e),o=y5(e),a=v5(o),i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=iE(i)),[i,iE(i)]}function gRe(e){let t=iE(e);return[m5(e),t,m5(t)]}function m5(e){return e.replace(/start|end/g,t=>Lxt[t])}var fRe=["left","right"],pRe=["right","left"],Dxt=["top","bottom"],Oxt=["bottom","top"];function _xt(e,t,r){switch(e){case"top":case"bottom":return r?t?pRe:fRe:t?fRe:pRe;case"left":case"right":return t?Dxt:Oxt;default:return[]}}function vRe(e,t,r,n){let o=hC(e),a=_xt(Gh(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(m5)))),a}function iE(e){return e.replace(/left|right|bottom|top/g,t=>Axt[t])}function Fxt(e){return{top:0,right:0,bottom:0,left:0,...e}}function zQ(e){return typeof e!="number"?Fxt(e):{top:e,right:e,bottom:e,left:e}}function gC(e){let{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function yRe(e,t,r){let{reference:n,floating:o}=e,a=xm(t),i=y5(t),s=v5(i),l=Gh(t),c=a==="y",u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[s]/2-o[s]/2,p;switch(l){case"top":p={x:u,y:n.y-o.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y}}switch(hC(t)){case"start":p[i]-=f*(r&&c?-1:1);break;case"end":p[i]+=f*(r&&c?-1:1);break}return p}var wRe=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=yRe(c,n,l),f=n,p={},m=0;for(let h=0;h<s.length;h++){let{name:g,fn:v}=s[h],{x:y,y:x,data:C,reset:b}=await v({x:u,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=y??u,d=x??d,p={...p,[g]:{...p[g],...C}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(f=b.placement),b.rects&&(c=b.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:u,y:d}=yRe(c,f,l)),h=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}};async function UI(e,t){var r;t===void 0&&(t={});let{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Wh(t,e),m=zQ(p),g=s[f?d==="floating"?"reference":"floating":d],v=gC(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(g)))==null||r?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),C=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},b=gC(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:x,strategy:l}):y);return{top:(v.top-b.top+m.top)/C.y,bottom:(b.bottom-v.bottom+m.bottom)/C.y,left:(v.left-b.left+m.left)/C.x,right:(b.right-v.right+m.right)/C.x}}var CRe=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Wh(e,t)||{};if(c==null)return{};let d=zQ(u),f={x:r,y:n},p=y5(o),m=v5(p),h=await i.getDimensions(c),g=p==="y",v=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",C=a.reference[m]+a.reference[p]-f[p]-a.floating[m],b=f[p]-a.reference[p],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c)),S=w?w[x]:0;(!S||!await(i.isElement==null?void 0:i.isElement(w)))&&(S=s.floating[x]||a.floating[m]);let P=C/2-b/2,N=S/2-h[m]/2-1,O=$h(d[v],N),L=$h(d[y],N),A=O,U=S-h[m]-L,V=S/2-h[m]/2+P,R=h5(A,V,U),I=!l.arrow&&hC(o)!=null&&V!==R&&a.reference[m]/2-(V<A?O:L)-h[m]/2<0,k=I?V<A?V-A:V-U:0;return{[p]:f[p]+k,data:{[p]:R,centerOffset:V-R-k,...I&&{alignmentOffset:k}},reset:I}}});var SRe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;let{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=Wh(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};let v=Gh(o),y=xm(s),x=Gh(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),b=f||(x||!h?[iE(s)]:gRe(s)),w=m!=="none";!f&&w&&b.push(...vRe(s,h,m,C));let S=[s,...b],P=await UI(t,g),N=[],O=((n=a.flip)==null?void 0:n.overflows)||[];if(u&&N.push(P[v]),d){let V=hRe(o,i,C);N.push(P[V[0]],P[V[1]])}if(O=[...O,{placement:o,overflows:N}],!N.every(V=>V<=0)){var L,A;let V=(((L=a.flip)==null?void 0:L.index)||0)+1,R=S[V];if(R&&(!(d==="alignment"?y!==xm(R):!1)||O.every(T=>xm(T.placement)===y?T.overflows[0]>0:!0)))return{data:{index:V,overflows:O},reset:{placement:R}};let I=(A=O.filter(k=>k.overflows[0]<=0).sort((k,T)=>k.overflows[1]-T.overflows[1])[0])==null?void 0:A.placement;if(!I)switch(p){case"bestFit":{var U;let k=(U=O.filter(T=>{if(w){let D=xm(T.placement);return D===y||D==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(D=>D>0).reduce((D,F)=>D+F,0)]).sort((T,D)=>T[1]-D[1])[0])==null?void 0:U[0];k&&(I=k);break}case"initialPlacement":I=s;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function xRe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bRe(e){return mRe.some(t=>e[t]>=0)}var PRe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...o}=Wh(e,t);switch(n){case"referenceHidden":{let a=await UI(t,{...o,elementContext:"reference"}),i=xRe(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:bRe(i)}}}case"escaped":{let a=await UI(t,{...o,altBoundary:!0}),i=xRe(a,r.floating);return{data:{escapedOffsets:i,escaped:bRe(i)}}}default:return{}}}}};var IRe=new Set(["left","top"]);async function Bxt(e,t){let{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Gh(r),s=hC(r),l=xm(r)==="y",c=IRe.has(i)?-1:1,u=a&&l?-1:1,d=Wh(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}var RRe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:o,y:a,placement:i,middlewareData:s}=t,l=await Bxt(t,e);return i===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},kRe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:g=>{let{x:v,y}=g;return{x:v,y}}},...l}=Wh(e,t),c={x:r,y:n},u=await UI(t,l),d=xm(Gh(o)),f=g5(d),p=c[f],m=c[d];if(a){let g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=p+u[g],x=p-u[v];p=h5(y,p,x)}if(i){let g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=m+u[g],x=m-u[v];m=h5(y,m,x)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[f]:a,[d]:i}}}}}},NRe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Wh(e,t),u={x:r,y:n},d=xm(o),f=g5(d),p=u[f],m=u[d],h=Wh(s,t),g=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){let x=f==="y"?"height":"width",C=a.reference[f]-a.floating[x]+g.mainAxis,b=a.reference[f]+a.reference[x]-g.mainAxis;p<C?p=C:p>b&&(p=b)}if(c){var v,y;let x=f==="y"?"width":"height",C=IRe.has(Gh(o)),b=a.reference[d]-a.floating[x]+(C&&((v=i.offset)==null?void 0:v[d])||0)+(C?0:g.crossAxis),w=a.reference[d]+a.reference[x]+(C?0:((y=i.offset)==null?void 0:y[d])||0)-(C?g.crossAxis:0);m<b?m=b:m>w&&(m=w)}return{[f]:p,[d]:m}}}},MRe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;let{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Wh(e,t),u=await UI(t,c),d=Gh(o),f=hC(o),p=xm(o)==="y",{width:m,height:h}=a.floating,g,v;d==="top"||d==="bottom"?(g=d,v=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g=f==="end"?"top":"bottom");let y=h-u.top-u.bottom,x=m-u.left-u.right,C=$h(h-u[g],y),b=$h(m-u[v],x),w=!t.middlewareData.shift,S=C,P=b;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(S=y),w&&!f){let O=Qc(u.left,0),L=Qc(u.right,0),A=Qc(u.top,0),U=Qc(u.bottom,0);p?P=m-2*(O!==0||L!==0?O+L:Qc(u.left,u.right)):S=h-2*(A!==0||U!==0?A+U:Qc(u.top,u.bottom))}await l({...t,availableWidth:P,availableHeight:S});let N=await i.getDimensions(s.floating);return m!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function x5(){return typeof window<"u"}function yC(e){return ARe(e)?(e.nodeName||"").toLowerCase():"#document"}function Hu(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bm(e){var t;return(t=(ARe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ARe(e){return x5()?e instanceof Node||e instanceof Hu(e).Node:!1}function op(e){return x5()?e instanceof Element||e instanceof Hu(e).Element:!1}function wm(e){return x5()?e instanceof HTMLElement||e instanceof Hu(e).HTMLElement:!1}function TRe(e){return!x5()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hu(e).ShadowRoot}var Vxt=new Set(["inline","contents"]);function HI(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=ap(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Vxt.has(o)}var zxt=new Set(["table","td","th"]);function LRe(e){return zxt.has(yC(e))}var Uxt=[":popover-open",":modal"];function cE(e){return Uxt.some(t=>{try{return e.matches(t)}catch{return!1}})}var Hxt=["transform","translate","scale","rotate","perspective"],jxt=["transform","translate","scale","rotate","perspective","filter"],qxt=["paint","layout","strict","content"];function b5(e){let t=w5(),r=op(e)?ap(e):e;return Hxt.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||jxt.some(n=>(r.willChange||"").includes(n))||qxt.some(n=>(r.contain||"").includes(n))}function ERe(e){let t=Hv(e);for(;wm(t)&&!xC(t);){if(b5(t))return t;if(cE(t))return null;t=Hv(t)}return null}function w5(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var $xt=new Set(["html","body","#document"]);function xC(e){return $xt.has(yC(e))}function ap(e){return Hu(e).getComputedStyle(e)}function uE(e){return op(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hv(e){if(yC(e)==="html")return e;let t=e.assignedSlot||e.parentNode||TRe(e)&&e.host||bm(e);return TRe(t)?t.host:t}function DRe(e){let t=Hv(e);return xC(t)?e.ownerDocument?e.ownerDocument.body:e.body:wm(t)&&HI(t)?t:DRe(t)}function vC(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let o=DRe(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=Hu(o);if(a){let s=C5(i);return t.concat(i,i.visualViewport||[],HI(o)?o:[],s&&r?vC(s):[])}return t.concat(o,vC(o,[],r))}function C5(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BRe(e){let t=ap(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=wm(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=sE(r)!==a||sE(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function HQ(e){return op(e)?e:e.contextElement}function jI(e){let t=HQ(e);if(!wm(t))return ym(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:a}=BRe(t),i=(a?sE(r.width):r.width)/n,s=(a?sE(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var Wxt=ym(0);function VRe(e){let t=Hu(e);return!w5()||!t.visualViewport?Wxt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gxt(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Hu(e)?!1:t}function bC(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let o=e.getBoundingClientRect(),a=HQ(e),i=ym(1);t&&(n?op(n)&&(i=jI(n)):i=jI(e));let s=Gxt(a,r,n)?VRe(a):ym(0),l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){let f=Hu(a),p=n&&op(n)?Hu(n):n,m=f,h=C5(m);for(;h&&n&&p!==m;){let g=jI(h),v=h.getBoundingClientRect(),y=ap(h),x=v.left+(h.clientLeft+parseFloat(y.paddingLeft))*g.x,C=v.top+(h.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=x,c+=C,m=Hu(h),h=C5(m)}}return gC({width:u,height:d,x:l,y:c})}function S5(e,t){let r=uE(e).scrollLeft;return t?t.left+r:bC(bm(e)).left+r}function zRe(e,t){let r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-S5(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Kxt(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,a=o==="fixed",i=bm(n),s=t?cE(t.floating):!1;if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=ym(1),u=ym(0),d=wm(n);if((d||!d&&!a)&&((yC(n)!=="body"||HI(i))&&(l=uE(n)),wm(n))){let p=bC(n);c=jI(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}let f=i&&!d&&!a?zRe(i,l):ym(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}}function Xxt(e){return Array.from(e.getClientRects())}function Yxt(e){let t=bm(e),r=uE(e),n=e.ownerDocument.body,o=Qc(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Qc(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),i=-r.scrollLeft+S5(e),s=-r.scrollTop;return ap(n).direction==="rtl"&&(i+=Qc(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}var ORe=25;function Qxt(e,t){let r=Hu(e),n=bm(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;let u=w5();(!u||u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}let c=S5(n);if(c<=0){let u=n.ownerDocument,d=u.body,f=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(n.clientWidth-d.clientWidth-p);m<=ORe&&(a-=m)}else c<=ORe&&(a+=c);return{width:a,height:i,x:s,y:l}}var Zxt=new Set(["absolute","fixed"]);function Jxt(e,t){let r=bC(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=wm(e)?jI(e):ym(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,l=o*a.x,c=n*a.y;return{width:i,height:s,x:l,y:c}}function _Re(e,t,r){let n;if(t==="viewport")n=Qxt(e,r);else if(t==="document")n=Yxt(bm(e));else if(op(t))n=Jxt(t,r);else{let o=VRe(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return gC(n)}function URe(e,t){let r=Hv(e);return r===t||!op(r)||xC(r)?!1:ap(r).position==="fixed"||URe(r,t)}function ebt(e,t){let r=t.get(e);if(r)return r;let n=vC(e,[],!1).filter(s=>op(s)&&yC(s)!=="body"),o=null,a=ap(e).position==="fixed",i=a?Hv(e):e;for(;op(i)&&!xC(i);){let s=ap(i),l=b5(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&Zxt.has(o.position)||HI(i)&&!l&&URe(e,i))?n=n.filter(u=>u!==i):o=s,i=Hv(i)}return t.set(e,n),n}function tbt(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,i=[...r==="clippingAncestors"?cE(t)?[]:ebt(t,this._c):[].concat(r),n],s=i[0],l=i.reduce((c,u)=>{let d=_Re(t,u,o);return c.top=Qc(d.top,c.top),c.right=$h(d.right,c.right),c.bottom=$h(d.bottom,c.bottom),c.left=Qc(d.left,c.left),c},_Re(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rbt(e){let{width:t,height:r}=BRe(e);return{width:t,height:r}}function nbt(e,t,r){let n=wm(t),o=bm(t),a=r==="fixed",i=bC(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=ym(0);function c(){l.x=S5(o)}if(n||!n&&!a)if((yC(t)!=="body"||HI(o))&&(s=uE(t)),n){let p=bC(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();a&&!n&&o&&c();let u=o&&!n&&!a?zRe(o,s):ym(0),d=i.left+s.scrollLeft-l.x-u.x,f=i.top+s.scrollTop-l.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function UQ(e){return ap(e).position==="static"}function FRe(e,t){if(!wm(e)||ap(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return bm(e)===r&&(r=r.ownerDocument.body),r}function HRe(e,t){let r=Hu(e);if(cE(e))return r;if(!wm(e)){let o=Hv(e);for(;o&&!xC(o);){if(op(o)&&!UQ(o))return o;o=Hv(o)}return r}let n=FRe(e,t);for(;n&&LRe(n)&&UQ(n);)n=FRe(n,t);return n&&xC(n)&&UQ(n)&&!b5(n)?r:n||ERe(e)||r}var obt=async function(e){let t=this.getOffsetParent||HRe,r=this.getDimensions,n=await r(e.floating);return{reference:nbt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function abt(e){return ap(e).direction==="rtl"}var jRe={convertOffsetParentRelativeRectToViewportRelativeRect:Kxt,getDocumentElement:bm,getClippingRect:tbt,getOffsetParent:HRe,getElementRects:obt,getClientRects:Xxt,getDimensions:rbt,getScale:jI,isElement:op,isRTL:abt};function qRe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ibt(e,t){let r=null,n,o=bm(e);function a(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;let m=lE(d),h=lE(o.clientWidth-(u+f)),g=lE(o.clientHeight-(d+p)),v=lE(u),x={rootMargin:-m+"px "+-h+"px "+-g+"px "+-v+"px",threshold:Qc(0,$h(1,l))||1},C=!0;function b(w){let S=w[0].intersectionRatio;if(S!==l){if(!C)return i();S?i(!1,S):n=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!qRe(c,e.getBoundingClientRect())&&i(),C=!1}try{r=new IntersectionObserver(b,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(b,x)}r.observe(e)}return i(!0),a}function jQ(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=HQ(e),u=o||a?[...c?vC(c):[],...vC(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),a&&v.addEventListener("resize",r)});let d=c&&s?ibt(c,r):null,f=-1,p=null;i&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let m,h=l?bC(e):null;l&&g();function g(){let v=bC(e);h&&!qRe(h,v)&&r(),h=v,m=requestAnimationFrame(g)}return r(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",r),a&&y.removeEventListener("resize",r)}),d?.(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(m)}}var $Re=RRe;var WRe=kRe,GRe=SRe,KRe=MRe,XRe=PRe,qQ=CRe;var YRe=NRe,$Q=(e,t,r)=>{let n=new Map,o={platform:jRe,...r},a={...o.platform,_c:n};return wRe(e,t,{...o,platform:a})};var hs=E(it(),1),ZRe=E(it(),1),JRe=E(zh(),1),sbt=typeof document<"u",lbt=function(){},P5=sbt?ZRe.useLayoutEffect:lbt;function I5(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!I5(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){let a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!I5(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function eke(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function QRe(e,t){let r=eke(e);return Math.round(t*r)/r}function WQ(e){let t=hs.useRef(e);return P5(()=>{t.current=e}),t}function tke(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=hs.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=hs.useState(n);I5(f,n)||p(n);let[m,h]=hs.useState(null),[g,v]=hs.useState(null),y=hs.useCallback(T=>{T!==w.current&&(w.current=T,h(T))},[]),x=hs.useCallback(T=>{T!==S.current&&(S.current=T,v(T))},[]),C=a||m,b=i||g,w=hs.useRef(null),S=hs.useRef(null),P=hs.useRef(u),N=l!=null,O=WQ(l),L=WQ(o),A=WQ(c),U=hs.useCallback(()=>{if(!w.current||!S.current)return;let T={placement:t,strategy:r,middleware:f};L.current&&(T.platform=L.current),$Q(w.current,S.current,T).then(D=>{let F={...D,isPositioned:A.current!==!1};V.current&&!I5(P.current,F)&&(P.current=F,JRe.flushSync(()=>{d(F)}))})},[f,t,r,L,A]);P5(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[c]);let V=hs.useRef(!1);P5(()=>(V.current=!0,()=>{V.current=!1}),[]),P5(()=>{if(C&&(w.current=C),b&&(S.current=b),C&&b){if(O.current)return O.current(C,b,U);U()}},[C,b,U,O,N]);let R=hs.useMemo(()=>({reference:w,floating:S,setReference:y,setFloating:x}),[y,x]),I=hs.useMemo(()=>({reference:C,floating:b}),[C,b]),k=hs.useMemo(()=>{let T={position:r,left:0,top:0};if(!I.floating)return T;let D=QRe(I.floating,u.x),F=QRe(I.floating,u.y);return s?{...T,transform:"translate("+D+"px, "+F+"px)",...eke(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:D,top:F}},[r,s,I.floating,u.x,u.y]);return hs.useMemo(()=>({...u,update:U,refs:R,elements:I,floatingStyles:k}),[u,U,R,I,k])}var cbt=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){let{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?qQ({element:n.current,padding:o}).fn(r):{}:n?qQ({element:n,padding:o}).fn(r):{}}}},rke=(e,t)=>({...$Re(e),options:[e,t]}),nke=(e,t)=>({...WRe(e),options:[e,t]}),oke=(e,t)=>({...YRe(e),options:[e,t]}),ake=(e,t)=>({...GRe(e),options:[e,t]}),ike=(e,t)=>({...KRe(e),options:[e,t]});var ske=(e,t)=>({...XRe(e),options:[e,t]});var lke=(e,t)=>({...cbt(e),options:[e,t]});var cke=E(it(),1);var GQ=E(Mr(),1),ubt="Arrow",uke=cke.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...a}=e;return(0,GQ.jsx)(et.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,GQ.jsx)("polygon",{points:"0,0 30,0 15,10"})})});uke.displayName=ubt;var dke=uke;var qI=E(it(),1);function Wn(e){let t=qI.useRef(e);return qI.useEffect(()=>{t.current=e}),qI.useMemo(()=>(...r)=>t.current?.(...r),[])}var fke=E(it(),1);function $I(e){let[t,r]=fke.useState(void 0);return En(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;let a=o[0],i,s;if("borderBoxSize"in a){let l=a.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,s=c.blockSize}else i=e.offsetWidth,s=e.offsetHeight;r({width:i,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Pb=E(Mr(),1);var KQ="Popper",[pke,Zc]=on(KQ),[fbt,mke]=pke(KQ),hke=e=>{let{__scopePopper:t,children:r}=e,[n,o]=ju.useState(null);return(0,Pb.jsx)(fbt,{scope:t,anchor:n,onAnchorChange:o,children:r})};hke.displayName=KQ;var gke="PopperAnchor",vke=ju.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...o}=e,a=mke(gke,r),i=ju.useRef(null),s=Ut(t,i),l=ju.useRef(null);return ju.useEffect(()=>{let c=l.current;l.current=n?.current||i.current,c!==l.current&&a.onAnchorChange(l.current)}),n?null:(0,Pb.jsx)(et.div,{...o,ref:s})});vke.displayName=gke;var XQ="PopperContent",[pbt,mbt]=pke(XQ),yke=ju.forwardRef((e,t)=>{let{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...h}=e,g=mke(XQ,r),[v,y]=ju.useState(null),x=Ut(t,z=>y(z)),[C,b]=ju.useState(null),w=$I(C),S=w?.width??0,P=w?.height??0,N=n+(a!=="center"?"-"+a:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(c)?c:[c],A=L.length>0,U={padding:O,boundary:L.filter(gbt),altBoundary:A},{refs:V,floatingStyles:R,placement:I,isPositioned:k,middlewareData:T}=tke({strategy:"fixed",placement:N,whileElementsMounted:(...z)=>jQ(...z,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[rke({mainAxis:o+P,alignmentAxis:i}),l&&nke({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?oke():void 0,...U}),l&&ake({...U}),ike({...U,apply:({elements:z,rects:G,availableWidth:X,availableHeight:Q})=>{let{width:oe,height:ae}=G.reference,Le=z.floating.style;Le.setProperty("--radix-popper-available-width",`${X}px`),Le.setProperty("--radix-popper-available-height",`${Q}px`),Le.setProperty("--radix-popper-anchor-width",`${oe}px`),Le.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),C&&lke({element:C,padding:s}),vbt({arrowWidth:S,arrowHeight:P}),f&&ske({strategy:"referenceHidden",...U})]}),[D,F]=wke(I),_=Wn(m);En(()=>{k&&_?.()},[k,_]);let M=T.arrow?.x,j=T.arrow?.y,H=T.arrow?.centerOffset!==0,[q,W]=ju.useState();return En(()=>{v&&W(window.getComputedStyle(v).zIndex)},[v]),(0,Pb.jsx)("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:k?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,["--radix-popper-transform-origin"]:[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,Pb.jsx)(pbt,{scope:r,placedSide:D,onArrowChange:b,arrowX:M,arrowY:j,shouldHideArrow:H,children:(0,Pb.jsx)(et.div,{"data-side":D,"data-align":F,...h,ref:x,style:{...h.style,animation:k?void 0:"none"}})})})});yke.displayName=XQ;var xke="PopperArrow",hbt={top:"bottom",right:"left",bottom:"top",left:"right"},bke=ju.forwardRef(function(t,r){let{__scopePopper:n,...o}=t,a=mbt(xke,n),i=hbt[a.placedSide];return(0,Pb.jsx)("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:(0,Pb.jsx)(dke,{...o,ref:r,style:{...o.style,display:"block"}})})});bke.displayName=xke;function gbt(e){return e!==null}var vbt=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,s=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=wke(r),d={start:"0%",center:"50%",end:"100%"}[u],f=(o.arrow?.x??0)+s/2,p=(o.arrow?.y??0)+l/2,m="",h="";return c==="bottom"?(m=i?d:`${f}px`,h=`${-l}px`):c==="top"?(m=i?d:`${f}px`,h=`${n.floating.height+l}px`):c==="right"?(m=`${-l}px`,h=i?d:`${p}px`):c==="left"&&(m=`${n.floating.width+l}px`,h=i?d:`${p}px`),{data:{x:m,y:h}}}});function wke(e){let[t,r="center"]=e.split("-");return[t,r]}var Cm=hke,Sm=vke,Kh=yke,Xh=bke;var R5=E(it(),1),Cke=E(zh(),1);var Ske=E(Mr(),1),ybt="Portal",Jc=R5.forwardRef((e,t)=>{let{container:r,...n}=e,[o,a]=R5.useState(!1);En(()=>a(!0),[]);let i=r||o&&globalThis?.document?.body;return i?Cke.default.createPortal((0,Ske.jsx)(et.div,{...n,ref:t}),i):null});Jc.displayName=ybt;var qu=E(it(),1);var Pke=E(it(),1);function xbt(e,t){return Pke.useReducer((r,n)=>t[r][n]??r,e)}var to=e=>{let{present:t,children:r}=e,n=bbt(t),o=typeof r=="function"?r({present:n.isPresent}):qu.Children.only(r),a=Ut(n.ref,wbt(o));return typeof r=="function"||n.isPresent?qu.cloneElement(o,{ref:a}):null};to.displayName="Presence";function bbt(e){let[t,r]=qu.useState(),n=qu.useRef(null),o=qu.useRef(e),a=qu.useRef("none"),i=e?"mounted":"unmounted",[s,l]=xbt(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return qu.useEffect(()=>{let c=k5(n.current);a.current=s==="mounted"?c:"none"},[s]),En(()=>{let c=n.current,u=o.current;if(u!==e){let f=a.current,p=k5(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),En(()=>{if(t){let c,u=t.ownerDocument.defaultView??window,d=p=>{let h=k5(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&h&&(l("ANIMATION_END"),!o.current)){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=p=>{p.target===t&&(a.current=k5(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:qu.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function k5(e){return e?.animationName||"none"}function wbt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var mi=E(it(),1);var Ike=E(it(),1);function Rke(e,t=globalThis?.document){let r=Wn(e);Ike.useEffect(()=>{let n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var QQ=E(Mr(),1),Cbt="DismissableLayer",YQ="dismissableLayer.update",Sbt="dismissableLayer.pointerDownOutside",Pbt="dismissableLayer.focusOutside",kke,Mke=mi.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lc=mi.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...l}=e,c=mi.useContext(Mke),[u,d]=mi.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=mi.useState({}),m=Ut(t,S=>d(S)),h=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g),y=u?h.indexOf(u):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,C=y>=v,b=Rbt(S=>{let P=S.target,N=[...c.branches].some(O=>O.contains(P));!C||N||(o?.(S),i?.(S),S.defaultPrevented||s?.())},f),w=kbt(S=>{let P=S.target;[...c.branches].some(O=>O.contains(P))||(a?.(S),i?.(S),S.defaultPrevented||s?.())},f);return Rke(S=>{y===c.layers.size-1&&(n?.(S),!S.defaultPrevented&&s&&(S.preventDefault(),s()))},f),mi.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(kke=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Nke(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=kke)}},[u,f,r,c]),mi.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Nke())},[u,c]),mi.useEffect(()=>{let S=()=>p({});return document.addEventListener(YQ,S),()=>document.removeEventListener(YQ,S)},[]),(0,QQ.jsx)(et.div,{...l,ref:m,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:ze(e.onFocusCapture,w.onFocusCapture),onBlurCapture:ze(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:ze(e.onPointerDownCapture,b.onPointerDownCapture)})});lc.displayName=Cbt;var Ibt="DismissableLayerBranch",Tke=mi.forwardRef((e,t)=>{let r=mi.useContext(Mke),n=mi.useRef(null),o=Ut(t,n);return mi.useEffect(()=>{let a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),(0,QQ.jsx)(et.div,{...e,ref:o})});Tke.displayName=Ibt;function Rbt(e,t=globalThis?.document){let r=Wn(e),n=mi.useRef(!1),o=mi.useRef(()=>{});return mi.useEffect(()=>{let a=s=>{if(s.target&&!n.current){let c=function(){Ake(Sbt,r,u,{discrete:!0})};var l=c;let u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function kbt(e,t=globalThis?.document){let r=Wn(e),n=mi.useRef(!1);return mi.useEffect(()=>{let o=a=>{a.target&&!n.current&&Ake(Pbt,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Nke(){let e=new CustomEvent(YQ);document.dispatchEvent(e)}function Ake(e,t,r,{discrete:n}){let o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Ov(o,a):o.dispatchEvent(a)}var Lke=lc,Eke=Tke;var Wd=E(Mr(),1),ZQ,T5="HoverCard",[Dke,Sqr]=on(T5,[Zc]),A5=Zc(),[Mbt,L5]=Dke(T5),Oke=e=>{let{__scopeHoverCard:t,children:r,open:n,defaultOpen:o,onOpenChange:a,openDelay:i=700,closeDelay:s=300}=e,l=A5(t),c=Li.useRef(0),u=Li.useRef(0),d=Li.useRef(!1),f=Li.useRef(!1),[p,m]=$n({prop:n,defaultProp:o??!1,onChange:a,caller:T5}),h=Li.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>m(!0),i)},[i,m]),g=Li.useCallback(()=>{clearTimeout(c.current),!d.current&&!f.current&&(u.current=window.setTimeout(()=>m(!1),s))},[s,m]),v=Li.useCallback(()=>m(!1),[m]);return Li.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),(0,Wd.jsx)(Mbt,{scope:t,open:p,onOpenChange:m,onOpen:h,onClose:g,onDismiss:v,hasSelectionRef:d,isPointerDownOnContentRef:f,children:(0,Wd.jsx)(Cm,{...l,children:r})})};Oke.displayName=T5;var _ke="HoverCardTrigger",Fke=Li.forwardRef((e,t)=>{let{__scopeHoverCard:r,...n}=e,o=L5(_ke,r),a=A5(r);return(0,Wd.jsx)(Sm,{asChild:!0,...a,children:(0,Wd.jsx)(et.a,{"data-state":o.open?"open":"closed",...n,ref:t,onPointerEnter:ze(e.onPointerEnter,M5(o.onOpen)),onPointerLeave:ze(e.onPointerLeave,M5(o.onClose)),onFocus:ze(e.onFocus,o.onOpen),onBlur:ze(e.onBlur,o.onClose),onTouchStart:ze(e.onTouchStart,i=>i.preventDefault())})})});Fke.displayName=_ke;var JQ="HoverCardPortal",[Tbt,Abt]=Dke(JQ,{forceMount:void 0}),Lbt=e=>{let{__scopeHoverCard:t,forceMount:r,children:n,container:o}=e,a=L5(JQ,t);return(0,Wd.jsx)(Tbt,{scope:t,forceMount:r,children:(0,Wd.jsx)(to,{present:r||a.open,children:(0,Wd.jsx)(Jc,{asChild:!0,container:o,children:n})})})};Lbt.displayName=JQ;var N5="HoverCardContent",Bke=Li.forwardRef((e,t)=>{let r=Abt(N5,e.__scopeHoverCard),{forceMount:n=r.forceMount,...o}=e,a=L5(N5,e.__scopeHoverCard);return(0,Wd.jsx)(to,{present:n||a.open,children:(0,Wd.jsx)(Ebt,{"data-state":a.open?"open":"closed",...o,onPointerEnter:ze(e.onPointerEnter,M5(a.onOpen)),onPointerLeave:ze(e.onPointerLeave,M5(a.onClose)),ref:t})})});Bke.displayName=N5;var Ebt=Li.forwardRef((e,t)=>{let{__scopeHoverCard:r,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,...s}=e,l=L5(N5,r),c=A5(r),u=Li.useRef(null),d=Ut(t,u),[f,p]=Li.useState(!1);return Li.useEffect(()=>{if(f){let m=document.body;return ZQ=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=ZQ,m.style.webkitUserSelect=ZQ}}},[f]),Li.useEffect(()=>{if(u.current){let m=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",m),()=>{document.removeEventListener("pointerup",m),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),Li.useEffect(()=>{u.current&&_bt(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),(0,Wd.jsx)(lc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:ze(a,m=>{m.preventDefault()}),onDismiss:l.onDismiss,children:(0,Wd.jsx)(Kh,{...c,...s,onPointerDown:ze(s.onPointerDown,m=>{m.currentTarget.contains(m.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Dbt="HoverCardArrow",Obt=Li.forwardRef((e,t)=>{let{__scopeHoverCard:r,...n}=e,o=A5(r);return(0,Wd.jsx)(Xh,{...o,...n,ref:t})});Obt.displayName=Dbt;function M5(e){return t=>t.pointerType==="touch"?void 0:e()}function _bt(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)t.push(r.currentNode);return t}var Vke=Oke,zke=Fke;var eZ=Bke;var Hke=E(me(),1),fE=Vke,pE=zke,WI=Uke.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>(0,Hke.jsx)(eZ,{ref:o,align:t,sideOffset:r,className:B("z-50 w-64 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),...n}));WI.displayName=eZ.displayName;var CC=E(de(),1);var ur=E(it(),1),Yke=E(zh(),1);var E5=E(it(),1),Bbt=E(Mr(),1),Vbt=E5.createContext(void 0);function ip(e){let t=E5.useContext(Vbt);return e||t||"ltr"}var tZ=E(it(),1);var zbt=tZ[" useId ".trim().toString()]||(()=>{}),Ubt=0;function No(e){let[t,r]=tZ.useState(zbt());return En(()=>{e||r(n=>n??String(Ubt++))},[e]),e||(t?`radix-${t}`:"")}var Ib=E(it(),1);var D5=E(Mr(),1),Hbt=E(it(),1);var qbt=E(Mr(),1);function Gd(e){let t=e+"CollectionProvider",[r,n]=on(t),[o,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{let{scope:g,children:v}=h,y=Ib.default.useRef(null),x=Ib.default.useRef(new Map).current;return(0,D5.jsx)(o,{scope:g,itemMap:x,collectionRef:y,children:v})};i.displayName=t;let s=e+"CollectionSlot",l=ac(s),c=Ib.default.forwardRef((h,g)=>{let{scope:v,children:y}=h,x=a(s,v),C=Ut(g,x.collectionRef);return(0,D5.jsx)(l,{ref:C,children:y})});c.displayName=s;let u=e+"CollectionItemSlot",d="data-radix-collection-item",f=ac(u),p=Ib.default.forwardRef((h,g)=>{let{scope:v,children:y,...x}=h,C=Ib.default.useRef(null),b=Ut(g,C),w=a(u,v);return Ib.default.useEffect(()=>(w.itemMap.set(C,{ref:C,...x}),()=>void w.itemMap.delete(C))),(0,D5.jsx)(f,{[d]:"",ref:b,children:y})});p.displayName=u;function m(h){let g=a(e+"CollectionConsumer",h);return Ib.default.useCallback(()=>{let y=g.collectionRef.current;if(!y)return[];let x=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((w,S)=>x.indexOf(w.ref.current)-x.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:c,ItemSlot:p},m,n]}var jke=new WeakMap,gs,Pm,Lqr=(Pm=class extends Map{constructor(r){super(r);MF(this,gs,void 0);T1(this,gs,[...super.keys()]),jke.set(this,!0)}set(r,n){return jke.get(this)&&(this.has(r)?Jn(this,gs)[Jn(this,gs).indexOf(r)]=r:Jn(this,gs).push(r)),super.set(r,n),this}insert(r,n,o){let a=this.has(n),i=Jn(this,gs).length,s=qke(r),l=s>=0?s:i+s,c=l<0||l>=i?-1:l;if(c===this.size||a&&c===this.size-1||c===-1)return this.set(n,o),this;let u=this.size+(a?0:1);s<0&&l++;let d=[...Jn(this,gs)],f,p=!1;for(let m=l;m<u;m++)if(l===m){let h=d[m];d[m]===n&&(h=d[m+1]),a&&this.delete(n),f=this.get(h),this.set(n,o)}else{!p&&d[m-1]===n&&(p=!0);let h=d[p?m:m-1],g=f;f=this.get(h),this.delete(h),this.set(h,g)}return this}with(r,n,o){let a=new Pm(this);return a.insert(r,n,o),a}before(r){let n=Jn(this,gs).indexOf(r)-1;if(!(n<0))return this.entryAt(n)}setBefore(r,n,o){let a=Jn(this,gs).indexOf(r);return a===-1?this:this.insert(a,n,o)}after(r){let n=Jn(this,gs).indexOf(r);if(n=n===-1||n===this.size-1?-1:n+1,n!==-1)return this.entryAt(n)}setAfter(r,n,o){let a=Jn(this,gs).indexOf(r);return a===-1?this:this.insert(a+1,n,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return T1(this,gs,[]),super.clear()}delete(r){let n=super.delete(r);return n&&Jn(this,gs).splice(Jn(this,gs).indexOf(r),1),n}deleteAt(r){let n=this.keyAt(r);return n!==void 0?this.delete(n):!1}at(r){let n=rZ(Jn(this,gs),r);if(n!==void 0)return this.get(n)}entryAt(r){let n=rZ(Jn(this,gs),r);if(n!==void 0)return[n,this.get(n)]}indexOf(r){return Jn(this,gs).indexOf(r)}keyAt(r){return rZ(Jn(this,gs),r)}from(r,n){let o=this.indexOf(r);if(o===-1)return;let a=o+n;return a<0&&(a=0),a>=this.size&&(a=this.size-1),this.at(a)}keyFrom(r,n){let o=this.indexOf(r);if(o===-1)return;let a=o+n;return a<0&&(a=0),a>=this.size&&(a=this.size-1),this.keyAt(a)}find(r,n){let o=0;for(let a of this){if(Reflect.apply(r,n,[a,o,this]))return a;o++}}findIndex(r,n){let o=0;for(let a of this){if(Reflect.apply(r,n,[a,o,this]))return o;o++}return-1}filter(r,n){let o=[],a=0;for(let i of this)Reflect.apply(r,n,[i,a,this])&&o.push(i),a++;return new Pm(o)}map(r,n){let o=[],a=0;for(let i of this)o.push([i[0],Reflect.apply(r,n,[i,a,this])]),a++;return new Pm(o)}reduce(...r){let[n,o]=r,a=0,i=o??this.at(0);for(let s of this)a===0&&r.length===1?i=s:i=Reflect.apply(n,this,[i,s,a,this]),a++;return i}reduceRight(...r){let[n,o]=r,a=o??this.at(-1);for(let i=this.size-1;i>=0;i--){let s=this.at(i);i===this.size-1&&r.length===1?a=s:a=Reflect.apply(n,this,[a,s,i,this])}return a}toSorted(r){let n=[...this.entries()].sort(r);return new Pm(n)}toReversed(){let r=new Pm;for(let n=this.size-1;n>=0;n--){let o=this.keyAt(n),a=this.get(o);r.set(o,a)}return r}toSpliced(...r){let n=[...this.entries()];return n.splice(...r),new Pm(n)}slice(r,n){let o=new Pm,a=this.size-1;if(r===void 0)return o;r<0&&(r=r+this.size),n!==void 0&&n>0&&(a=n-1);for(let i=r;i<=a;i++){let s=this.keyAt(i),l=this.get(s);o.set(s,l)}return o}every(r,n){let o=0;for(let a of this){if(!Reflect.apply(r,n,[a,o,this]))return!1;o++}return!0}some(r,n){let o=0;for(let a of this){if(Reflect.apply(r,n,[a,o,this]))return!0;o++}return!1}},gs=new WeakMap,Pm);function rZ(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=jbt(e,t);return r===-1?void 0:e[r]}function jbt(e,t){let r=e.length,n=qke(t),o=n>=0?n:r+n;return o<0||o>=r?-1:o}function qke(e){return e!==e||e===0?0:Math.trunc(e)}var O5=E(it(),1);function Rb(e){let t=O5.useRef({value:e,previous:e});return O5.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var $ke=E(it(),1);var Wke=E(Mr(),1),nZ=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),$bt="VisuallyHidden",mE=$ke.forwardRef((e,t)=>(0,Wke.jsx)(et.span,{...e,ref:t,style:{...nZ,...e.style}}));mE.displayName=$bt;var _5=mE;var _r=E(Mr(),1),wC="NavigationMenu",[cZ,Qke,Wbt]=Gd(wC),[oZ,Gbt,Kbt]=Gd(wC),[uZ,Yqr]=on(wC,[Wbt,Kbt]),[Xbt,sp]=uZ(wC),[Ybt,Qbt]=uZ(wC),Zke=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,value:n,onValueChange:o,defaultValue:a,delayDuration:i=200,skipDelayDuration:s=300,orientation:l="horizontal",dir:c,...u}=e,[d,f]=ur.useState(null),p=Ut(t,N=>f(N)),m=ip(c),h=ur.useRef(0),g=ur.useRef(0),v=ur.useRef(0),[y,x]=ur.useState(!0),[C,b]=$n({prop:n,onChange:N=>{let O=N!=="",L=s>0;O?(window.clearTimeout(v.current),L&&x(!1)):(window.clearTimeout(v.current),v.current=window.setTimeout(()=>x(!0),s)),o?.(N)},defaultProp:a??"",caller:wC}),w=ur.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>b(""),150)},[b]),S=ur.useCallback(N=>{window.clearTimeout(g.current),b(N)},[b]),P=ur.useCallback(N=>{C===N?window.clearTimeout(g.current):h.current=window.setTimeout(()=>{window.clearTimeout(g.current),b(N)},i)},[C,b,i]);return ur.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(g.current),window.clearTimeout(v.current)},[]),(0,_r.jsx)(Jke,{scope:r,isRootMenu:!0,value:C,dir:m,orientation:l,rootNavigationMenu:d,onTriggerEnter:N=>{window.clearTimeout(h.current),y?P(N):S(N)},onTriggerLeave:()=>{window.clearTimeout(h.current),w()},onContentEnter:()=>window.clearTimeout(g.current),onContentLeave:w,onItemSelect:N=>{b(O=>O===N?"":N)},onItemDismiss:()=>b(""),children:(0,_r.jsx)(et.nav,{"aria-label":"Main","data-orientation":l,dir:m,...u,ref:p})})});Zke.displayName=wC;var aZ="NavigationMenuSub",Zbt=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",...s}=e,l=sp(aZ,r),[c,u]=$n({prop:n,onChange:o,defaultProp:a??"",caller:aZ});return(0,_r.jsx)(Jke,{scope:r,isRootMenu:!1,value:c,dir:l.dir,orientation:i,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>u(d),onItemSelect:d=>u(d),onItemDismiss:()=>u(""),children:(0,_r.jsx)(et.div,{"data-orientation":i,...s,ref:t})})});Zbt.displayName=aZ;var Jke=e=>{let{scope:t,isRootMenu:r,rootNavigationMenu:n,dir:o,orientation:a,children:i,value:s,onItemSelect:l,onItemDismiss:c,onTriggerEnter:u,onTriggerLeave:d,onContentEnter:f,onContentLeave:p}=e,[m,h]=ur.useState(null),[g,v]=ur.useState(new Map),[y,x]=ur.useState(null);return(0,_r.jsx)(Xbt,{scope:t,isRootMenu:r,rootNavigationMenu:n,value:s,previousValue:Rb(s),baseId:No(),dir:o,orientation:a,viewport:m,onViewportChange:h,indicatorTrack:y,onIndicatorTrackChange:x,onTriggerEnter:Wn(u),onTriggerLeave:Wn(d),onContentEnter:Wn(f),onContentLeave:Wn(p),onItemSelect:Wn(l),onItemDismiss:Wn(c),onViewportContentChange:ur.useCallback((C,b)=>{v(w=>(w.set(C,b),new Map(w)))},[]),onViewportContentRemove:ur.useCallback(C=>{v(b=>b.has(C)?(b.delete(C),new Map(b)):b)},[]),children:(0,_r.jsx)(cZ.Provider,{scope:t,children:(0,_r.jsx)(Ybt,{scope:t,items:g,children:i})})})},eNe="NavigationMenuList",tNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,...n}=e,o=sp(eNe,r),a=(0,_r.jsx)(et.ul,{"data-orientation":o.orientation,...n,ref:t});return(0,_r.jsx)(et.div,{style:{position:"relative"},ref:o.onIndicatorTrackChange,children:(0,_r.jsx)(cZ.Slot,{scope:r,children:o.isRootMenu?(0,_r.jsx)(dNe,{asChild:!0,children:a}):a})})});tNe.displayName=eNe;var rNe="NavigationMenuItem",[Jbt,nNe]=uZ(rNe),oNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,value:n,...o}=e,a=No(),i=n||a||"LEGACY_REACT_AUTO_VALUE",s=ur.useRef(null),l=ur.useRef(null),c=ur.useRef(null),u=ur.useRef(()=>{}),d=ur.useRef(!1),f=ur.useCallback((m="start")=>{if(s.current){u.current();let h=sZ(s.current);h.length&&pZ(m==="start"?h:h.reverse())}},[]),p=ur.useCallback(()=>{if(s.current){let m=sZ(s.current);m.length&&(u.current=i0t(m))}},[]);return(0,_r.jsx)(Jbt,{scope:r,value:i,triggerRef:l,contentRef:s,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:p,onContentFocusOutside:p,children:(0,_r.jsx)(et.li,{...o,ref:t})})});oNe.displayName=rNe;var iZ="NavigationMenuTrigger",aNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,disabled:n,...o}=e,a=sp(iZ,e.__scopeNavigationMenu),i=nNe(iZ,e.__scopeNavigationMenu),s=ur.useRef(null),l=Ut(s,i.triggerRef,t),c=pNe(a.baseId,i.value),u=mNe(a.baseId,i.value),d=ur.useRef(!1),f=ur.useRef(!1),p=i.value===a.value;return(0,_r.jsxs)(_r.Fragment,{children:[(0,_r.jsx)(cZ.ItemSlot,{scope:r,value:i.value,children:(0,_r.jsx)(fNe,{asChild:!0,children:(0,_r.jsx)(et.button,{id:c,disabled:n,"data-disabled":n?"":void 0,"data-state":mZ(p),"aria-expanded":p,"aria-controls":u,...o,ref:l,onPointerEnter:ze(e.onPointerEnter,()=>{f.current=!1,i.wasEscapeCloseRef.current=!1}),onPointerMove:ze(e.onPointerMove,B5(()=>{n||f.current||i.wasEscapeCloseRef.current||d.current||(a.onTriggerEnter(i.value),d.current=!0)})),onPointerLeave:ze(e.onPointerLeave,B5(()=>{n||(a.onTriggerLeave(),d.current=!1)})),onClick:ze(e.onClick,()=>{a.onItemSelect(i.value),f.current=p}),onKeyDown:ze(e.onKeyDown,m=>{let g={horizontal:"ArrowDown",vertical:a.dir==="rtl"?"ArrowLeft":"ArrowRight"}[a.orientation];p&&m.key===g&&(i.onEntryKeyDown(),m.preventDefault())})})})}),p&&(0,_r.jsxs)(_r.Fragment,{children:[(0,_r.jsx)(_5,{"aria-hidden":!0,tabIndex:0,ref:i.focusProxyRef,onFocus:m=>{let h=i.contentRef.current,g=m.relatedTarget,v=g===s.current,y=h?.contains(g);(v||!y)&&i.onFocusProxyEnter(v?"start":"end")}}),a.viewport&&(0,_r.jsx)("span",{"aria-owns":u})]})]})});aNe.displayName=iZ;var e0t="NavigationMenuLink",Kke="navigationMenu.linkSelect",iNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,active:n,onSelect:o,...a}=e;return(0,_r.jsx)(fNe,{asChild:!0,children:(0,_r.jsx)(et.a,{"data-active":n?"":void 0,"aria-current":n?"page":void 0,...a,ref:t,onClick:ze(e.onClick,i=>{let s=i.target,l=new CustomEvent(Kke,{bubbles:!0,cancelable:!0});if(s.addEventListener(Kke,c=>o?.(c),{once:!0}),Ov(s,l),!l.defaultPrevented&&!i.metaKey){let c=new CustomEvent(F5,{bubbles:!0,cancelable:!0});Ov(s,c)}},{checkForDefaultPrevented:!1})})})});iNe.displayName=e0t;var dZ="NavigationMenuIndicator",sNe=ur.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=sp(dZ,e.__scopeNavigationMenu),a=!!o.value;return o.indicatorTrack?Yke.default.createPortal((0,_r.jsx)(to,{present:r||a,children:(0,_r.jsx)(t0t,{...n,ref:t})}),o.indicatorTrack):null});sNe.displayName=dZ;var t0t=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,...n}=e,o=sp(dZ,r),a=Qke(r),[i,s]=ur.useState(null),[l,c]=ur.useState(null),u=o.orientation==="horizontal",d=!!o.value;ur.useEffect(()=>{let m=a().find(h=>h.value===o.value)?.ref.current;m&&s(m)},[a,o.value]);let f=()=>{i&&c({size:u?i.offsetWidth:i.offsetHeight,offset:u?i.offsetLeft:i.offsetTop})};return lZ(i,f),lZ(o.indicatorTrack,f),l?(0,_r.jsx)(et.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":o.orientation,...n,ref:t,style:{position:"absolute",...u?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...n.style}}):null}),GI="NavigationMenuContent",lNe=ur.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=sp(GI,e.__scopeNavigationMenu),a=nNe(GI,e.__scopeNavigationMenu),i=Ut(a.contentRef,t),s=a.value===o.value,l={value:a.value,triggerRef:a.triggerRef,focusProxyRef:a.focusProxyRef,wasEscapeCloseRef:a.wasEscapeCloseRef,onContentFocusOutside:a.onContentFocusOutside,onRootContentClose:a.onRootContentClose,...n};return o.viewport?(0,_r.jsx)(r0t,{forceMount:r,...l,ref:i}):(0,_r.jsx)(to,{present:r||s,children:(0,_r.jsx)(cNe,{"data-state":mZ(s),...l,ref:i,onPointerEnter:ze(e.onPointerEnter,o.onContentEnter),onPointerLeave:ze(e.onPointerLeave,B5(o.onContentLeave)),style:{pointerEvents:!s&&o.isRootMenu?"none":void 0,...l.style}})})});lNe.displayName=GI;var r0t=ur.forwardRef((e,t)=>{let r=sp(GI,e.__scopeNavigationMenu),{onViewportContentChange:n,onViewportContentRemove:o}=r;return En(()=>{n(e.value,{ref:t,...e})},[e,t,n]),En(()=>()=>o(e.value),[e.value,o]),null}),F5="navigationMenu.rootContentDismiss",cNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,value:n,triggerRef:o,focusProxyRef:a,wasEscapeCloseRef:i,onRootContentClose:s,onContentFocusOutside:l,...c}=e,u=sp(GI,r),d=ur.useRef(null),f=Ut(d,t),p=pNe(u.baseId,n),m=mNe(u.baseId,n),h=Qke(r),g=ur.useRef(null),{onItemDismiss:v}=u;ur.useEffect(()=>{let x=d.current;if(u.isRootMenu&&x){let C=()=>{v(),s(),x.contains(document.activeElement)&&o.current?.focus()};return x.addEventListener(F5,C),()=>x.removeEventListener(F5,C)}},[u.isRootMenu,e.value,o,v,s]);let y=ur.useMemo(()=>{let C=h().map(O=>O.value);u.dir==="rtl"&&C.reverse();let b=C.indexOf(u.value),w=C.indexOf(u.previousValue),S=n===u.value,P=w===C.indexOf(n);if(!S&&!P)return g.current;let N=(()=>{if(b!==w){if(S&&w!==-1)return b>w?"from-end":"from-start";if(P&&b!==-1)return b>w?"to-start":"to-end"}return null})();return g.current=N,N},[u.previousValue,u.value,u.dir,h,n]);return(0,_r.jsx)(dNe,{asChild:!0,children:(0,_r.jsx)(lc,{id:m,"aria-labelledby":p,"data-motion":y,"data-orientation":u.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{let x=new Event(F5,{bubbles:!0,cancelable:!0});d.current?.dispatchEvent(x)},onFocusOutside:ze(e.onFocusOutside,x=>{l();let C=x.target;u.rootNavigationMenu?.contains(C)&&x.preventDefault()}),onPointerDownOutside:ze(e.onPointerDownOutside,x=>{let C=x.target,b=h().some(S=>S.ref.current?.contains(C)),w=u.isRootMenu&&u.viewport?.contains(C);(b||w||!u.isRootMenu)&&x.preventDefault()}),onKeyDown:ze(e.onKeyDown,x=>{let C=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!C){let w=sZ(x.currentTarget),S=document.activeElement,P=w.findIndex(L=>L===S),O=x.shiftKey?w.slice(0,P).reverse():w.slice(P+1,w.length);pZ(O)?x.preventDefault():a.current?.focus()}}),onEscapeKeyDown:ze(e.onEscapeKeyDown,x=>{i.current=!0})})})}),fZ="NavigationMenuViewport",uNe=ur.forwardRef((e,t)=>{let{forceMount:r,...n}=e,a=!!sp(fZ,e.__scopeNavigationMenu).value;return(0,_r.jsx)(to,{present:r||a,children:(0,_r.jsx)(n0t,{...n,ref:t})})});uNe.displayName=fZ;var n0t=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,children:n,...o}=e,a=sp(fZ,r),i=Ut(t,a.onViewportChange),s=Qbt(GI,e.__scopeNavigationMenu),[l,c]=ur.useState(null),[u,d]=ur.useState(null),f=l?l?.width+"px":void 0,p=l?l?.height+"px":void 0,m=!!a.value,h=m?a.value:a.previousValue;return lZ(u,()=>{u&&c({width:u.offsetWidth,height:u.offsetHeight})}),(0,_r.jsx)(et.div,{"data-state":mZ(m),"data-orientation":a.orientation,...o,ref:i,style:{pointerEvents:!m&&a.isRootMenu?"none":void 0,["--radix-navigation-menu-viewport-width"]:f,["--radix-navigation-menu-viewport-height"]:p,...o.style},onPointerEnter:ze(e.onPointerEnter,a.onContentEnter),onPointerLeave:ze(e.onPointerLeave,B5(a.onContentLeave)),children:Array.from(s.items).map(([v,{ref:y,forceMount:x,...C}])=>{let b=h===v;return(0,_r.jsx)(to,{present:x||b,children:(0,_r.jsx)(cNe,{...C,ref:Dv(y,w=>{b&&w&&d(w)})})},v)})})}),o0t="FocusGroup",dNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,...n}=e,o=sp(o0t,r);return(0,_r.jsx)(oZ.Provider,{scope:r,children:(0,_r.jsx)(oZ.Slot,{scope:r,children:(0,_r.jsx)(et.div,{dir:o.dir,...n,ref:t})})})}),Xke=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],a0t="FocusGroupItem",fNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,...n}=e,o=Gbt(r),a=sp(a0t,r);return(0,_r.jsx)(oZ.ItemSlot,{scope:r,children:(0,_r.jsx)(et.button,{...n,ref:t,onKeyDown:ze(e.onKeyDown,i=>{if(["Home","End",...Xke].includes(i.key)){let l=o().map(d=>d.ref.current);if([a.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(i.key)&&l.reverse(),Xke.includes(i.key)){let d=l.indexOf(i.currentTarget);l=l.slice(d+1)}setTimeout(()=>pZ(l)),i.preventDefault()}})})})});function sZ(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function pZ(e){let t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}function i0t(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{let r=t.dataset.tabindex;t.setAttribute("tabindex",r)})}}function lZ(e,t){let r=Wn(t);En(()=>{let n=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}function mZ(e){return e?"open":"closed"}function pNe(e,t){return`${e}-trigger-${t}`}function mNe(e,t){return`${e}-content-${t}`}function B5(e){return t=>t.pointerType==="mouse"?e(t):void 0}var hZ=Zke;var gZ=tNe,hNe=oNe,vZ=aNe,gNe=iNe,yZ=sNe,xZ=lNe,bZ=uNe;var lp=E(me(),1),hE=CC.forwardRef(({className:e,children:t,...r},n)=>(0,lp.jsxs)(hZ,{ref:n,className:B("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,(0,lp.jsx)(V5,{})]}));hE.displayName=hZ.displayName;var gE=CC.forwardRef(({className:e,...t},r)=>(0,lp.jsx)(gZ,{ref:r,className:B("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));gE.displayName=gZ.displayName;var vE=hNe,yE=mt("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),xE=CC.forwardRef(({className:e,children:t,...r},n)=>(0,lp.jsxs)(vZ,{ref:n,className:B(yE(),"group",e),...r,children:[t," ",(0,lp.jsx)($o,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));xE.displayName=vZ.displayName;var bE=CC.forwardRef(({className:e,...t},r)=>(0,lp.jsx)(xZ,{ref:r,className:B("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));bE.displayName=xZ.displayName;var wE=gNe,V5=CC.forwardRef(({className:e,...t},r)=>(0,lp.jsx)("div",{className:B("absolute left-0 top-full flex justify-center"),children:(0,lp.jsx)(bZ,{className:B("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:r,...t})}));V5.displayName=bZ.displayName;var wZ=CC.forwardRef(({className:e,...t},r)=>(0,lp.jsx)(yZ,{ref:r,className:B("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:(0,lp.jsx)("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));wZ.displayName=yZ.displayName;var vs=E(de(),1);var KI=E(de(),1),z5="moonui_license_cache",l0t=24*60*60*1e3,vNe=7*24*60*60*1e3;function Ht(){let[e,t]=(0,KI.useState)(!0),[r,n]=(0,KI.useState)(!0),[o,a]=(0,KI.useState)(!0);(0,KI.useEffect)(()=>{(async()=>{try{let l=localStorage.getItem(z5);if(l){let c=JSON.parse(l),u=Date.now();if(u-c.timestamp<l0t){n(c.valid&&c.hasLifetimeAccess),a(c.valid),t(!1);return}if(u-c.timestamp<vNe){i().catch(()=>{n(c.valid&&c.hasLifetimeAccess),a(c.valid)}),t(!1);return}}await i()}catch(l){console.error("License check error:",l),n(!0),a(!0)}finally{t(!1)}})()},[]);let i=async()=>{let s=process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN||localStorage.getItem("moonui_auth_token");if(!s){n(!0),a(!0);return}try{let l=await fetch("https://moonui.dev/api/auth/validate",{headers:{Authorization:`Bearer ${s}`}});if(l.ok){let c=await l.json(),u={valid:c.valid,hasLifetimeAccess:c.user?.hasLifetimeAccess||!1,timestamp:Date.now(),cacheUntil:c.cacheUntil?new Date(c.cacheUntil).getTime():void 0};localStorage.setItem(z5,JSON.stringify(u)),n(c.valid&&(c.user?.hasLifetimeAccess||c.user?.features?.includes("pro_components"))),a(c.valid)}else localStorage.removeItem(z5),n(!1),a(!1)}catch{let c=localStorage.getItem(z5);if(c){let u=JSON.parse(c);if(Date.now()-u.timestamp<vNe){n(u.valid&&u.hasLifetimeAccess),a(u.valid);return}}n(!1),a(!1)}};return{isLoading:e,isAuthenticated:o,isAdmin:!1,hasProAccess:r,subscriptionPlan:r?"lifetime":"free",subscription:{status:r?"active":"inactive",plan:r?"lifetime":"free"}}}var Gi=E(me(),1),CZ=mt("fixed bg-background shadow-2xl overflow-hidden",{variants:{position:{bottom:"bottom-0 left-0 right-0 rounded-t-[20px] max-h-[95vh]",top:"top-0 left-0 right-0 rounded-b-[20px] max-h-[95vh]",left:"left-0 top-0 bottom-0 rounded-r-[20px] max-w-[90vw]",right:"right-0 top-0 bottom-0 rounded-l-[20px] max-w-[90vw]"},size:{default:"",sm:"",md:"",lg:"",full:""}},compoundVariants:[{position:["bottom","top"],size:"sm",class:"h-[30vh]"},{position:["bottom","top"],size:"md",class:"h-[50vh]"},{position:["bottom","top"],size:"lg",class:"h-[70vh]"},{position:["bottom","top"],size:"full",class:"h-[95vh]"},{position:["left","right"],size:"sm",class:"w-[280px]"},{position:["left","right"],size:"md",class:"w-[380px]"},{position:["left","right"],size:"lg",class:"w-[480px]"},{position:["left","right"],size:"full",class:"w-[90vw]"}],defaultVariants:{position:"bottom",size:"default"}}),c0t=mt("absolute bg-muted-foreground/20 transition-all duration-200",{variants:{position:{bottom:"top-2 left-1/2 -translate-x-1/2 w-12 h-1 rounded-full",top:"bottom-2 left-1/2 -translate-x-1/2 w-12 h-1 rounded-full",left:"right-2 top-1/2 -translate-y-1/2 w-1 h-12 rounded-full",right:"left-2 top-1/2 -translate-y-1/2 w-1 h-12 rounded-full"}},defaultVariants:{position:"bottom"}}),u0t=e=>{(0,vs.useEffect)(()=>{if(!e)return;let t=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[e])},d0t=(e,t,r,n,o)=>{let a=Math.abs(e)/o*100;if(Math.abs(t)>500){if((n==="up"||n==="left")&&t<0){let i=r.filter(s=>s>a);return i.length>0?i[0]:r[r.length-1]}else if((n==="down"||n==="right")&&t>0){let i=r.filter(s=>s<a);return i.length>0?i[i.length-1]:0}}return r.reduce((i,s)=>Math.abs(s-a)<Math.abs(i-a)?s:i)},yNe=vs.default.forwardRef(({isOpen:e,onOpenChange:t,children:r,position:n="bottom",size:o="default",snapPoints:a=o==="default"?[25,50,75,100]:[],defaultSnapPoint:i,enableSwipeToClose:s=!0,closeThreshold:l=20,closeVelocity:c=500,dragElastic:u=.2,showHandle:d=!0,handleClassName:f,showCloseButton:p=!1,closeButtonClassName:m,showBackdrop:h=!0,backdropClassName:g,backdropBlur:v=!0,closeOnBackdropClick:y=!0,animationDuration:x=.5,springConfig:C={stiffness:300,damping:30,mass:1},preventBodyScroll:b=!0,autoHeight:w=!1,nestedScrolling:S=!0,onSnapPointChange:P,className:N,asChild:O=!1,isProComponent:L=!0,...A},U)=>{let V=n==="bottom"||n==="top",R=f3(),I=f3(),k=Ca(0),T=Ca(0),D=V?T:k,[F,_]=(0,vs.useState)(i||(a.length>0?a[0]:50)),[M,j]=(0,vs.useState)(!1),H=(0,vs.useRef)(null),[q,W]=(0,vs.useState)(null);u0t(e&&b);let z=(0,vs.useMemo)(()=>typeof window>"u"?1e3:V?window.innerHeight:window.innerWidth,[V]),G=(0,vs.useCallback)(Oe=>0,[n,z]),X=e?.5:0,Q=(0,vs.useCallback)((Oe,ve)=>{j(!1);let Re=V?ve.offset.y:ve.offset.x,be=V?ve.velocity.y:ve.velocity.x;if(s&&(n==="bottom"&&Re>l&&be>-c||n==="top"&&Re<-l&&be<c||n==="right"&&Re>l&&be>-c||n==="left"&&Re<-l&&be<c)){t(!1);return}if(a.length>0){let Y=n==="bottom"?"down":n==="top"?"up":n==="left"?"left":"right",Z=d0t(Math.abs(D.get()),be,a,Y,z);_(Z),P?.(Z),Ko(D,G(Z),{type:"spring",...C})}else Ko(D,G(F),{type:"spring",...C})},[V,n,s,l,c,a,D,z,G,F,C,t,P]),oe=(0,vs.useCallback)((Oe,ve)=>{j(!0)},[]);(0,vs.useEffect)(()=>{if(!w||!H.current||!e)return;let Oe=new ResizeObserver(ve=>{for(let Re of ve)W(Re.contentRect.height)});return Oe.observe(H.current),()=>{Oe.disconnect()}},[w,e]),(0,vs.useEffect)(()=>{e?Ko(D,0,{type:"spring",...C}):Ko(D,0,{type:"spring",...C})},[e,D,C]),(0,vs.useEffect)(()=>{if(!e)return;let Oe=ve=>{ve.key==="Escape"&&s&&t(!1)};return document.addEventListener("keydown",Oe),()=>document.removeEventListener("keydown",Oe)},[e,s,t]);let ae=()=>({x:0,y:0}),Le=()=>{switch(n){case"bottom":return{top:-200,bottom:100};case"top":return{top:-100,bottom:200};case"right":return{left:-200,right:100};case"left":return{left:-100,right:200};default:return{}}};return e?(0,Gi.jsxs)(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:x},className:"fixed inset-0 z-50",style:{pointerEvents:M?"none":"auto"},children:[h&&(0,Gi.jsx)(ie.div,{className:B("absolute inset-0 bg-black/50",v&&"backdrop-blur-sm",g),style:{opacity:X},onClick:y?()=>t(!1):void 0}),(0,Gi.jsxs)(ie.div,{ref:U,drag:s?V?"y":"x":!1,dragConstraints:Le(),dragElastic:u,onDragStart:oe,onDragEnd:Q,initial:ae(),style:{...M?{[V?"y":"x"]:D}:{},...w&&q&&V?{height:`${Math.min(q+60,z*.95)}px`}:{}},className:B(CZ({position:n,size:o}),"will-change-transform",N),...A,children:[d&&(0,Gi.jsx)("div",{className:B(c0t({position:n}),"cursor-grab active:cursor-grabbing",M&&"bg-muted-foreground/40 scale-x-150",f)}),p&&(0,Gi.jsx)("button",{onClick:()=>t(!1),className:B("absolute z-50 p-2 rounded-full bg-background/80 backdrop-blur-sm border shadow-sm","hover:bg-background transition-colors",n==="bottom"&&"top-3 right-3",n==="top"&&"bottom-3 right-3",n==="left"&&"top-3 right-3",n==="right"&&"top-3 left-3",m),"aria-label":"Close drawer",children:(0,Gi.jsx)(Zt,{className:"h-4 w-4"})}),(0,Gi.jsx)("div",{ref:H,className:B("h-full overflow-auto overscroll-contain",S&&"touch-pan-y",d&&n==="bottom"&&"pt-2",d&&n==="top"&&"pb-2"),style:{touchAction:S?"pan-y":"none"},children:r})]})]}):null});yNe.displayName="MoonUIGestureDrawerProComponent";var U5=vs.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Ht();return!n&&!r?(0,Gi.jsx)(Be,{className:"w-fit mx-auto",children:(0,Gi.jsx)(Ve,{className:"py-6 text-center",children:(0,Gi.jsxs)("div",{className:"space-y-4",children:[(0,Gi.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Gi.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Gi.jsxs)("div",{children:[(0,Gi.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Gi.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Gesture Drawer is available exclusively to MoonUI Pro subscribers."}),(0,Gi.jsx)("a",{href:"/pricing",children:(0,Gi.jsxs)(ne,{size:"sm",children:[(0,Gi.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Gi.jsx)(yNe,{...e,ref:t})});U5.displayName="MoonUIGestureDrawerPro";var xNe=U5;var _o=E(de(),1);var ir=E(me(),1),f0t=mt("fixed inset-0 z-50 flex items-center justify-center",{variants:{backdrop:{dark:"bg-black/95",blur:"bg-black/90 backdrop-blur-md",light:"bg-white/90",gradient:"bg-gradient-to-b from-black/95 to-black/80"}},defaultVariants:{backdrop:"blur"}}),bNe=_o.createContext(void 0);function wNe(){let e=_o.useContext(bNe);if(!e)throw new Error("useLightbox must be used within a LightboxProvider");return e}function XI({children:e,items:t=[],defaultIndex:r=0}){let[n,o]=_o.useState(r),[a,i]=_o.useState(!1),[s,l]=_o.useState(1),c=_o.useMemo(()=>({items:t,currentIndex:n,setCurrentIndex:o,isOpen:a,setIsOpen:i,zoom:s,setZoom:l}),[t,n,a,s]);return(0,ir.jsx)(bNe.Provider,{value:c,children:e})}var SC=_o.forwardRef(({index:e=0,asChild:t,children:r,onClick:n,...o},a)=>{let{setCurrentIndex:i,setIsOpen:s,setZoom:l}=wNe(),c=g=>{i(e),s(!0),l(1),n?.(g)};if(t){let g=r,{onDrag:v,onDragStart:y,onDragEnd:x,onDragOver:C,onDrop:b,...w}=o;return _o.cloneElement(g,{...g.props,...w,onClick:c})}let{onDrag:u,onDragStart:d,onDragEnd:f,onDragOver:p,onDrop:m,...h}=o;return(0,ir.jsx)("div",{ref:a,onClick:c,className:"cursor-pointer",...h,children:r})});SC.displayName="LightboxTrigger";var PC=_o.forwardRef(({className:e,backdrop:t,showNavigation:r=!0,showZoomControls:n=!0,showDownload:o=!0,showFullscreen:a=!0,showThumbnails:i=!1,enableKeyboardNavigation:s=!0,enableSwipeGestures:l=!0,animationDuration:c=300,autoPlayVideo:u=!1,onClose:d,...f},p)=>{let{onDrag:m,onDragStart:h,onDragEnd:g,onDragOver:v,onDrop:y,onAnimationStart:x,onAnimationEnd:C,onAnimationIteration:b,...w}=f,{items:S,currentIndex:P,setCurrentIndex:N,isOpen:O,setIsOpen:L,zoom:A,setZoom:U}=wNe(),[V,R]=_o.useState(!0),[I,k]=_o.useState(!1),[T,D]=_o.useState(!0),[F,_]=_o.useState(!1),[M,j]=_o.useState({x:0,y:0}),[H,q]=_o.useState(!1),W=_o.useRef(null),z=_o.useRef(null),G=S[P];_o.useEffect(()=>{G?.type==="video"&&u?(k(!0),D(!0)):k(!1)},[P,G,u]),_o.useEffect(()=>{if(!s||!O)return;let De=Y=>{switch(Y.key){case"ArrowLeft":Q();break;case"ArrowRight":oe();break;case"Escape":X();break;case"+":case"=":ae();break;case"-":Le();break;case" ":G?.type==="video"&&(Y.preventDefault(),k(!I));break}};return window.addEventListener("keydown",De),()=>window.removeEventListener("keydown",De)},[O,P,I,s]),_o.useEffect(()=>{z.current&&G?.type==="video"&&(I?z.current.play().catch(De=>{console.error("Video play error:",De),k(!1)}):z.current.pause())},[I,G]);let X=()=>{L(!1),U(1),j({x:0,y:0}),d?.()},Q=()=>{N(P>0?P-1:S.length-1),U(1),j({x:0,y:0}),R(!0)},oe=()=>{N(P<S.length-1?P+1:0),U(1),j({x:0,y:0}),R(!0)},ae=()=>{U(Math.min(A+.5,3))},Le=()=>{U(Math.max(A-.5,.5)),A-.5<=1&&j({x:0,y:0})},Ie=()=>{if(G){let De=document.createElement("a");De.href=G.src,De.download=G.alt||"download",De.click()}},Oe=()=>{F?document.exitFullscreen():W.current?.requestFullscreen(),_(!F)},ve=De=>{A>1&&q(!0)},Re=De=>{H&&A>1&&j({x:M.x+De.movementX,y:M.y+De.movementY})},be=()=>{q(!1)};return G?(0,ir.jsx)(nb,{open:O,onOpenChange:L,children:(0,ir.jsx)(Dt,{children:O&&(0,ir.jsx)(ob,{forceMount:!0,children:(0,ir.jsx)(Th,{asChild:!0,children:(0,ir.jsx)(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:c/1e3},className:B(f0t({backdrop:t}),e),ref:p,onClick:De=>{De.target===De.currentTarget&&X()},...w,children:(0,ir.jsxs)("div",{ref:W,className:"relative w-full h-full flex items-center justify-center pointer-events-none",onMouseMove:Re,onMouseUp:be,onMouseLeave:be,children:[(0,ir.jsx)("div",{className:"absolute inset-0 pointer-events-auto",onClick:X}),(0,ir.jsx)("button",{onClick:X,className:"absolute top-4 right-4 z-50 p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors pointer-events-auto",children:(0,ir.jsx)(Zt,{className:"h-5 w-5"})}),r&&S.length>1&&(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)("button",{onClick:Q,className:"absolute left-4 z-50 p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors pointer-events-auto",children:(0,ir.jsx)(oa,{className:"h-5 w-5"})}),(0,ir.jsx)("button",{onClick:oe,className:"absolute right-4 z-50 p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors pointer-events-auto",children:(0,ir.jsx)(Bn,{className:"h-5 w-5"})})]}),(0,ir.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 pointer-events-auto",children:[n&&G.type==="image"&&(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)("button",{onClick:Le,className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:(0,ir.jsx)(Dd,{className:"h-4 w-4"})}),(0,ir.jsxs)("span",{className:"px-3 py-1 rounded-full bg-black/50 text-white text-sm",children:[Math.round(A*100),"%"]}),(0,ir.jsx)("button",{onClick:ae,className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:(0,ir.jsx)(Ed,{className:"h-4 w-4"})})]}),G.type==="video"&&(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)("button",{onClick:()=>{k(!I),!I&&z.current&&z.current.play().catch(De=>{console.error("Play failed:",De)})},className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:I?(0,ir.jsx)(Nx,{className:"h-4 w-4"}):(0,ir.jsx)(rm,{className:"h-4 w-4"})}),(0,ir.jsx)("button",{onClick:()=>{D(!T),z.current&&(z.current.muted=!T)},className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:T?(0,ir.jsx)(qA,{className:"h-4 w-4"}):(0,ir.jsx)(jA,{className:"h-4 w-4"})})]}),o&&(0,ir.jsx)("button",{onClick:Ie,className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:(0,ir.jsx)(un,{className:"h-4 w-4"})}),a&&(0,ir.jsx)("button",{onClick:Oe,className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:(0,ir.jsx)(Rl,{className:"h-4 w-4"})})]}),(0,ir.jsxs)(ie.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},transition:{duration:c/1e3},className:"relative flex items-center justify-center pointer-events-auto",style:{transform:`scale(${A}) translate(${M.x/A}px, ${M.y/A}px)`,cursor:A>1?H?"grabbing":"grab":"auto"},onMouseDown:ve,children:[V&&(0,ir.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,ir.jsx)(Sr,{className:"h-8 w-8 animate-spin text-white"})}),G.type==="image"?(0,ir.jsx)("img",{src:G.src,alt:G.alt,className:"max-w-[90vw] max-h-[90vh] w-auto h-auto object-contain select-none",onLoad:()=>R(!1),draggable:!1}):(0,ir.jsx)("video",{ref:z,src:G.src,poster:G.poster,muted:T,controls:!0,autoPlay:u&&I,playsInline:!0,className:"max-w-[90vw] max-h-[90vh] w-auto h-auto",onLoadedData:()=>{R(!1),u&&I&&z.current&&z.current.play().catch(De=>{console.error("Autoplay failed:",De)})},onError:De=>{console.error("Video error:",De),R(!1)}})]}),(G.title||G.description)&&(0,ir.jsxs)(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"absolute top-4 left-4 max-w-md pointer-events-auto",children:[G.title&&(0,ir.jsx)("h3",{className:"text-white text-xl font-semibold mb-1",children:G.title}),G.description&&(0,ir.jsx)("p",{className:"text-white/80 text-sm",children:G.description})]}),i&&S.length>1&&(0,ir.jsx)(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"absolute bottom-20 left-0 right-0 flex justify-center z-50 pointer-events-auto",children:(0,ir.jsx)("div",{className:"flex gap-2 p-2 bg-black/70 backdrop-blur-sm rounded-lg max-w-[80vw] overflow-x-auto",children:S.map((De,Y)=>(0,ir.jsx)("button",{onClick:()=>{N(Y),U(1),j({x:0,y:0})},className:B("w-16 h-16 rounded overflow-hidden transition-all",Y===P?"ring-2 ring-white scale-110":"opacity-60 hover:opacity-100"),children:De.type==="image"?(0,ir.jsx)("img",{src:De.thumbnail||De.src,alt:De.alt,className:"w-full h-full object-cover"}):(0,ir.jsx)("div",{className:"w-full h-full bg-black/50 flex items-center justify-center",children:(0,ir.jsx)(rm,{className:"h-4 w-4 text-white"})})},Y))})})]})})})})})}):null});PC.displayName="LightboxContent";function p0t({src:e,type:t="image",alt:r,poster:n,title:o,description:a,children:i,...s}){return(0,ir.jsxs)(XI,{items:[{type:t,src:e,alt:r,poster:n,title:o,description:a}],children:[(0,ir.jsx)(SC,{children:i}),(0,ir.jsx)(PC,{...s})]})}var ys=E(de(),1);var Ft=E(me(),1),CNe=mt("w-full",{variants:{layout:{grid:"grid gap-4",masonry:"",horizontal:"flex overflow-x-auto gap-4 pb-4 snap-x snap-mandatory scrollbar-thin scrollbar-track-transparent scrollbar-thumb-border",justified:"flex flex-wrap gap-2"},columns:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",5:"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",6:"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6"}},defaultVariants:{layout:"grid",columns:3}}),H5=mt("relative overflow-hidden cursor-pointer group",{variants:{variant:{default:"rounded-lg",card:"rounded-lg shadow-sm border border-border bg-card",ghost:"rounded-lg hover:bg-accent/50",outline:"rounded-lg border-2 border-transparent hover:border-primary",glass:"rounded-lg backdrop-blur-md bg-white/10 border border-white/20"},aspectRatio:{square:"aspect-square",video:"aspect-video",portrait:"aspect-[3/4]",auto:""},hover:{none:"",zoom:"transition-transform duration-300 hover:scale-105",lift:"transition-all duration-300 hover:-translate-y-1 hover:shadow-lg",glow:"transition-all duration-300 hover:shadow-lg hover:shadow-primary/20"}},defaultVariants:{variant:"default",aspectRatio:"square",hover:"zoom"}}),SNe=ys.forwardRef(({className:e,items:t,layout:r,columns:n,variant:o,aspectRatio:a,hover:i,enableLightbox:s=!0,enableFiltering:l=!1,enableSorting:c=!1,categories:u=[],sortOptions:d=[],defaultCategory:f="all",defaultSort:p="default",showItemType:m=!0,showOverlay:h=!0,overlayContent:g,loadingState:v=!1,skeletonCount:y=6,emptyState:x,onItemClick:C,lazyLoad:b=!0,infiniteScroll:w=!1,onLoadMore:S,hasMore:P=!1,lightboxProps:N,...O},L)=>{let[A,U]=ys.useState(f),[V,R]=ys.useState(p),[I,k]=ys.useState(!1),[T,D]=ys.useState(new Set),F=ys.useRef(null),_=ys.useRef(null),M=ys.useMemo(()=>!l||A==="all"?t:t.filter(Q=>"category"in Q&&typeof Q.category=="string"?Q.category===A:A==="image"?Q.type==="image":A==="video"?Q.type==="video":!0),[t,A,l]),j=ys.useMemo(()=>{if(!c||V==="default")return M;let Q=d.find(oe=>oe.id===V);return Q?[...M].sort(Q.compareFn):M},[M,V,c,d]),H=[{id:"all",label:"All"},{id:"image",label:"Images",icon:(0,Ft.jsx)(rl,{className:"h-4 w-4"})},{id:"video",label:"Videos",icon:(0,Ft.jsx)(nm,{className:"h-4 w-4"})}],q=u.length>0?u:H;ys.useEffect(()=>{if(b)return F.current=new IntersectionObserver(Q=>{Q.forEach(oe=>{if(oe.isIntersecting){let ae=parseInt(oe.target.getAttribute("data-index")||"0");D(Le=>new Set(Le).add(ae))}})},{rootMargin:"50px"}),()=>{F.current?.disconnect()}},[b]),ys.useEffect(()=>{if(!w||!S||!P)return;let Q=new IntersectionObserver(oe=>{oe[0].isIntersecting&&S()},{rootMargin:"100px"});return _.current&&Q.observe(_.current),()=>Q.disconnect()},[w,S,P]);let W=(Q,oe)=>{C&&C(Q,oe)},z=(Q,oe)=>{let ae=!b||T.has(oe)||Q.thumbnail&&Q.thumbnail.endsWith(".svg"),Le=(0,Ft.jsxs)(ie.div,{className:B(H5({variant:o,aspectRatio:r==="masonry"||r==="justified"?"auto":a,hover:i}),r==="masonry"&&"break-inside-avoid mb-4 inline-block w-full",r==="justified"&&"flex-grow",r==="horizontal"&&"flex-shrink-0 w-80"),style:r==="justified"?{flexBasis:"200px",maxWidth:"400px"}:void 0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.3,delay:oe*.05},"data-index":oe,ref:Ie=>{Ie&&F.current&&!T.has(oe)&&F.current.observe(Ie)},onClick:()=>W(Q,oe),children:[Q.type==="image"?(0,Ft.jsxs)("div",{className:B("relative w-full",r==="masonry"||r==="justified"?"":"h-full"),children:[(0,Ft.jsx)("img",{src:Q.thumbnail||Q.src,alt:Q.alt||`Gallery item ${oe+1}`,className:B("w-full object-cover",r==="masonry"?"h-auto":"h-full",ae?"opacity-100":"opacity-0","transition-opacity duration-300"),loading:b?"lazy":void 0,onLoad:()=>D(Ie=>new Set(Ie).add(oe))}),!ae&&(0,Ft.jsx)("div",{className:B("absolute inset-0 w-full bg-muted animate-pulse",r==="masonry"?"h-64":"h-full",r==="masonry"&&"aspect-[3/4]")})]}):(0,Ft.jsxs)("div",{className:B("relative w-full bg-black",r==="masonry"?"":"h-full"),children:[ae&&(Q.thumbnail||Q.poster)&&(0,Ft.jsx)("img",{src:Q.thumbnail||Q.poster,alt:Q.alt||`Video thumbnail ${oe+1}`,className:B("w-full object-cover",r==="masonry"?"h-auto":"h-full"),loading:b?"lazy":void 0}),(0,Ft.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,Ft.jsx)("div",{className:"w-12 h-12 bg-black/70 rounded-full flex items-center justify-center",children:(0,Ft.jsx)(nm,{className:"h-6 w-6 text-white"})})})]}),h&&(0,Ft.jsxs)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:[g?g(Q,oe):(0,Ft.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-4 text-white",children:[Q.title&&(0,Ft.jsx)("h3",{className:"text-sm font-semibold mb-1",children:Q.title}),Q.description&&(0,Ft.jsx)("p",{className:"text-xs opacity-90 line-clamp-2",children:Q.description})]}),m&&(0,Ft.jsx)("div",{className:"absolute top-2 right-2",children:(0,Ft.jsx)("div",{className:"w-8 h-8 bg-white/20 backdrop-blur-sm rounded-full flex items-center justify-center",children:Q.type==="image"?(0,Ft.jsx)(rl,{className:"h-4 w-4 text-white"}):(0,Ft.jsx)(nm,{className:"h-4 w-4 text-white"})})})]})]},oe);return s?(0,Ft.jsx)(SC,{index:oe,children:Le},oe):Le},G=()=>(0,Ft.jsx)("div",{className:B(H5({variant:o,aspectRatio:a})),children:(0,Ft.jsx)("div",{className:"w-full h-full bg-muted animate-pulse"})}),X=(0,Ft.jsxs)(Ft.Fragment,{children:[(l||c)&&(0,Ft.jsxs)("div",{className:"mb-6",children:[(0,Ft.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Ft.jsxs)("div",{className:"flex items-center gap-4",children:[l&&(0,Ft.jsxs)("button",{onClick:()=>k(!I),className:B("flex items-center gap-2 px-4 py-2 rounded-lg border transition-colors",I?"bg-primary text-primary-foreground border-primary":"bg-background border-border hover:bg-accent"),children:[(0,Ft.jsx)(Ii,{className:"h-4 w-4"}),"Filters"]}),c&&d.length>0&&(0,Ft.jsxs)("select",{value:V,onChange:Q=>R(Q.target.value),className:"px-4 py-2 rounded-lg border bg-background",children:[(0,Ft.jsx)("option",{value:"default",children:"Default order"}),d.map(Q=>(0,Ft.jsx)("option",{value:Q.id,children:Q.label},Q.id))]})]}),(0,Ft.jsxs)("div",{className:"text-sm text-muted-foreground",children:[j.length," items"]})]}),(0,Ft.jsx)(Dt,{children:I&&l&&(0,Ft.jsx)(ie.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:(0,Ft.jsx)("div",{className:"flex flex-wrap gap-2 pb-4",children:q.map(Q=>(0,Ft.jsxs)("button",{onClick:()=>U(Q.id),className:B("flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-colors",A===Q.id?"bg-primary text-primary-foreground":"bg-muted hover:bg-accent"),children:[Q.icon,Q.label]},Q.id))})})})]}),(0,Ft.jsx)("div",{ref:L,className:B(r==="masonry"?"columns-1 sm:columns-2 md:columns-3 lg:columns-4 gap-4":CNe({layout:r,columns:n}),e),style:r==="masonry"?{columnGap:"1rem"}:void 0,children:v?(0,Ft.jsx)(Ft.Fragment,{children:Array.from({length:y}).map((Q,oe)=>(0,Ft.jsx)(ys.Fragment,{children:G()},oe))}):j.length>0?j.map((Q,oe)=>z(Q,oe)):x||(0,Ft.jsxs)("div",{className:"col-span-full flex flex-col items-center justify-center py-12 text-center",children:[(0,Ft.jsx)(rl,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,Ft.jsx)("p",{className:"text-muted-foreground",children:"No media items found"})]})}),w&&P&&(0,Ft.jsx)("div",{ref:_,className:"flex justify-center py-8",children:(0,Ft.jsx)(Sr,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]});return s?(0,Ft.jsxs)(XI,{items:j,children:[X,(0,Ft.jsx)(PC,{showThumbnails:!0,showNavigation:!0,backdrop:"blur",...N})]}):X});SNe.displayName="MoonUIMediaGalleryPro";var PNe=ys.forwardRef(({className:e,item:t,index:r=0,variant:n,aspectRatio:o,hover:a,showType:i=!0,showOverlay:s=!0,overlayContent:l,onLoad:c,...u},d)=>{let[f,p]=ys.useState(!1),m=()=>{p(!0),c?.()};return(0,Ft.jsxs)("div",{ref:d,className:B(H5({variant:n,aspectRatio:o,hover:a}),e),...u,children:[t.type==="image"?(0,Ft.jsx)("img",{src:t.src,alt:t.alt||`Gallery item ${r+1}`,className:B("w-full h-full object-cover transition-opacity duration-300",f?"opacity-100":"opacity-0"),onLoad:m}):(0,Ft.jsxs)("div",{className:"relative w-full h-full bg-black",children:[t.poster&&(0,Ft.jsx)("img",{src:t.poster,alt:t.alt||`Video thumbnail ${r+1}`,className:"w-full h-full object-cover",onLoad:m}),(0,Ft.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,Ft.jsx)("div",{className:"w-12 h-12 bg-black/70 rounded-full flex items-center justify-center",children:(0,Ft.jsx)(nm,{className:"h-6 w-6 text-white"})})})]}),!f&&(0,Ft.jsx)("div",{className:"absolute inset-0 bg-muted animate-pulse"}),s&&f&&(0,Ft.jsxs)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:[l||(0,Ft.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-4 text-white",children:[t.title&&(0,Ft.jsx)("h3",{className:"text-sm font-semibold mb-1",children:t.title}),t.description&&(0,Ft.jsx)("p",{className:"text-xs opacity-90 line-clamp-2",children:t.description})]}),i&&(0,Ft.jsx)("div",{className:"absolute top-2 right-2",children:(0,Ft.jsx)("div",{className:"w-8 h-8 bg-white/20 backdrop-blur-sm rounded-full flex items-center justify-center",children:t.type==="image"?(0,Ft.jsx)(rl,{className:"h-4 w-4 text-white"}):(0,Ft.jsx)(nm,{className:"h-4 w-4 text-white"})})})]})]})});PNe.displayName="MoonUIGalleryItemPro";var Yh=E(de(),1);var hi=E(me(),1);function YI({items:e,onReorder:t,keyExtractor:r,renderItem:n,className:o,itemClassName:a,dragHandleClassName:i,showDragHandle:s=!1,dragHandleSize:l=16,disabled:c=!1,onDragStart:u,onDragEnd:d,gap:f=8,animationDuration:p=200,showDropIndicator:m=!0,dropIndicatorColor:h="primary",dropIndicatorStyle:g="glow",dragPreviewStyle:v="clone",hapticFeedback:y=!0}){let[x,C]=(0,Yh.useState)(null),[b,w]=(0,Yh.useState)(null),[S,P]=(0,Yh.useState)(!1),[N,O]=(0,Yh.useState)({x:0,y:0}),[L,A]=(0,Yh.useState)(!1),U=(0,Yh.useRef)(null),V=(0,Yh.useRef)(0),R=(0,Yh.useRef)(new Map),I=(j,H)=>{if(c)return;let q=e[H];U.current=q,C(H),P(!0);let W=j.currentTarget.getBoundingClientRect();if(O({x:j.clientX-W.left,y:j.clientY-W.top}),j.dataTransfer.effectAllowed="move",j.dataTransfer.setData("text/html",""),j.currentTarget instanceof HTMLElement){let z=j.currentTarget.cloneNode(!0);z.style.position="absolute",z.style.top="-1000px",z.style.width=`${W.width}px`,v==="ghost"?(z.style.opacity="0.5",z.style.filter="grayscale(100%)"):v==="clone"?(z.style.opacity="0.9",z.style.transform="scale(1.02) rotate(1deg)",z.style.boxShadow="0 10px 30px rgba(0,0,0,0.3)"):v==="compact"&&(z.style.transform="scale(0.95)",z.style.opacity="0.85"),z.style.pointerEvents="none",document.body.appendChild(z),j.dataTransfer.setDragImage(z,N.x,N.y),setTimeout(()=>document.body.removeChild(z),0)}y&&"vibrate"in navigator&&navigator.vibrate(10),u?.(q,H)},k=j=>{j.preventDefault(),V.current++},T=j=>{V.current--,V.current===0&&w(null)},D=(j,H)=>{if(j.preventDefault(),j.dataTransfer.dropEffect="move",c||x===null)return;if(H===x){w(null),A(!1);return}let q=j.currentTarget.getBoundingClientRect(),W=j.clientY-q.top,z=q.height,G=W<z/2?"before":"after";w({index:H,position:G}),A(!0),y&&"vibrate"in navigator&&navigator.vibrate(5)},F=j=>{if(j.preventDefault(),c||x===null||!b||U.current===null){_();return}let H=[...e],q=H[x],W=b.index;b.position==="after"&&(W=W+1),H.splice(x,1),x<W&&(W=W-1),H.splice(W,0,q),t(H),_()},_=()=>{U.current&&x!==null&&d?.(U.current,x),setTimeout(()=>{C(null),w(null),P(!1),A(!1),U.current=null,V.current=0},50),y&&"vibrate"in navigator&&navigator.vibrate([10,50,10])},M=j=>{if(!m||!S)return null;let H=j==="before"?"-top-1":"-bottom-1";return g==="line"?(0,hi.jsx)(ie.div,{initial:{opacity:0,scaleX:0},animate:{opacity:1,scaleX:1},exit:{opacity:0,scaleX:0},className:B("absolute left-0 right-0 h-1 z-50 pointer-events-none",H),children:(0,hi.jsxs)("div",{className:"h-full bg-primary rounded-full relative",children:[(0,hi.jsx)(ie.div,{animate:{x:[0,10,0]},transition:{repeat:1/0,duration:1},className:"absolute -left-2 top-1/2 -translate-y-1/2 w-4 h-4 bg-primary rounded-full"}),(0,hi.jsx)(ie.div,{animate:{x:[0,-10,0]},transition:{repeat:1/0,duration:1},className:"absolute -right-2 top-1/2 -translate-y-1/2 w-4 h-4 bg-primary rounded-full"})]})}):g==="area"?(0,hi.jsx)(ie.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:24},exit:{opacity:0,height:0},className:B("absolute left-0 right-0 z-40 pointer-events-none",j==="before"?"-top-3":"-bottom-3"),children:(0,hi.jsx)("div",{className:"h-full bg-primary/10 rounded-lg border-2 border-dashed border-primary/50"})}):g==="glow"?(0,hi.jsx)(ie.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},className:B("absolute left-0 right-0 h-2 z-50 pointer-events-none",H),children:(0,hi.jsxs)("div",{className:"h-full relative",children:[(0,hi.jsx)("div",{className:"absolute inset-0 bg-primary/30 blur-xl animate-pulse"}),(0,hi.jsx)("div",{className:"absolute inset-0 bg-primary rounded-full animate-pulse"}),(0,hi.jsx)(ie.div,{animate:{opacity:[.5,1,.5],scale:[.95,1.05,.95]},transition:{repeat:1/0,duration:2},className:"absolute inset-0 bg-gradient-to-r from-primary via-primary/50 to-primary rounded-full"})]})}):null};return(0,hi.jsxs)("div",{className:B("relative",S&&"select-none",o),onDragEnter:k,onDragLeave:T,onDrop:F,onDragOver:j=>j.preventDefault(),children:[(0,hi.jsx)(Dt,{children:e.map((j,H)=>{let q=r(j),W=x===H,z=b?.index===H&&b?.position==="before",G=b?.index===H&&b?.position==="after";return(0,hi.jsxs)(ie.div,{ref:X=>{X&&R.current.set(q,X)},layout:!0,layoutId:q,initial:{opacity:0,y:20},animate:{opacity:W?.3:1,y:0,scale:W?.95:1,rotate:W?2:0},exit:{opacity:0,scale:.95},transition:{type:"spring",stiffness:500,damping:30,duration:p/1e3},className:"relative",style:{marginBottom:f},children:[z&&M("before"),(0,hi.jsx)("div",{draggable:!c,onDragStart:X=>I(X,H),onDragOver:X=>D(X,H),onDragEnd:_,className:B("relative bg-card rounded-lg border transition-all",W&&"cursor-grabbing shadow-2xl",!W&&S&&"hover:shadow-lg hover:border-primary/30",!W&&!S&&!c&&"hover:shadow-md hover:border-border/80",!c&&"cursor-grab active:cursor-grabbing",z&&"translate-y-3",G&&"-translate-y-3",a),children:(0,hi.jsxs)("div",{className:"flex items-center gap-3 p-2",children:[s&&(0,hi.jsx)(ie.div,{className:"pl-2",whileHover:{scale:1.1},whileTap:{scale:.95},children:(0,hi.jsx)(oA,{className:B("flex-shrink-0 text-muted-foreground/50",!c&&"hover:text-muted-foreground","transition-colors",i),size:l})}),(0,hi.jsx)("div",{className:"flex-1",children:n(j,H)})]})}),G&&M("after")]},q)})}),S&&(0,hi.jsx)(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 pointer-events-none z-[100]",children:(0,hi.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-primary/5 to-transparent"})})]})}var Im=E(de(),1);var uo=E(me(),1),SZ=mt("relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 overflow-hidden min-w-fit",{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",gradient:"bg-gradient-to-r from-purple-600 to-pink-600 text-white hover:from-purple-700 hover:to-pink-700",glow:"bg-primary text-primary-foreground shadow-lg hover:shadow-xl hover:shadow-primary/25"},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-11 rounded-md px-6 text-base font-medium",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),INe=Im.default.forwardRef(({className:e,variant:t,size:r,animation:n="none",state:o="idle",onStateChange:a,children:i,onClick:s,loadingText:l="Loading...",successText:c="Success!",errorText:u="Error!",ripple:d=!1,iconRotate:f=!1,shimmerSpeed:p="normal",glowIntensity:m="medium",showProgressBar:h=!1,autoResetDelay:g=2e3,onDrag:v,onDragEnd:y,onDragStart:x,onAnimationStart:C,onAnimationEnd:b,...w},S)=>{let[P,N]=(0,Im.useState)("idle"),[O,L]=(0,Im.useState)([]),[A,U]=(0,Im.useState)(0),[V,R]=(0,Im.useState)(!1),I=o!=="idle"?o:P,k=async H=>{if(I!=="loading"){if(d){let q=H.currentTarget.getBoundingClientRect(),W=H.clientX-q.left,z=H.clientY-q.top,G=Date.now();L([...O,{x:W,y:z,id:G}]),setTimeout(()=>{L(X=>X.filter(Q=>Q.id!==G))},600)}if(N("loading"),a?.("loading"),U(0),h){let q=setInterval(()=>{U(W=>W>=90?(clearInterval(q),90):W+10)},200)}if(s)try{await s(H),U(100),N("success"),a?.("success"),setTimeout(()=>{N("idle"),a?.("idle"),U(0)},g)}catch{U(0),N("error"),a?.("error"),setTimeout(()=>{N("idle"),a?.("idle")},g)}}},T=()=>{let H=B("h-4 w-4",{"animate-spin":I==="loading"||f&&I!=="idle"});switch(I){case"loading":return(0,uo.jsx)(Sr,{className:H});case"success":return(0,uo.jsx)(Wr,{className:B(H,"animate-scale-in")});case"error":return(0,uo.jsx)(Zt,{className:B(H,"animate-shake")});default:return null}},D=()=>{switch(I){case"success":return"bg-green-600";case"error":return"bg-red-600";default:return""}},F=()=>{switch(p){case"slow":return"duration-1500";case"fast":return"duration-500";default:return"duration-1000"}},_=()=>{switch(m){case"low":return"shadow-lg";case"high":return"shadow-2xl";default:return"shadow-xl"}},M,j;return n==="bounce"?M={y:[0,-10,0],transition:{duration:.6,repeat:1/0,repeatType:"loop"}}:n==="pulse"?M={scale:[1,1.1,1],transition:{duration:1,repeat:1/0,repeatType:"loop"}}:n==="shake"?M=void 0:n==="rotate"?M={rotate:10,transition:{type:"spring",stiffness:300}}:n==="scale"?(M={scale:1.05},j={scale:.95}):n==="slide"&&(M={y:-4}),(0,uo.jsxs)(ie.button,{...w,className:B(SZ({variant:t,size:r}),t==="glow"&&_(),n==="shake"&&V&&"animate-shake",e),ref:S,onClick:k,disabled:I==="loading"||w.disabled,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),whileHover:M,whileTap:j,children:[h&&I==="loading"&&(0,uo.jsx)(ie.div,{className:"absolute bottom-0 left-0 h-1 bg-primary-foreground/20 rounded-full",initial:{width:0},animate:{width:`${A}%`},transition:{duration:.3}}),n==="shimmer"&&(0,uo.jsx)(ie.div,{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent",initial:{x:"-100%"},animate:{x:"100%"},transition:{duration:p==="slow"?1.5:p==="fast"?.5:1,repeat:1/0,repeatDelay:1}}),(0,uo.jsx)("div",{className:"relative flex items-center justify-center gap-2 z-10",children:r==="icon"?I==="idle"?i:T():(0,uo.jsx)(uo.Fragment,{children:I==="idle"?(0,uo.jsxs)(uo.Fragment,{children:[Im.default.isValidElement(i)&&Im.default.cloneElement(i),typeof i=="string"&&i,Im.default.isValidElement(i)||typeof i=="string"?null:i]}):(0,uo.jsxs)(uo.Fragment,{children:[T(),(0,uo.jsxs)("span",{className:"ml-2",children:[I==="loading"&&l,I==="success"&&c,I==="error"&&u]})]})})}),(0,uo.jsx)(ie.div,{className:B("absolute inset-0 rounded-md",D()),initial:{scale:0,opacity:0},animate:{scale:I==="success"||I==="error"?1:0,opacity:I==="success"||I==="error"?.2:0},transition:{duration:.3},style:{zIndex:0}}),O.map(H=>(0,uo.jsx)("span",{className:"absolute bg-primary/20 rounded-full animate-ripple pointer-events-none",style:{left:H.x-10,top:H.y-10,width:20,height:20}},H.id))]})});INe.displayName="MoonUIAnimatedButtonProInternal";var PZ=Im.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Ht();return!n&&!r?(0,uo.jsx)(Be,{className:B("w-fit",e.className),children:(0,uo.jsx)(Ve,{className:"py-6 text-center",children:(0,uo.jsxs)("div",{className:"space-y-4",children:[(0,uo.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,uo.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,uo.jsxs)("div",{children:[(0,uo.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,uo.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Animated Button is available exclusively to MoonUI Pro subscribers."}),(0,uo.jsx)("a",{href:"/pricing",children:(0,uo.jsxs)(ne,{size:"sm",children:[(0,uo.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,uo.jsx)(INe,{...e,ref:t})});PZ.displayName="MoonUIAnimatedButtonPro";var QI=E(de(),1);var da=E(me(),1),IZ=class extends QI.Component{constructor(r){super(r);this.resetTimeoutId=null;this.previousResetKeys=[];this.resetErrorBoundary=()=>{let{onReset:r}=this.props;r?.(),this.setState({hasError:!1,error:void 0,errorInfo:void 0})};this.state={hasError:!1},this.previousResetKeys=r.resetKeys||[]}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){let{onError:o,isolate:a}=this.props;this.setState({errorInfo:n}),o?.(r,n),console.error(a?"[Isolated ErrorBoundary] caught an error:":"ErrorBoundary caught an error:",r,n)}componentDidUpdate(r){let{resetKeys:n,resetOnPropsChange:o}=this.props,{hasError:a}=this.state;if(a&&n&&n.some((s,l)=>s!==this.previousResetKeys[l])&&(this.previousResetKeys=n,this.resetErrorBoundary()),a&&o&&r!==this.props){let i={...this.props,children:null},s={...r,children:null};JSON.stringify(i)!==JSON.stringify(s)&&this.resetErrorBoundary()}}renderFallback(){let{fallback:r,className:n,showErrorDetails:o}=this.props,{error:a,errorInfo:i}=this.state;return a?r?typeof r=="function"?(0,da.jsx)(r,{error:a,resetErrorBoundary:this.resetErrorBoundary,errorInfo:i}):r:(0,da.jsx)("div",{className:B("flex items-center justify-center min-h-[200px] p-4",n),children:(0,da.jsxs)(Be,{className:"w-full max-w-md",children:[(0,da.jsxs)(yr,{className:"text-center",children:[(0,da.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/20",children:(0,da.jsx)(Ri,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),(0,da.jsx)(Or,{children:"Something went wrong"}),(0,da.jsx)($i,{children:"An error occurred while rendering this component"})]}),(0,da.jsxs)(Ve,{className:"text-center",children:[o&&!1,(0,da.jsxs)(ne,{onClick:this.resetErrorBoundary,className:"mt-4",children:[(0,da.jsx)(yo,{className:"mr-2 h-4 w-4"}),"Try again"]})]})]})}):null}render(){let{hasError:r}=this.state,{children:n,isolate:o}=this.props;if(r){if(o)try{return this.renderFallback()}catch(a){return console.error("Error boundary fallback failed:",a),(0,da.jsx)("div",{className:"p-4 text-center text-red-600",children:"Critical error: Unable to recover"})}return this.renderFallback()}return n}componentWillUnmount(){this.resetTimeoutId&&clearTimeout(this.resetTimeoutId)}};function m0t(e){let{hasProAccess:t,isLoading:r}=Ht(),n=(0,QI.useRef)(e.resetKeys);return(0,QI.useEffect)(()=>{n.current=e.resetKeys},[e.resetKeys]),!r&&!t?(0,da.jsx)(Be,{className:B("w-fit",e.className),children:(0,da.jsx)(Ve,{className:"py-6 text-center",children:(0,da.jsxs)("div",{className:"space-y-4",children:[(0,da.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,da.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,da.jsxs)("div",{children:[(0,da.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,da.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Error Boundary is available exclusively to MoonUI Pro subscribers."}),(0,da.jsx)("a",{href:"/pricing",children:(0,da.jsxs)(ne,{size:"sm",children:[(0,da.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,da.jsx)(IZ,{...e})}var h0t=m0t;var CE=E(de(),1);var Ia=E(me(),1),RNe=CE.default.forwardRef(({actions:e=[],position:t="bottom-right",size:r="default",className:n,children:o,onClick:a,...i},s)=>{let[l,c]=(0,CE.useState)(!1),u={sm:"h-10 w-10",default:"h-12 w-12",lg:"h-14 w-14"},d={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},f={"bottom-right":{x:-60,y:0},"bottom-left":{x:60,y:0},"top-right":{x:-60,y:0},"top-left":{x:60,y:0}},p=m=>{e.length>0?c(!l):a&&a(m)};return(0,Ia.jsxs)("div",{className:B("fixed z-50",d[t]),children:[(0,Ia.jsx)(Dt,{children:l&&e.length>0&&(0,Ia.jsx)("div",{className:"absolute",children:e.map((m,h)=>(0,Ia.jsxs)(ie.div,{initial:{scale:0,opacity:0,x:0,y:0},animate:{scale:1,opacity:1,x:f[t].x,y:f[t].y*(h+1)-10},exit:{scale:0,opacity:0,x:0,y:0},transition:{delay:h*.05,type:"spring",stiffness:200,damping:15},className:"absolute flex items-center gap-2",style:{transform:`translate(${t.includes("right"),"0"}, ${t.includes("bottom"),"0"})`},children:[(0,Ia.jsx)(ie.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{delay:(h+1)*.05},className:B("px-2 py-1 bg-background/90 backdrop-blur-sm text-sm font-medium rounded-md shadow-sm border whitespace-nowrap",t.includes("right")?"mr-2":"ml-2"),children:m.label}),(0,Ia.jsx)("button",{onClick:()=>{m.onClick(),c(!1)},className:B("inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",u[r]),children:m.icon})]},h))})}),(0,Ia.jsx)(ie.button,{ref:s,className:B("inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",u[r],n),onClick:p,whileHover:{scale:1.1},whileTap:{scale:.9},animate:{rotate:l?45:0},transition:{duration:.2},children:o||(e.length>0?(0,Ia.jsx)(si,{className:"h-5 w-5"}):(0,Ia.jsx)(si,{className:"h-5 w-5"}))}),(0,Ia.jsx)(Dt,{children:l&&(0,Ia.jsx)(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[-1]",onClick:()=>c(!1)})})]})});RNe.displayName="FloatingActionButtonInternal";var kNe=CE.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ht();return!o&&!n?(0,Ia.jsx)(Be,{className:B("w-fit",e),children:(0,Ia.jsx)(Ve,{className:"py-6 text-center",children:(0,Ia.jsxs)("div",{className:"space-y-4",children:[(0,Ia.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Ia.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Ia.jsxs)("div",{children:[(0,Ia.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Ia.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Floating Action Button is available exclusively to MoonUI Pro subscribers."}),(0,Ia.jsx)("a",{href:"/pricing",children:(0,Ia.jsxs)(ne,{size:"sm",children:[(0,Ia.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Ia.jsx)(RNe,{className:e,ref:r,...t})});kNe.displayName="FloatingActionButton";var cl=E(de(),1);var xs=E(me(),1),NNe=mt("relative rounded-lg border bg-card text-card-foreground shadow-sm transition-all duration-200 isolate",{variants:{variant:{subtle:"hover:bg-card/95",dramatic:"hover:bg-gradient-to-br hover:from-card hover:to-card/80",gaming:"hover:border-primary/50 hover:shadow-lg hover:shadow-primary/25",elegant:"hover:border-border/50 hover:bg-gradient-to-br hover:from-card hover:via-card/95 hover:to-card/90",neon:"hover:border-primary hover:shadow-[0_0_30px_rgba(var(--primary),0.3)]"},shadowIntensity:{none:"",light:"hover:shadow-md",medium:"hover:shadow-lg",heavy:"hover:shadow-xl",extreme:"hover:shadow-2xl"},glowEffect:{none:"",subtle:"",vibrant:"",neon:""}},defaultVariants:{variant:"subtle",shadowIntensity:"medium",glowEffect:"none"}}),MNe=cl.default.forwardRef(({children:e,className:t,variant:r,shadowIntensity:n,glowEffect:o,perspective:a=1e3,maxRotation:i=15,rotationIntensity:s,scale:l=1.05,springConfig:c={stiffness:200,damping:15,mass:1,velocity:0},animationSpeed:u=1,overlay:d,overlayAlwaysVisible:f=!1,glowColor:p="rgb(var(--primary))",glowBlur:m=20,glowSpread:h=1.2,enableTouch:g=!0,enableKeyboard:v=!0,onHoverStart:y,onHoverEnd:x,onRotationChange:C,animationDelay:b=0,ariaLabel:w,autoFocus:S=!1,rotateAxes:P={x:!0,y:!0},...N},O)=>{let{onDrag:L,onDragStart:A,onDragEnd:U,onDragOver:V,onDrop:R,onAnimationStart:I,onAnimationEnd:k,onAnimationIteration:T,...D}=N,F=(0,cl.useRef)(null),[_,M]=(0,cl.useState)(!1),[j,H]=(0,cl.useState)(!1),q=i||s||15,W=Ca(0),z=Ca(0),G=Nh(W,{...c,stiffness:c.stiffness*u,damping:c.damping/u}),X=Nh(z,{...c,stiffness:c.stiffness*u,damping:c.damping/u}),Q=tc(X,[-1,1],P.x?[q,-q]:[0,0]),oe=tc(G,[-1,1],P.y?[-q,q]:[0,0]),ae=(0,cl.useCallback)(be=>{if(!F.current)return;let De=F.current.getBoundingClientRect(),Y=De.left+De.width/2,Z=De.top+De.height/2,te,Ce;if("touches"in be&&g)te=be.touches[0].clientX,Ce=be.touches[0].clientY;else if("clientX"in be)te=be.clientX,Ce=be.clientY;else return;let ke=(Ce-Z)/(De.height/2),ge=(te-Y)/(De.width/2);W.set(ge),z.set(ke),C&&C(Q.get(),oe.get())},[g,W,z,Q,oe,C]),Le=(0,cl.useCallback)(()=>{M(!0),y?.()},[y]),Ie=(0,cl.useCallback)(()=>{M(!1),W.set(0),z.set(0),x?.()},[W,z,x]),Oe=(0,cl.useCallback)(be=>{if(!v||!j)return;let De=.1,Y=W.get(),Z=z.get();switch(be.key){case"ArrowUp":Z=Math.max(-.5,Z-De),z.set(Z),be.preventDefault();break;case"ArrowDown":Z=Math.min(.5,Z+De),z.set(Z),be.preventDefault();break;case"ArrowLeft":Y=Math.max(-.5,Y-De),W.set(Y),be.preventDefault();break;case"ArrowRight":Y=Math.min(.5,Y+De),W.set(Y),be.preventDefault();break;case"Enter":case" ":M(!_),_?x?.():y?.(),be.preventDefault();break;case"Escape":W.set(0),z.set(0),M(!1),x?.(),be.preventDefault();break}C&&C(Q.get(),oe.get())},[v,j,W,z,_,y,x,Q,oe,C]);(0,cl.useEffect)(()=>{S&&F.current&&F.current.focus()},[S]);let ve=(0,cl.useMemo)(()=>d?typeof d=="function"?d({isHovered:_,rotateX:Q.get(),rotateY:oe.get()}):d:null,[d,_,Q,oe]),Re=(0,cl.useMemo)(()=>{if(o==="none")return{};let be=0,De=m,Y=h;switch(o){case"subtle":be=_?.3:0;break;case"vibrant":be=_?.6:0,De=m*1.5;break;case"neon":be=_?.8:0,De=m*2,Y=h*1.3;break}return{opacity:be,filter:`blur(${De}px)`,scale:Y,backgroundColor:p}},[o,_,m,h,p]);return(0,xs.jsx)("div",{style:{perspective:`${a}px`},children:(0,xs.jsxs)(ie.div,{ref:be=>{F.current=be,typeof O=="function"?O(be):O&&(O.current=be)},className:B(NNe({variant:r,shadowIntensity:n,glowEffect:o}),"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),onMouseMove:ae,onMouseEnter:Le,onMouseLeave:Ie,onTouchMove:g?ae:void 0,onTouchStart:g?Le:void 0,onTouchEnd:g?Ie:void 0,onKeyDown:Oe,onFocus:()=>H(!0),onBlur:()=>H(!1),style:{transformStyle:"preserve-3d",transformOrigin:"center center",rotateX:_||j?Q:0,rotateY:_||j?oe:0,scale:_||j?l:1},transition:{type:"spring",stiffness:c.stiffness,damping:c.damping,duration:.15*(1/u),delay:b/1e3},tabIndex:v?0:void 0,role:v?"button":void 0,"aria-label":w,...D,children:[(0,xs.jsx)(ie.div,{className:"relative z-10",animate:{z:_||j?20:0},transition:{duration:.2*(1/u)},children:e}),ve&&(0,xs.jsx)(ie.div,{className:"absolute inset-0 rounded-lg pointer-events-none z-20",animate:{opacity:f||_||j?1:0},transition:{duration:.3*(1/u)},children:ve}),r!=="subtle"&&(0,xs.jsx)(ie.div,{className:B("absolute inset-0 rounded-lg pointer-events-none",r==="dramatic"&&"bg-gradient-to-br from-white/10 via-transparent to-black/10",r==="gaming"&&"bg-gradient-to-br from-primary/10 via-transparent to-primary/5",r==="elegant"&&"bg-gradient-to-br from-white/5 via-transparent to-black/5",r==="neon"&&"bg-gradient-to-br from-primary/20 via-transparent to-primary/10"),animate:{opacity:_||j?1:0},transition:{duration:.3*(1/u)}}),o!=="none"&&(0,xs.jsx)(ie.div,{className:"absolute inset-0 rounded-lg pointer-events-none -z-10",animate:Re,transition:{duration:.3*(1/u)}})]})})});MNe.displayName="HoverCard3DInternal";var TNe=cl.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Ht();return!n&&!r?(0,xs.jsx)(Be,{className:B("w-fit",e.className),children:(0,xs.jsx)(Ve,{className:"py-6 text-center",children:(0,xs.jsxs)("div",{className:"space-y-4",children:[(0,xs.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,xs.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,xs.jsxs)("div",{children:[(0,xs.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,xs.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"3D Hover Card is available exclusively to MoonUI Pro subscribers."}),(0,xs.jsx)("a",{href:"/pricing",children:(0,xs.jsxs)(ne,{size:"sm",children:[(0,xs.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,xs.jsx)(MNe,{...e,ref:t})});TNe.displayName="HoverCard3D";var IC=E(de(),1);var Tl=E(me(),1),g0t=mt("relative inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{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",gradient:"bg-gradient-to-r from-purple-600 to-pink-600 text-white shadow-lg hover:from-purple-700 hover:to-pink-700"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"}},defaultVariants:{variant:"default",size:"default",radius:"md"}}),ANe=IC.default.forwardRef(({children:e,className:t,variant:r,size:n,radius:o,strength:a=.3,range:i=100,springConfig:s={stiffness:200,damping:15},...l},c)=>{let u=(0,IC.useRef)(null),[d,f]=(0,IC.useState)(!1),p=Ca(0),m=Ca(0),h=Nh(p,s),g=Nh(m,s),v=tc(g,[-i,i],[5,-5]),y=tc(h,[-i,i],[-5,5]),x=w=>{if(!u.current)return;let S=u.current.getBoundingClientRect(),P=S.left+S.width/2,N=S.top+S.height/2,O=w.clientX-P,L=w.clientY-N;Math.sqrt(O*O+L*L)<i&&(p.set(O*a),m.set(L*a))},C=()=>{f(!1),p.set(0),m.set(0)},b=()=>{f(!0)};return(0,Tl.jsxs)(ie.button,{ref:w=>{u.current=w,typeof c=="function"?c(w):c&&(c.current=w)},className:B(g0t({variant:r,size:n,radius:o}),t),onMouseMove:x,onMouseLeave:C,onMouseEnter:b,style:{x:h,y:g,rotateX:v,rotateY:y,transformPerspective:1e3},whileHover:{scale:1.05},whileTap:{scale:.95},animate:{rotateX:d?v.get():0,rotateY:d?y.get():0},transition:{duration:.3},children:[(0,Tl.jsx)(ie.div,{className:"relative z-10 flex items-center justify-center",animate:{scale:d?1.02:1},transition:{duration:.2},children:e}),(0,Tl.jsx)(ie.div,{className:B("absolute inset-0 bg-primary/20 blur-md",o==="none"&&"rounded-none",o==="sm"&&"rounded-sm",o==="md"&&"rounded-md",o==="lg"&&"rounded-lg",o==="xl"&&"rounded-xl",o==="full"&&"rounded-full",!o&&"rounded-md"),animate:{opacity:d?.8:0,scale:d?1.1:1},transition:{duration:.3}})]})});ANe.displayName="MagneticButtonInternal";var LNe=IC.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ht();return!o&&!n?(0,Tl.jsx)(Be,{className:B("w-fit",e),children:(0,Tl.jsx)(Ve,{className:"py-6 text-center",children:(0,Tl.jsxs)("div",{className:"space-y-4",children:[(0,Tl.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Tl.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Tl.jsxs)("div",{children:[(0,Tl.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Tl.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Magnetic Button is available exclusively to MoonUI Pro subscribers."}),(0,Tl.jsx)("a",{href:"/pricing",children:(0,Tl.jsxs)(ne,{size:"sm",children:[(0,Tl.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Tl.jsx)(ANe,{className:e,ref:r,...t})});LNe.displayName="MagneticButton";var Qo=E(de(),1);var Gn=E(me(),1),ENe=Qo.default.forwardRef(({children:e,minZoom:t=.5,maxZoom:r=3,initialZoom:n=1,className:o,contentClassName:a,onZoomChange:i,showControls:s=!0,showIndicator:l=!0,doubleTapBehavior:c="zoom",wheelScaling:u=!0,dragEnabled:d=!0,zoomStep:f=.5,smoothZoom:p=!0,boundaryConstraints:m=!0,...h},g)=>{let v=(0,Qo.useRef)(null),y=(0,Qo.useRef)(null),[x,C]=(0,Qo.useState)(!1),[b,w]=(0,Qo.useState)(!1),[S,P]=(0,Qo.useState)(0),[N,O]=(0,Qo.useState)(!1),[L,A]=(0,Qo.useState)(!1),U=Ca(n),V=Ca(0),R=Ca(0),I=tc(U,z=>Math.min(Math.max(z,t),r)),k=tc(U,z=>Math.round(z*100)),T=(0,Qo.useCallback)(()=>{if(!v.current||!y.current||!m)return{left:0,right:0,top:0,bottom:0};let z=v.current.getBoundingClientRect(),G=U.get(),X=z.width*G,Q=z.height*G,oe=Math.max(0,(X-z.width)/2),ae=Math.max(0,(Q-z.height)/2);return{left:-oe,right:oe,top:-ae,bottom:ae}},[U,m]);(0,Qo.useEffect)(()=>{if(!v.current||!u)return;let z=v.current,G=X=>{N&&u&&(X.ctrlKey||X.metaKey)&&X.preventDefault()};return z.addEventListener("wheel",G,{passive:!1}),()=>{z.removeEventListener("wheel",G)}},[N,u]);let D=(0,Qo.useCallback)(z=>{if(!u||!z.ctrlKey&&!z.metaKey)return;z.preventDefault();let G=-z.deltaY/1e3,X=U.get(),Q=Math.min(Math.max(X+G,t),r);if(v.current){let oe=v.current.getBoundingClientRect(),ae=(z.clientX-oe.left)/oe.width-.5,Le=(z.clientY-oe.top)/oe.height-.5,Ie=Q-X,Oe=V.get(),ve=R.get(),Re=Oe-ae*oe.width*Ie,be=ve-Le*oe.height*Ie;p?(Ko(V,Re,{duration:.2}),Ko(R,be,{duration:.2})):(V.set(Re),R.set(be))}p?Ko(U,Q,{duration:.2}):U.set(Q),i?.(Q),l&&(w(!0),setTimeout(()=>w(!1),1500))},[U,V,R,t,r,i,u,p,l]),F=(0,Qo.useCallback)(z=>{z.preventDefault();let G=U.get(),X;if(c==="reset")X=n;else if(X=G>1?1:2,X>1&&v.current){let Q=v.current.getBoundingClientRect(),oe=(z.clientX-Q.left)/Q.width-.5,ae=(z.clientY-Q.top)/Q.height-.5,Le=-oe*Q.width*(X-1),Ie=-ae*Q.height*(X-1);Ko(V,Le,{duration:.3,type:"spring",stiffness:300}),Ko(R,Ie,{duration:.3,type:"spring",stiffness:300})}Ko(U,Math.min(Math.max(X,t),r),{duration:.3,type:"spring",stiffness:300}),(X===1||c==="reset")&&(Ko(V,0,{duration:.3}),Ko(R,0,{duration:.3})),i?.(X),l&&(w(!0),setTimeout(()=>w(!1),1500))},[U,V,R,t,r,n,i,c,l]),_=(0,Qo.useCallback)(z=>{let G=Date.now(),X=G-S;if(X<300&&X>0){let Q=z.changedTouches[0],oe={clientX:Q.clientX,clientY:Q.clientY,preventDefault:()=>{}};F(oe)}P(G)},[S,F]),M=(0,Qo.useCallback)(()=>{Ko(U,n,{duration:.3,type:"spring",stiffness:300}),Ko(V,0,{duration:.3,type:"spring",stiffness:300}),Ko(R,0,{duration:.3,type:"spring",stiffness:300}),i?.(n)},[U,V,R,n,i]),j=(0,Qo.useCallback)(()=>{let z=U.get(),G=Math.min(z+f,r);Ko(U,G,{duration:.3,type:"spring",stiffness:300}),i?.(G),l&&(w(!0),setTimeout(()=>w(!1),1500))},[U,r,f,i,l]),H=(0,Qo.useCallback)(()=>{let z=U.get(),G=Math.max(z-f,t);if(Ko(U,G,{duration:.3,type:"spring",stiffness:300}),G<U.get()){let X=T(),Q=V.get(),oe=R.get();(Q<X.left||Q>X.right)&&Ko(V,0,{duration:.3}),(oe<X.top||oe>X.bottom)&&Ko(R,0,{duration:.3})}i?.(G),l&&(w(!0),setTimeout(()=>w(!1),1500))},[U,t,f,V,R,T,i,l]),q=(0,Qo.useCallback)(()=>{M()},[M]),W=(0,Qo.useCallback)(()=>{v.current&&(document.fullscreenElement?document.exitFullscreen().then(()=>{A(!1)}).catch(z=>{console.error("Exit fullscreen error:",z)}):(v.current.parentElement||v.current).requestFullscreen().then(()=>{A(!0)}).catch(G=>{console.error("Fullscreen error:",G)}))},[]);return(0,Qo.useEffect)(()=>{let z=()=>{A(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",z),document.addEventListener("webkitfullscreenchange",z),document.addEventListener("mozfullscreenchange",z),document.addEventListener("MSFullscreenChange",z),()=>{document.removeEventListener("fullscreenchange",z),document.removeEventListener("webkitfullscreenchange",z),document.removeEventListener("mozfullscreenchange",z),document.removeEventListener("MSFullscreenChange",z)}},[]),(0,Qo.useEffect)(()=>{if(!N||!u)return;let z=G=>{!G.ctrlKey&&!G.metaKey||(G.key==="+"||G.key==="="?(G.preventDefault(),j()):G.key==="-"||G.key==="_"?(G.preventDefault(),H()):G.key==="0"&&(G.preventDefault(),M()))};return document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z)}},[N,u,j,H,M]),(0,Qo.useEffect)(()=>U.onChange(()=>{let G=T(),X=V.get(),Q=R.get();m&&((X<G.left||X>G.right)&&Ko(V,Math.max(G.left,Math.min(G.right,X)),{duration:.2}),(Q<G.top||Q>G.bottom)&&Ko(R,Math.max(G.top,Math.min(G.bottom,Q)),{duration:.2}))}),[U,V,R,T,m]),(0,Gn.jsxs)("div",{ref:g,className:B("relative overflow-hidden touch-none select-none",d&&"cursor-grab active:cursor-grabbing",L&&"fixed inset-0 z-50 bg-background",o),onWheel:D,onDoubleClick:F,onTouchEnd:_,onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),...h,children:[(0,Gn.jsx)("div",{ref:v,className:"w-full h-full",children:(0,Gn.jsx)(ie.div,{ref:y,drag:d,dragElastic:.1,dragMomentum:!1,dragConstraints:m?T():!1,onDragStart:()=>C(!0),onDragEnd:()=>C(!1),style:{scale:I,x:V,y:R},className:B("w-full h-full flex items-center justify-center",x&&"cursor-grabbing",a),children:e})}),(0,Gn.jsx)(Dt,{children:l&&b&&(0,Gn.jsxs)(ie.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute top-4 left-1/2 -translate-x-1/2 px-3 py-1.5 bg-black/80 dark:bg-white/80 text-white dark:text-black rounded-full text-sm font-medium pointer-events-none",children:[k.get(),"%"]})}),s&&(0,Gn.jsxs)("div",{className:"absolute bottom-4 right-4 flex gap-2",children:[(0,Gn.jsx)("button",{onClick:H,disabled:U.get()<=t,className:B("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed","shadow-sm hover:shadow-md"),"aria-label":"Zoom out",children:(0,Gn.jsx)(Dd,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:j,disabled:U.get()>=r,className:B("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed","shadow-sm hover:shadow-md"),"aria-label":"Zoom in",children:(0,Gn.jsx)(Ed,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:M,className:B("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","shadow-sm hover:shadow-md"),"aria-label":"Reset zoom",children:(0,Gn.jsx)(Iw,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:W,className:B("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","shadow-sm hover:shadow-md"),"aria-label":L?"Exit fullscreen":"Enter fullscreen",children:L?(0,Gn.jsx)(Cw,{className:"w-4 h-4"}):(0,Gn.jsx)(Rl,{className:"w-4 h-4"})})]}),s&&(0,Gn.jsx)("div",{className:"absolute bottom-4 left-4 px-3 py-1.5 bg-background/80 backdrop-blur-sm border rounded-md text-sm",children:(0,Gn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Gn.jsxs)("span",{children:[Math.round(U.get()*100),"%"]}),u&&!b&&(0,Gn.jsx)("span",{className:"text-xs text-muted-foreground",children:"(Ctrl+Scroll to zoom)"})]})})]})});ENe.displayName="PinchZoomInternal";var DNe=Qo.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ht();return!o&&!n?(0,Gn.jsx)(Be,{className:B("w-fit",e),children:(0,Gn.jsx)(Ve,{className:"py-6 text-center",children:(0,Gn.jsxs)("div",{className:"space-y-4",children:[(0,Gn.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Gn.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Gn.jsxs)("div",{children:[(0,Gn.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Gn.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Pinch Zoom is available exclusively to MoonUI Pro subscribers."}),(0,Gn.jsx)("a",{href:"/pricing",children:(0,Gn.jsxs)(ne,{size:"sm",children:[(0,Gn.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Gn.jsx)(ENe,{className:e,ref:r,...t})});DNe.displayName="PinchZoom";var kb=E(de(),1);var Ki=E(me(),1),ONe=kb.default.forwardRef(({children:e,className:t,spotlightColor:r="rgba(255, 255, 255, 0.25)",spotlightSize:n=300,intensity:o=.8,borderGlow:a=!0,...i},s)=>{let l=(0,kb.useRef)(null),[c,u]=(0,kb.useState)({x:0,y:0}),[d,f]=(0,kb.useState)(!1),p=g=>{if(!l.current)return;let v=l.current.getBoundingClientRect(),y=g.clientX-v.left,x=g.clientY-v.top;u({x:y,y:x})},m=()=>{f(!0)},h=()=>{f(!1)};return(0,Ki.jsxs)(ie.div,{ref:g=>{l.current=g,typeof s=="function"?s(g):s&&(s.current=g)},className:B("relative overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm",t),onMouseMove:p,onMouseEnter:m,onMouseLeave:h,whileHover:{scale:1.02},transition:{duration:.2},children:[(0,Ki.jsx)(ie.div,{className:"absolute inset-0 pointer-events-none",animate:{opacity:d?o:0},transition:{duration:.3},style:{background:`radial-gradient(${n}px circle at ${c.x}px ${c.y}px, ${r}, transparent 70%)`}}),(0,Ki.jsx)(ie.div,{className:"absolute inset-0 pointer-events-none",animate:{opacity:d?o*.5:0},transition:{duration:.4,delay:.1},style:{background:`radial-gradient(${n*1.5}px circle at ${c.x}px ${c.y}px, ${r.replace("0.25","0.1")}, transparent 80%)`}}),a&&(0,Ki.jsx)(ie.div,{className:"absolute inset-0 rounded-lg pointer-events-none",animate:{opacity:d?.6:0},transition:{duration:.3},style:{background:`linear-gradient(135deg, transparent 30%, ${r.replace("0.25","0.4")} 50%, transparent 70%)`,backgroundSize:"200% 200%",backgroundPosition:`${c.x/l.current?.offsetWidth*100}% ${c.y/l.current?.offsetHeight*100}%`}}),(0,Ki.jsx)("div",{className:"relative z-10",children:e}),(0,Ki.jsx)(ie.div,{className:"absolute inset-0 pointer-events-none",animate:{opacity:d?.3:0},transition:{duration:.5},children:[...Array(3)].map((g,v)=>(0,Ki.jsx)(ie.div,{className:"absolute w-1 h-1 bg-white rounded-full",animate:d?{x:[c.x,c.x+Math.random()*100-50],y:[c.y,c.y+Math.random()*100-50],opacity:[0,1,0],scale:[0,1,0]}:{},transition:{duration:2,delay:v*.2,repeat:d?1/0:0,ease:"easeOut"},style:{left:c.x,top:c.y}},v))})]})});ONe.displayName="SpotlightCardInternal";var _Ne=kb.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ht();return!o&&!n?(0,Ki.jsx)(Be,{className:B("w-fit",e),children:(0,Ki.jsx)(Ve,{className:"py-6 text-center",children:(0,Ki.jsxs)("div",{className:"space-y-4",children:[(0,Ki.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Ki.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Ki.jsxs)("div",{children:[(0,Ki.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Ki.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Spotlight Card is available exclusively to MoonUI Pro subscribers."}),(0,Ki.jsx)("a",{href:"/pricing",children:(0,Ki.jsxs)(ne,{size:"sm",children:[(0,Ki.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Ki.jsx)(ONe,{className:e,ref:r,...t})});_Ne.displayName="SpotlightCard";var Hs=E(de(),1);var ZI=E(de(),1);var tr=E(me(),1),FNe=[{value:"meeting",label:"Meeting",color:"#3b82f6"},{value:"task",label:"Task",color:"#10b981"},{value:"reminder",label:"Reminder",color:"#f59e0b"},{value:"event",label:"Event",color:"#8b5cf6"}],v0t=["#3b82f6","#10b981","#f59e0b","#8b5cf6","#ef4444","#06b6d4","#84cc16","#f97316","#ec4899","#6366f1","#14b8a6","#eab308","#f43f5e","#a855f7","#22c55e","#64748b"];function BNe({open:e,onOpenChange:t,event:r,selectedDate:n,onSave:o,onDelete:a,mode:i="create"}){let[s,l]=(0,ZI.useState)({title:"",description:"",date:"",startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""}),[c,u]=(0,ZI.useState)({}),[d,f]=(0,ZI.useState)(!1);(0,ZI.useEffect)(()=>{if(i==="edit"&&r)l({title:r.title||"",description:r.description||"",date:r.date.toISOString().split("T")[0],startTime:r.startTime||"",endTime:r.endTime||"",location:r.location||"",type:r.type||"meeting",color:r.color||"#3b82f6",attendees:r.attendees?.join(", ")||""});else if(i==="create"){let v=n?n.toISOString().split("T")[0]:new Date().toISOString().split("T")[0];l({title:"",description:"",date:v,startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""})}u({})},[r,n,i,e]);let p=()=>{let v={};return s.title.trim()||(v.title="Title is required"),s.date||(v.date="Date is required"),s.startTime&&s.endTime&&s.startTime>=s.endTime&&(v.endTime="End time must be after start time"),u(v),Object.keys(v).length===0},m=async v=>{if(v.preventDefault(),!!p()){f(!0);try{let y={...i==="edit"&&r?{id:r.id}:{},title:s.title.trim(),description:s.description.trim(),date:new Date(s.date+"T00:00:00"),startTime:s.startTime||void 0,endTime:s.endTime||void 0,location:s.location.trim()||void 0,type:s.type,color:s.color,attendees:s.attendees?s.attendees.split(",").map(x=>x.trim()).filter(Boolean):void 0};await o(y),t(!1)}catch(y){console.error("Error saving event:",y)}finally{f(!1)}}},h=()=>{r&&a&&(a(r.id),t(!1))},g=v=>{let y=FNe.find(x=>x.value===v);l(x=>({...x,type:v,color:y?.color||x.color}))};return(0,tr.jsx)(sa,{open:e,onOpenChange:t,children:(0,tr.jsxs)(Xo,{className:"sm:max-w-[500px]",children:[(0,tr.jsxs)(Pa,{children:[(0,tr.jsxs)(la,{className:"flex items-center gap-2",children:[(0,tr.jsx)(Va,{className:"w-5 h-5"}),i==="create"?"Create Event":"Edit Event"]}),(0,tr.jsx)(il,{children:i==="create"?"Add a new event to your calendar.":"Edit the event details."})]}),(0,tr.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"title",children:"Title *"}),(0,tr.jsx)(Kt,{id:"title",value:s.title,onChange:v=>l(y=>({...y,title:v.target.value})),placeholder:"Event title",className:B(c.title&&"border-red-500")}),c.title&&(0,tr.jsx)("p",{className:"text-sm text-red-500",children:c.title})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"description",children:"Description"}),(0,tr.jsx)(Yc,{id:"description",value:s.description,onChange:v=>l(y=>({...y,description:v.target.value})),placeholder:"Event description (optional)",rows:3})]}),(0,tr.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"date",children:"Date *"}),(0,tr.jsx)(Kt,{id:"date",type:"date",value:s.date,onChange:v=>l(y=>({...y,date:v.target.value})),className:B(c.date&&"border-red-500")}),c.date&&(0,tr.jsx)("p",{className:"text-sm text-red-500",children:c.date})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"startTime",children:"Start Time"}),(0,tr.jsx)(Kt,{id:"startTime",type:"time",value:s.startTime,onChange:v=>l(y=>({...y,startTime:v.target.value})),placeholder:"09:00"})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"endTime",children:"End Time"}),(0,tr.jsx)(Kt,{id:"endTime",type:"time",value:s.endTime,onChange:v=>l(y=>({...y,endTime:v.target.value})),placeholder:"10:00",className:B(c.endTime&&"border-red-500")}),c.endTime&&(0,tr.jsx)("p",{className:"text-sm text-red-500",children:c.endTime})]})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsxs)(bt,{htmlFor:"location",className:"flex items-center gap-2",children:[(0,tr.jsx)(Df,{className:"w-4 h-4"}),"Location"]}),(0,tr.jsx)(Kt,{id:"location",value:s.location,onChange:v=>l(y=>({...y,location:v.target.value})),placeholder:"Meeting room, address, or link"})]}),(0,tr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsxs)(bt,{className:"flex items-center gap-2",children:[(0,tr.jsx)(Nw,{className:"w-4 h-4"}),"Type"]}),(0,tr.jsxs)(Eo,{value:s.type,onValueChange:g,children:[(0,tr.jsx)(Do,{children:(0,tr.jsx)(Yo,{})}),(0,tr.jsx)(Oo,{children:FNe.map(v=>(0,tr.jsx)(Tt,{value:v.value,children:(0,tr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,tr.jsx)("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:v.color}}),v.label]})},v.value))})]})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsxs)(bt,{className:"flex items-center gap-2",children:[(0,tr.jsx)(Oc,{className:"w-4 h-4"}),"Color"]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,tr.jsx)("input",{type:"color",value:s.color,onChange:v=>l(y=>({...y,color:v.target.value})),className:"w-8 h-8 rounded border cursor-pointer flex-shrink-0"}),(0,tr.jsx)("span",{className:"text-sm text-muted-foreground",children:"Custom color"})]}),(0,tr.jsx)("div",{className:"grid grid-cols-8 gap-1",children:v0t.map(v=>(0,tr.jsx)("button",{type:"button",onClick:()=>l(y=>({...y,color:v})),className:B("w-full aspect-square rounded border-2 hover:scale-110 transition-transform",s.color===v?"border-foreground shadow-sm":"border-transparent"),style:{backgroundColor:v},"aria-label":`Select color ${v}`},v))})]})]})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"attendees",children:"Attendees"}),(0,tr.jsx)(Kt,{id:"attendees",value:s.attendees,onChange:v=>l(y=>({...y,attendees:v.target.value})),placeholder:"John Doe, Jane Smith (comma-separated)"})]}),(0,tr.jsxs)(um,{className:"gap-2",children:[i==="edit"&&a&&(0,tr.jsx)(ne,{type:"button",variant:"destructive",onClick:h,className:"mr-auto",children:"Delete Event"}),(0,tr.jsx)(ne,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:d,children:"Cancel"}),(0,tr.jsx)(ne,{type:"submit",disabled:d,children:d?i==="create"?"Creating...":"Saving...":i==="create"?"Create Event":"Save Changes"})]})]})]})})}var Se=E(me(),1),RZ=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],VNe=["January","February","March","April","May","June","July","August","September","October","November","December"],JI={meeting:"bg-blue-500",task:"bg-green-500",reminder:"bg-yellow-500",event:"bg-purple-500",birthday:"bg-pink-500",holiday:"bg-orange-500",conference:"bg-indigo-500"},y0t={low:"border-l-4 border-l-muted-foreground",medium:"border-l-4 border-l-yellow-500",high:"border-l-4 border-l-red-500"},x0t={confirmed:"",tentative:"opacity-70 border-dashed",cancelled:"opacity-50 line-through"};function b0t({events:e=[],onEventClick:t,onEventAdd:r,onEventEdit:n,onEventDelete:o,onDateChange:a,onViewChange:i,onEventDrop:s,className:l,showWeekends:c=!0,showEventDetails:u=!0,disabled:d=!1,minDate:f,maxDate:p,highlightToday:m=!0,height:h,defaultView:g="month",enableDragDrop:v=!0,enableSearch:y=!0,enableFilters:x=!0,enableExport:C=!0,enableImport:b=!1,enableRecurringEvents:w=!0,enableReminders:S=!0,eventCategories:P,workingHours:N={start:"09:00",end:"18:00"},holidays:O=[],locale:L="en-US",timeFormat:A="12h",firstDayOfWeek:U=0,theme:V="auto",customTheme:R,compactMode:I=!1,showProUpgrade:k=!1}){if(k)return(0,Se.jsx)(Be,{className:B("w-full",l),children:(0,Se.jsx)(Ve,{className:"py-12 text-center",children:(0,Se.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,Se.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Se.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Se.jsxs)("div",{children:[(0,Se.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,Se.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Calendar is available exclusively to MoonUI Pro subscribers."}),(0,Se.jsx)("div",{className:"flex gap-3 justify-center",children:(0,Se.jsx)("a",{href:"/pricing",children:(0,Se.jsxs)(ne,{size:"sm",children:[(0,Se.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[T,D]=Hs.default.useState(new Date),[F,_]=Hs.default.useState(null),[M,j]=Hs.default.useState(g),[H,q]=Hs.default.useState(!1),[W,z]=Hs.default.useState("create"),[G,X]=Hs.default.useState(null),[Q,oe]=Hs.default.useState(null),[ae,Le]=Hs.default.useState(null),[Ie,Oe]=Hs.default.useState(""),[ve,Re]=Hs.default.useState("all"),[be,De]=Hs.default.useState("all"),[Y,Z]=Hs.default.useState(!1),[te,Ce]=Hs.default.useState([]),[ke,ge]=Hs.default.useState(new Date),[ee,le]=Hs.default.useState(!1),[ue,he]=Hs.default.useState(!1),qe=new Date,_t=T.getMonth(),Zn=T.getFullYear(),We=new Date(Zn,_t,1),Ye=new Date(Zn,_t+1,0),pe=new Date(We),Ge=(pe.getDay()-U+7)%7;pe.setDate(pe.getDate()-Ge);let at=new Date(Ye),ht=(6-at.getDay()+U)%7;at.setDate(at.getDate()+ht);let fr=[],jt=new Date(pe);for(;jt<=at;)fr.push(new Date(jt)),jt.setDate(jt.getDate()+1);let Jt=Hs.default.useMemo(()=>{let _e=new Set;return e.forEach(rt=>{rt.tags?.forEach(xt=>_e.add(xt))}),Array.from(_e)},[e]),rr=Hs.default.useMemo(()=>e.filter(_e=>!(Ie&&!_e.title.toLowerCase().includes(Ie.toLowerCase())&&!_e.description?.toLowerCase().includes(Ie.toLowerCase())||ve!=="all"&&_e.type!==ve||be!=="all"&&_e.priority!==be||te.length>0&&(!_e.tags||!_e.tags.some(rt=>te.includes(rt))))),[e,Ie,ve,be,te]),Sn=_e=>rr.filter(rt=>{let xt=new Date(rt.date);return rt.recurring?On(_e,rt):xt.toDateString()===_e.toDateString()}),On=(_e,rt)=>{if(!rt.recurring)return!1;let xt=new Date(rt.date),Nr=Math.floor((_e.getTime()-xt.getTime())/(1e3*60*60*24));if(Nr<0||rt.recurring.endDate&&_e>rt.recurring.endDate)return!1;switch(rt.recurring.pattern){case"daily":return Nr%rt.recurring.interval===0;case"weekly":return Nr%(rt.recurring.interval*7)!==0?!1:rt.recurring.daysOfWeek?rt.recurring.daysOfWeek.includes(_e.getDay()):_e.getDay()===xt.getDay();case"monthly":return((_e.getFullYear()-xt.getFullYear())*12+(_e.getMonth()-xt.getMonth()))%rt.recurring.interval!==0?!1:rt.recurring.dayOfMonth?_e.getDate()===rt.recurring.dayOfMonth:_e.getDate()===xt.getDate();case"yearly":return(_e.getFullYear()-xt.getFullYear())%rt.recurring.interval!==0?!1:_e.getMonth()===xt.getMonth()&&_e.getDate()===xt.getDate();default:return!1}},ln=_e=>_e.toDateString()===qe.toDateString(),cn=_e=>_e.getMonth()===_t,wi=_e=>F&&_e.toDateString()===F.toDateString(),Ci=_e=>!!(d||f&&_e<f||p&&_e>p),ri=_e=>{let rt=new Date(T);_e==="prev"?rt.setMonth(_t-1):rt.setMonth(_t+1),D(rt),a?.(rt)},yu=_e=>{j(_e),i?.(_e)},xd=()=>{let _e=Zs(rr),rt=new Blob([_e],{type:"text/calendar"}),xt=URL.createObjectURL(rt),Nr=document.createElement("a");Nr.href=xt,Nr.download="calendar.ics",Nr.click(),URL.revokeObjectURL(xt)},Zs=_e=>{let rt=`BEGIN:VCALENDAR\r
|
|
120
|
+
Defaulting to \`null\`.`}var lQ=YPe,eIe=ZPe;var cQ=E(me(),1),ps=tIe.forwardRef(({className:e,value:t,...r},n)=>(0,cQ.jsx)(lQ,{ref:n,className:B("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,cQ.jsx)(eIe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ps.displayName=lQ.displayName;var tp=E(de(),1);var jd=E(me(),1),Oz=mt("aspect-square border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-border bg-background text-primary",outline:"border-border bg-transparent text-primary",filled:"border-primary bg-primary/10 text-primary"},size:{sm:"h-3.5 w-3.5",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"default",size:"default"}}),JL=tp.createContext({}),fC=tp.forwardRef(({className:e,value:t,onValueChange:r,disabled:n,name:o,...a},i)=>(0,jd.jsx)(JL.Provider,{value:{value:t,onValueChange:r,disabled:n,name:o},children:(0,jd.jsx)("div",{ref:i,role:"radiogroup",className:B("grid gap-2",e),...a})}));fC.displayName="RadioGroupPro";var _v=tp.forwardRef(({className:e,variant:t,size:r,indicator:n,id:o,value:a,disabled:i,...s},l)=>{let c=tp.useContext(JL),u=tp.useId(),d=o||u,f=c.value===a,p=m=>{c.onValueChange&&c.onValueChange(m.target.value),s.onChange&&s.onChange(m)};return(0,jd.jsxs)("div",{className:"relative flex items-center",children:[(0,jd.jsx)("input",{type:"radio",id:d,ref:l,value:a,checked:f,disabled:i||c.disabled,name:c.name,onChange:p,className:"sr-only",...s}),(0,jd.jsx)("label",{htmlFor:d,className:B(Oz({variant:t,size:r}),"rounded-full","focus-visible:ring-primary/50","relative inline-flex shrink-0 cursor-pointer items-center justify-center overflow-hidden",i&&"cursor-not-allowed opacity-50",e),children:(0,jd.jsx)("span",{className:B("absolute inset-0 pointer-events-none",f&&"flex items-center justify-center"),children:f&&(n||(0,jd.jsx)(Lf,{className:"h-[60%] w-[60%] fill-current text-current"}))})})]})});_v.displayName="RadioGroupItemPro";var eE=tp.forwardRef(({className:e,htmlFor:t,children:r,disabled:n=!1,...o},a)=>(0,jd.jsx)("label",{ref:a,htmlFor:t,className:B("text-sm font-medium leading-none ml-2 text-foreground",n&&"cursor-not-allowed opacity-70",e),...o,children:r}));eE.displayName="RadioLabelPro";var _z=tp.forwardRef(({id:e,label:t,labelClassName:r,...n},o)=>{let a=tp.useId(),i=e||a;return(0,jd.jsxs)("div",{className:"flex items-center",children:[(0,jd.jsx)(_v,{ref:o,id:i,...n}),(0,jd.jsx)(eE,{htmlFor:i,disabled:n.disabled,className:r,children:t})]})});_z.displayName="RadioItemWithLabelPro";var hQ=E(de(),1);var sr=E(de(),1);var nIe=E(de(),1),lo=E(me(),1);function Cyt(e,t){return nIe.useReducer((r,n)=>t[r][n]??r,e)}var uQ="ScrollArea",[oIe,nHr]=Fn(uQ),[Syt,rp]=oIe(uQ),aIe=sr.forwardRef((e,t)=>{let{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:a=600,...i}=e,[s,l]=sr.useState(null),[c,u]=sr.useState(null),[d,f]=sr.useState(null),[p,m]=sr.useState(null),[h,g]=sr.useState(null),[v,y]=sr.useState(0),[x,C]=sr.useState(0),[b,w]=sr.useState(!1),[S,P]=sr.useState(!1),N=Gt(t,L=>l(L)),O=Af(o);return(0,lo.jsx)(Syt,{scope:r,type:n,dir:O,scrollHideDelay:a,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:b,onScrollbarXEnabledChange:w,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:S,onScrollbarYEnabledChange:P,onCornerWidthChange:y,onCornerHeightChange:C,children:(0,lo.jsx)(ot.div,{dir:O,...i,ref:N,style:{position:"relative",["--radix-scroll-area-corner-width"]:v+"px",["--radix-scroll-area-corner-height"]:x+"px",...e.style}})})});aIe.displayName=uQ;var iIe="ScrollAreaViewport",sIe=sr.forwardRef((e,t)=>{let{__scopeScrollArea:r,children:n,nonce:o,...a}=e,i=rp(iIe,r),s=sr.useRef(null),l=Gt(t,s,i.onViewportChange);return(0,lo.jsxs)(lo.Fragment,{children:[(0,lo.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,lo.jsx)(ot.div,{"data-radix-scroll-area-viewport":"",...a,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,lo.jsx)("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});sIe.displayName=iIe;var Uh="ScrollAreaScrollbar",Vz=sr.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rp(Uh,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:i}=o,s=e.orientation==="horizontal";return sr.useEffect(()=>(s?a(!0):i(!0),()=>{s?a(!1):i(!1)}),[s,a,i]),o.type==="hover"?(0,lo.jsx)(Pyt,{...n,ref:t,forceMount:r}):o.type==="scroll"?(0,lo.jsx)(Iyt,{...n,ref:t,forceMount:r}):o.type==="auto"?(0,lo.jsx)(lIe,{...n,ref:t,forceMount:r}):o.type==="always"?(0,lo.jsx)(dQ,{...n,ref:t}):null});Vz.displayName=Uh;var Pyt=sr.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rp(Uh,e.__scopeScrollArea),[a,i]=sr.useState(!1);return sr.useEffect(()=>{let s=o.scrollArea,l=0;if(s){let c=()=>{window.clearTimeout(l),i(!0)},u=()=>{l=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),(0,lo.jsx)(Ro,{present:r||a,children:(0,lo.jsx)(lIe,{"data-state":a?"visible":"hidden",...n,ref:t})})}),Iyt=sr.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rp(Uh,e.__scopeScrollArea),a=e.orientation==="horizontal",i=Uz(()=>l("SCROLL_END"),100),[s,l]=Cyt("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return sr.useEffect(()=>{if(s==="idle"){let c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,o.scrollHideDelay,l]),sr.useEffect(()=>{let c=o.viewport,u=a?"scrollLeft":"scrollTop";if(c){let d=c[u],f=()=>{let p=c[u];d!==p&&(l("SCROLL"),i()),d=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,a,l,i]),(0,lo.jsx)(Ro,{present:r||s!=="hidden",children:(0,lo.jsx)(dQ,{"data-state":s==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Ze(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Ze(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),lIe=sr.forwardRef((e,t)=>{let r=rp(Uh,e.__scopeScrollArea),{forceMount:n,...o}=e,[a,i]=sr.useState(!1),s=e.orientation==="horizontal",l=Uz(()=>{if(r.viewport){let c=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;i(s?c:u)}},10);return BI(r.viewport,l),BI(r.content,l),(0,lo.jsx)(Ro,{present:n||a,children:(0,lo.jsx)(dQ,{"data-state":a?"visible":"hidden",...o,ref:t})})}),dQ=sr.forwardRef((e,t)=>{let{orientation:r="vertical",...n}=e,o=rp(Uh,e.__scopeScrollArea),a=sr.useRef(null),i=sr.useRef(0),[s,l]=sr.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=fIe(s.viewport,s.content),u={...n,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>a.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function d(f,p){return Ayt(f,i.current,s,p)}return r==="horizontal"?(0,lo.jsx)(Ryt,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){let f=o.viewport.scrollLeft,p=rIe(f,s,o.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):r==="vertical"?(0,lo.jsx)(kyt,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){let f=o.viewport.scrollTop,p=rIe(f,s);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),Ryt=sr.forwardRef((e,t)=>{let{sizes:r,onSizesChange:n,...o}=e,a=rp(Uh,e.__scopeScrollArea),[i,s]=sr.useState(),l=sr.useRef(null),c=Gt(t,l,a.onScrollbarXChange);return sr.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,lo.jsx)(uIe,{"data-orientation":"horizontal",...o,ref:c,sizes:r,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,["--radix-scroll-area-thumb-width"]:zz(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(a.viewport){let f=a.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),mIe(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Bz(i.paddingLeft),paddingEnd:Bz(i.paddingRight)}})}})}),kyt=sr.forwardRef((e,t)=>{let{sizes:r,onSizesChange:n,...o}=e,a=rp(Uh,e.__scopeScrollArea),[i,s]=sr.useState(),l=sr.useRef(null),c=Gt(t,l,a.onScrollbarYChange);return sr.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,lo.jsx)(uIe,{"data-orientation":"vertical",...o,ref:c,sizes:r,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)",["--radix-scroll-area-thumb-height"]:zz(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(a.viewport){let f=a.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),mIe(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Bz(i.paddingTop),paddingEnd:Bz(i.paddingBottom)}})}})}),[Nyt,cIe]=oIe(Uh),uIe=sr.forwardRef((e,t)=>{let{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:a,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,p=rp(Uh,r),[m,h]=sr.useState(null),g=Gt(t,N=>h(N)),v=sr.useRef(null),y=sr.useRef(""),x=p.viewport,C=n.content-n.viewport,b=qn(u),w=qn(l),S=Uz(d,10);function P(N){if(v.current){let O=N.clientX-v.current.left,L=N.clientY-v.current.top;c({x:O,y:L})}}return sr.useEffect(()=>{let N=O=>{let L=O.target;m?.contains(L)&&b(O,C)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[x,m,C,b]),sr.useEffect(w,[n,w]),BI(m,S),BI(p.content,S),(0,lo.jsx)(Nyt,{scope:r,scrollbar:m,hasThumb:o,onThumbChange:qn(a),onThumbPointerUp:qn(i),onThumbPositionChange:w,onThumbPointerDown:qn(s),children:(0,lo.jsx)(ot.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:Ze(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),v.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),P(N))}),onPointerMove:Ze(e.onPointerMove,P),onPointerUp:Ze(e.onPointerUp,N=>{let O=N.target;O.hasPointerCapture(N.pointerId)&&O.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),Fz="ScrollAreaThumb",fQ=sr.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=cIe(Fz,e.__scopeScrollArea);return(0,lo.jsx)(Ro,{present:r||o.hasThumb,children:(0,lo.jsx)(Myt,{ref:t,...n})})}),Myt=sr.forwardRef((e,t)=>{let{__scopeScrollArea:r,style:n,...o}=e,a=rp(Fz,r),i=cIe(Fz,r),{onThumbPositionChange:s}=i,l=Gt(t,d=>i.onThumbChange(d)),c=sr.useRef(void 0),u=Uz(()=>{c.current&&(c.current(),c.current=void 0)},100);return sr.useEffect(()=>{let d=a.viewport;if(d){let f=()=>{if(u(),!c.current){let p=Lyt(d,s);c.current=p,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[a.viewport,u,s]),(0,lo.jsx)(ot.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Ze(e.onPointerDownCapture,d=>{let p=d.target.getBoundingClientRect(),m=d.clientX-p.left,h=d.clientY-p.top;i.onThumbPointerDown({x:m,y:h})}),onPointerUp:Ze(e.onPointerUp,i.onThumbPointerUp)})});fQ.displayName=Fz;var pQ="ScrollAreaCorner",dIe=sr.forwardRef((e,t)=>{let r=rp(pQ,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?(0,lo.jsx)(Tyt,{...e,ref:t}):null});dIe.displayName=pQ;var Tyt=sr.forwardRef((e,t)=>{let{__scopeScrollArea:r,...n}=e,o=rp(pQ,r),[a,i]=sr.useState(0),[s,l]=sr.useState(0),c=!!(a&&s);return BI(o.scrollbarX,()=>{let u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),BI(o.scrollbarY,()=>{let u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),i(u)}),c?(0,lo.jsx)(ot.div,{...n,ref:t,style:{width:a,height:s,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Bz(e){return e?parseInt(e,10):0}function fIe(e,t){let r=e/t;return isNaN(r)?0:r}function zz(e){let t=fIe(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Ayt(e,t,r,n="ltr"){let o=zz(r),a=o/2,i=t||a,s=o-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,u=r.content-r.viewport,d=n==="ltr"?[0,u]:[u*-1,0];return pIe([l,c],d)(e)}function rIe(e,t,r="ltr"){let n=zz(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-n,l=r==="ltr"?[0,i]:[i*-1,0],c=VL(e,l);return pIe([0,i],[0,s])(c)}function pIe(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function mIe(e,t){return e>0&&e<t}var Lyt=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){let a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,s=r.top!==a.top;(i||s)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function Uz(e,t){let r=qn(e),n=sr.useRef(0);return sr.useEffect(()=>()=>window.clearTimeout(n.current),[]),sr.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function BI(e,t){let r=qn(t);Un(()=>{let n=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var mQ=aIe,hIe=sIe;var gIe=dIe;var bb=E(me(),1),ic=hQ.forwardRef(({className:e,children:t,...r},n)=>(0,bb.jsxs)(mQ,{ref:n,className:B("relative overflow-hidden",e),...r,children:[(0,bb.jsx)(hIe,{className:"h-full w-full rounded-[inherit]",children:t}),(0,bb.jsx)(Hz,{}),(0,bb.jsx)(gIe,{})]}));ic.displayName=mQ.displayName;var Hz=hQ.forwardRef(({className:e,orientation:t="vertical",...r},n)=>(0,bb.jsx)(Vz,{ref:n,orientation:t,className:B("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,bb.jsx)(fQ,{className:"relative flex-1 rounded-full bg-border"})}));Hz.displayName=Vz.displayName;var wIe=E(de(),1);var yIe=E(de(),1);var xIe=E(me(),1),Dyt="Separator",vIe="horizontal",Oyt=["horizontal","vertical"],bIe=yIe.forwardRef((e,t)=>{let{decorative:r,orientation:n=vIe,...o}=e,a=_yt(n)?n:vIe,s=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return(0,xIe.jsx)(ot.div,{"data-orientation":a,...s,...o,ref:t})});bIe.displayName=Dyt;function _yt(e){return Oyt.includes(e)}var gQ=bIe;var CIe=E(me(),1),jz=mt("shrink-0 bg-border",{variants:{orientation:{horizontal:"h-[1px] w-full",vertical:"h-full w-[1px]"},variant:{default:"bg-border",dashed:"border-dashed border-border bg-transparent",dotted:"border-dotted border-border bg-transparent",gradient:"bg-gradient-to-r from-transparent via-border to-transparent"},size:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",variant:"dashed",className:"border-t h-0"},{orientation:"vertical",variant:"dashed",className:"border-l w-0"},{orientation:"horizontal",variant:"dotted",className:"border-t h-0"},{orientation:"vertical",variant:"dotted",className:"border-l w-0"},{orientation:"horizontal",size:"sm",variant:["dashed","dotted"],className:"border-t-[0.5px]"},{orientation:"horizontal",size:"lg",variant:["dashed","dotted"],className:"border-t-2"},{orientation:"vertical",size:"sm",variant:["dashed","dotted"],className:"border-l-[0.5px]"},{orientation:"vertical",size:"lg",variant:["dashed","dotted"],className:"border-l-2"},{orientation:"horizontal",size:"sm",variant:["default","gradient"],className:"h-[0.5px]"},{orientation:"horizontal",size:"lg",variant:["default","gradient"],className:"h-[2px]"},{orientation:"vertical",size:"sm",variant:["default","gradient"],className:"w-[0.5px]"},{orientation:"vertical",size:"lg",variant:["default","gradient"],className:"w-[2px]"}],defaultVariants:{orientation:"horizontal",variant:"default",size:"md"}}),ms=wIe.forwardRef(({className:e,orientation:t="horizontal",variant:r="default",size:n="md",decorative:o=!0,...a},i)=>(0,CIe.jsx)(gQ,{ref:i,decorative:o,orientation:t,className:B(jz({orientation:t,variant:r,size:n}),e),...a}));ms.displayName=gQ.displayName;var tE=E(de(),1);var qd=E(me(),1),wb=nb,qz=_3,SIe=PI,vQ=ob,$z=tE.forwardRef(({className:e,...t},r)=>(0,qd.jsx)(Th,{className:B("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));$z.displayName=Th.displayName;var Byt=mt("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Fv=tE.forwardRef(({side:e="right",className:t,children:r,...n},o)=>(0,qd.jsxs)(vQ,{children:[(0,qd.jsx)($z,{}),(0,qd.jsxs)(ab,{ref:o,className:B(Byt({side:e}),t),...n,children:[r,(0,qd.jsxs)(PI,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,qd.jsx)(Zt,{className:"h-4 w-4"}),(0,qd.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Fv.displayName=ab.displayName;var rE=({className:e,...t})=>(0,qd.jsx)("div",{className:B("flex flex-col space-y-2 text-center sm:text-left",e),...t});rE.displayName="SheetHeader";var yQ=({className:e,...t})=>(0,qd.jsx)("div",{className:B("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});yQ.displayName="SheetFooter";var nE=tE.forwardRef(({className:e,...t},r)=>(0,qd.jsx)(CI,{ref:r,className:B("text-lg font-semibold text-foreground",e),...t}));nE.displayName=CI.displayName;var oE=tE.forwardRef(({className:e,...t},r)=>(0,qd.jsx)(SI,{ref:r,className:B("text-sm text-muted-foreground",e),...t}));oE.displayName=SI.displayName;var PIe=E(me(),1);function ca({className:e,...t}){return(0,PIe.jsx)("div",{className:B("animate-pulse rounded-md bg-muted",e),...t})}var Cb=E(de(),1);var Hh=E(me(),1),Vyt=mt("relative flex w-full touch-none select-none items-center",{variants:{size:{sm:"h-5",default:"h-6",md:"h-8",lg:"h-10"}},defaultVariants:{size:"default"}}),zyt=mt("relative h-1.5 w-full grow overflow-hidden rounded-full",{variants:{variant:{default:"bg-muted",primary:"bg-primary/20",secondary:"bg-secondary/20",accent:"bg-accent/20",success:"bg-success/20",warning:"bg-warning/20",error:"bg-error/20"}},defaultVariants:{variant:"default"}}),Uyt=mt("absolute h-full",{variants:{variant:{default:"bg-foreground",primary:"bg-primary",secondary:"bg-secondary",accent:"bg-accent",success:"bg-success",warning:"bg-warning",error:"bg-error"}},defaultVariants:{variant:"primary"}}),Hyt=mt("block rounded-full border-2 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"border-foreground bg-background",primary:"border-primary bg-background",secondary:"border-secondary bg-background",accent:"border-accent bg-background",success:"border-success bg-background",warning:"border-warning bg-background",error:"border-error bg-background"},size:{sm:"h-3 w-3",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"primary",size:"default"}}),Sb=Cb.forwardRef(({className:e,size:t,trackVariant:r,rangeVariant:n,thumbVariant:o,thumbSize:a,showValueLabel:i=!1,valueLabelFormat:s,valueLabelClassName:l,value:c,defaultValue:u=[0],onValueChange:d,disabled:f,...p},m)=>{let[h,g]=Cb.useState(c||u||[0]);Cb.useEffect(()=>{c!==void 0&&g(c)},[c]);let v=O=>s?s(O):`${Math.round(O*100)/100}`,y=(O,L,A)=>(O-L)/(A-L)*100,x=Cb.useRef(null),C=p.min||0,b=p.max||100,w=p.step||1,S=O=>{let L=O.map(A=>{if(w<1){let U=w.toString().split(".")[1]?.length||0;return Math.round(A*Math.pow(10,U))/Math.pow(10,U)}return Math.round(A)});g(L),d&&d(L)},P=O=>{if(f)return;let L=x.current;if(!L)return;let A=L.getBoundingClientRect(),U=(O.clientX-A.left)/A.width,V=C+U*(b-C),R=Math.round(V/w)*w,I=Math.max(C,Math.min(b,R)),k=[...h];k[0]=I,S(k)},N=O=>L=>{if(f)return;L.preventDefault();let A=V=>{let R=x.current;if(!R)return;let I=R.getBoundingClientRect(),k=(V.clientX-I.left)/I.width,T=C+k*(b-C),D=Math.round(T/w)*w,F=Math.max(C,Math.min(b,D)),_=[...h];_[O]=F,S(_)},U=()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",U)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",U)};return(0,Hh.jsxs)("div",{className:"w-full",ref:m,...p,children:[i&&(0,Hh.jsx)("div",{className:B("flex justify-end mb-1 text-sm text-muted-foreground",l),children:h.length===1?(0,Hh.jsx)("span",{children:v(h[0])}):(0,Hh.jsxs)("span",{children:[v(h[0])," - ",v(h[h.length-1])]})}),(0,Hh.jsxs)("div",{className:B(Vyt({size:t}),e),"data-disabled":f?!0:void 0,children:[(0,Hh.jsx)("div",{ref:x,className:B(zyt({variant:r||o||"default"})),onClick:P,children:(0,Hh.jsx)("div",{className:B(Uyt({variant:n||o||"primary"})),style:{left:"0%",width:`${y(h[0],C,b)}%`}})}),h.map((O,L)=>(0,Hh.jsx)("div",{className:B(Hyt({variant:o||"primary",size:a})),style:{left:`${y(O,C,b)}%`,transform:"translateX(-50%)",position:"absolute",top:"50%",marginTop:a==="sm"?"-6px":a==="lg"?"-12px":"-8px",cursor:f?"not-allowed":"pointer"},onMouseDown:N(L),"aria-label":`Thumb ${L+1}`,tabIndex:f?-1:0,role:"slider","aria-valuemin":C,"aria-valuemax":b,"aria-valuenow":O,"aria-disabled":f},L))]})]})});Sb.displayName="MoonUISliderPro";var AIe=E(de(),1);var gm=E(de(),1);var pC=E(me(),1),Wz="Switch",[jyt,RHr]=Fn(Wz),[qyt,$yt]=jyt(Wz),IIe=gm.forwardRef((e,t)=>{let{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:i,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,p]=gm.useState(null),m=Gt(t,x=>p(x)),h=gm.useRef(!1),g=f?u||!!f.closest("form"):!0,[v,y]=qo({prop:o,defaultProp:a??!1,onChange:c,caller:Wz});return(0,pC.jsxs)(qyt,{scope:r,checked:v,disabled:s,children:[(0,pC.jsx)(ot.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":MIe(v),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:m,onClick:Ze(e.onClick,x=>{y(C=>!C),g&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})}),g&&(0,pC.jsx)(NIe,{control:f,bubbles:!h.current,name:n,value:l,checked:v,required:i,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});IIe.displayName=Wz;var RIe="SwitchThumb",kIe=gm.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,o=$yt(RIe,r);return(0,pC.jsx)(ot.span,{"data-state":MIe(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});kIe.displayName=RIe;var Wyt="SwitchBubbleInput",NIe=gm.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},a)=>{let i=gm.useRef(null),s=Gt(i,a),l=hI(r),c=gI(t);return gm.useEffect(()=>{let u=i.current;if(!u)return;let d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==r&&p){let m=new Event("click",{bubbles:n});p.call(u,r),u.dispatchEvent(m)}},[l,r,n]),(0,pC.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});NIe.displayName=Wyt;function MIe(e){return e?"checked":"unchecked"}var xQ=IIe,TIe=kIe;var jh=E(me(),1),qh=AIe.forwardRef(({className:e,size:t="md",variant:r="primary",loading:n,leftIcon:o,rightIcon:a,description:i,...s},l)=>(0,jh.jsxs)("div",{className:"inline-flex items-center gap-2",children:[o&&(0,jh.jsx)("span",{className:"text-muted-foreground",children:o}),(0,jh.jsxs)(xQ,{className:B("peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent 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 dark:data-[state=unchecked]:bg-gray-700/70 dark:focus-visible:ring-primary/40 dark:focus-visible:ring-offset-gray-950",t==="sm"&&"h-4 w-8",t==="md"&&"h-6 w-11",t==="lg"&&"h-7 w-14",r==="primary"&&"data-[state=checked]:bg-primary",r==="success"&&"data-[state=checked]:bg-success",r==="warning"&&"data-[state=checked]:bg-warning",r==="danger"&&"data-[state=checked]:bg-error",r==="secondary"&&"data-[state=checked]:bg-accent","data-[state=unchecked]:bg-input",n&&"opacity-80 cursor-wait",e),disabled:n||s.disabled,...s,ref:l,children:[n?(0,jh.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,jh.jsx)("div",{className:"h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-primary"})}):null,(0,jh.jsx)(TIe,{className:B("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",t==="sm"&&"h-3 w-3 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",t==="md"&&"h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",t==="lg"&&"h-6 w-6 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0")})]}),a&&(0,jh.jsx)("span",{className:"text-muted-foreground",children:a}),i&&(0,jh.jsx)("span",{className:"text-sm text-muted-foreground",children:i})]}));qh.displayName=xQ.displayName;var sc=E(de(),1);var $a=E(me(),1),Gz=mt("w-full caption-bottom text-sm",{variants:{variant:{default:"dark:text-gray-200",bordered:"border border-border dark:border-gray-700",striped:"dark:text-gray-200",card:"border border-border dark:border-gray-700 rounded-md shadow-sm dark:shadow-gray-900/20",minimal:"border-none dark:text-gray-200"},size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"default"}}),Kz=sc.forwardRef(({className:e,variant:t,size:r,loading:n,emptyContent:o,...a},i)=>{let s=t==="striped",l=sc.Children.map(a.children,c=>{if(sc.isValidElement(c)&&c.type==="tbody"){let u=c.props;return sc.cloneElement(c,{className:B(u.className,s&&"even:[&>tr]:bg-muted/50")})}return c});return(0,$a.jsxs)("div",{className:"relative w-full overflow-auto",children:[n&&(0,$a.jsx)("div",{className:"absolute inset-0 bg-background/60 flex items-center justify-center z-10",children:(0,$a.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),(0,$a.jsx)("table",{ref:i,className:B(Gz({variant:t,size:r}),n&&"opacity-70",e),...a,children:l})]})});Kz.displayName="TablePro";var Xz=sc.forwardRef(({className:e,...t},r)=>(0,$a.jsx)("thead",{ref:r,className:B("[&_tr]:border-b",e),...t}));Xz.displayName="TableHeaderPro";var Yz=sc.forwardRef(({className:e,emptyContent:t,emptyMessage:r="No data available",children:n,...o},a)=>{let i=sc.Children.count(n)>0;return(0,$a.jsx)("tbody",{ref:a,className:B("[&_tr:last-child]:border-0",e),...o,children:i?n:(0,$a.jsx)("tr",{children:(0,$a.jsx)("td",{colSpan:100,className:"h-24 text-center",children:t||(0,$a.jsx)("div",{className:"py-6 text-muted-foreground",children:(0,$a.jsx)("div",{className:"text-sm",children:r})})})})})});Yz.displayName="TableBodyPro";var Qz=sc.forwardRef(({className:e,...t},r)=>(0,$a.jsx)("tfoot",{ref:r,className:B("bg-primary text-primary-foreground font-medium",e),...t}));Qz.displayName="TableFooterPro";var Zz=sc.forwardRef(({className:e,...t},r)=>(0,$a.jsx)("tr",{ref:r,className:B("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Zz.displayName="TableRowPro";var Jz=sc.forwardRef(({className:e,sortable:t,sorted:r,onSort:n,children:o,...a},i)=>{let s=()=>t?r==="asc"?(0,$a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block",viewBox:"0 0 20 20",fill:"currentColor",children:(0,$a.jsx)("path",{fillRule:"evenodd",d:"M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):r==="desc"?(0,$a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block",viewBox:"0 0 20 20",fill:"currentColor",children:(0,$a.jsx)("path",{fillRule:"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})}):(0,$a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block opacity-30",viewBox:"0 0 20 20",fill:"currentColor",children:(0,$a.jsx)("path",{fillRule:"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})}):null;return(0,$a.jsx)("th",{ref:i,className:B("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t&&"cursor-pointer hover:text-foreground select-none",e),onClick:t?n:void 0,...a,children:(0,$a.jsxs)("div",{className:"flex items-center",children:[o,t&&s()]})})});Jz.displayName="TableHeadPro";var e5=sc.forwardRef(({className:e,...t},r)=>(0,$a.jsx)("td",{ref:r,className:B("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));e5.displayName="TableCellPro";var t5=sc.forwardRef(({className:e,...t},r)=>(0,$a.jsx)("caption",{ref:r,className:B("mt-4 text-sm text-muted-foreground",e),...t}));t5.displayName="TableCaptionPro";var o5=E(de(),1);var Vv=E(de(),1);var Bv=E(me(),1),r5="Tabs",[Kyt,zHr]=Fn(r5,[LI]),LIe=LI(),[Xyt,bQ]=Kyt(r5),EIe=Vv.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=Af(s),[d,f]=qo({prop:n,onChange:o,defaultProp:a??"",caller:r5});return(0,Bv.jsx)(Xyt,{scope:r,baseId:jn(),value:d,onValueChange:f,orientation:i,dir:u,activationMode:l,children:(0,Bv.jsx)(ot.div,{dir:u,"data-orientation":i,...c,ref:t})})});EIe.displayName=r5;var DIe="TabsList",OIe=Vv.forwardRef((e,t)=>{let{__scopeTabs:r,loop:n=!0,...o}=e,a=bQ(DIe,r),i=LIe(r);return(0,Bv.jsx)(pz,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:n,children:(0,Bv.jsx)(ot.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});OIe.displayName=DIe;var _Ie="TabsTrigger",FIe=Vv.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,disabled:o=!1,...a}=e,i=bQ(_Ie,r),s=LIe(r),l=zIe(i.baseId,n),c=UIe(i.baseId,n),u=n===i.value;return(0,Bv.jsx)(mz,{asChild:!0,...s,focusable:!o,active:u,children:(0,Bv.jsx)(ot.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...a,ref:t,onMouseDown:Ze(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?i.onValueChange(n):d.preventDefault()}),onKeyDown:Ze(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(n)}),onFocus:Ze(e.onFocus,()=>{let d=i.activationMode!=="manual";!u&&!o&&d&&i.onValueChange(n)})})})});FIe.displayName=_Ie;var BIe="TabsContent",VIe=Vv.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,forceMount:o,children:a,...i}=e,s=bQ(BIe,r),l=zIe(s.baseId,n),c=UIe(s.baseId,n),u=n===s.value,d=Vv.useRef(u);return Vv.useEffect(()=>{let f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),(0,Bv.jsx)(Ro,{present:o||u,children:({present:f})=>(0,Bv.jsx)(ot.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&a})})});VIe.displayName=BIe;function zIe(e,t){return`${e}-trigger-${t}`}function UIe(e,t){return`${e}-content-${t}`}var n5=EIe,VI=OIe,zI=FIe,mC=VIe;var a5=E(me(),1),Uu=n5,Xc=o5.forwardRef(({className:e,...t},r)=>(0,a5.jsx)(VI,{ref:r,className:B("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Xc.displayName=VI.displayName;var ko=o5.forwardRef(({className:e,...t},r)=>(0,a5.jsx)(zI,{ref:r,className:B("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));ko.displayName=zI.displayName;var ua=o5.forwardRef(({className:e,...t},r)=>(0,a5.jsx)(mC,{ref:r,className:B("mt-6 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ua.displayName=mC.displayName;var ll=E(de(),1);var mn=E(me(),1),Yyt={fade:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},slide:{initial:{x:20,opacity:0},animate:{x:0,opacity:1},exit:{x:-20,opacity:0}},scale:{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:1.05,opacity:0}},flip:{initial:{rotateY:90,opacity:0},animate:{rotateY:0,opacity:1},exit:{rotateY:-90,opacity:0}},morph:{initial:{scale:.8,opacity:0,filter:"blur(10px)"},animate:{scale:1,opacity:1,filter:"blur(0px)"},exit:{scale:1.2,opacity:0,filter:"blur(10px)"}}},i5=ll.forwardRef(({variant:e="default",animationMode:t="fade",orientation:r="horizontal",closeable:n=!1,addable:o=!1,draggable:a=!1,persistKey:i,urlSync:s=!1,lazy:l=!1,items:c=[],onTabsChange:u,onTabClose:d,onTabAdd:f,loading:p=!1,swipeable:m=!1,scrollable:h=!1,onAnalytics:g,onBeforeChange:v,shortcuts:y=!1,maxTabs:x,groups:C,className:b,children:w,value:S,defaultValue:P,onValueChange:N,...O},L)=>{let[A,U]=ll.useState(c),[V,R]=ll.useState(()=>{if(i&&typeof window<"u"){let z=localStorage.getItem(`tabs-${i}`);if(z)return JSON.parse(z).activeTab||P||A[0]?.value}if(s&&typeof window<"u"){let G=new URLSearchParams(window.location.search).get("tab");if(G)return G}return P||A[0]?.value}),[I,k]=ll.useState(new Set),[T,D]=ll.useState(!1),F=ll.useRef(null),_=S!==void 0?S:V,M=ll.useCallback(async z=>{if(!(p||T)){if(v){D(!0);let G=await v(_||"",z);if(D(!1),!G)return}if(R(z),N?.(z),l&&!I.has(z)&&k(G=>new Set([...G,z])),g?.("tab_switch",{from:_,to:z}),i&&typeof window<"u"&&localStorage.setItem(`tabs-${i}`,JSON.stringify({activeTab:z,tabs:A})),s&&typeof window<"u"){let G=new URLSearchParams(window.location.search);G.set("tab",z),window.history.replaceState({},"",`${window.location.pathname}?${G}`)}}},[_,p,T,v,N,l,I,g,i,A,s]),j=ll.useCallback((z,G)=>{G.stopPropagation();let X=A.filter(Q=>Q.value!==z);U(X),u?.(X),d?.(z),g?.("tab_close",{value:z}),_===z&&X.length>0&&M(X[0].value)},[A,_,u,d,g,M]),H=ll.useCallback(()=>{if(x&&A.length>=x){g?.("tab_add_blocked",{reason:"max_tabs"});return}f?.(),g?.("tab_add",{count:A.length+1})},[A.length,x,f,g]);ll.useEffect(()=>{if(!y)return;let z=G=>{if((G.metaKey||G.ctrlKey)&&G.key>="1"&&G.key<="9"){G.preventDefault();let X=parseInt(G.key)-1;A[X]&&M(A[X].value)}(G.metaKey||G.ctrlKey)&&G.key==="w"&&n&&(G.preventDefault(),A.find(Q=>Q.value===_)?.closeable!==!1&&j(_||"",new MouseEvent("click"))),(G.metaKey||G.ctrlKey)&&G.key==="t"&&o&&(G.preventDefault(),H())};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[y,A,_,n,o,M,j,H]);let q=()=>{F.current&&F.current.scrollBy({left:-200,behavior:"smooth"})},W=()=>{F.current&&F.current.scrollBy({left:200,behavior:"smooth"})};return(0,mn.jsxs)("div",{className:B("relative w-full",e==="gradient"&&"bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg p-1",e==="glassmorphism"&&"backdrop-blur-xl bg-white/10 dark:bg-black/10 border border-white/20 dark:border-white/10 rounded-lg p-1",e==="neon"&&"bg-black rounded-lg p-1 shadow-[0_0_20px_rgba(139,92,246,0.3)]",b),children:[p&&(0,mn.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-lg",children:(0,mn.jsx)(Sr,{className:"h-6 w-6 animate-spin text-primary"})}),(0,mn.jsx)(n5,{ref:L,value:_,onValueChange:M,orientation:r,...O,children:A.length>0?(0,mn.jsxs)(mn.Fragment,{children:[(0,mn.jsxs)("div",{className:B("relative flex items-center",r==="vertical"&&"flex-col items-start"),children:[h&&r==="horizontal"&&(0,mn.jsx)(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 absolute left-0 z-10",onClick:q,children:(0,mn.jsx)(oa,{className:"h-4 w-4"})}),(0,mn.jsx)("div",{ref:F,className:B("flex-1 overflow-x-auto scrollbar-hide",h&&r==="horizontal"&&"mx-10"),children:(0,mn.jsxs)(VI,{className:B("flex items-center gap-1",r==="vertical"&&"flex-col items-start w-full",e==="underline"&&"border-b border-border"),children:[A.map((z,G)=>(0,mn.jsxs)(ie.div,{layout:!0,drag:a?r==="horizontal"?"x":"y":!1,dragConstraints:{left:0,right:0,top:0,bottom:0},dragElastic:.2,whileDrag:{scale:1.05,zIndex:50},className:"relative",children:[(0,mn.jsxs)(zI,{value:z.value,disabled:z.disabled,className:B("relative inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e==="default"&&"data-[state=active]:bg-background data-[state=active]:shadow-sm",e==="pills"&&"rounded-full data-[state=active]:bg-primary data-[state=active]:text-primary-foreground",e==="underline"&&"rounded-none border-b-2 border-transparent data-[state=active]:border-primary",e==="cards"&&"bg-muted/50 data-[state=active]:bg-background data-[state=active]:shadow-md",e==="minimal"&&"hover:bg-muted/50 data-[state=active]:bg-transparent data-[state=active]:underline",e==="gradient"&&"data-[state=active]:bg-gradient-to-r data-[state=active]:from-primary data-[state=active]:to-secondary data-[state=active]:text-white",e==="glassmorphism"&&"backdrop-blur-md data-[state=active]:bg-white/20 dark:data-[state=active]:bg-white/10",e==="neon"&&"text-purple-400 data-[state=active]:text-white data-[state=active]:shadow-[0_0_10px_rgba(139,92,246,0.8)]",r==="vertical"&&"w-full justify-start"),children:[z.icon&&(0,mn.jsx)("span",{className:"mr-2",children:z.icon}),z.label,z.badge&&(0,mn.jsx)("span",{className:"ml-2",children:z.badge}),n&&z.closeable!==!1&&(0,mn.jsx)("button",{onClick:X=>j(z.value,X),className:"ml-2 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:(0,mn.jsx)(Zt,{className:"h-3 w-3"})})]}),_===z.value&&t!=="none"&&(0,mn.jsx)(ie.div,{layoutId:"active-tab",className:B("absolute inset-0 -z-10",e==="default"&&"bg-background shadow-sm rounded-md",e==="pills"&&"bg-primary rounded-full",e==="underline"&&"bottom-0 h-0.5 bg-primary"),transition:{type:"spring",stiffness:500,damping:30}})]},z.value)),o&&(0,mn.jsx)(ne,{variant:"ghost",size:"sm",onClick:H,className:"h-8 w-8 p-0 ml-2",disabled:x?A.length>=x:!1,children:(0,mn.jsx)(si,{className:"h-4 w-4"})})]})}),h&&r==="horizontal"&&(0,mn.jsx)(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 absolute right-0 z-10",onClick:W,children:(0,mn.jsx)(Bn,{className:"h-4 w-4"})}),A.length>5&&(0,mn.jsxs)(Pr,{children:[(0,mn.jsx)(Ir,{asChild:!0,children:(0,mn.jsx)(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 ml-2",children:(0,mn.jsx)(za,{className:"h-4 w-4"})})}),(0,mn.jsx)(xr,{align:"end",children:A.slice(5).map(z=>(0,mn.jsxs)(Fe,{onClick:()=>M(z.value),children:[z.icon&&(0,mn.jsx)("span",{className:"mr-2",children:z.icon}),z.label]},z.value))})]})]}),t!=="none"?(0,mn.jsx)(Dt,{mode:"wait",children:A.map(z=>_!==z.value?null:(0,mn.jsx)(mC,{value:z.value,forceMount:!0,className:"mt-4 focus-visible:outline-none",children:(0,mn.jsx)(ie.div,{initial:"initial",animate:"animate",exit:"exit",variants:Yyt[t],transition:{duration:.3},children:z.content||w})},z.value))}):A.map(z=>(0,mn.jsx)(mC,{value:z.value,className:"mt-4 focus-visible:outline-none",children:z.content||w},z.value))]}):w})]})});i5.displayName="MoonUITabsPro";var wQ=ll.forwardRef(({className:e,...t},r)=>(0,mn.jsx)(VI,{ref:r,className:B("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));wQ.displayName="MoonUITabsListPro";var CQ=ll.forwardRef(({className:e,...t},r)=>(0,mn.jsx)(zI,{ref:r,className:B("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));CQ.displayName="MoonUITabsTriggerPro";var SQ=ll.forwardRef(({className:e,...t},r)=>(0,mn.jsx)(mC,{ref:r,className:B("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));SQ.displayName="MoonUITabsContentPro";var jIe=E(de(),1);var qIe=E(me(),1),Yc=jIe.default.forwardRef(({className:e,...t},r)=>(0,qIe.jsx)("textarea",{className:B("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Yc.displayName="MoonUITextareaPro";var Uv=E(de(),1);var Ur=E(de(),1),WIe=E(fh(),1);var co=E(me(),1),NQ="ToastProvider",[MQ,Qyt,Zyt]=ah("Toast"),[GIe,ljr]=Fn("Toast",[Zyt]),[Jyt,l5]=GIe(NQ),ext=e=>{let{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:i}=e,[s,l]=Ur.useState(null),[c,u]=Ur.useState(0),d=Ur.useRef(!1),f=Ur.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${NQ}\`. Expected non-empty \`string\`.`),(0,co.jsx)(MQ.Provider,{scope:t,children:(0,co.jsx)(Jyt,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:a,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:Ur.useCallback(()=>u(p=>p+1),[]),onToastRemove:Ur.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:i})})};ext.displayName=NQ;var KIe="ToastViewport",txt=["F8"],IQ="toast.viewportPause",RQ="toast.viewportResume",XIe=Ur.forwardRef((e,t)=>{let{__scopeToast:r,hotkey:n=txt,label:o="Notifications ({hotkey})",...a}=e,i=l5(KIe,r),s=Qyt(r),l=Ur.useRef(null),c=Ur.useRef(null),u=Ur.useRef(null),d=Ur.useRef(null),f=Gt(t,d,i.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=i.toastCount>0;Ur.useEffect(()=>{let g=v=>{n.length!==0&&n.every(x=>v[x]||v.code===x)&&d.current?.focus()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),Ur.useEffect(()=>{let g=l.current,v=d.current;if(m&&g&&v){let y=()=>{if(!i.isClosePausedRef.current){let w=new CustomEvent(IQ);v.dispatchEvent(w),i.isClosePausedRef.current=!0}},x=()=>{if(i.isClosePausedRef.current){let w=new CustomEvent(RQ);v.dispatchEvent(w),i.isClosePausedRef.current=!1}},C=w=>{!g.contains(w.relatedTarget)&&x()},b=()=>{g.contains(document.activeElement)||x()};return g.addEventListener("focusin",y),g.addEventListener("focusout",C),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",b),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",C),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",b),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[m,i.isClosePausedRef]);let h=Ur.useCallback(({tabbingDirection:g})=>{let y=s().map(x=>{let C=x.ref.current,b=[C,...mxt(C)];return g==="forwards"?b:b.reverse()});return(g==="forwards"?y.reverse():y).flat()},[s]);return Ur.useEffect(()=>{let g=d.current;if(g){let v=y=>{let x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){let b=document.activeElement,w=y.shiftKey;if(y.target===g&&w){c.current?.focus();return}let N=h({tabbingDirection:w?"backwards":"forwards"}),O=N.findIndex(L=>L===b);PQ(N.slice(O+1))?y.preventDefault():w?c.current?.focus():u.current?.focus()}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[s,h]),(0,co.jsxs)(b0e,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&(0,co.jsx)(kQ,{ref:c,onFocusFromOutsideViewport:()=>{let g=h({tabbingDirection:"forwards"});PQ(g)}}),(0,co.jsx)(MQ.Slot,{scope:r,children:(0,co.jsx)(ot.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,co.jsx)(kQ,{ref:u,onFocusFromOutsideViewport:()=>{let g=h({tabbingDirection:"backwards"});PQ(g)}})]})});XIe.displayName=KIe;var YIe="ToastFocusProxy",kQ=Ur.forwardRef((e,t)=>{let{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,a=l5(YIe,r);return(0,co.jsx)(_L,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{let s=i.relatedTarget;!a.viewport?.contains(s)&&n()}})});kQ.displayName=YIe;var aE="Toast",rxt="toast.swipeStart",nxt="toast.swipeMove",oxt="toast.swipeCancel",axt="toast.swipeEnd",QIe=Ur.forwardRef((e,t)=>{let{forceMount:r,open:n,defaultOpen:o,onOpenChange:a,...i}=e,[s,l]=qo({prop:n,defaultProp:o??!0,onChange:a,caller:aE});return(0,co.jsx)(Ro,{present:r||s,children:(0,co.jsx)(lxt,{open:s,...i,ref:t,onClose:()=>l(!1),onPause:qn(e.onPause),onResume:qn(e.onResume),onSwipeStart:Ze(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ze(e.onSwipeMove,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Ze(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ze(e.onSwipeEnd,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});QIe.displayName=aE;var[ixt,sxt]=GIe(aE,{onClose(){}}),lxt=Ur.forwardRef((e,t)=>{let{__scopeToast:r,type:n="foreground",duration:o,open:a,onClose:i,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=l5(aE,r),[g,v]=Ur.useState(null),y=Gt(t,V=>v(V)),x=Ur.useRef(null),C=Ur.useRef(null),b=o||h.duration,w=Ur.useRef(0),S=Ur.useRef(b),P=Ur.useRef(0),{onToastAdd:N,onToastRemove:O}=h,L=qn(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),i()}),A=Ur.useCallback(V=>{!V||V===1/0||(window.clearTimeout(P.current),w.current=new Date().getTime(),P.current=window.setTimeout(L,V))},[L]);Ur.useEffect(()=>{let V=h.viewport;if(V){let R=()=>{A(S.current),c?.()},I=()=>{let k=new Date().getTime()-w.current;S.current=S.current-k,window.clearTimeout(P.current),l?.()};return V.addEventListener(IQ,I),V.addEventListener(RQ,R),()=>{V.removeEventListener(IQ,I),V.removeEventListener(RQ,R)}}},[h.viewport,b,l,c,A]),Ur.useEffect(()=>{a&&!h.isClosePausedRef.current&&A(b)},[a,b,h.isClosePausedRef,A]),Ur.useEffect(()=>(N(),()=>O()),[N,O]);let U=Ur.useMemo(()=>g?oRe(g):null,[g]);return h.viewport?(0,co.jsxs)(co.Fragment,{children:[U&&(0,co.jsx)(cxt,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),(0,co.jsx)(ixt,{scope:r,onClose:L,children:WIe.createPortal((0,co.jsx)(MQ.ItemSlot,{scope:r,children:(0,co.jsx)(x0e,{asChild:!0,onEscapeKeyDown:Ze(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||L(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,co.jsx)(ot.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ze(e.onKeyDown,V=>{V.key==="Escape"&&(s?.(V.nativeEvent),V.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,L()))}),onPointerDown:Ze(e.onPointerDown,V=>{V.button===0&&(x.current={x:V.clientX,y:V.clientY})}),onPointerMove:Ze(e.onPointerMove,V=>{if(!x.current)return;let R=V.clientX-x.current.x,I=V.clientY-x.current.y,k=!!C.current,T=["left","right"].includes(h.swipeDirection),D=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,F=T?D(0,R):0,_=T?0:D(0,I),M=V.pointerType==="touch"?10:2,j={x:F,y:_},H={originalEvent:V,delta:j};k?(C.current=j,s5(nxt,d,H,{discrete:!1})):$Ie(j,h.swipeDirection,M)?(C.current=j,s5(rxt,u,H,{discrete:!1}),V.target.setPointerCapture(V.pointerId)):(Math.abs(R)>M||Math.abs(I)>M)&&(x.current=null)}),onPointerUp:Ze(e.onPointerUp,V=>{let R=C.current,I=V.target;if(I.hasPointerCapture(V.pointerId)&&I.releasePointerCapture(V.pointerId),C.current=null,x.current=null,R){let k=V.currentTarget,T={originalEvent:V,delta:R};$Ie(R,h.swipeDirection,h.swipeThreshold)?s5(axt,p,T,{discrete:!0}):s5(oxt,f,T,{discrete:!0}),k.addEventListener("click",D=>D.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),cxt=e=>{let{__scopeToast:t,children:r,...n}=e,o=l5(aE,t),[a,i]=Ur.useState(!1),[s,l]=Ur.useState(!1);return fxt(()=>i(!0)),Ur.useEffect(()=>{let c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:(0,co.jsx)(Bd,{asChild:!0,children:(0,co.jsx)(_L,{...n,children:a&&(0,co.jsxs)(co.Fragment,{children:[o.label," ",r]})})})},uxt="ToastTitle",ZIe=Ur.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e;return(0,co.jsx)(ot.div,{...n,ref:t})});ZIe.displayName=uxt;var dxt="ToastDescription",JIe=Ur.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e;return(0,co.jsx)(ot.div,{...n,ref:t})});JIe.displayName=dxt;var eRe="ToastAction",tRe=Ur.forwardRef((e,t)=>{let{altText:r,...n}=e;return r.trim()?(0,co.jsx)(nRe,{altText:r,asChild:!0,children:(0,co.jsx)(TQ,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${eRe}\`. Expected non-empty \`string\`.`),null)});tRe.displayName=eRe;var rRe="ToastClose",TQ=Ur.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e,o=sxt(rRe,r);return(0,co.jsx)(nRe,{asChild:!0,children:(0,co.jsx)(ot.button,{type:"button",...n,ref:t,onClick:Ze(e.onClick,o.onClose)})})});TQ.displayName=rRe;var nRe=Ur.forwardRef((e,t)=>{let{__scopeToast:r,altText:n,...o}=e;return(0,co.jsx)(ot.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function oRe(e){let t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),pxt(n)){let o=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!o)if(a){let i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...oRe(n))}}),t}function s5(e,t,r,{discrete:n}){let o=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?dP(o,a):o.dispatchEvent(a)}var $Ie=(e,t,r=0)=>{let n=Math.abs(e.x),o=Math.abs(e.y),a=n>o;return t==="left"||t==="right"?a&&n>r:!a&&o>r};function fxt(e=()=>{}){let t=qn(e);Un(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function pxt(e){return e.nodeType===e.ELEMENT_NODE}function mxt(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function PQ(e){let t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var AQ=XIe,LQ=QIe,EQ=ZIe,DQ=JIe,OQ=tRe,_Q=TQ;var zv=E(me(),1);var gxt=Uv.forwardRef(({className:e,...t},r)=>(0,zv.jsx)(AQ,{ref:r,className:B("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));gxt.displayName=AQ.displayName;var vxt=mt("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-8 shadow-sm transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-900/20 dark:text-green-100",warning:"border-orange-200 bg-orange-50 text-orange-900 dark:border-orange-800 dark:bg-orange-900/20 dark:text-orange-100",info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-900/20 dark:text-blue-100"}},defaultVariants:{variant:"default"}}),u5=Uv.forwardRef(({className:e,variant:t,...r},n)=>(0,zv.jsx)(LQ,{ref:n,className:B(vxt({variant:t}),e),...r}));u5.displayName=LQ.displayName;var yxt=Uv.forwardRef(({className:e,...t},r)=>(0,zv.jsx)(OQ,{ref:r,className:B("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));yxt.displayName=OQ.displayName;var xxt=Uv.forwardRef(({className:e,...t},r)=>(0,zv.jsx)(_Q,{ref:r,className:B("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,zv.jsx)(Zt,{className:"h-4 w-4"})}));xxt.displayName=_Q.displayName;var bxt=Uv.forwardRef(({className:e,...t},r)=>(0,zv.jsx)(EQ,{ref:r,className:B("text-sm font-semibold [&+div]:text-xs",e),...t}));bxt.displayName=EQ.displayName;var wxt=Uv.forwardRef(({className:e,...t},r)=>(0,zv.jsx)(DQ,{ref:r,className:B("text-sm opacity-90",e),...t}));wxt.displayName=DQ.displayName;var Cxt=5,Sxt=1e6,FQ=new Map,aRe=e=>{if(FQ.has(e))return;let t=setTimeout(()=>{FQ.delete(e),c5({type:"REMOVE_TOAST",toastId:e})},Sxt);FQ.set(e,t)},Pxt=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Cxt)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{let{toastId:r}=t;return r?aRe(r):e.toasts.forEach(n=>{aRe(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)};default:return e}},Ixt=[],BQ={toasts:[]},Rxt=0;function c5(e){BQ=Pxt(BQ,e),Ixt.forEach(t=>{t(BQ)})}function $d({...e}){let t=`toast-${Date.now()}-${++Rxt}`,r=o=>c5({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>c5({type:"DISMISS_TOAST",toastId:t});return c5({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}var dRe=E(de(),1);var sRe=E(it(),1);var mjr=!!(typeof window<"u"&&window.document&&window.document.createElement);function ze(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}var np=E(it(),1);var iRe=E(it(),1),En=globalThis?.document?iRe.useLayoutEffect:()=>{};var d5=E(it(),1);var kxt=np[" useInsertionEffect ".trim().toString()]||En;function $n({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[o,a,i]=Nxt({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:o;{let u=np.useRef(e!==void 0);np.useEffect(()=>{let d=u.current;d!==s&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}let c=np.useCallback(u=>{if(s){let d=Mxt(u)?u(e):u;d!==e&&i.current?.(d)}else a(u)},[s,e,a,i]);return[l,c]}function Nxt({defaultProp:e,onChange:t}){let[r,n]=np.useState(e),o=np.useRef(r),a=np.useRef(t);return kxt(()=>{a.current=t},[t]),np.useEffect(()=>{o.current!==r&&(a.current?.(r),o.current=r)},[r,o]),[r,n,a]}function Mxt(e){return typeof e=="function"}var yjr=Symbol("RADIX:SYNC_STATE");var lRe=E(Mr(),1),cRe="Toggle",uRe=sRe.forwardRef((e,t)=>{let{pressed:r,defaultPressed:n,onPressedChange:o,...a}=e,[i,s]=$n({prop:r,onChange:o,defaultProp:n??!1,caller:cRe});return(0,lRe.jsx)(et.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:ze(e.onClick,()=>{e.disabled||s(!i)})})});uRe.displayName=cRe;var VQ=uRe;var vm=E(me(),1),f5=mt("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"moonui-toggle-default bg-transparent hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:border-input dark:hover:bg-accent dark:hover:text-accent-foreground dark:data-[state=on]:bg-accent dark:data-[state=on]:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground data-[state=on]:bg-transparent data-[state=on]:text-accent-foreground dark:hover:bg-accent dark:hover:text-accent-foreground dark:data-[state=on]:text-accent-foreground",primary:"bg-transparent hover:bg-primary/10 hover:text-primary data-[state=on]:bg-primary data-[state=on]:text-primary-foreground dark:hover:bg-primary/20 dark:hover:text-primary dark:data-[state=on]:bg-primary dark:data-[state=on]:text-primary-foreground",secondary:"moonui-toggle-secondary bg-transparent hover:bg-secondary/10 hover:text-secondary data-[state=on]:bg-secondary data-[state=on]:text-secondary-foreground",success:"bg-transparent hover:bg-success/10 hover:text-success data-[state=on]:bg-success data-[state=on]:text-success-foreground dark:hover:bg-success/20 dark:hover:text-success dark:data-[state=on]:bg-success dark:data-[state=on]:text-success-foreground",warning:"bg-transparent hover:bg-warning/10 hover:text-warning data-[state=on]:bg-warning data-[state=on]:text-warning-foreground dark:hover:bg-warning/20 dark:hover:text-warning dark:data-[state=on]:bg-warning dark:data-[state=on]:text-warning-foreground",danger:"bg-transparent hover:bg-destructive/10 hover:text-destructive data-[state=on]:bg-destructive data-[state=on]:text-destructive-foreground dark:hover:bg-destructive/20 dark:hover:text-destructive dark:data-[state=on]:bg-destructive dark:data-[state=on]:text-destructive-foreground",gradient:"bg-transparent hover:bg-gradient-to-r hover:from-purple-500/10 hover:to-pink-500/10 hover:text-purple-600 data-[state=on]:bg-gradient-to-r data-[state=on]:from-purple-600 data-[state=on]:to-pink-600 data-[state=on]:text-white dark:hover:from-purple-500/20 dark:hover:to-pink-500/20 dark:hover:text-purple-400 dark:data-[state=on]:from-purple-600 dark:data-[state=on]:to-pink-600 dark:data-[state=on]:text-white"},size:{xs:"min-h-7 px-2 py-1 text-xs",sm:"min-h-8 px-2.5 py-1.5 text-xs",default:"min-h-9 px-3 py-2",md:"min-h-10 px-4 py-2.5",lg:"min-h-11 px-6 py-3",xl:"min-h-12 px-8 py-3.5 text-base"},shape:{default:"rounded-md",square:"rounded-none",rounded:"rounded-lg",pill:"rounded-full"}},defaultVariants:{variant:"default",size:"default",shape:"default"}}),p5=dRe.forwardRef(({className:e,variant:t,size:r,shape:n,loading:o,badge:a,badgeVariant:i="default",iconOn:s,iconOff:l,iconPosition:c="left",children:u,pressed:d,onPressedChange:f,defaultPressed:p,...m},h)=>{let g=d?s:l;return(0,vm.jsx)(VQ,{ref:h,className:B(f5({variant:t,size:r,shape:n}),e),pressed:d,onPressedChange:f,defaultPressed:p,disabled:o||m.disabled,...m,children:o?(0,vm.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,vm.jsx)("div",{className:"h-3 w-3 animate-spin rounded-full border-2 border-current border-t-transparent"}),u&&(0,vm.jsx)("span",{className:"text-center",children:u})]}):(0,vm.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[g&&c==="left"&&(0,vm.jsx)("span",{className:"flex-shrink-0",children:g}),u&&(0,vm.jsx)("span",{className:"text-center",children:u}),g&&c==="right"&&(0,vm.jsx)("span",{className:"flex-shrink-0",children:g}),a!==void 0&&(0,vm.jsx)("span",{className:B("ml-1 inline-flex items-center justify-center rounded-full px-1.5 text-xs font-semibold",i==="default"&&"bg-muted text-muted-foreground",i==="primary"&&"bg-primary text-primary-foreground",i==="secondary"&&"bg-secondary text-secondary-foreground dark:bg-accent dark:text-accent-foreground",i==="success"&&"bg-success text-success-foreground",i==="warning"&&"bg-warning text-warning-foreground",i==="danger"&&"bg-destructive text-destructive-foreground"),children:a})]})})});p5.displayName=VQ.displayName;var Uke=E(de(),1);var Li=E(it(),1);var ju=E(it(),1);var mRe=["top","right","bottom","left"];var $h=Math.min,Qc=Math.max,sE=Math.round,lE=Math.floor,ym=e=>({x:e,y:e}),Axt={left:"right",right:"left",bottom:"top",top:"bottom"},Lxt={start:"end",end:"start"};function h5(e,t,r){return Qc(e,$h(t,r))}function Wh(e,t){return typeof e=="function"?e(t):e}function Gh(e){return e.split("-")[0]}function hC(e){return e.split("-")[1]}function g5(e){return e==="x"?"y":"x"}function v5(e){return e==="y"?"height":"width"}var Ext=new Set(["top","bottom"]);function xm(e){return Ext.has(Gh(e))?"y":"x"}function y5(e){return g5(xm(e))}function hRe(e,t,r){r===void 0&&(r=!1);let n=hC(e),o=y5(e),a=v5(o),i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=iE(i)),[i,iE(i)]}function gRe(e){let t=iE(e);return[m5(e),t,m5(t)]}function m5(e){return e.replace(/start|end/g,t=>Lxt[t])}var fRe=["left","right"],pRe=["right","left"],Dxt=["top","bottom"],Oxt=["bottom","top"];function _xt(e,t,r){switch(e){case"top":case"bottom":return r?t?pRe:fRe:t?fRe:pRe;case"left":case"right":return t?Dxt:Oxt;default:return[]}}function vRe(e,t,r,n){let o=hC(e),a=_xt(Gh(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(m5)))),a}function iE(e){return e.replace(/left|right|bottom|top/g,t=>Axt[t])}function Fxt(e){return{top:0,right:0,bottom:0,left:0,...e}}function zQ(e){return typeof e!="number"?Fxt(e):{top:e,right:e,bottom:e,left:e}}function gC(e){let{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function yRe(e,t,r){let{reference:n,floating:o}=e,a=xm(t),i=y5(t),s=v5(i),l=Gh(t),c=a==="y",u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[s]/2-o[s]/2,p;switch(l){case"top":p={x:u,y:n.y-o.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y}}switch(hC(t)){case"start":p[i]-=f*(r&&c?-1:1);break;case"end":p[i]+=f*(r&&c?-1:1);break}return p}var wRe=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=yRe(c,n,l),f=n,p={},m=0;for(let h=0;h<s.length;h++){let{name:g,fn:v}=s[h],{x:y,y:x,data:C,reset:b}=await v({x:u,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=y??u,d=x??d,p={...p,[g]:{...p[g],...C}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(f=b.placement),b.rects&&(c=b.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:u,y:d}=yRe(c,f,l)),h=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}};async function UI(e,t){var r;t===void 0&&(t={});let{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Wh(t,e),m=zQ(p),g=s[f?d==="floating"?"reference":"floating":d],v=gC(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(g)))==null||r?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),C=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},b=gC(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:x,strategy:l}):y);return{top:(v.top-b.top+m.top)/C.y,bottom:(b.bottom-v.bottom+m.bottom)/C.y,left:(v.left-b.left+m.left)/C.x,right:(b.right-v.right+m.right)/C.x}}var CRe=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Wh(e,t)||{};if(c==null)return{};let d=zQ(u),f={x:r,y:n},p=y5(o),m=v5(p),h=await i.getDimensions(c),g=p==="y",v=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",C=a.reference[m]+a.reference[p]-f[p]-a.floating[m],b=f[p]-a.reference[p],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c)),S=w?w[x]:0;(!S||!await(i.isElement==null?void 0:i.isElement(w)))&&(S=s.floating[x]||a.floating[m]);let P=C/2-b/2,N=S/2-h[m]/2-1,O=$h(d[v],N),L=$h(d[y],N),A=O,U=S-h[m]-L,V=S/2-h[m]/2+P,R=h5(A,V,U),I=!l.arrow&&hC(o)!=null&&V!==R&&a.reference[m]/2-(V<A?O:L)-h[m]/2<0,k=I?V<A?V-A:V-U:0;return{[p]:f[p]+k,data:{[p]:R,centerOffset:V-R-k,...I&&{alignmentOffset:k}},reset:I}}});var SRe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;let{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=Wh(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};let v=Gh(o),y=xm(s),x=Gh(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),b=f||(x||!h?[iE(s)]:gRe(s)),w=m!=="none";!f&&w&&b.push(...vRe(s,h,m,C));let S=[s,...b],P=await UI(t,g),N=[],O=((n=a.flip)==null?void 0:n.overflows)||[];if(u&&N.push(P[v]),d){let V=hRe(o,i,C);N.push(P[V[0]],P[V[1]])}if(O=[...O,{placement:o,overflows:N}],!N.every(V=>V<=0)){var L,A;let V=(((L=a.flip)==null?void 0:L.index)||0)+1,R=S[V];if(R&&(!(d==="alignment"?y!==xm(R):!1)||O.every(T=>xm(T.placement)===y?T.overflows[0]>0:!0)))return{data:{index:V,overflows:O},reset:{placement:R}};let I=(A=O.filter(k=>k.overflows[0]<=0).sort((k,T)=>k.overflows[1]-T.overflows[1])[0])==null?void 0:A.placement;if(!I)switch(p){case"bestFit":{var U;let k=(U=O.filter(T=>{if(w){let D=xm(T.placement);return D===y||D==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(D=>D>0).reduce((D,F)=>D+F,0)]).sort((T,D)=>T[1]-D[1])[0])==null?void 0:U[0];k&&(I=k);break}case"initialPlacement":I=s;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function xRe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bRe(e){return mRe.some(t=>e[t]>=0)}var PRe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...o}=Wh(e,t);switch(n){case"referenceHidden":{let a=await UI(t,{...o,elementContext:"reference"}),i=xRe(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:bRe(i)}}}case"escaped":{let a=await UI(t,{...o,altBoundary:!0}),i=xRe(a,r.floating);return{data:{escapedOffsets:i,escaped:bRe(i)}}}default:return{}}}}};var IRe=new Set(["left","top"]);async function Bxt(e,t){let{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Gh(r),s=hC(r),l=xm(r)==="y",c=IRe.has(i)?-1:1,u=a&&l?-1:1,d=Wh(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}var RRe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:o,y:a,placement:i,middlewareData:s}=t,l=await Bxt(t,e);return i===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},kRe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:g=>{let{x:v,y}=g;return{x:v,y}}},...l}=Wh(e,t),c={x:r,y:n},u=await UI(t,l),d=xm(Gh(o)),f=g5(d),p=c[f],m=c[d];if(a){let g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=p+u[g],x=p-u[v];p=h5(y,p,x)}if(i){let g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=m+u[g],x=m-u[v];m=h5(y,m,x)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[f]:a,[d]:i}}}}}},NRe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Wh(e,t),u={x:r,y:n},d=xm(o),f=g5(d),p=u[f],m=u[d],h=Wh(s,t),g=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){let x=f==="y"?"height":"width",C=a.reference[f]-a.floating[x]+g.mainAxis,b=a.reference[f]+a.reference[x]-g.mainAxis;p<C?p=C:p>b&&(p=b)}if(c){var v,y;let x=f==="y"?"width":"height",C=IRe.has(Gh(o)),b=a.reference[d]-a.floating[x]+(C&&((v=i.offset)==null?void 0:v[d])||0)+(C?0:g.crossAxis),w=a.reference[d]+a.reference[x]+(C?0:((y=i.offset)==null?void 0:y[d])||0)-(C?g.crossAxis:0);m<b?m=b:m>w&&(m=w)}return{[f]:p,[d]:m}}}},MRe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;let{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Wh(e,t),u=await UI(t,c),d=Gh(o),f=hC(o),p=xm(o)==="y",{width:m,height:h}=a.floating,g,v;d==="top"||d==="bottom"?(g=d,v=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g=f==="end"?"top":"bottom");let y=h-u.top-u.bottom,x=m-u.left-u.right,C=$h(h-u[g],y),b=$h(m-u[v],x),w=!t.middlewareData.shift,S=C,P=b;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(S=y),w&&!f){let O=Qc(u.left,0),L=Qc(u.right,0),A=Qc(u.top,0),U=Qc(u.bottom,0);p?P=m-2*(O!==0||L!==0?O+L:Qc(u.left,u.right)):S=h-2*(A!==0||U!==0?A+U:Qc(u.top,u.bottom))}await l({...t,availableWidth:P,availableHeight:S});let N=await i.getDimensions(s.floating);return m!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function x5(){return typeof window<"u"}function yC(e){return ARe(e)?(e.nodeName||"").toLowerCase():"#document"}function Hu(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bm(e){var t;return(t=(ARe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ARe(e){return x5()?e instanceof Node||e instanceof Hu(e).Node:!1}function op(e){return x5()?e instanceof Element||e instanceof Hu(e).Element:!1}function wm(e){return x5()?e instanceof HTMLElement||e instanceof Hu(e).HTMLElement:!1}function TRe(e){return!x5()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hu(e).ShadowRoot}var Vxt=new Set(["inline","contents"]);function HI(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=ap(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Vxt.has(o)}var zxt=new Set(["table","td","th"]);function LRe(e){return zxt.has(yC(e))}var Uxt=[":popover-open",":modal"];function cE(e){return Uxt.some(t=>{try{return e.matches(t)}catch{return!1}})}var Hxt=["transform","translate","scale","rotate","perspective"],jxt=["transform","translate","scale","rotate","perspective","filter"],qxt=["paint","layout","strict","content"];function b5(e){let t=w5(),r=op(e)?ap(e):e;return Hxt.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||jxt.some(n=>(r.willChange||"").includes(n))||qxt.some(n=>(r.contain||"").includes(n))}function ERe(e){let t=Hv(e);for(;wm(t)&&!xC(t);){if(b5(t))return t;if(cE(t))return null;t=Hv(t)}return null}function w5(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var $xt=new Set(["html","body","#document"]);function xC(e){return $xt.has(yC(e))}function ap(e){return Hu(e).getComputedStyle(e)}function uE(e){return op(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hv(e){if(yC(e)==="html")return e;let t=e.assignedSlot||e.parentNode||TRe(e)&&e.host||bm(e);return TRe(t)?t.host:t}function DRe(e){let t=Hv(e);return xC(t)?e.ownerDocument?e.ownerDocument.body:e.body:wm(t)&&HI(t)?t:DRe(t)}function vC(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let o=DRe(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=Hu(o);if(a){let s=C5(i);return t.concat(i,i.visualViewport||[],HI(o)?o:[],s&&r?vC(s):[])}return t.concat(o,vC(o,[],r))}function C5(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BRe(e){let t=ap(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=wm(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=sE(r)!==a||sE(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function HQ(e){return op(e)?e:e.contextElement}function jI(e){let t=HQ(e);if(!wm(t))return ym(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:a}=BRe(t),i=(a?sE(r.width):r.width)/n,s=(a?sE(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var Wxt=ym(0);function VRe(e){let t=Hu(e);return!w5()||!t.visualViewport?Wxt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gxt(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Hu(e)?!1:t}function bC(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let o=e.getBoundingClientRect(),a=HQ(e),i=ym(1);t&&(n?op(n)&&(i=jI(n)):i=jI(e));let s=Gxt(a,r,n)?VRe(a):ym(0),l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){let f=Hu(a),p=n&&op(n)?Hu(n):n,m=f,h=C5(m);for(;h&&n&&p!==m;){let g=jI(h),v=h.getBoundingClientRect(),y=ap(h),x=v.left+(h.clientLeft+parseFloat(y.paddingLeft))*g.x,C=v.top+(h.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=x,c+=C,m=Hu(h),h=C5(m)}}return gC({width:u,height:d,x:l,y:c})}function S5(e,t){let r=uE(e).scrollLeft;return t?t.left+r:bC(bm(e)).left+r}function zRe(e,t){let r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-S5(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Kxt(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,a=o==="fixed",i=bm(n),s=t?cE(t.floating):!1;if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=ym(1),u=ym(0),d=wm(n);if((d||!d&&!a)&&((yC(n)!=="body"||HI(i))&&(l=uE(n)),wm(n))){let p=bC(n);c=jI(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}let f=i&&!d&&!a?zRe(i,l):ym(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}}function Xxt(e){return Array.from(e.getClientRects())}function Yxt(e){let t=bm(e),r=uE(e),n=e.ownerDocument.body,o=Qc(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Qc(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),i=-r.scrollLeft+S5(e),s=-r.scrollTop;return ap(n).direction==="rtl"&&(i+=Qc(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}var ORe=25;function Qxt(e,t){let r=Hu(e),n=bm(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;let u=w5();(!u||u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}let c=S5(n);if(c<=0){let u=n.ownerDocument,d=u.body,f=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(n.clientWidth-d.clientWidth-p);m<=ORe&&(a-=m)}else c<=ORe&&(a+=c);return{width:a,height:i,x:s,y:l}}var Zxt=new Set(["absolute","fixed"]);function Jxt(e,t){let r=bC(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=wm(e)?jI(e):ym(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,l=o*a.x,c=n*a.y;return{width:i,height:s,x:l,y:c}}function _Re(e,t,r){let n;if(t==="viewport")n=Qxt(e,r);else if(t==="document")n=Yxt(bm(e));else if(op(t))n=Jxt(t,r);else{let o=VRe(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return gC(n)}function URe(e,t){let r=Hv(e);return r===t||!op(r)||xC(r)?!1:ap(r).position==="fixed"||URe(r,t)}function ebt(e,t){let r=t.get(e);if(r)return r;let n=vC(e,[],!1).filter(s=>op(s)&&yC(s)!=="body"),o=null,a=ap(e).position==="fixed",i=a?Hv(e):e;for(;op(i)&&!xC(i);){let s=ap(i),l=b5(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&Zxt.has(o.position)||HI(i)&&!l&&URe(e,i))?n=n.filter(u=>u!==i):o=s,i=Hv(i)}return t.set(e,n),n}function tbt(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,i=[...r==="clippingAncestors"?cE(t)?[]:ebt(t,this._c):[].concat(r),n],s=i[0],l=i.reduce((c,u)=>{let d=_Re(t,u,o);return c.top=Qc(d.top,c.top),c.right=$h(d.right,c.right),c.bottom=$h(d.bottom,c.bottom),c.left=Qc(d.left,c.left),c},_Re(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rbt(e){let{width:t,height:r}=BRe(e);return{width:t,height:r}}function nbt(e,t,r){let n=wm(t),o=bm(t),a=r==="fixed",i=bC(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=ym(0);function c(){l.x=S5(o)}if(n||!n&&!a)if((yC(t)!=="body"||HI(o))&&(s=uE(t)),n){let p=bC(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();a&&!n&&o&&c();let u=o&&!n&&!a?zRe(o,s):ym(0),d=i.left+s.scrollLeft-l.x-u.x,f=i.top+s.scrollTop-l.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function UQ(e){return ap(e).position==="static"}function FRe(e,t){if(!wm(e)||ap(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return bm(e)===r&&(r=r.ownerDocument.body),r}function HRe(e,t){let r=Hu(e);if(cE(e))return r;if(!wm(e)){let o=Hv(e);for(;o&&!xC(o);){if(op(o)&&!UQ(o))return o;o=Hv(o)}return r}let n=FRe(e,t);for(;n&&LRe(n)&&UQ(n);)n=FRe(n,t);return n&&xC(n)&&UQ(n)&&!b5(n)?r:n||ERe(e)||r}var obt=async function(e){let t=this.getOffsetParent||HRe,r=this.getDimensions,n=await r(e.floating);return{reference:nbt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function abt(e){return ap(e).direction==="rtl"}var jRe={convertOffsetParentRelativeRectToViewportRelativeRect:Kxt,getDocumentElement:bm,getClippingRect:tbt,getOffsetParent:HRe,getElementRects:obt,getClientRects:Xxt,getDimensions:rbt,getScale:jI,isElement:op,isRTL:abt};function qRe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ibt(e,t){let r=null,n,o=bm(e);function a(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;let m=lE(d),h=lE(o.clientWidth-(u+f)),g=lE(o.clientHeight-(d+p)),v=lE(u),x={rootMargin:-m+"px "+-h+"px "+-g+"px "+-v+"px",threshold:Qc(0,$h(1,l))||1},C=!0;function b(w){let S=w[0].intersectionRatio;if(S!==l){if(!C)return i();S?i(!1,S):n=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!qRe(c,e.getBoundingClientRect())&&i(),C=!1}try{r=new IntersectionObserver(b,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(b,x)}r.observe(e)}return i(!0),a}function jQ(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=HQ(e),u=o||a?[...c?vC(c):[],...vC(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),a&&v.addEventListener("resize",r)});let d=c&&s?ibt(c,r):null,f=-1,p=null;i&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let m,h=l?bC(e):null;l&&g();function g(){let v=bC(e);h&&!qRe(h,v)&&r(),h=v,m=requestAnimationFrame(g)}return r(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",r),a&&y.removeEventListener("resize",r)}),d?.(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(m)}}var $Re=RRe;var WRe=kRe,GRe=SRe,KRe=MRe,XRe=PRe,qQ=CRe;var YRe=NRe,$Q=(e,t,r)=>{let n=new Map,o={platform:jRe,...r},a={...o.platform,_c:n};return wRe(e,t,{...o,platform:a})};var hs=E(it(),1),ZRe=E(it(),1),JRe=E(zh(),1),sbt=typeof document<"u",lbt=function(){},P5=sbt?ZRe.useLayoutEffect:lbt;function I5(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!I5(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){let a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!I5(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function eke(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function QRe(e,t){let r=eke(e);return Math.round(t*r)/r}function WQ(e){let t=hs.useRef(e);return P5(()=>{t.current=e}),t}function tke(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=hs.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=hs.useState(n);I5(f,n)||p(n);let[m,h]=hs.useState(null),[g,v]=hs.useState(null),y=hs.useCallback(T=>{T!==w.current&&(w.current=T,h(T))},[]),x=hs.useCallback(T=>{T!==S.current&&(S.current=T,v(T))},[]),C=a||m,b=i||g,w=hs.useRef(null),S=hs.useRef(null),P=hs.useRef(u),N=l!=null,O=WQ(l),L=WQ(o),A=WQ(c),U=hs.useCallback(()=>{if(!w.current||!S.current)return;let T={placement:t,strategy:r,middleware:f};L.current&&(T.platform=L.current),$Q(w.current,S.current,T).then(D=>{let F={...D,isPositioned:A.current!==!1};V.current&&!I5(P.current,F)&&(P.current=F,JRe.flushSync(()=>{d(F)}))})},[f,t,r,L,A]);P5(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[c]);let V=hs.useRef(!1);P5(()=>(V.current=!0,()=>{V.current=!1}),[]),P5(()=>{if(C&&(w.current=C),b&&(S.current=b),C&&b){if(O.current)return O.current(C,b,U);U()}},[C,b,U,O,N]);let R=hs.useMemo(()=>({reference:w,floating:S,setReference:y,setFloating:x}),[y,x]),I=hs.useMemo(()=>({reference:C,floating:b}),[C,b]),k=hs.useMemo(()=>{let T={position:r,left:0,top:0};if(!I.floating)return T;let D=QRe(I.floating,u.x),F=QRe(I.floating,u.y);return s?{...T,transform:"translate("+D+"px, "+F+"px)",...eke(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:D,top:F}},[r,s,I.floating,u.x,u.y]);return hs.useMemo(()=>({...u,update:U,refs:R,elements:I,floatingStyles:k}),[u,U,R,I,k])}var cbt=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){let{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?qQ({element:n.current,padding:o}).fn(r):{}:n?qQ({element:n,padding:o}).fn(r):{}}}},rke=(e,t)=>({...$Re(e),options:[e,t]}),nke=(e,t)=>({...WRe(e),options:[e,t]}),oke=(e,t)=>({...YRe(e),options:[e,t]}),ake=(e,t)=>({...GRe(e),options:[e,t]}),ike=(e,t)=>({...KRe(e),options:[e,t]});var ske=(e,t)=>({...XRe(e),options:[e,t]});var lke=(e,t)=>({...cbt(e),options:[e,t]});var cke=E(it(),1);var GQ=E(Mr(),1),ubt="Arrow",uke=cke.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...a}=e;return(0,GQ.jsx)(et.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,GQ.jsx)("polygon",{points:"0,0 30,0 15,10"})})});uke.displayName=ubt;var dke=uke;var qI=E(it(),1);function Wn(e){let t=qI.useRef(e);return qI.useEffect(()=>{t.current=e}),qI.useMemo(()=>(...r)=>t.current?.(...r),[])}var fke=E(it(),1);function $I(e){let[t,r]=fke.useState(void 0);return En(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;let a=o[0],i,s;if("borderBoxSize"in a){let l=a.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,s=c.blockSize}else i=e.offsetWidth,s=e.offsetHeight;r({width:i,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Pb=E(Mr(),1);var KQ="Popper",[pke,Zc]=on(KQ),[fbt,mke]=pke(KQ),hke=e=>{let{__scopePopper:t,children:r}=e,[n,o]=ju.useState(null);return(0,Pb.jsx)(fbt,{scope:t,anchor:n,onAnchorChange:o,children:r})};hke.displayName=KQ;var gke="PopperAnchor",vke=ju.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...o}=e,a=mke(gke,r),i=ju.useRef(null),s=Ut(t,i),l=ju.useRef(null);return ju.useEffect(()=>{let c=l.current;l.current=n?.current||i.current,c!==l.current&&a.onAnchorChange(l.current)}),n?null:(0,Pb.jsx)(et.div,{...o,ref:s})});vke.displayName=gke;var XQ="PopperContent",[pbt,mbt]=pke(XQ),yke=ju.forwardRef((e,t)=>{let{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...h}=e,g=mke(XQ,r),[v,y]=ju.useState(null),x=Ut(t,z=>y(z)),[C,b]=ju.useState(null),w=$I(C),S=w?.width??0,P=w?.height??0,N=n+(a!=="center"?"-"+a:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(c)?c:[c],A=L.length>0,U={padding:O,boundary:L.filter(gbt),altBoundary:A},{refs:V,floatingStyles:R,placement:I,isPositioned:k,middlewareData:T}=tke({strategy:"fixed",placement:N,whileElementsMounted:(...z)=>jQ(...z,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[rke({mainAxis:o+P,alignmentAxis:i}),l&&nke({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?oke():void 0,...U}),l&&ake({...U}),ike({...U,apply:({elements:z,rects:G,availableWidth:X,availableHeight:Q})=>{let{width:oe,height:ae}=G.reference,Le=z.floating.style;Le.setProperty("--radix-popper-available-width",`${X}px`),Le.setProperty("--radix-popper-available-height",`${Q}px`),Le.setProperty("--radix-popper-anchor-width",`${oe}px`),Le.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),C&&lke({element:C,padding:s}),vbt({arrowWidth:S,arrowHeight:P}),f&&ske({strategy:"referenceHidden",...U})]}),[D,F]=wke(I),_=Wn(m);En(()=>{k&&_?.()},[k,_]);let M=T.arrow?.x,j=T.arrow?.y,H=T.arrow?.centerOffset!==0,[q,W]=ju.useState();return En(()=>{v&&W(window.getComputedStyle(v).zIndex)},[v]),(0,Pb.jsx)("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:k?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,["--radix-popper-transform-origin"]:[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,Pb.jsx)(pbt,{scope:r,placedSide:D,onArrowChange:b,arrowX:M,arrowY:j,shouldHideArrow:H,children:(0,Pb.jsx)(et.div,{"data-side":D,"data-align":F,...h,ref:x,style:{...h.style,animation:k?void 0:"none"}})})})});yke.displayName=XQ;var xke="PopperArrow",hbt={top:"bottom",right:"left",bottom:"top",left:"right"},bke=ju.forwardRef(function(t,r){let{__scopePopper:n,...o}=t,a=mbt(xke,n),i=hbt[a.placedSide];return(0,Pb.jsx)("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:(0,Pb.jsx)(dke,{...o,ref:r,style:{...o.style,display:"block"}})})});bke.displayName=xke;function gbt(e){return e!==null}var vbt=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,s=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=wke(r),d={start:"0%",center:"50%",end:"100%"}[u],f=(o.arrow?.x??0)+s/2,p=(o.arrow?.y??0)+l/2,m="",h="";return c==="bottom"?(m=i?d:`${f}px`,h=`${-l}px`):c==="top"?(m=i?d:`${f}px`,h=`${n.floating.height+l}px`):c==="right"?(m=`${-l}px`,h=i?d:`${p}px`):c==="left"&&(m=`${n.floating.width+l}px`,h=i?d:`${p}px`),{data:{x:m,y:h}}}});function wke(e){let[t,r="center"]=e.split("-");return[t,r]}var Cm=hke,Sm=vke,Kh=yke,Xh=bke;var R5=E(it(),1),Cke=E(zh(),1);var Ske=E(Mr(),1),ybt="Portal",Jc=R5.forwardRef((e,t)=>{let{container:r,...n}=e,[o,a]=R5.useState(!1);En(()=>a(!0),[]);let i=r||o&&globalThis?.document?.body;return i?Cke.default.createPortal((0,Ske.jsx)(et.div,{...n,ref:t}),i):null});Jc.displayName=ybt;var qu=E(it(),1);var Pke=E(it(),1);function xbt(e,t){return Pke.useReducer((r,n)=>t[r][n]??r,e)}var to=e=>{let{present:t,children:r}=e,n=bbt(t),o=typeof r=="function"?r({present:n.isPresent}):qu.Children.only(r),a=Ut(n.ref,wbt(o));return typeof r=="function"||n.isPresent?qu.cloneElement(o,{ref:a}):null};to.displayName="Presence";function bbt(e){let[t,r]=qu.useState(),n=qu.useRef(null),o=qu.useRef(e),a=qu.useRef("none"),i=e?"mounted":"unmounted",[s,l]=xbt(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return qu.useEffect(()=>{let c=k5(n.current);a.current=s==="mounted"?c:"none"},[s]),En(()=>{let c=n.current,u=o.current;if(u!==e){let f=a.current,p=k5(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),En(()=>{if(t){let c,u=t.ownerDocument.defaultView??window,d=p=>{let h=k5(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&h&&(l("ANIMATION_END"),!o.current)){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=p=>{p.target===t&&(a.current=k5(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:qu.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function k5(e){return e?.animationName||"none"}function wbt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var mi=E(it(),1);var Ike=E(it(),1);function Rke(e,t=globalThis?.document){let r=Wn(e);Ike.useEffect(()=>{let n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var QQ=E(Mr(),1),Cbt="DismissableLayer",YQ="dismissableLayer.update",Sbt="dismissableLayer.pointerDownOutside",Pbt="dismissableLayer.focusOutside",kke,Mke=mi.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lc=mi.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...l}=e,c=mi.useContext(Mke),[u,d]=mi.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=mi.useState({}),m=Ut(t,S=>d(S)),h=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g),y=u?h.indexOf(u):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,C=y>=v,b=Rbt(S=>{let P=S.target,N=[...c.branches].some(O=>O.contains(P));!C||N||(o?.(S),i?.(S),S.defaultPrevented||s?.())},f),w=kbt(S=>{let P=S.target;[...c.branches].some(O=>O.contains(P))||(a?.(S),i?.(S),S.defaultPrevented||s?.())},f);return Rke(S=>{y===c.layers.size-1&&(n?.(S),!S.defaultPrevented&&s&&(S.preventDefault(),s()))},f),mi.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(kke=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Nke(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=kke)}},[u,f,r,c]),mi.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Nke())},[u,c]),mi.useEffect(()=>{let S=()=>p({});return document.addEventListener(YQ,S),()=>document.removeEventListener(YQ,S)},[]),(0,QQ.jsx)(et.div,{...l,ref:m,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:ze(e.onFocusCapture,w.onFocusCapture),onBlurCapture:ze(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:ze(e.onPointerDownCapture,b.onPointerDownCapture)})});lc.displayName=Cbt;var Ibt="DismissableLayerBranch",Tke=mi.forwardRef((e,t)=>{let r=mi.useContext(Mke),n=mi.useRef(null),o=Ut(t,n);return mi.useEffect(()=>{let a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),(0,QQ.jsx)(et.div,{...e,ref:o})});Tke.displayName=Ibt;function Rbt(e,t=globalThis?.document){let r=Wn(e),n=mi.useRef(!1),o=mi.useRef(()=>{});return mi.useEffect(()=>{let a=s=>{if(s.target&&!n.current){let c=function(){Ake(Sbt,r,u,{discrete:!0})};var l=c;let u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function kbt(e,t=globalThis?.document){let r=Wn(e),n=mi.useRef(!1);return mi.useEffect(()=>{let o=a=>{a.target&&!n.current&&Ake(Pbt,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Nke(){let e=new CustomEvent(YQ);document.dispatchEvent(e)}function Ake(e,t,r,{discrete:n}){let o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Ov(o,a):o.dispatchEvent(a)}var Lke=lc,Eke=Tke;var Wd=E(Mr(),1),ZQ,T5="HoverCard",[Dke,Sqr]=on(T5,[Zc]),A5=Zc(),[Mbt,L5]=Dke(T5),Oke=e=>{let{__scopeHoverCard:t,children:r,open:n,defaultOpen:o,onOpenChange:a,openDelay:i=700,closeDelay:s=300}=e,l=A5(t),c=Li.useRef(0),u=Li.useRef(0),d=Li.useRef(!1),f=Li.useRef(!1),[p,m]=$n({prop:n,defaultProp:o??!1,onChange:a,caller:T5}),h=Li.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>m(!0),i)},[i,m]),g=Li.useCallback(()=>{clearTimeout(c.current),!d.current&&!f.current&&(u.current=window.setTimeout(()=>m(!1),s))},[s,m]),v=Li.useCallback(()=>m(!1),[m]);return Li.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),(0,Wd.jsx)(Mbt,{scope:t,open:p,onOpenChange:m,onOpen:h,onClose:g,onDismiss:v,hasSelectionRef:d,isPointerDownOnContentRef:f,children:(0,Wd.jsx)(Cm,{...l,children:r})})};Oke.displayName=T5;var _ke="HoverCardTrigger",Fke=Li.forwardRef((e,t)=>{let{__scopeHoverCard:r,...n}=e,o=L5(_ke,r),a=A5(r);return(0,Wd.jsx)(Sm,{asChild:!0,...a,children:(0,Wd.jsx)(et.a,{"data-state":o.open?"open":"closed",...n,ref:t,onPointerEnter:ze(e.onPointerEnter,M5(o.onOpen)),onPointerLeave:ze(e.onPointerLeave,M5(o.onClose)),onFocus:ze(e.onFocus,o.onOpen),onBlur:ze(e.onBlur,o.onClose),onTouchStart:ze(e.onTouchStart,i=>i.preventDefault())})})});Fke.displayName=_ke;var JQ="HoverCardPortal",[Tbt,Abt]=Dke(JQ,{forceMount:void 0}),Lbt=e=>{let{__scopeHoverCard:t,forceMount:r,children:n,container:o}=e,a=L5(JQ,t);return(0,Wd.jsx)(Tbt,{scope:t,forceMount:r,children:(0,Wd.jsx)(to,{present:r||a.open,children:(0,Wd.jsx)(Jc,{asChild:!0,container:o,children:n})})})};Lbt.displayName=JQ;var N5="HoverCardContent",Bke=Li.forwardRef((e,t)=>{let r=Abt(N5,e.__scopeHoverCard),{forceMount:n=r.forceMount,...o}=e,a=L5(N5,e.__scopeHoverCard);return(0,Wd.jsx)(to,{present:n||a.open,children:(0,Wd.jsx)(Ebt,{"data-state":a.open?"open":"closed",...o,onPointerEnter:ze(e.onPointerEnter,M5(a.onOpen)),onPointerLeave:ze(e.onPointerLeave,M5(a.onClose)),ref:t})})});Bke.displayName=N5;var Ebt=Li.forwardRef((e,t)=>{let{__scopeHoverCard:r,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,...s}=e,l=L5(N5,r),c=A5(r),u=Li.useRef(null),d=Ut(t,u),[f,p]=Li.useState(!1);return Li.useEffect(()=>{if(f){let m=document.body;return ZQ=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=ZQ,m.style.webkitUserSelect=ZQ}}},[f]),Li.useEffect(()=>{if(u.current){let m=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",m),()=>{document.removeEventListener("pointerup",m),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),Li.useEffect(()=>{u.current&&_bt(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),(0,Wd.jsx)(lc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:ze(a,m=>{m.preventDefault()}),onDismiss:l.onDismiss,children:(0,Wd.jsx)(Kh,{...c,...s,onPointerDown:ze(s.onPointerDown,m=>{m.currentTarget.contains(m.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Dbt="HoverCardArrow",Obt=Li.forwardRef((e,t)=>{let{__scopeHoverCard:r,...n}=e,o=A5(r);return(0,Wd.jsx)(Xh,{...o,...n,ref:t})});Obt.displayName=Dbt;function M5(e){return t=>t.pointerType==="touch"?void 0:e()}function _bt(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)t.push(r.currentNode);return t}var Vke=Oke,zke=Fke;var eZ=Bke;var Hke=E(me(),1),fE=Vke,pE=zke,WI=Uke.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>(0,Hke.jsx)(eZ,{ref:o,align:t,sideOffset:r,className:B("z-50 w-64 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),...n}));WI.displayName=eZ.displayName;var CC=E(de(),1);var ur=E(it(),1),Yke=E(zh(),1);var E5=E(it(),1),Bbt=E(Mr(),1),Vbt=E5.createContext(void 0);function ip(e){let t=E5.useContext(Vbt);return e||t||"ltr"}var tZ=E(it(),1);var zbt=tZ[" useId ".trim().toString()]||(()=>{}),Ubt=0;function No(e){let[t,r]=tZ.useState(zbt());return En(()=>{e||r(n=>n??String(Ubt++))},[e]),e||(t?`radix-${t}`:"")}var Ib=E(it(),1);var D5=E(Mr(),1),Hbt=E(it(),1);var qbt=E(Mr(),1);function Gd(e){let t=e+"CollectionProvider",[r,n]=on(t),[o,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{let{scope:g,children:v}=h,y=Ib.default.useRef(null),x=Ib.default.useRef(new Map).current;return(0,D5.jsx)(o,{scope:g,itemMap:x,collectionRef:y,children:v})};i.displayName=t;let s=e+"CollectionSlot",l=ac(s),c=Ib.default.forwardRef((h,g)=>{let{scope:v,children:y}=h,x=a(s,v),C=Ut(g,x.collectionRef);return(0,D5.jsx)(l,{ref:C,children:y})});c.displayName=s;let u=e+"CollectionItemSlot",d="data-radix-collection-item",f=ac(u),p=Ib.default.forwardRef((h,g)=>{let{scope:v,children:y,...x}=h,C=Ib.default.useRef(null),b=Ut(g,C),w=a(u,v);return Ib.default.useEffect(()=>(w.itemMap.set(C,{ref:C,...x}),()=>void w.itemMap.delete(C))),(0,D5.jsx)(f,{[d]:"",ref:b,children:y})});p.displayName=u;function m(h){let g=a(e+"CollectionConsumer",h);return Ib.default.useCallback(()=>{let y=g.collectionRef.current;if(!y)return[];let x=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((w,S)=>x.indexOf(w.ref.current)-x.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:c,ItemSlot:p},m,n]}var jke=new WeakMap,gs,Pm,Lqr=(Pm=class extends Map{constructor(r){super(r);MF(this,gs,void 0);T1(this,gs,[...super.keys()]),jke.set(this,!0)}set(r,n){return jke.get(this)&&(this.has(r)?Jn(this,gs)[Jn(this,gs).indexOf(r)]=r:Jn(this,gs).push(r)),super.set(r,n),this}insert(r,n,o){let a=this.has(n),i=Jn(this,gs).length,s=qke(r),l=s>=0?s:i+s,c=l<0||l>=i?-1:l;if(c===this.size||a&&c===this.size-1||c===-1)return this.set(n,o),this;let u=this.size+(a?0:1);s<0&&l++;let d=[...Jn(this,gs)],f,p=!1;for(let m=l;m<u;m++)if(l===m){let h=d[m];d[m]===n&&(h=d[m+1]),a&&this.delete(n),f=this.get(h),this.set(n,o)}else{!p&&d[m-1]===n&&(p=!0);let h=d[p?m:m-1],g=f;f=this.get(h),this.delete(h),this.set(h,g)}return this}with(r,n,o){let a=new Pm(this);return a.insert(r,n,o),a}before(r){let n=Jn(this,gs).indexOf(r)-1;if(!(n<0))return this.entryAt(n)}setBefore(r,n,o){let a=Jn(this,gs).indexOf(r);return a===-1?this:this.insert(a,n,o)}after(r){let n=Jn(this,gs).indexOf(r);if(n=n===-1||n===this.size-1?-1:n+1,n!==-1)return this.entryAt(n)}setAfter(r,n,o){let a=Jn(this,gs).indexOf(r);return a===-1?this:this.insert(a+1,n,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return T1(this,gs,[]),super.clear()}delete(r){let n=super.delete(r);return n&&Jn(this,gs).splice(Jn(this,gs).indexOf(r),1),n}deleteAt(r){let n=this.keyAt(r);return n!==void 0?this.delete(n):!1}at(r){let n=rZ(Jn(this,gs),r);if(n!==void 0)return this.get(n)}entryAt(r){let n=rZ(Jn(this,gs),r);if(n!==void 0)return[n,this.get(n)]}indexOf(r){return Jn(this,gs).indexOf(r)}keyAt(r){return rZ(Jn(this,gs),r)}from(r,n){let o=this.indexOf(r);if(o===-1)return;let a=o+n;return a<0&&(a=0),a>=this.size&&(a=this.size-1),this.at(a)}keyFrom(r,n){let o=this.indexOf(r);if(o===-1)return;let a=o+n;return a<0&&(a=0),a>=this.size&&(a=this.size-1),this.keyAt(a)}find(r,n){let o=0;for(let a of this){if(Reflect.apply(r,n,[a,o,this]))return a;o++}}findIndex(r,n){let o=0;for(let a of this){if(Reflect.apply(r,n,[a,o,this]))return o;o++}return-1}filter(r,n){let o=[],a=0;for(let i of this)Reflect.apply(r,n,[i,a,this])&&o.push(i),a++;return new Pm(o)}map(r,n){let o=[],a=0;for(let i of this)o.push([i[0],Reflect.apply(r,n,[i,a,this])]),a++;return new Pm(o)}reduce(...r){let[n,o]=r,a=0,i=o??this.at(0);for(let s of this)a===0&&r.length===1?i=s:i=Reflect.apply(n,this,[i,s,a,this]),a++;return i}reduceRight(...r){let[n,o]=r,a=o??this.at(-1);for(let i=this.size-1;i>=0;i--){let s=this.at(i);i===this.size-1&&r.length===1?a=s:a=Reflect.apply(n,this,[a,s,i,this])}return a}toSorted(r){let n=[...this.entries()].sort(r);return new Pm(n)}toReversed(){let r=new Pm;for(let n=this.size-1;n>=0;n--){let o=this.keyAt(n),a=this.get(o);r.set(o,a)}return r}toSpliced(...r){let n=[...this.entries()];return n.splice(...r),new Pm(n)}slice(r,n){let o=new Pm,a=this.size-1;if(r===void 0)return o;r<0&&(r=r+this.size),n!==void 0&&n>0&&(a=n-1);for(let i=r;i<=a;i++){let s=this.keyAt(i),l=this.get(s);o.set(s,l)}return o}every(r,n){let o=0;for(let a of this){if(!Reflect.apply(r,n,[a,o,this]))return!1;o++}return!0}some(r,n){let o=0;for(let a of this){if(Reflect.apply(r,n,[a,o,this]))return!0;o++}return!1}},gs=new WeakMap,Pm);function rZ(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=jbt(e,t);return r===-1?void 0:e[r]}function jbt(e,t){let r=e.length,n=qke(t),o=n>=0?n:r+n;return o<0||o>=r?-1:o}function qke(e){return e!==e||e===0?0:Math.trunc(e)}var O5=E(it(),1);function Rb(e){let t=O5.useRef({value:e,previous:e});return O5.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var $ke=E(it(),1);var Wke=E(Mr(),1),nZ=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),$bt="VisuallyHidden",mE=$ke.forwardRef((e,t)=>(0,Wke.jsx)(et.span,{...e,ref:t,style:{...nZ,...e.style}}));mE.displayName=$bt;var _5=mE;var _r=E(Mr(),1),wC="NavigationMenu",[cZ,Qke,Wbt]=Gd(wC),[oZ,Gbt,Kbt]=Gd(wC),[uZ,Yqr]=on(wC,[Wbt,Kbt]),[Xbt,sp]=uZ(wC),[Ybt,Qbt]=uZ(wC),Zke=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,value:n,onValueChange:o,defaultValue:a,delayDuration:i=200,skipDelayDuration:s=300,orientation:l="horizontal",dir:c,...u}=e,[d,f]=ur.useState(null),p=Ut(t,N=>f(N)),m=ip(c),h=ur.useRef(0),g=ur.useRef(0),v=ur.useRef(0),[y,x]=ur.useState(!0),[C,b]=$n({prop:n,onChange:N=>{let O=N!=="",L=s>0;O?(window.clearTimeout(v.current),L&&x(!1)):(window.clearTimeout(v.current),v.current=window.setTimeout(()=>x(!0),s)),o?.(N)},defaultProp:a??"",caller:wC}),w=ur.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>b(""),150)},[b]),S=ur.useCallback(N=>{window.clearTimeout(g.current),b(N)},[b]),P=ur.useCallback(N=>{C===N?window.clearTimeout(g.current):h.current=window.setTimeout(()=>{window.clearTimeout(g.current),b(N)},i)},[C,b,i]);return ur.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(g.current),window.clearTimeout(v.current)},[]),(0,_r.jsx)(Jke,{scope:r,isRootMenu:!0,value:C,dir:m,orientation:l,rootNavigationMenu:d,onTriggerEnter:N=>{window.clearTimeout(h.current),y?P(N):S(N)},onTriggerLeave:()=>{window.clearTimeout(h.current),w()},onContentEnter:()=>window.clearTimeout(g.current),onContentLeave:w,onItemSelect:N=>{b(O=>O===N?"":N)},onItemDismiss:()=>b(""),children:(0,_r.jsx)(et.nav,{"aria-label":"Main","data-orientation":l,dir:m,...u,ref:p})})});Zke.displayName=wC;var aZ="NavigationMenuSub",Zbt=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",...s}=e,l=sp(aZ,r),[c,u]=$n({prop:n,onChange:o,defaultProp:a??"",caller:aZ});return(0,_r.jsx)(Jke,{scope:r,isRootMenu:!1,value:c,dir:l.dir,orientation:i,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>u(d),onItemSelect:d=>u(d),onItemDismiss:()=>u(""),children:(0,_r.jsx)(et.div,{"data-orientation":i,...s,ref:t})})});Zbt.displayName=aZ;var Jke=e=>{let{scope:t,isRootMenu:r,rootNavigationMenu:n,dir:o,orientation:a,children:i,value:s,onItemSelect:l,onItemDismiss:c,onTriggerEnter:u,onTriggerLeave:d,onContentEnter:f,onContentLeave:p}=e,[m,h]=ur.useState(null),[g,v]=ur.useState(new Map),[y,x]=ur.useState(null);return(0,_r.jsx)(Xbt,{scope:t,isRootMenu:r,rootNavigationMenu:n,value:s,previousValue:Rb(s),baseId:No(),dir:o,orientation:a,viewport:m,onViewportChange:h,indicatorTrack:y,onIndicatorTrackChange:x,onTriggerEnter:Wn(u),onTriggerLeave:Wn(d),onContentEnter:Wn(f),onContentLeave:Wn(p),onItemSelect:Wn(l),onItemDismiss:Wn(c),onViewportContentChange:ur.useCallback((C,b)=>{v(w=>(w.set(C,b),new Map(w)))},[]),onViewportContentRemove:ur.useCallback(C=>{v(b=>b.has(C)?(b.delete(C),new Map(b)):b)},[]),children:(0,_r.jsx)(cZ.Provider,{scope:t,children:(0,_r.jsx)(Ybt,{scope:t,items:g,children:i})})})},eNe="NavigationMenuList",tNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,...n}=e,o=sp(eNe,r),a=(0,_r.jsx)(et.ul,{"data-orientation":o.orientation,...n,ref:t});return(0,_r.jsx)(et.div,{style:{position:"relative"},ref:o.onIndicatorTrackChange,children:(0,_r.jsx)(cZ.Slot,{scope:r,children:o.isRootMenu?(0,_r.jsx)(dNe,{asChild:!0,children:a}):a})})});tNe.displayName=eNe;var rNe="NavigationMenuItem",[Jbt,nNe]=uZ(rNe),oNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,value:n,...o}=e,a=No(),i=n||a||"LEGACY_REACT_AUTO_VALUE",s=ur.useRef(null),l=ur.useRef(null),c=ur.useRef(null),u=ur.useRef(()=>{}),d=ur.useRef(!1),f=ur.useCallback((m="start")=>{if(s.current){u.current();let h=sZ(s.current);h.length&&pZ(m==="start"?h:h.reverse())}},[]),p=ur.useCallback(()=>{if(s.current){let m=sZ(s.current);m.length&&(u.current=i0t(m))}},[]);return(0,_r.jsx)(Jbt,{scope:r,value:i,triggerRef:l,contentRef:s,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:p,onContentFocusOutside:p,children:(0,_r.jsx)(et.li,{...o,ref:t})})});oNe.displayName=rNe;var iZ="NavigationMenuTrigger",aNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,disabled:n,...o}=e,a=sp(iZ,e.__scopeNavigationMenu),i=nNe(iZ,e.__scopeNavigationMenu),s=ur.useRef(null),l=Ut(s,i.triggerRef,t),c=pNe(a.baseId,i.value),u=mNe(a.baseId,i.value),d=ur.useRef(!1),f=ur.useRef(!1),p=i.value===a.value;return(0,_r.jsxs)(_r.Fragment,{children:[(0,_r.jsx)(cZ.ItemSlot,{scope:r,value:i.value,children:(0,_r.jsx)(fNe,{asChild:!0,children:(0,_r.jsx)(et.button,{id:c,disabled:n,"data-disabled":n?"":void 0,"data-state":mZ(p),"aria-expanded":p,"aria-controls":u,...o,ref:l,onPointerEnter:ze(e.onPointerEnter,()=>{f.current=!1,i.wasEscapeCloseRef.current=!1}),onPointerMove:ze(e.onPointerMove,B5(()=>{n||f.current||i.wasEscapeCloseRef.current||d.current||(a.onTriggerEnter(i.value),d.current=!0)})),onPointerLeave:ze(e.onPointerLeave,B5(()=>{n||(a.onTriggerLeave(),d.current=!1)})),onClick:ze(e.onClick,()=>{a.onItemSelect(i.value),f.current=p}),onKeyDown:ze(e.onKeyDown,m=>{let g={horizontal:"ArrowDown",vertical:a.dir==="rtl"?"ArrowLeft":"ArrowRight"}[a.orientation];p&&m.key===g&&(i.onEntryKeyDown(),m.preventDefault())})})})}),p&&(0,_r.jsxs)(_r.Fragment,{children:[(0,_r.jsx)(_5,{"aria-hidden":!0,tabIndex:0,ref:i.focusProxyRef,onFocus:m=>{let h=i.contentRef.current,g=m.relatedTarget,v=g===s.current,y=h?.contains(g);(v||!y)&&i.onFocusProxyEnter(v?"start":"end")}}),a.viewport&&(0,_r.jsx)("span",{"aria-owns":u})]})]})});aNe.displayName=iZ;var e0t="NavigationMenuLink",Kke="navigationMenu.linkSelect",iNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,active:n,onSelect:o,...a}=e;return(0,_r.jsx)(fNe,{asChild:!0,children:(0,_r.jsx)(et.a,{"data-active":n?"":void 0,"aria-current":n?"page":void 0,...a,ref:t,onClick:ze(e.onClick,i=>{let s=i.target,l=new CustomEvent(Kke,{bubbles:!0,cancelable:!0});if(s.addEventListener(Kke,c=>o?.(c),{once:!0}),Ov(s,l),!l.defaultPrevented&&!i.metaKey){let c=new CustomEvent(F5,{bubbles:!0,cancelable:!0});Ov(s,c)}},{checkForDefaultPrevented:!1})})})});iNe.displayName=e0t;var dZ="NavigationMenuIndicator",sNe=ur.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=sp(dZ,e.__scopeNavigationMenu),a=!!o.value;return o.indicatorTrack?Yke.default.createPortal((0,_r.jsx)(to,{present:r||a,children:(0,_r.jsx)(t0t,{...n,ref:t})}),o.indicatorTrack):null});sNe.displayName=dZ;var t0t=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,...n}=e,o=sp(dZ,r),a=Qke(r),[i,s]=ur.useState(null),[l,c]=ur.useState(null),u=o.orientation==="horizontal",d=!!o.value;ur.useEffect(()=>{let m=a().find(h=>h.value===o.value)?.ref.current;m&&s(m)},[a,o.value]);let f=()=>{i&&c({size:u?i.offsetWidth:i.offsetHeight,offset:u?i.offsetLeft:i.offsetTop})};return lZ(i,f),lZ(o.indicatorTrack,f),l?(0,_r.jsx)(et.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":o.orientation,...n,ref:t,style:{position:"absolute",...u?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...n.style}}):null}),GI="NavigationMenuContent",lNe=ur.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=sp(GI,e.__scopeNavigationMenu),a=nNe(GI,e.__scopeNavigationMenu),i=Ut(a.contentRef,t),s=a.value===o.value,l={value:a.value,triggerRef:a.triggerRef,focusProxyRef:a.focusProxyRef,wasEscapeCloseRef:a.wasEscapeCloseRef,onContentFocusOutside:a.onContentFocusOutside,onRootContentClose:a.onRootContentClose,...n};return o.viewport?(0,_r.jsx)(r0t,{forceMount:r,...l,ref:i}):(0,_r.jsx)(to,{present:r||s,children:(0,_r.jsx)(cNe,{"data-state":mZ(s),...l,ref:i,onPointerEnter:ze(e.onPointerEnter,o.onContentEnter),onPointerLeave:ze(e.onPointerLeave,B5(o.onContentLeave)),style:{pointerEvents:!s&&o.isRootMenu?"none":void 0,...l.style}})})});lNe.displayName=GI;var r0t=ur.forwardRef((e,t)=>{let r=sp(GI,e.__scopeNavigationMenu),{onViewportContentChange:n,onViewportContentRemove:o}=r;return En(()=>{n(e.value,{ref:t,...e})},[e,t,n]),En(()=>()=>o(e.value),[e.value,o]),null}),F5="navigationMenu.rootContentDismiss",cNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,value:n,triggerRef:o,focusProxyRef:a,wasEscapeCloseRef:i,onRootContentClose:s,onContentFocusOutside:l,...c}=e,u=sp(GI,r),d=ur.useRef(null),f=Ut(d,t),p=pNe(u.baseId,n),m=mNe(u.baseId,n),h=Qke(r),g=ur.useRef(null),{onItemDismiss:v}=u;ur.useEffect(()=>{let x=d.current;if(u.isRootMenu&&x){let C=()=>{v(),s(),x.contains(document.activeElement)&&o.current?.focus()};return x.addEventListener(F5,C),()=>x.removeEventListener(F5,C)}},[u.isRootMenu,e.value,o,v,s]);let y=ur.useMemo(()=>{let C=h().map(O=>O.value);u.dir==="rtl"&&C.reverse();let b=C.indexOf(u.value),w=C.indexOf(u.previousValue),S=n===u.value,P=w===C.indexOf(n);if(!S&&!P)return g.current;let N=(()=>{if(b!==w){if(S&&w!==-1)return b>w?"from-end":"from-start";if(P&&b!==-1)return b>w?"to-start":"to-end"}return null})();return g.current=N,N},[u.previousValue,u.value,u.dir,h,n]);return(0,_r.jsx)(dNe,{asChild:!0,children:(0,_r.jsx)(lc,{id:m,"aria-labelledby":p,"data-motion":y,"data-orientation":u.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{let x=new Event(F5,{bubbles:!0,cancelable:!0});d.current?.dispatchEvent(x)},onFocusOutside:ze(e.onFocusOutside,x=>{l();let C=x.target;u.rootNavigationMenu?.contains(C)&&x.preventDefault()}),onPointerDownOutside:ze(e.onPointerDownOutside,x=>{let C=x.target,b=h().some(S=>S.ref.current?.contains(C)),w=u.isRootMenu&&u.viewport?.contains(C);(b||w||!u.isRootMenu)&&x.preventDefault()}),onKeyDown:ze(e.onKeyDown,x=>{let C=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!C){let w=sZ(x.currentTarget),S=document.activeElement,P=w.findIndex(L=>L===S),O=x.shiftKey?w.slice(0,P).reverse():w.slice(P+1,w.length);pZ(O)?x.preventDefault():a.current?.focus()}}),onEscapeKeyDown:ze(e.onEscapeKeyDown,x=>{i.current=!0})})})}),fZ="NavigationMenuViewport",uNe=ur.forwardRef((e,t)=>{let{forceMount:r,...n}=e,a=!!sp(fZ,e.__scopeNavigationMenu).value;return(0,_r.jsx)(to,{present:r||a,children:(0,_r.jsx)(n0t,{...n,ref:t})})});uNe.displayName=fZ;var n0t=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,children:n,...o}=e,a=sp(fZ,r),i=Ut(t,a.onViewportChange),s=Qbt(GI,e.__scopeNavigationMenu),[l,c]=ur.useState(null),[u,d]=ur.useState(null),f=l?l?.width+"px":void 0,p=l?l?.height+"px":void 0,m=!!a.value,h=m?a.value:a.previousValue;return lZ(u,()=>{u&&c({width:u.offsetWidth,height:u.offsetHeight})}),(0,_r.jsx)(et.div,{"data-state":mZ(m),"data-orientation":a.orientation,...o,ref:i,style:{pointerEvents:!m&&a.isRootMenu?"none":void 0,["--radix-navigation-menu-viewport-width"]:f,["--radix-navigation-menu-viewport-height"]:p,...o.style},onPointerEnter:ze(e.onPointerEnter,a.onContentEnter),onPointerLeave:ze(e.onPointerLeave,B5(a.onContentLeave)),children:Array.from(s.items).map(([v,{ref:y,forceMount:x,...C}])=>{let b=h===v;return(0,_r.jsx)(to,{present:x||b,children:(0,_r.jsx)(cNe,{...C,ref:Dv(y,w=>{b&&w&&d(w)})})},v)})})}),o0t="FocusGroup",dNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,...n}=e,o=sp(o0t,r);return(0,_r.jsx)(oZ.Provider,{scope:r,children:(0,_r.jsx)(oZ.Slot,{scope:r,children:(0,_r.jsx)(et.div,{dir:o.dir,...n,ref:t})})})}),Xke=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],a0t="FocusGroupItem",fNe=ur.forwardRef((e,t)=>{let{__scopeNavigationMenu:r,...n}=e,o=Gbt(r),a=sp(a0t,r);return(0,_r.jsx)(oZ.ItemSlot,{scope:r,children:(0,_r.jsx)(et.button,{...n,ref:t,onKeyDown:ze(e.onKeyDown,i=>{if(["Home","End",...Xke].includes(i.key)){let l=o().map(d=>d.ref.current);if([a.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(i.key)&&l.reverse(),Xke.includes(i.key)){let d=l.indexOf(i.currentTarget);l=l.slice(d+1)}setTimeout(()=>pZ(l)),i.preventDefault()}})})})});function sZ(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function pZ(e){let t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}function i0t(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{let r=t.dataset.tabindex;t.setAttribute("tabindex",r)})}}function lZ(e,t){let r=Wn(t);En(()=>{let n=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}function mZ(e){return e?"open":"closed"}function pNe(e,t){return`${e}-trigger-${t}`}function mNe(e,t){return`${e}-content-${t}`}function B5(e){return t=>t.pointerType==="mouse"?e(t):void 0}var hZ=Zke;var gZ=tNe,hNe=oNe,vZ=aNe,gNe=iNe,yZ=sNe,xZ=lNe,bZ=uNe;var lp=E(me(),1),hE=CC.forwardRef(({className:e,children:t,...r},n)=>(0,lp.jsxs)(hZ,{ref:n,className:B("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,(0,lp.jsx)(V5,{})]}));hE.displayName=hZ.displayName;var gE=CC.forwardRef(({className:e,...t},r)=>(0,lp.jsx)(gZ,{ref:r,className:B("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));gE.displayName=gZ.displayName;var vE=hNe,yE=mt("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),xE=CC.forwardRef(({className:e,children:t,...r},n)=>(0,lp.jsxs)(vZ,{ref:n,className:B(yE(),"group",e),...r,children:[t," ",(0,lp.jsx)($o,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));xE.displayName=vZ.displayName;var bE=CC.forwardRef(({className:e,...t},r)=>(0,lp.jsx)(xZ,{ref:r,className:B("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));bE.displayName=xZ.displayName;var wE=gNe,V5=CC.forwardRef(({className:e,...t},r)=>(0,lp.jsx)("div",{className:B("absolute left-0 top-full flex justify-center"),children:(0,lp.jsx)(bZ,{className:B("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:r,...t})}));V5.displayName=bZ.displayName;var wZ=CC.forwardRef(({className:e,...t},r)=>(0,lp.jsx)(yZ,{ref:r,className:B("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:(0,lp.jsx)("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));wZ.displayName=yZ.displayName;var vs=E(de(),1);var KI=E(de(),1),z5="moonui_license_cache",l0t=24*60*60*1e3,vNe=7*24*60*60*1e3;function Ht(){let[e,t]=(0,KI.useState)(!0),[r,n]=(0,KI.useState)(!0),[o,a]=(0,KI.useState)(!0);(0,KI.useEffect)(()=>{(async()=>{try{let l=localStorage.getItem(z5);if(l){let c=JSON.parse(l),u=Date.now();if(u-c.timestamp<l0t){n(c.valid&&c.hasLifetimeAccess),a(c.valid),t(!1);return}if(u-c.timestamp<vNe){i().catch(()=>{n(c.valid&&c.hasLifetimeAccess),a(c.valid)}),t(!1);return}}await i()}catch(l){console.error("License check error:",l),n(!0),a(!0)}finally{t(!1)}})()},[]);let i=async()=>{let s=process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN||localStorage.getItem("moonui_auth_token");if(!s){n(!0),a(!0);return}try{let l=await fetch("https://moonui.dev/api/auth/validate",{headers:{Authorization:`Bearer ${s}`}});if(l.ok){let c=await l.json(),u={valid:c.valid,hasLifetimeAccess:c.user?.hasLifetimeAccess||!1,timestamp:Date.now(),cacheUntil:c.cacheUntil?new Date(c.cacheUntil).getTime():void 0};localStorage.setItem(z5,JSON.stringify(u)),n(c.valid&&(c.user?.hasLifetimeAccess||c.user?.features?.includes("pro_components"))),a(c.valid)}else localStorage.removeItem(z5),n(!1),a(!1)}catch{let c=localStorage.getItem(z5);if(c){let u=JSON.parse(c);if(Date.now()-u.timestamp<vNe){n(u.valid&&u.hasLifetimeAccess),a(u.valid);return}}n(!1),a(!1)}};return{isLoading:e,isAuthenticated:o,isAdmin:!1,hasProAccess:r,subscriptionPlan:r?"lifetime":"free",subscription:{status:r?"active":"inactive",plan:r?"lifetime":"free"}}}var Gi=E(me(),1),CZ=mt("fixed bg-background shadow-2xl overflow-hidden",{variants:{position:{bottom:"bottom-0 left-0 right-0 rounded-t-[20px] max-h-[95vh]",top:"top-0 left-0 right-0 rounded-b-[20px] max-h-[95vh]",left:"left-0 top-0 bottom-0 rounded-r-[20px] max-w-[90vw]",right:"right-0 top-0 bottom-0 rounded-l-[20px] max-w-[90vw]"},size:{default:"",sm:"",md:"",lg:"",full:""}},compoundVariants:[{position:["bottom","top"],size:"sm",class:"h-[30vh]"},{position:["bottom","top"],size:"md",class:"h-[50vh]"},{position:["bottom","top"],size:"lg",class:"h-[70vh]"},{position:["bottom","top"],size:"full",class:"h-[95vh]"},{position:["left","right"],size:"sm",class:"w-[280px]"},{position:["left","right"],size:"md",class:"w-[380px]"},{position:["left","right"],size:"lg",class:"w-[480px]"},{position:["left","right"],size:"full",class:"w-[90vw]"}],defaultVariants:{position:"bottom",size:"default"}}),c0t=mt("absolute bg-muted-foreground/20 transition-all duration-200",{variants:{position:{bottom:"top-2 left-1/2 -translate-x-1/2 w-12 h-1 rounded-full",top:"bottom-2 left-1/2 -translate-x-1/2 w-12 h-1 rounded-full",left:"right-2 top-1/2 -translate-y-1/2 w-1 h-12 rounded-full",right:"left-2 top-1/2 -translate-y-1/2 w-1 h-12 rounded-full"}},defaultVariants:{position:"bottom"}}),u0t=e=>{(0,vs.useEffect)(()=>{if(!e)return;let t=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[e])},d0t=(e,t,r,n,o)=>{let a=Math.abs(e)/o*100;if(Math.abs(t)>500){if((n==="up"||n==="left")&&t<0){let i=r.filter(s=>s>a);return i.length>0?i[0]:r[r.length-1]}else if((n==="down"||n==="right")&&t>0){let i=r.filter(s=>s<a);return i.length>0?i[i.length-1]:0}}return r.reduce((i,s)=>Math.abs(s-a)<Math.abs(i-a)?s:i)},yNe=vs.default.forwardRef(({isOpen:e,onOpenChange:t,children:r,position:n="bottom",size:o="default",snapPoints:a=o==="default"?[25,50,75,100]:[],defaultSnapPoint:i,enableSwipeToClose:s=!0,closeThreshold:l=20,closeVelocity:c=500,dragElastic:u=.2,showHandle:d=!0,handleClassName:f,showCloseButton:p=!1,closeButtonClassName:m,showBackdrop:h=!0,backdropClassName:g,backdropBlur:v=!0,closeOnBackdropClick:y=!0,animationDuration:x=.5,springConfig:C={stiffness:300,damping:30,mass:1},preventBodyScroll:b=!0,autoHeight:w=!1,nestedScrolling:S=!0,onSnapPointChange:P,className:N,asChild:O=!1,isProComponent:L=!0,...A},U)=>{let V=n==="bottom"||n==="top",R=f3(),I=f3(),k=Ca(0),T=Ca(0),D=V?T:k,[F,_]=(0,vs.useState)(i||(a.length>0?a[0]:50)),[M,j]=(0,vs.useState)(!1),H=(0,vs.useRef)(null),[q,W]=(0,vs.useState)(null);u0t(e&&b);let z=(0,vs.useMemo)(()=>typeof window>"u"?1e3:V?window.innerHeight:window.innerWidth,[V]),G=(0,vs.useCallback)(Oe=>0,[n,z]),X=e?.5:0,Q=(0,vs.useCallback)((Oe,ve)=>{j(!1);let Re=V?ve.offset.y:ve.offset.x,be=V?ve.velocity.y:ve.velocity.x;if(s&&(n==="bottom"&&Re>l&&be>-c||n==="top"&&Re<-l&&be<c||n==="right"&&Re>l&&be>-c||n==="left"&&Re<-l&&be<c)){t(!1);return}if(a.length>0){let Y=n==="bottom"?"down":n==="top"?"up":n==="left"?"left":"right",Z=d0t(Math.abs(D.get()),be,a,Y,z);_(Z),P?.(Z),Ko(D,G(Z),{type:"spring",...C})}else Ko(D,G(F),{type:"spring",...C})},[V,n,s,l,c,a,D,z,G,F,C,t,P]),oe=(0,vs.useCallback)((Oe,ve)=>{j(!0)},[]);(0,vs.useEffect)(()=>{if(!w||!H.current||!e)return;let Oe=new ResizeObserver(ve=>{for(let Re of ve)W(Re.contentRect.height)});return Oe.observe(H.current),()=>{Oe.disconnect()}},[w,e]),(0,vs.useEffect)(()=>{e?Ko(D,0,{type:"spring",...C}):Ko(D,0,{type:"spring",...C})},[e,D,C]),(0,vs.useEffect)(()=>{if(!e)return;let Oe=ve=>{ve.key==="Escape"&&s&&t(!1)};return document.addEventListener("keydown",Oe),()=>document.removeEventListener("keydown",Oe)},[e,s,t]);let ae=()=>({x:0,y:0}),Le=()=>{switch(n){case"bottom":return{top:-200,bottom:100};case"top":return{top:-100,bottom:200};case"right":return{left:-200,right:100};case"left":return{left:-100,right:200};default:return{}}};return e?(0,Gi.jsxs)(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:x},className:"fixed inset-0 z-50",style:{pointerEvents:M?"none":"auto"},children:[h&&(0,Gi.jsx)(ie.div,{className:B("absolute inset-0 bg-black/50",v&&"backdrop-blur-sm",g),style:{opacity:X},onClick:y?()=>t(!1):void 0}),(0,Gi.jsxs)(ie.div,{ref:U,drag:s?V?"y":"x":!1,dragConstraints:Le(),dragElastic:u,onDragStart:oe,onDragEnd:Q,initial:ae(),style:{...M?{[V?"y":"x"]:D}:{},...w&&q&&V?{height:`${Math.min(q+60,z*.95)}px`}:{}},className:B(CZ({position:n,size:o}),"will-change-transform",N),...A,children:[d&&(0,Gi.jsx)("div",{className:B(c0t({position:n}),"cursor-grab active:cursor-grabbing",M&&"bg-muted-foreground/40 scale-x-150",f)}),p&&(0,Gi.jsx)("button",{onClick:()=>t(!1),className:B("absolute z-50 p-2 rounded-full bg-background/80 backdrop-blur-sm border shadow-sm","hover:bg-background transition-colors",n==="bottom"&&"top-3 right-3",n==="top"&&"bottom-3 right-3",n==="left"&&"top-3 right-3",n==="right"&&"top-3 left-3",m),"aria-label":"Close drawer",children:(0,Gi.jsx)(Zt,{className:"h-4 w-4"})}),(0,Gi.jsx)("div",{ref:H,className:B("h-full overflow-auto overscroll-contain",S&&"touch-pan-y",d&&n==="bottom"&&"pt-2",d&&n==="top"&&"pb-2"),style:{touchAction:S?"pan-y":"none"},children:r})]})]}):null});yNe.displayName="MoonUIGestureDrawerProComponent";var U5=vs.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Ht();return!n&&!r?(0,Gi.jsx)(Be,{className:"w-fit mx-auto",children:(0,Gi.jsx)(Ve,{className:"py-6 text-center",children:(0,Gi.jsxs)("div",{className:"space-y-4",children:[(0,Gi.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Gi.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Gi.jsxs)("div",{children:[(0,Gi.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Gi.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Gesture Drawer is available exclusively to MoonUI Pro subscribers."}),(0,Gi.jsx)("a",{href:"/pricing",children:(0,Gi.jsxs)(ne,{size:"sm",children:[(0,Gi.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Gi.jsx)(yNe,{...e,ref:t})});U5.displayName="MoonUIGestureDrawerPro";var xNe=U5;var _o=E(de(),1);var ir=E(me(),1),f0t=mt("fixed inset-0 z-50 flex items-center justify-center",{variants:{backdrop:{dark:"bg-black/95",blur:"bg-black/90 backdrop-blur-md",light:"bg-white/90",gradient:"bg-gradient-to-b from-black/95 to-black/80"}},defaultVariants:{backdrop:"blur"}}),bNe=_o.createContext(void 0);function wNe(){let e=_o.useContext(bNe);if(!e)throw new Error("useLightbox must be used within a LightboxProvider");return e}function XI({children:e,items:t=[],defaultIndex:r=0}){let[n,o]=_o.useState(r),[a,i]=_o.useState(!1),[s,l]=_o.useState(1),c=_o.useMemo(()=>({items:t,currentIndex:n,setCurrentIndex:o,isOpen:a,setIsOpen:i,zoom:s,setZoom:l}),[t,n,a,s]);return(0,ir.jsx)(bNe.Provider,{value:c,children:e})}var SC=_o.forwardRef(({index:e=0,asChild:t,children:r,onClick:n,...o},a)=>{let{setCurrentIndex:i,setIsOpen:s,setZoom:l}=wNe(),c=g=>{i(e),s(!0),l(1),n?.(g)};if(t){let g=r,{onDrag:v,onDragStart:y,onDragEnd:x,onDragOver:C,onDrop:b,...w}=o;return _o.cloneElement(g,{...g.props,...w,onClick:c})}let{onDrag:u,onDragStart:d,onDragEnd:f,onDragOver:p,onDrop:m,...h}=o;return(0,ir.jsx)("div",{ref:a,onClick:c,className:"cursor-pointer",...h,children:r})});SC.displayName="LightboxTrigger";var PC=_o.forwardRef(({className:e,backdrop:t,showNavigation:r=!0,showZoomControls:n=!0,showDownload:o=!0,showFullscreen:a=!0,showThumbnails:i=!1,enableKeyboardNavigation:s=!0,enableSwipeGestures:l=!0,animationDuration:c=300,autoPlayVideo:u=!1,onClose:d,...f},p)=>{let{onDrag:m,onDragStart:h,onDragEnd:g,onDragOver:v,onDrop:y,onAnimationStart:x,onAnimationEnd:C,onAnimationIteration:b,...w}=f,{items:S,currentIndex:P,setCurrentIndex:N,isOpen:O,setIsOpen:L,zoom:A,setZoom:U}=wNe(),[V,R]=_o.useState(!0),[I,k]=_o.useState(!1),[T,D]=_o.useState(!0),[F,_]=_o.useState(!1),[M,j]=_o.useState({x:0,y:0}),[H,q]=_o.useState(!1),W=_o.useRef(null),z=_o.useRef(null),G=S[P];_o.useEffect(()=>{G?.type==="video"&&u?(k(!0),D(!0)):k(!1)},[P,G,u]),_o.useEffect(()=>{if(!s||!O)return;let De=Y=>{switch(Y.key){case"ArrowLeft":Q();break;case"ArrowRight":oe();break;case"Escape":X();break;case"+":case"=":ae();break;case"-":Le();break;case" ":G?.type==="video"&&(Y.preventDefault(),k(!I));break}};return window.addEventListener("keydown",De),()=>window.removeEventListener("keydown",De)},[O,P,I,s]),_o.useEffect(()=>{z.current&&G?.type==="video"&&(I?z.current.play().catch(De=>{console.error("Video play error:",De),k(!1)}):z.current.pause())},[I,G]);let X=()=>{L(!1),U(1),j({x:0,y:0}),d?.()},Q=()=>{N(P>0?P-1:S.length-1),U(1),j({x:0,y:0}),R(!0)},oe=()=>{N(P<S.length-1?P+1:0),U(1),j({x:0,y:0}),R(!0)},ae=()=>{U(Math.min(A+.5,3))},Le=()=>{U(Math.max(A-.5,.5)),A-.5<=1&&j({x:0,y:0})},Ie=()=>{if(G){let De=document.createElement("a");De.href=G.src,De.download=G.alt||"download",De.click()}},Oe=()=>{F?document.exitFullscreen():W.current?.requestFullscreen(),_(!F)},ve=De=>{A>1&&q(!0)},Re=De=>{H&&A>1&&j({x:M.x+De.movementX,y:M.y+De.movementY})},be=()=>{q(!1)};return G?(0,ir.jsx)(nb,{open:O,onOpenChange:L,children:(0,ir.jsx)(Dt,{children:O&&(0,ir.jsx)(ob,{forceMount:!0,children:(0,ir.jsx)(Th,{asChild:!0,children:(0,ir.jsx)(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:c/1e3},className:B(f0t({backdrop:t}),e),ref:p,onClick:De=>{De.target===De.currentTarget&&X()},...w,children:(0,ir.jsxs)("div",{ref:W,className:"relative w-full h-full flex items-center justify-center pointer-events-none",onMouseMove:Re,onMouseUp:be,onMouseLeave:be,children:[(0,ir.jsx)("div",{className:"absolute inset-0 pointer-events-auto",onClick:X}),(0,ir.jsx)("button",{onClick:X,className:"absolute top-4 right-4 z-50 p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors pointer-events-auto",children:(0,ir.jsx)(Zt,{className:"h-5 w-5"})}),r&&S.length>1&&(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)("button",{onClick:Q,className:"absolute left-4 z-50 p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors pointer-events-auto",children:(0,ir.jsx)(oa,{className:"h-5 w-5"})}),(0,ir.jsx)("button",{onClick:oe,className:"absolute right-4 z-50 p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors pointer-events-auto",children:(0,ir.jsx)(Bn,{className:"h-5 w-5"})})]}),(0,ir.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 pointer-events-auto",children:[n&&G.type==="image"&&(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)("button",{onClick:Le,className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:(0,ir.jsx)(Dd,{className:"h-4 w-4"})}),(0,ir.jsxs)("span",{className:"px-3 py-1 rounded-full bg-black/50 text-white text-sm",children:[Math.round(A*100),"%"]}),(0,ir.jsx)("button",{onClick:ae,className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:(0,ir.jsx)(Ed,{className:"h-4 w-4"})})]}),G.type==="video"&&(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)("button",{onClick:()=>{k(!I),!I&&z.current&&z.current.play().catch(De=>{console.error("Play failed:",De)})},className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:I?(0,ir.jsx)(Nx,{className:"h-4 w-4"}):(0,ir.jsx)(rm,{className:"h-4 w-4"})}),(0,ir.jsx)("button",{onClick:()=>{D(!T),z.current&&(z.current.muted=!T)},className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:T?(0,ir.jsx)(qA,{className:"h-4 w-4"}):(0,ir.jsx)(jA,{className:"h-4 w-4"})})]}),o&&(0,ir.jsx)("button",{onClick:Ie,className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:(0,ir.jsx)(un,{className:"h-4 w-4"})}),a&&(0,ir.jsx)("button",{onClick:Oe,className:"p-2 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",children:(0,ir.jsx)(Rl,{className:"h-4 w-4"})})]}),(0,ir.jsxs)(ie.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},transition:{duration:c/1e3},className:"relative flex items-center justify-center pointer-events-auto",style:{transform:`scale(${A}) translate(${M.x/A}px, ${M.y/A}px)`,cursor:A>1?H?"grabbing":"grab":"auto"},onMouseDown:ve,children:[V&&(0,ir.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,ir.jsx)(Sr,{className:"h-8 w-8 animate-spin text-white"})}),G.type==="image"?(0,ir.jsx)("img",{src:G.src,alt:G.alt,className:"max-w-[90vw] max-h-[90vh] w-auto h-auto object-contain select-none",onLoad:()=>R(!1),draggable:!1}):(0,ir.jsx)("video",{ref:z,src:G.src,poster:G.poster,muted:T,controls:!0,autoPlay:u&&I,playsInline:!0,className:"max-w-[90vw] max-h-[90vh] w-auto h-auto",onLoadedData:()=>{R(!1),u&&I&&z.current&&z.current.play().catch(De=>{console.error("Autoplay failed:",De)})},onError:De=>{console.error("Video error:",De),R(!1)}})]}),(G.title||G.description)&&(0,ir.jsxs)(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"absolute top-4 left-4 max-w-md pointer-events-auto",children:[G.title&&(0,ir.jsx)("h3",{className:"text-white text-xl font-semibold mb-1",children:G.title}),G.description&&(0,ir.jsx)("p",{className:"text-white/80 text-sm",children:G.description})]}),i&&S.length>1&&(0,ir.jsx)(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"absolute bottom-20 left-0 right-0 flex justify-center z-50 pointer-events-auto",children:(0,ir.jsx)("div",{className:"flex gap-2 p-2 bg-black/70 backdrop-blur-sm rounded-lg max-w-[80vw] overflow-x-auto",children:S.map((De,Y)=>(0,ir.jsx)("button",{onClick:()=>{N(Y),U(1),j({x:0,y:0})},className:B("w-16 h-16 rounded overflow-hidden transition-all",Y===P?"ring-2 ring-white scale-110":"opacity-60 hover:opacity-100"),children:De.type==="image"?(0,ir.jsx)("img",{src:De.thumbnail||De.src,alt:De.alt,className:"w-full h-full object-cover"}):(0,ir.jsx)("div",{className:"w-full h-full bg-black/50 flex items-center justify-center",children:(0,ir.jsx)(rm,{className:"h-4 w-4 text-white"})})},Y))})})]})})})})})}):null});PC.displayName="LightboxContent";function p0t({src:e,type:t="image",alt:r,poster:n,title:o,description:a,children:i,...s}){return(0,ir.jsxs)(XI,{items:[{type:t,src:e,alt:r,poster:n,title:o,description:a}],children:[(0,ir.jsx)(SC,{children:i}),(0,ir.jsx)(PC,{...s})]})}var ys=E(de(),1);var Ft=E(me(),1),CNe=mt("w-full",{variants:{layout:{grid:"grid gap-4",masonry:"",horizontal:"flex overflow-x-auto gap-4 pb-4 snap-x snap-mandatory scrollbar-thin scrollbar-track-transparent scrollbar-thumb-border",justified:"flex flex-wrap gap-2"},columns:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",5:"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",6:"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6"}},defaultVariants:{layout:"grid",columns:3}}),H5=mt("relative overflow-hidden cursor-pointer group",{variants:{variant:{default:"rounded-lg",card:"rounded-lg shadow-sm border border-border bg-card",ghost:"rounded-lg hover:bg-accent/50",outline:"rounded-lg border-2 border-transparent hover:border-primary",glass:"rounded-lg backdrop-blur-md bg-white/10 border border-white/20"},aspectRatio:{square:"aspect-square",video:"aspect-video",portrait:"aspect-[3/4]",auto:""},hover:{none:"",zoom:"transition-transform duration-300 hover:scale-105",lift:"transition-all duration-300 hover:-translate-y-1 hover:shadow-lg",glow:"transition-all duration-300 hover:shadow-lg hover:shadow-primary/20"}},defaultVariants:{variant:"default",aspectRatio:"square",hover:"zoom"}}),SNe=ys.forwardRef(({className:e,items:t,layout:r,columns:n,variant:o,aspectRatio:a,hover:i,enableLightbox:s=!0,enableFiltering:l=!1,enableSorting:c=!1,categories:u=[],sortOptions:d=[],defaultCategory:f="all",defaultSort:p="default",showItemType:m=!0,showOverlay:h=!0,overlayContent:g,loadingState:v=!1,skeletonCount:y=6,emptyState:x,onItemClick:C,lazyLoad:b=!0,infiniteScroll:w=!1,onLoadMore:S,hasMore:P=!1,lightboxProps:N,...O},L)=>{let[A,U]=ys.useState(f),[V,R]=ys.useState(p),[I,k]=ys.useState(!1),[T,D]=ys.useState(new Set),F=ys.useRef(null),_=ys.useRef(null),M=ys.useMemo(()=>!l||A==="all"?t:t.filter(Q=>"category"in Q&&typeof Q.category=="string"?Q.category===A:A==="image"?Q.type==="image":A==="video"?Q.type==="video":!0),[t,A,l]),j=ys.useMemo(()=>{if(!c||V==="default")return M;let Q=d.find(oe=>oe.id===V);return Q?[...M].sort(Q.compareFn):M},[M,V,c,d]),H=[{id:"all",label:"All"},{id:"image",label:"Images",icon:(0,Ft.jsx)(rl,{className:"h-4 w-4"})},{id:"video",label:"Videos",icon:(0,Ft.jsx)(nm,{className:"h-4 w-4"})}],q=u.length>0?u:H;ys.useEffect(()=>{if(b)return F.current=new IntersectionObserver(Q=>{Q.forEach(oe=>{if(oe.isIntersecting){let ae=parseInt(oe.target.getAttribute("data-index")||"0");D(Le=>new Set(Le).add(ae))}})},{rootMargin:"50px"}),()=>{F.current?.disconnect()}},[b]),ys.useEffect(()=>{if(!w||!S||!P)return;let Q=new IntersectionObserver(oe=>{oe[0].isIntersecting&&S()},{rootMargin:"100px"});return _.current&&Q.observe(_.current),()=>Q.disconnect()},[w,S,P]);let W=(Q,oe)=>{C&&C(Q,oe)},z=(Q,oe)=>{let ae=!b||T.has(oe)||Q.thumbnail&&Q.thumbnail.endsWith(".svg"),Le=(0,Ft.jsxs)(ie.div,{className:B(H5({variant:o,aspectRatio:r==="masonry"||r==="justified"?"auto":a,hover:i}),r==="masonry"&&"break-inside-avoid mb-4 inline-block w-full",r==="justified"&&"flex-grow",r==="horizontal"&&"flex-shrink-0 w-80"),style:r==="justified"?{flexBasis:"200px",maxWidth:"400px"}:void 0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.3,delay:oe*.05},"data-index":oe,ref:Ie=>{Ie&&F.current&&!T.has(oe)&&F.current.observe(Ie)},onClick:()=>W(Q,oe),children:[Q.type==="image"?(0,Ft.jsxs)("div",{className:B("relative w-full",r==="masonry"||r==="justified"?"":"h-full"),children:[(0,Ft.jsx)("img",{src:Q.thumbnail||Q.src,alt:Q.alt||`Gallery item ${oe+1}`,className:B("w-full object-cover",r==="masonry"?"h-auto":"h-full",ae?"opacity-100":"opacity-0","transition-opacity duration-300"),loading:b?"lazy":void 0,onLoad:()=>D(Ie=>new Set(Ie).add(oe))}),!ae&&(0,Ft.jsx)("div",{className:B("absolute inset-0 w-full bg-muted animate-pulse",r==="masonry"?"h-64":"h-full",r==="masonry"&&"aspect-[3/4]")})]}):(0,Ft.jsxs)("div",{className:B("relative w-full bg-black",r==="masonry"?"":"h-full"),children:[ae&&(Q.thumbnail||Q.poster)&&(0,Ft.jsx)("img",{src:Q.thumbnail||Q.poster,alt:Q.alt||`Video thumbnail ${oe+1}`,className:B("w-full object-cover",r==="masonry"?"h-auto":"h-full"),loading:b?"lazy":void 0}),(0,Ft.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,Ft.jsx)("div",{className:"w-12 h-12 bg-black/70 rounded-full flex items-center justify-center",children:(0,Ft.jsx)(nm,{className:"h-6 w-6 text-white"})})})]}),h&&(0,Ft.jsxs)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:[g?g(Q,oe):(0,Ft.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-4 text-white",children:[Q.title&&(0,Ft.jsx)("h3",{className:"text-sm font-semibold mb-1",children:Q.title}),Q.description&&(0,Ft.jsx)("p",{className:"text-xs opacity-90 line-clamp-2",children:Q.description})]}),m&&(0,Ft.jsx)("div",{className:"absolute top-2 right-2",children:(0,Ft.jsx)("div",{className:"w-8 h-8 bg-white/20 backdrop-blur-sm rounded-full flex items-center justify-center",children:Q.type==="image"?(0,Ft.jsx)(rl,{className:"h-4 w-4 text-white"}):(0,Ft.jsx)(nm,{className:"h-4 w-4 text-white"})})})]})]},oe);return s?(0,Ft.jsx)(SC,{index:oe,children:Le},oe):Le},G=()=>(0,Ft.jsx)("div",{className:B(H5({variant:o,aspectRatio:a})),children:(0,Ft.jsx)("div",{className:"w-full h-full bg-muted animate-pulse"})}),X=(0,Ft.jsxs)(Ft.Fragment,{children:[(l||c)&&(0,Ft.jsxs)("div",{className:"mb-6",children:[(0,Ft.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Ft.jsxs)("div",{className:"flex items-center gap-4",children:[l&&(0,Ft.jsxs)("button",{onClick:()=>k(!I),className:B("flex items-center gap-2 px-4 py-2 rounded-lg border transition-colors",I?"bg-primary text-primary-foreground border-primary":"bg-background border-border hover:bg-accent"),children:[(0,Ft.jsx)(Ii,{className:"h-4 w-4"}),"Filters"]}),c&&d.length>0&&(0,Ft.jsxs)("select",{value:V,onChange:Q=>R(Q.target.value),className:"px-4 py-2 rounded-lg border bg-background",children:[(0,Ft.jsx)("option",{value:"default",children:"Default order"}),d.map(Q=>(0,Ft.jsx)("option",{value:Q.id,children:Q.label},Q.id))]})]}),(0,Ft.jsxs)("div",{className:"text-sm text-muted-foreground",children:[j.length," items"]})]}),(0,Ft.jsx)(Dt,{children:I&&l&&(0,Ft.jsx)(ie.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:(0,Ft.jsx)("div",{className:"flex flex-wrap gap-2 pb-4",children:q.map(Q=>(0,Ft.jsxs)("button",{onClick:()=>U(Q.id),className:B("flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-colors",A===Q.id?"bg-primary text-primary-foreground":"bg-muted hover:bg-accent"),children:[Q.icon,Q.label]},Q.id))})})})]}),(0,Ft.jsx)("div",{ref:L,className:B(r==="masonry"?"columns-1 sm:columns-2 md:columns-3 lg:columns-4 gap-4":CNe({layout:r,columns:n}),e),style:r==="masonry"?{columnGap:"1rem"}:void 0,children:v?(0,Ft.jsx)(Ft.Fragment,{children:Array.from({length:y}).map((Q,oe)=>(0,Ft.jsx)(ys.Fragment,{children:G()},oe))}):j.length>0?j.map((Q,oe)=>z(Q,oe)):x||(0,Ft.jsxs)("div",{className:"col-span-full flex flex-col items-center justify-center py-12 text-center",children:[(0,Ft.jsx)(rl,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,Ft.jsx)("p",{className:"text-muted-foreground",children:"No media items found"})]})}),w&&P&&(0,Ft.jsx)("div",{ref:_,className:"flex justify-center py-8",children:(0,Ft.jsx)(Sr,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]});return s?(0,Ft.jsxs)(XI,{items:j,children:[X,(0,Ft.jsx)(PC,{showThumbnails:!0,showNavigation:!0,backdrop:"blur",...N})]}):X});SNe.displayName="MoonUIMediaGalleryPro";var PNe=ys.forwardRef(({className:e,item:t,index:r=0,variant:n,aspectRatio:o,hover:a,showType:i=!0,showOverlay:s=!0,overlayContent:l,onLoad:c,...u},d)=>{let[f,p]=ys.useState(!1),m=()=>{p(!0),c?.()};return(0,Ft.jsxs)("div",{ref:d,className:B(H5({variant:n,aspectRatio:o,hover:a}),e),...u,children:[t.type==="image"?(0,Ft.jsx)("img",{src:t.src,alt:t.alt||`Gallery item ${r+1}`,className:B("w-full h-full object-cover transition-opacity duration-300",f?"opacity-100":"opacity-0"),onLoad:m}):(0,Ft.jsxs)("div",{className:"relative w-full h-full bg-black",children:[t.poster&&(0,Ft.jsx)("img",{src:t.poster,alt:t.alt||`Video thumbnail ${r+1}`,className:"w-full h-full object-cover",onLoad:m}),(0,Ft.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,Ft.jsx)("div",{className:"w-12 h-12 bg-black/70 rounded-full flex items-center justify-center",children:(0,Ft.jsx)(nm,{className:"h-6 w-6 text-white"})})})]}),!f&&(0,Ft.jsx)("div",{className:"absolute inset-0 bg-muted animate-pulse"}),s&&f&&(0,Ft.jsxs)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:[l||(0,Ft.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-4 text-white",children:[t.title&&(0,Ft.jsx)("h3",{className:"text-sm font-semibold mb-1",children:t.title}),t.description&&(0,Ft.jsx)("p",{className:"text-xs opacity-90 line-clamp-2",children:t.description})]}),i&&(0,Ft.jsx)("div",{className:"absolute top-2 right-2",children:(0,Ft.jsx)("div",{className:"w-8 h-8 bg-white/20 backdrop-blur-sm rounded-full flex items-center justify-center",children:t.type==="image"?(0,Ft.jsx)(rl,{className:"h-4 w-4 text-white"}):(0,Ft.jsx)(nm,{className:"h-4 w-4 text-white"})})})]})]})});PNe.displayName="MoonUIGalleryItemPro";var Yh=E(de(),1);var hi=E(me(),1);function YI({items:e,onReorder:t,keyExtractor:r,renderItem:n,className:o,itemClassName:a,dragHandleClassName:i,showDragHandle:s=!1,dragHandleSize:l=16,disabled:c=!1,onDragStart:u,onDragEnd:d,gap:f=8,animationDuration:p=200,showDropIndicator:m=!0,dropIndicatorColor:h="primary",dropIndicatorStyle:g="glow",dragPreviewStyle:v="clone",hapticFeedback:y=!0}){let[x,C]=(0,Yh.useState)(null),[b,w]=(0,Yh.useState)(null),[S,P]=(0,Yh.useState)(!1),[N,O]=(0,Yh.useState)({x:0,y:0}),[L,A]=(0,Yh.useState)(!1),U=(0,Yh.useRef)(null),V=(0,Yh.useRef)(0),R=(0,Yh.useRef)(new Map),I=(j,H)=>{if(c)return;let q=e[H];U.current=q,C(H),P(!0);let W=j.currentTarget.getBoundingClientRect();if(O({x:j.clientX-W.left,y:j.clientY-W.top}),j.dataTransfer.effectAllowed="move",j.dataTransfer.setData("text/html",""),j.currentTarget instanceof HTMLElement){let z=j.currentTarget.cloneNode(!0);z.style.position="absolute",z.style.top="-1000px",z.style.width=`${W.width}px`,v==="ghost"?(z.style.opacity="0.5",z.style.filter="grayscale(100%)"):v==="clone"?(z.style.opacity="0.9",z.style.transform="scale(1.02) rotate(1deg)",z.style.boxShadow="0 10px 30px rgba(0,0,0,0.3)"):v==="compact"&&(z.style.transform="scale(0.95)",z.style.opacity="0.85"),z.style.pointerEvents="none",document.body.appendChild(z),j.dataTransfer.setDragImage(z,N.x,N.y),setTimeout(()=>document.body.removeChild(z),0)}y&&"vibrate"in navigator&&navigator.vibrate(10),u?.(q,H)},k=j=>{j.preventDefault(),V.current++},T=j=>{V.current--,V.current===0&&w(null)},D=(j,H)=>{if(j.preventDefault(),j.dataTransfer.dropEffect="move",c||x===null)return;if(H===x){w(null),A(!1);return}let q=j.currentTarget.getBoundingClientRect(),W=j.clientY-q.top,z=q.height,G=W<z/2?"before":"after";w({index:H,position:G}),A(!0),y&&"vibrate"in navigator&&navigator.vibrate(5)},F=j=>{if(j.preventDefault(),c||x===null||!b||U.current===null){_();return}let H=[...e],q=H[x],W=b.index;b.position==="after"&&(W=W+1),H.splice(x,1),x<W&&(W=W-1),H.splice(W,0,q),t(H),_()},_=()=>{U.current&&x!==null&&d?.(U.current,x),setTimeout(()=>{C(null),w(null),P(!1),A(!1),U.current=null,V.current=0},50),y&&"vibrate"in navigator&&navigator.vibrate([10,50,10])},M=j=>{if(!m||!S)return null;let H=j==="before"?"-top-1":"-bottom-1";return g==="line"?(0,hi.jsx)(ie.div,{initial:{opacity:0,scaleX:0},animate:{opacity:1,scaleX:1},exit:{opacity:0,scaleX:0},className:B("absolute left-0 right-0 h-1 z-50 pointer-events-none",H),children:(0,hi.jsxs)("div",{className:"h-full bg-primary rounded-full relative",children:[(0,hi.jsx)(ie.div,{animate:{x:[0,10,0]},transition:{repeat:1/0,duration:1},className:"absolute -left-2 top-1/2 -translate-y-1/2 w-4 h-4 bg-primary rounded-full"}),(0,hi.jsx)(ie.div,{animate:{x:[0,-10,0]},transition:{repeat:1/0,duration:1},className:"absolute -right-2 top-1/2 -translate-y-1/2 w-4 h-4 bg-primary rounded-full"})]})}):g==="area"?(0,hi.jsx)(ie.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:24},exit:{opacity:0,height:0},className:B("absolute left-0 right-0 z-40 pointer-events-none",j==="before"?"-top-3":"-bottom-3"),children:(0,hi.jsx)("div",{className:"h-full bg-primary/10 rounded-lg border-2 border-dashed border-primary/50"})}):g==="glow"?(0,hi.jsx)(ie.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},className:B("absolute left-0 right-0 h-2 z-50 pointer-events-none",H),children:(0,hi.jsxs)("div",{className:"h-full relative",children:[(0,hi.jsx)("div",{className:"absolute inset-0 bg-primary/30 blur-xl animate-pulse"}),(0,hi.jsx)("div",{className:"absolute inset-0 bg-primary rounded-full animate-pulse"}),(0,hi.jsx)(ie.div,{animate:{opacity:[.5,1,.5],scale:[.95,1.05,.95]},transition:{repeat:1/0,duration:2},className:"absolute inset-0 bg-gradient-to-r from-primary via-primary/50 to-primary rounded-full"})]})}):null};return(0,hi.jsxs)("div",{className:B("relative",S&&"select-none",o),onDragEnter:k,onDragLeave:T,onDrop:F,onDragOver:j=>j.preventDefault(),children:[(0,hi.jsx)(Dt,{children:e.map((j,H)=>{let q=r(j),W=x===H,z=b?.index===H&&b?.position==="before",G=b?.index===H&&b?.position==="after";return(0,hi.jsxs)(ie.div,{ref:X=>{X&&R.current.set(q,X)},layout:!0,layoutId:q,initial:{opacity:0,y:20},animate:{opacity:W?.3:1,y:0,scale:W?.95:1,rotate:W?2:0},exit:{opacity:0,scale:.95},transition:{type:"spring",stiffness:500,damping:30,duration:p/1e3},className:"relative",style:{marginBottom:f},children:[z&&M("before"),(0,hi.jsx)("div",{draggable:!c,onDragStart:X=>I(X,H),onDragOver:X=>D(X,H),onDragEnd:_,className:B("relative bg-card rounded-lg border transition-all",W&&"cursor-grabbing shadow-2xl",!W&&S&&"hover:shadow-lg hover:border-primary/30",!W&&!S&&!c&&"hover:shadow-md hover:border-border/80",!c&&"cursor-grab active:cursor-grabbing",z&&"translate-y-3",G&&"-translate-y-3",a),children:(0,hi.jsxs)("div",{className:"flex items-center gap-3 p-2",children:[s&&(0,hi.jsx)(ie.div,{className:"pl-2",whileHover:{scale:1.1},whileTap:{scale:.95},children:(0,hi.jsx)(oA,{className:B("flex-shrink-0 text-muted-foreground/50",!c&&"hover:text-muted-foreground","transition-colors",i),size:l})}),(0,hi.jsx)("div",{className:"flex-1",children:n(j,H)})]})}),G&&M("after")]},q)})}),S&&(0,hi.jsx)(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 pointer-events-none z-[100]",children:(0,hi.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-primary/5 to-transparent"})})]})}var Im=E(de(),1);var uo=E(me(),1),SZ=mt("relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 overflow-hidden min-w-fit",{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",gradient:"bg-gradient-to-r from-purple-600 to-pink-600 text-white hover:from-purple-700 hover:to-pink-700",glow:"bg-primary text-primary-foreground shadow-lg hover:shadow-xl hover:shadow-primary/25"},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-11 rounded-md px-6 text-base font-medium",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),INe=Im.default.forwardRef(({className:e,variant:t,size:r,animation:n="none",state:o="idle",onStateChange:a,children:i,onClick:s,loadingText:l="Loading...",successText:c="Success!",errorText:u="Error!",ripple:d=!1,iconRotate:f=!1,shimmerSpeed:p="normal",glowIntensity:m="medium",showProgressBar:h=!1,autoResetDelay:g=2e3,onDrag:v,onDragEnd:y,onDragStart:x,onAnimationStart:C,onAnimationEnd:b,...w},S)=>{let[P,N]=(0,Im.useState)("idle"),[O,L]=(0,Im.useState)([]),[A,U]=(0,Im.useState)(0),[V,R]=(0,Im.useState)(!1),I=o!=="idle"?o:P,k=async H=>{if(I!=="loading"){if(d){let q=H.currentTarget.getBoundingClientRect(),W=H.clientX-q.left,z=H.clientY-q.top,G=Date.now();L([...O,{x:W,y:z,id:G}]),setTimeout(()=>{L(X=>X.filter(Q=>Q.id!==G))},600)}if(N("loading"),a?.("loading"),U(0),h){let q=setInterval(()=>{U(W=>W>=90?(clearInterval(q),90):W+10)},200)}if(s)try{await s(H),U(100),N("success"),a?.("success"),setTimeout(()=>{N("idle"),a?.("idle"),U(0)},g)}catch{U(0),N("error"),a?.("error"),setTimeout(()=>{N("idle"),a?.("idle")},g)}}},T=()=>{let H=B("h-4 w-4",{"animate-spin":I==="loading"||f&&I!=="idle"});switch(I){case"loading":return(0,uo.jsx)(Sr,{className:H});case"success":return(0,uo.jsx)(Wr,{className:B(H,"animate-scale-in")});case"error":return(0,uo.jsx)(Zt,{className:B(H,"animate-shake")});default:return null}},D=()=>{switch(I){case"success":return"bg-green-600";case"error":return"bg-red-600";default:return""}},F=()=>{switch(p){case"slow":return"duration-1500";case"fast":return"duration-500";default:return"duration-1000"}},_=()=>{switch(m){case"low":return"shadow-lg";case"high":return"shadow-2xl";default:return"shadow-xl"}},M,j;return n==="bounce"?M={y:[0,-10,0],transition:{duration:.6,repeat:1/0,repeatType:"loop"}}:n==="pulse"?M={scale:[1,1.1,1],transition:{duration:1,repeat:1/0,repeatType:"loop"}}:n==="shake"?M=void 0:n==="rotate"?M={rotate:10,transition:{type:"spring",stiffness:300}}:n==="scale"?(M={scale:1.05},j={scale:.95}):n==="slide"&&(M={y:-4}),(0,uo.jsxs)(ie.button,{...w,className:B(SZ({variant:t,size:r}),t==="glow"&&_(),n==="shake"&&V&&"animate-shake",e),ref:S,onClick:k,disabled:I==="loading"||w.disabled,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),whileHover:M,whileTap:j,children:[h&&I==="loading"&&(0,uo.jsx)(ie.div,{className:"absolute bottom-0 left-0 h-1 bg-primary-foreground/20 rounded-full",initial:{width:0},animate:{width:`${A}%`},transition:{duration:.3}}),n==="shimmer"&&(0,uo.jsx)(ie.div,{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent",initial:{x:"-100%"},animate:{x:"100%"},transition:{duration:p==="slow"?1.5:p==="fast"?.5:1,repeat:1/0,repeatDelay:1}}),(0,uo.jsx)("div",{className:"relative flex items-center justify-center gap-2 z-10",children:r==="icon"?I==="idle"?i:T():(0,uo.jsx)(uo.Fragment,{children:I==="idle"?(0,uo.jsxs)(uo.Fragment,{children:[Im.default.isValidElement(i)&&Im.default.cloneElement(i),typeof i=="string"&&i,Im.default.isValidElement(i)||typeof i=="string"?null:i]}):(0,uo.jsxs)(uo.Fragment,{children:[T(),(0,uo.jsxs)("span",{className:"ml-2",children:[I==="loading"&&l,I==="success"&&c,I==="error"&&u]})]})})}),(0,uo.jsx)(ie.div,{className:B("absolute inset-0 rounded-md",D()),initial:{scale:0,opacity:0},animate:{scale:I==="success"||I==="error"?1:0,opacity:I==="success"||I==="error"?.2:0},transition:{duration:.3},style:{zIndex:0}}),O.map(H=>(0,uo.jsx)("span",{className:"absolute bg-primary/20 rounded-full animate-ripple pointer-events-none",style:{left:H.x-10,top:H.y-10,width:20,height:20}},H.id))]})});INe.displayName="MoonUIAnimatedButtonProInternal";var PZ=Im.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Ht();return!n&&!r?(0,uo.jsx)(Be,{className:B("w-fit",e.className),children:(0,uo.jsx)(Ve,{className:"py-6 text-center",children:(0,uo.jsxs)("div",{className:"space-y-4",children:[(0,uo.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,uo.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,uo.jsxs)("div",{children:[(0,uo.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,uo.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Animated Button is available exclusively to MoonUI Pro subscribers."}),(0,uo.jsx)("a",{href:"/pricing",children:(0,uo.jsxs)(ne,{size:"sm",children:[(0,uo.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,uo.jsx)(INe,{...e,ref:t})});PZ.displayName="MoonUIAnimatedButtonPro";var QI=E(de(),1);var da=E(me(),1),IZ=class extends QI.Component{constructor(r){super(r);this.resetTimeoutId=null;this.previousResetKeys=[];this.resetErrorBoundary=()=>{let{onReset:r}=this.props;r?.(),this.setState({hasError:!1,error:void 0,errorInfo:void 0})};this.state={hasError:!1},this.previousResetKeys=r.resetKeys||[]}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){let{onError:o,isolate:a}=this.props;this.setState({errorInfo:n}),o?.(r,n),console.error(a?"[Isolated ErrorBoundary] caught an error:":"ErrorBoundary caught an error:",r,n)}componentDidUpdate(r){let{resetKeys:n,resetOnPropsChange:o}=this.props,{hasError:a}=this.state;if(a&&n&&n.some((s,l)=>s!==this.previousResetKeys[l])&&(this.previousResetKeys=n,this.resetErrorBoundary()),a&&o&&r!==this.props){let i={...this.props,children:null},s={...r,children:null};JSON.stringify(i)!==JSON.stringify(s)&&this.resetErrorBoundary()}}renderFallback(){let{fallback:r,className:n,showErrorDetails:o}=this.props,{error:a,errorInfo:i}=this.state;return a?r?typeof r=="function"?(0,da.jsx)(r,{error:a,resetErrorBoundary:this.resetErrorBoundary,errorInfo:i}):r:(0,da.jsx)("div",{className:B("flex items-center justify-center min-h-[200px] p-4",n),children:(0,da.jsxs)(Be,{className:"w-full max-w-md",children:[(0,da.jsxs)(yr,{className:"text-center",children:[(0,da.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/20",children:(0,da.jsx)(Ri,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),(0,da.jsx)(Or,{children:"Something went wrong"}),(0,da.jsx)($i,{children:"An error occurred while rendering this component"})]}),(0,da.jsxs)(Ve,{className:"text-center",children:[o&&!1,(0,da.jsxs)(ne,{onClick:this.resetErrorBoundary,className:"mt-4",children:[(0,da.jsx)(yo,{className:"mr-2 h-4 w-4"}),"Try again"]})]})]})}):null}render(){let{hasError:r}=this.state,{children:n,isolate:o}=this.props;if(r){if(o)try{return this.renderFallback()}catch(a){return console.error("Error boundary fallback failed:",a),(0,da.jsx)("div",{className:"p-4 text-center text-red-600",children:"Critical error: Unable to recover"})}return this.renderFallback()}return n}componentWillUnmount(){this.resetTimeoutId&&clearTimeout(this.resetTimeoutId)}};function m0t(e){let{hasProAccess:t,isLoading:r}=Ht(),n=(0,QI.useRef)(e.resetKeys);return(0,QI.useEffect)(()=>{n.current=e.resetKeys},[e.resetKeys]),!r&&!t?(0,da.jsx)(Be,{className:B("w-fit",e.className),children:(0,da.jsx)(Ve,{className:"py-6 text-center",children:(0,da.jsxs)("div",{className:"space-y-4",children:[(0,da.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,da.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,da.jsxs)("div",{children:[(0,da.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,da.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Error Boundary is available exclusively to MoonUI Pro subscribers."}),(0,da.jsx)("a",{href:"/pricing",children:(0,da.jsxs)(ne,{size:"sm",children:[(0,da.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,da.jsx)(IZ,{...e})}var h0t=m0t;var CE=E(de(),1);var Ia=E(me(),1),RNe=CE.default.forwardRef(({actions:e=[],position:t="bottom-right",size:r="default",className:n,children:o,onClick:a,...i},s)=>{let[l,c]=(0,CE.useState)(!1),u={sm:"h-10 w-10",default:"h-12 w-12",lg:"h-14 w-14"},d={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},f={"bottom-right":{x:-60,y:0},"bottom-left":{x:60,y:0},"top-right":{x:-60,y:0},"top-left":{x:60,y:0}},p=m=>{e.length>0?c(!l):a&&a(m)};return(0,Ia.jsxs)("div",{className:B("fixed z-50",d[t]),children:[(0,Ia.jsx)(Dt,{children:l&&e.length>0&&(0,Ia.jsx)("div",{className:"absolute",children:e.map((m,h)=>(0,Ia.jsxs)(ie.div,{initial:{scale:0,opacity:0,x:0,y:0},animate:{scale:1,opacity:1,x:f[t].x,y:f[t].y*(h+1)-10},exit:{scale:0,opacity:0,x:0,y:0},transition:{delay:h*.05,type:"spring",stiffness:200,damping:15},className:"absolute flex items-center gap-2",style:{transform:`translate(${t.includes("right"),"0"}, ${t.includes("bottom"),"0"})`},children:[(0,Ia.jsx)(ie.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{delay:(h+1)*.05},className:B("px-2 py-1 bg-background/90 backdrop-blur-sm text-sm font-medium rounded-md shadow-sm border whitespace-nowrap",t.includes("right")?"mr-2":"ml-2"),children:m.label}),(0,Ia.jsx)("button",{onClick:()=>{m.onClick(),c(!1)},className:B("inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",u[r]),children:m.icon})]},h))})}),(0,Ia.jsx)(ie.button,{ref:s,className:B("inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",u[r],n),onClick:p,whileHover:{scale:1.1},whileTap:{scale:.9},animate:{rotate:l?45:0},transition:{duration:.2},children:o||(e.length>0?(0,Ia.jsx)(si,{className:"h-5 w-5"}):(0,Ia.jsx)(si,{className:"h-5 w-5"}))}),(0,Ia.jsx)(Dt,{children:l&&(0,Ia.jsx)(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[-1]",onClick:()=>c(!1)})})]})});RNe.displayName="FloatingActionButtonInternal";var kNe=CE.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ht();return!o&&!n?(0,Ia.jsx)(Be,{className:B("w-fit",e),children:(0,Ia.jsx)(Ve,{className:"py-6 text-center",children:(0,Ia.jsxs)("div",{className:"space-y-4",children:[(0,Ia.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Ia.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Ia.jsxs)("div",{children:[(0,Ia.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Ia.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Floating Action Button is available exclusively to MoonUI Pro subscribers."}),(0,Ia.jsx)("a",{href:"/pricing",children:(0,Ia.jsxs)(ne,{size:"sm",children:[(0,Ia.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Ia.jsx)(RNe,{className:e,ref:r,...t})});kNe.displayName="FloatingActionButton";var cl=E(de(),1);var xs=E(me(),1),NNe=mt("relative rounded-lg border bg-card text-card-foreground shadow-sm transition-all duration-200 isolate",{variants:{variant:{subtle:"hover:bg-card/95",dramatic:"hover:bg-gradient-to-br hover:from-card hover:to-card/80",gaming:"hover:border-primary/50 hover:shadow-lg hover:shadow-primary/25",elegant:"hover:border-border/50 hover:bg-gradient-to-br hover:from-card hover:via-card/95 hover:to-card/90",neon:"hover:border-primary hover:shadow-[0_0_30px_rgba(var(--primary),0.3)]"},shadowIntensity:{none:"",light:"hover:shadow-md",medium:"hover:shadow-lg",heavy:"hover:shadow-xl",extreme:"hover:shadow-2xl"},glowEffect:{none:"",subtle:"",vibrant:"",neon:""}},defaultVariants:{variant:"subtle",shadowIntensity:"medium",glowEffect:"none"}}),MNe=cl.default.forwardRef(({children:e,className:t,variant:r,shadowIntensity:n,glowEffect:o,perspective:a=1e3,maxRotation:i=15,rotationIntensity:s,scale:l=1.05,springConfig:c={stiffness:200,damping:15,mass:1,velocity:0},animationSpeed:u=1,overlay:d,overlayAlwaysVisible:f=!1,glowColor:p="rgb(var(--primary))",glowBlur:m=20,glowSpread:h=1.2,enableTouch:g=!0,enableKeyboard:v=!0,onHoverStart:y,onHoverEnd:x,onRotationChange:C,animationDelay:b=0,ariaLabel:w,autoFocus:S=!1,rotateAxes:P={x:!0,y:!0},...N},O)=>{let{onDrag:L,onDragStart:A,onDragEnd:U,onDragOver:V,onDrop:R,onAnimationStart:I,onAnimationEnd:k,onAnimationIteration:T,...D}=N,F=(0,cl.useRef)(null),[_,M]=(0,cl.useState)(!1),[j,H]=(0,cl.useState)(!1),q=i||s||15,W=Ca(0),z=Ca(0),G=Nh(W,{...c,stiffness:c.stiffness*u,damping:c.damping/u}),X=Nh(z,{...c,stiffness:c.stiffness*u,damping:c.damping/u}),Q=tc(X,[-1,1],P.x?[q,-q]:[0,0]),oe=tc(G,[-1,1],P.y?[-q,q]:[0,0]),ae=(0,cl.useCallback)(be=>{if(!F.current)return;let De=F.current.getBoundingClientRect(),Y=De.left+De.width/2,Z=De.top+De.height/2,te,Ce;if("touches"in be&&g)te=be.touches[0].clientX,Ce=be.touches[0].clientY;else if("clientX"in be)te=be.clientX,Ce=be.clientY;else return;let ke=(Ce-Z)/(De.height/2),ge=(te-Y)/(De.width/2);W.set(ge),z.set(ke),C&&C(Q.get(),oe.get())},[g,W,z,Q,oe,C]),Le=(0,cl.useCallback)(()=>{M(!0),y?.()},[y]),Ie=(0,cl.useCallback)(()=>{M(!1),W.set(0),z.set(0),x?.()},[W,z,x]),Oe=(0,cl.useCallback)(be=>{if(!v||!j)return;let De=.1,Y=W.get(),Z=z.get();switch(be.key){case"ArrowUp":Z=Math.max(-.5,Z-De),z.set(Z),be.preventDefault();break;case"ArrowDown":Z=Math.min(.5,Z+De),z.set(Z),be.preventDefault();break;case"ArrowLeft":Y=Math.max(-.5,Y-De),W.set(Y),be.preventDefault();break;case"ArrowRight":Y=Math.min(.5,Y+De),W.set(Y),be.preventDefault();break;case"Enter":case" ":M(!_),_?x?.():y?.(),be.preventDefault();break;case"Escape":W.set(0),z.set(0),M(!1),x?.(),be.preventDefault();break}C&&C(Q.get(),oe.get())},[v,j,W,z,_,y,x,Q,oe,C]);(0,cl.useEffect)(()=>{S&&F.current&&F.current.focus()},[S]);let ve=(0,cl.useMemo)(()=>d?typeof d=="function"?d({isHovered:_,rotateX:Q.get(),rotateY:oe.get()}):d:null,[d,_,Q,oe]),Re=(0,cl.useMemo)(()=>{if(o==="none")return{};let be=0,De=m,Y=h;switch(o){case"subtle":be=_?.3:0;break;case"vibrant":be=_?.6:0,De=m*1.5;break;case"neon":be=_?.8:0,De=m*2,Y=h*1.3;break}return{opacity:be,filter:`blur(${De}px)`,scale:Y,backgroundColor:p}},[o,_,m,h,p]);return(0,xs.jsx)("div",{style:{perspective:`${a}px`},children:(0,xs.jsxs)(ie.div,{ref:be=>{F.current=be,typeof O=="function"?O(be):O&&(O.current=be)},className:B(NNe({variant:r,shadowIntensity:n,glowEffect:o}),"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),onMouseMove:ae,onMouseEnter:Le,onMouseLeave:Ie,onTouchMove:g?ae:void 0,onTouchStart:g?Le:void 0,onTouchEnd:g?Ie:void 0,onKeyDown:Oe,onFocus:()=>H(!0),onBlur:()=>H(!1),style:{transformStyle:"preserve-3d",transformOrigin:"center center",rotateX:_||j?Q:0,rotateY:_||j?oe:0,scale:_||j?l:1},transition:{type:"spring",stiffness:c.stiffness,damping:c.damping,duration:.15*(1/u),delay:b/1e3},tabIndex:v?0:void 0,role:v?"button":void 0,"aria-label":w,...D,children:[(0,xs.jsx)(ie.div,{className:"relative z-10",animate:{z:_||j?20:0},transition:{duration:.2*(1/u)},children:e}),ve&&(0,xs.jsx)(ie.div,{className:"absolute inset-0 rounded-lg pointer-events-none z-20",animate:{opacity:f||_||j?1:0},transition:{duration:.3*(1/u)},children:ve}),r!=="subtle"&&(0,xs.jsx)(ie.div,{className:B("absolute inset-0 rounded-lg pointer-events-none",r==="dramatic"&&"bg-gradient-to-br from-white/10 via-transparent to-black/10",r==="gaming"&&"bg-gradient-to-br from-primary/10 via-transparent to-primary/5",r==="elegant"&&"bg-gradient-to-br from-white/5 via-transparent to-black/5",r==="neon"&&"bg-gradient-to-br from-primary/20 via-transparent to-primary/10"),animate:{opacity:_||j?1:0},transition:{duration:.3*(1/u)}}),o!=="none"&&(0,xs.jsx)(ie.div,{className:"absolute inset-0 rounded-lg pointer-events-none -z-10",animate:Re,transition:{duration:.3*(1/u)}})]})})});MNe.displayName="HoverCard3DInternal";var TNe=cl.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Ht();return!n&&!r?(0,xs.jsx)(Be,{className:B("w-fit",e.className),children:(0,xs.jsx)(Ve,{className:"py-6 text-center",children:(0,xs.jsxs)("div",{className:"space-y-4",children:[(0,xs.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,xs.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,xs.jsxs)("div",{children:[(0,xs.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,xs.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"3D Hover Card is available exclusively to MoonUI Pro subscribers."}),(0,xs.jsx)("a",{href:"/pricing",children:(0,xs.jsxs)(ne,{size:"sm",children:[(0,xs.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,xs.jsx)(MNe,{...e,ref:t})});TNe.displayName="HoverCard3D";var IC=E(de(),1);var Tl=E(me(),1),g0t=mt("relative inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{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",gradient:"bg-gradient-to-r from-purple-600 to-pink-600 text-white shadow-lg hover:from-purple-700 hover:to-pink-700"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"}},defaultVariants:{variant:"default",size:"default",radius:"md"}}),ANe=IC.default.forwardRef(({children:e,className:t,variant:r,size:n,radius:o,strength:a=.3,range:i=100,springConfig:s={stiffness:200,damping:15},...l},c)=>{let u=(0,IC.useRef)(null),[d,f]=(0,IC.useState)(!1),p=Ca(0),m=Ca(0),h=Nh(p,s),g=Nh(m,s),v=tc(g,[-i,i],[5,-5]),y=tc(h,[-i,i],[-5,5]),x=w=>{if(!u.current)return;let S=u.current.getBoundingClientRect(),P=S.left+S.width/2,N=S.top+S.height/2,O=w.clientX-P,L=w.clientY-N;Math.sqrt(O*O+L*L)<i&&(p.set(O*a),m.set(L*a))},C=()=>{f(!1),p.set(0),m.set(0)},b=()=>{f(!0)};return(0,Tl.jsxs)(ie.button,{ref:w=>{u.current=w,typeof c=="function"?c(w):c&&(c.current=w)},className:B(g0t({variant:r,size:n,radius:o}),t),onMouseMove:x,onMouseLeave:C,onMouseEnter:b,style:{x:h,y:g,rotateX:v,rotateY:y,transformPerspective:1e3},whileHover:{scale:1.05},whileTap:{scale:.95},animate:{rotateX:d?v.get():0,rotateY:d?y.get():0},transition:{duration:.3},children:[(0,Tl.jsx)(ie.div,{className:"relative z-10 flex items-center justify-center",animate:{scale:d?1.02:1},transition:{duration:.2},children:e}),(0,Tl.jsx)(ie.div,{className:B("absolute inset-0 bg-primary/20 blur-md",o==="none"&&"rounded-none",o==="sm"&&"rounded-sm",o==="md"&&"rounded-md",o==="lg"&&"rounded-lg",o==="xl"&&"rounded-xl",o==="full"&&"rounded-full",!o&&"rounded-md"),animate:{opacity:d?.8:0,scale:d?1.1:1},transition:{duration:.3}})]})});ANe.displayName="MagneticButtonInternal";var LNe=IC.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ht();return!o&&!n?(0,Tl.jsx)(Be,{className:B("w-fit",e),children:(0,Tl.jsx)(Ve,{className:"py-6 text-center",children:(0,Tl.jsxs)("div",{className:"space-y-4",children:[(0,Tl.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Tl.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Tl.jsxs)("div",{children:[(0,Tl.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Tl.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Magnetic Button is available exclusively to MoonUI Pro subscribers."}),(0,Tl.jsx)("a",{href:"/pricing",children:(0,Tl.jsxs)(ne,{size:"sm",children:[(0,Tl.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Tl.jsx)(ANe,{className:e,ref:r,...t})});LNe.displayName="MagneticButton";var Qo=E(de(),1);var Gn=E(me(),1),ENe=Qo.default.forwardRef(({children:e,minZoom:t=.5,maxZoom:r=3,initialZoom:n=1,className:o,contentClassName:a,onZoomChange:i,showControls:s=!0,showIndicator:l=!0,doubleTapBehavior:c="zoom",wheelScaling:u=!0,dragEnabled:d=!0,zoomStep:f=.5,smoothZoom:p=!0,boundaryConstraints:m=!0,...h},g)=>{let v=(0,Qo.useRef)(null),y=(0,Qo.useRef)(null),[x,C]=(0,Qo.useState)(!1),[b,w]=(0,Qo.useState)(!1),[S,P]=(0,Qo.useState)(0),[N,O]=(0,Qo.useState)(!1),[L,A]=(0,Qo.useState)(!1),U=Ca(n),V=Ca(0),R=Ca(0),I=tc(U,z=>Math.min(Math.max(z,t),r)),k=tc(U,z=>Math.round(z*100)),T=(0,Qo.useCallback)(()=>{if(!v.current||!y.current||!m)return{left:0,right:0,top:0,bottom:0};let z=v.current.getBoundingClientRect(),G=U.get(),X=z.width*G,Q=z.height*G,oe=Math.max(0,(X-z.width)/2),ae=Math.max(0,(Q-z.height)/2);return{left:-oe,right:oe,top:-ae,bottom:ae}},[U,m]);(0,Qo.useEffect)(()=>{if(!v.current||!u)return;let z=v.current,G=X=>{N&&u&&(X.ctrlKey||X.metaKey)&&X.preventDefault()};return z.addEventListener("wheel",G,{passive:!1}),()=>{z.removeEventListener("wheel",G)}},[N,u]);let D=(0,Qo.useCallback)(z=>{if(!u||!z.ctrlKey&&!z.metaKey)return;z.preventDefault();let G=-z.deltaY/1e3,X=U.get(),Q=Math.min(Math.max(X+G,t),r);if(v.current){let oe=v.current.getBoundingClientRect(),ae=(z.clientX-oe.left)/oe.width-.5,Le=(z.clientY-oe.top)/oe.height-.5,Ie=Q-X,Oe=V.get(),ve=R.get(),Re=Oe-ae*oe.width*Ie,be=ve-Le*oe.height*Ie;p?(Ko(V,Re,{duration:.2}),Ko(R,be,{duration:.2})):(V.set(Re),R.set(be))}p?Ko(U,Q,{duration:.2}):U.set(Q),i?.(Q),l&&(w(!0),setTimeout(()=>w(!1),1500))},[U,V,R,t,r,i,u,p,l]),F=(0,Qo.useCallback)(z=>{z.preventDefault();let G=U.get(),X;if(c==="reset")X=n;else if(X=G>1?1:2,X>1&&v.current){let Q=v.current.getBoundingClientRect(),oe=(z.clientX-Q.left)/Q.width-.5,ae=(z.clientY-Q.top)/Q.height-.5,Le=-oe*Q.width*(X-1),Ie=-ae*Q.height*(X-1);Ko(V,Le,{duration:.3,type:"spring",stiffness:300}),Ko(R,Ie,{duration:.3,type:"spring",stiffness:300})}Ko(U,Math.min(Math.max(X,t),r),{duration:.3,type:"spring",stiffness:300}),(X===1||c==="reset")&&(Ko(V,0,{duration:.3}),Ko(R,0,{duration:.3})),i?.(X),l&&(w(!0),setTimeout(()=>w(!1),1500))},[U,V,R,t,r,n,i,c,l]),_=(0,Qo.useCallback)(z=>{let G=Date.now(),X=G-S;if(X<300&&X>0){let Q=z.changedTouches[0],oe={clientX:Q.clientX,clientY:Q.clientY,preventDefault:()=>{}};F(oe)}P(G)},[S,F]),M=(0,Qo.useCallback)(()=>{Ko(U,n,{duration:.3,type:"spring",stiffness:300}),Ko(V,0,{duration:.3,type:"spring",stiffness:300}),Ko(R,0,{duration:.3,type:"spring",stiffness:300}),i?.(n)},[U,V,R,n,i]),j=(0,Qo.useCallback)(()=>{let z=U.get(),G=Math.min(z+f,r);Ko(U,G,{duration:.3,type:"spring",stiffness:300}),i?.(G),l&&(w(!0),setTimeout(()=>w(!1),1500))},[U,r,f,i,l]),H=(0,Qo.useCallback)(()=>{let z=U.get(),G=Math.max(z-f,t);if(Ko(U,G,{duration:.3,type:"spring",stiffness:300}),G<U.get()){let X=T(),Q=V.get(),oe=R.get();(Q<X.left||Q>X.right)&&Ko(V,0,{duration:.3}),(oe<X.top||oe>X.bottom)&&Ko(R,0,{duration:.3})}i?.(G),l&&(w(!0),setTimeout(()=>w(!1),1500))},[U,t,f,V,R,T,i,l]),q=(0,Qo.useCallback)(()=>{M()},[M]),W=(0,Qo.useCallback)(()=>{v.current&&(document.fullscreenElement?document.exitFullscreen().then(()=>{A(!1)}).catch(z=>{console.error("Exit fullscreen error:",z)}):(v.current.parentElement||v.current).requestFullscreen().then(()=>{A(!0)}).catch(G=>{console.error("Fullscreen error:",G)}))},[]);return(0,Qo.useEffect)(()=>{let z=()=>{A(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",z),document.addEventListener("webkitfullscreenchange",z),document.addEventListener("mozfullscreenchange",z),document.addEventListener("MSFullscreenChange",z),()=>{document.removeEventListener("fullscreenchange",z),document.removeEventListener("webkitfullscreenchange",z),document.removeEventListener("mozfullscreenchange",z),document.removeEventListener("MSFullscreenChange",z)}},[]),(0,Qo.useEffect)(()=>{if(!N||!u)return;let z=G=>{!G.ctrlKey&&!G.metaKey||(G.key==="+"||G.key==="="?(G.preventDefault(),j()):G.key==="-"||G.key==="_"?(G.preventDefault(),H()):G.key==="0"&&(G.preventDefault(),M()))};return document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z)}},[N,u,j,H,M]),(0,Qo.useEffect)(()=>U.onChange(()=>{let G=T(),X=V.get(),Q=R.get();m&&((X<G.left||X>G.right)&&Ko(V,Math.max(G.left,Math.min(G.right,X)),{duration:.2}),(Q<G.top||Q>G.bottom)&&Ko(R,Math.max(G.top,Math.min(G.bottom,Q)),{duration:.2}))}),[U,V,R,T,m]),(0,Gn.jsxs)("div",{ref:g,className:B("relative overflow-hidden touch-none select-none",d&&"cursor-grab active:cursor-grabbing",L&&"fixed inset-0 z-50 bg-background",o),onWheel:D,onDoubleClick:F,onTouchEnd:_,onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),...h,children:[(0,Gn.jsx)("div",{ref:v,className:"w-full h-full",children:(0,Gn.jsx)(ie.div,{ref:y,drag:d,dragElastic:.1,dragMomentum:!1,dragConstraints:m?T():!1,onDragStart:()=>C(!0),onDragEnd:()=>C(!1),style:{scale:I,x:V,y:R},className:B("w-full h-full flex items-center justify-center",x&&"cursor-grabbing",a),children:e})}),(0,Gn.jsx)(Dt,{children:l&&b&&(0,Gn.jsxs)(ie.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute top-4 left-1/2 -translate-x-1/2 px-3 py-1.5 bg-black/80 dark:bg-white/80 text-white dark:text-black rounded-full text-sm font-medium pointer-events-none",children:[k.get(),"%"]})}),s&&(0,Gn.jsxs)("div",{className:"absolute bottom-4 right-4 flex gap-2",children:[(0,Gn.jsx)("button",{onClick:H,disabled:U.get()<=t,className:B("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed","shadow-sm hover:shadow-md"),"aria-label":"Zoom out",children:(0,Gn.jsx)(Dd,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:j,disabled:U.get()>=r,className:B("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed","shadow-sm hover:shadow-md"),"aria-label":"Zoom in",children:(0,Gn.jsx)(Ed,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:M,className:B("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","shadow-sm hover:shadow-md"),"aria-label":"Reset zoom",children:(0,Gn.jsx)(Iw,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:W,className:B("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","shadow-sm hover:shadow-md"),"aria-label":L?"Exit fullscreen":"Enter fullscreen",children:L?(0,Gn.jsx)(Cw,{className:"w-4 h-4"}):(0,Gn.jsx)(Rl,{className:"w-4 h-4"})})]}),s&&(0,Gn.jsx)("div",{className:"absolute bottom-4 left-4 px-3 py-1.5 bg-background/80 backdrop-blur-sm border rounded-md text-sm",children:(0,Gn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Gn.jsxs)("span",{children:[Math.round(U.get()*100),"%"]}),u&&!b&&(0,Gn.jsx)("span",{className:"text-xs text-muted-foreground",children:"(Ctrl+Scroll to zoom)"})]})})]})});ENe.displayName="PinchZoomInternal";var DNe=Qo.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ht();return!o&&!n?(0,Gn.jsx)(Be,{className:B("w-fit",e),children:(0,Gn.jsx)(Ve,{className:"py-6 text-center",children:(0,Gn.jsxs)("div",{className:"space-y-4",children:[(0,Gn.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Gn.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Gn.jsxs)("div",{children:[(0,Gn.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Gn.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Pinch Zoom is available exclusively to MoonUI Pro subscribers."}),(0,Gn.jsx)("a",{href:"/pricing",children:(0,Gn.jsxs)(ne,{size:"sm",children:[(0,Gn.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Gn.jsx)(ENe,{className:e,ref:r,...t})});DNe.displayName="PinchZoom";var kb=E(de(),1);var Ki=E(me(),1),ONe=kb.default.forwardRef(({children:e,className:t,spotlightColor:r="rgba(255, 255, 255, 0.25)",spotlightSize:n=300,intensity:o=.8,borderGlow:a=!0,...i},s)=>{let l=(0,kb.useRef)(null),[c,u]=(0,kb.useState)({x:0,y:0}),[d,f]=(0,kb.useState)(!1),p=g=>{if(!l.current)return;let v=l.current.getBoundingClientRect(),y=g.clientX-v.left,x=g.clientY-v.top;u({x:y,y:x})},m=()=>{f(!0)},h=()=>{f(!1)};return(0,Ki.jsxs)(ie.div,{ref:g=>{l.current=g,typeof s=="function"?s(g):s&&(s.current=g)},className:B("relative overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm",t),onMouseMove:p,onMouseEnter:m,onMouseLeave:h,whileHover:{scale:1.02},transition:{duration:.2},children:[(0,Ki.jsx)(ie.div,{className:"absolute inset-0 pointer-events-none",animate:{opacity:d?o:0},transition:{duration:.3},style:{background:`radial-gradient(${n}px circle at ${c.x}px ${c.y}px, ${r}, transparent 70%)`}}),(0,Ki.jsx)(ie.div,{className:"absolute inset-0 pointer-events-none",animate:{opacity:d?o*.5:0},transition:{duration:.4,delay:.1},style:{background:`radial-gradient(${n*1.5}px circle at ${c.x}px ${c.y}px, ${r.replace("0.25","0.1")}, transparent 80%)`}}),a&&(0,Ki.jsx)(ie.div,{className:"absolute inset-0 rounded-lg pointer-events-none",animate:{opacity:d?.6:0},transition:{duration:.3},style:{background:`linear-gradient(135deg, transparent 30%, ${r.replace("0.25","0.4")} 50%, transparent 70%)`,backgroundSize:"200% 200%",backgroundPosition:`${c.x/l.current?.offsetWidth*100}% ${c.y/l.current?.offsetHeight*100}%`}}),(0,Ki.jsx)("div",{className:"relative z-10",children:e}),(0,Ki.jsx)(ie.div,{className:"absolute inset-0 pointer-events-none",animate:{opacity:d?.3:0},transition:{duration:.5},children:[...Array(3)].map((g,v)=>(0,Ki.jsx)(ie.div,{className:"absolute w-1 h-1 bg-white rounded-full",animate:d?{x:[c.x,c.x+Math.random()*100-50],y:[c.y,c.y+Math.random()*100-50],opacity:[0,1,0],scale:[0,1,0]}:{},transition:{duration:2,delay:v*.2,repeat:d?1/0:0,ease:"easeOut"},style:{left:c.x,top:c.y}},v))})]})});ONe.displayName="SpotlightCardInternal";var _Ne=kb.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ht();return!o&&!n?(0,Ki.jsx)(Be,{className:B("w-fit",e),children:(0,Ki.jsx)(Ve,{className:"py-6 text-center",children:(0,Ki.jsxs)("div",{className:"space-y-4",children:[(0,Ki.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Ki.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Ki.jsxs)("div",{children:[(0,Ki.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Ki.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Spotlight Card is available exclusively to MoonUI Pro subscribers."}),(0,Ki.jsx)("a",{href:"/pricing",children:(0,Ki.jsxs)(ne,{size:"sm",children:[(0,Ki.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Ki.jsx)(ONe,{className:e,ref:r,...t})});_Ne.displayName="SpotlightCard";var Hs=E(de(),1);var ZI=E(de(),1);var tr=E(me(),1),FNe=[{value:"meeting",label:"Meeting",color:"#3b82f6"},{value:"task",label:"Task",color:"#10b981"},{value:"reminder",label:"Reminder",color:"#f59e0b"},{value:"event",label:"Event",color:"#8b5cf6"}],v0t=["#3b82f6","#10b981","#f59e0b","#8b5cf6","#ef4444","#06b6d4","#84cc16","#f97316","#ec4899","#6366f1","#14b8a6","#eab308","#f43f5e","#a855f7","#22c55e","#64748b"];function BNe({open:e,onOpenChange:t,event:r,selectedDate:n,onSave:o,onDelete:a,mode:i="create"}){let[s,l]=(0,ZI.useState)({title:"",description:"",date:"",startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""}),[c,u]=(0,ZI.useState)({}),[d,f]=(0,ZI.useState)(!1);(0,ZI.useEffect)(()=>{if(i==="edit"&&r)l({title:r.title||"",description:r.description||"",date:r.date.toISOString().split("T")[0],startTime:r.startTime||"",endTime:r.endTime||"",location:r.location||"",type:r.type||"meeting",color:r.color||"#3b82f6",attendees:r.attendees?.join(", ")||""});else if(i==="create"){let v=n?n.toISOString().split("T")[0]:new Date().toISOString().split("T")[0];l({title:"",description:"",date:v,startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""})}u({})},[r,n,i,e]);let p=()=>{let v={};return s.title.trim()||(v.title="Title is required"),s.date||(v.date="Date is required"),s.startTime&&s.endTime&&s.startTime>=s.endTime&&(v.endTime="End time must be after start time"),u(v),Object.keys(v).length===0},m=async v=>{if(v.preventDefault(),!!p()){f(!0);try{let y={...i==="edit"&&r?{id:r.id}:{},title:s.title.trim(),description:s.description.trim(),date:new Date(s.date+"T00:00:00"),startTime:s.startTime||void 0,endTime:s.endTime||void 0,location:s.location.trim()||void 0,type:s.type,color:s.color,attendees:s.attendees?s.attendees.split(",").map(x=>x.trim()).filter(Boolean):void 0};await o(y),t(!1)}catch(y){console.error("Error saving event:",y)}finally{f(!1)}}},h=()=>{r&&a&&(a(r.id),t(!1))},g=v=>{let y=FNe.find(x=>x.value===v);l(x=>({...x,type:v,color:y?.color||x.color}))};return(0,tr.jsx)(sa,{open:e,onOpenChange:t,children:(0,tr.jsxs)(Xo,{className:"sm:max-w-[500px]",children:[(0,tr.jsxs)(Pa,{children:[(0,tr.jsxs)(la,{className:"flex items-center gap-2",children:[(0,tr.jsx)(Va,{className:"w-5 h-5"}),i==="create"?"Create Event":"Edit Event"]}),(0,tr.jsx)(il,{children:i==="create"?"Add a new event to your calendar.":"Edit the event details."})]}),(0,tr.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"title",children:"Title *"}),(0,tr.jsx)(Kt,{id:"title",value:s.title,onChange:v=>l(y=>({...y,title:v.target.value})),placeholder:"Event title",className:B(c.title&&"border-red-500")}),c.title&&(0,tr.jsx)("p",{className:"text-sm text-red-500",children:c.title})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"description",children:"Description"}),(0,tr.jsx)(Yc,{id:"description",value:s.description,onChange:v=>l(y=>({...y,description:v.target.value})),placeholder:"Event description (optional)",rows:3})]}),(0,tr.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"date",children:"Date *"}),(0,tr.jsx)(Kt,{id:"date",type:"date",value:s.date,onChange:v=>l(y=>({...y,date:v.target.value})),className:B(c.date&&"border-red-500")}),c.date&&(0,tr.jsx)("p",{className:"text-sm text-red-500",children:c.date})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"startTime",children:"Start Time"}),(0,tr.jsx)(Kt,{id:"startTime",type:"time",value:s.startTime,onChange:v=>l(y=>({...y,startTime:v.target.value})),placeholder:"09:00"})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"endTime",children:"End Time"}),(0,tr.jsx)(Kt,{id:"endTime",type:"time",value:s.endTime,onChange:v=>l(y=>({...y,endTime:v.target.value})),placeholder:"10:00",className:B(c.endTime&&"border-red-500")}),c.endTime&&(0,tr.jsx)("p",{className:"text-sm text-red-500",children:c.endTime})]})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsxs)(bt,{htmlFor:"location",className:"flex items-center gap-2",children:[(0,tr.jsx)(Df,{className:"w-4 h-4"}),"Location"]}),(0,tr.jsx)(Kt,{id:"location",value:s.location,onChange:v=>l(y=>({...y,location:v.target.value})),placeholder:"Meeting room, address, or link"})]}),(0,tr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsxs)(bt,{className:"flex items-center gap-2",children:[(0,tr.jsx)(Nw,{className:"w-4 h-4"}),"Type"]}),(0,tr.jsxs)(Eo,{value:s.type,onValueChange:g,children:[(0,tr.jsx)(Do,{children:(0,tr.jsx)(Yo,{})}),(0,tr.jsx)(Oo,{children:FNe.map(v=>(0,tr.jsx)(Tt,{value:v.value,children:(0,tr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,tr.jsx)("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:v.color}}),v.label]})},v.value))})]})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsxs)(bt,{className:"flex items-center gap-2",children:[(0,tr.jsx)(Oc,{className:"w-4 h-4"}),"Color"]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,tr.jsx)("input",{type:"color",value:s.color,onChange:v=>l(y=>({...y,color:v.target.value})),className:"w-8 h-8 rounded border cursor-pointer flex-shrink-0"}),(0,tr.jsx)("span",{className:"text-sm text-muted-foreground",children:"Custom color"})]}),(0,tr.jsx)("div",{className:"grid grid-cols-8 gap-1",children:v0t.map(v=>(0,tr.jsx)("button",{type:"button",onClick:()=>l(y=>({...y,color:v})),className:B("w-full aspect-square rounded border-2 hover:scale-110 transition-transform",s.color===v?"border-foreground shadow-sm":"border-transparent"),style:{backgroundColor:v},"aria-label":`Select color ${v}`},v))})]})]})]}),(0,tr.jsxs)("div",{className:"space-y-2",children:[(0,tr.jsx)(bt,{htmlFor:"attendees",children:"Attendees"}),(0,tr.jsx)(Kt,{id:"attendees",value:s.attendees,onChange:v=>l(y=>({...y,attendees:v.target.value})),placeholder:"John Doe, Jane Smith (comma-separated)"})]}),(0,tr.jsxs)(um,{className:"gap-2",children:[i==="edit"&&a&&(0,tr.jsx)(ne,{type:"button",variant:"destructive",onClick:h,className:"mr-auto",children:"Delete Event"}),(0,tr.jsx)(ne,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:d,children:"Cancel"}),(0,tr.jsx)(ne,{type:"submit",disabled:d,children:d?i==="create"?"Creating...":"Saving...":i==="create"?"Create Event":"Save Changes"})]})]})]})})}var Se=E(me(),1),RZ=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],VNe=["January","February","March","April","May","June","July","August","September","October","November","December"],JI={meeting:"bg-blue-500",task:"bg-green-500",reminder:"bg-yellow-500",event:"bg-purple-500",birthday:"bg-pink-500",holiday:"bg-orange-500",conference:"bg-indigo-500"},y0t={low:"border-l-4 border-l-muted-foreground",medium:"border-l-4 border-l-yellow-500",high:"border-l-4 border-l-red-500"},x0t={confirmed:"",tentative:"opacity-70 border-dashed",cancelled:"opacity-50 line-through"};function b0t({events:e=[],onEventClick:t,onEventAdd:r,onEventEdit:n,onEventDelete:o,onDateChange:a,onViewChange:i,onEventDrop:s,className:l,showWeekends:c=!0,showEventDetails:u=!0,disabled:d=!1,minDate:f,maxDate:p,highlightToday:m=!0,height:h,defaultView:g="month",enableDragDrop:v=!0,enableSearch:y=!0,enableFilters:x=!0,enableExport:C=!0,enableImport:b=!1,enableRecurringEvents:w=!0,enableReminders:S=!0,eventCategories:P,workingHours:N={start:"09:00",end:"18:00"},holidays:O=[],locale:L="en-US",timeFormat:A="12h",firstDayOfWeek:U=0,theme:V="auto",customTheme:R,compactMode:I=!1,showProUpgrade:k=!1}){if(k)return(0,Se.jsx)(Be,{className:B("w-full",l),children:(0,Se.jsx)(Ve,{className:"py-12 text-center",children:(0,Se.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,Se.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Se.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Se.jsxs)("div",{children:[(0,Se.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,Se.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Calendar is available exclusively to MoonUI Pro subscribers."}),(0,Se.jsx)("div",{className:"flex gap-3 justify-center",children:(0,Se.jsx)("a",{href:"/pricing",children:(0,Se.jsxs)(ne,{size:"sm",children:[(0,Se.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[T,D]=Hs.default.useState(new Date),[F,_]=Hs.default.useState(null),[M,j]=Hs.default.useState(g),[H,q]=Hs.default.useState(!1),[W,z]=Hs.default.useState("create"),[G,X]=Hs.default.useState(null),[Q,oe]=Hs.default.useState(null),[ae,Le]=Hs.default.useState(null),[Ie,Oe]=Hs.default.useState(""),[ve,Re]=Hs.default.useState("all"),[be,De]=Hs.default.useState("all"),[Y,Z]=Hs.default.useState(!1),[te,Ce]=Hs.default.useState([]),[ke,ge]=Hs.default.useState(new Date),[ee,le]=Hs.default.useState(!1),[ue,he]=Hs.default.useState(!1),qe=new Date,_t=T.getMonth(),Zn=T.getFullYear(),We=new Date(Zn,_t,1),Ye=new Date(Zn,_t+1,0),pe=new Date(We),Ge=(pe.getDay()-U+7)%7;pe.setDate(pe.getDate()-Ge);let at=new Date(Ye),ht=(6-at.getDay()+U)%7;at.setDate(at.getDate()+ht);let fr=[],jt=new Date(pe);for(;jt<=at;)fr.push(new Date(jt)),jt.setDate(jt.getDate()+1);let Jt=Hs.default.useMemo(()=>{let _e=new Set;return e.forEach(rt=>{rt.tags?.forEach(xt=>_e.add(xt))}),Array.from(_e)},[e]),rr=Hs.default.useMemo(()=>e.filter(_e=>!(Ie&&!_e.title.toLowerCase().includes(Ie.toLowerCase())&&!_e.description?.toLowerCase().includes(Ie.toLowerCase())||ve!=="all"&&_e.type!==ve||be!=="all"&&_e.priority!==be||te.length>0&&(!_e.tags||!_e.tags.some(rt=>te.includes(rt))))),[e,Ie,ve,be,te]),Sn=_e=>rr.filter(rt=>{let xt=new Date(rt.date);return rt.recurring?On(_e,rt):xt.toDateString()===_e.toDateString()}),On=(_e,rt)=>{if(!rt.recurring)return!1;let xt=new Date(rt.date),Nr=Math.floor((_e.getTime()-xt.getTime())/(1e3*60*60*24));if(Nr<0||rt.recurring.endDate&&_e>rt.recurring.endDate)return!1;switch(rt.recurring.pattern){case"daily":return Nr%rt.recurring.interval===0;case"weekly":return Nr%(rt.recurring.interval*7)!==0?!1:rt.recurring.daysOfWeek?rt.recurring.daysOfWeek.includes(_e.getDay()):_e.getDay()===xt.getDay();case"monthly":return((_e.getFullYear()-xt.getFullYear())*12+(_e.getMonth()-xt.getMonth()))%rt.recurring.interval!==0?!1:rt.recurring.dayOfMonth?_e.getDate()===rt.recurring.dayOfMonth:_e.getDate()===xt.getDate();case"yearly":return(_e.getFullYear()-xt.getFullYear())%rt.recurring.interval!==0?!1:_e.getMonth()===xt.getMonth()&&_e.getDate()===xt.getDate();default:return!1}},ln=_e=>_e.toDateString()===qe.toDateString(),cn=_e=>_e.getMonth()===_t,wi=_e=>F&&_e.toDateString()===F.toDateString(),Ci=_e=>!!(d||f&&_e<f||p&&_e>p),ri=_e=>{let rt=new Date(T);_e==="prev"?rt.setMonth(_t-1):rt.setMonth(_t+1),D(rt),a?.(rt)},yu=_e=>{j(_e),i?.(_e)},xd=()=>{let _e=Zs(rr),rt=new Blob([_e],{type:"text/calendar"}),xt=URL.createObjectURL(rt),Nr=document.createElement("a");Nr.href=xt,Nr.download="calendar.ics",Nr.click(),URL.revokeObjectURL(xt)},Zs=_e=>{let rt=`BEGIN:VCALENDAR\r
|
|
121
121
|
VERSION:2.0\r
|
|
122
122
|
PRODID:-//MoonUI//Calendar//EN\r
|
|
123
123
|
`;return _e.forEach(xt=>{rt+=`BEGIN:VEVENT\r
|
|
@@ -401,7 +401,7 @@ You can add a description to the \`${ON}\` by passing a \`${E9e}\` component as
|
|
|
401
401
|
|
|
402
402
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ON}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
403
403
|
|
|
404
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return vf.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},B9e=k9e;var V9e=N9e,Yse=M9e,Qse=T9e,Zse=O9e,Jse=F9e,ele=L9e,tle=D9e;var Op=E(me(),1),z9e=B9e;var bQt=V9e,U9e=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsx)(Yse,{className:B("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));U9e.displayName=Yse.displayName;var rle=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsxs)(bQt,{children:[(0,Op.jsx)(U9e,{}),(0,Op.jsx)(Qse,{ref:r,className:B("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));rle.displayName=Qse.displayName;var nle=({className:e,...t})=>(0,Op.jsx)("div",{className:B("flex flex-col space-y-2 text-center sm:text-left",e),...t});nle.displayName="AlertDialogHeader";var ole=({className:e,...t})=>(0,Op.jsx)("div",{className:B("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ole.displayName="AlertDialogFooter";var ale=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsx)(ele,{ref:r,className:B("text-lg font-semibold",e),...t}));ale.displayName=ele.displayName;var ile=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsx)(tle,{ref:r,className:B("text-sm text-muted-foreground",e),...t}));ile.displayName=tle.displayName;var sle=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsx)(Zse,{ref:r,className:B(Tu(),e),...t}));sle.displayName=Zse.displayName;var lle=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsx)(Jse,{ref:r,className:B(Tu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));lle.displayName=Jse.displayName;var Nn=E(me(),1);function H9e({selectedRows:e,actions:t,onClearSelection:r,className:n}){let[o,a]=cle.default.useState(!1),[i,s]=cle.default.useState(null),l=e.length,c=async f=>{if(f.confirmMessage){s(f);return}await u(f)},u=async f=>{a(!0);try{await f.action(e),r&&r()}catch(p){console.error("Bulk action failed:",p)}finally{a(!1),s(null)}},d=async()=>{i&&await u(i)};return l===0?null:(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsxs)("div",{className:B("flex items-center gap-2",n),children:[(0,Nn.jsxs)(Nt,{variant:"secondary",className:"gap-1",children:[(0,Nn.jsx)("span",{className:"font-semibold",children:l}),(0,Nn.jsx)("span",{children:"selected"})]}),(0,Nn.jsxs)(Pr,{children:[(0,Nn.jsx)(Ir,{asChild:!0,children:(0,Nn.jsx)(ne,{variant:"outline",size:"sm",disabled:o,className:"gap-2",children:o?(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(Sr,{className:"h-4 w-4 animate-spin"}),"Processing..."]}):(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(za,{className:"h-4 w-4"}),"Bulk Actions"]})})}),(0,Nn.jsxs)(xr,{align:"end",className:"w-48",children:[t.map((f,p)=>{let m=typeof f.disabled=="function"?f.disabled(e):f.disabled;return(0,Nn.jsxs)(Fe,{disabled:m||o,onSelect:()=>c(f),className:B("cursor-pointer",f.variant==="destructive"&&"text-destructive focus:text-destructive"),children:[f.icon&&(0,Nn.jsx)("span",{className:"mr-2 h-4 w-4",children:f.icon}),f.label]},p)}),r&&(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(zr,{}),(0,Nn.jsx)(Fe,{onSelect:r,className:"cursor-pointer text-muted-foreground",children:"Clear selection"})]})]})]})]}),(0,Nn.jsx)(z9e,{open:!!i,onOpenChange:f=>!f&&s(null),children:(0,Nn.jsxs)(rle,{children:[(0,Nn.jsxs)(nle,{children:[(0,Nn.jsxs)(ale,{className:"flex items-center gap-2",children:[i?.variant==="destructive"&&(0,Nn.jsx)(Ri,{className:"h-5 w-5 text-destructive"}),i?.confirmTitle||"Confirm Action"]}),(0,Nn.jsx)(ile,{children:i?.confirmMessage||`This action will affect ${l} selected item${l>1?"s":""}. This action cannot be undone.`})]}),(0,Nn.jsxs)(ole,{children:[(0,Nn.jsx)(lle,{disabled:o,children:"Cancel"}),(0,Nn.jsx)(sle,{onClick:d,disabled:o,className:B(i?.variant==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90"),children:o?(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(Sr,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing..."]}):"Confirm"})]})]})})]})}function wQt(e,t,r=!0){if(e.length===0)return"";let n=t||Object.keys(e[0]),o=[];if(r){let a=n.map(i=>{let s=String(i);return s.includes(",")||s.includes('"')||s.includes(`
|
|
404
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return vf.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},B9e=k9e;var V9e=N9e,Yse=M9e,Qse=T9e,Zse=O9e,Jse=F9e,ele=L9e,tle=D9e;var Op=E(me(),1),z9e=B9e;var bQt=V9e,U9e=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsx)(Yse,{className:B("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));U9e.displayName=Yse.displayName;var rle=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsxs)(bQt,{children:[(0,Op.jsx)(U9e,{}),(0,Op.jsx)(Qse,{ref:r,className:B("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));rle.displayName=Qse.displayName;var nle=({className:e,...t})=>(0,Op.jsx)("div",{className:B("flex flex-col space-y-2 text-center sm:text-left",e),...t});nle.displayName="AlertDialogHeader";var ole=({className:e,...t})=>(0,Op.jsx)("div",{className:B("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-6",e),...t});ole.displayName="AlertDialogFooter";var ale=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsx)(ele,{ref:r,className:B("text-lg font-semibold",e),...t}));ale.displayName=ele.displayName;var ile=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsx)(tle,{ref:r,className:B("text-sm text-muted-foreground",e),...t}));ile.displayName=tle.displayName;var sle=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsx)(Zse,{ref:r,className:B(Tu(),e),...t}));sle.displayName=Zse.displayName;var lle=KS.forwardRef(({className:e,...t},r)=>(0,Op.jsx)(Jse,{ref:r,className:B(Tu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));lle.displayName=Jse.displayName;var Nn=E(me(),1);function H9e({selectedRows:e,actions:t,onClearSelection:r,className:n}){let[o,a]=cle.default.useState(!1),[i,s]=cle.default.useState(null),l=e.length,c=async f=>{if(f.confirmMessage){s(f);return}await u(f)},u=async f=>{a(!0);try{await f.action(e),r&&r()}catch(p){console.error("Bulk action failed:",p)}finally{a(!1),s(null)}},d=async()=>{i&&await u(i)};return l===0?null:(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsxs)("div",{className:B("flex items-center gap-2",n),children:[(0,Nn.jsxs)(Nt,{variant:"secondary",className:"gap-1",children:[(0,Nn.jsx)("span",{className:"font-semibold",children:l}),(0,Nn.jsx)("span",{children:"selected"})]}),(0,Nn.jsxs)(Pr,{children:[(0,Nn.jsx)(Ir,{asChild:!0,children:(0,Nn.jsx)(ne,{variant:"outline",size:"sm",disabled:o,className:"gap-2",children:o?(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(Sr,{className:"h-4 w-4 animate-spin"}),"Processing..."]}):(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(za,{className:"h-4 w-4"}),"Bulk Actions"]})})}),(0,Nn.jsxs)(xr,{align:"end",className:"w-48",children:[t.map((f,p)=>{let m=typeof f.disabled=="function"?f.disabled(e):f.disabled;return(0,Nn.jsxs)(Fe,{disabled:m||o,onSelect:()=>c(f),className:B("cursor-pointer",f.variant==="destructive"&&"text-destructive focus:text-destructive"),children:[f.icon&&(0,Nn.jsx)("span",{className:"mr-2 h-4 w-4",children:f.icon}),f.label]},p)}),r&&(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(zr,{}),(0,Nn.jsx)(Fe,{onSelect:r,className:"cursor-pointer text-muted-foreground",children:"Clear selection"})]})]})]})]}),(0,Nn.jsx)(z9e,{open:!!i,onOpenChange:f=>!f&&s(null),children:(0,Nn.jsxs)(rle,{children:[(0,Nn.jsxs)(nle,{children:[(0,Nn.jsxs)(ale,{className:"flex items-center gap-2",children:[i?.variant==="destructive"&&(0,Nn.jsx)(Ri,{className:"h-5 w-5 text-destructive"}),i?.confirmTitle||"Confirm Action"]}),(0,Nn.jsx)(ile,{children:i?.confirmMessage||`This action will affect ${l} selected item${l>1?"s":""}. This action cannot be undone.`})]}),(0,Nn.jsxs)(ole,{children:[(0,Nn.jsx)(lle,{disabled:o,children:"Cancel"}),(0,Nn.jsx)(sle,{onClick:d,disabled:o,className:B(i?.variant==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90"),children:o?(0,Nn.jsxs)(Nn.Fragment,{children:[(0,Nn.jsx)(Sr,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing..."]}):"Confirm"})]})]})})]})}function wQt(e,t,r=!0){if(e.length===0)return"";let n=t||Object.keys(e[0]),o=[];if(r){let a=n.map(i=>{let s=String(i);return s.includes(",")||s.includes('"')||s.includes(`
|
|
405
405
|
`)?`"${s.replace(/"/g,'""')}"`:s});o.push(a.join(","))}return e.forEach(a=>{let i=n.map(s=>{let l=a[s];if(l==null)return"";if(l instanceof Date)return l.toISOString();if(typeof l=="object")return JSON.stringify(l);let c=String(l);return c.includes(",")||c.includes('"')||c.includes(`
|
|
406
406
|
`)?`"${c.replace(/"/g,'""')}"`:c});o.push(i.join(","))}),o.join(`
|
|
407
407
|
`)}function CQt(e,t){if(!t||t.length===0)return JSON.stringify(e,null,2);let r=e.map(n=>{let o={};return t.forEach(a=>{a in n&&(o[a]=n[a])}),o});return JSON.stringify(r,null,2)}function SQt(e,t,r){let n=new Blob([e],{type:r}),o=URL.createObjectURL(n),a=document.createElement("a");a.href=o,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}async function j9e(e,t){let{format:r,filename:n="data-export",columns:o,includeHeaders:a=!0}=t,i,s,l;switch(r){case"csv":i=wQt(e,o,a),s="text/csv;charset=utf-8;",l="csv";break;case"json":i=CQt(e,o),s="application/json;charset=utf-8;",l="json";break;case"xlsx":throw new Error("XLSX export requires additional dependencies. Use CSV format instead.");default:throw new Error(`Unsupported export format: ${r}`)}let c=`${n}-${new Date().toISOString().split("T")[0]}.${l}`;SQt(i,c,s)}function q9e(e,t){return e.filter(r=>{let n=r.id||r.accessorKey;return n&&t[n]!==!1}).map(r=>r.id||r.accessorKey).filter(Boolean)}var XS=E(de(),1),$9e=E(fh(),1);var Lt=E(me(),1),PQt={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Not contains",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",in:"In",notIn:"Not in",isNull:"Is empty",isNotNull:"Is not empty"};function IQt(e){switch(e){case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","isNull","isNotNull"];case"date":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","isNull","isNotNull"];case"boolean":return["equals","notEquals","isNull","isNotNull"];case"select":return["equals","notEquals","in","notIn","isNull","isNotNull"];default:return["equals","notEquals","contains","notContains","startsWith","endsWith","isNull","isNotNull"]}}function W9e({table:e,open:t,onOpenChange:r,position:n="right",width:o="400px",filters:a,onFiltersChange:i,customFilters:s,matchAll:l,onMatchAllChange:c}){let[u,d]=(0,XS.useState)([]),[f,p]=(0,XS.useState)(!0),m=a||u,h=i||d,g=l!==void 0?l:f,v=c||p,y=(0,XS.useMemo)(()=>e.getAllColumns().filter(N=>N.id==="select"||N.id==="actions"||N.id==="expander"?!1:N.getCanFilter()),[e]),x=()=>{let N=y[0];if(!N)return;let O={column:N.id,operator:"contains",value:""};h([...m,O])},C=(N,O)=>{let L=[...m];L[N]={...L[N],...O},h(L)},b=N=>{h(m.filter((O,L)=>L!==N))},w=()=>{h([]),e.resetColumnFilters()},S=()=>{e.resetColumnFilters(),[...new Set(m.map(O=>O.column))].forEach(O=>{let L=e.getColumn(O);L&&L.setFilterValue({custom:!0,filters:m,matchAll:g})}),m.length===0&&e.resetColumnFilters(),r(!1)};if(typeof document>"u")return null;let P=(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(Dt,{children:t&&(0,Lt.jsx)(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/20",style:{zIndex:9998},onClick:()=>r(!1)})}),(0,Lt.jsx)(Dt,{children:t&&(0,Lt.jsx)(ie.div,{initial:{x:n==="right"?"100%":"-100%"},animate:{x:0},exit:{x:n==="right"?"100%":"-100%"},transition:{type:"spring",damping:30,stiffness:300},className:B("fixed top-0 bottom-0 bg-background border-l shadow-xl",n==="right"?"right-0":"left-0"),style:{width:o,zIndex:9999},children:(0,Lt.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Lt.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[(0,Lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Lt.jsx)(Ii,{className:"h-5 w-5"}),(0,Lt.jsx)("h2",{className:"text-lg font-semibold",children:"Filters"}),m.length>0&&(0,Lt.jsxs)("span",{className:"text-sm text-muted-foreground",children:["(",m.length," active)"]})]}),(0,Lt.jsx)(ne,{variant:"ghost",size:"icon",onClick:()=>r(!1),children:(0,Lt.jsx)(Zt,{className:"h-4 w-4"})})]}),(0,Lt.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[(0,Lt.jsxs)("div",{className:"mb-6",children:[(0,Lt.jsx)(bt,{className:"text-sm font-medium mb-2 block",children:"Match conditions"}),(0,Lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Lt.jsx)(ne,{variant:g?"primary":"outline",size:"sm",onClick:()=>v(!0),className:"flex-1",children:"Match all"}),(0,Lt.jsx)(ne,{variant:g?"outline":"primary",size:"sm",onClick:()=>v(!1),className:"flex-1",children:"Match any"})]})]}),(0,Lt.jsx)(ms,{className:"mb-6"}),s&&(0,Lt.jsxs)(Lt.Fragment,{children:[s,(0,Lt.jsx)(ms,{className:"my-6"})]}),(0,Lt.jsx)("div",{className:"space-y-4",children:m.map((N,O)=>(0,Lt.jsx)(RQt,{filter:N,columns:y,onUpdate:L=>C(O,L),onRemove:()=>b(O)},O))}),(0,Lt.jsxs)(ne,{variant:"outline",size:"sm",onClick:x,className:"w-full mt-4",children:[(0,Lt.jsx)(si,{className:"h-4 w-4 mr-2"}),"Add filter"]})]}),(0,Lt.jsx)("div",{className:"p-4 border-t space-y-2",children:(0,Lt.jsxs)("div",{className:"flex gap-2",children:[(0,Lt.jsxs)(ne,{variant:"outline",onClick:w,disabled:m.length===0,className:"flex-1",children:[(0,Lt.jsx)(ji,{className:"h-4 w-4 mr-2"}),"Clear all"]}),(0,Lt.jsx)(ne,{onClick:S,className:"flex-1",children:"Apply filters"})]})})]})})})]});return(0,$9e.createPortal)(P,document.body)}function RQt({filter:e,columns:t,onUpdate:r,onRemove:n}){let a=t.find(p=>p.id===e.column)?.columnDef,i=a?.meta?.filterType||"string",s=a?.meta?.filterOptions,l=a?.meta?.filterValueAccessor,c=IQt(i),u=e.operator!=="isNull"&&e.operator!=="isNotNull",d=e.operator==="in"||e.operator==="notIn",f=XS.default.useMemo(()=>i!=="select"&&!s?null:s||null,[i,s]);return(0,Lt.jsxs)("div",{className:"space-y-2 p-3 border rounded-lg bg-muted/30",children:[(0,Lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Lt.jsxs)(Eo,{value:e.column,onValueChange:p=>r({column:p}),children:[(0,Lt.jsx)(Do,{className:"flex-1",children:(0,Lt.jsx)(Yo,{})}),(0,Lt.jsx)(Oo,{style:{zIndex:1e4},children:t.map(p=>{let m=p.columnDef.header,h=typeof m=="function"?p.id:m||p.id;return(0,Lt.jsx)(Tt,{value:p.id,children:h},p.id)})})]}),(0,Lt.jsx)(ne,{variant:"ghost",size:"icon",onClick:n,className:"h-8 w-8",children:(0,Lt.jsx)(Zt,{className:"h-4 w-4"})})]}),(0,Lt.jsxs)(Eo,{value:e.operator,onValueChange:p=>r({operator:p}),children:[(0,Lt.jsx)(Do,{children:(0,Lt.jsx)(Yo,{})}),(0,Lt.jsx)(Oo,{style:{zIndex:1e4},children:c.map(p=>(0,Lt.jsx)(Tt,{value:p,children:PQt[p]},p))})]}),u&&(0,Lt.jsx)("div",{children:i==="boolean"?(0,Lt.jsxs)(Eo,{value:String(e.value),onValueChange:p=>r({value:p==="true"}),children:[(0,Lt.jsx)(Do,{children:(0,Lt.jsx)(Yo,{})}),(0,Lt.jsxs)(Oo,{style:{zIndex:1e4},children:[(0,Lt.jsx)(Tt,{value:"true",children:"True"}),(0,Lt.jsx)(Tt,{value:"false",children:"False"})]})]}):(i==="select"||f)&&!d?(0,Lt.jsxs)(Eo,{value:e.value||"",onValueChange:p=>r({value:p}),children:[(0,Lt.jsx)(Do,{children:(0,Lt.jsx)(Yo,{placeholder:"Select value..."})}),(0,Lt.jsx)(Oo,{style:{zIndex:1e4},children:f?.map(p=>(0,Lt.jsx)(Tt,{value:p,children:p},p))})]}):(i==="select"||f)&&d?(0,Lt.jsxs)("div",{className:"space-y-2",children:[(0,Lt.jsx)("div",{className:"text-xs text-muted-foreground",children:"Select multiple values:"}),(0,Lt.jsx)("div",{className:"space-y-1 max-h-32 overflow-y-auto border rounded-md p-2",children:f?.map(p=>{let m=Array.isArray(e.value)?e.value:[],h=m.includes(p);return(0,Lt.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer hover:bg-muted/50 p-1 rounded",children:[(0,Lt.jsx)("input",{type:"checkbox",checked:h,onChange:g=>{let v=g.target.checked?[...m,p]:m.filter(y=>y!==p);r({value:v})},className:"rounded border-gray-300"}),(0,Lt.jsx)("span",{className:"text-sm",children:p})]},p)})})]}):i==="number"?(0,Lt.jsx)(Kt,{type:"number",value:e.value||"",onChange:p=>r({value:p.target.value}),placeholder:"Enter value..."}):d?(0,Lt.jsx)(Kt,{value:Array.isArray(e.value)?e.value.join(", "):e.value||"",onChange:p=>r({value:p.target.value}),placeholder:"Enter values separated by comma..."}):(0,Lt.jsx)(Kt,{value:e.value||"",onChange:p=>r({value:p.target.value}),placeholder:"Enter value..."})})]})}var K6=E(de(),1);var Qa=E(me(),1);function G9e({table:e,filter:t,data:r}){let n=e.getColumn(t.column);if(!n)return null;let o=n.columnDef,a=o?.meta?.filterValueAccessor,i=o?.meta?.filterOptions,s=h=>a?a(h):h[t.column],l=(0,K6.useMemo)(()=>{if(t.options&&t.options!=="auto")return t.options;if(i)return i;let h=new Set;return r.forEach(g=>{let v=s(g);v!=null&&v!==""&&h.add(String(v))}),Array.from(h).sort().slice(0,50)},[r,t.options,i]),c=(0,K6.useMemo)(()=>{if(!t.showCounts)return{};let h={};return l.forEach(g=>{h[g]=0}),r.forEach(g=>{let v=s(g);v!=null&&h[String(v)]!==void 0&&h[String(v)]++}),h},[r,t.showCounts,l]),u=n.getFilterValue(),d=(0,K6.useMemo)(()=>u?Array.isArray(u)?new Set(u):new Set([String(u)]):new Set,[u]),f=t.label||n.id,p=h=>{if(t.multi){let g=new Set(d);g.has(h)?g.delete(h):g.add(h),g.size===0?n.setFilterValue(void 0):n.setFilterValue(Array.from(g))}else d.has(h)?n.setFilterValue(void 0):n.setFilterValue(h)},m=()=>{n.setFilterValue(void 0)};return(0,Qa.jsxs)(Ti,{children:[(0,Qa.jsx)(Ai,{asChild:!0,children:(0,Qa.jsxs)(ne,{variant:"outline",size:"sm",className:B("h-8 border-dashed",d.size>0&&"border-solid"),children:[f,d.size>0&&(0,Qa.jsxs)(Qa.Fragment,{children:[(0,Qa.jsx)("span",{className:"mx-2 h-4 w-px bg-border"}),(0,Qa.jsx)(Nt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:d.size})]})]})}),(0,Qa.jsx)(pi,{className:"w-[250px] p-0",align:"start",children:(0,Qa.jsxs)(Fh,{children:[(0,Qa.jsx)(Qf,{placeholder:`Search ${f.toLowerCase()}...`}),(0,Qa.jsxs)(hb,{children:[(0,Qa.jsx)(Zf,{children:"No results found."}),(0,Qa.jsx)(Vu,{children:l.map(h=>{let g=d.has(h);return(0,Qa.jsxs)(nc,{onSelect:()=>p(h),children:[(0,Qa.jsx)("div",{className:B("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",g?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,Qa.jsx)(Wr,{className:B("h-4 w-4")})}),(0,Qa.jsx)("span",{className:"flex-1",children:h}),t.showCounts&&c[h]!==void 0&&(0,Qa.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:c[h]})]},h)})})]}),d.size>0&&(0,Qa.jsx)("div",{className:"border-t p-2",children:(0,Qa.jsxs)(ne,{variant:"ghost",size:"sm",className:"w-full justify-center",onClick:m,children:[(0,Qa.jsx)(Zt,{className:"mr-2 h-4 w-4"}),"Clear filter"]})})]})})]})}var O_=E(de(),1);var wn=E(me(),1);function K9e({table:e,column:t,title:r,options:n="auto",data:o}){let a=e.getColumn(t),[i,s]=(0,O_.useState)("");if(!a)return null;let l=a.columnDef,c=l?.meta?.filterValueAccessor,u=l?.meta?.filterOptions,d=b=>c?c(b):b[t],{availableOptions:f,optionCounts:p}=(0,O_.useMemo)(()=>{let b={},w=new Set;o.forEach(P=>{let N=d(P);if(N!=null&&N!==""){let O=String(N);w.add(O),b[O]=(b[O]||0)+1}});let S=[];return n!=="auto"?S=n:u?S=u.map(P=>({value:P,label:P})):S=Array.from(w).sort().slice(0,50).map(P=>({value:P,label:P})),{availableOptions:S,optionCounts:b}},[o,n,u]),m=a.getFilterValue(),h=new Set(m||[]),g=(0,O_.useMemo)(()=>i?f.filter(b=>(b.label||b.value).toLowerCase().includes(i.toLowerCase())):f,[f,i]),v=r||t,y=b=>{let w=new Set(h);w.has(b)?w.delete(b):w.add(b),w.size===0?a.setFilterValue(void 0):a.setFilterValue(Array.from(w))},x=()=>{a.setFilterValue(void 0),s("")},C=()=>{let b=g.map(w=>w.value);a.setFilterValue(b)};return(0,wn.jsxs)(Ti,{children:[(0,wn.jsx)(Ai,{asChild:!0,children:(0,wn.jsxs)(ne,{variant:"outline",size:"sm",className:B("h-8 border-dashed",h.size>0&&"border-solid"),children:[(0,wn.jsx)(wx,{className:"mr-2 h-4 w-4"}),v,h.size>0&&(0,wn.jsxs)(wn.Fragment,{children:[(0,wn.jsx)(ms,{orientation:"vertical",className:"mx-2 h-4"}),(0,wn.jsx)(Nt,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:h.size}),(0,wn.jsx)("div",{className:"hidden space-x-1 lg:flex",children:h.size>2?(0,wn.jsxs)(Nt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[h.size," selected"]}):Array.from(h).slice(0,2).map(b=>{let w=f.find(S=>S.value===b);return(0,wn.jsx)(Nt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:w?.label||b},b)})})]})]})}),(0,wn.jsxs)(pi,{className:"w-[300px] p-0",align:"start",children:[(0,wn.jsx)("div",{className:"p-3",children:(0,wn.jsxs)("div",{className:"relative",children:[(0,wn.jsx)(xo,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),(0,wn.jsx)(Kt,{placeholder:`Search ${v.toLowerCase()}...`,value:i,onChange:b=>s(b.target.value),className:"h-8 pl-8"})]})}),(0,wn.jsx)(ms,{}),(0,wn.jsx)("div",{className:"max-h-[300px] overflow-y-auto",children:g.length===0?(0,wn.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No results found"}):(0,wn.jsx)("div",{className:"p-2",children:g.map(b=>{let w=h.has(b.value),S=p[b.value]||0;return(0,wn.jsxs)(ne,{variant:"ghost",size:"sm",className:"w-full justify-start font-normal",onClick:()=>y(b.value),children:[(0,wn.jsx)("div",{className:B("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",w?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,wn.jsx)(Wr,{className:B("h-4 w-4")})}),b.icon&&(0,wn.jsx)("span",{className:"mr-2",children:b.icon}),(0,wn.jsx)("span",{className:"flex-1 text-left",children:b.label||b.value}),S>0&&(0,wn.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:S})]},b.value)})})}),(h.size>0||g.length>0)&&(0,wn.jsxs)(wn.Fragment,{children:[(0,wn.jsx)(ms,{}),(0,wn.jsxs)("div",{className:"flex items-center justify-between p-2",children:[h.size>0?(0,wn.jsxs)(ne,{variant:"ghost",size:"sm",onClick:x,className:"h-8 px-2 lg:px-3",children:["Clear",(0,wn.jsx)(Zt,{className:"ml-2 h-4 w-4"})]}):(0,wn.jsxs)(ne,{variant:"ghost",size:"sm",onClick:C,className:"h-8 px-2 lg:px-3",children:["Select all",(0,wn.jsx)(Wr,{className:"ml-2 h-4 w-4"})]}),(0,wn.jsxs)("span",{className:"text-xs text-muted-foreground",children:[h.size," of ",f.length," selected"]})]})]})]})]})}var Je=E(me(),1);function X9e({columns:e,data:t,searchable:r=!0,filterable:n=!0,exportable:o=!0,selectable:a=!1,pagination:i=!0,pageSize:s=10,pageSizeOptions:l=[5,10,20,50,100],className:c,onRowSelect:u,onExport:d,enableExpandable:f=!1,renderSubComponent:p,expandedRows:m,onRowExpandChange:h,bulkActions:g=[],quickFilters:v=[],facetedFilters:y=[],features:x={},theme:C={},texts:b={},enableSorting:w=!0,enableFiltering:S=!0,enablePagination:P=!0,enableColumnVisibility:N=!0,enableRowSelection:O,filterPlaceholder:L="Search all columns...",defaultPageSize:A,manualPagination:U=!1,pageCount:V,onPaginationChange:R,onSortingChange:I,onColumnFiltersChange:k,state:T}){let D=Ji.default.useMemo(()=>e.map(pe=>{let{enableHiding:Ge,...at}=pe;return{...at,enableHiding:!0,filterFn:"custom"}}),[e]),{hasProAccess:F,isLoading:_}=Ht();if(!_&&!F)return(0,Je.jsx)(Be,{className:B("w-full",c),children:(0,Je.jsx)(Ve,{className:"py-12 text-center",children:(0,Je.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,Je.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Je.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,Je.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Data Table is available exclusively to MoonUI Pro subscribers."}),(0,Je.jsx)("div",{className:"flex gap-3 justify-center",children:(0,Je.jsx)("a",{href:"/pricing",children:(0,Je.jsxs)(ne,{size:"sm",children:[(0,Je.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[M,j]=Ji.default.useState([]),[H,q]=Ji.default.useState([]),[W,z]=Ji.default.useState({}),[G,X]=Ji.default.useState({}),[Q,oe]=Ji.default.useState(""),[ae,Le]=Ji.default.useState({pageIndex:0,pageSize:A||s||10}),[Ie,Oe]=Ji.default.useState(!1),[ve,Re]=Ji.default.useState(new Set),[be,De]=Ji.default.useState(!1),Y=m||ve,Z=h?pe=>h(pe):Re,te=A||s,Ce=Ji.default.useMemo(()=>t,[t]),ke=pe=>()=>{let at=(T?.sorting??M).find(jt=>jt.id===pe),ht=[];at?at.desc?ht=[]:ht=[{id:pe,desc:!0}]:ht=[{id:pe,desc:!1}];let fr=I!==void 0?I:j;typeof fr=="function"&&fr(ht)},ge=L8e({data:Ce,columns:D,onSortingChange:I!==void 0?I:j,onColumnFiltersChange:k!==void 0?k:q,onPaginationChange:R!==void 0?R:Le,getCoreRowModel:N8e(),getPaginationRowModel:T8e(),getSortedRowModel:A8e(),getFilteredRowModel:M8e(),enableSortingRemoval:!0,enableMultiSort:!1,sortDescFirst:!1,onColumnVisibilityChange:z,onRowSelectionChange:X,onGlobalFilterChange:oe,globalFilterFn:"includesString",filterFns:{custom:(pe,Ge,at)=>{if(Array.isArray(at)){let Sn=ge.getColumn(Ge)?.columnDef?.meta?.filterValueAccessor,On=Sn?Sn(pe.original):pe.getValue(Ge);return at.includes(String(On))}if(typeof at=="string"||typeof at=="number"||typeof at=="boolean"){let Sn=ge.getColumn(Ge)?.columnDef?.meta?.filterValueAccessor,On=Sn?Sn(pe.original):pe.getValue(Ge);return String(On)===String(at)}if(!at?.custom||!at?.filters)return!0;let ht=at.filters,fr=at.matchAll!==void 0?at.matchAll:!0,jt=ht.map(Jt=>{let On=ge.getColumn(Jt.column)?.columnDef?.meta?.filterValueAccessor,ln=On?On(pe.original):pe.getValue(Jt.column),cn=Jt.value;switch(Jt.operator){case"equals":return ln===cn;case"notEquals":return ln!==cn;case"contains":return String(ln).toLowerCase().includes(String(cn).toLowerCase());case"notContains":return!String(ln).toLowerCase().includes(String(cn).toLowerCase());case"startsWith":return String(ln).toLowerCase().startsWith(String(cn).toLowerCase());case"endsWith":return String(ln).toLowerCase().endsWith(String(cn).toLowerCase());case"greaterThan":return Number(ln)>Number(cn);case"lessThan":return Number(ln)<Number(cn);case"greaterThanOrEqual":return Number(ln)>=Number(cn);case"lessThanOrEqual":return Number(ln)<=Number(cn);case"in":return Array.isArray(cn)?cn.includes(ln):String(cn).split(",").map(wi=>wi.trim()).includes(String(ln));case"notIn":return Array.isArray(cn)?!cn.includes(ln):!String(cn).split(",").map(wi=>wi.trim()).includes(String(ln));case"isNull":return ln==null||ln==="";case"isNotNull":return ln!=null&&ln!=="";default:return!0}});return fr?jt.every(Jt=>Jt):jt.some(Jt=>Jt)}},manualPagination:U,pageCount:V,state:{sorting:T?.sorting??M,columnFilters:T?.columnFilters??H,columnVisibility:T?.columnVisibility??W,rowSelection:T?.rowSelection??G,globalFilter:T?.globalFilter??Q,pagination:T?.pagination??ae,...T||{}},initialState:{pagination:{pageSize:te}},autoResetAll:!1,autoResetPageIndex:!1,autoResetExpanded:!1,getRowId:pe=>pe.id||pe.orderId||Math.random().toString()});Ji.default.useEffect(()=>{if(u&&a){let pe=ge.getFilteredSelectedRowModel().rows.map(Ge=>Ge.original);u(pe)}},[G,u,a,ge]);let ee=ge.getState(),le=ge.getRowModel(),ue=Ji.default.useRef(le.rows),he=Ji.default.useMemo(()=>{let pe=ue.current!==le.rows;return pe&&(ue.current=le.rows),pe},[le.rows]),qe=ue.current,_t={sorting:x.sorting!==!1,filtering:x.filtering!==!1||n,pagination:x.pagination!==!1||i,search:x.search!==!1||r,columnVisibility:x.columnVisibility!==!1,rowSelection:x.rowSelection!==!1||a,export:x.export!==!1||o},Zn=async pe=>{let Ge=ge.getFilteredSelectedRowModel().rows,at=Ge.length>0?Ge.map(jt=>jt.original):ge.getFilteredRowModel().rows.map(jt=>jt.original);if(typeof o=="object"&&o.onExport){o.onExport(at,pe);return}if(d){d(at);return}let ht=typeof o=="object"&&o.filename?o.filename:"data-export",fr=q9e(D,W);await j9e(at,{format:pe,filename:ht,columns:fr,includeHeaders:!0})},We=Ji.default.useMemo(()=>o?o===!0?["csv","json"]:typeof o=="object"&&o.formats?o.formats:["csv","json"]:[],[o]),Ye=()=>{ge.resetRowSelection()};return(0,Je.jsxs)("div",{className:B("moonui-pro-datatable-container flex flex-col gap-4",c),children:[(0,Je.jsxs)("div",{className:"moonui-pro-datatable-toolbar flex items-center justify-between",children:[(0,Je.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,Je.jsxs)("div",{className:"relative",children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(xo,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"})}),(0,Je.jsx)(Kt,{placeholder:L,value:Q,onChange:pe=>oe(pe.target.value),className:"pl-8 w-64"})]}),v.length>0&&(0,Je.jsx)("div",{className:"flex items-center gap-2",children:v.map((pe,Ge)=>(0,Je.jsx)(G9e,{table:ge,filter:pe,data:t},`quick-${pe.column}-${Ge}`))}),y.length>0&&(0,Je.jsx)("div",{className:"flex items-center gap-2",children:y.map(pe=>(0,Je.jsx)(K9e,{table:ge,column:pe,data:t},`faceted-${pe}`))}),n&&(0,Je.jsxs)(ne,{variant:"outline",size:"sm",onClick:()=>De(!0),children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Ii,{className:"mr-2 h-4 w-4"})}),"Filters",H.length>0&&(0,Je.jsx)("span",{className:"ml-2 rounded-full bg-primary px-2 py-0.5 text-xs text-primary-foreground",children:H.length})]}),a&&g.length>0&&(0,Je.jsx)(H9e,{selectedRows:ge.getFilteredSelectedRowModel().rows.map(pe=>pe.original),actions:g,onClearSelection:Ye})]}),(0,Je.jsxs)("div",{className:"flex items-center space-x-2",children:[o&&We.length>0&&(0,Je.jsxs)(Pr,{children:[(0,Je.jsx)(Ir,{asChild:!0,children:(0,Je.jsxs)(ne,{variant:"outline",size:"sm",children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(un,{className:"mr-2 h-4 w-4"})}),"Export"]})}),(0,Je.jsxs)(xr,{align:"end",children:[We.includes("csv")&&(0,Je.jsxs)(Fe,{onClick:()=>Zn("csv"),children:[(0,Je.jsx)(iv,{className:"mr-2 h-4 w-4"}),"Export as CSV"]}),We.includes("json")&&(0,Je.jsxs)(Fe,{onClick:()=>Zn("json"),children:[(0,Je.jsx)(yw,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),We.includes("xlsx")&&(0,Je.jsxs)(Fe,{onClick:()=>Zn("xlsx"),children:[(0,Je.jsx)(ZT,{className:"mr-2 h-4 w-4"}),"Export as Excel"]})]})]}),(0,Je.jsx)(E8e,{table:ge})]})]}),(0,Je.jsx)("div",{className:"moonui-pro-datatable-wrapper rounded-md border overflow-hidden",style:{contain:"layout style"},children:(0,Je.jsx)("div",{style:{overflowX:"auto"},children:(0,Je.jsxs)("table",{className:"moonui-pro-datatable",style:{width:"100%",tableLayout:"auto"},children:[(0,Je.jsx)("thead",{className:"moonui-data-table-header",children:ge.getHeaderGroups().map(pe=>(0,Je.jsx)("tr",{className:"moonui-data-table-row border-b",children:pe.headers.filter(Ge=>Ge.column.getIsVisible()).map(Ge=>(0,Je.jsx)("th",{className:"moonui-data-table-th h-12 px-4 text-left align-middle font-medium text-muted-foreground",children:Ge.isPlaceholder?null:(0,Je.jsxs)("div",{className:B("flex items-center space-x-2",Ge.column.getCanSort()&&"cursor-pointer select-none"),onClick:Ge.column.getCanSort()?ke(Ge.column.id):void 0,children:[Rse(Ge.column.columnDef.header,Ge.getContext()),Ge.column.getCanSort()&&(0,Je.jsx)("div",{className:"ml-2",children:Ge.column.getIsSorted()==="asc"?(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(av,{className:"h-4 w-4"})}):Ge.column.getIsSorted()==="desc"?(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(nv,{className:"h-4 w-4"})}):(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(ov,{className:"h-4 w-4"})})})]})},Ge.id))},pe.id))}),(0,Je.jsx)("tbody",{className:"moonui-data-table-body",children:Ie?(0,Je.jsx)(ie.tr,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:(0,Je.jsx)("td",{colSpan:ge.getAllLeafColumns().filter(pe=>pe.getIsVisible()).length,className:"h-24 text-center",children:(0,Je.jsxs)("div",{className:"flex items-center justify-center space-x-2",children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Sr,{className:"h-4 w-4 animate-spin"})}),(0,Je.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading..."})]})})},"loading"):qe?.length?(0,Je.jsx)(Je.Fragment,{children:qe.map((pe,Ge)=>{let at=pe.original.id||pe.id,ht=f&&Y.has(at);return(0,Je.jsx)(Y9e,{row:pe,columns:D,isExpanded:ht,enableExpandable:f,renderSubComponent:p,visibilityState:ge.getState().columnVisibility},at)})}):(0,Je.jsx)(ie.tr,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:(0,Je.jsx)("td",{colSpan:ge.getAllLeafColumns().filter(pe=>pe.getIsVisible()).length,className:"h-24 text-center",children:"No results found."})},"no-results")})]})})}),i&&(0,Je.jsxs)("div",{className:"flex items-center justify-between px-2",children:[(0,Je.jsx)("div",{className:"flex-1 text-sm text-muted-foreground",children:a&&ge.getFilteredSelectedRowModel().rows.length>0&&(0,Je.jsxs)("span",{children:[ge.getFilteredSelectedRowModel().rows.length," of"," ",ge.getFilteredRowModel().rows.length," row(s) selected."]})}),(0,Je.jsxs)("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[(0,Je.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Je.jsx)("p",{className:"text-sm font-medium",children:"Rows per page"}),(0,Je.jsx)("select",{value:ge.getState().pagination.pageSize,onChange:async pe=>{let Ge=Number(pe.target.value);R?R({pageIndex:ge.getState().pagination.pageIndex,pageSize:Ge}):(Oe(!0),await new Promise(at=>setTimeout(at,300)),ge.setPageSize(Ge),Oe(!1))},className:"h-8 w-[70px] rounded border border-input bg-background px-3 py-1 text-sm",disabled:Ie,children:l.map(pe=>(0,Je.jsx)("option",{value:pe,children:pe},pe))})]}),(0,Je.jsxs)("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",ge.getState().pagination.pageIndex+1," of"," ",ge.getPageCount()]}),(0,Je.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Je.jsx)(ne,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:async()=>{R?R({pageIndex:0,pageSize:ge.getState().pagination.pageSize}):(Oe(!0),await new Promise(pe=>setTimeout(pe,300)),ge.setPageIndex(0),Oe(!1))},disabled:!ge.getCanPreviousPage()||Ie,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(GT,{className:"h-4 w-4"})})}),(0,Je.jsx)(ne,{variant:"outline",className:"h-8 w-8 p-0",onClick:async()=>{if(R){let pe=ge.getState().pagination.pageIndex;R({pageIndex:pe-1,pageSize:ge.getState().pagination.pageSize})}else Oe(!0),await new Promise(pe=>setTimeout(pe,300)),ge.previousPage(),Oe(!1)},disabled:!ge.getCanPreviousPage()||Ie,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(oa,{className:"h-4 w-4"})})}),(0,Je.jsx)(ne,{variant:"outline",className:"h-8 w-8 p-0",onClick:async()=>{Oe(!0),await new Promise(pe=>setTimeout(pe,300)),ge.nextPage(),Oe(!1)},disabled:!ge.getCanNextPage()||Ie,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Bn,{className:"h-4 w-4"})})}),(0,Je.jsx)(ne,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:async()=>{Oe(!0),await new Promise(pe=>setTimeout(pe,300)),ge.setPageIndex(ge.getPageCount()-1),Oe(!1)},disabled:!ge.getCanNextPage()||Ie,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(KT,{className:"h-4 w-4"})})})]})]})]}),n&&(0,Je.jsx)(W9e,{table:ge,open:be,onOpenChange:De})]})}function kQt(e,t){return{id:"expander",header:()=>null,size:50,cell:({row:r})=>{let n=r.original.id||r.id,o=e.has(n);return(0,Je.jsx)("button",{onClick:a=>{a.stopPropagation(),t(n)},className:"p-2 hover:bg-muted rounded-md transition-colors","aria-label":o?"Collapse row":"Expand row",children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:o?(0,Je.jsx)($o,{className:"h-4 w-4 text-muted-foreground"}):(0,Je.jsx)(Bn,{className:"h-4 w-4 text-muted-foreground"})})})}}}function NQt(e=new Set){let[t,r]=Ji.default.useState(e),n=Ji.default.useCallback(i=>{r(s=>{let l=new Set(s);return l.has(i)?l.delete(i):l.add(i),l})},[]),o=Ji.default.useCallback(i=>{r(new Set(i))},[]),a=Ji.default.useCallback(()=>{r(new Set)},[]);return{expandedRows:t,setExpandedRows:r,toggleRow:n,expandAll:o,collapseAll:a}}var Y9e=Ji.default.memo(({row:e,columns:t,isExpanded:r,enableExpandable:n,renderSubComponent:o,visibilityState:a})=>{let i=e.original.id||e.id;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("tr",{className:B("border-b transition-colors hover:bg-muted/50",e.getIsSelected()&&"bg-muted",r&&"border-b-0"),children:e.getAllCells().filter(s=>a[s.column.id]!==!1).map(s=>(0,Je.jsx)("td",{className:"moonui-data-table-td p-4 align-middle",children:Rse(s.column.columnDef.cell,s.getContext())},s.id))}),r&&o&&(0,Je.jsx)("tr",{className:"border-b",children:(0,Je.jsx)("td",{colSpan:e.getAllCells().filter(s=>a[s.column.id]!==!1).length||1,className:"p-0 overflow-hidden",children:(0,Je.jsx)("div",{className:"transition-all duration-300 ease-out",style:{maxHeight:r?"1000px":"0",opacity:r?1:0},children:(0,Je.jsx)("div",{className:"border-t border-border/50",children:o({row:{original:e.original,id:i}})})})})})]})},(e,t)=>{let r=e.row.original.id||e.row.id,n=t.row.original.id||t.row.id,o=Object.keys(e.visibilityState).sort().join(","),a=Object.keys(t.visibilityState).sort().join(","),i=Object.values(e.visibilityState).join(","),s=Object.values(t.visibilityState).join(",");return r===n&&e.isExpanded===t.isExpanded&&e.row.getIsSelected()===t.row.getIsSelected()&&o===a&&i===s});Y9e.displayName="TableRow";var MQt=X9e;var vn=E(de(),1);var X6=E(dle(),1);var $e=E(me(),1),fle=vn.default.memo(({searchInputRef:e,searchPlaceholder:t,initialValue:r,onSearchChange:n,keyboardShortcuts:o})=>{let[a,i]=(0,vn.useState)(r||""),s=(0,vn.useRef)(void 0);(0,vn.useEffect)(()=>{i(r)},[r]);let l=(0,vn.useCallback)(c=>{let u=c.target.value;i(u),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{n(u),e.current&&e.current.focus()},150)},[n,e]);return(0,vn.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]),(0,$e.jsx)("div",{className:"p-4 border-b",children:(0,$e.jsxs)("div",{className:"relative",children:[(0,$e.jsx)(xo,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),(0,$e.jsx)("input",{ref:e,type:"text",placeholder:t,value:a,onChange:l,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",className:"w-full h-10 pl-9 pr-9 text-sm bg-background border border-input rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}),o&&(0,$e.jsxs)("kbd",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 hidden sm:flex",children:[(0,$e.jsx)("span",{className:"text-xs",children:"\u2318"}),"K"]})]})})});fle.displayName="SearchInput";function TQt({sections:e,footer:t,showSearch:r=!0,searchPlaceholder:n="Search...",searchQuery:o="",onSearchChange:a,showThemeToggle:i=!1,theme:s="system",onThemeChange:l,branding:c,collapsible:u=!0,defaultCollapsed:d=!1,floatingActionButton:f=!0,floatingActionButtonPosition:p={bottom:"1rem",left:"1rem"},floatingActionButtonClassName:m,glassmorphism:h=!1,animatedBackground:g=!1,keyboardShortcuts:v=!0,persistState:y=!0,persistKey:x="moonui-sidebar-state",onStateChange:C,customStyles:b,fullWidthItems:w=!0,enableNProgress:S=!0,className:P,activePath:N,onNavigate:O}){let[L,A]=(0,vn.useState)(!1),[U,V]=(0,vn.useState)(!1),[R,I]=(0,vn.useState)(d),[k,T]=(0,vn.useState)([]),[D,F]=(0,vn.useState)(o),[_,M]=(0,vn.useState)([]),j=(0,vn.useRef)(null);(0,vn.useEffect)(()=>{S&&X6.default.configure({easing:"ease",speed:800,showSpinner:!1,trickleSpeed:200,minimum:.2})},[S]);let H=Ca(0),q=Ca(0),W=Nh(H,{stiffness:300,damping:30}),z=Nh(q,{stiffness:300,damping:30});(0,vn.useEffect)(()=>{if(y&&typeof window<"u"){let Z=localStorage.getItem(x);if(Z){let te=JSON.parse(Z);I(te.collapsed),T(te.expandedSections),M(te.pinnedItems||[])}}},[y,x]),(0,vn.useEffect)(()=>{if(y&&typeof window<"u"){let Z={collapsed:R,expandedSections:k,searchQuery:D,pinnedItems:_,recentItems:[]};localStorage.setItem(x,JSON.stringify(Z)),C?.(Z)}},[R,k,D,_,y,x,C]),(0,vn.useEffect)(()=>{let Z=()=>{A(window.innerWidth<768)};return Z(),window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]),(0,vn.useEffect)(()=>{let Z=e.filter(te=>te.defaultExpanded!==!1).map(te=>te.id);T(Z)},[e]),(0,vn.useEffect)(()=>{if(!v)return;let Z=te=>{(te.metaKey||te.ctrlKey)&&te.key==="k"&&(te.preventDefault(),j.current?.focus()),(te.metaKey||te.ctrlKey)&&te.key==="b"&&(te.preventDefault(),L?V(!U):I(!R))};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[v,L,U,R]),(0,vn.useEffect)(()=>{if(!g)return;let Z=te=>{let Ce=document.querySelector(".sidebar-container")?.getBoundingClientRect();Ce&&(H.set(te.clientX-Ce.left),q.set(te.clientY-Ce.top))};return document.addEventListener("mousemove",Z),()=>document.removeEventListener("mousemove",Z)},[g,H,q]);let G=(0,vn.useCallback)(Z=>{T(te=>te.includes(Z)?te.filter(Ce=>Ce!==Z):[...te,Z])},[]),X=(0,vn.useCallback)(Z=>{M(te=>te.includes(Z)?te.filter(Ce=>Ce!==Z):[...te,Z])},[]),Q=(0,vn.useCallback)(Z=>{Z.action?Z.action():Z.href&&(S&&(X6.default.start(),setTimeout(()=>X6.default.done(),500)),O?O(Z.href):window.location.href=Z.href,L&&V(!1))},[O,L,S]);(0,vn.useEffect)(()=>{F(o)},[o]);let oe=(0,vn.useCallback)(Z=>{F(Z),a?.(Z)},[a]),ae=(0,vn.useCallback)((Z,te)=>te?Z.filter(Ce=>{let ke=Ce.title.toLowerCase().includes(te.toLowerCase()),ge=Ce.items?.some(ee=>ee.title.toLowerCase().includes(te.toLowerCase()));return ke||ge}):Z,[]),Le=(0,vn.useMemo)(()=>D?e.map(Z=>({...Z,filteredItems:ae(Z.items,D).map(te=>({...te,filteredChildren:te.items?ae(te.items,D):void 0}))})).filter(Z=>Z.filteredItems.length>0):e.map(Z=>({...Z,filteredItems:Z.items.map(te=>({...te,filteredChildren:te.items}))})),[e,D,ae]),Ie=(0,vn.useCallback)(Z=>{let te=Z.items&&Z.items.length>0;return!te&&!Z.title?null:(0,$e.jsxs)("div",{className:B("min-w-[200px] p-2",h&&"bg-background/95 backdrop-blur-sm"),children:[(0,$e.jsx)("div",{className:"font-medium px-2 py-1 text-sm",children:Z.title}),te&&(0,$e.jsx)("div",{className:"mt-1 space-y-0.5",children:Z.items?.map(Ce=>{let ke=Ce.href===N,ge=Ce.items&&Ce.items.length>0;return(0,$e.jsx)("div",{className:"relative",children:ge?(0,$e.jsxs)(fE,{openDelay:200,closeDelay:100,children:[(0,$e.jsx)(pE,{asChild:!0,children:(0,$e.jsxs)("button",{onClick:()=>Q(Ce),disabled:Ce.disabled,className:B("w-full flex items-center justify-between gap-2 rounded-md px-2 py-1.5 text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",ke&&"bg-primary/10 text-primary font-medium",Ce.disabled&&"opacity-50 cursor-not-allowed"),children:[(0,$e.jsxs)("div",{className:"flex items-center gap-2",children:[Ce.icon&&(0,$e.jsx)("span",{className:"flex-shrink-0",children:Ce.icon}),(0,$e.jsx)("span",{className:"truncate",children:Ce.title})]}),(0,$e.jsx)(Bn,{className:"h-3 w-3 flex-shrink-0"})]})}),(0,$e.jsx)(WI,{side:"right",align:"start",sideOffset:10,className:B("p-2",h&&"bg-background/95 backdrop-blur-sm"),children:(0,$e.jsx)("div",{className:"space-y-0.5",children:Ce.items?.map(ee=>{let le=ee.href===N;return(0,$e.jsxs)("button",{onClick:()=>Q(ee),disabled:ee.disabled,className:B("w-full flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",le&&"bg-primary/10 text-primary font-medium",ee.disabled&&"opacity-50 cursor-not-allowed"),children:[ee.icon&&(0,$e.jsx)("span",{className:"flex-shrink-0",children:ee.icon}),(0,$e.jsx)("span",{className:"truncate",children:ee.title}),ee.badge&&(0,$e.jsx)(Nt,{variant:ee.badgeVariant||"secondary",className:"ml-auto flex-shrink-0 text-[10px] px-1.5 py-0 h-5",children:ee.badge})]},ee.id)})})})]}):(0,$e.jsxs)("button",{onClick:()=>Q(Ce),disabled:Ce.disabled,className:B("w-full flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",ke&&"bg-primary/10 text-primary font-medium",Ce.disabled&&"opacity-50 cursor-not-allowed"),children:[Ce.icon&&(0,$e.jsx)("span",{className:"flex-shrink-0",children:Ce.icon}),(0,$e.jsx)("span",{className:"truncate",children:Ce.title}),Ce.badge&&(0,$e.jsx)(Nt,{variant:Ce.badgeVariant||"secondary",className:"ml-auto flex-shrink-0 text-[10px] px-1.5 py-0 h-5",children:Ce.badge})]})},Ce.id)})})]})},[N,h,Q]),Oe=(0,vn.useCallback)((Z,te=0,Ce)=>{let ke=Z.href===N,ge=_.includes(Z.id),ee=Z.items&&Z.items.length>0,le=k.includes(Z.id),ue=R&&!L&&te===0&&(ee||Z.title),he=Z.tooltip&&!R&&!ue,qe=(0,$e.jsxs)("button",{onClick:()=>{ee?G(Z.id):Q(Z)},className:B("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all",w?"w-[calc(100%-1.5rem)] mx-3":"w-full","hover:bg-accent hover:text-accent-foreground",ke&&"bg-primary/10 text-primary font-medium",Z.disabled&&"opacity-50 cursor-not-allowed",te>0&&"ml-6 text-xs",R&&te===0&&"justify-center px-2",b?.hover),disabled:Z.disabled,children:[Z.icon&&(0,$e.jsx)("span",{className:B("flex-shrink-0",R&&te===0&&"mx-auto"),children:Z.icon}),(!R||te>0)&&(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsx)("span",{className:"flex-1 text-left truncate",children:Z.title}),Z.badge&&(0,$e.jsx)(Nt,{variant:Z.badgeVariant||"secondary",className:"ml-auto flex-shrink-0 text-[10px] px-1.5 py-0 h-5",children:Z.badge}),ee&&te===0&&(0,$e.jsx)($o,{className:B("h-4 w-4 flex-shrink-0 transition-transform",le&&"rotate-180")}),ge&&(0,$e.jsx)(RA,{className:"h-3 w-3 flex-shrink-0"})]})]});return ue?(0,$e.jsx)("div",{children:(0,$e.jsxs)(fE,{openDelay:200,closeDelay:100,children:[(0,$e.jsx)(pE,{asChild:!0,children:qe}),(0,$e.jsx)(WI,{side:"right",align:"start",sideOffset:10,className:B("p-0 w-auto",h&&"bg-background/95 backdrop-blur-sm","animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"),children:(0,$e.jsx)(ie.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.15},children:Ie(Z)})})]})},Z.id):(0,$e.jsxs)("div",{children:[he?(0,$e.jsx)(Xf,{children:(0,$e.jsxs)(Ud,{children:[(0,$e.jsx)(Hd,{asChild:!0,children:qe}),(0,$e.jsx)(Bu,{side:"right",children:(0,$e.jsx)("p",{children:Z.tooltip})})]})}):qe,ee&&!R&&Ce&&(0,$e.jsx)(Dt,{children:le&&(0,$e.jsx)(ie.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:(0,$e.jsx)("div",{className:"pt-1 space-y-1",children:Ce.map(_t=>Oe(_t,te+1))})})})]},Z.id)},[N,_,k,R,b,Q,G,L,h,Ie,w]),ve=vn.default.memo(()=>(0,$e.jsxs)("div",{className:B("flex items-center gap-3 p-4 border-b",R&&!L&&"justify-center px-2"),children:[c&&(0,$e.jsxs)($e.Fragment,{children:[c.logo,(!R||L)&&c.title&&(0,$e.jsx)("span",{className:"font-semibold text-lg",children:c.title})]}),L&&(0,$e.jsx)(ne,{variant:"ghost",size:"sm",className:"ml-auto h-8 w-8 p-0",onClick:()=>V(!1),children:(0,$e.jsx)(Zt,{className:"h-4 w-4"})}),!L&&u&&(0,$e.jsx)(ne,{variant:"ghost",size:"sm",className:B("h-8 w-8 p-0",!R&&"ml-auto"),onClick:()=>I(!R),children:R?(0,$e.jsx)(Bn,{className:"h-4 w-4"}):(0,$e.jsx)(oa,{className:"h-4 w-4"})})]})),Re=vn.default.memo(()=>(0,$e.jsx)(ic,{className:"flex-1 overflow-y-auto",children:(0,$e.jsxs)("div",{className:"p-4 space-y-6",children:[_.length>0&&(!R||L)&&(0,$e.jsxs)("div",{children:[(0,$e.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Pinned"}),(0,$e.jsx)("div",{className:"space-y-1",children:e.flatMap(Z=>Z.items.filter(te=>_.includes(te.id))).map(Z=>Oe(Z))}),(0,$e.jsx)(ms,{className:"mt-4"})]}),Le.map((Z,te)=>(0,$e.jsxs)("div",{children:[Z.title&&(!R||L)&&(0,$e.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2",children:Z.title}),(0,$e.jsx)("div",{className:"space-y-1",children:Z.filteredItems.map(Ce=>Oe(Ce,0,Ce.filteredChildren))}),Z.showDivider&&te<Le.length-1&&(0,$e.jsx)(ms,{className:"mt-4"})]},Z.id))]})})),be=vn.default.memo(()=>t?(0,$e.jsxs)("div",{className:"border-t p-4",children:[(0,$e.jsx)("div",{className:"space-y-1",children:t.items.map(Z=>Oe(Z))}),i&&(!R||L)&&(0,$e.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,$e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Theme"}),(0,$e.jsxs)(Pr,{children:[(0,$e.jsx)(Ir,{asChild:!0,children:(0,$e.jsxs)(ne,{variant:"ghost",size:"sm",className:"h-7 px-2",children:[s==="light"&&(0,$e.jsx)(gh,{className:"h-3 w-3"}),s==="dark"&&(0,$e.jsx)(hh,{className:"h-3 w-3"}),s==="system"&&(0,$e.jsx)(_f,{className:"h-3 w-3"})]})}),(0,$e.jsxs)(xr,{align:"end",children:[(0,$e.jsxs)(Fe,{onClick:()=>l?.("light"),children:[(0,$e.jsx)(gh,{className:"mr-2 h-4 w-4"}),"Light"]}),(0,$e.jsxs)(Fe,{onClick:()=>l?.("dark"),children:[(0,$e.jsx)(hh,{className:"mr-2 h-4 w-4"}),"Dark"]}),(0,$e.jsxs)(Fe,{onClick:()=>l?.("system"),children:[(0,$e.jsx)(_f,{className:"mr-2 h-4 w-4"}),"System"]})]})]})]})]}):null),De=vn.default.memo(()=>(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsx)(Re,{}),(0,$e.jsx)(be,{})]})),Y=B("moonui-pro flex h-full flex-col bg-background border-r",h&&"bg-background/80 backdrop-blur-xl border-white/10",R&&!L&&"w-16",!R&&!L&&"w-64",b?.background,b?.border,P);return L?(0,$e.jsxs)($e.Fragment,{children:[f&&(0,$e.jsx)(ne,{onClick:()=>V(!0),className:B("fixed z-40 h-12 w-12 rounded-full shadow-lg md:hidden",m),size:"icon",style:{bottom:p?.bottom,left:p?.left,right:p?.right,top:p?.top},children:(0,$e.jsx)(Of,{className:"h-5 w-5"})}),(0,$e.jsx)(wb,{open:U,onOpenChange:V,children:(0,$e.jsx)(Fv,{side:"left",className:"w-80 p-0",children:(0,$e.jsxs)("div",{className:B(Y,"sidebar-container flex flex-col"),children:[g&&(0,$e.jsx)(ie.div,{className:"absolute inset-0 opacity-30",style:{background:`radial-gradient(circle at ${W}px ${z}px, rgba(var(--primary-rgb), 0.15), transparent 50%)`}}),(0,$e.jsx)(ve,{}),r&&(!R||L)&&(0,$e.jsx)(fle,{searchInputRef:j,searchPlaceholder:n,initialValue:D,onSearchChange:oe,keyboardShortcuts:v},"sidebar-search-mobile"),(0,$e.jsx)(De,{})]})})})]}):(0,$e.jsxs)("aside",{className:B(Y,"sidebar-container hidden md:flex flex-col"),children:[g&&(0,$e.jsx)(ie.div,{className:"absolute inset-0 opacity-30",style:{background:`radial-gradient(circle at ${W}px ${z}px, rgba(var(--primary-rgb), 0.15), transparent 50%)`}}),(0,$e.jsx)(ve,{}),r&&(!R||L)&&(0,$e.jsx)(fle,{searchInputRef:j,searchPlaceholder:n,initialValue:D,onSearchChange:oe,keyboardShortcuts:v},"sidebar-search-desktop"),(0,$e.jsx)(De,{})]})}function Z9e(e){let{hasProAccess:t,isLoading:r}=Ht();return!r&&!t?(0,$e.jsx)(Be,{className:B("w-full max-w-xs",e.className),children:(0,$e.jsx)(Ve,{className:"py-12 text-center",children:(0,$e.jsxs)("div",{className:"space-y-4",children:[(0,$e.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,$e.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,$e.jsxs)("div",{children:[(0,$e.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,$e.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Advanced Sidebar is available exclusively to MoonUI Pro subscribers."}),(0,$e.jsx)("a",{href:"/pricing",children:(0,$e.jsxs)(ne,{size:"sm",children:[(0,$e.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,$e.jsx)(TQt,{...e})}var AQt=Z9e;var Vi=E(de(),1);var Y6=E(dle(),1);var we=E(me(),1);function LQt({sections:e=[],branding:t,showSearch:r=!0,enableCommandAI:n=!1,commandAIShortcut:o="\u2318K",commandAIPlaceholder:a="Search commands...",onCommandAIOpen:i,onCommandAIClose:s,onCommandAISelect:l,searchPlaceholder:c="Search...",onSearch:u,showThemeToggle:d=!1,theme:f="system",onThemeChange:p,userMenu:m,notifications:h,cta:g,sticky:v=!0,glassmorphism:y=!1,animatedBackground:x=!1,keyboardShortcuts:C=!0,hideNavItems:b=!1,mobileBreakpoint:w=768,customStyles:S,variant:P="default",size:N="md",blur:O=!0,shadow:L=!1,rounded:A=!1,logoPosition:U="left",mobileMenuPosition:V="left",hideOnScroll:R=!1,showScrollProgress:I=!1,maxWidth:k="2xl",enableNProgress:T=!0,className:D,activePath:F,onNavigate:_}){console.log("Navbar sections:",e),console.log("enableCommandAI:",n);let[M,j]=(0,Vi.useState)(!1),[H,q]=(0,Vi.useState)(!1),[W,z]=(0,Vi.useState)(!1),[G,X]=(0,Vi.useState)(!1),[Q,oe]=(0,Vi.useState)(""),[ae,Le]=(0,Vi.useState)(!1),[Ie,Oe]=(0,Vi.useState)(!1),[ve,Re]=(0,Vi.useState)(0),be=(0,Vi.useRef)(0),De=(0,Vi.useRef)(null);(0,Vi.useEffect)(()=>{T&&Y6.default.configure({easing:"ease",speed:800,showSpinner:!1,trickleSpeed:200,minimum:.2})},[T]),(0,Vi.useEffect)(()=>{let le=()=>{j(window.innerWidth<w)};return le(),window.addEventListener("resize",le),()=>window.removeEventListener("resize",le)},[w]),(0,Vi.useEffect)(()=>{if(!v&&!R&&!I)return;let le=()=>{let ue=window.scrollY;if(Le(ue>10),R&&(ue>be.current&&ue>100?Oe(!0):Oe(!1),be.current=ue),I){let he=window.scrollY,qe=document.documentElement.scrollHeight-document.documentElement.clientHeight,_t=he/qe*100;Re(_t)}};return window.addEventListener("scroll",le,{passive:!0}),()=>window.removeEventListener("scroll",le)},[v,R,I]),(0,Vi.useEffect)(()=>{if(!C&&!n)return;let le=ue=>{(ue.metaKey||ue.ctrlKey)&&ue.key==="k"&&(ue.preventDefault(),X(!0),n&&i?.())};return document.addEventListener("keydown",le),()=>document.removeEventListener("keydown",le)},[C,n,i]);let Y=(0,Vi.useCallback)(le=>{le.action?le.action():le.href&&(T&&(Y6.default.start(),setTimeout(()=>Y6.default.done(),500)),_?_(le.href):window.location.href=le.href,M&&q(!1))},[_,M,T]),Z=(0,Vi.useCallback)(le=>{oe(le),u?.(le)},[u]),te=le=>(0,we.jsx)("div",{className:"grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]",children:le.map(ue=>(0,we.jsxs)(wE,{className:B("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",ue.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>!ue.disabled&&Y(ue),children:[(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[ue.icon&&(0,we.jsx)("span",{className:"flex-shrink-0",children:ue.icon}),(0,we.jsx)("div",{className:"text-sm font-medium leading-none",children:ue.title}),ue.badge&&(0,we.jsx)(Nt,{variant:ue.badgeVariant||"secondary",className:"ml-auto",children:ue.badge})]}),ue.description&&(0,we.jsx)("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:ue.description})]},ue.id))}),Ce=le=>(0,we.jsx)(we.Fragment,{children:le.map(ue=>ue.items&&ue.items.length>0?(0,we.jsxs)(zu,{children:[(0,we.jsx)(qc,{disabled:ue.disabled,children:(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ue.icon&&(0,we.jsx)("span",{children:ue.icon}),ue.title]})}),(0,we.jsx)($c,{children:Ce(ue.items)})]},ue.id):(0,we.jsxs)(Fe,{disabled:ue.disabled,onClick:()=>Y(ue),children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ue.icon&&(0,we.jsx)("span",{children:ue.icon}),ue.title]}),ue.badge&&(0,we.jsx)(Nt,{variant:ue.badgeVariant||"secondary",className:"ml-auto",children:ue.badge})]},ue.id))}),ke=()=>(0,we.jsxs)(wb,{open:H,onOpenChange:q,children:[(0,we.jsx)(qz,{asChild:!0,children:(0,we.jsx)(ne,{variant:"ghost",size:"icon",className:"md:hidden",children:(0,we.jsx)(Of,{className:"h-5 w-5"})})}),(0,we.jsx)(Fv,{side:V,className:"w-80 p-0",children:(0,we.jsxs)("div",{className:"flex h-full flex-col",children:[(0,we.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[t&&(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[t.logo,t.title&&(0,we.jsx)("span",{className:"font-semibold text-lg",children:t.title})]}),(0,we.jsx)(ne,{variant:"ghost",size:"icon",onClick:()=>q(!1),className:"h-8 w-8",children:(0,we.jsx)(Zt,{className:"h-4 w-4"})})]}),(0,we.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:!b&&e.map(le=>(0,we.jsxs)("div",{className:"space-y-1",children:[le.items.map(ue=>(0,we.jsx)("div",{children:ue.items&&ue.items.length>0?(0,we.jsxs)(Pr,{children:[(0,we.jsx)(Ir,{asChild:!0,children:(0,we.jsxs)(ne,{variant:"ghost",className:"w-full justify-between",disabled:ue.disabled,children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ue.icon&&(0,we.jsx)("span",{children:ue.icon}),ue.title]}),(0,we.jsx)($o,{className:"h-4 w-4"})]})}),(0,we.jsx)(xr,{align:"start",className:"w-56",children:ue.items&&Ce(ue.items)})]}):(0,we.jsxs)(ne,{variant:"ghost",className:"w-full justify-start",disabled:ue.disabled,onClick:()=>Y(ue),children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ue.icon&&(0,we.jsx)("span",{children:ue.icon}),ue.title]}),ue.badge&&(0,we.jsx)(Nt,{variant:ue.badgeVariant||"secondary",className:"ml-auto",children:ue.badge})]})},ue.id)),(0,we.jsx)(ms,{className:"my-2"})]},le.id))})]})})]}),ge=()=>{switch(N){case"sm":return"h-14";case"lg":return"h-20";default:return"h-16"}},ee=B("moonui-pro w-full transition-all duration-300",P==="default"&&"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",P==="floating"&&"mx-4 mt-4 rounded-lg border bg-background/95 backdrop-blur shadow-lg",P==="minimal"&&"bg-background",P==="transparent"&&"bg-transparent",v&&"sticky top-0 z-50",ae&&v&&P!=="transparent"&&"shadow-sm",ae&&P==="transparent"&&"bg-background/95 backdrop-blur border-b",Ie&&"-translate-y-full",y&&"bg-background/80 backdrop-blur-xl border-white/10",O&&"backdrop-blur-md",L&&"shadow-lg",A&&"rounded-lg",S?.background,S?.border,D);return(0,we.jsxs)(we.Fragment,{children:[(0,we.jsxs)("nav",{ref:De,className:ee,children:[(0,we.jsxs)("div",{className:B("flex items-center",ge(),k==="sm"&&"container max-w-screen-sm",k==="md"&&"container max-w-screen-md",k==="lg"&&"container max-w-screen-lg",k==="xl"&&"container max-w-screen-xl",k==="2xl"&&"container max-w-screen-2xl",k==="full"&&"w-full px-4 sm:px-6 lg:px-8"),children:[t&&(0,we.jsxs)("div",{className:B("flex items-center gap-2",U==="center"&&!M?"absolute left-1/2 -translate-x-1/2":"mr-4"),children:[U==="left"&&V==="left"&&(0,we.jsx)(ke,{}),(0,we.jsxs)("a",{href:t.href||"/",onClick:le=>{t.href&&_&&(le.preventDefault(),_(t.href))},className:"flex items-center gap-2",children:[t.logo,t.title&&!M&&(0,we.jsx)("span",{className:"font-semibold text-lg",children:t.title})]})]}),!M&&!b&&(0,we.jsx)(hE,{className:"hidden md:flex",children:(0,we.jsx)(gE,{children:e.map(le=>(0,we.jsx)(Vi.default.Fragment,{children:le.items.map(ue=>{let he=ue.items&&ue.items.length>0,qe=ue.href===F;return he?(0,we.jsxs)(vE,{children:[(0,we.jsx)(xE,{className:B(qe&&"bg-accent text-accent-foreground",ue.disabled&&"opacity-50 cursor-not-allowed"),disabled:ue.disabled,children:(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ue.icon&&(0,we.jsx)("span",{children:ue.icon}),ue.title]})}),(0,we.jsx)(bE,{children:ue.items&&te(ue.items)})]},ue.id):(0,we.jsx)(vE,{children:(0,we.jsxs)(wE,{className:B(yE(),qe&&"bg-accent text-accent-foreground",ue.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>!ue.disabled&&Y(ue),children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ue.icon&&(0,we.jsx)("span",{children:ue.icon}),ue.title]}),ue.badge&&(0,we.jsx)(Nt,{variant:ue.badgeVariant||"secondary",className:"ml-2",children:ue.badge})]})},ue.id)})},le.id))})}),(0,we.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[r&&(0,we.jsx)(we.Fragment,{children:M?(0,we.jsx)(ne,{variant:"ghost",size:"icon",onClick:()=>X(!0),children:(0,we.jsx)(xo,{className:"h-5 w-5"})}):(0,we.jsxs)("div",{className:"relative",children:[(0,we.jsx)(xo,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,we.jsx)(Kt,{type:"search",placeholder:c,className:"w-64 pl-9 pr-4 h-9 cursor-pointer",value:Q,onChange:le=>Z(le.target.value),onClick:()=>{n&&(X(!0),i?.())},readOnly:n}),(C||n)&&(0,we.jsx)("kbd",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 hidden sm:flex",children:n?o:(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)("span",{className:"text-xs",children:"\u2318"}),"K"]})})]})}),d&&(0,we.jsxs)(Pr,{children:[(0,we.jsx)(Ir,{asChild:!0,children:(0,we.jsxs)(ne,{variant:"ghost",size:"icon",children:[f==="light"&&(0,we.jsx)(gh,{className:"h-5 w-5"}),f==="dark"&&(0,we.jsx)(hh,{className:"h-5 w-5"}),f==="system"&&(0,we.jsx)(_f,{className:"h-5 w-5"})]})}),(0,we.jsxs)(xr,{align:"end",children:[(0,we.jsxs)(Fe,{onClick:()=>p?.("light"),children:[(0,we.jsx)(gh,{className:"mr-2 h-4 w-4"}),"Light"]}),(0,we.jsxs)(Fe,{onClick:()=>p?.("dark"),children:[(0,we.jsx)(hh,{className:"mr-2 h-4 w-4"}),"Dark"]}),(0,we.jsxs)(Fe,{onClick:()=>p?.("system"),children:[(0,we.jsx)(_f,{className:"mr-2 h-4 w-4"}),"System"]})]})]}),h&&(0,we.jsxs)(Pr,{children:[(0,we.jsx)(Ir,{asChild:!0,children:(0,we.jsxs)(ne,{variant:"ghost",size:"icon",className:"relative",children:[(0,we.jsx)(Jp,{className:"h-5 w-5"}),h.count&&h.count>0&&(0,we.jsx)("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] rounded-full bg-red-500 text-[11px] font-medium text-white flex items-center justify-center px-1",children:h.count>9?"9+":h.count})]})}),(0,we.jsxs)(xr,{align:"end",className:"w-[380px] p-0",sideOffset:8,children:[(0,we.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b",children:[(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[(0,we.jsx)("h4",{className:"text-base font-semibold",children:"Notifications"}),h.count&&h.count>0&&(0,we.jsxs)(Nt,{variant:"secondary",className:"h-5 px-2 rounded-full bg-primary/10 text-primary border-0",children:[h.count," new"]})]}),h.items&&h.items.length>0&&(0,we.jsx)(ne,{variant:"ghost",size:"sm",className:"text-xs h-7 px-2 text-muted-foreground hover:text-foreground",onClick:le=>{le.preventDefault(),console.log("Mark all as read")},children:"Mark all read"})]}),(0,we.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:h.items&&h.items.length>0?(0,we.jsx)("div",{className:"py-1",children:h.items.map((le,ue)=>(0,we.jsxs)("div",{children:[(0,we.jsx)("button",{className:B("w-full px-4 py-3 text-left hover:bg-muted/50 transition-colors","focus:outline-none focus:bg-muted/50",!le.read&&"bg-primary/5 hover:bg-primary/10"),onClick:()=>h.onNotificationClick?.(le.id),children:(0,we.jsxs)("div",{className:"flex gap-3",children:[(0,we.jsx)("div",{className:"mt-1.5",children:(0,we.jsx)("div",{className:B("h-2 w-2 rounded-full",le.read?"bg-transparent":"bg-primary")})}),(0,we.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,we.jsx)("p",{className:B("text-sm leading-tight",le.read?"font-normal":"font-medium"),children:le.title}),le.description&&(0,we.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:le.description}),le.time&&(0,we.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-1",children:le.time})]})]})}),ue<(h.items?.length||0)-1&&(0,we.jsx)("div",{className:"mx-4 border-b"})]},le.id))}):(0,we.jsxs)("div",{className:"py-12 text-center",children:[(0,we.jsx)(Jp,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),(0,we.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"No new notifications"}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"You're all caught up!"})]})}),h.items&&h.items.length>0&&(0,we.jsx)("div",{className:"border-t p-2",children:(0,we.jsx)(ne,{variant:"ghost",className:"w-full h-8 text-xs text-muted-foreground hover:text-foreground",onClick:le=>{le.preventDefault(),console.log("View all notifications")},children:"View all notifications"})})]})]}),g&&(0,we.jsx)(ne,{variant:g.variant||"primary",size:"sm",onClick:()=>{g.action?g.action():g.href&&_&&_(g.href)},className:M?"":"ml-2",children:g.text}),m&&(0,we.jsxs)(Pr,{children:[(0,we.jsx)(Ir,{asChild:!0,children:(0,we.jsx)(ne,{variant:"ghost",size:"icon",className:"relative",children:(0,we.jsxs)(ba,{className:"h-8 w-8",children:[(0,we.jsx)(ki,{src:m.user?.avatar,alt:m.user?.name}),(0,we.jsx)(Ha,{children:m.user?.name?.charAt(0)||(0,we.jsx)(Bf,{className:"h-4 w-4"})})]})})}),(0,we.jsxs)(xr,{align:"end",className:"w-56",children:[m.user&&(0,we.jsxs)(we.Fragment,{children:[(0,we.jsxs)("div",{className:"p-2",children:[(0,we.jsx)("p",{className:"text-sm font-medium",children:m.user.name}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground",children:m.user.email})]}),(0,we.jsx)(zr,{})]}),m.items&&Ce(m.items)]})]})]})]}),x&&(0,we.jsx)(ie.div,{className:"absolute inset-0 -z-10 opacity-30",animate:{background:["radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%)","radial-gradient(circle at 80% 50%, rgba(120, 119, 198, 0.3), transparent 50%)","radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%)"]},transition:{duration:10,repeat:1/0,ease:"linear"}}),I&&(0,we.jsx)("div",{className:"absolute bottom-0 left-0 w-full h-0.5 bg-muted",children:(0,we.jsx)("div",{className:"h-full bg-primary transition-all duration-150",style:{width:`${ve}%`}})})]}),(0,we.jsxs)(jL,{open:G,onOpenChange:le=>{X(le),le||s?.()},children:[(0,we.jsx)(Qf,{placeholder:n?a:c,value:Q,onValueChange:Z}),(0,we.jsxs)(hb,{children:[(0,we.jsx)(Zf,{children:n?(0,we.jsxs)("div",{className:"flex flex-col items-center py-6",children:[(0,we.jsx)(gt,{className:"h-8 w-8 text-muted-foreground mb-2"}),(0,we.jsx)("p",{className:"text-sm text-muted-foreground",children:"No results found"}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Try searching for pages, actions, or commands"})]}):"No results found."}),n&&!Q&&(0,we.jsxs)(Vu,{heading:"Quick Actions",children:[(0,we.jsxs)(nc,{onSelect:()=>{let le={id:"home",title:"Go Home",href:"/"};l?.(le),Y(le),X(!1)},children:[(0,we.jsx)(Px,{className:"mr-2 h-4 w-4"}),"Go Home",(0,we.jsx)("kbd",{className:"ml-auto text-xs",children:"\u2318H"})]}),(0,we.jsxs)(nc,{onSelect:()=>{z(!0),X(!1),l?.({id:"search",title:"Search",action:()=>z(!0)})},children:[(0,we.jsx)(xo,{className:"mr-2 h-4 w-4"}),"Search",(0,we.jsx)("kbd",{className:"ml-auto text-xs",children:"\u2318S"})]}),d&&(0,we.jsxs)(nc,{onSelect:()=>{p?.(f==="dark"?"light":"dark"),X(!1)},children:[f==="dark"?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(gh,{className:"mr-2 h-4 w-4"}),"Switch to Light Mode"]}):(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(hh,{className:"mr-2 h-4 w-4"}),"Switch to Dark Mode"]}),(0,we.jsx)("kbd",{className:"ml-auto text-xs",children:"\u2318T"})]})]}),e&&e.length>0&&e.map(le=>{if(!le||!le.items||le.items.length===0)return null;let ue=Q?le.items.filter(he=>he.title.toLowerCase().includes(Q.toLowerCase())||he.description?.toLowerCase().includes(Q.toLowerCase())):le.items;return ue.length===0?null:(0,we.jsx)(Vu,{heading:le.title||le.id,children:ue.map(he=>(0,we.jsxs)(nc,{disabled:he.disabled,onSelect:()=>{n&&l?.(he),Y(he),X(!1)},children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[he.icon&&(0,we.jsx)("span",{children:he.icon}),he.title]}),he.badge&&(0,we.jsx)(Nt,{variant:he.badgeVariant||"secondary",className:"ml-auto",children:he.badge}),he.description&&n&&(0,we.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:he.description})]},he.id))},le.id)}),n&&m?.items&&(0,we.jsx)(Vu,{heading:"Account",children:m.items.map(le=>(0,we.jsx)(nc,{disabled:le.disabled,onSelect:()=>{let ue={...le,action:le.onClick||le.action};ue.action?ue.action():ue.href&&(window.location.href=ue.href),l?.(ue),X(!1)},children:(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[le.icon&&(0,we.jsx)("span",{children:le.icon}),le.title]})},le.id))})]})]})]})}function J9e(e){let{hasProAccess:t,isLoading:r}=Ht();return!r&&!t?(0,we.jsx)(Be,{className:B("w-full",e.className),children:(0,we.jsx)(Ve,{className:"py-8 text-center",children:(0,we.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,we.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,we.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,we.jsxs)("div",{children:[(0,we.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,we.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Advanced Navbar is available exclusively to MoonUI Pro subscribers."}),(0,we.jsx)("a",{href:"/pricing",children:(0,we.jsxs)(ne,{size:"sm",children:[(0,we.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,we.jsx)(LQt,{...e})}var EQt=J9e;var ple=E(de(),1);var Za=E(de(),1),rKe=E(me(),1),eKe=(0,Za.createContext)(null),w0=()=>{let e=(0,Za.useContext)(eKe);if(!e)throw new Error("useFormWizard must be used within a FormWizardProvider");return e},tKe=({children:e,steps:t,initialStep:r=0,onStepChange:n,onComplete:o,validateOnStepChange:a=!0,allowBackNavigation:i=!0,allowStepSkip:s=!1,autoSave:l=!1,autoSaveDelay:c=2e3,onAutoSave:u,persistData:d=!1,storageKey:f="form-wizard-data"})=>{let[p,m]=(0,Za.useState)(r),[h,g]=(0,Za.useState)({}),[v,y]=(0,Za.useState)(new Set),[x,C]=(0,Za.useState)(!1),[b,w]=(0,Za.useState)(null);(0,Za.useEffect)(()=>{if(d&&typeof window<"u"){let k=localStorage.getItem(f);if(k)try{let T=JSON.parse(k);g(T.stepData||{}),m(T.currentStep||0),y(new Set(T.completedSteps||[]))}catch(T){console.error("Failed to load persisted wizard data:",T)}}},[d,f]),(0,Za.useEffect)(()=>{if(!l||!u)return;let k=setTimeout(()=>{let T=h[t[p].id];T&&u(t[p].id,T)},c);return()=>clearTimeout(k)},[h,p,l,c,u,t]),(0,Za.useEffect)(()=>{if(d&&typeof window<"u"){let k={stepData:h,currentStep:p,completedSteps:Array.from(v)};localStorage.setItem(f,JSON.stringify(k))}},[h,p,v,d,f]);let S=(0,Za.useCallback)(async()=>{let k=t[p];if(k.requiredFields!==!1&&typeof window<"u"){let D=document.querySelector("[data-wizard-step-content]");if(D)if(Array.isArray(k.requiredFields)){let F=[];if(k.requiredFields.forEach(_=>{let M=D.querySelector(`[name="${_}"], [id="${_}"]`);if(M){let j=M;M.tagName==="INPUT"&&M.type==="checkbox"?M.checked||F.push(_):(!j.value||j.value.trim()==="")&&F.push(_)}}),F.length>0)return w(`Please fill in the following required fields: ${F.join(", ")}`),!1}else{let F=D.querySelectorAll("input[required], select[required], textarea[required]"),_=[];if(F.forEach(j=>{let H=j;if(!H.value||H.value.trim()===""){let q=document.querySelector(`label[for="${H.id}"]`),W=q?q.textContent?.replace(" *","")||"Field":H.name||H.id||"Field";_.push(W)}}),D.querySelectorAll('input[type="checkbox"][required]').forEach(j=>{let H=j;if(!H.checked){let q=document.querySelector(`label[for="${H.id}"]`),W=q?q.textContent?.replace(" *","")||"Checkbox":H.name||H.id||"Checkbox";_.push(W)}}),_.length>0)return w(`Please fill in the following required fields: ${_.join(", ")}`),!1}}if(!k.validation)return!0;C(!0),w(null);try{let D=await k.validation();if(typeof D=="boolean")return D||w("Please complete all required fields before proceeding"),D;if(typeof D=="object"&&D!==null&&"isValid"in D){let F=D;return F.isValid||(F.error?w(F.error):F.errors&&Array.isArray(F.errors)?w(F.errors.join(", ")):w("Please complete all required fields before proceeding")),F.isValid}return w("Invalid validation response"),!1}catch(D){return w(D instanceof Error?D.message:"Validation failed"),!1}finally{C(!1)}},[p,t]),P=(0,Za.useCallback)((k,T)=>{g(D=>({...D,[k]:{...D[k],...T}})),w(null)},[]),N=(0,Za.useCallback)(async k=>{if(k<0||k>=t.length||k===p)return;let T=t[k];if((typeof T.isDisabled=="function"?T.isDisabled(p,t):T.isDisabled)||a&&k>p&&!await S())return;let F=t[p];F.onExit&&await F.onExit(),k>p&&y(M=>new Set([...M,p])),T.onEnter&&await T.onEnter();let _=p;m(k),n?.(k,_)},[p,t,a,S,n]),O=(0,Za.useCallback)(()=>{N(p+1)},[p,N]),L=(0,Za.useCallback)(()=>{i&&N(p-1)},[p,N,i]),A=(0,Za.useCallback)(async()=>{if(await S()&&(y(T=>new Set([...T,p])),o)){C(!0);try{await o(h),d&&typeof window<"u"&&localStorage.removeItem(f)}catch(T){w(T instanceof Error?T.message:"Failed to complete wizard")}finally{C(!1)}}},[p,h,S,o,d,f]),U=(0,Za.useCallback)(()=>{m(0),g({}),y(new Set),w(null),d&&typeof window<"u"&&localStorage.removeItem(f)},[d,f]),V=(0,Za.useCallback)(k=>v.has(k),[v]),R=(0,Za.useCallback)(k=>{if(k===0||s)return!0;for(let T=0;T<k;T++)if(!v.has(T)&&!t[T].isOptional)return!1;return!0},[v,s,t]),I={steps:t,currentStep:p,stepData:h,isLoading:x,error:b,goToNext:O,goToPrevious:L,goToStep:N,updateStepData:k=>P(t[p].id,k),validateCurrentStep:S,completeWizard:A,resetWizard:U,isStepCompleted:V,isStepAccessible:R,canGoNext:p<t.length-1,canGoPrevious:i&&p>0};return(0,rKe.jsx)(eKe.Provider,{value:I,children:e})};var gr=E(me(),1),Q6=({className:e,progressType:t="linear",orientation:r="horizontal",showStepNumbers:n=!0,showStepTitles:o=!0,stepIconPosition:a="top",completedStepIcon:i=(0,gr.jsx)(Pi,{className:"w-5 h-5"}),activeStepIcon:s,errorStepIcon:l=(0,gr.jsx)(aa,{className:"w-5 h-5"})})=>{let{steps:c,currentStep:u,isStepCompleted:d,isStepAccessible:f,error:p}=w0();if(t==="linear")return(0,gr.jsx)("div",{className:B("relative w-full",r==="vertical"?"flex flex-col space-y-8":"",e),children:r==="horizontal"?(0,gr.jsx)("div",{className:"relative w-full",children:(0,gr.jsx)("div",{className:B("relative flex items-start justify-between w-full",a==="left"&&"pl-14"),children:c.map((m,h)=>{let g=h===u,v=d(h),y=f(h),x=g&&p,C=typeof m.icon=="function"?m.icon({isActive:g,isCompleted:v}):m.icon;return(0,gr.jsxs)("div",{className:"relative flex-1 flex flex-col items-center",children:[a==="left"&&C&&(0,gr.jsx)("div",{className:"absolute -left-12 top-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,gr.jsx)("span",{className:B("w-8 h-8 flex items-center justify-center transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:C})}),a==="top"&&C&&(0,gr.jsx)("div",{className:"flex items-center justify-center mb-2",children:(0,gr.jsx)("span",{className:B("w-8 h-8 flex items-center justify-center transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:C})}),o&&(0,gr.jsxs)("div",{className:"text-center mb-3 min-h-[40px] px-2",children:[(0,gr.jsx)("p",{className:B("text-sm font-semibold transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:m.title}),m.description&&(0,gr.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:m.description})]}),(0,gr.jsxs)("div",{className:"relative flex items-center w-full",children:[h<c.length-1&&(0,gr.jsxs)("div",{className:"absolute left-1/2 w-full h-[2px]",style:{width:"calc(100% + 24px)",marginLeft:"24px"},children:[(0,gr.jsx)("div",{className:"h-full bg-border"}),h<u&&(0,gr.jsx)(ie.div,{className:"absolute inset-0 bg-primary",initial:{scaleX:0},animate:{scaleX:1},transition:{duration:.5,delay:h*.1},style:{transformOrigin:"left"}})]}),(0,gr.jsx)(ie.div,{initial:{scale:.8},animate:{scale:g?1.05:1},transition:{duration:.2},className:B("relative z-10 flex items-center justify-center rounded-full transition-all duration-300 mx-auto","w-12 h-12 border-2",g&&"border-primary bg-primary text-primary-foreground shadow-lg shadow-primary/20",v&&!g&&"border-primary bg-primary text-primary-foreground",!g&&!v&&y&&"border-border bg-background text-muted-foreground hover:border-accent",!y&&"border-border/50 bg-muted text-muted-foreground/50 cursor-not-allowed",x&&"border-destructive bg-destructive text-destructive-foreground"),children:x?l:v&&!g?i:g&&s?s:C&&a==="inside"?(0,gr.jsx)("span",{className:"w-5 h-5 flex items-center justify-center",children:C}):n?(0,gr.jsx)("span",{className:"text-sm font-semibold",children:h+1}):(0,gr.jsx)(Lf,{className:"w-4 h-4"})})]}),(0,gr.jsx)("div",{className:"mt-3",children:(0,gr.jsxs)("p",{className:"text-xs text-muted-foreground font-medium",children:["Step ",h+1," of ",c.length]})})]},m.id)})})}):(0,gr.jsxs)("div",{className:"relative pl-12",children:[c.length>1&&(0,gr.jsxs)(gr.Fragment,{children:[(0,gr.jsx)("div",{className:"absolute left-6 top-8 bottom-8 w-[2px] bg-border"}),(0,gr.jsx)(ie.div,{className:"absolute left-6 top-8 w-[2px] bg-primary",initial:{height:0},animate:{height:`${u/(c.length-1)*(100-16)}%`},transition:{duration:.5}})]}),c.map((m,h)=>{let g=h===u,v=d(h),y=f(h),x=g&&p,C=typeof m.icon=="function"?m.icon({isActive:g,isCompleted:v}):m.icon;return(0,gr.jsxs)("div",{className:"relative flex items-center mb-8 last:mb-0",children:[(0,gr.jsx)(ie.div,{initial:{scale:.8},animate:{scale:g?1.05:1},className:B("absolute left-0 z-20 flex items-center justify-center rounded-full border-2 transition-all duration-300","w-12 h-12",g&&"border-primary bg-primary text-primary-foreground shadow-lg",v&&!g&&"border-primary bg-primary text-primary-foreground",!g&&!v&&y&&"border-border bg-background text-muted-foreground hover:border-accent",!y&&"border-border/50 bg-muted text-muted-foreground/50 cursor-not-allowed",x&&"border-destructive bg-destructive text-destructive-foreground"),children:x?l:v&&!g?i:g&&s?s:C?(0,gr.jsx)("span",{className:"w-5 h-5 flex items-center justify-center",children:C}):n?(0,gr.jsx)("span",{className:"text-sm font-semibold",children:h+1}):(0,gr.jsx)(Lf,{className:"w-4 h-4"})}),(0,gr.jsx)("div",{className:"ml-16",children:o&&(0,gr.jsxs)(gr.Fragment,{children:[(0,gr.jsx)("p",{className:B("text-sm font-semibold transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:m.title}),m.description&&(0,gr.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:m.description})]})})]},m.id)})]})});if(t==="dots")return(0,gr.jsx)("div",{className:B("flex items-center justify-center space-x-2",e),children:c.map((m,h)=>{let g=h===u,v=d(h);return(0,gr.jsx)(ie.div,{initial:{scale:.8},animate:{scale:g?1.2:1},className:B("rounded-full transition-all duration-300",g?"w-3 h-3 bg-primary":"w-2 h-2",v&&!g&&"bg-primary/60",!g&&!v&&"bg-muted")},h)})});if(t==="circular"){let m=(u+1)/c.length*100,h=2*Math.PI*45,g=h-m/100*h;return(0,gr.jsxs)("div",{className:B("relative w-36 h-36 mx-auto",e),children:[(0,gr.jsxs)("svg",{className:"w-full h-full -rotate-90",viewBox:"0 0 144 144",children:[(0,gr.jsx)("circle",{cx:"72",cy:"72",r:"45",fill:"none",stroke:"currentColor",strokeWidth:"8",className:"text-border"}),(0,gr.jsx)(ie.circle,{cx:"72",cy:"72",r:"45",fill:"none",stroke:"currentColor",strokeWidth:"8",strokeDasharray:h,initial:{strokeDashoffset:h},animate:{strokeDashoffset:g},className:"text-primary",transition:{duration:.5}})]}),(0,gr.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,gr.jsxs)("div",{className:"text-center",children:[(0,gr.jsx)("p",{className:"text-3xl font-bold",children:u+1}),(0,gr.jsxs)("p",{className:"text-sm text-muted-foreground",children:["of ",c.length]})]})})]})}return null};var Z6=E(de(),1);var C0=E(me(),1),DQt={slide:{initial:e=>({x:e>0?1e3:-1e3,opacity:0}),animate:{x:0,opacity:1},exit:e=>({x:e<0?1e3:-1e3,opacity:0})},fade:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},scale:{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}},none:{initial:{},animate:{},exit:{}}},J6=({className:e,animationType:t="slide",animationDuration:r=.3})=>{let{steps:n,currentStep:o,goToNext:a,goToPrevious:i,goToStep:s,updateStepData:l,stepData:c,error:u}=w0(),[d,f]=Z6.default.useState(0),p=Z6.default.useRef(o);Z6.default.useEffect(()=>{f(o>p.current?1:-1),p.current=o},[o]);let m=n[o],h=o===0,g=o===n.length-1,v={currentStep:o,totalSteps:n.length,goToNext:a,goToPrevious:i,goToStep:s,isFirstStep:h,isLastStep:g,stepData:c[m.id]||{},updateStepData:x=>l(m.id,x)},y=typeof m.content=="function"?m.content(v):m.content;return(0,C0.jsx)(Dt,{mode:"wait",custom:d,children:(0,C0.jsx)(ie.div,{custom:d,variants:DQt[t],initial:"initial",animate:"animate",exit:"exit",transition:{duration:r,ease:"easeInOut"},className:B("w-full",e),"data-wizard-step-content":!0,children:(0,C0.jsxs)("div",{className:"space-y-4",children:[u&&(0,C0.jsxs)(Tx,{variant:"error",children:[(0,C0.jsx)(eo,{className:"h-4 w-4"}),(0,C0.jsx)(Ax,{children:u})]}),y]})},o)})};var Gs=E(me(),1),eW=({className:e,showStepIndicator:t=!0,previousText:r="Previous",nextText:n="Next",completeText:o="Complete",loadingText:a="Processing...",onPreviousClick:i,onNextClick:s,onCompleteClick:l})=>{let{steps:c,currentStep:u,isLoading:d,canGoNext:f,canGoPrevious:p,goToNext:m,goToPrevious:h,completeWizard:g}=w0(),v=u===c.length-1,y=c[u],x=()=>{i?.(),h()},C=()=>{v?(l?.(),g()):(s?.(),m())};return(0,Gs.jsxs)("div",{className:B("flex items-center justify-between",e),children:[(0,Gs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Gs.jsxs)(ne,{type:"button",variant:"outline",onClick:x,disabled:!p||d,className:B("transition-all duration-200",!p&&"invisible"),children:[(0,Gs.jsx)(oa,{className:"w-4 h-4 mr-1"}),r]}),t&&(0,Gs.jsxs)(ie.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"px-3 py-1 text-sm text-muted-foreground",children:["Step ",u+1," of ",c.length,y.isOptional&&(0,Gs.jsx)("span",{className:"ml-1 text-xs",children:"(Optional)"})]})]}),(0,Gs.jsx)(ne,{type:"button",onClick:C,disabled:d||!f&&!v,className:"min-w-[120px]",children:d?(0,Gs.jsxs)(Gs.Fragment,{children:[(0,Gs.jsx)(Sr,{className:"w-4 h-4 mr-2 animate-spin"}),a]}):v?(0,Gs.jsxs)(Gs.Fragment,{children:[(0,Gs.jsx)(Wr,{className:"w-4 h-4 mr-2"}),o]}):(0,Gs.jsxs)(Gs.Fragment,{children:[n,(0,Gs.jsx)(Bn,{className:"w-4 h-4 ml-1"})]})})]})};var Ja=E(me(),1),nKe=ple.default.forwardRef(({steps:e,currentStep:t=0,onStepChange:r,onComplete:n,orientation:o="horizontal",progressType:a="linear",allowStepSkip:i=!1,allowBackNavigation:s=!0,validateOnStepChange:l=!0,animationType:c="slide",animationDuration:u=.3,showStepNumbers:d=!0,showStepTitles:f=!0,showProgressBar:p=!0,stepIconPosition:m="top",completedStepIcon:h,activeStepIcon:g,errorStepIcon:v,className:y,progressClassName:x,navigationClassName:C,contentClassName:b,stepClassName:w,autoSave:S=!1,autoSaveDelay:P=2e3,onAutoSave:N,persistData:O=!1,storageKey:L="form-wizard-data"},A)=>(0,Ja.jsx)(tKe,{steps:e,initialStep:t,onStepChange:r,onComplete:n,validateOnStepChange:l,allowBackNavigation:s,allowStepSkip:i,autoSave:S,autoSaveDelay:P,onAutoSave:N,persistData:O,storageKey:L,children:(0,Ja.jsxs)("div",{ref:A,className:B("w-full",y),children:[p&&(0,Ja.jsx)(Ja.Fragment,{children:(0,Ja.jsx)(Q6,{className:B("mb-12",x),progressType:a,orientation:o,showStepNumbers:d,showStepTitles:f,stepIconPosition:m,completedStepIcon:h,activeStepIcon:g,errorStepIcon:v})}),(0,Ja.jsx)(Be,{className:B("border-0 shadow-none",b),children:(0,Ja.jsx)(Ve,{className:"p-0",children:(0,Ja.jsx)(J6,{className:w,animationType:c,animationDuration:u})})}),(0,Ja.jsx)(eW,{className:B("mt-8",C)})]})}));nKe.displayName="FormWizardInternal";var __=ple.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Ht();return!n&&!r?(0,Ja.jsx)(Be,{className:B("w-full",e.className),children:(0,Ja.jsx)(Ve,{className:"py-12 text-center",children:(0,Ja.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,Ja.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Ja.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Ja.jsxs)("div",{children:[(0,Ja.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,Ja.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Form Wizard is available exclusively to MoonUI Pro subscribers."}),(0,Ja.jsx)("a",{href:"/pricing",children:(0,Ja.jsxs)(ne,{size:"sm",children:[(0,Ja.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Ja.jsx)(nKe,{...e,ref:t})});__.displayName="MoonUIFormWizardPro";var OQt=__;var sd=E(de(),1);var yt=E(me(),1);function oKe(e){let t=[...e];for(let r=t.length-1;r>0;r--){let n=Math.floor(Math.random()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t}var _Qt=({title:e,description:t,questions:r,onComplete:n,showTimer:o=!0,totalTimeLimit:a,showProgress:i=!0,showQuestionNumbers:s=!0,allowReview:l=!0,allowSkip:c=!0,shuffleQuestions:u=!1,shuffleOptions:d=!1,passingScore:f=70,instantFeedback:p=!1,showHints:m=!1,className:h})=>{let[g]=(0,sd.useState)(()=>u?oKe(r):r),[v,y]=(0,sd.useState)({}),[x,C]=(0,sd.useState)([]),[b,w]=(0,sd.useState)(a||0),[S,P]=(0,sd.useState)({}),[N,O]=(0,sd.useState)(!1),[L,A]=(0,sd.useState)(0);(0,sd.useEffect)(()=>{if(!o||!a||N)return;let k=setInterval(()=>{w(T=>T<=1?(V(),0):T-1)},1e3);return()=>clearInterval(k)},[o,a,N]),(0,sd.useEffect)(()=>{if(!o||N)return;let k=setInterval(()=>{A(T=>T+1)},1e3);return()=>clearInterval(k)},[o,N]);let U=(0,sd.useCallback)(()=>{let k=0,T=0;return{results:g.map(F=>{let _=v[F.id],M=F.points||1;T+=M;let j=!1;if(_!=null&&_!==""){if(F.type==="single-choice"||F.type==="true-false")j=_===F.correctAnswer;else if(F.type==="multiple-choice"){let q=Array.isArray(_)?_:[],W=Array.isArray(F.correctAnswer)?F.correctAnswer:[];j=q.length===W.length&&q.every(z=>W.includes(z))}}let H=j?M:0;return k+=H,{questionId:F.id,answer:_,isCorrect:j,points:H,timeSpent:S[F.id]||0}}),score:k,totalScore:T}},[g,v,S]),V=async()=>{let{results:k,score:T,totalScore:D}=U();C(k),O(!0),n&&await n(k,T,D)},R=k=>{let T=Math.floor(k/60),D=k%60;return`${T}:${D.toString().padStart(2,"0")}`},I=g.map((k,T)=>({id:k.id,title:`Question ${T+1}`,description:k.tags?.join(", "),content:({updateStepData:D,goToNext:F})=>{let _=v[k.id],M=d&&k.options?oKe(k.options):k.options;(0,sd.useEffect)(()=>{S[k.id]||P(H=>({...H,[k.id]:L}))},[]);let j=H=>{y(q=>({...q,[k.id]:H})),p&&k.type};return(0,yt.jsxs)(Be,{className:"border-0 shadow-none",children:[(0,yt.jsxs)(yr,{children:[(0,yt.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[s&&(0,yt.jsxs)(Nt,{variant:"secondary",children:["Question ",T+1," of ",g.length]}),k.points&&k.points>1&&(0,yt.jsxs)(Nt,{variant:"outline",children:[k.points," points"]})]}),(0,yt.jsx)(Or,{className:"text-xl",children:k.question}),k.description&&(0,yt.jsx)($i,{children:k.description})]}),(0,yt.jsxs)(Ve,{className:"space-y-4",children:[k.image&&(0,yt.jsx)("img",{src:k.image,alt:"Question illustration",className:"w-full rounded-lg"}),k.type==="single-choice"&&M&&(0,yt.jsx)(fC,{value:_||"",onValueChange:j,children:M.map((H,q)=>(0,yt.jsxs)(ie.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:q*.1},className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,yt.jsx)(_v,{value:String(H.value),id:`${k.id}-${H.value}`}),(0,yt.jsx)(bt,{htmlFor:`${k.id}-${H.value}`,className:"flex-1 cursor-pointer",children:H.label||H.value})]},String(H.value)))}),k.type==="multiple-choice"&&M&&(0,yt.jsx)("div",{className:"space-y-2",children:M.map((H,q)=>(0,yt.jsxs)(ie.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:q*.1},className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,yt.jsx)(Ou,{id:`${k.id}-${H.value}`,checked:(_||[]).includes(H.value),onCheckedChange:W=>{let z=_||[];j(W?[...z,H.value]:z.filter(G=>G!==H.value))}}),(0,yt.jsx)(bt,{htmlFor:`${k.id}-${H.value}`,className:"flex-1 cursor-pointer",children:H.label||H.value})]},String(H.value)))}),k.type==="true-false"&&(0,yt.jsxs)(fC,{value:_?.toString()||"",onValueChange:H=>j(H==="true"),children:[(0,yt.jsxs)("div",{className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50",children:[(0,yt.jsx)(_v,{value:"true",id:`${k.id}-true`}),(0,yt.jsx)(bt,{htmlFor:`${k.id}-true`,className:"flex-1 cursor-pointer",children:"True"})]}),(0,yt.jsxs)("div",{className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50",children:[(0,yt.jsx)(_v,{value:"false",id:`${k.id}-false`}),(0,yt.jsx)(bt,{htmlFor:`${k.id}-false`,className:"flex-1 cursor-pointer",children:"False"})]})]}),k.type==="text"&&(0,yt.jsx)(Yc,{value:_||"",onChange:H=>j(H.target.value),placeholder:"Type your answer here...",className:"min-h-[120px]"}),k.type==="rating"&&(0,yt.jsxs)("div",{className:"space-y-4",children:[(0,yt.jsx)(Sb,{value:[_||5],onValueChange:([H])=>j(H),max:10,min:1,step:1,className:"w-full"}),(0,yt.jsxs)("div",{className:"text-center text-2xl font-bold",children:[_||5,"/10"]})]}),m&&k.hint&&(0,yt.jsx)(Tx,{children:(0,yt.jsxs)(Ax,{children:[(0,yt.jsx)("strong",{children:"Hint:"})," ",k.hint]})})]})]})},validation:()=>!(k.required&&!v[k.id]),isOptional:!k.required}));if(N){let{score:k,totalScore:T}=U(),D=Math.round(k/T*100),F=D>=f;return(0,yt.jsx)(ie.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:B("w-full max-w-2xl mx-auto",h),children:(0,yt.jsxs)(Be,{children:[(0,yt.jsxs)(yr,{className:"text-center",children:[(0,yt.jsx)("div",{className:"mx-auto mb-4",children:(0,yt.jsx)(zA,{className:B("w-16 h-16",F?"text-yellow-500":"text-muted-foreground")})}),(0,yt.jsx)(Or,{className:"text-3xl",children:"Quiz Complete!"}),(0,yt.jsx)($i,{children:"Here's how you performed"})]}),(0,yt.jsxs)(Ve,{className:"space-y-6",children:[(0,yt.jsxs)("div",{className:"text-center",children:[(0,yt.jsxs)("div",{className:"text-5xl font-bold mb-2",children:[D,"%"]}),(0,yt.jsx)(ps,{value:D,className:"h-3 mb-4"}),(0,yt.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,yt.jsxs)("span",{children:["Score: ",k,"/",T]}),(0,yt.jsx)("span",{children:F?(0,yt.jsx)(Nt,{variant:"success",children:"Passed"}):(0,yt.jsx)(Nt,{variant:"destructive",children:"Failed"})})]})]}),l&&(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)("h3",{className:"font-semibold",children:"Review Answers"}),x.map((_,M)=>{let j=g.find(H=>H.id===_.questionId);return(0,yt.jsxs)("div",{className:"flex items-center justify-between p-2 rounded-lg bg-muted/50",children:[(0,yt.jsxs)("span",{className:"text-sm",children:[s&&`Q${M+1}: `,j?.question.substring(0,50),"..."]}),(0,yt.jsxs)(Nt,{variant:_.isCorrect?"success":"destructive",children:[_.points,"/",j?.points||1]})]},_.questionId)})]}),(0,yt.jsxs)("div",{className:"flex gap-2",children:[(0,yt.jsxs)(ne,{className:"flex-1",onClick:()=>window.location.reload(),children:[(0,yt.jsx)(cv,{className:"w-4 h-4 mr-2"}),"Retake Quiz"]}),(0,yt.jsxs)(ne,{variant:"outline",children:[(0,yt.jsx)(un,{className:"w-4 h-4 mr-2"}),"Download Results"]}),(0,yt.jsxs)(ne,{variant:"outline",children:[(0,yt.jsx)(uv,{className:"w-4 h-4 mr-2"}),"Share"]})]})]})]})})}return(0,yt.jsxs)("div",{className:B("w-full",h),children:[o&&a&&(0,yt.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,yt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,yt.jsx)(In,{className:"w-4 h-4"}),(0,yt.jsxs)("span",{className:"text-sm font-medium",children:["Time Remaining: ",R(b)]})]}),(0,yt.jsx)(ps,{value:b/a*100,className:"w-32 h-2"})]}),(0,yt.jsx)(__,{steps:I,onComplete:V,allowStepSkip:c,validateOnStepChange:!0,showProgressBar:i,progressType:"dots",animationType:"slide"})]})},FQt=e=>{let{hasProAccess:t,isLoading:r}=Ht();return!r&&!t?(0,yt.jsx)(Be,{className:B("w-full",e.className),children:(0,yt.jsx)(Ve,{className:"py-12 text-center",children:(0,yt.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,yt.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,yt.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,yt.jsxs)("div",{children:[(0,yt.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,yt.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Quiz Form is available exclusively to MoonUI Pro subscribers."}),(0,yt.jsx)("a",{href:"/pricing",children:(0,yt.jsxs)(ne,{size:"sm",children:[(0,yt.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,yt.jsx)(_Qt,{...e})},BQt=FQt;var ld=E(de(),1);var Vr=E(me(),1),VQt={visa:/^4/,mastercard:/^5[1-5]/,amex:/^3[47]/,discover:/^6(?:011|5)/,diners:/^3(?:0[0-5]|[68])/,jcb:/^35/,unionpay:/^62/};function zQt(e,t){let r=e.replace(/\s+/g,"").replace(/[^0-9]/gi,""),n=t==="amex"?r.match(/\d{1,4}/g):r.match(/\d{1,4}/g);return n?n.join(" "):r}function UQt(e){let t=e.replace(/\s+/g,"").replace(/[^0-9]/gi,"");return t.length>=2?t.slice(0,2)+(t.length>2?"/"+t.slice(2,4):""):t}function HQt(e){let t=e.replace(/\s+/g,"");for(let[r,n]of Object.entries(VQt))if(n.test(t))return r;return null}function jQt(e){let t=e.replace(/\s+/g,"");if(!/^\d+$/.test(t))return!1;let r=0,n=!1;for(let o=t.length-1;o>=0;o--){let a=parseInt(t.charAt(o),10);n&&(a*=2,a>9&&(a-=9)),r+=a,n=!n}return r%10===0}function qQt(e){let t=e.split("/");if(t.length!==2)return!1;let r=parseInt(t[0],10),n=parseInt("20"+t[1],10);if(r<1||r>12)return!1;let o=new Date;return new Date(n,r-1)>o}var aKe=ld.default.forwardRef(({value:e={number:"",expiry:"",cvc:"",name:""},onChange:t,showCardPreview:r=!0,showCardType:n=!0,showSecurityBadge:o=!0,autoFormat:a=!0,validateOnChange:i=!1,labels:s={},placeholders:l={},errors:c={},className:u,inputClassName:d,labelClassName:f,errorClassName:p,disabled:m,required:h,...g},v)=>{let[y,x]=(0,ld.useState)(null),[C,b]=(0,ld.useState)(null),[w,S]=(0,ld.useState)({}),P=(0,ld.useRef)(null),N=(0,ld.useRef)(null),O=(0,ld.useRef)(null),L=(0,ld.useRef)(null);(0,ld.useEffect)(()=>{let V=HQt(e.number);x(V)},[e.number]),(0,ld.useEffect)(()=>{if(!i)return;let V={};e.number&&!jQt(e.number)&&(V.number="Invalid card number"),e.expiry&&!qQt(e.expiry)&&(V.expiry="Invalid expiry date"),e.cvc&&(e.cvc.length<3||e.cvc.length>4)&&(V.cvc="Invalid CVC"),S(V)},[e,i]);let A=(V,R)=>{let I=R;if(a){if(V==="number"){I=zQt(R,y||void 0);let k=y==="amex"?18:19;if(I.length>k)return}else if(V==="expiry"){if(I=UQt(R),I.length>5)return}else if(V==="cvc"){I=R.replace(/\D/g,"");let k=y==="amex"?4:3;if(I.length>k)return}}t?.({...e,[V]:I}),a&&(V==="number"&&I.length===(y==="amex"?18:19)?N.current?.focus():V==="expiry"&&I.length===5?O.current?.focus():V==="cvc"&&I.length===(y==="amex"?4:3)&&L.current?.focus())},U={...w,...c};return(0,Vr.jsxs)("div",{ref:v,className:B("space-y-4",u),...g,children:[r&&(0,Vr.jsxs)(ie.div,{className:"relative w-full max-w-md mx-auto h-48 rounded-xl bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-700 dark:to-purple-700 p-6 text-white shadow-xl overflow-hidden",initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},children:[(0,Vr.jsxs)("div",{className:"flex justify-between items-start mb-8",children:[(0,Vr.jsx)("div",{className:"text-lg font-semibold",children:y?y.toUpperCase():"CARD"}),(0,Vr.jsx)(YT,{className:"w-8 h-8 text-white/80"})]}),(0,Vr.jsxs)("div",{className:"space-y-4",children:[(0,Vr.jsx)("div",{className:"text-xl font-mono tracking-wider",children:e.number||"\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022"}),(0,Vr.jsxs)("div",{className:"flex justify-between",children:[(0,Vr.jsxs)("div",{children:[(0,Vr.jsx)("div",{className:"text-xs text-white/70",children:"NAME"}),(0,Vr.jsx)("div",{className:"text-sm uppercase",children:e.name||"YOUR NAME"})]}),(0,Vr.jsxs)("div",{children:[(0,Vr.jsx)("div",{className:"text-xs text-white/70",children:"EXPIRES"}),(0,Vr.jsx)("div",{className:"text-sm",children:e.expiry||"MM/YY"})]})]})]})]}),(0,Vr.jsxs)("div",{className:"space-y-4",children:[(0,Vr.jsxs)("div",{className:"space-y-1",children:[(0,Vr.jsxs)(bt,{htmlFor:"card-number",className:f,children:[s.number||"Card Number",h&&(0,Vr.jsx)("span",{className:"text-destructive ml-1",children:"*"})]}),(0,Vr.jsxs)("div",{className:"relative",children:[(0,Vr.jsx)(Kt,{ref:P,id:"card-number",type:"text",inputMode:"numeric",value:e.number,onChange:V=>A("number",V.target.value),onFocus:()=>b("number"),onBlur:()=>b(null),placeholder:l.number||"1234 5678 9012 3456",className:B("pr-20",U.number&&"border-destructive",d),disabled:m}),n&&y&&(0,Vr.jsx)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm font-medium text-muted-foreground",children:y.toUpperCase()})]}),U.number&&(0,Vr.jsx)("p",{className:B("text-sm text-destructive",p),children:U.number})]}),(0,Vr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Vr.jsxs)("div",{className:"space-y-1",children:[(0,Vr.jsxs)(bt,{htmlFor:"card-expiry",className:f,children:[s.expiry||"Expiry Date",h&&(0,Vr.jsx)("span",{className:"text-destructive ml-1",children:"*"})]}),(0,Vr.jsx)(Kt,{ref:N,id:"card-expiry",type:"text",inputMode:"numeric",value:e.expiry,onChange:V=>A("expiry",V.target.value),onFocus:()=>b("expiry"),onBlur:()=>b(null),placeholder:l.expiry||"MM/YY",className:B(U.expiry&&"border-destructive",d),disabled:m}),U.expiry&&(0,Vr.jsx)("p",{className:B("text-sm text-destructive",p),children:U.expiry})]}),(0,Vr.jsxs)("div",{className:"space-y-1",children:[(0,Vr.jsxs)(bt,{htmlFor:"card-cvc",className:f,children:[s.cvc||"CVC",h&&(0,Vr.jsx)("span",{className:"text-destructive ml-1",children:"*"})]}),(0,Vr.jsxs)("div",{className:"relative",children:[(0,Vr.jsx)(Kt,{ref:O,id:"card-cvc",type:"text",inputMode:"numeric",value:e.cvc,onChange:V=>A("cvc",V.target.value),onFocus:()=>b("cvc"),onBlur:()=>b(null),placeholder:l.cvc||y==="amex"?"1234":"123",className:B(U.cvc&&"border-destructive",d),disabled:m}),o&&(0,Vr.jsx)(Ct,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"})]}),U.cvc&&(0,Vr.jsx)("p",{className:B("text-sm text-destructive",p),children:U.cvc})]})]}),(0,Vr.jsxs)("div",{className:"space-y-1",children:[(0,Vr.jsx)(bt,{htmlFor:"card-name",className:f,children:s.name||"Cardholder Name"}),(0,Vr.jsx)(Kt,{ref:L,id:"card-name",type:"text",value:e.name,onChange:V=>A("name",V.target.value),onFocus:()=>b("name"),onBlur:()=>b(null),placeholder:l.name||"John Doe",className:B(U.name&&"border-destructive",d),disabled:m}),U.name&&(0,Vr.jsx)("p",{className:B("text-sm text-destructive",p),children:U.name})]})]}),o&&(0,Vr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Vr.jsx)(Ct,{className:"w-4 h-4"}),(0,Vr.jsx)("span",{children:"Your payment information is secure and encrypted"})]})]})});aKe.displayName="MoonUICreditCardInputPro";var Hl=E(de(),1);var tt=E(me(),1),iKe=mt("relative w-full rounded-lg border bg-card text-card-foreground shadow-sm",{variants:{variant:{default:"border-border",exam:"border-primary/20 bg-primary/5",personality:"border-secondary/20 bg-secondary/5"},size:{sm:"p-4",md:"p-6",lg:"p-8"}},defaultVariants:{variant:"default",size:"md"}}),sKe=Hl.default.forwardRef(({className:e,variant:t,size:r,questions:n,settings:o={},onComplete:a,onProgress:i,title:s,description:l,...c},u)=>{let[d,f]=(0,Hl.useState)([]),[p,m]=(0,Hl.useState)(0),[h,g]=(0,Hl.useState)({}),[v,y]=(0,Hl.useState)(!1),[x,C]=(0,Hl.useState)(null),[b,w]=(0,Hl.useState)(o.timeLimit?o.timeLimit*60:null),[S,P]=(0,Hl.useState)(Date.now()),[N,O]=(0,Hl.useState)(!1),[L,A]=(0,Hl.useState)(0);(0,Hl.useEffect)(()=>{let H=[...n];o.shuffleQuestions&&(H=V(H)),o.shuffleOptions&&(H=H.map(q=>q.options?{...q,options:V([...q.options])}:q)),f(H)},[n,o.shuffleQuestions,o.shuffleOptions]),(0,Hl.useEffect)(()=>{if(b===null||b<=0||v)return;let H=setInterval(()=>{w(q=>q===null||q<=1?(T(),0):q-1)},1e3);return()=>clearInterval(H)},[b,v]),(0,Hl.useEffect)(()=>{i&&i(p+1,d.length)},[p,d.length,i]);let U=d[p],V=H=>{let q=[...H];for(let W=q.length-1;W>0;W--){let z=Math.floor(Math.random()*(W+1));[q[W],q[z]]=[q[z],q[W]]}return q},R=H=>{let q=Date.now()-S;g(W=>({...W,[U.id]:{questionId:U.id,answer:H,timeSpent:q}}))},I=()=>{p<d.length-1?(m(H=>H+1),P(Date.now()),O(!1)):T()},k=()=>{p>0&&(m(H=>H-1),O(!1))},T=()=>{let H=D();C(H),y(!0),A(q=>q+1),a&&a(H)},D=()=>{let H=0,q=0,W=[];d.forEach(X=>{let Q=h[X.id],oe=X.points||1;H+=oe;let ae=!1;if(Q?.answer&&X.correctAnswer!==void 0)switch(X.type){case"single-choice":case"true-false":case"text":ae=Q.answer===X.correctAnswer;break;case"multiple-choice":Array.isArray(Q.answer)&&Array.isArray(X.correctAnswer)&&(ae=Q.answer.length===X.correctAnswer.length&&Q.answer.every(Le=>X.correctAnswer.includes(Le)));break;case"matching":if(typeof Q.answer=="object"&&typeof X.correctAnswer=="object"){let Le=X.correctAnswer,Ie=Q.answer;ae=Object.keys(Le).every(Oe=>Le[Oe]===Ie[Oe])}break;case"rating":ae=!0;break}ae&&(q+=oe),W.push({questionId:X.id,userAnswer:Q?.answer||null,correctAnswer:X.correctAnswer,isCorrect:ae,points:ae?oe:0})});let z=H>0?q/H*100:0,G=Object.values(h).reduce((X,Q)=>X+(Q.timeSpent||0),0);return{score:q,totalScore:H,percentage:z,passed:o.passingScore?z>=o.passingScore:void 0,answers:W,timeSpent:G,completedAt:new Date}},F=()=>{m(0),g({}),y(!1),C(null),w(o.timeLimit?o.timeLimit*60:null),P(Date.now()),O(!1),o.shuffleQuestions&&f(V([...n]))},_=()=>{if(!x)return;let H={title:s,completedAt:x.completedAt,score:x.score,totalScore:x.totalScore,percentage:x.percentage,passed:x.passed,timeSpent:x.timeSpent,answers:x.answers.map(G=>({question:d.find(Q=>Q.id===G.questionId)?.question,userAnswer:G.userAnswer,correctAnswer:G.correctAnswer,isCorrect:G.isCorrect,points:G.points}))},q=new Blob([JSON.stringify(H,null,2)],{type:"application/json"}),W=URL.createObjectURL(q),z=document.createElement("a");z.href=W,z.download=`quiz-results-${Date.now()}.json`,z.click(),URL.revokeObjectURL(W)},M=H=>{let q=Math.floor(H/60),W=H%60;return`${q}:${W.toString().padStart(2,"0")}`},j=()=>{if(!U)return null;let H=h[U.id]?.answer;switch(U.type){case"single-choice":case"true-false":return(0,tt.jsx)("div",{className:"space-y-3",children:U.options?.map((G,X)=>(0,tt.jsx)(ie.button,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:X*.1},onClick:()=>R(G),className:B("w-full text-left p-4 rounded-lg border transition-colors",H===G?"border-primary bg-primary/10":"border-border hover:border-primary/50"),children:G},X))});case"multiple-choice":return(0,tt.jsx)("div",{className:"space-y-3",children:U.options?.map((G,X)=>{let Q=Array.isArray(H)&&H.includes(G);return(0,tt.jsx)(ie.button,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:X*.1},onClick:()=>{let oe=H||[],ae=Q?oe.filter(Le=>Le!==G):[...oe,G];R(ae)},className:B("w-full text-left p-4 rounded-lg border transition-colors",Q?"border-primary bg-primary/10":"border-border hover:border-primary/50"),children:(0,tt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,tt.jsx)("div",{className:B("w-5 h-5 rounded border-2 transition-colors",Q?"bg-primary border-primary":"border-border"),children:Q&&(0,tt.jsx)(_s,{className:"w-full h-full text-primary-foreground"})}),G]})},X)})});case"text":return(0,tt.jsx)(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:(0,tt.jsx)("textarea",{className:"w-full p-4 rounded-lg border border-input bg-background resize-none",rows:4,placeholder:"Type your answer here...",value:H||"",onChange:G=>R(G.target.value)})});case"rating":let q=U.maxRating||5,W=typeof H=="number"?H:0;return(0,tt.jsxs)(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-4",children:[(0,tt.jsx)("div",{className:"flex justify-center gap-2",children:Array.from({length:q},(G,X)=>X+1).map(G=>(0,tt.jsx)("button",{onClick:()=>R(G),className:"transition-transform hover:scale-110",children:(0,tt.jsx)(ss,{className:B("w-10 h-10 transition-colors",G<=W?"fill-yellow-500 text-yellow-500":"text-muted-foreground")})},G))}),U.ratingLabels&&(0,tt.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,tt.jsx)("span",{children:U.ratingLabels[0]}),(0,tt.jsx)("span",{children:U.ratingLabels[1]})]})]});case"matching":let z=H||{};return(0,tt.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,tt.jsxs)("div",{className:"space-y-3",children:[(0,tt.jsx)("h4",{className:"font-medium mb-2",children:"Match these items:"}),U.leftOptions?.map((G,X)=>(0,tt.jsx)(ie.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:X*.1},className:"p-3 rounded-lg border bg-muted/50",children:G},G))]}),(0,tt.jsxs)("div",{className:"space-y-3",children:[(0,tt.jsx)("h4",{className:"font-medium mb-2",children:"With these:"}),U.leftOptions?.map(G=>(0,tt.jsx)(ie.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},children:(0,tt.jsxs)("select",{className:"w-full p-3 rounded-lg border bg-background",value:z[G]||"",onChange:X=>R({...z,[G]:X.target.value}),children:[(0,tt.jsx)("option",{value:"",children:"Select..."}),U.rightOptions?.map(X=>(0,tt.jsx)("option",{value:X,children:X},X))]})},G))]})]});default:return null}};return v&&x?(0,tt.jsx)("div",{ref:u,className:B(iKe({variant:t,size:r}),e),...c,children:(0,tt.jsxs)(ie.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"space-y-6",children:[(0,tt.jsxs)("div",{className:"text-center",children:[(0,tt.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Quiz Completed!"}),(0,tt.jsxs)("div",{className:"text-5xl font-bold mb-4",children:[x.percentage.toFixed(1),"%"]}),(0,tt.jsxs)("p",{className:"text-muted-foreground",children:["You scored ",x.score," out of ",x.totalScore," points"]}),x.passed!==void 0&&(0,tt.jsx)("div",{className:B("mt-4 inline-flex items-center gap-2 px-4 py-2 rounded-full",x.passed?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:x.passed?(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(_s,{className:"w-5 h-5"}),"Passed"]}):(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(aa,{className:"w-5 h-5"}),"Failed"]})})]}),o.allowReview&&(0,tt.jsxs)("div",{className:"space-y-4",children:[(0,tt.jsx)("h3",{className:"font-semibold",children:"Review Answers:"}),x.answers.map((H,q)=>{let W=d.find(z=>z.id===H.questionId);return W?(0,tt.jsx)("div",{className:"p-4 rounded-lg border bg-muted/50",children:(0,tt.jsxs)("div",{className:"flex items-start gap-3",children:[H.isCorrect?(0,tt.jsx)(_s,{className:"w-5 h-5 text-green-600 mt-0.5"}):(0,tt.jsx)(aa,{className:"w-5 h-5 text-red-600 mt-0.5"}),(0,tt.jsxs)("div",{className:"flex-1",children:[(0,tt.jsxs)("p",{className:"font-medium mb-2",children:[q+1,". ",W.question]}),(0,tt.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Your answer: ",JSON.stringify(H.userAnswer)]}),!H.isCorrect&&W.correctAnswer!==void 0&&(0,tt.jsxs)("p",{className:"text-sm text-green-600 mt-1",children:["Correct answer: ",JSON.stringify(W.correctAnswer)]}),W.explanation&&(0,tt.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:W.explanation})]})]})},H.questionId):null})]}),(0,tt.jsxs)("div",{className:"flex gap-3 justify-center",children:[(!o.maxAttempts||L<o.maxAttempts)&&(0,tt.jsxs)("button",{onClick:F,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90",children:[(0,tt.jsx)(cv,{className:"w-4 h-4"}),"Try Again"]}),(0,tt.jsxs)("button",{onClick:_,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg border hover:bg-muted",children:[(0,tt.jsx)(un,{className:"w-4 h-4"}),"Download Results"]})]})]})}):(0,tt.jsxs)("div",{ref:u,className:B(iKe({variant:t,size:r}),e),...c,children:[(s||b!==null)&&(0,tt.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,tt.jsxs)("div",{children:[s&&(0,tt.jsx)("h2",{className:"text-2xl font-bold",children:s}),l&&(0,tt.jsx)("p",{className:"text-muted-foreground mt-1",children:l})]}),b!==null&&(0,tt.jsxs)("div",{className:B("flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium",b<60?"bg-red-100 text-red-700":"bg-muted"),children:[(0,tt.jsx)(In,{className:"w-4 h-4"}),M(b)]})]}),(0,tt.jsxs)("div",{className:"mb-6",children:[(0,tt.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground mb-2",children:[(0,tt.jsxs)("span",{children:["Question ",p+1," of ",d.length]}),(0,tt.jsxs)("span",{children:[Math.round((p+1)/d.length*100),"%"]})]}),(0,tt.jsx)("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:(0,tt.jsx)(ie.div,{className:"h-full bg-primary",initial:{width:0},animate:{width:`${(p+1)/d.length*100}%`},transition:{duration:.3}})})]}),(0,tt.jsx)(Dt,{mode:"wait",children:U&&(0,tt.jsxs)(ie.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"mb-6",children:[(0,tt.jsxs)("h3",{className:"text-lg font-semibold mb-4",children:[U.question,U.required&&(0,tt.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),j(),o.showHints&&U.hint&&(0,tt.jsxs)("div",{className:"mt-4",children:[(0,tt.jsxs)("button",{onClick:()=>O(!N),className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[(0,tt.jsx)(em,{className:"w-4 h-4"}),N?"Hide":"Show"," Hint"]}),N&&(0,tt.jsx)(ie.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mt-2 p-3 rounded-lg bg-muted/50 text-sm",children:U.hint})]}),o.showInstantFeedback&&h[U.id]&&U.correctAnswer!==void 0&&(0,tt.jsx)(ie.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mt-4",children:(()=>{let H=h[U.id].answer,q=!1;switch(U.type){case"single-choice":case"true-false":q=H===U.correctAnswer;break}return(0,tt.jsxs)("div",{className:B("p-3 rounded-lg flex items-start gap-2",q?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:[q?(0,tt.jsx)(_s,{className:"w-5 h-5 mt-0.5"}):(0,tt.jsx)(aa,{className:"w-5 h-5 mt-0.5"}),(0,tt.jsxs)("div",{children:[(0,tt.jsx)("p",{className:"font-medium",children:q?"Correct!":"Incorrect"}),U.explanation&&(0,tt.jsx)("p",{className:"text-sm mt-1",children:U.explanation})]})]})})()})]},U.id)}),(0,tt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,tt.jsxs)("button",{onClick:k,disabled:p===0,className:B("inline-flex items-center gap-2 px-4 py-2 rounded-lg transition-colors",p===0?"opacity-50 cursor-not-allowed bg-muted text-muted-foreground":"bg-muted hover:bg-muted/80"),children:[(0,tt.jsx)(oa,{className:"w-4 h-4"}),"Previous"]}),(0,tt.jsxs)("button",{onClick:p===d.length-1?T:I,disabled:U?.required&&!h[U.id],className:B("inline-flex items-center gap-2 px-4 py-2 rounded-lg transition-colors",U?.required&&!h[U.id]?"opacity-50 cursor-not-allowed bg-muted text-muted-foreground":"bg-primary text-primary-foreground hover:bg-primary/90"),children:[p===d.length-1?"Complete":"Next",(0,tt.jsx)(Bn,{className:"w-4 h-4"})]})]})]})});sKe.displayName="MoonUIQuizFormProInternal";var mle=Hl.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Ht();return!n&&!r?(0,tt.jsx)(Be,{className:B("w-full",e.className),children:(0,tt.jsx)(Ve,{className:"py-12 text-center",children:(0,tt.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,tt.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,tt.jsx)(Ct,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,tt.jsxs)("div",{children:[(0,tt.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,tt.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"MoonUI Quiz Form is available exclusively to MoonUI Pro subscribers."}),(0,tt.jsx)("a",{href:"/pricing",children:(0,tt.jsxs)(ne,{size:"sm",children:[(0,tt.jsx)(gt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,tt.jsx)(sKe,{...e,ref:t})});mle.displayName="MoonUIQuizFormPro";var yd=E(de(),1);var J=E(it(),1),Tn=E(it(),1);var cd=E(it(),1);var jl=E(it(),1);var YS=E(Mr(),1),tW="Collapsible",[$Qt,hle]=on(tW),[WQt,gle]=$Qt(tW),lKe=jl.forwardRef((e,t)=>{let{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:a,onOpenChange:i,...s}=e,[l,c]=$n({prop:n,defaultProp:o??!1,onChange:i,caller:tW});return(0,YS.jsx)(WQt,{scope:r,disabled:a,contentId:No(),open:l,onOpenToggle:jl.useCallback(()=>c(u=>!u),[c]),children:(0,YS.jsx)(et.div,{"data-state":yle(l),"data-disabled":a?"":void 0,...s,ref:t})})});lKe.displayName=tW;var cKe="CollapsibleTrigger",uKe=jl.forwardRef((e,t)=>{let{__scopeCollapsible:r,...n}=e,o=gle(cKe,r);return(0,YS.jsx)(et.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":yle(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:ze(e.onClick,o.onOpenToggle)})});uKe.displayName=cKe;var vle="CollapsibleContent",dKe=jl.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=gle(vle,e.__scopeCollapsible);return(0,YS.jsx)(to,{present:r||o.open,children:({present:a})=>(0,YS.jsx)(GQt,{...n,ref:t,present:a})})});dKe.displayName=vle;var GQt=jl.forwardRef((e,t)=>{let{__scopeCollapsible:r,present:n,children:o,...a}=e,i=gle(vle,r),[s,l]=jl.useState(n),c=jl.useRef(null),u=Ut(t,c),d=jl.useRef(0),f=d.current,p=jl.useRef(0),m=p.current,h=i.open||s,g=jl.useRef(h),v=jl.useRef(void 0);return jl.useEffect(()=>{let y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),En(()=>{let y=c.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";let x=y.getBoundingClientRect();d.current=x.height,p.current=x.width,g.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(n)}},[i.open,n]),(0,YS.jsx)(et.div,{"data-state":yle(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!h,...a,ref:u,style:{["--radix-collapsible-content-height"]:f?`${f}px`:void 0,["--radix-collapsible-content-width"]:m?`${m}px`:void 0,...e.style},children:h&&o})});function yle(e){return e?"open":"closed"}var fKe=lKe,pKe=uKe,mKe=dKe;var Ks=E(Mr(),1),Xm="Accordion",XQt=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ble,YQt,QQt]=Gd(Xm),[nW,FTn]=on(Xm,[QQt,hle]),wle=hle(),ZQt=cd.default.forwardRef((e,t)=>{let{type:r,...n}=e,o=n,a=n;return(0,Ks.jsx)(ble.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?(0,Ks.jsx)(rZt,{...a,ref:t}):(0,Ks.jsx)(tZt,{...o,ref:t})})});ZQt.displayName=Xm;var[hKe,JQt]=nW(Xm),[gKe,eZt]=nW(Xm,{collapsible:!1}),tZt=cd.default.forwardRef((e,t)=>{let{value:r,defaultValue:n,onValueChange:o=()=>{},collapsible:a=!1,...i}=e,[s,l]=$n({prop:r,defaultProp:n??"",onChange:o,caller:Xm});return(0,Ks.jsx)(hKe,{scope:e.__scopeAccordion,value:cd.default.useMemo(()=>s?[s]:[],[s]),onItemOpen:l,onItemClose:cd.default.useCallback(()=>a&&l(""),[a,l]),children:(0,Ks.jsx)(gKe,{scope:e.__scopeAccordion,collapsible:a,children:(0,Ks.jsx)(vKe,{...i,ref:t})})})}),rZt=cd.default.forwardRef((e,t)=>{let{value:r,defaultValue:n,onValueChange:o=()=>{},...a}=e,[i,s]=$n({prop:r,defaultProp:n??[],onChange:o,caller:Xm}),l=cd.default.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=cd.default.useCallback(u=>s((d=[])=>d.filter(f=>f!==u)),[s]);return(0,Ks.jsx)(hKe,{scope:e.__scopeAccordion,value:i,onItemOpen:l,onItemClose:c,children:(0,Ks.jsx)(gKe,{scope:e.__scopeAccordion,collapsible:!0,children:(0,Ks.jsx)(vKe,{...a,ref:t})})})}),[nZt,oW]=nW(Xm),vKe=cd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,disabled:n,dir:o,orientation:a="vertical",...i}=e,s=cd.default.useRef(null),l=Ut(s,t),c=YQt(r),d=ip(o)==="ltr",f=ze(e.onKeyDown,p=>{if(!XQt.includes(p.key))return;let m=p.target,h=c().filter(P=>!P.ref.current?.disabled),g=h.findIndex(P=>P.ref.current===m),v=h.length;if(g===-1)return;p.preventDefault();let y=g,x=0,C=v-1,b=()=>{y=g+1,y>C&&(y=x)},w=()=>{y=g-1,y<x&&(y=C)};switch(p.key){case"Home":y=x;break;case"End":y=C;break;case"ArrowRight":a==="horizontal"&&(d?b():w());break;case"ArrowDown":a==="vertical"&&b();break;case"ArrowLeft":a==="horizontal"&&(d?w():b());break;case"ArrowUp":a==="vertical"&&w();break}let S=y%v;h[S].ref.current?.focus()});return(0,Ks.jsx)(nZt,{scope:r,disabled:n,direction:o,orientation:a,children:(0,Ks.jsx)(ble.Slot,{scope:r,children:(0,Ks.jsx)(et.div,{...i,"data-orientation":a,ref:l,onKeyDown:n?void 0:f})})})}),rW="AccordionItem",[oZt,Cle]=nW(rW),yKe=cd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,value:n,...o}=e,a=oW(rW,r),i=JQt(rW,r),s=wle(r),l=No(),c=n&&i.value.includes(n)||!1,u=a.disabled||e.disabled;return(0,Ks.jsx)(oZt,{scope:r,open:c,disabled:u,triggerId:l,children:(0,Ks.jsx)(fKe,{"data-orientation":a.orientation,"data-state":PKe(c),...s,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?i.onItemOpen(n):i.onItemClose(n)}})})});yKe.displayName=rW;var xKe="AccordionHeader",bKe=cd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,...n}=e,o=oW(Xm,r),a=Cle(xKe,r);return(0,Ks.jsx)(et.h3,{"data-orientation":o.orientation,"data-state":PKe(a.open),"data-disabled":a.disabled?"":void 0,...n,ref:t})});bKe.displayName=xKe;var xle="AccordionTrigger",wKe=cd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,...n}=e,o=oW(Xm,r),a=Cle(xle,r),i=eZt(xle,r),s=wle(r);return(0,Ks.jsx)(ble.ItemSlot,{scope:r,children:(0,Ks.jsx)(pKe,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:a.triggerId,...s,...n,ref:t})})});wKe.displayName=xle;var CKe="AccordionContent",SKe=cd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,...n}=e,o=oW(Xm,r),a=Cle(CKe,r),i=wle(r);return(0,Ks.jsx)(mKe,{role:"region","aria-labelledby":a.triggerId,"data-orientation":o.orientation,...i,...n,ref:t,style:{["--radix-accordion-content-height"]:"var(--radix-collapsible-content-height)",["--radix-accordion-content-width"]:"var(--radix-collapsible-content-width)",...e.style}})});SKe.displayName=CKe;function PKe(e){return e?"open":"closed"}var IKe=yKe,RKe=bKe,Sle=wKe,Ple=SKe;var iW=E(it());var kKe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),iZt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),Ile=e=>{let t=iZt(e);return t.charAt(0).toUpperCase()+t.slice(1)},aW=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),NKe=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var F_=E(it());var MKe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var TKe=(0,F_.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:i,...s},l)=>(0,F_.createElement)("svg",{ref:l,...MKe,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:aW("lucide",o),...!a&&!NKe(s)&&{"aria-hidden":"true"},...s},[...i.map(([c,u])=>(0,F_.createElement)(c,u)),...Array.isArray(a)?a:[a]]));var vt=(e,t)=>{let r=(0,iW.forwardRef)(({className:n,...o},a)=>(0,iW.createElement)(TKe,{ref:a,iconNode:t,className:aW(`lucide-${kKe(Ile(e))}`,`lucide-${e}`,n),...o}));return r.displayName=Ile(e),r};var sZt=[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],B_=vt("align-center",sZt);var lZt=[["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M3 6h18",key:"d0wm0j"}]],V_=vt("align-justify",lZt);var cZt=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],z_=vt("align-left",cZt);var uZt=[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],U_=vt("align-right",uZt);var dZt=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],H_=vt("bold",dZt);var fZt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],My=vt("check",fZt);var pZt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],S0=vt("chevron-down",pZt);var mZt=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],_N=vt("chevron-left",mZt);var hZt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],P0=vt("chevron-right",hZt);var gZt=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],j_=vt("chevron-up",gZt);var vZt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Og=vt("circle-alert",vZt);var yZt=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],I0=vt("circle-check-big",yZt);var xZt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],FN=vt("circle",xZt);var bZt=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],q_=vt("code",bZt);var wZt=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],$_=vt("credit-card",wZt);var CZt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Ty=vt("ellipsis",CZt);var SZt=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],W_=vt("eye",SZt);var PZt=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],G_=vt("file-text",PZt);var IZt=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],K_=vt("file",IZt);var RZt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],BN=vt("image",RZt);var kZt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],VN=vt("info",kZt);var NZt=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],X_=vt("italic",NZt);var MZt=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Y_=vt("link",MZt);var TZt=[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]],Q_=vt("list-ordered",TZt);var AZt=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Z_=vt("list",AZt);var LZt=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],yf=vt("loader-circle",LZt);var EZt=[["path",{d:"M5 12h14",key:"1ays0h"}]],J_=vt("minus",EZt);var DZt=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],e2=vt("music",DZt);var OZt=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],t2=vt("palette",OZt);var _Zt=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],r2=vt("phone",_Zt);var FZt=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],n2=vt("quote",FZt);var BZt=[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]],o2=vt("redo",BZt);var VZt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],a2=vt("search",VZt);var zZt=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],ud=vt("square-pen",zZt);var UZt=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],i2=vt("strikethrough",UZt);var HZt=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],R0=vt("triangle-alert",HZt);var jZt=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],s2=vt("underline",jZt);var qZt=[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]],l2=vt("undo",qZt);var $Zt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],c2=vt("upload",$Zt);var WZt=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],u2=vt("video",WZt);var GZt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ay=vt("x",GZt);function AKe(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=AKe(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function sW(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=AKe(e))&&(n&&(n+=" "),n+=t);return n}var Nle="-",KZt=e=>{let t=YZt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{let s=i.split(Nle);return s[0]===""&&s.length!==1&&s.shift(),DKe(s,t)||XZt(i)},getConflictingClassGroupIds:(i,s)=>{let l=r[i]||[];return s&&n[i]?[...l,...n[i]]:l}}},DKe=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),o=n?DKe(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;let a=e.join(Nle);return t.validators.find(({validator:i})=>i(a))?.classGroupId},LKe=/^\[(.+)\]$/,XZt=e=>{if(LKe.test(e)){let t=LKe.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},YZt=e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return ZZt(Object.entries(e.classGroups),r).forEach(([a,i])=>{kle(i,n,a,t)}),n},kle=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){let a=o===""?t:EKe(t,o);a.classGroupId=r;return}if(typeof o=="function"){if(QZt(o)){kle(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([a,i])=>{kle(i,EKe(t,a),r,n)})})},EKe=(e,t)=>{let r=e;return t.split(Nle).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},QZt=e=>e.isThemeGetter,ZZt=(e,t)=>t?e.map(([r,n])=>{let o=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([i,s])=>[t+i,s])):a);return[r,o]}):e,JZt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map,o=(a,i)=>{r.set(a,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let i=r.get(a);if(i!==void 0)return i;if((i=n.get(a))!==void 0)return o(a,i),i},set(a,i){r.has(a)?r.set(a,i):o(a,i)}}},OKe="!",eJt=e=>{let{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],a=t.length,i=s=>{let l=[],c=0,u=0,d;for(let g=0;g<s.length;g++){let v=s[g];if(c===0){if(v===o&&(n||s.slice(g,g+a)===t)){l.push(s.slice(u,g)),u=g+a;continue}if(v==="/"){d=g;continue}}v==="["?c++:v==="]"&&c--}let f=l.length===0?s:s.substring(u),p=f.startsWith(OKe),m=p?f.substring(1):f,h=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:h}};return r?s=>r({className:s,parseClassName:i}):i},tJt=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},rJt=e=>({cache:JZt(e.cacheSize),parseClassName:eJt(e),...KZt(e)}),nJt=/\s+/,oJt=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(nJt),s="";for(let l=i.length-1;l>=0;l-=1){let c=i[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(c),m=!!p,h=n(m?f.substring(0,p):f);if(!h){if(!m){s=c+(s.length>0?" "+s:s);continue}if(h=n(f),!h){s=c+(s.length>0?" "+s:s);continue}m=!1}let g=tJt(u).join(":"),v=d?g+OKe:g,y=v+h;if(a.includes(y))continue;a.push(y);let x=o(h,m);for(let C=0;C<x.length;++C){let b=x[C];a.push(v+b)}s=c+(s.length>0?" "+s:s)}return s};function aJt(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=_Ke(t))&&(n&&(n+=" "),n+=r);return n}var _Ke=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=_Ke(e[n]))&&(r&&(r+=" "),r+=t);return r};function iJt(e,...t){let r,n,o,a=i;function i(l){let c=t.reduce((u,d)=>d(u),e());return r=rJt(c),n=r.cache.get,o=r.cache.set,a=s,s(l)}function s(l){let c=n(l);if(c)return c;let u=oJt(l,r);return o(l,u),u}return function(){return a(aJt.apply(null,arguments))}}var Oa=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},FKe=/^\[(?:([a-z-]+):)?(.+)\]$/i,sJt=/^\d+\/\d+$/,lJt=new Set(["px","full","screen"]),cJt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uJt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dJt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fJt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pJt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ly=e=>zN(e)||lJt.has(e)||sJt.test(e),k0=e=>UN(e,"length",wJt),zN=e=>!!e&&!Number.isNaN(Number(e)),Rle=e=>UN(e,"number",zN),d2=e=>!!e&&Number.isInteger(Number(e)),mJt=e=>e.endsWith("%")&&zN(e.slice(0,-1)),tn=e=>FKe.test(e),N0=e=>cJt.test(e),hJt=new Set(["length","size","percentage"]),gJt=e=>UN(e,hJt,BKe),vJt=e=>UN(e,"position",BKe),yJt=new Set(["image","url"]),xJt=e=>UN(e,yJt,SJt),bJt=e=>UN(e,"",CJt),f2=()=>!0,UN=(e,t,r)=>{let n=FKe.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},wJt=e=>uJt.test(e)&&!dJt.test(e),BKe=()=>!1,CJt=e=>fJt.test(e),SJt=e=>pJt.test(e);var PJt=()=>{let e=Oa("colors"),t=Oa("spacing"),r=Oa("blur"),n=Oa("brightness"),o=Oa("borderColor"),a=Oa("borderRadius"),i=Oa("borderSpacing"),s=Oa("borderWidth"),l=Oa("contrast"),c=Oa("grayscale"),u=Oa("hueRotate"),d=Oa("invert"),f=Oa("gap"),p=Oa("gradientColorStops"),m=Oa("gradientColorStopPositions"),h=Oa("inset"),g=Oa("margin"),v=Oa("opacity"),y=Oa("padding"),x=Oa("saturate"),C=Oa("scale"),b=Oa("sepia"),w=Oa("skew"),S=Oa("space"),P=Oa("translate"),N=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",tn,t],A=()=>[tn,t],U=()=>["",Ly,k0],V=()=>["auto",zN,tn],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],k=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",tn],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>[zN,tn];return{cacheSize:500,separator:":",theme:{colors:[f2],spacing:[Ly,k0],blur:["none","",N0,tn],brightness:_(),borderColor:[e],borderRadius:["none","","full",N0,tn],borderSpacing:A(),borderWidth:U(),contrast:_(),grayscale:D(),hueRotate:_(),invert:D(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[mJt,k0],inset:L(),margin:L(),opacity:_(),padding:A(),saturate:_(),scale:_(),sepia:D(),skew:_(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",tn]}],container:["container"],columns:[{columns:[N0]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...R(),tn]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",d2,tn]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",tn]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",d2,tn]}],"grid-cols":[{"grid-cols":[f2]}],"col-start-end":[{col:["auto",{span:["full",d2,tn]},tn]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[f2]}],"row-start-end":[{row:["auto",{span:[d2,tn]},tn]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",tn]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",tn]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",tn,t]}],"min-w":[{"min-w":[tn,t,"min","max","fit"]}],"max-w":[{"max-w":[tn,t,"none","full","min","max","fit","prose",{screen:[N0]},N0]}],h:[{h:[tn,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[tn,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[tn,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[tn,t,"auto","min","max","fit"]}],"font-size":[{text:["base",N0,k0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Rle]}],"font-family":[{font:[f2]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",tn]}],"line-clamp":[{"line-clamp":["none",zN,Rle]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ly,tn]}],"list-image":[{"list-image":["none",tn]}],"list-style-type":[{list:["none","disc","decimal",tn]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ly,k0]}],"underline-offset":[{"underline-offset":["auto",Ly,tn]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tn]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),vJt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gJt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xJt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:I()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Ly,tn]}],"outline-w":[{outline:[Ly,k0]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Ly,k0]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",N0,bJt]}],"shadow-color":[{shadow:[f2]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...k(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":k()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",N0,tn]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",tn]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",tn]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",tn]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[d2,tn]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[w]}],"skew-y":[{"skew-y":[w]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",tn]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tn]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tn]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ly,k0,Rle]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var VKe=iJt(PJt);var $=E(Mr(),1);var zKe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,UKe=sW,Mn=(e,t)=>r=>{var n;if(t?.variants==null)return UKe(e,r?.class,r?.className);let{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(c=>{let u=r?.[c],d=a?.[c];if(u===null)return null;let f=zKe(u)||zKe(d);return o[c][f]}),s=r&&Object.entries(r).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(m=>{let[h,g]=m;return Array.isArray(g)?g.includes({...a,...s}[h]):{...a,...s}[h]===g})?[...c,d,f]:c},[]);return UKe(e,i,l,r?.class,r?.className)};var _p=E(it(),1);var HKe=E(SE(),1);function jKe(){return(0,HKe.useSyncExternalStore)(IJt,()=>!0,()=>!1)}function IJt(){return()=>{}}var p2=E(Mr(),1),Mle="Avatar",[RJt,yEn]=on(Mle),[kJt,$Ke]=RJt(Mle),WKe=_p.forwardRef((e,t)=>{let{__scopeAvatar:r,...n}=e,[o,a]=_p.useState("idle");return(0,p2.jsx)(kJt,{scope:r,imageLoadingStatus:o,onImageLoadingStatusChange:a,children:(0,p2.jsx)(et.span,{...n,ref:t})})});WKe.displayName=Mle;var GKe="AvatarImage",KKe=_p.forwardRef((e,t)=>{let{__scopeAvatar:r,src:n,onLoadingStatusChange:o=()=>{},...a}=e,i=$Ke(GKe,r),s=NJt(n,a),l=Wn(c=>{o(c),i.onImageLoadingStatusChange(c)});return En(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?(0,p2.jsx)(et.img,{...a,ref:t,src:n}):null});KKe.displayName=GKe;var XKe="AvatarFallback",YKe=_p.forwardRef((e,t)=>{let{__scopeAvatar:r,delayMs:n,...o}=e,a=$Ke(XKe,r),[i,s]=_p.useState(n===void 0);return _p.useEffect(()=>{if(n!==void 0){let l=window.setTimeout(()=>s(!0),n);return()=>window.clearTimeout(l)}},[n]),i&&a.imageLoadingStatus!=="loaded"?(0,p2.jsx)(et.span,{...o,ref:t}):null});YKe.displayName=XKe;function qKe(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function NJt(e,{referrerPolicy:t,crossOrigin:r}){let n=jKe(),o=_p.useRef(null),a=(()=>n?(o.current||(o.current=new window.Image),o.current):null)(),[i,s]=_p.useState(()=>qKe(a,e));return En(()=>{s(qKe(a,e))},[a,e]),En(()=>{let l=d=>()=>{s(d)};if(!a)return;let c=l("loaded"),u=l("error");return a.addEventListener("load",c),a.addEventListener("error",u),t&&(a.referrerPolicy=t),typeof r=="string"&&(a.crossOrigin=r),()=>{a.removeEventListener("load",c),a.removeEventListener("error",u)}},[a,r,t]),i}var Tle=WKe,Ale=KKe,Lle=YKe;var Q2=E(Mr(),1),Vg=E(it(),1);var QKe=E(it(),1),HN=(0,QKe.createContext)({});var ZKe=E(it(),1);function _g(e){let t=(0,ZKe.useRef)(null);return t.current===null&&(t.current=e()),t.current}var lW=E(it(),1);var jN=typeof window<"u";var qN=jN?lW.useLayoutEffect:lW.useEffect;var fce=E(Mr(),1),eXe=E(it(),1),X2=E(it(),1);var JKe=E(it(),1),M0=(0,JKe.createContext)(null);var Z7e=E(Mr(),1);function QS(e,t){e.indexOf(t)===-1&&e.push(t)}function Ym(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var yl=(e,t,r)=>r>t?t:r<e?e:r;var Ey=()=>{},ql=()=>{};var Sc={};var m2=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function h2(e){return typeof e=="object"&&e!==null}var g2=e=>/^0[^.\s]+$/u.test(e);function ZS(e){let t;return()=>(t===void 0&&(t=e()),t)}var bi=e=>e;var TJt=(e,t)=>r=>t(e(r)),Qm=(...e)=>e.reduce(TJt);var Fp=(e,t,r)=>{let n=t-e;return n===0?1:(r-e)/n};var Dy=class{constructor(){this.subscriptions=[]}add(t){return QS(this.subscriptions,t),()=>Ym(this.subscriptions,t)}notify(t,r,n){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,r,n);else for(let a=0;a<o;a++){let i=this.subscriptions[a];i&&i(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var es=e=>e*1e3,$l=e=>e/1e3;function v2(e,t){return t?e*(1e3/t):0}var e7e=(e,t,r)=>{let n=t-e;return((r-e)%n+n)%n+e};var t7e=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,AJt=1e-7,LJt=12;function EJt(e,t,r,n,o){let a,i,s=0;do i=t+(r-t)/2,a=t7e(i,n,o)-e,a>0?r=i:t=i;while(Math.abs(a)>AJt&&++s<LJt);return i}function T0(e,t,r,n){if(e===t&&r===n)return bi;let o=a=>EJt(a,0,1,e,r);return a=>a===0||a===1?a:t7e(o(a),t,n)}var cW=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var uW=e=>t=>1-e(1-t);var dW=T0(.33,1.53,.69,.99),$N=uW(dW),y2=cW($N);var x2=e=>(e*=2)<1?.5*$N(e):.5*(2-Math.pow(2,-10*(e-1)));var b2=e=>1-Math.sin(Math.acos(e)),w2=uW(b2),C2=cW(b2);var Ele=T0(.42,0,1,1),Dle=T0(0,0,.58,1),S2=T0(.42,0,.58,1);var P2=e=>Array.isArray(e)&&typeof e[0]!="number";function I2(e,t){return P2(e)?e[e7e(0,e.length,t)]:e}var R2=e=>Array.isArray(e)&&typeof e[0]=="number";var r7e={linear:bi,easeIn:Ele,easeInOut:S2,easeOut:Dle,circIn:b2,circInOut:C2,circOut:w2,backIn:$N,backInOut:y2,backOut:dW,anticipate:x2},DJt=e=>typeof e=="string",fW=e=>{if(R2(e)){ql(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,o]=e;return T0(t,r,n,o)}else if(DJt(e))return ql(r7e[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),r7e[e];return e};var k2=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];var dd={value:null,addProjectionMetrics:null};function n7e(e,t){let r=new Set,n=new Set,o=!1,a=!1,i=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){i.has(d)&&(u.schedule(d),e()),l++,d(s)}let u={schedule:(d,f=!1,p=!1)=>{let h=p&&o?r:n;return f&&i.add(d),h.has(d)||h.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(s=d,o){a=!0;return}o=!0,[r,n]=[n,r],r.forEach(c),t&&dd.value&&dd.value.frameloop[t].push(l),l=0,r.clear(),o=!1,a&&(a=!1,u.process(d))}};return u}var OJt=40;function pW(e,t){let r=!1,n=!0,o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,i=k2.reduce((x,C)=>(x[C]=n7e(a,t?C:void 0),x),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=i,h=()=>{let x=Sc.useManualTiming?o.timestamp:performance.now();r=!1,Sc.useManualTiming||(o.delta=n?1e3/60:Math.max(Math.min(x-o.timestamp,OJt),1)),o.timestamp=x,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),p.process(o),m.process(o),o.isProcessing=!1,r&&t&&(n=!1,e(h))},g=()=>{r=!0,n=!0,o.isProcessing||e(h)};return{schedule:k2.reduce((x,C)=>{let b=i[C];return x[C]=(w,S=!1,P=!1)=>(r||g(),b.schedule(w,S,P)),x},{}),cancel:x=>{for(let C=0;C<k2.length;C++)i[k2[C]].cancel(x)},state:o,steps:i}}var{schedule:rn,cancel:Pc,state:zi,steps:N2}=pW(typeof requestAnimationFrame<"u"?requestAnimationFrame:bi,!0);var mW;function _Jt(){mW=void 0}var Ui={now:()=>(mW===void 0&&Ui.set(zi.isProcessing||Sc.useManualTiming?zi.timestamp:performance.now()),mW),set:e=>{mW=e,queueMicrotask(_Jt)}};var Zm={layout:0,mainThread:0,waapi:0};var o7e=e=>t=>typeof t=="string"&&t.startsWith(e),JS=o7e("--"),FJt=o7e("var(--"),e1=e=>FJt(e)?BJt.test(e.split("/*")[0].trim()):!1,BJt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var Fg={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Oy={...Fg,transform:e=>yl(0,1,e)},M2={...Fg,default:1};var A0=e=>Math.round(e*1e5)/1e5;var WN=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function a7e(e){return e==null}var i7e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var GN=(e,t)=>r=>!!(typeof r=="string"&&i7e.test(r)&&r.startsWith(e)||t&&!a7e(r)&&Object.prototype.hasOwnProperty.call(r,t)),hW=(e,t,r)=>n=>{if(typeof n!="string")return n;let[o,a,i,s]=n.match(WN);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:s!==void 0?parseFloat(s):1}};var VJt=e=>yl(0,255,e),Ole={...Fg,transform:e=>Math.round(VJt(e))},Bg={test:GN("rgb","red"),parse:hW("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Ole.transform(e)+", "+Ole.transform(t)+", "+Ole.transform(r)+", "+A0(Oy.transform(n))+")"};function zJt(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}}var T2={test:GN("#"),parse:zJt,transform:Bg.transform};var A2=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Jm=A2("deg"),Ic=A2("%"),cr=A2("px"),_le=A2("vh"),Fle=A2("vw"),gW=(()=>({...Ic,parse:e=>Ic.parse(e)/100,transform:e=>Ic.transform(e*100)}))();var L0={test:GN("hsl","hue"),parse:hW("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Ic.transform(A0(t))+", "+Ic.transform(A0(r))+", "+A0(Oy.transform(n))+")"};var ei={test:e=>Bg.test(e)||T2.test(e)||L0.test(e),parse:e=>Bg.test(e)?Bg.parse(e):L0.test(e)?L0.parse(e):T2.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Bg.transform(e):L0.transform(e),getAnimatableNone:e=>{let t=ei.parse(e);return t.alpha=0,ei.transform(t)}};var s7e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function UJt(e){return isNaN(e)&&typeof e=="string"&&(e.match(WN)?.length||0)+(e.match(s7e)?.length||0)>0}var c7e="number",u7e="color",HJt="var",jJt="var(",l7e="${}",qJt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function E0(e){let t=e.toString(),r=[],n={color:[],number:[],var:[]},o=[],a=0,s=t.replace(qJt,l=>(ei.test(l)?(n.color.push(a),o.push(u7e),r.push(ei.parse(l))):l.startsWith(jJt)?(n.var.push(a),o.push(HJt),r.push(l)):(n.number.push(a),o.push(c7e),r.push(parseFloat(l))),++a,l7e)).split(l7e);return{values:r,split:s,indexes:n,types:o}}function d7e(e){return E0(e).values}function f7e(e){let{split:t,types:r}=E0(e),n=t.length;return o=>{let a="";for(let i=0;i<n;i++)if(a+=t[i],o[i]!==void 0){let s=r[i];s===c7e?a+=A0(o[i]):s===u7e?a+=ei.transform(o[i]):a+=o[i]}return a}}var $Jt=e=>typeof e=="number"?0:ei.test(e)?ei.getAnimatableNone(e):e;function WJt(e){let t=d7e(e);return f7e(e)(t.map($Jt))}var Rc={test:UJt,parse:d7e,createTransformer:f7e,getAnimatableNone:WJt};function Ble(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function p7e({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let o=0,a=0,i=0;if(!t)o=a=i=r;else{let s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;o=Ble(l,s,e+1/3),a=Ble(l,s,e),i=Ble(l,s,e-1/3)}return{red:Math.round(o*255),green:Math.round(a*255),blue:Math.round(i*255),alpha:n}}function KN(e,t){return r=>r>0?t:e}var Cn=(e,t,r)=>e+(t-e)*r;var Vle=(e,t,r)=>{let n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},GJt=[T2,Bg,L0],KJt=e=>GJt.find(t=>t.test(e));function m7e(e){let t=KJt(e);if(Ey(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===L0&&(r=p7e(r)),r}var zle=(e,t)=>{let r=m7e(e),n=m7e(t);if(!r||!n)return KN(e,t);let o={...r};return a=>(o.red=Vle(r.red,n.red,a),o.green=Vle(r.green,n.green,a),o.blue=Vle(r.blue,n.blue,a),o.alpha=Cn(r.alpha,n.alpha,a),Bg.transform(o))};var vW=new Set(["none","hidden"]);function h7e(e,t){return vW.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function XJt(e,t){return r=>Cn(e,t,r)}function yW(e){return typeof e=="number"?XJt:typeof e=="string"?e1(e)?KN:ei.test(e)?zle:ZJt:Array.isArray(e)?g7e:typeof e=="object"?ei.test(e)?zle:YJt:KN}function g7e(e,t){let r=[...e],n=r.length,o=e.map((a,i)=>yW(a)(a,t[i]));return a=>{for(let i=0;i<n;i++)r[i]=o[i](a);return r}}function YJt(e,t){let r={...e,...t},n={};for(let o in r)e[o]!==void 0&&t[o]!==void 0&&(n[o]=yW(e[o])(e[o],t[o]));return o=>{for(let a in n)r[a]=n[a](o);return r}}function QJt(e,t){let r=[],n={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){let a=t.types[o],i=e.indexes[a][n[a]],s=e.values[i]??0;r[o]=s,n[a]++}return r}var ZJt=(e,t)=>{let r=Rc.createTransformer(t),n=E0(e),o=E0(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?vW.has(e)&&!o.values.length||vW.has(t)&&!n.values.length?h7e(e,t):Qm(g7e(QJt(n,o),o.values),r):(Ey(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),KN(e,t))};function xW(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?Cn(e,t,r):yW(e)(e,t)}var v7e=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>rn.update(t,r),stop:()=>Pc(t),now:()=>zi.isProcessing?zi.timestamp:Ui.now()}};var bW=(e,t,r=10)=>{let n="",o=Math.max(Math.round(t/r),2);for(let a=0;a<o;a++)n+=Math.round(e(a/(o-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`};function XN(e){let t=0,r=50,n=e.next(t);for(;!n.done&&t<2e4;)t+=r,n=e.next(t);return t>=2e4?1/0:t}function L2(e,t=100,r){let n=r({...e,keyframes:[0,t]}),o=Math.min(XN(n),2e4);return{type:"keyframes",ease:a=>n.next(o*a).value/t,duration:$l(o)}}var JJt=5;function wW(e,t,r){let n=Math.max(t-JJt,0);return v2(r-e(n),t-n)}var _a={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Hle=.001;function y7e({duration:e=_a.duration,bounce:t=_a.bounce,velocity:r=_a.velocity,mass:n=_a.mass}){let o,a;Ey(e<=es(_a.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=yl(_a.minDamping,_a.maxDamping,i),e=yl(_a.minDuration,_a.maxDuration,$l(e)),i<1?(o=c=>{let u=c*i,d=u*e,f=u-r,p=CW(c,i),m=Math.exp(-d);return Hle-f/p*m},a=c=>{let d=c*i*e,f=d*r+r,p=Math.pow(i,2)*Math.pow(c,2)*e,m=Math.exp(-d),h=CW(Math.pow(c,2),i);return(-o(c)+Hle>0?-1:1)*((f-p)*m)/h}):(o=c=>{let u=Math.exp(-c*e),d=(c-r)*e+1;return-Hle+u*d},a=c=>{let u=Math.exp(-c*e),d=(r-c)*(e*e);return u*d});let s=5/e,l=ter(o,a,s);if(e=es(e),isNaN(l))return{stiffness:_a.stiffness,damping:_a.damping,duration:e};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:i*2*Math.sqrt(n*c),duration:e}}}var eer=12;function ter(e,t,r){let n=r;for(let o=1;o<eer;o++)n=n-e(n)/t(n);return n}function CW(e,t){return e*Math.sqrt(1-t*t)}var rer=["duration","bounce"],ner=["stiffness","damping","mass"];function x7e(e,t){return t.some(r=>e[r]!==void 0)}function oer(e){let t={velocity:_a.velocity,stiffness:_a.stiffness,damping:_a.damping,mass:_a.mass,isResolvedFromDuration:!1,...e};if(!x7e(e,ner)&&x7e(e,rer))if(e.visualDuration){let r=e.visualDuration,n=2*Math.PI/(r*1.2),o=n*n,a=2*yl(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:_a.mass,stiffness:o,damping:a}}else{let r=y7e(e);t={...t,...r,mass:_a.mass},t.isResolvedFromDuration=!0}return t}function _y(e=_a.visualDuration,t=_a.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:n,restDelta:o}=r,a=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=oer({...r,velocity:-$l(r.velocity||0)}),m=f||0,h=c/(2*Math.sqrt(l*u)),g=i-a,v=$l(Math.sqrt(l/u)),y=Math.abs(g)<5;n||(n=y?_a.restSpeed.granular:_a.restSpeed.default),o||(o=y?_a.restDelta.granular:_a.restDelta.default);let x;if(h<1){let b=CW(v,h);x=w=>{let S=Math.exp(-h*v*w);return i-S*((m+h*v*g)/b*Math.sin(b*w)+g*Math.cos(b*w))}}else if(h===1)x=b=>i-Math.exp(-v*b)*(g+(m+v*g)*b);else{let b=v*Math.sqrt(h*h-1);x=w=>{let S=Math.exp(-h*v*w),P=Math.min(b*w,300);return i-S*((m+h*v*g)*Math.sinh(P)+b*g*Math.cosh(P))/b}}let C={calculatedDuration:p&&d||null,next:b=>{let w=x(b);if(p)s.done=b>=d;else{let S=b===0?m:0;h<1&&(S=b===0?es(m):wW(x,b,w));let P=Math.abs(S)<=n,N=Math.abs(i-w)<=o;s.done=P&&N}return s.value=s.done?i:w,s},toString:()=>{let b=Math.min(XN(C),2e4),w=bW(S=>C.next(b*S).value,b,30);return b+"ms "+w},toTransition:()=>{}};return C}_y.applyToOptions=e=>{let t=L2(e,100,_y);return e.ease=t.ease,e.duration=es(t.duration),e.type="keyframes",e};function E2({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=P=>s!==void 0&&P<s||l!==void 0&&P>l,m=P=>s===void 0?l:l===void 0||Math.abs(s-P)<Math.abs(l-P)?s:l,h=r*t,g=d+h,v=i===void 0?g:i(g);v!==g&&(h=v-d);let y=P=>-h*Math.exp(-P/n),x=P=>v+y(P),C=P=>{let N=y(P),O=x(P);f.done=Math.abs(N)<=c,f.value=f.done?v:O},b,w,S=P=>{p(f.value)&&(b=P,w=_y({keyframes:[f.value,m(f.value)],velocity:wW(x,P,f.value),damping:o,stiffness:a,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:P=>{let N=!1;return!w&&b===void 0&&(N=!0,C(P),S(P)),b!==void 0&&P>=b?w.next(P-b):(!N&&C(P),f)}}}function aer(e,t,r){let n=[],o=r||Sc.mix||xW,a=e.length-1;for(let i=0;i<a;i++){let s=o(e[i],e[i+1]);if(t){let l=Array.isArray(t)?t[i]||bi:t;s=Qm(l,s)}n.push(s)}return n}function SW(e,t,{clamp:r=!0,ease:n,mixer:o}={}){let a=e.length;if(ql(a===t.length,"Both input and output ranges must be the same length","range-length"),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=aer(t,n,o),l=s.length,c=u=>{if(i&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);let f=Fp(e[d],e[d+1],u);return s[d](f)};return r?u=>c(yl(e[0],e[a-1],u)):c}function D2(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let o=Fp(0,t,n);e.push(Cn(r,1,o))}}function O2(e){let t=[0];return D2(t,e.length-1),t}function b7e(e,t){return e.map(r=>r*t)}function ier(e,t){return e.map(()=>t||S2).splice(0,e.length-1)}function t1({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let o=P2(n)?n.map(fW):fW(n),a={done:!1,value:t[0]},i=b7e(r&&r.length===t.length?r:O2(t),e),s=SW(i,t,{ease:Array.isArray(o)?o:ier(t,o)});return{calculatedDuration:e,next:l=>(a.value=s(l),a.done=l>=e,a)}}var ser=e=>e!==null;function YN(e,{repeat:t,repeatType:r="loop"},n,o=1){let a=e.filter(ser),s=o<0||t&&r!=="loop"&&t%2===1?0:a.length-1;return!s||n===void 0?a[s]:n}var ler={decay:E2,inertia:E2,tween:t1,keyframes:t1,spring:_y};function PW(e){typeof e.type=="string"&&(e.type=ler[e.type])}var D0=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}};var cer=e=>e/100,Fy=class extends D0{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:r}=this.options;r&&r.updatedAt!==Ui.now()&&this.tick(Ui.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},Zm.mainThread++,this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;PW(t);let{type:r=t1,repeat:n=0,repeatDelay:o=0,repeatType:a,velocity:i=0}=t,{keyframes:s}=t,l=r||t1;l!==t1&&typeof s[0]!="number"&&(this.mixKeyframes=Qm(cer,xW(s[0],s[1])),s=[0,100]);let c=l({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-i})),c.calculatedDuration===null&&(c.calculatedDuration=XN(c));let{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(n+1)-o,this.generator=c}updateTime(t){let r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){let{generator:n,totalDuration:o,mixKeyframes:a,mirroredGenerator:i,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:p,type:m,onUpdate:h,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);let v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let x=this.currentTime,C=n;if(d){let P=Math.min(this.currentTime,o)/s,N=Math.floor(P),O=P%1;!O&&P>=1&&(O=1),O===1&&N--,N=Math.min(N,d+1),!!(N%2)&&(f==="reverse"?(O=1-O,p&&(O-=p/s)):f==="mirror"&&(C=i)),x=yl(0,1,O)*s}let b=y?{done:!1,value:u[0]}:C.next(x);a&&(b.value=a(b.value));let{done:w}=b;!y&&l!==null&&(w=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);let S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return S&&m!==E2&&(b.value=YN(u,this.options,g,this.speed)),h&&h(b.value),S&&this.finish(),b}then(t,r){return this.finished.then(t,r)}get duration(){return $l(this.calculatedDuration)}get time(){return $l(this.currentTime)}set time(t){t=es(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ui.now());let r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=$l(this.currentTime))}play(){if(this.isStopped)return;let{driver:t=v7e,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();let n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ui.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,Zm.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}};function w7e(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var r1=e=>e*180/Math.PI,jle=e=>{let t=r1(Math.atan2(e[1],e[0]));return qle(t)},uer={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:jle,rotateZ:jle,skewX:e=>r1(Math.atan(e[1])),skewY:e=>r1(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},qle=e=>(e=e%360,e<0&&(e+=360),e),C7e=jle,S7e=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),P7e=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),der={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:S7e,scaleY:P7e,scale:e=>(S7e(e)+P7e(e))/2,rotateX:e=>qle(r1(Math.atan2(e[6],e[5]))),rotateY:e=>qle(r1(Math.atan2(-e[2],e[0]))),rotateZ:C7e,rotate:C7e,skewX:e=>r1(Math.atan(e[4])),skewY:e=>r1(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function _2(e){return e.includes("scale")?1:0}function F2(e,t){if(!e||e==="none")return _2(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),n,o;if(r)n=der,o=r;else{let s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=uer,o=s}if(!o)return _2(t);let a=n[t],i=o[1].split(",").map(fer);return typeof a=="function"?a(i):i[a]}var $le=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return F2(r,t)};function fer(e){return parseFloat(e.trim())}var eh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xf=(()=>new Set(eh))();var Wle=e=>e===Fg||e===cr,per=new Set(["x","y","z"]),mer=eh.filter(e=>!per.has(e));function I7e(e){let t=[];return mer.forEach(r=>{let n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}var O0={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>F2(t,"x"),y:(e,{transform:t})=>F2(t,"y")};O0.translateX=O0.x;O0.translateY=O0.y;var n1=new Set,Gle=!1,Kle=!1,Xle=!1;function R7e(){if(Kle){let e=Array.from(n1).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{let o=I7e(n);o.length&&(r.set(n,o),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();let o=r.get(n);o&&o.forEach(([a,i])=>{n.getValue(a)?.set(i)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Kle=!1,Gle=!1,n1.forEach(e=>e.complete(Xle)),n1.clear()}function k7e(){n1.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Kle=!0)})}function Yle(){Xle=!0,k7e(),R7e(),Xle=!1}var By=class{constructor(t,r,n,o,a,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=o,this.element=a,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(n1.add(this),Gle||(Gle=!0,rn.read(k7e),rn.resolveKeyframes(R7e))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:n,motionValue:o}=this;if(t[0]===null){let a=o?.get(),i=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&r){let s=n.readValue(r,i);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=i),o&&a===void 0&&o.set(t[0])}w7e(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),n1.delete(this)}cancel(){this.state==="scheduled"&&(n1.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var N7e=e=>e.startsWith("--");function M7e(e,t,r){N7e(t)?e.style.setProperty(t,r):e.style[t]=r}var T7e=ZS(()=>window.ScrollTimeline!==void 0);var A7e={};function L7e(e,t){let r=ZS(e);return()=>A7e[t]??r()}var IW=L7e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var o1=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;var Qle={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:o1([0,.65,.55,1]),circOut:o1([.55,0,1,.45]),backIn:o1([.31,.01,.66,-.59]),backOut:o1([.33,1.53,.69,.99])};function Zle(e,t){if(e)return typeof e=="function"?IW()?bW(e,t):"ease-out":R2(e)?o1(e):Array.isArray(e)?e.map(r=>Zle(r,t)||Qle.easeOut):Qle[e]}function E7e(e,t,r,{delay:n=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeOut",times:l}={},c=void 0){let u={[t]:r};l&&(u.offset=l);let d=Zle(s,o);Array.isArray(d)&&(u.easing=d),dd.value&&Zm.waapi++;let f={delay:n,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:i==="reverse"?"alternate":"normal"};c&&(f.pseudoElement=c);let p=e.animate(u,f);return dd.value&&p.finished.finally(()=>{Zm.waapi--}),p}function a1(e){return typeof e=="function"&&"applyToOptions"in e}function D7e({type:e,...t}){return a1(e)&&IW()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}var RW=class extends D0{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;let{element:r,name:n,keyframes:o,pseudoElement:a,allowFlatten:i=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=i,this.options=t,ql(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let c=D7e(t);this.animation=E7e(r,n,o,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){let u=YN(o,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(u):M7e(r,n,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){let t=this.animation.effect?.getComputedTiming?.().duration||0;return $l(Number(t))}get time(){return $l(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=es(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&T7e()?(this.animation.timeline=t,bi):r(this)}};var O7e={anticipate:x2,backInOut:y2,circInOut:C2};function her(e){return e in O7e}function _7e(e){typeof e.ease=="string"&&her(e.ease)&&(e.ease=O7e[e.ease])}var F7e=10,kW=class extends RW{constructor(t){_7e(t),PW(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:r,onUpdate:n,onComplete:o,element:a,...i}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}let s=new Fy({...i,autoplay:!1}),l=es(this.finishedTime??this.time);r.setWithVelocity(s.sample(l-F7e).value,s.sample(l).value,F7e),s.stop()}};var Jle=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Rc.test(e)||e==="0")&&!e.startsWith("url("));function ger(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function B7e(e,t,r,n){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let a=e[e.length-1],i=Jle(o,t),s=Jle(a,t);return Ey(i===s,`You are trying to animate ${t} from "${o}" to "${a}". "${i?a:o}" is not an animatable value.`,"value-not-animatable"),!i||!s?!1:ger(e)||(r==="spring"||a1(r))&&n}function QN(e){e.duration=0,e.type}var ver=new Set(["opacity","clipPath","filter","transform"]),yer=ZS(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function V7e(e){let{motionValue:t,name:r,repeatDelay:n,repeatType:o,damping:a,type:i}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:c}=t.owner.getProps();return yer()&&r&&ver.has(r)&&(r!=="transform"||!c)&&!l&&!n&&o!=="mirror"&&a!==0&&i!=="inertia"}var xer=40,B2=class extends D0{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:i="loop",keyframes:s,name:l,motionValue:c,element:u,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ui.now();let f={autoplay:t,delay:r,type:n,repeat:o,repeatDelay:a,repeatType:i,name:l,motionValue:c,element:u,...d},p=u?.KeyframeResolver||By;this.keyframeResolver=new p(s,(m,h,g)=>this.onKeyframesResolved(m,h,f,!g),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,r,n,o){this.keyframeResolver=void 0;let{name:a,type:i,velocity:s,delay:l,isHandoff:c,onUpdate:u}=n;this.resolvedAt=Ui.now(),B7e(t,a,i,s)||((Sc.instantAnimations||!l)&&u?.(YN(t,n,r)),t[0]=t[t.length-1],QN(n),n.repeat=0);let f={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>xer?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},p=!c&&V7e(f)?new kW({...f,element:f.motionValue.owner.current}):new Fy(f);p.finished.then(()=>this.notifyFinished()).catch(bi),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Yle()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};var NW=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,r){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=r}attachTimeline(t){let r=this.animations.map(n=>n.attachTimeline(t));return()=>{r.forEach((n,o)=>{n&&n(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let r=0;r<this.animations.length;r++)t=Math.max(t,this.animations[r].duration);return t}runAll(t){this.animations.forEach(r=>r[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var V2=class extends NW{then(t,r){return this.finished.finally(t).then(()=>{})}};var ber=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wer(e){let t=ber.exec(e);if(!t)return[,];let[,r,n,o]=t;return[`--${r??n}`,o]}var Cer=4;function ece(e,t,r=1){ql(r<=Cer,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,o]=wer(e);if(!n)return;let a=window.getComputedStyle(t).getPropertyValue(n);if(a){let i=a.trim();return m2(i)?parseFloat(i):i}return e1(o)?ece(o,t,r+1):o}function i1(e,t){return e?.[t]??e?.default??e}var z2=new Set(["width","height","top","left","right","bottom",...eh]);var z7e={test:e=>e==="auto",parse:e=>e};var MW=e=>t=>t.test(e);var tce=[Fg,cr,Ic,Jm,Fle,_le,z7e],rce=e=>tce.find(MW(e));function U7e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||g2(e):!0}var Ser=new Set(["brightness","contrast","saturate","opacity"]);function Per(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[n]=r.match(WN)||[];if(!n)return e;let o=r.replace(n,""),a=Ser.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}var Ier=/\b([a-z-]*)\(.*?\)/gu,U2={...Rc,getAnimatableNone:e=>{let t=e.match(Ier);return t?t.map(Per).join(" "):e}};var nce={...Fg,transform:Math.round};var H7e={rotate:Jm,rotateX:Jm,rotateY:Jm,rotateZ:Jm,scale:M2,scaleX:M2,scaleY:M2,scaleZ:M2,skew:Jm,skewX:Jm,skewY:Jm,distance:cr,translateX:cr,translateY:cr,translateZ:cr,x:cr,y:cr,z:cr,perspective:cr,transformPerspective:cr,opacity:Oy,originX:gW,originY:gW,originZ:cr};var s1={borderWidth:cr,borderTopWidth:cr,borderRightWidth:cr,borderBottomWidth:cr,borderLeftWidth:cr,borderRadius:cr,radius:cr,borderTopLeftRadius:cr,borderTopRightRadius:cr,borderBottomRightRadius:cr,borderBottomLeftRadius:cr,width:cr,maxWidth:cr,height:cr,maxHeight:cr,top:cr,right:cr,bottom:cr,left:cr,padding:cr,paddingTop:cr,paddingRight:cr,paddingBottom:cr,paddingLeft:cr,margin:cr,marginTop:cr,marginRight:cr,marginBottom:cr,marginLeft:cr,backgroundPositionX:cr,backgroundPositionY:cr,...H7e,zIndex:nce,fillOpacity:Oy,strokeOpacity:Oy,numOctaves:nce};var j7e={...s1,color:ei,backgroundColor:ei,outlineColor:ei,fill:ei,stroke:ei,borderColor:ei,borderTopColor:ei,borderRightColor:ei,borderBottomColor:ei,borderLeftColor:ei,filter:U2,WebkitFilter:U2},H2=e=>j7e[e];function j2(e,t){let r=H2(e);return r!==U2&&(r=Rc),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var Rer=new Set(["auto","none","0"]);function q7e(e,t,r){let n=0,o;for(;n<e.length&&!o;){let a=e[n];typeof a=="string"&&!Rer.has(a)&&E0(a).values.length&&(o=e[n]),n++}if(o&&r)for(let a of t)e[a]=j2(r,o)}var q2=class extends By{constructor(t,r,n,o,a){super(t,r,n,o,a,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),e1(c))){let u=ece(c,r.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!z2.has(n)||t.length!==2)return;let[o,a]=t,i=rce(o),s=rce(a);if(i!==s)if(Wle(i)&&Wle(s))for(let l=0;l<t.length;l++){let c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else O0[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,n=[];for(let o=0;o<t.length;o++)(t[o]===null||U7e(t[o]))&&n.push(o);n.length&&q7e(t,n,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=O0[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let o=r[r.length-1];o!==void 0&&t.getValue(n,o).jump(o,!1)}measureEndState(){let{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;let o=t.getValue(r);o&&o.jump(this.measuredOrigin,!1);let a=n.length-1,i=n[a];n[a]=O0[r](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,l])=>{t.getValue(s).set(l)}),this.resolveNoneKeyframes()}};function $2(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;t&&(n=t.current);let o=r?.[e]??n.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}var W2=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function G2(e){return h2(e)&&"offsetHeight"in e}var $7e=30,ker=e=>!isNaN(parseFloat(e)),l1={current:void 0},TW=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{let o=Ui.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Ui.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ker(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Dy);let n=this.events[t].add(r);return t==="change"?()=>{n(),rn.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return l1.current&&l1.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=Ui.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>$7e)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,$7e);return v2(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function fd(e,t){return new TW(e,t)}var{schedule:c1,cancel:Ner}=pW(queueMicrotask,!1);var Bp={x:!1,y:!1};function AW(){return Bp.x||Bp.y}function oce(e){return e==="x"||e==="y"?Bp[e]?null:(Bp[e]=!0,()=>{Bp[e]=!1}):Bp.x||Bp.y?null:(Bp.x=Bp.y=!0,()=>{Bp.x=Bp.y=!1})}function LW(e,t){let r=$2(e),n=new AbortController,o={passive:!0,...t,signal:n.signal};return[r,o,()=>n.abort()]}function W7e(e){return!(e.pointerType==="touch"||AW())}function ace(e,t,r={}){let[n,o,a]=LW(e,r),i=s=>{if(!W7e(s))return;let{target:l}=s,c=t(l,s);if(typeof c!="function"||!l)return;let u=d=>{W7e(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return n.forEach(s=>{s.addEventListener("pointerenter",i,o)}),a}var ice=(e,t)=>t?e===t?!0:ice(e,t.parentElement):!1;var u1=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var Mer=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function G7e(e){return Mer.has(e.tagName)||e.tabIndex!==-1}var ZN=new WeakSet;function K7e(e){return t=>{t.key==="Enter"&&e(t)}}function sce(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var X7e=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=K7e(()=>{if(ZN.has(r))return;sce(r,"down");let o=K7e(()=>{sce(r,"up")}),a=()=>sce(r,"cancel");r.addEventListener("keyup",o,t),r.addEventListener("blur",a,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function Y7e(e){return u1(e)&&!AW()}function lce(e,t,r={}){let[n,o,a]=LW(e,r),i=s=>{let l=s.currentTarget;if(!Y7e(s))return;ZN.add(l);let c=t(l,s),u=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),ZN.has(l)&&ZN.delete(l),Y7e(p)&&typeof c=="function"&&c(p,{success:m})},d=p=>{u(p,l===window||l===document||r.useGlobalTarget||ice(l,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return n.forEach(s=>{(r.useGlobalTarget?window:s).addEventListener("pointerdown",i,o),G2(s)&&(s.addEventListener("focus",c=>X7e(c,o)),!G7e(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),a}function d1(e){return h2(e)&&"ownerSVGElement"in e}function K2(e){return d1(e)&&e.tagName==="svg"}function cce(...e){let t=!Array.isArray(e[0]),r=t?0:-1,n=e[0+r],o=e[1+r],a=e[2+r],i=e[3+r],s=SW(o,a,i);return t?s(n):s}var ho=e=>!!(e&&e.getVelocity);var Ter=[...tce,ei,Rc],uce=e=>Ter.find(MW(e));var EW=E(it(),1),Vy=E(it(),1);var Q7e=E(it(),1),_0=(0,Q7e.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var dce=class extends EW.Component{getSnapshotBeforeUpdate(t){let r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){let n=r.offsetParent,o=G2(n)&&n.offsetWidth||0,a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft,a.right=o-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}};function J7e({children:e,isPresent:t,anchorX:r,root:n}){let o=(0,Vy.useId)(),a=(0,Vy.useRef)(null),i=(0,Vy.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=(0,Vy.useContext)(_0);return(0,Vy.useInsertionEffect)(()=>{let{width:l,height:c,top:u,left:d,right:f}=i.current;if(t||!a.current||!l||!c)return;let p=r==="left"?`left: ${d}`:`right: ${f}`;a.current.dataset.motionPopId=o;let m=document.createElement("style");s&&(m.nonce=s);let h=n??document.head;return h.appendChild(m),m.sheet&&m.sheet.insertRule(`
|