@app-studio/web 0.9.90 → 0.9.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web.cjs.js +10 -37
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.esm.js +7418 -8103
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.js +10 -37
- package/dist/web.umd.js.map +1 -1
- package/package.json +2 -1
package/dist/web.umd.js
CHANGED
|
@@ -1,36 +1,9 @@
|
|
|
1
|
-
(function(z,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react"),require("app-studio"),require("lucide-react/dynamicIconImports"),require("zustand"),require("react-dom"),require("formik")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","app-studio","lucide-react/dynamicIconImports","zustand","react-dom","formik"],n):(z=typeof globalThis<"u"?globalThis:z||self,n(z.AppStudioWeb={},z.jsxRuntime,z.React,z.appStudio,z.lucideReactDynamicIconImports,z.zustand,z.ReactDOM,z.Formik))})(this,function(z,n,h,s,Cr,bt,Bl,Ce){"use strict";function Hl(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const Z=Hl(h),yt=(e="id")=>`${e}-${Math.random().toString(36).substring(2,9)}`,Al=({type:e="single",value:o,defaultValue:t,onValueChange:r,collapsible:a=!1})=>{const l=o!==void 0,c=o??t,d=()=>e==="multiple"?Array.isArray(c)?c:c?[c]:[]:Array.isArray(c)?c[0]:c,[i,u]=h.useState(d()),g=h.useMemo(()=>yt("accordion"),[]),f=l?o:i,m=h.useMemo(()=>f===void 0?[]:Array.isArray(f)?f:[f],[f]);h.useEffect(()=>{l&&(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,l,e]);const b=h.useCallback(y=>{let x;if(e==="single")f===y&&a?x=void 0:f!==y?x=y:x=f;else{const k=Array.isArray(f)?f:[];k.includes(y)?x=k.filter(w=>w!==y):x=[...k,y],Array.isArray(x)&&x.length===0&&(x=[])}l||u(x),r&&r(x)},[e,f,a,l,r]),p=h.useCallback(y=>m.includes(y),[m]);return{expandedItems:m,toggleItem:b,isItemExpanded:p,type:e,collapsible:a,baseId:g}},Fl={square:{borderRadius:0},rounded:{borderRadius:8}},Ol={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"}}},wr=h.createContext({expandedItems:[],toggleItem:()=>{},isItemExpanded:()=>!1,type:"single",collapsible:!1,baseId:""}),vl=({children:e,value:o})=>n.jsx(wr.Provider,{value:o,children:e}),Ir=()=>{const e=h.useContext(wr);if(!e)throw new Error("useAccordionContext must be used within an AccordionProvider");return e},Nl=({value:e,children:o,isDisabled:t=!1,views:r,...a})=>{const{isItemExpanded:l,baseId:c}=Ir(),d=l(e),i=`${c}-trigger-${e}`,u=`${c}-content-${e}`;return n.jsx(s.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,...r==null?void 0:r.item,...a,children:h.Children.map(o,g=>h.isValidElement(g)?h.cloneElement(g,{...g.props,value:e,isExpanded:d,isDisabled:t,triggerId:i,contentId:u}):g)})},Ul=({children:e,value:o,isExpanded:t,isDisabled:r,triggerId:a,contentId:l,views:c,asChild:d=!1,...i})=>{const{toggleItem:u}=Ir(),f={id:a,"aria-expanded":t,"aria-controls":l,"aria-disabled":r,"data-state":t?"open":"closed","data-disabled":r?"":void 0,onClick:()=>{o&&!r&&u(o)},padding:16,cursor:r?"not-allowed":"pointer",alignItems:"center",justifyContent:"space-between",backgroundColor:"color-white",width:"100%",...c==null?void 0:c.container,...i};if(d&&h.isValidElement(e)){const m=h.Children.only(e);return h.cloneElement(m,{...f,...m.props})}return n.jsxs(s.Horizontal,{...f,children:[e,n.jsx(s.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:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z",fill:"currentColor"})})})]})},ql=({children:e,isExpanded:o,isDisabled:t,triggerId:r,contentId:a,views:l,...c})=>o?n.jsx(s.View,{id:a,role:"region","aria-labelledby":r,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,...l==null?void 0:l.container,...c,children:e}):null,Gl=({children:e,shape:o="rounded",variant:t="default",views:r,baseId:a,type:l,collapsible:c,themeMode:d,...i})=>n.jsx(s.Vertical,{width:"100%","data-orientation":"vertical",...Fl[o],...Ol[t],...r==null?void 0:r.container,...i,children:e}),Po=({children:e,type:o="single",value:t,defaultValue:r,onValueChange:a,collapsible:l=!1,shape:c="rounded",variant:d="default",views:i,...u})=>{const g=Array.isArray(r)?r:r?[r]:void 0,f=Al({type:o,value:t,defaultValue:r??g,onValueChange:a,collapsible:l});return n.jsx(vl,{value:{expandedItems:f.expandedItems,toggleItem:f.toggleItem,isItemExpanded:f.isItemExpanded,type:f.type,collapsible:f.collapsible,baseId:f.baseId},children:n.jsx(Gl,{shape:c,variant:d,views:i,baseId:f.baseId,type:f.type,collapsible:f.collapsible,...u,children:e})})};Po.Item=Nl,Po.Trigger=Ul,Po.Content=ql;const xt=({widthHeight:e,color:o="currentColor",transform:t,orientation:r="up",children:a,...l})=>n.jsx(s.Center,{widthHeight:e,lineHeight:e,color:o,display:"flex",transform:t||(r==="left"?"rotate(-90deg)":r==="right"?"rotate(90deg)":r==="up"?"rotate(0deg)":r==="down"?"rotate(180deg)":"none"),...l,children:a}),Yl=(e,o,t)=>{const{getColor:r}=s.useTheme(),a=r(o);return{fill:e?a:"none",stroke:a,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}},Wo=({name:e="circle",widthHeight:o=24,color:t="currentColor",filled:r=!1,strokeWidth:a=1,size:l,children:c,fallback:d,...i})=>{const u=l||o;if(!e)return n.jsx(xt,{widthHeight:o,color:t,...i,children:c});const g=e.toLowerCase().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if(!(g in Cr))return n.jsx(xt,{widthHeight:u,color:t,...i,children:d||c});const f=h.lazy(Cr[g]),m=Yl(r,t,a);return n.jsx(xt,{widthHeight:u,color:t,...i,children:n.jsx(h.Suspense,{fallback:d||null,children:n.jsx(f,{size:u,...m})})})},U=(e,o={})=>{const t=r=>n.jsx(Wo,{name:e,...o,...r});return t.displayName=`${e}Icon`,t},Xl=U("user",{filled:!1}),Kl=U("circle-help",{filled:!1}),Ql=U("folder",{filled:!1}),ce=U("chevron-up",{filled:!1}),Jl=U("grip-vertical",{filled:!1}),io=U("file",{filled:!1}),Zl=U("video",{filled:!1}),Rl=U("image",{filled:!1}),_o=U("volume",{filled:!1}),ec=U("twitter",{filled:!1}),oc=U("x",{filled:!1}),tc=U("twitch",{filled:!1}),ye=U("x",{filled:!1,strokeWidth:2}),rc=U("instagram",{filled:!1}),nc=U("youtube",{filled:!1}),ac=U("facebook",{filled:!1}),lc=U("linkedin",{filled:!1}),cc=U("at-sign",{filled:!1}),Tr=U("minus",{filled:!1}),ze=U("info",{filled:!1}),kt=U("play",{filled:!1}),jr=U("pause",{filled:!1}),ic=U("heart",{filled:!1}),sc=U("star",{filled:!1}),dc=U("save",{filled:!1}),Ct=U("triangle-alert",{filled:!1}),uc=U("battery",{filled:!1}),gc=U("bookmark",{filled:!1}),hc=U("cloud",{filled:!1}),fc=U("copy",{filled:!1}),$o=U("trash",{filled:!1}),mc=$o,pc=U("edit",{filled:!1}),wt=U("mic",{filled:!1}),Lo=U("square",{filled:!1}),It=U("send",{filled:!1}),Tt=U("loader",{filled:!1}),so=U("paperclip",{filled:!1}),Do=U("search",{filled:!1}),bc=U("home",{filled:!1}),Sr=U("settings",{filled:!1}),yc=U("download",{filled:!1}),Mr=U("share",{filled:!1}),Bo=U("check",{filled:!1}),xc=U("plus",{filled:!1}),jt=U("eye-off",{filled:!1}),St=U("eye",{filled:!1}),kc=U("lock",{filled:!1}),Cc=U("user",{filled:!1}),zr=U("external-link",{filled:!1}),Mt=U("check-circle",{filled:!1}),Ho=U("alert-circle",{filled:!1}),wc=U("bell",{filled:!1}),Ic=U("file-text",{filled:!1}),Tc=U("bar-chart",{filled:!1}),jc=U("moon",{filled:!1}),Er=U("panel-left",{filled:!1}),zt=U("upload",{filled:!1}),Sc=Bo,Mc=e=>n.jsx(ce,{orientation:"left",...e}),zc=U("zoom-out",{filled:!1}),Ec=U("type",{filled:!1}),Vc=U("shapes",{filled:!1}),Pc=U("rotate-cw",{filled:!1}),Wc=U("gift",{filled:!1}),_c=U("shield",{filled:!1}),$c=U("log-out",{filled:!1}),Lc=U("power",{filled:!1}),Dc=U("link",{filled:!1}),Bc=U("layout",{filled:!1}),Hc=U("zap",{filled:!1}),Ac=U("credit-card",{filled:!1}),Fc=U("more-horizontal",{filled:!1}),Oc=$o,vc=U("filter",{filled:!1}),Nc=U("calendar",{filled:!1}),Uc=U("clock",{filled:!1}),qc=U("map-pin",{filled:!1}),Gc=U("menu",{filled:!1}),Yc=U("refresh-cw",{filled:!1}),Xc=U("printer",{filled:!1}),Kc=U("wand",{filled:!1}),Qc=U("thumbs-down",{filled:!1}),Jc=U("thumbs-up",{filled:!1}),Zc=U("camera",{filled:!1}),Rc=U("bluetooth",{filled:!1}),ei=U("unlock",{filled:!1}),oi=U("wifi",{filled:!1}),ti=U("arrow-right",{filled:!1}),ri=U("arrow-up",{filled:!1}),ni=U("loader",{filled:!1}),ai=U("sliders-horizontal",{filled:!1}),li=U("crop",{filled:!1}),ci=U("zoom-in",{filled:!1}),ii=U("grip-horizontal",{filled:!1}),Vr=U("mouse-pointer-2",{filled:!1}),si=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"}}}),di=({icon:e,title:o="",views:t,description:r="",variant:a="default",themeMode:l,children:c,...d})=>{const{themeMode:i}=s.useTheme(),u=si(),g=()=>{var b;if(e)return e;const m={size:20,color:((b=t==null?void 0:t.icon)==null?void 0:b.color)??u[a].icon.color};switch(a){case"info":return n.jsx(ze,{...m});case"success":return n.jsx(Mt,{...m});case"error":return n.jsx(Ho,{...m});case"warning":default:return n.jsx(Ct,{...m})}};return n.jsxs(s.Horizontal,{gap:12,padding:"16px",flexWrap:"nowrap",alignItems:"flex-start",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:u[a].container.borderColor,backgroundColor:u[a].container.backgroundColor,boxShadow:u[a].container.boxShadow,transition:"all 0.2s ease",...t==null?void 0:t.container,...d,children:[n.jsx(s.View,{alignSelf:"flex-start",marginTop:"2px",...t==null?void 0:t.icon,children:g()}),n.jsxs(s.Vertical,{gap:8,children:[" ",n.jsx(s.Text,{fontSize:"16px",fontWeight:"600",lineHeight:"24px",color:u[a].content.color,backgroundColor:u[a].container.backgroundColor,...t==null?void 0:t.title,children:o}),n.jsx(s.Text,{fontSize:"14px",fontWeight:"400",lineHeight:"20px",color:u[a].content.color,backgroundColor:u[a].container.backgroundColor,...t==null?void 0:t.description,children:r||c})]})]})},ui=e=>n.jsx(di,{...e}),gi=({ratio:e=16/9,children:o,views:t,...r})=>n.jsx(s.Center,{width:"100%",position:"relative",overflow:"hidden",paddingTop:`${1/e*100}%`,borderRadius:8,...r,...t==null?void 0:t.center,children:n.jsx(s.View,{position:"absolute",top:0,right:0,bottom:0,left:0,...t==null?void 0:t.view,children:o})}),hi=({ratio:e,children:o,...t})=>n.jsx(gi,{ratio:e,...t,children:o});function fi(e,o,t){return Math.min(Math.max(e,o),t)}const mi=({bars:e,isPaused:o,...t})=>n.jsx(s.Horizontal,{alignItems:"center",minWidth:100,gap:1,height:32,maxWidth:200,width:"100%",marginTop:4,...t,children:e.map((a,l)=>n.jsx(s.View,{width:2,backgroundColor:o?"color-gray-200":a>=0?"color-gray-900":"color-gray-500",style:{height:`${fi(a*300,2,32)}px`}},l))}),Et=({analyserNode:e,isPaused:o,...t})=>{const r=h.useRef(null),a=60,l=32,[c,d]=h.useState([]);return h.useEffect(()=>{if(!e){d(Array(a).fill(-1));return}const i=e.frequencyBinCount,u=new Uint8Array(i),g=()=>{e.getByteTimeDomainData(u);let f=0;for(let b=0;b<i;b++){const p=(u[b]-128)/128;f+=p*p}const m=Math.sqrt(f/i);h.startTransition(()=>{d(b=>{const y=[...b,m].slice(-a);return y.length<a?[...Array(a-y.length).fill(-1),...y]:y})})};return r.current=setInterval(g,l),()=>{r.current&&clearInterval(r.current)}},[e]),n.jsx(mi,{bars:c,isPaused:o,...t})},Ao=bt.create(e=>({visible:!1,title:"",subtitle:"",variant:"info",isClosable:!1,views:{},action:()=>{},actionText:"",showIcon:!1,timeout:3e3,show:(o,t="",r="",a,l,c,d,i,u)=>e({visible:!0,variant:o,title:t,subtitle:r,isClosable:a,views:l,action:c,actionText:d,showIcon:i,timeout:u}),hide:()=>e({visible:!1})})),Pr=(e,o,t,r)=>{Ao.getState().show(e,o,t,r==null?void 0:r.isClosable,r==null?void 0:r.views,r==null?void 0:r.action,r==null?void 0:r.actionText,r==null?void 0:r.showIcon,r==null?void 0:r.timeout)},Wr=()=>{Ao.getState().hide()},pi={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"}}},_r=({variant:e,hide:o,title:t,subtitle:r,theme:a,action:l,actionText:c,showIcon:d=!1,isClosable:i=!1,timeout:u=3e3,views:g})=>{var k,w;h.useEffect(()=>{if(u&&!i){const I=setTimeout(()=>{o()},u);return()=>{clearTimeout(I)}}},[]);const f=a??pi,m=!!(l&&c),b={borderWidth:1,borderStyle:"solid",borderRadius:8,borderColor:`${f[e].container.border}`},p={info:"#3b82f6",success:"#4ade80",warning:"#f97316",error:"#ef4444"}[e],y={info:n.jsx(ze,{widthHeight:24,color:p,...g==null?void 0:g.icon}),success:n.jsx(Mt,{widthHeight:24,color:p,...g==null?void 0:g.icon}),warning:n.jsx(Ct,{widthHeight:24,color:p,...g==null?void 0:g.icon}),error:n.jsx(Ho,{widthHeight:24,color:p,...g==null?void 0:g.icon})}[e],x=d&&y;return n.jsxs(s.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:i?()=>{}:()=>{o()},...b,...g==null?void 0:g.container,children:[x&&y,n.jsxs(s.Vertical,{gap:8,width:"100%",children:[n.jsx(s.Text,{size:"md",weight:"semiBold",...g==null?void 0:g.title,children:t}),r&&n.jsx(s.Text,{size:"sm",...g==null?void 0:g.subtitle,children:r})]}),m&&n.jsx(s.Text,{marginRight:10,onClick:l,padding:"6px 10px",whiteSpace:"nowrap",...b,...g==null?void 0:g.actionText,children:c}),i&&n.jsx(s.View,{position:"absolute",zIndex:1e4,right:8,top:6,onClick:()=>{o()},...(k=g==null?void 0:g.closingIcon)==null?void 0:k.container,children:n.jsx(ye,{widthHeight:18,color:p,...(w=g==null?void 0:g.closingIcon)==null?void 0:w.icon})})]})},bi=({container:e,theme:o,position:t="topRight"})=>{const{visible:r,title:a,variant:l,subtitle:c,isClosable:d,views:i,action:u,actionText:g,showIcon:f,timeout:m}=Ao(),b={topLeft:{top:6,left:8},topRight:{top:6,right:8},bottomLeft:{bottom:8,left:6},bottomRight:{bottom:8,right:6}}[t],p=()=>n.jsx(_r,{variant:l,subtitle:c,show:r,title:a,theme:o,isClosable:d,views:i,action:u,actionText:g,showIcon:f,timeout:m,hide:()=>Wr()}),y=e?h.cloneElement(e,{},p()):n.jsx(s.View,{position:"absolute",zIndex:1e4,...b,children:p()});return r?y:null},yi=(e,o)=>{const t=document.createElement("video");t.preload="metadata",t.onloadedmetadata=()=>{t.currentTime=1},t.oncanplay=()=>{const r=document.createElement("canvas");r.width=t.videoWidth,r.height=t.videoHeight;const a=r.getContext("2d");if(a){a.drawImage(t,0,0,r.width,r.height);const l=r.toDataURL("image/jpeg");o(l)}URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(e)},xi=({maxSize:e=100*1024*1024,onFileSelect:o,onMultipleFileSelect:t,validateFile:r,thumbnail:a,multiple:l=!1,onError:c=d=>{Pr("error","Error",d)}})=>{const d=h.useRef(null),i=h.useRef(null),[u,g]=h.useState(null),[f,m]=h.useState([]),[b,p]=h.useState(null),[y,x]=h.useState(null),[k,w]=h.useState(a||null),I=h.useCallback(T=>{const j=T.target.files;if(p(null),!j||j.length===0){c("No file selected"),p("No file selected");return}if(l){const M=Array.from(j),E=[];for(const P of M){if(P.size>e){c(`File ${P.name} exceeds ${Math.round(e/(1024*1024))}MB.`),p(`File ${P.name} exceeds ${Math.round(e/(1024*1024))}MB.`);continue}if(r){const L=r(P);if(L){c(`${P.name}: ${L}`),p(`${P.name}: ${L}`);continue}}E.push(P)}E.length>0&&(m(E),t&&t(E))}else{const M=j[0];if(M.size>e){c(`File exceeds ${Math.round(e/(1024*1024))}MB.`),p(`File exceeds ${Math.round(e/(1024*1024))}MB.`);return}if(r){const E=r(M);if(E){c(E),p(E);return}}x(URL.createObjectURL(M)),M.type.startsWith("video/")&&yi(M,w),o&&(g(M),o(M))}},[e,o,t,r,l]),C=()=>{var T;return(T=d.current)==null?void 0:T.click()};return h.useEffect(()=>()=>{y&&URL.revokeObjectURL(y),k&&URL.revokeObjectURL(k)},[y,k]),{previewUrl:y,thumbnailUrl:k,errorMessage:b,fileInputRef:d,videoRef:i,selectedFile:u,selectedFiles:f,handleFileChange:I,handleClick:C}},ki=({accept:e,isLoading:o=!1,progress:t=0,icon:r,text:a,previewUrl:l,thumbnailUrl:c,errorMessage:d,fileInputRef:i,videoRef:u,selectedFile:g,selectedFiles:f,handleFileChange:m,handleClick:b,multiple:p=!1,containerProps:y,errorMessageProps:x,progressProps:k,videoProps:w,imageProps:I,iconProps:C,textProps:T,fileType:j,previewUrl:M,renderError:E=({errorMessage:W,errorMessageProps:$,themeMode:_})=>n.jsx(s.Text,{color:"red",fontSize:12,marginTop:8,...$,...V==null?void 0:V.text,children:W}),renderText:P=({text:W,textProps:$})=>n.jsx(s.Text,{marginTop:8,...$,...V==null?void 0:V.text,children:W}),renderFile:L=({selectedFile:W,textProps:$})=>W?n.jsxs(s.Center,{marginTop:8,gap:10,flexDirection:"column",...V==null?void 0:V.container,children:[n.jsx(s.Text,{maxLines:2,...$,...V==null?void 0:V.text,children:W.name}),n.jsxs(s.Text,{...$,...V==null?void 0:V.text,children:["(",Math.round(W.size/1024)," KB)"]})]}):null,renderVideo:S=({selectedFile:W,videoRef:$,videoProps:_})=>n.jsx(s.View,{width:"100%",height:"100%",position:"relative",...V==null?void 0:V.view,children:n.jsx(s.View,{as:"video",width:"100%",height:"100%",src:W?URL.createObjectURL(W):void 0,style:{objectFit:"cover"},ref:$,..._,...V==null?void 0:V.view})}),renderImage:D=({previewUrl:W,imageProps:$})=>(console.log("Rendering image with URL:",W),n.jsx(s.View,{width:"100%",height:"100%",position:"relative",...V==null?void 0:V.view,children:n.jsx(s.Image,{src:W,alt:"Preview",width:"100%",height:"100%",objectFit:"cover",style:{maxHeight:"100%",maxWidth:"100%"},...$,...V==null?void 0:V.image})})),renderProgress:H=({progress:W,progressProps:$})=>n.jsxs(s.Horizontal,{gap:8,alignItems:"center",...$,...V==null?void 0:V.horizontal,children:[n.jsx(s.View,{height:4,backgroundColor:"rgba(0,0,0,0.1)",width:"100%",borderRadius:2,...V==null?void 0:V.view,children:n.jsx(s.View,{height:4,width:`${W}%`,borderRadius:2,backgroundColor:"color-dark-50",...V==null?void 0:V.view})}),n.jsxs(s.Text,{fontSize:12,...V==null?void 0:V.text,children:[W,"%"]})]}),views:V={}})=>{const W=M||l;return n.jsxs(s.Center,{onClick:b,cursor:"pointer",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,padding:16,flexDirection:"column",overflow:"hidden",position:"relative",height:g&&t===100?"200px":"auto",...y,...V==null?void 0:V.container,children:[t===100&&j==="image"&&W&&D({previewUrl:W,imageProps:I}),t===100&&j==="video"&&c&&S({selectedFile:g,thumbnailUrl:c,videoRef:u,videoProps:w,imageProps:I}),t===100&&j==="file"&&g&&L({selectedFile:g,textProps:T}),t<100&&(r||n.jsx(zt,{widthHeight:32,...C})),!o&&!g&&a&&P({text:a,textProps:T}),o&&H({progress:t,progressProps:k}),!o&&d&&E({errorMessage:d,errorMessageProps:x}),n.jsx(s.View,{as:"input",type:"file",ref:i,onChange:m,accept:e,multiple:p,style:{display:"none"},...V==null?void 0:V.view})]})},Fo=({accept:e="*/*",icon:o,text:t,maxSize:r,onFileSelect:a,onMultipleFileSelect:l,validateFile:c,isLoading:d=!1,progress:i=0,fileType:u,multiple:g=!1,...f})=>{const{previewUrl:m,thumbnailUrl:b,errorMessage:p,videoRef:y,fileInputRef:x,selectedFile:k,selectedFiles:w,handleFileChange:I,handleClick:C}=xi({maxSize:r,onFileSelect:a,onMultipleFileSelect:l,validateFile:c,multiple:g}),j=(()=>{if(u)return u;if(k)return k.type.startsWith("image/")?"image":k.type.startsWith("video/")?"video":"file"})();return n.jsx(ki,{handleClick:C,accept:e,isLoading:d,progress:i,icon:o,text:t,maxSize:r,onFileSelect:a,validateFile:c,errorMessage:p,handleFileChange:I,selectedFile:k,selectedFiles:w,videoRef:y,fileInputRef:x,previewUrl:m,thumbnailUrl:b,fileType:j,multiple:g,...f})};function Ci({onAudio:e,recording:o,paused:t,audioBlob:r,analyserNode:a,startRecording:l,stopRecording:c,pauseRecording:d,resumeRecording:i,resetRecording:u,handleFileChange:g,...f}){const[m,b]=h.useState(null);return h.useEffect(()=>{if(r){const p=URL.createObjectURL(r);return b(p),()=>{URL.revokeObjectURL(p)}}return b(null),()=>{}},[r]),n.jsxs(s.View,{gap:"8px",...f,children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",margin:10,children:[n.jsx(Fo,{accept:"audio/*",icon:n.jsx(so,{widthHeight:16}),maxSize:100*1024*1024,onFileSelect:p=>e(p),fileType:"file",multiple:!1,renderError:({errorMessage:p})=>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:p=>p.size>100*1024*1024?"File size exceeds 100MB limit":p.type.startsWith("audio/")?null:"Only audio files are allowed"}),o?n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[n.jsx(s.View,{as:"button",type:"button",onClick:t?i: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?n.jsx(kt,{widthHeight:16,color:"currentColor",filled:!1}):n.jsx(jr,{widthHeight:16,color:"currentColor",filled:!1})}),n.jsx(s.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:n.jsx(Lo,{widthHeight:16,color:"currentColor",filled:!1})}),n.jsx(s.View,{minWidth:90,children:o&&n.jsx(Et,{analyserNode:a,isPaused:t})})]}):n.jsx(s.View,{as:"button",type:"button",onClick:l,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:n.jsx(wt,{widthHeight:16,color:"currentColor",filled:!1})})]}),m&&!o&&n.jsx("audio",{controls:!0,src:m})]})}function $r(){const[e,o]=h.useState(!1),[t,r]=h.useState(!1),[a,l]=h.useState(0),[c,d]=h.useState(null),[i,u]=h.useState(null),[g,f]=h.useState(null),m=h.useRef(null),b=h.useRef(null),p=h.useRef(null),y=h.useRef(null),x=h.useRef([]),k=h.useRef(null),w=typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",I=h.useCallback(()=>{m.current&&(m.current.state!=="inactive"&&m.current.stop(),m.current=null),y.current&&(y.current.getTracks().forEach(P=>P.stop()),y.current=null),b.current&&(b.current.close(),b.current=null),p.current&&(p.current.disconnect(),p.current=null),u(null),k.current&&(clearInterval(k.current),k.current=null)},[]),C=h.useCallback(async()=>{I(),d(null),l(0),x.current=[];try{const P=await navigator.mediaDevices.getUserMedia({audio:!0});y.current=P;const L=MediaRecorder.isTypeSupported(w)?w:void 0,S=new MediaRecorder(P,L?{mimeType:L}:void 0);m.current=S;const D=new(window.AudioContext||window.webkitAudioContext);b.current=D;const H=D.createMediaStreamSource(P),V=D.createAnalyser();V.fftSize=256,V.smoothingTimeConstant=.8,H.connect(V),p.current=V,u(V),S.ondataavailable=W=>{W.data.size>0&&x.current.push(W.data)},S.onstop=()=>{const W=new Blob(x.current,{type:S.mimeType||w});f(W),I()},S.start(),o(!0),r(!1),k.current=setInterval(()=>{l(W=>W+1)},1e3)}catch{d("Microphone access denied or unavailable."),I()}},[I]),T=h.useCallback(()=>{m.current&&m.current.state!=="inactive"&&m.current.stop(),o(!1),r(!1),k.current&&(clearInterval(k.current),k.current=null)},[]),j=h.useCallback(()=>{m.current&&m.current.state==="recording"&&(m.current.pause(),r(!0),k.current&&(clearInterval(k.current),k.current=null))},[]),M=h.useCallback(()=>{m.current&&m.current.state==="paused"&&(m.current.resume(),r(!1),k.current||(k.current=setInterval(()=>{l(P=>P+1)},1e3)))},[]),E=h.useCallback(()=>{I(),o(!1),r(!1),f(null),l(0),d(null),x.current=[]},[I]);return h.useEffect(()=>()=>I(),[I]),{recording:e,paused:t,audioBlob:g,analyserNode:i,duration:a,error:c,startRecording:C,stopRecording:T,pauseRecording:j,resumeRecording:M,resetRecording:E}}function wi(e){const{onAudio:o}=e,{recording:t,paused:r,audioBlob:a,analyserNode:l,startRecording:c,stopRecording:d,pauseRecording:i,resumeRecording:u,resetRecording:g}=$r();return h.useEffect(()=>{if(a&&o){const m=new File([a],"recording.webm",{type:a.type||"audio/webm;codecs=opus"});o(m)}},[a,o]),{recording:t,paused:r,audioBlob:a,analyserNode:l,startRecording:c,stopRecording:d,pauseRecording:i,resumeRecording:u,resetRecording:g,handleFileChange:m=>{var p;const b=(p=m.target.files)==null?void 0:p[0];b&&o&&o(b)}}}function Ii(e){const o=wi(e);return n.jsx(Ci,{...e,...o})}const Ti=()=>{const[e,o]=h.useState(!1);return{imageError:e,setImageError:o}},ji={xs:24,sm:32,md:48,lg:64,xl:80},Vt={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"}},Si=({src:e,size:o="md",fallback:t="IM",views:r,imageError:a,setImageError:l,onClick:c=()=>{},children:d})=>{const i=ji[o],u={...Vt.image,...(r==null?void 0:r.image)||{}};return n.jsxs(s.Center,{role:"avatar",width:i,height:i,...Vt.container,borderColor:a?"color-gray-400":"transparent",onClick:c,...r==null?void 0:r.container,children:[!a&&e?n.jsx(s.Image,{alt:"IM",src:e,style:u,width:i,height:i,onError:()=>l(!0)}):n.jsx(s.Text,{size:o,...Vt.fallback,...r==null?void 0:r.fallback,children:t}),d]})},Mi=({src:e,size:o,views:t,fallback:r,onClick:a,children:l})=>{const{imageError:c,setImageError:d}=Ti();return n.jsx(Si,{src:e,size:o,views:t,fallback:r,imageError:c,setImageError:d,onClick:a,children:l})},zi={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"}},Ei={square:0,rounded:"8px",pill:"9999px"},Vi={"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"}},Pi=e=>({filled:{backgroundColor:"theme-primary",color:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s ease"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"theme-primary",color:"theme-primary",transition:"all 0.2s ease"},link:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",color:"theme-primary",textDecoration:"underline",textUnderlineOffset:"2px",transition:"all 0.2s ease"},ghost:{backgroundColor:"transparent",color:"color-gray-500",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s ease"}}),Lr=e=>({default:{indicator:{backgroundColor:"color-gray-400"},label:{color:"color-gray-700"}},info:{indicator:{backgroundColor:"color-blue-500"},label:{color:"color-blue-700"}},success:{indicator:{backgroundColor:"color-green-500"},label:{color:"color-green-700"}},warning:{indicator:{backgroundColor:"color-orange-500"},label:{color:"color-orange-700"}},error:{indicator:{backgroundColor:"color-red-500"},label:{color:"color-red-700"}}}),Wi=({content:e,children:o,icon:t,pastil:r,position:a,shape:l="pill",variant:c="filled",size:d="md",views:i,themeMode:u,...g})=>{const{themeMode:f}=s.useTheme(),m=Pi()[c],b=Lr(),p={width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",borderRadius:Ei[l],...zi[d],...m,...a?Vi[a]:{},...i==null?void 0:i.container};let y="currentColor";return typeof r=="string"?r in b?y=b[r].indicator.backgroundColor:y=r:r===!0&&(y="color-green-500",c==="filled"&&(y="color-white")),n.jsxs(s.Center,{role:"badge",...p,...g,children:[t&&n.jsx(s.View,{role:"badge-icon",...i==null?void 0:i.icon,children:t}),r&&n.jsx(s.View,{role:"badge-pastil",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:y,...i==null?void 0:i.pastil}),(e||o)&&n.jsx(s.Text,{role:"badgeText",fontWeight:"500",textAlign:"center",...i==null?void 0:i.text,color:p.color,children:o||e})]})},_i=e=>n.jsx(Wi,{...e}),$i=()=>{const[e,o]=h.useState(!1);return{isHovered:e,setIsHovered:o}};/**
|
|
2
|
-
* @remix-run/router v1.23.2
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) Remix Software Inc.
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
-
*
|
|
9
|
-
* @license MIT
|
|
10
|
-
*/function Pt(){return Pt=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Pt.apply(this,arguments)}var Dr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Dr||(Dr={}));function de(e,o){if(e===!1||e===null||typeof e>"u")throw new Error(o)}function Ne(e,o){if(!e){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function Wt(e){let{pathname:o="/",search:t="",hash:r=""}=e;return t&&t!=="?"&&(o+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(o+=r.charAt(0)==="#"?r:"#"+r),o}function Br(e){let o={};if(e){let t=e.indexOf("#");t>=0&&(o.hash=e.substr(t),e=e.substr(0,t));let r=e.indexOf("?");r>=0&&(o.search=e.substr(r),e=e.substr(0,r)),e&&(o.pathname=e)}return o}var Hr;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Hr||(Hr={}));function Ar(e,o){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[t,r]=Li(e.path,e.caseSensitive,e.end),a=o.match(t);if(!a)return null;let l=a[0],c=l.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:r.reduce((u,g,f)=>{let{paramName:m,isOptional:b}=g;if(m==="*"){let y=d[f]||"";c=l.slice(0,l.length-y.length).replace(/(.)\/+$/,"$1")}const p=d[f];return b&&!p?u[m]=void 0:u[m]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:l,pathnameBase:c,pattern:e}}function Li(e,o,t){o===void 0&&(o=!1),t===void 0&&(t=!0),Ne(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,i)=>(r.push({paramName:d,isOptional:i!=null}),i?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,o?void 0:"i"),r]}function Ue(e,o){if(o==="/")return e;if(!e.toLowerCase().startsWith(o.toLowerCase()))return null;let t=o.endsWith("/")?o.length-1:o.length,r=e.charAt(t);return r&&r!=="/"?null:e.slice(t)||"/"}const Di=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bi=e=>Di.test(e);function Hi(e,o){o===void 0&&(o="/");let{pathname:t,search:r="",hash:a=""}=typeof e=="string"?Br(e):e,l;if(t)if(Bi(t))l=t;else{if(t.includes("//")){let c=t;t=t.replace(/\/\/+/g,"/"),Ne(!1,"Pathnames cannot have embedded double slashes - normalizing "+(c+" -> "+t))}t.startsWith("/")?l=Fr(t.substring(1),"/"):l=Fr(t,o)}else l=o;return{pathname:l,search:Fi(r),hash:Oi(a)}}function Fr(e,o){let t=o.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?t.length>1&&t.pop():a!=="."&&t.push(a)}),t.length>1?t.join("/"):"/"}function _t(e,o,t,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+o+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ai(e){return e.filter((o,t)=>t===0||o.route.path&&o.route.path.length>0)}function Or(e,o){let t=Ai(e);return o?t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase):t.map(r=>r.pathnameBase)}function vr(e,o,t,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Br(e):(a=Pt({},e),de(!a.pathname||!a.pathname.includes("?"),_t("?","pathname","search",a)),de(!a.pathname||!a.pathname.includes("#"),_t("#","pathname","hash",a)),de(!a.search||!a.search.includes("#"),_t("#","search","hash",a)));let l=e===""||a.pathname==="",c=l?"/":a.pathname,d;if(c==null)d=t;else{let f=o.length-1;if(!r&&c.startsWith("..")){let m=c.split("/");for(;m[0]==="..";)m.shift(),f-=1;a.pathname=m.join("/")}d=f>=0?o[f]:"/"}let i=Hi(a,d),u=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&t.endsWith("/");return!i.pathname.endsWith("/")&&(u||g)&&(i.pathname+="/"),i}const $t=e=>e.join("/").replace(/\/\/+/g,"/"),Fi=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Oi=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Nr=["post","put","patch","delete"];new Set(Nr);const vi=["get",...Nr];new Set(vi);/**
|
|
11
|
-
* React Router v6.30.3
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Remix Software Inc.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
17
|
-
*
|
|
18
|
-
* @license MIT
|
|
19
|
-
*/function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Lt.apply(this,arguments)}const Oo=Z.createContext(null);process.env.NODE_ENV!=="production"&&(Oo.displayName="DataRouter");const Ur=Z.createContext(null);process.env.NODE_ENV!=="production"&&(Ur.displayName="DataRouterState");const Ni=Z.createContext(null);process.env.NODE_ENV!=="production"&&(Ni.displayName="Await");const je=Z.createContext(null);process.env.NODE_ENV!=="production"&&(je.displayName="Navigation");const Dt=Z.createContext(null);process.env.NODE_ENV!=="production"&&(Dt.displayName="Location");const qe=Z.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(qe.displayName="Route");const Ui=Z.createContext(null);process.env.NODE_ENV!=="production"&&(Ui.displayName="RouteError");function qi(e,o){let{relative:t}=o===void 0?{}:o;Bt()||(process.env.NODE_ENV!=="production"?de(!1,"useHref() may be used only in the context of a <Router> component."):de(!1));let{basename:r,navigator:a}=Z.useContext(je),{hash:l,pathname:c,search:d}=go(e,{relative:t}),i=c;return r!=="/"&&(i=c==="/"?r:$t([r,c])),a.createHref({pathname:i,search:d,hash:l})}function Bt(){return Z.useContext(Dt)!=null}function uo(){return Bt()||(process.env.NODE_ENV!=="production"?de(!1,"useLocation() may be used only in the context of a <Router> component."):de(!1)),Z.useContext(Dt).location}const qr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gr(e){Z.useContext(je).static||Z.useLayoutEffect(e)}function Gi(){let{isDataRoute:e}=Z.useContext(qe);return e?Ji():Yi()}function Yi(){Bt()||(process.env.NODE_ENV!=="production"?de(!1,"useNavigate() may be used only in the context of a <Router> component."):de(!1));let e=Z.useContext(Oo),{basename:o,future:t,navigator:r}=Z.useContext(je),{matches:a}=Z.useContext(qe),{pathname:l}=uo(),c=JSON.stringify(Or(a,t.v7_relativeSplatPath)),d=Z.useRef(!1);return Gr(()=>{d.current=!0}),Z.useCallback(function(u,g){if(g===void 0&&(g={}),process.env.NODE_ENV!=="production"&&Ne(d.current,qr),!d.current)return;if(typeof u=="number"){r.go(u);return}let f=vr(u,JSON.parse(c),l,g.relative==="path");e==null&&o!=="/"&&(f.pathname=f.pathname==="/"?o:$t([o,f.pathname])),(g.replace?r.replace:r.push)(f,g.state,g)},[o,r,c,l,e])}function go(e,o){let{relative:t}=o===void 0?{}:o,{future:r}=Z.useContext(je),{matches:a}=Z.useContext(qe),{pathname:l}=uo(),c=JSON.stringify(Or(a,r.v7_relativeSplatPath));return Z.useMemo(()=>vr(e,JSON.parse(c),l,t==="path"),[e,c,l,t])}var Yr=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Yr||{}),Ht=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ht||{});function Xr(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Xi(e){let o=Z.useContext(Oo);return o||(process.env.NODE_ENV!=="production"?de(!1,Xr(e)):de(!1)),o}function Ki(e){let o=Z.useContext(qe);return o||(process.env.NODE_ENV!=="production"?de(!1,Xr(e)):de(!1)),o}function Kr(e){let o=Ki(e),t=o.matches[o.matches.length-1];return t.route.id||(process.env.NODE_ENV!=="production"?de(!1,e+' can only be used on routes that contain a unique "id"'):de(!1)),t.route.id}function Qi(){return Kr(Ht.UseRouteId)}function Ji(){let{router:e}=Xi(Yr.UseNavigateStable),o=Kr(Ht.UseNavigateStable),t=Z.useRef(!1);return Gr(()=>{t.current=!0}),Z.useCallback(function(a,l){l===void 0&&(l={}),process.env.NODE_ENV!=="production"&&Ne(t.current,qr),t.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Lt({fromRouteId:o},l)))},[e,o])}new Promise(()=>{});/**
|
|
20
|
-
* React Router DOM v6.30.3
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Remix Software Inc.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
26
|
-
*
|
|
27
|
-
* @license MIT
|
|
28
|
-
*/function Ge(){return Ge=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Ge.apply(this,arguments)}function At(e,o){if(e==null)return{};var t={},r=Object.keys(e),a,l;for(l=0;l<r.length;l++)a=r[l],!(o.indexOf(a)>=0)&&(t[a]=e[a]);return t}const vo="get",No="application/x-www-form-urlencoded";function Uo(e){return e!=null&&typeof e.tagName=="string"}function Zi(e){return Uo(e)&&e.tagName.toLowerCase()==="button"}function Ri(e){return Uo(e)&&e.tagName.toLowerCase()==="form"}function es(e){return Uo(e)&&e.tagName.toLowerCase()==="input"}function os(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ts(e,o){return e.button===0&&(!o||o==="_self")&&!os(e)}let qo=null;function rs(){if(qo===null)try{new FormData(document.createElement("form"),0),qo=!1}catch{qo=!0}return qo}const ns=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ft(e){return e!=null&&!ns.has(e)?(process.env.NODE_ENV!=="production"&&Ne(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+No+'"')),null):e}function as(e,o){let t,r,a,l,c;if(Ri(e)){let d=e.getAttribute("action");r=d?Ue(d,o):null,t=e.getAttribute("method")||vo,a=Ft(e.getAttribute("enctype"))||No,l=new FormData(e)}else if(Zi(e)||es(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let i=e.getAttribute("formaction")||d.getAttribute("action");if(r=i?Ue(i,o):null,t=e.getAttribute("formmethod")||d.getAttribute("method")||vo,a=Ft(e.getAttribute("formenctype"))||Ft(d.getAttribute("enctype"))||No,l=new FormData(d,e),!rs()){let{name:u,type:g,value:f}=e;if(g==="image"){let m=u?u+".":"";l.append(m+"x","0"),l.append(m+"y","0")}else u&&l.append(u,f)}}else{if(Uo(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=vo,r=null,a=No,c=e}return l&&a==="text/plain"&&(c=l,l=void 0),{action:r,method:t.toLowerCase(),encType:a,formData:l,body:c}}const ls=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],cs=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],is=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"],ss="6";try{window.__reactRouterVersion=ss}catch{}const Qr=Z.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Qr.displayName="ViewTransition");const ds=Z.createContext(new Map);process.env.NODE_ENV!=="production"&&(ds.displayName="Fetchers"),process.env.NODE_ENV;const us=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gs=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ot=Z.forwardRef(function(o,t){let{onClick:r,relative:a,reloadDocument:l,replace:c,state:d,target:i,to:u,preventScrollReset:g,viewTransition:f}=o,m=At(o,ls),{basename:b}=Z.useContext(je),p,y=!1;if(typeof u=="string"&&gs.test(u)&&(p=u,us))try{let I=new URL(window.location.href),C=u.startsWith("//")?new URL(I.protocol+u):new URL(u),T=Ue(C.pathname,b);C.origin===I.origin&&T!=null?u=T+C.search+C.hash:y=!0}catch{process.env.NODE_ENV!=="production"&&Ne(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let x=qi(u,{relative:a}),k=ps(u,{replace:c,state:d,target:i,preventScrollReset:g,relative:a,viewTransition:f});function w(I){r&&r(I),I.defaultPrevented||k(I)}return Z.createElement("a",Ge({},m,{href:p||x,onClick:y||l?r:w,ref:t,target:i}))});process.env.NODE_ENV!=="production"&&(Ot.displayName="Link");const hs=Z.forwardRef(function(o,t){let{"aria-current":r="page",caseSensitive:a=!1,className:l="",end:c=!1,style:d,to:i,viewTransition:u,children:g}=o,f=At(o,cs),m=go(i,{relative:f.relative}),b=uo(),p=Z.useContext(Ur),{navigator:y,basename:x}=Z.useContext(je),k=p!=null&&ws(m)&&u===!0,w=y.encodeLocation?y.encodeLocation(m).pathname:m.pathname,I=b.pathname,C=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;a||(I=I.toLowerCase(),C=C?C.toLowerCase():null,w=w.toLowerCase()),C&&x&&(C=Ue(C,x)||C);const T=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let j=I===w||!c&&I.startsWith(w)&&I.charAt(T)==="/",M=C!=null&&(C===w||!c&&C.startsWith(w)&&C.charAt(w.length)==="/"),E={isActive:j,isPending:M,isTransitioning:k},P=j?r:void 0,L;typeof l=="function"?L=l(E):L=[l,j?"active":null,M?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let S=typeof d=="function"?d(E):d;return Z.createElement(Ot,Ge({},f,{"aria-current":P,className:L,ref:t,style:S,to:i,viewTransition:u}),typeof g=="function"?g(E):g)});process.env.NODE_ENV!=="production"&&(hs.displayName="NavLink");const fs=Z.forwardRef((e,o)=>{let{fetcherKey:t,navigate:r,reloadDocument:a,replace:l,state:c,method:d=vo,action:i,onSubmit:u,relative:g,preventScrollReset:f,viewTransition:m}=e,b=At(e,is),p=ks(),y=Cs(i,{relative:g}),x=d.toLowerCase()==="get"?"get":"post",k=w=>{if(u&&u(w),w.defaultPrevented)return;w.preventDefault();let I=w.nativeEvent.submitter,C=(I==null?void 0:I.getAttribute("formmethod"))||d;p(I||w.currentTarget,{fetcherKey:t,method:C,navigate:r,replace:l,state:c,relative:g,preventScrollReset:f,viewTransition:m})};return Z.createElement("form",Ge({ref:o,method:x,action:y,onSubmit:a?u:k},b))});process.env.NODE_ENV!=="production"&&(fs.displayName="Form"),process.env.NODE_ENV;var Go;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Go||(Go={}));var Jr;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Jr||(Jr={}));function ms(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Zr(e){let o=Z.useContext(Oo);return o||(process.env.NODE_ENV!=="production"?de(!1,ms(e)):de(!1)),o}function ps(e,o){let{target:t,replace:r,state:a,preventScrollReset:l,relative:c,viewTransition:d}=o===void 0?{}:o,i=Gi(),u=uo(),g=go(e,{relative:c});return Z.useCallback(f=>{if(ts(f,t)){f.preventDefault();let m=r!==void 0?r:Wt(u)===Wt(g);i(e,{replace:m,state:a,preventScrollReset:l,relative:c,viewTransition:d})}},[u,i,g,r,a,t,e,l,c,d])}function bs(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let ys=0,xs=()=>"__"+String(++ys)+"__";function ks(){let{router:e}=Zr(Go.UseSubmit),{basename:o}=Z.useContext(je),t=Qi();return Z.useCallback(function(r,a){a===void 0&&(a={}),bs();let{action:l,method:c,encType:d,formData:i,body:u}=as(r,o);if(a.navigate===!1){let g=a.fetcherKey||xs();e.fetch(g,t,a.action||l,{preventScrollReset:a.preventScrollReset,formData:i,body:u,formMethod:a.method||c,formEncType:a.encType||d,flushSync:a.flushSync})}else e.navigate(a.action||l,{preventScrollReset:a.preventScrollReset,formData:i,body:u,formMethod:a.method||c,formEncType:a.encType||d,replace:a.replace,state:a.state,fromRouteId:t,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,o,t])}function Cs(e,o){let{relative:t}=o===void 0?{}:o,{basename:r}=Z.useContext(je),a=Z.useContext(qe);a||(process.env.NODE_ENV!=="production"?de(!1,"useFormAction must be used inside a RouteContext"):de(!1));let[l]=a.matches.slice(-1),c=Ge({},go(e||".",{relative:t})),d=uo();if(e==null){c.search=d.search;let i=new URLSearchParams(c.search),u=i.getAll("index");if(u.some(f=>f==="")){i.delete("index"),u.filter(m=>m).forEach(m=>i.append("index",m));let f=i.toString();c.search=f?"?"+f:""}}return(!e||e===".")&&l.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(c.pathname=c.pathname==="/"?r:$t([r,c.pathname])),Wt(c)}function ws(e,o){o===void 0&&(o={});let t=Z.useContext(Qr);t==null&&(process.env.NODE_ENV!=="production"?de(!1,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):de(!1));let{basename:r}=Zr(Go.useViewTransitionState),a=go(e,{relative:o.relative});if(!t.isTransitioning)return!1;let l=Ue(t.currentLocation.pathname,r)||t.currentLocation.pathname,c=Ue(t.nextLocation.pathname,r)||t.nextLocation.pathname;return Ar(a.pathname,c)!=null||Ar(a.pathname,l)!=null}const Is={xs:12,sm:14,md:16,lg:18,xl:20},Ts=({children:e,to:o="/",iconSize:t="sm",underline:r="default",isHovered:a=!1,isExternal:l=!1,views:c={icon:{},text:{}},setIsHovered:d=()=>{},...i})=>{const u=()=>{r==="hover"&&d(!0)},g=()=>{r==="hover"&&d(!1)},f=()=>r==="underline"||r==="hover"&&a?"underline":"none";return n.jsx(Ot,{to:o,target:l?"_blank":"_self",style:{textDecoration:"inherit",color:"inherit"},children:n.jsxs(s.Horizontal,{onMouseEnter:u,onMouseLeave:g,gap:3,alignItems:"center",flexWrap:"nowrap",textDecoration:f(),...c.text,...i,children:[e,l&&n.jsx(zr,{widthHeight:Is[t]})]})})},Rr=e=>{const o=$i();return n.jsx(Ts,{...o,...e})},vt={xs:14,sm:18,md:22,lg:26,xl:30},Nt={fast:50,normal:100,slow:300},js=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:r,...a})=>{const{getColor:l,themeMode:c}=s.useTheme(),d=l(t,{themeMode:r||c}),i=typeof e=="number"?e:vt[e],[u,g]=h.useState(0);return h.useEffect(()=>{const f=setInterval(()=>{g(m=>m+45)},Nt[o]);return()=>clearInterval(f)},[o]),n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${i}px`,height:`${i}px`,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:`rotate(${u}deg)`},...a,children:[n.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),n.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("g",{id:"SVGRepo_iconCarrier",children:n.jsx("path",{d:"M21 12a9 9 0 11-6.219-8.56"})})]})},Ss=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:r,...a})=>{const{getColor:l,themeMode:c}=s.useTheme(),d=l(t,{themeMode:r||c}),i=typeof e=="number"?e:vt[e],[u,g]=h.useState(0);return h.useEffect(()=>{const f=setInterval(()=>{g(m=>m+45)},Nt[o]);return()=>clearInterval(f)},[o]),n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${i}px`,height:`${i}px`,style:{transform:`rotate(${u}deg)`},...a,children:[n.jsx("circle",{cx:"10",cy:"25",r:"4",fill:d}),n.jsx("circle",{cx:"25",cy:"25",r:"4",fill:d}),n.jsx("circle",{cx:"40",cy:"25",r:"4",fill:d})]})},Ms=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:r,...a})=>{const{getColor:l,themeMode:c}=s.useTheme(),d=l(t,{themeMode:r||c}),i=typeof e=="number"?e:vt[e],[u,g]=h.useState(0);return h.useEffect(()=>{const f=setInterval(()=>{g(m=>m+45)},Nt[o]);return()=>clearInterval(f)},[o]),n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${i}px`,height:`${i}px`,style:{transform:`rotate(${u}deg)`},...a,children:n.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:d,strokeWidth:"5",strokeDasharray:"1,10"})})},zs=({size:e,children:o,textColor:t,loaderColor:r,type:a="default",speed:l="normal",textPosition:c="right",views:d,...i})=>{const{getColor:u}=s.useTheme();r=u(r||i.color||"theme-loading"),t=u(t||i.color||"theme-loading");const g={size:e,speed:l,color:r},f={default:n.jsx(js,{...g}),dotted:n.jsx(Ss,{...g}),quarter:n.jsx(Ms,{...g})};return n.jsxs(s.Center,{gap:10,flexDirection:c==="top"||c==="bottom"?"column":"row",...i,...d==null?void 0:d.container,children:[(c==="left"||c==="top")&&o&&n.jsx(s.View,{color:t,...d==null?void 0:d.text,children:o}),f[a],(c==="right"||c==="bottom")&&o&&n.jsx(s.View,{color:t,...d==null?void 0:d.text,children:o})]})},ho=e=>n.jsx(zs,{...e}),Es={xs:10,sm:12,md:14,lg:16,xl:20},fo={xs:12,sm:16,md:20,lg:24,xl:28},mo=e=>({minHeight:fo[e]*2,paddingHorizontal:fo[e]/2,fontSize:Es[e],fontWeight:500,lineHeight:fo[e],letterSpacing:"-0.01em",paddingInline:fo[e],paddingBlock:fo[e]/2,outlineWidth:"medium"}),en={xs:mo("xs"),sm:mo("sm"),md:mo("md"),lg:mo("lg"),xl:mo("xl")},po={square:0,rounded:8,pill:999},on={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}},Vs=(e,o,t=!1)=>{const r=t?o:e,a=t?e:o,l=t?o:e;return{filled:{backgroundColor:r,color:a,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 ${r}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},empty:{backgroundColor:"transparent",color:l,borderWidth:1,borderStyle:"solid",borderColor:l,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${l}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},outline:{backgroundColor:"transparent",color:l,borderWidth:1,borderStyle:"solid",borderColor:l,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${l}`},transition:"background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease"},ghost:{backgroundColor:"transparent",color:l,borderWidth:1,borderStyle:"solid",borderColor:"transparent",_hover:{borderWidth:1,borderStyle:"solid",borderColor:l,color:l,opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${l}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},link:{backgroundColor:"transparent",color:l,borderWidth:0,borderStyle:"none",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"2px",textDecorationThickness:"1px",textDecorationColor:l,_hover:{opacity:.8},_active:{opacity:.9},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${l}`},transition:"opacity 0.2s ease"},subtle:{backgroundColor:t?`color-mix(in srgb, ${l} 20%, transparent)`:`color-mix(in srgb, ${l} 5%, transparent)`,color:l,borderWidth:1,borderStyle:"solid",borderColor:l,_hover:{backgroundColor:t?`color-mix(in srgb, ${l} 40%, transparent)`:`color-mix(in srgb, ${l} 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 ${l}`},transition:"all 0.2s ease"}}},Ps=({children:e,icon:o,isLoading:t,iconPosition:r="left",loaderPosition:a="left",size:l="md",resolvedTextColor:c,isIconRounded:d,views:i})=>{const u=["left","right"].includes(r)?s.Horizontal:s.Vertical,g=en[l],f=d?on[l]:{};return n.jsxs(u,{gap:8,alignItems:"center",justifyContent:"center",...g,...f,...i==null?void 0:i.content,children:[t&&a==="left"&&n.jsx(ho,{size:l==="xs"||l==="sm"?"sm":"md",color:c,...i==null?void 0:i.loader}),o&&["left","top"].includes(r)&&!t&&n.jsx(s.View,{color:c,...i==null?void 0:i.icon,children:o}),e,o&&["right","bottom"].includes(r)&&!t&&n.jsx(s.View,{color:c,...i==null?void 0:i.icon,children:o}),t&&a==="right"&&n.jsx(ho,{size:l==="xs"||l==="sm"?"sm":"md",color:c,...i==null?void 0:i.loader})]})},Ws=e=>{const o=po[e];return typeof o=="number"?o:typeof o=="string"&&parseInt(o,10)||0},_s=({asComponent:e,isDisabled:o,isLoading:t,isWrapped:r=!1,borderRadius:a,width:l,height:c,baseStyles:d,sizeStyles:i,iconPad:u,mainTone:g,resolvedTextColor:f,children:m,borderWidth:b=0,...p})=>n.jsx(s.Element,{as:e,disabled:!!(o||t),display:r?"flex":"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:a,width:l,height:c,...d,...i,...u,backgroundColor:(d==null?void 0:d.backgroundColor)||(r?g:void 0),color:f,borderWidth:r?0:void 0,cursor:o?"default":"pointer",...p,children:m}),$s=({shape:e,isDisabled:o,onClick:t,shadow:r,borderWidth:a,isAuto:l,isFilled:c,views:d,children:i,...u})=>n.jsx(s.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:po[e],cursor:o?"default":"pointer",onClick:t,boxShadow:r,padding:a,width:l?"fit-content":c?"100%":void 0,...d==null?void 0:d.container,...u,children:i}),Ls=({variant:e,animation:o,to:t,isDisabled:r,isLoading:a,isAuto:l,isFilled:c,isExternal:d,shape:i="rounded",shadow:u,onClick:g,views:f,baseStyles:m,sizeStyles:b,iconPad:p,resolvedTextColor:y,content:x,size:k,mainTone:w,borderMovingDuration:I=2,borderMovingGradientColors:C=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:T="#705CFF",animatedStrokeTextColor:j="#333333",getColor:M=P=>P,...E})=>{var D;const P=Ws(i),L=t?n.jsx(Rr,{to:t,isExternal:d,color:"currentColor",textDecoration:"inherit",_hover:{color:"currentColor"},...f==null?void 0:f.link,children:x}):x,S={isDisabled:r,isLoading:a,baseStyles:m,sizeStyles:b,iconPad:p,resolvedTextColor:y,mainTone:w,children:L};if(o==="borderMoving"&&C){const V={from:{backgroundPosition:"0% 50%"},to:{backgroundPosition:"200% 50%"},duration:`${I}s`,timingFunction:"linear",iterationCount:"infinite"};return n.jsx($s,{shape:i,isDisabled:r,onClick:g,shadow:u,borderWidth:3,isAuto:l,isFilled:c,views:f,background:`linear-gradient(90deg, ${C[0]}, ${C[1]}, ${C[2]}, ${C[0]})`,backgroundSize:"200% 100%",animate:V,...E,children:n.jsx(_s,{asComponent:t?"div":"button",isWrapped:!0,borderRadius:Math.max(0,P-3),width:"100%",height:"100%",...S})})}if(o==="animatedStroke"){const H=M(T),V=M(j),W=1e3,$={from:{strokeWidth:"8px",strokeDasharray:`0 ${W}`,strokeDashoffset:-Math.round(W*.63)},to:{strokeWidth:"3px",strokeDasharray:`${W}`,strokeDashoffset:0},duration:"0.9s",timingFunction:"ease-in",fillMode:"forwards"},_=["group",(D=f==null?void 0:f.container)==null?void 0:D.className,E==null?void 0:E.className].filter(Boolean).join(" ");return n.jsxs(s.Element,{as:t?"div":"button",type:t?void 0:"button",disabled:!!(!t&&(r||a)),onClick:g,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:l?"fit-content":c?"100%":void 0,borderRadius:po[i],boxShadow:u,transition:"all 0.2s ease",cursor:r?"default":"pointer",color:V,backgroundColor:"transparent",borderWidth:0,...f==null?void 0:f.container,...E,className:_,children:[n.jsx(s.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:n.jsx(s.View,{as:"rect",x:"0",y:"0",height:"100%",width:"100%",rx:P,ry:P,fill:"transparent",stroke:H,strokeWidth:"8px",strokeDasharray:`0 ${W}`,strokeDashoffset:-Math.round(W*.63),pathLength:W,on:{groupHover:{animate:$}}})}),n.jsx(s.View,{position:"relative",zIndex:0,children:L})]})}if(o==="borderReveal"){const V=(C==null?void 0:C[0])||w||"#000000",$=I*.75/4,_=`linear-gradient(90deg, ${V} 50%, transparent 50%)`,B=`linear-gradient(180deg, ${V} 50%, transparent 50%)`,A=`linear-gradient(270deg, ${V} 50%, transparent 50%)`,F=`linear-gradient(0deg, ${V} 50%, transparent 50%)`,v="100% 0, 100% 100%, 0 100%, 0 0",O="0 0, 100% 0, 100% 100%, 0 100%",N=`0s, ${$}s, ${$*2}s, ${$*2}s`,K=`${$*2}s, ${$*2}s, ${$}s, 0s`,Q=4;return n.jsx(s.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:po[i],cursor:r?"default":"pointer",onClick:g,boxShadow:u,padding:3,background:`
|
|
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,u,i,Kt,tt,Xa,Ka,xe){"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,d=()=>e==="multiple"?Array.isArray(c)?c:c?[c]:[]:Array.isArray(c)?c[0]:c,[s,g]=u.useState(d()),h=u.useMemo(()=>rt("accordion"),[]),f=a?o:s,m=u.useMemo(()=>f===void 0?[]:Array.isArray(f)?f:[f],[f]);u.useEffect(()=>{a&&(e==="multiple"&&!Array.isArray(o)?(console.warn('Accordion with type="multiple" received non-array value:',o),g(o?[String(o)]:[])):e==="single"&&Array.isArray(o)?(console.warn('Accordion with type="single" received array value:',o),g(o.length>0?o[0]:void 0)):g(o))},[o,a,e]);const p=u.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||g(y),n&&n(y)},[e,f,l,a,n]),b=u.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"}}},Qt=u.createContext({expandedItems:[],toggleItem:()=>{},isItemExpanded:()=>!1,type:"single",collapsible:!1,baseId:""}),Ra=({children:e,value:o})=>r.jsx(Qt.Provider,{value:o,children:e}),Zt=()=>{const e=u.useContext(Qt);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}=Zt(),d=a(e),s=`${c}-trigger-${e}`,g=`${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:u.Children.map(o,h=>u.isValidElement(h)?u.cloneElement(h,{...h.props,value:e,isExpanded:d,isDisabled:t,triggerId:s,contentId:g}):h)})},ol=({children:e,value:o,isExpanded:t,isDisabled:n,triggerId:l,contentId:a,views:c,asChild:d=!1,...s})=>{const{toggleItem:g}=Zt(),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&&g(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&&u.isValidElement(e)){const m=u.Children.only(e);return u.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:d,...s})=>r.jsx(i.Vertical,{width:"100%","data-orientation":"vertical",...Za[o],...Ja[t],...n==null?void 0:n.container,...s,children:e}),wo=({children:e,type:o="single",value:t,defaultValue:n,onValueChange:l,collapsible:a=!1,shape:c="rounded",variant:d="default",views:s,...g})=>{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:d,views:s,baseId:f.baseId,type:f.type,collapsible:f.collapsible,...g,children:e})})};wo.Item=el,wo.Trigger=ol,wo.Content=tl;const nt=({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}),nl=(e,o,t)=>{const{getColor:n}=i.useTheme(),l=n(o);return{fill:e?l:"none",stroke:l,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}},Io=({name:e="circle",widthHeight:o=24,color:t="currentColor",filled:n=!1,strokeWidth:l=1,size:a,children:c,fallback:d,...s})=>{const g=a||o;if(!e)return r.jsx(nt,{widthHeight:o,color:t,...s,children:c});const h=e.toLowerCase().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if(!(h in Kt))return r.jsx(nt,{widthHeight:g,color:t,...s,children:d||c});const f=u.lazy(Kt[h]),m=nl(n,t,l);return r.jsx(nt,{widthHeight:g,color:t,...s,children:r.jsx(u.Suspense,{fallback:d||null,children:r.jsx(f,{size:g,...m})})})},U=(e,o={})=>{const t=n=>r.jsx(Io,{name:e,...o,...n});return t.displayName=`${e}Icon`,t},al=U("user",{filled:!1}),ll=U("circle-help",{filled:!1}),cl=U("folder",{filled:!1}),le=U("chevron-up",{filled:!1}),il=U("grip-vertical",{filled:!1}),oo=U("file",{filled:!1}),sl=U("video",{filled:!1}),dl=U("image",{filled:!1}),To=U("volume",{filled:!1}),gl=U("twitter",{filled:!1}),ul=U("x",{filled:!1}),hl=U("twitch",{filled:!1}),pe=U("x",{filled:!1,strokeWidth:2}),fl=U("instagram",{filled:!1}),ml=U("youtube",{filled:!1}),pl=U("facebook",{filled:!1}),bl=U("linkedin",{filled:!1}),yl=U("at-sign",{filled:!1}),Jt=U("minus",{filled:!1}),je=U("info",{filled:!1}),at=U("play",{filled:!1}),Rt=U("pause",{filled:!1}),xl=U("heart",{filled:!1}),kl=U("star",{filled:!1}),Cl=U("save",{filled:!1}),lt=U("triangle-alert",{filled:!1}),wl=U("battery",{filled:!1}),Il=U("bookmark",{filled:!1}),Tl=U("cloud",{filled:!1}),jl=U("copy",{filled:!1}),jo=U("trash",{filled:!1}),Sl=jo,Ml=U("edit",{filled:!1}),ct=U("mic",{filled:!1}),So=U("square",{filled:!1}),it=U("send",{filled:!1}),st=U("loader",{filled:!1}),to=U("paperclip",{filled:!1}),Mo=U("search",{filled:!1}),zl=U("home",{filled:!1}),er=U("settings",{filled:!1}),Vl=U("download",{filled:!1}),or=U("share",{filled:!1}),zo=U("check",{filled:!1}),El=U("plus",{filled:!1}),dt=U("eye-off",{filled:!1}),gt=U("eye",{filled:!1}),Pl=U("lock",{filled:!1}),Wl=U("user",{filled:!1}),tr=U("external-link",{filled:!1}),ut=U("check-circle",{filled:!1}),Vo=U("alert-circle",{filled:!1}),_l=U("bell",{filled:!1}),$l=U("file-text",{filled:!1}),Hl=U("bar-chart",{filled:!1}),Bl=U("moon",{filled:!1}),rr=U("panel-left",{filled:!1}),ht=U("upload",{filled:!1}),Ll=zo,Al=e=>r.jsx(le,{orientation:"left",...e}),Dl=U("zoom-out",{filled:!1}),Fl=U("type",{filled:!1}),Ol=U("shapes",{filled:!1}),ql=U("rotate-cw",{filled:!1}),Nl=U("gift",{filled:!1}),Ul=U("shield",{filled:!1}),Gl=U("log-out",{filled:!1}),Yl=U("power",{filled:!1}),vl=U("link",{filled:!1}),Xl=U("layout",{filled:!1}),Kl=U("zap",{filled:!1}),Ql=U("credit-card",{filled:!1}),Zl=U("more-horizontal",{filled:!1}),Jl=jo,Rl=U("filter",{filled:!1}),ec=U("calendar",{filled:!1}),oc=U("clock",{filled:!1}),tc=U("map-pin",{filled:!1}),rc=U("menu",{filled:!1}),nc=U("refresh-cw",{filled:!1}),ac=U("printer",{filled:!1}),lc=U("wand",{filled:!1}),cc=U("thumbs-down",{filled:!1}),ic=U("thumbs-up",{filled:!1}),sc=U("camera",{filled:!1}),dc=U("bluetooth",{filled:!1}),gc=U("unlock",{filled:!1}),uc=U("wifi",{filled:!1}),hc=U("arrow-right",{filled:!1}),fc=U("arrow-up",{filled:!1}),mc=U("loader",{filled:!1}),pc=U("sliders-horizontal",{filled:!1}),bc=U("crop",{filled:!1}),yc=U("zoom-in",{filled:!1}),xc=U("grip-horizontal",{filled:!1}),nr=U("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=({icon:e,title:o="",views:t,description:n="",variant:l="default",themeMode:a,children:c,...d})=>{const{themeMode:s}=i.useTheme(),g=kc(),h=()=>{var p;if(e)return e;const m={size:20,color:((p=t==null?void 0:t.icon)==null?void 0:p.color)??g[l].icon.color};switch(l){case"info":return r.jsx(je,{...m});case"success":return r.jsx(ut,{...m});case"error":return r.jsx(Vo,{...m});case"warning":default:return r.jsx(lt,{...m})}};return r.jsxs(i.Horizontal,{gap:12,padding:"16px",flexWrap:"nowrap",alignItems:"flex-start",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:g[l].container.borderColor,backgroundColor:g[l].container.backgroundColor,boxShadow:g[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:h()}),r.jsxs(i.Vertical,{gap:8,children:[" ",r.jsx(i.Text,{fontSize:"16px",fontWeight:"600",lineHeight:"24px",color:g[l].content.color,backgroundColor:g[l].container.backgroundColor,...t==null?void 0:t.title,children:o}),r.jsx(i.Text,{fontSize:"14px",fontWeight:"400",lineHeight:"20px",color:g[l].content.color,backgroundColor:g[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=u.useRef(null),l=60,a=32,[c,d]=u.useState([]);return u.useEffect(()=>{if(!e){d(Array(l).fill(-1));return}const s=e.frequencyBinCount,g=new Uint8Array(s),h=()=>{e.getByteTimeDomainData(g);let f=0;for(let p=0;p<s;p++){const b=(g[p]-128)/128;f+=b*b}const m=Math.sqrt(f/s);u.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(Sc,{bars:c,isPaused:o,...t})},Eo=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,g)=>e({visible:!0,variant:o,title:t,subtitle:n,isClosable:l,views:a,action:c,actionText:d,showIcon:s,timeout:g}),hide:()=>e({visible:!1})})),ar=(e,o,t,n)=>{Eo.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=()=>{Eo.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:d=!1,isClosable:s=!1,timeout:g=3e3,views:h})=>{var k,w;u.useEffect(()=>{if(g&&!s){const I=setTimeout(()=>{o()},g);return()=>{clearTimeout(I)}}},[]);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(je,{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(Vo,{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})})]})},zc=({container:e,theme:o,position:t="topRight"})=>{const{visible:n,title:l,variant:a,subtitle:c,isClosable:d,views:s,action:g,actionText:h,showIcon:f,timeout:m}=Eo(),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:d,views:s,action:g,actionText:h,showIcon:f,timeout:m,hide:()=>lr()}),x=e?u.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=d=>{ar("error","Error",d)}})=>{const d=u.useRef(null),s=u.useRef(null),[g,h]=u.useState(null),[f,m]=u.useState([]),[p,b]=u.useState(null),[x,y]=u.useState(null),[k,w]=u.useState(l||null),I=u.useCallback(T=>{const j=T.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 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 B=n(P);if(B){c(`${P.name}: ${B}`),b(`${P.name}: ${B}`);continue}}V.push(P)}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/")&&Vc(z,w),o&&(h(z),o(z))}},[e,o,t,n,a]),C=()=>{var T;return(T=d.current)==null?void 0:T.click()};return u.useEffect(()=>()=>{x&&URL.revokeObjectURL(x),k&&URL.revokeObjectURL(k)},[x,k]),{previewUrl:x,thumbnailUrl:k,errorMessage:p,fileInputRef:d,videoRef:s,selectedFile:g,selectedFiles:f,handleFileChange:I,handleClick:C}},Pc=({accept:e,isLoading:o=!1,progress:t=0,icon:n,text:l,previewUrl:a,thumbnailUrl:c,errorMessage:d,fileInputRef:s,videoRef:g,selectedFile:h,selectedFiles:f,handleFileChange:m,handleClick:p,multiple:b=!1,containerProps:x,errorMessageProps:y,progressProps:k,videoProps:w,imageProps:I,iconProps:C,textProps:T,fileType:j,previewUrl:z,renderError:V=({errorMessage:W,errorMessageProps:$,themeMode:_})=>r.jsx(i.Text,{color:"red",fontSize:12,marginTop:8,...$,...E==null?void 0:E.text,children:W}),renderText:P=({text:W,textProps:$})=>r.jsx(i.Text,{marginTop:8,...$,...E==null?void 0:E.text,children:W}),renderFile:B=({selectedFile:W,textProps:$})=>W?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:W.name}),r.jsxs(i.Text,{...$,...E==null?void 0:E.text,children:["(",Math.round(W.size/1024)," KB)"]})]}):null,renderVideo:S=({selectedFile:W,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:W?URL.createObjectURL(W):void 0,style:{objectFit:"cover"},ref:$,..._,...E==null?void 0:E.view})}),renderImage:H=({previewUrl:W,imageProps:$})=>(console.log("Rendering image with URL:",W),r.jsx(i.View,{width:"100%",height:"100%",position:"relative",...E==null?void 0:E.view,children:r.jsx(i.Image,{src:W,alt:"Preview",width:"100%",height:"100%",objectFit:"cover",style:{maxHeight:"100%",maxWidth:"100%"},...$,...E==null?void 0:E.image})})),renderProgress:A=({progress:W,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:`${W}%`,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:[W,"%"]})]}),views:E={}})=>{const W=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"&&W&&H({previewUrl:W,imageProps:I}),t===100&&j==="video"&&c&&S({selectedFile:h,thumbnailUrl:c,videoRef:g,videoProps:w,imageProps:I}),t===100&&j==="file"&&h&&B({selectedFile:h,textProps:T}),t<100&&(n||r.jsx(ht,{widthHeight:32,...C})),!o&&!h&&l&&P({text:l,textProps:T}),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})]})},Po=({accept:e="*/*",icon:o,text:t,maxSize:n,onFileSelect:l,onMultipleFileSelect:a,validateFile:c,isLoading:d=!1,progress:s=0,fileType:g,multiple:h=!1,...f})=>{const{previewUrl:m,thumbnailUrl:p,errorMessage:b,videoRef:x,fileInputRef:y,selectedFile:k,selectedFiles:w,handleFileChange:I,handleClick:C}=Ec({maxSize:n,onFileSelect:l,onMultipleFileSelect:a,validateFile:c,multiple:h}),j=(()=>{if(g)return g;if(k)return k.type.startsWith("image/")?"image":k.type.startsWith("video/")?"video":"file"})();return r.jsx(Pc,{handleClick:C,accept:e,isLoading:d,progress:s,icon:o,text:t,maxSize:n,onFileSelect:l,validateFile:c,errorMessage:b,handleFileChange:I,selectedFile:k,selectedFiles:w,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:d,resumeRecording:s,resetRecording:g,handleFileChange:h,...f}){const[m,p]=u.useState(null);return u.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(Po,{accept:"audio/*",icon:r.jsx(to,{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(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(So,{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]=u.useState(!1),[t,n]=u.useState(!1),[l,a]=u.useState(0),[c,d]=u.useState(null),[s,g]=u.useState(null),[h,f]=u.useState(null),m=u.useRef(null),p=u.useRef(null),b=u.useRef(null),x=u.useRef(null),y=u.useRef([]),k=u.useRef(null),w=typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",I=u.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),g(null),k.current&&(clearInterval(k.current),k.current=null)},[]),C=u.useCallback(async()=>{I(),d(null),a(0),y.current=[];try{const P=await navigator.mediaDevices.getUserMedia({audio:!0});x.current=P;const B=MediaRecorder.isTypeSupported(w)?w:void 0,S=new MediaRecorder(P,B?{mimeType:B}:void 0);m.current=S;const H=new(window.AudioContext||window.webkitAudioContext);p.current=H;const A=H.createMediaStreamSource(P),E=H.createAnalyser();E.fftSize=256,E.smoothingTimeConstant=.8,A.connect(E),b.current=E,g(E),S.ondataavailable=W=>{W.data.size>0&&y.current.push(W.data)},S.onstop=()=>{const W=new Blob(y.current,{type:S.mimeType||w});f(W),I()},S.start(),o(!0),n(!1),k.current=setInterval(()=>{a(W=>W+1)},1e3)}catch{d("Microphone access denied or unavailable."),I()}},[I]),T=u.useCallback(()=>{m.current&&m.current.state!=="inactive"&&m.current.stop(),o(!1),n(!1),k.current&&(clearInterval(k.current),k.current=null)},[]),j=u.useCallback(()=>{m.current&&m.current.state==="recording"&&(m.current.pause(),n(!0),k.current&&(clearInterval(k.current),k.current=null))},[]),z=u.useCallback(()=>{m.current&&m.current.state==="paused"&&(m.current.resume(),n(!1),k.current||(k.current=setInterval(()=>{a(P=>P+1)},1e3)))},[]),V=u.useCallback(()=>{I(),o(!1),n(!1),f(null),a(0),d(null),y.current=[]},[I]);return u.useEffect(()=>()=>I(),[I]),{recording:e,paused:t,audioBlob:h,analyserNode:s,duration:l,error:c,startRecording:C,stopRecording:T,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:g,resetRecording:h}=ir();return u.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:g,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]=u.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:d})=>{const s=Bc[o],g={...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:g,width:s,height:s,onError:()=>a(!0)}):r.jsx(i.Text,{size:o,...mt.fallback,...n==null?void 0:n.fallback,children:t}),d]})},Ac=({src:e,size:o,views:t,fallback:n,onClick:l,children:a})=>{const{imageError:c,setImageError:d}=Hc();return r.jsx(Lc,{src:e,size:o,views:t,fallback:n,imageError:c,setImageError:d,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=({content:e,children:o,icon:t,pastil:n,position:l,shape:a="pill",variant:c="filled",size:d="md",views:s,themeMode:g,...h})=>{const{themeMode:f}=i.useTheme(),m=qc()[c],p=sr(),b={width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",borderRadius:Fc[a],...Dc[d],...m,...l?Oc[l]:{},...s==null?void 0:s.container};let x="currentColor";return typeof n=="string"?n in p?x=p[n].indicator.backgroundColor:x=n:n===!0&&(x="color-green-500",c==="filled"&&(x="color-white")),r.jsxs(i.Center,{role:"badge",...b,...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:x,...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:b.color,children:o||e})]})},Uc=e=>r.jsx(Nc,{...e}),Gc=()=>{const[e,o]=u.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:d=()=>{},...s})=>{const g=()=>{n==="hover"&&d(!0)},h=()=>{n==="hover"&&d(!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:g,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(),d=a(t,{themeMode:n||c}),s=typeof e=="number"?e:pt[e],[g,h]=u.useState(0);return u.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:d,strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:`rotate(${g}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(),d=a(t,{themeMode:n||c}),s=typeof e=="number"?e:pt[e],[g,h]=u.useState(0);return u.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(${g}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})]})},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:pt[e],[g,h]=u.useState(0);return u.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(${g}deg)`},...l,children:r.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:d,strokeWidth:"5",strokeDasharray:"1,10"})})},Zc=({size:e,children:o,textColor:t,loaderColor:n,type:l="default",speed:a="normal",textPosition:c="right",views:d,...s})=>{const{getColor:g}=i.useTheme();n=g(n||s.color||"theme-loading"),t=g(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,...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})]})},ro=e=>r.jsx(Zc,{...e}),Jc={xs:10,sm:12,md:14,lg:16,xl:20},no={xs:12,sm:16,md:20,lg:24,xl:28},ao=e=>({minHeight:no[e]*2,paddingHorizontal:no[e]/2,fontSize:Jc[e],fontWeight:500,lineHeight:no[e],letterSpacing:"-0.01em",paddingInline:no[e],paddingBlock:no[e]/2,outlineWidth:"medium"}),gr={xs:ao("xs"),sm:ao("sm"),md:ao("md"),lg:ao("lg"),xl:ao("xl")},lo={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:"all 0.2s ease"}}},ei=({children:e,icon:o,isLoading:t,iconPosition:n="left",loaderPosition:l="left",size:a="md",resolvedTextColor:c,isIconRounded:d,views:s})=>{const g=["left","right"].includes(n)?i.Horizontal:i.Vertical,h=gr[a],f=d?ur[a]:{};return r.jsxs(g,{gap:8,alignItems:"center",justifyContent:"center",...h,...f,...s==null?void 0:s.content,children:[t&&l==="left"&&r.jsx(ro,{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(ro,{size:a==="xs"||a==="sm"?"sm":"md",color:c,...s==null?void 0:s.loader})]})},oi=e=>{const o=lo[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:d,sizeStyles:s,iconPad:g,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,...g,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}),ri=({shape:e,isDisabled:o,onClick:t,shadow:n,borderWidth:l,isAuto:a,isFilled:c,views:d,children:s,...g})=>r.jsx(i.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:lo[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,...g,children:s}),ni=({variant:e,animation:o,to:t,isDisabled:n,isLoading:l,isAuto:a,isFilled:c,isExternal:d,shape:s="rounded",shadow:g,onClick:h,views:f,baseStyles:m,sizeStyles:p,iconPad:b,resolvedTextColor:x,content:y,size:k,mainTone:w,borderMovingDuration:I=2,borderMovingGradientColors:C=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:T="#705CFF",animatedStrokeTextColor:j="#333333",getColor:z=P=>P,...V})=>{var H;const P=oi(s),B=t?r.jsx(dr,{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:B};if(o==="borderMoving"&&C){const E={from:{backgroundPosition:"0% 50%"},to:{backgroundPosition:"200% 50%"},duration:`${I}s`,timingFunction:"linear",iterationCount:"infinite"};return r.jsx(ri,{shape:s,isDisabled:n,onClick:h,shadow:g,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(ti,{asComponent:t?"div":"button",isWrapped:!0,borderRadius:Math.max(0,P-3),width:"100%",height:"100%",...S})})}if(o==="animatedStroke"){const A=z(T),E=z(j),W=1e3,$={from:{strokeWidth:"8px",strokeDasharray:`0 ${W}`,strokeDashoffset:-Math.round(W*.63)},to:{strokeWidth:"3px",strokeDasharray:`${W}`,strokeDashoffset:0},duration:"0.9s",timingFunction:"ease-in",fillMode:"forwards"},_=["group",(H=f==null?void 0:f.container)==null?void 0:H.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:lo[s],boxShadow:g,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:P,ry:P,fill:"transparent",stroke:A,strokeWidth:"8px",strokeDasharray:`0 ${W}`,strokeDashoffset:-Math.round(W*.63),pathLength:W,on:{groupHover:{animate:$}}})}),r.jsx(i.View,{position:"relative",zIndex:0,children:B})]})}if(o==="borderReveal"){const E=(C==null?void 0:C[0])||w||"#000000",$=I*.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`,K=`${$*2}s, ${$*2}s, ${$}s, 0s`,Q=4;return r.jsx(i.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:lo[s],cursor:n?"default":"pointer",onClick:h,boxShadow:g,padding:3,background:`
|
|
29
2
|
${_} no-repeat,
|
|
30
|
-
${
|
|
31
|
-
${
|
|
3
|
+
${L} no-repeat,
|
|
4
|
+
${D} no-repeat,
|
|
32
5
|
${F} no-repeat
|
|
33
|
-
`,backgroundSize:`200% ${Q}px, ${Q}px 200%, 200% ${Q}px, ${Q}px 200%`,backgroundPosition:v,transitionProperty:"background-position",transitionDuration:`${$}s`,transitionTimingFunction:"linear",transitionDelay:K,_hover:{backgroundPosition:O,transitionDelay:N},width:l?"fit-content":c?"100%":void 0,...f==null?void 0:f.container,...E,children:n.jsx(s.View,{as:t?"div":"button",disabled:!!(r||a),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:Math.max(0,P-3),width:"100%",height:"100%",...m,...b,...p,backgroundColor:(m==null?void 0:m.backgroundColor)||w,color:y,borderWidth:0,cursor:r?"default":"pointer",children:L})})}return n.jsx(s.Element,{as:e==="link"&&t?"div":"button",type:e==="link"&&t?void 0:"button",disabled:!!(r||a),...b,...p,display:"inline-flex",alignItems:"center",justifyContent:"center",width:l?"fit-content":c?"100%":void 0,borderRadius:po[i],boxShadow:u,transition:"all 0.2s ease",cursor:r?"default":"pointer",onClick:g,...m,...f==null?void 0:f.container,...E,children:L})},Ds=({variant:e="filled",size:o="md",shape:t="rounded",iconPosition:r="left",loaderPosition:a="left",backgroundColor:l,color:c,textColor:d,reversed:i=!1,isAuto:u=!0,isFilled:g,isDisabled:f,isLoading:m,isIconRounded:b,isHovered:p,icon:y,children:x,to:k,isExternal:w,shadow:I,onClick:C,views:T={},borderMovingDuration:j=2,borderMovingGradientColors:M=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:E="#705CFF",animatedStrokeTextColor:P="#333333",...L})=>{const{getColorHex:S}=s.useTheme();let V=S(f?"theme-disabled":m?"theme-loading":l??c??"theme-button-background");(V==="theme-button-background"||V==="theme-loading")&&(V=S(m?"color-dark-500":"theme-primary"));let $=S(d??"theme-button-text");$==="theme-button-text"&&($=S("color-white"));const B=h.useMemo(()=>Vs(V,$,i),[V,$,i])[e],A=(B==null?void 0:B.color)??$,F=n.jsx(Ps,{icon:y,isLoading:m,iconPosition:r,loaderPosition:a,size:o,resolvedTextColor:A,isIconRounded:b,views:T,children:x}),v=en[o],O=b?on[o]:{};return n.jsx(Ls,{variant:e,animation:L.animation,to:k,isDisabled:f,isLoading:m,isAuto:u,isFilled:g,isExternal:w,shape:t,shadow:I,onClick:C,views:T,baseStyles:B,sizeStyles:v,iconPad:O,resolvedTextColor:A,content:F,size:o,mainTone:V,borderMovingDuration:j,borderMovingGradientColors:M,animatedStrokeAccentColor:E,animatedStrokeTextColor:P,getColor:S,...L})},$e=e=>{const[o,t]=s.useHover();return n.jsx(Ds,{ref:o,isHovered:t,...e})},Bs={sm:{padding:"12px"},md:{padding:"16px"},lg:{padding:"24px"}},Hs={square:0,rounded:"8px",pill:"24px"},As=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)"}}}},Yo=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"}}},tn=h.createContext({}),Ut=()=>h.useContext(tn),qt=({children:e,views:o,style:t,themeMode:r,...a})=>{var u;const l=s.useTheme(),{styles:c}=Ut(),d=Yo(l).header,i={...d,...c==null?void 0:c.header,...a,style:{...d==null?void 0:d.style,...(u=c==null?void 0:c.header)==null?void 0:u.style,...t}};return n.jsx(s.Vertical,{gap:8,...i,children:e})},Gt=({children:e,views:o,style:t,themeMode:r,...a})=>{var u;const l=s.useTheme(),{styles:c}=Ut(),d=Yo(l).content,i={...d,...c==null?void 0:c.content,...a,style:{...d==null?void 0:d.style,...(u=c==null?void 0:c.content)==null?void 0:u.style,...t}};return n.jsx(s.Vertical,{gap:12,...i,children:e})},Yt=({children:e,views:o,style:t,themeMode:r,...a})=>{var u;const l=s.useTheme(),{styles:c}=Ut(),d=Yo(l).footer,i={...d,...c==null?void 0:c.footer,...a,style:{...d==null?void 0:d.style,...(u=c==null?void 0:c.footer)==null?void 0:u.style,...t}};return n.jsx(s.Vertical,{gap:8,...i,children:e})},Fs=({variant:e="default",size:o="md",shape:t="rounded",children:r,header:a,footer:l,isFullWidth:c=!1,views:d,style:i,themeMode:u,...g})=>{var C,T;const f=s.useTheme(),m=Yo(f),b=((C=Bs[o])==null?void 0:C.padding)||"16px",p=h.useMemo(()=>({styles:{container:{...m.container,borderRadius:Hs[t],...d==null?void 0:d.container},header:{...m.header,padding:b,...d==null?void 0:d.header},content:{...m.content,padding:b,...d==null?void 0:d.content},footer:{...m.footer,padding:b,...d==null?void 0:d.footer}}}),[m,d,b,t]),y=h.Children.toArray(r).some(j=>h.isValidElement(j)&&(j.type===qt||j.type===Gt||j.type===Yt)),{themeMode:x}=f,w=As(u||x)[e],I={width:c?"100%":"auto",overflow:"hidden",...w,...p.styles.container,...g,style:{...(T=p.styles.container)==null?void 0:T.style,...i}};return n.jsx(tn.Provider,{value:p,children:n.jsx(s.View,{...I,children:y?r:n.jsxs(s.Vertical,{width:"100%",children:[a&&n.jsx(qt,{children:a}),n.jsx(Gt,{children:r}),l&&n.jsx(Yt,{children:l})]})})})},Xo=e=>n.jsx(Fs,{...e});Xo.Header=qt,Xo.Content=Gt,Xo.Footer=Yt;const Os=({defaultActiveIndex:e=0,activeIndex:o,onChange:t,autoPlay:r=!1,autoPlayInterval:a=3e3,pauseOnHover:l=!0,infinite:c=!0,totalSlides:d,stepIndices:i})=>{const u=h.useRef(d||0),[g,f]=h.useState(d||0),m=h.useRef(new Set),b=h.useRef(0),p=h.useMemo(()=>yt("carousel-content"),[]),[y,x]=h.useState(o!==void 0?o:e),[k,w]=h.useState(!1),[I,C]=h.useState(!1),[T,j]=h.useState(0),[M,E]=h.useState(0),P=h.useRef(null);h.useEffect(()=>{o!==void 0&&x(o)},[o]);const L=h.useCallback(O=>{let N=O;c?O<0?N=g-1:O>=g&&(N=0):N=Math.max(0,Math.min(O,g-1)),i&&i.length>0&&(i.includes(N)||(N=i.reduce((Q,G)=>Math.abs(G-N)<Math.abs(Q-N)?G:Q))),o===void 0&&x(N),t&&t(N)},[o,c,t,g]),S=h.useCallback(()=>{L(y+1)},[y,L]),D=h.useCallback(()=>{L(y-1)},[y,L]);h.useEffect(()=>(r&&!k&&!I&&(P.current=setInterval(()=>{S()},a)),()=>{P.current&&clearInterval(P.current)}),[r,a,k,I,S,l]);const H=h.useCallback(()=>{l&&w(!0)},[l]),V=h.useCallback(()=>{w(!1)},[]),W=h.useCallback(O=>{C(!0),"touches"in O?(j(O.touches[0].clientX),E(O.touches[0].clientY)):(j(O.clientX),E(O.clientY))},[]),$=h.useCallback(O=>{if(!I)return;let N,K;"touches"in O?(N=O.touches[0].clientX,K=O.touches[0].clientY):(N=O.clientX,K=O.clientY);const Q=N-T,G=K-M;Math.abs(Q)>Math.abs(G)&&Math.abs(Q)>50&&(Q>0?D():S(),C(!1))},[I,T,M,S,D]),_=h.useCallback(()=>{C(!1)},[]),B=h.useCallback(()=>{const O=b.current++;m.current.add(O);const N=m.current.size;return u.current=N,f(N),O},[]),A=h.useCallback(O=>{m.current.delete(O);const N=m.current.size;if(u.current=N,f(N),N>0&&y>=N){const K=Math.max(0,N-1);o===void 0&&x(K),t&&t(K)}},[y,o,t]),F=c||y>0,v=c||y<g-1;return{activeIndex:y,totalSlides:g,goToSlide:L,nextSlide:S,prevSlide:D,canGoNext:v,canGoPrevious:F,handleMouseEnter:H,handleMouseLeave:V,handleDragStart:W,handleDragMove:$,handleDragEnd:_,registerSlide:B,unregisterSlide:A,contentId:p,infinite:c}},vs={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"}},Ns={dot:{backgroundColor:"theme-primary"},line:{backgroundColor:"theme-primary"},number:{backgroundColor:"theme-primary",color:"color-white"}},Ko={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"}},bo=()=>({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,...Ko},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...Ko}}),rn=h.createContext(null),Qo=()=>{const e=h.useContext(rn);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},nn=({children:e,isActive:o,views:t,...r})=>n.jsx(s.View,{flexShrink:0,width:"100%",height:"100%",display:o?"block":"none",...t,...r,children:e}),an=({views:e,children:o,...t})=>{const{goToPrevious:r,canGoPrevious:a,styles:l}=Qo(),d={...bo().prevButton,...l==null?void 0:l.prevButton,...e==null?void 0:e.prevButton};return n.jsx($e,{"aria-label":"Previous slide",onClick:()=>r(),isDisabled:!a,...d,...t,children:o??n.jsx(ce,{orientation:"left",widthHeight:16})})},ln=({views:e,children:o,...t})=>{const{goToNext:r,canGoNext:a,styles:l}=Qo(),d={...bo().nextButton,...l==null?void 0:l.nextButton,...e==null?void 0:e.nextButton};return n.jsx($e,{"aria-label":"Next slide",onClick:()=>r(),isDisabled:!a,...d,...t,children:o??n.jsx(ce,{orientation:"right",widthHeight:16})})},cn=({children:e,views:o,...t})=>{const{registerSlide:r,unregisterSlide:a,styles:l}=Qo(),c=h.useRef(null);h.useEffect(()=>{const u=r();return c.current=u,()=>{c.current!==null&&a(c.current)}},[r,a]);const i={...bo().item,...l==null?void 0:l.item,...o==null?void 0:o.item};return n.jsx(s.View,{role:"group","aria-roledescription":"slide",...i,...t,children:e})},sn=({children:e,views:o,style:t,...r})=>{const{currentIndex:a,styles:l,contentId:c}=Qo(),d=bo(),i={...d.content,...l==null?void 0:l.content,...o==null?void 0:o.content},u={...d.innerContainer,...l==null?void 0:l.innerContainer,...o==null?void 0:o.innerContainer},g=`-${a*100}%`;return n.jsx(s.View,{...i,...r,style:{...i==null?void 0:i.style,...t},id:c,"aria-live":"polite",children:n.jsx(s.View,{...u,style:{...u==null?void 0:u.style,transform:`translateX(${g})`},children:e})})},Us=({children:e,defaultActiveIndex:o=0,activeIndex:t,onChange:r,showNavigation:a=!0,navigationPosition:l="inside",prevButton:c,nextButton:d,showIndicators:i=!0,indicatorPosition:u="bottom",indicatorVariant:g="dot",autoPlay:f=!1,autoPlayInterval:m=3e3,pauseOnHover:b=!0,infinite:p=!0,direction:y="horizontal",transitionDuration:x=300,views:k,stepIndices:w,themeMode:I,...C})=>{const T=h.useMemo(()=>h.Children.toArray(e),[e]),j=Os({defaultActiveIndex:o,activeIndex:t,onChange:r,autoPlay:f,autoPlayInterval:m,pauseOnHover:b,infinite:p,totalSlides:T.length}),{activeIndex:M,totalSlides:E,goToSlide:P,nextSlide:L,prevSlide:S,handleMouseEnter:D,handleMouseLeave:H,handleDragStart:V,handleDragMove:W,handleDragEnd:$}=j,_=()=>{if(!a)return null;const F=c||n.jsx(s.View,{as:"button","aria-label":"Previous slide",...Ko,...k==null?void 0:k.prevButton,children:"❮"}),v=d||n.jsx(s.View,{as:"button","aria-label":"Next slide",...Ko,...k==null?void 0:k.nextButton,children:"❯"});return n.jsxs(n.Fragment,{children:[n.jsx(s.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",left:l==="inside"?"10px":"-40px",onClick:S,cursor:!p&&M===0?"not-allowed":"pointer",opacity:!p&&M===0?.5:1,children:F}),n.jsx(s.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",right:l==="inside"?"10px":"-40px",onClick:L,cursor:!p&&M===T.length-1?"not-allowed":"pointer",opacity:!p&&M===T.length-1?.5:1,children:v})]})},B=()=>i?n.jsx(s.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...u==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:T.map((F,v)=>n.jsx(s.View,{onClick:()=>P(v),cursor:"pointer",...vs[g],...v===M?{...Ns[g]}:{},...k==null?void 0:k.indicator,...v===M?k==null?void 0:k.activeIndicator:{},children:g==="number"&&v+1},v))}):null;return h.useMemo(()=>h.Children.toArray(e).some(F=>h.isValidElement(F)&&(F.type===sn||F.type===cn||F.type===an||F.type===ln)),[e])?n.jsx(rn.Provider,{value:{currentIndex:M,totalSlides:E,goToSlide:P,goToNext:L,goToPrevious:S,canGoNext:j.canGoNext,canGoPrevious:j.canGoPrevious,registerSlide:j.registerSlide,unregisterSlide:j.unregisterSlide,styles:{...bo(),...k},contentId:j.contentId,infinite:p},children:n.jsx(s.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})}):n.jsxs(s.View,{position:"relative",width:"100%",height:"100%",overflow:"hidden",onMouseEnter:D,onMouseLeave:H,onTouchStart:V,onTouchMove:W,onTouchEnd:$,onMouseDown:V,onMouseMove:W,onMouseUp:$,...k==null?void 0:k.container,...C,children:[n.jsx(s.View,{width:"100%",height:"100%",position:"relative",...k==null?void 0:k.slideWrapper,children:T.map((F,v)=>n.jsx(nn,{isActive:v===M,index:v,views:k==null?void 0:k.slide,children:F},v))}),_(),B()]})},Ye=e=>n.jsx(Us,{...e});Ye.Slide=nn,Ye.Content=sn,Ye.Item=cn,Ye.Previous=an,Ye.Next=ln;const we={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"},Xe=[we.blue,we.green,we.purple,we.orange,we.red,we.teal,we.pink,we.indigo,we.yellow,we.cyan],qs={width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},Gs={fontSize:"18px",fontWeight:"bold",marginBottom:"16px",textAlign:"center"},Ys={display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"16px"},Xs={display:"flex",alignItems:"center",marginRight:"16px",marginBottom:"8px"},Ks={width:"12px",height:"12px",borderRadius:"2px",marginRight:"6px"},Qs={fontSize:"14px"},dn={stroke:"color-gray-200",strokeWidth:"1px"},Jo={stroke:"color-gray-300",strokeWidth:"1px"},Zo={fontSize:"12px",fill:"color-gray-600"},Js={rx:"2px",ry:"2px",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},Zs={strokeWidth:"2px",fill:"none"},Rs={r:"4px",strokeWidth:"2px",stroke:"white",cursor:"pointer",transition:"r 0.2s ease"},Ro={strokeWidth:"1px",stroke:"white",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},Xt={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"},ed={...Xt},od={...Xt,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},td={...Xt,backgroundColor:"rgba(245, 245, 245, 0.8)",color:"color-gray-600"},rd=({data:e,dataPoints:o,animated:t=!0,animationDuration:r=500,showTooltips:a=!0})=>{const[l,c]=h.useState(t?0:1),[d,i]=h.useState({visible:!1,x:0,y:0,content:null}),u=h.useRef(null),g=h.useRef(null);h.useEffect(()=>{if(!t){c(1);return}const y=Date.now(),x=()=>{const k=Date.now()-y,w=Math.min(k/r,1);c(w),w<1&&(u.current=requestAnimationFrame(x))};return u.current=requestAnimationFrame(x),()=>{u.current&&cancelAnimationFrame(u.current)}},[t,r]);const f=h.useCallback(()=>e?{...e,series:e.series.map((y,x)=>({...y,color:y.color||Xe[x%Xe.length]}))}:o?o.map((y,x)=>({...y,color:y.color||Xe[x%Xe.length]})):null,[e,o]),m=h.useCallback((y,x,k)=>{a&&i({visible:!0,x:y,y:x,content:k})},[a]),b=h.useCallback(()=>{i(y=>({...y,visible:!1}))},[]),p=h.useCallback(()=>{if(!g.current)return{width:0,height:0};const{width:y,height:x}=g.current.getBoundingClientRect();return{width:y,height:x}},[]);return{animationProgress:l,tooltip:d,containerRef:g,processedData:f,showTooltip:m,hideTooltip:b,getChartDimensions:p}},nd=({data:e,width:o,height:t,animationProgress:r,showGrid:a=!0,onBarClick:l,showTooltip:c,hideTooltip:d,views:i})=>{const{getColor:u}=s.useTheme(),g={top:20,right:20,bottom:40,left:50},f=o-g.left-g.right,m=t-g.top-g.bottom,b=h.useMemo(()=>{let T=0;return e.series.forEach(j=>{j.data.forEach(M=>{T=Math.max(T,M)})}),T},[e]),p=e.labels.length,y=e.series.length,x=f/p,k=x*.8/y,w=x*.2/(y+1),I=b||10,C=h.useMemo(()=>{const j=[];for(let M=0;M<=5;M++){const E=I/5*M;j.push(E)}return j},[b]);return n.jsxs("svg",{width:o,height:t,children:[n.jsx("line",{x1:g.left,y1:t-g.bottom,x2:o-g.right,y2:t-g.bottom,...Jo,...i==null?void 0:i.axis}),n.jsx("line",{x1:g.left,y1:g.top,x2:g.left,y2:t-g.bottom,...Jo,...i==null?void 0:i.axis}),e.labels.map((T,j)=>{const M=g.left+(j+.5)*x,E=t-g.bottom+20;return n.jsx("text",{x:M,y:E,textAnchor:"middle",...Zo,...i==null?void 0:i.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:T},`x-label-${j}`)}),C.map((T,j)=>{const M=t-g.bottom-T/I*m;return n.jsxs(h.Fragment,{children:[n.jsx("text",{x:g.left-10,y:M,textAnchor:"end",dominantBaseline:"middle",...Zo,...i==null?void 0:i.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:T.toFixed(0)}),a&&n.jsx("line",{x1:g.left,y1:M,x2:o-g.right,y2:M,...dn,...i==null?void 0:i.grid})]},`y-tick-${j}`)}),e.series.map((T,j)=>n.jsx(h.Fragment,{children:T.data.map((M,E)=>{const P=M/I*m*r,L=g.left+E*x+w*(j+1)+k*j,S=t-g.bottom-P,D=e.labels[E],H=e.series.reduce((B,A)=>{const F=A.data[E];return B+(typeof F=="number"?F:0)},0),V=H>0?(M/H*100).toFixed(1):null,W=T.color?u(T.color):"black",$=B=>{const A=n.jsxs(s.View,{display:"flex",flexDirection:"column",minWidth:"180px",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"semibold",children:T.name}),n.jsx(s.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:W})]}),n.jsx(s.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:D}),n.jsxs(s.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Value"}),n.jsx(s.Text,{fontWeight:"medium",children:M.toLocaleString()})]}),V!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Share"}),n.jsx(s.Text,{fontWeight:"medium",children:`${V}%`})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Category total"}),n.jsx(s.Text,{fontWeight:"medium",children:H.toLocaleString()})]})]})]});c(B.clientX,B.clientY,A)},_=()=>{l&&l(T.name,E)};return n.jsx("rect",{x:L,y:S,width:k,height:P,fill:W,onMouseEnter:$,onMouseLeave:d,onClick:_,...Js,...i==null?void 0:i.bar},`bar-${j}-${E}`)})},`series-${j}`))]})},ad=({data:e,width:o,height:t,animationProgress:r,showGrid:a=!0,onPointClick:l,showTooltip:c,hideTooltip:d,views:i})=>{const{getColor:u}=s.useTheme(),g={top:20,right:20,bottom:40,left:50},f=o-g.left-g.right,m=t-g.top-g.bottom,b=h.useMemo(()=>{let w=0;return e.series.forEach(I=>{I.data.forEach(C=>{w=Math.max(w,C)})}),w},[e]),p=b||10,y=h.useMemo(()=>{const I=[];for(let C=0;C<=5;C++){const T=p/5*C;I.push(T)}return I},[b]),x=w=>`M ${w.map((C,T)=>{const j=g.left+T/(e.labels.length-1)*f,M=t-g.bottom-C/p*m*r;return`${j},${M}`}).join(" L ")}`,k=w=>{const I=g.left,C=g.left+f,T=t-g.bottom,j=w.map((M,E)=>{const P=g.left+E/(e.labels.length-1)*f,L=t-g.bottom-M/p*m*r;return`${P},${L}`});return`M ${I},${T} L ${j.join(" L ")} L ${C},${T} Z`};return n.jsxs("svg",{width:o,height:t,children:[n.jsx("line",{x1:g.left,y1:t-g.bottom,x2:o-g.right,y2:t-g.bottom,...Jo,...i==null?void 0:i.axis}),n.jsx("line",{x1:g.left,y1:g.top,x2:g.left,y2:t-g.bottom,...Jo,...i==null?void 0:i.axis}),e.labels.map((w,I)=>{const C=g.left+I/(e.labels.length-1)*f,T=t-g.bottom+20;return n.jsx("text",{x:C,y:T,textAnchor:"middle",...Zo,...i==null?void 0:i.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-${I}`)}),y.map((w,I)=>{const C=t-g.bottom-w/p*m;return n.jsxs(h.Fragment,{children:[n.jsx("text",{x:g.left-10,y:C,textAnchor:"end",dominantBaseline:"middle",...Zo,...i==null?void 0:i.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)}),a&&n.jsx("line",{x1:g.left,y1:C,x2:o-g.right,y2:C,...dn,...i==null?void 0:i.grid})]},`y-tick-${I}`)}),e.series.map((w,I)=>{const C=w.color?u(w.color):"black";return n.jsxs(h.Fragment,{children:[n.jsx("path",{d:k(w.data),fill:C,opacity:.1,...i==null?void 0:i.area}),n.jsx("path",{d:x(w.data),stroke:C,...Zs,...i==null?void 0:i.line}),w.data.map((T,j)=>{const M=g.left+j/(e.labels.length-1)*f,E=t-g.bottom-T/p*m*r,P=e.labels[j],L=e.series.reduce((_,B)=>{const A=B.data[j];return _+(typeof A=="number"?A:0)},0),S=L>0?(T/L*100).toFixed(1):null,D=j>0&&typeof w.data[j-1]=="number"?w.data[j-1]:null,H=typeof D=="number"?T-D:null,V=typeof H=="number"?`${H>=0?"+":""}${H.toLocaleString()}`:null,W=_=>{const B=n.jsxs(s.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"semibold",children:w.name}),n.jsx(s.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:C})]}),n.jsx(s.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:P}),n.jsxs(s.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Value"}),n.jsx(s.Text,{fontWeight:"medium",children:T.toLocaleString()})]}),V!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Change"}),n.jsx(s.Text,{fontWeight:"medium",children:V})]}),S!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Share"}),n.jsx(s.Text,{fontWeight:"medium",children:`${S}%`})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Category total"}),n.jsx(s.Text,{fontWeight:"medium",children:L.toLocaleString()})]})]})]});c(_.clientX,_.clientY,B)},$=()=>{l&&l(w.name,j)};return n.jsx("circle",{cx:M,cy:E,fill:C,onMouseEnter:W,onMouseLeave:d,onClick:$,...Rs,...i==null?void 0:i.point},`point-${I}-${j}`)})]},`series-${I}`)})]})},ld=({dataPoints:e,width:o,height:t,animationProgress:r,isDonut:a=!1,onSliceClick:l,showTooltip:c,hideTooltip:d,views:i})=>{const{getColor:u}=s.useTheme(),{ref:g,relation:f}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),m=h.useRef(null);h.useEffect(()=>{m.current&&g&&(g.current=m.current)},[m,g]);const p=Math.min(o,t)/2*.8,y=o/2,x=t/2,k=a?p*.6:0,w=h.useMemo(()=>e.reduce((C,T)=>C+T.value,0),[e]),I=h.useMemo(()=>{if(w===0)return[{path:a?[`M ${y} ${x-p}`,`A ${p} ${p} 0 1 1 ${y} ${x+p}`,`A ${p} ${p} 0 1 1 ${y} ${x-p}`,`M ${y} ${x-k}`,`A ${k} ${k} 0 1 0 ${y} ${x+k}`,`A ${k} ${k} 0 1 0 ${y} ${x-k}`,"Z"].join(" "):[`M ${y} ${x}`,`M ${y} ${x-p}`,`A ${p} ${p} 0 1 1 ${y} ${x+p}`,`A ${p} ${p} 0 1 1 ${y} ${x-p}`,"Z"].join(" "),color:"#E2E8F0",label:"Total",value:0,percentage:"0%",labelX:y,labelY:x,startAngle:0,endAngle:Math.PI*2,index:-1}];const C=[];let T=-Math.PI/2;for(let j=0;j<e.length;j++){const E=e[j].value/w,P=E*2*Math.PI*r,L=T+P,S=y+Math.cos(T)*p,D=x+Math.sin(T)*p,H=y+Math.cos(L)*p,V=x+Math.sin(L)*p,W=y+Math.cos(T)*k,$=x+Math.sin(T)*k,_=y+Math.cos(L)*k,B=x+Math.sin(L)*k,A=P>Math.PI?1:0;let F;a?F=[`M ${S} ${D}`,`A ${p} ${p} 0 ${A} 1 ${H} ${V}`,`L ${_} ${B}`,`A ${k} ${k} 0 ${A} 0 ${W} ${$}`,"Z"].join(" "):F=[`M ${y} ${x}`,`L ${S} ${D}`,`A ${p} ${p} 0 ${A} 1 ${H} ${V}`,"Z"].join(" ");const v=T+P/2,O=p*.7,N=y+Math.cos(v)*O,K=x+Math.sin(v)*O,Q=`${(E*100).toFixed(1)}%`,G=e[j].color||Xe[j%Xe.length],J=u(G);C.push({path:F,color:J,label:e[j].label,value:e[j].value,percentage:Q,labelX:N,labelY:K,startAngle:T,endAngle:L,index:j}),T=L}return C},[e,w,p,y,x,k,r,a]);return n.jsxs("svg",{ref:m,width:o,height:t,style:{overflow:"visible"},children:[a&&n.jsx("circle",{cx:y,cy:x,r:k,fill:"white",pointerEvents:"none"}),I.map((C,T)=>{const j=P=>{const L=w>0?C.value/w*100:0,S=w>0?Math.max(0,100-L):null,D=n.jsxs(s.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"semibold",children:C.label}),n.jsx(s.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:C.color})]}),n.jsxs(s.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:["Slice ",C.index+1," of ",e.length]}),n.jsxs(s.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Value"}),n.jsx(s.Text,{fontWeight:"medium",children:C.value.toLocaleString()})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Share"}),n.jsx(s.Text,{fontWeight:"medium",children:C.percentage})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Total"}),n.jsx(s.Text,{fontWeight:"medium",children:w.toLocaleString()})]}),S!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Remaining"}),n.jsx(s.Text,{fontWeight:"medium",children:`${S.toFixed(1)}%`})]})]})]});let H=P.clientX,V=P.clientY;if(f&&m.current){const W=m.current.getBoundingClientRect();P.clientX-W.left,P.clientY-W.top,f.space.horizontal==="left"?H=P.clientX-100:H=P.clientX+10,f.space.vertical==="top"?V=P.clientY-30:V=P.clientY+10}c(H,V,D)},M=()=>{C.index!==-1&&l&&l(e[C.index],C.index)},E=C.index===-1;return n.jsxs("g",{children:[n.jsx("path",{d:C.path,fill:C.color,onMouseEnter:E?void 0:j,onMouseLeave:E?void 0:d,onClick:M,...Ro,style:{...Ro==null?void 0:Ro.style,cursor:E?"default":"pointer"},...i==null?void 0:i.pie}),!E&&C.endAngle-C.startAngle>.2&&n.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-${T}`)})]})},cd=({visible:e,x:o,y:t,content:r,maxDistance:a=100,views:l})=>{const c=h.useRef(null),[d,i]=h.useState({left:0,top:0});return h.useEffect(()=>{if(!e||!c.current)return;const g=c.current.getBoundingClientRect(),f=g.width,m=g.height,b=10,p=15;let y=o-p,x=t-p;const k=o-y,w=t-x;k>a&&(y=o-a),w>a&&(x=t-a),y+f>window.innerWidth-b&&(y=window.innerWidth-f-b,o-y>a&&(y=o-a)),y<b&&(y=b),x+m>window.innerHeight-b&&(x=window.innerHeight-m-b,t-x>a&&(x=t-a)),x<b&&(x=b),i({left:y,top:x})},[e,o,t,a]),e?n.jsx(s.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,...l==null?void 0:l.tooltip,children:r}):null},id=({type:e,data:o,dataPoints:t,title:r,showLegend:a=!0,legendPosition:l="bottom",showGrid:c=!0,showTooltips:d=!0,animated:i=!0,animationDuration:u=500,responsive:g=!0,aspectRatio:f=16/9,width:m=200,height:b=200,views:p,onDataPointClick:y,onSeriesClick:x,isLoading:k=!1,error:w,noData:I,loadingIndicator:C,errorIndicator:T,noDataIndicator:j,"aria-label":M,themeMode:E,...P})=>{const{animationProgress:L,tooltip:S,containerRef:D,processedData:H,showTooltip:V,hideTooltip:W,getChartDimensions:$}=rd({data:o,dataPoints:t,animated:i,animationDuration:u,showTooltips:d}),_=H(),{width:B,height:A}=$(),F=m||B,v=b||(g?B/f:A),O=()=>{if(!a||!_)return null;let ae=[];return e==="pie"||e==="donut"?Array.isArray(_)&&(ae=_):_&&_.series&&(ae=_.series),!ae||ae.length===0?null:n.jsx(s.Horizontal,{flexWrap:"wrap",justifyContent:"center",marginTop:l==="bottom"?"16px":0,marginBottom:l==="top"?"16px":0,...Ys,...p==null?void 0:p.legend,children:ae.map((le,re)=>n.jsxs(s.View,{...Xs,...p==null?void 0:p.legendItem,children:[n.jsx(s.View,{backgroundColor:le.color,...Ks}),n.jsx(s.Text,{...Qs,children:le.name||le.label})]},`legend-${re}`))})},N=()=>{if(!_)return null;switch(e){case"bar":return n.jsx(nd,{data:_,width:F,height:v,animationProgress:L,showGrid:c,onBarClick:x,showTooltip:V,hideTooltip:W,views:p});case"line":case"area":return n.jsx(ad,{data:_,width:F,height:v,animationProgress:L,showGrid:c,onPointClick:x,showTooltip:V,hideTooltip:W,views:p});case"pie":case"donut":return n.jsx(ld,{dataPoints:_,width:F,height:v,animationProgress:L,isDonut:e==="donut",onSliceClick:y,showTooltip:V,hideTooltip:W,views:p});default:return null}},K=()=>k?n.jsx(s.View,{...ed,...p==null?void 0:p.loadingOverlay,children:C||n.jsx(s.Center,{children:n.jsx(ho,{size:"lg"})})}):null,Q=()=>w?n.jsx(s.View,{...od,...p==null?void 0:p.errorOverlay,children:T||n.jsx(s.Text,{fontWeight:"medium",children:typeof w=="string"?w:"An error occurred"})}):null,G=()=>I?n.jsx(s.View,{...td,...p==null?void 0:p.noDataOverlay,children:j||n.jsx(s.Text,{children:typeof I=="string"?I:"No data available"})}):null,J=M??(typeof r=="string"?r:"Chart"),oe=!w&&!k&&!I;return n.jsxs(s.View,{ref:D,role:"region","aria-label":J,"aria-busy":k,...qs,...p==null?void 0:p.container,...P,children:[r&&n.jsx(s.Text,{...Gs,children:r}),oe&&l==="top"&&O(),n.jsxs(s.View,{flex:1,width:"100%",position:"relative",...p==null?void 0:p.chart,children:[oe&&N(),K(),Q(),G()]}),oe&&l==="bottom"&&O(),n.jsx(cd,{visible:d&&S.visible,x:S.x,y:S.y,content:S.content,maxDistance:100,views:p})]})},sd=e=>n.jsx(id,{...e}),dd=(e=365)=>{const[o,t]=h.useState(!1),[r,a]=h.useState(null),l="app-studio-cookie-consent";h.useEffect(()=>{const u=localStorage.getItem(l);a(u!==null?u==="true":!1)},[]);const c=u=>{localStorage.setItem(l,String(u));const g=new Date;g.setDate(g.getDate()+e),localStorage.setItem(`${l}-expires`,g.toISOString()),a(u)};return{isHovered:o,setIsHovered:t,hasConsent:r,acceptCookies:()=>{c(!0)},resetConsent:()=>{localStorage.removeItem(l),localStorage.removeItem(`${l}-expires`),a(!1)}}},ud=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"}}}},gd=({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:r="Personnaliser",position:a="bottom",variant:l="default",onAccept:c,onCustomize:d,views:i,showCustomizeButton:u=!0,cookieExpiration:g=365,themeMode:f,...m})=>{const{themeMode:b}=s.useTheme(),p=f||b||"light",{hasConsent:y,acceptCookies:x}=dd(g),w=ud(p)[l];if(y)return null;const I=()=>{x(),c&&c()},C=()=>{d&&d()};return n.jsx(s.View,{position:"fixed",left:16,right:16,zIndex:1e3,padding:16,borderWidth:"1px",borderStyle:"solid",borderRadius:8,maxWidth:"800px",marginX:"auto",...a==="bottom"?{bottom:16}:{top:16},...w.container,...i==null?void 0:i.container,...m,children:n.jsxs(s.Vertical,{gap:12,maxWidth:1200,marginX:"auto",children:[e&&n.jsx(s.Text,{fontWeight:"bold",fontSize:18,color:"color-black",...i==null?void 0:i.title,children:e}),o&&n.jsx(s.Text,{fontSize:14,color:"color-black",...i==null?void 0:i.description,children:o}),n.jsxs(s.Horizontal,{gap:12,justifyContent:"flex-end",marginTop:8,...i==null?void 0:i.buttonGroup,children:[u&&n.jsx($e,{variant:"outline",onClick:C,size:"sm",...i==null?void 0:i.customizeButton,children:r}),n.jsx($e,{variant:"primary",onClick:I,size:"sm",...i==null?void 0:i.acceptButton,children:t})]})]})})},hd=e=>n.jsx(gd,{...e}),fd=e=>{const{size:o,variant:t,onOpenChange:r}=e||{},[a,l]=h.useState(!1),[c,d]=h.useState({x:0,y:0}),[i,u]=h.useState(null),g=h.useRef(null),f=h.useRef(null),m=h.useMemo(()=>yt("contextmenu-content"),[]),b=h.useCallback(y=>{d({x:y.clientX,y:y.clientY}),l(!0),r==null||r(!0)},[r]),p=h.useCallback(()=>{l(!1),u(null),r==null||r(!1)},[r]);return h.useEffect(()=>{const y=w=>{f.current&&!f.current.contains(w.target)&&p()},x=()=>{a&&p()},k=w=>{w.key==="Escape"&&a&&p()};return document.addEventListener("mousedown",y),window.addEventListener("resize",x),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",y),window.removeEventListener("resize",x),document.removeEventListener("keydown",k)}},[a,p]),{isOpen:a,setIsOpen:l,position:c,setPosition:d,activeSubmenuId:i,setActiveSubmenuId:u,size:o,variant:t,triggerRef:g,contentRef:f,contentId:m,openMenu:b,closeMenu:p}},un={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},md={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"}},gn={hover:{backgroundColor:"color-gray-100"}},hn=h.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:()=>{}}),pd=({children:e,value:o})=>n.jsx(hn.Provider,{value:o,children:e}),et=()=>{const e=h.useContext(hn);if(!e)throw new Error("useContextMenuContext must be used within a ContextMenuProvider");return e},fn=({children:e,disableNativeContextMenu:o=!0,asChild:t=!1,isDisabled:r=!1,views:a,...l})=>{const{triggerRef:c,contentId:d,openMenu:i}=et(),g={ref:c,onContextMenu:f=>{if(!r)if(o&&f.preventDefault(),i)i(f);else{const{setIsOpen:m,setPosition:b}=et();b({x:f.clientX,y:f.clientY}),m(!0)}},"aria-controls":d,"aria-haspopup":"menu","data-disabled":r?"":void 0,...t&&h.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:r},...a==null?void 0:a.container,...l};if(t&&h.isValidElement(e)){const f=h.Children.only(e);return h.cloneElement(f,{...g,...f.props})}return n.jsx(s.View,{...g,children:e})},Kt=({items:e,children:o,position:t,side:r="right",align:a="start",views:l,style:c,...d})=>{const{isOpen:i,position:u,contentRef:g,contentId:f,variant:m}=et(),b=h.useRef(null),p=g||b,{ref:y,relation:x}=s.useElementPosition({}),[k,w]=h.useState({x:0,y:0});if(h.useEffect(()=>{if(i&&p.current){const C=t||u,T=p.current.offsetWidth,j=p.current.offsetHeight,M=window.innerWidth,E=window.innerHeight;let P=C.x,L=C.y;x&&(x.space.horizontal==="left"?P=C.x-T:P=C.x,x.space.vertical==="top"?L=C.y-j:L=C.y),P+T>M&&(P=M-T-8),P<8&&(P=8),L+j>E&&(L=E-j-8),L<8&&(L=8),w({x:P,y:L})}},[i,u,t,r,a,p,x]),!i)return null;const I={position:"fixed",top:`${k.y}px`,left:`${k.x}px`,zIndex:1e3,transformOrigin:"top left"};return n.jsxs(s.View,{id:f||"context-menu",ref:p,role:"menu",tabIndex:-1,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:{...I,...c},...md[m],...l==null?void 0:l.menu,...l==null?void 0:l.content,...d,children:[e&&e.map((C,T)=>C.divider?n.jsx(pn,{views:l},`divider-${T}`):n.jsx(mn,{item:C,views:l},C.id)),o]})},mn=({item:e,children:o,onSelect:t,isDisabled:r=!1,views:a,...l})=>{const{activeSubmenuId:c,setActiveSubmenuId:d,size:i,closeMenu:u}=et();if(e){const[f,m]=h.useState(!1),b=e.items&&e.items.length>0,p=c===e.id,[y,x]=h.useState({x:0,y:0}),k=e.disabled||r,w=()=>{m(!0),b&&d(e.id)},I=()=>{m(!1)},C=()=>{k||!b&&e.onClick&&(e.onClick(),u&&u())},{ref:T,relation:j}=s.useElementPosition({});return h.useEffect(()=>{if(p&&T.current){const M=T.current.getBoundingClientRect(),E=window.innerWidth,P=200;let L=!1;if(j)L=j.space.horizontal==="left";else{const S=E-M.right,D=M.left;L=S<P&&D>S}x({x:L?M.left-P:M.right,y:M.top})}},[p,e.items,j]),n.jsxs(s.View,{ref:T,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,...un[i],_hover:k?{}:gn.hover,backgroundColor:f&&!k?"color-gray-100":"transparent",onMouseEnter:w,onMouseLeave:I,onClick:C,...a==null?void 0:a.item,...l,children:[e.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),n.jsx(s.View,{flexGrow:1,children:e.label}),b&&n.jsx(s.View,{marginLeft:8,...a==null?void 0:a.submenuIndicator,children:n.jsx(ce,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),p&&b&&n.jsx(Kt,{items:e.items||[],position:y,side:"right",align:"start",views:a})]})}const g=f=>{r||(t==null||t(f),u&&u())};return n.jsx(s.View,{role:"menuitem",onClick:g,cursor:r?"not-allowed":"pointer",opacity:r?.5:1,"aria-disabled":r,"data-disabled":r?"":void 0,...un[i],_hover:r?{}:gn.hover,...a==null?void 0:a.item,...l,children:o})},pn=({views:e,...o})=>n.jsx(s.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.divider,...o}),bd=({views:e,...o})=>n.jsx(s.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.separator,...o}),yd=({children:e,items:o,size:t="md",variant:r="default",disableNativeContextMenu:a=!0,views:l,themeMode:c,...d})=>!o||o.length===0?n.jsx(n.Fragment,{children:e}):n.jsxs(n.Fragment,{children:[n.jsx(fn,{disableNativeContextMenu:a,views:l,...d,children:e}),n.jsx(Kt,{items:o,views:l})]}),Ke=({children:e,items:o,size:t="md",variant:r="default",disableNativeContextMenu:a=!0,onOpenChange:l,views:c,...d})=>{const i=fd({size:t,variant:r,onOpenChange:l}),{isOpen:u,setIsOpen:g,position:f,setPosition:m,activeSubmenuId:b,setActiveSubmenuId:p,triggerRef:y,contentRef:x,contentId:k,openMenu:w,closeMenu:I}=i;return n.jsx(pd,{value:{isOpen:u,setIsOpen:g,position:f,setPosition:m,activeSubmenuId:b,setActiveSubmenuId:p,size:t,variant:r,triggerRef:y,contentRef:x,contentId:k,openMenu:w,closeMenu:I,styles:c},children:n.jsx(yd,{items:o,size:t,variant:r,disableNativeContextMenu:a,views:c,...d,children:e})})};Ke.Trigger=fn,Ke.Content=Kt,Ke.Item=mn,Ke.Divider=pn,Ke.Separator=bd;const xd=({src:e,color:o,views:t,themeMode:r,...a})=>{const{getColor:l,themeMode:c}=s.useTheme(),d=o?{fill:l(o,{themeMode:c}),stroke:l(o,{themeMode:c})}:{};return n.jsx(s.Center,{...a,...t==null?void 0:t.container,children:n.jsx(s.Image,{...d,content:'url("'+e+'")',width:"100%",height:"100%",...t==null?void 0:t.image})})},kd=({path:e,...o})=>n.jsx(s.Image,{src:e,...o}),bn=({placeholder:e,isMulti:o,options:t,id:r=`select-${Math.random().toString(36).substr(2,9)}`})=>{const a=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[l,c]=h.useState(!1),[d,i]=h.useState(!1),[u,g]=h.useState(a),[f,m]=h.useState(0),[b,p]=h.useState(!0);return{id:r,value:u,setValue:g,hide:b,setHide:p,isHovered:l,setIsHovered:c,isFocused:d,setIsFocused:i,highlightedIndex:f,setHighlightedIndex:m}},yn=({children:e,containerId:o="portal-root"})=>{const[t,r]=h.useState(null);return h.useEffect(()=>{let a=document.getElementById(o),l=!1;return a||(l=!0,a=document.createElement("div"),a.setAttribute("id",o),document.body.appendChild(a)),r(a),()=>{l&&a&&a.parentNode&&a.childNodes.length===0&&a.parentNode.removeChild(a)}},[o]),t?Bl.createPortal(e,t):null},Qt=({children:e,views:o={helperText:{}},...t})=>n.jsx(s.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}),Se=h.forwardRef(({children:e,helperText:o,error:t=!1,views:r,...a},l)=>n.jsxs(s.Vertical,{ref:l,gap:8,position:"relative",width:"100%",marginVertical:4,...a,...r==null?void 0:r.container,children:[e,!t&&o&&n.jsx(Qt,{marginTop:4,...r==null?void 0:r.helperText,children:o}),t&&n.jsx(s.Text,{size:"xs",marginTop:4,marginHorizontal:0,fontWeight:"500",color:"color-red-500",transition:"all 0.2s ease",...r==null?void 0:r.error,children:t})]}));Se.displayName="FieldContainer";const xn={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},kn={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},Cn={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"}}},Cd={paddingTop:"16px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"12px",paddingBottom:"6px",paddingLeft:"12px",paddingRight:"12px"}}},wd={paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"12px",paddingRight:"12px"}}},Ee=({label:e,shadow:o,children:t,value:r,size:a="md",shape:l="default",variant:c="default",error:d=!1,showLabel:i=!1,isFocused:u=!1,isHovered:g=!1,isDisabled:f=!1,isReadOnly:m=!1,views:b={pickerBox:{}},...p})=>{const x=d?"color-red-500":(g||u)&&!f?"theme-primary":"color-gray-300";return n.jsx(s.Horizontal,{gap:8,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",marginBottom:2,borderStyle:"solid",borderColor:x,backgroundColor:"color-white",fontSize:s.Typography.fontSizes[a],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",...i?Cd:wd,...o,...xn[l],...Cn[c],...b==null?void 0:b.container,...p,children:t})},Jt=({children:e,...o})=>n.jsx(s.Center,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",...o,children:e}),Id={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}},Td=({children:e,heading:o,isItalic:t=!1,isUnderlined:r=!1,isStriked:a=!1,weight:l="normal",size:c="sm",dropDown:d,...i})=>{const u=o?Id[o]:{};return n.jsx(s.Element,{as:"label",width:"100%",fontSize:c,fontStyle:t?"italic":"normal",fontWeight:s.Typography.fontWeights[l],textDecoration:a?"line-through":r?"underline":"none",...u,...i,children:e})},yo=e=>n.jsx(Td,{...e}),Le=({children:e,size:o="md",error:t=!1,color:r="theme-primary",views:a={label:{}},helperText:l,...c})=>n.jsx(yo,{top:0,zIndex:-10,position:"absolute",fontSize:kn[o],lineHeight:kn[o],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:t?"color-red-500":r,transition:"color 200ms ease-out",...a.label,...c,children:e}),Qe=({children:e,...o})=>n.jsx(s.Vertical,{width:"100%",maxWidth:"100%",position:"relative",...o,children:e}),wn={xs:12,sm:14,md:16,lg:20,xl:24},jd={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)"},Sd={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)"}},Md={padding:"10px 12px",cursor:"pointer",borderRadius:"6px",margin:"2px 4px",transition:"background-color 0.15s ease"},ot={default:{backgroundColor:"transparent"},highlighted:{backgroundColor:"color-gray-100"},selected:{backgroundColor:"color-gray-100"},selectedHighlighted:{backgroundColor:"color-gray-200"}},In={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)"}},zd={padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},Ed={scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.15) transparent"},Vd=({isHovered:e,setIsHovered:o,option:t,size:r="md",callback:a=()=>{},style:l,isSelected:c=!1,...d})=>{const i=(f,m)=>{f.stopPropagation(),f.preventDefault(),typeof a=="function"&&a(m)},u=()=>o(!e),g=()=>c&&e?ot.selectedHighlighted:c?ot.selected:e?ot.highlighted:ot.default;return n.jsxs(s.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...Md,...g(),onMouseEnter:u,onMouseLeave:u,onClick:f=>i(f,t.value),...d,children:[n.jsx(s.Text,{fontSize:s.Typography.fontSizes[r],fontWeight:c?"500":"400",lineHeight:"1.4",color:c?"color-gray-900":"color-gray-700",...l,children:t.label}),c&&n.jsx(s.Element,{as:"span",color:"theme-primary",fontSize:"14px",marginLeft:8,display:"flex",alignItems:"center",children:"✓"})]})},Pd=({size:e="md",views:o={field:{},text:{}},value:t,isDisabled:r,placeholder:a,removeOption:l=()=>{},options:c})=>{const d={margin:0,width:"95%",height:"100%",border:"none",paddingVertical:4,paddingHorizontal:0,fontSize:s.Typography.fontSizes[e],fontWeight:"400",lineHeight:"1.5",letterSpacing:"-0.01em",backgroundColor:"transparent",color:r?"color-gray-400":"color-gray-900",cursor:r?"not-allowed":"pointer",transition:"all 0.2s ease",...o.field,...o.text},i=c.length>0&&c.find(u=>u.value===t);return n.jsx(s.Text,{...d,children:(t===""||Array.isArray(t)&&t.length===0)&&a?a:n.jsx(n.Fragment,{children:typeof t=="string"?(i&&i.label)??t:Array.isArray(t)&&t.length>0?n.jsx(s.Horizontal,{gap:6,children:t.map(u=>n.jsx($d,{option:u,removeOption:l},u))}):n.jsx("span",{children:t})})})},Wd=({id:e,name:o,value:t,onChange:r,isMulti:a=!1,isDisabled:l=!1,isReadOnly:c=!1,options:d=[],...i})=>{const u=g=>{r&&r(g)};return n.jsx(s.Element,{id:e,name:o,as:"select",opacity:0,width:0,height:0,position:"absolute",value:t,disabled:l,readOnly:c,onChange:u,multiple:a,...i,children:d.length>0&&d.map(g=>n.jsx("option",{value:g.value,children:g.label},g.value))})},_d=({size:e,views:o={},options:t,callback:r=()=>{},highlightedIndex:a,setHighlightedIndex:l,selectedValue:c})=>{const d=u=>r(u),i=u=>Array.isArray(c)?c.includes(u):c===u;return n.jsx(s.Element,{as:"ul",role:"listbox",display:"flex",flexDirection:"column",margin:0,padding:"4px",...jd,style:Ed,...o==null?void 0:o.dropDown,children:t&&t.length>0&&t.map((u,g)=>n.jsx(Vd,{size:e,style:o.text,option:u,callback:d,isSelected:i(u.value),isHovered:g===a,setIsHovered:()=>{},onMouseEnter:()=>l(g)},u.value))})},$d=({option:e,size:o="md",removeOption:t=()=>{},...r})=>{const a=()=>t(e);return n.jsxs(s.Horizontal,{gap:6,alignItems:"center",onClick:l=>l.stopPropagation(),...zd,_hover:{backgroundColor:"color-gray-200"},...r,children:[n.jsx(s.Text,{fontSize:s.Typography.fontSizes[o],fontWeight:"500",color:"color-gray-700",children:e}),n.jsx(ye,{role:"close-button",color:"color-gray-500",widthHeight:wn[o],onClick:a,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},Tn=({id:e,name:o,label:t,value:r,placeholder:a,helperText:l,hide:c=!1,error:d=!1,isMulti:i=!1,isFocused:u=!1,isHovered:g=!1,isDisabled:f=!1,isReadOnly:m=!1,options:b=[],shadow:p={},size:y="md",shape:x="default",variant:k="default",views:w={text:{},icon:{},dropDown:{},selectBox:{},label:{},helperText:{}},onChange:I=()=>{},setHide:C=()=>{},setValue:T=()=>{},setIsHovered:j=()=>{},setIsFocused:M=()=>{},setHighlightedIndex:E,highlightedIndex:P,...L})=>{const{ref:S,relation:D,updateRelation:H}=s.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),V=h.useRef(null),W=()=>{var Q;if(!S.current)return{};const O=S.current.getBoundingClientRect(),N={position:"fixed",left:O.left,width:O.width,zIndex:1e4};return((Q=D==null?void 0:D.space)==null?void 0:Q.vertical)==="top"?{...N,bottom:window.innerHeight-O.top+8}:{...N,top:O.bottom+8}};h.useEffect(()=>{const O=()=>C(!0);return document.addEventListener("closeAllSelects",O),()=>document.removeEventListener("closeAllSelects",O)},[C]),h.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(!g),B=()=>M(!0),A=O=>{document.dispatchEvent(new Event("closeAllSelects")),O&&O.stopPropagation&&O.stopPropagation();const N=!c;C(N),M(!N)},F=h.useCallback(O=>{if(C(!0),document.dispatchEvent(new Event("closeAllSelects")),i&&Array.isArray(r)){if(!r.includes(O)){const N=[...r,O];T(N),I&&I(O)}}else T(O),I&&I(O);M(!0)},[i,r,C,T,I,M]),v=O=>{if(Array.isArray(r)&&r.includes(O)){const N=r.filter(K=>K!==O);T(N.length===0?[]:N)}};return n.jsx(Se,{ref:S,position:"relative",width:"100%",display:"inline-block",id:e,role:"SelectBox",helperText:l,error:d,views:w,onClick:O=>{O.stopPropagation(),f||m||A(O)},children:n.jsxs(Ee,{label:t,size:y,error:d,shape:x,views:w,shadow:p,variant:k,value:r,color:"theme-primary",isHovered:g,isDisabled:f,isReadOnly:m,isFocused:u,showLabel:$,onMouseEnter:_,onMouseLeave:_,position:"relative",children:[n.jsxs(Qe,{children:[$&&n.jsx(Le,{htmlFor:e,color:"theme-primary",error:d,...w,children:t}),n.jsx(Wd,{id:e,name:o,options:b,onChange:I,value:r,isDisabled:f,isReadOnly:m,isMulti:i,onFocus:B,...L}),n.jsx(Pd,{options:b,size:y,views:w,value:r,isDisabled:f,placeholder:a,removeOption:v})]}),n.jsx(Jt,{children:!m&&!f&&n.jsx(s.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:c?In.closed:In.open,children:n.jsx(ce,{color:"inherit",widthHeight:wn[y],style:w.icon,orientation:"down"})})}),!c&&b.length>0&&n.jsx(yn,{children:n.jsx(s.Element,{ref:V,onClick:O=>O.stopPropagation(),style:{...W(),...Sd.enter},children:n.jsx(_d,{size:y,views:w,options:b,callback:F,highlightedIndex:P,setHighlightedIndex:E,selectedValue:r})})})]})})},Ld=e=>{const o={...e,options:e.options||[]},t=bn(o);return n.jsx(Tn,{...t,...o,onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(r)}})},jn=({isDisabled:e,isChecked:o})=>{const[t,r]=h.useState(!1),[a,l]=h.useState(o||!1),[c,d]=h.useState(o||!1);return h.useEffect(()=>{o!==void 0&&(l(o),d(o))},[o]),{isHovered:t,setIsHovered:r,on:a,setOn:l,value:c,setValue:d}},Dd={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"}},Bd={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"}},Hd={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}},De={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}}},Sn={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)"}},Ad=e=>n.jsx(s.Input,{type:"checkbox",...e}),Mn=({id:e,name:o,label:t,inActiveChild:r,isChecked:a,activeChild:l,labelPosition:c="right",shadow:d={},size:i="sm",value:u=!1,isHovered:g=!1,isDisabled:f=!1,isReadOnly:m=!1,on:b,setOn:p,onChange:y,setValue:x=()=>{},setIsHovered:k=()=>{},helperText:w,views:I={slider:{},circle:{},label:{}},...C})=>{const T=P=>{if(!m&&!f){const L=P.target.checked;x(L),p(L),y&&y(L)}},j=()=>k(!0),M=()=>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",...I.label}};return n.jsxs(yo,{htmlFor:e,onMouseEnter:j,onMouseLeave:M,...E.container,...C,children:[n.jsx(Ad,{id:e,name:o,opacity:0,width:0,height:0,checked:u,onChange:T,disabled:f,readOnly:m,...C}),c==="left"&&t&&n.jsx(s.Text,{fontWeight:"500",color:f?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t}),n.jsxs(s.View,{display:"flex",alignItems:"center",justifyContent:u?l?"space-between":"flex-end":r?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:f?De.default.disabled:u?g?De.states.hover.active:De.default.active:g?De.states.hover.inactive:De.default.inactive,opacity:!f&&u&&g?De.states.hover.activeOpacity:1,cursor:"pointer",...Sn.slider,...d,...Hd[i],...Bd[i],...I.slider,children:[l&&u&&n.jsx(s.View,{marginLeft:8,marginRight:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:l}),n.jsx(s.View,{borderRadius:"50%",backgroundColor:De.default.knob,boxShadow:g?"0 2px 4px rgba(0, 0, 0, 0.2)":"0 1px 2px rgba(0, 0, 0, 0.1)",transform:g?"scale(1.05)":"scale(1)",...Sn.knob,zIndex:1,...Dd[i],...I.circle}),r&&!u&&n.jsx(s.View,{marginRight:8,marginLeft:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:r})]}),c==="right"&&t&&n.jsx(s.Text,{fontWeight:"500",color:f?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t})]})},Fd=e=>{const o=jn(e);return n.jsx(Mn,{...o,...e})},zn=({placeholder:e,isMulti:o,options:t,id:r=`selector-${Math.random().toString(36).substr(2,9)}`})=>{const a=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[l,c]=h.useState(!1),[d,i]=h.useState(!1),[u,g]=h.useState(a),[f,m]=h.useState(0),[b,p]=h.useState(!0);return{id:r,value:u,setValue:g,hide:b,setHide:p,isHovered:l,setIsHovered:c,isFocused:d,setIsFocused:i,highlightedIndex:f,setHighlightedIndex:m}},En=({id:e,name:o,label:t,value:r,size:a,views:l={},options:c=[],onChange:d=()=>{},setValue:i=()=>{},...u})=>{const{getColor:g}=s.useTheme(),f=h.useCallback(m=>{i(m.value),d&&d(m.value)},[i,d]);return n.jsxs(Se,{id:e,width:"100%",views:l,children:[t&&n.jsxs(s.Horizontal,{fontSize:"10px",letterSpacing:"wider",color:"color-black-500",fontWeight:"bold",marginBottom:12,alignItems:"center",gap:6,style:{textTransform:"uppercase"},children:[n.jsx(ze,{widthHeight:14})," ",n.jsx(s.Text,{children:t})]}),n.jsx(s.Horizontal,{gap:0,children:c.map((m,b,p)=>{const y=r===m.value;let x=g("color-gray-200"),k=g("color-gray-500"),w="transparent";if(y){if(m.color)m.color,x=g(m.color),k=g(m.color),w="rgba(0,0,0,0.05)";else{const I=g("theme-primary");x=I,k=I,w="color-gray-50"}m.color?(x=g(m.color),k=g(m.color),w="transparent"):(x=g("theme-primary"),k=g("theme-primary"),w="transparent")}return n.jsx($e,{onClick:()=>f(m),flex:1,...a?{size:a}:{paddingVertical:6,fontSize:"12px"},fontWeight:y?"bold":"normal",style:{borderTop:`1px solid ${y?x:g("color-gray-200")}`,borderBottom:`1px solid ${y?x:g("color-gray-200")}`,borderLeft:`1px solid ${y?x:g("color-gray-200")}`,borderRight:b===p.length-1||y?`1px solid ${y?x:g("color-gray-200")}`:"none",backgroundColor:w,color:k,borderRadius:b===0?"6px 0 0 6px":b===p.length-1?"0 6px 6px 0":"0",zIndex:y?1:0,boxShadow:"none"},...l.item,children:m.label},m.value)})}),n.jsx("input",{type:"hidden",id:e,name:o,value:Array.isArray(r)?r.join(","):r,onChange:()=>{}})]})},Od=e=>{const o={...e,options:e.options||[]},t=zn(o);return n.jsx(En,{...t,...o,onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(r)}})},Vn=({label:e,placeholder:o,value:t})=>{const[r,a]=h.useState(e??o),[l,c]=h.useState(!1),[d,i]=h.useState(t||""),[u,g]=h.useState(!1);return h.useMemo(()=>{a(u&&!d?o??"":e??o)},[d,u,e,o]),{hint:r,setHint:a,isHovered:l,setIsHovered:c,value:d,setValue:i,isFocused:u,setIsFocused:g}},Pn=({id:e,name:o,hint:t,error:r,value:a,label:l,shadow:c,helperText:d,placeholder:i,size:u="sm",shape:g="default",variant:f="default",isHovered:m=!1,isFocused:b=!1,isEditable:p=!1,isReadOnly:y=!1,isDisabled:x=!1,isAutoFocus:k=!1,isMultiline:w=!1,maxRows:I=3,maxCols:C=30,onBlur:T=()=>{},onChange:j,onFocus:M,setHint:E=()=>{},setValue:P=()=>{},setIsFocused:L=()=>{},setIsHovered:S=()=>{},views:D={label:{},helperText:{}},...H})=>{const V=!!(b&&l),W={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:s.Typography.fontSizes[u],lineHeight:`${Math.round(s.Typography.fontSizes[u]*1.5)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:x?"color-gray-400":"color-gray-900",cursor:x?"not-allowed":"text",opacity:x?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...D.field},$=()=>S(!m),_=()=>{L(!0),M&&M()},B=F=>{T(F),L(!1)},A=F=>{typeof F=="string"?(P(F),j&&j(F)):(P(F.target.value),j&&j(F.target.value))};return n.jsx(Se,{helperText:d,error:r,views:D,...H,children:n.jsx(Ee,{label:l,size:u,error:r,shape:g,views:D,shadow:c,variant:f,value:a,color:"theme-primary",isHovered:m,isDisabled:x,isReadOnly:y,isFocused:b,showLabel:V,onMouseEnter:$,onMouseLeave:$,...D==null?void 0:D.content,children:n.jsxs(Qe,{...D==null?void 0:D.warper,children:[V&&n.jsx(Le,{htmlFor:e,color:"theme-primary",error:r,...D==null?void 0:D.label,children:l}),n.jsx(s.Element,{as:"textarea",id:e,name:o,rows:I,cols:C,value:a,readOnly:y,disabled:x,autoFocus:k,editable:`${!!p.toString()}`,placeholder:t,onBlur:B,onFocus:_,multiline:`${!!w.toString()}`,onChange:F=>A(F),...W,style:{resize:x||y?"none":"vertical"},...D==null?void 0:D.textarea})]})})})},vd=e=>{const o=Vn(e);return n.jsx(Pn,{...o,...e})},Zt=({label:e,placeholder:o,value:t})=>{const[r,a]=h.useState(e??o),[l,c]=h.useState(!1),[d,i]=h.useState(!1),[u,g]=h.useState(t);return h.useMemo(()=>{a(l&&!u?o??"":e??o)},[u,l,e,o]),{hint:r,setHint:a,isFocused:l,setIsFocused:c,isHovered:d,setIsHovered:i,setValue:g,value:u}},Nd=e=>n.jsx(s.Input,{type:"text",...e}),xo=({id:e,name:o,label:t,hint:r,value:a,onChange:l,left:c,right:d,helperText:i,placeholder:u,onChangeText:g,shadow:f={},views:m={container:{},field:{},label:{},helperText:{},text:{}},size:b="md",shape:p="default",variant:y="default",error:x=!1,isFocused:k=!1,isHovered:w=!1,isDisabled:I=!1,isReadOnly:C=!1,isClearable:T=!0,isAutoFocus:j=!1,setHint:M=()=>{},setIsFocused:E=()=>{},setIsHovered:P=()=>{},setValue:L=()=>{},onClick:S=()=>{},onFocus:D,onBlur:H=()=>{},themeMode:V,...W})=>{const{getColor:$,themeMode:_}=s.useTheme(),B=$("color-blueGray-700",{themeMode:V||_}),A=!!(k&&t),F={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",height:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:s.Typography.fontSizes[b],lineHeight:`${Math.round(s.Typography.fontSizes[b]*1.4)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:I?"color-gray-400":"color-gray-900",cursor:I?"not-allowed":"text",opacity:I?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...m.field},v=()=>{E(!0),D&&D()},O=()=>P(!w),N=G=>{H&&H(G),E(!1)},K=G=>{typeof G=="string"?(L(G),g&&g(G),l&&l(G)):(L(G.target.value),g&&g(G.target.value),l&&l(G.target.value))},Q=()=>{L(""),l&&(H({target:{name:o}}),g&&g(""),l&&l("")),typeof document>"u"&&g&&g("")};return n.jsx(Se,{helperText:i,error:x,views:m,children:n.jsxs(Ee,{label:t,size:b,error:x,shape:p,views:m,shadow:f,variant:y,value:a,color:"theme-primary",isHovered:w,isDisabled:I,isReadOnly:C,isFocused:k,showLabel:A,onMouseEnter:O,onMouseLeave:O,children:[c,n.jsxs(Qe,{children:[A&&n.jsx(Le,{htmlFor:e,color:"theme-primary",error:x,...m,children:t}),n.jsx(Nd,{id:e,name:o,readOnly:C,disabled:I,autoFocus:j,placeholder:r,onFocus:v,onBlur:N,autoComplete:"off",...F,...W,onChange:K,value:a})]}),T&&a&&!C&&!I&&n.jsx(Jt,{children:n.jsx(ye,{size:20,color:B,onClick:Q,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]})})},ko=e=>{const o=Zt(e);return n.jsx(xo,{...o,...e})},Wn=({defaultIsSelected:e=!1})=>{const[o,t]=h.useState(!1),[r,a]=h.useState(e);return{isHovered:o,setIsHovered:t,isSelected:r,setIsSelected:a}},Ud={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"}},_n={xs:10,sm:14,md:16,lg:20,xl:24},qd={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"}},Rt={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"}}},$n=({id:e,icon:o,name:t,label:r,isChecked:a,onChange:l,onValueChange:c,shadow:d={},labelPosition:i="right",size:u="md",error:g=!1,isSelected:f=!1,isHovered:m=!1,isDisabled:b=!1,isReadOnly:p=!1,isIndeterminate:y=!1,defaultIsSelected:x=!1,setIsSelected:k=()=>{},setIsHovered:w=()=>{},views:I={checkbox:{},label:{}},infoText:C,helperText:T,...j})=>{const M=()=>w(!m),E=()=>{!p&&!b&&(k&&k(!f),l&&l(!a),c&&c(!a))},P=y?"indeterminate":a||f?"selected":"unselected",L=g?Rt.error[P]:b?Rt.disabled[P]:m?Rt.hover[P]:{},S={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:g?"color-red-600":b?"color-gray-400":"color-gray-700",cursor:b?"not-allowed":p?"default":"pointer",opacity:b?.6:1,transition:"all 0.2s ease",...I.label},checkbox:{...qd[P],...L,borderRadius:"4px",...Ud[u],transition:"all 0.2s ease",...d,...I.checkbox}};return n.jsxs(yo,{htmlFor:e,as:"div",onClick:E,onMouseEnter:M,onMouseLeave:M,size:s.Typography.fontSizes[u],...S.container,...j,children:[n.jsxs(s.Vertical,{gap:8,children:[" ",n.jsxs(s.Horizontal,{gap:12,alignItems:"center",children:[" ",i==="left"&&r&&n.jsx(s.Text,{size:u,fontWeight:"500",...I==null?void 0:I.label,children:r}),n.jsx(s.Center,{...S.checkbox,children:y?n.jsx(Tr,{widthHeight:_n[u],color:"white",transition:"all 0.2s ease"}):(a||f)&&(o??n.jsx(Bo,{widthHeight:_n[u],color:"white",transition:"all 0.2s ease"}))}),i==="right"&&r&&n.jsx(s.Text,{size:u,fontWeight:"500",...I==null?void 0:I.label,children:r})]}),C&&n.jsx(s.Text,{marginLeft:i==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...I==null?void 0:I.infoText,children:C})]}),g&&n.jsx(s.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:g})]})},Gd=e=>{const o=Wn(e);return n.jsx($n,{...o,...e})},Ln=e=>{const{value:o,defaultValue:t="",onChange:r,onChangeComplete:a,onOpen:l,onClose:c,closeOnSelect:d=!0,maxRecentColors:i=8,showRecentColors:u=!0,isAutoFocus:g=!1}=e,[f,m]=h.useState(!1),[b,p]=h.useState(o??t),[y,x]=h.useState(""),[k,w]=h.useState([]),[I,C]=h.useState(!1),[T,j]=h.useState(!1),M=h.useRef(null),E=h.useRef(null);h.useEffect(()=>{o!==void 0&&p(o)},[o]),h.useEffect(()=>{if(u)try{const $=localStorage.getItem("colorInput-recentColors");$&&w(JSON.parse($))}catch($){console.warn("Failed to load recent colors from localStorage:",$)}},[u]),h.useEffect(()=>{g&&M.current&&M.current.focus()},[g]),h.useEffect(()=>{const $=_=>{f&&M.current&&E.current&&!M.current.contains(_.target)&&!E.current.contains(_.target)&&V()};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[f]);const P=h.useCallback($=>{u&&w(_=>{const B=_.filter(F=>F!==$),A=[$,...B].slice(0,i);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(A))}catch(F){console.warn("Failed to save recent colors to localStorage:",F)}return A})},[u,i]),L=h.useCallback(()=>{const $=!f;m($),$?l==null||l():c==null||c()},[f,l,c]),S=h.useCallback($=>{p($),P($),r==null||r($),a==null||a($),d&&(m(!1),c==null||c())},[r,a,d,c,P]),D=h.useCallback($=>{x($)},[]),H=h.useCallback(()=>{y&&(S(y),x(""))},[y,S]),V=h.useCallback(()=>{m(!1),c==null||c()},[c]),W=h.useCallback($=>{p($),r==null||r($)},[r]);return{isOpen:f,selectedColor:b,recentColors:k,customColor:y,isFocused:I,isHovered:T,handleToggle:L,handleColorSelect:S,handleCustomColorChange:D,handleCustomColorSubmit:H,handleClose:V,setIsFocused:C,setIsHovered:j,setValue:W,triggerRef:M,dropdownRef:E}},Co={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"}},Yd={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"}},Xd={default:{borderRadius:"6px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Kd={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"}},Qd=[{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"}],Dn=({id:e,name:o,label:t,placeholder:r="Select a color",helperText:a,views:l={},size:c="md",shape:d="default",variant:i="default",shadow:u,error:g=!1,isDisabled:f=!1,isReadOnly:m=!1,isFocused:b=!1,isHovered:p=!1,predefinedColors:y=Qd,showCustomInput:x=!0,showRecentColors:k=!0,isOpen:w=!1,selectedColor:I="",recentColors:C=[],customColor:T="",handleToggle:j=()=>{},handleColorSelect:M=()=>{},handleCustomColorChange:E=()=>{},handleCustomColorSubmit:P=()=>{},setIsFocused:L=()=>{},setIsHovered:S=()=>{},triggerRef:D,dropdownRef:H,onChange:V,...W})=>{const{getColor:$}=s.useTheme(),_={...Co.container,...l==null?void 0:l.container},B={...Co.trigger,...Yd[c],...Xd[d],...Kd[i],...g&&{borderColor:"color-red-500"},...f&&{opacity:.6,cursor:"not-allowed"},...b&&{borderColor:"color-blue-500",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.1)"},...p&&!f&&{borderColor:"color-gray-400"},...l==null?void 0:l.trigger,...u&&u},A={...Co.dropdown,...l==null?void 0:l.dropdown},F={...Co.colorGrid,...l==null?void 0:l.colorGrid},v={...Co.recentColors,...l==null?void 0:l.recentColors},O=I||"color-gray-200";return n.jsxs(s.View,{..._,...W,children:[t&&n.jsx(yo,{htmlFor:e,size:c,isDisabled:f,error:g,views:l==null?void 0:l.label,children:t}),n.jsxs(s.View,{ref:D,onClick:f||m?void 0:j,onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),onFocus:()=>L(!0),onBlur:()=>L(!1),tabIndex:f?-1:0,role:"button","aria-expanded":w,"aria-haspopup":"listbox","aria-label":t||r,width:"fit-content",gap:8,...B,children:[n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:O,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),!m&&!f&&n.jsx(ce,{widthHeight:16,color:"color-gray-500",orientation:w?"up":"down"})]}),w&&n.jsxs(s.View,{ref:H,...A,children:[n.jsx(s.View,{...F,children:y.map((N,K)=>n.jsx(s.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:N.value,borderWidth:"2px",borderStyle:"solid",borderColor:I===N.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(N.value),title:N.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...l==null?void 0:l.colorSwatch},K))}),k&&C.length>0&&n.jsxs(s.Vertical,{gap:8,marginTop:"16px",children:[n.jsx(s.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Recent Colors"}),n.jsx(s.Horizontal,{gap:4,flexWrap:"wrap",...v,children:C.map((N,K)=>n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:N,borderWidth:"1px",borderStyle:"solid",borderColor:I===N?"color-blue-500":"color-gray-300",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(N),title:N,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"}},K))})]}),x&&n.jsxs(s.Vertical,{gap:8,marginTop:"16px",children:[n.jsx(s.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Custom Color"}),n.jsxs(s.Horizontal,{gap:8,children:[n.jsx(ko,{value:T,onChange:N=>E(N.target.value),placeholder:"#000000 or rgb(0,0,0)",size:"sm",style:{flex:1},views:l==null?void 0:l.customInput}),n.jsx(s.View,{padding:"8px 12px",backgroundColor:"color-blue-500",borderRadius:"4px",cursor:"pointer",onClick:P,_hover:{backgroundColor:"color-blue-600"},children:n.jsx(s.Text,{color:"color-white",fontSize:"12px",fontWeight:"500",children:"Add"})})]})]})]}),a&&n.jsx(s.Text,{fontSize:"12px",color:g?"color-red-500":"color-gray-600",marginTop:"4px",...l==null?void 0:l.helperText,children:a}),g&&typeof g=="string"&&n.jsx(s.Text,{fontSize:"12px",color:"color-red-500",marginTop:"4px",...l==null?void 0:l.error,children:g})]})},Jd=e=>{const o=Ln(e);return n.jsx(Dn,{...o,...e})},er=[{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"}],Bn=({placeholder:e})=>{const[o,t]=h.useState(er),[r,a]=h.useState(e??er[0].name),[l,c]=h.useState(!0),[d,i]=h.useState(!1),[u,g]=h.useState(!1);return{hide:l,setHide:c,newOptions:o,setNewOptions:t,isHovered:u,setIsHovered:g,isFocused:d,setIsFocused:i,value:r,setValue:a}},Hn={xs:8,sm:10,md:12,lg:14,xl:16},Zd=({size:e,...o})=>n.jsx(s.Element,{as:"ul",...o}),Rd=e=>n.jsx(s.Input,{type:"country",...e}),eu=({size:e,...o})=>n.jsx(s.Element,{as:"li",...o}),ou=({option:e,size:o="md",callback:t=()=>{},views:r={text:{}}})=>{const a=l=>{l&&l.stopPropagation&&l.stopPropagation(),t(e)};return n.jsx(eu,{margin:0,role:"DropDownItem",listStyleType:"none",fontWeight:"normal",paddingVertical:6,paddingHorizontal:12,onClick:a,fontSize:s.Typography.fontSizes[o],_hover:{opacity:.8},...r.text,children:e})},tu=({size:e,views:o={dropDown:{}},options:t=[],callback:r=()=>{}})=>{const a=l=>r(l);return n.jsx(Zd,{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(l=>n.jsx(ou,{size:e,option:l.name,callback:a,...o.text},l.code))})},An=({id:e,name:o,label:t,value:r,placeholder:a,helperText:l,hide:c=!1,error:d=!1,isHovered:i=!1,isFocused:u=!1,isAutoFocus:g=!1,isDisabled:f=!1,isReadOnly:m=!1,shadow:b={},newOptions:p=[],size:y="md",variant:x="default",shape:k="default",onChange:w,onBlur:I=()=>{},setHide:C=()=>{},setNewOptions:T=()=>{},setIsHovered:j=()=>{},setIsFocused:M=()=>{},setValue:E=()=>{},views:P={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:L,...S})=>{const{getColor:D,themeMode:H}=s.useTheme(),V=D("color-blueGray-700",{themeMode:L||H}),W=()=>M(!0),$=O=>{C(!c),E(O),w&&w(O)},_=()=>{!f&&!m&&C(!c)},B=O=>{const N=O.target.value,K=er.filter(Q=>Q.name.toLowerCase().startsWith(N.toLowerCase()));c&&C(!1),T(K),w&&w(N)},A=O=>{I(O),M(!1)},F=!!(t&&(u||r)),v={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:s.Typography.fontSizes[y],backgroundColor:"transparent",color:f?"color-trueGray-600":"color-blueGray-700",cursor:f?"not-allowed":m?"auto":"pointer",...P.field};return n.jsxs(Se,{helperText:l,error:d,views:P,onClick:_,children:[n.jsxs(Ee,{label:t,size:y,error:d,shape:k,views:P,shadow:b,variant:x,value:r,color:"theme-primary",isDisabled:f,isReadOnly:m,isFocused:u,showLabel:F,_hover:!f&&!d?{borderColor:"theme-primary"}:void 0,children:[n.jsxs(Qe,{children:[F&&n.jsx(Le,{htmlFor:e,color:"theme-primary",error:d,...P,children:t}),n.jsx(Rd,{id:e,name:o,placeholder:a,readOnly:m,disabled:f,autoFocus:g,onBlur:A,onFocus:W,...v,...S,value:r,onChange:B})]}),n.jsx(Jt,{children:c?n.jsx(ce,{orientation:"down",widthHeight:Hn[y],color:V,style:P.icon}):n.jsx(ce,{orientation:"up",widthHeight:Hn[y],color:V,style:P.icon})})]}),!c&&n.jsx(tu,{size:y,views:P,options:p,callback:$})]})},ru=e=>{const o=Bn(e);return n.jsx(An,{...o,...e})};function tt(e){"@babel/helpers - typeof";return tt=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},tt(e)}function me(e,o){if(o.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+o.length+" present")}function nu(e){return me(1,arguments),e instanceof Date||tt(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ie(e){me(1,arguments);var o=Object.prototype.toString.call(e);return e instanceof Date||tt(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 au(e){if(me(1,arguments),!nu(e)&&typeof e!="number")return!1;var o=Ie(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 lu(e,o){me(2,arguments);var t=Ie(e).getTime(),r=Be(o);return new Date(t+r)}function cu(e,o){me(2,arguments);var t=Be(o);return lu(e,-t)}var iu=864e5;function su(e){me(1,arguments);var o=Ie(e),t=o.getTime();o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0);var r=o.getTime(),a=t-r;return Math.floor(a/iu)+1}function rt(e){me(1,arguments);var o=1,t=Ie(e),r=t.getUTCDay(),a=(r<o?7:0)+r-o;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function Fn(e){me(1,arguments);var o=Ie(e),t=o.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(t+1,0,4),r.setUTCHours(0,0,0,0);var a=rt(r),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var c=rt(l);return o.getTime()>=a.getTime()?t+1:o.getTime()>=c.getTime()?t:t-1}function du(e){me(1,arguments);var o=Fn(e),t=new Date(0);t.setUTCFullYear(o,0,4),t.setUTCHours(0,0,0,0);var r=rt(t);return r}var uu=6048e5;function gu(e){me(1,arguments);var o=Ie(e),t=rt(o).getTime()-du(o).getTime();return Math.round(t/uu)+1}var hu={};function nt(){return hu}function at(e,o){var t,r,a,l,c,d,i,u;me(1,arguments);var g=nt(),f=Be((t=(r=(a=(l=o==null?void 0:o.weekStartsOn)!==null&&l!==void 0?l:o==null||(c=o.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&a!==void 0?a:g.weekStartsOn)!==null&&r!==void 0?r:(i=g.locale)===null||i===void 0||(u=i.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=Ie(e),b=m.getUTCDay(),p=(b<f?7:0)+b-f;return m.setUTCDate(m.getUTCDate()-p),m.setUTCHours(0,0,0,0),m}function On(e,o){var t,r,a,l,c,d,i,u;me(1,arguments);var g=Ie(e),f=g.getUTCFullYear(),m=nt(),b=Be((t=(r=(a=(l=o==null?void 0:o.firstWeekContainsDate)!==null&&l!==void 0?l:o==null||(c=o.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:m.firstWeekContainsDate)!==null&&r!==void 0?r:(i=m.locale)===null||i===void 0||(u=i.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(b>=1&&b<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(f+1,0,b),p.setUTCHours(0,0,0,0);var y=at(p,o),x=new Date(0);x.setUTCFullYear(f,0,b),x.setUTCHours(0,0,0,0);var k=at(x,o);return g.getTime()>=y.getTime()?f+1:g.getTime()>=k.getTime()?f:f-1}function fu(e,o){var t,r,a,l,c,d,i,u;me(1,arguments);var g=nt(),f=Be((t=(r=(a=(l=o==null?void 0:o.firstWeekContainsDate)!==null&&l!==void 0?l:o==null||(c=o.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:g.firstWeekContainsDate)!==null&&r!==void 0?r:(i=g.locale)===null||i===void 0||(u=i.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&t!==void 0?t:1),m=On(e,o),b=new Date(0);b.setUTCFullYear(m,0,f),b.setUTCHours(0,0,0,0);var p=at(b,o);return p}var mu=6048e5;function pu(e,o){me(1,arguments);var t=Ie(e),r=at(t,o).getTime()-fu(t,o).getTime();return Math.round(r/mu)+1}function te(e,o){for(var t=e<0?"-":"",r=Math.abs(e).toString();r.length<o;)r="0"+r;return t+r}var Ve={y:function(o,t){var r=o.getUTCFullYear(),a=r>0?r:1-r;return te(t==="yy"?a%100:a,t.length)},M:function(o,t){var r=o.getUTCMonth();return t==="M"?String(r+1):te(r+1,2)},d:function(o,t){return te(o.getUTCDate(),t.length)},a:function(o,t){var r=o.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="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 r=t.length,a=o.getUTCMilliseconds(),l=Math.floor(a*Math.pow(10,r-3));return te(l,t.length)}},Je={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},bu={G:function(o,t,r){var a=o.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})}},y:function(o,t,r){if(t==="yo"){var a=o.getUTCFullYear(),l=a>0?a:1-a;return r.ordinalNumber(l,{unit:"year"})}return Ve.y(o,t)},Y:function(o,t,r,a){var l=On(o,a),c=l>0?l:1-l;if(t==="YY"){var d=c%100;return te(d,2)}return t==="Yo"?r.ordinalNumber(c,{unit:"year"}):te(c,t.length)},R:function(o,t){var r=Fn(o);return te(r,t.length)},u:function(o,t){var r=o.getUTCFullYear();return te(r,t.length)},Q:function(o,t,r){var a=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return te(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(o,t,r){var a=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return te(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(o,t,r){var a=o.getUTCMonth();switch(t){case"M":case"MM":return Ve.M(o,t);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(o,t,r){var a=o.getUTCMonth();switch(t){case"L":return String(a+1);case"LL":return te(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(o,t,r,a){var l=pu(o,a);return t==="wo"?r.ordinalNumber(l,{unit:"week"}):te(l,t.length)},I:function(o,t,r){var a=gu(o);return t==="Io"?r.ordinalNumber(a,{unit:"week"}):te(a,t.length)},d:function(o,t,r){return t==="do"?r.ordinalNumber(o.getUTCDate(),{unit:"date"}):Ve.d(o,t)},D:function(o,t,r){var a=su(o);return t==="Do"?r.ordinalNumber(a,{unit:"dayOfYear"}):te(a,t.length)},E:function(o,t,r){var a=o.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});case"EEEE":default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(o,t,r,a){var l=o.getUTCDay(),c=(l-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(c);case"ee":return te(c,2);case"eo":return r.ordinalNumber(c,{unit:"day"});case"eee":return r.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(l,{width:"short",context:"formatting"});case"eeee":default:return r.day(l,{width:"wide",context:"formatting"})}},c:function(o,t,r,a){var l=o.getUTCDay(),c=(l-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(c);case"cc":return te(c,t.length);case"co":return r.ordinalNumber(c,{unit:"day"});case"ccc":return r.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(l,{width:"narrow",context:"standalone"});case"cccccc":return r.day(l,{width:"short",context:"standalone"});case"cccc":default:return r.day(l,{width:"wide",context:"standalone"})}},i:function(o,t,r){var a=o.getUTCDay(),l=a===0?7:a;switch(t){case"i":return String(l);case"ii":return te(l,t.length);case"io":return r.ordinalNumber(l,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});case"iiii":default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(o,t,r){var a=o.getUTCHours(),l=a/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(o,t,r){var a=o.getUTCHours(),l;switch(a===12?l=Je.noon:a===0?l=Je.midnight:l=a/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(o,t,r){var a=o.getUTCHours(),l;switch(a>=17?l=Je.evening:a>=12?l=Je.afternoon:a>=4?l=Je.morning:l=Je.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(o,t,r){if(t==="ho"){var a=o.getUTCHours()%12;return a===0&&(a=12),r.ordinalNumber(a,{unit:"hour"})}return Ve.h(o,t)},H:function(o,t,r){return t==="Ho"?r.ordinalNumber(o.getUTCHours(),{unit:"hour"}):Ve.H(o,t)},K:function(o,t,r){var a=o.getUTCHours()%12;return t==="Ko"?r.ordinalNumber(a,{unit:"hour"}):te(a,t.length)},k:function(o,t,r){var a=o.getUTCHours();return a===0&&(a=24),t==="ko"?r.ordinalNumber(a,{unit:"hour"}):te(a,t.length)},m:function(o,t,r){return t==="mo"?r.ordinalNumber(o.getUTCMinutes(),{unit:"minute"}):Ve.m(o,t)},s:function(o,t,r){return t==="so"?r.ordinalNumber(o.getUTCSeconds(),{unit:"second"}):Ve.s(o,t)},S:function(o,t){return Ve.S(o,t)},X:function(o,t,r,a){var l=a._originalDate||o,c=l.getTimezoneOffset();if(c===0)return"Z";switch(t){case"X":return Nn(c);case"XXXX":case"XX":return He(c);case"XXXXX":case"XXX":default:return He(c,":")}},x:function(o,t,r,a){var l=a._originalDate||o,c=l.getTimezoneOffset();switch(t){case"x":return Nn(c);case"xxxx":case"xx":return He(c);case"xxxxx":case"xxx":default:return He(c,":")}},O:function(o,t,r,a){var l=a._originalDate||o,c=l.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+vn(c,":");case"OOOO":default:return"GMT"+He(c,":")}},z:function(o,t,r,a){var l=a._originalDate||o,c=l.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+vn(c,":");case"zzzz":default:return"GMT"+He(c,":")}},t:function(o,t,r,a){var l=a._originalDate||o,c=Math.floor(l.getTime()/1e3);return te(c,t.length)},T:function(o,t,r,a){var l=a._originalDate||o,c=l.getTime();return te(c,t.length)}};function vn(e,o){var t=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),l=r%60;if(l===0)return t+String(a);var c=o;return t+String(a)+c+te(l,2)}function Nn(e,o){if(e%60===0){var t=e>0?"-":"+";return t+te(Math.abs(e)/60,2)}return He(e,o)}function He(e,o){var t=o||"",r=e>0?"-":"+",a=Math.abs(e),l=te(Math.floor(a/60),2),c=te(a%60,2);return r+l+t+c}var Un=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"})}},qn=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"})}},yu=function(o,t){var r=o.match(/(P+)(p+)?/)||[],a=r[1],l=r[2];if(!l)return Un(o,t);var c;switch(a){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}}",Un(a,t)).replace("{{time}}",qn(l,t))},xu={p:qn,P:yu};function ku(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 Cu=["D","DD"],wu=["YY","YYYY"];function Iu(e){return Cu.indexOf(e)!==-1}function Tu(e){return wu.indexOf(e)!==-1}function Gn(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 ju={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"}},Su=function(o,t,r){var a,l=ju[o];return typeof l=="string"?a=l:t===1?a=l.one:a=l.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a};function or(e){return function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=o.width?String(o.width):e.defaultWidth,r=e.formats[t]||e.formats[e.defaultWidth];return r}}var Mu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Eu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Vu={date:or({formats:Mu,defaultWidth:"full"}),time:or({formats:zu,defaultWidth:"full"}),dateTime:or({formats:Eu,defaultWidth:"full"})},Pu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wu=function(o,t,r,a){return Pu[o]};function wo(e){return function(o,t){var r=t!=null&&t.context?String(t.context):"standalone",a;if(r==="formatting"&&e.formattingValues){var l=e.defaultFormattingWidth||e.defaultWidth,c=t!=null&&t.width?String(t.width):l;a=e.formattingValues[c]||e.formattingValues[l]}else{var d=e.defaultWidth,i=t!=null&&t.width?String(t.width):e.defaultWidth;a=e.values[i]||e.values[d]}var u=e.argumentCallback?e.argumentCallback(o):o;return a[u]}}var _u={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$u={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Lu={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"]},Du={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"]},Bu={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"}},Hu={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"}},Au=function(o,t){var r=Number(o),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Fu={ordinalNumber:Au,era:wo({values:_u,defaultWidth:"wide"}),quarter:wo({values:$u,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:wo({values:Lu,defaultWidth:"wide"}),day:wo({values:Du,defaultWidth:"wide"}),dayPeriod:wo({values:Bu,defaultWidth:"wide",formattingValues:Hu,defaultFormattingWidth:"wide"})};function Io(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],l=o.match(a);if(!l)return null;var c=l[0],d=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],i=Array.isArray(d)?vu(d,function(f){return f.test(c)}):Ou(d,function(f){return f.test(c)}),u;u=e.valueCallback?e.valueCallback(i):i,u=t.valueCallback?t.valueCallback(u):u;var g=o.slice(c.length);return{value:u,rest:g}}}function Ou(e,o){for(var t in e)if(e.hasOwnProperty(t)&&o(e[t]))return t}function vu(e,o){for(var t=0;t<e.length;t++)if(o(e[t]))return t}function Nu(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=o.match(e.matchPattern);if(!r)return null;var a=r[0],l=o.match(e.parsePattern);if(!l)return null;var c=e.valueCallback?e.valueCallback(l[0]):l[0];c=t.valueCallback?t.valueCallback(c):c;var d=o.slice(a.length);return{value:c,rest:d}}}var Uu=/^(\d+)(th|st|nd|rd)?/i,qu=/\d+/i,Gu={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},Yu={any:[/^b/i,/^(a|c)/i]},Xu={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ku={any:[/1/i,/2/i,/3/i,/4/i]},Qu={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},Ju={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]},Zu={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},Ru={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]},eg={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},og={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}},tg={ordinalNumber:Nu({matchPattern:Uu,parsePattern:qu,valueCallback:function(o){return parseInt(o,10)}}),era:Io({matchPatterns:Gu,defaultMatchWidth:"wide",parsePatterns:Yu,defaultParseWidth:"any"}),quarter:Io({matchPatterns:Xu,defaultMatchWidth:"wide",parsePatterns:Ku,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:Io({matchPatterns:Qu,defaultMatchWidth:"wide",parsePatterns:Ju,defaultParseWidth:"any"}),day:Io({matchPatterns:Zu,defaultMatchWidth:"wide",parsePatterns:Ru,defaultParseWidth:"any"}),dayPeriod:Io({matchPatterns:eg,defaultMatchWidth:"any",parsePatterns:og,defaultParseWidth:"any"})},rg={code:"en-US",formatDistance:Su,formatLong:Vu,formatRelative:Wu,localize:Fu,match:tg,options:{weekStartsOn:0,firstWeekContainsDate:1}},ng=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ag=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lg=/^'([^]*?)'?$/,cg=/''/g,ig=/[a-zA-Z]/;function sg(e,o,t){var r,a,l,c,d,i,u,g,f,m,b,p,y,x;me(2,arguments);var k=String(o),w=nt(),I=(r=(a=void 0)!==null&&a!==void 0?a:w.locale)!==null&&r!==void 0?r:rg,C=Be((l=(c=(d=(i=void 0)!==null&&i!==void 0?i:void 0)!==null&&d!==void 0?d:w.firstWeekContainsDate)!==null&&c!==void 0?c:(u=w.locale)===null||u===void 0||(g=u.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&l!==void 0?l:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var T=Be((f=(m=(b=(p=void 0)!==null&&p!==void 0?p:void 0)!==null&&b!==void 0?b:w.weekStartsOn)!==null&&m!==void 0?m:(y=w.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:0);if(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!I.localize)throw new RangeError("locale must contain localize property");if(!I.formatLong)throw new RangeError("locale must contain formatLong property");var j=Ie(e);if(!au(j))throw new RangeError("Invalid time value");var M=ku(j),E=cu(j,M),P={firstWeekContainsDate:C,weekStartsOn:T,locale:I,_originalDate:j},L=k.match(ag).map(function(S){var D=S[0];if(D==="p"||D==="P"){var H=xu[D];return H(S,I.formatLong)}return S}).join("").match(ng).map(function(S){if(S==="''")return"'";var D=S[0];if(D==="'")return dg(S);var H=bu[D];if(H)return Tu(S)&&Gn(S,o,String(e)),Iu(S)&&Gn(S,o,String(e)),H(E,S,I.localize,P);if(D.match(ig))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return S}).join("");return L}function dg(e){var o=e.match(lg);return o?o[1].replace(cg,"'"):e}const Yn=()=>{const[e,o]=h.useState(!1),[t,r]=h.useState(!1),[a,l]=h.useState(sg(new Date,"yyyy-MM-dd"));return{date:a,setDate:l,isHovered:e,setIsHovered:o,isFocused:t,setIsFocused:r}},ug=e=>n.jsx(s.Input,{type:"date",...e}),Xn=({id:e,icon:o,name:t,label:r,date:a,children:l,helperText:c,shadow:d={},size:i="md",variant:u="default",shape:g="default",views:f={container:{},label:{},helperText:{},text:{},field:{}},error:m=!1,isHovered:b=!1,isFocused:p=!1,isDisabled:y=!1,isReadOnly:x=!1,setDate:k=()=>{},setIsFocused:w=()=>{},setIsHovered:I=()=>{},onChange:C,onChangeText:T,...j})=>{const M=!!(p&&r),E=()=>I(!b),P=()=>w(!0),L=D=>{typeof D=="string"?(k(D),T&&T(D)):(k(D.target.value),C&&C(D.target.value))},S={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none",backgroundColor:"transparent"}},fontSize:s.Typography.fontSizes[i],backgroundColor:"transparent",color:y?"color-trueGray-600":"color-blueGray-700",cursor:y?"not-allowed":x?"auto":"pointer",...f.field};return n.jsx(Se,{helperText:c,error:m,views:f,children:n.jsx(Ee,{label:r,size:i,error:m,shape:g,views:f,shadow:d,color:"theme-primary",variant:u,value:a,isHovered:b,isDisabled:y,isReadOnly:x,isFocused:p,showLabel:M,onMouseEnter:E,onMouseLeave:E,children:n.jsxs(Qe,{children:[M&&n.jsx(Le,{htmlFor:e,color:"theme-primary",error:m,...f,children:r}),n.jsx(ug,{id:e,name:t,onFocus:P,disabled:y,readOnly:x,...S,...j,...T&&{onChangeText:L},onChange:L})]})})})},gg=e=>{const o=Yn();return n.jsx(Xn,{...o,...e})},Kn=e=>{const o=Zt(e),[t,r]=h.useState(!1);return{isVisible:t,setIsVisible:r,...e,...o}},hg=({visibleIcon:e=n.jsx(St,{widthHeight:14}),hiddenIcon:o=n.jsx(jt,{widthHeight:14}),...t})=>{const{isVisible:r,setIsVisible:a,...l}=Kn(t);return n.jsx(xo,{...l,type:r?"text":"password",isClearable:!1,right:n.jsx(s.View,{onClick:()=>{t.isDisabled||a(!r)},children:r?e:o})})},Qn=(e,o,t)=>{const[r,a]=h.useState(e),[l,c]=h.useState(o?{value:o,label:o}:e[0]),[d,i]=h.useState([]),[u,g]=h.useState(0),[f,m]=h.useState(t??""),[b,p]=h.useState(!1);return{filteredItems:r,setFilteredItems:a,selectedItem:l,setSelectedItem:c,selectedItems:d,setSelectedItems:i,highlightedIndex:u,setHighlightedIndex:g,searchQuery:f,setSearchQuery:m,isDropdownVisible:b,setIsDropdownVisible:p}},fg={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)"},Jn={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)"}},mg={padding:"8px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-100",backgroundColor:"color-gray-50",borderTopLeftRadius:"10px",borderTopRightRadius:"10px"},pg={padding:"8px 10px",cursor:"pointer",borderRadius:"6px",margin:"1px 4px",transition:"background-color 0.15s ease"},bg={padding:"24px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},Zn={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)"}},yg={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"},Rn=({placeholder:e,items:o,showTick:t=!0,onSelect:r,searchEnabled:a=!0,left:l,right:c,label:d,filteredItems:i,setSelectedItem:u,selectedItem:g,selectedItems:f,setSelectedItems:m,highlightedIndex:b,setHighlightedIndex:p,searchQuery:y,setSearchQuery:x,setFilteredItems:k,views:w,isDropdownVisible:I,setIsDropdownVisible:C,isMulti:T=!1,...j})=>{const{ref:M,relation:E}=s.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),P=h.useRef(null),[L,S]=h.useState(!1),[D,H]=h.useState(!1),V=()=>{var N;const A=D?Jn.enter:Jn.initial;if(!M.current)return{};const F=M.current.getBoundingClientRect(),v={position:"fixed",left:F.left,width:F.width,zIndex:1e4,...A};return((N=E==null?void 0:E.space)==null?void 0:N.vertical)==="top"?{...v,bottom:window.innerHeight-F.top+6}:{...v,top:F.bottom+6}};h.useEffect(()=>{if(I){const A=setTimeout(()=>H(!0),10);return()=>clearTimeout(A)}H(!1)},[I]),h.useEffect(()=>{const A=F=>{!F.composedPath().some(N=>(N==null?void 0:N.id)==="combobox-dropdown")&&M.current&&!M.current.contains(F.target)&&C(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]);const W=A=>{if(x(A),A==="")k(o);else{const F=o.filter(v=>v.label.toLowerCase().includes(A.toLowerCase()));k(F)}p(0)},$=A=>{if(T){const F=f.some(O=>O.value===A.value);let v;F?v=f.filter(O=>O.value!==A.value):v=[...f,A],m(v),r==null||r(v)}else u(A),r==null||r(A),C(!1)},_=(A,F)=>{A.stopPropagation();const v=f.filter(O=>O.value!==F.value);m(v),r==null||r(v)},B=A=>T?f.some(F=>F.value===A.value):A.value===g.value;return n.jsxs(s.Horizontal,{role:"combobox",flexWrap:"nowrap",gap:15,alignItems:"center",width:"100%",...j,children:[d&&n.jsx(s.Text,{views:w==null?void 0:w.label,htmlFor:j.id,children:d}),n.jsxs(s.View,{position:"relative",width:"100%",children:[n.jsx("div",{ref:M,onClick:()=>C(!I),style:{width:"100%"},children:n.jsxs(Ee,{isHovered:L,isFocused:I,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),cursor:"pointer",views:{container:w==null?void 0:w.container},children:[n.jsxs(s.Horizontal,{gap:10,alignItems:"center",width:"100%",flexWrap:T?"wrap":"nowrap",...w==null?void 0:w.labelContainer,children:[l,T?f.length>0?n.jsx(s.Horizontal,{gap:6,flexWrap:"wrap",alignItems:"center",children:f.map(A=>n.jsxs(s.Horizontal,{...yg,_hover:{backgroundColor:"color-gray-200"},children:[A.icon&&n.jsx(s.View,{flexShrink:0,children:A.icon}),n.jsx(s.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:A.label}),n.jsx(ye,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:F=>_(F,A)})]},A.value))}):n.jsx(s.Text,{weight:"medium",flexGrow:1,color:"color-gray-500",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...w==null?void 0:w.label,children:e}):n.jsxs(n.Fragment,{children:[g.icon&&g.label!==e&&n.jsx(s.View,{children:g.icon}),n.jsx(s.Text,{weight:"medium",flexGrow:1,color:g.label===e?"color-gray-500":"color-gray-800",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...w==null?void 0:w.label,children:g.label})]})]}),n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[c,n.jsx(s.View,{style:I?Zn.open:Zn.closed,children:n.jsx(ce,{widthHeight:16,orientation:"down",color:I?"color-gray-700":"color-gray-400"})})]})]})}),I&&n.jsx(yn,{children:n.jsxs(s.View,{ref:P,id:"combobox-dropdown",role:"listbox","aria-labelledby":j.id,...fg,style:V(),...w==null?void 0:w.dropdown,children:[a&&n.jsx(s.View,{...mg,children:n.jsx(xo,{id:`${j.id}-search`,name:`${j.name}-search`,width:"100%",type:"search",autoFocus:!0,value:y,onChange:A=>W(A),hint:e||"Search...",isClearable:!1,left:n.jsx(Do,{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"}}})}),i.length>0&&n.jsx(s.View,{margin:0,padding:"4px",children:i.map((A,F)=>{const v=B(A),O=F===b;return n.jsxs(s.Horizontal,{role:"option","aria-selected":v,justifyContent:"space-between",alignItems:"center",...pg,backgroundColor:v&&O?"rgba(59, 130, 246, 0.12)":v?"rgba(59, 130, 246, 0.08)":O?"color-gray-100":"transparent",onMouseEnter:()=>p(F),onClick:()=>$(A),...w==null?void 0:w.item,children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[A.icon&&n.jsx(s.View,{flexShrink:0,children:A.icon}),n.jsx(s.Text,{size:"sm",color:v?"theme-primary":"color-gray-800",weight:v?"medium":"normal",children:A.label})]}),v&&t&&n.jsx(Bo,{widthHeight:16,color:"theme-primary"})]},A.value)})}),i.length===0&&n.jsxs(s.Vertical,{...bg,children:[n.jsx(Do,{widthHeight:24,color:"color-gray-300"}),n.jsx(s.Text,{color:"color-gray-500",size:"sm",align:"center",children:"No results found"}),n.jsx(s.Text,{color:"color-gray-400",size:"xs",align:"center",children:"Try a different search term"})]})]})})]})]})},xg=({id:e,name:o,items:t,placeholder:r,searchPlaceholder:a,...l})=>{const c=Qn(t,r,a);return n.jsx(Rn,{id:e,name:o,items:t,...c,...l})},ea=e=>{const{tags:o,defaultTags:t=[],onTagsChange:r,onTagAdd:a,onTagRemove:l,maxTags:c,minTagLength:d=1,maxTagLength:i=50,allowDuplicates:u=!1,separators:g=["enter","comma"],isDisabled:f=!1,isReadOnly:m=!1}=e,[b,p]=h.useState(""),[y,x]=h.useState(()=>(o||t||[]).map((V,W)=>({id:`tag-${W}-${Date.now()}`,value:V}))),[k,w]=h.useState(!1),[I,C]=h.useState(!1),T=o&&Array.isArray(o)?o.map((H,V)=>({id:`tag-${V}-${Date.now()}`,value:H})):y;h.useEffect(()=>{o&&Array.isArray(o)&&x(o.map((H,V)=>({id:`tag-${V}-${Date.now()}`,value:H})))},[o]);const j=h.useCallback(H=>{const V=H.trim();return!(V.length<d||V.length>i||!u&&T.map($=>$.value.toLowerCase()).includes(V.toLowerCase())||c&&T.length>=c)},[T,d,i,u,c]),M=h.useCallback(H=>{if(f||m)return;const V=H.trim();if(!V||!j(V))return;const W={id:`tag-${Date.now()}-${Math.random()}`,value:V},$=[...T,W],_=$.map(B=>B.value);o||x($),r==null||r(_),a==null||a(V),p("")},[T,j,r,a,f,m,o]),E=h.useCallback(H=>{if(f||m)return;const V=T[H];if(!V)return;const W=T.filter((_,B)=>B!==H),$=W.map(_=>_.value);o||x(W),r==null||r($),l==null||l(V.value,H)},[T,r,l,f,m,o]),P=h.useCallback(H=>{if(f||m)return;const V=H.target.value;if(g.includes("comma")&&V.includes(",")){const W=V.split(","),$=W[0],_=W.slice(1).join(",");$.trim()&&M($),p(_);return}p(V)},[M,g,f,m]),L=h.useCallback(H=>{if(f||m)return;const{key:V}=H;if(g.includes("enter")&&V==="Enter"){H.preventDefault(),b.trim()&&M(b);return}if(g.includes("tab")&&V==="Tab"&&b.trim()){H.preventDefault(),M(b);return}if(g.includes("space")&&V===" "&&b.trim()){H.preventDefault(),M(b);return}if(V==="Backspace"&&!b&&T.length>0){H.preventDefault(),E(T.length-1);return}},[M,E,b,T,g,f,m]),S=h.useCallback(()=>{var H;w(!0),(H=e.onFocus)==null||H.call(e)},[e.onFocus]),D=h.useCallback(()=>{var H;w(!1),b.trim()&&M(b),(H=e.onBlur)==null||H.call(e)},[M,b,e.onBlur]);return{inputValue:b,setInputValue:p,tags:T,setTags:x,isFocused:k,setIsFocused:w,isHovered:I,setIsHovered:C,addTag:M,removeTag:E,handleInputChange:P,handleKeyDown:L,handleFocus:S,handleBlur:D,validateTag:j}},kg=({tag:e,onRemove:o,isRemovable:t,size:r,views:a,isDisabled:l,isReadOnly:c})=>{const[d,i]=h.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}}[r]||{padding:"6px 14px",fontSize:"14px",iconSize:14};return n.jsxs(s.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:l?.6:1,_hover:!l&&!c?{backgroundColor:"color-gray-100-200",borderColor:"color-gray-200",boxShadow:"0 4px 6px rgba(0,0,0,0.05)",transform:"translateY(-1px)"}:{},...a==null?void 0:a.tag,children:[n.jsx(s.Text,{fontSize:u.fontSize,color:l?"color-gray-100":"theme-primary",whiteSpace:"nowrap",...a==null?void 0:a.tagText,children:e}),t&&!l&&!c&&n.jsx(s.View,{cursor:"pointer",padding:"2px",borderRadius:"50%",transition:"all 0.2s ease",backgroundColor:d?"color-red-100":"transparent",opacity:d?1:.7,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:g=>{g.stopPropagation(),o()},_hover:{backgroundColor:"color-red-50"},...a==null?void 0:a.tagRemove,children:n.jsx(ye,{widthHeight:u.iconSize,color:d?"color-red-500":"color-gray-400"})})]})},oa=({id:e,name:o,label:t,placeholder:r="Type and press Enter to add tags...",helperText:a,error:l=!1,inputValue:c="",tags:d=[],left:i,right:u,shadow:g={},views:f={},size:m="md",shape:b="default",variant:p="default",isDisabled:y=!1,isReadOnly:x=!1,isAutoFocus:k=!1,isRemovable:w=!0,isFocused:I=!1,isHovered:C=!1,maxTags:T,handleInputChange:j,handleKeyDown:M,handleFocus:E,handleBlur:P,removeTag:L,setIsHovered:S,onClick:D,...H})=>{const{getColor:V,themeMode:W}=s.useTheme(),$=!!(t&&(I||d.length>0||c)),_=T&&d.length>=T,B={...xn[b],...Cn[p],...f==null?void 0:f.inputContainer},A={border:"none",outline:"none",backgroundColor:"transparent",fontSize:s.Typography.fontSizes[m],color:y?"color-gray-400":"color-gray-800",flex:1,minWidth:"120px",...f==null?void 0:f.input};return n.jsx(Se,{error:!!l,helperText:typeof l=="string"?l:a,views:f,...H,children:n.jsxs(Ee,{label:t,shadow:g,value:d.length>0||c?"has-content":"",size:m,shape:b,variant:p,error:!!l,showLabel:$,isFocused:I,isHovered:C,isDisabled:y,isReadOnly:x,views:f,onClick:D,onMouseEnter:()=>S==null?void 0:S(!0),onMouseLeave:()=>S==null?void 0:S(!1),...B,children:[i,n.jsxs(Qe,{children:[t&&n.jsx(Le,{size:m,error:!!l,views:f,children:t}),n.jsxs(s.Horizontal,{alignItems:"center",gap:8,flexWrap:"wrap",width:"100%",minHeight:s.Typography.fontSizes[m],padding:"8px 0",...f==null?void 0:f.tagsContainer,children:[d.map((F,v)=>n.jsx(kg,{tag:F.value,onRemove:()=>L==null?void 0:L(v),isRemovable:w,size:m,views:f,isDisabled:y,isReadOnly:x},F.id)),!_&&n.jsx(s.Input,{id:e,name:o,type:"text",value:c,placeholder:d.length===0?r:"",disabled:y,readOnly:x,autoFocus:k,onChange:j,onKeyDown:M,onFocus:E,onBlur:P,autoComplete:"off",...A}),_&&n.jsxs(s.Text,{fontSize:s.Typography.fontSizes[m],color:"color-gray-500",fontStyle:"italic",...f==null?void 0:f.placeholder,children:["Maximum ",T," tags reached"]})]})]}),u]})})},Cg=e=>{const o=ea(e),{tags:t,...r}=e;return n.jsx(oa,{...o,...r})};function wg(e){const o=setTimeout(e,0),t=setTimeout(e,10),r=setTimeout(e,50);return[o,t,r]}const ta=({value:e,defaultValue:o="",length:t=6,onChange:r,onChangeText:a,onComplete:l,onKeyDown:c,onKeyPress:d,onBlur:i,onFocus:u,isReadOnly:g,isDisabled:f,pattern:m,stepValues:b,pasteTransformer:p})=>{var K,Q;const y=e!==void 0,x=y?e:o,[k,w]=h.useState((x==null?void 0:x.slice(0,t))||""),[I,C]=h.useState(!1),[T,j]=h.useState(!1),[M,E]=h.useState(null),[P,L]=h.useState(null),S=h.useRef(null),D=h.useRef(null),H=h.useRef({value:k,onChange:r||(()=>{}),isIOS:typeof window<"u"&&((Q=(K=window==null?void 0:window.CSS)==null?void 0:K.supports)==null?void 0:Q.call(K,"-webkit-touch-callout","none"))}),V=h.useRef({prev:[null,null,"none"]}),W=m?typeof m=="string"?new RegExp(m):m:null;h.useEffect(()=>{y&&e!==k&&w((e==null?void 0:e.slice(0,t))||"")},[y,e,t,k]);const $=h.useCallback(G=>{let J=G;if(b&&b.length>0&&G){const oe=parseInt(G,10);if(!isNaN(oe)){let ae=b[0],le=Math.abs(oe-ae);for(let re=1;re<b.length;re++){const he=Math.abs(oe-b[re]);he<le&&(le=he,ae=b[re])}J=ae.toString()}}w(J),r&&r(J),a&&a(J),l&&J.length===t&&l(J)},[r,a,l,t,b]),_=h.useCallback(G=>{G&&S.current!==G&&Object.defineProperty(S,"current",{value:G,writable:!0})},[]),B=h.useCallback(G=>{const J=G.currentTarget.value.slice(0,t);if(J.length>0&&W&&!W.test(J)){G.preventDefault();return}$(J),S.current&&(S.current.value=J)},[t,W,$,S]),A=h.useCallback(()=>{var G;if(S.current){const J=Math.min(S.current.value.length,t-1),oe=S.current.value.length;(G=S.current)==null||G.setSelectionRange(J,oe),E(J),L(oe)}C(!0)},[t]),F=h.useCallback(()=>{C(!1)},[]),v=h.useCallback(G=>{c&&c(G)},[]),O=h.useCallback(G=>{d&&d(G)},[]),N=h.useCallback(G=>{const J=S.current;if(!G.clipboardData||!J)return;const oe=G.clipboardData.getData("text/plain"),ae=p?p(oe):oe;G.preventDefault();const le=J.selectionStart||0,re=J.selectionEnd||0,q=(le!==re?k.slice(0,le)+ae+k.slice(re):k.slice(0,le)+ae+k.slice(le)).slice(0,t);if(q.length>0&&W&&!W.test(q))return;J.value=q,$(q),w(q);const Y=Math.min(q.length,t-1),ee=q.length;J.setSelectionRange(Y,ee),E(Y),L(ee)},[t,p,W,$,k,w]);return h.useEffect(()=>{const G=S.current,J=D.current;if(!G||!J)return;H.current.value!==G.value&&H.current.onChange&&H.current.onChange(G.value),V.current.prev=[G.selectionStart,G.selectionEnd,G.selectionDirection];function oe(){if(document.activeElement!==G){E(null),L(null);return}const re=(G==null?void 0:G.selectionStart)??null,he=(G==null?void 0:G.selectionEnd)??null,ke=(G==null?void 0:G.selectionDirection)??null,q=(G==null?void 0:G.maxLength)??0,Y=(G==null?void 0:G.value)??"",ee=V.current.prev;let X=-1,R=-1,se="none";if(Y.length!==0&&re!==null&&he!==null){const be=re===he,pt=re===Y.length&&Y.length<q;if(be&&!pt){const ve=re;if(ve===0)X=0,R=1,se="forward";else if(ve===q)X=ve-1,R=ve,se="backward";else if(q>1&&Y.length>1){let kr=0;if(ee[0]!==null&&ee[1]!==null){se=ve<ee[1]?"backward":"forward";const Dm=ee[0]===ee[1]&&ee[0]<q;se==="backward"&&!Dm&&(kr=-1)}X=kr+ve,R=kr+ve+1}}X!==-1&&R!==-1&&X!==R&&S.current&&S.current.setSelectionRange(X,R,se)}const fe=X!==-1?X:re,pe=R!==-1?R:he,ne=se!=="none"?se:ke;E(fe),L(pe),V.current.prev=[fe,pe,ne]}document.addEventListener("selectionchange",oe,{capture:!0}),oe(),document.activeElement===G&&C(!0);const ae=()=>{J&&J.style.setProperty("--root-height",`${G.clientHeight}px`)};ae();const le=new window.ResizeObserver(ae);return le.observe(G),()=>{document.removeEventListener("selectionchange",oe,{capture:!0}),le.disconnect()}},[]),h.useEffect(()=>{wg(()=>{var ae,le,re,he;(ae=S.current)==null||ae.dispatchEvent(new Event("input"));const G=(le=S.current)==null?void 0:le.selectionStart,J=(re=S.current)==null?void 0:re.selectionEnd,oe=(he=S.current)==null?void 0:he.selectionDirection;G!==null&&J!==null&&G!==void 0&&J!==void 0&&(E(G),L(J),V.current.prev=[G,J,oe||"none"])})},[k,I]),{value:k,setValue:$,isFocused:I,setIsFocused:C,isHovered:T,setIsHovered:j,inputRef:S,containerRef:D,mirrorSelectionStart:M,mirrorSelectionEnd:P,setMirrorSelectionStart:E,setMirrorSelectionEnd:L,setInputRef:_,handleChange:B,handleFocus:A,handleBlur:F,handleKeyDown:v,handleKeyPress:O,handlePaste:N}},Ig=h.createContext({slots:[],isFocused:!1,isHovering:!1}),Tg=`
|
|
6
|
+
`,backgroundSize:`200% ${Q}px, ${Q}px 200%, 200% ${Q}px, ${Q}px 200%`,backgroundPosition:q,transitionProperty:"background-position",transitionDuration:`${$}s`,transitionTimingFunction:"linear",transitionDelay:K,_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,P-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:B})})}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:lo[s],boxShadow:g,transition:"all 0.2s ease",cursor:n?"default":"pointer",onClick:h,...m,...f==null?void 0:f.container,...V,children:B})},ai=({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:g=!0,isFilled:h,isDisabled:f,isLoading:m,isIconRounded:p,isHovered:b,icon:x,children:y,to:k,isExternal:w,shadow:I,onClick:C,views:T={},borderMovingDuration:j=2,borderMovingGradientColors:z=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:V="#705CFF",animatedStrokeTextColor:P="#333333",...B})=>{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=u.useMemo(()=>Rc(E,$,s),[E,$,s])[e],D=(L==null?void 0:L.color)??$,F=r.jsx(ei,{icon:x,isLoading:m,iconPosition:n,loaderPosition:l,size:o,resolvedTextColor:D,isIconRounded:p,views:T,children:y}),q=gr[o],O=p?ur[o]:{};return r.jsx(ni,{variant:e,animation:B.animation,to:k,isDisabled:f,isLoading:m,isAuto:g,isFilled:h,isExternal:w,shape:t,shadow:I,onClick:C,views:T,baseStyles:L,sizeStyles:q,iconPad:O,resolvedTextColor:D,content:F,size:o,mainTone:E,borderMovingDuration:j,borderMovingGradientColors:z,animatedStrokeAccentColor:V,animatedStrokeTextColor:P,getColor:S,...B})},Pe=e=>{const[o,t]=i.useHover();return r.jsx(ai,{ref:o,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)"}}}},Wo=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=u.createContext({}),yt=()=>u.useContext(hr),xt=({children:e,views:o,style:t,themeMode:n,...l})=>{var g;const a=i.useTheme(),{styles:c}=yt(),d=Wo(a).header,s={...d,...c==null?void 0:c.header,...l,style:{...d==null?void 0:d.style,...(g=c==null?void 0:c.header)==null?void 0:g.style,...t}};return r.jsx(i.Vertical,{gap:8,...s,children:e})},kt=({children:e,views:o,style:t,themeMode:n,...l})=>{var g;const a=i.useTheme(),{styles:c}=yt(),d=Wo(a).content,s={...d,...c==null?void 0:c.content,...l,style:{...d==null?void 0:d.style,...(g=c==null?void 0:c.content)==null?void 0:g.style,...t}};return r.jsx(i.Vertical,{gap:12,...s,children:e})},Ct=({children:e,views:o,style:t,themeMode:n,...l})=>{var g;const a=i.useTheme(),{styles:c}=yt(),d=Wo(a).footer,s={...d,...c==null?void 0:c.footer,...l,style:{...d==null?void 0:d.style,...(g=c==null?void 0:c.footer)==null?void 0:g.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:d,style:s,themeMode:g,...h})=>{var C,T;const f=i.useTheme(),m=Wo(f),p=((C=li[o])==null?void 0:C.padding)||"16px",b=u.useMemo(()=>({styles:{container:{...m.container,borderRadius:ci[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=u.Children.toArray(n).some(j=>u.isValidElement(j)&&(j.type===xt||j.type===kt||j.type===Ct)),{themeMode:y}=f,w=ii(g||y)[e],I={width:c?"100%":"auto",overflow:"hidden",...w,...b.styles.container,...h,style:{...(T=b.styles.container)==null?void 0:T.style,...s}};return r.jsx(hr.Provider,{value:b,children:r.jsx(i.View,{...I,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:d,stepIndices:s})=>{const g=u.useRef(d||0),[h,f]=u.useState(d||0),m=u.useRef(new Set),p=u.useRef(0),b=u.useMemo(()=>rt("carousel-content"),[]),[x,y]=u.useState(o!==void 0?o:e),[k,w]=u.useState(!1),[I,C]=u.useState(!1),[T,j]=u.useState(0),[z,V]=u.useState(0),P=u.useRef(null);u.useEffect(()=>{o!==void 0&&y(o)},[o]);const B=u.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((Q,Y)=>Math.abs(Y-N)<Math.abs(Q-N)?Y:Q))),o===void 0&&y(N),t&&t(N)},[o,c,t,h]),S=u.useCallback(()=>{B(x+1)},[x,B]),H=u.useCallback(()=>{B(x-1)},[x,B]);u.useEffect(()=>(n&&!k&&!I&&(P.current=setInterval(()=>{S()},l)),()=>{P.current&&clearInterval(P.current)}),[n,l,k,I,S,a]);const A=u.useCallback(()=>{a&&w(!0)},[a]),E=u.useCallback(()=>{w(!1)},[]),W=u.useCallback(O=>{C(!0),"touches"in O?(j(O.touches[0].clientX),V(O.touches[0].clientY)):(j(O.clientX),V(O.clientY))},[]),$=u.useCallback(O=>{if(!I)return;let N,K;"touches"in O?(N=O.touches[0].clientX,K=O.touches[0].clientY):(N=O.clientX,K=O.clientY);const Q=N-T,Y=K-z;Math.abs(Q)>Math.abs(Y)&&Math.abs(Q)>50&&(Q>0?H():S(),C(!1))},[I,T,z,S,H]),_=u.useCallback(()=>{C(!1)},[]),L=u.useCallback(()=>{const O=p.current++;m.current.add(O);const N=m.current.size;return g.current=N,f(N),O},[]),D=u.useCallback(O=>{m.current.delete(O);const N=m.current.size;if(g.current=N,f(N),N>0&&x>=N){const K=Math.max(0,N-1);o===void 0&&y(K),t&&t(K)}},[x,o,t]),F=c||x>0,q=c||x<h-1;return{activeIndex:x,totalSlides:h,goToSlide:B,nextSlide:S,prevSlide:H,canGoNext:q,canGoPrevious:F,handleMouseEnter:A,handleMouseLeave:E,handleDragStart:W,handleDragMove:$,handleDragEnd:_,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"}},$o={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"}},co=()=>({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,...$o},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...$o}}),fr=u.createContext(null),Ho=()=>{const e=u.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}=Ho(),d={...co().prevButton,...a==null?void 0:a.prevButton,...e==null?void 0:e.prevButton};return r.jsx(Pe,{"aria-label":"Previous slide",onClick:()=>n(),isDisabled:!l,...d,...t,children:o??r.jsx(le,{orientation:"left",widthHeight:16})})},br=({views:e,children:o,...t})=>{const{goToNext:n,canGoNext:l,styles:a}=Ho(),d={...co().nextButton,...a==null?void 0:a.nextButton,...e==null?void 0:e.nextButton};return r.jsx(Pe,{"aria-label":"Next slide",onClick:()=>n(),isDisabled:!l,...d,...t,children:o??r.jsx(le,{orientation:"right",widthHeight:16})})},yr=({children:e,views:o,...t})=>{const{registerSlide:n,unregisterSlide:l,styles:a}=Ho(),c=u.useRef(null);u.useEffect(()=>{const g=n();return c.current=g,()=>{c.current!==null&&l(c.current)}},[n,l]);const s={...co().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}=Ho(),d=co(),s={...d.content,...a==null?void 0:a.content,...o==null?void 0:o.content},g={...d.innerContainer,...a==null?void 0:a.innerContainer,...o==null?void 0:o.innerContainer},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,{...g,style:{...g==null?void 0:g.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:d,showIndicators:s=!0,indicatorPosition:g="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:I,...C})=>{const T=u.useMemo(()=>u.Children.toArray(e),[e]),j=di({defaultActiveIndex:o,activeIndex:t,onChange:n,autoPlay:f,autoPlayInterval:m,pauseOnHover:p,infinite:b,totalSlides:T.length}),{activeIndex:z,totalSlides:V,goToSlide:P,nextSlide:B,prevSlide:S,handleMouseEnter:H,handleMouseLeave:A,handleDragStart:E,handleDragMove:W,handleDragEnd:$}=j,_=()=>{if(!l)return null;const F=c||r.jsx(i.View,{as:"button","aria-label":"Previous slide",...$o,...k==null?void 0:k.prevButton,children:"❮"}),q=d||r.jsx(i.View,{as:"button","aria-label":"Next slide",...$o,...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:B,cursor:!b&&z===T.length-1?"not-allowed":"pointer",opacity:!b&&z===T.length-1?.5:1,children:q})]})},L=()=>s?r.jsx(i.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...g==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:T.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 u.useMemo(()=>u.Children.toArray(e).some(F=>u.isValidElement(F)&&(F.type===xr||F.type===yr||F.type===pr||F.type===br)),[e])?r.jsx(fr.Provider,{value:{currentIndex:z,totalSlides:V,goToSlide:P,goToNext:B,goToPrevious:S,canGoNext:j.canGoNext,canGoPrevious:j.canGoPrevious,registerSlide:j.registerSlide,unregisterSlide:j.unregisterSlide,styles:{...co(),...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:H,onMouseLeave:A,onTouchStart:E,onTouchMove:W,onTouchEnd:$,onMouseDown:E,onMouseMove:W,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:T.map((F,q)=>r.jsx(mr,{isActive:q===z,index:q,views:k==null?void 0:k.slide,children:F},q))}),_(),L()]})},Fe=e=>r.jsx(hi,{...e});Fe.Slide=mr,Fe.Content=xr,Fe.Item=yr,Fe.Previous=pr,Fe.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"},Oe=[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"},Bo={stroke:"color-gray-300",strokeWidth:"1px"},Lo={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"},Ao={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]=u.useState(t?0:1),[d,s]=u.useState({visible:!1,x:0,y:0,content:null}),g=u.useRef(null),h=u.useRef(null);u.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&&(g.current=requestAnimationFrame(y))};return g.current=requestAnimationFrame(y),()=>{g.current&&cancelAnimationFrame(g.current)}},[t,n]);const f=u.useCallback(()=>e?{...e,series:e.series.map((x,y)=>({...x,color:x.color||Oe[y%Oe.length]}))}:o?o.map((x,y)=>({...x,color:x.color||Oe[y%Oe.length]})):null,[e,o]),m=u.useCallback((x,y,k)=>{l&&s({visible:!0,x,y,content:k})},[l]),p=u.useCallback(()=>{s(x=>({...x,visible:!1}))},[]),b=u.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}},Mi=({data:e,width:o,height:t,animationProgress:n,showGrid:l=!0,onBarClick:a,showTooltip:c,hideTooltip:d,views:s})=>{const{getColor:g}=i.useTheme(),h={top:20,right:20,bottom:40,left:50},f=o-h.left-h.right,m=t-h.top-h.bottom,p=u.useMemo(()=>{let T=0;return e.series.forEach(j=>{j.data.forEach(z=>{T=Math.max(T,z)})}),T},[e]),b=e.labels.length,x=e.series.length,y=f/b,k=y*.8/x,w=y*.2/(x+1),I=p||10,C=u.useMemo(()=>{const j=[];for(let z=0;z<=5;z++){const V=I/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,...Bo,...s==null?void 0:s.axis}),r.jsx("line",{x1:h.left,y1:h.top,x2:h.left,y2:t-h.bottom,...Bo,...s==null?void 0:s.axis}),e.labels.map((T,j)=>{const z=h.left+(j+.5)*y,V=t-h.bottom+20;return r.jsx("text",{x:z,y:V,textAnchor:"middle",...Lo,...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:T},`x-label-${j}`)}),C.map((T,j)=>{const z=t-h.bottom-T/I*m;return r.jsxs(u.Fragment,{children:[r.jsx("text",{x:h.left-10,y:z,textAnchor:"end",dominantBaseline:"middle",...Lo,...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:T.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((T,j)=>r.jsx(u.Fragment,{children:T.data.map((z,V)=>{const P=z/I*m*n,B=h.left+V*y+w*(j+1)+k*j,S=t-h.bottom-P,H=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,W=T.color?g(T.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:T.name}),r.jsx(i.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:W})]}),r.jsx(i.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:H}),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(T.name,V)};return r.jsx("rect",{x:B,y:S,width:k,height:P,fill:W,onMouseEnter:$,onMouseLeave:d,onClick:_,...ki,...s==null?void 0:s.bar},`bar-${j}-${V}`)})},`series-${j}`))]})},zi=({data:e,width:o,height:t,animationProgress:n,showGrid:l=!0,onPointClick:a,showTooltip:c,hideTooltip:d,views:s})=>{const{getColor:g}=i.useTheme(),h={top:20,right:20,bottom:40,left:50},f=o-h.left-h.right,m=t-h.top-h.bottom,p=u.useMemo(()=>{let w=0;return e.series.forEach(I=>{I.data.forEach(C=>{w=Math.max(w,C)})}),w},[e]),b=p||10,x=u.useMemo(()=>{const I=[];for(let C=0;C<=5;C++){const T=b/5*C;I.push(T)}return I},[p]),y=w=>`M ${w.map((C,T)=>{const j=h.left+T/(e.labels.length-1)*f,z=t-h.bottom-C/b*m*n;return`${j},${z}`}).join(" L ")}`,k=w=>{const I=h.left,C=h.left+f,T=t-h.bottom,j=w.map((z,V)=>{const P=h.left+V/(e.labels.length-1)*f,B=t-h.bottom-z/b*m*n;return`${P},${B}`});return`M ${I},${T} L ${j.join(" L ")} L ${C},${T} 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,...Bo,...s==null?void 0:s.axis}),r.jsx("line",{x1:h.left,y1:h.top,x2:h.left,y2:t-h.bottom,...Bo,...s==null?void 0:s.axis}),e.labels.map((w,I)=>{const C=h.left+I/(e.labels.length-1)*f,T=t-h.bottom+20;return r.jsx("text",{x:C,y:T,textAnchor:"middle",...Lo,...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-${I}`)}),x.map((w,I)=>{const C=t-h.bottom-w/b*m;return r.jsxs(u.Fragment,{children:[r.jsx("text",{x:h.left-10,y:C,textAnchor:"end",dominantBaseline:"middle",...Lo,...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,...kr,...s==null?void 0:s.grid})]},`y-tick-${I}`)}),e.series.map((w,I)=>{const C=w.color?g(w.color):"black";return r.jsxs(u.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,...Ci,...s==null?void 0:s.line}),w.data.map((T,j)=>{const z=h.left+j/(e.labels.length-1)*f,V=t-h.bottom-T/b*m*n,P=e.labels[j],B=e.series.reduce((_,L)=>{const D=L.data[j];return _+(typeof D=="number"?D:0)},0),S=B>0?(T/B*100).toFixed(1):null,H=j>0&&typeof w.data[j-1]=="number"?w.data[j-1]:null,A=typeof H=="number"?T-H:null,E=typeof A=="number"?`${A>=0?"+":""}${A.toLocaleString()}`:null,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: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: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:T.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:B.toLocaleString()})]})]})]});c(_.clientX,_.clientY,L)},$=()=>{a&&a(w.name,j)};return r.jsx("circle",{cx:z,cy:V,fill:C,onMouseEnter:W,onMouseLeave:d,onClick:$,...wi,...s==null?void 0:s.point},`point-${I}-${j}`)})]},`series-${I}`)})]})},Vi=({dataPoints:e,width:o,height:t,animationProgress:n,isDonut:l=!1,onSliceClick:a,showTooltip:c,hideTooltip:d,views:s})=>{const{getColor:g}=i.useTheme(),{ref:h,relation:f}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),m=u.useRef(null);u.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=u.useMemo(()=>e.reduce((C,T)=>C+T.value,0),[e]),I=u.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 T=-Math.PI/2;for(let j=0;j<e.length;j++){const V=e[j].value/w,P=V*2*Math.PI*n,B=T+P,S=x+Math.cos(T)*b,H=y+Math.sin(T)*b,A=x+Math.cos(B)*b,E=y+Math.sin(B)*b,W=x+Math.cos(T)*k,$=y+Math.sin(T)*k,_=x+Math.cos(B)*k,L=y+Math.sin(B)*k,D=P>Math.PI?1:0;let F;l?F=[`M ${S} ${H}`,`A ${b} ${b} 0 ${D} 1 ${A} ${E}`,`L ${_} ${L}`,`A ${k} ${k} 0 ${D} 0 ${W} ${$}`,"Z"].join(" "):F=[`M ${x} ${y}`,`L ${S} ${H}`,`A ${b} ${b} 0 ${D} 1 ${A} ${E}`,"Z"].join(" ");const q=T+P/2,O=b*.7,N=x+Math.cos(q)*O,K=y+Math.sin(q)*O,Q=`${(V*100).toFixed(1)}%`,Y=e[j].color||Oe[j%Oe.length],Z=g(Y);C.push({path:F,color:Z,label:e[j].label,value:e[j].value,percentage:Q,labelX:N,labelY:K,startAngle:T,endAngle:B,index:j}),T=B}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"}),I.map((C,T)=>{const j=P=>{const B=w>0?C.value/w*100:0,S=w>0?Math.max(0,100-B):null,H=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=P.clientX,E=P.clientY;if(f&&m.current){const W=m.current.getBoundingClientRect();P.clientX-W.left,P.clientY-W.top,f.space.horizontal==="left"?A=P.clientX-100:A=P.clientX+10,f.space.vertical==="top"?E=P.clientY-30:E=P.clientY+10}c(A,E,H)},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,...Ao,style:{...Ao==null?void 0:Ao.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-${T}`)})]})},Ei=({visible:e,x:o,y:t,content:n,maxDistance:l=100,views:a})=>{const c=u.useRef(null),[d,s]=u.useState({left:0,top:0});return u.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},Pi=({type:e,data:o,dataPoints:t,title:n,showLegend:l=!0,legendPosition:a="bottom",showGrid:c=!0,showTooltips:d=!0,animated:s=!0,animationDuration:g=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:I,loadingIndicator:C,errorIndicator:T,noDataIndicator:j,"aria-label":z,themeMode:V,...P})=>{const{animationProgress:B,tooltip:S,containerRef:H,processedData:A,showTooltip:E,hideTooltip:W,getChartDimensions:$}=Si({data:o,dataPoints:t,animated:s,animationDuration:g,showTooltips:d}),_=A(),{width:L,height:D}=$(),F=m||L,q=p||(h?L/f:D),O=()=>{if(!l||!_)return null;let ne=[];return e==="pie"||e==="donut"?Array.isArray(_)&&(ne=_):_&&_.series&&(ne=_.series),!ne||ne.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:ne.map((ae,te)=>r.jsxs(i.View,{...bi,...b==null?void 0:b.legendItem,children:[r.jsx(i.View,{backgroundColor:ae.color,...yi}),r.jsx(i.Text,{...xi,children:ae.name||ae.label})]},`legend-${te}`))})},N=()=>{if(!_)return null;switch(e){case"bar":return r.jsx(Mi,{data:_,width:F,height:q,animationProgress:B,showGrid:c,onBarClick:y,showTooltip:E,hideTooltip:W,views:b});case"line":case"area":return r.jsx(zi,{data:_,width:F,height:q,animationProgress:B,showGrid:c,onPointClick:y,showTooltip:E,hideTooltip:W,views:b});case"pie":case"donut":return r.jsx(Vi,{dataPoints:_,width:F,height:q,animationProgress:B,isDonut:e==="donut",onSliceClick:x,showTooltip:E,hideTooltip:W,views:b});default:return null}},K=()=>k?r.jsx(i.View,{...Ii,...b==null?void 0:b.loadingOverlay,children:C||r.jsx(i.Center,{children:r.jsx(ro,{size:"lg"})})}):null,Q=()=>w?r.jsx(i.View,{...Ti,...b==null?void 0:b.errorOverlay,children:T||r.jsx(i.Text,{fontWeight:"medium",children:typeof w=="string"?w:"An error occurred"})}):null,Y=()=>I?r.jsx(i.View,{...ji,...b==null?void 0:b.noDataOverlay,children:j||r.jsx(i.Text,{children:typeof I=="string"?I:"No data available"})}):null,Z=z??(typeof n=="string"?n:"Chart"),ee=!w&&!k&&!I;return r.jsxs(i.View,{ref:H,role:"region","aria-label":Z,"aria-busy":k,...fi,...b==null?void 0:b.container,...P,children:[n&&r.jsx(i.Text,{...mi,children:n}),ee&&a==="top"&&O(),r.jsxs(i.View,{flex:1,width:"100%",position:"relative",...b==null?void 0:b.chart,children:[ee&&N(),K(),Q(),Y()]}),ee&&a==="bottom"&&O(),r.jsx(Ei,{visible:d&&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]=u.useState(!1),[n,l]=u.useState(null),a="app-studio-cookie-consent";u.useEffect(()=>{const g=localStorage.getItem(a);l(g!==null?g==="true":!1)},[]);const c=g=>{localStorage.setItem(a,String(g));const h=new Date;h.setDate(h.getDate()+e),localStorage.setItem(`${a}-expires`,h.toISOString()),l(g)};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:d,views:s,showCustomizeButton:g=!0,cookieExpiration:h=365,themeMode:f,...m})=>{const{themeMode:p}=i.useTheme(),b=f||p||"light",{hasConsent:x,acceptCookies:y}=_i(h),w=$i(b)[a];if(x)return null;const I=()=>{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:[g&&r.jsx(Pe,{variant:"outline",onClick:C,size:"sm",...s==null?void 0:s.customizeButton,children:n}),r.jsx(Pe,{variant:"primary",onClick:I,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]=u.useState(!1),[c,d]=u.useState({x:0,y:0}),[s,g]=u.useState(null),h=u.useRef(null),f=u.useRef(null),m=u.useMemo(()=>rt("contextmenu-content"),[]),p=u.useCallback(x=>{d({x:x.clientX,y:x.clientY}),a(!0),n==null||n(!0)},[n]),b=u.useCallback(()=>{a(!1),g(null),n==null||n(!1)},[n]);return u.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:g,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=u.createContext({isOpen:!1,setIsOpen:()=>{},position:{x:0,y:0},setPosition:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null},contentRef:{current:null},contentId:"contextmenu-content",closeMenu:()=>{},openMenu:()=>{}}),Di=({children:e,value:o})=>r.jsx(Ir.Provider,{value:o,children:e}),Do=()=>{const e=u.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:d,openMenu:s}=Do(),h={ref:c,onContextMenu:f=>{if(!n)if(o&&f.preventDefault(),s)s(f);else{const{setIsOpen:m,setPosition:p}=Do();p({x:f.clientX,y:f.clientY}),m(!0)}},"aria-controls":d,"aria-haspopup":"menu","data-disabled":n?"":void 0,...t&&u.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:n},...l==null?void 0:l.container,...a};if(t&&u.isValidElement(e)){const f=u.Children.only(e);return u.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,...d})=>{const{isOpen:s,position:g,contentRef:h,contentId:f,variant:m}=Do(),p=u.useRef(null),b=h||p,{ref:x,relation:y}=i.useElementPosition({}),[k,w]=u.useState({x:0,y:0});if(u.useEffect(()=>{if(s&&b.current){const C=t||g,T=b.current.offsetWidth,j=b.current.offsetHeight,z=window.innerWidth,V=window.innerHeight;let P=C.x,B=C.y;y&&(y.space.horizontal==="left"?P=C.x-T:P=C.x,y.space.vertical==="top"?B=C.y-j:B=C.y),P+T>z&&(P=z-T-8),P<8&&(P=8),B+j>V&&(B=V-j-8),B<8&&(B=8),w({x:P,y:B})}},[s,g,t,n,l,b,y]),!s)return null;const I={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:{...I,...c},...Ai[m],...a==null?void 0:a.menu,...a==null?void 0:a.content,...d,children:[e&&e.map((C,T)=>C.divider?r.jsx(Sr,{views:a},`divider-${T}`):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:d,size:s,closeMenu:g}=Do();if(e){const[f,m]=u.useState(!1),p=e.items&&e.items.length>0,b=c===e.id,[x,y]=u.useState({x:0,y:0}),k=e.disabled||n,w=()=>{m(!0),p&&d(e.id)},I=()=>{m(!1)},C=()=>{k||!p&&e.onClick&&(e.onClick(),g&&g())},{ref:T,relation:j}=i.useElementPosition({});return u.useEffect(()=>{if(b&&T.current){const z=T.current.getBoundingClientRect(),V=window.innerWidth,P=200;let B=!1;if(j)B=j.space.horizontal==="left";else{const S=V-z.right,H=z.left;B=S<P&&H>S}y({x:B?z.left-P:z.right,y:z.top})}},[b,e.items,j]),r.jsxs(i.View,{ref:T,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:w,onMouseLeave:I,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),g&&g())};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,...d})=>!o||o.length===0?r.jsx(r.Fragment,{children:e}):r.jsxs(r.Fragment,{children:[r.jsx(Tr,{disableNativeContextMenu:l,views:a,...d,children:e}),r.jsx(It,{items:o,views:a})]}),qe=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:l=!0,onOpenChange:a,views:c,...d})=>{const s=Li({size:t,variant:n,onOpenChange:a}),{isOpen:g,setIsOpen:h,position:f,setPosition:m,activeSubmenuId:p,setActiveSubmenuId:b,triggerRef:x,contentRef:y,contentId:k,openMenu:w,closeMenu:I}=s;return r.jsx(Di,{value:{isOpen:g,setIsOpen:h,position:f,setPosition:m,activeSubmenuId:p,setActiveSubmenuId:b,size:t,variant:n,triggerRef:x,contentRef:y,contentId:k,openMenu:w,closeMenu:I,styles:c},children:r.jsx(Oi,{items:o,size:t,variant:n,disableNativeContextMenu:l,views:c,...d,children:e})})};qe.Trigger=Tr,qe.Content=It,qe.Item=jr,qe.Divider=Sr,qe.Separator=Fi;const qi=({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})})},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]=u.useState(!1),[d,s]=u.useState(!1),[g,h]=u.useState(l),[f,m]=u.useState(0),[p,b]=u.useState(!0);return{id:n,value:g,setValue:h,hide:p,setHide:b,isHovered:a,setIsHovered:c,isFocused:d,setIsFocused:s,highlightedIndex:f,setHighlightedIndex:m}},zr=({children:e,containerId:o="portal-root"})=>{const[t,n]=u.useState(null);return u.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}),Ie=u.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})]}));Ie.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"}}},Se=({label:e,shadow:o,children:t,value:n,size:l="md",shape:a="default",variant:c="default",error:d=!1,showLabel:s=!1,isFocused:g=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:m=!1,views:p={pickerBox:{}},...b})=>{const y=d?"color-red-500":(h||g)&&!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:d,...s})=>{const g=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",...g,...s,children:e})},io=e=>r.jsx(vi,{...e}),We=({children:e,size:o="md",error:t=!1,color:n="theme-primary",views:l={label:{}},helperText:a,...c})=>r.jsx(io,{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}),Ne=({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"},Fo={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,...d})=>{const s=(f,m)=>{f.stopPropagation(),f.preventDefault(),typeof l=="function"&&l(m)},g=()=>o(!e),h=()=>c&&e?Fo.selectedHighlighted:c?Fo.selected:e?Fo.highlighted:Fo.default;return r.jsxs(i.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...Qi,...h(),onMouseEnter:g,onMouseLeave:g,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:"✓"})]})},es=({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(g=>g.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(g=>r.jsx(rs,{option:g,removeOption:a},g))}):r.jsx("span",{children:t})})})},os=({id:e,name:o,value:t,onChange:n,isMulti:l=!1,isDisabled:a=!1,isReadOnly:c=!1,options:d=[],...s})=>{const g=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:g,multiple:l,...s,children:d.length>0&&d.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 d=g=>n(g),s=g=>Array.isArray(c)?c.includes(g):c===g;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((g,h)=>r.jsx(Ri,{size:e,style:o.text,option:g,callback:d,isSelected:s(g.value),isHovered:h===l,setIsHovered:()=>{},onMouseEnter:()=>a(h)},g.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:d=!1,isMulti:s=!1,isFocused:g=!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:I=()=>{},setHide:C=()=>{},setValue:T=()=>{},setIsHovered:j=()=>{},setIsFocused:z=()=>{},setHighlightedIndex:V,highlightedIndex:P,...B})=>{const{ref:S,relation:H,updateRelation:A}=i.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),E=u.useRef(null),W=()=>{var Q;if(!S.current)return{};const O=S.current.getBoundingClientRect(),N={position:"fixed",left:O.left,width:O.width,zIndex:1e4};return((Q=H==null?void 0:H.space)==null?void 0:Q.vertical)==="top"?{...N,bottom:window.innerHeight-O.top+8}:{...N,top:O.bottom+8}};u.useEffect(()=>{const O=()=>C(!0);return document.addEventListener("closeAllSelects",O),()=>document.removeEventListener("closeAllSelects",O)},[C]),u.useEffect(()=>{const O=N=>{!N.target.closest(`#${e}`)&&!c&&C(!0)};return document.addEventListener("click",O),()=>{document.removeEventListener("click",O)}},[e,c,C]);const $=!!(g&&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=u.useCallback(O=>{if(C(!0),document.dispatchEvent(new Event("closeAllSelects")),s&&Array.isArray(n)){if(!n.includes(O)){const N=[...n,O];T(N),I&&I(O)}}else T(O),I&&I(O);z(!0)},[s,n,C,T,I,z]),q=O=>{if(Array.isArray(n)&&n.includes(O)){const N=n.filter(K=>K!==O);T(N.length===0?[]:N)}};return r.jsx(Ie,{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(Se,{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:g,showLabel:$,onMouseEnter:_,onMouseLeave:_,position:"relative",children:[r.jsxs(Ne,{children:[$&&r.jsx(We,{htmlFor:e,color:"theme-primary",error:d,...w,children:t}),r.jsx(os,{id:e,name:o,options:p,onChange:I,value:n,isDisabled:f,isReadOnly:m,isMulti:s,onFocus:L,...B}),r.jsx(es,{options:p,size:x,views:w,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:w.icon,orientation:"down"})})}),!c&&p.length>0&&r.jsx(zr,{children:r.jsx(i.Element,{ref:E,onClick:O=>O.stopPropagation(),style:{...W(),...Ki.enter},children:r.jsx(ts,{size:x,views:w,options:p,callback:F,highlightedIndex:P,setHighlightedIndex:V,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]=u.useState(!1),[l,a]=u.useState(o||!1),[c,d]=u.useState(o||!1);return u.useEffect(()=>{o!==void 0&&(a(o),d(o))},[o]),{isHovered:t,setIsHovered:n,on:l,setOn:a,value:c,setValue:d}},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}},_e={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:d={},size:s="sm",value:g=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:m=!1,on:p,setOn:b,onChange:x,setValue:y=()=>{},setIsHovered:k=()=>{},helperText:w,views:I={slider:{},circle:{},label:{}},...C})=>{const T=P=>{if(!m&&!f){const B=P.target.checked;y(B),b(B),x&&x(B)}},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",...I.label}};return r.jsxs(io,{htmlFor:e,onMouseEnter:j,onMouseLeave:z,...V.container,...C,children:[r.jsx(is,{id:e,name:o,opacity:0,width:0,height:0,checked:g,onChange:T,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:g?a?"space-between":"flex-end":n?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:f?_e.default.disabled:g?h?_e.states.hover.active:_e.default.active:h?_e.states.hover.inactive:_e.default.inactive,opacity:!f&&g&&h?_e.states.hover.activeOpacity:1,cursor:"pointer",...Br.slider,...d,...cs[s],...ls[s],...I.slider,children:[a&&g&&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:_e.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],...I.circle}),n&&!g&&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]=u.useState(!1),[d,s]=u.useState(!1),[g,h]=u.useState(l),[f,m]=u.useState(0),[p,b]=u.useState(!0);return{id:n,value:g,setValue:h,hide:p,setHide:b,isHovered:a,setIsHovered:c,isFocused:d,setIsFocused:s,highlightedIndex:f,setHighlightedIndex:m}},Dr=({id:e,name:o,label:t,value:n,size:l,views:a={},options:c=[],onChange:d=()=>{},setValue:s=()=>{},...g})=>{const{getColor:h}=i.useTheme(),f=u.useCallback(m=>{s(m.value),d&&d(m.value)},[s,d]);return r.jsxs(Ie,{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(je,{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 I=h("theme-primary");y=I,k=I,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(Pe,{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:()=>{}})]})},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]=u.useState(e??o),[a,c]=u.useState(!1),[d,s]=u.useState(t||""),[g,h]=u.useState(!1);return u.useMemo(()=>{l(g&&!d?o??"":e??o)},[d,g,e,o]),{hint:n,setHint:l,isHovered:a,setIsHovered:c,value:d,setValue:s,isFocused:g,setIsFocused:h}},Or=({id:e,name:o,hint:t,error:n,value:l,label:a,shadow:c,helperText:d,placeholder:s,size:g="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:I=3,maxCols:C=30,onBlur:T=()=>{},onChange:j,onFocus:z,setHint:V=()=>{},setValue:P=()=>{},setIsFocused:B=()=>{},setIsHovered:S=()=>{},views:H={label:{},helperText:{}},...A})=>{const E=!!(p&&a),W={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:i.Typography.fontSizes[g],lineHeight:`${Math.round(i.Typography.fontSizes[g]*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",...H.field},$=()=>S(!m),_=()=>{B(!0),z&&z()},L=F=>{T(F),B(!1)},D=F=>{typeof F=="string"?(P(F),j&&j(F)):(P(F.target.value),j&&j(F.target.value))};return r.jsx(Ie,{helperText:d,error:n,views:H,...A,children:r.jsx(Se,{label:a,size:g,error:n,shape:h,views:H,shadow:c,variant:f,value:l,color:"theme-primary",isHovered:m,isDisabled:y,isReadOnly:x,isFocused:p,showLabel:E,onMouseEnter:$,onMouseLeave:$,...H==null?void 0:H.content,children:r.jsxs(Ne,{...H==null?void 0:H.warper,children:[E&&r.jsx(We,{htmlFor:e,color:"theme-primary",error:n,...H==null?void 0:H.label,children:a}),r.jsx(i.Element,{as:"textarea",id:e,name:o,rows:I,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),...W,style:{resize:y||x?"none":"vertical"},...H==null?void 0:H.textarea})]})})})},gs=e=>{const o=Fr(e);return r.jsx(Or,{...o,...e})},St=({label:e,placeholder:o,value:t})=>{const[n,l]=u.useState(e??o),[a,c]=u.useState(!1),[d,s]=u.useState(!1),[g,h]=u.useState(t);return u.useMemo(()=>{l(a&&!g?o??"":e??o)},[g,a,e,o]),{hint:n,setHint:l,isFocused:a,setIsFocused:c,isHovered:d,setIsHovered:s,setValue:h,value:g}},us=e=>r.jsx(i.Input,{type:"text",...e}),so=({id:e,name:o,label:t,hint:n,value:l,onChange:a,left:c,right:d,helperText:s,placeholder:g,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:I=!1,isReadOnly:C=!1,isClearable:T=!0,isAutoFocus:j=!1,setHint:z=()=>{},setIsFocused:V=()=>{},setIsHovered:P=()=>{},setValue:B=()=>{},onClick:S=()=>{},onFocus:H,onBlur:A=()=>{},themeMode:E,...W})=>{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:I?"color-gray-400":"color-gray-900",cursor:I?"not-allowed":"text",opacity:I?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...m.field},q=()=>{V(!0),H&&H()},O=()=>P(!w),N=Y=>{A&&A(Y),V(!1)},K=Y=>{typeof Y=="string"?(B(Y),h&&h(Y),a&&a(Y)):(B(Y.target.value),h&&h(Y.target.value),a&&a(Y.target.value))},Q=()=>{B(""),a&&(A({target:{name:o}}),h&&h(""),a&&a("")),typeof document>"u"&&h&&h("")};return r.jsx(Ie,{helperText:s,error:y,views:m,children:r.jsxs(Se,{label:t,size:p,error:y,shape:b,views:m,shadow:f,variant:x,value:l,color:"theme-primary",isHovered:w,isDisabled:I,isReadOnly:C,isFocused:k,showLabel:D,onMouseEnter:O,onMouseLeave:O,children:[c,r.jsxs(Ne,{children:[D&&r.jsx(We,{htmlFor:e,color:"theme-primary",error:y,...m,children:t}),r.jsx(us,{id:e,name:o,readOnly:C,disabled:I,autoFocus:j,placeholder:n,onFocus:q,onBlur:N,autoComplete:"off",...F,...W,onChange:K,value:l})]}),T&&l&&!C&&!I&&r.jsx(jt,{children:r.jsx(pe,{size:20,color:L,onClick:Q,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]})})},go=e=>{const o=St(e);return r.jsx(so,{...o,...e})},qr=({defaultIsSelected:e=!1})=>{const[o,t]=u.useState(!1),[n,l]=u.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:d={},labelPosition:s="right",size:g="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:I={checkbox:{},label:{}},infoText:C,helperText:T,...j})=>{const z=()=>w(!m),V=()=>{!b&&!p&&(k&&k(!f),a&&a(!l),c&&c(!l))},P=x?"indeterminate":l||f?"selected":"unselected",B=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",...I.label},checkbox:{...fs[P],...B,borderRadius:"4px",...hs[g],transition:"all 0.2s ease",...d,...I.checkbox}};return r.jsxs(io,{htmlFor:e,as:"div",onClick:V,onMouseEnter:z,onMouseLeave:z,size:i.Typography.fontSizes[g],...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:g,fontWeight:"500",...I==null?void 0:I.label,children:n}),r.jsx(i.Center,{...S.checkbox,children:x?r.jsx(Jt,{widthHeight:Nr[g],color:"white",transition:"all 0.2s ease"}):(l||f)&&(o??r.jsx(zo,{widthHeight:Nr[g],color:"white",transition:"all 0.2s ease"}))}),s==="right"&&n&&r.jsx(i.Text,{size:g,fontWeight:"500",...I==null?void 0:I.label,children:n})]}),C&&r.jsx(i.Text,{marginLeft:s==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...I==null?void 0:I.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:d=!0,maxRecentColors:s=8,showRecentColors:g=!0,isAutoFocus:h=!1}=e,[f,m]=u.useState(!1),[p,b]=u.useState(o??t),[x,y]=u.useState(""),[k,w]=u.useState([]),[I,C]=u.useState(!1),[T,j]=u.useState(!1),z=u.useRef(null),V=u.useRef(null);u.useEffect(()=>{o!==void 0&&b(o)},[o]),u.useEffect(()=>{if(g)try{const $=localStorage.getItem("colorInput-recentColors");$&&w(JSON.parse($))}catch($){console.warn("Failed to load recent colors from localStorage:",$)}},[g]),u.useEffect(()=>{h&&z.current&&z.current.focus()},[h]),u.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 P=u.useCallback($=>{g&&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})},[g,s]),B=u.useCallback(()=>{const $=!f;m($),$?a==null||a():c==null||c()},[f,a,c]),S=u.useCallback($=>{b($),P($),n==null||n($),l==null||l($),d&&(m(!1),c==null||c())},[n,l,d,c,P]),H=u.useCallback($=>{y($)},[]),A=u.useCallback(()=>{x&&(S(x),y(""))},[x,S]),E=u.useCallback(()=>{m(!1),c==null||c()},[c]),W=u.useCallback($=>{b($),n==null||n($)},[n]);return{isOpen:f,selectedColor:p,recentColors:k,customColor:x,isFocused:I,isHovered:T,handleToggle:B,handleColorSelect:S,handleCustomColorChange:H,handleCustomColorSubmit:A,handleClose:E,setIsFocused:C,setIsHovered:j,setValue:W,triggerRef:z,dropdownRef:V}},uo={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:d="default",variant:s="default",shadow:g,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:w=!1,selectedColor:I="",recentColors:C=[],customColor:T="",handleToggle:j=()=>{},handleColorSelect:z=()=>{},handleCustomColorChange:V=()=>{},handleCustomColorSubmit:P=()=>{},setIsFocused:B=()=>{},setIsHovered:S=()=>{},triggerRef:H,dropdownRef:A,onChange:E,...W})=>{const{getColor:$}=i.useTheme(),_={...uo.container,...a==null?void 0:a.container},L={...uo.trigger,...ps[c],...bs[d],...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,...g&&g},D={...uo.dropdown,...a==null?void 0:a.dropdown},F={...uo.colorGrid,...a==null?void 0:a.colorGrid},q={...uo.recentColors,...a==null?void 0:a.recentColors},O=I||"color-gray-200";return r.jsxs(i.View,{..._,...W,children:[t&&r.jsx(io,{htmlFor:e,size:c,isDisabled:f,error:h,views:a==null?void 0:a.label,children:t}),r.jsxs(i.View,{ref:H,onClick:f||m?void 0:j,onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),onFocus:()=>B(!0),onBlur:()=>B(!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,K)=>r.jsx(i.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:N.value,borderWidth:"2px",borderStyle:"solid",borderColor:I===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},K))}),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,K)=>r.jsx(i.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:N,borderWidth:"1px",borderStyle:"solid",borderColor:I===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"}},K))})]}),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(go,{value:T,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: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]=u.useState(zt),[n,l]=u.useState(e??zt[0].name),[a,c]=u.useState(!0),[d,s]=u.useState(!1),[g,h]=u.useState(!1);return{hide:a,setHide:c,newOptions:o,setNewOptions:t,isHovered:g,setIsHovered:h,isFocused:d,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:d=!1,isHovered:s=!1,isFocused:g=!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:I=()=>{},setHide:C=()=>{},setNewOptions:T=()=>{},setIsHovered:j=()=>{},setIsFocused:z=()=>{},setValue:V=()=>{},views:P={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:B,...S})=>{const{getColor:H,themeMode:A}=i.useTheme(),E=H("color-blueGray-700",{themeMode:B||A}),W=()=>z(!0),$=O=>{C(!c),V(O),w&&w(O)},_=()=>{!f&&!m&&C(!c)},L=O=>{const N=O.target.value,K=zt.filter(Q=>Q.name.toLowerCase().startsWith(N.toLowerCase()));c&&C(!1),T(K),w&&w(N)},D=O=>{I(O),z(!1)},F=!!(t&&(g||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(Ie,{helperText:a,error:d,views:P,onClick:_,children:[r.jsxs(Se,{label:t,size:x,error:d,shape:k,views:P,shadow:p,variant:y,value:n,color:"theme-primary",isDisabled:f,isReadOnly:m,isFocused:g,showLabel:F,_hover:!f&&!d?{borderColor:"theme-primary"}:void 0,children:[r.jsxs(Ne,{children:[F&&r.jsx(We,{htmlFor:e,color:"theme-primary",error:d,...P,children:t}),r.jsx(ws,{id:e,name:o,placeholder:l,readOnly:m,disabled:f,autoFocus:h,onBlur:D,onFocus:W,...q,...S,value:n,onChange:L})]}),r.jsx(jt,{children:c?r.jsx(le,{orientation:"down",widthHeight:Xr[x],color:E,style:P.icon}):r.jsx(le,{orientation:"up",widthHeight:Xr[x],color:E,style:P.icon})})]}),!c&&r.jsx(js,{size:x,views:P,options:b,callback:$})]})},Ss=e=>{const o=vr(e);return r.jsx(Kr,{...o,...e})};function Oo(e){"@babel/helpers - typeof";return Oo=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},Oo(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||Oo(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||Oo(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 $e(e){if(e===null||e===!0||e===!1)return NaN;var o=Number(e);return isNaN(o)?o:o<0?Math.ceil(o):Math.floor(o)}function Vs(e,o){he(2,arguments);var t=Ce(e).getTime(),n=$e(o);return new Date(t+n)}function Es(e,o){he(2,arguments);var t=$e(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 qo(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=qo(n),a=new Date(0);a.setUTCFullYear(t,0,4),a.setUTCHours(0,0,0,0);var c=qo(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=qo(t);return n}var $s=6048e5;function Hs(e){he(1,arguments);var o=Ce(e),t=qo(o).getTime()-_s(o).getTime();return Math.round(t/$s)+1}var Bs={};function No(){return Bs}function Uo(e,o){var t,n,l,a,c,d,s,g;he(1,arguments);var h=No(),f=$e((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||(g=s.options)===null||g===void 0?void 0:g.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,d,s,g;he(1,arguments);var h=Ce(e),f=h.getUTCFullYear(),m=No(),p=$e((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||(g=s.options)===null||g===void 0?void 0:g.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=Uo(b,o),y=new Date(0);y.setUTCFullYear(f,0,p),y.setUTCHours(0,0,0,0);var k=Uo(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,d,s,g;he(1,arguments);var h=No(),f=$e((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||(g=s.options)===null||g===void 0?void 0:g.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=Uo(p,o);return b}var As=6048e5;function Ds(e,o){he(1,arguments);var t=Ce(e),n=Uo(t,o).getTime()-Ls(t,o).getTime();return Math.round(n/As)+1}function oe(e,o){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length<o;)n="0"+n;return t+n}var Me={y:function(o,t){var n=o.getUTCFullYear(),l=n>0?n:1-n;return oe(t==="yy"?l%100:l,t.length)},M:function(o,t){var n=o.getUTCMonth();return t==="M"?String(n+1):oe(n+1,2)},d:function(o,t){return oe(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 oe(o.getUTCHours()%12||12,t.length)},H:function(o,t){return oe(o.getUTCHours(),t.length)},m:function(o,t){return oe(o.getUTCMinutes(),t.length)},s:function(o,t){return oe(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 oe(a,t.length)}},Ue={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 Me.y(o,t)},Y:function(o,t,n,l){var a=Zr(o,l),c=a>0?a:1-a;if(t==="YY"){var d=c%100;return oe(d,2)}return t==="Yo"?n.ordinalNumber(c,{unit:"year"}):oe(c,t.length)},R:function(o,t){var n=Qr(o);return oe(n,t.length)},u:function(o,t){var n=o.getUTCFullYear();return oe(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 oe(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 oe(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 Me.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 oe(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"}):oe(a,t.length)},I:function(o,t,n){var l=Hs(o);return t==="Io"?n.ordinalNumber(l,{unit:"week"}):oe(l,t.length)},d:function(o,t,n){return t==="do"?n.ordinalNumber(o.getUTCDate(),{unit:"date"}):Me.d(o,t)},D:function(o,t,n){var l=Ws(o);return t==="Do"?n.ordinalNumber(l,{unit:"dayOfYear"}):oe(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 oe(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 oe(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 oe(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=Ue.noon:l===0?a=Ue.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=Ue.evening:l>=12?a=Ue.afternoon:l>=4?a=Ue.morning:a=Ue.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 Me.h(o,t)},H:function(o,t,n){return t==="Ho"?n.ordinalNumber(o.getUTCHours(),{unit:"hour"}):Me.H(o,t)},K:function(o,t,n){var l=o.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(l,{unit:"hour"}):oe(l,t.length)},k:function(o,t,n){var l=o.getUTCHours();return l===0&&(l=24),t==="ko"?n.ordinalNumber(l,{unit:"hour"}):oe(l,t.length)},m:function(o,t,n){return t==="mo"?n.ordinalNumber(o.getUTCMinutes(),{unit:"minute"}):Me.m(o,t)},s:function(o,t,n){return t==="so"?n.ordinalNumber(o.getUTCSeconds(),{unit:"second"}):Me.s(o,t)},S:function(o,t){return Me.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 He(c);case"XXXXX":case"XXX":default:return He(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 He(c);case"xxxxx":case"xxx":default:return He(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"+He(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"+He(c,":")}},t:function(o,t,n,l){var a=l._originalDate||o,c=Math.floor(a.getTime()/1e3);return oe(c,t.length)},T:function(o,t,n,l){var a=l._originalDate||o,c=a.getTime();return oe(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+oe(a,2)}function Rr(e,o){if(e%60===0){var t=e>0?"-":"+";return t+oe(Math.abs(e)/60,2)}return He(e,o)}function He(e,o){var t=o||"",n=e>0?"-":"+",l=Math.abs(e),a=oe(Math.floor(l/60),2),c=oe(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 ho(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 g=e.argumentCallback?e.argumentCallback(o):o;return l[g]}}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:ho({values:td,defaultWidth:"wide"}),quarter:ho({values:rd,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:ho({values:nd,defaultWidth:"wide"}),day:ho({values:ad,defaultWidth:"wide"}),dayPeriod:ho({values:ld,defaultWidth:"wide",formattingValues:cd,defaultFormattingWidth:"wide"})};function fo(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)?gd(d,function(f){return f.test(c)}):dd(d,function(f){return f.test(c)}),g;g=e.valueCallback?e.valueCallback(s):s,g=t.valueCallback?t.valueCallback(g):g;var h=o.slice(c.length);return{value:g,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 d=o.slice(l.length);return{value:c,rest:d}}}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:fo({matchPatterns:md,defaultMatchWidth:"wide",parsePatterns:pd,defaultParseWidth:"any"}),quarter:fo({matchPatterns:bd,defaultMatchWidth:"wide",parsePatterns:yd,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:fo({matchPatterns:xd,defaultMatchWidth:"wide",parsePatterns:kd,defaultParseWidth:"any"}),day:fo({matchPatterns:Cd,defaultMatchWidth:"wide",parsePatterns:wd,defaultParseWidth:"any"}),dayPeriod:fo({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,d,s,g,h,f,m,p,b,x,y;he(2,arguments);var k=String(o),w=No(),I=(n=(l=void 0)!==null&&l!==void 0?l:w.locale)!==null&&n!==void 0?n:Sd,C=$e((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:(g=w.locale)===null||g===void 0||(h=g.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 T=$e((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(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!I.localize)throw new RangeError("locale must contain localize property");if(!I.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),V=Es(j,z),P={firstWeekContainsDate:C,weekStartsOn:T,locale:I,_originalDate:j},B=k.match(zd).map(function(S){var H=S[0];if(H==="p"||H==="P"){var A=qs[H];return A(S,I.formatLong)}return S}).join("").match(Md).map(function(S){if(S==="''")return"'";var H=S[0];if(H==="'")return _d(S);var A=Fs[H];if(A)return vs(S)&&tn(S,o,String(e)),Ys(S)&&tn(S,o,String(e)),A(V,S,I.localize,P);if(H.match(Pd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");return S}).join("");return B}function _d(e){var o=e.match(Vd);return o?o[1].replace(Ed,"'"):e}const rn=()=>{const[e,o]=u.useState(!1),[t,n]=u.useState(!1),[l,a]=u.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:d={},size:s="md",variant:g="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:I=()=>{},onChange:C,onChangeText:T,...j})=>{const z=!!(b&&n),V=()=>I(!p),P=()=>w(!0),B=H=>{typeof H=="string"?(k(H),T&&T(H)):(k(H.target.value),C&&C(H.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(Ie,{helperText:c,error:m,views:f,children:r.jsx(Se,{label:n,size:s,error:m,shape:h,views:f,shadow:d,color:"theme-primary",variant:g,value:l,isHovered:p,isDisabled:x,isReadOnly:y,isFocused:b,showLabel:z,onMouseEnter:V,onMouseLeave:V,children:r.jsxs(Ne,{children:[z&&r.jsx(We,{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,...T&&{onChangeText:B},onChange:B})]})})})},Hd=e=>{const o=rn();return r.jsx(nn,{...o,...e})},an=e=>{const o=St(e),[t,n]=u.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(so,{...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]=u.useState(e),[a,c]=u.useState(o?{value:o,label:o}:e[0]),[d,s]=u.useState([]),[g,h]=u.useState(0),[f,m]=u.useState(t??""),[p,b]=u.useState(!1);return{filteredItems:n,setFilteredItems:l,selectedItem:a,setSelectedItem:c,selectedItems:d,setSelectedItems:s,highlightedIndex:g,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:d,filteredItems:s,setSelectedItem:g,selectedItem:h,selectedItems:f,setSelectedItems:m,highlightedIndex:p,setHighlightedIndex:b,searchQuery:x,setSearchQuery:y,setFilteredItems:k,views:w,isDropdownVisible:I,setIsDropdownVisible:C,isMulti:T=!1,...j})=>{const{ref:z,relation:V}=i.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),P=u.useRef(null),[B,S]=u.useState(!1),[H,A]=u.useState(!1),E=()=>{var N;const D=H?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((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}};u.useEffect(()=>{if(I){const D=setTimeout(()=>A(!0),10);return()=>clearTimeout(D)}A(!1)},[I]),u.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 W=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(T){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 g(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=>T?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(!I),style:{width:"100%"},children:r.jsxs(Se,{isHovered:B,isFocused:I,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:T?"wrap":"nowrap",...w==null?void 0:w.labelContainer,children:[a,T?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=>_(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:I?sn.open:sn.closed,children:r.jsx(le,{widthHeight:16,orientation:"down",color:I?"color-gray-700":"color-gray-400"})})]})]})}),I&&r.jsx(zr,{children:r.jsxs(i.View,{ref:P,id:"combobox-dropdown",role:"listbox","aria-labelledby":j.id,...Ld,style:E(),...w==null?void 0:w.dropdown,children:[l&&r.jsx(i.View,{...Ad,children:r.jsx(so,{id:`${j.id}-search`,name:`${j.name}-search`,width:"100%",type:"search",autoFocus:!0,value:x,onChange:D=>W(D),hint:e||"Search...",isClearable:!1,left:r.jsx(Mo,{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",...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:()=>$(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(zo,{widthHeight:16,color:"theme-primary"})]},D.value)})}),s.length===0&&r.jsxs(i.Vertical,{...Fd,children:[r.jsx(Mo,{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:d=1,maxTagLength:s=50,allowDuplicates:g=!1,separators:h=["enter","comma"],isDisabled:f=!1,isReadOnly:m=!1}=e,[p,b]=u.useState(""),[x,y]=u.useState(()=>(o||t||[]).map((E,W)=>({id:`tag-${W}-${Date.now()}`,value:E}))),[k,w]=u.useState(!1),[I,C]=u.useState(!1),T=o&&Array.isArray(o)?o.map((A,E)=>({id:`tag-${E}-${Date.now()}`,value:A})):x;u.useEffect(()=>{o&&Array.isArray(o)&&y(o.map((A,E)=>({id:`tag-${E}-${Date.now()}`,value:A})))},[o]);const j=u.useCallback(A=>{const E=A.trim();return!(E.length<d||E.length>s||!g&&T.map($=>$.value.toLowerCase()).includes(E.toLowerCase())||c&&T.length>=c)},[T,d,s,g,c]),z=u.useCallback(A=>{if(f||m)return;const E=A.trim();if(!E||!j(E))return;const W={id:`tag-${Date.now()}-${Math.random()}`,value:E},$=[...T,W],_=$.map(L=>L.value);o||y($),n==null||n(_),l==null||l(E),b("")},[T,j,n,l,f,m,o]),V=u.useCallback(A=>{if(f||m)return;const E=T[A];if(!E)return;const W=T.filter((_,L)=>L!==A),$=W.map(_=>_.value);o||y(W),n==null||n($),a==null||a(E.value,A)},[T,n,a,f,m,o]),P=u.useCallback(A=>{if(f||m)return;const E=A.target.value;if(h.includes("comma")&&E.includes(",")){const W=E.split(","),$=W[0],_=W.slice(1).join(",");$.trim()&&z($),b(_);return}b(E)},[z,h,f,m]),B=u.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&&T.length>0){A.preventDefault(),V(T.length-1);return}},[z,V,p,T,h,f,m]),S=u.useCallback(()=>{var A;w(!0),(A=e.onFocus)==null||A.call(e)},[e.onFocus]),H=u.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:T,setTags:y,isFocused:k,setIsFocused:w,isHovered:I,setIsHovered:C,addTag:z,removeTag:V,handleInputChange:P,handleKeyDown:B,handleFocus:S,handleBlur:H,validateTag:j}},Nd=({tag:e,onRemove:o,isRemovable:t,size:n,views:l,isDisabled:a,isReadOnly:c})=>{const[d,s]=u.useState(!1),g={xs:{padding:"2px 8px",fontSize:"10px",iconSize:10},sm:{padding:"4px 10px",fontSize:"12px",iconSize:12},md:{padding:"6px 14px",fontSize:"14px",iconSize:14},lg:{padding:"8px 16px",fontSize:"16px",iconSize:16},xl:{padding:"10px 18px",fontSize:"18px",iconSize:18}}[n]||{padding:"6px 14px",fontSize:"14px",iconSize:14};return r.jsxs(i.Horizontal,{alignItems:"center",gap:6,padding:g.padding,backgroundColor:"color-gray-100-100",borderRadius:"16px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-100",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",opacity:a?.6:1,_hover:!a&&!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:g.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:g.iconSize,color:d?"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:d=[],left:s,right:g,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:I=!1,isHovered:C=!1,maxTags:T,handleInputChange:j,handleKeyDown:z,handleFocus:V,handleBlur:P,removeTag:B,setIsHovered:S,onClick:H,...A})=>{const{getColor:E,themeMode:W}=i.useTheme(),$=!!(t&&(I||d.length>0||c)),_=T&&d.length>=T,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(Ie,{error:!!a,helperText:typeof a=="string"?a:l,views:f,...A,children:r.jsxs(Se,{label:t,shadow:h,value:d.length>0||c?"has-content":"",size:m,shape:p,variant:b,error:!!a,showLabel:$,isFocused:I,isHovered:C,isDisabled:x,isReadOnly:y,views:f,onClick:H,onMouseEnter:()=>S==null?void 0:S(!0),onMouseLeave:()=>S==null?void 0:S(!1),...L,children:[s,r.jsxs(Ne,{children:[t&&r.jsx(We,{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(Nd,{tag:F.value,onRemove:()=>B==null?void 0:B(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:P,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 ",T," tags reached"]})]})]}),g]})})},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:d,onBlur:s,onFocus:g,isReadOnly:h,isDisabled:f,pattern:m,stepValues:p,pasteTransformer:b})=>{var K,Q;const x=e!==void 0,y=x?e:o,[k,w]=u.useState((y==null?void 0:y.slice(0,t))||""),[I,C]=u.useState(!1),[T,j]=u.useState(!1),[z,V]=u.useState(null),[P,B]=u.useState(null),S=u.useRef(null),H=u.useRef(null),A=u.useRef({value:k,onChange:n||(()=>{}),isIOS:typeof window<"u"&&((Q=(K=window==null?void 0:window.CSS)==null?void 0:K.supports)==null?void 0:Q.call(K,"-webkit-touch-callout","none"))}),E=u.useRef({prev:[null,null,"none"]}),W=m?typeof m=="string"?new RegExp(m):m:null;u.useEffect(()=>{x&&e!==k&&w((e==null?void 0:e.slice(0,t))||"")},[x,e,t,k]);const $=u.useCallback(Y=>{let Z=Y;if(p&&p.length>0&&Y){const ee=parseInt(Y,10);if(!isNaN(ee)){let ne=p[0],ae=Math.abs(ee-ne);for(let te=1;te<p.length;te++){const ge=Math.abs(ee-p[te]);ge<ae&&(ae=ge,ne=p[te])}Z=ne.toString()}}w(Z),n&&n(Z),l&&l(Z),a&&Z.length===t&&a(Z)},[n,l,a,t,p]),_=u.useCallback(Y=>{Y&&S.current!==Y&&Object.defineProperty(S,"current",{value:Y,writable:!0})},[]),L=u.useCallback(Y=>{const Z=Y.currentTarget.value.slice(0,t);if(Z.length>0&&W&&!W.test(Z)){Y.preventDefault();return}$(Z),S.current&&(S.current.value=Z)},[t,W,$,S]),D=u.useCallback(()=>{var Y;if(S.current){const Z=Math.min(S.current.value.length,t-1),ee=S.current.value.length;(Y=S.current)==null||Y.setSelectionRange(Z,ee),V(Z),B(ee)}C(!0)},[t]),F=u.useCallback(()=>{C(!1)},[]),q=u.useCallback(Y=>{c&&c(Y)},[]),O=u.useCallback(Y=>{d&&d(Y)},[]),N=u.useCallback(Y=>{const Z=S.current;if(!Y.clipboardData||!Z)return;const ee=Y.clipboardData.getData("text/plain"),ne=b?b(ee):ee;Y.preventDefault();const ae=Z.selectionStart||0,te=Z.selectionEnd||0,G=(ae!==te?k.slice(0,ae)+ne+k.slice(te):k.slice(0,ae)+ne+k.slice(ae)).slice(0,t);if(G.length>0&&W&&!W.test(G))return;Z.value=G,$(G),w(G);const v=Math.min(G.length,t-1),R=G.length;Z.setSelectionRange(v,R),V(v),B(R)},[t,b,W,$,k,w]);return u.useEffect(()=>{const Y=S.current,Z=H.current;if(!Y||!Z)return;A.current.value!==Y.value&&A.current.onChange&&A.current.onChange(Y.value),E.current.prev=[Y.selectionStart,Y.selectionEnd,Y.selectionDirection];function ee(){if(document.activeElement!==Y){V(null),B(null);return}const te=(Y==null?void 0:Y.selectionStart)??null,ge=(Y==null?void 0:Y.selectionEnd)??null,ye=(Y==null?void 0:Y.selectionDirection)??null,G=(Y==null?void 0:Y.maxLength)??0,v=(Y==null?void 0:Y.value)??"",R=E.current.prev;let X=-1,J=-1,ie="none";if(v.length!==0&&te!==null&&ge!==null){const me=te===ge,ot=te===v.length&&v.length<G;if(me&&!ot){const De=te;if(De===0)X=0,J=1,ie="forward";else if(De===G)X=De-1,J=De,ie="backward";else if(G>1&&v.length>1){let Xt=0;if(R[0]!==null&&R[1]!==null){ie=De<R[1]?"backward":"forward";const a0=R[0]===R[1]&&R[0]<G;ie==="backward"&&!a0&&(Xt=-1)}X=Xt+De,J=Xt+De+1}}X!==-1&&J!==-1&&X!==J&&S.current&&S.current.setSelectionRange(X,J,ie)}const ue=X!==-1?X:te,fe=J!==-1?J:ge,re=ie!=="none"?ie:ye;V(ue),B(fe),E.current.prev=[ue,fe,re]}document.addEventListener("selectionchange",ee,{capture:!0}),ee(),document.activeElement===Y&&C(!0);const ne=()=>{Z&&Z.style.setProperty("--root-height",`${Y.clientHeight}px`)};ne();const ae=new window.ResizeObserver(ne);return ae.observe(Y),()=>{document.removeEventListener("selectionchange",ee,{capture:!0}),ae.disconnect()}},[]),u.useEffect(()=>{Gd(()=>{var ne,ae,te,ge;(ne=S.current)==null||ne.dispatchEvent(new Event("input"));const Y=(ae=S.current)==null?void 0:ae.selectionStart,Z=(te=S.current)==null?void 0:te.selectionEnd,ee=(ge=S.current)==null?void 0:ge.selectionDirection;Y!==null&&Z!==null&&Y!==void 0&&Z!==void 0&&(V(Y),B(Z),E.current.prev=[Y,Z,ee||"none"])})},[k,I]),{value:k,setValue:$,isFocused:I,setIsFocused:C,isHovered:T,setIsHovered:j,inputRef:S,containerRef:H,mirrorSelectionStart:z,mirrorSelectionEnd:P,setMirrorSelectionStart:V,setMirrorSelectionEnd:B,setInputRef:_,handleChange:L,handleFocus:D,handleBlur:F,handleKeyDown:q,handleKeyPress:O,handlePaste:N}},Yd=u.createContext({slots:[],isFocused:!1,isHovering:!1}),vd=`
|
|
34
7
|
@keyframes blink {
|
|
35
8
|
0%, 100% { opacity: 1; }
|
|
36
9
|
50% { opacity: 0; }
|
|
@@ -49,17 +22,17 @@
|
|
|
49
22
|
border-radius: 4px !important;
|
|
50
23
|
width: 100% !important;
|
|
51
24
|
}
|
|
52
|
-
`;function Ze(e,o){try{e.insertRule(o)}catch{console.error("input-otp could not insert CSS rule:",o)}}const ra=({id:e,name:o,label:t,value:r="",length:a=6,onChange:l,onChangeText:c,onComplete:d,helperText:i,placeholder:u="",shadow:g,views:f={},size:m="md",shape:b="rounded",variant:p="outline",gap:y=8,type:x="text",error:k=!1,isFocused:w=!1,isHovered:I=!1,isDisabled:C=!1,isReadOnly:T=!1,isAutoFocus:j=!1,setValue:M,setIsFocused:E,setIsHovered:P,inputRef:L,containerRef:S,mirrorSelectionStart:D,mirrorSelectionEnd:H,setMirrorSelectionStart:V,setMirrorSelectionEnd:W,handlePaste:$,handleChange:_,handleFocus:B,handleBlur:A,handleKeyDown:F,handleKeyPress:v,secureTextEntry:O,isFirstColumn:N,stepValues:K,setInputRef:Q,onBlur:G=()=>{},onClick:J=()=>{},onFocus:oe=()=>{},...ae})=>{s.useTheme();const le=!!t,re=h.useMemo(()=>({slots:Array.from({length:a}).map((q,Y)=>{const ee=w&&D!==null&&H!==null&&(D===H&&Y===D||Y>=D&&Y<H),X=r[Y]!==void 0?r[Y]:null,R=r[0]!==void 0?null:(u==null?void 0:u[Y])??null;return{char:X,placeholderChar:R,isActive:ee,hasFakeCaret:ee&&X===null}}),isFocused:w,isHovering:!C&&I}),[w,I,C,a,H,D,u,r]);h.useEffect(()=>{j&&L.current&&L.current.focus()},[j,L]),h.useEffect(()=>{if(!document.getElementById("input-otp-style")){const q=document.createElement("style");if(q.id="input-otp-style",document.head.appendChild(q),q.sheet){const Y="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;";Ze(q.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),Ze(q.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Ze(q.sheet,`[data-input-otp]:autofill { ${Y} }`),Ze(q.sheet,`[data-input-otp]:-webkit-autofill { ${Y} }`),Ze(q.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; } }"),Ze(q.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const he=()=>n.jsx(s.Horizontal,{gap:y,width:"100%",justifyContent:"center",minHeight:m==="xs"?"32px":m==="sm"?"36px":m==="md"?"40px":m==="lg"?"48px":"56px",...f.container,children:re.slots.map((q,Y)=>n.jsxs(Ee,{size:m,error:k,shape:b,views:f,variant:p,value:q.char||"",color:"theme-primary",isHovered:I,isDisabled:C,isReadOnly:T,isFocused:q.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:[q.char?n.jsx(s.View,{textAlign:"center",fontSize:m==="xs"?"14px":m==="sm"?"16px":m==="md"?"18px":m==="lg"?"20px":"24px",fontWeight:"medium",...f.text,children:x==="password"?"•":q.char}):q.placeholderChar?n.jsx(s.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:q.placeholderChar}):null,q.hasFakeCaret&&n.jsx(s.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}-${Y}`))}),ke={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 n.jsxs(n.Fragment,{children:[n.jsx("noscript",{children:n.jsx("style",{children:Tg})}),n.jsxs(Se,{helperText:i,error:k,views:f,...ae,children:[le&&n.jsx(Le,{htmlFor:e,color:"theme-primary",error:k,...f.label,children:t}),n.jsxs(s.View,{ref:S,"data-input-otp-container":!0,position:"relative",cursor:C?"default":"text",userSelect:"none",pointerEvents:"none",children:[n.jsx(Ig.Provider,{value:re,children:he()}),n.jsx(s.View,{position:"absolute",inset:0,pointerEvents:"none",children:n.jsx(s.Input,{ref:q=>Q(q),"data-input-otp":!0,"data-input-otp-placeholder-shown":r.length===0||void 0,"data-input-otp-mss":D,"data-input-otp-mse":H,id:e||o,name:o,type:x==="password"?"password":"text",inputMode:x!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:a,readOnly:T,disabled:C,placeholder:u,value:r,onChange:_,onKeyDown:F,onPaste:$,onFocus:B,onBlur:A,onClick:J,onMouseOver:()=>P(!0),onMouseLeave:()=>P(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${a} digits`,style:ke,...f.input})})]})]})]})},jg=e=>{const{value:o}=e,{value:t,setValue:r,isFocused:a,setIsFocused:l,isHovered:c,setIsHovered:d,inputRef:i,containerRef:u,mirrorSelectionStart:g,mirrorSelectionEnd:f,setMirrorSelectionStart:m,setMirrorSelectionEnd:b,setInputRef:p,handleChange:y,handleFocus:x,handleBlur:k,handleKeyDown:w,handlePaste:I,handleKeyPress:C}=ta(e),T=o!==void 0?o:t;return n.jsx(ra,{...e,value:T,setValue:r,isFocused:a,setIsFocused:l,isHovered:c,setIsHovered:d,inputRef:i,containerRef:u,mirrorSelectionStart:g,mirrorSelectionEnd:f,setMirrorSelectionStart:m,setMirrorSelectionEnd:b,setInputRef:p,handleChange:y,handleFocus:x,handleBlur:k,handleKeyDown:w,handleKeyPress:C,handlePaste:I,stepValues:e.stepValues})},na=h.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Sg=()=>h.useContext(na),Mg=({children:e,autoFocus:o=!1,initFocus:t,onChange:r=()=>{},...a})=>{const l=Ce.useFormikContext();h.useEffect(()=>{r(l.values)},[l.values]);const c=h.useRef({}),d=h.useRef([]),i=(f,m)=>{c.current[f]=m,d.current.includes(f)||d.current.push(f)},u=f=>{var m;if(o){const p=d.current.indexOf(f)+1;p<d.current.length?(m=c.current[d.current[p]])==null||m.focus():l.onSubmit&&l.onSubmit(l.values)}},g={active:o,focusNextInput:u,setInputRef:i,handleSubmitEditing:u,getReturnKeyType:f=>d.current.indexOf(f)===d.current.length-1?"done":"next"};return h.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]),n.jsx(na.Provider,{value:g,children:n.jsx(s.Form,{...a,children:e})})},zg=e=>{switch(e){case"email":return{autoCorrect:"off",inputMode:"email",autoCapitalize:"none"};case"password":return{autoCorrect:"off",secureTextEntry:!0,autoCapitalize:"none"};case"digits":return{inputMode:"tel"};case"numeric":return{inputMode:"numeric"};case"name":return{autoCorrect:"off"};default:return{}}},ue=({name:e,type:o,...t})=>{const r=Sg(),{touched:a,errors:l,submitCount:c,values:d,setFieldTouched:i,setFieldValue:u}=Ce.useFormikContext(),g=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=()=>{i(e,!0)},b=k=>{k.key==="Enter"&&(k.preventDefault(),r.focusNextInput(e))},p=["text","password","email","digits"].includes(o),y=Ce.getIn(a,e)||c>0?Ce.getIn(l,e):void 0,x=Ce.getIn(d,e);return{...zg(o),...t,value:x,error:y,onBlur:m,onKeyPress:b,...p?{onChangeText:g}:{onChange:f},...r.active?{handleKeyPress:b}:{}}},Eg=e=>{let{value:o,...t}=ue(e);t.isChecked=o;const r=Wn(e);return n.jsx($n,{...r,...t})},Vg=({defaultIsSelected:e=!1,isChecked:o})=>{const[t,r]=h.useState(!1),[a,l]=h.useState(o!==void 0?o:e);return h.useEffect(()=>{o!==void 0&&l(o)},[o]),{isHovered:t,setIsHovered:r,isSelected:a,setIsSelected:l}},Pg={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"}},Wg={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"}},_g={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{backgroundColor:"transparent",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300"}},$g={selected:{backgroundColor:"theme-primary"},unselected:{backgroundColor:"transparent"}},tr={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"}}},rr={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"}}},Lg=({id:e,icon:o,name:t,label:r,value:a,isChecked:l,onChange:c,onValueChange:d,shadow:i={},labelPosition:u="right",size:g="md",error:f=!1,isSelected:m=!1,isHovered:b=!1,isDisabled:p=!1,isReadOnly:y=!1,defaultIsSelected:x=!1,setIsSelected:k=()=>{},setIsHovered:w=()=>{},views:I={radio:{},label:{}},infoText:C,helperText:T,...j})=>{const M=()=>w(!b),E=()=>{!y&&!p&&(k&&k(!0),c&&c(a),d&&d(a))},P=l||m?"selected":"unselected",L=f?tr.error[P]:p?tr.disabled[P]:b?tr.hover[P]:{},S=f?rr.error[P]:p?rr.disabled[P]:b?rr.hover[P]:{},D={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:f?"color-red-600":p?"color-gray-400":"color-gray-700",cursor:p?"not-allowed":y?"default":"pointer",opacity:p?.6:1,transition:"all 0.2s ease",...I.label},radio:{..._g[P],...L,borderRadius:"50%",backgroundColor:"color-white",...Pg[g],transition:"all 0.2s ease",...i,...I.radio},dot:{...$g[P],...S,borderRadius:"50%",...Wg[g],transition:"all 0.2s ease"}};return n.jsxs(yo,{htmlFor:e,as:"div",onClick:E,onMouseEnter:M,onMouseLeave:M,size:s.Typography.fontSizes[g],...D.container,...j,children:[n.jsxs(s.Vertical,{gap:8,children:[" ",n.jsxs(s.Horizontal,{gap:12,alignItems:"center",children:[" ",u==="left"&&r&&n.jsx(s.Text,{size:g,fontWeight:"500",...I==null?void 0:I.label,children:r}),n.jsx(s.Center,{...D.radio,children:(l||m)&&n.jsx(s.View,{...D.dot})}),u==="right"&&r&&n.jsx(s.Text,{size:g,fontWeight:"500",...I==null?void 0:I.label,children:r})]}),C&&n.jsx(s.Text,{marginLeft:u==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15px",...I==null?void 0:I.infoText,children:C})]}),f&&n.jsx(s.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:f})]})},Dg=e=>{let{value:o,...t}=ue(e);t.isChecked=o===e.value;const r=Vg(e);return n.jsx(Lg,{...r,...t})},aa=e=>{const{value:o,onChange:t,onSubmit:r,autoFocus:a=!0,loading:l=!1,disabled:c=!1,isAgentRunning:d=!1,onStopAgent:i,sandboxId:u,onUploadProgress:g,onUploadSuccess:f,onUploadError:m,onFileUpload:b}=e,p=o!==void 0&&t!==void 0,[y,x]=h.useState(""),k=p?o:y,[w,I]=h.useState([]),[C,T]=h.useState([]),[j,M]=h.useState(!1),[E,P]=h.useState(0),[L,S]=h.useState([]),[D,H]=h.useState(!1),V=h.useRef(null),[W,$]=h.useState(!1),[_,B]=h.useState("gpt-4"),[A]=h.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=h.useRef(null),v=h.useRef(null),[O,N]=h.useState(e.showGuideTip||!1);h.useEffect(()=>{a&&F.current&&F.current.focus()},[a]),h.useEffect(()=>()=>{w.forEach(X=>{})},[w]);const K=X=>{p&&t?t(X):x(X)},Q=X=>{if(X.preventDefault(),!k.trim()&&w.length===0||l||c&&!d)return;if(d&&i){i();return}let R=k;if(w.length>0){const pe=w.map(ne=>`[Uploaded File: ${URL.createObjectURL(ne)}}]`).join(`
|
|
53
|
-
`);
|
|
25
|
+
`;function Ge(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:d,helperText:s,placeholder:g="",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:I=!1,isDisabled:C=!1,isReadOnly:T=!1,isAutoFocus:j=!1,setValue:z,setIsFocused:V,setIsHovered:P,inputRef:B,containerRef:S,mirrorSelectionStart:H,mirrorSelectionEnd:A,setMirrorSelectionStart:E,setMirrorSelectionEnd:W,handlePaste:$,handleChange:_,handleFocus:L,handleBlur:D,handleKeyDown:F,handleKeyPress:q,secureTextEntry:O,isFirstColumn:N,stepValues:K,setInputRef:Q,onBlur:Y=()=>{},onClick:Z=()=>{},onFocus:ee=()=>{},...ne})=>{i.useTheme();const ae=!!t,te=u.useMemo(()=>({slots:Array.from({length:l}).map((G,v)=>{const R=w&&H!==null&&A!==null&&(H===A&&v===H||v>=H&&v<A),X=n[v]!==void 0?n[v]:null,J=n[0]!==void 0?null:(g==null?void 0:g[v])??null;return{char:X,placeholderChar:J,isActive:R,hasFakeCaret:R&&X===null}}),isFocused:w,isHovering:!C&&I}),[w,I,C,l,A,H,g,n]);u.useEffect(()=>{j&&B.current&&B.current.focus()},[j,B]),u.useEffect(()=>{if(!document.getElementById("input-otp-style")){const G=document.createElement("style");if(G.id="input-otp-style",document.head.appendChild(G),G.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;";Ge(G.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),Ge(G.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Ge(G.sheet,`[data-input-otp]:autofill { ${v} }`),Ge(G.sheet,`[data-input-otp]:-webkit-autofill { ${v} }`),Ge(G.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; } }"),Ge(G.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:te.slots.map((G,v)=>r.jsxs(Se,{size:m,error:k,shape:p,views:f,variant:b,value:G.char||"",color:"theme-primary",isHovered:I,isDisabled:C,isReadOnly:T,isFocused:G.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:[G.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"?"•":G.char}):G.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:G.placeholderChar}):null,G.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}`))}),ye={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(Ie,{helperText:s,error:k,views:f,...ne,children:[ae&&r.jsx(We,{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:te,children:ge()}),r.jsx(i.View,{position:"absolute",inset:0,pointerEvents:"none",children:r.jsx(i.Input,{ref:G=>Q(G),"data-input-otp":!0,"data-input-otp-placeholder-shown":n.length===0||void 0,"data-input-otp-mss":H,"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:T,disabled:C,placeholder:g,value:n,onChange:_,onKeyDown:F,onPaste:$,onFocus:L,onBlur:D,onClick:Z,onMouseOver:()=>P(!0),onMouseLeave:()=>P(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${l} digits`,style:ye,...f.input})})]})]})]})},Xd=e=>{const{value:o}=e,{value:t,setValue:n,isFocused:l,setIsFocused:a,isHovered:c,setIsHovered:d,inputRef:s,containerRef:g,mirrorSelectionStart:h,mirrorSelectionEnd:f,setMirrorSelectionStart:m,setMirrorSelectionEnd:p,setInputRef:b,handleChange:x,handleFocus:y,handleBlur:k,handleKeyDown:w,handlePaste:I,handleKeyPress:C}=hn(e),T=o!==void 0?o:t;return r.jsx(fn,{...e,value:T,setValue:n,isFocused:l,setIsFocused:a,isHovered:c,setIsHovered:d,inputRef:s,containerRef:g,mirrorSelectionStart:h,mirrorSelectionEnd:f,setMirrorSelectionStart:m,setMirrorSelectionEnd:p,setInputRef:b,handleChange:x,handleFocus:y,handleBlur:k,handleKeyDown:w,handleKeyPress:C,handlePaste:I,stepValues:e.stepValues})},mn=u.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Kd=()=>u.useContext(mn),Qd=({children:e,autoFocus:o=!1,initFocus:t,onChange:n=()=>{},...l})=>{const a=xe.useFormikContext();u.useEffect(()=>{n(a.values)},[a.values]);const c=u.useRef({}),d=u.useRef([]),s=(f,m)=>{c.current[f]=m,d.current.includes(f)||d.current.push(f)},g=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:g,setInputRef:s,handleSubmitEditing:g,getReturnKeyType:f=>d.current.indexOf(f)===d.current.length-1?"done":"next"};return u.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(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:d,setFieldTouched:s,setFieldValue:g}=xe.useFormikContext(),h=k=>{var w;g(e,k),(w=t.onChangeText)==null||w.call(t,k)},f=k=>{var w;g(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=xe.getIn(l,e)||c>0?xe.getIn(a,e):void 0,y=xe.getIn(d,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]=u.useState(!1),[l,a]=u.useState(o!==void 0?o:e);return u.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:d,shadow:s={},labelPosition:g="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:I={radio:{},label:{}},infoText:C,helperText:T,...j})=>{const z=()=>w(!p),V=()=>{!x&&!b&&(k&&k(!0),c&&c(l),d&&d(l))},P=a||m?"selected":"unselected",B=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]:{},H={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",...I.label},radio:{...tg[P],...B,borderRadius:"50%",backgroundColor:"color-white",...eg[h],transition:"all 0.2s ease",...s,...I.radio},dot:{...rg[P],...S,borderRadius:"50%",...og[h],transition:"all 0.2s ease"}};return r.jsxs(io,{htmlFor:e,as:"div",onClick:V,onMouseEnter:z,onMouseLeave:z,size:i.Typography.fontSizes[h],...H.container,...j,children:[r.jsxs(i.Vertical,{gap:8,children:[" ",r.jsxs(i.Horizontal,{gap:12,alignItems:"center",children:[" ",g==="left"&&n&&r.jsx(i.Text,{size:h,fontWeight:"500",...I==null?void 0:I.label,children:n}),r.jsx(i.Center,{...H.radio,children:(a||m)&&r.jsx(i.View,{...H.dot})}),g==="right"&&n&&r.jsx(i.Text,{size:h,fontWeight:"500",...I==null?void 0:I.label,children:n})]}),C&&r.jsx(i.Text,{marginLeft:g==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15px",...I==null?void 0:I.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:d=!1,onStopAgent:s,sandboxId:g,onUploadProgress:h,onUploadSuccess:f,onUploadError:m,onFileUpload:p}=e,b=o!==void 0&&t!==void 0,[x,y]=u.useState(""),k=b?o:x,[w,I]=u.useState([]),[C,T]=u.useState([]),[j,z]=u.useState(!1),[V,P]=u.useState(0),[B,S]=u.useState([]),[H,A]=u.useState(!1),E=u.useRef(null),[W,$]=u.useState(!1),[_,L]=u.useState("gpt-4"),[D]=u.useState([{id:"gpt-3.5-turbo",name:"GPT-3.5"},{id:"gpt-4",name:"GPT-4"},{id:"gpt-4-thinking",name:"GPT-4 (Thinking)",isThinking:!0},{id:"claude-3-5-sonnet",name:"Claude 3.5 Sonnet"}]),F=u.useRef(null),q=u.useRef(null),[O,N]=u.useState(e.showGuideTip||!1);u.useEffect(()=>{l&&F.current&&F.current.focus()},[l]),u.useEffect(()=>()=>{w.forEach(X=>{})},[w]);const K=X=>{b&&t?t(X):y(X)},Q=X=>{if(X.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(re=>`[Uploaded File: ${URL.createObjectURL(re)}}]`).join(`
|
|
26
|
+
`);J=J?`${J}
|
|
54
27
|
|
|
55
|
-
${pe}`:pe}let se=_,fe=!1;_.endsWith("-thinking")&&(se=_.replace(/-thinking$/,""),fe=!0),r(R,{model_name:se,enable_thinking:fe}),p||x(""),I([]),T([])},G=X=>{I(R=>R.filter((se,fe)=>fe!==X)),!u&&C.length>X&&T(R=>R.filter((se,fe)=>fe!==X))},J=X=>{X.preventDefault(),X.stopPropagation(),$(!0)},oe=X=>{X.preventDefault(),X.stopPropagation(),$(!1)},ae=h.useCallback(X=>{!X||X.length===0||(T(R=>[...R,...X]),I(R=>[...R,...X]),S(R=>[...R,...X]),M(!0))},[T,I]),le=h.useCallback(()=>{if(L.length>0&&!D&&b){H(!0);const X=L[0];V.current=X,P(0);try{b(X)}catch(R){S(se=>se.slice(1)),H(!1),V.current=null,P(0),M(se=>L.length-1>0||!1),m==null||m(R)}}else L.length===0&&j&&(M(!1),P(0))},[L,D,b,j,m]);h.useEffect(()=>{le()},[L,D,le]);const re="active",he=X=>!0,ke=()=>{N(!1),e.onGuideClose&&e.onGuideClose()},q=X=>{p&&t?t(X.text):x(X.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(X),F.current&&F.current.focus()},Y=h.useCallback(()=>C,[C]),ee=h.useCallback(()=>T([]),[]);return{onSubmit:r,getPendingFiles:Y,clearPendingFiles:ee,value:k,handleChange:K,handleSubmit:Q,editableRef:F,fileInputRef:v,isUploading:j,uploadProgress:E,isDraggingOver:W,uploadedFiles:w,pendingFiles:C,removeUploadedFile:G,setPendingFiles:T,setUploadedFiles:I,setIsUploading:M,startUpload:ae,selectedModel:_,handleModelChange:B,modelOptions:A,subscriptionStatus:re,canAccessModel:he,handleDragOver:J,handleDragLeave:oe,isGuideTipShown:O,hideGuideTip:ke,handlePromptExampleSelect:q}},Bg={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}},la={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"}}}},Hg={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},Ag={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"}},Fg={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"}},ca=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,Og=({openDelay:e=200,closeDelay:o=300}={})=>{const[t,r]=h.useState(!1),a=h.useRef(null),l=h.useRef(null),c=h.useRef(null),d=h.useRef(null),i=h.useMemo(()=>ca("hovercard-content"),[]),u=h.useMemo(()=>ca("hovercard-trigger"),[]),g=h.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),l.current&&(clearTimeout(l.current),l.current=null)},[]),f=h.useCallback(()=>{g(),t||(a.current=setTimeout(()=>{r(!0)},e))},[t,e,g]),m=h.useCallback(()=>{g(),t&&(l.current=setTimeout(()=>{r(!1)},o))},[t,o,g]),b=h.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null)},[]);return h.useEffect(()=>()=>g(),[g]),{isOpen:t,openCard:f,closeCard:m,cancelCloseTimer:b,triggerRef:c,contentRef:d,contentId:i,triggerId:u}},ia=h.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),vg=({children:e,value:o})=>n.jsx(ia.Provider,{value:o,children:e}),sa=()=>{const e=h.useContext(ia);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},Ng=({children:e,views:o,asChild:t=!1,...r})=>{const{openCard:a,closeCard:l,triggerRef:c,contentId:d,triggerId:i}=sa(),b={ref:c,onMouseEnter:()=>a(),onMouseLeave:()=>l(),onFocus:()=>a(),onBlur:()=>l(),id:i,"aria-describedby":d,...o==null?void 0:o.container,...r};if(t&&h.isValidElement(e)){const p=h.Children.only(e);return h.cloneElement(p,{...b,...p.props})}return n.jsx(s.View,{position:"relative",display:"inline-block",...b,children:e})},Ug=({children:e,views:o,side:t="bottom",align:r="center",sideOffset:a=8,style:l,backgroundColor:c="white",borderRadius:d="4px",boxShadow:i="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:u="12px",minWidth:g="50px",maxWidth:f="300px",...m})=>{const{isOpen:b,cancelCloseTimer:p,closeCard:y,contentRef:x,triggerRef:k,contentId:w,triggerId:I}=sa(),{ref:C,relation:T}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});h.useEffect(()=>{k!=null&&k.current&&(C==null?void 0:C.current)!==k.current&&C&&(C.current=k.current)},[k,C,b]);const j=()=>p(),M=()=>y();if(!b)return null;const E=()=>{if(!T||!(k!=null&&k.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const S=k.current.getBoundingClientRect();let D=t;t==="bottom"&&T.space.vertical==="top"?D="top":t==="top"&&T.space.vertical==="bottom"?D="bottom":t==="right"&&T.space.horizontal==="left"?D="left":t==="left"&&T.space.horizontal==="right"&&(D="right");let H=0,V=0;switch(D){case"bottom":H=S.left+S.width/2,V=S.bottom+a;break;case"top":H=S.left+S.width/2,V=S.top-a;break;case"right":H=S.right+a,V=S.top+S.height/2;break;case"left":H=S.left-a,V=S.top+S.height/2;break}return{position:"fixed",left:H,top:V,zIndex:1e3,transform:P(D)}},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)"}},L=E();return n.jsx(s.View,{ref:x,id:w,role:"tooltip","aria-labelledby":I,onMouseEnter:j,onMouseLeave:M,backgroundColor:c,borderRadius:d,boxShadow:i,padding:u,minWidth:g,maxWidth:f,style:{...L,...l},...o==null?void 0:o.container,...m,children:e})},xe=({children:e,views:o,openDelay:t,closeDelay:r,...a})=>{const l=Og({openDelay:t,closeDelay:r});return n.jsx(vg,{value:l,children:n.jsx(s.View,{position:"relative",display:"inline-block",...o==null?void 0:o.container,...a,children:e})})};xe.Trigger=Ng,xe.Content=Ug;const qg=({files:e,sandboxId:o,onRemove:t,layout:r="inline",maxHeight:a="120px",showPreviews:l=!1,views:c={}})=>{if(e.length===0)return null;const d=h.useCallback(i=>i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`,[]);return n.jsx(s.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:a,overflowY:"auto",...c==null?void 0:c.container,children:e.map((i,u)=>{const g=URL.createObjectURL(i)||(i==null?void 0:i.path)||(i==null?void 0:i.url)||"",f=i.type.startsWith("image/"),m=i.type.startsWith("video/"),b=i.type.startsWith("audio/");return n.jsx(s.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:l&&n.jsxs(xe,{children:[n.jsxs(xe.Trigger,{children:[f&&n.jsx(s.Image,{src:g,alt:i.name,width:"60px",height:"60px",objectFit:"cover"}),m&&n.jsx(s.View,{as:"video",src:g,alt:i.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),b&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(_o,{widthHeight:24,color:"color-black"})}),!f&&!m&&!b&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(io,{widthHeight:24,color:"color-black"})}),t&&n.jsx(s.Button,{...Bg.attachmentRemove,onClick:p=>{p.stopPropagation(),t(u)},"aria-label":`Remove ${i.name}`,children:"×"})]}),n.jsxs(xe.Content,{children:[f&&n.jsx(s.Image,{src:g,alt:i.name,maxWidth:"100%"}),m&&n.jsx(s.View,{as:"video",src:g,controls:!0,maxWidth:"100%"}),b&&n.jsx(s.View,{as:"audio",src:g,controls:!0,width:"100%"}),n.jsxs(s.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...c==null?void 0:c.name,children:[i.name," (",d(i.size),")"]})]})]})},u)})})},da=h.forwardRef(({value:e,onChange:o,placeholder:t="Type your message...",disabled:r=!1,autoFocus:a=!0,suggestions:l=[],onSuggestionSelect:c,showSuggestions:d=!1,mentionData:i=[],mentionTrigger:u="@",onMentionSelect:g,maxHeight:f="200px",minHeight:m="40px",views:b={}},p)=>{var he,ke;const y=h.useRef(e),[x,k]=h.useState(-1),[w,I]=h.useState(!e),C=h.useRef(null),[T,j]=h.useState(!1),[M,E]=h.useState(!1),[P,L]=h.useState(""),[S,D]=h.useState(-1),[H,V]=h.useState(-1),[W,$]=h.useState([]),{ref:_,relation:B}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[A,F]=h.useState({x:0,y:0}),[v,O]=h.useState({x:0,y:0});h.useEffect(()=>{const q=p;q.current&&e!==y.current&&(q.current.textContent=e,y.current=e,I(!e))},[e,p]),h.useEffect(()=>{a&&p&&typeof p=="object"&&p.current&&p.current.focus()},[a,p]);const N=()=>{const q=window.getSelection();if(!q||q.rangeCount===0)return-1;const Y=q.getRangeAt(0),ee=Y.cloneRange();return ee.selectNodeContents(p&&typeof p=="object"&&p.current?p.current:document.body),ee.setEnd(Y.endContainer,Y.endOffset),ee.toString().length},K=h.useCallback((q,Y)=>{const ee=q.substring(0,Y),X=ee.lastIndexOf(u);if(X!==-1){const R=ee.substring(X+1);if(!R.includes(" ")){const fe=R.toLowerCase(),pe=i.filter(be=>be.name.toLowerCase().includes(fe));L(fe),D(X),$(pe),E(pe.length>0),V(0);const ne=Q();F(ne);return}}E(!1),L(""),D(-1),V(-1)},[i,u]);h.useEffect(()=>{C.current&&_&&(_.current=C.current)},[C,_]);const Q=h.useCallback((q=200)=>{if(!C.current)return{x:0,y:0};const Y=C.current.getBoundingClientRect();if(B){const se=B.space.vertical==="top";return{x:Y.left,y:se?Y.top-q-8:Y.bottom+8}}const ee=window.innerHeight,X={top:Y.top,bottom:ee-Y.bottom},R=X.bottom<q+8&&X.top>X.bottom;return{x:Y.left,y:R?Y.top-q-8:Y.bottom+8}},[B]),G=h.useCallback(()=>{j(!0);const q=Q();O(q)},[Q]),J=h.useCallback(()=>{setTimeout(()=>{j(!1),k(-1)},150)},[]),oe=q=>{const Y=q.currentTarget.textContent||"";if(Y!==y.current){o(Y),y.current=Y,I(!Y);const ee=N();K(Y,ee)}},ae=h.useCallback(q=>{if(p&&typeof p=="object"&&p.current){const Y=p.current.textContent||"",ee=Y.substring(0,S),X=Y.substring(S+u.length+P.length),R=ee+u+q.name+" "+X;o(R),y.current=R,p.current.textContent=R;const se=ee.length+u.length+q.name.length+1;setTimeout(()=>{var fe;if(p.current){const pe=document.createRange(),ne=window.getSelection(),be=p.current.firstChild;be&&ne&&(pe.setStart(be,Math.min(se,((fe=be.textContent)==null?void 0:fe.length)||0)),pe.collapse(!0),ne.removeAllRanges(),ne.addRange(pe))}},0)}E(!1),L(""),D(-1),V(-1),g&&g(q)},[S,u,P,o,g,p]),le=h.useCallback(q=>{c&&c(q),k(-1)},[c]),re=q=>{if(M&&W.length>0){if(q.key==="ArrowDown"){q.preventDefault(),V(Y=>Y<W.length-1?Y+1:0);return}if(q.key==="ArrowUp"){q.preventDefault(),V(Y=>Y>0?Y-1:W.length-1);return}if((q.key==="Tab"||q.key==="Enter")&&H>=0){q.preventDefault(),ae(W[H]);return}if(q.key==="Escape"){E(!1),V(-1);return}}if(d&&l.length>0){if(q.key==="ArrowDown"){q.preventDefault(),k(Y=>Y<l.length-1?Y+1:0);return}if(q.key==="ArrowUp"){q.preventDefault(),k(Y=>Y>0?Y-1:l.length-1);return}if(q.key==="Tab"&&x>=0){q.preventDefault(),le(l[x]);return}if(q.key==="Escape"){k(-1);return}}};return n.jsxs(s.View,{ref:C,width:"100%",position:"relative",...b==null?void 0:b.container,children:[n.jsxs(s.View,{width:"100%",minHeight:m,maxHeight:f,overflowY:"auto",position:"relative",children:[w&&n.jsx(s.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...b==null?void 0:b.placeholder,children:t}),n.jsx(s.View,{as:"div",ref:p,contentEditable:!r,suppressContentEditableWarning:!0,onInput:oe,onKeyDown:re,onFocus:G,onBlur:J,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",...b==null?void 0:b.input})]}),M&&W.length>0&&n.jsx(s.View,{position:"fixed",left:A.x,top:A.y,width:((he=C.current)==null?void 0:he.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",...b==null?void 0:b.mentionContainer,children:n.jsxs(s.Vertical,{gap:0,children:[W.map((q,Y)=>n.jsx(s.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:Y===H?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>ae(q),onMouseEnter:()=>V(Y),_hover:{backgroundColor:"color-blue-50"},...b==null?void 0:b.mentionItem,children:n.jsxs(s.Vertical,{gap:4,children:[n.jsxs(s.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[u,q.name]}),q.description&&n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",children:q.description})]})},q.id)),process.env.NODE_ENV==="development"&&n.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",u,")",B&&n.jsxs(n.Fragment,{children:[n.jsx("br",{}),"Space: ",B.space.vertical,"-",B.space.horizontal]})]})]})}),d&&l.length>0&&!M&&T&&!e&&n.jsx(s.View,{position:"fixed",left:v.x,top:v.y,width:((ke=C.current)==null?void 0:ke.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",...b==null?void 0:b.suggestionsContainer,children:n.jsxs(s.Vertical,{gap:0,children:[l.map((q,Y)=>n.jsx(s.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:Y===x?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>le(q),onMouseEnter:()=>k(Y),_hover:{backgroundColor:"color-blue-50"},...b==null?void 0:b.suggestionItem,children:n.jsxs(s.Vertical,{gap:4,children:[n.jsx(s.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:q.text}),q.description&&n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",children:q.description})]})},q.id)),process.env.NODE_ENV==="development"&&n.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",B&&n.jsxs(n.Fragment,{children:[n.jsx("br",{}),"Space: ",B.space.vertical,"-",B.space.horizontal]})]})]})})]})});da.displayName="EditableInput";const Gg=({examples:e,onSelect:o,views:t={}})=>{const{getColor:r}=s.useTheme();return!e||e.length===0?null:n.jsx(s.Horizontal,{gap:8,overflowX:"auto",padding:"8px 0",width:"100%",...t==null?void 0:t.container,children:e.map(a=>n.jsx(s.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(a),_hover:{backgroundColor:"color-gray-200"},...t==null?void 0:t.item,children:n.jsx(s.Text,{fontSize:"14px",color:"color-gray-700",...t==null?void 0:t.text,children:a.text})},a.id))})},Yg=({onRecordingComplete:e,onRecordingStart:o,views:t={}})=>{const{recording:r,paused:a,audioBlob:l,analyserNode:c,startRecording:d,stopRecording:i}=$r();h.useEffect(()=>{if(l){const g=new File([l],`recording-${Date.now()}.webm`,{type:l.type||"audio/webm;codecs=opus"});e(g)}},[l]);const u=h.useCallback(()=>{d(),o==null||o()},[]);return n.jsxs(s.Horizontal,{alignItems:"center",gap:4,children:[n.jsx(s.View,{minWidth:90,children:r&&c&&n.jsx(Et,{analyserNode:c,isPaused:a})}),n.jsx(s.View,{as:"button",type:"button",onClick:r?i:u,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:r?"theme-error":"color-gray-100",color:r?"color-white":"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:r?"color-red-600":"color-gray-200"},...t.button,children:r?n.jsx(Lo,{widthHeight:16,color:"currentColor",filled:!1}):n.jsx(wt,{widthHeight:16,color:"currentColor",filled:!1})})]})},ua=({onSubmit:e,placeholder:o="Say what you want and Kimmy will surprise you",loading:t=!1,disabled:r=!1,isAgentRunning:a=!1,enableAudioRecording:l=!1,leftButtons:c,rightButtons:d,onStopAgent:i,loadingText:u="Agent is working...",autoFocus:g=!0,sandboxId:f,hideAttachments:m=!1,attachmentText:b="",promptExamples:p=[],suggestions:y=[],errorMessage:x,size:k="md",shape:w="rounded",variant:I="default",views:C={},mentionData:T=[],mentionTrigger:j="@",onMentionSelect:M,onAudioRecordingStart:E,onAudioRecordingStop:P,value:L,handleChange:S,handleSubmit:D,editableRef:H,fileInputRef:V,isUploading:W,uploadProgress:$,isDraggingOver:_,uploadedFiles:B,removeUploadedFile:A,setPendingFiles:F,setUploadedFiles:v,setIsUploading:O,startUpload:N,selectedModel:K,handleModelChange:Q,modelOptions:G,subscriptionStatus:J,canAccessModel:oe,isGuideTipShown:ae,hideGuideTip:le,handlePromptExampleSelect:re,handleDragOver:he,handleDragLeave:ke,onChange:q,...Y})=>{s.useTheme();const ee={...la.container,...Hg[w],...C==null?void 0:C.container},X={...la.content,...Ag[k],...Fg[I],...C==null?void 0:C.content},R=((L==null?void 0:L.trim().length)??0)>0||B.length>0,se=h.useCallback(ne=>{N([ne]),P==null||P(ne)},[N,P]),fe=h.useCallback(ne=>{const be=ne.filter(pt=>pt.size>52428800?(console.error(`File size exceeds 50MB limit: ${pt.name}`),!1):!0);be.length>0&&N(be)},[N]),pe=[...T||[],...B.map((ne,be)=>({id:`file-${be}`,name:ne.name}))];return n.jsxs(s.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...ee,...Y,onDragOver:he,onDragLeave:ke,onDrop:ne=>{if(ne.preventDefault(),ne.stopPropagation(),ke(ne),ne.dataTransfer.files.length>0){const be=Array.from(ne.dataTransfer.files);fe(be)}},children:[p.length>0&&n.jsx(Gg,{examples:p,onSelect:re,views:{container:C==null?void 0:C.promptExamples,item:C==null?void 0:C.promptExampleItem}}),a&&n.jsxs(s.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:[n.jsx(Tt,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),n.jsx(s.Text,{color:"color-gray-500",children:u})]}),n.jsx(s.View,{position:"relative",width:"100%",overflow:"visible",children:n.jsxs(s.View,{as:"form",onSubmit:D,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...X,...ee,paddingHorizontal:16,paddingVertical:10,backgroundColor:_?"color-blue-50":void 0,children:[n.jsx(qg,{files:B,sandboxId:f,onRemove:A,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}}),n.jsx(da,{ref:H,value:L||"",onChange:S,placeholder:o,disabled:r&&!a,autoFocus:g,suggestions:y||[],showSuggestions:y&&y.length>0&&!L,onSuggestionSelect:ne=>{S(ne.text)},mentionData:pe,mentionTrigger:j,onMentionSelect:M,views:{container:{},input:C==null?void 0:C.editableInput}}),n.jsxs(s.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[!m&&n.jsx(Fo,{accept:"*/*",icon:n.jsx(so,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:fe,isLoading:W,progress:$||0,text:b,fileType:"file",renderError:({errorMessage:ne})=>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:ne=>ne.size>50*1024*1024?"File size exceeds 50MB limit":null}),c]}),n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[l&&n.jsx(Yg,{onRecordingStart:E,onRecordingComplete:se,views:{button:C==null?void 0:C.recordButton}}),n.jsx(s.View,{as:"button",type:"button",onClick:D,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:a?"theme-error":R?"theme-primary":"color-gray-300",color:"color-white",borderRadius:w==="rounded"?"50%":4,border:"none",cursor:R?"pointer":"not-allowed",disabled:!R||t||r&&!a,transition:"all 0.2s ease",_hover:{backgroundColor:a?"color-red-600":R?"color-blue-600":"color-gray-300"},...C==null?void 0:C.submitButton,children:a?n.jsx(Lo,{widthHeight:16,color:"currentColor",filled:!1}):t?n.jsx(ho,{type:"quarter",size:16,color:"color-white"}):n.jsx(It,{widthHeight:16,color:"currentColor",filled:!1})}),d]})]})]})}),x&&n.jsx(s.Text,{color:"theme-error",marginTop:"4px",...C==null?void 0:C.bottomTip,children:x})]})},Xg=e=>{const{name:o,onSubmit:t,...r}=e,[a,l]=h.useState([]),c=ue({name:o,type:"text"}),d=m=>{c.onChangeText&&c.onChangeText(m)},i=(m,b)=>{t?t(m,b):d(m)},u=()=>a,g=()=>l([]),f=aa({...r,value:c.value||"",onChange:d,onSubmit:i,getPendingFiles:u,clearPendingFiles:g});return n.jsx(ua,{...r,...f,value:c.value||"",onChange:d,onSubmit:i,error:c.error,getPendingFiles:u,clearPendingFiles:g})},Kg=e=>{const o=ue(e),t=Ln(o);return n.jsx(Dn,{...t,...o})},Qg=e=>{const o=ue(e),t=Yn();return n.jsx(Xn,{...t,...o})},Jg=e=>{const o=ue(e),t=Bn(e);return n.jsx(An,{...t,...o})},Zg=e=>{let o=ue(e);o.selected=o.value;const t=bn(e);return n.jsx(Tn,{...t,...o})},Rg=e=>{const o=ue(e),t=jn(e);return n.jsx(Mn,{...t,...o})},eh=e=>{const{name:o,...t}=e,{values:r,errors:a,touched:l,submitCount:c,setFieldValue:d,setFieldTouched:i}=Ce.useFormikContext(),u=Ce.getIn(r,o)||[],g=Ce.getIn(l,o)||c>0?Ce.getIn(a,o):void 0,f=h.useCallback(x=>{var w;const k=Array.isArray(x)?x.filter(I=>typeof I=="string"):[];d(o,k),(w=e.onTagsChange)==null||w.call(e,k)},[o,d,e.onTagsChange]),m=h.useCallback(()=>{var x;i(o,!0),(x=e.onBlur)==null||x.call(e)},[o,i,e.onBlur]),b=ea({...t,tags:u,onTagsChange:f,onBlur:m}),{tags:p,...y}=b;return n.jsx(oa,{...y,...t,tags:p,error:g})},oh=e=>{const o=ue(e),t=Vn(e);return n.jsx(Pn,{...t,...o})},th=e=>{const o=ue(e),{value:t,...r}=Zt(e);return n.jsx(xo,{...r,...o})},rh=({visibleIcon:e=n.jsx(St,{widthHeight:14}),hiddenIcon:o=n.jsx(jt,{widthHeight:14}),...t})=>{const r=ue(t),{isVisible:a,setIsVisible:l,...c}=Kn(r);return n.jsx(xo,{...c,type:a?"text":"password",isClearable:!1,right:n.jsx(s.View,{onClick:()=>{t.isDisabled||l(!a)},children:a?e:o})})},nh=({items:e,placeholder:o,searchPlaceholder:t,isMulti:r=!1,...a})=>{const l=ue(a),c=Qn(e,o,t);h.useEffect(()=>{if(r&&Array.isArray(l.value))c.setSelectedItems(l.value);else if(!r&&l.value){const i=typeof l.value=="object"?l.value:e.find(u=>u.value===l.value);i&&c.setSelectedItem(i)}},[l.value,r,e]);const d=i=>{l.onChange(i)};return n.jsx(Rn,{...c,...l,items:e,placeholder:o,isMulti:r,onSelect:d})},Re=(e,o,t)=>Math.min(Math.max(e,o),t),ah=(e,o,t,r,a,l,c)=>{const d=r-t;let i;if(l==="horizontal"){const u=o.width,g=e-o.left;i=Re(g/u,0,1)}else{const u=o.height,g=o.bottom-e;i=Re(g/u,0,1)}if(c&&c.length>0){const u=t+i*d;let g=c[0],f=Math.abs(u-g);for(let m=1;m<c.length;m++){const b=Math.abs(u-c[m]);b<f&&(f=b,g=c[m])}return g}else{const u=t+i*d,g=Math.round(u/a)*a;return Re(g,t,r)}},ga=({min:e=0,max:o=100,step:t=1,value:r=0,defaultValue:a,onChange:l,onDrag:c,orientation:d="horizontal",isDisabled:i=!1,stepValues:u})=>{const g=Re(r??a??e,e,o),[f,m]=h.useState(g),[b,p]=h.useState(!1),[y,x]=h.useState(!1),k=h.useRef(null),w=h.useRef(null),I=r!==void 0,C=I?r:f;h.useEffect(()=>{I&&m(Re(r,e,o))},[r,I,e,o]);const T=h.useCallback(D=>{const H=Re(D,e,o);I||m(H),l&&H!==C&&l(H),b&&c&&c(H)},[I,e,o,l,C,b,c]),j=h.useCallback(D=>{if(i||!k.current)return;const H=k.current.getBoundingClientRect();let V;"touches"in D?V=d==="horizontal"?D.touches[0].clientX:D.touches[0].clientY:V=d==="horizontal"?D.clientX:D.clientY;const W=ah(V,H,e,o,t,d,u);T(W)},[e,o,t,d,T,i,u]),M=h.useCallback(D=>{if(i)return;D.preventDefault(),p(!0),j(D);const H=W=>{j(W)},V=()=>{p(!1),document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",V),document.removeEventListener("touchmove",H),document.removeEventListener("touchend",V)};document.addEventListener("mousemove",H),document.addEventListener("mouseup",V),document.addEventListener("touchmove",H),document.addEventListener("touchend",V)},[j,i]),E=h.useCallback(D=>{w.current&&w.current.contains(D.target)||M(D)},[M]),P=h.useCallback(D=>{if(i)return;let H=C;switch(D.key){case"ArrowLeft":case"ArrowDown":H=C-t;break;case"ArrowRight":case"ArrowUp":H=C+t;break;case"Home":H=e;break;case"End":H=o;break;default:return}D.preventDefault(),T(H)},[C,e,o,t,T,i]),L=o-e,S=L===0?0:(C-e)/L*100;return{currentValue:C,isDragging:b,isHovered:y,setIsHovered:x,trackRef:k,thumbRef:w,handleThumbMouseDown:M,handleTrackMouseDown:E,handleKeyDown:P,thumbPositionPercent:S}},ha={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%"}},fa={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}},ma={square:0,rounded:4,pill:24},pa=(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"}}))(),lh={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}},ch={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},ba=({min:e=0,max:o=100,step:t=1,currentValue:r,stepValues:a,shape:l="rounded",size:c="md",variant:d="default",orientation:i="horizontal",isDisabled:u=!1,showValue:g=!1,showTooltip:f=!1,backgroundColor:m="theme-primary",label:b,helperText:p,themeMode:y,shadow:x={},isDragging:k,isHovered:w,setIsHovered:I,trackRef:C,thumbRef:T,handleThumbMouseDown:j,handleTrackMouseDown:M,handleKeyDown:E,thumbPositionPercent:P,ariaLabel:L="Slider",views:S={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:D,onDrag:H,...V})=>{var Q,G;const{getColorHex:W,themeMode:$}=s.useTheme(),_=W(m,{themeMode:y||$}),B=W("theme-disabled",{themeMode:y||$}),A=W(pa[d].backgroundColor,{themeMode:y||$}),F=i==="vertical",{trackCrossAxisSize:v,thumbSize:O}=lh[c]||{trackCrossAxisSize:ha[c].height,thumbSize:fa[c].width||16},N=n.jsxs(s.Vertical,{width:"100%",gap:8,...S.container,...V,children:[b&&n.jsxs(s.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontSize:14,fontWeight:500,...S.label,children:b}),g&&n.jsx(s.Text,{fontSize:14,color:"color-blueGray-500",...S.valueLabel,children:r})]}),n.jsxs(s.View,{ref:C,position:"relative",cursor:u?"not-allowed":"pointer",opacity:u?.6:1,onMouseDown:M,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),...ha[c],borderRadius:ma[l],backgroundColor:A,...pa[d],...x,...S.track,children:[a&&a.length>0&&n.jsx(n.Fragment,{children:a.map(J=>{const oe=(J-e)/(o-e)*100;return n.jsx(s.View,{position:"absolute",top:"50%",left:`${oe}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",backgroundColor:u?B:_,zIndex:1,...S.stepMarks},J)})}),n.jsx(s.View,{position:"absolute",top:0,left:0,height:"100%",width:`${P}%`,backgroundColor:u?B:_,borderRadius:ma[l],transition:"width 0.1s ease-in-out",...S.progress,...S.filledTrack}),n.jsx(s.View,{ref:T,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":r,"aria-orientation":i,"aria-disabled":u,"aria-label":L,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?B:_}`,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:E,...fa[c],...S.thumb,children:f&&(w||k)&&n.jsx(s.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:n.jsx(s.Text,{...(Q=S.tooltip)==null?void 0:Q.text,children:r==null?void 0:r.toFixed(t<1?1:0)})})})]}),p&&n.jsx(Qt,{children:p})]}),K=n.jsxs(s.Center,{...ch[i],position:"relative",onMouseEnter:()=>!u&&I(!0),onMouseLeave:()=>!u&&I(!1),...V,...S==null?void 0:S.container,children:[b&&n.jsxs(s.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[n.jsx(s.Text,{fontSize:14,fontWeight:500,...S.label,children:b}),g&&n.jsx(s.Text,{fontSize:14,color:"color-blueGray-500",...S.valueLabel,children:r})]}),n.jsxs(s.View,{ref:C,position:"relative",borderRadius:v/2,backgroundColor:u?B:A,cursor:u?"not-allowed":"pointer",width:F?`${v}px`:"100%",height:F?"100%":`${v}px`,onMouseDown:M,onTouchStart:M,...S==null?void 0:S.track,children:[a&&a.length>0&&n.jsx(n.Fragment,{children:a.map(J=>{const oe=(J-e)/(o-e)*100;return n.jsx(s.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:u?B:_,zIndex:1,...F?{bottom:`${oe}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${oe}%`,top:"50%",transform:"translate(-50%, -50%)"},...S.stepMarks},J)})}),n.jsx(s.View,{position:"absolute",borderRadius:v/2,backgroundColor:u?B:_,...F?{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}),n.jsx(s.View,{ref:T,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":r,"aria-orientation":i,"aria-disabled":u,"aria-label":L,position:"absolute",width:`${O}px`,height:`${O}px`,borderRadius:"50%",backgroundColor:u?B:_,border:"2px solid color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:u?"not-allowed":"grab",transform:F?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:k?"none":"left 0.1s, bottom 0.1s",...F?{left:"50%",bottom:`${P}%`}:{top:"50%",left:`${P}%`},onMouseDown:j,onTouchStart:j,onKeyDown:E,...S==null?void 0:S.thumb,children:f&&(w||k)&&n.jsx(s.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...F?{left:"100%",marginLeft:"8px",bottom:"0",transform:"translateY(50%)"}:{bottom:"100%",left:"50%",marginBottom:"8px",transform:"translateX(-50%)"},...S==null?void 0:S.tooltip,children:n.jsx(s.Text,{...(G=S==null?void 0:S.tooltip)==null?void 0:G.text,children:r==null?void 0:r.toFixed(t<1?1:0)})})})]}),p&&n.jsx(Qt,{marginTop:8,children:p})]});return F||f?K:N},ih=e=>{const o=ue(e),t=ga({...e,value:o.value!==void 0?Number(o.value):void 0,onChange:r=>{var a;o.onChange(r),(a=e.onChange)==null||a.call(e,r)}});return n.jsx(ba,{...e,...t,...o})},sh=e=>{const o=ue(e),{isFocused:t,setIsFocused:r,isHovered:a,setIsHovered:l,inputRef:c,containerRef:d,mirrorSelectionStart:i,mirrorSelectionEnd:u,setMirrorSelectionStart:g,setMirrorSelectionEnd:f,setInputRef:m,handleFocus:b,handleBlur:p,handleKeyDown:y,handlePaste:x}=ta(e),k=h.useCallback(I=>{o.onChange&&o.onChange(I),e.onComplete&&I.length===(e.length||6)&&e.onComplete(I),c.current&&(c.current.value=I)},[o,e,c]),w=h.useCallback(I=>{const C=I.currentTarget.value.slice(0,e.length||6);k(C),c.current&&(c.current.value=C)},[e.length,k,c]);return n.jsx(ra,{...e,...o,setValue:k,isFocused:t,setIsFocused:r,isHovered:a,setIsHovered:l,inputRef:c,containerRef:d,mirrorSelectionStart:i,mirrorSelectionEnd:u,setMirrorSelectionStart:g,setMirrorSelectionEnd:f,setInputRef:m,handleChange:w,handleFocus:b,handleBlur:p,handleKeyDown:y,handlePaste:x,stepValues:e.stepValues})},dh=e=>Array.isArray(e)?e:e==null?[]:[e],ya=({name:e,uploadFile:o,onUploadSuccess:t,onUploadError:r,transformResponse:a,onMultipleFileSelect:l,onFileSelect:c,multiple:d=!0,...i})=>{const{setFieldValue:u,setFieldTouched:g,values:f}=Ce.useFormikContext(),[m,b]=h.useState(!1),[p,y]=h.useState(0),x=h.useCallback(async I=>{if(!I||I.length===0)return;g(e,!0,!0),b(!0);const C=[];for(const T of I){y(0);try{const j=await o(T,E=>{y(E??0)}),M=a?a(j,T):j;C.push(M),t==null||t(T,M)}catch(j){r==null||r(T,j)}}if(C.length>0){const T=dh(Ce.getIn(f,e));u(e,[...T,...C],!0),y(100)}else y(0);b(!1)},[e,r,t,g,u,a,o,f]),k=h.useCallback(async I=>{l==null||l(I),await x(I)},[x,l]),w=h.useCallback(async I=>{c==null||c(I),await x([I])},[x,c]);return n.jsx(Fo,{...i,multiple:d,onMultipleFileSelect:d?k:void 0,onFileSelect:d?void 0:w,isLoading:m,progress:p})};ya.displayName="FormikUploader";const uh=e=>{let o=ue(e);o.selected=o.value;const t=zn(e);return n.jsx(En,{...t,...o})},xa=e=>{const[o,t]=h.useState(!1),[r,a]=h.useState(e);return{isHovered:o,setIsHovered:t,isToggle:r,setIsToggled:a}},gh={square:0,rounded:4,pill:24},hh=(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"}}),ka=({children:e,shape:o="rounded",variant:t="ghost",isHovered:r,setIsHovered:a,isDisabled:l,isToggle:c,setIsToggled:d,onToggle:i,views:u,backgroundColor:g,color:f,themeMode:m,...b})=>{const{getColor:p,themeMode:y}=s.useTheme(),x=m??y,w=p(l?"theme-disabled":g??f??"theme-primary",{themeMode:x}),C=hh(w,x==="light")[t],T=!!(c||r),j=()=>a(!r),M=()=>{l||d(E=>{const P=!E;return i&&i(P),P})};return n.jsx(s.Center,{role:"Toggle",padding:o==="pill"?"10px 12px":"8px",width:"fit-content",cursor:l?"not-allowed":"pointer",borderRadius:gh[o],onClick:M,onMouseEnter:j,onMouseLeave:()=>a(!1),...C,...T&&{backgroundColor:w,color:x==="light"?"color-black":"color-white"},...b,...u==null?void 0:u.container,children:e})},fh=({children:e,shape:o,variant:t,isDisabled:r,isToggled:a=!1,onToggle:l,...c})=>{const d=ue(c),{isHovered:i,setIsHovered:u,isToggle:g,setIsToggled:f}=xa(d.value??a);h.useEffect(()=>{f(d.value??a)},[d.value,a]);const m=b=>{f(b),d.onChange(b),l==null||l(b)};return n.jsx(ka,{shape:o,variant:t,isDisabled:r,isHovered:i,setIsHovered:u,isToggle:g,setIsToggled:f,onToggle:m,...c,children:e})},Ca=()=>{const[e,o]=h.useState([]);return{activeToggles:e,setActiveToggles:o}},wa=({children:e,shape:o,variant:t,isDisabled:r,isToggled:a=!1,onToggle:l,...c})=>{const{isHovered:d,setIsHovered:i,isToggle:u,setIsToggled:g}=xa(a);return h.useEffect(()=>{g(a)},[a]),n.jsx(ka,{shape:o,variant:t,isDisabled:r,isHovered:d,setIsHovered:i,isToggle:u,setIsToggled:g,onToggle:l,...c,children:e})},Ia=({items:e,onToggleChange:o,activeToggles:t,setActiveToggles:r,shape:a="rounded",variant:l="ghost",views:c})=>{const d=h.useCallback((i,u)=>{r(g=>{let f;return u?f=g.includes(i)?g:[...g,i]:f=g.filter(m=>m!==i),o==null||o(f),f})},[o,r]);return n.jsx(s.Horizontal,{role:"ToggleGroup",display:"flex",gap:5,...c==null?void 0:c.container,children:e.map(i=>n.jsx(wa,{role:`toggle-${i.id}`,shape:a,variant:l,isToggled:t.includes(i.id)||i.isActive,onToggle:u=>d(i.id,u),isDisabled:i.isDisabled,views:c==null?void 0:c.toggle,children:i.value},i.id))})},mh=({items:e,shape:o,variant:t,onToggleChange:r,...a})=>{const l=ue(a),{activeToggles:c,setActiveToggles:d}=Ca();h.useEffect(()=>{Array.isArray(l.value)&&d(l.value)},[l.value]);const i=u=>{d(u),l.onChange(u),r==null||r(u)};return n.jsx(Ia,{items:e,shape:o,variant:t,activeToggles:c,setActiveToggles:d,onToggleChange:i,...a})},Ta=["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"],ja=e=>{const{value:o,defaultValue:t,onChange:r,isOpen:a,onOpen:l,onClose:c,closeOnSelect:d=!0}=e,[i,u]=h.useState(a??!1),[g,f]=h.useState(o??t),[m,b]=h.useState(""),p=h.useRef(null),y=h.useRef(null);h.useEffect(()=>{o!==void 0&&f(o)},[o]),h.useEffect(()=>{a!==void 0&&u(a)},[a]);const x=h.useMemo(()=>m?Ta.filter(T=>T.toLowerCase().includes(m.toLowerCase())).slice(0,100):Ta.slice(0,100),[m]);h.useEffect(()=>{const T=j=>{i&&p.current&&y.current&&!p.current.contains(j.target)&&!y.current.contains(j.target)&&k()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[i]);const k=h.useCallback(()=>{a===void 0&&u(!1),c&&c()},[c,a]),w=h.useCallback(()=>{const T=!i;a===void 0&&u(T),T?(l&&l(),b("")):c&&c()},[i,l,c,a]),I=h.useCallback(T=>{o===void 0&&f(T),r&&r(T),d&&k()},[r,d,k,o]),C=h.useCallback(T=>{b(T)},[]);return{isOpen:i,selectedIcon:g,searchQuery:m,filteredIcons:x,handleToggle:w,handleIconSelect:I,handleSearchChange:C,handleClose:k,triggerRef:p,dropdownRef:y}},eo={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"}},ph={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"}},bh={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},yh={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"}},Sa=({label:e,placeholder:o="Select an icon",helperText:t,views:r={},size:a="md",shape:l="default",variant:c="default",error:d=!1,isDisabled:i=!1,isReadOnly:u=!1,showSearch:g=!0,isOpen:f,selectedIcon:m,searchQuery:b,filteredIcons:p,handleToggle:y,handleIconSelect:x,handleSearchChange:k,triggerRef:w,dropdownRef:I,handleClose:C,onChange:T,...j})=>{const{getColor:M}=s.useTheme(),E={...eo.container,...r==null?void 0:r.container},P={...eo.trigger,...ph[a],...bh[l],...yh[c],...d&&{borderColor:"color-red-500"},...i&&{opacity:.6,cursor:"not-allowed"},...r==null?void 0:r.trigger},L={...eo.dropdown,...r==null?void 0:r.dropdown},S={...eo.iconGrid,...r==null?void 0:r.iconGrid};return n.jsxs(s.View,{...E,...j,children:[e&&n.jsx(s.Text,{fontSize:a==="xs"?"12px":a==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...r==null?void 0:r.label,children:e}),n.jsxs(s.View,{ref:w,onClick:i||u?void 0:y,...P,children:[n.jsx(s.Horizontal,{alignItems:"center",gap:8,width:"100%",children:m?n.jsxs(s.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[n.jsx(Wo,{name:m,widthHeight:16}),n.jsx(s.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m})]}):n.jsx(s.Text,{color:"color-gray-500",fontSize:"inherit",children:o})}),!u&&!i&&n.jsx(ce,{widthHeight:16,color:"color-gray-500",orientation:f?"up":"down"})]}),f&&n.jsxs(s.View,{ref:I,...L,children:[g&&n.jsx(s.View,{...eo.searchInput,...r==null?void 0:r.searchInput,children:n.jsx(ko,{placeholder:"Search icons...",value:b,onChange:D=>k(D),size:"sm",autoFocus:!0})}),n.jsx(s.View,{...S,children:p.length>0?p.map(D=>n.jsx(s.View,{...eo.iconItem,onClick:()=>x(D),title:D,_hover:{backgroundColor:"color-gray-100"},backgroundColor:m===D?"color-blue-100":"transparent",...r==null?void 0:r.iconItem,children:n.jsx(Wo,{name:D,widthHeight:20})},D)):n.jsx(s.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:n.jsx(s.Text,{fontSize:"14px",children:"No icons found"})})})]}),t&&n.jsx(s.Text,{color:d?"color-red-500":"color-gray-600",marginTop:"4px",...r==null?void 0:r.helperText,children:t})]})},xh=e=>{const o=ue(e),t={...e,value:o.value??e.value??e.defaultValue},r=ja(t),a=l=>{r.handleIconSelect(l),o.onChange(l)};return n.jsx(Sa,{...r,...t,handleIconSelect:a})},Pe={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"}},kh={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"}},Ch={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},wh={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"}},Ih={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},Th=[{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"]}],Ma=e=>{const{value:o,defaultValue:t="",onChange:r,onEmojiSelect:a,isOpen:l,onOpen:c,onClose:d,closeOnSelect:i=!0,maxRecentEmojis:u=16,showRecentEmojis:g=!0,enabledCategories:f=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:m=[]}=e,[b,p]=h.useState(l??!1),[y,x]=h.useState(o??t),[k,w]=h.useState(""),[I,C]=h.useState("smileys"),[T,j]=h.useState([]),M=h.useRef(null),E=h.useRef(null),P=h.useMemo(()=>[...Th,...m],[m]),L=h.useMemo(()=>{let _=P;if(I!=="recent"?_=_.filter(B=>B.category===I):_=T,k){const B=k.toLowerCase();_=_.filter(A=>A.name.toLowerCase().includes(B)||A.keywords.some(F=>F.toLowerCase().includes(B)))}return _},[P,I,T,k]);h.useEffect(()=>{o!==void 0&&x(o)},[o]),h.useEffect(()=>{l!==void 0&&p(l)},[l]),h.useEffect(()=>{if(g){const _=localStorage.getItem("emojiPicker-recentEmojis");if(_)try{j(JSON.parse(_))}catch{}}},[g]),h.useEffect(()=>{const _=B=>{b&&M.current&&E.current&&!M.current.contains(B.target)&&!E.current.contains(B.target)&&$()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[b]);const S=h.useCallback(_=>{g&&j(B=>{const A=B.filter(v=>v.emoji!==_.emoji),F=[_,...A].slice(0,u);return localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(F)),F})},[g,u]),D=h.useCallback(()=>{const _=!b;p(_),_?(c==null||c(),w(""),g&&T.length>0?C("recent"):C("smileys")):d==null||d()},[b,c,d,g,T.length]),H=h.useCallback(_=>{x(_.emoji),S(_),r==null||r(_.emoji),a==null||a(_),i&&(p(!1),d==null||d())},[r,a,i,d,S]),V=h.useCallback(_=>{w(_),_&&I==="recent"&&C("smileys")},[I]),W=h.useCallback(_=>{C(_),w("")},[]),$=h.useCallback(()=>{p(!1),d==null||d()},[d]);return{isOpen:b,selectedEmoji:y,recentEmojis:T,searchQuery:k,activeCategory:I,filteredEmojis:L,handleToggle:D,handleEmojiSelect:H,handleSearchChange:V,handleCategoryChange:W,handleClose:$,triggerRef:M,dropdownRef:E}},za=({id:e,name:o,label:t,placeholder:r="Select an emoji",helperText:a,views:l={},size:c="md",shape:d="default",variant:i="default",error:u=!1,isDisabled:g=!1,isReadOnly:f=!1,showSearch:m=!0,showCategories:b=!0,showRecentEmojis:p=!0,enabledCategories:y=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:x,selectedEmoji:k,recentEmojis:w,searchQuery:I,activeCategory:C,filteredEmojis:T,handleToggle:j,handleEmojiSelect:M,handleSearchChange:E,handleCategoryChange:P,triggerRef:L,dropdownRef:S,onChange:D,...H})=>{const{getColor:V}=s.useTheme(),W={...Pe.container,...l==null?void 0:l.container},$={...Pe.trigger,...kh[c],...Ch[d],...wh[i],...u&&{borderColor:"color-red-500"},...g&&{opacity:.6,cursor:"not-allowed"},...l==null?void 0:l.trigger},_={...Pe.dropdown,...l==null?void 0:l.dropdown},B={...Pe.categoryTabs,...l==null?void 0:l.categoryTabs},A={...Pe.emojiGrid,...l==null?void 0:l.emojiGrid},F=y.filter(v=>v==="recent"?p&&w.length>0:!0);return n.jsxs(s.View,{...W,...H,children:[t&&n.jsx(s.Text,{fontSize:c==="xs"?"12px":c==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...l==null?void 0:l.label,children:t}),n.jsxs(s.View,{ref:L,onClick:g||f?void 0:j,...$,children:[n.jsx(s.Horizontal,{alignItems:"center",gap:8,children:n.jsx(s.Text,{color:k?"color-gray-800":"color-gray-500",fontSize:"inherit",children:k||r})}),!f&&!g&&n.jsx(ce,{widthHeight:16,color:"color-gray-500",orientation:x?"up":"down"})]}),x&&n.jsxs(s.View,{ref:S,..._,children:[m&&n.jsx(s.View,{...Pe.searchInput,...l==null?void 0:l.searchInput,children:n.jsx(ko,{placeholder:"Search emojis...",value:I,onChange:v=>E(v.target.value),size:"sm"})}),b&&n.jsx(s.View,{...B,children:F.map(v=>n.jsx(s.View,{...Pe.categoryTab,...C===v&&{borderBottomColor:"color-blue-500",color:"color-blue-600"},onClick:()=>P(v),title:v.charAt(0).toUpperCase()+v.slice(1),...l==null?void 0:l.categoryTab,children:Ih[v]},v))}),n.jsx(s.View,{...A,children:T.length>0?T.map((v,O)=>n.jsx(s.View,{...Pe.emoji,onClick:()=>M(v),title:v.name,_hover:{backgroundColor:"color-gray-100"},color:"color-gray-800",...l==null?void 0:l.emoji,children:v.emoji},`${v.emoji}-${O}`)):n.jsx(s.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:n.jsx(s.Text,{fontSize:"14px",children:I?"No emojis found":"No emojis in this category"})})})]}),a&&n.jsx(s.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...l==null?void 0:l.helperText,children:a})]})},jh=e=>{const o=ue(e),t={...e,value:o.value??e.value??e.defaultValue},r=Ma(t),a=l=>{var c;r.handleEmojiSelect(l),o.onChange(l.emoji),(c=e.onEmojiSelect)==null||c.call(e,l)};return n.jsx(za,{...r,...t,handleEmojiSelect:a})},Sh=({files:e,onRemove:o,maxHeight:t="120px",views:r={}})=>{if(e.length===0)return null;const a=h.useCallback(l=>l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(1)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`,[]);return n.jsx(s.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:t,overflowY:"auto",...r==null?void 0:r.container,children:e.map((l,c)=>{const d=l.url||"",i=l.type.startsWith("image/"),u=l.type.startsWith("video/"),g=l.type.startsWith("audio/");return n.jsx(s.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,...r==null?void 0:r.item,children:n.jsxs(xe,{children:[n.jsx(xe.Trigger,{children:n.jsxs(s.View,{position:"relative",children:[i&&d&&n.jsx(s.Image,{src:d,alt:l.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),u&&d&&n.jsx(s.View,{as:"video",src:d,alt:l.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),g&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:n.jsx(_o,{widthHeight:24,color:"color-black"})}),!i&&!u&&!g&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:n.jsx(io,{widthHeight:24,color:"color-black"})}),o&&n.jsx(s.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 ${l.name}`,children:"×"})]})}),n.jsxs(xe.Content,{children:[i&&d&&n.jsx(s.Image,{src:d,alt:l.name,maxWidth:"300px"}),u&&d&&n.jsx(s.View,{as:"video",src:d,controls:!0,maxWidth:"300px"}),g&&d&&n.jsx(s.View,{as:"audio",src:d,controls:!0,width:"100%"}),n.jsxs(s.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",fontSize:12,...r==null?void 0:r.name,children:[l.name," (",a(l.size),")"]})]})]})},c)})})},Mh=e=>{const o=ga(e);return n.jsx(ba,{...e,...o})},zh=({url:e,type:o,name:t,onOpen:r})=>{const a=o.toLowerCase(),l=a.startsWith("image"),c=a.startsWith("video"),d=a.startsWith("audio"),i=()=>{r&&r()};return n.jsxs(s.View,{width:"60px",height:"60px",flexShrink:0,borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-200",cursor:"pointer",onClick:i,children:[l&&n.jsx(s.Image,{src:e,alt:t,width:"100%",height:"100%",objectFit:"cover"}),c&&n.jsx(s.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:u=>u.stopPropagation()}),d&&n.jsx(s.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:u=>u.stopPropagation()}),!l&&!c&&!d&&n.jsx(io,{widthHeight:24,color:"color-gray-600"})]})},We=bt.create(e=>({modals:[],onHide:o=>o,onShow:(o,t)=>({name:o,props:t}),show:(o,t={},r={})=>{e(a=>({...a,modals:[...a.modals,{name:o,props:{...t,isVisible:!0},overlayProps:r}]}))},hide:o=>{e(t=>o?{...t,modals:t.modals.filter(r=>r.name!==o)}:{modals:[]})},setOnHide:o=>{e(t=>({...t,onHide:o}))},setOnShow:o=>{e(t=>({...t,onShow:o}))}})),Eh=(e,o={},t={})=>{We.getState().show(e,o,t),We.getState().onShow(e,o)},nr=e=>{console.log("hideModal",e),We.getState().onHide(e),We.getState().hide(typeof e=="string"?e:void 0)},Vh={square:{borderRadius:0},rounded:{borderRadius:"8px"}},Ph={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"}},Wh={xs:12,sm:16,md:20,lg:24,xl:28},lt={body:{fontSize:"16px",fontWeight:"400",lineHeight:"24px",color:"color-gray-700"}},Ea=({children:e,blur:o,isOpen:t=!1,isClosePrevented:r=!1,onClose:a=()=>{},position:l="center",views:c,...d})=>{const i=()=>{r||a()};return n.jsx(s.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:i,visibility:t?"visible":"hidden",transition:"all 0.3s ease",...c==null?void 0:c.container,children:n.jsx(s.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:i,...Ph[l],...d,...c==null?void 0:c.view,children:e})})},_h=({children:e,shadow:o,isFullScreen:t=!1,shape:r="rounded",views:a,isOpen:l,...c})=>{const d=typeof document!==void 0?{boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"}:{elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},i=u=>{u&&u.stopPropagation&&u.stopPropagation()};return n.jsx(s.Vertical,{cursor:"default",backgroundColor:"color-white",width:t?"100%":600,height:t?"100%":"fit-content",onClick:i,transition:"all 0.3s ease",...o||d,...Vh[r],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...c,...a==null?void 0:a.container,children:e})},$h=({children:e,buttonColor:o="theme-primary",iconSize:t="md",buttonPosition:r="right",views:a,...l})=>{const c=l.onClose?l.onClose:nr,d=n.jsx(s.View,{onClick:c,children:n.jsx(ye,{widthHeight:Wh[t],color:o})});return n.jsxs(s.Horizontal,{justifyContent:r==="none"?"center":"space-between",alignItems:"center",paddingVertical:16,paddingHorizontal:24,borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",media:{mobile:{paddingVertical:12,paddingHorizontal:16}},...l,...a==null?void 0:a.header,children:[r==="left"&&d,e,r==="right"&&d]})},Lh=({children:e,views:o,...t})=>n.jsx(s.View,{paddingVertical:16,paddingHorizontal:24,fontSize:lt.body.fontSize,fontWeight:lt.body.fontWeight,lineHeight:lt.body.lineHeight,color:lt.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...t,...o==null?void 0:o.view,children:e}),Dh=({children:e,views:o,...t})=>n.jsx(s.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}),Bh=({modals:e,onShow:o,onHide:t})=>{const r=We(a=>a.modals);return o&&We.getState().setOnShow(o),t&&We.getState().setOnHide(t),r.length===0?null:n.jsx(h.Fragment,{children:r.map((a,l)=>{const c=e[a.name];return c?n.jsx(Ea,{isOpen:a.props.isVisible,onClose:()=>nr(a.name),blur:5,...a.overlayProps,style:{zIndex:1e3+l},children:n.jsx(c,{...a.props})},l):(console.error(`${a.name} modal doesn't exist`),null)})})},Ae=({children:e})=>n.jsx(n.Fragment,{children:e});Ae.Overlay=Ea,Ae.Container=_h,Ae.Header=$h,Ae.Body=Lh,Ae.Footer=Dh,Ae.Layout=Bh;const Va={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},Hh={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"}},Pa=({isOpen:e,onClose:o,isClosePrevented:t,blur:r,children:a,...l})=>{const c=()=>{t||o()};return h.useEffect(()=>{const d=i=>{i.key==="Escape"&&e&&!t&&o()};return e&&document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[e,t,o]),n.jsx(s.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:r?`blur(${r}px)`:void 0,pointerEvents:e?"auto":"none",...l,children:a})},Wa=({placement:e="right",size:o="md",children:t,...r})=>{const a=d=>{d.stopPropagation()},c=e==="top"||e==="bottom"?{height:o==="full"?"100vh":Va[o]||o,maxHeight:"100vh"}:{width:o==="full"?"100vw":Va[o]||o,maxWidth:"100vw"};return n.jsx(s.Vertical,{position:"absolute",backgroundColor:"color-white",...Hh[e],...c,onClick:a,transition:"transform 0.3s ease",...r,children:t})},Ah=({children:e,onClose:o,buttonPosition:t="right",...r})=>{const a=o&&n.jsx(s.View,{onClick:o,cursor:"pointer",padding:8,children:n.jsx(ye,{widthHeight:20,color:"color-gray-500"})});return n.jsxs(s.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderBottomWidth:"1px",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:t==="none"?"center":"space-between",...r,children:[t==="left"&&a,e,t==="right"&&a]})},Fh=({children:e,...o})=>n.jsx(s.Vertical,{padding:24,flex:1,overflowY:"auto",...o,children:e}),Oh=({children:e,...o})=>n.jsx(s.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderTopWidth:"1px",borderTopColor:"color-gray-200",alignItems:"center",justifyContent:"flex-end",gap:12,...o,children:e}),oo=({isOpen:e,onClose:o,placement:t="right",size:r="md",isClosePrevented:a,children:l,...c})=>{const d=e?{}:{transform:t==="left"||t==="right"?`translateX(${t==="left"?"-100%":"100%"})`:`translateY(${t==="top"?"-100%":"100%"})`};return n.jsx(Pa,{isOpen:e,onClose:o,isClosePrevented:a,...c,children:n.jsx(Wa,{placement:t,size:r,style:d,children:l})})};oo.Overlay=Pa,oo.Container=Wa,oo.Header=Ah,oo.Body=Fh,oo.Footer=Oh;const vh=(e=null,o=[])=>{const[t,r]=h.useState(e),[a,l]=h.useState(o),c=h.useRef({});return{activeItemId:t,setActiveItemId:r,expandedItemIds:a,toggleExpandedItem:u=>{l(g=>g.includes(u)?g.filter(m=>m!==u):[...g,u])},isItemExpanded:u=>a.includes(u),triggerRefs:c}},ar={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"}}}},lr={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"}},_a={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},to={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"}},$a=h.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),Nh=({children:e,value:o})=>n.jsx($a.Provider,{value:o,children:e}),To=()=>{const e=h.useContext($a);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},cr=({children:e,views:o})=>{const{orientation:t}=To(),r=t==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(r,{width:"100%",..._a[t],transition:"all 0.2s ease",borderRadius:"4px",...o==null?void 0:o.container,children:e})},La=h.createContext({itemValue:null,isDisabled:!1}),Uh=()=>{const e=h.useContext(La);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},ir=({item:e,value:o,isDisabled:t=!1,children:r,views:a})=>{var k;const{activeItemId:l,setActiveItemId:c,orientation:d,size:i,variant:u,onItemActivate:g}=To(),f=(e==null?void 0:e.id)||o,m=l===f,b=(e==null?void 0:e.items)&&e.items.length>0,p=(e==null?void 0:e.disabled)||t,y=()=>{p||f&&(c(f),g&&g(f))},x=d==="horizontal"?s.Horizontal:s.Vertical;return r?n.jsx(La.Provider,{value:{itemValue:f||null,isDisabled:p},children:n.jsx(s.View,{width:"100%",cursor:p?"not-allowed":"pointer",opacity:p?.6:1,borderRadius:"4px",transition:"all 0.2s ease",...ar[i],...lr[u],...m?to.active:{},_hover:p?{}:to.hover,...a==null?void 0:a.item,children:r})}):b&&e?n.jsxs(x,{width:"100%",flexDirection:"column",position:"relative",...a==null?void 0:a.item,children:[n.jsxs(Da,{itemId:e.id,disabled:e.disabled,views:a,children:[e.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),e.label]}),n.jsx(Ba,{itemId:e.id,children:n.jsx(cr,{children:(k=e.items)==null?void 0:k.map(w=>n.jsx(ir,{item:w},w.id))})})]}):e?n.jsxs(s.View,{as:e.href?"a":"div",to:e.href,onClick:y,cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.6:1,width:"100%",display:"flex",alignItems:"center",borderRadius:"4px",transition:"all 0.2s ease",gap:"8px",...ar[i],...lr[u],...m?to.active:{},_hover:e.disabled?{}:to.hover,...a==null?void 0:a.item,children:[e.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),e.label]}):null},Da=({children:e,itemId:o,disabled:t,views:r})=>{const{activeItemId:a,toggleExpandedItem:l,isItemExpanded:c,size:d,variant:i,triggerRefs:u}=To(),g=h.useRef(null),f=a===o,m=c(o);h.useEffect(()=>(g.current&&o&&(u.current[o]=g.current),()=>{o&&delete u.current[o]}),[o,u]);const b=p=>{p.preventDefault(),!t&&l(o)};return n.jsxs(s.View,{ref:g,onClick:b,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",...ar[d],...lr[i],...f?to.active:{},_hover:t?{}:to.hover,...r==null?void 0:r.trigger,children:[n.jsx(s.View,{display:"flex",alignItems:"center",children:e}),n.jsx(s.View,{transition:"transform 0.2s ease",transform:m?"rotate(180deg)":"rotate(0deg)",...r==null?void 0:r.indicator,children:n.jsx(ce,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},Ba=({children:e,itemId:o,views:t})=>{const{isItemExpanded:r,orientation:a,triggerRefs:l}=To(),c=h.useRef(null),[d,i]=h.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),u=r(o);if(h.useEffect(()=>{if(u&&c.current&&o&&l.current[o]&&a==="horizontal"){const f=c.current.getBoundingClientRect(),m=l.current[o].getBoundingClientRect(),b=Math.max(f.width||200,200),p=Math.max(f.height||150,150),y=window.innerWidth,x=window.innerHeight,k={top:m.top,right:y-m.right,bottom:x-m.bottom,left:m.left},w=a==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=p+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=p+8,x:m.left,y:m.top-p-8},{placement:"right",space:k.right,fits:k.right>=b+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=b+8,x:m.left-b-8,y:m.top}]:[{placement:"right",space:k.right,fits:k.right>=b+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=b+8,x:m.left-b-8,y:m.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=p+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=p+8,x:m.left,y:m.top-p-8}],I=w.find(M=>M.fits);if(I){i({x:I.x,y:I.y,placement:I.placement});return}const C=w.reduce((M,E)=>E.space>M.space?E:M);let T=C.x,j=C.y;T+b>y&&(T=y-b-8),T<8&&(T=8),j+p>x&&(j=x-p-8),j<8&&(j=8),i({x:T,y:j,placement:C.placement})}},[u,a,o,l]),!u)return null;if(a==="vertical")return n.jsx(s.View,{paddingLeft:16,width:"100%",position:"relative",backgroundColor:"transparent",...t==null?void 0:t.container,children:e});const g={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return n.jsx(s.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:g,...t==null?void 0:t.container,children:e})},qh=({href:e,children:o,views:t,...r})=>{const{itemValue:a,isDisabled:l}=Uh(),{activeItemId:c,setActiveItemId:d,onItemActivate:i}=To(),u=c===a,g=f=>{if(l){f.preventDefault();return}a&&(d(a),i&&i(a)),r.onClick&&r.onClick(f)};return n.jsx(s.View,{as:"a",href:l?void 0:e,onClick:g,cursor:l?"not-allowed":"pointer",opacity:l?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":u?"page":void 0,"aria-disabled":l,"data-active":u?"":void 0,"data-disabled":l?"":void 0,...u?{fontWeight:"bold"}:{},...t==null?void 0:t.container,...r,children:o})},Gh=({items:e,orientation:o,views:t,themeMode:r})=>{const a=o==="horizontal"?s.Horizontal:s.Vertical;return!e||e.length===0?null:n.jsx(a,{width:"100%",..._a[o],...t==null?void 0:t.container,children:n.jsx(cr,{views:t,children:e.map(l=>n.jsx(ir,{item:l,views:t},l.id))})})},ro=({items:e,children:o,orientation:t="vertical",size:r="md",variant:a="default",defaultActiveItemId:l=null,defaultExpandedItemIds:c=[],onItemActivate:d,views:i,...u})=>{const{activeItemId:g,setActiveItemId:f,expandedItemIds:m,toggleExpandedItem:b,isItemExpanded:p,triggerRefs:y}=vh(l,c);return n.jsx(Nh,{value:{activeItemId:g,setActiveItemId:f,expandedItemIds:m,toggleExpandedItem:b,isItemExpanded:p,orientation:t,size:r,variant:a,onItemActivate:d,triggerRefs:y},children:e?n.jsx(Gh,{items:e,orientation:t,size:r,variant:a,views:i,...u}):o})};ro.List=cr,ro.Item=ir,ro.Trigger=Da,ro.Content=Ba,ro.Link=qh;const Ha={},Aa=h.createContext({views:Ha,onRowClick:()=>{}}),Yh=({children:e,views:o=Ha,onRowClick:t})=>n.jsx(Aa.Provider,{value:{views:o,onRowClick:t},children:e}),_e=()=>h.useContext(Aa),ge={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"}}}};({...ge.th},{...ge.td}),{...ge.tr},{...ge.td},{...ge.th},{...ge.table},{...ge.th},{...ge.td},{...ge.tr},{...ge.tfoot},{...ge.caption};const Fa=e=>{const{views:o}=_e();return n.jsx(s.Element,{as:"table",borderCollapse:"collapse",...ge.table,...o==null?void 0:o.table,...e})},Oa=e=>{const{views:o}=_e();return n.jsx(s.Element,{as:"thead",textAlign:"left",...ge.thead,...o==null?void 0:o.thead,...e})},va=e=>{const{views:o}=_e();return n.jsx(s.Element,{as:"th",whiteSpace:"nowrap",...ge.th,...o==null?void 0:o.th,...e})},ct=e=>{const{views:o,onRowClick:t}=_e();return n.jsx(s.Element,{as:"tr",...ge.tr,...o==null?void 0:o.tr,onClick:t,...e})},sr=e=>{const{views:o}=_e();return n.jsx(s.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e.isFirstColumn?"500":"400",...ge.td,...o==null?void 0:o.td,...e})},Na=e=>{const{views:o}=_e();return n.jsx(s.Element,{as:"tbody",...ge.tbody,...o==null?void 0:o.tbody,...e})},Ua=e=>{const{views:o}=_e();return n.jsx(s.Element,{as:"tfoot",...ge.tfoot,...o==null?void 0:o.tfoot,...e})},qa=e=>{const{views:o}=_e();return n.jsx(s.Element,{as:"caption",...ge.caption,...o==null?void 0:o.caption,...e})},Xh=({data:e,columns:o,footer:t,caption:r,themeMode:a})=>n.jsxs(Fa,{role:"Table",children:[r&&n.jsx(qa,{children:r}),n.jsx(Oa,{children:n.jsx(ct,{children:o.map(l=>n.jsx(va,{children:l.title},l.field))})}),n.jsx(Na,{children:e.map((l,c)=>n.jsx(ct,{children:o.map((d,i)=>n.jsx(sr,{isFirstColumn:i===0,children:l[d.field]},d.field))},c))}),t&&n.jsx(Ua,{children:n.jsx(ct,{children:t.map((l,c)=>n.jsx(sr,{...l.props,children:l.value},c))})})]}),Te=({children:e,views:o,onClick:t})=>n.jsx(Yh,{views:o,onRowClick:t,children:e});Te.Head=Oa,Te.HeadCell=va,Te.Body=Na,Te.Row=ct,Te.Cell=sr,Te.Footer=Ua,Te.Caption=qa,Te.Container=Fa,Te.Template=Xh;const Kh=(e,o,t)=>{const r=u=>u.value!==void 0?u.value:u.title,a=()=>{if(!(!e||e.length===0)){if(o!==void 0){const u=e.find(g=>r(g)===o);if(u)return u}return e[0]}},[l,c]=h.useState(a()),d=t!==void 0?e.find(u=>r(u)===t):l,i=u=>{t===void 0&&c(u)};return h.useEffect(()=>{if(t!==void 0)return;const u=a(),g=l&&e.some(f=>r(f)===r(l));u&&(!g||o!==void 0&&l&&r(l)!==o)?c(u):!u&&l&&c(void 0)},[e,o]),{activeTab:d,setActiveTab:i}},Qh=(e,o,t)=>{const[r,a]=h.useState(e||null);return{activeValue:o!==void 0?o:r,setActiveValue:d=>{o===void 0&&a(d),t&&t(d)}}},Jh=({tab:e,isActive:o,onClick:t,iconPosition:r="left",tabStyles:a,textStyles:l})=>{const c={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"}}},d=()=>{switch(r){case"top":return"column";case"bottom":return"column-reverse";case"right":return"row-reverse";case"left":default:return"row"}},i=()=>["top","bottom"].includes(r)?"4px":"8px",u=e.icon&&h.isValidElement(e.icon)?h.cloneElement(e.icon,{strokeWidth:o?2.5:2}):e.icon;return n.jsxs(s.Element,{as:"div",role:"tab","aria-selected":o,tabIndex:o?0:-1,...c,...a,flexDirection:d(),gap:i(),onClick:t,"data-state":o?"active":"inactive",children:[u&&n.jsx(s.Element,{children:u},o?"active-icon":"inactive-icon"),n.jsxs(s.Element,{display:"grid",alignItems:"center",justifyContent:"center",children:[n.jsx(s.Text,{...l,fontWeight:"600",visibility:"hidden",gridColumn:"1",gridRow:"1","aria-hidden":"true",children:e.title}),n.jsx(s.Text,{...l,fontWeight:o?"600":"500",gridColumn:"1",gridRow:"1",children:e.title})]})]})},Zh=({tabs:e=[],activeTab:o,handleTabClick:t,views:r={},renderTab:a,renderContent:l,iconPosition:c="left"})=>o?n.jsxs(s.Vertical,{width:"100%",height:"100%",...r.container,children:[n.jsx(s.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...r.headerTabs,children:e.map(d=>{const i=(d.value!==void 0?d.value:d.title)===(o.value!==void 0?o.value:o.title),u=()=>t(d);return a?a(d,i,u):n.jsx(Jh,{tab:d,isActive:i,onClick:u,iconPosition:c,tabStyles:{...r.tab,...i?r.activeTab:{}},textStyles:{...r.title,...i?r.activeText:{}}},d.title)})}),n.jsx(s.View,{width:"100%",height:"100%",...r.content,children:l?l(o):o.content})]}):null,Ga=h.createContext(null),Ya=()=>{const e=h.useContext(Ga);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},Rh=({children:e,views:o})=>n.jsx(s.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...o==null?void 0:o.container,children:e}),ef=({value:e,children:o,disabled:t=!1,views:r})=>{const{activeValue:a,setActiveValue:l}=Ya(),c=a===e,d=()=>{t||l(e)};return n.jsx(s.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,...r==null?void 0:r.trigger,...c?r==null?void 0:r.activeState:{},children:o})},of=({value:e,children:o,views:t})=>{const{activeValue:r}=Ya();return r!==e?null:n.jsx(s.View,{width:"100%",padding:"24px",...t==null?void 0:t.content,children:o})},tf=({tabs:e,views:o,defaultValue:t,onTabChange:r,renderTab:a,renderContent:l,iconPosition:c="left",value:d,onValueChange:i,children:u})=>{const g=Qh(t,d,i),f=Kh(e||[],t,d);if(u)return n.jsx(Ga.Provider,{value:g,children:u});if(e){const m=b=>{const p=y=>y.value!==void 0?y.value:y.title;(!f.activeTab||p(f.activeTab)!==p(b))&&(f.setActiveTab(b),r&&r(b))};return n.jsx(Zh,{tabs:e,views:o,activeTab:f.activeTab,handleTabClick:m,renderTab:a,renderContent:l,iconPosition:c})}return null},it=h.memo(tf);it.List=Rh,it.Trigger=ef,it.Content=of;const rf=e=>{const{children:o,_isInView:t=!1,alternateHighlightText:r=[],alternateAnimation:a=!1,alternateDuration:l=3e3,highlightText:c,highlightTypewriter:d=!1,highlightSlide:i=!1,highlightSlideDuration:u=500,highlightSlideStagger:g=50,highlightSlideSequential:f=!0}=e,[m,b]=h.useState(o),[p,y]=h.useState(c);return h.useEffect(()=>{if(!a||r.length===0||!t||typeof o!="string"||typeof c!="string")return b(o),y(c),()=>{};const x=o,k=c;let w=0;const I=T=>{const j=r[T],M=k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),E=new RegExp(M,"gi"),P=x.replace(E,j);b(P),y(j)};I(w);const C=setInterval(()=>{w=(w+1)%r.length,I(w)},l);return()=>clearInterval(C)},[a,r,l,c,o,t]),{finalDisplayedText:m,activeHighlightTarget:p,highlightTypewriter:d,highlightSlide:i,highlightSlideDuration:u,highlightSlideStagger:g,highlightSlideSequential:f}},nf={xs:24,sm:36,md:48,lg:64,xl:72},af={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:()=>({})},lf=({text:e,typingSpeed:o=50,pauseTime:t=500,onComplete:r,showCursor:a=!0,cursorColor:l="currentColor",textStyle:c,textComponent:d,as:i,...u})=>{const g=d||s.Text,f=Array.isArray(e)?e:[e],[m,b]=h.useState(f.map(()=>"")),[p,y]=h.useState(!1),[x,k]=h.useState(0),[w,I]=h.useState(0);h.useEffect(()=>{b(f.map(()=>"")),y(!1),k(0),I(0)},[e]),h.useEffect(()=>{if(p){r&&r();return}const T=f[x];if(w>=T.length){if(x>=f.length-1){y(!0);return}const M=setTimeout(()=>{k(E=>E+1),I(0)},t);return()=>clearTimeout(M)}const j=setTimeout(()=>{b(M=>{const E=[...M];return E[x]=T.substring(0,w+1),E}),I(M=>M+1)},o);return()=>clearTimeout(j)},[f,x,w,p,r,t,o]);const C=T=>{if(!T||typeof T!="string")return T;const j=T.split("|");return j.length===1?T:j.map((M,E)=>n.jsxs(h.Fragment,{children:[M,E<j.length-1&&n.jsx("br",{})]},E))};return n.jsx(n.Fragment,{children:m.map((T,j)=>n.jsxs(h.Fragment,{children:[C(T),a&&j===x&&!p&&n.jsx(g,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:l,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...c})]},j))})},cf=({text:e,duration:o=500,direction:t="up",stagger:r=50,sequential:a=!1,textStyle:l,as:c,wordProps:d,textComponent:i,...u})=>{const[g,f]=h.useState(e),[m,b]=h.useState("entering"),[p,y]=h.useState(0),x=i||s.Text,k=h.useRef(null),w=h.useRef(null);h.useEffect(()=>{e===g&&m==="visible"||e!==g&&(m==="entering"||m==="visible"?(k.current=e,b("exiting")):m==="exiting"&&(k.current=e))},[e,g,m]);const{lines:I,totalWordCount:C}=h.useMemo(()=>{const $=g.split("|").map(B=>B.trim().split(/\s+/).filter(A=>A.length>0)),_=$.reduce((B,A)=>B+A.length,0);return{lines:$,totalWordCount:_}},[g]),T=h.useMemo(()=>a?C*(o+r):(C-1)*r+o,[C,o,r,a]),j=h.useMemo(()=>a?C*(o+r):(C-1)*r+o,[C,o,r,a]);h.useEffect(()=>(w.current&&clearTimeout(w.current),m==="entering"?w.current=setTimeout(()=>{b("visible")},T+50):m==="exiting"&&(w.current=setTimeout(()=>{k.current!==null&&(f(k.current),k.current=null),y(W=>W+1),b("entering")},j+50)),()=>{w.current&&clearTimeout(w.current)}),[m,T,j]);const{style:M,...E}=d||{},P=t==="up",L=W=>a?W*(o+r):W*r,S=h.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",lineHeight:"normal",...l}),[l]),D=h.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),H=h.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let V=0;return n.jsx(s.Element,{as:"span",style:S,...u,children:n.jsx("span",{style:D,children:I.map((W,$)=>n.jsx("span",{style:H,children:W.map((_,B)=>{const A=V++,F=L(A),v=B===W.length-1;let O;const N=`${o}ms`,K=`${F}ms`;m==="entering"?O=P?s.Animation.slideInUp({duration:N,delay:K,timingFunction:"ease-out",fillMode:"both"}):s.Animation.slideInDown({duration:N,delay:K,timingFunction:"ease-out",fillMode:"both"}):m==="exiting"&&(O=P?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:N,delay:K,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:N,delay:K,timingFunction:"ease-in",fillMode:"both"});const Q={...M,display:"inline-block",marginRight:v?0:"0.25em",transform:m==="visible"?"translateY(0)":void 0,opacity:m==="visible"?1:void 0};return n.jsx(x,{as:"span",animate:O,...E,...Q,children:_},`${p}-${$}-${B}`)})},`line-${$}`))})})};function Xa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const dr=e=>{if(!e||typeof e!="string")return e;const o=e.split("|");return o.length===1?e:o.map((t,r)=>n.jsxs(h.Fragment,{children:[t,r<o.length-1&&n.jsx("br",{})]},r))},sf=({children:e,highlightText:o,highlightStyle:t="solid",highlightColor:r="theme-primary",highlightSecondaryColor:a,size:l="lg",views:c,highlightAnimate:d,animate:i,animationLoop:u=1,highlightAnimationLoop:g=1,highlightTypewriter:f=!1,highlightTypewriterDuration:m=3e3,highlightSlide:b=!1,highlightSlideDuration:p=500,highlightSlideStagger:y=50,highlightSlideSequential:x=!0,themeMode:k,...w})=>{const{ref:I,inView:C}=s.useInView(),{finalDisplayedText:T,activeHighlightTarget:j,highlightTypewriter:M,highlightSlide:E,highlightSlideDuration:P,highlightSlideStagger:L,highlightSlideSequential:S}=rf({children:e,highlightText:o,_isInView:C,highlightTypewriter:f,highlightSlide:b,highlightSlideDuration:p,highlightSlideStagger:y,highlightSlideSequential:x,...w}),D=nf[l],H=af[t](r,a),V=(F,v)=>F&&(Array.isArray(F)?F.map(O=>({...O,iterationCount:v.toString()})):{...F,iterationCount:v.toString()}),W=V(i,u),$=V(d,g),_=typeof T=="string"?T:typeof e=="string"?e:"",B={ref:I,animate:C?W:void 0,as:"h1",fontSize:D},A=F=>!C&&(M||E)?n.jsx("span",{style:{opacity:0},children:F}):M?n.jsx(lf,{text:F,typingSpeed:Math.max(30,m/(F.length*10)),cursorColor:"currentColor",...H}):E?n.jsx(cf,{text:F,duration:P,stagger:L,sequential:S,direction:"up",fontSize:D,wordProps:H}):dr(F);if(typeof _=="string"&&j){const F=Array.isArray(j)?new RegExp(`(${j.map(K=>Xa(String(K))).join("|")})`,"gi"):new RegExp(`(${Xa(String(j))})`,"gi"),v=[];let O=0,N;for(;N=F.exec(_);)N.index>O&&v.push(_.substring(O,N.index)),v.push({highlight:!0,text:N[0]}),O=N.index+N[0].length;return O<_.length&&v.push(_.substring(O)),n.jsx(s.Element,{...B,...c==null?void 0:c.container,...w,children:v.map((K,Q)=>typeof K=="string"?n.jsx(s.Text,{as:"span",display:"inline",...c==null?void 0:c.text,children:dr(K)},`text-${Q}`):n.jsx(s.Text,{as:"span",display:"inline",animate:C?$:void 0,...E?{}:H,...c==null?void 0:c.highlight,children:A(K.text)},`highlight-${Q}`))})}return t&&!j?n.jsx(s.Element,{...B,...w,...c==null?void 0:c.container,children:n.jsx(s.Text,{as:"span",display:"inline",animate:C?$:void 0,...E?{}:H,...c==null?void 0:c.highlight,children:A(_)})}):n.jsx(s.Text,{...B,...w,...c==null?void 0:c.container,...c==null?void 0:c.text,children:dr(_)})},df=e=>n.jsx(sf,{...e}),uf=({items:e,shape:o,variant:t,onToggleChange:r})=>{const{activeToggles:a,setActiveToggles:l}=Ca();return n.jsx(Ia,{items:e,shape:o,variant:t,activeToggles:a,setActiveToggles:l,onToggleChange:r})},gf=({items:e,onChange:o})=>{const[t,r]=h.useState(e),[a,l]=h.useState(null),[c,d]=h.useState(null),i=h.useRef({x:0,y:0}),u=h.useRef([]),g=h.useCallback((b,p)=>{b.preventDefault(),document.body.style.cursor="grabbing";const y="touches"in b?b.touches[0].clientX:b.clientX,x="touches"in b?b.touches[0].clientY:b.clientY;i.current={x:y,y:x},d(p),l(t[p])},[t]),f=h.useCallback(b=>{if(c===null)return;const p="touches"in b?b.touches[0].clientX:b.clientX,y="touches"in b?b.touches[0].clientY:b.clientY,x=u.current[c];if(!x)return;const k=p-i.current.x,w=y-i.current.y;x.style.transform=`translate(${k}px, ${w}px)`,x.style.zIndex="1000";const I=u.current.findIndex((C,T)=>{if(!C||T===c)return!1;const j=C.getBoundingClientRect();return y>=j.top&&y<=j.bottom});if(I!==-1&&I!==c){const C=[...t],[T]=C.splice(c,1);C.splice(I,0,T),r(C),d(I),o==null||o(C),i.current={x:p,y}}},[c,t,o]),m=h.useCallback(()=>{document.body.style.cursor="",u.current.forEach(b=>{b&&(b.style.transform="",b.style.zIndex="")}),d(null),l(null)},[c]);return h.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:a,draggedIndex:c,itemRefs:u,handleDragStart:g}},hf=({items:e,renderItem:o,containerProps:t,itemProps:r,draggedIndex:a,itemRefs:l,handleDragStart:c,views:d,themeMode:i})=>n.jsx(s.View,{overflow:"hidden",position:"relative",...t,...d==null?void 0:d.container,children:e.map((u,g)=>n.jsx(s.View,{ref:f=>l.current[g]=f,onMouseDown:f=>c(f,g),onTouchStart:f=>c(f,g),position:"relative",cursor:"grab",transition:"transform 0.2s",...r,...d==null?void 0:d.item,children:o?o(u,g):u},g))}),Ka=e=>{const{items:o,draggedIndex:t,itemRefs:r,handleDragStart:a}=gf(e);return n.jsx(hf,{...e,items:o,draggedIndex:t,itemRefs:r,handleDragStart:a})},ff=Ka,mf=({onFileSelect:e,onMultipleFileSelect:o,validateFile:t,accept:r,multiple:a,disabled:l,previewUrl:c})=>{const[d,i]=h.useState(!1),[u,g]=h.useState(null),f=h.useRef(null),m=c!==void 0?c:u;h.useEffect(()=>()=>{u&&URL.revokeObjectURL(u)},[u]);const b=h.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!l&&i(!0)},[l]),p=h.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!l&&i(!1)},[l]),y=h.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!l&&i(!0)},[l]),x=h.useCallback(C=>{if(!C||C.length===0)return;const T=Array.from(C);if(!a&&T.length>0){const j=T[0];if(j.type.startsWith("image/")){const M=URL.createObjectURL(j);g(E=>(E&&URL.revokeObjectURL(E),M))}else g(null)}a?o&&o(T):T.length>0&&e&&e(T[0])},[a,o,e]),k=h.useCallback(C=>{C.preventDefault(),C.stopPropagation(),i(!1),!l&&C.dataTransfer.files&&C.dataTransfer.files.length>0&&(x(C.dataTransfer.files),C.dataTransfer.clearData())},[l,x]),w=h.useCallback(()=>{var C;l||(C=f.current)==null||C.click()},[l]),I=h.useCallback(C=>{x(C.target.files),C.target.value&&(C.target.value="")},[x]);return{isDragActive:d,handleDragEnter:b,handleDragLeave:p,handleDragOver:y,handleDrop:k,handleClick:w,handleFileChange:I,inputRef:f,preview:m}},pf={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)"}},Qa=({files:e,sandboxId:o,onRemove:t,layout:r="inline",maxHeight:a="120px",showPreviews:l=!1,views:c={}})=>{if(e.length===0)return null;const d=h.useCallback(i=>i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`,[]);return n.jsx(s.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:a,overflowY:"auto",...c==null?void 0:c.container,children:e.map((i,u)=>{const g=URL.createObjectURL(i)||(i==null?void 0:i.path)||(i==null?void 0:i.url)||"",f=i.type.startsWith("image/"),m=i.type.startsWith("video/"),b=i.type.startsWith("audio/");return n.jsx(s.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:l&&n.jsxs(xe,{children:[n.jsxs(xe.Trigger,{children:[f&&n.jsx(s.Image,{src:g,alt:i.name,width:"60px",height:"60px",objectFit:"cover"}),m&&n.jsx(s.View,{as:"video",src:g,alt:i.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),b&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(_o,{widthHeight:24,color:"color-black"})}),!f&&!m&&!b&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(io,{widthHeight:24,color:"color-black"})}),t&&n.jsx(s.Button,{...pf,onClick:p=>{p.stopPropagation(),t(u)},"aria-label":`Remove ${i.name}`,children:"×"})]}),n.jsxs(xe.Content,{children:[f&&n.jsx(s.Image,{src:g,alt:i.name,maxWidth:"100%"}),m&&n.jsx(s.View,{as:"video",src:g,controls:!0,maxWidth:"100%"}),b&&n.jsx(s.View,{as:"audio",src:g,controls:!0,width:"100%"}),n.jsxs(s.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...c==null?void 0:c.name,children:[i.name," (",d(i.size),")"]})]})]})},u)})})},bf=({children:e,text:o="Drop files here or click to upload",textProps:t,containerProps:r,disabled:a,accept:l,multiple:c,isDragActive:d,handleDragEnter:i,handleDragLeave:u,handleDragOver:g,handleDrop:f,handleClick:m,handleFileChange:b,inputRef:p,preview:y,imageProps:x,selectedFiles:k,onRemove:w})=>n.jsxs(s.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:a?"not-allowed":"pointer",opacity:a?.6:1,onClick:m,onDragEnter:i,onDragLeave:u,onDragOver:g,onDrop:f,transition:"all 0.2s ease-in-out",overflow:"hidden",position:"relative",padding:16,...r,children:[n.jsx("input",{type:"file",ref:p,onChange:b,accept:l,multiple:c,style:{display:"none"},disabled:a}),y&&!c?n.jsxs(s.View,{width:"100%",height:"200px",position:"relative",children:[n.jsx(s.Image,{src:y,alt:"Preview",width:"100%",height:"100%",objectFit:"contain",...x}),n.jsx(s.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:n.jsx(s.Text,{color:"white",fontWeight:600,children:"Click to replace"})})]}):n.jsxs(s.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[e||n.jsxs(s.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[n.jsx(zt,{widthHeight:40,color:d?"primary":"rgba(0,0,0,0.4)"}),n.jsx(s.Text,{marginTop:16,color:d?"primary":"rgba(0,0,0,0.6)",fontWeight:500,textAlign:"center",...t,children:o})]}),c&&k&&k.length>0&&n.jsx(s.View,{marginTop:16,width:"100%",children:n.jsx(Qa,{files:k,onRemove:w||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),yf=e=>{const o=mf(e);return n.jsx(bf,{...e,...o})},xf=(e=!1)=>{const[o,t]=h.useState(e),[r,a]=h.useState(null);return h.useEffect(()=>{const l=i=>{!i.composedPath().some(f=>(f==null?void 0:f.id)==="dropdown-menu"||(f==null?void 0:f.id)==="dropdown-trigger")&&o&&(t(!1),a(null))},c=()=>{o&&(t(!1),a(null))},d=i=>{i.key==="Escape"&&o&&(t(!1),a(null))};return document.addEventListener("mousedown",l),window.addEventListener("resize",c),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",l),window.removeEventListener("resize",c),document.removeEventListener("keydown",d)}},[o]),{isOpen:o,setIsOpen:t,activeSubmenuId:r,setActiveSubmenuId:a}},kf={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Cf={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"}},wf={hover:{backgroundColor:"color-gray-100"}},Ja=h.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),If=({children:e,value:o})=>n.jsx(Ja.Provider,{value:o,children:e}),ur=()=>{const e=h.useContext(Ja);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},Za=({children:e,views:o,...t})=>{const{isOpen:r,setIsOpen:a,triggerRef:l}=ur(),c=d=>{d.stopPropagation(),a(!r)};return n.jsx(s.View,{ref:l,id:"dropdown-trigger",onClick:c,cursor:"pointer",position:"relative",display:"inline-block",...o==null?void 0:o.container,...t,children:e})},gr=({items:e,side:o="bottom",align:t="start",views:r,...a})=>{const{isOpen:l,variant:c,triggerRef:d}=ur(),i=h.useRef(null),{ref:u,relation:g}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[f,m]=h.useState({x:0,y:0,placement:o});if(h.useEffect(()=>{d.current&&u&&(u.current=d.current)},[d,u,l]),h.useEffect(()=>{if(l&&i.current&&d.current){const y=d.current.getBoundingClientRect();let x=o;g&&(o==="bottom"&&g.space.vertical==="top"?x="top":o==="top"&&g.space.vertical==="bottom"?x="bottom":o==="right"&&g.space.horizontal==="left"?x="left":o==="left"&&g.space.horizontal==="right"&&(x="right"));let k=0,w=0;switch(x){case"bottom":k=t==="start"?y.left:t==="end"?y.right-180:y.left+y.width/2-90,w=y.bottom+8;break;case"top":k=t==="start"?y.left:t==="end"?y.right-180:y.left+y.width/2-90,w=y.top-8;break;case"right":k=y.right+8,w=t==="start"?y.top:t==="end"?y.bottom-100:y.top+y.height/2-50;break;case"left":k=y.left-8,w=t==="start"?y.top:t==="end"?y.bottom-100:y.top+y.height/2-50;break}m({x:k,y:w,placement:x})}},[l,o,t,d,g]),!l)return null;const p=(()=>{const y={position:"fixed",left:f.x,top:f.y,zIndex:1e3};switch(f.placement){case"top":return{...y,transform:"translateY(-100%)"};case"left":return{...y,transform:"translateX(-100%)"};case"bottom":case"right":default:return y}})();return n.jsx(s.View,{ref:i,id:"dropdown-menu",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:p,...Cf[c],...r==null?void 0:r.menu,...a,children:e.map((y,x)=>y.divider?n.jsx(el,{views:r},`divider-${x}`):n.jsx(Ra,{item:y,views:r},y.id))})},Ra=({item:e,views:o,...t})=>{const{activeSubmenuId:r,setActiveSubmenuId:a,size:l}=ur(),[c,d]=h.useState(!1),i=e.items&&e.items.length>0,u=r===e.id,g=h.useRef(null),f=()=>{d(!0),i&&a(e.id)},m=()=>{d(!1)},b=p=>{p.stopPropagation(),!e.disabled&&!i&&e.onClick&&e.onClick()};return n.jsxs(s.View,{ref:g,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...kf[l],_hover:e.disabled?{}:wf.hover,backgroundColor:c&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:f,onMouseLeave:m,onClick:b,...o==null?void 0:o.item,...t,children:[e.icon&&n.jsx(s.View,{marginRight:8,...o==null?void 0:o.icon,children:e.icon}),n.jsx(s.View,{flexGrow:1,children:e.label}),i&&n.jsx(s.View,{marginLeft:8,...o==null?void 0:o.submenuIndicator,children:n.jsx(ce,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),u&&i&&n.jsx(gr,{items:e.items||[],side:"right",align:"start",views:o})]})},el=({views:e,...o})=>n.jsx(s.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...o}),Tf=({trigger:e,items:o,side:t="bottom",align:r="start",views:a,themeMode:l,...c})=>n.jsxs(s.View,{position:"relative",display:"inline-block",...a==null?void 0:a.container,...c,children:[n.jsx(Za,{views:a,children:e}),n.jsx(gr,{items:o,side:t,align:r,views:a})]}),jo=({trigger:e,items:o,size:t="md",variant:r="default",side:a="bottom",align:l="start",defaultOpen:c=!1,views:d,...i})=>{const{isOpen:u,setIsOpen:g,activeSubmenuId:f,setActiveSubmenuId:m}=xf(c),b=h.useRef(null);return n.jsx(If,{value:{isOpen:u,setIsOpen:g,activeSubmenuId:f,setActiveSubmenuId:m,size:t,variant:r,triggerRef:b},children:n.jsx(Tf,{trigger:e,items:o,side:a,align:l,views:d,...i})})};jo.Trigger=Za,jo.Content=gr,jo.Item=Ra,jo.Divider=el;const jf=e=>{const{value:o,defaultValue:t="",onChange:r,onChangeComplete:a,isOpen:l,onOpen:c,onClose:d,closeOnSelect:i=!0,maxRecentColors:u=8,showRecentColors:g=!0}=e,[f,m]=h.useState(l??!1),[b,p]=h.useState(o??t),[y,x]=h.useState(""),[k,w]=h.useState([]),I=h.useRef(null),C=h.useRef(null);h.useEffect(()=>{o!==void 0&&p(o)},[o]),h.useEffect(()=>{l!==void 0&&m(l)},[l]),h.useEffect(()=>{if(g){const S=localStorage.getItem("colorPicker-recentColors");if(S)try{w(JSON.parse(S))}catch{}}},[g]),h.useEffect(()=>{const S=D=>{f&&I.current&&C.current&&!I.current.contains(D.target)&&!C.current.contains(D.target)&&L()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[f]);const T=h.useCallback(S=>{g&&w(D=>{const H=D.filter(W=>W!==S),V=[S,...H].slice(0,u);return localStorage.setItem("colorPicker-recentColors",JSON.stringify(V)),V})},[g,u]),j=h.useCallback(()=>{const S=!f;m(S),S?c==null||c():d==null||d()},[f,c,d]),M=h.useCallback(S=>{p(S),T(S),r==null||r(S),a==null||a(S),i&&(m(!1),d==null||d())},[r,a,i,d,T]),E=h.useCallback(S=>{x(S)},[]),P=h.useCallback(()=>{y&&(M(y),x(""))},[y,M]),L=h.useCallback(()=>{m(!1),d==null||d()},[d]);return{isOpen:f,selectedColor:b,recentColors:k,customColor:y,handleToggle:j,handleColorSelect:M,handleCustomColorChange:E,handleCustomColorSubmit:P,handleClose:L,triggerRef:I,dropdownRef:C}},no={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"}},Sf={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"}},Mf={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},zf={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"}},Ef=[{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"}],Vf=({id:e,name:o,label:t,placeholder:r="Select a color",helperText:a,views:l={},size:c="md",shape:d="default",variant:i="default",error:u=!1,isDisabled:g=!1,isReadOnly:f=!1,predefinedColors:m=Ef,showCustomInput:b=!0,showRecentColors:p=!0,isOpen:y,selectedColor:x,recentColors:k,customColor:w,handleToggle:I,handleColorSelect:C,handleCustomColorChange:T,handleCustomColorSubmit:j,triggerRef:M,dropdownRef:E,onChange:P,...L})=>{const{getColor:S}=s.useTheme(),D={...no.container,...l==null?void 0:l.container},H={...no.trigger,...Sf[c],...Mf[d],...zf[i],...u&&{borderColor:"color-red-500"},...g&&{opacity:.6,cursor:"not-allowed"},...l==null?void 0:l.trigger},V={...no.dropdown,...l==null?void 0:l.dropdown},W={...no.colorGrid,...l==null?void 0:l.colorGrid},$={...no.recentColors,...l==null?void 0:l.recentColors},_=x||"color-gray-200";return n.jsxs(s.View,{...D,...L,children:[t&&n.jsx(s.Text,{fontSize:c==="xs"?"12px":c==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...l==null?void 0:l.label,children:t}),n.jsxs(s.View,{ref:M,onClick:g||f?void 0:I,...H,children:[n.jsxs(s.Horizontal,{alignItems:"center",gap:8,children:[n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:_,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),n.jsx(s.Text,{color:x?"color-gray-800":"color-gray-500",fontSize:"inherit",children:x||r})]}),!f&&!g&&n.jsx(ce,{widthHeight:16,color:"color-gray-500",orientation:y?"up":"down"})]}),y&&n.jsxs(s.View,{ref:E,...V,children:[n.jsx(s.View,{...W,children:m.map((B,A)=>n.jsx(s.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:B.value,borderWidth:"2px",borderStyle:"solid",borderColor:x===B.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>C(B.value),title:B.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...l==null?void 0:l.colorSwatch},A))}),b&&n.jsxs(s.View,{...no.customInput,...l==null?void 0:l.customInput,children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",marginBottom:"8px",children:[n.jsx("input",{type:"color",value:w||"#000000",onChange:B=>{const A=B.target.value;T(A),C(A)},style:{width:"40px",height:"32px",border:"1px solid #d1d5db",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},title:"Pick a color"}),n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",children:"Use native color picker"})]}),n.jsx(ko,{placeholder:"Enter hex color (e.g., #ff0000)",value:w,onChange:B=>T(B.target.value),onKeyPress:B=>{B.key==="Enter"&&j()},size:"sm",right:w&&n.jsx(s.View,{width:"16px",height:"16px",borderRadius:"2px",backgroundColor:w,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:j})})]}),p&&k.length>0&&n.jsxs(s.View,{...$,children:[n.jsx(s.Text,{fontWeight:"500",color:"color-gray-600",marginBottom:"8px",children:"Recent Colors"}),n.jsx(s.Horizontal,{gap:8,flexWrap:"wrap",children:k.map((B,A)=>n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:B,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:()=>C(B),title:B,_hover:{transform:"scale(1.1)"}},A))})]})]}),a&&n.jsx(s.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...l==null?void 0:l.helperText,children:a})]})},Pf=e=>{const o=jf(e);return n.jsx(Vf,{...o,...e})},Wf=e=>{const o=Ma(e);return n.jsx(za,{...o,...e})},_f=e=>{const o=ja(e);return n.jsx(Sa,{...o,...e})},$f=(e=null,o=null)=>{const[t,r]=h.useState(e),[a,l]=h.useState(o),c=i=>a===i,d=i=>{l(u=>u===i?null:i)};return h.useEffect(()=>{const i=g=>{!g.composedPath().some(b=>(b==null?void 0:b.id)==="menubar-content"||(b==null?void 0:b.id)==="menubar-trigger")&&a!==null&&l(null)},u=g=>{g.key==="Escape"&&a!==null&&l(null)};return document.addEventListener("mousedown",i),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",u)}},[a]),{activeMenuId:t,setActiveMenuId:r,openMenuId:a,setOpenMenuId:l,isMenuOpen:c,toggleMenu:d}},ol={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},Lf={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"}},Df={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},st={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},tl=h.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),dt=()=>h.useContext(tl),Bf=({value:e,children:o})=>n.jsx(tl.Provider,{value:e,children:o}),rl=({children:e,orientation:o="horizontal",size:t="md",variant:r="default",views:a,...l})=>{const c=o==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(c,{role:"menubar","aria-orientation":o,...Df[o],...Lf[r],...a==null?void 0:a.container,...l,children:e})},nl=({children:e,id:o,disabled:t=!1,views:r})=>{const{orientation:a}=dt(),l=a==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(l,{role:"none",position:"relative",opacity:t?.5:1,pointerEvents:t?"none":"auto",...r==null?void 0:r.menu,children:h.Children.map(e,c=>h.isValidElement(c)?h.cloneElement(c,{...c.props,menuId:o}):c)})},al=({children:e,menuId:o,disabled:t=!1,views:r})=>{const{activeMenuId:a,setActiveMenuId:l,toggleMenu:c,isMenuOpen:d,size:i,triggerRefs:u}=dt(),g=h.useRef(null),f=a===o,m=d(o);h.useEffect(()=>(g.current&&o&&(u.current[o]=g.current),()=>{o&&delete u.current[o]}),[o,u]);const b=()=>{t||(l(o),c(o))};return n.jsx(s.View,{ref:g,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":m,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...ol[i],...f?st.active:{},...t?st.disabled:{},_hover:t?{}:st.hover,onClick:b,...r==null?void 0:r.trigger,children:e})},ll=({children:e,menuId:o,views:t})=>{const{isMenuOpen:r,orientation:a,triggerRefs:l}=dt(),c=h.useRef(null),[d,i]=h.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),u=r(o);if(h.useEffect(()=>{if(u&&c.current&&o&&l.current[o]){const f=c.current.getBoundingClientRect(),m=l.current[o].getBoundingClientRect(),b=Math.max(f.width||200,200),p=Math.max(f.height||150,150),y=window.innerWidth,x=window.innerHeight,k={top:m.top,right:y-m.right,bottom:x-m.bottom,left:m.left},w=a==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=p+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=p+8,x:m.left,y:m.top-p-8},{placement:"right",space:k.right,fits:k.right>=b+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=b+8,x:m.left-b-8,y:m.top}]:[{placement:"right",space:k.right,fits:k.right>=b+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=b+8,x:m.left-b-8,y:m.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=p+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=p+8,x:m.left,y:m.top-p-8}],I=w.find(M=>M.fits);if(I){i({x:I.x,y:I.y,placement:I.placement});return}const C=w.reduce((M,E)=>E.space>M.space?E:M);let T=C.x,j=C.y;T+b>y&&(T=y-b-8),T<8&&(T=8),j+p>x&&(j=x-p-8),j<8&&(j=8),i({x:T,y:j,placement:C.placement})}},[u,a,o,l]),!u)return null;const g={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return n.jsx(s.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:g,...t==null?void 0:t.content,children:e})},cl=({children:e,icon:o,disabled:t=!1,onClick:r,views:a})=>{const{size:l}=dt(),c=()=>{t||!r||r()};return n.jsxs(s.View,{role:"menuitem",cursor:t?"not-allowed":"pointer",userSelect:"none",display:"flex",alignItems:"center",opacity:t?.5:1,...ol[l],_hover:t?{}:st.hover,onClick:c,...a==null?void 0:a.item,children:[o&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:o}),e]})},il=({views:e})=>n.jsx(s.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),Hf=({items:e,orientation:o,size:t,variant:r,views:a,themeMode:l})=>n.jsx(rl,{orientation:o,size:t,variant:r,views:a,children:e.map(c=>n.jsxs(nl,{id:c.id,disabled:c.disabled,views:a,children:[n.jsxs(al,{menuId:c.id,views:a,children:[c.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:c.icon}),c.label]}),c.items&&c.items.length>0&&n.jsx(ll,{menuId:c.id,views:a,children:c.items.map((d,i)=>d.separator?n.jsx(il,{views:a},`separator-${i}`):n.jsx(cl,{id:d.id,icon:d.icon,disabled:d.disabled,onClick:d.onClick,views:a,children:d.label},d.id))})]},c.id))}),Fe=({items:e,orientation:o="horizontal",size:t="md",variant:r="default",defaultActiveMenuId:a=null,defaultOpenMenuId:l=null,views:c,...d})=>{const{activeMenuId:i,setActiveMenuId:u,openMenuId:g,setOpenMenuId:f,isMenuOpen:m,toggleMenu:b}=$f(a,l),p=h.useRef({});return n.jsx(Bf,{value:{activeMenuId:i,setActiveMenuId:u,openMenuId:g,setOpenMenuId:f,isMenuOpen:m,toggleMenu:b,orientation:o,size:t,variant:r,triggerRefs:p},children:n.jsx(Hf,{items:e,orientation:o,size:t,variant:r,views:c,...d})})};Fe.Root=rl,Fe.Menu=nl,Fe.Trigger=al,Fe.Content=ll,Fe.Item=cl,Fe.Separator=il;const Af=(e,o,t)=>{const[r,a]=h.useState([]);return h.useEffect(()=>{a((()=>{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)),i=Math.min(o-1,d+t-3);i>=o-1&&(i=o-1,d=Math.max(2,i-(t-3))),d>2&&c.push("...");for(let u=d;u<=i;u++)c.push(u);i<o-1&&c.push("..."),c.push(o)}return c})())},[e,o,t]),{visiblePageNumbers:r}},ao={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"}}}},So={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"}}},Mo={rounded:{borderRadius:"4px"},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},Ff={backgroundColor:"color-blue-500",color:"color-white",_hover:{backgroundColor:"color-blue-600"}},ut={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},Of=({currentPage:e,totalPages:o,onPageChange:t,pageSize:r=10,pageSizeOptions:a=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"100 / page",value:100}],onPageSizeChange:l,showPageSizeSelector:c=!1,showPageInfo:d=!0,maxPageButtons:i=5,showFirstLastButtons:u=!1,size:g="md",variant:f="default",shape:m="rounded",visiblePageNumbers:b,views:p,...y})=>{const x=I=>{I<1||I>o||I===e||t(I)},k=I=>{l&&l(Number(I.target.value))},w=(I,C)=>{if(I==="...")return n.jsx(s.View,{display:"flex",alignItems:"center",justifyContent:"center",...ao[g],...p==null?void 0:p.ellipsis,children:"..."},`ellipsis-${C}`);const T=I===e;return n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:T?"default":"pointer",...ao[g],...So[f],...Mo[m],...T?Ff:{},onClick:()=>x(I),"aria-label":`Page ${I}`,"aria-current":T?"page":void 0,...T?p==null?void 0:p.activePageButton:p==null?void 0:p.pageButton,children:I},`page-${I}`)};return n.jsxs(s.Horizontal,{alignItems:"center",gap:8,...p==null?void 0:p.container,...y,children:[u&&n.jsxs(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...ao[g],...So[f],...Mo[m],...e===1?ut:{},onClick:()=>x(1),"aria-label":"First page",disabled:e===1,...p==null?void 0:p.navigationButton,children:[n.jsx(ce,{orientation:"left",widthHeight:16}),n.jsx(ce,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...ao[g],...So[f],...Mo[m],...e===1?ut:{},onClick:()=>x(e-1),"aria-label":"Previous page",disabled:e===1,...p==null?void 0:p.navigationButton,children:n.jsx(ce,{orientation:"left",widthHeight:16})}),b.map((I,C)=>w(I,C)),n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...ao[g],...So[f],...Mo[m],...e===o?ut:{},onClick:()=>x(e+1),"aria-label":"Next page",disabled:e===o,...p==null?void 0:p.navigationButton,children:n.jsx(ce,{orientation:"right",widthHeight:16})}),u&&n.jsxs(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...ao[g],...So[f],...Mo[m],...e===o?ut:{},onClick:()=>x(o),"aria-label":"Last page",disabled:e===o,...p==null?void 0:p.navigationButton,children:[n.jsx(ce,{orientation:"right",widthHeight:16}),n.jsx(ce,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),d&&n.jsxs(s.Text,{marginLeft:16,color:"color-gray-600",...p==null?void 0:p.pageInfo,children:["Page ",e," of ",o]}),c&&l&&n.jsx(s.View,{as:"select",marginLeft:16,padding:"4px 8px",borderRadius:"4px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",cursor:"pointer",value:r,onChange:k,...p==null?void 0:p.pageSizeSelector,children:a.map(I=>n.jsx("option",{value:I.value,children:I.label},I.value))})]})},vf=({currentPage:e,totalPages:o,onPageChange:t,pageSize:r=10,pageSizeOptions:a,onPageSizeChange:l,showPageSizeSelector:c=!1,showPageInfo:d=!0,maxPageButtons:i=5,showFirstLastButtons:u=!1,size:g="md",variant:f="default",shape:m="rounded",views:b,...p})=>{const{visiblePageNumbers:y}=Af(e,o,i);return n.jsx(Of,{currentPage:e,totalPages:o,onPageChange:t,pageSize:r,pageSizeOptions:a,onPageSizeChange:l,showPageSizeSelector:c,showPageInfo:d,maxPageButtons:i,showFirstLastButtons:u,size:g,variant:f,shape:m,visiblePageNumbers:y,views:b,...p})},Nf=({shape:e="linear",value:o=0,max:t=100,color:r="theme-primary",backgroundColor:a="color-gray-200",height:l,size:c,radius:d=4,strokeWidth:i=10,showLabel:u=!1,labelColor:g="theme-text-primary",animated:f=!0,animationDuration:m="0.5s",views:b,themeMode:p,...y})=>{const{getColor:x,themeMode:k}=s.useTheme(),w=p||k,C=Math.min(t,Math.max(0,o))/t*100,T=x(a,{themeMode:w}),j=x(r,{themeMode:w});if(e==="circle"){const E=c||(typeof l=="number"?l:100),P=(E-i)/2,L=2*Math.PI*P,S=L-C/100*L;return n.jsxs(s.View,{width:E,height:E,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...b==null?void 0:b.container,...y,children:[n.jsxs("svg",{width:E,height:E,viewBox:`0 0 ${E} ${E}`,style:{transform:"rotate(-90deg)"},children:[n.jsx("circle",{cx:E/2,cy:E/2,r:P,stroke:T,strokeWidth:i,fill:"transparent",...b==null?void 0:b.track}),n.jsx("circle",{cx:E/2,cy:E/2,r:P,stroke:j,strokeWidth:i,strokeDasharray:L,strokeDashoffset:S,strokeLinecap:"round",fill:"transparent",style:{transition:f?`stroke-dashoffset ${m} ease-in-out`:"none"},...b==null?void 0:b.indicator})]}),u&&n.jsx(s.View,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",children:n.jsxs(s.Text,{color:g,fontSize:`${E*.2}px`,fontWeight:"bold",...b==null?void 0:b.text,children:[Math.round(C),"%"]})})]})}const M=l||8;return n.jsx(s.View,{role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":t,width:"100%",height:M,backgroundColor:T,borderRadius:d,overflow:"hidden",...b==null?void 0:b.container,...y,children:n.jsx(s.View,{width:`${C}%`,height:"100%",backgroundColor:j,borderRadius:d,style:{transition:f?`width ${m} ease-in-out`:"none"},...b==null?void 0:b.bar})})},Uf=e=>n.jsx(Nf,{...e}),qf=(e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}))(),Gf={thin:"1px",medium:"2px",thick:"4px"},zo={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"}},Yf=({orientation:e="horizontal",variant:o="solid",thickness:t="thin",color:r,spacing:a="0px",label:l,decorative:c=!1,views:d,themeMode:i,...u})=>{const{themeMode:g}=s.useTheme(),f=r||"color-gray-200",m=qf[o],b=Gf[t],p=c?{"aria-hidden":!0}:{role:"separator","aria-orientation":e};return l&&e==="horizontal"?n.jsxs(s.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:a,...p,...u,children:[n.jsx(s.View,{height:"0px",flexGrow:1,borderTopWidth:b,borderTopStyle:m,borderTopColor:f,...zo.container,...d==null?void 0:d.container}),n.jsx(s.Text,{...zo.label,...d==null?void 0:d.label,children:l}),n.jsx(s.View,{height:"0px",flexGrow:1,borderTopWidth:b,borderTopStyle:m,borderTopColor:f,...zo.container,...d==null?void 0:d.container})]}):e==="horizontal"?n.jsx(s.View,{height:"0px",width:"100%",borderTopWidth:b,borderTopStyle:m,borderTopColor:f,padding:a,...zo.container,...p,...d==null?void 0:d.container,...u}):n.jsx(s.View,{width:"0px",height:"100%",borderLeftWidth:b,borderLeftStyle:m,borderLeftColor:f,padding:a,...zo.container,...p,...d==null?void 0:d.container,...u})},sl=e=>n.jsx(Yf,{...e}),Xf=sl,Kf=sl,Qf={xs:12,sm:14,md:16,lg:18,xl:20},Jf=({isSupported:e,isSharing:o,onShare:t,label:r,children:a,icon:l,size:c,isDisabled:d,isLoading:i,iconPosition:u,disableWhenUnsupported:g=!0,...f})=>{const m=c??"md",b=l??n.jsx(Mr,{widthHeight:Qf[m],strokeWidth:1.5,filled:!1}),p=!!d||!e&&g,y=!!i||o;return n.jsx($e,{...f,size:m,icon:b,iconPosition:u??"left",isDisabled:p,isLoading:y,onClick:t,children:a??r??"Share"})},dl=()=>typeof navigator>"u"?void 0:navigator,Zf=(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},Rf=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},e0=e=>{const{shareData:o,onClick:t,onUnsupported:r,onShareStart:a,onShareSuccess:l,onShareCancel:c,onShareError:d}=e,[i,u]=h.useState(!1),g=h.useMemo(()=>Zf(dl(),o),[o]),f=h.useCallback((...m)=>{t==null||t(...m);const b=dl();if(!b||typeof b.share!="function"){r==null||r();return}if(!i){if(typeof b.canShare=="function")try{if(!b.canShare(o)){r==null||r();return}}catch(p){d==null||d(p);return}u(!0),a==null||a();try{b.share(o).then(()=>{l==null||l()}).catch(p=>{if(Rf(p)==="AbortError"){c==null||c();return}d==null||d(p)}).finally(()=>{u(!1)})}catch(p){u(!1),d==null||d(p)}}},[i,t,c,d,a,l,r,o]);return{isSupported:g,isSharing:i,handleShare:f}},o0=e=>{const{isSupported:o,isSharing:t,handleShare:r}=e0(e),{shareData:a,onShareStart:l,onShareSuccess:c,onShareCancel:d,onShareError:i,onUnsupported:u,onClick:g,...f}=e;return n.jsx(Jf,{...f,isSupported:o,isSharing:t,onShare:r})},t0=({label:e,status:o="default",views:t,themeMode:r,...a})=>{const{themeMode:l}=s.useTheme(),c=Lr();return n.jsxs(s.Horizontal,{alignItems:"center",gap:8,role:"status-indicator",...t==null?void 0:t.container,...a,children:[n.jsx(s.View,{role:"status-dot",width:"8px",height:"8px",borderRadius:"50%",...c[o].indicator,...t==null?void 0:t.indicator}),e&&n.jsx(s.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...c[o].label,...t==null?void 0:t.label,children:e})]})},r0=e=>n.jsx(t0,{...e}),n0=(e=!0,o,t,r)=>{const{on:a}=s.useResponsive(),l=a("mobile"),[c,d]=h.useState(o!==void 0?o:e);return h.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:l}},a0={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},l0=(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"}}))(),c0={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},i0={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)"}},s0={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)"},ul=h.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),gt=()=>h.useContext(ul),d0=({value:e,children:o})=>n.jsx(ul.Provider,{value:e,children:o}),u0=({children:e,showToggleButton:o=!0,views:t,...r})=>{const{isExpanded:a,toggleExpanded:l,position:c}=gt();return n.jsx(s.Horizontal,{width:"100%",padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:"space-between",...t==null?void 0:t.header,...r,children:a?n.jsxs(s.Horizontal,{width:"100%",alignItems:"center",justifyContent:"space-between",children:[e,o&&n.jsx(s.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:l,"aria-label":a?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:n.jsx(ce,{orientation:c==="left"?"left":"right",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})]}):n.jsx(s.View,{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:o&&n.jsx(s.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:l,"aria-label":a?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:n.jsx(ce,{orientation:c==="left"?"right":"left",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})})})},g0=({children:e,views:o,...t})=>{const{isExpanded:r}=gt();return n.jsx(s.View,{flex:"1",width:"100%",overflowY:"auto",overflowX:"hidden",padding:r?"16px":"8px",...o==null?void 0:o.content,...t,children:e})},h0=({children:e,views:o,...t})=>{const{isExpanded:r}=gt();return n.jsx(s.View,{width:"100%",padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",...o==null?void 0:o.footer,...t,children:r?e:null})},f0=({children:e,position:o="left",size:t="md",variant:r="default",fixed:a=!1,hasBackdrop:l=!0,expandedWidth:c,collapsedWidth:d,breakpointBehavior:i="overlay",elevation:u="none",transitionPreset:g="normal",ariaLabel:f="Sidebar navigation",isExpanded:m,isMobile:b,collapse:p,views:y,themeMode:x,...k})=>{const w=a0[t],I=m?c||w.expandedWidth:d||w.collapsedWidth,C=!b||b&&i!=="hide",T=a||b&&i==="overlay"?"fixed":"relative",j=l&&b&&m&&i==="overlay";return n.jsxs(n.Fragment,{children:[j&&n.jsx(s.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:p,...y==null?void 0:y.backdrop}),C&&n.jsx(s.Vertical,{position:T,top:0,height:"100vh",width:I,zIndex:999,transition:s0[g],transform:b&&i==="overlay"&&!m?`translateX(${o==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":f,...l0[r],...c0[o],...i0[u],...y==null?void 0:y.container,...k,children:h.Children.map(e,M=>M)})]})},Eo=({children:e,position:o="left",size:t="md",variant:r="default",defaultExpanded:a=!0,expanded:l,onExpandedChange:c,fixed:d=!1,hasBackdrop:i=!0,showToggleButton:u=!0,expandedWidth:g,collapsedWidth:f,breakpoint:m=768,breakpointBehavior:b="overlay",views:p,...y})=>{const{isExpanded:x,toggleExpanded:k,expand:w,collapse:I,isMobile:C}=n0(a,l,c);return n.jsx(d0,{value:{isExpanded:x,toggleExpanded:k,expand:w,collapse:I,position:o,size:t,variant:r,views:p},children:n.jsx(f0,{position:o,size:t,variant:r,fixed:d,hasBackdrop:i,showToggleButton:u,expandedWidth:g,collapsedWidth:f,breakpoint:m,breakpointBehavior:b,isExpanded:x,isMobile:C,toggleExpanded:k,expand:w,collapse:I,views:p,...y,children:e})})};Eo.Header=u0,Eo.Content=g0,Eo.Footer=h0,Eo.useContext=gt;const m0=()=>({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)}}}),p0=(e,o,t,r=50,a=1/0,l=!1,c,d,i=10)=>{const[u,g]=h.useState(!1),[f,m]=h.useState([]),b=h.useRef(null),p=h.useRef(null),y=h.useRef(0),x=h.useRef([]),k=h.useRef(d||(typeof window<"u"?m0():null)),w=h.useCallback(()=>b.current?e==="horizontal"?b.current.offsetWidth:b.current.offsetHeight:0,[e]),I=h.useCallback(()=>{if(!c||!k.current)return null;const W=k.current.getItem(c);if(!W)return null;try{const $=JSON.parse(W);return Array.isArray($.sizes)?$.sizes:null}catch($){return console.warn("Failed to parse saved panel sizes:",$),null}},[c]),C=h.useCallback(()=>{if(!c||!k.current||f.length===0)return;const W=f.map($=>({id:$.id,size:$.size,collapsed:$.collapsed||!1}));k.current.setItem(c,JSON.stringify({sizes:W}))},[c,f]),T=h.useCallback((W,$,_,B,A)=>{m(F=>F.some(v=>v.id===W)?F:[...F,{id:W,size:$,minSize:_??r,maxSize:B??a,collapsible:A??l,collapsed:!1}])},[r,a,l]),j=h.useCallback(W=>{m($=>$.filter(_=>_.id!==W))},[]),M=h.useCallback(W=>{const $=f.find(_=>_.id===W);return $?$.size:0},[f]),E=h.useCallback((W,$)=>{m(_=>_.map(B=>B.id===W?{...B,size:$}:B))},[]),P=h.useCallback(W=>{const $=f.find(_=>_.id===W);return $?!!$.collapsed:!1},[f]),L=h.useCallback(W=>{m($=>{const _=$.findIndex(v=>v.id===W);if(_===-1)return $;const B=$[_];if(!B.collapsible)return $;const A={...B,collapsed:!B.collapsed},F=[...$];return F[_]=A,F})},[]),S=h.useCallback((W,$)=>{p.current=W,y.current=$,x.current=f.map(_=>_.size),g(!0)},[f]),D=h.useCallback(W=>{if(!u||!p.current)return;const $=p.current,_=W-y.current;let B=-1;const A=$.match(/\d+$/);if(A&&(B=parseInt(A[0],10)-1),B===-1&&f.length>=2&&(B=0),B<0||B>=f.length-1)return;const F=f[B],v=f[B+1];if(F.collapsed||v.collapsed)return;let O=x.current[B]+_,N=x.current[B+1]-_;O=Math.max(F.minSize??r,Math.min(F.maxSize??a,O)),N=Math.max(v.minSize??r,Math.min(v.maxSize??a,N)),m(K=>K.map((Q,G)=>G===B?{...Q,size:O}:G===B+1?{...Q,size:N}:Q))},[u,f,e,r,a]),H=h.useCallback(()=>{u&&t&&t(f.map(W=>W.size)),p.current=null,g(!1),c&&C()},[u,f,t,c,C]),V=h.useCallback(W=>{if(!u||!p.current)return;const $=p.current;let _=-1;const B=$.match(/\d+$/);if(B&&(_=parseInt(B[0],10)-1),_===-1&&f.length>=2&&(_=0),_<0||_>=f.length-1)return;let A=0;e==="horizontal"?(W.key==="ArrowLeft"&&(A=-i),W.key==="ArrowRight"&&(A=i),W.key==="Home"&&(A=-100),W.key==="End"&&(A=100)):(W.key==="ArrowUp"&&(A=-i),W.key==="ArrowDown"&&(A=i),W.key==="Home"&&(A=-100),W.key==="End"&&(A=100)),A!==0&&(W.preventDefault(),D(y.current+A)),W.key==="Escape"&&(m(F=>F.map((v,O)=>({...v,size:x.current[O]}))),H())},[u,f,e,D,H,i]);return h.useEffect(()=>{const W=B=>{if(!u)return;const A=e==="horizontal"?B.clientX:B.clientY;D(A)},$=B=>{if(!u||B.touches.length===0)return;const A=B.touches[0],F=e==="horizontal"?A.clientX:A.clientY;D(F)},_=()=>{u&&H()};return u&&(document.addEventListener("mousemove",W),document.addEventListener("touchmove",$),document.addEventListener("mouseup",_),document.addEventListener("touchend",_),document.addEventListener("keydown",V),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("touchmove",$),document.removeEventListener("mouseup",_),document.removeEventListener("touchend",_),document.removeEventListener("keydown",V),document.body.style.cursor="",document.body.style.userSelect=""}},[u,e,D,H,V]),h.useEffect(()=>{if(f.length!==0){if(c){const W=I();if(W){m($=>$.map(_=>{const B=W.find(A=>A.id===_.id);return B?{..._,size:B.size,collapsed:B.collapsed||!1}:_}));return}}if(!o){const $=w()/f.length;m(_=>_.map(B=>({...B,size:$})))}}},[f.length,o,w,c,I]),h.useEffect(()=>{if(!o||o.length===0||f.length===0)return;const W=w(),$=o.map(_=>typeof _=="string"&&_.endsWith("%")?parseFloat(_)/100*W:typeof _=="number"?_:parseFloat(_));m(_=>_.map((B,A)=>({...B,size:A<$.length?$[A]:B.size})))},[o,f.length,w]),h.useEffect(()=>{f.length>0&&c&&!u&&C()},[f,c,u,C]),{isResizing:u,setIsResizing:g,containerRef:b,panels:f,registerPanel:T,unregisterPanel:j,getPanelSize:M,setPanelSize:E,isPanelCollapsed:P,togglePanelCollapse:L,startResize:S,onResize:D,endResize:H}},b0={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},y0=(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],x0=(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"}}}))(),ht={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},gl=h.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),hl=()=>h.useContext(gl),k0=({value:e,children:o})=>n.jsx(gl.Provider,{value:e,children:o}),C0=({children:e,id:o,defaultSize:t,minSize:r,maxSize:a,collapsible:l,defaultCollapsed:c,onCollapseChange:d,views:i,...u})=>{const{orientation:g,registerPanel:f,unregisterPanel:m,getPanelSize:b,isPanelCollapsed:p,togglePanelCollapse:y}=hl(),x=typeof t=="string"&&t.endsWith("%")?0:typeof t=="number"?t:0;h.useEffect(()=>(f(o,x,r,a,l),()=>m(o)),[o,x,r,a,l,f,m]);const k=b(o),w=p(o);return h.useEffect(()=>{d&&w!==void 0&&d(w)},[w,d]),h.useEffect(()=>{l&&c&&!w&&y(o)},[o,l,c,w,y]),w?n.jsx(s.View,{flex:"0 0 auto",width:g==="horizontal"?"10px":"100%",height:g==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>y(o),"aria-label":`Expand panel ${o}`,role:"button",tabIndex:0,...i==null?void 0:i.collapsedPanel,...u}):n.jsx(s.View,{flex:k>0?"0 0 auto":"1",width:g==="horizontal"?`${k}px`:"100%",height:g==="vertical"?`${k}px`:"100%",overflow:"auto",...i==null?void 0:i.panel,...u,children:e})},w0=({id:e,position:o="both",disabled:t=!1,withVisualIndicator:r=!0,withCollapseButton:a=!1,collapseTarget:l,views:c,...d})=>{const{orientation:i,size:u,variant:g,startResize:f,isPanelCollapsed:m,togglePanelCollapse:b}=hl(),y=(()=>{if(l)return l;const T=e.match(/\d+$/);if(!T)return"";const j=parseInt(T[0],10);return isNaN(j)?"":`panel${j}`})(),x=m(y),k=T=>{if(t)return;T.preventDefault();const j=i==="horizontal"?T.clientX:T.clientY;f(e,j)},w=T=>{if(t||T.touches.length===0)return;T.preventDefault();const j=T.touches[0],M=i==="horizontal"?j.clientX:j.clientY;f(e,M)},I=T=>{t||(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f(e,0))},C=T=>{T.stopPropagation(),y&&b(y)};return n.jsxs(s.View,{role:"separator","aria-orientation":i,"aria-valuemin":0,"aria-valuemax":100,tabIndex:t?-1:0,cursor:i==="horizontal"?"col-resize":"row-resize",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",...y0(u,i),...x0[g],onMouseDown:k,onTouchStart:w,onKeyDown:I,opacity:t?.5:1,pointerEvents:t?"none":"auto",...c==null?void 0:c.handle,...d,children:[r&&n.jsx(s.View,{display:"flex",alignItems:"center",justifyContent:"center",width:i==="horizontal"?"100%":"auto",height:i==="vertical"?"100%":"auto",pointerEvents:"none",...c==null?void 0:c.handleIcon,children:i==="horizontal"?n.jsxs(s.Horizontal,{gap:1,children:[n.jsx(s.View,{...ht.horizontal}),n.jsx(s.View,{...ht.horizontal})]}):n.jsxs(s.Vertical,{gap:1,children:[n.jsx(s.View,{...ht.vertical}),n.jsx(s.View,{...ht.vertical})]})}),a&&y&&n.jsx(s.View,{position:"absolute",top:i==="horizontal"?"-20px":"50%",left:i==="horizontal"?"50%":"-20px",transform:i==="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":x?`Expand panel ${y}`:`Collapse panel ${y}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...c==null?void 0:c.collapseIcon,children:n.jsx(s.View,{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center",children:x?n.jsxs(s.Horizontal,{children:[n.jsx(s.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"}),n.jsx(s.View,{width:"2px",height:"6px",backgroundColor:"color-gray-600",position:"absolute"})]}):n.jsx(s.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"})})})]})},I0=({children:e,orientation:o="horizontal",size:t="md",variant:r="default",defaultSizes:a,minSize:l,maxSize:c,collapsible:d=!1,containerRef:i,autoSaveId:u,views:g,...f})=>{const m=o==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(m,{ref:i,width:"100%",height:"100%",position:"relative",overflow:"hidden",...b0[o],...g==null?void 0:g.container,...f,children:e})},hr=({children:e,orientation:o="horizontal",size:t="md",variant:r="default",defaultSizes:a,onSizesChange:l,minSize:c=50,maxSize:d,collapsible:i=!1,autoSaveId:u,storage:g,keyboardResizeBy:f=10,views:m,...b})=>{const{isResizing:p,setIsResizing:y,containerRef:x,registerPanel:k,unregisterPanel:w,getPanelSize:I,setPanelSize:C,isPanelCollapsed:T,togglePanelCollapse:j,startResize:M,onResize:E,endResize:P}=p0(o,a,l,c,d,i,u,g,f);return n.jsx(k0,{value:{orientation:o,size:t,variant:r,isResizing:p,setIsResizing:y,registerPanel:k,unregisterPanel:w,getPanelSize:I,setPanelSize:C,isPanelCollapsed:T,togglePanelCollapse:j,startResize:M,onResize:E,endResize:P},children:n.jsx(I0,{orientation:o,size:t,variant:r,defaultSizes:a,minSize:c,maxSize:d,collapsible:i,autoSaveId:u,keyboardResizeBy:f,containerRef:x,views:m,...b,children:e})})};hr.Panel=C0,hr.Handle=w0;const ft={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"}}},T0={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"}},j0=()=>Math.random().toString(36).substring(2,9);let lo=new Map;const Vo=bt.create(e=>({toasts:[],add:(o,t,r,a={})=>{const l=a.id||j0(),c={id:l,variant:o,title:t,description:r,createdAt:Date.now(),isVisible:!0,...a};if(e(d=>({toasts:[...d.toasts,c]})),a.duration!==0){const d=a.duration||5e3,i=setTimeout(()=>{Vo.getState().remove(l)},d);lo.set(l,i)}return l},remove:o=>{e(t=>({toasts:t.toasts.map(r=>r.id===o?{...r,isVisible:!1}:r)})),lo.has(o)&&(clearTimeout(lo.get(o)),lo.delete(o)),setTimeout(()=>{e(t=>({toasts:t.toasts.filter(r=>r.id!==o)}))},300)},removeAll:()=>{lo.forEach(clearTimeout),lo.clear(),e(o=>({toasts:o.toasts.map(t=>({...t,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),Oe=(e,o,t,r)=>Vo.getState().add(e,o,t,r),fl=(e,o,t)=>Oe("info",e,o,t),ml=(e,o,t)=>Oe("success",e,o,t),pl=(e,o,t)=>Oe("warning",e,o,t),bl=(e,o,t)=>Oe("error",e,o,t),yl=e=>{Vo.getState().remove(e)},xl=()=>{Vo.getState().removeAll()},kl=({variant:e,title:o,description:t,onClose:r,isClosable:a=!0,action:l,actionText:c,showIcon:d=!0,theme:i,views:u,render:g,icon:f,id:m,isVisible:b=!0,themeMode:p})=>{const y=i??ft,x=()=>{var C,T;if(f!==void 0)return f;const I=e?(T=(C=ft[e])==null?void 0:C.icon)==null?void 0:T.color:ft.info.icon.color;switch(e){case"info":return n.jsx(ze,{widthHeight:20,color:I});case"success":return n.jsx(kt,{widthHeight:20,color:I});case"warning":return n.jsx(ze,{widthHeight:20,color:I,orientation:"down"});case"error":return n.jsx($o,{widthHeight:20,color:I});default:return n.jsx(ze,{widthHeight:20,color:ft.info.icon.color})}};if(g)return n.jsx(n.Fragment,{children:g({id:m||"",onClose:r})});const k=e==="error"?"alert":"status",w=e==="error"||e==="warning"?"assertive":"polite";return n.jsxs(s.Horizontal,{role:k,"aria-live":w,"aria-atomic":"true","data-state":b?"open":"closed",gap:12,width:"100%",maxWidth:"400px",borderWidth:"1px",borderStyle:"solid",borderRadius:"8px",padding:"12px 16px",alignItems:"flex-start",position:"relative",backgroundColor:y[e].container.backgroundColor,borderColor:y[e].container.border,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",opacity:b?1:0,transform:b?"scale(1)":"scale(0.95)",transition:"all 0.3s ease",...u==null?void 0:u.container,children:[d&&n.jsx(s.View,{marginTop:"2px",...u==null?void 0:u.icon,children:x()}),n.jsxs(s.Vertical,{gap:4,flex:"1",children:[n.jsx(s.Text,{size:"md",fontWeight:"600",color:y[e].content.color,backgroundColor:y[e].container.backgroundColor,...u==null?void 0:u.title,children:o}),t&&n.jsx(s.Text,{size:"sm",color:y[e].content.color,fontWeight:"400",backgroundColor:y[e].container.backgroundColor,...u==null?void 0:u.description,children:t}),l&&c&&n.jsx(s.Text,{size:"sm",fontWeight:"600",marginTop:"8px",cursor:"pointer",color:y[e].content.color,backgroundColor:y[e].container.backgroundColor,onClick:I=>{I.stopPropagation(),l()},_hover:{textDecoration:"underline"},transition:"all 0.2s ease",...u==null?void 0:u.actionButton,children:c})]}),a&&n.jsx(s.View,{as:"button","aria-label":"Close toast",backgroundColor:"transparent",border:"none",cursor:"pointer",padding:"4px",marginLeft:"8px",marginTop:"-4px",marginRight:"-8px",borderRadius:"4px",onClick:I=>{I.stopPropagation(),r()},_hover:{backgroundColor:"rgba(0, 0, 0, 0.05)"},transition:"all 0.2s ease",...u==null?void 0:u.closeButton,children:n.jsx(ye,{widthHeight:16,color:y[e].content.color})})]})},S0=({position:e="top-right",gap:o=8,limit:t=5,containerStyle:r})=>{const{toasts:a,remove:l}=Vo(),d=h.useMemo(()=>{const i={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return a.forEach(u=>{const g=u.position||e;i[g].push(u)}),Object.keys(i).forEach(u=>{i[u]=i[u].slice(-t)}),i},[a,e,t])[e];return n.jsx(s.View,{position:"fixed",zIndex:9999,display:"flex",flexDirection:e.includes("bottom")?"column-reverse":"column",gap:`${o}px`,width:"fit-content",maxWidth:"100%",pointerEvents:"none",...T0[e],style:r,children:d.map(i=>n.jsx(s.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:n.jsx(kl,{id:i.id,variant:i.variant,title:i.title,description:i.description,onClose:()=>l(i.id),isClosable:i.isClosable,action:i.action,actionText:i.actionText,showIcon:i.showIcon,views:i.views,render:i.render,icon:i.icon,isVisible:i.isVisible})},i.id))})},M0=()=>({toast:(e,o,t,r)=>Oe(e,o,t,r),info:(e,o,t)=>fl(e,o,t),success:(e,o,t)=>ml(e,o,t),warning:(e,o,t)=>pl(e,o,t),error:(e,o,t)=>bl(e,o,t),remove:e=>yl(e),removeAll:()=>xl()}),z0=Object.assign(e=>n.jsx(kl,{...e}),{Container:e=>n.jsx(S0,{...e}),show:Oe,info:fl,success:ml,warning:pl,error:bl,remove:yl,removeAll:xl}),E0=M0,Cl=(e,o)=>{var c,d;if(!e)return!0;const t=e.toLowerCase(),r=o.name.toLowerCase().includes(t),a=((c=o.description)==null?void 0:c.toLowerCase().includes(t))||!1,l=((d=o.keywords)==null?void 0:d.some(i=>i.toLowerCase().includes(t)))||!1;return r||a||l},V0=({open:e,onOpenChange:o,groups:t=[],commands:r=[],filter:a})=>{const[l,c]=h.useState(""),[d,i]=h.useState(0),u=h.useRef(null),g=h.useMemo(()=>a||Cl,[a]),f=h.useMemo(()=>[...t.flatMap(x=>x.commands),...r],[t,r]),m=h.useMemo(()=>l.trim()?f.filter(y=>g(l,y)):f,[f,l,g]),b=h.useMemo(()=>{if(!l)return t;const y=a||Cl;return t.map(x=>({...x,commands:x.commands.filter(k=>y(l,k))})).filter(x=>x.commands.length)},[t,l,a]);h.useEffect(()=>{i(0)},[m.length]);const p=h.useCallback(y=>{if(e)switch(y.key){case"ArrowDown":y.preventDefault(),i(x=>x<m.length-1?x+1:x);break;case"ArrowUp":y.preventDefault(),i(x=>x>0?x-1:x);break;case"Enter":y.preventDefault(),m[d]&&(m[d].onSelect(),o(!1),c(""));break;case"Escape":y.preventDefault(),o(!1),c("");break}},[e,m,d,o]);return h.useEffect(()=>(document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}),[p]),h.useEffect(()=>{if(u.current&&e){const y=u.current.querySelector(`[data-index="${d}"]`);y&&y.scrollIntoView({block:"nearest"})}},[d,e]),h.useEffect(()=>{e?i(0):c("")},[e]),{search:l,setSearch:c,selectedIndex:d,setSelectedIndex:i,filteredCommands:m,filteredGroups:b,listRef:u}},P0={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},W0=(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)"}}))(),_0={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},$0={overflow:"auto",padding:"8px 0"},L0={marginBottom:"8px"},D0={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},B0={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},H0={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},A0={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},F0={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},O0={display:"flex",flexDirection:"column",flex:1},v0={fontSize:"14px",fontWeight:"medium"},N0={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},U0={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},q0={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},G0={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},Y0=h.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),X0=({value:e,children:o})=>n.jsx(Y0.Provider,{value:e,children:o}),wl=({value:e,onValueChange:o,placeholder:t="Type a command or search...",views:r,...a})=>{const l=h.useRef(null);return h.useEffect(()=>{l.current&&l.current.focus()},[]),n.jsxs(s.View,{..._0,...r==null?void 0:r.container,...a,children:[n.jsx(Do,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),n.jsx(s.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:l,...r==null?void 0:r.input})]})},K0=({children:e,views:o,...t})=>n.jsx(s.View,{...$0,...o==null?void 0:o.container,...t,children:e}),Il=({heading:e,children:o,views:t,...r})=>n.jsxs(s.View,{...L0,...t==null?void 0:t.container,...r,children:[n.jsx(s.Text,{...D0,...t==null?void 0:t.heading,children:e}),o]}),fr=({item:e,selected:o=!1,onSelect:t,views:r,...a})=>{const l=()=>{!e.disabled&&t&&t()};return n.jsxs(s.Horizontal,{...B0,...o?H0:{},...e.disabled?A0:{},onClick:l,...r==null?void 0:r.container,...a,children:[e.icon&&n.jsx(s.View,{...F0,...r==null?void 0:r.icon,children:e.icon}),n.jsxs(s.Vertical,{...O0,...r==null?void 0:r.content,children:[n.jsx(s.Text,{...v0,...r==null?void 0:r.name,children:e.name}),e.description&&n.jsx(s.Text,{...N0,...r==null?void 0:r.description,children:e.description})]}),e.shortcut&&n.jsx(s.Text,{...U0,...r==null?void 0:r.shortcut,children:e.shortcut})]})},Tl=({children:e="No results found.",views:o,...t})=>n.jsx(s.View,{...q0,...o==null?void 0:o.container,...t,children:e}),Q0=({open:e,onOpenChange:o,groups:t=[],commands:r=[],placeholder:a,size:l="md",variant:c="default",emptyState:d,footer:i,search:u,setSearch:g,selectedIndex:f,setSelectedIndex:m,filteredCommands:b,filteredGroups:p,listRef:y,views:x,filter:k,...w})=>{if(!e)return null;const I=h.useCallback(E=>{E.disabled||(E.onSelect(),o(!1),g(""))},[o,g]),C=h.useCallback(E=>E.target===E.currentTarget&&o(!1),[o]),T=h.useMemo(()=>({search:u,setSearch:g,selectedIndex:f,setSelectedIndex:m,filteredCommands:b,onSelect:I}),[u,f,b,I,g,m]),j=t.length>0,M=b.length===0;return n.jsx(s.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:n.jsx(X0,{value:T,children:n.jsxs(s.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...P0[l],...W0[c],...x==null?void 0:x.container,onClick:E=>E.stopPropagation(),children:[n.jsx(wl,{value:u,onValueChange:g,placeholder:a,views:x==null?void 0:x.searchInput}),n.jsx(s.View,{ref:y,flex:1,overflow:"auto",...x==null?void 0:x.list,children:M?d||n.jsx(Tl,{views:x==null?void 0:x.empty}):j?p.map(E=>n.jsx(Il,{heading:E.name,views:x==null?void 0:x.groupHeading,children:E.commands.map(P=>{const L=b.findIndex(S=>S.id===P.id);return n.jsx(fr,{item:P,selected:L===f,onSelect:()=>I(P),"data-index":L,views:{container:x==null?void 0:x.item,icon:x==null?void 0:x.icon,content:x==null?void 0:x.content,name:x==null?void 0:x.name,description:x==null?void 0:x.description,shortcut:x==null?void 0:x.shortcut}},P.id)})},E.id)):b.map((E,P)=>n.jsx(fr,{item:E,selected:P===f,onSelect:()=>I(E),"data-index":P,views:{container:x==null?void 0:x.item,icon:x==null?void 0:x.icon,content:x==null?void 0:x.content,name:x==null?void 0:x.name,description:x==null?void 0:x.description,shortcut:x==null?void 0:x.shortcut}},E.id))}),i&&n.jsx(s.View,{...G0,...x==null?void 0:x.footer,children:i})]})})})},co=({open:e,onOpenChange:o,groups:t=[],commands:r=[],placeholder:a,size:l="md",variant:c="default",filter:d,emptyState:i,footer:u,views:g,...f})=>{const{search:m,setSearch:b,selectedIndex:p,setSelectedIndex:y,filteredCommands:x,filteredGroups:k,listRef:w}=V0({open:e,onOpenChange:o,groups:t,commands:r,filter:d});return n.jsx(Q0,{open:e,onOpenChange:o,groups:t,commands:r,placeholder:a,size:l,variant:c,emptyState:i,footer:u,search:m,setSearch:b,selectedIndex:p,setSelectedIndex:y,filteredCommands:x,filteredGroups:k,listRef:w,views:g,...f})};co.Input=wl,co.List=K0,co.Group=Il,co.Item=fr,co.Empty=Tl;const jl=()=>Math.random().toString(36).substring(2,11),J0=({defaultOpen:e=!1,openDelay:o=200,closeDelay:t=200,isDisabled:r=!1}={})=>{const[a,l]=h.useState(e),c=h.useRef(null),d=h.useRef(null),i=h.useRef(null),u=h.useRef(null),g=h.useRef(`tooltip-trigger-${jl()}`).current,f=h.useRef(`tooltip-content-${jl()}`).current,m=h.useCallback(()=>{r||(u.current&&(clearTimeout(u.current),u.current=null),!a&&!i.current&&(i.current=setTimeout(()=>{l(!0),i.current=null},o)))},[a,o,r]),b=h.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null),a&&!u.current&&(u.current=setTimeout(()=>{l(!1),u.current=null},t))},[a,t]),p=h.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]);return h.useEffect(()=>()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current)},[]),h.useEffect(()=>{const y=x=>{x.key==="Escape"&&a&&l(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[a]),{isOpen:a,openTooltip:m,closeTooltip:b,cancelCloseTimer:p,triggerRef:c,contentRef:d,triggerId:g,contentId:f}},Z0={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},R0=(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"}}))(),em=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}},Sl=h.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),mr=()=>h.useContext(Sl),om=({value:e,children:o})=>n.jsx(Sl.Provider,{value:e,children:o}),Ml=({children:e,views:o,asChild:t=!1,...r})=>{const{openTooltip:a,closeTooltip:l,triggerRef:c,contentId:d,triggerId:i}=mr(),b={ref:c,onMouseEnter:()=>a(),onMouseLeave:()=>l(),onFocus:()=>a(),onBlur:()=>l(),id:i,"aria-describedby":d,...o==null?void 0:o.container,...r};return t&&h.isValidElement(e)?h.cloneElement(e,b):n.jsx(s.View,{display:"inline-block",...b,children:e})},tm=({children:e,views:o,...t})=>{const{isOpen:r,contentRef:a,contentId:l,triggerId:c}=mr();return r?n.jsx(s.View,{ref:a,id:l,role:"tooltip","aria-labelledby":c,...o==null?void 0:o.container,...t,children:e}):null},rm=({content:e,children:o,position:t="top",align:r="center",size:a="md",variant:l="default",showArrow:c=!0,views:d,themeMode:i,...u})=>{const{isOpen:g,triggerRef:f,contentRef:m,contentId:b,triggerId:p}=mr(),{ref:y,relation:x}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[k,w]=h.useState({x:0,y:0,placement:t});h.useEffect(()=>{f!=null&&f.current&&y&&(y.current=f.current)},[f,y,g]),h.useEffect(()=>{if(g&&(m!=null&&m.current)&&(f!=null&&f.current)){const j=f.current.getBoundingClientRect();let M=t;x&&(t==="top"&&x.space.vertical==="bottom"?M="bottom":t==="bottom"&&x.space.vertical==="top"?M="top":t==="right"&&x.space.horizontal==="left"?M="left":t==="left"&&x.space.horizontal==="right"&&(M="right"));let E=0,P=0;switch(M){case"top":E=r==="start"?j.left:r==="end"?j.right-120:j.left+j.width/2-60,P=j.top-8;break;case"bottom":E=r==="start"?j.left:r==="end"?j.right-120:j.left+j.width/2-60,P=j.bottom+8;break;case"right":E=j.right+8,P=r==="start"?j.top:r==="end"?j.bottom-32:j.top+j.height/2-16;break;case"left":E=j.left-8,P=r==="start"?j.top:r==="end"?j.bottom-32:j.top+j.height/2-16;break}w({x:E,y:P,placement:M})}},[g,t,r,f,m,x]);const I=c?em(k.placement):{},T=(()=>{const j={position:"fixed",left:k.x,top:k.y,zIndex:1e3};switch(k.placement){case"top":return{...j,transform:"translateY(-100%)"};case"left":return{...j,transform:"translateX(-100%)"};case"bottom":case"right":default:return j}})();return n.jsxs(s.View,{position:"relative",display:"inline-block",...d==null?void 0:d.container,...u,children:[n.jsx(Ml,{children:o}),g&&n.jsxs(s.View,{ref:m,id:b,role:"tooltip","aria-labelledby":p,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:T,...Z0[a],...R0[l],...d==null?void 0:d.content,children:[typeof e=="string"?n.jsx(s.Text,{...d==null?void 0:d.text,children:e}):e,c&&n.jsx(s.View,{...I,...d==null?void 0:d.arrow})]})]})},pr=({content:e,children:o,position:t="top",align:r="center",size:a="md",variant:l="default",openDelay:c=200,closeDelay:d=200,showArrow:i=!0,defaultOpen:u=!1,isDisabled:g=!1,views:f,...m})=>{const b=J0({defaultOpen:u,openDelay:c,closeDelay:d,isDisabled:g});return n.jsx(om,{value:b,children:n.jsx(rm,{content:e,position:t,align:r,size:a,variant:l,showArrow:i,views:f,...m,children:o})})};pr.Trigger=Ml,pr.Content=tm;const zl=h.forwardRef((e,o)=>{const t=aa(e);return n.jsx(ua,{...e,...t})});zl.displayName="ChatInput";const nm={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},El={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%"}},br={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}},yr={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}},Vl={"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"},mt={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"},am={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"}]},lm=(e,o,t,r,a)=>{const l=o.map(c=>`${c.color} ${c.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${t&&Vl[t]?Vl[t]:t||"to right"}, ${l})`;case"radial":const d=a&&mt[a]?mt[a]:a||"center";return`radial-gradient(${r||"circle"} at ${d}, ${l})`;case"conic":return`conic-gradient(from 0deg at ${a&&mt[a]?mt[a]:a||"center"}, ${l})`;default:return`linear-gradient(to right, ${l})`}},cm={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)"}}}},Pl={container:{position:"relative",overflow:"hidden",borderRadius:"8px",transition:"all 0.2s ease"},content:{position:"relative",zIndex:1,width:"100%",height:"100%",padding:"16px"}},im=({type:e="linear",direction:o="to-right",shape:t="circle",position:r="center",from:a,to:l,colors:c,animate:d=!1,animationDuration:i=3,children:u,views:g,themeMode:f,...m})=>{const b=h.useMemo(()=>c&&c.length>0?c:a&&l?[{color:a,position:"0%"},{color:l,position:"100%"}]:am[e],[c,a,l,e]),p=h.useMemo(()=>{const x=b.map(k=>({...k,color:k.color}));return lm(e,x,o,t,r)},[e,b,o,t,r]),y=h.useMemo(()=>{if(!d)return{};const x=cm[e];return{...x,transition:x.transition.replace("3s",`${i}s`),animationDuration:`${i}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[d,i,e]);return n.jsx(s.View,{background:p,...Pl.container,...y,...g==null?void 0:g.container,...m,children:u&&n.jsx(s.View,{...Pl.content,...g==null?void 0:g.content,children:u})})},sm=e=>n.jsx(im,{...e}),dm=h.createContext({}),um=({children:e,showRadialGradient:o=!0,views:t,themeMode:r,...a})=>{const l={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={...El.gradient,backgroundImage:`
|
|
28
|
+
${fe}`:fe}let ie=_,ue=!1;_.endsWith("-thinking")&&(ie=_.replace(/-thinking$/,""),ue=!0),n(J,{model_name:ie,enable_thinking:ue}),b||y(""),I([]),T([])},Y=X=>{I(J=>J.filter((ie,ue)=>ue!==X)),!g&&C.length>X&&T(J=>J.filter((ie,ue)=>ue!==X))},Z=X=>{X.preventDefault(),X.stopPropagation(),$(!0)},ee=X=>{X.preventDefault(),X.stopPropagation(),$(!1)},ne=u.useCallback(X=>{!X||X.length===0||(T(J=>[...J,...X]),I(J=>[...J,...X]),S(J=>[...J,...X]),z(!0))},[T,I]),ae=u.useCallback(()=>{if(B.length>0&&!H&&p){A(!0);const X=B[0];E.current=X,P(0);try{p(X)}catch(J){S(ie=>ie.slice(1)),A(!1),E.current=null,P(0),z(ie=>B.length-1>0||!1),m==null||m(J)}}else B.length===0&&j&&(z(!1),P(0))},[B,H,p,j,m]);u.useEffect(()=>{ae()},[B,H,ae]);const te="active",ge=X=>!0,ye=()=>{N(!1),e.onGuideClose&&e.onGuideClose()},G=X=>{b&&t?t(X.text):y(X.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(X),F.current&&F.current.focus()},v=u.useCallback(()=>C,[C]),R=u.useCallback(()=>T([]),[]);return{onSubmit:n,getPendingFiles:v,clearPendingFiles:R,value:k,handleChange:K,handleSubmit:Q,editableRef:F,fileInputRef:q,isUploading:j,uploadProgress:V,isDraggingOver:W,uploadedFiles:w,pendingFiles:C,removeUploadedFile:Y,setPendingFiles:T,setUploadedFiles:I,setIsUploading:z,startUpload:ne,selectedModel:_,handleModelChange:L,modelOptions:D,subscriptionStatus:te,canAccessModel:ge,handleDragOver:Z,handleDragLeave:ee,isGuideTipShown:O,hideGuideTip:ye,handlePromptExampleSelect:G}},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]=u.useState(!1),l=u.useRef(null),a=u.useRef(null),c=u.useRef(null),d=u.useRef(null),s=u.useMemo(()=>yn("hovercard-content"),[]),g=u.useMemo(()=>yn("hovercard-trigger"),[]),h=u.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),f=u.useCallback(()=>{h(),t||(l.current=setTimeout(()=>{n(!0)},e))},[t,e,h]),m=u.useCallback(()=>{h(),t&&(a.current=setTimeout(()=>{n(!1)},o))},[t,o,h]),p=u.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null)},[]);return u.useEffect(()=>()=>h(),[h]),{isOpen:t,openCard:f,closeCard:m,cancelCloseTimer:p,triggerRef:c,contentRef:d,contentId:s,triggerId:g}},xn=u.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=u.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:d,triggerId:s}=kn(),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&&u.isValidElement(e)){const b=u.Children.only(e);return u.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:d="4px",boxShadow:s="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:g="12px",minWidth:h="50px",maxWidth:f="300px",...m})=>{const{isOpen:p,cancelCloseTimer:b,closeCard:x,contentRef:y,triggerRef:k,contentId:w,triggerId:I}=kn(),{ref:C,relation:T}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});u.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(!T||!(k!=null&&k.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const S=k.current.getBoundingClientRect();let H=t;t==="bottom"&&T.space.vertical==="top"?H="top":t==="top"&&T.space.vertical==="bottom"?H="bottom":t==="right"&&T.space.horizontal==="left"?H="left":t==="left"&&T.space.horizontal==="right"&&(H="right");let A=0,E=0;switch(H){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:P(H)}},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)"}},B=V();return r.jsx(i.View,{ref:y,id:w,role:"tooltip","aria-labelledby":I,onMouseEnter:j,onMouseLeave:z,backgroundColor:c,borderRadius:d,boxShadow:s,padding:g,minWidth:h,maxWidth:f,style:{...B,...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 d=u.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(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,g)=>{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(To,{widthHeight:24,color:"color-black"})}),!f&&!m&&!p&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(oo,{widthHeight:24,color:"color-black"})}),t&&r.jsx(i.Button,{...lg.attachmentRemove,onClick:b=>{b.stopPropagation(),t(g)},"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),")"]})]})]})},g)})})},Cn=u.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:g="@",onMentionSelect:h,maxHeight:f="200px",minHeight:m="40px",views:p={}},b)=>{var ge,ye;const x=u.useRef(e),[y,k]=u.useState(-1),[w,I]=u.useState(!e),C=u.useRef(null),[T,j]=u.useState(!1),[z,V]=u.useState(!1),[P,B]=u.useState(""),[S,H]=u.useState(-1),[A,E]=u.useState(-1),[W,$]=u.useState([]),{ref:_,relation:L}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[D,F]=u.useState({x:0,y:0}),[q,O]=u.useState({x:0,y:0});u.useEffect(()=>{const G=b;G.current&&e!==x.current&&(G.current.textContent=e,x.current=e,I(!e))},[e,b]),u.useEffect(()=>{l&&b&&typeof b=="object"&&b.current&&b.current.focus()},[l,b]);const N=()=>{const G=window.getSelection();if(!G||G.rangeCount===0)return-1;const v=G.getRangeAt(0),R=v.cloneRange();return R.selectNodeContents(b&&typeof b=="object"&&b.current?b.current:document.body),R.setEnd(v.endContainer,v.endOffset),R.toString().length},K=u.useCallback((G,v)=>{const R=G.substring(0,v),X=R.lastIndexOf(g);if(X!==-1){const J=R.substring(X+1);if(!J.includes(" ")){const ue=J.toLowerCase(),fe=s.filter(me=>me.name.toLowerCase().includes(ue));B(ue),H(X),$(fe),V(fe.length>0),E(0);const re=Q();F(re);return}}V(!1),B(""),H(-1),E(-1)},[s,g]);u.useEffect(()=>{C.current&&_&&(_.current=C.current)},[C,_]);const Q=u.useCallback((G=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-G-8:v.bottom+8}}const R=window.innerHeight,X={top:v.top,bottom:R-v.bottom},J=X.bottom<G+8&&X.top>X.bottom;return{x:v.left,y:J?v.top-G-8:v.bottom+8}},[L]),Y=u.useCallback(()=>{j(!0);const G=Q();O(G)},[Q]),Z=u.useCallback(()=>{setTimeout(()=>{j(!1),k(-1)},150)},[]),ee=G=>{const v=G.currentTarget.textContent||"";if(v!==x.current){o(v),x.current=v,I(!v);const R=N();K(v,R)}},ne=u.useCallback(G=>{if(b&&typeof b=="object"&&b.current){const v=b.current.textContent||"",R=v.substring(0,S),X=v.substring(S+g.length+P.length),J=R+g+G.name+" "+X;o(J),x.current=J,b.current.textContent=J;const ie=R.length+g.length+G.name.length+1;setTimeout(()=>{var ue;if(b.current){const fe=document.createRange(),re=window.getSelection(),me=b.current.firstChild;me&&re&&(fe.setStart(me,Math.min(ie,((ue=me.textContent)==null?void 0:ue.length)||0)),fe.collapse(!0),re.removeAllRanges(),re.addRange(fe))}},0)}V(!1),B(""),H(-1),E(-1),h&&h(G)},[S,g,P,o,h,b]),ae=u.useCallback(G=>{c&&c(G),k(-1)},[c]),te=G=>{if(z&&W.length>0){if(G.key==="ArrowDown"){G.preventDefault(),E(v=>v<W.length-1?v+1:0);return}if(G.key==="ArrowUp"){G.preventDefault(),E(v=>v>0?v-1:W.length-1);return}if((G.key==="Tab"||G.key==="Enter")&&A>=0){G.preventDefault(),ne(W[A]);return}if(G.key==="Escape"){V(!1),E(-1);return}}if(d&&a.length>0){if(G.key==="ArrowDown"){G.preventDefault(),k(v=>v<a.length-1?v+1:0);return}if(G.key==="ArrowUp"){G.preventDefault(),k(v=>v>0?v-1:a.length-1);return}if(G.key==="Tab"&&y>=0){G.preventDefault(),ae(a[y]);return}if(G.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:ee,onKeyDown:te,onFocus:Y,onBlur:Z,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&&W.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:[W.map((G,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:()=>ne(G),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:[g,G.name]}),G.description&&r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",children:G.description})]})},G.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",g,")",L&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})}),d&&a.length>0&&!z&&T&&!e&&r.jsx(i.View,{position:"fixed",left:q.x,top:q.y,width:((ye=C.current)==null?void 0:ye.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((G,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:()=>ae(G),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:G.text}),G.description&&r.jsx(i.Text,{fontSize:"12px",color:"color-gray-600",children:G.description})]})},G.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:d,stopRecording:s}=ir();u.useEffect(()=>{if(a){const h=new File([a],`recording-${Date.now()}.webm`,{type:a.type||"audio/webm;codecs=opus"});e(h)}},[a]);const g=u.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(ft,{analyserNode:c,isPaused:l})}),r.jsx(i.View,{as:"button",type:"button",onClick:n?s:g,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n?"theme-error":"color-gray-100",color:n?"color-white":"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:n?"color-red-600":"color-gray-200"},...t.button,children:n?r.jsx(So,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(ct,{widthHeight:16,color:"currentColor",filled:!1})})]})},wn=({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:g="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:I="default",views:C={},mentionData:T=[],mentionTrigger:j="@",onMentionSelect:z,onAudioRecordingStart:V,onAudioRecordingStop:P,value:B,handleChange:S,handleSubmit:H,editableRef:A,fileInputRef:E,isUploading:W,uploadProgress:$,isDraggingOver:_,uploadedFiles:L,removeUploadedFile:D,setPendingFiles:F,setUploadedFiles:q,setIsUploading:O,startUpload:N,selectedModel:K,handleModelChange:Q,modelOptions:Y,subscriptionStatus:Z,canAccessModel:ee,isGuideTipShown:ne,hideGuideTip:ae,handlePromptExampleSelect:te,handleDragOver:ge,handleDragLeave:ye,onChange:G,...v})=>{i.useTheme();const R={...bn.container,...cg[w],...C==null?void 0:C.container},X={...bn.content,...ig[k],...sg[I],...C==null?void 0:C.content},J=((B==null?void 0:B.trim().length)??0)>0||L.length>0,ie=u.useCallback(re=>{N([re]),P==null||P(re)},[N,P]),ue=u.useCallback(re=>{const me=re.filter(ot=>ot.size>52428800?(console.error(`File size exceeds 50MB limit: ${ot.name}`),!1):!0);me.length>0&&N(me)},[N]),fe=[...T||[],...L.map((re,me)=>({id:`file-${me}`,name:re.name}))];return r.jsxs(i.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...R,...v,onDragOver:ge,onDragLeave:ye,onDrop:re=>{if(re.preventDefault(),re.stopPropagation(),ye(re),re.dataTransfer.files.length>0){const me=Array.from(re.dataTransfer.files);ue(me)}},children:[b.length>0&&r.jsx(mg,{examples:b,onSelect:te,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:g})]}),r.jsx(i.View,{position:"relative",width:"100%",overflow:"visible",children:r.jsxs(i.View,{as:"form",onSubmit:H,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...X,...R,paddingHorizontal:16,paddingVertical:10,backgroundColor:_?"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:B||"",onChange:S,placeholder:o,disabled:n&&!l,autoFocus:h,suggestions:x||[],showSuggestions:x&&x.length>0&&!B,onSuggestionSelect:re=>{S(re.text)},mentionData:fe,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(Po,{accept:"*/*",icon:r.jsx(to,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:ue,isLoading:W,progress:$||0,text:p,fileType:"file",renderError:({errorMessage:re})=>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:re=>re.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:V,onRecordingComplete:ie,views:{button:C==null?void 0:C.recordButton}}),r.jsx(i.View,{as:"button",type:"button",onClick:H,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(So,{widthHeight:16,color:"currentColor",filled:!1}):t?r.jsx(ro,{type:"quarter",size:16,color:"color-white"}):r.jsx(it,{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})]})},bg=e=>{const{name:o,onSubmit:t,...n}=e,[l,a]=u.useState([]),c=se({name:o,type:"text"}),d=m=>{c.onChangeText&&c.onChangeText(m)},s=(m,p)=>{t?t(m,p):d(m)},g=()=>l,h=()=>a([]),f=pn({...n,value:c.value||"",onChange:d,onSubmit:s,getPendingFiles:g,clearPendingFiles:h});return r.jsx(wn,{...n,...f,value:c.value||"",onChange:d,onSubmit:s,error:c.error,getPendingFiles:g,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:d,setFieldTouched:s}=xe.useFormikContext(),g=xe.getIn(n,o)||[],h=xe.getIn(a,o)||c>0?xe.getIn(l,o):void 0,f=u.useCallback(y=>{var w;const k=Array.isArray(y)?y.filter(I=>typeof I=="string"):[];d(o,k),(w=e.onTagsChange)==null||w.call(e,k)},[o,d,e.onTagsChange]),m=u.useCallback(()=>{var y;s(o,!0),(y=e.onBlur)==null||y.call(e)},[o,s,e.onBlur]),p=gn({...t,tags:g,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(so,{...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(so,{...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);u.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(g=>g.value===a.value);s&&c.setSelectedItem(s)}},[a.value,n,e]);const d=s=>{a.onChange(s)};return r.jsx(dn,{...c,...a,items:e,placeholder:o,isMulti:n,onSelect:d})},Ye=(e,o,t)=>Math.min(Math.max(e,o),t),zg=(e,o,t,n,l,a,c)=>{const d=n-t;let s;if(a==="horizontal"){const g=o.width,h=e-o.left;s=Ye(h/g,0,1)}else{const g=o.height,h=o.bottom-e;s=Ye(h/g,0,1)}if(c&&c.length>0){const g=t+s*d;let h=c[0],f=Math.abs(g-h);for(let m=1;m<c.length;m++){const p=Math.abs(g-c[m]);p<f&&(f=p,h=c[m])}return h}else{const g=t+s*d,h=Math.round(g/l)*l;return Ye(h,t,n)}},In=({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:g})=>{const h=Ye(n??l??e,e,o),[f,m]=u.useState(h),[p,b]=u.useState(!1),[x,y]=u.useState(!1),k=u.useRef(null),w=u.useRef(null),I=n!==void 0,C=I?n:f;u.useEffect(()=>{I&&m(Ye(n,e,o))},[n,I,e,o]);const T=u.useCallback(H=>{const A=Ye(H,e,o);I||m(A),a&&A!==C&&a(A),p&&c&&c(A)},[I,e,o,a,C,p,c]),j=u.useCallback(H=>{if(s||!k.current)return;const A=k.current.getBoundingClientRect();let E;"touches"in H?E=d==="horizontal"?H.touches[0].clientX:H.touches[0].clientY:E=d==="horizontal"?H.clientX:H.clientY;const W=zg(E,A,e,o,t,d,g);T(W)},[e,o,t,d,T,s,g]),z=u.useCallback(H=>{if(s)return;H.preventDefault(),b(!0),j(H);const A=W=>{j(W)},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=u.useCallback(H=>{w.current&&w.current.contains(H.target)||z(H)},[z]),P=u.useCallback(H=>{if(s)return;let A=C;switch(H.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}H.preventDefault(),T(A)},[C,e,o,t,T,s]),B=o-e,S=B===0?0:(C-e)/B*100;return{currentValue:C,isDragging:p,isHovered:x,setIsHovered:y,trackRef:k,thumbRef:w,handleThumbMouseDown:z,handleTrackMouseDown:V,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=({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:g=!1,showValue:h=!1,showTooltip:f=!1,backgroundColor:m="theme-primary",label:p,helperText:b,themeMode:x,shadow:y={},isDragging:k,isHovered:w,setIsHovered:I,trackRef:C,thumbRef:T,handleThumbMouseDown:j,handleTrackMouseDown:z,handleKeyDown:V,thumbPositionPercent:P,ariaLabel:B="Slider",views:S={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:H,onDrag:A,...E})=>{var Q,Y;const{getColorHex:W,themeMode:$}=i.useTheme(),_=W(m,{themeMode:x||$}),L=W("theme-disabled",{themeMode:x||$}),D=W(Mn[d].backgroundColor,{themeMode:x||$}),F=s==="vertical",{trackCrossAxisSize:q,thumbSize:O}=Vg[c]||{trackCrossAxisSize:Tn[c].height,thumbSize:jn[c].width||16},N=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:g?"not-allowed":"pointer",opacity:g?.6:1,onMouseDown:z,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),...Tn[c],borderRadius:Sn[a],backgroundColor:D,...Mn[d],...y,...S.track,children:[l&&l.length>0&&r.jsx(r.Fragment,{children:l.map(Z=>{const ee=(Z-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:g?L:_,zIndex:1,...S.stepMarks},Z)})}),r.jsx(i.View,{position:"absolute",top:0,left:0,height:"100%",width:`${P}%`,backgroundColor:g?L:_,borderRadius:Sn[a],transition:"width 0.1s ease-in-out",...S.progress,...S.filledTrack}),r.jsx(i.View,{ref:T,role:"slider",tabIndex:g?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":g,"aria-label":B,position:"absolute",top:"50%",left:`${P}%`,borderRadius:"50%",backgroundColor:"color-white",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:`2px solid ${g?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,...jn[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,{...(Q=S.tooltip)==null?void 0:Q.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),b&&r.jsx(Tt,{children:b})]}),K=r.jsxs(i.Center,{...Eg[s],position:"relative",onMouseEnter:()=>!g&&I(!0),onMouseLeave:()=>!g&&I(!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:q/2,backgroundColor:g?L:D,cursor:g?"not-allowed":"pointer",width:F?`${q}px`:"100%",height:F?"100%":`${q}px`,onMouseDown:z,onTouchStart:z,...S==null?void 0:S.track,children:[l&&l.length>0&&r.jsx(r.Fragment,{children:l.map(Z=>{const ee=(Z-e)/(o-e)*100;return r.jsx(i.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:g?L:_,zIndex:1,...F?{bottom:`${ee}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${ee}%`,top:"50%",transform:"translate(-50%, -50%)"},...S.stepMarks},Z)})}),r.jsx(i.View,{position:"absolute",borderRadius:q/2,backgroundColor:g?L:_,...F?{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:T,role:"slider",tabIndex:g?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":g,"aria-label":B,position:"absolute",width:`${O}px`,height:`${O}px`,borderRadius:"50%",backgroundColor:g?L:_,border:"2px solid color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:g?"not-allowed":"grab",transform:F?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:k?"none":"left 0.1s, bottom 0.1s",...F?{left:"50%",bottom:`${P}%`}:{top:"50%",left:`${P}%`},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,...F?{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,{...(Y=S==null?void 0:S.tooltip)==null?void 0:Y.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),b&&r.jsx(Tt,{marginTop:8,children:b})]});return F||f?K:N},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:d,mirrorSelectionStart:s,mirrorSelectionEnd:g,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:m,handleFocus:p,handleBlur:b,handleKeyDown:x,handlePaste:y}=hn(e),k=u.useCallback(I=>{o.onChange&&o.onChange(I),e.onComplete&&I.length===(e.length||6)&&e.onComplete(I),c.current&&(c.current.value=I)},[o,e,c]),w=u.useCallback(I=>{const C=I.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:d,mirrorSelectionStart:s,mirrorSelectionEnd:g,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],Vn=({name:e,uploadFile:o,onUploadSuccess:t,onUploadError:n,transformResponse:l,onMultipleFileSelect:a,onFileSelect:c,multiple:d=!0,...s})=>{const{setFieldValue:g,setFieldTouched:h,values:f}=xe.useFormikContext(),[m,p]=u.useState(!1),[b,x]=u.useState(0),y=u.useCallback(async I=>{if(!I||I.length===0)return;h(e,!0,!0),p(!0);const C=[];for(const T of I){x(0);try{const j=await o(T,V=>{x(V??0)}),z=l?l(j,T):j;C.push(z),t==null||t(T,z)}catch(j){n==null||n(T,j)}}if(C.length>0){const T=_g(xe.getIn(f,e));g(e,[...T,...C],!0),x(100)}else x(0);p(!1)},[e,n,t,h,g,l,o,f]),k=u.useCallback(async I=>{a==null||a(I),await y(I)},[y,a]),w=u.useCallback(async I=>{c==null||c(I),await y([I])},[y,c]);return r.jsx(Po,{...s,multiple:d,onMultipleFileSelect:d?k:void 0,onFileSelect:d?void 0:w,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]=u.useState(!1),[n,l]=u.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=({children:e,shape:o="rounded",variant:t="ghost",isHovered:n,setIsHovered:l,isDisabled:a,isToggle:c,setIsToggled:d,onToggle:s,views:g,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=Bg(w,y==="light")[t],T=!!(c||n),j=()=>l(!n),z=()=>{a||d(V=>{const P=!V;return s&&s(P),P})};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,...T&&{backgroundColor:w,color:y==="light"?"color-black":"color-white"},...p,...g==null?void 0:g.container,children:e})},Lg=({children:e,shape:o,variant:t,isDisabled:n,isToggled:l=!1,onToggle:a,...c})=>{const d=se(c),{isHovered:s,setIsHovered:g,isToggle:h,setIsToggled:f}=En(d.value??l);u.useEffect(()=>{f(d.value??l)},[d.value,l]);const m=p=>{f(p),d.onChange(p),a==null||a(p)};return r.jsx(Pn,{shape:o,variant:t,isDisabled:n,isHovered:s,setIsHovered:g,isToggle:h,setIsToggled:f,onToggle:m,...c,children:e})},Wn=()=>{const[e,o]=u.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:g,setIsToggled:h}=En(l);return u.useEffect(()=>{h(l)},[l]),r.jsx(Pn,{shape:o,variant:t,isDisabled:n,isHovered:d,setIsHovered:s,isToggle:g,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 d=u.useCallback((s,g)=>{n(h=>{let f;return g?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:g=>d(s.id,g),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:d}=Wn();u.useEffect(()=>{Array.isArray(a.value)&&d(a.value)},[a.value]);const s=g=>{d(g),a.onChange(g),n==null||n(g)};return r.jsx($n,{items:e,shape:o,variant:t,activeToggles:c,setActiveToggles:d,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:d=!0}=e,[s,g]=u.useState(l??!1),[h,f]=u.useState(o??t),[m,p]=u.useState(""),b=u.useRef(null),x=u.useRef(null);u.useEffect(()=>{o!==void 0&&f(o)},[o]),u.useEffect(()=>{l!==void 0&&g(l)},[l]);const y=u.useMemo(()=>m?Hn.filter(T=>T.toLowerCase().includes(m.toLowerCase())).slice(0,100):Hn.slice(0,100),[m]);u.useEffect(()=>{const T=j=>{s&&b.current&&x.current&&!b.current.contains(j.target)&&!x.current.contains(j.target)&&k()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[s]);const k=u.useCallback(()=>{l===void 0&&g(!1),c&&c()},[c,l]),w=u.useCallback(()=>{const T=!s;l===void 0&&g(T),T?(a&&a(),p("")):c&&c()},[s,a,c,l]),I=u.useCallback(T=>{o===void 0&&f(T),n&&n(T),d&&k()},[n,d,k,o]),C=u.useCallback(T=>{p(T)},[]);return{isOpen:s,selectedIcon:h,searchQuery:m,filteredIcons:y,handleToggle:w,handleIconSelect:I,handleSearchChange:C,handleClose:k,triggerRef:b,dropdownRef:x}},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:"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:d=!1,isDisabled:s=!1,isReadOnly:g=!1,showSearch:h=!0,isOpen:f,selectedIcon:m,searchQuery:p,filteredIcons:b,handleToggle:x,handleIconSelect:y,handleSearchChange:k,triggerRef:w,dropdownRef:I,handleClose:C,onChange:T,...j})=>{const{getColor:z}=i.useTheme(),V={...ve.container,...n==null?void 0:n.container},P={...ve.trigger,...Dg[l],...Fg[a],...Og[c],...d&&{borderColor:"color-red-500"},...s&&{opacity:.6,cursor:"not-allowed"},...n==null?void 0:n.trigger},B={...ve.dropdown,...n==null?void 0:n.dropdown},S={...ve.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||g?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(Io,{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})}),!g&&!s&&r.jsx(le,{widthHeight:16,color:"color-gray-500",orientation:f?"up":"down"})]}),f&&r.jsxs(i.View,{ref:I,...B,children:[h&&r.jsx(i.View,{...ve.searchInput,...n==null?void 0:n.searchInput,children:r.jsx(go,{placeholder:"Search icons...",value:p,onChange:H=>k(H),size:"sm",autoFocus:!0})}),r.jsx(i.View,{...S,children:b.length>0?b.map(H=>r.jsx(i.View,{...ve.iconItem,onClick:()=>y(H),title:H,_hover:{backgroundColor:"color-gray-100"},backgroundColor:m===H?"color-blue-100":"transparent",...n==null?void 0:n.iconItem,children:r.jsx(Io,{name:H,widthHeight:20})},H)):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})]})},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})},ze={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:d,closeOnSelect:s=!0,maxRecentEmojis:g=16,showRecentEmojis:h=!0,enabledCategories:f=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:m=[]}=e,[p,b]=u.useState(a??!1),[x,y]=u.useState(o??t),[k,w]=u.useState(""),[I,C]=u.useState("smileys"),[T,j]=u.useState([]),z=u.useRef(null),V=u.useRef(null),P=u.useMemo(()=>[...vg,...m],[m]),B=u.useMemo(()=>{let _=P;if(I!=="recent"?_=_.filter(L=>L.category===I):_=T,k){const L=k.toLowerCase();_=_.filter(D=>D.name.toLowerCase().includes(L)||D.keywords.some(F=>F.toLowerCase().includes(L)))}return _},[P,I,T,k]);u.useEffect(()=>{o!==void 0&&y(o)},[o]),u.useEffect(()=>{a!==void 0&&b(a)},[a]),u.useEffect(()=>{if(h){const _=localStorage.getItem("emojiPicker-recentEmojis");if(_)try{j(JSON.parse(_))}catch{}}},[h]),u.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=u.useCallback(_=>{h&&j(L=>{const D=L.filter(q=>q.emoji!==_.emoji),F=[_,...D].slice(0,g);return localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(F)),F})},[h,g]),H=u.useCallback(()=>{const _=!p;b(_),_?(c==null||c(),w(""),h&&T.length>0?C("recent"):C("smileys")):d==null||d()},[p,c,d,h,T.length]),A=u.useCallback(_=>{y(_.emoji),S(_),n==null||n(_.emoji),l==null||l(_),s&&(b(!1),d==null||d())},[n,l,s,d,S]),E=u.useCallback(_=>{w(_),_&&I==="recent"&&C("smileys")},[I]),W=u.useCallback(_=>{C(_),w("")},[]),$=u.useCallback(()=>{b(!1),d==null||d()},[d]);return{isOpen:p,selectedEmoji:x,recentEmojis:T,searchQuery:k,activeCategory:I,filteredEmojis:B,handleToggle:H,handleEmojiSelect:A,handleSearchChange:E,handleCategoryChange:W,handleClose:$,triggerRef:z,dropdownRef:V}},Dn=({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:g=!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:I,activeCategory:C,filteredEmojis:T,handleToggle:j,handleEmojiSelect:z,handleSearchChange:V,handleCategoryChange:P,triggerRef:B,dropdownRef:S,onChange:H,...A})=>{const{getColor:E}=i.useTheme(),W={...ze.container,...a==null?void 0:a.container},$={...ze.trigger,...Ng[c],...Ug[d],...Gg[s],...g&&{borderColor:"color-red-500"},...h&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},_={...ze.dropdown,...a==null?void 0:a.dropdown},L={...ze.categoryTabs,...a==null?void 0:a.categoryTabs},D={...ze.emojiGrid,...a==null?void 0:a.emojiGrid},F=x.filter(q=>q==="recent"?b&&w.length>0:!0);return r.jsxs(i.View,{...W,...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:B,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,{...ze.searchInput,...a==null?void 0:a.searchInput,children:r.jsx(go,{placeholder:"Search emojis...",value:I,onChange:q=>V(q.target.value),size:"sm"})}),p&&r.jsx(i.View,{...L,children:F.map(q=>r.jsx(i.View,{...ze.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:T.length>0?T.map((q,O)=>r.jsx(i.View,{...ze.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:I?"No emojis found":"No emojis in this category"})})})]}),l&&r.jsx(i.Text,{color:g?"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=u.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/"),g=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"}),g&&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(To,{widthHeight:24,color:"color-black"})}),!s&&!g&&!h&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(oo,{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"}),g&&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)})})},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"),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:g=>g.stopPropagation()}),d&&r.jsx(i.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:g=>g.stopPropagation()}),!a&&!c&&!d&&r.jsx(oo,{widthHeight:24,color:"color-gray-600"})]})},Ve=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={})=>{Ve.getState().show(e,o,t),Ve.getState().onShow(e,o)},Wt=e=>{console.log("hideModal",e),Ve.getState().onHide(e),Ve.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},Go={body:{fontSize:"16px",fontWeight:"400",lineHeight:"24px",color:"color-gray-700"}},Fn=({children:e,blur:o,isOpen:t=!1,isClosePrevented:n=!1,onClose:l=()=>{},position:a="center",views:c,...d})=>{const s=()=>{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],...d,...c==null?void 0:c.view,children:e})})},tu=({children:e,shadow:o,isFullScreen:t=!1,shape:n="rounded",views:l,isOpen:a,...c})=>{const d=typeof document!==void 0?{boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"}:{elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},s=g=>{g&&g.stopPropagation&&g.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,...Rg[n],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...c,...l==null?void 0:l.container,children:e})},ru=({children:e,buttonColor:o="theme-primary",iconSize:t="md",buttonPosition:n="right",views:l,...a})=>{const c=a.onClose?a.onClose:Wt,d=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"&&d,e,n==="right"&&d]})},nu=({children:e,views:o,...t})=>r.jsx(i.View,{paddingVertical:16,paddingHorizontal:24,fontSize:Go.body.fontSize,fontWeight:Go.body.fontWeight,lineHeight:Go.body.lineHeight,color:Go.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...t,...o==null?void 0:o.view,children:e}),au=({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}),lu=({modals:e,onShow:o,onHide:t})=>{const n=Ve(l=>l.modals);return o&&Ve.getState().setOnShow(o),t&&Ve.getState().setOnHide(t),n.length===0?null:r.jsx(u.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)})})},Be=({children:e})=>r.jsx(r.Fragment,{children:e});Be.Overlay=Fn,Be.Container=tu,Be.Header=ru,Be.Body=nu,Be.Footer=au,Be.Layout=lu;const On={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},cu={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 u.useEffect(()=>{const d=s=>{s.key==="Escape"&&e&&!t&&o()};return e&&document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[e,t,o]),r.jsx(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=d=>{d.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",...cu[e],...c,onClick:l,transition:"transform 0.3s ease",...n,children:t})},iu=({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]})},su=({children:e,...o})=>r.jsx(i.Vertical,{padding:24,flex:1,overflowY:"auto",...o,children:e}),du=({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}),Xe=({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(qn,{isOpen:e,onClose:o,isClosePrevented:l,...c,children:r.jsx(Nn,{placement:t,size:n,style:d,children:a})})};Xe.Overlay=qn,Xe.Container=Nn,Xe.Header=iu,Xe.Body=su,Xe.Footer=du;const gu=(e=null,o=[])=>{const[t,n]=u.useState(e),[l,a]=u.useState(o),c=u.useRef({});return{activeItemId:t,setActiveItemId:n,expandedItemIds:l,toggleExpandedItem:g=>{a(h=>h.includes(g)?h.filter(m=>m!==g):[...h,g])},isItemExpanded:g=>l.includes(g),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"}},Ke={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=u.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),uu=({children:e,value:o})=>r.jsx(Gn.Provider,{value:o,children:e}),mo=()=>{const e=u.useContext(Gn);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},Ht=({children:e,views:o})=>{const{orientation:t}=mo(),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=u.createContext({itemValue:null,isDisabled:!1}),hu=()=>{const e=u.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:d,size:s,variant:g,onItemActivate:h}=mo(),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(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[g],...m?Ke.active:{},_hover:b?{}:Ke.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(w=>r.jsx(Bt,{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],...$t[g],...m?Ke.active:{},_hover:e.disabled?{}:Ke.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:d,variant:s,triggerRefs:g}=mo(),h=u.useRef(null),f=l===o,m=c(o);u.useEffect(()=>(h.current&&o&&(g.current[o]=h.current),()=>{o&&delete g.current[o]}),[o,g]);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],...$t[s],...f?Ke.active:{},_hover:t?{}:Ke.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}=mo(),c=u.useRef(null),[d,s]=u.useState({x:0,y:0,placement:l==="horizontal"?"bottom":"right"}),g=n(o);if(u.useEffect(()=>{if(g&&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}],I=w.find(z=>z.fits);if(I){s({x:I.x,y:I.y,placement:I.placement});return}const C=w.reduce((z,V)=>V.space>z.space?V:z);let T=C.x,j=C.y;T+p>x&&(T=x-p-8),T<8&&(T=8),j+b>y&&(j=y-b-8),j<8&&(j=8),s({x:T,y:j,placement:C.placement})}},[g,l,o,a]),!g)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})},fu=({href:e,children:o,views:t,...n})=>{const{itemValue:l,isDisabled:a}=hu(),{activeItemId:c,setActiveItemId:d,onItemActivate:s}=mo(),g=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":g?"page":void 0,"aria-disabled":a,"data-active":g?"":void 0,"data-disabled":a?"":void 0,...g?{fontWeight:"bold"}:{},...t==null?void 0:t.container,...n,children:o})},mu=({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))})})},Qe=({items:e,children:o,orientation:t="vertical",size:n="md",variant:l="default",defaultActiveItemId:a=null,defaultExpandedItemIds:c=[],onItemActivate:d,views:s,...g})=>{const{activeItemId:h,setActiveItemId:f,expandedItemIds:m,toggleExpandedItem:p,isItemExpanded:b,triggerRefs:x}=gu(a,c);return r.jsx(uu,{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(mu,{items:e,orientation:t,size:n,variant:l,views:s,...g}):o})};Qe.List=Ht,Qe.Item=Bt,Qe.Trigger=vn,Qe.Content=Xn,Qe.Link=fu;const Kn={},Qn=u.createContext({views:Kn,onRowClick:()=>{}}),pu=({children:e,views:o=Kn,onRowClick:t})=>r.jsx(Qn.Provider,{value:{views:o,onRowClick:t},children:e}),Ee=()=>u.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}=Ee();return r.jsx(i.Element,{as:"table",borderCollapse:"collapse",...de.table,...o==null?void 0:o.table,...e})},Jn=e=>{const{views:o}=Ee();return r.jsx(i.Element,{as:"thead",textAlign:"left",...de.thead,...o==null?void 0:o.thead,...e})},Rn=e=>{const{views:o}=Ee();return r.jsx(i.Element,{as:"th",whiteSpace:"nowrap",...de.th,...o==null?void 0:o.th,...e})},Yo=e=>{const{views:o,onRowClick:t}=Ee();return r.jsx(i.Element,{as:"tr",...de.tr,...o==null?void 0:o.tr,onClick:t,...e})},Lt=e=>{const{views:o}=Ee();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}=Ee();return r.jsx(i.Element,{as:"tbody",...de.tbody,...o==null?void 0:o.tbody,...e})},oa=e=>{const{views:o}=Ee();return r.jsx(i.Element,{as:"tfoot",...de.tfoot,...o==null?void 0:o.tfoot,...e})},ta=e=>{const{views:o}=Ee();return r.jsx(i.Element,{as:"caption",...de.caption,...o==null?void 0:o.caption,...e})},bu=({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(Yo,{children:o.map(a=>r.jsx(Rn,{children:a.title},a.field))})}),r.jsx(ea,{children:e.map((a,c)=>r.jsx(Yo,{children:o.map((d,s)=>r.jsx(Lt,{isFirstColumn:s===0,children:a[d.field]},d.field))},c))}),t&&r.jsx(oa,{children:r.jsx(Yo,{children:t.map((a,c)=>r.jsx(Lt,{...a.props,children:a.value},c))})})]}),we=({children:e,views:o,onClick:t})=>r.jsx(pu,{views:o,onRowClick:t,children:e});we.Head=Jn,we.HeadCell=Rn,we.Body=ea,we.Row=Yo,we.Cell=Lt,we.Footer=oa,we.Caption=ta,we.Container=Zn,we.Template=bu;const yu=(e,o,t)=>{const n=g=>g.value!==void 0?g.value:g.title,l=()=>{if(!(!e||e.length===0)){if(o!==void 0){const g=e.find(h=>n(h)===o);if(g)return g}return e[0]}},[a,c]=u.useState(l()),d=t!==void 0?e.find(g=>n(g)===t):a,s=g=>{t===void 0&&c(g)};return u.useEffect(()=>{if(t!==void 0)return;const g=l(),h=a&&e.some(f=>n(f)===n(a));g&&(!h||o!==void 0&&a&&n(a)!==o)?c(g):!g&&a&&c(void 0)},[e,o]),{activeTab:d,setActiveTab:s}},xu=(e,o,t)=>{const[n,l]=u.useState(e||null);return{activeValue:o!==void 0?o:n,setActiveValue:d=>{o===void 0&&l(d),t&&t(d)}}},ku=({tab:e,isActive:o,onClick:t,iconPosition:n="left",tabStyles:l,textStyles:a})=>{const c={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"}}},d=()=>{switch(n){case"top":return"column";case"bottom":return"column-reverse";case"right":return"row-reverse";case"left":default:return"row"}},s=()=>["top","bottom"].includes(n)?"4px":"8px",g=e.icon&&u.isValidElement(e.icon)?u.cloneElement(e.icon,{strokeWidth:o?2.5:2}):e.icon;return r.jsxs(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:[g&&r.jsx(i.Element,{children:g},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})]})]})},Cu=({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),g=()=>t(d);return l?l(d,s,g):r.jsx(ku,{tab:d,isActive:s,onClick:g,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,ra=u.createContext(null),na=()=>{const e=u.useContext(ra);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},wu=({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}),Iu=({value:e,children:o,disabled:t=!1,views:n})=>{const{activeValue:l,setActiveValue:a}=na(),c=l===e,d=()=>{t||a(e)};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})},Tu=({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})},ju=({tabs:e,views:o,defaultValue:t,onTabChange:n,renderTab:l,renderContent:a,iconPosition:c="left",value:d,onValueChange:s,children:g})=>{const h=xu(t,d,s),f=yu(e||[],t,d);if(g)return r.jsx(ra.Provider,{value:h,children:g});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(Cu,{tabs:e,views:o,activeTab:f.activeTab,handleTabClick:m,renderTab:l,renderContent:a,iconPosition:c})}return null},vo=u.memo(ju);vo.List=wu,vo.Trigger=Iu,vo.Content=Tu;const Su=e=>{const{children:o,_isInView:t=!1,alternateHighlightText:n=[],alternateAnimation:l=!1,alternateDuration:a=3e3,highlightText:c,highlightTypewriter:d=!1,highlightSlide:s=!1,highlightSlideDuration:g=500,highlightSlideStagger:h=50,highlightSlideSequential:f=!0}=e,[m,p]=u.useState(o),[b,x]=u.useState(c);return u.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 I=T=>{const j=n[T],z=k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),V=new RegExp(z,"gi"),P=y.replace(V,j);p(P),x(j)};I(w);const C=setInterval(()=>{w=(w+1)%n.length,I(w)},a);return()=>clearInterval(C)},[l,n,a,c,o,t]),{finalDisplayedText:m,activeHighlightTarget:b,highlightTypewriter:d,highlightSlide:s,highlightSlideDuration:g,highlightSlideStagger:h,highlightSlideSequential:f}},Mu={xs:24,sm:36,md:48,lg:64,xl:72},zu={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:()=>({})},Vu=({text:e,typingSpeed:o=50,pauseTime:t=500,onComplete:n,showCursor:l=!0,cursorColor:a="currentColor",textStyle:c,textComponent:d,as:s,...g})=>{const h=d||i.Text,f=Array.isArray(e)?e:[e],[m,p]=u.useState(f.map(()=>"")),[b,x]=u.useState(!1),[y,k]=u.useState(0),[w,I]=u.useState(0);u.useEffect(()=>{p(f.map(()=>"")),x(!1),k(0),I(0)},[e]),u.useEffect(()=>{if(b){n&&n();return}const T=f[y];if(w>=T.length){if(y>=f.length-1){x(!0);return}const z=setTimeout(()=>{k(V=>V+1),I(0)},t);return()=>clearTimeout(z)}const j=setTimeout(()=>{p(z=>{const V=[...z];return V[y]=T.substring(0,w+1),V}),I(z=>z+1)},o);return()=>clearTimeout(j)},[f,y,w,b,n,t,o]);const C=T=>{if(!T||typeof T!="string")return T;const j=T.split("|");return j.length===1?T:j.map((z,V)=>r.jsxs(u.Fragment,{children:[z,V<j.length-1&&r.jsx("br",{})]},V))};return r.jsx(r.Fragment,{children:m.map((T,j)=>r.jsxs(u.Fragment,{children:[C(T),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))})},Eu=({text:e,duration:o=500,direction:t="up",stagger:n=50,sequential:l=!1,textStyle:a,as:c,wordProps:d,textComponent:s,...g})=>{const[h,f]=u.useState(e),[m,p]=u.useState("entering"),[b,x]=u.useState(0),y=s||i.Text,k=u.useRef(null),w=u.useRef(null);u.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:I,totalWordCount:C}=u.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]),T=u.useMemo(()=>l?C*(o+n):(C-1)*n+o,[C,o,n,l]),j=u.useMemo(()=>l?C*(o+n):(C-1)*n+o,[C,o,n,l]);u.useEffect(()=>(w.current&&clearTimeout(w.current),m==="entering"?w.current=setTimeout(()=>{p("visible")},T+50):m==="exiting"&&(w.current=setTimeout(()=>{k.current!==null&&(f(k.current),k.current=null),x(W=>W+1),p("entering")},j+50)),()=>{w.current&&clearTimeout(w.current)}),[m,T,j]);const{style:z,...V}=d||{},P=t==="up",B=W=>l?W*(o+n):W*n,S=u.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",lineHeight:"normal",...a}),[a]),H=u.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),A=u.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let E=0;return r.jsx(i.Element,{as:"span",style:S,...g,children:r.jsx("span",{style:H,children:I.map((W,$)=>r.jsx("span",{style:A,children:W.map((_,L)=>{const D=E++,F=B(D),q=L===W.length-1;let O;const N=`${o}ms`,K=`${F}ms`;m==="entering"?O=P?i.Animation.slideInUp({duration:N,delay:K,timingFunction:"ease-out",fillMode:"both"}):i.Animation.slideInDown({duration:N,delay:K,timingFunction:"ease-out",fillMode:"both"}):m==="exiting"&&(O=P?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:N,delay:K,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:N,delay:K,timingFunction:"ease-in",fillMode:"both"});const Q={...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,...Q,children:_},`${b}-${$}-${L}`)})},`line-${$}`))})})};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(u.Fragment,{children:[t,n<o.length-1&&r.jsx("br",{})]},n))},Pu=({children:e,highlightText:o,highlightStyle:t="solid",highlightColor:n="theme-primary",highlightSecondaryColor:l,size:a="lg",views:c,highlightAnimate:d,animate:s,animationLoop:g=1,highlightAnimationLoop:h=1,highlightTypewriter:f=!1,highlightTypewriterDuration:m=3e3,highlightSlide:p=!1,highlightSlideDuration:b=500,highlightSlideStagger:x=50,highlightSlideSequential:y=!0,themeMode:k,...w})=>{const{ref:I,inView:C}=i.useInView(),{finalDisplayedText:T,activeHighlightTarget:j,highlightTypewriter:z,highlightSlide:V,highlightSlideDuration:P,highlightSlideStagger:B,highlightSlideSequential:S}=Su({children:e,highlightText:o,_isInView:C,highlightTypewriter:f,highlightSlide:p,highlightSlideDuration:b,highlightSlideStagger:x,highlightSlideSequential:y,...w}),H=Mu[a],A=zu[t](n,l),E=(F,q)=>F&&(Array.isArray(F)?F.map(O=>({...O,iterationCount:q.toString()})):{...F,iterationCount:q.toString()}),W=E(s,g),$=E(d,h),_=typeof T=="string"?T:typeof e=="string"?e:"",L={ref:I,animate:C?W:void 0,as:"h1",fontSize:H},D=F=>!C&&(z||V)?r.jsx("span",{style:{opacity:0},children:F}):z?r.jsx(Vu,{text:F,typingSpeed:Math.max(30,m/(F.length*10)),cursorColor:"currentColor",...A}):V?r.jsx(Eu,{text:F,duration:P,stagger:B,sequential:S,direction:"up",fontSize:H,wordProps:A}):At(F);if(typeof _=="string"&&j){const F=Array.isArray(j)?new RegExp(`(${j.map(K=>aa(String(K))).join("|")})`,"gi"):new RegExp(`(${aa(String(j))})`,"gi"),q=[];let O=0,N;for(;N=F.exec(_);)N.index>O&&q.push(_.substring(O,N.index)),q.push({highlight:!0,text:N[0]}),O=N.index+N[0].length;return O<_.length&&q.push(_.substring(O)),r.jsx(i.Element,{...L,...c==null?void 0:c.container,...w,children:q.map((K,Q)=>typeof K=="string"?r.jsx(i.Text,{as:"span",display:"inline",...c==null?void 0:c.text,children:At(K)},`text-${Q}`):r.jsx(i.Text,{as:"span",display:"inline",animate:C?$:void 0,...V?{}:A,...c==null?void 0:c.highlight,children:D(K.text)},`highlight-${Q}`))})}return t&&!j?r.jsx(i.Element,{...L,...w,...c==null?void 0:c.container,children:r.jsx(i.Text,{as:"span",display:"inline",animate:C?$:void 0,...V?{}:A,...c==null?void 0:c.highlight,children:D(_)})}):r.jsx(i.Text,{...L,...w,...c==null?void 0:c.container,...c==null?void 0:c.text,children:At(_)})},Wu=e=>r.jsx(Pu,{...e}),_u=({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})},$u=({items:e,onChange:o})=>{const[t,n]=u.useState(e),[l,a]=u.useState(null),[c,d]=u.useState(null),s=u.useRef({x:0,y:0}),g=u.useRef([]),h=u.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=u.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=g.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 I=g.current.findIndex((C,T)=>{if(!C||T===c)return!1;const j=C.getBoundingClientRect();return x>=j.top&&x<=j.bottom});if(I!==-1&&I!==c){const C=[...t],[T]=C.splice(c,1);C.splice(I,0,T),n(C),d(I),o==null||o(C),s.current={x:b,y:x}}},[c,t,o]),m=u.useCallback(()=>{document.body.style.cursor="",g.current.forEach(p=>{p&&(p.style.transform="",p.style.zIndex="")}),d(null),a(null)},[c]);return u.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:g,handleDragStart:h}},Hu=({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((g,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(g,h):g},h))}),la=e=>{const{items:o,draggedIndex:t,itemRefs:n,handleDragStart:l}=$u(e);return r.jsx(Hu,{...e,items:o,draggedIndex:t,itemRefs:n,handleDragStart:l})},Bu=la,Lu=({onFileSelect:e,onMultipleFileSelect:o,validateFile:t,accept:n,multiple:l,disabled:a,previewUrl:c})=>{const[d,s]=u.useState(!1),[g,h]=u.useState(null),f=u.useRef(null),m=c!==void 0?c:g;u.useEffect(()=>()=>{g&&URL.revokeObjectURL(g)},[g]);const p=u.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!a&&s(!0)},[a]),b=u.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!a&&s(!1)},[a]),x=u.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!a&&s(!0)},[a]),y=u.useCallback(C=>{if(!C||C.length===0)return;const T=Array.from(C);if(!l&&T.length>0){const j=T[0];if(j.type.startsWith("image/")){const z=URL.createObjectURL(j);h(V=>(V&&URL.revokeObjectURL(V),z))}else h(null)}l?o&&o(T):T.length>0&&e&&e(T[0])},[l,o,e]),k=u.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=u.useCallback(()=>{var C;a||(C=f.current)==null||C.click()},[a]),I=u.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:I,inputRef:f,preview:m}},Au={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 d=u.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(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,g)=>{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(To,{widthHeight:24,color:"color-black"})}),!f&&!m&&!p&&r.jsx(i.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(oo,{widthHeight:24,color:"color-black"})}),t&&r.jsx(i.Button,{...Au,onClick:b=>{b.stopPropagation(),t(g)},"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),")"]})]})]})},g)})})},Du=({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:g,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:g,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: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(ca,{files:k,onRemove:w||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),Fu=e=>{const o=Lu(e);return r.jsx(Du,{...e,...o})},Ou=(e=!1)=>{const[o,t]=u.useState(e),[n,l]=u.useState(null);return u.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}},qu={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Nu={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"}},Uu={hover:{backgroundColor:"color-gray-100"}},ia=u.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),Gu=({children:e,value:o})=>r.jsx(ia.Provider,{value:o,children:e}),Dt=()=>{const e=u.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=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})},Ft=({items:e,side:o="bottom",align:t="start",views:n,...l})=>{const{isOpen:a,variant:c,triggerRef:d}=Dt(),s=u.useRef(null),{ref:g,relation:h}=i.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[f,m]=u.useState({x:0,y:0,placement:o});if(u.useEffect(()=>{d.current&&g&&(g.current=d.current)},[d,g,a]),u.useEffect(()=>{if(a&&s.current&&d.current){const 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,...Nu[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,d]=u.useState(!1),s=e.items&&e.items.length>0,g=n===e.id,h=u.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",...qu[a],_hover:e.disabled?{}:Uu.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})}),g&&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}),Yu=({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})]}),po=({trigger:e,items:o,size:t="md",variant:n="default",side:l="bottom",align:a="start",defaultOpen:c=!1,views:d,...s})=>{const{isOpen:g,setIsOpen:h,activeSubmenuId:f,setActiveSubmenuId:m}=Ou(c),p=u.useRef(null);return r.jsx(Gu,{value:{isOpen:g,setIsOpen:h,activeSubmenuId:f,setActiveSubmenuId:m,size:t,variant:n,triggerRef:p},children:r.jsx(Yu,{trigger:e,items:o,side:l,align:a,views:d,...s})})};po.Trigger=sa,po.Content=Ft,po.Item=da,po.Divider=ga;const vu=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:l,isOpen:a,onOpen:c,onClose:d,closeOnSelect:s=!0,maxRecentColors:g=8,showRecentColors:h=!0}=e,[f,m]=u.useState(a??!1),[p,b]=u.useState(o??t),[x,y]=u.useState(""),[k,w]=u.useState([]),I=u.useRef(null),C=u.useRef(null);u.useEffect(()=>{o!==void 0&&b(o)},[o]),u.useEffect(()=>{a!==void 0&&m(a)},[a]),u.useEffect(()=>{if(h){const S=localStorage.getItem("colorPicker-recentColors");if(S)try{w(JSON.parse(S))}catch{}}},[h]),u.useEffect(()=>{const S=H=>{f&&I.current&&C.current&&!I.current.contains(H.target)&&!C.current.contains(H.target)&&B()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[f]);const T=u.useCallback(S=>{h&&w(H=>{const A=H.filter(W=>W!==S),E=[S,...A].slice(0,g);return localStorage.setItem("colorPicker-recentColors",JSON.stringify(E)),E})},[h,g]),j=u.useCallback(()=>{const S=!f;m(S),S?c==null||c():d==null||d()},[f,c,d]),z=u.useCallback(S=>{b(S),T(S),n==null||n(S),l==null||l(S),s&&(m(!1),d==null||d())},[n,l,s,d,T]),V=u.useCallback(S=>{y(S)},[]),P=u.useCallback(()=>{x&&(z(x),y(""))},[x,z]),B=u.useCallback(()=>{m(!1),d==null||d()},[d]);return{isOpen:f,selectedColor:p,recentColors:k,customColor:x,handleToggle:j,handleColorSelect:z,handleCustomColorChange:V,handleCustomColorSubmit:P,handleClose:B,triggerRef:I,dropdownRef:C}},Ze={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"}},Xu={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"}},Ku={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Qu={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"}},Zu=[{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"}],Ju=({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:g=!1,isDisabled:h=!1,isReadOnly:f=!1,predefinedColors:m=Zu,showCustomInput:p=!0,showRecentColors:b=!0,isOpen:x,selectedColor:y,recentColors:k,customColor:w,handleToggle:I,handleColorSelect:C,handleCustomColorChange:T,handleCustomColorSubmit:j,triggerRef:z,dropdownRef:V,onChange:P,...B})=>{const{getColor:S}=i.useTheme(),H={...Ze.container,...a==null?void 0:a.container},A={...Ze.trigger,...Xu[c],...Ku[d],...Qu[s],...g&&{borderColor:"color-red-500"},...h&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},E={...Ze.dropdown,...a==null?void 0:a.dropdown},W={...Ze.colorGrid,...a==null?void 0:a.colorGrid},$={...Ze.recentColors,...a==null?void 0:a.recentColors},_=y||"color-gray-200";return r.jsxs(i.View,{...H,...B,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:I,...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,{...W,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,{...Ze.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;T(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(go,{placeholder:"Enter hex color (e.g., #ff0000)",value:w,onChange:L=>T(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:g?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:l})]})},Ru=e=>{const o=vu(e);return r.jsx(Ju,{...o,...e})},eh=e=>{const o=An(e);return r.jsx(Dn,{...o,...e})},oh=e=>{const o=Bn(e);return r.jsx(Ln,{...o,...e})},th=(e=null,o=null)=>{const[t,n]=u.useState(e),[l,a]=u.useState(o),c=s=>l===s,d=s=>{a(g=>g===s?null:s)};return u.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)},g=h=>{h.key==="Escape"&&l!==null&&a(null)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",g)}},[l]),{activeMenuId:t,setActiveMenuId:n,openMenuId:l,setOpenMenuId:a,isMenuOpen:c,toggleMenu:d}},ua={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},rh={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"}},nh={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Xo={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},ha=u.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),Ko=()=>u.useContext(ha),ah=({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,...nh[o],...rh[n],...l==null?void 0:l.container,...a,children:e})},ma=({children:e,id:o,disabled:t=!1,views:n})=>{const{orientation:l}=Ko(),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:u.Children.map(e,c=>u.isValidElement(c)?u.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:d,size:s,triggerRefs:g}=Ko(),h=u.useRef(null),f=l===o,m=d(o);u.useEffect(()=>(h.current&&o&&(g.current[o]=h.current),()=>{o&&delete g.current[o]}),[o,g]);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?Xo.active:{},...t?Xo.disabled:{},_hover:t?{}:Xo.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}=Ko(),c=u.useRef(null),[d,s]=u.useState({x:0,y:0,placement:l==="horizontal"?"bottom":"right"}),g=n(o);if(u.useEffect(()=>{if(g&&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}],I=w.find(z=>z.fits);if(I){s({x:I.x,y:I.y,placement:I.placement});return}const C=w.reduce((z,V)=>V.space>z.space?V:z);let T=C.x,j=C.y;T+p>x&&(T=x-p-8),T<8&&(T=8),j+b>y&&(j=y-b-8),j<8&&(j=8),s({x:T,y:j,placement:C.placement})}},[g,l,o,a]),!g)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})},ya=({children:e,icon:o,disabled:t=!1,onClick:n,views:l})=>{const{size:a}=Ko(),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?{}:Xo.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}),lh=({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((d,s)=>d.separator?r.jsx(xa,{views:l},`separator-${s}`):r.jsx(ya,{id:d.id,icon:d.icon,disabled:d.disabled,onClick:d.onClick,views:l,children:d.label},d.id))})]},c.id))}),Le=({items:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultActiveMenuId:l=null,defaultOpenMenuId:a=null,views:c,...d})=>{const{activeMenuId:s,setActiveMenuId:g,openMenuId:h,setOpenMenuId:f,isMenuOpen:m,toggleMenu:p}=th(l,a),b=u.useRef({});return r.jsx(ah,{value:{activeMenuId:s,setActiveMenuId:g,openMenuId:h,setOpenMenuId:f,isMenuOpen:m,toggleMenu:p,orientation:o,size:t,variant:n,triggerRefs:b},children:r.jsx(lh,{items:e,orientation:o,size:t,variant:n,views:c,...d})})};Le.Root=fa,Le.Menu=ma,Le.Trigger=pa,Le.Content=ba,Le.Item=ya,Le.Separator=xa;const ch=(e,o,t)=>{const[n,l]=u.useState([]);return u.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 g=d;g<=s;g++)c.push(g);s<o-1&&c.push("..."),c.push(o)}return c})())},[e,o,t]),{visiblePageNumbers:n}},Je={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"}}}},bo={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"}}},yo={rounded:{borderRadius:"4px"},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},ih={backgroundColor:"color-blue-500",color:"color-white",_hover:{backgroundColor:"color-blue-600"}},Qo={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},sh=({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:g=!1,size:h="md",variant:f="default",shape:m="rounded",visiblePageNumbers:p,views:b,...x})=>{const y=I=>{I<1||I>o||I===e||t(I)},k=I=>{a&&a(Number(I.target.value))},w=(I,C)=>{if(I==="...")return r.jsx(i.View,{display:"flex",alignItems:"center",justifyContent:"center",...Je[h],...b==null?void 0:b.ellipsis,children:"..."},`ellipsis-${C}`);const T=I===e;return r.jsx(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:T?"default":"pointer",...Je[h],...bo[f],...yo[m],...T?ih:{},onClick:()=>y(I),"aria-label":`Page ${I}`,"aria-current":T?"page":void 0,...T?b==null?void 0:b.activePageButton:b==null?void 0:b.pageButton,children:I},`page-${I}`)};return r.jsxs(i.Horizontal,{alignItems:"center",gap:8,...b==null?void 0:b.container,...x,children:[g&&r.jsxs(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Je[h],...bo[f],...yo[m],...e===1?Qo:{},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",...Je[h],...bo[f],...yo[m],...e===1?Qo:{},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((I,C)=>w(I,C)),r.jsx(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Je[h],...bo[f],...yo[m],...e===o?Qo:{},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})}),g&&r.jsxs(i.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Je[h],...bo[f],...yo[m],...e===o?Qo:{},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(I=>r.jsx("option",{value:I.value,children:I.label},I.value))})]})},dh=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:l,onPageSizeChange:a,showPageSizeSelector:c=!1,showPageInfo:d=!0,maxPageButtons:s=5,showFirstLastButtons:g=!1,size:h="md",variant:f="default",shape:m="rounded",views:p,...b})=>{const{visiblePageNumbers:x}=ch(e,o,s);return r.jsx(sh,{currentPage:e,totalPages:o,onPageChange:t,pageSize:n,pageSizeOptions:l,onPageSizeChange:a,showPageSizeSelector:c,showPageInfo:d,maxPageButtons:s,showFirstLastButtons:g,size:h,variant:f,shape:m,visiblePageNumbers:x,views:p,...b})},gh=({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:g=!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,T=y(l,{themeMode:w}),j=y(n,{themeMode:w});if(e==="circle"){const V=c||(typeof a=="number"?a:100),P=(V-s)/2,B=2*Math.PI*P,S=B-C/100*B;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:P,stroke:T,strokeWidth:s,fill:"transparent",...p==null?void 0:p.track}),r.jsx("circle",{cx:V/2,cy:V/2,r:P,stroke:j,strokeWidth:s,strokeDasharray:B,strokeDashoffset:S,strokeLinecap:"round",fill:"transparent",style:{transition:f?`stroke-dashoffset ${m} ease-in-out`:"none"},...p==null?void 0:p.indicator})]}),g&&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:T,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})})},uh=e=>r.jsx(gh,{...e}),hh=(e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}))(),fh={thin:"1px",medium:"2px",thick:"4px"},xo={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"}},mh=({orientation:e="horizontal",variant:o="solid",thickness:t="thin",color:n,spacing:l="0px",label:a,decorative:c=!1,views:d,themeMode:s,...g})=>{const{themeMode:h}=i.useTheme(),f=n||"color-gray-200",m=hh[o],p=fh[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,...g,children:[r.jsx(i.View,{height:"0px",flexGrow:1,borderTopWidth:p,borderTopStyle:m,borderTopColor:f,...xo.container,...d==null?void 0:d.container}),r.jsx(i.Text,{...xo.label,...d==null?void 0:d.label,children:a}),r.jsx(i.View,{height:"0px",flexGrow:1,borderTopWidth:p,borderTopStyle:m,borderTopColor:f,...xo.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,...xo.container,...b,...d==null?void 0:d.container,...g}):r.jsx(i.View,{width:"0px",height:"100%",borderLeftWidth:p,borderLeftStyle:m,borderLeftColor:f,padding:l,...xo.container,...b,...d==null?void 0:d.container,...g})},ka=e=>r.jsx(mh,{...e}),ph=ka,bh=ka,yh={xs:12,sm:14,md:16,lg:18,xl:20},xh=({isSupported:e,isSharing:o,onShare:t,label:n,children:l,icon:a,size:c,isDisabled:d,isLoading:s,iconPosition:g,disableWhenUnsupported:h=!0,...f})=>{const m=c??"md",p=a??r.jsx(or,{widthHeight:yh[m],strokeWidth:1.5,filled:!1}),b=!!d||!e&&h,x=!!s||o;return r.jsx(Pe,{...f,size:m,icon:p,iconPosition:g??"left",isDisabled:b,isLoading:x,onClick:t,children:l??n??"Share"})},Ca=()=>typeof navigator>"u"?void 0:navigator,kh=(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},Ch=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},wh=e=>{const{shareData:o,onClick:t,onUnsupported:n,onShareStart:l,onShareSuccess:a,onShareCancel:c,onShareError:d}=e,[s,g]=u.useState(!1),h=u.useMemo(()=>kh(Ca(),o),[o]),f=u.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){d==null||d(b);return}g(!0),l==null||l();try{p.share(o).then(()=>{a==null||a()}).catch(b=>{if(Ch(b)==="AbortError"){c==null||c();return}d==null||d(b)}).finally(()=>{g(!1)})}catch(b){g(!1),d==null||d(b)}}},[s,t,c,d,l,a,n,o]);return{isSupported:h,isSharing:s,handleShare:f}},Ih=e=>{const{isSupported:o,isSharing:t,handleShare:n}=wh(e),{shareData:l,onShareStart:a,onShareSuccess:c,onShareCancel:d,onShareError:s,onUnsupported:g,onClick:h,...f}=e;return r.jsx(xh,{...f,isSupported:o,isSharing:t,onShare:n})},Th=({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})]})},jh=e=>r.jsx(Th,{...e}),Sh=(e=!0,o,t,n)=>{const{on:l}=i.useResponsive(),a=l("mobile"),[c,d]=u.useState(o!==void 0?o:e);return u.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}},Mh={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},zh=(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"}}))(),Vh={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},Eh={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)"}},Ph={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=u.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),Zo=()=>u.useContext(wa),Wh=({value:e,children:o})=>r.jsx(wa.Provider,{value:e,children:o}),_h=({children:e,showToggleButton:o=!0,views:t,...n})=>{const{isExpanded:l,toggleExpanded:a,position:c}=Zo();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})})})})},$h=({children:e,views:o,...t})=>{const{isExpanded:n}=Zo();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})},Hh=({children:e,views:o,...t})=>{const{isExpanded:n}=Zo();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})},Bh=({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:g="none",transitionPreset:h="normal",ariaLabel:f="Sidebar navigation",isExpanded:m,isMobile:p,collapse:b,views:x,themeMode:y,...k})=>{const w=Mh[t],I=m?c||w.expandedWidth:d||w.collapsedWidth,C=!p||p&&s!=="hide",T=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:T,top:0,height:"100vh",width:I,zIndex:999,transition:Ph[h],transform:p&&s==="overlay"&&!m?`translateX(${o==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":f,...zh[n],...Vh[o],...Eh[g],...x==null?void 0:x.container,...k,children:u.Children.map(e,z=>z)})]})},ko=({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:g=!0,expandedWidth:h,collapsedWidth:f,breakpoint:m=768,breakpointBehavior:p="overlay",views:b,...x})=>{const{isExpanded:y,toggleExpanded:k,expand:w,collapse:I,isMobile:C}=Sh(l,a,c);return r.jsx(Wh,{value:{isExpanded:y,toggleExpanded:k,expand:w,collapse:I,position:o,size:t,variant:n,views:b},children:r.jsx(Bh,{position:o,size:t,variant:n,fixed:d,hasBackdrop:s,showToggleButton:g,expandedWidth:h,collapsedWidth:f,breakpoint:m,breakpointBehavior:p,isExpanded:y,isMobile:C,toggleExpanded:k,expand:w,collapse:I,views:b,...x,children:e})})};ko.Header=_h,ko.Content=$h,ko.Footer=Hh,ko.useContext=Zo;const Lh=()=>({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)}}}),Ah=(e,o,t,n=50,l=1/0,a=!1,c,d,s=10)=>{const[g,h]=u.useState(!1),[f,m]=u.useState([]),p=u.useRef(null),b=u.useRef(null),x=u.useRef(0),y=u.useRef([]),k=u.useRef(d||(typeof window<"u"?Lh():null)),w=u.useCallback(()=>p.current?e==="horizontal"?p.current.offsetWidth:p.current.offsetHeight:0,[e]),I=u.useCallback(()=>{if(!c||!k.current)return null;const W=k.current.getItem(c);if(!W)return null;try{const $=JSON.parse(W);return Array.isArray($.sizes)?$.sizes:null}catch($){return console.warn("Failed to parse saved panel sizes:",$),null}},[c]),C=u.useCallback(()=>{if(!c||!k.current||f.length===0)return;const W=f.map($=>({id:$.id,size:$.size,collapsed:$.collapsed||!1}));k.current.setItem(c,JSON.stringify({sizes:W}))},[c,f]),T=u.useCallback((W,$,_,L,D)=>{m(F=>F.some(q=>q.id===W)?F:[...F,{id:W,size:$,minSize:_??n,maxSize:L??l,collapsible:D??a,collapsed:!1}])},[n,l,a]),j=u.useCallback(W=>{m($=>$.filter(_=>_.id!==W))},[]),z=u.useCallback(W=>{const $=f.find(_=>_.id===W);return $?$.size:0},[f]),V=u.useCallback((W,$)=>{m(_=>_.map(L=>L.id===W?{...L,size:$}:L))},[]),P=u.useCallback(W=>{const $=f.find(_=>_.id===W);return $?!!$.collapsed:!1},[f]),B=u.useCallback(W=>{m($=>{const _=$.findIndex(q=>q.id===W);if(_===-1)return $;const L=$[_];if(!L.collapsible)return $;const D={...L,collapsed:!L.collapsed},F=[...$];return F[_]=D,F})},[]),S=u.useCallback((W,$)=>{b.current=W,x.current=$,y.current=f.map(_=>_.size),h(!0)},[f]),H=u.useCallback(W=>{if(!g||!b.current)return;const $=b.current,_=W-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(K=>K.map((Q,Y)=>Y===L?{...Q,size:O}:Y===L+1?{...Q,size:N}:Q))},[g,f,e,n,l]),A=u.useCallback(()=>{g&&t&&t(f.map(W=>W.size)),b.current=null,h(!1),c&&C()},[g,f,t,c,C]),E=u.useCallback(W=>{if(!g||!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"?(W.key==="ArrowLeft"&&(D=-s),W.key==="ArrowRight"&&(D=s),W.key==="Home"&&(D=-100),W.key==="End"&&(D=100)):(W.key==="ArrowUp"&&(D=-s),W.key==="ArrowDown"&&(D=s),W.key==="Home"&&(D=-100),W.key==="End"&&(D=100)),D!==0&&(W.preventDefault(),H(x.current+D)),W.key==="Escape"&&(m(F=>F.map((q,O)=>({...q,size:y.current[O]}))),A())},[g,f,e,H,A,s]);return u.useEffect(()=>{const W=L=>{if(!g)return;const D=e==="horizontal"?L.clientX:L.clientY;H(D)},$=L=>{if(!g||L.touches.length===0)return;const D=L.touches[0],F=e==="horizontal"?D.clientX:D.clientY;H(F)},_=()=>{g&&A()};return g&&(document.addEventListener("mousemove",W),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",W),document.removeEventListener("touchmove",$),document.removeEventListener("mouseup",_),document.removeEventListener("touchend",_),document.removeEventListener("keydown",E),document.body.style.cursor="",document.body.style.userSelect=""}},[g,e,H,A,E]),u.useEffect(()=>{if(f.length!==0){if(c){const W=I();if(W){m($=>$.map(_=>{const L=W.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,I]),u.useEffect(()=>{if(!o||o.length===0||f.length===0)return;const W=w(),$=o.map(_=>typeof _=="string"&&_.endsWith("%")?parseFloat(_)/100*W:typeof _=="number"?_:parseFloat(_));m(_=>_.map((L,D)=>({...L,size:D<$.length?$[D]:L.size})))},[o,f.length,w]),u.useEffect(()=>{f.length>0&&c&&!g&&C()},[f,c,g,C]),{isResizing:g,setIsResizing:h,containerRef:p,panels:f,registerPanel:T,unregisterPanel:j,getPanelSize:z,setPanelSize:V,isPanelCollapsed:P,togglePanelCollapse:B,startResize:S,onResize:H,endResize:A}},Dh={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Fh=(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],Oh=(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"}}}))(),Jo={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=u.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),Ta=()=>u.useContext(Ia),qh=({value:e,children:o})=>r.jsx(Ia.Provider,{value:e,children:o}),Nh=({children:e,id:o,defaultSize:t,minSize:n,maxSize:l,collapsible:a,defaultCollapsed:c,onCollapseChange:d,views:s,...g})=>{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;u.useEffect(()=>(f(o,y,n,l,a),()=>m(o)),[o,y,n,l,a,f,m]);const k=p(o),w=b(o);return u.useEffect(()=>{d&&w!==void 0&&d(w)},[w,d]),u.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,...g}):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,...g,children:e})},Uh=({id:e,position:o="both",disabled:t=!1,withVisualIndicator:n=!0,withCollapseButton:l=!1,collapseTarget:a,views:c,...d})=>{const{orientation:s,size:g,variant:h,startResize:f,isPanelCollapsed:m,togglePanelCollapse:p}=Ta(),x=(()=>{if(a)return a;const T=e.match(/\d+$/);if(!T)return"";const j=parseInt(T[0],10);return isNaN(j)?"":`panel${j}`})(),y=m(x),k=T=>{if(t)return;T.preventDefault();const j=s==="horizontal"?T.clientX:T.clientY;f(e,j)},w=T=>{if(t||T.touches.length===0)return;T.preventDefault();const j=T.touches[0],z=s==="horizontal"?j.clientX:j.clientY;f(e,z)},I=T=>{t||(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f(e,0))},C=T=>{T.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",...Fh(g,s),...Oh[h],onMouseDown:k,onTouchStart:w,onKeyDown:I,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,{...Jo.horizontal}),r.jsx(i.View,{...Jo.horizontal})]}):r.jsxs(i.Vertical,{gap:1,children:[r.jsx(i.View,{...Jo.vertical}),r.jsx(i.View,{...Jo.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"})})})]})},Gh=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:l,minSize:a,maxSize:c,collapsible:d=!1,containerRef:s,autoSaveId:g,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",...Dh[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:d,collapsible:s=!1,autoSaveId:g,storage:h,keyboardResizeBy:f=10,views:m,...p})=>{const{isResizing:b,setIsResizing:x,containerRef:y,registerPanel:k,unregisterPanel:w,getPanelSize:I,setPanelSize:C,isPanelCollapsed:T,togglePanelCollapse:j,startResize:z,onResize:V,endResize:P}=Ah(o,l,a,c,d,s,g,h,f);return r.jsx(qh,{value:{orientation:o,size:t,variant:n,isResizing:b,setIsResizing:x,registerPanel:k,unregisterPanel:w,getPanelSize:I,setPanelSize:C,isPanelCollapsed:T,togglePanelCollapse:j,startResize:z,onResize:V,endResize:P},children:r.jsx(Gh,{orientation:o,size:t,variant:n,defaultSizes:l,minSize:c,maxSize:d,collapsible:s,autoSaveId:g,keyboardResizeBy:f,containerRef:y,views:m,...p,children:e})})};Ot.Panel=Nh,Ot.Handle=Uh;const Ro={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"}}},Yh={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"}},vh=()=>Math.random().toString(36).substring(2,9);let Re=new Map;const Co=tt.create(e=>({toasts:[],add:(o,t,n,l={})=>{const a=l.id||vh(),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(()=>{Co.getState().remove(a)},d);Re.set(a,s)}return a},remove:o=>{e(t=>({toasts:t.toasts.map(n=>n.id===o?{...n,isVisible:!1}:n)})),Re.has(o)&&(clearTimeout(Re.get(o)),Re.delete(o)),setTimeout(()=>{e(t=>({toasts:t.toasts.filter(n=>n.id!==o)}))},300)},removeAll:()=>{Re.forEach(clearTimeout),Re.clear(),e(o=>({toasts:o.toasts.map(t=>({...t,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),Ae=(e,o,t,n)=>Co.getState().add(e,o,t,n),ja=(e,o,t)=>Ae("info",e,o,t),Sa=(e,o,t)=>Ae("success",e,o,t),Ma=(e,o,t)=>Ae("warning",e,o,t),za=(e,o,t)=>Ae("error",e,o,t),Va=e=>{Co.getState().remove(e)},Ea=()=>{Co.getState().removeAll()},Pa=({variant:e,title:o,description:t,onClose:n,isClosable:l=!0,action:a,actionText:c,showIcon:d=!0,theme:s,views:g,render:h,icon:f,id:m,isVisible:p=!0,themeMode:b})=>{const x=s??Ro,y=()=>{var C,T;if(f!==void 0)return f;const I=e?(T=(C=Ro[e])==null?void 0:C.icon)==null?void 0:T.color:Ro.info.icon.color;switch(e){case"info":return r.jsx(je,{widthHeight:20,color:I});case"success":return r.jsx(at,{widthHeight:20,color:I});case"warning":return r.jsx(je,{widthHeight:20,color:I,orientation:"down"});case"error":return r.jsx(jo,{widthHeight:20,color:I});default:return r.jsx(je,{widthHeight:20,color:Ro.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",...g==null?void 0:g.container,children:[d&&r.jsx(i.View,{marginTop:"2px",...g==null?void 0:g.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,...g==null?void 0:g.title,children:o}),t&&r.jsx(i.Text,{size:"sm",color:x[e].content.color,fontWeight:"400",backgroundColor:x[e].container.backgroundColor,...g==null?void 0:g.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:I=>{I.stopPropagation(),a()},_hover:{textDecoration:"underline"},transition:"all 0.2s ease",...g==null?void 0:g.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:I=>{I.stopPropagation(),n()},_hover:{backgroundColor:"rgba(0, 0, 0, 0.05)"},transition:"all 0.2s ease",...g==null?void 0:g.closeButton,children:r.jsx(pe,{widthHeight:16,color:x[e].content.color})})]})},Xh=({position:e="top-right",gap:o=8,limit:t=5,containerStyle:n})=>{const{toasts:l,remove:a}=Co(),d=u.useMemo(()=>{const s={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return l.forEach(g=>{const h=g.position||e;s[h].push(g)}),Object.keys(s).forEach(g=>{s[g]=s[g].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",...Yh[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(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))})},Kh=()=>({toast:(e,o,t,n)=>Ae(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()}),Qh=Object.assign(e=>r.jsx(Pa,{...e}),{Container:e=>r.jsx(Xh,{...e}),show:Ae,info:ja,success:Sa,warning:Ma,error:za,remove:Va,removeAll:Ea}),Zh=Kh,Wa=(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},Jh=({open:e,onOpenChange:o,groups:t=[],commands:n=[],filter:l})=>{const[a,c]=u.useState(""),[d,s]=u.useState(0),g=u.useRef(null),h=u.useMemo(()=>l||Wa,[l]),f=u.useMemo(()=>[...t.flatMap(y=>y.commands),...n],[t,n]),m=u.useMemo(()=>a.trim()?f.filter(x=>h(a,x)):f,[f,a,h]),p=u.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]);u.useEffect(()=>{s(0)},[m.length]);const b=u.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 u.useEffect(()=>(document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}),[b]),u.useEffect(()=>{if(g.current&&e){const x=g.current.querySelector(`[data-index="${d}"]`);x&&x.scrollIntoView({block:"nearest"})}},[d,e]),u.useEffect(()=>{e?s(0):c("")},[e]),{search:a,setSearch:c,selectedIndex:d,setSelectedIndex:s,filteredCommands:m,filteredGroups:p,listRef:g}},Rh={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},ef=(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)"}}))(),of={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},tf={overflow:"auto",padding:"8px 0"},rf={marginBottom:"8px"},nf={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},af={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},lf={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},cf={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},sf={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},df={display:"flex",flexDirection:"column",flex:1},gf={fontSize:"14px",fontWeight:"medium"},uf={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},hf={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},ff={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},mf={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},pf=u.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),bf=({value:e,children:o})=>r.jsx(pf.Provider,{value:e,children:o}),_a=({value:e,onValueChange:o,placeholder:t="Type a command or search...",views:n,...l})=>{const a=u.useRef(null);return u.useEffect(()=>{a.current&&a.current.focus()},[]),r.jsxs(i.View,{...of,...n==null?void 0:n.container,...l,children:[r.jsx(Mo,{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})]})},yf=({children:e,views:o,...t})=>r.jsx(i.View,{...tf,...o==null?void 0:o.container,...t,children:e}),$a=({heading:e,children:o,views:t,...n})=>r.jsxs(i.View,{...rf,...t==null?void 0:t.container,...n,children:[r.jsx(i.Text,{...nf,...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,{...af,...o?lf:{},...e.disabled?cf:{},onClick:a,...n==null?void 0:n.container,...l,children:[e.icon&&r.jsx(i.View,{...sf,...n==null?void 0:n.icon,children:e.icon}),r.jsxs(i.Vertical,{...df,...n==null?void 0:n.content,children:[r.jsx(i.Text,{...gf,...n==null?void 0:n.name,children:e.name}),e.description&&r.jsx(i.Text,{...uf,...n==null?void 0:n.description,children:e.description})]}),e.shortcut&&r.jsx(i.Text,{...hf,...n==null?void 0:n.shortcut,children:e.shortcut})]})},Ha=({children:e="No results found.",views:o,...t})=>r.jsx(i.View,{...ff,...o==null?void 0:o.container,...t,children:e}),xf=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:l,size:a="md",variant:c="default",emptyState:d,footer:s,search:g,setSearch:h,selectedIndex:f,setSelectedIndex:m,filteredCommands:p,filteredGroups:b,listRef:x,views:y,filter:k,...w})=>{if(!e)return null;const I=u.useCallback(V=>{V.disabled||(V.onSelect(),o(!1),h(""))},[o,h]),C=u.useCallback(V=>V.target===V.currentTarget&&o(!1),[o]),T=u.useMemo(()=>({search:g,setSearch:h,selectedIndex:f,setSelectedIndex:m,filteredCommands:p,onSelect:I}),[g,f,p,I,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(bf,{value:T,children:r.jsxs(i.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...Rh[a],...ef[c],...y==null?void 0:y.container,onClick:V=>V.stopPropagation(),children:[r.jsx(_a,{value:g,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(Ha,{views:y==null?void 0:y.empty}):j?b.map(V=>r.jsx($a,{heading:V.name,views:y==null?void 0:y.groupHeading,children:V.commands.map(P=>{const B=p.findIndex(S=>S.id===P.id);return r.jsx(qt,{item:P,selected:B===f,onSelect:()=>I(P),"data-index":B,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)})},V.id)):p.map((V,P)=>r.jsx(qt,{item:V,selected:P===f,onSelect:()=>I(V),"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}},V.id))}),s&&r.jsx(i.View,{...mf,...y==null?void 0:y.footer,children:s})]})})})},eo=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:l,size:a="md",variant:c="default",filter:d,emptyState:s,footer:g,views:h,...f})=>{const{search:m,setSearch:p,selectedIndex:b,setSelectedIndex:x,filteredCommands:y,filteredGroups:k,listRef:w}=Jh({open:e,onOpenChange:o,groups:t,commands:n,filter:d});return r.jsx(xf,{open:e,onOpenChange:o,groups:t,commands:n,placeholder:l,size:a,variant:c,emptyState:s,footer:g,search:m,setSearch:p,selectedIndex:b,setSelectedIndex:x,filteredCommands:y,filteredGroups:k,listRef:w,views:h,...f})};eo.Input=_a,eo.List=yf,eo.Group=$a,eo.Item=qt,eo.Empty=Ha;const Ba=()=>Math.random().toString(36).substring(2,11),kf=({defaultOpen:e=!1,openDelay:o=200,closeDelay:t=200,isDisabled:n=!1}={})=>{const[l,a]=u.useState(e),c=u.useRef(null),d=u.useRef(null),s=u.useRef(null),g=u.useRef(null),h=u.useRef(`tooltip-trigger-${Ba()}`).current,f=u.useRef(`tooltip-content-${Ba()}`).current,m=u.useCallback(()=>{n||(g.current&&(clearTimeout(g.current),g.current=null),!l&&!s.current&&(s.current=setTimeout(()=>{a(!0),s.current=null},o)))},[l,o,n]),p=u.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),l&&!g.current&&(g.current=setTimeout(()=>{a(!1),g.current=null},t))},[l,t]),b=u.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null)},[]);return u.useEffect(()=>()=>{s.current&&clearTimeout(s.current),g.current&&clearTimeout(g.current)},[]),u.useEffect(()=>{const 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}},Cf={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},wf=(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"}}))(),If=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=u.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Nt=()=>u.useContext(La),Tf=({value:e,children:o})=>r.jsx(La.Provider,{value:e,children:o}),Aa=({children:e,views:o,asChild:t=!1,...n})=>{const{openTooltip:l,closeTooltip:a,triggerRef:c,contentId:d,triggerId:s}=Nt(),p={ref:c,onMouseEnter:()=>l(),onMouseLeave:()=>a(),onFocus:()=>l(),onBlur:()=>a(),id:s,"aria-describedby":d,...o==null?void 0:o.container,...n};return t&&u.isValidElement(e)?u.cloneElement(e,p):r.jsx(i.View,{display:"inline-block",...p,children:e})},jf=({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},Sf=({content:e,children:o,position:t="top",align:n="center",size:l="md",variant:a="default",showArrow:c=!0,views:d,themeMode:s,...g})=>{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,w]=u.useState({x:0,y:0,placement:t});u.useEffect(()=>{f!=null&&f.current&&x&&(x.current=f.current)},[f,x,h]),u.useEffect(()=>{if(h&&(m!=null&&m.current)&&(f!=null&&f.current)){const j=f.current.getBoundingClientRect();let z=t;y&&(t==="top"&&y.space.vertical==="bottom"?z="bottom":t==="bottom"&&y.space.vertical==="top"?z="top":t==="right"&&y.space.horizontal==="left"?z="left":t==="left"&&y.space.horizontal==="right"&&(z="right"));let V=0,P=0;switch(z){case"top":V=n==="start"?j.left:n==="end"?j.right-120:j.left+j.width/2-60,P=j.top-8;break;case"bottom":V=n==="start"?j.left:n==="end"?j.right-120:j.left+j.width/2-60,P=j.bottom+8;break;case"right":V=j.right+8,P=n==="start"?j.top:n==="end"?j.bottom-32:j.top+j.height/2-16;break;case"left":V=j.left-8,P=n==="start"?j.top:n==="end"?j.bottom-32:j.top+j.height/2-16;break}w({x:V,y:P,placement:z})}},[h,t,n,f,m,y]);const I=c?If(k.placement):{},T=(()=>{const j={position:"fixed",left:k.x,top:k.y,zIndex:1e3};switch(k.placement){case"top":return{...j,transform:"translateY(-100%)"};case"left":return{...j,transform:"translateX(-100%)"};case"bottom":case"right":default:return j}})();return r.jsxs(i.View,{position:"relative",display:"inline-block",...d==null?void 0:d.container,...g,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:T,...Cf[l],...wf[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,{...I,...d==null?void 0:d.arrow})]})]})},Ut=({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:g=!1,isDisabled:h=!1,views:f,...m})=>{const p=kf({defaultOpen:g,openDelay:c,closeDelay:d,isDisabled:h});return r.jsx(Tf,{value:p,children:r.jsx(Sf,{content:e,position:t,align:n,size:l,variant:a,showArrow:s,views:f,...m,children:o})})};Ut.Trigger=Aa,Ut.Content=jf;const Da=u.forwardRef((e,o)=>{const t=pn(e);return r.jsx(wn,{...e,...t})});Da.displayName="ChatInput";const Mf={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"},et={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"},zf={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"}]},Vf=(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 d=l&&et[l]?et[l]:l||"center";return`radial-gradient(${n||"circle"} at ${d}, ${a})`;case"conic":return`conic-gradient(from 0deg at ${l&&et[l]?et[l]:l||"center"}, ${a})`;default:return`linear-gradient(to right, ${a})`}},Ef={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"}},Pf=({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:g,views:h,themeMode:f,...m})=>{const p=u.useMemo(()=>c&&c.length>0?c:l&&a?[{color:l,position:"0%"},{color:a,position:"100%"}]:zf[e],[c,l,a,e]),b=u.useMemo(()=>{const y=p.map(k=>({...k,color:k.color}));return Vf(e,y,o,t,n)},[e,p,o,t,n]),x=u.useMemo(()=>{if(!d)return{};const y=Ef[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,...qa.container,...x,...h==null?void 0:h.container,...m,children:g&&r.jsx(i.View,{...qa.content,...h==null?void 0:h.content,children:g})})},Wf=e=>r.jsx(Pf,{...e}),_f=u.createContext({}),$f=({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={...Fa.gradient,backgroundImage:`
|
|
56
29
|
repeating-linear-gradient(100deg, ${c.join(", ")}),
|
|
57
|
-
repeating-linear-gradient(100deg, ${
|
|
58
|
-
`,animation:"aurora 4s ease infinite",...o?{maskImage:"radial-gradient(ellipse at 100% 0%, black 10%, transparent 70%)"}:{}};return
|
|
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,{...Fa.container,...t==null?void 0:t.container,...l,children:[r.jsx(i.View,{style:d}),e,r.jsx("style",{children:`
|
|
59
32
|
@keyframes aurora {
|
|
60
33
|
0% { background-position: 0% 50%; }
|
|
61
34
|
50% { background-position: 100% 50%; }
|
|
62
35
|
100% { background-position: 0% 50%; }
|
|
63
36
|
}
|
|
64
|
-
`})]})},gm=({number:e=20,children:o,...t})=>{const r=Array.from({length:e},(a,l)=>l);return n.jsxs(s.View,{width:"100%",height:"100%",backgroundColor:"black",position:"relative",overflow:"hidden",...t,children:[r.map(a=>{const l=a*37%200-100+"px",c=.2+a*13%6*.1+"s",d=(1+a*7%9)/2+"s",i=300+a*17%100+"px";return n.jsx(s.View,{position:"absolute",top:"0px",left:l,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(${i}) translateY(${i})`},iterationCount:"infinite",timingFunction:"linear",fillMode:"forwards",duration:d,delay:c},children:n.jsx(s.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)"})},a)}),o&&n.jsx(s.View,{position:"relative",zIndex:1,width:"100%",height:"100%",children:o})]})},Wl=["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)"],hm=()=>Wl[Math.floor(Math.random()*Wl.length)],fm=({rows:e=15,cols:o=10,squareSize:t=40,...r})=>{const a=Array(e).fill(1),l=Array(o).fill(1);return n.jsx(s.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)",...r,children:a.map((c,d)=>n.jsx(s.Horizontal,{gap:0,children:l.map((i,u)=>n.jsx(s.View,{height:t/3,width:t,borderStyle:"solid",borderColor:"color-gray-200",borderWidth:.5,backgroundColor:"transparent",cursor:"pointer",on:{hover:{backgroundColor:hm(),transition:"background-color 0.2s ease"}}},`col-${u}`))},`row-${d}`))})},mm=["rgb(59, 130, 246)","rgb(147, 51, 234)","rgb(236, 72, 153)","rgb(34, 197, 94)","rgb(251, 146, 60)","rgb(168, 85, 247)"],pm=({count:e=50,colors:o=mm,speed:t="medium",shapes:r=["circle"],...a})=>{const l=Array.from({length:e},(u,g)=>g),c=()=>{switch(t){case"slow":return .5;case"fast":return 2;default:return 1}},d=()=>r[Math.floor(Math.random()*r.length)],i=()=>o[Math.floor(Math.random()*o.length)];return n.jsx(s.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...a,children:l.map(u=>{const g=Math.random()*8+4,f=Math.random()*400,m=Math.random()*300,b=Math.random()*400,p=Math.random()*300,y=(Math.random()*10+5)/c(),x=Math.random()*5,k=d(),w=i(),I={circle:{borderRadius:"50%"},square:{borderRadius:"2px"},triangle:{borderRadius:"0",clipPath:"polygon(50% 0%, 0% 100%, 100% 100%)"}};return n.jsx(s.View,{position:"absolute",width:g,height:g,backgroundColor:w,opacity:.7,style:{left:f,top:m,...I[k]},animate:{from:{transform:"translate(0px, 0px) scale(0.5)",opacity:0},to:{transform:`translate(${b-f}px, ${p-m}px) scale(1)`,opacity:.7},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${y}s`,delay:`${x}s`}},u)})})},bm=({gridSize:e=30,lineColor:o="rgba(59, 130, 246, 0.3)",pulseColor:t="rgba(59, 130, 246, 0.8)",animationSpeed:r="medium",...a})=>{const l=()=>{switch(r){case"slow":return 4;case"fast":return 1;default:return 2}},c=Math.floor(400/e),d=Math.floor(300/e),i=c*d,u=Array.from({length:i},(g,f)=>f);return n.jsxs(s.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...a,children:[Array.from({length:c+1},(g,f)=>n.jsx(s.View,{position:"absolute",left:f*e,top:0,width:1,height:"100%",backgroundColor:o},`v-line-${f}`)),Array.from({length:d+1},(g,f)=>n.jsx(s.View,{position:"absolute",left:0,top:f*e,width:"100%",height:1,backgroundColor:o},`h-line-${f}`)),u.map(g=>{const f=g%c,m=Math.floor(g/c),b=(f+m)*.1;return n.jsx(s.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:`${l()}s`,delay:`${b}s`}},g)})]})},ym=["rgba(59, 130, 246, 0.6)","rgba(147, 51, 234, 0.6)","rgba(236, 72, 153, 0.6)","rgba(34, 197, 94, 0.6)"],xm=({rippleCount:e=5,colors:o=ym,maxSize:t=200,frequency:r=3,...a})=>{const l=Array.from({length:e},(c,d)=>({id:d,x:Math.random()*400,y:Math.random()*300,color:o[d%o.length],delay:d*(r/e),duration:3+Math.random()*2}));return n.jsxs(s.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-100",...a,children:[l.map(c=>n.jsx(s.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)),l.map(c=>n.jsx(s.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}`))]})},km=({children:e,src:o,backgroundSize:t="cover",backgroundPosition:r="center",backgroundRepeat:a="no-repeat",backgroundAttachment:l="scroll",imageOpacity:c=1,overlay:d=null,blendMode:i="normal",views:u,themeMode:g,...f})=>{const m={...br.image,backgroundImage:`url(${o})`,backgroundSize:t,backgroundPosition:r,backgroundRepeat:a,backgroundAttachment:l,opacity:c};return n.jsxs(s.View,{...br.container,...u==null?void 0:u.container,...f,children:[n.jsx(s.View,{style:m,...u==null?void 0:u.image}),d,e&&n.jsx(s.View,{...br.content,...u==null?void 0:u.content,children:e})]})},Cm=({children:e,src:o,autoPlay:t=!0,loop:r=!0,muted:a=!0,playsInline:l=!0,overlay:c=null,blendMode:d="normal",views:i,themeMode:u,...g})=>n.jsxs(s.View,{...yr.container,...i==null?void 0:i.container,...g,children:[n.jsx(s.View,{as:"video",src:o,autoPlay:t,loop:r,muted:a,playsInline:l,style:yr.video,...i==null?void 0:i.video}),c,e&&n.jsx(s.View,{...yr.content,...i==null?void 0:i.content,children:e})]}),wm=({children:e,...o})=>n.jsx(sm,{...o,children:e}),Im=({contentPosition:e,backgroundColor:o="color-black-900",...t})=>{const a=(()=>{let l=`${o}-100`,c=`${o}-900`,d=`${o}-600`,i=`${o}-400`;switch(o.indexOf("-")===-1&&(l=`color-mix(in srgb, ${o} 10%, transparent)`,c=`color-mix(in srgb, ${o} 90%, transparent)`,d=`color-mix(in srgb, ${o} 70%, transparent)`,i=`color-mix(in srgb, ${o} 50%, transparent)`),e){case"left":return`radial-gradient(circle at 70% 50%, ${l} 0%, ${l} 100%), linear-gradient(to right, ${c} 0%, ${d} 65%, ${l} 100%)`;case"right":return`radial-gradient(circle at 30% 50%, ${l} 0%, ${l} 100%), linear-gradient(to left, ${c} 0%, ${d} 65%, ${l} 100%)`;case"top":return`radial-gradient(circle at 50% 40%, ${l} 0%, ${l} 100%), linear-gradient(to bottom, ${c} 0%, ${d} 60%, ${l} 100%)`;case"bottom":return`radial-gradient(circle at 50% 60%, ${l} 0%, ${l} 100%), linear-gradient(to top, ${c} 0%, ${d} 60%, ${l} 100%)`;case"center":return`radial-gradient(circle at 50% 70%, ${c} 0%, ${l} 100%)`;default:return i}})();return n.jsx(s.View,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:a,pointerEvents:"none",zIndex:1,...t})},Tm=({children:e,views:o,...t})=>n.jsx(dm.Provider,{value:{},children:n.jsx(s.View,{...nm.container,...o==null?void 0:o.container,...t,children:e})}),_l=h.forwardRef(({children:e,designProps:o,shape:t="rounded",decorationRotation:r=5,decorationScale:a=1,decorationOpacity:l=.8,views:c,...d},i)=>{const g=(x=>{switch(x){case"square":return"0px";case"pill":return"9999px";case"rounded":default:return"16px"}})(t),f=Math.abs(r)*(Math.PI/180),m=Math.sin(f)*100,b=(a-1)*100/2,p=Math.ceil(m+b),y=d.backgroundColor??"theme-primary";return n.jsx(s.View,{...d,ref:i,backgroundColor:"transparent",position:"relative",overflow:"visible",...c==null?void 0:c.container,children:n.jsxs(s.View,{padding:d.padding??`${96+p}px ${p}px`,position:"relative",overflow:"visible",children:[n.jsx(s.View,{position:"absolute",top:p,left:p,right:p,bottom:p,backgroundColor:y,borderRadius:g,opacity:l/1.5,transform:`scale(${a})`,pointerEvents:"none",zIndex:1,...c==null?void 0:c.back}),n.jsx(s.View,{position:"absolute",top:p,left:p,right:p,bottom:p,transform:`rotate(${r}deg) scale(${a})`,opacity:l/1.2,backgroundColor:y,borderRadius:g,pointerEvents:"none",zIndex:2,...c==null?void 0:c.front}),n.jsx(s.View,{margin:"0 auto",position:"relative",zIndex:3,...c==null?void 0:c.content,children:e})]})})});_l.displayName="Background.Layout";const ie=Tm;ie.Aurora=um,ie.Meteors=gm,ie.Wall=fm,ie.Particles=pm,ie.Grid=bm,ie.Ripples=xm,ie.Image=km,ie.Video=Cm,ie.Gradient=wm,ie.Overlay=Im,ie.Layout=_l;const $l=h.forwardRef((e,o)=>n.jsx(ie,{...e,ref:o}));$l.displayName="Background";const Ll=Object.assign($l,{Layout:ie.Layout,Aurora:ie.Aurora,Meteors:ie.Meteors,Wall:ie.Wall,Particles:ie.Particles,Grid:ie.Grid,Ripples:ie.Ripples,Image:ie.Image,Video:ie.Video,Gradient:ie.Gradient,Overlay:ie.Overlay});Ll.displayName="Background";function jm(e){const{inputValue:o,onInputChange:t,onSubmit:r,messages:a=[]}=e,[l,c]=h.useState(""),d=h.useRef(null),i=h.useRef(null),u=o!==void 0,g=o!==void 0?o:l,f=h.useCallback(b=>{u?t==null||t(b):c(b)},[u,t]),m=h.useCallback(b=>{b&&b.preventDefault();const p=g.trim();p&&r&&(r(p),u||c(""),d.current&&(d.current.style.height="auto"))},[g,r,u]);return h.useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[a.length]),{internalInputValue:g,handleInputChange:f,handleSubmit:m,inputRef:d,messagesRef:i}}const Sm={sm:{fontSize:"13px",padding:"8px"},md:{fontSize:"14px",padding:"12px"},lg:{fontSize:"16px",padding:"16px"}},Mm={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"}},zm={sm:{fontSize:"13px",padding:"6px 10px",borderRadius:"14px"},md:{fontSize:"14px",padding:"8px 12px",borderRadius:"16px"},lg:{fontSize:"16px",padding:"10px 16px",borderRadius:"18px"}},Em={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)"},Vm={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)"},Me={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}},Pm=({messages:e=[],inputPlaceholder:o="Type a message...",disableInput:t=!1,variant:r="default",size:a="md",showTimestamps:l=!0,enableAttachments:c=!1,enableContextPicker:d=!1,selectedContextElements:i=[],onContextPickerClick:u,onRemoveContextElement:g,isLoading:f=!1,loadingText:m="Loading...",styles:b={},maxHeight:p="600px",internalInputValue:y,handleInputChange:x,handleSubmit:k,inputRef:w,messagesRef:I,...C})=>{var V;const T={...Me.container,...Mm[r],...b.container},j={...Me.messagesContainer,maxHeight:p,...b.messagesContainer},M={...Me.inputContainer,...b.inputContainer},E={...Me.input,...Sm[a],...b.input},P=h.useCallback(W=>{x(W.target.value),W.target.style.height="auto",W.target.style.height=`${W.target.scrollHeight}px`},[x]),L=h.useCallback(W=>{W.key==="Enter"&&!W.shiftKey&&(W.preventDefault(),k())},[k]),S=y.trim().length>0,{onSubmit:D,...H}=C;return n.jsxs(s.View,{...T,...H,children:[n.jsxs(s.View,{ref:I,...j,children:[e.length===0?n.jsx(s.View,{display:"flex",alignItems:"center",justifyContent:"center",flex:1,color:"color-gray-400",children:n.jsx(s.Text,{fontSize:"14px",children:"No messages yet. Start a conversation!"})}):e.map(W=>n.jsx(Wm,{message:W,size:a,showTimestamp:l,styles:{bubble:b.bubble,userBubble:b.userBubble,assistantBubble:b.assistantBubble,timestamp:b.timestamp,reasoningContainer:b.reasoningContainer,reasoningContent:b.reasoningContent,errorMessage:b.errorMessage,systemMessage:b.systemMessage,toolMessage:b.toolMessage}},W.id)),f&&n.jsxs(s.Horizontal,{justifyContent:"flex-start",alignItems:"center",gap:8,marginTop:"8px",...b.loadingIndicator,children:[n.jsx(Tt,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),n.jsx(s.Text,{color:"color-gray-500",fontSize:"14px",children:m})]})]}),n.jsxs(s.View,{children:[i.length>0&&n.jsx(s.Horizontal,{gap:8,marginBottom:"8px",flexWrap:"wrap",paddingHorizontal:"20px",...b.contextChipsContainer,children:i.map(W=>n.jsxs(s.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:[n.jsx(s.Text,{fontSize:"12px",color:"color-blue-700",fontWeight:"500",children:W.name}),n.jsx(s.View,{as:"button",type:"button",onClick:()=>g==null?void 0:g(W.id),cursor:"pointer",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",children:n.jsx(ye,{widthHeight:12,color:"color-blue-700"})})]},W.id))}),n.jsxs(s.View,{as:"form",onSubmit:k,...M,children:[c&&n.jsx(s.View,{as:"button",type:"button",...Me.attachmentButton,...b.attachmentButton,_hover:{backgroundColor:"color-gray-100"},children:n.jsx(so,{widthHeight:16,color:"color-gray-600"})}),n.jsx(s.View,{as:"textarea",ref:w,value:y,onChange:P,onKeyDown:L,placeholder:o,disabled:t||f,...E,style:{...E,opacity:t||f?.5:1}}),n.jsxs(s.Vertical,{gap:4,alignItems:"center",children:[d&&n.jsx(s.View,{as:"button",type:"button",onClick:u,...Me.attachmentButton,...b.contextPickerButton,_hover:{backgroundColor:"color-gray-100",...(V=b.contextPickerButton)==null?void 0:V._hover},title:"Select element from page",children:n.jsx(Vr,{widthHeight:16,color:"color-gray-600"})}),n.jsx(s.View,{as:"button",type:"submit",disabled:!S||t||f,...Me.sendButton,backgroundColor:S?"theme-primary":"color-gray-300",_hover:{backgroundColor:S?"color-blue-600":"color-gray-300"},...b.sendButton,style:{cursor:S?"pointer":"not-allowed",opacity:!S||t||f?.6:1},children:n.jsx(It,{widthHeight:16,color:"color-white",filled:!1})})]})]})]})]})},Wm=({message:e,size:o,showTimestamp:t,styles:r})=>{const[a,l]=h.useState(!1),[c,d]=h.useState(!1),i=e.role==="user",u=e.messageType==="system",g=e.messageType==="error",f=e.messageType==="tool";if(u)return n.jsx(s.View,{display:"flex",justifyContent:"center",padding:"8px",width:"100%",...r.systemMessage,children:n.jsxs(s.Horizontal,{gap:6,alignItems:"center",opacity:.7,children:[n.jsx(ze,{widthHeight:12,color:"color-gray-600"}),n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.content})]})});if(f)return n.jsx(s.View,{display:"flex",justifyContent:"flex-start",padding:"8px 16px",width:"100%",...r.toolMessage,children:n.jsxs(s.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:[n.jsx(Sr,{widthHeight:14,color:"color-gray-600"}),n.jsxs(s.Vertical,{gap:2,children:[n.jsx(s.Text,{fontSize:"11px",fontWeight:"600",color:"color-gray-700",children:"Tool Usage"}),n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",fontFamily:"monospace",children:e.content})]})]})});const m={...Me.bubble,...zm[o],...i?Em:Vm,...g?{backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.2)",color:"#b91c1c"}:{},...r.bubble,...i?r.userBubble:r.assistantBubble,...g?r.errorMessage:{}},b={...Me.timestamp,[i?"right":"left"]:"8px",opacity:a?1:0,...r.timestamp};return n.jsx(s.View,{position:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),display:"flex",justifyContent:i?"flex-end":"flex-start",children:n.jsxs(s.View,{...m,children:[t&&n.jsx(s.View,{...b,children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),g&&n.jsxs(s.Horizontal,{gap:6,marginBottom:"4px",alignItems:"center",children:[n.jsx(Ho,{widthHeight:14,color:"#b91c1c"}),n.jsx(s.Text,{fontWeight:"600",fontSize:"12px",children:"Error"})]}),e.reasoning&&n.jsxs(s.View,{marginBottom:"8px",borderBottom:"1px solid rgba(0,0,0,0.05)",paddingBottom:"8px",...r.reasoningContainer,children:[n.jsxs(s.Horizontal,{as:"button",onClick:()=>d(!c),cursor:"pointer",gap:4,alignItems:"center",backgroundColor:"transparent",border:"none",padding:0,children:[n.jsx(s.Text,{fontSize:"11px",color:"color-gray-500",fontWeight:"600",children:"Thinking Process"}),n.jsx(ce,{orientation:c?"down":"right",widthHeight:10,color:"color-gray-500"})]}),c&&n.jsx(s.View,{padding:"8px",backgroundColor:"rgba(0,0,0,0.03)",borderRadius:"8px",marginTop:"4px",...r.reasoningContent,children:n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.reasoning})})]}),n.jsx(s.View,{whiteSpace:"pre-wrap",wordBreak:"break-word",children:e.content}),e.attachments&&e.attachments.length>0&&n.jsx(s.Vertical,{gap:4,marginTop:"8px",children:e.attachments.map(p=>n.jsxs(s.Horizontal,{gap:6,padding:"6px 8px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",fontSize:"12px",children:[n.jsx(so,{widthHeight:14}),n.jsx(s.Text,{children:p.name})]},p.id))}),e.contextElements&&e.contextElements.length>0&&n.jsxs(s.Vertical,{gap:4,marginTop:"8px",children:[n.jsx(s.Text,{fontSize:"11px",color:"rgba(0,0,0,0.5)",fontWeight:"600",children:"Context:"}),e.contextElements.map(p=>n.jsx(s.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:n.jsx(s.Text,{color:"color-blue-700",fontWeight:"500",children:p.name})},p.id))]})]})})},xr=e=>{const o=jm(e);return n.jsx(Pm,{...e,...o})};xr.displayName="ChatWidget";const Dl=xr;function _m({onSelect:e,onCancel:o,active:t}){const[r,a]=h.useState(null);h.useRef(null);const l=h.useCallback(i=>{var b;if(!t)return;const u=document.elementFromPoint(i.clientX,i.clientY);if(!u||u===document.body||u.closest('[data-chatwidget-ignore="true"]')||u.closest("#chatwidget-overlay")){a(null);return}const g=u.getBoundingClientRect();let f=u.tagName.toLowerCase();if(u.id)f+=`#${u.id}`;else if(u.className&&typeof u.className=="string"){const p=u.className.split(" ")[0];p&&(f+=`.${p}`)}const m=(b=u.innerText)==null?void 0:b.slice(0,20);m&&(f+=` ("${m}...")`),a({id:u.id||`el-${Date.now()}`,name:f,tagName:u.tagName.toLowerCase(),rect:g})},[t]),c=h.useCallback(i=>{!t||i.target.closest('[data-chatwidget-ignore="true"]')||(i.preventDefault(),i.stopPropagation(),r&&e(r))},[t,r,e]),d=h.useCallback(i=>{t&&i.key==="Escape"&&o()},[t,o]);return h.useEffect(()=>(t?(document.addEventListener("mousemove",l),document.addEventListener("click",c,!0),document.addEventListener("keydown",d),document.body.style.cursor="crosshair"):(a(null),document.removeEventListener("mousemove",l),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""}),[t,l,c,d]),{highlightedElement:r}}function $m({element:e}){return e?n.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:n.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 Lm=({initialMessages:e=[],onSendMessage:o,bubbleSize:t="md"})=>{const[r,a]=h.useState(!1),[l,c]=h.useState(!1),[d,i]=h.useState(e),[u,g]=h.useState([]),{highlightedElement:f}=_m({active:l,onSelect:x=>{g(k=>[...k,x]),c(!1),a(!0)},onCancel:()=>{c(!1),a(!0)}}),m=()=>a(!r),b=()=>{c(!0),a(!1)},p=x=>{g(k=>k.filter(w=>w.id!==x))},y=x=>{const k={id:Date.now().toString(),role:"user",content:x,timestamp:new Date,contextElements:[...u]};i(w=>[...w,k]),o==null||o(x,u),g([]),setTimeout(()=>{var T;const w=Math.random()>.7,I=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: ${((T=k.contextElements)==null?void 0:T.map(j=>j.name).join(", "))||"general context"}. How can I assist you further?`,messageType:w?"tool":"text",reasoning:I?"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};i(j=>[...j,C]),w&&setTimeout(()=>{i(j=>[...j,{id:(Date.now()+2).toString(),role:"assistant",messageType:"system",content:'Tool "highlightElement" executed successfully.',timestamp:new Date}])},800)},1e3)};return n.jsxs(s.View,{position:"fixed",bottom:24,right:24,zIndex:9999,children:[n.jsx($m,{element:f}),l&&n.jsx(s.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:n.jsx(s.Text,{fontWeight:"600",fontSize:"14px",children:"Click an element to select it. Press ESC to cancel."})}),r&&n.jsxs(s.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:[n.jsxs(s.View,{padding:"16px",borderBottom:"1px solid rgba(0,0,0,0.05)",display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"bold",color:"color-gray-800",children:"ChatWidget Assistant"}),n.jsx(s.View,{as:"button",onClick:()=>a(!1),cursor:"pointer",padding:"4px",borderRadius:"50%",border:"none",backgroundColor:"transparent",_hover:{backgroundColor:"rgba(0,0,0,0.05)"},children:n.jsx(ye,{widthHeight:16,color:"color-gray-500"})})]}),n.jsx(Dl,{messages:d,onSubmit:y,size:t,variant:"minimal",enableContextPicker:!0,selectedContextElements:u,onContextPickerClick:b,onRemoveContextElement:p,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)"}}})]}),!l&&n.jsx(s.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:r?n.jsx(ye,{widthHeight:24,color:"white"}):n.jsx(Er,{widthHeight:24,color:"white"})})]})};z.Accordion=Po,z.Alert=ui,z.ArrowIcon=ri,z.AspectRatio=hi,z.AttachmentGroup=Qa,z.AttachmentIcon=so,z.AttachmentPreview=Sh,z.AudioIcon=_o,z.AudioInput=Ii,z.AudioWaveform=Et,z.Avatar=Mi,z.BackIcon=Mc,z.Background=Ll,z.Badge=_i,z.BatteryIcon=uc,z.BluetoothIcon=Rc,z.BoldArrowIcon=ti,z.BookmarkIcon=gc,z.Button=$e,z.CalendarIcon=Nc,z.CameraIcon=Zc,z.Card=Xo,z.Carousel=Ye,z.Chart=sd,z.ChartIcon=Tc,z.ChatInput=zl,z.ChatWidget=Dl,z.ChatWidgetComponent=xr,z.ChatWidgetWidget=Lm,z.CheckIcon=Sc,z.Checkbox=Gd,z.ChevronIcon=ce,z.ClockIcon=Uc,z.CloseEyeIcon=jt,z.CloseIcon=ye,z.CloudIcon=hc,z.ColorInput=Jd,z.ColorPicker=Pf,z.ComboBox=xg,z.Command=co,z.ContextMenu=Ke,z.CookieConsent=hd,z.CopyIcon=fc,z.CountryPicker=ru,z.CreditCardIcon=Ac,z.CropIcon=li,z.DatePicker=gg,z.DeleteIcon=mc,z.Divider=Kf,z.DocumentIcon=Ic,z.DownloadIcon=yc,z.DragAndDrop=ff,z.DragAndDropComponent=Ka,z.DragHandleIcon=Jl,z.DragHandleLinesIcon=ii,z.Drawer=oo,z.DropZone=yf,z.DropdownMenu=jo,z.DustBinIcon=$o,z.EditIcon=pc,z.EmojiPicker=Wf,z.ErrorIcon=Ho,z.ExternalLinkIcon=zr,z.FacebookIcon=ac,z.FileIcon=io,z.FileImage=kd,z.FileSVG=xd,z.FilterIcon=vc,z.FolderIcon=Ql,z.FormikChatInput=Xg,z.FormikCheckbox=Eg,z.FormikColorInput=Kg,z.FormikComboBox=nh,z.FormikCountryPicker=Jg,z.FormikDatePicker=Qg,z.FormikEmojiPicker=jh,z.FormikForm=Mg,z.FormikIconPicker=xh,z.FormikOTPInput=sh,z.FormikPassword=rh,z.FormikRadio=Dg,z.FormikSelect=Zg,z.FormikSelector=uh,z.FormikSlider=ih,z.FormikSwitch=Rg,z.FormikTagInput=eh,z.FormikTextArea=oh,z.FormikTextField=th,z.FormikToggle=fh,z.FormikToggleGroup=mh,z.FormikUploader=ya,z.GiftIcon=Wc,z.HeartIcon=ic,z.HelpIcon=Kl,z.HomeIcon=bc,z.HoverCard=xe,z.Icon=Wo,z.IconPicker=_f,z.ImageIcon=Rl,z.InfoIcon=ze,z.InstagramIcon=rc,z.LayoutIcon=Bc,z.LikeIcon=Jc,z.Link=Rr,z.LinkIcon=Dc,z.LinkedinIcon=lc,z.Loader=ho,z.LoadingSpinnerIcon=Tt,z.LockIcon=kc,z.LogoutIcon=$c,z.MagicWandIcon=Kc,z.MapPinIcon=qc,z.MediaPreview=zh,z.MenuIcon=Gc,z.Menubar=Fe,z.MessageLayout=bi,z.MessageView=_r,z.MicrophoneIcon=wt,z.MinusIcon=Tr,z.Modal=Ae,z.MoonIcon=jc,z.MoreIcon=Fc,z.MousePointerIcon=Vr,z.NavigationMenu=ro,z.NotificationIcon=wc,z.OTPInput=jg,z.OpenEyeIcon=St,z.Pagination=vf,z.PanelIcon=Er,z.Password=hg,z.PauseIcon=jr,z.PlayIcon=kt,z.PlusIcon=xc,z.PowerOffIcon=Lc,z.PrintIcon=Xc,z.ProfileIcon=Cc,z.ProgressBar=Uf,z.RefreshIcon=Yc,z.Resizable=hr,z.RotateIcon=Pc,z.SaveIcon=dc,z.SearchIcon=Do,z.Select=Ld,z.Selector=Od,z.SendIcon=It,z.Separator=Xf,z.SettingsIcon=Sr,z.ShapeIcon=Vc,z.ShareButton=o0,z.ShareIcon=Mr,z.ShieldIcon=_c,z.Sidebar=Eo,z.Slider=Mh,z.SliderIcon=ai,z.SpinnerIcon=ni,z.StarIcon=sc,z.StatusIndicator=r0,z.StopIcon=Lo,z.SuccessIcon=Mt,z.Switch=Fd,z.Table=Te,z.Tabs=it,z.TagInput=Cg,z.TextArea=vd,z.TextField=ko,z.TextIcon=Ec,z.ThreadsIcon=cc,z.TickIcon=Bo,z.Title=df,z.Toast=z0,z.Toggle=wa,z.ToggleGroup=uf,z.Tooltip=pr,z.TrashIcon=Oc,z.TwitchIcon=tc,z.TwitterIcon=ec,z.UnLikeIcon=Qc,z.UnlockIcon=ei,z.UploadIcon=zt,z.Uploader=Fo,z.UserIcon=Xl,z.VideoIcon=Zl,z.WarningIcon=Ct,z.WifiIcon=oi,z.XIcon=oc,z.YoutubeIcon=nc,z.ZapIcon=Hc,z.ZoomInIcon=ci,z.ZoomOutIcon=zc,z.hideMessage=Wr,z.hideModal=nr,z.showMessage=Pr,z.showModal=Eh,z.showToast=Oe,z.useMessageStore=Ao,z.useModalStore=We,z.useToast=E0,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|
|
37
|
+
`})]})},Hf=({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})]})},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)"],Bf=()=>Na[Math.floor(Math.random()*Na.length)],Lf=({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,g)=>r.jsx(i.View,{height:t/3,width:t,borderStyle:"solid",borderColor:"color-gray-200",borderWidth:.5,backgroundColor:"transparent",cursor:"pointer",on:{hover:{backgroundColor:Bf(),transition:"background-color 0.2s ease"}}},`col-${g}`))},`row-${d}`))})},Af=["rgb(59, 130, 246)","rgb(147, 51, 234)","rgb(236, 72, 153)","rgb(34, 197, 94)","rgb(251, 146, 60)","rgb(168, 85, 247)"],Df=({count:e=50,colors:o=Af,speed:t="medium",shapes:n=["circle"],...l})=>{const a=Array.from({length:e},(g,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(g=>{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(),I={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,...I[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`}},g)})})},Ff=({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,g=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}`)),g.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)})]})},Of=["rgba(59, 130, 246, 0.6)","rgba(147, 51, 234, 0.6)","rgba(236, 72, 153, 0.6)","rgba(34, 197, 94, 0.6)"],qf=({rippleCount:e=5,colors:o=Of,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}`))]})},Nf=({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:g,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,...g==null?void 0:g.container,...f,children:[r.jsx(i.View,{style:m,...g==null?void 0:g.image}),d,e&&r.jsx(i.View,{...Gt.content,...g==null?void 0:g.content,children:e})]})},Uf=({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:g,...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})]}),Gf=({children:e,...o})=>r.jsx(Wf,{...o,children:e}),Yf=({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})},vf=({children:e,views:o,...t})=>r.jsx(_f.Provider,{value:{},children:r.jsx(i.View,{...Mf.container,...o==null?void 0:o.container,...t,children:e})}),Ua=u.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})]})})});Ua.displayName="Background.Layout";const ce=vf;ce.Aurora=$f,ce.Meteors=Hf,ce.Wall=Lf,ce.Particles=Df,ce.Grid=Ff,ce.Ripples=qf,ce.Image=Nf,ce.Video=Uf,ce.Gradient=Gf,ce.Overlay=Yf,ce.Layout=Ua;const Ga=u.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 Xf(e){const{inputValue:o,onInputChange:t,onSubmit:n,messages:l=[]}=e,[a,c]=u.useState(""),d=u.useRef(null),s=u.useRef(null),g=o!==void 0,h=o!==void 0?o:a,f=u.useCallback(p=>{g?t==null||t(p):c(p)},[g,t]),m=u.useCallback(p=>{p&&p.preventDefault();const b=h.trim();b&&n&&(n(b),g||c(""),d.current&&(d.current.style.height="auto"))},[h,n,g]);return u.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[l.length]),{internalInputValue:h,handleInputChange:f,handleSubmit:m,inputRef:d,messagesRef:s}}const Kf={sm:{fontSize:"13px",padding:"8px"},md:{fontSize:"14px",padding:"12px"},lg:{fontSize:"16px",padding:"16px"}},Qf={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"}},Zf={sm:{fontSize:"13px",padding:"6px 10px",borderRadius:"14px"},md:{fontSize:"14px",padding:"8px 12px",borderRadius:"16px"},lg:{fontSize:"16px",padding:"10px 16px",borderRadius:"18px"}},Jf={backgroundColor:"rgba(37, 99, 235, 0.9)",color:"#ffffff",alignSelf:"flex-end",borderBottomRightRadius:"4px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Rf={backgroundColor:"rgba(244, 244, 245, 0.6)",color:"#18181b",alignSelf:"flex-start",borderBottomLeftRadius:"4px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Te={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}},e0=({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:g,onRemoveContextElement:h,isLoading:f=!1,loadingText:m="Loading...",styles:p={},maxHeight:b="600px",internalInputValue:x,handleInputChange:y,handleSubmit:k,inputRef:w,messagesRef:I,...C})=>{var E;const T={...Te.container,...Qf[n],...p.container},j={...Te.messagesContainer,maxHeight:b,...p.messagesContainer},z={...Te.inputContainer,...p.inputContainer},V={...Te.input,...Kf[l],...p.input},P=u.useCallback(W=>{y(W.target.value),W.target.style.height="auto",W.target.style.height=`${W.target.scrollHeight}px`},[y]),B=u.useCallback(W=>{W.key==="Enter"&&!W.shiftKey&&(W.preventDefault(),k())},[k]),S=x.trim().length>0,{onSubmit:H,...A}=C;return r.jsxs(i.View,{...T,...A,children:[r.jsxs(i.View,{ref:I,...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(W=>r.jsx(o0,{message:W,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}},W.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(W=>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:W.name}),r.jsx(i.View,{as:"button",type:"button",onClick:()=>h==null?void 0:h(W.id),cursor:"pointer",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",children:r.jsx(pe,{widthHeight:12,color:"color-blue-700"})})]},W.id))}),r.jsxs(i.View,{as:"form",onSubmit:k,...z,children:[c&&r.jsx(i.View,{as:"button",type:"button",...Te.attachmentButton,...p.attachmentButton,_hover:{backgroundColor:"color-gray-100"},children:r.jsx(to,{widthHeight:16,color:"color-gray-600"})}),r.jsx(i.View,{as:"textarea",ref:w,value:x,onChange:P,onKeyDown:B,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:g,...Te.attachmentButton,...p.contextPickerButton,_hover:{backgroundColor:"color-gray-100",...(E=p.contextPickerButton)==null?void 0:E._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,...Te.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})})]})]})]})]})},o0=({message:e,size:o,showTimestamp:t,styles:n})=>{const[l,a]=u.useState(!1),[c,d]=u.useState(!1),s=e.role==="user",g=e.messageType==="system",h=e.messageType==="error",f=e.messageType==="tool";if(g)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(je,{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={...Te.bubble,...Zf[o],...s?Jf:Rf,...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={...Te.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(Vo,{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(to,{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=Xf(e);return r.jsx(e0,{...e,...o})};vt.displayName="ChatWidget";const va=vt;function t0({onSelect:e,onCancel:o,active:t}){const[n,l]=u.useState(null);u.useRef(null);const a=u.useCallback(s=>{var p;if(!t)return;const g=document.elementFromPoint(s.clientX,s.clientY);if(!g||g===document.body||g.closest('[data-chatwidget-ignore="true"]')||g.closest("#chatwidget-overlay")){l(null);return}const h=g.getBoundingClientRect();let f=g.tagName.toLowerCase();if(g.id)f+=`#${g.id}`;else if(g.className&&typeof g.className=="string"){const b=g.className.split(" ")[0];b&&(f+=`.${b}`)}const m=(p=g.innerText)==null?void 0:p.slice(0,20);m&&(f+=` ("${m}...")`),l({id:g.id||`el-${Date.now()}`,name:f,tagName:g.tagName.toLowerCase(),rect:h})},[t]),c=u.useCallback(s=>{!t||s.target.closest('[data-chatwidget-ignore="true"]')||(s.preventDefault(),s.stopPropagation(),n&&e(n))},[t,n,e]),d=u.useCallback(s=>{t&&s.key==="Escape"&&o()},[t,o]);return u.useEffect(()=>(t?(document.addEventListener("mousemove",a),document.addEventListener("click",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 r0({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 n0=({initialMessages:e=[],onSendMessage:o,bubbleSize:t="md"})=>{const[n,l]=u.useState(!1),[a,c]=u.useState(!1),[d,s]=u.useState(e),[g,h]=u.useState([]),{highlightedElement:f}=t0({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:[...g]};s(w=>[...w,k]),o==null||o(y,g),h([]),setTimeout(()=>{var T;const w=Math.random()>.7,I=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: ${((T=k.contextElements)==null?void 0:T.map(j=>j.name).join(", "))||"general context"}. How can I assist you further?`,messageType:w?"tool":"text",reasoning:I?"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(r0,{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:d,onSubmit:x,size:t,variant:"minimal",enableContextPicker:!0,selectedContextElements:g,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=wo,M.Alert=wc,M.ArrowIcon=fc,M.AspectRatio=Tc,M.AttachmentGroup=ca,M.AttachmentIcon=to,M.AttachmentPreview=Kg,M.AudioIcon=To,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=Pe,M.CalendarIcon=ec,M.CameraIcon=sc,M.Card=_o,M.Carousel=Fe,M.Chart=Wi,M.ChartIcon=Hl,M.ChatInput=Da,M.ChatWidget=va,M.ChatWidgetComponent=vt,M.ChatWidgetWidget=n0,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=Ru,M.ComboBox=qd,M.Command=eo,M.ContextMenu=qe,M.CookieConsent=Bi,M.CopyIcon=jl,M.CountryPicker=Ss,M.CreditCardIcon=Ql,M.CropIcon=bc,M.DatePicker=Hd,M.DeleteIcon=Sl,M.Divider=bh,M.DocumentIcon=$l,M.DownloadIcon=Vl,M.DragAndDrop=Bu,M.DragAndDropComponent=la,M.DragHandleIcon=il,M.DragHandleLinesIcon=xc,M.Drawer=Xe,M.DropZone=Fu,M.DropdownMenu=po,M.DustBinIcon=jo,M.EditIcon=Ml,M.EmojiPicker=eh,M.ErrorIcon=Vo,M.ExternalLinkIcon=tr,M.FacebookIcon=pl,M.FileIcon=oo,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=Io,M.IconPicker=oh,M.ImageIcon=dl,M.InfoIcon=je,M.InstagramIcon=fl,M.LayoutIcon=Xl,M.LikeIcon=ic,M.Link=dr,M.LinkIcon=vl,M.LinkedinIcon=bl,M.Loader=ro,M.LoadingSpinnerIcon=st,M.LockIcon=Pl,M.LogoutIcon=Gl,M.MagicWandIcon=lc,M.MapPinIcon=tc,M.MediaPreview=Zg,M.MenuIcon=rc,M.Menubar=Le,M.MessageLayout=zc,M.MessageView=cr,M.MicrophoneIcon=ct,M.MinusIcon=Jt,M.Modal=Be,M.MoonIcon=Bl,M.MoreIcon=Zl,M.MousePointerIcon=nr,M.NavigationMenu=Qe,M.NotificationIcon=_l,M.OTPInput=Xd,M.OpenEyeIcon=gt,M.Pagination=dh,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=uh,M.RefreshIcon=nc,M.Resizable=Ot,M.RotateIcon=ql,M.SaveIcon=Cl,M.SearchIcon=Mo,M.Select=ns,M.Selector=ds,M.SendIcon=it,M.Separator=ph,M.SettingsIcon=er,M.ShapeIcon=Ol,M.ShareButton=Ih,M.ShareIcon=or,M.ShieldIcon=Ul,M.Sidebar=ko,M.Slider=Qg,M.SliderIcon=pc,M.SpinnerIcon=mc,M.StarIcon=kl,M.StatusIndicator=jh,M.StopIcon=So,M.SuccessIcon=ut,M.Switch=ss,M.Table=we,M.Tabs=vo,M.TagInput=Ud,M.TextArea=gs,M.TextField=go,M.TextIcon=Fl,M.ThreadsIcon=yl,M.TickIcon=zo,M.Title=Wu,M.Toast=Qh,M.Toggle=_n,M.ToggleGroup=_u,M.Tooltip=Ut,M.TrashIcon=Jl,M.TwitchIcon=hl,M.TwitterIcon=gl,M.UnLikeIcon=cc,M.UnlockIcon=gc,M.UploadIcon=ht,M.Uploader=Po,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=Ae,M.useMessageStore=Eo,M.useModalStore=Ve,M.useToast=Zh,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
65
38
|
//# sourceMappingURL=web.umd.js.map
|