@app-studio/web 0.9.93 → 0.9.96

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/web.cjs.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("react"),c=require("app-studio"),wr=require("lucide-react/dynamicIconImports"),jt=require("zustand"),Xa=require("react-router-dom"),Ka=require("react-dom"),be=require("formik"),Ct=(e="id")=>`${e}-${Math.random().toString(36).substring(2,9)}`,Qa=({type:e="single",value:o,defaultValue:t,onValueChange:n,collapsible:i=!1})=>{const a=o!==void 0,l=o??t,d=()=>e==="multiple"?Array.isArray(l)?l:l?[l]:[]:Array.isArray(l)?l[0]:l,[s,g]=u.useState(d()),p=u.useMemo(()=>Ct("accordion"),[]),m=a?o:s,h=u.useMemo(()=>m===void 0?[]:Array.isArray(m)?m:[m],[m]);u.useEffect(()=>{a&&(e==="multiple"&&!Array.isArray(o)?(console.warn('Accordion with type="multiple" received non-array value:',o),g(o?[String(o)]:[])):e==="single"&&Array.isArray(o)?(console.warn('Accordion with type="single" received array value:',o),g(o.length>0?o[0]:void 0)):g(o))},[o,a,e]);const f=u.useCallback(y=>{let b;if(e==="single")m===y&&i?b=void 0:m!==y?b=y:b=m;else{const k=Array.isArray(m)?m:[];k.includes(y)?b=k.filter(C=>C!==y):b=[...k,y],Array.isArray(b)&&b.length===0&&(b=[])}a||g(b),n&&n(b)},[e,m,i,a,n]),x=u.useCallback(y=>h.includes(y),[h]);return{expandedItems:h,toggleItem:f,isItemExpanded:x,type:e,collapsible:i,baseId:p}},Za={square:{borderRadius:0},rounded:{borderRadius:8}},Ja={default:{backgroundColor:"transparent",borderWidth:0,transition:"background-color 0.15s ease"},outline:{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",transition:"border-color 0.15s ease, background-color 0.15s ease",_hover:{borderColor:"color-gray-300"}},filled:{backgroundColor:"color-gray-50",transition:"background-color 0.15s ease",_hover:{backgroundColor:"color-gray-100"}}},Ir=u.createContext({expandedItems:[],toggleItem:()=>{},isItemExpanded:()=>!1,type:"single",collapsible:!1,baseId:""}),ei=({children:e,value:o})=>r.jsx(Ir.Provider,{value:o,children:e}),Tr=()=>{const e=u.useContext(Ir);if(!e)throw new Error("useAccordionContext must be used within an AccordionProvider");return e},oi=({value:e,children:o,isDisabled:t=!1,views:n,...i})=>{const{isItemExpanded:a,baseId:l}=Tr(),d=a(e),s=`${l}-trigger-${e}`,g=`${l}-content-${e}`;return r.jsx(c.View,{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",marginBottom:8,overflow:"hidden",opacity:t?.5:1,pointerEvents:t?"none":"auto","data-state":d?"open":"closed","data-disabled":t?"":void 0,...n==null?void 0:n.item,...i,children:u.Children.map(o,p=>u.isValidElement(p)?u.cloneElement(p,{...p.props,value:e,isExpanded:d,isDisabled:t,triggerId:s,contentId:g}):p)})},ti=({children:e,value:o,isExpanded:t,isDisabled:n,triggerId:i,contentId:a,views:l,asChild:d=!1,...s})=>{const{toggleItem:g}=Tr(),m={id:i,"aria-expanded":t,"aria-controls":a,"aria-disabled":n,"data-state":t?"open":"closed","data-disabled":n?"":void 0,onClick:()=>{o&&!n&&g(o)},padding:16,cursor:n?"not-allowed":"pointer",alignItems:"center",justifyContent:"space-between",backgroundColor:"color-white",width:"100%",...l==null?void 0:l.container,...s};if(d&&u.isValidElement(e)){const h=u.Children.only(e);return u.cloneElement(h,{...m,...h.props})}return r.jsxs(c.Horizontal,{...m,children:[e,r.jsx(c.View,{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",transform:t?"rotate(180deg)":"rotate(0deg)",...l==null?void 0:l.icon,children:r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z",fill:"currentColor"})})})]})},ri=({children:e,isExpanded:o,isDisabled:t,triggerId:n,contentId:i,views:a,...l})=>o?r.jsx(c.View,{id:i,role:"region","aria-labelledby":n,padding:16,backgroundColor:"color-white",maxHeight:o?"1000px":"0",transition:"max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",opacity:1,overflow:"hidden","data-state":o?"open":"closed","data-disabled":t?"":void 0,...a==null?void 0:a.container,...l,children:e}):null,ni=({children:e,shape:o="rounded",variant:t="default",views:n,baseId:i,type:a,collapsible:l,themeMode:d,...s})=>r.jsx(c.Vertical,{width:"100%","data-orientation":"vertical",...Za[o],...Ja[t],...n==null?void 0:n.container,...s,children:e}),ai=({children:e,type:o="single",value:t,defaultValue:n,onValueChange:i,collapsible:a=!1,shape:l="rounded",variant:d="default",views:s,...g})=>{const p=Array.isArray(n)?n:n?[n]:void 0,m=Qa({type:o,value:t,defaultValue:n??p,onValueChange:i,collapsible:a});return r.jsx(ei,{value:{expandedItems:m.expandedItems,toggleItem:m.toggleItem,isItemExpanded:m.isItemExpanded,type:m.type,collapsible:m.collapsible,baseId:m.baseId},children:r.jsx(ni,{shape:l,variant:d,views:s,baseId:m.baseId,type:m.type,collapsible:m.collapsible,...g,children:e})})},Do=ai;Do.Item=oi;Do.Trigger=ti;Do.Content=ri;const tt=new Map,ii=e=>(tt.has(e)||tt.set(e,u.lazy(wr[e])),tt.get(e)),rt=u.memo(({widthHeight:e,color:o="currentColor",transform:t,orientation:n="up",children:i,...a})=>r.jsx(c.Center,{widthHeight:e,lineHeight:e,color:o,display:"flex",transform:t||(n==="left"?"rotate(-90deg)":n==="right"?"rotate(90deg)":n==="up"?"rotate(0deg)":n==="down"?"rotate(180deg)":"none"),...a,children:i})),Eo=u.memo(({name:e="circle",widthHeight:o=24,color:t="currentColor",filled:n=!1,strokeWidth:i=1,size:a,children:l,fallback:d,...s})=>{const{getColor:g}=c.useTheme(),p=a||o,m=u.useMemo(()=>{const x=g(t);return{fill:n?x:"none",stroke:x,strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round"}},[n,t,i,g]);if(!e)return r.jsx(rt,{widthHeight:o,color:t,...s,children:l});const h=e.toLowerCase().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if(!(h in wr))return r.jsx(rt,{widthHeight:p,color:t,...s,children:d||l});const f=ii(h);return r.jsx(rt,{widthHeight:p,color:t,...s,children:r.jsx(u.Suspense,{fallback:d||null,children:r.jsx(f,{size:p,...m})})})}),q=(e,o={})=>{const t=n=>r.jsx(Eo,{name:e,...o,...n});return t.displayName=`${e}Icon`,t},li=q("user",{filled:!1}),ci=q("circle-help",{filled:!1}),si=q("folder",{filled:!1}),ae=q("chevron-up",{filled:!1}),di=q("grip-vertical",{filled:!1}),go=q("file",{filled:!1}),ui=q("video",{filled:!1}),gi=q("image",{filled:!1}),Fo=q("volume",{filled:!1}),pi=q("twitter",{filled:!1}),mi=q("x",{filled:!1}),hi=q("twitch",{filled:!1}),fe=q("x",{filled:!1,strokeWidth:2}),fi=q("instagram",{filled:!1}),xi=q("youtube",{filled:!1}),bi=q("facebook",{filled:!1}),yi=q("linkedin",{filled:!1}),ki=q("at-sign",{filled:!1}),Mr=q("minus",{filled:!1}),ze=q("info",{filled:!1}),St=q("play",{filled:!1}),zr=q("pause",{filled:!1}),ji=q("heart",{filled:!1}),Ci=q("star",{filled:!1}),Si=q("save",{filled:!1}),wt=q("triangle-alert",{filled:!1}),wi=q("battery",{filled:!1}),Ii=q("bookmark",{filled:!1}),Ti=q("cloud",{filled:!1}),Mi=q("copy",{filled:!1}),Oo=q("trash",{filled:!1}),zi=Oo,Ri=q("edit",{filled:!1}),It=q("mic",{filled:!1}),qo=q("square",{filled:!1}),Tt=q("send",{filled:!1}),Mt=q("loader",{filled:!1}),po=q("paperclip",{filled:!1}),Po=q("search",{filled:!1}),Vi=q("home",{filled:!1}),Rr=q("settings",{filled:!1}),Ei=q("download",{filled:!1}),Vr=q("share",{filled:!1}),No=q("check",{filled:!1}),Pi=q("plus",{filled:!1}),zt=q("eye-off",{filled:!1}),Rt=q("eye",{filled:!1}),Wi=q("lock",{filled:!1}),_i=q("user",{filled:!1}),Er=q("external-link",{filled:!1}),Vt=q("check-circle",{filled:!1}),Uo=q("alert-circle",{filled:!1}),$i=q("bell",{filled:!1}),Hi=q("file-text",{filled:!1}),Bi=q("bar-chart",{filled:!1}),Li=q("moon",{filled:!1}),Pr=q("panel-left",{filled:!1}),Et=q("upload",{filled:!1}),Ai=No,Di=e=>r.jsx(ae,{orientation:"left",...e}),Fi=q("zoom-out",{filled:!1}),Oi=q("type",{filled:!1}),qi=q("shapes",{filled:!1}),Ni=q("rotate-cw",{filled:!1}),Ui=q("gift",{filled:!1}),Gi=q("shield",{filled:!1}),Yi=q("log-out",{filled:!1}),vi=q("power",{filled:!1}),Xi=q("link",{filled:!1}),Ki=q("layout",{filled:!1}),Qi=q("zap",{filled:!1}),Zi=q("credit-card",{filled:!1}),Ji=q("more-horizontal",{filled:!1}),el=Oo,ol=q("filter",{filled:!1}),tl=q("calendar",{filled:!1}),rl=q("clock",{filled:!1}),nl=q("map-pin",{filled:!1}),al=q("menu",{filled:!1}),il=q("refresh-cw",{filled:!1}),ll=q("printer",{filled:!1}),cl=q("wand",{filled:!1}),sl=q("thumbs-down",{filled:!1}),dl=q("thumbs-up",{filled:!1}),ul=q("camera",{filled:!1}),gl=q("bluetooth",{filled:!1}),pl=q("unlock",{filled:!1}),ml=q("wifi",{filled:!1}),hl=q("arrow-right",{filled:!1}),fl=q("arrow-up",{filled:!1}),xl=q("loader",{filled:!1}),bl=q("sliders-horizontal",{filled:!1}),yl=q("crop",{filled:!1}),kl=q("zoom-in",{filled:!1}),jl=q("grip-horizontal",{filled:!1}),Wr=q("mouse-pointer-2",{filled:!1}),Cl=e=>({default:{container:{backgroundColor:"color-gray-50",borderColor:"color-gray-200",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},content:{color:"color-gray-700"},icon:{color:"color-gray-500"}},info:{container:{backgroundColor:"color-blue-50",borderColor:"color-blue-200",boxShadow:"0 1px 2px rgba(59, 130, 246, 0.05)"},content:{color:"color-blue-700"},icon:{color:"color-blue-500"}},success:{container:{backgroundColor:"color-green-50",borderColor:"color-green-200",boxShadow:"0 1px 2px rgba(34, 197, 94, 0.05)"},content:{color:"color-green-700"},icon:{color:"color-green-500"}},error:{container:{backgroundColor:"color-red-50",borderColor:"color-red-200",boxShadow:"0 1px 2px rgba(239, 68, 68, 0.05)"},content:{color:"color-red-700"},icon:{color:"color-red-500"}},warning:{container:{backgroundColor:"color-orange-50",borderColor:"color-orange-200",boxShadow:"0 1px 2px rgba(249, 115, 22, 0.05)"},content:{color:"color-orange-700"},icon:{color:"color-orange-500"}}}),Sl=u.memo(({icon:e,title:o="",views:t,description:n="",variant:i="default",themeMode:a,children:l,...d})=>{const{themeMode:s}=c.useTheme(),g=a||s,p=u.useMemo(()=>Cl(),[g]),m=()=>{var x;if(e)return e;const f={size:20,color:((x=t==null?void 0:t.icon)==null?void 0:x.color)??p[i].icon.color};switch(i){case"info":return r.jsx(ze,{...f});case"success":return r.jsx(Vt,{...f});case"error":return r.jsx(Uo,{...f});case"warning":default:return r.jsx(wt,{...f})}};return r.jsxs(c.Horizontal,{gap:12,padding:"16px",flexWrap:"nowrap",alignItems:"flex-start",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:p[i].container.borderColor,backgroundColor:p[i].container.backgroundColor,boxShadow:p[i].container.boxShadow,transition:"all 0.2s ease",...t==null?void 0:t.container,...d,children:[r.jsx(c.View,{alignSelf:"flex-start",marginTop:"2px",...t==null?void 0:t.icon,children:m()}),r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsx(c.Text,{fontSize:"16px",fontWeight:"600",lineHeight:"24px",color:p[i].content.color,backgroundColor:p[i].container.backgroundColor,...t==null?void 0:t.title,children:o}),r.jsx(c.Text,{fontSize:"14px",fontWeight:"400",lineHeight:"20px",color:p[i].content.color,backgroundColor:p[i].container.backgroundColor,...t==null?void 0:t.description,children:n||l})]})]})}),wl=e=>r.jsx(Sl,{...e}),Il=wl,Tl=({ratio:e=16/9,children:o,views:t,...n})=>r.jsx(c.Center,{width:"100%",position:"relative",overflow:"hidden",paddingTop:`${1/e*100}%`,borderRadius:8,...n,...t==null?void 0:t.center,children:r.jsx(c.View,{position:"absolute",top:0,right:0,bottom:0,left:0,...t==null?void 0:t.view,children:o})}),Ml=({ratio:e,children:o,...t})=>r.jsx(Tl,{ratio:e,...t,children:o}),zl=Ml;function Rl(e,o,t){return Math.min(Math.max(e,o),t)}const Vl=({bars:e,isPaused:o,...t})=>r.jsx(c.Horizontal,{alignItems:"center",minWidth:100,gap:1,height:32,maxWidth:200,width:"100%",marginTop:4,...t,children:e.map((i,a)=>r.jsx(c.View,{width:2,backgroundColor:o?"color-gray-200":i>=0?"color-gray-900":"color-gray-500",style:{height:`${Rl(i*300,2,32)}px`}},a))}),Pt=({analyserNode:e,isPaused:o,...t})=>{const n=u.useRef(null),i=60,a=32,[l,d]=u.useState([]);return u.useEffect(()=>{if(!e){d(Array(i).fill(-1));return}const s=e.frequencyBinCount,g=new Uint8Array(s),p=()=>{e.getByteTimeDomainData(g);let m=0;for(let f=0;f<s;f++){const x=(g[f]-128)/128;m+=x*x}const h=Math.sqrt(m/s);u.startTransition(()=>{d(f=>{const y=[...f,h].slice(-i);return y.length<i?[...Array(i-y.length).fill(-1),...y]:y})})};return n.current=setInterval(p,a),()=>{n.current&&clearInterval(n.current)}},[e]),r.jsx(Vl,{bars:l,isPaused:o,...t})},Go=jt.create(e=>({visible:!1,title:"",subtitle:"",variant:"info",isClosable:!1,views:{},action:()=>{},actionText:"",showIcon:!1,timeout:3e3,show:(o,t="",n="",i,a,l,d,s,g)=>e({visible:!0,variant:o,title:t,subtitle:n,isClosable:i,views:a,action:l,actionText:d,showIcon:s,timeout:g}),hide:()=>e({visible:!1})})),_r=(e,o,t,n)=>{Go.getState().show(e,o,t,n==null?void 0:n.isClosable,n==null?void 0:n.views,n==null?void 0:n.action,n==null?void 0:n.actionText,n==null?void 0:n.showIcon,n==null?void 0:n.timeout)},$r=()=>{Go.getState().hide()},El={info:{container:{backgroundColor:"color-blue-200",border:"color-blue-400"},icon:{color:"color-blue-500",name:"InformationIcon"},content:{color:"color-blue-500"},close:{color:"color-blue-500",name:"CloseIcon"}},success:{container:{backgroundColor:"color-green-200",border:"color-green-400"},icon:{color:"color-green-500",name:"SuccessIcon"},content:{color:"color-green-500"},close:{color:"color-green-500",name:"CloseIcon"}},error:{container:{backgroundColor:"color-red-200",border:"color-red-400"},icon:{color:"color-red-500",name:"ErrrorIcon"},content:{color:"color-red-500"},close:{color:"color-red-500",name:"CloseIcon"}},warning:{container:{backgroundColor:"color-orange-200",border:"color-orange-400"},icon:{color:"color-orange-500",name:"ErrrorIcon"},content:{color:"color-orange-500"},close:{color:"color-orange-500",name:"CloseIcon"}}},Hr=({variant:e,hide:o,title:t,subtitle:n,theme:i,action:a,actionText:l,showIcon:d=!1,isClosable:s=!1,timeout:g=3e3,views:p})=>{var k,C;u.useEffect(()=>{if(g&&!s){const w=setTimeout(()=>{o()},g);return()=>{clearTimeout(w)}}},[]);const m=i??El,h=!!(a&&l),f={borderWidth:1,borderStyle:"solid",borderRadius:8,borderColor:`${m[e].container.border}`},x={info:"#3b82f6",success:"#4ade80",warning:"#f97316",error:"#ef4444"}[e],y={info:r.jsx(ze,{widthHeight:24,color:x,...p==null?void 0:p.icon}),success:r.jsx(Vt,{widthHeight:24,color:x,...p==null?void 0:p.icon}),warning:r.jsx(wt,{widthHeight:24,color:x,...p==null?void 0:p.icon}),error:r.jsx(Uo,{widthHeight:24,color:x,...p==null?void 0:p.icon})}[e],b=d&&y;return r.jsxs(c.Horizontal,{role:"messageContent",gap:16,width:400,flexWrap:"nowrap",position:"relative",alignItems:"center",padding:"14px 24px 14px 14px",color:`${m[e].content.color}`,backgroundColor:`${m[e].container.backgroundColor}`,onClick:s?()=>{}:()=>{o()},...f,...p==null?void 0:p.container,children:[b&&y,r.jsxs(c.Vertical,{gap:8,width:"100%",children:[r.jsx(c.Text,{size:"md",weight:"semiBold",...p==null?void 0:p.title,children:t}),n&&r.jsx(c.Text,{size:"sm",...p==null?void 0:p.subtitle,children:n})]}),h&&r.jsx(c.Text,{marginRight:10,onClick:a,padding:"6px 10px",whiteSpace:"nowrap",...f,...p==null?void 0:p.actionText,children:l}),s&&r.jsx(c.View,{position:"absolute",zIndex:1e4,right:8,top:6,onClick:()=>{o()},...(k=p==null?void 0:p.closingIcon)==null?void 0:k.container,children:r.jsx(fe,{widthHeight:18,color:x,...(C=p==null?void 0:p.closingIcon)==null?void 0:C.icon})})]})},Pl=({container:e,theme:o,position:t="topRight"})=>{const{visible:n,title:i,variant:a,subtitle:l,isClosable:d,views:s,action:g,actionText:p,showIcon:m,timeout:h}=Go(),f={topLeft:{top:6,left:8},topRight:{top:6,right:8},bottomLeft:{bottom:8,left:6},bottomRight:{bottom:8,right:6}}[t],x=()=>r.jsx(Hr,{variant:a,subtitle:l,show:n,title:i,theme:o,isClosable:d,views:s,action:g,actionText:p,showIcon:m,timeout:h,hide:()=>$r()}),y=e?u.cloneElement(e,{},x()):r.jsx(c.View,{position:"absolute",zIndex:1e4,...f,children:x()});return n?y:null},Wl=(e,o)=>{const t=document.createElement("video");t.preload="metadata",t.onloadedmetadata=()=>{t.currentTime=1},t.oncanplay=()=>{const n=document.createElement("canvas");n.width=t.videoWidth,n.height=t.videoHeight;const i=n.getContext("2d");if(i){i.drawImage(t,0,0,n.width,n.height);const a=n.toDataURL("image/jpeg");o(a)}URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(e)},_l=({maxSize:e=100*1024*1024,onFileSelect:o,onMultipleFileSelect:t,validateFile:n,thumbnail:i,multiple:a=!1,onError:l=d=>{_r("error","Error",d)}})=>{const d=u.useRef(null),s=u.useRef(null),[g,p]=u.useState(null),[m,h]=u.useState([]),[f,x]=u.useState(null),[y,b]=u.useState(null),[k,C]=u.useState(i||null),w=u.useCallback(S=>{const I=S.target.files;if(x(null),!I||I.length===0){l("No file selected"),x("No file selected");return}if(a){const M=Array.from(I),z=[];for(const E of M){if(E.size>e){l(`File ${E.name} exceeds ${Math.round(e/(1024*1024))}MB.`),x(`File ${E.name} exceeds ${Math.round(e/(1024*1024))}MB.`);continue}if(n){const _=n(E);if(_){l(`${E.name}: ${_}`),x(`${E.name}: ${_}`);continue}}z.push(E)}z.length>0&&(h(z),t&&t(z))}else{const M=I[0];if(M.size>e){l(`File exceeds ${Math.round(e/(1024*1024))}MB.`),x(`File exceeds ${Math.round(e/(1024*1024))}MB.`);return}if(n){const z=n(M);if(z){l(z),x(z);return}}b(URL.createObjectURL(M)),M.type.startsWith("video/")&&Wl(M,C),o&&(p(M),o(M))}},[e,o,t,n,a]),j=()=>{var S;return(S=d.current)==null?void 0:S.click()};return u.useEffect(()=>()=>{y&&URL.revokeObjectURL(y),k&&URL.revokeObjectURL(k)},[y,k]),{previewUrl:y,thumbnailUrl:k,errorMessage:f,fileInputRef:d,videoRef:s,selectedFile:g,selectedFiles:m,handleFileChange:w,handleClick:j}},$l=({accept:e,isLoading:o=!1,progress:t=0,icon:n,text:i,previewUrl:a,thumbnailUrl:l,errorMessage:d,fileInputRef:s,videoRef:g,selectedFile:p,selectedFiles:m,handleFileChange:h,handleClick:f,multiple:x=!1,containerProps:y,errorMessageProps:b,progressProps:k,videoProps:C,imageProps:w,iconProps:j,textProps:S,fileType:I,previewUrl:M,renderError:z=({errorMessage:V,errorMessageProps:W,themeMode:P})=>r.jsx(c.Text,{color:"red",fontSize:12,marginTop:8,...W,...R==null?void 0:R.text,children:V}),renderText:E=({text:V,textProps:W})=>r.jsx(c.Text,{marginTop:8,...W,...R==null?void 0:R.text,children:V}),renderFile:_=({selectedFile:V,textProps:W})=>V?r.jsxs(c.Center,{marginTop:8,gap:10,flexDirection:"column",...R==null?void 0:R.container,children:[r.jsx(c.Text,{maxLines:2,...W,...R==null?void 0:R.text,children:V.name}),r.jsxs(c.Text,{...W,...R==null?void 0:R.text,children:["(",Math.round(V.size/1024)," KB)"]})]}):null,renderVideo:T=({selectedFile:V,videoRef:W,videoProps:P})=>r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...R==null?void 0:R.view,children:r.jsx(c.View,{as:"video",width:"100%",height:"100%",src:V?URL.createObjectURL(V):void 0,style:{objectFit:"cover"},ref:W,...P,...R==null?void 0:R.view})}),renderImage:$=({previewUrl:V,imageProps:W})=>(console.log("Rendering image with URL:",V),r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...R==null?void 0:R.view,children:r.jsx(c.Image,{src:V,alt:"Preview",width:"100%",height:"100%",objectFit:"cover",style:{maxHeight:"100%",maxWidth:"100%"},...W,...R==null?void 0:R.image})})),renderProgress:B=({progress:V,progressProps:W})=>r.jsxs(c.Horizontal,{gap:8,alignItems:"center",...W,...R==null?void 0:R.horizontal,children:[r.jsx(c.View,{height:4,backgroundColor:"rgba(0,0,0,0.1)",width:"100%",borderRadius:2,...R==null?void 0:R.view,children:r.jsx(c.View,{height:4,width:`${V}%`,borderRadius:2,backgroundColor:"color-dark-50",...R==null?void 0:R.view})}),r.jsxs(c.Text,{fontSize:12,...R==null?void 0:R.text,children:[V,"%"]})]}),views:R={}})=>{const V=M||a;return r.jsxs(c.Center,{onClick:f,cursor:"pointer",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,padding:16,flexDirection:"column",overflow:"hidden",position:"relative",height:p&&t===100?"200px":"auto",...y,...R==null?void 0:R.container,children:[t===100&&I==="image"&&V&&$({previewUrl:V,imageProps:w}),t===100&&I==="video"&&l&&T({selectedFile:p,thumbnailUrl:l,videoRef:g,videoProps:C,imageProps:w}),t===100&&I==="file"&&p&&_({selectedFile:p,textProps:S}),t<100&&(n||r.jsx(Et,{widthHeight:32,...j})),!o&&!p&&i&&E({text:i,textProps:S}),o&&B({progress:t,progressProps:k}),!o&&d&&z({errorMessage:d,errorMessageProps:b}),r.jsx(c.View,{as:"input",type:"file",ref:s,onChange:h,accept:e,multiple:x,style:{display:"none"},...R==null?void 0:R.view})]})},Yo=({accept:e="*/*",icon:o,text:t,maxSize:n,onFileSelect:i,onMultipleFileSelect:a,validateFile:l,isLoading:d=!1,progress:s=0,fileType:g,multiple:p=!1,...m})=>{const{previewUrl:h,thumbnailUrl:f,errorMessage:x,videoRef:y,fileInputRef:b,selectedFile:k,selectedFiles:C,handleFileChange:w,handleClick:j}=_l({maxSize:n,onFileSelect:i,onMultipleFileSelect:a,validateFile:l,multiple:p}),I=(()=>{if(g)return g;if(k)return k.type.startsWith("image/")?"image":k.type.startsWith("video/")?"video":"file"})();return r.jsx($l,{handleClick:j,accept:e,isLoading:d,progress:s,icon:o,text:t,maxSize:n,onFileSelect:i,validateFile:l,errorMessage:x,handleFileChange:w,selectedFile:k,selectedFiles:C,videoRef:y,fileInputRef:b,previewUrl:h,thumbnailUrl:f,fileType:I,multiple:p,...m})};function Hl({onAudio:e,recording:o,paused:t,audioBlob:n,analyserNode:i,startRecording:a,stopRecording:l,pauseRecording:d,resumeRecording:s,resetRecording:g,handleFileChange:p,...m}){const[h,f]=u.useState(null);return u.useEffect(()=>{if(n){const x=URL.createObjectURL(n);return f(x),()=>{URL.revokeObjectURL(x)}}return f(null),()=>{}},[n]),r.jsxs(c.View,{gap:"8px",...m,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",margin:10,children:[r.jsx(Yo,{accept:"audio/*",icon:r.jsx(po,{widthHeight:16}),maxSize:100*1024*1024,onFileSelect:x=>e(x),fileType:"file",multiple:!1,renderError:({errorMessage:x})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"}}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:"50%",padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:x=>x.size>100*1024*1024?"File size exceeds 100MB limit":x.type.startsWith("audio/")?null:"Only audio files are allowed"}),o?r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[r.jsx(c.View,{as:"button",type:"button",onClick:t?s:d,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-100",color:"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-gray-200"},children:t?r.jsx(St,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(zr,{widthHeight:16,color:"currentColor",filled:!1})}),r.jsx(c.View,{as:"button",type:"button",onClick:l,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"theme-error",color:"color-white",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-red-600"},children:r.jsx(qo,{widthHeight:16,color:"currentColor",filled:!1})}),r.jsx(c.View,{minWidth:90,children:o&&r.jsx(Pt,{analyserNode:i,isPaused:t})})]}):r.jsx(c.View,{as:"button",type:"button",onClick:a,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-100",color:"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-gray-200"},children:r.jsx(It,{widthHeight:16,color:"currentColor",filled:!1})})]}),h&&!o&&r.jsx("audio",{controls:!0,src:h})]})}function Br(){const[e,o]=u.useState(!1),[t,n]=u.useState(!1),[i,a]=u.useState(0),[l,d]=u.useState(null),[s,g]=u.useState(null),[p,m]=u.useState(null),h=u.useRef(null),f=u.useRef(null),x=u.useRef(null),y=u.useRef(null),b=u.useRef([]),k=u.useRef(null),C=typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",w=u.useCallback(()=>{h.current&&(h.current.state!=="inactive"&&h.current.stop(),h.current=null),y.current&&(y.current.getTracks().forEach(E=>E.stop()),y.current=null),f.current&&(f.current.close(),f.current=null),x.current&&(x.current.disconnect(),x.current=null),g(null),k.current&&(clearInterval(k.current),k.current=null)},[]),j=u.useCallback(async()=>{w(),d(null),a(0),b.current=[];try{const E=await navigator.mediaDevices.getUserMedia({audio:!0});y.current=E;const _=MediaRecorder.isTypeSupported(C)?C:void 0,T=new MediaRecorder(E,_?{mimeType:_}:void 0);h.current=T;const $=new(window.AudioContext||window.webkitAudioContext);f.current=$;const B=$.createMediaStreamSource(E),R=$.createAnalyser();R.fftSize=256,R.smoothingTimeConstant=.8,B.connect(R),x.current=R,g(R),T.ondataavailable=V=>{V.data.size>0&&b.current.push(V.data)},T.onstop=()=>{const V=new Blob(b.current,{type:T.mimeType||C});m(V),w()},T.start(),o(!0),n(!1),k.current=setInterval(()=>{a(V=>V+1)},1e3)}catch{d("Microphone access denied or unavailable."),w()}},[w]),S=u.useCallback(()=>{h.current&&h.current.state!=="inactive"&&h.current.stop(),o(!1),n(!1),k.current&&(clearInterval(k.current),k.current=null)},[]),I=u.useCallback(()=>{h.current&&h.current.state==="recording"&&(h.current.pause(),n(!0),k.current&&(clearInterval(k.current),k.current=null))},[]),M=u.useCallback(()=>{h.current&&h.current.state==="paused"&&(h.current.resume(),n(!1),k.current||(k.current=setInterval(()=>{a(E=>E+1)},1e3)))},[]),z=u.useCallback(()=>{w(),o(!1),n(!1),m(null),a(0),d(null),b.current=[]},[w]);return u.useEffect(()=>()=>w(),[w]),{recording:e,paused:t,audioBlob:p,analyserNode:s,duration:i,error:l,startRecording:j,stopRecording:S,pauseRecording:I,resumeRecording:M,resetRecording:z}}function Bl(e){const{onAudio:o}=e,{recording:t,paused:n,audioBlob:i,analyserNode:a,startRecording:l,stopRecording:d,pauseRecording:s,resumeRecording:g,resetRecording:p}=Br();return u.useEffect(()=>{if(i&&o){const h=new File([i],"recording.webm",{type:i.type||"audio/webm;codecs=opus"});o(h)}},[i,o]),{recording:t,paused:n,audioBlob:i,analyserNode:a,startRecording:l,stopRecording:d,pauseRecording:s,resumeRecording:g,resetRecording:p,handleFileChange:h=>{var x;const f=(x=h.target.files)==null?void 0:x[0];f&&o&&o(f)}}}function Ll(e){const o=Bl(e);return r.jsx(Hl,{...e,...o})}const Al=()=>{const[e,o]=u.useState(!1);return{imageError:e,setImageError:o}},Dl={xs:24,sm:32,md:48,lg:64,xl:80},nt={container:{borderRadius:"50%",overflow:"hidden",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",backgroundColor:"color-gray-100",boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.1)",transition:"all 0.2s ease"},fallback:{fontWeight:"500",color:"color-gray-600"},image:{objectFit:"cover",transition:"all 0.2s ease"}},Fl=({src:e,size:o="md",fallback:t="IM",views:n,imageError:i,setImageError:a,onClick:l=()=>{},children:d})=>{const s=Dl[o],g={...nt.image,...(n==null?void 0:n.image)||{}};return r.jsxs(c.Center,{role:"avatar",width:s,height:s,...nt.container,borderColor:i?"color-gray-400":"transparent",onClick:l,...n==null?void 0:n.container,children:[!i&&e?r.jsx(c.Image,{alt:"IM",src:e,style:g,width:s,height:s,onError:()=>a(!0)}):r.jsx(c.Text,{size:o,...nt.fallback,...n==null?void 0:n.fallback,children:t}),d]})},Ol=({src:e,size:o,views:t,fallback:n,onClick:i,children:a})=>{const{imageError:l,setImageError:d}=Al();return r.jsx(Fl,{src:e,size:o,views:t,fallback:n,imageError:l,setImageError:d,onClick:i,children:a})},ql=Ol,Nl={xs:{minWidth:"20px",height:"20px",padding:"0 6px",fontSize:"10px",fontWeight:"500",lineHeight:"20px"},sm:{minWidth:"24px",height:"24px",padding:"0 8px",fontSize:"12px",fontWeight:"500",lineHeight:"24px"},md:{minWidth:"28px",height:"28px",padding:"0 10px",fontSize:"14px",fontWeight:"500",lineHeight:"28px"},lg:{minWidth:"32px",height:"32px",padding:"0 12px",fontSize:"16px",fontWeight:"500",lineHeight:"32px"},xl:{minWidth:"36px",height:"36px",padding:"0 14px",fontSize:"20px",fontWeight:"500",lineHeight:"36px"}},Ul={square:0,rounded:"8px",pill:"9999px"},Gl={"top-right":{top:"4px",right:"4px",position:"absolute"},"top-left":{top:"4px",left:"4px",position:"absolute"},"bottom-right":{bottom:"4px",right:"4px",position:"absolute"},"bottom-left":{bottom:"4px",left:"4px",position:"absolute"}},Yl=e=>({filled:{backgroundColor:"theme-primary",color:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s ease"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"theme-primary",color:"theme-primary",transition:"all 0.2s ease"},link:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",color:"theme-primary",textDecoration:"underline",textUnderlineOffset:"2px",transition:"all 0.2s ease"},ghost:{backgroundColor:"transparent",color:"color-gray-500",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s ease"}}),Lr=e=>({default:{indicator:{backgroundColor:"color-gray-400"},label:{color:"color-gray-700"}},info:{indicator:{backgroundColor:"color-blue-500"},label:{color:"color-blue-700"}},success:{indicator:{backgroundColor:"color-green-500"},label:{color:"color-green-700"}},warning:{indicator:{backgroundColor:"color-orange-500"},label:{color:"color-orange-700"}},error:{indicator:{backgroundColor:"color-red-500"},label:{color:"color-red-700"}}}),vl=u.memo(({content:e,children:o,icon:t,pastil:n,position:i,shape:a="pill",variant:l="filled",size:d="md",views:s,themeMode:g,...p})=>{const{themeMode:m}=c.useTheme(),h=g||m,f=u.useMemo(()=>Yl()[l],[h,l]),x=u.useMemo(()=>Lr(),[h]),y=u.useMemo(()=>({width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",borderRadius:Ul[a],...Nl[d],...f,...i?Gl[i]:{},...s==null?void 0:s.container}),[a,d,f,i,s==null?void 0:s.container]);let b="currentColor";return typeof n=="string"?n in x?b=x[n].indicator.backgroundColor:b=n:n===!0&&(b="color-green-500",l==="filled"&&(b="color-white")),r.jsxs(c.Center,{role:"badge",...y,...p,children:[t&&r.jsx(c.View,{role:"badge-icon",...s==null?void 0:s.icon,children:t}),n&&r.jsx(c.View,{role:"badge-pastil",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:b,...s==null?void 0:s.pastil}),(e||o)&&r.jsx(c.Text,{role:"badgeText",fontWeight:"500",textAlign:"center",...s==null?void 0:s.text,color:y.color,children:o||e})]})}),Xl=e=>r.jsx(vl,{...e}),Kl=()=>{const[e,o]=u.useState(!1);return{isHovered:e,setIsHovered:o}},Ql={xs:12,sm:14,md:16,lg:18,xl:20},Zl=({children:e,to:o="/",iconSize:t="sm",underline:n="default",isHovered:i=!1,isExternal:a=!1,views:l={icon:{},text:{}},setIsHovered:d=()=>{},...s})=>{const g=()=>{n==="hover"&&d(!0)},p=()=>{n==="hover"&&d(!1)},m=()=>n==="underline"||n==="hover"&&i?"underline":"none";return r.jsx(Xa.Link,{to:o,target:a?"_blank":"_self",style:{textDecoration:"inherit",color:"inherit"},children:r.jsxs(c.Horizontal,{onMouseEnter:g,onMouseLeave:p,gap:3,alignItems:"center",flexWrap:"nowrap",textDecoration:m(),...l.text,...s,children:[e,a&&r.jsx(Er,{widthHeight:Ql[t]})]})})},Jl=e=>{const o=Kl();return r.jsx(Zl,{...o,...e})},Ar=Jl,Wt={xs:14,sm:18,md:22,lg:26,xl:30},_t={fast:50,normal:100,slow:300},ec=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=a(t,{themeMode:n||l}),s=typeof e=="number"?e:Wt[e],[g,p]=u.useState(0);return u.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},_t[o]);return()=>clearInterval(m)},[o]),r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${s}px`,height:`${s}px`,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:`rotate(${g}deg)`},...i,children:[r.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),r.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("g",{id:"SVGRepo_iconCarrier",children:r.jsx("path",{d:"M21 12a9 9 0 11-6.219-8.56"})})]})},oc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=a(t,{themeMode:n||l}),s=typeof e=="number"?e:Wt[e],[g,p]=u.useState(0);return u.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},_t[o]);return()=>clearInterval(m)},[o]),r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${s}px`,height:`${s}px`,style:{transform:`rotate(${g}deg)`},...i,children:[r.jsx("circle",{cx:"10",cy:"25",r:"4",fill:d}),r.jsx("circle",{cx:"25",cy:"25",r:"4",fill:d}),r.jsx("circle",{cx:"40",cy:"25",r:"4",fill:d})]})},tc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=a(t,{themeMode:n||l}),s=typeof e=="number"?e:Wt[e],[g,p]=u.useState(0);return u.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},_t[o]);return()=>clearInterval(m)},[o]),r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${s}px`,height:`${s}px`,style:{transform:`rotate(${g}deg)`},...i,children:r.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:d,strokeWidth:"5",strokeDasharray:"1,10"})})},rc=({size:e,children:o,textColor:t,loaderColor:n,type:i="default",speed:a="normal",textPosition:l="right",views:d,...s})=>{const{getColor:g}=c.useTheme();n=g(n||s.color||"theme-loading"),t=g(t||s.color||"theme-loading");const p={size:e,speed:a,color:n},m={default:r.jsx(ec,{...p}),dotted:r.jsx(oc,{...p}),quarter:r.jsx(tc,{...p})};return r.jsxs(c.Center,{gap:10,flexDirection:l==="top"||l==="bottom"?"column":"row",...s,...d==null?void 0:d.container,children:[(l==="left"||l==="top")&&o&&r.jsx(c.View,{color:t,...d==null?void 0:d.text,children:o}),m[i],(l==="right"||l==="bottom")&&o&&r.jsx(c.View,{color:t,...d==null?void 0:d.text,children:o})]})},nc=e=>r.jsx(rc,{...e}),uo=nc,ac={xs:10,sm:12,md:14,lg:16,xl:20},oo={xs:12,sm:16,md:20,lg:24,xl:28},to=e=>({minHeight:oo[e]*2,paddingHorizontal:oo[e]/2,fontSize:ac[e],fontWeight:500,lineHeight:oo[e],letterSpacing:"-0.01em",paddingInline:oo[e],paddingBlock:oo[e]/2,outlineWidth:"medium"}),Dr={xs:to("xs"),sm:to("sm"),md:to("md"),lg:to("lg"),xl:to("xl")},so={square:0,rounded:8,pill:999},Fr={xs:{width:16,height:16,padding:6},sm:{width:20,height:20,padding:6},md:{width:24,height:24,padding:8},lg:{width:24,height:24,padding:12},xl:{width:28,height:28,padding:14}},ic=(e,o,t=!1)=>{const n=t?o:e,i=t?e:o,a=t?o:e;return{filled:{backgroundColor:n,color:i,borderWidth:1,borderStyle:"solid",borderColor:"transparent",_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${n}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},empty:{backgroundColor:"transparent",color:a,borderWidth:1,borderStyle:"solid",borderColor:a,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},outline:{backgroundColor:"transparent",color:a,borderWidth:1,borderStyle:"solid",borderColor:a,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease"},ghost:{backgroundColor:"transparent",color:a,borderWidth:1,borderStyle:"solid",borderColor:"transparent",_hover:{borderWidth:1,borderStyle:"solid",borderColor:a,color:a,opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},link:{backgroundColor:"transparent",color:a,borderWidth:0,borderStyle:"none",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"2px",textDecorationThickness:"1px",textDecorationColor:a,_hover:{opacity:.8},_active:{opacity:.9},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"opacity 0.2s ease"},subtle:{backgroundColor:t?`color-mix(in srgb, ${a} 20%, transparent)`:`color-mix(in srgb, ${a} 5%, transparent)`,color:a,borderWidth:1,borderStyle:"solid",borderColor:a,_hover:{backgroundColor:t?`color-mix(in srgb, ${a} 40%, transparent)`:`color-mix(in srgb, ${a} 15%, transparent)`},_active:{backgroundColor:t?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.15)"},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"all 0.2s ease"}}},lc=u.memo(({children:e,icon:o,isLoading:t,iconPosition:n="left",loaderPosition:i="left",size:a="md",resolvedTextColor:l,isIconRounded:d,views:s})=>{const g=["left","right"].includes(n)?c.Horizontal:c.Vertical,p=Dr[a],m=d?Fr[a]:{};return r.jsxs(g,{gap:8,alignItems:"center",justifyContent:"center",...p,...m,...s==null?void 0:s.content,children:[t&&i==="left"&&r.jsx(uo,{size:a==="xs"||a==="sm"?"sm":"md",color:l,...s==null?void 0:s.loader}),o&&["left","top"].includes(n)&&!t&&r.jsx(c.View,{color:l,...s==null?void 0:s.icon,children:o}),e,o&&["right","bottom"].includes(n)&&!t&&r.jsx(c.View,{color:l,...s==null?void 0:s.icon,children:o}),t&&i==="right"&&r.jsx(uo,{size:a==="xs"||a==="sm"?"sm":"md",color:l,...s==null?void 0:s.loader})]})}),cc=e=>{const o=so[e];return typeof o=="number"?o:typeof o=="string"&&parseInt(o,10)||0},sc=({asComponent:e,isDisabled:o,isLoading:t,isWrapped:n=!1,borderRadius:i,width:a,height:l,baseStyles:d,sizeStyles:s,iconPad:g,mainTone:p,resolvedTextColor:m,children:h,borderWidth:f=0,...x})=>r.jsx(c.Element,{as:e,disabled:!!(o||t),display:n?"flex":"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:i,width:a,height:l,...d,...s,...g,backgroundColor:(d==null?void 0:d.backgroundColor)||(n?p:void 0),color:m,borderWidth:n?0:void 0,cursor:o?"default":"pointer",...x,children:h}),dc=({shape:e,isDisabled:o,onClick:t,shadow:n,borderWidth:i,isAuto:a,isFilled:l,views:d,children:s,...g})=>r.jsx(c.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:so[e],cursor:o?"default":"pointer",onClick:t,boxShadow:n,padding:i,width:a?"fit-content":l?"100%":void 0,...d==null?void 0:d.container,...g,children:s}),uc=({variant:e,animation:o,to:t,isDisabled:n,isLoading:i,isAuto:a,isFilled:l,isExternal:d,shape:s="rounded",shadow:g,onClick:p,views:m,baseStyles:h,sizeStyles:f,iconPad:x,resolvedTextColor:y,content:b,size:k,mainTone:C,borderMovingDuration:w=2,borderMovingGradientColors:j=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:S="#705CFF",animatedStrokeTextColor:I="#333333",getColor:M=E=>E,...z})=>{var $;const E=cc(s),_=t?r.jsx(Ar,{to:t,isExternal:d,color:"currentColor",textDecoration:"inherit",_hover:{color:"currentColor"},...m==null?void 0:m.link,children:b}):b,T={isDisabled:n,isLoading:i,baseStyles:h,sizeStyles:f,iconPad:x,resolvedTextColor:y,mainTone:C,children:_};if(o==="borderMoving"&&j){const R={from:{backgroundPosition:"0% 50%"},to:{backgroundPosition:"200% 50%"},duration:`${w}s`,timingFunction:"linear",iterationCount:"infinite"};return r.jsx(dc,{shape:s,isDisabled:n,onClick:p,shadow:g,borderWidth:3,isAuto:a,isFilled:l,views:m,background:`linear-gradient(90deg, ${j[0]}, ${j[1]}, ${j[2]}, ${j[0]})`,backgroundSize:"200% 100%",animate:R,...z,children:r.jsx(sc,{asComponent:t?"div":"button",isWrapped:!0,borderRadius:Math.max(0,E-3),width:"100%",height:"100%",...T})})}if(o==="animatedStroke"){const B=M(S),R=M(I),V=1e3,W={from:{strokeWidth:"8px",strokeDasharray:`0 ${V}`,strokeDashoffset:-Math.round(V*.63)},to:{strokeWidth:"3px",strokeDasharray:`${V}`,strokeDashoffset:0},duration:"0.9s",timingFunction:"ease-in",fillMode:"forwards"},P=["group",($=m==null?void 0:m.container)==null?void 0:$.className,z==null?void 0:z.className].filter(Boolean).join(" ");return r.jsxs(c.Element,{as:t?"div":"button",type:t?void 0:"button",disabled:!!(!t&&(n||i)),onClick:p,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":l?"100%":void 0,borderRadius:so[s],boxShadow:g,transition:"all 0.2s ease",cursor:n?"default":"pointer",color:R,backgroundColor:"transparent",borderWidth:0,...m==null?void 0:m.container,...z,className:P,children:[r.jsx(c.View,{as:"svg",position:"absolute",top:0,right:0,bottom:0,left:0,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",pointerEvents:"none",zIndex:1,"aria-hidden":"true",children:r.jsx(c.View,{as:"rect",x:"0",y:"0",height:"100%",width:"100%",rx:E,ry:E,fill:"transparent",stroke:B,strokeWidth:"8px",strokeDasharray:`0 ${V}`,strokeDashoffset:-Math.round(V*.63),pathLength:V,on:{groupHover:{animate:W}}})}),r.jsx(c.View,{position:"relative",zIndex:0,children:_})]})}if(o==="borderReveal"){const R=(j==null?void 0:j[0])||C||"#000000",W=w*.75/4,P=`linear-gradient(90deg, ${R} 50%, transparent 50%)`,H=`linear-gradient(180deg, ${R} 50%, transparent 50%)`,L=`linear-gradient(270deg, ${R} 50%, transparent 50%)`,A=`linear-gradient(0deg, ${R} 50%, transparent 50%)`,F="100% 0, 100% 100%, 0 100%, 0 0",D="0 0, 100% 0, 100% 100%, 0 100%",O=`0s, ${W}s, ${W*2}s, ${W*2}s`,K=`${W*2}s, ${W*2}s, ${W}s, 0s`,Y=4;return r.jsx(c.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:so[s],cursor:n?"default":"pointer",onClick:p,boxShadow:g,padding:3,background:`
2
- ${P} no-repeat,
1
+ "use strict";var Xa=Object.create;var vt=Object.defineProperty;var Ka=Object.getOwnPropertyDescriptor;var Qa=Object.getOwnPropertyNames;var Za=Object.getPrototypeOf,Ja=Object.prototype.hasOwnProperty;var ei=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Qa(o))!Ja.call(e,i)&&i!==t&&vt(e,i,{get:()=>o[i],enumerable:!(n=Ka(o,i))||n.enumerable});return e};var oi=(e,o,t)=>(t=e!=null?Xa(Za(e)):{},ei(o||!e||!e.__esModule?vt(t,"default",{value:e,enumerable:!0}):t,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("react"),c=require("app-studio"),kt=require("zustand"),ti=require("react-router-dom"),ri=require("react-dom"),be=require("formik"),jt=(e="id")=>`${e}-${Math.random().toString(36).substring(2,9)}`,ni=({type:e="single",value:o,defaultValue:t,onValueChange:n,collapsible:i=!1})=>{const a=o!==void 0,l=o??t,d=()=>e==="multiple"?Array.isArray(l)?l:l?[l]:[]:Array.isArray(l)?l[0]:l,[s,g]=u.useState(d()),p=u.useMemo(()=>jt("accordion"),[]),m=a?o:s,h=u.useMemo(()=>m===void 0?[]:Array.isArray(m)?m:[m],[m]);u.useEffect(()=>{a&&(e==="multiple"&&!Array.isArray(o)?(console.warn('Accordion with type="multiple" received non-array value:',o),g(o?[String(o)]:[])):e==="single"&&Array.isArray(o)?(console.warn('Accordion with type="single" received array value:',o),g(o.length>0?o[0]:void 0)):g(o))},[o,a,e]);const f=u.useCallback(y=>{let b;if(e==="single")m===y&&i?b=void 0:m!==y?b=y:b=m;else{const k=Array.isArray(m)?m:[];k.includes(y)?b=k.filter(S=>S!==y):b=[...k,y],Array.isArray(b)&&b.length===0&&(b=[])}a||g(b),n&&n(b)},[e,m,i,a,n]),x=u.useCallback(y=>h.includes(y),[h]);return{expandedItems:h,toggleItem:f,isItemExpanded:x,type:e,collapsible:i,baseId:p}},ai={square:{borderRadius:0},rounded:{borderRadius:8}},ii={default:{backgroundColor:"transparent",borderWidth:0,transition:"background-color 0.15s ease"},outline:{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",transition:"border-color 0.15s ease, background-color 0.15s ease",_hover:{borderColor:"color-gray-300"}},filled:{backgroundColor:"color-gray-50",transition:"background-color 0.15s ease",_hover:{backgroundColor:"color-gray-100"}}},Ir=u.createContext({expandedItems:[],toggleItem:()=>{},isItemExpanded:()=>!1,type:"single",collapsible:!1,baseId:""}),li=({children:e,value:o})=>r.jsx(Ir.Provider,{value:o,children:e}),Tr=()=>{const e=u.useContext(Ir);if(!e)throw new Error("useAccordionContext must be used within an AccordionProvider");return e},ci=({value:e,children:o,isDisabled:t=!1,views:n,...i})=>{const{isItemExpanded:a,baseId:l}=Tr(),d=a(e),s=`${l}-trigger-${e}`,g=`${l}-content-${e}`;return r.jsx(c.View,{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",marginBottom:8,overflow:"hidden",opacity:t?.5:1,pointerEvents:t?"none":"auto","data-state":d?"open":"closed","data-disabled":t?"":void 0,...n==null?void 0:n.item,...i,children:u.Children.map(o,p=>u.isValidElement(p)?u.cloneElement(p,{...p.props,value:e,isExpanded:d,isDisabled:t,triggerId:s,contentId:g}):p)})},si=({children:e,value:o,isExpanded:t,isDisabled:n,triggerId:i,contentId:a,views:l,asChild:d=!1,...s})=>{const{toggleItem:g}=Tr(),m={id:i,"aria-expanded":t,"aria-controls":a,"aria-disabled":n,"data-state":t?"open":"closed","data-disabled":n?"":void 0,onClick:()=>{o&&!n&&g(o)},padding:16,cursor:n?"not-allowed":"pointer",alignItems:"center",justifyContent:"space-between",backgroundColor:"color-white",width:"100%",...l==null?void 0:l.container,...s};if(d&&u.isValidElement(e)){const h=u.Children.only(e);return u.cloneElement(h,{...m,...h.props})}return r.jsxs(c.Horizontal,{...m,children:[e,r.jsx(c.View,{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",transform:t?"rotate(180deg)":"rotate(0deg)",...l==null?void 0:l.icon,children:r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z",fill:"currentColor"})})})]})},di=({children:e,isExpanded:o,isDisabled:t,triggerId:n,contentId:i,views:a,...l})=>o?r.jsx(c.View,{id:i,role:"region","aria-labelledby":n,padding:16,backgroundColor:"color-white",maxHeight:o?"1000px":"0",transition:"max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",opacity:1,overflow:"hidden","data-state":o?"open":"closed","data-disabled":t?"":void 0,...a==null?void 0:a.container,...l,children:e}):null,ui=({children:e,shape:o="rounded",variant:t="default",views:n,baseId:i,type:a,collapsible:l,themeMode:d,...s})=>r.jsx(c.Vertical,{width:"100%","data-orientation":"vertical",...ai[o],...ii[t],...n==null?void 0:n.container,...s,children:e}),gi=({children:e,type:o="single",value:t,defaultValue:n,onValueChange:i,collapsible:a=!1,shape:l="rounded",variant:d="default",views:s,...g})=>{const p=Array.isArray(n)?n:n?[n]:void 0,m=ni({type:o,value:t,defaultValue:n??p,onValueChange:i,collapsible:a});return r.jsx(li,{value:{expandedItems:m.expandedItems,toggleItem:m.toggleItem,isItemExpanded:m.isItemExpanded,type:m.type,collapsible:m.collapsible,baseId:m.baseId},children:r.jsx(ui,{shape:l,variant:d,views:s,baseId:m.baseId,type:m.type,collapsible:m.collapsible,...g,children:e})})},Do=gi;Do.Item=ci;Do.Trigger=si;Do.Content=di;const tt=new Map,pi=(e,o,t)=>(tt.has(e)||tt.set(e,u.lazy(()=>import("lucide-react/dynamicIconImports").then(n=>{const i=n.default[e];return i?i():{default:()=>r.jsx(r.Fragment,{children:o||t})}}))),tt.get(e)),Xt=u.memo(({widthHeight:e,color:o="currentColor",transform:t,orientation:n="up",children:i,...a})=>r.jsx(c.Center,{widthHeight:e,lineHeight:e,color:o,display:"flex",transform:t||(n==="left"?"rotate(-90deg)":n==="right"?"rotate(90deg)":n==="up"?"rotate(0deg)":n==="down"?"rotate(180deg)":"none"),...a,children:i})),Eo=u.memo(({name:e="circle",widthHeight:o=24,color:t="currentColor",filled:n=!1,strokeWidth:i=1,size:a,children:l,fallback:d,...s})=>{const{getColor:g}=c.useTheme(),p=a||o,m=u.useMemo(()=>{const x=g(t);return{fill:n?x:"none",stroke:x,strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round"}},[n,t,i,g]);if(!e)return r.jsx(Xt,{widthHeight:o,color:t,...s,children:l});const h=e.toLowerCase().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),f=pi(h,d,l);return r.jsx(Xt,{widthHeight:p,color:t,...s,children:r.jsx(u.Suspense,{fallback:d||null,children:r.jsx(f,{size:p,...m})})})}),N=(e,o={})=>{const t=n=>r.jsx(Eo,{name:e,...o,...n});return t.displayName=`${e}Icon`,t},mi=N("user",{filled:!1}),hi=N("circle-help",{filled:!1}),fi=N("folder",{filled:!1}),ae=N("chevron-up",{filled:!1}),xi=N("grip-vertical",{filled:!1}),go=N("file",{filled:!1}),bi=N("video",{filled:!1}),yi=N("image",{filled:!1}),Fo=N("volume",{filled:!1}),ki=N("twitter",{filled:!1}),ji=N("x",{filled:!1}),Ci=N("twitch",{filled:!1}),fe=N("x",{filled:!1,strokeWidth:2}),Si=N("instagram",{filled:!1}),wi=N("youtube",{filled:!1}),Ii=N("facebook",{filled:!1}),Ti=N("linkedin",{filled:!1}),Mi=N("at-sign",{filled:!1}),Mr=N("minus",{filled:!1}),ze=N("info",{filled:!1}),Ct=N("play",{filled:!1}),zr=N("pause",{filled:!1}),zi=N("heart",{filled:!1}),Ri=N("star",{filled:!1}),Vi=N("save",{filled:!1}),St=N("triangle-alert",{filled:!1}),Ei=N("battery",{filled:!1}),Pi=N("bookmark",{filled:!1}),Wi=N("cloud",{filled:!1}),_i=N("copy",{filled:!1}),Oo=N("trash",{filled:!1}),$i=Oo,Hi=N("edit",{filled:!1}),wt=N("mic",{filled:!1}),qo=N("square",{filled:!1}),It=N("send",{filled:!1}),Tt=N("loader",{filled:!1}),po=N("paperclip",{filled:!1}),Po=N("search",{filled:!1}),Bi=N("home",{filled:!1}),Rr=N("settings",{filled:!1}),Li=N("download",{filled:!1}),Vr=N("share",{filled:!1}),No=N("check",{filled:!1}),Ai=N("plus",{filled:!1}),Mt=N("eye-off",{filled:!1}),zt=N("eye",{filled:!1}),Di=N("lock",{filled:!1}),Fi=N("user",{filled:!1}),Er=N("external-link",{filled:!1}),Rt=N("check-circle",{filled:!1}),Uo=N("alert-circle",{filled:!1}),Oi=N("bell",{filled:!1}),qi=N("file-text",{filled:!1}),Ni=N("bar-chart",{filled:!1}),Ui=N("moon",{filled:!1}),Pr=N("panel-left",{filled:!1}),Vt=N("upload",{filled:!1}),Gi=No,Yi=e=>r.jsx(ae,{orientation:"left",...e}),vi=N("zoom-out",{filled:!1}),Xi=N("type",{filled:!1}),Ki=N("shapes",{filled:!1}),Qi=N("rotate-cw",{filled:!1}),Zi=N("gift",{filled:!1}),Ji=N("shield",{filled:!1}),el=N("log-out",{filled:!1}),ol=N("power",{filled:!1}),tl=N("link",{filled:!1}),rl=N("layout",{filled:!1}),nl=N("zap",{filled:!1}),al=N("credit-card",{filled:!1}),il=N("more-horizontal",{filled:!1}),ll=Oo,cl=N("filter",{filled:!1}),sl=N("calendar",{filled:!1}),dl=N("clock",{filled:!1}),ul=N("map-pin",{filled:!1}),gl=N("menu",{filled:!1}),pl=N("refresh-cw",{filled:!1}),ml=N("printer",{filled:!1}),hl=N("wand",{filled:!1}),fl=N("thumbs-down",{filled:!1}),xl=N("thumbs-up",{filled:!1}),bl=N("camera",{filled:!1}),yl=N("bluetooth",{filled:!1}),kl=N("unlock",{filled:!1}),jl=N("wifi",{filled:!1}),Cl=N("arrow-right",{filled:!1}),Sl=N("arrow-up",{filled:!1}),wl=N("loader",{filled:!1}),Il=N("sliders-horizontal",{filled:!1}),Tl=N("crop",{filled:!1}),Ml=N("zoom-in",{filled:!1}),zl=N("grip-horizontal",{filled:!1}),Wr=N("mouse-pointer-2",{filled:!1}),Rl=e=>({default:{container:{backgroundColor:"color-gray-50",borderColor:"color-gray-200",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},content:{color:"color-gray-700"},icon:{color:"color-gray-500"}},info:{container:{backgroundColor:"color-blue-50",borderColor:"color-blue-200",boxShadow:"0 1px 2px rgba(59, 130, 246, 0.05)"},content:{color:"color-blue-700"},icon:{color:"color-blue-500"}},success:{container:{backgroundColor:"color-green-50",borderColor:"color-green-200",boxShadow:"0 1px 2px rgba(34, 197, 94, 0.05)"},content:{color:"color-green-700"},icon:{color:"color-green-500"}},error:{container:{backgroundColor:"color-red-50",borderColor:"color-red-200",boxShadow:"0 1px 2px rgba(239, 68, 68, 0.05)"},content:{color:"color-red-700"},icon:{color:"color-red-500"}},warning:{container:{backgroundColor:"color-orange-50",borderColor:"color-orange-200",boxShadow:"0 1px 2px rgba(249, 115, 22, 0.05)"},content:{color:"color-orange-700"},icon:{color:"color-orange-500"}}}),Vl=u.memo(({icon:e,title:o="",views:t,description:n="",variant:i="default",themeMode:a,children:l,...d})=>{const{themeMode:s}=c.useTheme(),g=a||s,p=u.useMemo(()=>Rl(),[g]),m=()=>{var x;if(e)return e;const f={size:20,color:((x=t==null?void 0:t.icon)==null?void 0:x.color)??p[i].icon.color};switch(i){case"info":return r.jsx(ze,{...f});case"success":return r.jsx(Rt,{...f});case"error":return r.jsx(Uo,{...f});case"warning":default:return r.jsx(St,{...f})}};return r.jsxs(c.Horizontal,{gap:12,padding:"16px",flexWrap:"nowrap",alignItems:"flex-start",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:p[i].container.borderColor,backgroundColor:p[i].container.backgroundColor,boxShadow:p[i].container.boxShadow,transition:"all 0.2s ease",...t==null?void 0:t.container,...d,children:[r.jsx(c.View,{alignSelf:"flex-start",marginTop:"2px",...t==null?void 0:t.icon,children:m()}),r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsx(c.Text,{fontSize:"16px",fontWeight:"600",lineHeight:"24px",color:p[i].content.color,backgroundColor:p[i].container.backgroundColor,...t==null?void 0:t.title,children:o}),r.jsx(c.Text,{fontSize:"14px",fontWeight:"400",lineHeight:"20px",color:p[i].content.color,backgroundColor:p[i].container.backgroundColor,...t==null?void 0:t.description,children:n||l})]})]})}),El=e=>r.jsx(Vl,{...e}),Pl=El,Wl=({ratio:e=16/9,children:o,views:t,...n})=>r.jsx(c.Center,{width:"100%",position:"relative",overflow:"hidden",paddingTop:`${1/e*100}%`,borderRadius:8,...n,...t==null?void 0:t.center,children:r.jsx(c.View,{position:"absolute",top:0,right:0,bottom:0,left:0,...t==null?void 0:t.view,children:o})}),_l=({ratio:e,children:o,...t})=>r.jsx(Wl,{ratio:e,...t,children:o}),$l=_l;function Hl(e,o,t){return Math.min(Math.max(e,o),t)}const Bl=({bars:e,isPaused:o,...t})=>r.jsx(c.Horizontal,{alignItems:"center",minWidth:100,gap:1,height:32,maxWidth:200,width:"100%",marginTop:4,...t,children:e.map((i,a)=>r.jsx(c.View,{width:2,backgroundColor:o?"color-gray-200":i>=0?"color-gray-900":"color-gray-500",style:{height:`${Hl(i*300,2,32)}px`}},a))}),Et=({analyserNode:e,isPaused:o,...t})=>{const n=u.useRef(null),i=60,a=32,[l,d]=u.useState([]);return u.useEffect(()=>{if(!e){d(Array(i).fill(-1));return}const s=e.frequencyBinCount,g=new Uint8Array(s),p=()=>{e.getByteTimeDomainData(g);let m=0;for(let f=0;f<s;f++){const x=(g[f]-128)/128;m+=x*x}const h=Math.sqrt(m/s);u.startTransition(()=>{d(f=>{const y=[...f,h].slice(-i);return y.length<i?[...Array(i-y.length).fill(-1),...y]:y})})};return n.current=setInterval(p,a),()=>{n.current&&clearInterval(n.current)}},[e]),r.jsx(Bl,{bars:l,isPaused:o,...t})},Go=kt.create(e=>({visible:!1,title:"",subtitle:"",variant:"info",isClosable:!1,views:{},action:()=>{},actionText:"",showIcon:!1,timeout:3e3,show:(o,t="",n="",i,a,l,d,s,g)=>e({visible:!0,variant:o,title:t,subtitle:n,isClosable:i,views:a,action:l,actionText:d,showIcon:s,timeout:g}),hide:()=>e({visible:!1})})),_r=(e,o,t,n)=>{Go.getState().show(e,o,t,n==null?void 0:n.isClosable,n==null?void 0:n.views,n==null?void 0:n.action,n==null?void 0:n.actionText,n==null?void 0:n.showIcon,n==null?void 0:n.timeout)},$r=()=>{Go.getState().hide()},Ll={info:{container:{backgroundColor:"color-blue-200",border:"color-blue-400"},icon:{color:"color-blue-500",name:"InformationIcon"},content:{color:"color-blue-500"},close:{color:"color-blue-500",name:"CloseIcon"}},success:{container:{backgroundColor:"color-green-200",border:"color-green-400"},icon:{color:"color-green-500",name:"SuccessIcon"},content:{color:"color-green-500"},close:{color:"color-green-500",name:"CloseIcon"}},error:{container:{backgroundColor:"color-red-200",border:"color-red-400"},icon:{color:"color-red-500",name:"ErrrorIcon"},content:{color:"color-red-500"},close:{color:"color-red-500",name:"CloseIcon"}},warning:{container:{backgroundColor:"color-orange-200",border:"color-orange-400"},icon:{color:"color-orange-500",name:"ErrrorIcon"},content:{color:"color-orange-500"},close:{color:"color-orange-500",name:"CloseIcon"}}},Hr=({variant:e,hide:o,title:t,subtitle:n,theme:i,action:a,actionText:l,showIcon:d=!1,isClosable:s=!1,timeout:g=3e3,views:p})=>{var k,S;u.useEffect(()=>{if(g&&!s){const w=setTimeout(()=>{o()},g);return()=>{clearTimeout(w)}}},[]);const m=i??Ll,h=!!(a&&l),f={borderWidth:1,borderStyle:"solid",borderRadius:8,borderColor:`${m[e].container.border}`},x={info:"#3b82f6",success:"#4ade80",warning:"#f97316",error:"#ef4444"}[e],y={info:r.jsx(ze,{widthHeight:24,color:x,...p==null?void 0:p.icon}),success:r.jsx(Rt,{widthHeight:24,color:x,...p==null?void 0:p.icon}),warning:r.jsx(St,{widthHeight:24,color:x,...p==null?void 0:p.icon}),error:r.jsx(Uo,{widthHeight:24,color:x,...p==null?void 0:p.icon})}[e],b=d&&y;return r.jsxs(c.Horizontal,{role:"messageContent",gap:16,width:400,flexWrap:"nowrap",position:"relative",alignItems:"center",padding:"14px 24px 14px 14px",color:`${m[e].content.color}`,backgroundColor:`${m[e].container.backgroundColor}`,onClick:s?()=>{}:()=>{o()},...f,...p==null?void 0:p.container,children:[b&&y,r.jsxs(c.Vertical,{gap:8,width:"100%",children:[r.jsx(c.Text,{size:"md",weight:"semiBold",...p==null?void 0:p.title,children:t}),n&&r.jsx(c.Text,{size:"sm",...p==null?void 0:p.subtitle,children:n})]}),h&&r.jsx(c.Text,{marginRight:10,onClick:a,padding:"6px 10px",whiteSpace:"nowrap",...f,...p==null?void 0:p.actionText,children:l}),s&&r.jsx(c.View,{position:"absolute",zIndex:1e4,right:8,top:6,onClick:()=>{o()},...(k=p==null?void 0:p.closingIcon)==null?void 0:k.container,children:r.jsx(fe,{widthHeight:18,color:x,...(S=p==null?void 0:p.closingIcon)==null?void 0:S.icon})})]})},Al=({container:e,theme:o,position:t="topRight"})=>{const{visible:n,title:i,variant:a,subtitle:l,isClosable:d,views:s,action:g,actionText:p,showIcon:m,timeout:h}=Go(),f={topLeft:{top:6,left:8},topRight:{top:6,right:8},bottomLeft:{bottom:8,left:6},bottomRight:{bottom:8,right:6}}[t],x=()=>r.jsx(Hr,{variant:a,subtitle:l,show:n,title:i,theme:o,isClosable:d,views:s,action:g,actionText:p,showIcon:m,timeout:h,hide:()=>$r()}),y=e?u.cloneElement(e,{},x()):r.jsx(c.View,{position:"absolute",zIndex:1e4,...f,children:x()});return n?y:null},Dl=(e,o)=>{const t=document.createElement("video");t.preload="metadata",t.onloadedmetadata=()=>{t.currentTime=1},t.oncanplay=()=>{const n=document.createElement("canvas");n.width=t.videoWidth,n.height=t.videoHeight;const i=n.getContext("2d");if(i){i.drawImage(t,0,0,n.width,n.height);const a=n.toDataURL("image/jpeg");o(a)}URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(e)},Fl=({maxSize:e=100*1024*1024,onFileSelect:o,onMultipleFileSelect:t,validateFile:n,thumbnail:i,multiple:a=!1,onError:l=d=>{_r("error","Error",d)}})=>{const d=u.useRef(null),s=u.useRef(null),[g,p]=u.useState(null),[m,h]=u.useState([]),[f,x]=u.useState(null),[y,b]=u.useState(null),[k,S]=u.useState(i||null),w=u.useCallback(C=>{const I=C.target.files;if(x(null),!I||I.length===0){l("No file selected"),x("No file selected");return}if(a){const M=Array.from(I),R=[];for(const V of M){if(V.size>e){l(`File ${V.name} exceeds ${Math.round(e/(1024*1024))}MB.`),x(`File ${V.name} exceeds ${Math.round(e/(1024*1024))}MB.`);continue}if(n){const _=n(V);if(_){l(`${V.name}: ${_}`),x(`${V.name}: ${_}`);continue}}R.push(V)}R.length>0&&(h(R),t&&t(R))}else{const M=I[0];if(M.size>e){l(`File exceeds ${Math.round(e/(1024*1024))}MB.`),x(`File exceeds ${Math.round(e/(1024*1024))}MB.`);return}if(n){const R=n(M);if(R){l(R),x(R);return}}b(URL.createObjectURL(M)),M.type.startsWith("video/")&&Dl(M,S),o&&(p(M),o(M))}},[e,o,t,n,a]),j=()=>{var C;return(C=d.current)==null?void 0:C.click()};return u.useEffect(()=>()=>{y&&URL.revokeObjectURL(y),k&&URL.revokeObjectURL(k)},[y,k]),{previewUrl:y,thumbnailUrl:k,errorMessage:f,fileInputRef:d,videoRef:s,selectedFile:g,selectedFiles:m,handleFileChange:w,handleClick:j}},Ol=({accept:e,isLoading:o=!1,progress:t=0,icon:n,text:i,previewUrl:a,thumbnailUrl:l,errorMessage:d,fileInputRef:s,videoRef:g,selectedFile:p,selectedFiles:m,handleFileChange:h,handleClick:f,multiple:x=!1,containerProps:y,errorMessageProps:b,progressProps:k,videoProps:S,imageProps:w,iconProps:j,textProps:C,fileType:I,previewUrl:M,renderError:R=({errorMessage:z,errorMessageProps:$,themeMode:E})=>r.jsx(c.Text,{color:"red",fontSize:12,marginTop:8,...$,...P==null?void 0:P.text,children:z}),renderText:V=({text:z,textProps:$})=>r.jsx(c.Text,{marginTop:8,...$,...P==null?void 0:P.text,children:z}),renderFile:_=({selectedFile:z,textProps:$})=>z?r.jsxs(c.Center,{marginTop:8,gap:10,flexDirection:"column",...P==null?void 0:P.container,children:[r.jsx(c.Text,{maxLines:2,...$,...P==null?void 0:P.text,children:z.name}),r.jsxs(c.Text,{...$,...P==null?void 0:P.text,children:["(",Math.round(z.size/1024)," KB)"]})]}):null,renderVideo:T=({selectedFile:z,videoRef:$,videoProps:E})=>r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...P==null?void 0:P.view,children:r.jsx(c.View,{as:"video",width:"100%",height:"100%",src:z?URL.createObjectURL(z):void 0,style:{objectFit:"cover"},ref:$,...E,...P==null?void 0:P.view})}),renderImage:W=({previewUrl:z,imageProps:$})=>(console.log("Rendering image with URL:",z),r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...P==null?void 0:P.view,children:r.jsx(c.Image,{src:z,alt:"Preview",width:"100%",height:"100%",objectFit:"cover",style:{maxHeight:"100%",maxWidth:"100%"},...$,...P==null?void 0:P.image})})),renderProgress:B=({progress:z,progressProps:$})=>r.jsxs(c.Horizontal,{gap:8,alignItems:"center",...$,...P==null?void 0:P.horizontal,children:[r.jsx(c.View,{height:4,backgroundColor:"rgba(0,0,0,0.1)",width:"100%",borderRadius:2,...P==null?void 0:P.view,children:r.jsx(c.View,{height:4,width:`${z}%`,borderRadius:2,backgroundColor:"color-dark-50",...P==null?void 0:P.view})}),r.jsxs(c.Text,{fontSize:12,...P==null?void 0:P.text,children:[z,"%"]})]}),views:P={}})=>{const z=M||a;return r.jsxs(c.Center,{onClick:f,cursor:"pointer",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,padding:16,flexDirection:"column",overflow:"hidden",position:"relative",height:p&&t===100?"200px":"auto",...y,...P==null?void 0:P.container,children:[t===100&&I==="image"&&z&&W({previewUrl:z,imageProps:w}),t===100&&I==="video"&&l&&T({selectedFile:p,thumbnailUrl:l,videoRef:g,videoProps:S,imageProps:w}),t===100&&I==="file"&&p&&_({selectedFile:p,textProps:C}),t<100&&(n||r.jsx(Vt,{widthHeight:32,...j})),!o&&!p&&i&&V({text:i,textProps:C}),o&&B({progress:t,progressProps:k}),!o&&d&&R({errorMessage:d,errorMessageProps:b}),r.jsx(c.View,{as:"input",type:"file",ref:s,onChange:h,accept:e,multiple:x,style:{display:"none"},...P==null?void 0:P.view})]})},Yo=({accept:e="*/*",icon:o,text:t,maxSize:n,onFileSelect:i,onMultipleFileSelect:a,validateFile:l,isLoading:d=!1,progress:s=0,fileType:g,multiple:p=!1,...m})=>{const{previewUrl:h,thumbnailUrl:f,errorMessage:x,videoRef:y,fileInputRef:b,selectedFile:k,selectedFiles:S,handleFileChange:w,handleClick:j}=Fl({maxSize:n,onFileSelect:i,onMultipleFileSelect:a,validateFile:l,multiple:p}),I=(()=>{if(g)return g;if(k)return k.type.startsWith("image/")?"image":k.type.startsWith("video/")?"video":"file"})();return r.jsx(Ol,{handleClick:j,accept:e,isLoading:d,progress:s,icon:o,text:t,maxSize:n,onFileSelect:i,validateFile:l,errorMessage:x,handleFileChange:w,selectedFile:k,selectedFiles:S,videoRef:y,fileInputRef:b,previewUrl:h,thumbnailUrl:f,fileType:I,multiple:p,...m})};function ql({onAudio:e,recording:o,paused:t,audioBlob:n,analyserNode:i,startRecording:a,stopRecording:l,pauseRecording:d,resumeRecording:s,resetRecording:g,handleFileChange:p,...m}){const[h,f]=u.useState(null);return u.useEffect(()=>{if(n){const x=URL.createObjectURL(n);return f(x),()=>{URL.revokeObjectURL(x)}}return f(null),()=>{}},[n]),r.jsxs(c.View,{gap:"8px",...m,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",margin:10,children:[r.jsx(Yo,{accept:"audio/*",icon:r.jsx(po,{widthHeight:16}),maxSize:100*1024*1024,onFileSelect:x=>e(x),fileType:"file",multiple:!1,renderError:({errorMessage:x})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"}}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:"50%",padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:x=>x.size>100*1024*1024?"File size exceeds 100MB limit":x.type.startsWith("audio/")?null:"Only audio files are allowed"}),o?r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[r.jsx(c.View,{as:"button",type:"button",onClick:t?s:d,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-100",color:"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-gray-200"},children:t?r.jsx(Ct,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(zr,{widthHeight:16,color:"currentColor",filled:!1})}),r.jsx(c.View,{as:"button",type:"button",onClick:l,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"theme-error",color:"color-white",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-red-600"},children:r.jsx(qo,{widthHeight:16,color:"currentColor",filled:!1})}),r.jsx(c.View,{minWidth:90,children:o&&r.jsx(Et,{analyserNode:i,isPaused:t})})]}):r.jsx(c.View,{as:"button",type:"button",onClick:a,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-100",color:"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-gray-200"},children:r.jsx(wt,{widthHeight:16,color:"currentColor",filled:!1})})]}),h&&!o&&r.jsx("audio",{controls:!0,src:h})]})}function Br(){const[e,o]=u.useState(!1),[t,n]=u.useState(!1),[i,a]=u.useState(0),[l,d]=u.useState(null),[s,g]=u.useState(null),[p,m]=u.useState(null),h=u.useRef(null),f=u.useRef(null),x=u.useRef(null),y=u.useRef(null),b=u.useRef([]),k=u.useRef(null),S=typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",w=u.useCallback(()=>{h.current&&(h.current.state!=="inactive"&&h.current.stop(),h.current=null),y.current&&(y.current.getTracks().forEach(V=>V.stop()),y.current=null),f.current&&(f.current.close(),f.current=null),x.current&&(x.current.disconnect(),x.current=null),g(null),k.current&&(clearInterval(k.current),k.current=null)},[]),j=u.useCallback(async()=>{w(),d(null),a(0),b.current=[];try{const V=await navigator.mediaDevices.getUserMedia({audio:!0});y.current=V;const _=MediaRecorder.isTypeSupported(S)?S:void 0,T=new MediaRecorder(V,_?{mimeType:_}:void 0);h.current=T;const W=new(window.AudioContext||window.webkitAudioContext);f.current=W;const B=W.createMediaStreamSource(V),P=W.createAnalyser();P.fftSize=256,P.smoothingTimeConstant=.8,B.connect(P),x.current=P,g(P),T.ondataavailable=z=>{z.data.size>0&&b.current.push(z.data)},T.onstop=()=>{const z=new Blob(b.current,{type:T.mimeType||S});m(z),w()},T.start(),o(!0),n(!1),k.current=setInterval(()=>{a(z=>z+1)},1e3)}catch{d("Microphone access denied or unavailable."),w()}},[w]),C=u.useCallback(()=>{h.current&&h.current.state!=="inactive"&&h.current.stop(),o(!1),n(!1),k.current&&(clearInterval(k.current),k.current=null)},[]),I=u.useCallback(()=>{h.current&&h.current.state==="recording"&&(h.current.pause(),n(!0),k.current&&(clearInterval(k.current),k.current=null))},[]),M=u.useCallback(()=>{h.current&&h.current.state==="paused"&&(h.current.resume(),n(!1),k.current||(k.current=setInterval(()=>{a(V=>V+1)},1e3)))},[]),R=u.useCallback(()=>{w(),o(!1),n(!1),m(null),a(0),d(null),b.current=[]},[w]);return u.useEffect(()=>()=>w(),[w]),{recording:e,paused:t,audioBlob:p,analyserNode:s,duration:i,error:l,startRecording:j,stopRecording:C,pauseRecording:I,resumeRecording:M,resetRecording:R}}function Nl(e){const{onAudio:o}=e,{recording:t,paused:n,audioBlob:i,analyserNode:a,startRecording:l,stopRecording:d,pauseRecording:s,resumeRecording:g,resetRecording:p}=Br();return u.useEffect(()=>{if(i&&o){const h=new File([i],"recording.webm",{type:i.type||"audio/webm;codecs=opus"});o(h)}},[i,o]),{recording:t,paused:n,audioBlob:i,analyserNode:a,startRecording:l,stopRecording:d,pauseRecording:s,resumeRecording:g,resetRecording:p,handleFileChange:h=>{var x;const f=(x=h.target.files)==null?void 0:x[0];f&&o&&o(f)}}}function Ul(e){const o=Nl(e);return r.jsx(ql,{...e,...o})}const Gl=()=>{const[e,o]=u.useState(!1);return{imageError:e,setImageError:o}},Yl={xs:24,sm:32,md:48,lg:64,xl:80},rt={container:{borderRadius:"50%",overflow:"hidden",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",backgroundColor:"color-gray-100",boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.1)",transition:"all 0.2s ease"},fallback:{fontWeight:"500",color:"color-gray-600"},image:{objectFit:"cover",transition:"all 0.2s ease"}},vl=({src:e,size:o="md",fallback:t="IM",views:n,imageError:i,setImageError:a,onClick:l=()=>{},children:d})=>{const s=Yl[o],g={...rt.image,...(n==null?void 0:n.image)||{}};return r.jsxs(c.Center,{role:"avatar",width:s,height:s,...rt.container,borderColor:i?"color-gray-400":"transparent",onClick:l,...n==null?void 0:n.container,children:[!i&&e?r.jsx(c.Image,{alt:"IM",src:e,style:g,width:s,height:s,onError:()=>a(!0)}):r.jsx(c.Text,{size:o,...rt.fallback,...n==null?void 0:n.fallback,children:t}),d]})},Xl=({src:e,size:o,views:t,fallback:n,onClick:i,children:a})=>{const{imageError:l,setImageError:d}=Gl();return r.jsx(vl,{src:e,size:o,views:t,fallback:n,imageError:l,setImageError:d,onClick:i,children:a})},Kl=Xl,Ql={xs:{minWidth:"20px",height:"20px",padding:"0 6px",fontSize:"10px",fontWeight:"500",lineHeight:"20px"},sm:{minWidth:"24px",height:"24px",padding:"0 8px",fontSize:"12px",fontWeight:"500",lineHeight:"24px"},md:{minWidth:"28px",height:"28px",padding:"0 10px",fontSize:"14px",fontWeight:"500",lineHeight:"28px"},lg:{minWidth:"32px",height:"32px",padding:"0 12px",fontSize:"16px",fontWeight:"500",lineHeight:"32px"},xl:{minWidth:"36px",height:"36px",padding:"0 14px",fontSize:"20px",fontWeight:"500",lineHeight:"36px"}},Zl={square:0,rounded:"8px",pill:"9999px"},Jl={"top-right":{top:"4px",right:"4px",position:"absolute"},"top-left":{top:"4px",left:"4px",position:"absolute"},"bottom-right":{bottom:"4px",right:"4px",position:"absolute"},"bottom-left":{bottom:"4px",left:"4px",position:"absolute"}},ec=e=>({filled:{backgroundColor:"theme-primary",color:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s ease"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"theme-primary",color:"theme-primary",transition:"all 0.2s ease"},link:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",color:"theme-primary",textDecoration:"underline",textUnderlineOffset:"2px",transition:"all 0.2s ease"},ghost:{backgroundColor:"transparent",color:"color-gray-500",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s ease"}}),Lr=e=>({default:{indicator:{backgroundColor:"color-gray-400"},label:{color:"color-gray-700"}},info:{indicator:{backgroundColor:"color-blue-500"},label:{color:"color-blue-700"}},success:{indicator:{backgroundColor:"color-green-500"},label:{color:"color-green-700"}},warning:{indicator:{backgroundColor:"color-orange-500"},label:{color:"color-orange-700"}},error:{indicator:{backgroundColor:"color-red-500"},label:{color:"color-red-700"}}}),oc=u.memo(({content:e,children:o,icon:t,pastil:n,position:i,shape:a="pill",variant:l="filled",size:d="md",views:s,themeMode:g,...p})=>{const{themeMode:m}=c.useTheme(),h=g||m,f=u.useMemo(()=>ec()[l],[h,l]),x=u.useMemo(()=>Lr(),[h]),y=u.useMemo(()=>({width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",borderRadius:Zl[a],...Ql[d],...f,...i?Jl[i]:{},...s==null?void 0:s.container}),[a,d,f,i,s==null?void 0:s.container]);let b="currentColor";return typeof n=="string"?n in x?b=x[n].indicator.backgroundColor:b=n:n===!0&&(b="color-green-500",l==="filled"&&(b="color-white")),r.jsxs(c.Center,{role:"badge",...y,...p,children:[t&&r.jsx(c.View,{role:"badge-icon",...s==null?void 0:s.icon,children:t}),n&&r.jsx(c.View,{role:"badge-pastil",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:b,...s==null?void 0:s.pastil}),(e||o)&&r.jsx(c.Text,{role:"badgeText",fontWeight:"500",textAlign:"center",...s==null?void 0:s.text,color:y.color,children:o||e})]})}),tc=e=>r.jsx(oc,{...e}),rc=()=>{const[e,o]=u.useState(!1);return{isHovered:e,setIsHovered:o}},nc={xs:12,sm:14,md:16,lg:18,xl:20},ac=({children:e,to:o="/",iconSize:t="sm",underline:n="default",isHovered:i=!1,isExternal:a=!1,views:l={icon:{},text:{}},setIsHovered:d=()=>{},...s})=>{const g=()=>{n==="hover"&&d(!0)},p=()=>{n==="hover"&&d(!1)},m=()=>n==="underline"||n==="hover"&&i?"underline":"none";return r.jsx(ti.Link,{to:o,target:a?"_blank":"_self",style:{textDecoration:"inherit",color:"inherit"},children:r.jsxs(c.Horizontal,{onMouseEnter:g,onMouseLeave:p,gap:3,alignItems:"center",flexWrap:"nowrap",textDecoration:m(),...l.text,...s,children:[e,a&&r.jsx(Er,{widthHeight:nc[t]})]})})},ic=e=>{const o=rc();return r.jsx(ac,{...o,...e})},Ar=ic,Pt={xs:14,sm:18,md:22,lg:26,xl:30},Wt={fast:50,normal:100,slow:300},lc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=a(t,{themeMode:n||l}),s=typeof e=="number"?e:Pt[e],[g,p]=u.useState(0);return u.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},Wt[o]);return()=>clearInterval(m)},[o]),r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${s}px`,height:`${s}px`,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:`rotate(${g}deg)`},...i,children:[r.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),r.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("g",{id:"SVGRepo_iconCarrier",children:r.jsx("path",{d:"M21 12a9 9 0 11-6.219-8.56"})})]})},cc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=a(t,{themeMode:n||l}),s=typeof e=="number"?e:Pt[e],[g,p]=u.useState(0);return u.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},Wt[o]);return()=>clearInterval(m)},[o]),r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${s}px`,height:`${s}px`,style:{transform:`rotate(${g}deg)`},...i,children:[r.jsx("circle",{cx:"10",cy:"25",r:"4",fill:d}),r.jsx("circle",{cx:"25",cy:"25",r:"4",fill:d}),r.jsx("circle",{cx:"40",cy:"25",r:"4",fill:d})]})},sc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=a(t,{themeMode:n||l}),s=typeof e=="number"?e:Pt[e],[g,p]=u.useState(0);return u.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},Wt[o]);return()=>clearInterval(m)},[o]),r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${s}px`,height:`${s}px`,style:{transform:`rotate(${g}deg)`},...i,children:r.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:d,strokeWidth:"5",strokeDasharray:"1,10"})})},dc=({size:e,children:o,textColor:t,loaderColor:n,type:i="default",speed:a="normal",textPosition:l="right",views:d,...s})=>{const{getColor:g}=c.useTheme();n=g(n||s.color||"theme-loading"),t=g(t||s.color||"theme-loading");const p={size:e,speed:a,color:n},m={default:r.jsx(lc,{...p}),dotted:r.jsx(cc,{...p}),quarter:r.jsx(sc,{...p})};return r.jsxs(c.Center,{gap:10,flexDirection:l==="top"||l==="bottom"?"column":"row",...s,...d==null?void 0:d.container,children:[(l==="left"||l==="top")&&o&&r.jsx(c.View,{color:t,...d==null?void 0:d.text,children:o}),m[i],(l==="right"||l==="bottom")&&o&&r.jsx(c.View,{color:t,...d==null?void 0:d.text,children:o})]})},uc=e=>r.jsx(dc,{...e}),uo=uc,gc={xs:10,sm:12,md:14,lg:16,xl:20},oo={xs:12,sm:16,md:20,lg:24,xl:28},to=e=>({minHeight:oo[e]*2,paddingHorizontal:oo[e]/2,fontSize:gc[e],fontWeight:500,lineHeight:oo[e],letterSpacing:"-0.01em",paddingInline:oo[e],paddingBlock:oo[e]/2,outlineWidth:"medium"}),Dr={xs:to("xs"),sm:to("sm"),md:to("md"),lg:to("lg"),xl:to("xl")},so={square:0,rounded:8,pill:999},Fr={xs:{width:16,height:16,padding:6},sm:{width:20,height:20,padding:6},md:{width:24,height:24,padding:8},lg:{width:24,height:24,padding:12},xl:{width:28,height:28,padding:14}},pc=(e,o,t=!1)=>{const n=t?o:e,i=t?e:o,a=t?o:e;return{filled:{backgroundColor:n,color:i,borderWidth:1,borderStyle:"solid",borderColor:"transparent",_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${n}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},empty:{backgroundColor:"transparent",color:a,borderWidth:1,borderStyle:"solid",borderColor:a,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},outline:{backgroundColor:"transparent",color:a,borderWidth:1,borderStyle:"solid",borderColor:a,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease"},ghost:{backgroundColor:"transparent",color:a,borderWidth:1,borderStyle:"solid",borderColor:"transparent",_hover:{borderWidth:1,borderStyle:"solid",borderColor:a,color:a,opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},link:{backgroundColor:"transparent",color:a,borderWidth:0,borderStyle:"none",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"2px",textDecorationThickness:"1px",textDecorationColor:a,_hover:{opacity:.8},_active:{opacity:.9},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"opacity 0.2s ease"},subtle:{backgroundColor:t?`color-mix(in srgb, ${a} 20%, transparent)`:`color-mix(in srgb, ${a} 5%, transparent)`,color:a,borderWidth:1,borderStyle:"solid",borderColor:a,_hover:{backgroundColor:t?`color-mix(in srgb, ${a} 40%, transparent)`:`color-mix(in srgb, ${a} 15%, transparent)`},_active:{backgroundColor:t?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.15)"},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"background-color 0.2s ease, box-shadow 0.2s ease"}}},mc=u.memo(({children:e,icon:o,isLoading:t,iconPosition:n="left",loaderPosition:i="left",size:a="md",resolvedTextColor:l,isIconRounded:d,views:s})=>{const g=["left","right"].includes(n)?c.Horizontal:c.Vertical,p=Dr[a],m=d?Fr[a]:{};return r.jsxs(g,{gap:8,alignItems:"center",justifyContent:"center",...p,...m,...s==null?void 0:s.content,children:[t&&i==="left"&&r.jsx(uo,{size:a==="xs"||a==="sm"?"sm":"md",color:l,...s==null?void 0:s.loader}),o&&["left","top"].includes(n)&&!t&&r.jsx(c.View,{color:l,...s==null?void 0:s.icon,children:o}),e,o&&["right","bottom"].includes(n)&&!t&&r.jsx(c.View,{color:l,...s==null?void 0:s.icon,children:o}),t&&i==="right"&&r.jsx(uo,{size:a==="xs"||a==="sm"?"sm":"md",color:l,...s==null?void 0:s.loader})]})}),hc=e=>{const o=so[e];return typeof o=="number"?o:typeof o=="string"&&parseInt(o,10)||0},fc=({asComponent:e,isDisabled:o,isLoading:t,isWrapped:n=!1,borderRadius:i,width:a,height:l,baseStyles:d,sizeStyles:s,iconPad:g,mainTone:p,resolvedTextColor:m,children:h,borderWidth:f=0,...x})=>r.jsx(c.Element,{as:e,disabled:!!(o||t),display:n?"flex":"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:i,width:a,height:l,...d,...s,...g,backgroundColor:(d==null?void 0:d.backgroundColor)||(n?p:void 0),color:m,borderWidth:n?0:void 0,cursor:o?"default":"pointer",...x,children:h}),xc=({shape:e,isDisabled:o,onClick:t,shadow:n,borderWidth:i,isAuto:a,isFilled:l,views:d,children:s,...g})=>r.jsx(c.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:so[e],cursor:o?"default":"pointer",onClick:t,boxShadow:n,padding:i,width:a?"fit-content":l?"100%":void 0,...d==null?void 0:d.container,...g,children:s}),bc=({variant:e,animation:o,to:t,isDisabled:n,isLoading:i,isAuto:a,isFilled:l,isExternal:d,shape:s="rounded",shadow:g,onClick:p,views:m,baseStyles:h,sizeStyles:f,iconPad:x,containerRef:y,resolvedTextColor:b,content:k,size:S,mainTone:w,borderMovingDuration:j=2,borderMovingGradientColors:C=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:I="#705CFF",animatedStrokeTextColor:M="#333333",getColor:R=_=>_,...V})=>{var B;const _=hc(s),T=t?r.jsx(Ar,{to:t,isExternal:d,color:"currentColor",textDecoration:"inherit",_hover:{color:"currentColor"},...m==null?void 0:m.link,children:k}):k,W={isDisabled:n,isLoading:i,baseStyles:h,sizeStyles:f,iconPad:x,resolvedTextColor:b,mainTone:w,children:T};if(o==="borderMoving"&&C){const z={from:{backgroundPosition:"0% 50%"},to:{backgroundPosition:"200% 50%"},duration:`${j}s`,timingFunction:"linear",iterationCount:"infinite"};return r.jsx(xc,{shape:s,isDisabled:n,onClick:p,shadow:g,borderWidth:3,isAuto:a,isFilled:l,views:m,background:`linear-gradient(90deg, ${C[0]}, ${C[1]}, ${C[2]}, ${C[0]})`,backgroundSize:"200% 100%",animate:z,...V,children:r.jsx(fc,{asComponent:t?"div":"button",isWrapped:!0,borderRadius:Math.max(0,_-3),width:"100%",height:"100%",...W})})}if(o==="animatedStroke"){const P=R(I),z=R(M),$=1e3,E={from:{strokeWidth:"8px",strokeDasharray:`0 ${$}`,strokeDashoffset:-Math.round($*.63)},to:{strokeWidth:"3px",strokeDasharray:`${$}`,strokeDashoffset:0},duration:"0.9s",timingFunction:"ease-in",fillMode:"forwards"},H=["group",(B=m==null?void 0:m.container)==null?void 0:B.className,V==null?void 0:V.className].filter(Boolean).join(" ");return r.jsxs(c.Element,{ref:y,as:t?"div":"button",type:t?void 0:"button",disabled:!!(!t&&(n||i)),onClick:p,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":l?"100%":void 0,borderRadius:so[s],boxShadow:g,transition:"background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",cursor:n?"default":"pointer",color:z,backgroundColor:"transparent",borderWidth:0,...m==null?void 0:m.container,...V,className:H,children:[r.jsx(c.View,{as:"svg",position:"absolute",top:0,right:0,bottom:0,left:0,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",pointerEvents:"none",zIndex:1,"aria-hidden":"true",children:r.jsx(c.View,{as:"rect",x:"0",y:"0",height:"100%",width:"100%",rx:_,ry:_,fill:"transparent",stroke:P,strokeWidth:"8px",strokeDasharray:`0 ${$}`,strokeDashoffset:-Math.round($*.63),pathLength:$,on:{groupHover:{animate:E}}})}),r.jsx(c.View,{position:"relative",zIndex:0,children:T})]})}if(o==="borderReveal"){const z=(C==null?void 0:C[0])||w||"#000000",E=j*.75/4,H=`linear-gradient(90deg, ${z} 50%, transparent 50%)`,L=`linear-gradient(180deg, ${z} 50%, transparent 50%)`,A=`linear-gradient(270deg, ${z} 50%, transparent 50%)`,F=`linear-gradient(0deg, ${z} 50%, transparent 50%)`,D="100% 0, 100% 100%, 0 100%, 0 0",q="0 0, 100% 0, 100% 100%, 0 100%",K=`0s, ${E}s, ${E*2}s, ${E*2}s`,Y=`${E*2}s, ${E*2}s, ${E}s, 0s`,O=4;return r.jsx(c.Element,{ref:y,as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:so[s],cursor:n?"default":"pointer",onClick:p,boxShadow:g,padding:3,background:`
3
2
  ${H} no-repeat,
4
3
  ${L} no-repeat,
5
- ${A} no-repeat
6
- `,backgroundSize:`200% ${Y}px, ${Y}px 200%, 200% ${Y}px, ${Y}px 200%`,backgroundPosition:F,transitionProperty:"background-position",transitionDuration:`${W}s`,transitionTimingFunction:"linear",transitionDelay:K,_hover:{backgroundPosition:D,transitionDelay:O},width:a?"fit-content":l?"100%":void 0,...m==null?void 0:m.container,...z,children:r.jsx(c.View,{as:t?"div":"button",disabled:!!(n||i),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:Math.max(0,E-3),width:"100%",height:"100%",...h,...f,...x,backgroundColor:(h==null?void 0:h.backgroundColor)||C,color:y,borderWidth:0,cursor:n?"default":"pointer",children:_})})}return r.jsx(c.Element,{as:e==="link"&&t?"div":"button",type:e==="link"&&t?void 0:"button",disabled:!!(n||i),...f,...x,display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":l?"100%":void 0,borderRadius:so[s],boxShadow:g,transition:"all 0.2s ease",cursor:n?"default":"pointer",onClick:p,...h,...m==null?void 0:m.container,...z,children:_})},gc=u.memo(({variant:e="filled",size:o="md",shape:t="rounded",iconPosition:n="left",loaderPosition:i="left",backgroundColor:a,color:l,textColor:d,reversed:s=!1,isAuto:g=!0,isFilled:p,isDisabled:m,isLoading:h,isIconRounded:f,isHovered:x,icon:y,children:b,to:k,isExternal:C,shadow:w,onClick:j,views:S={},borderMovingDuration:I=2,borderMovingGradientColors:M=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:z="#705CFF",animatedStrokeTextColor:E="#333333",..._})=>{const{getColorHex:T}=c.useTheme();let R=T(m?"theme-disabled":h?"theme-loading":a??l??"theme-button-background");(R==="theme-button-background"||R==="theme-loading")&&(R=T(h?"color-dark-500":"theme-primary"));let W=T(d??"theme-button-text");W==="theme-button-text"&&(W=T("color-white"));const H=u.useMemo(()=>ic(R,W,s),[R,W,s])[e],L=(H==null?void 0:H.color)??W,A=r.jsx(lc,{icon:y,isLoading:h,iconPosition:n,loaderPosition:i,size:o,resolvedTextColor:L,isIconRounded:f,views:S,children:b}),F=Dr[o],D=f?Fr[o]:{};return r.jsx(uc,{variant:e,animation:_.animation,to:k,isDisabled:m,isLoading:h,isAuto:g,isFilled:p,isExternal:C,shape:t,shadow:w,onClick:j,views:S,baseStyles:H,sizeStyles:F,iconPad:D,resolvedTextColor:L,content:A,size:o,mainTone:R,borderMovingDuration:I,borderMovingGradientColors:M,animatedStrokeAccentColor:z,animatedStrokeTextColor:E,getColor:T,..._})}),pc=e=>{const[o,t]=c.useHover();return r.jsx(gc,{ref:o,isHovered:t,...e})},_e=pc,mc={sm:{padding:"12px"},md:{padding:"16px"},lg:{padding:"24px"}},hc={square:0,rounded:"8px",pill:"24px"},fc=e=>{const o=e==="dark";return{default:{backgroundColor:o?"color-gray-900":"color-white",border:"none",transition:"background-color 0.2s ease, box-shadow 0.2s ease"},outlined:{backgroundColor:o?"color-gray-900":"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:o?"color-gray-700":"color-gray-200",transition:"border-color 0.2s ease, box-shadow 0.2s ease",_hover:{borderColor:o?"color-gray-600":"color-gray-300",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.05)"}},elevated:{backgroundColor:o?"color-gray-900":"color-white",boxShadow:o?"0px 4px 12px rgba(0, 0, 0, 0.3)":"0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)",border:"none",transition:"box-shadow 0.2s ease",_hover:{boxShadow:o?"0px 8px 16px rgba(0, 0, 0, 0.4)":"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)"}}}},vo=e=>{const o=e.themeMode==="dark";return{container:{backgroundColor:o?"color-gray-900":"color-white",color:o?"color-white":"color-black",borderRadius:"8px",overflow:"hidden",transition:"all 0.2s ease"},header:{padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:o?"color-gray-800":"color-gray-100",color:"theme-primary"},content:{padding:"16px",color:o?"color-gray-300":"color-gray-600"},footer:{padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:o?"color-gray-800":"color-gray-100"}}},Or=u.createContext({}),$t=()=>u.useContext(Or),gt=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=$t(),d=vo(a).header,s={...d,...l==null?void 0:l.header,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.header)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:8,...s,children:e})},pt=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=$t(),d=vo(a).content,s={...d,...l==null?void 0:l.content,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.content)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:12,...s,children:e})},mt=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=$t(),d=vo(a).footer,s={...d,...l==null?void 0:l.footer,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.footer)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:8,...s,children:e})},xc=({variant:e="default",size:o="md",shape:t="rounded",children:n,header:i,footer:a,isFullWidth:l=!1,views:d,style:s,themeMode:g,...p})=>{var j,S;const m=c.useTheme(),h=vo(m),f=((j=mc[o])==null?void 0:j.padding)||"16px",x=u.useMemo(()=>({styles:{container:{...h.container,borderRadius:hc[t],...d==null?void 0:d.container},header:{...h.header,padding:f,...d==null?void 0:d.header},content:{...h.content,padding:f,...d==null?void 0:d.content},footer:{...h.footer,padding:f,...d==null?void 0:d.footer}}}),[h,d,f,t]),y=u.Children.toArray(n).some(I=>u.isValidElement(I)&&(I.type===gt||I.type===pt||I.type===mt)),{themeMode:b}=m,C=fc(g||b)[e],w={width:l?"100%":"auto",overflow:"hidden",...C,...x.styles.container,...p,style:{...(S=x.styles.container)==null?void 0:S.style,...s}};return r.jsx(Or.Provider,{value:x,children:r.jsx(c.View,{...w,children:y?n:r.jsxs(c.Vertical,{width:"100%",children:[i&&r.jsx(gt,{children:i}),r.jsx(pt,{children:n}),a&&r.jsx(mt,{children:a})]})})})},bc=e=>r.jsx(xc,{...e}),Xo=bc;Xo.Header=gt;Xo.Content=pt;Xo.Footer=mt;const yc=({defaultActiveIndex:e=0,activeIndex:o,onChange:t,autoPlay:n=!1,autoPlayInterval:i=3e3,pauseOnHover:a=!0,infinite:l=!0,totalSlides:d,stepIndices:s})=>{const g=u.useRef(d||0),[p,m]=u.useState(d||0),h=u.useRef(new Set),f=u.useRef(0),x=u.useMemo(()=>Ct("carousel-content"),[]),[y,b]=u.useState(o!==void 0?o:e),[k,C]=u.useState(!1),[w,j]=u.useState(!1),[S,I]=u.useState(0),[M,z]=u.useState(0),E=u.useRef(null);u.useEffect(()=>{o!==void 0&&b(o)},[o]);const _=u.useCallback(D=>{let O=D;l?D<0?O=p-1:D>=p&&(O=0):O=Math.max(0,Math.min(D,p-1)),s&&s.length>0&&(s.includes(O)||(O=s.reduce((Y,N)=>Math.abs(N-O)<Math.abs(Y-O)?N:Y))),o===void 0&&b(O),t&&t(O)},[o,l,t,p]),T=u.useCallback(()=>{_(y+1)},[y,_]),$=u.useCallback(()=>{_(y-1)},[y,_]);u.useEffect(()=>(n&&!k&&!w&&(E.current=setInterval(()=>{T()},i)),()=>{E.current&&clearInterval(E.current)}),[n,i,k,w,T,a]);const B=u.useCallback(()=>{a&&C(!0)},[a]),R=u.useCallback(()=>{C(!1)},[]),V=u.useCallback(D=>{j(!0),"touches"in D?(I(D.touches[0].clientX),z(D.touches[0].clientY)):(I(D.clientX),z(D.clientY))},[]),W=u.useCallback(D=>{if(!w)return;let O,K;"touches"in D?(O=D.touches[0].clientX,K=D.touches[0].clientY):(O=D.clientX,K=D.clientY);const Y=O-S,N=K-M;Math.abs(Y)>Math.abs(N)&&Math.abs(Y)>50&&(Y>0?$():T(),j(!1))},[w,S,M,T,$]),P=u.useCallback(()=>{j(!1)},[]),H=u.useCallback(()=>{const D=f.current++;h.current.add(D);const O=h.current.size;return g.current=O,m(O),D},[]),L=u.useCallback(D=>{h.current.delete(D);const O=h.current.size;if(g.current=O,m(O),O>0&&y>=O){const K=Math.max(0,O-1);o===void 0&&b(K),t&&t(K)}},[y,o,t]),A=l||y>0,F=l||y<p-1;return{activeIndex:y,totalSlides:p,goToSlide:_,nextSlide:T,prevSlide:$,canGoNext:F,canGoPrevious:A,handleMouseEnter:B,handleMouseLeave:R,handleDragStart:V,handleDragMove:W,handleDragEnd:P,registerSlide:H,unregisterSlide:L,contentId:x,infinite:l}},kc={dot:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},line:{width:"20px",height:"4px",borderRadius:"2px",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},number:{minWidth:"24px",height:"24px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",transition:"background-color 0.3s ease"}},jc={dot:{backgroundColor:"theme-primary"},line:{backgroundColor:"theme-primary"},number:{backgroundColor:"theme-primary",color:"color-white"}},Wo={width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"color-white",color:"color-gray-800",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",boxShadow:"0 2px 5px rgba(0, 0, 0, 0.1)",zIndex:1,transition:"background-color 0.3s ease",_hover:{backgroundColor:"color-gray-100"}},mo=()=>({container:{position:"relative",overflow:"hidden"},content:{overflow:"hidden",width:"100%",height:"100%"},innerContainer:{display:"flex",transitionProperty:"transform",transitionDuration:"300ms",transitionTimingFunction:"ease-in-out",height:"100%"},item:{flex:"0 0 100%",minWidth:0,position:"relative",height:"100%"},prevButton:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)",zIndex:10,...Wo},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...Wo}}),qr=u.createContext(null),Ko=()=>{const e=u.useContext(qr);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},Nr=({children:e,isActive:o,views:t,...n})=>r.jsx(c.View,{flexShrink:0,width:"100%",height:"100%",display:o?"block":"none",...t,...n,children:e}),Ur=({views:e,children:o,...t})=>{const{goToPrevious:n,canGoPrevious:i,styles:a}=Ko(),d={...mo().prevButton,...a==null?void 0:a.prevButton,...e==null?void 0:e.prevButton};return r.jsx(_e,{"aria-label":"Previous slide",onClick:()=>n(),isDisabled:!i,...d,...t,children:o??r.jsx(ae,{orientation:"left",widthHeight:16})})},Gr=({views:e,children:o,...t})=>{const{goToNext:n,canGoNext:i,styles:a}=Ko(),d={...mo().nextButton,...a==null?void 0:a.nextButton,...e==null?void 0:e.nextButton};return r.jsx(_e,{"aria-label":"Next slide",onClick:()=>n(),isDisabled:!i,...d,...t,children:o??r.jsx(ae,{orientation:"right",widthHeight:16})})},Yr=({children:e,views:o,...t})=>{const{registerSlide:n,unregisterSlide:i,styles:a}=Ko(),l=u.useRef(null);u.useEffect(()=>{const g=n();return l.current=g,()=>{l.current!==null&&i(l.current)}},[n,i]);const s={...mo().item,...a==null?void 0:a.item,...o==null?void 0:o.item};return r.jsx(c.View,{role:"group","aria-roledescription":"slide",...s,...t,children:e})},vr=({children:e,views:o,style:t,...n})=>{const{currentIndex:i,styles:a,contentId:l}=Ko(),d=mo(),s={...d.content,...a==null?void 0:a.content,...o==null?void 0:o.content},g={...d.innerContainer,...a==null?void 0:a.innerContainer,...o==null?void 0:o.innerContainer},p=`-${i*100}%`;return r.jsx(c.View,{...s,...n,style:{...s==null?void 0:s.style,...t},id:l,"aria-live":"polite",children:r.jsx(c.View,{...g,style:{...g==null?void 0:g.style,transform:`translateX(${p})`},children:e})})},Cc=({children:e,defaultActiveIndex:o=0,activeIndex:t,onChange:n,showNavigation:i=!0,navigationPosition:a="inside",prevButton:l,nextButton:d,showIndicators:s=!0,indicatorPosition:g="bottom",indicatorVariant:p="dot",autoPlay:m=!1,autoPlayInterval:h=3e3,pauseOnHover:f=!0,infinite:x=!0,direction:y="horizontal",transitionDuration:b=300,views:k,stepIndices:C,themeMode:w,...j})=>{const S=u.useMemo(()=>u.Children.toArray(e),[e]),I=yc({defaultActiveIndex:o,activeIndex:t,onChange:n,autoPlay:m,autoPlayInterval:h,pauseOnHover:f,infinite:x,totalSlides:S.length}),{activeIndex:M,totalSlides:z,goToSlide:E,nextSlide:_,prevSlide:T,handleMouseEnter:$,handleMouseLeave:B,handleDragStart:R,handleDragMove:V,handleDragEnd:W}=I,P=()=>{if(!i)return null;const A=l||r.jsx(c.View,{as:"button","aria-label":"Previous slide",...Wo,...k==null?void 0:k.prevButton,children:"❮"}),F=d||r.jsx(c.View,{as:"button","aria-label":"Next slide",...Wo,...k==null?void 0:k.nextButton,children:"❯"});return r.jsxs(r.Fragment,{children:[r.jsx(c.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",left:a==="inside"?"10px":"-40px",onClick:T,cursor:!x&&M===0?"not-allowed":"pointer",opacity:!x&&M===0?.5:1,children:A}),r.jsx(c.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",right:a==="inside"?"10px":"-40px",onClick:_,cursor:!x&&M===S.length-1?"not-allowed":"pointer",opacity:!x&&M===S.length-1?.5:1,children:F})]})},H=()=>s?r.jsx(c.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...g==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:S.map((A,F)=>r.jsx(c.View,{onClick:()=>E(F),cursor:"pointer",...kc[p],...F===M?{...jc[p]}:{},...k==null?void 0:k.indicator,...F===M?k==null?void 0:k.activeIndicator:{},children:p==="number"&&F+1},F))}):null;return u.useMemo(()=>u.Children.toArray(e).some(A=>u.isValidElement(A)&&(A.type===vr||A.type===Yr||A.type===Ur||A.type===Gr)),[e])?r.jsx(qr.Provider,{value:{currentIndex:M,totalSlides:z,goToSlide:E,goToNext:_,goToPrevious:T,canGoNext:I.canGoNext,canGoPrevious:I.canGoPrevious,registerSlide:I.registerSlide,unregisterSlide:I.unregisterSlide,styles:{...mo(),...k},contentId:I.contentId,infinite:x},children:r.jsx(c.View,{role:"region","aria-roledescription":"carousel","aria-label":"Carousel",position:"relative",width:"100%",height:"100%",overflow:"hidden",...k==null?void 0:k.container,...j,children:e})}):r.jsxs(c.View,{position:"relative",width:"100%",height:"100%",overflow:"hidden",onMouseEnter:$,onMouseLeave:B,onTouchStart:R,onTouchMove:V,onTouchEnd:W,onMouseDown:R,onMouseMove:V,onMouseUp:W,...k==null?void 0:k.container,...j,children:[r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...k==null?void 0:k.slideWrapper,children:S.map((A,F)=>r.jsx(Nr,{isActive:F===M,index:F,views:k==null?void 0:k.slide,children:A},F))}),P(),H()]})},Sc=e=>r.jsx(Cc,{...e}),Xe=Sc;Xe.Slide=Nr;Xe.Content=vr;Xe.Item=Yr;Xe.Previous=Ur;Xe.Next=Gr;const ke={blue:"color-blue-500",green:"color-green-500",purple:"color-purple-500",orange:"color-orange-500",red:"color-red-500",teal:"color-teal-500",pink:"color-pink-500",indigo:"color-indigo-500",yellow:"color-yellow-500",cyan:"color-cyan-500"},wc=[ke.blue,ke.green,ke.purple,ke.orange,ke.red,ke.teal,ke.pink,ke.indigo,ke.yellow,ke.cyan],Ge=wc,Ic={width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},Tc={fontSize:"18px",fontWeight:"bold",marginBottom:"16px",textAlign:"center"},Mc={display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"16px"},zc={display:"flex",alignItems:"center",marginRight:"16px",marginBottom:"8px"},Rc={width:"12px",height:"12px",borderRadius:"2px",marginRight:"6px"},Vc={fontSize:"14px"},Xr={stroke:"color-gray-200",strokeWidth:"1px"},_o={stroke:"color-gray-300",strokeWidth:"1px"},$o={fontSize:"12px",fill:"color-gray-600"},Ec={rx:"2px",ry:"2px",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},Pc={strokeWidth:"2px",fill:"none"},Wc={r:"4px",strokeWidth:"2px",stroke:"white",cursor:"pointer",transition:"r 0.2s ease"},Co={strokeWidth:"1px",stroke:"white",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},Ht={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)",borderRadius:"4px",zIndex:10,padding:"16px",textAlign:"center"},_c={...Ht},$c={...Ht,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},Hc={...Ht,backgroundColor:"rgba(245, 245, 245, 0.8)",color:"color-gray-600"},Bc=({data:e,dataPoints:o,animated:t=!0,animationDuration:n=500,showTooltips:i=!0})=>{const[a,l]=u.useState(t?0:1),[d,s]=u.useState({visible:!1,x:0,y:0,content:null}),g=u.useRef(null),p=u.useRef(null);u.useEffect(()=>{if(!t){l(1);return}const y=Date.now(),b=()=>{const k=Date.now()-y,C=Math.min(k/n,1);l(C),C<1&&(g.current=requestAnimationFrame(b))};return g.current=requestAnimationFrame(b),()=>{g.current&&cancelAnimationFrame(g.current)}},[t,n]);const m=u.useCallback(()=>e?{...e,series:e.series.map((y,b)=>({...y,color:y.color||Ge[b%Ge.length]}))}:o?o.map((y,b)=>({...y,color:y.color||Ge[b%Ge.length]})):null,[e,o]),h=u.useCallback((y,b,k)=>{i&&s({visible:!0,x:y,y:b,content:k})},[i]),f=u.useCallback(()=>{s(y=>({...y,visible:!1}))},[]),x=u.useCallback(()=>{if(!p.current)return{width:0,height:0};const{width:y,height:b}=p.current.getBoundingClientRect();return{width:y,height:b}},[]);return{animationProgress:a,tooltip:d,containerRef:p,processedData:m,showTooltip:h,hideTooltip:f,getChartDimensions:x}},Lc=({data:e,width:o,height:t,animationProgress:n,showGrid:i=!0,onBarClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),p={top:20,right:20,bottom:40,left:50},m=o-p.left-p.right,h=t-p.top-p.bottom,f=u.useMemo(()=>{let S=0;return e.series.forEach(I=>{I.data.forEach(M=>{S=Math.max(S,M)})}),S},[e]),x=e.labels.length,y=e.series.length,b=m/x,k=b*.8/y,C=b*.2/(y+1),w=f||10,j=u.useMemo(()=>{const I=[];for(let M=0;M<=5;M++){const z=w/5*M;I.push(z)}return I},[f]);return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:p.left,y1:t-p.bottom,x2:o-p.right,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),r.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),e.labels.map((S,I)=>{const M=p.left+(I+.5)*b,z=t-p.bottom+20;return r.jsx("text",{x:M,y:z,textAnchor:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:S},`x-label-${I}`)}),j.map((S,I)=>{const M=t-p.bottom-S/w*h;return r.jsxs(u.Fragment,{children:[r.jsx("text",{x:p.left-10,y:M,textAnchor:"end",dominantBaseline:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:S.toFixed(0)}),i&&r.jsx("line",{x1:p.left,y1:M,x2:o-p.right,y2:M,...Xr,...s==null?void 0:s.grid})]},`y-tick-${I}`)}),e.series.map((S,I)=>r.jsx(u.Fragment,{children:S.data.map((M,z)=>{const E=M/w*h*n,_=p.left+z*b+C*(I+1)+k*I,T=t-p.bottom-E,$=e.labels[z],B=e.series.reduce((H,L)=>{const A=L.data[z];return H+(typeof A=="number"?A:0)},0),R=B>0?(M/B*100).toFixed(1):null,V=S.color?g(S.color):"black",W=H=>{const L=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"180px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:S.name}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:V})]}),r.jsx(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:$}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:M.toLocaleString()})]}),R!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:`${R}%`})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(c.Text,{fontWeight:"medium",children:B.toLocaleString()})]})]})]});l(H.clientX,H.clientY,L)},P=()=>{a&&a(S.name,z)};return r.jsx("rect",{x:_,y:T,width:k,height:E,fill:V,onMouseEnter:W,onMouseLeave:d,onClick:P,...Ec,...s==null?void 0:s.bar},`bar-${I}-${z}`)})},`series-${I}`))]})},Ac=({data:e,width:o,height:t,animationProgress:n,showGrid:i=!0,onPointClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),p={top:20,right:20,bottom:40,left:50},m=o-p.left-p.right,h=t-p.top-p.bottom,f=u.useMemo(()=>{let C=0;return e.series.forEach(w=>{w.data.forEach(j=>{C=Math.max(C,j)})}),C},[e]),x=f||10,y=u.useMemo(()=>{const w=[];for(let j=0;j<=5;j++){const S=x/5*j;w.push(S)}return w},[f]),b=C=>`M ${C.map((j,S)=>{const I=p.left+S/(e.labels.length-1)*m,M=t-p.bottom-j/x*h*n;return`${I},${M}`}).join(" L ")}`,k=C=>{const w=p.left,j=p.left+m,S=t-p.bottom,I=C.map((M,z)=>{const E=p.left+z/(e.labels.length-1)*m,_=t-p.bottom-M/x*h*n;return`${E},${_}`});return`M ${w},${S} L ${I.join(" L ")} L ${j},${S} Z`};return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:p.left,y1:t-p.bottom,x2:o-p.right,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),r.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),e.labels.map((C,w)=>{const j=p.left+w/(e.labels.length-1)*m,S=t-p.bottom+20;return r.jsx("text",{x:j,y:S,textAnchor:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:C},`x-label-${w}`)}),y.map((C,w)=>{const j=t-p.bottom-C/x*h;return r.jsxs(u.Fragment,{children:[r.jsx("text",{x:p.left-10,y:j,textAnchor:"end",dominantBaseline:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:C.toFixed(0)}),i&&r.jsx("line",{x1:p.left,y1:j,x2:o-p.right,y2:j,...Xr,...s==null?void 0:s.grid})]},`y-tick-${w}`)}),e.series.map((C,w)=>{const j=C.color?g(C.color):"black";return r.jsxs(u.Fragment,{children:[r.jsx("path",{d:k(C.data),fill:j,opacity:.1,...s==null?void 0:s.area}),r.jsx("path",{d:b(C.data),stroke:j,...Pc,...s==null?void 0:s.line}),C.data.map((S,I)=>{const M=p.left+I/(e.labels.length-1)*m,z=t-p.bottom-S/x*h*n,E=e.labels[I],_=e.series.reduce((P,H)=>{const L=H.data[I];return P+(typeof L=="number"?L:0)},0),T=_>0?(S/_*100).toFixed(1):null,$=I>0&&typeof C.data[I-1]=="number"?C.data[I-1]:null,B=typeof $=="number"?S-$:null,R=typeof B=="number"?`${B>=0?"+":""}${B.toLocaleString()}`:null,V=P=>{const H=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:C.name}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:j})]}),r.jsx(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:E}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:S.toLocaleString()})]}),R!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Change"}),r.jsx(c.Text,{fontWeight:"medium",children:R})]}),T!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:`${T}%`})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(c.Text,{fontWeight:"medium",children:_.toLocaleString()})]})]})]});l(P.clientX,P.clientY,H)},W=()=>{a&&a(C.name,I)};return r.jsx("circle",{cx:M,cy:z,fill:j,onMouseEnter:V,onMouseLeave:d,onClick:W,...Wc,...s==null?void 0:s.point},`point-${w}-${I}`)})]},`series-${w}`)})]})},Dc=({dataPoints:e,width:o,height:t,animationProgress:n,isDonut:i=!1,onSliceClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),{ref:p,relation:m}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),h=u.useRef(null);u.useEffect(()=>{h.current&&p&&(p.current=h.current)},[h,p]);const x=Math.min(o,t)/2*.8,y=o/2,b=t/2,k=i?x*.6:0,C=u.useMemo(()=>e.reduce((j,S)=>j+S.value,0),[e]),w=u.useMemo(()=>{if(C===0)return[{path:i?[`M ${y} ${b-x}`,`A ${x} ${x} 0 1 1 ${y} ${b+x}`,`A ${x} ${x} 0 1 1 ${y} ${b-x}`,`M ${y} ${b-k}`,`A ${k} ${k} 0 1 0 ${y} ${b+k}`,`A ${k} ${k} 0 1 0 ${y} ${b-k}`,"Z"].join(" "):[`M ${y} ${b}`,`M ${y} ${b-x}`,`A ${x} ${x} 0 1 1 ${y} ${b+x}`,`A ${x} ${x} 0 1 1 ${y} ${b-x}`,"Z"].join(" "),color:"#E2E8F0",label:"Total",value:0,percentage:"0%",labelX:y,labelY:b,startAngle:0,endAngle:Math.PI*2,index:-1}];const j=[];let S=-Math.PI/2;for(let I=0;I<e.length;I++){const z=e[I].value/C,E=z*2*Math.PI*n,_=S+E,T=y+Math.cos(S)*x,$=b+Math.sin(S)*x,B=y+Math.cos(_)*x,R=b+Math.sin(_)*x,V=y+Math.cos(S)*k,W=b+Math.sin(S)*k,P=y+Math.cos(_)*k,H=b+Math.sin(_)*k,L=E>Math.PI?1:0;let A;i?A=[`M ${T} ${$}`,`A ${x} ${x} 0 ${L} 1 ${B} ${R}`,`L ${P} ${H}`,`A ${k} ${k} 0 ${L} 0 ${V} ${W}`,"Z"].join(" "):A=[`M ${y} ${b}`,`L ${T} ${$}`,`A ${x} ${x} 0 ${L} 1 ${B} ${R}`,"Z"].join(" ");const F=S+E/2,D=x*.7,O=y+Math.cos(F)*D,K=b+Math.sin(F)*D,Y=`${(z*100).toFixed(1)}%`,N=e[I].color||Ge[I%Ge.length],X=g(N);j.push({path:A,color:X,label:e[I].label,value:e[I].value,percentage:Y,labelX:O,labelY:K,startAngle:S,endAngle:_,index:I}),S=_}return j},[e,C,x,y,b,k,n,i]);return r.jsxs("svg",{ref:h,width:o,height:t,style:{overflow:"visible"},children:[i&&r.jsx("circle",{cx:y,cy:b,r:k,fill:"white",pointerEvents:"none"}),w.map((j,S)=>{const I=E=>{const _=C>0?j.value/C*100:0,T=C>0?Math.max(0,100-_):null,$=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:j.label}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:j.color})]}),r.jsxs(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:["Slice ",j.index+1," of ",e.length]}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:j.value.toLocaleString()})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:j.percentage})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Total"}),r.jsx(c.Text,{fontWeight:"medium",children:C.toLocaleString()})]}),T!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Remaining"}),r.jsx(c.Text,{fontWeight:"medium",children:`${T.toFixed(1)}%`})]})]})]});let B=E.clientX,R=E.clientY;if(m&&h.current){const V=h.current.getBoundingClientRect();E.clientX-V.left,E.clientY-V.top,m.space.horizontal==="left"?B=E.clientX-100:B=E.clientX+10,m.space.vertical==="top"?R=E.clientY-30:R=E.clientY+10}l(B,R,$)},M=()=>{j.index!==-1&&a&&a(e[j.index],j.index)},z=j.index===-1;return r.jsxs("g",{children:[r.jsx("path",{d:j.path,fill:j.color,onMouseEnter:z?void 0:I,onMouseLeave:z?void 0:d,onClick:M,...Co,style:{...Co==null?void 0:Co.style,cursor:z?"default":"pointer"},...s==null?void 0:s.pie}),!z&&j.endAngle-j.startAngle>.2&&r.jsx("text",{x:j.labelX,y:j.labelY,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontWeight:"bold",pointerEvents:"none",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3)",filter:"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))"},children:j.percentage})]},`slice-${S}`)})]})},Fc=({visible:e,x:o,y:t,content:n,maxDistance:i=100,views:a})=>{const l=u.useRef(null),[d,s]=u.useState({left:0,top:0});return u.useEffect(()=>{if(!e||!l.current)return;const p=l.current.getBoundingClientRect(),m=p.width,h=p.height,f=10,x=15;let y=o-x,b=t-x;const k=o-y,C=t-b;k>i&&(y=o-i),C>i&&(b=t-i),y+m>window.innerWidth-f&&(y=window.innerWidth-m-f,o-y>i&&(y=o-i)),y<f&&(y=f),b+h>window.innerHeight-f&&(b=window.innerHeight-h-f,t-b>i&&(b=t-i)),b<f&&(b=f),s({left:y,top:b})},[e,o,t,i]),e?r.jsx(c.View,{ref:l,position:"fixed",left:`${d.left}px`,top:`${d.top}px`,backgroundColor:"color-white",padding:"12px 16px",borderRadius:"8px",boxShadow:"0px 12px 24px rgba(15, 23, 42, 0.18)",border:"1px solid color-gray-200",fontSize:"14px",display:"flex",flexDirection:"column",pointerEvents:"none",zIndex:10,...a==null?void 0:a.tooltip,children:n}):null},Oc=({type:e,data:o,dataPoints:t,title:n,showLegend:i=!0,legendPosition:a="bottom",showGrid:l=!0,showTooltips:d=!0,animated:s=!0,animationDuration:g=500,responsive:p=!0,aspectRatio:m=16/9,width:h=200,height:f=200,views:x,onDataPointClick:y,onSeriesClick:b,isLoading:k=!1,error:C,noData:w,loadingIndicator:j,errorIndicator:S,noDataIndicator:I,"aria-label":M,themeMode:z,...E})=>{const{animationProgress:_,tooltip:T,containerRef:$,processedData:B,showTooltip:R,hideTooltip:V,getChartDimensions:W}=Bc({data:o,dataPoints:t,animated:s,animationDuration:g,showTooltips:d}),P=B(),{width:H,height:L}=W(),A=h||H,F=f||(p?H/m:L),D=()=>{if(!i||!P)return null;let J=[];return e==="pie"||e==="donut"?Array.isArray(P)&&(J=P):P&&P.series&&(J=P.series),!J||J.length===0?null:r.jsx(c.Horizontal,{flexWrap:"wrap",justifyContent:"center",marginTop:a==="bottom"?"16px":0,marginBottom:a==="top"?"16px":0,...Mc,...x==null?void 0:x.legend,children:J.map((oe,re)=>r.jsxs(c.View,{...zc,...x==null?void 0:x.legendItem,children:[r.jsx(c.View,{backgroundColor:oe.color,...Rc}),r.jsx(c.Text,{...Vc,children:oe.name||oe.label})]},`legend-${re}`))})},O=()=>{if(!P)return null;switch(e){case"bar":return r.jsx(Lc,{data:P,width:A,height:F,animationProgress:_,showGrid:l,onBarClick:b,showTooltip:R,hideTooltip:V,views:x});case"line":case"area":return r.jsx(Ac,{data:P,width:A,height:F,animationProgress:_,showGrid:l,onPointClick:b,showTooltip:R,hideTooltip:V,views:x});case"pie":case"donut":return r.jsx(Dc,{dataPoints:P,width:A,height:F,animationProgress:_,isDonut:e==="donut",onSliceClick:y,showTooltip:R,hideTooltip:V,views:x});default:return null}},K=()=>k?r.jsx(c.View,{..._c,...x==null?void 0:x.loadingOverlay,children:j||r.jsx(c.Center,{children:r.jsx(uo,{size:"lg"})})}):null,Y=()=>C?r.jsx(c.View,{...$c,...x==null?void 0:x.errorOverlay,children:S||r.jsx(c.Text,{fontWeight:"medium",children:typeof C=="string"?C:"An error occurred"})}):null,N=()=>w?r.jsx(c.View,{...Hc,...x==null?void 0:x.noDataOverlay,children:I||r.jsx(c.Text,{children:typeof w=="string"?w:"No data available"})}):null,X=M??(typeof n=="string"?n:"Chart"),Z=!C&&!k&&!w;return r.jsxs(c.View,{ref:$,role:"region","aria-label":X,"aria-busy":k,...Ic,...x==null?void 0:x.container,...E,children:[n&&r.jsx(c.Text,{...Tc,children:n}),Z&&a==="top"&&D(),r.jsxs(c.View,{flex:1,width:"100%",position:"relative",...x==null?void 0:x.chart,children:[Z&&O(),K(),Y(),N()]}),Z&&a==="bottom"&&D(),r.jsx(Fc,{visible:d&&T.visible,x:T.x,y:T.y,content:T.content,maxDistance:100,views:x})]})},qc=e=>r.jsx(Oc,{...e}),Nc=qc,Uc=(e=365)=>{const[o,t]=u.useState(!1),[n,i]=u.useState(null),a="app-studio-cookie-consent";u.useEffect(()=>{const g=localStorage.getItem(a);i(g!==null?g==="true":!1)},[]);const l=g=>{localStorage.setItem(a,String(g));const p=new Date;p.setDate(p.getDate()+e),localStorage.setItem(`${a}-expires`,p.toISOString()),i(g)};return{isHovered:o,setIsHovered:t,hasConsent:n,acceptCookies:()=>{l(!0)},resetConsent:()=>{localStorage.removeItem(a),localStorage.removeItem(`${a}-expires`),i(!1)}}},Gc=e=>{const o=e==="dark";return{default:{container:{backgroundColor:o?"#1f2937":"#ffffff",borderColor:o?"#374151":"#e5e7eb",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#e5e7eb":"#1f2937"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:o?"#e5e7eb":"#4b5563",borderColor:o?"#4b5563":"#d1d5db",hoverBackgroundColor:o?"#374151":"#f3f4f6"}},info:{container:{backgroundColor:o?"#1e3a8a":"#eff6ff",borderColor:o?"#1e40af":"#bfdbfe",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#bfdbfe":"#1e40af"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:o?"#bfdbfe":"#1e40af",borderColor:o?"#3b82f6":"#93c5fd",hoverBackgroundColor:o?"#1e40af":"#dbeafe"}},primary:{container:{backgroundColor:o?"#0c4a6e":"#f0f9ff",borderColor:o?"#0369a1":"#bae6fd",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#bae6fd":"#0369a1"},acceptButton:{backgroundColor:"#0ea5e9",color:"#ffffff",hoverBackgroundColor:"#0284c7"},customizeButton:{backgroundColor:"transparent",color:o?"#bae6fd":"#0369a1",borderColor:o?"#0ea5e9":"#7dd3fc",hoverBackgroundColor:o?"#0369a1":"#e0f2fe"}}}},Yc=({title:e="Nous utilisons des cookies",description:o="Ce site utilise des cookies pour améliorer votre expérience. En continuant à naviguer sur ce site, vous acceptez notre utilisation des cookies conformément à notre politique de confidentialité.",acceptButtonText:t="Accepter",customizeButtonText:n="Personnaliser",position:i="bottom",variant:a="default",onAccept:l,onCustomize:d,views:s,showCustomizeButton:g=!0,cookieExpiration:p=365,themeMode:m,...h})=>{const{themeMode:f}=c.useTheme(),x=m||f||"light",{hasConsent:y,acceptCookies:b}=Uc(p),C=Gc(x)[a];if(y)return null;const w=()=>{b(),l&&l()},j=()=>{d&&d()};return r.jsx(c.View,{position:"fixed",left:16,right:16,zIndex:1e3,padding:16,borderWidth:"1px",borderStyle:"solid",borderRadius:8,maxWidth:"800px",marginX:"auto",...i==="bottom"?{bottom:16}:{top:16},...C.container,...s==null?void 0:s.container,...h,children:r.jsxs(c.Vertical,{gap:12,maxWidth:1200,marginX:"auto",children:[e&&r.jsx(c.Text,{fontWeight:"bold",fontSize:18,color:"color-black",...s==null?void 0:s.title,children:e}),o&&r.jsx(c.Text,{fontSize:14,color:"color-black",...s==null?void 0:s.description,children:o}),r.jsxs(c.Horizontal,{gap:12,justifyContent:"flex-end",marginTop:8,...s==null?void 0:s.buttonGroup,children:[g&&r.jsx(_e,{variant:"outline",onClick:j,size:"sm",...s==null?void 0:s.customizeButton,children:n}),r.jsx(_e,{variant:"primary",onClick:w,size:"sm",...s==null?void 0:s.acceptButton,children:t})]})]})})},vc=e=>r.jsx(Yc,{...e}),Xc=vc,Kc=e=>{const{size:o,variant:t,onOpenChange:n}=e||{},[i,a]=u.useState(!1),[l,d]=u.useState({x:0,y:0}),[s,g]=u.useState(null),p=u.useRef(null),m=u.useRef(null),h=u.useMemo(()=>Ct("contextmenu-content"),[]),f=u.useCallback(y=>{d({x:y.clientX,y:y.clientY}),a(!0),n==null||n(!0)},[n]),x=u.useCallback(()=>{a(!1),g(null),n==null||n(!1)},[n]);return u.useEffect(()=>{const y=C=>{m.current&&!m.current.contains(C.target)&&x()},b=()=>{i&&x()},k=C=>{C.key==="Escape"&&i&&x()};return document.addEventListener("mousedown",y),window.addEventListener("resize",b),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",y),window.removeEventListener("resize",b),document.removeEventListener("keydown",k)}},[i,x]),{isOpen:i,setIsOpen:a,position:l,setPosition:d,activeSubmenuId:s,setActiveSubmenuId:g,size:o,variant:t,triggerRef:p,contentRef:m,contentId:h,openMenu:f,closeMenu:x}},Xt={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Qc={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Kt={hover:{backgroundColor:"color-gray-100"}},Kr=u.createContext({isOpen:!1,setIsOpen:()=>{},position:{x:0,y:0},setPosition:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null},contentRef:{current:null},contentId:"contextmenu-content",closeMenu:()=>{},openMenu:()=>{}}),Zc=({children:e,value:o})=>r.jsx(Kr.Provider,{value:o,children:e}),Ho=()=>{const e=u.useContext(Kr);if(!e)throw new Error("useContextMenuContext must be used within a ContextMenuProvider");return e},Qr=({children:e,disableNativeContextMenu:o=!0,asChild:t=!1,isDisabled:n=!1,views:i,...a})=>{const{triggerRef:l,contentId:d,openMenu:s}=Ho(),p={ref:l,onContextMenu:m=>{if(!n)if(o&&m.preventDefault(),s)s(m);else{const{setIsOpen:h,setPosition:f}=Ho();f({x:m.clientX,y:m.clientY}),h(!0)}},"aria-controls":d,"aria-haspopup":"menu","data-disabled":n?"":void 0,...t&&u.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:n},...i==null?void 0:i.container,...a};if(t&&u.isValidElement(e)){const m=u.Children.only(e);return u.cloneElement(m,{...p,...m.props})}return r.jsx(c.View,{...p,children:e})},Bt=({items:e,children:o,position:t,side:n="right",align:i="start",views:a,style:l,...d})=>{const{isOpen:s,position:g,contentRef:p,contentId:m,variant:h}=Ho(),f=u.useRef(null),x=p||f,{ref:y,relation:b}=c.useElementPosition({}),[k,C]=u.useState({x:0,y:0});if(u.useEffect(()=>{if(s&&x.current){const j=t||g,S=x.current.offsetWidth,I=x.current.offsetHeight,M=window.innerWidth,z=window.innerHeight;let E=j.x,_=j.y;b&&(b.space.horizontal==="left"?E=j.x-S:E=j.x,b.space.vertical==="top"?_=j.y-I:_=j.y),E+S>M&&(E=M-S-8),E<8&&(E=8),_+I>z&&(_=z-I-8),_<8&&(_=8),C({x:E,y:_})}},[s,g,t,n,i,x,b]),!s)return null;const w={position:"fixed",top:`${k.y}px`,left:`${k.x}px`,zIndex:1e3,transformOrigin:"top left"};return r.jsxs(c.View,{id:m||"context-menu",ref:x,role:"menu",tabIndex:-1,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:{...w,...l},...Qc[h],...a==null?void 0:a.menu,...a==null?void 0:a.content,...d,children:[e&&e.map((j,S)=>j.divider?r.jsx(Jr,{views:a},`divider-${S}`):r.jsx(Zr,{item:j,views:a},j.id)),o]})},Zr=({item:e,children:o,onSelect:t,isDisabled:n=!1,views:i,...a})=>{const{activeSubmenuId:l,setActiveSubmenuId:d,size:s,closeMenu:g}=Ho();if(e){const[m,h]=u.useState(!1),f=e.items&&e.items.length>0,x=l===e.id,[y,b]=u.useState({x:0,y:0}),k=e.disabled||n,C=()=>{h(!0),f&&d(e.id)},w=()=>{h(!1)},j=()=>{k||!f&&e.onClick&&(e.onClick(),g&&g())},{ref:S,relation:I}=c.useElementPosition({});return u.useEffect(()=>{if(x&&S.current){const M=S.current.getBoundingClientRect(),z=window.innerWidth,E=200;let _=!1;if(I)_=I.space.horizontal==="left";else{const T=z-M.right,$=M.left;_=T<E&&$>T}b({x:_?M.left-E:M.right,y:M.top})}},[x,e.items,I]),r.jsxs(c.View,{ref:S,role:"menuitem",display:"flex",alignItems:"center",cursor:k?"not-allowed":"pointer",opacity:k?.5:1,position:"relative","aria-disabled":k,"data-disabled":k?"":void 0,...Xt[s],_hover:k?{}:Kt.hover,backgroundColor:m&&!k?"color-gray-100":"transparent",onMouseEnter:C,onMouseLeave:w,onClick:j,...i==null?void 0:i.item,...a,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),r.jsx(c.View,{flexGrow:1,children:e.label}),f&&r.jsx(c.View,{marginLeft:8,...i==null?void 0:i.submenuIndicator,children:r.jsx(ae,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),x&&f&&r.jsx(Bt,{items:e.items||[],position:y,side:"right",align:"start",views:i})]})}const p=m=>{n||(t==null||t(m),g&&g())};return r.jsx(c.View,{role:"menuitem",onClick:p,cursor:n?"not-allowed":"pointer",opacity:n?.5:1,"aria-disabled":n,"data-disabled":n?"":void 0,...Xt[s],_hover:n?{}:Kt.hover,...i==null?void 0:i.item,...a,children:o})},Jr=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.divider,...o}),Jc=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.separator,...o}),es=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:i=!0,views:a,themeMode:l,...d})=>!o||o.length===0?r.jsx(r.Fragment,{children:e}):r.jsxs(r.Fragment,{children:[r.jsx(Qr,{disableNativeContextMenu:i,views:a,...d,children:e}),r.jsx(Bt,{items:o,views:a})]}),os=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:i=!0,onOpenChange:a,views:l,...d})=>{const s=Kc({size:t,variant:n,onOpenChange:a}),{isOpen:g,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:f,setActiveSubmenuId:x,triggerRef:y,contentRef:b,contentId:k,openMenu:C,closeMenu:w}=s;return r.jsx(Zc,{value:{isOpen:g,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:f,setActiveSubmenuId:x,size:t,variant:n,triggerRef:y,contentRef:b,contentId:k,openMenu:C,closeMenu:w,styles:l},children:r.jsx(es,{items:o,size:t,variant:n,disableNativeContextMenu:i,views:l,...d,children:e})})},Ke=os;Ke.Trigger=Qr;Ke.Content=Bt;Ke.Item=Zr;Ke.Divider=Jr;Ke.Separator=Jc;const ts=({src:e,color:o,views:t,themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=o?{fill:a(o,{themeMode:l}),stroke:a(o,{themeMode:l})}:{};return r.jsx(c.Center,{...i,...t==null?void 0:t.container,children:r.jsx(c.Image,{...d,content:'url("'+e+'")',width:"100%",height:"100%",...t==null?void 0:t.image})})},rs=({path:e,...o})=>r.jsx(c.Image,{src:e,...o}),en=({placeholder:e,isMulti:o,options:t,id:n=`select-${Math.random().toString(36).substr(2,9)}`})=>{const i=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(i),[m,h]=u.useState(0),[f,x]=u.useState(!0);return{id:n,value:g,setValue:p,hide:f,setHide:x,isHovered:a,setIsHovered:l,isFocused:d,setIsFocused:s,highlightedIndex:m,setHighlightedIndex:h}},on=({children:e,containerId:o="portal-root"})=>{const[t,n]=u.useState(null);return u.useEffect(()=>{let i=document.getElementById(o),a=!1;return i||(a=!0,i=document.createElement("div"),i.setAttribute("id",o),document.body.appendChild(i)),n(i),()=>{a&&i&&i.parentNode&&i.childNodes.length===0&&i.parentNode.removeChild(i)}},[o]),t?Ka.createPortal(e,t):null},ht=({children:e,views:o={helperText:{}},...t})=>r.jsx(c.Text,{size:"xs",fontWeight:"400",letterSpacing:"-0.01em",lineHeight:"16px",marginVertical:0,marginHorizontal:0,color:"color-gray-500",transition:"all 0.2s ease",...o.helperText,...t,children:e}),we=u.forwardRef(({children:e,helperText:o,error:t=!1,views:n,...i},a)=>r.jsxs(c.Vertical,{ref:a,gap:8,position:"relative",width:"100%",marginVertical:4,...i,...n==null?void 0:n.container,children:[e,!t&&o&&r.jsx(ht,{marginTop:4,...n==null?void 0:n.helperText,children:o}),t&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,fontWeight:"500",color:"color-red-500",transition:"all 0.2s ease",...n==null?void 0:n.error,children:t})]}));we.displayName="FieldContainer";const tn={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},Qt={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},rn={outline:{borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",transition:"border-color 200ms ease-out, box-shadow 200ms ease-out, background-color 200ms ease-out",_hover:{borderColor:"color-gray-300",backgroundColor:"color-gray-50"},_focus:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"},_focusVisible:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"}},default:{borderWidth:0,borderBottomWidth:"1.5px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",borderRadius:0,backgroundColor:"transparent",transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out",_hover:{borderBottomColor:"color-gray-400",backgroundColor:"color-gray-50"},_focus:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"},_focusVisible:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"}},none:{border:"none",backgroundColor:"transparent",transition:"background-color 200ms ease-out",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"},_focusVisible:{outline:"none",backgroundColor:"color-gray-100"}}},ns={paddingTop:"16px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"12px",paddingBottom:"6px",paddingLeft:"12px",paddingRight:"12px"}}},as={paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"12px",paddingRight:"12px"}}},Ve=({label:e,shadow:o,children:t,value:n,size:i="md",shape:a="default",variant:l="default",error:d=!1,showLabel:s=!1,isFocused:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,views:f={pickerBox:{}},...x})=>{const b=d?"color-red-500":(p||g)&&!m?"theme-primary":"color-gray-300";return r.jsx(c.Horizontal,{gap:8,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",marginBottom:2,borderStyle:"solid",borderColor:b,backgroundColor:"color-white",fontSize:c.Typography.fontSizes[i],cursor:m?"not-allowed":h?"auto":"text",opacity:m?.7:1,transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out, opacity 200ms ease-out",...s?ns:as,...o,...tn[a],...rn[l],...f==null?void 0:f.container,...x,children:t})},Lt=({children:e,...o})=>r.jsx(c.Center,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",...o,children:e}),is={h1:{fontSize:96,lineHeight:112,letterSpacing:-1.5},h2:{fontSize:60,lineHeight:71,letterSpacing:-.5},h3:{fontSize:48,lineHeight:57,letterSpacing:0},h4:{fontSize:34,lineHeight:40,letterSpacing:.25},h5:{fontSize:24,lineHeight:28,letterSpacing:0},h6:{fontSize:20,lineHeight:24,letterSpacing:.15}},ls=({children:e,heading:o,isItalic:t=!1,isUnderlined:n=!1,isStriked:i=!1,weight:a="normal",size:l="sm",dropDown:d,...s})=>{const g=o?is[o]:{};return r.jsx(c.Element,{as:"label",width:"100%",fontSize:l,fontStyle:t?"italic":"normal",fontWeight:c.Typography.fontWeights[a],textDecoration:i?"line-through":n?"underline":"none",...g,...s,children:e})},cs=e=>r.jsx(ls,{...e}),ho=cs,He=({children:e,size:o="md",error:t=!1,color:n="theme-primary",views:i={label:{}},helperText:a,...l})=>r.jsx(ho,{top:0,zIndex:-10,position:"absolute",fontSize:Qt[o],lineHeight:Qt[o],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:t?"color-red-500":n,transition:"color 200ms ease-out",...i.label,...l,children:e}),Qe=({children:e,...o})=>r.jsx(c.Vertical,{width:"100%",maxWidth:"100%",position:"relative",...o,children:e}),nn={xs:12,sm:14,md:16,lg:20,xl:24},ss={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},ds={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},us={padding:"10px 12px",cursor:"pointer",borderRadius:"6px",margin:"2px 4px",transition:"background-color 0.15s ease"},So={default:{backgroundColor:"transparent"},highlighted:{backgroundColor:"color-gray-100"},selected:{backgroundColor:"color-gray-100"},selectedHighlighted:{backgroundColor:"color-gray-200"}},Zt={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},gs={padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},ps={scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.15) transparent"},ms=({isHovered:e,setIsHovered:o,option:t,size:n="md",callback:i=()=>{},style:a,isSelected:l=!1,...d})=>{const s=(m,h)=>{m.stopPropagation(),m.preventDefault(),typeof i=="function"&&i(h)},g=()=>o(!e),p=()=>l&&e?So.selectedHighlighted:l?So.selected:e?So.highlighted:So.default;return r.jsxs(c.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...us,...p(),onMouseEnter:g,onMouseLeave:g,onClick:m=>s(m,t.value),...d,children:[r.jsx(c.Text,{fontSize:c.Typography.fontSizes[n],fontWeight:l?"500":"400",lineHeight:"1.4",color:l?"color-gray-900":"color-gray-700",...a,children:t.label}),l&&r.jsx(c.Element,{as:"span",color:"theme-primary",fontSize:"14px",marginLeft:8,display:"flex",alignItems:"center",children:"✓"})]})},hs=({size:e="md",views:o={field:{},text:{}},value:t,isDisabled:n,placeholder:i,removeOption:a=()=>{},options:l})=>{const d={margin:0,width:"95%",height:"100%",border:"none",paddingVertical:4,paddingHorizontal:0,fontSize:c.Typography.fontSizes[e],fontWeight:"400",lineHeight:"1.5",letterSpacing:"-0.01em",backgroundColor:"transparent",color:n?"color-gray-400":"color-gray-900",cursor:n?"not-allowed":"pointer",transition:"all 0.2s ease",...o.field,...o.text},s=l.length>0&&l.find(g=>g.value===t);return r.jsx(c.Text,{...d,children:(t===""||Array.isArray(t)&&t.length===0)&&i?i:r.jsx(r.Fragment,{children:typeof t=="string"?(s&&s.label)??t:Array.isArray(t)&&t.length>0?r.jsx(c.Horizontal,{gap:6,children:t.map(g=>r.jsx(bs,{option:g,removeOption:a},g))}):r.jsx("span",{children:t})})})},fs=({id:e,name:o,value:t,onChange:n,isMulti:i=!1,isDisabled:a=!1,isReadOnly:l=!1,options:d=[],...s})=>{const g=p=>{n&&n(p)};return r.jsx(c.Element,{id:e,name:o,as:"select",opacity:0,width:0,height:0,position:"absolute",value:t,disabled:a,readOnly:l,onChange:g,multiple:i,...s,children:d.length>0&&d.map(p=>r.jsx("option",{value:p.value,children:p.label},p.value))})},xs=({size:e,views:o={},options:t,callback:n=()=>{},highlightedIndex:i,setHighlightedIndex:a,selectedValue:l})=>{const d=g=>n(g),s=g=>Array.isArray(l)?l.includes(g):l===g;return r.jsx(c.Element,{as:"ul",role:"listbox",display:"flex",flexDirection:"column",margin:0,padding:"4px",...ss,style:ps,...o==null?void 0:o.dropDown,children:t&&t.length>0&&t.map((g,p)=>r.jsx(ms,{size:e,style:o.text,option:g,callback:d,isSelected:s(g.value),isHovered:p===i,setIsHovered:()=>{},onMouseEnter:()=>a(p)},g.value))})},bs=({option:e,size:o="md",removeOption:t=()=>{},...n})=>{const i=()=>t(e);return r.jsxs(c.Horizontal,{gap:6,alignItems:"center",onClick:a=>a.stopPropagation(),...gs,_hover:{backgroundColor:"color-gray-200"},...n,children:[r.jsx(c.Text,{fontSize:c.Typography.fontSizes[o],fontWeight:"500",color:"color-gray-700",children:e}),r.jsx(fe,{role:"close-button",color:"color-gray-500",widthHeight:nn[o],onClick:i,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},an=({id:e,name:o,label:t,value:n,placeholder:i,helperText:a,hide:l=!1,error:d=!1,isMulti:s=!1,isFocused:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,options:f=[],shadow:x={},size:y="md",shape:b="default",variant:k="default",views:C={text:{},icon:{},dropDown:{},selectBox:{},label:{},helperText:{}},onChange:w=()=>{},setHide:j=()=>{},setValue:S=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setHighlightedIndex:z,highlightedIndex:E,..._})=>{const{ref:T,relation:$,updateRelation:B}=c.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),R=u.useRef(null),V=()=>{var Y;if(!T.current)return{};const D=T.current.getBoundingClientRect(),O={position:"fixed",left:D.left,width:D.width,zIndex:1e4};return((Y=$==null?void 0:$.space)==null?void 0:Y.vertical)==="top"?{...O,bottom:window.innerHeight-D.top+8}:{...O,top:D.bottom+8}};u.useEffect(()=>{const D=()=>j(!0);return document.addEventListener("closeAllSelects",D),()=>document.removeEventListener("closeAllSelects",D)},[j]),u.useEffect(()=>{const D=O=>{!O.target.closest(`#${e}`)&&!l&&j(!0)};return document.addEventListener("click",D),()=>{document.removeEventListener("click",D)}},[e,l,j]);const W=!!(g&&t),P=()=>I(!p),H=()=>M(!0),L=D=>{document.dispatchEvent(new Event("closeAllSelects")),D&&D.stopPropagation&&D.stopPropagation();const O=!l;j(O),M(!O)},A=u.useCallback(D=>{if(j(!0),document.dispatchEvent(new Event("closeAllSelects")),s&&Array.isArray(n)){if(!n.includes(D)){const O=[...n,D];S(O),w&&w(D)}}else S(D),w&&w(D);M(!0)},[s,n,j,S,w,M]),F=D=>{if(Array.isArray(n)&&n.includes(D)){const O=n.filter(K=>K!==D);S(O.length===0?[]:O)}};return r.jsx(we,{ref:T,position:"relative",width:"100%",display:"inline-block",id:e,role:"SelectBox",helperText:a,error:d,views:C,onClick:D=>{D.stopPropagation(),m||h||L(D)},children:r.jsxs(Ve,{label:t,size:y,error:d,shape:b,views:C,shadow:x,variant:k,value:n,color:"theme-primary",isHovered:p,isDisabled:m,isReadOnly:h,isFocused:g,showLabel:W,onMouseEnter:P,onMouseLeave:P,position:"relative",children:[r.jsxs(Qe,{children:[W&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...C,children:t}),r.jsx(fs,{id:e,name:o,options:f,onChange:w,value:n,isDisabled:m,isReadOnly:h,isMulti:s,onFocus:H,..._}),r.jsx(hs,{options:f,size:y,views:C,value:n,isDisabled:m,placeholder:i,removeOption:F})]}),r.jsx(Lt,{children:!h&&!m&&r.jsx(c.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:l?Zt.closed:Zt.open,children:r.jsx(ae,{color:"inherit",widthHeight:nn[y],style:C.icon,orientation:"down"})})}),!l&&f.length>0&&r.jsx(on,{children:r.jsx(c.Element,{ref:R,onClick:D=>D.stopPropagation(),style:{...V(),...ds.enter},children:r.jsx(xs,{size:y,views:C,options:f,callback:A,highlightedIndex:E,setHighlightedIndex:z,selectedValue:n})})})]})})},ys=e=>{const o={...e,options:e.options||[]},t=en(o);return r.jsx(an,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},ks=ys,ln=({isDisabled:e,isChecked:o})=>{const[t,n]=u.useState(!1),[i,a]=u.useState(o||!1),[l,d]=u.useState(o||!1);return u.useEffect(()=>{o!==void 0&&(a(o),d(o))},[o]),{isHovered:t,setIsHovered:n,on:i,setOn:a,value:l,setValue:d}},js={xs:{height:"8px",width:"8px"},sm:{height:"12px",width:"12px"},md:{height:"16px",width:"16px"},lg:{height:"20px",width:"20px"},xl:{height:"24px",width:"24px"}},Cs={xs:{height:"16px",width:"36px"},sm:{height:"20px",width:"44px"},md:{height:"24px",width:"52px"},lg:{height:"28px",width:"60px"},xl:{height:"32px",width:"68px"}},Ss={xs:{paddingVertical:4,paddingHorizontal:2},sm:{paddingVertical:4,paddingHorizontal:2},md:{paddingVertical:4,paddingHorizontal:4},lg:{paddingVertical:4,paddingHorizontal:4},xl:{paddingVertical:4,paddingHorizontal:4}},Pe={default:{active:"theme-primary",inactive:"color-gray-300",knob:"white",disabled:"color-gray-200"},states:{hover:{active:"theme-primary",inactive:"color-gray-400",activeOpacity:.9}}},Jt={slider:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},knob:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}},ws=e=>r.jsx(c.Input,{type:"checkbox",...e}),cn=({id:e,name:o,label:t,inActiveChild:n,isChecked:i,activeChild:a,labelPosition:l="right",shadow:d={},size:s="sm",value:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,on:f,setOn:x,onChange:y,setValue:b=()=>{},setIsHovered:k=()=>{},helperText:C,views:w={slider:{},circle:{},label:{}},...j})=>{const S=E=>{if(!h&&!m){const _=E.target.checked;b(_),x(_),y&&y(_)}},I=()=>k(!0),M=()=>k(!1),z={container:{gap:12,display:"flex",height:"fit-content",width:"fit-content",alignItems:"center",cursor:m?"not-allowed":h?"default":"pointer",opacity:m?.6:1,transition:"all 0.2s ease",...w.label}};return r.jsxs(ho,{htmlFor:e,onMouseEnter:I,onMouseLeave:M,...z.container,...j,children:[r.jsx(ws,{id:e,name:o,opacity:0,width:0,height:0,checked:g,onChange:S,disabled:m,readOnly:h,...j}),l==="left"&&t&&r.jsx(c.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t}),r.jsxs(c.View,{display:"flex",alignItems:"center",justifyContent:g?a?"space-between":"flex-end":n?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:m?Pe.default.disabled:g?p?Pe.states.hover.active:Pe.default.active:p?Pe.states.hover.inactive:Pe.default.inactive,opacity:!m&&g&&p?Pe.states.hover.activeOpacity:1,cursor:"pointer",...Jt.slider,...d,...Ss[s],...Cs[s],...w.slider,children:[a&&g&&r.jsx(c.View,{marginLeft:8,marginRight:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:a}),r.jsx(c.View,{borderRadius:"50%",backgroundColor:Pe.default.knob,boxShadow:p?"0 2px 4px rgba(0, 0, 0, 0.2)":"0 1px 2px rgba(0, 0, 0, 0.1)",transform:p?"scale(1.05)":"scale(1)",...Jt.knob,zIndex:1,...js[s],...w.circle}),n&&!g&&r.jsx(c.View,{marginRight:8,marginLeft:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:n})]}),l==="right"&&t&&r.jsx(c.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t})]})},Is=e=>{const o=ln(e);return r.jsx(cn,{...o,...e})},Ts=Is,sn=({placeholder:e,isMulti:o,options:t,id:n=`selector-${Math.random().toString(36).substr(2,9)}`})=>{const i=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(i),[m,h]=u.useState(0),[f,x]=u.useState(!0);return{id:n,value:g,setValue:p,hide:f,setHide:x,isHovered:a,setIsHovered:l,isFocused:d,setIsFocused:s,highlightedIndex:m,setHighlightedIndex:h}},dn=({id:e,name:o,label:t,value:n,size:i,views:a={},options:l=[],onChange:d=()=>{},setValue:s=()=>{},...g})=>{const{getColor:p}=c.useTheme(),m=u.useCallback(h=>{s(h.value),d&&d(h.value)},[s,d]);return r.jsxs(we,{id:e,width:"100%",views:a,children:[t&&r.jsxs(c.Horizontal,{fontSize:"10px",letterSpacing:"wider",color:"color-black-500",fontWeight:"bold",marginBottom:12,alignItems:"center",gap:6,style:{textTransform:"uppercase"},children:[r.jsx(ze,{widthHeight:14})," ",r.jsx(c.Text,{children:t})]}),r.jsx(c.Horizontal,{gap:0,children:l.map((h,f,x)=>{const y=n===h.value;let b=p("color-gray-200"),k=p("color-gray-500"),C="transparent";if(y){if(h.color)h.color,b=p(h.color),k=p(h.color),C="rgba(0,0,0,0.05)";else{const w=p("theme-primary");b=w,k=w,C="color-gray-50"}h.color?(b=p(h.color),k=p(h.color),C="transparent"):(b=p("theme-primary"),k=p("theme-primary"),C="transparent")}return r.jsx(_e,{onClick:()=>m(h),flex:1,...i?{size:i}:{paddingVertical:6,fontSize:"12px"},fontWeight:y?"bold":"normal",style:{borderTop:`1px solid ${y?b:p("color-gray-200")}`,borderBottom:`1px solid ${y?b:p("color-gray-200")}`,borderLeft:`1px solid ${y?b:p("color-gray-200")}`,borderRight:f===x.length-1||y?`1px solid ${y?b:p("color-gray-200")}`:"none",backgroundColor:C,color:k,borderRadius:f===0?"6px 0 0 6px":f===x.length-1?"0 6px 6px 0":"0",zIndex:y?1:0,boxShadow:"none"},...a.item,children:h.label},h.value)})}),r.jsx("input",{type:"hidden",id:e,name:o,value:Array.isArray(n)?n.join(","):n,onChange:()=>{}})]})},Ms=e=>{const o={...e,options:e.options||[]},t=sn(o);return r.jsx(dn,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},zs=Ms,un=({label:e,placeholder:o,value:t})=>{const[n,i]=u.useState(e??o),[a,l]=u.useState(!1),[d,s]=u.useState(t||""),[g,p]=u.useState(!1);return u.useMemo(()=>{i(g&&!d?o??"":e??o)},[d,g,e,o]),{hint:n,setHint:i,isHovered:a,setIsHovered:l,value:d,setValue:s,isFocused:g,setIsFocused:p}},gn=({id:e,name:o,hint:t,error:n,value:i,label:a,shadow:l,helperText:d,placeholder:s,size:g="sm",shape:p="default",variant:m="default",isHovered:h=!1,isFocused:f=!1,isEditable:x=!1,isReadOnly:y=!1,isDisabled:b=!1,isAutoFocus:k=!1,isMultiline:C=!1,maxRows:w=3,maxCols:j=30,onBlur:S=()=>{},onChange:I,onFocus:M,setHint:z=()=>{},setValue:E=()=>{},setIsFocused:_=()=>{},setIsHovered:T=()=>{},views:$={label:{},helperText:{}},...B})=>{const R=!!(f&&a),V={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[g],lineHeight:`${Math.round(c.Typography.fontSizes[g]*1.5)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:b?"color-gray-400":"color-gray-900",cursor:b?"not-allowed":"text",opacity:b?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...$.field},W=()=>T(!h),P=()=>{_(!0),M&&M()},H=A=>{S(A),_(!1)},L=A=>{typeof A=="string"?(E(A),I&&I(A)):(E(A.target.value),I&&I(A.target.value))};return r.jsx(we,{helperText:d,error:n,views:$,...B,children:r.jsx(Ve,{label:a,size:g,error:n,shape:p,views:$,shadow:l,variant:m,value:i,color:"theme-primary",isHovered:h,isDisabled:b,isReadOnly:y,isFocused:f,showLabel:R,onMouseEnter:W,onMouseLeave:W,...$==null?void 0:$.content,children:r.jsxs(Qe,{...$==null?void 0:$.warper,children:[R&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:n,...$==null?void 0:$.label,children:a}),r.jsx(c.Element,{as:"textarea",id:e,name:o,rows:w,cols:j,value:i,readOnly:y,disabled:b,autoFocus:k,editable:`${!!x.toString()}`,placeholder:t,onBlur:H,onFocus:P,multiline:`${!!C.toString()}`,onChange:A=>L(A),...V,style:{resize:b||y?"none":"vertical"},...$==null?void 0:$.textarea})]})})})},Rs=e=>{const o=un(e);return r.jsx(gn,{...o,...e})},Vs=Rs,At=({label:e,placeholder:o,value:t})=>{const[n,i]=u.useState(e??o),[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(t);return u.useMemo(()=>{i(a&&!g?o??"":e??o)},[g,a,e,o]),{hint:n,setHint:i,isFocused:a,setIsFocused:l,isHovered:d,setIsHovered:s,setValue:p,value:g}},Es=e=>r.jsx(c.Input,{type:"text",...e}),fo=({id:e,name:o,label:t,hint:n,value:i,onChange:a,left:l,right:d,helperText:s,placeholder:g,onChangeText:p,shadow:m={},views:h={container:{},field:{},label:{},helperText:{},text:{}},size:f="md",shape:x="default",variant:y="default",error:b=!1,isFocused:k=!1,isHovered:C=!1,isDisabled:w=!1,isReadOnly:j=!1,isClearable:S=!0,isAutoFocus:I=!1,setHint:M=()=>{},setIsFocused:z=()=>{},setIsHovered:E=()=>{},setValue:_=()=>{},onClick:T=()=>{},onFocus:$,onBlur:B=()=>{},themeMode:R,...V})=>{const{getColor:W,themeMode:P}=c.useTheme(),H=W("color-blueGray-700",{themeMode:R||P}),L=!!(k&&t),A={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",height:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[f],lineHeight:`${Math.round(c.Typography.fontSizes[f]*1.4)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:w?"color-gray-400":"color-gray-900",cursor:w?"not-allowed":"text",opacity:w?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...h.field},F=()=>{z(!0),$&&$()},D=()=>E(!C),O=N=>{B&&B(N),z(!1)},K=N=>{typeof N=="string"?(_(N),p&&p(N),a&&a(N)):(_(N.target.value),p&&p(N.target.value),a&&a(N.target.value))},Y=()=>{_(""),a&&(B({target:{name:o}}),p&&p(""),a&&a("")),typeof document>"u"&&p&&p("")};return r.jsx(we,{helperText:s,error:b,views:h,children:r.jsxs(Ve,{label:t,size:f,error:b,shape:x,views:h,shadow:m,variant:y,value:i,color:"theme-primary",isHovered:C,isDisabled:w,isReadOnly:j,isFocused:k,showLabel:L,onMouseEnter:D,onMouseLeave:D,children:[l,r.jsxs(Qe,{children:[L&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:b,...h,children:t}),r.jsx(Es,{id:e,name:o,readOnly:j,disabled:w,autoFocus:I,placeholder:n,onFocus:F,onBlur:O,autoComplete:"off",...A,...V,onChange:K,value:i})]}),S&&i&&!j&&!w&&r.jsx(Lt,{children:r.jsx(fe,{size:20,color:H,onClick:Y,cursor:"pointer",borderRadius:"50%",transition:"background-color 150ms ease-out, transform 150ms ease-out",_hover:{backgroundColor:"color-gray-100",transform:"scale(1.05)"},_active:{transform:"scale(0.95)"}})}),d]})})},Ps=e=>{const o=At(e);return r.jsx(fo,{...o,...e})},xo=Ps,pn=({defaultIsSelected:e=!1})=>{const[o,t]=u.useState(!1),[n,i]=u.useState(e);return{isHovered:o,setIsHovered:t,isSelected:n,setIsSelected:i}},Ws={xs:{height:"12px",width:"12px"},sm:{height:"16px",width:"16px"},md:{height:"20px",width:"20px"},lg:{height:"24px",width:"24px"},xl:{height:"28px",width:"28px"}},er={xs:10,sm:14,md:16,lg:20,xl:24},_s={selected:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},unselected:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-black",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},indeterminate:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"}},at={hover:{selected:{opacity:.9},unselected:{borderColor:"color-gray-400",backgroundColor:"color-gray-50"},indeterminate:{opacity:.9}},disabled:{selected:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},unselected:{borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},indeterminate:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"}},error:{selected:{backgroundColor:"color-red-500",borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"},indeterminate:{backgroundColor:"color-red-500",borderColor:"color-red-500"}}},mn=({id:e,icon:o,name:t,label:n,isChecked:i,onChange:a,onValueChange:l,shadow:d={},labelPosition:s="right",size:g="md",error:p=!1,isSelected:m=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:x=!1,isIndeterminate:y=!1,defaultIsSelected:b=!1,setIsSelected:k=()=>{},setIsHovered:C=()=>{},views:w={checkbox:{},label:{}},infoText:j,helperText:S,...I})=>{const M=()=>C(!h),z=()=>{!x&&!f&&(k&&k(!m),a&&a(!i),l&&l(!i))},E=y?"indeterminate":i||m?"selected":"unselected",_=p?at.error[E]:f?at.disabled[E]:h?at.hover[E]:{},T={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:p?"color-red-600":f?"color-gray-400":"color-gray-700",cursor:f?"not-allowed":x?"default":"pointer",opacity:f?.6:1,transition:"all 0.2s ease",...w.label},checkbox:{..._s[E],..._,borderRadius:"4px",...Ws[g],transition:"all 0.2s ease",...d,...w.checkbox}};return r.jsxs(ho,{htmlFor:e,as:"div",onClick:z,onMouseEnter:M,onMouseLeave:M,size:c.Typography.fontSizes[g],...T.container,...I,children:[r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsxs(c.Horizontal,{gap:12,alignItems:"center",children:[" ",s==="left"&&n&&r.jsx(c.Text,{size:g,fontWeight:"500",...w==null?void 0:w.label,children:n}),r.jsx(c.Center,{...T.checkbox,children:y?r.jsx(Mr,{widthHeight:er[g],color:"white",transition:"all 0.2s ease"}):(i||m)&&(o??r.jsx(No,{widthHeight:er[g],color:"white",transition:"all 0.2s ease"}))}),s==="right"&&n&&r.jsx(c.Text,{size:g,fontWeight:"500",...w==null?void 0:w.label,children:n})]}),j&&r.jsx(c.Text,{marginLeft:s==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...w==null?void 0:w.infoText,children:j})]}),p&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:p})]})},$s=e=>{const o=pn(e);return r.jsx(mn,{...o,...e})},Hs=$s,hn=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:i,onOpen:a,onClose:l,closeOnSelect:d=!0,maxRecentColors:s=8,showRecentColors:g=!0,isAutoFocus:p=!1}=e,[m,h]=u.useState(!1),[f,x]=u.useState(o??t),[y,b]=u.useState(""),[k,C]=u.useState([]),[w,j]=u.useState(!1),[S,I]=u.useState(!1),M=u.useRef(null),z=u.useRef(null);u.useEffect(()=>{o!==void 0&&x(o)},[o]),u.useEffect(()=>{if(g)try{const W=localStorage.getItem("colorInput-recentColors");W&&C(JSON.parse(W))}catch(W){console.warn("Failed to load recent colors from localStorage:",W)}},[g]),u.useEffect(()=>{p&&M.current&&M.current.focus()},[p]),u.useEffect(()=>{const W=P=>{m&&M.current&&z.current&&!M.current.contains(P.target)&&!z.current.contains(P.target)&&R()};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[m]);const E=u.useCallback(W=>{g&&C(P=>{const H=P.filter(A=>A!==W),L=[W,...H].slice(0,s);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(L))}catch(A){console.warn("Failed to save recent colors to localStorage:",A)}return L})},[g,s]),_=u.useCallback(()=>{const W=!m;h(W),W?a==null||a():l==null||l()},[m,a,l]),T=u.useCallback(W=>{x(W),E(W),n==null||n(W),i==null||i(W),d&&(h(!1),l==null||l())},[n,i,d,l,E]),$=u.useCallback(W=>{b(W)},[]),B=u.useCallback(()=>{y&&(T(y),b(""))},[y,T]),R=u.useCallback(()=>{h(!1),l==null||l()},[l]),V=u.useCallback(W=>{x(W),n==null||n(W)},[n]);return{isOpen:m,selectedColor:f,recentColors:k,customColor:y,isFocused:w,isHovered:S,handleToggle:_,handleColorSelect:T,handleCustomColorChange:$,handleCustomColorSubmit:B,handleClose:R,setIsFocused:j,setIsHovered:I,setValue:V,triggerRef:M,dropdownRef:z}},ro={container:{position:"relative",display:"inline-block",width:"fit-content"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",padding:"8px 12px"},dropdown:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"8px"},recentColors:{display:"flex",gap:"4px",flexWrap:"wrap"}},Bs={xs:{height:"28px",fontSize:"10px",padding:"4px 8px"},sm:{height:"32px",fontSize:"12px",padding:"6px 10px"},md:{height:"40px",fontSize:"14px",padding:"8px 12px"},lg:{height:"48px",fontSize:"16px",padding:"12px 16px"},xl:{height:"56px",fontSize:"20px",padding:"16px 20px"}},Ls={default:{borderRadius:"6px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},As={default:{backgroundColor:"color-white",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},outline:{backgroundColor:"transparent",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},none:{backgroundColor:"transparent",borderColor:"transparent",borderWidth:"0px"}},Ds=[{name:"Red 500",value:"color-red-500"},{name:"Orange 500",value:"color-orange-500"},{name:"Yellow 500",value:"color-yellow-500"},{name:"Green 500",value:"color-green-500"},{name:"Blue 500",value:"color-blue-500"},{name:"Indigo 500",value:"color-indigo-500"},{name:"Purple 500",value:"color-purple-500"},{name:"Pink 500",value:"color-pink-500"},{name:"Red 300",value:"color-red-300"},{name:"Orange 300",value:"color-orange-300"},{name:"Yellow 300",value:"color-yellow-300"},{name:"Green 300",value:"color-green-300"},{name:"Blue 300",value:"color-blue-300"},{name:"Indigo 300",value:"color-indigo-300"},{name:"Purple 300",value:"color-purple-300"},{name:"Pink 300",value:"color-pink-300"},{name:"Red 700",value:"color-red-700"},{name:"Orange 700",value:"color-orange-700"},{name:"Yellow 700",value:"color-yellow-700"},{name:"Green 700",value:"color-green-700"},{name:"Blue 700",value:"color-blue-700"},{name:"Indigo 700",value:"color-indigo-700"},{name:"Purple 700",value:"color-purple-700"},{name:"Pink 700",value:"color-pink-700"},{name:"Gray 100",value:"color-gray-100"},{name:"Gray 300",value:"color-gray-300"},{name:"Gray 500",value:"color-gray-500"},{name:"Gray 700",value:"color-gray-700"},{name:"Gray 900",value:"color-gray-900"},{name:"White",value:"color-white"},{name:"Black",value:"color-black"},{name:"Transparent",value:"transparent"}],fn=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",shadow:g,error:p=!1,isDisabled:m=!1,isReadOnly:h=!1,isFocused:f=!1,isHovered:x=!1,predefinedColors:y=Ds,showCustomInput:b=!0,showRecentColors:k=!0,isOpen:C=!1,selectedColor:w="",recentColors:j=[],customColor:S="",handleToggle:I=()=>{},handleColorSelect:M=()=>{},handleCustomColorChange:z=()=>{},handleCustomColorSubmit:E=()=>{},setIsFocused:_=()=>{},setIsHovered:T=()=>{},triggerRef:$,dropdownRef:B,onChange:R,...V})=>{const{getColor:W}=c.useTheme(),P={...ro.container,...a==null?void 0:a.container},H={...ro.trigger,...Bs[l],...Ls[d],...As[s],...p&&{borderColor:"color-red-500"},...m&&{opacity:.6,cursor:"not-allowed"},...f&&{borderColor:"color-blue-500",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.1)"},...x&&!m&&{borderColor:"color-gray-400"},...a==null?void 0:a.trigger,...g&&g},L={...ro.dropdown,...a==null?void 0:a.dropdown},A={...ro.colorGrid,...a==null?void 0:a.colorGrid},F={...ro.recentColors,...a==null?void 0:a.recentColors},D=w||"color-gray-200";return r.jsxs(c.View,{...P,...V,children:[t&&r.jsx(ho,{htmlFor:e,size:l,isDisabled:m,error:p,views:a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:$,onClick:m||h?void 0:I,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),onFocus:()=>_(!0),onBlur:()=>_(!1),tabIndex:m?-1:0,role:"button","aria-expanded":C,"aria-haspopup":"listbox","aria-label":t||n,width:"fit-content",gap:8,...H,children:[r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:D,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),!h&&!m&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:C?"up":"down"})]}),C&&r.jsxs(c.View,{ref:B,...L,children:[r.jsx(c.View,{...A,children:y.map((O,K)=>r.jsx(c.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:O.value,borderWidth:"2px",borderStyle:"solid",borderColor:w===O.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(O.value),title:O.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},K))}),k&&j.length>0&&r.jsxs(c.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(c.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Recent Colors"}),r.jsx(c.Horizontal,{gap:4,flexWrap:"wrap",...F,children:j.map((O,K)=>r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:O,borderWidth:"1px",borderStyle:"solid",borderColor:w===O?"color-blue-500":"color-gray-300",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(O),title:O,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"}},K))})]}),b&&r.jsxs(c.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(c.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Custom Color"}),r.jsxs(c.Horizontal,{gap:8,children:[r.jsx(xo,{value:S,onChange:O=>z(O.target.value),placeholder:"#000000 or rgb(0,0,0)",size:"sm",style:{flex:1},views:a==null?void 0:a.customInput}),r.jsx(c.View,{padding:"8px 12px",backgroundColor:"color-blue-500",borderRadius:"4px",cursor:"pointer",onClick:E,_hover:{backgroundColor:"color-blue-600"},children:r.jsx(c.Text,{color:"color-white",fontSize:"12px",fontWeight:"500",children:"Add"})})]})]})]}),i&&r.jsx(c.Text,{fontSize:"12px",color:p?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i}),p&&typeof p=="string"&&r.jsx(c.Text,{fontSize:"12px",color:"color-red-500",marginTop:"4px",...a==null?void 0:a.error,children:p})]})},Fs=e=>{const o=hn(e);return r.jsx(fn,{...o,...e})},Os=Fs,ft=[{name:"Afghanistan",dial_code:"+93",emoji:"🇦🇫",code:"AF"},{name:"Aland Islands",dial_code:"+358",emoji:"🇦🇽",code:"AX"},{name:"Albania",dial_code:"+355",emoji:"🇦🇱",code:"AL"},{name:"Algeria",dial_code:"+213",emoji:"🇩🇿",code:"DZ"},{name:"AmericanSamoa",dial_code:"+1684",emoji:"🇦🇸",code:"AS"},{name:"Andorra",dial_code:"+376",emoji:"🇦🇩",code:"AD"},{name:"Angola",dial_code:"+244",emoji:"🇦🇴",code:"AO"},{name:"Anguilla",dial_code:"+1264",emoji:"🇦🇮",code:"AI"},{name:"Antarctica",dial_code:"+672",emoji:"🇦🇶",code:"AQ"},{name:"Antigua and Barbuda",dial_code:"+1268",emoji:"🇦🇬",code:"AG"},{name:"Argentina",dial_code:"+54",emoji:"🇦🇷",code:"AR"},{name:"Armenia",dial_code:"+374",emoji:"🇦🇲",code:"AM"},{name:"Aruba",dial_code:"+297",emoji:"🇦🇼",code:"AW"},{name:"Australia",dial_code:"+61",emoji:"🇦🇺",code:"AU"},{name:"Austria",dial_code:"+43",emoji:"🇦🇹",code:"AT"},{name:"Azerbaijan",dial_code:"+994",emoji:"🇦🇿",code:"AZ"},{name:"Bahamas",dial_code:"+1242",emoji:"🇧🇸",code:"BS"},{name:"Bahrain",dial_code:"+973",emoji:"🇧🇭",code:"BH"},{name:"Bangladesh",dial_code:"+880",emoji:"🇧🇩",code:"BD"},{name:"Barbados",dial_code:"+1246",emoji:"🇧🇧",code:"BB"},{name:"Belarus",dial_code:"+375",emoji:"🇧🇾",code:"BY"},{name:"Belgium",dial_code:"+32",emoji:"🇧🇪",code:"BE"},{name:"Belize",dial_code:"+501",emoji:"🇧🇿",code:"BZ"},{name:"Benin",dial_code:"+229",emoji:"🇧🇯",code:"BJ"},{name:"Bermuda",dial_code:"+1441",emoji:"🇧🇲",code:"BM"},{name:"Bhutan",dial_code:"+975",emoji:"🇧🇹",code:"BT"},{name:"Bolivia, Plurinational State of",dial_code:"+591",emoji:"🇧🇴",code:"BO"},{name:"Bosnia and Herzegovina",dial_code:"+387",emoji:"🇧🇦",code:"BA"},{name:"Botswana",dial_code:"+267",emoji:"🇧🇼",code:"BW"},{name:"Brazil",dial_code:"+55",emoji:"🇧🇷",code:"BR"},{name:"British Indian Ocean Territory",dial_code:"+246",emoji:"🇮🇴",code:"IO"},{name:"Brunei Darussalam",dial_code:"+673",emoji:"🇧🇳",code:"BN"},{name:"Bulgaria",dial_code:"+359",emoji:"🇧🇬",code:"BG"},{name:"Burkina Faso",dial_code:"+226",emoji:"🇧🇫",code:"BF"},{name:"Burundi",dial_code:"+257",emoji:"🇧🇮",code:"BI"},{name:"Cambodia",dial_code:"+855",emoji:"🇰🇭",code:"KH"},{name:"Cameroon",dial_code:"+237",emoji:"🇨🇲",code:"CM"},{name:"Canada",dial_code:"+1",emoji:"🇨🇦",code:"CA"},{name:"Cape Verde",dial_code:"+238",emoji:"🇨🇻",code:"CV"},{name:"Cayman Islands",dial_code:"+345",emoji:"🇰🇾",code:"KY"},{name:"Central African Republic",dial_code:"+236",emoji:"🇨🇫",code:"CF"},{name:"Chad",dial_code:"+235",emoji:"🇹🇩",code:"TD"},{name:"Chile",dial_code:"+56",emoji:"🇨🇱",code:"CL"},{name:"China",dial_code:"+86",emoji:"🇨🇳",code:"CN"},{name:"Christmas Island",dial_code:"+61",emoji:"🇨🇽",code:"CX"},{name:"Cocos (Keeling) Islands",dial_code:"+61",emoji:"🇨🇨",code:"CC"},{name:"Colombia",dial_code:"+57",emoji:"🇨🇴",code:"CO"},{name:"Comoros",dial_code:"+269",emoji:"🇰🇲",code:"KM"},{name:"Congo",dial_code:"+242",emoji:"🇨🇬",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dial_code:"+243",emoji:"🇨🇩",code:"CD"},{name:"Cook Islands",dial_code:"+682",emoji:"🇨🇰",code:"CK"},{name:"Costa Rica",dial_code:"+506",emoji:"🇨🇷",code:"CR"},{name:"Cote d'Ivoire",dial_code:"+225",emoji:"🇨🇮",code:"CI"},{name:"Croatia",dial_code:"+385",emoji:"🇭🇷",code:"HR"},{name:"Cuba",dial_code:"+53",emoji:"🇨🇺",code:"CU"},{name:"Cyprus",dial_code:"+357",emoji:"🇨🇾",code:"CY"},{name:"Czech Republic",dial_code:"+420",emoji:"🇨🇿",code:"CZ"},{name:"Denmark",dial_code:"+45",emoji:"🇩🇰",code:"DK"},{name:"Djibouti",dial_code:"+253",emoji:"🇩🇯",code:"DJ"},{name:"Dominica",dial_code:"+1767",emoji:"🇩🇲",code:"DM"},{name:"Dominican Republic",dial_code:"+1849",emoji:"🇩🇴",code:"DO"},{name:"Ecuador",dial_code:"+593",emoji:"🇪🇨",code:"EC"},{name:"Egypt",dial_code:"+20",emoji:"🇪🇬",code:"EG"},{name:"El Salvador",dial_code:"+503",emoji:"🇸🇻",code:"SV"},{name:"Equatorial Guinea",dial_code:"+240",emoji:"🇬🇶",code:"GQ"},{name:"Eritrea",dial_code:"+291",emoji:"🇪🇷",code:"ER"},{name:"Estonia",dial_code:"+372",emoji:"🇪🇪",code:"EE"},{name:"Ethiopia",dial_code:"+251",emoji:"🇪🇹",code:"ET"},{name:"Falkland Islands (Malvinas)",dial_code:"+500",emoji:"🇫🇰",code:"FK"},{name:"Faroe Islands",dial_code:"+298",emoji:"🇫🇴",code:"FO"},{name:"Fiji",dial_code:"+679",emoji:"🇫🇯",code:"FJ"},{name:"Finland",dial_code:"+358",emoji:"🇫🇮",code:"FI"},{name:"France",dial_code:"+33",emoji:"🇫🇷",code:"FR"},{name:"French Guiana",dial_code:"+594",emoji:"🇬🇫",code:"GF"},{name:"French Polynesia",dial_code:"+689",emoji:"🇵🇫",code:"PF"},{name:"Gabon",dial_code:"+241",emoji:"🇬🇦",code:"GA"},{name:"Gambia",dial_code:"+220",emoji:"🇬🇲",code:"GM"},{name:"Georgia",dial_code:"+995",emoji:"🇬🇪",code:"GE"},{name:"Germany",dial_code:"+49",emoji:"🇩🇪",code:"DE"},{name:"Ghana",dial_code:"+233",emoji:"🇬🇭",code:"GH"},{name:"Gibraltar",dial_code:"+350",emoji:"🇬🇮",code:"GI"},{name:"Greece",dial_code:"+30",emoji:"🇬🇷",code:"GR"},{name:"Greenland",dial_code:"+299",emoji:"🇬🇱",code:"GL"},{name:"Grenada",dial_code:"+1473",emoji:"🇬🇩",code:"GD"},{name:"Guadeloupe",dial_code:"+590",emoji:"🇬🇵",code:"GP"},{name:"Guam",dial_code:"+1671",emoji:"🇬🇺",code:"GU"},{name:"Guatemala",dial_code:"+502",emoji:"🇬🇹",code:"GT"},{name:"Guernsey",dial_code:"+44",emoji:"🇬🇬",code:"GG"},{name:"Guinea",dial_code:"+224",emoji:"🇬🇳",code:"GN"},{name:"Guinea-Bissau",dial_code:"+245",emoji:"🇬🇼",code:"GW"},{name:"Guyana",dial_code:"+595",emoji:"🇬🇾",code:"GY"},{name:"Haiti",dial_code:"+509",emoji:"🇭🇹",code:"HT"},{name:"Holy See (Vatican City State)",dial_code:"+379",emoji:"🇻🇦",code:"VA"},{name:"Honduras",dial_code:"+504",emoji:"🇭🇳",code:"HN"},{name:"Hong Kong",dial_code:"+852",emoji:"🇭🇰",code:"HK"},{name:"Hungary",dial_code:"+36",emoji:"🇭🇺",code:"HU"},{name:"Iceland",dial_code:"+354",emoji:"🇮🇸",code:"IS"},{name:"India",dial_code:"+91",emoji:"🇮🇳",code:"IN"},{name:"Indonesia",dial_code:"+62",emoji:"🇮🇩",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dial_code:"+98",emoji:"🇮🇷",code:"IR"},{name:"Iraq",dial_code:"+964",emoji:"🇮🇷",code:"IQ"},{name:"Ireland",dial_code:"+353",emoji:"🇮🇪",code:"IE"},{name:"Isle of Man",dial_code:"+44",emoji:"🇮🇲",code:"IM"},{name:"Israel",dial_code:"+972",emoji:"🇮🇱",code:"IL"},{name:"Italy",dial_code:"+39",emoji:"🇮🇹",code:"IT"},{name:"Jamaica",dial_code:"+1876",emoji:"🇯🇲",code:"JM"},{name:"Japan",dial_code:"+81",emoji:"🇯🇵",code:"JP"},{name:"Jersey",dial_code:"+44",emoji:"🇯🇪",code:"JE"},{name:"Jordan",dial_code:"+962",emoji:"🇯🇴",code:"JO"},{name:"Kazakhstan",dial_code:"+77",emoji:"🇰🇿",code:"KZ"},{name:"Kenya",dial_code:"+254",emoji:"🇰🇪",code:"KE"},{name:"Kiribati",dial_code:"+686",emoji:"🇰🇮",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dial_code:"+850",emoji:"🇰🇵",code:"KP"},{name:"Korea, Republic of South Korea",dial_code:"+82",emoji:"🇰🇷",code:"KR"},{name:"Kuwait",dial_code:"+965",emoji:"🇰🇼",code:"KW"},{name:"Kyrgyzstan",dial_code:"+996",emoji:"🇰🇬",code:"KG"},{name:"Laos",dial_code:"+856",emoji:"🇱🇦",code:"LA"},{name:"Latvia",dial_code:"+371",emoji:"🇱🇻",code:"LV"},{name:"Lebanon",dial_code:"+961",emoji:"🇱🇧",code:"LB"},{name:"Lesotho",dial_code:"+266",emoji:"🇱🇸",code:"LS"},{name:"Liberia",dial_code:"+231",emoji:"🇱🇷",code:"LR"},{name:"Libyan Arab Jamahiriya",dial_code:"+218",emoji:"🇱🇾",code:"LY"},{name:"Liechtenstein",dial_code:"+423",emoji:"🇱🇮",code:"LI"},{name:"Lithuania",dial_code:"+370",emoji:"🇱🇹",code:"LT"},{name:"Luxembourg",dial_code:"+352",emoji:"🇱🇺",code:"LU"},{name:"Macao",dial_code:"+853",emoji:"🇲🇴",code:"MO"},{name:"Macedonia",dial_code:"+389",emoji:"🇲🇰",code:"MK"},{name:"Madagascar",dial_code:"+261",emoji:"🇲🇬",code:"MG"},{name:"Malawi",dial_code:"+265",emoji:"🇲🇼",code:"MW"},{name:"Malaysia",dial_code:"+60",emoji:"🇲🇾",code:"MY"},{name:"Maldives",dial_code:"+960",emoji:"🇲🇻",code:"MV"},{name:"Mali",dial_code:"+223",emoji:"🇲🇱",code:"ML"},{name:"Malta",dial_code:"+356",emoji:"🇲🇹",code:"MT"},{name:"Marshall Islands",dial_code:"+692",emoji:"🇲🇭",code:"MH"},{name:"Martinique",dial_code:"+596",emoji:"🇲🇶",code:"MQ"},{name:"Mauritania",dial_code:"+222",emoji:"🇲🇷",code:"MR"},{name:"Mauritius",dial_code:"+230",emoji:"🇲🇺",code:"MU"},{name:"Mayotte",dial_code:"+262",emoji:"🇾🇹",code:"YT"},{name:"Mexico",dial_code:"+52",emoji:"🇲🇽",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dial_code:"+691",emoji:"🇫🇲",code:"FM"},{name:"Moldova",dial_code:"+373",emoji:"🇲🇩",code:"MD"},{name:"Monaco",dial_code:"+377",emoji:"🇲🇨",code:"MC"},{name:"Mongolia",dial_code:"+976",emoji:"🇲🇳",code:"MN"},{name:"Montenegro",dial_code:"+382",emoji:"🇲🇪",code:"ME"},{name:"Montserrat",dial_code:"+1664",emoji:"🇲🇸",code:"MS"},{name:"Morocco",dial_code:"+212",emoji:"🇲🇦",code:"MA"},{name:"Mozambique",dial_code:"+258",emoji:"🇲🇿",code:"MZ"},{name:"Myanmar",dial_code:"+95",emoji:"🇲🇲",code:"MM"},{name:"Namibia",emoji:"🇳🇦",dial_code:"+264",code:"NA"},{name:"Nauru",dial_code:"+674",emoji:"🇳🇷",code:"NR"},{name:"Nepal",dial_code:"+977",emoji:"🇳🇵",code:"NP"},{name:"Netherlands",dial_code:"+31",emoji:"🇳🇱",code:"NL"},{name:"Netherlands Antilles",dial_code:"+599",emoji:"🇧🇶",code:"AN"},{name:"New Caledonia",dial_code:"+687",emoji:"🇳🇨",code:"NC"},{name:"New Zealand",dial_code:"+64",emoji:"🇳🇿",code:"NZ"},{name:"Nicaragua",dial_code:"+505",emoji:"🇳🇮",code:"NI"},{name:"Niger",dial_code:"+227",emoji:"🇳🇪",code:"NE"},{name:"Nigeria",dial_code:"+234",emoji:"🇳🇬",code:"NG"},{name:"Niue",dial_code:"+683",emoji:"🇳🇺",code:"NU"},{name:"Norfolk Island",dial_code:"+672",emoji:"🇳🇫",code:"NF"},{name:"Northern Mariana Islands",dial_code:"+1670",emoji:"🇲🇵",code:"MP"},{name:"Norway",dial_code:"+47",emoji:"🇳🇴",code:"NO"},{name:"Oman",dial_code:"+968",emoji:"🇴🇲",code:"OM"},{name:"Pakistan",dial_code:"+92",emoji:"🇵🇰",code:"PK"},{name:"Palau",dial_code:"+680",emoji:"🇵🇼",code:"PW"},{name:"Palestinian Territory, Occupied",dial_code:"+970",emoji:"🇵🇸",code:"PS"},{name:"Panama",dial_code:"+507",emoji:"🇵🇦",code:"PA"},{name:"Papua New Guinea",dial_code:"+675",emoji:"🇵🇬",code:"PG"},{name:"Paraguay",dial_code:"+595",emoji:"🇵🇾",code:"PY"},{name:"Peru",dial_code:"+51",emoji:"🇵🇪",code:"PE"},{name:"Philippines",dial_code:"+63",emoji:"🇵🇭",code:"PH"},{name:"Pitcairn",dial_code:"+872",emoji:"🇵🇳",code:"PN"},{name:"Poland",dial_code:"+48",emoji:"🇵🇱",code:"PL"},{name:"Portugal",dial_code:"+351",emoji:"🇵🇹",code:"PT"},{name:"Puerto Rico",dial_code:"+1939",emoji:"🇵🇷",code:"PR"},{name:"Qatar",dial_code:"+974",emoji:"🇶🇦",code:"QA"},{name:"Romania",dial_code:"+40",emoji:"🇷🇴",code:"RO"},{name:"Russia",dial_code:"+7",emoji:"🇷🇺",code:"RU"},{name:"Rwanda",dial_code:"+250",emoji:"🇷🇼",code:"RW"},{name:"Reunion",dial_code:"+262",emoji:"🇷🇪",code:"RE"},{name:"Saint Barthelemy",dial_code:"+590",emoji:"🇧🇱",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dial_code:"+290",emoji:"🇸🇭",code:"SH"},{name:"Saint Kitts and Nevis",dial_code:"+1869",emoji:"🇰🇳",code:"KN"},{name:"Saint Lucia",dial_code:"+1758",emoji:"🇱🇨",code:"LC"},{name:"Saint Martin",dial_code:"+590",emoji:"🇲🇫",code:"MF"},{name:"Saint Pierre and Miquelon",dial_code:"+508",emoji:"🇵🇲",code:"PM"},{name:"Saint Vincent and the Grenadines",dial_code:"+1784",emoji:"🇻🇨",code:"VC"},{name:"Samoa",dial_code:"+685",emoji:"🇼🇸",code:"WS"},{name:"San Marino",dial_code:"+378",emoji:"🇸🇲",code:"SM"},{name:"Sao Tome and Principe",dial_code:"+239",emoji:"🇸🇹",code:"ST"},{name:"Saudi Arabia",dial_code:"+966",emoji:"🇸🇦",code:"SA"},{name:"Senegal",dial_code:"+221",emoji:"🇸🇳",code:"SN"},{name:"Serbia",dial_code:"+381",emoji:"🇷🇸",code:"RS"},{name:"Seychelles",dial_code:"+248",emoji:"🇸🇨",code:"SC"},{name:"Sierra Leone",dial_code:"+232",emoji:"🇸🇱",code:"SL"},{name:"Singapore",dial_code:"+65",emoji:"🇸🇬",code:"SG"},{name:"Slovakia",dial_code:"+421",emoji:"🇸🇰",code:"SK"},{name:"Slovenia",dial_code:"+386",emoji:"🇸🇮",code:"SI"},{name:"Solomon Islands",dial_code:"+677",emoji:"🇸🇧",code:"SB"},{name:"Somalia",dial_code:"+252",emoji:"🇸🇴",code:"SO"},{name:"South Africa",dial_code:"+27",emoji:"🇿🇦",code:"ZA"},{name:"South Sudan",dial_code:"+211",emoji:"🇸🇸",code:"SS"},{name:"South Georgia and the South Sandwich Islands",dial_code:"+500",emoji:"🇬🇸",code:"GS"},{name:"Spain",dial_code:"+34",emoji:"🇪🇸",code:"ES"},{name:"Sri Lanka",dial_code:"+94",emoji:"🇱🇰",code:"LK"},{name:"Sudan",dial_code:"+249",emoji:"🇸🇩",code:"SD"},{name:"Suriname",dial_code:"+597",emoji:"🇸🇷",code:"SR"},{name:"Svalbard and Jan Mayen",dial_code:"+47",emoji:"🇸🇯",code:"SJ"},{name:"Swaziland",dial_code:"+268",emoji:"🇸🇿",code:"SZ"},{name:"Sweden",dial_code:"+46",emoji:"🇸🇪",code:"SE"},{name:"Switzerland",dial_code:"+41",emoji:"🇨🇭",code:"CH"},{name:"Syrian Arab Republic",dial_code:"+963",emoji:"🇸🇾",code:"SY"},{name:"Taiwan",dial_code:"+886",emoji:"🇹🇼",code:"TW"},{name:"Tajikistan",dial_code:"+992",emoji:"🇹🇯",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dial_code:"+255",emoji:"🇹🇿",code:"TZ"},{name:"Thailand",dial_code:"+66",emoji:"🇹🇭",code:"TH"},{name:"Timor-Leste",dial_code:"+670",emoji:"🇹🇱",code:"TL"},{name:"Togo",dial_code:"+228",emoji:"🇹🇬",code:"TG"},{name:"Tokelau",dial_code:"+690",emoji:"🇹🇰",code:"TK"},{name:"Tonga",dial_code:"+676",emoji:"🇹🇴",code:"TO"},{name:"Trinidad and Tobago",dial_code:"+1868",emoji:"🇹🇹",code:"TT"},{name:"Tunisia",dial_code:"+216",emoji:"🇹🇳",code:"TN"},{name:"Turkey",dial_code:"+90",emoji:"🇹🇷",code:"TR"},{name:"Turkmenistan",dial_code:"+993",emoji:"🇹🇲",code:"TM"},{name:"Turks and Caicos Islands",dial_code:"+1649",emoji:"🇹🇨",code:"TC"},{name:"Tuvalu",dial_code:"+688",emoji:"🇹🇻",code:"TV"},{name:"Uganda",dial_code:"+256",emoji:"🇺🇬",code:"UG"},{name:"Ukraine",dial_code:"+380",emoji:"🇺🇦",code:"UA"},{name:"United Arab Emirates",dial_code:"+971",emoji:"🇦🇪",code:"AE"},{name:"United Kingdom",dial_code:"+44",emoji:"🇬🇧",code:"GB"},{name:"United States",dial_code:"+1",emoji:"🇺🇸",code:"US"},{name:"Uruguay",dial_code:"+598",emoji:"🇺🇾",code:"UY"},{name:"Uzbekistan",dial_code:"+998",emoji:"🇺🇿",code:"UZ"},{name:"Vanuatu",dial_code:"+678",emoji:"🇻🇺",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dial_code:"+58",emoji:"🇻🇪",code:"VE"},{name:"Vietnam",dial_code:"+84",emoji:"🇻🇳",code:"VN"},{name:"Virgin Islands, British",dial_code:"+1284",emoji:"🇻🇬",code:"VG"},{name:"Virgin Islands, U.S.",dial_code:"+1340",emoji:"🇻🇮",code:"VI"},{name:"Wallis and Futuna",dial_code:"+681",emoji:"🇼🇫",code:"WF"},{name:"Yemen",dial_code:"+967",emoji:"🇾🇪",code:"YE"},{name:"Zambia",dial_code:"+260",emoji:"🇿🇲",code:"ZM"},{name:"Zimbabwe",dial_code:"+263",emoji:"🇿🇼",code:"ZW"}],xn=({placeholder:e})=>{const[o,t]=u.useState(ft),[n,i]=u.useState(e??ft[0].name),[a,l]=u.useState(!0),[d,s]=u.useState(!1),[g,p]=u.useState(!1);return{hide:a,setHide:l,newOptions:o,setNewOptions:t,isHovered:g,setIsHovered:p,isFocused:d,setIsFocused:s,value:n,setValue:i}},or={xs:8,sm:10,md:12,lg:14,xl:16},qs=({size:e,...o})=>r.jsx(c.Element,{as:"ul",...o}),Ns=e=>r.jsx(c.Input,{type:"country",...e}),Us=({size:e,...o})=>r.jsx(c.Element,{as:"li",...o}),Gs=({option:e,size:o="md",callback:t=()=>{},views:n={text:{}}})=>{const i=a=>{a&&a.stopPropagation&&a.stopPropagation(),t(e)};return r.jsx(Us,{margin:0,role:"DropDownItem",listStyleType:"none",fontWeight:"normal",paddingVertical:6,paddingHorizontal:12,onClick:i,fontSize:c.Typography.fontSizes[o],_hover:{opacity:.8},...n.text,children:e})},Ys=({size:e,views:o={dropDown:{}},options:t=[],callback:n=()=>{}})=>{const i=a=>n(a);return r.jsx(qs,{role:"dropDown",margin:0,padding:0,top:"100%",width:"100%",display:"flex",zIndex:1e3,overflow:"auto",maxHeight:"300px",borderRadius:4,position:"absolute",flexDirection:"column",backgroundColor:"color-white",boxShadow:"rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px",...o.dropDown,children:t.map(a=>r.jsx(Gs,{size:e,option:a.name,callback:i,...o.text},a.code))})},bn=({id:e,name:o,label:t,value:n,placeholder:i,helperText:a,hide:l=!1,error:d=!1,isHovered:s=!1,isFocused:g=!1,isAutoFocus:p=!1,isDisabled:m=!1,isReadOnly:h=!1,shadow:f={},newOptions:x=[],size:y="md",variant:b="default",shape:k="default",onChange:C,onBlur:w=()=>{},setHide:j=()=>{},setNewOptions:S=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setValue:z=()=>{},views:E={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:_,...T})=>{const{getColor:$,themeMode:B}=c.useTheme(),R=$("color-blueGray-700",{themeMode:_||B}),V=()=>M(!0),W=D=>{j(!l),z(D),C&&C(D)},P=()=>{!m&&!h&&j(!l)},H=D=>{const O=D.target.value,K=ft.filter(Y=>Y.name.toLowerCase().startsWith(O.toLowerCase()));l&&j(!1),S(K),C&&C(O)},L=D=>{w(D),M(!1)},A=!!(t&&(g||n)),F={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[y],backgroundColor:"transparent",color:m?"color-trueGray-600":"color-blueGray-700",cursor:m?"not-allowed":h?"auto":"pointer",...E.field};return r.jsxs(we,{helperText:a,error:d,views:E,onClick:P,children:[r.jsxs(Ve,{label:t,size:y,error:d,shape:k,views:E,shadow:f,variant:b,value:n,color:"theme-primary",isDisabled:m,isReadOnly:h,isFocused:g,showLabel:A,_hover:!m&&!d?{borderColor:"theme-primary"}:void 0,children:[r.jsxs(Qe,{children:[A&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...E,children:t}),r.jsx(Ns,{id:e,name:o,placeholder:i,readOnly:h,disabled:m,autoFocus:p,onBlur:L,onFocus:V,...F,...T,value:n,onChange:H})]}),r.jsx(Lt,{children:l?r.jsx(ae,{orientation:"down",widthHeight:or[y],color:R,style:E.icon}):r.jsx(ae,{orientation:"up",widthHeight:or[y],color:R,style:E.icon})})]}),!l&&r.jsx(Ys,{size:y,views:E,options:x,callback:W})]})},vs=e=>{const o=xn(e);return r.jsx(bn,{...o,...e})},Xs=vs;function Bo(e){"@babel/helpers - typeof";return Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Bo(e)}function ge(e,o){if(o.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+o.length+" present")}function Ks(e){return ge(1,arguments),e instanceof Date||Bo(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function je(e){ge(1,arguments);var o=Object.prototype.toString.call(e);return e instanceof Date||Bo(e)==="object"&&o==="[object Date]"?new Date(e.getTime()):typeof e=="number"||o==="[object Number]"?new Date(e):((typeof e=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Qs(e){if(ge(1,arguments),!Ks(e)&&typeof e!="number")return!1;var o=je(e);return!isNaN(Number(o))}function $e(e){if(e===null||e===!0||e===!1)return NaN;var o=Number(e);return isNaN(o)?o:o<0?Math.ceil(o):Math.floor(o)}function Zs(e,o){ge(2,arguments);var t=je(e).getTime(),n=$e(o);return new Date(t+n)}function Js(e,o){ge(2,arguments);var t=$e(o);return Zs(e,-t)}var ed=864e5;function od(e){ge(1,arguments);var o=je(e),t=o.getTime();o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0);var n=o.getTime(),i=t-n;return Math.floor(i/ed)+1}function Lo(e){ge(1,arguments);var o=1,t=je(e),n=t.getUTCDay(),i=(n<o?7:0)+n-o;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}function yn(e){ge(1,arguments);var o=je(e),t=o.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var i=Lo(n),a=new Date(0);a.setUTCFullYear(t,0,4),a.setUTCHours(0,0,0,0);var l=Lo(a);return o.getTime()>=i.getTime()?t+1:o.getTime()>=l.getTime()?t:t-1}function td(e){ge(1,arguments);var o=yn(e),t=new Date(0);t.setUTCFullYear(o,0,4),t.setUTCHours(0,0,0,0);var n=Lo(t);return n}var rd=6048e5;function nd(e){ge(1,arguments);var o=je(e),t=Lo(o).getTime()-td(o).getTime();return Math.round(t/rd)+1}var ad={};function Qo(){return ad}function Ao(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=Qo(),m=$e((t=(n=(i=(a=o==null?void 0:o.weekStartsOn)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&i!==void 0?i:p.weekStartsOn)!==null&&n!==void 0?n:(s=p.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.weekStartsOn)!==null&&t!==void 0?t:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=je(e),f=h.getUTCDay(),x=(f<m?7:0)+f-m;return h.setUTCDate(h.getUTCDate()-x),h.setUTCHours(0,0,0,0),h}function kn(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=je(e),m=p.getUTCFullYear(),h=Qo(),f=$e((t=(n=(i=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:h.firstWeekContainsDate)!==null&&n!==void 0?n:(s=h.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(m+1,0,f),x.setUTCHours(0,0,0,0);var y=Ao(x,o),b=new Date(0);b.setUTCFullYear(m,0,f),b.setUTCHours(0,0,0,0);var k=Ao(b,o);return p.getTime()>=y.getTime()?m+1:p.getTime()>=k.getTime()?m:m-1}function id(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=Qo(),m=$e((t=(n=(i=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&n!==void 0?n:(s=p.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=kn(e,o),f=new Date(0);f.setUTCFullYear(h,0,m),f.setUTCHours(0,0,0,0);var x=Ao(f,o);return x}var ld=6048e5;function cd(e,o){ge(1,arguments);var t=je(e),n=Ao(t,o).getTime()-id(t,o).getTime();return Math.round(n/ld)+1}function te(e,o){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length<o;)n="0"+n;return t+n}var Te={y:function(o,t){var n=o.getUTCFullYear(),i=n>0?n:1-n;return te(t==="yy"?i%100:i,t.length)},M:function(o,t){var n=o.getUTCMonth();return t==="M"?String(n+1):te(n+1,2)},d:function(o,t){return te(o.getUTCDate(),t.length)},a:function(o,t){var n=o.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(o,t){return te(o.getUTCHours()%12||12,t.length)},H:function(o,t){return te(o.getUTCHours(),t.length)},m:function(o,t){return te(o.getUTCMinutes(),t.length)},s:function(o,t){return te(o.getUTCSeconds(),t.length)},S:function(o,t){var n=t.length,i=o.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return te(a,t.length)}},De={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sd={G:function(o,t,n){var i=o.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(o,t,n){if(t==="yo"){var i=o.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Te.y(o,t)},Y:function(o,t,n,i){var a=kn(o,i),l=a>0?a:1-a;if(t==="YY"){var d=l%100;return te(d,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):te(l,t.length)},R:function(o,t){var n=yn(o);return te(n,t.length)},u:function(o,t){var n=o.getUTCFullYear();return te(n,t.length)},Q:function(o,t,n){var i=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return te(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(o,t,n){var i=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return te(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(o,t,n){var i=o.getUTCMonth();switch(t){case"M":case"MM":return Te.M(o,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(o,t,n){var i=o.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return te(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(o,t,n,i){var a=cd(o,i);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):te(a,t.length)},I:function(o,t,n){var i=nd(o);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):te(i,t.length)},d:function(o,t,n){return t==="do"?n.ordinalNumber(o.getUTCDate(),{unit:"date"}):Te.d(o,t)},D:function(o,t,n){var i=od(o);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):te(i,t.length)},E:function(o,t,n){var i=o.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(o,t,n,i){var a=o.getUTCDay(),l=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return te(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(o,t,n,i){var a=o.getUTCDay(),l=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return te(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(o,t,n){var i=o.getUTCDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return te(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(o,t,n){var i=o.getUTCHours(),a=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(o,t,n){var i=o.getUTCHours(),a;switch(i===12?a=De.noon:i===0?a=De.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(o,t,n){var i=o.getUTCHours(),a;switch(i>=17?a=De.evening:i>=12?a=De.afternoon:i>=4?a=De.morning:a=De.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(o,t,n){if(t==="ho"){var i=o.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Te.h(o,t)},H:function(o,t,n){return t==="Ho"?n.ordinalNumber(o.getUTCHours(),{unit:"hour"}):Te.H(o,t)},K:function(o,t,n){var i=o.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):te(i,t.length)},k:function(o,t,n){var i=o.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):te(i,t.length)},m:function(o,t,n){return t==="mo"?n.ordinalNumber(o.getUTCMinutes(),{unit:"minute"}):Te.m(o,t)},s:function(o,t,n){return t==="so"?n.ordinalNumber(o.getUTCSeconds(),{unit:"second"}):Te.s(o,t)},S:function(o,t){return Te.S(o,t)},X:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();if(l===0)return"Z";switch(t){case"X":return rr(l);case"XXXX":case"XX":return We(l);case"XXXXX":case"XXX":default:return We(l,":")}},x:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"x":return rr(l);case"xxxx":case"xx":return We(l);case"xxxxx":case"xxx":default:return We(l,":")}},O:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+tr(l,":");case"OOOO":default:return"GMT"+We(l,":")}},z:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+tr(l,":");case"zzzz":default:return"GMT"+We(l,":")}},t:function(o,t,n,i){var a=i._originalDate||o,l=Math.floor(a.getTime()/1e3);return te(l,t.length)},T:function(o,t,n,i){var a=i._originalDate||o,l=a.getTime();return te(l,t.length)}};function tr(e,o){var t=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return t+String(i);var l=o;return t+String(i)+l+te(a,2)}function rr(e,o){if(e%60===0){var t=e>0?"-":"+";return t+te(Math.abs(e)/60,2)}return We(e,o)}function We(e,o){var t=o||"",n=e>0?"-":"+",i=Math.abs(e),a=te(Math.floor(i/60),2),l=te(i%60,2);return n+a+t+l}var nr=function(o,t){switch(o){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},jn=function(o,t){switch(o){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},dd=function(o,t){var n=o.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return nr(o,t);var l;switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",nr(i,t)).replace("{{time}}",jn(a,t))},ud={p:jn,P:dd};function gd(e){var o=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return o.setUTCFullYear(e.getFullYear()),e.getTime()-o.getTime()}var pd=["D","DD"],md=["YY","YYYY"];function hd(e){return pd.indexOf(e)!==-1}function fd(e){return md.indexOf(e)!==-1}function ar(e,o,t){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(o,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(o,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(o,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(o,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var xd={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},bd=function(o,t,n){var i,a=xd[o];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function it(e){return function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=o.width?String(o.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var yd={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kd={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},jd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cd={date:it({formats:yd,defaultWidth:"full"}),time:it({formats:kd,defaultWidth:"full"}),dateTime:it({formats:jd,defaultWidth:"full"})},Sd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wd=function(o,t,n,i){return Sd[o]};function no(e){return function(o,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,l=t!=null&&t.width?String(t.width):a;i=e.formattingValues[l]||e.formattingValues[a]}else{var d=e.defaultWidth,s=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[s]||e.values[d]}var g=e.argumentCallback?e.argumentCallback(o):o;return i[g]}}var Id={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Td={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Md={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},zd={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Rd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Vd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ed=function(o,t){var n=Number(o),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Pd={ordinalNumber:Ed,era:no({values:Id,defaultWidth:"wide"}),quarter:no({values:Td,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:no({values:Md,defaultWidth:"wide"}),day:no({values:zd,defaultWidth:"wide"}),dayPeriod:no({values:Rd,defaultWidth:"wide",formattingValues:Vd,defaultFormattingWidth:"wide"})};function ao(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=o.match(i);if(!a)return null;var l=a[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(d)?_d(d,function(m){return m.test(l)}):Wd(d,function(m){return m.test(l)}),g;g=e.valueCallback?e.valueCallback(s):s,g=t.valueCallback?t.valueCallback(g):g;var p=o.slice(l.length);return{value:g,rest:p}}}function Wd(e,o){for(var t in e)if(e.hasOwnProperty(t)&&o(e[t]))return t}function _d(e,o){for(var t=0;t<e.length;t++)if(o(e[t]))return t}function $d(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=o.match(e.matchPattern);if(!n)return null;var i=n[0],a=o.match(e.parsePattern);if(!a)return null;var l=e.valueCallback?e.valueCallback(a[0]):a[0];l=t.valueCallback?t.valueCallback(l):l;var d=o.slice(i.length);return{value:l,rest:d}}}var Hd=/^(\d+)(th|st|nd|rd)?/i,Bd=/\d+/i,Ld={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ad={any:[/^b/i,/^(a|c)/i]},Dd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Fd={any:[/1/i,/2/i,/3/i,/4/i]},Od={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Nd={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ud={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Gd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Yd={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},vd={ordinalNumber:$d({matchPattern:Hd,parsePattern:Bd,valueCallback:function(o){return parseInt(o,10)}}),era:ao({matchPatterns:Ld,defaultMatchWidth:"wide",parsePatterns:Ad,defaultParseWidth:"any"}),quarter:ao({matchPatterns:Dd,defaultMatchWidth:"wide",parsePatterns:Fd,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:ao({matchPatterns:Od,defaultMatchWidth:"wide",parsePatterns:qd,defaultParseWidth:"any"}),day:ao({matchPatterns:Nd,defaultMatchWidth:"wide",parsePatterns:Ud,defaultParseWidth:"any"}),dayPeriod:ao({matchPatterns:Gd,defaultMatchWidth:"any",parsePatterns:Yd,defaultParseWidth:"any"})},Xd={code:"en-US",formatDistance:bd,formatLong:Cd,formatRelative:wd,localize:Pd,match:vd,options:{weekStartsOn:0,firstWeekContainsDate:1}},Kd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zd=/^'([^]*?)'?$/,Jd=/''/g,eu=/[a-zA-Z]/;function ou(e,o,t){var n,i,a,l,d,s,g,p,m,h,f,x,y,b;ge(2,arguments);var k=String(o),C=Qo(),w=(n=(i=void 0)!==null&&i!==void 0?i:C.locale)!==null&&n!==void 0?n:Xd,j=$e((a=(l=(d=(s=void 0)!==null&&s!==void 0?s:void 0)!==null&&d!==void 0?d:C.firstWeekContainsDate)!==null&&l!==void 0?l:(g=C.locale)===null||g===void 0||(p=g.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(j>=1&&j<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var S=$e((m=(h=(f=(x=void 0)!==null&&x!==void 0?x:void 0)!==null&&f!==void 0?f:C.weekStartsOn)!==null&&h!==void 0?h:(y=C.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&m!==void 0?m:0);if(!(S>=0&&S<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!w.localize)throw new RangeError("locale must contain localize property");if(!w.formatLong)throw new RangeError("locale must contain formatLong property");var I=je(e);if(!Qs(I))throw new RangeError("Invalid time value");var M=gd(I),z=Js(I,M),E={firstWeekContainsDate:j,weekStartsOn:S,locale:w,_originalDate:I},_=k.match(Qd).map(function(T){var $=T[0];if($==="p"||$==="P"){var B=ud[$];return B(T,w.formatLong)}return T}).join("").match(Kd).map(function(T){if(T==="''")return"'";var $=T[0];if($==="'")return tu(T);var B=sd[$];if(B)return fd(T)&&ar(T,o,String(e)),hd(T)&&ar(T,o,String(e)),B(z,T,w.localize,E);if($.match(eu))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return T}).join("");return _}function tu(e){var o=e.match(Zd);return o?o[1].replace(Jd,"'"):e}const Cn=()=>{const[e,o]=u.useState(!1),[t,n]=u.useState(!1),[i,a]=u.useState(ou(new Date,"yyyy-MM-dd"));return{date:i,setDate:a,isHovered:e,setIsHovered:o,isFocused:t,setIsFocused:n}},ru=e=>r.jsx(c.Input,{type:"date",...e}),Sn=({id:e,icon:o,name:t,label:n,date:i,children:a,helperText:l,shadow:d={},size:s="md",variant:g="default",shape:p="default",views:m={container:{},label:{},helperText:{},text:{},field:{}},error:h=!1,isHovered:f=!1,isFocused:x=!1,isDisabled:y=!1,isReadOnly:b=!1,setDate:k=()=>{},setIsFocused:C=()=>{},setIsHovered:w=()=>{},onChange:j,onChangeText:S,...I})=>{const M=!!(x&&n),z=()=>w(!f),E=()=>C(!0),_=$=>{typeof $=="string"?(k($),S&&S($)):(k($.target.value),j&&j($.target.value))},T={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none",backgroundColor:"transparent"}},fontSize:c.Typography.fontSizes[s],backgroundColor:"transparent",color:y?"color-trueGray-600":"color-blueGray-700",cursor:y?"not-allowed":b?"auto":"pointer",...m.field};return r.jsx(we,{helperText:l,error:h,views:m,children:r.jsx(Ve,{label:n,size:s,error:h,shape:p,views:m,shadow:d,color:"theme-primary",variant:g,value:i,isHovered:f,isDisabled:y,isReadOnly:b,isFocused:x,showLabel:M,onMouseEnter:z,onMouseLeave:z,children:r.jsxs(Qe,{children:[M&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:h,...m,children:n}),r.jsx(ru,{id:e,name:t,onFocus:E,disabled:y,readOnly:b,...T,...I,...S&&{onChangeText:_},onChange:_})]})})})},nu=e=>{const o=Cn();return r.jsx(Sn,{...o,...e})},au=nu,wn=e=>{const o=At(e),[t,n]=u.useState(!1);return{isVisible:t,setIsVisible:n,...e,...o}},iu=({visibleIcon:e=r.jsx(Rt,{widthHeight:14}),hiddenIcon:o=r.jsx(zt,{widthHeight:14}),...t})=>{const{isVisible:n,setIsVisible:i,...a}=wn(t);return r.jsx(fo,{...a,type:n?"text":"password",isClearable:!1,right:r.jsx(c.View,{onClick:()=>{t.isDisabled||i(!n)},children:n?e:o})})},lu=iu,In=(e,o,t)=>{const[n,i]=u.useState(e),[a,l]=u.useState(o?{value:o,label:o}:e[0]),[d,s]=u.useState([]),[g,p]=u.useState(0),[m,h]=u.useState(t??""),[f,x]=u.useState(!1);return{filteredItems:n,setFilteredItems:i,selectedItem:a,setSelectedItem:l,selectedItems:d,setSelectedItems:s,highlightedIndex:g,setHighlightedIndex:p,searchQuery:m,setSearchQuery:h,isDropdownVisible:f,setIsDropdownVisible:x}},cu={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},ir={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},initial:{opacity:0,transform:"translateY(-8px) scale(0.96)"}},su={padding:"8px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-100",backgroundColor:"color-gray-50",borderTopLeftRadius:"10px",borderTopRightRadius:"10px"},du={padding:"8px 10px",cursor:"pointer",borderRadius:"6px",margin:"1px 4px",transition:"background-color 0.15s ease"},uu={padding:"24px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},lr={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},gu={display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"color-gray-100",borderRadius:"4px",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},Tn=({placeholder:e,items:o,showTick:t=!0,onSelect:n,searchEnabled:i=!0,left:a,right:l,label:d,filteredItems:s,setSelectedItem:g,selectedItem:p,selectedItems:m,setSelectedItems:h,highlightedIndex:f,setHighlightedIndex:x,searchQuery:y,setSearchQuery:b,setFilteredItems:k,views:C,isDropdownVisible:w,setIsDropdownVisible:j,isMulti:S=!1,...I})=>{const{ref:M,relation:z}=c.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),E=u.useRef(null),[_,T]=u.useState(!1),[$,B]=u.useState(!1),R=()=>{var O;const L=$?ir.enter:ir.initial;if(!M.current)return{};const A=M.current.getBoundingClientRect(),F={position:"fixed",left:A.left,width:A.width,zIndex:1e4,...L};return((O=z==null?void 0:z.space)==null?void 0:O.vertical)==="top"?{...F,bottom:window.innerHeight-A.top+6}:{...F,top:A.bottom+6}};u.useEffect(()=>{if(w){const L=setTimeout(()=>B(!0),10);return()=>clearTimeout(L)}B(!1)},[w]),u.useEffect(()=>{const L=A=>{!A.composedPath().some(O=>(O==null?void 0:O.id)==="combobox-dropdown")&&M.current&&!M.current.contains(A.target)&&j(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);const V=L=>{if(b(L),L==="")k(o);else{const A=o.filter(F=>F.label.toLowerCase().includes(L.toLowerCase()));k(A)}x(0)},W=L=>{if(S){const A=m.some(D=>D.value===L.value);let F;A?F=m.filter(D=>D.value!==L.value):F=[...m,L],h(F),n==null||n(F)}else g(L),n==null||n(L),j(!1)},P=(L,A)=>{L.stopPropagation();const F=m.filter(D=>D.value!==A.value);h(F),n==null||n(F)},H=L=>S?m.some(A=>A.value===L.value):L.value===p.value;return r.jsxs(c.Horizontal,{role:"combobox",flexWrap:"nowrap",gap:15,alignItems:"center",width:"100%",...I,children:[d&&r.jsx(c.Text,{views:C==null?void 0:C.label,htmlFor:I.id,children:d}),r.jsxs(c.View,{position:"relative",width:"100%",children:[r.jsx("div",{ref:M,onClick:()=>j(!w),style:{width:"100%"},children:r.jsxs(Ve,{isHovered:_,isFocused:w,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),cursor:"pointer",views:{container:C==null?void 0:C.container},children:[r.jsxs(c.Horizontal,{gap:10,alignItems:"center",width:"100%",flexWrap:S?"wrap":"nowrap",...C==null?void 0:C.labelContainer,children:[a,S?m.length>0?r.jsx(c.Horizontal,{gap:6,flexWrap:"wrap",alignItems:"center",children:m.map(L=>r.jsxs(c.Horizontal,{...gu,_hover:{backgroundColor:"color-gray-200"},children:[L.icon&&r.jsx(c.View,{flexShrink:0,children:L.icon}),r.jsx(c.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:L.label}),r.jsx(fe,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:A=>P(A,L)})]},L.value))}):r.jsx(c.Text,{weight:"medium",flexGrow:1,color:"color-gray-500",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...C==null?void 0:C.label,children:e}):r.jsxs(r.Fragment,{children:[p.icon&&p.label!==e&&r.jsx(c.View,{children:p.icon}),r.jsx(c.Text,{weight:"medium",flexGrow:1,color:p.label===e?"color-gray-500":"color-gray-800",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...C==null?void 0:C.label,children:p.label})]})]}),r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[l,r.jsx(c.View,{style:w?lr.open:lr.closed,children:r.jsx(ae,{widthHeight:16,orientation:"down",color:w?"color-gray-700":"color-gray-400"})})]})]})}),w&&r.jsx(on,{children:r.jsxs(c.View,{ref:E,id:"combobox-dropdown",role:"listbox","aria-labelledby":I.id,...cu,style:R(),...C==null?void 0:C.dropdown,children:[i&&r.jsx(c.View,{...su,children:r.jsx(fo,{id:`${I.id}-search`,name:`${I.name}-search`,width:"100%",type:"search",autoFocus:!0,value:y,onChange:L=>V(L),hint:e||"Search...",isClearable:!1,left:r.jsx(Po,{widthHeight:14,color:"color-gray-400"}),views:{container:{width:"100%",padding:"0",backgroundColor:"transparent",borderColor:"color-gray-200",...C==null?void 0:C.text},field:{fontSize:"13px"}}})}),s.length>0&&r.jsx(c.View,{margin:0,padding:"4px",children:s.map((L,A)=>{const F=H(L),D=A===f;return r.jsxs(c.Horizontal,{role:"option","aria-selected":F,justifyContent:"space-between",alignItems:"center",...du,backgroundColor:F&&D?"rgba(59, 130, 246, 0.12)":F?"rgba(59, 130, 246, 0.08)":D?"color-gray-100":"transparent",onMouseEnter:()=>x(A),onClick:()=>W(L),...C==null?void 0:C.item,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[L.icon&&r.jsx(c.View,{flexShrink:0,children:L.icon}),r.jsx(c.Text,{size:"sm",color:F?"theme-primary":"color-gray-800",weight:F?"medium":"normal",children:L.label})]}),F&&t&&r.jsx(No,{widthHeight:16,color:"theme-primary"})]},L.value)})}),s.length===0&&r.jsxs(c.Vertical,{...uu,children:[r.jsx(Po,{widthHeight:24,color:"color-gray-300"}),r.jsx(c.Text,{color:"color-gray-500",size:"sm",align:"center",children:"No results found"}),r.jsx(c.Text,{color:"color-gray-400",size:"xs",align:"center",children:"Try a different search term"})]})]})})]})]})},pu=({id:e,name:o,items:t,placeholder:n,searchPlaceholder:i,...a})=>{const l=In(t,n,i);return r.jsx(Tn,{id:e,name:o,items:t,...l,...a})},mu=pu,Mn=e=>{const{tags:o,defaultTags:t=[],onTagsChange:n,onTagAdd:i,onTagRemove:a,maxTags:l,minTagLength:d=1,maxTagLength:s=50,allowDuplicates:g=!1,separators:p=["enter","comma"],isDisabled:m=!1,isReadOnly:h=!1}=e,[f,x]=u.useState(""),[y,b]=u.useState(()=>(o||t||[]).map((R,V)=>({id:`tag-${V}-${Date.now()}`,value:R}))),[k,C]=u.useState(!1),[w,j]=u.useState(!1),S=o&&Array.isArray(o)?o.map((B,R)=>({id:`tag-${R}-${Date.now()}`,value:B})):y;u.useEffect(()=>{o&&Array.isArray(o)&&b(o.map((B,R)=>({id:`tag-${R}-${Date.now()}`,value:B})))},[o]);const I=u.useCallback(B=>{const R=B.trim();return!(R.length<d||R.length>s||!g&&S.map(W=>W.value.toLowerCase()).includes(R.toLowerCase())||l&&S.length>=l)},[S,d,s,g,l]),M=u.useCallback(B=>{if(m||h)return;const R=B.trim();if(!R||!I(R))return;const V={id:`tag-${Date.now()}-${Math.random()}`,value:R},W=[...S,V],P=W.map(H=>H.value);o||b(W),n==null||n(P),i==null||i(R),x("")},[S,I,n,i,m,h,o]),z=u.useCallback(B=>{if(m||h)return;const R=S[B];if(!R)return;const V=S.filter((P,H)=>H!==B),W=V.map(P=>P.value);o||b(V),n==null||n(W),a==null||a(R.value,B)},[S,n,a,m,h,o]),E=u.useCallback(B=>{if(m||h)return;const R=B.target.value;if(p.includes("comma")&&R.includes(",")){const V=R.split(","),W=V[0],P=V.slice(1).join(",");W.trim()&&M(W),x(P);return}x(R)},[M,p,m,h]),_=u.useCallback(B=>{if(m||h)return;const{key:R}=B;if(p.includes("enter")&&R==="Enter"){B.preventDefault(),f.trim()&&M(f);return}if(p.includes("tab")&&R==="Tab"&&f.trim()){B.preventDefault(),M(f);return}if(p.includes("space")&&R===" "&&f.trim()){B.preventDefault(),M(f);return}if(R==="Backspace"&&!f&&S.length>0){B.preventDefault(),z(S.length-1);return}},[M,z,f,S,p,m,h]),T=u.useCallback(()=>{var B;C(!0),(B=e.onFocus)==null||B.call(e)},[e.onFocus]),$=u.useCallback(()=>{var B;C(!1),f.trim()&&M(f),(B=e.onBlur)==null||B.call(e)},[M,f,e.onBlur]);return{inputValue:f,setInputValue:x,tags:S,setTags:b,isFocused:k,setIsFocused:C,isHovered:w,setIsHovered:j,addTag:M,removeTag:z,handleInputChange:E,handleKeyDown:_,handleFocus:T,handleBlur:$,validateTag:I}},hu=({tag:e,onRemove:o,isRemovable:t,size:n,views:i,isDisabled:a,isReadOnly:l})=>{const[d,s]=u.useState(!1),g={xs:{padding:"2px 8px",fontSize:"10px",iconSize:10},sm:{padding:"4px 10px",fontSize:"12px",iconSize:12},md:{padding:"6px 14px",fontSize:"14px",iconSize:14},lg:{padding:"8px 16px",fontSize:"16px",iconSize:16},xl:{padding:"10px 18px",fontSize:"18px",iconSize:18}}[n]||{padding:"6px 14px",fontSize:"14px",iconSize:14};return r.jsxs(c.Horizontal,{alignItems:"center",gap:6,padding:g.padding,backgroundColor:"color-gray-100-100",borderRadius:"16px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-100",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",opacity:a?.6:1,_hover:!a&&!l?{backgroundColor:"color-gray-100-200",borderColor:"color-gray-200",boxShadow:"0 4px 6px rgba(0,0,0,0.05)",transform:"translateY(-1px)"}:{},...i==null?void 0:i.tag,children:[r.jsx(c.Text,{fontSize:g.fontSize,color:a?"color-gray-100":"theme-primary",whiteSpace:"nowrap",...i==null?void 0:i.tagText,children:e}),t&&!a&&!l&&r.jsx(c.View,{cursor:"pointer",padding:"2px",borderRadius:"50%",transition:"all 0.2s ease",backgroundColor:d?"color-red-100":"transparent",opacity:d?1:.7,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:p=>{p.stopPropagation(),o()},_hover:{backgroundColor:"color-red-50"},...i==null?void 0:i.tagRemove,children:r.jsx(fe,{widthHeight:g.iconSize,color:d?"color-red-500":"color-gray-400"})})]})},zn=({id:e,name:o,label:t,placeholder:n="Type and press Enter to add tags...",helperText:i,error:a=!1,inputValue:l="",tags:d=[],left:s,right:g,shadow:p={},views:m={},size:h="md",shape:f="default",variant:x="default",isDisabled:y=!1,isReadOnly:b=!1,isAutoFocus:k=!1,isRemovable:C=!0,isFocused:w=!1,isHovered:j=!1,maxTags:S,handleInputChange:I,handleKeyDown:M,handleFocus:z,handleBlur:E,removeTag:_,setIsHovered:T,onClick:$,...B})=>{const{getColor:R,themeMode:V}=c.useTheme(),W=!!(t&&(w||d.length>0||l)),P=S&&d.length>=S,H={...tn[f],...rn[x],...m==null?void 0:m.inputContainer},L={border:"none",outline:"none",backgroundColor:"transparent",fontSize:c.Typography.fontSizes[h],color:y?"color-gray-400":"color-gray-800",flex:1,minWidth:"120px",...m==null?void 0:m.input};return r.jsx(we,{error:!!a,helperText:typeof a=="string"?a:i,views:m,...B,children:r.jsxs(Ve,{label:t,shadow:p,value:d.length>0||l?"has-content":"",size:h,shape:f,variant:x,error:!!a,showLabel:W,isFocused:w,isHovered:j,isDisabled:y,isReadOnly:b,views:m,onClick:$,onMouseEnter:()=>T==null?void 0:T(!0),onMouseLeave:()=>T==null?void 0:T(!1),...H,children:[s,r.jsxs(Qe,{children:[t&&r.jsx(He,{size:h,error:!!a,views:m,children:t}),r.jsxs(c.Horizontal,{alignItems:"center",gap:8,flexWrap:"wrap",width:"100%",minHeight:c.Typography.fontSizes[h],padding:"8px 0",...m==null?void 0:m.tagsContainer,children:[d.map((A,F)=>r.jsx(hu,{tag:A.value,onRemove:()=>_==null?void 0:_(F),isRemovable:C,size:h,views:m,isDisabled:y,isReadOnly:b},A.id)),!P&&r.jsx(c.Input,{id:e,name:o,type:"text",value:l,placeholder:d.length===0?n:"",disabled:y,readOnly:b,autoFocus:k,onChange:I,onKeyDown:M,onFocus:z,onBlur:E,autoComplete:"off",...L}),P&&r.jsxs(c.Text,{fontSize:c.Typography.fontSizes[h],color:"color-gray-500",fontStyle:"italic",...m==null?void 0:m.placeholder,children:["Maximum ",S," tags reached"]})]})]}),g]})})},fu=e=>{const o=Mn(e),{tags:t,...n}=e;return r.jsx(zn,{...o,...n})},xu=fu;function bu(e){const o=setTimeout(e,0),t=setTimeout(e,10),n=setTimeout(e,50);return[o,t,n]}const Rn=({value:e,defaultValue:o="",length:t=6,onChange:n,onChangeText:i,onComplete:a,onKeyDown:l,onKeyPress:d,onBlur:s,onFocus:g,isReadOnly:p,isDisabled:m,pattern:h,stepValues:f,pasteTransformer:x})=>{var K,Y;const y=e!==void 0,b=y?e:o,[k,C]=u.useState((b==null?void 0:b.slice(0,t))||""),[w,j]=u.useState(!1),[S,I]=u.useState(!1),[M,z]=u.useState(null),[E,_]=u.useState(null),T=u.useRef(null),$=u.useRef(null),B=u.useRef({value:k,onChange:n||(()=>{}),isIOS:typeof window<"u"&&((Y=(K=window==null?void 0:window.CSS)==null?void 0:K.supports)==null?void 0:Y.call(K,"-webkit-touch-callout","none"))}),R=u.useRef({prev:[null,null,"none"]}),V=h?typeof h=="string"?new RegExp(h):h:null;u.useEffect(()=>{y&&e!==k&&C((e==null?void 0:e.slice(0,t))||"")},[y,e,t,k]);const W=u.useCallback(N=>{let X=N;if(f&&f.length>0&&N){const Z=parseInt(N,10);if(!isNaN(Z)){let J=f[0],oe=Math.abs(Z-J);for(let re=1;re<f.length;re++){const ce=Math.abs(Z-f[re]);ce<oe&&(oe=ce,J=f[re])}X=J.toString()}}C(X),n&&n(X),i&&i(X),a&&X.length===t&&a(X)},[n,i,a,t,f]),P=u.useCallback(N=>{N&&T.current!==N&&Object.defineProperty(T,"current",{value:N,writable:!0})},[]),H=u.useCallback(N=>{const X=N.currentTarget.value.slice(0,t);if(X.length>0&&V&&!V.test(X)){N.preventDefault();return}W(X),T.current&&(T.current.value=X)},[t,V,W,T]),L=u.useCallback(()=>{var N;if(T.current){const X=Math.min(T.current.value.length,t-1),Z=T.current.value.length;(N=T.current)==null||N.setSelectionRange(X,Z),z(X),_(Z)}j(!0)},[t]),A=u.useCallback(()=>{j(!1)},[]),F=u.useCallback(N=>{l&&l(N)},[]),D=u.useCallback(N=>{d&&d(N)},[]),O=u.useCallback(N=>{const X=T.current;if(!N.clipboardData||!X)return;const Z=N.clipboardData.getData("text/plain"),J=x?x(Z):Z;N.preventDefault();const oe=X.selectionStart||0,re=X.selectionEnd||0,U=(oe!==re?k.slice(0,oe)+J+k.slice(re):k.slice(0,oe)+J+k.slice(oe)).slice(0,t);if(U.length>0&&V&&!V.test(U))return;X.value=U,W(U),C(U);const G=Math.min(U.length,t-1),ee=U.length;X.setSelectionRange(G,ee),z(G),_(ee)},[t,x,V,W,k,C]);return u.useEffect(()=>{const N=T.current,X=$.current;if(!N||!X)return;B.current.value!==N.value&&B.current.onChange&&B.current.onChange(N.value),R.current.prev=[N.selectionStart,N.selectionEnd,N.selectionDirection];function Z(){if(document.activeElement!==N){z(null),_(null);return}const re=(N==null?void 0:N.selectionStart)??null,ce=(N==null?void 0:N.selectionEnd)??null,me=(N==null?void 0:N.selectionDirection)??null,U=(N==null?void 0:N.maxLength)??0,G=(N==null?void 0:N.value)??"",ee=R.current.prev;let v=-1,Q=-1,le="none";if(G.length!==0&&re!==null&&ce!==null){const ne=re===ce,Ie=re===G.length&&G.length<U;if(ne&&!Ie){const ye=re;if(ye===0)v=0,Q=1,le="forward";else if(ye===U)v=ye-1,Q=ye,le="backward";else if(U>1&&G.length>1){let ot=0;if(ee[0]!==null&&ee[1]!==null){le=ye<ee[1]?"backward":"forward";const va=ee[0]===ee[1]&&ee[0]<U;le==="backward"&&!va&&(ot=-1)}v=ot+ye,Q=ot+ye+1}}v!==-1&&Q!==-1&&v!==Q&&T.current&&T.current.setSelectionRange(v,Q,le)}const se=v!==-1?v:re,pe=Q!==-1?Q:ce,xe=le!=="none"?le:me;z(se),_(pe),R.current.prev=[se,pe,xe]}document.addEventListener("selectionchange",Z,{capture:!0}),Z(),document.activeElement===N&&j(!0);const J=()=>{X&&X.style.setProperty("--root-height",`${N.clientHeight}px`)};J();const oe=new window.ResizeObserver(J);return oe.observe(N),()=>{document.removeEventListener("selectionchange",Z,{capture:!0}),oe.disconnect()}},[]),u.useEffect(()=>{bu(()=>{var J,oe,re,ce;(J=T.current)==null||J.dispatchEvent(new Event("input"));const N=(oe=T.current)==null?void 0:oe.selectionStart,X=(re=T.current)==null?void 0:re.selectionEnd,Z=(ce=T.current)==null?void 0:ce.selectionDirection;N!==null&&X!==null&&N!==void 0&&X!==void 0&&(z(N),_(X),R.current.prev=[N,X,Z||"none"])})},[k,w]),{value:k,setValue:W,isFocused:w,setIsFocused:j,isHovered:S,setIsHovered:I,inputRef:T,containerRef:$,mirrorSelectionStart:M,mirrorSelectionEnd:E,setMirrorSelectionStart:z,setMirrorSelectionEnd:_,setInputRef:P,handleChange:H,handleFocus:L,handleBlur:A,handleKeyDown:F,handleKeyPress:D,handlePaste:O}},yu=u.createContext({slots:[],isFocused:!1,isHovering:!1}),ku=`
4
+ ${A} no-repeat,
5
+ ${F} no-repeat
6
+ `,backgroundSize:`200% ${O}px, ${O}px 200%, 200% ${O}px, ${O}px 200%`,backgroundPosition:D,transitionProperty:"background-position",transitionDuration:`${E}s`,transitionTimingFunction:"linear",transitionDelay:Y,_hover:{backgroundPosition:q,transitionDelay:K},width:a?"fit-content":l?"100%":void 0,...m==null?void 0:m.container,...V,children:r.jsx(c.View,{as:t?"div":"button",disabled:!!(n||i),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:Math.max(0,_-3),width:"100%",height:"100%",...h,...f,...x,backgroundColor:(h==null?void 0:h.backgroundColor)||w,color:b,borderWidth:0,cursor:n?"default":"pointer",children:T})})}return r.jsx(c.Element,{ref:y,as:e==="link"&&t?"div":"button",type:e==="link"&&t?void 0:"button",disabled:!!(n||i),...f,...x,display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":l?"100%":void 0,borderRadius:so[s],boxShadow:g,transition:"background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",cursor:n?"default":"pointer",onClick:p,...h,...m==null?void 0:m.container,...V,children:T})},yc=u.memo(u.forwardRef(({variant:e="filled",size:o="md",shape:t="rounded",iconPosition:n="left",loaderPosition:i="left",backgroundColor:a,color:l,textColor:d,reversed:s=!1,isAuto:g=!0,isFilled:p,isDisabled:m,isLoading:h,isIconRounded:f,isHovered:x,icon:y,children:b,to:k,isExternal:S,shadow:w,onClick:j,views:C={},borderMovingDuration:I=2,borderMovingGradientColors:M=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:R="#705CFF",animatedStrokeTextColor:V="#333333",..._},T)=>{const{getColorHex:W}=c.useTheme();let z=W(m?"theme-disabled":h?"theme-loading":a??l??"theme-button-background");(z==="theme-button-background"||z==="theme-loading")&&(z=W(h?"color-dark-500":"theme-primary"));let E=W(d??"theme-button-text");E==="theme-button-text"&&(E=W("color-white"));const L=u.useMemo(()=>pc(z,E,s),[z,E,s])[e],A=(L==null?void 0:L.color)??E,F=r.jsx(mc,{icon:y,isLoading:h,iconPosition:n,loaderPosition:i,size:o,resolvedTextColor:A,isIconRounded:f,views:C,children:b}),D=Dr[o],q=f?Fr[o]:{};return r.jsx(bc,{variant:e,animation:_.animation,to:k,isDisabled:m,isLoading:h,isAuto:g,isFilled:p,isExternal:S,shape:t,shadow:w,onClick:j,views:C,baseStyles:L,sizeStyles:D,iconPad:q,resolvedTextColor:A,content:F,size:o,mainTone:z,borderMovingDuration:I,borderMovingGradientColors:M,animatedStrokeAccentColor:R,animatedStrokeTextColor:V,getColor:W,containerRef:T,..._})})),kc=e=>{const[o,t]=c.useHover();return r.jsx(yc,{isHovered:t,...e})},_e=kc,jc={sm:{padding:"12px"},md:{padding:"16px"},lg:{padding:"24px"}},Cc={square:0,rounded:"8px",pill:"24px"},Sc=e=>{const o=e==="dark";return{default:{backgroundColor:o?"color-gray-900":"color-white",border:"none",transition:"background-color 0.2s ease, box-shadow 0.2s ease"},outlined:{backgroundColor:o?"color-gray-900":"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:o?"color-gray-700":"color-gray-200",transition:"border-color 0.2s ease, box-shadow 0.2s ease",_hover:{borderColor:o?"color-gray-600":"color-gray-300",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.05)"}},elevated:{backgroundColor:o?"color-gray-900":"color-white",boxShadow:o?"0px 4px 12px rgba(0, 0, 0, 0.3)":"0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)",border:"none",transition:"box-shadow 0.2s ease",_hover:{boxShadow:o?"0px 8px 16px rgba(0, 0, 0, 0.4)":"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)"}}}},vo=e=>{const o=e.themeMode==="dark";return{container:{backgroundColor:o?"color-gray-900":"color-white",color:o?"color-white":"color-black",borderRadius:"8px",overflow:"hidden",transition:"all 0.2s ease"},header:{padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:o?"color-gray-800":"color-gray-100",color:"theme-primary"},content:{padding:"16px",color:o?"color-gray-300":"color-gray-600"},footer:{padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:o?"color-gray-800":"color-gray-100"}}},Or=u.createContext({}),_t=()=>u.useContext(Or),ut=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).header,s={...d,...l==null?void 0:l.header,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.header)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:8,...s,children:e})},gt=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).content,s={...d,...l==null?void 0:l.content,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.content)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:12,...s,children:e})},pt=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).footer,s={...d,...l==null?void 0:l.footer,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.footer)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:8,...s,children:e})},wc=({variant:e="default",size:o="md",shape:t="rounded",children:n,header:i,footer:a,isFullWidth:l=!1,views:d,style:s,themeMode:g,...p})=>{var j,C;const m=c.useTheme(),h=vo(m),f=((j=jc[o])==null?void 0:j.padding)||"16px",x=u.useMemo(()=>({styles:{container:{...h.container,borderRadius:Cc[t],...d==null?void 0:d.container},header:{...h.header,padding:f,...d==null?void 0:d.header},content:{...h.content,padding:f,...d==null?void 0:d.content},footer:{...h.footer,padding:f,...d==null?void 0:d.footer}}}),[h,d,f,t]),y=u.Children.toArray(n).some(I=>u.isValidElement(I)&&(I.type===ut||I.type===gt||I.type===pt)),{themeMode:b}=m,S=Sc(g||b)[e],w={width:l?"100%":"auto",overflow:"hidden",...S,...x.styles.container,...p,style:{...(C=x.styles.container)==null?void 0:C.style,...s}};return r.jsx(Or.Provider,{value:x,children:r.jsx(c.View,{...w,children:y?n:r.jsxs(c.Vertical,{width:"100%",children:[i&&r.jsx(ut,{children:i}),r.jsx(gt,{children:n}),a&&r.jsx(pt,{children:a})]})})})},Ic=e=>r.jsx(wc,{...e}),Xo=Ic;Xo.Header=ut;Xo.Content=gt;Xo.Footer=pt;const Tc=({defaultActiveIndex:e=0,activeIndex:o,onChange:t,autoPlay:n=!1,autoPlayInterval:i=3e3,pauseOnHover:a=!0,infinite:l=!0,totalSlides:d,stepIndices:s})=>{const g=u.useRef(d||0),[p,m]=u.useState(d||0),h=u.useRef(new Set),f=u.useRef(0),x=u.useMemo(()=>jt("carousel-content"),[]),[y,b]=u.useState(o!==void 0?o:e),[k,S]=u.useState(!1),[w,j]=u.useState(!1),[C,I]=u.useState(0),[M,R]=u.useState(0),V=u.useRef(null);u.useEffect(()=>{o!==void 0&&b(o)},[o]);const _=u.useCallback(D=>{let q=D;l?D<0?q=p-1:D>=p&&(q=0):q=Math.max(0,Math.min(D,p-1)),s&&s.length>0&&(s.includes(q)||(q=s.reduce((Y,O)=>Math.abs(O-q)<Math.abs(Y-q)?O:Y))),o===void 0&&b(q),t&&t(q)},[o,l,t,p]),T=u.useCallback(()=>{_(y+1)},[y,_]),W=u.useCallback(()=>{_(y-1)},[y,_]);u.useEffect(()=>(n&&!k&&!w&&(V.current=setInterval(()=>{T()},i)),()=>{V.current&&clearInterval(V.current)}),[n,i,k,w,T,a]);const B=u.useCallback(()=>{a&&S(!0)},[a]),P=u.useCallback(()=>{S(!1)},[]),z=u.useCallback(D=>{j(!0),"touches"in D?(I(D.touches[0].clientX),R(D.touches[0].clientY)):(I(D.clientX),R(D.clientY))},[]),$=u.useCallback(D=>{if(!w)return;let q,K;"touches"in D?(q=D.touches[0].clientX,K=D.touches[0].clientY):(q=D.clientX,K=D.clientY);const Y=q-C,O=K-M;Math.abs(Y)>Math.abs(O)&&Math.abs(Y)>50&&(Y>0?W():T(),j(!1))},[w,C,M,T,W]),E=u.useCallback(()=>{j(!1)},[]),H=u.useCallback(()=>{const D=f.current++;h.current.add(D);const q=h.current.size;return g.current=q,m(q),D},[]),L=u.useCallback(D=>{h.current.delete(D);const q=h.current.size;if(g.current=q,m(q),q>0&&y>=q){const K=Math.max(0,q-1);o===void 0&&b(K),t&&t(K)}},[y,o,t]),A=l||y>0,F=l||y<p-1;return{activeIndex:y,totalSlides:p,goToSlide:_,nextSlide:T,prevSlide:W,canGoNext:F,canGoPrevious:A,handleMouseEnter:B,handleMouseLeave:P,handleDragStart:z,handleDragMove:$,handleDragEnd:E,registerSlide:H,unregisterSlide:L,contentId:x,infinite:l}},Mc={dot:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},line:{width:"20px",height:"4px",borderRadius:"2px",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},number:{minWidth:"24px",height:"24px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",transition:"background-color 0.3s ease"}},zc={dot:{backgroundColor:"theme-primary"},line:{backgroundColor:"theme-primary"},number:{backgroundColor:"theme-primary",color:"color-white"}},Wo={width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"color-white",color:"color-gray-800",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",boxShadow:"0 2px 5px rgba(0, 0, 0, 0.1)",zIndex:1,transition:"background-color 0.3s ease",_hover:{backgroundColor:"color-gray-100"}},mo=()=>({container:{position:"relative",overflow:"hidden"},content:{overflow:"hidden",width:"100%",height:"100%"},innerContainer:{display:"flex",transitionProperty:"transform",transitionDuration:"300ms",transitionTimingFunction:"ease-in-out",height:"100%"},item:{flex:"0 0 100%",minWidth:0,position:"relative",height:"100%"},prevButton:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)",zIndex:10,...Wo},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...Wo}}),qr=u.createContext(null),Ko=()=>{const e=u.useContext(qr);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},Nr=({children:e,isActive:o,views:t,...n})=>r.jsx(c.View,{flexShrink:0,width:"100%",height:"100%",display:o?"block":"none",...t,...n,children:e}),Ur=({views:e,children:o,...t})=>{const{goToPrevious:n,canGoPrevious:i,styles:a}=Ko(),d={...mo().prevButton,...a==null?void 0:a.prevButton,...e==null?void 0:e.prevButton};return r.jsx(_e,{"aria-label":"Previous slide",onClick:()=>n(),isDisabled:!i,...d,...t,children:o??r.jsx(ae,{orientation:"left",widthHeight:16})})},Gr=({views:e,children:o,...t})=>{const{goToNext:n,canGoNext:i,styles:a}=Ko(),d={...mo().nextButton,...a==null?void 0:a.nextButton,...e==null?void 0:e.nextButton};return r.jsx(_e,{"aria-label":"Next slide",onClick:()=>n(),isDisabled:!i,...d,...t,children:o??r.jsx(ae,{orientation:"right",widthHeight:16})})},Yr=({children:e,views:o,...t})=>{const{registerSlide:n,unregisterSlide:i,styles:a}=Ko(),l=u.useRef(null);u.useEffect(()=>{const g=n();return l.current=g,()=>{l.current!==null&&i(l.current)}},[n,i]);const s={...mo().item,...a==null?void 0:a.item,...o==null?void 0:o.item};return r.jsx(c.View,{role:"group","aria-roledescription":"slide",...s,...t,children:e})},vr=({children:e,views:o,style:t,...n})=>{const{currentIndex:i,styles:a,contentId:l}=Ko(),d=mo(),s={...d.content,...a==null?void 0:a.content,...o==null?void 0:o.content},g={...d.innerContainer,...a==null?void 0:a.innerContainer,...o==null?void 0:o.innerContainer},p=`-${i*100}%`;return r.jsx(c.View,{...s,...n,style:{...s==null?void 0:s.style,...t},id:l,"aria-live":"polite",children:r.jsx(c.View,{...g,style:{...g==null?void 0:g.style,transform:`translateX(${p})`},children:e})})},Rc=({children:e,defaultActiveIndex:o=0,activeIndex:t,onChange:n,showNavigation:i=!0,navigationPosition:a="inside",prevButton:l,nextButton:d,showIndicators:s=!0,indicatorPosition:g="bottom",indicatorVariant:p="dot",autoPlay:m=!1,autoPlayInterval:h=3e3,pauseOnHover:f=!0,infinite:x=!0,direction:y="horizontal",transitionDuration:b=300,views:k,stepIndices:S,themeMode:w,...j})=>{const C=u.useMemo(()=>u.Children.toArray(e),[e]),I=Tc({defaultActiveIndex:o,activeIndex:t,onChange:n,autoPlay:m,autoPlayInterval:h,pauseOnHover:f,infinite:x,totalSlides:C.length}),{activeIndex:M,totalSlides:R,goToSlide:V,nextSlide:_,prevSlide:T,handleMouseEnter:W,handleMouseLeave:B,handleDragStart:P,handleDragMove:z,handleDragEnd:$}=I,E=()=>{if(!i)return null;const A=l||r.jsx(c.View,{as:"button","aria-label":"Previous slide",...Wo,...k==null?void 0:k.prevButton,children:"❮"}),F=d||r.jsx(c.View,{as:"button","aria-label":"Next slide",...Wo,...k==null?void 0:k.nextButton,children:"❯"});return r.jsxs(r.Fragment,{children:[r.jsx(c.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",left:a==="inside"?"10px":"-40px",onClick:T,cursor:!x&&M===0?"not-allowed":"pointer",opacity:!x&&M===0?.5:1,children:A}),r.jsx(c.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",right:a==="inside"?"10px":"-40px",onClick:_,cursor:!x&&M===C.length-1?"not-allowed":"pointer",opacity:!x&&M===C.length-1?.5:1,children:F})]})},H=()=>s?r.jsx(c.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...g==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:C.map((A,F)=>r.jsx(c.View,{onClick:()=>V(F),cursor:"pointer",...Mc[p],...F===M?{...zc[p]}:{},...k==null?void 0:k.indicator,...F===M?k==null?void 0:k.activeIndicator:{},children:p==="number"&&F+1},F))}):null;return u.useMemo(()=>u.Children.toArray(e).some(A=>u.isValidElement(A)&&(A.type===vr||A.type===Yr||A.type===Ur||A.type===Gr)),[e])?r.jsx(qr.Provider,{value:{currentIndex:M,totalSlides:R,goToSlide:V,goToNext:_,goToPrevious:T,canGoNext:I.canGoNext,canGoPrevious:I.canGoPrevious,registerSlide:I.registerSlide,unregisterSlide:I.unregisterSlide,styles:{...mo(),...k},contentId:I.contentId,infinite:x},children:r.jsx(c.View,{role:"region","aria-roledescription":"carousel","aria-label":"Carousel",position:"relative",width:"100%",height:"100%",overflow:"hidden",...k==null?void 0:k.container,...j,children:e})}):r.jsxs(c.View,{position:"relative",width:"100%",height:"100%",overflow:"hidden",onMouseEnter:W,onMouseLeave:B,onTouchStart:P,onTouchMove:z,onTouchEnd:$,onMouseDown:P,onMouseMove:z,onMouseUp:$,...k==null?void 0:k.container,...j,children:[r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...k==null?void 0:k.slideWrapper,children:C.map((A,F)=>r.jsx(Nr,{isActive:F===M,index:F,views:k==null?void 0:k.slide,children:A},F))}),E(),H()]})},Vc=e=>r.jsx(Rc,{...e}),Xe=Vc;Xe.Slide=Nr;Xe.Content=vr;Xe.Item=Yr;Xe.Previous=Ur;Xe.Next=Gr;const ke={blue:"color-blue-500",green:"color-green-500",purple:"color-purple-500",orange:"color-orange-500",red:"color-red-500",teal:"color-teal-500",pink:"color-pink-500",indigo:"color-indigo-500",yellow:"color-yellow-500",cyan:"color-cyan-500"},Ec=[ke.blue,ke.green,ke.purple,ke.orange,ke.red,ke.teal,ke.pink,ke.indigo,ke.yellow,ke.cyan],Ge=Ec,Pc={width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},Wc={fontSize:"18px",fontWeight:"bold",marginBottom:"16px",textAlign:"center"},_c={display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"16px"},$c={display:"flex",alignItems:"center",marginRight:"16px",marginBottom:"8px"},Hc={width:"12px",height:"12px",borderRadius:"2px",marginRight:"6px"},Bc={fontSize:"14px"},Xr={stroke:"color-gray-200",strokeWidth:"1px"},_o={stroke:"color-gray-300",strokeWidth:"1px"},$o={fontSize:"12px",fill:"color-gray-600"},Lc={rx:"2px",ry:"2px",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},Ac={strokeWidth:"2px",fill:"none"},Dc={r:"4px",strokeWidth:"2px",stroke:"white",cursor:"pointer",transition:"r 0.2s ease"},Co={strokeWidth:"1px",stroke:"white",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},$t={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)",borderRadius:"4px",zIndex:10,padding:"16px",textAlign:"center"},Fc={...$t},Oc={...$t,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},qc={...$t,backgroundColor:"rgba(245, 245, 245, 0.8)",color:"color-gray-600"},Nc=({data:e,dataPoints:o,animated:t=!0,animationDuration:n=500,showTooltips:i=!0})=>{const[a,l]=u.useState(t?0:1),[d,s]=u.useState({visible:!1,x:0,y:0,content:null}),g=u.useRef(null),p=u.useRef(null);u.useEffect(()=>{if(!t){l(1);return}const y=Date.now(),b=()=>{const k=Date.now()-y,S=Math.min(k/n,1);l(S),S<1&&(g.current=requestAnimationFrame(b))};return g.current=requestAnimationFrame(b),()=>{g.current&&cancelAnimationFrame(g.current)}},[t,n]);const m=u.useCallback(()=>e?{...e,series:e.series.map((y,b)=>({...y,color:y.color||Ge[b%Ge.length]}))}:o?o.map((y,b)=>({...y,color:y.color||Ge[b%Ge.length]})):null,[e,o]),h=u.useCallback((y,b,k)=>{i&&s({visible:!0,x:y,y:b,content:k})},[i]),f=u.useCallback(()=>{s(y=>({...y,visible:!1}))},[]),x=u.useCallback(()=>{if(!p.current)return{width:0,height:0};const{width:y,height:b}=p.current.getBoundingClientRect();return{width:y,height:b}},[]);return{animationProgress:a,tooltip:d,containerRef:p,processedData:m,showTooltip:h,hideTooltip:f,getChartDimensions:x}},Uc=({data:e,width:o,height:t,animationProgress:n,showGrid:i=!0,onBarClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),p={top:20,right:20,bottom:40,left:50},m=o-p.left-p.right,h=t-p.top-p.bottom,f=u.useMemo(()=>{let C=0;return e.series.forEach(I=>{I.data.forEach(M=>{C=Math.max(C,M)})}),C},[e]),x=e.labels.length,y=e.series.length,b=m/x,k=b*.8/y,S=b*.2/(y+1),w=f||10,j=u.useMemo(()=>{const I=[];for(let M=0;M<=5;M++){const R=w/5*M;I.push(R)}return I},[f]);return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:p.left,y1:t-p.bottom,x2:o-p.right,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),r.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),e.labels.map((C,I)=>{const M=p.left+(I+.5)*b,R=t-p.bottom+20;return r.jsx("text",{x:M,y:R,textAnchor:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:C},`x-label-${I}`)}),j.map((C,I)=>{const M=t-p.bottom-C/w*h;return r.jsxs(u.Fragment,{children:[r.jsx("text",{x:p.left-10,y:M,textAnchor:"end",dominantBaseline:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:C.toFixed(0)}),i&&r.jsx("line",{x1:p.left,y1:M,x2:o-p.right,y2:M,...Xr,...s==null?void 0:s.grid})]},`y-tick-${I}`)}),e.series.map((C,I)=>r.jsx(u.Fragment,{children:C.data.map((M,R)=>{const V=M/w*h*n,_=p.left+R*b+S*(I+1)+k*I,T=t-p.bottom-V,W=e.labels[R],B=e.series.reduce((H,L)=>{const A=L.data[R];return H+(typeof A=="number"?A:0)},0),P=B>0?(M/B*100).toFixed(1):null,z=C.color?g(C.color):"black",$=H=>{const L=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"180px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:C.name}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:z})]}),r.jsx(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:W}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:M.toLocaleString()})]}),P!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:`${P}%`})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(c.Text,{fontWeight:"medium",children:B.toLocaleString()})]})]})]});l(H.clientX,H.clientY,L)},E=()=>{a&&a(C.name,R)};return r.jsx("rect",{x:_,y:T,width:k,height:V,fill:z,onMouseEnter:$,onMouseLeave:d,onClick:E,...Lc,...s==null?void 0:s.bar},`bar-${I}-${R}`)})},`series-${I}`))]})},Gc=({data:e,width:o,height:t,animationProgress:n,showGrid:i=!0,onPointClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),p={top:20,right:20,bottom:40,left:50},m=o-p.left-p.right,h=t-p.top-p.bottom,f=u.useMemo(()=>{let S=0;return e.series.forEach(w=>{w.data.forEach(j=>{S=Math.max(S,j)})}),S},[e]),x=f||10,y=u.useMemo(()=>{const w=[];for(let j=0;j<=5;j++){const C=x/5*j;w.push(C)}return w},[f]),b=S=>`M ${S.map((j,C)=>{const I=p.left+C/(e.labels.length-1)*m,M=t-p.bottom-j/x*h*n;return`${I},${M}`}).join(" L ")}`,k=S=>{const w=p.left,j=p.left+m,C=t-p.bottom,I=S.map((M,R)=>{const V=p.left+R/(e.labels.length-1)*m,_=t-p.bottom-M/x*h*n;return`${V},${_}`});return`M ${w},${C} L ${I.join(" L ")} L ${j},${C} Z`};return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:p.left,y1:t-p.bottom,x2:o-p.right,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),r.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),e.labels.map((S,w)=>{const j=p.left+w/(e.labels.length-1)*m,C=t-p.bottom+20;return r.jsx("text",{x:j,y:C,textAnchor:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:S},`x-label-${w}`)}),y.map((S,w)=>{const j=t-p.bottom-S/x*h;return r.jsxs(u.Fragment,{children:[r.jsx("text",{x:p.left-10,y:j,textAnchor:"end",dominantBaseline:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:S.toFixed(0)}),i&&r.jsx("line",{x1:p.left,y1:j,x2:o-p.right,y2:j,...Xr,...s==null?void 0:s.grid})]},`y-tick-${w}`)}),e.series.map((S,w)=>{const j=S.color?g(S.color):"black";return r.jsxs(u.Fragment,{children:[r.jsx("path",{d:k(S.data),fill:j,opacity:.1,...s==null?void 0:s.area}),r.jsx("path",{d:b(S.data),stroke:j,...Ac,...s==null?void 0:s.line}),S.data.map((C,I)=>{const M=p.left+I/(e.labels.length-1)*m,R=t-p.bottom-C/x*h*n,V=e.labels[I],_=e.series.reduce((E,H)=>{const L=H.data[I];return E+(typeof L=="number"?L:0)},0),T=_>0?(C/_*100).toFixed(1):null,W=I>0&&typeof S.data[I-1]=="number"?S.data[I-1]:null,B=typeof W=="number"?C-W:null,P=typeof B=="number"?`${B>=0?"+":""}${B.toLocaleString()}`:null,z=E=>{const H=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:S.name}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:j})]}),r.jsx(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:V}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:C.toLocaleString()})]}),P!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Change"}),r.jsx(c.Text,{fontWeight:"medium",children:P})]}),T!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:`${T}%`})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(c.Text,{fontWeight:"medium",children:_.toLocaleString()})]})]})]});l(E.clientX,E.clientY,H)},$=()=>{a&&a(S.name,I)};return r.jsx("circle",{cx:M,cy:R,fill:j,onMouseEnter:z,onMouseLeave:d,onClick:$,...Dc,...s==null?void 0:s.point},`point-${w}-${I}`)})]},`series-${w}`)})]})},Yc=({dataPoints:e,width:o,height:t,animationProgress:n,isDonut:i=!1,onSliceClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),{ref:p,relation:m}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),h=u.useRef(null);u.useEffect(()=>{h.current&&p&&(p.current=h.current)},[h,p]);const x=Math.min(o,t)/2*.8,y=o/2,b=t/2,k=i?x*.6:0,S=u.useMemo(()=>e.reduce((j,C)=>j+C.value,0),[e]),w=u.useMemo(()=>{if(S===0)return[{path:i?[`M ${y} ${b-x}`,`A ${x} ${x} 0 1 1 ${y} ${b+x}`,`A ${x} ${x} 0 1 1 ${y} ${b-x}`,`M ${y} ${b-k}`,`A ${k} ${k} 0 1 0 ${y} ${b+k}`,`A ${k} ${k} 0 1 0 ${y} ${b-k}`,"Z"].join(" "):[`M ${y} ${b}`,`M ${y} ${b-x}`,`A ${x} ${x} 0 1 1 ${y} ${b+x}`,`A ${x} ${x} 0 1 1 ${y} ${b-x}`,"Z"].join(" "),color:"#E2E8F0",label:"Total",value:0,percentage:"0%",labelX:y,labelY:b,startAngle:0,endAngle:Math.PI*2,index:-1}];const j=[];let C=-Math.PI/2;for(let I=0;I<e.length;I++){const R=e[I].value/S,V=R*2*Math.PI*n,_=C+V,T=y+Math.cos(C)*x,W=b+Math.sin(C)*x,B=y+Math.cos(_)*x,P=b+Math.sin(_)*x,z=y+Math.cos(C)*k,$=b+Math.sin(C)*k,E=y+Math.cos(_)*k,H=b+Math.sin(_)*k,L=V>Math.PI?1:0;let A;i?A=[`M ${T} ${W}`,`A ${x} ${x} 0 ${L} 1 ${B} ${P}`,`L ${E} ${H}`,`A ${k} ${k} 0 ${L} 0 ${z} ${$}`,"Z"].join(" "):A=[`M ${y} ${b}`,`L ${T} ${W}`,`A ${x} ${x} 0 ${L} 1 ${B} ${P}`,"Z"].join(" ");const F=C+V/2,D=x*.7,q=y+Math.cos(F)*D,K=b+Math.sin(F)*D,Y=`${(R*100).toFixed(1)}%`,O=e[I].color||Ge[I%Ge.length],X=g(O);j.push({path:A,color:X,label:e[I].label,value:e[I].value,percentage:Y,labelX:q,labelY:K,startAngle:C,endAngle:_,index:I}),C=_}return j},[e,S,x,y,b,k,n,i]);return r.jsxs("svg",{ref:h,width:o,height:t,style:{overflow:"visible"},children:[i&&r.jsx("circle",{cx:y,cy:b,r:k,fill:"white",pointerEvents:"none"}),w.map((j,C)=>{const I=V=>{const _=S>0?j.value/S*100:0,T=S>0?Math.max(0,100-_):null,W=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:j.label}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:j.color})]}),r.jsxs(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:["Slice ",j.index+1," of ",e.length]}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:j.value.toLocaleString()})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:j.percentage})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Total"}),r.jsx(c.Text,{fontWeight:"medium",children:S.toLocaleString()})]}),T!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Remaining"}),r.jsx(c.Text,{fontWeight:"medium",children:`${T.toFixed(1)}%`})]})]})]});let B=V.clientX,P=V.clientY;if(m&&h.current){const z=h.current.getBoundingClientRect();V.clientX-z.left,V.clientY-z.top,m.space.horizontal==="left"?B=V.clientX-100:B=V.clientX+10,m.space.vertical==="top"?P=V.clientY-30:P=V.clientY+10}l(B,P,W)},M=()=>{j.index!==-1&&a&&a(e[j.index],j.index)},R=j.index===-1;return r.jsxs("g",{children:[r.jsx("path",{d:j.path,fill:j.color,onMouseEnter:R?void 0:I,onMouseLeave:R?void 0:d,onClick:M,...Co,style:{...Co==null?void 0:Co.style,cursor:R?"default":"pointer"},...s==null?void 0:s.pie}),!R&&j.endAngle-j.startAngle>.2&&r.jsx("text",{x:j.labelX,y:j.labelY,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontWeight:"bold",pointerEvents:"none",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3)",filter:"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))"},children:j.percentage})]},`slice-${C}`)})]})},vc=({visible:e,x:o,y:t,content:n,maxDistance:i=100,views:a})=>{const l=u.useRef(null),[d,s]=u.useState({left:0,top:0});return u.useEffect(()=>{if(!e||!l.current)return;const p=l.current.getBoundingClientRect(),m=p.width,h=p.height,f=10,x=15;let y=o-x,b=t-x;const k=o-y,S=t-b;k>i&&(y=o-i),S>i&&(b=t-i),y+m>window.innerWidth-f&&(y=window.innerWidth-m-f,o-y>i&&(y=o-i)),y<f&&(y=f),b+h>window.innerHeight-f&&(b=window.innerHeight-h-f,t-b>i&&(b=t-i)),b<f&&(b=f),s({left:y,top:b})},[e,o,t,i]),e?r.jsx(c.View,{ref:l,position:"fixed",left:`${d.left}px`,top:`${d.top}px`,backgroundColor:"color-white",padding:"12px 16px",borderRadius:"8px",boxShadow:"0px 12px 24px rgba(15, 23, 42, 0.18)",border:"1px solid color-gray-200",fontSize:"14px",display:"flex",flexDirection:"column",pointerEvents:"none",zIndex:10,...a==null?void 0:a.tooltip,children:n}):null},Xc=({type:e,data:o,dataPoints:t,title:n,showLegend:i=!0,legendPosition:a="bottom",showGrid:l=!0,showTooltips:d=!0,animated:s=!0,animationDuration:g=500,responsive:p=!0,aspectRatio:m=16/9,width:h=200,height:f=200,views:x,onDataPointClick:y,onSeriesClick:b,isLoading:k=!1,error:S,noData:w,loadingIndicator:j,errorIndicator:C,noDataIndicator:I,"aria-label":M,themeMode:R,...V})=>{const{animationProgress:_,tooltip:T,containerRef:W,processedData:B,showTooltip:P,hideTooltip:z,getChartDimensions:$}=Nc({data:o,dataPoints:t,animated:s,animationDuration:g,showTooltips:d}),E=B(),{width:H,height:L}=$(),A=h||H,F=f||(p?H/m:L),D=()=>{if(!i||!E)return null;let J=[];return e==="pie"||e==="donut"?Array.isArray(E)&&(J=E):E&&E.series&&(J=E.series),!J||J.length===0?null:r.jsx(c.Horizontal,{flexWrap:"wrap",justifyContent:"center",marginTop:a==="bottom"?"16px":0,marginBottom:a==="top"?"16px":0,..._c,...x==null?void 0:x.legend,children:J.map((oe,re)=>r.jsxs(c.View,{...$c,...x==null?void 0:x.legendItem,children:[r.jsx(c.View,{backgroundColor:oe.color,...Hc}),r.jsx(c.Text,{...Bc,children:oe.name||oe.label})]},`legend-${re}`))})},q=()=>{if(!E)return null;switch(e){case"bar":return r.jsx(Uc,{data:E,width:A,height:F,animationProgress:_,showGrid:l,onBarClick:b,showTooltip:P,hideTooltip:z,views:x});case"line":case"area":return r.jsx(Gc,{data:E,width:A,height:F,animationProgress:_,showGrid:l,onPointClick:b,showTooltip:P,hideTooltip:z,views:x});case"pie":case"donut":return r.jsx(Yc,{dataPoints:E,width:A,height:F,animationProgress:_,isDonut:e==="donut",onSliceClick:y,showTooltip:P,hideTooltip:z,views:x});default:return null}},K=()=>k?r.jsx(c.View,{...Fc,...x==null?void 0:x.loadingOverlay,children:j||r.jsx(c.Center,{children:r.jsx(uo,{size:"lg"})})}):null,Y=()=>S?r.jsx(c.View,{...Oc,...x==null?void 0:x.errorOverlay,children:C||r.jsx(c.Text,{fontWeight:"medium",children:typeof S=="string"?S:"An error occurred"})}):null,O=()=>w?r.jsx(c.View,{...qc,...x==null?void 0:x.noDataOverlay,children:I||r.jsx(c.Text,{children:typeof w=="string"?w:"No data available"})}):null,X=M??(typeof n=="string"?n:"Chart"),Z=!S&&!k&&!w;return r.jsxs(c.View,{ref:W,role:"region","aria-label":X,"aria-busy":k,...Pc,...x==null?void 0:x.container,...V,children:[n&&r.jsx(c.Text,{...Wc,children:n}),Z&&a==="top"&&D(),r.jsxs(c.View,{flex:1,width:"100%",position:"relative",...x==null?void 0:x.chart,children:[Z&&q(),K(),Y(),O()]}),Z&&a==="bottom"&&D(),r.jsx(vc,{visible:d&&T.visible,x:T.x,y:T.y,content:T.content,maxDistance:100,views:x})]})},Kc=e=>r.jsx(Xc,{...e}),Qc=Kc,Zc=(e=365)=>{const[o,t]=u.useState(!1),[n,i]=u.useState(null),a="app-studio-cookie-consent";u.useEffect(()=>{const g=localStorage.getItem(a);i(g!==null?g==="true":!1)},[]);const l=g=>{localStorage.setItem(a,String(g));const p=new Date;p.setDate(p.getDate()+e),localStorage.setItem(`${a}-expires`,p.toISOString()),i(g)};return{isHovered:o,setIsHovered:t,hasConsent:n,acceptCookies:()=>{l(!0)},resetConsent:()=>{localStorage.removeItem(a),localStorage.removeItem(`${a}-expires`),i(!1)}}},Jc=e=>{const o=e==="dark";return{default:{container:{backgroundColor:o?"#1f2937":"#ffffff",borderColor:o?"#374151":"#e5e7eb",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#e5e7eb":"#1f2937"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:o?"#e5e7eb":"#4b5563",borderColor:o?"#4b5563":"#d1d5db",hoverBackgroundColor:o?"#374151":"#f3f4f6"}},info:{container:{backgroundColor:o?"#1e3a8a":"#eff6ff",borderColor:o?"#1e40af":"#bfdbfe",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#bfdbfe":"#1e40af"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:o?"#bfdbfe":"#1e40af",borderColor:o?"#3b82f6":"#93c5fd",hoverBackgroundColor:o?"#1e40af":"#dbeafe"}},primary:{container:{backgroundColor:o?"#0c4a6e":"#f0f9ff",borderColor:o?"#0369a1":"#bae6fd",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#bae6fd":"#0369a1"},acceptButton:{backgroundColor:"#0ea5e9",color:"#ffffff",hoverBackgroundColor:"#0284c7"},customizeButton:{backgroundColor:"transparent",color:o?"#bae6fd":"#0369a1",borderColor:o?"#0ea5e9":"#7dd3fc",hoverBackgroundColor:o?"#0369a1":"#e0f2fe"}}}},es=({title:e="Nous utilisons des cookies",description:o="Ce site utilise des cookies pour améliorer votre expérience. En continuant à naviguer sur ce site, vous acceptez notre utilisation des cookies conformément à notre politique de confidentialité.",acceptButtonText:t="Accepter",customizeButtonText:n="Personnaliser",position:i="bottom",variant:a="default",onAccept:l,onCustomize:d,views:s,showCustomizeButton:g=!0,cookieExpiration:p=365,themeMode:m,...h})=>{const{themeMode:f}=c.useTheme(),x=m||f||"light",{hasConsent:y,acceptCookies:b}=Zc(p),S=Jc(x)[a];if(y)return null;const w=()=>{b(),l&&l()},j=()=>{d&&d()};return r.jsx(c.View,{style:{position:"fixed",left:16,right:16,zIndex:1e3,...i==="bottom"?{bottom:16}:{top:16}},padding:16,borderWidth:"1px",borderStyle:"solid",borderRadius:8,maxWidth:"800px",marginLeft:"auto",marginRight:"auto",transition:"opacity 0.3s ease, transform 0.3s ease",...S.container,...s==null?void 0:s.container,...h,children:r.jsxs(c.Vertical,{gap:12,maxWidth:1200,marginLeft:"auto",marginRight:"auto",children:[e&&r.jsx(c.Text,{fontWeight:"bold",fontSize:18,color:"color-black",...s==null?void 0:s.title,children:e}),o&&r.jsx(c.Text,{fontSize:14,color:"color-black",...s==null?void 0:s.description,children:o}),r.jsxs(c.Horizontal,{gap:12,justifyContent:"flex-end",marginTop:8,...s==null?void 0:s.buttonGroup,children:[g&&r.jsx(_e,{variant:"outline",onClick:j,size:"sm",...s==null?void 0:s.customizeButton,children:n}),r.jsx(_e,{variant:"primary",onClick:w,size:"sm",...s==null?void 0:s.acceptButton,children:t})]})]})})},os=e=>r.jsx(es,{...e}),ts=os,rs=e=>{const{size:o,variant:t,onOpenChange:n}=e||{},[i,a]=u.useState(!1),[l,d]=u.useState({x:0,y:0}),[s,g]=u.useState(null),p=u.useRef(null),m=u.useRef(null),h=u.useMemo(()=>jt("contextmenu-content"),[]),f=u.useCallback(y=>{d({x:y.clientX,y:y.clientY}),a(!0),n==null||n(!0)},[n]),x=u.useCallback(()=>{a(!1),g(null),n==null||n(!1)},[n]);return u.useEffect(()=>{const y=S=>{m.current&&!m.current.contains(S.target)&&x()},b=()=>{i&&x()},k=S=>{S.key==="Escape"&&i&&x()};return document.addEventListener("mousedown",y),window.addEventListener("resize",b),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",y),window.removeEventListener("resize",b),document.removeEventListener("keydown",k)}},[i,x]),{isOpen:i,setIsOpen:a,position:l,setPosition:d,activeSubmenuId:s,setActiveSubmenuId:g,size:o,variant:t,triggerRef:p,contentRef:m,contentId:h,openMenu:f,closeMenu:x}},Kt={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},ns={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Qt={hover:{backgroundColor:"color-gray-100"}},Kr=u.createContext({isOpen:!1,setIsOpen:()=>{},position:{x:0,y:0},setPosition:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null},contentRef:{current:null},contentId:"contextmenu-content",closeMenu:()=>{},openMenu:()=>{}}),as=({children:e,value:o})=>r.jsx(Kr.Provider,{value:o,children:e}),Ho=()=>{const e=u.useContext(Kr);if(!e)throw new Error("useContextMenuContext must be used within a ContextMenuProvider");return e},Qr=({children:e,disableNativeContextMenu:o=!0,asChild:t=!1,isDisabled:n=!1,views:i,...a})=>{const{triggerRef:l,contentId:d,openMenu:s}=Ho(),p={ref:l,onContextMenu:m=>{if(!n)if(o&&m.preventDefault(),s)s(m);else{const{setIsOpen:h,setPosition:f}=Ho();f({x:m.clientX,y:m.clientY}),h(!0)}},"aria-controls":d,"aria-haspopup":"menu","data-disabled":n?"":void 0,...t&&u.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:n},...i==null?void 0:i.container,...a};if(t&&u.isValidElement(e)){const m=u.Children.only(e);return u.cloneElement(m,{...p,...m.props})}return r.jsx(c.View,{...p,children:e})},Ht=({items:e,children:o,position:t,side:n="right",align:i="start",views:a,style:l,...d})=>{const{isOpen:s,position:g,contentRef:p,contentId:m,variant:h}=Ho(),f=u.useRef(null),x=p||f,{ref:y,relation:b}=c.useElementPosition({}),[k,S]=u.useState({x:0,y:0});if(u.useEffect(()=>{if(s&&x.current){const j=t||g,C=x.current.offsetWidth,I=x.current.offsetHeight,M=window.innerWidth,R=window.innerHeight;let V=j.x,_=j.y;b&&(b.space.horizontal==="left"?V=j.x-C:V=j.x,b.space.vertical==="top"?_=j.y-I:_=j.y),V+C>M&&(V=M-C-8),V<8&&(V=8),_+I>R&&(_=R-I-8),_<8&&(_=8),S({x:V,y:_})}},[s,g,t,n,i,x,b]),!s)return null;const w={position:"fixed",top:`${k.y}px`,left:`${k.x}px`,zIndex:1e3,transformOrigin:"top left"};return r.jsxs(c.View,{id:m||"context-menu",ref:x,role:"menu",tabIndex:-1,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:{...w,...l},...ns[h],...a==null?void 0:a.menu,...a==null?void 0:a.content,...d,children:[e&&e.map((j,C)=>j.divider?r.jsx(Jr,{views:a},`divider-${C}`):r.jsx(Zr,{item:j,views:a},j.id)),o]})},Zr=({item:e,children:o,onSelect:t,isDisabled:n=!1,views:i,...a})=>{const{activeSubmenuId:l,setActiveSubmenuId:d,size:s,closeMenu:g}=Ho();if(e){const[m,h]=u.useState(!1),f=e.items&&e.items.length>0,x=l===e.id,[y,b]=u.useState({x:0,y:0}),k=e.disabled||n,S=()=>{h(!0),f&&d(e.id)},w=()=>{h(!1)},j=()=>{k||!f&&e.onClick&&(e.onClick(),g&&g())},{ref:C,relation:I}=c.useElementPosition({});return u.useEffect(()=>{if(x&&C.current){const M=C.current.getBoundingClientRect(),R=window.innerWidth,V=200;let _=!1;if(I)_=I.space.horizontal==="left";else{const T=R-M.right,W=M.left;_=T<V&&W>T}b({x:_?M.left-V:M.right,y:M.top})}},[x,e.items,I]),r.jsxs(c.View,{ref:C,role:"menuitem",display:"flex",alignItems:"center",cursor:k?"not-allowed":"pointer",opacity:k?.5:1,position:"relative","aria-disabled":k,"data-disabled":k?"":void 0,...Kt[s],_hover:k?{}:Qt.hover,backgroundColor:m&&!k?"color-gray-100":"transparent",onMouseEnter:S,onMouseLeave:w,onClick:j,...i==null?void 0:i.item,...a,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),r.jsx(c.View,{flexGrow:1,children:e.label}),f&&r.jsx(c.View,{marginLeft:8,...i==null?void 0:i.submenuIndicator,children:r.jsx(ae,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),x&&f&&r.jsx(Ht,{items:e.items||[],position:y,side:"right",align:"start",views:i})]})}const p=m=>{n||(t==null||t(m),g&&g())};return r.jsx(c.View,{role:"menuitem",onClick:p,cursor:n?"not-allowed":"pointer",opacity:n?.5:1,"aria-disabled":n,"data-disabled":n?"":void 0,...Kt[s],_hover:n?{}:Qt.hover,...i==null?void 0:i.item,...a,children:o})},Jr=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.divider,...o}),is=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.separator,...o}),ls=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:i=!0,views:a,themeMode:l,...d})=>!o||o.length===0?r.jsx(r.Fragment,{children:e}):r.jsxs(r.Fragment,{children:[r.jsx(Qr,{disableNativeContextMenu:i,views:a,...d,children:e}),r.jsx(Ht,{items:o,views:a})]}),cs=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:i=!0,onOpenChange:a,views:l,...d})=>{const s=rs({size:t,variant:n,onOpenChange:a}),{isOpen:g,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:f,setActiveSubmenuId:x,triggerRef:y,contentRef:b,contentId:k,openMenu:S,closeMenu:w}=s;return r.jsx(as,{value:{isOpen:g,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:f,setActiveSubmenuId:x,size:t,variant:n,triggerRef:y,contentRef:b,contentId:k,openMenu:S,closeMenu:w,styles:l},children:r.jsx(ls,{items:o,size:t,variant:n,disableNativeContextMenu:i,views:l,...d,children:e})})},Ke=cs;Ke.Trigger=Qr;Ke.Content=Ht;Ke.Item=Zr;Ke.Divider=Jr;Ke.Separator=is;const ss=({src:e,color:o,views:t,themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=o?{fill:a(o,{themeMode:l}),stroke:a(o,{themeMode:l})}:{};return r.jsx(c.Center,{...i,...t==null?void 0:t.container,children:r.jsx(c.Image,{...d,content:'url("'+e+'")',width:"100%",height:"100%",...t==null?void 0:t.image})})},ds=({path:e,...o})=>r.jsx(c.Image,{src:e,...o}),en=({placeholder:e,isMulti:o,options:t,id:n=`select-${Math.random().toString(36).substr(2,9)}`})=>{const i=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(i),[m,h]=u.useState(0),[f,x]=u.useState(!0);return{id:n,value:g,setValue:p,hide:f,setHide:x,isHovered:a,setIsHovered:l,isFocused:d,setIsFocused:s,highlightedIndex:m,setHighlightedIndex:h}},on=({children:e,containerId:o="portal-root"})=>{const[t,n]=u.useState(null);return u.useEffect(()=>{let i=document.getElementById(o),a=!1;return i||(a=!0,i=document.createElement("div"),i.setAttribute("id",o),document.body.appendChild(i)),n(i),()=>{a&&i&&i.parentNode&&i.childNodes.length===0&&i.parentNode.removeChild(i)}},[o]),t?ri.createPortal(e,t):null},mt=({children:e,views:o={helperText:{}},...t})=>r.jsx(c.Text,{size:"xs",fontWeight:"400",letterSpacing:"-0.01em",lineHeight:"16px",marginVertical:0,marginHorizontal:0,color:"color-gray-500",transition:"all 0.2s ease",...o.helperText,...t,children:e}),we=u.forwardRef(({children:e,helperText:o,error:t=!1,views:n,...i},a)=>r.jsxs(c.Vertical,{ref:a,gap:8,position:"relative",width:"100%",marginVertical:4,...i,...n==null?void 0:n.container,children:[e,!t&&o&&r.jsx(mt,{marginTop:4,...n==null?void 0:n.helperText,children:o}),t&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,fontWeight:"500",color:"color-red-500",transition:"all 0.2s ease",...n==null?void 0:n.error,children:t})]}));we.displayName="FieldContainer";const tn={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},Zt={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},rn={outline:{borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",transition:"border-color 200ms ease-out, box-shadow 200ms ease-out, background-color 200ms ease-out",_hover:{borderColor:"color-gray-300",backgroundColor:"color-gray-50"},_focus:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"},_focusVisible:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"}},default:{borderWidth:0,borderBottomWidth:"1.5px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",borderRadius:0,backgroundColor:"transparent",transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out",_hover:{borderBottomColor:"color-gray-400",backgroundColor:"color-gray-50"},_focus:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"},_focusVisible:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"}},none:{border:"none",backgroundColor:"transparent",transition:"background-color 200ms ease-out",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"},_focusVisible:{outline:"none",backgroundColor:"color-gray-100"}}},us={paddingTop:"16px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"12px",paddingBottom:"6px",paddingLeft:"12px",paddingRight:"12px"}}},gs={paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"12px",paddingRight:"12px"}}},Ve=({label:e,shadow:o,children:t,value:n,size:i="md",shape:a="default",variant:l="default",error:d=!1,showLabel:s=!1,isFocused:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,views:f={pickerBox:{}},...x})=>{const b=d?"color-red-500":(p||g)&&!m?"theme-primary":"color-gray-300";return r.jsx(c.Horizontal,{gap:8,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",marginBottom:2,borderStyle:"solid",borderColor:b,backgroundColor:"color-white",fontSize:c.Typography.fontSizes[i],cursor:m?"not-allowed":h?"auto":"text",opacity:m?.7:1,transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out, opacity 200ms ease-out",...s?us:gs,...o,...tn[a],...rn[l],...f==null?void 0:f.container,...x,children:t})},Bt=({children:e,...o})=>r.jsx(c.Center,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",...o,children:e}),ps={h1:{fontSize:96,lineHeight:112,letterSpacing:-1.5},h2:{fontSize:60,lineHeight:71,letterSpacing:-.5},h3:{fontSize:48,lineHeight:57,letterSpacing:0},h4:{fontSize:34,lineHeight:40,letterSpacing:.25},h5:{fontSize:24,lineHeight:28,letterSpacing:0},h6:{fontSize:20,lineHeight:24,letterSpacing:.15}},ms=({children:e,heading:o,isItalic:t=!1,isUnderlined:n=!1,isStriked:i=!1,weight:a="normal",size:l="sm",dropDown:d,...s})=>{const g=o?ps[o]:{};return r.jsx(c.Element,{as:"label",width:"100%",fontSize:l,fontStyle:t?"italic":"normal",fontWeight:c.Typography.fontWeights[a],textDecoration:i?"line-through":n?"underline":"none",...g,...s,children:e})},hs=e=>r.jsx(ms,{...e}),ho=hs,He=({children:e,size:o="md",error:t=!1,color:n="theme-primary",views:i={label:{}},helperText:a,...l})=>r.jsx(ho,{top:0,zIndex:-10,position:"absolute",fontSize:Zt[o],lineHeight:Zt[o],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:t?"color-red-500":n,transition:"color 200ms ease-out",...i.label,...l,children:e}),Qe=({children:e,...o})=>r.jsx(c.Vertical,{width:"100%",maxWidth:"100%",position:"relative",...o,children:e}),nn={xs:12,sm:14,md:16,lg:20,xl:24},fs={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},xs={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},bs={padding:"10px 12px",cursor:"pointer",borderRadius:"6px",margin:"2px 4px",transition:"background-color 0.15s ease"},So={default:{backgroundColor:"transparent"},highlighted:{backgroundColor:"color-gray-100"},selected:{backgroundColor:"color-gray-100"},selectedHighlighted:{backgroundColor:"color-gray-200"}},Jt={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},ys={padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},ks={scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.15) transparent"},js=({isHovered:e,setIsHovered:o,option:t,size:n="md",callback:i=()=>{},style:a,isSelected:l=!1,...d})=>{const s=(m,h)=>{m.stopPropagation(),m.preventDefault(),typeof i=="function"&&i(h)},g=()=>o(!e),p=()=>l&&e?So.selectedHighlighted:l?So.selected:e?So.highlighted:So.default;return r.jsxs(c.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...bs,...p(),onMouseEnter:g,onMouseLeave:g,onClick:m=>s(m,t.value),...d,children:[r.jsx(c.Text,{fontSize:c.Typography.fontSizes[n],fontWeight:l?"500":"400",lineHeight:"1.4",color:l?"color-gray-900":"color-gray-700",...a,children:t.label}),l&&r.jsx(c.Element,{as:"span",color:"theme-primary",fontSize:"14px",marginLeft:8,display:"flex",alignItems:"center",children:"✓"})]})},Cs=({size:e="md",views:o={field:{},text:{}},value:t,isDisabled:n,placeholder:i,removeOption:a=()=>{},options:l})=>{const d={margin:0,width:"95%",height:"100%",border:"none",paddingVertical:4,paddingHorizontal:0,fontSize:c.Typography.fontSizes[e],fontWeight:"400",lineHeight:"1.5",letterSpacing:"-0.01em",backgroundColor:"transparent",color:n?"color-gray-400":"color-gray-900",cursor:n?"not-allowed":"pointer",transition:"all 0.2s ease",...o.field,...o.text},s=l.length>0&&l.find(g=>g.value===t);return r.jsx(c.Text,{...d,children:(t===""||Array.isArray(t)&&t.length===0)&&i?i:r.jsx(r.Fragment,{children:typeof t=="string"?(s&&s.label)??t:Array.isArray(t)&&t.length>0?r.jsx(c.Horizontal,{gap:6,children:t.map(g=>r.jsx(Is,{option:g,removeOption:a},g))}):r.jsx("span",{children:t})})})},Ss=({id:e,name:o,value:t,onChange:n,isMulti:i=!1,isDisabled:a=!1,isReadOnly:l=!1,options:d=[],...s})=>{const g=p=>{n&&n(p)};return r.jsx(c.Element,{id:e,name:o,as:"select",opacity:0,width:1,height:1,overflow:"hidden",position:"absolute",pointerEvents:"none",tabIndex:-1,"aria-hidden":"true",value:t,disabled:a,readOnly:l,onChange:g,multiple:i,...s,children:d.length>0&&d.map(p=>r.jsx("option",{value:p.value,children:p.label},p.value))})},ws=({size:e,views:o={},options:t,callback:n=()=>{},highlightedIndex:i,setHighlightedIndex:a,selectedValue:l})=>{const d=g=>n(g),s=g=>Array.isArray(l)?l.includes(g):l===g;return r.jsx(c.Element,{as:"ul",role:"listbox",display:"flex",flexDirection:"column",margin:0,padding:"4px",...fs,style:ks,...o==null?void 0:o.dropDown,children:t&&t.length>0&&t.map((g,p)=>r.jsx(js,{size:e,style:o.text,option:g,callback:d,isSelected:s(g.value),isHovered:p===i,setIsHovered:()=>{},onMouseEnter:()=>a(p)},g.value))})},Is=({option:e,size:o="md",removeOption:t=()=>{},...n})=>{const i=()=>t(e);return r.jsxs(c.Horizontal,{gap:6,alignItems:"center",onClick:a=>a.stopPropagation(),...ys,_hover:{backgroundColor:"color-gray-200"},...n,children:[r.jsx(c.Text,{fontSize:c.Typography.fontSizes[o],fontWeight:"500",color:"color-gray-700",children:e}),r.jsx(fe,{role:"close-button",color:"color-gray-500",widthHeight:nn[o],onClick:i,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},an=({id:e,name:o,label:t,value:n,placeholder:i,helperText:a,hide:l=!1,error:d=!1,isMulti:s=!1,isFocused:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,options:f=[],shadow:x={},size:y="md",shape:b="default",variant:k="default",views:S={text:{},icon:{},dropDown:{},selectBox:{},label:{},helperText:{}},onChange:w=()=>{},setHide:j=()=>{},setValue:C=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setHighlightedIndex:R,highlightedIndex:V,..._})=>{const{ref:T,relation:W,updateRelation:B}=c.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),P=u.useRef(null),z=()=>{var Y;if(!T.current)return{};const D=T.current.getBoundingClientRect(),q={position:"fixed",left:D.left,width:D.width,zIndex:1e4};return((Y=W==null?void 0:W.space)==null?void 0:Y.vertical)==="top"?{...q,bottom:window.innerHeight-D.top+8}:{...q,top:D.bottom+8}};u.useEffect(()=>{const D=()=>j(!0);return document.addEventListener("closeAllSelects",D),()=>document.removeEventListener("closeAllSelects",D)},[j]),u.useEffect(()=>{const D=q=>{!q.target.closest(`#${e}`)&&!l&&j(!0)};return document.addEventListener("click",D),()=>{document.removeEventListener("click",D)}},[e,l,j]);const $=!!(g&&t),E=()=>I(!p),H=()=>M(!0),L=D=>{document.dispatchEvent(new Event("closeAllSelects")),D&&D.stopPropagation&&D.stopPropagation();const q=!l;j(q),M(!q)},A=u.useCallback(D=>{if(j(!0),document.dispatchEvent(new Event("closeAllSelects")),s&&Array.isArray(n)){if(!n.includes(D)){const q=[...n,D];C(q),w&&w(D)}}else C(D),w&&w(D);M(!0)},[s,n,j,C,w,M]),F=D=>{if(Array.isArray(n)&&n.includes(D)){const q=n.filter(K=>K!==D);C(q.length===0?[]:q)}};return r.jsx(we,{ref:T,position:"relative",width:"100%",display:"inline-block",id:e,role:"SelectBox",helperText:a,error:d,views:S,onClick:D=>{D.stopPropagation(),m||h||L(D)},children:r.jsxs(Ve,{label:t,size:y,error:d,shape:b,views:S,shadow:x,variant:k,value:n,color:"theme-primary",isHovered:p,isDisabled:m,isReadOnly:h,isFocused:g,showLabel:$,onMouseEnter:E,onMouseLeave:E,position:"relative",children:[r.jsxs(Qe,{children:[$&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...S,children:t}),r.jsx(Ss,{id:e,name:o,options:f,onChange:w,value:n,isDisabled:m,isReadOnly:h,isMulti:s,onFocus:H,..._}),r.jsx(Cs,{options:f,size:y,views:S,value:n,isDisabled:m,placeholder:i,removeOption:F})]}),r.jsx(Bt,{children:!h&&!m&&r.jsx(c.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:l?Jt.closed:Jt.open,children:r.jsx(ae,{color:"inherit",widthHeight:nn[y],style:S.icon,orientation:"down"})})}),!l&&f.length>0&&r.jsx(on,{children:r.jsx(c.Element,{ref:P,onClick:D=>D.stopPropagation(),style:{...z(),...xs.enter},children:r.jsx(ws,{size:y,views:S,options:f,callback:A,highlightedIndex:V,setHighlightedIndex:R,selectedValue:n})})})]})})},Ts=e=>{const o={...e,options:e.options||[]},t=en(o);return r.jsx(an,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},Ms=Ts,ln=({isDisabled:e,isChecked:o})=>{const[t,n]=u.useState(!1),[i,a]=u.useState(o||!1),[l,d]=u.useState(o||!1);return u.useEffect(()=>{o!==void 0&&(a(o),d(o))},[o]),{isHovered:t,setIsHovered:n,on:i,setOn:a,value:l,setValue:d}},zs={xs:{height:"8px",width:"8px"},sm:{height:"12px",width:"12px"},md:{height:"16px",width:"16px"},lg:{height:"20px",width:"20px"},xl:{height:"24px",width:"24px"}},Rs={xs:{height:"16px",width:"36px"},sm:{height:"20px",width:"44px"},md:{height:"24px",width:"52px"},lg:{height:"28px",width:"60px"},xl:{height:"32px",width:"68px"}},Vs={xs:{paddingVertical:4,paddingHorizontal:2},sm:{paddingVertical:4,paddingHorizontal:2},md:{paddingVertical:4,paddingHorizontal:4},lg:{paddingVertical:4,paddingHorizontal:4},xl:{paddingVertical:4,paddingHorizontal:4}},Pe={default:{active:"theme-primary",inactive:"color-gray-300",knob:"white",disabled:"color-gray-200"},states:{hover:{active:"theme-primary",inactive:"color-gray-400",activeOpacity:.9}}},er={slider:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},knob:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}},Es=e=>r.jsx(c.Input,{type:"checkbox",...e}),cn=({id:e,name:o,label:t,inActiveChild:n,isChecked:i,activeChild:a,labelPosition:l="right",shadow:d={},size:s="sm",value:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,on:f,setOn:x,onChange:y,setValue:b=()=>{},setIsHovered:k=()=>{},helperText:S,views:w={slider:{},circle:{},label:{}},...j})=>{const C=V=>{if(!h&&!m){const _=V.target.checked;b(_),x(_),y&&y(_)}},I=()=>k(!0),M=()=>k(!1),R={container:{gap:12,display:"flex",height:"fit-content",width:"fit-content",alignItems:"center",cursor:m?"not-allowed":h?"default":"pointer",opacity:m?.6:1,transition:"all 0.2s ease",...w.label}};return r.jsxs(ho,{htmlFor:e,onMouseEnter:I,onMouseLeave:M,...R.container,...j,children:[r.jsx(Es,{id:e,name:o,opacity:0,width:0,height:0,checked:g,onChange:C,disabled:m,readOnly:h,...j}),l==="left"&&t&&r.jsx(c.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t}),r.jsxs(c.View,{display:"flex",alignItems:"center",justifyContent:g?a?"space-between":"flex-end":n?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:m?Pe.default.disabled:g?p?Pe.states.hover.active:Pe.default.active:p?Pe.states.hover.inactive:Pe.default.inactive,opacity:!m&&g&&p?Pe.states.hover.activeOpacity:1,cursor:"pointer",...er.slider,...d,...Vs[s],...Rs[s],...w.slider,children:[a&&g&&r.jsx(c.View,{marginLeft:8,marginRight:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:a}),r.jsx(c.View,{borderRadius:"50%",backgroundColor:Pe.default.knob,boxShadow:p?"0 2px 4px rgba(0, 0, 0, 0.2)":"0 1px 2px rgba(0, 0, 0, 0.1)",transform:p?"scale(1.05)":"scale(1)",...er.knob,zIndex:1,...zs[s],...w.circle}),n&&!g&&r.jsx(c.View,{marginRight:8,marginLeft:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:n})]}),l==="right"&&t&&r.jsx(c.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t})]})},Ps=e=>{const o=ln(e);return r.jsx(cn,{...o,...e})},Ws=Ps,sn=({placeholder:e,isMulti:o,options:t,id:n=`selector-${Math.random().toString(36).substr(2,9)}`})=>{const i=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(i),[m,h]=u.useState(0),[f,x]=u.useState(!0);return{id:n,value:g,setValue:p,hide:f,setHide:x,isHovered:a,setIsHovered:l,isFocused:d,setIsFocused:s,highlightedIndex:m,setHighlightedIndex:h}},dn=({id:e,name:o,label:t,value:n,size:i,views:a={},options:l=[],onChange:d=()=>{},setValue:s=()=>{},...g})=>{const{getColor:p}=c.useTheme(),m=u.useCallback(h=>{s(h.value),d&&d(h.value)},[s,d]);return r.jsxs(we,{id:e,width:"100%",views:a,children:[t&&r.jsxs(c.Horizontal,{fontSize:"10px",letterSpacing:"wider",color:"color-black-500",fontWeight:"bold",marginBottom:12,alignItems:"center",gap:6,style:{textTransform:"uppercase"},children:[r.jsx(ze,{widthHeight:14})," ",r.jsx(c.Text,{children:t})]}),r.jsx(c.Horizontal,{gap:0,children:l.map((h,f,x)=>{const y=n===h.value;let b=p("color-gray-200"),k=p("color-gray-500"),S="transparent";if(y){if(h.color)h.color,b=p(h.color),k=p(h.color),S="rgba(0,0,0,0.05)";else{const w=p("theme-primary");b=w,k=w,S="color-gray-50"}h.color?(b=p(h.color),k=p(h.color),S="transparent"):(b=p("theme-primary"),k=p("theme-primary"),S="transparent")}return r.jsx(_e,{onClick:()=>m(h),flex:1,...i?{size:i}:{paddingVertical:6,fontSize:"12px"},fontWeight:y?"bold":"normal",style:{borderTop:`1px solid ${y?b:p("color-gray-200")}`,borderBottom:`1px solid ${y?b:p("color-gray-200")}`,borderLeft:`1px solid ${y?b:p("color-gray-200")}`,borderRight:f===x.length-1||y?`1px solid ${y?b:p("color-gray-200")}`:"none",backgroundColor:S,color:k,borderRadius:f===0?"6px 0 0 6px":f===x.length-1?"0 6px 6px 0":"0",zIndex:y?1:0,boxShadow:"none"},...a.item,children:h.label},h.value)})}),r.jsx("input",{type:"hidden",id:e,name:o,value:Array.isArray(n)?n.join(","):n,onChange:()=>{}})]})},_s=e=>{const o={...e,options:e.options||[]},t=sn(o);return r.jsx(dn,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},$s=_s,un=({label:e,placeholder:o,value:t})=>{const[n,i]=u.useState(e??o),[a,l]=u.useState(!1),[d,s]=u.useState(t||""),[g,p]=u.useState(!1);return u.useMemo(()=>{i(g&&!d?o??"":e??o)},[d,g,e,o]),{hint:n,setHint:i,isHovered:a,setIsHovered:l,value:d,setValue:s,isFocused:g,setIsFocused:p}},gn=({id:e,name:o,hint:t,error:n,value:i,label:a,shadow:l,helperText:d,placeholder:s,size:g="sm",shape:p="default",variant:m="default",isHovered:h=!1,isFocused:f=!1,isEditable:x=!1,isReadOnly:y=!1,isDisabled:b=!1,isAutoFocus:k=!1,isMultiline:S=!1,maxRows:w=3,maxCols:j=30,onBlur:C=()=>{},onChange:I,onFocus:M,setHint:R=()=>{},setValue:V=()=>{},setIsFocused:_=()=>{},setIsHovered:T=()=>{},views:W={label:{},helperText:{}},...B})=>{const P=!!(f&&a),z={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[g],lineHeight:`${Math.round(c.Typography.fontSizes[g]*1.5)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:b?"color-gray-400":"color-gray-900",cursor:b?"not-allowed":"text",opacity:b?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...W.field},$=()=>T(!h),E=()=>{_(!0),M&&M()},H=A=>{C(A),_(!1)},L=A=>{typeof A=="string"?(V(A),I&&I(A)):(V(A.target.value),I&&I(A.target.value))};return r.jsx(we,{helperText:d,error:n,views:W,...B,children:r.jsx(Ve,{label:a,size:g,error:n,shape:p,views:W,shadow:l,variant:m,value:i,color:"theme-primary",isHovered:h,isDisabled:b,isReadOnly:y,isFocused:f,showLabel:P,onMouseEnter:$,onMouseLeave:$,...W==null?void 0:W.content,children:r.jsxs(Qe,{...W==null?void 0:W.warper,children:[P&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:n,...W==null?void 0:W.label,children:a}),r.jsx(c.Element,{as:"textarea",id:e,name:o,rows:w,cols:j,value:i,readOnly:y,disabled:b,autoFocus:k,placeholder:t,onBlur:H,onFocus:E,onChange:A=>L(A),...z,style:{resize:b||y?"none":"vertical"},...W==null?void 0:W.textarea})]})})})},Hs=e=>{const o=un(e);return r.jsx(gn,{...o,...e})},Bs=Hs,Lt=({label:e,placeholder:o,value:t})=>{const[n,i]=u.useState(e??o),[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(t);return u.useMemo(()=>{i(a&&!g?o??"":e??o)},[g,a,e,o]),{hint:n,setHint:i,isFocused:a,setIsFocused:l,isHovered:d,setIsHovered:s,setValue:p,value:g}},Ls=e=>r.jsx(c.Input,{type:"text",...e}),fo=({id:e,name:o,label:t,hint:n,value:i,onChange:a,left:l,right:d,helperText:s,placeholder:g,onChangeText:p,shadow:m={},views:h={container:{},field:{},label:{},helperText:{},text:{}},size:f="md",shape:x="default",variant:y="default",error:b=!1,isFocused:k=!1,isHovered:S=!1,isDisabled:w=!1,isReadOnly:j=!1,isClearable:C=!0,isAutoFocus:I=!1,setHint:M=()=>{},setIsFocused:R=()=>{},setIsHovered:V=()=>{},setValue:_=()=>{},onClick:T=()=>{},onFocus:W,onBlur:B=()=>{},themeMode:P,...z})=>{const{getColor:$,themeMode:E}=c.useTheme(),H=$("color-blueGray-700",{themeMode:P||E}),L=!!(k&&t),A={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",height:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[f],lineHeight:`${Math.round(c.Typography.fontSizes[f]*1.4)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:w?"color-gray-400":"color-gray-900",cursor:w?"not-allowed":"text",opacity:w?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...h.field},F=()=>{R(!0),W&&W()},D=()=>V(!S),q=O=>{B&&B(O),R(!1)},K=O=>{typeof O=="string"?(_(O),p&&p(O),a&&a(O)):(_(O.target.value),p&&p(O.target.value),a&&a(O.target.value))},Y=()=>{_(""),a&&(B({target:{name:o}}),p&&p(""),a&&a("")),typeof document>"u"&&p&&p("")};return r.jsx(we,{helperText:s,error:b,views:h,children:r.jsxs(Ve,{label:t,size:f,error:b,shape:x,views:h,shadow:m,variant:y,value:i,color:"theme-primary",isHovered:S,isDisabled:w,isReadOnly:j,isFocused:k,showLabel:L,onMouseEnter:D,onMouseLeave:D,children:[l,r.jsxs(Qe,{children:[L&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:b,...h,children:t}),r.jsx(Ls,{id:e,name:o,readOnly:j,disabled:w,autoFocus:I,placeholder:n,onFocus:F,onBlur:q,autoComplete:"off",...A,...z,onChange:K,value:i})]}),C&&i&&!j&&!w&&r.jsx(Bt,{children:r.jsx(fe,{size:20,color:H,onClick:Y,cursor:"pointer",borderRadius:"50%",transition:"background-color 150ms ease-out, transform 150ms ease-out",_hover:{backgroundColor:"color-gray-100",transform:"scale(1.05)"},_active:{transform:"scale(0.95)"}})}),d]})})},As=e=>{const o=Lt(e);return r.jsx(fo,{...o,...e})},xo=As,pn=({defaultIsSelected:e=!1})=>{const[o,t]=u.useState(!1),[n,i]=u.useState(e);return{isHovered:o,setIsHovered:t,isSelected:n,setIsSelected:i}},Ds={xs:{height:"12px",width:"12px"},sm:{height:"16px",width:"16px"},md:{height:"20px",width:"20px"},lg:{height:"24px",width:"24px"},xl:{height:"28px",width:"28px"}},or={xs:10,sm:14,md:16,lg:20,xl:24},Fs={selected:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},unselected:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-black",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},indeterminate:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"}},nt={hover:{selected:{opacity:.9},unselected:{borderColor:"color-gray-400",backgroundColor:"color-gray-50"},indeterminate:{opacity:.9}},disabled:{selected:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},unselected:{borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},indeterminate:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"}},error:{selected:{backgroundColor:"color-red-500",borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"},indeterminate:{backgroundColor:"color-red-500",borderColor:"color-red-500"}}},mn=({id:e,icon:o,name:t,label:n,isChecked:i,onChange:a,onValueChange:l,shadow:d={},labelPosition:s="right",size:g="md",error:p=!1,isSelected:m=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:x=!1,isIndeterminate:y=!1,defaultIsSelected:b=!1,setIsSelected:k=()=>{},setIsHovered:S=()=>{},views:w={checkbox:{},label:{}},infoText:j,helperText:C,...I})=>{const M=()=>S(!h),R=()=>{!x&&!f&&(k&&k(!m),a&&a(!i),l&&l(!i))},V=y?"indeterminate":i||m?"selected":"unselected",_=p?nt.error[V]:f?nt.disabled[V]:h?nt.hover[V]:{},T={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:p?"color-red-600":f?"color-gray-400":"color-gray-700",cursor:f?"not-allowed":x?"default":"pointer",opacity:f?.6:1,transition:"all 0.2s ease",...w.label},checkbox:{...Fs[V],..._,borderRadius:"4px",...Ds[g],transition:"all 0.2s ease",...d,...w.checkbox}};return r.jsxs(ho,{htmlFor:e,as:"div",onClick:R,onMouseEnter:M,onMouseLeave:M,size:c.Typography.fontSizes[g],...T.container,...I,children:[r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsxs(c.Horizontal,{gap:12,alignItems:"center",children:[" ",s==="left"&&n&&r.jsx(c.Text,{size:g,fontWeight:"500",...w==null?void 0:w.label,children:n}),r.jsx(c.Center,{...T.checkbox,children:y?r.jsx(Mr,{widthHeight:or[g],color:"white",transition:"all 0.2s ease"}):(i||m)&&(o??r.jsx(No,{widthHeight:or[g],color:"white",transition:"all 0.2s ease"}))}),s==="right"&&n&&r.jsx(c.Text,{size:g,fontWeight:"500",...w==null?void 0:w.label,children:n})]}),j&&r.jsx(c.Text,{marginLeft:s==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...w==null?void 0:w.infoText,children:j})]}),p&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:p})]})},Os=e=>{const o=pn(e);return r.jsx(mn,{...o,...e})},qs=Os,hn=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:i,onOpen:a,onClose:l,closeOnSelect:d=!0,maxRecentColors:s=8,showRecentColors:g=!0,isAutoFocus:p=!1}=e,[m,h]=u.useState(!1),[f,x]=u.useState(o??t),[y,b]=u.useState(""),[k,S]=u.useState([]),[w,j]=u.useState(!1),[C,I]=u.useState(!1),M=u.useRef(null),R=u.useRef(null);u.useEffect(()=>{o!==void 0&&x(o)},[o]),u.useEffect(()=>{if(g)try{const $=localStorage.getItem("colorInput-recentColors");$&&S(JSON.parse($))}catch($){console.warn("Failed to load recent colors from localStorage:",$)}},[g]),u.useEffect(()=>{p&&M.current&&M.current.focus()},[p]),u.useEffect(()=>{const $=E=>{m&&M.current&&R.current&&!M.current.contains(E.target)&&!R.current.contains(E.target)&&P()};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[m]);const V=u.useCallback($=>{g&&S(E=>{const H=E.filter(A=>A!==$),L=[$,...H].slice(0,s);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(L))}catch(A){console.warn("Failed to save recent colors to localStorage:",A)}return L})},[g,s]),_=u.useCallback(()=>{const $=!m;h($),$?a==null||a():l==null||l()},[m,a,l]),T=u.useCallback($=>{x($),V($),n==null||n($),i==null||i($),d&&(h(!1),l==null||l())},[n,i,d,l,V]),W=u.useCallback($=>{b($)},[]),B=u.useCallback(()=>{y&&(T(y),b(""))},[y,T]),P=u.useCallback(()=>{h(!1),l==null||l()},[l]),z=u.useCallback($=>{x($),n==null||n($)},[n]);return{isOpen:m,selectedColor:f,recentColors:k,customColor:y,isFocused:w,isHovered:C,handleToggle:_,handleColorSelect:T,handleCustomColorChange:W,handleCustomColorSubmit:B,handleClose:P,setIsFocused:j,setIsHovered:I,setValue:z,triggerRef:M,dropdownRef:R}},ro={container:{position:"relative",display:"inline-block",width:"fit-content"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",padding:"8px 12px"},dropdown:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"8px"},recentColors:{display:"flex",gap:"4px",flexWrap:"wrap"}},Ns={xs:{height:"28px",fontSize:"10px",padding:"4px 8px"},sm:{height:"32px",fontSize:"12px",padding:"6px 10px"},md:{height:"40px",fontSize:"14px",padding:"8px 12px"},lg:{height:"48px",fontSize:"16px",padding:"12px 16px"},xl:{height:"56px",fontSize:"20px",padding:"16px 20px"}},Us={default:{borderRadius:"6px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Gs={default:{backgroundColor:"color-white",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},outline:{backgroundColor:"transparent",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},none:{backgroundColor:"transparent",borderColor:"transparent",borderWidth:"0px"}},Ys=[{name:"Red 500",value:"color-red-500"},{name:"Orange 500",value:"color-orange-500"},{name:"Yellow 500",value:"color-yellow-500"},{name:"Green 500",value:"color-green-500"},{name:"Blue 500",value:"color-blue-500"},{name:"Indigo 500",value:"color-indigo-500"},{name:"Purple 500",value:"color-purple-500"},{name:"Pink 500",value:"color-pink-500"},{name:"Red 300",value:"color-red-300"},{name:"Orange 300",value:"color-orange-300"},{name:"Yellow 300",value:"color-yellow-300"},{name:"Green 300",value:"color-green-300"},{name:"Blue 300",value:"color-blue-300"},{name:"Indigo 300",value:"color-indigo-300"},{name:"Purple 300",value:"color-purple-300"},{name:"Pink 300",value:"color-pink-300"},{name:"Red 700",value:"color-red-700"},{name:"Orange 700",value:"color-orange-700"},{name:"Yellow 700",value:"color-yellow-700"},{name:"Green 700",value:"color-green-700"},{name:"Blue 700",value:"color-blue-700"},{name:"Indigo 700",value:"color-indigo-700"},{name:"Purple 700",value:"color-purple-700"},{name:"Pink 700",value:"color-pink-700"},{name:"Gray 100",value:"color-gray-100"},{name:"Gray 300",value:"color-gray-300"},{name:"Gray 500",value:"color-gray-500"},{name:"Gray 700",value:"color-gray-700"},{name:"Gray 900",value:"color-gray-900"},{name:"White",value:"color-white"},{name:"Black",value:"color-black"},{name:"Transparent",value:"transparent"}],fn=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",shadow:g,error:p=!1,isDisabled:m=!1,isReadOnly:h=!1,isFocused:f=!1,isHovered:x=!1,predefinedColors:y=Ys,showCustomInput:b=!0,showRecentColors:k=!0,isOpen:S=!1,selectedColor:w="",recentColors:j=[],customColor:C="",handleToggle:I=()=>{},handleColorSelect:M=()=>{},handleCustomColorChange:R=()=>{},handleCustomColorSubmit:V=()=>{},setIsFocused:_=()=>{},setIsHovered:T=()=>{},triggerRef:W,dropdownRef:B,onChange:P,...z})=>{const{getColor:$}=c.useTheme(),E={...ro.container,...a==null?void 0:a.container},H={...ro.trigger,...Ns[l],...Us[d],...Gs[s],...p&&{borderColor:"color-red-500"},...m&&{opacity:.6,cursor:"not-allowed"},...f&&{borderColor:"color-blue-500",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.1)"},...x&&!m&&{borderColor:"color-gray-400"},...a==null?void 0:a.trigger,...g&&g},L={...ro.dropdown,...a==null?void 0:a.dropdown},A={...ro.colorGrid,...a==null?void 0:a.colorGrid},F={...ro.recentColors,...a==null?void 0:a.recentColors},D=w||"color-gray-200";return r.jsxs(c.View,{...E,...z,children:[t&&r.jsx(ho,{htmlFor:e,size:l,isDisabled:m,error:p,views:a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:W,onClick:m||h?void 0:I,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),onFocus:()=>_(!0),onBlur:()=>_(!1),tabIndex:m?-1:0,role:"button","aria-expanded":S,"aria-haspopup":"listbox","aria-label":t||n,width:"fit-content",gap:8,...H,children:[r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:D,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),!h&&!m&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:S?"up":"down"})]}),S&&r.jsxs(c.View,{ref:B,...L,children:[r.jsx(c.View,{...A,children:y.map((q,K)=>r.jsx(c.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:q.value,borderWidth:"2px",borderStyle:"solid",borderColor:w===q.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(q.value),title:q.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},K))}),k&&j.length>0&&r.jsxs(c.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(c.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Recent Colors"}),r.jsx(c.Horizontal,{gap:4,flexWrap:"wrap",...F,children:j.map((q,K)=>r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:q,borderWidth:"1px",borderStyle:"solid",borderColor:w===q?"color-blue-500":"color-gray-300",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(q),title:q,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"}},K))})]}),b&&r.jsxs(c.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(c.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Custom Color"}),r.jsxs(c.Horizontal,{gap:8,children:[r.jsx(xo,{value:C,onChange:q=>R(q.target.value),placeholder:"#000000 or rgb(0,0,0)",size:"sm",style:{flex:1},views:a==null?void 0:a.customInput}),r.jsx(c.View,{padding:"8px 12px",backgroundColor:"color-blue-500",borderRadius:"4px",cursor:"pointer",onClick:V,_hover:{backgroundColor:"color-blue-600"},children:r.jsx(c.Text,{color:"color-white",fontSize:"12px",fontWeight:"500",children:"Add"})})]})]})]}),i&&r.jsx(c.Text,{fontSize:"12px",color:p?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i}),p&&typeof p=="string"&&r.jsx(c.Text,{fontSize:"12px",color:"color-red-500",marginTop:"4px",...a==null?void 0:a.error,children:p})]})},vs=e=>{const o=hn(e);return r.jsx(fn,{...o,...e})},Xs=vs,ht=[{name:"Afghanistan",dial_code:"+93",emoji:"🇦🇫",code:"AF"},{name:"Aland Islands",dial_code:"+358",emoji:"🇦🇽",code:"AX"},{name:"Albania",dial_code:"+355",emoji:"🇦🇱",code:"AL"},{name:"Algeria",dial_code:"+213",emoji:"🇩🇿",code:"DZ"},{name:"AmericanSamoa",dial_code:"+1684",emoji:"🇦🇸",code:"AS"},{name:"Andorra",dial_code:"+376",emoji:"🇦🇩",code:"AD"},{name:"Angola",dial_code:"+244",emoji:"🇦🇴",code:"AO"},{name:"Anguilla",dial_code:"+1264",emoji:"🇦🇮",code:"AI"},{name:"Antarctica",dial_code:"+672",emoji:"🇦🇶",code:"AQ"},{name:"Antigua and Barbuda",dial_code:"+1268",emoji:"🇦🇬",code:"AG"},{name:"Argentina",dial_code:"+54",emoji:"🇦🇷",code:"AR"},{name:"Armenia",dial_code:"+374",emoji:"🇦🇲",code:"AM"},{name:"Aruba",dial_code:"+297",emoji:"🇦🇼",code:"AW"},{name:"Australia",dial_code:"+61",emoji:"🇦🇺",code:"AU"},{name:"Austria",dial_code:"+43",emoji:"🇦🇹",code:"AT"},{name:"Azerbaijan",dial_code:"+994",emoji:"🇦🇿",code:"AZ"},{name:"Bahamas",dial_code:"+1242",emoji:"🇧🇸",code:"BS"},{name:"Bahrain",dial_code:"+973",emoji:"🇧🇭",code:"BH"},{name:"Bangladesh",dial_code:"+880",emoji:"🇧🇩",code:"BD"},{name:"Barbados",dial_code:"+1246",emoji:"🇧🇧",code:"BB"},{name:"Belarus",dial_code:"+375",emoji:"🇧🇾",code:"BY"},{name:"Belgium",dial_code:"+32",emoji:"🇧🇪",code:"BE"},{name:"Belize",dial_code:"+501",emoji:"🇧🇿",code:"BZ"},{name:"Benin",dial_code:"+229",emoji:"🇧🇯",code:"BJ"},{name:"Bermuda",dial_code:"+1441",emoji:"🇧🇲",code:"BM"},{name:"Bhutan",dial_code:"+975",emoji:"🇧🇹",code:"BT"},{name:"Bolivia, Plurinational State of",dial_code:"+591",emoji:"🇧🇴",code:"BO"},{name:"Bosnia and Herzegovina",dial_code:"+387",emoji:"🇧🇦",code:"BA"},{name:"Botswana",dial_code:"+267",emoji:"🇧🇼",code:"BW"},{name:"Brazil",dial_code:"+55",emoji:"🇧🇷",code:"BR"},{name:"British Indian Ocean Territory",dial_code:"+246",emoji:"🇮🇴",code:"IO"},{name:"Brunei Darussalam",dial_code:"+673",emoji:"🇧🇳",code:"BN"},{name:"Bulgaria",dial_code:"+359",emoji:"🇧🇬",code:"BG"},{name:"Burkina Faso",dial_code:"+226",emoji:"🇧🇫",code:"BF"},{name:"Burundi",dial_code:"+257",emoji:"🇧🇮",code:"BI"},{name:"Cambodia",dial_code:"+855",emoji:"🇰🇭",code:"KH"},{name:"Cameroon",dial_code:"+237",emoji:"🇨🇲",code:"CM"},{name:"Canada",dial_code:"+1",emoji:"🇨🇦",code:"CA"},{name:"Cape Verde",dial_code:"+238",emoji:"🇨🇻",code:"CV"},{name:"Cayman Islands",dial_code:"+345",emoji:"🇰🇾",code:"KY"},{name:"Central African Republic",dial_code:"+236",emoji:"🇨🇫",code:"CF"},{name:"Chad",dial_code:"+235",emoji:"🇹🇩",code:"TD"},{name:"Chile",dial_code:"+56",emoji:"🇨🇱",code:"CL"},{name:"China",dial_code:"+86",emoji:"🇨🇳",code:"CN"},{name:"Christmas Island",dial_code:"+61",emoji:"🇨🇽",code:"CX"},{name:"Cocos (Keeling) Islands",dial_code:"+61",emoji:"🇨🇨",code:"CC"},{name:"Colombia",dial_code:"+57",emoji:"🇨🇴",code:"CO"},{name:"Comoros",dial_code:"+269",emoji:"🇰🇲",code:"KM"},{name:"Congo",dial_code:"+242",emoji:"🇨🇬",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dial_code:"+243",emoji:"🇨🇩",code:"CD"},{name:"Cook Islands",dial_code:"+682",emoji:"🇨🇰",code:"CK"},{name:"Costa Rica",dial_code:"+506",emoji:"🇨🇷",code:"CR"},{name:"Cote d'Ivoire",dial_code:"+225",emoji:"🇨🇮",code:"CI"},{name:"Croatia",dial_code:"+385",emoji:"🇭🇷",code:"HR"},{name:"Cuba",dial_code:"+53",emoji:"🇨🇺",code:"CU"},{name:"Cyprus",dial_code:"+357",emoji:"🇨🇾",code:"CY"},{name:"Czech Republic",dial_code:"+420",emoji:"🇨🇿",code:"CZ"},{name:"Denmark",dial_code:"+45",emoji:"🇩🇰",code:"DK"},{name:"Djibouti",dial_code:"+253",emoji:"🇩🇯",code:"DJ"},{name:"Dominica",dial_code:"+1767",emoji:"🇩🇲",code:"DM"},{name:"Dominican Republic",dial_code:"+1849",emoji:"🇩🇴",code:"DO"},{name:"Ecuador",dial_code:"+593",emoji:"🇪🇨",code:"EC"},{name:"Egypt",dial_code:"+20",emoji:"🇪🇬",code:"EG"},{name:"El Salvador",dial_code:"+503",emoji:"🇸🇻",code:"SV"},{name:"Equatorial Guinea",dial_code:"+240",emoji:"🇬🇶",code:"GQ"},{name:"Eritrea",dial_code:"+291",emoji:"🇪🇷",code:"ER"},{name:"Estonia",dial_code:"+372",emoji:"🇪🇪",code:"EE"},{name:"Ethiopia",dial_code:"+251",emoji:"🇪🇹",code:"ET"},{name:"Falkland Islands (Malvinas)",dial_code:"+500",emoji:"🇫🇰",code:"FK"},{name:"Faroe Islands",dial_code:"+298",emoji:"🇫🇴",code:"FO"},{name:"Fiji",dial_code:"+679",emoji:"🇫🇯",code:"FJ"},{name:"Finland",dial_code:"+358",emoji:"🇫🇮",code:"FI"},{name:"France",dial_code:"+33",emoji:"🇫🇷",code:"FR"},{name:"French Guiana",dial_code:"+594",emoji:"🇬🇫",code:"GF"},{name:"French Polynesia",dial_code:"+689",emoji:"🇵🇫",code:"PF"},{name:"Gabon",dial_code:"+241",emoji:"🇬🇦",code:"GA"},{name:"Gambia",dial_code:"+220",emoji:"🇬🇲",code:"GM"},{name:"Georgia",dial_code:"+995",emoji:"🇬🇪",code:"GE"},{name:"Germany",dial_code:"+49",emoji:"🇩🇪",code:"DE"},{name:"Ghana",dial_code:"+233",emoji:"🇬🇭",code:"GH"},{name:"Gibraltar",dial_code:"+350",emoji:"🇬🇮",code:"GI"},{name:"Greece",dial_code:"+30",emoji:"🇬🇷",code:"GR"},{name:"Greenland",dial_code:"+299",emoji:"🇬🇱",code:"GL"},{name:"Grenada",dial_code:"+1473",emoji:"🇬🇩",code:"GD"},{name:"Guadeloupe",dial_code:"+590",emoji:"🇬🇵",code:"GP"},{name:"Guam",dial_code:"+1671",emoji:"🇬🇺",code:"GU"},{name:"Guatemala",dial_code:"+502",emoji:"🇬🇹",code:"GT"},{name:"Guernsey",dial_code:"+44",emoji:"🇬🇬",code:"GG"},{name:"Guinea",dial_code:"+224",emoji:"🇬🇳",code:"GN"},{name:"Guinea-Bissau",dial_code:"+245",emoji:"🇬🇼",code:"GW"},{name:"Guyana",dial_code:"+595",emoji:"🇬🇾",code:"GY"},{name:"Haiti",dial_code:"+509",emoji:"🇭🇹",code:"HT"},{name:"Holy See (Vatican City State)",dial_code:"+379",emoji:"🇻🇦",code:"VA"},{name:"Honduras",dial_code:"+504",emoji:"🇭🇳",code:"HN"},{name:"Hong Kong",dial_code:"+852",emoji:"🇭🇰",code:"HK"},{name:"Hungary",dial_code:"+36",emoji:"🇭🇺",code:"HU"},{name:"Iceland",dial_code:"+354",emoji:"🇮🇸",code:"IS"},{name:"India",dial_code:"+91",emoji:"🇮🇳",code:"IN"},{name:"Indonesia",dial_code:"+62",emoji:"🇮🇩",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dial_code:"+98",emoji:"🇮🇷",code:"IR"},{name:"Iraq",dial_code:"+964",emoji:"🇮🇷",code:"IQ"},{name:"Ireland",dial_code:"+353",emoji:"🇮🇪",code:"IE"},{name:"Isle of Man",dial_code:"+44",emoji:"🇮🇲",code:"IM"},{name:"Israel",dial_code:"+972",emoji:"🇮🇱",code:"IL"},{name:"Italy",dial_code:"+39",emoji:"🇮🇹",code:"IT"},{name:"Jamaica",dial_code:"+1876",emoji:"🇯🇲",code:"JM"},{name:"Japan",dial_code:"+81",emoji:"🇯🇵",code:"JP"},{name:"Jersey",dial_code:"+44",emoji:"🇯🇪",code:"JE"},{name:"Jordan",dial_code:"+962",emoji:"🇯🇴",code:"JO"},{name:"Kazakhstan",dial_code:"+77",emoji:"🇰🇿",code:"KZ"},{name:"Kenya",dial_code:"+254",emoji:"🇰🇪",code:"KE"},{name:"Kiribati",dial_code:"+686",emoji:"🇰🇮",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dial_code:"+850",emoji:"🇰🇵",code:"KP"},{name:"Korea, Republic of South Korea",dial_code:"+82",emoji:"🇰🇷",code:"KR"},{name:"Kuwait",dial_code:"+965",emoji:"🇰🇼",code:"KW"},{name:"Kyrgyzstan",dial_code:"+996",emoji:"🇰🇬",code:"KG"},{name:"Laos",dial_code:"+856",emoji:"🇱🇦",code:"LA"},{name:"Latvia",dial_code:"+371",emoji:"🇱🇻",code:"LV"},{name:"Lebanon",dial_code:"+961",emoji:"🇱🇧",code:"LB"},{name:"Lesotho",dial_code:"+266",emoji:"🇱🇸",code:"LS"},{name:"Liberia",dial_code:"+231",emoji:"🇱🇷",code:"LR"},{name:"Libyan Arab Jamahiriya",dial_code:"+218",emoji:"🇱🇾",code:"LY"},{name:"Liechtenstein",dial_code:"+423",emoji:"🇱🇮",code:"LI"},{name:"Lithuania",dial_code:"+370",emoji:"🇱🇹",code:"LT"},{name:"Luxembourg",dial_code:"+352",emoji:"🇱🇺",code:"LU"},{name:"Macao",dial_code:"+853",emoji:"🇲🇴",code:"MO"},{name:"Macedonia",dial_code:"+389",emoji:"🇲🇰",code:"MK"},{name:"Madagascar",dial_code:"+261",emoji:"🇲🇬",code:"MG"},{name:"Malawi",dial_code:"+265",emoji:"🇲🇼",code:"MW"},{name:"Malaysia",dial_code:"+60",emoji:"🇲🇾",code:"MY"},{name:"Maldives",dial_code:"+960",emoji:"🇲🇻",code:"MV"},{name:"Mali",dial_code:"+223",emoji:"🇲🇱",code:"ML"},{name:"Malta",dial_code:"+356",emoji:"🇲🇹",code:"MT"},{name:"Marshall Islands",dial_code:"+692",emoji:"🇲🇭",code:"MH"},{name:"Martinique",dial_code:"+596",emoji:"🇲🇶",code:"MQ"},{name:"Mauritania",dial_code:"+222",emoji:"🇲🇷",code:"MR"},{name:"Mauritius",dial_code:"+230",emoji:"🇲🇺",code:"MU"},{name:"Mayotte",dial_code:"+262",emoji:"🇾🇹",code:"YT"},{name:"Mexico",dial_code:"+52",emoji:"🇲🇽",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dial_code:"+691",emoji:"🇫🇲",code:"FM"},{name:"Moldova",dial_code:"+373",emoji:"🇲🇩",code:"MD"},{name:"Monaco",dial_code:"+377",emoji:"🇲🇨",code:"MC"},{name:"Mongolia",dial_code:"+976",emoji:"🇲🇳",code:"MN"},{name:"Montenegro",dial_code:"+382",emoji:"🇲🇪",code:"ME"},{name:"Montserrat",dial_code:"+1664",emoji:"🇲🇸",code:"MS"},{name:"Morocco",dial_code:"+212",emoji:"🇲🇦",code:"MA"},{name:"Mozambique",dial_code:"+258",emoji:"🇲🇿",code:"MZ"},{name:"Myanmar",dial_code:"+95",emoji:"🇲🇲",code:"MM"},{name:"Namibia",emoji:"🇳🇦",dial_code:"+264",code:"NA"},{name:"Nauru",dial_code:"+674",emoji:"🇳🇷",code:"NR"},{name:"Nepal",dial_code:"+977",emoji:"🇳🇵",code:"NP"},{name:"Netherlands",dial_code:"+31",emoji:"🇳🇱",code:"NL"},{name:"Netherlands Antilles",dial_code:"+599",emoji:"🇧🇶",code:"AN"},{name:"New Caledonia",dial_code:"+687",emoji:"🇳🇨",code:"NC"},{name:"New Zealand",dial_code:"+64",emoji:"🇳🇿",code:"NZ"},{name:"Nicaragua",dial_code:"+505",emoji:"🇳🇮",code:"NI"},{name:"Niger",dial_code:"+227",emoji:"🇳🇪",code:"NE"},{name:"Nigeria",dial_code:"+234",emoji:"🇳🇬",code:"NG"},{name:"Niue",dial_code:"+683",emoji:"🇳🇺",code:"NU"},{name:"Norfolk Island",dial_code:"+672",emoji:"🇳🇫",code:"NF"},{name:"Northern Mariana Islands",dial_code:"+1670",emoji:"🇲🇵",code:"MP"},{name:"Norway",dial_code:"+47",emoji:"🇳🇴",code:"NO"},{name:"Oman",dial_code:"+968",emoji:"🇴🇲",code:"OM"},{name:"Pakistan",dial_code:"+92",emoji:"🇵🇰",code:"PK"},{name:"Palau",dial_code:"+680",emoji:"🇵🇼",code:"PW"},{name:"Palestinian Territory, Occupied",dial_code:"+970",emoji:"🇵🇸",code:"PS"},{name:"Panama",dial_code:"+507",emoji:"🇵🇦",code:"PA"},{name:"Papua New Guinea",dial_code:"+675",emoji:"🇵🇬",code:"PG"},{name:"Paraguay",dial_code:"+595",emoji:"🇵🇾",code:"PY"},{name:"Peru",dial_code:"+51",emoji:"🇵🇪",code:"PE"},{name:"Philippines",dial_code:"+63",emoji:"🇵🇭",code:"PH"},{name:"Pitcairn",dial_code:"+872",emoji:"🇵🇳",code:"PN"},{name:"Poland",dial_code:"+48",emoji:"🇵🇱",code:"PL"},{name:"Portugal",dial_code:"+351",emoji:"🇵🇹",code:"PT"},{name:"Puerto Rico",dial_code:"+1939",emoji:"🇵🇷",code:"PR"},{name:"Qatar",dial_code:"+974",emoji:"🇶🇦",code:"QA"},{name:"Romania",dial_code:"+40",emoji:"🇷🇴",code:"RO"},{name:"Russia",dial_code:"+7",emoji:"🇷🇺",code:"RU"},{name:"Rwanda",dial_code:"+250",emoji:"🇷🇼",code:"RW"},{name:"Reunion",dial_code:"+262",emoji:"🇷🇪",code:"RE"},{name:"Saint Barthelemy",dial_code:"+590",emoji:"🇧🇱",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dial_code:"+290",emoji:"🇸🇭",code:"SH"},{name:"Saint Kitts and Nevis",dial_code:"+1869",emoji:"🇰🇳",code:"KN"},{name:"Saint Lucia",dial_code:"+1758",emoji:"🇱🇨",code:"LC"},{name:"Saint Martin",dial_code:"+590",emoji:"🇲🇫",code:"MF"},{name:"Saint Pierre and Miquelon",dial_code:"+508",emoji:"🇵🇲",code:"PM"},{name:"Saint Vincent and the Grenadines",dial_code:"+1784",emoji:"🇻🇨",code:"VC"},{name:"Samoa",dial_code:"+685",emoji:"🇼🇸",code:"WS"},{name:"San Marino",dial_code:"+378",emoji:"🇸🇲",code:"SM"},{name:"Sao Tome and Principe",dial_code:"+239",emoji:"🇸🇹",code:"ST"},{name:"Saudi Arabia",dial_code:"+966",emoji:"🇸🇦",code:"SA"},{name:"Senegal",dial_code:"+221",emoji:"🇸🇳",code:"SN"},{name:"Serbia",dial_code:"+381",emoji:"🇷🇸",code:"RS"},{name:"Seychelles",dial_code:"+248",emoji:"🇸🇨",code:"SC"},{name:"Sierra Leone",dial_code:"+232",emoji:"🇸🇱",code:"SL"},{name:"Singapore",dial_code:"+65",emoji:"🇸🇬",code:"SG"},{name:"Slovakia",dial_code:"+421",emoji:"🇸🇰",code:"SK"},{name:"Slovenia",dial_code:"+386",emoji:"🇸🇮",code:"SI"},{name:"Solomon Islands",dial_code:"+677",emoji:"🇸🇧",code:"SB"},{name:"Somalia",dial_code:"+252",emoji:"🇸🇴",code:"SO"},{name:"South Africa",dial_code:"+27",emoji:"🇿🇦",code:"ZA"},{name:"South Sudan",dial_code:"+211",emoji:"🇸🇸",code:"SS"},{name:"South Georgia and the South Sandwich Islands",dial_code:"+500",emoji:"🇬🇸",code:"GS"},{name:"Spain",dial_code:"+34",emoji:"🇪🇸",code:"ES"},{name:"Sri Lanka",dial_code:"+94",emoji:"🇱🇰",code:"LK"},{name:"Sudan",dial_code:"+249",emoji:"🇸🇩",code:"SD"},{name:"Suriname",dial_code:"+597",emoji:"🇸🇷",code:"SR"},{name:"Svalbard and Jan Mayen",dial_code:"+47",emoji:"🇸🇯",code:"SJ"},{name:"Swaziland",dial_code:"+268",emoji:"🇸🇿",code:"SZ"},{name:"Sweden",dial_code:"+46",emoji:"🇸🇪",code:"SE"},{name:"Switzerland",dial_code:"+41",emoji:"🇨🇭",code:"CH"},{name:"Syrian Arab Republic",dial_code:"+963",emoji:"🇸🇾",code:"SY"},{name:"Taiwan",dial_code:"+886",emoji:"🇹🇼",code:"TW"},{name:"Tajikistan",dial_code:"+992",emoji:"🇹🇯",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dial_code:"+255",emoji:"🇹🇿",code:"TZ"},{name:"Thailand",dial_code:"+66",emoji:"🇹🇭",code:"TH"},{name:"Timor-Leste",dial_code:"+670",emoji:"🇹🇱",code:"TL"},{name:"Togo",dial_code:"+228",emoji:"🇹🇬",code:"TG"},{name:"Tokelau",dial_code:"+690",emoji:"🇹🇰",code:"TK"},{name:"Tonga",dial_code:"+676",emoji:"🇹🇴",code:"TO"},{name:"Trinidad and Tobago",dial_code:"+1868",emoji:"🇹🇹",code:"TT"},{name:"Tunisia",dial_code:"+216",emoji:"🇹🇳",code:"TN"},{name:"Turkey",dial_code:"+90",emoji:"🇹🇷",code:"TR"},{name:"Turkmenistan",dial_code:"+993",emoji:"🇹🇲",code:"TM"},{name:"Turks and Caicos Islands",dial_code:"+1649",emoji:"🇹🇨",code:"TC"},{name:"Tuvalu",dial_code:"+688",emoji:"🇹🇻",code:"TV"},{name:"Uganda",dial_code:"+256",emoji:"🇺🇬",code:"UG"},{name:"Ukraine",dial_code:"+380",emoji:"🇺🇦",code:"UA"},{name:"United Arab Emirates",dial_code:"+971",emoji:"🇦🇪",code:"AE"},{name:"United Kingdom",dial_code:"+44",emoji:"🇬🇧",code:"GB"},{name:"United States",dial_code:"+1",emoji:"🇺🇸",code:"US"},{name:"Uruguay",dial_code:"+598",emoji:"🇺🇾",code:"UY"},{name:"Uzbekistan",dial_code:"+998",emoji:"🇺🇿",code:"UZ"},{name:"Vanuatu",dial_code:"+678",emoji:"🇻🇺",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dial_code:"+58",emoji:"🇻🇪",code:"VE"},{name:"Vietnam",dial_code:"+84",emoji:"🇻🇳",code:"VN"},{name:"Virgin Islands, British",dial_code:"+1284",emoji:"🇻🇬",code:"VG"},{name:"Virgin Islands, U.S.",dial_code:"+1340",emoji:"🇻🇮",code:"VI"},{name:"Wallis and Futuna",dial_code:"+681",emoji:"🇼🇫",code:"WF"},{name:"Yemen",dial_code:"+967",emoji:"🇾🇪",code:"YE"},{name:"Zambia",dial_code:"+260",emoji:"🇿🇲",code:"ZM"},{name:"Zimbabwe",dial_code:"+263",emoji:"🇿🇼",code:"ZW"}],xn=({placeholder:e})=>{const[o,t]=u.useState(ht),[n,i]=u.useState(e??ht[0].name),[a,l]=u.useState(!0),[d,s]=u.useState(!1),[g,p]=u.useState(!1);return{hide:a,setHide:l,newOptions:o,setNewOptions:t,isHovered:g,setIsHovered:p,isFocused:d,setIsFocused:s,value:n,setValue:i}},tr={xs:8,sm:10,md:12,lg:14,xl:16},Ks=({size:e,...o})=>r.jsx(c.Element,{as:"ul",...o}),Qs=e=>r.jsx(c.Input,{type:"country",...e}),Zs=({size:e,...o})=>r.jsx(c.Element,{as:"li",...o}),Js=({option:e,size:o="md",callback:t=()=>{},views:n={text:{}}})=>{const i=a=>{a&&a.stopPropagation&&a.stopPropagation(),t(e)};return r.jsx(Zs,{margin:0,role:"DropDownItem",listStyleType:"none",fontWeight:"normal",paddingVertical:6,paddingHorizontal:12,onClick:i,fontSize:c.Typography.fontSizes[o],_hover:{opacity:.8},...n.text,children:e})},ed=({size:e,views:o={dropDown:{}},options:t=[],callback:n=()=>{}})=>{const i=a=>n(a);return r.jsx(Ks,{role:"dropDown",margin:0,padding:0,top:"100%",width:"100%",display:"flex",zIndex:1e3,overflow:"auto",maxHeight:"300px",borderRadius:4,position:"absolute",flexDirection:"column",backgroundColor:"color-white",boxShadow:"rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px",...o.dropDown,children:t.map(a=>r.jsx(Js,{size:e,option:a.name,callback:i,...o.text},a.code))})},bn=({id:e,name:o,label:t,value:n,placeholder:i,helperText:a,hide:l=!1,error:d=!1,isHovered:s=!1,isFocused:g=!1,isAutoFocus:p=!1,isDisabled:m=!1,isReadOnly:h=!1,shadow:f={},newOptions:x=[],size:y="md",variant:b="default",shape:k="default",onChange:S,onBlur:w=()=>{},setHide:j=()=>{},setNewOptions:C=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setValue:R=()=>{},views:V={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:_,...T})=>{const{getColor:W,themeMode:B}=c.useTheme(),P=W("color-blueGray-700",{themeMode:_||B}),z=()=>M(!0),$=D=>{j(!l),R(D),S&&S(D)},E=()=>{!m&&!h&&j(!l)},H=D=>{const q=D.target.value,K=ht.filter(Y=>Y.name.toLowerCase().startsWith(q.toLowerCase()));l&&j(!1),C(K),S&&S(q)},L=D=>{w(D),M(!1)},A=!!(t&&(g||n)),F={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[y],backgroundColor:"transparent",color:m?"color-trueGray-600":"color-blueGray-700",cursor:m?"not-allowed":h?"auto":"pointer",...V.field};return r.jsxs(we,{helperText:a,error:d,views:V,onClick:E,children:[r.jsxs(Ve,{label:t,size:y,error:d,shape:k,views:V,shadow:f,variant:b,value:n,color:"theme-primary",isDisabled:m,isReadOnly:h,isFocused:g,showLabel:A,_hover:!m&&!d?{borderColor:"theme-primary"}:void 0,children:[r.jsxs(Qe,{children:[A&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...V,children:t}),r.jsx(Qs,{id:e,name:o,placeholder:i,readOnly:h,disabled:m,autoFocus:p,onBlur:L,onFocus:z,...F,...T,value:n,onChange:H})]}),r.jsx(Bt,{children:l?r.jsx(ae,{orientation:"down",widthHeight:tr[y],color:P,style:V.icon}):r.jsx(ae,{orientation:"up",widthHeight:tr[y],color:P,style:V.icon})})]}),!l&&r.jsx(ed,{size:y,views:V,options:x,callback:$})]})},od=e=>{const o=xn(e);return r.jsx(bn,{...o,...e})},td=od;function Bo(e){"@babel/helpers - typeof";return Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Bo(e)}function ge(e,o){if(o.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+o.length+" present")}function rd(e){return ge(1,arguments),e instanceof Date||Bo(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function je(e){ge(1,arguments);var o=Object.prototype.toString.call(e);return e instanceof Date||Bo(e)==="object"&&o==="[object Date]"?new Date(e.getTime()):typeof e=="number"||o==="[object Number]"?new Date(e):((typeof e=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function nd(e){if(ge(1,arguments),!rd(e)&&typeof e!="number")return!1;var o=je(e);return!isNaN(Number(o))}function $e(e){if(e===null||e===!0||e===!1)return NaN;var o=Number(e);return isNaN(o)?o:o<0?Math.ceil(o):Math.floor(o)}function ad(e,o){ge(2,arguments);var t=je(e).getTime(),n=$e(o);return new Date(t+n)}function id(e,o){ge(2,arguments);var t=$e(o);return ad(e,-t)}var ld=864e5;function cd(e){ge(1,arguments);var o=je(e),t=o.getTime();o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0);var n=o.getTime(),i=t-n;return Math.floor(i/ld)+1}function Lo(e){ge(1,arguments);var o=1,t=je(e),n=t.getUTCDay(),i=(n<o?7:0)+n-o;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}function yn(e){ge(1,arguments);var o=je(e),t=o.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var i=Lo(n),a=new Date(0);a.setUTCFullYear(t,0,4),a.setUTCHours(0,0,0,0);var l=Lo(a);return o.getTime()>=i.getTime()?t+1:o.getTime()>=l.getTime()?t:t-1}function sd(e){ge(1,arguments);var o=yn(e),t=new Date(0);t.setUTCFullYear(o,0,4),t.setUTCHours(0,0,0,0);var n=Lo(t);return n}var dd=6048e5;function ud(e){ge(1,arguments);var o=je(e),t=Lo(o).getTime()-sd(o).getTime();return Math.round(t/dd)+1}var gd={};function Qo(){return gd}function Ao(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=Qo(),m=$e((t=(n=(i=(a=o==null?void 0:o.weekStartsOn)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&i!==void 0?i:p.weekStartsOn)!==null&&n!==void 0?n:(s=p.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.weekStartsOn)!==null&&t!==void 0?t:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=je(e),f=h.getUTCDay(),x=(f<m?7:0)+f-m;return h.setUTCDate(h.getUTCDate()-x),h.setUTCHours(0,0,0,0),h}function kn(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=je(e),m=p.getUTCFullYear(),h=Qo(),f=$e((t=(n=(i=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:h.firstWeekContainsDate)!==null&&n!==void 0?n:(s=h.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(m+1,0,f),x.setUTCHours(0,0,0,0);var y=Ao(x,o),b=new Date(0);b.setUTCFullYear(m,0,f),b.setUTCHours(0,0,0,0);var k=Ao(b,o);return p.getTime()>=y.getTime()?m+1:p.getTime()>=k.getTime()?m:m-1}function pd(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=Qo(),m=$e((t=(n=(i=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&n!==void 0?n:(s=p.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=kn(e,o),f=new Date(0);f.setUTCFullYear(h,0,m),f.setUTCHours(0,0,0,0);var x=Ao(f,o);return x}var md=6048e5;function hd(e,o){ge(1,arguments);var t=je(e),n=Ao(t,o).getTime()-pd(t,o).getTime();return Math.round(n/md)+1}function te(e,o){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length<o;)n="0"+n;return t+n}var Te={y:function(o,t){var n=o.getUTCFullYear(),i=n>0?n:1-n;return te(t==="yy"?i%100:i,t.length)},M:function(o,t){var n=o.getUTCMonth();return t==="M"?String(n+1):te(n+1,2)},d:function(o,t){return te(o.getUTCDate(),t.length)},a:function(o,t){var n=o.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(o,t){return te(o.getUTCHours()%12||12,t.length)},H:function(o,t){return te(o.getUTCHours(),t.length)},m:function(o,t){return te(o.getUTCMinutes(),t.length)},s:function(o,t){return te(o.getUTCSeconds(),t.length)},S:function(o,t){var n=t.length,i=o.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return te(a,t.length)}},De={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fd={G:function(o,t,n){var i=o.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(o,t,n){if(t==="yo"){var i=o.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Te.y(o,t)},Y:function(o,t,n,i){var a=kn(o,i),l=a>0?a:1-a;if(t==="YY"){var d=l%100;return te(d,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):te(l,t.length)},R:function(o,t){var n=yn(o);return te(n,t.length)},u:function(o,t){var n=o.getUTCFullYear();return te(n,t.length)},Q:function(o,t,n){var i=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return te(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(o,t,n){var i=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return te(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(o,t,n){var i=o.getUTCMonth();switch(t){case"M":case"MM":return Te.M(o,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(o,t,n){var i=o.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return te(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(o,t,n,i){var a=hd(o,i);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):te(a,t.length)},I:function(o,t,n){var i=ud(o);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):te(i,t.length)},d:function(o,t,n){return t==="do"?n.ordinalNumber(o.getUTCDate(),{unit:"date"}):Te.d(o,t)},D:function(o,t,n){var i=cd(o);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):te(i,t.length)},E:function(o,t,n){var i=o.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(o,t,n,i){var a=o.getUTCDay(),l=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return te(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(o,t,n,i){var a=o.getUTCDay(),l=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return te(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(o,t,n){var i=o.getUTCDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return te(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(o,t,n){var i=o.getUTCHours(),a=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(o,t,n){var i=o.getUTCHours(),a;switch(i===12?a=De.noon:i===0?a=De.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(o,t,n){var i=o.getUTCHours(),a;switch(i>=17?a=De.evening:i>=12?a=De.afternoon:i>=4?a=De.morning:a=De.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(o,t,n){if(t==="ho"){var i=o.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Te.h(o,t)},H:function(o,t,n){return t==="Ho"?n.ordinalNumber(o.getUTCHours(),{unit:"hour"}):Te.H(o,t)},K:function(o,t,n){var i=o.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):te(i,t.length)},k:function(o,t,n){var i=o.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):te(i,t.length)},m:function(o,t,n){return t==="mo"?n.ordinalNumber(o.getUTCMinutes(),{unit:"minute"}):Te.m(o,t)},s:function(o,t,n){return t==="so"?n.ordinalNumber(o.getUTCSeconds(),{unit:"second"}):Te.s(o,t)},S:function(o,t){return Te.S(o,t)},X:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();if(l===0)return"Z";switch(t){case"X":return nr(l);case"XXXX":case"XX":return We(l);case"XXXXX":case"XXX":default:return We(l,":")}},x:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"x":return nr(l);case"xxxx":case"xx":return We(l);case"xxxxx":case"xxx":default:return We(l,":")}},O:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rr(l,":");case"OOOO":default:return"GMT"+We(l,":")}},z:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rr(l,":");case"zzzz":default:return"GMT"+We(l,":")}},t:function(o,t,n,i){var a=i._originalDate||o,l=Math.floor(a.getTime()/1e3);return te(l,t.length)},T:function(o,t,n,i){var a=i._originalDate||o,l=a.getTime();return te(l,t.length)}};function rr(e,o){var t=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return t+String(i);var l=o;return t+String(i)+l+te(a,2)}function nr(e,o){if(e%60===0){var t=e>0?"-":"+";return t+te(Math.abs(e)/60,2)}return We(e,o)}function We(e,o){var t=o||"",n=e>0?"-":"+",i=Math.abs(e),a=te(Math.floor(i/60),2),l=te(i%60,2);return n+a+t+l}var ar=function(o,t){switch(o){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},jn=function(o,t){switch(o){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},xd=function(o,t){var n=o.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return ar(o,t);var l;switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",ar(i,t)).replace("{{time}}",jn(a,t))},bd={p:jn,P:xd};function yd(e){var o=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return o.setUTCFullYear(e.getFullYear()),e.getTime()-o.getTime()}var kd=["D","DD"],jd=["YY","YYYY"];function Cd(e){return kd.indexOf(e)!==-1}function Sd(e){return jd.indexOf(e)!==-1}function ir(e,o,t){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(o,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(o,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(o,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(o,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var wd={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Id=function(o,t,n){var i,a=wd[o];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function at(e){return function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=o.width?String(o.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var Td={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Md={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rd={date:at({formats:Td,defaultWidth:"full"}),time:at({formats:Md,defaultWidth:"full"}),dateTime:at({formats:zd,defaultWidth:"full"})},Vd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ed=function(o,t,n,i){return Vd[o]};function no(e){return function(o,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,l=t!=null&&t.width?String(t.width):a;i=e.formattingValues[l]||e.formattingValues[a]}else{var d=e.defaultWidth,s=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[s]||e.values[d]}var g=e.argumentCallback?e.argumentCallback(o):o;return i[g]}}var Pd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},_d={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$d={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Hd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Bd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ld=function(o,t){var n=Number(o),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Ad={ordinalNumber:Ld,era:no({values:Pd,defaultWidth:"wide"}),quarter:no({values:Wd,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:no({values:_d,defaultWidth:"wide"}),day:no({values:$d,defaultWidth:"wide"}),dayPeriod:no({values:Hd,defaultWidth:"wide",formattingValues:Bd,defaultFormattingWidth:"wide"})};function ao(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=o.match(i);if(!a)return null;var l=a[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(d)?Fd(d,function(m){return m.test(l)}):Dd(d,function(m){return m.test(l)}),g;g=e.valueCallback?e.valueCallback(s):s,g=t.valueCallback?t.valueCallback(g):g;var p=o.slice(l.length);return{value:g,rest:p}}}function Dd(e,o){for(var t in e)if(e.hasOwnProperty(t)&&o(e[t]))return t}function Fd(e,o){for(var t=0;t<e.length;t++)if(o(e[t]))return t}function Od(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=o.match(e.matchPattern);if(!n)return null;var i=n[0],a=o.match(e.parsePattern);if(!a)return null;var l=e.valueCallback?e.valueCallback(a[0]):a[0];l=t.valueCallback?t.valueCallback(l):l;var d=o.slice(i.length);return{value:l,rest:d}}}var qd=/^(\d+)(th|st|nd|rd)?/i,Nd=/\d+/i,Ud={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Gd={any:[/^b/i,/^(a|c)/i]},Yd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vd={any:[/1/i,/2/i,/3/i,/4/i]},Xd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Kd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Qd={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Zd={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Jd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},eu={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ou={ordinalNumber:Od({matchPattern:qd,parsePattern:Nd,valueCallback:function(o){return parseInt(o,10)}}),era:ao({matchPatterns:Ud,defaultMatchWidth:"wide",parsePatterns:Gd,defaultParseWidth:"any"}),quarter:ao({matchPatterns:Yd,defaultMatchWidth:"wide",parsePatterns:vd,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:ao({matchPatterns:Xd,defaultMatchWidth:"wide",parsePatterns:Kd,defaultParseWidth:"any"}),day:ao({matchPatterns:Qd,defaultMatchWidth:"wide",parsePatterns:Zd,defaultParseWidth:"any"}),dayPeriod:ao({matchPatterns:Jd,defaultMatchWidth:"any",parsePatterns:eu,defaultParseWidth:"any"})},tu={code:"en-US",formatDistance:Id,formatLong:Rd,formatRelative:Ed,localize:Ad,match:ou,options:{weekStartsOn:0,firstWeekContainsDate:1}},ru=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nu=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,au=/^'([^]*?)'?$/,iu=/''/g,lu=/[a-zA-Z]/;function cu(e,o,t){var n,i,a,l,d,s,g,p,m,h,f,x,y,b;ge(2,arguments);var k=String(o),S=Qo(),w=(n=(i=void 0)!==null&&i!==void 0?i:S.locale)!==null&&n!==void 0?n:tu,j=$e((a=(l=(d=(s=void 0)!==null&&s!==void 0?s:void 0)!==null&&d!==void 0?d:S.firstWeekContainsDate)!==null&&l!==void 0?l:(g=S.locale)===null||g===void 0||(p=g.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(j>=1&&j<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var C=$e((m=(h=(f=(x=void 0)!==null&&x!==void 0?x:void 0)!==null&&f!==void 0?f:S.weekStartsOn)!==null&&h!==void 0?h:(y=S.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&m!==void 0?m:0);if(!(C>=0&&C<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!w.localize)throw new RangeError("locale must contain localize property");if(!w.formatLong)throw new RangeError("locale must contain formatLong property");var I=je(e);if(!nd(I))throw new RangeError("Invalid time value");var M=yd(I),R=id(I,M),V={firstWeekContainsDate:j,weekStartsOn:C,locale:w,_originalDate:I},_=k.match(nu).map(function(T){var W=T[0];if(W==="p"||W==="P"){var B=bd[W];return B(T,w.formatLong)}return T}).join("").match(ru).map(function(T){if(T==="''")return"'";var W=T[0];if(W==="'")return su(T);var B=fd[W];if(B)return Sd(T)&&ir(T,o,String(e)),Cd(T)&&ir(T,o,String(e)),B(R,T,w.localize,V);if(W.match(lu))throw new RangeError("Format string contains an unescaped latin alphabet character `"+W+"`");return T}).join("");return _}function su(e){var o=e.match(au);return o?o[1].replace(iu,"'"):e}const Cn=()=>{const[e,o]=u.useState(!1),[t,n]=u.useState(!1),[i,a]=u.useState(cu(new Date,"yyyy-MM-dd"));return{date:i,setDate:a,isHovered:e,setIsHovered:o,isFocused:t,setIsFocused:n}},du=e=>r.jsx(c.Input,{type:"date",...e}),Sn=({id:e,icon:o,name:t,label:n,date:i,children:a,helperText:l,shadow:d={},size:s="md",variant:g="default",shape:p="default",views:m={container:{},label:{},helperText:{},text:{},field:{}},error:h=!1,isHovered:f=!1,isFocused:x=!1,isDisabled:y=!1,isReadOnly:b=!1,setDate:k=()=>{},setIsFocused:S=()=>{},setIsHovered:w=()=>{},onChange:j,onChangeText:C,...I})=>{const M=!!(x&&n),R=()=>w(!f),V=()=>S(!0),_=W=>{typeof W=="string"?(k(W),C&&C(W)):(k(W.target.value),j&&j(W.target.value))},T={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none",backgroundColor:"transparent"}},fontSize:c.Typography.fontSizes[s],backgroundColor:"transparent",color:y?"color-trueGray-600":"color-blueGray-700",cursor:y?"not-allowed":b?"auto":"pointer",...m.field};return r.jsx(we,{helperText:l,error:h,views:m,children:r.jsx(Ve,{label:n,size:s,error:h,shape:p,views:m,shadow:d,color:"theme-primary",variant:g,value:i,isHovered:f,isDisabled:y,isReadOnly:b,isFocused:x,showLabel:M,onMouseEnter:R,onMouseLeave:R,children:r.jsxs(Qe,{children:[M&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:h,...m,children:n}),r.jsx(du,{id:e,name:t,onFocus:V,disabled:y,readOnly:b,...T,...I,...C&&{onChangeText:_},onChange:_})]})})})},uu=e=>{const o=Cn();return r.jsx(Sn,{...o,...e})},gu=uu,wn=e=>{const o=Lt(e),[t,n]=u.useState(!1);return{isVisible:t,setIsVisible:n,...e,...o}},pu=({visibleIcon:e=r.jsx(zt,{widthHeight:14}),hiddenIcon:o=r.jsx(Mt,{widthHeight:14}),...t})=>{const{isVisible:n,setIsVisible:i,...a}=wn(t);return r.jsx(fo,{...a,type:n?"text":"password",isClearable:!1,right:r.jsx(c.View,{onClick:()=>{t.isDisabled||i(!n)},children:n?e:o})})},mu=pu,In=(e,o,t)=>{const[n,i]=u.useState(e),[a,l]=u.useState(o?{value:o,label:o}:e[0]),[d,s]=u.useState([]),[g,p]=u.useState(0),[m,h]=u.useState(t??""),[f,x]=u.useState(!1);return{filteredItems:n,setFilteredItems:i,selectedItem:a,setSelectedItem:l,selectedItems:d,setSelectedItems:s,highlightedIndex:g,setHighlightedIndex:p,searchQuery:m,setSearchQuery:h,isDropdownVisible:f,setIsDropdownVisible:x}},hu={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},lr={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},initial:{opacity:0,transform:"translateY(-8px) scale(0.96)"}},fu={padding:"8px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-100",backgroundColor:"color-gray-50",borderTopLeftRadius:"10px",borderTopRightRadius:"10px"},xu={padding:"8px 10px",cursor:"pointer",borderRadius:"6px",margin:"1px 4px",transition:"background-color 0.15s ease"},bu={padding:"24px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},cr={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},yu={display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"color-gray-100",borderRadius:"4px",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},Tn=({placeholder:e,items:o,showTick:t=!0,onSelect:n,searchEnabled:i=!0,left:a,right:l,label:d,filteredItems:s,setSelectedItem:g,selectedItem:p,selectedItems:m,setSelectedItems:h,highlightedIndex:f,setHighlightedIndex:x,searchQuery:y,setSearchQuery:b,setFilteredItems:k,views:S,isDropdownVisible:w,setIsDropdownVisible:j,isMulti:C=!1,...I})=>{const{ref:M,relation:R}=c.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),V=u.useRef(null),[_,T]=u.useState(!1),[W,B]=u.useState(!1),P=()=>{var q;const L=W?lr.enter:lr.initial;if(!M.current)return{};const A=M.current.getBoundingClientRect(),F={position:"fixed",left:A.left,width:A.width,zIndex:1e4,...L};return((q=R==null?void 0:R.space)==null?void 0:q.vertical)==="top"?{...F,bottom:window.innerHeight-A.top+6}:{...F,top:A.bottom+6}};u.useEffect(()=>{if(w){const L=setTimeout(()=>B(!0),10);return()=>clearTimeout(L)}B(!1)},[w]),u.useEffect(()=>{const L=A=>{!A.composedPath().some(q=>(q==null?void 0:q.id)==="combobox-dropdown")&&M.current&&!M.current.contains(A.target)&&j(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);const z=L=>{if(b(L),L==="")k(o);else{const A=o.filter(F=>F.label.toLowerCase().includes(L.toLowerCase()));k(A)}x(0)},$=L=>{if(C){const A=m.some(D=>D.value===L.value);let F;A?F=m.filter(D=>D.value!==L.value):F=[...m,L],h(F),n==null||n(F)}else g(L),n==null||n(L),j(!1)},E=(L,A)=>{L.stopPropagation();const F=m.filter(D=>D.value!==A.value);h(F),n==null||n(F)},H=L=>C?m.some(A=>A.value===L.value):L.value===p.value;return r.jsxs(c.Horizontal,{role:"combobox",flexWrap:"nowrap",gap:15,alignItems:"center",width:"100%",...I,children:[d&&r.jsx(c.Text,{views:S==null?void 0:S.label,htmlFor:I.id,children:d}),r.jsxs(c.View,{position:"relative",width:"100%",children:[r.jsx("div",{ref:M,onClick:()=>j(!w),style:{width:"100%"},children:r.jsxs(Ve,{isHovered:_,isFocused:w,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),cursor:"pointer",views:{container:S==null?void 0:S.container},children:[r.jsxs(c.Horizontal,{gap:10,alignItems:"center",width:"100%",flexWrap:C?"wrap":"nowrap",...S==null?void 0:S.labelContainer,children:[a,C?m.length>0?r.jsx(c.Horizontal,{gap:6,flexWrap:"wrap",alignItems:"center",children:m.map(L=>r.jsxs(c.Horizontal,{...yu,_hover:{backgroundColor:"color-gray-200"},children:[L.icon&&r.jsx(c.View,{flexShrink:0,children:L.icon}),r.jsx(c.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:L.label}),r.jsx(fe,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:A=>E(A,L)})]},L.value))}):r.jsx(c.Text,{weight:"medium",flexGrow:1,color:"color-gray-500",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...S==null?void 0:S.label,children:e}):r.jsxs(r.Fragment,{children:[p.icon&&p.label!==e&&r.jsx(c.View,{children:p.icon}),r.jsx(c.Text,{weight:"medium",flexGrow:1,color:p.label===e?"color-gray-500":"color-gray-800",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...S==null?void 0:S.label,children:p.label})]})]}),r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[l,r.jsx(c.View,{style:w?cr.open:cr.closed,children:r.jsx(ae,{widthHeight:16,orientation:"down",color:w?"color-gray-700":"color-gray-400"})})]})]})}),w&&r.jsx(on,{children:r.jsxs(c.View,{ref:V,id:"combobox-dropdown",role:"listbox","aria-labelledby":I.id,...hu,style:P(),...S==null?void 0:S.dropdown,children:[i&&r.jsx(c.View,{...fu,children:r.jsx(fo,{id:`${I.id}-search`,name:`${I.name}-search`,width:"100%",type:"search",autoFocus:!0,value:y,onChange:L=>z(L),hint:e||"Search...",isClearable:!1,left:r.jsx(Po,{widthHeight:14,color:"color-gray-400"}),views:{container:{width:"100%",padding:"0",backgroundColor:"transparent",borderColor:"color-gray-200",...S==null?void 0:S.text},field:{fontSize:"13px"}}})}),s.length>0&&r.jsx(c.View,{margin:0,padding:"4px",children:s.map((L,A)=>{const F=H(L),D=A===f;return r.jsxs(c.Horizontal,{role:"option","aria-selected":F,justifyContent:"space-between",alignItems:"center",...xu,backgroundColor:F&&D?"rgba(59, 130, 246, 0.12)":F?"rgba(59, 130, 246, 0.08)":D?"color-gray-100":"transparent",onMouseEnter:()=>x(A),onClick:()=>$(L),...S==null?void 0:S.item,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[L.icon&&r.jsx(c.View,{flexShrink:0,children:L.icon}),r.jsx(c.Text,{size:"sm",color:F?"theme-primary":"color-gray-800",weight:F?"medium":"normal",children:L.label})]}),F&&t&&r.jsx(No,{widthHeight:16,color:"theme-primary"})]},L.value)})}),s.length===0&&r.jsxs(c.Vertical,{...bu,children:[r.jsx(Po,{widthHeight:24,color:"color-gray-300"}),r.jsx(c.Text,{color:"color-gray-500",size:"sm",align:"center",children:"No results found"}),r.jsx(c.Text,{color:"color-gray-400",size:"xs",align:"center",children:"Try a different search term"})]})]})})]})]})},ku=({id:e,name:o,items:t,placeholder:n,searchPlaceholder:i,...a})=>{const l=In(t,n,i);return r.jsx(Tn,{id:e,name:o,items:t,...l,...a})},ju=ku,Mn=e=>{const{tags:o,defaultTags:t=[],onTagsChange:n,onTagAdd:i,onTagRemove:a,maxTags:l,minTagLength:d=1,maxTagLength:s=50,allowDuplicates:g=!1,separators:p=["enter","comma"],isDisabled:m=!1,isReadOnly:h=!1}=e,[f,x]=u.useState(""),[y,b]=u.useState(()=>(o||t||[]).map((P,z)=>({id:`tag-${z}-${Date.now()}`,value:P}))),[k,S]=u.useState(!1),[w,j]=u.useState(!1),C=o&&Array.isArray(o)?o.map((B,P)=>({id:`tag-${P}-${Date.now()}`,value:B})):y;u.useEffect(()=>{o&&Array.isArray(o)&&b(o.map((B,P)=>({id:`tag-${P}-${Date.now()}`,value:B})))},[o]);const I=u.useCallback(B=>{const P=B.trim();return!(P.length<d||P.length>s||!g&&C.map($=>$.value.toLowerCase()).includes(P.toLowerCase())||l&&C.length>=l)},[C,d,s,g,l]),M=u.useCallback(B=>{if(m||h)return;const P=B.trim();if(!P||!I(P))return;const z={id:`tag-${Date.now()}-${Math.random()}`,value:P},$=[...C,z],E=$.map(H=>H.value);o||b($),n==null||n(E),i==null||i(P),x("")},[C,I,n,i,m,h,o]),R=u.useCallback(B=>{if(m||h)return;const P=C[B];if(!P)return;const z=C.filter((E,H)=>H!==B),$=z.map(E=>E.value);o||b(z),n==null||n($),a==null||a(P.value,B)},[C,n,a,m,h,o]),V=u.useCallback(B=>{if(m||h)return;const P=B.target.value;if(p.includes("comma")&&P.includes(",")){const z=P.split(","),$=z[0],E=z.slice(1).join(",");$.trim()&&M($),x(E);return}x(P)},[M,p,m,h]),_=u.useCallback(B=>{if(m||h)return;const{key:P}=B;if(p.includes("enter")&&P==="Enter"){B.preventDefault(),f.trim()&&M(f);return}if(p.includes("tab")&&P==="Tab"&&f.trim()){B.preventDefault(),M(f);return}if(p.includes("space")&&P===" "&&f.trim()){B.preventDefault(),M(f);return}if(P==="Backspace"&&!f&&C.length>0){B.preventDefault(),R(C.length-1);return}},[M,R,f,C,p,m,h]),T=u.useCallback(()=>{var B;S(!0),(B=e.onFocus)==null||B.call(e)},[e.onFocus]),W=u.useCallback(()=>{var B;S(!1),f.trim()&&M(f),(B=e.onBlur)==null||B.call(e)},[M,f,e.onBlur]);return{inputValue:f,setInputValue:x,tags:C,setTags:b,isFocused:k,setIsFocused:S,isHovered:w,setIsHovered:j,addTag:M,removeTag:R,handleInputChange:V,handleKeyDown:_,handleFocus:T,handleBlur:W,validateTag:I}},Cu=({tag:e,onRemove:o,isRemovable:t,size:n,views:i,isDisabled:a,isReadOnly:l})=>{const[d,s]=u.useState(!1),g={xs:{padding:"2px 8px",fontSize:"10px",iconSize:10},sm:{padding:"4px 10px",fontSize:"12px",iconSize:12},md:{padding:"6px 14px",fontSize:"14px",iconSize:14},lg:{padding:"8px 16px",fontSize:"16px",iconSize:16},xl:{padding:"10px 18px",fontSize:"18px",iconSize:18}}[n]||{padding:"6px 14px",fontSize:"14px",iconSize:14};return r.jsxs(c.Horizontal,{alignItems:"center",gap:6,padding:g.padding,backgroundColor:"color-gray-100-100",borderRadius:"16px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-100",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",opacity:a?.6:1,_hover:!a&&!l?{backgroundColor:"color-gray-100-200",borderColor:"color-gray-200",boxShadow:"0 4px 6px rgba(0,0,0,0.05)",transform:"translateY(-1px)"}:{},...i==null?void 0:i.tag,children:[r.jsx(c.Text,{fontSize:g.fontSize,color:a?"color-gray-100":"theme-primary",whiteSpace:"nowrap",...i==null?void 0:i.tagText,children:e}),t&&!a&&!l&&r.jsx(c.View,{cursor:"pointer",padding:"2px",borderRadius:"50%",transition:"all 0.2s ease",backgroundColor:d?"color-red-100":"transparent",opacity:d?1:.7,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:p=>{p.stopPropagation(),o()},_hover:{backgroundColor:"color-red-50"},...i==null?void 0:i.tagRemove,children:r.jsx(fe,{widthHeight:g.iconSize,color:d?"color-red-500":"color-gray-400"})})]})},zn=({id:e,name:o,label:t,placeholder:n="Type and press Enter to add tags...",helperText:i,error:a=!1,inputValue:l="",tags:d=[],left:s,right:g,shadow:p={},views:m={},size:h="md",shape:f="default",variant:x="default",isDisabled:y=!1,isReadOnly:b=!1,isAutoFocus:k=!1,isRemovable:S=!0,isFocused:w=!1,isHovered:j=!1,maxTags:C,handleInputChange:I,handleKeyDown:M,handleFocus:R,handleBlur:V,removeTag:_,setIsHovered:T,onClick:W,...B})=>{const{getColor:P,themeMode:z}=c.useTheme(),$=!!(t&&(w||d.length>0||l)),E=C&&d.length>=C,H={...tn[f],...rn[x],...m==null?void 0:m.inputContainer},L={border:"none",outline:"none",backgroundColor:"transparent",fontSize:c.Typography.fontSizes[h],color:y?"color-gray-400":"color-gray-800",flex:1,minWidth:"120px",...m==null?void 0:m.input};return r.jsx(we,{error:!!a,helperText:typeof a=="string"?a:i,views:m,...B,children:r.jsxs(Ve,{label:t,shadow:p,value:d.length>0||l?"has-content":"",size:h,shape:f,variant:x,error:!!a,showLabel:$,isFocused:w,isHovered:j,isDisabled:y,isReadOnly:b,views:m,onClick:W,onMouseEnter:()=>T==null?void 0:T(!0),onMouseLeave:()=>T==null?void 0:T(!1),...H,children:[s,r.jsxs(Qe,{children:[t&&r.jsx(He,{size:h,error:!!a,views:m,children:t}),r.jsxs(c.Horizontal,{alignItems:"center",gap:8,flexWrap:"wrap",width:"100%",minHeight:c.Typography.fontSizes[h],padding:"8px 0",...m==null?void 0:m.tagsContainer,children:[d.map((A,F)=>r.jsx(Cu,{tag:A.value,onRemove:()=>_==null?void 0:_(F),isRemovable:S,size:h,views:m,isDisabled:y,isReadOnly:b},A.id)),!E&&r.jsx(c.Input,{id:e,name:o,type:"text",value:l,placeholder:d.length===0?n:"",disabled:y,readOnly:b,autoFocus:k,onChange:I,onKeyDown:M,onFocus:R,onBlur:V,autoComplete:"off",...L}),E&&r.jsxs(c.Text,{fontSize:c.Typography.fontSizes[h],color:"color-gray-500",fontStyle:"italic",...m==null?void 0:m.placeholder,children:["Maximum ",C," tags reached"]})]})]}),g]})})},Su=e=>{const o=Mn(e),{tags:t,...n}=e;return r.jsx(zn,{...o,...n})},wu=Su;function Iu(e){const o=setTimeout(e,0),t=setTimeout(e,10),n=setTimeout(e,50);return[o,t,n]}const Rn=({value:e,defaultValue:o="",length:t=6,onChange:n,onChangeText:i,onComplete:a,onKeyDown:l,onKeyPress:d,onBlur:s,onFocus:g,isReadOnly:p,isDisabled:m,pattern:h,stepValues:f,pasteTransformer:x})=>{var K,Y;const y=e!==void 0,b=y?e:o,[k,S]=u.useState((b==null?void 0:b.slice(0,t))||""),[w,j]=u.useState(!1),[C,I]=u.useState(!1),[M,R]=u.useState(null),[V,_]=u.useState(null),T=u.useRef(null),W=u.useRef(null),B=u.useRef({value:k,onChange:n||(()=>{}),isIOS:typeof window<"u"&&((Y=(K=window==null?void 0:window.CSS)==null?void 0:K.supports)==null?void 0:Y.call(K,"-webkit-touch-callout","none"))}),P=u.useRef({prev:[null,null,"none"]}),z=h?typeof h=="string"?new RegExp(h):h:null;u.useEffect(()=>{y&&e!==k&&S((e==null?void 0:e.slice(0,t))||"")},[y,e,t,k]);const $=u.useCallback(O=>{let X=O;if(f&&f.length>0&&O){const Z=parseInt(O,10);if(!isNaN(Z)){let J=f[0],oe=Math.abs(Z-J);for(let re=1;re<f.length;re++){const ce=Math.abs(Z-f[re]);ce<oe&&(oe=ce,J=f[re])}X=J.toString()}}S(X),n&&n(X),i&&i(X),a&&X.length===t&&a(X)},[n,i,a,t,f]),E=u.useCallback(O=>{O&&T.current!==O&&Object.defineProperty(T,"current",{value:O,writable:!0})},[]),H=u.useCallback(O=>{const X=O.currentTarget.value.slice(0,t);if(X.length>0&&z&&!z.test(X)){O.preventDefault();return}$(X),T.current&&(T.current.value=X)},[t,z,$,T]),L=u.useCallback(()=>{var O;if(T.current){const X=Math.min(T.current.value.length,t-1),Z=T.current.value.length;(O=T.current)==null||O.setSelectionRange(X,Z),R(X),_(Z)}j(!0)},[t]),A=u.useCallback(()=>{j(!1)},[]),F=u.useCallback(O=>{l&&l(O)},[]),D=u.useCallback(O=>{d&&d(O)},[]),q=u.useCallback(O=>{const X=T.current;if(!O.clipboardData||!X)return;const Z=O.clipboardData.getData("text/plain"),J=x?x(Z):Z;O.preventDefault();const oe=X.selectionStart||0,re=X.selectionEnd||0,U=(oe!==re?k.slice(0,oe)+J+k.slice(re):k.slice(0,oe)+J+k.slice(oe)).slice(0,t);if(U.length>0&&z&&!z.test(U))return;X.value=U,$(U),S(U);const G=Math.min(U.length,t-1),ee=U.length;X.setSelectionRange(G,ee),R(G),_(ee)},[t,x,z,$,k,S]);return u.useEffect(()=>{const O=T.current,X=W.current;if(!O||!X)return;B.current.value!==O.value&&B.current.onChange&&B.current.onChange(O.value),P.current.prev=[O.selectionStart,O.selectionEnd,O.selectionDirection];function Z(){if(document.activeElement!==O){R(null),_(null);return}const re=(O==null?void 0:O.selectionStart)??null,ce=(O==null?void 0:O.selectionEnd)??null,me=(O==null?void 0:O.selectionDirection)??null,U=(O==null?void 0:O.maxLength)??0,G=(O==null?void 0:O.value)??"",ee=P.current.prev;let v=-1,Q=-1,le="none";if(G.length!==0&&re!==null&&ce!==null){const ne=re===ce,Ie=re===G.length&&G.length<U;if(ne&&!Ie){const ye=re;if(ye===0)v=0,Q=1,le="forward";else if(ye===U)v=ye-1,Q=ye,le="backward";else if(U>1&&G.length>1){let ot=0;if(ee[0]!==null&&ee[1]!==null){le=ye<ee[1]?"backward":"forward";const va=ee[0]===ee[1]&&ee[0]<U;le==="backward"&&!va&&(ot=-1)}v=ot+ye,Q=ot+ye+1}}v!==-1&&Q!==-1&&v!==Q&&T.current&&T.current.setSelectionRange(v,Q,le)}const se=v!==-1?v:re,pe=Q!==-1?Q:ce,xe=le!=="none"?le:me;R(se),_(pe),P.current.prev=[se,pe,xe]}document.addEventListener("selectionchange",Z,{capture:!0}),Z(),document.activeElement===O&&j(!0);const J=()=>{X&&X.style.setProperty("--root-height",`${O.clientHeight}px`)};J();const oe=new window.ResizeObserver(J);return oe.observe(O),()=>{document.removeEventListener("selectionchange",Z,{capture:!0}),oe.disconnect()}},[]),u.useEffect(()=>{Iu(()=>{var J,oe,re,ce;(J=T.current)==null||J.dispatchEvent(new Event("input"));const O=(oe=T.current)==null?void 0:oe.selectionStart,X=(re=T.current)==null?void 0:re.selectionEnd,Z=(ce=T.current)==null?void 0:ce.selectionDirection;O!==null&&X!==null&&O!==void 0&&X!==void 0&&(R(O),_(X),P.current.prev=[O,X,Z||"none"])})},[k,w]),{value:k,setValue:$,isFocused:w,setIsFocused:j,isHovered:C,setIsHovered:I,inputRef:T,containerRef:W,mirrorSelectionStart:M,mirrorSelectionEnd:V,setMirrorSelectionStart:R,setMirrorSelectionEnd:_,setInputRef:E,handleChange:H,handleFocus:L,handleBlur:A,handleKeyDown:F,handleKeyPress:D,handlePaste:q}},Tu=u.createContext({slots:[],isFocused:!1,isHovering:!1}),Mu=`
7
7
  @keyframes blink {
8
8
  0%, 100% { opacity: 1; }
9
9
  50% { opacity: 0; }
@@ -22,17 +22,17 @@
22
22
  border-radius: 4px !important;
23
23
  width: 100% !important;
24
24
  }
25
- `;function Fe(e,o){try{e.insertRule(o)}catch{console.error("input-otp could not insert CSS rule:",o)}}const Vn=({id:e,name:o,label:t,value:n="",length:i=6,onChange:a,onChangeText:l,onComplete:d,helperText:s,placeholder:g="",shadow:p,views:m={},size:h="md",shape:f="rounded",variant:x="outline",gap:y=8,type:b="text",error:k=!1,isFocused:C=!1,isHovered:w=!1,isDisabled:j=!1,isReadOnly:S=!1,isAutoFocus:I=!1,setValue:M,setIsFocused:z,setIsHovered:E,inputRef:_,containerRef:T,mirrorSelectionStart:$,mirrorSelectionEnd:B,setMirrorSelectionStart:R,setMirrorSelectionEnd:V,handlePaste:W,handleChange:P,handleFocus:H,handleBlur:L,handleKeyDown:A,handleKeyPress:F,secureTextEntry:D,isFirstColumn:O,stepValues:K,setInputRef:Y,onBlur:N=()=>{},onClick:X=()=>{},onFocus:Z=()=>{},...J})=>{c.useTheme();const oe=!!t,re=u.useMemo(()=>({slots:Array.from({length:i}).map((U,G)=>{const ee=C&&$!==null&&B!==null&&($===B&&G===$||G>=$&&G<B),v=n[G]!==void 0?n[G]:null,Q=n[0]!==void 0?null:(g==null?void 0:g[G])??null;return{char:v,placeholderChar:Q,isActive:ee,hasFakeCaret:ee&&v===null}}),isFocused:C,isHovering:!j&&w}),[C,w,j,i,B,$,g,n]);u.useEffect(()=>{I&&_.current&&_.current.focus()},[I,_]),u.useEffect(()=>{if(!document.getElementById("input-otp-style")){const U=document.createElement("style");if(U.id="input-otp-style",document.head.appendChild(U),U.sheet){const G="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";Fe(U.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),Fe(U.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Fe(U.sheet,`[data-input-otp]:autofill { ${G} }`),Fe(U.sheet,`[data-input-otp]:-webkit-autofill { ${G} }`),Fe(U.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),Fe(U.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const ce=()=>r.jsx(c.Horizontal,{gap:y,width:"100%",justifyContent:"center",minHeight:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...m.container,children:re.slots.map((U,G)=>r.jsxs(Ve,{size:h,error:k,shape:f,views:m,variant:x,value:U.char||"",color:"theme-primary",isHovered:w,isDisabled:j,isReadOnly:S,isFocused:U.isActive,showLabel:!1,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),justifyContent:"center",alignItems:"center",width:"100%",position:"relative",height:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...m.container,children:[U.char?r.jsx(c.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",fontWeight:"medium",...m.text,children:b==="password"?"•":U.char}):U.placeholderChar?r.jsx(c.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",color:"color-gray-400",opacity:.5,...m.text,children:U.placeholderChar}):null,U.hasFakeCaret&&r.jsx(c.View,{position:"absolute",width:"2px",height:"60%",backgroundColor:"theme-primary",animation:"blink 1s step-start infinite",style:{animationName:"blink",animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"step-start"}})]},`${e||o}-${G}`))}),me={position:"absolute",inset:0,width:"100%",height:"100%",display:"flex",textAlign:"center",opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"};return r.jsxs(r.Fragment,{children:[r.jsx("noscript",{children:r.jsx("style",{children:ku})}),r.jsxs(we,{helperText:s,error:k,views:m,...J,children:[oe&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:k,...m.label,children:t}),r.jsxs(c.View,{ref:T,"data-input-otp-container":!0,position:"relative",cursor:j?"default":"text",userSelect:"none",pointerEvents:"none",children:[r.jsx(yu.Provider,{value:re,children:ce()}),r.jsx(c.View,{position:"absolute",inset:0,pointerEvents:"none",children:r.jsx(c.Input,{ref:U=>Y(U),"data-input-otp":!0,"data-input-otp-placeholder-shown":n.length===0||void 0,"data-input-otp-mss":$,"data-input-otp-mse":B,id:e||o,name:o,type:b==="password"?"password":"text",inputMode:b!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:i,readOnly:S,disabled:j,placeholder:g,value:n,onChange:P,onKeyDown:A,onPaste:W,onFocus:H,onBlur:L,onClick:X,onMouseOver:()=>E(!0),onMouseLeave:()=>E(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${i} digits`,style:me,...m.input})})]})]})]})},ju=e=>{const{value:o}=e,{value:t,setValue:n,isFocused:i,setIsFocused:a,isHovered:l,setIsHovered:d,inputRef:s,containerRef:g,mirrorSelectionStart:p,mirrorSelectionEnd:m,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:x,handleChange:y,handleFocus:b,handleBlur:k,handleKeyDown:C,handlePaste:w,handleKeyPress:j}=Rn(e),S=o!==void 0?o:t;return r.jsx(Vn,{...e,value:S,setValue:n,isFocused:i,setIsFocused:a,isHovered:l,setIsHovered:d,inputRef:s,containerRef:g,mirrorSelectionStart:p,mirrorSelectionEnd:m,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:x,handleChange:y,handleFocus:b,handleBlur:k,handleKeyDown:C,handleKeyPress:j,handlePaste:w,stepValues:e.stepValues})},Cu=ju,En=u.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Su=()=>u.useContext(En),wu=({children:e,autoFocus:o=!1,initFocus:t,onChange:n=()=>{},...i})=>{const a=be.useFormikContext();u.useEffect(()=>{n(a.values)},[a.values]);const l=u.useRef({}),d=u.useRef([]),s=(m,h)=>{l.current[m]=h,d.current.includes(m)||d.current.push(m)},g=m=>{var h;if(o){const x=d.current.indexOf(m)+1;x<d.current.length?(h=l.current[d.current[x]])==null||h.focus():a.onSubmit&&a.onSubmit(a.values)}},p={active:o,focusNextInput:g,setInputRef:s,handleSubmitEditing:g,getReturnKeyType:m=>d.current.indexOf(m)===d.current.length-1?"done":"next"};return u.useEffect(()=>{var m,h;o&&(t&&l.current[t]?(m=l.current[t])==null||m.focus():d.current[0]&&((h=l.current[d.current[0]])==null||h.focus()))},[o,t]),r.jsx(En.Provider,{value:p,children:r.jsx(c.Form,{...i,children:e})})},Iu=e=>{switch(e){case"email":return{autoCorrect:"off",inputMode:"email",autoCapitalize:"none"};case"password":return{autoCorrect:"off",secureTextEntry:!0,autoCapitalize:"none"};case"digits":return{inputMode:"tel"};case"numeric":return{inputMode:"numeric"};case"name":return{autoCorrect:"off"};default:return{}}},ue=({name:e,type:o,...t})=>{const n=Su(),{touched:i,errors:a,submitCount:l,values:d,setFieldTouched:s,setFieldValue:g}=be.useFormikContext(),p=k=>{var C;g(e,k),(C=t.onChangeText)==null||C.call(t,k)},m=k=>{var C;g(e,k),(C=t.onChange)==null||C.call(t,k)},h=()=>{s(e,!0)},f=k=>{k.key==="Enter"&&(k.preventDefault(),n.focusNextInput(e))},x=["text","password","email","digits"].includes(o),y=be.getIn(i,e)||l>0?be.getIn(a,e):void 0,b=be.getIn(d,e);return{...Iu(o),...t,value:b,error:y,onBlur:h,onKeyPress:f,...x?{onChangeText:p}:{onChange:m},...n.active?{handleKeyPress:f}:{}}},Tu=e=>{let{value:o,...t}=ue(e);t.isChecked=o;const n=pn(e);return r.jsx(mn,{...n,...t})},Mu=Tu,zu=({defaultIsSelected:e=!1,isChecked:o})=>{const[t,n]=u.useState(!1),[i,a]=u.useState(o!==void 0?o:e);return u.useEffect(()=>{o!==void 0&&a(o)},[o]),{isHovered:t,setIsHovered:n,isSelected:i,setIsSelected:a}},Ru={xs:{height:"16px",width:"16px"},sm:{height:"20px",width:"20px"},md:{height:"24px",width:"24px"},lg:{height:"28px",width:"28px"},xl:{height:"32px",width:"32px"}},Vu={xs:{height:"8px",width:"8px"},sm:{height:"10px",width:"10px"},md:{height:"12px",width:"12px"},lg:{height:"14px",width:"14px"},xl:{height:"16px",width:"16px"}},Eu={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{backgroundColor:"transparent",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300"}},Pu={selected:{backgroundColor:"theme-primary"},unselected:{backgroundColor:"transparent"}},lt={hover:{selected:{borderColor:"color-blue-600"},unselected:{borderColor:"color-gray-400"}},disabled:{selected:{borderColor:"color-gray-300",opacity:.6},unselected:{borderColor:"color-gray-300",opacity:.6}},error:{selected:{borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"}}},ct={hover:{selected:{backgroundColor:"color-blue-600"},unselected:{backgroundColor:"transparent"}},disabled:{selected:{backgroundColor:"color-gray-300",opacity:.6},unselected:{backgroundColor:"transparent",opacity:.6}},error:{selected:{backgroundColor:"color-red-500"},unselected:{backgroundColor:"transparent"}}},Wu=({id:e,icon:o,name:t,label:n,value:i,isChecked:a,onChange:l,onValueChange:d,shadow:s={},labelPosition:g="right",size:p="md",error:m=!1,isSelected:h=!1,isHovered:f=!1,isDisabled:x=!1,isReadOnly:y=!1,defaultIsSelected:b=!1,setIsSelected:k=()=>{},setIsHovered:C=()=>{},views:w={radio:{},label:{}},infoText:j,helperText:S,...I})=>{const M=()=>C(!f),z=()=>{!y&&!x&&(k&&k(!0),l&&l(i),d&&d(i))},E=a||h?"selected":"unselected",_=m?lt.error[E]:x?lt.disabled[E]:f?lt.hover[E]:{},T=m?ct.error[E]:x?ct.disabled[E]:f?ct.hover[E]:{},$={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:m?"color-red-600":x?"color-gray-400":"color-gray-700",cursor:x?"not-allowed":y?"default":"pointer",opacity:x?.6:1,transition:"all 0.2s ease",...w.label},radio:{...Eu[E],..._,borderRadius:"50%",backgroundColor:"color-white",...Ru[p],transition:"all 0.2s ease",...s,...w.radio},dot:{...Pu[E],...T,borderRadius:"50%",...Vu[p],transition:"all 0.2s ease"}};return r.jsxs(ho,{htmlFor:e,as:"div",onClick:z,onMouseEnter:M,onMouseLeave:M,size:c.Typography.fontSizes[p],...$.container,...I,children:[r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsxs(c.Horizontal,{gap:12,alignItems:"center",children:[" ",g==="left"&&n&&r.jsx(c.Text,{size:p,fontWeight:"500",...w==null?void 0:w.label,children:n}),r.jsx(c.Center,{...$.radio,children:(a||h)&&r.jsx(c.View,{...$.dot})}),g==="right"&&n&&r.jsx(c.Text,{size:p,fontWeight:"500",...w==null?void 0:w.label,children:n})]}),j&&r.jsx(c.Text,{marginLeft:g==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15px",...w==null?void 0:w.infoText,children:j})]}),m&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:m})]})},_u=e=>{let{value:o,...t}=ue(e);t.isChecked=o===e.value;const n=zu(e);return r.jsx(Wu,{...n,...t})},$u=_u,Pn=e=>{const{value:o,onChange:t,onSubmit:n,autoFocus:i=!0,loading:a=!1,disabled:l=!1,isAgentRunning:d=!1,onStopAgent:s,sandboxId:g,onUploadProgress:p,onUploadSuccess:m,onUploadError:h,onFileUpload:f}=e,x=o!==void 0&&t!==void 0,[y,b]=u.useState(""),k=x?o:y,[C,w]=u.useState([]),[j,S]=u.useState([]),[I,M]=u.useState(!1),[z,E]=u.useState(0),[_,T]=u.useState([]),[$,B]=u.useState(!1),R=u.useRef(null),[V,W]=u.useState(!1),[P,H]=u.useState("gpt-4"),[L]=u.useState([{id:"gpt-3.5-turbo",name:"GPT-3.5"},{id:"gpt-4",name:"GPT-4"},{id:"gpt-4-thinking",name:"GPT-4 (Thinking)",isThinking:!0},{id:"claude-3-5-sonnet",name:"Claude 3.5 Sonnet"}]),A=u.useRef(null),F=u.useRef(null),[D,O]=u.useState(e.showGuideTip||!1);u.useEffect(()=>{i&&A.current&&A.current.focus()},[i]),u.useEffect(()=>()=>{C.forEach(v=>{})},[C]);const K=v=>{x&&t?t(v):b(v)},Y=v=>{if(v.preventDefault(),!k.trim()&&C.length===0||a||l&&!d)return;if(d&&s){s();return}let Q=k;if(C.length>0){const pe=C.map(xe=>`[Uploaded File: ${URL.createObjectURL(xe)}}]`).join(`
25
+ `;function Fe(e,o){try{e.insertRule(o)}catch{console.error("input-otp could not insert CSS rule:",o)}}const Vn=({id:e,name:o,label:t,value:n="",length:i=6,onChange:a,onChangeText:l,onComplete:d,helperText:s,placeholder:g="",shadow:p,views:m={},size:h="md",shape:f="rounded",variant:x="outline",gap:y=8,type:b="text",error:k=!1,isFocused:S=!1,isHovered:w=!1,isDisabled:j=!1,isReadOnly:C=!1,isAutoFocus:I=!1,setValue:M,setIsFocused:R,setIsHovered:V,inputRef:_,containerRef:T,mirrorSelectionStart:W,mirrorSelectionEnd:B,setMirrorSelectionStart:P,setMirrorSelectionEnd:z,handlePaste:$,handleChange:E,handleFocus:H,handleBlur:L,handleKeyDown:A,handleKeyPress:F,secureTextEntry:D,isFirstColumn:q,stepValues:K,setInputRef:Y,onBlur:O=()=>{},onClick:X=()=>{},onFocus:Z=()=>{},...J})=>{c.useTheme();const oe=!!t,re=u.useMemo(()=>({slots:Array.from({length:i}).map((U,G)=>{const ee=S&&W!==null&&B!==null&&(W===B&&G===W||G>=W&&G<B),v=n[G]!==void 0?n[G]:null,Q=n[0]!==void 0?null:(g==null?void 0:g[G])??null;return{char:v,placeholderChar:Q,isActive:ee,hasFakeCaret:ee&&v===null}}),isFocused:S,isHovering:!j&&w}),[S,w,j,i,B,W,g,n]);u.useEffect(()=>{I&&_.current&&_.current.focus()},[I,_]),u.useEffect(()=>{if(!document.getElementById("input-otp-style")){const U=document.createElement("style");if(U.id="input-otp-style",document.head.appendChild(U),U.sheet){const G="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";Fe(U.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),Fe(U.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Fe(U.sheet,`[data-input-otp]:autofill { ${G} }`),Fe(U.sheet,`[data-input-otp]:-webkit-autofill { ${G} }`),Fe(U.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),Fe(U.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const ce=()=>r.jsx(c.Horizontal,{gap:y,width:"100%",justifyContent:"center",minHeight:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...m.container,children:re.slots.map((U,G)=>r.jsxs(Ve,{size:h,error:k,shape:f,views:m,variant:x,value:U.char||"",color:"theme-primary",isHovered:w,isDisabled:j,isReadOnly:C,isFocused:U.isActive,showLabel:!1,onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),justifyContent:"center",alignItems:"center",width:"100%",position:"relative",height:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...m.container,children:[U.char?r.jsx(c.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",fontWeight:"medium",...m.text,children:b==="password"?"•":U.char}):U.placeholderChar?r.jsx(c.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",color:"color-gray-400",opacity:.5,...m.text,children:U.placeholderChar}):null,U.hasFakeCaret&&r.jsx(c.View,{position:"absolute",width:"2px",height:"60%",backgroundColor:"theme-primary",animation:"blink 1s step-start infinite",style:{animationName:"blink",animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"step-start"}})]},`${e||o}-${G}`))}),me={position:"absolute",inset:0,width:"100%",height:"100%",display:"flex",textAlign:"center",opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"};return r.jsxs(r.Fragment,{children:[r.jsx("noscript",{children:r.jsx("style",{children:Mu})}),r.jsxs(we,{helperText:s,error:k,views:m,...J,children:[oe&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:k,...m.label,children:t}),r.jsxs(c.View,{ref:T,"data-input-otp-container":!0,position:"relative",cursor:j?"default":"text",userSelect:"none",pointerEvents:"none",children:[r.jsx(Tu.Provider,{value:re,children:ce()}),r.jsx(c.View,{position:"absolute",inset:0,pointerEvents:"none",children:r.jsx(c.Input,{ref:U=>Y(U),"data-input-otp":!0,"data-input-otp-placeholder-shown":n.length===0||void 0,"data-input-otp-mss":W,"data-input-otp-mse":B,id:e||o,name:o,type:b==="password"?"password":"text",inputMode:b!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:i,readOnly:C,disabled:j,placeholder:g,value:n,onChange:E,onKeyDown:A,onPaste:$,onFocus:H,onBlur:L,onClick:X,onMouseOver:()=>V(!0),onMouseLeave:()=>V(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${i} digits`,style:me,...m.input})})]})]})]})},zu=e=>{const{value:o}=e,{value:t,setValue:n,isFocused:i,setIsFocused:a,isHovered:l,setIsHovered:d,inputRef:s,containerRef:g,mirrorSelectionStart:p,mirrorSelectionEnd:m,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:x,handleChange:y,handleFocus:b,handleBlur:k,handleKeyDown:S,handlePaste:w,handleKeyPress:j}=Rn(e),C=o!==void 0?o:t;return r.jsx(Vn,{...e,value:C,setValue:n,isFocused:i,setIsFocused:a,isHovered:l,setIsHovered:d,inputRef:s,containerRef:g,mirrorSelectionStart:p,mirrorSelectionEnd:m,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:x,handleChange:y,handleFocus:b,handleBlur:k,handleKeyDown:S,handleKeyPress:j,handlePaste:w,stepValues:e.stepValues})},Ru=zu,En=u.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Vu=()=>u.useContext(En),Eu=({children:e,autoFocus:o=!1,initFocus:t,onChange:n=()=>{},...i})=>{const a=be.useFormikContext();u.useEffect(()=>{n(a.values)},[a.values]);const l=u.useRef({}),d=u.useRef([]),s=(m,h)=>{l.current[m]=h,d.current.includes(m)||d.current.push(m)},g=m=>{var h;if(o){const x=d.current.indexOf(m)+1;x<d.current.length?(h=l.current[d.current[x]])==null||h.focus():a.onSubmit&&a.onSubmit(a.values)}},p={active:o,focusNextInput:g,setInputRef:s,handleSubmitEditing:g,getReturnKeyType:m=>d.current.indexOf(m)===d.current.length-1?"done":"next"};return u.useEffect(()=>{var m,h;o&&(t&&l.current[t]?(m=l.current[t])==null||m.focus():d.current[0]&&((h=l.current[d.current[0]])==null||h.focus()))},[o,t]),r.jsx(En.Provider,{value:p,children:r.jsx(c.Form,{...i,children:e})})},Pu=e=>{switch(e){case"email":return{autoCorrect:"off",inputMode:"email",autoCapitalize:"none"};case"password":return{autoCorrect:"off",secureTextEntry:!0,autoCapitalize:"none"};case"digits":return{inputMode:"tel"};case"numeric":return{inputMode:"numeric"};case"name":return{autoCorrect:"off"};default:return{}}},ue=({name:e,type:o,...t})=>{const n=Vu(),{touched:i,errors:a,submitCount:l,values:d,setFieldTouched:s,setFieldValue:g}=be.useFormikContext(),p=k=>{var S;g(e,k),(S=t.onChangeText)==null||S.call(t,k)},m=k=>{var S;g(e,k),(S=t.onChange)==null||S.call(t,k)},h=()=>{s(e,!0)},f=k=>{k.key==="Enter"&&(k.preventDefault(),n.focusNextInput(e))},x=["text","password","email","digits"].includes(o),y=be.getIn(i,e)||l>0?be.getIn(a,e):void 0,b=be.getIn(d,e);return{...Pu(o),...t,value:b,error:y,onBlur:h,onKeyPress:f,...x?{onChangeText:p}:{onChange:m},...n.active?{handleKeyPress:f}:{}}},Wu=e=>{let{value:o,...t}=ue(e);t.isChecked=o;const n=pn(e);return r.jsx(mn,{...n,...t})},_u=Wu,$u=({defaultIsSelected:e=!1,isChecked:o})=>{const[t,n]=u.useState(!1),[i,a]=u.useState(o!==void 0?o:e);return u.useEffect(()=>{o!==void 0&&a(o)},[o]),{isHovered:t,setIsHovered:n,isSelected:i,setIsSelected:a}},Hu={xs:{height:"16px",width:"16px"},sm:{height:"20px",width:"20px"},md:{height:"24px",width:"24px"},lg:{height:"28px",width:"28px"},xl:{height:"32px",width:"32px"}},Bu={xs:{height:"8px",width:"8px"},sm:{height:"10px",width:"10px"},md:{height:"12px",width:"12px"},lg:{height:"14px",width:"14px"},xl:{height:"16px",width:"16px"}},Lu={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{backgroundColor:"transparent",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300"}},Au={selected:{backgroundColor:"theme-primary"},unselected:{backgroundColor:"transparent"}},it={hover:{selected:{borderColor:"color-blue-600"},unselected:{borderColor:"color-gray-400"}},disabled:{selected:{borderColor:"color-gray-300",opacity:.6},unselected:{borderColor:"color-gray-300",opacity:.6}},error:{selected:{borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"}}},lt={hover:{selected:{backgroundColor:"color-blue-600"},unselected:{backgroundColor:"transparent"}},disabled:{selected:{backgroundColor:"color-gray-300",opacity:.6},unselected:{backgroundColor:"transparent",opacity:.6}},error:{selected:{backgroundColor:"color-red-500"},unselected:{backgroundColor:"transparent"}}},Du=({id:e,icon:o,name:t,label:n,value:i,isChecked:a,onChange:l,onValueChange:d,shadow:s={},labelPosition:g="right",size:p="md",error:m=!1,isSelected:h=!1,isHovered:f=!1,isDisabled:x=!1,isReadOnly:y=!1,defaultIsSelected:b=!1,setIsSelected:k=()=>{},setIsHovered:S=()=>{},views:w={radio:{},label:{}},infoText:j,helperText:C,...I})=>{const M=()=>S(!f),R=()=>{!y&&!x&&(k&&k(!0),l&&l(i),d&&d(i))},V=a||h?"selected":"unselected",_=m?it.error[V]:x?it.disabled[V]:f?it.hover[V]:{},T=m?lt.error[V]:x?lt.disabled[V]:f?lt.hover[V]:{},W={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:m?"color-red-600":x?"color-gray-400":"color-gray-700",cursor:x?"not-allowed":y?"default":"pointer",opacity:x?.6:1,transition:"all 0.2s ease",...w.label},radio:{...Lu[V],..._,borderRadius:"50%",backgroundColor:"color-white",...Hu[p],transition:"all 0.2s ease",...s,...w.radio},dot:{...Au[V],...T,borderRadius:"50%",...Bu[p],transition:"all 0.2s ease"}};return r.jsxs(ho,{htmlFor:e,as:"div",onClick:R,onMouseEnter:M,onMouseLeave:M,size:c.Typography.fontSizes[p],...W.container,...I,children:[r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsxs(c.Horizontal,{gap:12,alignItems:"center",children:[" ",g==="left"&&n&&r.jsx(c.Text,{size:p,fontWeight:"500",...w==null?void 0:w.label,children:n}),r.jsx(c.Center,{...W.radio,children:(a||h)&&r.jsx(c.View,{...W.dot})}),g==="right"&&n&&r.jsx(c.Text,{size:p,fontWeight:"500",...w==null?void 0:w.label,children:n})]}),j&&r.jsx(c.Text,{marginLeft:g==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15px",...w==null?void 0:w.infoText,children:j})]}),m&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:m})]})},Fu=e=>{let{value:o,...t}=ue(e);t.isChecked=o===e.value;const n=$u(e);return r.jsx(Du,{...n,...t})},Ou=Fu,Pn=e=>{const{value:o,onChange:t,onSubmit:n,autoFocus:i=!0,loading:a=!1,disabled:l=!1,isAgentRunning:d=!1,onStopAgent:s,sandboxId:g,onUploadProgress:p,onUploadSuccess:m,onUploadError:h,onFileUpload:f}=e,x=o!==void 0&&t!==void 0,[y,b]=u.useState(""),k=x?o:y,[S,w]=u.useState([]),[j,C]=u.useState([]),[I,M]=u.useState(!1),[R,V]=u.useState(0),[_,T]=u.useState([]),[W,B]=u.useState(!1),P=u.useRef(null),[z,$]=u.useState(!1),[E,H]=u.useState("gpt-4"),[L]=u.useState([{id:"gpt-3.5-turbo",name:"GPT-3.5"},{id:"gpt-4",name:"GPT-4"},{id:"gpt-4-thinking",name:"GPT-4 (Thinking)",isThinking:!0},{id:"claude-3-5-sonnet",name:"Claude 3.5 Sonnet"}]),A=u.useRef(null),F=u.useRef(null),[D,q]=u.useState(e.showGuideTip||!1);u.useEffect(()=>{i&&A.current&&A.current.focus()},[i]),u.useEffect(()=>()=>{S.forEach(v=>{})},[S]);const K=v=>{x&&t?t(v):b(v)},Y=v=>{if(v.preventDefault(),!k.trim()&&S.length===0||a||l&&!d)return;if(d&&s){s();return}let Q=k;if(S.length>0){const pe=S.map(xe=>`[Uploaded File: ${URL.createObjectURL(xe)}}]`).join(`
26
26
  `);Q=Q?`${Q}
27
27
 
28
- ${pe}`:pe}let le=P,se=!1;P.endsWith("-thinking")&&(le=P.replace(/-thinking$/,""),se=!0),n(Q,{model_name:le,enable_thinking:se}),x||b(""),w([]),S([])},N=v=>{w(Q=>Q.filter((le,se)=>se!==v)),!g&&j.length>v&&S(Q=>Q.filter((le,se)=>se!==v))},X=v=>{v.preventDefault(),v.stopPropagation(),W(!0)},Z=v=>{v.preventDefault(),v.stopPropagation(),W(!1)},J=u.useCallback(v=>{!v||v.length===0||(S(Q=>[...Q,...v]),w(Q=>[...Q,...v]),T(Q=>[...Q,...v]),M(!0))},[S,w]),oe=u.useCallback(()=>{if(_.length>0&&!$&&f){B(!0);const v=_[0];R.current=v,E(0);try{f(v)}catch(Q){T(le=>le.slice(1)),B(!1),R.current=null,E(0),M(le=>_.length-1>0||!1),h==null||h(Q)}}else _.length===0&&I&&(M(!1),E(0))},[_,$,f,I,h]);u.useEffect(()=>{oe()},[_,$,oe]);const re="active",ce=v=>!0,me=()=>{O(!1),e.onGuideClose&&e.onGuideClose()},U=v=>{x&&t?t(v.text):b(v.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(v),A.current&&A.current.focus()},G=u.useCallback(()=>j,[j]),ee=u.useCallback(()=>S([]),[]);return{onSubmit:n,getPendingFiles:G,clearPendingFiles:ee,value:k,handleChange:K,handleSubmit:Y,editableRef:A,fileInputRef:F,isUploading:I,uploadProgress:z,isDraggingOver:V,uploadedFiles:C,pendingFiles:j,removeUploadedFile:N,setPendingFiles:S,setUploadedFiles:w,setIsUploading:M,startUpload:J,selectedModel:P,handleModelChange:H,modelOptions:L,subscriptionStatus:re,canAccessModel:ce,handleDragOver:X,handleDragLeave:Z,isGuideTipShown:D,hideGuideTip:me,handlePromptExampleSelect:U}},Hu={attachmentRemove:{position:"absolute",top:"2px",right:"2px",width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"color-black-900",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",zIndex:1}},cr={container:{width:"100%",maxWidth:"100%",borderRadius:"12px",backgroundColor:"color-white",transition:"all 0.2s ease",media:{mobile:{borderRadius:"8px"}}},content:{width:"100%",padding:"12px",borderRadius:"12px",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",media:{mobile:{padding:"10px",borderRadius:"8px"}}}},Bu={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},Lu={xs:{fontSize:"10px",padding:"4px 8px"},sm:{fontSize:"12px",padding:"6px 10px"},md:{fontSize:"14px",padding:"8px 12px"},lg:{fontSize:"16px",padding:"10px 14px"},xl:{fontSize:"20px",padding:"12px 16px"}},Au={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"},none:{backgroundColor:"transparent",border:"none"}},sr=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,Du=({openDelay:e=200,closeDelay:o=300}={})=>{const[t,n]=u.useState(!1),i=u.useRef(null),a=u.useRef(null),l=u.useRef(null),d=u.useRef(null),s=u.useMemo(()=>sr("hovercard-content"),[]),g=u.useMemo(()=>sr("hovercard-trigger"),[]),p=u.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),m=u.useCallback(()=>{p(),t||(i.current=setTimeout(()=>{n(!0)},e))},[t,e,p]),h=u.useCallback(()=>{p(),t&&(a.current=setTimeout(()=>{n(!1)},o))},[t,o,p]),f=u.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null)},[]);return u.useEffect(()=>()=>p(),[p]),{isOpen:t,openCard:m,closeCard:h,cancelCloseTimer:f,triggerRef:l,contentRef:d,contentId:s,triggerId:g}},Wn=u.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Fu=({children:e,value:o})=>r.jsx(Wn.Provider,{value:o,children:e}),_n=()=>{const e=u.useContext(Wn);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},Ou=({children:e,views:o,asChild:t=!1,...n})=>{const{openCard:i,closeCard:a,triggerRef:l,contentId:d,triggerId:s}=_n(),f={ref:l,onMouseEnter:()=>i(),onMouseLeave:()=>a(),onFocus:()=>i(),onBlur:()=>a(),id:s,"aria-describedby":d,...o==null?void 0:o.container,...n};if(t&&u.isValidElement(e)){const x=u.Children.only(e);return u.cloneElement(x,{...f,...x.props})}return r.jsx(c.View,{position:"relative",display:"inline-block",...f,children:e})},qu=({children:e,views:o,side:t="bottom",align:n="center",sideOffset:i=8,style:a,backgroundColor:l="white",borderRadius:d="4px",boxShadow:s="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:g="12px",minWidth:p="50px",maxWidth:m="300px",...h})=>{const{isOpen:f,cancelCloseTimer:x,closeCard:y,contentRef:b,triggerRef:k,contentId:C,triggerId:w}=_n(),{ref:j,relation:S}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});u.useEffect(()=>{k!=null&&k.current&&(j==null?void 0:j.current)!==k.current&&j&&(j.current=k.current)},[k,j,f]);const I=()=>x(),M=()=>y();if(!f)return null;const z=()=>{if(!S||!(k!=null&&k.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const T=k.current.getBoundingClientRect();let $=t;t==="bottom"&&S.space.vertical==="top"?$="top":t==="top"&&S.space.vertical==="bottom"?$="bottom":t==="right"&&S.space.horizontal==="left"?$="left":t==="left"&&S.space.horizontal==="right"&&($="right");let B=0,R=0;switch($){case"bottom":B=T.left+T.width/2,R=T.bottom+i;break;case"top":B=T.left+T.width/2,R=T.top-i;break;case"right":B=T.right+i,R=T.top+T.height/2;break;case"left":B=T.left-i,R=T.top+T.height/2;break}return{position:"fixed",left:B,top:R,zIndex:1e3,transform:E($)}},E=T=>{switch(T){case"bottom":return"translate(-50%, 0)";case"top":return"translate(-50%, -100%)";case"right":return"translate(0, -50%)";case"left":return"translate(-100%, -50%)";default:return"translate(-50%, 0)"}},_=z();return r.jsx(c.View,{ref:b,id:C,role:"tooltip","aria-labelledby":w,onMouseEnter:I,onMouseLeave:M,backgroundColor:l,borderRadius:d,boxShadow:s,padding:g,minWidth:p,maxWidth:m,style:{..._,...a},...o==null?void 0:o.container,...h,children:e})},Nu=({children:e,views:o,openDelay:t,closeDelay:n,...i})=>{const a=Du({openDelay:t,closeDelay:n});return r.jsx(Fu,{value:a,children:r.jsx(c.View,{position:"relative",display:"inline-block",...o==null?void 0:o.container,...i,children:e})})},he=Nu;he.Trigger=Ou;he.Content=qu;const Uu=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:i="120px",showPreviews:a=!1,views:l={}})=>{if(e.length===0)return null;const d=u.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(c.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:i,overflowY:"auto",...l==null?void 0:l.container,children:e.map((s,g)=>{const p=URL.createObjectURL(s)||(s==null?void 0:s.path)||(s==null?void 0:s.url)||"",m=s.type.startsWith("image/"),h=s.type.startsWith("video/"),f=s.type.startsWith("audio/");return r.jsx(c.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...l==null?void 0:l.item,children:a&&r.jsxs(he,{children:[r.jsxs(he.Trigger,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,width:"60px",height:"60px",objectFit:"cover"}),h&&r.jsx(c.View,{as:"video",src:p,alt:s.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(Fo,{widthHeight:24,color:"color-black"})}),!m&&!h&&!f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(go,{widthHeight:24,color:"color-black"})}),t&&r.jsx(c.Button,{...Hu.attachmentRemove,onClick:x=>{x.stopPropagation(),t(g)},"aria-label":`Remove ${s.name}`,children:"×"})]}),r.jsxs(he.Content,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,maxWidth:"100%"}),h&&r.jsx(c.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),f&&r.jsx(c.View,{as:"audio",src:p,controls:!0,width:"100%"}),r.jsxs(c.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...l==null?void 0:l.name,children:[s.name," (",d(s.size),")"]})]})]})},g)})})},$n=u.forwardRef(({value:e,onChange:o,placeholder:t="Type your message...",disabled:n=!1,autoFocus:i=!0,suggestions:a=[],onSuggestionSelect:l,showSuggestions:d=!1,mentionData:s=[],mentionTrigger:g="@",onMentionSelect:p,maxHeight:m="200px",minHeight:h="40px",views:f={}},x)=>{var ce,me;const y=u.useRef(e),[b,k]=u.useState(-1),[C,w]=u.useState(!e),j=u.useRef(null),[S,I]=u.useState(!1),[M,z]=u.useState(!1),[E,_]=u.useState(""),[T,$]=u.useState(-1),[B,R]=u.useState(-1),[V,W]=u.useState([]),{ref:P,relation:H}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[L,A]=u.useState({x:0,y:0}),[F,D]=u.useState({x:0,y:0});u.useEffect(()=>{const U=x;U.current&&e!==y.current&&(U.current.textContent=e,y.current=e,w(!e))},[e,x]),u.useEffect(()=>{i&&x&&typeof x=="object"&&x.current&&x.current.focus()},[i,x]);const O=()=>{const U=window.getSelection();if(!U||U.rangeCount===0)return-1;const G=U.getRangeAt(0),ee=G.cloneRange();return ee.selectNodeContents(x&&typeof x=="object"&&x.current?x.current:document.body),ee.setEnd(G.endContainer,G.endOffset),ee.toString().length},K=u.useCallback((U,G)=>{const ee=U.substring(0,G),v=ee.lastIndexOf(g);if(v!==-1){const Q=ee.substring(v+1);if(!Q.includes(" ")){const se=Q.toLowerCase(),pe=s.filter(ne=>ne.name.toLowerCase().includes(se));_(se),$(v),W(pe),z(pe.length>0),R(0);const xe=Y();A(xe);return}}z(!1),_(""),$(-1),R(-1)},[s,g]);u.useEffect(()=>{j.current&&P&&(P.current=j.current)},[j,P]);const Y=u.useCallback((U=200)=>{if(!j.current)return{x:0,y:0};const G=j.current.getBoundingClientRect();if(H){const le=H.space.vertical==="top";return{x:G.left,y:le?G.top-U-8:G.bottom+8}}const ee=window.innerHeight,v={top:G.top,bottom:ee-G.bottom},Q=v.bottom<U+8&&v.top>v.bottom;return{x:G.left,y:Q?G.top-U-8:G.bottom+8}},[H]),N=u.useCallback(()=>{I(!0);const U=Y();D(U)},[Y]),X=u.useCallback(()=>{setTimeout(()=>{I(!1),k(-1)},150)},[]),Z=U=>{const G=U.currentTarget.textContent||"";if(G!==y.current){o(G),y.current=G,w(!G);const ee=O();K(G,ee)}},J=u.useCallback(U=>{if(x&&typeof x=="object"&&x.current){const G=x.current.textContent||"",ee=G.substring(0,T),v=G.substring(T+g.length+E.length),Q=ee+g+U.name+" "+v;o(Q),y.current=Q,x.current.textContent=Q;const le=ee.length+g.length+U.name.length+1;setTimeout(()=>{var se;if(x.current){const pe=document.createRange(),xe=window.getSelection(),ne=x.current.firstChild;ne&&xe&&(pe.setStart(ne,Math.min(le,((se=ne.textContent)==null?void 0:se.length)||0)),pe.collapse(!0),xe.removeAllRanges(),xe.addRange(pe))}},0)}z(!1),_(""),$(-1),R(-1),p&&p(U)},[T,g,E,o,p,x]),oe=u.useCallback(U=>{l&&l(U),k(-1)},[l]),re=U=>{if(M&&V.length>0){if(U.key==="ArrowDown"){U.preventDefault(),R(G=>G<V.length-1?G+1:0);return}if(U.key==="ArrowUp"){U.preventDefault(),R(G=>G>0?G-1:V.length-1);return}if((U.key==="Tab"||U.key==="Enter")&&B>=0){U.preventDefault(),J(V[B]);return}if(U.key==="Escape"){z(!1),R(-1);return}}if(d&&a.length>0){if(U.key==="ArrowDown"){U.preventDefault(),k(G=>G<a.length-1?G+1:0);return}if(U.key==="ArrowUp"){U.preventDefault(),k(G=>G>0?G-1:a.length-1);return}if(U.key==="Tab"&&b>=0){U.preventDefault(),oe(a[b]);return}if(U.key==="Escape"){k(-1);return}}};return r.jsxs(c.View,{ref:j,width:"100%",position:"relative",...f==null?void 0:f.container,children:[r.jsxs(c.View,{width:"100%",minHeight:h,maxHeight:m,overflowY:"auto",position:"relative",children:[C&&r.jsx(c.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...f==null?void 0:f.placeholder,children:t}),r.jsx(c.View,{as:"div",ref:x,contentEditable:!n,suppressContentEditableWarning:!0,onInput:Z,onKeyDown:re,onFocus:N,onBlur:X,role:"textbox","aria-multiline":"true","aria-placeholder":t,width:"100%",minHeight:"24px",padding:"8px",outline:"none",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"14px",color:"color-gray-900",backgroundColor:"transparent",...f==null?void 0:f.input})]}),M&&V.length>0&&r.jsx(c.View,{position:"fixed",left:L.x,top:L.y,width:((ce=j.current)==null?void 0:ce.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-blue-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9999,maxHeight:"200px",overflowY:"auto",...f==null?void 0:f.mentionContainer,children:r.jsxs(c.Vertical,{gap:0,children:[V.map((U,G)=>r.jsx(c.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:G===B?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>J(U),onMouseEnter:()=>R(G),_hover:{backgroundColor:"color-blue-50"},...f==null?void 0:f.mentionItem,children:r.jsxs(c.Vertical,{gap:4,children:[r.jsxs(c.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[g,U.name]}),U.description&&r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",children:U.description})]})},U.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",g,")",H&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",H.space.vertical,"-",H.space.horizontal]})]})]})}),d&&a.length>0&&!M&&S&&!e&&r.jsx(c.View,{position:"fixed",left:F.x,top:F.y,width:((me=j.current)==null?void 0:me.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-green-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9998,maxHeight:"200px",overflowY:"auto",...f==null?void 0:f.suggestionsContainer,children:r.jsxs(c.Vertical,{gap:0,children:[a.map((U,G)=>r.jsx(c.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:G===b?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>oe(U),onMouseEnter:()=>k(G),_hover:{backgroundColor:"color-blue-50"},...f==null?void 0:f.suggestionItem,children:r.jsxs(c.Vertical,{gap:4,children:[r.jsx(c.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:U.text}),U.description&&r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",children:U.description})]})},U.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",H&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",H.space.vertical,"-",H.space.horizontal]})]})]})})]})});$n.displayName="EditableInput";const Gu=({examples:e,onSelect:o,views:t={}})=>{const{getColor:n}=c.useTheme();return!e||e.length===0?null:r.jsx(c.Horizontal,{gap:8,overflowX:"auto",padding:"8px 0",width:"100%",...t==null?void 0:t.container,children:e.map(i=>r.jsx(c.View,{as:"button",type:"button",padding:"8px 12px",borderRadius:"4px",backgroundColor:"color-gray-100",border:"none",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>o(i),_hover:{backgroundColor:"color-gray-200"},...t==null?void 0:t.item,children:r.jsx(c.Text,{fontSize:"14px",color:"color-gray-700",...t==null?void 0:t.text,children:i.text})},i.id))})},Yu=({onRecordingComplete:e,onRecordingStart:o,views:t={}})=>{const{recording:n,paused:i,audioBlob:a,analyserNode:l,startRecording:d,stopRecording:s}=Br();u.useEffect(()=>{if(a){const p=new File([a],`recording-${Date.now()}.webm`,{type:a.type||"audio/webm;codecs=opus"});e(p)}},[a]);const g=u.useCallback(()=>{d(),o==null||o()},[]);return r.jsxs(c.Horizontal,{alignItems:"center",gap:4,children:[r.jsx(c.View,{minWidth:90,children:n&&l&&r.jsx(Pt,{analyserNode:l,isPaused:i})}),r.jsx(c.View,{as:"button",type:"button",onClick:n?s:g,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n?"theme-error":"color-gray-100",color:n?"color-white":"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:n?"color-red-600":"color-gray-200"},...t.button,children:n?r.jsx(qo,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(It,{widthHeight:16,color:"currentColor",filled:!1})})]})},Hn=u.memo(({onSubmit:e,placeholder:o="Say what you want and Kimmy will surprise you",loading:t=!1,disabled:n=!1,isAgentRunning:i=!1,enableAudioRecording:a=!1,leftButtons:l,rightButtons:d,onStopAgent:s,loadingText:g="Agent is working...",autoFocus:p=!0,sandboxId:m,hideAttachments:h=!1,attachmentText:f="",promptExamples:x=[],suggestions:y=[],errorMessage:b,size:k="md",shape:C="rounded",variant:w="default",views:j={},mentionData:S=[],mentionTrigger:I="@",onMentionSelect:M,onAudioRecordingStart:z,onAudioRecordingStop:E,value:_,handleChange:T,handleSubmit:$,editableRef:B,fileInputRef:R,isUploading:V,uploadProgress:W,isDraggingOver:P,uploadedFiles:H,removeUploadedFile:L,setPendingFiles:A,setUploadedFiles:F,setIsUploading:D,startUpload:O,selectedModel:K,handleModelChange:Y,modelOptions:N,subscriptionStatus:X,canAccessModel:Z,isGuideTipShown:J,hideGuideTip:oe,handlePromptExampleSelect:re,handleDragOver:ce,handleDragLeave:me,onChange:U,...G})=>{c.useTheme();const ee=u.useMemo(()=>({...cr.container,...Bu[C],...j==null?void 0:j.container}),[C,j==null?void 0:j.container]),v=u.useMemo(()=>({...cr.content,...Lu[k],...Au[w],...j==null?void 0:j.content}),[k,w,j==null?void 0:j.content]),Q=((_==null?void 0:_.trim().length)??0)>0||H.length>0,le=u.useCallback(ne=>{O([ne]),E==null||E(ne)},[O,E]),se=u.useCallback(ne=>{const Ie=ne.filter(ye=>ye.size>52428800?(console.error(`File size exceeds 50MB limit: ${ye.name}`),!1):!0);Ie.length>0&&O(Ie)},[O]),pe=u.useCallback(ne=>{if(ne.preventDefault(),ne.stopPropagation(),me(ne),ne.dataTransfer.files.length>0){const Ie=Array.from(ne.dataTransfer.files);se(Ie)}},[me,se]),xe=u.useMemo(()=>[...S||[],...H.map((ne,Ie)=>({id:`file-${Ie}`,name:ne.name}))],[S,H]);return r.jsxs(c.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...ee,...G,onDragOver:ce,onDragLeave:me,onDrop:pe,children:[x.length>0&&r.jsx(Gu,{examples:x,onSelect:re,views:{container:j==null?void 0:j.promptExamples,item:j==null?void 0:j.promptExampleItem}}),i&&r.jsxs(c.Horizontal,{justifyContent:"center",alignItems:"center",gap:8,padding:"8px 0",animate:{from:{opacity:0,y:-10},to:{opacity:1,y:0},duration:"0.3s"},...j==null?void 0:j.loadingIndicator,children:[r.jsx(Mt,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(c.Text,{color:"color-gray-500",children:g})]}),r.jsx(c.View,{position:"relative",width:"100%",overflow:"visible",children:r.jsxs(c.View,{as:"form",onSubmit:$,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...v,...ee,paddingHorizontal:16,paddingVertical:10,backgroundColor:P?"color-blue-50":void 0,children:[r.jsx(Uu,{files:H,sandboxId:m,onRemove:L,showPreviews:!0,views:{container:j==null?void 0:j.attachments,item:j==null?void 0:j.attachmentItem,name:j==null?void 0:j.attachmentName,size:j==null?void 0:j.attachmentSize,removeButton:j==null?void 0:j.attachmentRemove}}),r.jsx($n,{ref:B,value:_||"",onChange:T,placeholder:o,disabled:n&&!i,autoFocus:p,suggestions:y||[],showSuggestions:y&&y.length>0&&!_,onSuggestionSelect:ne=>{T(ne.text)},mentionData:xe,mentionTrigger:I,onMentionSelect:M,views:{container:{},input:j==null?void 0:j.editableInput}}),r.jsxs(c.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[!h&&r.jsx(Yo,{accept:"*/*",icon:r.jsx(po,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:se,isLoading:V,progress:W||0,text:f,fileType:"file",renderError:({errorMessage:ne})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},...j==null?void 0:j.fileButton}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:C==="rounded"?"50%":4,padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:ne=>ne.size>50*1024*1024?"File size exceeds 50MB limit":null}),l]}),r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[a&&r.jsx(Yu,{onRecordingStart:z,onRecordingComplete:le,views:{button:j==null?void 0:j.recordButton}}),r.jsx(c.View,{as:"button",type:"button",onClick:$,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i?"theme-error":Q?"theme-primary":"color-gray-300",color:"color-white",borderRadius:C==="rounded"?"50%":4,border:"none",cursor:Q?"pointer":"not-allowed",disabled:!Q||t||n&&!i,transition:"all 0.2s ease",_hover:{backgroundColor:i?"color-red-600":Q?"color-blue-600":"color-gray-300"},...j==null?void 0:j.submitButton,children:i?r.jsx(qo,{widthHeight:16,color:"currentColor",filled:!1}):t?r.jsx(uo,{type:"quarter",size:16,color:"color-white"}):r.jsx(Tt,{widthHeight:16,color:"currentColor",filled:!1})}),d]})]})]})}),b&&r.jsx(c.Text,{color:"theme-error",marginTop:"4px",...j==null?void 0:j.bottomTip,children:b})]})}),vu=e=>{const{name:o,onSubmit:t,...n}=e,[i,a]=u.useState([]),l=ue({name:o,type:"text"}),d=h=>{l.onChangeText&&l.onChangeText(h)},s=(h,f)=>{t?t(h,f):d(h)},g=()=>i,p=()=>a([]),m=Pn({...n,value:l.value||"",onChange:d,onSubmit:s,getPendingFiles:g,clearPendingFiles:p});return r.jsx(Hn,{...n,...m,value:l.value||"",onChange:d,onSubmit:s,error:l.error,getPendingFiles:g,clearPendingFiles:p})},Xu=vu,Ku=e=>{const o=ue(e),t=hn(o);return r.jsx(fn,{...t,...o})},Qu=Ku,Zu=e=>{const o=ue(e),t=Cn();return r.jsx(Sn,{...t,...o})},Ju=Zu,eg=e=>{const o=ue(e),t=xn(e);return r.jsx(bn,{...t,...o})},og=eg,tg=e=>{let o=ue(e);o.selected=o.value;const t=en(e);return r.jsx(an,{...t,...o})},rg=tg,ng=e=>{const o=ue(e),t=ln(e);return r.jsx(cn,{...t,...o})},ag=ng,ig=e=>{const{name:o,...t}=e,{values:n,errors:i,touched:a,submitCount:l,setFieldValue:d,setFieldTouched:s}=be.useFormikContext(),g=be.getIn(n,o)||[],p=be.getIn(a,o)||l>0?be.getIn(i,o):void 0,m=u.useCallback(b=>{var C;const k=Array.isArray(b)?b.filter(w=>typeof w=="string"):[];d(o,k),(C=e.onTagsChange)==null||C.call(e,k)},[o,d,e.onTagsChange]),h=u.useCallback(()=>{var b;s(o,!0),(b=e.onBlur)==null||b.call(e)},[o,s,e.onBlur]),f=Mn({...t,tags:g,onTagsChange:m,onBlur:h}),{tags:x,...y}=f;return r.jsx(zn,{...y,...t,tags:x,error:p})},lg=ig,cg=e=>{const o=ue(e),t=un(e);return r.jsx(gn,{...t,...o})},sg=cg,dg=e=>{const o=ue(e),{value:t,...n}=At(e);return r.jsx(fo,{...n,...o})},ug=dg,gg=({visibleIcon:e=r.jsx(Rt,{widthHeight:14}),hiddenIcon:o=r.jsx(zt,{widthHeight:14}),...t})=>{const n=ue(t),{isVisible:i,setIsVisible:a,...l}=wn(n);return r.jsx(fo,{...l,type:i?"text":"password",isClearable:!1,right:r.jsx(c.View,{onClick:()=>{t.isDisabled||a(!i)},children:i?e:o})})},pg=gg,mg=({items:e,placeholder:o,searchPlaceholder:t,isMulti:n=!1,...i})=>{const a=ue(i),l=In(e,o,t);u.useEffect(()=>{if(n&&Array.isArray(a.value))l.setSelectedItems(a.value);else if(!n&&a.value){const s=typeof a.value=="object"?a.value:e.find(g=>g.value===a.value);s&&l.setSelectedItem(s)}},[a.value,n,e]);const d=s=>{a.onChange(s)};return r.jsx(Tn,{...l,...a,items:e,placeholder:o,isMulti:n,onSelect:d})},hg=mg,ve=(e,o,t)=>Math.min(Math.max(e,o),t),fg=(e,o,t,n,i,a,l)=>{const d=n-t;let s;if(a==="horizontal"){const g=o.width,p=e-o.left;s=ve(p/g,0,1)}else{const g=o.height,p=o.bottom-e;s=ve(p/g,0,1)}if(l&&l.length>0){const g=t+s*d;let p=l[0],m=Math.abs(g-p);for(let h=1;h<l.length;h++){const f=Math.abs(g-l[h]);f<m&&(m=f,p=l[h])}return p}else{const g=t+s*d,p=Math.round(g/i)*i;return ve(p,t,n)}},Bn=({min:e=0,max:o=100,step:t=1,value:n=0,defaultValue:i,onChange:a,onDrag:l,orientation:d="horizontal",isDisabled:s=!1,stepValues:g})=>{const p=ve(n??i??e,e,o),[m,h]=u.useState(p),[f,x]=u.useState(!1),[y,b]=u.useState(!1),k=u.useRef(null),C=u.useRef(null),w=n!==void 0,j=w?n:m;u.useEffect(()=>{w&&h(ve(n,e,o))},[n,w,e,o]);const S=u.useCallback($=>{const B=ve($,e,o);w||h(B),a&&B!==j&&a(B),f&&l&&l(B)},[w,e,o,a,j,f,l]),I=u.useCallback($=>{if(s||!k.current)return;const B=k.current.getBoundingClientRect();let R;"touches"in $?R=d==="horizontal"?$.touches[0].clientX:$.touches[0].clientY:R=d==="horizontal"?$.clientX:$.clientY;const V=fg(R,B,e,o,t,d,g);S(V)},[e,o,t,d,S,s,g]),M=u.useCallback($=>{if(s)return;$.preventDefault(),x(!0),I($);const B=V=>{I(V)},R=()=>{x(!1),document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",R),document.removeEventListener("touchmove",B),document.removeEventListener("touchend",R)};document.addEventListener("mousemove",B),document.addEventListener("mouseup",R),document.addEventListener("touchmove",B),document.addEventListener("touchend",R)},[I,s]),z=u.useCallback($=>{C.current&&C.current.contains($.target)||M($)},[M]),E=u.useCallback($=>{if(s)return;let B=j;switch($.key){case"ArrowLeft":case"ArrowDown":B=j-t;break;case"ArrowRight":case"ArrowUp":B=j+t;break;case"Home":B=e;break;case"End":B=o;break;default:return}$.preventDefault(),S(B)},[j,e,o,t,S,s]),_=o-e,T=_===0?0:(j-e)/_*100;return{currentValue:j,isDragging:f,isHovered:y,setIsHovered:b,trackRef:k,thumbRef:C,handleThumbMouseDown:M,handleTrackMouseDown:z,handleKeyDown:E,thumbPositionPercent:T}},dr={xs:{height:4,width:"100%"},sm:{height:6,width:"100%"},md:{height:8,width:"100%"},lg:{height:10,width:"100%"},xl:{height:12,width:"100%"}},ur={xs:{width:12,height:12},sm:{width:16,height:16},md:{width:20,height:20},lg:{width:24,height:24},xl:{width:28,height:28}},gr={square:0,rounded:4,pill:24},xg=e=>({default:{backgroundColor:"color-gray-200",transition:"background-color 0.15s ease"},outline:{backgroundColor:"transparent",borderWidth:1,borderStyle:"solid",borderColor:"color-gray-300",transition:"border-color 0.15s ease"}}),pr=xg(),bg={xs:{trackCrossAxisSize:4,thumbSize:12},sm:{trackCrossAxisSize:6,thumbSize:16},md:{trackCrossAxisSize:8,thumbSize:20},lg:{trackCrossAxisSize:10,thumbSize:24},xl:{trackCrossAxisSize:12,thumbSize:28}},yg={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},Ln=u.memo(({min:e=0,max:o=100,step:t=1,currentValue:n,stepValues:i,shape:a="rounded",size:l="md",variant:d="default",orientation:s="horizontal",isDisabled:g=!1,showValue:p=!1,showTooltip:m=!1,backgroundColor:h="theme-primary",label:f,helperText:x,themeMode:y,shadow:b={},isDragging:k,isHovered:C,setIsHovered:w,trackRef:j,thumbRef:S,handleThumbMouseDown:I,handleTrackMouseDown:M,handleKeyDown:z,thumbPositionPercent:E,ariaLabel:_="Slider",views:T={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:$,onDrag:B,...R})=>{var N,X;const{getColorHex:V,themeMode:W}=c.useTheme(),P=y||W,H=u.useMemo(()=>V(h,{themeMode:P}),[V,h,P]),L=u.useMemo(()=>V("theme-disabled",{themeMode:P}),[V,P]),A=u.useMemo(()=>V(pr[d].backgroundColor,{themeMode:P}),[V,d,P]),F=s==="vertical",{trackCrossAxisSize:D,thumbSize:O}=bg[l]||{trackCrossAxisSize:dr[l].height,thumbSize:ur[l].width||16},K=r.jsxs(c.Vertical,{width:"100%",gap:8,...T.container,...R,children:[f&&r.jsxs(c.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontSize:14,fontWeight:500,...T.label,children:f}),p&&r.jsx(c.Text,{fontSize:14,color:"color-blueGray-500",...T.valueLabel,children:n})]}),r.jsxs(c.View,{ref:j,position:"relative",cursor:g?"not-allowed":"pointer",opacity:g?.6:1,onMouseDown:M,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),...dr[l],borderRadius:gr[a],backgroundColor:A,...pr[d],...b,...T.track,children:[i&&i.length>0&&r.jsx(r.Fragment,{children:i.map(Z=>{const J=(Z-e)/(o-e)*100;return r.jsx(c.View,{position:"absolute",top:"50%",left:`${J}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",backgroundColor:g?L:H,zIndex:1,...T.stepMarks},Z)})}),r.jsx(c.View,{position:"absolute",top:0,left:0,height:"100%",width:`${E}%`,backgroundColor:g?L:H,borderRadius:gr[a],transition:"width 0.1s ease-in-out",...T.progress,...T.filledTrack}),r.jsx(c.View,{ref:S,role:"slider",tabIndex:g?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":g,"aria-label":_,position:"absolute",top:"50%",left:`${E}%`,borderRadius:"50%",backgroundColor:"color-white",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:`2px solid ${g?L:H}`,transition:k?"none":"transform 0.1s ease-in-out",transform:C?"translate(-50%, -50%) scale(1.1)":"translate(-50%, -50%)",zIndex:2,onMouseDown:I,onTouchStart:I,onKeyDown:z,...ur[l],...T.thumb,children:m&&(C||k)&&r.jsx(c.View,{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:8,padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:4,fontSize:12,whiteSpace:"nowrap",zIndex:3,...T.tooltip,children:r.jsx(c.Text,{...(N=T.tooltip)==null?void 0:N.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),x&&r.jsx(ht,{children:x})]}),Y=r.jsxs(c.Center,{...yg[s],position:"relative",onMouseEnter:()=>!g&&w(!0),onMouseLeave:()=>!g&&w(!1),...R,...T==null?void 0:T.container,children:[f&&r.jsxs(c.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[r.jsx(c.Text,{fontSize:14,fontWeight:500,...T.label,children:f}),p&&r.jsx(c.Text,{fontSize:14,color:"color-blueGray-500",...T.valueLabel,children:n})]}),r.jsxs(c.View,{ref:j,position:"relative",borderRadius:D/2,backgroundColor:g?L:A,cursor:g?"not-allowed":"pointer",width:F?`${D}px`:"100%",height:F?"100%":`${D}px`,onMouseDown:M,onTouchStart:M,...T==null?void 0:T.track,children:[i&&i.length>0&&r.jsx(r.Fragment,{children:i.map(Z=>{const J=(Z-e)/(o-e)*100;return r.jsx(c.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:g?L:H,zIndex:1,...F?{bottom:`${J}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${J}%`,top:"50%",transform:"translate(-50%, -50%)"},...T.stepMarks},Z)})}),r.jsx(c.View,{position:"absolute",borderRadius:D/2,backgroundColor:g?L:H,...F?{bottom:0,left:0,width:"100%",height:`${E}%`}:{top:0,left:0,height:"100%",width:`${E}%`},...T==null?void 0:T.filledTrack,...T==null?void 0:T.progress}),r.jsx(c.View,{ref:S,role:"slider",tabIndex:g?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":g,"aria-label":_,position:"absolute",width:`${O}px`,height:`${O}px`,borderRadius:"50%",backgroundColor:g?L:H,border:"2px solid color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:g?"not-allowed":"grab",transform:F?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:k?"none":"left 0.1s, bottom 0.1s",...F?{left:"50%",bottom:`${E}%`}:{top:"50%",left:`${E}%`},onMouseDown:I,onTouchStart:I,onKeyDown:z,...T==null?void 0:T.thumb,children:m&&(C||k)&&r.jsx(c.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...F?{left:"100%",marginLeft:"8px",bottom:"0",transform:"translateY(50%)"}:{bottom:"100%",left:"50%",marginBottom:"8px",transform:"translateX(-50%)"},...T==null?void 0:T.tooltip,children:r.jsx(c.Text,{...(X=T==null?void 0:T.tooltip)==null?void 0:X.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),x&&r.jsx(ht,{marginTop:8,children:x})]});return F||m?Y:K}),kg=e=>{const o=ue(e),t=Bn({...e,value:o.value!==void 0?Number(o.value):void 0,onChange:n=>{var i;o.onChange(n),(i=e.onChange)==null||i.call(e,n)}});return r.jsx(Ln,{...e,...t,...o})},jg=kg,Cg=e=>{const o=ue(e),{isFocused:t,setIsFocused:n,isHovered:i,setIsHovered:a,inputRef:l,containerRef:d,mirrorSelectionStart:s,mirrorSelectionEnd:g,setMirrorSelectionStart:p,setMirrorSelectionEnd:m,setInputRef:h,handleFocus:f,handleBlur:x,handleKeyDown:y,handlePaste:b}=Rn(e),k=u.useCallback(w=>{o.onChange&&o.onChange(w),e.onComplete&&w.length===(e.length||6)&&e.onComplete(w),l.current&&(l.current.value=w)},[o,e,l]),C=u.useCallback(w=>{const j=w.currentTarget.value.slice(0,e.length||6);k(j),l.current&&(l.current.value=j)},[e.length,k,l]);return r.jsx(Vn,{...e,...o,setValue:k,isFocused:t,setIsFocused:n,isHovered:i,setIsHovered:a,inputRef:l,containerRef:d,mirrorSelectionStart:s,mirrorSelectionEnd:g,setMirrorSelectionStart:p,setMirrorSelectionEnd:m,setInputRef:h,handleChange:C,handleFocus:f,handleBlur:x,handleKeyDown:y,handlePaste:b,stepValues:e.stepValues})},Sg=Cg,wg=e=>Array.isArray(e)?e:e==null?[]:[e],An=({name:e,uploadFile:o,onUploadSuccess:t,onUploadError:n,transformResponse:i,onMultipleFileSelect:a,onFileSelect:l,multiple:d=!0,...s})=>{const{setFieldValue:g,setFieldTouched:p,values:m}=be.useFormikContext(),[h,f]=u.useState(!1),[x,y]=u.useState(0),b=u.useCallback(async w=>{if(!w||w.length===0)return;p(e,!0,!0),f(!0);const j=[];for(const S of w){y(0);try{const I=await o(S,z=>{y(z??0)}),M=i?i(I,S):I;j.push(M),t==null||t(S,M)}catch(I){n==null||n(S,I)}}if(j.length>0){const S=wg(be.getIn(m,e));g(e,[...S,...j],!0),y(100)}else y(0);f(!1)},[e,n,t,p,g,i,o,m]),k=u.useCallback(async w=>{a==null||a(w),await b(w)},[b,a]),C=u.useCallback(async w=>{l==null||l(w),await b([w])},[b,l]);return r.jsx(Yo,{...s,multiple:d,onMultipleFileSelect:d?k:void 0,onFileSelect:d?void 0:C,isLoading:h,progress:x})};An.displayName="FormikUploader";const Ig=e=>{let o=ue(e);o.selected=o.value;const t=sn(e);return r.jsx(dn,{...t,...o})},Tg=Ig,Dn=e=>{const[o,t]=u.useState(!1),[n,i]=u.useState(e);return{isHovered:o,setIsHovered:t,isToggle:n,setIsToggled:i}},Mg={square:0,rounded:4,pill:24},zg=(e,o)=>({outline:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:e,_hover:{backgroundColor:e,color:o?"color-black":"color-white",transform:"translateY(-1px)"},_active:{backgroundColor:e,color:o?"color-black":"color-white",transform:"translateY(0)"},transition:"all 0.2s ease"},ghost:{backgroundColor:"transparent",color:e,borderWidth:0,borderStyle:"none",borderColor:"transparent",_hover:{backgroundColor:e,color:o?"color-black":"color-white",transform:"translateY(-1px)"},_active:{backgroundColor:e,color:o?"color-black":"color-white",transform:"translateY(0)"},transition:"all 0.2s ease"},link:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"1px",textDecorationThickness:"1px",_hover:{borderColor:e,textDecorationThickness:"2px",transform:"translateY(-1px)"},_active:{borderColor:e,textDecorationThickness:"2px",transform:"translateY(0)"},transition:"all 0.2s ease"}}),Fn=u.memo(({children:e,shape:o="rounded",variant:t="ghost",isHovered:n,setIsHovered:i,isDisabled:a,isToggle:l,setIsToggled:d,onToggle:s,views:g,backgroundColor:p,color:m,themeMode:h,...f})=>{const{getColor:x,themeMode:y}=c.useTheme(),b=h??y,C=x(a?"theme-disabled":p??m??"theme-primary",{themeMode:b}),j=u.useMemo(()=>zg(C,b==="light"),[C,b])[t],S=!!(l||n),I=u.useCallback(()=>i(!n),[n,i]),M=u.useCallback(()=>{a||d(z=>{const E=!z;return s&&s(E),E})},[a,d,s]);return r.jsx(c.Center,{role:"Toggle",padding:o==="pill"?"10px 12px":"8px",width:"fit-content",cursor:a?"not-allowed":"pointer",borderRadius:Mg[o],onClick:M,onMouseEnter:I,onMouseLeave:()=>i(!1),...j,...S&&{backgroundColor:C,color:b==="light"?"color-black":"color-white"},...f,...g==null?void 0:g.container,children:e})}),Rg=({children:e,shape:o,variant:t,isDisabled:n,isToggled:i=!1,onToggle:a,...l})=>{const d=ue(l),{isHovered:s,setIsHovered:g,isToggle:p,setIsToggled:m}=Dn(d.value??i);u.useEffect(()=>{m(d.value??i)},[d.value,i]);const h=f=>{m(f),d.onChange(f),a==null||a(f)};return r.jsx(Fn,{shape:o,variant:t,isDisabled:n,isHovered:s,setIsHovered:g,isToggle:p,setIsToggled:m,onToggle:h,...l,children:e})},Vg=Rg,On=()=>{const[e,o]=u.useState([]);return{activeToggles:e,setActiveToggles:o}},Eg=({children:e,shape:o,variant:t,isDisabled:n,isToggled:i=!1,onToggle:a,...l})=>{const{isHovered:d,setIsHovered:s,isToggle:g,setIsToggled:p}=Dn(i);return u.useEffect(()=>{p(i)},[i]),r.jsx(Fn,{shape:o,variant:t,isDisabled:n,isHovered:d,setIsHovered:s,isToggle:g,setIsToggled:p,onToggle:a,...l,children:e})},qn=Eg,Nn=({items:e,onToggleChange:o,activeToggles:t,setActiveToggles:n,shape:i="rounded",variant:a="ghost",views:l})=>{const d=u.useCallback((s,g)=>{n(p=>{let m;return g?m=p.includes(s)?p:[...p,s]:m=p.filter(h=>h!==s),o==null||o(m),m})},[o,n]);return r.jsx(c.Horizontal,{role:"ToggleGroup",display:"flex",gap:5,...l==null?void 0:l.container,children:e.map(s=>r.jsx(qn,{role:`toggle-${s.id}`,shape:i,variant:a,isToggled:t.includes(s.id)||s.isActive,onToggle:g=>d(s.id,g),isDisabled:s.isDisabled,views:l==null?void 0:l.toggle,children:s.value},s.id))})},Pg=({items:e,shape:o,variant:t,onToggleChange:n,...i})=>{const a=ue(i),{activeToggles:l,setActiveToggles:d}=On();u.useEffect(()=>{Array.isArray(a.value)&&d(a.value)},[a.value]);const s=g=>{d(g),a.onChange(g),n==null||n(g)};return r.jsx(Nn,{items:e,shape:o,variant:t,activeToggles:l,setActiveToggles:d,onToggleChange:s,...i})},Wg=Pg,mr=["zoom-out","zoom-in","zap","zap-off","youtube","x","wrench","worm","workflow","wine","wine-off","wind","wind-arrow-down","wifi","wifi-zero","wifi-sync","wifi-pen","wifi-off","wifi-low","wifi-high","wifi-cog","whole-word","wheat","wheat-off","weight","weight-tilde","webhook","webhook-off","webcam","waypoints","waves","waves-ladder","waves-arrow-up","waves-arrow-down","watch","washing-machine","warehouse","wand","wand-sparkles","wallpaper","wallet","wallet-minimal","wallet-cards","vote","volume","volume-x","volume-off","volume-2","volume-1","volleyball","voicemail","view","videotape","video","video-off","vibrate","vibrate-off","venus","venus-and-mars","venetian-mask","vegan","vector-square","vault","variable","van","utility-pole","utensils","utensils-crossed","users","users-round","user","user-x","user-star","user-search","user-round","user-round-x","user-round-search","user-round-plus","user-round-pen","user-round-minus","user-round-cog","user-round-check","user-plus","user-pen","user-minus","user-lock","user-cog","user-check","usb","upload","unplug","unlink","unlink-2","university","ungroup","unfold-vertical","unfold-horizontal","undo","undo-dot","undo-2","underline","umbrella","umbrella-off","type","type-outline","twitter","twitch","tv","tv-minimal","tv-minimal-play","turtle","turntable","turkish-lira","truck","truck-electric","trophy","triangle","triangle-right","triangle-dashed","triangle-alert","trending-up","trending-up-down","trending-down","trello","trees","tree-pine","tree-palm","tree-deciduous","trash","trash-2","transgender","tram-front","train-track","train-front","train-front-tunnel","traffic-cone","tractor","toy-brick","tower-control","touchpad","touchpad-off","torus","tornado","toolbox","tool-case","toilet","toggle-right","toggle-left","timer","timer-reset","timer-off","tickets","tickets-plane","ticket","ticket-x","ticket-slash","ticket-plus","ticket-percent","ticket-minus","ticket-check","thumbs-up","thumbs-down","thermometer","thermometer-sun","thermometer-snowflake","theater","text-wrap","text-select","text-search","text-quote","text-initial","text-cursor","text-cursor-input","text-align-start","text-align-justify","text-align-end","text-align-center","test-tubes","test-tube","test-tube-diagonal","terminal","tent","tent-tree","telescope","target","tangent","tally-5","tally-4","tally-3","tally-2","tally-1","tags","tag","tablets","tablet","tablet-smartphone","table","table-rows-split","table-properties","table-of-contents","table-columns-split","table-cells-split","table-cells-merge","table-2","syringe","swords","sword","switch-camera","swiss-franc","swatch-book","superscript","sunset","sunrise","sun","sun-snow","sun-moon","sun-medium","sun-dim","subscript","strikethrough","stretch-vertical","stretch-horizontal","store","stone","sticky-note","sticker","stethoscope","step-forward","step-back","star","star-off","star-half","stamp","squirrel","squircle","squircle-dashed","squares-unite","squares-subtract","squares-intersect","squares-exclude","square","square-x","square-user","square-user-round","square-terminal","square-stop","square-star","square-stack","square-square","square-split-vertical","square-split-horizontal","square-slash","square-sigma","square-scissors","square-round-corner","square-radical","square-power","square-plus","square-play","square-pilcrow","square-pi","square-percent","square-pen","square-pause","square-parking","square-parking-off","square-mouse-pointer","square-minus","square-menu","square-m","square-library","square-kanban","square-function","square-equal","square-dot","square-divide","square-dashed","square-dashed-top-solid","square-dashed-mouse-pointer","square-dashed-kanban","square-dashed-bottom","square-dashed-bottom-code","square-code","square-chevron-up","square-chevron-right","square-chevron-left","square-chevron-down","square-check","square-check-big","square-chart-gantt","square-bottom-dashed-scissors","square-asterisk","square-arrow-up","square-arrow-up-right","square-arrow-up-left","square-arrow-right","square-arrow-out-up-right","square-arrow-out-up-left","square-arrow-out-down-right","square-arrow-out-down-left","square-arrow-left","square-arrow-down","square-arrow-down-right","square-arrow-down-left","square-activity","sprout","spray-can","spotlight","spool","split","spline","spline-pointer","spell-check","spell-check-2","speech","speaker","sparkles","sparkle","spade","space","soup","solar-panel","sofa","soap-dispenser-droplet","snowflake","snail","smile","smile-plus","smartphone","smartphone-nfc","smartphone-charging","sliders-vertical","sliders-horizontal","slice","slash","slack","skull","skip-forward","skip-back","siren","signpost","signpost-big","signature","signal","signal-zero","signal-medium","signal-low","signal-high","sigma","shuffle","shrub","shrink","shrimp","shredder","shower-head","shovel","shopping-cart","shopping-basket","shopping-bag","shirt","ship","ship-wheel","shield","shield-x","shield-user","shield-question-mark","shield-plus","shield-off","shield-minus","shield-half","shield-ellipsis","shield-check","shield-ban","shield-alert","shell","sheet","share","share-2","shapes","settings","settings-2","server","server-off","server-crash","server-cog","separator-vertical","separator-horizontal","send","send-to-back","send-horizontal","section","search","search-x","search-slash","search-code","search-check","search-alert","scroll","scroll-text","screen-share","screen-share-off","scooter","scissors","scissors-line-dashed","school","scan","scan-text","scan-search","scan-qr-code","scan-line","scan-heart","scan-face","scan-eye","scan-barcode","scaling","scale","scale-3d","save","save-off","save-all","saudi-riyal","satellite","satellite-dish","sandwich","salad","sailboat","russian-ruble","ruler","ruler-dimension-line","rss","rows-4","rows-3","rows-2","router","route","route-off","rotate-cw","rotate-cw-square","rotate-ccw","rotate-ccw-square","rotate-ccw-key","rotate-3d","rose","roller-coaster","rocking-chair","rocket","ribbon","rewind","reply","reply-all","replace","replace-all","repeat","repeat-2","repeat-1","remove-formatting","regex","refrigerator","refresh-cw","refresh-cw-off","refresh-ccw","refresh-ccw-dot","redo","redo-dot","redo-2","recycle","rectangle-vertical","rectangle-horizontal","rectangle-goggles","rectangle-ellipsis","rectangle-circle","receipt","receipt-turkish-lira","receipt-text","receipt-swiss-franc","receipt-russian-ruble","receipt-pound-sterling","receipt-japanese-yen","receipt-indian-rupee","receipt-euro","receipt-cent","ratio","rat","rainbow","rail-symbol","radius","radio","radio-tower","radio-receiver","radical","radiation","radar","rabbit","quote","qr-code","pyramid","puzzle","proportions","projector","printer","printer-check","presentation","power","power-off","pound-sterling","popsicle","popcorn","pointer","pointer-off","podcast","pocket","pocket-knife","plus","plug","plug-zap","plug-2","play","plane","plane-takeoff","plane-landing","pizza","pipette","pin","pin-off","pill","pill-bottle","pilcrow","pilcrow-right","pilcrow-left","piggy-bank","picture-in-picture","picture-in-picture-2","pickaxe","piano","pi","phone","phone-outgoing","phone-off","phone-missed","phone-incoming","phone-forwarded","phone-call","philippine-peso","person-standing","percent","pentagon","pencil","pencil-ruler","pencil-off","pencil-line","pen","pen-tool","pen-off","pen-line","pc-case","paw-print","pause","party-popper","parking-meter","parentheses","paperclip","panels-top-left","panels-right-bottom","panels-left-bottom","panel-top","panel-top-open","panel-top-dashed","panel-top-close","panel-top-bottom-dashed","panel-right","panel-right-open","panel-right-dashed","panel-right-close","panel-left","panel-left-right-dashed","panel-left-open","panel-left-dashed","panel-left-close","panel-bottom","panel-bottom-open","panel-bottom-dashed","panel-bottom-close","panda","palette","paintbrush","paintbrush-vertical","paint-roller","paint-bucket","package","package-x","package-search","package-plus","package-open","package-minus","package-check","package-2","origami","orbit","option","omega","octagon","octagon-x","octagon-pause","octagon-minus","octagon-alert","nut","nut-off","notepad-text","notepad-text-dashed","notebook","notebook-text","notebook-tabs","notebook-pen","non-binary","nfc","newspaper","network","navigation","navigation-off","navigation-2","navigation-2-off","music","music-4","music-3","music-2","move","move-vertical","move-up","move-up-right","move-up-left","move-right","move-left","move-horizontal","move-down","move-down-right","move-down-left","move-diagonal","move-diagonal-2","move-3d","mouse","mouse-pointer","mouse-pointer-click","mouse-pointer-ban","mouse-pointer-2","mouse-pointer-2-off","mouse-off","mountain","mountain-snow","motorbike","moon","moon-star","monitor","monitor-x","monitor-up","monitor-stop","monitor-speaker","monitor-smartphone","monitor-play","monitor-pause","monitor-off","monitor-down","monitor-dot","monitor-cog","monitor-cloud","monitor-check","minus","minimize","minimize-2","milk","milk-off","milestone","microwave","microscope","microchip","mic","mic-vocal","mic-off","messages-square","message-square","message-square-x","message-square-warning","message-square-text","message-square-share","message-square-reply","message-square-quote","message-square-plus","message-square-off","message-square-more","message-square-lock","message-square-heart","message-square-dot","message-square-diff","message-square-dashed","message-square-code","message-circle","message-circle-x","message-circle-warning","message-circle-reply","message-circle-question-mark","message-circle-plus","message-circle-off","message-circle-more","message-circle-heart","message-circle-dashed","message-circle-code","merge","menu","memory-stick","meh","megaphone","megaphone-off","medal","maximize","maximize-2","martini","mars","mars-stroke","map","map-plus","map-pinned","map-pin","map-pin-x","map-pin-x-inside","map-pin-plus","map-pin-plus-inside","map-pin-pen","map-pin-off","map-pin-minus","map-pin-minus-inside","map-pin-house","map-pin-check","map-pin-check-inside","map-minus","mails","mailbox","mail","mail-x","mail-warning","mail-search","mail-question-mark","mail-plus","mail-open","mail-minus","mail-check","magnet","luggage","lollipop","logs","log-out","log-in","lock","lock-open","lock-keyhole","lock-keyhole-open","locate","locate-off","locate-fixed","loader","loader-pinwheel","loader-circle","list","list-x","list-video","list-tree","list-todo","list-start","list-restart","list-plus","list-ordered","list-music","list-minus","list-indent-increase","list-indent-decrease","list-filter","list-filter-plus","list-end","list-collapse","list-chevrons-up-down","list-chevrons-down-up","list-checks","list-check","linkedin","link","link-2","link-2-off","line-squiggle","lightbulb","lightbulb-off","ligature","life-buoy","library","library-big","lectern","leafy-green","leaf","layout-template","layout-panel-top","layout-panel-left","layout-list","layout-grid","layout-dashboard","layers","layers-plus","layers-2","laugh","lasso","lasso-select","laptop","laptop-minimal","laptop-minimal-check","languages","landmark","land-plot","lamp","lamp-wall-up","lamp-wall-down","lamp-floor","lamp-desk","lamp-ceiling","keyboard","keyboard-off","keyboard-music","key","key-square","key-round","kayak","kanban","joystick","japanese-yen","iteration-cw","iteration-ccw","italic","instagram","inspection-panel","info","infinity","indian-rupee","inbox","import","images","image","image-upscale","image-up","image-plus","image-play","image-off","image-minus","image-down","id-card","id-card-lanyard","ice-cream-cone","ice-cream-bowl","house","house-wifi","house-plus","house-plug","house-heart","hourglass","hotel","hospital","hop","hop-off","history","highlighter","hexagon","helicopter","heater","heart","heart-pulse","heart-plus","heart-off","heart-minus","heart-handshake","heart-crack","headset","headphones","headphone-off","heading","heading-6","heading-5","heading-4","heading-3","heading-2","heading-1","hdmi-port","hd","haze","hat-glasses","hash","hard-hat","hard-drive","hard-drive-upload","hard-drive-download","handshake","handbag","hand","hand-platter","hand-metal","hand-helping","hand-heart","hand-grab","hand-fist","hand-coins","hammer","hamburger","ham","guitar","group","grip","grip-vertical","grip-horizontal","grid-3x3","grid-3x2","grid-2x2","grid-2x2-x","grid-2x2-plus","grid-2x2-check","grape","graduation-cap","gpu","goal","globe","globe-lock","glasses","glass-water","gitlab","github","git-pull-request","git-pull-request-draft","git-pull-request-create","git-pull-request-create-arrow","git-pull-request-closed","git-pull-request-arrow","git-merge","git-graph","git-fork","git-compare","git-compare-arrows","git-commit-vertical","git-commit-horizontal","git-branch","git-branch-plus","git-branch-minus","gift","ghost","georgian-lari","gem","gavel","gauge","gamepad","gamepad-directional","gamepad-2","gallery-vertical","gallery-vertical-end","gallery-thumbnails","gallery-horizontal","gallery-horizontal-end","funnel","funnel-x","funnel-plus","fullscreen","fuel","frown","framer","frame","forward","form","forklift","footprints","folders","folder","folder-x","folder-up","folder-tree","folder-sync","folder-symlink","folder-search","folder-search-2","folder-root","folder-plus","folder-pen","folder-output","folder-open","folder-open-dot","folder-minus","folder-lock","folder-key","folder-kanban","folder-input","folder-heart","folder-git","folder-git-2","folder-down","folder-dot","folder-cog","folder-code","folder-closed","folder-clock","folder-check","folder-archive","fold-vertical","fold-horizontal","focus","flower","flower-2","flip-vertical","flip-vertical-2","flip-horizontal","flip-horizontal-2","flask-round","flask-conical","flask-conical-off","flashlight","flashlight-off","flame","flame-kindling","flag","flag-triangle-right","flag-triangle-left","flag-off","fishing-hook","fish","fish-symbol","fish-off","fire-extinguisher","fingerprint-pattern","film","files","file","file-x","file-x-corner","file-volume","file-video-camera","file-user","file-up","file-type","file-type-corner","file-text","file-terminal","file-symlink","file-stack","file-spreadsheet","file-sliders","file-signal","file-search","file-search-corner","file-scan","file-question-mark","file-plus","file-plus-corner","file-play","file-pen","file-pen-line","file-output","file-music","file-minus","file-minus-corner","file-lock","file-key","file-input","file-image","file-heart","file-headphone","file-exclamation-point","file-down","file-digit","file-diff","file-cog","file-code","file-code-corner","file-clock","file-check","file-check-corner","file-chart-pie","file-chart-line","file-chart-column","file-chart-column-increasing","file-braces","file-braces-corner","file-box","file-badge","file-axis-3d","file-archive","figma","ferris-wheel","fence","feather","fast-forward","fan","factory","facebook","eye","eye-off","eye-closed","external-link","expand","ev-charger","euro","ethernet-port","eraser","equal","equal-not","equal-approximately","ellipsis","ellipsis-vertical","egg","egg-off","egg-fried","eclipse","earth","earth-lock","ear","ear-off","dumbbell","drumstick","drum","droplets","droplet","droplet-off","drone","drill","dribbble","drama","drafting-compass","download","dot","door-open","door-closed","door-closed-locked","donut","dollar-sign","dog","dock","dna","dna-off","divide","disc","disc-album","disc-3","disc-2","diff","dices","dice-6","dice-5","dice-4","dice-3","dice-2","dice-1","diamond","diamond-plus","diamond-percent","diamond-minus","diameter","dessert","delete","decimals-arrow-right","decimals-arrow-left","database","database-zap","database-backup","dam","cylinder","currency","cup-soda","cuboid","crown","crosshair","cross","crop","croissant","credit-card","creative-commons","cpu","corner-up-right","corner-up-left","corner-right-up","corner-right-down","corner-left-up","corner-left-down","corner-down-right","corner-down-left","copyright","copyleft","copy","copy-x","copy-slash","copy-plus","copy-minus","copy-check","cooking-pot","cookie","contrast","container","contact","contact-round","construction","cone","concierge-bell","computer","component","compass","command","combine","columns-4","columns-3","columns-3-cog","columns-2","coins","cog","coffee","codesandbox","codepen","code","code-xml","club","clover","cloudy","cloud","cloud-upload","cloud-sync","cloud-sun","cloud-sun-rain","cloud-snow","cloud-rain","cloud-rain-wind","cloud-off","cloud-moon","cloud-moon-rain","cloud-lightning","cloud-hail","cloud-fog","cloud-drizzle","cloud-download","cloud-cog","cloud-check","cloud-backup","cloud-alert","closed-caption","clock","clock-plus","clock-fading","clock-check","clock-arrow-up","clock-arrow-down","clock-alert","clock-9","clock-8","clock-7","clock-6","clock-5","clock-4","clock-3","clock-2","clock-12","clock-11","clock-10","clock-1","clipboard","clipboard-x","clipboard-type","clipboard-plus","clipboard-pen","clipboard-pen-line","clipboard-paste","clipboard-minus","clipboard-list","clipboard-copy","clipboard-clock","clipboard-check","clapperboard","citrus","circuit-board","circle","circle-x","circle-user","circle-user-round","circle-stop","circle-star","circle-small","circle-slash","circle-slash-2","circle-question-mark","circle-power","circle-pound-sterling","circle-plus","circle-play","circle-pile","circle-percent","circle-pause","circle-parking","circle-parking-off","circle-off","circle-minus","circle-gauge","circle-fading-plus","circle-fading-arrow-up","circle-equal","circle-ellipsis","circle-dot","circle-dot-dashed","circle-dollar-sign","circle-divide","circle-dashed","circle-chevron-up","circle-chevron-right","circle-chevron-left","circle-chevron-down","circle-check","circle-check-big","circle-arrow-up","circle-arrow-right","circle-arrow-out-up-right","circle-arrow-out-up-left","circle-arrow-out-down-right","circle-arrow-out-down-left","circle-arrow-left","circle-arrow-down","circle-alert","cigarette","cigarette-off","church","chromium","chevrons-up","chevrons-up-down","chevrons-right","chevrons-right-left","chevrons-left","chevrons-left-right","chevrons-left-right-ellipsis","chevrons-down","chevrons-down-up","chevron-up","chevron-right","chevron-left","chevron-last","chevron-first","chevron-down","chess-rook","chess-queen","chess-pawn","chess-knight","chess-king","chess-bishop","cherry","chef-hat","check","check-line","check-check","chart-spline","chart-scatter","chart-pie","chart-no-axes-gantt","chart-no-axes-combined","chart-no-axes-column","chart-no-axes-column-increasing","chart-no-axes-column-decreasing","chart-network","chart-line","chart-gantt","chart-column","chart-column-stacked","chart-column-increasing","chart-column-decreasing","chart-column-big","chart-candlestick","chart-bar","chart-bar-stacked","chart-bar-increasing","chart-bar-decreasing","chart-bar-big","chart-area","cctv","cat","castle","cast","cassette-tape","case-upper","case-sensitive","case-lower","carrot","card-sim","caravan","car","car-taxi-front","car-front","captions","captions-off","cannabis","cannabis-off","candy","candy-off","candy-cane","camera","camera-off","calendars","calendar","calendar-x","calendar-x-2","calendar-sync","calendar-search","calendar-range","calendar-plus","calendar-plus-2","calendar-off","calendar-minus","calendar-minus-2","calendar-heart","calendar-fold","calendar-days","calendar-cog","calendar-clock","calendar-check","calendar-check-2","calendar-arrow-up","calendar-arrow-down","calendar-1","calculator","cake","cake-slice","cable","cable-car","bus","bus-front","building","building-2","bug","bug-play","bug-off","bubbles","brush","brush-cleaning","bring-to-front","briefcase","briefcase-medical","briefcase-conveyor-belt","briefcase-business","brick-wall","brick-wall-shield","brick-wall-fire","brain","brain-cog","brain-circuit","brackets","braces","boxes","box","bow-arrow","bottle-wine","bot","bot-off","bot-message-square","boom-box","bookmark","bookmark-x","bookmark-plus","bookmark-minus","bookmark-check","book","book-x","book-user","book-up","book-up-2","book-type","book-text","book-search","book-plus","book-open","book-open-text","book-open-check","book-minus","book-marked","book-lock","book-key","book-image","book-heart","book-headphones","book-down","book-dashed","book-copy","book-check","book-audio","book-alert","book-a","bone","bomb","bolt","bold","bluetooth","bluetooth-searching","bluetooth-off","bluetooth-connected","blocks","blinds","blend","bitcoin","birdhouse","bird","biohazard","binoculars","binary","bike","biceps-flexed","between-vertical-start","between-vertical-end","between-horizontal-start","between-horizontal-end","bell","bell-ring","bell-plus","bell-off","bell-minus","bell-electric","bell-dot","beer","beer-off","beef","bed","bed-single","bed-double","bean","bean-off","beaker","battery","battery-warning","battery-plus","battery-medium","battery-low","battery-full","battery-charging","bath","baseline","barrel","barcode","banknote","banknote-x","banknote-arrow-up","banknote-arrow-down","bandage","banana","ban","balloon","baggage-claim","badge","badge-x","badge-turkish-lira","badge-swiss-franc","badge-russian-ruble","badge-question-mark","badge-pound-sterling","badge-plus","badge-percent","badge-minus","badge-japanese-yen","badge-info","badge-indian-rupee","badge-euro","badge-dollar-sign","badge-check","badge-cent","badge-alert","backpack","baby","axis-3d","axe","award","audio-waveform","audio-lines","atom","at-sign","asterisk","arrows-up-from-line","arrow-up","arrow-up-z-a","arrow-up-wide-narrow","arrow-up-to-line","arrow-up-right","arrow-up-narrow-wide","arrow-up-left","arrow-up-from-line","arrow-up-from-dot","arrow-up-down","arrow-up-a-z","arrow-up-1-0","arrow-up-0-1","arrow-right","arrow-right-to-line","arrow-right-left","arrow-right-from-line","arrow-left","arrow-left-to-line","arrow-left-right","arrow-left-from-line","arrow-down","arrow-down-z-a","arrow-down-wide-narrow","arrow-down-up","arrow-down-to-line","arrow-down-to-dot","arrow-down-right","arrow-down-narrow-wide","arrow-down-left","arrow-down-from-line","arrow-down-a-z","arrow-down-1-0","arrow-down-0-1","arrow-big-up","arrow-big-up-dash","arrow-big-right","arrow-big-right-dash","arrow-big-left","arrow-big-left-dash","arrow-big-down","arrow-big-down-dash","armchair","archive","archive-x","archive-restore","apple","app-window","app-window-mac","aperture","anvil","antenna","annoyed","angry","anchor","amphora","ampersands","ampersand","ambulance","align-vertical-space-between","align-vertical-space-around","align-vertical-justify-start","align-vertical-justify-end","align-vertical-justify-center","align-vertical-distribute-start","align-vertical-distribute-end","align-vertical-distribute-center","align-start-vertical","align-start-horizontal","align-horizontal-space-between","align-horizontal-space-around","align-horizontal-justify-start","align-horizontal-justify-end","align-horizontal-justify-center","align-horizontal-distribute-start","align-horizontal-distribute-end","align-horizontal-distribute-center","align-end-vertical","align-end-horizontal","align-center-vertical","align-center-horizontal","album","alarm-smoke","alarm-clock","alarm-clock-plus","alarm-clock-off","alarm-clock-minus","alarm-clock-check","airplay","air-vent","activity","accessibility","a-large-small","a-arrow-up","a-arrow-down"],Un=e=>{const{value:o,defaultValue:t,onChange:n,isOpen:i,onOpen:a,onClose:l,closeOnSelect:d=!0}=e,[s,g]=u.useState(i??!1),[p,m]=u.useState(o??t),[h,f]=u.useState(""),x=u.useRef(null),y=u.useRef(null);u.useEffect(()=>{o!==void 0&&m(o)},[o]),u.useEffect(()=>{i!==void 0&&g(i)},[i]);const b=u.useMemo(()=>h?mr.filter(S=>S.toLowerCase().includes(h.toLowerCase())).slice(0,100):mr.slice(0,100),[h]);u.useEffect(()=>{const S=I=>{s&&x.current&&y.current&&!x.current.contains(I.target)&&!y.current.contains(I.target)&&k()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[s]);const k=u.useCallback(()=>{i===void 0&&g(!1),l&&l()},[l,i]),C=u.useCallback(()=>{const S=!s;i===void 0&&g(S),S?(a&&a(),f("")):l&&l()},[s,a,l,i]),w=u.useCallback(S=>{o===void 0&&m(S),n&&n(S),d&&k()},[n,d,k,o]),j=u.useCallback(S=>{f(S)},[]);return{isOpen:s,selectedIcon:p,searchQuery:h,filteredIcons:b,handleToggle:C,handleIconSelect:w,handleSearchChange:j,handleClose:k,triggerRef:x,dropdownRef:y}},Oe={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px",maxHeight:"320px",overflow:"hidden",display:"flex",flexDirection:"column"},searchInput:{marginBottom:"12px",flexShrink:0},iconGrid:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:"8px",overflowY:"auto",padding:"4px",color:"color-black",flexGrow:1},iconItem:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:"4px",transition:"all 0.2s ease"}},_g={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},$g={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Hg={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Gn=({label:e,placeholder:o="Select an icon",helperText:t,views:n={},size:i="md",shape:a="default",variant:l="default",error:d=!1,isDisabled:s=!1,isReadOnly:g=!1,showSearch:p=!0,isOpen:m,selectedIcon:h,searchQuery:f,filteredIcons:x,handleToggle:y,handleIconSelect:b,handleSearchChange:k,triggerRef:C,dropdownRef:w,handleClose:j,onChange:S,...I})=>{const{getColor:M}=c.useTheme(),z={...Oe.container,...n==null?void 0:n.container},E={...Oe.trigger,..._g[i],...$g[a],...Hg[l],...d&&{borderColor:"color-red-500"},...s&&{opacity:.6,cursor:"not-allowed"},...n==null?void 0:n.trigger},_={...Oe.dropdown,...n==null?void 0:n.dropdown},T={...Oe.iconGrid,...n==null?void 0:n.iconGrid};return r.jsxs(c.View,{...z,...I,children:[e&&r.jsx(c.Text,{fontSize:i==="xs"?"12px":i==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...n==null?void 0:n.label,children:e}),r.jsxs(c.View,{ref:C,onClick:s||g?void 0:y,...E,children:[r.jsx(c.Horizontal,{alignItems:"center",gap:8,width:"100%",children:h?r.jsxs(c.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[r.jsx(Eo,{name:h,widthHeight:16}),r.jsx(c.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h})]}):r.jsx(c.Text,{color:"color-gray-500",fontSize:"inherit",children:o})}),!g&&!s&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:m?"up":"down"})]}),m&&r.jsxs(c.View,{ref:w,..._,children:[p&&r.jsx(c.View,{...Oe.searchInput,...n==null?void 0:n.searchInput,children:r.jsx(xo,{placeholder:"Search icons...",value:f,onChange:$=>k($),size:"sm",autoFocus:!0})}),r.jsx(c.View,{...T,children:x.length>0?x.map($=>r.jsx(c.View,{...Oe.iconItem,onClick:()=>b($),title:$,_hover:{backgroundColor:"color-gray-100"},backgroundColor:h===$?"color-blue-100":"transparent",...n==null?void 0:n.iconItem,children:r.jsx(Eo,{name:$,widthHeight:20})},$)):r.jsx(c.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(c.Text,{fontSize:"14px",children:"No icons found"})})})]}),t&&r.jsx(c.Text,{color:d?"color-red-500":"color-gray-600",marginTop:"4px",...n==null?void 0:n.helperText,children:t})]})},Bg=e=>{const o=ue(e),t={...e,value:o.value??e.value??e.defaultValue},n=Un(t),i=a=>{n.handleIconSelect(a),o.onChange(a)};return r.jsx(Gn,{...n,...t,handleIconSelect:i})},Lg=Bg,Me={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"320px",maxHeight:"400px",overflow:"hidden"},searchInput:{marginBottom:"12px"},categoryTabs:{display:"flex",borderBottom:"1px solid color-gray-200",marginBottom:"12px",overflowX:"auto"},categoryTab:{padding:"8px 12px",cursor:"pointer",borderBottom:"2px solid transparent",transition:"all 0.2s ease",fontSize:"14px",fontWeight:"500",color:"color-gray-600",whiteSpace:"nowrap"},emojiGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"4px",maxHeight:"240px",overflowY:"auto",padding:"4px",color:"color-black"},emoji:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:"4px",fontSize:"20px",transition:"all 0.2s ease"}},Ag={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},Dg={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Fg={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Og={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},qg=[{emoji:"😀",name:"grinning face",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😃",name:"grinning face with big eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😄",name:"grinning face with smiling eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😁",name:"beaming face with smiling eyes",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😆",name:"grinning squinting face",category:"smileys",keywords:["happy","laugh","smile"]},{emoji:"😅",name:"grinning face with sweat",category:"smileys",keywords:["happy","sweat","relief"]},{emoji:"🤣",name:"rolling on the floor laughing",category:"smileys",keywords:["laugh","funny","rofl"]},{emoji:"😂",name:"face with tears of joy",category:"smileys",keywords:["laugh","cry","joy"]},{emoji:"🙂",name:"slightly smiling face",category:"smileys",keywords:["smile","happy"]},{emoji:"🙃",name:"upside-down face",category:"smileys",keywords:["silly","upside down"]},{emoji:"😉",name:"winking face",category:"smileys",keywords:["wink","flirt"]},{emoji:"😊",name:"smiling face with smiling eyes",category:"smileys",keywords:["happy","smile","blush"]},{emoji:"😇",name:"smiling face with halo",category:"smileys",keywords:["angel","innocent"]},{emoji:"🥰",name:"smiling face with hearts",category:"smileys",keywords:["love","hearts","adore"]},{emoji:"😍",name:"smiling face with heart-eyes",category:"smileys",keywords:["love","heart","eyes"]},{emoji:"🤩",name:"star-struck",category:"smileys",keywords:["star","struck","amazed"]},{emoji:"😘",name:"face blowing a kiss",category:"smileys",keywords:["kiss","love","flirt"]},{emoji:"😗",name:"kissing face",category:"smileys",keywords:["kiss","love"]},{emoji:"☺️",name:"smiling face",category:"smileys",keywords:["smile","happy","content"]},{emoji:"😚",name:"kissing face with closed eyes",category:"smileys",keywords:["kiss","love","closed eyes"]},{emoji:"😙",name:"kissing face with smiling eyes",category:"smileys",keywords:["kiss","love","smile"]},{emoji:"🥲",name:"smiling face with tear",category:"smileys",keywords:["happy","cry","tear","bittersweet"]},{emoji:"😋",name:"face savoring food",category:"smileys",keywords:["yum","delicious","food"]},{emoji:"😛",name:"face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"😜",name:"winking face with tongue",category:"smileys",keywords:["wink","tongue","silly"]},{emoji:"🤪",name:"zany face",category:"smileys",keywords:["crazy","silly","wild"]},{emoji:"😝",name:"squinting face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"🤑",name:"money-mouth face",category:"smileys",keywords:["money","rich","greedy"]},{emoji:"🤗",name:"hugging face",category:"smileys",keywords:["hug","love","care"]},{emoji:"🤭",name:"face with hand over mouth",category:"smileys",keywords:["oops","secret","quiet"]},{emoji:"🫢",name:"face with open eyes and hand over mouth",category:"smileys",keywords:["surprise","shock","oops"]},{emoji:"🫣",name:"face with peeking eye",category:"smileys",keywords:["peek","shy","embarrassed"]},{emoji:"🤫",name:"shushing face",category:"smileys",keywords:["quiet","secret","shh"]},{emoji:"🤔",name:"thinking face",category:"smileys",keywords:["think","consider","hmm"]},{emoji:"🫡",name:"saluting face",category:"smileys",keywords:["salute","respect","military"]},{emoji:"🤐",name:"zipper-mouth face",category:"smileys",keywords:["quiet","secret","zip"]},{emoji:"🤨",name:"face with raised eyebrow",category:"smileys",keywords:["suspicious","doubt","skeptical"]},{emoji:"😐",name:"neutral face",category:"smileys",keywords:["neutral","meh","blank"]},{emoji:"😑",name:"expressionless face",category:"smileys",keywords:["blank","deadpan","meh"]},{emoji:"😶",name:"face without mouth",category:"smileys",keywords:["quiet","speechless","silent"]},{emoji:"🫥",name:"dotted line face",category:"smileys",keywords:["invisible","depressed","disappear"]},{emoji:"😏",name:"smirking face",category:"smileys",keywords:["smirk","smug","confident"]},{emoji:"😒",name:"unamused face",category:"smileys",keywords:["unamused","bored","annoyed"]},{emoji:"🙄",name:"face with rolling eyes",category:"smileys",keywords:["eye roll","annoyed","whatever"]},{emoji:"😬",name:"grimacing face",category:"smileys",keywords:["grimace","awkward","oops"]},{emoji:"😮‍💨",name:"face exhaling",category:"smileys",keywords:["sigh","relief","tired"]},{emoji:"🤥",name:"lying face",category:"smileys",keywords:["lie","pinocchio","dishonest"]},{emoji:"😌",name:"relieved face",category:"smileys",keywords:["relief","calm","peaceful"]},{emoji:"😔",name:"pensive face",category:"smileys",keywords:["sad","thoughtful","pensive"]},{emoji:"😪",name:"sleepy face",category:"smileys",keywords:["sleepy","tired","drowsy"]},{emoji:"🤤",name:"drooling face",category:"smileys",keywords:["drool","desire","sleep"]},{emoji:"😴",name:"sleeping face",category:"smileys",keywords:["sleep","tired","zzz"]},{emoji:"😷",name:"face with medical mask",category:"smileys",keywords:["mask","sick","doctor"]},{emoji:"🤒",name:"face with thermometer",category:"smileys",keywords:["sick","fever","ill"]},{emoji:"🤕",name:"face with head-bandage",category:"smileys",keywords:["hurt","injured","bandage"]},{emoji:"🤢",name:"nauseated face",category:"smileys",keywords:["sick","nausea","disgusted"]},{emoji:"🤮",name:"face vomiting",category:"smileys",keywords:["vomit","sick","disgusted"]},{emoji:"🤧",name:"sneezing face",category:"smileys",keywords:["sneeze","sick","gesundheit"]},{emoji:"🥵",name:"hot face",category:"smileys",keywords:["hot","heat","sweat"]},{emoji:"🥶",name:"cold face",category:"smileys",keywords:["cold","freeze","blue"]},{emoji:"🥴",name:"woozy face",category:"smileys",keywords:["dizzy","drunk","confused"]},{emoji:"😵",name:"dizzy face",category:"smileys",keywords:["dizzy","confused","knocked out"]},{emoji:"😵‍💫",name:"face with spiral eyes",category:"smileys",keywords:["dizzy","hypnotized","confused"]},{emoji:"🤯",name:"exploding head",category:"smileys",keywords:["mind blown","shocked","amazed"]},{emoji:"🤠",name:"cowboy hat face",category:"smileys",keywords:["cowboy","hat","western"]},{emoji:"🥳",name:"partying face",category:"smileys",keywords:["party","celebration","birthday"]},{emoji:"🥸",name:"disguised face",category:"smileys",keywords:["disguise","glasses","incognito"]},{emoji:"😎",name:"smiling face with sunglasses",category:"smileys",keywords:["cool","sunglasses","awesome"]},{emoji:"🤓",name:"nerd face",category:"smileys",keywords:["nerd","geek","smart"]},{emoji:"🧐",name:"face with monocle",category:"smileys",keywords:["monocle","fancy","inspection"]},{emoji:"👋",name:"waving hand",category:"people",keywords:["wave","hello","goodbye"]},{emoji:"🤚",name:"raised back of hand",category:"people",keywords:["hand","stop"]},{emoji:"🖐️",name:"hand with fingers splayed",category:"people",keywords:["hand","five"]},{emoji:"✋",name:"raised hand",category:"people",keywords:["hand","stop","high five"]},{emoji:"🖖",name:"vulcan salute",category:"people",keywords:["spock","vulcan"]},{emoji:"👌",name:"OK hand",category:"people",keywords:["ok","perfect"]},{emoji:"🤌",name:"pinched fingers",category:"people",keywords:["italian","chef kiss"]},{emoji:"🤏",name:"pinching hand",category:"people",keywords:["small","tiny"]},{emoji:"✌️",name:"victory hand",category:"people",keywords:["peace","victory"]},{emoji:"🤞",name:"crossed fingers",category:"people",keywords:["luck","hope"]},{emoji:"🤟",name:"love-you gesture",category:"people",keywords:["love","you"]},{emoji:"🤘",name:"sign of the horns",category:"people",keywords:["rock","metal"]},{emoji:"🤙",name:"call me hand",category:"people",keywords:["call","phone"]},{emoji:"👈",name:"backhand index pointing left",category:"people",keywords:["point","left"]},{emoji:"👉",name:"backhand index pointing right",category:"people",keywords:["point","right"]},{emoji:"👆",name:"backhand index pointing up",category:"people",keywords:["point","up"]},{emoji:"🖕",name:"middle finger",category:"people",keywords:["middle finger","rude"]},{emoji:"👇",name:"backhand index pointing down",category:"people",keywords:["point","down"]},{emoji:"☝️",name:"index pointing up",category:"people",keywords:["point","up","one"]},{emoji:"👍",name:"thumbs up",category:"people",keywords:["thumbs up","good","yes"]},{emoji:"👎",name:"thumbs down",category:"people",keywords:["thumbs down","bad","no"]},{emoji:"✊",name:"raised fist",category:"people",keywords:["fist","power","solidarity"]},{emoji:"👊",name:"oncoming fist",category:"people",keywords:["fist","punch","bump"]},{emoji:"🤛",name:"left-facing fist",category:"people",keywords:["fist","bump","left"]},{emoji:"🤜",name:"right-facing fist",category:"people",keywords:["fist","bump","right"]},{emoji:"👏",name:"clapping hands",category:"people",keywords:["clap","applause","bravo"]},{emoji:"🙌",name:"raising hands",category:"people",keywords:["celebration","hooray","praise"]},{emoji:"👐",name:"open hands",category:"people",keywords:["open","hug","jazz hands"]},{emoji:"🤲",name:"palms up together",category:"people",keywords:["prayer","please","hope"]},{emoji:"🤝",name:"handshake",category:"people",keywords:["handshake","deal","agreement"]},{emoji:"🙏",name:"folded hands",category:"people",keywords:["prayer","thanks","please"]},{emoji:"✍️",name:"writing hand",category:"people",keywords:["write","author","signature"]},{emoji:"💅",name:"nail polish",category:"people",keywords:["nails","beauty","manicure"]},{emoji:"🤳",name:"selfie",category:"people",keywords:["selfie","camera","phone"]},{emoji:"💪",name:"flexed biceps",category:"people",keywords:["muscle","strong","flex"]},{emoji:"🦾",name:"mechanical arm",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦿",name:"mechanical leg",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦵",name:"leg",category:"people",keywords:["leg","limb","kick"]},{emoji:"🦶",name:"foot",category:"people",keywords:["foot","kick","stomp"]},{emoji:"👂",name:"ear",category:"people",keywords:["ear","hear","listen"]},{emoji:"🦻",name:"ear with hearing aid",category:"people",keywords:["hearing aid","deaf","accessibility"]},{emoji:"👃",name:"nose",category:"people",keywords:["nose","smell","sniff"]},{emoji:"🧠",name:"brain",category:"people",keywords:["brain","smart","think"]},{emoji:"🫀",name:"anatomical heart",category:"people",keywords:["heart","organ","love"]},{emoji:"🫁",name:"lungs",category:"people",keywords:["lungs","breathe","organ"]},{emoji:"🦷",name:"tooth",category:"people",keywords:["tooth","dental","smile"]},{emoji:"🦴",name:"bone",category:"people",keywords:["bone","skeleton","dog"]},{emoji:"👀",name:"eyes",category:"people",keywords:["eyes","look","see"]},{emoji:"👁️",name:"eye",category:"people",keywords:["eye","see","watch"]},{emoji:"👅",name:"tongue",category:"people",keywords:["tongue","taste","lick"]},{emoji:"👄",name:"mouth",category:"people",keywords:["mouth","lips","kiss"]},{emoji:"🫦",name:"biting lip",category:"people",keywords:["lip","bite","nervous"]},{emoji:"👶",name:"baby",category:"people",keywords:["baby","infant","child"]},{emoji:"🧒",name:"child",category:"people",keywords:["child","kid","young"]},{emoji:"👦",name:"boy",category:"people",keywords:["boy","child","male"]},{emoji:"👧",name:"girl",category:"people",keywords:["girl","child","female"]},{emoji:"🧑",name:"person",category:"people",keywords:["person","adult","human"]},{emoji:"👱",name:"person: blond hair",category:"people",keywords:["blond","hair","person"]},{emoji:"👨",name:"man",category:"people",keywords:["man","male","adult"]},{emoji:"🧔",name:"person: beard",category:"people",keywords:["beard","man","facial hair"]},{emoji:"👩",name:"woman",category:"people",keywords:["woman","female","adult"]},{emoji:"🧓",name:"older person",category:"people",keywords:["old","elderly","senior"]},{emoji:"👴",name:"old man",category:"people",keywords:["old","man","elderly"]},{emoji:"👵",name:"old woman",category:"people",keywords:["old","woman","elderly"]},{emoji:"🐶",name:"dog face",category:"animals",keywords:["dog","pet","animal"]},{emoji:"🐱",name:"cat face",category:"animals",keywords:["cat","pet","animal"]},{emoji:"🐭",name:"mouse face",category:"animals",keywords:["mouse","animal"]},{emoji:"🐹",name:"hamster",category:"animals",keywords:["hamster","pet"]},{emoji:"🐰",name:"rabbit face",category:"animals",keywords:["rabbit","bunny"]},{emoji:"🦊",name:"fox",category:"animals",keywords:["fox","animal"]},{emoji:"🐻",name:"bear",category:"animals",keywords:["bear","animal"]},{emoji:"🐼",name:"panda",category:"animals",keywords:["panda","bear"]},{emoji:"🐨",name:"koala",category:"animals",keywords:["koala","australia","marsupial"]},{emoji:"🐯",name:"tiger face",category:"animals",keywords:["tiger","cat","wild"]},{emoji:"🦁",name:"lion",category:"animals",keywords:["lion","king","cat"]},{emoji:"🐮",name:"cow face",category:"animals",keywords:["cow","moo","farm"]},{emoji:"🐷",name:"pig face",category:"animals",keywords:["pig","oink","farm"]},{emoji:"🐽",name:"pig nose",category:"animals",keywords:["pig","nose","snout"]},{emoji:"🐸",name:"frog",category:"animals",keywords:["frog","amphibian","green"]},{emoji:"🐵",name:"monkey face",category:"animals",keywords:["monkey","primate","banana"]},{emoji:"🙈",name:"see-no-evil monkey",category:"animals",keywords:["monkey","see no evil","eyes"]},{emoji:"🙉",name:"hear-no-evil monkey",category:"animals",keywords:["monkey","hear no evil","ears"]},{emoji:"🙊",name:"speak-no-evil monkey",category:"animals",keywords:["monkey","speak no evil","mouth"]},{emoji:"🐒",name:"monkey",category:"animals",keywords:["monkey","primate","zoo"]},{emoji:"🦍",name:"gorilla",category:"animals",keywords:["gorilla","ape","strong"]},{emoji:"🦧",name:"orangutan",category:"animals",keywords:["orangutan","ape","orange"]},{emoji:"🐺",name:"wolf",category:"animals",keywords:["wolf","howl","wild"]},{emoji:"🐗",name:"boar",category:"animals",keywords:["boar","pig","wild"]},{emoji:"🐴",name:"horse face",category:"animals",keywords:["horse","neigh","ride"]},{emoji:"🐎",name:"horse",category:"animals",keywords:["horse","racing","gallop"]},{emoji:"🦄",name:"unicorn",category:"animals",keywords:["unicorn","magical","horn"]},{emoji:"🦓",name:"zebra",category:"animals",keywords:["zebra","stripes","africa"]},{emoji:"🦌",name:"deer",category:"animals",keywords:["deer","antlers","forest"]},{emoji:"🦏",name:"rhinoceros",category:"animals",keywords:["rhino","horn","africa"]},{emoji:"🦛",name:"hippopotamus",category:"animals",keywords:["hippo","water","africa"]},{emoji:"🐘",name:"elephant",category:"animals",keywords:["elephant","trunk","memory"]},{emoji:"🦒",name:"giraffe",category:"animals",keywords:["giraffe","tall","neck"]},{emoji:"🦘",name:"kangaroo",category:"animals",keywords:["kangaroo","hop","australia"]},{emoji:"🦥",name:"sloth",category:"animals",keywords:["sloth","slow","lazy"]},{emoji:"🦦",name:"otter",category:"animals",keywords:["otter","water","cute"]},{emoji:"🦨",name:"skunk",category:"animals",keywords:["skunk","smell","stripe"]},{emoji:"🦡",name:"badger",category:"animals",keywords:["badger","honey","dig"]},{emoji:"🐾",name:"paw prints",category:"animals",keywords:["paw","prints","tracks"]},{emoji:"🐔",name:"chicken",category:"animals",keywords:["chicken","rooster","farm"]},{emoji:"🐓",name:"rooster",category:"animals",keywords:["rooster","cock","morning"]},{emoji:"🐣",name:"hatching chick",category:"animals",keywords:["chick","hatching","egg"]},{emoji:"🐤",name:"baby chick",category:"animals",keywords:["chick","baby","yellow"]},{emoji:"🐥",name:"front-facing baby chick",category:"animals",keywords:["chick","baby","cute"]},{emoji:"🦆",name:"duck",category:"animals",keywords:["duck","quack","water"]},{emoji:"🦅",name:"eagle",category:"animals",keywords:["eagle","bird","freedom"]},{emoji:"🦉",name:"owl",category:"animals",keywords:["owl","wise","night"]},{emoji:"🦇",name:"bat",category:"animals",keywords:["bat","vampire","night"]},{emoji:"",name:"bug",category:"animals",keywords:["bug","insect","crawl"]},{emoji:"🦋",name:"butterfly",category:"animals",keywords:["butterfly","beautiful","fly"]},{emoji:"🐌",name:"snail",category:"animals",keywords:["snail","slow","shell"]},{emoji:"🐞",name:"lady beetle",category:"animals",keywords:["ladybug","beetle","red"]},{emoji:"🐜",name:"ant",category:"animals",keywords:["ant","work","colony"]},{emoji:"🦟",name:"mosquito",category:"animals",keywords:["mosquito","bite","buzz"]},{emoji:"🕷️",name:"spider",category:"animals",keywords:["spider","web","eight legs"]},{emoji:"🦂",name:"scorpion",category:"animals",keywords:["scorpion","sting","desert"]},{emoji:"🐢",name:"turtle",category:"animals",keywords:["turtle","slow","shell"]},{emoji:"🐍",name:"snake",category:"animals",keywords:["snake","slither","reptile"]},{emoji:"🦎",name:"lizard",category:"animals",keywords:["lizard","gecko","reptile"]},{emoji:"🐙",name:"octopus",category:"animals",keywords:["octopus","tentacles","sea"]},{emoji:"🦑",name:"squid",category:"animals",keywords:["squid","tentacles","ocean"]},{emoji:"🦐",name:"shrimp",category:"animals",keywords:["shrimp","seafood","small"]},{emoji:"🦞",name:"lobster",category:"animals",keywords:["lobster","claws","red"]},{emoji:"🦀",name:"crab",category:"animals",keywords:["crab","claws","beach"]},{emoji:"🐡",name:"blowfish",category:"animals",keywords:["blowfish","puffer","spiky"]},{emoji:"🐠",name:"tropical fish",category:"animals",keywords:["fish","tropical","colorful"]},{emoji:"🐟",name:"fish",category:"animals",keywords:["fish","swim","water"]},{emoji:"🐬",name:"dolphin",category:"animals",keywords:["dolphin","smart","ocean"]},{emoji:"🐳",name:"spouting whale",category:"animals",keywords:["whale","spout","big"]},{emoji:"🐋",name:"whale",category:"animals",keywords:["whale","ocean","huge"]},{emoji:"🦈",name:"shark",category:"animals",keywords:["shark","teeth","dangerous"]},{emoji:"🐊",name:"crocodile",category:"animals",keywords:["crocodile","teeth","swamp"]},{emoji:"🌸",name:"cherry blossom",category:"animals",keywords:["flower","spring","pink"]},{emoji:"💐",name:"bouquet",category:"animals",keywords:["flowers","bouquet","gift"]},{emoji:"🌺",name:"hibiscus",category:"animals",keywords:["flower","tropical","red"]},{emoji:"🌻",name:"sunflower",category:"animals",keywords:["sunflower","yellow","big"]},{emoji:"🌹",name:"rose",category:"animals",keywords:["rose","love","red"]},{emoji:"🥀",name:"wilted flower",category:"animals",keywords:["flower","wilted","sad"]},{emoji:"🌷",name:"tulip",category:"animals",keywords:["tulip","spring","netherlands"]},{emoji:"🌼",name:"daisy",category:"animals",keywords:["daisy","white","simple"]},{emoji:"🌱",name:"seedling",category:"animals",keywords:["plant","grow","green"]},{emoji:"🌿",name:"herb",category:"animals",keywords:["herb","green","leaf"]},{emoji:"🍀",name:"four leaf clover",category:"animals",keywords:["clover","luck","green"]},{emoji:"🌳",name:"deciduous tree",category:"animals",keywords:["tree","nature","green"]},{emoji:"🌲",name:"evergreen tree",category:"animals",keywords:["tree","pine","christmas"]},{emoji:"🌴",name:"palm tree",category:"animals",keywords:["palm","tropical","beach"]},{emoji:"🌵",name:"cactus",category:"animals",keywords:["cactus","desert","spiky"]},{emoji:"🍎",name:"red apple",category:"food",keywords:["apple","fruit"]},{emoji:"🍊",name:"tangerine",category:"food",keywords:["orange","fruit"]},{emoji:"🍋",name:"lemon",category:"food",keywords:["lemon","fruit"]},{emoji:"🍌",name:"banana",category:"food",keywords:["banana","fruit"]},{emoji:"🍉",name:"watermelon",category:"food",keywords:["watermelon","fruit"]},{emoji:"🍇",name:"grapes",category:"food",keywords:["grapes","fruit"]},{emoji:"🍓",name:"strawberry",category:"food",keywords:["strawberry","fruit"]},{emoji:"🫐",name:"blueberries",category:"food",keywords:["blueberry","fruit"]},{emoji:"🥝",name:"kiwi fruit",category:"food",keywords:["kiwi","fruit","green"]},{emoji:"🍅",name:"tomato",category:"food",keywords:["tomato","red","vegetable"]},{emoji:"🫒",name:"olive",category:"food",keywords:["olive","green","oil"]},{emoji:"🥥",name:"coconut",category:"food",keywords:["coconut","tropical","milk"]},{emoji:"🥑",name:"avocado",category:"food",keywords:["avocado","green","healthy"]},{emoji:"🍆",name:"eggplant",category:"food",keywords:["eggplant","purple","vegetable"]},{emoji:"🥔",name:"potato",category:"food",keywords:["potato","vegetable","starch"]},{emoji:"🥕",name:"carrot",category:"food",keywords:["carrot","orange","vegetable"]},{emoji:"🌽",name:"ear of corn",category:"food",keywords:["corn","yellow","vegetable"]},{emoji:"🌶️",name:"hot pepper",category:"food",keywords:["pepper","hot","spicy"]},{emoji:"🫑",name:"bell pepper",category:"food",keywords:["pepper","bell","vegetable"]},{emoji:"🥒",name:"cucumber",category:"food",keywords:["cucumber","green","vegetable"]},{emoji:"🥬",name:"leafy greens",category:"food",keywords:["lettuce","greens","salad"]},{emoji:"🥦",name:"broccoli",category:"food",keywords:["broccoli","green","vegetable"]},{emoji:"🧄",name:"garlic",category:"food",keywords:["garlic","flavor","cooking"]},{emoji:"🧅",name:"onion",category:"food",keywords:["onion","cry","cooking"]},{emoji:"🍄",name:"mushroom",category:"food",keywords:["mushroom","fungi","cooking"]},{emoji:"🥜",name:"peanuts",category:"food",keywords:["peanuts","nuts","snack"]},{emoji:"🌰",name:"chestnut",category:"food",keywords:["chestnut","nut","autumn"]},{emoji:"🍞",name:"bread",category:"food",keywords:["bread","loaf","carbs"]},{emoji:"🥐",name:"croissant",category:"food",keywords:["croissant","french","pastry"]},{emoji:"🥖",name:"baguette bread",category:"food",keywords:["baguette","french","bread"]},{emoji:"🫓",name:"flatbread",category:"food",keywords:["flatbread","bread","thin"]},{emoji:"🥨",name:"pretzel",category:"food",keywords:["pretzel","twisted","snack"]},{emoji:"🥯",name:"bagel",category:"food",keywords:["bagel","round","breakfast"]},{emoji:"🥞",name:"pancakes",category:"food",keywords:["pancakes","breakfast","syrup"]},{emoji:"🧇",name:"waffle",category:"food",keywords:["waffle","breakfast","squares"]},{emoji:"🧀",name:"cheese wedge",category:"food",keywords:["cheese","dairy","yellow"]},{emoji:"🍖",name:"meat on bone",category:"food",keywords:["meat","bone","protein"]},{emoji:"🍗",name:"poultry leg",category:"food",keywords:["chicken","leg","meat"]},{emoji:"🥩",name:"cut of meat",category:"food",keywords:["steak","meat","red"]},{emoji:"🥓",name:"bacon",category:"food",keywords:["bacon","pork","breakfast"]},{emoji:"🍔",name:"hamburger",category:"food",keywords:["burger","hamburger","fast food"]},{emoji:"🍟",name:"french fries",category:"food",keywords:["fries","potato","fast food"]},{emoji:"🍕",name:"pizza",category:"food",keywords:["pizza","slice","italian"]},{emoji:"🌭",name:"hot dog",category:"food",keywords:["hot dog","sausage","fast food"]},{emoji:"🥪",name:"sandwich",category:"food",keywords:["sandwich","bread","lunch"]},{emoji:"🌮",name:"taco",category:"food",keywords:["taco","mexican","shell"]},{emoji:"🌯",name:"burrito",category:"food",keywords:["burrito","wrap","mexican"]},{emoji:"🫔",name:"tamale",category:"food",keywords:["tamale","mexican","corn"]},{emoji:"🥙",name:"stuffed flatbread",category:"food",keywords:["pita","flatbread","stuffed"]},{emoji:"🧆",name:"falafel",category:"food",keywords:["falafel","middle eastern","chickpea"]},{emoji:"🥚",name:"egg",category:"food",keywords:["egg","protein","breakfast"]},{emoji:"🍳",name:"cooking",category:"food",keywords:["cooking","frying pan","egg"]},{emoji:"🥘",name:"shallow pan of food",category:"food",keywords:["paella","pan","cooking"]},{emoji:"🍲",name:"pot of food",category:"food",keywords:["stew","pot","cooking"]},{emoji:"🫕",name:"fondue",category:"food",keywords:["fondue","cheese","pot"]},{emoji:"🥣",name:"bowl with spoon",category:"food",keywords:["bowl","cereal","soup"]},{emoji:"🥗",name:"green salad",category:"food",keywords:["salad","healthy","greens"]},{emoji:"🍿",name:"popcorn",category:"food",keywords:["popcorn","movie","snack"]},{emoji:"🧈",name:"butter",category:"food",keywords:["butter","dairy","spread"]},{emoji:"🧂",name:"salt",category:"food",keywords:["salt","seasoning","white"]},{emoji:"🥫",name:"canned food",category:"food",keywords:["can","canned","preserved"]},{emoji:"🍱",name:"bento box",category:"food",keywords:["bento","japanese","lunch box"]},{emoji:"🍘",name:"rice cracker",category:"food",keywords:["rice","cracker","japanese"]},{emoji:"🍙",name:"rice ball",category:"food",keywords:["rice ball","onigiri","japanese"]},{emoji:"🍚",name:"cooked rice",category:"food",keywords:["rice","cooked","bowl"]},{emoji:"🍛",name:"curry rice",category:"food",keywords:["curry","rice","spicy"]},{emoji:"🍜",name:"steaming bowl",category:"food",keywords:["ramen","noodles","soup"]},{emoji:"🍝",name:"spaghetti",category:"food",keywords:["spaghetti","pasta","italian"]},{emoji:"🍠",name:"roasted sweet potato",category:"food",keywords:["sweet potato","roasted","orange"]},{emoji:"🍢",name:"oden",category:"food",keywords:["oden","japanese","skewer"]},{emoji:"🍣",name:"sushi",category:"food",keywords:["sushi","japanese","fish"]},{emoji:"🍤",name:"fried shrimp",category:"food",keywords:["shrimp","fried","tempura"]},{emoji:"🍥",name:"fish cake with swirl",category:"food",keywords:["fish cake","japanese","swirl"]},{emoji:"🥮",name:"moon cake",category:"food",keywords:["moon cake","chinese","festival"]},{emoji:"🍡",name:"dango",category:"food",keywords:["dango","japanese","sweet"]},{emoji:"🥟",name:"dumpling",category:"food",keywords:["dumpling","chinese","steamed"]},{emoji:"🥠",name:"fortune cookie",category:"food",keywords:["fortune cookie","chinese","luck"]},{emoji:"🥡",name:"takeout box",category:"food",keywords:["takeout","chinese","box"]},{emoji:"🦀",name:"crab",category:"food",keywords:["crab","seafood","claws"]},{emoji:"🦞",name:"lobster",category:"food",keywords:["lobster","seafood","red"]},{emoji:"🦐",name:"shrimp",category:"food",keywords:["shrimp","seafood","small"]},{emoji:"🦑",name:"squid",category:"food",keywords:["squid","seafood","tentacles"]},{emoji:"🦪",name:"oyster",category:"food",keywords:["oyster","seafood","shell"]},{emoji:"🍦",name:"soft ice cream",category:"food",keywords:["ice cream","soft serve","cone"]},{emoji:"🍧",name:"shaved ice",category:"food",keywords:["shaved ice","snow cone","cold"]},{emoji:"🍨",name:"ice cream",category:"food",keywords:["ice cream","dessert","cold"]},{emoji:"🍩",name:"doughnut",category:"food",keywords:["donut","doughnut","sweet"]},{emoji:"🍪",name:"cookie",category:"food",keywords:["cookie","sweet","baked"]},{emoji:"🎂",name:"birthday cake",category:"food",keywords:["cake","birthday","celebration"]},{emoji:"🍰",name:"shortcake",category:"food",keywords:["cake","slice","dessert"]},{emoji:"🧁",name:"cupcake",category:"food",keywords:["cupcake","muffin","sweet"]},{emoji:"🥧",name:"pie",category:"food",keywords:["pie","dessert","slice"]},{emoji:"🍫",name:"chocolate bar",category:"food",keywords:["chocolate","bar","sweet"]},{emoji:"🍬",name:"candy",category:"food",keywords:["candy","sweet","wrapper"]},{emoji:"🍭",name:"lollipop",category:"food",keywords:["lollipop","candy","stick"]},{emoji:"🍮",name:"custard",category:"food",keywords:["custard","pudding","dessert"]},{emoji:"🍯",name:"honey pot",category:"food",keywords:["honey","sweet","bee"]},{emoji:"🍼",name:"baby bottle",category:"food",keywords:["bottle","baby","milk"]},{emoji:"🥛",name:"glass of milk",category:"food",keywords:["milk","glass","dairy"]},{emoji:"☕",name:"hot beverage",category:"food",keywords:["coffee","tea","hot"]},{emoji:"🫖",name:"teapot",category:"food",keywords:["teapot","tea","hot"]},{emoji:"🍵",name:"teacup without handle",category:"food",keywords:["tea","green tea","cup"]},{emoji:"🍶",name:"sake",category:"food",keywords:["sake","japanese","alcohol"]},{emoji:"🍾",name:"bottle with popping cork",category:"food",keywords:["champagne","celebration","cork"]},{emoji:"🍷",name:"wine glass",category:"food",keywords:["wine","glass","alcohol"]},{emoji:"🍸",name:"cocktail glass",category:"food",keywords:["cocktail","martini","alcohol"]},{emoji:"🍹",name:"tropical drink",category:"food",keywords:["tropical","cocktail","umbrella"]},{emoji:"🍺",name:"beer mug",category:"food",keywords:["beer","mug","alcohol"]},{emoji:"🍻",name:"clinking beer mugs",category:"food",keywords:["beer","cheers","celebration"]},{emoji:"🥂",name:"clinking glasses",category:"food",keywords:["champagne","cheers","celebration"]},{emoji:"🥃",name:"tumbler glass",category:"food",keywords:["whiskey","tumbler","alcohol"]},{emoji:"🫗",name:"pouring liquid",category:"food",keywords:["pour","liquid","drink"]},{emoji:"🥤",name:"cup with straw",category:"food",keywords:["soda","straw","drink"]},{emoji:"🧋",name:"bubble tea",category:"food",keywords:["bubble tea","boba","drink"]},{emoji:"🧃",name:"beverage box",category:"food",keywords:["juice box","drink","straw"]},{emoji:"🧉",name:"mate",category:"food",keywords:["mate","tea","south american"]},{emoji:"🧊",name:"ice",category:"food",keywords:["ice","cold","cube"]},{emoji:"⚽",name:"soccer ball",category:"activities",keywords:["soccer","football","sport"]},{emoji:"🏀",name:"basketball",category:"activities",keywords:["basketball","sport"]},{emoji:"🏈",name:"american football",category:"activities",keywords:["football","sport"]},{emoji:"⚾",name:"baseball",category:"activities",keywords:["baseball","sport"]},{emoji:"🥎",name:"softball",category:"activities",keywords:["softball","sport"]},{emoji:"🎾",name:"tennis",category:"activities",keywords:["tennis","sport"]},{emoji:"🚗",name:"automobile",category:"travel",keywords:["car","vehicle"]},{emoji:"🚕",name:"taxi",category:"travel",keywords:["taxi","car"]},{emoji:"🚙",name:"sport utility vehicle",category:"travel",keywords:["suv","car"]},{emoji:"🚌",name:"bus",category:"travel",keywords:["bus","vehicle"]},{emoji:"🚎",name:"trolleybus",category:"travel",keywords:["trolley","bus"]},{emoji:"🏎️",name:"racing car",category:"travel",keywords:["race","car","fast"]},{emoji:"💡",name:"light bulb",category:"objects",keywords:["idea","light","bulb"]},{emoji:"🔋",name:"battery",category:"objects",keywords:["battery","power"]},{emoji:"🖥️",name:"desktop computer",category:"objects",keywords:["computer","desktop"]},{emoji:"💻",name:"laptop",category:"objects",keywords:["laptop","computer"]},{emoji:"📱",name:"mobile phone",category:"objects",keywords:["phone","mobile"]},{emoji:"☎️",name:"telephone",category:"objects",keywords:["phone","telephone"]},{emoji:"❤️",name:"red heart",category:"symbols",keywords:["love","heart"]},{emoji:"🧡",name:"orange heart",category:"symbols",keywords:["love","heart"]},{emoji:"💛",name:"yellow heart",category:"symbols",keywords:["love","heart"]},{emoji:"💚",name:"green heart",category:"symbols",keywords:["love","heart"]},{emoji:"💙",name:"blue heart",category:"symbols",keywords:["love","heart"]},{emoji:"💜",name:"purple heart",category:"symbols",keywords:["love","heart"]},{emoji:"🖤",name:"black heart",category:"symbols",keywords:["love","heart"]},{emoji:"🤍",name:"white heart",category:"symbols",keywords:["love","heart"]},{emoji:"🏁",name:"chequered flag",category:"flags",keywords:["flag","race","finish"]},{emoji:"🚩",name:"triangular flag",category:"flags",keywords:["flag","warning"]},{emoji:"🏳️",name:"white flag",category:"flags",keywords:["flag","surrender"]},{emoji:"🏴",name:"black flag",category:"flags",keywords:["flag","pirate"]},{emoji:"🏳️‍🌈",name:"rainbow flag",category:"flags",keywords:["flag","rainbow","pride"]}],Yn=e=>{const{value:o,defaultValue:t="",onChange:n,onEmojiSelect:i,isOpen:a,onOpen:l,onClose:d,closeOnSelect:s=!0,maxRecentEmojis:g=16,showRecentEmojis:p=!0,enabledCategories:m=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:h=[]}=e,[f,x]=u.useState(a??!1),[y,b]=u.useState(o??t),[k,C]=u.useState(""),[w,j]=u.useState("smileys"),[S,I]=u.useState([]),M=u.useRef(null),z=u.useRef(null),E=u.useMemo(()=>[...qg,...h],[h]),_=u.useMemo(()=>{let P=E;if(w!=="recent"?P=P.filter(H=>H.category===w):P=S,k){const H=k.toLowerCase();P=P.filter(L=>L.name.toLowerCase().includes(H)||L.keywords.some(A=>A.toLowerCase().includes(H)))}return P},[E,w,S,k]);u.useEffect(()=>{o!==void 0&&b(o)},[o]),u.useEffect(()=>{a!==void 0&&x(a)},[a]),u.useEffect(()=>{if(p){const P=localStorage.getItem("emojiPicker-recentEmojis");if(P)try{I(JSON.parse(P))}catch{}}},[p]),u.useEffect(()=>{const P=H=>{f&&M.current&&z.current&&!M.current.contains(H.target)&&!z.current.contains(H.target)&&W()};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[f]);const T=u.useCallback(P=>{p&&I(H=>{const L=H.filter(F=>F.emoji!==P.emoji),A=[P,...L].slice(0,g);return localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(A)),A})},[p,g]),$=u.useCallback(()=>{const P=!f;x(P),P?(l==null||l(),C(""),p&&S.length>0?j("recent"):j("smileys")):d==null||d()},[f,l,d,p,S.length]),B=u.useCallback(P=>{b(P.emoji),T(P),n==null||n(P.emoji),i==null||i(P),s&&(x(!1),d==null||d())},[n,i,s,d,T]),R=u.useCallback(P=>{C(P),P&&w==="recent"&&j("smileys")},[w]),V=u.useCallback(P=>{j(P),C("")},[]),W=u.useCallback(()=>{x(!1),d==null||d()},[d]);return{isOpen:f,selectedEmoji:y,recentEmojis:S,searchQuery:k,activeCategory:w,filteredEmojis:_,handleToggle:$,handleEmojiSelect:B,handleSearchChange:R,handleCategoryChange:V,handleClose:W,triggerRef:M,dropdownRef:z}},vn=({id:e,name:o,label:t,placeholder:n="Select an emoji",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",error:g=!1,isDisabled:p=!1,isReadOnly:m=!1,showSearch:h=!0,showCategories:f=!0,showRecentEmojis:x=!0,enabledCategories:y=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:b,selectedEmoji:k,recentEmojis:C,searchQuery:w,activeCategory:j,filteredEmojis:S,handleToggle:I,handleEmojiSelect:M,handleSearchChange:z,handleCategoryChange:E,triggerRef:_,dropdownRef:T,onChange:$,...B})=>{const{getColor:R}=c.useTheme(),V={...Me.container,...a==null?void 0:a.container},W={...Me.trigger,...Ag[l],...Dg[d],...Fg[s],...g&&{borderColor:"color-red-500"},...p&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},P={...Me.dropdown,...a==null?void 0:a.dropdown},H={...Me.categoryTabs,...a==null?void 0:a.categoryTabs},L={...Me.emojiGrid,...a==null?void 0:a.emojiGrid},A=y.filter(F=>F==="recent"?x&&C.length>0:!0);return r.jsxs(c.View,{...V,...B,children:[t&&r.jsx(c.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:_,onClick:p||m?void 0:I,...W,children:[r.jsx(c.Horizontal,{alignItems:"center",gap:8,children:r.jsx(c.Text,{color:k?"color-gray-800":"color-gray-500",fontSize:"inherit",children:k||n})}),!m&&!p&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:b?"up":"down"})]}),b&&r.jsxs(c.View,{ref:T,...P,children:[h&&r.jsx(c.View,{...Me.searchInput,...a==null?void 0:a.searchInput,children:r.jsx(xo,{placeholder:"Search emojis...",value:w,onChange:F=>z(F.target.value),size:"sm"})}),f&&r.jsx(c.View,{...H,children:A.map(F=>r.jsx(c.View,{...Me.categoryTab,...j===F&&{borderBottomColor:"color-blue-500",color:"color-blue-600"},onClick:()=>E(F),title:F.charAt(0).toUpperCase()+F.slice(1),...a==null?void 0:a.categoryTab,children:Og[F]},F))}),r.jsx(c.View,{...L,children:S.length>0?S.map((F,D)=>r.jsx(c.View,{...Me.emoji,onClick:()=>M(F),title:F.name,_hover:{backgroundColor:"color-gray-100"},color:"color-gray-800",...a==null?void 0:a.emoji,children:F.emoji},`${F.emoji}-${D}`)):r.jsx(c.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(c.Text,{fontSize:"14px",children:w?"No emojis found":"No emojis in this category"})})})]}),i&&r.jsx(c.Text,{color:g?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i})]})},Ng=e=>{const o=ue(e),t={...e,value:o.value??e.value??e.defaultValue},n=Yn(t),i=a=>{var l;n.handleEmojiSelect(a),o.onChange(a.emoji),(l=e.onEmojiSelect)==null||l.call(e,a)};return r.jsx(vn,{...n,...t,handleEmojiSelect:i})},Ug=Ng,Gg=({files:e,onRemove:o,maxHeight:t="120px",views:n={}})=>{if(e.length===0)return null;const i=u.useCallback(a=>a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(1)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(c.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:t,overflowY:"auto",...n==null?void 0:n.container,children:e.map((a,l)=>{const d=a.url||"",s=a.type.startsWith("image/"),g=a.type.startsWith("video/"),p=a.type.startsWith("audio/");return r.jsx(c.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",position:"relative",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...n==null?void 0:n.item,children:r.jsxs(he,{children:[r.jsx(he.Trigger,{children:r.jsxs(c.View,{position:"relative",children:[s&&d&&r.jsx(c.Image,{src:d,alt:a.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),g&&d&&r.jsx(c.View,{as:"video",src:d,alt:a.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),p&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(Fo,{widthHeight:24,color:"color-black"})}),!s&&!g&&!p&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(go,{widthHeight:24,color:"color-black"})}),o&&r.jsx(c.Button,{position:"absolute",top:"-4px",right:"-4px",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",backgroundColor:"color-red-500",color:"white",fontSize:14,fontWeight:"bold",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:"2px solid white",_hover:{backgroundColor:"color-red-600"},onClick:m=>{m.stopPropagation(),o(l)},"aria-label":`Remove ${a.name}`,children:"×"})]})}),r.jsxs(he.Content,{children:[s&&d&&r.jsx(c.Image,{src:d,alt:a.name,maxWidth:"300px"}),g&&d&&r.jsx(c.View,{as:"video",src:d,controls:!0,maxWidth:"300px"}),p&&d&&r.jsx(c.View,{as:"audio",src:d,controls:!0,width:"100%"}),r.jsxs(c.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",fontSize:12,...n==null?void 0:n.name,children:[a.name," (",i(a.size),")"]})]})]})},l)})})},Yg=e=>{const o=Bn(e);return r.jsx(Ln,{...e,...o})},vg=Yg,Xg=({url:e,type:o,name:t,onOpen:n})=>{const i=o.toLowerCase(),a=i.startsWith("image"),l=i.startsWith("video"),d=i.startsWith("audio"),s=()=>{n&&n()};return r.jsxs(c.View,{width:"60px",height:"60px",flexShrink:0,borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-200",cursor:"pointer",onClick:s,children:[a&&r.jsx(c.Image,{src:e,alt:t,width:"100%",height:"100%",objectFit:"cover"}),l&&r.jsx(c.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:g=>g.stopPropagation()}),d&&r.jsx(c.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:g=>g.stopPropagation()}),!a&&!l&&!d&&r.jsx(go,{widthHeight:24,color:"color-gray-600"})]})},Re=jt.create(e=>({modals:[],onHide:o=>o,onShow:(o,t)=>({name:o,props:t}),show:(o,t={},n={})=>{e(i=>({...i,modals:[...i.modals,{name:o,props:{...t,isVisible:!0},overlayProps:n}]}))},hide:o=>{e(t=>o?{...t,modals:t.modals.filter(n=>n.name!==o)}:{modals:[]})},setOnHide:o=>{e(t=>({...t,onHide:o}))},setOnShow:o=>{e(t=>({...t,onShow:o}))}})),Kg=(e,o={},t={})=>{Re.getState().show(e,o,t),Re.getState().onShow(e,o)},Dt=e=>{console.log("hideModal",e),Re.getState().onHide(e),Re.getState().hide(typeof e=="string"?e:void 0)},Qg={square:{borderRadius:0},rounded:{borderRadius:"8px"}},Zg={center:{justifyContent:"center",alignItems:"center"},top:{justifyContent:"center",alignItems:"flex-start"},right:{justifyContent:"flex-end",alignItems:"center"},bottom:{justifyContent:"center",alignItems:"flex-end"},left:{justifyContent:"flex-start",alignItems:"center"}},Jg={xs:12,sm:16,md:20,lg:24,xl:28},wo={body:{fontSize:"16px",fontWeight:"400",lineHeight:"24px",color:"color-gray-700"}},Xn=u.memo(({children:e,blur:o,isOpen:t=!1,isClosePrevented:n=!1,onClose:i=()=>{},position:a="center",views:l,...d})=>{const s=u.useCallback(()=>{n||i()},[n,i]);return r.jsx(c.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:s,visibility:t?"visible":"hidden",transition:"all 0.3s ease",...l==null?void 0:l.container,children:r.jsx(c.View,{position:"absolute",top:0,left:0,zIndex:1e3,width:"100vw",height:"100vh",display:"flex",backgroundColor:"color-blackAlpha-500",backdropFilter:o?`blur(${o}px)`:void 0,transition:"all 0.3s ease",onClick:s,...Zg[a],...d,...l==null?void 0:l.view,children:e})})}),ep={boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"},op={elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},tp=u.memo(({children:e,shadow:o,isFullScreen:t=!1,shape:n="rounded",views:i,isOpen:a,...l})=>{const d=typeof document!==void 0?ep:op,s=u.useCallback(g=>{g&&g.stopPropagation&&g.stopPropagation()},[]);return r.jsx(c.Vertical,{cursor:"default",backgroundColor:"color-white",width:t?"100%":600,height:t?"100%":"fit-content",onClick:s,transition:"all 0.3s ease",...o||d,...Qg[n],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...l,...i==null?void 0:i.container,children:e})}),rp=u.memo(({children:e,buttonColor:o="theme-primary",iconSize:t="md",buttonPosition:n="right",views:i,...a})=>{const l=a.onClose?a.onClose:Dt,d=r.jsx(c.View,{onClick:l,children:r.jsx(fe,{widthHeight:Jg[t],color:o})});return r.jsxs(c.Horizontal,{justifyContent:n==="none"?"center":"space-between",alignItems:"center",paddingVertical:16,paddingHorizontal:24,borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",media:{mobile:{paddingVertical:12,paddingHorizontal:16}},...a,...i==null?void 0:i.header,children:[n==="left"&&d,e,n==="right"&&d]})}),np=u.memo(({children:e,views:o,...t})=>r.jsx(c.View,{paddingVertical:16,paddingHorizontal:24,fontSize:wo.body.fontSize,fontWeight:wo.body.fontWeight,lineHeight:wo.body.lineHeight,color:wo.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...t,...o==null?void 0:o.view,children:e})),ap=u.memo(({children:e,views:o,...t})=>r.jsx(c.Horizontal,{marginTop:"auto",alignItems:"center",justifyContent:"flex-end",paddingVertical:16,paddingHorizontal:24,borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",gap:12,media:{mobile:{paddingVertical:12,paddingHorizontal:16,gap:8}},...t,...o==null?void 0:o.container,children:e})),ip=({modals:e,onShow:o,onHide:t})=>{const n=Re(i=>i.modals);return o&&Re.getState().setOnShow(o),t&&Re.getState().setOnHide(t),n.length===0?null:r.jsx(u.Fragment,{children:n.map((i,a)=>{const l=e[i.name];return l?r.jsx(Xn,{isOpen:i.props.isVisible,onClose:()=>Dt(i.name),blur:5,...i.overlayProps,style:{zIndex:1e3+a},children:r.jsx(l,{...i.props})},a):(console.error(`${i.name} modal doesn't exist`),null)})})},Be=({children:e})=>r.jsx(r.Fragment,{children:e});Be.Overlay=Xn;Be.Container=tp;Be.Header=rp;Be.Body=np;Be.Footer=ap;Be.Layout=ip;const hr={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},lp={left:{top:0,left:0,bottom:0,height:"100vh",borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{top:0,right:0,bottom:0,height:"100vh",borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"},top:{top:0,left:0,right:0,width:"100vw",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},bottom:{bottom:0,left:0,right:0,width:"100vw",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200"}},Kn=({isOpen:e,onClose:o,isClosePrevented:t,blur:n,children:i,...a})=>{const l=()=>{t||o()};return u.useEffect(()=>{const d=s=>{s.key==="Escape"&&e&&!t&&o()};return e&&document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[e,t,o]),r.jsx(c.View,{"data-testid":"drawer-overlay",role:"dialog","aria-modal":"true",position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:1e3,visibility:e?"visible":"hidden",onClick:l,transition:"all 0.3s ease",backgroundColor:e?"color-blackAlpha-500":"transparent",backdropFilter:n?`blur(${n}px)`:void 0,pointerEvents:e?"auto":"none",...a,children:i})},Qn=({placement:e="right",size:o="md",children:t,...n})=>{const i=d=>{d.stopPropagation()},l=e==="top"||e==="bottom"?{height:o==="full"?"100vh":hr[o]||o,maxHeight:"100vh"}:{width:o==="full"?"100vw":hr[o]||o,maxWidth:"100vw"};return r.jsx(c.Vertical,{position:"absolute",backgroundColor:"color-white",...lp[e],...l,onClick:i,transition:"transform 0.3s ease",...n,children:t})},cp=({children:e,onClose:o,buttonPosition:t="right",...n})=>{const i=o&&r.jsx(c.View,{onClick:o,cursor:"pointer",padding:8,children:r.jsx(fe,{widthHeight:20,color:"color-gray-500"})});return r.jsxs(c.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderBottomWidth:"1px",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:t==="none"?"center":"space-between",...n,children:[t==="left"&&i,e,t==="right"&&i]})},sp=({children:e,...o})=>r.jsx(c.Vertical,{padding:24,flex:1,overflowY:"auto",...o,children:e}),dp=({children:e,...o})=>r.jsx(c.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderTopWidth:"1px",borderTopColor:"color-gray-200",alignItems:"center",justifyContent:"flex-end",gap:12,...o,children:e}),up=({isOpen:e,onClose:o,placement:t="right",size:n="md",isClosePrevented:i,children:a,...l})=>{const d=e?{}:{transform:t==="left"||t==="right"?`translateX(${t==="left"?"-100%":"100%"})`:`translateY(${t==="top"?"-100%":"100%"})`};return r.jsx(Kn,{isOpen:e,onClose:o,isClosePrevented:i,...l,children:r.jsx(Qn,{placement:t,size:n,style:d,children:a})})},Ze=up;Ze.Overlay=Kn;Ze.Container=Qn;Ze.Header=cp;Ze.Body=sp;Ze.Footer=dp;const gp=(e=null,o=[])=>{const[t,n]=u.useState(e),[i,a]=u.useState(o),l=u.useRef({});return{activeItemId:t,setActiveItemId:n,expandedItemIds:i,toggleExpandedItem:g=>{a(p=>p.includes(g)?p.filter(h=>h!==g):[...p,g])},isItemExpanded:g=>i.includes(g),triggerRefs:l}},xt={sm:{padding:"8px 12px",fontSize:"12px",fontWeight:"500",media:{mobile:{padding:"6px 10px",fontSize:"11px"}}},md:{padding:"12px 16px",fontSize:"14px",fontWeight:"500",media:{mobile:{padding:"10px 14px",fontSize:"13px"}}},lg:{padding:"16px 20px",fontSize:"16px",fontWeight:"500",media:{mobile:{padding:"12px 16px",fontSize:"14px"}}}},bt={default:{backgroundColor:"transparent",color:"color-gray-800",transition:"all 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"all 0.2s ease"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"all 0.2s ease"}},Zn={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},Ye={active:{backgroundColor:"color-blue-50",color:"color-blue-700",fontWeight:"600",borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"color-blue-600"},hover:{backgroundColor:"color-gray-100",transition:"background-color 0.2s ease"}},Jn=u.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),pp=({children:e,value:o})=>r.jsx(Jn.Provider,{value:o,children:e}),bo=()=>{const e=u.useContext(Jn);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},Ft=({children:e,views:o})=>{const{orientation:t}=bo(),n=t==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(n,{width:"100%",...Zn[t],transition:"all 0.2s ease",borderRadius:"4px",...o==null?void 0:o.container,children:e})},ea=u.createContext({itemValue:null,isDisabled:!1}),mp=()=>{const e=u.useContext(ea);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},Ot=({item:e,value:o,isDisabled:t=!1,children:n,views:i})=>{var k;const{activeItemId:a,setActiveItemId:l,orientation:d,size:s,variant:g,onItemActivate:p}=bo(),m=(e==null?void 0:e.id)||o,h=a===m,f=(e==null?void 0:e.items)&&e.items.length>0,x=(e==null?void 0:e.disabled)||t,y=()=>{x||m&&(l(m),p&&p(m))},b=d==="horizontal"?c.Horizontal:c.Vertical;return n?r.jsx(ea.Provider,{value:{itemValue:m||null,isDisabled:x},children:r.jsx(c.View,{width:"100%",cursor:x?"not-allowed":"pointer",opacity:x?.6:1,borderRadius:"4px",transition:"all 0.2s ease",...xt[s],...bt[g],...h?Ye.active:{},_hover:x?{}:Ye.hover,...i==null?void 0:i.item,children:n})}):f&&e?r.jsxs(b,{width:"100%",flexDirection:"column",position:"relative",...i==null?void 0:i.item,children:[r.jsxs(oa,{itemId:e.id,disabled:e.disabled,views:i,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),e.label]}),r.jsx(ta,{itemId:e.id,children:r.jsx(Ft,{children:(k=e.items)==null?void 0:k.map(C=>r.jsx(Ot,{item:C},C.id))})})]}):e?r.jsxs(c.View,{as:e.href?"a":"div",to:e.href,onClick:y,cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.6:1,width:"100%",display:"flex",alignItems:"center",borderRadius:"4px",transition:"all 0.2s ease",gap:"8px",...xt[s],...bt[g],...h?Ye.active:{},_hover:e.disabled?{}:Ye.hover,...i==null?void 0:i.item,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),e.label]}):null},oa=({children:e,itemId:o,disabled:t,views:n})=>{const{activeItemId:i,toggleExpandedItem:a,isItemExpanded:l,size:d,variant:s,triggerRefs:g}=bo(),p=u.useRef(null),m=i===o,h=l(o);u.useEffect(()=>(p.current&&o&&(g.current[o]=p.current),()=>{o&&delete g.current[o]}),[o,g]);const f=x=>{x.preventDefault(),!t&&a(o)};return r.jsxs(c.View,{ref:p,onClick:f,cursor:t?"not-allowed":"pointer",opacity:t?.5:1,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:4,transition:"background-color 0.2s ease",...xt[d],...bt[s],...m?Ye.active:{},_hover:t?{}:Ye.hover,...n==null?void 0:n.trigger,children:[r.jsx(c.View,{display:"flex",alignItems:"center",children:e}),r.jsx(c.View,{transition:"transform 0.2s ease",transform:h?"rotate(180deg)":"rotate(0deg)",...n==null?void 0:n.indicator,children:r.jsx(ae,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},ta=({children:e,itemId:o,views:t})=>{const{isItemExpanded:n,orientation:i,triggerRefs:a}=bo(),l=u.useRef(null),[d,s]=u.useState({x:0,y:0,placement:i==="horizontal"?"bottom":"right"}),g=n(o);if(u.useEffect(()=>{if(g&&l.current&&o&&a.current[o]&&i==="horizontal"){const m=l.current.getBoundingClientRect(),h=a.current[o].getBoundingClientRect(),f=Math.max(m.width||200,200),x=Math.max(m.height||150,150),y=window.innerWidth,b=window.innerHeight,k={top:h.top,right:y-h.right,bottom:b-h.bottom,left:h.left},C=i==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8},{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top}]:[{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8}],w=C.find(M=>M.fits);if(w){s({x:w.x,y:w.y,placement:w.placement});return}const j=C.reduce((M,z)=>z.space>M.space?z:M);let S=j.x,I=j.y;S+f>y&&(S=y-f-8),S<8&&(S=8),I+x>b&&(I=b-x-8),I<8&&(I=8),s({x:S,y:I,placement:j.placement})}},[g,i,o,a]),!g)return null;if(i==="vertical")return r.jsx(c.View,{paddingLeft:16,width:"100%",position:"relative",backgroundColor:"transparent",...t==null?void 0:t.container,children:e});const p={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return r.jsx(c.View,{ref:l,role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:p,...t==null?void 0:t.container,children:e})},hp=({href:e,children:o,views:t,...n})=>{const{itemValue:i,isDisabled:a}=mp(),{activeItemId:l,setActiveItemId:d,onItemActivate:s}=bo(),g=l===i,p=m=>{if(a){m.preventDefault();return}i&&(d(i),s&&s(i)),n.onClick&&n.onClick(m)};return r.jsx(c.View,{as:"a",href:a?void 0:e,onClick:p,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":g?"page":void 0,"aria-disabled":a,"data-active":g?"":void 0,"data-disabled":a?"":void 0,...g?{fontWeight:"bold"}:{},...t==null?void 0:t.container,...n,children:o})},fp=({items:e,orientation:o,views:t,themeMode:n})=>{const i=o==="horizontal"?c.Horizontal:c.Vertical;return!e||e.length===0?null:r.jsx(i,{width:"100%",...Zn[o],...t==null?void 0:t.container,children:r.jsx(Ft,{views:t,children:e.map(a=>r.jsx(Ot,{item:a,views:t},a.id))})})},xp=({items:e,children:o,orientation:t="vertical",size:n="md",variant:i="default",defaultActiveItemId:a=null,defaultExpandedItemIds:l=[],onItemActivate:d,views:s,...g})=>{const{activeItemId:p,setActiveItemId:m,expandedItemIds:h,toggleExpandedItem:f,isItemExpanded:x,triggerRefs:y}=gp(a,l);return r.jsx(pp,{value:{activeItemId:p,setActiveItemId:m,expandedItemIds:h,toggleExpandedItem:f,isItemExpanded:x,orientation:t,size:n,variant:i,onItemActivate:d,triggerRefs:y},children:e?r.jsx(fp,{items:e,orientation:t,size:n,variant:i,views:s,...g}):o})},Je=xp;Je.List=Ft;Je.Item=Ot;Je.Trigger=oa;Je.Content=ta;Je.Link=hp;const ra={},na=u.createContext({views:ra,onRowClick:()=>{}}),bp=({children:e,views:o=ra,onRowClick:t})=>r.jsx(na.Provider,{value:{views:o,onRowClick:t},children:e}),Ee=()=>u.useContext(na),de={table:{width:"100%",borderRadius:"8px",overflow:"hidden",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.04)",border:"1px solid",borderColor:"color-gray-200",transition:"box-shadow 0.2s ease",media:{mobile:{overflowX:"auto",display:"block",borderRadius:"4px"}}},thead:{backgroundColor:"color-gray-50",borderBottom:"1px solid",borderBottomColor:"color-gray-200"},th:{padding:"12px 16px",fontWeight:"600",fontSize:"14px",color:"color-gray-700",textAlign:"left",media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},td:{padding:"12px 16px",fontSize:"14px",borderBottom:"1px solid",borderBottomColor:"color-gray-100",color:"color-gray-900",media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},tr:{transition:"background-color 0.15s ease",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"}},tfoot:{backgroundColor:"color-gray-50",fontWeight:"600",borderTop:"2px solid",borderTopColor:"color-gray-200"},caption:{margin:"8px 0",color:"color-gray-600",fontSize:"14px",fontStyle:"italic",media:{mobile:{fontSize:"12px"}}}};({...de.th},{...de.td});({...de.tr});({...de.td},{...de.th});({...de.table},{...de.th}),{...de.td},{...de.tr},{...de.tfoot},{...de.caption};const aa=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"table",borderCollapse:"collapse",...de.table,...o==null?void 0:o.table,...e})},ia=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"thead",textAlign:"left",...de.thead,...o==null?void 0:o.thead,...e})},la=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"th",whiteSpace:"nowrap",...de.th,...o==null?void 0:o.th,...e})},Ro=e=>{const{views:o,onRowClick:t}=Ee();return r.jsx(c.Element,{as:"tr",...de.tr,...o==null?void 0:o.tr,onClick:t,...e})},yt=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e.isFirstColumn?"500":"400",...de.td,...o==null?void 0:o.td,...e})},ca=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"tbody",...de.tbody,...o==null?void 0:o.tbody,...e})},sa=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"tfoot",...de.tfoot,...o==null?void 0:o.tfoot,...e})},da=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"caption",...de.caption,...o==null?void 0:o.caption,...e})},yp=({data:e,columns:o,footer:t,caption:n,themeMode:i})=>r.jsxs(aa,{role:"Table",children:[n&&r.jsx(da,{children:n}),r.jsx(ia,{children:r.jsx(Ro,{children:o.map(a=>r.jsx(la,{children:a.title},a.field))})}),r.jsx(ca,{children:e.map((a,l)=>r.jsx(Ro,{children:o.map((d,s)=>r.jsx(yt,{isFirstColumn:s===0,children:a[d.field]},d.field))},l))}),t&&r.jsx(sa,{children:r.jsx(Ro,{children:t.map((a,l)=>r.jsx(yt,{...a.props,children:a.value},l))})})]}),Ce=({children:e,views:o,onClick:t})=>r.jsx(bp,{views:o,onRowClick:t,children:e});Ce.Head=ia;Ce.HeadCell=la;Ce.Body=ca;Ce.Row=Ro;Ce.Cell=yt;Ce.Footer=sa;Ce.Caption=da;Ce.Container=aa;Ce.Template=yp;const kp=(e,o,t)=>{const n=g=>g.value!==void 0?g.value:g.title,i=()=>{if(!(!e||e.length===0)){if(o!==void 0){const g=e.find(p=>n(p)===o);if(g)return g}return e[0]}},[a,l]=u.useState(i()),d=t!==void 0?e.find(g=>n(g)===t):a,s=g=>{t===void 0&&l(g)};return u.useEffect(()=>{if(t!==void 0)return;const g=i(),p=a&&e.some(m=>n(m)===n(a));g&&(!p||o!==void 0&&a&&n(a)!==o)?l(g):!g&&a&&l(void 0)},[e,o]),{activeTab:d,setActiveTab:s}},jp=(e,o,t)=>{const[n,i]=u.useState(e||null);return{activeValue:o!==void 0?o:n,setActiveValue:d=>{o===void 0&&i(d),t&&t(d)}}},Cp=u.memo(({tab:e,isActive:o,onClick:t,iconPosition:n="left",tabStyles:i,textStyles:a})=>{const l=u.useMemo(()=>({display:"flex",alignItems:"center",justifyContent:"center",padding:"12px 16px",cursor:"pointer",borderBottom:"2px solid",borderBottomColor:o?"theme-primary":"transparent",backgroundColor:"transparent",color:o?"theme-primary":"color-gray-600",fontWeight:o?"600":"500",marginBottom:"-1px",transition:"all 0.2s ease",on:{hover:{color:"theme-primary",borderBottomColor:o?"theme-primary":"color-gray-300"}}}),[o]),d=()=>{switch(n){case"top":return"column";case"bottom":return"column-reverse";case"right":return"row-reverse";case"left":default:return"row"}},s=()=>["top","bottom"].includes(n)?"4px":"8px",g=e.icon&&u.isValidElement(e.icon)?u.cloneElement(e.icon,{strokeWidth:o?2.5:2}):e.icon;return r.jsxs(c.Element,{as:"div",role:"tab","aria-selected":o,tabIndex:o?0:-1,...l,...i,flexDirection:d(),gap:s(),onClick:t,"data-state":o?"active":"inactive",children:[g&&r.jsx(c.Element,{children:g},o?"active-icon":"inactive-icon"),r.jsxs(c.Element,{display:"grid",alignItems:"center",justifyContent:"center",children:[r.jsx(c.Text,{...a,fontWeight:"600",visibility:"hidden",gridColumn:"1",gridRow:"1","aria-hidden":"true",children:e.title}),r.jsx(c.Text,{...a,fontWeight:o?"600":"500",gridColumn:"1",gridRow:"1",children:e.title})]})]})}),Sp=({tabs:e=[],activeTab:o,handleTabClick:t,views:n={},renderTab:i,renderContent:a,iconPosition:l="left"})=>o?r.jsxs(c.Vertical,{width:"100%",height:"100%",...n.container,children:[r.jsx(c.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...n.headerTabs,children:e.map(d=>{const s=(d.value!==void 0?d.value:d.title)===(o.value!==void 0?o.value:o.title),g=()=>t(d);return i?i(d,s,g):r.jsx(Cp,{tab:d,isActive:s,onClick:g,iconPosition:l,tabStyles:{...n.tab,...s?n.activeTab:{}},textStyles:{...n.title,...s?n.activeText:{}}},d.title)})}),r.jsx(c.View,{width:"100%",height:"100%",...n.content,children:a?a(o):o.content})]}):null,ua=u.createContext(null),ga=()=>{const e=u.useContext(ua);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},wp=u.memo(({children:e,views:o})=>r.jsx(c.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...o==null?void 0:o.container,children:e})),Ip=u.memo(({value:e,children:o,disabled:t=!1,views:n})=>{const{activeValue:i,setActiveValue:a}=ga(),l=i===e,d=u.useCallback(()=>{t||a(e)},[t,e,a]);return r.jsx(c.View,{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,padding:"12px 16px",borderBottom:"2px solid",borderBottomColor:l?"theme-primary":"transparent",color:l?"theme-primary":"color-gray-600",fontWeight:l?"600":"400",transition:"all 0.2s ease",_hover:t?{}:{color:"theme-primary"},onClick:d,...n==null?void 0:n.trigger,...l?n==null?void 0:n.activeState:{},children:o})}),Tp=u.memo(({value:e,children:o,views:t})=>{const{activeValue:n}=ga();return n!==e?null:r.jsx(c.View,{width:"100%",padding:"24px",...t==null?void 0:t.content,children:o})}),Mp=({tabs:e,views:o,defaultValue:t,onTabChange:n,renderTab:i,renderContent:a,iconPosition:l="left",value:d,onValueChange:s,children:g})=>{const p=jp(t,d,s),m=kp(e||[],t,d);if(g)return r.jsx(ua.Provider,{value:p,children:g});if(e){const h=f=>{const x=y=>y.value!==void 0?y.value:y.title;(!m.activeTab||x(m.activeTab)!==x(f))&&(m.setActiveTab(f),n&&n(f))};return r.jsx(Sp,{tabs:e,views:o,activeTab:m.activeTab,handleTabClick:h,renderTab:i,renderContent:a,iconPosition:l})}return null},zp=u.memo(Mp),Zo=zp;Zo.List=wp;Zo.Trigger=Ip;Zo.Content=Tp;const Rp=e=>{const{children:o,_isInView:t=!1,alternateHighlightText:n=[],alternateAnimation:i=!1,alternateDuration:a=3e3,highlightText:l,highlightTypewriter:d=!1,highlightSlide:s=!1,highlightSlideDuration:g=500,highlightSlideStagger:p=50,highlightSlideSequential:m=!0}=e,[h,f]=u.useState(o),[x,y]=u.useState(l);return u.useEffect(()=>{if(!i||n.length===0||!t||typeof o!="string"||typeof l!="string")return f(o),y(l),()=>{};const b=o,k=l;let C=0;const w=S=>{const I=n[S],M=k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),z=new RegExp(M,"gi"),E=b.replace(z,I);f(E),y(I)};w(C);const j=setInterval(()=>{C=(C+1)%n.length,w(C)},a);return()=>clearInterval(j)},[i,n,a,l,o,t]),{finalDisplayedText:h,activeHighlightTarget:x,highlightTypewriter:d,highlightSlide:s,highlightSlideDuration:g,highlightSlideStagger:p,highlightSlideSequential:m}},Vp={xs:24,sm:36,md:48,lg:64,xl:72},Ep={underline:e=>({textDecoration:"underline",textDecorationColor:e,textDecorationThickness:"4px",textUnderlineOffset:"4px"}),background:e=>({backgroundColor:e,color:"color-white",padding:"0 8px",borderRadius:"4px"}),gradient:(e,o)=>({background:`linear-gradient(135deg, ${e}, ${o||e})`,backgroundClip:"text",WebkitBackgroundClip:"text !important",WebkitTextFillColor:"transparent",color:"transparent",display:"inline-block",textShadow:"none"}),outline:e=>({WebkitTextStroke:`1px ${e}`,WebkitTextFillColor:"transparent !important",color:"transparent",textShadow:"none"}),glow:e=>({color:e,textShadow:`0 0 10px ${e}80, 0 0 20px ${e}40, 0 0 30px ${e}20`}),solid:e=>({color:e}),default:()=>({})},Pp=({text:e,typingSpeed:o=50,pauseTime:t=500,onComplete:n,showCursor:i=!0,cursorColor:a="currentColor",textStyle:l,textComponent:d,as:s,...g})=>{const p=d||c.Text,m=Array.isArray(e)?e:[e],[h,f]=u.useState(m.map(()=>"")),[x,y]=u.useState(!1),[b,k]=u.useState(0),[C,w]=u.useState(0);u.useEffect(()=>{f(m.map(()=>"")),y(!1),k(0),w(0)},[e]),u.useEffect(()=>{if(x){n&&n();return}const S=m[b];if(C>=S.length){if(b>=m.length-1){y(!0);return}const M=setTimeout(()=>{k(z=>z+1),w(0)},t);return()=>clearTimeout(M)}const I=setTimeout(()=>{f(M=>{const z=[...M];return z[b]=S.substring(0,C+1),z}),w(M=>M+1)},o);return()=>clearTimeout(I)},[m,b,C,x,n,t,o]);const j=S=>{if(!S||typeof S!="string")return S;const I=S.split("|");return I.length===1?S:I.map((M,z)=>r.jsxs(u.Fragment,{children:[M,z<I.length-1&&r.jsx("br",{})]},z))};return r.jsx(r.Fragment,{children:h.map((S,I)=>r.jsxs(u.Fragment,{children:[j(S),i&&I===b&&!x&&r.jsx(p,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:a,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...l})]},I))})},Wp=({text:e,duration:o=500,direction:t="up",stagger:n=50,sequential:i=!1,textStyle:a,as:l,wordProps:d,textComponent:s,...g})=>{const[p,m]=u.useState(e),[h,f]=u.useState("entering"),[x,y]=u.useState(0),b=s||c.Text,k=u.useRef(null),C=u.useRef(null);u.useEffect(()=>{e===p&&h==="visible"||e!==p&&(h==="entering"||h==="visible"?(k.current=e,f("exiting")):h==="exiting"&&(k.current=e))},[e,p,h]);const{lines:w,totalWordCount:j}=u.useMemo(()=>{const W=p.split("|").map(H=>H.trim().split(/\s+/).filter(L=>L.length>0)),P=W.reduce((H,L)=>H+L.length,0);return{lines:W,totalWordCount:P}},[p]),S=u.useMemo(()=>i?j*(o+n):(j-1)*n+o,[j,o,n,i]),I=u.useMemo(()=>i?j*(o+n):(j-1)*n+o,[j,o,n,i]);u.useEffect(()=>(C.current&&clearTimeout(C.current),h==="entering"?C.current=setTimeout(()=>{f("visible")},S+50):h==="exiting"&&(C.current=setTimeout(()=>{k.current!==null&&(m(k.current),k.current=null),y(V=>V+1),f("entering")},I+50)),()=>{C.current&&clearTimeout(C.current)}),[h,S,I]);const{style:M,...z}=d||{},E=t==="up",_=V=>i?V*(o+n):V*n,T=u.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",lineHeight:"normal",...a}),[a]),$=u.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),B=u.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let R=0;return r.jsx(c.Element,{as:"span",style:T,...g,children:r.jsx("span",{style:$,children:w.map((V,W)=>r.jsx("span",{style:B,children:V.map((P,H)=>{const L=R++,A=_(L),F=H===V.length-1;let D;const O=`${o}ms`,K=`${A}ms`;h==="entering"?D=E?c.Animation.slideInUp({duration:O,delay:K,timingFunction:"ease-out",fillMode:"both"}):c.Animation.slideInDown({duration:O,delay:K,timingFunction:"ease-out",fillMode:"both"}):h==="exiting"&&(D=E?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:O,delay:K,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:O,delay:K,timingFunction:"ease-in",fillMode:"both"});const Y={...M,display:"inline-block",marginRight:F?0:"0.25em",transform:h==="visible"?"translateY(0)":void 0,opacity:h==="visible"?1:void 0};return r.jsx(b,{as:"span",animate:D,...z,...Y,children:P},`${x}-${W}-${H}`)})},`line-${W}`))})})};function fr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const st=e=>{if(!e||typeof e!="string")return e;const o=e.split("|");return o.length===1?e:o.map((t,n)=>r.jsxs(u.Fragment,{children:[t,n<o.length-1&&r.jsx("br",{})]},n))},_p=({children:e,highlightText:o,highlightStyle:t="solid",highlightColor:n="theme-primary",highlightSecondaryColor:i,size:a="lg",views:l,highlightAnimate:d,animate:s,animationLoop:g=1,highlightAnimationLoop:p=1,highlightTypewriter:m=!1,highlightTypewriterDuration:h=3e3,highlightSlide:f=!1,highlightSlideDuration:x=500,highlightSlideStagger:y=50,highlightSlideSequential:b=!0,themeMode:k,responsive:C,alternateHighlightText:w,alternateAnimation:j,alternateDuration:S,_isInView:I,...M})=>{const{ref:z,inView:E}=c.useInView(),{finalDisplayedText:_,activeHighlightTarget:T,highlightTypewriter:$,highlightSlide:B,highlightSlideDuration:R,highlightSlideStagger:V,highlightSlideSequential:W}=Rp({children:e,highlightText:o,_isInView:E,highlightTypewriter:m,highlightSlide:f,highlightSlideDuration:x,highlightSlideStagger:y,highlightSlideSequential:b,alternateHighlightText:w,alternateAnimation:j,alternateDuration:S,...M}),P=Vp[a],H=Ep[t](n,i),L=(Y,N)=>Y&&(Array.isArray(Y)?Y.map(X=>({...X,iterationCount:N.toString()})):{...Y,iterationCount:N.toString()}),A=L(s,g),F=L(d,p),D=typeof _=="string"?_:typeof e=="string"?e:"",O={ref:z,animate:E?A:void 0,as:"h1",fontSize:P},K=Y=>!E&&($||B)?r.jsx("span",{style:{opacity:0},children:Y}):$?r.jsx(Pp,{text:Y,typingSpeed:Math.max(30,h/(Y.length*10)),cursorColor:"currentColor",...H}):B?r.jsx(Wp,{text:Y,duration:R,stagger:V,sequential:W,direction:"up",fontSize:P,wordProps:H}):st(Y);if(typeof D=="string"&&T){const Y=Array.isArray(T)?new RegExp(`(${T.map(J=>fr(String(J))).join("|")})`,"gi"):new RegExp(`(${fr(String(T))})`,"gi"),N=[];let X=0,Z;for(;Z=Y.exec(D);)Z.index>X&&N.push(D.substring(X,Z.index)),N.push({highlight:!0,text:Z[0]}),X=Z.index+Z[0].length;return X<D.length&&N.push(D.substring(X)),r.jsx(c.Element,{...O,...l==null?void 0:l.container,...M,children:N.map((J,oe)=>typeof J=="string"?r.jsx(c.Text,{as:"span",display:"inline",...l==null?void 0:l.text,children:st(J)},`text-${oe}`):r.jsx(c.Text,{as:"span",display:"inline",animate:E?F:void 0,...B?{}:H,...l==null?void 0:l.highlight,children:K(J.text)},`highlight-${oe}`))})}return t&&!T?r.jsx(c.Element,{...O,...M,...l==null?void 0:l.container,children:r.jsx(c.Text,{as:"span",display:"inline",animate:E?F:void 0,...B?{}:H,...l==null?void 0:l.highlight,children:K(D)})}):r.jsx(c.Text,{...O,...M,...l==null?void 0:l.container,...l==null?void 0:l.text,children:st(D)})},$p=e=>r.jsx(_p,{...e}),Hp=$p,Bp=({items:e,shape:o,variant:t,onToggleChange:n})=>{const{activeToggles:i,setActiveToggles:a}=On();return r.jsx(Nn,{items:e,shape:o,variant:t,activeToggles:i,setActiveToggles:a,onToggleChange:n})},Lp=Bp,Ap=({items:e,onChange:o})=>{const[t,n]=u.useState(e),[i,a]=u.useState(null),[l,d]=u.useState(null),s=u.useRef({x:0,y:0}),g=u.useRef([]),p=u.useCallback((f,x)=>{f.preventDefault(),document.body.style.cursor="grabbing";const y="touches"in f?f.touches[0].clientX:f.clientX,b="touches"in f?f.touches[0].clientY:f.clientY;s.current={x:y,y:b},d(x),a(t[x])},[t]),m=u.useCallback(f=>{if(l===null)return;const x="touches"in f?f.touches[0].clientX:f.clientX,y="touches"in f?f.touches[0].clientY:f.clientY,b=g.current[l];if(!b)return;const k=x-s.current.x,C=y-s.current.y;b.style.transform=`translate(${k}px, ${C}px)`,b.style.zIndex="1000";const w=g.current.findIndex((j,S)=>{if(!j||S===l)return!1;const I=j.getBoundingClientRect();return y>=I.top&&y<=I.bottom});if(w!==-1&&w!==l){const j=[...t],[S]=j.splice(l,1);j.splice(w,0,S),n(j),d(w),o==null||o(j),s.current={x,y}}},[l,t,o]),h=u.useCallback(()=>{document.body.style.cursor="",g.current.forEach(f=>{f&&(f.style.transform="",f.style.zIndex="")}),d(null),a(null)},[l]);return u.useEffect(()=>(l!==null&&(window.addEventListener("mousemove",m),window.addEventListener("touchmove",m),window.addEventListener("mouseup",h),window.addEventListener("touchend",h)),()=>{window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)}),[l,m,h]),{items:t,draggedItem:i,draggedIndex:l,itemRefs:g,handleDragStart:p}},Dp=({items:e,renderItem:o,containerProps:t,itemProps:n,draggedIndex:i,itemRefs:a,handleDragStart:l,views:d,themeMode:s})=>r.jsx(c.View,{overflow:"hidden",position:"relative",...t,...d==null?void 0:d.container,children:e.map((g,p)=>r.jsx(c.View,{ref:m=>a.current[p]=m,onMouseDown:m=>l(m,p),onTouchStart:m=>l(m,p),position:"relative",cursor:"grab",transition:"transform 0.2s",...n,...d==null?void 0:d.item,children:o?o(g,p):g},p))}),pa=e=>{const{items:o,draggedIndex:t,itemRefs:n,handleDragStart:i}=Ap(e);return r.jsx(Dp,{...e,items:o,draggedIndex:t,itemRefs:n,handleDragStart:i})},Fp=pa,Op=({onFileSelect:e,onMultipleFileSelect:o,validateFile:t,accept:n,multiple:i,disabled:a,previewUrl:l})=>{const[d,s]=u.useState(!1),[g,p]=u.useState(null),m=u.useRef(null),h=l!==void 0?l:g;u.useEffect(()=>()=>{g&&URL.revokeObjectURL(g)},[g]);const f=u.useCallback(j=>{j.preventDefault(),j.stopPropagation(),!a&&s(!0)},[a]),x=u.useCallback(j=>{j.preventDefault(),j.stopPropagation(),!a&&s(!1)},[a]),y=u.useCallback(j=>{j.preventDefault(),j.stopPropagation(),!a&&s(!0)},[a]),b=u.useCallback(j=>{if(!j||j.length===0)return;const S=Array.from(j);if(!i&&S.length>0){const I=S[0];if(I.type.startsWith("image/")){const M=URL.createObjectURL(I);p(z=>(z&&URL.revokeObjectURL(z),M))}else p(null)}i?o&&o(S):S.length>0&&e&&e(S[0])},[i,o,e]),k=u.useCallback(j=>{j.preventDefault(),j.stopPropagation(),s(!1),!a&&j.dataTransfer.files&&j.dataTransfer.files.length>0&&(b(j.dataTransfer.files),j.dataTransfer.clearData())},[a,b]),C=u.useCallback(()=>{var j;a||(j=m.current)==null||j.click()},[a]),w=u.useCallback(j=>{b(j.target.files),j.target.value&&(j.target.value="")},[b]);return{isDragActive:d,handleDragEnter:f,handleDragLeave:x,handleDragOver:y,handleDrop:k,handleClick:C,handleFileChange:w,inputRef:m,preview:h}},qp={position:"absolute",top:"-4px",right:"-4px",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",border:"none",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"12px",zIndex:10,_hover:{backgroundColor:"rgba(0, 0, 0, 0.7)"}},ma=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:i="120px",showPreviews:a=!1,views:l={}})=>{if(e.length===0)return null;const d=u.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(c.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:i,overflowY:"auto",...l==null?void 0:l.container,children:e.map((s,g)=>{const p=URL.createObjectURL(s)||(s==null?void 0:s.path)||(s==null?void 0:s.url)||"",m=s.type.startsWith("image/"),h=s.type.startsWith("video/"),f=s.type.startsWith("audio/");return r.jsx(c.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...l==null?void 0:l.item,children:a&&r.jsxs(he,{children:[r.jsxs(he.Trigger,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,width:"60px",height:"60px",objectFit:"cover"}),h&&r.jsx(c.View,{as:"video",src:p,alt:s.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(Fo,{widthHeight:24,color:"color-black"})}),!m&&!h&&!f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(go,{widthHeight:24,color:"color-black"})}),t&&r.jsx(c.Button,{...qp,onClick:x=>{x.stopPropagation(),t(g)},"aria-label":`Remove ${s.name}`,children:"×"})]}),r.jsxs(he.Content,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,maxWidth:"100%"}),h&&r.jsx(c.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),f&&r.jsx(c.View,{as:"audio",src:p,controls:!0,width:"100%"}),r.jsxs(c.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...l==null?void 0:l.name,children:[s.name," (",d(s.size),")"]})]})]})},g)})})},Np=({children:e,text:o="Drop files here or click to upload",textProps:t,containerProps:n,disabled:i,accept:a,multiple:l,isDragActive:d,handleDragEnter:s,handleDragLeave:g,handleDragOver:p,handleDrop:m,handleClick:h,handleFileChange:f,inputRef:x,preview:y,imageProps:b,selectedFiles:k,onRemove:C})=>r.jsxs(c.Center,{width:"100%",minHeight:"200px",height:k&&k.length>0?"auto":"200px",borderWidth:2,borderStyle:"dashed",borderColor:d?"primary":"rgba(0,0,0,0.1)",borderRadius:12,backgroundColor:d?"rgba(0,0,0,0.02)":"transparent",flexDirection:"column",cursor:i?"not-allowed":"pointer",opacity:i?.6:1,onClick:h,onDragEnter:s,onDragLeave:g,onDragOver:p,onDrop:m,transition:"all 0.2s ease-in-out",overflow:"hidden",position:"relative",padding:16,...n,children:[r.jsx("input",{type:"file",ref:x,onChange:f,accept:a,multiple:l,style:{display:"none"},disabled:i}),y&&!l?r.jsxs(c.View,{width:"100%",height:"200px",position:"relative",children:[r.jsx(c.Image,{src:y,alt:"Preview",width:"100%",height:"100%",objectFit:"contain",...b}),r.jsx(c.Center,{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.3)",opacity:0,_hover:{opacity:1},transition:"opacity 0.2s",children:r.jsx(c.Text,{color:"white",fontWeight:600,children:"Click to replace"})})]}):r.jsxs(c.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[e||r.jsxs(c.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[r.jsx(Et,{widthHeight:40,color:d?"primary":"rgba(0,0,0,0.4)"}),r.jsx(c.Text,{marginTop:16,color:d?"primary":"rgba(0,0,0,0.6)",fontWeight:500,textAlign:"center",...t,children:o})]}),l&&k&&k.length>0&&r.jsx(c.View,{marginTop:16,width:"100%",children:r.jsx(ma,{files:k,onRemove:C||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),Up=e=>{const o=Op(e);return r.jsx(Np,{...e,...o})},Gp=(e=!1)=>{const[o,t]=u.useState(e),[n,i]=u.useState(null);return u.useEffect(()=>{const a=s=>{!s.composedPath().some(m=>(m==null?void 0:m.id)==="dropdown-menu"||(m==null?void 0:m.id)==="dropdown-trigger")&&o&&(t(!1),i(null))},l=()=>{o&&(t(!1),i(null))},d=s=>{s.key==="Escape"&&o&&(t(!1),i(null))};return document.addEventListener("mousedown",a),window.addEventListener("resize",l),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",a),window.removeEventListener("resize",l),document.removeEventListener("keydown",d)}},[o]),{isOpen:o,setIsOpen:t,activeSubmenuId:n,setActiveSubmenuId:i}},Yp={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},vp={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Xp={hover:{backgroundColor:"color-gray-100"}},ha=u.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),Kp=({children:e,value:o})=>r.jsx(ha.Provider,{value:o,children:e}),qt=()=>{const e=u.useContext(ha);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},fa=({children:e,views:o,...t})=>{const{isOpen:n,setIsOpen:i,triggerRef:a}=qt(),l=d=>{d.stopPropagation(),i(!n)};return r.jsx(c.View,{ref:a,id:"dropdown-trigger",onClick:l,cursor:"pointer",position:"relative",display:"inline-block",...o==null?void 0:o.container,...t,children:e})},Nt=({items:e,side:o="bottom",align:t="start",views:n,...i})=>{const{isOpen:a,variant:l,triggerRef:d}=qt(),s=u.useRef(null),{ref:g,relation:p}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[m,h]=u.useState({x:0,y:0,placement:o});if(u.useEffect(()=>{d.current&&g&&(g.current=d.current)},[d,g,a]),u.useEffect(()=>{if(a&&s.current&&d.current){const y=d.current.getBoundingClientRect();let b=o;p&&(o==="bottom"&&p.space.vertical==="top"?b="top":o==="top"&&p.space.vertical==="bottom"?b="bottom":o==="right"&&p.space.horizontal==="left"?b="left":o==="left"&&p.space.horizontal==="right"&&(b="right"));let k=0,C=0;switch(b){case"bottom":k=t==="start"?y.left:t==="end"?y.right-180:y.left+y.width/2-90,C=y.bottom+8;break;case"top":k=t==="start"?y.left:t==="end"?y.right-180:y.left+y.width/2-90,C=y.top-8;break;case"right":k=y.right+8,C=t==="start"?y.top:t==="end"?y.bottom-100:y.top+y.height/2-50;break;case"left":k=y.left-8,C=t==="start"?y.top:t==="end"?y.bottom-100:y.top+y.height/2-50;break}h({x:k,y:C,placement:b})}},[a,o,t,d,p]),!a)return null;const x=(()=>{const y={position:"fixed",left:m.x,top:m.y,zIndex:1e3};switch(m.placement){case"top":return{...y,transform:"translateY(-100%)"};case"left":return{...y,transform:"translateX(-100%)"};case"bottom":case"right":default:return y}})();return r.jsx(c.View,{ref:s,id:"dropdown-menu",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:x,...vp[l],...n==null?void 0:n.menu,...i,children:e.map((y,b)=>y.divider?r.jsx(ba,{views:n},`divider-${b}`):r.jsx(xa,{item:y,views:n},y.id))})},xa=({item:e,views:o,...t})=>{const{activeSubmenuId:n,setActiveSubmenuId:i,size:a}=qt(),[l,d]=u.useState(!1),s=e.items&&e.items.length>0,g=n===e.id,p=u.useRef(null),m=()=>{d(!0),s&&i(e.id)},h=()=>{d(!1)},f=x=>{x.stopPropagation(),!e.disabled&&!s&&e.onClick&&e.onClick()};return r.jsxs(c.View,{ref:p,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...Yp[a],_hover:e.disabled?{}:Xp.hover,backgroundColor:l&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:m,onMouseLeave:h,onClick:f,...o==null?void 0:o.item,...t,children:[e.icon&&r.jsx(c.View,{marginRight:8,...o==null?void 0:o.icon,children:e.icon}),r.jsx(c.View,{flexGrow:1,children:e.label}),s&&r.jsx(c.View,{marginLeft:8,...o==null?void 0:o.submenuIndicator,children:r.jsx(ae,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),g&&s&&r.jsx(Nt,{items:e.items||[],side:"right",align:"start",views:o})]})},ba=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...o}),Qp=({trigger:e,items:o,side:t="bottom",align:n="start",views:i,themeMode:a,...l})=>r.jsxs(c.View,{position:"relative",display:"inline-block",...i==null?void 0:i.container,...l,children:[r.jsx(fa,{views:i,children:e}),r.jsx(Nt,{items:o,side:t,align:n,views:i})]}),Zp=({trigger:e,items:o,size:t="md",variant:n="default",side:i="bottom",align:a="start",defaultOpen:l=!1,views:d,...s})=>{const{isOpen:g,setIsOpen:p,activeSubmenuId:m,setActiveSubmenuId:h}=Gp(l),f=u.useRef(null);return r.jsx(Kp,{value:{isOpen:g,setIsOpen:p,activeSubmenuId:m,setActiveSubmenuId:h,size:t,variant:n,triggerRef:f},children:r.jsx(Qp,{trigger:e,items:o,side:i,align:a,views:d,...s})})},yo=Zp;yo.Trigger=fa;yo.Content=Nt;yo.Item=xa;yo.Divider=ba;const Jp=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:i,isOpen:a,onOpen:l,onClose:d,closeOnSelect:s=!0,maxRecentColors:g=8,showRecentColors:p=!0}=e,[m,h]=u.useState(a??!1),[f,x]=u.useState(o??t),[y,b]=u.useState(""),[k,C]=u.useState([]),w=u.useRef(null),j=u.useRef(null);u.useEffect(()=>{o!==void 0&&x(o)},[o]),u.useEffect(()=>{a!==void 0&&h(a)},[a]),u.useEffect(()=>{if(p){const T=localStorage.getItem("colorPicker-recentColors");if(T)try{C(JSON.parse(T))}catch{}}},[p]),u.useEffect(()=>{const T=$=>{m&&w.current&&j.current&&!w.current.contains($.target)&&!j.current.contains($.target)&&_()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[m]);const S=u.useCallback(T=>{p&&C($=>{const B=$.filter(V=>V!==T),R=[T,...B].slice(0,g);return localStorage.setItem("colorPicker-recentColors",JSON.stringify(R)),R})},[p,g]),I=u.useCallback(()=>{const T=!m;h(T),T?l==null||l():d==null||d()},[m,l,d]),M=u.useCallback(T=>{x(T),S(T),n==null||n(T),i==null||i(T),s&&(h(!1),d==null||d())},[n,i,s,d,S]),z=u.useCallback(T=>{b(T)},[]),E=u.useCallback(()=>{y&&(M(y),b(""))},[y,M]),_=u.useCallback(()=>{h(!1),d==null||d()},[d]);return{isOpen:m,selectedColor:f,recentColors:k,customColor:y,handleToggle:I,handleColorSelect:M,handleCustomColorChange:z,handleCustomColorSubmit:E,handleClose:_,triggerRef:w,dropdownRef:j}},qe={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"8px",marginBottom:"16px"},customInput:{marginBottom:"12px"},recentColors:{borderTop:"1px solid color-gray-200",paddingTop:"12px"}},em={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},om={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},tm={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},rm=[{name:"Blue 500",value:"color-blue-500",category:"primary"},{name:"Purple 500",value:"color-purple-500",category:"primary"},{name:"Pink 500",value:"color-pink-500",category:"primary"},{name:"Red 500",value:"color-red-500",category:"primary"},{name:"Orange 500",value:"color-orange-500",category:"primary"},{name:"Yellow 500",value:"color-yellow-500",category:"primary"},{name:"Green 500",value:"color-green-500",category:"primary"},{name:"Teal 500",value:"color-teal-500",category:"primary"},{name:"Blue 300",value:"color-blue-300",category:"light"},{name:"Purple 300",value:"color-purple-300",category:"light"},{name:"Pink 300",value:"color-pink-300",category:"light"},{name:"Red 300",value:"color-red-300",category:"light"},{name:"Orange 300",value:"color-orange-300",category:"light"},{name:"Yellow 300",value:"color-yellow-300",category:"light"},{name:"Green 300",value:"color-green-300",category:"light"},{name:"Teal 300",value:"color-teal-300",category:"light"},{name:"Blue 700",value:"color-blue-700",category:"dark"},{name:"Purple 700",value:"color-purple-700",category:"dark"},{name:"Pink 700",value:"color-pink-700",category:"dark"},{name:"Red 700",value:"color-red-700",category:"dark"},{name:"Orange 700",value:"color-orange-700",category:"dark"},{name:"Yellow 700",value:"color-yellow-700",category:"dark"},{name:"Green 700",value:"color-green-700",category:"dark"},{name:"Teal 700",value:"color-teal-700",category:"dark"},{name:"Gray 100",value:"color-gray-100",category:"neutral"},{name:"Gray 300",value:"color-gray-300",category:"neutral"},{name:"Gray 500",value:"color-gray-500",category:"neutral"},{name:"Gray 700",value:"color-gray-700",category:"neutral"},{name:"Gray 900",value:"color-gray-900",category:"neutral"},{name:"Black",value:"color-black",category:"neutral"},{name:"White",value:"color-white",category:"neutral"}],nm=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",error:g=!1,isDisabled:p=!1,isReadOnly:m=!1,predefinedColors:h=rm,showCustomInput:f=!0,showRecentColors:x=!0,isOpen:y,selectedColor:b,recentColors:k,customColor:C,handleToggle:w,handleColorSelect:j,handleCustomColorChange:S,handleCustomColorSubmit:I,triggerRef:M,dropdownRef:z,onChange:E,..._})=>{const{getColor:T}=c.useTheme(),$={...qe.container,...a==null?void 0:a.container},B={...qe.trigger,...em[l],...om[d],...tm[s],...g&&{borderColor:"color-red-500"},...p&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},R={...qe.dropdown,...a==null?void 0:a.dropdown},V={...qe.colorGrid,...a==null?void 0:a.colorGrid},W={...qe.recentColors,...a==null?void 0:a.recentColors},P=b||"color-gray-200";return r.jsxs(c.View,{...$,..._,children:[t&&r.jsx(c.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:M,onClick:p||m?void 0:w,...B,children:[r.jsxs(c.Horizontal,{alignItems:"center",gap:8,children:[r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:P,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),r.jsx(c.Text,{color:b?"color-gray-800":"color-gray-500",fontSize:"inherit",children:b||n})]}),!m&&!p&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:y?"up":"down"})]}),y&&r.jsxs(c.View,{ref:z,...R,children:[r.jsx(c.View,{...V,children:h.map((H,L)=>r.jsx(c.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:H.value,borderWidth:"2px",borderStyle:"solid",borderColor:b===H.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>j(H.value),title:H.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},L))}),f&&r.jsxs(c.View,{...qe.customInput,...a==null?void 0:a.customInput,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",marginBottom:"8px",children:[r.jsx("input",{type:"color",value:C||"#000000",onChange:H=>{const L=H.target.value;S(L),j(L)},style:{width:"40px",height:"32px",border:"1px solid #d1d5db",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},title:"Pick a color"}),r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",children:"Use native color picker"})]}),r.jsx(xo,{placeholder:"Enter hex color (e.g., #ff0000)",value:C,onChange:H=>S(H.target.value),onKeyPress:H=>{H.key==="Enter"&&I()},size:"sm",right:C&&r.jsx(c.View,{width:"16px",height:"16px",borderRadius:"2px",backgroundColor:C,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:I})})]}),x&&k.length>0&&r.jsxs(c.View,{...W,children:[r.jsx(c.Text,{fontWeight:"500",color:"color-gray-600",marginBottom:"8px",children:"Recent Colors"}),r.jsx(c.Horizontal,{gap:8,flexWrap:"wrap",children:k.map((H,L)=>r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:H,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:()=>j(H),title:H,_hover:{transform:"scale(1.1)"}},L))})]})]}),i&&r.jsx(c.Text,{color:g?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i})]})},am=e=>{const o=Jp(e);return r.jsx(nm,{...o,...e})},im=am,lm=e=>{const o=Yn(e);return r.jsx(vn,{...o,...e})},cm=lm,sm=e=>{const o=Un(e);return r.jsx(Gn,{...o,...e})},dm=sm,um=(e=null,o=null)=>{const[t,n]=u.useState(e),[i,a]=u.useState(o),l=s=>i===s,d=s=>{a(g=>g===s?null:s)};return u.useEffect(()=>{const s=p=>{!p.composedPath().some(f=>(f==null?void 0:f.id)==="menubar-content"||(f==null?void 0:f.id)==="menubar-trigger")&&i!==null&&a(null)},g=p=>{p.key==="Escape"&&i!==null&&a(null)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",g)}},[i]),{activeMenuId:t,setActiveMenuId:n,openMenuId:i,setOpenMenuId:a,isMenuOpen:l,toggleMenu:d}},ya={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},gm={default:{backgroundColor:"transparent",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},pm={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Vo={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},ka=u.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),Jo=()=>u.useContext(ka),mm=({value:e,children:o})=>r.jsx(ka.Provider,{value:e,children:o}),ja=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",views:i,...a})=>{const l=o==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(l,{role:"menubar","aria-orientation":o,...pm[o],...gm[n],...i==null?void 0:i.container,...a,children:e})},Ca=({children:e,id:o,disabled:t=!1,views:n})=>{const{orientation:i}=Jo(),a=i==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(a,{role:"none",position:"relative",opacity:t?.5:1,pointerEvents:t?"none":"auto",...n==null?void 0:n.menu,children:u.Children.map(e,l=>u.isValidElement(l)?u.cloneElement(l,{...l.props,menuId:o}):l)})},Sa=({children:e,menuId:o,disabled:t=!1,views:n})=>{const{activeMenuId:i,setActiveMenuId:a,toggleMenu:l,isMenuOpen:d,size:s,triggerRefs:g}=Jo(),p=u.useRef(null),m=i===o,h=d(o);u.useEffect(()=>(p.current&&o&&(g.current[o]=p.current),()=>{o&&delete g.current[o]}),[o,g]);const f=()=>{t||(a(o),l(o))};return r.jsx(c.View,{ref:p,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":h,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...ya[s],...m?Vo.active:{},...t?Vo.disabled:{},_hover:t?{}:Vo.hover,onClick:f,...n==null?void 0:n.trigger,children:e})},wa=({children:e,menuId:o,views:t})=>{const{isMenuOpen:n,orientation:i,triggerRefs:a}=Jo(),l=u.useRef(null),[d,s]=u.useState({x:0,y:0,placement:i==="horizontal"?"bottom":"right"}),g=n(o);if(u.useEffect(()=>{if(g&&l.current&&o&&a.current[o]){const m=l.current.getBoundingClientRect(),h=a.current[o].getBoundingClientRect(),f=Math.max(m.width||200,200),x=Math.max(m.height||150,150),y=window.innerWidth,b=window.innerHeight,k={top:h.top,right:y-h.right,bottom:b-h.bottom,left:h.left},C=i==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8},{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top}]:[{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8}],w=C.find(M=>M.fits);if(w){s({x:w.x,y:w.y,placement:w.placement});return}const j=C.reduce((M,z)=>z.space>M.space?z:M);let S=j.x,I=j.y;S+f>y&&(S=y-f-8),S<8&&(S=8),I+x>b&&(I=b-x-8),I<8&&(I=8),s({x:S,y:I,placement:j.placement})}},[g,i,o,a]),!g)return null;const p={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return r.jsx(c.View,{ref:l,id:"menubar-content",role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:p,...t==null?void 0:t.content,children:e})},Ia=({children:e,icon:o,disabled:t=!1,onClick:n,views:i})=>{const{size:a}=Jo(),l=()=>{t||!n||n()};return r.jsxs(c.View,{role:"menuitem",cursor:t?"not-allowed":"pointer",userSelect:"none",display:"flex",alignItems:"center",opacity:t?.5:1,...ya[a],_hover:t?{}:Vo.hover,onClick:l,...i==null?void 0:i.item,children:[o&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:o}),e]})},Ta=({views:e})=>r.jsx(c.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),hm=({items:e,orientation:o,size:t,variant:n,views:i,themeMode:a})=>r.jsx(ja,{orientation:o,size:t,variant:n,views:i,children:e.map(l=>r.jsxs(Ca,{id:l.id,disabled:l.disabled,views:i,children:[r.jsxs(Sa,{menuId:l.id,views:i,children:[l.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:l.icon}),l.label]}),l.items&&l.items.length>0&&r.jsx(wa,{menuId:l.id,views:i,children:l.items.map((d,s)=>d.separator?r.jsx(Ta,{views:i},`separator-${s}`):r.jsx(Ia,{id:d.id,icon:d.icon,disabled:d.disabled,onClick:d.onClick,views:i,children:d.label},d.id))})]},l.id))}),fm=({items:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultActiveMenuId:i=null,defaultOpenMenuId:a=null,views:l,...d})=>{const{activeMenuId:s,setActiveMenuId:g,openMenuId:p,setOpenMenuId:m,isMenuOpen:h,toggleMenu:f}=um(i,a),x=u.useRef({});return r.jsx(mm,{value:{activeMenuId:s,setActiveMenuId:g,openMenuId:p,setOpenMenuId:m,isMenuOpen:h,toggleMenu:f,orientation:o,size:t,variant:n,triggerRefs:x},children:r.jsx(hm,{items:e,orientation:o,size:t,variant:n,views:l,...d})})},Le=fm;Le.Root=ja;Le.Menu=Ca;Le.Trigger=Sa;Le.Content=wa;Le.Item=Ia;Le.Separator=Ta;const xm=(e,o,t)=>{const[n,i]=u.useState([]);return u.useEffect(()=>{i((()=>{const l=[];if(o<=t)for(let d=1;d<=o;d++)l.push(d);else{l.push(1);let d=Math.max(2,e-Math.floor((t-2)/2)),s=Math.min(o-1,d+t-3);s>=o-1&&(s=o-1,d=Math.max(2,s-(t-3))),d>2&&l.push("...");for(let g=d;g<=s;g++)l.push(g);s<o-1&&l.push("..."),l.push(o)}return l})())},[e,o,t]),{visiblePageNumbers:n}},Ne={sm:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px",media:{mobile:{fontSize:"11px",padding:"3px 6px",minWidth:"24px",height:"24px"}}},md:{fontSize:"14px",padding:"6px 12px",minWidth:"36px",height:"36px",media:{mobile:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px"}}},lg:{fontSize:"16px",padding:"8px 16px",minWidth:"44px",height:"44px",media:{mobile:{fontSize:"14px",padding:"6px 12px",minWidth:"36px",height:"36px"}}}},io={default:{backgroundColor:"transparent",color:"color-gray-800",_hover:{backgroundColor:"color-gray-100"}},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",_hover:{backgroundColor:"color-gray-200"}},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",_hover:{backgroundColor:"color-gray-100"}}},lo={rounded:{borderRadius:"4px"},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},bm={backgroundColor:"color-blue-500",color:"color-white",_hover:{backgroundColor:"color-blue-600"}},Io={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},ym=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:i=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"100 / page",value:100}],onPageSizeChange:a,showPageSizeSelector:l=!1,showPageInfo:d=!0,maxPageButtons:s=5,showFirstLastButtons:g=!1,size:p="md",variant:m="default",shape:h="rounded",visiblePageNumbers:f,views:x,...y})=>{const b=w=>{w<1||w>o||w===e||t(w)},k=w=>{a&&a(Number(w.target.value))},C=(w,j)=>{if(w==="...")return r.jsx(c.View,{display:"flex",alignItems:"center",justifyContent:"center",...Ne[p],...x==null?void 0:x.ellipsis,children:"..."},`ellipsis-${j}`);const S=w===e;return r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:S?"default":"pointer",...Ne[p],...io[m],...lo[h],...S?bm:{},onClick:()=>b(w),"aria-label":`Page ${w}`,"aria-current":S?"page":void 0,...S?x==null?void 0:x.activePageButton:x==null?void 0:x.pageButton,children:w},`page-${w}`)};return r.jsxs(c.Horizontal,{alignItems:"center",gap:8,...x==null?void 0:x.container,...y,children:[g&&r.jsxs(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Ne[p],...io[m],...lo[h],...e===1?Io:{},onClick:()=>b(1),"aria-label":"First page",disabled:e===1,...x==null?void 0:x.navigationButton,children:[r.jsx(ae,{orientation:"left",widthHeight:16}),r.jsx(ae,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Ne[p],...io[m],...lo[h],...e===1?Io:{},onClick:()=>b(e-1),"aria-label":"Previous page",disabled:e===1,...x==null?void 0:x.navigationButton,children:r.jsx(ae,{orientation:"left",widthHeight:16})}),f.map((w,j)=>C(w,j)),r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Ne[p],...io[m],...lo[h],...e===o?Io:{},onClick:()=>b(e+1),"aria-label":"Next page",disabled:e===o,...x==null?void 0:x.navigationButton,children:r.jsx(ae,{orientation:"right",widthHeight:16})}),g&&r.jsxs(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Ne[p],...io[m],...lo[h],...e===o?Io:{},onClick:()=>b(o),"aria-label":"Last page",disabled:e===o,...x==null?void 0:x.navigationButton,children:[r.jsx(ae,{orientation:"right",widthHeight:16}),r.jsx(ae,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),d&&r.jsxs(c.Text,{marginLeft:16,color:"color-gray-600",...x==null?void 0:x.pageInfo,children:["Page ",e," of ",o]}),l&&a&&r.jsx(c.View,{as:"select",marginLeft:16,padding:"4px 8px",borderRadius:"4px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",cursor:"pointer",value:n,onChange:k,...x==null?void 0:x.pageSizeSelector,children:i.map(w=>r.jsx("option",{value:w.value,children:w.label},w.value))})]})},km=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:i,onPageSizeChange:a,showPageSizeSelector:l=!1,showPageInfo:d=!0,maxPageButtons:s=5,showFirstLastButtons:g=!1,size:p="md",variant:m="default",shape:h="rounded",views:f,...x})=>{const{visiblePageNumbers:y}=xm(e,o,s);return r.jsx(ym,{currentPage:e,totalPages:o,onPageChange:t,pageSize:n,pageSizeOptions:i,onPageSizeChange:a,showPageSizeSelector:l,showPageInfo:d,maxPageButtons:s,showFirstLastButtons:g,size:p,variant:m,shape:h,visiblePageNumbers:y,views:f,...x})},jm=km,Cm=u.memo(({shape:e="linear",value:o=0,max:t=100,color:n="theme-primary",backgroundColor:i="color-gray-200",height:a,size:l,radius:d=4,strokeWidth:s=10,showLabel:g=!1,labelColor:p="theme-text-primary",animated:m=!0,animationDuration:h="0.5s",views:f,themeMode:x,...y})=>{const{getColor:b,themeMode:k}=c.useTheme(),C=x||k,j=Math.min(t,Math.max(0,o))/t*100,S=u.useMemo(()=>b(i,{themeMode:C}),[b,i,C]),I=u.useMemo(()=>b(n,{themeMode:C}),[b,n,C]);if(e==="circle"){const z=l||(typeof a=="number"?a:100),E=(z-s)/2,_=2*Math.PI*E,T=_-j/100*_;return r.jsxs(c.View,{width:z,height:z,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...f==null?void 0:f.container,...y,children:[r.jsxs("svg",{width:z,height:z,viewBox:`0 0 ${z} ${z}`,style:{transform:"rotate(-90deg)"},children:[r.jsx("circle",{cx:z/2,cy:z/2,r:E,stroke:S,strokeWidth:s,fill:"transparent",...f==null?void 0:f.track}),r.jsx("circle",{cx:z/2,cy:z/2,r:E,stroke:I,strokeWidth:s,strokeDasharray:_,strokeDashoffset:T,strokeLinecap:"round",fill:"transparent",style:{transition:m?`stroke-dashoffset ${h} ease-in-out`:"none"},...f==null?void 0:f.indicator})]}),g&&r.jsx(c.View,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",children:r.jsxs(c.Text,{color:p,fontSize:`${z*.2}px`,fontWeight:"bold",...f==null?void 0:f.text,children:[Math.round(j),"%"]})})]})}const M=a||8;return r.jsx(c.View,{role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":t,width:"100%",height:M,backgroundColor:S,borderRadius:d,overflow:"hidden",...f==null?void 0:f.container,...y,children:r.jsx(c.View,{width:`${j}%`,height:"100%",backgroundColor:I,borderRadius:d,style:{transition:m?`width ${h} ease-in-out`:"none"},...f==null?void 0:f.bar})})}),Sm=e=>r.jsx(Cm,{...e}),wm=Sm,Im=e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}),Tm=Im(),Mm={thin:"1px",medium:"2px",thick:"4px"},co={container:{transition:"opacity 0.15s ease"},label:{fontSize:"14px",fontWeight:"500",color:"color-gray-600",paddingHorizontal:"8px",backgroundColor:"color-white",transition:"color 0.15s ease"}},zm=({orientation:e="horizontal",variant:o="solid",thickness:t="thin",color:n,spacing:i="0px",label:a,decorative:l=!1,views:d,themeMode:s,...g})=>{const{themeMode:p}=c.useTheme(),m=n||"color-gray-200",h=Tm[o],f=Mm[t],x=l?{"aria-hidden":!0}:{role:"separator","aria-orientation":e};return a&&e==="horizontal"?r.jsxs(c.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:i,...x,...g,children:[r.jsx(c.View,{height:"0px",flexGrow:1,borderTopWidth:f,borderTopStyle:h,borderTopColor:m,...co.container,...d==null?void 0:d.container}),r.jsx(c.Text,{...co.label,...d==null?void 0:d.label,children:a}),r.jsx(c.View,{height:"0px",flexGrow:1,borderTopWidth:f,borderTopStyle:h,borderTopColor:m,...co.container,...d==null?void 0:d.container})]}):e==="horizontal"?r.jsx(c.View,{height:"0px",width:"100%",borderTopWidth:f,borderTopStyle:h,borderTopColor:m,padding:i,...co.container,...x,...d==null?void 0:d.container,...g}):r.jsx(c.View,{width:"0px",height:"100%",borderLeftWidth:f,borderLeftStyle:h,borderLeftColor:m,padding:i,...co.container,...x,...d==null?void 0:d.container,...g})},Ma=e=>r.jsx(zm,{...e}),Rm=Ma,Vm=Ma,Em={xs:12,sm:14,md:16,lg:18,xl:20},Pm=({isSupported:e,isSharing:o,onShare:t,label:n,children:i,icon:a,size:l,isDisabled:d,isLoading:s,iconPosition:g,disableWhenUnsupported:p=!0,...m})=>{const h=l??"md",f=a??r.jsx(Vr,{widthHeight:Em[h],strokeWidth:1.5,filled:!1}),x=!!d||!e&&p,y=!!s||o;return r.jsx(_e,{...m,size:h,icon:f,iconPosition:g??"left",isDisabled:x,isLoading:y,onClick:t,children:i??n??"Share"})},xr=()=>typeof navigator>"u"?void 0:navigator,Wm=(e,o)=>{if(!e||typeof e.share!="function")return!1;if(typeof e.canShare=="function")try{return e.canShare(o)}catch{return!1}return!0},_m=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},$m=e=>{const{shareData:o,onClick:t,onUnsupported:n,onShareStart:i,onShareSuccess:a,onShareCancel:l,onShareError:d}=e,[s,g]=u.useState(!1),p=u.useMemo(()=>Wm(xr(),o),[o]),m=u.useCallback((...h)=>{t==null||t(...h);const f=xr();if(!f||typeof f.share!="function"){n==null||n();return}if(!s){if(typeof f.canShare=="function")try{if(!f.canShare(o)){n==null||n();return}}catch(x){d==null||d(x);return}g(!0),i==null||i();try{f.share(o).then(()=>{a==null||a()}).catch(x=>{if(_m(x)==="AbortError"){l==null||l();return}d==null||d(x)}).finally(()=>{g(!1)})}catch(x){g(!1),d==null||d(x)}}},[s,t,l,d,i,a,n,o]);return{isSupported:p,isSharing:s,handleShare:m}},Hm=e=>{const{isSupported:o,isSharing:t,handleShare:n}=$m(e),{shareData:i,onShareStart:a,onShareSuccess:l,onShareCancel:d,onShareError:s,onUnsupported:g,onClick:p,...m}=e;return r.jsx(Pm,{...m,isSupported:o,isSharing:t,onShare:n})},Bm=Hm,Lm=({label:e,status:o="default",views:t,themeMode:n,...i})=>{const{themeMode:a}=c.useTheme(),l=Lr();return r.jsxs(c.Horizontal,{alignItems:"center",gap:8,role:"status-indicator",...t==null?void 0:t.container,...i,children:[r.jsx(c.View,{role:"status-dot",width:"8px",height:"8px",borderRadius:"50%",...l[o].indicator,...t==null?void 0:t.indicator}),e&&r.jsx(c.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...l[o].label,...t==null?void 0:t.label,children:e})]})},Am=e=>r.jsx(Lm,{...e}),Dm=(e=!0,o,t,n)=>{const{on:i}=c.useResponsive(),a=i("mobile"),[l,d]=u.useState(o!==void 0?o:e);return u.useEffect(()=>{o!==void 0&&d(o)},[o]),{isExpanded:l,toggleExpanded:()=>{const m=!l;d(m),t&&t(m)},expand:()=>{l||(d(!0),t&&t(!0))},collapse:()=>{l&&(d(!1),t&&t(!1))},isMobile:a}},Fm={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},Om=e=>({default:{backgroundColor:"color-white",color:"color-gray-800",transition:"all 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"all 0.2s ease"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"all 0.2s ease"},subtle:{backgroundColor:"color-gray-50",color:"color-gray-800",transition:"all 0.2s ease"},elevated:{backgroundColor:"color-white",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",color:"color-gray-800",transition:"all 0.2s ease"}}),qm=Om(),Nm={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},Um={none:{},low:{boxShadow:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)"},medium:{boxShadow:"0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)"},high:{boxShadow:"0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)"}},Gm={fast:"width 0.2s ease, transform 0.2s ease",normal:"width 0.3s ease, transform 0.3s ease",slow:"width 0.5s ease, transform 0.5s ease",bounce:"width 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55)"},za=u.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),et=()=>u.useContext(za),Ym=({value:e,children:o})=>r.jsx(za.Provider,{value:e,children:o}),vm=({children:e,showToggleButton:o=!0,views:t,...n})=>{const{isExpanded:i,toggleExpanded:a,position:l}=et();return r.jsx(c.Horizontal,{width:"100%",padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:"space-between",...t==null?void 0:t.header,...n,children:i?r.jsxs(c.Horizontal,{width:"100%",alignItems:"center",justifyContent:"space-between",children:[e,o&&r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:a,"aria-label":i?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(ae,{orientation:l==="left"?"left":"right",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})]}):r.jsx(c.View,{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:o&&r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:a,"aria-label":i?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(ae,{orientation:l==="left"?"right":"left",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})})})},Xm=({children:e,views:o,...t})=>{const{isExpanded:n}=et();return r.jsx(c.View,{flex:"1",width:"100%",overflowY:"auto",overflowX:"hidden",padding:n?"16px":"8px",...o==null?void 0:o.content,...t,children:e})},Km=({children:e,views:o,...t})=>{const{isExpanded:n}=et();return r.jsx(c.View,{width:"100%",padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",...o==null?void 0:o.footer,...t,children:n?e:null})},Qm=({children:e,position:o="left",size:t="md",variant:n="default",fixed:i=!1,hasBackdrop:a=!0,expandedWidth:l,collapsedWidth:d,breakpointBehavior:s="overlay",elevation:g="none",transitionPreset:p="normal",ariaLabel:m="Sidebar navigation",isExpanded:h,isMobile:f,collapse:x,views:y,themeMode:b,...k})=>{const C=Fm[t],w=h?l||C.expandedWidth:d||C.collapsedWidth,j=!f||f&&s!=="hide",S=i||f&&s==="overlay"?"fixed":"relative",I=a&&f&&h&&s==="overlay";return r.jsxs(r.Fragment,{children:[I&&r.jsx(c.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:x,...y==null?void 0:y.backdrop}),j&&r.jsx(c.Vertical,{position:S,top:0,height:"100vh",width:w,zIndex:999,transition:Gm[p],transform:f&&s==="overlay"&&!h?`translateX(${o==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":m,...qm[n],...Nm[o],...Um[g],...y==null?void 0:y.container,...k,children:u.Children.map(e,M=>M)})]})},Zm=({children:e,position:o="left",size:t="md",variant:n="default",defaultExpanded:i=!0,expanded:a,onExpandedChange:l,fixed:d=!1,hasBackdrop:s=!0,showToggleButton:g=!0,expandedWidth:p,collapsedWidth:m,breakpoint:h=768,breakpointBehavior:f="overlay",views:x,...y})=>{const{isExpanded:b,toggleExpanded:k,expand:C,collapse:w,isMobile:j}=Dm(i,a,l);return r.jsx(Ym,{value:{isExpanded:b,toggleExpanded:k,expand:C,collapse:w,position:o,size:t,variant:n,views:x},children:r.jsx(Qm,{position:o,size:t,variant:n,fixed:d,hasBackdrop:s,showToggleButton:g,expandedWidth:p,collapsedWidth:m,breakpoint:h,breakpointBehavior:f,isExpanded:b,isMobile:j,toggleExpanded:k,expand:C,collapse:w,views:x,...y,children:e})})},ko=Zm;ko.Header=vm;ko.Content=Xm;ko.Footer=Km;ko.useContext=et;const Jm=()=>({getItem:e=>{try{return localStorage.getItem(`resizable-${e}`)}catch(o){return console.warn("Failed to access localStorage:",o),null}},setItem:(e,o)=>{try{localStorage.setItem(`resizable-${e}`,o)}catch(t){console.warn("Failed to write to localStorage:",t)}}}),eh=(e,o,t,n=50,i=1/0,a=!1,l,d,s=10)=>{const[g,p]=u.useState(!1),[m,h]=u.useState([]),f=u.useRef(null),x=u.useRef(null),y=u.useRef(0),b=u.useRef([]),k=u.useRef(d||(typeof window<"u"?Jm():null)),C=u.useCallback(()=>f.current?e==="horizontal"?f.current.offsetWidth:f.current.offsetHeight:0,[e]),w=u.useCallback(()=>{if(!l||!k.current)return null;const V=k.current.getItem(l);if(!V)return null;try{const W=JSON.parse(V);return Array.isArray(W.sizes)?W.sizes:null}catch(W){return console.warn("Failed to parse saved panel sizes:",W),null}},[l]),j=u.useCallback(()=>{if(!l||!k.current||m.length===0)return;const V=m.map(W=>({id:W.id,size:W.size,collapsed:W.collapsed||!1}));k.current.setItem(l,JSON.stringify({sizes:V}))},[l,m]),S=u.useCallback((V,W,P,H,L)=>{h(A=>A.some(F=>F.id===V)?A:[...A,{id:V,size:W,minSize:P??n,maxSize:H??i,collapsible:L??a,collapsed:!1}])},[n,i,a]),I=u.useCallback(V=>{h(W=>W.filter(P=>P.id!==V))},[]),M=u.useCallback(V=>{const W=m.find(P=>P.id===V);return W?W.size:0},[m]),z=u.useCallback((V,W)=>{h(P=>P.map(H=>H.id===V?{...H,size:W}:H))},[]),E=u.useCallback(V=>{const W=m.find(P=>P.id===V);return W?!!W.collapsed:!1},[m]),_=u.useCallback(V=>{h(W=>{const P=W.findIndex(F=>F.id===V);if(P===-1)return W;const H=W[P];if(!H.collapsible)return W;const L={...H,collapsed:!H.collapsed},A=[...W];return A[P]=L,A})},[]),T=u.useCallback((V,W)=>{x.current=V,y.current=W,b.current=m.map(P=>P.size),p(!0)},[m]),$=u.useCallback(V=>{if(!g||!x.current)return;const W=x.current,P=V-y.current;let H=-1;const L=W.match(/\d+$/);if(L&&(H=parseInt(L[0],10)-1),H===-1&&m.length>=2&&(H=0),H<0||H>=m.length-1)return;const A=m[H],F=m[H+1];if(A.collapsed||F.collapsed)return;let D=b.current[H]+P,O=b.current[H+1]-P;D=Math.max(A.minSize??n,Math.min(A.maxSize??i,D)),O=Math.max(F.minSize??n,Math.min(F.maxSize??i,O)),h(K=>K.map((Y,N)=>N===H?{...Y,size:D}:N===H+1?{...Y,size:O}:Y))},[g,m,e,n,i]),B=u.useCallback(()=>{g&&t&&t(m.map(V=>V.size)),x.current=null,p(!1),l&&j()},[g,m,t,l,j]),R=u.useCallback(V=>{if(!g||!x.current)return;const W=x.current;let P=-1;const H=W.match(/\d+$/);if(H&&(P=parseInt(H[0],10)-1),P===-1&&m.length>=2&&(P=0),P<0||P>=m.length-1)return;let L=0;e==="horizontal"?(V.key==="ArrowLeft"&&(L=-s),V.key==="ArrowRight"&&(L=s),V.key==="Home"&&(L=-100),V.key==="End"&&(L=100)):(V.key==="ArrowUp"&&(L=-s),V.key==="ArrowDown"&&(L=s),V.key==="Home"&&(L=-100),V.key==="End"&&(L=100)),L!==0&&(V.preventDefault(),$(y.current+L)),V.key==="Escape"&&(h(A=>A.map((F,D)=>({...F,size:b.current[D]}))),B())},[g,m,e,$,B,s]);return u.useEffect(()=>{const V=H=>{if(!g)return;const L=e==="horizontal"?H.clientX:H.clientY;$(L)},W=H=>{if(!g||H.touches.length===0)return;const L=H.touches[0],A=e==="horizontal"?L.clientX:L.clientY;$(A)},P=()=>{g&&B()};return g&&(document.addEventListener("mousemove",V),document.addEventListener("touchmove",W),document.addEventListener("mouseup",P),document.addEventListener("touchend",P),document.addEventListener("keydown",R),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",V),document.removeEventListener("touchmove",W),document.removeEventListener("mouseup",P),document.removeEventListener("touchend",P),document.removeEventListener("keydown",R),document.body.style.cursor="",document.body.style.userSelect=""}},[g,e,$,B,R]),u.useEffect(()=>{if(m.length!==0){if(l){const V=w();if(V){h(W=>W.map(P=>{const H=V.find(L=>L.id===P.id);return H?{...P,size:H.size,collapsed:H.collapsed||!1}:P}));return}}if(!o){const W=C()/m.length;h(P=>P.map(H=>({...H,size:W})))}}},[m.length,o,C,l,w]),u.useEffect(()=>{if(!o||o.length===0||m.length===0)return;const V=C(),W=o.map(P=>typeof P=="string"&&P.endsWith("%")?parseFloat(P)/100*V:typeof P=="number"?P:parseFloat(P));h(P=>P.map((H,L)=>({...H,size:L<W.length?W[L]:H.size})))},[o,m.length,C]),u.useEffect(()=>{m.length>0&&l&&!g&&j()},[m,l,g,j]),{isResizing:g,setIsResizing:p,containerRef:f,panels:m,registerPanel:S,unregisterPanel:I,getPanelSize:M,setPanelSize:z,isPanelCollapsed:E,togglePanelCollapse:_,startResize:T,onResize:$,endResize:B}},oh={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},th=(e,o)=>({sm:{width:o==="horizontal"?"4px":"100%",height:o==="vertical"?"4px":"100%"},md:{width:o==="horizontal"?"6px":"100%",height:o==="vertical"?"6px":"100%"},lg:{width:o==="horizontal"?"8px":"100%",height:o==="vertical"?"8px":"100%"}})[e],rh=e=>({default:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}},subtle:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-100"},_active:{backgroundColor:"color-gray-200"}},prominent:{backgroundColor:"color-gray-100",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}}}),nh=rh(),To={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},Ra=u.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),Va=()=>u.useContext(Ra),ah=({value:e,children:o})=>r.jsx(Ra.Provider,{value:e,children:o}),ih=({children:e,id:o,defaultSize:t,minSize:n,maxSize:i,collapsible:a,defaultCollapsed:l,onCollapseChange:d,views:s,...g})=>{const{orientation:p,registerPanel:m,unregisterPanel:h,getPanelSize:f,isPanelCollapsed:x,togglePanelCollapse:y}=Va(),b=typeof t=="string"&&t.endsWith("%")?0:typeof t=="number"?t:0;u.useEffect(()=>(m(o,b,n,i,a),()=>h(o)),[o,b,n,i,a,m,h]);const k=f(o),C=x(o);return u.useEffect(()=>{d&&C!==void 0&&d(C)},[C,d]),u.useEffect(()=>{a&&l&&!C&&y(o)},[o,a,l,C,y]),C?r.jsx(c.View,{flex:"0 0 auto",width:p==="horizontal"?"10px":"100%",height:p==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>y(o),"aria-label":`Expand panel ${o}`,role:"button",tabIndex:0,...s==null?void 0:s.collapsedPanel,...g}):r.jsx(c.View,{flex:k>0?"0 0 auto":"1",width:p==="horizontal"?`${k}px`:"100%",height:p==="vertical"?`${k}px`:"100%",overflow:"auto",...s==null?void 0:s.panel,...g,children:e})},lh=({id:e,position:o="both",disabled:t=!1,withVisualIndicator:n=!0,withCollapseButton:i=!1,collapseTarget:a,views:l,...d})=>{const{orientation:s,size:g,variant:p,startResize:m,isPanelCollapsed:h,togglePanelCollapse:f}=Va(),y=(()=>{if(a)return a;const S=e.match(/\d+$/);if(!S)return"";const I=parseInt(S[0],10);return isNaN(I)?"":`panel${I}`})(),b=h(y),k=S=>{if(t)return;S.preventDefault();const I=s==="horizontal"?S.clientX:S.clientY;m(e,I)},C=S=>{if(t||S.touches.length===0)return;S.preventDefault();const I=S.touches[0],M=s==="horizontal"?I.clientX:I.clientY;m(e,M)},w=S=>{t||(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),m(e,0))},j=S=>{S.stopPropagation(),y&&f(y)};return r.jsxs(c.View,{role:"separator","aria-orientation":s,"aria-valuemin":0,"aria-valuemax":100,tabIndex:t?-1:0,cursor:s==="horizontal"?"col-resize":"row-resize",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",...th(g,s),...nh[p],onMouseDown:k,onTouchStart:C,onKeyDown:w,opacity:t?.5:1,pointerEvents:t?"none":"auto",...l==null?void 0:l.handle,...d,children:[n&&r.jsx(c.View,{display:"flex",alignItems:"center",justifyContent:"center",width:s==="horizontal"?"100%":"auto",height:s==="vertical"?"100%":"auto",pointerEvents:"none",...l==null?void 0:l.handleIcon,children:s==="horizontal"?r.jsxs(c.Horizontal,{gap:1,children:[r.jsx(c.View,{...To.horizontal}),r.jsx(c.View,{...To.horizontal})]}):r.jsxs(c.Vertical,{gap:1,children:[r.jsx(c.View,{...To.vertical}),r.jsx(c.View,{...To.vertical})]})}),i&&y&&r.jsx(c.View,{position:"absolute",top:s==="horizontal"?"-20px":"50%",left:s==="horizontal"?"50%":"-20px",transform:s==="horizontal"?"translateX(-50%)":"translateY(-50%)",width:"16px",height:"16px",borderRadius:"full",backgroundColor:"color-gray-100",border:"1px solid",borderColor:"color-gray-300",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:1,onClick:j,"aria-label":b?`Expand panel ${y}`:`Collapse panel ${y}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...l==null?void 0:l.collapseIcon,children:r.jsx(c.View,{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center",children:b?r.jsxs(c.Horizontal,{children:[r.jsx(c.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"}),r.jsx(c.View,{width:"2px",height:"6px",backgroundColor:"color-gray-600",position:"absolute"})]}):r.jsx(c.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"})})})]})},ch=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:i,minSize:a,maxSize:l,collapsible:d=!1,containerRef:s,autoSaveId:g,views:p,...m})=>{const h=o==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(h,{ref:s,width:"100%",height:"100%",position:"relative",overflow:"hidden",...oh[o],...p==null?void 0:p.container,...m,children:e})},sh=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:i,onSizesChange:a,minSize:l=50,maxSize:d,collapsible:s=!1,autoSaveId:g,storage:p,keyboardResizeBy:m=10,views:h,...f})=>{const{isResizing:x,setIsResizing:y,containerRef:b,registerPanel:k,unregisterPanel:C,getPanelSize:w,setPanelSize:j,isPanelCollapsed:S,togglePanelCollapse:I,startResize:M,onResize:z,endResize:E}=eh(o,i,a,l,d,s,g,p,m);return r.jsx(ah,{value:{orientation:o,size:t,variant:n,isResizing:x,setIsResizing:y,registerPanel:k,unregisterPanel:C,getPanelSize:w,setPanelSize:j,isPanelCollapsed:S,togglePanelCollapse:I,startResize:M,onResize:z,endResize:E},children:r.jsx(ch,{orientation:o,size:t,variant:n,defaultSizes:i,minSize:l,maxSize:d,collapsible:s,autoSaveId:g,keyboardResizeBy:m,containerRef:b,views:h,...f,children:e})})},Ut=sh;Ut.Panel=ih;Ut.Handle=lh;const Mo={info:{container:{backgroundColor:"color-blue-50",border:"color-blue-300"},content:{color:"color-blue-700"},icon:{color:"color-blue-500"}},success:{container:{backgroundColor:"color-green-50",border:"color-green-300"},content:{color:"color-green-700"},icon:{color:"color-green-500"}},warning:{container:{backgroundColor:"color-orange-50",border:"color-orange-300"},content:{color:"color-orange-700"},icon:{color:"color-orange-500"}},error:{container:{backgroundColor:"color-red-50",border:"color-red-300"},content:{color:"color-red-700"},icon:{color:"color-red-500"}}},dh={top:{top:"16px",left:"50%",transform:"translateX(-50%)"},"top-right":{top:"16px",right:"16px"},"top-left":{top:"16px",left:"16px"},bottom:{bottom:"16px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"}},uh=()=>Math.random().toString(36).substring(2,9);let Ue=new Map;const jo=jt.create(e=>({toasts:[],add:(o,t,n,i={})=>{const a=i.id||uh(),l={id:a,variant:o,title:t,description:n,createdAt:Date.now(),isVisible:!0,...i};if(e(d=>({toasts:[...d.toasts,l]})),i.duration!==0){const d=i.duration||5e3,s=setTimeout(()=>{jo.getState().remove(a)},d);Ue.set(a,s)}return a},remove:o=>{e(t=>({toasts:t.toasts.map(n=>n.id===o?{...n,isVisible:!1}:n)})),Ue.has(o)&&(clearTimeout(Ue.get(o)),Ue.delete(o)),setTimeout(()=>{e(t=>({toasts:t.toasts.filter(n=>n.id!==o)}))},300)},removeAll:()=>{Ue.forEach(clearTimeout),Ue.clear(),e(o=>({toasts:o.toasts.map(t=>({...t,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),Ae=(e,o,t,n)=>jo.getState().add(e,o,t,n),Ea=(e,o,t)=>Ae("info",e,o,t),Pa=(e,o,t)=>Ae("success",e,o,t),Wa=(e,o,t)=>Ae("warning",e,o,t),_a=(e,o,t)=>Ae("error",e,o,t),$a=e=>{jo.getState().remove(e)},Ha=()=>{jo.getState().removeAll()},Ba=({variant:e,title:o,description:t,onClose:n,isClosable:i=!0,action:a,actionText:l,showIcon:d=!0,theme:s,views:g,render:p,icon:m,id:h,isVisible:f=!0,themeMode:x})=>{const y=s??Mo,b=()=>{var j,S;if(m!==void 0)return m;const w=e?(S=(j=Mo[e])==null?void 0:j.icon)==null?void 0:S.color:Mo.info.icon.color;switch(e){case"info":return r.jsx(ze,{widthHeight:20,color:w});case"success":return r.jsx(St,{widthHeight:20,color:w});case"warning":return r.jsx(ze,{widthHeight:20,color:w,orientation:"down"});case"error":return r.jsx(Oo,{widthHeight:20,color:w});default:return r.jsx(ze,{widthHeight:20,color:Mo.info.icon.color})}};if(p)return r.jsx(r.Fragment,{children:p({id:h||"",onClose:n})});const k=e==="error"?"alert":"status",C=e==="error"||e==="warning"?"assertive":"polite";return r.jsxs(c.Horizontal,{role:k,"aria-live":C,"aria-atomic":"true","data-state":f?"open":"closed",gap:12,width:"100%",maxWidth:"400px",borderWidth:"1px",borderStyle:"solid",borderRadius:"8px",padding:"12px 16px",alignItems:"flex-start",position:"relative",backgroundColor:y[e].container.backgroundColor,borderColor:y[e].container.border,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",opacity:f?1:0,transform:f?"scale(1)":"scale(0.95)",transition:"all 0.3s ease",...g==null?void 0:g.container,children:[d&&r.jsx(c.View,{marginTop:"2px",...g==null?void 0:g.icon,children:b()}),r.jsxs(c.Vertical,{gap:4,flex:"1",children:[r.jsx(c.Text,{size:"md",fontWeight:"600",color:y[e].content.color,backgroundColor:y[e].container.backgroundColor,...g==null?void 0:g.title,children:o}),t&&r.jsx(c.Text,{size:"sm",color:y[e].content.color,fontWeight:"400",backgroundColor:y[e].container.backgroundColor,...g==null?void 0:g.description,children:t}),a&&l&&r.jsx(c.Text,{size:"sm",fontWeight:"600",marginTop:"8px",cursor:"pointer",color:y[e].content.color,backgroundColor:y[e].container.backgroundColor,onClick:w=>{w.stopPropagation(),a()},_hover:{textDecoration:"underline"},transition:"all 0.2s ease",...g==null?void 0:g.actionButton,children:l})]}),i&&r.jsx(c.View,{as:"button","aria-label":"Close toast",backgroundColor:"transparent",border:"none",cursor:"pointer",padding:"4px",marginLeft:"8px",marginTop:"-4px",marginRight:"-8px",borderRadius:"4px",onClick:w=>{w.stopPropagation(),n()},_hover:{backgroundColor:"rgba(0, 0, 0, 0.05)"},transition:"all 0.2s ease",...g==null?void 0:g.closeButton,children:r.jsx(fe,{widthHeight:16,color:y[e].content.color})})]})},gh=({position:e="top-right",gap:o=8,limit:t=5,containerStyle:n})=>{const{toasts:i,remove:a}=jo(),d=u.useMemo(()=>{const s={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return i.forEach(g=>{const p=g.position||e;s[p].push(g)}),Object.keys(s).forEach(g=>{s[g]=s[g].slice(-t)}),s},[i,e,t])[e];return r.jsx(c.View,{position:"fixed",zIndex:9999,display:"flex",flexDirection:e.includes("bottom")?"column-reverse":"column",gap:`${o}px`,width:"fit-content",maxWidth:"100%",pointerEvents:"none",...dh[e],style:n,children:d.map(s=>r.jsx(c.View,{pointerEvents:"auto",animation:e.includes("right")?"slideInRight 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("left")?"slideInLeft 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("top")?"slideInDown 0.3s ease-out, fadeIn 0.3s ease-out":"slideInUp 0.3s ease-out, fadeIn 0.3s ease-out",children:r.jsx(Ba,{id:s.id,variant:s.variant,title:s.title,description:s.description,onClose:()=>a(s.id),isClosable:s.isClosable,action:s.action,actionText:s.actionText,showIcon:s.showIcon,views:s.views,render:s.render,icon:s.icon,isVisible:s.isVisible})},s.id))})},ph=()=>({toast:(e,o,t,n)=>Ae(e,o,t,n),info:(e,o,t)=>Ea(e,o,t),success:(e,o,t)=>Pa(e,o,t),warning:(e,o,t)=>Wa(e,o,t),error:(e,o,t)=>_a(e,o,t),remove:e=>$a(e),removeAll:()=>Ha()}),mh=e=>r.jsx(Ba,{...e}),hh=Object.assign(mh,{Container:e=>r.jsx(gh,{...e}),show:Ae,info:Ea,success:Pa,warning:Wa,error:_a,remove:$a,removeAll:Ha}),fh=ph,br=(e,o)=>{var l,d;if(!e)return!0;const t=e.toLowerCase(),n=o.name.toLowerCase().includes(t),i=((l=o.description)==null?void 0:l.toLowerCase().includes(t))||!1,a=((d=o.keywords)==null?void 0:d.some(s=>s.toLowerCase().includes(t)))||!1;return n||i||a},xh=({open:e,onOpenChange:o,groups:t=[],commands:n=[],filter:i})=>{const[a,l]=u.useState(""),[d,s]=u.useState(0),g=u.useRef(null),p=u.useMemo(()=>i||br,[i]),m=u.useMemo(()=>[...t.flatMap(b=>b.commands),...n],[t,n]),h=u.useMemo(()=>a.trim()?m.filter(y=>p(a,y)):m,[m,a,p]),f=u.useMemo(()=>{if(!a)return t;const y=i||br;return t.map(b=>({...b,commands:b.commands.filter(k=>y(a,k))})).filter(b=>b.commands.length)},[t,a,i]);u.useEffect(()=>{s(0)},[h.length]);const x=u.useCallback(y=>{if(e)switch(y.key){case"ArrowDown":y.preventDefault(),s(b=>b<h.length-1?b+1:b);break;case"ArrowUp":y.preventDefault(),s(b=>b>0?b-1:b);break;case"Enter":y.preventDefault(),h[d]&&(h[d].onSelect(),o(!1),l(""));break;case"Escape":y.preventDefault(),o(!1),l("");break}},[e,h,d,o]);return u.useEffect(()=>(document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}),[x]),u.useEffect(()=>{if(g.current&&e){const y=g.current.querySelector(`[data-index="${d}"]`);y&&y.scrollIntoView({block:"nearest"})}},[d,e]),u.useEffect(()=>{e?s(0):l("")},[e]),{search:a,setSearch:l,selectedIndex:d,setSelectedIndex:s,filteredCommands:h,filteredGroups:f,listRef:g}},bh={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},yh=e=>({default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},outline:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"}}),kh=yh(),jh={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},Ch={overflow:"auto",padding:"8px 0"},Sh={marginBottom:"8px"},wh={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},Ih={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},Th={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},Mh={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},zh={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},Rh={display:"flex",flexDirection:"column",flex:1},Vh={fontSize:"14px",fontWeight:"medium"},Eh={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},Ph={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},Wh={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},_h={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},$h=u.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),Hh=({value:e,children:o})=>r.jsx($h.Provider,{value:e,children:o}),La=({value:e,onValueChange:o,placeholder:t="Type a command or search...",views:n,...i})=>{const a=u.useRef(null);return u.useEffect(()=>{a.current&&a.current.focus()},[]),r.jsxs(c.View,{...jh,...n==null?void 0:n.container,...i,children:[r.jsx(Po,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),r.jsx(c.View,{as:"input",type:"text",value:e,onChange:l=>o(l.target.value),placeholder:t,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"14px",ref:a,...n==null?void 0:n.input})]})},Bh=({children:e,views:o,...t})=>r.jsx(c.View,{...Ch,...o==null?void 0:o.container,...t,children:e}),Aa=({heading:e,children:o,views:t,...n})=>r.jsxs(c.View,{...Sh,...t==null?void 0:t.container,...n,children:[r.jsx(c.Text,{...wh,...t==null?void 0:t.heading,children:e}),o]}),kt=({item:e,selected:o=!1,onSelect:t,views:n,...i})=>{const a=()=>{!e.disabled&&t&&t()};return r.jsxs(c.Horizontal,{...Ih,...o?Th:{},...e.disabled?Mh:{},onClick:a,...n==null?void 0:n.container,...i,children:[e.icon&&r.jsx(c.View,{...zh,...n==null?void 0:n.icon,children:e.icon}),r.jsxs(c.Vertical,{...Rh,...n==null?void 0:n.content,children:[r.jsx(c.Text,{...Vh,...n==null?void 0:n.name,children:e.name}),e.description&&r.jsx(c.Text,{...Eh,...n==null?void 0:n.description,children:e.description})]}),e.shortcut&&r.jsx(c.Text,{...Ph,...n==null?void 0:n.shortcut,children:e.shortcut})]})},Da=({children:e="No results found.",views:o,...t})=>r.jsx(c.View,{...Wh,...o==null?void 0:o.container,...t,children:e}),Lh=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:i,size:a="md",variant:l="default",emptyState:d,footer:s,search:g,setSearch:p,selectedIndex:m,setSelectedIndex:h,filteredCommands:f,filteredGroups:x,listRef:y,views:b,filter:k,...C})=>{if(!e)return null;const w=u.useCallback(z=>{z.disabled||(z.onSelect(),o(!1),p(""))},[o,p]),j=u.useCallback(z=>z.target===z.currentTarget&&o(!1),[o]),S=u.useMemo(()=>({search:g,setSearch:p,selectedIndex:m,setSelectedIndex:h,filteredCommands:f,onSelect:w}),[g,m,f,w,p,h]),I=t.length>0,M=f.length===0;return r.jsx(c.View,{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:9999,onClick:j,...C,children:r.jsx(Hh,{value:S,children:r.jsxs(c.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...bh[a],...kh[l],...b==null?void 0:b.container,onClick:z=>z.stopPropagation(),children:[r.jsx(La,{value:g,onValueChange:p,placeholder:i,views:b==null?void 0:b.searchInput}),r.jsx(c.View,{ref:y,flex:1,overflow:"auto",...b==null?void 0:b.list,children:M?d||r.jsx(Da,{views:b==null?void 0:b.empty}):I?x.map(z=>r.jsx(Aa,{heading:z.name,views:b==null?void 0:b.groupHeading,children:z.commands.map(E=>{const _=f.findIndex(T=>T.id===E.id);return r.jsx(kt,{item:E,selected:_===m,onSelect:()=>w(E),"data-index":_,views:{container:b==null?void 0:b.item,icon:b==null?void 0:b.icon,content:b==null?void 0:b.content,name:b==null?void 0:b.name,description:b==null?void 0:b.description,shortcut:b==null?void 0:b.shortcut}},E.id)})},z.id)):f.map((z,E)=>r.jsx(kt,{item:z,selected:E===m,onSelect:()=>w(z),"data-index":E,views:{container:b==null?void 0:b.item,icon:b==null?void 0:b.icon,content:b==null?void 0:b.content,name:b==null?void 0:b.name,description:b==null?void 0:b.description,shortcut:b==null?void 0:b.shortcut}},z.id))}),s&&r.jsx(c.View,{..._h,...b==null?void 0:b.footer,children:s})]})})})},Ah=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:i,size:a="md",variant:l="default",filter:d,emptyState:s,footer:g,views:p,...m})=>{const{search:h,setSearch:f,selectedIndex:x,setSelectedIndex:y,filteredCommands:b,filteredGroups:k,listRef:C}=xh({open:e,onOpenChange:o,groups:t,commands:n,filter:d});return r.jsx(Lh,{open:e,onOpenChange:o,groups:t,commands:n,placeholder:i,size:a,variant:l,emptyState:s,footer:g,search:h,setSearch:f,selectedIndex:x,setSelectedIndex:y,filteredCommands:b,filteredGroups:k,listRef:C,views:p,...m})},eo=Ah;eo.Input=La;eo.List=Bh;eo.Group=Aa;eo.Item=kt;eo.Empty=Da;const yr=()=>Math.random().toString(36).substring(2,11),Dh=({defaultOpen:e=!1,openDelay:o=200,closeDelay:t=200,isDisabled:n=!1}={})=>{const[i,a]=u.useState(e),l=u.useRef(null),d=u.useRef(null),s=u.useRef(null),g=u.useRef(null),p=u.useRef(`tooltip-trigger-${yr()}`).current,m=u.useRef(`tooltip-content-${yr()}`).current,h=u.useCallback(()=>{n||(g.current&&(clearTimeout(g.current),g.current=null),!i&&!s.current&&(s.current=setTimeout(()=>{a(!0),s.current=null},o)))},[i,o,n]),f=u.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),i&&!g.current&&(g.current=setTimeout(()=>{a(!1),g.current=null},t))},[i,t]),x=u.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null)},[]);return u.useEffect(()=>()=>{s.current&&clearTimeout(s.current),g.current&&clearTimeout(g.current)},[]),u.useEffect(()=>{const y=b=>{b.key==="Escape"&&i&&a(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[i]),{isOpen:i,openTooltip:h,closeTooltip:f,cancelCloseTimer:x,triggerRef:l,contentRef:d,triggerId:p,contentId:m}},Fh={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},Oh=e=>({default:{backgroundColor:"color-gray-900",color:"color-white",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",transition:"opacity 0.15s ease"},light:{backgroundColor:"color-white",color:"color-gray-800",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.04)",transition:"opacity 0.15s ease"},dark:{backgroundColor:"color-gray-950",color:"color-white",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.2), 0px 2px 4px rgba(0, 0, 0, 0.12)",transition:"opacity 0.15s ease"}}),qh=Oh(),Nh=e=>{const o={position:"absolute",width:"8px",height:"8px",backgroundColor:"inherit",borderStyle:"inherit",borderWidth:"inherit",borderColor:"inherit",transform:"rotate(45deg)"};switch(e){case"top":return{...o,bottom:"-4px",left:"50%",marginLeft:"-4px",borderTop:"none",borderLeft:"none"};case"right":return{...o,left:"-4px",top:"50%",marginTop:"-4px",borderRight:"none",borderTop:"none"};case"bottom":return{...o,top:"-4px",left:"50%",marginLeft:"-4px",borderBottom:"none",borderRight:"none"};case"left":return{...o,right:"-4px",top:"50%",marginTop:"-4px",borderLeft:"none",borderBottom:"none"};default:return o}},Fa=u.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Gt=()=>u.useContext(Fa),Uh=({value:e,children:o})=>r.jsx(Fa.Provider,{value:e,children:o}),Oa=u.memo(({children:e,views:o,asChild:t=!1,...n})=>{const{openTooltip:i,closeTooltip:a,triggerRef:l,contentId:d,triggerId:s}=Gt(),g=u.useCallback(()=>i(),[i]),p=u.useCallback(()=>a(),[a]),m=u.useCallback(()=>i(),[i]),h=u.useCallback(()=>a(),[a]),f={ref:l,onMouseEnter:g,onMouseLeave:p,onFocus:m,onBlur:h,id:s,"aria-describedby":d,...o==null?void 0:o.container,...n};return t&&u.isValidElement(e)?u.cloneElement(e,f):r.jsx(c.View,{display:"inline-block",...f,children:e})}),Gh=u.memo(({children:e,views:o,...t})=>{const{isOpen:n,contentRef:i,contentId:a,triggerId:l}=Gt();return n?r.jsx(c.View,{ref:i,id:a,role:"tooltip","aria-labelledby":l,...o==null?void 0:o.container,...t,children:e}):null}),Yh=({content:e,children:o,position:t="top",align:n="center",size:i="md",variant:a="default",showArrow:l=!0,views:d,themeMode:s,...g})=>{const{isOpen:p,triggerRef:m,contentRef:h,contentId:f,triggerId:x}=Gt(),{ref:y,relation:b}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[k,C]=u.useState({x:0,y:0,placement:t});u.useEffect(()=>{m!=null&&m.current&&y&&(y.current=m.current)},[m,y,p]),u.useEffect(()=>{if(p&&(h!=null&&h.current)&&(m!=null&&m.current)){const S=m.current.getBoundingClientRect();let I=t;b&&(t==="top"&&b.space.vertical==="bottom"?I="bottom":t==="bottom"&&b.space.vertical==="top"?I="top":t==="right"&&b.space.horizontal==="left"?I="left":t==="left"&&b.space.horizontal==="right"&&(I="right"));let M=0,z=0;switch(I){case"top":M=n==="start"?S.left:n==="end"?S.right-120:S.left+S.width/2-60,z=S.top-8;break;case"bottom":M=n==="start"?S.left:n==="end"?S.right-120:S.left+S.width/2-60,z=S.bottom+8;break;case"right":M=S.right+8,z=n==="start"?S.top:n==="end"?S.bottom-32:S.top+S.height/2-16;break;case"left":M=S.left-8,z=n==="start"?S.top:n==="end"?S.bottom-32:S.top+S.height/2-16;break}C({x:M,y:z,placement:I})}},[p,t,n,m,h,b]);const w=u.useMemo(()=>l?Nh(k.placement):{},[l,k.placement]),j=u.useMemo(()=>{const S={position:"fixed",left:k.x,top:k.y,zIndex:1e3};switch(k.placement){case"top":return{...S,transform:"translateY(-100%)"};case"left":return{...S,transform:"translateX(-100%)"};case"bottom":case"right":default:return S}},[k.x,k.y,k.placement]);return r.jsxs(c.View,{position:"relative",display:"inline-block",...d==null?void 0:d.container,...g,children:[r.jsx(Oa,{children:o}),p&&r.jsxs(c.View,{ref:h,id:f,role:"tooltip","aria-labelledby":x,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:j,...Fh[i],...qh[a],...d==null?void 0:d.content,children:[typeof e=="string"?r.jsx(c.Text,{...d==null?void 0:d.text,children:e}):e,l&&r.jsx(c.View,{...w,...d==null?void 0:d.arrow})]})]})},vh=({content:e,children:o,position:t="top",align:n="center",size:i="md",variant:a="default",openDelay:l=200,closeDelay:d=200,showArrow:s=!0,defaultOpen:g=!1,isDisabled:p=!1,views:m,...h})=>{const f=Dh({defaultOpen:g,openDelay:l,closeDelay:d,isDisabled:p});return r.jsx(Uh,{value:f,children:r.jsx(Yh,{content:e,position:t,align:n,size:i,variant:a,showArrow:s,views:m,...h,children:o})})},Yt=vh;Yt.Trigger=Oa;Yt.Content=Gh;const qa=u.forwardRef((e,o)=>{const t=Pn(e);return r.jsx(Hn,{...e,...t})});qa.displayName="ChatInput";const Xh={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},kr={container:{position:"relative",display:"flex",flexDirection:"column",height:"100vh",alignItems:"center",justifyContent:"center"},gradient:{position:"absolute",inset:"-10px",opacity:.5,pointerEvents:"none",filter:"blur(10px)",backgroundSize:"300% 200%",backgroundPosition:"50% 50%, 50% 50%"}},dt={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},image:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundAttachment:"scroll"},content:{position:"relative",width:"100%",height:"100%",zIndex:2}},ut={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},video:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"},content:{position:"relative",zIndex:2}},jr={"to-right":"to right","to-left":"to left","to-bottom":"to bottom","to-top":"to top","to-top-right":"to top right","to-top-left":"to top left","to-bottom-right":"to bottom right","to-bottom-left":"to bottom left"},zo={center:"center",top:"top",right:"right",bottom:"bottom",left:"left","top-right":"top right","top-left":"top left","bottom-right":"bottom right","bottom-left":"bottom left"},Kh={linear:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],radial:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],conic:[{color:"color-red-500",position:"0deg"},{color:"color-yellow-500",position:"90deg"},{color:"color-green-500",position:"180deg"},{color:"color-blue-500",position:"270deg"},{color:"color-red-500",position:"360deg"}]},Qh=(e,o,t,n,i)=>{const a=o.map(l=>`${l.color} ${l.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${t&&jr[t]?jr[t]:t||"to right"}, ${a})`;case"radial":const d=i&&zo[i]?zo[i]:i||"center";return`radial-gradient(${n||"circle"} at ${d}, ${a})`;case"conic":return`conic-gradient(from 0deg at ${i&&zo[i]?zo[i]:i||"center"}, ${a})`;default:return`linear-gradient(to right, ${a})`}},Zh={linear:{backgroundSize:"200% 200%",transition:"background-position 3s ease-in-out",animate:{from:{backgroundPosition:"0% 50%"},"50%":{backgroundPosition:"100% 50%"},to:{backgroundPosition:"0% 50%"}}},radial:{backgroundSize:"100% 100%",transition:"all 3s ease-in-out",animate:{from:{backgroundPosition:"center",backgroundSize:"100% 100%"},"50%":{backgroundSize:"120% 120%"},to:{backgroundPosition:"center",backgroundSize:"100% 100%"}}},conic:{transition:"transform 3s linear",animate:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}},Cr={container:{position:"relative",overflow:"hidden",borderRadius:"8px",transition:"all 0.2s ease"},content:{position:"relative",zIndex:1,width:"100%",height:"100%",padding:"16px"}},Jh=({type:e="linear",direction:o="to-right",shape:t="circle",position:n="center",from:i,to:a,colors:l,animate:d=!1,animationDuration:s=3,children:g,views:p,themeMode:m,...h})=>{const f=u.useMemo(()=>l&&l.length>0?l:i&&a?[{color:i,position:"0%"},{color:a,position:"100%"}]:Kh[e],[l,i,a,e]),x=u.useMemo(()=>{const b=f.map(k=>({...k,color:k.color}));return Qh(e,b,o,t,n)},[e,f,o,t,n]),y=u.useMemo(()=>{if(!d)return{};const b=Zh[e];return{...b,transition:b.transition.replace("3s",`${s}s`),animationDuration:`${s}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[d,s,e]);return r.jsx(c.View,{background:x,...Cr.container,...y,...p==null?void 0:p.container,...h,children:g&&r.jsx(c.View,{...Cr.content,...p==null?void 0:p.content,children:g})})},ef=e=>r.jsx(Jh,{...e}),of=u.createContext({}),tf=({children:e,showRadialGradient:o=!0,views:t,themeMode:n,...i})=>{const a={white:"rgba(255,255,255,1)",transparent:"rgba(255,255,255,0)"},l=["rgb(59, 130, 246)","rgb(196, 181, 253)","rgb(147, 197, 253)","rgb(221, 214, 254)","rgb(96, 165, 250)"],d={...kr.gradient,backgroundImage:`
28
+ ${pe}`:pe}let le=E,se=!1;E.endsWith("-thinking")&&(le=E.replace(/-thinking$/,""),se=!0),n(Q,{model_name:le,enable_thinking:se}),x||b(""),w([]),C([])},O=v=>{w(Q=>Q.filter((le,se)=>se!==v)),!g&&j.length>v&&C(Q=>Q.filter((le,se)=>se!==v))},X=v=>{v.preventDefault(),v.stopPropagation(),$(!0)},Z=v=>{v.preventDefault(),v.stopPropagation(),$(!1)},J=u.useCallback(v=>{!v||v.length===0||(C(Q=>[...Q,...v]),w(Q=>[...Q,...v]),T(Q=>[...Q,...v]),M(!0))},[C,w]),oe=u.useCallback(()=>{if(_.length>0&&!W&&f){B(!0);const v=_[0];P.current=v,V(0);try{f(v)}catch(Q){T(le=>le.slice(1)),B(!1),P.current=null,V(0),M(le=>_.length-1>0||!1),h==null||h(Q)}}else _.length===0&&I&&(M(!1),V(0))},[_,W,f,I,h]);u.useEffect(()=>{oe()},[_,W,oe]);const re="active",ce=v=>!0,me=()=>{q(!1),e.onGuideClose&&e.onGuideClose()},U=v=>{x&&t?t(v.text):b(v.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(v),A.current&&A.current.focus()},G=u.useCallback(()=>j,[j]),ee=u.useCallback(()=>C([]),[]);return{onSubmit:n,getPendingFiles:G,clearPendingFiles:ee,value:k,handleChange:K,handleSubmit:Y,editableRef:A,fileInputRef:F,isUploading:I,uploadProgress:R,isDraggingOver:z,uploadedFiles:S,pendingFiles:j,removeUploadedFile:O,setPendingFiles:C,setUploadedFiles:w,setIsUploading:M,startUpload:J,selectedModel:E,handleModelChange:H,modelOptions:L,subscriptionStatus:re,canAccessModel:ce,handleDragOver:X,handleDragLeave:Z,isGuideTipShown:D,hideGuideTip:me,handlePromptExampleSelect:U}},qu={attachmentRemove:{position:"absolute",top:"2px",right:"2px",width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"color-black-900",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",zIndex:1}},sr={container:{width:"100%",maxWidth:"100%",borderRadius:"12px",backgroundColor:"color-white",transition:"all 0.2s ease",media:{mobile:{borderRadius:"8px"}}},content:{width:"100%",padding:"12px",borderRadius:"12px",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",media:{mobile:{padding:"10px",borderRadius:"8px"}}}},Nu={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},Uu={xs:{fontSize:"10px",padding:"4px 8px"},sm:{fontSize:"12px",padding:"6px 10px"},md:{fontSize:"14px",padding:"8px 12px"},lg:{fontSize:"16px",padding:"10px 14px"},xl:{fontSize:"20px",padding:"12px 16px"}},Gu={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"},none:{backgroundColor:"transparent",border:"none"}},dr=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,Yu=({openDelay:e=200,closeDelay:o=300}={})=>{const[t,n]=u.useState(!1),i=u.useRef(null),a=u.useRef(null),l=u.useRef(null),d=u.useRef(null),s=u.useMemo(()=>dr("hovercard-content"),[]),g=u.useMemo(()=>dr("hovercard-trigger"),[]),p=u.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),m=u.useCallback(()=>{p(),t||(i.current=setTimeout(()=>{n(!0)},e))},[t,e,p]),h=u.useCallback(()=>{p(),t&&(a.current=setTimeout(()=>{n(!1)},o))},[t,o,p]),f=u.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null)},[]);return u.useEffect(()=>()=>p(),[p]),{isOpen:t,openCard:m,closeCard:h,cancelCloseTimer:f,triggerRef:l,contentRef:d,contentId:s,triggerId:g}},Wn=u.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),vu=({children:e,value:o})=>r.jsx(Wn.Provider,{value:o,children:e}),_n=()=>{const e=u.useContext(Wn);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},Xu=({children:e,views:o,asChild:t=!1,...n})=>{const{openCard:i,closeCard:a,triggerRef:l,contentId:d,triggerId:s}=_n(),f={ref:l,onMouseEnter:()=>i(),onMouseLeave:()=>a(),onFocus:()=>i(),onBlur:()=>a(),id:s,"aria-describedby":d,...o==null?void 0:o.container,...n};if(t&&u.isValidElement(e)){const x=u.Children.only(e);return u.cloneElement(x,{...f,...x.props})}return r.jsx(c.View,{position:"relative",display:"inline-block",...f,children:e})},Ku=({children:e,views:o,side:t="bottom",align:n="center",sideOffset:i=8,style:a,backgroundColor:l="white",borderRadius:d="4px",boxShadow:s="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:g="12px",minWidth:p="50px",maxWidth:m="300px",...h})=>{const{isOpen:f,cancelCloseTimer:x,closeCard:y,contentRef:b,triggerRef:k,contentId:S,triggerId:w}=_n(),{ref:j,relation:C}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});u.useEffect(()=>{k!=null&&k.current&&(j==null?void 0:j.current)!==k.current&&j&&(j.current=k.current)},[k,j,f]);const I=()=>x(),M=()=>y();if(!f)return null;const R=()=>{if(!C||!(k!=null&&k.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const T=k.current.getBoundingClientRect();let W=t;t==="bottom"&&C.space.vertical==="top"?W="top":t==="top"&&C.space.vertical==="bottom"?W="bottom":t==="right"&&C.space.horizontal==="left"?W="left":t==="left"&&C.space.horizontal==="right"&&(W="right");let B=0,P=0;switch(W){case"bottom":B=T.left+T.width/2,P=T.bottom+i;break;case"top":B=T.left+T.width/2,P=T.top-i;break;case"right":B=T.right+i,P=T.top+T.height/2;break;case"left":B=T.left-i,P=T.top+T.height/2;break}return{position:"fixed",left:B,top:P,zIndex:1e3,transform:V(W)}},V=T=>{switch(T){case"bottom":return"translate(-50%, 0)";case"top":return"translate(-50%, -100%)";case"right":return"translate(0, -50%)";case"left":return"translate(-100%, -50%)";default:return"translate(-50%, 0)"}},_=R();return r.jsx(c.View,{ref:b,id:S,role:"tooltip","aria-labelledby":w,onMouseEnter:I,onMouseLeave:M,backgroundColor:l,borderRadius:d,boxShadow:s,padding:g,minWidth:p,maxWidth:m,style:{..._,...a},...o==null?void 0:o.container,...h,children:e})},Qu=({children:e,views:o,openDelay:t,closeDelay:n,...i})=>{const a=Yu({openDelay:t,closeDelay:n});return r.jsx(vu,{value:a,children:r.jsx(c.View,{position:"relative",display:"inline-block",...o==null?void 0:o.container,...i,children:e})})},he=Qu;he.Trigger=Xu;he.Content=Ku;const Zu=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:i="120px",showPreviews:a=!1,views:l={}})=>{if(e.length===0)return null;const d=u.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(c.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:i,overflowY:"auto",...l==null?void 0:l.container,children:e.map((s,g)=>{const p=URL.createObjectURL(s)||(s==null?void 0:s.path)||(s==null?void 0:s.url)||"",m=s.type.startsWith("image/"),h=s.type.startsWith("video/"),f=s.type.startsWith("audio/");return r.jsx(c.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...l==null?void 0:l.item,children:a&&r.jsxs(he,{children:[r.jsxs(he.Trigger,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,width:"60px",height:"60px",objectFit:"cover"}),h&&r.jsx(c.View,{as:"video",src:p,alt:s.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(Fo,{widthHeight:24,color:"color-black"})}),!m&&!h&&!f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(go,{widthHeight:24,color:"color-black"})}),t&&r.jsx(c.Button,{...qu.attachmentRemove,onClick:x=>{x.stopPropagation(),t(g)},"aria-label":`Remove ${s.name}`,children:"×"})]}),r.jsxs(he.Content,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,maxWidth:"100%"}),h&&r.jsx(c.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),f&&r.jsx(c.View,{as:"audio",src:p,controls:!0,width:"100%"}),r.jsxs(c.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...l==null?void 0:l.name,children:[s.name," (",d(s.size),")"]})]})]})},g)})})},$n=u.forwardRef(({value:e,onChange:o,placeholder:t="Type your message...",disabled:n=!1,autoFocus:i=!0,suggestions:a=[],onSuggestionSelect:l,showSuggestions:d=!1,mentionData:s=[],mentionTrigger:g="@",onMentionSelect:p,maxHeight:m="200px",minHeight:h="40px",views:f={}},x)=>{var ce,me;const y=u.useRef(e),[b,k]=u.useState(-1),[S,w]=u.useState(!e),j=u.useRef(null),[C,I]=u.useState(!1),[M,R]=u.useState(!1),[V,_]=u.useState(""),[T,W]=u.useState(-1),[B,P]=u.useState(-1),[z,$]=u.useState([]),{ref:E,relation:H}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[L,A]=u.useState({x:0,y:0}),[F,D]=u.useState({x:0,y:0});u.useEffect(()=>{const U=x;U.current&&e!==y.current&&(U.current.textContent=e,y.current=e,w(!e))},[e,x]),u.useEffect(()=>{i&&x&&typeof x=="object"&&x.current&&x.current.focus()},[i,x]);const q=()=>{const U=window.getSelection();if(!U||U.rangeCount===0)return-1;const G=U.getRangeAt(0),ee=G.cloneRange();return ee.selectNodeContents(x&&typeof x=="object"&&x.current?x.current:document.body),ee.setEnd(G.endContainer,G.endOffset),ee.toString().length},K=u.useCallback((U,G)=>{const ee=U.substring(0,G),v=ee.lastIndexOf(g);if(v!==-1){const Q=ee.substring(v+1);if(!Q.includes(" ")){const se=Q.toLowerCase(),pe=s.filter(ne=>ne.name.toLowerCase().includes(se));_(se),W(v),$(pe),R(pe.length>0),P(0);const xe=Y();A(xe);return}}R(!1),_(""),W(-1),P(-1)},[s,g]);u.useEffect(()=>{j.current&&E&&(E.current=j.current)},[j,E]);const Y=u.useCallback((U=200)=>{if(!j.current)return{x:0,y:0};const G=j.current.getBoundingClientRect();if(H){const le=H.space.vertical==="top";return{x:G.left,y:le?G.top-U-8:G.bottom+8}}const ee=window.innerHeight,v={top:G.top,bottom:ee-G.bottom},Q=v.bottom<U+8&&v.top>v.bottom;return{x:G.left,y:Q?G.top-U-8:G.bottom+8}},[H]),O=u.useCallback(()=>{I(!0);const U=Y();D(U)},[Y]),X=u.useCallback(()=>{setTimeout(()=>{I(!1),k(-1)},150)},[]),Z=U=>{const G=U.currentTarget.textContent||"";if(G!==y.current){o(G),y.current=G,w(!G);const ee=q();K(G,ee)}},J=u.useCallback(U=>{if(x&&typeof x=="object"&&x.current){const G=x.current.textContent||"",ee=G.substring(0,T),v=G.substring(T+g.length+V.length),Q=ee+g+U.name+" "+v;o(Q),y.current=Q,x.current.textContent=Q;const le=ee.length+g.length+U.name.length+1;setTimeout(()=>{var se;if(x.current){const pe=document.createRange(),xe=window.getSelection(),ne=x.current.firstChild;ne&&xe&&(pe.setStart(ne,Math.min(le,((se=ne.textContent)==null?void 0:se.length)||0)),pe.collapse(!0),xe.removeAllRanges(),xe.addRange(pe))}},0)}R(!1),_(""),W(-1),P(-1),p&&p(U)},[T,g,V,o,p,x]),oe=u.useCallback(U=>{l&&l(U),k(-1)},[l]),re=U=>{if(M&&z.length>0){if(U.key==="ArrowDown"){U.preventDefault(),P(G=>G<z.length-1?G+1:0);return}if(U.key==="ArrowUp"){U.preventDefault(),P(G=>G>0?G-1:z.length-1);return}if((U.key==="Tab"||U.key==="Enter")&&B>=0){U.preventDefault(),J(z[B]);return}if(U.key==="Escape"){R(!1),P(-1);return}}if(d&&a.length>0){if(U.key==="ArrowDown"){U.preventDefault(),k(G=>G<a.length-1?G+1:0);return}if(U.key==="ArrowUp"){U.preventDefault(),k(G=>G>0?G-1:a.length-1);return}if(U.key==="Tab"&&b>=0){U.preventDefault(),oe(a[b]);return}if(U.key==="Escape"){k(-1);return}}};return r.jsxs(c.View,{ref:j,width:"100%",position:"relative",...f==null?void 0:f.container,children:[r.jsxs(c.View,{width:"100%",minHeight:h,maxHeight:m,overflowY:"auto",position:"relative",children:[S&&r.jsx(c.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...f==null?void 0:f.placeholder,children:t}),r.jsx(c.View,{as:"div",ref:x,contentEditable:!n,suppressContentEditableWarning:!0,onInput:Z,onKeyDown:re,onFocus:O,onBlur:X,role:"textbox","aria-multiline":"true","aria-placeholder":t,width:"100%",minHeight:"24px",padding:"8px",outline:"none",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"14px",color:"color-gray-900",backgroundColor:"transparent",...f==null?void 0:f.input})]}),M&&z.length>0&&r.jsx(c.View,{position:"fixed",left:L.x,top:L.y,width:((ce=j.current)==null?void 0:ce.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-blue-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9999,maxHeight:"200px",overflowY:"auto",...f==null?void 0:f.mentionContainer,children:r.jsxs(c.Vertical,{gap:0,children:[z.map((U,G)=>r.jsx(c.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:G===B?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>J(U),onMouseEnter:()=>P(G),_hover:{backgroundColor:"color-blue-50"},...f==null?void 0:f.mentionItem,children:r.jsxs(c.Vertical,{gap:4,children:[r.jsxs(c.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[g,U.name]}),U.description&&r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",children:U.description})]})},U.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",g,")",H&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",H.space.vertical,"-",H.space.horizontal]})]})]})}),d&&a.length>0&&!M&&C&&!e&&r.jsx(c.View,{position:"fixed",left:F.x,top:F.y,width:((me=j.current)==null?void 0:me.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-green-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9998,maxHeight:"200px",overflowY:"auto",...f==null?void 0:f.suggestionsContainer,children:r.jsxs(c.Vertical,{gap:0,children:[a.map((U,G)=>r.jsx(c.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:G===b?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>oe(U),onMouseEnter:()=>k(G),_hover:{backgroundColor:"color-blue-50"},...f==null?void 0:f.suggestionItem,children:r.jsxs(c.Vertical,{gap:4,children:[r.jsx(c.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:U.text}),U.description&&r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",children:U.description})]})},U.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",H&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",H.space.vertical,"-",H.space.horizontal]})]})]})})]})});$n.displayName="EditableInput";const Ju=({examples:e,onSelect:o,views:t={}})=>{const{getColor:n}=c.useTheme();return!e||e.length===0?null:r.jsx(c.Horizontal,{gap:8,overflowX:"auto",padding:"8px 0",width:"100%",...t==null?void 0:t.container,children:e.map(i=>r.jsx(c.View,{as:"button",type:"button",padding:"8px 12px",borderRadius:"4px",backgroundColor:"color-gray-100",border:"none",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>o(i),_hover:{backgroundColor:"color-gray-200"},...t==null?void 0:t.item,children:r.jsx(c.Text,{fontSize:"14px",color:"color-gray-700",...t==null?void 0:t.text,children:i.text})},i.id))})},eg=({onRecordingComplete:e,onRecordingStart:o,views:t={}})=>{const{recording:n,paused:i,audioBlob:a,analyserNode:l,startRecording:d,stopRecording:s}=Br();u.useEffect(()=>{if(a){const p=new File([a],`recording-${Date.now()}.webm`,{type:a.type||"audio/webm;codecs=opus"});e(p)}},[a]);const g=u.useCallback(()=>{d(),o==null||o()},[]);return r.jsxs(c.Horizontal,{alignItems:"center",gap:4,children:[r.jsx(c.View,{minWidth:90,children:n&&l&&r.jsx(Et,{analyserNode:l,isPaused:i})}),r.jsx(c.View,{as:"button",type:"button",onClick:n?s:g,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n?"theme-error":"color-gray-100",color:n?"color-white":"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:n?"color-red-600":"color-gray-200"},...t.button,children:n?r.jsx(qo,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(wt,{widthHeight:16,color:"currentColor",filled:!1})})]})},Hn=u.memo(({onSubmit:e,placeholder:o="Say what you want and Kimmy will surprise you",loading:t=!1,disabled:n=!1,isAgentRunning:i=!1,enableAudioRecording:a=!1,leftButtons:l,rightButtons:d,onStopAgent:s,loadingText:g="Agent is working...",autoFocus:p=!0,sandboxId:m,hideAttachments:h=!1,attachmentText:f="",promptExamples:x=[],suggestions:y=[],errorMessage:b,size:k="md",shape:S="rounded",variant:w="default",views:j={},mentionData:C=[],mentionTrigger:I="@",onMentionSelect:M,onAudioRecordingStart:R,onAudioRecordingStop:V,value:_,handleChange:T,handleSubmit:W,editableRef:B,fileInputRef:P,isUploading:z,uploadProgress:$,isDraggingOver:E,uploadedFiles:H,removeUploadedFile:L,setPendingFiles:A,setUploadedFiles:F,setIsUploading:D,startUpload:q,selectedModel:K,handleModelChange:Y,modelOptions:O,subscriptionStatus:X,canAccessModel:Z,isGuideTipShown:J,hideGuideTip:oe,handlePromptExampleSelect:re,handleDragOver:ce,handleDragLeave:me,onChange:U,...G})=>{c.useTheme();const ee=u.useMemo(()=>({...sr.container,...Nu[S],...j==null?void 0:j.container}),[S,j==null?void 0:j.container]),v=u.useMemo(()=>({...sr.content,...Uu[k],...Gu[w],...j==null?void 0:j.content}),[k,w,j==null?void 0:j.content]),Q=((_==null?void 0:_.trim().length)??0)>0||H.length>0,le=u.useCallback(ne=>{q([ne]),V==null||V(ne)},[q,V]),se=u.useCallback(ne=>{const Ie=ne.filter(ye=>ye.size>52428800?(console.error(`File size exceeds 50MB limit: ${ye.name}`),!1):!0);Ie.length>0&&q(Ie)},[q]),pe=u.useCallback(ne=>{if(ne.preventDefault(),ne.stopPropagation(),me(ne),ne.dataTransfer.files.length>0){const Ie=Array.from(ne.dataTransfer.files);se(Ie)}},[me,se]),xe=u.useMemo(()=>[...C||[],...H.map((ne,Ie)=>({id:`file-${Ie}`,name:ne.name}))],[C,H]);return r.jsxs(c.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...ee,...G,onDragOver:ce,onDragLeave:me,onDrop:pe,children:[x.length>0&&r.jsx(Ju,{examples:x,onSelect:re,views:{container:j==null?void 0:j.promptExamples,item:j==null?void 0:j.promptExampleItem}}),i&&r.jsxs(c.Horizontal,{justifyContent:"center",alignItems:"center",gap:8,padding:"8px 0",animate:{from:{opacity:0,y:-10},to:{opacity:1,y:0},duration:"0.3s"},...j==null?void 0:j.loadingIndicator,children:[r.jsx(Tt,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(c.Text,{color:"color-gray-500",children:g})]}),r.jsx(c.View,{position:"relative",width:"100%",overflow:"visible",children:r.jsxs(c.View,{as:"form",onSubmit:W,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...v,...ee,paddingHorizontal:16,paddingVertical:10,backgroundColor:E?"color-blue-50":void 0,children:[r.jsx(Zu,{files:H,sandboxId:m,onRemove:L,showPreviews:!0,views:{container:j==null?void 0:j.attachments,item:j==null?void 0:j.attachmentItem,name:j==null?void 0:j.attachmentName,size:j==null?void 0:j.attachmentSize,removeButton:j==null?void 0:j.attachmentRemove}}),r.jsx($n,{ref:B,value:_||"",onChange:T,placeholder:o,disabled:n&&!i,autoFocus:p,suggestions:y||[],showSuggestions:y&&y.length>0&&!_,onSuggestionSelect:ne=>{T(ne.text)},mentionData:xe,mentionTrigger:I,onMentionSelect:M,views:{container:{},input:j==null?void 0:j.editableInput}}),r.jsxs(c.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[!h&&r.jsx(Yo,{accept:"*/*",icon:r.jsx(po,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:se,isLoading:z,progress:$||0,text:f,fileType:"file",renderError:({errorMessage:ne})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},...j==null?void 0:j.fileButton}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:S==="rounded"?"50%":4,padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:ne=>ne.size>50*1024*1024?"File size exceeds 50MB limit":null}),l]}),r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[a&&r.jsx(eg,{onRecordingStart:R,onRecordingComplete:le,views:{button:j==null?void 0:j.recordButton}}),r.jsx(c.View,{as:"button",type:"button",onClick:W,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i?"theme-error":Q?"theme-primary":"color-gray-300",color:"color-white",borderRadius:S==="rounded"?"50%":4,border:"none",cursor:Q?"pointer":"not-allowed",disabled:!Q||t||n&&!i,transition:"all 0.2s ease",_hover:{backgroundColor:i?"color-red-600":Q?"color-blue-600":"color-gray-300"},...j==null?void 0:j.submitButton,children:i?r.jsx(qo,{widthHeight:16,color:"currentColor",filled:!1}):t?r.jsx(uo,{type:"quarter",size:16,color:"color-white"}):r.jsx(It,{widthHeight:16,color:"currentColor",filled:!1})}),d]})]})]})}),b&&r.jsx(c.Text,{color:"theme-error",marginTop:"4px",...j==null?void 0:j.bottomTip,children:b})]})}),og=e=>{const{name:o,onSubmit:t,...n}=e,[i,a]=u.useState([]),l=ue({name:o,type:"text"}),d=h=>{l.onChangeText&&l.onChangeText(h)},s=(h,f)=>{t?t(h,f):d(h)},g=()=>i,p=()=>a([]),m=Pn({...n,value:l.value||"",onChange:d,onSubmit:s,getPendingFiles:g,clearPendingFiles:p});return r.jsx(Hn,{...n,...m,value:l.value||"",onChange:d,onSubmit:s,error:l.error,getPendingFiles:g,clearPendingFiles:p})},tg=og,rg=e=>{const o=ue(e),t=hn(o);return r.jsx(fn,{...t,...o})},ng=rg,ag=e=>{const o=ue(e),t=Cn();return r.jsx(Sn,{...t,...o})},ig=ag,lg=e=>{const o=ue(e),t=xn(e);return r.jsx(bn,{...t,...o})},cg=lg,sg=e=>{let o=ue(e);o.selected=o.value;const t=en(e);return r.jsx(an,{...t,...o})},dg=sg,ug=e=>{const o=ue(e),t=ln(e);return r.jsx(cn,{...t,...o})},gg=ug,pg=e=>{const{name:o,...t}=e,{values:n,errors:i,touched:a,submitCount:l,setFieldValue:d,setFieldTouched:s}=be.useFormikContext(),g=be.getIn(n,o)||[],p=be.getIn(a,o)||l>0?be.getIn(i,o):void 0,m=u.useCallback(b=>{var S;const k=Array.isArray(b)?b.filter(w=>typeof w=="string"):[];d(o,k),(S=e.onTagsChange)==null||S.call(e,k)},[o,d,e.onTagsChange]),h=u.useCallback(()=>{var b;s(o,!0),(b=e.onBlur)==null||b.call(e)},[o,s,e.onBlur]),f=Mn({...t,tags:g,onTagsChange:m,onBlur:h}),{tags:x,...y}=f;return r.jsx(zn,{...y,...t,tags:x,error:p})},mg=pg,hg=e=>{const o=ue(e),t=un(e);return r.jsx(gn,{...t,...o})},fg=hg,xg=e=>{const o=ue(e),{value:t,...n}=Lt(e);return r.jsx(fo,{...n,...o})},bg=xg,yg=({visibleIcon:e=r.jsx(zt,{widthHeight:14}),hiddenIcon:o=r.jsx(Mt,{widthHeight:14}),...t})=>{const n=ue(t),{isVisible:i,setIsVisible:a,...l}=wn(n);return r.jsx(fo,{...l,type:i?"text":"password",isClearable:!1,right:r.jsx(c.View,{onClick:()=>{t.isDisabled||a(!i)},children:i?e:o})})},kg=yg,jg=({items:e,placeholder:o,searchPlaceholder:t,isMulti:n=!1,...i})=>{const a=ue(i),l=In(e,o,t);u.useEffect(()=>{if(n&&Array.isArray(a.value))l.setSelectedItems(a.value);else if(!n&&a.value){const s=typeof a.value=="object"?a.value:e.find(g=>g.value===a.value);s&&l.setSelectedItem(s)}},[a.value,n,e]);const d=s=>{a.onChange(s)};return r.jsx(Tn,{...l,...a,items:e,placeholder:o,isMulti:n,onSelect:d})},Cg=jg,ve=(e,o,t)=>Math.min(Math.max(e,o),t),Sg=(e,o,t,n,i,a,l)=>{const d=n-t;let s;if(a==="horizontal"){const g=o.width,p=e-o.left;s=ve(p/g,0,1)}else{const g=o.height,p=o.bottom-e;s=ve(p/g,0,1)}if(l&&l.length>0){const g=t+s*d;let p=l[0],m=Math.abs(g-p);for(let h=1;h<l.length;h++){const f=Math.abs(g-l[h]);f<m&&(m=f,p=l[h])}return p}else{const g=t+s*d,p=Math.round(g/i)*i;return ve(p,t,n)}},Bn=({min:e=0,max:o=100,step:t=1,value:n=0,defaultValue:i,onChange:a,onDrag:l,orientation:d="horizontal",isDisabled:s=!1,stepValues:g})=>{const p=ve(n??i??e,e,o),[m,h]=u.useState(p),[f,x]=u.useState(!1),[y,b]=u.useState(!1),k=u.useRef(null),S=u.useRef(null),w=n!==void 0,j=w?n:m;u.useEffect(()=>{w&&h(ve(n,e,o))},[n,w,e,o]);const C=u.useCallback(W=>{const B=ve(W,e,o);w||h(B),a&&B!==j&&a(B),f&&l&&l(B)},[w,e,o,a,j,f,l]),I=u.useCallback(W=>{if(s||!k.current)return;const B=k.current.getBoundingClientRect();let P;"touches"in W?P=d==="horizontal"?W.touches[0].clientX:W.touches[0].clientY:P=d==="horizontal"?W.clientX:W.clientY;const z=Sg(P,B,e,o,t,d,g);C(z)},[e,o,t,d,C,s,g]),M=u.useCallback(W=>{if(s)return;W.preventDefault(),x(!0),I(W);const B=z=>{I(z)},P=()=>{x(!1),document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",P),document.removeEventListener("touchmove",B),document.removeEventListener("touchend",P)};document.addEventListener("mousemove",B),document.addEventListener("mouseup",P),document.addEventListener("touchmove",B),document.addEventListener("touchend",P)},[I,s]),R=u.useCallback(W=>{S.current&&S.current.contains(W.target)||M(W)},[M]),V=u.useCallback(W=>{if(s)return;let B=j;switch(W.key){case"ArrowLeft":case"ArrowDown":B=j-t;break;case"ArrowRight":case"ArrowUp":B=j+t;break;case"Home":B=e;break;case"End":B=o;break;default:return}W.preventDefault(),C(B)},[j,e,o,t,C,s]),_=o-e,T=_===0?0:(j-e)/_*100;return{currentValue:j,isDragging:f,isHovered:y,setIsHovered:b,trackRef:k,thumbRef:S,handleThumbMouseDown:M,handleTrackMouseDown:R,handleKeyDown:V,thumbPositionPercent:T}},ur={xs:{height:4,width:"100%"},sm:{height:6,width:"100%"},md:{height:8,width:"100%"},lg:{height:10,width:"100%"},xl:{height:12,width:"100%"}},gr={xs:{width:12,height:12},sm:{width:16,height:16},md:{width:20,height:20},lg:{width:24,height:24},xl:{width:28,height:28}},pr={square:0,rounded:4,pill:24},wg=e=>({default:{backgroundColor:"color-gray-200",transition:"background-color 0.15s ease"},outline:{backgroundColor:"transparent",borderWidth:1,borderStyle:"solid",borderColor:"color-gray-300",transition:"border-color 0.15s ease"}}),mr=wg(),Ig={xs:{trackCrossAxisSize:4,thumbSize:12},sm:{trackCrossAxisSize:6,thumbSize:16},md:{trackCrossAxisSize:8,thumbSize:20},lg:{trackCrossAxisSize:10,thumbSize:24},xl:{trackCrossAxisSize:12,thumbSize:28}},Tg={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},Ln=u.memo(({min:e=0,max:o=100,step:t=1,currentValue:n,stepValues:i,shape:a="rounded",size:l="md",variant:d="default",orientation:s="horizontal",isDisabled:g=!1,showValue:p=!1,showTooltip:m=!1,backgroundColor:h="theme-primary",label:f,helperText:x,themeMode:y,shadow:b={},isDragging:k,isHovered:S,setIsHovered:w,trackRef:j,thumbRef:C,handleThumbMouseDown:I,handleTrackMouseDown:M,handleKeyDown:R,thumbPositionPercent:V,ariaLabel:_="Slider",views:T={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:W,onDrag:B,...P})=>{var O,X;const{getColorHex:z,themeMode:$}=c.useTheme(),E=y||$,H=u.useMemo(()=>z(h,{themeMode:E}),[z,h,E]),L=u.useMemo(()=>z("theme-disabled",{themeMode:E}),[z,E]),A=u.useMemo(()=>z(mr[d].backgroundColor,{themeMode:E}),[z,d,E]),F=s==="vertical",{trackCrossAxisSize:D,thumbSize:q}=Ig[l]||{trackCrossAxisSize:ur[l].height,thumbSize:gr[l].width||16},K=r.jsxs(c.Vertical,{width:"100%",gap:8,...T.container,...P,children:[f&&r.jsxs(c.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontSize:14,fontWeight:500,...T.label,children:f}),p&&r.jsx(c.Text,{fontSize:14,color:"color-blueGray-500",...T.valueLabel,children:n})]}),r.jsxs(c.View,{ref:j,position:"relative",cursor:g?"not-allowed":"pointer",opacity:g?.6:1,onMouseDown:M,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),...ur[l],borderRadius:pr[a],backgroundColor:A,...mr[d],...b,...T.track,children:[i&&i.length>0&&r.jsx(r.Fragment,{children:i.map(Z=>{const J=(Z-e)/(o-e)*100;return r.jsx(c.View,{position:"absolute",top:"50%",left:`${J}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",backgroundColor:g?L:H,zIndex:1,...T.stepMarks},Z)})}),r.jsx(c.View,{position:"absolute",top:0,left:0,height:"100%",width:`${V}%`,backgroundColor:g?L:H,borderRadius:pr[a],transition:"width 0.1s ease-in-out",...T.progress,...T.filledTrack}),r.jsx(c.View,{ref:C,role:"slider",tabIndex:g?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":g,"aria-label":_,position:"absolute",top:"50%",left:`${V}%`,borderRadius:"50%",backgroundColor:"color-white",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:`2px solid ${g?L:H}`,transition:k?"none":"transform 0.1s ease-in-out",transform:S?"translate(-50%, -50%) scale(1.1)":"translate(-50%, -50%)",zIndex:2,onMouseDown:I,onTouchStart:I,onKeyDown:R,...gr[l],...T.thumb,children:m&&(S||k)&&r.jsx(c.View,{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:8,padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:4,fontSize:12,whiteSpace:"nowrap",zIndex:3,...T.tooltip,children:r.jsx(c.Text,{...(O=T.tooltip)==null?void 0:O.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),x&&r.jsx(mt,{children:x})]}),Y=r.jsxs(c.Center,{...Tg[s],position:"relative",onMouseEnter:()=>!g&&w(!0),onMouseLeave:()=>!g&&w(!1),...P,...T==null?void 0:T.container,children:[f&&r.jsxs(c.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[r.jsx(c.Text,{fontSize:14,fontWeight:500,...T.label,children:f}),p&&r.jsx(c.Text,{fontSize:14,color:"color-blueGray-500",...T.valueLabel,children:n})]}),r.jsxs(c.View,{ref:j,position:"relative",borderRadius:D/2,backgroundColor:g?L:A,cursor:g?"not-allowed":"pointer",width:F?`${D}px`:"100%",height:F?"100%":`${D}px`,onMouseDown:M,onTouchStart:M,...T==null?void 0:T.track,children:[i&&i.length>0&&r.jsx(r.Fragment,{children:i.map(Z=>{const J=(Z-e)/(o-e)*100;return r.jsx(c.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:g?L:H,zIndex:1,...F?{bottom:`${J}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${J}%`,top:"50%",transform:"translate(-50%, -50%)"},...T.stepMarks},Z)})}),r.jsx(c.View,{position:"absolute",borderRadius:D/2,backgroundColor:g?L:H,...F?{bottom:0,left:0,width:"100%",height:`${V}%`}:{top:0,left:0,height:"100%",width:`${V}%`},...T==null?void 0:T.filledTrack,...T==null?void 0:T.progress}),r.jsx(c.View,{ref:C,role:"slider",tabIndex:g?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":g,"aria-label":_,position:"absolute",width:`${q}px`,height:`${q}px`,borderRadius:"50%",backgroundColor:g?L:H,border:"2px solid color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:g?"not-allowed":"grab",transform:F?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:k?"none":"left 0.1s, bottom 0.1s",...F?{left:"50%",bottom:`${V}%`}:{top:"50%",left:`${V}%`},onMouseDown:I,onTouchStart:I,onKeyDown:R,...T==null?void 0:T.thumb,children:m&&(S||k)&&r.jsx(c.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...F?{left:"100%",marginLeft:"8px",bottom:"0",transform:"translateY(50%)"}:{bottom:"100%",left:"50%",marginBottom:"8px",transform:"translateX(-50%)"},...T==null?void 0:T.tooltip,children:r.jsx(c.Text,{...(X=T==null?void 0:T.tooltip)==null?void 0:X.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),x&&r.jsx(mt,{marginTop:8,children:x})]});return F||m?Y:K}),Mg=e=>{const o=ue(e),t=Bn({...e,value:o.value!==void 0?Number(o.value):void 0,onChange:n=>{var i;o.onChange(n),(i=e.onChange)==null||i.call(e,n)}});return r.jsx(Ln,{...e,...t,...o})},zg=Mg,Rg=e=>{const o=ue(e),{isFocused:t,setIsFocused:n,isHovered:i,setIsHovered:a,inputRef:l,containerRef:d,mirrorSelectionStart:s,mirrorSelectionEnd:g,setMirrorSelectionStart:p,setMirrorSelectionEnd:m,setInputRef:h,handleFocus:f,handleBlur:x,handleKeyDown:y,handlePaste:b}=Rn(e),k=u.useCallback(w=>{o.onChange&&o.onChange(w),e.onComplete&&w.length===(e.length||6)&&e.onComplete(w),l.current&&(l.current.value=w)},[o,e,l]),S=u.useCallback(w=>{const j=w.currentTarget.value.slice(0,e.length||6);k(j),l.current&&(l.current.value=j)},[e.length,k,l]);return r.jsx(Vn,{...e,...o,setValue:k,isFocused:t,setIsFocused:n,isHovered:i,setIsHovered:a,inputRef:l,containerRef:d,mirrorSelectionStart:s,mirrorSelectionEnd:g,setMirrorSelectionStart:p,setMirrorSelectionEnd:m,setInputRef:h,handleChange:S,handleFocus:f,handleBlur:x,handleKeyDown:y,handlePaste:b,stepValues:e.stepValues})},Vg=Rg,Eg=e=>Array.isArray(e)?e:e==null?[]:[e],An=({name:e,uploadFile:o,onUploadSuccess:t,onUploadError:n,transformResponse:i,onMultipleFileSelect:a,onFileSelect:l,multiple:d=!0,...s})=>{const{setFieldValue:g,setFieldTouched:p,values:m}=be.useFormikContext(),[h,f]=u.useState(!1),[x,y]=u.useState(0),b=u.useCallback(async w=>{if(!w||w.length===0)return;p(e,!0,!0),f(!0);const j=[];for(const C of w){y(0);try{const I=await o(C,R=>{y(R??0)}),M=i?i(I,C):I;j.push(M),t==null||t(C,M)}catch(I){n==null||n(C,I)}}if(j.length>0){const C=Eg(be.getIn(m,e));g(e,[...C,...j],!0),y(100)}else y(0);f(!1)},[e,n,t,p,g,i,o,m]),k=u.useCallback(async w=>{a==null||a(w),await b(w)},[b,a]),S=u.useCallback(async w=>{l==null||l(w),await b([w])},[b,l]);return r.jsx(Yo,{...s,multiple:d,onMultipleFileSelect:d?k:void 0,onFileSelect:d?void 0:S,isLoading:h,progress:x})};An.displayName="FormikUploader";const Pg=e=>{let o=ue(e);o.selected=o.value;const t=sn(e);return r.jsx(dn,{...t,...o})},Wg=Pg,Dn=e=>{const[o,t]=u.useState(!1),[n,i]=u.useState(e);return{isHovered:o,setIsHovered:t,isToggle:n,setIsToggled:i}},_g={square:0,rounded:4,pill:24},$g=(e,o)=>({outline:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:e,_hover:{backgroundColor:e,color:o?"color-black":"color-white",transform:"translateY(-1px)"},_active:{backgroundColor:e,color:o?"color-black":"color-white",transform:"translateY(0)"},transition:"all 0.2s ease"},ghost:{backgroundColor:"transparent",color:e,borderWidth:0,borderStyle:"none",borderColor:"transparent",_hover:{backgroundColor:e,color:o?"color-black":"color-white",transform:"translateY(-1px)"},_active:{backgroundColor:e,color:o?"color-black":"color-white",transform:"translateY(0)"},transition:"all 0.2s ease"},link:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"1px",textDecorationThickness:"1px",_hover:{borderColor:e,textDecorationThickness:"2px",transform:"translateY(-1px)"},_active:{borderColor:e,textDecorationThickness:"2px",transform:"translateY(0)"},transition:"all 0.2s ease"}}),Fn=u.memo(({children:e,shape:o="rounded",variant:t="ghost",isHovered:n,setIsHovered:i,isDisabled:a,isToggle:l,setIsToggled:d,onToggle:s,views:g,backgroundColor:p,color:m,themeMode:h,...f})=>{const{getColor:x,themeMode:y}=c.useTheme(),b=h??y,S=x(a?"theme-disabled":p??m??"theme-primary",{themeMode:b}),j=u.useMemo(()=>$g(S,b==="light"),[S,b])[t],C=!!(l||n),I=u.useCallback(()=>i(!n),[n,i]),M=u.useCallback(()=>{a||d(R=>{const V=!R;return s&&s(V),V})},[a,d,s]);return r.jsx(c.Center,{role:"Toggle",padding:o==="pill"?"10px 12px":"8px",width:"fit-content",cursor:a?"not-allowed":"pointer",borderRadius:_g[o],onClick:M,onMouseEnter:I,onMouseLeave:()=>i(!1),...j,...C&&{backgroundColor:S,color:b==="light"?"color-black":"color-white"},...f,...g==null?void 0:g.container,children:e})}),Hg=({children:e,shape:o,variant:t,isDisabled:n,isToggled:i=!1,onToggle:a,...l})=>{const d=ue(l),{isHovered:s,setIsHovered:g,isToggle:p,setIsToggled:m}=Dn(d.value??i);u.useEffect(()=>{m(d.value??i)},[d.value,i]);const h=f=>{m(f),d.onChange(f),a==null||a(f)};return r.jsx(Fn,{shape:o,variant:t,isDisabled:n,isHovered:s,setIsHovered:g,isToggle:p,setIsToggled:m,onToggle:h,...l,children:e})},Bg=Hg,On=()=>{const[e,o]=u.useState([]);return{activeToggles:e,setActiveToggles:o}},Lg=({children:e,shape:o,variant:t,isDisabled:n,isToggled:i=!1,onToggle:a,...l})=>{const{isHovered:d,setIsHovered:s,isToggle:g,setIsToggled:p}=Dn(i);return u.useEffect(()=>{p(i)},[i]),r.jsx(Fn,{shape:o,variant:t,isDisabled:n,isHovered:d,setIsHovered:s,isToggle:g,setIsToggled:p,onToggle:a,...l,children:e})},qn=Lg,Nn=({items:e,onToggleChange:o,activeToggles:t,setActiveToggles:n,shape:i="rounded",variant:a="ghost",views:l})=>{const d=u.useCallback((s,g)=>{n(p=>{let m;return g?m=p.includes(s)?p:[...p,s]:m=p.filter(h=>h!==s),o==null||o(m),m})},[o,n]);return r.jsx(c.Horizontal,{role:"ToggleGroup",display:"flex",gap:5,...l==null?void 0:l.container,children:e.map(s=>r.jsx(qn,{role:`toggle-${s.id}`,shape:i,variant:a,isToggled:t.includes(s.id)||s.isActive,onToggle:g=>d(s.id,g),isDisabled:s.isDisabled,views:l==null?void 0:l.toggle,children:s.value},s.id))})},Ag=({items:e,shape:o,variant:t,onToggleChange:n,...i})=>{const a=ue(i),{activeToggles:l,setActiveToggles:d}=On();u.useEffect(()=>{Array.isArray(a.value)&&d(a.value)},[a.value]);const s=g=>{d(g),a.onChange(g),n==null||n(g)};return r.jsx(Nn,{items:e,shape:o,variant:t,activeToggles:l,setActiveToggles:d,onToggleChange:s,...i})},Dg=Ag,hr=["zoom-out","zoom-in","zap","zap-off","youtube","x","wrench","worm","workflow","wine","wine-off","wind","wind-arrow-down","wifi","wifi-zero","wifi-sync","wifi-pen","wifi-off","wifi-low","wifi-high","wifi-cog","whole-word","wheat","wheat-off","weight","weight-tilde","webhook","webhook-off","webcam","waypoints","waves","waves-ladder","waves-arrow-up","waves-arrow-down","watch","washing-machine","warehouse","wand","wand-sparkles","wallpaper","wallet","wallet-minimal","wallet-cards","vote","volume","volume-x","volume-off","volume-2","volume-1","volleyball","voicemail","view","videotape","video","video-off","vibrate","vibrate-off","venus","venus-and-mars","venetian-mask","vegan","vector-square","vault","variable","van","utility-pole","utensils","utensils-crossed","users","users-round","user","user-x","user-star","user-search","user-round","user-round-x","user-round-search","user-round-plus","user-round-pen","user-round-minus","user-round-cog","user-round-check","user-plus","user-pen","user-minus","user-lock","user-cog","user-check","usb","upload","unplug","unlink","unlink-2","university","ungroup","unfold-vertical","unfold-horizontal","undo","undo-dot","undo-2","underline","umbrella","umbrella-off","type","type-outline","twitter","twitch","tv","tv-minimal","tv-minimal-play","turtle","turntable","turkish-lira","truck","truck-electric","trophy","triangle","triangle-right","triangle-dashed","triangle-alert","trending-up","trending-up-down","trending-down","trello","trees","tree-pine","tree-palm","tree-deciduous","trash","trash-2","transgender","tram-front","train-track","train-front","train-front-tunnel","traffic-cone","tractor","toy-brick","tower-control","touchpad","touchpad-off","torus","tornado","toolbox","tool-case","toilet","toggle-right","toggle-left","timer","timer-reset","timer-off","tickets","tickets-plane","ticket","ticket-x","ticket-slash","ticket-plus","ticket-percent","ticket-minus","ticket-check","thumbs-up","thumbs-down","thermometer","thermometer-sun","thermometer-snowflake","theater","text-wrap","text-select","text-search","text-quote","text-initial","text-cursor","text-cursor-input","text-align-start","text-align-justify","text-align-end","text-align-center","test-tubes","test-tube","test-tube-diagonal","terminal","tent","tent-tree","telescope","target","tangent","tally-5","tally-4","tally-3","tally-2","tally-1","tags","tag","tablets","tablet","tablet-smartphone","table","table-rows-split","table-properties","table-of-contents","table-columns-split","table-cells-split","table-cells-merge","table-2","syringe","swords","sword","switch-camera","swiss-franc","swatch-book","superscript","sunset","sunrise","sun","sun-snow","sun-moon","sun-medium","sun-dim","subscript","strikethrough","stretch-vertical","stretch-horizontal","store","stone","sticky-note","sticker","stethoscope","step-forward","step-back","star","star-off","star-half","stamp","squirrel","squircle","squircle-dashed","squares-unite","squares-subtract","squares-intersect","squares-exclude","square","square-x","square-user","square-user-round","square-terminal","square-stop","square-star","square-stack","square-square","square-split-vertical","square-split-horizontal","square-slash","square-sigma","square-scissors","square-round-corner","square-radical","square-power","square-plus","square-play","square-pilcrow","square-pi","square-percent","square-pen","square-pause","square-parking","square-parking-off","square-mouse-pointer","square-minus","square-menu","square-m","square-library","square-kanban","square-function","square-equal","square-dot","square-divide","square-dashed","square-dashed-top-solid","square-dashed-mouse-pointer","square-dashed-kanban","square-dashed-bottom","square-dashed-bottom-code","square-code","square-chevron-up","square-chevron-right","square-chevron-left","square-chevron-down","square-check","square-check-big","square-chart-gantt","square-bottom-dashed-scissors","square-asterisk","square-arrow-up","square-arrow-up-right","square-arrow-up-left","square-arrow-right","square-arrow-out-up-right","square-arrow-out-up-left","square-arrow-out-down-right","square-arrow-out-down-left","square-arrow-left","square-arrow-down","square-arrow-down-right","square-arrow-down-left","square-activity","sprout","spray-can","spotlight","spool","split","spline","spline-pointer","spell-check","spell-check-2","speech","speaker","sparkles","sparkle","spade","space","soup","solar-panel","sofa","soap-dispenser-droplet","snowflake","snail","smile","smile-plus","smartphone","smartphone-nfc","smartphone-charging","sliders-vertical","sliders-horizontal","slice","slash","slack","skull","skip-forward","skip-back","siren","signpost","signpost-big","signature","signal","signal-zero","signal-medium","signal-low","signal-high","sigma","shuffle","shrub","shrink","shrimp","shredder","shower-head","shovel","shopping-cart","shopping-basket","shopping-bag","shirt","ship","ship-wheel","shield","shield-x","shield-user","shield-question-mark","shield-plus","shield-off","shield-minus","shield-half","shield-ellipsis","shield-check","shield-ban","shield-alert","shell","sheet","share","share-2","shapes","settings","settings-2","server","server-off","server-crash","server-cog","separator-vertical","separator-horizontal","send","send-to-back","send-horizontal","section","search","search-x","search-slash","search-code","search-check","search-alert","scroll","scroll-text","screen-share","screen-share-off","scooter","scissors","scissors-line-dashed","school","scan","scan-text","scan-search","scan-qr-code","scan-line","scan-heart","scan-face","scan-eye","scan-barcode","scaling","scale","scale-3d","save","save-off","save-all","saudi-riyal","satellite","satellite-dish","sandwich","salad","sailboat","russian-ruble","ruler","ruler-dimension-line","rss","rows-4","rows-3","rows-2","router","route","route-off","rotate-cw","rotate-cw-square","rotate-ccw","rotate-ccw-square","rotate-ccw-key","rotate-3d","rose","roller-coaster","rocking-chair","rocket","ribbon","rewind","reply","reply-all","replace","replace-all","repeat","repeat-2","repeat-1","remove-formatting","regex","refrigerator","refresh-cw","refresh-cw-off","refresh-ccw","refresh-ccw-dot","redo","redo-dot","redo-2","recycle","rectangle-vertical","rectangle-horizontal","rectangle-goggles","rectangle-ellipsis","rectangle-circle","receipt","receipt-turkish-lira","receipt-text","receipt-swiss-franc","receipt-russian-ruble","receipt-pound-sterling","receipt-japanese-yen","receipt-indian-rupee","receipt-euro","receipt-cent","ratio","rat","rainbow","rail-symbol","radius","radio","radio-tower","radio-receiver","radical","radiation","radar","rabbit","quote","qr-code","pyramid","puzzle","proportions","projector","printer","printer-check","presentation","power","power-off","pound-sterling","popsicle","popcorn","pointer","pointer-off","podcast","pocket","pocket-knife","plus","plug","plug-zap","plug-2","play","plane","plane-takeoff","plane-landing","pizza","pipette","pin","pin-off","pill","pill-bottle","pilcrow","pilcrow-right","pilcrow-left","piggy-bank","picture-in-picture","picture-in-picture-2","pickaxe","piano","pi","phone","phone-outgoing","phone-off","phone-missed","phone-incoming","phone-forwarded","phone-call","philippine-peso","person-standing","percent","pentagon","pencil","pencil-ruler","pencil-off","pencil-line","pen","pen-tool","pen-off","pen-line","pc-case","paw-print","pause","party-popper","parking-meter","parentheses","paperclip","panels-top-left","panels-right-bottom","panels-left-bottom","panel-top","panel-top-open","panel-top-dashed","panel-top-close","panel-top-bottom-dashed","panel-right","panel-right-open","panel-right-dashed","panel-right-close","panel-left","panel-left-right-dashed","panel-left-open","panel-left-dashed","panel-left-close","panel-bottom","panel-bottom-open","panel-bottom-dashed","panel-bottom-close","panda","palette","paintbrush","paintbrush-vertical","paint-roller","paint-bucket","package","package-x","package-search","package-plus","package-open","package-minus","package-check","package-2","origami","orbit","option","omega","octagon","octagon-x","octagon-pause","octagon-minus","octagon-alert","nut","nut-off","notepad-text","notepad-text-dashed","notebook","notebook-text","notebook-tabs","notebook-pen","non-binary","nfc","newspaper","network","navigation","navigation-off","navigation-2","navigation-2-off","music","music-4","music-3","music-2","move","move-vertical","move-up","move-up-right","move-up-left","move-right","move-left","move-horizontal","move-down","move-down-right","move-down-left","move-diagonal","move-diagonal-2","move-3d","mouse","mouse-pointer","mouse-pointer-click","mouse-pointer-ban","mouse-pointer-2","mouse-pointer-2-off","mouse-off","mountain","mountain-snow","motorbike","moon","moon-star","monitor","monitor-x","monitor-up","monitor-stop","monitor-speaker","monitor-smartphone","monitor-play","monitor-pause","monitor-off","monitor-down","monitor-dot","monitor-cog","monitor-cloud","monitor-check","minus","minimize","minimize-2","milk","milk-off","milestone","microwave","microscope","microchip","mic","mic-vocal","mic-off","messages-square","message-square","message-square-x","message-square-warning","message-square-text","message-square-share","message-square-reply","message-square-quote","message-square-plus","message-square-off","message-square-more","message-square-lock","message-square-heart","message-square-dot","message-square-diff","message-square-dashed","message-square-code","message-circle","message-circle-x","message-circle-warning","message-circle-reply","message-circle-question-mark","message-circle-plus","message-circle-off","message-circle-more","message-circle-heart","message-circle-dashed","message-circle-code","merge","menu","memory-stick","meh","megaphone","megaphone-off","medal","maximize","maximize-2","martini","mars","mars-stroke","map","map-plus","map-pinned","map-pin","map-pin-x","map-pin-x-inside","map-pin-plus","map-pin-plus-inside","map-pin-pen","map-pin-off","map-pin-minus","map-pin-minus-inside","map-pin-house","map-pin-check","map-pin-check-inside","map-minus","mails","mailbox","mail","mail-x","mail-warning","mail-search","mail-question-mark","mail-plus","mail-open","mail-minus","mail-check","magnet","luggage","lollipop","logs","log-out","log-in","lock","lock-open","lock-keyhole","lock-keyhole-open","locate","locate-off","locate-fixed","loader","loader-pinwheel","loader-circle","list","list-x","list-video","list-tree","list-todo","list-start","list-restart","list-plus","list-ordered","list-music","list-minus","list-indent-increase","list-indent-decrease","list-filter","list-filter-plus","list-end","list-collapse","list-chevrons-up-down","list-chevrons-down-up","list-checks","list-check","linkedin","link","link-2","link-2-off","line-squiggle","lightbulb","lightbulb-off","ligature","life-buoy","library","library-big","lectern","leafy-green","leaf","layout-template","layout-panel-top","layout-panel-left","layout-list","layout-grid","layout-dashboard","layers","layers-plus","layers-2","laugh","lasso","lasso-select","laptop","laptop-minimal","laptop-minimal-check","languages","landmark","land-plot","lamp","lamp-wall-up","lamp-wall-down","lamp-floor","lamp-desk","lamp-ceiling","keyboard","keyboard-off","keyboard-music","key","key-square","key-round","kayak","kanban","joystick","japanese-yen","iteration-cw","iteration-ccw","italic","instagram","inspection-panel","info","infinity","indian-rupee","inbox","import","images","image","image-upscale","image-up","image-plus","image-play","image-off","image-minus","image-down","id-card","id-card-lanyard","ice-cream-cone","ice-cream-bowl","house","house-wifi","house-plus","house-plug","house-heart","hourglass","hotel","hospital","hop","hop-off","history","highlighter","hexagon","helicopter","heater","heart","heart-pulse","heart-plus","heart-off","heart-minus","heart-handshake","heart-crack","headset","headphones","headphone-off","heading","heading-6","heading-5","heading-4","heading-3","heading-2","heading-1","hdmi-port","hd","haze","hat-glasses","hash","hard-hat","hard-drive","hard-drive-upload","hard-drive-download","handshake","handbag","hand","hand-platter","hand-metal","hand-helping","hand-heart","hand-grab","hand-fist","hand-coins","hammer","hamburger","ham","guitar","group","grip","grip-vertical","grip-horizontal","grid-3x3","grid-3x2","grid-2x2","grid-2x2-x","grid-2x2-plus","grid-2x2-check","grape","graduation-cap","gpu","goal","globe","globe-lock","glasses","glass-water","gitlab","github","git-pull-request","git-pull-request-draft","git-pull-request-create","git-pull-request-create-arrow","git-pull-request-closed","git-pull-request-arrow","git-merge","git-graph","git-fork","git-compare","git-compare-arrows","git-commit-vertical","git-commit-horizontal","git-branch","git-branch-plus","git-branch-minus","gift","ghost","georgian-lari","gem","gavel","gauge","gamepad","gamepad-directional","gamepad-2","gallery-vertical","gallery-vertical-end","gallery-thumbnails","gallery-horizontal","gallery-horizontal-end","funnel","funnel-x","funnel-plus","fullscreen","fuel","frown","framer","frame","forward","form","forklift","footprints","folders","folder","folder-x","folder-up","folder-tree","folder-sync","folder-symlink","folder-search","folder-search-2","folder-root","folder-plus","folder-pen","folder-output","folder-open","folder-open-dot","folder-minus","folder-lock","folder-key","folder-kanban","folder-input","folder-heart","folder-git","folder-git-2","folder-down","folder-dot","folder-cog","folder-code","folder-closed","folder-clock","folder-check","folder-archive","fold-vertical","fold-horizontal","focus","flower","flower-2","flip-vertical","flip-vertical-2","flip-horizontal","flip-horizontal-2","flask-round","flask-conical","flask-conical-off","flashlight","flashlight-off","flame","flame-kindling","flag","flag-triangle-right","flag-triangle-left","flag-off","fishing-hook","fish","fish-symbol","fish-off","fire-extinguisher","fingerprint-pattern","film","files","file","file-x","file-x-corner","file-volume","file-video-camera","file-user","file-up","file-type","file-type-corner","file-text","file-terminal","file-symlink","file-stack","file-spreadsheet","file-sliders","file-signal","file-search","file-search-corner","file-scan","file-question-mark","file-plus","file-plus-corner","file-play","file-pen","file-pen-line","file-output","file-music","file-minus","file-minus-corner","file-lock","file-key","file-input","file-image","file-heart","file-headphone","file-exclamation-point","file-down","file-digit","file-diff","file-cog","file-code","file-code-corner","file-clock","file-check","file-check-corner","file-chart-pie","file-chart-line","file-chart-column","file-chart-column-increasing","file-braces","file-braces-corner","file-box","file-badge","file-axis-3d","file-archive","figma","ferris-wheel","fence","feather","fast-forward","fan","factory","facebook","eye","eye-off","eye-closed","external-link","expand","ev-charger","euro","ethernet-port","eraser","equal","equal-not","equal-approximately","ellipsis","ellipsis-vertical","egg","egg-off","egg-fried","eclipse","earth","earth-lock","ear","ear-off","dumbbell","drumstick","drum","droplets","droplet","droplet-off","drone","drill","dribbble","drama","drafting-compass","download","dot","door-open","door-closed","door-closed-locked","donut","dollar-sign","dog","dock","dna","dna-off","divide","disc","disc-album","disc-3","disc-2","diff","dices","dice-6","dice-5","dice-4","dice-3","dice-2","dice-1","diamond","diamond-plus","diamond-percent","diamond-minus","diameter","dessert","delete","decimals-arrow-right","decimals-arrow-left","database","database-zap","database-backup","dam","cylinder","currency","cup-soda","cuboid","crown","crosshair","cross","crop","croissant","credit-card","creative-commons","cpu","corner-up-right","corner-up-left","corner-right-up","corner-right-down","corner-left-up","corner-left-down","corner-down-right","corner-down-left","copyright","copyleft","copy","copy-x","copy-slash","copy-plus","copy-minus","copy-check","cooking-pot","cookie","contrast","container","contact","contact-round","construction","cone","concierge-bell","computer","component","compass","command","combine","columns-4","columns-3","columns-3-cog","columns-2","coins","cog","coffee","codesandbox","codepen","code","code-xml","club","clover","cloudy","cloud","cloud-upload","cloud-sync","cloud-sun","cloud-sun-rain","cloud-snow","cloud-rain","cloud-rain-wind","cloud-off","cloud-moon","cloud-moon-rain","cloud-lightning","cloud-hail","cloud-fog","cloud-drizzle","cloud-download","cloud-cog","cloud-check","cloud-backup","cloud-alert","closed-caption","clock","clock-plus","clock-fading","clock-check","clock-arrow-up","clock-arrow-down","clock-alert","clock-9","clock-8","clock-7","clock-6","clock-5","clock-4","clock-3","clock-2","clock-12","clock-11","clock-10","clock-1","clipboard","clipboard-x","clipboard-type","clipboard-plus","clipboard-pen","clipboard-pen-line","clipboard-paste","clipboard-minus","clipboard-list","clipboard-copy","clipboard-clock","clipboard-check","clapperboard","citrus","circuit-board","circle","circle-x","circle-user","circle-user-round","circle-stop","circle-star","circle-small","circle-slash","circle-slash-2","circle-question-mark","circle-power","circle-pound-sterling","circle-plus","circle-play","circle-pile","circle-percent","circle-pause","circle-parking","circle-parking-off","circle-off","circle-minus","circle-gauge","circle-fading-plus","circle-fading-arrow-up","circle-equal","circle-ellipsis","circle-dot","circle-dot-dashed","circle-dollar-sign","circle-divide","circle-dashed","circle-chevron-up","circle-chevron-right","circle-chevron-left","circle-chevron-down","circle-check","circle-check-big","circle-arrow-up","circle-arrow-right","circle-arrow-out-up-right","circle-arrow-out-up-left","circle-arrow-out-down-right","circle-arrow-out-down-left","circle-arrow-left","circle-arrow-down","circle-alert","cigarette","cigarette-off","church","chromium","chevrons-up","chevrons-up-down","chevrons-right","chevrons-right-left","chevrons-left","chevrons-left-right","chevrons-left-right-ellipsis","chevrons-down","chevrons-down-up","chevron-up","chevron-right","chevron-left","chevron-last","chevron-first","chevron-down","chess-rook","chess-queen","chess-pawn","chess-knight","chess-king","chess-bishop","cherry","chef-hat","check","check-line","check-check","chart-spline","chart-scatter","chart-pie","chart-no-axes-gantt","chart-no-axes-combined","chart-no-axes-column","chart-no-axes-column-increasing","chart-no-axes-column-decreasing","chart-network","chart-line","chart-gantt","chart-column","chart-column-stacked","chart-column-increasing","chart-column-decreasing","chart-column-big","chart-candlestick","chart-bar","chart-bar-stacked","chart-bar-increasing","chart-bar-decreasing","chart-bar-big","chart-area","cctv","cat","castle","cast","cassette-tape","case-upper","case-sensitive","case-lower","carrot","card-sim","caravan","car","car-taxi-front","car-front","captions","captions-off","cannabis","cannabis-off","candy","candy-off","candy-cane","camera","camera-off","calendars","calendar","calendar-x","calendar-x-2","calendar-sync","calendar-search","calendar-range","calendar-plus","calendar-plus-2","calendar-off","calendar-minus","calendar-minus-2","calendar-heart","calendar-fold","calendar-days","calendar-cog","calendar-clock","calendar-check","calendar-check-2","calendar-arrow-up","calendar-arrow-down","calendar-1","calculator","cake","cake-slice","cable","cable-car","bus","bus-front","building","building-2","bug","bug-play","bug-off","bubbles","brush","brush-cleaning","bring-to-front","briefcase","briefcase-medical","briefcase-conveyor-belt","briefcase-business","brick-wall","brick-wall-shield","brick-wall-fire","brain","brain-cog","brain-circuit","brackets","braces","boxes","box","bow-arrow","bottle-wine","bot","bot-off","bot-message-square","boom-box","bookmark","bookmark-x","bookmark-plus","bookmark-minus","bookmark-check","book","book-x","book-user","book-up","book-up-2","book-type","book-text","book-search","book-plus","book-open","book-open-text","book-open-check","book-minus","book-marked","book-lock","book-key","book-image","book-heart","book-headphones","book-down","book-dashed","book-copy","book-check","book-audio","book-alert","book-a","bone","bomb","bolt","bold","bluetooth","bluetooth-searching","bluetooth-off","bluetooth-connected","blocks","blinds","blend","bitcoin","birdhouse","bird","biohazard","binoculars","binary","bike","biceps-flexed","between-vertical-start","between-vertical-end","between-horizontal-start","between-horizontal-end","bell","bell-ring","bell-plus","bell-off","bell-minus","bell-electric","bell-dot","beer","beer-off","beef","bed","bed-single","bed-double","bean","bean-off","beaker","battery","battery-warning","battery-plus","battery-medium","battery-low","battery-full","battery-charging","bath","baseline","barrel","barcode","banknote","banknote-x","banknote-arrow-up","banknote-arrow-down","bandage","banana","ban","balloon","baggage-claim","badge","badge-x","badge-turkish-lira","badge-swiss-franc","badge-russian-ruble","badge-question-mark","badge-pound-sterling","badge-plus","badge-percent","badge-minus","badge-japanese-yen","badge-info","badge-indian-rupee","badge-euro","badge-dollar-sign","badge-check","badge-cent","badge-alert","backpack","baby","axis-3d","axe","award","audio-waveform","audio-lines","atom","at-sign","asterisk","arrows-up-from-line","arrow-up","arrow-up-z-a","arrow-up-wide-narrow","arrow-up-to-line","arrow-up-right","arrow-up-narrow-wide","arrow-up-left","arrow-up-from-line","arrow-up-from-dot","arrow-up-down","arrow-up-a-z","arrow-up-1-0","arrow-up-0-1","arrow-right","arrow-right-to-line","arrow-right-left","arrow-right-from-line","arrow-left","arrow-left-to-line","arrow-left-right","arrow-left-from-line","arrow-down","arrow-down-z-a","arrow-down-wide-narrow","arrow-down-up","arrow-down-to-line","arrow-down-to-dot","arrow-down-right","arrow-down-narrow-wide","arrow-down-left","arrow-down-from-line","arrow-down-a-z","arrow-down-1-0","arrow-down-0-1","arrow-big-up","arrow-big-up-dash","arrow-big-right","arrow-big-right-dash","arrow-big-left","arrow-big-left-dash","arrow-big-down","arrow-big-down-dash","armchair","archive","archive-x","archive-restore","apple","app-window","app-window-mac","aperture","anvil","antenna","annoyed","angry","anchor","amphora","ampersands","ampersand","ambulance","align-vertical-space-between","align-vertical-space-around","align-vertical-justify-start","align-vertical-justify-end","align-vertical-justify-center","align-vertical-distribute-start","align-vertical-distribute-end","align-vertical-distribute-center","align-start-vertical","align-start-horizontal","align-horizontal-space-between","align-horizontal-space-around","align-horizontal-justify-start","align-horizontal-justify-end","align-horizontal-justify-center","align-horizontal-distribute-start","align-horizontal-distribute-end","align-horizontal-distribute-center","align-end-vertical","align-end-horizontal","align-center-vertical","align-center-horizontal","album","alarm-smoke","alarm-clock","alarm-clock-plus","alarm-clock-off","alarm-clock-minus","alarm-clock-check","airplay","air-vent","activity","accessibility","a-large-small","a-arrow-up","a-arrow-down"],Un=e=>{const{value:o,defaultValue:t,onChange:n,isOpen:i,onOpen:a,onClose:l,closeOnSelect:d=!0}=e,[s,g]=u.useState(i??!1),[p,m]=u.useState(o??t),[h,f]=u.useState(""),x=u.useRef(null),y=u.useRef(null);u.useEffect(()=>{o!==void 0&&m(o)},[o]),u.useEffect(()=>{i!==void 0&&g(i)},[i]);const b=u.useMemo(()=>h?hr.filter(C=>C.toLowerCase().includes(h.toLowerCase())).slice(0,100):hr.slice(0,100),[h]);u.useEffect(()=>{const C=I=>{s&&x.current&&y.current&&!x.current.contains(I.target)&&!y.current.contains(I.target)&&k()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[s]);const k=u.useCallback(()=>{i===void 0&&g(!1),l&&l()},[l,i]),S=u.useCallback(()=>{const C=!s;i===void 0&&g(C),C?(a&&a(),f("")):l&&l()},[s,a,l,i]),w=u.useCallback(C=>{o===void 0&&m(C),n&&n(C),d&&k()},[n,d,k,o]),j=u.useCallback(C=>{f(C)},[]);return{isOpen:s,selectedIcon:p,searchQuery:h,filteredIcons:b,handleToggle:S,handleIconSelect:w,handleSearchChange:j,handleClose:k,triggerRef:x,dropdownRef:y}},Oe={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px",maxHeight:"320px",overflow:"hidden",display:"flex",flexDirection:"column"},searchInput:{marginBottom:"12px",flexShrink:0},iconGrid:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:"8px",overflowY:"auto",padding:"4px",color:"color-black",flexGrow:1},iconItem:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:"4px",transition:"all 0.2s ease"}},Fg={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},Og={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},qg={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Gn=({label:e,placeholder:o="Select an icon",helperText:t,views:n={},size:i="md",shape:a="default",variant:l="default",error:d=!1,isDisabled:s=!1,isReadOnly:g=!1,showSearch:p=!0,isOpen:m,selectedIcon:h,searchQuery:f,filteredIcons:x,handleToggle:y,handleIconSelect:b,handleSearchChange:k,triggerRef:S,dropdownRef:w,handleClose:j,onChange:C,...I})=>{const{getColor:M}=c.useTheme(),R={...Oe.container,...n==null?void 0:n.container},V={...Oe.trigger,...Fg[i],...Og[a],...qg[l],...d&&{borderColor:"color-red-500"},...s&&{opacity:.6,cursor:"not-allowed"},...n==null?void 0:n.trigger},_={...Oe.dropdown,...n==null?void 0:n.dropdown},T={...Oe.iconGrid,...n==null?void 0:n.iconGrid};return r.jsxs(c.View,{...R,...I,children:[e&&r.jsx(c.Text,{fontSize:i==="xs"?"12px":i==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...n==null?void 0:n.label,children:e}),r.jsxs(c.View,{ref:S,onClick:s||g?void 0:y,...V,children:[r.jsx(c.Horizontal,{alignItems:"center",gap:8,width:"100%",children:h?r.jsxs(c.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[r.jsx(Eo,{name:h,widthHeight:16}),r.jsx(c.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h})]}):r.jsx(c.Text,{color:"color-gray-500",fontSize:"inherit",children:o})}),!g&&!s&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:m?"up":"down"})]}),m&&r.jsxs(c.View,{ref:w,..._,children:[p&&r.jsx(c.View,{...Oe.searchInput,...n==null?void 0:n.searchInput,children:r.jsx(xo,{placeholder:"Search icons...",value:f,onChange:W=>k(W),size:"sm",autoFocus:!0})}),r.jsx(c.View,{...T,children:x.length>0?x.map(W=>r.jsx(c.View,{...Oe.iconItem,onClick:()=>b(W),title:W,_hover:{backgroundColor:"color-gray-100"},backgroundColor:h===W?"color-blue-100":"transparent",...n==null?void 0:n.iconItem,children:r.jsx(Eo,{name:W,widthHeight:20})},W)):r.jsx(c.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(c.Text,{fontSize:"14px",children:"No icons found"})})})]}),t&&r.jsx(c.Text,{color:d?"color-red-500":"color-gray-600",marginTop:"4px",...n==null?void 0:n.helperText,children:t})]})},Ng=e=>{const o=ue(e),t={...e,value:o.value??e.value??e.defaultValue},n=Un(t),i=a=>{n.handleIconSelect(a),o.onChange(a)};return r.jsx(Gn,{...n,...t,handleIconSelect:i})},Ug=Ng,Me={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"320px",maxHeight:"400px",overflow:"hidden"},searchInput:{marginBottom:"12px"},categoryTabs:{display:"flex",borderBottom:"1px solid color-gray-200",marginBottom:"12px",overflowX:"auto"},categoryTab:{padding:"8px 12px",cursor:"pointer",borderBottom:"2px solid transparent",transition:"all 0.2s ease",fontSize:"14px",fontWeight:"500",color:"color-gray-600",whiteSpace:"nowrap"},emojiGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"4px",maxHeight:"240px",overflowY:"auto",padding:"4px",color:"color-black"},emoji:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:"4px",fontSize:"20px",transition:"all 0.2s ease"}},Gg={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},Yg={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},vg={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Xg={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},Kg=[{emoji:"😀",name:"grinning face",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😃",name:"grinning face with big eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😄",name:"grinning face with smiling eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😁",name:"beaming face with smiling eyes",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😆",name:"grinning squinting face",category:"smileys",keywords:["happy","laugh","smile"]},{emoji:"😅",name:"grinning face with sweat",category:"smileys",keywords:["happy","sweat","relief"]},{emoji:"🤣",name:"rolling on the floor laughing",category:"smileys",keywords:["laugh","funny","rofl"]},{emoji:"😂",name:"face with tears of joy",category:"smileys",keywords:["laugh","cry","joy"]},{emoji:"🙂",name:"slightly smiling face",category:"smileys",keywords:["smile","happy"]},{emoji:"🙃",name:"upside-down face",category:"smileys",keywords:["silly","upside down"]},{emoji:"😉",name:"winking face",category:"smileys",keywords:["wink","flirt"]},{emoji:"😊",name:"smiling face with smiling eyes",category:"smileys",keywords:["happy","smile","blush"]},{emoji:"😇",name:"smiling face with halo",category:"smileys",keywords:["angel","innocent"]},{emoji:"🥰",name:"smiling face with hearts",category:"smileys",keywords:["love","hearts","adore"]},{emoji:"😍",name:"smiling face with heart-eyes",category:"smileys",keywords:["love","heart","eyes"]},{emoji:"🤩",name:"star-struck",category:"smileys",keywords:["star","struck","amazed"]},{emoji:"😘",name:"face blowing a kiss",category:"smileys",keywords:["kiss","love","flirt"]},{emoji:"😗",name:"kissing face",category:"smileys",keywords:["kiss","love"]},{emoji:"☺️",name:"smiling face",category:"smileys",keywords:["smile","happy","content"]},{emoji:"😚",name:"kissing face with closed eyes",category:"smileys",keywords:["kiss","love","closed eyes"]},{emoji:"😙",name:"kissing face with smiling eyes",category:"smileys",keywords:["kiss","love","smile"]},{emoji:"🥲",name:"smiling face with tear",category:"smileys",keywords:["happy","cry","tear","bittersweet"]},{emoji:"😋",name:"face savoring food",category:"smileys",keywords:["yum","delicious","food"]},{emoji:"😛",name:"face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"😜",name:"winking face with tongue",category:"smileys",keywords:["wink","tongue","silly"]},{emoji:"🤪",name:"zany face",category:"smileys",keywords:["crazy","silly","wild"]},{emoji:"😝",name:"squinting face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"🤑",name:"money-mouth face",category:"smileys",keywords:["money","rich","greedy"]},{emoji:"🤗",name:"hugging face",category:"smileys",keywords:["hug","love","care"]},{emoji:"🤭",name:"face with hand over mouth",category:"smileys",keywords:["oops","secret","quiet"]},{emoji:"🫢",name:"face with open eyes and hand over mouth",category:"smileys",keywords:["surprise","shock","oops"]},{emoji:"🫣",name:"face with peeking eye",category:"smileys",keywords:["peek","shy","embarrassed"]},{emoji:"🤫",name:"shushing face",category:"smileys",keywords:["quiet","secret","shh"]},{emoji:"🤔",name:"thinking face",category:"smileys",keywords:["think","consider","hmm"]},{emoji:"🫡",name:"saluting face",category:"smileys",keywords:["salute","respect","military"]},{emoji:"🤐",name:"zipper-mouth face",category:"smileys",keywords:["quiet","secret","zip"]},{emoji:"🤨",name:"face with raised eyebrow",category:"smileys",keywords:["suspicious","doubt","skeptical"]},{emoji:"😐",name:"neutral face",category:"smileys",keywords:["neutral","meh","blank"]},{emoji:"😑",name:"expressionless face",category:"smileys",keywords:["blank","deadpan","meh"]},{emoji:"😶",name:"face without mouth",category:"smileys",keywords:["quiet","speechless","silent"]},{emoji:"🫥",name:"dotted line face",category:"smileys",keywords:["invisible","depressed","disappear"]},{emoji:"😏",name:"smirking face",category:"smileys",keywords:["smirk","smug","confident"]},{emoji:"😒",name:"unamused face",category:"smileys",keywords:["unamused","bored","annoyed"]},{emoji:"🙄",name:"face with rolling eyes",category:"smileys",keywords:["eye roll","annoyed","whatever"]},{emoji:"😬",name:"grimacing face",category:"smileys",keywords:["grimace","awkward","oops"]},{emoji:"😮‍💨",name:"face exhaling",category:"smileys",keywords:["sigh","relief","tired"]},{emoji:"🤥",name:"lying face",category:"smileys",keywords:["lie","pinocchio","dishonest"]},{emoji:"😌",name:"relieved face",category:"smileys",keywords:["relief","calm","peaceful"]},{emoji:"😔",name:"pensive face",category:"smileys",keywords:["sad","thoughtful","pensive"]},{emoji:"😪",name:"sleepy face",category:"smileys",keywords:["sleepy","tired","drowsy"]},{emoji:"🤤",name:"drooling face",category:"smileys",keywords:["drool","desire","sleep"]},{emoji:"😴",name:"sleeping face",category:"smileys",keywords:["sleep","tired","zzz"]},{emoji:"😷",name:"face with medical mask",category:"smileys",keywords:["mask","sick","doctor"]},{emoji:"🤒",name:"face with thermometer",category:"smileys",keywords:["sick","fever","ill"]},{emoji:"🤕",name:"face with head-bandage",category:"smileys",keywords:["hurt","injured","bandage"]},{emoji:"🤢",name:"nauseated face",category:"smileys",keywords:["sick","nausea","disgusted"]},{emoji:"🤮",name:"face vomiting",category:"smileys",keywords:["vomit","sick","disgusted"]},{emoji:"🤧",name:"sneezing face",category:"smileys",keywords:["sneeze","sick","gesundheit"]},{emoji:"🥵",name:"hot face",category:"smileys",keywords:["hot","heat","sweat"]},{emoji:"🥶",name:"cold face",category:"smileys",keywords:["cold","freeze","blue"]},{emoji:"🥴",name:"woozy face",category:"smileys",keywords:["dizzy","drunk","confused"]},{emoji:"😵",name:"dizzy face",category:"smileys",keywords:["dizzy","confused","knocked out"]},{emoji:"😵‍💫",name:"face with spiral eyes",category:"smileys",keywords:["dizzy","hypnotized","confused"]},{emoji:"🤯",name:"exploding head",category:"smileys",keywords:["mind blown","shocked","amazed"]},{emoji:"🤠",name:"cowboy hat face",category:"smileys",keywords:["cowboy","hat","western"]},{emoji:"🥳",name:"partying face",category:"smileys",keywords:["party","celebration","birthday"]},{emoji:"🥸",name:"disguised face",category:"smileys",keywords:["disguise","glasses","incognito"]},{emoji:"😎",name:"smiling face with sunglasses",category:"smileys",keywords:["cool","sunglasses","awesome"]},{emoji:"🤓",name:"nerd face",category:"smileys",keywords:["nerd","geek","smart"]},{emoji:"🧐",name:"face with monocle",category:"smileys",keywords:["monocle","fancy","inspection"]},{emoji:"👋",name:"waving hand",category:"people",keywords:["wave","hello","goodbye"]},{emoji:"🤚",name:"raised back of hand",category:"people",keywords:["hand","stop"]},{emoji:"🖐️",name:"hand with fingers splayed",category:"people",keywords:["hand","five"]},{emoji:"✋",name:"raised hand",category:"people",keywords:["hand","stop","high five"]},{emoji:"🖖",name:"vulcan salute",category:"people",keywords:["spock","vulcan"]},{emoji:"👌",name:"OK hand",category:"people",keywords:["ok","perfect"]},{emoji:"🤌",name:"pinched fingers",category:"people",keywords:["italian","chef kiss"]},{emoji:"🤏",name:"pinching hand",category:"people",keywords:["small","tiny"]},{emoji:"✌️",name:"victory hand",category:"people",keywords:["peace","victory"]},{emoji:"🤞",name:"crossed fingers",category:"people",keywords:["luck","hope"]},{emoji:"🤟",name:"love-you gesture",category:"people",keywords:["love","you"]},{emoji:"🤘",name:"sign of the horns",category:"people",keywords:["rock","metal"]},{emoji:"🤙",name:"call me hand",category:"people",keywords:["call","phone"]},{emoji:"👈",name:"backhand index pointing left",category:"people",keywords:["point","left"]},{emoji:"👉",name:"backhand index pointing right",category:"people",keywords:["point","right"]},{emoji:"👆",name:"backhand index pointing up",category:"people",keywords:["point","up"]},{emoji:"🖕",name:"middle finger",category:"people",keywords:["middle finger","rude"]},{emoji:"👇",name:"backhand index pointing down",category:"people",keywords:["point","down"]},{emoji:"☝️",name:"index pointing up",category:"people",keywords:["point","up","one"]},{emoji:"👍",name:"thumbs up",category:"people",keywords:["thumbs up","good","yes"]},{emoji:"👎",name:"thumbs down",category:"people",keywords:["thumbs down","bad","no"]},{emoji:"✊",name:"raised fist",category:"people",keywords:["fist","power","solidarity"]},{emoji:"👊",name:"oncoming fist",category:"people",keywords:["fist","punch","bump"]},{emoji:"🤛",name:"left-facing fist",category:"people",keywords:["fist","bump","left"]},{emoji:"🤜",name:"right-facing fist",category:"people",keywords:["fist","bump","right"]},{emoji:"👏",name:"clapping hands",category:"people",keywords:["clap","applause","bravo"]},{emoji:"🙌",name:"raising hands",category:"people",keywords:["celebration","hooray","praise"]},{emoji:"👐",name:"open hands",category:"people",keywords:["open","hug","jazz hands"]},{emoji:"🤲",name:"palms up together",category:"people",keywords:["prayer","please","hope"]},{emoji:"🤝",name:"handshake",category:"people",keywords:["handshake","deal","agreement"]},{emoji:"🙏",name:"folded hands",category:"people",keywords:["prayer","thanks","please"]},{emoji:"✍️",name:"writing hand",category:"people",keywords:["write","author","signature"]},{emoji:"💅",name:"nail polish",category:"people",keywords:["nails","beauty","manicure"]},{emoji:"🤳",name:"selfie",category:"people",keywords:["selfie","camera","phone"]},{emoji:"💪",name:"flexed biceps",category:"people",keywords:["muscle","strong","flex"]},{emoji:"🦾",name:"mechanical arm",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦿",name:"mechanical leg",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦵",name:"leg",category:"people",keywords:["leg","limb","kick"]},{emoji:"🦶",name:"foot",category:"people",keywords:["foot","kick","stomp"]},{emoji:"👂",name:"ear",category:"people",keywords:["ear","hear","listen"]},{emoji:"🦻",name:"ear with hearing aid",category:"people",keywords:["hearing aid","deaf","accessibility"]},{emoji:"👃",name:"nose",category:"people",keywords:["nose","smell","sniff"]},{emoji:"🧠",name:"brain",category:"people",keywords:["brain","smart","think"]},{emoji:"🫀",name:"anatomical heart",category:"people",keywords:["heart","organ","love"]},{emoji:"🫁",name:"lungs",category:"people",keywords:["lungs","breathe","organ"]},{emoji:"🦷",name:"tooth",category:"people",keywords:["tooth","dental","smile"]},{emoji:"🦴",name:"bone",category:"people",keywords:["bone","skeleton","dog"]},{emoji:"👀",name:"eyes",category:"people",keywords:["eyes","look","see"]},{emoji:"👁️",name:"eye",category:"people",keywords:["eye","see","watch"]},{emoji:"👅",name:"tongue",category:"people",keywords:["tongue","taste","lick"]},{emoji:"👄",name:"mouth",category:"people",keywords:["mouth","lips","kiss"]},{emoji:"🫦",name:"biting lip",category:"people",keywords:["lip","bite","nervous"]},{emoji:"👶",name:"baby",category:"people",keywords:["baby","infant","child"]},{emoji:"🧒",name:"child",category:"people",keywords:["child","kid","young"]},{emoji:"👦",name:"boy",category:"people",keywords:["boy","child","male"]},{emoji:"👧",name:"girl",category:"people",keywords:["girl","child","female"]},{emoji:"🧑",name:"person",category:"people",keywords:["person","adult","human"]},{emoji:"👱",name:"person: blond hair",category:"people",keywords:["blond","hair","person"]},{emoji:"👨",name:"man",category:"people",keywords:["man","male","adult"]},{emoji:"🧔",name:"person: beard",category:"people",keywords:["beard","man","facial hair"]},{emoji:"👩",name:"woman",category:"people",keywords:["woman","female","adult"]},{emoji:"🧓",name:"older person",category:"people",keywords:["old","elderly","senior"]},{emoji:"👴",name:"old man",category:"people",keywords:["old","man","elderly"]},{emoji:"👵",name:"old woman",category:"people",keywords:["old","woman","elderly"]},{emoji:"🐶",name:"dog face",category:"animals",keywords:["dog","pet","animal"]},{emoji:"🐱",name:"cat face",category:"animals",keywords:["cat","pet","animal"]},{emoji:"🐭",name:"mouse face",category:"animals",keywords:["mouse","animal"]},{emoji:"🐹",name:"hamster",category:"animals",keywords:["hamster","pet"]},{emoji:"🐰",name:"rabbit face",category:"animals",keywords:["rabbit","bunny"]},{emoji:"🦊",name:"fox",category:"animals",keywords:["fox","animal"]},{emoji:"🐻",name:"bear",category:"animals",keywords:["bear","animal"]},{emoji:"🐼",name:"panda",category:"animals",keywords:["panda","bear"]},{emoji:"🐨",name:"koala",category:"animals",keywords:["koala","australia","marsupial"]},{emoji:"🐯",name:"tiger face",category:"animals",keywords:["tiger","cat","wild"]},{emoji:"🦁",name:"lion",category:"animals",keywords:["lion","king","cat"]},{emoji:"🐮",name:"cow face",category:"animals",keywords:["cow","moo","farm"]},{emoji:"🐷",name:"pig face",category:"animals",keywords:["pig","oink","farm"]},{emoji:"🐽",name:"pig nose",category:"animals",keywords:["pig","nose","snout"]},{emoji:"🐸",name:"frog",category:"animals",keywords:["frog","amphibian","green"]},{emoji:"🐵",name:"monkey face",category:"animals",keywords:["monkey","primate","banana"]},{emoji:"🙈",name:"see-no-evil monkey",category:"animals",keywords:["monkey","see no evil","eyes"]},{emoji:"🙉",name:"hear-no-evil monkey",category:"animals",keywords:["monkey","hear no evil","ears"]},{emoji:"🙊",name:"speak-no-evil monkey",category:"animals",keywords:["monkey","speak no evil","mouth"]},{emoji:"🐒",name:"monkey",category:"animals",keywords:["monkey","primate","zoo"]},{emoji:"🦍",name:"gorilla",category:"animals",keywords:["gorilla","ape","strong"]},{emoji:"🦧",name:"orangutan",category:"animals",keywords:["orangutan","ape","orange"]},{emoji:"🐺",name:"wolf",category:"animals",keywords:["wolf","howl","wild"]},{emoji:"🐗",name:"boar",category:"animals",keywords:["boar","pig","wild"]},{emoji:"🐴",name:"horse face",category:"animals",keywords:["horse","neigh","ride"]},{emoji:"🐎",name:"horse",category:"animals",keywords:["horse","racing","gallop"]},{emoji:"🦄",name:"unicorn",category:"animals",keywords:["unicorn","magical","horn"]},{emoji:"🦓",name:"zebra",category:"animals",keywords:["zebra","stripes","africa"]},{emoji:"🦌",name:"deer",category:"animals",keywords:["deer","antlers","forest"]},{emoji:"🦏",name:"rhinoceros",category:"animals",keywords:["rhino","horn","africa"]},{emoji:"🦛",name:"hippopotamus",category:"animals",keywords:["hippo","water","africa"]},{emoji:"🐘",name:"elephant",category:"animals",keywords:["elephant","trunk","memory"]},{emoji:"🦒",name:"giraffe",category:"animals",keywords:["giraffe","tall","neck"]},{emoji:"🦘",name:"kangaroo",category:"animals",keywords:["kangaroo","hop","australia"]},{emoji:"🦥",name:"sloth",category:"animals",keywords:["sloth","slow","lazy"]},{emoji:"🦦",name:"otter",category:"animals",keywords:["otter","water","cute"]},{emoji:"🦨",name:"skunk",category:"animals",keywords:["skunk","smell","stripe"]},{emoji:"🦡",name:"badger",category:"animals",keywords:["badger","honey","dig"]},{emoji:"🐾",name:"paw prints",category:"animals",keywords:["paw","prints","tracks"]},{emoji:"🐔",name:"chicken",category:"animals",keywords:["chicken","rooster","farm"]},{emoji:"🐓",name:"rooster",category:"animals",keywords:["rooster","cock","morning"]},{emoji:"🐣",name:"hatching chick",category:"animals",keywords:["chick","hatching","egg"]},{emoji:"🐤",name:"baby chick",category:"animals",keywords:["chick","baby","yellow"]},{emoji:"🐥",name:"front-facing baby chick",category:"animals",keywords:["chick","baby","cute"]},{emoji:"🦆",name:"duck",category:"animals",keywords:["duck","quack","water"]},{emoji:"🦅",name:"eagle",category:"animals",keywords:["eagle","bird","freedom"]},{emoji:"🦉",name:"owl",category:"animals",keywords:["owl","wise","night"]},{emoji:"🦇",name:"bat",category:"animals",keywords:["bat","vampire","night"]},{emoji:"",name:"bug",category:"animals",keywords:["bug","insect","crawl"]},{emoji:"🦋",name:"butterfly",category:"animals",keywords:["butterfly","beautiful","fly"]},{emoji:"🐌",name:"snail",category:"animals",keywords:["snail","slow","shell"]},{emoji:"🐞",name:"lady beetle",category:"animals",keywords:["ladybug","beetle","red"]},{emoji:"🐜",name:"ant",category:"animals",keywords:["ant","work","colony"]},{emoji:"🦟",name:"mosquito",category:"animals",keywords:["mosquito","bite","buzz"]},{emoji:"🕷️",name:"spider",category:"animals",keywords:["spider","web","eight legs"]},{emoji:"🦂",name:"scorpion",category:"animals",keywords:["scorpion","sting","desert"]},{emoji:"🐢",name:"turtle",category:"animals",keywords:["turtle","slow","shell"]},{emoji:"🐍",name:"snake",category:"animals",keywords:["snake","slither","reptile"]},{emoji:"🦎",name:"lizard",category:"animals",keywords:["lizard","gecko","reptile"]},{emoji:"🐙",name:"octopus",category:"animals",keywords:["octopus","tentacles","sea"]},{emoji:"🦑",name:"squid",category:"animals",keywords:["squid","tentacles","ocean"]},{emoji:"🦐",name:"shrimp",category:"animals",keywords:["shrimp","seafood","small"]},{emoji:"🦞",name:"lobster",category:"animals",keywords:["lobster","claws","red"]},{emoji:"🦀",name:"crab",category:"animals",keywords:["crab","claws","beach"]},{emoji:"🐡",name:"blowfish",category:"animals",keywords:["blowfish","puffer","spiky"]},{emoji:"🐠",name:"tropical fish",category:"animals",keywords:["fish","tropical","colorful"]},{emoji:"🐟",name:"fish",category:"animals",keywords:["fish","swim","water"]},{emoji:"🐬",name:"dolphin",category:"animals",keywords:["dolphin","smart","ocean"]},{emoji:"🐳",name:"spouting whale",category:"animals",keywords:["whale","spout","big"]},{emoji:"🐋",name:"whale",category:"animals",keywords:["whale","ocean","huge"]},{emoji:"🦈",name:"shark",category:"animals",keywords:["shark","teeth","dangerous"]},{emoji:"🐊",name:"crocodile",category:"animals",keywords:["crocodile","teeth","swamp"]},{emoji:"🌸",name:"cherry blossom",category:"animals",keywords:["flower","spring","pink"]},{emoji:"💐",name:"bouquet",category:"animals",keywords:["flowers","bouquet","gift"]},{emoji:"🌺",name:"hibiscus",category:"animals",keywords:["flower","tropical","red"]},{emoji:"🌻",name:"sunflower",category:"animals",keywords:["sunflower","yellow","big"]},{emoji:"🌹",name:"rose",category:"animals",keywords:["rose","love","red"]},{emoji:"🥀",name:"wilted flower",category:"animals",keywords:["flower","wilted","sad"]},{emoji:"🌷",name:"tulip",category:"animals",keywords:["tulip","spring","netherlands"]},{emoji:"🌼",name:"daisy",category:"animals",keywords:["daisy","white","simple"]},{emoji:"🌱",name:"seedling",category:"animals",keywords:["plant","grow","green"]},{emoji:"🌿",name:"herb",category:"animals",keywords:["herb","green","leaf"]},{emoji:"🍀",name:"four leaf clover",category:"animals",keywords:["clover","luck","green"]},{emoji:"🌳",name:"deciduous tree",category:"animals",keywords:["tree","nature","green"]},{emoji:"🌲",name:"evergreen tree",category:"animals",keywords:["tree","pine","christmas"]},{emoji:"🌴",name:"palm tree",category:"animals",keywords:["palm","tropical","beach"]},{emoji:"🌵",name:"cactus",category:"animals",keywords:["cactus","desert","spiky"]},{emoji:"🍎",name:"red apple",category:"food",keywords:["apple","fruit"]},{emoji:"🍊",name:"tangerine",category:"food",keywords:["orange","fruit"]},{emoji:"🍋",name:"lemon",category:"food",keywords:["lemon","fruit"]},{emoji:"🍌",name:"banana",category:"food",keywords:["banana","fruit"]},{emoji:"🍉",name:"watermelon",category:"food",keywords:["watermelon","fruit"]},{emoji:"🍇",name:"grapes",category:"food",keywords:["grapes","fruit"]},{emoji:"🍓",name:"strawberry",category:"food",keywords:["strawberry","fruit"]},{emoji:"🫐",name:"blueberries",category:"food",keywords:["blueberry","fruit"]},{emoji:"🥝",name:"kiwi fruit",category:"food",keywords:["kiwi","fruit","green"]},{emoji:"🍅",name:"tomato",category:"food",keywords:["tomato","red","vegetable"]},{emoji:"🫒",name:"olive",category:"food",keywords:["olive","green","oil"]},{emoji:"🥥",name:"coconut",category:"food",keywords:["coconut","tropical","milk"]},{emoji:"🥑",name:"avocado",category:"food",keywords:["avocado","green","healthy"]},{emoji:"🍆",name:"eggplant",category:"food",keywords:["eggplant","purple","vegetable"]},{emoji:"🥔",name:"potato",category:"food",keywords:["potato","vegetable","starch"]},{emoji:"🥕",name:"carrot",category:"food",keywords:["carrot","orange","vegetable"]},{emoji:"🌽",name:"ear of corn",category:"food",keywords:["corn","yellow","vegetable"]},{emoji:"🌶️",name:"hot pepper",category:"food",keywords:["pepper","hot","spicy"]},{emoji:"🫑",name:"bell pepper",category:"food",keywords:["pepper","bell","vegetable"]},{emoji:"🥒",name:"cucumber",category:"food",keywords:["cucumber","green","vegetable"]},{emoji:"🥬",name:"leafy greens",category:"food",keywords:["lettuce","greens","salad"]},{emoji:"🥦",name:"broccoli",category:"food",keywords:["broccoli","green","vegetable"]},{emoji:"🧄",name:"garlic",category:"food",keywords:["garlic","flavor","cooking"]},{emoji:"🧅",name:"onion",category:"food",keywords:["onion","cry","cooking"]},{emoji:"🍄",name:"mushroom",category:"food",keywords:["mushroom","fungi","cooking"]},{emoji:"🥜",name:"peanuts",category:"food",keywords:["peanuts","nuts","snack"]},{emoji:"🌰",name:"chestnut",category:"food",keywords:["chestnut","nut","autumn"]},{emoji:"🍞",name:"bread",category:"food",keywords:["bread","loaf","carbs"]},{emoji:"🥐",name:"croissant",category:"food",keywords:["croissant","french","pastry"]},{emoji:"🥖",name:"baguette bread",category:"food",keywords:["baguette","french","bread"]},{emoji:"🫓",name:"flatbread",category:"food",keywords:["flatbread","bread","thin"]},{emoji:"🥨",name:"pretzel",category:"food",keywords:["pretzel","twisted","snack"]},{emoji:"🥯",name:"bagel",category:"food",keywords:["bagel","round","breakfast"]},{emoji:"🥞",name:"pancakes",category:"food",keywords:["pancakes","breakfast","syrup"]},{emoji:"🧇",name:"waffle",category:"food",keywords:["waffle","breakfast","squares"]},{emoji:"🧀",name:"cheese wedge",category:"food",keywords:["cheese","dairy","yellow"]},{emoji:"🍖",name:"meat on bone",category:"food",keywords:["meat","bone","protein"]},{emoji:"🍗",name:"poultry leg",category:"food",keywords:["chicken","leg","meat"]},{emoji:"🥩",name:"cut of meat",category:"food",keywords:["steak","meat","red"]},{emoji:"🥓",name:"bacon",category:"food",keywords:["bacon","pork","breakfast"]},{emoji:"🍔",name:"hamburger",category:"food",keywords:["burger","hamburger","fast food"]},{emoji:"🍟",name:"french fries",category:"food",keywords:["fries","potato","fast food"]},{emoji:"🍕",name:"pizza",category:"food",keywords:["pizza","slice","italian"]},{emoji:"🌭",name:"hot dog",category:"food",keywords:["hot dog","sausage","fast food"]},{emoji:"🥪",name:"sandwich",category:"food",keywords:["sandwich","bread","lunch"]},{emoji:"🌮",name:"taco",category:"food",keywords:["taco","mexican","shell"]},{emoji:"🌯",name:"burrito",category:"food",keywords:["burrito","wrap","mexican"]},{emoji:"🫔",name:"tamale",category:"food",keywords:["tamale","mexican","corn"]},{emoji:"🥙",name:"stuffed flatbread",category:"food",keywords:["pita","flatbread","stuffed"]},{emoji:"🧆",name:"falafel",category:"food",keywords:["falafel","middle eastern","chickpea"]},{emoji:"🥚",name:"egg",category:"food",keywords:["egg","protein","breakfast"]},{emoji:"🍳",name:"cooking",category:"food",keywords:["cooking","frying pan","egg"]},{emoji:"🥘",name:"shallow pan of food",category:"food",keywords:["paella","pan","cooking"]},{emoji:"🍲",name:"pot of food",category:"food",keywords:["stew","pot","cooking"]},{emoji:"🫕",name:"fondue",category:"food",keywords:["fondue","cheese","pot"]},{emoji:"🥣",name:"bowl with spoon",category:"food",keywords:["bowl","cereal","soup"]},{emoji:"🥗",name:"green salad",category:"food",keywords:["salad","healthy","greens"]},{emoji:"🍿",name:"popcorn",category:"food",keywords:["popcorn","movie","snack"]},{emoji:"🧈",name:"butter",category:"food",keywords:["butter","dairy","spread"]},{emoji:"🧂",name:"salt",category:"food",keywords:["salt","seasoning","white"]},{emoji:"🥫",name:"canned food",category:"food",keywords:["can","canned","preserved"]},{emoji:"🍱",name:"bento box",category:"food",keywords:["bento","japanese","lunch box"]},{emoji:"🍘",name:"rice cracker",category:"food",keywords:["rice","cracker","japanese"]},{emoji:"🍙",name:"rice ball",category:"food",keywords:["rice ball","onigiri","japanese"]},{emoji:"🍚",name:"cooked rice",category:"food",keywords:["rice","cooked","bowl"]},{emoji:"🍛",name:"curry rice",category:"food",keywords:["curry","rice","spicy"]},{emoji:"🍜",name:"steaming bowl",category:"food",keywords:["ramen","noodles","soup"]},{emoji:"🍝",name:"spaghetti",category:"food",keywords:["spaghetti","pasta","italian"]},{emoji:"🍠",name:"roasted sweet potato",category:"food",keywords:["sweet potato","roasted","orange"]},{emoji:"🍢",name:"oden",category:"food",keywords:["oden","japanese","skewer"]},{emoji:"🍣",name:"sushi",category:"food",keywords:["sushi","japanese","fish"]},{emoji:"🍤",name:"fried shrimp",category:"food",keywords:["shrimp","fried","tempura"]},{emoji:"🍥",name:"fish cake with swirl",category:"food",keywords:["fish cake","japanese","swirl"]},{emoji:"🥮",name:"moon cake",category:"food",keywords:["moon cake","chinese","festival"]},{emoji:"🍡",name:"dango",category:"food",keywords:["dango","japanese","sweet"]},{emoji:"🥟",name:"dumpling",category:"food",keywords:["dumpling","chinese","steamed"]},{emoji:"🥠",name:"fortune cookie",category:"food",keywords:["fortune cookie","chinese","luck"]},{emoji:"🥡",name:"takeout box",category:"food",keywords:["takeout","chinese","box"]},{emoji:"🦀",name:"crab",category:"food",keywords:["crab","seafood","claws"]},{emoji:"🦞",name:"lobster",category:"food",keywords:["lobster","seafood","red"]},{emoji:"🦐",name:"shrimp",category:"food",keywords:["shrimp","seafood","small"]},{emoji:"🦑",name:"squid",category:"food",keywords:["squid","seafood","tentacles"]},{emoji:"🦪",name:"oyster",category:"food",keywords:["oyster","seafood","shell"]},{emoji:"🍦",name:"soft ice cream",category:"food",keywords:["ice cream","soft serve","cone"]},{emoji:"🍧",name:"shaved ice",category:"food",keywords:["shaved ice","snow cone","cold"]},{emoji:"🍨",name:"ice cream",category:"food",keywords:["ice cream","dessert","cold"]},{emoji:"🍩",name:"doughnut",category:"food",keywords:["donut","doughnut","sweet"]},{emoji:"🍪",name:"cookie",category:"food",keywords:["cookie","sweet","baked"]},{emoji:"🎂",name:"birthday cake",category:"food",keywords:["cake","birthday","celebration"]},{emoji:"🍰",name:"shortcake",category:"food",keywords:["cake","slice","dessert"]},{emoji:"🧁",name:"cupcake",category:"food",keywords:["cupcake","muffin","sweet"]},{emoji:"🥧",name:"pie",category:"food",keywords:["pie","dessert","slice"]},{emoji:"🍫",name:"chocolate bar",category:"food",keywords:["chocolate","bar","sweet"]},{emoji:"🍬",name:"candy",category:"food",keywords:["candy","sweet","wrapper"]},{emoji:"🍭",name:"lollipop",category:"food",keywords:["lollipop","candy","stick"]},{emoji:"🍮",name:"custard",category:"food",keywords:["custard","pudding","dessert"]},{emoji:"🍯",name:"honey pot",category:"food",keywords:["honey","sweet","bee"]},{emoji:"🍼",name:"baby bottle",category:"food",keywords:["bottle","baby","milk"]},{emoji:"🥛",name:"glass of milk",category:"food",keywords:["milk","glass","dairy"]},{emoji:"☕",name:"hot beverage",category:"food",keywords:["coffee","tea","hot"]},{emoji:"🫖",name:"teapot",category:"food",keywords:["teapot","tea","hot"]},{emoji:"🍵",name:"teacup without handle",category:"food",keywords:["tea","green tea","cup"]},{emoji:"🍶",name:"sake",category:"food",keywords:["sake","japanese","alcohol"]},{emoji:"🍾",name:"bottle with popping cork",category:"food",keywords:["champagne","celebration","cork"]},{emoji:"🍷",name:"wine glass",category:"food",keywords:["wine","glass","alcohol"]},{emoji:"🍸",name:"cocktail glass",category:"food",keywords:["cocktail","martini","alcohol"]},{emoji:"🍹",name:"tropical drink",category:"food",keywords:["tropical","cocktail","umbrella"]},{emoji:"🍺",name:"beer mug",category:"food",keywords:["beer","mug","alcohol"]},{emoji:"🍻",name:"clinking beer mugs",category:"food",keywords:["beer","cheers","celebration"]},{emoji:"🥂",name:"clinking glasses",category:"food",keywords:["champagne","cheers","celebration"]},{emoji:"🥃",name:"tumbler glass",category:"food",keywords:["whiskey","tumbler","alcohol"]},{emoji:"🫗",name:"pouring liquid",category:"food",keywords:["pour","liquid","drink"]},{emoji:"🥤",name:"cup with straw",category:"food",keywords:["soda","straw","drink"]},{emoji:"🧋",name:"bubble tea",category:"food",keywords:["bubble tea","boba","drink"]},{emoji:"🧃",name:"beverage box",category:"food",keywords:["juice box","drink","straw"]},{emoji:"🧉",name:"mate",category:"food",keywords:["mate","tea","south american"]},{emoji:"🧊",name:"ice",category:"food",keywords:["ice","cold","cube"]},{emoji:"⚽",name:"soccer ball",category:"activities",keywords:["soccer","football","sport"]},{emoji:"🏀",name:"basketball",category:"activities",keywords:["basketball","sport"]},{emoji:"🏈",name:"american football",category:"activities",keywords:["football","sport"]},{emoji:"⚾",name:"baseball",category:"activities",keywords:["baseball","sport"]},{emoji:"🥎",name:"softball",category:"activities",keywords:["softball","sport"]},{emoji:"🎾",name:"tennis",category:"activities",keywords:["tennis","sport"]},{emoji:"🚗",name:"automobile",category:"travel",keywords:["car","vehicle"]},{emoji:"🚕",name:"taxi",category:"travel",keywords:["taxi","car"]},{emoji:"🚙",name:"sport utility vehicle",category:"travel",keywords:["suv","car"]},{emoji:"🚌",name:"bus",category:"travel",keywords:["bus","vehicle"]},{emoji:"🚎",name:"trolleybus",category:"travel",keywords:["trolley","bus"]},{emoji:"🏎️",name:"racing car",category:"travel",keywords:["race","car","fast"]},{emoji:"💡",name:"light bulb",category:"objects",keywords:["idea","light","bulb"]},{emoji:"🔋",name:"battery",category:"objects",keywords:["battery","power"]},{emoji:"🖥️",name:"desktop computer",category:"objects",keywords:["computer","desktop"]},{emoji:"💻",name:"laptop",category:"objects",keywords:["laptop","computer"]},{emoji:"📱",name:"mobile phone",category:"objects",keywords:["phone","mobile"]},{emoji:"☎️",name:"telephone",category:"objects",keywords:["phone","telephone"]},{emoji:"❤️",name:"red heart",category:"symbols",keywords:["love","heart"]},{emoji:"🧡",name:"orange heart",category:"symbols",keywords:["love","heart"]},{emoji:"💛",name:"yellow heart",category:"symbols",keywords:["love","heart"]},{emoji:"💚",name:"green heart",category:"symbols",keywords:["love","heart"]},{emoji:"💙",name:"blue heart",category:"symbols",keywords:["love","heart"]},{emoji:"💜",name:"purple heart",category:"symbols",keywords:["love","heart"]},{emoji:"🖤",name:"black heart",category:"symbols",keywords:["love","heart"]},{emoji:"🤍",name:"white heart",category:"symbols",keywords:["love","heart"]},{emoji:"🏁",name:"chequered flag",category:"flags",keywords:["flag","race","finish"]},{emoji:"🚩",name:"triangular flag",category:"flags",keywords:["flag","warning"]},{emoji:"🏳️",name:"white flag",category:"flags",keywords:["flag","surrender"]},{emoji:"🏴",name:"black flag",category:"flags",keywords:["flag","pirate"]},{emoji:"🏳️‍🌈",name:"rainbow flag",category:"flags",keywords:["flag","rainbow","pride"]}],Yn=e=>{const{value:o,defaultValue:t="",onChange:n,onEmojiSelect:i,isOpen:a,onOpen:l,onClose:d,closeOnSelect:s=!0,maxRecentEmojis:g=16,showRecentEmojis:p=!0,enabledCategories:m=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:h=[]}=e,[f,x]=u.useState(a??!1),[y,b]=u.useState(o??t),[k,S]=u.useState(""),[w,j]=u.useState("smileys"),[C,I]=u.useState([]),M=u.useRef(null),R=u.useRef(null),V=u.useMemo(()=>[...Kg,...h],[h]),_=u.useMemo(()=>{let E=V;if(w!=="recent"?E=E.filter(H=>H.category===w):E=C,k){const H=k.toLowerCase();E=E.filter(L=>L.name.toLowerCase().includes(H)||L.keywords.some(A=>A.toLowerCase().includes(H)))}return E},[V,w,C,k]);u.useEffect(()=>{o!==void 0&&b(o)},[o]),u.useEffect(()=>{a!==void 0&&x(a)},[a]),u.useEffect(()=>{if(p){const E=localStorage.getItem("emojiPicker-recentEmojis");if(E)try{I(JSON.parse(E))}catch{}}},[p]),u.useEffect(()=>{const E=H=>{f&&M.current&&R.current&&!M.current.contains(H.target)&&!R.current.contains(H.target)&&$()};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[f]);const T=u.useCallback(E=>{p&&I(H=>{const L=H.filter(F=>F.emoji!==E.emoji),A=[E,...L].slice(0,g);return localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(A)),A})},[p,g]),W=u.useCallback(()=>{const E=!f;x(E),E?(l==null||l(),S(""),p&&C.length>0?j("recent"):j("smileys")):d==null||d()},[f,l,d,p,C.length]),B=u.useCallback(E=>{b(E.emoji),T(E),n==null||n(E.emoji),i==null||i(E),s&&(x(!1),d==null||d())},[n,i,s,d,T]),P=u.useCallback(E=>{S(E),E&&w==="recent"&&j("smileys")},[w]),z=u.useCallback(E=>{j(E),S("")},[]),$=u.useCallback(()=>{x(!1),d==null||d()},[d]);return{isOpen:f,selectedEmoji:y,recentEmojis:C,searchQuery:k,activeCategory:w,filteredEmojis:_,handleToggle:W,handleEmojiSelect:B,handleSearchChange:P,handleCategoryChange:z,handleClose:$,triggerRef:M,dropdownRef:R}},vn=({id:e,name:o,label:t,placeholder:n="Select an emoji",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",error:g=!1,isDisabled:p=!1,isReadOnly:m=!1,showSearch:h=!0,showCategories:f=!0,showRecentEmojis:x=!0,enabledCategories:y=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:b,selectedEmoji:k,recentEmojis:S,searchQuery:w,activeCategory:j,filteredEmojis:C,handleToggle:I,handleEmojiSelect:M,handleSearchChange:R,handleCategoryChange:V,triggerRef:_,dropdownRef:T,onChange:W,...B})=>{const{getColor:P}=c.useTheme(),z={...Me.container,...a==null?void 0:a.container},$={...Me.trigger,...Gg[l],...Yg[d],...vg[s],...g&&{borderColor:"color-red-500"},...p&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},E={...Me.dropdown,...a==null?void 0:a.dropdown},H={...Me.categoryTabs,...a==null?void 0:a.categoryTabs},L={...Me.emojiGrid,...a==null?void 0:a.emojiGrid},A=y.filter(F=>F==="recent"?x&&S.length>0:!0);return r.jsxs(c.View,{...z,...B,children:[t&&r.jsx(c.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:_,onClick:p||m?void 0:I,...$,children:[r.jsx(c.Horizontal,{alignItems:"center",gap:8,children:r.jsx(c.Text,{color:k?"color-gray-800":"color-gray-500",fontSize:"inherit",children:k||n})}),!m&&!p&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:b?"up":"down"})]}),b&&r.jsxs(c.View,{ref:T,...E,children:[h&&r.jsx(c.View,{...Me.searchInput,...a==null?void 0:a.searchInput,children:r.jsx(xo,{placeholder:"Search emojis...",value:w,onChange:F=>R(F.target.value),size:"sm"})}),f&&r.jsx(c.View,{...H,children:A.map(F=>r.jsx(c.View,{...Me.categoryTab,...j===F&&{borderBottomColor:"color-blue-500",color:"color-blue-600"},onClick:()=>V(F),title:F.charAt(0).toUpperCase()+F.slice(1),...a==null?void 0:a.categoryTab,children:Xg[F]},F))}),r.jsx(c.View,{...L,children:C.length>0?C.map((F,D)=>r.jsx(c.View,{...Me.emoji,onClick:()=>M(F),title:F.name,_hover:{backgroundColor:"color-gray-100"},color:"color-gray-800",...a==null?void 0:a.emoji,children:F.emoji},`${F.emoji}-${D}`)):r.jsx(c.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(c.Text,{fontSize:"14px",children:w?"No emojis found":"No emojis in this category"})})})]}),i&&r.jsx(c.Text,{color:g?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i})]})},Qg=e=>{const o=ue(e),t={...e,value:o.value??e.value??e.defaultValue},n=Yn(t),i=a=>{var l;n.handleEmojiSelect(a),o.onChange(a.emoji),(l=e.onEmojiSelect)==null||l.call(e,a)};return r.jsx(vn,{...n,...t,handleEmojiSelect:i})},Zg=Qg,Jg=({files:e,onRemove:o,maxHeight:t="120px",views:n={}})=>{if(e.length===0)return null;const i=u.useCallback(a=>a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(1)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(c.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:t,overflowY:"auto",...n==null?void 0:n.container,children:e.map((a,l)=>{const d=a.url||"",s=a.type.startsWith("image/"),g=a.type.startsWith("video/"),p=a.type.startsWith("audio/");return r.jsx(c.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",position:"relative",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...n==null?void 0:n.item,children:r.jsxs(he,{children:[r.jsx(he.Trigger,{children:r.jsxs(c.View,{position:"relative",children:[s&&d&&r.jsx(c.Image,{src:d,alt:a.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),g&&d&&r.jsx(c.View,{as:"video",src:d,alt:a.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),p&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(Fo,{widthHeight:24,color:"color-black"})}),!s&&!g&&!p&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(go,{widthHeight:24,color:"color-black"})}),o&&r.jsx(c.Button,{position:"absolute",top:"-4px",right:"-4px",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",backgroundColor:"color-red-500",color:"white",fontSize:14,fontWeight:"bold",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:"2px solid white",_hover:{backgroundColor:"color-red-600"},onClick:m=>{m.stopPropagation(),o(l)},"aria-label":`Remove ${a.name}`,children:"×"})]})}),r.jsxs(he.Content,{children:[s&&d&&r.jsx(c.Image,{src:d,alt:a.name,maxWidth:"300px"}),g&&d&&r.jsx(c.View,{as:"video",src:d,controls:!0,maxWidth:"300px"}),p&&d&&r.jsx(c.View,{as:"audio",src:d,controls:!0,width:"100%"}),r.jsxs(c.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",fontSize:12,...n==null?void 0:n.name,children:[a.name," (",i(a.size),")"]})]})]})},l)})})},ep=e=>{const o=Bn(e);return r.jsx(Ln,{...e,...o})},op=ep,tp=({url:e,type:o,name:t,onOpen:n})=>{const i=o.toLowerCase(),a=i.startsWith("image"),l=i.startsWith("video"),d=i.startsWith("audio"),s=()=>{n&&n()};return r.jsxs(c.View,{width:"60px",height:"60px",flexShrink:0,borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-200",cursor:"pointer",onClick:s,children:[a&&r.jsx(c.Image,{src:e,alt:t,width:"100%",height:"100%",objectFit:"cover"}),l&&r.jsx(c.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:g=>g.stopPropagation()}),d&&r.jsx(c.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:g=>g.stopPropagation()}),!a&&!l&&!d&&r.jsx(go,{widthHeight:24,color:"color-gray-600"})]})},Re=kt.create(e=>({modals:[],onHide:o=>o,onShow:(o,t)=>({name:o,props:t}),show:(o,t={},n={})=>{e(i=>({...i,modals:[...i.modals,{name:o,props:{...t,isVisible:!0},overlayProps:n}]}))},hide:o=>{e(t=>o?{...t,modals:t.modals.filter(n=>n.name!==o)}:{modals:[]})},setOnHide:o=>{e(t=>({...t,onHide:o}))},setOnShow:o=>{e(t=>({...t,onShow:o}))}})),rp=(e,o={},t={})=>{Re.getState().show(e,o,t),Re.getState().onShow(e,o)},At=e=>{console.log("hideModal",e),Re.getState().onHide(e),Re.getState().hide(typeof e=="string"?e:void 0)},np={square:{borderRadius:0},rounded:{borderRadius:"8px"}},ap={center:{justifyContent:"center",alignItems:"center"},top:{justifyContent:"center",alignItems:"flex-start"},right:{justifyContent:"flex-end",alignItems:"center"},bottom:{justifyContent:"center",alignItems:"flex-end"},left:{justifyContent:"flex-start",alignItems:"center"}},ip={xs:12,sm:16,md:20,lg:24,xl:28},wo={body:{fontSize:"16px",fontWeight:"400",lineHeight:"24px",color:"color-gray-700"}},Xn=u.memo(({children:e,blur:o,isOpen:t=!1,isClosePrevented:n=!1,onClose:i=()=>{},position:a="center",views:l,...d})=>{const s=u.useCallback(()=>{n||i()},[n,i]);return r.jsx(c.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:s,visibility:t?"visible":"hidden",transition:"all 0.3s ease",...l==null?void 0:l.container,children:r.jsx(c.View,{position:"absolute",top:0,left:0,zIndex:1e3,width:"100vw",height:"100vh",display:"flex",backgroundColor:"color-blackAlpha-500",backdropFilter:o?`blur(${o}px)`:void 0,transition:"all 0.3s ease",onClick:s,...ap[a],...d,...l==null?void 0:l.view,children:e})})}),lp={boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"},cp={elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},sp=u.memo(({children:e,shadow:o,isFullScreen:t=!1,shape:n="rounded",views:i,isOpen:a,...l})=>{const d=typeof document!==void 0?lp:cp,s=u.useCallback(g=>{g&&g.stopPropagation&&g.stopPropagation()},[]);return r.jsx(c.Vertical,{cursor:"default",backgroundColor:"color-white",width:t?"100%":600,height:t?"100%":"fit-content",onClick:s,transition:"all 0.3s ease",...o||d,...np[n],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...l,...i==null?void 0:i.container,children:e})}),dp=u.memo(({children:e,buttonColor:o="theme-primary",iconSize:t="md",buttonPosition:n="right",views:i,...a})=>{const l=a.onClose?a.onClose:At,d=r.jsx(c.View,{onClick:l,children:r.jsx(fe,{widthHeight:ip[t],color:o})});return r.jsxs(c.Horizontal,{justifyContent:n==="none"?"center":"space-between",alignItems:"center",paddingVertical:16,paddingHorizontal:24,borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",media:{mobile:{paddingVertical:12,paddingHorizontal:16}},...a,...i==null?void 0:i.header,children:[n==="left"&&d,e,n==="right"&&d]})}),up=u.memo(({children:e,views:o,...t})=>r.jsx(c.View,{paddingVertical:16,paddingHorizontal:24,fontSize:wo.body.fontSize,fontWeight:wo.body.fontWeight,lineHeight:wo.body.lineHeight,color:wo.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...t,...o==null?void 0:o.view,children:e})),gp=u.memo(({children:e,views:o,...t})=>r.jsx(c.Horizontal,{marginTop:"auto",alignItems:"center",justifyContent:"flex-end",paddingVertical:16,paddingHorizontal:24,borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",gap:12,media:{mobile:{paddingVertical:12,paddingHorizontal:16,gap:8}},...t,...o==null?void 0:o.container,children:e})),pp=({modals:e,onShow:o,onHide:t})=>{const n=Re(i=>i.modals);return o&&Re.getState().setOnShow(o),t&&Re.getState().setOnHide(t),n.length===0?null:r.jsx(u.Fragment,{children:n.map((i,a)=>{const l=e[i.name];return l?r.jsx(Xn,{isOpen:i.props.isVisible,onClose:()=>At(i.name),blur:5,...i.overlayProps,style:{zIndex:1e3+a},children:r.jsx(l,{...i.props})},a):(console.error(`${i.name} modal doesn't exist`),null)})})},Be=({children:e})=>r.jsx(r.Fragment,{children:e});Be.Overlay=Xn;Be.Container=sp;Be.Header=dp;Be.Body=up;Be.Footer=gp;Be.Layout=pp;const fr={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},mp={left:{top:0,left:0,bottom:0,height:"100vh",borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{top:0,right:0,bottom:0,height:"100vh",borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"},top:{top:0,left:0,right:0,width:"100vw",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},bottom:{bottom:0,left:0,right:0,width:"100vw",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200"}},Kn=({isOpen:e,onClose:o,isClosePrevented:t,blur:n,children:i,...a})=>{const l=()=>{t||o()};return u.useEffect(()=>{const d=s=>{s.key==="Escape"&&e&&!t&&o()};return e&&document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[e,t,o]),r.jsx(c.View,{"data-testid":"drawer-overlay",role:"dialog","aria-modal":"true",position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:1e3,visibility:e?"visible":"hidden",onClick:l,transition:"all 0.3s ease",backgroundColor:e?"color-blackAlpha-500":"transparent",backdropFilter:n?`blur(${n}px)`:void 0,pointerEvents:e?"auto":"none",...a,children:i})},Qn=({placement:e="right",size:o="md",children:t,...n})=>{const i=d=>{d.stopPropagation()},l=e==="top"||e==="bottom"?{height:o==="full"?"100vh":fr[o]||o,maxHeight:"100vh"}:{width:o==="full"?"100vw":fr[o]||o,maxWidth:"100vw"};return r.jsx(c.Vertical,{position:"absolute",backgroundColor:"color-white",...mp[e],...l,onClick:i,transition:"transform 0.3s ease",...n,children:t})},hp=({children:e,onClose:o,buttonPosition:t="right",...n})=>{const i=o&&r.jsx(c.View,{onClick:o,cursor:"pointer",padding:8,children:r.jsx(fe,{widthHeight:20,color:"color-gray-500"})});return r.jsxs(c.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderBottomWidth:"1px",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:t==="none"?"center":"space-between",...n,children:[t==="left"&&i,e,t==="right"&&i]})},fp=({children:e,...o})=>r.jsx(c.Vertical,{padding:24,flex:1,overflowY:"auto",...o,children:e}),xp=({children:e,...o})=>r.jsx(c.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderTopWidth:"1px",borderTopColor:"color-gray-200",alignItems:"center",justifyContent:"flex-end",gap:12,...o,children:e}),bp=({isOpen:e,onClose:o,placement:t="right",size:n="md",isClosePrevented:i,children:a,...l})=>{const d=e?{}:{transform:t==="left"||t==="right"?`translateX(${t==="left"?"-100%":"100%"})`:`translateY(${t==="top"?"-100%":"100%"})`};return r.jsx(Kn,{isOpen:e,onClose:o,isClosePrevented:i,...l,children:r.jsx(Qn,{placement:t,size:n,style:d,children:a})})},Ze=bp;Ze.Overlay=Kn;Ze.Container=Qn;Ze.Header=hp;Ze.Body=fp;Ze.Footer=xp;const yp=(e=null,o=[])=>{const[t,n]=u.useState(e),[i,a]=u.useState(o),l=u.useRef({});return{activeItemId:t,setActiveItemId:n,expandedItemIds:i,toggleExpandedItem:g=>{a(p=>p.includes(g)?p.filter(h=>h!==g):[...p,g])},isItemExpanded:g=>i.includes(g),triggerRefs:l}},ft={sm:{padding:"8px 12px",fontSize:"12px",fontWeight:"500",media:{mobile:{padding:"6px 10px",fontSize:"11px"}}},md:{padding:"12px 16px",fontSize:"14px",fontWeight:"500",media:{mobile:{padding:"10px 14px",fontSize:"13px"}}},lg:{padding:"16px 20px",fontSize:"16px",fontWeight:"500",media:{mobile:{padding:"12px 16px",fontSize:"14px"}}}},xt={default:{backgroundColor:"transparent",color:"color-gray-800",transition:"all 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"all 0.2s ease"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"all 0.2s ease"}},Zn={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},Ye={active:{backgroundColor:"color-blue-50",color:"color-blue-700",fontWeight:"600",borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"color-blue-600"},hover:{backgroundColor:"color-gray-100",transition:"background-color 0.2s ease"}},Jn=u.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),kp=({children:e,value:o})=>r.jsx(Jn.Provider,{value:o,children:e}),bo=()=>{const e=u.useContext(Jn);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},Dt=({children:e,views:o})=>{const{orientation:t}=bo(),n=t==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(n,{width:"100%",...Zn[t],transition:"all 0.2s ease",borderRadius:"4px",...o==null?void 0:o.container,children:e})},ea=u.createContext({itemValue:null,isDisabled:!1}),jp=()=>{const e=u.useContext(ea);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},Ft=({item:e,value:o,isDisabled:t=!1,children:n,views:i})=>{var k;const{activeItemId:a,setActiveItemId:l,orientation:d,size:s,variant:g,onItemActivate:p}=bo(),m=(e==null?void 0:e.id)||o,h=a===m,f=(e==null?void 0:e.items)&&e.items.length>0,x=(e==null?void 0:e.disabled)||t,y=()=>{x||m&&(l(m),p&&p(m))},b=d==="horizontal"?c.Horizontal:c.Vertical;return n?r.jsx(ea.Provider,{value:{itemValue:m||null,isDisabled:x},children:r.jsx(c.View,{width:"100%",cursor:x?"not-allowed":"pointer",opacity:x?.6:1,borderRadius:"4px",transition:"all 0.2s ease",...ft[s],...xt[g],...h?Ye.active:{},_hover:x?{}:Ye.hover,...i==null?void 0:i.item,children:n})}):f&&e?r.jsxs(b,{width:"100%",flexDirection:"column",position:"relative",...i==null?void 0:i.item,children:[r.jsxs(oa,{itemId:e.id,disabled:e.disabled,views:i,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),e.label]}),r.jsx(ta,{itemId:e.id,children:r.jsx(Dt,{children:(k=e.items)==null?void 0:k.map(S=>r.jsx(Ft,{item:S},S.id))})})]}):e?r.jsxs(c.View,{as:e.href?"a":"div",to:e.href,onClick:y,cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.6:1,width:"100%",display:"flex",alignItems:"center",borderRadius:"4px",transition:"all 0.2s ease",gap:"8px",...ft[s],...xt[g],...h?Ye.active:{},_hover:e.disabled?{}:Ye.hover,...i==null?void 0:i.item,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),e.label]}):null},oa=({children:e,itemId:o,disabled:t,views:n})=>{const{activeItemId:i,toggleExpandedItem:a,isItemExpanded:l,size:d,variant:s,triggerRefs:g}=bo(),p=u.useRef(null),m=i===o,h=l(o);u.useEffect(()=>(p.current&&o&&(g.current[o]=p.current),()=>{o&&delete g.current[o]}),[o,g]);const f=x=>{x.preventDefault(),!t&&a(o)};return r.jsxs(c.View,{ref:p,onClick:f,cursor:t?"not-allowed":"pointer",opacity:t?.5:1,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:4,transition:"background-color 0.2s ease",...ft[d],...xt[s],...m?Ye.active:{},_hover:t?{}:Ye.hover,...n==null?void 0:n.trigger,children:[r.jsx(c.View,{display:"flex",alignItems:"center",children:e}),r.jsx(c.View,{transition:"transform 0.2s ease",transform:h?"rotate(180deg)":"rotate(0deg)",...n==null?void 0:n.indicator,children:r.jsx(ae,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},ta=({children:e,itemId:o,views:t})=>{const{isItemExpanded:n,orientation:i,triggerRefs:a}=bo(),l=u.useRef(null),[d,s]=u.useState({x:0,y:0,placement:i==="horizontal"?"bottom":"right"}),g=n(o);if(u.useEffect(()=>{if(g&&l.current&&o&&a.current[o]&&i==="horizontal"){const m=l.current.getBoundingClientRect(),h=a.current[o].getBoundingClientRect(),f=Math.max(m.width||200,200),x=Math.max(m.height||150,150),y=window.innerWidth,b=window.innerHeight,k={top:h.top,right:y-h.right,bottom:b-h.bottom,left:h.left},S=i==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8},{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top}]:[{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8}],w=S.find(M=>M.fits);if(w){s({x:w.x,y:w.y,placement:w.placement});return}const j=S.reduce((M,R)=>R.space>M.space?R:M);let C=j.x,I=j.y;C+f>y&&(C=y-f-8),C<8&&(C=8),I+x>b&&(I=b-x-8),I<8&&(I=8),s({x:C,y:I,placement:j.placement})}},[g,i,o,a]),!g)return null;if(i==="vertical")return r.jsx(c.View,{paddingLeft:16,width:"100%",position:"relative",backgroundColor:"transparent",...t==null?void 0:t.container,children:e});const p={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return r.jsx(c.View,{ref:l,role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:p,...t==null?void 0:t.container,children:e})},Cp=({href:e,children:o,views:t,...n})=>{const{itemValue:i,isDisabled:a}=jp(),{activeItemId:l,setActiveItemId:d,onItemActivate:s}=bo(),g=l===i,p=m=>{if(a){m.preventDefault();return}i&&(d(i),s&&s(i)),n.onClick&&n.onClick(m)};return r.jsx(c.View,{as:"a",href:a?void 0:e,onClick:p,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":g?"page":void 0,"aria-disabled":a,"data-active":g?"":void 0,"data-disabled":a?"":void 0,...g?{fontWeight:"bold"}:{},...t==null?void 0:t.container,...n,children:o})},Sp=({items:e,orientation:o,views:t,themeMode:n})=>{const i=o==="horizontal"?c.Horizontal:c.Vertical;return!e||e.length===0?null:r.jsx(i,{width:"100%",...Zn[o],...t==null?void 0:t.container,children:r.jsx(Dt,{views:t,children:e.map(a=>r.jsx(Ft,{item:a,views:t},a.id))})})},wp=({items:e,children:o,orientation:t="vertical",size:n="md",variant:i="default",defaultActiveItemId:a=null,defaultExpandedItemIds:l=[],onItemActivate:d,views:s,...g})=>{const{activeItemId:p,setActiveItemId:m,expandedItemIds:h,toggleExpandedItem:f,isItemExpanded:x,triggerRefs:y}=yp(a,l);return r.jsx(kp,{value:{activeItemId:p,setActiveItemId:m,expandedItemIds:h,toggleExpandedItem:f,isItemExpanded:x,orientation:t,size:n,variant:i,onItemActivate:d,triggerRefs:y},children:e?r.jsx(Sp,{items:e,orientation:t,size:n,variant:i,views:s,...g}):o})},Je=wp;Je.List=Dt;Je.Item=Ft;Je.Trigger=oa;Je.Content=ta;Je.Link=Cp;const ra={},na=u.createContext({views:ra,onRowClick:()=>{}}),Ip=({children:e,views:o=ra,onRowClick:t})=>r.jsx(na.Provider,{value:{views:o,onRowClick:t},children:e}),Ee=()=>u.useContext(na),de={table:{width:"100%",borderRadius:"8px",overflow:"hidden",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.04)",border:"1px solid",borderColor:"color-gray-200",transition:"box-shadow 0.2s ease",media:{mobile:{overflowX:"auto",display:"block",borderRadius:"4px"}}},thead:{backgroundColor:"color-gray-50",borderBottom:"1px solid",borderBottomColor:"color-gray-200"},th:{padding:"12px 16px",fontWeight:"600",fontSize:"14px",color:"color-gray-700",textAlign:"left",media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},td:{padding:"12px 16px",fontSize:"14px",borderBottom:"1px solid",borderBottomColor:"color-gray-100",color:"color-gray-900",media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},tr:{transition:"background-color 0.15s ease",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"}},tfoot:{backgroundColor:"color-gray-50",fontWeight:"600",borderTop:"2px solid",borderTopColor:"color-gray-200"},caption:{margin:"8px 0",color:"color-gray-600",fontSize:"14px",fontStyle:"italic",media:{mobile:{fontSize:"12px"}}}};({...de.th},{...de.td});({...de.tr});({...de.td},{...de.th});({...de.table},{...de.th}),{...de.td},{...de.tr},{...de.tfoot},{...de.caption};const aa=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"table",borderCollapse:"collapse",...de.table,...o==null?void 0:o.table,...e})},ia=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"thead",textAlign:"left",...de.thead,...o==null?void 0:o.thead,...e})},la=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"th",whiteSpace:"nowrap",...de.th,...o==null?void 0:o.th,...e})},Ro=e=>{const{views:o,onRowClick:t}=Ee();return r.jsx(c.Element,{as:"tr",...de.tr,...o==null?void 0:o.tr,onClick:t,...e})},bt=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e.isFirstColumn?"500":"400",...de.td,...o==null?void 0:o.td,...e})},ca=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"tbody",...de.tbody,...o==null?void 0:o.tbody,...e})},sa=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"tfoot",...de.tfoot,...o==null?void 0:o.tfoot,...e})},da=e=>{const{views:o}=Ee();return r.jsx(c.Element,{as:"caption",...de.caption,...o==null?void 0:o.caption,...e})},Tp=({data:e,columns:o,footer:t,caption:n,themeMode:i})=>r.jsxs(aa,{role:"Table",children:[n&&r.jsx(da,{children:n}),r.jsx(ia,{children:r.jsx(Ro,{children:o.map(a=>r.jsx(la,{children:a.title},a.field))})}),r.jsx(ca,{children:e.map((a,l)=>r.jsx(Ro,{children:o.map((d,s)=>r.jsx(bt,{isFirstColumn:s===0,children:a[d.field]},d.field))},l))}),t&&r.jsx(sa,{children:r.jsx(Ro,{children:t.map((a,l)=>r.jsx(bt,{...a.props,children:a.value},l))})})]}),Ce=({children:e,views:o,onClick:t})=>r.jsx(Ip,{views:o,onRowClick:t,children:e});Ce.Head=ia;Ce.HeadCell=la;Ce.Body=ca;Ce.Row=Ro;Ce.Cell=bt;Ce.Footer=sa;Ce.Caption=da;Ce.Container=aa;Ce.Template=Tp;const Mp=(e,o,t)=>{const n=g=>g.value!==void 0?g.value:g.title,i=()=>{if(!(!e||e.length===0)){if(o!==void 0){const g=e.find(p=>n(p)===o);if(g)return g}return e[0]}},[a,l]=u.useState(i()),d=t!==void 0?e.find(g=>n(g)===t):a,s=g=>{t===void 0&&l(g)};return u.useEffect(()=>{if(t!==void 0)return;const g=i(),p=a&&e.some(m=>n(m)===n(a));g&&(!p||o!==void 0&&a&&n(a)!==o)?l(g):!g&&a&&l(void 0)},[e,o]),{activeTab:d,setActiveTab:s}},zp=(e,o,t)=>{const[n,i]=u.useState(e||null);return{activeValue:o!==void 0?o:n,setActiveValue:d=>{o===void 0&&i(d),t&&t(d)}}},Rp=u.memo(({tab:e,isActive:o,onClick:t,iconPosition:n="left",tabStyles:i,textStyles:a})=>{const l=u.useMemo(()=>({display:"flex",alignItems:"center",justifyContent:"center",padding:"12px 16px",cursor:"pointer",borderBottom:"2px solid",borderBottomColor:o?"theme-primary":"transparent",backgroundColor:"transparent",color:o?"theme-primary":"color-gray-600",fontWeight:o?"600":"500",marginBottom:"-1px",transition:"all 0.2s ease",on:{hover:{color:"theme-primary",borderBottomColor:o?"theme-primary":"color-gray-300"}}}),[o]),d=()=>{switch(n){case"top":return"column";case"bottom":return"column-reverse";case"right":return"row-reverse";case"left":default:return"row"}},s=()=>["top","bottom"].includes(n)?"4px":"8px",g=e.icon&&u.isValidElement(e.icon)?u.cloneElement(e.icon,{strokeWidth:o?2.5:2}):e.icon;return r.jsxs(c.Element,{as:"div",role:"tab","aria-selected":o,tabIndex:o?0:-1,...l,...i,flexDirection:d(),gap:s(),onClick:t,"data-state":o?"active":"inactive",children:[g&&r.jsx(c.Element,{children:g},o?"active-icon":"inactive-icon"),r.jsxs(c.Element,{display:"grid",alignItems:"center",justifyContent:"center",children:[r.jsx(c.Text,{...a,fontWeight:"600",visibility:"hidden",gridColumn:"1",gridRow:"1","aria-hidden":"true",children:e.title}),r.jsx(c.Text,{...a,fontWeight:o?"600":"500",gridColumn:"1",gridRow:"1",children:e.title})]})]})}),Vp=({tabs:e=[],activeTab:o,handleTabClick:t,views:n={},renderTab:i,renderContent:a,iconPosition:l="left"})=>o?r.jsxs(c.Vertical,{width:"100%",height:"100%",...n.container,children:[r.jsx(c.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...n.headerTabs,children:e.map(d=>{const s=(d.value!==void 0?d.value:d.title)===(o.value!==void 0?o.value:o.title),g=()=>t(d);return i?i(d,s,g):r.jsx(Rp,{tab:d,isActive:s,onClick:g,iconPosition:l,tabStyles:{...n.tab,...s?n.activeTab:{}},textStyles:{...n.title,...s?n.activeText:{}}},d.title)})}),r.jsx(c.View,{width:"100%",height:"100%",...n.content,children:a?a(o):o.content})]}):null,ua=u.createContext(null),ga=()=>{const e=u.useContext(ua);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},Ep=u.memo(({children:e,views:o})=>r.jsx(c.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...o==null?void 0:o.container,children:e})),Pp=u.memo(({value:e,children:o,disabled:t=!1,views:n})=>{const{activeValue:i,setActiveValue:a}=ga(),l=i===e,d=u.useCallback(()=>{t||a(e)},[t,e,a]);return r.jsx(c.View,{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,padding:"12px 16px",borderBottom:"2px solid",borderBottomColor:l?"theme-primary":"transparent",color:l?"theme-primary":"color-gray-600",fontWeight:l?"600":"400",transition:"all 0.2s ease",_hover:t?{}:{color:"theme-primary"},onClick:d,...n==null?void 0:n.trigger,...l?n==null?void 0:n.activeState:{},children:o})}),Wp=u.memo(({value:e,children:o,views:t})=>{const{activeValue:n}=ga();return n!==e?null:r.jsx(c.View,{width:"100%",padding:"24px",...t==null?void 0:t.content,children:o})}),_p=({tabs:e,views:o,defaultValue:t,onTabChange:n,renderTab:i,renderContent:a,iconPosition:l="left",value:d,onValueChange:s,children:g})=>{const p=zp(t,d,s),m=Mp(e||[],t,d);if(g)return r.jsx(ua.Provider,{value:p,children:g});if(e){const h=f=>{const x=y=>y.value!==void 0?y.value:y.title;(!m.activeTab||x(m.activeTab)!==x(f))&&(m.setActiveTab(f),n&&n(f))};return r.jsx(Vp,{tabs:e,views:o,activeTab:m.activeTab,handleTabClick:h,renderTab:i,renderContent:a,iconPosition:l})}return null},$p=u.memo(_p),Zo=$p;Zo.List=Ep;Zo.Trigger=Pp;Zo.Content=Wp;const Hp=e=>{const{children:o,_isInView:t=!1,alternateHighlightText:n=[],alternateAnimation:i=!1,alternateDuration:a=3e3,highlightText:l,highlightTypewriter:d=!1,highlightSlide:s=!1,highlightSlideDuration:g=500,highlightSlideStagger:p=50,highlightSlideSequential:m=!0}=e,[h,f]=u.useState(o),[x,y]=u.useState(l);return u.useEffect(()=>{if(!i||n.length===0||!t||typeof o!="string"||typeof l!="string")return f(o),y(l),()=>{};const b=o,k=l;let S=0;const w=C=>{const I=n[C],M=k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(M,"gi"),V=b.replace(R,I);f(V),y(I)};w(S);const j=setInterval(()=>{S=(S+1)%n.length,w(S)},a);return()=>clearInterval(j)},[i,n,a,l,o,t]),{finalDisplayedText:h,activeHighlightTarget:x,highlightTypewriter:d,highlightSlide:s,highlightSlideDuration:g,highlightSlideStagger:p,highlightSlideSequential:m}},Bp={xs:24,sm:36,md:48,lg:64,xl:72},Lp={underline:e=>({textDecoration:"underline",textDecorationColor:e,textDecorationThickness:"4px",textUnderlineOffset:"4px"}),background:e=>({backgroundColor:e,color:"color-white",padding:"0 8px",borderRadius:"4px"}),gradient:(e,o)=>({background:`linear-gradient(135deg, ${e}, ${o||e})`,backgroundClip:"text",WebkitBackgroundClip:"text !important",WebkitTextFillColor:"transparent",color:"transparent",display:"inline-block",textShadow:"none"}),outline:e=>({WebkitTextStroke:`1px ${e}`,WebkitTextFillColor:"transparent !important",color:"transparent",textShadow:"none"}),glow:e=>({color:e,textShadow:`0 0 10px ${e}80, 0 0 20px ${e}40, 0 0 30px ${e}20`}),solid:e=>({color:e}),default:()=>({})},Ap=({text:e,typingSpeed:o=50,pauseTime:t=500,onComplete:n,showCursor:i=!0,cursorColor:a="currentColor",textStyle:l,textComponent:d,as:s,...g})=>{const p=d||c.Text,m=Array.isArray(e)?e:[e],[h,f]=u.useState(m.map(()=>"")),[x,y]=u.useState(!1),[b,k]=u.useState(0),[S,w]=u.useState(0);u.useEffect(()=>{f(m.map(()=>"")),y(!1),k(0),w(0)},[e]),u.useEffect(()=>{if(x){n&&n();return}const C=m[b];if(S>=C.length){if(b>=m.length-1){y(!0);return}const M=setTimeout(()=>{k(R=>R+1),w(0)},t);return()=>clearTimeout(M)}const I=setTimeout(()=>{f(M=>{const R=[...M];return R[b]=C.substring(0,S+1),R}),w(M=>M+1)},o);return()=>clearTimeout(I)},[m,b,S,x,n,t,o]);const j=C=>{if(!C||typeof C!="string")return C;const I=C.split("|");return I.length===1?C:I.map((M,R)=>r.jsxs(u.Fragment,{children:[M,R<I.length-1&&r.jsx("br",{})]},R))};return r.jsx(r.Fragment,{children:h.map((C,I)=>r.jsxs(u.Fragment,{children:[j(C),i&&I===b&&!x&&r.jsx(p,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:a,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...l})]},I))})},Dp=({text:e,duration:o=500,direction:t="up",stagger:n=50,sequential:i=!1,textStyle:a,as:l,wordProps:d,textComponent:s,...g})=>{const[p,m]=u.useState(e),[h,f]=u.useState("entering"),[x,y]=u.useState(0),b=s||c.Text,k=u.useRef(null),S=u.useRef(null);u.useEffect(()=>{e===p&&h==="visible"||e!==p&&(h==="entering"||h==="visible"?(k.current=e,f("exiting")):h==="exiting"&&(k.current=e))},[e,p,h]);const{lines:w,totalWordCount:j}=u.useMemo(()=>{const $=p.split("|").map(H=>H.trim().split(/\s+/).filter(L=>L.length>0)),E=$.reduce((H,L)=>H+L.length,0);return{lines:$,totalWordCount:E}},[p]),C=u.useMemo(()=>i?j*(o+n):(j-1)*n+o,[j,o,n,i]),I=u.useMemo(()=>i?j*(o+n):(j-1)*n+o,[j,o,n,i]);u.useEffect(()=>(S.current&&clearTimeout(S.current),h==="entering"?S.current=setTimeout(()=>{f("visible")},C+50):h==="exiting"&&(S.current=setTimeout(()=>{k.current!==null&&(m(k.current),k.current=null),y(z=>z+1),f("entering")},I+50)),()=>{S.current&&clearTimeout(S.current)}),[h,C,I]);const{style:M,...R}=d||{},V=t==="up",_=z=>i?z*(o+n):z*n,T=u.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",lineHeight:"normal",...a}),[a]),W=u.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),B=u.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let P=0;return r.jsx(c.Element,{as:"span",style:T,...g,children:r.jsx("span",{style:W,children:w.map((z,$)=>r.jsx("span",{style:B,children:z.map((E,H)=>{const L=P++,A=_(L),F=H===z.length-1;let D;const q=`${o}ms`,K=`${A}ms`;h==="entering"?D=V?c.Animation.slideInUp({duration:q,delay:K,timingFunction:"ease-out",fillMode:"both"}):c.Animation.slideInDown({duration:q,delay:K,timingFunction:"ease-out",fillMode:"both"}):h==="exiting"&&(D=V?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:q,delay:K,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:q,delay:K,timingFunction:"ease-in",fillMode:"both"});const Y={...M,display:"inline-block",marginRight:F?0:"0.25em",transform:h==="visible"?"translateY(0)":void 0,opacity:h==="visible"?1:void 0};return r.jsx(b,{as:"span",animate:D,...R,...Y,children:E},`${x}-${$}-${H}`)})},`line-${$}`))})})};function xr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ct=e=>{if(!e||typeof e!="string")return e;const o=e.split("|");return o.length===1?e:o.map((t,n)=>r.jsxs(u.Fragment,{children:[t,n<o.length-1&&r.jsx("br",{})]},n))},Fp=({children:e,highlightText:o,highlightStyle:t="solid",highlightColor:n="theme-primary",highlightSecondaryColor:i,size:a="lg",views:l,highlightAnimate:d,animate:s,animationLoop:g=1,highlightAnimationLoop:p=1,highlightTypewriter:m=!1,highlightTypewriterDuration:h=3e3,highlightSlide:f=!1,highlightSlideDuration:x=500,highlightSlideStagger:y=50,highlightSlideSequential:b=!0,themeMode:k,responsive:S,alternateHighlightText:w,alternateAnimation:j,alternateDuration:C,_isInView:I,...M})=>{const{ref:R,inView:V}=c.useInView(),{finalDisplayedText:_,activeHighlightTarget:T,highlightTypewriter:W,highlightSlide:B,highlightSlideDuration:P,highlightSlideStagger:z,highlightSlideSequential:$}=Hp({children:e,highlightText:o,_isInView:V,highlightTypewriter:m,highlightSlide:f,highlightSlideDuration:x,highlightSlideStagger:y,highlightSlideSequential:b,alternateHighlightText:w,alternateAnimation:j,alternateDuration:C,...M}),E=Bp[a],H=Lp[t](n,i),L=(Y,O)=>Y&&(Array.isArray(Y)?Y.map(X=>({...X,iterationCount:O.toString()})):{...Y,iterationCount:O.toString()}),A=L(s,g),F=L(d,p),D=typeof _=="string"?_:typeof e=="string"?e:"",q={ref:R,animate:V?A:void 0,as:"h1",fontSize:E},K=Y=>!V&&(W||B)?r.jsx("span",{style:{opacity:0},children:Y}):W?r.jsx(Ap,{text:Y,typingSpeed:Math.max(30,h/(Y.length*10)),cursorColor:"currentColor",...H}):B?r.jsx(Dp,{text:Y,duration:P,stagger:z,sequential:$,direction:"up",fontSize:E,wordProps:H}):ct(Y);if(typeof D=="string"&&T){const Y=Array.isArray(T)?new RegExp(`(${T.map(J=>xr(String(J))).join("|")})`,"gi"):new RegExp(`(${xr(String(T))})`,"gi"),O=[];let X=0,Z;for(;Z=Y.exec(D);)Z.index>X&&O.push(D.substring(X,Z.index)),O.push({highlight:!0,text:Z[0]}),X=Z.index+Z[0].length;return X<D.length&&O.push(D.substring(X)),r.jsx(c.Element,{...q,...l==null?void 0:l.container,...M,children:O.map((J,oe)=>typeof J=="string"?r.jsx(c.Text,{as:"span",display:"inline",...l==null?void 0:l.text,children:ct(J)},`text-${oe}`):r.jsx(c.Text,{as:"span",display:"inline",animate:V?F:void 0,...B?{}:H,...l==null?void 0:l.highlight,children:K(J.text)},`highlight-${oe}`))})}return t&&!T?r.jsx(c.Element,{...q,...M,...l==null?void 0:l.container,children:r.jsx(c.Text,{as:"span",display:"inline",animate:V?F:void 0,...B?{}:H,...l==null?void 0:l.highlight,children:K(D)})}):r.jsx(c.Text,{...q,...M,...l==null?void 0:l.container,...l==null?void 0:l.text,children:ct(D)})},Op=e=>r.jsx(Fp,{...e}),qp=Op,Np=({items:e,shape:o,variant:t,onToggleChange:n})=>{const{activeToggles:i,setActiveToggles:a}=On();return r.jsx(Nn,{items:e,shape:o,variant:t,activeToggles:i,setActiveToggles:a,onToggleChange:n})},Up=Np,Gp=({items:e,onChange:o})=>{const[t,n]=u.useState(e),[i,a]=u.useState(null),[l,d]=u.useState(null),s=u.useRef({x:0,y:0}),g=u.useRef([]),p=u.useCallback((f,x)=>{f.preventDefault(),document.body.style.cursor="grabbing";const y="touches"in f?f.touches[0].clientX:f.clientX,b="touches"in f?f.touches[0].clientY:f.clientY;s.current={x:y,y:b},d(x),a(t[x])},[t]),m=u.useCallback(f=>{if(l===null)return;const x="touches"in f?f.touches[0].clientX:f.clientX,y="touches"in f?f.touches[0].clientY:f.clientY,b=g.current[l];if(!b)return;const k=x-s.current.x,S=y-s.current.y;b.style.transform=`translate(${k}px, ${S}px)`,b.style.zIndex="1000";const w=g.current.findIndex((j,C)=>{if(!j||C===l)return!1;const I=j.getBoundingClientRect();return y>=I.top&&y<=I.bottom});if(w!==-1&&w!==l){const j=[...t],[C]=j.splice(l,1);j.splice(w,0,C),n(j),d(w),o==null||o(j),s.current={x,y}}},[l,t,o]),h=u.useCallback(()=>{document.body.style.cursor="",g.current.forEach(f=>{f&&(f.style.transform="",f.style.zIndex="")}),d(null),a(null)},[l]);return u.useEffect(()=>(l!==null&&(window.addEventListener("mousemove",m),window.addEventListener("touchmove",m),window.addEventListener("mouseup",h),window.addEventListener("touchend",h)),()=>{window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)}),[l,m,h]),{items:t,draggedItem:i,draggedIndex:l,itemRefs:g,handleDragStart:p}},Yp=({items:e,renderItem:o,containerProps:t,itemProps:n,draggedIndex:i,itemRefs:a,handleDragStart:l,views:d,themeMode:s})=>r.jsx(c.View,{overflow:"hidden",position:"relative",...t,...d==null?void 0:d.container,children:e.map((g,p)=>r.jsx(c.View,{ref:m=>a.current[p]=m,onMouseDown:m=>l(m,p),onTouchStart:m=>l(m,p),position:"relative",cursor:"grab",transition:"transform 0.2s",...n,...d==null?void 0:d.item,children:o?o(g,p):g},p))}),pa=e=>{const{items:o,draggedIndex:t,itemRefs:n,handleDragStart:i}=Gp(e);return r.jsx(Yp,{...e,items:o,draggedIndex:t,itemRefs:n,handleDragStart:i})},vp=pa,Xp=({onFileSelect:e,onMultipleFileSelect:o,validateFile:t,accept:n,multiple:i,disabled:a,previewUrl:l})=>{const[d,s]=u.useState(!1),[g,p]=u.useState(null),m=u.useRef(null),h=l!==void 0?l:g;u.useEffect(()=>()=>{g&&URL.revokeObjectURL(g)},[g]);const f=u.useCallback(j=>{j.preventDefault(),j.stopPropagation(),!a&&s(!0)},[a]),x=u.useCallback(j=>{j.preventDefault(),j.stopPropagation(),!a&&s(!1)},[a]),y=u.useCallback(j=>{j.preventDefault(),j.stopPropagation(),!a&&s(!0)},[a]),b=u.useCallback(j=>{if(!j||j.length===0)return;const C=Array.from(j);if(!i&&C.length>0){const I=C[0];if(I.type.startsWith("image/")){const M=URL.createObjectURL(I);p(R=>(R&&URL.revokeObjectURL(R),M))}else p(null)}i?o&&o(C):C.length>0&&e&&e(C[0])},[i,o,e]),k=u.useCallback(j=>{j.preventDefault(),j.stopPropagation(),s(!1),!a&&j.dataTransfer.files&&j.dataTransfer.files.length>0&&(b(j.dataTransfer.files),j.dataTransfer.clearData())},[a,b]),S=u.useCallback(()=>{var j;a||(j=m.current)==null||j.click()},[a]),w=u.useCallback(j=>{b(j.target.files),j.target.value&&(j.target.value="")},[b]);return{isDragActive:d,handleDragEnter:f,handleDragLeave:x,handleDragOver:y,handleDrop:k,handleClick:S,handleFileChange:w,inputRef:m,preview:h}},Kp={position:"absolute",top:"-4px",right:"-4px",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",border:"none",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"12px",zIndex:10,_hover:{backgroundColor:"rgba(0, 0, 0, 0.7)"}},ma=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:i="120px",showPreviews:a=!1,views:l={}})=>{if(e.length===0)return null;const d=u.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(c.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:i,overflowY:"auto",...l==null?void 0:l.container,children:e.map((s,g)=>{const p=URL.createObjectURL(s)||(s==null?void 0:s.path)||(s==null?void 0:s.url)||"",m=s.type.startsWith("image/"),h=s.type.startsWith("video/"),f=s.type.startsWith("audio/");return r.jsx(c.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...l==null?void 0:l.item,children:a&&r.jsxs(he,{children:[r.jsxs(he.Trigger,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,width:"60px",height:"60px",objectFit:"cover"}),h&&r.jsx(c.View,{as:"video",src:p,alt:s.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(Fo,{widthHeight:24,color:"color-black"})}),!m&&!h&&!f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(go,{widthHeight:24,color:"color-black"})}),t&&r.jsx(c.Button,{...Kp,onClick:x=>{x.stopPropagation(),t(g)},"aria-label":`Remove ${s.name}`,children:"×"})]}),r.jsxs(he.Content,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,maxWidth:"100%"}),h&&r.jsx(c.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),f&&r.jsx(c.View,{as:"audio",src:p,controls:!0,width:"100%"}),r.jsxs(c.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...l==null?void 0:l.name,children:[s.name," (",d(s.size),")"]})]})]})},g)})})},Qp=({children:e,text:o="Drop files here or click to upload",textProps:t,containerProps:n,disabled:i,accept:a,multiple:l,isDragActive:d,handleDragEnter:s,handleDragLeave:g,handleDragOver:p,handleDrop:m,handleClick:h,handleFileChange:f,inputRef:x,preview:y,imageProps:b,selectedFiles:k,onRemove:S})=>r.jsxs(c.Center,{width:"100%",minHeight:"200px",height:k&&k.length>0?"auto":"200px",borderWidth:2,borderStyle:"dashed",borderColor:d?"primary":"rgba(0,0,0,0.1)",borderRadius:12,backgroundColor:d?"rgba(0,0,0,0.02)":"transparent",flexDirection:"column",cursor:i?"not-allowed":"pointer",opacity:i?.6:1,onClick:h,onDragEnter:s,onDragLeave:g,onDragOver:p,onDrop:m,transition:"all 0.2s ease-in-out",overflow:"hidden",position:"relative",padding:16,...n,children:[r.jsx("input",{type:"file",ref:x,onChange:f,accept:a,multiple:l,style:{display:"none"},disabled:i}),y&&!l?r.jsxs(c.View,{width:"100%",height:"200px",position:"relative",children:[r.jsx(c.Image,{src:y,alt:"Preview",width:"100%",height:"100%",objectFit:"contain",...b}),r.jsx(c.Center,{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.3)",opacity:0,_hover:{opacity:1},transition:"opacity 0.2s",children:r.jsx(c.Text,{color:"white",fontWeight:600,children:"Click to replace"})})]}):r.jsxs(c.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[e||r.jsxs(c.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[r.jsx(Vt,{widthHeight:40,color:d?"primary":"rgba(0,0,0,0.4)"}),r.jsx(c.Text,{marginTop:16,color:d?"primary":"rgba(0,0,0,0.6)",fontWeight:500,textAlign:"center",...t,children:o})]}),l&&k&&k.length>0&&r.jsx(c.View,{marginTop:16,width:"100%",children:r.jsx(ma,{files:k,onRemove:S||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),Zp=e=>{const o=Xp(e);return r.jsx(Qp,{...e,...o})},Jp=(e=!1)=>{const[o,t]=u.useState(e),[n,i]=u.useState(null);return u.useEffect(()=>{const a=s=>{!s.composedPath().some(m=>(m==null?void 0:m.id)==="dropdown-menu"||(m==null?void 0:m.id)==="dropdown-trigger")&&o&&(t(!1),i(null))},l=()=>{o&&(t(!1),i(null))},d=s=>{s.key==="Escape"&&o&&(t(!1),i(null))};return document.addEventListener("mousedown",a),window.addEventListener("resize",l),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",a),window.removeEventListener("resize",l),document.removeEventListener("keydown",d)}},[o]),{isOpen:o,setIsOpen:t,activeSubmenuId:n,setActiveSubmenuId:i}},em={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},om={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},tm={hover:{backgroundColor:"color-gray-100"}},ha=u.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),rm=({children:e,value:o})=>r.jsx(ha.Provider,{value:o,children:e}),Ot=()=>{const e=u.useContext(ha);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},fa=({children:e,views:o,...t})=>{const{isOpen:n,setIsOpen:i,triggerRef:a}=Ot(),l=d=>{d.stopPropagation(),i(!n)};return r.jsx(c.View,{ref:a,id:"dropdown-trigger",onClick:l,cursor:"pointer",position:"relative",display:"inline-block",...o==null?void 0:o.container,...t,children:e})},qt=({items:e,side:o="bottom",align:t="start",views:n,...i})=>{const{isOpen:a,variant:l,triggerRef:d}=Ot(),s=u.useRef(null),{ref:g,relation:p}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[m,h]=u.useState({x:0,y:0,placement:o});if(u.useEffect(()=>{d.current&&g&&(g.current=d.current)},[d,g,a]),u.useEffect(()=>{if(a&&s.current&&d.current){const y=d.current.getBoundingClientRect();let b=o;p&&(o==="bottom"&&p.space.vertical==="top"?b="top":o==="top"&&p.space.vertical==="bottom"?b="bottom":o==="right"&&p.space.horizontal==="left"?b="left":o==="left"&&p.space.horizontal==="right"&&(b="right"));let k=0,S=0;switch(b){case"bottom":k=t==="start"?y.left:t==="end"?y.right-180:y.left+y.width/2-90,S=y.bottom+8;break;case"top":k=t==="start"?y.left:t==="end"?y.right-180:y.left+y.width/2-90,S=y.top-8;break;case"right":k=y.right+8,S=t==="start"?y.top:t==="end"?y.bottom-100:y.top+y.height/2-50;break;case"left":k=y.left-8,S=t==="start"?y.top:t==="end"?y.bottom-100:y.top+y.height/2-50;break}h({x:k,y:S,placement:b})}},[a,o,t,d,p]),!a)return null;const x=(()=>{const y={position:"fixed",left:m.x,top:m.y,zIndex:1e3};switch(m.placement){case"top":return{...y,transform:"translateY(-100%)"};case"left":return{...y,transform:"translateX(-100%)"};case"bottom":case"right":default:return y}})();return r.jsx(c.View,{ref:s,id:"dropdown-menu",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:x,...om[l],...n==null?void 0:n.menu,...i,children:e.map((y,b)=>y.divider?r.jsx(ba,{views:n},`divider-${b}`):r.jsx(xa,{item:y,views:n},y.id))})},xa=({item:e,views:o,...t})=>{const{activeSubmenuId:n,setActiveSubmenuId:i,size:a}=Ot(),[l,d]=u.useState(!1),s=e.items&&e.items.length>0,g=n===e.id,p=u.useRef(null),m=()=>{d(!0),s&&i(e.id)},h=()=>{d(!1)},f=x=>{x.stopPropagation(),!e.disabled&&!s&&e.onClick&&e.onClick()};return r.jsxs(c.View,{ref:p,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...em[a],_hover:e.disabled?{}:tm.hover,backgroundColor:l&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:m,onMouseLeave:h,onClick:f,...o==null?void 0:o.item,...t,children:[e.icon&&r.jsx(c.View,{marginRight:8,...o==null?void 0:o.icon,children:e.icon}),r.jsx(c.View,{flexGrow:1,children:e.label}),s&&r.jsx(c.View,{marginLeft:8,...o==null?void 0:o.submenuIndicator,children:r.jsx(ae,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),g&&s&&r.jsx(qt,{items:e.items||[],side:"right",align:"start",views:o})]})},ba=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...o}),nm=({trigger:e,items:o,side:t="bottom",align:n="start",views:i,themeMode:a,...l})=>r.jsxs(c.View,{position:"relative",display:"inline-block",...i==null?void 0:i.container,...l,children:[r.jsx(fa,{views:i,children:e}),r.jsx(qt,{items:o,side:t,align:n,views:i})]}),am=({trigger:e,items:o,size:t="md",variant:n="default",side:i="bottom",align:a="start",defaultOpen:l=!1,views:d,...s})=>{const{isOpen:g,setIsOpen:p,activeSubmenuId:m,setActiveSubmenuId:h}=Jp(l),f=u.useRef(null);return r.jsx(rm,{value:{isOpen:g,setIsOpen:p,activeSubmenuId:m,setActiveSubmenuId:h,size:t,variant:n,triggerRef:f},children:r.jsx(nm,{trigger:e,items:o,side:i,align:a,views:d,...s})})},yo=am;yo.Trigger=fa;yo.Content=qt;yo.Item=xa;yo.Divider=ba;const im=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:i,isOpen:a,onOpen:l,onClose:d,closeOnSelect:s=!0,maxRecentColors:g=8,showRecentColors:p=!0}=e,[m,h]=u.useState(a??!1),[f,x]=u.useState(o??t),[y,b]=u.useState(""),[k,S]=u.useState([]),w=u.useRef(null),j=u.useRef(null);u.useEffect(()=>{o!==void 0&&x(o)},[o]),u.useEffect(()=>{a!==void 0&&h(a)},[a]),u.useEffect(()=>{if(p){const T=localStorage.getItem("colorPicker-recentColors");if(T)try{S(JSON.parse(T))}catch{}}},[p]),u.useEffect(()=>{const T=W=>{m&&w.current&&j.current&&!w.current.contains(W.target)&&!j.current.contains(W.target)&&_()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[m]);const C=u.useCallback(T=>{p&&S(W=>{const B=W.filter(z=>z!==T),P=[T,...B].slice(0,g);return localStorage.setItem("colorPicker-recentColors",JSON.stringify(P)),P})},[p,g]),I=u.useCallback(()=>{const T=!m;h(T),T?l==null||l():d==null||d()},[m,l,d]),M=u.useCallback(T=>{x(T),C(T),n==null||n(T),i==null||i(T),s&&(h(!1),d==null||d())},[n,i,s,d,C]),R=u.useCallback(T=>{b(T)},[]),V=u.useCallback(()=>{y&&(M(y),b(""))},[y,M]),_=u.useCallback(()=>{h(!1),d==null||d()},[d]);return{isOpen:m,selectedColor:f,recentColors:k,customColor:y,handleToggle:I,handleColorSelect:M,handleCustomColorChange:R,handleCustomColorSubmit:V,handleClose:_,triggerRef:w,dropdownRef:j}},qe={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"8px",marginBottom:"16px"},customInput:{marginBottom:"12px"},recentColors:{borderTop:"1px solid color-gray-200",paddingTop:"12px"}},lm={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},cm={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},sm={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},dm=[{name:"Blue 500",value:"color-blue-500",category:"primary"},{name:"Purple 500",value:"color-purple-500",category:"primary"},{name:"Pink 500",value:"color-pink-500",category:"primary"},{name:"Red 500",value:"color-red-500",category:"primary"},{name:"Orange 500",value:"color-orange-500",category:"primary"},{name:"Yellow 500",value:"color-yellow-500",category:"primary"},{name:"Green 500",value:"color-green-500",category:"primary"},{name:"Teal 500",value:"color-teal-500",category:"primary"},{name:"Blue 300",value:"color-blue-300",category:"light"},{name:"Purple 300",value:"color-purple-300",category:"light"},{name:"Pink 300",value:"color-pink-300",category:"light"},{name:"Red 300",value:"color-red-300",category:"light"},{name:"Orange 300",value:"color-orange-300",category:"light"},{name:"Yellow 300",value:"color-yellow-300",category:"light"},{name:"Green 300",value:"color-green-300",category:"light"},{name:"Teal 300",value:"color-teal-300",category:"light"},{name:"Blue 700",value:"color-blue-700",category:"dark"},{name:"Purple 700",value:"color-purple-700",category:"dark"},{name:"Pink 700",value:"color-pink-700",category:"dark"},{name:"Red 700",value:"color-red-700",category:"dark"},{name:"Orange 700",value:"color-orange-700",category:"dark"},{name:"Yellow 700",value:"color-yellow-700",category:"dark"},{name:"Green 700",value:"color-green-700",category:"dark"},{name:"Teal 700",value:"color-teal-700",category:"dark"},{name:"Gray 100",value:"color-gray-100",category:"neutral"},{name:"Gray 300",value:"color-gray-300",category:"neutral"},{name:"Gray 500",value:"color-gray-500",category:"neutral"},{name:"Gray 700",value:"color-gray-700",category:"neutral"},{name:"Gray 900",value:"color-gray-900",category:"neutral"},{name:"Black",value:"color-black",category:"neutral"},{name:"White",value:"color-white",category:"neutral"}],um=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",error:g=!1,isDisabled:p=!1,isReadOnly:m=!1,predefinedColors:h=dm,showCustomInput:f=!0,showRecentColors:x=!0,isOpen:y,selectedColor:b,recentColors:k,customColor:S,handleToggle:w,handleColorSelect:j,handleCustomColorChange:C,handleCustomColorSubmit:I,triggerRef:M,dropdownRef:R,onChange:V,..._})=>{const{getColor:T}=c.useTheme(),W={...qe.container,...a==null?void 0:a.container},B={...qe.trigger,...lm[l],...cm[d],...sm[s],...g&&{borderColor:"color-red-500"},...p&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},P={...qe.dropdown,...a==null?void 0:a.dropdown},z={...qe.colorGrid,...a==null?void 0:a.colorGrid},$={...qe.recentColors,...a==null?void 0:a.recentColors},E=b||"color-gray-200";return r.jsxs(c.View,{...W,..._,children:[t&&r.jsx(c.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:M,onClick:p||m?void 0:w,...B,children:[r.jsxs(c.Horizontal,{alignItems:"center",gap:8,children:[r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:E,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),r.jsx(c.Text,{color:b?"color-gray-800":"color-gray-500",fontSize:"inherit",children:b||n})]}),!m&&!p&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:y?"up":"down"})]}),y&&r.jsxs(c.View,{ref:R,...P,children:[r.jsx(c.View,{...z,children:h.map((H,L)=>r.jsx(c.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:H.value,borderWidth:"2px",borderStyle:"solid",borderColor:b===H.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>j(H.value),title:H.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},L))}),f&&r.jsxs(c.View,{...qe.customInput,...a==null?void 0:a.customInput,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",marginBottom:"8px",children:[r.jsx("input",{type:"color",value:S||"#000000",onChange:H=>{const L=H.target.value;C(L),j(L)},style:{width:"40px",height:"32px",border:"1px solid #d1d5db",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},title:"Pick a color"}),r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",children:"Use native color picker"})]}),r.jsx(xo,{placeholder:"Enter hex color (e.g., #ff0000)",value:S,onChange:H=>C(H.target.value),onKeyPress:H=>{H.key==="Enter"&&I()},size:"sm",right:S&&r.jsx(c.View,{width:"16px",height:"16px",borderRadius:"2px",backgroundColor:S,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:I})})]}),x&&k.length>0&&r.jsxs(c.View,{...$,children:[r.jsx(c.Text,{fontWeight:"500",color:"color-gray-600",marginBottom:"8px",children:"Recent Colors"}),r.jsx(c.Horizontal,{gap:8,flexWrap:"wrap",children:k.map((H,L)=>r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:H,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:()=>j(H),title:H,_hover:{transform:"scale(1.1)"}},L))})]})]}),i&&r.jsx(c.Text,{color:g?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i})]})},gm=e=>{const o=im(e);return r.jsx(um,{...o,...e})},pm=gm,mm=e=>{const o=Yn(e);return r.jsx(vn,{...o,...e})},hm=mm,fm=e=>{const o=Un(e);return r.jsx(Gn,{...o,...e})},xm=fm,bm=(e=null,o=null)=>{const[t,n]=u.useState(e),[i,a]=u.useState(o),l=s=>i===s,d=s=>{a(g=>g===s?null:s)};return u.useEffect(()=>{const s=p=>{!p.composedPath().some(f=>(f==null?void 0:f.id)==="menubar-content"||(f==null?void 0:f.id)==="menubar-trigger")&&i!==null&&a(null)},g=p=>{p.key==="Escape"&&i!==null&&a(null)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",g)}},[i]),{activeMenuId:t,setActiveMenuId:n,openMenuId:i,setOpenMenuId:a,isMenuOpen:l,toggleMenu:d}},ya={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},ym={default:{backgroundColor:"transparent",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},km={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Vo={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},ka=u.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),Jo=()=>u.useContext(ka),jm=({value:e,children:o})=>r.jsx(ka.Provider,{value:e,children:o}),ja=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",views:i,...a})=>{const l=o==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(l,{role:"menubar","aria-orientation":o,...km[o],...ym[n],...i==null?void 0:i.container,...a,children:e})},Ca=({children:e,id:o,disabled:t=!1,views:n})=>{const{orientation:i}=Jo(),a=i==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(a,{role:"none",position:"relative",opacity:t?.5:1,pointerEvents:t?"none":"auto",...n==null?void 0:n.menu,children:u.Children.map(e,l=>u.isValidElement(l)?u.cloneElement(l,{...l.props,menuId:o}):l)})},Sa=({children:e,menuId:o,disabled:t=!1,views:n})=>{const{activeMenuId:i,setActiveMenuId:a,toggleMenu:l,isMenuOpen:d,size:s,triggerRefs:g}=Jo(),p=u.useRef(null),m=i===o,h=d(o);u.useEffect(()=>(p.current&&o&&(g.current[o]=p.current),()=>{o&&delete g.current[o]}),[o,g]);const f=()=>{t||(a(o),l(o))};return r.jsx(c.View,{ref:p,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":h,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...ya[s],...m?Vo.active:{},...t?Vo.disabled:{},_hover:t?{}:Vo.hover,onClick:f,...n==null?void 0:n.trigger,children:e})},wa=({children:e,menuId:o,views:t})=>{const{isMenuOpen:n,orientation:i,triggerRefs:a}=Jo(),l=u.useRef(null),[d,s]=u.useState({x:0,y:0,placement:i==="horizontal"?"bottom":"right"}),g=n(o);if(u.useEffect(()=>{if(g&&l.current&&o&&a.current[o]){const m=l.current.getBoundingClientRect(),h=a.current[o].getBoundingClientRect(),f=Math.max(m.width||200,200),x=Math.max(m.height||150,150),y=window.innerWidth,b=window.innerHeight,k={top:h.top,right:y-h.right,bottom:b-h.bottom,left:h.left},S=i==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8},{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top}]:[{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8}],w=S.find(M=>M.fits);if(w){s({x:w.x,y:w.y,placement:w.placement});return}const j=S.reduce((M,R)=>R.space>M.space?R:M);let C=j.x,I=j.y;C+f>y&&(C=y-f-8),C<8&&(C=8),I+x>b&&(I=b-x-8),I<8&&(I=8),s({x:C,y:I,placement:j.placement})}},[g,i,o,a]),!g)return null;const p={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return r.jsx(c.View,{ref:l,id:"menubar-content",role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:p,...t==null?void 0:t.content,children:e})},Ia=({children:e,icon:o,disabled:t=!1,onClick:n,views:i})=>{const{size:a}=Jo(),l=()=>{t||!n||n()};return r.jsxs(c.View,{role:"menuitem",cursor:t?"not-allowed":"pointer",userSelect:"none",display:"flex",alignItems:"center",opacity:t?.5:1,...ya[a],_hover:t?{}:Vo.hover,onClick:l,...i==null?void 0:i.item,children:[o&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:o}),e]})},Ta=({views:e})=>r.jsx(c.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),Cm=({items:e,orientation:o,size:t,variant:n,views:i,themeMode:a})=>r.jsx(ja,{orientation:o,size:t,variant:n,views:i,children:e.map(l=>r.jsxs(Ca,{id:l.id,disabled:l.disabled,views:i,children:[r.jsxs(Sa,{menuId:l.id,views:i,children:[l.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:l.icon}),l.label]}),l.items&&l.items.length>0&&r.jsx(wa,{menuId:l.id,views:i,children:l.items.map((d,s)=>d.separator?r.jsx(Ta,{views:i},`separator-${s}`):r.jsx(Ia,{id:d.id,icon:d.icon,disabled:d.disabled,onClick:d.onClick,views:i,children:d.label},d.id))})]},l.id))}),Sm=({items:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultActiveMenuId:i=null,defaultOpenMenuId:a=null,views:l,...d})=>{const{activeMenuId:s,setActiveMenuId:g,openMenuId:p,setOpenMenuId:m,isMenuOpen:h,toggleMenu:f}=bm(i,a),x=u.useRef({});return r.jsx(jm,{value:{activeMenuId:s,setActiveMenuId:g,openMenuId:p,setOpenMenuId:m,isMenuOpen:h,toggleMenu:f,orientation:o,size:t,variant:n,triggerRefs:x},children:r.jsx(Cm,{items:e,orientation:o,size:t,variant:n,views:l,...d})})},Le=Sm;Le.Root=ja;Le.Menu=Ca;Le.Trigger=Sa;Le.Content=wa;Le.Item=Ia;Le.Separator=Ta;const wm=(e,o,t)=>{const[n,i]=u.useState([]);return u.useEffect(()=>{i((()=>{const l=[];if(o<=t)for(let d=1;d<=o;d++)l.push(d);else{l.push(1);let d=Math.max(2,e-Math.floor((t-2)/2)),s=Math.min(o-1,d+t-3);s>=o-1&&(s=o-1,d=Math.max(2,s-(t-3))),d>2&&l.push("...");for(let g=d;g<=s;g++)l.push(g);s<o-1&&l.push("..."),l.push(o)}return l})())},[e,o,t]),{visiblePageNumbers:n}},Ne={sm:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px",media:{mobile:{fontSize:"11px",padding:"3px 6px",minWidth:"24px",height:"24px"}}},md:{fontSize:"14px",padding:"6px 12px",minWidth:"36px",height:"36px",media:{mobile:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px"}}},lg:{fontSize:"16px",padding:"8px 16px",minWidth:"44px",height:"44px",media:{mobile:{fontSize:"14px",padding:"6px 12px",minWidth:"36px",height:"36px"}}}},io={default:{backgroundColor:"transparent",color:"color-gray-800",_hover:{backgroundColor:"color-gray-100"}},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",_hover:{backgroundColor:"color-gray-200"}},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",_hover:{backgroundColor:"color-gray-100"}}},lo={rounded:{borderRadius:"4px"},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},Im={backgroundColor:"color-blue-500",color:"color-white",_hover:{backgroundColor:"color-blue-600"}},Io={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},Tm=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:i=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"100 / page",value:100}],onPageSizeChange:a,showPageSizeSelector:l=!1,showPageInfo:d=!0,maxPageButtons:s=5,showFirstLastButtons:g=!1,size:p="md",variant:m="default",shape:h="rounded",visiblePageNumbers:f,views:x,...y})=>{const b=w=>{w<1||w>o||w===e||t(w)},k=w=>{a&&a(Number(w.target.value))},S=(w,j)=>{if(w==="...")return r.jsx(c.View,{display:"flex",alignItems:"center",justifyContent:"center",...Ne[p],...x==null?void 0:x.ellipsis,children:"..."},`ellipsis-${j}`);const C=w===e;return r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:C?"default":"pointer",...Ne[p],...io[m],...lo[h],...C?Im:{},onClick:()=>b(w),"aria-label":`Page ${w}`,"aria-current":C?"page":void 0,...C?x==null?void 0:x.activePageButton:x==null?void 0:x.pageButton,children:w},`page-${w}`)};return r.jsxs(c.Horizontal,{alignItems:"center",gap:8,...x==null?void 0:x.container,...y,children:[g&&r.jsxs(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Ne[p],...io[m],...lo[h],...e===1?Io:{},onClick:()=>b(1),"aria-label":"First page",disabled:e===1,...x==null?void 0:x.navigationButton,children:[r.jsx(ae,{orientation:"left",widthHeight:16}),r.jsx(ae,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Ne[p],...io[m],...lo[h],...e===1?Io:{},onClick:()=>b(e-1),"aria-label":"Previous page",disabled:e===1,...x==null?void 0:x.navigationButton,children:r.jsx(ae,{orientation:"left",widthHeight:16})}),f.map((w,j)=>S(w,j)),r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Ne[p],...io[m],...lo[h],...e===o?Io:{},onClick:()=>b(e+1),"aria-label":"Next page",disabled:e===o,...x==null?void 0:x.navigationButton,children:r.jsx(ae,{orientation:"right",widthHeight:16})}),g&&r.jsxs(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Ne[p],...io[m],...lo[h],...e===o?Io:{},onClick:()=>b(o),"aria-label":"Last page",disabled:e===o,...x==null?void 0:x.navigationButton,children:[r.jsx(ae,{orientation:"right",widthHeight:16}),r.jsx(ae,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),d&&r.jsxs(c.Text,{marginLeft:16,color:"color-gray-600",...x==null?void 0:x.pageInfo,children:["Page ",e," of ",o]}),l&&a&&r.jsx(c.View,{as:"select",marginLeft:16,padding:"4px 8px",borderRadius:"4px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",cursor:"pointer",value:n,onChange:k,...x==null?void 0:x.pageSizeSelector,children:i.map(w=>r.jsx("option",{value:w.value,children:w.label},w.value))})]})},Mm=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:i,onPageSizeChange:a,showPageSizeSelector:l=!1,showPageInfo:d=!0,maxPageButtons:s=5,showFirstLastButtons:g=!1,size:p="md",variant:m="default",shape:h="rounded",views:f,...x})=>{const{visiblePageNumbers:y}=wm(e,o,s);return r.jsx(Tm,{currentPage:e,totalPages:o,onPageChange:t,pageSize:n,pageSizeOptions:i,onPageSizeChange:a,showPageSizeSelector:l,showPageInfo:d,maxPageButtons:s,showFirstLastButtons:g,size:p,variant:m,shape:h,visiblePageNumbers:y,views:f,...x})},zm=Mm,Rm=u.memo(({shape:e="linear",value:o=0,max:t=100,color:n="theme-primary",backgroundColor:i="color-gray-200",height:a,size:l,radius:d=4,strokeWidth:s=10,showLabel:g=!1,labelColor:p="theme-text-primary",animated:m=!0,animationDuration:h="0.5s",views:f,themeMode:x,...y})=>{const{getColor:b,themeMode:k}=c.useTheme(),S=x||k,j=Math.min(t,Math.max(0,o))/t*100,C=u.useMemo(()=>b(i,{themeMode:S}),[b,i,S]),I=u.useMemo(()=>b(n,{themeMode:S}),[b,n,S]);if(e==="circle"){const R=l||(typeof a=="number"?a:100),V=(R-s)/2,_=2*Math.PI*V,T=_-j/100*_;return r.jsxs(c.View,{width:R,height:R,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...f==null?void 0:f.container,...y,children:[r.jsxs("svg",{width:R,height:R,viewBox:`0 0 ${R} ${R}`,style:{transform:"rotate(-90deg)"},children:[r.jsx("circle",{cx:R/2,cy:R/2,r:V,stroke:C,strokeWidth:s,fill:"transparent",...f==null?void 0:f.track}),r.jsx("circle",{cx:R/2,cy:R/2,r:V,stroke:I,strokeWidth:s,strokeDasharray:_,strokeDashoffset:T,strokeLinecap:"round",fill:"transparent",style:{transition:m?`stroke-dashoffset ${h} ease-in-out`:"none"},...f==null?void 0:f.indicator})]}),g&&r.jsx(c.View,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",children:r.jsxs(c.Text,{color:p,fontSize:`${R*.2}px`,fontWeight:"bold",...f==null?void 0:f.text,children:[Math.round(j),"%"]})})]})}const M=a||8;return r.jsx(c.View,{role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":t,width:"100%",height:M,backgroundColor:C,borderRadius:d,overflow:"hidden",...f==null?void 0:f.container,...y,children:r.jsx(c.View,{width:`${j}%`,height:"100%",backgroundColor:I,borderRadius:d,style:{transition:m?`width ${h} ease-in-out`:"none"},...f==null?void 0:f.bar})})}),Vm=e=>r.jsx(Rm,{...e}),Em=Vm,Pm=e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}),Wm=Pm(),_m={thin:"1px",medium:"2px",thick:"4px"},co={container:{transition:"opacity 0.15s ease"},label:{fontSize:"14px",fontWeight:"500",color:"color-gray-600",paddingHorizontal:"8px",backgroundColor:"color-white",transition:"color 0.15s ease"}},$m=({orientation:e="horizontal",variant:o="solid",thickness:t="thin",color:n,spacing:i="0px",label:a,decorative:l=!1,views:d,themeMode:s,...g})=>{const{themeMode:p}=c.useTheme(),m=n||"color-gray-200",h=Wm[o],f=_m[t],x=l?{"aria-hidden":!0}:{role:"separator","aria-orientation":e};return a&&e==="horizontal"?r.jsxs(c.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:i,...x,...g,children:[r.jsx(c.View,{height:"0px",flexGrow:1,borderTopWidth:f,borderTopStyle:h,borderTopColor:m,...co.container,...d==null?void 0:d.container}),r.jsx(c.Text,{...co.label,...d==null?void 0:d.label,children:a}),r.jsx(c.View,{height:"0px",flexGrow:1,borderTopWidth:f,borderTopStyle:h,borderTopColor:m,...co.container,...d==null?void 0:d.container})]}):e==="horizontal"?r.jsx(c.View,{height:"0px",width:"100%",borderTopWidth:f,borderTopStyle:h,borderTopColor:m,padding:i,...co.container,...x,...d==null?void 0:d.container,...g}):r.jsx(c.View,{width:"0px",height:"100%",borderLeftWidth:f,borderLeftStyle:h,borderLeftColor:m,padding:i,...co.container,...x,...d==null?void 0:d.container,...g})},Ma=e=>r.jsx($m,{...e}),Hm=Ma,Bm=Ma,Lm={xs:12,sm:14,md:16,lg:18,xl:20},Am=({isSupported:e,isSharing:o,onShare:t,label:n,children:i,icon:a,size:l,isDisabled:d,isLoading:s,iconPosition:g,disableWhenUnsupported:p=!0,...m})=>{const h=l??"md",f=a??r.jsx(Vr,{widthHeight:Lm[h],strokeWidth:1.5,filled:!1}),x=!!d||!e&&p,y=!!s||o;return r.jsx(_e,{...m,size:h,icon:f,iconPosition:g??"left",isDisabled:x,isLoading:y,onClick:t,children:i??n??"Share"})},br=()=>typeof navigator>"u"?void 0:navigator,Dm=(e,o)=>{if(!e||typeof e.share!="function")return!1;if(typeof e.canShare=="function")try{return e.canShare(o)}catch{return!1}return!0},Fm=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},Om=e=>{const{shareData:o,onClick:t,onUnsupported:n,onShareStart:i,onShareSuccess:a,onShareCancel:l,onShareError:d}=e,[s,g]=u.useState(!1),p=u.useMemo(()=>Dm(br(),o),[o]),m=u.useCallback((...h)=>{t==null||t(...h);const f=br();if(!f||typeof f.share!="function"){n==null||n();return}if(!s){if(typeof f.canShare=="function")try{if(!f.canShare(o)){n==null||n();return}}catch(x){d==null||d(x);return}g(!0),i==null||i();try{f.share(o).then(()=>{a==null||a()}).catch(x=>{if(Fm(x)==="AbortError"){l==null||l();return}d==null||d(x)}).finally(()=>{g(!1)})}catch(x){g(!1),d==null||d(x)}}},[s,t,l,d,i,a,n,o]);return{isSupported:p,isSharing:s,handleShare:m}},qm=e=>{const{isSupported:o,isSharing:t,handleShare:n}=Om(e),{shareData:i,onShareStart:a,onShareSuccess:l,onShareCancel:d,onShareError:s,onUnsupported:g,onClick:p,...m}=e;return r.jsx(Am,{...m,isSupported:o,isSharing:t,onShare:n})},Nm=qm,Um=({label:e,status:o="default",views:t,themeMode:n,...i})=>{const{themeMode:a}=c.useTheme(),l=Lr();return r.jsxs(c.Horizontal,{alignItems:"center",gap:8,role:"status-indicator",...t==null?void 0:t.container,...i,children:[r.jsx(c.View,{role:"status-dot",width:"8px",height:"8px",borderRadius:"50%",...l[o].indicator,...t==null?void 0:t.indicator}),e&&r.jsx(c.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...l[o].label,...t==null?void 0:t.label,children:e})]})},Gm=e=>r.jsx(Um,{...e}),Ym=(e=!0,o,t,n)=>{const{on:i}=c.useResponsive(),a=i("mobile"),[l,d]=u.useState(o!==void 0?o:e);return u.useEffect(()=>{o!==void 0&&d(o)},[o]),{isExpanded:l,toggleExpanded:()=>{const m=!l;d(m),t&&t(m)},expand:()=>{l||(d(!0),t&&t(!0))},collapse:()=>{l&&(d(!1),t&&t(!1))},isMobile:a}},vm={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},Xm=e=>({default:{backgroundColor:"color-white",color:"color-gray-800",transition:"all 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"all 0.2s ease"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"all 0.2s ease"},subtle:{backgroundColor:"color-gray-50",color:"color-gray-800",transition:"all 0.2s ease"},elevated:{backgroundColor:"color-white",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",color:"color-gray-800",transition:"all 0.2s ease"}}),Km=Xm(),Qm={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},Zm={none:{},low:{boxShadow:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)"},medium:{boxShadow:"0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)"},high:{boxShadow:"0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)"}},Jm={fast:"width 0.2s ease, transform 0.2s ease",normal:"width 0.3s ease, transform 0.3s ease",slow:"width 0.5s ease, transform 0.5s ease",bounce:"width 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55)"},za=u.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),et=()=>u.useContext(za),eh=({value:e,children:o})=>r.jsx(za.Provider,{value:e,children:o}),oh=({children:e,showToggleButton:o=!0,views:t,...n})=>{const{isExpanded:i,toggleExpanded:a,position:l}=et();return r.jsx(c.Horizontal,{width:"100%",padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:"space-between",...t==null?void 0:t.header,...n,children:i?r.jsxs(c.Horizontal,{width:"100%",alignItems:"center",justifyContent:"space-between",children:[e,o&&r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:a,"aria-label":i?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(ae,{orientation:l==="left"?"left":"right",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})]}):r.jsx(c.View,{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:o&&r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:a,"aria-label":i?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(ae,{orientation:l==="left"?"right":"left",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})})})},th=({children:e,views:o,...t})=>{const{isExpanded:n}=et();return r.jsx(c.View,{flex:"1",width:"100%",overflowY:"auto",overflowX:"hidden",padding:n?"16px":"8px",...o==null?void 0:o.content,...t,children:e})},rh=({children:e,views:o,...t})=>{const{isExpanded:n}=et();return r.jsx(c.View,{width:"100%",padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",...o==null?void 0:o.footer,...t,children:n?e:null})},nh=({children:e,position:o="left",size:t="md",variant:n="default",fixed:i=!1,hasBackdrop:a=!0,expandedWidth:l,collapsedWidth:d,breakpointBehavior:s="overlay",elevation:g="none",transitionPreset:p="normal",ariaLabel:m="Sidebar navigation",isExpanded:h,isMobile:f,collapse:x,views:y,themeMode:b,...k})=>{const S=vm[t],w=h?l||S.expandedWidth:d||S.collapsedWidth,j=!f||f&&s!=="hide",C=i||f&&s==="overlay"?"fixed":"relative",I=a&&f&&h&&s==="overlay";return r.jsxs(r.Fragment,{children:[I&&r.jsx(c.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:x,...y==null?void 0:y.backdrop}),j&&r.jsx(c.Vertical,{position:C,top:0,height:"100vh",width:w,zIndex:999,transition:Jm[p],transform:f&&s==="overlay"&&!h?`translateX(${o==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":m,...Km[n],...Qm[o],...Zm[g],...y==null?void 0:y.container,...k,children:u.Children.map(e,M=>M)})]})},ah=({children:e,position:o="left",size:t="md",variant:n="default",defaultExpanded:i=!0,expanded:a,onExpandedChange:l,fixed:d=!1,hasBackdrop:s=!0,showToggleButton:g=!0,expandedWidth:p,collapsedWidth:m,breakpoint:h=768,breakpointBehavior:f="overlay",views:x,...y})=>{const{isExpanded:b,toggleExpanded:k,expand:S,collapse:w,isMobile:j}=Ym(i,a,l);return r.jsx(eh,{value:{isExpanded:b,toggleExpanded:k,expand:S,collapse:w,position:o,size:t,variant:n,views:x},children:r.jsx(nh,{position:o,size:t,variant:n,fixed:d,hasBackdrop:s,showToggleButton:g,expandedWidth:p,collapsedWidth:m,breakpoint:h,breakpointBehavior:f,isExpanded:b,isMobile:j,toggleExpanded:k,expand:S,collapse:w,views:x,...y,children:e})})},ko=ah;ko.Header=oh;ko.Content=th;ko.Footer=rh;ko.useContext=et;const ih=()=>({getItem:e=>{try{return localStorage.getItem(`resizable-${e}`)}catch(o){return console.warn("Failed to access localStorage:",o),null}},setItem:(e,o)=>{try{localStorage.setItem(`resizable-${e}`,o)}catch(t){console.warn("Failed to write to localStorage:",t)}}}),lh=(e,o,t,n=50,i=1/0,a=!1,l,d,s=10)=>{const[g,p]=u.useState(!1),[m,h]=u.useState([]),f=u.useRef(null),x=u.useRef(null),y=u.useRef(0),b=u.useRef([]),k=u.useRef(d||(typeof window<"u"?ih():null)),S=u.useCallback(()=>f.current?e==="horizontal"?f.current.offsetWidth:f.current.offsetHeight:0,[e]),w=u.useCallback(()=>{if(!l||!k.current)return null;const z=k.current.getItem(l);if(!z)return null;try{const $=JSON.parse(z);return Array.isArray($.sizes)?$.sizes:null}catch($){return console.warn("Failed to parse saved panel sizes:",$),null}},[l]),j=u.useCallback(()=>{if(!l||!k.current||m.length===0)return;const z=m.map($=>({id:$.id,size:$.size,collapsed:$.collapsed||!1}));k.current.setItem(l,JSON.stringify({sizes:z}))},[l,m]),C=u.useCallback((z,$,E,H,L)=>{h(A=>A.some(F=>F.id===z)?A:[...A,{id:z,size:$,minSize:E??n,maxSize:H??i,collapsible:L??a,collapsed:!1}])},[n,i,a]),I=u.useCallback(z=>{h($=>$.filter(E=>E.id!==z))},[]),M=u.useCallback(z=>{const $=m.find(E=>E.id===z);return $?$.size:0},[m]),R=u.useCallback((z,$)=>{h(E=>E.map(H=>H.id===z?{...H,size:$}:H))},[]),V=u.useCallback(z=>{const $=m.find(E=>E.id===z);return $?!!$.collapsed:!1},[m]),_=u.useCallback(z=>{h($=>{const E=$.findIndex(F=>F.id===z);if(E===-1)return $;const H=$[E];if(!H.collapsible)return $;const L={...H,collapsed:!H.collapsed},A=[...$];return A[E]=L,A})},[]),T=u.useCallback((z,$)=>{x.current=z,y.current=$,b.current=m.map(E=>E.size),p(!0)},[m]),W=u.useCallback(z=>{if(!g||!x.current)return;const $=x.current,E=z-y.current;let H=-1;const L=$.match(/\d+$/);if(L&&(H=parseInt(L[0],10)-1),H===-1&&m.length>=2&&(H=0),H<0||H>=m.length-1)return;const A=m[H],F=m[H+1];if(A.collapsed||F.collapsed)return;let D=b.current[H]+E,q=b.current[H+1]-E;D=Math.max(A.minSize??n,Math.min(A.maxSize??i,D)),q=Math.max(F.minSize??n,Math.min(F.maxSize??i,q)),h(K=>K.map((Y,O)=>O===H?{...Y,size:D}:O===H+1?{...Y,size:q}:Y))},[g,m,e,n,i]),B=u.useCallback(()=>{g&&t&&t(m.map(z=>z.size)),x.current=null,p(!1),l&&j()},[g,m,t,l,j]),P=u.useCallback(z=>{if(!g||!x.current)return;const $=x.current;let E=-1;const H=$.match(/\d+$/);if(H&&(E=parseInt(H[0],10)-1),E===-1&&m.length>=2&&(E=0),E<0||E>=m.length-1)return;let L=0;e==="horizontal"?(z.key==="ArrowLeft"&&(L=-s),z.key==="ArrowRight"&&(L=s),z.key==="Home"&&(L=-100),z.key==="End"&&(L=100)):(z.key==="ArrowUp"&&(L=-s),z.key==="ArrowDown"&&(L=s),z.key==="Home"&&(L=-100),z.key==="End"&&(L=100)),L!==0&&(z.preventDefault(),W(y.current+L)),z.key==="Escape"&&(h(A=>A.map((F,D)=>({...F,size:b.current[D]}))),B())},[g,m,e,W,B,s]);return u.useEffect(()=>{const z=H=>{if(!g)return;const L=e==="horizontal"?H.clientX:H.clientY;W(L)},$=H=>{if(!g||H.touches.length===0)return;const L=H.touches[0],A=e==="horizontal"?L.clientX:L.clientY;W(A)},E=()=>{g&&B()};return g&&(document.addEventListener("mousemove",z),document.addEventListener("touchmove",$),document.addEventListener("mouseup",E),document.addEventListener("touchend",E),document.addEventListener("keydown",P),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",z),document.removeEventListener("touchmove",$),document.removeEventListener("mouseup",E),document.removeEventListener("touchend",E),document.removeEventListener("keydown",P),document.body.style.cursor="",document.body.style.userSelect=""}},[g,e,W,B,P]),u.useEffect(()=>{if(m.length!==0){if(l){const z=w();if(z){h($=>$.map(E=>{const H=z.find(L=>L.id===E.id);return H?{...E,size:H.size,collapsed:H.collapsed||!1}:E}));return}}if(!o){const $=S()/m.length;h(E=>E.map(H=>({...H,size:$})))}}},[m.length,o,S,l,w]),u.useEffect(()=>{if(!o||o.length===0||m.length===0)return;const z=S(),$=o.map(E=>typeof E=="string"&&E.endsWith("%")?parseFloat(E)/100*z:typeof E=="number"?E:parseFloat(E));h(E=>E.map((H,L)=>({...H,size:L<$.length?$[L]:H.size})))},[o,m.length,S]),u.useEffect(()=>{m.length>0&&l&&!g&&j()},[m,l,g,j]),{isResizing:g,setIsResizing:p,containerRef:f,panels:m,registerPanel:C,unregisterPanel:I,getPanelSize:M,setPanelSize:R,isPanelCollapsed:V,togglePanelCollapse:_,startResize:T,onResize:W,endResize:B}},ch={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},sh=(e,o)=>({sm:{width:o==="horizontal"?"4px":"100%",height:o==="vertical"?"4px":"100%"},md:{width:o==="horizontal"?"6px":"100%",height:o==="vertical"?"6px":"100%"},lg:{width:o==="horizontal"?"8px":"100%",height:o==="vertical"?"8px":"100%"}})[e],dh=e=>({default:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}},subtle:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-100"},_active:{backgroundColor:"color-gray-200"}},prominent:{backgroundColor:"color-gray-100",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}}}),uh=dh(),To={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},Ra=u.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),Va=()=>u.useContext(Ra),gh=({value:e,children:o})=>r.jsx(Ra.Provider,{value:e,children:o}),ph=({children:e,id:o,defaultSize:t,minSize:n,maxSize:i,collapsible:a,defaultCollapsed:l,onCollapseChange:d,views:s,...g})=>{const{orientation:p,registerPanel:m,unregisterPanel:h,getPanelSize:f,isPanelCollapsed:x,togglePanelCollapse:y}=Va(),b=typeof t=="string"&&t.endsWith("%")?0:typeof t=="number"?t:0;u.useEffect(()=>(m(o,b,n,i,a),()=>h(o)),[o,b,n,i,a,m,h]);const k=f(o),S=x(o);return u.useEffect(()=>{d&&S!==void 0&&d(S)},[S,d]),u.useEffect(()=>{a&&l&&!S&&y(o)},[o,a,l,S,y]),S?r.jsx(c.View,{flex:"0 0 auto",width:p==="horizontal"?"10px":"100%",height:p==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>y(o),"aria-label":`Expand panel ${o}`,role:"button",tabIndex:0,...s==null?void 0:s.collapsedPanel,...g}):r.jsx(c.View,{flex:k>0?"0 0 auto":"1",width:p==="horizontal"?`${k}px`:"100%",height:p==="vertical"?`${k}px`:"100%",overflow:"auto",...s==null?void 0:s.panel,...g,children:e})},mh=({id:e,position:o="both",disabled:t=!1,withVisualIndicator:n=!0,withCollapseButton:i=!1,collapseTarget:a,views:l,...d})=>{const{orientation:s,size:g,variant:p,startResize:m,isPanelCollapsed:h,togglePanelCollapse:f}=Va(),y=(()=>{if(a)return a;const C=e.match(/\d+$/);if(!C)return"";const I=parseInt(C[0],10);return isNaN(I)?"":`panel${I}`})(),b=h(y),k=C=>{if(t)return;C.preventDefault();const I=s==="horizontal"?C.clientX:C.clientY;m(e,I)},S=C=>{if(t||C.touches.length===0)return;C.preventDefault();const I=C.touches[0],M=s==="horizontal"?I.clientX:I.clientY;m(e,M)},w=C=>{t||(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),m(e,0))},j=C=>{C.stopPropagation(),y&&f(y)};return r.jsxs(c.View,{role:"separator","aria-orientation":s,"aria-valuemin":0,"aria-valuemax":100,tabIndex:t?-1:0,cursor:s==="horizontal"?"col-resize":"row-resize",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",...sh(g,s),...uh[p],onMouseDown:k,onTouchStart:S,onKeyDown:w,opacity:t?.5:1,pointerEvents:t?"none":"auto",...l==null?void 0:l.handle,...d,children:[n&&r.jsx(c.View,{display:"flex",alignItems:"center",justifyContent:"center",width:s==="horizontal"?"100%":"auto",height:s==="vertical"?"100%":"auto",pointerEvents:"none",...l==null?void 0:l.handleIcon,children:s==="horizontal"?r.jsxs(c.Horizontal,{gap:1,children:[r.jsx(c.View,{...To.horizontal}),r.jsx(c.View,{...To.horizontal})]}):r.jsxs(c.Vertical,{gap:1,children:[r.jsx(c.View,{...To.vertical}),r.jsx(c.View,{...To.vertical})]})}),i&&y&&r.jsx(c.View,{position:"absolute",top:s==="horizontal"?"-20px":"50%",left:s==="horizontal"?"50%":"-20px",transform:s==="horizontal"?"translateX(-50%)":"translateY(-50%)",width:"16px",height:"16px",borderRadius:"full",backgroundColor:"color-gray-100",border:"1px solid",borderColor:"color-gray-300",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:1,onClick:j,"aria-label":b?`Expand panel ${y}`:`Collapse panel ${y}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...l==null?void 0:l.collapseIcon,children:r.jsx(c.View,{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center",children:b?r.jsxs(c.Horizontal,{children:[r.jsx(c.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"}),r.jsx(c.View,{width:"2px",height:"6px",backgroundColor:"color-gray-600",position:"absolute"})]}):r.jsx(c.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"})})})]})},hh=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:i,minSize:a,maxSize:l,collapsible:d=!1,containerRef:s,autoSaveId:g,views:p,...m})=>{const h=o==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(h,{ref:s,width:"100%",height:"100%",position:"relative",overflow:"hidden",...ch[o],...p==null?void 0:p.container,...m,children:e})},fh=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:i,onSizesChange:a,minSize:l=50,maxSize:d,collapsible:s=!1,autoSaveId:g,storage:p,keyboardResizeBy:m=10,views:h,...f})=>{const{isResizing:x,setIsResizing:y,containerRef:b,registerPanel:k,unregisterPanel:S,getPanelSize:w,setPanelSize:j,isPanelCollapsed:C,togglePanelCollapse:I,startResize:M,onResize:R,endResize:V}=lh(o,i,a,l,d,s,g,p,m);return r.jsx(gh,{value:{orientation:o,size:t,variant:n,isResizing:x,setIsResizing:y,registerPanel:k,unregisterPanel:S,getPanelSize:w,setPanelSize:j,isPanelCollapsed:C,togglePanelCollapse:I,startResize:M,onResize:R,endResize:V},children:r.jsx(hh,{orientation:o,size:t,variant:n,defaultSizes:i,minSize:l,maxSize:d,collapsible:s,autoSaveId:g,keyboardResizeBy:m,containerRef:b,views:h,...f,children:e})})},Nt=fh;Nt.Panel=ph;Nt.Handle=mh;const Mo={info:{container:{backgroundColor:"color-blue-50",border:"color-blue-300"},content:{color:"color-blue-700"},icon:{color:"color-blue-500"}},success:{container:{backgroundColor:"color-green-50",border:"color-green-300"},content:{color:"color-green-700"},icon:{color:"color-green-500"}},warning:{container:{backgroundColor:"color-orange-50",border:"color-orange-300"},content:{color:"color-orange-700"},icon:{color:"color-orange-500"}},error:{container:{backgroundColor:"color-red-50",border:"color-red-300"},content:{color:"color-red-700"},icon:{color:"color-red-500"}}},xh={top:{top:"16px",left:"50%",transform:"translateX(-50%)"},"top-right":{top:"16px",right:"16px"},"top-left":{top:"16px",left:"16px"},bottom:{bottom:"16px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"}},bh=()=>Math.random().toString(36).substring(2,9);let Ue=new Map;const jo=kt.create(e=>({toasts:[],add:(o,t,n,i={})=>{const a=i.id||bh(),l={id:a,variant:o,title:t,description:n,createdAt:Date.now(),isVisible:!0,...i};if(e(d=>({toasts:[...d.toasts,l]})),i.duration!==0){const d=i.duration||5e3,s=setTimeout(()=>{jo.getState().remove(a)},d);Ue.set(a,s)}return a},remove:o=>{e(t=>({toasts:t.toasts.map(n=>n.id===o?{...n,isVisible:!1}:n)})),Ue.has(o)&&(clearTimeout(Ue.get(o)),Ue.delete(o)),setTimeout(()=>{e(t=>({toasts:t.toasts.filter(n=>n.id!==o)}))},300)},removeAll:()=>{Ue.forEach(clearTimeout),Ue.clear(),e(o=>({toasts:o.toasts.map(t=>({...t,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),Ae=(e,o,t,n)=>jo.getState().add(e,o,t,n),Ea=(e,o,t)=>Ae("info",e,o,t),Pa=(e,o,t)=>Ae("success",e,o,t),Wa=(e,o,t)=>Ae("warning",e,o,t),_a=(e,o,t)=>Ae("error",e,o,t),$a=e=>{jo.getState().remove(e)},Ha=()=>{jo.getState().removeAll()},Ba=({variant:e,title:o,description:t,onClose:n,isClosable:i=!0,action:a,actionText:l,showIcon:d=!0,theme:s,views:g,render:p,icon:m,id:h,isVisible:f=!0,themeMode:x})=>{const y=s??Mo,b=()=>{var j,C;if(m!==void 0)return m;const w=e?(C=(j=Mo[e])==null?void 0:j.icon)==null?void 0:C.color:Mo.info.icon.color;switch(e){case"info":return r.jsx(ze,{widthHeight:20,color:w});case"success":return r.jsx(Ct,{widthHeight:20,color:w});case"warning":return r.jsx(ze,{widthHeight:20,color:w,orientation:"down"});case"error":return r.jsx(Oo,{widthHeight:20,color:w});default:return r.jsx(ze,{widthHeight:20,color:Mo.info.icon.color})}};if(p)return r.jsx(r.Fragment,{children:p({id:h||"",onClose:n})});const k=e==="error"?"alert":"status",S=e==="error"||e==="warning"?"assertive":"polite";return r.jsxs(c.Horizontal,{role:k,"aria-live":S,"aria-atomic":"true","data-state":f?"open":"closed",gap:12,width:"100%",maxWidth:"400px",borderWidth:"1px",borderStyle:"solid",borderRadius:"8px",padding:"12px 16px",alignItems:"flex-start",position:"relative",backgroundColor:y[e].container.backgroundColor,borderColor:y[e].container.border,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",opacity:f?1:0,transform:f?"scale(1)":"scale(0.95)",transition:"all 0.3s ease",...g==null?void 0:g.container,children:[d&&r.jsx(c.View,{marginTop:"2px",...g==null?void 0:g.icon,children:b()}),r.jsxs(c.Vertical,{gap:4,flex:"1",children:[r.jsx(c.Text,{size:"md",fontWeight:"600",color:y[e].content.color,backgroundColor:y[e].container.backgroundColor,...g==null?void 0:g.title,children:o}),t&&r.jsx(c.Text,{size:"sm",color:y[e].content.color,fontWeight:"400",backgroundColor:y[e].container.backgroundColor,...g==null?void 0:g.description,children:t}),a&&l&&r.jsx(c.Text,{size:"sm",fontWeight:"600",marginTop:"8px",cursor:"pointer",color:y[e].content.color,backgroundColor:y[e].container.backgroundColor,onClick:w=>{w.stopPropagation(),a()},_hover:{textDecoration:"underline"},transition:"all 0.2s ease",...g==null?void 0:g.actionButton,children:l})]}),i&&r.jsx(c.View,{as:"button","aria-label":"Close toast",backgroundColor:"transparent",border:"none",cursor:"pointer",padding:"4px",marginLeft:"8px",marginTop:"-4px",marginRight:"-8px",borderRadius:"4px",onClick:w=>{w.stopPropagation(),n()},_hover:{backgroundColor:"rgba(0, 0, 0, 0.05)"},transition:"all 0.2s ease",...g==null?void 0:g.closeButton,children:r.jsx(fe,{widthHeight:16,color:y[e].content.color})})]})},yh=({position:e="top-right",gap:o=8,limit:t=5,containerStyle:n})=>{const{toasts:i,remove:a}=jo(),d=u.useMemo(()=>{const s={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return i.forEach(g=>{const p=g.position||e;s[p].push(g)}),Object.keys(s).forEach(g=>{s[g]=s[g].slice(-t)}),s},[i,e,t])[e];return r.jsx(c.View,{position:"fixed",zIndex:9999,display:"flex",flexDirection:e.includes("bottom")?"column-reverse":"column",gap:`${o}px`,width:"fit-content",maxWidth:"100%",pointerEvents:"none",...xh[e],style:n,children:d.map(s=>r.jsx(c.View,{pointerEvents:"auto",animation:e.includes("right")?"slideInRight 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("left")?"slideInLeft 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("top")?"slideInDown 0.3s ease-out, fadeIn 0.3s ease-out":"slideInUp 0.3s ease-out, fadeIn 0.3s ease-out",children:r.jsx(Ba,{id:s.id,variant:s.variant,title:s.title,description:s.description,onClose:()=>a(s.id),isClosable:s.isClosable,action:s.action,actionText:s.actionText,showIcon:s.showIcon,views:s.views,render:s.render,icon:s.icon,isVisible:s.isVisible})},s.id))})},kh=()=>({toast:(e,o,t,n)=>Ae(e,o,t,n),info:(e,o,t)=>Ea(e,o,t),success:(e,o,t)=>Pa(e,o,t),warning:(e,o,t)=>Wa(e,o,t),error:(e,o,t)=>_a(e,o,t),remove:e=>$a(e),removeAll:()=>Ha()}),jh=e=>r.jsx(Ba,{...e}),Ch=Object.assign(jh,{Container:e=>r.jsx(yh,{...e}),show:Ae,info:Ea,success:Pa,warning:Wa,error:_a,remove:$a,removeAll:Ha}),Sh=kh,yr=(e,o)=>{var l,d;if(!e)return!0;const t=e.toLowerCase(),n=o.name.toLowerCase().includes(t),i=((l=o.description)==null?void 0:l.toLowerCase().includes(t))||!1,a=((d=o.keywords)==null?void 0:d.some(s=>s.toLowerCase().includes(t)))||!1;return n||i||a},wh=({open:e,onOpenChange:o,groups:t=[],commands:n=[],filter:i})=>{const[a,l]=u.useState(""),[d,s]=u.useState(0),g=u.useRef(null),p=u.useMemo(()=>i||yr,[i]),m=u.useMemo(()=>[...t.flatMap(b=>b.commands),...n],[t,n]),h=u.useMemo(()=>a.trim()?m.filter(y=>p(a,y)):m,[m,a,p]),f=u.useMemo(()=>{if(!a)return t;const y=i||yr;return t.map(b=>({...b,commands:b.commands.filter(k=>y(a,k))})).filter(b=>b.commands.length)},[t,a,i]);u.useEffect(()=>{s(0)},[h.length]);const x=u.useCallback(y=>{if(e)switch(y.key){case"ArrowDown":y.preventDefault(),s(b=>b<h.length-1?b+1:b);break;case"ArrowUp":y.preventDefault(),s(b=>b>0?b-1:b);break;case"Enter":y.preventDefault(),h[d]&&(h[d].onSelect(),o(!1),l(""));break;case"Escape":y.preventDefault(),o(!1),l("");break}},[e,h,d,o]);return u.useEffect(()=>(document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}),[x]),u.useEffect(()=>{if(g.current&&e){const y=g.current.querySelector(`[data-index="${d}"]`);y&&y.scrollIntoView({block:"nearest"})}},[d,e]),u.useEffect(()=>{e?s(0):l("")},[e]),{search:a,setSearch:l,selectedIndex:d,setSelectedIndex:s,filteredCommands:h,filteredGroups:f,listRef:g}},Ih={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},Th=e=>({default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},outline:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"}}),Mh=Th(),zh={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},Rh={overflow:"auto",padding:"8px 0"},Vh={marginBottom:"8px"},Eh={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},Ph={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},Wh={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},_h={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},$h={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},Hh={display:"flex",flexDirection:"column",flex:1},Bh={fontSize:"14px",fontWeight:"medium"},Lh={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},Ah={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},Dh={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},Fh={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},Oh=u.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),qh=({value:e,children:o})=>r.jsx(Oh.Provider,{value:e,children:o}),La=({value:e,onValueChange:o,placeholder:t="Type a command or search...",views:n,...i})=>{const a=u.useRef(null);return u.useEffect(()=>{a.current&&a.current.focus()},[]),r.jsxs(c.View,{...zh,...n==null?void 0:n.container,...i,children:[r.jsx(Po,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),r.jsx(c.View,{as:"input",type:"text",value:e,onChange:l=>o(l.target.value),placeholder:t,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"14px",ref:a,...n==null?void 0:n.input})]})},Nh=({children:e,views:o,...t})=>r.jsx(c.View,{...Rh,...o==null?void 0:o.container,...t,children:e}),Aa=({heading:e,children:o,views:t,...n})=>r.jsxs(c.View,{...Vh,...t==null?void 0:t.container,...n,children:[r.jsx(c.Text,{...Eh,...t==null?void 0:t.heading,children:e}),o]}),yt=({item:e,selected:o=!1,onSelect:t,views:n,...i})=>{const a=()=>{!e.disabled&&t&&t()};return r.jsxs(c.Horizontal,{...Ph,...o?Wh:{},...e.disabled?_h:{},onClick:a,...n==null?void 0:n.container,...i,children:[e.icon&&r.jsx(c.View,{...$h,...n==null?void 0:n.icon,children:e.icon}),r.jsxs(c.Vertical,{...Hh,...n==null?void 0:n.content,children:[r.jsx(c.Text,{...Bh,...n==null?void 0:n.name,children:e.name}),e.description&&r.jsx(c.Text,{...Lh,...n==null?void 0:n.description,children:e.description})]}),e.shortcut&&r.jsx(c.Text,{...Ah,...n==null?void 0:n.shortcut,children:e.shortcut})]})},Da=({children:e="No results found.",views:o,...t})=>r.jsx(c.View,{...Dh,...o==null?void 0:o.container,...t,children:e}),Uh=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:i,size:a="md",variant:l="default",emptyState:d,footer:s,search:g,setSearch:p,selectedIndex:m,setSelectedIndex:h,filteredCommands:f,filteredGroups:x,listRef:y,views:b,filter:k,...S})=>{if(!e)return null;const w=u.useCallback(R=>{R.disabled||(R.onSelect(),o(!1),p(""))},[o,p]),j=u.useCallback(R=>R.target===R.currentTarget&&o(!1),[o]),C=u.useMemo(()=>({search:g,setSearch:p,selectedIndex:m,setSelectedIndex:h,filteredCommands:f,onSelect:w}),[g,m,f,w,p,h]),I=t.length>0,M=f.length===0;return r.jsx(c.View,{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:9999,onClick:j,...S,children:r.jsx(qh,{value:C,children:r.jsxs(c.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...Ih[a],...Mh[l],...b==null?void 0:b.container,onClick:R=>R.stopPropagation(),children:[r.jsx(La,{value:g,onValueChange:p,placeholder:i,views:b==null?void 0:b.searchInput}),r.jsx(c.View,{ref:y,flex:1,overflow:"auto",...b==null?void 0:b.list,children:M?d||r.jsx(Da,{views:b==null?void 0:b.empty}):I?x.map(R=>r.jsx(Aa,{heading:R.name,views:b==null?void 0:b.groupHeading,children:R.commands.map(V=>{const _=f.findIndex(T=>T.id===V.id);return r.jsx(yt,{item:V,selected:_===m,onSelect:()=>w(V),"data-index":_,views:{container:b==null?void 0:b.item,icon:b==null?void 0:b.icon,content:b==null?void 0:b.content,name:b==null?void 0:b.name,description:b==null?void 0:b.description,shortcut:b==null?void 0:b.shortcut}},V.id)})},R.id)):f.map((R,V)=>r.jsx(yt,{item:R,selected:V===m,onSelect:()=>w(R),"data-index":V,views:{container:b==null?void 0:b.item,icon:b==null?void 0:b.icon,content:b==null?void 0:b.content,name:b==null?void 0:b.name,description:b==null?void 0:b.description,shortcut:b==null?void 0:b.shortcut}},R.id))}),s&&r.jsx(c.View,{...Fh,...b==null?void 0:b.footer,children:s})]})})})},Gh=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:i,size:a="md",variant:l="default",filter:d,emptyState:s,footer:g,views:p,...m})=>{const{search:h,setSearch:f,selectedIndex:x,setSelectedIndex:y,filteredCommands:b,filteredGroups:k,listRef:S}=wh({open:e,onOpenChange:o,groups:t,commands:n,filter:d});return r.jsx(Uh,{open:e,onOpenChange:o,groups:t,commands:n,placeholder:i,size:a,variant:l,emptyState:s,footer:g,search:h,setSearch:f,selectedIndex:x,setSelectedIndex:y,filteredCommands:b,filteredGroups:k,listRef:S,views:p,...m})},eo=Gh;eo.Input=La;eo.List=Nh;eo.Group=Aa;eo.Item=yt;eo.Empty=Da;const kr=()=>Math.random().toString(36).substring(2,11),Yh=({defaultOpen:e=!1,openDelay:o=200,closeDelay:t=200,isDisabled:n=!1}={})=>{const[i,a]=u.useState(e),l=u.useRef(null),d=u.useRef(null),s=u.useRef(null),g=u.useRef(null),p=u.useRef(`tooltip-trigger-${kr()}`).current,m=u.useRef(`tooltip-content-${kr()}`).current,h=u.useCallback(()=>{n||(g.current&&(clearTimeout(g.current),g.current=null),!i&&!s.current&&(s.current=setTimeout(()=>{a(!0),s.current=null},o)))},[i,o,n]),f=u.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),i&&!g.current&&(g.current=setTimeout(()=>{a(!1),g.current=null},t))},[i,t]),x=u.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null)},[]);return u.useEffect(()=>()=>{s.current&&clearTimeout(s.current),g.current&&clearTimeout(g.current)},[]),u.useEffect(()=>{const y=b=>{b.key==="Escape"&&i&&a(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[i]),{isOpen:i,openTooltip:h,closeTooltip:f,cancelCloseTimer:x,triggerRef:l,contentRef:d,triggerId:p,contentId:m}},vh={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},Xh=e=>({default:{backgroundColor:"color-gray-900",color:"color-white",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",transition:"opacity 0.15s ease"},light:{backgroundColor:"color-white",color:"color-gray-800",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.04)",transition:"opacity 0.15s ease"},dark:{backgroundColor:"color-gray-950",color:"color-white",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.2), 0px 2px 4px rgba(0, 0, 0, 0.12)",transition:"opacity 0.15s ease"}}),Kh=Xh(),Qh=e=>{const o={position:"absolute",width:"8px",height:"8px",backgroundColor:"inherit",borderStyle:"inherit",borderWidth:"inherit",borderColor:"inherit",transform:"rotate(45deg)"};switch(e){case"top":return{...o,bottom:"-4px",left:"50%",marginLeft:"-4px",borderTop:"none",borderLeft:"none"};case"right":return{...o,left:"-4px",top:"50%",marginTop:"-4px",borderRight:"none",borderTop:"none"};case"bottom":return{...o,top:"-4px",left:"50%",marginLeft:"-4px",borderBottom:"none",borderRight:"none"};case"left":return{...o,right:"-4px",top:"50%",marginTop:"-4px",borderLeft:"none",borderBottom:"none"};default:return o}},Fa=u.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Ut=()=>u.useContext(Fa),Zh=({value:e,children:o})=>r.jsx(Fa.Provider,{value:e,children:o}),Oa=u.memo(({children:e,views:o,asChild:t=!1,...n})=>{const{openTooltip:i,closeTooltip:a,triggerRef:l,contentId:d,triggerId:s}=Ut(),g=u.useCallback(()=>i(),[i]),p=u.useCallback(()=>a(),[a]),m=u.useCallback(()=>i(),[i]),h=u.useCallback(()=>a(),[a]),f={ref:l,onMouseEnter:g,onMouseLeave:p,onFocus:m,onBlur:h,id:s,"aria-describedby":d,...o==null?void 0:o.container,...n};return t&&u.isValidElement(e)?u.cloneElement(e,f):r.jsx(c.View,{display:"inline-block",...f,children:e})}),Jh=u.memo(({children:e,views:o,...t})=>{const{isOpen:n,contentRef:i,contentId:a,triggerId:l}=Ut();return n?r.jsx(c.View,{ref:i,id:a,role:"tooltip","aria-labelledby":l,...o==null?void 0:o.container,...t,children:e}):null}),ef=({content:e,children:o,position:t="top",align:n="center",size:i="md",variant:a="default",showArrow:l=!0,views:d,themeMode:s,...g})=>{const{isOpen:p,triggerRef:m,contentRef:h,contentId:f,triggerId:x}=Ut(),{ref:y,relation:b}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[k,S]=u.useState({x:0,y:0,placement:t});u.useEffect(()=>{m!=null&&m.current&&y&&(y.current=m.current)},[m,y,p]),u.useEffect(()=>{if(p&&(h!=null&&h.current)&&(m!=null&&m.current)){const C=m.current.getBoundingClientRect();let I=t;b&&(t==="top"&&b.space.vertical==="bottom"?I="bottom":t==="bottom"&&b.space.vertical==="top"?I="top":t==="right"&&b.space.horizontal==="left"?I="left":t==="left"&&b.space.horizontal==="right"&&(I="right"));let M=0,R=0;switch(I){case"top":M=n==="start"?C.left:n==="end"?C.right-120:C.left+C.width/2-60,R=C.top-8;break;case"bottom":M=n==="start"?C.left:n==="end"?C.right-120:C.left+C.width/2-60,R=C.bottom+8;break;case"right":M=C.right+8,R=n==="start"?C.top:n==="end"?C.bottom-32:C.top+C.height/2-16;break;case"left":M=C.left-8,R=n==="start"?C.top:n==="end"?C.bottom-32:C.top+C.height/2-16;break}S({x:M,y:R,placement:I})}},[p,t,n,m,h,b]);const w=u.useMemo(()=>l?Qh(k.placement):{},[l,k.placement]),j=u.useMemo(()=>{const C={position:"fixed",left:k.x,top:k.y,zIndex:1e3};switch(k.placement){case"top":return{...C,transform:"translateY(-100%)"};case"left":return{...C,transform:"translateX(-100%)"};case"bottom":case"right":default:return C}},[k.x,k.y,k.placement]);return r.jsxs(c.View,{position:"relative",display:"inline-block",...d==null?void 0:d.container,...g,children:[r.jsx(Oa,{children:o}),p&&r.jsxs(c.View,{ref:h,id:f,role:"tooltip","aria-labelledby":x,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:j,...vh[i],...Kh[a],...d==null?void 0:d.content,children:[typeof e=="string"?r.jsx(c.Text,{...d==null?void 0:d.text,children:e}):e,l&&r.jsx(c.View,{...w,...d==null?void 0:d.arrow})]})]})},of=({content:e,children:o,position:t="top",align:n="center",size:i="md",variant:a="default",openDelay:l=200,closeDelay:d=200,showArrow:s=!0,defaultOpen:g=!1,isDisabled:p=!1,views:m,...h})=>{const f=Yh({defaultOpen:g,openDelay:l,closeDelay:d,isDisabled:p});return r.jsx(Zh,{value:f,children:r.jsx(ef,{content:e,position:t,align:n,size:i,variant:a,showArrow:s,views:m,...h,children:o})})},Gt=of;Gt.Trigger=Oa;Gt.Content=Jh;const qa=u.forwardRef((e,o)=>{const t=Pn(e);return r.jsx(Hn,{...e,...t})});qa.displayName="ChatInput";const tf={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},jr={container:{position:"relative",display:"flex",flexDirection:"column",height:"100vh",alignItems:"center",justifyContent:"center"},gradient:{position:"absolute",inset:"-10px",opacity:.5,pointerEvents:"none",filter:"blur(10px)",backgroundSize:"300% 200%",backgroundPosition:"50% 50%, 50% 50%"}},st={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},image:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundAttachment:"scroll"},content:{position:"relative",width:"100%",height:"100%",zIndex:2}},dt={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},video:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"},content:{position:"relative",zIndex:2}},Cr={"to-right":"to right","to-left":"to left","to-bottom":"to bottom","to-top":"to top","to-top-right":"to top right","to-top-left":"to top left","to-bottom-right":"to bottom right","to-bottom-left":"to bottom left"},zo={center:"center",top:"top",right:"right",bottom:"bottom",left:"left","top-right":"top right","top-left":"top left","bottom-right":"bottom right","bottom-left":"bottom left"},rf={linear:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],radial:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],conic:[{color:"color-red-500",position:"0deg"},{color:"color-yellow-500",position:"90deg"},{color:"color-green-500",position:"180deg"},{color:"color-blue-500",position:"270deg"},{color:"color-red-500",position:"360deg"}]},nf=(e,o,t,n,i)=>{const a=o.map(l=>`${l.color} ${l.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${t&&Cr[t]?Cr[t]:t||"to right"}, ${a})`;case"radial":const d=i&&zo[i]?zo[i]:i||"center";return`radial-gradient(${n||"circle"} at ${d}, ${a})`;case"conic":return`conic-gradient(from 0deg at ${i&&zo[i]?zo[i]:i||"center"}, ${a})`;default:return`linear-gradient(to right, ${a})`}},af={linear:{backgroundSize:"200% 200%",transition:"background-position 3s ease-in-out",animate:{from:{backgroundPosition:"0% 50%"},"50%":{backgroundPosition:"100% 50%"},to:{backgroundPosition:"0% 50%"}}},radial:{backgroundSize:"100% 100%",transition:"all 3s ease-in-out",animate:{from:{backgroundPosition:"center",backgroundSize:"100% 100%"},"50%":{backgroundSize:"120% 120%"},to:{backgroundPosition:"center",backgroundSize:"100% 100%"}}},conic:{transition:"transform 3s linear",animate:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}},Sr={container:{position:"relative",overflow:"hidden",borderRadius:"8px",transition:"all 0.2s ease"},content:{position:"relative",zIndex:1,width:"100%",height:"100%",padding:"16px"}},lf=({type:e="linear",direction:o="to-right",shape:t="circle",position:n="center",from:i,to:a,colors:l,animate:d=!1,animationDuration:s=3,children:g,views:p,themeMode:m,...h})=>{const f=u.useMemo(()=>l&&l.length>0?l:i&&a?[{color:i,position:"0%"},{color:a,position:"100%"}]:rf[e],[l,i,a,e]),x=u.useMemo(()=>{const b=f.map(k=>({...k,color:k.color}));return nf(e,b,o,t,n)},[e,f,o,t,n]),y=u.useMemo(()=>{if(!d)return{};const b=af[e];return{...b,transition:b.transition.replace("3s",`${s}s`),animationDuration:`${s}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[d,s,e]);return r.jsx(c.View,{background:x,...Sr.container,...y,...p==null?void 0:p.container,...h,children:g&&r.jsx(c.View,{...Sr.content,...p==null?void 0:p.content,children:g})})},cf=e=>r.jsx(lf,{...e}),sf=u.createContext({}),df=({children:e,showRadialGradient:o=!0,views:t,themeMode:n,...i})=>{const a={white:"rgba(255,255,255,1)",transparent:"rgba(255,255,255,0)"},l=["rgb(59, 130, 246)","rgb(196, 181, 253)","rgb(147, 197, 253)","rgb(221, 214, 254)","rgb(96, 165, 250)"],d={...jr.gradient,backgroundImage:`
29
29
  repeating-linear-gradient(100deg, ${l.join(", ")}),
30
30
  repeating-linear-gradient(100deg, ${a.white} 0%, ${a.white} 7%, ${a.transparent} 10%, ${a.transparent} 12%, ${a.white} 16%)
31
- `,animation:"aurora 4s ease infinite",...o?{maskImage:"radial-gradient(ellipse at 100% 0%, black 10%, transparent 70%)"}:{}};return r.jsxs(c.View,{...kr.container,...t==null?void 0:t.container,...i,children:[r.jsx(c.View,{style:d}),e,r.jsx("style",{children:`
31
+ `,animation:"aurora 4s ease infinite",...o?{maskImage:"radial-gradient(ellipse at 100% 0%, black 10%, transparent 70%)"}:{}};return r.jsxs(c.View,{...jr.container,...t==null?void 0:t.container,...i,children:[r.jsx(c.View,{style:d}),e,r.jsx("style",{children:`
32
32
  @keyframes aurora {
33
33
  0% { background-position: 0% 50%; }
34
34
  50% { background-position: 100% 50%; }
35
35
  100% { background-position: 0% 50%; }
36
36
  }
37
- `})]})},rf=({number:e=20,children:o,...t})=>{const n=Array.from({length:e},(i,a)=>a);return r.jsxs(c.View,{width:"100%",height:"100%",backgroundColor:"black",position:"relative",overflow:"hidden",...t,children:[n.map(i=>{const a=i*37%200-100+"px",l=.2+i*13%6*.1+"s",d=(1+i*7%9)/2+"s",s=300+i*17%100+"px";return r.jsx(c.View,{position:"absolute",top:"0px",left:a,width:"2px",height:"2px",borderRadius:"9999px",backgroundColor:"white",boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)",transform:"rotate(215deg)",zIndex:0,animate:{from:{transform:"translateX(-100%) translateY(-100%)"},to:{transform:`translateX(${s}) translateY(${s})`},iterationCount:"infinite",timingFunction:"linear",fillMode:"forwards",duration:d,delay:l},children:r.jsx(c.View,{position:"absolute",top:"-1px",left:"-1px",width:"1px",height:"1px",borderRadius:"9999px",backgroundColor:"white",boxShadow:"0 10px 0 1px rgba(255, 255, 255, 0.1)"})},i)}),o&&r.jsx(c.View,{position:"relative",zIndex:1,width:"100%",height:"100%",children:o})]})},Sr=["rgb(186, 230, 253)","rgb(249, 168, 212)","rgb(134, 239, 172)","rgb(253, 224, 71)","rgb(252, 165, 165)","rgb(216, 180, 254)","rgb(147, 197, 253)","rgb(165, 180, 252)","rgb(196, 181, 253)"],nf=()=>Sr[Math.floor(Math.random()*Sr.length)],af=({rows:e=15,cols:o=10,squareSize:t=40,...n})=>{const i=Array(e).fill(1),a=Array(o).fill(1);return r.jsx(c.View,{padding:16,width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-50",zIndex:0,transform:"skewX(-48deg) skewY(14deg) scale(0.675) rotate(0deg) translateZ(0)",...n,children:i.map((l,d)=>r.jsx(c.Horizontal,{gap:0,children:a.map((s,g)=>r.jsx(c.View,{height:t/3,width:t,borderStyle:"solid",borderColor:"color-gray-200",borderWidth:.5,backgroundColor:"transparent",cursor:"pointer",on:{hover:{backgroundColor:nf(),transition:"background-color 0.2s ease"}}},`col-${g}`))},`row-${d}`))})},lf=["rgb(59, 130, 246)","rgb(147, 51, 234)","rgb(236, 72, 153)","rgb(34, 197, 94)","rgb(251, 146, 60)","rgb(168, 85, 247)"],cf=({count:e=50,colors:o=lf,speed:t="medium",shapes:n=["circle"],...i})=>{const a=Array.from({length:e},(g,p)=>p),l=()=>{switch(t){case"slow":return .5;case"fast":return 2;default:return 1}},d=()=>n[Math.floor(Math.random()*n.length)],s=()=>o[Math.floor(Math.random()*o.length)];return r.jsx(c.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...i,children:a.map(g=>{const p=Math.random()*8+4,m=Math.random()*400,h=Math.random()*300,f=Math.random()*400,x=Math.random()*300,y=(Math.random()*10+5)/l(),b=Math.random()*5,k=d(),C=s(),w={circle:{borderRadius:"50%"},square:{borderRadius:"2px"},triangle:{borderRadius:"0",clipPath:"polygon(50% 0%, 0% 100%, 100% 100%)"}};return r.jsx(c.View,{position:"absolute",width:p,height:p,backgroundColor:C,opacity:.7,style:{left:m,top:h,...w[k]},animate:{from:{transform:"translate(0px, 0px) scale(0.5)",opacity:0},to:{transform:`translate(${f-m}px, ${x-h}px) scale(1)`,opacity:.7},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${y}s`,delay:`${b}s`}},g)})})},sf=({gridSize:e=30,lineColor:o="rgba(59, 130, 246, 0.3)",pulseColor:t="rgba(59, 130, 246, 0.8)",animationSpeed:n="medium",...i})=>{const a=()=>{switch(n){case"slow":return 4;case"fast":return 1;default:return 2}},l=Math.floor(400/e),d=Math.floor(300/e),s=l*d,g=Array.from({length:s},(p,m)=>m);return r.jsxs(c.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...i,children:[Array.from({length:l+1},(p,m)=>r.jsx(c.View,{position:"absolute",left:m*e,top:0,width:1,height:"100%",backgroundColor:o},`v-line-${m}`)),Array.from({length:d+1},(p,m)=>r.jsx(c.View,{position:"absolute",left:0,top:m*e,width:"100%",height:1,backgroundColor:o},`h-line-${m}`)),g.map(p=>{const m=p%l,h=Math.floor(p/l),f=(m+h)*.1;return r.jsx(c.View,{position:"absolute",left:m*e+1,top:h*e+1,width:e-2,height:e-2,backgroundColor:"transparent",animate:{from:{backgroundColor:"transparent"},to:{backgroundColor:t},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${a()}s`,delay:`${f}s`}},p)})]})},df=["rgba(59, 130, 246, 0.6)","rgba(147, 51, 234, 0.6)","rgba(236, 72, 153, 0.6)","rgba(34, 197, 94, 0.6)"],uf=({rippleCount:e=5,colors:o=df,maxSize:t=200,frequency:n=3,...i})=>{const a=Array.from({length:e},(l,d)=>({id:d,x:Math.random()*400,y:Math.random()*300,color:o[d%o.length],delay:d*(n/e),duration:3+Math.random()*2}));return r.jsxs(c.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-100",...i,children:[a.map(l=>r.jsx(c.View,{position:"absolute",width:20,height:20,borderRadius:"50%",style:{left:l.x-10,top:l.y-10,border:`2px solid ${l.color}`,backgroundColor:"transparent"},animate:{from:{transform:"scale(0)",opacity:1},to:{transform:`scale(${t/20})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${l.duration}s`,delay:`${l.delay}s`}},l.id)),a.map(l=>r.jsx(c.View,{position:"absolute",width:10,height:10,borderRadius:"50%",style:{left:l.x-5,top:l.y-5,backgroundColor:l.color},animate:{from:{transform:"scale(1)",opacity:.8},to:{transform:`scale(${t/40})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${l.duration*1.2}s`,delay:`${l.delay+.5}s`}},`secondary-${l.id}`))]})},gf=({children:e,src:o,backgroundSize:t="cover",backgroundPosition:n="center",backgroundRepeat:i="no-repeat",backgroundAttachment:a="scroll",imageOpacity:l=1,overlay:d=null,blendMode:s="normal",views:g,themeMode:p,...m})=>{const h={...dt.image,backgroundImage:`url(${o})`,backgroundSize:t,backgroundPosition:n,backgroundRepeat:i,backgroundAttachment:a,opacity:l};return r.jsxs(c.View,{...dt.container,...g==null?void 0:g.container,...m,children:[r.jsx(c.View,{style:h,...g==null?void 0:g.image}),d,e&&r.jsx(c.View,{...dt.content,...g==null?void 0:g.content,children:e})]})},pf=({children:e,src:o,autoPlay:t=!0,loop:n=!0,muted:i=!0,playsInline:a=!0,overlay:l=null,blendMode:d="normal",views:s,themeMode:g,...p})=>r.jsxs(c.View,{...ut.container,...s==null?void 0:s.container,...p,children:[r.jsx(c.View,{as:"video",src:o,autoPlay:t,loop:n,muted:i,playsInline:a,style:ut.video,...s==null?void 0:s.video}),l,e&&r.jsx(c.View,{...ut.content,...s==null?void 0:s.content,children:e})]}),mf=({children:e,...o})=>r.jsx(ef,{...o,children:e}),hf=({contentPosition:e,backgroundColor:o="color-black-900",...t})=>{const i=(()=>{let a=`${o}-100`,l=`${o}-900`,d=`${o}-600`,s=`${o}-400`;switch(o.indexOf("-")===-1&&(a=`color-mix(in srgb, ${o} 10%, transparent)`,l=`color-mix(in srgb, ${o} 90%, transparent)`,d=`color-mix(in srgb, ${o} 70%, transparent)`,s=`color-mix(in srgb, ${o} 50%, transparent)`),e){case"left":return`radial-gradient(circle at 70% 50%, ${a} 0%, ${a} 100%), linear-gradient(to right, ${l} 0%, ${d} 65%, ${a} 100%)`;case"right":return`radial-gradient(circle at 30% 50%, ${a} 0%, ${a} 100%), linear-gradient(to left, ${l} 0%, ${d} 65%, ${a} 100%)`;case"top":return`radial-gradient(circle at 50% 40%, ${a} 0%, ${a} 100%), linear-gradient(to bottom, ${l} 0%, ${d} 60%, ${a} 100%)`;case"bottom":return`radial-gradient(circle at 50% 60%, ${a} 0%, ${a} 100%), linear-gradient(to top, ${l} 0%, ${d} 60%, ${a} 100%)`;case"center":return`radial-gradient(circle at 50% 70%, ${l} 0%, ${a} 100%)`;default:return s}})();return r.jsx(c.View,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:i,pointerEvents:"none",zIndex:1,...t})},ff=({children:e,views:o,...t})=>r.jsx(of.Provider,{value:{},children:r.jsx(c.View,{...Xh.container,...o==null?void 0:o.container,...t,children:e})}),Na=u.forwardRef(({children:e,designProps:o,shape:t="rounded",decorationRotation:n=5,decorationScale:i=1,decorationOpacity:a=.8,views:l,...d},s)=>{const p=(b=>{switch(b){case"square":return"0px";case"pill":return"9999px";case"rounded":default:return"16px"}})(t),m=Math.abs(n)*(Math.PI/180),h=Math.sin(m)*100,f=(i-1)*100/2,x=Math.ceil(h+f),y=d.backgroundColor??"theme-primary";return r.jsx(c.View,{...d,ref:s,backgroundColor:"transparent",position:"relative",overflow:"visible",...l==null?void 0:l.container,children:r.jsxs(c.View,{padding:d.padding??`${96+x}px ${x}px`,position:"relative",overflow:"visible",children:[r.jsx(c.View,{position:"absolute",top:x,left:x,right:x,bottom:x,backgroundColor:y,borderRadius:p,opacity:a/1.5,transform:`scale(${i})`,pointerEvents:"none",zIndex:1,...l==null?void 0:l.back}),r.jsx(c.View,{position:"absolute",top:x,left:x,right:x,bottom:x,transform:`rotate(${n}deg) scale(${i})`,opacity:a/1.2,backgroundColor:y,borderRadius:p,pointerEvents:"none",zIndex:2,...l==null?void 0:l.front}),r.jsx(c.View,{margin:"0 auto",position:"relative",zIndex:3,...l==null?void 0:l.content,children:e})]})})});Na.displayName="Background.Layout";const ie=ff;ie.Aurora=tf;ie.Meteors=rf;ie.Wall=af;ie.Particles=cf;ie.Grid=sf;ie.Ripples=uf;ie.Image=gf;ie.Video=pf;ie.Gradient=mf;ie.Overlay=hf;ie.Layout=Na;const Ua=u.forwardRef((e,o)=>r.jsx(ie,{...e,ref:o}));Ua.displayName="Background";const Ga=Object.assign(Ua,{Layout:ie.Layout,Aurora:ie.Aurora,Meteors:ie.Meteors,Wall:ie.Wall,Particles:ie.Particles,Grid:ie.Grid,Ripples:ie.Ripples,Image:ie.Image,Video:ie.Video,Gradient:ie.Gradient,Overlay:ie.Overlay});Ga.displayName="Background";function xf(e){const{inputValue:o,onInputChange:t,onSubmit:n,messages:i=[]}=e,[a,l]=u.useState(""),d=u.useRef(null),s=u.useRef(null),g=o!==void 0,p=o!==void 0?o:a,m=u.useCallback(f=>{g?t==null||t(f):l(f)},[g,t]),h=u.useCallback(f=>{f&&f.preventDefault();const x=p.trim();x&&n&&(n(x),g||l(""),d.current&&(d.current.style.height="auto"))},[p,n,g]);return u.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[i.length]),{internalInputValue:p,handleInputChange:m,handleSubmit:h,inputRef:d,messagesRef:s}}const bf={sm:{fontSize:"13px",padding:"8px"},md:{fontSize:"14px",padding:"12px"},lg:{fontSize:"16px",padding:"16px"}},yf={default:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"16px"},glassy:{backgroundColor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(12px)",border:"1px solid rgba(0, 0, 0, 0.1)",borderRadius:"16px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},minimal:{backgroundColor:"transparent",border:"none"}},kf={sm:{fontSize:"13px",padding:"6px 10px",borderRadius:"14px"},md:{fontSize:"14px",padding:"8px 12px",borderRadius:"16px"},lg:{fontSize:"16px",padding:"10px 16px",borderRadius:"18px"}},jf={backgroundColor:"rgba(37, 99, 235, 0.9)",color:"#ffffff",alignSelf:"flex-end",borderBottomRightRadius:"4px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Cf={backgroundColor:"rgba(244, 244, 245, 0.6)",color:"#18181b",alignSelf:"flex-start",borderBottomLeftRadius:"4px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Sf={position:"relative",backgroundColor:"rgba(244, 244, 245, 0.05)",backdropFilter:"blur(12px)",borderRadius:"16px",border:"1px solid rgba(0, 0, 0, 0.1)",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",padding:"8px 12px",display:"flex",alignItems:"flex-end",gap:"8px",transition:"all 0.2s ease"},Se={container:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"hidden"},messagesContainer:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:"8px",padding:"16px"},inputContainer:Sf,bubble:{maxWidth:"80%",position:"relative",wordWrap:"break-word",animation:"chatBubbleAppear 0.3s ease-out"},timestamp:{position:"absolute",top:"-24px",fontSize:"12px",color:"rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(255, 255, 255, 0.9)",padding:"2px 8px",borderRadius:"9999px",opacity:0,transition:"opacity 0.15s ease-out",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},input:{flex:1,border:"none",outline:"none",backgroundColor:"transparent",resize:"none",fontFamily:"inherit",fontSize:"14px",minHeight:"24px",maxHeight:"120px"},sendButton:{width:"32px",height:"32px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},attachmentButton:{width:"32px",height:"32px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",transition:"background-color 0.2s ease",flexShrink:0}},wf=({messages:e=[],inputPlaceholder:o="Type a message...",disableInput:t=!1,variant:n="default",size:i="md",showTimestamps:a=!0,enableAttachments:l=!1,enableContextPicker:d=!1,selectedContextElements:s=[],onContextPickerClick:g,onRemoveContextElement:p,isLoading:m=!1,loadingText:h="Loading...",styles:f={},maxHeight:x="600px",internalInputValue:y,handleInputChange:b,handleSubmit:k,inputRef:C,messagesRef:w,...j})=>{var R;const S={...Se.container,...yf[n],...f.container},I={...Se.messagesContainer,maxHeight:x,...f.messagesContainer},M={...Se.inputContainer,...f.inputContainer},z={...Se.input,...bf[i],...f.input},E=u.useCallback(V=>{b(V.target.value),V.target.style.height="auto",V.target.style.height=`${V.target.scrollHeight}px`},[b]),_=u.useCallback(V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),k())},[k]),T=y.trim().length>0,{onSubmit:$,...B}=j;return r.jsxs(c.View,{...S,...B,children:[r.jsxs(c.View,{ref:w,...I,children:[e.length===0?r.jsx(c.View,{display:"flex",alignItems:"center",justifyContent:"center",flex:1,color:"color-gray-400",children:r.jsx(c.Text,{fontSize:"14px",children:"No messages yet. Start a conversation!"})}):e.map(V=>r.jsx(If,{message:V,size:i,showTimestamp:a,styles:{bubble:f.bubble,userBubble:f.userBubble,assistantBubble:f.assistantBubble,timestamp:f.timestamp,reasoningContainer:f.reasoningContainer,reasoningContent:f.reasoningContent,errorMessage:f.errorMessage,systemMessage:f.systemMessage,toolMessage:f.toolMessage}},V.id)),m&&r.jsxs(c.Horizontal,{justifyContent:"flex-start",alignItems:"center",gap:8,marginTop:"8px",...f.loadingIndicator,children:[r.jsx(Mt,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(c.Text,{color:"color-gray-500",fontSize:"14px",children:h})]})]}),r.jsxs(c.View,{children:[s.length>0&&r.jsx(c.Horizontal,{gap:8,marginBottom:"8px",flexWrap:"wrap",paddingHorizontal:"20px",...f.contextChipsContainer,children:s.map(V=>r.jsxs(c.Horizontal,{backgroundColor:"rgba(37, 99, 235, 0.1)",border:"1px solid rgba(37, 99, 235, 0.2)",borderRadius:"6px",padding:"4px 8px",alignItems:"center",gap:6,children:[r.jsx(c.Text,{fontSize:"12px",color:"color-blue-700",fontWeight:"500",children:V.name}),r.jsx(c.View,{as:"button",type:"button",onClick:()=>p==null?void 0:p(V.id),cursor:"pointer",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",children:r.jsx(fe,{widthHeight:12,color:"color-blue-700"})})]},V.id))}),r.jsxs(c.View,{as:"form",onSubmit:k,...M,children:[l&&r.jsx(c.View,{as:"button",type:"button",...Se.attachmentButton,...f.attachmentButton,_hover:{backgroundColor:"color-gray-100"},children:r.jsx(po,{widthHeight:16,color:"color-gray-600"})}),r.jsx(c.View,{as:"textarea",ref:C,value:y,onChange:E,onKeyDown:_,placeholder:o,disabled:t||m,...z,style:{...z,opacity:t||m?.5:1}}),r.jsxs(c.Vertical,{gap:4,alignItems:"center",children:[d&&r.jsx(c.View,{as:"button",type:"button",onClick:g,...Se.attachmentButton,...f.contextPickerButton,_hover:{backgroundColor:"color-gray-100",...(R=f.contextPickerButton)==null?void 0:R._hover},title:"Select element from page",children:r.jsx(Wr,{widthHeight:16,color:"color-gray-600"})}),r.jsx(c.View,{as:"button",type:"submit",disabled:!T||t||m,...Se.sendButton,backgroundColor:T?"theme-primary":"color-gray-300",_hover:{backgroundColor:T?"color-blue-600":"color-gray-300"},...f.sendButton,style:{cursor:T?"pointer":"not-allowed",opacity:!T||t||m?.6:1},children:r.jsx(Tt,{widthHeight:16,color:"color-white",filled:!1})})]})]})]})]})},If=({message:e,size:o,showTimestamp:t,styles:n})=>{const[i,a]=u.useState(!1),[l,d]=u.useState(!1),s=e.role==="user",g=e.messageType==="system",p=e.messageType==="error",m=e.messageType==="tool";if(g)return r.jsx(c.View,{display:"flex",justifyContent:"center",padding:"8px",width:"100%",...n.systemMessage,children:r.jsxs(c.Horizontal,{gap:6,alignItems:"center",opacity:.7,children:[r.jsx(ze,{widthHeight:12,color:"color-gray-600"}),r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.content})]})});if(m)return r.jsx(c.View,{display:"flex",justifyContent:"flex-start",padding:"8px 16px",width:"100%",...n.toolMessage,children:r.jsxs(c.Horizontal,{gap:8,alignItems:"center",backgroundColor:"rgba(0,0,0,0.03)",padding:"8px",borderRadius:"8px",width:"100%",border:"1px solid rgba(0,0,0,0.05)",children:[r.jsx(Rr,{widthHeight:14,color:"color-gray-600"}),r.jsxs(c.Vertical,{gap:2,children:[r.jsx(c.Text,{fontSize:"11px",fontWeight:"600",color:"color-gray-700",children:"Tool Usage"}),r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",fontFamily:"monospace",children:e.content})]})]})});const h={...Se.bubble,...kf[o],...s?jf:Cf,...p?{backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.2)",color:"#b91c1c"}:{},...n.bubble,...s?n.userBubble:n.assistantBubble,...p?n.errorMessage:{}},f={...Se.timestamp,[s?"right":"left"]:"8px",opacity:i?1:0,...n.timestamp};return r.jsx(c.View,{position:"relative",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),display:"flex",justifyContent:s?"flex-end":"flex-start",children:r.jsxs(c.View,{...h,children:[t&&r.jsx(c.View,{...f,children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),p&&r.jsxs(c.Horizontal,{gap:6,marginBottom:"4px",alignItems:"center",children:[r.jsx(Uo,{widthHeight:14,color:"#b91c1c"}),r.jsx(c.Text,{fontWeight:"600",fontSize:"12px",children:"Error"})]}),e.reasoning&&r.jsxs(c.View,{marginBottom:"8px",borderBottom:"1px solid rgba(0,0,0,0.05)",paddingBottom:"8px",...n.reasoningContainer,children:[r.jsxs(c.Horizontal,{as:"button",onClick:()=>d(!l),cursor:"pointer",gap:4,alignItems:"center",backgroundColor:"transparent",border:"none",padding:0,children:[r.jsx(c.Text,{fontSize:"11px",color:"color-gray-500",fontWeight:"600",children:"Thinking Process"}),r.jsx(ae,{orientation:l?"down":"right",widthHeight:10,color:"color-gray-500"})]}),l&&r.jsx(c.View,{padding:"8px",backgroundColor:"rgba(0,0,0,0.03)",borderRadius:"8px",marginTop:"4px",...n.reasoningContent,children:r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.reasoning})})]}),r.jsx(c.View,{whiteSpace:"pre-wrap",wordBreak:"break-word",children:e.content}),e.attachments&&e.attachments.length>0&&r.jsx(c.Vertical,{gap:4,marginTop:"8px",children:e.attachments.map(x=>r.jsxs(c.Horizontal,{gap:6,padding:"6px 8px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",fontSize:"12px",children:[r.jsx(po,{widthHeight:14}),r.jsx(c.Text,{children:x.name})]},x.id))}),e.contextElements&&e.contextElements.length>0&&r.jsxs(c.Vertical,{gap:4,marginTop:"8px",children:[r.jsx(c.Text,{fontSize:"11px",color:"rgba(0,0,0,0.5)",fontWeight:"600",children:"Context:"}),e.contextElements.map(x=>r.jsx(c.Horizontal,{gap:6,padding:"4px 8px",backgroundColor:"rgba(37, 99, 235, 0.1)",borderRadius:"6px",fontSize:"11px",border:"1px solid rgba(37, 99, 235, 0.2)",children:r.jsx(c.Text,{color:"color-blue-700",fontWeight:"500",children:x.name})},x.id))]})]})})},vt=e=>{const o=xf(e);return r.jsx(wf,{...e,...o})};vt.displayName="ChatWidget";const Ya=vt;function Tf({onSelect:e,onCancel:o,active:t}){const[n,i]=u.useState(null);u.useRef(null);const a=u.useCallback(s=>{var f;if(!t)return;const g=document.elementFromPoint(s.clientX,s.clientY);if(!g||g===document.body||g.closest('[data-chatwidget-ignore="true"]')||g.closest("#chatwidget-overlay")){i(null);return}const p=g.getBoundingClientRect();let m=g.tagName.toLowerCase();if(g.id)m+=`#${g.id}`;else if(g.className&&typeof g.className=="string"){const x=g.className.split(" ")[0];x&&(m+=`.${x}`)}const h=(f=g.innerText)==null?void 0:f.slice(0,20);h&&(m+=` ("${h}...")`),i({id:g.id||`el-${Date.now()}`,name:m,tagName:g.tagName.toLowerCase(),rect:p})},[t]),l=u.useCallback(s=>{!t||s.target.closest('[data-chatwidget-ignore="true"]')||(s.preventDefault(),s.stopPropagation(),n&&e(n))},[t,n,e]),d=u.useCallback(s=>{t&&s.key==="Escape"&&o()},[t,o]);return u.useEffect(()=>(t?(document.addEventListener("mousemove",a),document.addEventListener("click",l,!0),document.addEventListener("keydown",d),document.body.style.cursor="crosshair"):(i(null),document.removeEventListener("mousemove",a),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""),()=>{document.removeEventListener("mousemove",a),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""}),[t,a,l,d]),{highlightedElement:n}}function Mf({element:e}){return e?r.jsx("div",{id:"chatwidget-overlay",style:{position:"fixed",top:e.rect.top,left:e.rect.left,width:e.rect.width,height:e.rect.height,border:"2px solid #2563eb",backgroundColor:"rgba(37, 99, 235, 0.1)",pointerEvents:"none",zIndex:99999,transition:"all 0.1s ease-out",borderRadius:"4px"},children:r.jsx("div",{style:{position:"absolute",top:"-24px",left:"0",backgroundColor:"#2563eb",color:"white",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",fontWeight:"bold",whiteSpace:"nowrap"},children:e.name})}):null}const zf=({initialMessages:e=[],onSendMessage:o,bubbleSize:t="md"})=>{const[n,i]=u.useState(!1),[a,l]=u.useState(!1),[d,s]=u.useState(e),[g,p]=u.useState([]),{highlightedElement:m}=Tf({active:a,onSelect:b=>{p(k=>[...k,b]),l(!1),i(!0)},onCancel:()=>{l(!1),i(!0)}}),h=()=>i(!n),f=()=>{l(!0),i(!1)},x=b=>{p(k=>k.filter(C=>C.id!==b))},y=b=>{const k={id:Date.now().toString(),role:"user",content:b,timestamp:new Date,contextElements:[...g]};s(C=>[...C,k]),o==null||o(b,g),p([]),setTimeout(()=>{var S;const C=Math.random()>.7,w=Math.random()>.4,j={id:(Date.now()+1).toString(),role:"assistant",timestamp:new Date,content:C?"I will highlight the selected element.":`I received your message regarding: ${((S=k.contextElements)==null?void 0:S.map(I=>I.name).join(", "))||"general context"}. How can I assist you further?`,messageType:C?"tool":"text",reasoning:w?"Analyzing the user input and context... The user seems to be asking about specific elements. I should tailor my response to the selected context.":void 0};s(I=>[...I,j]),C&&setTimeout(()=>{s(I=>[...I,{id:(Date.now()+2).toString(),role:"assistant",messageType:"system",content:'Tool "highlightElement" executed successfully.',timestamp:new Date}])},800)},1e3)};return r.jsxs(c.View,{position:"fixed",bottom:24,right:24,zIndex:9999,children:[r.jsx(Mf,{element:m}),a&&r.jsx(c.View,{position:"fixed",top:24,left:"50%",transform:"translateX(-50%)",backgroundColor:"rgba(0,0,0,0.8)",color:"white",padding:"8px 16px",borderRadius:"24px",zIndex:1e4,boxShadow:"0 4px 6px rgba(0,0,0,0.1)",children:r.jsx(c.Text,{fontWeight:"600",fontSize:"14px",children:"Click an element to select it. Press ESC to cancel."})}),n&&r.jsxs(c.View,{position:"absolute",bottom:60,right:0,width:"400px",height:"600px",marginBottom:"16px",backgroundColor:"rgba(255, 255, 255, 0.8)",backdropFilter:"blur(20px)",borderRadius:"24px",border:"1px solid rgba(255, 255, 255, 0.4)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden",animation:"slideUp 0.3s ease-out",style:{animation:"fadeIn 0.2s ease-out",transformOrigin:"bottom right"},children:[r.jsxs(c.View,{padding:"16px",borderBottom:"1px solid rgba(0,0,0,0.05)",display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"bold",color:"color-gray-800",children:"ChatWidget Assistant"}),r.jsx(c.View,{as:"button",onClick:()=>i(!1),cursor:"pointer",padding:"4px",borderRadius:"50%",border:"none",backgroundColor:"transparent",_hover:{backgroundColor:"rgba(0,0,0,0.05)"},children:r.jsx(fe,{widthHeight:16,color:"color-gray-500"})})]}),r.jsx(Ya,{messages:d,onSubmit:y,size:t,variant:"minimal",enableContextPicker:!0,selectedContextElements:g,onContextPickerClick:f,onRemoveContextElement:x,styles:{container:{height:"calc(100% - 60px)",backgroundColor:"transparent"},inputContainer:{backgroundColor:"white",margin:"0 16px 16px 16px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"}}})]}),!a&&r.jsx(c.View,{as:"button",onClick:h,width:"56px",height:"56px",borderRadius:"50%",backgroundColor:"theme-primary",border:"none",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",_hover:{transform:"scale(1.05)"},_active:{transform:"scale(0.95)"},"data-chatwidget-ignore":"true",children:n?r.jsx(fe,{widthHeight:24,color:"white"}):r.jsx(Pr,{widthHeight:24,color:"white"})})]})};exports.Accordion=Do;exports.Alert=Il;exports.ArrowIcon=fl;exports.AspectRatio=zl;exports.AttachmentGroup=ma;exports.AttachmentIcon=po;exports.AttachmentPreview=Gg;exports.AudioIcon=Fo;exports.AudioInput=Ll;exports.AudioWaveform=Pt;exports.Avatar=ql;exports.BackIcon=Di;exports.Background=Ga;exports.Badge=Xl;exports.BatteryIcon=wi;exports.BluetoothIcon=gl;exports.BoldArrowIcon=hl;exports.BookmarkIcon=Ii;exports.Button=_e;exports.CalendarIcon=tl;exports.CameraIcon=ul;exports.Card=Xo;exports.Carousel=Xe;exports.Chart=Nc;exports.ChartIcon=Bi;exports.ChatInput=qa;exports.ChatWidget=Ya;exports.ChatWidgetComponent=vt;exports.ChatWidgetWidget=zf;exports.CheckIcon=Ai;exports.Checkbox=Hs;exports.ChevronIcon=ae;exports.ClockIcon=rl;exports.CloseEyeIcon=zt;exports.CloseIcon=fe;exports.CloudIcon=Ti;exports.ColorInput=Os;exports.ColorPicker=im;exports.ComboBox=mu;exports.Command=eo;exports.ContextMenu=Ke;exports.CookieConsent=Xc;exports.CopyIcon=Mi;exports.CountryPicker=Xs;exports.CreditCardIcon=Zi;exports.CropIcon=yl;exports.DatePicker=au;exports.DeleteIcon=zi;exports.Divider=Vm;exports.DocumentIcon=Hi;exports.DownloadIcon=Ei;exports.DragAndDrop=Fp;exports.DragAndDropComponent=pa;exports.DragHandleIcon=di;exports.DragHandleLinesIcon=jl;exports.Drawer=Ze;exports.DropZone=Up;exports.DropdownMenu=yo;exports.DustBinIcon=Oo;exports.EditIcon=Ri;exports.EmojiPicker=cm;exports.ErrorIcon=Uo;exports.ExternalLinkIcon=Er;exports.FacebookIcon=bi;exports.FileIcon=go;exports.FileImage=rs;exports.FileSVG=ts;exports.FilterIcon=ol;exports.FolderIcon=si;exports.FormikChatInput=Xu;exports.FormikCheckbox=Mu;exports.FormikColorInput=Qu;exports.FormikComboBox=hg;exports.FormikCountryPicker=og;exports.FormikDatePicker=Ju;exports.FormikEmojiPicker=Ug;exports.FormikForm=wu;exports.FormikIconPicker=Lg;exports.FormikOTPInput=Sg;exports.FormikPassword=pg;exports.FormikRadio=$u;exports.FormikSelect=rg;exports.FormikSelector=Tg;exports.FormikSlider=jg;exports.FormikSwitch=ag;exports.FormikTagInput=lg;exports.FormikTextArea=sg;exports.FormikTextField=ug;exports.FormikToggle=Vg;exports.FormikToggleGroup=Wg;exports.FormikUploader=An;exports.GiftIcon=Ui;exports.HeartIcon=ji;exports.HelpIcon=ci;exports.HomeIcon=Vi;exports.HoverCard=he;exports.Icon=Eo;exports.IconPicker=dm;exports.ImageIcon=gi;exports.InfoIcon=ze;exports.InstagramIcon=fi;exports.LayoutIcon=Ki;exports.LikeIcon=dl;exports.Link=Ar;exports.LinkIcon=Xi;exports.LinkedinIcon=yi;exports.Loader=uo;exports.LoadingSpinnerIcon=Mt;exports.LockIcon=Wi;exports.LogoutIcon=Yi;exports.MagicWandIcon=cl;exports.MapPinIcon=nl;exports.MediaPreview=Xg;exports.MenuIcon=al;exports.Menubar=Le;exports.MessageLayout=Pl;exports.MessageView=Hr;exports.MicrophoneIcon=It;exports.MinusIcon=Mr;exports.Modal=Be;exports.MoonIcon=Li;exports.MoreIcon=Ji;exports.MousePointerIcon=Wr;exports.NavigationMenu=Je;exports.NotificationIcon=$i;exports.OTPInput=Cu;exports.OpenEyeIcon=Rt;exports.Pagination=jm;exports.PanelIcon=Pr;exports.Password=lu;exports.PauseIcon=zr;exports.PlayIcon=St;exports.PlusIcon=Pi;exports.PowerOffIcon=vi;exports.PrintIcon=ll;exports.ProfileIcon=_i;exports.ProgressBar=wm;exports.RefreshIcon=il;exports.Resizable=Ut;exports.RotateIcon=Ni;exports.SaveIcon=Si;exports.SearchIcon=Po;exports.Select=ks;exports.Selector=zs;exports.SendIcon=Tt;exports.Separator=Rm;exports.SettingsIcon=Rr;exports.ShapeIcon=qi;exports.ShareButton=Bm;exports.ShareIcon=Vr;exports.ShieldIcon=Gi;exports.Sidebar=ko;exports.Slider=vg;exports.SliderIcon=bl;exports.SpinnerIcon=xl;exports.StarIcon=Ci;exports.StatusIndicator=Am;exports.StopIcon=qo;exports.SuccessIcon=Vt;exports.Switch=Ts;exports.Table=Ce;exports.Tabs=Zo;exports.TagInput=xu;exports.TextArea=Vs;exports.TextField=xo;exports.TextIcon=Oi;exports.ThreadsIcon=ki;exports.TickIcon=No;exports.Title=Hp;exports.Toast=hh;exports.Toggle=qn;exports.ToggleGroup=Lp;exports.Tooltip=Yt;exports.TrashIcon=el;exports.TwitchIcon=hi;exports.TwitterIcon=pi;exports.UnLikeIcon=sl;exports.UnlockIcon=pl;exports.UploadIcon=Et;exports.Uploader=Yo;exports.UserIcon=li;exports.VideoIcon=ui;exports.WarningIcon=wt;exports.WifiIcon=ml;exports.XIcon=mi;exports.YoutubeIcon=xi;exports.ZapIcon=Qi;exports.ZoomInIcon=kl;exports.ZoomOutIcon=Fi;exports.hideMessage=$r;exports.hideModal=Dt;exports.showMessage=_r;exports.showModal=Kg;exports.showToast=Ae;exports.useMessageStore=Go;exports.useModalStore=Re;exports.useToast=fh;
37
+ `})]})},uf=({number:e=20,children:o,...t})=>{const n=Array.from({length:e},(i,a)=>a);return r.jsxs(c.View,{width:"100%",height:"100%",backgroundColor:"black",position:"relative",overflow:"hidden",...t,children:[n.map(i=>{const a=i*37%200-100+"px",l=.2+i*13%6*.1+"s",d=(1+i*7%9)/2+"s",s=300+i*17%100+"px";return r.jsx(c.View,{position:"absolute",top:"0px",left:a,width:"2px",height:"2px",borderRadius:"9999px",backgroundColor:"white",boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)",transform:"rotate(215deg)",zIndex:0,animate:{from:{transform:"translateX(-100%) translateY(-100%)"},to:{transform:`translateX(${s}) translateY(${s})`},iterationCount:"infinite",timingFunction:"linear",fillMode:"forwards",duration:d,delay:l},children:r.jsx(c.View,{position:"absolute",top:"-1px",left:"-1px",width:"1px",height:"1px",borderRadius:"9999px",backgroundColor:"white",boxShadow:"0 10px 0 1px rgba(255, 255, 255, 0.1)"})},i)}),o&&r.jsx(c.View,{position:"relative",zIndex:1,width:"100%",height:"100%",children:o})]})},wr=["rgb(186, 230, 253)","rgb(249, 168, 212)","rgb(134, 239, 172)","rgb(253, 224, 71)","rgb(252, 165, 165)","rgb(216, 180, 254)","rgb(147, 197, 253)","rgb(165, 180, 252)","rgb(196, 181, 253)"],gf=()=>wr[Math.floor(Math.random()*wr.length)],pf=({rows:e=15,cols:o=10,squareSize:t=40,...n})=>{const i=Array(e).fill(1),a=Array(o).fill(1);return r.jsx(c.View,{padding:16,width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-50",zIndex:0,transform:"skewX(-48deg) skewY(14deg) scale(0.675) rotate(0deg) translateZ(0)",...n,children:i.map((l,d)=>r.jsx(c.Horizontal,{gap:0,children:a.map((s,g)=>r.jsx(c.View,{height:t/3,width:t,borderStyle:"solid",borderColor:"color-gray-200",borderWidth:.5,backgroundColor:"transparent",cursor:"pointer",on:{hover:{backgroundColor:gf(),transition:"background-color 0.2s ease"}}},`col-${g}`))},`row-${d}`))})},mf=["rgb(59, 130, 246)","rgb(147, 51, 234)","rgb(236, 72, 153)","rgb(34, 197, 94)","rgb(251, 146, 60)","rgb(168, 85, 247)"],hf=({count:e=50,colors:o=mf,speed:t="medium",shapes:n=["circle"],...i})=>{const a=Array.from({length:e},(g,p)=>p),l=()=>{switch(t){case"slow":return .5;case"fast":return 2;default:return 1}},d=()=>n[Math.floor(Math.random()*n.length)],s=()=>o[Math.floor(Math.random()*o.length)];return r.jsx(c.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...i,children:a.map(g=>{const p=Math.random()*8+4,m=Math.random()*400,h=Math.random()*300,f=Math.random()*400,x=Math.random()*300,y=(Math.random()*10+5)/l(),b=Math.random()*5,k=d(),S=s(),w={circle:{borderRadius:"50%"},square:{borderRadius:"2px"},triangle:{borderRadius:"0",clipPath:"polygon(50% 0%, 0% 100%, 100% 100%)"}};return r.jsx(c.View,{position:"absolute",width:p,height:p,backgroundColor:S,opacity:.7,style:{left:m,top:h,...w[k]},animate:{from:{transform:"translate(0px, 0px) scale(0.5)",opacity:0},to:{transform:`translate(${f-m}px, ${x-h}px) scale(1)`,opacity:.7},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${y}s`,delay:`${b}s`}},g)})})},ff=({gridSize:e=30,lineColor:o="rgba(59, 130, 246, 0.3)",pulseColor:t="rgba(59, 130, 246, 0.8)",animationSpeed:n="medium",...i})=>{const a=()=>{switch(n){case"slow":return 4;case"fast":return 1;default:return 2}},l=Math.floor(400/e),d=Math.floor(300/e),s=l*d,g=Array.from({length:s},(p,m)=>m);return r.jsxs(c.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...i,children:[Array.from({length:l+1},(p,m)=>r.jsx(c.View,{position:"absolute",left:m*e,top:0,width:1,height:"100%",backgroundColor:o},`v-line-${m}`)),Array.from({length:d+1},(p,m)=>r.jsx(c.View,{position:"absolute",left:0,top:m*e,width:"100%",height:1,backgroundColor:o},`h-line-${m}`)),g.map(p=>{const m=p%l,h=Math.floor(p/l),f=(m+h)*.1;return r.jsx(c.View,{position:"absolute",left:m*e+1,top:h*e+1,width:e-2,height:e-2,backgroundColor:"transparent",animate:{from:{backgroundColor:"transparent"},to:{backgroundColor:t},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${a()}s`,delay:`${f}s`}},p)})]})},xf=["rgba(59, 130, 246, 0.6)","rgba(147, 51, 234, 0.6)","rgba(236, 72, 153, 0.6)","rgba(34, 197, 94, 0.6)"],bf=({rippleCount:e=5,colors:o=xf,maxSize:t=200,frequency:n=3,...i})=>{const a=Array.from({length:e},(l,d)=>({id:d,x:Math.random()*400,y:Math.random()*300,color:o[d%o.length],delay:d*(n/e),duration:3+Math.random()*2}));return r.jsxs(c.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-100",...i,children:[a.map(l=>r.jsx(c.View,{position:"absolute",width:20,height:20,borderRadius:"50%",style:{left:l.x-10,top:l.y-10,border:`2px solid ${l.color}`,backgroundColor:"transparent"},animate:{from:{transform:"scale(0)",opacity:1},to:{transform:`scale(${t/20})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${l.duration}s`,delay:`${l.delay}s`}},l.id)),a.map(l=>r.jsx(c.View,{position:"absolute",width:10,height:10,borderRadius:"50%",style:{left:l.x-5,top:l.y-5,backgroundColor:l.color},animate:{from:{transform:"scale(1)",opacity:.8},to:{transform:`scale(${t/40})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${l.duration*1.2}s`,delay:`${l.delay+.5}s`}},`secondary-${l.id}`))]})},yf=({children:e,src:o,backgroundSize:t="cover",backgroundPosition:n="center",backgroundRepeat:i="no-repeat",backgroundAttachment:a="scroll",imageOpacity:l=1,overlay:d=null,blendMode:s="normal",views:g,themeMode:p,...m})=>{const h={...st.image,backgroundImage:`url(${o})`,backgroundSize:t,backgroundPosition:n,backgroundRepeat:i,backgroundAttachment:a,opacity:l};return r.jsxs(c.View,{...st.container,...g==null?void 0:g.container,...m,children:[r.jsx(c.View,{style:h,...g==null?void 0:g.image}),d,e&&r.jsx(c.View,{...st.content,...g==null?void 0:g.content,children:e})]})},kf=({children:e,src:o,autoPlay:t=!0,loop:n=!0,muted:i=!0,playsInline:a=!0,overlay:l=null,blendMode:d="normal",views:s,themeMode:g,...p})=>r.jsxs(c.View,{...dt.container,...s==null?void 0:s.container,...p,children:[r.jsx(c.View,{as:"video",src:o,autoPlay:t,loop:n,muted:i,playsInline:a,style:dt.video,...s==null?void 0:s.video}),l,e&&r.jsx(c.View,{...dt.content,...s==null?void 0:s.content,children:e})]}),jf=({children:e,...o})=>r.jsx(cf,{...o,children:e}),Cf=({contentPosition:e,backgroundColor:o="color-black-900",...t})=>{const i=(()=>{let a=`${o}-100`,l=`${o}-900`,d=`${o}-600`,s=`${o}-400`;switch(o.indexOf("-")===-1&&(a=`color-mix(in srgb, ${o} 10%, transparent)`,l=`color-mix(in srgb, ${o} 90%, transparent)`,d=`color-mix(in srgb, ${o} 70%, transparent)`,s=`color-mix(in srgb, ${o} 50%, transparent)`),e){case"left":return`radial-gradient(circle at 70% 50%, ${a} 0%, ${a} 100%), linear-gradient(to right, ${l} 0%, ${d} 65%, ${a} 100%)`;case"right":return`radial-gradient(circle at 30% 50%, ${a} 0%, ${a} 100%), linear-gradient(to left, ${l} 0%, ${d} 65%, ${a} 100%)`;case"top":return`radial-gradient(circle at 50% 40%, ${a} 0%, ${a} 100%), linear-gradient(to bottom, ${l} 0%, ${d} 60%, ${a} 100%)`;case"bottom":return`radial-gradient(circle at 50% 60%, ${a} 0%, ${a} 100%), linear-gradient(to top, ${l} 0%, ${d} 60%, ${a} 100%)`;case"center":return`radial-gradient(circle at 50% 70%, ${l} 0%, ${a} 100%)`;default:return s}})();return r.jsx(c.View,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:i,pointerEvents:"none",zIndex:1,...t})},Sf=({children:e,views:o,...t})=>r.jsx(sf.Provider,{value:{},children:r.jsx(c.View,{...tf.container,...o==null?void 0:o.container,...t,children:e})}),Na=u.forwardRef(({children:e,designProps:o,shape:t="rounded",decorationRotation:n=5,decorationScale:i=1,decorationOpacity:a=.8,views:l,...d},s)=>{const p=(b=>{switch(b){case"square":return"0px";case"pill":return"9999px";case"rounded":default:return"16px"}})(t),m=Math.abs(n)*(Math.PI/180),h=Math.sin(m)*100,f=(i-1)*100/2,x=Math.ceil(h+f),y=d.backgroundColor??"theme-primary";return r.jsx(c.View,{...d,ref:s,backgroundColor:"transparent",position:"relative",overflow:"visible",...l==null?void 0:l.container,children:r.jsxs(c.View,{padding:d.padding??`${96+x}px ${x}px`,position:"relative",overflow:"visible",children:[r.jsx(c.View,{position:"absolute",top:x,left:x,right:x,bottom:x,backgroundColor:y,borderRadius:p,opacity:a/1.5,transform:`scale(${i})`,pointerEvents:"none",zIndex:1,...l==null?void 0:l.back}),r.jsx(c.View,{position:"absolute",top:x,left:x,right:x,bottom:x,transform:`rotate(${n}deg) scale(${i})`,opacity:a/1.2,backgroundColor:y,borderRadius:p,pointerEvents:"none",zIndex:2,...l==null?void 0:l.front}),r.jsx(c.View,{margin:"0 auto",position:"relative",zIndex:3,...l==null?void 0:l.content,children:e})]})})});Na.displayName="Background.Layout";const ie=Sf;ie.Aurora=df;ie.Meteors=uf;ie.Wall=pf;ie.Particles=hf;ie.Grid=ff;ie.Ripples=bf;ie.Image=yf;ie.Video=kf;ie.Gradient=jf;ie.Overlay=Cf;ie.Layout=Na;const Ua=u.forwardRef((e,o)=>r.jsx(ie,{...e,ref:o}));Ua.displayName="Background";const Ga=Object.assign(Ua,{Layout:ie.Layout,Aurora:ie.Aurora,Meteors:ie.Meteors,Wall:ie.Wall,Particles:ie.Particles,Grid:ie.Grid,Ripples:ie.Ripples,Image:ie.Image,Video:ie.Video,Gradient:ie.Gradient,Overlay:ie.Overlay});Ga.displayName="Background";function wf(e){const{inputValue:o,onInputChange:t,onSubmit:n,messages:i=[]}=e,[a,l]=u.useState(""),d=u.useRef(null),s=u.useRef(null),g=o!==void 0,p=o!==void 0?o:a,m=u.useCallback(f=>{g?t==null||t(f):l(f)},[g,t]),h=u.useCallback(f=>{f&&f.preventDefault();const x=p.trim();x&&n&&(n(x),g||l(""),d.current&&(d.current.style.height="auto"))},[p,n,g]);return u.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[i.length]),{internalInputValue:p,handleInputChange:m,handleSubmit:h,inputRef:d,messagesRef:s}}const If={sm:{fontSize:"13px",padding:"8px"},md:{fontSize:"14px",padding:"12px"},lg:{fontSize:"16px",padding:"16px"}},Tf={default:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"16px"},glassy:{backgroundColor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(12px)",border:"1px solid rgba(0, 0, 0, 0.1)",borderRadius:"16px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},minimal:{backgroundColor:"transparent",border:"none"}},Mf={sm:{fontSize:"13px",padding:"6px 10px",borderRadius:"14px"},md:{fontSize:"14px",padding:"8px 12px",borderRadius:"16px"},lg:{fontSize:"16px",padding:"10px 16px",borderRadius:"18px"}},zf={backgroundColor:"rgba(37, 99, 235, 0.9)",color:"#ffffff",alignSelf:"flex-end",borderBottomRightRadius:"4px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Rf={backgroundColor:"rgba(244, 244, 245, 0.6)",color:"#18181b",alignSelf:"flex-start",borderBottomLeftRadius:"4px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Vf={position:"relative",backgroundColor:"rgba(244, 244, 245, 0.05)",backdropFilter:"blur(12px)",borderRadius:"16px",border:"1px solid rgba(0, 0, 0, 0.1)",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",padding:"8px 12px",display:"flex",alignItems:"flex-end",gap:"8px",transition:"all 0.2s ease"},Se={container:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"hidden"},messagesContainer:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:"8px",padding:"16px"},inputContainer:Vf,bubble:{maxWidth:"80%",position:"relative",wordWrap:"break-word",animation:"chatBubbleAppear 0.3s ease-out"},timestamp:{position:"absolute",top:"-24px",fontSize:"12px",color:"rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(255, 255, 255, 0.9)",padding:"2px 8px",borderRadius:"9999px",opacity:0,transition:"opacity 0.15s ease-out",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},input:{flex:1,border:"none",outline:"none",backgroundColor:"transparent",resize:"none",fontFamily:"inherit",fontSize:"14px",minHeight:"24px",maxHeight:"120px"},sendButton:{width:"32px",height:"32px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},attachmentButton:{width:"32px",height:"32px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",transition:"background-color 0.2s ease",flexShrink:0}},Ef=({messages:e=[],inputPlaceholder:o="Type a message...",disableInput:t=!1,variant:n="default",size:i="md",showTimestamps:a=!0,enableAttachments:l=!1,enableContextPicker:d=!1,selectedContextElements:s=[],onContextPickerClick:g,onRemoveContextElement:p,isLoading:m=!1,loadingText:h="Loading...",styles:f={},maxHeight:x="600px",internalInputValue:y,handleInputChange:b,handleSubmit:k,inputRef:S,messagesRef:w,...j})=>{var P;const C={...Se.container,...Tf[n],...f.container},I={...Se.messagesContainer,maxHeight:x,...f.messagesContainer},M={...Se.inputContainer,...f.inputContainer},R={...Se.input,...If[i],...f.input},V=u.useCallback(z=>{b(z.target.value),z.target.style.height="auto",z.target.style.height=`${z.target.scrollHeight}px`},[b]),_=u.useCallback(z=>{z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),k())},[k]),T=y.trim().length>0,{onSubmit:W,...B}=j;return r.jsxs(c.View,{...C,...B,children:[r.jsxs(c.View,{ref:w,...I,children:[e.length===0?r.jsx(c.View,{display:"flex",alignItems:"center",justifyContent:"center",flex:1,color:"color-gray-400",children:r.jsx(c.Text,{fontSize:"14px",children:"No messages yet. Start a conversation!"})}):e.map(z=>r.jsx(Pf,{message:z,size:i,showTimestamp:a,styles:{bubble:f.bubble,userBubble:f.userBubble,assistantBubble:f.assistantBubble,timestamp:f.timestamp,reasoningContainer:f.reasoningContainer,reasoningContent:f.reasoningContent,errorMessage:f.errorMessage,systemMessage:f.systemMessage,toolMessage:f.toolMessage}},z.id)),m&&r.jsxs(c.Horizontal,{justifyContent:"flex-start",alignItems:"center",gap:8,marginTop:"8px",...f.loadingIndicator,children:[r.jsx(Tt,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(c.Text,{color:"color-gray-500",fontSize:"14px",children:h})]})]}),r.jsxs(c.View,{children:[s.length>0&&r.jsx(c.Horizontal,{gap:8,marginBottom:"8px",flexWrap:"wrap",paddingHorizontal:"20px",...f.contextChipsContainer,children:s.map(z=>r.jsxs(c.Horizontal,{backgroundColor:"rgba(37, 99, 235, 0.1)",border:"1px solid rgba(37, 99, 235, 0.2)",borderRadius:"6px",padding:"4px 8px",alignItems:"center",gap:6,children:[r.jsx(c.Text,{fontSize:"12px",color:"color-blue-700",fontWeight:"500",children:z.name}),r.jsx(c.View,{as:"button",type:"button",onClick:()=>p==null?void 0:p(z.id),cursor:"pointer",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",children:r.jsx(fe,{widthHeight:12,color:"color-blue-700"})})]},z.id))}),r.jsxs(c.View,{as:"form",onSubmit:k,...M,children:[l&&r.jsx(c.View,{as:"button",type:"button",...Se.attachmentButton,...f.attachmentButton,_hover:{backgroundColor:"color-gray-100"},children:r.jsx(po,{widthHeight:16,color:"color-gray-600"})}),r.jsx(c.View,{as:"textarea",ref:S,value:y,onChange:V,onKeyDown:_,placeholder:o,disabled:t||m,...R,style:{...R,opacity:t||m?.5:1}}),r.jsxs(c.Vertical,{gap:4,alignItems:"center",children:[d&&r.jsx(c.View,{as:"button",type:"button",onClick:g,...Se.attachmentButton,...f.contextPickerButton,_hover:{backgroundColor:"color-gray-100",...(P=f.contextPickerButton)==null?void 0:P._hover},title:"Select element from page",children:r.jsx(Wr,{widthHeight:16,color:"color-gray-600"})}),r.jsx(c.View,{as:"button",type:"submit",disabled:!T||t||m,...Se.sendButton,backgroundColor:T?"theme-primary":"color-gray-300",_hover:{backgroundColor:T?"color-blue-600":"color-gray-300"},...f.sendButton,style:{cursor:T?"pointer":"not-allowed",opacity:!T||t||m?.6:1},children:r.jsx(It,{widthHeight:16,color:"color-white",filled:!1})})]})]})]})]})},Pf=({message:e,size:o,showTimestamp:t,styles:n})=>{const[i,a]=u.useState(!1),[l,d]=u.useState(!1),s=e.role==="user",g=e.messageType==="system",p=e.messageType==="error",m=e.messageType==="tool";if(g)return r.jsx(c.View,{display:"flex",justifyContent:"center",padding:"8px",width:"100%",...n.systemMessage,children:r.jsxs(c.Horizontal,{gap:6,alignItems:"center",opacity:.7,children:[r.jsx(ze,{widthHeight:12,color:"color-gray-600"}),r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.content})]})});if(m)return r.jsx(c.View,{display:"flex",justifyContent:"flex-start",padding:"8px 16px",width:"100%",...n.toolMessage,children:r.jsxs(c.Horizontal,{gap:8,alignItems:"center",backgroundColor:"rgba(0,0,0,0.03)",padding:"8px",borderRadius:"8px",width:"100%",border:"1px solid rgba(0,0,0,0.05)",children:[r.jsx(Rr,{widthHeight:14,color:"color-gray-600"}),r.jsxs(c.Vertical,{gap:2,children:[r.jsx(c.Text,{fontSize:"11px",fontWeight:"600",color:"color-gray-700",children:"Tool Usage"}),r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",fontFamily:"monospace",children:e.content})]})]})});const h={...Se.bubble,...Mf[o],...s?zf:Rf,...p?{backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.2)",color:"#b91c1c"}:{},...n.bubble,...s?n.userBubble:n.assistantBubble,...p?n.errorMessage:{}},f={...Se.timestamp,[s?"right":"left"]:"8px",opacity:i?1:0,...n.timestamp};return r.jsx(c.View,{position:"relative",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),display:"flex",justifyContent:s?"flex-end":"flex-start",children:r.jsxs(c.View,{...h,children:[t&&r.jsx(c.View,{...f,children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),p&&r.jsxs(c.Horizontal,{gap:6,marginBottom:"4px",alignItems:"center",children:[r.jsx(Uo,{widthHeight:14,color:"#b91c1c"}),r.jsx(c.Text,{fontWeight:"600",fontSize:"12px",children:"Error"})]}),e.reasoning&&r.jsxs(c.View,{marginBottom:"8px",borderBottom:"1px solid rgba(0,0,0,0.05)",paddingBottom:"8px",...n.reasoningContainer,children:[r.jsxs(c.Horizontal,{as:"button",onClick:()=>d(!l),cursor:"pointer",gap:4,alignItems:"center",backgroundColor:"transparent",border:"none",padding:0,children:[r.jsx(c.Text,{fontSize:"11px",color:"color-gray-500",fontWeight:"600",children:"Thinking Process"}),r.jsx(ae,{orientation:l?"down":"right",widthHeight:10,color:"color-gray-500"})]}),l&&r.jsx(c.View,{padding:"8px",backgroundColor:"rgba(0,0,0,0.03)",borderRadius:"8px",marginTop:"4px",...n.reasoningContent,children:r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.reasoning})})]}),r.jsx(c.View,{whiteSpace:"pre-wrap",wordBreak:"break-word",children:e.content}),e.attachments&&e.attachments.length>0&&r.jsx(c.Vertical,{gap:4,marginTop:"8px",children:e.attachments.map(x=>r.jsxs(c.Horizontal,{gap:6,padding:"6px 8px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",fontSize:"12px",children:[r.jsx(po,{widthHeight:14}),r.jsx(c.Text,{children:x.name})]},x.id))}),e.contextElements&&e.contextElements.length>0&&r.jsxs(c.Vertical,{gap:4,marginTop:"8px",children:[r.jsx(c.Text,{fontSize:"11px",color:"rgba(0,0,0,0.5)",fontWeight:"600",children:"Context:"}),e.contextElements.map(x=>r.jsx(c.Horizontal,{gap:6,padding:"4px 8px",backgroundColor:"rgba(37, 99, 235, 0.1)",borderRadius:"6px",fontSize:"11px",border:"1px solid rgba(37, 99, 235, 0.2)",children:r.jsx(c.Text,{color:"color-blue-700",fontWeight:"500",children:x.name})},x.id))]})]})})},Yt=e=>{const o=wf(e);return r.jsx(Ef,{...e,...o})};Yt.displayName="ChatWidget";const Ya=Yt;function Wf({onSelect:e,onCancel:o,active:t}){const[n,i]=u.useState(null);u.useRef(null);const a=u.useCallback(s=>{var f;if(!t)return;const g=document.elementFromPoint(s.clientX,s.clientY);if(!g||g===document.body||g.closest('[data-chatwidget-ignore="true"]')||g.closest("#chatwidget-overlay")){i(null);return}const p=g.getBoundingClientRect();let m=g.tagName.toLowerCase();if(g.id)m+=`#${g.id}`;else if(g.className&&typeof g.className=="string"){const x=g.className.split(" ")[0];x&&(m+=`.${x}`)}const h=(f=g.innerText)==null?void 0:f.slice(0,20);h&&(m+=` ("${h}...")`),i({id:g.id||`el-${Date.now()}`,name:m,tagName:g.tagName.toLowerCase(),rect:p})},[t]),l=u.useCallback(s=>{!t||s.target.closest('[data-chatwidget-ignore="true"]')||(s.preventDefault(),s.stopPropagation(),n&&e(n))},[t,n,e]),d=u.useCallback(s=>{t&&s.key==="Escape"&&o()},[t,o]);return u.useEffect(()=>(t?(document.addEventListener("mousemove",a),document.addEventListener("click",l,!0),document.addEventListener("keydown",d),document.body.style.cursor="crosshair"):(i(null),document.removeEventListener("mousemove",a),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""),()=>{document.removeEventListener("mousemove",a),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""}),[t,a,l,d]),{highlightedElement:n}}function _f({element:e}){return e?r.jsx("div",{id:"chatwidget-overlay",style:{position:"fixed",top:e.rect.top,left:e.rect.left,width:e.rect.width,height:e.rect.height,border:"2px solid #2563eb",backgroundColor:"rgba(37, 99, 235, 0.1)",pointerEvents:"none",zIndex:99999,transition:"all 0.1s ease-out",borderRadius:"4px"},children:r.jsx("div",{style:{position:"absolute",top:"-24px",left:"0",backgroundColor:"#2563eb",color:"white",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",fontWeight:"bold",whiteSpace:"nowrap"},children:e.name})}):null}const $f=({initialMessages:e=[],onSendMessage:o,bubbleSize:t="md"})=>{const[n,i]=u.useState(!1),[a,l]=u.useState(!1),[d,s]=u.useState(e),[g,p]=u.useState([]),{highlightedElement:m}=Wf({active:a,onSelect:b=>{p(k=>[...k,b]),l(!1),i(!0)},onCancel:()=>{l(!1),i(!0)}}),h=()=>i(!n),f=()=>{l(!0),i(!1)},x=b=>{p(k=>k.filter(S=>S.id!==b))},y=b=>{const k={id:Date.now().toString(),role:"user",content:b,timestamp:new Date,contextElements:[...g]};s(S=>[...S,k]),o==null||o(b,g),p([]),setTimeout(()=>{var C;const S=Math.random()>.7,w=Math.random()>.4,j={id:(Date.now()+1).toString(),role:"assistant",timestamp:new Date,content:S?"I will highlight the selected element.":`I received your message regarding: ${((C=k.contextElements)==null?void 0:C.map(I=>I.name).join(", "))||"general context"}. How can I assist you further?`,messageType:S?"tool":"text",reasoning:w?"Analyzing the user input and context... The user seems to be asking about specific elements. I should tailor my response to the selected context.":void 0};s(I=>[...I,j]),S&&setTimeout(()=>{s(I=>[...I,{id:(Date.now()+2).toString(),role:"assistant",messageType:"system",content:'Tool "highlightElement" executed successfully.',timestamp:new Date}])},800)},1e3)};return r.jsxs(c.View,{position:"fixed",bottom:24,right:24,zIndex:9999,children:[r.jsx(_f,{element:m}),a&&r.jsx(c.View,{position:"fixed",top:24,left:"50%",transform:"translateX(-50%)",backgroundColor:"rgba(0,0,0,0.8)",color:"white",padding:"8px 16px",borderRadius:"24px",zIndex:1e4,boxShadow:"0 4px 6px rgba(0,0,0,0.1)",children:r.jsx(c.Text,{fontWeight:"600",fontSize:"14px",children:"Click an element to select it. Press ESC to cancel."})}),n&&r.jsxs(c.View,{position:"absolute",bottom:60,right:0,width:"400px",height:"600px",marginBottom:"16px",backgroundColor:"rgba(255, 255, 255, 0.8)",backdropFilter:"blur(20px)",borderRadius:"24px",border:"1px solid rgba(255, 255, 255, 0.4)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden",animation:"slideUp 0.3s ease-out",style:{animation:"fadeIn 0.2s ease-out",transformOrigin:"bottom right"},children:[r.jsxs(c.View,{padding:"16px",borderBottom:"1px solid rgba(0,0,0,0.05)",display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"bold",color:"color-gray-800",children:"ChatWidget Assistant"}),r.jsx(c.View,{as:"button",onClick:()=>i(!1),cursor:"pointer",padding:"4px",borderRadius:"50%",border:"none",backgroundColor:"transparent",_hover:{backgroundColor:"rgba(0,0,0,0.05)"},children:r.jsx(fe,{widthHeight:16,color:"color-gray-500"})})]}),r.jsx(Ya,{messages:d,onSubmit:y,size:t,variant:"minimal",enableContextPicker:!0,selectedContextElements:g,onContextPickerClick:f,onRemoveContextElement:x,styles:{container:{height:"calc(100% - 60px)",backgroundColor:"transparent"},inputContainer:{backgroundColor:"white",margin:"0 16px 16px 16px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"}}})]}),!a&&r.jsx(c.View,{as:"button",onClick:h,width:"56px",height:"56px",borderRadius:"50%",backgroundColor:"theme-primary",border:"none",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",_hover:{transform:"scale(1.05)"},_active:{transform:"scale(0.95)"},"data-chatwidget-ignore":"true",children:n?r.jsx(fe,{widthHeight:24,color:"white"}):r.jsx(Pr,{widthHeight:24,color:"white"})})]})};exports.Accordion=Do;exports.Alert=Pl;exports.ArrowIcon=Sl;exports.AspectRatio=$l;exports.AttachmentGroup=ma;exports.AttachmentIcon=po;exports.AttachmentPreview=Jg;exports.AudioIcon=Fo;exports.AudioInput=Ul;exports.AudioWaveform=Et;exports.Avatar=Kl;exports.BackIcon=Yi;exports.Background=Ga;exports.Badge=tc;exports.BatteryIcon=Ei;exports.BluetoothIcon=yl;exports.BoldArrowIcon=Cl;exports.BookmarkIcon=Pi;exports.Button=_e;exports.CalendarIcon=sl;exports.CameraIcon=bl;exports.Card=Xo;exports.Carousel=Xe;exports.Chart=Qc;exports.ChartIcon=Ni;exports.ChatInput=qa;exports.ChatWidget=Ya;exports.ChatWidgetComponent=Yt;exports.ChatWidgetWidget=$f;exports.CheckIcon=Gi;exports.Checkbox=qs;exports.ChevronIcon=ae;exports.ClockIcon=dl;exports.CloseEyeIcon=Mt;exports.CloseIcon=fe;exports.CloudIcon=Wi;exports.ColorInput=Xs;exports.ColorPicker=pm;exports.ComboBox=ju;exports.Command=eo;exports.ContextMenu=Ke;exports.CookieConsent=ts;exports.CopyIcon=_i;exports.CountryPicker=td;exports.CreditCardIcon=al;exports.CropIcon=Tl;exports.DatePicker=gu;exports.DeleteIcon=$i;exports.Divider=Bm;exports.DocumentIcon=qi;exports.DownloadIcon=Li;exports.DragAndDrop=vp;exports.DragAndDropComponent=pa;exports.DragHandleIcon=xi;exports.DragHandleLinesIcon=zl;exports.Drawer=Ze;exports.DropZone=Zp;exports.DropdownMenu=yo;exports.DustBinIcon=Oo;exports.EditIcon=Hi;exports.EmojiPicker=hm;exports.ErrorIcon=Uo;exports.ExternalLinkIcon=Er;exports.FacebookIcon=Ii;exports.FileIcon=go;exports.FileImage=ds;exports.FileSVG=ss;exports.FilterIcon=cl;exports.FolderIcon=fi;exports.FormikChatInput=tg;exports.FormikCheckbox=_u;exports.FormikColorInput=ng;exports.FormikComboBox=Cg;exports.FormikCountryPicker=cg;exports.FormikDatePicker=ig;exports.FormikEmojiPicker=Zg;exports.FormikForm=Eu;exports.FormikIconPicker=Ug;exports.FormikOTPInput=Vg;exports.FormikPassword=kg;exports.FormikRadio=Ou;exports.FormikSelect=dg;exports.FormikSelector=Wg;exports.FormikSlider=zg;exports.FormikSwitch=gg;exports.FormikTagInput=mg;exports.FormikTextArea=fg;exports.FormikTextField=bg;exports.FormikToggle=Bg;exports.FormikToggleGroup=Dg;exports.FormikUploader=An;exports.GiftIcon=Zi;exports.HeartIcon=zi;exports.HelpIcon=hi;exports.HomeIcon=Bi;exports.HoverCard=he;exports.Icon=Eo;exports.IconPicker=xm;exports.ImageIcon=yi;exports.InfoIcon=ze;exports.InstagramIcon=Si;exports.LayoutIcon=rl;exports.LikeIcon=xl;exports.Link=Ar;exports.LinkIcon=tl;exports.LinkedinIcon=Ti;exports.Loader=uo;exports.LoadingSpinnerIcon=Tt;exports.LockIcon=Di;exports.LogoutIcon=el;exports.MagicWandIcon=hl;exports.MapPinIcon=ul;exports.MediaPreview=tp;exports.MenuIcon=gl;exports.Menubar=Le;exports.MessageLayout=Al;exports.MessageView=Hr;exports.MicrophoneIcon=wt;exports.MinusIcon=Mr;exports.Modal=Be;exports.MoonIcon=Ui;exports.MoreIcon=il;exports.MousePointerIcon=Wr;exports.NavigationMenu=Je;exports.NotificationIcon=Oi;exports.OTPInput=Ru;exports.OpenEyeIcon=zt;exports.Pagination=zm;exports.PanelIcon=Pr;exports.Password=mu;exports.PauseIcon=zr;exports.PlayIcon=Ct;exports.PlusIcon=Ai;exports.PowerOffIcon=ol;exports.PrintIcon=ml;exports.ProfileIcon=Fi;exports.ProgressBar=Em;exports.RefreshIcon=pl;exports.Resizable=Nt;exports.RotateIcon=Qi;exports.SaveIcon=Vi;exports.SearchIcon=Po;exports.Select=Ms;exports.Selector=$s;exports.SendIcon=It;exports.Separator=Hm;exports.SettingsIcon=Rr;exports.ShapeIcon=Ki;exports.ShareButton=Nm;exports.ShareIcon=Vr;exports.ShieldIcon=Ji;exports.Sidebar=ko;exports.Slider=op;exports.SliderIcon=Il;exports.SpinnerIcon=wl;exports.StarIcon=Ri;exports.StatusIndicator=Gm;exports.StopIcon=qo;exports.SuccessIcon=Rt;exports.Switch=Ws;exports.Table=Ce;exports.Tabs=Zo;exports.TagInput=wu;exports.TextArea=Bs;exports.TextField=xo;exports.TextIcon=Xi;exports.ThreadsIcon=Mi;exports.TickIcon=No;exports.Title=qp;exports.Toast=Ch;exports.Toggle=qn;exports.ToggleGroup=Up;exports.Tooltip=Gt;exports.TrashIcon=ll;exports.TwitchIcon=Ci;exports.TwitterIcon=ki;exports.UnLikeIcon=fl;exports.UnlockIcon=kl;exports.UploadIcon=Vt;exports.Uploader=Yo;exports.UserIcon=mi;exports.VideoIcon=bi;exports.WarningIcon=St;exports.WifiIcon=jl;exports.XIcon=ji;exports.YoutubeIcon=wi;exports.ZapIcon=nl;exports.ZoomInIcon=Ml;exports.ZoomOutIcon=vi;exports.hideMessage=$r;exports.hideModal=At;exports.showMessage=_r;exports.showModal=rp;exports.showToast=Ae;exports.useMessageStore=Go;exports.useModalStore=Re;exports.useToast=Sh;
38
38
  //# sourceMappingURL=web.cjs.js.map