@app-studio/web 0.9.93 → 0.9.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.html +2 -1
- package/dist/orange.webp +0 -0
- package/dist/web.cjs.js +8 -8
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.esm.js +4268 -4211
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.js +8 -8
- package/dist/web.umd.js.map +1 -1
- package/package.json +14 -13
package/dist/web.umd.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(M,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("react"),require("app-studio"),require("lucide-react/dynamicIconImports"),require("zustand"),require("react-router-dom"),require("react-dom"),require("formik")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","app-studio","lucide-react/dynamicIconImports","zustand","react-router-dom","react-dom","formik"],r):(M=typeof globalThis<"u"?globalThis:M||self,r(M.AppStudioWeb={},M.jsxRuntime,M.React,M.appStudio,M.lucideReactDynamicIconImports,M.zustand,M.ReactRouterDOM,M.ReactDOM,M.Formik))})(this,function(M,r,g,i,Qt,tt,Ka,Qa,ye){"use strict";const rt=(e="id")=>`${e}-${Math.random().toString(36).substring(2,9)}`,Za=({type:e="single",value:o,defaultValue:t,onValueChange:n,collapsible:l=!1})=>{const a=o!==void 0,c=o??t,d=()=>e==="multiple"?Array.isArray(c)?c:c?[c]:[]:Array.isArray(c)?c[0]:c,[s,u]=g.useState(d()),h=g.useMemo(()=>rt("accordion"),[]),f=a?o:s,m=g.useMemo(()=>f===void 0?[]:Array.isArray(f)?f:[f],[f]);g.useEffect(()=>{a&&(e==="multiple"&&!Array.isArray(o)?(console.warn('Accordion with type="multiple" received non-array value:',o),u(o?[String(o)]:[])):e==="single"&&Array.isArray(o)?(console.warn('Accordion with type="single" received array value:',o),u(o.length>0?o[0]:void 0)):u(o))},[o,a,e]);const p=g.useCallback(x=>{let y;if(e==="single")f===x&&l?y=void 0:f!==x?y=x:y=f;else{const k=Array.isArray(f)?f:[];k.includes(x)?y=k.filter(w=>w!==x):y=[...k,x],Array.isArray(y)&&y.length===0&&(y=[])}a||u(y),n&&n(y)},[e,f,l,a,n]),b=g.useCallback(x=>m.includes(x),[m]);return{expandedItems:m,toggleItem:p,isItemExpanded:b,type:e,collapsible:l,baseId:h}},Ja={square:{borderRadius:0},rounded:{borderRadius:8}},Ra={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"}}},Zt=g.createContext({expandedItems:[],toggleItem:()=>{},isItemExpanded:()=>!1,type:"single",collapsible:!1,baseId:""}),el=({children:e,value:o})=>r.jsx(Zt.Provider,{value:o,children:e}),Jt=()=>{const e=g.useContext(Zt);if(!e)throw new Error("useAccordionContext must be used within an AccordionProvider");return e},ol=({value:e,children:o,isDisabled:t=!1,views:n,...l})=>{const{isItemExpanded:a,baseId:c}=Jt(),d=a(e),s=`${c}-trigger-${e}`,u=`${c}-content-${e}`;return r.jsx(i.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,...l,children:g.Children.map(o,h=>g.isValidElement(h)?g.cloneElement(h,{...h.props,value:e,isExpanded:d,isDisabled:t,triggerId:s,contentId:u}):h)})},tl=({children:e,value:o,isExpanded:t,isDisabled:n,triggerId:l,contentId:a,views:c,asChild:d=!1,...s})=>{const{toggleItem:u}=Jt(),f={id:l,"aria-expanded":t,"aria-controls":a,"aria-disabled":n,"data-state":t?"open":"closed","data-disabled":n?"":void 0,onClick:()=>{o&&!n&&u(o)},padding:16,cursor:n?"not-allowed":"pointer",alignItems:"center",justifyContent:"space-between",backgroundColor:"color-white",width:"100%",...c==null?void 0:c.container,...s};if(d&&g.isValidElement(e)){const m=g.Children.only(e);return g.cloneElement(m,{...f,...m.props})}return r.jsxs(i.Horizontal,{...f,children:[e,r.jsx(i.View,{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",transform:t?"rotate(180deg)":"rotate(0deg)",...c==null?void 0:c.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"})})})]})},rl=({children:e,isExpanded:o,isDisabled:t,triggerId:n,contentId:l,views:a,...c})=>o?r.jsx(i.View,{id:l,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,...c,children:e}):null,nl=({children:e,shape:o="rounded",variant:t="default",views:n,baseId:l,type:a,collapsible:c,themeMode:d,...s})=>r.jsx(i.Vertical,{width:"100%","data-orientation":"vertical",...Ja[o],...Ra[t],...n==null?void 0:n.container,...s,children:e}),Io=({children:e,type:o="single",value:t,defaultValue:n,onValueChange:l,collapsible:a=!1,shape:c="rounded",variant:d="default",views:s,...u})=>{const h=Array.isArray(n)?n:n?[n]:void 0,f=Za({type:o,value:t,defaultValue:n??h,onValueChange:l,collapsible:a});return r.jsx(el,{value:{expandedItems:f.expandedItems,toggleItem:f.toggleItem,isItemExpanded:f.isItemExpanded,type:f.type,collapsible:f.collapsible,baseId:f.baseId},children:r.jsx(nl,{shape:c,variant:d,views:s,baseId:f.baseId,type:f.type,collapsible:f.collapsible,...u,children:e})})};Io.Item=ol,Io.Trigger=tl,Io.Content=rl;const nt=new Map,al=e=>(nt.has(e)||nt.set(e,g.lazy(Qt[e])),nt.get(e)),at=g.memo(({widthHeight:e,color:o="currentColor",transform:t,orientation:n="up",children:l,...a})=>r.jsx(i.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:l})),To=g.memo(({name:e="circle",widthHeight:o=24,color:t="currentColor",filled:n=!1,strokeWidth:l=1,size:a,children:c,fallback:d,...s})=>{const{getColor:u}=i.useTheme(),h=a||o,f=g.useMemo(()=>{const b=u(t);return{fill:n?b:"none",stroke:b,strokeWidth:l,strokeLinecap:"round",strokeLinejoin:"round"}},[n,t,l,u]);if(!e)return r.jsx(at,{widthHeight:o,color:t,...s,children:c});const m=e.toLowerCase().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if(!(m in Qt))return r.jsx(at,{widthHeight:h,color:t,...s,children:d||c});const p=al(m);return r.jsx(at,{widthHeight:h,color:t,...s,children:r.jsx(g.Suspense,{fallback:d||null,children:r.jsx(p,{size:h,...f})})})}),U=(e,o={})=>{const t=n=>r.jsx(To,{name:e,...o,...n});return t.displayName=`${e}Icon`,t},ll=U("user",{filled:!1}),cl=U("circle-help",{filled:!1}),il=U("folder",{filled:!1}),le=U("chevron-up",{filled:!1}),sl=U("grip-vertical",{filled:!1}),to=U("file",{filled:!1}),dl=U("video",{filled:!1}),gl=U("image",{filled:!1}),jo=U("volume",{filled:!1}),ul=U("twitter",{filled:!1}),hl=U("x",{filled:!1}),fl=U("twitch",{filled:!1}),pe=U("x",{filled:!1,strokeWidth:2}),ml=U("instagram",{filled:!1}),pl=U("youtube",{filled:!1}),bl=U("facebook",{filled:!1}),yl=U("linkedin",{filled:!1}),xl=U("at-sign",{filled:!1}),Rt=U("minus",{filled:!1}),Se=U("info",{filled:!1}),lt=U("play",{filled:!1}),er=U("pause",{filled:!1}),kl=U("heart",{filled:!1}),Cl=U("star",{filled:!1}),wl=U("save",{filled:!1}),ct=U("triangle-alert",{filled:!1}),Il=U("battery",{filled:!1}),Tl=U("bookmark",{filled:!1}),jl=U("cloud",{filled:!1}),Sl=U("copy",{filled:!1}),So=U("trash",{filled:!1}),Ml=So,zl=U("edit",{filled:!1}),it=U("mic",{filled:!1}),Mo=U("square",{filled:!1}),st=U("send",{filled:!1}),dt=U("loader",{filled:!1}),ro=U("paperclip",{filled:!1}),zo=U("search",{filled:!1}),Vl=U("home",{filled:!1}),or=U("settings",{filled:!1}),El=U("download",{filled:!1}),tr=U("share",{filled:!1}),Vo=U("check",{filled:!1}),Pl=U("plus",{filled:!1}),gt=U("eye-off",{filled:!1}),ut=U("eye",{filled:!1}),Wl=U("lock",{filled:!1}),_l=U("user",{filled:!1}),rr=U("external-link",{filled:!1}),ht=U("check-circle",{filled:!1}),Eo=U("alert-circle",{filled:!1}),$l=U("bell",{filled:!1}),Hl=U("file-text",{filled:!1}),Bl=U("bar-chart",{filled:!1}),Ll=U("moon",{filled:!1}),nr=U("panel-left",{filled:!1}),ft=U("upload",{filled:!1}),Al=Vo,Dl=e=>r.jsx(le,{orientation:"left",...e}),Fl=U("zoom-out",{filled:!1}),Ol=U("type",{filled:!1}),ql=U("shapes",{filled:!1}),Nl=U("rotate-cw",{filled:!1}),Ul=U("gift",{filled:!1}),Gl=U("shield",{filled:!1}),Yl=U("log-out",{filled:!1}),vl=U("power",{filled:!1}),Xl=U("link",{filled:!1}),Kl=U("layout",{filled:!1}),Ql=U("zap",{filled:!1}),Zl=U("credit-card",{filled:!1}),Jl=U("more-horizontal",{filled:!1}),Rl=So,ec=U("filter",{filled:!1}),oc=U("calendar",{filled:!1}),tc=U("clock",{filled:!1}),rc=U("map-pin",{filled:!1}),nc=U("menu",{filled:!1}),ac=U("refresh-cw",{filled:!1}),lc=U("printer",{filled:!1}),cc=U("wand",{filled:!1}),ic=U("thumbs-down",{filled:!1}),sc=U("thumbs-up",{filled:!1}),dc=U("camera",{filled:!1}),gc=U("bluetooth",{filled:!1}),uc=U("unlock",{filled:!1}),hc=U("wifi",{filled:!1}),fc=U("arrow-right",{filled:!1}),mc=U("arrow-up",{filled:!1}),pc=U("loader",{filled:!1}),bc=U("sliders-horizontal",{filled:!1}),yc=U("crop",{filled:!1}),xc=U("zoom-in",{filled:!1}),kc=U("grip-horizontal",{filled:!1}),ar=U("mouse-pointer-2",{filled:!1}),Cc=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"}}}),wc=g.memo(({icon:e,title:o="",views:t,description:n="",variant:l="default",themeMode:a,children:c,...d})=>{const{themeMode:s}=i.useTheme(),u=a||s,h=g.useMemo(()=>Cc(),[u]),f=()=>{var b;if(e)return e;const p={size:20,color:((b=t==null?void 0:t.icon)==null?void 0:b.color)??h[l].icon.color};switch(l){case"info":return r.jsx(Se,{...p});case"success":return r.jsx(ht,{...p});case"error":return r.jsx(Eo,{...p});case"warning":default:return r.jsx(ct,{...p})}};return r.jsxs(i.Horizontal,{gap:12,padding:"16px",flexWrap:"nowrap",alignItems:"flex-start",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:h[l].container.borderColor,backgroundColor:h[l].container.backgroundColor,boxShadow:h[l].container.boxShadow,transition:"all 0.2s ease",...t==null?void 0:t.container,...d,children:[r.jsx(i.View,{alignSelf:"flex-start",marginTop:"2px",...t==null?void 0:t.icon,children:f()}),r.jsxs(i.Vertical,{gap:8,children:[" ",r.jsx(i.Text,{fontSize:"16px",fontWeight:"600",lineHeight:"24px",color:h[l].content.color,backgroundColor:h[l].container.backgroundColor,...t==null?void 0:t.title,children:o}),r.jsx(i.Text,{fontSize:"14px",fontWeight:"400",lineHeight:"20px",color:h[l].content.color,backgroundColor:h[l].container.backgroundColor,...t==null?void 0:t.description,children:n||c})]})]})}),Ic=e=>r.jsx(wc,{...e}),Tc=({ratio:e=16/9,children:o,views:t,...n})=>r.jsx(i.Center,{width:"100%",position:"relative",overflow:"hidden",paddingTop:`${1/e*100}%`,borderRadius:8,...n,...t==null?void 0:t.center,children:r.jsx(i.View,{position:"absolute",top:0,right:0,bottom:0,left:0,...t==null?void 0:t.view,children:o})}),jc=({ratio:e,children:o,...t})=>r.jsx(Tc,{ratio:e,...t,children:o});function Sc(e,o,t){return Math.min(Math.max(e,o),t)}const Mc=({bars:e,isPaused:o,...t})=>r.jsx(i.Horizontal,{alignItems:"center",minWidth:100,gap:1,height:32,maxWidth:200,width:"100%",marginTop:4,...t,children:e.map((l,a)=>r.jsx(i.View,{width:2,backgroundColor:o?"color-gray-200":l>=0?"color-gray-900":"color-gray-500",style:{height:`${Sc(l*300,2,32)}px`}},a))}),mt=({analyserNode:e,isPaused:o,...t})=>{const n=g.useRef(null),l=60,a=32,[c,d]=g.useState([]);return g.useEffect(()=>{if(!e){d(Array(l).fill(-1));return}const s=e.frequencyBinCount,u=new Uint8Array(s),h=()=>{e.getByteTimeDomainData(u);let f=0;for(let p=0;p<s;p++){const b=(u[p]-128)/128;f+=b*b}const m=Math.sqrt(f/s);g.startTransition(()=>{d(p=>{const x=[...p,m].slice(-l);return x.length<l?[...Array(l-x.length).fill(-1),...x]:x})})};return n.current=setInterval(h,a),()=>{n.current&&clearInterval(n.current)}},[e]),r.jsx(Mc,{bars:c,isPaused:o,...t})},Po=tt.create(e=>({visible:!1,title:"",subtitle:"",variant:"info",isClosable:!1,views:{},action:()=>{},actionText:"",showIcon:!1,timeout:3e3,show:(o,t="",n="",l,a,c,d,s,u)=>e({visible:!0,variant:o,title:t,subtitle:n,isClosable:l,views:a,action:c,actionText:d,showIcon:s,timeout:u}),hide:()=>e({visible:!1})})),lr=(e,o,t,n)=>{Po.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)},cr=()=>{Po.getState().hide()},zc={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"}}},ir=({variant:e,hide:o,title:t,subtitle:n,theme:l,action:a,actionText:c,showIcon:d=!1,isClosable:s=!1,timeout:u=3e3,views:h})=>{var k,w;g.useEffect(()=>{if(u&&!s){const T=setTimeout(()=>{o()},u);return()=>{clearTimeout(T)}}},[]);const f=l??zc,m=!!(a&&c),p={borderWidth:1,borderStyle:"solid",borderRadius:8,borderColor:`${f[e].container.border}`},b={info:"#3b82f6",success:"#4ade80",warning:"#f97316",error:"#ef4444"}[e],x={info:r.jsx(Se,{widthHeight:24,color:b,...h==null?void 0:h.icon}),success:r.jsx(ht,{widthHeight:24,color:b,...h==null?void 0:h.icon}),warning:r.jsx(ct,{widthHeight:24,color:b,...h==null?void 0:h.icon}),error:r.jsx(Eo,{widthHeight:24,color:b,...h==null?void 0:h.icon})}[e],y=d&&x;return r.jsxs(i.Horizontal,{role:"messageContent",gap:16,width:400,flexWrap:"nowrap",position:"relative",alignItems:"center",padding:"14px 24px 14px 14px",color:`${f[e].content.color}`,backgroundColor:`${f[e].container.backgroundColor}`,onClick:s?()=>{}:()=>{o()},...p,...h==null?void 0:h.container,children:[y&&x,r.jsxs(i.Vertical,{gap:8,width:"100%",children:[r.jsx(i.Text,{size:"md",weight:"semiBold",...h==null?void 0:h.title,children:t}),n&&r.jsx(i.Text,{size:"sm",...h==null?void 0:h.subtitle,children:n})]}),m&&r.jsx(i.Text,{marginRight:10,onClick:a,padding:"6px 10px",whiteSpace:"nowrap",...p,...h==null?void 0:h.actionText,children:c}),s&&r.jsx(i.View,{position:"absolute",zIndex:1e4,right:8,top:6,onClick:()=>{o()},...(k=h==null?void 0:h.closingIcon)==null?void 0:k.container,children:r.jsx(pe,{widthHeight:18,color:b,...(w=h==null?void 0:h.closingIcon)==null?void 0:w.icon})})]})},Vc=({container:e,theme:o,position:t="topRight"})=>{const{visible:n,title:l,variant:a,subtitle:c,isClosable:d,views:s,action:u,actionText:h,showIcon:f,timeout:m}=Po(),p={topLeft:{top:6,left:8},topRight:{top:6,right:8},bottomLeft:{bottom:8,left:6},bottomRight:{bottom:8,right:6}}[t],b=()=>r.jsx(ir,{variant:a,subtitle:c,show:n,title:l,theme:o,isClosable:d,views:s,action:u,actionText:h,showIcon:f,timeout:m,hide:()=>cr()}),x=e?g.cloneElement(e,{},b()):r.jsx(i.View,{position:"absolute",zIndex:1e4,...p,children:b()});return n?x:null},Ec=(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 l=n.getContext("2d");if(l){l.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)},Pc=({maxSize:e=100*1024*1024,onFileSelect:o,onMultipleFileSelect:t,validateFile:n,thumbnail:l,multiple:a=!1,onError:c=d=>{lr("error","Error",d)}})=>{const d=g.useRef(null),s=g.useRef(null),[u,h]=g.useState(null),[f,m]=g.useState([]),[p,b]=g.useState(null),[x,y]=g.useState(null),[k,w]=g.useState(l||null),T=g.useCallback(I=>{const j=I.target.files;if(b(null),!j||j.length===0){c("No file selected"),b("No file selected");return}if(a){const z=Array.from(j),V=[];for(const W of z){if(W.size>e){c(`File ${W.name} exceeds ${Math.round(e/(1024*1024))}MB.`),b(`File ${W.name} exceeds ${Math.round(e/(1024*1024))}MB.`);continue}if(n){const H=n(W);if(H){c(`${W.name}: ${H}`),b(`${W.name}: ${H}`);continue}}V.push(W)}V.length>0&&(m(V),t&&t(V))}else{const z=j[0];if(z.size>e){c(`File exceeds ${Math.round(e/(1024*1024))}MB.`),b(`File exceeds ${Math.round(e/(1024*1024))}MB.`);return}if(n){const V=n(z);if(V){c(V),b(V);return}}y(URL.createObjectURL(z)),z.type.startsWith("video/")&&Ec(z,w),o&&(h(z),o(z))}},[e,o,t,n,a]),C=()=>{var I;return(I=d.current)==null?void 0:I.click()};return g.useEffect(()=>()=>{x&&URL.revokeObjectURL(x),k&&URL.revokeObjectURL(k)},[x,k]),{previewUrl:x,thumbnailUrl:k,errorMessage:p,fileInputRef:d,videoRef:s,selectedFile:u,selectedFiles:f,handleFileChange:T,handleClick:C}},Wc=({accept:e,isLoading:o=!1,progress:t=0,icon:n,text:l,previewUrl:a,thumbnailUrl:c,errorMessage:d,fileInputRef:s,videoRef:u,selectedFile:h,selectedFiles:f,handleFileChange:m,handleClick:p,multiple:b=!1,containerProps:x,errorMessageProps:y,progressProps:k,videoProps:w,imageProps:T,iconProps:C,textProps:I,fileType:j,previewUrl:z,renderError:V=({errorMessage:P,errorMessageProps:$,themeMode:_})=>r.jsx(i.Text,{color:"red",fontSize:12,marginTop:8,...$,...E==null?void 0:E.text,children:P}),renderText:W=({text:P,textProps:$})=>r.jsx(i.Text,{marginTop:8,...$,...E==null?void 0:E.text,children:P}),renderFile:H=({selectedFile:P,textProps:$})=>P?r.jsxs(i.Center,{marginTop:8,gap:10,flexDirection:"column",...E==null?void 0:E.container,children:[r.jsx(i.Text,{maxLines:2,...$,...E==null?void 0:E.text,children:P.name}),r.jsxs(i.Text,{...$,...E==null?void 0:E.text,children:["(",Math.round(P.size/1024)," KB)"]})]}):null,renderVideo:S=({selectedFile:P,videoRef:$,videoProps:_})=>r.jsx(i.View,{width:"100%",height:"100%",position:"relative",...E==null?void 0:E.view,children:r.jsx(i.View,{as:"video",width:"100%",height:"100%",src:P?URL.createObjectURL(P):void 0,style:{objectFit:"cover"},ref:$,..._,...E==null?void 0:E.view})}),renderImage:B=({previewUrl:P,imageProps:$})=>(console.log("Rendering image with URL:",P),r.jsx(i.View,{width:"100%",height:"100%",position:"relative",...E==null?void 0:E.view,children:r.jsx(i.Image,{src:P,alt:"Preview",width:"100%",height:"100%",objectFit:"cover",style:{maxHeight:"100%",maxWidth:"100%"},...$,...E==null?void 0:E.image})})),renderProgress:A=({progress:P,progressProps:$})=>r.jsxs(i.Horizontal,{gap:8,alignItems:"center",...$,...E==null?void 0:E.horizontal,children:[r.jsx(i.View,{height:4,backgroundColor:"rgba(0,0,0,0.1)",width:"100%",borderRadius:2,...E==null?void 0:E.view,children:r.jsx(i.View,{height:4,width:`${P}%`,borderRadius:2,backgroundColor:"color-dark-50",...E==null?void 0:E.view})}),r.jsxs(i.Text,{fontSize:12,...E==null?void 0:E.text,children:[P,"%"]})]}),views:E={}})=>{const P=z||a;return r.jsxs(i.Center,{onClick:p,cursor:"pointer",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,padding:16,flexDirection:"column",overflow:"hidden",position:"relative",height:h&&t===100?"200px":"auto",...x,...E==null?void 0:E.container,children:[t===100&&j==="image"&&P&&B({previewUrl:P,imageProps:T}),t===100&&j==="video"&&c&&S({selectedFile:h,thumbnailUrl:c,videoRef:u,videoProps:w,imageProps:T}),t===100&&j==="file"&&h&&H({selectedFile:h,textProps:I}),t<100&&(n||r.jsx(ft,{widthHeight:32,...C})),!o&&!h&&l&&W({text:l,textProps:I}),o&&A({progress:t,progressProps:k}),!o&&d&&V({errorMessage:d,errorMessageProps:y}),r.jsx(i.View,{as:"input",type:"file",ref:s,onChange:m,accept:e,multiple:b,style:{display:"none"},...E==null?void 0:E.view})]})},Wo=({accept:e="*/*",icon:o,text:t,maxSize:n,onFileSelect:l,onMultipleFileSelect:a,validateFile:c,isLoading:d=!1,progress:s=0,fileType:u,multiple:h=!1,...f})=>{const{previewUrl:m,thumbnailUrl:p,errorMessage:b,videoRef:x,fileInputRef:y,selectedFile:k,selectedFiles:w,handleFileChange:T,handleClick:C}=Pc({maxSize:n,onFileSelect:l,onMultipleFileSelect:a,validateFile:c,multiple:h}),j=(()=>{if(u)return u;if(k)return k.type.startsWith("image/")?"image":k.type.startsWith("video/")?"video":"file"})();return r.jsx(Wc,{handleClick:C,accept:e,isLoading:d,progress:s,icon:o,text:t,maxSize:n,onFileSelect:l,validateFile:c,errorMessage:b,handleFileChange:T,selectedFile:k,selectedFiles:w,videoRef:x,fileInputRef:y,previewUrl:m,thumbnailUrl:p,fileType:j,multiple:h,...f})};function _c({onAudio:e,recording:o,paused:t,audioBlob:n,analyserNode:l,startRecording:a,stopRecording:c,pauseRecording:d,resumeRecording:s,resetRecording:u,handleFileChange:h,...f}){const[m,p]=g.useState(null);return g.useEffect(()=>{if(n){const b=URL.createObjectURL(n);return p(b),()=>{URL.revokeObjectURL(b)}}return p(null),()=>{}},[n]),r.jsxs(i.View,{gap:"8px",...f,children:[r.jsxs(i.Horizontal,{gap:8,alignItems:"center",margin:10,children:[r.jsx(Wo,{accept:"audio/*",icon:r.jsx(ro,{widthHeight:16}),maxSize:100*1024*1024,onFileSelect:b=>e(b),fileType:"file",multiple:!1,renderError:({errorMessage:b})=>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:b=>b.size>100*1024*1024?"File size exceeds 100MB limit":b.type.startsWith("audio/")?null:"Only audio files are allowed"}),o?r.jsxs(i.Horizontal,{gap:8,alignItems:"center",children:[r.jsx(i.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(lt,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(er,{widthHeight:16,color:"currentColor",filled:!1})}),r.jsx(i.View,{as:"button",type:"button",onClick:c,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(Mo,{widthHeight:16,color:"currentColor",filled:!1})}),r.jsx(i.View,{minWidth:90,children:o&&r.jsx(mt,{analyserNode:l,isPaused:t})})]}):r.jsx(i.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})})]}),m&&!o&&r.jsx("audio",{controls:!0,src:m})]})}function sr(){const[e,o]=g.useState(!1),[t,n]=g.useState(!1),[l,a]=g.useState(0),[c,d]=g.useState(null),[s,u]=g.useState(null),[h,f]=g.useState(null),m=g.useRef(null),p=g.useRef(null),b=g.useRef(null),x=g.useRef(null),y=g.useRef([]),k=g.useRef(null),w=typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",T=g.useCallback(()=>{m.current&&(m.current.state!=="inactive"&&m.current.stop(),m.current=null),x.current&&(x.current.getTracks().forEach(W=>W.stop()),x.current=null),p.current&&(p.current.close(),p.current=null),b.current&&(b.current.disconnect(),b.current=null),u(null),k.current&&(clearInterval(k.current),k.current=null)},[]),C=g.useCallback(async()=>{T(),d(null),a(0),y.current=[];try{const W=await navigator.mediaDevices.getUserMedia({audio:!0});x.current=W;const H=MediaRecorder.isTypeSupported(w)?w:void 0,S=new MediaRecorder(W,H?{mimeType:H}:void 0);m.current=S;const B=new(window.AudioContext||window.webkitAudioContext);p.current=B;const A=B.createMediaStreamSource(W),E=B.createAnalyser();E.fftSize=256,E.smoothingTimeConstant=.8,A.connect(E),b.current=E,u(E),S.ondataavailable=P=>{P.data.size>0&&y.current.push(P.data)},S.onstop=()=>{const P=new Blob(y.current,{type:S.mimeType||w});f(P),T()},S.start(),o(!0),n(!1),k.current=setInterval(()=>{a(P=>P+1)},1e3)}catch{d("Microphone access denied or unavailable."),T()}},[T]),I=g.useCallback(()=>{m.current&&m.current.state!=="inactive"&&m.current.stop(),o(!1),n(!1),k.current&&(clearInterval(k.current),k.current=null)},[]),j=g.useCallback(()=>{m.current&&m.current.state==="recording"&&(m.current.pause(),n(!0),k.current&&(clearInterval(k.current),k.current=null))},[]),z=g.useCallback(()=>{m.current&&m.current.state==="paused"&&(m.current.resume(),n(!1),k.current||(k.current=setInterval(()=>{a(W=>W+1)},1e3)))},[]),V=g.useCallback(()=>{T(),o(!1),n(!1),f(null),a(0),d(null),y.current=[]},[T]);return g.useEffect(()=>()=>T(),[T]),{recording:e,paused:t,audioBlob:h,analyserNode:s,duration:l,error:c,startRecording:C,stopRecording:I,pauseRecording:j,resumeRecording:z,resetRecording:V}}function $c(e){const{onAudio:o}=e,{recording:t,paused:n,audioBlob:l,analyserNode:a,startRecording:c,stopRecording:d,pauseRecording:s,resumeRecording:u,resetRecording:h}=sr();return g.useEffect(()=>{if(l&&o){const m=new File([l],"recording.webm",{type:l.type||"audio/webm;codecs=opus"});o(m)}},[l,o]),{recording:t,paused:n,audioBlob:l,analyserNode:a,startRecording:c,stopRecording:d,pauseRecording:s,resumeRecording:u,resetRecording:h,handleFileChange:m=>{var b;const p=(b=m.target.files)==null?void 0:b[0];p&&o&&o(p)}}}function Hc(e){const o=$c(e);return r.jsx(_c,{...e,...o})}const Bc=()=>{const[e,o]=g.useState(!1);return{imageError:e,setImageError:o}},Lc={xs:24,sm:32,md:48,lg:64,xl:80},pt={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"}},Ac=({src:e,size:o="md",fallback:t="IM",views:n,imageError:l,setImageError:a,onClick:c=()=>{},children:d})=>{const s=Lc[o],u={...pt.image,...(n==null?void 0:n.image)||{}};return r.jsxs(i.Center,{role:"avatar",width:s,height:s,...pt.container,borderColor:l?"color-gray-400":"transparent",onClick:c,...n==null?void 0:n.container,children:[!l&&e?r.jsx(i.Image,{alt:"IM",src:e,style:u,width:s,height:s,onError:()=>a(!0)}):r.jsx(i.Text,{size:o,...pt.fallback,...n==null?void 0:n.fallback,children:t}),d]})},Dc=({src:e,size:o,views:t,fallback:n,onClick:l,children:a})=>{const{imageError:c,setImageError:d}=Bc();return r.jsx(Ac,{src:e,size:o,views:t,fallback:n,imageError:c,setImageError:d,onClick:l,children:a})},Fc={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"}},Oc={square:0,rounded:"8px",pill:"9999px"},qc={"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"}},Nc=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"}}),dr=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"}}}),Uc=g.memo(({content:e,children:o,icon:t,pastil:n,position:l,shape:a="pill",variant:c="filled",size:d="md",views:s,themeMode:u,...h})=>{const{themeMode:f}=i.useTheme(),m=u||f,p=g.useMemo(()=>Nc()[c],[m,c]),b=g.useMemo(()=>dr(),[m]),x=g.useMemo(()=>({width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",borderRadius:Oc[a],...Fc[d],...p,...l?qc[l]:{},...s==null?void 0:s.container}),[a,d,p,l,s==null?void 0:s.container]);let y="currentColor";return typeof n=="string"?n in b?y=b[n].indicator.backgroundColor:y=n:n===!0&&(y="color-green-500",c==="filled"&&(y="color-white")),r.jsxs(i.Center,{role:"badge",...x,...h,children:[t&&r.jsx(i.View,{role:"badge-icon",...s==null?void 0:s.icon,children:t}),n&&r.jsx(i.View,{role:"badge-pastil",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:y,...s==null?void 0:s.pastil}),(e||o)&&r.jsx(i.Text,{role:"badgeText",fontWeight:"500",textAlign:"center",...s==null?void 0:s.text,color:x.color,children:o||e})]})}),Gc=e=>r.jsx(Uc,{...e}),Yc=()=>{const[e,o]=g.useState(!1);return{isHovered:e,setIsHovered:o}},vc={xs:12,sm:14,md:16,lg:18,xl:20},Xc=({children:e,to:o="/",iconSize:t="sm",underline:n="default",isHovered:l=!1,isExternal:a=!1,views:c={icon:{},text:{}},setIsHovered:d=()=>{},...s})=>{const u=()=>{n==="hover"&&d(!0)},h=()=>{n==="hover"&&d(!1)},f=()=>n==="underline"||n==="hover"&&l?"underline":"none";return r.jsx(Ka.Link,{to:o,target:a?"_blank":"_self",style:{textDecoration:"inherit",color:"inherit"},children:r.jsxs(i.Horizontal,{onMouseEnter:u,onMouseLeave:h,gap:3,alignItems:"center",flexWrap:"nowrap",textDecoration:f(),...c.text,...s,children:[e,a&&r.jsx(rr,{widthHeight:vc[t]})]})})},gr=e=>{const o=Yc();return r.jsx(Xc,{...o,...e})},bt={xs:14,sm:18,md:22,lg:26,xl:30},yt={fast:50,normal:100,slow:300},Kc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...l})=>{const{getColor:a,themeMode:c}=i.useTheme(),d=a(t,{themeMode:n||c}),s=typeof e=="number"?e:bt[e],[u,h]=g.useState(0);return g.useEffect(()=>{const f=setInterval(()=>{h(m=>m+45)},yt[o]);return()=>clearInterval(f)},[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(${u}deg)`},...l,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"})})]})},Qc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...l})=>{const{getColor:a,themeMode:c}=i.useTheme(),d=a(t,{themeMode:n||c}),s=typeof e=="number"?e:bt[e],[u,h]=g.useState(0);return g.useEffect(()=>{const f=setInterval(()=>{h(m=>m+45)},yt[o]);return()=>clearInterval(f)},[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(${u}deg)`},...l,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})]})},Zc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...l})=>{const{getColor:a,themeMode:c}=i.useTheme(),d=a(t,{themeMode:n||c}),s=typeof e=="number"?e:bt[e],[u,h]=g.useState(0);return g.useEffect(()=>{const f=setInterval(()=>{h(m=>m+45)},yt[o]);return()=>clearInterval(f)},[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(${u}deg)`},...l,children:r.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:d,strokeWidth:"5",strokeDasharray:"1,10"})})},Jc=({size:e,children:o,textColor:t,loaderColor:n,type:l="default",speed:a="normal",textPosition:c="right",views:d,...s})=>{const{getColor:u}=i.useTheme();n=u(n||s.color||"theme-loading"),t=u(t||s.color||"theme-loading");const h={size:e,speed:a,color:n},f={default:r.jsx(Kc,{...h}),dotted:r.jsx(Qc,{...h}),quarter:r.jsx(Zc,{...h})};return r.jsxs(i.Center,{gap:10,flexDirection:c==="top"||c==="bottom"?"column":"row",...s,...d==null?void 0:d.container,children:[(c==="left"||c==="top")&&o&&r.jsx(i.View,{color:t,...d==null?void 0:d.text,children:o}),f[l],(c==="right"||c==="bottom")&&o&&r.jsx(i.View,{color:t,...d==null?void 0:d.text,children:o})]})},no=e=>r.jsx(Jc,{...e}),Rc={xs:10,sm:12,md:14,lg:16,xl:20},ao={xs:12,sm:16,md:20,lg:24,xl:28},lo=e=>({minHeight:ao[e]*2,paddingHorizontal:ao[e]/2,fontSize:Rc[e],fontWeight:500,lineHeight:ao[e],letterSpacing:"-0.01em",paddingInline:ao[e],paddingBlock:ao[e]/2,outlineWidth:"medium"}),ur={xs:lo("xs"),sm:lo("sm"),md:lo("md"),lg:lo("lg"),xl:lo("xl")},co={square:0,rounded:8,pill:999},hr={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}},ei=(e,o,t=!1)=>{const n=t?o:e,l=t?e:o,a=t?o:e;return{filled:{backgroundColor:n,color:l,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"}}},oi=g.memo(({children:e,icon:o,isLoading:t,iconPosition:n="left",loaderPosition:l="left",size:a="md",resolvedTextColor:c,isIconRounded:d,views:s})=>{const u=["left","right"].includes(n)?i.Horizontal:i.Vertical,h=ur[a],f=d?hr[a]:{};return r.jsxs(u,{gap:8,alignItems:"center",justifyContent:"center",...h,...f,...s==null?void 0:s.content,children:[t&&l==="left"&&r.jsx(no,{size:a==="xs"||a==="sm"?"sm":"md",color:c,...s==null?void 0:s.loader}),o&&["left","top"].includes(n)&&!t&&r.jsx(i.View,{color:c,...s==null?void 0:s.icon,children:o}),e,o&&["right","bottom"].includes(n)&&!t&&r.jsx(i.View,{color:c,...s==null?void 0:s.icon,children:o}),t&&l==="right"&&r.jsx(no,{size:a==="xs"||a==="sm"?"sm":"md",color:c,...s==null?void 0:s.loader})]})}),ti=e=>{const o=co[e];return typeof o=="number"?o:typeof o=="string"&&parseInt(o,10)||0},ri=({asComponent:e,isDisabled:o,isLoading:t,isWrapped:n=!1,borderRadius:l,width:a,height:c,baseStyles:d,sizeStyles:s,iconPad:u,mainTone:h,resolvedTextColor:f,children:m,borderWidth:p=0,...b})=>r.jsx(i.Element,{as:e,disabled:!!(o||t),display:n?"flex":"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:l,width:a,height:c,...d,...s,...u,backgroundColor:(d==null?void 0:d.backgroundColor)||(n?h:void 0),color:f,borderWidth:n?0:void 0,cursor:o?"default":"pointer",...b,children:m}),ni=({shape:e,isDisabled:o,onClick:t,shadow:n,borderWidth:l,isAuto:a,isFilled:c,views:d,children:s,...u})=>r.jsx(i.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:co[e],cursor:o?"default":"pointer",onClick:t,boxShadow:n,padding:l,width:a?"fit-content":c?"100%":void 0,...d==null?void 0:d.container,...u,children:s}),ai=({variant:e,animation:o,to:t,isDisabled:n,isLoading:l,isAuto:a,isFilled:c,isExternal:d,shape:s="rounded",shadow:u,onClick:h,views:f,baseStyles:m,sizeStyles:p,iconPad:b,resolvedTextColor:x,content:y,size:k,mainTone:w,borderMovingDuration:T=2,borderMovingGradientColors:C=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:I="#705CFF",animatedStrokeTextColor:j="#333333",getColor:z=W=>W,...V})=>{var B;const W=ti(s),H=t?r.jsx(gr,{to:t,isExternal:d,color:"currentColor",textDecoration:"inherit",_hover:{color:"currentColor"},...f==null?void 0:f.link,children:y}):y,S={isDisabled:n,isLoading:l,baseStyles:m,sizeStyles:p,iconPad:b,resolvedTextColor:x,mainTone:w,children:H};if(o==="borderMoving"&&C){const E={from:{backgroundPosition:"0% 50%"},to:{backgroundPosition:"200% 50%"},duration:`${T}s`,timingFunction:"linear",iterationCount:"infinite"};return r.jsx(ni,{shape:s,isDisabled:n,onClick:h,shadow:u,borderWidth:3,isAuto:a,isFilled:c,views:f,background:`linear-gradient(90deg, ${C[0]}, ${C[1]}, ${C[2]}, ${C[0]})`,backgroundSize:"200% 100%",animate:E,...V,children:r.jsx(ri,{asComponent:t?"div":"button",isWrapped:!0,borderRadius:Math.max(0,W-3),width:"100%",height:"100%",...S})})}if(o==="animatedStroke"){const A=z(I),E=z(j),P=1e3,$={from:{strokeWidth:"8px",strokeDasharray:`0 ${P}`,strokeDashoffset:-Math.round(P*.63)},to:{strokeWidth:"3px",strokeDasharray:`${P}`,strokeDashoffset:0},duration:"0.9s",timingFunction:"ease-in",fillMode:"forwards"},_=["group",(B=f==null?void 0:f.container)==null?void 0:B.className,V==null?void 0:V.className].filter(Boolean).join(" ");return r.jsxs(i.Element,{as:t?"div":"button",type:t?void 0:"button",disabled:!!(!t&&(n||l)),onClick:h,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":c?"100%":void 0,borderRadius:co[s],boxShadow:u,transition:"all 0.2s ease",cursor:n?"default":"pointer",color:E,backgroundColor:"transparent",borderWidth:0,...f==null?void 0:f.container,...V,className:_,children:[r.jsx(i.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(i.View,{as:"rect",x:"0",y:"0",height:"100%",width:"100%",rx:W,ry:W,fill:"transparent",stroke:A,strokeWidth:"8px",strokeDasharray:`0 ${P}`,strokeDashoffset:-Math.round(P*.63),pathLength:P,on:{groupHover:{animate:$}}})}),r.jsx(i.View,{position:"relative",zIndex:0,children:H})]})}if(o==="borderReveal"){const E=(C==null?void 0:C[0])||w||"#000000",$=T*.75/4,_=`linear-gradient(90deg, ${E} 50%, transparent 50%)`,L=`linear-gradient(180deg, ${E} 50%, transparent 50%)`,D=`linear-gradient(270deg, ${E} 50%, transparent 50%)`,F=`linear-gradient(0deg, ${E} 50%, transparent 50%)`,q="100% 0, 100% 100%, 0 100%, 0 0",O="0 0, 100% 0, 100% 100%, 0 100%",N=`0s, ${$}s, ${$*2}s, ${$*2}s`,Z=`${$*2}s, ${$*2}s, ${$}s, 0s`,X=4;return r.jsx(i.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:co[s],cursor:n?"default":"pointer",onClick:h,boxShadow:u,padding:3,background:`
|
|
2
|
-
${_} no-repeat,
|
|
1
|
+
(function(M,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("react"),require("app-studio"),require("zustand"),require("react-router-dom"),require("react-dom"),require("formik")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","app-studio","zustand","react-router-dom","react-dom","formik"],r):(M=typeof globalThis<"u"?globalThis:M||self,r(M.AppStudioWeb={},M.jsxRuntime,M.React,M.appStudio,M.zustand,M.ReactRouterDOM,M.ReactDOM,M.Formik))})(this,function(M,r,d,i,tt,Xa,Ka,ye){"use strict";const rt=(e="id")=>`${e}-${Math.random().toString(36).substring(2,9)}`,Qa=({type:e="single",value:o,defaultValue:t,onValueChange:n,collapsible:l=!1})=>{const a=o!==void 0,c=o??t,g=()=>e==="multiple"?Array.isArray(c)?c:c?[c]:[]:Array.isArray(c)?c[0]:c,[s,u]=d.useState(g()),h=d.useMemo(()=>rt("accordion"),[]),f=a?o:s,m=d.useMemo(()=>f===void 0?[]:Array.isArray(f)?f:[f],[f]);d.useEffect(()=>{a&&(e==="multiple"&&!Array.isArray(o)?(console.warn('Accordion with type="multiple" received non-array value:',o),u(o?[String(o)]:[])):e==="single"&&Array.isArray(o)?(console.warn('Accordion with type="single" received array value:',o),u(o.length>0?o[0]:void 0)):u(o))},[o,a,e]);const p=d.useCallback(x=>{let y;if(e==="single")f===x&&l?y=void 0:f!==x?y=x:y=f;else{const k=Array.isArray(f)?f:[];k.includes(x)?y=k.filter(I=>I!==x):y=[...k,x],Array.isArray(y)&&y.length===0&&(y=[])}a||u(y),n&&n(y)},[e,f,l,a,n]),b=d.useCallback(x=>m.includes(x),[m]);return{expandedItems:m,toggleItem:p,isItemExpanded:b,type:e,collapsible:l,baseId:h}},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"}}},Kt=d.createContext({expandedItems:[],toggleItem:()=>{},isItemExpanded:()=>!1,type:"single",collapsible:!1,baseId:""}),Ra=({children:e,value:o})=>r.jsx(Kt.Provider,{value:o,children:e}),Qt=()=>{const e=d.useContext(Kt);if(!e)throw new Error("useAccordionContext must be used within an AccordionProvider");return e},el=({value:e,children:o,isDisabled:t=!1,views:n,...l})=>{const{isItemExpanded:a,baseId:c}=Qt(),g=a(e),s=`${c}-trigger-${e}`,u=`${c}-content-${e}`;return r.jsx(i.View,{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",marginBottom:8,overflow:"hidden",opacity:t?.5:1,pointerEvents:t?"none":"auto","data-state":g?"open":"closed","data-disabled":t?"":void 0,...n==null?void 0:n.item,...l,children:d.Children.map(o,h=>d.isValidElement(h)?d.cloneElement(h,{...h.props,value:e,isExpanded:g,isDisabled:t,triggerId:s,contentId:u}):h)})},ol=({children:e,value:o,isExpanded:t,isDisabled:n,triggerId:l,contentId:a,views:c,asChild:g=!1,...s})=>{const{toggleItem:u}=Qt(),f={id:l,"aria-expanded":t,"aria-controls":a,"aria-disabled":n,"data-state":t?"open":"closed","data-disabled":n?"":void 0,onClick:()=>{o&&!n&&u(o)},padding:16,cursor:n?"not-allowed":"pointer",alignItems:"center",justifyContent:"space-between",backgroundColor:"color-white",width:"100%",...c==null?void 0:c.container,...s};if(g&&d.isValidElement(e)){const m=d.Children.only(e);return d.cloneElement(m,{...f,...m.props})}return r.jsxs(i.Horizontal,{...f,children:[e,r.jsx(i.View,{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",transform:t?"rotate(180deg)":"rotate(0deg)",...c==null?void 0:c.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"})})})]})},tl=({children:e,isExpanded:o,isDisabled:t,triggerId:n,contentId:l,views:a,...c})=>o?r.jsx(i.View,{id:l,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,...c,children:e}):null,rl=({children:e,shape:o="rounded",variant:t="default",views:n,baseId:l,type:a,collapsible:c,themeMode:g,...s})=>r.jsx(i.Vertical,{width:"100%","data-orientation":"vertical",...Za[o],...Ja[t],...n==null?void 0:n.container,...s,children:e}),Io=({children:e,type:o="single",value:t,defaultValue:n,onValueChange:l,collapsible:a=!1,shape:c="rounded",variant:g="default",views:s,...u})=>{const h=Array.isArray(n)?n:n?[n]:void 0,f=Qa({type:o,value:t,defaultValue:n??h,onValueChange:l,collapsible:a});return r.jsx(Ra,{value:{expandedItems:f.expandedItems,toggleItem:f.toggleItem,isItemExpanded:f.isItemExpanded,type:f.type,collapsible:f.collapsible,baseId:f.baseId},children:r.jsx(rl,{shape:c,variant:g,views:s,baseId:f.baseId,type:f.type,collapsible:f.collapsible,...u,children:e})})};Io.Item=el,Io.Trigger=ol,Io.Content=tl;const nt=new Map,nl=(e,o,t)=>(nt.has(e)||nt.set(e,d.lazy(()=>import("lucide-react/dynamicIconImports").then(n=>{const l=n.default[e];return l?l():{default:()=>r.jsx(r.Fragment,{children:o||t})}}))),nt.get(e)),Zt=d.memo(({widthHeight:e,color:o="currentColor",transform:t,orientation:n="up",children:l,...a})=>r.jsx(i.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:l})),To=d.memo(({name:e="circle",widthHeight:o=24,color:t="currentColor",filled:n=!1,strokeWidth:l=1,size:a,children:c,fallback:g,...s})=>{const{getColor:u}=i.useTheme(),h=a||o,f=d.useMemo(()=>{const b=u(t);return{fill:n?b:"none",stroke:b,strokeWidth:l,strokeLinecap:"round",strokeLinejoin:"round"}},[n,t,l,u]);if(!e)return r.jsx(Zt,{widthHeight:o,color:t,...s,children:c});const m=e.toLowerCase().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),p=nl(m,g,c);return r.jsx(Zt,{widthHeight:h,color:t,...s,children:r.jsx(d.Suspense,{fallback:g||null,children:r.jsx(p,{size:h,...f})})})}),G=(e,o={})=>{const t=n=>r.jsx(To,{name:e,...o,...n});return t.displayName=`${e}Icon`,t},al=G("user",{filled:!1}),ll=G("circle-help",{filled:!1}),cl=G("folder",{filled:!1}),le=G("chevron-up",{filled:!1}),il=G("grip-vertical",{filled:!1}),to=G("file",{filled:!1}),sl=G("video",{filled:!1}),dl=G("image",{filled:!1}),jo=G("volume",{filled:!1}),gl=G("twitter",{filled:!1}),ul=G("x",{filled:!1}),hl=G("twitch",{filled:!1}),pe=G("x",{filled:!1,strokeWidth:2}),fl=G("instagram",{filled:!1}),ml=G("youtube",{filled:!1}),pl=G("facebook",{filled:!1}),bl=G("linkedin",{filled:!1}),yl=G("at-sign",{filled:!1}),Jt=G("minus",{filled:!1}),Se=G("info",{filled:!1}),at=G("play",{filled:!1}),Rt=G("pause",{filled:!1}),xl=G("heart",{filled:!1}),kl=G("star",{filled:!1}),Cl=G("save",{filled:!1}),lt=G("triangle-alert",{filled:!1}),wl=G("battery",{filled:!1}),Il=G("bookmark",{filled:!1}),Tl=G("cloud",{filled:!1}),jl=G("copy",{filled:!1}),So=G("trash",{filled:!1}),Sl=So,Ml=G("edit",{filled:!1}),ct=G("mic",{filled:!1}),Mo=G("square",{filled:!1}),it=G("send",{filled:!1}),st=G("loader",{filled:!1}),ro=G("paperclip",{filled:!1}),zo=G("search",{filled:!1}),zl=G("home",{filled:!1}),er=G("settings",{filled:!1}),Vl=G("download",{filled:!1}),or=G("share",{filled:!1}),Vo=G("check",{filled:!1}),El=G("plus",{filled:!1}),dt=G("eye-off",{filled:!1}),gt=G("eye",{filled:!1}),Pl=G("lock",{filled:!1}),Wl=G("user",{filled:!1}),tr=G("external-link",{filled:!1}),ut=G("check-circle",{filled:!1}),Eo=G("alert-circle",{filled:!1}),_l=G("bell",{filled:!1}),$l=G("file-text",{filled:!1}),Hl=G("bar-chart",{filled:!1}),Bl=G("moon",{filled:!1}),rr=G("panel-left",{filled:!1}),ht=G("upload",{filled:!1}),Ll=Vo,Al=e=>r.jsx(le,{orientation:"left",...e}),Dl=G("zoom-out",{filled:!1}),Fl=G("type",{filled:!1}),Ol=G("shapes",{filled:!1}),ql=G("rotate-cw",{filled:!1}),Nl=G("gift",{filled:!1}),Ul=G("shield",{filled:!1}),Gl=G("log-out",{filled:!1}),Yl=G("power",{filled:!1}),vl=G("link",{filled:!1}),Xl=G("layout",{filled:!1}),Kl=G("zap",{filled:!1}),Ql=G("credit-card",{filled:!1}),Zl=G("more-horizontal",{filled:!1}),Jl=So,Rl=G("filter",{filled:!1}),ec=G("calendar",{filled:!1}),oc=G("clock",{filled:!1}),tc=G("map-pin",{filled:!1}),rc=G("menu",{filled:!1}),nc=G("refresh-cw",{filled:!1}),ac=G("printer",{filled:!1}),lc=G("wand",{filled:!1}),cc=G("thumbs-down",{filled:!1}),ic=G("thumbs-up",{filled:!1}),sc=G("camera",{filled:!1}),dc=G("bluetooth",{filled:!1}),gc=G("unlock",{filled:!1}),uc=G("wifi",{filled:!1}),hc=G("arrow-right",{filled:!1}),fc=G("arrow-up",{filled:!1}),mc=G("loader",{filled:!1}),pc=G("sliders-horizontal",{filled:!1}),bc=G("crop",{filled:!1}),yc=G("zoom-in",{filled:!1}),xc=G("grip-horizontal",{filled:!1}),nr=G("mouse-pointer-2",{filled:!1}),kc=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"}}}),Cc=d.memo(({icon:e,title:o="",views:t,description:n="",variant:l="default",themeMode:a,children:c,...g})=>{const{themeMode:s}=i.useTheme(),u=a||s,h=d.useMemo(()=>kc(),[u]),f=()=>{var b;if(e)return e;const p={size:20,color:((b=t==null?void 0:t.icon)==null?void 0:b.color)??h[l].icon.color};switch(l){case"info":return r.jsx(Se,{...p});case"success":return r.jsx(ut,{...p});case"error":return r.jsx(Eo,{...p});case"warning":default:return r.jsx(lt,{...p})}};return r.jsxs(i.Horizontal,{gap:12,padding:"16px",flexWrap:"nowrap",alignItems:"flex-start",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:h[l].container.borderColor,backgroundColor:h[l].container.backgroundColor,boxShadow:h[l].container.boxShadow,transition:"all 0.2s ease",...t==null?void 0:t.container,...g,children:[r.jsx(i.View,{alignSelf:"flex-start",marginTop:"2px",...t==null?void 0:t.icon,children:f()}),r.jsxs(i.Vertical,{gap:8,children:[" ",r.jsx(i.Text,{fontSize:"16px",fontWeight:"600",lineHeight:"24px",color:h[l].content.color,backgroundColor:h[l].container.backgroundColor,...t==null?void 0:t.title,children:o}),r.jsx(i.Text,{fontSize:"14px",fontWeight:"400",lineHeight:"20px",color:h[l].content.color,backgroundColor:h[l].container.backgroundColor,...t==null?void 0:t.description,children:n||c})]})]})}),wc=e=>r.jsx(Cc,{...e}),Ic=({ratio:e=16/9,children:o,views:t,...n})=>r.jsx(i.Center,{width:"100%",position:"relative",overflow:"hidden",paddingTop:`${1/e*100}%`,borderRadius:8,...n,...t==null?void 0:t.center,children:r.jsx(i.View,{position:"absolute",top:0,right:0,bottom:0,left:0,...t==null?void 0:t.view,children:o})}),Tc=({ratio:e,children:o,...t})=>r.jsx(Ic,{ratio:e,...t,children:o});function jc(e,o,t){return Math.min(Math.max(e,o),t)}const Sc=({bars:e,isPaused:o,...t})=>r.jsx(i.Horizontal,{alignItems:"center",minWidth:100,gap:1,height:32,maxWidth:200,width:"100%",marginTop:4,...t,children:e.map((l,a)=>r.jsx(i.View,{width:2,backgroundColor:o?"color-gray-200":l>=0?"color-gray-900":"color-gray-500",style:{height:`${jc(l*300,2,32)}px`}},a))}),ft=({analyserNode:e,isPaused:o,...t})=>{const n=d.useRef(null),l=60,a=32,[c,g]=d.useState([]);return d.useEffect(()=>{if(!e){g(Array(l).fill(-1));return}const s=e.frequencyBinCount,u=new Uint8Array(s),h=()=>{e.getByteTimeDomainData(u);let f=0;for(let p=0;p<s;p++){const b=(u[p]-128)/128;f+=b*b}const m=Math.sqrt(f/s);d.startTransition(()=>{g(p=>{const x=[...p,m].slice(-l);return x.length<l?[...Array(l-x.length).fill(-1),...x]:x})})};return n.current=setInterval(h,a),()=>{n.current&&clearInterval(n.current)}},[e]),r.jsx(Sc,{bars:c,isPaused:o,...t})},Po=tt.create(e=>({visible:!1,title:"",subtitle:"",variant:"info",isClosable:!1,views:{},action:()=>{},actionText:"",showIcon:!1,timeout:3e3,show:(o,t="",n="",l,a,c,g,s,u)=>e({visible:!0,variant:o,title:t,subtitle:n,isClosable:l,views:a,action:c,actionText:g,showIcon:s,timeout:u}),hide:()=>e({visible:!1})})),ar=(e,o,t,n)=>{Po.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)},lr=()=>{Po.getState().hide()},Mc={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"}}},cr=({variant:e,hide:o,title:t,subtitle:n,theme:l,action:a,actionText:c,showIcon:g=!1,isClosable:s=!1,timeout:u=3e3,views:h})=>{var k,I;d.useEffect(()=>{if(u&&!s){const T=setTimeout(()=>{o()},u);return()=>{clearTimeout(T)}}},[]);const f=l??Mc,m=!!(a&&c),p={borderWidth:1,borderStyle:"solid",borderRadius:8,borderColor:`${f[e].container.border}`},b={info:"#3b82f6",success:"#4ade80",warning:"#f97316",error:"#ef4444"}[e],x={info:r.jsx(Se,{widthHeight:24,color:b,...h==null?void 0:h.icon}),success:r.jsx(ut,{widthHeight:24,color:b,...h==null?void 0:h.icon}),warning:r.jsx(lt,{widthHeight:24,color:b,...h==null?void 0:h.icon}),error:r.jsx(Eo,{widthHeight:24,color:b,...h==null?void 0:h.icon})}[e],y=g&&x;return r.jsxs(i.Horizontal,{role:"messageContent",gap:16,width:400,flexWrap:"nowrap",position:"relative",alignItems:"center",padding:"14px 24px 14px 14px",color:`${f[e].content.color}`,backgroundColor:`${f[e].container.backgroundColor}`,onClick:s?()=>{}:()=>{o()},...p,...h==null?void 0:h.container,children:[y&&x,r.jsxs(i.Vertical,{gap:8,width:"100%",children:[r.jsx(i.Text,{size:"md",weight:"semiBold",...h==null?void 0:h.title,children:t}),n&&r.jsx(i.Text,{size:"sm",...h==null?void 0:h.subtitle,children:n})]}),m&&r.jsx(i.Text,{marginRight:10,onClick:a,padding:"6px 10px",whiteSpace:"nowrap",...p,...h==null?void 0:h.actionText,children:c}),s&&r.jsx(i.View,{position:"absolute",zIndex:1e4,right:8,top:6,onClick:()=>{o()},...(k=h==null?void 0:h.closingIcon)==null?void 0:k.container,children:r.jsx(pe,{widthHeight:18,color:b,...(I=h==null?void 0:h.closingIcon)==null?void 0:I.icon})})]})},zc=({container:e,theme:o,position:t="topRight"})=>{const{visible:n,title:l,variant:a,subtitle:c,isClosable:g,views:s,action:u,actionText:h,showIcon:f,timeout:m}=Po(),p={topLeft:{top:6,left:8},topRight:{top:6,right:8},bottomLeft:{bottom:8,left:6},bottomRight:{bottom:8,right:6}}[t],b=()=>r.jsx(cr,{variant:a,subtitle:c,show:n,title:l,theme:o,isClosable:g,views:s,action:u,actionText:h,showIcon:f,timeout:m,hide:()=>lr()}),x=e?d.cloneElement(e,{},b()):r.jsx(i.View,{position:"absolute",zIndex:1e4,...p,children:b()});return n?x:null},Vc=(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 l=n.getContext("2d");if(l){l.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)},Ec=({maxSize:e=100*1024*1024,onFileSelect:o,onMultipleFileSelect:t,validateFile:n,thumbnail:l,multiple:a=!1,onError:c=g=>{ar("error","Error",g)}})=>{const g=d.useRef(null),s=d.useRef(null),[u,h]=d.useState(null),[f,m]=d.useState([]),[p,b]=d.useState(null),[x,y]=d.useState(null),[k,I]=d.useState(l||null),T=d.useCallback(w=>{const j=w.target.files;if(b(null),!j||j.length===0){c("No file selected"),b("No file selected");return}if(a){const z=Array.from(j),E=[];for(const P of z){if(P.size>e){c(`File ${P.name} exceeds ${Math.round(e/(1024*1024))}MB.`),b(`File ${P.name} exceeds ${Math.round(e/(1024*1024))}MB.`);continue}if(n){const H=n(P);if(H){c(`${P.name}: ${H}`),b(`${P.name}: ${H}`);continue}}E.push(P)}E.length>0&&(m(E),t&&t(E))}else{const z=j[0];if(z.size>e){c(`File exceeds ${Math.round(e/(1024*1024))}MB.`),b(`File exceeds ${Math.round(e/(1024*1024))}MB.`);return}if(n){const E=n(z);if(E){c(E),b(E);return}}y(URL.createObjectURL(z)),z.type.startsWith("video/")&&Vc(z,I),o&&(h(z),o(z))}},[e,o,t,n,a]),C=()=>{var w;return(w=g.current)==null?void 0:w.click()};return d.useEffect(()=>()=>{x&&URL.revokeObjectURL(x),k&&URL.revokeObjectURL(k)},[x,k]),{previewUrl:x,thumbnailUrl:k,errorMessage:p,fileInputRef:g,videoRef:s,selectedFile:u,selectedFiles:f,handleFileChange:T,handleClick:C}},Pc=({accept:e,isLoading:o=!1,progress:t=0,icon:n,text:l,previewUrl:a,thumbnailUrl:c,errorMessage:g,fileInputRef:s,videoRef:u,selectedFile:h,selectedFiles:f,handleFileChange:m,handleClick:p,multiple:b=!1,containerProps:x,errorMessageProps:y,progressProps:k,videoProps:I,imageProps:T,iconProps:C,textProps:w,fileType:j,previewUrl:z,renderError:E=({errorMessage:V,errorMessageProps:B,themeMode:W})=>r.jsx(i.Text,{color:"red",fontSize:12,marginTop:8,...B,..._==null?void 0:_.text,children:V}),renderText:P=({text:V,textProps:B})=>r.jsx(i.Text,{marginTop:8,...B,..._==null?void 0:_.text,children:V}),renderFile:H=({selectedFile:V,textProps:B})=>V?r.jsxs(i.Center,{marginTop:8,gap:10,flexDirection:"column",..._==null?void 0:_.container,children:[r.jsx(i.Text,{maxLines:2,...B,..._==null?void 0:_.text,children:V.name}),r.jsxs(i.Text,{...B,..._==null?void 0:_.text,children:["(",Math.round(V.size/1024)," KB)"]})]}):null,renderVideo:S=({selectedFile:V,videoRef:B,videoProps:W})=>r.jsx(i.View,{width:"100%",height:"100%",position:"relative",..._==null?void 0:_.view,children:r.jsx(i.View,{as:"video",width:"100%",height:"100%",src:V?URL.createObjectURL(V):void 0,style:{objectFit:"cover"},ref:B,...W,..._==null?void 0:_.view})}),renderImage:$=({previewUrl:V,imageProps:B})=>(console.log("Rendering image with URL:",V),r.jsx(i.View,{width:"100%",height:"100%",position:"relative",..._==null?void 0:_.view,children:r.jsx(i.Image,{src:V,alt:"Preview",width:"100%",height:"100%",objectFit:"cover",style:{maxHeight:"100%",maxWidth:"100%"},...B,..._==null?void 0:_.image})})),renderProgress:A=({progress:V,progressProps:B})=>r.jsxs(i.Horizontal,{gap:8,alignItems:"center",...B,..._==null?void 0:_.horizontal,children:[r.jsx(i.View,{height:4,backgroundColor:"rgba(0,0,0,0.1)",width:"100%",borderRadius:2,..._==null?void 0:_.view,children:r.jsx(i.View,{height:4,width:`${V}%`,borderRadius:2,backgroundColor:"color-dark-50",..._==null?void 0:_.view})}),r.jsxs(i.Text,{fontSize:12,..._==null?void 0:_.text,children:[V,"%"]})]}),views:_={}})=>{const V=z||a;return r.jsxs(i.Center,{onClick:p,cursor:"pointer",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,padding:16,flexDirection:"column",overflow:"hidden",position:"relative",height:h&&t===100?"200px":"auto",...x,..._==null?void 0:_.container,children:[t===100&&j==="image"&&V&&$({previewUrl:V,imageProps:T}),t===100&&j==="video"&&c&&S({selectedFile:h,thumbnailUrl:c,videoRef:u,videoProps:I,imageProps:T}),t===100&&j==="file"&&h&&H({selectedFile:h,textProps:w}),t<100&&(n||r.jsx(ht,{widthHeight:32,...C})),!o&&!h&&l&&P({text:l,textProps:w}),o&&A({progress:t,progressProps:k}),!o&&g&&E({errorMessage:g,errorMessageProps:y}),r.jsx(i.View,{as:"input",type:"file",ref:s,onChange:m,accept:e,multiple:b,style:{display:"none"},..._==null?void 0:_.view})]})},Wo=({accept:e="*/*",icon:o,text:t,maxSize:n,onFileSelect:l,onMultipleFileSelect:a,validateFile:c,isLoading:g=!1,progress:s=0,fileType:u,multiple:h=!1,...f})=>{const{previewUrl:m,thumbnailUrl:p,errorMessage:b,videoRef:x,fileInputRef:y,selectedFile:k,selectedFiles:I,handleFileChange:T,handleClick:C}=Ec({maxSize:n,onFileSelect:l,onMultipleFileSelect:a,validateFile:c,multiple:h}),j=(()=>{if(u)return u;if(k)return k.type.startsWith("image/")?"image":k.type.startsWith("video/")?"video":"file"})();return r.jsx(Pc,{handleClick:C,accept:e,isLoading:g,progress:s,icon:o,text:t,maxSize:n,onFileSelect:l,validateFile:c,errorMessage:b,handleFileChange:T,selectedFile:k,selectedFiles:I,videoRef:x,fileInputRef:y,previewUrl:m,thumbnailUrl:p,fileType:j,multiple:h,...f})};function Wc({onAudio:e,recording:o,paused:t,audioBlob:n,analyserNode:l,startRecording:a,stopRecording:c,pauseRecording:g,resumeRecording:s,resetRecording:u,handleFileChange:h,...f}){const[m,p]=d.useState(null);return d.useEffect(()=>{if(n){const b=URL.createObjectURL(n);return p(b),()=>{URL.revokeObjectURL(b)}}return p(null),()=>{}},[n]),r.jsxs(i.View,{gap:"8px",...f,children:[r.jsxs(i.Horizontal,{gap:8,alignItems:"center",margin:10,children:[r.jsx(Wo,{accept:"audio/*",icon:r.jsx(ro,{widthHeight:16}),maxSize:100*1024*1024,onFileSelect:b=>e(b),fileType:"file",multiple:!1,renderError:({errorMessage:b})=>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:b=>b.size>100*1024*1024?"File size exceeds 100MB limit":b.type.startsWith("audio/")?null:"Only audio files are allowed"}),o?r.jsxs(i.Horizontal,{gap:8,alignItems:"center",children:[r.jsx(i.View,{as:"button",type:"button",onClick:t?s:g,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(at,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(Rt,{widthHeight:16,color:"currentColor",filled:!1})}),r.jsx(i.View,{as:"button",type:"button",onClick:c,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(Mo,{widthHeight:16,color:"currentColor",filled:!1})}),r.jsx(i.View,{minWidth:90,children:o&&r.jsx(ft,{analyserNode:l,isPaused:t})})]}):r.jsx(i.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(ct,{widthHeight:16,color:"currentColor",filled:!1})})]}),m&&!o&&r.jsx("audio",{controls:!0,src:m})]})}function ir(){const[e,o]=d.useState(!1),[t,n]=d.useState(!1),[l,a]=d.useState(0),[c,g]=d.useState(null),[s,u]=d.useState(null),[h,f]=d.useState(null),m=d.useRef(null),p=d.useRef(null),b=d.useRef(null),x=d.useRef(null),y=d.useRef([]),k=d.useRef(null),I=typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",T=d.useCallback(()=>{m.current&&(m.current.state!=="inactive"&&m.current.stop(),m.current=null),x.current&&(x.current.getTracks().forEach(P=>P.stop()),x.current=null),p.current&&(p.current.close(),p.current=null),b.current&&(b.current.disconnect(),b.current=null),u(null),k.current&&(clearInterval(k.current),k.current=null)},[]),C=d.useCallback(async()=>{T(),g(null),a(0),y.current=[];try{const P=await navigator.mediaDevices.getUserMedia({audio:!0});x.current=P;const H=MediaRecorder.isTypeSupported(I)?I:void 0,S=new MediaRecorder(P,H?{mimeType:H}:void 0);m.current=S;const $=new(window.AudioContext||window.webkitAudioContext);p.current=$;const A=$.createMediaStreamSource(P),_=$.createAnalyser();_.fftSize=256,_.smoothingTimeConstant=.8,A.connect(_),b.current=_,u(_),S.ondataavailable=V=>{V.data.size>0&&y.current.push(V.data)},S.onstop=()=>{const V=new Blob(y.current,{type:S.mimeType||I});f(V),T()},S.start(),o(!0),n(!1),k.current=setInterval(()=>{a(V=>V+1)},1e3)}catch{g("Microphone access denied or unavailable."),T()}},[T]),w=d.useCallback(()=>{m.current&&m.current.state!=="inactive"&&m.current.stop(),o(!1),n(!1),k.current&&(clearInterval(k.current),k.current=null)},[]),j=d.useCallback(()=>{m.current&&m.current.state==="recording"&&(m.current.pause(),n(!0),k.current&&(clearInterval(k.current),k.current=null))},[]),z=d.useCallback(()=>{m.current&&m.current.state==="paused"&&(m.current.resume(),n(!1),k.current||(k.current=setInterval(()=>{a(P=>P+1)},1e3)))},[]),E=d.useCallback(()=>{T(),o(!1),n(!1),f(null),a(0),g(null),y.current=[]},[T]);return d.useEffect(()=>()=>T(),[T]),{recording:e,paused:t,audioBlob:h,analyserNode:s,duration:l,error:c,startRecording:C,stopRecording:w,pauseRecording:j,resumeRecording:z,resetRecording:E}}function _c(e){const{onAudio:o}=e,{recording:t,paused:n,audioBlob:l,analyserNode:a,startRecording:c,stopRecording:g,pauseRecording:s,resumeRecording:u,resetRecording:h}=ir();return d.useEffect(()=>{if(l&&o){const m=new File([l],"recording.webm",{type:l.type||"audio/webm;codecs=opus"});o(m)}},[l,o]),{recording:t,paused:n,audioBlob:l,analyserNode:a,startRecording:c,stopRecording:g,pauseRecording:s,resumeRecording:u,resetRecording:h,handleFileChange:m=>{var b;const p=(b=m.target.files)==null?void 0:b[0];p&&o&&o(p)}}}function $c(e){const o=_c(e);return r.jsx(Wc,{...e,...o})}const Hc=()=>{const[e,o]=d.useState(!1);return{imageError:e,setImageError:o}},Bc={xs:24,sm:32,md:48,lg:64,xl:80},mt={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"}},Lc=({src:e,size:o="md",fallback:t="IM",views:n,imageError:l,setImageError:a,onClick:c=()=>{},children:g})=>{const s=Bc[o],u={...mt.image,...(n==null?void 0:n.image)||{}};return r.jsxs(i.Center,{role:"avatar",width:s,height:s,...mt.container,borderColor:l?"color-gray-400":"transparent",onClick:c,...n==null?void 0:n.container,children:[!l&&e?r.jsx(i.Image,{alt:"IM",src:e,style:u,width:s,height:s,onError:()=>a(!0)}):r.jsx(i.Text,{size:o,...mt.fallback,...n==null?void 0:n.fallback,children:t}),g]})},Ac=({src:e,size:o,views:t,fallback:n,onClick:l,children:a})=>{const{imageError:c,setImageError:g}=Hc();return r.jsx(Lc,{src:e,size:o,views:t,fallback:n,imageError:c,setImageError:g,onClick:l,children:a})},Dc={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"}},Fc={square:0,rounded:"8px",pill:"9999px"},Oc={"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"}},qc=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"}}),sr=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"}}}),Nc=d.memo(({content:e,children:o,icon:t,pastil:n,position:l,shape:a="pill",variant:c="filled",size:g="md",views:s,themeMode:u,...h})=>{const{themeMode:f}=i.useTheme(),m=u||f,p=d.useMemo(()=>qc()[c],[m,c]),b=d.useMemo(()=>sr(),[m]),x=d.useMemo(()=>({width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",borderRadius:Fc[a],...Dc[g],...p,...l?Oc[l]:{},...s==null?void 0:s.container}),[a,g,p,l,s==null?void 0:s.container]);let y="currentColor";return typeof n=="string"?n in b?y=b[n].indicator.backgroundColor:y=n:n===!0&&(y="color-green-500",c==="filled"&&(y="color-white")),r.jsxs(i.Center,{role:"badge",...x,...h,children:[t&&r.jsx(i.View,{role:"badge-icon",...s==null?void 0:s.icon,children:t}),n&&r.jsx(i.View,{role:"badge-pastil",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:y,...s==null?void 0:s.pastil}),(e||o)&&r.jsx(i.Text,{role:"badgeText",fontWeight:"500",textAlign:"center",...s==null?void 0:s.text,color:x.color,children:o||e})]})}),Uc=e=>r.jsx(Nc,{...e}),Gc=()=>{const[e,o]=d.useState(!1);return{isHovered:e,setIsHovered:o}},Yc={xs:12,sm:14,md:16,lg:18,xl:20},vc=({children:e,to:o="/",iconSize:t="sm",underline:n="default",isHovered:l=!1,isExternal:a=!1,views:c={icon:{},text:{}},setIsHovered:g=()=>{},...s})=>{const u=()=>{n==="hover"&&g(!0)},h=()=>{n==="hover"&&g(!1)},f=()=>n==="underline"||n==="hover"&&l?"underline":"none";return r.jsx(Xa.Link,{to:o,target:a?"_blank":"_self",style:{textDecoration:"inherit",color:"inherit"},children:r.jsxs(i.Horizontal,{onMouseEnter:u,onMouseLeave:h,gap:3,alignItems:"center",flexWrap:"nowrap",textDecoration:f(),...c.text,...s,children:[e,a&&r.jsx(tr,{widthHeight:Yc[t]})]})})},dr=e=>{const o=Gc();return r.jsx(vc,{...o,...e})},pt={xs:14,sm:18,md:22,lg:26,xl:30},bt={fast:50,normal:100,slow:300},Xc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...l})=>{const{getColor:a,themeMode:c}=i.useTheme(),g=a(t,{themeMode:n||c}),s=typeof e=="number"?e:pt[e],[u,h]=d.useState(0);return d.useEffect(()=>{const f=setInterval(()=>{h(m=>m+45)},bt[o]);return()=>clearInterval(f)},[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:g,strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:`rotate(${u}deg)`},...l,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"})})]})},Kc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...l})=>{const{getColor:a,themeMode:c}=i.useTheme(),g=a(t,{themeMode:n||c}),s=typeof e=="number"?e:pt[e],[u,h]=d.useState(0);return d.useEffect(()=>{const f=setInterval(()=>{h(m=>m+45)},bt[o]);return()=>clearInterval(f)},[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(${u}deg)`},...l,children:[r.jsx("circle",{cx:"10",cy:"25",r:"4",fill:g}),r.jsx("circle",{cx:"25",cy:"25",r:"4",fill:g}),r.jsx("circle",{cx:"40",cy:"25",r:"4",fill:g})]})},Qc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...l})=>{const{getColor:a,themeMode:c}=i.useTheme(),g=a(t,{themeMode:n||c}),s=typeof e=="number"?e:pt[e],[u,h]=d.useState(0);return d.useEffect(()=>{const f=setInterval(()=>{h(m=>m+45)},bt[o]);return()=>clearInterval(f)},[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(${u}deg)`},...l,children:r.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:g,strokeWidth:"5",strokeDasharray:"1,10"})})},Zc=({size:e,children:o,textColor:t,loaderColor:n,type:l="default",speed:a="normal",textPosition:c="right",views:g,...s})=>{const{getColor:u}=i.useTheme();n=u(n||s.color||"theme-loading"),t=u(t||s.color||"theme-loading");const h={size:e,speed:a,color:n},f={default:r.jsx(Xc,{...h}),dotted:r.jsx(Kc,{...h}),quarter:r.jsx(Qc,{...h})};return r.jsxs(i.Center,{gap:10,flexDirection:c==="top"||c==="bottom"?"column":"row",...s,...g==null?void 0:g.container,children:[(c==="left"||c==="top")&&o&&r.jsx(i.View,{color:t,...g==null?void 0:g.text,children:o}),f[l],(c==="right"||c==="bottom")&&o&&r.jsx(i.View,{color:t,...g==null?void 0:g.text,children:o})]})},no=e=>r.jsx(Zc,{...e}),Jc={xs:10,sm:12,md:14,lg:16,xl:20},ao={xs:12,sm:16,md:20,lg:24,xl:28},lo=e=>({minHeight:ao[e]*2,paddingHorizontal:ao[e]/2,fontSize:Jc[e],fontWeight:500,lineHeight:ao[e],letterSpacing:"-0.01em",paddingInline:ao[e],paddingBlock:ao[e]/2,outlineWidth:"medium"}),gr={xs:lo("xs"),sm:lo("sm"),md:lo("md"),lg:lo("lg"),xl:lo("xl")},co={square:0,rounded:8,pill:999},ur={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}},Rc=(e,o,t=!1)=>{const n=t?o:e,l=t?e:o,a=t?o:e;return{filled:{backgroundColor:n,color:l,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"}}},ei=d.memo(({children:e,icon:o,isLoading:t,iconPosition:n="left",loaderPosition:l="left",size:a="md",resolvedTextColor:c,isIconRounded:g,views:s})=>{const u=["left","right"].includes(n)?i.Horizontal:i.Vertical,h=gr[a],f=g?ur[a]:{};return r.jsxs(u,{gap:8,alignItems:"center",justifyContent:"center",...h,...f,...s==null?void 0:s.content,children:[t&&l==="left"&&r.jsx(no,{size:a==="xs"||a==="sm"?"sm":"md",color:c,...s==null?void 0:s.loader}),o&&["left","top"].includes(n)&&!t&&r.jsx(i.View,{color:c,...s==null?void 0:s.icon,children:o}),e,o&&["right","bottom"].includes(n)&&!t&&r.jsx(i.View,{color:c,...s==null?void 0:s.icon,children:o}),t&&l==="right"&&r.jsx(no,{size:a==="xs"||a==="sm"?"sm":"md",color:c,...s==null?void 0:s.loader})]})}),oi=e=>{const o=co[e];return typeof o=="number"?o:typeof o=="string"&&parseInt(o,10)||0},ti=({asComponent:e,isDisabled:o,isLoading:t,isWrapped:n=!1,borderRadius:l,width:a,height:c,baseStyles:g,sizeStyles:s,iconPad:u,mainTone:h,resolvedTextColor:f,children:m,borderWidth:p=0,...b})=>r.jsx(i.Element,{as:e,disabled:!!(o||t),display:n?"flex":"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:l,width:a,height:c,...g,...s,...u,backgroundColor:(g==null?void 0:g.backgroundColor)||(n?h:void 0),color:f,borderWidth:n?0:void 0,cursor:o?"default":"pointer",...b,children:m}),ri=({shape:e,isDisabled:o,onClick:t,shadow:n,borderWidth:l,isAuto:a,isFilled:c,views:g,children:s,...u})=>r.jsx(i.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:co[e],cursor:o?"default":"pointer",onClick:t,boxShadow:n,padding:l,width:a?"fit-content":c?"100%":void 0,...g==null?void 0:g.container,...u,children:s}),ni=({variant:e,animation:o,to:t,isDisabled:n,isLoading:l,isAuto:a,isFilled:c,isExternal:g,shape:s="rounded",shadow:u,onClick:h,views:f,baseStyles:m,sizeStyles:p,iconPad:b,containerRef:x,resolvedTextColor:y,content:k,size:I,mainTone:T,borderMovingDuration:C=2,borderMovingGradientColors:w=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:j="#705CFF",animatedStrokeTextColor:z="#333333",getColor:E=H=>H,...P})=>{var A;const H=oi(s),S=t?r.jsx(dr,{to:t,isExternal:g,color:"currentColor",textDecoration:"inherit",_hover:{color:"currentColor"},...f==null?void 0:f.link,children:k}):k,$={isDisabled:n,isLoading:l,baseStyles:m,sizeStyles:p,iconPad:b,resolvedTextColor:y,mainTone:T,children:S};if(o==="borderMoving"&&w){const V={from:{backgroundPosition:"0% 50%"},to:{backgroundPosition:"200% 50%"},duration:`${C}s`,timingFunction:"linear",iterationCount:"infinite"};return r.jsx(ri,{shape:s,isDisabled:n,onClick:h,shadow:u,borderWidth:3,isAuto:a,isFilled:c,views:f,background:`linear-gradient(90deg, ${w[0]}, ${w[1]}, ${w[2]}, ${w[0]})`,backgroundSize:"200% 100%",animate:V,...P,children:r.jsx(ti,{asComponent:t?"div":"button",isWrapped:!0,borderRadius:Math.max(0,H-3),width:"100%",height:"100%",...$})})}if(o==="animatedStroke"){const _=E(j),V=E(z),B=1e3,W={from:{strokeWidth:"8px",strokeDasharray:`0 ${B}`,strokeDashoffset:-Math.round(B*.63)},to:{strokeWidth:"3px",strokeDasharray:`${B}`,strokeDashoffset:0},duration:"0.9s",timingFunction:"ease-in",fillMode:"forwards"},L=["group",(A=f==null?void 0:f.container)==null?void 0:A.className,P==null?void 0:P.className].filter(Boolean).join(" ");return r.jsxs(i.Element,{ref:x,as:t?"div":"button",type:t?void 0:"button",disabled:!!(!t&&(n||l)),onClick:h,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":c?"100%":void 0,borderRadius:co[s],boxShadow:u,transition:"background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",cursor:n?"default":"pointer",color:V,backgroundColor:"transparent",borderWidth:0,...f==null?void 0:f.container,...P,className:L,children:[r.jsx(i.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(i.View,{as:"rect",x:"0",y:"0",height:"100%",width:"100%",rx:H,ry:H,fill:"transparent",stroke:_,strokeWidth:"8px",strokeDasharray:`0 ${B}`,strokeDashoffset:-Math.round(B*.63),pathLength:B,on:{groupHover:{animate:W}}})}),r.jsx(i.View,{position:"relative",zIndex:0,children:S})]})}if(o==="borderReveal"){const V=(w==null?void 0:w[0])||T||"#000000",W=C*.75/4,L=`linear-gradient(90deg, ${V} 50%, transparent 50%)`,D=`linear-gradient(180deg, ${V} 50%, transparent 50%)`,F=`linear-gradient(270deg, ${V} 50%, transparent 50%)`,q=`linear-gradient(0deg, ${V} 50%, transparent 50%)`,O="100% 0, 100% 100%, 0 100%, 0 0",U="0 0, 100% 0, 100% 100%, 0 100%",Z=`0s, ${W}s, ${W*2}s, ${W*2}s`,X=`${W*2}s, ${W*2}s, ${W}s, 0s`,N=4;return r.jsx(i.Element,{ref:x,as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:co[s],cursor:n?"default":"pointer",onClick:h,boxShadow:u,padding:3,background:`
|
|
3
2
|
${L} no-repeat,
|
|
4
3
|
${D} no-repeat,
|
|
5
|
-
${F} no-repeat
|
|
6
|
-
`,backgroundSize:`200% ${X}px, ${X}px 200%, 200% ${X}px, ${X}px 200%`,backgroundPosition:q,transitionProperty:"background-position",transitionDuration:`${$}s`,transitionTimingFunction:"linear",transitionDelay:Z,_hover:{backgroundPosition:O,transitionDelay:N},width:a?"fit-content":c?"100%":void 0,...f==null?void 0:f.container,...V,children:r.jsx(i.View,{as:t?"div":"button",disabled:!!(n||l),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:Math.max(0,W-3),width:"100%",height:"100%",...m,...p,...b,backgroundColor:(m==null?void 0:m.backgroundColor)||w,color:x,borderWidth:0,cursor:n?"default":"pointer",children:H})})}return r.jsx(i.Element,{as:e==="link"&&t?"div":"button",type:e==="link"&&t?void 0:"button",disabled:!!(n||l),...p,...b,display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":c?"100%":void 0,borderRadius:co[s],boxShadow:u,transition:"all 0.2s ease",cursor:n?"default":"pointer",onClick:h,...m,...f==null?void 0:f.container,...V,children:H})},li=g.memo(({variant:e="filled",size:o="md",shape:t="rounded",iconPosition:n="left",loaderPosition:l="left",backgroundColor:a,color:c,textColor:d,reversed:s=!1,isAuto:u=!0,isFilled:h,isDisabled:f,isLoading:m,isIconRounded:p,isHovered:b,icon:x,children:y,to:k,isExternal:w,shadow:T,onClick:C,views:I={},borderMovingDuration:j=2,borderMovingGradientColors:z=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:V="#705CFF",animatedStrokeTextColor:W="#333333",...H})=>{const{getColorHex:S}=i.useTheme();let E=S(f?"theme-disabled":m?"theme-loading":a??c??"theme-button-background");(E==="theme-button-background"||E==="theme-loading")&&(E=S(m?"color-dark-500":"theme-primary"));let $=S(d??"theme-button-text");$==="theme-button-text"&&($=S("color-white"));const L=g.useMemo(()=>ei(E,$,s),[E,$,s])[e],D=(L==null?void 0:L.color)??$,F=r.jsx(oi,{icon:x,isLoading:m,iconPosition:n,loaderPosition:l,size:o,resolvedTextColor:D,isIconRounded:p,views:I,children:y}),q=ur[o],O=p?hr[o]:{};return r.jsx(ai,{variant:e,animation:H.animation,to:k,isDisabled:f,isLoading:m,isAuto:u,isFilled:h,isExternal:w,shape:t,shadow:T,onClick:C,views:I,baseStyles:L,sizeStyles:q,iconPad:O,resolvedTextColor:D,content:F,size:o,mainTone:E,borderMovingDuration:j,borderMovingGradientColors:z,animatedStrokeAccentColor:V,animatedStrokeTextColor:W,getColor:S,...H})}),_e=e=>{const[o,t]=i.useHover();return r.jsx(li,{ref:o,isHovered:t,...e})},ci={sm:{padding:"12px"},md:{padding:"16px"},lg:{padding:"24px"}},ii={square:0,rounded:"8px",pill:"24px"},si=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)"}}}},_o=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"}}},fr=g.createContext({}),xt=()=>g.useContext(fr),kt=({children:e,views:o,style:t,themeMode:n,...l})=>{var u;const a=i.useTheme(),{styles:c}=xt(),d=_o(a).header,s={...d,...c==null?void 0:c.header,...l,style:{...d==null?void 0:d.style,...(u=c==null?void 0:c.header)==null?void 0:u.style,...t}};return r.jsx(i.Vertical,{gap:8,...s,children:e})},Ct=({children:e,views:o,style:t,themeMode:n,...l})=>{var u;const a=i.useTheme(),{styles:c}=xt(),d=_o(a).content,s={...d,...c==null?void 0:c.content,...l,style:{...d==null?void 0:d.style,...(u=c==null?void 0:c.content)==null?void 0:u.style,...t}};return r.jsx(i.Vertical,{gap:12,...s,children:e})},wt=({children:e,views:o,style:t,themeMode:n,...l})=>{var u;const a=i.useTheme(),{styles:c}=xt(),d=_o(a).footer,s={...d,...c==null?void 0:c.footer,...l,style:{...d==null?void 0:d.style,...(u=c==null?void 0:c.footer)==null?void 0:u.style,...t}};return r.jsx(i.Vertical,{gap:8,...s,children:e})},di=({variant:e="default",size:o="md",shape:t="rounded",children:n,header:l,footer:a,isFullWidth:c=!1,views:d,style:s,themeMode:u,...h})=>{var C,I;const f=i.useTheme(),m=_o(f),p=((C=ci[o])==null?void 0:C.padding)||"16px",b=g.useMemo(()=>({styles:{container:{...m.container,borderRadius:ii[t],...d==null?void 0:d.container},header:{...m.header,padding:p,...d==null?void 0:d.header},content:{...m.content,padding:p,...d==null?void 0:d.content},footer:{...m.footer,padding:p,...d==null?void 0:d.footer}}}),[m,d,p,t]),x=g.Children.toArray(n).some(j=>g.isValidElement(j)&&(j.type===kt||j.type===Ct||j.type===wt)),{themeMode:y}=f,w=si(u||y)[e],T={width:c?"100%":"auto",overflow:"hidden",...w,...b.styles.container,...h,style:{...(I=b.styles.container)==null?void 0:I.style,...s}};return r.jsx(fr.Provider,{value:b,children:r.jsx(i.View,{...T,children:x?n:r.jsxs(i.Vertical,{width:"100%",children:[l&&r.jsx(kt,{children:l}),r.jsx(Ct,{children:n}),a&&r.jsx(wt,{children:a})]})})})},$o=e=>r.jsx(di,{...e});$o.Header=kt,$o.Content=Ct,$o.Footer=wt;const gi=({defaultActiveIndex:e=0,activeIndex:o,onChange:t,autoPlay:n=!1,autoPlayInterval:l=3e3,pauseOnHover:a=!0,infinite:c=!0,totalSlides:d,stepIndices:s})=>{const u=g.useRef(d||0),[h,f]=g.useState(d||0),m=g.useRef(new Set),p=g.useRef(0),b=g.useMemo(()=>rt("carousel-content"),[]),[x,y]=g.useState(o!==void 0?o:e),[k,w]=g.useState(!1),[T,C]=g.useState(!1),[I,j]=g.useState(0),[z,V]=g.useState(0),W=g.useRef(null);g.useEffect(()=>{o!==void 0&&y(o)},[o]);const H=g.useCallback(O=>{let N=O;c?O<0?N=h-1:O>=h&&(N=0):N=Math.max(0,Math.min(O,h-1)),s&&s.length>0&&(s.includes(N)||(N=s.reduce((X,G)=>Math.abs(G-N)<Math.abs(X-N)?G:X))),o===void 0&&y(N),t&&t(N)},[o,c,t,h]),S=g.useCallback(()=>{H(x+1)},[x,H]),B=g.useCallback(()=>{H(x-1)},[x,H]);g.useEffect(()=>(n&&!k&&!T&&(W.current=setInterval(()=>{S()},l)),()=>{W.current&&clearInterval(W.current)}),[n,l,k,T,S,a]);const A=g.useCallback(()=>{a&&w(!0)},[a]),E=g.useCallback(()=>{w(!1)},[]),P=g.useCallback(O=>{C(!0),"touches"in O?(j(O.touches[0].clientX),V(O.touches[0].clientY)):(j(O.clientX),V(O.clientY))},[]),$=g.useCallback(O=>{if(!T)return;let N,Z;"touches"in O?(N=O.touches[0].clientX,Z=O.touches[0].clientY):(N=O.clientX,Z=O.clientY);const X=N-I,G=Z-z;Math.abs(X)>Math.abs(G)&&Math.abs(X)>50&&(X>0?B():S(),C(!1))},[T,I,z,S,B]),_=g.useCallback(()=>{C(!1)},[]),L=g.useCallback(()=>{const O=p.current++;m.current.add(O);const N=m.current.size;return u.current=N,f(N),O},[]),D=g.useCallback(O=>{m.current.delete(O);const N=m.current.size;if(u.current=N,f(N),N>0&&x>=N){const Z=Math.max(0,N-1);o===void 0&&y(Z),t&&t(Z)}},[x,o,t]),F=c||x>0,q=c||x<h-1;return{activeIndex:x,totalSlides:h,goToSlide:H,nextSlide:S,prevSlide:B,canGoNext:q,canGoPrevious:F,handleMouseEnter:A,handleMouseLeave:E,handleDragStart:P,handleDragMove:$,handleDragEnd:_,registerSlide:L,unregisterSlide:D,contentId:b,infinite:c}},ui={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"}},hi={dot:{backgroundColor:"theme-primary"},line:{backgroundColor:"theme-primary"},number:{backgroundColor:"theme-primary",color:"color-white"}},Ho={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"}},io=()=>({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,...Ho},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...Ho}}),mr=g.createContext(null),Bo=()=>{const e=g.useContext(mr);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},pr=({children:e,isActive:o,views:t,...n})=>r.jsx(i.View,{flexShrink:0,width:"100%",height:"100%",display:o?"block":"none",...t,...n,children:e}),br=({views:e,children:o,...t})=>{const{goToPrevious:n,canGoPrevious:l,styles:a}=Bo(),d={...io().prevButton,...a==null?void 0:a.prevButton,...e==null?void 0:e.prevButton};return r.jsx(_e,{"aria-label":"Previous slide",onClick:()=>n(),isDisabled:!l,...d,...t,children:o??r.jsx(le,{orientation:"left",widthHeight:16})})},yr=({views:e,children:o,...t})=>{const{goToNext:n,canGoNext:l,styles:a}=Bo(),d={...io().nextButton,...a==null?void 0:a.nextButton,...e==null?void 0:e.nextButton};return r.jsx(_e,{"aria-label":"Next slide",onClick:()=>n(),isDisabled:!l,...d,...t,children:o??r.jsx(le,{orientation:"right",widthHeight:16})})},xr=({children:e,views:o,...t})=>{const{registerSlide:n,unregisterSlide:l,styles:a}=Bo(),c=g.useRef(null);g.useEffect(()=>{const u=n();return c.current=u,()=>{c.current!==null&&l(c.current)}},[n,l]);const s={...io().item,...a==null?void 0:a.item,...o==null?void 0:o.item};return r.jsx(i.View,{role:"group","aria-roledescription":"slide",...s,...t,children:e})},kr=({children:e,views:o,style:t,...n})=>{const{currentIndex:l,styles:a,contentId:c}=Bo(),d=io(),s={...d.content,...a==null?void 0:a.content,...o==null?void 0:o.content},u={...d.innerContainer,...a==null?void 0:a.innerContainer,...o==null?void 0:o.innerContainer},h=`-${l*100}%`;return r.jsx(i.View,{...s,...n,style:{...s==null?void 0:s.style,...t},id:c,"aria-live":"polite",children:r.jsx(i.View,{...u,style:{...u==null?void 0:u.style,transform:`translateX(${h})`},children:e})})},fi=({children:e,defaultActiveIndex:o=0,activeIndex:t,onChange:n,showNavigation:l=!0,navigationPosition:a="inside",prevButton:c,nextButton:d,showIndicators:s=!0,indicatorPosition:u="bottom",indicatorVariant:h="dot",autoPlay:f=!1,autoPlayInterval:m=3e3,pauseOnHover:p=!0,infinite:b=!0,direction:x="horizontal",transitionDuration:y=300,views:k,stepIndices:w,themeMode:T,...C})=>{const I=g.useMemo(()=>g.Children.toArray(e),[e]),j=gi({defaultActiveIndex:o,activeIndex:t,onChange:n,autoPlay:f,autoPlayInterval:m,pauseOnHover:p,infinite:b,totalSlides:I.length}),{activeIndex:z,totalSlides:V,goToSlide:W,nextSlide:H,prevSlide:S,handleMouseEnter:B,handleMouseLeave:A,handleDragStart:E,handleDragMove:P,handleDragEnd:$}=j,_=()=>{if(!l)return null;const F=c||r.jsx(i.View,{as:"button","aria-label":"Previous slide",...Ho,...k==null?void 0:k.prevButton,children:"❮"}),q=d||r.jsx(i.View,{as:"button","aria-label":"Next slide",...Ho,...k==null?void 0:k.nextButton,children:"❯"});return r.jsxs(r.Fragment,{children:[r.jsx(i.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",left:a==="inside"?"10px":"-40px",onClick:S,cursor:!b&&z===0?"not-allowed":"pointer",opacity:!b&&z===0?.5:1,children:F}),r.jsx(i.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",right:a==="inside"?"10px":"-40px",onClick:H,cursor:!b&&z===I.length-1?"not-allowed":"pointer",opacity:!b&&z===I.length-1?.5:1,children:q})]})},L=()=>s?r.jsx(i.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...u==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:I.map((F,q)=>r.jsx(i.View,{onClick:()=>W(q),cursor:"pointer",...ui[h],...q===z?{...hi[h]}:{},...k==null?void 0:k.indicator,...q===z?k==null?void 0:k.activeIndicator:{},children:h==="number"&&q+1},q))}):null;return g.useMemo(()=>g.Children.toArray(e).some(F=>g.isValidElement(F)&&(F.type===kr||F.type===xr||F.type===br||F.type===yr)),[e])?r.jsx(mr.Provider,{value:{currentIndex:z,totalSlides:V,goToSlide:W,goToNext:H,goToPrevious:S,canGoNext:j.canGoNext,canGoPrevious:j.canGoPrevious,registerSlide:j.registerSlide,unregisterSlide:j.unregisterSlide,styles:{...io(),...k},contentId:j.contentId,infinite:b},children:r.jsx(i.View,{role:"region","aria-roledescription":"carousel","aria-label":"Carousel",position:"relative",width:"100%",height:"100%",overflow:"hidden",...k==null?void 0:k.container,...C,children:e})}):r.jsxs(i.View,{position:"relative",width:"100%",height:"100%",overflow:"hidden",onMouseEnter:B,onMouseLeave:A,onTouchStart:E,onTouchMove:P,onTouchEnd:$,onMouseDown:E,onMouseMove:P,onMouseUp:$,...k==null?void 0:k.container,...C,children:[r.jsx(i.View,{width:"100%",height:"100%",position:"relative",...k==null?void 0:k.slideWrapper,children:I.map((F,q)=>r.jsx(pr,{isActive:q===z,index:q,views:k==null?void 0:k.slide,children:F},q))}),_(),L()]})},Oe=e=>r.jsx(fi,{...e});Oe.Slide=pr,Oe.Content=kr,Oe.Item=xr,Oe.Previous=br,Oe.Next=yr;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"},qe=[ke.blue,ke.green,ke.purple,ke.orange,ke.red,ke.teal,ke.pink,ke.indigo,ke.yellow,ke.cyan],mi={width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},pi={fontSize:"18px",fontWeight:"bold",marginBottom:"16px",textAlign:"center"},bi={display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"16px"},yi={display:"flex",alignItems:"center",marginRight:"16px",marginBottom:"8px"},xi={width:"12px",height:"12px",borderRadius:"2px",marginRight:"6px"},ki={fontSize:"14px"},Cr={stroke:"color-gray-200",strokeWidth:"1px"},Lo={stroke:"color-gray-300",strokeWidth:"1px"},Ao={fontSize:"12px",fill:"color-gray-600"},Ci={rx:"2px",ry:"2px",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},wi={strokeWidth:"2px",fill:"none"},Ii={r:"4px",strokeWidth:"2px",stroke:"white",cursor:"pointer",transition:"r 0.2s ease"},Do={strokeWidth:"1px",stroke:"white",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},It={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"},Ti={...It},ji={...It,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},Si={...It,backgroundColor:"rgba(245, 245, 245, 0.8)",color:"color-gray-600"},Mi=({data:e,dataPoints:o,animated:t=!0,animationDuration:n=500,showTooltips:l=!0})=>{const[a,c]=g.useState(t?0:1),[d,s]=g.useState({visible:!1,x:0,y:0,content:null}),u=g.useRef(null),h=g.useRef(null);g.useEffect(()=>{if(!t){c(1);return}const x=Date.now(),y=()=>{const k=Date.now()-x,w=Math.min(k/n,1);c(w),w<1&&(u.current=requestAnimationFrame(y))};return u.current=requestAnimationFrame(y),()=>{u.current&&cancelAnimationFrame(u.current)}},[t,n]);const f=g.useCallback(()=>e?{...e,series:e.series.map((x,y)=>({...x,color:x.color||qe[y%qe.length]}))}:o?o.map((x,y)=>({...x,color:x.color||qe[y%qe.length]})):null,[e,o]),m=g.useCallback((x,y,k)=>{l&&s({visible:!0,x,y,content:k})},[l]),p=g.useCallback(()=>{s(x=>({...x,visible:!1}))},[]),b=g.useCallback(()=>{if(!h.current)return{width:0,height:0};const{width:x,height:y}=h.current.getBoundingClientRect();return{width:x,height:y}},[]);return{animationProgress:a,tooltip:d,containerRef:h,processedData:f,showTooltip:m,hideTooltip:p,getChartDimensions:b}},zi=({data:e,width:o,height:t,animationProgress:n,showGrid:l=!0,onBarClick:a,showTooltip:c,hideTooltip:d,views:s})=>{const{getColor:u}=i.useTheme(),h={top:20,right:20,bottom:40,left:50},f=o-h.left-h.right,m=t-h.top-h.bottom,p=g.useMemo(()=>{let I=0;return e.series.forEach(j=>{j.data.forEach(z=>{I=Math.max(I,z)})}),I},[e]),b=e.labels.length,x=e.series.length,y=f/b,k=y*.8/x,w=y*.2/(x+1),T=p||10,C=g.useMemo(()=>{const j=[];for(let z=0;z<=5;z++){const V=T/5*z;j.push(V)}return j},[p]);return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:h.left,y1:t-h.bottom,x2:o-h.right,y2:t-h.bottom,...Lo,...s==null?void 0:s.axis}),r.jsx("line",{x1:h.left,y1:h.top,x2:h.left,y2:t-h.bottom,...Lo,...s==null?void 0:s.axis}),e.labels.map((I,j)=>{const z=h.left+(j+.5)*y,V=t-h.bottom+20;return r.jsx("text",{x:z,y:V,textAnchor:"middle",...Ao,...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:I},`x-label-${j}`)}),C.map((I,j)=>{const z=t-h.bottom-I/T*m;return r.jsxs(g.Fragment,{children:[r.jsx("text",{x:h.left-10,y:z,textAnchor:"end",dominantBaseline:"middle",...Ao,...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:I.toFixed(0)}),l&&r.jsx("line",{x1:h.left,y1:z,x2:o-h.right,y2:z,...Cr,...s==null?void 0:s.grid})]},`y-tick-${j}`)}),e.series.map((I,j)=>r.jsx(g.Fragment,{children:I.data.map((z,V)=>{const W=z/T*m*n,H=h.left+V*y+w*(j+1)+k*j,S=t-h.bottom-W,B=e.labels[V],A=e.series.reduce((L,D)=>{const F=D.data[V];return L+(typeof F=="number"?F:0)},0),E=A>0?(z/A*100).toFixed(1):null,P=I.color?u(I.color):"black",$=L=>{const D=r.jsxs(i.View,{display:"flex",flexDirection:"column",minWidth:"180px",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(i.Text,{fontWeight:"semibold",children:I.name}),r.jsx(i.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:P})]}),r.jsx(i.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:B}),r.jsxs(i.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Value"}),r.jsx(i.Text,{fontWeight:"medium",children:z.toLocaleString()})]}),E!==null&&r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Share"}),r.jsx(i.Text,{fontWeight:"medium",children:`${E}%`})]}),r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(i.Text,{fontWeight:"medium",children:A.toLocaleString()})]})]})]});c(L.clientX,L.clientY,D)},_=()=>{a&&a(I.name,V)};return r.jsx("rect",{x:H,y:S,width:k,height:W,fill:P,onMouseEnter:$,onMouseLeave:d,onClick:_,...Ci,...s==null?void 0:s.bar},`bar-${j}-${V}`)})},`series-${j}`))]})},Vi=({data:e,width:o,height:t,animationProgress:n,showGrid:l=!0,onPointClick:a,showTooltip:c,hideTooltip:d,views:s})=>{const{getColor:u}=i.useTheme(),h={top:20,right:20,bottom:40,left:50},f=o-h.left-h.right,m=t-h.top-h.bottom,p=g.useMemo(()=>{let w=0;return e.series.forEach(T=>{T.data.forEach(C=>{w=Math.max(w,C)})}),w},[e]),b=p||10,x=g.useMemo(()=>{const T=[];for(let C=0;C<=5;C++){const I=b/5*C;T.push(I)}return T},[p]),y=w=>`M ${w.map((C,I)=>{const j=h.left+I/(e.labels.length-1)*f,z=t-h.bottom-C/b*m*n;return`${j},${z}`}).join(" L ")}`,k=w=>{const T=h.left,C=h.left+f,I=t-h.bottom,j=w.map((z,V)=>{const W=h.left+V/(e.labels.length-1)*f,H=t-h.bottom-z/b*m*n;return`${W},${H}`});return`M ${T},${I} L ${j.join(" L ")} L ${C},${I} Z`};return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:h.left,y1:t-h.bottom,x2:o-h.right,y2:t-h.bottom,...Lo,...s==null?void 0:s.axis}),r.jsx("line",{x1:h.left,y1:h.top,x2:h.left,y2:t-h.bottom,...Lo,...s==null?void 0:s.axis}),e.labels.map((w,T)=>{const C=h.left+T/(e.labels.length-1)*f,I=t-h.bottom+20;return r.jsx("text",{x:C,y:I,textAnchor:"middle",...Ao,...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:w},`x-label-${T}`)}),x.map((w,T)=>{const C=t-h.bottom-w/b*m;return r.jsxs(g.Fragment,{children:[r.jsx("text",{x:h.left-10,y:C,textAnchor:"end",dominantBaseline:"middle",...Ao,...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:w.toFixed(0)}),l&&r.jsx("line",{x1:h.left,y1:C,x2:o-h.right,y2:C,...Cr,...s==null?void 0:s.grid})]},`y-tick-${T}`)}),e.series.map((w,T)=>{const C=w.color?u(w.color):"black";return r.jsxs(g.Fragment,{children:[r.jsx("path",{d:k(w.data),fill:C,opacity:.1,...s==null?void 0:s.area}),r.jsx("path",{d:y(w.data),stroke:C,...wi,...s==null?void 0:s.line}),w.data.map((I,j)=>{const z=h.left+j/(e.labels.length-1)*f,V=t-h.bottom-I/b*m*n,W=e.labels[j],H=e.series.reduce((_,L)=>{const D=L.data[j];return _+(typeof D=="number"?D:0)},0),S=H>0?(I/H*100).toFixed(1):null,B=j>0&&typeof w.data[j-1]=="number"?w.data[j-1]:null,A=typeof B=="number"?I-B:null,E=typeof A=="number"?`${A>=0?"+":""}${A.toLocaleString()}`:null,P=_=>{const L=r.jsxs(i.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(i.Text,{fontWeight:"semibold",children:w.name}),r.jsx(i.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:C})]}),r.jsx(i.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:W}),r.jsxs(i.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Value"}),r.jsx(i.Text,{fontWeight:"medium",children:I.toLocaleString()})]}),E!==null&&r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Change"}),r.jsx(i.Text,{fontWeight:"medium",children:E})]}),S!==null&&r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Share"}),r.jsx(i.Text,{fontWeight:"medium",children:`${S}%`})]}),r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(i.Text,{fontWeight:"medium",children:H.toLocaleString()})]})]})]});c(_.clientX,_.clientY,L)},$=()=>{a&&a(w.name,j)};return r.jsx("circle",{cx:z,cy:V,fill:C,onMouseEnter:P,onMouseLeave:d,onClick:$,...Ii,...s==null?void 0:s.point},`point-${T}-${j}`)})]},`series-${T}`)})]})},Ei=({dataPoints:e,width:o,height:t,animationProgress:n,isDonut:l=!1,onSliceClick:a,showTooltip:c,hideTooltip:d,views:s})=>{const{getColor:u}=i.useTheme(),{ref:h,relation:f}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),m=g.useRef(null);g.useEffect(()=>{m.current&&h&&(h.current=m.current)},[m,h]);const b=Math.min(o,t)/2*.8,x=o/2,y=t/2,k=l?b*.6:0,w=g.useMemo(()=>e.reduce((C,I)=>C+I.value,0),[e]),T=g.useMemo(()=>{if(w===0)return[{path:l?[`M ${x} ${y-b}`,`A ${b} ${b} 0 1 1 ${x} ${y+b}`,`A ${b} ${b} 0 1 1 ${x} ${y-b}`,`M ${x} ${y-k}`,`A ${k} ${k} 0 1 0 ${x} ${y+k}`,`A ${k} ${k} 0 1 0 ${x} ${y-k}`,"Z"].join(" "):[`M ${x} ${y}`,`M ${x} ${y-b}`,`A ${b} ${b} 0 1 1 ${x} ${y+b}`,`A ${b} ${b} 0 1 1 ${x} ${y-b}`,"Z"].join(" "),color:"#E2E8F0",label:"Total",value:0,percentage:"0%",labelX:x,labelY:y,startAngle:0,endAngle:Math.PI*2,index:-1}];const C=[];let I=-Math.PI/2;for(let j=0;j<e.length;j++){const V=e[j].value/w,W=V*2*Math.PI*n,H=I+W,S=x+Math.cos(I)*b,B=y+Math.sin(I)*b,A=x+Math.cos(H)*b,E=y+Math.sin(H)*b,P=x+Math.cos(I)*k,$=y+Math.sin(I)*k,_=x+Math.cos(H)*k,L=y+Math.sin(H)*k,D=W>Math.PI?1:0;let F;l?F=[`M ${S} ${B}`,`A ${b} ${b} 0 ${D} 1 ${A} ${E}`,`L ${_} ${L}`,`A ${k} ${k} 0 ${D} 0 ${P} ${$}`,"Z"].join(" "):F=[`M ${x} ${y}`,`L ${S} ${B}`,`A ${b} ${b} 0 ${D} 1 ${A} ${E}`,"Z"].join(" ");const q=I+W/2,O=b*.7,N=x+Math.cos(q)*O,Z=y+Math.sin(q)*O,X=`${(V*100).toFixed(1)}%`,G=e[j].color||qe[j%qe.length],Q=u(G);C.push({path:F,color:Q,label:e[j].label,value:e[j].value,percentage:X,labelX:N,labelY:Z,startAngle:I,endAngle:H,index:j}),I=H}return C},[e,w,b,x,y,k,n,l]);return r.jsxs("svg",{ref:m,width:o,height:t,style:{overflow:"visible"},children:[l&&r.jsx("circle",{cx:x,cy:y,r:k,fill:"white",pointerEvents:"none"}),T.map((C,I)=>{const j=W=>{const H=w>0?C.value/w*100:0,S=w>0?Math.max(0,100-H):null,B=r.jsxs(i.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(i.Text,{fontWeight:"semibold",children:C.label}),r.jsx(i.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:C.color})]}),r.jsxs(i.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:["Slice ",C.index+1," of ",e.length]}),r.jsxs(i.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Value"}),r.jsx(i.Text,{fontWeight:"medium",children:C.value.toLocaleString()})]}),r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Share"}),r.jsx(i.Text,{fontWeight:"medium",children:C.percentage})]}),r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Total"}),r.jsx(i.Text,{fontWeight:"medium",children:w.toLocaleString()})]}),S!==null&&r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Remaining"}),r.jsx(i.Text,{fontWeight:"medium",children:`${S.toFixed(1)}%`})]})]})]});let A=W.clientX,E=W.clientY;if(f&&m.current){const P=m.current.getBoundingClientRect();W.clientX-P.left,W.clientY-P.top,f.space.horizontal==="left"?A=W.clientX-100:A=W.clientX+10,f.space.vertical==="top"?E=W.clientY-30:E=W.clientY+10}c(A,E,B)},z=()=>{C.index!==-1&&a&&a(e[C.index],C.index)},V=C.index===-1;return r.jsxs("g",{children:[r.jsx("path",{d:C.path,fill:C.color,onMouseEnter:V?void 0:j,onMouseLeave:V?void 0:d,onClick:z,...Do,style:{...Do==null?void 0:Do.style,cursor:V?"default":"pointer"},...s==null?void 0:s.pie}),!V&&C.endAngle-C.startAngle>.2&&r.jsx("text",{x:C.labelX,y:C.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:C.percentage})]},`slice-${I}`)})]})},Pi=({visible:e,x:o,y:t,content:n,maxDistance:l=100,views:a})=>{const c=g.useRef(null),[d,s]=g.useState({left:0,top:0});return g.useEffect(()=>{if(!e||!c.current)return;const h=c.current.getBoundingClientRect(),f=h.width,m=h.height,p=10,b=15;let x=o-b,y=t-b;const k=o-x,w=t-y;k>l&&(x=o-l),w>l&&(y=t-l),x+f>window.innerWidth-p&&(x=window.innerWidth-f-p,o-x>l&&(x=o-l)),x<p&&(x=p),y+m>window.innerHeight-p&&(y=window.innerHeight-m-p,t-y>l&&(y=t-l)),y<p&&(y=p),s({left:x,top:y})},[e,o,t,l]),e?r.jsx(i.View,{ref:c,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},Wi=({type:e,data:o,dataPoints:t,title:n,showLegend:l=!0,legendPosition:a="bottom",showGrid:c=!0,showTooltips:d=!0,animated:s=!0,animationDuration:u=500,responsive:h=!0,aspectRatio:f=16/9,width:m=200,height:p=200,views:b,onDataPointClick:x,onSeriesClick:y,isLoading:k=!1,error:w,noData:T,loadingIndicator:C,errorIndicator:I,noDataIndicator:j,"aria-label":z,themeMode:V,...W})=>{const{animationProgress:H,tooltip:S,containerRef:B,processedData:A,showTooltip:E,hideTooltip:P,getChartDimensions:$}=Mi({data:o,dataPoints:t,animated:s,animationDuration:u,showTooltips:d}),_=A(),{width:L,height:D}=$(),F=m||L,q=p||(h?L/f:D),O=()=>{if(!l||!_)return null;let ee=[];return e==="pie"||e==="donut"?Array.isArray(_)&&(ee=_):_&&_.series&&(ee=_.series),!ee||ee.length===0?null:r.jsx(i.Horizontal,{flexWrap:"wrap",justifyContent:"center",marginTop:a==="bottom"?"16px":0,marginBottom:a==="top"?"16px":0,...bi,...b==null?void 0:b.legend,children:ee.map((re,ne)=>r.jsxs(i.View,{...yi,...b==null?void 0:b.legendItem,children:[r.jsx(i.View,{backgroundColor:re.color,...xi}),r.jsx(i.Text,{...ki,children:re.name||re.label})]},`legend-${ne}`))})},N=()=>{if(!_)return null;switch(e){case"bar":return r.jsx(zi,{data:_,width:F,height:q,animationProgress:H,showGrid:c,onBarClick:y,showTooltip:E,hideTooltip:P,views:b});case"line":case"area":return r.jsx(Vi,{data:_,width:F,height:q,animationProgress:H,showGrid:c,onPointClick:y,showTooltip:E,hideTooltip:P,views:b});case"pie":case"donut":return r.jsx(Ei,{dataPoints:_,width:F,height:q,animationProgress:H,isDonut:e==="donut",onSliceClick:x,showTooltip:E,hideTooltip:P,views:b});default:return null}},Z=()=>k?r.jsx(i.View,{...Ti,...b==null?void 0:b.loadingOverlay,children:C||r.jsx(i.Center,{children:r.jsx(no,{size:"lg"})})}):null,X=()=>w?r.jsx(i.View,{...ji,...b==null?void 0:b.errorOverlay,children:I||r.jsx(i.Text,{fontWeight:"medium",children:typeof w=="string"?w:"An error occurred"})}):null,G=()=>T?r.jsx(i.View,{...Si,...b==null?void 0:b.noDataOverlay,children:j||r.jsx(i.Text,{children:typeof T=="string"?T:"No data available"})}):null,Q=z??(typeof n=="string"?n:"Chart"),R=!w&&!k&&!T;return r.jsxs(i.View,{ref:B,role:"region","aria-label":Q,"aria-busy":k,...mi,...b==null?void 0:b.container,...W,children:[n&&r.jsx(i.Text,{...pi,children:n}),R&&a==="top"&&O(),r.jsxs(i.View,{flex:1,width:"100%",position:"relative",...b==null?void 0:b.chart,children:[R&&N(),Z(),X(),G()]}),R&&a==="bottom"&&O(),r.jsx(Pi,{visible:d&&S.visible,x:S.x,y:S.y,content:S.content,maxDistance:100,views:b})]})},_i=e=>r.jsx(Wi,{...e}),$i=(e=365)=>{const[o,t]=g.useState(!1),[n,l]=g.useState(null),a="app-studio-cookie-consent";g.useEffect(()=>{const u=localStorage.getItem(a);l(u!==null?u==="true":!1)},[]);const c=u=>{localStorage.setItem(a,String(u));const h=new Date;h.setDate(h.getDate()+e),localStorage.setItem(`${a}-expires`,h.toISOString()),l(u)};return{isHovered:o,setIsHovered:t,hasConsent:n,acceptCookies:()=>{c(!0)},resetConsent:()=>{localStorage.removeItem(a),localStorage.removeItem(`${a}-expires`),l(!1)}}},Hi=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"}}}},Bi=({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:l="bottom",variant:a="default",onAccept:c,onCustomize:d,views:s,showCustomizeButton:u=!0,cookieExpiration:h=365,themeMode:f,...m})=>{const{themeMode:p}=i.useTheme(),b=f||p||"light",{hasConsent:x,acceptCookies:y}=$i(h),w=Hi(b)[a];if(x)return null;const T=()=>{y(),c&&c()},C=()=>{d&&d()};return r.jsx(i.View,{position:"fixed",left:16,right:16,zIndex:1e3,padding:16,borderWidth:"1px",borderStyle:"solid",borderRadius:8,maxWidth:"800px",marginX:"auto",...l==="bottom"?{bottom:16}:{top:16},...w.container,...s==null?void 0:s.container,...m,children:r.jsxs(i.Vertical,{gap:12,maxWidth:1200,marginX:"auto",children:[e&&r.jsx(i.Text,{fontWeight:"bold",fontSize:18,color:"color-black",...s==null?void 0:s.title,children:e}),o&&r.jsx(i.Text,{fontSize:14,color:"color-black",...s==null?void 0:s.description,children:o}),r.jsxs(i.Horizontal,{gap:12,justifyContent:"flex-end",marginTop:8,...s==null?void 0:s.buttonGroup,children:[u&&r.jsx(_e,{variant:"outline",onClick:C,size:"sm",...s==null?void 0:s.customizeButton,children:n}),r.jsx(_e,{variant:"primary",onClick:T,size:"sm",...s==null?void 0:s.acceptButton,children:t})]})]})})},Li=e=>r.jsx(Bi,{...e}),Ai=e=>{const{size:o,variant:t,onOpenChange:n}=e||{},[l,a]=g.useState(!1),[c,d]=g.useState({x:0,y:0}),[s,u]=g.useState(null),h=g.useRef(null),f=g.useRef(null),m=g.useMemo(()=>rt("contextmenu-content"),[]),p=g.useCallback(x=>{d({x:x.clientX,y:x.clientY}),a(!0),n==null||n(!0)},[n]),b=g.useCallback(()=>{a(!1),u(null),n==null||n(!1)},[n]);return g.useEffect(()=>{const x=w=>{f.current&&!f.current.contains(w.target)&&b()},y=()=>{l&&b()},k=w=>{w.key==="Escape"&&l&&b()};return document.addEventListener("mousedown",x),window.addEventListener("resize",y),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",x),window.removeEventListener("resize",y),document.removeEventListener("keydown",k)}},[l,b]),{isOpen:l,setIsOpen:a,position:c,setPosition:d,activeSubmenuId:s,setActiveSubmenuId:u,size:o,variant:t,triggerRef:h,contentRef:f,contentId:m,openMenu:p,closeMenu:b}},wr={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Di={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"}},Ir={hover:{backgroundColor:"color-gray-100"}},Tr=g.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:()=>{}}),Fi=({children:e,value:o})=>r.jsx(Tr.Provider,{value:o,children:e}),Fo=()=>{const e=g.useContext(Tr);if(!e)throw new Error("useContextMenuContext must be used within a ContextMenuProvider");return e},jr=({children:e,disableNativeContextMenu:o=!0,asChild:t=!1,isDisabled:n=!1,views:l,...a})=>{const{triggerRef:c,contentId:d,openMenu:s}=Fo(),h={ref:c,onContextMenu:f=>{if(!n)if(o&&f.preventDefault(),s)s(f);else{const{setIsOpen:m,setPosition:p}=Fo();p({x:f.clientX,y:f.clientY}),m(!0)}},"aria-controls":d,"aria-haspopup":"menu","data-disabled":n?"":void 0,...t&&g.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:n},...l==null?void 0:l.container,...a};if(t&&g.isValidElement(e)){const f=g.Children.only(e);return g.cloneElement(f,{...h,...f.props})}return r.jsx(i.View,{...h,children:e})},Tt=({items:e,children:o,position:t,side:n="right",align:l="start",views:a,style:c,...d})=>{const{isOpen:s,position:u,contentRef:h,contentId:f,variant:m}=Fo(),p=g.useRef(null),b=h||p,{ref:x,relation:y}=i.useElementPosition({}),[k,w]=g.useState({x:0,y:0});if(g.useEffect(()=>{if(s&&b.current){const C=t||u,I=b.current.offsetWidth,j=b.current.offsetHeight,z=window.innerWidth,V=window.innerHeight;let W=C.x,H=C.y;y&&(y.space.horizontal==="left"?W=C.x-I:W=C.x,y.space.vertical==="top"?H=C.y-j:H=C.y),W+I>z&&(W=z-I-8),W<8&&(W=8),H+j>V&&(H=V-j-8),H<8&&(H=8),w({x:W,y:H})}},[s,u,t,n,l,b,y]),!s)return null;const T={position:"fixed",top:`${k.y}px`,left:`${k.x}px`,zIndex:1e3,transformOrigin:"top left"};return r.jsxs(i.View,{id:f||"context-menu",ref:b,role:"menu",tabIndex:-1,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:{...T,...c},...Di[m],...a==null?void 0:a.menu,...a==null?void 0:a.content,...d,children:[e&&e.map((C,I)=>C.divider?r.jsx(Mr,{views:a},`divider-${I}`):r.jsx(Sr,{item:C,views:a},C.id)),o]})},Sr=({item:e,children:o,onSelect:t,isDisabled:n=!1,views:l,...a})=>{const{activeSubmenuId:c,setActiveSubmenuId:d,size:s,closeMenu:u}=Fo();if(e){const[f,m]=g.useState(!1),p=e.items&&e.items.length>0,b=c===e.id,[x,y]=g.useState({x:0,y:0}),k=e.disabled||n,w=()=>{m(!0),p&&d(e.id)},T=()=>{m(!1)},C=()=>{k||!p&&e.onClick&&(e.onClick(),u&&u())},{ref:I,relation:j}=i.useElementPosition({});return g.useEffect(()=>{if(b&&I.current){const z=I.current.getBoundingClientRect(),V=window.innerWidth,W=200;let H=!1;if(j)H=j.space.horizontal==="left";else{const S=V-z.right,B=z.left;H=S<W&&B>S}y({x:H?z.left-W:z.right,y:z.top})}},[b,e.items,j]),r.jsxs(i.View,{ref:I,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,...wr[s],_hover:k?{}:Ir.hover,backgroundColor:f&&!k?"color-gray-100":"transparent",onMouseEnter:w,onMouseLeave:T,onClick:C,...l==null?void 0:l.item,...a,children:[e.icon&&r.jsx(i.View,{marginRight:8,...l==null?void 0:l.icon,children:e.icon}),r.jsx(i.View,{flexGrow:1,children:e.label}),p&&r.jsx(i.View,{marginLeft:8,...l==null?void 0:l.submenuIndicator,children:r.jsx(le,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),b&&p&&r.jsx(Tt,{items:e.items||[],position:x,side:"right",align:"start",views:l})]})}const h=f=>{n||(t==null||t(f),u&&u())};return r.jsx(i.View,{role:"menuitem",onClick:h,cursor:n?"not-allowed":"pointer",opacity:n?.5:1,"aria-disabled":n,"data-disabled":n?"":void 0,...wr[s],_hover:n?{}:Ir.hover,...l==null?void 0:l.item,...a,children:o})},Mr=({views:e,...o})=>r.jsx(i.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.divider,...o}),Oi=({views:e,...o})=>r.jsx(i.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.separator,...o}),qi=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:l=!0,views:a,themeMode:c,...d})=>!o||o.length===0?r.jsx(r.Fragment,{children:e}):r.jsxs(r.Fragment,{children:[r.jsx(jr,{disableNativeContextMenu:l,views:a,...d,children:e}),r.jsx(Tt,{items:o,views:a})]}),Ne=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:l=!0,onOpenChange:a,views:c,...d})=>{const s=Ai({size:t,variant:n,onOpenChange:a}),{isOpen:u,setIsOpen:h,position:f,setPosition:m,activeSubmenuId:p,setActiveSubmenuId:b,triggerRef:x,contentRef:y,contentId:k,openMenu:w,closeMenu:T}=s;return r.jsx(Fi,{value:{isOpen:u,setIsOpen:h,position:f,setPosition:m,activeSubmenuId:p,setActiveSubmenuId:b,size:t,variant:n,triggerRef:x,contentRef:y,contentId:k,openMenu:w,closeMenu:T,styles:c},children:r.jsx(qi,{items:o,size:t,variant:n,disableNativeContextMenu:l,views:c,...d,children:e})})};Ne.Trigger=jr,Ne.Content=Tt,Ne.Item=Sr,Ne.Divider=Mr,Ne.Separator=Oi;const Ni=({src:e,color:o,views:t,themeMode:n,...l})=>{const{getColor:a,themeMode:c}=i.useTheme(),d=o?{fill:a(o,{themeMode:c}),stroke:a(o,{themeMode:c})}:{};return r.jsx(i.Center,{...l,...t==null?void 0:t.container,children:r.jsx(i.Image,{...d,content:'url("'+e+'")',width:"100%",height:"100%",...t==null?void 0:t.image})})},Ui=({path:e,...o})=>r.jsx(i.Image,{src:e,...o}),zr=({placeholder:e,isMulti:o,options:t,id:n=`select-${Math.random().toString(36).substr(2,9)}`})=>{const l=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,c]=g.useState(!1),[d,s]=g.useState(!1),[u,h]=g.useState(l),[f,m]=g.useState(0),[p,b]=g.useState(!0);return{id:n,value:u,setValue:h,hide:p,setHide:b,isHovered:a,setIsHovered:c,isFocused:d,setIsFocused:s,highlightedIndex:f,setHighlightedIndex:m}},Vr=({children:e,containerId:o="portal-root"})=>{const[t,n]=g.useState(null);return g.useEffect(()=>{let l=document.getElementById(o),a=!1;return l||(a=!0,l=document.createElement("div"),l.setAttribute("id",o),document.body.appendChild(l)),n(l),()=>{a&&l&&l.parentNode&&l.childNodes.length===0&&l.parentNode.removeChild(l)}},[o]),t?Qa.createPortal(e,t):null},jt=({children:e,views:o={helperText:{}},...t})=>r.jsx(i.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}),Te=g.forwardRef(({children:e,helperText:o,error:t=!1,views:n,...l},a)=>r.jsxs(i.Vertical,{ref:a,gap:8,position:"relative",width:"100%",marginVertical:4,...l,...n==null?void 0:n.container,children:[e,!t&&o&&r.jsx(jt,{marginTop:4,...n==null?void 0:n.helperText,children:o}),t&&r.jsx(i.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})]}));Te.displayName="FieldContainer";const Er={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},Pr={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},Wr={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"}}},Gi={paddingTop:"16px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"12px",paddingBottom:"6px",paddingLeft:"12px",paddingRight:"12px"}}},Yi={paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"12px",paddingRight:"12px"}}},Me=({label:e,shadow:o,children:t,value:n,size:l="md",shape:a="default",variant:c="default",error:d=!1,showLabel:s=!1,isFocused:u=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:m=!1,views:p={pickerBox:{}},...b})=>{const y=d?"color-red-500":(h||u)&&!f?"theme-primary":"color-gray-300";return r.jsx(i.Horizontal,{gap:8,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",marginBottom:2,borderStyle:"solid",borderColor:y,backgroundColor:"color-white",fontSize:i.Typography.fontSizes[l],cursor:f?"not-allowed":m?"auto":"text",opacity:f?.7:1,transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out, opacity 200ms ease-out",...s?Gi:Yi,...o,...Er[a],...Wr[c],...p==null?void 0:p.container,...b,children:t})},St=({children:e,...o})=>r.jsx(i.Center,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",...o,children:e}),vi={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}},Xi=({children:e,heading:o,isItalic:t=!1,isUnderlined:n=!1,isStriked:l=!1,weight:a="normal",size:c="sm",dropDown:d,...s})=>{const u=o?vi[o]:{};return r.jsx(i.Element,{as:"label",width:"100%",fontSize:c,fontStyle:t?"italic":"normal",fontWeight:i.Typography.fontWeights[a],textDecoration:l?"line-through":n?"underline":"none",...u,...s,children:e})},so=e=>r.jsx(Xi,{...e}),$e=({children:e,size:o="md",error:t=!1,color:n="theme-primary",views:l={label:{}},helperText:a,...c})=>r.jsx(so,{top:0,zIndex:-10,position:"absolute",fontSize:Pr[o],lineHeight:Pr[o],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:t?"color-red-500":n,transition:"color 200ms ease-out",...l.label,...c,children:e}),Ue=({children:e,...o})=>r.jsx(i.Vertical,{width:"100%",maxWidth:"100%",position:"relative",...o,children:e}),_r={xs:12,sm:14,md:16,lg:20,xl:24},Ki={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)"},Qi={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)"}},Zi={padding:"10px 12px",cursor:"pointer",borderRadius:"6px",margin:"2px 4px",transition:"background-color 0.15s ease"},Oo={default:{backgroundColor:"transparent"},highlighted:{backgroundColor:"color-gray-100"},selected:{backgroundColor:"color-gray-100"},selectedHighlighted:{backgroundColor:"color-gray-200"}},$r={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)"}},Ji={padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},Ri={scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.15) transparent"},es=({isHovered:e,setIsHovered:o,option:t,size:n="md",callback:l=()=>{},style:a,isSelected:c=!1,...d})=>{const s=(f,m)=>{f.stopPropagation(),f.preventDefault(),typeof l=="function"&&l(m)},u=()=>o(!e),h=()=>c&&e?Oo.selectedHighlighted:c?Oo.selected:e?Oo.highlighted:Oo.default;return r.jsxs(i.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...Zi,...h(),onMouseEnter:u,onMouseLeave:u,onClick:f=>s(f,t.value),...d,children:[r.jsx(i.Text,{fontSize:i.Typography.fontSizes[n],fontWeight:c?"500":"400",lineHeight:"1.4",color:c?"color-gray-900":"color-gray-700",...a,children:t.label}),c&&r.jsx(i.Element,{as:"span",color:"theme-primary",fontSize:"14px",marginLeft:8,display:"flex",alignItems:"center",children:"✓"})]})},os=({size:e="md",views:o={field:{},text:{}},value:t,isDisabled:n,placeholder:l,removeOption:a=()=>{},options:c})=>{const d={margin:0,width:"95%",height:"100%",border:"none",paddingVertical:4,paddingHorizontal:0,fontSize:i.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=c.length>0&&c.find(u=>u.value===t);return r.jsx(i.Text,{...d,children:(t===""||Array.isArray(t)&&t.length===0)&&l?l:r.jsx(r.Fragment,{children:typeof t=="string"?(s&&s.label)??t:Array.isArray(t)&&t.length>0?r.jsx(i.Horizontal,{gap:6,children:t.map(u=>r.jsx(ns,{option:u,removeOption:a},u))}):r.jsx("span",{children:t})})})},ts=({id:e,name:o,value:t,onChange:n,isMulti:l=!1,isDisabled:a=!1,isReadOnly:c=!1,options:d=[],...s})=>{const u=h=>{n&&n(h)};return r.jsx(i.Element,{id:e,name:o,as:"select",opacity:0,width:0,height:0,position:"absolute",value:t,disabled:a,readOnly:c,onChange:u,multiple:l,...s,children:d.length>0&&d.map(h=>r.jsx("option",{value:h.value,children:h.label},h.value))})},rs=({size:e,views:o={},options:t,callback:n=()=>{},highlightedIndex:l,setHighlightedIndex:a,selectedValue:c})=>{const d=u=>n(u),s=u=>Array.isArray(c)?c.includes(u):c===u;return r.jsx(i.Element,{as:"ul",role:"listbox",display:"flex",flexDirection:"column",margin:0,padding:"4px",...Ki,style:Ri,...o==null?void 0:o.dropDown,children:t&&t.length>0&&t.map((u,h)=>r.jsx(es,{size:e,style:o.text,option:u,callback:d,isSelected:s(u.value),isHovered:h===l,setIsHovered:()=>{},onMouseEnter:()=>a(h)},u.value))})},ns=({option:e,size:o="md",removeOption:t=()=>{},...n})=>{const l=()=>t(e);return r.jsxs(i.Horizontal,{gap:6,alignItems:"center",onClick:a=>a.stopPropagation(),...Ji,_hover:{backgroundColor:"color-gray-200"},...n,children:[r.jsx(i.Text,{fontSize:i.Typography.fontSizes[o],fontWeight:"500",color:"color-gray-700",children:e}),r.jsx(pe,{role:"close-button",color:"color-gray-500",widthHeight:_r[o],onClick:l,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},Hr=({id:e,name:o,label:t,value:n,placeholder:l,helperText:a,hide:c=!1,error:d=!1,isMulti:s=!1,isFocused:u=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:m=!1,options:p=[],shadow:b={},size:x="md",shape:y="default",variant:k="default",views:w={text:{},icon:{},dropDown:{},selectBox:{},label:{},helperText:{}},onChange:T=()=>{},setHide:C=()=>{},setValue:I=()=>{},setIsHovered:j=()=>{},setIsFocused:z=()=>{},setHighlightedIndex:V,highlightedIndex:W,...H})=>{const{ref:S,relation:B,updateRelation:A}=i.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),E=g.useRef(null),P=()=>{var X;if(!S.current)return{};const O=S.current.getBoundingClientRect(),N={position:"fixed",left:O.left,width:O.width,zIndex:1e4};return((X=B==null?void 0:B.space)==null?void 0:X.vertical)==="top"?{...N,bottom:window.innerHeight-O.top+8}:{...N,top:O.bottom+8}};g.useEffect(()=>{const O=()=>C(!0);return document.addEventListener("closeAllSelects",O),()=>document.removeEventListener("closeAllSelects",O)},[C]),g.useEffect(()=>{const O=N=>{!N.target.closest(`#${e}`)&&!c&&C(!0)};return document.addEventListener("click",O),()=>{document.removeEventListener("click",O)}},[e,c,C]);const $=!!(u&&t),_=()=>j(!h),L=()=>z(!0),D=O=>{document.dispatchEvent(new Event("closeAllSelects")),O&&O.stopPropagation&&O.stopPropagation();const N=!c;C(N),z(!N)},F=g.useCallback(O=>{if(C(!0),document.dispatchEvent(new Event("closeAllSelects")),s&&Array.isArray(n)){if(!n.includes(O)){const N=[...n,O];I(N),T&&T(O)}}else I(O),T&&T(O);z(!0)},[s,n,C,I,T,z]),q=O=>{if(Array.isArray(n)&&n.includes(O)){const N=n.filter(Z=>Z!==O);I(N.length===0?[]:N)}};return r.jsx(Te,{ref:S,position:"relative",width:"100%",display:"inline-block",id:e,role:"SelectBox",helperText:a,error:d,views:w,onClick:O=>{O.stopPropagation(),f||m||D(O)},children:r.jsxs(Me,{label:t,size:x,error:d,shape:y,views:w,shadow:b,variant:k,value:n,color:"theme-primary",isHovered:h,isDisabled:f,isReadOnly:m,isFocused:u,showLabel:$,onMouseEnter:_,onMouseLeave:_,position:"relative",children:[r.jsxs(Ue,{children:[$&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:d,...w,children:t}),r.jsx(ts,{id:e,name:o,options:p,onChange:T,value:n,isDisabled:f,isReadOnly:m,isMulti:s,onFocus:L,...H}),r.jsx(os,{options:p,size:x,views:w,value:n,isDisabled:f,placeholder:l,removeOption:q})]}),r.jsx(St,{children:!m&&!f&&r.jsx(i.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:c?$r.closed:$r.open,children:r.jsx(le,{color:"inherit",widthHeight:_r[x],style:w.icon,orientation:"down"})})}),!c&&p.length>0&&r.jsx(Vr,{children:r.jsx(i.Element,{ref:E,onClick:O=>O.stopPropagation(),style:{...P(),...Qi.enter},children:r.jsx(rs,{size:x,views:w,options:p,callback:F,highlightedIndex:W,setHighlightedIndex:V,selectedValue:n})})})]})})},as=e=>{const o={...e,options:e.options||[]},t=zr(o);return r.jsx(Hr,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},Br=({isDisabled:e,isChecked:o})=>{const[t,n]=g.useState(!1),[l,a]=g.useState(o||!1),[c,d]=g.useState(o||!1);return g.useEffect(()=>{o!==void 0&&(a(o),d(o))},[o]),{isHovered:t,setIsHovered:n,on:l,setOn:a,value:c,setValue:d}},ls={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"}},is={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}},He={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}}},Lr={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)"}},ss=e=>r.jsx(i.Input,{type:"checkbox",...e}),Ar=({id:e,name:o,label:t,inActiveChild:n,isChecked:l,activeChild:a,labelPosition:c="right",shadow:d={},size:s="sm",value:u=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:m=!1,on:p,setOn:b,onChange:x,setValue:y=()=>{},setIsHovered:k=()=>{},helperText:w,views:T={slider:{},circle:{},label:{}},...C})=>{const I=W=>{if(!m&&!f){const H=W.target.checked;y(H),b(H),x&&x(H)}},j=()=>k(!0),z=()=>k(!1),V={container:{gap:12,display:"flex",height:"fit-content",width:"fit-content",alignItems:"center",cursor:f?"not-allowed":m?"default":"pointer",opacity:f?.6:1,transition:"all 0.2s ease",...T.label}};return r.jsxs(so,{htmlFor:e,onMouseEnter:j,onMouseLeave:z,...V.container,...C,children:[r.jsx(ss,{id:e,name:o,opacity:0,width:0,height:0,checked:u,onChange:I,disabled:f,readOnly:m,...C}),c==="left"&&t&&r.jsx(i.Text,{fontWeight:"500",color:f?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t}),r.jsxs(i.View,{display:"flex",alignItems:"center",justifyContent:u?a?"space-between":"flex-end":n?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:f?He.default.disabled:u?h?He.states.hover.active:He.default.active:h?He.states.hover.inactive:He.default.inactive,opacity:!f&&u&&h?He.states.hover.activeOpacity:1,cursor:"pointer",...Lr.slider,...d,...is[s],...cs[s],...T.slider,children:[a&&u&&r.jsx(i.View,{marginLeft:8,marginRight:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:a}),r.jsx(i.View,{borderRadius:"50%",backgroundColor:He.default.knob,boxShadow:h?"0 2px 4px rgba(0, 0, 0, 0.2)":"0 1px 2px rgba(0, 0, 0, 0.1)",transform:h?"scale(1.05)":"scale(1)",...Lr.knob,zIndex:1,...ls[s],...T.circle}),n&&!u&&r.jsx(i.View,{marginRight:8,marginLeft:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:n})]}),c==="right"&&t&&r.jsx(i.Text,{fontWeight:"500",color:f?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t})]})},ds=e=>{const o=Br(e);return r.jsx(Ar,{...o,...e})},Dr=({placeholder:e,isMulti:o,options:t,id:n=`selector-${Math.random().toString(36).substr(2,9)}`})=>{const l=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,c]=g.useState(!1),[d,s]=g.useState(!1),[u,h]=g.useState(l),[f,m]=g.useState(0),[p,b]=g.useState(!0);return{id:n,value:u,setValue:h,hide:p,setHide:b,isHovered:a,setIsHovered:c,isFocused:d,setIsFocused:s,highlightedIndex:f,setHighlightedIndex:m}},Fr=({id:e,name:o,label:t,value:n,size:l,views:a={},options:c=[],onChange:d=()=>{},setValue:s=()=>{},...u})=>{const{getColor:h}=i.useTheme(),f=g.useCallback(m=>{s(m.value),d&&d(m.value)},[s,d]);return r.jsxs(Te,{id:e,width:"100%",views:a,children:[t&&r.jsxs(i.Horizontal,{fontSize:"10px",letterSpacing:"wider",color:"color-black-500",fontWeight:"bold",marginBottom:12,alignItems:"center",gap:6,style:{textTransform:"uppercase"},children:[r.jsx(Se,{widthHeight:14})," ",r.jsx(i.Text,{children:t})]}),r.jsx(i.Horizontal,{gap:0,children:c.map((m,p,b)=>{const x=n===m.value;let y=h("color-gray-200"),k=h("color-gray-500"),w="transparent";if(x){if(m.color)m.color,y=h(m.color),k=h(m.color),w="rgba(0,0,0,0.05)";else{const T=h("theme-primary");y=T,k=T,w="color-gray-50"}m.color?(y=h(m.color),k=h(m.color),w="transparent"):(y=h("theme-primary"),k=h("theme-primary"),w="transparent")}return r.jsx(_e,{onClick:()=>f(m),flex:1,...l?{size:l}:{paddingVertical:6,fontSize:"12px"},fontWeight:x?"bold":"normal",style:{borderTop:`1px solid ${x?y:h("color-gray-200")}`,borderBottom:`1px solid ${x?y:h("color-gray-200")}`,borderLeft:`1px solid ${x?y:h("color-gray-200")}`,borderRight:p===b.length-1||x?`1px solid ${x?y:h("color-gray-200")}`:"none",backgroundColor:w,color:k,borderRadius:p===0?"6px 0 0 6px":p===b.length-1?"0 6px 6px 0":"0",zIndex:x?1:0,boxShadow:"none"},...a.item,children:m.label},m.value)})}),r.jsx("input",{type:"hidden",id:e,name:o,value:Array.isArray(n)?n.join(","):n,onChange:()=>{}})]})},gs=e=>{const o={...e,options:e.options||[]},t=Dr(o);return r.jsx(Fr,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},Or=({label:e,placeholder:o,value:t})=>{const[n,l]=g.useState(e??o),[a,c]=g.useState(!1),[d,s]=g.useState(t||""),[u,h]=g.useState(!1);return g.useMemo(()=>{l(u&&!d?o??"":e??o)},[d,u,e,o]),{hint:n,setHint:l,isHovered:a,setIsHovered:c,value:d,setValue:s,isFocused:u,setIsFocused:h}},qr=({id:e,name:o,hint:t,error:n,value:l,label:a,shadow:c,helperText:d,placeholder:s,size:u="sm",shape:h="default",variant:f="default",isHovered:m=!1,isFocused:p=!1,isEditable:b=!1,isReadOnly:x=!1,isDisabled:y=!1,isAutoFocus:k=!1,isMultiline:w=!1,maxRows:T=3,maxCols:C=30,onBlur:I=()=>{},onChange:j,onFocus:z,setHint:V=()=>{},setValue:W=()=>{},setIsFocused:H=()=>{},setIsHovered:S=()=>{},views:B={label:{},helperText:{}},...A})=>{const E=!!(p&&a),P={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:i.Typography.fontSizes[u],lineHeight:`${Math.round(i.Typography.fontSizes[u]*1.5)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:y?"color-gray-400":"color-gray-900",cursor:y?"not-allowed":"text",opacity:y?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...B.field},$=()=>S(!m),_=()=>{H(!0),z&&z()},L=F=>{I(F),H(!1)},D=F=>{typeof F=="string"?(W(F),j&&j(F)):(W(F.target.value),j&&j(F.target.value))};return r.jsx(Te,{helperText:d,error:n,views:B,...A,children:r.jsx(Me,{label:a,size:u,error:n,shape:h,views:B,shadow:c,variant:f,value:l,color:"theme-primary",isHovered:m,isDisabled:y,isReadOnly:x,isFocused:p,showLabel:E,onMouseEnter:$,onMouseLeave:$,...B==null?void 0:B.content,children:r.jsxs(Ue,{...B==null?void 0:B.warper,children:[E&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:n,...B==null?void 0:B.label,children:a}),r.jsx(i.Element,{as:"textarea",id:e,name:o,rows:T,cols:C,value:l,readOnly:x,disabled:y,autoFocus:k,editable:`${!!b.toString()}`,placeholder:t,onBlur:L,onFocus:_,multiline:`${!!w.toString()}`,onChange:F=>D(F),...P,style:{resize:y||x?"none":"vertical"},...B==null?void 0:B.textarea})]})})})},us=e=>{const o=Or(e);return r.jsx(qr,{...o,...e})},Mt=({label:e,placeholder:o,value:t})=>{const[n,l]=g.useState(e??o),[a,c]=g.useState(!1),[d,s]=g.useState(!1),[u,h]=g.useState(t);return g.useMemo(()=>{l(a&&!u?o??"":e??o)},[u,a,e,o]),{hint:n,setHint:l,isFocused:a,setIsFocused:c,isHovered:d,setIsHovered:s,setValue:h,value:u}},hs=e=>r.jsx(i.Input,{type:"text",...e}),go=({id:e,name:o,label:t,hint:n,value:l,onChange:a,left:c,right:d,helperText:s,placeholder:u,onChangeText:h,shadow:f={},views:m={container:{},field:{},label:{},helperText:{},text:{}},size:p="md",shape:b="default",variant:x="default",error:y=!1,isFocused:k=!1,isHovered:w=!1,isDisabled:T=!1,isReadOnly:C=!1,isClearable:I=!0,isAutoFocus:j=!1,setHint:z=()=>{},setIsFocused:V=()=>{},setIsHovered:W=()=>{},setValue:H=()=>{},onClick:S=()=>{},onFocus:B,onBlur:A=()=>{},themeMode:E,...P})=>{const{getColor:$,themeMode:_}=i.useTheme(),L=$("color-blueGray-700",{themeMode:E||_}),D=!!(k&&t),F={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",height:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:i.Typography.fontSizes[p],lineHeight:`${Math.round(i.Typography.fontSizes[p]*1.4)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:T?"color-gray-400":"color-gray-900",cursor:T?"not-allowed":"text",opacity:T?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...m.field},q=()=>{V(!0),B&&B()},O=()=>W(!w),N=G=>{A&&A(G),V(!1)},Z=G=>{typeof G=="string"?(H(G),h&&h(G),a&&a(G)):(H(G.target.value),h&&h(G.target.value),a&&a(G.target.value))},X=()=>{H(""),a&&(A({target:{name:o}}),h&&h(""),a&&a("")),typeof document>"u"&&h&&h("")};return r.jsx(Te,{helperText:s,error:y,views:m,children:r.jsxs(Me,{label:t,size:p,error:y,shape:b,views:m,shadow:f,variant:x,value:l,color:"theme-primary",isHovered:w,isDisabled:T,isReadOnly:C,isFocused:k,showLabel:D,onMouseEnter:O,onMouseLeave:O,children:[c,r.jsxs(Ue,{children:[D&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:y,...m,children:t}),r.jsx(hs,{id:e,name:o,readOnly:C,disabled:T,autoFocus:j,placeholder:n,onFocus:q,onBlur:N,autoComplete:"off",...F,...P,onChange:Z,value:l})]}),I&&l&&!C&&!T&&r.jsx(St,{children:r.jsx(pe,{size:20,color:L,onClick:X,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]})})},uo=e=>{const o=Mt(e);return r.jsx(go,{...o,...e})},Nr=({defaultIsSelected:e=!1})=>{const[o,t]=g.useState(!1),[n,l]=g.useState(e);return{isHovered:o,setIsHovered:t,isSelected:n,setIsSelected:l}},fs={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"}},Ur={xs:10,sm:14,md:16,lg:20,xl:24},ms={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"}},zt={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"}}},Gr=({id:e,icon:o,name:t,label:n,isChecked:l,onChange:a,onValueChange:c,shadow:d={},labelPosition:s="right",size:u="md",error:h=!1,isSelected:f=!1,isHovered:m=!1,isDisabled:p=!1,isReadOnly:b=!1,isIndeterminate:x=!1,defaultIsSelected:y=!1,setIsSelected:k=()=>{},setIsHovered:w=()=>{},views:T={checkbox:{},label:{}},infoText:C,helperText:I,...j})=>{const z=()=>w(!m),V=()=>{!b&&!p&&(k&&k(!f),a&&a(!l),c&&c(!l))},W=x?"indeterminate":l||f?"selected":"unselected",H=h?zt.error[W]:p?zt.disabled[W]:m?zt.hover[W]:{},S={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:h?"color-red-600":p?"color-gray-400":"color-gray-700",cursor:p?"not-allowed":b?"default":"pointer",opacity:p?.6:1,transition:"all 0.2s ease",...T.label},checkbox:{...ms[W],...H,borderRadius:"4px",...fs[u],transition:"all 0.2s ease",...d,...T.checkbox}};return r.jsxs(so,{htmlFor:e,as:"div",onClick:V,onMouseEnter:z,onMouseLeave:z,size:i.Typography.fontSizes[u],...S.container,...j,children:[r.jsxs(i.Vertical,{gap:8,children:[" ",r.jsxs(i.Horizontal,{gap:12,alignItems:"center",children:[" ",s==="left"&&n&&r.jsx(i.Text,{size:u,fontWeight:"500",...T==null?void 0:T.label,children:n}),r.jsx(i.Center,{...S.checkbox,children:x?r.jsx(Rt,{widthHeight:Ur[u],color:"white",transition:"all 0.2s ease"}):(l||f)&&(o??r.jsx(Vo,{widthHeight:Ur[u],color:"white",transition:"all 0.2s ease"}))}),s==="right"&&n&&r.jsx(i.Text,{size:u,fontWeight:"500",...T==null?void 0:T.label,children:n})]}),C&&r.jsx(i.Text,{marginLeft:s==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...T==null?void 0:T.infoText,children:C})]}),h&&r.jsx(i.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:h})]})},ps=e=>{const o=Nr(e);return r.jsx(Gr,{...o,...e})},Yr=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:l,onOpen:a,onClose:c,closeOnSelect:d=!0,maxRecentColors:s=8,showRecentColors:u=!0,isAutoFocus:h=!1}=e,[f,m]=g.useState(!1),[p,b]=g.useState(o??t),[x,y]=g.useState(""),[k,w]=g.useState([]),[T,C]=g.useState(!1),[I,j]=g.useState(!1),z=g.useRef(null),V=g.useRef(null);g.useEffect(()=>{o!==void 0&&b(o)},[o]),g.useEffect(()=>{if(u)try{const $=localStorage.getItem("colorInput-recentColors");$&&w(JSON.parse($))}catch($){console.warn("Failed to load recent colors from localStorage:",$)}},[u]),g.useEffect(()=>{h&&z.current&&z.current.focus()},[h]),g.useEffect(()=>{const $=_=>{f&&z.current&&V.current&&!z.current.contains(_.target)&&!V.current.contains(_.target)&&E()};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[f]);const W=g.useCallback($=>{u&&w(_=>{const L=_.filter(F=>F!==$),D=[$,...L].slice(0,s);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(D))}catch(F){console.warn("Failed to save recent colors to localStorage:",F)}return D})},[u,s]),H=g.useCallback(()=>{const $=!f;m($),$?a==null||a():c==null||c()},[f,a,c]),S=g.useCallback($=>{b($),W($),n==null||n($),l==null||l($),d&&(m(!1),c==null||c())},[n,l,d,c,W]),B=g.useCallback($=>{y($)},[]),A=g.useCallback(()=>{x&&(S(x),y(""))},[x,S]),E=g.useCallback(()=>{m(!1),c==null||c()},[c]),P=g.useCallback($=>{b($),n==null||n($)},[n]);return{isOpen:f,selectedColor:p,recentColors:k,customColor:x,isFocused:T,isHovered:I,handleToggle:H,handleColorSelect:S,handleCustomColorChange:B,handleCustomColorSubmit:A,handleClose:E,setIsFocused:C,setIsHovered:j,setValue:P,triggerRef:z,dropdownRef:V}},ho={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"}},ys={default:{borderRadius:"6px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},xs={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"}},ks=[{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"}],vr=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:l,views:a={},size:c="md",shape:d="default",variant:s="default",shadow:u,error:h=!1,isDisabled:f=!1,isReadOnly:m=!1,isFocused:p=!1,isHovered:b=!1,predefinedColors:x=ks,showCustomInput:y=!0,showRecentColors:k=!0,isOpen:w=!1,selectedColor:T="",recentColors:C=[],customColor:I="",handleToggle:j=()=>{},handleColorSelect:z=()=>{},handleCustomColorChange:V=()=>{},handleCustomColorSubmit:W=()=>{},setIsFocused:H=()=>{},setIsHovered:S=()=>{},triggerRef:B,dropdownRef:A,onChange:E,...P})=>{const{getColor:$}=i.useTheme(),_={...ho.container,...a==null?void 0:a.container},L={...ho.trigger,...bs[c],...ys[d],...xs[s],...h&&{borderColor:"color-red-500"},...f&&{opacity:.6,cursor:"not-allowed"},...p&&{borderColor:"color-blue-500",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.1)"},...b&&!f&&{borderColor:"color-gray-400"},...a==null?void 0:a.trigger,...u&&u},D={...ho.dropdown,...a==null?void 0:a.dropdown},F={...ho.colorGrid,...a==null?void 0:a.colorGrid},q={...ho.recentColors,...a==null?void 0:a.recentColors},O=T||"color-gray-200";return r.jsxs(i.View,{..._,...P,children:[t&&r.jsx(so,{htmlFor:e,size:c,isDisabled:f,error:h,views:a==null?void 0:a.label,children:t}),r.jsxs(i.View,{ref:B,onClick:f||m?void 0:j,onMouseEnter:()=>H(!0),onMouseLeave:()=>H(!1),onFocus:()=>H(!0),onBlur:()=>H(!1),tabIndex:f?-1:0,role:"button","aria-expanded":w,"aria-haspopup":"listbox","aria-label":t||n,width:"fit-content",gap:8,...L,children:[r.jsx(i.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:O,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),!m&&!f&&r.jsx(le,{widthHeight:16,color:"color-gray-500",orientation:w?"up":"down"})]}),w&&r.jsxs(i.View,{ref:A,...D,children:[r.jsx(i.View,{...F,children:x.map((N,Z)=>r.jsx(i.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:N.value,borderWidth:"2px",borderStyle:"solid",borderColor:T===N.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>z(N.value),title:N.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},Z))}),k&&C.length>0&&r.jsxs(i.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(i.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Recent Colors"}),r.jsx(i.Horizontal,{gap:4,flexWrap:"wrap",...q,children:C.map((N,Z)=>r.jsx(i.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:N,borderWidth:"1px",borderStyle:"solid",borderColor:T===N?"color-blue-500":"color-gray-300",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>z(N),title:N,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"}},Z))})]}),y&&r.jsxs(i.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(i.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Custom Color"}),r.jsxs(i.Horizontal,{gap:8,children:[r.jsx(uo,{value:I,onChange:N=>V(N.target.value),placeholder:"#000000 or rgb(0,0,0)",size:"sm",style:{flex:1},views:a==null?void 0:a.customInput}),r.jsx(i.View,{padding:"8px 12px",backgroundColor:"color-blue-500",borderRadius:"4px",cursor:"pointer",onClick:W,_hover:{backgroundColor:"color-blue-600"},children:r.jsx(i.Text,{color:"color-white",fontSize:"12px",fontWeight:"500",children:"Add"})})]})]})]}),l&&r.jsx(i.Text,{fontSize:"12px",color:h?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:l}),h&&typeof h=="string"&&r.jsx(i.Text,{fontSize:"12px",color:"color-red-500",marginTop:"4px",...a==null?void 0:a.error,children:h})]})},Cs=e=>{const o=Yr(e);return r.jsx(vr,{...o,...e})},Vt=[{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"}],Xr=({placeholder:e})=>{const[o,t]=g.useState(Vt),[n,l]=g.useState(e??Vt[0].name),[a,c]=g.useState(!0),[d,s]=g.useState(!1),[u,h]=g.useState(!1);return{hide:a,setHide:c,newOptions:o,setNewOptions:t,isHovered:u,setIsHovered:h,isFocused:d,setIsFocused:s,value:n,setValue:l}},Kr={xs:8,sm:10,md:12,lg:14,xl:16},ws=({size:e,...o})=>r.jsx(i.Element,{as:"ul",...o}),Is=e=>r.jsx(i.Input,{type:"country",...e}),Ts=({size:e,...o})=>r.jsx(i.Element,{as:"li",...o}),js=({option:e,size:o="md",callback:t=()=>{},views:n={text:{}}})=>{const l=a=>{a&&a.stopPropagation&&a.stopPropagation(),t(e)};return r.jsx(Ts,{margin:0,role:"DropDownItem",listStyleType:"none",fontWeight:"normal",paddingVertical:6,paddingHorizontal:12,onClick:l,fontSize:i.Typography.fontSizes[o],_hover:{opacity:.8},...n.text,children:e})},Ss=({size:e,views:o={dropDown:{}},options:t=[],callback:n=()=>{}})=>{const l=a=>n(a);return r.jsx(ws,{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:l,...o.text},a.code))})},Qr=({id:e,name:o,label:t,value:n,placeholder:l,helperText:a,hide:c=!1,error:d=!1,isHovered:s=!1,isFocused:u=!1,isAutoFocus:h=!1,isDisabled:f=!1,isReadOnly:m=!1,shadow:p={},newOptions:b=[],size:x="md",variant:y="default",shape:k="default",onChange:w,onBlur:T=()=>{},setHide:C=()=>{},setNewOptions:I=()=>{},setIsHovered:j=()=>{},setIsFocused:z=()=>{},setValue:V=()=>{},views:W={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:H,...S})=>{const{getColor:B,themeMode:A}=i.useTheme(),E=B("color-blueGray-700",{themeMode:H||A}),P=()=>z(!0),$=O=>{C(!c),V(O),w&&w(O)},_=()=>{!f&&!m&&C(!c)},L=O=>{const N=O.target.value,Z=Vt.filter(X=>X.name.toLowerCase().startsWith(N.toLowerCase()));c&&C(!1),I(Z),w&&w(N)},D=O=>{T(O),z(!1)},F=!!(t&&(u||n)),q={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:i.Typography.fontSizes[x],backgroundColor:"transparent",color:f?"color-trueGray-600":"color-blueGray-700",cursor:f?"not-allowed":m?"auto":"pointer",...W.field};return r.jsxs(Te,{helperText:a,error:d,views:W,onClick:_,children:[r.jsxs(Me,{label:t,size:x,error:d,shape:k,views:W,shadow:p,variant:y,value:n,color:"theme-primary",isDisabled:f,isReadOnly:m,isFocused:u,showLabel:F,_hover:!f&&!d?{borderColor:"theme-primary"}:void 0,children:[r.jsxs(Ue,{children:[F&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:d,...W,children:t}),r.jsx(Is,{id:e,name:o,placeholder:l,readOnly:m,disabled:f,autoFocus:h,onBlur:D,onFocus:P,...q,...S,value:n,onChange:L})]}),r.jsx(St,{children:c?r.jsx(le,{orientation:"down",widthHeight:Kr[x],color:E,style:W.icon}):r.jsx(le,{orientation:"up",widthHeight:Kr[x],color:E,style:W.icon})})]}),!c&&r.jsx(Ss,{size:x,views:W,options:b,callback:$})]})},Ms=e=>{const o=Xr(e);return r.jsx(Qr,{...o,...e})};function qo(e){"@babel/helpers - typeof";return qo=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},qo(e)}function he(e,o){if(o.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+o.length+" present")}function zs(e){return he(1,arguments),e instanceof Date||qo(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ce(e){he(1,arguments);var o=Object.prototype.toString.call(e);return e instanceof Date||qo(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 Vs(e){if(he(1,arguments),!zs(e)&&typeof e!="number")return!1;var o=Ce(e);return!isNaN(Number(o))}function Be(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 Es(e,o){he(2,arguments);var t=Ce(e).getTime(),n=Be(o);return new Date(t+n)}function Ps(e,o){he(2,arguments);var t=Be(o);return Es(e,-t)}var Ws=864e5;function _s(e){he(1,arguments);var o=Ce(e),t=o.getTime();o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0);var n=o.getTime(),l=t-n;return Math.floor(l/Ws)+1}function No(e){he(1,arguments);var o=1,t=Ce(e),n=t.getUTCDay(),l=(n<o?7:0)+n-o;return t.setUTCDate(t.getUTCDate()-l),t.setUTCHours(0,0,0,0),t}function Zr(e){he(1,arguments);var o=Ce(e),t=o.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var l=No(n),a=new Date(0);a.setUTCFullYear(t,0,4),a.setUTCHours(0,0,0,0);var c=No(a);return o.getTime()>=l.getTime()?t+1:o.getTime()>=c.getTime()?t:t-1}function $s(e){he(1,arguments);var o=Zr(e),t=new Date(0);t.setUTCFullYear(o,0,4),t.setUTCHours(0,0,0,0);var n=No(t);return n}var Hs=6048e5;function Bs(e){he(1,arguments);var o=Ce(e),t=No(o).getTime()-$s(o).getTime();return Math.round(t/Hs)+1}var Ls={};function Uo(){return Ls}function Go(e,o){var t,n,l,a,c,d,s,u;he(1,arguments);var h=Uo(),f=Be((t=(n=(l=(a=o==null?void 0:o.weekStartsOn)!==null&&a!==void 0?a:o==null||(c=o.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&l!==void 0?l:h.weekStartsOn)!==null&&n!==void 0?n:(s=h.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Ce(e),p=m.getUTCDay(),b=(p<f?7:0)+p-f;return m.setUTCDate(m.getUTCDate()-b),m.setUTCHours(0,0,0,0),m}function Jr(e,o){var t,n,l,a,c,d,s,u;he(1,arguments);var h=Ce(e),f=h.getUTCFullYear(),m=Uo(),p=Be((t=(n=(l=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(c=o.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:m.firstWeekContainsDate)!==null&&n!==void 0?n:(s=m.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(f+1,0,p),b.setUTCHours(0,0,0,0);var x=Go(b,o),y=new Date(0);y.setUTCFullYear(f,0,p),y.setUTCHours(0,0,0,0);var k=Go(y,o);return h.getTime()>=x.getTime()?f+1:h.getTime()>=k.getTime()?f:f-1}function As(e,o){var t,n,l,a,c,d,s,u;he(1,arguments);var h=Uo(),f=Be((t=(n=(l=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(c=o.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:h.firstWeekContainsDate)!==null&&n!==void 0?n:(s=h.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&t!==void 0?t:1),m=Jr(e,o),p=new Date(0);p.setUTCFullYear(m,0,f),p.setUTCHours(0,0,0,0);var b=Go(p,o);return b}var Ds=6048e5;function Fs(e,o){he(1,arguments);var t=Ce(e),n=Go(t,o).getTime()-As(t,o).getTime();return Math.round(n/Ds)+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 ze={y:function(o,t){var n=o.getUTCFullYear(),l=n>0?n:1-n;return te(t==="yy"?l%100:l,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,l=o.getUTCMilliseconds(),a=Math.floor(l*Math.pow(10,n-3));return te(a,t.length)}},Ge={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Os={G:function(o,t,n){var l=o.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(l,{width:"abbreviated"});case"GGGGG":return n.era(l,{width:"narrow"});case"GGGG":default:return n.era(l,{width:"wide"})}},y:function(o,t,n){if(t==="yo"){var l=o.getUTCFullYear(),a=l>0?l:1-l;return n.ordinalNumber(a,{unit:"year"})}return ze.y(o,t)},Y:function(o,t,n,l){var a=Jr(o,l),c=a>0?a:1-a;if(t==="YY"){var d=c%100;return te(d,2)}return t==="Yo"?n.ordinalNumber(c,{unit:"year"}):te(c,t.length)},R:function(o,t){var n=Zr(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 l=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"Q":return String(l);case"QQ":return te(l,2);case"Qo":return n.ordinalNumber(l,{unit:"quarter"});case"QQQ":return n.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(l,{width:"wide",context:"formatting"})}},q:function(o,t,n){var l=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"q":return String(l);case"qq":return te(l,2);case"qo":return n.ordinalNumber(l,{unit:"quarter"});case"qqq":return n.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(l,{width:"wide",context:"standalone"})}},M:function(o,t,n){var l=o.getUTCMonth();switch(t){case"M":case"MM":return ze.M(o,t);case"Mo":return n.ordinalNumber(l+1,{unit:"month"});case"MMM":return n.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(l,{width:"wide",context:"formatting"})}},L:function(o,t,n){var l=o.getUTCMonth();switch(t){case"L":return String(l+1);case"LL":return te(l+1,2);case"Lo":return n.ordinalNumber(l+1,{unit:"month"});case"LLL":return n.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(l,{width:"wide",context:"standalone"})}},w:function(o,t,n,l){var a=Fs(o,l);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):te(a,t.length)},I:function(o,t,n){var l=Bs(o);return t==="Io"?n.ordinalNumber(l,{unit:"week"}):te(l,t.length)},d:function(o,t,n){return t==="do"?n.ordinalNumber(o.getUTCDate(),{unit:"date"}):ze.d(o,t)},D:function(o,t,n){var l=_s(o);return t==="Do"?n.ordinalNumber(l,{unit:"dayOfYear"}):te(l,t.length)},E:function(o,t,n){var l=o.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(l,{width:"short",context:"formatting"});case"EEEE":default:return n.day(l,{width:"wide",context:"formatting"})}},e:function(o,t,n,l){var a=o.getUTCDay(),c=(a-l.weekStartsOn+8)%7||7;switch(t){case"e":return String(c);case"ee":return te(c,2);case"eo":return n.ordinalNumber(c,{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,l){var a=o.getUTCDay(),c=(a-l.weekStartsOn+8)%7||7;switch(t){case"c":return String(c);case"cc":return te(c,t.length);case"co":return n.ordinalNumber(c,{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 l=o.getUTCDay(),a=l===0?7:l;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(l,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(l,{width:"short",context:"formatting"});case"iiii":default:return n.day(l,{width:"wide",context:"formatting"})}},a:function(o,t,n){var l=o.getUTCHours(),a=l/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 l=o.getUTCHours(),a;switch(l===12?a=Ge.noon:l===0?a=Ge.midnight:a=l/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 l=o.getUTCHours(),a;switch(l>=17?a=Ge.evening:l>=12?a=Ge.afternoon:l>=4?a=Ge.morning:a=Ge.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 l=o.getUTCHours()%12;return l===0&&(l=12),n.ordinalNumber(l,{unit:"hour"})}return ze.h(o,t)},H:function(o,t,n){return t==="Ho"?n.ordinalNumber(o.getUTCHours(),{unit:"hour"}):ze.H(o,t)},K:function(o,t,n){var l=o.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(l,{unit:"hour"}):te(l,t.length)},k:function(o,t,n){var l=o.getUTCHours();return l===0&&(l=24),t==="ko"?n.ordinalNumber(l,{unit:"hour"}):te(l,t.length)},m:function(o,t,n){return t==="mo"?n.ordinalNumber(o.getUTCMinutes(),{unit:"minute"}):ze.m(o,t)},s:function(o,t,n){return t==="so"?n.ordinalNumber(o.getUTCSeconds(),{unit:"second"}):ze.s(o,t)},S:function(o,t){return ze.S(o,t)},X:function(o,t,n,l){var a=l._originalDate||o,c=a.getTimezoneOffset();if(c===0)return"Z";switch(t){case"X":return en(c);case"XXXX":case"XX":return Le(c);case"XXXXX":case"XXX":default:return Le(c,":")}},x:function(o,t,n,l){var a=l._originalDate||o,c=a.getTimezoneOffset();switch(t){case"x":return en(c);case"xxxx":case"xx":return Le(c);case"xxxxx":case"xxx":default:return Le(c,":")}},O:function(o,t,n,l){var a=l._originalDate||o,c=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Rr(c,":");case"OOOO":default:return"GMT"+Le(c,":")}},z:function(o,t,n,l){var a=l._originalDate||o,c=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Rr(c,":");case"zzzz":default:return"GMT"+Le(c,":")}},t:function(o,t,n,l){var a=l._originalDate||o,c=Math.floor(a.getTime()/1e3);return te(c,t.length)},T:function(o,t,n,l){var a=l._originalDate||o,c=a.getTime();return te(c,t.length)}};function Rr(e,o){var t=e>0?"-":"+",n=Math.abs(e),l=Math.floor(n/60),a=n%60;if(a===0)return t+String(l);var c=o;return t+String(l)+c+te(a,2)}function en(e,o){if(e%60===0){var t=e>0?"-":"+";return t+te(Math.abs(e)/60,2)}return Le(e,o)}function Le(e,o){var t=o||"",n=e>0?"-":"+",l=Math.abs(e),a=te(Math.floor(l/60),2),c=te(l%60,2);return n+a+t+c}var on=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"})}},tn=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"})}},qs=function(o,t){var n=o.match(/(P+)(p+)?/)||[],l=n[1],a=n[2];if(!a)return on(o,t);var c;switch(l){case"P":c=t.dateTime({width:"short"});break;case"PP":c=t.dateTime({width:"medium"});break;case"PPP":c=t.dateTime({width:"long"});break;case"PPPP":default:c=t.dateTime({width:"full"});break}return c.replace("{{date}}",on(l,t)).replace("{{time}}",tn(a,t))},Ns={p:tn,P:qs};function Us(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 Gs=["D","DD"],Ys=["YY","YYYY"];function vs(e){return Gs.indexOf(e)!==-1}function Xs(e){return Ys.indexOf(e)!==-1}function rn(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 Ks={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"}},Qs=function(o,t,n){var l,a=Ks[o];return typeof a=="string"?l=a:t===1?l=a.one:l=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+l:l+" ago":l};function Et(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 Zs={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Js={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rs={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ed={date:Et({formats:Zs,defaultWidth:"full"}),time:Et({formats:Js,defaultWidth:"full"}),dateTime:Et({formats:Rs,defaultWidth:"full"})},od={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},td=function(o,t,n,l){return od[o]};function fo(e){return function(o,t){var n=t!=null&&t.context?String(t.context):"standalone",l;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,c=t!=null&&t.width?String(t.width):a;l=e.formattingValues[c]||e.formattingValues[a]}else{var d=e.defaultWidth,s=t!=null&&t.width?String(t.width):e.defaultWidth;l=e.values[s]||e.values[d]}var u=e.argumentCallback?e.argumentCallback(o):o;return l[u]}}var rd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},nd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ad={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"]},ld={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"]},cd={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"}},id={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"}},sd=function(o,t){var n=Number(o),l=n%100;if(l>20||l<10)switch(l%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},dd={ordinalNumber:sd,era:fo({values:rd,defaultWidth:"wide"}),quarter:fo({values:nd,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:fo({values:ad,defaultWidth:"wide"}),day:fo({values:ld,defaultWidth:"wide"}),dayPeriod:fo({values:cd,defaultWidth:"wide",formattingValues:id,defaultFormattingWidth:"wide"})};function mo(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,l=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=o.match(l);if(!a)return null;var c=a[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(d)?ud(d,function(f){return f.test(c)}):gd(d,function(f){return f.test(c)}),u;u=e.valueCallback?e.valueCallback(s):s,u=t.valueCallback?t.valueCallback(u):u;var h=o.slice(c.length);return{value:u,rest:h}}}function gd(e,o){for(var t in e)if(e.hasOwnProperty(t)&&o(e[t]))return t}function ud(e,o){for(var t=0;t<e.length;t++)if(o(e[t]))return t}function hd(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 l=n[0],a=o.match(e.parsePattern);if(!a)return null;var c=e.valueCallback?e.valueCallback(a[0]):a[0];c=t.valueCallback?t.valueCallback(c):c;var d=o.slice(l.length);return{value:c,rest:d}}}var fd=/^(\d+)(th|st|nd|rd)?/i,md=/\d+/i,pd={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},bd={any:[/^b/i,/^(a|c)/i]},yd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xd={any:[/1/i,/2/i,/3/i,/4/i]},kd={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},Cd={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]},wd={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},Id={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]},Td={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},jd={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}},Sd={ordinalNumber:hd({matchPattern:fd,parsePattern:md,valueCallback:function(o){return parseInt(o,10)}}),era:mo({matchPatterns:pd,defaultMatchWidth:"wide",parsePatterns:bd,defaultParseWidth:"any"}),quarter:mo({matchPatterns:yd,defaultMatchWidth:"wide",parsePatterns:xd,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:mo({matchPatterns:kd,defaultMatchWidth:"wide",parsePatterns:Cd,defaultParseWidth:"any"}),day:mo({matchPatterns:wd,defaultMatchWidth:"wide",parsePatterns:Id,defaultParseWidth:"any"}),dayPeriod:mo({matchPatterns:Td,defaultMatchWidth:"any",parsePatterns:jd,defaultParseWidth:"any"})},Md={code:"en-US",formatDistance:Qs,formatLong:ed,formatRelative:td,localize:dd,match:Sd,options:{weekStartsOn:0,firstWeekContainsDate:1}},zd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Vd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ed=/^'([^]*?)'?$/,Pd=/''/g,Wd=/[a-zA-Z]/;function _d(e,o,t){var n,l,a,c,d,s,u,h,f,m,p,b,x,y;he(2,arguments);var k=String(o),w=Uo(),T=(n=(l=void 0)!==null&&l!==void 0?l:w.locale)!==null&&n!==void 0?n:Md,C=Be((a=(c=(d=(s=void 0)!==null&&s!==void 0?s:void 0)!==null&&d!==void 0?d:w.firstWeekContainsDate)!==null&&c!==void 0?c:(u=w.locale)===null||u===void 0||(h=u.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=Be((f=(m=(p=(b=void 0)!==null&&b!==void 0?b:void 0)!==null&&p!==void 0?p:w.weekStartsOn)!==null&&m!==void 0?m:(x=w.locale)===null||x===void 0||(y=x.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&f!==void 0?f:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var j=Ce(e);if(!Vs(j))throw new RangeError("Invalid time value");var z=Us(j),V=Ps(j,z),W={firstWeekContainsDate:C,weekStartsOn:I,locale:T,_originalDate:j},H=k.match(Vd).map(function(S){var B=S[0];if(B==="p"||B==="P"){var A=Ns[B];return A(S,T.formatLong)}return S}).join("").match(zd).map(function(S){if(S==="''")return"'";var B=S[0];if(B==="'")return $d(S);var A=Os[B];if(A)return Xs(S)&&rn(S,o,String(e)),vs(S)&&rn(S,o,String(e)),A(V,S,T.localize,W);if(B.match(Wd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+B+"`");return S}).join("");return H}function $d(e){var o=e.match(Ed);return o?o[1].replace(Pd,"'"):e}const nn=()=>{const[e,o]=g.useState(!1),[t,n]=g.useState(!1),[l,a]=g.useState(_d(new Date,"yyyy-MM-dd"));return{date:l,setDate:a,isHovered:e,setIsHovered:o,isFocused:t,setIsFocused:n}},Hd=e=>r.jsx(i.Input,{type:"date",...e}),an=({id:e,icon:o,name:t,label:n,date:l,children:a,helperText:c,shadow:d={},size:s="md",variant:u="default",shape:h="default",views:f={container:{},label:{},helperText:{},text:{},field:{}},error:m=!1,isHovered:p=!1,isFocused:b=!1,isDisabled:x=!1,isReadOnly:y=!1,setDate:k=()=>{},setIsFocused:w=()=>{},setIsHovered:T=()=>{},onChange:C,onChangeText:I,...j})=>{const z=!!(b&&n),V=()=>T(!p),W=()=>w(!0),H=B=>{typeof B=="string"?(k(B),I&&I(B)):(k(B.target.value),C&&C(B.target.value))},S={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none",backgroundColor:"transparent"}},fontSize:i.Typography.fontSizes[s],backgroundColor:"transparent",color:x?"color-trueGray-600":"color-blueGray-700",cursor:x?"not-allowed":y?"auto":"pointer",...f.field};return r.jsx(Te,{helperText:c,error:m,views:f,children:r.jsx(Me,{label:n,size:s,error:m,shape:h,views:f,shadow:d,color:"theme-primary",variant:u,value:l,isHovered:p,isDisabled:x,isReadOnly:y,isFocused:b,showLabel:z,onMouseEnter:V,onMouseLeave:V,children:r.jsxs(Ue,{children:[z&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:m,...f,children:n}),r.jsx(Hd,{id:e,name:t,onFocus:W,disabled:x,readOnly:y,...S,...j,...I&&{onChangeText:H},onChange:H})]})})})},Bd=e=>{const o=nn();return r.jsx(an,{...o,...e})},ln=e=>{const o=Mt(e),[t,n]=g.useState(!1);return{isVisible:t,setIsVisible:n,...e,...o}},Ld=({visibleIcon:e=r.jsx(ut,{widthHeight:14}),hiddenIcon:o=r.jsx(gt,{widthHeight:14}),...t})=>{const{isVisible:n,setIsVisible:l,...a}=ln(t);return r.jsx(go,{...a,type:n?"text":"password",isClearable:!1,right:r.jsx(i.View,{onClick:()=>{t.isDisabled||l(!n)},children:n?e:o})})},cn=(e,o,t)=>{const[n,l]=g.useState(e),[a,c]=g.useState(o?{value:o,label:o}:e[0]),[d,s]=g.useState([]),[u,h]=g.useState(0),[f,m]=g.useState(t??""),[p,b]=g.useState(!1);return{filteredItems:n,setFilteredItems:l,selectedItem:a,setSelectedItem:c,selectedItems:d,setSelectedItems:s,highlightedIndex:u,setHighlightedIndex:h,searchQuery:f,setSearchQuery:m,isDropdownVisible:p,setIsDropdownVisible:b}},Ad={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)"},sn={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)"}},Dd={padding:"8px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-100",backgroundColor:"color-gray-50",borderTopLeftRadius:"10px",borderTopRightRadius:"10px"},Fd={padding:"8px 10px",cursor:"pointer",borderRadius:"6px",margin:"1px 4px",transition:"background-color 0.15s ease"},Od={padding:"24px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},dn={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)"}},qd={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"},gn=({placeholder:e,items:o,showTick:t=!0,onSelect:n,searchEnabled:l=!0,left:a,right:c,label:d,filteredItems:s,setSelectedItem:u,selectedItem:h,selectedItems:f,setSelectedItems:m,highlightedIndex:p,setHighlightedIndex:b,searchQuery:x,setSearchQuery:y,setFilteredItems:k,views:w,isDropdownVisible:T,setIsDropdownVisible:C,isMulti:I=!1,...j})=>{const{ref:z,relation:V}=i.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),W=g.useRef(null),[H,S]=g.useState(!1),[B,A]=g.useState(!1),E=()=>{var N;const D=B?sn.enter:sn.initial;if(!z.current)return{};const F=z.current.getBoundingClientRect(),q={position:"fixed",left:F.left,width:F.width,zIndex:1e4,...D};return((N=V==null?void 0:V.space)==null?void 0:N.vertical)==="top"?{...q,bottom:window.innerHeight-F.top+6}:{...q,top:F.bottom+6}};g.useEffect(()=>{if(T){const D=setTimeout(()=>A(!0),10);return()=>clearTimeout(D)}A(!1)},[T]),g.useEffect(()=>{const D=F=>{!F.composedPath().some(N=>(N==null?void 0:N.id)==="combobox-dropdown")&&z.current&&!z.current.contains(F.target)&&C(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const P=D=>{if(y(D),D==="")k(o);else{const F=o.filter(q=>q.label.toLowerCase().includes(D.toLowerCase()));k(F)}b(0)},$=D=>{if(I){const F=f.some(O=>O.value===D.value);let q;F?q=f.filter(O=>O.value!==D.value):q=[...f,D],m(q),n==null||n(q)}else u(D),n==null||n(D),C(!1)},_=(D,F)=>{D.stopPropagation();const q=f.filter(O=>O.value!==F.value);m(q),n==null||n(q)},L=D=>I?f.some(F=>F.value===D.value):D.value===h.value;return r.jsxs(i.Horizontal,{role:"combobox",flexWrap:"nowrap",gap:15,alignItems:"center",width:"100%",...j,children:[d&&r.jsx(i.Text,{views:w==null?void 0:w.label,htmlFor:j.id,children:d}),r.jsxs(i.View,{position:"relative",width:"100%",children:[r.jsx("div",{ref:z,onClick:()=>C(!T),style:{width:"100%"},children:r.jsxs(Me,{isHovered:H,isFocused:T,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),cursor:"pointer",views:{container:w==null?void 0:w.container},children:[r.jsxs(i.Horizontal,{gap:10,alignItems:"center",width:"100%",flexWrap:I?"wrap":"nowrap",...w==null?void 0:w.labelContainer,children:[a,I?f.length>0?r.jsx(i.Horizontal,{gap:6,flexWrap:"wrap",alignItems:"center",children:f.map(D=>r.jsxs(i.Horizontal,{...qd,_hover:{backgroundColor:"color-gray-200"},children:[D.icon&&r.jsx(i.View,{flexShrink:0,children:D.icon}),r.jsx(i.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:D.label}),r.jsx(pe,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:F=>_(F,D)})]},D.value))}):r.jsx(i.Text,{weight:"medium",flexGrow:1,color:"color-gray-500",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...w==null?void 0:w.label,children:e}):r.jsxs(r.Fragment,{children:[h.icon&&h.label!==e&&r.jsx(i.View,{children:h.icon}),r.jsx(i.Text,{weight:"medium",flexGrow:1,color:h.label===e?"color-gray-500":"color-gray-800",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...w==null?void 0:w.label,children:h.label})]})]}),r.jsxs(i.Horizontal,{gap:8,alignItems:"center",children:[c,r.jsx(i.View,{style:T?dn.open:dn.closed,children:r.jsx(le,{widthHeight:16,orientation:"down",color:T?"color-gray-700":"color-gray-400"})})]})]})}),T&&r.jsx(Vr,{children:r.jsxs(i.View,{ref:W,id:"combobox-dropdown",role:"listbox","aria-labelledby":j.id,...Ad,style:E(),...w==null?void 0:w.dropdown,children:[l&&r.jsx(i.View,{...Dd,children:r.jsx(go,{id:`${j.id}-search`,name:`${j.name}-search`,width:"100%",type:"search",autoFocus:!0,value:x,onChange:D=>P(D),hint:e||"Search...",isClearable:!1,left:r.jsx(zo,{widthHeight:14,color:"color-gray-400"}),views:{container:{width:"100%",padding:"0",backgroundColor:"transparent",borderColor:"color-gray-200",...w==null?void 0:w.text},field:{fontSize:"13px"}}})}),s.length>0&&r.jsx(i.View,{margin:0,padding:"4px",children:s.map((D,F)=>{const q=L(D),O=F===p;return r.jsxs(i.Horizontal,{role:"option","aria-selected":q,justifyContent:"space-between",alignItems:"center",...Fd,backgroundColor:q&&O?"rgba(59, 130, 246, 0.12)":q?"rgba(59, 130, 246, 0.08)":O?"color-gray-100":"transparent",onMouseEnter:()=>b(F),onClick:()=>$(D),...w==null?void 0:w.item,children:[r.jsxs(i.Horizontal,{gap:8,alignItems:"center",children:[D.icon&&r.jsx(i.View,{flexShrink:0,children:D.icon}),r.jsx(i.Text,{size:"sm",color:q?"theme-primary":"color-gray-800",weight:q?"medium":"normal",children:D.label})]}),q&&t&&r.jsx(Vo,{widthHeight:16,color:"theme-primary"})]},D.value)})}),s.length===0&&r.jsxs(i.Vertical,{...Od,children:[r.jsx(zo,{widthHeight:24,color:"color-gray-300"}),r.jsx(i.Text,{color:"color-gray-500",size:"sm",align:"center",children:"No results found"}),r.jsx(i.Text,{color:"color-gray-400",size:"xs",align:"center",children:"Try a different search term"})]})]})})]})]})},Nd=({id:e,name:o,items:t,placeholder:n,searchPlaceholder:l,...a})=>{const c=cn(t,n,l);return r.jsx(gn,{id:e,name:o,items:t,...c,...a})},un=e=>{const{tags:o,defaultTags:t=[],onTagsChange:n,onTagAdd:l,onTagRemove:a,maxTags:c,minTagLength:d=1,maxTagLength:s=50,allowDuplicates:u=!1,separators:h=["enter","comma"],isDisabled:f=!1,isReadOnly:m=!1}=e,[p,b]=g.useState(""),[x,y]=g.useState(()=>(o||t||[]).map((E,P)=>({id:`tag-${P}-${Date.now()}`,value:E}))),[k,w]=g.useState(!1),[T,C]=g.useState(!1),I=o&&Array.isArray(o)?o.map((A,E)=>({id:`tag-${E}-${Date.now()}`,value:A})):x;g.useEffect(()=>{o&&Array.isArray(o)&&y(o.map((A,E)=>({id:`tag-${E}-${Date.now()}`,value:A})))},[o]);const j=g.useCallback(A=>{const E=A.trim();return!(E.length<d||E.length>s||!u&&I.map($=>$.value.toLowerCase()).includes(E.toLowerCase())||c&&I.length>=c)},[I,d,s,u,c]),z=g.useCallback(A=>{if(f||m)return;const E=A.trim();if(!E||!j(E))return;const P={id:`tag-${Date.now()}-${Math.random()}`,value:E},$=[...I,P],_=$.map(L=>L.value);o||y($),n==null||n(_),l==null||l(E),b("")},[I,j,n,l,f,m,o]),V=g.useCallback(A=>{if(f||m)return;const E=I[A];if(!E)return;const P=I.filter((_,L)=>L!==A),$=P.map(_=>_.value);o||y(P),n==null||n($),a==null||a(E.value,A)},[I,n,a,f,m,o]),W=g.useCallback(A=>{if(f||m)return;const E=A.target.value;if(h.includes("comma")&&E.includes(",")){const P=E.split(","),$=P[0],_=P.slice(1).join(",");$.trim()&&z($),b(_);return}b(E)},[z,h,f,m]),H=g.useCallback(A=>{if(f||m)return;const{key:E}=A;if(h.includes("enter")&&E==="Enter"){A.preventDefault(),p.trim()&&z(p);return}if(h.includes("tab")&&E==="Tab"&&p.trim()){A.preventDefault(),z(p);return}if(h.includes("space")&&E===" "&&p.trim()){A.preventDefault(),z(p);return}if(E==="Backspace"&&!p&&I.length>0){A.preventDefault(),V(I.length-1);return}},[z,V,p,I,h,f,m]),S=g.useCallback(()=>{var A;w(!0),(A=e.onFocus)==null||A.call(e)},[e.onFocus]),B=g.useCallback(()=>{var A;w(!1),p.trim()&&z(p),(A=e.onBlur)==null||A.call(e)},[z,p,e.onBlur]);return{inputValue:p,setInputValue:b,tags:I,setTags:y,isFocused:k,setIsFocused:w,isHovered:T,setIsHovered:C,addTag:z,removeTag:V,handleInputChange:W,handleKeyDown:H,handleFocus:S,handleBlur:B,validateTag:j}},Ud=({tag:e,onRemove:o,isRemovable:t,size:n,views:l,isDisabled:a,isReadOnly:c})=>{const[d,s]=g.useState(!1),u={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(i.Horizontal,{alignItems:"center",gap:6,padding:u.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&&!c?{backgroundColor:"color-gray-100-200",borderColor:"color-gray-200",boxShadow:"0 4px 6px rgba(0,0,0,0.05)",transform:"translateY(-1px)"}:{},...l==null?void 0:l.tag,children:[r.jsx(i.Text,{fontSize:u.fontSize,color:a?"color-gray-100":"theme-primary",whiteSpace:"nowrap",...l==null?void 0:l.tagText,children:e}),t&&!a&&!c&&r.jsx(i.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:h=>{h.stopPropagation(),o()},_hover:{backgroundColor:"color-red-50"},...l==null?void 0:l.tagRemove,children:r.jsx(pe,{widthHeight:u.iconSize,color:d?"color-red-500":"color-gray-400"})})]})},hn=({id:e,name:o,label:t,placeholder:n="Type and press Enter to add tags...",helperText:l,error:a=!1,inputValue:c="",tags:d=[],left:s,right:u,shadow:h={},views:f={},size:m="md",shape:p="default",variant:b="default",isDisabled:x=!1,isReadOnly:y=!1,isAutoFocus:k=!1,isRemovable:w=!0,isFocused:T=!1,isHovered:C=!1,maxTags:I,handleInputChange:j,handleKeyDown:z,handleFocus:V,handleBlur:W,removeTag:H,setIsHovered:S,onClick:B,...A})=>{const{getColor:E,themeMode:P}=i.useTheme(),$=!!(t&&(T||d.length>0||c)),_=I&&d.length>=I,L={...Er[p],...Wr[b],...f==null?void 0:f.inputContainer},D={border:"none",outline:"none",backgroundColor:"transparent",fontSize:i.Typography.fontSizes[m],color:x?"color-gray-400":"color-gray-800",flex:1,minWidth:"120px",...f==null?void 0:f.input};return r.jsx(Te,{error:!!a,helperText:typeof a=="string"?a:l,views:f,...A,children:r.jsxs(Me,{label:t,shadow:h,value:d.length>0||c?"has-content":"",size:m,shape:p,variant:b,error:!!a,showLabel:$,isFocused:T,isHovered:C,isDisabled:x,isReadOnly:y,views:f,onClick:B,onMouseEnter:()=>S==null?void 0:S(!0),onMouseLeave:()=>S==null?void 0:S(!1),...L,children:[s,r.jsxs(Ue,{children:[t&&r.jsx($e,{size:m,error:!!a,views:f,children:t}),r.jsxs(i.Horizontal,{alignItems:"center",gap:8,flexWrap:"wrap",width:"100%",minHeight:i.Typography.fontSizes[m],padding:"8px 0",...f==null?void 0:f.tagsContainer,children:[d.map((F,q)=>r.jsx(Ud,{tag:F.value,onRemove:()=>H==null?void 0:H(q),isRemovable:w,size:m,views:f,isDisabled:x,isReadOnly:y},F.id)),!_&&r.jsx(i.Input,{id:e,name:o,type:"text",value:c,placeholder:d.length===0?n:"",disabled:x,readOnly:y,autoFocus:k,onChange:j,onKeyDown:z,onFocus:V,onBlur:W,autoComplete:"off",...D}),_&&r.jsxs(i.Text,{fontSize:i.Typography.fontSizes[m],color:"color-gray-500",fontStyle:"italic",...f==null?void 0:f.placeholder,children:["Maximum ",I," tags reached"]})]})]}),u]})})},Gd=e=>{const o=un(e),{tags:t,...n}=e;return r.jsx(hn,{...o,...n})};function Yd(e){const o=setTimeout(e,0),t=setTimeout(e,10),n=setTimeout(e,50);return[o,t,n]}const fn=({value:e,defaultValue:o="",length:t=6,onChange:n,onChangeText:l,onComplete:a,onKeyDown:c,onKeyPress:d,onBlur:s,onFocus:u,isReadOnly:h,isDisabled:f,pattern:m,stepValues:p,pasteTransformer:b})=>{var Z,X;const x=e!==void 0,y=x?e:o,[k,w]=g.useState((y==null?void 0:y.slice(0,t))||""),[T,C]=g.useState(!1),[I,j]=g.useState(!1),[z,V]=g.useState(null),[W,H]=g.useState(null),S=g.useRef(null),B=g.useRef(null),A=g.useRef({value:k,onChange:n||(()=>{}),isIOS:typeof window<"u"&&((X=(Z=window==null?void 0:window.CSS)==null?void 0:Z.supports)==null?void 0:X.call(Z,"-webkit-touch-callout","none"))}),E=g.useRef({prev:[null,null,"none"]}),P=m?typeof m=="string"?new RegExp(m):m:null;g.useEffect(()=>{x&&e!==k&&w((e==null?void 0:e.slice(0,t))||"")},[x,e,t,k]);const $=g.useCallback(G=>{let Q=G;if(p&&p.length>0&&G){const R=parseInt(G,10);if(!isNaN(R)){let ee=p[0],re=Math.abs(R-ee);for(let ne=1;ne<p.length;ne++){const ge=Math.abs(R-p[ne]);ge<re&&(re=ge,ee=p[ne])}Q=ee.toString()}}w(Q),n&&n(Q),l&&l(Q),a&&Q.length===t&&a(Q)},[n,l,a,t,p]),_=g.useCallback(G=>{G&&S.current!==G&&Object.defineProperty(S,"current",{value:G,writable:!0})},[]),L=g.useCallback(G=>{const Q=G.currentTarget.value.slice(0,t);if(Q.length>0&&P&&!P.test(Q)){G.preventDefault();return}$(Q),S.current&&(S.current.value=Q)},[t,P,$,S]),D=g.useCallback(()=>{var G;if(S.current){const Q=Math.min(S.current.value.length,t-1),R=S.current.value.length;(G=S.current)==null||G.setSelectionRange(Q,R),V(Q),H(R)}C(!0)},[t]),F=g.useCallback(()=>{C(!1)},[]),q=g.useCallback(G=>{c&&c(G)},[]),O=g.useCallback(G=>{d&&d(G)},[]),N=g.useCallback(G=>{const Q=S.current;if(!G.clipboardData||!Q)return;const R=G.clipboardData.getData("text/plain"),ee=b?b(R):R;G.preventDefault();const re=Q.selectionStart||0,ne=Q.selectionEnd||0,Y=(re!==ne?k.slice(0,re)+ee+k.slice(ne):k.slice(0,re)+ee+k.slice(re)).slice(0,t);if(Y.length>0&&P&&!P.test(Y))return;Q.value=Y,$(Y),w(Y);const v=Math.min(Y.length,t-1),oe=Y.length;Q.setSelectionRange(v,oe),V(v),H(oe)},[t,b,P,$,k,w]);return g.useEffect(()=>{const G=S.current,Q=B.current;if(!G||!Q)return;A.current.value!==G.value&&A.current.onChange&&A.current.onChange(G.value),E.current.prev=[G.selectionStart,G.selectionEnd,G.selectionDirection];function R(){if(document.activeElement!==G){V(null),H(null);return}const ne=(G==null?void 0:G.selectionStart)??null,ge=(G==null?void 0:G.selectionEnd)??null,me=(G==null?void 0:G.selectionDirection)??null,Y=(G==null?void 0:G.maxLength)??0,v=(G==null?void 0:G.value)??"",oe=E.current.prev;let K=-1,J=-1,ie="none";if(v.length!==0&&ne!==null&&ge!==null){const ae=ne===ge,We=ne===v.length&&v.length<Y;if(ae&&!We){const Ie=ne;if(Ie===0)K=0,J=1,ie="forward";else if(Ie===Y)K=Ie-1,J=Ie,ie="backward";else if(Y>1&&v.length>1){let Kt=0;if(oe[0]!==null&&oe[1]!==null){ie=Ie<oe[1]?"backward":"forward";const i0=oe[0]===oe[1]&&oe[0]<Y;ie==="backward"&&!i0&&(Kt=-1)}K=Kt+Ie,J=Kt+Ie+1}}K!==-1&&J!==-1&&K!==J&&S.current&&S.current.setSelectionRange(K,J,ie)}const ue=K!==-1?K:ne,fe=J!==-1?J:ge,xe=ie!=="none"?ie:me;V(ue),H(fe),E.current.prev=[ue,fe,xe]}document.addEventListener("selectionchange",R,{capture:!0}),R(),document.activeElement===G&&C(!0);const ee=()=>{Q&&Q.style.setProperty("--root-height",`${G.clientHeight}px`)};ee();const re=new window.ResizeObserver(ee);return re.observe(G),()=>{document.removeEventListener("selectionchange",R,{capture:!0}),re.disconnect()}},[]),g.useEffect(()=>{Yd(()=>{var ee,re,ne,ge;(ee=S.current)==null||ee.dispatchEvent(new Event("input"));const G=(re=S.current)==null?void 0:re.selectionStart,Q=(ne=S.current)==null?void 0:ne.selectionEnd,R=(ge=S.current)==null?void 0:ge.selectionDirection;G!==null&&Q!==null&&G!==void 0&&Q!==void 0&&(V(G),H(Q),E.current.prev=[G,Q,R||"none"])})},[k,T]),{value:k,setValue:$,isFocused:T,setIsFocused:C,isHovered:I,setIsHovered:j,inputRef:S,containerRef:B,mirrorSelectionStart:z,mirrorSelectionEnd:W,setMirrorSelectionStart:V,setMirrorSelectionEnd:H,setInputRef:_,handleChange:L,handleFocus:D,handleBlur:F,handleKeyDown:q,handleKeyPress:O,handlePaste:N}},vd=g.createContext({slots:[],isFocused:!1,isHovering:!1}),Xd=`
|
|
4
|
+
${F} no-repeat,
|
|
5
|
+
${q} no-repeat
|
|
6
|
+
`,backgroundSize:`200% ${N}px, ${N}px 200%, 200% ${N}px, ${N}px 200%`,backgroundPosition:O,transitionProperty:"background-position",transitionDuration:`${W}s`,transitionTimingFunction:"linear",transitionDelay:X,_hover:{backgroundPosition:U,transitionDelay:Z},width:a?"fit-content":c?"100%":void 0,...f==null?void 0:f.container,...P,children:r.jsx(i.View,{as:t?"div":"button",disabled:!!(n||l),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:Math.max(0,H-3),width:"100%",height:"100%",...m,...p,...b,backgroundColor:(m==null?void 0:m.backgroundColor)||T,color:y,borderWidth:0,cursor:n?"default":"pointer",children:S})})}return r.jsx(i.Element,{ref:x,as:e==="link"&&t?"div":"button",type:e==="link"&&t?void 0:"button",disabled:!!(n||l),...p,...b,display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":c?"100%":void 0,borderRadius:co[s],boxShadow:u,transition:"background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",cursor:n?"default":"pointer",onClick:h,...m,...f==null?void 0:f.container,...P,children:S})},ai=d.memo(d.forwardRef(({variant:e="filled",size:o="md",shape:t="rounded",iconPosition:n="left",loaderPosition:l="left",backgroundColor:a,color:c,textColor:g,reversed:s=!1,isAuto:u=!0,isFilled:h,isDisabled:f,isLoading:m,isIconRounded:p,isHovered:b,icon:x,children:y,to:k,isExternal:I,shadow:T,onClick:C,views:w={},borderMovingDuration:j=2,borderMovingGradientColors:z=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:E="#705CFF",animatedStrokeTextColor:P="#333333",...H},S)=>{const{getColorHex:$}=i.useTheme();let V=$(f?"theme-disabled":m?"theme-loading":a??c??"theme-button-background");(V==="theme-button-background"||V==="theme-loading")&&(V=$(m?"color-dark-500":"theme-primary"));let W=$(g??"theme-button-text");W==="theme-button-text"&&(W=$("color-white"));const D=d.useMemo(()=>Rc(V,W,s),[V,W,s])[e],F=(D==null?void 0:D.color)??W,q=r.jsx(ei,{icon:x,isLoading:m,iconPosition:n,loaderPosition:l,size:o,resolvedTextColor:F,isIconRounded:p,views:w,children:y}),O=gr[o],U=p?ur[o]:{};return r.jsx(ni,{variant:e,animation:H.animation,to:k,isDisabled:f,isLoading:m,isAuto:u,isFilled:h,isExternal:I,shape:t,shadow:T,onClick:C,views:w,baseStyles:D,sizeStyles:O,iconPad:U,resolvedTextColor:F,content:q,size:o,mainTone:V,borderMovingDuration:j,borderMovingGradientColors:z,animatedStrokeAccentColor:E,animatedStrokeTextColor:P,getColor:$,containerRef:S,...H})})),_e=e=>{const[o,t]=i.useHover();return r.jsx(ai,{isHovered:t,...e})},li={sm:{padding:"12px"},md:{padding:"16px"},lg:{padding:"24px"}},ci={square:0,rounded:"8px",pill:"24px"},ii=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)"}}}},_o=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"}}},hr=d.createContext({}),yt=()=>d.useContext(hr),xt=({children:e,views:o,style:t,themeMode:n,...l})=>{var u;const a=i.useTheme(),{styles:c}=yt(),g=_o(a).header,s={...g,...c==null?void 0:c.header,...l,style:{...g==null?void 0:g.style,...(u=c==null?void 0:c.header)==null?void 0:u.style,...t}};return r.jsx(i.Vertical,{gap:8,...s,children:e})},kt=({children:e,views:o,style:t,themeMode:n,...l})=>{var u;const a=i.useTheme(),{styles:c}=yt(),g=_o(a).content,s={...g,...c==null?void 0:c.content,...l,style:{...g==null?void 0:g.style,...(u=c==null?void 0:c.content)==null?void 0:u.style,...t}};return r.jsx(i.Vertical,{gap:12,...s,children:e})},Ct=({children:e,views:o,style:t,themeMode:n,...l})=>{var u;const a=i.useTheme(),{styles:c}=yt(),g=_o(a).footer,s={...g,...c==null?void 0:c.footer,...l,style:{...g==null?void 0:g.style,...(u=c==null?void 0:c.footer)==null?void 0:u.style,...t}};return r.jsx(i.Vertical,{gap:8,...s,children:e})},si=({variant:e="default",size:o="md",shape:t="rounded",children:n,header:l,footer:a,isFullWidth:c=!1,views:g,style:s,themeMode:u,...h})=>{var C,w;const f=i.useTheme(),m=_o(f),p=((C=li[o])==null?void 0:C.padding)||"16px",b=d.useMemo(()=>({styles:{container:{...m.container,borderRadius:ci[t],...g==null?void 0:g.container},header:{...m.header,padding:p,...g==null?void 0:g.header},content:{...m.content,padding:p,...g==null?void 0:g.content},footer:{...m.footer,padding:p,...g==null?void 0:g.footer}}}),[m,g,p,t]),x=d.Children.toArray(n).some(j=>d.isValidElement(j)&&(j.type===xt||j.type===kt||j.type===Ct)),{themeMode:y}=f,I=ii(u||y)[e],T={width:c?"100%":"auto",overflow:"hidden",...I,...b.styles.container,...h,style:{...(w=b.styles.container)==null?void 0:w.style,...s}};return r.jsx(hr.Provider,{value:b,children:r.jsx(i.View,{...T,children:x?n:r.jsxs(i.Vertical,{width:"100%",children:[l&&r.jsx(xt,{children:l}),r.jsx(kt,{children:n}),a&&r.jsx(Ct,{children:a})]})})})},$o=e=>r.jsx(si,{...e});$o.Header=xt,$o.Content=kt,$o.Footer=Ct;const di=({defaultActiveIndex:e=0,activeIndex:o,onChange:t,autoPlay:n=!1,autoPlayInterval:l=3e3,pauseOnHover:a=!0,infinite:c=!0,totalSlides:g,stepIndices:s})=>{const u=d.useRef(g||0),[h,f]=d.useState(g||0),m=d.useRef(new Set),p=d.useRef(0),b=d.useMemo(()=>rt("carousel-content"),[]),[x,y]=d.useState(o!==void 0?o:e),[k,I]=d.useState(!1),[T,C]=d.useState(!1),[w,j]=d.useState(0),[z,E]=d.useState(0),P=d.useRef(null);d.useEffect(()=>{o!==void 0&&y(o)},[o]);const H=d.useCallback(O=>{let U=O;c?O<0?U=h-1:O>=h&&(U=0):U=Math.max(0,Math.min(O,h-1)),s&&s.length>0&&(s.includes(U)||(U=s.reduce((X,N)=>Math.abs(N-U)<Math.abs(X-U)?N:X))),o===void 0&&y(U),t&&t(U)},[o,c,t,h]),S=d.useCallback(()=>{H(x+1)},[x,H]),$=d.useCallback(()=>{H(x-1)},[x,H]);d.useEffect(()=>(n&&!k&&!T&&(P.current=setInterval(()=>{S()},l)),()=>{P.current&&clearInterval(P.current)}),[n,l,k,T,S,a]);const A=d.useCallback(()=>{a&&I(!0)},[a]),_=d.useCallback(()=>{I(!1)},[]),V=d.useCallback(O=>{C(!0),"touches"in O?(j(O.touches[0].clientX),E(O.touches[0].clientY)):(j(O.clientX),E(O.clientY))},[]),B=d.useCallback(O=>{if(!T)return;let U,Z;"touches"in O?(U=O.touches[0].clientX,Z=O.touches[0].clientY):(U=O.clientX,Z=O.clientY);const X=U-w,N=Z-z;Math.abs(X)>Math.abs(N)&&Math.abs(X)>50&&(X>0?$():S(),C(!1))},[T,w,z,S,$]),W=d.useCallback(()=>{C(!1)},[]),L=d.useCallback(()=>{const O=p.current++;m.current.add(O);const U=m.current.size;return u.current=U,f(U),O},[]),D=d.useCallback(O=>{m.current.delete(O);const U=m.current.size;if(u.current=U,f(U),U>0&&x>=U){const Z=Math.max(0,U-1);o===void 0&&y(Z),t&&t(Z)}},[x,o,t]),F=c||x>0,q=c||x<h-1;return{activeIndex:x,totalSlides:h,goToSlide:H,nextSlide:S,prevSlide:$,canGoNext:q,canGoPrevious:F,handleMouseEnter:A,handleMouseLeave:_,handleDragStart:V,handleDragMove:B,handleDragEnd:W,registerSlide:L,unregisterSlide:D,contentId:b,infinite:c}},gi={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"}},ui={dot:{backgroundColor:"theme-primary"},line:{backgroundColor:"theme-primary"},number:{backgroundColor:"theme-primary",color:"color-white"}},Ho={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"}},io=()=>({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,...Ho},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...Ho}}),fr=d.createContext(null),Bo=()=>{const e=d.useContext(fr);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},mr=({children:e,isActive:o,views:t,...n})=>r.jsx(i.View,{flexShrink:0,width:"100%",height:"100%",display:o?"block":"none",...t,...n,children:e}),pr=({views:e,children:o,...t})=>{const{goToPrevious:n,canGoPrevious:l,styles:a}=Bo(),g={...io().prevButton,...a==null?void 0:a.prevButton,...e==null?void 0:e.prevButton};return r.jsx(_e,{"aria-label":"Previous slide",onClick:()=>n(),isDisabled:!l,...g,...t,children:o??r.jsx(le,{orientation:"left",widthHeight:16})})},br=({views:e,children:o,...t})=>{const{goToNext:n,canGoNext:l,styles:a}=Bo(),g={...io().nextButton,...a==null?void 0:a.nextButton,...e==null?void 0:e.nextButton};return r.jsx(_e,{"aria-label":"Next slide",onClick:()=>n(),isDisabled:!l,...g,...t,children:o??r.jsx(le,{orientation:"right",widthHeight:16})})},yr=({children:e,views:o,...t})=>{const{registerSlide:n,unregisterSlide:l,styles:a}=Bo(),c=d.useRef(null);d.useEffect(()=>{const u=n();return c.current=u,()=>{c.current!==null&&l(c.current)}},[n,l]);const s={...io().item,...a==null?void 0:a.item,...o==null?void 0:o.item};return r.jsx(i.View,{role:"group","aria-roledescription":"slide",...s,...t,children:e})},xr=({children:e,views:o,style:t,...n})=>{const{currentIndex:l,styles:a,contentId:c}=Bo(),g=io(),s={...g.content,...a==null?void 0:a.content,...o==null?void 0:o.content},u={...g.innerContainer,...a==null?void 0:a.innerContainer,...o==null?void 0:o.innerContainer},h=`-${l*100}%`;return r.jsx(i.View,{...s,...n,style:{...s==null?void 0:s.style,...t},id:c,"aria-live":"polite",children:r.jsx(i.View,{...u,style:{...u==null?void 0:u.style,transform:`translateX(${h})`},children:e})})},hi=({children:e,defaultActiveIndex:o=0,activeIndex:t,onChange:n,showNavigation:l=!0,navigationPosition:a="inside",prevButton:c,nextButton:g,showIndicators:s=!0,indicatorPosition:u="bottom",indicatorVariant:h="dot",autoPlay:f=!1,autoPlayInterval:m=3e3,pauseOnHover:p=!0,infinite:b=!0,direction:x="horizontal",transitionDuration:y=300,views:k,stepIndices:I,themeMode:T,...C})=>{const w=d.useMemo(()=>d.Children.toArray(e),[e]),j=di({defaultActiveIndex:o,activeIndex:t,onChange:n,autoPlay:f,autoPlayInterval:m,pauseOnHover:p,infinite:b,totalSlides:w.length}),{activeIndex:z,totalSlides:E,goToSlide:P,nextSlide:H,prevSlide:S,handleMouseEnter:$,handleMouseLeave:A,handleDragStart:_,handleDragMove:V,handleDragEnd:B}=j,W=()=>{if(!l)return null;const F=c||r.jsx(i.View,{as:"button","aria-label":"Previous slide",...Ho,...k==null?void 0:k.prevButton,children:"❮"}),q=g||r.jsx(i.View,{as:"button","aria-label":"Next slide",...Ho,...k==null?void 0:k.nextButton,children:"❯"});return r.jsxs(r.Fragment,{children:[r.jsx(i.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",left:a==="inside"?"10px":"-40px",onClick:S,cursor:!b&&z===0?"not-allowed":"pointer",opacity:!b&&z===0?.5:1,children:F}),r.jsx(i.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",right:a==="inside"?"10px":"-40px",onClick:H,cursor:!b&&z===w.length-1?"not-allowed":"pointer",opacity:!b&&z===w.length-1?.5:1,children:q})]})},L=()=>s?r.jsx(i.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...u==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:w.map((F,q)=>r.jsx(i.View,{onClick:()=>P(q),cursor:"pointer",...gi[h],...q===z?{...ui[h]}:{},...k==null?void 0:k.indicator,...q===z?k==null?void 0:k.activeIndicator:{},children:h==="number"&&q+1},q))}):null;return d.useMemo(()=>d.Children.toArray(e).some(F=>d.isValidElement(F)&&(F.type===xr||F.type===yr||F.type===pr||F.type===br)),[e])?r.jsx(fr.Provider,{value:{currentIndex:z,totalSlides:E,goToSlide:P,goToNext:H,goToPrevious:S,canGoNext:j.canGoNext,canGoPrevious:j.canGoPrevious,registerSlide:j.registerSlide,unregisterSlide:j.unregisterSlide,styles:{...io(),...k},contentId:j.contentId,infinite:b},children:r.jsx(i.View,{role:"region","aria-roledescription":"carousel","aria-label":"Carousel",position:"relative",width:"100%",height:"100%",overflow:"hidden",...k==null?void 0:k.container,...C,children:e})}):r.jsxs(i.View,{position:"relative",width:"100%",height:"100%",overflow:"hidden",onMouseEnter:$,onMouseLeave:A,onTouchStart:_,onTouchMove:V,onTouchEnd:B,onMouseDown:_,onMouseMove:V,onMouseUp:B,...k==null?void 0:k.container,...C,children:[r.jsx(i.View,{width:"100%",height:"100%",position:"relative",...k==null?void 0:k.slideWrapper,children:w.map((F,q)=>r.jsx(mr,{isActive:q===z,index:q,views:k==null?void 0:k.slide,children:F},q))}),W(),L()]})},Oe=e=>r.jsx(hi,{...e});Oe.Slide=mr,Oe.Content=xr,Oe.Item=yr,Oe.Previous=pr,Oe.Next=br;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"},qe=[ke.blue,ke.green,ke.purple,ke.orange,ke.red,ke.teal,ke.pink,ke.indigo,ke.yellow,ke.cyan],fi={width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},mi={fontSize:"18px",fontWeight:"bold",marginBottom:"16px",textAlign:"center"},pi={display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"16px"},bi={display:"flex",alignItems:"center",marginRight:"16px",marginBottom:"8px"},yi={width:"12px",height:"12px",borderRadius:"2px",marginRight:"6px"},xi={fontSize:"14px"},kr={stroke:"color-gray-200",strokeWidth:"1px"},Lo={stroke:"color-gray-300",strokeWidth:"1px"},Ao={fontSize:"12px",fill:"color-gray-600"},ki={rx:"2px",ry:"2px",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},Ci={strokeWidth:"2px",fill:"none"},wi={r:"4px",strokeWidth:"2px",stroke:"white",cursor:"pointer",transition:"r 0.2s ease"},Do={strokeWidth:"1px",stroke:"white",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},wt={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"},Ii={...wt},Ti={...wt,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},ji={...wt,backgroundColor:"rgba(245, 245, 245, 0.8)",color:"color-gray-600"},Si=({data:e,dataPoints:o,animated:t=!0,animationDuration:n=500,showTooltips:l=!0})=>{const[a,c]=d.useState(t?0:1),[g,s]=d.useState({visible:!1,x:0,y:0,content:null}),u=d.useRef(null),h=d.useRef(null);d.useEffect(()=>{if(!t){c(1);return}const x=Date.now(),y=()=>{const k=Date.now()-x,I=Math.min(k/n,1);c(I),I<1&&(u.current=requestAnimationFrame(y))};return u.current=requestAnimationFrame(y),()=>{u.current&&cancelAnimationFrame(u.current)}},[t,n]);const f=d.useCallback(()=>e?{...e,series:e.series.map((x,y)=>({...x,color:x.color||qe[y%qe.length]}))}:o?o.map((x,y)=>({...x,color:x.color||qe[y%qe.length]})):null,[e,o]),m=d.useCallback((x,y,k)=>{l&&s({visible:!0,x,y,content:k})},[l]),p=d.useCallback(()=>{s(x=>({...x,visible:!1}))},[]),b=d.useCallback(()=>{if(!h.current)return{width:0,height:0};const{width:x,height:y}=h.current.getBoundingClientRect();return{width:x,height:y}},[]);return{animationProgress:a,tooltip:g,containerRef:h,processedData:f,showTooltip:m,hideTooltip:p,getChartDimensions:b}},Mi=({data:e,width:o,height:t,animationProgress:n,showGrid:l=!0,onBarClick:a,showTooltip:c,hideTooltip:g,views:s})=>{const{getColor:u}=i.useTheme(),h={top:20,right:20,bottom:40,left:50},f=o-h.left-h.right,m=t-h.top-h.bottom,p=d.useMemo(()=>{let w=0;return e.series.forEach(j=>{j.data.forEach(z=>{w=Math.max(w,z)})}),w},[e]),b=e.labels.length,x=e.series.length,y=f/b,k=y*.8/x,I=y*.2/(x+1),T=p||10,C=d.useMemo(()=>{const j=[];for(let z=0;z<=5;z++){const E=T/5*z;j.push(E)}return j},[p]);return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:h.left,y1:t-h.bottom,x2:o-h.right,y2:t-h.bottom,...Lo,...s==null?void 0:s.axis}),r.jsx("line",{x1:h.left,y1:h.top,x2:h.left,y2:t-h.bottom,...Lo,...s==null?void 0:s.axis}),e.labels.map((w,j)=>{const z=h.left+(j+.5)*y,E=t-h.bottom+20;return r.jsx("text",{x:z,y:E,textAnchor:"middle",...Ao,...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:w},`x-label-${j}`)}),C.map((w,j)=>{const z=t-h.bottom-w/T*m;return r.jsxs(d.Fragment,{children:[r.jsx("text",{x:h.left-10,y:z,textAnchor:"end",dominantBaseline:"middle",...Ao,...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:w.toFixed(0)}),l&&r.jsx("line",{x1:h.left,y1:z,x2:o-h.right,y2:z,...kr,...s==null?void 0:s.grid})]},`y-tick-${j}`)}),e.series.map((w,j)=>r.jsx(d.Fragment,{children:w.data.map((z,E)=>{const P=z/T*m*n,H=h.left+E*y+I*(j+1)+k*j,S=t-h.bottom-P,$=e.labels[E],A=e.series.reduce((L,D)=>{const F=D.data[E];return L+(typeof F=="number"?F:0)},0),_=A>0?(z/A*100).toFixed(1):null,V=w.color?u(w.color):"black",B=L=>{const D=r.jsxs(i.View,{display:"flex",flexDirection:"column",minWidth:"180px",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(i.Text,{fontWeight:"semibold",children:w.name}),r.jsx(i.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:V})]}),r.jsx(i.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:$}),r.jsxs(i.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Value"}),r.jsx(i.Text,{fontWeight:"medium",children:z.toLocaleString()})]}),_!==null&&r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Share"}),r.jsx(i.Text,{fontWeight:"medium",children:`${_}%`})]}),r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(i.Text,{fontWeight:"medium",children:A.toLocaleString()})]})]})]});c(L.clientX,L.clientY,D)},W=()=>{a&&a(w.name,E)};return r.jsx("rect",{x:H,y:S,width:k,height:P,fill:V,onMouseEnter:B,onMouseLeave:g,onClick:W,...ki,...s==null?void 0:s.bar},`bar-${j}-${E}`)})},`series-${j}`))]})},zi=({data:e,width:o,height:t,animationProgress:n,showGrid:l=!0,onPointClick:a,showTooltip:c,hideTooltip:g,views:s})=>{const{getColor:u}=i.useTheme(),h={top:20,right:20,bottom:40,left:50},f=o-h.left-h.right,m=t-h.top-h.bottom,p=d.useMemo(()=>{let I=0;return e.series.forEach(T=>{T.data.forEach(C=>{I=Math.max(I,C)})}),I},[e]),b=p||10,x=d.useMemo(()=>{const T=[];for(let C=0;C<=5;C++){const w=b/5*C;T.push(w)}return T},[p]),y=I=>`M ${I.map((C,w)=>{const j=h.left+w/(e.labels.length-1)*f,z=t-h.bottom-C/b*m*n;return`${j},${z}`}).join(" L ")}`,k=I=>{const T=h.left,C=h.left+f,w=t-h.bottom,j=I.map((z,E)=>{const P=h.left+E/(e.labels.length-1)*f,H=t-h.bottom-z/b*m*n;return`${P},${H}`});return`M ${T},${w} L ${j.join(" L ")} L ${C},${w} Z`};return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:h.left,y1:t-h.bottom,x2:o-h.right,y2:t-h.bottom,...Lo,...s==null?void 0:s.axis}),r.jsx("line",{x1:h.left,y1:h.top,x2:h.left,y2:t-h.bottom,...Lo,...s==null?void 0:s.axis}),e.labels.map((I,T)=>{const C=h.left+T/(e.labels.length-1)*f,w=t-h.bottom+20;return r.jsx("text",{x:C,y:w,textAnchor:"middle",...Ao,...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:I},`x-label-${T}`)}),x.map((I,T)=>{const C=t-h.bottom-I/b*m;return r.jsxs(d.Fragment,{children:[r.jsx("text",{x:h.left-10,y:C,textAnchor:"end",dominantBaseline:"middle",...Ao,...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:I.toFixed(0)}),l&&r.jsx("line",{x1:h.left,y1:C,x2:o-h.right,y2:C,...kr,...s==null?void 0:s.grid})]},`y-tick-${T}`)}),e.series.map((I,T)=>{const C=I.color?u(I.color):"black";return r.jsxs(d.Fragment,{children:[r.jsx("path",{d:k(I.data),fill:C,opacity:.1,...s==null?void 0:s.area}),r.jsx("path",{d:y(I.data),stroke:C,...Ci,...s==null?void 0:s.line}),I.data.map((w,j)=>{const z=h.left+j/(e.labels.length-1)*f,E=t-h.bottom-w/b*m*n,P=e.labels[j],H=e.series.reduce((W,L)=>{const D=L.data[j];return W+(typeof D=="number"?D:0)},0),S=H>0?(w/H*100).toFixed(1):null,$=j>0&&typeof I.data[j-1]=="number"?I.data[j-1]:null,A=typeof $=="number"?w-$:null,_=typeof A=="number"?`${A>=0?"+":""}${A.toLocaleString()}`:null,V=W=>{const L=r.jsxs(i.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(i.Text,{fontWeight:"semibold",children:I.name}),r.jsx(i.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:C})]}),r.jsx(i.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:P}),r.jsxs(i.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Value"}),r.jsx(i.Text,{fontWeight:"medium",children:w.toLocaleString()})]}),_!==null&&r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Change"}),r.jsx(i.Text,{fontWeight:"medium",children:_})]}),S!==null&&r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Share"}),r.jsx(i.Text,{fontWeight:"medium",children:`${S}%`})]}),r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(i.Text,{fontWeight:"medium",children:H.toLocaleString()})]})]})]});c(W.clientX,W.clientY,L)},B=()=>{a&&a(I.name,j)};return r.jsx("circle",{cx:z,cy:E,fill:C,onMouseEnter:V,onMouseLeave:g,onClick:B,...wi,...s==null?void 0:s.point},`point-${T}-${j}`)})]},`series-${T}`)})]})},Vi=({dataPoints:e,width:o,height:t,animationProgress:n,isDonut:l=!1,onSliceClick:a,showTooltip:c,hideTooltip:g,views:s})=>{const{getColor:u}=i.useTheme(),{ref:h,relation:f}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),m=d.useRef(null);d.useEffect(()=>{m.current&&h&&(h.current=m.current)},[m,h]);const b=Math.min(o,t)/2*.8,x=o/2,y=t/2,k=l?b*.6:0,I=d.useMemo(()=>e.reduce((C,w)=>C+w.value,0),[e]),T=d.useMemo(()=>{if(I===0)return[{path:l?[`M ${x} ${y-b}`,`A ${b} ${b} 0 1 1 ${x} ${y+b}`,`A ${b} ${b} 0 1 1 ${x} ${y-b}`,`M ${x} ${y-k}`,`A ${k} ${k} 0 1 0 ${x} ${y+k}`,`A ${k} ${k} 0 1 0 ${x} ${y-k}`,"Z"].join(" "):[`M ${x} ${y}`,`M ${x} ${y-b}`,`A ${b} ${b} 0 1 1 ${x} ${y+b}`,`A ${b} ${b} 0 1 1 ${x} ${y-b}`,"Z"].join(" "),color:"#E2E8F0",label:"Total",value:0,percentage:"0%",labelX:x,labelY:y,startAngle:0,endAngle:Math.PI*2,index:-1}];const C=[];let w=-Math.PI/2;for(let j=0;j<e.length;j++){const E=e[j].value/I,P=E*2*Math.PI*n,H=w+P,S=x+Math.cos(w)*b,$=y+Math.sin(w)*b,A=x+Math.cos(H)*b,_=y+Math.sin(H)*b,V=x+Math.cos(w)*k,B=y+Math.sin(w)*k,W=x+Math.cos(H)*k,L=y+Math.sin(H)*k,D=P>Math.PI?1:0;let F;l?F=[`M ${S} ${$}`,`A ${b} ${b} 0 ${D} 1 ${A} ${_}`,`L ${W} ${L}`,`A ${k} ${k} 0 ${D} 0 ${V} ${B}`,"Z"].join(" "):F=[`M ${x} ${y}`,`L ${S} ${$}`,`A ${b} ${b} 0 ${D} 1 ${A} ${_}`,"Z"].join(" ");const q=w+P/2,O=b*.7,U=x+Math.cos(q)*O,Z=y+Math.sin(q)*O,X=`${(E*100).toFixed(1)}%`,N=e[j].color||qe[j%qe.length],Q=u(N);C.push({path:F,color:Q,label:e[j].label,value:e[j].value,percentage:X,labelX:U,labelY:Z,startAngle:w,endAngle:H,index:j}),w=H}return C},[e,I,b,x,y,k,n,l]);return r.jsxs("svg",{ref:m,width:o,height:t,style:{overflow:"visible"},children:[l&&r.jsx("circle",{cx:x,cy:y,r:k,fill:"white",pointerEvents:"none"}),T.map((C,w)=>{const j=P=>{const H=I>0?C.value/I*100:0,S=I>0?Math.max(0,100-H):null,$=r.jsxs(i.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(i.Text,{fontWeight:"semibold",children:C.label}),r.jsx(i.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:C.color})]}),r.jsxs(i.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:["Slice ",C.index+1," of ",e.length]}),r.jsxs(i.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(i.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Value"}),r.jsx(i.Text,{fontWeight:"medium",children:C.value.toLocaleString()})]}),r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Share"}),r.jsx(i.Text,{fontWeight:"medium",children:C.percentage})]}),r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Total"}),r.jsx(i.Text,{fontWeight:"medium",children:I.toLocaleString()})]}),S!==null&&r.jsxs(i.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(i.Text,{color:"color-gray-500",children:"Remaining"}),r.jsx(i.Text,{fontWeight:"medium",children:`${S.toFixed(1)}%`})]})]})]});let A=P.clientX,_=P.clientY;if(f&&m.current){const V=m.current.getBoundingClientRect();P.clientX-V.left,P.clientY-V.top,f.space.horizontal==="left"?A=P.clientX-100:A=P.clientX+10,f.space.vertical==="top"?_=P.clientY-30:_=P.clientY+10}c(A,_,$)},z=()=>{C.index!==-1&&a&&a(e[C.index],C.index)},E=C.index===-1;return r.jsxs("g",{children:[r.jsx("path",{d:C.path,fill:C.color,onMouseEnter:E?void 0:j,onMouseLeave:E?void 0:g,onClick:z,...Do,style:{...Do==null?void 0:Do.style,cursor:E?"default":"pointer"},...s==null?void 0:s.pie}),!E&&C.endAngle-C.startAngle>.2&&r.jsx("text",{x:C.labelX,y:C.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:C.percentage})]},`slice-${w}`)})]})},Ei=({visible:e,x:o,y:t,content:n,maxDistance:l=100,views:a})=>{const c=d.useRef(null),[g,s]=d.useState({left:0,top:0});return d.useEffect(()=>{if(!e||!c.current)return;const h=c.current.getBoundingClientRect(),f=h.width,m=h.height,p=10,b=15;let x=o-b,y=t-b;const k=o-x,I=t-y;k>l&&(x=o-l),I>l&&(y=t-l),x+f>window.innerWidth-p&&(x=window.innerWidth-f-p,o-x>l&&(x=o-l)),x<p&&(x=p),y+m>window.innerHeight-p&&(y=window.innerHeight-m-p,t-y>l&&(y=t-l)),y<p&&(y=p),s({left:x,top:y})},[e,o,t,l]),e?r.jsx(i.View,{ref:c,position:"fixed",left:`${g.left}px`,top:`${g.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},Pi=({type:e,data:o,dataPoints:t,title:n,showLegend:l=!0,legendPosition:a="bottom",showGrid:c=!0,showTooltips:g=!0,animated:s=!0,animationDuration:u=500,responsive:h=!0,aspectRatio:f=16/9,width:m=200,height:p=200,views:b,onDataPointClick:x,onSeriesClick:y,isLoading:k=!1,error:I,noData:T,loadingIndicator:C,errorIndicator:w,noDataIndicator:j,"aria-label":z,themeMode:E,...P})=>{const{animationProgress:H,tooltip:S,containerRef:$,processedData:A,showTooltip:_,hideTooltip:V,getChartDimensions:B}=Si({data:o,dataPoints:t,animated:s,animationDuration:u,showTooltips:g}),W=A(),{width:L,height:D}=B(),F=m||L,q=p||(h?L/f:D),O=()=>{if(!l||!W)return null;let ee=[];return e==="pie"||e==="donut"?Array.isArray(W)&&(ee=W):W&&W.series&&(ee=W.series),!ee||ee.length===0?null:r.jsx(i.Horizontal,{flexWrap:"wrap",justifyContent:"center",marginTop:a==="bottom"?"16px":0,marginBottom:a==="top"?"16px":0,...pi,...b==null?void 0:b.legend,children:ee.map((re,ne)=>r.jsxs(i.View,{...bi,...b==null?void 0:b.legendItem,children:[r.jsx(i.View,{backgroundColor:re.color,...yi}),r.jsx(i.Text,{...xi,children:re.name||re.label})]},`legend-${ne}`))})},U=()=>{if(!W)return null;switch(e){case"bar":return r.jsx(Mi,{data:W,width:F,height:q,animationProgress:H,showGrid:c,onBarClick:y,showTooltip:_,hideTooltip:V,views:b});case"line":case"area":return r.jsx(zi,{data:W,width:F,height:q,animationProgress:H,showGrid:c,onPointClick:y,showTooltip:_,hideTooltip:V,views:b});case"pie":case"donut":return r.jsx(Vi,{dataPoints:W,width:F,height:q,animationProgress:H,isDonut:e==="donut",onSliceClick:x,showTooltip:_,hideTooltip:V,views:b});default:return null}},Z=()=>k?r.jsx(i.View,{...Ii,...b==null?void 0:b.loadingOverlay,children:C||r.jsx(i.Center,{children:r.jsx(no,{size:"lg"})})}):null,X=()=>I?r.jsx(i.View,{...Ti,...b==null?void 0:b.errorOverlay,children:w||r.jsx(i.Text,{fontWeight:"medium",children:typeof I=="string"?I:"An error occurred"})}):null,N=()=>T?r.jsx(i.View,{...ji,...b==null?void 0:b.noDataOverlay,children:j||r.jsx(i.Text,{children:typeof T=="string"?T:"No data available"})}):null,Q=z??(typeof n=="string"?n:"Chart"),R=!I&&!k&&!T;return r.jsxs(i.View,{ref:$,role:"region","aria-label":Q,"aria-busy":k,...fi,...b==null?void 0:b.container,...P,children:[n&&r.jsx(i.Text,{...mi,children:n}),R&&a==="top"&&O(),r.jsxs(i.View,{flex:1,width:"100%",position:"relative",...b==null?void 0:b.chart,children:[R&&U(),Z(),X(),N()]}),R&&a==="bottom"&&O(),r.jsx(Ei,{visible:g&&S.visible,x:S.x,y:S.y,content:S.content,maxDistance:100,views:b})]})},Wi=e=>r.jsx(Pi,{...e}),_i=(e=365)=>{const[o,t]=d.useState(!1),[n,l]=d.useState(null),a="app-studio-cookie-consent";d.useEffect(()=>{const u=localStorage.getItem(a);l(u!==null?u==="true":!1)},[]);const c=u=>{localStorage.setItem(a,String(u));const h=new Date;h.setDate(h.getDate()+e),localStorage.setItem(`${a}-expires`,h.toISOString()),l(u)};return{isHovered:o,setIsHovered:t,hasConsent:n,acceptCookies:()=>{c(!0)},resetConsent:()=>{localStorage.removeItem(a),localStorage.removeItem(`${a}-expires`),l(!1)}}},$i=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"}}}},Hi=({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:l="bottom",variant:a="default",onAccept:c,onCustomize:g,views:s,showCustomizeButton:u=!0,cookieExpiration:h=365,themeMode:f,...m})=>{const{themeMode:p}=i.useTheme(),b=f||p||"light",{hasConsent:x,acceptCookies:y}=_i(h),I=$i(b)[a];if(x)return null;const T=()=>{y(),c&&c()},C=()=>{g&&g()};return r.jsx(i.View,{style:{position:"fixed",left:16,right:16,zIndex:1e3,...l==="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",...I.container,...s==null?void 0:s.container,...m,children:r.jsxs(i.Vertical,{gap:12,maxWidth:1200,marginLeft:"auto",marginRight:"auto",children:[e&&r.jsx(i.Text,{fontWeight:"bold",fontSize:18,color:"color-black",...s==null?void 0:s.title,children:e}),o&&r.jsx(i.Text,{fontSize:14,color:"color-black",...s==null?void 0:s.description,children:o}),r.jsxs(i.Horizontal,{gap:12,justifyContent:"flex-end",marginTop:8,...s==null?void 0:s.buttonGroup,children:[u&&r.jsx(_e,{variant:"outline",onClick:C,size:"sm",...s==null?void 0:s.customizeButton,children:n}),r.jsx(_e,{variant:"primary",onClick:T,size:"sm",...s==null?void 0:s.acceptButton,children:t})]})]})})},Bi=e=>r.jsx(Hi,{...e}),Li=e=>{const{size:o,variant:t,onOpenChange:n}=e||{},[l,a]=d.useState(!1),[c,g]=d.useState({x:0,y:0}),[s,u]=d.useState(null),h=d.useRef(null),f=d.useRef(null),m=d.useMemo(()=>rt("contextmenu-content"),[]),p=d.useCallback(x=>{g({x:x.clientX,y:x.clientY}),a(!0),n==null||n(!0)},[n]),b=d.useCallback(()=>{a(!1),u(null),n==null||n(!1)},[n]);return d.useEffect(()=>{const x=I=>{f.current&&!f.current.contains(I.target)&&b()},y=()=>{l&&b()},k=I=>{I.key==="Escape"&&l&&b()};return document.addEventListener("mousedown",x),window.addEventListener("resize",y),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",x),window.removeEventListener("resize",y),document.removeEventListener("keydown",k)}},[l,b]),{isOpen:l,setIsOpen:a,position:c,setPosition:g,activeSubmenuId:s,setActiveSubmenuId:u,size:o,variant:t,triggerRef:h,contentRef:f,contentId:m,openMenu:p,closeMenu:b}},Cr={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Ai={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"}},wr={hover:{backgroundColor:"color-gray-100"}},Ir=d.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:()=>{}}),Di=({children:e,value:o})=>r.jsx(Ir.Provider,{value:o,children:e}),Fo=()=>{const e=d.useContext(Ir);if(!e)throw new Error("useContextMenuContext must be used within a ContextMenuProvider");return e},Tr=({children:e,disableNativeContextMenu:o=!0,asChild:t=!1,isDisabled:n=!1,views:l,...a})=>{const{triggerRef:c,contentId:g,openMenu:s}=Fo(),h={ref:c,onContextMenu:f=>{if(!n)if(o&&f.preventDefault(),s)s(f);else{const{setIsOpen:m,setPosition:p}=Fo();p({x:f.clientX,y:f.clientY}),m(!0)}},"aria-controls":g,"aria-haspopup":"menu","data-disabled":n?"":void 0,...t&&d.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:n},...l==null?void 0:l.container,...a};if(t&&d.isValidElement(e)){const f=d.Children.only(e);return d.cloneElement(f,{...h,...f.props})}return r.jsx(i.View,{...h,children:e})},It=({items:e,children:o,position:t,side:n="right",align:l="start",views:a,style:c,...g})=>{const{isOpen:s,position:u,contentRef:h,contentId:f,variant:m}=Fo(),p=d.useRef(null),b=h||p,{ref:x,relation:y}=i.useElementPosition({}),[k,I]=d.useState({x:0,y:0});if(d.useEffect(()=>{if(s&&b.current){const C=t||u,w=b.current.offsetWidth,j=b.current.offsetHeight,z=window.innerWidth,E=window.innerHeight;let P=C.x,H=C.y;y&&(y.space.horizontal==="left"?P=C.x-w:P=C.x,y.space.vertical==="top"?H=C.y-j:H=C.y),P+w>z&&(P=z-w-8),P<8&&(P=8),H+j>E&&(H=E-j-8),H<8&&(H=8),I({x:P,y:H})}},[s,u,t,n,l,b,y]),!s)return null;const T={position:"fixed",top:`${k.y}px`,left:`${k.x}px`,zIndex:1e3,transformOrigin:"top left"};return r.jsxs(i.View,{id:f||"context-menu",ref:b,role:"menu",tabIndex:-1,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:{...T,...c},...Ai[m],...a==null?void 0:a.menu,...a==null?void 0:a.content,...g,children:[e&&e.map((C,w)=>C.divider?r.jsx(Sr,{views:a},`divider-${w}`):r.jsx(jr,{item:C,views:a},C.id)),o]})},jr=({item:e,children:o,onSelect:t,isDisabled:n=!1,views:l,...a})=>{const{activeSubmenuId:c,setActiveSubmenuId:g,size:s,closeMenu:u}=Fo();if(e){const[f,m]=d.useState(!1),p=e.items&&e.items.length>0,b=c===e.id,[x,y]=d.useState({x:0,y:0}),k=e.disabled||n,I=()=>{m(!0),p&&g(e.id)},T=()=>{m(!1)},C=()=>{k||!p&&e.onClick&&(e.onClick(),u&&u())},{ref:w,relation:j}=i.useElementPosition({});return d.useEffect(()=>{if(b&&w.current){const z=w.current.getBoundingClientRect(),E=window.innerWidth,P=200;let H=!1;if(j)H=j.space.horizontal==="left";else{const S=E-z.right,$=z.left;H=S<P&&$>S}y({x:H?z.left-P:z.right,y:z.top})}},[b,e.items,j]),r.jsxs(i.View,{ref:w,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,...Cr[s],_hover:k?{}:wr.hover,backgroundColor:f&&!k?"color-gray-100":"transparent",onMouseEnter:I,onMouseLeave:T,onClick:C,...l==null?void 0:l.item,...a,children:[e.icon&&r.jsx(i.View,{marginRight:8,...l==null?void 0:l.icon,children:e.icon}),r.jsx(i.View,{flexGrow:1,children:e.label}),p&&r.jsx(i.View,{marginLeft:8,...l==null?void 0:l.submenuIndicator,children:r.jsx(le,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),b&&p&&r.jsx(It,{items:e.items||[],position:x,side:"right",align:"start",views:l})]})}const h=f=>{n||(t==null||t(f),u&&u())};return r.jsx(i.View,{role:"menuitem",onClick:h,cursor:n?"not-allowed":"pointer",opacity:n?.5:1,"aria-disabled":n,"data-disabled":n?"":void 0,...Cr[s],_hover:n?{}:wr.hover,...l==null?void 0:l.item,...a,children:o})},Sr=({views:e,...o})=>r.jsx(i.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.divider,...o}),Fi=({views:e,...o})=>r.jsx(i.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.separator,...o}),Oi=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:l=!0,views:a,themeMode:c,...g})=>!o||o.length===0?r.jsx(r.Fragment,{children:e}):r.jsxs(r.Fragment,{children:[r.jsx(Tr,{disableNativeContextMenu:l,views:a,...g,children:e}),r.jsx(It,{items:o,views:a})]}),Ne=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:l=!0,onOpenChange:a,views:c,...g})=>{const s=Li({size:t,variant:n,onOpenChange:a}),{isOpen:u,setIsOpen:h,position:f,setPosition:m,activeSubmenuId:p,setActiveSubmenuId:b,triggerRef:x,contentRef:y,contentId:k,openMenu:I,closeMenu:T}=s;return r.jsx(Di,{value:{isOpen:u,setIsOpen:h,position:f,setPosition:m,activeSubmenuId:p,setActiveSubmenuId:b,size:t,variant:n,triggerRef:x,contentRef:y,contentId:k,openMenu:I,closeMenu:T,styles:c},children:r.jsx(Oi,{items:o,size:t,variant:n,disableNativeContextMenu:l,views:c,...g,children:e})})};Ne.Trigger=Tr,Ne.Content=It,Ne.Item=jr,Ne.Divider=Sr,Ne.Separator=Fi;const qi=({src:e,color:o,views:t,themeMode:n,...l})=>{const{getColor:a,themeMode:c}=i.useTheme(),g=o?{fill:a(o,{themeMode:c}),stroke:a(o,{themeMode:c})}:{};return r.jsx(i.Center,{...l,...t==null?void 0:t.container,children:r.jsx(i.Image,{...g,content:'url("'+e+'")',width:"100%",height:"100%",...t==null?void 0:t.image})})},Ni=({path:e,...o})=>r.jsx(i.Image,{src:e,...o}),Mr=({placeholder:e,isMulti:o,options:t,id:n=`select-${Math.random().toString(36).substr(2,9)}`})=>{const l=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,c]=d.useState(!1),[g,s]=d.useState(!1),[u,h]=d.useState(l),[f,m]=d.useState(0),[p,b]=d.useState(!0);return{id:n,value:u,setValue:h,hide:p,setHide:b,isHovered:a,setIsHovered:c,isFocused:g,setIsFocused:s,highlightedIndex:f,setHighlightedIndex:m}},zr=({children:e,containerId:o="portal-root"})=>{const[t,n]=d.useState(null);return d.useEffect(()=>{let l=document.getElementById(o),a=!1;return l||(a=!0,l=document.createElement("div"),l.setAttribute("id",o),document.body.appendChild(l)),n(l),()=>{a&&l&&l.parentNode&&l.childNodes.length===0&&l.parentNode.removeChild(l)}},[o]),t?Ka.createPortal(e,t):null},Tt=({children:e,views:o={helperText:{}},...t})=>r.jsx(i.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}),Te=d.forwardRef(({children:e,helperText:o,error:t=!1,views:n,...l},a)=>r.jsxs(i.Vertical,{ref:a,gap:8,position:"relative",width:"100%",marginVertical:4,...l,...n==null?void 0:n.container,children:[e,!t&&o&&r.jsx(Tt,{marginTop:4,...n==null?void 0:n.helperText,children:o}),t&&r.jsx(i.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})]}));Te.displayName="FieldContainer";const Vr={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},Er={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},Pr={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"}}},Ui={paddingTop:"16px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"12px",paddingBottom:"6px",paddingLeft:"12px",paddingRight:"12px"}}},Gi={paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"12px",paddingRight:"12px"}}},Me=({label:e,shadow:o,children:t,value:n,size:l="md",shape:a="default",variant:c="default",error:g=!1,showLabel:s=!1,isFocused:u=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:m=!1,views:p={pickerBox:{}},...b})=>{const y=g?"color-red-500":(h||u)&&!f?"theme-primary":"color-gray-300";return r.jsx(i.Horizontal,{gap:8,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",marginBottom:2,borderStyle:"solid",borderColor:y,backgroundColor:"color-white",fontSize:i.Typography.fontSizes[l],cursor:f?"not-allowed":m?"auto":"text",opacity:f?.7:1,transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out, opacity 200ms ease-out",...s?Ui:Gi,...o,...Vr[a],...Pr[c],...p==null?void 0:p.container,...b,children:t})},jt=({children:e,...o})=>r.jsx(i.Center,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",...o,children:e}),Yi={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}},vi=({children:e,heading:o,isItalic:t=!1,isUnderlined:n=!1,isStriked:l=!1,weight:a="normal",size:c="sm",dropDown:g,...s})=>{const u=o?Yi[o]:{};return r.jsx(i.Element,{as:"label",width:"100%",fontSize:c,fontStyle:t?"italic":"normal",fontWeight:i.Typography.fontWeights[a],textDecoration:l?"line-through":n?"underline":"none",...u,...s,children:e})},so=e=>r.jsx(vi,{...e}),$e=({children:e,size:o="md",error:t=!1,color:n="theme-primary",views:l={label:{}},helperText:a,...c})=>r.jsx(so,{top:0,zIndex:-10,position:"absolute",fontSize:Er[o],lineHeight:Er[o],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:t?"color-red-500":n,transition:"color 200ms ease-out",...l.label,...c,children:e}),Ue=({children:e,...o})=>r.jsx(i.Vertical,{width:"100%",maxWidth:"100%",position:"relative",...o,children:e}),Wr={xs:12,sm:14,md:16,lg:20,xl:24},Xi={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)"},Ki={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)"}},Qi={padding:"10px 12px",cursor:"pointer",borderRadius:"6px",margin:"2px 4px",transition:"background-color 0.15s ease"},Oo={default:{backgroundColor:"transparent"},highlighted:{backgroundColor:"color-gray-100"},selected:{backgroundColor:"color-gray-100"},selectedHighlighted:{backgroundColor:"color-gray-200"}},_r={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)"}},Zi={padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},Ji={scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.15) transparent"},Ri=({isHovered:e,setIsHovered:o,option:t,size:n="md",callback:l=()=>{},style:a,isSelected:c=!1,...g})=>{const s=(f,m)=>{f.stopPropagation(),f.preventDefault(),typeof l=="function"&&l(m)},u=()=>o(!e),h=()=>c&&e?Oo.selectedHighlighted:c?Oo.selected:e?Oo.highlighted:Oo.default;return r.jsxs(i.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...Qi,...h(),onMouseEnter:u,onMouseLeave:u,onClick:f=>s(f,t.value),...g,children:[r.jsx(i.Text,{fontSize:i.Typography.fontSizes[n],fontWeight:c?"500":"400",lineHeight:"1.4",color:c?"color-gray-900":"color-gray-700",...a,children:t.label}),c&&r.jsx(i.Element,{as:"span",color:"theme-primary",fontSize:"14px",marginLeft:8,display:"flex",alignItems:"center",children:"✓"})]})},es=({size:e="md",views:o={field:{},text:{}},value:t,isDisabled:n,placeholder:l,removeOption:a=()=>{},options:c})=>{const g={margin:0,width:"95%",height:"100%",border:"none",paddingVertical:4,paddingHorizontal:0,fontSize:i.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=c.length>0&&c.find(u=>u.value===t);return r.jsx(i.Text,{...g,children:(t===""||Array.isArray(t)&&t.length===0)&&l?l:r.jsx(r.Fragment,{children:typeof t=="string"?(s&&s.label)??t:Array.isArray(t)&&t.length>0?r.jsx(i.Horizontal,{gap:6,children:t.map(u=>r.jsx(rs,{option:u,removeOption:a},u))}):r.jsx("span",{children:t})})})},os=({id:e,name:o,value:t,onChange:n,isMulti:l=!1,isDisabled:a=!1,isReadOnly:c=!1,options:g=[],...s})=>{const u=h=>{n&&n(h)};return r.jsx(i.Element,{id:e,name:o,as:"select",opacity:0,width:0,height:0,position:"absolute",value:t,disabled:a,readOnly:c,onChange:u,multiple:l,...s,children:g.length>0&&g.map(h=>r.jsx("option",{value:h.value,children:h.label},h.value))})},ts=({size:e,views:o={},options:t,callback:n=()=>{},highlightedIndex:l,setHighlightedIndex:a,selectedValue:c})=>{const g=u=>n(u),s=u=>Array.isArray(c)?c.includes(u):c===u;return r.jsx(i.Element,{as:"ul",role:"listbox",display:"flex",flexDirection:"column",margin:0,padding:"4px",...Xi,style:Ji,...o==null?void 0:o.dropDown,children:t&&t.length>0&&t.map((u,h)=>r.jsx(Ri,{size:e,style:o.text,option:u,callback:g,isSelected:s(u.value),isHovered:h===l,setIsHovered:()=>{},onMouseEnter:()=>a(h)},u.value))})},rs=({option:e,size:o="md",removeOption:t=()=>{},...n})=>{const l=()=>t(e);return r.jsxs(i.Horizontal,{gap:6,alignItems:"center",onClick:a=>a.stopPropagation(),...Zi,_hover:{backgroundColor:"color-gray-200"},...n,children:[r.jsx(i.Text,{fontSize:i.Typography.fontSizes[o],fontWeight:"500",color:"color-gray-700",children:e}),r.jsx(pe,{role:"close-button",color:"color-gray-500",widthHeight:Wr[o],onClick:l,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},$r=({id:e,name:o,label:t,value:n,placeholder:l,helperText:a,hide:c=!1,error:g=!1,isMulti:s=!1,isFocused:u=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:m=!1,options:p=[],shadow:b={},size:x="md",shape:y="default",variant:k="default",views:I={text:{},icon:{},dropDown:{},selectBox:{},label:{},helperText:{}},onChange:T=()=>{},setHide:C=()=>{},setValue:w=()=>{},setIsHovered:j=()=>{},setIsFocused:z=()=>{},setHighlightedIndex:E,highlightedIndex:P,...H})=>{const{ref:S,relation:$,updateRelation:A}=i.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),_=d.useRef(null),V=()=>{var X;if(!S.current)return{};const O=S.current.getBoundingClientRect(),U={position:"fixed",left:O.left,width:O.width,zIndex:1e4};return((X=$==null?void 0:$.space)==null?void 0:X.vertical)==="top"?{...U,bottom:window.innerHeight-O.top+8}:{...U,top:O.bottom+8}};d.useEffect(()=>{const O=()=>C(!0);return document.addEventListener("closeAllSelects",O),()=>document.removeEventListener("closeAllSelects",O)},[C]),d.useEffect(()=>{const O=U=>{!U.target.closest(`#${e}`)&&!c&&C(!0)};return document.addEventListener("click",O),()=>{document.removeEventListener("click",O)}},[e,c,C]);const B=!!(u&&t),W=()=>j(!h),L=()=>z(!0),D=O=>{document.dispatchEvent(new Event("closeAllSelects")),O&&O.stopPropagation&&O.stopPropagation();const U=!c;C(U),z(!U)},F=d.useCallback(O=>{if(C(!0),document.dispatchEvent(new Event("closeAllSelects")),s&&Array.isArray(n)){if(!n.includes(O)){const U=[...n,O];w(U),T&&T(O)}}else w(O),T&&T(O);z(!0)},[s,n,C,w,T,z]),q=O=>{if(Array.isArray(n)&&n.includes(O)){const U=n.filter(Z=>Z!==O);w(U.length===0?[]:U)}};return r.jsx(Te,{ref:S,position:"relative",width:"100%",display:"inline-block",id:e,role:"SelectBox",helperText:a,error:g,views:I,onClick:O=>{O.stopPropagation(),f||m||D(O)},children:r.jsxs(Me,{label:t,size:x,error:g,shape:y,views:I,shadow:b,variant:k,value:n,color:"theme-primary",isHovered:h,isDisabled:f,isReadOnly:m,isFocused:u,showLabel:B,onMouseEnter:W,onMouseLeave:W,position:"relative",children:[r.jsxs(Ue,{children:[B&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:g,...I,children:t}),r.jsx(os,{id:e,name:o,options:p,onChange:T,value:n,isDisabled:f,isReadOnly:m,isMulti:s,onFocus:L,...H}),r.jsx(es,{options:p,size:x,views:I,value:n,isDisabled:f,placeholder:l,removeOption:q})]}),r.jsx(jt,{children:!m&&!f&&r.jsx(i.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:c?_r.closed:_r.open,children:r.jsx(le,{color:"inherit",widthHeight:Wr[x],style:I.icon,orientation:"down"})})}),!c&&p.length>0&&r.jsx(zr,{children:r.jsx(i.Element,{ref:_,onClick:O=>O.stopPropagation(),style:{...V(),...Ki.enter},children:r.jsx(ts,{size:x,views:I,options:p,callback:F,highlightedIndex:P,setHighlightedIndex:E,selectedValue:n})})})]})})},ns=e=>{const o={...e,options:e.options||[]},t=Mr(o);return r.jsx($r,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},Hr=({isDisabled:e,isChecked:o})=>{const[t,n]=d.useState(!1),[l,a]=d.useState(o||!1),[c,g]=d.useState(o||!1);return d.useEffect(()=>{o!==void 0&&(a(o),g(o))},[o]),{isHovered:t,setIsHovered:n,on:l,setOn:a,value:c,setValue:g}},as={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"}},ls={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"}},cs={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}},He={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}}},Br={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)"}},is=e=>r.jsx(i.Input,{type:"checkbox",...e}),Lr=({id:e,name:o,label:t,inActiveChild:n,isChecked:l,activeChild:a,labelPosition:c="right",shadow:g={},size:s="sm",value:u=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:m=!1,on:p,setOn:b,onChange:x,setValue:y=()=>{},setIsHovered:k=()=>{},helperText:I,views:T={slider:{},circle:{},label:{}},...C})=>{const w=P=>{if(!m&&!f){const H=P.target.checked;y(H),b(H),x&&x(H)}},j=()=>k(!0),z=()=>k(!1),E={container:{gap:12,display:"flex",height:"fit-content",width:"fit-content",alignItems:"center",cursor:f?"not-allowed":m?"default":"pointer",opacity:f?.6:1,transition:"all 0.2s ease",...T.label}};return r.jsxs(so,{htmlFor:e,onMouseEnter:j,onMouseLeave:z,...E.container,...C,children:[r.jsx(is,{id:e,name:o,opacity:0,width:0,height:0,checked:u,onChange:w,disabled:f,readOnly:m,...C}),c==="left"&&t&&r.jsx(i.Text,{fontWeight:"500",color:f?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t}),r.jsxs(i.View,{display:"flex",alignItems:"center",justifyContent:u?a?"space-between":"flex-end":n?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:f?He.default.disabled:u?h?He.states.hover.active:He.default.active:h?He.states.hover.inactive:He.default.inactive,opacity:!f&&u&&h?He.states.hover.activeOpacity:1,cursor:"pointer",...Br.slider,...g,...cs[s],...ls[s],...T.slider,children:[a&&u&&r.jsx(i.View,{marginLeft:8,marginRight:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:a}),r.jsx(i.View,{borderRadius:"50%",backgroundColor:He.default.knob,boxShadow:h?"0 2px 4px rgba(0, 0, 0, 0.2)":"0 1px 2px rgba(0, 0, 0, 0.1)",transform:h?"scale(1.05)":"scale(1)",...Br.knob,zIndex:1,...as[s],...T.circle}),n&&!u&&r.jsx(i.View,{marginRight:8,marginLeft:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:n})]}),c==="right"&&t&&r.jsx(i.Text,{fontWeight:"500",color:f?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t})]})},ss=e=>{const o=Hr(e);return r.jsx(Lr,{...o,...e})},Ar=({placeholder:e,isMulti:o,options:t,id:n=`selector-${Math.random().toString(36).substr(2,9)}`})=>{const l=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,c]=d.useState(!1),[g,s]=d.useState(!1),[u,h]=d.useState(l),[f,m]=d.useState(0),[p,b]=d.useState(!0);return{id:n,value:u,setValue:h,hide:p,setHide:b,isHovered:a,setIsHovered:c,isFocused:g,setIsFocused:s,highlightedIndex:f,setHighlightedIndex:m}},Dr=({id:e,name:o,label:t,value:n,size:l,views:a={},options:c=[],onChange:g=()=>{},setValue:s=()=>{},...u})=>{const{getColor:h}=i.useTheme(),f=d.useCallback(m=>{s(m.value),g&&g(m.value)},[s,g]);return r.jsxs(Te,{id:e,width:"100%",views:a,children:[t&&r.jsxs(i.Horizontal,{fontSize:"10px",letterSpacing:"wider",color:"color-black-500",fontWeight:"bold",marginBottom:12,alignItems:"center",gap:6,style:{textTransform:"uppercase"},children:[r.jsx(Se,{widthHeight:14})," ",r.jsx(i.Text,{children:t})]}),r.jsx(i.Horizontal,{gap:0,children:c.map((m,p,b)=>{const x=n===m.value;let y=h("color-gray-200"),k=h("color-gray-500"),I="transparent";if(x){if(m.color)m.color,y=h(m.color),k=h(m.color),I="rgba(0,0,0,0.05)";else{const T=h("theme-primary");y=T,k=T,I="color-gray-50"}m.color?(y=h(m.color),k=h(m.color),I="transparent"):(y=h("theme-primary"),k=h("theme-primary"),I="transparent")}return r.jsx(_e,{onClick:()=>f(m),flex:1,...l?{size:l}:{paddingVertical:6,fontSize:"12px"},fontWeight:x?"bold":"normal",style:{borderTop:`1px solid ${x?y:h("color-gray-200")}`,borderBottom:`1px solid ${x?y:h("color-gray-200")}`,borderLeft:`1px solid ${x?y:h("color-gray-200")}`,borderRight:p===b.length-1||x?`1px solid ${x?y:h("color-gray-200")}`:"none",backgroundColor:I,color:k,borderRadius:p===0?"6px 0 0 6px":p===b.length-1?"0 6px 6px 0":"0",zIndex:x?1:0,boxShadow:"none"},...a.item,children:m.label},m.value)})}),r.jsx("input",{type:"hidden",id:e,name:o,value:Array.isArray(n)?n.join(","):n,onChange:()=>{}})]})},ds=e=>{const o={...e,options:e.options||[]},t=Ar(o);return r.jsx(Dr,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},Fr=({label:e,placeholder:o,value:t})=>{const[n,l]=d.useState(e??o),[a,c]=d.useState(!1),[g,s]=d.useState(t||""),[u,h]=d.useState(!1);return d.useMemo(()=>{l(u&&!g?o??"":e??o)},[g,u,e,o]),{hint:n,setHint:l,isHovered:a,setIsHovered:c,value:g,setValue:s,isFocused:u,setIsFocused:h}},Or=({id:e,name:o,hint:t,error:n,value:l,label:a,shadow:c,helperText:g,placeholder:s,size:u="sm",shape:h="default",variant:f="default",isHovered:m=!1,isFocused:p=!1,isEditable:b=!1,isReadOnly:x=!1,isDisabled:y=!1,isAutoFocus:k=!1,isMultiline:I=!1,maxRows:T=3,maxCols:C=30,onBlur:w=()=>{},onChange:j,onFocus:z,setHint:E=()=>{},setValue:P=()=>{},setIsFocused:H=()=>{},setIsHovered:S=()=>{},views:$={label:{},helperText:{}},...A})=>{const _=!!(p&&a),V={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:i.Typography.fontSizes[u],lineHeight:`${Math.round(i.Typography.fontSizes[u]*1.5)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:y?"color-gray-400":"color-gray-900",cursor:y?"not-allowed":"text",opacity:y?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...$.field},B=()=>S(!m),W=()=>{H(!0),z&&z()},L=F=>{w(F),H(!1)},D=F=>{typeof F=="string"?(P(F),j&&j(F)):(P(F.target.value),j&&j(F.target.value))};return r.jsx(Te,{helperText:g,error:n,views:$,...A,children:r.jsx(Me,{label:a,size:u,error:n,shape:h,views:$,shadow:c,variant:f,value:l,color:"theme-primary",isHovered:m,isDisabled:y,isReadOnly:x,isFocused:p,showLabel:_,onMouseEnter:B,onMouseLeave:B,...$==null?void 0:$.content,children:r.jsxs(Ue,{...$==null?void 0:$.warper,children:[_&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:n,...$==null?void 0:$.label,children:a}),r.jsx(i.Element,{as:"textarea",id:e,name:o,rows:T,cols:C,value:l,readOnly:x,disabled:y,autoFocus:k,editable:`${!!b.toString()}`,placeholder:t,onBlur:L,onFocus:W,multiline:`${!!I.toString()}`,onChange:F=>D(F),...V,style:{resize:y||x?"none":"vertical"},...$==null?void 0:$.textarea})]})})})},gs=e=>{const o=Fr(e);return r.jsx(Or,{...o,...e})},St=({label:e,placeholder:o,value:t})=>{const[n,l]=d.useState(e??o),[a,c]=d.useState(!1),[g,s]=d.useState(!1),[u,h]=d.useState(t);return d.useMemo(()=>{l(a&&!u?o??"":e??o)},[u,a,e,o]),{hint:n,setHint:l,isFocused:a,setIsFocused:c,isHovered:g,setIsHovered:s,setValue:h,value:u}},us=e=>r.jsx(i.Input,{type:"text",...e}),go=({id:e,name:o,label:t,hint:n,value:l,onChange:a,left:c,right:g,helperText:s,placeholder:u,onChangeText:h,shadow:f={},views:m={container:{},field:{},label:{},helperText:{},text:{}},size:p="md",shape:b="default",variant:x="default",error:y=!1,isFocused:k=!1,isHovered:I=!1,isDisabled:T=!1,isReadOnly:C=!1,isClearable:w=!0,isAutoFocus:j=!1,setHint:z=()=>{},setIsFocused:E=()=>{},setIsHovered:P=()=>{},setValue:H=()=>{},onClick:S=()=>{},onFocus:$,onBlur:A=()=>{},themeMode:_,...V})=>{const{getColor:B,themeMode:W}=i.useTheme(),L=B("color-blueGray-700",{themeMode:_||W}),D=!!(k&&t),F={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",height:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:i.Typography.fontSizes[p],lineHeight:`${Math.round(i.Typography.fontSizes[p]*1.4)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:T?"color-gray-400":"color-gray-900",cursor:T?"not-allowed":"text",opacity:T?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...m.field},q=()=>{E(!0),$&&$()},O=()=>P(!I),U=N=>{A&&A(N),E(!1)},Z=N=>{typeof N=="string"?(H(N),h&&h(N),a&&a(N)):(H(N.target.value),h&&h(N.target.value),a&&a(N.target.value))},X=()=>{H(""),a&&(A({target:{name:o}}),h&&h(""),a&&a("")),typeof document>"u"&&h&&h("")};return r.jsx(Te,{helperText:s,error:y,views:m,children:r.jsxs(Me,{label:t,size:p,error:y,shape:b,views:m,shadow:f,variant:x,value:l,color:"theme-primary",isHovered:I,isDisabled:T,isReadOnly:C,isFocused:k,showLabel:D,onMouseEnter:O,onMouseLeave:O,children:[c,r.jsxs(Ue,{children:[D&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:y,...m,children:t}),r.jsx(us,{id:e,name:o,readOnly:C,disabled:T,autoFocus:j,placeholder:n,onFocus:q,onBlur:U,autoComplete:"off",...F,...V,onChange:Z,value:l})]}),w&&l&&!C&&!T&&r.jsx(jt,{children:r.jsx(pe,{size:20,color:L,onClick:X,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)"}})}),g]})})},uo=e=>{const o=St(e);return r.jsx(go,{...o,...e})},qr=({defaultIsSelected:e=!1})=>{const[o,t]=d.useState(!1),[n,l]=d.useState(e);return{isHovered:o,setIsHovered:t,isSelected:n,setIsSelected:l}},hs={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"}},Nr={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"}},Mt={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"}}},Ur=({id:e,icon:o,name:t,label:n,isChecked:l,onChange:a,onValueChange:c,shadow:g={},labelPosition:s="right",size:u="md",error:h=!1,isSelected:f=!1,isHovered:m=!1,isDisabled:p=!1,isReadOnly:b=!1,isIndeterminate:x=!1,defaultIsSelected:y=!1,setIsSelected:k=()=>{},setIsHovered:I=()=>{},views:T={checkbox:{},label:{}},infoText:C,helperText:w,...j})=>{const z=()=>I(!m),E=()=>{!b&&!p&&(k&&k(!f),a&&a(!l),c&&c(!l))},P=x?"indeterminate":l||f?"selected":"unselected",H=h?Mt.error[P]:p?Mt.disabled[P]:m?Mt.hover[P]:{},S={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:h?"color-red-600":p?"color-gray-400":"color-gray-700",cursor:p?"not-allowed":b?"default":"pointer",opacity:p?.6:1,transition:"all 0.2s ease",...T.label},checkbox:{...fs[P],...H,borderRadius:"4px",...hs[u],transition:"all 0.2s ease",...g,...T.checkbox}};return r.jsxs(so,{htmlFor:e,as:"div",onClick:E,onMouseEnter:z,onMouseLeave:z,size:i.Typography.fontSizes[u],...S.container,...j,children:[r.jsxs(i.Vertical,{gap:8,children:[" ",r.jsxs(i.Horizontal,{gap:12,alignItems:"center",children:[" ",s==="left"&&n&&r.jsx(i.Text,{size:u,fontWeight:"500",...T==null?void 0:T.label,children:n}),r.jsx(i.Center,{...S.checkbox,children:x?r.jsx(Jt,{widthHeight:Nr[u],color:"white",transition:"all 0.2s ease"}):(l||f)&&(o??r.jsx(Vo,{widthHeight:Nr[u],color:"white",transition:"all 0.2s ease"}))}),s==="right"&&n&&r.jsx(i.Text,{size:u,fontWeight:"500",...T==null?void 0:T.label,children:n})]}),C&&r.jsx(i.Text,{marginLeft:s==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...T==null?void 0:T.infoText,children:C})]}),h&&r.jsx(i.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:h})]})},ms=e=>{const o=qr(e);return r.jsx(Ur,{...o,...e})},Gr=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:l,onOpen:a,onClose:c,closeOnSelect:g=!0,maxRecentColors:s=8,showRecentColors:u=!0,isAutoFocus:h=!1}=e,[f,m]=d.useState(!1),[p,b]=d.useState(o??t),[x,y]=d.useState(""),[k,I]=d.useState([]),[T,C]=d.useState(!1),[w,j]=d.useState(!1),z=d.useRef(null),E=d.useRef(null);d.useEffect(()=>{o!==void 0&&b(o)},[o]),d.useEffect(()=>{if(u)try{const B=localStorage.getItem("colorInput-recentColors");B&&I(JSON.parse(B))}catch(B){console.warn("Failed to load recent colors from localStorage:",B)}},[u]),d.useEffect(()=>{h&&z.current&&z.current.focus()},[h]),d.useEffect(()=>{const B=W=>{f&&z.current&&E.current&&!z.current.contains(W.target)&&!E.current.contains(W.target)&&_()};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[f]);const P=d.useCallback(B=>{u&&I(W=>{const L=W.filter(F=>F!==B),D=[B,...L].slice(0,s);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(D))}catch(F){console.warn("Failed to save recent colors to localStorage:",F)}return D})},[u,s]),H=d.useCallback(()=>{const B=!f;m(B),B?a==null||a():c==null||c()},[f,a,c]),S=d.useCallback(B=>{b(B),P(B),n==null||n(B),l==null||l(B),g&&(m(!1),c==null||c())},[n,l,g,c,P]),$=d.useCallback(B=>{y(B)},[]),A=d.useCallback(()=>{x&&(S(x),y(""))},[x,S]),_=d.useCallback(()=>{m(!1),c==null||c()},[c]),V=d.useCallback(B=>{b(B),n==null||n(B)},[n]);return{isOpen:f,selectedColor:p,recentColors:k,customColor:x,isFocused:T,isHovered:w,handleToggle:H,handleColorSelect:S,handleCustomColorChange:$,handleCustomColorSubmit:A,handleClose:_,setIsFocused:C,setIsHovered:j,setValue:V,triggerRef:z,dropdownRef:E}},ho={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"}},ps={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"}},bs={default:{borderRadius:"6px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},ys={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"}},xs=[{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"}],Yr=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:l,views:a={},size:c="md",shape:g="default",variant:s="default",shadow:u,error:h=!1,isDisabled:f=!1,isReadOnly:m=!1,isFocused:p=!1,isHovered:b=!1,predefinedColors:x=xs,showCustomInput:y=!0,showRecentColors:k=!0,isOpen:I=!1,selectedColor:T="",recentColors:C=[],customColor:w="",handleToggle:j=()=>{},handleColorSelect:z=()=>{},handleCustomColorChange:E=()=>{},handleCustomColorSubmit:P=()=>{},setIsFocused:H=()=>{},setIsHovered:S=()=>{},triggerRef:$,dropdownRef:A,onChange:_,...V})=>{const{getColor:B}=i.useTheme(),W={...ho.container,...a==null?void 0:a.container},L={...ho.trigger,...ps[c],...bs[g],...ys[s],...h&&{borderColor:"color-red-500"},...f&&{opacity:.6,cursor:"not-allowed"},...p&&{borderColor:"color-blue-500",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.1)"},...b&&!f&&{borderColor:"color-gray-400"},...a==null?void 0:a.trigger,...u&&u},D={...ho.dropdown,...a==null?void 0:a.dropdown},F={...ho.colorGrid,...a==null?void 0:a.colorGrid},q={...ho.recentColors,...a==null?void 0:a.recentColors},O=T||"color-gray-200";return r.jsxs(i.View,{...W,...V,children:[t&&r.jsx(so,{htmlFor:e,size:c,isDisabled:f,error:h,views:a==null?void 0:a.label,children:t}),r.jsxs(i.View,{ref:$,onClick:f||m?void 0:j,onMouseEnter:()=>H(!0),onMouseLeave:()=>H(!1),onFocus:()=>H(!0),onBlur:()=>H(!1),tabIndex:f?-1:0,role:"button","aria-expanded":I,"aria-haspopup":"listbox","aria-label":t||n,width:"fit-content",gap:8,...L,children:[r.jsx(i.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:O,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),!m&&!f&&r.jsx(le,{widthHeight:16,color:"color-gray-500",orientation:I?"up":"down"})]}),I&&r.jsxs(i.View,{ref:A,...D,children:[r.jsx(i.View,{...F,children:x.map((U,Z)=>r.jsx(i.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:U.value,borderWidth:"2px",borderStyle:"solid",borderColor:T===U.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>z(U.value),title:U.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},Z))}),k&&C.length>0&&r.jsxs(i.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(i.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Recent Colors"}),r.jsx(i.Horizontal,{gap:4,flexWrap:"wrap",...q,children:C.map((U,Z)=>r.jsx(i.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:U,borderWidth:"1px",borderStyle:"solid",borderColor:T===U?"color-blue-500":"color-gray-300",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>z(U),title:U,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"}},Z))})]}),y&&r.jsxs(i.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(i.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Custom Color"}),r.jsxs(i.Horizontal,{gap:8,children:[r.jsx(uo,{value:w,onChange:U=>E(U.target.value),placeholder:"#000000 or rgb(0,0,0)",size:"sm",style:{flex:1},views:a==null?void 0:a.customInput}),r.jsx(i.View,{padding:"8px 12px",backgroundColor:"color-blue-500",borderRadius:"4px",cursor:"pointer",onClick:P,_hover:{backgroundColor:"color-blue-600"},children:r.jsx(i.Text,{color:"color-white",fontSize:"12px",fontWeight:"500",children:"Add"})})]})]})]}),l&&r.jsx(i.Text,{fontSize:"12px",color:h?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:l}),h&&typeof h=="string"&&r.jsx(i.Text,{fontSize:"12px",color:"color-red-500",marginTop:"4px",...a==null?void 0:a.error,children:h})]})},ks=e=>{const o=Gr(e);return r.jsx(Yr,{...o,...e})},zt=[{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"}],vr=({placeholder:e})=>{const[o,t]=d.useState(zt),[n,l]=d.useState(e??zt[0].name),[a,c]=d.useState(!0),[g,s]=d.useState(!1),[u,h]=d.useState(!1);return{hide:a,setHide:c,newOptions:o,setNewOptions:t,isHovered:u,setIsHovered:h,isFocused:g,setIsFocused:s,value:n,setValue:l}},Xr={xs:8,sm:10,md:12,lg:14,xl:16},Cs=({size:e,...o})=>r.jsx(i.Element,{as:"ul",...o}),ws=e=>r.jsx(i.Input,{type:"country",...e}),Is=({size:e,...o})=>r.jsx(i.Element,{as:"li",...o}),Ts=({option:e,size:o="md",callback:t=()=>{},views:n={text:{}}})=>{const l=a=>{a&&a.stopPropagation&&a.stopPropagation(),t(e)};return r.jsx(Is,{margin:0,role:"DropDownItem",listStyleType:"none",fontWeight:"normal",paddingVertical:6,paddingHorizontal:12,onClick:l,fontSize:i.Typography.fontSizes[o],_hover:{opacity:.8},...n.text,children:e})},js=({size:e,views:o={dropDown:{}},options:t=[],callback:n=()=>{}})=>{const l=a=>n(a);return r.jsx(Cs,{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(Ts,{size:e,option:a.name,callback:l,...o.text},a.code))})},Kr=({id:e,name:o,label:t,value:n,placeholder:l,helperText:a,hide:c=!1,error:g=!1,isHovered:s=!1,isFocused:u=!1,isAutoFocus:h=!1,isDisabled:f=!1,isReadOnly:m=!1,shadow:p={},newOptions:b=[],size:x="md",variant:y="default",shape:k="default",onChange:I,onBlur:T=()=>{},setHide:C=()=>{},setNewOptions:w=()=>{},setIsHovered:j=()=>{},setIsFocused:z=()=>{},setValue:E=()=>{},views:P={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:H,...S})=>{const{getColor:$,themeMode:A}=i.useTheme(),_=$("color-blueGray-700",{themeMode:H||A}),V=()=>z(!0),B=O=>{C(!c),E(O),I&&I(O)},W=()=>{!f&&!m&&C(!c)},L=O=>{const U=O.target.value,Z=zt.filter(X=>X.name.toLowerCase().startsWith(U.toLowerCase()));c&&C(!1),w(Z),I&&I(U)},D=O=>{T(O),z(!1)},F=!!(t&&(u||n)),q={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:i.Typography.fontSizes[x],backgroundColor:"transparent",color:f?"color-trueGray-600":"color-blueGray-700",cursor:f?"not-allowed":m?"auto":"pointer",...P.field};return r.jsxs(Te,{helperText:a,error:g,views:P,onClick:W,children:[r.jsxs(Me,{label:t,size:x,error:g,shape:k,views:P,shadow:p,variant:y,value:n,color:"theme-primary",isDisabled:f,isReadOnly:m,isFocused:u,showLabel:F,_hover:!f&&!g?{borderColor:"theme-primary"}:void 0,children:[r.jsxs(Ue,{children:[F&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:g,...P,children:t}),r.jsx(ws,{id:e,name:o,placeholder:l,readOnly:m,disabled:f,autoFocus:h,onBlur:D,onFocus:V,...q,...S,value:n,onChange:L})]}),r.jsx(jt,{children:c?r.jsx(le,{orientation:"down",widthHeight:Xr[x],color:_,style:P.icon}):r.jsx(le,{orientation:"up",widthHeight:Xr[x],color:_,style:P.icon})})]}),!c&&r.jsx(js,{size:x,views:P,options:b,callback:B})]})},Ss=e=>{const o=vr(e);return r.jsx(Kr,{...o,...e})};function qo(e){"@babel/helpers - typeof";return qo=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},qo(e)}function he(e,o){if(o.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+o.length+" present")}function Ms(e){return he(1,arguments),e instanceof Date||qo(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ce(e){he(1,arguments);var o=Object.prototype.toString.call(e);return e instanceof Date||qo(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 zs(e){if(he(1,arguments),!Ms(e)&&typeof e!="number")return!1;var o=Ce(e);return!isNaN(Number(o))}function Be(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 Vs(e,o){he(2,arguments);var t=Ce(e).getTime(),n=Be(o);return new Date(t+n)}function Es(e,o){he(2,arguments);var t=Be(o);return Vs(e,-t)}var Ps=864e5;function Ws(e){he(1,arguments);var o=Ce(e),t=o.getTime();o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0);var n=o.getTime(),l=t-n;return Math.floor(l/Ps)+1}function No(e){he(1,arguments);var o=1,t=Ce(e),n=t.getUTCDay(),l=(n<o?7:0)+n-o;return t.setUTCDate(t.getUTCDate()-l),t.setUTCHours(0,0,0,0),t}function Qr(e){he(1,arguments);var o=Ce(e),t=o.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var l=No(n),a=new Date(0);a.setUTCFullYear(t,0,4),a.setUTCHours(0,0,0,0);var c=No(a);return o.getTime()>=l.getTime()?t+1:o.getTime()>=c.getTime()?t:t-1}function _s(e){he(1,arguments);var o=Qr(e),t=new Date(0);t.setUTCFullYear(o,0,4),t.setUTCHours(0,0,0,0);var n=No(t);return n}var $s=6048e5;function Hs(e){he(1,arguments);var o=Ce(e),t=No(o).getTime()-_s(o).getTime();return Math.round(t/$s)+1}var Bs={};function Uo(){return Bs}function Go(e,o){var t,n,l,a,c,g,s,u;he(1,arguments);var h=Uo(),f=Be((t=(n=(l=(a=o==null?void 0:o.weekStartsOn)!==null&&a!==void 0?a:o==null||(c=o.locale)===null||c===void 0||(g=c.options)===null||g===void 0?void 0:g.weekStartsOn)!==null&&l!==void 0?l:h.weekStartsOn)!==null&&n!==void 0?n:(s=h.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Ce(e),p=m.getUTCDay(),b=(p<f?7:0)+p-f;return m.setUTCDate(m.getUTCDate()-b),m.setUTCHours(0,0,0,0),m}function Zr(e,o){var t,n,l,a,c,g,s,u;he(1,arguments);var h=Ce(e),f=h.getUTCFullYear(),m=Uo(),p=Be((t=(n=(l=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(c=o.locale)===null||c===void 0||(g=c.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&l!==void 0?l:m.firstWeekContainsDate)!==null&&n!==void 0?n:(s=m.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(f+1,0,p),b.setUTCHours(0,0,0,0);var x=Go(b,o),y=new Date(0);y.setUTCFullYear(f,0,p),y.setUTCHours(0,0,0,0);var k=Go(y,o);return h.getTime()>=x.getTime()?f+1:h.getTime()>=k.getTime()?f:f-1}function Ls(e,o){var t,n,l,a,c,g,s,u;he(1,arguments);var h=Uo(),f=Be((t=(n=(l=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(c=o.locale)===null||c===void 0||(g=c.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&l!==void 0?l:h.firstWeekContainsDate)!==null&&n!==void 0?n:(s=h.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&t!==void 0?t:1),m=Zr(e,o),p=new Date(0);p.setUTCFullYear(m,0,f),p.setUTCHours(0,0,0,0);var b=Go(p,o);return b}var As=6048e5;function Ds(e,o){he(1,arguments);var t=Ce(e),n=Go(t,o).getTime()-Ls(t,o).getTime();return Math.round(n/As)+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 ze={y:function(o,t){var n=o.getUTCFullYear(),l=n>0?n:1-n;return te(t==="yy"?l%100:l,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,l=o.getUTCMilliseconds(),a=Math.floor(l*Math.pow(10,n-3));return te(a,t.length)}},Ge={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fs={G:function(o,t,n){var l=o.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(l,{width:"abbreviated"});case"GGGGG":return n.era(l,{width:"narrow"});case"GGGG":default:return n.era(l,{width:"wide"})}},y:function(o,t,n){if(t==="yo"){var l=o.getUTCFullYear(),a=l>0?l:1-l;return n.ordinalNumber(a,{unit:"year"})}return ze.y(o,t)},Y:function(o,t,n,l){var a=Zr(o,l),c=a>0?a:1-a;if(t==="YY"){var g=c%100;return te(g,2)}return t==="Yo"?n.ordinalNumber(c,{unit:"year"}):te(c,t.length)},R:function(o,t){var n=Qr(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 l=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"Q":return String(l);case"QQ":return te(l,2);case"Qo":return n.ordinalNumber(l,{unit:"quarter"});case"QQQ":return n.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(l,{width:"wide",context:"formatting"})}},q:function(o,t,n){var l=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"q":return String(l);case"qq":return te(l,2);case"qo":return n.ordinalNumber(l,{unit:"quarter"});case"qqq":return n.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(l,{width:"wide",context:"standalone"})}},M:function(o,t,n){var l=o.getUTCMonth();switch(t){case"M":case"MM":return ze.M(o,t);case"Mo":return n.ordinalNumber(l+1,{unit:"month"});case"MMM":return n.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(l,{width:"wide",context:"formatting"})}},L:function(o,t,n){var l=o.getUTCMonth();switch(t){case"L":return String(l+1);case"LL":return te(l+1,2);case"Lo":return n.ordinalNumber(l+1,{unit:"month"});case"LLL":return n.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(l,{width:"wide",context:"standalone"})}},w:function(o,t,n,l){var a=Ds(o,l);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):te(a,t.length)},I:function(o,t,n){var l=Hs(o);return t==="Io"?n.ordinalNumber(l,{unit:"week"}):te(l,t.length)},d:function(o,t,n){return t==="do"?n.ordinalNumber(o.getUTCDate(),{unit:"date"}):ze.d(o,t)},D:function(o,t,n){var l=Ws(o);return t==="Do"?n.ordinalNumber(l,{unit:"dayOfYear"}):te(l,t.length)},E:function(o,t,n){var l=o.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(l,{width:"short",context:"formatting"});case"EEEE":default:return n.day(l,{width:"wide",context:"formatting"})}},e:function(o,t,n,l){var a=o.getUTCDay(),c=(a-l.weekStartsOn+8)%7||7;switch(t){case"e":return String(c);case"ee":return te(c,2);case"eo":return n.ordinalNumber(c,{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,l){var a=o.getUTCDay(),c=(a-l.weekStartsOn+8)%7||7;switch(t){case"c":return String(c);case"cc":return te(c,t.length);case"co":return n.ordinalNumber(c,{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 l=o.getUTCDay(),a=l===0?7:l;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(l,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(l,{width:"short",context:"formatting"});case"iiii":default:return n.day(l,{width:"wide",context:"formatting"})}},a:function(o,t,n){var l=o.getUTCHours(),a=l/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 l=o.getUTCHours(),a;switch(l===12?a=Ge.noon:l===0?a=Ge.midnight:a=l/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 l=o.getUTCHours(),a;switch(l>=17?a=Ge.evening:l>=12?a=Ge.afternoon:l>=4?a=Ge.morning:a=Ge.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 l=o.getUTCHours()%12;return l===0&&(l=12),n.ordinalNumber(l,{unit:"hour"})}return ze.h(o,t)},H:function(o,t,n){return t==="Ho"?n.ordinalNumber(o.getUTCHours(),{unit:"hour"}):ze.H(o,t)},K:function(o,t,n){var l=o.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(l,{unit:"hour"}):te(l,t.length)},k:function(o,t,n){var l=o.getUTCHours();return l===0&&(l=24),t==="ko"?n.ordinalNumber(l,{unit:"hour"}):te(l,t.length)},m:function(o,t,n){return t==="mo"?n.ordinalNumber(o.getUTCMinutes(),{unit:"minute"}):ze.m(o,t)},s:function(o,t,n){return t==="so"?n.ordinalNumber(o.getUTCSeconds(),{unit:"second"}):ze.s(o,t)},S:function(o,t){return ze.S(o,t)},X:function(o,t,n,l){var a=l._originalDate||o,c=a.getTimezoneOffset();if(c===0)return"Z";switch(t){case"X":return Rr(c);case"XXXX":case"XX":return Le(c);case"XXXXX":case"XXX":default:return Le(c,":")}},x:function(o,t,n,l){var a=l._originalDate||o,c=a.getTimezoneOffset();switch(t){case"x":return Rr(c);case"xxxx":case"xx":return Le(c);case"xxxxx":case"xxx":default:return Le(c,":")}},O:function(o,t,n,l){var a=l._originalDate||o,c=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Jr(c,":");case"OOOO":default:return"GMT"+Le(c,":")}},z:function(o,t,n,l){var a=l._originalDate||o,c=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Jr(c,":");case"zzzz":default:return"GMT"+Le(c,":")}},t:function(o,t,n,l){var a=l._originalDate||o,c=Math.floor(a.getTime()/1e3);return te(c,t.length)},T:function(o,t,n,l){var a=l._originalDate||o,c=a.getTime();return te(c,t.length)}};function Jr(e,o){var t=e>0?"-":"+",n=Math.abs(e),l=Math.floor(n/60),a=n%60;if(a===0)return t+String(l);var c=o;return t+String(l)+c+te(a,2)}function Rr(e,o){if(e%60===0){var t=e>0?"-":"+";return t+te(Math.abs(e)/60,2)}return Le(e,o)}function Le(e,o){var t=o||"",n=e>0?"-":"+",l=Math.abs(e),a=te(Math.floor(l/60),2),c=te(l%60,2);return n+a+t+c}var en=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"})}},on=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"})}},Os=function(o,t){var n=o.match(/(P+)(p+)?/)||[],l=n[1],a=n[2];if(!a)return en(o,t);var c;switch(l){case"P":c=t.dateTime({width:"short"});break;case"PP":c=t.dateTime({width:"medium"});break;case"PPP":c=t.dateTime({width:"long"});break;case"PPPP":default:c=t.dateTime({width:"full"});break}return c.replace("{{date}}",en(l,t)).replace("{{time}}",on(a,t))},qs={p:on,P:Os};function Ns(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 Us=["D","DD"],Gs=["YY","YYYY"];function Ys(e){return Us.indexOf(e)!==-1}function vs(e){return Gs.indexOf(e)!==-1}function tn(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 Xs={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"}},Ks=function(o,t,n){var l,a=Xs[o];return typeof a=="string"?l=a:t===1?l=a.one:l=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+l:l+" ago":l};function Vt(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 Qs={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Zs={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Js={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rs={date:Vt({formats:Qs,defaultWidth:"full"}),time:Vt({formats:Zs,defaultWidth:"full"}),dateTime:Vt({formats:Js,defaultWidth:"full"})},ed={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},od=function(o,t,n,l){return ed[o]};function fo(e){return function(o,t){var n=t!=null&&t.context?String(t.context):"standalone",l;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,c=t!=null&&t.width?String(t.width):a;l=e.formattingValues[c]||e.formattingValues[a]}else{var g=e.defaultWidth,s=t!=null&&t.width?String(t.width):e.defaultWidth;l=e.values[s]||e.values[g]}var u=e.argumentCallback?e.argumentCallback(o):o;return l[u]}}var td={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nd={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"]},ad={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"]},ld={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"}},cd={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"}},id=function(o,t){var n=Number(o),l=n%100;if(l>20||l<10)switch(l%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},sd={ordinalNumber:id,era:fo({values:td,defaultWidth:"wide"}),quarter:fo({values:rd,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:fo({values:nd,defaultWidth:"wide"}),day:fo({values:ad,defaultWidth:"wide"}),dayPeriod:fo({values:ld,defaultWidth:"wide",formattingValues:cd,defaultFormattingWidth:"wide"})};function mo(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,l=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=o.match(l);if(!a)return null;var c=a[0],g=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(g)?gd(g,function(f){return f.test(c)}):dd(g,function(f){return f.test(c)}),u;u=e.valueCallback?e.valueCallback(s):s,u=t.valueCallback?t.valueCallback(u):u;var h=o.slice(c.length);return{value:u,rest:h}}}function dd(e,o){for(var t in e)if(e.hasOwnProperty(t)&&o(e[t]))return t}function gd(e,o){for(var t=0;t<e.length;t++)if(o(e[t]))return t}function ud(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 l=n[0],a=o.match(e.parsePattern);if(!a)return null;var c=e.valueCallback?e.valueCallback(a[0]):a[0];c=t.valueCallback?t.valueCallback(c):c;var g=o.slice(l.length);return{value:c,rest:g}}}var hd=/^(\d+)(th|st|nd|rd)?/i,fd=/\d+/i,md={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},pd={any:[/^b/i,/^(a|c)/i]},bd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},yd={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]},Cd={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},wd={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]},Id={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},Td={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}},jd={ordinalNumber:ud({matchPattern:hd,parsePattern:fd,valueCallback:function(o){return parseInt(o,10)}}),era:mo({matchPatterns:md,defaultMatchWidth:"wide",parsePatterns:pd,defaultParseWidth:"any"}),quarter:mo({matchPatterns:bd,defaultMatchWidth:"wide",parsePatterns:yd,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:mo({matchPatterns:xd,defaultMatchWidth:"wide",parsePatterns:kd,defaultParseWidth:"any"}),day:mo({matchPatterns:Cd,defaultMatchWidth:"wide",parsePatterns:wd,defaultParseWidth:"any"}),dayPeriod:mo({matchPatterns:Id,defaultMatchWidth:"any",parsePatterns:Td,defaultParseWidth:"any"})},Sd={code:"en-US",formatDistance:Ks,formatLong:Rs,formatRelative:od,localize:sd,match:jd,options:{weekStartsOn:0,firstWeekContainsDate:1}},Md=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vd=/^'([^]*?)'?$/,Ed=/''/g,Pd=/[a-zA-Z]/;function Wd(e,o,t){var n,l,a,c,g,s,u,h,f,m,p,b,x,y;he(2,arguments);var k=String(o),I=Uo(),T=(n=(l=void 0)!==null&&l!==void 0?l:I.locale)!==null&&n!==void 0?n:Sd,C=Be((a=(c=(g=(s=void 0)!==null&&s!==void 0?s:void 0)!==null&&g!==void 0?g:I.firstWeekContainsDate)!==null&&c!==void 0?c:(u=I.locale)===null||u===void 0||(h=u.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=Be((f=(m=(p=(b=void 0)!==null&&b!==void 0?b:void 0)!==null&&p!==void 0?p:I.weekStartsOn)!==null&&m!==void 0?m:(x=I.locale)===null||x===void 0||(y=x.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&f!==void 0?f:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var j=Ce(e);if(!zs(j))throw new RangeError("Invalid time value");var z=Ns(j),E=Es(j,z),P={firstWeekContainsDate:C,weekStartsOn:w,locale:T,_originalDate:j},H=k.match(zd).map(function(S){var $=S[0];if($==="p"||$==="P"){var A=qs[$];return A(S,T.formatLong)}return S}).join("").match(Md).map(function(S){if(S==="''")return"'";var $=S[0];if($==="'")return _d(S);var A=Fs[$];if(A)return vs(S)&&tn(S,o,String(e)),Ys(S)&&tn(S,o,String(e)),A(E,S,T.localize,P);if($.match(Pd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return S}).join("");return H}function _d(e){var o=e.match(Vd);return o?o[1].replace(Ed,"'"):e}const rn=()=>{const[e,o]=d.useState(!1),[t,n]=d.useState(!1),[l,a]=d.useState(Wd(new Date,"yyyy-MM-dd"));return{date:l,setDate:a,isHovered:e,setIsHovered:o,isFocused:t,setIsFocused:n}},$d=e=>r.jsx(i.Input,{type:"date",...e}),nn=({id:e,icon:o,name:t,label:n,date:l,children:a,helperText:c,shadow:g={},size:s="md",variant:u="default",shape:h="default",views:f={container:{},label:{},helperText:{},text:{},field:{}},error:m=!1,isHovered:p=!1,isFocused:b=!1,isDisabled:x=!1,isReadOnly:y=!1,setDate:k=()=>{},setIsFocused:I=()=>{},setIsHovered:T=()=>{},onChange:C,onChangeText:w,...j})=>{const z=!!(b&&n),E=()=>T(!p),P=()=>I(!0),H=$=>{typeof $=="string"?(k($),w&&w($)):(k($.target.value),C&&C($.target.value))},S={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none",backgroundColor:"transparent"}},fontSize:i.Typography.fontSizes[s],backgroundColor:"transparent",color:x?"color-trueGray-600":"color-blueGray-700",cursor:x?"not-allowed":y?"auto":"pointer",...f.field};return r.jsx(Te,{helperText:c,error:m,views:f,children:r.jsx(Me,{label:n,size:s,error:m,shape:h,views:f,shadow:g,color:"theme-primary",variant:u,value:l,isHovered:p,isDisabled:x,isReadOnly:y,isFocused:b,showLabel:z,onMouseEnter:E,onMouseLeave:E,children:r.jsxs(Ue,{children:[z&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:m,...f,children:n}),r.jsx($d,{id:e,name:t,onFocus:P,disabled:x,readOnly:y,...S,...j,...w&&{onChangeText:H},onChange:H})]})})})},Hd=e=>{const o=rn();return r.jsx(nn,{...o,...e})},an=e=>{const o=St(e),[t,n]=d.useState(!1);return{isVisible:t,setIsVisible:n,...e,...o}},Bd=({visibleIcon:e=r.jsx(gt,{widthHeight:14}),hiddenIcon:o=r.jsx(dt,{widthHeight:14}),...t})=>{const{isVisible:n,setIsVisible:l,...a}=an(t);return r.jsx(go,{...a,type:n?"text":"password",isClearable:!1,right:r.jsx(i.View,{onClick:()=>{t.isDisabled||l(!n)},children:n?e:o})})},ln=(e,o,t)=>{const[n,l]=d.useState(e),[a,c]=d.useState(o?{value:o,label:o}:e[0]),[g,s]=d.useState([]),[u,h]=d.useState(0),[f,m]=d.useState(t??""),[p,b]=d.useState(!1);return{filteredItems:n,setFilteredItems:l,selectedItem:a,setSelectedItem:c,selectedItems:g,setSelectedItems:s,highlightedIndex:u,setHighlightedIndex:h,searchQuery:f,setSearchQuery:m,isDropdownVisible:p,setIsDropdownVisible:b}},Ld={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)"},cn={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)"}},Ad={padding:"8px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-100",backgroundColor:"color-gray-50",borderTopLeftRadius:"10px",borderTopRightRadius:"10px"},Dd={padding:"8px 10px",cursor:"pointer",borderRadius:"6px",margin:"1px 4px",transition:"background-color 0.15s ease"},Fd={padding:"24px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},sn={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)"}},Od={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"},dn=({placeholder:e,items:o,showTick:t=!0,onSelect:n,searchEnabled:l=!0,left:a,right:c,label:g,filteredItems:s,setSelectedItem:u,selectedItem:h,selectedItems:f,setSelectedItems:m,highlightedIndex:p,setHighlightedIndex:b,searchQuery:x,setSearchQuery:y,setFilteredItems:k,views:I,isDropdownVisible:T,setIsDropdownVisible:C,isMulti:w=!1,...j})=>{const{ref:z,relation:E}=i.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),P=d.useRef(null),[H,S]=d.useState(!1),[$,A]=d.useState(!1),_=()=>{var U;const D=$?cn.enter:cn.initial;if(!z.current)return{};const F=z.current.getBoundingClientRect(),q={position:"fixed",left:F.left,width:F.width,zIndex:1e4,...D};return((U=E==null?void 0:E.space)==null?void 0:U.vertical)==="top"?{...q,bottom:window.innerHeight-F.top+6}:{...q,top:F.bottom+6}};d.useEffect(()=>{if(T){const D=setTimeout(()=>A(!0),10);return()=>clearTimeout(D)}A(!1)},[T]),d.useEffect(()=>{const D=F=>{!F.composedPath().some(U=>(U==null?void 0:U.id)==="combobox-dropdown")&&z.current&&!z.current.contains(F.target)&&C(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const V=D=>{if(y(D),D==="")k(o);else{const F=o.filter(q=>q.label.toLowerCase().includes(D.toLowerCase()));k(F)}b(0)},B=D=>{if(w){const F=f.some(O=>O.value===D.value);let q;F?q=f.filter(O=>O.value!==D.value):q=[...f,D],m(q),n==null||n(q)}else u(D),n==null||n(D),C(!1)},W=(D,F)=>{D.stopPropagation();const q=f.filter(O=>O.value!==F.value);m(q),n==null||n(q)},L=D=>w?f.some(F=>F.value===D.value):D.value===h.value;return r.jsxs(i.Horizontal,{role:"combobox",flexWrap:"nowrap",gap:15,alignItems:"center",width:"100%",...j,children:[g&&r.jsx(i.Text,{views:I==null?void 0:I.label,htmlFor:j.id,children:g}),r.jsxs(i.View,{position:"relative",width:"100%",children:[r.jsx("div",{ref:z,onClick:()=>C(!T),style:{width:"100%"},children:r.jsxs(Me,{isHovered:H,isFocused:T,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),cursor:"pointer",views:{container:I==null?void 0:I.container},children:[r.jsxs(i.Horizontal,{gap:10,alignItems:"center",width:"100%",flexWrap:w?"wrap":"nowrap",...I==null?void 0:I.labelContainer,children:[a,w?f.length>0?r.jsx(i.Horizontal,{gap:6,flexWrap:"wrap",alignItems:"center",children:f.map(D=>r.jsxs(i.Horizontal,{...Od,_hover:{backgroundColor:"color-gray-200"},children:[D.icon&&r.jsx(i.View,{flexShrink:0,children:D.icon}),r.jsx(i.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:D.label}),r.jsx(pe,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:F=>W(F,D)})]},D.value))}):r.jsx(i.Text,{weight:"medium",flexGrow:1,color:"color-gray-500",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...I==null?void 0:I.label,children:e}):r.jsxs(r.Fragment,{children:[h.icon&&h.label!==e&&r.jsx(i.View,{children:h.icon}),r.jsx(i.Text,{weight:"medium",flexGrow:1,color:h.label===e?"color-gray-500":"color-gray-800",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...I==null?void 0:I.label,children:h.label})]})]}),r.jsxs(i.Horizontal,{gap:8,alignItems:"center",children:[c,r.jsx(i.View,{style:T?sn.open:sn.closed,children:r.jsx(le,{widthHeight:16,orientation:"down",color:T?"color-gray-700":"color-gray-400"})})]})]})}),T&&r.jsx(zr,{children:r.jsxs(i.View,{ref:P,id:"combobox-dropdown",role:"listbox","aria-labelledby":j.id,...Ld,style:_(),...I==null?void 0:I.dropdown,children:[l&&r.jsx(i.View,{...Ad,children:r.jsx(go,{id:`${j.id}-search`,name:`${j.name}-search`,width:"100%",type:"search",autoFocus:!0,value:x,onChange:D=>V(D),hint:e||"Search...",isClearable:!1,left:r.jsx(zo,{widthHeight:14,color:"color-gray-400"}),views:{container:{width:"100%",padding:"0",backgroundColor:"transparent",borderColor:"color-gray-200",...I==null?void 0:I.text},field:{fontSize:"13px"}}})}),s.length>0&&r.jsx(i.View,{margin:0,padding:"4px",children:s.map((D,F)=>{const q=L(D),O=F===p;return r.jsxs(i.Horizontal,{role:"option","aria-selected":q,justifyContent:"space-between",alignItems:"center",...Dd,backgroundColor:q&&O?"rgba(59, 130, 246, 0.12)":q?"rgba(59, 130, 246, 0.08)":O?"color-gray-100":"transparent",onMouseEnter:()=>b(F),onClick:()=>B(D),...I==null?void 0:I.item,children:[r.jsxs(i.Horizontal,{gap:8,alignItems:"center",children:[D.icon&&r.jsx(i.View,{flexShrink:0,children:D.icon}),r.jsx(i.Text,{size:"sm",color:q?"theme-primary":"color-gray-800",weight:q?"medium":"normal",children:D.label})]}),q&&t&&r.jsx(Vo,{widthHeight:16,color:"theme-primary"})]},D.value)})}),s.length===0&&r.jsxs(i.Vertical,{...Fd,children:[r.jsx(zo,{widthHeight:24,color:"color-gray-300"}),r.jsx(i.Text,{color:"color-gray-500",size:"sm",align:"center",children:"No results found"}),r.jsx(i.Text,{color:"color-gray-400",size:"xs",align:"center",children:"Try a different search term"})]})]})})]})]})},qd=({id:e,name:o,items:t,placeholder:n,searchPlaceholder:l,...a})=>{const c=ln(t,n,l);return r.jsx(dn,{id:e,name:o,items:t,...c,...a})},gn=e=>{const{tags:o,defaultTags:t=[],onTagsChange:n,onTagAdd:l,onTagRemove:a,maxTags:c,minTagLength:g=1,maxTagLength:s=50,allowDuplicates:u=!1,separators:h=["enter","comma"],isDisabled:f=!1,isReadOnly:m=!1}=e,[p,b]=d.useState(""),[x,y]=d.useState(()=>(o||t||[]).map((_,V)=>({id:`tag-${V}-${Date.now()}`,value:_}))),[k,I]=d.useState(!1),[T,C]=d.useState(!1),w=o&&Array.isArray(o)?o.map((A,_)=>({id:`tag-${_}-${Date.now()}`,value:A})):x;d.useEffect(()=>{o&&Array.isArray(o)&&y(o.map((A,_)=>({id:`tag-${_}-${Date.now()}`,value:A})))},[o]);const j=d.useCallback(A=>{const _=A.trim();return!(_.length<g||_.length>s||!u&&w.map(B=>B.value.toLowerCase()).includes(_.toLowerCase())||c&&w.length>=c)},[w,g,s,u,c]),z=d.useCallback(A=>{if(f||m)return;const _=A.trim();if(!_||!j(_))return;const V={id:`tag-${Date.now()}-${Math.random()}`,value:_},B=[...w,V],W=B.map(L=>L.value);o||y(B),n==null||n(W),l==null||l(_),b("")},[w,j,n,l,f,m,o]),E=d.useCallback(A=>{if(f||m)return;const _=w[A];if(!_)return;const V=w.filter((W,L)=>L!==A),B=V.map(W=>W.value);o||y(V),n==null||n(B),a==null||a(_.value,A)},[w,n,a,f,m,o]),P=d.useCallback(A=>{if(f||m)return;const _=A.target.value;if(h.includes("comma")&&_.includes(",")){const V=_.split(","),B=V[0],W=V.slice(1).join(",");B.trim()&&z(B),b(W);return}b(_)},[z,h,f,m]),H=d.useCallback(A=>{if(f||m)return;const{key:_}=A;if(h.includes("enter")&&_==="Enter"){A.preventDefault(),p.trim()&&z(p);return}if(h.includes("tab")&&_==="Tab"&&p.trim()){A.preventDefault(),z(p);return}if(h.includes("space")&&_===" "&&p.trim()){A.preventDefault(),z(p);return}if(_==="Backspace"&&!p&&w.length>0){A.preventDefault(),E(w.length-1);return}},[z,E,p,w,h,f,m]),S=d.useCallback(()=>{var A;I(!0),(A=e.onFocus)==null||A.call(e)},[e.onFocus]),$=d.useCallback(()=>{var A;I(!1),p.trim()&&z(p),(A=e.onBlur)==null||A.call(e)},[z,p,e.onBlur]);return{inputValue:p,setInputValue:b,tags:w,setTags:y,isFocused:k,setIsFocused:I,isHovered:T,setIsHovered:C,addTag:z,removeTag:E,handleInputChange:P,handleKeyDown:H,handleFocus:S,handleBlur:$,validateTag:j}},Nd=({tag:e,onRemove:o,isRemovable:t,size:n,views:l,isDisabled:a,isReadOnly:c})=>{const[g,s]=d.useState(!1),u={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(i.Horizontal,{alignItems:"center",gap:6,padding:u.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&&!c?{backgroundColor:"color-gray-100-200",borderColor:"color-gray-200",boxShadow:"0 4px 6px rgba(0,0,0,0.05)",transform:"translateY(-1px)"}:{},...l==null?void 0:l.tag,children:[r.jsx(i.Text,{fontSize:u.fontSize,color:a?"color-gray-100":"theme-primary",whiteSpace:"nowrap",...l==null?void 0:l.tagText,children:e}),t&&!a&&!c&&r.jsx(i.View,{cursor:"pointer",padding:"2px",borderRadius:"50%",transition:"all 0.2s ease",backgroundColor:g?"color-red-100":"transparent",opacity:g?1:.7,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:h=>{h.stopPropagation(),o()},_hover:{backgroundColor:"color-red-50"},...l==null?void 0:l.tagRemove,children:r.jsx(pe,{widthHeight:u.iconSize,color:g?"color-red-500":"color-gray-400"})})]})},un=({id:e,name:o,label:t,placeholder:n="Type and press Enter to add tags...",helperText:l,error:a=!1,inputValue:c="",tags:g=[],left:s,right:u,shadow:h={},views:f={},size:m="md",shape:p="default",variant:b="default",isDisabled:x=!1,isReadOnly:y=!1,isAutoFocus:k=!1,isRemovable:I=!0,isFocused:T=!1,isHovered:C=!1,maxTags:w,handleInputChange:j,handleKeyDown:z,handleFocus:E,handleBlur:P,removeTag:H,setIsHovered:S,onClick:$,...A})=>{const{getColor:_,themeMode:V}=i.useTheme(),B=!!(t&&(T||g.length>0||c)),W=w&&g.length>=w,L={...Vr[p],...Pr[b],...f==null?void 0:f.inputContainer},D={border:"none",outline:"none",backgroundColor:"transparent",fontSize:i.Typography.fontSizes[m],color:x?"color-gray-400":"color-gray-800",flex:1,minWidth:"120px",...f==null?void 0:f.input};return r.jsx(Te,{error:!!a,helperText:typeof a=="string"?a:l,views:f,...A,children:r.jsxs(Me,{label:t,shadow:h,value:g.length>0||c?"has-content":"",size:m,shape:p,variant:b,error:!!a,showLabel:B,isFocused:T,isHovered:C,isDisabled:x,isReadOnly:y,views:f,onClick:$,onMouseEnter:()=>S==null?void 0:S(!0),onMouseLeave:()=>S==null?void 0:S(!1),...L,children:[s,r.jsxs(Ue,{children:[t&&r.jsx($e,{size:m,error:!!a,views:f,children:t}),r.jsxs(i.Horizontal,{alignItems:"center",gap:8,flexWrap:"wrap",width:"100%",minHeight:i.Typography.fontSizes[m],padding:"8px 0",...f==null?void 0:f.tagsContainer,children:[g.map((F,q)=>r.jsx(Nd,{tag:F.value,onRemove:()=>H==null?void 0:H(q),isRemovable:I,size:m,views:f,isDisabled:x,isReadOnly:y},F.id)),!W&&r.jsx(i.Input,{id:e,name:o,type:"text",value:c,placeholder:g.length===0?n:"",disabled:x,readOnly:y,autoFocus:k,onChange:j,onKeyDown:z,onFocus:E,onBlur:P,autoComplete:"off",...D}),W&&r.jsxs(i.Text,{fontSize:i.Typography.fontSizes[m],color:"color-gray-500",fontStyle:"italic",...f==null?void 0:f.placeholder,children:["Maximum ",w," tags reached"]})]})]}),u]})})},Ud=e=>{const o=gn(e),{tags:t,...n}=e;return r.jsx(un,{...o,...n})};function Gd(e){const o=setTimeout(e,0),t=setTimeout(e,10),n=setTimeout(e,50);return[o,t,n]}const hn=({value:e,defaultValue:o="",length:t=6,onChange:n,onChangeText:l,onComplete:a,onKeyDown:c,onKeyPress:g,onBlur:s,onFocus:u,isReadOnly:h,isDisabled:f,pattern:m,stepValues:p,pasteTransformer:b})=>{var Z,X;const x=e!==void 0,y=x?e:o,[k,I]=d.useState((y==null?void 0:y.slice(0,t))||""),[T,C]=d.useState(!1),[w,j]=d.useState(!1),[z,E]=d.useState(null),[P,H]=d.useState(null),S=d.useRef(null),$=d.useRef(null),A=d.useRef({value:k,onChange:n||(()=>{}),isIOS:typeof window<"u"&&((X=(Z=window==null?void 0:window.CSS)==null?void 0:Z.supports)==null?void 0:X.call(Z,"-webkit-touch-callout","none"))}),_=d.useRef({prev:[null,null,"none"]}),V=m?typeof m=="string"?new RegExp(m):m:null;d.useEffect(()=>{x&&e!==k&&I((e==null?void 0:e.slice(0,t))||"")},[x,e,t,k]);const B=d.useCallback(N=>{let Q=N;if(p&&p.length>0&&N){const R=parseInt(N,10);if(!isNaN(R)){let ee=p[0],re=Math.abs(R-ee);for(let ne=1;ne<p.length;ne++){const ge=Math.abs(R-p[ne]);ge<re&&(re=ge,ee=p[ne])}Q=ee.toString()}}I(Q),n&&n(Q),l&&l(Q),a&&Q.length===t&&a(Q)},[n,l,a,t,p]),W=d.useCallback(N=>{N&&S.current!==N&&Object.defineProperty(S,"current",{value:N,writable:!0})},[]),L=d.useCallback(N=>{const Q=N.currentTarget.value.slice(0,t);if(Q.length>0&&V&&!V.test(Q)){N.preventDefault();return}B(Q),S.current&&(S.current.value=Q)},[t,V,B,S]),D=d.useCallback(()=>{var N;if(S.current){const Q=Math.min(S.current.value.length,t-1),R=S.current.value.length;(N=S.current)==null||N.setSelectionRange(Q,R),E(Q),H(R)}C(!0)},[t]),F=d.useCallback(()=>{C(!1)},[]),q=d.useCallback(N=>{c&&c(N)},[]),O=d.useCallback(N=>{g&&g(N)},[]),U=d.useCallback(N=>{const Q=S.current;if(!N.clipboardData||!Q)return;const R=N.clipboardData.getData("text/plain"),ee=b?b(R):R;N.preventDefault();const re=Q.selectionStart||0,ne=Q.selectionEnd||0,Y=(re!==ne?k.slice(0,re)+ee+k.slice(ne):k.slice(0,re)+ee+k.slice(re)).slice(0,t);if(Y.length>0&&V&&!V.test(Y))return;Q.value=Y,B(Y),I(Y);const v=Math.min(Y.length,t-1),oe=Y.length;Q.setSelectionRange(v,oe),E(v),H(oe)},[t,b,V,B,k,I]);return d.useEffect(()=>{const N=S.current,Q=$.current;if(!N||!Q)return;A.current.value!==N.value&&A.current.onChange&&A.current.onChange(N.value),_.current.prev=[N.selectionStart,N.selectionEnd,N.selectionDirection];function R(){if(document.activeElement!==N){E(null),H(null);return}const ne=(N==null?void 0:N.selectionStart)??null,ge=(N==null?void 0:N.selectionEnd)??null,me=(N==null?void 0:N.selectionDirection)??null,Y=(N==null?void 0:N.maxLength)??0,v=(N==null?void 0:N.value)??"",oe=_.current.prev;let K=-1,J=-1,ie="none";if(v.length!==0&&ne!==null&&ge!==null){const ae=ne===ge,We=ne===v.length&&v.length<Y;if(ae&&!We){const Ie=ne;if(Ie===0)K=0,J=1,ie="forward";else if(Ie===Y)K=Ie-1,J=Ie,ie="backward";else if(Y>1&&v.length>1){let Xt=0;if(oe[0]!==null&&oe[1]!==null){ie=Ie<oe[1]?"backward":"forward";const c0=oe[0]===oe[1]&&oe[0]<Y;ie==="backward"&&!c0&&(Xt=-1)}K=Xt+Ie,J=Xt+Ie+1}}K!==-1&&J!==-1&&K!==J&&S.current&&S.current.setSelectionRange(K,J,ie)}const ue=K!==-1?K:ne,fe=J!==-1?J:ge,xe=ie!=="none"?ie:me;E(ue),H(fe),_.current.prev=[ue,fe,xe]}document.addEventListener("selectionchange",R,{capture:!0}),R(),document.activeElement===N&&C(!0);const ee=()=>{Q&&Q.style.setProperty("--root-height",`${N.clientHeight}px`)};ee();const re=new window.ResizeObserver(ee);return re.observe(N),()=>{document.removeEventListener("selectionchange",R,{capture:!0}),re.disconnect()}},[]),d.useEffect(()=>{Gd(()=>{var ee,re,ne,ge;(ee=S.current)==null||ee.dispatchEvent(new Event("input"));const N=(re=S.current)==null?void 0:re.selectionStart,Q=(ne=S.current)==null?void 0:ne.selectionEnd,R=(ge=S.current)==null?void 0:ge.selectionDirection;N!==null&&Q!==null&&N!==void 0&&Q!==void 0&&(E(N),H(Q),_.current.prev=[N,Q,R||"none"])})},[k,T]),{value:k,setValue:B,isFocused:T,setIsFocused:C,isHovered:w,setIsHovered:j,inputRef:S,containerRef:$,mirrorSelectionStart:z,mirrorSelectionEnd:P,setMirrorSelectionStart:E,setMirrorSelectionEnd:H,setInputRef:W,handleChange:L,handleFocus:D,handleBlur:F,handleKeyDown:q,handleKeyPress:O,handlePaste:U}},Yd=d.createContext({slots:[],isFocused:!1,isHovering:!1}),vd=`
|
|
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 Ye(e,o){try{e.insertRule(o)}catch{console.error("input-otp could not insert CSS rule:",o)}}const mn=({id:e,name:o,label:t,value:n="",length:l=6,onChange:a,onChangeText:c,onComplete:d,helperText:s,placeholder:u="",shadow:h,views:f={},size:m="md",shape:p="rounded",variant:b="outline",gap:x=8,type:y="text",error:k=!1,isFocused:w=!1,isHovered:T=!1,isDisabled:C=!1,isReadOnly:I=!1,isAutoFocus:j=!1,setValue:z,setIsFocused:V,setIsHovered:W,inputRef:H,containerRef:S,mirrorSelectionStart:B,mirrorSelectionEnd:A,setMirrorSelectionStart:E,setMirrorSelectionEnd:P,handlePaste:$,handleChange:_,handleFocus:L,handleBlur:D,handleKeyDown:F,handleKeyPress:q,secureTextEntry:O,isFirstColumn:N,stepValues:Z,setInputRef:X,onBlur:G=()=>{},onClick:Q=()=>{},onFocus:R=()=>{},...ee})=>{i.useTheme();const re=!!t,ne=g.useMemo(()=>({slots:Array.from({length:l}).map((Y,v)=>{const oe=w&&B!==null&&A!==null&&(B===A&&v===B||v>=B&&v<A),K=n[v]!==void 0?n[v]:null,J=n[0]!==void 0?null:(u==null?void 0:u[v])??null;return{char:K,placeholderChar:J,isActive:oe,hasFakeCaret:oe&&K===null}}),isFocused:w,isHovering:!C&&T}),[w,T,C,l,A,B,u,n]);g.useEffect(()=>{j&&H.current&&H.current.focus()},[j,H]),g.useEffect(()=>{if(!document.getElementById("input-otp-style")){const Y=document.createElement("style");if(Y.id="input-otp-style",document.head.appendChild(Y),Y.sheet){const v="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;";Ye(Y.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),Ye(Y.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Ye(Y.sheet,`[data-input-otp]:autofill { ${v} }`),Ye(Y.sheet,`[data-input-otp]:-webkit-autofill { ${v} }`),Ye(Y.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; } }"),Ye(Y.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const ge=()=>r.jsx(i.Horizontal,{gap:x,width:"100%",justifyContent:"center",minHeight:m==="xs"?"32px":m==="sm"?"36px":m==="md"?"40px":m==="lg"?"48px":"56px",...f.container,children:ne.slots.map((Y,v)=>r.jsxs(Me,{size:m,error:k,shape:p,views:f,variant:b,value:Y.char||"",color:"theme-primary",isHovered:T,isDisabled:C,isReadOnly:I,isFocused:Y.isActive,showLabel:!1,onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),justifyContent:"center",alignItems:"center",width:"100%",position:"relative",height:m==="xs"?"32px":m==="sm"?"36px":m==="md"?"40px":m==="lg"?"48px":"56px",...f.container,children:[Y.char?r.jsx(i.View,{textAlign:"center",fontSize:m==="xs"?"14px":m==="sm"?"16px":m==="md"?"18px":m==="lg"?"20px":"24px",fontWeight:"medium",...f.text,children:y==="password"?"•":Y.char}):Y.placeholderChar?r.jsx(i.View,{textAlign:"center",fontSize:m==="xs"?"14px":m==="sm"?"16px":m==="md"?"18px":m==="lg"?"20px":"24px",color:"color-gray-400",opacity:.5,...f.text,children:Y.placeholderChar}):null,Y.hasFakeCaret&&r.jsx(i.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}-${v}`))}),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:Xd})}),r.jsxs(Te,{helperText:s,error:k,views:f,...ee,children:[re&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:k,...f.label,children:t}),r.jsxs(i.View,{ref:S,"data-input-otp-container":!0,position:"relative",cursor:C?"default":"text",userSelect:"none",pointerEvents:"none",children:[r.jsx(vd.Provider,{value:ne,children:ge()}),r.jsx(i.View,{position:"absolute",inset:0,pointerEvents:"none",children:r.jsx(i.Input,{ref:Y=>X(Y),"data-input-otp":!0,"data-input-otp-placeholder-shown":n.length===0||void 0,"data-input-otp-mss":B,"data-input-otp-mse":A,id:e||o,name:o,type:y==="password"?"password":"text",inputMode:y!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:l,readOnly:I,disabled:C,placeholder:u,value:n,onChange:_,onKeyDown:F,onPaste:$,onFocus:L,onBlur:D,onClick:Q,onMouseOver:()=>W(!0),onMouseLeave:()=>W(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${l} digits`,style:me,...f.input})})]})]})]})},Kd=e=>{const{value:o}=e,{value:t,setValue:n,isFocused:l,setIsFocused:a,isHovered:c,setIsHovered:d,inputRef:s,containerRef:u,mirrorSelectionStart:h,mirrorSelectionEnd:f,setMirrorSelectionStart:m,setMirrorSelectionEnd:p,setInputRef:b,handleChange:x,handleFocus:y,handleBlur:k,handleKeyDown:w,handlePaste:T,handleKeyPress:C}=fn(e),I=o!==void 0?o:t;return r.jsx(mn,{...e,value:I,setValue:n,isFocused:l,setIsFocused:a,isHovered:c,setIsHovered:d,inputRef:s,containerRef:u,mirrorSelectionStart:h,mirrorSelectionEnd:f,setMirrorSelectionStart:m,setMirrorSelectionEnd:p,setInputRef:b,handleChange:x,handleFocus:y,handleBlur:k,handleKeyDown:w,handleKeyPress:C,handlePaste:T,stepValues:e.stepValues})},pn=g.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Qd=()=>g.useContext(pn),Zd=({children:e,autoFocus:o=!1,initFocus:t,onChange:n=()=>{},...l})=>{const a=ye.useFormikContext();g.useEffect(()=>{n(a.values)},[a.values]);const c=g.useRef({}),d=g.useRef([]),s=(f,m)=>{c.current[f]=m,d.current.includes(f)||d.current.push(f)},u=f=>{var m;if(o){const b=d.current.indexOf(f)+1;b<d.current.length?(m=c.current[d.current[b]])==null||m.focus():a.onSubmit&&a.onSubmit(a.values)}},h={active:o,focusNextInput:u,setInputRef:s,handleSubmitEditing:u,getReturnKeyType:f=>d.current.indexOf(f)===d.current.length-1?"done":"next"};return g.useEffect(()=>{var f,m;o&&(t&&c.current[t]?(f=c.current[t])==null||f.focus():d.current[0]&&((m=c.current[d.current[0]])==null||m.focus()))},[o,t]),r.jsx(pn.Provider,{value:h,children:r.jsx(i.Form,{...l,children:e})})},Jd=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{}}},se=({name:e,type:o,...t})=>{const n=Qd(),{touched:l,errors:a,submitCount:c,values:d,setFieldTouched:s,setFieldValue:u}=ye.useFormikContext(),h=k=>{var w;u(e,k),(w=t.onChangeText)==null||w.call(t,k)},f=k=>{var w;u(e,k),(w=t.onChange)==null||w.call(t,k)},m=()=>{s(e,!0)},p=k=>{k.key==="Enter"&&(k.preventDefault(),n.focusNextInput(e))},b=["text","password","email","digits"].includes(o),x=ye.getIn(l,e)||c>0?ye.getIn(a,e):void 0,y=ye.getIn(d,e);return{...Jd(o),...t,value:y,error:x,onBlur:m,onKeyPress:p,...b?{onChangeText:h}:{onChange:f},...n.active?{handleKeyPress:p}:{}}},Rd=e=>{let{value:o,...t}=se(e);t.isChecked=o;const n=Nr(e);return r.jsx(Gr,{...n,...t})},eg=({defaultIsSelected:e=!1,isChecked:o})=>{const[t,n]=g.useState(!1),[l,a]=g.useState(o!==void 0?o:e);return g.useEffect(()=>{o!==void 0&&a(o)},[o]),{isHovered:t,setIsHovered:n,isSelected:l,setIsSelected:a}},og={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"}},tg={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"}},rg={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{backgroundColor:"transparent",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300"}},ng={selected:{backgroundColor:"theme-primary"},unselected:{backgroundColor:"transparent"}},Pt={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"}}},Wt={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"}}},ag=({id:e,icon:o,name:t,label:n,value:l,isChecked:a,onChange:c,onValueChange:d,shadow:s={},labelPosition:u="right",size:h="md",error:f=!1,isSelected:m=!1,isHovered:p=!1,isDisabled:b=!1,isReadOnly:x=!1,defaultIsSelected:y=!1,setIsSelected:k=()=>{},setIsHovered:w=()=>{},views:T={radio:{},label:{}},infoText:C,helperText:I,...j})=>{const z=()=>w(!p),V=()=>{!x&&!b&&(k&&k(!0),c&&c(l),d&&d(l))},W=a||m?"selected":"unselected",H=f?Pt.error[W]:b?Pt.disabled[W]:p?Pt.hover[W]:{},S=f?Wt.error[W]:b?Wt.disabled[W]:p?Wt.hover[W]:{},B={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:f?"color-red-600":b?"color-gray-400":"color-gray-700",cursor:b?"not-allowed":x?"default":"pointer",opacity:b?.6:1,transition:"all 0.2s ease",...T.label},radio:{...rg[W],...H,borderRadius:"50%",backgroundColor:"color-white",...og[h],transition:"all 0.2s ease",...s,...T.radio},dot:{...ng[W],...S,borderRadius:"50%",...tg[h],transition:"all 0.2s ease"}};return r.jsxs(so,{htmlFor:e,as:"div",onClick:V,onMouseEnter:z,onMouseLeave:z,size:i.Typography.fontSizes[h],...B.container,...j,children:[r.jsxs(i.Vertical,{gap:8,children:[" ",r.jsxs(i.Horizontal,{gap:12,alignItems:"center",children:[" ",u==="left"&&n&&r.jsx(i.Text,{size:h,fontWeight:"500",...T==null?void 0:T.label,children:n}),r.jsx(i.Center,{...B.radio,children:(a||m)&&r.jsx(i.View,{...B.dot})}),u==="right"&&n&&r.jsx(i.Text,{size:h,fontWeight:"500",...T==null?void 0:T.label,children:n})]}),C&&r.jsx(i.Text,{marginLeft:u==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15px",...T==null?void 0:T.infoText,children:C})]}),f&&r.jsx(i.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:f})]})},lg=e=>{let{value:o,...t}=se(e);t.isChecked=o===e.value;const n=eg(e);return r.jsx(ag,{...n,...t})},bn=e=>{const{value:o,onChange:t,onSubmit:n,autoFocus:l=!0,loading:a=!1,disabled:c=!1,isAgentRunning:d=!1,onStopAgent:s,sandboxId:u,onUploadProgress:h,onUploadSuccess:f,onUploadError:m,onFileUpload:p}=e,b=o!==void 0&&t!==void 0,[x,y]=g.useState(""),k=b?o:x,[w,T]=g.useState([]),[C,I]=g.useState([]),[j,z]=g.useState(!1),[V,W]=g.useState(0),[H,S]=g.useState([]),[B,A]=g.useState(!1),E=g.useRef(null),[P,$]=g.useState(!1),[_,L]=g.useState("gpt-4"),[D]=g.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"}]),F=g.useRef(null),q=g.useRef(null),[O,N]=g.useState(e.showGuideTip||!1);g.useEffect(()=>{l&&F.current&&F.current.focus()},[l]),g.useEffect(()=>()=>{w.forEach(K=>{})},[w]);const Z=K=>{b&&t?t(K):y(K)},X=K=>{if(K.preventDefault(),!k.trim()&&w.length===0||a||c&&!d)return;if(d&&s){s();return}let J=k;if(w.length>0){const fe=w.map(xe=>`[Uploaded File: ${URL.createObjectURL(xe)}}]`).join(`
|
|
25
|
+
`;function Ye(e,o){try{e.insertRule(o)}catch{console.error("input-otp could not insert CSS rule:",o)}}const fn=({id:e,name:o,label:t,value:n="",length:l=6,onChange:a,onChangeText:c,onComplete:g,helperText:s,placeholder:u="",shadow:h,views:f={},size:m="md",shape:p="rounded",variant:b="outline",gap:x=8,type:y="text",error:k=!1,isFocused:I=!1,isHovered:T=!1,isDisabled:C=!1,isReadOnly:w=!1,isAutoFocus:j=!1,setValue:z,setIsFocused:E,setIsHovered:P,inputRef:H,containerRef:S,mirrorSelectionStart:$,mirrorSelectionEnd:A,setMirrorSelectionStart:_,setMirrorSelectionEnd:V,handlePaste:B,handleChange:W,handleFocus:L,handleBlur:D,handleKeyDown:F,handleKeyPress:q,secureTextEntry:O,isFirstColumn:U,stepValues:Z,setInputRef:X,onBlur:N=()=>{},onClick:Q=()=>{},onFocus:R=()=>{},...ee})=>{i.useTheme();const re=!!t,ne=d.useMemo(()=>({slots:Array.from({length:l}).map((Y,v)=>{const oe=I&&$!==null&&A!==null&&($===A&&v===$||v>=$&&v<A),K=n[v]!==void 0?n[v]:null,J=n[0]!==void 0?null:(u==null?void 0:u[v])??null;return{char:K,placeholderChar:J,isActive:oe,hasFakeCaret:oe&&K===null}}),isFocused:I,isHovering:!C&&T}),[I,T,C,l,A,$,u,n]);d.useEffect(()=>{j&&H.current&&H.current.focus()},[j,H]),d.useEffect(()=>{if(!document.getElementById("input-otp-style")){const Y=document.createElement("style");if(Y.id="input-otp-style",document.head.appendChild(Y),Y.sheet){const v="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;";Ye(Y.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),Ye(Y.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Ye(Y.sheet,`[data-input-otp]:autofill { ${v} }`),Ye(Y.sheet,`[data-input-otp]:-webkit-autofill { ${v} }`),Ye(Y.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; } }"),Ye(Y.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const ge=()=>r.jsx(i.Horizontal,{gap:x,width:"100%",justifyContent:"center",minHeight:m==="xs"?"32px":m==="sm"?"36px":m==="md"?"40px":m==="lg"?"48px":"56px",...f.container,children:ne.slots.map((Y,v)=>r.jsxs(Me,{size:m,error:k,shape:p,views:f,variant:b,value:Y.char||"",color:"theme-primary",isHovered:T,isDisabled:C,isReadOnly:w,isFocused:Y.isActive,showLabel:!1,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),justifyContent:"center",alignItems:"center",width:"100%",position:"relative",height:m==="xs"?"32px":m==="sm"?"36px":m==="md"?"40px":m==="lg"?"48px":"56px",...f.container,children:[Y.char?r.jsx(i.View,{textAlign:"center",fontSize:m==="xs"?"14px":m==="sm"?"16px":m==="md"?"18px":m==="lg"?"20px":"24px",fontWeight:"medium",...f.text,children:y==="password"?"•":Y.char}):Y.placeholderChar?r.jsx(i.View,{textAlign:"center",fontSize:m==="xs"?"14px":m==="sm"?"16px":m==="md"?"18px":m==="lg"?"20px":"24px",color:"color-gray-400",opacity:.5,...f.text,children:Y.placeholderChar}):null,Y.hasFakeCaret&&r.jsx(i.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}-${v}`))}),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:vd})}),r.jsxs(Te,{helperText:s,error:k,views:f,...ee,children:[re&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:k,...f.label,children:t}),r.jsxs(i.View,{ref:S,"data-input-otp-container":!0,position:"relative",cursor:C?"default":"text",userSelect:"none",pointerEvents:"none",children:[r.jsx(Yd.Provider,{value:ne,children:ge()}),r.jsx(i.View,{position:"absolute",inset:0,pointerEvents:"none",children:r.jsx(i.Input,{ref:Y=>X(Y),"data-input-otp":!0,"data-input-otp-placeholder-shown":n.length===0||void 0,"data-input-otp-mss":$,"data-input-otp-mse":A,id:e||o,name:o,type:y==="password"?"password":"text",inputMode:y!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:l,readOnly:w,disabled:C,placeholder:u,value:n,onChange:W,onKeyDown:F,onPaste:B,onFocus:L,onBlur:D,onClick:Q,onMouseOver:()=>P(!0),onMouseLeave:()=>P(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${l} digits`,style:me,...f.input})})]})]})]})},Xd=e=>{const{value:o}=e,{value:t,setValue:n,isFocused:l,setIsFocused:a,isHovered:c,setIsHovered:g,inputRef:s,containerRef:u,mirrorSelectionStart:h,mirrorSelectionEnd:f,setMirrorSelectionStart:m,setMirrorSelectionEnd:p,setInputRef:b,handleChange:x,handleFocus:y,handleBlur:k,handleKeyDown:I,handlePaste:T,handleKeyPress:C}=hn(e),w=o!==void 0?o:t;return r.jsx(fn,{...e,value:w,setValue:n,isFocused:l,setIsFocused:a,isHovered:c,setIsHovered:g,inputRef:s,containerRef:u,mirrorSelectionStart:h,mirrorSelectionEnd:f,setMirrorSelectionStart:m,setMirrorSelectionEnd:p,setInputRef:b,handleChange:x,handleFocus:y,handleBlur:k,handleKeyDown:I,handleKeyPress:C,handlePaste:T,stepValues:e.stepValues})},mn=d.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Kd=()=>d.useContext(mn),Qd=({children:e,autoFocus:o=!1,initFocus:t,onChange:n=()=>{},...l})=>{const a=ye.useFormikContext();d.useEffect(()=>{n(a.values)},[a.values]);const c=d.useRef({}),g=d.useRef([]),s=(f,m)=>{c.current[f]=m,g.current.includes(f)||g.current.push(f)},u=f=>{var m;if(o){const b=g.current.indexOf(f)+1;b<g.current.length?(m=c.current[g.current[b]])==null||m.focus():a.onSubmit&&a.onSubmit(a.values)}},h={active:o,focusNextInput:u,setInputRef:s,handleSubmitEditing:u,getReturnKeyType:f=>g.current.indexOf(f)===g.current.length-1?"done":"next"};return d.useEffect(()=>{var f,m;o&&(t&&c.current[t]?(f=c.current[t])==null||f.focus():g.current[0]&&((m=c.current[g.current[0]])==null||m.focus()))},[o,t]),r.jsx(mn.Provider,{value:h,children:r.jsx(i.Form,{...l,children:e})})},Zd=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{}}},se=({name:e,type:o,...t})=>{const n=Kd(),{touched:l,errors:a,submitCount:c,values:g,setFieldTouched:s,setFieldValue:u}=ye.useFormikContext(),h=k=>{var I;u(e,k),(I=t.onChangeText)==null||I.call(t,k)},f=k=>{var I;u(e,k),(I=t.onChange)==null||I.call(t,k)},m=()=>{s(e,!0)},p=k=>{k.key==="Enter"&&(k.preventDefault(),n.focusNextInput(e))},b=["text","password","email","digits"].includes(o),x=ye.getIn(l,e)||c>0?ye.getIn(a,e):void 0,y=ye.getIn(g,e);return{...Zd(o),...t,value:y,error:x,onBlur:m,onKeyPress:p,...b?{onChangeText:h}:{onChange:f},...n.active?{handleKeyPress:p}:{}}},Jd=e=>{let{value:o,...t}=se(e);t.isChecked=o;const n=qr(e);return r.jsx(Ur,{...n,...t})},Rd=({defaultIsSelected:e=!1,isChecked:o})=>{const[t,n]=d.useState(!1),[l,a]=d.useState(o!==void 0?o:e);return d.useEffect(()=>{o!==void 0&&a(o)},[o]),{isHovered:t,setIsHovered:n,isSelected:l,setIsSelected:a}},eg={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"}},og={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"}},tg={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{backgroundColor:"transparent",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300"}},rg={selected:{backgroundColor:"theme-primary"},unselected:{backgroundColor:"transparent"}},Et={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"}}},Pt={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"}}},ng=({id:e,icon:o,name:t,label:n,value:l,isChecked:a,onChange:c,onValueChange:g,shadow:s={},labelPosition:u="right",size:h="md",error:f=!1,isSelected:m=!1,isHovered:p=!1,isDisabled:b=!1,isReadOnly:x=!1,defaultIsSelected:y=!1,setIsSelected:k=()=>{},setIsHovered:I=()=>{},views:T={radio:{},label:{}},infoText:C,helperText:w,...j})=>{const z=()=>I(!p),E=()=>{!x&&!b&&(k&&k(!0),c&&c(l),g&&g(l))},P=a||m?"selected":"unselected",H=f?Et.error[P]:b?Et.disabled[P]:p?Et.hover[P]:{},S=f?Pt.error[P]:b?Pt.disabled[P]:p?Pt.hover[P]:{},$={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:f?"color-red-600":b?"color-gray-400":"color-gray-700",cursor:b?"not-allowed":x?"default":"pointer",opacity:b?.6:1,transition:"all 0.2s ease",...T.label},radio:{...tg[P],...H,borderRadius:"50%",backgroundColor:"color-white",...eg[h],transition:"all 0.2s ease",...s,...T.radio},dot:{...rg[P],...S,borderRadius:"50%",...og[h],transition:"all 0.2s ease"}};return r.jsxs(so,{htmlFor:e,as:"div",onClick:E,onMouseEnter:z,onMouseLeave:z,size:i.Typography.fontSizes[h],...$.container,...j,children:[r.jsxs(i.Vertical,{gap:8,children:[" ",r.jsxs(i.Horizontal,{gap:12,alignItems:"center",children:[" ",u==="left"&&n&&r.jsx(i.Text,{size:h,fontWeight:"500",...T==null?void 0:T.label,children:n}),r.jsx(i.Center,{...$.radio,children:(a||m)&&r.jsx(i.View,{...$.dot})}),u==="right"&&n&&r.jsx(i.Text,{size:h,fontWeight:"500",...T==null?void 0:T.label,children:n})]}),C&&r.jsx(i.Text,{marginLeft:u==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15px",...T==null?void 0:T.infoText,children:C})]}),f&&r.jsx(i.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:f})]})},ag=e=>{let{value:o,...t}=se(e);t.isChecked=o===e.value;const n=Rd(e);return r.jsx(ng,{...n,...t})},pn=e=>{const{value:o,onChange:t,onSubmit:n,autoFocus:l=!0,loading:a=!1,disabled:c=!1,isAgentRunning:g=!1,onStopAgent:s,sandboxId:u,onUploadProgress:h,onUploadSuccess:f,onUploadError:m,onFileUpload:p}=e,b=o!==void 0&&t!==void 0,[x,y]=d.useState(""),k=b?o:x,[I,T]=d.useState([]),[C,w]=d.useState([]),[j,z]=d.useState(!1),[E,P]=d.useState(0),[H,S]=d.useState([]),[$,A]=d.useState(!1),_=d.useRef(null),[V,B]=d.useState(!1),[W,L]=d.useState("gpt-4"),[D]=d.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"}]),F=d.useRef(null),q=d.useRef(null),[O,U]=d.useState(e.showGuideTip||!1);d.useEffect(()=>{l&&F.current&&F.current.focus()},[l]),d.useEffect(()=>()=>{I.forEach(K=>{})},[I]);const Z=K=>{b&&t?t(K):y(K)},X=K=>{if(K.preventDefault(),!k.trim()&&I.length===0||a||c&&!g)return;if(g&&s){s();return}let J=k;if(I.length>0){const fe=I.map(xe=>`[Uploaded File: ${URL.createObjectURL(xe)}}]`).join(`
|
|
26
26
|
`);J=J?`${J}
|
|
27
27
|
|
|
28
|
-
${fe}`:fe}let ie=_,ue=!1;_.endsWith("-thinking")&&(ie=_.replace(/-thinking$/,""),ue=!0),n(J,{model_name:ie,enable_thinking:ue}),b||y(""),T([]),I([])},G=K=>{T(J=>J.filter((ie,ue)=>ue!==K)),!u&&C.length>K&&I(J=>J.filter((ie,ue)=>ue!==K))},Q=K=>{K.preventDefault(),K.stopPropagation(),$(!0)},R=K=>{K.preventDefault(),K.stopPropagation(),$(!1)},ee=g.useCallback(K=>{!K||K.length===0||(I(J=>[...J,...K]),T(J=>[...J,...K]),S(J=>[...J,...K]),z(!0))},[I,T]),re=g.useCallback(()=>{if(H.length>0&&!B&&p){A(!0);const K=H[0];E.current=K,W(0);try{p(K)}catch(J){S(ie=>ie.slice(1)),A(!1),E.current=null,W(0),z(ie=>H.length-1>0||!1),m==null||m(J)}}else H.length===0&&j&&(z(!1),W(0))},[H,B,p,j,m]);g.useEffect(()=>{re()},[H,B,re]);const ne="active",ge=K=>!0,me=()=>{N(!1),e.onGuideClose&&e.onGuideClose()},Y=K=>{b&&t?t(K.text):y(K.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(K),F.current&&F.current.focus()},v=g.useCallback(()=>C,[C]),oe=g.useCallback(()=>I([]),[]);return{onSubmit:n,getPendingFiles:v,clearPendingFiles:oe,value:k,handleChange:Z,handleSubmit:X,editableRef:F,fileInputRef:q,isUploading:j,uploadProgress:V,isDraggingOver:P,uploadedFiles:w,pendingFiles:C,removeUploadedFile:G,setPendingFiles:I,setUploadedFiles:T,setIsUploading:z,startUpload:ee,selectedModel:_,handleModelChange:L,modelOptions:D,subscriptionStatus:ne,canAccessModel:ge,handleDragOver:Q,handleDragLeave:R,isGuideTipShown:O,hideGuideTip:me,handlePromptExampleSelect:Y}},cg={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}},yn={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"}}}},ig={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},sg={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"}},dg={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"}},xn=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,gg=({openDelay:e=200,closeDelay:o=300}={})=>{const[t,n]=g.useState(!1),l=g.useRef(null),a=g.useRef(null),c=g.useRef(null),d=g.useRef(null),s=g.useMemo(()=>xn("hovercard-content"),[]),u=g.useMemo(()=>xn("hovercard-trigger"),[]),h=g.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),f=g.useCallback(()=>{h(),t||(l.current=setTimeout(()=>{n(!0)},e))},[t,e,h]),m=g.useCallback(()=>{h(),t&&(a.current=setTimeout(()=>{n(!1)},o))},[t,o,h]),p=g.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null)},[]);return g.useEffect(()=>()=>h(),[h]),{isOpen:t,openCard:f,closeCard:m,cancelCloseTimer:p,triggerRef:c,contentRef:d,contentId:s,triggerId:u}},kn=g.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),ug=({children:e,value:o})=>r.jsx(kn.Provider,{value:o,children:e}),Cn=()=>{const e=g.useContext(kn);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},hg=({children:e,views:o,asChild:t=!1,...n})=>{const{openCard:l,closeCard:a,triggerRef:c,contentId:d,triggerId:s}=Cn(),p={ref:c,onMouseEnter:()=>l(),onMouseLeave:()=>a(),onFocus:()=>l(),onBlur:()=>a(),id:s,"aria-describedby":d,...o==null?void 0:o.container,...n};if(t&&g.isValidElement(e)){const b=g.Children.only(e);return g.cloneElement(b,{...p,...b.props})}return r.jsx(i.View,{position:"relative",display:"inline-block",...p,children:e})},fg=({children:e,views:o,side:t="bottom",align:n="center",sideOffset:l=8,style:a,backgroundColor:c="white",borderRadius:d="4px",boxShadow:s="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:u="12px",minWidth:h="50px",maxWidth:f="300px",...m})=>{const{isOpen:p,cancelCloseTimer:b,closeCard:x,contentRef:y,triggerRef:k,contentId:w,triggerId:T}=Cn(),{ref:C,relation:I}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});g.useEffect(()=>{k!=null&&k.current&&(C==null?void 0:C.current)!==k.current&&C&&(C.current=k.current)},[k,C,p]);const j=()=>b(),z=()=>x();if(!p)return null;const V=()=>{if(!I||!(k!=null&&k.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const S=k.current.getBoundingClientRect();let B=t;t==="bottom"&&I.space.vertical==="top"?B="top":t==="top"&&I.space.vertical==="bottom"?B="bottom":t==="right"&&I.space.horizontal==="left"?B="left":t==="left"&&I.space.horizontal==="right"&&(B="right");let A=0,E=0;switch(B){case"bottom":A=S.left+S.width/2,E=S.bottom+l;break;case"top":A=S.left+S.width/2,E=S.top-l;break;case"right":A=S.right+l,E=S.top+S.height/2;break;case"left":A=S.left-l,E=S.top+S.height/2;break}return{position:"fixed",left:A,top:E,zIndex:1e3,transform:W(B)}},W=S=>{switch(S){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)"}},H=V();return r.jsx(i.View,{ref:y,id:w,role:"tooltip","aria-labelledby":T,onMouseEnter:j,onMouseLeave:z,backgroundColor:c,borderRadius:d,boxShadow:s,padding:u,minWidth:h,maxWidth:f,style:{...H,...a},...o==null?void 0:o.container,...m,children:e})},be=({children:e,views:o,openDelay:t,closeDelay:n,...l})=>{const a=gg({openDelay:t,closeDelay:n});return r.jsx(ug,{value:a,children:r.jsx(i.View,{position:"relative",display:"inline-block",...o==null?void 0:o.container,...l,children:e})})};be.Trigger=hg,be.Content=fg;const mg=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:l="120px",showPreviews:a=!1,views:c={}})=>{if(e.length===0)return null;const d=g.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(i.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:l,overflowY:"auto",...c==null?void 0:c.container,children:e.map((s,u)=>{const h=URL.createObjectURL(s)||(s==null?void 0:s.path)||(s==null?void 0:s.url)||"",f=s.type.startsWith("image/"),m=s.type.startsWith("video/"),p=s.type.startsWith("audio/");return r.jsx(i.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,...c==null?void 0:c.item,children:a&&r.jsxs(be,{children:[r.jsxs(be.Trigger,{children:[f&&r.jsx(i.Image,{src:h,alt:s.name,width:"60px",height:"60px",objectFit:"cover"}),m&&r.jsx(i.View,{as:"video",src:h,alt:s.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),p&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(jo,{widthHeight:24,color:"color-black"})}),!f&&!m&&!p&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(to,{widthHeight:24,color:"color-black"})}),t&&r.jsx(i.Button,{...cg.attachmentRemove,onClick:b=>{b.stopPropagation(),t(u)},"aria-label":`Remove ${s.name}`,children:"×"})]}),r.jsxs(be.Content,{children:[f&&r.jsx(i.Image,{src:h,alt:s.name,maxWidth:"100%"}),m&&r.jsx(i.View,{as:"video",src:h,controls:!0,maxWidth:"100%"}),p&&r.jsx(i.View,{as:"audio",src:h,controls:!0,width:"100%"}),r.jsxs(i.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...c==null?void 0:c.name,children:[s.name," (",d(s.size),")"]})]})]})},u)})})},wn=g.forwardRef(({value:e,onChange:o,placeholder:t="Type your message...",disabled:n=!1,autoFocus:l=!0,suggestions:a=[],onSuggestionSelect:c,showSuggestions:d=!1,mentionData:s=[],mentionTrigger:u="@",onMentionSelect:h,maxHeight:f="200px",minHeight:m="40px",views:p={}},b)=>{var ge,me;const x=g.useRef(e),[y,k]=g.useState(-1),[w,T]=g.useState(!e),C=g.useRef(null),[I,j]=g.useState(!1),[z,V]=g.useState(!1),[W,H]=g.useState(""),[S,B]=g.useState(-1),[A,E]=g.useState(-1),[P,$]=g.useState([]),{ref:_,relation:L}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[D,F]=g.useState({x:0,y:0}),[q,O]=g.useState({x:0,y:0});g.useEffect(()=>{const Y=b;Y.current&&e!==x.current&&(Y.current.textContent=e,x.current=e,T(!e))},[e,b]),g.useEffect(()=>{l&&b&&typeof b=="object"&&b.current&&b.current.focus()},[l,b]);const N=()=>{const Y=window.getSelection();if(!Y||Y.rangeCount===0)return-1;const v=Y.getRangeAt(0),oe=v.cloneRange();return oe.selectNodeContents(b&&typeof b=="object"&&b.current?b.current:document.body),oe.setEnd(v.endContainer,v.endOffset),oe.toString().length},Z=g.useCallback((Y,v)=>{const oe=Y.substring(0,v),K=oe.lastIndexOf(u);if(K!==-1){const J=oe.substring(K+1);if(!J.includes(" ")){const ue=J.toLowerCase(),fe=s.filter(ae=>ae.name.toLowerCase().includes(ue));H(ue),B(K),$(fe),V(fe.length>0),E(0);const xe=X();F(xe);return}}V(!1),H(""),B(-1),E(-1)},[s,u]);g.useEffect(()=>{C.current&&_&&(_.current=C.current)},[C,_]);const X=g.useCallback((Y=200)=>{if(!C.current)return{x:0,y:0};const v=C.current.getBoundingClientRect();if(L){const ie=L.space.vertical==="top";return{x:v.left,y:ie?v.top-Y-8:v.bottom+8}}const oe=window.innerHeight,K={top:v.top,bottom:oe-v.bottom},J=K.bottom<Y+8&&K.top>K.bottom;return{x:v.left,y:J?v.top-Y-8:v.bottom+8}},[L]),G=g.useCallback(()=>{j(!0);const Y=X();O(Y)},[X]),Q=g.useCallback(()=>{setTimeout(()=>{j(!1),k(-1)},150)},[]),R=Y=>{const v=Y.currentTarget.textContent||"";if(v!==x.current){o(v),x.current=v,T(!v);const oe=N();Z(v,oe)}},ee=g.useCallback(Y=>{if(b&&typeof b=="object"&&b.current){const v=b.current.textContent||"",oe=v.substring(0,S),K=v.substring(S+u.length+W.length),J=oe+u+Y.name+" "+K;o(J),x.current=J,b.current.textContent=J;const ie=oe.length+u.length+Y.name.length+1;setTimeout(()=>{var ue;if(b.current){const fe=document.createRange(),xe=window.getSelection(),ae=b.current.firstChild;ae&&xe&&(fe.setStart(ae,Math.min(ie,((ue=ae.textContent)==null?void 0:ue.length)||0)),fe.collapse(!0),xe.removeAllRanges(),xe.addRange(fe))}},0)}V(!1),H(""),B(-1),E(-1),h&&h(Y)},[S,u,W,o,h,b]),re=g.useCallback(Y=>{c&&c(Y),k(-1)},[c]),ne=Y=>{if(z&&P.length>0){if(Y.key==="ArrowDown"){Y.preventDefault(),E(v=>v<P.length-1?v+1:0);return}if(Y.key==="ArrowUp"){Y.preventDefault(),E(v=>v>0?v-1:P.length-1);return}if((Y.key==="Tab"||Y.key==="Enter")&&A>=0){Y.preventDefault(),ee(P[A]);return}if(Y.key==="Escape"){V(!1),E(-1);return}}if(d&&a.length>0){if(Y.key==="ArrowDown"){Y.preventDefault(),k(v=>v<a.length-1?v+1:0);return}if(Y.key==="ArrowUp"){Y.preventDefault(),k(v=>v>0?v-1:a.length-1);return}if(Y.key==="Tab"&&y>=0){Y.preventDefault(),re(a[y]);return}if(Y.key==="Escape"){k(-1);return}}};return r.jsxs(i.View,{ref:C,width:"100%",position:"relative",...p==null?void 0:p.container,children:[r.jsxs(i.View,{width:"100%",minHeight:m,maxHeight:f,overflowY:"auto",position:"relative",children:[w&&r.jsx(i.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...p==null?void 0:p.placeholder,children:t}),r.jsx(i.View,{as:"div",ref:b,contentEditable:!n,suppressContentEditableWarning:!0,onInput:R,onKeyDown:ne,onFocus:G,onBlur:Q,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",...p==null?void 0:p.input})]}),z&&P.length>0&&r.jsx(i.View,{position:"fixed",left:D.x,top:D.y,width:((ge=C.current)==null?void 0:ge.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",...p==null?void 0:p.mentionContainer,children:r.jsxs(i.Vertical,{gap:0,children:[P.map((Y,v)=>r.jsx(i.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:v===A?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>ee(Y),onMouseEnter:()=>E(v),_hover:{backgroundColor:"color-blue-50"},...p==null?void 0:p.mentionItem,children:r.jsxs(i.Vertical,{gap:4,children:[r.jsxs(i.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[u,Y.name]}),Y.description&&r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",children:Y.description})]})},Y.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",u,")",L&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})}),d&&a.length>0&&!z&&I&&!e&&r.jsx(i.View,{position:"fixed",left:q.x,top:q.y,width:((me=C.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",...p==null?void 0:p.suggestionsContainer,children:r.jsxs(i.Vertical,{gap:0,children:[a.map((Y,v)=>r.jsx(i.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:v===y?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>re(Y),onMouseEnter:()=>k(v),_hover:{backgroundColor:"color-blue-50"},...p==null?void 0:p.suggestionItem,children:r.jsxs(i.Vertical,{gap:4,children:[r.jsx(i.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:Y.text}),Y.description&&r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",children:Y.description})]})},Y.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",L&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})})]})});wn.displayName="EditableInput";const pg=({examples:e,onSelect:o,views:t={}})=>{const{getColor:n}=i.useTheme();return!e||e.length===0?null:r.jsx(i.Horizontal,{gap:8,overflowX:"auto",padding:"8px 0",width:"100%",...t==null?void 0:t.container,children:e.map(l=>r.jsx(i.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(l),_hover:{backgroundColor:"color-gray-200"},...t==null?void 0:t.item,children:r.jsx(i.Text,{fontSize:"14px",color:"color-gray-700",...t==null?void 0:t.text,children:l.text})},l.id))})},bg=({onRecordingComplete:e,onRecordingStart:o,views:t={}})=>{const{recording:n,paused:l,audioBlob:a,analyserNode:c,startRecording:d,stopRecording:s}=sr();g.useEffect(()=>{if(a){const h=new File([a],`recording-${Date.now()}.webm`,{type:a.type||"audio/webm;codecs=opus"});e(h)}},[a]);const u=g.useCallback(()=>{d(),o==null||o()},[]);return r.jsxs(i.Horizontal,{alignItems:"center",gap:4,children:[r.jsx(i.View,{minWidth:90,children:n&&c&&r.jsx(mt,{analyserNode:c,isPaused:l})}),r.jsx(i.View,{as:"button",type:"button",onClick:n?s:u,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(Mo,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(it,{widthHeight:16,color:"currentColor",filled:!1})})]})},In=g.memo(({onSubmit:e,placeholder:o="Say what you want and Kimmy will surprise you",loading:t=!1,disabled:n=!1,isAgentRunning:l=!1,enableAudioRecording:a=!1,leftButtons:c,rightButtons:d,onStopAgent:s,loadingText:u="Agent is working...",autoFocus:h=!0,sandboxId:f,hideAttachments:m=!1,attachmentText:p="",promptExamples:b=[],suggestions:x=[],errorMessage:y,size:k="md",shape:w="rounded",variant:T="default",views:C={},mentionData:I=[],mentionTrigger:j="@",onMentionSelect:z,onAudioRecordingStart:V,onAudioRecordingStop:W,value:H,handleChange:S,handleSubmit:B,editableRef:A,fileInputRef:E,isUploading:P,uploadProgress:$,isDraggingOver:_,uploadedFiles:L,removeUploadedFile:D,setPendingFiles:F,setUploadedFiles:q,setIsUploading:O,startUpload:N,selectedModel:Z,handleModelChange:X,modelOptions:G,subscriptionStatus:Q,canAccessModel:R,isGuideTipShown:ee,hideGuideTip:re,handlePromptExampleSelect:ne,handleDragOver:ge,handleDragLeave:me,onChange:Y,...v})=>{i.useTheme();const oe=g.useMemo(()=>({...yn.container,...ig[w],...C==null?void 0:C.container}),[w,C==null?void 0:C.container]),K=g.useMemo(()=>({...yn.content,...sg[k],...dg[T],...C==null?void 0:C.content}),[k,T,C==null?void 0:C.content]),J=((H==null?void 0:H.trim().length)??0)>0||L.length>0,ie=g.useCallback(ae=>{N([ae]),W==null||W(ae)},[N,W]),ue=g.useCallback(ae=>{const We=ae.filter(Ie=>Ie.size>52428800?(console.error(`File size exceeds 50MB limit: ${Ie.name}`),!1):!0);We.length>0&&N(We)},[N]),fe=g.useCallback(ae=>{if(ae.preventDefault(),ae.stopPropagation(),me(ae),ae.dataTransfer.files.length>0){const We=Array.from(ae.dataTransfer.files);ue(We)}},[me,ue]),xe=g.useMemo(()=>[...I||[],...L.map((ae,We)=>({id:`file-${We}`,name:ae.name}))],[I,L]);return r.jsxs(i.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...oe,...v,onDragOver:ge,onDragLeave:me,onDrop:fe,children:[b.length>0&&r.jsx(pg,{examples:b,onSelect:ne,views:{container:C==null?void 0:C.promptExamples,item:C==null?void 0:C.promptExampleItem}}),l&&r.jsxs(i.Horizontal,{justifyContent:"center",alignItems:"center",gap:8,padding:"8px 0",animate:{from:{opacity:0,y:-10},to:{opacity:1,y:0},duration:"0.3s"},...C==null?void 0:C.loadingIndicator,children:[r.jsx(dt,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(i.Text,{color:"color-gray-500",children:u})]}),r.jsx(i.View,{position:"relative",width:"100%",overflow:"visible",children:r.jsxs(i.View,{as:"form",onSubmit:B,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...K,...oe,paddingHorizontal:16,paddingVertical:10,backgroundColor:_?"color-blue-50":void 0,children:[r.jsx(mg,{files:L,sandboxId:f,onRemove:D,showPreviews:!0,views:{container:C==null?void 0:C.attachments,item:C==null?void 0:C.attachmentItem,name:C==null?void 0:C.attachmentName,size:C==null?void 0:C.attachmentSize,removeButton:C==null?void 0:C.attachmentRemove}}),r.jsx(wn,{ref:A,value:H||"",onChange:S,placeholder:o,disabled:n&&!l,autoFocus:h,suggestions:x||[],showSuggestions:x&&x.length>0&&!H,onSuggestionSelect:ae=>{S(ae.text)},mentionData:xe,mentionTrigger:j,onMentionSelect:z,views:{container:{},input:C==null?void 0:C.editableInput}}),r.jsxs(i.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[r.jsxs(i.Horizontal,{gap:8,alignItems:"center",children:[!m&&r.jsx(Wo,{accept:"*/*",icon:r.jsx(ro,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:ue,isLoading:P,progress:$||0,text:p,fileType:"file",renderError:({errorMessage:ae})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},...C==null?void 0:C.fileButton}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:w==="rounded"?"50%":4,padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:ae=>ae.size>50*1024*1024?"File size exceeds 50MB limit":null}),c]}),r.jsxs(i.Horizontal,{gap:8,alignItems:"center",children:[a&&r.jsx(bg,{onRecordingStart:V,onRecordingComplete:ie,views:{button:C==null?void 0:C.recordButton}}),r.jsx(i.View,{as:"button",type:"button",onClick:B,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:l?"theme-error":J?"theme-primary":"color-gray-300",color:"color-white",borderRadius:w==="rounded"?"50%":4,border:"none",cursor:J?"pointer":"not-allowed",disabled:!J||t||n&&!l,transition:"all 0.2s ease",_hover:{backgroundColor:l?"color-red-600":J?"color-blue-600":"color-gray-300"},...C==null?void 0:C.submitButton,children:l?r.jsx(Mo,{widthHeight:16,color:"currentColor",filled:!1}):t?r.jsx(no,{type:"quarter",size:16,color:"color-white"}):r.jsx(st,{widthHeight:16,color:"currentColor",filled:!1})}),d]})]})]})}),y&&r.jsx(i.Text,{color:"theme-error",marginTop:"4px",...C==null?void 0:C.bottomTip,children:y})]})}),yg=e=>{const{name:o,onSubmit:t,...n}=e,[l,a]=g.useState([]),c=se({name:o,type:"text"}),d=m=>{c.onChangeText&&c.onChangeText(m)},s=(m,p)=>{t?t(m,p):d(m)},u=()=>l,h=()=>a([]),f=bn({...n,value:c.value||"",onChange:d,onSubmit:s,getPendingFiles:u,clearPendingFiles:h});return r.jsx(In,{...n,...f,value:c.value||"",onChange:d,onSubmit:s,error:c.error,getPendingFiles:u,clearPendingFiles:h})},xg=e=>{const o=se(e),t=Yr(o);return r.jsx(vr,{...t,...o})},kg=e=>{const o=se(e),t=nn();return r.jsx(an,{...t,...o})},Cg=e=>{const o=se(e),t=Xr(e);return r.jsx(Qr,{...t,...o})},wg=e=>{let o=se(e);o.selected=o.value;const t=zr(e);return r.jsx(Hr,{...t,...o})},Ig=e=>{const o=se(e),t=Br(e);return r.jsx(Ar,{...t,...o})},Tg=e=>{const{name:o,...t}=e,{values:n,errors:l,touched:a,submitCount:c,setFieldValue:d,setFieldTouched:s}=ye.useFormikContext(),u=ye.getIn(n,o)||[],h=ye.getIn(a,o)||c>0?ye.getIn(l,o):void 0,f=g.useCallback(y=>{var w;const k=Array.isArray(y)?y.filter(T=>typeof T=="string"):[];d(o,k),(w=e.onTagsChange)==null||w.call(e,k)},[o,d,e.onTagsChange]),m=g.useCallback(()=>{var y;s(o,!0),(y=e.onBlur)==null||y.call(e)},[o,s,e.onBlur]),p=un({...t,tags:u,onTagsChange:f,onBlur:m}),{tags:b,...x}=p;return r.jsx(hn,{...x,...t,tags:b,error:h})},jg=e=>{const o=se(e),t=Or(e);return r.jsx(qr,{...t,...o})},Sg=e=>{const o=se(e),{value:t,...n}=Mt(e);return r.jsx(go,{...n,...o})},Mg=({visibleIcon:e=r.jsx(ut,{widthHeight:14}),hiddenIcon:o=r.jsx(gt,{widthHeight:14}),...t})=>{const n=se(t),{isVisible:l,setIsVisible:a,...c}=ln(n);return r.jsx(go,{...c,type:l?"text":"password",isClearable:!1,right:r.jsx(i.View,{onClick:()=>{t.isDisabled||a(!l)},children:l?e:o})})},zg=({items:e,placeholder:o,searchPlaceholder:t,isMulti:n=!1,...l})=>{const a=se(l),c=cn(e,o,t);g.useEffect(()=>{if(n&&Array.isArray(a.value))c.setSelectedItems(a.value);else if(!n&&a.value){const s=typeof a.value=="object"?a.value:e.find(u=>u.value===a.value);s&&c.setSelectedItem(s)}},[a.value,n,e]);const d=s=>{a.onChange(s)};return r.jsx(gn,{...c,...a,items:e,placeholder:o,isMulti:n,onSelect:d})},ve=(e,o,t)=>Math.min(Math.max(e,o),t),Vg=(e,o,t,n,l,a,c)=>{const d=n-t;let s;if(a==="horizontal"){const u=o.width,h=e-o.left;s=ve(h/u,0,1)}else{const u=o.height,h=o.bottom-e;s=ve(h/u,0,1)}if(c&&c.length>0){const u=t+s*d;let h=c[0],f=Math.abs(u-h);for(let m=1;m<c.length;m++){const p=Math.abs(u-c[m]);p<f&&(f=p,h=c[m])}return h}else{const u=t+s*d,h=Math.round(u/l)*l;return ve(h,t,n)}},Tn=({min:e=0,max:o=100,step:t=1,value:n=0,defaultValue:l,onChange:a,onDrag:c,orientation:d="horizontal",isDisabled:s=!1,stepValues:u})=>{const h=ve(n??l??e,e,o),[f,m]=g.useState(h),[p,b]=g.useState(!1),[x,y]=g.useState(!1),k=g.useRef(null),w=g.useRef(null),T=n!==void 0,C=T?n:f;g.useEffect(()=>{T&&m(ve(n,e,o))},[n,T,e,o]);const I=g.useCallback(B=>{const A=ve(B,e,o);T||m(A),a&&A!==C&&a(A),p&&c&&c(A)},[T,e,o,a,C,p,c]),j=g.useCallback(B=>{if(s||!k.current)return;const A=k.current.getBoundingClientRect();let E;"touches"in B?E=d==="horizontal"?B.touches[0].clientX:B.touches[0].clientY:E=d==="horizontal"?B.clientX:B.clientY;const P=Vg(E,A,e,o,t,d,u);I(P)},[e,o,t,d,I,s,u]),z=g.useCallback(B=>{if(s)return;B.preventDefault(),b(!0),j(B);const A=P=>{j(P)},E=()=>{b(!1),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",E)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",E),document.addEventListener("touchmove",A),document.addEventListener("touchend",E)},[j,s]),V=g.useCallback(B=>{w.current&&w.current.contains(B.target)||z(B)},[z]),W=g.useCallback(B=>{if(s)return;let A=C;switch(B.key){case"ArrowLeft":case"ArrowDown":A=C-t;break;case"ArrowRight":case"ArrowUp":A=C+t;break;case"Home":A=e;break;case"End":A=o;break;default:return}B.preventDefault(),I(A)},[C,e,o,t,I,s]),H=o-e,S=H===0?0:(C-e)/H*100;return{currentValue:C,isDragging:p,isHovered:x,setIsHovered:y,trackRef:k,thumbRef:w,handleThumbMouseDown:z,handleTrackMouseDown:V,handleKeyDown:W,thumbPositionPercent:S}},jn={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%"}},Sn={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}},Mn={square:0,rounded:4,pill:24},zn=(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"}}))(),Eg={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}},Pg={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},Vn=g.memo(({min:e=0,max:o=100,step:t=1,currentValue:n,stepValues:l,shape:a="rounded",size:c="md",variant:d="default",orientation:s="horizontal",isDisabled:u=!1,showValue:h=!1,showTooltip:f=!1,backgroundColor:m="theme-primary",label:p,helperText:b,themeMode:x,shadow:y={},isDragging:k,isHovered:w,setIsHovered:T,trackRef:C,thumbRef:I,handleThumbMouseDown:j,handleTrackMouseDown:z,handleKeyDown:V,thumbPositionPercent:W,ariaLabel:H="Slider",views:S={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:B,onDrag:A,...E})=>{var G,Q;const{getColorHex:P,themeMode:$}=i.useTheme(),_=x||$,L=g.useMemo(()=>P(m,{themeMode:_}),[P,m,_]),D=g.useMemo(()=>P("theme-disabled",{themeMode:_}),[P,_]),F=g.useMemo(()=>P(zn[d].backgroundColor,{themeMode:_}),[P,d,_]),q=s==="vertical",{trackCrossAxisSize:O,thumbSize:N}=Eg[c]||{trackCrossAxisSize:jn[c].height,thumbSize:Sn[c].width||16},Z=r.jsxs(i.Vertical,{width:"100%",gap:8,...S.container,...E,children:[p&&r.jsxs(i.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[r.jsx(i.Text,{fontSize:14,fontWeight:500,...S.label,children:p}),h&&r.jsx(i.Text,{fontSize:14,color:"color-blueGray-500",...S.valueLabel,children:n})]}),r.jsxs(i.View,{ref:C,position:"relative",cursor:u?"not-allowed":"pointer",opacity:u?.6:1,onMouseDown:z,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),...jn[c],borderRadius:Mn[a],backgroundColor:F,...zn[d],...y,...S.track,children:[l&&l.length>0&&r.jsx(r.Fragment,{children:l.map(R=>{const ee=(R-e)/(o-e)*100;return r.jsx(i.View,{position:"absolute",top:"50%",left:`${ee}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",backgroundColor:u?D:L,zIndex:1,...S.stepMarks},R)})}),r.jsx(i.View,{position:"absolute",top:0,left:0,height:"100%",width:`${W}%`,backgroundColor:u?D:L,borderRadius:Mn[a],transition:"width 0.1s ease-in-out",...S.progress,...S.filledTrack}),r.jsx(i.View,{ref:I,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":u,"aria-label":H,position:"absolute",top:"50%",left:`${W}%`,borderRadius:"50%",backgroundColor:"color-white",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:`2px solid ${u?D:L}`,transition:k?"none":"transform 0.1s ease-in-out",transform:w?"translate(-50%, -50%) scale(1.1)":"translate(-50%, -50%)",zIndex:2,onMouseDown:j,onTouchStart:j,onKeyDown:V,...Sn[c],...S.thumb,children:f&&(w||k)&&r.jsx(i.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,...S.tooltip,children:r.jsx(i.Text,{...(G=S.tooltip)==null?void 0:G.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),b&&r.jsx(jt,{children:b})]}),X=r.jsxs(i.Center,{...Pg[s],position:"relative",onMouseEnter:()=>!u&&T(!0),onMouseLeave:()=>!u&&T(!1),...E,...S==null?void 0:S.container,children:[p&&r.jsxs(i.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[r.jsx(i.Text,{fontSize:14,fontWeight:500,...S.label,children:p}),h&&r.jsx(i.Text,{fontSize:14,color:"color-blueGray-500",...S.valueLabel,children:n})]}),r.jsxs(i.View,{ref:C,position:"relative",borderRadius:O/2,backgroundColor:u?D:F,cursor:u?"not-allowed":"pointer",width:q?`${O}px`:"100%",height:q?"100%":`${O}px`,onMouseDown:z,onTouchStart:z,...S==null?void 0:S.track,children:[l&&l.length>0&&r.jsx(r.Fragment,{children:l.map(R=>{const ee=(R-e)/(o-e)*100;return r.jsx(i.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:u?D:L,zIndex:1,...q?{bottom:`${ee}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${ee}%`,top:"50%",transform:"translate(-50%, -50%)"},...S.stepMarks},R)})}),r.jsx(i.View,{position:"absolute",borderRadius:O/2,backgroundColor:u?D:L,...q?{bottom:0,left:0,width:"100%",height:`${W}%`}:{top:0,left:0,height:"100%",width:`${W}%`},...S==null?void 0:S.filledTrack,...S==null?void 0:S.progress}),r.jsx(i.View,{ref:I,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":u,"aria-label":H,position:"absolute",width:`${N}px`,height:`${N}px`,borderRadius:"50%",backgroundColor:u?D:L,border:"2px solid color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:u?"not-allowed":"grab",transform:q?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:k?"none":"left 0.1s, bottom 0.1s",...q?{left:"50%",bottom:`${W}%`}:{top:"50%",left:`${W}%`},onMouseDown:j,onTouchStart:j,onKeyDown:V,...S==null?void 0:S.thumb,children:f&&(w||k)&&r.jsx(i.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...q?{left:"100%",marginLeft:"8px",bottom:"0",transform:"translateY(50%)"}:{bottom:"100%",left:"50%",marginBottom:"8px",transform:"translateX(-50%)"},...S==null?void 0:S.tooltip,children:r.jsx(i.Text,{...(Q=S==null?void 0:S.tooltip)==null?void 0:Q.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),b&&r.jsx(jt,{marginTop:8,children:b})]});return q||f?X:Z}),Wg=e=>{const o=se(e),t=Tn({...e,value:o.value!==void 0?Number(o.value):void 0,onChange:n=>{var l;o.onChange(n),(l=e.onChange)==null||l.call(e,n)}});return r.jsx(Vn,{...e,...t,...o})},_g=e=>{const o=se(e),{isFocused:t,setIsFocused:n,isHovered:l,setIsHovered:a,inputRef:c,containerRef:d,mirrorSelectionStart:s,mirrorSelectionEnd:u,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:m,handleFocus:p,handleBlur:b,handleKeyDown:x,handlePaste:y}=fn(e),k=g.useCallback(T=>{o.onChange&&o.onChange(T),e.onComplete&&T.length===(e.length||6)&&e.onComplete(T),c.current&&(c.current.value=T)},[o,e,c]),w=g.useCallback(T=>{const C=T.currentTarget.value.slice(0,e.length||6);k(C),c.current&&(c.current.value=C)},[e.length,k,c]);return r.jsx(mn,{...e,...o,setValue:k,isFocused:t,setIsFocused:n,isHovered:l,setIsHovered:a,inputRef:c,containerRef:d,mirrorSelectionStart:s,mirrorSelectionEnd:u,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:m,handleChange:w,handleFocus:p,handleBlur:b,handleKeyDown:x,handlePaste:y,stepValues:e.stepValues})},$g=e=>Array.isArray(e)?e:e==null?[]:[e],En=({name:e,uploadFile:o,onUploadSuccess:t,onUploadError:n,transformResponse:l,onMultipleFileSelect:a,onFileSelect:c,multiple:d=!0,...s})=>{const{setFieldValue:u,setFieldTouched:h,values:f}=ye.useFormikContext(),[m,p]=g.useState(!1),[b,x]=g.useState(0),y=g.useCallback(async T=>{if(!T||T.length===0)return;h(e,!0,!0),p(!0);const C=[];for(const I of T){x(0);try{const j=await o(I,V=>{x(V??0)}),z=l?l(j,I):j;C.push(z),t==null||t(I,z)}catch(j){n==null||n(I,j)}}if(C.length>0){const I=$g(ye.getIn(f,e));u(e,[...I,...C],!0),x(100)}else x(0);p(!1)},[e,n,t,h,u,l,o,f]),k=g.useCallback(async T=>{a==null||a(T),await y(T)},[y,a]),w=g.useCallback(async T=>{c==null||c(T),await y([T])},[y,c]);return r.jsx(Wo,{...s,multiple:d,onMultipleFileSelect:d?k:void 0,onFileSelect:d?void 0:w,isLoading:m,progress:b})};En.displayName="FormikUploader";const Hg=e=>{let o=se(e);o.selected=o.value;const t=Dr(e);return r.jsx(Fr,{...t,...o})},Pn=e=>{const[o,t]=g.useState(!1),[n,l]=g.useState(e);return{isHovered:o,setIsHovered:t,isToggle:n,setIsToggled:l}},Bg={square:0,rounded:4,pill:24},Lg=(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"}}),Wn=g.memo(({children:e,shape:o="rounded",variant:t="ghost",isHovered:n,setIsHovered:l,isDisabled:a,isToggle:c,setIsToggled:d,onToggle:s,views:u,backgroundColor:h,color:f,themeMode:m,...p})=>{const{getColor:b,themeMode:x}=i.useTheme(),y=m??x,w=b(a?"theme-disabled":h??f??"theme-primary",{themeMode:y}),C=g.useMemo(()=>Lg(w,y==="light"),[w,y])[t],I=!!(c||n),j=g.useCallback(()=>l(!n),[n,l]),z=g.useCallback(()=>{a||d(V=>{const W=!V;return s&&s(W),W})},[a,d,s]);return r.jsx(i.Center,{role:"Toggle",padding:o==="pill"?"10px 12px":"8px",width:"fit-content",cursor:a?"not-allowed":"pointer",borderRadius:Bg[o],onClick:z,onMouseEnter:j,onMouseLeave:()=>l(!1),...C,...I&&{backgroundColor:w,color:y==="light"?"color-black":"color-white"},...p,...u==null?void 0:u.container,children:e})}),Ag=({children:e,shape:o,variant:t,isDisabled:n,isToggled:l=!1,onToggle:a,...c})=>{const d=se(c),{isHovered:s,setIsHovered:u,isToggle:h,setIsToggled:f}=Pn(d.value??l);g.useEffect(()=>{f(d.value??l)},[d.value,l]);const m=p=>{f(p),d.onChange(p),a==null||a(p)};return r.jsx(Wn,{shape:o,variant:t,isDisabled:n,isHovered:s,setIsHovered:u,isToggle:h,setIsToggled:f,onToggle:m,...c,children:e})},_n=()=>{const[e,o]=g.useState([]);return{activeToggles:e,setActiveToggles:o}},$n=({children:e,shape:o,variant:t,isDisabled:n,isToggled:l=!1,onToggle:a,...c})=>{const{isHovered:d,setIsHovered:s,isToggle:u,setIsToggled:h}=Pn(l);return g.useEffect(()=>{h(l)},[l]),r.jsx(Wn,{shape:o,variant:t,isDisabled:n,isHovered:d,setIsHovered:s,isToggle:u,setIsToggled:h,onToggle:a,...c,children:e})},Hn=({items:e,onToggleChange:o,activeToggles:t,setActiveToggles:n,shape:l="rounded",variant:a="ghost",views:c})=>{const d=g.useCallback((s,u)=>{n(h=>{let f;return u?f=h.includes(s)?h:[...h,s]:f=h.filter(m=>m!==s),o==null||o(f),f})},[o,n]);return r.jsx(i.Horizontal,{role:"ToggleGroup",display:"flex",gap:5,...c==null?void 0:c.container,children:e.map(s=>r.jsx($n,{role:`toggle-${s.id}`,shape:l,variant:a,isToggled:t.includes(s.id)||s.isActive,onToggle:u=>d(s.id,u),isDisabled:s.isDisabled,views:c==null?void 0:c.toggle,children:s.value},s.id))})},Dg=({items:e,shape:o,variant:t,onToggleChange:n,...l})=>{const a=se(l),{activeToggles:c,setActiveToggles:d}=_n();g.useEffect(()=>{Array.isArray(a.value)&&d(a.value)},[a.value]);const s=u=>{d(u),a.onChange(u),n==null||n(u)};return r.jsx(Hn,{items:e,shape:o,variant:t,activeToggles:c,setActiveToggles:d,onToggleChange:s,...l})},Bn=["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"],Ln=e=>{const{value:o,defaultValue:t,onChange:n,isOpen:l,onOpen:a,onClose:c,closeOnSelect:d=!0}=e,[s,u]=g.useState(l??!1),[h,f]=g.useState(o??t),[m,p]=g.useState(""),b=g.useRef(null),x=g.useRef(null);g.useEffect(()=>{o!==void 0&&f(o)},[o]),g.useEffect(()=>{l!==void 0&&u(l)},[l]);const y=g.useMemo(()=>m?Bn.filter(I=>I.toLowerCase().includes(m.toLowerCase())).slice(0,100):Bn.slice(0,100),[m]);g.useEffect(()=>{const I=j=>{s&&b.current&&x.current&&!b.current.contains(j.target)&&!x.current.contains(j.target)&&k()};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[s]);const k=g.useCallback(()=>{l===void 0&&u(!1),c&&c()},[c,l]),w=g.useCallback(()=>{const I=!s;l===void 0&&u(I),I?(a&&a(),p("")):c&&c()},[s,a,c,l]),T=g.useCallback(I=>{o===void 0&&f(I),n&&n(I),d&&k()},[n,d,k,o]),C=g.useCallback(I=>{p(I)},[]);return{isOpen:s,selectedIcon:h,searchQuery:m,filteredIcons:y,handleToggle:w,handleIconSelect:T,handleSearchChange:C,handleClose:k,triggerRef:b,dropdownRef:x}},Xe={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"}},An=({label:e,placeholder:o="Select an icon",helperText:t,views:n={},size:l="md",shape:a="default",variant:c="default",error:d=!1,isDisabled:s=!1,isReadOnly:u=!1,showSearch:h=!0,isOpen:f,selectedIcon:m,searchQuery:p,filteredIcons:b,handleToggle:x,handleIconSelect:y,handleSearchChange:k,triggerRef:w,dropdownRef:T,handleClose:C,onChange:I,...j})=>{const{getColor:z}=i.useTheme(),V={...Xe.container,...n==null?void 0:n.container},W={...Xe.trigger,...Fg[l],...Og[a],...qg[c],...d&&{borderColor:"color-red-500"},...s&&{opacity:.6,cursor:"not-allowed"},...n==null?void 0:n.trigger},H={...Xe.dropdown,...n==null?void 0:n.dropdown},S={...Xe.iconGrid,...n==null?void 0:n.iconGrid};return r.jsxs(i.View,{...V,...j,children:[e&&r.jsx(i.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...n==null?void 0:n.label,children:e}),r.jsxs(i.View,{ref:w,onClick:s||u?void 0:x,...W,children:[r.jsx(i.Horizontal,{alignItems:"center",gap:8,width:"100%",children:m?r.jsxs(i.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[r.jsx(To,{name:m,widthHeight:16}),r.jsx(i.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m})]}):r.jsx(i.Text,{color:"color-gray-500",fontSize:"inherit",children:o})}),!u&&!s&&r.jsx(le,{widthHeight:16,color:"color-gray-500",orientation:f?"up":"down"})]}),f&&r.jsxs(i.View,{ref:T,...H,children:[h&&r.jsx(i.View,{...Xe.searchInput,...n==null?void 0:n.searchInput,children:r.jsx(uo,{placeholder:"Search icons...",value:p,onChange:B=>k(B),size:"sm",autoFocus:!0})}),r.jsx(i.View,{...S,children:b.length>0?b.map(B=>r.jsx(i.View,{...Xe.iconItem,onClick:()=>y(B),title:B,_hover:{backgroundColor:"color-gray-100"},backgroundColor:m===B?"color-blue-100":"transparent",...n==null?void 0:n.iconItem,children:r.jsx(To,{name:B,widthHeight:20})},B)):r.jsx(i.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(i.Text,{fontSize:"14px",children:"No icons found"})})})]}),t&&r.jsx(i.Text,{color:d?"color-red-500":"color-gray-600",marginTop:"4px",...n==null?void 0:n.helperText,children:t})]})},Ng=e=>{const o=se(e),t={...e,value:o.value??e.value??e.defaultValue},n=Ln(t),l=a=>{n.handleIconSelect(a),o.onChange(a)};return r.jsx(An,{...n,...t,handleIconSelect:l})},Ve={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"}},Ug={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"}},Gg={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Yg={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"}},vg={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},Xg=[{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"]}],Dn=e=>{const{value:o,defaultValue:t="",onChange:n,onEmojiSelect:l,isOpen:a,onOpen:c,onClose:d,closeOnSelect:s=!0,maxRecentEmojis:u=16,showRecentEmojis:h=!0,enabledCategories:f=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:m=[]}=e,[p,b]=g.useState(a??!1),[x,y]=g.useState(o??t),[k,w]=g.useState(""),[T,C]=g.useState("smileys"),[I,j]=g.useState([]),z=g.useRef(null),V=g.useRef(null),W=g.useMemo(()=>[...Xg,...m],[m]),H=g.useMemo(()=>{let _=W;if(T!=="recent"?_=_.filter(L=>L.category===T):_=I,k){const L=k.toLowerCase();_=_.filter(D=>D.name.toLowerCase().includes(L)||D.keywords.some(F=>F.toLowerCase().includes(L)))}return _},[W,T,I,k]);g.useEffect(()=>{o!==void 0&&y(o)},[o]),g.useEffect(()=>{a!==void 0&&b(a)},[a]),g.useEffect(()=>{if(h){const _=localStorage.getItem("emojiPicker-recentEmojis");if(_)try{j(JSON.parse(_))}catch{}}},[h]),g.useEffect(()=>{const _=L=>{p&&z.current&&V.current&&!z.current.contains(L.target)&&!V.current.contains(L.target)&&$()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[p]);const S=g.useCallback(_=>{h&&j(L=>{const D=L.filter(q=>q.emoji!==_.emoji),F=[_,...D].slice(0,u);return localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(F)),F})},[h,u]),B=g.useCallback(()=>{const _=!p;b(_),_?(c==null||c(),w(""),h&&I.length>0?C("recent"):C("smileys")):d==null||d()},[p,c,d,h,I.length]),A=g.useCallback(_=>{y(_.emoji),S(_),n==null||n(_.emoji),l==null||l(_),s&&(b(!1),d==null||d())},[n,l,s,d,S]),E=g.useCallback(_=>{w(_),_&&T==="recent"&&C("smileys")},[T]),P=g.useCallback(_=>{C(_),w("")},[]),$=g.useCallback(()=>{b(!1),d==null||d()},[d]);return{isOpen:p,selectedEmoji:x,recentEmojis:I,searchQuery:k,activeCategory:T,filteredEmojis:H,handleToggle:B,handleEmojiSelect:A,handleSearchChange:E,handleCategoryChange:P,handleClose:$,triggerRef:z,dropdownRef:V}},Fn=({id:e,name:o,label:t,placeholder:n="Select an emoji",helperText:l,views:a={},size:c="md",shape:d="default",variant:s="default",error:u=!1,isDisabled:h=!1,isReadOnly:f=!1,showSearch:m=!0,showCategories:p=!0,showRecentEmojis:b=!0,enabledCategories:x=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:y,selectedEmoji:k,recentEmojis:w,searchQuery:T,activeCategory:C,filteredEmojis:I,handleToggle:j,handleEmojiSelect:z,handleSearchChange:V,handleCategoryChange:W,triggerRef:H,dropdownRef:S,onChange:B,...A})=>{const{getColor:E}=i.useTheme(),P={...Ve.container,...a==null?void 0:a.container},$={...Ve.trigger,...Ug[c],...Gg[d],...Yg[s],...u&&{borderColor:"color-red-500"},...h&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},_={...Ve.dropdown,...a==null?void 0:a.dropdown},L={...Ve.categoryTabs,...a==null?void 0:a.categoryTabs},D={...Ve.emojiGrid,...a==null?void 0:a.emojiGrid},F=x.filter(q=>q==="recent"?b&&w.length>0:!0);return r.jsxs(i.View,{...P,...A,children:[t&&r.jsx(i.Text,{fontSize:c==="xs"?"12px":c==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...a==null?void 0:a.label,children:t}),r.jsxs(i.View,{ref:H,onClick:h||f?void 0:j,...$,children:[r.jsx(i.Horizontal,{alignItems:"center",gap:8,children:r.jsx(i.Text,{color:k?"color-gray-800":"color-gray-500",fontSize:"inherit",children:k||n})}),!f&&!h&&r.jsx(le,{widthHeight:16,color:"color-gray-500",orientation:y?"up":"down"})]}),y&&r.jsxs(i.View,{ref:S,..._,children:[m&&r.jsx(i.View,{...Ve.searchInput,...a==null?void 0:a.searchInput,children:r.jsx(uo,{placeholder:"Search emojis...",value:T,onChange:q=>V(q.target.value),size:"sm"})}),p&&r.jsx(i.View,{...L,children:F.map(q=>r.jsx(i.View,{...Ve.categoryTab,...C===q&&{borderBottomColor:"color-blue-500",color:"color-blue-600"},onClick:()=>W(q),title:q.charAt(0).toUpperCase()+q.slice(1),...a==null?void 0:a.categoryTab,children:vg[q]},q))}),r.jsx(i.View,{...D,children:I.length>0?I.map((q,O)=>r.jsx(i.View,{...Ve.emoji,onClick:()=>z(q),title:q.name,_hover:{backgroundColor:"color-gray-100"},color:"color-gray-800",...a==null?void 0:a.emoji,children:q.emoji},`${q.emoji}-${O}`)):r.jsx(i.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(i.Text,{fontSize:"14px",children:T?"No emojis found":"No emojis in this category"})})})]}),l&&r.jsx(i.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:l})]})},Kg=e=>{const o=se(e),t={...e,value:o.value??e.value??e.defaultValue},n=Dn(t),l=a=>{var c;n.handleEmojiSelect(a),o.onChange(a.emoji),(c=e.onEmojiSelect)==null||c.call(e,a)};return r.jsx(Fn,{...n,...t,handleEmojiSelect:l})},Qg=({files:e,onRemove:o,maxHeight:t="120px",views:n={}})=>{if(e.length===0)return null;const l=g.useCallback(a=>a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(1)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(i.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:t,overflowY:"auto",...n==null?void 0:n.container,children:e.map((a,c)=>{const d=a.url||"",s=a.type.startsWith("image/"),u=a.type.startsWith("video/"),h=a.type.startsWith("audio/");return r.jsx(i.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(be,{children:[r.jsx(be.Trigger,{children:r.jsxs(i.View,{position:"relative",children:[s&&d&&r.jsx(i.Image,{src:d,alt:a.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),u&&d&&r.jsx(i.View,{as:"video",src:d,alt:a.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),h&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(jo,{widthHeight:24,color:"color-black"})}),!s&&!u&&!h&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(to,{widthHeight:24,color:"color-black"})}),o&&r.jsx(i.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:f=>{f.stopPropagation(),o(c)},"aria-label":`Remove ${a.name}`,children:"×"})]})}),r.jsxs(be.Content,{children:[s&&d&&r.jsx(i.Image,{src:d,alt:a.name,maxWidth:"300px"}),u&&d&&r.jsx(i.View,{as:"video",src:d,controls:!0,maxWidth:"300px"}),h&&d&&r.jsx(i.View,{as:"audio",src:d,controls:!0,width:"100%"}),r.jsxs(i.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",fontSize:12,...n==null?void 0:n.name,children:[a.name," (",l(a.size),")"]})]})]})},c)})})},Zg=e=>{const o=Tn(e);return r.jsx(Vn,{...e,...o})},Jg=({url:e,type:o,name:t,onOpen:n})=>{const l=o.toLowerCase(),a=l.startsWith("image"),c=l.startsWith("video"),d=l.startsWith("audio"),s=()=>{n&&n()};return r.jsxs(i.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(i.Image,{src:e,alt:t,width:"100%",height:"100%",objectFit:"cover"}),c&&r.jsx(i.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:u=>u.stopPropagation()}),d&&r.jsx(i.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:u=>u.stopPropagation()}),!a&&!c&&!d&&r.jsx(to,{widthHeight:24,color:"color-gray-600"})]})},Ee=tt.create(e=>({modals:[],onHide:o=>o,onShow:(o,t)=>({name:o,props:t}),show:(o,t={},n={})=>{e(l=>({...l,modals:[...l.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}))}})),Rg=(e,o={},t={})=>{Ee.getState().show(e,o,t),Ee.getState().onShow(e,o)},_t=e=>{console.log("hideModal",e),Ee.getState().onHide(e),Ee.getState().hide(typeof e=="string"?e:void 0)},eu={square:{borderRadius:0},rounded:{borderRadius:"8px"}},ou={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"}},tu={xs:12,sm:16,md:20,lg:24,xl:28},Yo={body:{fontSize:"16px",fontWeight:"400",lineHeight:"24px",color:"color-gray-700"}},On=g.memo(({children:e,blur:o,isOpen:t=!1,isClosePrevented:n=!1,onClose:l=()=>{},position:a="center",views:c,...d})=>{const s=g.useCallback(()=>{n||l()},[n,l]);return r.jsx(i.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:s,visibility:t?"visible":"hidden",transition:"all 0.3s ease",...c==null?void 0:c.container,children:r.jsx(i.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,...ou[a],...d,...c==null?void 0:c.view,children:e})})}),ru={boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"},nu={elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},au=g.memo(({children:e,shadow:o,isFullScreen:t=!1,shape:n="rounded",views:l,isOpen:a,...c})=>{const d=typeof document!==void 0?ru:nu,s=g.useCallback(u=>{u&&u.stopPropagation&&u.stopPropagation()},[]);return r.jsx(i.Vertical,{cursor:"default",backgroundColor:"color-white",width:t?"100%":600,height:t?"100%":"fit-content",onClick:s,transition:"all 0.3s ease",...o||d,...eu[n],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...c,...l==null?void 0:l.container,children:e})}),lu=g.memo(({children:e,buttonColor:o="theme-primary",iconSize:t="md",buttonPosition:n="right",views:l,...a})=>{const c=a.onClose?a.onClose:_t,d=r.jsx(i.View,{onClick:c,children:r.jsx(pe,{widthHeight:tu[t],color:o})});return r.jsxs(i.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,...l==null?void 0:l.header,children:[n==="left"&&d,e,n==="right"&&d]})}),cu=g.memo(({children:e,views:o,...t})=>r.jsx(i.View,{paddingVertical:16,paddingHorizontal:24,fontSize:Yo.body.fontSize,fontWeight:Yo.body.fontWeight,lineHeight:Yo.body.lineHeight,color:Yo.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...t,...o==null?void 0:o.view,children:e})),iu=g.memo(({children:e,views:o,...t})=>r.jsx(i.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})),su=({modals:e,onShow:o,onHide:t})=>{const n=Ee(l=>l.modals);return o&&Ee.getState().setOnShow(o),t&&Ee.getState().setOnHide(t),n.length===0?null:r.jsx(g.Fragment,{children:n.map((l,a)=>{const c=e[l.name];return c?r.jsx(On,{isOpen:l.props.isVisible,onClose:()=>_t(l.name),blur:5,...l.overlayProps,style:{zIndex:1e3+a},children:r.jsx(c,{...l.props})},a):(console.error(`${l.name} modal doesn't exist`),null)})})},Ae=({children:e})=>r.jsx(r.Fragment,{children:e});Ae.Overlay=On,Ae.Container=au,Ae.Header=lu,Ae.Body=cu,Ae.Footer=iu,Ae.Layout=su;const qn={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},du={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"}},Nn=({isOpen:e,onClose:o,isClosePrevented:t,blur:n,children:l,...a})=>{const c=()=>{t||o()};return g.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(i.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:c,transition:"all 0.3s ease",backgroundColor:e?"color-blackAlpha-500":"transparent",backdropFilter:n?`blur(${n}px)`:void 0,pointerEvents:e?"auto":"none",...a,children:l})},Un=({placement:e="right",size:o="md",children:t,...n})=>{const l=d=>{d.stopPropagation()},c=e==="top"||e==="bottom"?{height:o==="full"?"100vh":qn[o]||o,maxHeight:"100vh"}:{width:o==="full"?"100vw":qn[o]||o,maxWidth:"100vw"};return r.jsx(i.Vertical,{position:"absolute",backgroundColor:"color-white",...du[e],...c,onClick:l,transition:"transform 0.3s ease",...n,children:t})},gu=({children:e,onClose:o,buttonPosition:t="right",...n})=>{const l=o&&r.jsx(i.View,{onClick:o,cursor:"pointer",padding:8,children:r.jsx(pe,{widthHeight:20,color:"color-gray-500"})});return r.jsxs(i.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderBottomWidth:"1px",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:t==="none"?"center":"space-between",...n,children:[t==="left"&&l,e,t==="right"&&l]})},uu=({children:e,...o})=>r.jsx(i.Vertical,{padding:24,flex:1,overflowY:"auto",...o,children:e}),hu=({children:e,...o})=>r.jsx(i.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderTopWidth:"1px",borderTopColor:"color-gray-200",alignItems:"center",justifyContent:"flex-end",gap:12,...o,children:e}),Ke=({isOpen:e,onClose:o,placement:t="right",size:n="md",isClosePrevented:l,children:a,...c})=>{const d=e?{}:{transform:t==="left"||t==="right"?`translateX(${t==="left"?"-100%":"100%"})`:`translateY(${t==="top"?"-100%":"100%"})`};return r.jsx(Nn,{isOpen:e,onClose:o,isClosePrevented:l,...c,children:r.jsx(Un,{placement:t,size:n,style:d,children:a})})};Ke.Overlay=Nn,Ke.Container=Un,Ke.Header=gu,Ke.Body=uu,Ke.Footer=hu;const fu=(e=null,o=[])=>{const[t,n]=g.useState(e),[l,a]=g.useState(o),c=g.useRef({});return{activeItemId:t,setActiveItemId:n,expandedItemIds:l,toggleExpandedItem:u=>{a(h=>h.includes(u)?h.filter(m=>m!==u):[...h,u])},isItemExpanded:u=>l.includes(u),triggerRefs:c}},$t={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"}}}},Ht={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"}},Gn={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},Qe={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"}},Yn=g.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),mu=({children:e,value:o})=>r.jsx(Yn.Provider,{value:o,children:e}),po=()=>{const e=g.useContext(Yn);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},Bt=({children:e,views:o})=>{const{orientation:t}=po(),n=t==="horizontal"?i.Horizontal:i.Vertical;return r.jsx(n,{width:"100%",...Gn[t],transition:"all 0.2s ease",borderRadius:"4px",...o==null?void 0:o.container,children:e})},vn=g.createContext({itemValue:null,isDisabled:!1}),pu=()=>{const e=g.useContext(vn);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},Lt=({item:e,value:o,isDisabled:t=!1,children:n,views:l})=>{var k;const{activeItemId:a,setActiveItemId:c,orientation:d,size:s,variant:u,onItemActivate:h}=po(),f=(e==null?void 0:e.id)||o,m=a===f,p=(e==null?void 0:e.items)&&e.items.length>0,b=(e==null?void 0:e.disabled)||t,x=()=>{b||f&&(c(f),h&&h(f))},y=d==="horizontal"?i.Horizontal:i.Vertical;return n?r.jsx(vn.Provider,{value:{itemValue:f||null,isDisabled:b},children:r.jsx(i.View,{width:"100%",cursor:b?"not-allowed":"pointer",opacity:b?.6:1,borderRadius:"4px",transition:"all 0.2s ease",...$t[s],...Ht[u],...m?Qe.active:{},_hover:b?{}:Qe.hover,...l==null?void 0:l.item,children:n})}):p&&e?r.jsxs(y,{width:"100%",flexDirection:"column",position:"relative",...l==null?void 0:l.item,children:[r.jsxs(Xn,{itemId:e.id,disabled:e.disabled,views:l,children:[e.icon&&r.jsx(i.View,{marginRight:8,...l==null?void 0:l.icon,children:e.icon}),e.label]}),r.jsx(Kn,{itemId:e.id,children:r.jsx(Bt,{children:(k=e.items)==null?void 0:k.map(w=>r.jsx(Lt,{item:w},w.id))})})]}):e?r.jsxs(i.View,{as:e.href?"a":"div",to:e.href,onClick:x,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",...$t[s],...Ht[u],...m?Qe.active:{},_hover:e.disabled?{}:Qe.hover,...l==null?void 0:l.item,children:[e.icon&&r.jsx(i.View,{marginRight:8,...l==null?void 0:l.icon,children:e.icon}),e.label]}):null},Xn=({children:e,itemId:o,disabled:t,views:n})=>{const{activeItemId:l,toggleExpandedItem:a,isItemExpanded:c,size:d,variant:s,triggerRefs:u}=po(),h=g.useRef(null),f=l===o,m=c(o);g.useEffect(()=>(h.current&&o&&(u.current[o]=h.current),()=>{o&&delete u.current[o]}),[o,u]);const p=b=>{b.preventDefault(),!t&&a(o)};return r.jsxs(i.View,{ref:h,onClick:p,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",...$t[d],...Ht[s],...f?Qe.active:{},_hover:t?{}:Qe.hover,...n==null?void 0:n.trigger,children:[r.jsx(i.View,{display:"flex",alignItems:"center",children:e}),r.jsx(i.View,{transition:"transform 0.2s ease",transform:m?"rotate(180deg)":"rotate(0deg)",...n==null?void 0:n.indicator,children:r.jsx(le,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},Kn=({children:e,itemId:o,views:t})=>{const{isItemExpanded:n,orientation:l,triggerRefs:a}=po(),c=g.useRef(null),[d,s]=g.useState({x:0,y:0,placement:l==="horizontal"?"bottom":"right"}),u=n(o);if(g.useEffect(()=>{if(u&&c.current&&o&&a.current[o]&&l==="horizontal"){const f=c.current.getBoundingClientRect(),m=a.current[o].getBoundingClientRect(),p=Math.max(f.width||200,200),b=Math.max(f.height||150,150),x=window.innerWidth,y=window.innerHeight,k={top:m.top,right:x-m.right,bottom:y-m.bottom,left:m.left},w=l==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=b+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=b+8,x:m.left,y:m.top-b-8},{placement:"right",space:k.right,fits:k.right>=p+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=p+8,x:m.left-p-8,y:m.top}]:[{placement:"right",space:k.right,fits:k.right>=p+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=p+8,x:m.left-p-8,y:m.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=b+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=b+8,x:m.left,y:m.top-b-8}],T=w.find(z=>z.fits);if(T){s({x:T.x,y:T.y,placement:T.placement});return}const C=w.reduce((z,V)=>V.space>z.space?V:z);let I=C.x,j=C.y;I+p>x&&(I=x-p-8),I<8&&(I=8),j+b>y&&(j=y-b-8),j<8&&(j=8),s({x:I,y:j,placement:C.placement})}},[u,l,o,a]),!u)return null;if(l==="vertical")return r.jsx(i.View,{paddingLeft:16,width:"100%",position:"relative",backgroundColor:"transparent",...t==null?void 0:t.container,children:e});const h={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return r.jsx(i.View,{ref:c,role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:h,...t==null?void 0:t.container,children:e})},bu=({href:e,children:o,views:t,...n})=>{const{itemValue:l,isDisabled:a}=pu(),{activeItemId:c,setActiveItemId:d,onItemActivate:s}=po(),u=c===l,h=f=>{if(a){f.preventDefault();return}l&&(d(l),s&&s(l)),n.onClick&&n.onClick(f)};return r.jsx(i.View,{as:"a",href:a?void 0:e,onClick:h,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":u?"page":void 0,"aria-disabled":a,"data-active":u?"":void 0,"data-disabled":a?"":void 0,...u?{fontWeight:"bold"}:{},...t==null?void 0:t.container,...n,children:o})},yu=({items:e,orientation:o,views:t,themeMode:n})=>{const l=o==="horizontal"?i.Horizontal:i.Vertical;return!e||e.length===0?null:r.jsx(l,{width:"100%",...Gn[o],...t==null?void 0:t.container,children:r.jsx(Bt,{views:t,children:e.map(a=>r.jsx(Lt,{item:a,views:t},a.id))})})},Ze=({items:e,children:o,orientation:t="vertical",size:n="md",variant:l="default",defaultActiveItemId:a=null,defaultExpandedItemIds:c=[],onItemActivate:d,views:s,...u})=>{const{activeItemId:h,setActiveItemId:f,expandedItemIds:m,toggleExpandedItem:p,isItemExpanded:b,triggerRefs:x}=fu(a,c);return r.jsx(mu,{value:{activeItemId:h,setActiveItemId:f,expandedItemIds:m,toggleExpandedItem:p,isItemExpanded:b,orientation:t,size:n,variant:l,onItemActivate:d,triggerRefs:x},children:e?r.jsx(yu,{items:e,orientation:t,size:n,variant:l,views:s,...u}):o})};Ze.List=Bt,Ze.Item=Lt,Ze.Trigger=Xn,Ze.Content=Kn,Ze.Link=bu;const Qn={},Zn=g.createContext({views:Qn,onRowClick:()=>{}}),xu=({children:e,views:o=Qn,onRowClick:t})=>r.jsx(Zn.Provider,{value:{views:o,onRowClick:t},children:e}),Pe=()=>g.useContext(Zn),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 Jn=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"table",borderCollapse:"collapse",...de.table,...o==null?void 0:o.table,...e})},Rn=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"thead",textAlign:"left",...de.thead,...o==null?void 0:o.thead,...e})},ea=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"th",whiteSpace:"nowrap",...de.th,...o==null?void 0:o.th,...e})},vo=e=>{const{views:o,onRowClick:t}=Pe();return r.jsx(i.Element,{as:"tr",...de.tr,...o==null?void 0:o.tr,onClick:t,...e})},At=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e.isFirstColumn?"500":"400",...de.td,...o==null?void 0:o.td,...e})},oa=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"tbody",...de.tbody,...o==null?void 0:o.tbody,...e})},ta=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"tfoot",...de.tfoot,...o==null?void 0:o.tfoot,...e})},ra=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"caption",...de.caption,...o==null?void 0:o.caption,...e})},ku=({data:e,columns:o,footer:t,caption:n,themeMode:l})=>r.jsxs(Jn,{role:"Table",children:[n&&r.jsx(ra,{children:n}),r.jsx(Rn,{children:r.jsx(vo,{children:o.map(a=>r.jsx(ea,{children:a.title},a.field))})}),r.jsx(oa,{children:e.map((a,c)=>r.jsx(vo,{children:o.map((d,s)=>r.jsx(At,{isFirstColumn:s===0,children:a[d.field]},d.field))},c))}),t&&r.jsx(ta,{children:r.jsx(vo,{children:t.map((a,c)=>r.jsx(At,{...a.props,children:a.value},c))})})]}),we=({children:e,views:o,onClick:t})=>r.jsx(xu,{views:o,onRowClick:t,children:e});we.Head=Rn,we.HeadCell=ea,we.Body=oa,we.Row=vo,we.Cell=At,we.Footer=ta,we.Caption=ra,we.Container=Jn,we.Template=ku;const Cu=(e,o,t)=>{const n=u=>u.value!==void 0?u.value:u.title,l=()=>{if(!(!e||e.length===0)){if(o!==void 0){const u=e.find(h=>n(h)===o);if(u)return u}return e[0]}},[a,c]=g.useState(l()),d=t!==void 0?e.find(u=>n(u)===t):a,s=u=>{t===void 0&&c(u)};return g.useEffect(()=>{if(t!==void 0)return;const u=l(),h=a&&e.some(f=>n(f)===n(a));u&&(!h||o!==void 0&&a&&n(a)!==o)?c(u):!u&&a&&c(void 0)},[e,o]),{activeTab:d,setActiveTab:s}},wu=(e,o,t)=>{const[n,l]=g.useState(e||null);return{activeValue:o!==void 0?o:n,setActiveValue:d=>{o===void 0&&l(d),t&&t(d)}}},Iu=g.memo(({tab:e,isActive:o,onClick:t,iconPosition:n="left",tabStyles:l,textStyles:a})=>{const c=g.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",u=e.icon&&g.isValidElement(e.icon)?g.cloneElement(e.icon,{strokeWidth:o?2.5:2}):e.icon;return r.jsxs(i.Element,{as:"div",role:"tab","aria-selected":o,tabIndex:o?0:-1,...c,...l,flexDirection:d(),gap:s(),onClick:t,"data-state":o?"active":"inactive",children:[u&&r.jsx(i.Element,{children:u},o?"active-icon":"inactive-icon"),r.jsxs(i.Element,{display:"grid",alignItems:"center",justifyContent:"center",children:[r.jsx(i.Text,{...a,fontWeight:"600",visibility:"hidden",gridColumn:"1",gridRow:"1","aria-hidden":"true",children:e.title}),r.jsx(i.Text,{...a,fontWeight:o?"600":"500",gridColumn:"1",gridRow:"1",children:e.title})]})]})}),Tu=({tabs:e=[],activeTab:o,handleTabClick:t,views:n={},renderTab:l,renderContent:a,iconPosition:c="left"})=>o?r.jsxs(i.Vertical,{width:"100%",height:"100%",...n.container,children:[r.jsx(i.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),u=()=>t(d);return l?l(d,s,u):r.jsx(Iu,{tab:d,isActive:s,onClick:u,iconPosition:c,tabStyles:{...n.tab,...s?n.activeTab:{}},textStyles:{...n.title,...s?n.activeText:{}}},d.title)})}),r.jsx(i.View,{width:"100%",height:"100%",...n.content,children:a?a(o):o.content})]}):null,na=g.createContext(null),aa=()=>{const e=g.useContext(na);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},ju=g.memo(({children:e,views:o})=>r.jsx(i.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...o==null?void 0:o.container,children:e})),Su=g.memo(({value:e,children:o,disabled:t=!1,views:n})=>{const{activeValue:l,setActiveValue:a}=aa(),c=l===e,d=g.useCallback(()=>{t||a(e)},[t,e,a]);return r.jsx(i.View,{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,padding:"12px 16px",borderBottom:"2px solid",borderBottomColor:c?"theme-primary":"transparent",color:c?"theme-primary":"color-gray-600",fontWeight:c?"600":"400",transition:"all 0.2s ease",_hover:t?{}:{color:"theme-primary"},onClick:d,...n==null?void 0:n.trigger,...c?n==null?void 0:n.activeState:{},children:o})}),Mu=g.memo(({value:e,children:o,views:t})=>{const{activeValue:n}=aa();return n!==e?null:r.jsx(i.View,{width:"100%",padding:"24px",...t==null?void 0:t.content,children:o})}),zu=({tabs:e,views:o,defaultValue:t,onTabChange:n,renderTab:l,renderContent:a,iconPosition:c="left",value:d,onValueChange:s,children:u})=>{const h=wu(t,d,s),f=Cu(e||[],t,d);if(u)return r.jsx(na.Provider,{value:h,children:u});if(e){const m=p=>{const b=x=>x.value!==void 0?x.value:x.title;(!f.activeTab||b(f.activeTab)!==b(p))&&(f.setActiveTab(p),n&&n(p))};return r.jsx(Tu,{tabs:e,views:o,activeTab:f.activeTab,handleTabClick:m,renderTab:l,renderContent:a,iconPosition:c})}return null},Xo=g.memo(zu);Xo.List=ju,Xo.Trigger=Su,Xo.Content=Mu;const Vu=e=>{const{children:o,_isInView:t=!1,alternateHighlightText:n=[],alternateAnimation:l=!1,alternateDuration:a=3e3,highlightText:c,highlightTypewriter:d=!1,highlightSlide:s=!1,highlightSlideDuration:u=500,highlightSlideStagger:h=50,highlightSlideSequential:f=!0}=e,[m,p]=g.useState(o),[b,x]=g.useState(c);return g.useEffect(()=>{if(!l||n.length===0||!t||typeof o!="string"||typeof c!="string")return p(o),x(c),()=>{};const y=o,k=c;let w=0;const T=I=>{const j=n[I],z=k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),V=new RegExp(z,"gi"),W=y.replace(V,j);p(W),x(j)};T(w);const C=setInterval(()=>{w=(w+1)%n.length,T(w)},a);return()=>clearInterval(C)},[l,n,a,c,o,t]),{finalDisplayedText:m,activeHighlightTarget:b,highlightTypewriter:d,highlightSlide:s,highlightSlideDuration:u,highlightSlideStagger:h,highlightSlideSequential:f}},Eu={xs:24,sm:36,md:48,lg:64,xl:72},Pu={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:()=>({})},Wu=({text:e,typingSpeed:o=50,pauseTime:t=500,onComplete:n,showCursor:l=!0,cursorColor:a="currentColor",textStyle:c,textComponent:d,as:s,...u})=>{const h=d||i.Text,f=Array.isArray(e)?e:[e],[m,p]=g.useState(f.map(()=>"")),[b,x]=g.useState(!1),[y,k]=g.useState(0),[w,T]=g.useState(0);g.useEffect(()=>{p(f.map(()=>"")),x(!1),k(0),T(0)},[e]),g.useEffect(()=>{if(b){n&&n();return}const I=f[y];if(w>=I.length){if(y>=f.length-1){x(!0);return}const z=setTimeout(()=>{k(V=>V+1),T(0)},t);return()=>clearTimeout(z)}const j=setTimeout(()=>{p(z=>{const V=[...z];return V[y]=I.substring(0,w+1),V}),T(z=>z+1)},o);return()=>clearTimeout(j)},[f,y,w,b,n,t,o]);const C=I=>{if(!I||typeof I!="string")return I;const j=I.split("|");return j.length===1?I:j.map((z,V)=>r.jsxs(g.Fragment,{children:[z,V<j.length-1&&r.jsx("br",{})]},V))};return r.jsx(r.Fragment,{children:m.map((I,j)=>r.jsxs(g.Fragment,{children:[C(I),l&&j===y&&!b&&r.jsx(h,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:a,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...c})]},j))})},_u=({text:e,duration:o=500,direction:t="up",stagger:n=50,sequential:l=!1,textStyle:a,as:c,wordProps:d,textComponent:s,...u})=>{const[h,f]=g.useState(e),[m,p]=g.useState("entering"),[b,x]=g.useState(0),y=s||i.Text,k=g.useRef(null),w=g.useRef(null);g.useEffect(()=>{e===h&&m==="visible"||e!==h&&(m==="entering"||m==="visible"?(k.current=e,p("exiting")):m==="exiting"&&(k.current=e))},[e,h,m]);const{lines:T,totalWordCount:C}=g.useMemo(()=>{const $=h.split("|").map(L=>L.trim().split(/\s+/).filter(D=>D.length>0)),_=$.reduce((L,D)=>L+D.length,0);return{lines:$,totalWordCount:_}},[h]),I=g.useMemo(()=>l?C*(o+n):(C-1)*n+o,[C,o,n,l]),j=g.useMemo(()=>l?C*(o+n):(C-1)*n+o,[C,o,n,l]);g.useEffect(()=>(w.current&&clearTimeout(w.current),m==="entering"?w.current=setTimeout(()=>{p("visible")},I+50):m==="exiting"&&(w.current=setTimeout(()=>{k.current!==null&&(f(k.current),k.current=null),x(P=>P+1),p("entering")},j+50)),()=>{w.current&&clearTimeout(w.current)}),[m,I,j]);const{style:z,...V}=d||{},W=t==="up",H=P=>l?P*(o+n):P*n,S=g.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",lineHeight:"normal",...a}),[a]),B=g.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),A=g.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let E=0;return r.jsx(i.Element,{as:"span",style:S,...u,children:r.jsx("span",{style:B,children:T.map((P,$)=>r.jsx("span",{style:A,children:P.map((_,L)=>{const D=E++,F=H(D),q=L===P.length-1;let O;const N=`${o}ms`,Z=`${F}ms`;m==="entering"?O=W?i.Animation.slideInUp({duration:N,delay:Z,timingFunction:"ease-out",fillMode:"both"}):i.Animation.slideInDown({duration:N,delay:Z,timingFunction:"ease-out",fillMode:"both"}):m==="exiting"&&(O=W?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:N,delay:Z,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:N,delay:Z,timingFunction:"ease-in",fillMode:"both"});const X={...z,display:"inline-block",marginRight:q?0:"0.25em",transform:m==="visible"?"translateY(0)":void 0,opacity:m==="visible"?1:void 0};return r.jsx(y,{as:"span",animate:O,...V,...X,children:_},`${b}-${$}-${L}`)})},`line-${$}`))})})};function la(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Dt=e=>{if(!e||typeof e!="string")return e;const o=e.split("|");return o.length===1?e:o.map((t,n)=>r.jsxs(g.Fragment,{children:[t,n<o.length-1&&r.jsx("br",{})]},n))},$u=({children:e,highlightText:o,highlightStyle:t="solid",highlightColor:n="theme-primary",highlightSecondaryColor:l,size:a="lg",views:c,highlightAnimate:d,animate:s,animationLoop:u=1,highlightAnimationLoop:h=1,highlightTypewriter:f=!1,highlightTypewriterDuration:m=3e3,highlightSlide:p=!1,highlightSlideDuration:b=500,highlightSlideStagger:x=50,highlightSlideSequential:y=!0,themeMode:k,responsive:w,alternateHighlightText:T,alternateAnimation:C,alternateDuration:I,_isInView:j,...z})=>{const{ref:V,inView:W}=i.useInView(),{finalDisplayedText:H,activeHighlightTarget:S,highlightTypewriter:B,highlightSlide:A,highlightSlideDuration:E,highlightSlideStagger:P,highlightSlideSequential:$}=Vu({children:e,highlightText:o,_isInView:W,highlightTypewriter:f,highlightSlide:p,highlightSlideDuration:b,highlightSlideStagger:x,highlightSlideSequential:y,alternateHighlightText:T,alternateAnimation:C,alternateDuration:I,...z}),_=Eu[a],L=Pu[t](n,l),D=(X,G)=>X&&(Array.isArray(X)?X.map(Q=>({...Q,iterationCount:G.toString()})):{...X,iterationCount:G.toString()}),F=D(s,u),q=D(d,h),O=typeof H=="string"?H:typeof e=="string"?e:"",N={ref:V,animate:W?F:void 0,as:"h1",fontSize:_},Z=X=>!W&&(B||A)?r.jsx("span",{style:{opacity:0},children:X}):B?r.jsx(Wu,{text:X,typingSpeed:Math.max(30,m/(X.length*10)),cursorColor:"currentColor",...L}):A?r.jsx(_u,{text:X,duration:E,stagger:P,sequential:$,direction:"up",fontSize:_,wordProps:L}):Dt(X);if(typeof O=="string"&&S){const X=Array.isArray(S)?new RegExp(`(${S.map(ee=>la(String(ee))).join("|")})`,"gi"):new RegExp(`(${la(String(S))})`,"gi"),G=[];let Q=0,R;for(;R=X.exec(O);)R.index>Q&&G.push(O.substring(Q,R.index)),G.push({highlight:!0,text:R[0]}),Q=R.index+R[0].length;return Q<O.length&&G.push(O.substring(Q)),r.jsx(i.Element,{...N,...c==null?void 0:c.container,...z,children:G.map((ee,re)=>typeof ee=="string"?r.jsx(i.Text,{as:"span",display:"inline",...c==null?void 0:c.text,children:Dt(ee)},`text-${re}`):r.jsx(i.Text,{as:"span",display:"inline",animate:W?q:void 0,...A?{}:L,...c==null?void 0:c.highlight,children:Z(ee.text)},`highlight-${re}`))})}return t&&!S?r.jsx(i.Element,{...N,...z,...c==null?void 0:c.container,children:r.jsx(i.Text,{as:"span",display:"inline",animate:W?q:void 0,...A?{}:L,...c==null?void 0:c.highlight,children:Z(O)})}):r.jsx(i.Text,{...N,...z,...c==null?void 0:c.container,...c==null?void 0:c.text,children:Dt(O)})},Hu=e=>r.jsx($u,{...e}),Bu=({items:e,shape:o,variant:t,onToggleChange:n})=>{const{activeToggles:l,setActiveToggles:a}=_n();return r.jsx(Hn,{items:e,shape:o,variant:t,activeToggles:l,setActiveToggles:a,onToggleChange:n})},Lu=({items:e,onChange:o})=>{const[t,n]=g.useState(e),[l,a]=g.useState(null),[c,d]=g.useState(null),s=g.useRef({x:0,y:0}),u=g.useRef([]),h=g.useCallback((p,b)=>{p.preventDefault(),document.body.style.cursor="grabbing";const x="touches"in p?p.touches[0].clientX:p.clientX,y="touches"in p?p.touches[0].clientY:p.clientY;s.current={x,y},d(b),a(t[b])},[t]),f=g.useCallback(p=>{if(c===null)return;const b="touches"in p?p.touches[0].clientX:p.clientX,x="touches"in p?p.touches[0].clientY:p.clientY,y=u.current[c];if(!y)return;const k=b-s.current.x,w=x-s.current.y;y.style.transform=`translate(${k}px, ${w}px)`,y.style.zIndex="1000";const T=u.current.findIndex((C,I)=>{if(!C||I===c)return!1;const j=C.getBoundingClientRect();return x>=j.top&&x<=j.bottom});if(T!==-1&&T!==c){const C=[...t],[I]=C.splice(c,1);C.splice(T,0,I),n(C),d(T),o==null||o(C),s.current={x:b,y:x}}},[c,t,o]),m=g.useCallback(()=>{document.body.style.cursor="",u.current.forEach(p=>{p&&(p.style.transform="",p.style.zIndex="")}),d(null),a(null)},[c]);return g.useEffect(()=>(c!==null&&(window.addEventListener("mousemove",f),window.addEventListener("touchmove",f),window.addEventListener("mouseup",m),window.addEventListener("touchend",m)),()=>{window.removeEventListener("mousemove",f),window.removeEventListener("touchmove",f),window.removeEventListener("mouseup",m),window.removeEventListener("touchend",m)}),[c,f,m]),{items:t,draggedItem:l,draggedIndex:c,itemRefs:u,handleDragStart:h}},Au=({items:e,renderItem:o,containerProps:t,itemProps:n,draggedIndex:l,itemRefs:a,handleDragStart:c,views:d,themeMode:s})=>r.jsx(i.View,{overflow:"hidden",position:"relative",...t,...d==null?void 0:d.container,children:e.map((u,h)=>r.jsx(i.View,{ref:f=>a.current[h]=f,onMouseDown:f=>c(f,h),onTouchStart:f=>c(f,h),position:"relative",cursor:"grab",transition:"transform 0.2s",...n,...d==null?void 0:d.item,children:o?o(u,h):u},h))}),ca=e=>{const{items:o,draggedIndex:t,itemRefs:n,handleDragStart:l}=Lu(e);return r.jsx(Au,{...e,items:o,draggedIndex:t,itemRefs:n,handleDragStart:l})},Du=ca,Fu=({onFileSelect:e,onMultipleFileSelect:o,validateFile:t,accept:n,multiple:l,disabled:a,previewUrl:c})=>{const[d,s]=g.useState(!1),[u,h]=g.useState(null),f=g.useRef(null),m=c!==void 0?c:u;g.useEffect(()=>()=>{u&&URL.revokeObjectURL(u)},[u]);const p=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!a&&s(!0)},[a]),b=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!a&&s(!1)},[a]),x=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!a&&s(!0)},[a]),y=g.useCallback(C=>{if(!C||C.length===0)return;const I=Array.from(C);if(!l&&I.length>0){const j=I[0];if(j.type.startsWith("image/")){const z=URL.createObjectURL(j);h(V=>(V&&URL.revokeObjectURL(V),z))}else h(null)}l?o&&o(I):I.length>0&&e&&e(I[0])},[l,o,e]),k=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!1),!a&&C.dataTransfer.files&&C.dataTransfer.files.length>0&&(y(C.dataTransfer.files),C.dataTransfer.clearData())},[a,y]),w=g.useCallback(()=>{var C;a||(C=f.current)==null||C.click()},[a]),T=g.useCallback(C=>{y(C.target.files),C.target.value&&(C.target.value="")},[y]);return{isDragActive:d,handleDragEnter:p,handleDragLeave:b,handleDragOver:x,handleDrop:k,handleClick:w,handleFileChange:T,inputRef:f,preview:m}},Ou={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)"}},ia=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:l="120px",showPreviews:a=!1,views:c={}})=>{if(e.length===0)return null;const d=g.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(i.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:l,overflowY:"auto",...c==null?void 0:c.container,children:e.map((s,u)=>{const h=URL.createObjectURL(s)||(s==null?void 0:s.path)||(s==null?void 0:s.url)||"",f=s.type.startsWith("image/"),m=s.type.startsWith("video/"),p=s.type.startsWith("audio/");return r.jsx(i.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,...c==null?void 0:c.item,children:a&&r.jsxs(be,{children:[r.jsxs(be.Trigger,{children:[f&&r.jsx(i.Image,{src:h,alt:s.name,width:"60px",height:"60px",objectFit:"cover"}),m&&r.jsx(i.View,{as:"video",src:h,alt:s.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),p&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(jo,{widthHeight:24,color:"color-black"})}),!f&&!m&&!p&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(to,{widthHeight:24,color:"color-black"})}),t&&r.jsx(i.Button,{...Ou,onClick:b=>{b.stopPropagation(),t(u)},"aria-label":`Remove ${s.name}`,children:"×"})]}),r.jsxs(be.Content,{children:[f&&r.jsx(i.Image,{src:h,alt:s.name,maxWidth:"100%"}),m&&r.jsx(i.View,{as:"video",src:h,controls:!0,maxWidth:"100%"}),p&&r.jsx(i.View,{as:"audio",src:h,controls:!0,width:"100%"}),r.jsxs(i.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...c==null?void 0:c.name,children:[s.name," (",d(s.size),")"]})]})]})},u)})})},qu=({children:e,text:o="Drop files here or click to upload",textProps:t,containerProps:n,disabled:l,accept:a,multiple:c,isDragActive:d,handleDragEnter:s,handleDragLeave:u,handleDragOver:h,handleDrop:f,handleClick:m,handleFileChange:p,inputRef:b,preview:x,imageProps:y,selectedFiles:k,onRemove:w})=>r.jsxs(i.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:l?"not-allowed":"pointer",opacity:l?.6:1,onClick:m,onDragEnter:s,onDragLeave:u,onDragOver:h,onDrop:f,transition:"all 0.2s ease-in-out",overflow:"hidden",position:"relative",padding:16,...n,children:[r.jsx("input",{type:"file",ref:b,onChange:p,accept:a,multiple:c,style:{display:"none"},disabled:l}),x&&!c?r.jsxs(i.View,{width:"100%",height:"200px",position:"relative",children:[r.jsx(i.Image,{src:x,alt:"Preview",width:"100%",height:"100%",objectFit:"contain",...y}),r.jsx(i.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(i.Text,{color:"white",fontWeight:600,children:"Click to replace"})})]}):r.jsxs(i.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[e||r.jsxs(i.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[r.jsx(ft,{widthHeight:40,color:d?"primary":"rgba(0,0,0,0.4)"}),r.jsx(i.Text,{marginTop:16,color:d?"primary":"rgba(0,0,0,0.6)",fontWeight:500,textAlign:"center",...t,children:o})]}),c&&k&&k.length>0&&r.jsx(i.View,{marginTop:16,width:"100%",children:r.jsx(ia,{files:k,onRemove:w||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),Nu=e=>{const o=Fu(e);return r.jsx(qu,{...e,...o})},Uu=(e=!1)=>{const[o,t]=g.useState(e),[n,l]=g.useState(null);return g.useEffect(()=>{const a=s=>{!s.composedPath().some(f=>(f==null?void 0:f.id)==="dropdown-menu"||(f==null?void 0:f.id)==="dropdown-trigger")&&o&&(t(!1),l(null))},c=()=>{o&&(t(!1),l(null))},d=s=>{s.key==="Escape"&&o&&(t(!1),l(null))};return document.addEventListener("mousedown",a),window.addEventListener("resize",c),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",a),window.removeEventListener("resize",c),document.removeEventListener("keydown",d)}},[o]),{isOpen:o,setIsOpen:t,activeSubmenuId:n,setActiveSubmenuId:l}},Gu={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Yu={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"}},vu={hover:{backgroundColor:"color-gray-100"}},sa=g.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),Xu=({children:e,value:o})=>r.jsx(sa.Provider,{value:o,children:e}),Ft=()=>{const e=g.useContext(sa);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},da=({children:e,views:o,...t})=>{const{isOpen:n,setIsOpen:l,triggerRef:a}=Ft(),c=d=>{d.stopPropagation(),l(!n)};return r.jsx(i.View,{ref:a,id:"dropdown-trigger",onClick:c,cursor:"pointer",position:"relative",display:"inline-block",...o==null?void 0:o.container,...t,children:e})},Ot=({items:e,side:o="bottom",align:t="start",views:n,...l})=>{const{isOpen:a,variant:c,triggerRef:d}=Ft(),s=g.useRef(null),{ref:u,relation:h}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[f,m]=g.useState({x:0,y:0,placement:o});if(g.useEffect(()=>{d.current&&u&&(u.current=d.current)},[d,u,a]),g.useEffect(()=>{if(a&&s.current&&d.current){const x=d.current.getBoundingClientRect();let y=o;h&&(o==="bottom"&&h.space.vertical==="top"?y="top":o==="top"&&h.space.vertical==="bottom"?y="bottom":o==="right"&&h.space.horizontal==="left"?y="left":o==="left"&&h.space.horizontal==="right"&&(y="right"));let k=0,w=0;switch(y){case"bottom":k=t==="start"?x.left:t==="end"?x.right-180:x.left+x.width/2-90,w=x.bottom+8;break;case"top":k=t==="start"?x.left:t==="end"?x.right-180:x.left+x.width/2-90,w=x.top-8;break;case"right":k=x.right+8,w=t==="start"?x.top:t==="end"?x.bottom-100:x.top+x.height/2-50;break;case"left":k=x.left-8,w=t==="start"?x.top:t==="end"?x.bottom-100:x.top+x.height/2-50;break}m({x:k,y:w,placement:y})}},[a,o,t,d,h]),!a)return null;const b=(()=>{const x={position:"fixed",left:f.x,top:f.y,zIndex:1e3};switch(f.placement){case"top":return{...x,transform:"translateY(-100%)"};case"left":return{...x,transform:"translateX(-100%)"};case"bottom":case"right":default:return x}})();return r.jsx(i.View,{ref:s,id:"dropdown-menu",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:b,...Yu[c],...n==null?void 0:n.menu,...l,children:e.map((x,y)=>x.divider?r.jsx(ua,{views:n},`divider-${y}`):r.jsx(ga,{item:x,views:n},x.id))})},ga=({item:e,views:o,...t})=>{const{activeSubmenuId:n,setActiveSubmenuId:l,size:a}=Ft(),[c,d]=g.useState(!1),s=e.items&&e.items.length>0,u=n===e.id,h=g.useRef(null),f=()=>{d(!0),s&&l(e.id)},m=()=>{d(!1)},p=b=>{b.stopPropagation(),!e.disabled&&!s&&e.onClick&&e.onClick()};return r.jsxs(i.View,{ref:h,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...Gu[a],_hover:e.disabled?{}:vu.hover,backgroundColor:c&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:f,onMouseLeave:m,onClick:p,...o==null?void 0:o.item,...t,children:[e.icon&&r.jsx(i.View,{marginRight:8,...o==null?void 0:o.icon,children:e.icon}),r.jsx(i.View,{flexGrow:1,children:e.label}),s&&r.jsx(i.View,{marginLeft:8,...o==null?void 0:o.submenuIndicator,children:r.jsx(le,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),u&&s&&r.jsx(Ot,{items:e.items||[],side:"right",align:"start",views:o})]})},ua=({views:e,...o})=>r.jsx(i.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...o}),Ku=({trigger:e,items:o,side:t="bottom",align:n="start",views:l,themeMode:a,...c})=>r.jsxs(i.View,{position:"relative",display:"inline-block",...l==null?void 0:l.container,...c,children:[r.jsx(da,{views:l,children:e}),r.jsx(Ot,{items:o,side:t,align:n,views:l})]}),bo=({trigger:e,items:o,size:t="md",variant:n="default",side:l="bottom",align:a="start",defaultOpen:c=!1,views:d,...s})=>{const{isOpen:u,setIsOpen:h,activeSubmenuId:f,setActiveSubmenuId:m}=Uu(c),p=g.useRef(null);return r.jsx(Xu,{value:{isOpen:u,setIsOpen:h,activeSubmenuId:f,setActiveSubmenuId:m,size:t,variant:n,triggerRef:p},children:r.jsx(Ku,{trigger:e,items:o,side:l,align:a,views:d,...s})})};bo.Trigger=da,bo.Content=Ot,bo.Item=ga,bo.Divider=ua;const Qu=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:l,isOpen:a,onOpen:c,onClose:d,closeOnSelect:s=!0,maxRecentColors:u=8,showRecentColors:h=!0}=e,[f,m]=g.useState(a??!1),[p,b]=g.useState(o??t),[x,y]=g.useState(""),[k,w]=g.useState([]),T=g.useRef(null),C=g.useRef(null);g.useEffect(()=>{o!==void 0&&b(o)},[o]),g.useEffect(()=>{a!==void 0&&m(a)},[a]),g.useEffect(()=>{if(h){const S=localStorage.getItem("colorPicker-recentColors");if(S)try{w(JSON.parse(S))}catch{}}},[h]),g.useEffect(()=>{const S=B=>{f&&T.current&&C.current&&!T.current.contains(B.target)&&!C.current.contains(B.target)&&H()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[f]);const I=g.useCallback(S=>{h&&w(B=>{const A=B.filter(P=>P!==S),E=[S,...A].slice(0,u);return localStorage.setItem("colorPicker-recentColors",JSON.stringify(E)),E})},[h,u]),j=g.useCallback(()=>{const S=!f;m(S),S?c==null||c():d==null||d()},[f,c,d]),z=g.useCallback(S=>{b(S),I(S),n==null||n(S),l==null||l(S),s&&(m(!1),d==null||d())},[n,l,s,d,I]),V=g.useCallback(S=>{y(S)},[]),W=g.useCallback(()=>{x&&(z(x),y(""))},[x,z]),H=g.useCallback(()=>{m(!1),d==null||d()},[d]);return{isOpen:f,selectedColor:p,recentColors:k,customColor:x,handleToggle:j,handleColorSelect:z,handleCustomColorChange:V,handleCustomColorSubmit:W,handleClose:H,triggerRef:T,dropdownRef:C}},Je={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"}},Zu={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"}},Ju={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Ru={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"}},eh=[{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"}],oh=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:l,views:a={},size:c="md",shape:d="default",variant:s="default",error:u=!1,isDisabled:h=!1,isReadOnly:f=!1,predefinedColors:m=eh,showCustomInput:p=!0,showRecentColors:b=!0,isOpen:x,selectedColor:y,recentColors:k,customColor:w,handleToggle:T,handleColorSelect:C,handleCustomColorChange:I,handleCustomColorSubmit:j,triggerRef:z,dropdownRef:V,onChange:W,...H})=>{const{getColor:S}=i.useTheme(),B={...Je.container,...a==null?void 0:a.container},A={...Je.trigger,...Zu[c],...Ju[d],...Ru[s],...u&&{borderColor:"color-red-500"},...h&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},E={...Je.dropdown,...a==null?void 0:a.dropdown},P={...Je.colorGrid,...a==null?void 0:a.colorGrid},$={...Je.recentColors,...a==null?void 0:a.recentColors},_=y||"color-gray-200";return r.jsxs(i.View,{...B,...H,children:[t&&r.jsx(i.Text,{fontSize:c==="xs"?"12px":c==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...a==null?void 0:a.label,children:t}),r.jsxs(i.View,{ref:z,onClick:h||f?void 0:T,...A,children:[r.jsxs(i.Horizontal,{alignItems:"center",gap:8,children:[r.jsx(i.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:_,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),r.jsx(i.Text,{color:y?"color-gray-800":"color-gray-500",fontSize:"inherit",children:y||n})]}),!f&&!h&&r.jsx(le,{widthHeight:16,color:"color-gray-500",orientation:x?"up":"down"})]}),x&&r.jsxs(i.View,{ref:V,...E,children:[r.jsx(i.View,{...P,children:m.map((L,D)=>r.jsx(i.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:L.value,borderWidth:"2px",borderStyle:"solid",borderColor:y===L.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>C(L.value),title:L.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},D))}),p&&r.jsxs(i.View,{...Je.customInput,...a==null?void 0:a.customInput,children:[r.jsxs(i.Horizontal,{gap:8,alignItems:"center",marginBottom:"8px",children:[r.jsx("input",{type:"color",value:w||"#000000",onChange:L=>{const D=L.target.value;I(D),C(D)},style:{width:"40px",height:"32px",border:"1px solid #d1d5db",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},title:"Pick a color"}),r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",children:"Use native color picker"})]}),r.jsx(uo,{placeholder:"Enter hex color (e.g., #ff0000)",value:w,onChange:L=>I(L.target.value),onKeyPress:L=>{L.key==="Enter"&&j()},size:"sm",right:w&&r.jsx(i.View,{width:"16px",height:"16px",borderRadius:"2px",backgroundColor:w,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:j})})]}),b&&k.length>0&&r.jsxs(i.View,{...$,children:[r.jsx(i.Text,{fontWeight:"500",color:"color-gray-600",marginBottom:"8px",children:"Recent Colors"}),r.jsx(i.Horizontal,{gap:8,flexWrap:"wrap",children:k.map((L,D)=>r.jsx(i.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:L,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:()=>C(L),title:L,_hover:{transform:"scale(1.1)"}},D))})]})]}),l&&r.jsx(i.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:l})]})},th=e=>{const o=Qu(e);return r.jsx(oh,{...o,...e})},rh=e=>{const o=Dn(e);return r.jsx(Fn,{...o,...e})},nh=e=>{const o=Ln(e);return r.jsx(An,{...o,...e})},ah=(e=null,o=null)=>{const[t,n]=g.useState(e),[l,a]=g.useState(o),c=s=>l===s,d=s=>{a(u=>u===s?null:s)};return g.useEffect(()=>{const s=h=>{!h.composedPath().some(p=>(p==null?void 0:p.id)==="menubar-content"||(p==null?void 0:p.id)==="menubar-trigger")&&l!==null&&a(null)},u=h=>{h.key==="Escape"&&l!==null&&a(null)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",u)}},[l]),{activeMenuId:t,setActiveMenuId:n,openMenuId:l,setOpenMenuId:a,isMenuOpen:c,toggleMenu:d}},ha={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},lh={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"}},ch={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Ko={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},fa=g.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),Qo=()=>g.useContext(fa),ih=({value:e,children:o})=>r.jsx(fa.Provider,{value:e,children:o}),ma=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",views:l,...a})=>{const c=o==="horizontal"?i.Horizontal:i.Vertical;return r.jsx(c,{role:"menubar","aria-orientation":o,...ch[o],...lh[n],...l==null?void 0:l.container,...a,children:e})},pa=({children:e,id:o,disabled:t=!1,views:n})=>{const{orientation:l}=Qo(),a=l==="horizontal"?i.Horizontal:i.Vertical;return r.jsx(a,{role:"none",position:"relative",opacity:t?.5:1,pointerEvents:t?"none":"auto",...n==null?void 0:n.menu,children:g.Children.map(e,c=>g.isValidElement(c)?g.cloneElement(c,{...c.props,menuId:o}):c)})},ba=({children:e,menuId:o,disabled:t=!1,views:n})=>{const{activeMenuId:l,setActiveMenuId:a,toggleMenu:c,isMenuOpen:d,size:s,triggerRefs:u}=Qo(),h=g.useRef(null),f=l===o,m=d(o);g.useEffect(()=>(h.current&&o&&(u.current[o]=h.current),()=>{o&&delete u.current[o]}),[o,u]);const p=()=>{t||(a(o),c(o))};return r.jsx(i.View,{ref:h,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":m,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...ha[s],...f?Ko.active:{},...t?Ko.disabled:{},_hover:t?{}:Ko.hover,onClick:p,...n==null?void 0:n.trigger,children:e})},ya=({children:e,menuId:o,views:t})=>{const{isMenuOpen:n,orientation:l,triggerRefs:a}=Qo(),c=g.useRef(null),[d,s]=g.useState({x:0,y:0,placement:l==="horizontal"?"bottom":"right"}),u=n(o);if(g.useEffect(()=>{if(u&&c.current&&o&&a.current[o]){const f=c.current.getBoundingClientRect(),m=a.current[o].getBoundingClientRect(),p=Math.max(f.width||200,200),b=Math.max(f.height||150,150),x=window.innerWidth,y=window.innerHeight,k={top:m.top,right:x-m.right,bottom:y-m.bottom,left:m.left},w=l==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=b+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=b+8,x:m.left,y:m.top-b-8},{placement:"right",space:k.right,fits:k.right>=p+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=p+8,x:m.left-p-8,y:m.top}]:[{placement:"right",space:k.right,fits:k.right>=p+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=p+8,x:m.left-p-8,y:m.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=b+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=b+8,x:m.left,y:m.top-b-8}],T=w.find(z=>z.fits);if(T){s({x:T.x,y:T.y,placement:T.placement});return}const C=w.reduce((z,V)=>V.space>z.space?V:z);let I=C.x,j=C.y;I+p>x&&(I=x-p-8),I<8&&(I=8),j+b>y&&(j=y-b-8),j<8&&(j=8),s({x:I,y:j,placement:C.placement})}},[u,l,o,a]),!u)return null;const h={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return r.jsx(i.View,{ref:c,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:h,...t==null?void 0:t.content,children:e})},xa=({children:e,icon:o,disabled:t=!1,onClick:n,views:l})=>{const{size:a}=Qo(),c=()=>{t||!n||n()};return r.jsxs(i.View,{role:"menuitem",cursor:t?"not-allowed":"pointer",userSelect:"none",display:"flex",alignItems:"center",opacity:t?.5:1,...ha[a],_hover:t?{}:Ko.hover,onClick:c,...l==null?void 0:l.item,children:[o&&r.jsx(i.View,{marginRight:8,...l==null?void 0:l.icon,children:o}),e]})},ka=({views:e})=>r.jsx(i.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),sh=({items:e,orientation:o,size:t,variant:n,views:l,themeMode:a})=>r.jsx(ma,{orientation:o,size:t,variant:n,views:l,children:e.map(c=>r.jsxs(pa,{id:c.id,disabled:c.disabled,views:l,children:[r.jsxs(ba,{menuId:c.id,views:l,children:[c.icon&&r.jsx(i.View,{marginRight:8,...l==null?void 0:l.icon,children:c.icon}),c.label]}),c.items&&c.items.length>0&&r.jsx(ya,{menuId:c.id,views:l,children:c.items.map((d,s)=>d.separator?r.jsx(ka,{views:l},`separator-${s}`):r.jsx(xa,{id:d.id,icon:d.icon,disabled:d.disabled,onClick:d.onClick,views:l,children:d.label},d.id))})]},c.id))}),De=({items:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultActiveMenuId:l=null,defaultOpenMenuId:a=null,views:c,...d})=>{const{activeMenuId:s,setActiveMenuId:u,openMenuId:h,setOpenMenuId:f,isMenuOpen:m,toggleMenu:p}=ah(l,a),b=g.useRef({});return r.jsx(ih,{value:{activeMenuId:s,setActiveMenuId:u,openMenuId:h,setOpenMenuId:f,isMenuOpen:m,toggleMenu:p,orientation:o,size:t,variant:n,triggerRefs:b},children:r.jsx(sh,{items:e,orientation:o,size:t,variant:n,views:c,...d})})};De.Root=ma,De.Menu=pa,De.Trigger=ba,De.Content=ya,De.Item=xa,De.Separator=ka;const dh=(e,o,t)=>{const[n,l]=g.useState([]);return g.useEffect(()=>{l((()=>{const c=[];if(o<=t)for(let d=1;d<=o;d++)c.push(d);else{c.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&&c.push("...");for(let u=d;u<=s;u++)c.push(u);s<o-1&&c.push("..."),c.push(o)}return c})())},[e,o,t]),{visiblePageNumbers:n}},Re={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"}}}},yo={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"}}},xo={rounded:{borderRadius:"4px"},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},gh={backgroundColor:"color-blue-500",color:"color-white",_hover:{backgroundColor:"color-blue-600"}},Zo={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},uh=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:l=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"100 / page",value:100}],onPageSizeChange:a,showPageSizeSelector:c=!1,showPageInfo:d=!0,maxPageButtons:s=5,showFirstLastButtons:u=!1,size:h="md",variant:f="default",shape:m="rounded",visiblePageNumbers:p,views:b,...x})=>{const y=T=>{T<1||T>o||T===e||t(T)},k=T=>{a&&a(Number(T.target.value))},w=(T,C)=>{if(T==="...")return r.jsx(i.View,{display:"flex",alignItems:"center",justifyContent:"center",...Re[h],...b==null?void 0:b.ellipsis,children:"..."},`ellipsis-${C}`);const I=T===e;return r.jsx(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:I?"default":"pointer",...Re[h],...yo[f],...xo[m],...I?gh:{},onClick:()=>y(T),"aria-label":`Page ${T}`,"aria-current":I?"page":void 0,...I?b==null?void 0:b.activePageButton:b==null?void 0:b.pageButton,children:T},`page-${T}`)};return r.jsxs(i.Horizontal,{alignItems:"center",gap:8,...b==null?void 0:b.container,...x,children:[u&&r.jsxs(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Re[h],...yo[f],...xo[m],...e===1?Zo:{},onClick:()=>y(1),"aria-label":"First page",disabled:e===1,...b==null?void 0:b.navigationButton,children:[r.jsx(le,{orientation:"left",widthHeight:16}),r.jsx(le,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),r.jsx(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Re[h],...yo[f],...xo[m],...e===1?Zo:{},onClick:()=>y(e-1),"aria-label":"Previous page",disabled:e===1,...b==null?void 0:b.navigationButton,children:r.jsx(le,{orientation:"left",widthHeight:16})}),p.map((T,C)=>w(T,C)),r.jsx(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Re[h],...yo[f],...xo[m],...e===o?Zo:{},onClick:()=>y(e+1),"aria-label":"Next page",disabled:e===o,...b==null?void 0:b.navigationButton,children:r.jsx(le,{orientation:"right",widthHeight:16})}),u&&r.jsxs(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Re[h],...yo[f],...xo[m],...e===o?Zo:{},onClick:()=>y(o),"aria-label":"Last page",disabled:e===o,...b==null?void 0:b.navigationButton,children:[r.jsx(le,{orientation:"right",widthHeight:16}),r.jsx(le,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),d&&r.jsxs(i.Text,{marginLeft:16,color:"color-gray-600",...b==null?void 0:b.pageInfo,children:["Page ",e," of ",o]}),c&&a&&r.jsx(i.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,...b==null?void 0:b.pageSizeSelector,children:l.map(T=>r.jsx("option",{value:T.value,children:T.label},T.value))})]})},hh=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:l,onPageSizeChange:a,showPageSizeSelector:c=!1,showPageInfo:d=!0,maxPageButtons:s=5,showFirstLastButtons:u=!1,size:h="md",variant:f="default",shape:m="rounded",views:p,...b})=>{const{visiblePageNumbers:x}=dh(e,o,s);return r.jsx(uh,{currentPage:e,totalPages:o,onPageChange:t,pageSize:n,pageSizeOptions:l,onPageSizeChange:a,showPageSizeSelector:c,showPageInfo:d,maxPageButtons:s,showFirstLastButtons:u,size:h,variant:f,shape:m,visiblePageNumbers:x,views:p,...b})},fh=g.memo(({shape:e="linear",value:o=0,max:t=100,color:n="theme-primary",backgroundColor:l="color-gray-200",height:a,size:c,radius:d=4,strokeWidth:s=10,showLabel:u=!1,labelColor:h="theme-text-primary",animated:f=!0,animationDuration:m="0.5s",views:p,themeMode:b,...x})=>{const{getColor:y,themeMode:k}=i.useTheme(),w=b||k,C=Math.min(t,Math.max(0,o))/t*100,I=g.useMemo(()=>y(l,{themeMode:w}),[y,l,w]),j=g.useMemo(()=>y(n,{themeMode:w}),[y,n,w]);if(e==="circle"){const V=c||(typeof a=="number"?a:100),W=(V-s)/2,H=2*Math.PI*W,S=H-C/100*H;return r.jsxs(i.View,{width:V,height:V,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...p==null?void 0:p.container,...x,children:[r.jsxs("svg",{width:V,height:V,viewBox:`0 0 ${V} ${V}`,style:{transform:"rotate(-90deg)"},children:[r.jsx("circle",{cx:V/2,cy:V/2,r:W,stroke:I,strokeWidth:s,fill:"transparent",...p==null?void 0:p.track}),r.jsx("circle",{cx:V/2,cy:V/2,r:W,stroke:j,strokeWidth:s,strokeDasharray:H,strokeDashoffset:S,strokeLinecap:"round",fill:"transparent",style:{transition:f?`stroke-dashoffset ${m} ease-in-out`:"none"},...p==null?void 0:p.indicator})]}),u&&r.jsx(i.View,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",children:r.jsxs(i.Text,{color:h,fontSize:`${V*.2}px`,fontWeight:"bold",...p==null?void 0:p.text,children:[Math.round(C),"%"]})})]})}const z=a||8;return r.jsx(i.View,{role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":t,width:"100%",height:z,backgroundColor:I,borderRadius:d,overflow:"hidden",...p==null?void 0:p.container,...x,children:r.jsx(i.View,{width:`${C}%`,height:"100%",backgroundColor:j,borderRadius:d,style:{transition:f?`width ${m} ease-in-out`:"none"},...p==null?void 0:p.bar})})}),mh=e=>r.jsx(fh,{...e}),ph=(e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}))(),bh={thin:"1px",medium:"2px",thick:"4px"},ko={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"}},yh=({orientation:e="horizontal",variant:o="solid",thickness:t="thin",color:n,spacing:l="0px",label:a,decorative:c=!1,views:d,themeMode:s,...u})=>{const{themeMode:h}=i.useTheme(),f=n||"color-gray-200",m=ph[o],p=bh[t],b=c?{"aria-hidden":!0}:{role:"separator","aria-orientation":e};return a&&e==="horizontal"?r.jsxs(i.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:l,...b,...u,children:[r.jsx(i.View,{height:"0px",flexGrow:1,borderTopWidth:p,borderTopStyle:m,borderTopColor:f,...ko.container,...d==null?void 0:d.container}),r.jsx(i.Text,{...ko.label,...d==null?void 0:d.label,children:a}),r.jsx(i.View,{height:"0px",flexGrow:1,borderTopWidth:p,borderTopStyle:m,borderTopColor:f,...ko.container,...d==null?void 0:d.container})]}):e==="horizontal"?r.jsx(i.View,{height:"0px",width:"100%",borderTopWidth:p,borderTopStyle:m,borderTopColor:f,padding:l,...ko.container,...b,...d==null?void 0:d.container,...u}):r.jsx(i.View,{width:"0px",height:"100%",borderLeftWidth:p,borderLeftStyle:m,borderLeftColor:f,padding:l,...ko.container,...b,...d==null?void 0:d.container,...u})},Ca=e=>r.jsx(yh,{...e}),xh=Ca,kh=Ca,Ch={xs:12,sm:14,md:16,lg:18,xl:20},wh=({isSupported:e,isSharing:o,onShare:t,label:n,children:l,icon:a,size:c,isDisabled:d,isLoading:s,iconPosition:u,disableWhenUnsupported:h=!0,...f})=>{const m=c??"md",p=a??r.jsx(tr,{widthHeight:Ch[m],strokeWidth:1.5,filled:!1}),b=!!d||!e&&h,x=!!s||o;return r.jsx(_e,{...f,size:m,icon:p,iconPosition:u??"left",isDisabled:b,isLoading:x,onClick:t,children:l??n??"Share"})},wa=()=>typeof navigator>"u"?void 0:navigator,Ih=(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},Th=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},jh=e=>{const{shareData:o,onClick:t,onUnsupported:n,onShareStart:l,onShareSuccess:a,onShareCancel:c,onShareError:d}=e,[s,u]=g.useState(!1),h=g.useMemo(()=>Ih(wa(),o),[o]),f=g.useCallback((...m)=>{t==null||t(...m);const p=wa();if(!p||typeof p.share!="function"){n==null||n();return}if(!s){if(typeof p.canShare=="function")try{if(!p.canShare(o)){n==null||n();return}}catch(b){d==null||d(b);return}u(!0),l==null||l();try{p.share(o).then(()=>{a==null||a()}).catch(b=>{if(Th(b)==="AbortError"){c==null||c();return}d==null||d(b)}).finally(()=>{u(!1)})}catch(b){u(!1),d==null||d(b)}}},[s,t,c,d,l,a,n,o]);return{isSupported:h,isSharing:s,handleShare:f}},Sh=e=>{const{isSupported:o,isSharing:t,handleShare:n}=jh(e),{shareData:l,onShareStart:a,onShareSuccess:c,onShareCancel:d,onShareError:s,onUnsupported:u,onClick:h,...f}=e;return r.jsx(wh,{...f,isSupported:o,isSharing:t,onShare:n})},Mh=({label:e,status:o="default",views:t,themeMode:n,...l})=>{const{themeMode:a}=i.useTheme(),c=dr();return r.jsxs(i.Horizontal,{alignItems:"center",gap:8,role:"status-indicator",...t==null?void 0:t.container,...l,children:[r.jsx(i.View,{role:"status-dot",width:"8px",height:"8px",borderRadius:"50%",...c[o].indicator,...t==null?void 0:t.indicator}),e&&r.jsx(i.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...c[o].label,...t==null?void 0:t.label,children:e})]})},zh=e=>r.jsx(Mh,{...e}),Vh=(e=!0,o,t,n)=>{const{on:l}=i.useResponsive(),a=l("mobile"),[c,d]=g.useState(o!==void 0?o:e);return g.useEffect(()=>{o!==void 0&&d(o)},[o]),{isExpanded:c,toggleExpanded:()=>{const f=!c;d(f),t&&t(f)},expand:()=>{c||(d(!0),t&&t(!0))},collapse:()=>{c&&(d(!1),t&&t(!1))},isMobile:a}},Eh={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},Ph=(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"}}))(),Wh={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},_h={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)"}},$h={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)"},Ia=g.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),Jo=()=>g.useContext(Ia),Hh=({value:e,children:o})=>r.jsx(Ia.Provider,{value:e,children:o}),Bh=({children:e,showToggleButton:o=!0,views:t,...n})=>{const{isExpanded:l,toggleExpanded:a,position:c}=Jo();return r.jsx(i.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:l?r.jsxs(i.Horizontal,{width:"100%",alignItems:"center",justifyContent:"space-between",children:[e,o&&r.jsx(i.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":l?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(le,{orientation:c==="left"?"left":"right",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})]}):r.jsx(i.View,{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:o&&r.jsx(i.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":l?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(le,{orientation:c==="left"?"right":"left",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})})})},Lh=({children:e,views:o,...t})=>{const{isExpanded:n}=Jo();return r.jsx(i.View,{flex:"1",width:"100%",overflowY:"auto",overflowX:"hidden",padding:n?"16px":"8px",...o==null?void 0:o.content,...t,children:e})},Ah=({children:e,views:o,...t})=>{const{isExpanded:n}=Jo();return r.jsx(i.View,{width:"100%",padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",...o==null?void 0:o.footer,...t,children:n?e:null})},Dh=({children:e,position:o="left",size:t="md",variant:n="default",fixed:l=!1,hasBackdrop:a=!0,expandedWidth:c,collapsedWidth:d,breakpointBehavior:s="overlay",elevation:u="none",transitionPreset:h="normal",ariaLabel:f="Sidebar navigation",isExpanded:m,isMobile:p,collapse:b,views:x,themeMode:y,...k})=>{const w=Eh[t],T=m?c||w.expandedWidth:d||w.collapsedWidth,C=!p||p&&s!=="hide",I=l||p&&s==="overlay"?"fixed":"relative",j=a&&p&&m&&s==="overlay";return r.jsxs(r.Fragment,{children:[j&&r.jsx(i.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:b,...x==null?void 0:x.backdrop}),C&&r.jsx(i.Vertical,{position:I,top:0,height:"100vh",width:T,zIndex:999,transition:$h[h],transform:p&&s==="overlay"&&!m?`translateX(${o==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":f,...Ph[n],...Wh[o],..._h[u],...x==null?void 0:x.container,...k,children:g.Children.map(e,z=>z)})]})},Co=({children:e,position:o="left",size:t="md",variant:n="default",defaultExpanded:l=!0,expanded:a,onExpandedChange:c,fixed:d=!1,hasBackdrop:s=!0,showToggleButton:u=!0,expandedWidth:h,collapsedWidth:f,breakpoint:m=768,breakpointBehavior:p="overlay",views:b,...x})=>{const{isExpanded:y,toggleExpanded:k,expand:w,collapse:T,isMobile:C}=Vh(l,a,c);return r.jsx(Hh,{value:{isExpanded:y,toggleExpanded:k,expand:w,collapse:T,position:o,size:t,variant:n,views:b},children:r.jsx(Dh,{position:o,size:t,variant:n,fixed:d,hasBackdrop:s,showToggleButton:u,expandedWidth:h,collapsedWidth:f,breakpoint:m,breakpointBehavior:p,isExpanded:y,isMobile:C,toggleExpanded:k,expand:w,collapse:T,views:b,...x,children:e})})};Co.Header=Bh,Co.Content=Lh,Co.Footer=Ah,Co.useContext=Jo;const Fh=()=>({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)}}}),Oh=(e,o,t,n=50,l=1/0,a=!1,c,d,s=10)=>{const[u,h]=g.useState(!1),[f,m]=g.useState([]),p=g.useRef(null),b=g.useRef(null),x=g.useRef(0),y=g.useRef([]),k=g.useRef(d||(typeof window<"u"?Fh():null)),w=g.useCallback(()=>p.current?e==="horizontal"?p.current.offsetWidth:p.current.offsetHeight:0,[e]),T=g.useCallback(()=>{if(!c||!k.current)return null;const P=k.current.getItem(c);if(!P)return null;try{const $=JSON.parse(P);return Array.isArray($.sizes)?$.sizes:null}catch($){return console.warn("Failed to parse saved panel sizes:",$),null}},[c]),C=g.useCallback(()=>{if(!c||!k.current||f.length===0)return;const P=f.map($=>({id:$.id,size:$.size,collapsed:$.collapsed||!1}));k.current.setItem(c,JSON.stringify({sizes:P}))},[c,f]),I=g.useCallback((P,$,_,L,D)=>{m(F=>F.some(q=>q.id===P)?F:[...F,{id:P,size:$,minSize:_??n,maxSize:L??l,collapsible:D??a,collapsed:!1}])},[n,l,a]),j=g.useCallback(P=>{m($=>$.filter(_=>_.id!==P))},[]),z=g.useCallback(P=>{const $=f.find(_=>_.id===P);return $?$.size:0},[f]),V=g.useCallback((P,$)=>{m(_=>_.map(L=>L.id===P?{...L,size:$}:L))},[]),W=g.useCallback(P=>{const $=f.find(_=>_.id===P);return $?!!$.collapsed:!1},[f]),H=g.useCallback(P=>{m($=>{const _=$.findIndex(q=>q.id===P);if(_===-1)return $;const L=$[_];if(!L.collapsible)return $;const D={...L,collapsed:!L.collapsed},F=[...$];return F[_]=D,F})},[]),S=g.useCallback((P,$)=>{b.current=P,x.current=$,y.current=f.map(_=>_.size),h(!0)},[f]),B=g.useCallback(P=>{if(!u||!b.current)return;const $=b.current,_=P-x.current;let L=-1;const D=$.match(/\d+$/);if(D&&(L=parseInt(D[0],10)-1),L===-1&&f.length>=2&&(L=0),L<0||L>=f.length-1)return;const F=f[L],q=f[L+1];if(F.collapsed||q.collapsed)return;let O=y.current[L]+_,N=y.current[L+1]-_;O=Math.max(F.minSize??n,Math.min(F.maxSize??l,O)),N=Math.max(q.minSize??n,Math.min(q.maxSize??l,N)),m(Z=>Z.map((X,G)=>G===L?{...X,size:O}:G===L+1?{...X,size:N}:X))},[u,f,e,n,l]),A=g.useCallback(()=>{u&&t&&t(f.map(P=>P.size)),b.current=null,h(!1),c&&C()},[u,f,t,c,C]),E=g.useCallback(P=>{if(!u||!b.current)return;const $=b.current;let _=-1;const L=$.match(/\d+$/);if(L&&(_=parseInt(L[0],10)-1),_===-1&&f.length>=2&&(_=0),_<0||_>=f.length-1)return;let D=0;e==="horizontal"?(P.key==="ArrowLeft"&&(D=-s),P.key==="ArrowRight"&&(D=s),P.key==="Home"&&(D=-100),P.key==="End"&&(D=100)):(P.key==="ArrowUp"&&(D=-s),P.key==="ArrowDown"&&(D=s),P.key==="Home"&&(D=-100),P.key==="End"&&(D=100)),D!==0&&(P.preventDefault(),B(x.current+D)),P.key==="Escape"&&(m(F=>F.map((q,O)=>({...q,size:y.current[O]}))),A())},[u,f,e,B,A,s]);return g.useEffect(()=>{const P=L=>{if(!u)return;const D=e==="horizontal"?L.clientX:L.clientY;B(D)},$=L=>{if(!u||L.touches.length===0)return;const D=L.touches[0],F=e==="horizontal"?D.clientX:D.clientY;B(F)},_=()=>{u&&A()};return u&&(document.addEventListener("mousemove",P),document.addEventListener("touchmove",$),document.addEventListener("mouseup",_),document.addEventListener("touchend",_),document.addEventListener("keydown",E),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("touchmove",$),document.removeEventListener("mouseup",_),document.removeEventListener("touchend",_),document.removeEventListener("keydown",E),document.body.style.cursor="",document.body.style.userSelect=""}},[u,e,B,A,E]),g.useEffect(()=>{if(f.length!==0){if(c){const P=T();if(P){m($=>$.map(_=>{const L=P.find(D=>D.id===_.id);return L?{..._,size:L.size,collapsed:L.collapsed||!1}:_}));return}}if(!o){const $=w()/f.length;m(_=>_.map(L=>({...L,size:$})))}}},[f.length,o,w,c,T]),g.useEffect(()=>{if(!o||o.length===0||f.length===0)return;const P=w(),$=o.map(_=>typeof _=="string"&&_.endsWith("%")?parseFloat(_)/100*P:typeof _=="number"?_:parseFloat(_));m(_=>_.map((L,D)=>({...L,size:D<$.length?$[D]:L.size})))},[o,f.length,w]),g.useEffect(()=>{f.length>0&&c&&!u&&C()},[f,c,u,C]),{isResizing:u,setIsResizing:h,containerRef:p,panels:f,registerPanel:I,unregisterPanel:j,getPanelSize:z,setPanelSize:V,isPanelCollapsed:W,togglePanelCollapse:H,startResize:S,onResize:B,endResize:A}},qh={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Nh=(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],Uh=(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"}}}))(),Ro={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},Ta=g.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),ja=()=>g.useContext(Ta),Gh=({value:e,children:o})=>r.jsx(Ta.Provider,{value:e,children:o}),Yh=({children:e,id:o,defaultSize:t,minSize:n,maxSize:l,collapsible:a,defaultCollapsed:c,onCollapseChange:d,views:s,...u})=>{const{orientation:h,registerPanel:f,unregisterPanel:m,getPanelSize:p,isPanelCollapsed:b,togglePanelCollapse:x}=ja(),y=typeof t=="string"&&t.endsWith("%")?0:typeof t=="number"?t:0;g.useEffect(()=>(f(o,y,n,l,a),()=>m(o)),[o,y,n,l,a,f,m]);const k=p(o),w=b(o);return g.useEffect(()=>{d&&w!==void 0&&d(w)},[w,d]),g.useEffect(()=>{a&&c&&!w&&x(o)},[o,a,c,w,x]),w?r.jsx(i.View,{flex:"0 0 auto",width:h==="horizontal"?"10px":"100%",height:h==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>x(o),"aria-label":`Expand panel ${o}`,role:"button",tabIndex:0,...s==null?void 0:s.collapsedPanel,...u}):r.jsx(i.View,{flex:k>0?"0 0 auto":"1",width:h==="horizontal"?`${k}px`:"100%",height:h==="vertical"?`${k}px`:"100%",overflow:"auto",...s==null?void 0:s.panel,...u,children:e})},vh=({id:e,position:o="both",disabled:t=!1,withVisualIndicator:n=!0,withCollapseButton:l=!1,collapseTarget:a,views:c,...d})=>{const{orientation:s,size:u,variant:h,startResize:f,isPanelCollapsed:m,togglePanelCollapse:p}=ja(),x=(()=>{if(a)return a;const I=e.match(/\d+$/);if(!I)return"";const j=parseInt(I[0],10);return isNaN(j)?"":`panel${j}`})(),y=m(x),k=I=>{if(t)return;I.preventDefault();const j=s==="horizontal"?I.clientX:I.clientY;f(e,j)},w=I=>{if(t||I.touches.length===0)return;I.preventDefault();const j=I.touches[0],z=s==="horizontal"?j.clientX:j.clientY;f(e,z)},T=I=>{t||(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),f(e,0))},C=I=>{I.stopPropagation(),x&&p(x)};return r.jsxs(i.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",...Nh(u,s),...Uh[h],onMouseDown:k,onTouchStart:w,onKeyDown:T,opacity:t?.5:1,pointerEvents:t?"none":"auto",...c==null?void 0:c.handle,...d,children:[n&&r.jsx(i.View,{display:"flex",alignItems:"center",justifyContent:"center",width:s==="horizontal"?"100%":"auto",height:s==="vertical"?"100%":"auto",pointerEvents:"none",...c==null?void 0:c.handleIcon,children:s==="horizontal"?r.jsxs(i.Horizontal,{gap:1,children:[r.jsx(i.View,{...Ro.horizontal}),r.jsx(i.View,{...Ro.horizontal})]}):r.jsxs(i.Vertical,{gap:1,children:[r.jsx(i.View,{...Ro.vertical}),r.jsx(i.View,{...Ro.vertical})]})}),l&&x&&r.jsx(i.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:C,"aria-label":y?`Expand panel ${x}`:`Collapse panel ${x}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...c==null?void 0:c.collapseIcon,children:r.jsx(i.View,{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center",children:y?r.jsxs(i.Horizontal,{children:[r.jsx(i.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"}),r.jsx(i.View,{width:"2px",height:"6px",backgroundColor:"color-gray-600",position:"absolute"})]}):r.jsx(i.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"})})})]})},Xh=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:l,minSize:a,maxSize:c,collapsible:d=!1,containerRef:s,autoSaveId:u,views:h,...f})=>{const m=o==="horizontal"?i.Horizontal:i.Vertical;return r.jsx(m,{ref:s,width:"100%",height:"100%",position:"relative",overflow:"hidden",...qh[o],...h==null?void 0:h.container,...f,children:e})},qt=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:l,onSizesChange:a,minSize:c=50,maxSize:d,collapsible:s=!1,autoSaveId:u,storage:h,keyboardResizeBy:f=10,views:m,...p})=>{const{isResizing:b,setIsResizing:x,containerRef:y,registerPanel:k,unregisterPanel:w,getPanelSize:T,setPanelSize:C,isPanelCollapsed:I,togglePanelCollapse:j,startResize:z,onResize:V,endResize:W}=Oh(o,l,a,c,d,s,u,h,f);return r.jsx(Gh,{value:{orientation:o,size:t,variant:n,isResizing:b,setIsResizing:x,registerPanel:k,unregisterPanel:w,getPanelSize:T,setPanelSize:C,isPanelCollapsed:I,togglePanelCollapse:j,startResize:z,onResize:V,endResize:W},children:r.jsx(Xh,{orientation:o,size:t,variant:n,defaultSizes:l,minSize:c,maxSize:d,collapsible:s,autoSaveId:u,keyboardResizeBy:f,containerRef:y,views:m,...p,children:e})})};qt.Panel=Yh,qt.Handle=vh;const et={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"}}},Kh={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"}},Qh=()=>Math.random().toString(36).substring(2,9);let eo=new Map;const wo=tt.create(e=>({toasts:[],add:(o,t,n,l={})=>{const a=l.id||Qh(),c={id:a,variant:o,title:t,description:n,createdAt:Date.now(),isVisible:!0,...l};if(e(d=>({toasts:[...d.toasts,c]})),l.duration!==0){const d=l.duration||5e3,s=setTimeout(()=>{wo.getState().remove(a)},d);eo.set(a,s)}return a},remove:o=>{e(t=>({toasts:t.toasts.map(n=>n.id===o?{...n,isVisible:!1}:n)})),eo.has(o)&&(clearTimeout(eo.get(o)),eo.delete(o)),setTimeout(()=>{e(t=>({toasts:t.toasts.filter(n=>n.id!==o)}))},300)},removeAll:()=>{eo.forEach(clearTimeout),eo.clear(),e(o=>({toasts:o.toasts.map(t=>({...t,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),Fe=(e,o,t,n)=>wo.getState().add(e,o,t,n),Sa=(e,o,t)=>Fe("info",e,o,t),Ma=(e,o,t)=>Fe("success",e,o,t),za=(e,o,t)=>Fe("warning",e,o,t),Va=(e,o,t)=>Fe("error",e,o,t),Ea=e=>{wo.getState().remove(e)},Pa=()=>{wo.getState().removeAll()},Wa=({variant:e,title:o,description:t,onClose:n,isClosable:l=!0,action:a,actionText:c,showIcon:d=!0,theme:s,views:u,render:h,icon:f,id:m,isVisible:p=!0,themeMode:b})=>{const x=s??et,y=()=>{var C,I;if(f!==void 0)return f;const T=e?(I=(C=et[e])==null?void 0:C.icon)==null?void 0:I.color:et.info.icon.color;switch(e){case"info":return r.jsx(Se,{widthHeight:20,color:T});case"success":return r.jsx(lt,{widthHeight:20,color:T});case"warning":return r.jsx(Se,{widthHeight:20,color:T,orientation:"down"});case"error":return r.jsx(So,{widthHeight:20,color:T});default:return r.jsx(Se,{widthHeight:20,color:et.info.icon.color})}};if(h)return r.jsx(r.Fragment,{children:h({id:m||"",onClose:n})});const k=e==="error"?"alert":"status",w=e==="error"||e==="warning"?"assertive":"polite";return r.jsxs(i.Horizontal,{role:k,"aria-live":w,"aria-atomic":"true","data-state":p?"open":"closed",gap:12,width:"100%",maxWidth:"400px",borderWidth:"1px",borderStyle:"solid",borderRadius:"8px",padding:"12px 16px",alignItems:"flex-start",position:"relative",backgroundColor:x[e].container.backgroundColor,borderColor:x[e].container.border,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",opacity:p?1:0,transform:p?"scale(1)":"scale(0.95)",transition:"all 0.3s ease",...u==null?void 0:u.container,children:[d&&r.jsx(i.View,{marginTop:"2px",...u==null?void 0:u.icon,children:y()}),r.jsxs(i.Vertical,{gap:4,flex:"1",children:[r.jsx(i.Text,{size:"md",fontWeight:"600",color:x[e].content.color,backgroundColor:x[e].container.backgroundColor,...u==null?void 0:u.title,children:o}),t&&r.jsx(i.Text,{size:"sm",color:x[e].content.color,fontWeight:"400",backgroundColor:x[e].container.backgroundColor,...u==null?void 0:u.description,children:t}),a&&c&&r.jsx(i.Text,{size:"sm",fontWeight:"600",marginTop:"8px",cursor:"pointer",color:x[e].content.color,backgroundColor:x[e].container.backgroundColor,onClick:T=>{T.stopPropagation(),a()},_hover:{textDecoration:"underline"},transition:"all 0.2s ease",...u==null?void 0:u.actionButton,children:c})]}),l&&r.jsx(i.View,{as:"button","aria-label":"Close toast",backgroundColor:"transparent",border:"none",cursor:"pointer",padding:"4px",marginLeft:"8px",marginTop:"-4px",marginRight:"-8px",borderRadius:"4px",onClick:T=>{T.stopPropagation(),n()},_hover:{backgroundColor:"rgba(0, 0, 0, 0.05)"},transition:"all 0.2s ease",...u==null?void 0:u.closeButton,children:r.jsx(pe,{widthHeight:16,color:x[e].content.color})})]})},Zh=({position:e="top-right",gap:o=8,limit:t=5,containerStyle:n})=>{const{toasts:l,remove:a}=wo(),d=g.useMemo(()=>{const s={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return l.forEach(u=>{const h=u.position||e;s[h].push(u)}),Object.keys(s).forEach(u=>{s[u]=s[u].slice(-t)}),s},[l,e,t])[e];return r.jsx(i.View,{position:"fixed",zIndex:9999,display:"flex",flexDirection:e.includes("bottom")?"column-reverse":"column",gap:`${o}px`,width:"fit-content",maxWidth:"100%",pointerEvents:"none",...Kh[e],style:n,children:d.map(s=>r.jsx(i.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(Wa,{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))})},Jh=()=>({toast:(e,o,t,n)=>Fe(e,o,t,n),info:(e,o,t)=>Sa(e,o,t),success:(e,o,t)=>Ma(e,o,t),warning:(e,o,t)=>za(e,o,t),error:(e,o,t)=>Va(e,o,t),remove:e=>Ea(e),removeAll:()=>Pa()}),Rh=Object.assign(e=>r.jsx(Wa,{...e}),{Container:e=>r.jsx(Zh,{...e}),show:Fe,info:Sa,success:Ma,warning:za,error:Va,remove:Ea,removeAll:Pa}),ef=Jh,_a=(e,o)=>{var c,d;if(!e)return!0;const t=e.toLowerCase(),n=o.name.toLowerCase().includes(t),l=((c=o.description)==null?void 0:c.toLowerCase().includes(t))||!1,a=((d=o.keywords)==null?void 0:d.some(s=>s.toLowerCase().includes(t)))||!1;return n||l||a},of=({open:e,onOpenChange:o,groups:t=[],commands:n=[],filter:l})=>{const[a,c]=g.useState(""),[d,s]=g.useState(0),u=g.useRef(null),h=g.useMemo(()=>l||_a,[l]),f=g.useMemo(()=>[...t.flatMap(y=>y.commands),...n],[t,n]),m=g.useMemo(()=>a.trim()?f.filter(x=>h(a,x)):f,[f,a,h]),p=g.useMemo(()=>{if(!a)return t;const x=l||_a;return t.map(y=>({...y,commands:y.commands.filter(k=>x(a,k))})).filter(y=>y.commands.length)},[t,a,l]);g.useEffect(()=>{s(0)},[m.length]);const b=g.useCallback(x=>{if(e)switch(x.key){case"ArrowDown":x.preventDefault(),s(y=>y<m.length-1?y+1:y);break;case"ArrowUp":x.preventDefault(),s(y=>y>0?y-1:y);break;case"Enter":x.preventDefault(),m[d]&&(m[d].onSelect(),o(!1),c(""));break;case"Escape":x.preventDefault(),o(!1),c("");break}},[e,m,d,o]);return g.useEffect(()=>(document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}),[b]),g.useEffect(()=>{if(u.current&&e){const x=u.current.querySelector(`[data-index="${d}"]`);x&&x.scrollIntoView({block:"nearest"})}},[d,e]),g.useEffect(()=>{e?s(0):c("")},[e]),{search:a,setSearch:c,selectedIndex:d,setSelectedIndex:s,filteredCommands:m,filteredGroups:p,listRef:u}},tf={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},rf=(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)"}}))(),nf={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},af={overflow:"auto",padding:"8px 0"},lf={marginBottom:"8px"},cf={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},sf={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},df={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},gf={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},uf={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},hf={display:"flex",flexDirection:"column",flex:1},ff={fontSize:"14px",fontWeight:"medium"},mf={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},pf={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},bf={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},yf={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},xf=g.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),kf=({value:e,children:o})=>r.jsx(xf.Provider,{value:e,children:o}),$a=({value:e,onValueChange:o,placeholder:t="Type a command or search...",views:n,...l})=>{const a=g.useRef(null);return g.useEffect(()=>{a.current&&a.current.focus()},[]),r.jsxs(i.View,{...nf,...n==null?void 0:n.container,...l,children:[r.jsx(zo,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),r.jsx(i.View,{as:"input",type:"text",value:e,onChange:c=>o(c.target.value),placeholder:t,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"14px",ref:a,...n==null?void 0:n.input})]})},Cf=({children:e,views:o,...t})=>r.jsx(i.View,{...af,...o==null?void 0:o.container,...t,children:e}),Ha=({heading:e,children:o,views:t,...n})=>r.jsxs(i.View,{...lf,...t==null?void 0:t.container,...n,children:[r.jsx(i.Text,{...cf,...t==null?void 0:t.heading,children:e}),o]}),Nt=({item:e,selected:o=!1,onSelect:t,views:n,...l})=>{const a=()=>{!e.disabled&&t&&t()};return r.jsxs(i.Horizontal,{...sf,...o?df:{},...e.disabled?gf:{},onClick:a,...n==null?void 0:n.container,...l,children:[e.icon&&r.jsx(i.View,{...uf,...n==null?void 0:n.icon,children:e.icon}),r.jsxs(i.Vertical,{...hf,...n==null?void 0:n.content,children:[r.jsx(i.Text,{...ff,...n==null?void 0:n.name,children:e.name}),e.description&&r.jsx(i.Text,{...mf,...n==null?void 0:n.description,children:e.description})]}),e.shortcut&&r.jsx(i.Text,{...pf,...n==null?void 0:n.shortcut,children:e.shortcut})]})},Ba=({children:e="No results found.",views:o,...t})=>r.jsx(i.View,{...bf,...o==null?void 0:o.container,...t,children:e}),wf=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:l,size:a="md",variant:c="default",emptyState:d,footer:s,search:u,setSearch:h,selectedIndex:f,setSelectedIndex:m,filteredCommands:p,filteredGroups:b,listRef:x,views:y,filter:k,...w})=>{if(!e)return null;const T=g.useCallback(V=>{V.disabled||(V.onSelect(),o(!1),h(""))},[o,h]),C=g.useCallback(V=>V.target===V.currentTarget&&o(!1),[o]),I=g.useMemo(()=>({search:u,setSearch:h,selectedIndex:f,setSelectedIndex:m,filteredCommands:p,onSelect:T}),[u,f,p,T,h,m]),j=t.length>0,z=p.length===0;return r.jsx(i.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:C,...w,children:r.jsx(kf,{value:I,children:r.jsxs(i.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...tf[a],...rf[c],...y==null?void 0:y.container,onClick:V=>V.stopPropagation(),children:[r.jsx($a,{value:u,onValueChange:h,placeholder:l,views:y==null?void 0:y.searchInput}),r.jsx(i.View,{ref:x,flex:1,overflow:"auto",...y==null?void 0:y.list,children:z?d||r.jsx(Ba,{views:y==null?void 0:y.empty}):j?b.map(V=>r.jsx(Ha,{heading:V.name,views:y==null?void 0:y.groupHeading,children:V.commands.map(W=>{const H=p.findIndex(S=>S.id===W.id);return r.jsx(Nt,{item:W,selected:H===f,onSelect:()=>T(W),"data-index":H,views:{container:y==null?void 0:y.item,icon:y==null?void 0:y.icon,content:y==null?void 0:y.content,name:y==null?void 0:y.name,description:y==null?void 0:y.description,shortcut:y==null?void 0:y.shortcut}},W.id)})},V.id)):p.map((V,W)=>r.jsx(Nt,{item:V,selected:W===f,onSelect:()=>T(V),"data-index":W,views:{container:y==null?void 0:y.item,icon:y==null?void 0:y.icon,content:y==null?void 0:y.content,name:y==null?void 0:y.name,description:y==null?void 0:y.description,shortcut:y==null?void 0:y.shortcut}},V.id))}),s&&r.jsx(i.View,{...yf,...y==null?void 0:y.footer,children:s})]})})})},oo=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:l,size:a="md",variant:c="default",filter:d,emptyState:s,footer:u,views:h,...f})=>{const{search:m,setSearch:p,selectedIndex:b,setSelectedIndex:x,filteredCommands:y,filteredGroups:k,listRef:w}=of({open:e,onOpenChange:o,groups:t,commands:n,filter:d});return r.jsx(wf,{open:e,onOpenChange:o,groups:t,commands:n,placeholder:l,size:a,variant:c,emptyState:s,footer:u,search:m,setSearch:p,selectedIndex:b,setSelectedIndex:x,filteredCommands:y,filteredGroups:k,listRef:w,views:h,...f})};oo.Input=$a,oo.List=Cf,oo.Group=Ha,oo.Item=Nt,oo.Empty=Ba;const La=()=>Math.random().toString(36).substring(2,11),If=({defaultOpen:e=!1,openDelay:o=200,closeDelay:t=200,isDisabled:n=!1}={})=>{const[l,a]=g.useState(e),c=g.useRef(null),d=g.useRef(null),s=g.useRef(null),u=g.useRef(null),h=g.useRef(`tooltip-trigger-${La()}`).current,f=g.useRef(`tooltip-content-${La()}`).current,m=g.useCallback(()=>{n||(u.current&&(clearTimeout(u.current),u.current=null),!l&&!s.current&&(s.current=setTimeout(()=>{a(!0),s.current=null},o)))},[l,o,n]),p=g.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),l&&!u.current&&(u.current=setTimeout(()=>{a(!1),u.current=null},t))},[l,t]),b=g.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]);return g.useEffect(()=>()=>{s.current&&clearTimeout(s.current),u.current&&clearTimeout(u.current)},[]),g.useEffect(()=>{const x=y=>{y.key==="Escape"&&l&&a(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[l]),{isOpen:l,openTooltip:m,closeTooltip:p,cancelCloseTimer:b,triggerRef:c,contentRef:d,triggerId:h,contentId:f}},Tf={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},jf=(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"}}))(),Sf=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}},Aa=g.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Ut=()=>g.useContext(Aa),Mf=({value:e,children:o})=>r.jsx(Aa.Provider,{value:e,children:o}),Da=g.memo(({children:e,views:o,asChild:t=!1,...n})=>{const{openTooltip:l,closeTooltip:a,triggerRef:c,contentId:d,triggerId:s}=Ut(),u=g.useCallback(()=>l(),[l]),h=g.useCallback(()=>a(),[a]),f=g.useCallback(()=>l(),[l]),m=g.useCallback(()=>a(),[a]),p={ref:c,onMouseEnter:u,onMouseLeave:h,onFocus:f,onBlur:m,id:s,"aria-describedby":d,...o==null?void 0:o.container,...n};return t&&g.isValidElement(e)?g.cloneElement(e,p):r.jsx(i.View,{display:"inline-block",...p,children:e})}),zf=g.memo(({children:e,views:o,...t})=>{const{isOpen:n,contentRef:l,contentId:a,triggerId:c}=Ut();return n?r.jsx(i.View,{ref:l,id:a,role:"tooltip","aria-labelledby":c,...o==null?void 0:o.container,...t,children:e}):null}),Vf=({content:e,children:o,position:t="top",align:n="center",size:l="md",variant:a="default",showArrow:c=!0,views:d,themeMode:s,...u})=>{const{isOpen:h,triggerRef:f,contentRef:m,contentId:p,triggerId:b}=Ut(),{ref:x,relation:y}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[k,w]=g.useState({x:0,y:0,placement:t});g.useEffect(()=>{f!=null&&f.current&&x&&(x.current=f.current)},[f,x,h]),g.useEffect(()=>{if(h&&(m!=null&&m.current)&&(f!=null&&f.current)){const I=f.current.getBoundingClientRect();let j=t;y&&(t==="top"&&y.space.vertical==="bottom"?j="bottom":t==="bottom"&&y.space.vertical==="top"?j="top":t==="right"&&y.space.horizontal==="left"?j="left":t==="left"&&y.space.horizontal==="right"&&(j="right"));let z=0,V=0;switch(j){case"top":z=n==="start"?I.left:n==="end"?I.right-120:I.left+I.width/2-60,V=I.top-8;break;case"bottom":z=n==="start"?I.left:n==="end"?I.right-120:I.left+I.width/2-60,V=I.bottom+8;break;case"right":z=I.right+8,V=n==="start"?I.top:n==="end"?I.bottom-32:I.top+I.height/2-16;break;case"left":z=I.left-8,V=n==="start"?I.top:n==="end"?I.bottom-32:I.top+I.height/2-16;break}w({x:z,y:V,placement:j})}},[h,t,n,f,m,y]);const T=g.useMemo(()=>c?Sf(k.placement):{},[c,k.placement]),C=g.useMemo(()=>{const I={position:"fixed",left:k.x,top:k.y,zIndex:1e3};switch(k.placement){case"top":return{...I,transform:"translateY(-100%)"};case"left":return{...I,transform:"translateX(-100%)"};case"bottom":case"right":default:return I}},[k.x,k.y,k.placement]);return r.jsxs(i.View,{position:"relative",display:"inline-block",...d==null?void 0:d.container,...u,children:[r.jsx(Da,{children:o}),h&&r.jsxs(i.View,{ref:m,id:p,role:"tooltip","aria-labelledby":b,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:C,...Tf[l],...jf[a],...d==null?void 0:d.content,children:[typeof e=="string"?r.jsx(i.Text,{...d==null?void 0:d.text,children:e}):e,c&&r.jsx(i.View,{...T,...d==null?void 0:d.arrow})]})]})},Gt=({content:e,children:o,position:t="top",align:n="center",size:l="md",variant:a="default",openDelay:c=200,closeDelay:d=200,showArrow:s=!0,defaultOpen:u=!1,isDisabled:h=!1,views:f,...m})=>{const p=If({defaultOpen:u,openDelay:c,closeDelay:d,isDisabled:h});return r.jsx(Mf,{value:p,children:r.jsx(Vf,{content:e,position:t,align:n,size:l,variant:a,showArrow:s,views:f,...m,children:o})})};Gt.Trigger=Da,Gt.Content=zf;const Fa=g.forwardRef((e,o)=>{const t=bn(e);return r.jsx(In,{...e,...t})});Fa.displayName="ChatInput";const Ef={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},Oa={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%"}},Yt={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}},vt={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}},qa={"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"},ot={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"},Pf={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"}]},Wf=(e,o,t,n,l)=>{const a=o.map(c=>`${c.color} ${c.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${t&&qa[t]?qa[t]:t||"to right"}, ${a})`;case"radial":const d=l&&ot[l]?ot[l]:l||"center";return`radial-gradient(${n||"circle"} at ${d}, ${a})`;case"conic":return`conic-gradient(from 0deg at ${l&&ot[l]?ot[l]:l||"center"}, ${a})`;default:return`linear-gradient(to right, ${a})`}},_f={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)"}}}},Na={container:{position:"relative",overflow:"hidden",borderRadius:"8px",transition:"all 0.2s ease"},content:{position:"relative",zIndex:1,width:"100%",height:"100%",padding:"16px"}},$f=({type:e="linear",direction:o="to-right",shape:t="circle",position:n="center",from:l,to:a,colors:c,animate:d=!1,animationDuration:s=3,children:u,views:h,themeMode:f,...m})=>{const p=g.useMemo(()=>c&&c.length>0?c:l&&a?[{color:l,position:"0%"},{color:a,position:"100%"}]:Pf[e],[c,l,a,e]),b=g.useMemo(()=>{const y=p.map(k=>({...k,color:k.color}));return Wf(e,y,o,t,n)},[e,p,o,t,n]),x=g.useMemo(()=>{if(!d)return{};const y=_f[e];return{...y,transition:y.transition.replace("3s",`${s}s`),animationDuration:`${s}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[d,s,e]);return r.jsx(i.View,{background:b,...Na.container,...x,...h==null?void 0:h.container,...m,children:u&&r.jsx(i.View,{...Na.content,...h==null?void 0:h.content,children:u})})},Hf=e=>r.jsx($f,{...e}),Bf=g.createContext({}),Lf=({children:e,showRadialGradient:o=!0,views:t,themeMode:n,...l})=>{const a={white:"rgba(255,255,255,1)",transparent:"rgba(255,255,255,0)"},c=["rgb(59, 130, 246)","rgb(196, 181, 253)","rgb(147, 197, 253)","rgb(221, 214, 254)","rgb(96, 165, 250)"],d={...Oa.gradient,backgroundImage:`
|
|
28
|
+
${fe}`:fe}let ie=W,ue=!1;W.endsWith("-thinking")&&(ie=W.replace(/-thinking$/,""),ue=!0),n(J,{model_name:ie,enable_thinking:ue}),b||y(""),T([]),w([])},N=K=>{T(J=>J.filter((ie,ue)=>ue!==K)),!u&&C.length>K&&w(J=>J.filter((ie,ue)=>ue!==K))},Q=K=>{K.preventDefault(),K.stopPropagation(),B(!0)},R=K=>{K.preventDefault(),K.stopPropagation(),B(!1)},ee=d.useCallback(K=>{!K||K.length===0||(w(J=>[...J,...K]),T(J=>[...J,...K]),S(J=>[...J,...K]),z(!0))},[w,T]),re=d.useCallback(()=>{if(H.length>0&&!$&&p){A(!0);const K=H[0];_.current=K,P(0);try{p(K)}catch(J){S(ie=>ie.slice(1)),A(!1),_.current=null,P(0),z(ie=>H.length-1>0||!1),m==null||m(J)}}else H.length===0&&j&&(z(!1),P(0))},[H,$,p,j,m]);d.useEffect(()=>{re()},[H,$,re]);const ne="active",ge=K=>!0,me=()=>{U(!1),e.onGuideClose&&e.onGuideClose()},Y=K=>{b&&t?t(K.text):y(K.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(K),F.current&&F.current.focus()},v=d.useCallback(()=>C,[C]),oe=d.useCallback(()=>w([]),[]);return{onSubmit:n,getPendingFiles:v,clearPendingFiles:oe,value:k,handleChange:Z,handleSubmit:X,editableRef:F,fileInputRef:q,isUploading:j,uploadProgress:E,isDraggingOver:V,uploadedFiles:I,pendingFiles:C,removeUploadedFile:N,setPendingFiles:w,setUploadedFiles:T,setIsUploading:z,startUpload:ee,selectedModel:W,handleModelChange:L,modelOptions:D,subscriptionStatus:ne,canAccessModel:ge,handleDragOver:Q,handleDragLeave:R,isGuideTipShown:O,hideGuideTip:me,handlePromptExampleSelect:Y}},lg={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}},bn={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"}}}},cg={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},ig={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"}},sg={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"}},yn=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,dg=({openDelay:e=200,closeDelay:o=300}={})=>{const[t,n]=d.useState(!1),l=d.useRef(null),a=d.useRef(null),c=d.useRef(null),g=d.useRef(null),s=d.useMemo(()=>yn("hovercard-content"),[]),u=d.useMemo(()=>yn("hovercard-trigger"),[]),h=d.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),f=d.useCallback(()=>{h(),t||(l.current=setTimeout(()=>{n(!0)},e))},[t,e,h]),m=d.useCallback(()=>{h(),t&&(a.current=setTimeout(()=>{n(!1)},o))},[t,o,h]),p=d.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null)},[]);return d.useEffect(()=>()=>h(),[h]),{isOpen:t,openCard:f,closeCard:m,cancelCloseTimer:p,triggerRef:c,contentRef:g,contentId:s,triggerId:u}},xn=d.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),gg=({children:e,value:o})=>r.jsx(xn.Provider,{value:o,children:e}),kn=()=>{const e=d.useContext(xn);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},ug=({children:e,views:o,asChild:t=!1,...n})=>{const{openCard:l,closeCard:a,triggerRef:c,contentId:g,triggerId:s}=kn(),p={ref:c,onMouseEnter:()=>l(),onMouseLeave:()=>a(),onFocus:()=>l(),onBlur:()=>a(),id:s,"aria-describedby":g,...o==null?void 0:o.container,...n};if(t&&d.isValidElement(e)){const b=d.Children.only(e);return d.cloneElement(b,{...p,...b.props})}return r.jsx(i.View,{position:"relative",display:"inline-block",...p,children:e})},hg=({children:e,views:o,side:t="bottom",align:n="center",sideOffset:l=8,style:a,backgroundColor:c="white",borderRadius:g="4px",boxShadow:s="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:u="12px",minWidth:h="50px",maxWidth:f="300px",...m})=>{const{isOpen:p,cancelCloseTimer:b,closeCard:x,contentRef:y,triggerRef:k,contentId:I,triggerId:T}=kn(),{ref:C,relation:w}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});d.useEffect(()=>{k!=null&&k.current&&(C==null?void 0:C.current)!==k.current&&C&&(C.current=k.current)},[k,C,p]);const j=()=>b(),z=()=>x();if(!p)return null;const E=()=>{if(!w||!(k!=null&&k.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const S=k.current.getBoundingClientRect();let $=t;t==="bottom"&&w.space.vertical==="top"?$="top":t==="top"&&w.space.vertical==="bottom"?$="bottom":t==="right"&&w.space.horizontal==="left"?$="left":t==="left"&&w.space.horizontal==="right"&&($="right");let A=0,_=0;switch($){case"bottom":A=S.left+S.width/2,_=S.bottom+l;break;case"top":A=S.left+S.width/2,_=S.top-l;break;case"right":A=S.right+l,_=S.top+S.height/2;break;case"left":A=S.left-l,_=S.top+S.height/2;break}return{position:"fixed",left:A,top:_,zIndex:1e3,transform:P($)}},P=S=>{switch(S){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)"}},H=E();return r.jsx(i.View,{ref:y,id:I,role:"tooltip","aria-labelledby":T,onMouseEnter:j,onMouseLeave:z,backgroundColor:c,borderRadius:g,boxShadow:s,padding:u,minWidth:h,maxWidth:f,style:{...H,...a},...o==null?void 0:o.container,...m,children:e})},be=({children:e,views:o,openDelay:t,closeDelay:n,...l})=>{const a=dg({openDelay:t,closeDelay:n});return r.jsx(gg,{value:a,children:r.jsx(i.View,{position:"relative",display:"inline-block",...o==null?void 0:o.container,...l,children:e})})};be.Trigger=ug,be.Content=hg;const fg=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:l="120px",showPreviews:a=!1,views:c={}})=>{if(e.length===0)return null;const g=d.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(i.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:l,overflowY:"auto",...c==null?void 0:c.container,children:e.map((s,u)=>{const h=URL.createObjectURL(s)||(s==null?void 0:s.path)||(s==null?void 0:s.url)||"",f=s.type.startsWith("image/"),m=s.type.startsWith("video/"),p=s.type.startsWith("audio/");return r.jsx(i.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,...c==null?void 0:c.item,children:a&&r.jsxs(be,{children:[r.jsxs(be.Trigger,{children:[f&&r.jsx(i.Image,{src:h,alt:s.name,width:"60px",height:"60px",objectFit:"cover"}),m&&r.jsx(i.View,{as:"video",src:h,alt:s.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),p&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(jo,{widthHeight:24,color:"color-black"})}),!f&&!m&&!p&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(to,{widthHeight:24,color:"color-black"})}),t&&r.jsx(i.Button,{...lg.attachmentRemove,onClick:b=>{b.stopPropagation(),t(u)},"aria-label":`Remove ${s.name}`,children:"×"})]}),r.jsxs(be.Content,{children:[f&&r.jsx(i.Image,{src:h,alt:s.name,maxWidth:"100%"}),m&&r.jsx(i.View,{as:"video",src:h,controls:!0,maxWidth:"100%"}),p&&r.jsx(i.View,{as:"audio",src:h,controls:!0,width:"100%"}),r.jsxs(i.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...c==null?void 0:c.name,children:[s.name," (",g(s.size),")"]})]})]})},u)})})},Cn=d.forwardRef(({value:e,onChange:o,placeholder:t="Type your message...",disabled:n=!1,autoFocus:l=!0,suggestions:a=[],onSuggestionSelect:c,showSuggestions:g=!1,mentionData:s=[],mentionTrigger:u="@",onMentionSelect:h,maxHeight:f="200px",minHeight:m="40px",views:p={}},b)=>{var ge,me;const x=d.useRef(e),[y,k]=d.useState(-1),[I,T]=d.useState(!e),C=d.useRef(null),[w,j]=d.useState(!1),[z,E]=d.useState(!1),[P,H]=d.useState(""),[S,$]=d.useState(-1),[A,_]=d.useState(-1),[V,B]=d.useState([]),{ref:W,relation:L}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[D,F]=d.useState({x:0,y:0}),[q,O]=d.useState({x:0,y:0});d.useEffect(()=>{const Y=b;Y.current&&e!==x.current&&(Y.current.textContent=e,x.current=e,T(!e))},[e,b]),d.useEffect(()=>{l&&b&&typeof b=="object"&&b.current&&b.current.focus()},[l,b]);const U=()=>{const Y=window.getSelection();if(!Y||Y.rangeCount===0)return-1;const v=Y.getRangeAt(0),oe=v.cloneRange();return oe.selectNodeContents(b&&typeof b=="object"&&b.current?b.current:document.body),oe.setEnd(v.endContainer,v.endOffset),oe.toString().length},Z=d.useCallback((Y,v)=>{const oe=Y.substring(0,v),K=oe.lastIndexOf(u);if(K!==-1){const J=oe.substring(K+1);if(!J.includes(" ")){const ue=J.toLowerCase(),fe=s.filter(ae=>ae.name.toLowerCase().includes(ue));H(ue),$(K),B(fe),E(fe.length>0),_(0);const xe=X();F(xe);return}}E(!1),H(""),$(-1),_(-1)},[s,u]);d.useEffect(()=>{C.current&&W&&(W.current=C.current)},[C,W]);const X=d.useCallback((Y=200)=>{if(!C.current)return{x:0,y:0};const v=C.current.getBoundingClientRect();if(L){const ie=L.space.vertical==="top";return{x:v.left,y:ie?v.top-Y-8:v.bottom+8}}const oe=window.innerHeight,K={top:v.top,bottom:oe-v.bottom},J=K.bottom<Y+8&&K.top>K.bottom;return{x:v.left,y:J?v.top-Y-8:v.bottom+8}},[L]),N=d.useCallback(()=>{j(!0);const Y=X();O(Y)},[X]),Q=d.useCallback(()=>{setTimeout(()=>{j(!1),k(-1)},150)},[]),R=Y=>{const v=Y.currentTarget.textContent||"";if(v!==x.current){o(v),x.current=v,T(!v);const oe=U();Z(v,oe)}},ee=d.useCallback(Y=>{if(b&&typeof b=="object"&&b.current){const v=b.current.textContent||"",oe=v.substring(0,S),K=v.substring(S+u.length+P.length),J=oe+u+Y.name+" "+K;o(J),x.current=J,b.current.textContent=J;const ie=oe.length+u.length+Y.name.length+1;setTimeout(()=>{var ue;if(b.current){const fe=document.createRange(),xe=window.getSelection(),ae=b.current.firstChild;ae&&xe&&(fe.setStart(ae,Math.min(ie,((ue=ae.textContent)==null?void 0:ue.length)||0)),fe.collapse(!0),xe.removeAllRanges(),xe.addRange(fe))}},0)}E(!1),H(""),$(-1),_(-1),h&&h(Y)},[S,u,P,o,h,b]),re=d.useCallback(Y=>{c&&c(Y),k(-1)},[c]),ne=Y=>{if(z&&V.length>0){if(Y.key==="ArrowDown"){Y.preventDefault(),_(v=>v<V.length-1?v+1:0);return}if(Y.key==="ArrowUp"){Y.preventDefault(),_(v=>v>0?v-1:V.length-1);return}if((Y.key==="Tab"||Y.key==="Enter")&&A>=0){Y.preventDefault(),ee(V[A]);return}if(Y.key==="Escape"){E(!1),_(-1);return}}if(g&&a.length>0){if(Y.key==="ArrowDown"){Y.preventDefault(),k(v=>v<a.length-1?v+1:0);return}if(Y.key==="ArrowUp"){Y.preventDefault(),k(v=>v>0?v-1:a.length-1);return}if(Y.key==="Tab"&&y>=0){Y.preventDefault(),re(a[y]);return}if(Y.key==="Escape"){k(-1);return}}};return r.jsxs(i.View,{ref:C,width:"100%",position:"relative",...p==null?void 0:p.container,children:[r.jsxs(i.View,{width:"100%",minHeight:m,maxHeight:f,overflowY:"auto",position:"relative",children:[I&&r.jsx(i.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...p==null?void 0:p.placeholder,children:t}),r.jsx(i.View,{as:"div",ref:b,contentEditable:!n,suppressContentEditableWarning:!0,onInput:R,onKeyDown:ne,onFocus:N,onBlur:Q,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",...p==null?void 0:p.input})]}),z&&V.length>0&&r.jsx(i.View,{position:"fixed",left:D.x,top:D.y,width:((ge=C.current)==null?void 0:ge.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",...p==null?void 0:p.mentionContainer,children:r.jsxs(i.Vertical,{gap:0,children:[V.map((Y,v)=>r.jsx(i.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:v===A?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>ee(Y),onMouseEnter:()=>_(v),_hover:{backgroundColor:"color-blue-50"},...p==null?void 0:p.mentionItem,children:r.jsxs(i.Vertical,{gap:4,children:[r.jsxs(i.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[u,Y.name]}),Y.description&&r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",children:Y.description})]})},Y.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",u,")",L&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})}),g&&a.length>0&&!z&&w&&!e&&r.jsx(i.View,{position:"fixed",left:q.x,top:q.y,width:((me=C.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",...p==null?void 0:p.suggestionsContainer,children:r.jsxs(i.Vertical,{gap:0,children:[a.map((Y,v)=>r.jsx(i.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:v===y?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>re(Y),onMouseEnter:()=>k(v),_hover:{backgroundColor:"color-blue-50"},...p==null?void 0:p.suggestionItem,children:r.jsxs(i.Vertical,{gap:4,children:[r.jsx(i.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:Y.text}),Y.description&&r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",children:Y.description})]})},Y.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",L&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})})]})});Cn.displayName="EditableInput";const mg=({examples:e,onSelect:o,views:t={}})=>{const{getColor:n}=i.useTheme();return!e||e.length===0?null:r.jsx(i.Horizontal,{gap:8,overflowX:"auto",padding:"8px 0",width:"100%",...t==null?void 0:t.container,children:e.map(l=>r.jsx(i.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(l),_hover:{backgroundColor:"color-gray-200"},...t==null?void 0:t.item,children:r.jsx(i.Text,{fontSize:"14px",color:"color-gray-700",...t==null?void 0:t.text,children:l.text})},l.id))})},pg=({onRecordingComplete:e,onRecordingStart:o,views:t={}})=>{const{recording:n,paused:l,audioBlob:a,analyserNode:c,startRecording:g,stopRecording:s}=ir();d.useEffect(()=>{if(a){const h=new File([a],`recording-${Date.now()}.webm`,{type:a.type||"audio/webm;codecs=opus"});e(h)}},[a]);const u=d.useCallback(()=>{g(),o==null||o()},[]);return r.jsxs(i.Horizontal,{alignItems:"center",gap:4,children:[r.jsx(i.View,{minWidth:90,children:n&&c&&r.jsx(ft,{analyserNode:c,isPaused:l})}),r.jsx(i.View,{as:"button",type:"button",onClick:n?s:u,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(Mo,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(ct,{widthHeight:16,color:"currentColor",filled:!1})})]})},wn=d.memo(({onSubmit:e,placeholder:o="Say what you want and Kimmy will surprise you",loading:t=!1,disabled:n=!1,isAgentRunning:l=!1,enableAudioRecording:a=!1,leftButtons:c,rightButtons:g,onStopAgent:s,loadingText:u="Agent is working...",autoFocus:h=!0,sandboxId:f,hideAttachments:m=!1,attachmentText:p="",promptExamples:b=[],suggestions:x=[],errorMessage:y,size:k="md",shape:I="rounded",variant:T="default",views:C={},mentionData:w=[],mentionTrigger:j="@",onMentionSelect:z,onAudioRecordingStart:E,onAudioRecordingStop:P,value:H,handleChange:S,handleSubmit:$,editableRef:A,fileInputRef:_,isUploading:V,uploadProgress:B,isDraggingOver:W,uploadedFiles:L,removeUploadedFile:D,setPendingFiles:F,setUploadedFiles:q,setIsUploading:O,startUpload:U,selectedModel:Z,handleModelChange:X,modelOptions:N,subscriptionStatus:Q,canAccessModel:R,isGuideTipShown:ee,hideGuideTip:re,handlePromptExampleSelect:ne,handleDragOver:ge,handleDragLeave:me,onChange:Y,...v})=>{i.useTheme();const oe=d.useMemo(()=>({...bn.container,...cg[I],...C==null?void 0:C.container}),[I,C==null?void 0:C.container]),K=d.useMemo(()=>({...bn.content,...ig[k],...sg[T],...C==null?void 0:C.content}),[k,T,C==null?void 0:C.content]),J=((H==null?void 0:H.trim().length)??0)>0||L.length>0,ie=d.useCallback(ae=>{U([ae]),P==null||P(ae)},[U,P]),ue=d.useCallback(ae=>{const We=ae.filter(Ie=>Ie.size>52428800?(console.error(`File size exceeds 50MB limit: ${Ie.name}`),!1):!0);We.length>0&&U(We)},[U]),fe=d.useCallback(ae=>{if(ae.preventDefault(),ae.stopPropagation(),me(ae),ae.dataTransfer.files.length>0){const We=Array.from(ae.dataTransfer.files);ue(We)}},[me,ue]),xe=d.useMemo(()=>[...w||[],...L.map((ae,We)=>({id:`file-${We}`,name:ae.name}))],[w,L]);return r.jsxs(i.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...oe,...v,onDragOver:ge,onDragLeave:me,onDrop:fe,children:[b.length>0&&r.jsx(mg,{examples:b,onSelect:ne,views:{container:C==null?void 0:C.promptExamples,item:C==null?void 0:C.promptExampleItem}}),l&&r.jsxs(i.Horizontal,{justifyContent:"center",alignItems:"center",gap:8,padding:"8px 0",animate:{from:{opacity:0,y:-10},to:{opacity:1,y:0},duration:"0.3s"},...C==null?void 0:C.loadingIndicator,children:[r.jsx(st,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(i.Text,{color:"color-gray-500",children:u})]}),r.jsx(i.View,{position:"relative",width:"100%",overflow:"visible",children:r.jsxs(i.View,{as:"form",onSubmit:$,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...K,...oe,paddingHorizontal:16,paddingVertical:10,backgroundColor:W?"color-blue-50":void 0,children:[r.jsx(fg,{files:L,sandboxId:f,onRemove:D,showPreviews:!0,views:{container:C==null?void 0:C.attachments,item:C==null?void 0:C.attachmentItem,name:C==null?void 0:C.attachmentName,size:C==null?void 0:C.attachmentSize,removeButton:C==null?void 0:C.attachmentRemove}}),r.jsx(Cn,{ref:A,value:H||"",onChange:S,placeholder:o,disabled:n&&!l,autoFocus:h,suggestions:x||[],showSuggestions:x&&x.length>0&&!H,onSuggestionSelect:ae=>{S(ae.text)},mentionData:xe,mentionTrigger:j,onMentionSelect:z,views:{container:{},input:C==null?void 0:C.editableInput}}),r.jsxs(i.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[r.jsxs(i.Horizontal,{gap:8,alignItems:"center",children:[!m&&r.jsx(Wo,{accept:"*/*",icon:r.jsx(ro,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:ue,isLoading:V,progress:B||0,text:p,fileType:"file",renderError:({errorMessage:ae})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},...C==null?void 0:C.fileButton}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:I==="rounded"?"50%":4,padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:ae=>ae.size>50*1024*1024?"File size exceeds 50MB limit":null}),c]}),r.jsxs(i.Horizontal,{gap:8,alignItems:"center",children:[a&&r.jsx(pg,{onRecordingStart:E,onRecordingComplete:ie,views:{button:C==null?void 0:C.recordButton}}),r.jsx(i.View,{as:"button",type:"button",onClick:$,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:l?"theme-error":J?"theme-primary":"color-gray-300",color:"color-white",borderRadius:I==="rounded"?"50%":4,border:"none",cursor:J?"pointer":"not-allowed",disabled:!J||t||n&&!l,transition:"all 0.2s ease",_hover:{backgroundColor:l?"color-red-600":J?"color-blue-600":"color-gray-300"},...C==null?void 0:C.submitButton,children:l?r.jsx(Mo,{widthHeight:16,color:"currentColor",filled:!1}):t?r.jsx(no,{type:"quarter",size:16,color:"color-white"}):r.jsx(it,{widthHeight:16,color:"currentColor",filled:!1})}),g]})]})]})}),y&&r.jsx(i.Text,{color:"theme-error",marginTop:"4px",...C==null?void 0:C.bottomTip,children:y})]})}),bg=e=>{const{name:o,onSubmit:t,...n}=e,[l,a]=d.useState([]),c=se({name:o,type:"text"}),g=m=>{c.onChangeText&&c.onChangeText(m)},s=(m,p)=>{t?t(m,p):g(m)},u=()=>l,h=()=>a([]),f=pn({...n,value:c.value||"",onChange:g,onSubmit:s,getPendingFiles:u,clearPendingFiles:h});return r.jsx(wn,{...n,...f,value:c.value||"",onChange:g,onSubmit:s,error:c.error,getPendingFiles:u,clearPendingFiles:h})},yg=e=>{const o=se(e),t=Gr(o);return r.jsx(Yr,{...t,...o})},xg=e=>{const o=se(e),t=rn();return r.jsx(nn,{...t,...o})},kg=e=>{const o=se(e),t=vr(e);return r.jsx(Kr,{...t,...o})},Cg=e=>{let o=se(e);o.selected=o.value;const t=Mr(e);return r.jsx($r,{...t,...o})},wg=e=>{const o=se(e),t=Hr(e);return r.jsx(Lr,{...t,...o})},Ig=e=>{const{name:o,...t}=e,{values:n,errors:l,touched:a,submitCount:c,setFieldValue:g,setFieldTouched:s}=ye.useFormikContext(),u=ye.getIn(n,o)||[],h=ye.getIn(a,o)||c>0?ye.getIn(l,o):void 0,f=d.useCallback(y=>{var I;const k=Array.isArray(y)?y.filter(T=>typeof T=="string"):[];g(o,k),(I=e.onTagsChange)==null||I.call(e,k)},[o,g,e.onTagsChange]),m=d.useCallback(()=>{var y;s(o,!0),(y=e.onBlur)==null||y.call(e)},[o,s,e.onBlur]),p=gn({...t,tags:u,onTagsChange:f,onBlur:m}),{tags:b,...x}=p;return r.jsx(un,{...x,...t,tags:b,error:h})},Tg=e=>{const o=se(e),t=Fr(e);return r.jsx(Or,{...t,...o})},jg=e=>{const o=se(e),{value:t,...n}=St(e);return r.jsx(go,{...n,...o})},Sg=({visibleIcon:e=r.jsx(gt,{widthHeight:14}),hiddenIcon:o=r.jsx(dt,{widthHeight:14}),...t})=>{const n=se(t),{isVisible:l,setIsVisible:a,...c}=an(n);return r.jsx(go,{...c,type:l?"text":"password",isClearable:!1,right:r.jsx(i.View,{onClick:()=>{t.isDisabled||a(!l)},children:l?e:o})})},Mg=({items:e,placeholder:o,searchPlaceholder:t,isMulti:n=!1,...l})=>{const a=se(l),c=ln(e,o,t);d.useEffect(()=>{if(n&&Array.isArray(a.value))c.setSelectedItems(a.value);else if(!n&&a.value){const s=typeof a.value=="object"?a.value:e.find(u=>u.value===a.value);s&&c.setSelectedItem(s)}},[a.value,n,e]);const g=s=>{a.onChange(s)};return r.jsx(dn,{...c,...a,items:e,placeholder:o,isMulti:n,onSelect:g})},ve=(e,o,t)=>Math.min(Math.max(e,o),t),zg=(e,o,t,n,l,a,c)=>{const g=n-t;let s;if(a==="horizontal"){const u=o.width,h=e-o.left;s=ve(h/u,0,1)}else{const u=o.height,h=o.bottom-e;s=ve(h/u,0,1)}if(c&&c.length>0){const u=t+s*g;let h=c[0],f=Math.abs(u-h);for(let m=1;m<c.length;m++){const p=Math.abs(u-c[m]);p<f&&(f=p,h=c[m])}return h}else{const u=t+s*g,h=Math.round(u/l)*l;return ve(h,t,n)}},In=({min:e=0,max:o=100,step:t=1,value:n=0,defaultValue:l,onChange:a,onDrag:c,orientation:g="horizontal",isDisabled:s=!1,stepValues:u})=>{const h=ve(n??l??e,e,o),[f,m]=d.useState(h),[p,b]=d.useState(!1),[x,y]=d.useState(!1),k=d.useRef(null),I=d.useRef(null),T=n!==void 0,C=T?n:f;d.useEffect(()=>{T&&m(ve(n,e,o))},[n,T,e,o]);const w=d.useCallback($=>{const A=ve($,e,o);T||m(A),a&&A!==C&&a(A),p&&c&&c(A)},[T,e,o,a,C,p,c]),j=d.useCallback($=>{if(s||!k.current)return;const A=k.current.getBoundingClientRect();let _;"touches"in $?_=g==="horizontal"?$.touches[0].clientX:$.touches[0].clientY:_=g==="horizontal"?$.clientX:$.clientY;const V=zg(_,A,e,o,t,g,u);w(V)},[e,o,t,g,w,s,u]),z=d.useCallback($=>{if(s)return;$.preventDefault(),b(!0),j($);const A=V=>{j(V)},_=()=>{b(!1),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",_)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",_),document.addEventListener("touchmove",A),document.addEventListener("touchend",_)},[j,s]),E=d.useCallback($=>{I.current&&I.current.contains($.target)||z($)},[z]),P=d.useCallback($=>{if(s)return;let A=C;switch($.key){case"ArrowLeft":case"ArrowDown":A=C-t;break;case"ArrowRight":case"ArrowUp":A=C+t;break;case"Home":A=e;break;case"End":A=o;break;default:return}$.preventDefault(),w(A)},[C,e,o,t,w,s]),H=o-e,S=H===0?0:(C-e)/H*100;return{currentValue:C,isDragging:p,isHovered:x,setIsHovered:y,trackRef:k,thumbRef:I,handleThumbMouseDown:z,handleTrackMouseDown:E,handleKeyDown:P,thumbPositionPercent:S}},Tn={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%"}},jn={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}},Sn={square:0,rounded:4,pill:24},Mn=(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"}}))(),Vg={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}},Eg={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},zn=d.memo(({min:e=0,max:o=100,step:t=1,currentValue:n,stepValues:l,shape:a="rounded",size:c="md",variant:g="default",orientation:s="horizontal",isDisabled:u=!1,showValue:h=!1,showTooltip:f=!1,backgroundColor:m="theme-primary",label:p,helperText:b,themeMode:x,shadow:y={},isDragging:k,isHovered:I,setIsHovered:T,trackRef:C,thumbRef:w,handleThumbMouseDown:j,handleTrackMouseDown:z,handleKeyDown:E,thumbPositionPercent:P,ariaLabel:H="Slider",views:S={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:$,onDrag:A,..._})=>{var N,Q;const{getColorHex:V,themeMode:B}=i.useTheme(),W=x||B,L=d.useMemo(()=>V(m,{themeMode:W}),[V,m,W]),D=d.useMemo(()=>V("theme-disabled",{themeMode:W}),[V,W]),F=d.useMemo(()=>V(Mn[g].backgroundColor,{themeMode:W}),[V,g,W]),q=s==="vertical",{trackCrossAxisSize:O,thumbSize:U}=Vg[c]||{trackCrossAxisSize:Tn[c].height,thumbSize:jn[c].width||16},Z=r.jsxs(i.Vertical,{width:"100%",gap:8,...S.container,..._,children:[p&&r.jsxs(i.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[r.jsx(i.Text,{fontSize:14,fontWeight:500,...S.label,children:p}),h&&r.jsx(i.Text,{fontSize:14,color:"color-blueGray-500",...S.valueLabel,children:n})]}),r.jsxs(i.View,{ref:C,position:"relative",cursor:u?"not-allowed":"pointer",opacity:u?.6:1,onMouseDown:z,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),...Tn[c],borderRadius:Sn[a],backgroundColor:F,...Mn[g],...y,...S.track,children:[l&&l.length>0&&r.jsx(r.Fragment,{children:l.map(R=>{const ee=(R-e)/(o-e)*100;return r.jsx(i.View,{position:"absolute",top:"50%",left:`${ee}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",backgroundColor:u?D:L,zIndex:1,...S.stepMarks},R)})}),r.jsx(i.View,{position:"absolute",top:0,left:0,height:"100%",width:`${P}%`,backgroundColor:u?D:L,borderRadius:Sn[a],transition:"width 0.1s ease-in-out",...S.progress,...S.filledTrack}),r.jsx(i.View,{ref:w,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":u,"aria-label":H,position:"absolute",top:"50%",left:`${P}%`,borderRadius:"50%",backgroundColor:"color-white",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:`2px solid ${u?D:L}`,transition:k?"none":"transform 0.1s ease-in-out",transform:I?"translate(-50%, -50%) scale(1.1)":"translate(-50%, -50%)",zIndex:2,onMouseDown:j,onTouchStart:j,onKeyDown:E,...jn[c],...S.thumb,children:f&&(I||k)&&r.jsx(i.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,...S.tooltip,children:r.jsx(i.Text,{...(N=S.tooltip)==null?void 0:N.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),b&&r.jsx(Tt,{children:b})]}),X=r.jsxs(i.Center,{...Eg[s],position:"relative",onMouseEnter:()=>!u&&T(!0),onMouseLeave:()=>!u&&T(!1),..._,...S==null?void 0:S.container,children:[p&&r.jsxs(i.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[r.jsx(i.Text,{fontSize:14,fontWeight:500,...S.label,children:p}),h&&r.jsx(i.Text,{fontSize:14,color:"color-blueGray-500",...S.valueLabel,children:n})]}),r.jsxs(i.View,{ref:C,position:"relative",borderRadius:O/2,backgroundColor:u?D:F,cursor:u?"not-allowed":"pointer",width:q?`${O}px`:"100%",height:q?"100%":`${O}px`,onMouseDown:z,onTouchStart:z,...S==null?void 0:S.track,children:[l&&l.length>0&&r.jsx(r.Fragment,{children:l.map(R=>{const ee=(R-e)/(o-e)*100;return r.jsx(i.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:u?D:L,zIndex:1,...q?{bottom:`${ee}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${ee}%`,top:"50%",transform:"translate(-50%, -50%)"},...S.stepMarks},R)})}),r.jsx(i.View,{position:"absolute",borderRadius:O/2,backgroundColor:u?D:L,...q?{bottom:0,left:0,width:"100%",height:`${P}%`}:{top:0,left:0,height:"100%",width:`${P}%`},...S==null?void 0:S.filledTrack,...S==null?void 0:S.progress}),r.jsx(i.View,{ref:w,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":u,"aria-label":H,position:"absolute",width:`${U}px`,height:`${U}px`,borderRadius:"50%",backgroundColor:u?D:L,border:"2px solid color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:u?"not-allowed":"grab",transform:q?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:k?"none":"left 0.1s, bottom 0.1s",...q?{left:"50%",bottom:`${P}%`}:{top:"50%",left:`${P}%`},onMouseDown:j,onTouchStart:j,onKeyDown:E,...S==null?void 0:S.thumb,children:f&&(I||k)&&r.jsx(i.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...q?{left:"100%",marginLeft:"8px",bottom:"0",transform:"translateY(50%)"}:{bottom:"100%",left:"50%",marginBottom:"8px",transform:"translateX(-50%)"},...S==null?void 0:S.tooltip,children:r.jsx(i.Text,{...(Q=S==null?void 0:S.tooltip)==null?void 0:Q.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),b&&r.jsx(Tt,{marginTop:8,children:b})]});return q||f?X:Z}),Pg=e=>{const o=se(e),t=In({...e,value:o.value!==void 0?Number(o.value):void 0,onChange:n=>{var l;o.onChange(n),(l=e.onChange)==null||l.call(e,n)}});return r.jsx(zn,{...e,...t,...o})},Wg=e=>{const o=se(e),{isFocused:t,setIsFocused:n,isHovered:l,setIsHovered:a,inputRef:c,containerRef:g,mirrorSelectionStart:s,mirrorSelectionEnd:u,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:m,handleFocus:p,handleBlur:b,handleKeyDown:x,handlePaste:y}=hn(e),k=d.useCallback(T=>{o.onChange&&o.onChange(T),e.onComplete&&T.length===(e.length||6)&&e.onComplete(T),c.current&&(c.current.value=T)},[o,e,c]),I=d.useCallback(T=>{const C=T.currentTarget.value.slice(0,e.length||6);k(C),c.current&&(c.current.value=C)},[e.length,k,c]);return r.jsx(fn,{...e,...o,setValue:k,isFocused:t,setIsFocused:n,isHovered:l,setIsHovered:a,inputRef:c,containerRef:g,mirrorSelectionStart:s,mirrorSelectionEnd:u,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:m,handleChange:I,handleFocus:p,handleBlur:b,handleKeyDown:x,handlePaste:y,stepValues:e.stepValues})},_g=e=>Array.isArray(e)?e:e==null?[]:[e],Vn=({name:e,uploadFile:o,onUploadSuccess:t,onUploadError:n,transformResponse:l,onMultipleFileSelect:a,onFileSelect:c,multiple:g=!0,...s})=>{const{setFieldValue:u,setFieldTouched:h,values:f}=ye.useFormikContext(),[m,p]=d.useState(!1),[b,x]=d.useState(0),y=d.useCallback(async T=>{if(!T||T.length===0)return;h(e,!0,!0),p(!0);const C=[];for(const w of T){x(0);try{const j=await o(w,E=>{x(E??0)}),z=l?l(j,w):j;C.push(z),t==null||t(w,z)}catch(j){n==null||n(w,j)}}if(C.length>0){const w=_g(ye.getIn(f,e));u(e,[...w,...C],!0),x(100)}else x(0);p(!1)},[e,n,t,h,u,l,o,f]),k=d.useCallback(async T=>{a==null||a(T),await y(T)},[y,a]),I=d.useCallback(async T=>{c==null||c(T),await y([T])},[y,c]);return r.jsx(Wo,{...s,multiple:g,onMultipleFileSelect:g?k:void 0,onFileSelect:g?void 0:I,isLoading:m,progress:b})};Vn.displayName="FormikUploader";const $g=e=>{let o=se(e);o.selected=o.value;const t=Ar(e);return r.jsx(Dr,{...t,...o})},En=e=>{const[o,t]=d.useState(!1),[n,l]=d.useState(e);return{isHovered:o,setIsHovered:t,isToggle:n,setIsToggled:l}},Hg={square:0,rounded:4,pill:24},Bg=(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"}}),Pn=d.memo(({children:e,shape:o="rounded",variant:t="ghost",isHovered:n,setIsHovered:l,isDisabled:a,isToggle:c,setIsToggled:g,onToggle:s,views:u,backgroundColor:h,color:f,themeMode:m,...p})=>{const{getColor:b,themeMode:x}=i.useTheme(),y=m??x,I=b(a?"theme-disabled":h??f??"theme-primary",{themeMode:y}),C=d.useMemo(()=>Bg(I,y==="light"),[I,y])[t],w=!!(c||n),j=d.useCallback(()=>l(!n),[n,l]),z=d.useCallback(()=>{a||g(E=>{const P=!E;return s&&s(P),P})},[a,g,s]);return r.jsx(i.Center,{role:"Toggle",padding:o==="pill"?"10px 12px":"8px",width:"fit-content",cursor:a?"not-allowed":"pointer",borderRadius:Hg[o],onClick:z,onMouseEnter:j,onMouseLeave:()=>l(!1),...C,...w&&{backgroundColor:I,color:y==="light"?"color-black":"color-white"},...p,...u==null?void 0:u.container,children:e})}),Lg=({children:e,shape:o,variant:t,isDisabled:n,isToggled:l=!1,onToggle:a,...c})=>{const g=se(c),{isHovered:s,setIsHovered:u,isToggle:h,setIsToggled:f}=En(g.value??l);d.useEffect(()=>{f(g.value??l)},[g.value,l]);const m=p=>{f(p),g.onChange(p),a==null||a(p)};return r.jsx(Pn,{shape:o,variant:t,isDisabled:n,isHovered:s,setIsHovered:u,isToggle:h,setIsToggled:f,onToggle:m,...c,children:e})},Wn=()=>{const[e,o]=d.useState([]);return{activeToggles:e,setActiveToggles:o}},_n=({children:e,shape:o,variant:t,isDisabled:n,isToggled:l=!1,onToggle:a,...c})=>{const{isHovered:g,setIsHovered:s,isToggle:u,setIsToggled:h}=En(l);return d.useEffect(()=>{h(l)},[l]),r.jsx(Pn,{shape:o,variant:t,isDisabled:n,isHovered:g,setIsHovered:s,isToggle:u,setIsToggled:h,onToggle:a,...c,children:e})},$n=({items:e,onToggleChange:o,activeToggles:t,setActiveToggles:n,shape:l="rounded",variant:a="ghost",views:c})=>{const g=d.useCallback((s,u)=>{n(h=>{let f;return u?f=h.includes(s)?h:[...h,s]:f=h.filter(m=>m!==s),o==null||o(f),f})},[o,n]);return r.jsx(i.Horizontal,{role:"ToggleGroup",display:"flex",gap:5,...c==null?void 0:c.container,children:e.map(s=>r.jsx(_n,{role:`toggle-${s.id}`,shape:l,variant:a,isToggled:t.includes(s.id)||s.isActive,onToggle:u=>g(s.id,u),isDisabled:s.isDisabled,views:c==null?void 0:c.toggle,children:s.value},s.id))})},Ag=({items:e,shape:o,variant:t,onToggleChange:n,...l})=>{const a=se(l),{activeToggles:c,setActiveToggles:g}=Wn();d.useEffect(()=>{Array.isArray(a.value)&&g(a.value)},[a.value]);const s=u=>{g(u),a.onChange(u),n==null||n(u)};return r.jsx($n,{items:e,shape:o,variant:t,activeToggles:c,setActiveToggles:g,onToggleChange:s,...l})},Hn=["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"],Bn=e=>{const{value:o,defaultValue:t,onChange:n,isOpen:l,onOpen:a,onClose:c,closeOnSelect:g=!0}=e,[s,u]=d.useState(l??!1),[h,f]=d.useState(o??t),[m,p]=d.useState(""),b=d.useRef(null),x=d.useRef(null);d.useEffect(()=>{o!==void 0&&f(o)},[o]),d.useEffect(()=>{l!==void 0&&u(l)},[l]);const y=d.useMemo(()=>m?Hn.filter(w=>w.toLowerCase().includes(m.toLowerCase())).slice(0,100):Hn.slice(0,100),[m]);d.useEffect(()=>{const w=j=>{s&&b.current&&x.current&&!b.current.contains(j.target)&&!x.current.contains(j.target)&&k()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[s]);const k=d.useCallback(()=>{l===void 0&&u(!1),c&&c()},[c,l]),I=d.useCallback(()=>{const w=!s;l===void 0&&u(w),w?(a&&a(),p("")):c&&c()},[s,a,c,l]),T=d.useCallback(w=>{o===void 0&&f(w),n&&n(w),g&&k()},[n,g,k,o]),C=d.useCallback(w=>{p(w)},[]);return{isOpen:s,selectedIcon:h,searchQuery:m,filteredIcons:y,handleToggle:I,handleIconSelect:T,handleSearchChange:C,handleClose:k,triggerRef:b,dropdownRef:x}},Xe={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"}},Dg={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"}},Fg={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Og={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"}},Ln=({label:e,placeholder:o="Select an icon",helperText:t,views:n={},size:l="md",shape:a="default",variant:c="default",error:g=!1,isDisabled:s=!1,isReadOnly:u=!1,showSearch:h=!0,isOpen:f,selectedIcon:m,searchQuery:p,filteredIcons:b,handleToggle:x,handleIconSelect:y,handleSearchChange:k,triggerRef:I,dropdownRef:T,handleClose:C,onChange:w,...j})=>{const{getColor:z}=i.useTheme(),E={...Xe.container,...n==null?void 0:n.container},P={...Xe.trigger,...Dg[l],...Fg[a],...Og[c],...g&&{borderColor:"color-red-500"},...s&&{opacity:.6,cursor:"not-allowed"},...n==null?void 0:n.trigger},H={...Xe.dropdown,...n==null?void 0:n.dropdown},S={...Xe.iconGrid,...n==null?void 0:n.iconGrid};return r.jsxs(i.View,{...E,...j,children:[e&&r.jsx(i.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...n==null?void 0:n.label,children:e}),r.jsxs(i.View,{ref:I,onClick:s||u?void 0:x,...P,children:[r.jsx(i.Horizontal,{alignItems:"center",gap:8,width:"100%",children:m?r.jsxs(i.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[r.jsx(To,{name:m,widthHeight:16}),r.jsx(i.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m})]}):r.jsx(i.Text,{color:"color-gray-500",fontSize:"inherit",children:o})}),!u&&!s&&r.jsx(le,{widthHeight:16,color:"color-gray-500",orientation:f?"up":"down"})]}),f&&r.jsxs(i.View,{ref:T,...H,children:[h&&r.jsx(i.View,{...Xe.searchInput,...n==null?void 0:n.searchInput,children:r.jsx(uo,{placeholder:"Search icons...",value:p,onChange:$=>k($),size:"sm",autoFocus:!0})}),r.jsx(i.View,{...S,children:b.length>0?b.map($=>r.jsx(i.View,{...Xe.iconItem,onClick:()=>y($),title:$,_hover:{backgroundColor:"color-gray-100"},backgroundColor:m===$?"color-blue-100":"transparent",...n==null?void 0:n.iconItem,children:r.jsx(To,{name:$,widthHeight:20})},$)):r.jsx(i.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(i.Text,{fontSize:"14px",children:"No icons found"})})})]}),t&&r.jsx(i.Text,{color:g?"color-red-500":"color-gray-600",marginTop:"4px",...n==null?void 0:n.helperText,children:t})]})},qg=e=>{const o=se(e),t={...e,value:o.value??e.value??e.defaultValue},n=Bn(t),l=a=>{n.handleIconSelect(a),o.onChange(a)};return r.jsx(Ln,{...n,...t,handleIconSelect:l})},Ve={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"}},Ng={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"}},Ug={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Gg={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"}},Yg={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},vg=[{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"]}],An=e=>{const{value:o,defaultValue:t="",onChange:n,onEmojiSelect:l,isOpen:a,onOpen:c,onClose:g,closeOnSelect:s=!0,maxRecentEmojis:u=16,showRecentEmojis:h=!0,enabledCategories:f=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:m=[]}=e,[p,b]=d.useState(a??!1),[x,y]=d.useState(o??t),[k,I]=d.useState(""),[T,C]=d.useState("smileys"),[w,j]=d.useState([]),z=d.useRef(null),E=d.useRef(null),P=d.useMemo(()=>[...vg,...m],[m]),H=d.useMemo(()=>{let W=P;if(T!=="recent"?W=W.filter(L=>L.category===T):W=w,k){const L=k.toLowerCase();W=W.filter(D=>D.name.toLowerCase().includes(L)||D.keywords.some(F=>F.toLowerCase().includes(L)))}return W},[P,T,w,k]);d.useEffect(()=>{o!==void 0&&y(o)},[o]),d.useEffect(()=>{a!==void 0&&b(a)},[a]),d.useEffect(()=>{if(h){const W=localStorage.getItem("emojiPicker-recentEmojis");if(W)try{j(JSON.parse(W))}catch{}}},[h]),d.useEffect(()=>{const W=L=>{p&&z.current&&E.current&&!z.current.contains(L.target)&&!E.current.contains(L.target)&&B()};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[p]);const S=d.useCallback(W=>{h&&j(L=>{const D=L.filter(q=>q.emoji!==W.emoji),F=[W,...D].slice(0,u);return localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(F)),F})},[h,u]),$=d.useCallback(()=>{const W=!p;b(W),W?(c==null||c(),I(""),h&&w.length>0?C("recent"):C("smileys")):g==null||g()},[p,c,g,h,w.length]),A=d.useCallback(W=>{y(W.emoji),S(W),n==null||n(W.emoji),l==null||l(W),s&&(b(!1),g==null||g())},[n,l,s,g,S]),_=d.useCallback(W=>{I(W),W&&T==="recent"&&C("smileys")},[T]),V=d.useCallback(W=>{C(W),I("")},[]),B=d.useCallback(()=>{b(!1),g==null||g()},[g]);return{isOpen:p,selectedEmoji:x,recentEmojis:w,searchQuery:k,activeCategory:T,filteredEmojis:H,handleToggle:$,handleEmojiSelect:A,handleSearchChange:_,handleCategoryChange:V,handleClose:B,triggerRef:z,dropdownRef:E}},Dn=({id:e,name:o,label:t,placeholder:n="Select an emoji",helperText:l,views:a={},size:c="md",shape:g="default",variant:s="default",error:u=!1,isDisabled:h=!1,isReadOnly:f=!1,showSearch:m=!0,showCategories:p=!0,showRecentEmojis:b=!0,enabledCategories:x=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:y,selectedEmoji:k,recentEmojis:I,searchQuery:T,activeCategory:C,filteredEmojis:w,handleToggle:j,handleEmojiSelect:z,handleSearchChange:E,handleCategoryChange:P,triggerRef:H,dropdownRef:S,onChange:$,...A})=>{const{getColor:_}=i.useTheme(),V={...Ve.container,...a==null?void 0:a.container},B={...Ve.trigger,...Ng[c],...Ug[g],...Gg[s],...u&&{borderColor:"color-red-500"},...h&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},W={...Ve.dropdown,...a==null?void 0:a.dropdown},L={...Ve.categoryTabs,...a==null?void 0:a.categoryTabs},D={...Ve.emojiGrid,...a==null?void 0:a.emojiGrid},F=x.filter(q=>q==="recent"?b&&I.length>0:!0);return r.jsxs(i.View,{...V,...A,children:[t&&r.jsx(i.Text,{fontSize:c==="xs"?"12px":c==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...a==null?void 0:a.label,children:t}),r.jsxs(i.View,{ref:H,onClick:h||f?void 0:j,...B,children:[r.jsx(i.Horizontal,{alignItems:"center",gap:8,children:r.jsx(i.Text,{color:k?"color-gray-800":"color-gray-500",fontSize:"inherit",children:k||n})}),!f&&!h&&r.jsx(le,{widthHeight:16,color:"color-gray-500",orientation:y?"up":"down"})]}),y&&r.jsxs(i.View,{ref:S,...W,children:[m&&r.jsx(i.View,{...Ve.searchInput,...a==null?void 0:a.searchInput,children:r.jsx(uo,{placeholder:"Search emojis...",value:T,onChange:q=>E(q.target.value),size:"sm"})}),p&&r.jsx(i.View,{...L,children:F.map(q=>r.jsx(i.View,{...Ve.categoryTab,...C===q&&{borderBottomColor:"color-blue-500",color:"color-blue-600"},onClick:()=>P(q),title:q.charAt(0).toUpperCase()+q.slice(1),...a==null?void 0:a.categoryTab,children:Yg[q]},q))}),r.jsx(i.View,{...D,children:w.length>0?w.map((q,O)=>r.jsx(i.View,{...Ve.emoji,onClick:()=>z(q),title:q.name,_hover:{backgroundColor:"color-gray-100"},color:"color-gray-800",...a==null?void 0:a.emoji,children:q.emoji},`${q.emoji}-${O}`)):r.jsx(i.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(i.Text,{fontSize:"14px",children:T?"No emojis found":"No emojis in this category"})})})]}),l&&r.jsx(i.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:l})]})},Xg=e=>{const o=se(e),t={...e,value:o.value??e.value??e.defaultValue},n=An(t),l=a=>{var c;n.handleEmojiSelect(a),o.onChange(a.emoji),(c=e.onEmojiSelect)==null||c.call(e,a)};return r.jsx(Dn,{...n,...t,handleEmojiSelect:l})},Kg=({files:e,onRemove:o,maxHeight:t="120px",views:n={}})=>{if(e.length===0)return null;const l=d.useCallback(a=>a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(1)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(i.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:t,overflowY:"auto",...n==null?void 0:n.container,children:e.map((a,c)=>{const g=a.url||"",s=a.type.startsWith("image/"),u=a.type.startsWith("video/"),h=a.type.startsWith("audio/");return r.jsx(i.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(be,{children:[r.jsx(be.Trigger,{children:r.jsxs(i.View,{position:"relative",children:[s&&g&&r.jsx(i.Image,{src:g,alt:a.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),u&&g&&r.jsx(i.View,{as:"video",src:g,alt:a.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),h&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(jo,{widthHeight:24,color:"color-black"})}),!s&&!u&&!h&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(to,{widthHeight:24,color:"color-black"})}),o&&r.jsx(i.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:f=>{f.stopPropagation(),o(c)},"aria-label":`Remove ${a.name}`,children:"×"})]})}),r.jsxs(be.Content,{children:[s&&g&&r.jsx(i.Image,{src:g,alt:a.name,maxWidth:"300px"}),u&&g&&r.jsx(i.View,{as:"video",src:g,controls:!0,maxWidth:"300px"}),h&&g&&r.jsx(i.View,{as:"audio",src:g,controls:!0,width:"100%"}),r.jsxs(i.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",fontSize:12,...n==null?void 0:n.name,children:[a.name," (",l(a.size),")"]})]})]})},c)})})},Qg=e=>{const o=In(e);return r.jsx(zn,{...e,...o})},Zg=({url:e,type:o,name:t,onOpen:n})=>{const l=o.toLowerCase(),a=l.startsWith("image"),c=l.startsWith("video"),g=l.startsWith("audio"),s=()=>{n&&n()};return r.jsxs(i.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(i.Image,{src:e,alt:t,width:"100%",height:"100%",objectFit:"cover"}),c&&r.jsx(i.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:u=>u.stopPropagation()}),g&&r.jsx(i.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:u=>u.stopPropagation()}),!a&&!c&&!g&&r.jsx(to,{widthHeight:24,color:"color-gray-600"})]})},Ee=tt.create(e=>({modals:[],onHide:o=>o,onShow:(o,t)=>({name:o,props:t}),show:(o,t={},n={})=>{e(l=>({...l,modals:[...l.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}))}})),Jg=(e,o={},t={})=>{Ee.getState().show(e,o,t),Ee.getState().onShow(e,o)},Wt=e=>{console.log("hideModal",e),Ee.getState().onHide(e),Ee.getState().hide(typeof e=="string"?e:void 0)},Rg={square:{borderRadius:0},rounded:{borderRadius:"8px"}},eu={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"}},ou={xs:12,sm:16,md:20,lg:24,xl:28},Yo={body:{fontSize:"16px",fontWeight:"400",lineHeight:"24px",color:"color-gray-700"}},Fn=d.memo(({children:e,blur:o,isOpen:t=!1,isClosePrevented:n=!1,onClose:l=()=>{},position:a="center",views:c,...g})=>{const s=d.useCallback(()=>{n||l()},[n,l]);return r.jsx(i.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:s,visibility:t?"visible":"hidden",transition:"all 0.3s ease",...c==null?void 0:c.container,children:r.jsx(i.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,...eu[a],...g,...c==null?void 0:c.view,children:e})})}),tu={boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"},ru={elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},nu=d.memo(({children:e,shadow:o,isFullScreen:t=!1,shape:n="rounded",views:l,isOpen:a,...c})=>{const g=typeof document!==void 0?tu:ru,s=d.useCallback(u=>{u&&u.stopPropagation&&u.stopPropagation()},[]);return r.jsx(i.Vertical,{cursor:"default",backgroundColor:"color-white",width:t?"100%":600,height:t?"100%":"fit-content",onClick:s,transition:"all 0.3s ease",...o||g,...Rg[n],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...c,...l==null?void 0:l.container,children:e})}),au=d.memo(({children:e,buttonColor:o="theme-primary",iconSize:t="md",buttonPosition:n="right",views:l,...a})=>{const c=a.onClose?a.onClose:Wt,g=r.jsx(i.View,{onClick:c,children:r.jsx(pe,{widthHeight:ou[t],color:o})});return r.jsxs(i.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,...l==null?void 0:l.header,children:[n==="left"&&g,e,n==="right"&&g]})}),lu=d.memo(({children:e,views:o,...t})=>r.jsx(i.View,{paddingVertical:16,paddingHorizontal:24,fontSize:Yo.body.fontSize,fontWeight:Yo.body.fontWeight,lineHeight:Yo.body.lineHeight,color:Yo.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...t,...o==null?void 0:o.view,children:e})),cu=d.memo(({children:e,views:o,...t})=>r.jsx(i.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})),iu=({modals:e,onShow:o,onHide:t})=>{const n=Ee(l=>l.modals);return o&&Ee.getState().setOnShow(o),t&&Ee.getState().setOnHide(t),n.length===0?null:r.jsx(d.Fragment,{children:n.map((l,a)=>{const c=e[l.name];return c?r.jsx(Fn,{isOpen:l.props.isVisible,onClose:()=>Wt(l.name),blur:5,...l.overlayProps,style:{zIndex:1e3+a},children:r.jsx(c,{...l.props})},a):(console.error(`${l.name} modal doesn't exist`),null)})})},Ae=({children:e})=>r.jsx(r.Fragment,{children:e});Ae.Overlay=Fn,Ae.Container=nu,Ae.Header=au,Ae.Body=lu,Ae.Footer=cu,Ae.Layout=iu;const On={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},su={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"}},qn=({isOpen:e,onClose:o,isClosePrevented:t,blur:n,children:l,...a})=>{const c=()=>{t||o()};return d.useEffect(()=>{const g=s=>{s.key==="Escape"&&e&&!t&&o()};return e&&document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[e,t,o]),r.jsx(i.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:c,transition:"all 0.3s ease",backgroundColor:e?"color-blackAlpha-500":"transparent",backdropFilter:n?`blur(${n}px)`:void 0,pointerEvents:e?"auto":"none",...a,children:l})},Nn=({placement:e="right",size:o="md",children:t,...n})=>{const l=g=>{g.stopPropagation()},c=e==="top"||e==="bottom"?{height:o==="full"?"100vh":On[o]||o,maxHeight:"100vh"}:{width:o==="full"?"100vw":On[o]||o,maxWidth:"100vw"};return r.jsx(i.Vertical,{position:"absolute",backgroundColor:"color-white",...su[e],...c,onClick:l,transition:"transform 0.3s ease",...n,children:t})},du=({children:e,onClose:o,buttonPosition:t="right",...n})=>{const l=o&&r.jsx(i.View,{onClick:o,cursor:"pointer",padding:8,children:r.jsx(pe,{widthHeight:20,color:"color-gray-500"})});return r.jsxs(i.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderBottomWidth:"1px",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:t==="none"?"center":"space-between",...n,children:[t==="left"&&l,e,t==="right"&&l]})},gu=({children:e,...o})=>r.jsx(i.Vertical,{padding:24,flex:1,overflowY:"auto",...o,children:e}),uu=({children:e,...o})=>r.jsx(i.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderTopWidth:"1px",borderTopColor:"color-gray-200",alignItems:"center",justifyContent:"flex-end",gap:12,...o,children:e}),Ke=({isOpen:e,onClose:o,placement:t="right",size:n="md",isClosePrevented:l,children:a,...c})=>{const g=e?{}:{transform:t==="left"||t==="right"?`translateX(${t==="left"?"-100%":"100%"})`:`translateY(${t==="top"?"-100%":"100%"})`};return r.jsx(qn,{isOpen:e,onClose:o,isClosePrevented:l,...c,children:r.jsx(Nn,{placement:t,size:n,style:g,children:a})})};Ke.Overlay=qn,Ke.Container=Nn,Ke.Header=du,Ke.Body=gu,Ke.Footer=uu;const hu=(e=null,o=[])=>{const[t,n]=d.useState(e),[l,a]=d.useState(o),c=d.useRef({});return{activeItemId:t,setActiveItemId:n,expandedItemIds:l,toggleExpandedItem:u=>{a(h=>h.includes(u)?h.filter(m=>m!==u):[...h,u])},isItemExpanded:u=>l.includes(u),triggerRefs:c}},_t={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"}}}},$t={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"}},Un={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},Qe={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"}},Gn=d.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),fu=({children:e,value:o})=>r.jsx(Gn.Provider,{value:o,children:e}),po=()=>{const e=d.useContext(Gn);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},Ht=({children:e,views:o})=>{const{orientation:t}=po(),n=t==="horizontal"?i.Horizontal:i.Vertical;return r.jsx(n,{width:"100%",...Un[t],transition:"all 0.2s ease",borderRadius:"4px",...o==null?void 0:o.container,children:e})},Yn=d.createContext({itemValue:null,isDisabled:!1}),mu=()=>{const e=d.useContext(Yn);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},Bt=({item:e,value:o,isDisabled:t=!1,children:n,views:l})=>{var k;const{activeItemId:a,setActiveItemId:c,orientation:g,size:s,variant:u,onItemActivate:h}=po(),f=(e==null?void 0:e.id)||o,m=a===f,p=(e==null?void 0:e.items)&&e.items.length>0,b=(e==null?void 0:e.disabled)||t,x=()=>{b||f&&(c(f),h&&h(f))},y=g==="horizontal"?i.Horizontal:i.Vertical;return n?r.jsx(Yn.Provider,{value:{itemValue:f||null,isDisabled:b},children:r.jsx(i.View,{width:"100%",cursor:b?"not-allowed":"pointer",opacity:b?.6:1,borderRadius:"4px",transition:"all 0.2s ease",..._t[s],...$t[u],...m?Qe.active:{},_hover:b?{}:Qe.hover,...l==null?void 0:l.item,children:n})}):p&&e?r.jsxs(y,{width:"100%",flexDirection:"column",position:"relative",...l==null?void 0:l.item,children:[r.jsxs(vn,{itemId:e.id,disabled:e.disabled,views:l,children:[e.icon&&r.jsx(i.View,{marginRight:8,...l==null?void 0:l.icon,children:e.icon}),e.label]}),r.jsx(Xn,{itemId:e.id,children:r.jsx(Ht,{children:(k=e.items)==null?void 0:k.map(I=>r.jsx(Bt,{item:I},I.id))})})]}):e?r.jsxs(i.View,{as:e.href?"a":"div",to:e.href,onClick:x,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",..._t[s],...$t[u],...m?Qe.active:{},_hover:e.disabled?{}:Qe.hover,...l==null?void 0:l.item,children:[e.icon&&r.jsx(i.View,{marginRight:8,...l==null?void 0:l.icon,children:e.icon}),e.label]}):null},vn=({children:e,itemId:o,disabled:t,views:n})=>{const{activeItemId:l,toggleExpandedItem:a,isItemExpanded:c,size:g,variant:s,triggerRefs:u}=po(),h=d.useRef(null),f=l===o,m=c(o);d.useEffect(()=>(h.current&&o&&(u.current[o]=h.current),()=>{o&&delete u.current[o]}),[o,u]);const p=b=>{b.preventDefault(),!t&&a(o)};return r.jsxs(i.View,{ref:h,onClick:p,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",..._t[g],...$t[s],...f?Qe.active:{},_hover:t?{}:Qe.hover,...n==null?void 0:n.trigger,children:[r.jsx(i.View,{display:"flex",alignItems:"center",children:e}),r.jsx(i.View,{transition:"transform 0.2s ease",transform:m?"rotate(180deg)":"rotate(0deg)",...n==null?void 0:n.indicator,children:r.jsx(le,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},Xn=({children:e,itemId:o,views:t})=>{const{isItemExpanded:n,orientation:l,triggerRefs:a}=po(),c=d.useRef(null),[g,s]=d.useState({x:0,y:0,placement:l==="horizontal"?"bottom":"right"}),u=n(o);if(d.useEffect(()=>{if(u&&c.current&&o&&a.current[o]&&l==="horizontal"){const f=c.current.getBoundingClientRect(),m=a.current[o].getBoundingClientRect(),p=Math.max(f.width||200,200),b=Math.max(f.height||150,150),x=window.innerWidth,y=window.innerHeight,k={top:m.top,right:x-m.right,bottom:y-m.bottom,left:m.left},I=l==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=b+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=b+8,x:m.left,y:m.top-b-8},{placement:"right",space:k.right,fits:k.right>=p+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=p+8,x:m.left-p-8,y:m.top}]:[{placement:"right",space:k.right,fits:k.right>=p+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=p+8,x:m.left-p-8,y:m.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=b+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=b+8,x:m.left,y:m.top-b-8}],T=I.find(z=>z.fits);if(T){s({x:T.x,y:T.y,placement:T.placement});return}const C=I.reduce((z,E)=>E.space>z.space?E:z);let w=C.x,j=C.y;w+p>x&&(w=x-p-8),w<8&&(w=8),j+b>y&&(j=y-b-8),j<8&&(j=8),s({x:w,y:j,placement:C.placement})}},[u,l,o,a]),!u)return null;if(l==="vertical")return r.jsx(i.View,{paddingLeft:16,width:"100%",position:"relative",backgroundColor:"transparent",...t==null?void 0:t.container,children:e});const h={position:"fixed",left:g.x,top:g.y,zIndex:1e3};return r.jsx(i.View,{ref:c,role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:h,...t==null?void 0:t.container,children:e})},pu=({href:e,children:o,views:t,...n})=>{const{itemValue:l,isDisabled:a}=mu(),{activeItemId:c,setActiveItemId:g,onItemActivate:s}=po(),u=c===l,h=f=>{if(a){f.preventDefault();return}l&&(g(l),s&&s(l)),n.onClick&&n.onClick(f)};return r.jsx(i.View,{as:"a",href:a?void 0:e,onClick:h,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":u?"page":void 0,"aria-disabled":a,"data-active":u?"":void 0,"data-disabled":a?"":void 0,...u?{fontWeight:"bold"}:{},...t==null?void 0:t.container,...n,children:o})},bu=({items:e,orientation:o,views:t,themeMode:n})=>{const l=o==="horizontal"?i.Horizontal:i.Vertical;return!e||e.length===0?null:r.jsx(l,{width:"100%",...Un[o],...t==null?void 0:t.container,children:r.jsx(Ht,{views:t,children:e.map(a=>r.jsx(Bt,{item:a,views:t},a.id))})})},Ze=({items:e,children:o,orientation:t="vertical",size:n="md",variant:l="default",defaultActiveItemId:a=null,defaultExpandedItemIds:c=[],onItemActivate:g,views:s,...u})=>{const{activeItemId:h,setActiveItemId:f,expandedItemIds:m,toggleExpandedItem:p,isItemExpanded:b,triggerRefs:x}=hu(a,c);return r.jsx(fu,{value:{activeItemId:h,setActiveItemId:f,expandedItemIds:m,toggleExpandedItem:p,isItemExpanded:b,orientation:t,size:n,variant:l,onItemActivate:g,triggerRefs:x},children:e?r.jsx(bu,{items:e,orientation:t,size:n,variant:l,views:s,...u}):o})};Ze.List=Ht,Ze.Item=Bt,Ze.Trigger=vn,Ze.Content=Xn,Ze.Link=pu;const Kn={},Qn=d.createContext({views:Kn,onRowClick:()=>{}}),yu=({children:e,views:o=Kn,onRowClick:t})=>r.jsx(Qn.Provider,{value:{views:o,onRowClick:t},children:e}),Pe=()=>d.useContext(Qn),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 Zn=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"table",borderCollapse:"collapse",...de.table,...o==null?void 0:o.table,...e})},Jn=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"thead",textAlign:"left",...de.thead,...o==null?void 0:o.thead,...e})},Rn=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"th",whiteSpace:"nowrap",...de.th,...o==null?void 0:o.th,...e})},vo=e=>{const{views:o,onRowClick:t}=Pe();return r.jsx(i.Element,{as:"tr",...de.tr,...o==null?void 0:o.tr,onClick:t,...e})},Lt=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e.isFirstColumn?"500":"400",...de.td,...o==null?void 0:o.td,...e})},ea=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"tbody",...de.tbody,...o==null?void 0:o.tbody,...e})},oa=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"tfoot",...de.tfoot,...o==null?void 0:o.tfoot,...e})},ta=e=>{const{views:o}=Pe();return r.jsx(i.Element,{as:"caption",...de.caption,...o==null?void 0:o.caption,...e})},xu=({data:e,columns:o,footer:t,caption:n,themeMode:l})=>r.jsxs(Zn,{role:"Table",children:[n&&r.jsx(ta,{children:n}),r.jsx(Jn,{children:r.jsx(vo,{children:o.map(a=>r.jsx(Rn,{children:a.title},a.field))})}),r.jsx(ea,{children:e.map((a,c)=>r.jsx(vo,{children:o.map((g,s)=>r.jsx(Lt,{isFirstColumn:s===0,children:a[g.field]},g.field))},c))}),t&&r.jsx(oa,{children:r.jsx(vo,{children:t.map((a,c)=>r.jsx(Lt,{...a.props,children:a.value},c))})})]}),we=({children:e,views:o,onClick:t})=>r.jsx(yu,{views:o,onRowClick:t,children:e});we.Head=Jn,we.HeadCell=Rn,we.Body=ea,we.Row=vo,we.Cell=Lt,we.Footer=oa,we.Caption=ta,we.Container=Zn,we.Template=xu;const ku=(e,o,t)=>{const n=u=>u.value!==void 0?u.value:u.title,l=()=>{if(!(!e||e.length===0)){if(o!==void 0){const u=e.find(h=>n(h)===o);if(u)return u}return e[0]}},[a,c]=d.useState(l()),g=t!==void 0?e.find(u=>n(u)===t):a,s=u=>{t===void 0&&c(u)};return d.useEffect(()=>{if(t!==void 0)return;const u=l(),h=a&&e.some(f=>n(f)===n(a));u&&(!h||o!==void 0&&a&&n(a)!==o)?c(u):!u&&a&&c(void 0)},[e,o]),{activeTab:g,setActiveTab:s}},Cu=(e,o,t)=>{const[n,l]=d.useState(e||null);return{activeValue:o!==void 0?o:n,setActiveValue:g=>{o===void 0&&l(g),t&&t(g)}}},wu=d.memo(({tab:e,isActive:o,onClick:t,iconPosition:n="left",tabStyles:l,textStyles:a})=>{const c=d.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]),g=()=>{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",u=e.icon&&d.isValidElement(e.icon)?d.cloneElement(e.icon,{strokeWidth:o?2.5:2}):e.icon;return r.jsxs(i.Element,{as:"div",role:"tab","aria-selected":o,tabIndex:o?0:-1,...c,...l,flexDirection:g(),gap:s(),onClick:t,"data-state":o?"active":"inactive",children:[u&&r.jsx(i.Element,{children:u},o?"active-icon":"inactive-icon"),r.jsxs(i.Element,{display:"grid",alignItems:"center",justifyContent:"center",children:[r.jsx(i.Text,{...a,fontWeight:"600",visibility:"hidden",gridColumn:"1",gridRow:"1","aria-hidden":"true",children:e.title}),r.jsx(i.Text,{...a,fontWeight:o?"600":"500",gridColumn:"1",gridRow:"1",children:e.title})]})]})}),Iu=({tabs:e=[],activeTab:o,handleTabClick:t,views:n={},renderTab:l,renderContent:a,iconPosition:c="left"})=>o?r.jsxs(i.Vertical,{width:"100%",height:"100%",...n.container,children:[r.jsx(i.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...n.headerTabs,children:e.map(g=>{const s=(g.value!==void 0?g.value:g.title)===(o.value!==void 0?o.value:o.title),u=()=>t(g);return l?l(g,s,u):r.jsx(wu,{tab:g,isActive:s,onClick:u,iconPosition:c,tabStyles:{...n.tab,...s?n.activeTab:{}},textStyles:{...n.title,...s?n.activeText:{}}},g.title)})}),r.jsx(i.View,{width:"100%",height:"100%",...n.content,children:a?a(o):o.content})]}):null,ra=d.createContext(null),na=()=>{const e=d.useContext(ra);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},Tu=d.memo(({children:e,views:o})=>r.jsx(i.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...o==null?void 0:o.container,children:e})),ju=d.memo(({value:e,children:o,disabled:t=!1,views:n})=>{const{activeValue:l,setActiveValue:a}=na(),c=l===e,g=d.useCallback(()=>{t||a(e)},[t,e,a]);return r.jsx(i.View,{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,padding:"12px 16px",borderBottom:"2px solid",borderBottomColor:c?"theme-primary":"transparent",color:c?"theme-primary":"color-gray-600",fontWeight:c?"600":"400",transition:"all 0.2s ease",_hover:t?{}:{color:"theme-primary"},onClick:g,...n==null?void 0:n.trigger,...c?n==null?void 0:n.activeState:{},children:o})}),Su=d.memo(({value:e,children:o,views:t})=>{const{activeValue:n}=na();return n!==e?null:r.jsx(i.View,{width:"100%",padding:"24px",...t==null?void 0:t.content,children:o})}),Mu=({tabs:e,views:o,defaultValue:t,onTabChange:n,renderTab:l,renderContent:a,iconPosition:c="left",value:g,onValueChange:s,children:u})=>{const h=Cu(t,g,s),f=ku(e||[],t,g);if(u)return r.jsx(ra.Provider,{value:h,children:u});if(e){const m=p=>{const b=x=>x.value!==void 0?x.value:x.title;(!f.activeTab||b(f.activeTab)!==b(p))&&(f.setActiveTab(p),n&&n(p))};return r.jsx(Iu,{tabs:e,views:o,activeTab:f.activeTab,handleTabClick:m,renderTab:l,renderContent:a,iconPosition:c})}return null},Xo=d.memo(Mu);Xo.List=Tu,Xo.Trigger=ju,Xo.Content=Su;const zu=e=>{const{children:o,_isInView:t=!1,alternateHighlightText:n=[],alternateAnimation:l=!1,alternateDuration:a=3e3,highlightText:c,highlightTypewriter:g=!1,highlightSlide:s=!1,highlightSlideDuration:u=500,highlightSlideStagger:h=50,highlightSlideSequential:f=!0}=e,[m,p]=d.useState(o),[b,x]=d.useState(c);return d.useEffect(()=>{if(!l||n.length===0||!t||typeof o!="string"||typeof c!="string")return p(o),x(c),()=>{};const y=o,k=c;let I=0;const T=w=>{const j=n[w],z=k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),E=new RegExp(z,"gi"),P=y.replace(E,j);p(P),x(j)};T(I);const C=setInterval(()=>{I=(I+1)%n.length,T(I)},a);return()=>clearInterval(C)},[l,n,a,c,o,t]),{finalDisplayedText:m,activeHighlightTarget:b,highlightTypewriter:g,highlightSlide:s,highlightSlideDuration:u,highlightSlideStagger:h,highlightSlideSequential:f}},Vu={xs:24,sm:36,md:48,lg:64,xl:72},Eu={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:()=>({})},Pu=({text:e,typingSpeed:o=50,pauseTime:t=500,onComplete:n,showCursor:l=!0,cursorColor:a="currentColor",textStyle:c,textComponent:g,as:s,...u})=>{const h=g||i.Text,f=Array.isArray(e)?e:[e],[m,p]=d.useState(f.map(()=>"")),[b,x]=d.useState(!1),[y,k]=d.useState(0),[I,T]=d.useState(0);d.useEffect(()=>{p(f.map(()=>"")),x(!1),k(0),T(0)},[e]),d.useEffect(()=>{if(b){n&&n();return}const w=f[y];if(I>=w.length){if(y>=f.length-1){x(!0);return}const z=setTimeout(()=>{k(E=>E+1),T(0)},t);return()=>clearTimeout(z)}const j=setTimeout(()=>{p(z=>{const E=[...z];return E[y]=w.substring(0,I+1),E}),T(z=>z+1)},o);return()=>clearTimeout(j)},[f,y,I,b,n,t,o]);const C=w=>{if(!w||typeof w!="string")return w;const j=w.split("|");return j.length===1?w:j.map((z,E)=>r.jsxs(d.Fragment,{children:[z,E<j.length-1&&r.jsx("br",{})]},E))};return r.jsx(r.Fragment,{children:m.map((w,j)=>r.jsxs(d.Fragment,{children:[C(w),l&&j===y&&!b&&r.jsx(h,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:a,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...c})]},j))})},Wu=({text:e,duration:o=500,direction:t="up",stagger:n=50,sequential:l=!1,textStyle:a,as:c,wordProps:g,textComponent:s,...u})=>{const[h,f]=d.useState(e),[m,p]=d.useState("entering"),[b,x]=d.useState(0),y=s||i.Text,k=d.useRef(null),I=d.useRef(null);d.useEffect(()=>{e===h&&m==="visible"||e!==h&&(m==="entering"||m==="visible"?(k.current=e,p("exiting")):m==="exiting"&&(k.current=e))},[e,h,m]);const{lines:T,totalWordCount:C}=d.useMemo(()=>{const B=h.split("|").map(L=>L.trim().split(/\s+/).filter(D=>D.length>0)),W=B.reduce((L,D)=>L+D.length,0);return{lines:B,totalWordCount:W}},[h]),w=d.useMemo(()=>l?C*(o+n):(C-1)*n+o,[C,o,n,l]),j=d.useMemo(()=>l?C*(o+n):(C-1)*n+o,[C,o,n,l]);d.useEffect(()=>(I.current&&clearTimeout(I.current),m==="entering"?I.current=setTimeout(()=>{p("visible")},w+50):m==="exiting"&&(I.current=setTimeout(()=>{k.current!==null&&(f(k.current),k.current=null),x(V=>V+1),p("entering")},j+50)),()=>{I.current&&clearTimeout(I.current)}),[m,w,j]);const{style:z,...E}=g||{},P=t==="up",H=V=>l?V*(o+n):V*n,S=d.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",lineHeight:"normal",...a}),[a]),$=d.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),A=d.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let _=0;return r.jsx(i.Element,{as:"span",style:S,...u,children:r.jsx("span",{style:$,children:T.map((V,B)=>r.jsx("span",{style:A,children:V.map((W,L)=>{const D=_++,F=H(D),q=L===V.length-1;let O;const U=`${o}ms`,Z=`${F}ms`;m==="entering"?O=P?i.Animation.slideInUp({duration:U,delay:Z,timingFunction:"ease-out",fillMode:"both"}):i.Animation.slideInDown({duration:U,delay:Z,timingFunction:"ease-out",fillMode:"both"}):m==="exiting"&&(O=P?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:U,delay:Z,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:U,delay:Z,timingFunction:"ease-in",fillMode:"both"});const X={...z,display:"inline-block",marginRight:q?0:"0.25em",transform:m==="visible"?"translateY(0)":void 0,opacity:m==="visible"?1:void 0};return r.jsx(y,{as:"span",animate:O,...E,...X,children:W},`${b}-${B}-${L}`)})},`line-${B}`))})})};function aa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const At=e=>{if(!e||typeof e!="string")return e;const o=e.split("|");return o.length===1?e:o.map((t,n)=>r.jsxs(d.Fragment,{children:[t,n<o.length-1&&r.jsx("br",{})]},n))},_u=({children:e,highlightText:o,highlightStyle:t="solid",highlightColor:n="theme-primary",highlightSecondaryColor:l,size:a="lg",views:c,highlightAnimate:g,animate:s,animationLoop:u=1,highlightAnimationLoop:h=1,highlightTypewriter:f=!1,highlightTypewriterDuration:m=3e3,highlightSlide:p=!1,highlightSlideDuration:b=500,highlightSlideStagger:x=50,highlightSlideSequential:y=!0,themeMode:k,responsive:I,alternateHighlightText:T,alternateAnimation:C,alternateDuration:w,_isInView:j,...z})=>{const{ref:E,inView:P}=i.useInView(),{finalDisplayedText:H,activeHighlightTarget:S,highlightTypewriter:$,highlightSlide:A,highlightSlideDuration:_,highlightSlideStagger:V,highlightSlideSequential:B}=zu({children:e,highlightText:o,_isInView:P,highlightTypewriter:f,highlightSlide:p,highlightSlideDuration:b,highlightSlideStagger:x,highlightSlideSequential:y,alternateHighlightText:T,alternateAnimation:C,alternateDuration:w,...z}),W=Vu[a],L=Eu[t](n,l),D=(X,N)=>X&&(Array.isArray(X)?X.map(Q=>({...Q,iterationCount:N.toString()})):{...X,iterationCount:N.toString()}),F=D(s,u),q=D(g,h),O=typeof H=="string"?H:typeof e=="string"?e:"",U={ref:E,animate:P?F:void 0,as:"h1",fontSize:W},Z=X=>!P&&($||A)?r.jsx("span",{style:{opacity:0},children:X}):$?r.jsx(Pu,{text:X,typingSpeed:Math.max(30,m/(X.length*10)),cursorColor:"currentColor",...L}):A?r.jsx(Wu,{text:X,duration:_,stagger:V,sequential:B,direction:"up",fontSize:W,wordProps:L}):At(X);if(typeof O=="string"&&S){const X=Array.isArray(S)?new RegExp(`(${S.map(ee=>aa(String(ee))).join("|")})`,"gi"):new RegExp(`(${aa(String(S))})`,"gi"),N=[];let Q=0,R;for(;R=X.exec(O);)R.index>Q&&N.push(O.substring(Q,R.index)),N.push({highlight:!0,text:R[0]}),Q=R.index+R[0].length;return Q<O.length&&N.push(O.substring(Q)),r.jsx(i.Element,{...U,...c==null?void 0:c.container,...z,children:N.map((ee,re)=>typeof ee=="string"?r.jsx(i.Text,{as:"span",display:"inline",...c==null?void 0:c.text,children:At(ee)},`text-${re}`):r.jsx(i.Text,{as:"span",display:"inline",animate:P?q:void 0,...A?{}:L,...c==null?void 0:c.highlight,children:Z(ee.text)},`highlight-${re}`))})}return t&&!S?r.jsx(i.Element,{...U,...z,...c==null?void 0:c.container,children:r.jsx(i.Text,{as:"span",display:"inline",animate:P?q:void 0,...A?{}:L,...c==null?void 0:c.highlight,children:Z(O)})}):r.jsx(i.Text,{...U,...z,...c==null?void 0:c.container,...c==null?void 0:c.text,children:At(O)})},$u=e=>r.jsx(_u,{...e}),Hu=({items:e,shape:o,variant:t,onToggleChange:n})=>{const{activeToggles:l,setActiveToggles:a}=Wn();return r.jsx($n,{items:e,shape:o,variant:t,activeToggles:l,setActiveToggles:a,onToggleChange:n})},Bu=({items:e,onChange:o})=>{const[t,n]=d.useState(e),[l,a]=d.useState(null),[c,g]=d.useState(null),s=d.useRef({x:0,y:0}),u=d.useRef([]),h=d.useCallback((p,b)=>{p.preventDefault(),document.body.style.cursor="grabbing";const x="touches"in p?p.touches[0].clientX:p.clientX,y="touches"in p?p.touches[0].clientY:p.clientY;s.current={x,y},g(b),a(t[b])},[t]),f=d.useCallback(p=>{if(c===null)return;const b="touches"in p?p.touches[0].clientX:p.clientX,x="touches"in p?p.touches[0].clientY:p.clientY,y=u.current[c];if(!y)return;const k=b-s.current.x,I=x-s.current.y;y.style.transform=`translate(${k}px, ${I}px)`,y.style.zIndex="1000";const T=u.current.findIndex((C,w)=>{if(!C||w===c)return!1;const j=C.getBoundingClientRect();return x>=j.top&&x<=j.bottom});if(T!==-1&&T!==c){const C=[...t],[w]=C.splice(c,1);C.splice(T,0,w),n(C),g(T),o==null||o(C),s.current={x:b,y:x}}},[c,t,o]),m=d.useCallback(()=>{document.body.style.cursor="",u.current.forEach(p=>{p&&(p.style.transform="",p.style.zIndex="")}),g(null),a(null)},[c]);return d.useEffect(()=>(c!==null&&(window.addEventListener("mousemove",f),window.addEventListener("touchmove",f),window.addEventListener("mouseup",m),window.addEventListener("touchend",m)),()=>{window.removeEventListener("mousemove",f),window.removeEventListener("touchmove",f),window.removeEventListener("mouseup",m),window.removeEventListener("touchend",m)}),[c,f,m]),{items:t,draggedItem:l,draggedIndex:c,itemRefs:u,handleDragStart:h}},Lu=({items:e,renderItem:o,containerProps:t,itemProps:n,draggedIndex:l,itemRefs:a,handleDragStart:c,views:g,themeMode:s})=>r.jsx(i.View,{overflow:"hidden",position:"relative",...t,...g==null?void 0:g.container,children:e.map((u,h)=>r.jsx(i.View,{ref:f=>a.current[h]=f,onMouseDown:f=>c(f,h),onTouchStart:f=>c(f,h),position:"relative",cursor:"grab",transition:"transform 0.2s",...n,...g==null?void 0:g.item,children:o?o(u,h):u},h))}),la=e=>{const{items:o,draggedIndex:t,itemRefs:n,handleDragStart:l}=Bu(e);return r.jsx(Lu,{...e,items:o,draggedIndex:t,itemRefs:n,handleDragStart:l})},Au=la,Du=({onFileSelect:e,onMultipleFileSelect:o,validateFile:t,accept:n,multiple:l,disabled:a,previewUrl:c})=>{const[g,s]=d.useState(!1),[u,h]=d.useState(null),f=d.useRef(null),m=c!==void 0?c:u;d.useEffect(()=>()=>{u&&URL.revokeObjectURL(u)},[u]);const p=d.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!a&&s(!0)},[a]),b=d.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!a&&s(!1)},[a]),x=d.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!a&&s(!0)},[a]),y=d.useCallback(C=>{if(!C||C.length===0)return;const w=Array.from(C);if(!l&&w.length>0){const j=w[0];if(j.type.startsWith("image/")){const z=URL.createObjectURL(j);h(E=>(E&&URL.revokeObjectURL(E),z))}else h(null)}l?o&&o(w):w.length>0&&e&&e(w[0])},[l,o,e]),k=d.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!1),!a&&C.dataTransfer.files&&C.dataTransfer.files.length>0&&(y(C.dataTransfer.files),C.dataTransfer.clearData())},[a,y]),I=d.useCallback(()=>{var C;a||(C=f.current)==null||C.click()},[a]),T=d.useCallback(C=>{y(C.target.files),C.target.value&&(C.target.value="")},[y]);return{isDragActive:g,handleDragEnter:p,handleDragLeave:b,handleDragOver:x,handleDrop:k,handleClick:I,handleFileChange:T,inputRef:f,preview:m}},Fu={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)"}},ca=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:l="120px",showPreviews:a=!1,views:c={}})=>{if(e.length===0)return null;const g=d.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(i.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:l,overflowY:"auto",...c==null?void 0:c.container,children:e.map((s,u)=>{const h=URL.createObjectURL(s)||(s==null?void 0:s.path)||(s==null?void 0:s.url)||"",f=s.type.startsWith("image/"),m=s.type.startsWith("video/"),p=s.type.startsWith("audio/");return r.jsx(i.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,...c==null?void 0:c.item,children:a&&r.jsxs(be,{children:[r.jsxs(be.Trigger,{children:[f&&r.jsx(i.Image,{src:h,alt:s.name,width:"60px",height:"60px",objectFit:"cover"}),m&&r.jsx(i.View,{as:"video",src:h,alt:s.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),p&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(jo,{widthHeight:24,color:"color-black"})}),!f&&!m&&!p&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(to,{widthHeight:24,color:"color-black"})}),t&&r.jsx(i.Button,{...Fu,onClick:b=>{b.stopPropagation(),t(u)},"aria-label":`Remove ${s.name}`,children:"×"})]}),r.jsxs(be.Content,{children:[f&&r.jsx(i.Image,{src:h,alt:s.name,maxWidth:"100%"}),m&&r.jsx(i.View,{as:"video",src:h,controls:!0,maxWidth:"100%"}),p&&r.jsx(i.View,{as:"audio",src:h,controls:!0,width:"100%"}),r.jsxs(i.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...c==null?void 0:c.name,children:[s.name," (",g(s.size),")"]})]})]})},u)})})},Ou=({children:e,text:o="Drop files here or click to upload",textProps:t,containerProps:n,disabled:l,accept:a,multiple:c,isDragActive:g,handleDragEnter:s,handleDragLeave:u,handleDragOver:h,handleDrop:f,handleClick:m,handleFileChange:p,inputRef:b,preview:x,imageProps:y,selectedFiles:k,onRemove:I})=>r.jsxs(i.Center,{width:"100%",minHeight:"200px",height:k&&k.length>0?"auto":"200px",borderWidth:2,borderStyle:"dashed",borderColor:g?"primary":"rgba(0,0,0,0.1)",borderRadius:12,backgroundColor:g?"rgba(0,0,0,0.02)":"transparent",flexDirection:"column",cursor:l?"not-allowed":"pointer",opacity:l?.6:1,onClick:m,onDragEnter:s,onDragLeave:u,onDragOver:h,onDrop:f,transition:"all 0.2s ease-in-out",overflow:"hidden",position:"relative",padding:16,...n,children:[r.jsx("input",{type:"file",ref:b,onChange:p,accept:a,multiple:c,style:{display:"none"},disabled:l}),x&&!c?r.jsxs(i.View,{width:"100%",height:"200px",position:"relative",children:[r.jsx(i.Image,{src:x,alt:"Preview",width:"100%",height:"100%",objectFit:"contain",...y}),r.jsx(i.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(i.Text,{color:"white",fontWeight:600,children:"Click to replace"})})]}):r.jsxs(i.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[e||r.jsxs(i.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[r.jsx(ht,{widthHeight:40,color:g?"primary":"rgba(0,0,0,0.4)"}),r.jsx(i.Text,{marginTop:16,color:g?"primary":"rgba(0,0,0,0.6)",fontWeight:500,textAlign:"center",...t,children:o})]}),c&&k&&k.length>0&&r.jsx(i.View,{marginTop:16,width:"100%",children:r.jsx(ca,{files:k,onRemove:I||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),qu=e=>{const o=Du(e);return r.jsx(Ou,{...e,...o})},Nu=(e=!1)=>{const[o,t]=d.useState(e),[n,l]=d.useState(null);return d.useEffect(()=>{const a=s=>{!s.composedPath().some(f=>(f==null?void 0:f.id)==="dropdown-menu"||(f==null?void 0:f.id)==="dropdown-trigger")&&o&&(t(!1),l(null))},c=()=>{o&&(t(!1),l(null))},g=s=>{s.key==="Escape"&&o&&(t(!1),l(null))};return document.addEventListener("mousedown",a),window.addEventListener("resize",c),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",a),window.removeEventListener("resize",c),document.removeEventListener("keydown",g)}},[o]),{isOpen:o,setIsOpen:t,activeSubmenuId:n,setActiveSubmenuId:l}},Uu={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Gu={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"}},Yu={hover:{backgroundColor:"color-gray-100"}},ia=d.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),vu=({children:e,value:o})=>r.jsx(ia.Provider,{value:o,children:e}),Dt=()=>{const e=d.useContext(ia);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},sa=({children:e,views:o,...t})=>{const{isOpen:n,setIsOpen:l,triggerRef:a}=Dt(),c=g=>{g.stopPropagation(),l(!n)};return r.jsx(i.View,{ref:a,id:"dropdown-trigger",onClick:c,cursor:"pointer",position:"relative",display:"inline-block",...o==null?void 0:o.container,...t,children:e})},Ft=({items:e,side:o="bottom",align:t="start",views:n,...l})=>{const{isOpen:a,variant:c,triggerRef:g}=Dt(),s=d.useRef(null),{ref:u,relation:h}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[f,m]=d.useState({x:0,y:0,placement:o});if(d.useEffect(()=>{g.current&&u&&(u.current=g.current)},[g,u,a]),d.useEffect(()=>{if(a&&s.current&&g.current){const x=g.current.getBoundingClientRect();let y=o;h&&(o==="bottom"&&h.space.vertical==="top"?y="top":o==="top"&&h.space.vertical==="bottom"?y="bottom":o==="right"&&h.space.horizontal==="left"?y="left":o==="left"&&h.space.horizontal==="right"&&(y="right"));let k=0,I=0;switch(y){case"bottom":k=t==="start"?x.left:t==="end"?x.right-180:x.left+x.width/2-90,I=x.bottom+8;break;case"top":k=t==="start"?x.left:t==="end"?x.right-180:x.left+x.width/2-90,I=x.top-8;break;case"right":k=x.right+8,I=t==="start"?x.top:t==="end"?x.bottom-100:x.top+x.height/2-50;break;case"left":k=x.left-8,I=t==="start"?x.top:t==="end"?x.bottom-100:x.top+x.height/2-50;break}m({x:k,y:I,placement:y})}},[a,o,t,g,h]),!a)return null;const b=(()=>{const x={position:"fixed",left:f.x,top:f.y,zIndex:1e3};switch(f.placement){case"top":return{...x,transform:"translateY(-100%)"};case"left":return{...x,transform:"translateX(-100%)"};case"bottom":case"right":default:return x}})();return r.jsx(i.View,{ref:s,id:"dropdown-menu",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:b,...Gu[c],...n==null?void 0:n.menu,...l,children:e.map((x,y)=>x.divider?r.jsx(ga,{views:n},`divider-${y}`):r.jsx(da,{item:x,views:n},x.id))})},da=({item:e,views:o,...t})=>{const{activeSubmenuId:n,setActiveSubmenuId:l,size:a}=Dt(),[c,g]=d.useState(!1),s=e.items&&e.items.length>0,u=n===e.id,h=d.useRef(null),f=()=>{g(!0),s&&l(e.id)},m=()=>{g(!1)},p=b=>{b.stopPropagation(),!e.disabled&&!s&&e.onClick&&e.onClick()};return r.jsxs(i.View,{ref:h,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...Uu[a],_hover:e.disabled?{}:Yu.hover,backgroundColor:c&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:f,onMouseLeave:m,onClick:p,...o==null?void 0:o.item,...t,children:[e.icon&&r.jsx(i.View,{marginRight:8,...o==null?void 0:o.icon,children:e.icon}),r.jsx(i.View,{flexGrow:1,children:e.label}),s&&r.jsx(i.View,{marginLeft:8,...o==null?void 0:o.submenuIndicator,children:r.jsx(le,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),u&&s&&r.jsx(Ft,{items:e.items||[],side:"right",align:"start",views:o})]})},ga=({views:e,...o})=>r.jsx(i.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...o}),Xu=({trigger:e,items:o,side:t="bottom",align:n="start",views:l,themeMode:a,...c})=>r.jsxs(i.View,{position:"relative",display:"inline-block",...l==null?void 0:l.container,...c,children:[r.jsx(sa,{views:l,children:e}),r.jsx(Ft,{items:o,side:t,align:n,views:l})]}),bo=({trigger:e,items:o,size:t="md",variant:n="default",side:l="bottom",align:a="start",defaultOpen:c=!1,views:g,...s})=>{const{isOpen:u,setIsOpen:h,activeSubmenuId:f,setActiveSubmenuId:m}=Nu(c),p=d.useRef(null);return r.jsx(vu,{value:{isOpen:u,setIsOpen:h,activeSubmenuId:f,setActiveSubmenuId:m,size:t,variant:n,triggerRef:p},children:r.jsx(Xu,{trigger:e,items:o,side:l,align:a,views:g,...s})})};bo.Trigger=sa,bo.Content=Ft,bo.Item=da,bo.Divider=ga;const Ku=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:l,isOpen:a,onOpen:c,onClose:g,closeOnSelect:s=!0,maxRecentColors:u=8,showRecentColors:h=!0}=e,[f,m]=d.useState(a??!1),[p,b]=d.useState(o??t),[x,y]=d.useState(""),[k,I]=d.useState([]),T=d.useRef(null),C=d.useRef(null);d.useEffect(()=>{o!==void 0&&b(o)},[o]),d.useEffect(()=>{a!==void 0&&m(a)},[a]),d.useEffect(()=>{if(h){const S=localStorage.getItem("colorPicker-recentColors");if(S)try{I(JSON.parse(S))}catch{}}},[h]),d.useEffect(()=>{const S=$=>{f&&T.current&&C.current&&!T.current.contains($.target)&&!C.current.contains($.target)&&H()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[f]);const w=d.useCallback(S=>{h&&I($=>{const A=$.filter(V=>V!==S),_=[S,...A].slice(0,u);return localStorage.setItem("colorPicker-recentColors",JSON.stringify(_)),_})},[h,u]),j=d.useCallback(()=>{const S=!f;m(S),S?c==null||c():g==null||g()},[f,c,g]),z=d.useCallback(S=>{b(S),w(S),n==null||n(S),l==null||l(S),s&&(m(!1),g==null||g())},[n,l,s,g,w]),E=d.useCallback(S=>{y(S)},[]),P=d.useCallback(()=>{x&&(z(x),y(""))},[x,z]),H=d.useCallback(()=>{m(!1),g==null||g()},[g]);return{isOpen:f,selectedColor:p,recentColors:k,customColor:x,handleToggle:j,handleColorSelect:z,handleCustomColorChange:E,handleCustomColorSubmit:P,handleClose:H,triggerRef:T,dropdownRef:C}},Je={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"}},Qu={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"}},Zu={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Ju={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"}},Ru=[{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"}],eh=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:l,views:a={},size:c="md",shape:g="default",variant:s="default",error:u=!1,isDisabled:h=!1,isReadOnly:f=!1,predefinedColors:m=Ru,showCustomInput:p=!0,showRecentColors:b=!0,isOpen:x,selectedColor:y,recentColors:k,customColor:I,handleToggle:T,handleColorSelect:C,handleCustomColorChange:w,handleCustomColorSubmit:j,triggerRef:z,dropdownRef:E,onChange:P,...H})=>{const{getColor:S}=i.useTheme(),$={...Je.container,...a==null?void 0:a.container},A={...Je.trigger,...Qu[c],...Zu[g],...Ju[s],...u&&{borderColor:"color-red-500"},...h&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},_={...Je.dropdown,...a==null?void 0:a.dropdown},V={...Je.colorGrid,...a==null?void 0:a.colorGrid},B={...Je.recentColors,...a==null?void 0:a.recentColors},W=y||"color-gray-200";return r.jsxs(i.View,{...$,...H,children:[t&&r.jsx(i.Text,{fontSize:c==="xs"?"12px":c==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...a==null?void 0:a.label,children:t}),r.jsxs(i.View,{ref:z,onClick:h||f?void 0:T,...A,children:[r.jsxs(i.Horizontal,{alignItems:"center",gap:8,children:[r.jsx(i.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:W,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),r.jsx(i.Text,{color:y?"color-gray-800":"color-gray-500",fontSize:"inherit",children:y||n})]}),!f&&!h&&r.jsx(le,{widthHeight:16,color:"color-gray-500",orientation:x?"up":"down"})]}),x&&r.jsxs(i.View,{ref:E,..._,children:[r.jsx(i.View,{...V,children:m.map((L,D)=>r.jsx(i.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:L.value,borderWidth:"2px",borderStyle:"solid",borderColor:y===L.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>C(L.value),title:L.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},D))}),p&&r.jsxs(i.View,{...Je.customInput,...a==null?void 0:a.customInput,children:[r.jsxs(i.Horizontal,{gap:8,alignItems:"center",marginBottom:"8px",children:[r.jsx("input",{type:"color",value:I||"#000000",onChange:L=>{const D=L.target.value;w(D),C(D)},style:{width:"40px",height:"32px",border:"1px solid #d1d5db",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},title:"Pick a color"}),r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",children:"Use native color picker"})]}),r.jsx(uo,{placeholder:"Enter hex color (e.g., #ff0000)",value:I,onChange:L=>w(L.target.value),onKeyPress:L=>{L.key==="Enter"&&j()},size:"sm",right:I&&r.jsx(i.View,{width:"16px",height:"16px",borderRadius:"2px",backgroundColor:I,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:j})})]}),b&&k.length>0&&r.jsxs(i.View,{...B,children:[r.jsx(i.Text,{fontWeight:"500",color:"color-gray-600",marginBottom:"8px",children:"Recent Colors"}),r.jsx(i.Horizontal,{gap:8,flexWrap:"wrap",children:k.map((L,D)=>r.jsx(i.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:L,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:()=>C(L),title:L,_hover:{transform:"scale(1.1)"}},D))})]})]}),l&&r.jsx(i.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:l})]})},oh=e=>{const o=Ku(e);return r.jsx(eh,{...o,...e})},th=e=>{const o=An(e);return r.jsx(Dn,{...o,...e})},rh=e=>{const o=Bn(e);return r.jsx(Ln,{...o,...e})},nh=(e=null,o=null)=>{const[t,n]=d.useState(e),[l,a]=d.useState(o),c=s=>l===s,g=s=>{a(u=>u===s?null:s)};return d.useEffect(()=>{const s=h=>{!h.composedPath().some(p=>(p==null?void 0:p.id)==="menubar-content"||(p==null?void 0:p.id)==="menubar-trigger")&&l!==null&&a(null)},u=h=>{h.key==="Escape"&&l!==null&&a(null)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",u)}},[l]),{activeMenuId:t,setActiveMenuId:n,openMenuId:l,setOpenMenuId:a,isMenuOpen:c,toggleMenu:g}},ua={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},ah={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"}},lh={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Ko={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},ha=d.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),Qo=()=>d.useContext(ha),ch=({value:e,children:o})=>r.jsx(ha.Provider,{value:e,children:o}),fa=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",views:l,...a})=>{const c=o==="horizontal"?i.Horizontal:i.Vertical;return r.jsx(c,{role:"menubar","aria-orientation":o,...lh[o],...ah[n],...l==null?void 0:l.container,...a,children:e})},ma=({children:e,id:o,disabled:t=!1,views:n})=>{const{orientation:l}=Qo(),a=l==="horizontal"?i.Horizontal:i.Vertical;return r.jsx(a,{role:"none",position:"relative",opacity:t?.5:1,pointerEvents:t?"none":"auto",...n==null?void 0:n.menu,children:d.Children.map(e,c=>d.isValidElement(c)?d.cloneElement(c,{...c.props,menuId:o}):c)})},pa=({children:e,menuId:o,disabled:t=!1,views:n})=>{const{activeMenuId:l,setActiveMenuId:a,toggleMenu:c,isMenuOpen:g,size:s,triggerRefs:u}=Qo(),h=d.useRef(null),f=l===o,m=g(o);d.useEffect(()=>(h.current&&o&&(u.current[o]=h.current),()=>{o&&delete u.current[o]}),[o,u]);const p=()=>{t||(a(o),c(o))};return r.jsx(i.View,{ref:h,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":m,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...ua[s],...f?Ko.active:{},...t?Ko.disabled:{},_hover:t?{}:Ko.hover,onClick:p,...n==null?void 0:n.trigger,children:e})},ba=({children:e,menuId:o,views:t})=>{const{isMenuOpen:n,orientation:l,triggerRefs:a}=Qo(),c=d.useRef(null),[g,s]=d.useState({x:0,y:0,placement:l==="horizontal"?"bottom":"right"}),u=n(o);if(d.useEffect(()=>{if(u&&c.current&&o&&a.current[o]){const f=c.current.getBoundingClientRect(),m=a.current[o].getBoundingClientRect(),p=Math.max(f.width||200,200),b=Math.max(f.height||150,150),x=window.innerWidth,y=window.innerHeight,k={top:m.top,right:x-m.right,bottom:y-m.bottom,left:m.left},I=l==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=b+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=b+8,x:m.left,y:m.top-b-8},{placement:"right",space:k.right,fits:k.right>=p+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=p+8,x:m.left-p-8,y:m.top}]:[{placement:"right",space:k.right,fits:k.right>=p+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=p+8,x:m.left-p-8,y:m.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=b+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=b+8,x:m.left,y:m.top-b-8}],T=I.find(z=>z.fits);if(T){s({x:T.x,y:T.y,placement:T.placement});return}const C=I.reduce((z,E)=>E.space>z.space?E:z);let w=C.x,j=C.y;w+p>x&&(w=x-p-8),w<8&&(w=8),j+b>y&&(j=y-b-8),j<8&&(j=8),s({x:w,y:j,placement:C.placement})}},[u,l,o,a]),!u)return null;const h={position:"fixed",left:g.x,top:g.y,zIndex:1e3};return r.jsx(i.View,{ref:c,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:h,...t==null?void 0:t.content,children:e})},ya=({children:e,icon:o,disabled:t=!1,onClick:n,views:l})=>{const{size:a}=Qo(),c=()=>{t||!n||n()};return r.jsxs(i.View,{role:"menuitem",cursor:t?"not-allowed":"pointer",userSelect:"none",display:"flex",alignItems:"center",opacity:t?.5:1,...ua[a],_hover:t?{}:Ko.hover,onClick:c,...l==null?void 0:l.item,children:[o&&r.jsx(i.View,{marginRight:8,...l==null?void 0:l.icon,children:o}),e]})},xa=({views:e})=>r.jsx(i.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),ih=({items:e,orientation:o,size:t,variant:n,views:l,themeMode:a})=>r.jsx(fa,{orientation:o,size:t,variant:n,views:l,children:e.map(c=>r.jsxs(ma,{id:c.id,disabled:c.disabled,views:l,children:[r.jsxs(pa,{menuId:c.id,views:l,children:[c.icon&&r.jsx(i.View,{marginRight:8,...l==null?void 0:l.icon,children:c.icon}),c.label]}),c.items&&c.items.length>0&&r.jsx(ba,{menuId:c.id,views:l,children:c.items.map((g,s)=>g.separator?r.jsx(xa,{views:l},`separator-${s}`):r.jsx(ya,{id:g.id,icon:g.icon,disabled:g.disabled,onClick:g.onClick,views:l,children:g.label},g.id))})]},c.id))}),De=({items:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultActiveMenuId:l=null,defaultOpenMenuId:a=null,views:c,...g})=>{const{activeMenuId:s,setActiveMenuId:u,openMenuId:h,setOpenMenuId:f,isMenuOpen:m,toggleMenu:p}=nh(l,a),b=d.useRef({});return r.jsx(ch,{value:{activeMenuId:s,setActiveMenuId:u,openMenuId:h,setOpenMenuId:f,isMenuOpen:m,toggleMenu:p,orientation:o,size:t,variant:n,triggerRefs:b},children:r.jsx(ih,{items:e,orientation:o,size:t,variant:n,views:c,...g})})};De.Root=fa,De.Menu=ma,De.Trigger=pa,De.Content=ba,De.Item=ya,De.Separator=xa;const sh=(e,o,t)=>{const[n,l]=d.useState([]);return d.useEffect(()=>{l((()=>{const c=[];if(o<=t)for(let g=1;g<=o;g++)c.push(g);else{c.push(1);let g=Math.max(2,e-Math.floor((t-2)/2)),s=Math.min(o-1,g+t-3);s>=o-1&&(s=o-1,g=Math.max(2,s-(t-3))),g>2&&c.push("...");for(let u=g;u<=s;u++)c.push(u);s<o-1&&c.push("..."),c.push(o)}return c})())},[e,o,t]),{visiblePageNumbers:n}},Re={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"}}}},yo={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"}}},xo={rounded:{borderRadius:"4px"},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},dh={backgroundColor:"color-blue-500",color:"color-white",_hover:{backgroundColor:"color-blue-600"}},Zo={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},gh=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:l=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"100 / page",value:100}],onPageSizeChange:a,showPageSizeSelector:c=!1,showPageInfo:g=!0,maxPageButtons:s=5,showFirstLastButtons:u=!1,size:h="md",variant:f="default",shape:m="rounded",visiblePageNumbers:p,views:b,...x})=>{const y=T=>{T<1||T>o||T===e||t(T)},k=T=>{a&&a(Number(T.target.value))},I=(T,C)=>{if(T==="...")return r.jsx(i.View,{display:"flex",alignItems:"center",justifyContent:"center",...Re[h],...b==null?void 0:b.ellipsis,children:"..."},`ellipsis-${C}`);const w=T===e;return r.jsx(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:w?"default":"pointer",...Re[h],...yo[f],...xo[m],...w?dh:{},onClick:()=>y(T),"aria-label":`Page ${T}`,"aria-current":w?"page":void 0,...w?b==null?void 0:b.activePageButton:b==null?void 0:b.pageButton,children:T},`page-${T}`)};return r.jsxs(i.Horizontal,{alignItems:"center",gap:8,...b==null?void 0:b.container,...x,children:[u&&r.jsxs(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Re[h],...yo[f],...xo[m],...e===1?Zo:{},onClick:()=>y(1),"aria-label":"First page",disabled:e===1,...b==null?void 0:b.navigationButton,children:[r.jsx(le,{orientation:"left",widthHeight:16}),r.jsx(le,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),r.jsx(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Re[h],...yo[f],...xo[m],...e===1?Zo:{},onClick:()=>y(e-1),"aria-label":"Previous page",disabled:e===1,...b==null?void 0:b.navigationButton,children:r.jsx(le,{orientation:"left",widthHeight:16})}),p.map((T,C)=>I(T,C)),r.jsx(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Re[h],...yo[f],...xo[m],...e===o?Zo:{},onClick:()=>y(e+1),"aria-label":"Next page",disabled:e===o,...b==null?void 0:b.navigationButton,children:r.jsx(le,{orientation:"right",widthHeight:16})}),u&&r.jsxs(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Re[h],...yo[f],...xo[m],...e===o?Zo:{},onClick:()=>y(o),"aria-label":"Last page",disabled:e===o,...b==null?void 0:b.navigationButton,children:[r.jsx(le,{orientation:"right",widthHeight:16}),r.jsx(le,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),g&&r.jsxs(i.Text,{marginLeft:16,color:"color-gray-600",...b==null?void 0:b.pageInfo,children:["Page ",e," of ",o]}),c&&a&&r.jsx(i.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,...b==null?void 0:b.pageSizeSelector,children:l.map(T=>r.jsx("option",{value:T.value,children:T.label},T.value))})]})},uh=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:l,onPageSizeChange:a,showPageSizeSelector:c=!1,showPageInfo:g=!0,maxPageButtons:s=5,showFirstLastButtons:u=!1,size:h="md",variant:f="default",shape:m="rounded",views:p,...b})=>{const{visiblePageNumbers:x}=sh(e,o,s);return r.jsx(gh,{currentPage:e,totalPages:o,onPageChange:t,pageSize:n,pageSizeOptions:l,onPageSizeChange:a,showPageSizeSelector:c,showPageInfo:g,maxPageButtons:s,showFirstLastButtons:u,size:h,variant:f,shape:m,visiblePageNumbers:x,views:p,...b})},hh=d.memo(({shape:e="linear",value:o=0,max:t=100,color:n="theme-primary",backgroundColor:l="color-gray-200",height:a,size:c,radius:g=4,strokeWidth:s=10,showLabel:u=!1,labelColor:h="theme-text-primary",animated:f=!0,animationDuration:m="0.5s",views:p,themeMode:b,...x})=>{const{getColor:y,themeMode:k}=i.useTheme(),I=b||k,C=Math.min(t,Math.max(0,o))/t*100,w=d.useMemo(()=>y(l,{themeMode:I}),[y,l,I]),j=d.useMemo(()=>y(n,{themeMode:I}),[y,n,I]);if(e==="circle"){const E=c||(typeof a=="number"?a:100),P=(E-s)/2,H=2*Math.PI*P,S=H-C/100*H;return r.jsxs(i.View,{width:E,height:E,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...p==null?void 0:p.container,...x,children:[r.jsxs("svg",{width:E,height:E,viewBox:`0 0 ${E} ${E}`,style:{transform:"rotate(-90deg)"},children:[r.jsx("circle",{cx:E/2,cy:E/2,r:P,stroke:w,strokeWidth:s,fill:"transparent",...p==null?void 0:p.track}),r.jsx("circle",{cx:E/2,cy:E/2,r:P,stroke:j,strokeWidth:s,strokeDasharray:H,strokeDashoffset:S,strokeLinecap:"round",fill:"transparent",style:{transition:f?`stroke-dashoffset ${m} ease-in-out`:"none"},...p==null?void 0:p.indicator})]}),u&&r.jsx(i.View,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",children:r.jsxs(i.Text,{color:h,fontSize:`${E*.2}px`,fontWeight:"bold",...p==null?void 0:p.text,children:[Math.round(C),"%"]})})]})}const z=a||8;return r.jsx(i.View,{role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":t,width:"100%",height:z,backgroundColor:w,borderRadius:g,overflow:"hidden",...p==null?void 0:p.container,...x,children:r.jsx(i.View,{width:`${C}%`,height:"100%",backgroundColor:j,borderRadius:g,style:{transition:f?`width ${m} ease-in-out`:"none"},...p==null?void 0:p.bar})})}),fh=e=>r.jsx(hh,{...e}),mh=(e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}))(),ph={thin:"1px",medium:"2px",thick:"4px"},ko={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"}},bh=({orientation:e="horizontal",variant:o="solid",thickness:t="thin",color:n,spacing:l="0px",label:a,decorative:c=!1,views:g,themeMode:s,...u})=>{const{themeMode:h}=i.useTheme(),f=n||"color-gray-200",m=mh[o],p=ph[t],b=c?{"aria-hidden":!0}:{role:"separator","aria-orientation":e};return a&&e==="horizontal"?r.jsxs(i.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:l,...b,...u,children:[r.jsx(i.View,{height:"0px",flexGrow:1,borderTopWidth:p,borderTopStyle:m,borderTopColor:f,...ko.container,...g==null?void 0:g.container}),r.jsx(i.Text,{...ko.label,...g==null?void 0:g.label,children:a}),r.jsx(i.View,{height:"0px",flexGrow:1,borderTopWidth:p,borderTopStyle:m,borderTopColor:f,...ko.container,...g==null?void 0:g.container})]}):e==="horizontal"?r.jsx(i.View,{height:"0px",width:"100%",borderTopWidth:p,borderTopStyle:m,borderTopColor:f,padding:l,...ko.container,...b,...g==null?void 0:g.container,...u}):r.jsx(i.View,{width:"0px",height:"100%",borderLeftWidth:p,borderLeftStyle:m,borderLeftColor:f,padding:l,...ko.container,...b,...g==null?void 0:g.container,...u})},ka=e=>r.jsx(bh,{...e}),yh=ka,xh=ka,kh={xs:12,sm:14,md:16,lg:18,xl:20},Ch=({isSupported:e,isSharing:o,onShare:t,label:n,children:l,icon:a,size:c,isDisabled:g,isLoading:s,iconPosition:u,disableWhenUnsupported:h=!0,...f})=>{const m=c??"md",p=a??r.jsx(or,{widthHeight:kh[m],strokeWidth:1.5,filled:!1}),b=!!g||!e&&h,x=!!s||o;return r.jsx(_e,{...f,size:m,icon:p,iconPosition:u??"left",isDisabled:b,isLoading:x,onClick:t,children:l??n??"Share"})},Ca=()=>typeof navigator>"u"?void 0:navigator,wh=(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},Ih=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},Th=e=>{const{shareData:o,onClick:t,onUnsupported:n,onShareStart:l,onShareSuccess:a,onShareCancel:c,onShareError:g}=e,[s,u]=d.useState(!1),h=d.useMemo(()=>wh(Ca(),o),[o]),f=d.useCallback((...m)=>{t==null||t(...m);const p=Ca();if(!p||typeof p.share!="function"){n==null||n();return}if(!s){if(typeof p.canShare=="function")try{if(!p.canShare(o)){n==null||n();return}}catch(b){g==null||g(b);return}u(!0),l==null||l();try{p.share(o).then(()=>{a==null||a()}).catch(b=>{if(Ih(b)==="AbortError"){c==null||c();return}g==null||g(b)}).finally(()=>{u(!1)})}catch(b){u(!1),g==null||g(b)}}},[s,t,c,g,l,a,n,o]);return{isSupported:h,isSharing:s,handleShare:f}},jh=e=>{const{isSupported:o,isSharing:t,handleShare:n}=Th(e),{shareData:l,onShareStart:a,onShareSuccess:c,onShareCancel:g,onShareError:s,onUnsupported:u,onClick:h,...f}=e;return r.jsx(Ch,{...f,isSupported:o,isSharing:t,onShare:n})},Sh=({label:e,status:o="default",views:t,themeMode:n,...l})=>{const{themeMode:a}=i.useTheme(),c=sr();return r.jsxs(i.Horizontal,{alignItems:"center",gap:8,role:"status-indicator",...t==null?void 0:t.container,...l,children:[r.jsx(i.View,{role:"status-dot",width:"8px",height:"8px",borderRadius:"50%",...c[o].indicator,...t==null?void 0:t.indicator}),e&&r.jsx(i.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...c[o].label,...t==null?void 0:t.label,children:e})]})},Mh=e=>r.jsx(Sh,{...e}),zh=(e=!0,o,t,n)=>{const{on:l}=i.useResponsive(),a=l("mobile"),[c,g]=d.useState(o!==void 0?o:e);return d.useEffect(()=>{o!==void 0&&g(o)},[o]),{isExpanded:c,toggleExpanded:()=>{const f=!c;g(f),t&&t(f)},expand:()=>{c||(g(!0),t&&t(!0))},collapse:()=>{c&&(g(!1),t&&t(!1))},isMobile:a}},Vh={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},Eh=(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"}}))(),Ph={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},Wh={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)"}},_h={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)"},wa=d.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),Jo=()=>d.useContext(wa),$h=({value:e,children:o})=>r.jsx(wa.Provider,{value:e,children:o}),Hh=({children:e,showToggleButton:o=!0,views:t,...n})=>{const{isExpanded:l,toggleExpanded:a,position:c}=Jo();return r.jsx(i.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:l?r.jsxs(i.Horizontal,{width:"100%",alignItems:"center",justifyContent:"space-between",children:[e,o&&r.jsx(i.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":l?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(le,{orientation:c==="left"?"left":"right",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})]}):r.jsx(i.View,{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:o&&r.jsx(i.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":l?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(le,{orientation:c==="left"?"right":"left",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})})})},Bh=({children:e,views:o,...t})=>{const{isExpanded:n}=Jo();return r.jsx(i.View,{flex:"1",width:"100%",overflowY:"auto",overflowX:"hidden",padding:n?"16px":"8px",...o==null?void 0:o.content,...t,children:e})},Lh=({children:e,views:o,...t})=>{const{isExpanded:n}=Jo();return r.jsx(i.View,{width:"100%",padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",...o==null?void 0:o.footer,...t,children:n?e:null})},Ah=({children:e,position:o="left",size:t="md",variant:n="default",fixed:l=!1,hasBackdrop:a=!0,expandedWidth:c,collapsedWidth:g,breakpointBehavior:s="overlay",elevation:u="none",transitionPreset:h="normal",ariaLabel:f="Sidebar navigation",isExpanded:m,isMobile:p,collapse:b,views:x,themeMode:y,...k})=>{const I=Vh[t],T=m?c||I.expandedWidth:g||I.collapsedWidth,C=!p||p&&s!=="hide",w=l||p&&s==="overlay"?"fixed":"relative",j=a&&p&&m&&s==="overlay";return r.jsxs(r.Fragment,{children:[j&&r.jsx(i.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:b,...x==null?void 0:x.backdrop}),C&&r.jsx(i.Vertical,{position:w,top:0,height:"100vh",width:T,zIndex:999,transition:_h[h],transform:p&&s==="overlay"&&!m?`translateX(${o==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":f,...Eh[n],...Ph[o],...Wh[u],...x==null?void 0:x.container,...k,children:d.Children.map(e,z=>z)})]})},Co=({children:e,position:o="left",size:t="md",variant:n="default",defaultExpanded:l=!0,expanded:a,onExpandedChange:c,fixed:g=!1,hasBackdrop:s=!0,showToggleButton:u=!0,expandedWidth:h,collapsedWidth:f,breakpoint:m=768,breakpointBehavior:p="overlay",views:b,...x})=>{const{isExpanded:y,toggleExpanded:k,expand:I,collapse:T,isMobile:C}=zh(l,a,c);return r.jsx($h,{value:{isExpanded:y,toggleExpanded:k,expand:I,collapse:T,position:o,size:t,variant:n,views:b},children:r.jsx(Ah,{position:o,size:t,variant:n,fixed:g,hasBackdrop:s,showToggleButton:u,expandedWidth:h,collapsedWidth:f,breakpoint:m,breakpointBehavior:p,isExpanded:y,isMobile:C,toggleExpanded:k,expand:I,collapse:T,views:b,...x,children:e})})};Co.Header=Hh,Co.Content=Bh,Co.Footer=Lh,Co.useContext=Jo;const Dh=()=>({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)}}}),Fh=(e,o,t,n=50,l=1/0,a=!1,c,g,s=10)=>{const[u,h]=d.useState(!1),[f,m]=d.useState([]),p=d.useRef(null),b=d.useRef(null),x=d.useRef(0),y=d.useRef([]),k=d.useRef(g||(typeof window<"u"?Dh():null)),I=d.useCallback(()=>p.current?e==="horizontal"?p.current.offsetWidth:p.current.offsetHeight:0,[e]),T=d.useCallback(()=>{if(!c||!k.current)return null;const V=k.current.getItem(c);if(!V)return null;try{const B=JSON.parse(V);return Array.isArray(B.sizes)?B.sizes:null}catch(B){return console.warn("Failed to parse saved panel sizes:",B),null}},[c]),C=d.useCallback(()=>{if(!c||!k.current||f.length===0)return;const V=f.map(B=>({id:B.id,size:B.size,collapsed:B.collapsed||!1}));k.current.setItem(c,JSON.stringify({sizes:V}))},[c,f]),w=d.useCallback((V,B,W,L,D)=>{m(F=>F.some(q=>q.id===V)?F:[...F,{id:V,size:B,minSize:W??n,maxSize:L??l,collapsible:D??a,collapsed:!1}])},[n,l,a]),j=d.useCallback(V=>{m(B=>B.filter(W=>W.id!==V))},[]),z=d.useCallback(V=>{const B=f.find(W=>W.id===V);return B?B.size:0},[f]),E=d.useCallback((V,B)=>{m(W=>W.map(L=>L.id===V?{...L,size:B}:L))},[]),P=d.useCallback(V=>{const B=f.find(W=>W.id===V);return B?!!B.collapsed:!1},[f]),H=d.useCallback(V=>{m(B=>{const W=B.findIndex(q=>q.id===V);if(W===-1)return B;const L=B[W];if(!L.collapsible)return B;const D={...L,collapsed:!L.collapsed},F=[...B];return F[W]=D,F})},[]),S=d.useCallback((V,B)=>{b.current=V,x.current=B,y.current=f.map(W=>W.size),h(!0)},[f]),$=d.useCallback(V=>{if(!u||!b.current)return;const B=b.current,W=V-x.current;let L=-1;const D=B.match(/\d+$/);if(D&&(L=parseInt(D[0],10)-1),L===-1&&f.length>=2&&(L=0),L<0||L>=f.length-1)return;const F=f[L],q=f[L+1];if(F.collapsed||q.collapsed)return;let O=y.current[L]+W,U=y.current[L+1]-W;O=Math.max(F.minSize??n,Math.min(F.maxSize??l,O)),U=Math.max(q.minSize??n,Math.min(q.maxSize??l,U)),m(Z=>Z.map((X,N)=>N===L?{...X,size:O}:N===L+1?{...X,size:U}:X))},[u,f,e,n,l]),A=d.useCallback(()=>{u&&t&&t(f.map(V=>V.size)),b.current=null,h(!1),c&&C()},[u,f,t,c,C]),_=d.useCallback(V=>{if(!u||!b.current)return;const B=b.current;let W=-1;const L=B.match(/\d+$/);if(L&&(W=parseInt(L[0],10)-1),W===-1&&f.length>=2&&(W=0),W<0||W>=f.length-1)return;let D=0;e==="horizontal"?(V.key==="ArrowLeft"&&(D=-s),V.key==="ArrowRight"&&(D=s),V.key==="Home"&&(D=-100),V.key==="End"&&(D=100)):(V.key==="ArrowUp"&&(D=-s),V.key==="ArrowDown"&&(D=s),V.key==="Home"&&(D=-100),V.key==="End"&&(D=100)),D!==0&&(V.preventDefault(),$(x.current+D)),V.key==="Escape"&&(m(F=>F.map((q,O)=>({...q,size:y.current[O]}))),A())},[u,f,e,$,A,s]);return d.useEffect(()=>{const V=L=>{if(!u)return;const D=e==="horizontal"?L.clientX:L.clientY;$(D)},B=L=>{if(!u||L.touches.length===0)return;const D=L.touches[0],F=e==="horizontal"?D.clientX:D.clientY;$(F)},W=()=>{u&&A()};return u&&(document.addEventListener("mousemove",V),document.addEventListener("touchmove",B),document.addEventListener("mouseup",W),document.addEventListener("touchend",W),document.addEventListener("keydown",_),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",V),document.removeEventListener("touchmove",B),document.removeEventListener("mouseup",W),document.removeEventListener("touchend",W),document.removeEventListener("keydown",_),document.body.style.cursor="",document.body.style.userSelect=""}},[u,e,$,A,_]),d.useEffect(()=>{if(f.length!==0){if(c){const V=T();if(V){m(B=>B.map(W=>{const L=V.find(D=>D.id===W.id);return L?{...W,size:L.size,collapsed:L.collapsed||!1}:W}));return}}if(!o){const B=I()/f.length;m(W=>W.map(L=>({...L,size:B})))}}},[f.length,o,I,c,T]),d.useEffect(()=>{if(!o||o.length===0||f.length===0)return;const V=I(),B=o.map(W=>typeof W=="string"&&W.endsWith("%")?parseFloat(W)/100*V:typeof W=="number"?W:parseFloat(W));m(W=>W.map((L,D)=>({...L,size:D<B.length?B[D]:L.size})))},[o,f.length,I]),d.useEffect(()=>{f.length>0&&c&&!u&&C()},[f,c,u,C]),{isResizing:u,setIsResizing:h,containerRef:p,panels:f,registerPanel:w,unregisterPanel:j,getPanelSize:z,setPanelSize:E,isPanelCollapsed:P,togglePanelCollapse:H,startResize:S,onResize:$,endResize:A}},Oh={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},qh=(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],Nh=(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"}}}))(),Ro={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},Ia=d.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),Ta=()=>d.useContext(Ia),Uh=({value:e,children:o})=>r.jsx(Ia.Provider,{value:e,children:o}),Gh=({children:e,id:o,defaultSize:t,minSize:n,maxSize:l,collapsible:a,defaultCollapsed:c,onCollapseChange:g,views:s,...u})=>{const{orientation:h,registerPanel:f,unregisterPanel:m,getPanelSize:p,isPanelCollapsed:b,togglePanelCollapse:x}=Ta(),y=typeof t=="string"&&t.endsWith("%")?0:typeof t=="number"?t:0;d.useEffect(()=>(f(o,y,n,l,a),()=>m(o)),[o,y,n,l,a,f,m]);const k=p(o),I=b(o);return d.useEffect(()=>{g&&I!==void 0&&g(I)},[I,g]),d.useEffect(()=>{a&&c&&!I&&x(o)},[o,a,c,I,x]),I?r.jsx(i.View,{flex:"0 0 auto",width:h==="horizontal"?"10px":"100%",height:h==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>x(o),"aria-label":`Expand panel ${o}`,role:"button",tabIndex:0,...s==null?void 0:s.collapsedPanel,...u}):r.jsx(i.View,{flex:k>0?"0 0 auto":"1",width:h==="horizontal"?`${k}px`:"100%",height:h==="vertical"?`${k}px`:"100%",overflow:"auto",...s==null?void 0:s.panel,...u,children:e})},Yh=({id:e,position:o="both",disabled:t=!1,withVisualIndicator:n=!0,withCollapseButton:l=!1,collapseTarget:a,views:c,...g})=>{const{orientation:s,size:u,variant:h,startResize:f,isPanelCollapsed:m,togglePanelCollapse:p}=Ta(),x=(()=>{if(a)return a;const w=e.match(/\d+$/);if(!w)return"";const j=parseInt(w[0],10);return isNaN(j)?"":`panel${j}`})(),y=m(x),k=w=>{if(t)return;w.preventDefault();const j=s==="horizontal"?w.clientX:w.clientY;f(e,j)},I=w=>{if(t||w.touches.length===0)return;w.preventDefault();const j=w.touches[0],z=s==="horizontal"?j.clientX:j.clientY;f(e,z)},T=w=>{t||(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),f(e,0))},C=w=>{w.stopPropagation(),x&&p(x)};return r.jsxs(i.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",...qh(u,s),...Nh[h],onMouseDown:k,onTouchStart:I,onKeyDown:T,opacity:t?.5:1,pointerEvents:t?"none":"auto",...c==null?void 0:c.handle,...g,children:[n&&r.jsx(i.View,{display:"flex",alignItems:"center",justifyContent:"center",width:s==="horizontal"?"100%":"auto",height:s==="vertical"?"100%":"auto",pointerEvents:"none",...c==null?void 0:c.handleIcon,children:s==="horizontal"?r.jsxs(i.Horizontal,{gap:1,children:[r.jsx(i.View,{...Ro.horizontal}),r.jsx(i.View,{...Ro.horizontal})]}):r.jsxs(i.Vertical,{gap:1,children:[r.jsx(i.View,{...Ro.vertical}),r.jsx(i.View,{...Ro.vertical})]})}),l&&x&&r.jsx(i.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:C,"aria-label":y?`Expand panel ${x}`:`Collapse panel ${x}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...c==null?void 0:c.collapseIcon,children:r.jsx(i.View,{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center",children:y?r.jsxs(i.Horizontal,{children:[r.jsx(i.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"}),r.jsx(i.View,{width:"2px",height:"6px",backgroundColor:"color-gray-600",position:"absolute"})]}):r.jsx(i.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"})})})]})},vh=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:l,minSize:a,maxSize:c,collapsible:g=!1,containerRef:s,autoSaveId:u,views:h,...f})=>{const m=o==="horizontal"?i.Horizontal:i.Vertical;return r.jsx(m,{ref:s,width:"100%",height:"100%",position:"relative",overflow:"hidden",...Oh[o],...h==null?void 0:h.container,...f,children:e})},Ot=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:l,onSizesChange:a,minSize:c=50,maxSize:g,collapsible:s=!1,autoSaveId:u,storage:h,keyboardResizeBy:f=10,views:m,...p})=>{const{isResizing:b,setIsResizing:x,containerRef:y,registerPanel:k,unregisterPanel:I,getPanelSize:T,setPanelSize:C,isPanelCollapsed:w,togglePanelCollapse:j,startResize:z,onResize:E,endResize:P}=Fh(o,l,a,c,g,s,u,h,f);return r.jsx(Uh,{value:{orientation:o,size:t,variant:n,isResizing:b,setIsResizing:x,registerPanel:k,unregisterPanel:I,getPanelSize:T,setPanelSize:C,isPanelCollapsed:w,togglePanelCollapse:j,startResize:z,onResize:E,endResize:P},children:r.jsx(vh,{orientation:o,size:t,variant:n,defaultSizes:l,minSize:c,maxSize:g,collapsible:s,autoSaveId:u,keyboardResizeBy:f,containerRef:y,views:m,...p,children:e})})};Ot.Panel=Gh,Ot.Handle=Yh;const et={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"}},Kh=()=>Math.random().toString(36).substring(2,9);let eo=new Map;const wo=tt.create(e=>({toasts:[],add:(o,t,n,l={})=>{const a=l.id||Kh(),c={id:a,variant:o,title:t,description:n,createdAt:Date.now(),isVisible:!0,...l};if(e(g=>({toasts:[...g.toasts,c]})),l.duration!==0){const g=l.duration||5e3,s=setTimeout(()=>{wo.getState().remove(a)},g);eo.set(a,s)}return a},remove:o=>{e(t=>({toasts:t.toasts.map(n=>n.id===o?{...n,isVisible:!1}:n)})),eo.has(o)&&(clearTimeout(eo.get(o)),eo.delete(o)),setTimeout(()=>{e(t=>({toasts:t.toasts.filter(n=>n.id!==o)}))},300)},removeAll:()=>{eo.forEach(clearTimeout),eo.clear(),e(o=>({toasts:o.toasts.map(t=>({...t,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),Fe=(e,o,t,n)=>wo.getState().add(e,o,t,n),ja=(e,o,t)=>Fe("info",e,o,t),Sa=(e,o,t)=>Fe("success",e,o,t),Ma=(e,o,t)=>Fe("warning",e,o,t),za=(e,o,t)=>Fe("error",e,o,t),Va=e=>{wo.getState().remove(e)},Ea=()=>{wo.getState().removeAll()},Pa=({variant:e,title:o,description:t,onClose:n,isClosable:l=!0,action:a,actionText:c,showIcon:g=!0,theme:s,views:u,render:h,icon:f,id:m,isVisible:p=!0,themeMode:b})=>{const x=s??et,y=()=>{var C,w;if(f!==void 0)return f;const T=e?(w=(C=et[e])==null?void 0:C.icon)==null?void 0:w.color:et.info.icon.color;switch(e){case"info":return r.jsx(Se,{widthHeight:20,color:T});case"success":return r.jsx(at,{widthHeight:20,color:T});case"warning":return r.jsx(Se,{widthHeight:20,color:T,orientation:"down"});case"error":return r.jsx(So,{widthHeight:20,color:T});default:return r.jsx(Se,{widthHeight:20,color:et.info.icon.color})}};if(h)return r.jsx(r.Fragment,{children:h({id:m||"",onClose:n})});const k=e==="error"?"alert":"status",I=e==="error"||e==="warning"?"assertive":"polite";return r.jsxs(i.Horizontal,{role:k,"aria-live":I,"aria-atomic":"true","data-state":p?"open":"closed",gap:12,width:"100%",maxWidth:"400px",borderWidth:"1px",borderStyle:"solid",borderRadius:"8px",padding:"12px 16px",alignItems:"flex-start",position:"relative",backgroundColor:x[e].container.backgroundColor,borderColor:x[e].container.border,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",opacity:p?1:0,transform:p?"scale(1)":"scale(0.95)",transition:"all 0.3s ease",...u==null?void 0:u.container,children:[g&&r.jsx(i.View,{marginTop:"2px",...u==null?void 0:u.icon,children:y()}),r.jsxs(i.Vertical,{gap:4,flex:"1",children:[r.jsx(i.Text,{size:"md",fontWeight:"600",color:x[e].content.color,backgroundColor:x[e].container.backgroundColor,...u==null?void 0:u.title,children:o}),t&&r.jsx(i.Text,{size:"sm",color:x[e].content.color,fontWeight:"400",backgroundColor:x[e].container.backgroundColor,...u==null?void 0:u.description,children:t}),a&&c&&r.jsx(i.Text,{size:"sm",fontWeight:"600",marginTop:"8px",cursor:"pointer",color:x[e].content.color,backgroundColor:x[e].container.backgroundColor,onClick:T=>{T.stopPropagation(),a()},_hover:{textDecoration:"underline"},transition:"all 0.2s ease",...u==null?void 0:u.actionButton,children:c})]}),l&&r.jsx(i.View,{as:"button","aria-label":"Close toast",backgroundColor:"transparent",border:"none",cursor:"pointer",padding:"4px",marginLeft:"8px",marginTop:"-4px",marginRight:"-8px",borderRadius:"4px",onClick:T=>{T.stopPropagation(),n()},_hover:{backgroundColor:"rgba(0, 0, 0, 0.05)"},transition:"all 0.2s ease",...u==null?void 0:u.closeButton,children:r.jsx(pe,{widthHeight:16,color:x[e].content.color})})]})},Qh=({position:e="top-right",gap:o=8,limit:t=5,containerStyle:n})=>{const{toasts:l,remove:a}=wo(),g=d.useMemo(()=>{const s={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return l.forEach(u=>{const h=u.position||e;s[h].push(u)}),Object.keys(s).forEach(u=>{s[u]=s[u].slice(-t)}),s},[l,e,t])[e];return r.jsx(i.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:g.map(s=>r.jsx(i.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(Pa,{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))})},Zh=()=>({toast:(e,o,t,n)=>Fe(e,o,t,n),info:(e,o,t)=>ja(e,o,t),success:(e,o,t)=>Sa(e,o,t),warning:(e,o,t)=>Ma(e,o,t),error:(e,o,t)=>za(e,o,t),remove:e=>Va(e),removeAll:()=>Ea()}),Jh=Object.assign(e=>r.jsx(Pa,{...e}),{Container:e=>r.jsx(Qh,{...e}),show:Fe,info:ja,success:Sa,warning:Ma,error:za,remove:Va,removeAll:Ea}),Rh=Zh,Wa=(e,o)=>{var c,g;if(!e)return!0;const t=e.toLowerCase(),n=o.name.toLowerCase().includes(t),l=((c=o.description)==null?void 0:c.toLowerCase().includes(t))||!1,a=((g=o.keywords)==null?void 0:g.some(s=>s.toLowerCase().includes(t)))||!1;return n||l||a},ef=({open:e,onOpenChange:o,groups:t=[],commands:n=[],filter:l})=>{const[a,c]=d.useState(""),[g,s]=d.useState(0),u=d.useRef(null),h=d.useMemo(()=>l||Wa,[l]),f=d.useMemo(()=>[...t.flatMap(y=>y.commands),...n],[t,n]),m=d.useMemo(()=>a.trim()?f.filter(x=>h(a,x)):f,[f,a,h]),p=d.useMemo(()=>{if(!a)return t;const x=l||Wa;return t.map(y=>({...y,commands:y.commands.filter(k=>x(a,k))})).filter(y=>y.commands.length)},[t,a,l]);d.useEffect(()=>{s(0)},[m.length]);const b=d.useCallback(x=>{if(e)switch(x.key){case"ArrowDown":x.preventDefault(),s(y=>y<m.length-1?y+1:y);break;case"ArrowUp":x.preventDefault(),s(y=>y>0?y-1:y);break;case"Enter":x.preventDefault(),m[g]&&(m[g].onSelect(),o(!1),c(""));break;case"Escape":x.preventDefault(),o(!1),c("");break}},[e,m,g,o]);return d.useEffect(()=>(document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}),[b]),d.useEffect(()=>{if(u.current&&e){const x=u.current.querySelector(`[data-index="${g}"]`);x&&x.scrollIntoView({block:"nearest"})}},[g,e]),d.useEffect(()=>{e?s(0):c("")},[e]),{search:a,setSearch:c,selectedIndex:g,setSelectedIndex:s,filteredCommands:m,filteredGroups:p,listRef:u}},of={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},tf=(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)"}}))(),rf={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},nf={overflow:"auto",padding:"8px 0"},af={marginBottom:"8px"},lf={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},cf={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},sf={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},df={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},gf={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},uf={display:"flex",flexDirection:"column",flex:1},hf={fontSize:"14px",fontWeight:"medium"},ff={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},mf={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},pf={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},bf={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},yf=d.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),xf=({value:e,children:o})=>r.jsx(yf.Provider,{value:e,children:o}),_a=({value:e,onValueChange:o,placeholder:t="Type a command or search...",views:n,...l})=>{const a=d.useRef(null);return d.useEffect(()=>{a.current&&a.current.focus()},[]),r.jsxs(i.View,{...rf,...n==null?void 0:n.container,...l,children:[r.jsx(zo,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),r.jsx(i.View,{as:"input",type:"text",value:e,onChange:c=>o(c.target.value),placeholder:t,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"14px",ref:a,...n==null?void 0:n.input})]})},kf=({children:e,views:o,...t})=>r.jsx(i.View,{...nf,...o==null?void 0:o.container,...t,children:e}),$a=({heading:e,children:o,views:t,...n})=>r.jsxs(i.View,{...af,...t==null?void 0:t.container,...n,children:[r.jsx(i.Text,{...lf,...t==null?void 0:t.heading,children:e}),o]}),qt=({item:e,selected:o=!1,onSelect:t,views:n,...l})=>{const a=()=>{!e.disabled&&t&&t()};return r.jsxs(i.Horizontal,{...cf,...o?sf:{},...e.disabled?df:{},onClick:a,...n==null?void 0:n.container,...l,children:[e.icon&&r.jsx(i.View,{...gf,...n==null?void 0:n.icon,children:e.icon}),r.jsxs(i.Vertical,{...uf,...n==null?void 0:n.content,children:[r.jsx(i.Text,{...hf,...n==null?void 0:n.name,children:e.name}),e.description&&r.jsx(i.Text,{...ff,...n==null?void 0:n.description,children:e.description})]}),e.shortcut&&r.jsx(i.Text,{...mf,...n==null?void 0:n.shortcut,children:e.shortcut})]})},Ha=({children:e="No results found.",views:o,...t})=>r.jsx(i.View,{...pf,...o==null?void 0:o.container,...t,children:e}),Cf=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:l,size:a="md",variant:c="default",emptyState:g,footer:s,search:u,setSearch:h,selectedIndex:f,setSelectedIndex:m,filteredCommands:p,filteredGroups:b,listRef:x,views:y,filter:k,...I})=>{if(!e)return null;const T=d.useCallback(E=>{E.disabled||(E.onSelect(),o(!1),h(""))},[o,h]),C=d.useCallback(E=>E.target===E.currentTarget&&o(!1),[o]),w=d.useMemo(()=>({search:u,setSearch:h,selectedIndex:f,setSelectedIndex:m,filteredCommands:p,onSelect:T}),[u,f,p,T,h,m]),j=t.length>0,z=p.length===0;return r.jsx(i.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:C,...I,children:r.jsx(xf,{value:w,children:r.jsxs(i.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...of[a],...tf[c],...y==null?void 0:y.container,onClick:E=>E.stopPropagation(),children:[r.jsx(_a,{value:u,onValueChange:h,placeholder:l,views:y==null?void 0:y.searchInput}),r.jsx(i.View,{ref:x,flex:1,overflow:"auto",...y==null?void 0:y.list,children:z?g||r.jsx(Ha,{views:y==null?void 0:y.empty}):j?b.map(E=>r.jsx($a,{heading:E.name,views:y==null?void 0:y.groupHeading,children:E.commands.map(P=>{const H=p.findIndex(S=>S.id===P.id);return r.jsx(qt,{item:P,selected:H===f,onSelect:()=>T(P),"data-index":H,views:{container:y==null?void 0:y.item,icon:y==null?void 0:y.icon,content:y==null?void 0:y.content,name:y==null?void 0:y.name,description:y==null?void 0:y.description,shortcut:y==null?void 0:y.shortcut}},P.id)})},E.id)):p.map((E,P)=>r.jsx(qt,{item:E,selected:P===f,onSelect:()=>T(E),"data-index":P,views:{container:y==null?void 0:y.item,icon:y==null?void 0:y.icon,content:y==null?void 0:y.content,name:y==null?void 0:y.name,description:y==null?void 0:y.description,shortcut:y==null?void 0:y.shortcut}},E.id))}),s&&r.jsx(i.View,{...bf,...y==null?void 0:y.footer,children:s})]})})})},oo=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:l,size:a="md",variant:c="default",filter:g,emptyState:s,footer:u,views:h,...f})=>{const{search:m,setSearch:p,selectedIndex:b,setSelectedIndex:x,filteredCommands:y,filteredGroups:k,listRef:I}=ef({open:e,onOpenChange:o,groups:t,commands:n,filter:g});return r.jsx(Cf,{open:e,onOpenChange:o,groups:t,commands:n,placeholder:l,size:a,variant:c,emptyState:s,footer:u,search:m,setSearch:p,selectedIndex:b,setSelectedIndex:x,filteredCommands:y,filteredGroups:k,listRef:I,views:h,...f})};oo.Input=_a,oo.List=kf,oo.Group=$a,oo.Item=qt,oo.Empty=Ha;const Ba=()=>Math.random().toString(36).substring(2,11),wf=({defaultOpen:e=!1,openDelay:o=200,closeDelay:t=200,isDisabled:n=!1}={})=>{const[l,a]=d.useState(e),c=d.useRef(null),g=d.useRef(null),s=d.useRef(null),u=d.useRef(null),h=d.useRef(`tooltip-trigger-${Ba()}`).current,f=d.useRef(`tooltip-content-${Ba()}`).current,m=d.useCallback(()=>{n||(u.current&&(clearTimeout(u.current),u.current=null),!l&&!s.current&&(s.current=setTimeout(()=>{a(!0),s.current=null},o)))},[l,o,n]),p=d.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),l&&!u.current&&(u.current=setTimeout(()=>{a(!1),u.current=null},t))},[l,t]),b=d.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]);return d.useEffect(()=>()=>{s.current&&clearTimeout(s.current),u.current&&clearTimeout(u.current)},[]),d.useEffect(()=>{const x=y=>{y.key==="Escape"&&l&&a(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[l]),{isOpen:l,openTooltip:m,closeTooltip:p,cancelCloseTimer:b,triggerRef:c,contentRef:g,triggerId:h,contentId:f}},If={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},Tf=(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"}}))(),jf=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}},La=d.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Nt=()=>d.useContext(La),Sf=({value:e,children:o})=>r.jsx(La.Provider,{value:e,children:o}),Aa=d.memo(({children:e,views:o,asChild:t=!1,...n})=>{const{openTooltip:l,closeTooltip:a,triggerRef:c,contentId:g,triggerId:s}=Nt(),u=d.useCallback(()=>l(),[l]),h=d.useCallback(()=>a(),[a]),f=d.useCallback(()=>l(),[l]),m=d.useCallback(()=>a(),[a]),p={ref:c,onMouseEnter:u,onMouseLeave:h,onFocus:f,onBlur:m,id:s,"aria-describedby":g,...o==null?void 0:o.container,...n};return t&&d.isValidElement(e)?d.cloneElement(e,p):r.jsx(i.View,{display:"inline-block",...p,children:e})}),Mf=d.memo(({children:e,views:o,...t})=>{const{isOpen:n,contentRef:l,contentId:a,triggerId:c}=Nt();return n?r.jsx(i.View,{ref:l,id:a,role:"tooltip","aria-labelledby":c,...o==null?void 0:o.container,...t,children:e}):null}),zf=({content:e,children:o,position:t="top",align:n="center",size:l="md",variant:a="default",showArrow:c=!0,views:g,themeMode:s,...u})=>{const{isOpen:h,triggerRef:f,contentRef:m,contentId:p,triggerId:b}=Nt(),{ref:x,relation:y}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[k,I]=d.useState({x:0,y:0,placement:t});d.useEffect(()=>{f!=null&&f.current&&x&&(x.current=f.current)},[f,x,h]),d.useEffect(()=>{if(h&&(m!=null&&m.current)&&(f!=null&&f.current)){const w=f.current.getBoundingClientRect();let j=t;y&&(t==="top"&&y.space.vertical==="bottom"?j="bottom":t==="bottom"&&y.space.vertical==="top"?j="top":t==="right"&&y.space.horizontal==="left"?j="left":t==="left"&&y.space.horizontal==="right"&&(j="right"));let z=0,E=0;switch(j){case"top":z=n==="start"?w.left:n==="end"?w.right-120:w.left+w.width/2-60,E=w.top-8;break;case"bottom":z=n==="start"?w.left:n==="end"?w.right-120:w.left+w.width/2-60,E=w.bottom+8;break;case"right":z=w.right+8,E=n==="start"?w.top:n==="end"?w.bottom-32:w.top+w.height/2-16;break;case"left":z=w.left-8,E=n==="start"?w.top:n==="end"?w.bottom-32:w.top+w.height/2-16;break}I({x:z,y:E,placement:j})}},[h,t,n,f,m,y]);const T=d.useMemo(()=>c?jf(k.placement):{},[c,k.placement]),C=d.useMemo(()=>{const w={position:"fixed",left:k.x,top:k.y,zIndex:1e3};switch(k.placement){case"top":return{...w,transform:"translateY(-100%)"};case"left":return{...w,transform:"translateX(-100%)"};case"bottom":case"right":default:return w}},[k.x,k.y,k.placement]);return r.jsxs(i.View,{position:"relative",display:"inline-block",...g==null?void 0:g.container,...u,children:[r.jsx(Aa,{children:o}),h&&r.jsxs(i.View,{ref:m,id:p,role:"tooltip","aria-labelledby":b,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:C,...If[l],...Tf[a],...g==null?void 0:g.content,children:[typeof e=="string"?r.jsx(i.Text,{...g==null?void 0:g.text,children:e}):e,c&&r.jsx(i.View,{...T,...g==null?void 0:g.arrow})]})]})},Ut=({content:e,children:o,position:t="top",align:n="center",size:l="md",variant:a="default",openDelay:c=200,closeDelay:g=200,showArrow:s=!0,defaultOpen:u=!1,isDisabled:h=!1,views:f,...m})=>{const p=wf({defaultOpen:u,openDelay:c,closeDelay:g,isDisabled:h});return r.jsx(Sf,{value:p,children:r.jsx(zf,{content:e,position:t,align:n,size:l,variant:a,showArrow:s,views:f,...m,children:o})})};Ut.Trigger=Aa,Ut.Content=Mf;const Da=d.forwardRef((e,o)=>{const t=pn(e);return r.jsx(wn,{...e,...t})});Da.displayName="ChatInput";const Vf={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},Fa={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%"}},Gt={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}},Yt={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}},Oa={"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"},ot={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"},Ef={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"}]},Pf=(e,o,t,n,l)=>{const a=o.map(c=>`${c.color} ${c.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${t&&Oa[t]?Oa[t]:t||"to right"}, ${a})`;case"radial":const g=l&&ot[l]?ot[l]:l||"center";return`radial-gradient(${n||"circle"} at ${g}, ${a})`;case"conic":return`conic-gradient(from 0deg at ${l&&ot[l]?ot[l]:l||"center"}, ${a})`;default:return`linear-gradient(to right, ${a})`}},Wf={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)"}}}},qa={container:{position:"relative",overflow:"hidden",borderRadius:"8px",transition:"all 0.2s ease"},content:{position:"relative",zIndex:1,width:"100%",height:"100%",padding:"16px"}},_f=({type:e="linear",direction:o="to-right",shape:t="circle",position:n="center",from:l,to:a,colors:c,animate:g=!1,animationDuration:s=3,children:u,views:h,themeMode:f,...m})=>{const p=d.useMemo(()=>c&&c.length>0?c:l&&a?[{color:l,position:"0%"},{color:a,position:"100%"}]:Ef[e],[c,l,a,e]),b=d.useMemo(()=>{const y=p.map(k=>({...k,color:k.color}));return Pf(e,y,o,t,n)},[e,p,o,t,n]),x=d.useMemo(()=>{if(!g)return{};const y=Wf[e];return{...y,transition:y.transition.replace("3s",`${s}s`),animationDuration:`${s}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[g,s,e]);return r.jsx(i.View,{background:b,...qa.container,...x,...h==null?void 0:h.container,...m,children:u&&r.jsx(i.View,{...qa.content,...h==null?void 0:h.content,children:u})})},$f=e=>r.jsx(_f,{...e}),Hf=d.createContext({}),Bf=({children:e,showRadialGradient:o=!0,views:t,themeMode:n,...l})=>{const a={white:"rgba(255,255,255,1)",transparent:"rgba(255,255,255,0)"},c=["rgb(59, 130, 246)","rgb(196, 181, 253)","rgb(147, 197, 253)","rgb(221, 214, 254)","rgb(96, 165, 250)"],g={...Fa.gradient,backgroundImage:`
|
|
29
29
|
repeating-linear-gradient(100deg, ${c.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(i.View,{...
|
|
31
|
+
`,animation:"aurora 4s ease infinite",...o?{maskImage:"radial-gradient(ellipse at 100% 0%, black 10%, transparent 70%)"}:{}};return r.jsxs(i.View,{...Fa.container,...t==null?void 0:t.container,...l,children:[r.jsx(i.View,{style:g}),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
|
-
`})]})},Af=({number:e=20,children:o,...t})=>{const n=Array.from({length:e},(l,a)=>a);return r.jsxs(i.View,{width:"100%",height:"100%",backgroundColor:"black",position:"relative",overflow:"hidden",...t,children:[n.map(l=>{const a=l*37%200-100+"px",c=.2+l*13%6*.1+"s",d=(1+l*7%9)/2+"s",s=300+l*17%100+"px";return r.jsx(i.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:c},children:r.jsx(i.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)"})},l)}),o&&r.jsx(i.View,{position:"relative",zIndex:1,width:"100%",height:"100%",children:o})]})},Ua=["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)"],Df=()=>Ua[Math.floor(Math.random()*Ua.length)],Ff=({rows:e=15,cols:o=10,squareSize:t=40,...n})=>{const l=Array(e).fill(1),a=Array(o).fill(1);return r.jsx(i.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:l.map((c,d)=>r.jsx(i.Horizontal,{gap:0,children:a.map((s,u)=>r.jsx(i.View,{height:t/3,width:t,borderStyle:"solid",borderColor:"color-gray-200",borderWidth:.5,backgroundColor:"transparent",cursor:"pointer",on:{hover:{backgroundColor:Df(),transition:"background-color 0.2s ease"}}},`col-${u}`))},`row-${d}`))})},Of=["rgb(59, 130, 246)","rgb(147, 51, 234)","rgb(236, 72, 153)","rgb(34, 197, 94)","rgb(251, 146, 60)","rgb(168, 85, 247)"],qf=({count:e=50,colors:o=Of,speed:t="medium",shapes:n=["circle"],...l})=>{const a=Array.from({length:e},(u,h)=>h),c=()=>{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(i.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...l,children:a.map(u=>{const h=Math.random()*8+4,f=Math.random()*400,m=Math.random()*300,p=Math.random()*400,b=Math.random()*300,x=(Math.random()*10+5)/c(),y=Math.random()*5,k=d(),w=s(),T={circle:{borderRadius:"50%"},square:{borderRadius:"2px"},triangle:{borderRadius:"0",clipPath:"polygon(50% 0%, 0% 100%, 100% 100%)"}};return r.jsx(i.View,{position:"absolute",width:h,height:h,backgroundColor:w,opacity:.7,style:{left:f,top:m,...T[k]},animate:{from:{transform:"translate(0px, 0px) scale(0.5)",opacity:0},to:{transform:`translate(${p-f}px, ${b-m}px) scale(1)`,opacity:.7},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${x}s`,delay:`${y}s`}},u)})})},Nf=({gridSize:e=30,lineColor:o="rgba(59, 130, 246, 0.3)",pulseColor:t="rgba(59, 130, 246, 0.8)",animationSpeed:n="medium",...l})=>{const a=()=>{switch(n){case"slow":return 4;case"fast":return 1;default:return 2}},c=Math.floor(400/e),d=Math.floor(300/e),s=c*d,u=Array.from({length:s},(h,f)=>f);return r.jsxs(i.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...l,children:[Array.from({length:c+1},(h,f)=>r.jsx(i.View,{position:"absolute",left:f*e,top:0,width:1,height:"100%",backgroundColor:o},`v-line-${f}`)),Array.from({length:d+1},(h,f)=>r.jsx(i.View,{position:"absolute",left:0,top:f*e,width:"100%",height:1,backgroundColor:o},`h-line-${f}`)),u.map(h=>{const f=h%c,m=Math.floor(h/c),p=(f+m)*.1;return r.jsx(i.View,{position:"absolute",left:f*e+1,top:m*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:`${p}s`}},h)})]})},Uf=["rgba(59, 130, 246, 0.6)","rgba(147, 51, 234, 0.6)","rgba(236, 72, 153, 0.6)","rgba(34, 197, 94, 0.6)"],Gf=({rippleCount:e=5,colors:o=Uf,maxSize:t=200,frequency:n=3,...l})=>{const a=Array.from({length:e},(c,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(i.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-100",...l,children:[a.map(c=>r.jsx(i.View,{position:"absolute",width:20,height:20,borderRadius:"50%",style:{left:c.x-10,top:c.y-10,border:`2px solid ${c.color}`,backgroundColor:"transparent"},animate:{from:{transform:"scale(0)",opacity:1},to:{transform:`scale(${t/20})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${c.duration}s`,delay:`${c.delay}s`}},c.id)),a.map(c=>r.jsx(i.View,{position:"absolute",width:10,height:10,borderRadius:"50%",style:{left:c.x-5,top:c.y-5,backgroundColor:c.color},animate:{from:{transform:"scale(1)",opacity:.8},to:{transform:`scale(${t/40})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${c.duration*1.2}s`,delay:`${c.delay+.5}s`}},`secondary-${c.id}`))]})},Yf=({children:e,src:o,backgroundSize:t="cover",backgroundPosition:n="center",backgroundRepeat:l="no-repeat",backgroundAttachment:a="scroll",imageOpacity:c=1,overlay:d=null,blendMode:s="normal",views:u,themeMode:h,...f})=>{const m={...Yt.image,backgroundImage:`url(${o})`,backgroundSize:t,backgroundPosition:n,backgroundRepeat:l,backgroundAttachment:a,opacity:c};return r.jsxs(i.View,{...Yt.container,...u==null?void 0:u.container,...f,children:[r.jsx(i.View,{style:m,...u==null?void 0:u.image}),d,e&&r.jsx(i.View,{...Yt.content,...u==null?void 0:u.content,children:e})]})},vf=({children:e,src:o,autoPlay:t=!0,loop:n=!0,muted:l=!0,playsInline:a=!0,overlay:c=null,blendMode:d="normal",views:s,themeMode:u,...h})=>r.jsxs(i.View,{...vt.container,...s==null?void 0:s.container,...h,children:[r.jsx(i.View,{as:"video",src:o,autoPlay:t,loop:n,muted:l,playsInline:a,style:vt.video,...s==null?void 0:s.video}),c,e&&r.jsx(i.View,{...vt.content,...s==null?void 0:s.content,children:e})]}),Xf=({children:e,...o})=>r.jsx(Hf,{...o,children:e}),Kf=({contentPosition:e,backgroundColor:o="color-black-900",...t})=>{const l=(()=>{let a=`${o}-100`,c=`${o}-900`,d=`${o}-600`,s=`${o}-400`;switch(o.indexOf("-")===-1&&(a=`color-mix(in srgb, ${o} 10%, transparent)`,c=`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, ${c} 0%, ${d} 65%, ${a} 100%)`;case"right":return`radial-gradient(circle at 30% 50%, ${a} 0%, ${a} 100%), linear-gradient(to left, ${c} 0%, ${d} 65%, ${a} 100%)`;case"top":return`radial-gradient(circle at 50% 40%, ${a} 0%, ${a} 100%), linear-gradient(to bottom, ${c} 0%, ${d} 60%, ${a} 100%)`;case"bottom":return`radial-gradient(circle at 50% 60%, ${a} 0%, ${a} 100%), linear-gradient(to top, ${c} 0%, ${d} 60%, ${a} 100%)`;case"center":return`radial-gradient(circle at 50% 70%, ${c} 0%, ${a} 100%)`;default:return s}})();return r.jsx(i.View,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:l,pointerEvents:"none",zIndex:1,...t})},Qf=({children:e,views:o,...t})=>r.jsx(Bf.Provider,{value:{},children:r.jsx(i.View,{...Ef.container,...o==null?void 0:o.container,...t,children:e})}),Ga=g.forwardRef(({children:e,designProps:o,shape:t="rounded",decorationRotation:n=5,decorationScale:l=1,decorationOpacity:a=.8,views:c,...d},s)=>{const h=(y=>{switch(y){case"square":return"0px";case"pill":return"9999px";case"rounded":default:return"16px"}})(t),f=Math.abs(n)*(Math.PI/180),m=Math.sin(f)*100,p=(l-1)*100/2,b=Math.ceil(m+p),x=d.backgroundColor??"theme-primary";return r.jsx(i.View,{...d,ref:s,backgroundColor:"transparent",position:"relative",overflow:"visible",...c==null?void 0:c.container,children:r.jsxs(i.View,{padding:d.padding??`${96+b}px ${b}px`,position:"relative",overflow:"visible",children:[r.jsx(i.View,{position:"absolute",top:b,left:b,right:b,bottom:b,backgroundColor:x,borderRadius:h,opacity:a/1.5,transform:`scale(${l})`,pointerEvents:"none",zIndex:1,...c==null?void 0:c.back}),r.jsx(i.View,{position:"absolute",top:b,left:b,right:b,bottom:b,transform:`rotate(${n}deg) scale(${l})`,opacity:a/1.2,backgroundColor:x,borderRadius:h,pointerEvents:"none",zIndex:2,...c==null?void 0:c.front}),r.jsx(i.View,{margin:"0 auto",position:"relative",zIndex:3,...c==null?void 0:c.content,children:e})]})})});Ga.displayName="Background.Layout";const ce=Qf;ce.Aurora=Lf,ce.Meteors=Af,ce.Wall=Ff,ce.Particles=qf,ce.Grid=Nf,ce.Ripples=Gf,ce.Image=Yf,ce.Video=vf,ce.Gradient=Xf,ce.Overlay=Kf,ce.Layout=Ga;const Ya=g.forwardRef((e,o)=>r.jsx(ce,{...e,ref:o}));Ya.displayName="Background";const va=Object.assign(Ya,{Layout:ce.Layout,Aurora:ce.Aurora,Meteors:ce.Meteors,Wall:ce.Wall,Particles:ce.Particles,Grid:ce.Grid,Ripples:ce.Ripples,Image:ce.Image,Video:ce.Video,Gradient:ce.Gradient,Overlay:ce.Overlay});va.displayName="Background";function Zf(e){const{inputValue:o,onInputChange:t,onSubmit:n,messages:l=[]}=e,[a,c]=g.useState(""),d=g.useRef(null),s=g.useRef(null),u=o!==void 0,h=o!==void 0?o:a,f=g.useCallback(p=>{u?t==null||t(p):c(p)},[u,t]),m=g.useCallback(p=>{p&&p.preventDefault();const b=h.trim();b&&n&&(n(b),u||c(""),d.current&&(d.current.style.height="auto"))},[h,n,u]);return g.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[l.length]),{internalInputValue:h,handleInputChange:f,handleSubmit:m,inputRef:d,messagesRef:s}}const Jf={sm:{fontSize:"13px",padding:"8px"},md:{fontSize:"14px",padding:"12px"},lg:{fontSize:"16px",padding:"16px"}},Rf={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"}},e0={sm:{fontSize:"13px",padding:"6px 10px",borderRadius:"14px"},md:{fontSize:"14px",padding:"8px 12px",borderRadius:"16px"},lg:{fontSize:"16px",padding:"10px 16px",borderRadius:"18px"}},o0={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)"},t0={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)"},je={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:{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"},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}},r0=({messages:e=[],inputPlaceholder:o="Type a message...",disableInput:t=!1,variant:n="default",size:l="md",showTimestamps:a=!0,enableAttachments:c=!1,enableContextPicker:d=!1,selectedContextElements:s=[],onContextPickerClick:u,onRemoveContextElement:h,isLoading:f=!1,loadingText:m="Loading...",styles:p={},maxHeight:b="600px",internalInputValue:x,handleInputChange:y,handleSubmit:k,inputRef:w,messagesRef:T,...C})=>{var E;const I={...je.container,...Rf[n],...p.container},j={...je.messagesContainer,maxHeight:b,...p.messagesContainer},z={...je.inputContainer,...p.inputContainer},V={...je.input,...Jf[l],...p.input},W=g.useCallback(P=>{y(P.target.value),P.target.style.height="auto",P.target.style.height=`${P.target.scrollHeight}px`},[y]),H=g.useCallback(P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),k())},[k]),S=x.trim().length>0,{onSubmit:B,...A}=C;return r.jsxs(i.View,{...I,...A,children:[r.jsxs(i.View,{ref:T,...j,children:[e.length===0?r.jsx(i.View,{display:"flex",alignItems:"center",justifyContent:"center",flex:1,color:"color-gray-400",children:r.jsx(i.Text,{fontSize:"14px",children:"No messages yet. Start a conversation!"})}):e.map(P=>r.jsx(n0,{message:P,size:l,showTimestamp:a,styles:{bubble:p.bubble,userBubble:p.userBubble,assistantBubble:p.assistantBubble,timestamp:p.timestamp,reasoningContainer:p.reasoningContainer,reasoningContent:p.reasoningContent,errorMessage:p.errorMessage,systemMessage:p.systemMessage,toolMessage:p.toolMessage}},P.id)),f&&r.jsxs(i.Horizontal,{justifyContent:"flex-start",alignItems:"center",gap:8,marginTop:"8px",...p.loadingIndicator,children:[r.jsx(dt,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(i.Text,{color:"color-gray-500",fontSize:"14px",children:m})]})]}),r.jsxs(i.View,{children:[s.length>0&&r.jsx(i.Horizontal,{gap:8,marginBottom:"8px",flexWrap:"wrap",paddingHorizontal:"20px",...p.contextChipsContainer,children:s.map(P=>r.jsxs(i.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(i.Text,{fontSize:"12px",color:"color-blue-700",fontWeight:"500",children:P.name}),r.jsx(i.View,{as:"button",type:"button",onClick:()=>h==null?void 0:h(P.id),cursor:"pointer",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",children:r.jsx(pe,{widthHeight:12,color:"color-blue-700"})})]},P.id))}),r.jsxs(i.View,{as:"form",onSubmit:k,...z,children:[c&&r.jsx(i.View,{as:"button",type:"button",...je.attachmentButton,...p.attachmentButton,_hover:{backgroundColor:"color-gray-100"},children:r.jsx(ro,{widthHeight:16,color:"color-gray-600"})}),r.jsx(i.View,{as:"textarea",ref:w,value:x,onChange:W,onKeyDown:H,placeholder:o,disabled:t||f,...V,style:{...V,opacity:t||f?.5:1}}),r.jsxs(i.Vertical,{gap:4,alignItems:"center",children:[d&&r.jsx(i.View,{as:"button",type:"button",onClick:u,...je.attachmentButton,...p.contextPickerButton,_hover:{backgroundColor:"color-gray-100",...(E=p.contextPickerButton)==null?void 0:E._hover},title:"Select element from page",children:r.jsx(ar,{widthHeight:16,color:"color-gray-600"})}),r.jsx(i.View,{as:"button",type:"submit",disabled:!S||t||f,...je.sendButton,backgroundColor:S?"theme-primary":"color-gray-300",_hover:{backgroundColor:S?"color-blue-600":"color-gray-300"},...p.sendButton,style:{cursor:S?"pointer":"not-allowed",opacity:!S||t||f?.6:1},children:r.jsx(st,{widthHeight:16,color:"color-white",filled:!1})})]})]})]})]})},n0=({message:e,size:o,showTimestamp:t,styles:n})=>{const[l,a]=g.useState(!1),[c,d]=g.useState(!1),s=e.role==="user",u=e.messageType==="system",h=e.messageType==="error",f=e.messageType==="tool";if(u)return r.jsx(i.View,{display:"flex",justifyContent:"center",padding:"8px",width:"100%",...n.systemMessage,children:r.jsxs(i.Horizontal,{gap:6,alignItems:"center",opacity:.7,children:[r.jsx(Se,{widthHeight:12,color:"color-gray-600"}),r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.content})]})});if(f)return r.jsx(i.View,{display:"flex",justifyContent:"flex-start",padding:"8px 16px",width:"100%",...n.toolMessage,children:r.jsxs(i.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(or,{widthHeight:14,color:"color-gray-600"}),r.jsxs(i.Vertical,{gap:2,children:[r.jsx(i.Text,{fontSize:"11px",fontWeight:"600",color:"color-gray-700",children:"Tool Usage"}),r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",fontFamily:"monospace",children:e.content})]})]})});const m={...je.bubble,...e0[o],...s?o0:t0,...h?{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,...h?n.errorMessage:{}},p={...je.timestamp,[s?"right":"left"]:"8px",opacity:l?1:0,...n.timestamp};return r.jsx(i.View,{position:"relative",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),display:"flex",justifyContent:s?"flex-end":"flex-start",children:r.jsxs(i.View,{...m,children:[t&&r.jsx(i.View,{...p,children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),h&&r.jsxs(i.Horizontal,{gap:6,marginBottom:"4px",alignItems:"center",children:[r.jsx(Eo,{widthHeight:14,color:"#b91c1c"}),r.jsx(i.Text,{fontWeight:"600",fontSize:"12px",children:"Error"})]}),e.reasoning&&r.jsxs(i.View,{marginBottom:"8px",borderBottom:"1px solid rgba(0,0,0,0.05)",paddingBottom:"8px",...n.reasoningContainer,children:[r.jsxs(i.Horizontal,{as:"button",onClick:()=>d(!c),cursor:"pointer",gap:4,alignItems:"center",backgroundColor:"transparent",border:"none",padding:0,children:[r.jsx(i.Text,{fontSize:"11px",color:"color-gray-500",fontWeight:"600",children:"Thinking Process"}),r.jsx(le,{orientation:c?"down":"right",widthHeight:10,color:"color-gray-500"})]}),c&&r.jsx(i.View,{padding:"8px",backgroundColor:"rgba(0,0,0,0.03)",borderRadius:"8px",marginTop:"4px",...n.reasoningContent,children:r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.reasoning})})]}),r.jsx(i.View,{whiteSpace:"pre-wrap",wordBreak:"break-word",children:e.content}),e.attachments&&e.attachments.length>0&&r.jsx(i.Vertical,{gap:4,marginTop:"8px",children:e.attachments.map(b=>r.jsxs(i.Horizontal,{gap:6,padding:"6px 8px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",fontSize:"12px",children:[r.jsx(ro,{widthHeight:14}),r.jsx(i.Text,{children:b.name})]},b.id))}),e.contextElements&&e.contextElements.length>0&&r.jsxs(i.Vertical,{gap:4,marginTop:"8px",children:[r.jsx(i.Text,{fontSize:"11px",color:"rgba(0,0,0,0.5)",fontWeight:"600",children:"Context:"}),e.contextElements.map(b=>r.jsx(i.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(i.Text,{color:"color-blue-700",fontWeight:"500",children:b.name})},b.id))]})]})})},Xt=e=>{const o=Zf(e);return r.jsx(r0,{...e,...o})};Xt.displayName="ChatWidget";const Xa=Xt;function a0({onSelect:e,onCancel:o,active:t}){const[n,l]=g.useState(null);g.useRef(null);const a=g.useCallback(s=>{var p;if(!t)return;const u=document.elementFromPoint(s.clientX,s.clientY);if(!u||u===document.body||u.closest('[data-chatwidget-ignore="true"]')||u.closest("#chatwidget-overlay")){l(null);return}const h=u.getBoundingClientRect();let f=u.tagName.toLowerCase();if(u.id)f+=`#${u.id}`;else if(u.className&&typeof u.className=="string"){const b=u.className.split(" ")[0];b&&(f+=`.${b}`)}const m=(p=u.innerText)==null?void 0:p.slice(0,20);m&&(f+=` ("${m}...")`),l({id:u.id||`el-${Date.now()}`,name:f,tagName:u.tagName.toLowerCase(),rect:h})},[t]),c=g.useCallback(s=>{!t||s.target.closest('[data-chatwidget-ignore="true"]')||(s.preventDefault(),s.stopPropagation(),n&&e(n))},[t,n,e]),d=g.useCallback(s=>{t&&s.key==="Escape"&&o()},[t,o]);return g.useEffect(()=>(t?(document.addEventListener("mousemove",a),document.addEventListener("click",c,!0),document.addEventListener("keydown",d),document.body.style.cursor="crosshair"):(l(null),document.removeEventListener("mousemove",a),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""),()=>{document.removeEventListener("mousemove",a),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""}),[t,a,c,d]),{highlightedElement:n}}function l0({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 c0=({initialMessages:e=[],onSendMessage:o,bubbleSize:t="md"})=>{const[n,l]=g.useState(!1),[a,c]=g.useState(!1),[d,s]=g.useState(e),[u,h]=g.useState([]),{highlightedElement:f}=a0({active:a,onSelect:y=>{h(k=>[...k,y]),c(!1),l(!0)},onCancel:()=>{c(!1),l(!0)}}),m=()=>l(!n),p=()=>{c(!0),l(!1)},b=y=>{h(k=>k.filter(w=>w.id!==y))},x=y=>{const k={id:Date.now().toString(),role:"user",content:y,timestamp:new Date,contextElements:[...u]};s(w=>[...w,k]),o==null||o(y,u),h([]),setTimeout(()=>{var I;const w=Math.random()>.7,T=Math.random()>.4,C={id:(Date.now()+1).toString(),role:"assistant",timestamp:new Date,content:w?"I will highlight the selected element.":`I received your message regarding: ${((I=k.contextElements)==null?void 0:I.map(j=>j.name).join(", "))||"general context"}. How can I assist you further?`,messageType:w?"tool":"text",reasoning:T?"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(j=>[...j,C]),w&&setTimeout(()=>{s(j=>[...j,{id:(Date.now()+2).toString(),role:"assistant",messageType:"system",content:'Tool "highlightElement" executed successfully.',timestamp:new Date}])},800)},1e3)};return r.jsxs(i.View,{position:"fixed",bottom:24,right:24,zIndex:9999,children:[r.jsx(l0,{element:f}),a&&r.jsx(i.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(i.Text,{fontWeight:"600",fontSize:"14px",children:"Click an element to select it. Press ESC to cancel."})}),n&&r.jsxs(i.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(i.View,{padding:"16px",borderBottom:"1px solid rgba(0,0,0,0.05)",display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(i.Text,{fontWeight:"bold",color:"color-gray-800",children:"ChatWidget Assistant"}),r.jsx(i.View,{as:"button",onClick:()=>l(!1),cursor:"pointer",padding:"4px",borderRadius:"50%",border:"none",backgroundColor:"transparent",_hover:{backgroundColor:"rgba(0,0,0,0.05)"},children:r.jsx(pe,{widthHeight:16,color:"color-gray-500"})})]}),r.jsx(Xa,{messages:d,onSubmit:x,size:t,variant:"minimal",enableContextPicker:!0,selectedContextElements:u,onContextPickerClick:p,onRemoveContextElement:b,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(i.View,{as:"button",onClick:m,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(pe,{widthHeight:24,color:"white"}):r.jsx(nr,{widthHeight:24,color:"white"})})]})};M.Accordion=Io,M.Alert=Ic,M.ArrowIcon=mc,M.AspectRatio=jc,M.AttachmentGroup=ia,M.AttachmentIcon=ro,M.AttachmentPreview=Qg,M.AudioIcon=jo,M.AudioInput=Hc,M.AudioWaveform=mt,M.Avatar=Dc,M.BackIcon=Dl,M.Background=va,M.Badge=Gc,M.BatteryIcon=Il,M.BluetoothIcon=gc,M.BoldArrowIcon=fc,M.BookmarkIcon=Tl,M.Button=_e,M.CalendarIcon=oc,M.CameraIcon=dc,M.Card=$o,M.Carousel=Oe,M.Chart=_i,M.ChartIcon=Bl,M.ChatInput=Fa,M.ChatWidget=Xa,M.ChatWidgetComponent=Xt,M.ChatWidgetWidget=c0,M.CheckIcon=Al,M.Checkbox=ps,M.ChevronIcon=le,M.ClockIcon=tc,M.CloseEyeIcon=gt,M.CloseIcon=pe,M.CloudIcon=jl,M.ColorInput=Cs,M.ColorPicker=th,M.ComboBox=Nd,M.Command=oo,M.ContextMenu=Ne,M.CookieConsent=Li,M.CopyIcon=Sl,M.CountryPicker=Ms,M.CreditCardIcon=Zl,M.CropIcon=yc,M.DatePicker=Bd,M.DeleteIcon=Ml,M.Divider=kh,M.DocumentIcon=Hl,M.DownloadIcon=El,M.DragAndDrop=Du,M.DragAndDropComponent=ca,M.DragHandleIcon=sl,M.DragHandleLinesIcon=kc,M.Drawer=Ke,M.DropZone=Nu,M.DropdownMenu=bo,M.DustBinIcon=So,M.EditIcon=zl,M.EmojiPicker=rh,M.ErrorIcon=Eo,M.ExternalLinkIcon=rr,M.FacebookIcon=bl,M.FileIcon=to,M.FileImage=Ui,M.FileSVG=Ni,M.FilterIcon=ec,M.FolderIcon=il,M.FormikChatInput=yg,M.FormikCheckbox=Rd,M.FormikColorInput=xg,M.FormikComboBox=zg,M.FormikCountryPicker=Cg,M.FormikDatePicker=kg,M.FormikEmojiPicker=Kg,M.FormikForm=Zd,M.FormikIconPicker=Ng,M.FormikOTPInput=_g,M.FormikPassword=Mg,M.FormikRadio=lg,M.FormikSelect=wg,M.FormikSelector=Hg,M.FormikSlider=Wg,M.FormikSwitch=Ig,M.FormikTagInput=Tg,M.FormikTextArea=jg,M.FormikTextField=Sg,M.FormikToggle=Ag,M.FormikToggleGroup=Dg,M.FormikUploader=En,M.GiftIcon=Ul,M.HeartIcon=kl,M.HelpIcon=cl,M.HomeIcon=Vl,M.HoverCard=be,M.Icon=To,M.IconPicker=nh,M.ImageIcon=gl,M.InfoIcon=Se,M.InstagramIcon=ml,M.LayoutIcon=Kl,M.LikeIcon=sc,M.Link=gr,M.LinkIcon=Xl,M.LinkedinIcon=yl,M.Loader=no,M.LoadingSpinnerIcon=dt,M.LockIcon=Wl,M.LogoutIcon=Yl,M.MagicWandIcon=cc,M.MapPinIcon=rc,M.MediaPreview=Jg,M.MenuIcon=nc,M.Menubar=De,M.MessageLayout=Vc,M.MessageView=ir,M.MicrophoneIcon=it,M.MinusIcon=Rt,M.Modal=Ae,M.MoonIcon=Ll,M.MoreIcon=Jl,M.MousePointerIcon=ar,M.NavigationMenu=Ze,M.NotificationIcon=$l,M.OTPInput=Kd,M.OpenEyeIcon=ut,M.Pagination=hh,M.PanelIcon=nr,M.Password=Ld,M.PauseIcon=er,M.PlayIcon=lt,M.PlusIcon=Pl,M.PowerOffIcon=vl,M.PrintIcon=lc,M.ProfileIcon=_l,M.ProgressBar=mh,M.RefreshIcon=ac,M.Resizable=qt,M.RotateIcon=Nl,M.SaveIcon=wl,M.SearchIcon=zo,M.Select=as,M.Selector=gs,M.SendIcon=st,M.Separator=xh,M.SettingsIcon=or,M.ShapeIcon=ql,M.ShareButton=Sh,M.ShareIcon=tr,M.ShieldIcon=Gl,M.Sidebar=Co,M.Slider=Zg,M.SliderIcon=bc,M.SpinnerIcon=pc,M.StarIcon=Cl,M.StatusIndicator=zh,M.StopIcon=Mo,M.SuccessIcon=ht,M.Switch=ds,M.Table=we,M.Tabs=Xo,M.TagInput=Gd,M.TextArea=us,M.TextField=uo,M.TextIcon=Ol,M.ThreadsIcon=xl,M.TickIcon=Vo,M.Title=Hu,M.Toast=Rh,M.Toggle=$n,M.ToggleGroup=Bu,M.Tooltip=Gt,M.TrashIcon=Rl,M.TwitchIcon=fl,M.TwitterIcon=ul,M.UnLikeIcon=ic,M.UnlockIcon=uc,M.UploadIcon=ft,M.Uploader=Wo,M.UserIcon=ll,M.VideoIcon=dl,M.WarningIcon=ct,M.WifiIcon=hc,M.XIcon=hl,M.YoutubeIcon=pl,M.ZapIcon=Ql,M.ZoomInIcon=xc,M.ZoomOutIcon=Fl,M.hideMessage=cr,M.hideModal=_t,M.showMessage=lr,M.showModal=Rg,M.showToast=Fe,M.useMessageStore=Po,M.useModalStore=Ee,M.useToast=ef,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
37
|
+
`})]})},Lf=({number:e=20,children:o,...t})=>{const n=Array.from({length:e},(l,a)=>a);return r.jsxs(i.View,{width:"100%",height:"100%",backgroundColor:"black",position:"relative",overflow:"hidden",...t,children:[n.map(l=>{const a=l*37%200-100+"px",c=.2+l*13%6*.1+"s",g=(1+l*7%9)/2+"s",s=300+l*17%100+"px";return r.jsx(i.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:g,delay:c},children:r.jsx(i.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)"})},l)}),o&&r.jsx(i.View,{position:"relative",zIndex:1,width:"100%",height:"100%",children:o})]})},Na=["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)"],Af=()=>Na[Math.floor(Math.random()*Na.length)],Df=({rows:e=15,cols:o=10,squareSize:t=40,...n})=>{const l=Array(e).fill(1),a=Array(o).fill(1);return r.jsx(i.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:l.map((c,g)=>r.jsx(i.Horizontal,{gap:0,children:a.map((s,u)=>r.jsx(i.View,{height:t/3,width:t,borderStyle:"solid",borderColor:"color-gray-200",borderWidth:.5,backgroundColor:"transparent",cursor:"pointer",on:{hover:{backgroundColor:Af(),transition:"background-color 0.2s ease"}}},`col-${u}`))},`row-${g}`))})},Ff=["rgb(59, 130, 246)","rgb(147, 51, 234)","rgb(236, 72, 153)","rgb(34, 197, 94)","rgb(251, 146, 60)","rgb(168, 85, 247)"],Of=({count:e=50,colors:o=Ff,speed:t="medium",shapes:n=["circle"],...l})=>{const a=Array.from({length:e},(u,h)=>h),c=()=>{switch(t){case"slow":return .5;case"fast":return 2;default:return 1}},g=()=>n[Math.floor(Math.random()*n.length)],s=()=>o[Math.floor(Math.random()*o.length)];return r.jsx(i.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...l,children:a.map(u=>{const h=Math.random()*8+4,f=Math.random()*400,m=Math.random()*300,p=Math.random()*400,b=Math.random()*300,x=(Math.random()*10+5)/c(),y=Math.random()*5,k=g(),I=s(),T={circle:{borderRadius:"50%"},square:{borderRadius:"2px"},triangle:{borderRadius:"0",clipPath:"polygon(50% 0%, 0% 100%, 100% 100%)"}};return r.jsx(i.View,{position:"absolute",width:h,height:h,backgroundColor:I,opacity:.7,style:{left:f,top:m,...T[k]},animate:{from:{transform:"translate(0px, 0px) scale(0.5)",opacity:0},to:{transform:`translate(${p-f}px, ${b-m}px) scale(1)`,opacity:.7},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${x}s`,delay:`${y}s`}},u)})})},qf=({gridSize:e=30,lineColor:o="rgba(59, 130, 246, 0.3)",pulseColor:t="rgba(59, 130, 246, 0.8)",animationSpeed:n="medium",...l})=>{const a=()=>{switch(n){case"slow":return 4;case"fast":return 1;default:return 2}},c=Math.floor(400/e),g=Math.floor(300/e),s=c*g,u=Array.from({length:s},(h,f)=>f);return r.jsxs(i.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...l,children:[Array.from({length:c+1},(h,f)=>r.jsx(i.View,{position:"absolute",left:f*e,top:0,width:1,height:"100%",backgroundColor:o},`v-line-${f}`)),Array.from({length:g+1},(h,f)=>r.jsx(i.View,{position:"absolute",left:0,top:f*e,width:"100%",height:1,backgroundColor:o},`h-line-${f}`)),u.map(h=>{const f=h%c,m=Math.floor(h/c),p=(f+m)*.1;return r.jsx(i.View,{position:"absolute",left:f*e+1,top:m*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:`${p}s`}},h)})]})},Nf=["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=Nf,maxSize:t=200,frequency:n=3,...l})=>{const a=Array.from({length:e},(c,g)=>({id:g,x:Math.random()*400,y:Math.random()*300,color:o[g%o.length],delay:g*(n/e),duration:3+Math.random()*2}));return r.jsxs(i.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-100",...l,children:[a.map(c=>r.jsx(i.View,{position:"absolute",width:20,height:20,borderRadius:"50%",style:{left:c.x-10,top:c.y-10,border:`2px solid ${c.color}`,backgroundColor:"transparent"},animate:{from:{transform:"scale(0)",opacity:1},to:{transform:`scale(${t/20})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${c.duration}s`,delay:`${c.delay}s`}},c.id)),a.map(c=>r.jsx(i.View,{position:"absolute",width:10,height:10,borderRadius:"50%",style:{left:c.x-5,top:c.y-5,backgroundColor:c.color},animate:{from:{transform:"scale(1)",opacity:.8},to:{transform:`scale(${t/40})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${c.duration*1.2}s`,delay:`${c.delay+.5}s`}},`secondary-${c.id}`))]})},Gf=({children:e,src:o,backgroundSize:t="cover",backgroundPosition:n="center",backgroundRepeat:l="no-repeat",backgroundAttachment:a="scroll",imageOpacity:c=1,overlay:g=null,blendMode:s="normal",views:u,themeMode:h,...f})=>{const m={...Gt.image,backgroundImage:`url(${o})`,backgroundSize:t,backgroundPosition:n,backgroundRepeat:l,backgroundAttachment:a,opacity:c};return r.jsxs(i.View,{...Gt.container,...u==null?void 0:u.container,...f,children:[r.jsx(i.View,{style:m,...u==null?void 0:u.image}),g,e&&r.jsx(i.View,{...Gt.content,...u==null?void 0:u.content,children:e})]})},Yf=({children:e,src:o,autoPlay:t=!0,loop:n=!0,muted:l=!0,playsInline:a=!0,overlay:c=null,blendMode:g="normal",views:s,themeMode:u,...h})=>r.jsxs(i.View,{...Yt.container,...s==null?void 0:s.container,...h,children:[r.jsx(i.View,{as:"video",src:o,autoPlay:t,loop:n,muted:l,playsInline:a,style:Yt.video,...s==null?void 0:s.video}),c,e&&r.jsx(i.View,{...Yt.content,...s==null?void 0:s.content,children:e})]}),vf=({children:e,...o})=>r.jsx($f,{...o,children:e}),Xf=({contentPosition:e,backgroundColor:o="color-black-900",...t})=>{const l=(()=>{let a=`${o}-100`,c=`${o}-900`,g=`${o}-600`,s=`${o}-400`;switch(o.indexOf("-")===-1&&(a=`color-mix(in srgb, ${o} 10%, transparent)`,c=`color-mix(in srgb, ${o} 90%, transparent)`,g=`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, ${c} 0%, ${g} 65%, ${a} 100%)`;case"right":return`radial-gradient(circle at 30% 50%, ${a} 0%, ${a} 100%), linear-gradient(to left, ${c} 0%, ${g} 65%, ${a} 100%)`;case"top":return`radial-gradient(circle at 50% 40%, ${a} 0%, ${a} 100%), linear-gradient(to bottom, ${c} 0%, ${g} 60%, ${a} 100%)`;case"bottom":return`radial-gradient(circle at 50% 60%, ${a} 0%, ${a} 100%), linear-gradient(to top, ${c} 0%, ${g} 60%, ${a} 100%)`;case"center":return`radial-gradient(circle at 50% 70%, ${c} 0%, ${a} 100%)`;default:return s}})();return r.jsx(i.View,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:l,pointerEvents:"none",zIndex:1,...t})},Kf=({children:e,views:o,...t})=>r.jsx(Hf.Provider,{value:{},children:r.jsx(i.View,{...Vf.container,...o==null?void 0:o.container,...t,children:e})}),Ua=d.forwardRef(({children:e,designProps:o,shape:t="rounded",decorationRotation:n=5,decorationScale:l=1,decorationOpacity:a=.8,views:c,...g},s)=>{const h=(y=>{switch(y){case"square":return"0px";case"pill":return"9999px";case"rounded":default:return"16px"}})(t),f=Math.abs(n)*(Math.PI/180),m=Math.sin(f)*100,p=(l-1)*100/2,b=Math.ceil(m+p),x=g.backgroundColor??"theme-primary";return r.jsx(i.View,{...g,ref:s,backgroundColor:"transparent",position:"relative",overflow:"visible",...c==null?void 0:c.container,children:r.jsxs(i.View,{padding:g.padding??`${96+b}px ${b}px`,position:"relative",overflow:"visible",children:[r.jsx(i.View,{position:"absolute",top:b,left:b,right:b,bottom:b,backgroundColor:x,borderRadius:h,opacity:a/1.5,transform:`scale(${l})`,pointerEvents:"none",zIndex:1,...c==null?void 0:c.back}),r.jsx(i.View,{position:"absolute",top:b,left:b,right:b,bottom:b,transform:`rotate(${n}deg) scale(${l})`,opacity:a/1.2,backgroundColor:x,borderRadius:h,pointerEvents:"none",zIndex:2,...c==null?void 0:c.front}),r.jsx(i.View,{margin:"0 auto",position:"relative",zIndex:3,...c==null?void 0:c.content,children:e})]})})});Ua.displayName="Background.Layout";const ce=Kf;ce.Aurora=Bf,ce.Meteors=Lf,ce.Wall=Df,ce.Particles=Of,ce.Grid=qf,ce.Ripples=Uf,ce.Image=Gf,ce.Video=Yf,ce.Gradient=vf,ce.Overlay=Xf,ce.Layout=Ua;const Ga=d.forwardRef((e,o)=>r.jsx(ce,{...e,ref:o}));Ga.displayName="Background";const Ya=Object.assign(Ga,{Layout:ce.Layout,Aurora:ce.Aurora,Meteors:ce.Meteors,Wall:ce.Wall,Particles:ce.Particles,Grid:ce.Grid,Ripples:ce.Ripples,Image:ce.Image,Video:ce.Video,Gradient:ce.Gradient,Overlay:ce.Overlay});Ya.displayName="Background";function Qf(e){const{inputValue:o,onInputChange:t,onSubmit:n,messages:l=[]}=e,[a,c]=d.useState(""),g=d.useRef(null),s=d.useRef(null),u=o!==void 0,h=o!==void 0?o:a,f=d.useCallback(p=>{u?t==null||t(p):c(p)},[u,t]),m=d.useCallback(p=>{p&&p.preventDefault();const b=h.trim();b&&n&&(n(b),u||c(""),g.current&&(g.current.style.height="auto"))},[h,n,u]);return d.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[l.length]),{internalInputValue:h,handleInputChange:f,handleSubmit:m,inputRef:g,messagesRef:s}}const Zf={sm:{fontSize:"13px",padding:"8px"},md:{fontSize:"14px",padding:"12px"},lg:{fontSize:"16px",padding:"16px"}},Jf={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"}},Rf={sm:{fontSize:"13px",padding:"6px 10px",borderRadius:"14px"},md:{fontSize:"14px",padding:"8px 12px",borderRadius:"16px"},lg:{fontSize:"16px",padding:"10px 16px",borderRadius:"18px"}},e0={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)"},o0={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)"},je={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:{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"},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}},t0=({messages:e=[],inputPlaceholder:o="Type a message...",disableInput:t=!1,variant:n="default",size:l="md",showTimestamps:a=!0,enableAttachments:c=!1,enableContextPicker:g=!1,selectedContextElements:s=[],onContextPickerClick:u,onRemoveContextElement:h,isLoading:f=!1,loadingText:m="Loading...",styles:p={},maxHeight:b="600px",internalInputValue:x,handleInputChange:y,handleSubmit:k,inputRef:I,messagesRef:T,...C})=>{var _;const w={...je.container,...Jf[n],...p.container},j={...je.messagesContainer,maxHeight:b,...p.messagesContainer},z={...je.inputContainer,...p.inputContainer},E={...je.input,...Zf[l],...p.input},P=d.useCallback(V=>{y(V.target.value),V.target.style.height="auto",V.target.style.height=`${V.target.scrollHeight}px`},[y]),H=d.useCallback(V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),k())},[k]),S=x.trim().length>0,{onSubmit:$,...A}=C;return r.jsxs(i.View,{...w,...A,children:[r.jsxs(i.View,{ref:T,...j,children:[e.length===0?r.jsx(i.View,{display:"flex",alignItems:"center",justifyContent:"center",flex:1,color:"color-gray-400",children:r.jsx(i.Text,{fontSize:"14px",children:"No messages yet. Start a conversation!"})}):e.map(V=>r.jsx(r0,{message:V,size:l,showTimestamp:a,styles:{bubble:p.bubble,userBubble:p.userBubble,assistantBubble:p.assistantBubble,timestamp:p.timestamp,reasoningContainer:p.reasoningContainer,reasoningContent:p.reasoningContent,errorMessage:p.errorMessage,systemMessage:p.systemMessage,toolMessage:p.toolMessage}},V.id)),f&&r.jsxs(i.Horizontal,{justifyContent:"flex-start",alignItems:"center",gap:8,marginTop:"8px",...p.loadingIndicator,children:[r.jsx(st,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(i.Text,{color:"color-gray-500",fontSize:"14px",children:m})]})]}),r.jsxs(i.View,{children:[s.length>0&&r.jsx(i.Horizontal,{gap:8,marginBottom:"8px",flexWrap:"wrap",paddingHorizontal:"20px",...p.contextChipsContainer,children:s.map(V=>r.jsxs(i.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(i.Text,{fontSize:"12px",color:"color-blue-700",fontWeight:"500",children:V.name}),r.jsx(i.View,{as:"button",type:"button",onClick:()=>h==null?void 0:h(V.id),cursor:"pointer",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",children:r.jsx(pe,{widthHeight:12,color:"color-blue-700"})})]},V.id))}),r.jsxs(i.View,{as:"form",onSubmit:k,...z,children:[c&&r.jsx(i.View,{as:"button",type:"button",...je.attachmentButton,...p.attachmentButton,_hover:{backgroundColor:"color-gray-100"},children:r.jsx(ro,{widthHeight:16,color:"color-gray-600"})}),r.jsx(i.View,{as:"textarea",ref:I,value:x,onChange:P,onKeyDown:H,placeholder:o,disabled:t||f,...E,style:{...E,opacity:t||f?.5:1}}),r.jsxs(i.Vertical,{gap:4,alignItems:"center",children:[g&&r.jsx(i.View,{as:"button",type:"button",onClick:u,...je.attachmentButton,...p.contextPickerButton,_hover:{backgroundColor:"color-gray-100",...(_=p.contextPickerButton)==null?void 0:_._hover},title:"Select element from page",children:r.jsx(nr,{widthHeight:16,color:"color-gray-600"})}),r.jsx(i.View,{as:"button",type:"submit",disabled:!S||t||f,...je.sendButton,backgroundColor:S?"theme-primary":"color-gray-300",_hover:{backgroundColor:S?"color-blue-600":"color-gray-300"},...p.sendButton,style:{cursor:S?"pointer":"not-allowed",opacity:!S||t||f?.6:1},children:r.jsx(it,{widthHeight:16,color:"color-white",filled:!1})})]})]})]})]})},r0=({message:e,size:o,showTimestamp:t,styles:n})=>{const[l,a]=d.useState(!1),[c,g]=d.useState(!1),s=e.role==="user",u=e.messageType==="system",h=e.messageType==="error",f=e.messageType==="tool";if(u)return r.jsx(i.View,{display:"flex",justifyContent:"center",padding:"8px",width:"100%",...n.systemMessage,children:r.jsxs(i.Horizontal,{gap:6,alignItems:"center",opacity:.7,children:[r.jsx(Se,{widthHeight:12,color:"color-gray-600"}),r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.content})]})});if(f)return r.jsx(i.View,{display:"flex",justifyContent:"flex-start",padding:"8px 16px",width:"100%",...n.toolMessage,children:r.jsxs(i.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(er,{widthHeight:14,color:"color-gray-600"}),r.jsxs(i.Vertical,{gap:2,children:[r.jsx(i.Text,{fontSize:"11px",fontWeight:"600",color:"color-gray-700",children:"Tool Usage"}),r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",fontFamily:"monospace",children:e.content})]})]})});const m={...je.bubble,...Rf[o],...s?e0:o0,...h?{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,...h?n.errorMessage:{}},p={...je.timestamp,[s?"right":"left"]:"8px",opacity:l?1:0,...n.timestamp};return r.jsx(i.View,{position:"relative",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),display:"flex",justifyContent:s?"flex-end":"flex-start",children:r.jsxs(i.View,{...m,children:[t&&r.jsx(i.View,{...p,children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),h&&r.jsxs(i.Horizontal,{gap:6,marginBottom:"4px",alignItems:"center",children:[r.jsx(Eo,{widthHeight:14,color:"#b91c1c"}),r.jsx(i.Text,{fontWeight:"600",fontSize:"12px",children:"Error"})]}),e.reasoning&&r.jsxs(i.View,{marginBottom:"8px",borderBottom:"1px solid rgba(0,0,0,0.05)",paddingBottom:"8px",...n.reasoningContainer,children:[r.jsxs(i.Horizontal,{as:"button",onClick:()=>g(!c),cursor:"pointer",gap:4,alignItems:"center",backgroundColor:"transparent",border:"none",padding:0,children:[r.jsx(i.Text,{fontSize:"11px",color:"color-gray-500",fontWeight:"600",children:"Thinking Process"}),r.jsx(le,{orientation:c?"down":"right",widthHeight:10,color:"color-gray-500"})]}),c&&r.jsx(i.View,{padding:"8px",backgroundColor:"rgba(0,0,0,0.03)",borderRadius:"8px",marginTop:"4px",...n.reasoningContent,children:r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.reasoning})})]}),r.jsx(i.View,{whiteSpace:"pre-wrap",wordBreak:"break-word",children:e.content}),e.attachments&&e.attachments.length>0&&r.jsx(i.Vertical,{gap:4,marginTop:"8px",children:e.attachments.map(b=>r.jsxs(i.Horizontal,{gap:6,padding:"6px 8px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",fontSize:"12px",children:[r.jsx(ro,{widthHeight:14}),r.jsx(i.Text,{children:b.name})]},b.id))}),e.contextElements&&e.contextElements.length>0&&r.jsxs(i.Vertical,{gap:4,marginTop:"8px",children:[r.jsx(i.Text,{fontSize:"11px",color:"rgba(0,0,0,0.5)",fontWeight:"600",children:"Context:"}),e.contextElements.map(b=>r.jsx(i.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(i.Text,{color:"color-blue-700",fontWeight:"500",children:b.name})},b.id))]})]})})},vt=e=>{const o=Qf(e);return r.jsx(t0,{...e,...o})};vt.displayName="ChatWidget";const va=vt;function n0({onSelect:e,onCancel:o,active:t}){const[n,l]=d.useState(null);d.useRef(null);const a=d.useCallback(s=>{var p;if(!t)return;const u=document.elementFromPoint(s.clientX,s.clientY);if(!u||u===document.body||u.closest('[data-chatwidget-ignore="true"]')||u.closest("#chatwidget-overlay")){l(null);return}const h=u.getBoundingClientRect();let f=u.tagName.toLowerCase();if(u.id)f+=`#${u.id}`;else if(u.className&&typeof u.className=="string"){const b=u.className.split(" ")[0];b&&(f+=`.${b}`)}const m=(p=u.innerText)==null?void 0:p.slice(0,20);m&&(f+=` ("${m}...")`),l({id:u.id||`el-${Date.now()}`,name:f,tagName:u.tagName.toLowerCase(),rect:h})},[t]),c=d.useCallback(s=>{!t||s.target.closest('[data-chatwidget-ignore="true"]')||(s.preventDefault(),s.stopPropagation(),n&&e(n))},[t,n,e]),g=d.useCallback(s=>{t&&s.key==="Escape"&&o()},[t,o]);return d.useEffect(()=>(t?(document.addEventListener("mousemove",a),document.addEventListener("click",c,!0),document.addEventListener("keydown",g),document.body.style.cursor="crosshair"):(l(null),document.removeEventListener("mousemove",a),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",g),document.body.style.cursor=""),()=>{document.removeEventListener("mousemove",a),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",g),document.body.style.cursor=""}),[t,a,c,g]),{highlightedElement:n}}function a0({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 l0=({initialMessages:e=[],onSendMessage:o,bubbleSize:t="md"})=>{const[n,l]=d.useState(!1),[a,c]=d.useState(!1),[g,s]=d.useState(e),[u,h]=d.useState([]),{highlightedElement:f}=n0({active:a,onSelect:y=>{h(k=>[...k,y]),c(!1),l(!0)},onCancel:()=>{c(!1),l(!0)}}),m=()=>l(!n),p=()=>{c(!0),l(!1)},b=y=>{h(k=>k.filter(I=>I.id!==y))},x=y=>{const k={id:Date.now().toString(),role:"user",content:y,timestamp:new Date,contextElements:[...u]};s(I=>[...I,k]),o==null||o(y,u),h([]),setTimeout(()=>{var w;const I=Math.random()>.7,T=Math.random()>.4,C={id:(Date.now()+1).toString(),role:"assistant",timestamp:new Date,content:I?"I will highlight the selected element.":`I received your message regarding: ${((w=k.contextElements)==null?void 0:w.map(j=>j.name).join(", "))||"general context"}. How can I assist you further?`,messageType:I?"tool":"text",reasoning:T?"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(j=>[...j,C]),I&&setTimeout(()=>{s(j=>[...j,{id:(Date.now()+2).toString(),role:"assistant",messageType:"system",content:'Tool "highlightElement" executed successfully.',timestamp:new Date}])},800)},1e3)};return r.jsxs(i.View,{position:"fixed",bottom:24,right:24,zIndex:9999,children:[r.jsx(a0,{element:f}),a&&r.jsx(i.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(i.Text,{fontWeight:"600",fontSize:"14px",children:"Click an element to select it. Press ESC to cancel."})}),n&&r.jsxs(i.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(i.View,{padding:"16px",borderBottom:"1px solid rgba(0,0,0,0.05)",display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(i.Text,{fontWeight:"bold",color:"color-gray-800",children:"ChatWidget Assistant"}),r.jsx(i.View,{as:"button",onClick:()=>l(!1),cursor:"pointer",padding:"4px",borderRadius:"50%",border:"none",backgroundColor:"transparent",_hover:{backgroundColor:"rgba(0,0,0,0.05)"},children:r.jsx(pe,{widthHeight:16,color:"color-gray-500"})})]}),r.jsx(va,{messages:g,onSubmit:x,size:t,variant:"minimal",enableContextPicker:!0,selectedContextElements:u,onContextPickerClick:p,onRemoveContextElement:b,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(i.View,{as:"button",onClick:m,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(pe,{widthHeight:24,color:"white"}):r.jsx(rr,{widthHeight:24,color:"white"})})]})};M.Accordion=Io,M.Alert=wc,M.ArrowIcon=fc,M.AspectRatio=Tc,M.AttachmentGroup=ca,M.AttachmentIcon=ro,M.AttachmentPreview=Kg,M.AudioIcon=jo,M.AudioInput=$c,M.AudioWaveform=ft,M.Avatar=Ac,M.BackIcon=Al,M.Background=Ya,M.Badge=Uc,M.BatteryIcon=wl,M.BluetoothIcon=dc,M.BoldArrowIcon=hc,M.BookmarkIcon=Il,M.Button=_e,M.CalendarIcon=ec,M.CameraIcon=sc,M.Card=$o,M.Carousel=Oe,M.Chart=Wi,M.ChartIcon=Hl,M.ChatInput=Da,M.ChatWidget=va,M.ChatWidgetComponent=vt,M.ChatWidgetWidget=l0,M.CheckIcon=Ll,M.Checkbox=ms,M.ChevronIcon=le,M.ClockIcon=oc,M.CloseEyeIcon=dt,M.CloseIcon=pe,M.CloudIcon=Tl,M.ColorInput=ks,M.ColorPicker=oh,M.ComboBox=qd,M.Command=oo,M.ContextMenu=Ne,M.CookieConsent=Bi,M.CopyIcon=jl,M.CountryPicker=Ss,M.CreditCardIcon=Ql,M.CropIcon=bc,M.DatePicker=Hd,M.DeleteIcon=Sl,M.Divider=xh,M.DocumentIcon=$l,M.DownloadIcon=Vl,M.DragAndDrop=Au,M.DragAndDropComponent=la,M.DragHandleIcon=il,M.DragHandleLinesIcon=xc,M.Drawer=Ke,M.DropZone=qu,M.DropdownMenu=bo,M.DustBinIcon=So,M.EditIcon=Ml,M.EmojiPicker=th,M.ErrorIcon=Eo,M.ExternalLinkIcon=tr,M.FacebookIcon=pl,M.FileIcon=to,M.FileImage=Ni,M.FileSVG=qi,M.FilterIcon=Rl,M.FolderIcon=cl,M.FormikChatInput=bg,M.FormikCheckbox=Jd,M.FormikColorInput=yg,M.FormikComboBox=Mg,M.FormikCountryPicker=kg,M.FormikDatePicker=xg,M.FormikEmojiPicker=Xg,M.FormikForm=Qd,M.FormikIconPicker=qg,M.FormikOTPInput=Wg,M.FormikPassword=Sg,M.FormikRadio=ag,M.FormikSelect=Cg,M.FormikSelector=$g,M.FormikSlider=Pg,M.FormikSwitch=wg,M.FormikTagInput=Ig,M.FormikTextArea=Tg,M.FormikTextField=jg,M.FormikToggle=Lg,M.FormikToggleGroup=Ag,M.FormikUploader=Vn,M.GiftIcon=Nl,M.HeartIcon=xl,M.HelpIcon=ll,M.HomeIcon=zl,M.HoverCard=be,M.Icon=To,M.IconPicker=rh,M.ImageIcon=dl,M.InfoIcon=Se,M.InstagramIcon=fl,M.LayoutIcon=Xl,M.LikeIcon=ic,M.Link=dr,M.LinkIcon=vl,M.LinkedinIcon=bl,M.Loader=no,M.LoadingSpinnerIcon=st,M.LockIcon=Pl,M.LogoutIcon=Gl,M.MagicWandIcon=lc,M.MapPinIcon=tc,M.MediaPreview=Zg,M.MenuIcon=rc,M.Menubar=De,M.MessageLayout=zc,M.MessageView=cr,M.MicrophoneIcon=ct,M.MinusIcon=Jt,M.Modal=Ae,M.MoonIcon=Bl,M.MoreIcon=Zl,M.MousePointerIcon=nr,M.NavigationMenu=Ze,M.NotificationIcon=_l,M.OTPInput=Xd,M.OpenEyeIcon=gt,M.Pagination=uh,M.PanelIcon=rr,M.Password=Bd,M.PauseIcon=Rt,M.PlayIcon=at,M.PlusIcon=El,M.PowerOffIcon=Yl,M.PrintIcon=ac,M.ProfileIcon=Wl,M.ProgressBar=fh,M.RefreshIcon=nc,M.Resizable=Ot,M.RotateIcon=ql,M.SaveIcon=Cl,M.SearchIcon=zo,M.Select=ns,M.Selector=ds,M.SendIcon=it,M.Separator=yh,M.SettingsIcon=er,M.ShapeIcon=Ol,M.ShareButton=jh,M.ShareIcon=or,M.ShieldIcon=Ul,M.Sidebar=Co,M.Slider=Qg,M.SliderIcon=pc,M.SpinnerIcon=mc,M.StarIcon=kl,M.StatusIndicator=Mh,M.StopIcon=Mo,M.SuccessIcon=ut,M.Switch=ss,M.Table=we,M.Tabs=Xo,M.TagInput=Ud,M.TextArea=gs,M.TextField=uo,M.TextIcon=Fl,M.ThreadsIcon=yl,M.TickIcon=Vo,M.Title=$u,M.Toast=Jh,M.Toggle=_n,M.ToggleGroup=Hu,M.Tooltip=Ut,M.TrashIcon=Jl,M.TwitchIcon=hl,M.TwitterIcon=gl,M.UnLikeIcon=cc,M.UnlockIcon=gc,M.UploadIcon=ht,M.Uploader=Wo,M.UserIcon=al,M.VideoIcon=sl,M.WarningIcon=lt,M.WifiIcon=uc,M.XIcon=ul,M.YoutubeIcon=ml,M.ZapIcon=Kl,M.ZoomInIcon=yc,M.ZoomOutIcon=Dl,M.hideMessage=lr,M.hideModal=Wt,M.showMessage=ar,M.showModal=Jg,M.showToast=Fe,M.useMessageStore=Po,M.useModalStore=Ee,M.useToast=Rh,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
38
38
|
//# sourceMappingURL=web.umd.js.map
|