@app-studio/web 0.9.95 → 0.9.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web.cjs.js +1 -1
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.esm.js +357 -355
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.js +1 -1
- package/dist/web.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/web.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
${L} no-repeat,
|
|
4
4
|
${A} no-repeat,
|
|
5
5
|
${F} no-repeat
|
|
6
|
-
`,backgroundSize:`200% ${O}px, ${O}px 200%, 200% ${O}px, ${O}px 200%`,backgroundPosition:D,transitionProperty:"background-position",transitionDuration:`${E}s`,transitionTimingFunction:"linear",transitionDelay:Y,_hover:{backgroundPosition:q,transitionDelay:K},width:a?"fit-content":l?"100%":void 0,...m==null?void 0:m.container,...V,children:r.jsx(c.View,{as:t?"div":"button",disabled:!!(n||i),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:Math.max(0,_-3),width:"100%",height:"100%",...h,...f,...x,backgroundColor:(h==null?void 0:h.backgroundColor)||w,color:b,borderWidth:0,cursor:n?"default":"pointer",children:T})})}return r.jsx(c.Element,{ref:y,as:e==="link"&&t?"div":"button",type:e==="link"&&t?void 0:"button",disabled:!!(n||i),...f,...x,display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":l?"100%":void 0,borderRadius:so[s],boxShadow:g,transition:"background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",cursor:n?"default":"pointer",onClick:p,...h,...m==null?void 0:m.container,...V,children:T})},yc=u.memo(u.forwardRef(({variant:e="filled",size:o="md",shape:t="rounded",iconPosition:n="left",loaderPosition:i="left",backgroundColor:a,color:l,textColor:d,reversed:s=!1,isAuto:g=!0,isFilled:p,isDisabled:m,isLoading:h,isIconRounded:f,isHovered:x,icon:y,children:b,to:k,isExternal:S,shadow:w,onClick:j,views:C={},borderMovingDuration:I=2,borderMovingGradientColors:M=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:R="#705CFF",animatedStrokeTextColor:V="#333333",..._},T)=>{const{getColorHex:W}=c.useTheme();let z=W(m?"theme-disabled":h?"theme-loading":a??l??"theme-button-background");(z==="theme-button-background"||z==="theme-loading")&&(z=W(h?"color-dark-500":"theme-primary"));let E=W(d??"theme-button-text");E==="theme-button-text"&&(E=W("color-white"));const L=u.useMemo(()=>pc(z,E,s),[z,E,s])[e],A=(L==null?void 0:L.color)??E,F=r.jsx(mc,{icon:y,isLoading:h,iconPosition:n,loaderPosition:i,size:o,resolvedTextColor:A,isIconRounded:f,views:C,children:b}),D=Dr[o],q=f?Fr[o]:{};return r.jsx(bc,{variant:e,animation:_.animation,to:k,isDisabled:m,isLoading:h,isAuto:g,isFilled:p,isExternal:S,shape:t,shadow:w,onClick:j,views:C,baseStyles:L,sizeStyles:D,iconPad:q,resolvedTextColor:A,content:F,size:o,mainTone:z,borderMovingDuration:I,borderMovingGradientColors:M,animatedStrokeAccentColor:R,animatedStrokeTextColor:V,getColor:W,containerRef:T,..._})})),kc=e=>{const[o,t]=c.useHover();return r.jsx(yc,{isHovered:t,...e})},_e=kc,jc={sm:{padding:"12px"},md:{padding:"16px"},lg:{padding:"24px"}},Cc={square:0,rounded:"8px",pill:"24px"},Sc=e=>{const o=e==="dark";return{default:{backgroundColor:o?"color-gray-900":"color-white",border:"none",transition:"background-color 0.2s ease, box-shadow 0.2s ease"},outlined:{backgroundColor:o?"color-gray-900":"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:o?"color-gray-700":"color-gray-200",transition:"border-color 0.2s ease, box-shadow 0.2s ease",_hover:{borderColor:o?"color-gray-600":"color-gray-300",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.05)"}},elevated:{backgroundColor:o?"color-gray-900":"color-white",boxShadow:o?"0px 4px 12px rgba(0, 0, 0, 0.3)":"0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)",border:"none",transition:"box-shadow 0.2s ease",_hover:{boxShadow:o?"0px 8px 16px rgba(0, 0, 0, 0.4)":"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)"}}}},vo=e=>{const o=e.themeMode==="dark";return{container:{backgroundColor:o?"color-gray-900":"color-white",color:o?"color-white":"color-black",borderRadius:"8px",overflow:"hidden",transition:"all 0.2s ease"},header:{padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:o?"color-gray-800":"color-gray-100",color:"theme-primary"},content:{padding:"16px",color:o?"color-gray-300":"color-gray-600"},footer:{padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:o?"color-gray-800":"color-gray-100"}}},Or=u.createContext({}),_t=()=>u.useContext(Or),ut=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).header,s={...d,...l==null?void 0:l.header,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.header)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:8,...s,children:e})},gt=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).content,s={...d,...l==null?void 0:l.content,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.content)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:12,...s,children:e})},pt=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).footer,s={...d,...l==null?void 0:l.footer,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.footer)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:8,...s,children:e})},wc=({variant:e="default",size:o="md",shape:t="rounded",children:n,header:i,footer:a,isFullWidth:l=!1,views:d,style:s,themeMode:g,...p})=>{var j,C;const m=c.useTheme(),h=vo(m),f=((j=jc[o])==null?void 0:j.padding)||"16px",x=u.useMemo(()=>({styles:{container:{...h.container,borderRadius:Cc[t],...d==null?void 0:d.container},header:{...h.header,padding:f,...d==null?void 0:d.header},content:{...h.content,padding:f,...d==null?void 0:d.content},footer:{...h.footer,padding:f,...d==null?void 0:d.footer}}}),[h,d,f,t]),y=u.Children.toArray(n).some(I=>u.isValidElement(I)&&(I.type===ut||I.type===gt||I.type===pt)),{themeMode:b}=m,S=Sc(g||b)[e],w={width:l?"100%":"auto",overflow:"hidden",...S,...x.styles.container,...p,style:{...(C=x.styles.container)==null?void 0:C.style,...s}};return r.jsx(Or.Provider,{value:x,children:r.jsx(c.View,{...w,children:y?n:r.jsxs(c.Vertical,{width:"100%",children:[i&&r.jsx(ut,{children:i}),r.jsx(gt,{children:n}),a&&r.jsx(pt,{children:a})]})})})},Ic=e=>r.jsx(wc,{...e}),Xo=Ic;Xo.Header=ut;Xo.Content=gt;Xo.Footer=pt;const Tc=({defaultActiveIndex:e=0,activeIndex:o,onChange:t,autoPlay:n=!1,autoPlayInterval:i=3e3,pauseOnHover:a=!0,infinite:l=!0,totalSlides:d,stepIndices:s})=>{const g=u.useRef(d||0),[p,m]=u.useState(d||0),h=u.useRef(new Set),f=u.useRef(0),x=u.useMemo(()=>jt("carousel-content"),[]),[y,b]=u.useState(o!==void 0?o:e),[k,S]=u.useState(!1),[w,j]=u.useState(!1),[C,I]=u.useState(0),[M,R]=u.useState(0),V=u.useRef(null);u.useEffect(()=>{o!==void 0&&b(o)},[o]);const _=u.useCallback(D=>{let q=D;l?D<0?q=p-1:D>=p&&(q=0):q=Math.max(0,Math.min(D,p-1)),s&&s.length>0&&(s.includes(q)||(q=s.reduce((Y,O)=>Math.abs(O-q)<Math.abs(Y-q)?O:Y))),o===void 0&&b(q),t&&t(q)},[o,l,t,p]),T=u.useCallback(()=>{_(y+1)},[y,_]),W=u.useCallback(()=>{_(y-1)},[y,_]);u.useEffect(()=>(n&&!k&&!w&&(V.current=setInterval(()=>{T()},i)),()=>{V.current&&clearInterval(V.current)}),[n,i,k,w,T,a]);const B=u.useCallback(()=>{a&&S(!0)},[a]),P=u.useCallback(()=>{S(!1)},[]),z=u.useCallback(D=>{j(!0),"touches"in D?(I(D.touches[0].clientX),R(D.touches[0].clientY)):(I(D.clientX),R(D.clientY))},[]),$=u.useCallback(D=>{if(!w)return;let q,K;"touches"in D?(q=D.touches[0].clientX,K=D.touches[0].clientY):(q=D.clientX,K=D.clientY);const Y=q-C,O=K-M;Math.abs(Y)>Math.abs(O)&&Math.abs(Y)>50&&(Y>0?W():T(),j(!1))},[w,C,M,T,W]),E=u.useCallback(()=>{j(!1)},[]),H=u.useCallback(()=>{const D=f.current++;h.current.add(D);const q=h.current.size;return g.current=q,m(q),D},[]),L=u.useCallback(D=>{h.current.delete(D);const q=h.current.size;if(g.current=q,m(q),q>0&&y>=q){const K=Math.max(0,q-1);o===void 0&&b(K),t&&t(K)}},[y,o,t]),A=l||y>0,F=l||y<p-1;return{activeIndex:y,totalSlides:p,goToSlide:_,nextSlide:T,prevSlide:W,canGoNext:F,canGoPrevious:A,handleMouseEnter:B,handleMouseLeave:P,handleDragStart:z,handleDragMove:$,handleDragEnd:E,registerSlide:H,unregisterSlide:L,contentId:x,infinite:l}},Mc={dot:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},line:{width:"20px",height:"4px",borderRadius:"2px",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},number:{minWidth:"24px",height:"24px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",transition:"background-color 0.3s ease"}},zc={dot:{backgroundColor:"theme-primary"},line:{backgroundColor:"theme-primary"},number:{backgroundColor:"theme-primary",color:"color-white"}},Wo={width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"color-white",color:"color-gray-800",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",boxShadow:"0 2px 5px rgba(0, 0, 0, 0.1)",zIndex:1,transition:"background-color 0.3s ease",_hover:{backgroundColor:"color-gray-100"}},mo=()=>({container:{position:"relative",overflow:"hidden"},content:{overflow:"hidden",width:"100%",height:"100%"},innerContainer:{display:"flex",transitionProperty:"transform",transitionDuration:"300ms",transitionTimingFunction:"ease-in-out",height:"100%"},item:{flex:"0 0 100%",minWidth:0,position:"relative",height:"100%"},prevButton:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)",zIndex:10,...Wo},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...Wo}}),qr=u.createContext(null),Ko=()=>{const e=u.useContext(qr);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},Nr=({children:e,isActive:o,views:t,...n})=>r.jsx(c.View,{flexShrink:0,width:"100%",height:"100%",display:o?"block":"none",...t,...n,children:e}),Ur=({views:e,children:o,...t})=>{const{goToPrevious:n,canGoPrevious:i,styles:a}=Ko(),d={...mo().prevButton,...a==null?void 0:a.prevButton,...e==null?void 0:e.prevButton};return r.jsx(_e,{"aria-label":"Previous slide",onClick:()=>n(),isDisabled:!i,...d,...t,children:o??r.jsx(ae,{orientation:"left",widthHeight:16})})},Gr=({views:e,children:o,...t})=>{const{goToNext:n,canGoNext:i,styles:a}=Ko(),d={...mo().nextButton,...a==null?void 0:a.nextButton,...e==null?void 0:e.nextButton};return r.jsx(_e,{"aria-label":"Next slide",onClick:()=>n(),isDisabled:!i,...d,...t,children:o??r.jsx(ae,{orientation:"right",widthHeight:16})})},Yr=({children:e,views:o,...t})=>{const{registerSlide:n,unregisterSlide:i,styles:a}=Ko(),l=u.useRef(null);u.useEffect(()=>{const g=n();return l.current=g,()=>{l.current!==null&&i(l.current)}},[n,i]);const s={...mo().item,...a==null?void 0:a.item,...o==null?void 0:o.item};return r.jsx(c.View,{role:"group","aria-roledescription":"slide",...s,...t,children:e})},vr=({children:e,views:o,style:t,...n})=>{const{currentIndex:i,styles:a,contentId:l}=Ko(),d=mo(),s={...d.content,...a==null?void 0:a.content,...o==null?void 0:o.content},g={...d.innerContainer,...a==null?void 0:a.innerContainer,...o==null?void 0:o.innerContainer},p=`-${i*100}%`;return r.jsx(c.View,{...s,...n,style:{...s==null?void 0:s.style,...t},id:l,"aria-live":"polite",children:r.jsx(c.View,{...g,style:{...g==null?void 0:g.style,transform:`translateX(${p})`},children:e})})},Rc=({children:e,defaultActiveIndex:o=0,activeIndex:t,onChange:n,showNavigation:i=!0,navigationPosition:a="inside",prevButton:l,nextButton:d,showIndicators:s=!0,indicatorPosition:g="bottom",indicatorVariant:p="dot",autoPlay:m=!1,autoPlayInterval:h=3e3,pauseOnHover:f=!0,infinite:x=!0,direction:y="horizontal",transitionDuration:b=300,views:k,stepIndices:S,themeMode:w,...j})=>{const C=u.useMemo(()=>u.Children.toArray(e),[e]),I=Tc({defaultActiveIndex:o,activeIndex:t,onChange:n,autoPlay:m,autoPlayInterval:h,pauseOnHover:f,infinite:x,totalSlides:C.length}),{activeIndex:M,totalSlides:R,goToSlide:V,nextSlide:_,prevSlide:T,handleMouseEnter:W,handleMouseLeave:B,handleDragStart:P,handleDragMove:z,handleDragEnd:$}=I,E=()=>{if(!i)return null;const A=l||r.jsx(c.View,{as:"button","aria-label":"Previous slide",...Wo,...k==null?void 0:k.prevButton,children:"❮"}),F=d||r.jsx(c.View,{as:"button","aria-label":"Next slide",...Wo,...k==null?void 0:k.nextButton,children:"❯"});return r.jsxs(r.Fragment,{children:[r.jsx(c.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",left:a==="inside"?"10px":"-40px",onClick:T,cursor:!x&&M===0?"not-allowed":"pointer",opacity:!x&&M===0?.5:1,children:A}),r.jsx(c.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",right:a==="inside"?"10px":"-40px",onClick:_,cursor:!x&&M===C.length-1?"not-allowed":"pointer",opacity:!x&&M===C.length-1?.5:1,children:F})]})},H=()=>s?r.jsx(c.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...g==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:C.map((A,F)=>r.jsx(c.View,{onClick:()=>V(F),cursor:"pointer",...Mc[p],...F===M?{...zc[p]}:{},...k==null?void 0:k.indicator,...F===M?k==null?void 0:k.activeIndicator:{},children:p==="number"&&F+1},F))}):null;return u.useMemo(()=>u.Children.toArray(e).some(A=>u.isValidElement(A)&&(A.type===vr||A.type===Yr||A.type===Ur||A.type===Gr)),[e])?r.jsx(qr.Provider,{value:{currentIndex:M,totalSlides:R,goToSlide:V,goToNext:_,goToPrevious:T,canGoNext:I.canGoNext,canGoPrevious:I.canGoPrevious,registerSlide:I.registerSlide,unregisterSlide:I.unregisterSlide,styles:{...mo(),...k},contentId:I.contentId,infinite:x},children:r.jsx(c.View,{role:"region","aria-roledescription":"carousel","aria-label":"Carousel",position:"relative",width:"100%",height:"100%",overflow:"hidden",...k==null?void 0:k.container,...j,children:e})}):r.jsxs(c.View,{position:"relative",width:"100%",height:"100%",overflow:"hidden",onMouseEnter:W,onMouseLeave:B,onTouchStart:P,onTouchMove:z,onTouchEnd:$,onMouseDown:P,onMouseMove:z,onMouseUp:$,...k==null?void 0:k.container,...j,children:[r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...k==null?void 0:k.slideWrapper,children:C.map((A,F)=>r.jsx(Nr,{isActive:F===M,index:F,views:k==null?void 0:k.slide,children:A},F))}),E(),H()]})},Vc=e=>r.jsx(Rc,{...e}),Xe=Vc;Xe.Slide=Nr;Xe.Content=vr;Xe.Item=Yr;Xe.Previous=Ur;Xe.Next=Gr;const ke={blue:"color-blue-500",green:"color-green-500",purple:"color-purple-500",orange:"color-orange-500",red:"color-red-500",teal:"color-teal-500",pink:"color-pink-500",indigo:"color-indigo-500",yellow:"color-yellow-500",cyan:"color-cyan-500"},Ec=[ke.blue,ke.green,ke.purple,ke.orange,ke.red,ke.teal,ke.pink,ke.indigo,ke.yellow,ke.cyan],Ge=Ec,Pc={width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},Wc={fontSize:"18px",fontWeight:"bold",marginBottom:"16px",textAlign:"center"},_c={display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"16px"},$c={display:"flex",alignItems:"center",marginRight:"16px",marginBottom:"8px"},Hc={width:"12px",height:"12px",borderRadius:"2px",marginRight:"6px"},Bc={fontSize:"14px"},Xr={stroke:"color-gray-200",strokeWidth:"1px"},_o={stroke:"color-gray-300",strokeWidth:"1px"},$o={fontSize:"12px",fill:"color-gray-600"},Lc={rx:"2px",ry:"2px",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},Ac={strokeWidth:"2px",fill:"none"},Dc={r:"4px",strokeWidth:"2px",stroke:"white",cursor:"pointer",transition:"r 0.2s ease"},Co={strokeWidth:"1px",stroke:"white",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},$t={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)",borderRadius:"4px",zIndex:10,padding:"16px",textAlign:"center"},Fc={...$t},Oc={...$t,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},qc={...$t,backgroundColor:"rgba(245, 245, 245, 0.8)",color:"color-gray-600"},Nc=({data:e,dataPoints:o,animated:t=!0,animationDuration:n=500,showTooltips:i=!0})=>{const[a,l]=u.useState(t?0:1),[d,s]=u.useState({visible:!1,x:0,y:0,content:null}),g=u.useRef(null),p=u.useRef(null);u.useEffect(()=>{if(!t){l(1);return}const y=Date.now(),b=()=>{const k=Date.now()-y,S=Math.min(k/n,1);l(S),S<1&&(g.current=requestAnimationFrame(b))};return g.current=requestAnimationFrame(b),()=>{g.current&&cancelAnimationFrame(g.current)}},[t,n]);const m=u.useCallback(()=>e?{...e,series:e.series.map((y,b)=>({...y,color:y.color||Ge[b%Ge.length]}))}:o?o.map((y,b)=>({...y,color:y.color||Ge[b%Ge.length]})):null,[e,o]),h=u.useCallback((y,b,k)=>{i&&s({visible:!0,x:y,y:b,content:k})},[i]),f=u.useCallback(()=>{s(y=>({...y,visible:!1}))},[]),x=u.useCallback(()=>{if(!p.current)return{width:0,height:0};const{width:y,height:b}=p.current.getBoundingClientRect();return{width:y,height:b}},[]);return{animationProgress:a,tooltip:d,containerRef:p,processedData:m,showTooltip:h,hideTooltip:f,getChartDimensions:x}},Uc=({data:e,width:o,height:t,animationProgress:n,showGrid:i=!0,onBarClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),p={top:20,right:20,bottom:40,left:50},m=o-p.left-p.right,h=t-p.top-p.bottom,f=u.useMemo(()=>{let C=0;return e.series.forEach(I=>{I.data.forEach(M=>{C=Math.max(C,M)})}),C},[e]),x=e.labels.length,y=e.series.length,b=m/x,k=b*.8/y,S=b*.2/(y+1),w=f||10,j=u.useMemo(()=>{const I=[];for(let M=0;M<=5;M++){const R=w/5*M;I.push(R)}return I},[f]);return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:p.left,y1:t-p.bottom,x2:o-p.right,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),r.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),e.labels.map((C,I)=>{const M=p.left+(I+.5)*b,R=t-p.bottom+20;return r.jsx("text",{x:M,y:R,textAnchor:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:C},`x-label-${I}`)}),j.map((C,I)=>{const M=t-p.bottom-C/w*h;return r.jsxs(u.Fragment,{children:[r.jsx("text",{x:p.left-10,y:M,textAnchor:"end",dominantBaseline:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:C.toFixed(0)}),i&&r.jsx("line",{x1:p.left,y1:M,x2:o-p.right,y2:M,...Xr,...s==null?void 0:s.grid})]},`y-tick-${I}`)}),e.series.map((C,I)=>r.jsx(u.Fragment,{children:C.data.map((M,R)=>{const V=M/w*h*n,_=p.left+R*b+S*(I+1)+k*I,T=t-p.bottom-V,W=e.labels[R],B=e.series.reduce((H,L)=>{const A=L.data[R];return H+(typeof A=="number"?A:0)},0),P=B>0?(M/B*100).toFixed(1):null,z=C.color?g(C.color):"black",$=H=>{const L=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"180px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:C.name}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:z})]}),r.jsx(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:W}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:M.toLocaleString()})]}),P!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:`${P}%`})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(c.Text,{fontWeight:"medium",children:B.toLocaleString()})]})]})]});l(H.clientX,H.clientY,L)},E=()=>{a&&a(C.name,R)};return r.jsx("rect",{x:_,y:T,width:k,height:V,fill:z,onMouseEnter:$,onMouseLeave:d,onClick:E,...Lc,...s==null?void 0:s.bar},`bar-${I}-${R}`)})},`series-${I}`))]})},Gc=({data:e,width:o,height:t,animationProgress:n,showGrid:i=!0,onPointClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),p={top:20,right:20,bottom:40,left:50},m=o-p.left-p.right,h=t-p.top-p.bottom,f=u.useMemo(()=>{let S=0;return e.series.forEach(w=>{w.data.forEach(j=>{S=Math.max(S,j)})}),S},[e]),x=f||10,y=u.useMemo(()=>{const w=[];for(let j=0;j<=5;j++){const C=x/5*j;w.push(C)}return w},[f]),b=S=>`M ${S.map((j,C)=>{const I=p.left+C/(e.labels.length-1)*m,M=t-p.bottom-j/x*h*n;return`${I},${M}`}).join(" L ")}`,k=S=>{const w=p.left,j=p.left+m,C=t-p.bottom,I=S.map((M,R)=>{const V=p.left+R/(e.labels.length-1)*m,_=t-p.bottom-M/x*h*n;return`${V},${_}`});return`M ${w},${C} L ${I.join(" L ")} L ${j},${C} Z`};return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:p.left,y1:t-p.bottom,x2:o-p.right,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),r.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),e.labels.map((S,w)=>{const j=p.left+w/(e.labels.length-1)*m,C=t-p.bottom+20;return r.jsx("text",{x:j,y:C,textAnchor:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:S},`x-label-${w}`)}),y.map((S,w)=>{const j=t-p.bottom-S/x*h;return r.jsxs(u.Fragment,{children:[r.jsx("text",{x:p.left-10,y:j,textAnchor:"end",dominantBaseline:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:S.toFixed(0)}),i&&r.jsx("line",{x1:p.left,y1:j,x2:o-p.right,y2:j,...Xr,...s==null?void 0:s.grid})]},`y-tick-${w}`)}),e.series.map((S,w)=>{const j=S.color?g(S.color):"black";return r.jsxs(u.Fragment,{children:[r.jsx("path",{d:k(S.data),fill:j,opacity:.1,...s==null?void 0:s.area}),r.jsx("path",{d:b(S.data),stroke:j,...Ac,...s==null?void 0:s.line}),S.data.map((C,I)=>{const M=p.left+I/(e.labels.length-1)*m,R=t-p.bottom-C/x*h*n,V=e.labels[I],_=e.series.reduce((E,H)=>{const L=H.data[I];return E+(typeof L=="number"?L:0)},0),T=_>0?(C/_*100).toFixed(1):null,W=I>0&&typeof S.data[I-1]=="number"?S.data[I-1]:null,B=typeof W=="number"?C-W:null,P=typeof B=="number"?`${B>=0?"+":""}${B.toLocaleString()}`:null,z=E=>{const H=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:S.name}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:j})]}),r.jsx(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:V}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:C.toLocaleString()})]}),P!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Change"}),r.jsx(c.Text,{fontWeight:"medium",children:P})]}),T!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:`${T}%`})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(c.Text,{fontWeight:"medium",children:_.toLocaleString()})]})]})]});l(E.clientX,E.clientY,H)},$=()=>{a&&a(S.name,I)};return r.jsx("circle",{cx:M,cy:R,fill:j,onMouseEnter:z,onMouseLeave:d,onClick:$,...Dc,...s==null?void 0:s.point},`point-${w}-${I}`)})]},`series-${w}`)})]})},Yc=({dataPoints:e,width:o,height:t,animationProgress:n,isDonut:i=!1,onSliceClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),{ref:p,relation:m}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),h=u.useRef(null);u.useEffect(()=>{h.current&&p&&(p.current=h.current)},[h,p]);const x=Math.min(o,t)/2*.8,y=o/2,b=t/2,k=i?x*.6:0,S=u.useMemo(()=>e.reduce((j,C)=>j+C.value,0),[e]),w=u.useMemo(()=>{if(S===0)return[{path:i?[`M ${y} ${b-x}`,`A ${x} ${x} 0 1 1 ${y} ${b+x}`,`A ${x} ${x} 0 1 1 ${y} ${b-x}`,`M ${y} ${b-k}`,`A ${k} ${k} 0 1 0 ${y} ${b+k}`,`A ${k} ${k} 0 1 0 ${y} ${b-k}`,"Z"].join(" "):[`M ${y} ${b}`,`M ${y} ${b-x}`,`A ${x} ${x} 0 1 1 ${y} ${b+x}`,`A ${x} ${x} 0 1 1 ${y} ${b-x}`,"Z"].join(" "),color:"#E2E8F0",label:"Total",value:0,percentage:"0%",labelX:y,labelY:b,startAngle:0,endAngle:Math.PI*2,index:-1}];const j=[];let C=-Math.PI/2;for(let I=0;I<e.length;I++){const R=e[I].value/S,V=R*2*Math.PI*n,_=C+V,T=y+Math.cos(C)*x,W=b+Math.sin(C)*x,B=y+Math.cos(_)*x,P=b+Math.sin(_)*x,z=y+Math.cos(C)*k,$=b+Math.sin(C)*k,E=y+Math.cos(_)*k,H=b+Math.sin(_)*k,L=V>Math.PI?1:0;let A;i?A=[`M ${T} ${W}`,`A ${x} ${x} 0 ${L} 1 ${B} ${P}`,`L ${E} ${H}`,`A ${k} ${k} 0 ${L} 0 ${z} ${$}`,"Z"].join(" "):A=[`M ${y} ${b}`,`L ${T} ${W}`,`A ${x} ${x} 0 ${L} 1 ${B} ${P}`,"Z"].join(" ");const F=C+V/2,D=x*.7,q=y+Math.cos(F)*D,K=b+Math.sin(F)*D,Y=`${(R*100).toFixed(1)}%`,O=e[I].color||Ge[I%Ge.length],X=g(O);j.push({path:A,color:X,label:e[I].label,value:e[I].value,percentage:Y,labelX:q,labelY:K,startAngle:C,endAngle:_,index:I}),C=_}return j},[e,S,x,y,b,k,n,i]);return r.jsxs("svg",{ref:h,width:o,height:t,style:{overflow:"visible"},children:[i&&r.jsx("circle",{cx:y,cy:b,r:k,fill:"white",pointerEvents:"none"}),w.map((j,C)=>{const I=V=>{const _=S>0?j.value/S*100:0,T=S>0?Math.max(0,100-_):null,W=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:j.label}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:j.color})]}),r.jsxs(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:["Slice ",j.index+1," of ",e.length]}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:j.value.toLocaleString()})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:j.percentage})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Total"}),r.jsx(c.Text,{fontWeight:"medium",children:S.toLocaleString()})]}),T!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Remaining"}),r.jsx(c.Text,{fontWeight:"medium",children:`${T.toFixed(1)}%`})]})]})]});let B=V.clientX,P=V.clientY;if(m&&h.current){const z=h.current.getBoundingClientRect();V.clientX-z.left,V.clientY-z.top,m.space.horizontal==="left"?B=V.clientX-100:B=V.clientX+10,m.space.vertical==="top"?P=V.clientY-30:P=V.clientY+10}l(B,P,W)},M=()=>{j.index!==-1&&a&&a(e[j.index],j.index)},R=j.index===-1;return r.jsxs("g",{children:[r.jsx("path",{d:j.path,fill:j.color,onMouseEnter:R?void 0:I,onMouseLeave:R?void 0:d,onClick:M,...Co,style:{...Co==null?void 0:Co.style,cursor:R?"default":"pointer"},...s==null?void 0:s.pie}),!R&&j.endAngle-j.startAngle>.2&&r.jsx("text",{x:j.labelX,y:j.labelY,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontWeight:"bold",pointerEvents:"none",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3)",filter:"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))"},children:j.percentage})]},`slice-${C}`)})]})},vc=({visible:e,x:o,y:t,content:n,maxDistance:i=100,views:a})=>{const l=u.useRef(null),[d,s]=u.useState({left:0,top:0});return u.useEffect(()=>{if(!e||!l.current)return;const p=l.current.getBoundingClientRect(),m=p.width,h=p.height,f=10,x=15;let y=o-x,b=t-x;const k=o-y,S=t-b;k>i&&(y=o-i),S>i&&(b=t-i),y+m>window.innerWidth-f&&(y=window.innerWidth-m-f,o-y>i&&(y=o-i)),y<f&&(y=f),b+h>window.innerHeight-f&&(b=window.innerHeight-h-f,t-b>i&&(b=t-i)),b<f&&(b=f),s({left:y,top:b})},[e,o,t,i]),e?r.jsx(c.View,{ref:l,position:"fixed",left:`${d.left}px`,top:`${d.top}px`,backgroundColor:"color-white",padding:"12px 16px",borderRadius:"8px",boxShadow:"0px 12px 24px rgba(15, 23, 42, 0.18)",border:"1px solid color-gray-200",fontSize:"14px",display:"flex",flexDirection:"column",pointerEvents:"none",zIndex:10,...a==null?void 0:a.tooltip,children:n}):null},Xc=({type:e,data:o,dataPoints:t,title:n,showLegend:i=!0,legendPosition:a="bottom",showGrid:l=!0,showTooltips:d=!0,animated:s=!0,animationDuration:g=500,responsive:p=!0,aspectRatio:m=16/9,width:h=200,height:f=200,views:x,onDataPointClick:y,onSeriesClick:b,isLoading:k=!1,error:S,noData:w,loadingIndicator:j,errorIndicator:C,noDataIndicator:I,"aria-label":M,themeMode:R,...V})=>{const{animationProgress:_,tooltip:T,containerRef:W,processedData:B,showTooltip:P,hideTooltip:z,getChartDimensions:$}=Nc({data:o,dataPoints:t,animated:s,animationDuration:g,showTooltips:d}),E=B(),{width:H,height:L}=$(),A=h||H,F=f||(p?H/m:L),D=()=>{if(!i||!E)return null;let J=[];return e==="pie"||e==="donut"?Array.isArray(E)&&(J=E):E&&E.series&&(J=E.series),!J||J.length===0?null:r.jsx(c.Horizontal,{flexWrap:"wrap",justifyContent:"center",marginTop:a==="bottom"?"16px":0,marginBottom:a==="top"?"16px":0,..._c,...x==null?void 0:x.legend,children:J.map((oe,re)=>r.jsxs(c.View,{...$c,...x==null?void 0:x.legendItem,children:[r.jsx(c.View,{backgroundColor:oe.color,...Hc}),r.jsx(c.Text,{...Bc,children:oe.name||oe.label})]},`legend-${re}`))})},q=()=>{if(!E)return null;switch(e){case"bar":return r.jsx(Uc,{data:E,width:A,height:F,animationProgress:_,showGrid:l,onBarClick:b,showTooltip:P,hideTooltip:z,views:x});case"line":case"area":return r.jsx(Gc,{data:E,width:A,height:F,animationProgress:_,showGrid:l,onPointClick:b,showTooltip:P,hideTooltip:z,views:x});case"pie":case"donut":return r.jsx(Yc,{dataPoints:E,width:A,height:F,animationProgress:_,isDonut:e==="donut",onSliceClick:y,showTooltip:P,hideTooltip:z,views:x});default:return null}},K=()=>k?r.jsx(c.View,{...Fc,...x==null?void 0:x.loadingOverlay,children:j||r.jsx(c.Center,{children:r.jsx(uo,{size:"lg"})})}):null,Y=()=>S?r.jsx(c.View,{...Oc,...x==null?void 0:x.errorOverlay,children:C||r.jsx(c.Text,{fontWeight:"medium",children:typeof S=="string"?S:"An error occurred"})}):null,O=()=>w?r.jsx(c.View,{...qc,...x==null?void 0:x.noDataOverlay,children:I||r.jsx(c.Text,{children:typeof w=="string"?w:"No data available"})}):null,X=M??(typeof n=="string"?n:"Chart"),Z=!S&&!k&&!w;return r.jsxs(c.View,{ref:W,role:"region","aria-label":X,"aria-busy":k,...Pc,...x==null?void 0:x.container,...V,children:[n&&r.jsx(c.Text,{...Wc,children:n}),Z&&a==="top"&&D(),r.jsxs(c.View,{flex:1,width:"100%",position:"relative",...x==null?void 0:x.chart,children:[Z&&q(),K(),Y(),O()]}),Z&&a==="bottom"&&D(),r.jsx(vc,{visible:d&&T.visible,x:T.x,y:T.y,content:T.content,maxDistance:100,views:x})]})},Kc=e=>r.jsx(Xc,{...e}),Qc=Kc,Zc=(e=365)=>{const[o,t]=u.useState(!1),[n,i]=u.useState(null),a="app-studio-cookie-consent";u.useEffect(()=>{const g=localStorage.getItem(a);i(g!==null?g==="true":!1)},[]);const l=g=>{localStorage.setItem(a,String(g));const p=new Date;p.setDate(p.getDate()+e),localStorage.setItem(`${a}-expires`,p.toISOString()),i(g)};return{isHovered:o,setIsHovered:t,hasConsent:n,acceptCookies:()=>{l(!0)},resetConsent:()=>{localStorage.removeItem(a),localStorage.removeItem(`${a}-expires`),i(!1)}}},Jc=e=>{const o=e==="dark";return{default:{container:{backgroundColor:o?"#1f2937":"#ffffff",borderColor:o?"#374151":"#e5e7eb",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#e5e7eb":"#1f2937"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:o?"#e5e7eb":"#4b5563",borderColor:o?"#4b5563":"#d1d5db",hoverBackgroundColor:o?"#374151":"#f3f4f6"}},info:{container:{backgroundColor:o?"#1e3a8a":"#eff6ff",borderColor:o?"#1e40af":"#bfdbfe",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#bfdbfe":"#1e40af"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:o?"#bfdbfe":"#1e40af",borderColor:o?"#3b82f6":"#93c5fd",hoverBackgroundColor:o?"#1e40af":"#dbeafe"}},primary:{container:{backgroundColor:o?"#0c4a6e":"#f0f9ff",borderColor:o?"#0369a1":"#bae6fd",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#bae6fd":"#0369a1"},acceptButton:{backgroundColor:"#0ea5e9",color:"#ffffff",hoverBackgroundColor:"#0284c7"},customizeButton:{backgroundColor:"transparent",color:o?"#bae6fd":"#0369a1",borderColor:o?"#0ea5e9":"#7dd3fc",hoverBackgroundColor:o?"#0369a1":"#e0f2fe"}}}},es=({title:e="Nous utilisons des cookies",description:o="Ce site utilise des cookies pour améliorer votre expérience. En continuant à naviguer sur ce site, vous acceptez notre utilisation des cookies conformément à notre politique de confidentialité.",acceptButtonText:t="Accepter",customizeButtonText:n="Personnaliser",position:i="bottom",variant:a="default",onAccept:l,onCustomize:d,views:s,showCustomizeButton:g=!0,cookieExpiration:p=365,themeMode:m,...h})=>{const{themeMode:f}=c.useTheme(),x=m||f||"light",{hasConsent:y,acceptCookies:b}=Zc(p),S=Jc(x)[a];if(y)return null;const w=()=>{b(),l&&l()},j=()=>{d&&d()};return r.jsx(c.View,{style:{position:"fixed",left:16,right:16,zIndex:1e3,...i==="bottom"?{bottom:16}:{top:16}},padding:16,borderWidth:"1px",borderStyle:"solid",borderRadius:8,maxWidth:"800px",marginLeft:"auto",marginRight:"auto",transition:"opacity 0.3s ease, transform 0.3s ease",...S.container,...s==null?void 0:s.container,...h,children:r.jsxs(c.Vertical,{gap:12,maxWidth:1200,marginLeft:"auto",marginRight:"auto",children:[e&&r.jsx(c.Text,{fontWeight:"bold",fontSize:18,color:"color-black",...s==null?void 0:s.title,children:e}),o&&r.jsx(c.Text,{fontSize:14,color:"color-black",...s==null?void 0:s.description,children:o}),r.jsxs(c.Horizontal,{gap:12,justifyContent:"flex-end",marginTop:8,...s==null?void 0:s.buttonGroup,children:[g&&r.jsx(_e,{variant:"outline",onClick:j,size:"sm",...s==null?void 0:s.customizeButton,children:n}),r.jsx(_e,{variant:"primary",onClick:w,size:"sm",...s==null?void 0:s.acceptButton,children:t})]})]})})},os=e=>r.jsx(es,{...e}),ts=os,rs=e=>{const{size:o,variant:t,onOpenChange:n}=e||{},[i,a]=u.useState(!1),[l,d]=u.useState({x:0,y:0}),[s,g]=u.useState(null),p=u.useRef(null),m=u.useRef(null),h=u.useMemo(()=>jt("contextmenu-content"),[]),f=u.useCallback(y=>{d({x:y.clientX,y:y.clientY}),a(!0),n==null||n(!0)},[n]),x=u.useCallback(()=>{a(!1),g(null),n==null||n(!1)},[n]);return u.useEffect(()=>{const y=S=>{m.current&&!m.current.contains(S.target)&&x()},b=()=>{i&&x()},k=S=>{S.key==="Escape"&&i&&x()};return document.addEventListener("mousedown",y),window.addEventListener("resize",b),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",y),window.removeEventListener("resize",b),document.removeEventListener("keydown",k)}},[i,x]),{isOpen:i,setIsOpen:a,position:l,setPosition:d,activeSubmenuId:s,setActiveSubmenuId:g,size:o,variant:t,triggerRef:p,contentRef:m,contentId:h,openMenu:f,closeMenu:x}},Kt={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},ns={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Qt={hover:{backgroundColor:"color-gray-100"}},Kr=u.createContext({isOpen:!1,setIsOpen:()=>{},position:{x:0,y:0},setPosition:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null},contentRef:{current:null},contentId:"contextmenu-content",closeMenu:()=>{},openMenu:()=>{}}),as=({children:e,value:o})=>r.jsx(Kr.Provider,{value:o,children:e}),Ho=()=>{const e=u.useContext(Kr);if(!e)throw new Error("useContextMenuContext must be used within a ContextMenuProvider");return e},Qr=({children:e,disableNativeContextMenu:o=!0,asChild:t=!1,isDisabled:n=!1,views:i,...a})=>{const{triggerRef:l,contentId:d,openMenu:s}=Ho(),p={ref:l,onContextMenu:m=>{if(!n)if(o&&m.preventDefault(),s)s(m);else{const{setIsOpen:h,setPosition:f}=Ho();f({x:m.clientX,y:m.clientY}),h(!0)}},"aria-controls":d,"aria-haspopup":"menu","data-disabled":n?"":void 0,...t&&u.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:n},...i==null?void 0:i.container,...a};if(t&&u.isValidElement(e)){const m=u.Children.only(e);return u.cloneElement(m,{...p,...m.props})}return r.jsx(c.View,{...p,children:e})},Ht=({items:e,children:o,position:t,side:n="right",align:i="start",views:a,style:l,...d})=>{const{isOpen:s,position:g,contentRef:p,contentId:m,variant:h}=Ho(),f=u.useRef(null),x=p||f,{ref:y,relation:b}=c.useElementPosition({}),[k,S]=u.useState({x:0,y:0});if(u.useEffect(()=>{if(s&&x.current){const j=t||g,C=x.current.offsetWidth,I=x.current.offsetHeight,M=window.innerWidth,R=window.innerHeight;let V=j.x,_=j.y;b&&(b.space.horizontal==="left"?V=j.x-C:V=j.x,b.space.vertical==="top"?_=j.y-I:_=j.y),V+C>M&&(V=M-C-8),V<8&&(V=8),_+I>R&&(_=R-I-8),_<8&&(_=8),S({x:V,y:_})}},[s,g,t,n,i,x,b]),!s)return null;const w={position:"fixed",top:`${k.y}px`,left:`${k.x}px`,zIndex:1e3,transformOrigin:"top left"};return r.jsxs(c.View,{id:m||"context-menu",ref:x,role:"menu",tabIndex:-1,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:{...w,...l},...ns[h],...a==null?void 0:a.menu,...a==null?void 0:a.content,...d,children:[e&&e.map((j,C)=>j.divider?r.jsx(Jr,{views:a},`divider-${C}`):r.jsx(Zr,{item:j,views:a},j.id)),o]})},Zr=({item:e,children:o,onSelect:t,isDisabled:n=!1,views:i,...a})=>{const{activeSubmenuId:l,setActiveSubmenuId:d,size:s,closeMenu:g}=Ho();if(e){const[m,h]=u.useState(!1),f=e.items&&e.items.length>0,x=l===e.id,[y,b]=u.useState({x:0,y:0}),k=e.disabled||n,S=()=>{h(!0),f&&d(e.id)},w=()=>{h(!1)},j=()=>{k||!f&&e.onClick&&(e.onClick(),g&&g())},{ref:C,relation:I}=c.useElementPosition({});return u.useEffect(()=>{if(x&&C.current){const M=C.current.getBoundingClientRect(),R=window.innerWidth,V=200;let _=!1;if(I)_=I.space.horizontal==="left";else{const T=R-M.right,W=M.left;_=T<V&&W>T}b({x:_?M.left-V:M.right,y:M.top})}},[x,e.items,I]),r.jsxs(c.View,{ref:C,role:"menuitem",display:"flex",alignItems:"center",cursor:k?"not-allowed":"pointer",opacity:k?.5:1,position:"relative","aria-disabled":k,"data-disabled":k?"":void 0,...Kt[s],_hover:k?{}:Qt.hover,backgroundColor:m&&!k?"color-gray-100":"transparent",onMouseEnter:S,onMouseLeave:w,onClick:j,...i==null?void 0:i.item,...a,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),r.jsx(c.View,{flexGrow:1,children:e.label}),f&&r.jsx(c.View,{marginLeft:8,...i==null?void 0:i.submenuIndicator,children:r.jsx(ae,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),x&&f&&r.jsx(Ht,{items:e.items||[],position:y,side:"right",align:"start",views:i})]})}const p=m=>{n||(t==null||t(m),g&&g())};return r.jsx(c.View,{role:"menuitem",onClick:p,cursor:n?"not-allowed":"pointer",opacity:n?.5:1,"aria-disabled":n,"data-disabled":n?"":void 0,...Kt[s],_hover:n?{}:Qt.hover,...i==null?void 0:i.item,...a,children:o})},Jr=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.divider,...o}),is=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.separator,...o}),ls=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:i=!0,views:a,themeMode:l,...d})=>!o||o.length===0?r.jsx(r.Fragment,{children:e}):r.jsxs(r.Fragment,{children:[r.jsx(Qr,{disableNativeContextMenu:i,views:a,...d,children:e}),r.jsx(Ht,{items:o,views:a})]}),cs=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:i=!0,onOpenChange:a,views:l,...d})=>{const s=rs({size:t,variant:n,onOpenChange:a}),{isOpen:g,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:f,setActiveSubmenuId:x,triggerRef:y,contentRef:b,contentId:k,openMenu:S,closeMenu:w}=s;return r.jsx(as,{value:{isOpen:g,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:f,setActiveSubmenuId:x,size:t,variant:n,triggerRef:y,contentRef:b,contentId:k,openMenu:S,closeMenu:w,styles:l},children:r.jsx(ls,{items:o,size:t,variant:n,disableNativeContextMenu:i,views:l,...d,children:e})})},Ke=cs;Ke.Trigger=Qr;Ke.Content=Ht;Ke.Item=Zr;Ke.Divider=Jr;Ke.Separator=is;const ss=({src:e,color:o,views:t,themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=o?{fill:a(o,{themeMode:l}),stroke:a(o,{themeMode:l})}:{};return r.jsx(c.Center,{...i,...t==null?void 0:t.container,children:r.jsx(c.Image,{...d,content:'url("'+e+'")',width:"100%",height:"100%",...t==null?void 0:t.image})})},ds=({path:e,...o})=>r.jsx(c.Image,{src:e,...o}),en=({placeholder:e,isMulti:o,options:t,id:n=`select-${Math.random().toString(36).substr(2,9)}`})=>{const i=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(i),[m,h]=u.useState(0),[f,x]=u.useState(!0);return{id:n,value:g,setValue:p,hide:f,setHide:x,isHovered:a,setIsHovered:l,isFocused:d,setIsFocused:s,highlightedIndex:m,setHighlightedIndex:h}},on=({children:e,containerId:o="portal-root"})=>{const[t,n]=u.useState(null);return u.useEffect(()=>{let i=document.getElementById(o),a=!1;return i||(a=!0,i=document.createElement("div"),i.setAttribute("id",o),document.body.appendChild(i)),n(i),()=>{a&&i&&i.parentNode&&i.childNodes.length===0&&i.parentNode.removeChild(i)}},[o]),t?ri.createPortal(e,t):null},mt=({children:e,views:o={helperText:{}},...t})=>r.jsx(c.Text,{size:"xs",fontWeight:"400",letterSpacing:"-0.01em",lineHeight:"16px",marginVertical:0,marginHorizontal:0,color:"color-gray-500",transition:"all 0.2s ease",...o.helperText,...t,children:e}),we=u.forwardRef(({children:e,helperText:o,error:t=!1,views:n,...i},a)=>r.jsxs(c.Vertical,{ref:a,gap:8,position:"relative",width:"100%",marginVertical:4,...i,...n==null?void 0:n.container,children:[e,!t&&o&&r.jsx(mt,{marginTop:4,...n==null?void 0:n.helperText,children:o}),t&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,fontWeight:"500",color:"color-red-500",transition:"all 0.2s ease",...n==null?void 0:n.error,children:t})]}));we.displayName="FieldContainer";const tn={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},Zt={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},rn={outline:{borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",transition:"border-color 200ms ease-out, box-shadow 200ms ease-out, background-color 200ms ease-out",_hover:{borderColor:"color-gray-300",backgroundColor:"color-gray-50"},_focus:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"},_focusVisible:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"}},default:{borderWidth:0,borderBottomWidth:"1.5px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",borderRadius:0,backgroundColor:"transparent",transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out",_hover:{borderBottomColor:"color-gray-400",backgroundColor:"color-gray-50"},_focus:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"},_focusVisible:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"}},none:{border:"none",backgroundColor:"transparent",transition:"background-color 200ms ease-out",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"},_focusVisible:{outline:"none",backgroundColor:"color-gray-100"}}},us={paddingTop:"16px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"12px",paddingBottom:"6px",paddingLeft:"12px",paddingRight:"12px"}}},gs={paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"12px",paddingRight:"12px"}}},Ve=({label:e,shadow:o,children:t,value:n,size:i="md",shape:a="default",variant:l="default",error:d=!1,showLabel:s=!1,isFocused:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,views:f={pickerBox:{}},...x})=>{const b=d?"color-red-500":(p||g)&&!m?"theme-primary":"color-gray-300";return r.jsx(c.Horizontal,{gap:8,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",marginBottom:2,borderStyle:"solid",borderColor:b,backgroundColor:"color-white",fontSize:c.Typography.fontSizes[i],cursor:m?"not-allowed":h?"auto":"text",opacity:m?.7:1,transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out, opacity 200ms ease-out",...s?us:gs,...o,...tn[a],...rn[l],...f==null?void 0:f.container,...x,children:t})},Bt=({children:e,...o})=>r.jsx(c.Center,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",...o,children:e}),ps={h1:{fontSize:96,lineHeight:112,letterSpacing:-1.5},h2:{fontSize:60,lineHeight:71,letterSpacing:-.5},h3:{fontSize:48,lineHeight:57,letterSpacing:0},h4:{fontSize:34,lineHeight:40,letterSpacing:.25},h5:{fontSize:24,lineHeight:28,letterSpacing:0},h6:{fontSize:20,lineHeight:24,letterSpacing:.15}},ms=({children:e,heading:o,isItalic:t=!1,isUnderlined:n=!1,isStriked:i=!1,weight:a="normal",size:l="sm",dropDown:d,...s})=>{const g=o?ps[o]:{};return r.jsx(c.Element,{as:"label",width:"100%",fontSize:l,fontStyle:t?"italic":"normal",fontWeight:c.Typography.fontWeights[a],textDecoration:i?"line-through":n?"underline":"none",...g,...s,children:e})},hs=e=>r.jsx(ms,{...e}),ho=hs,He=({children:e,size:o="md",error:t=!1,color:n="theme-primary",views:i={label:{}},helperText:a,...l})=>r.jsx(ho,{top:0,zIndex:-10,position:"absolute",fontSize:Zt[o],lineHeight:Zt[o],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:t?"color-red-500":n,transition:"color 200ms ease-out",...i.label,...l,children:e}),Qe=({children:e,...o})=>r.jsx(c.Vertical,{width:"100%",maxWidth:"100%",position:"relative",...o,children:e}),nn={xs:12,sm:14,md:16,lg:20,xl:24},fs={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},xs={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},bs={padding:"10px 12px",cursor:"pointer",borderRadius:"6px",margin:"2px 4px",transition:"background-color 0.15s ease"},So={default:{backgroundColor:"transparent"},highlighted:{backgroundColor:"color-gray-100"},selected:{backgroundColor:"color-gray-100"},selectedHighlighted:{backgroundColor:"color-gray-200"}},Jt={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},ys={padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},ks={scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.15) transparent"},js=({isHovered:e,setIsHovered:o,option:t,size:n="md",callback:i=()=>{},style:a,isSelected:l=!1,...d})=>{const s=(m,h)=>{m.stopPropagation(),m.preventDefault(),typeof i=="function"&&i(h)},g=()=>o(!e),p=()=>l&&e?So.selectedHighlighted:l?So.selected:e?So.highlighted:So.default;return r.jsxs(c.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...bs,...p(),onMouseEnter:g,onMouseLeave:g,onClick:m=>s(m,t.value),...d,children:[r.jsx(c.Text,{fontSize:c.Typography.fontSizes[n],fontWeight:l?"500":"400",lineHeight:"1.4",color:l?"color-gray-900":"color-gray-700",...a,children:t.label}),l&&r.jsx(c.Element,{as:"span",color:"theme-primary",fontSize:"14px",marginLeft:8,display:"flex",alignItems:"center",children:"✓"})]})},Cs=({size:e="md",views:o={field:{},text:{}},value:t,isDisabled:n,placeholder:i,removeOption:a=()=>{},options:l})=>{const d={margin:0,width:"95%",height:"100%",border:"none",paddingVertical:4,paddingHorizontal:0,fontSize:c.Typography.fontSizes[e],fontWeight:"400",lineHeight:"1.5",letterSpacing:"-0.01em",backgroundColor:"transparent",color:n?"color-gray-400":"color-gray-900",cursor:n?"not-allowed":"pointer",transition:"all 0.2s ease",...o.field,...o.text},s=l.length>0&&l.find(g=>g.value===t);return r.jsx(c.Text,{...d,children:(t===""||Array.isArray(t)&&t.length===0)&&i?i:r.jsx(r.Fragment,{children:typeof t=="string"?(s&&s.label)??t:Array.isArray(t)&&t.length>0?r.jsx(c.Horizontal,{gap:6,children:t.map(g=>r.jsx(Is,{option:g,removeOption:a},g))}):r.jsx("span",{children:t})})})},Ss=({id:e,name:o,value:t,onChange:n,isMulti:i=!1,isDisabled:a=!1,isReadOnly:l=!1,options:d=[],...s})=>{const g=p=>{n&&n(p)};return r.jsx(c.Element,{id:e,name:o,as:"select",opacity:0,width:0,height:0,position:"absolute",value:t,disabled:a,readOnly:l,onChange:g,multiple:i,...s,children:d.length>0&&d.map(p=>r.jsx("option",{value:p.value,children:p.label},p.value))})},ws=({size:e,views:o={},options:t,callback:n=()=>{},highlightedIndex:i,setHighlightedIndex:a,selectedValue:l})=>{const d=g=>n(g),s=g=>Array.isArray(l)?l.includes(g):l===g;return r.jsx(c.Element,{as:"ul",role:"listbox",display:"flex",flexDirection:"column",margin:0,padding:"4px",...fs,style:ks,...o==null?void 0:o.dropDown,children:t&&t.length>0&&t.map((g,p)=>r.jsx(js,{size:e,style:o.text,option:g,callback:d,isSelected:s(g.value),isHovered:p===i,setIsHovered:()=>{},onMouseEnter:()=>a(p)},g.value))})},Is=({option:e,size:o="md",removeOption:t=()=>{},...n})=>{const i=()=>t(e);return r.jsxs(c.Horizontal,{gap:6,alignItems:"center",onClick:a=>a.stopPropagation(),...ys,_hover:{backgroundColor:"color-gray-200"},...n,children:[r.jsx(c.Text,{fontSize:c.Typography.fontSizes[o],fontWeight:"500",color:"color-gray-700",children:e}),r.jsx(fe,{role:"close-button",color:"color-gray-500",widthHeight:nn[o],onClick:i,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},an=({id:e,name:o,label:t,value:n,placeholder:i,helperText:a,hide:l=!1,error:d=!1,isMulti:s=!1,isFocused:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,options:f=[],shadow:x={},size:y="md",shape:b="default",variant:k="default",views:S={text:{},icon:{},dropDown:{},selectBox:{},label:{},helperText:{}},onChange:w=()=>{},setHide:j=()=>{},setValue:C=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setHighlightedIndex:R,highlightedIndex:V,..._})=>{const{ref:T,relation:W,updateRelation:B}=c.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),P=u.useRef(null),z=()=>{var Y;if(!T.current)return{};const D=T.current.getBoundingClientRect(),q={position:"fixed",left:D.left,width:D.width,zIndex:1e4};return((Y=W==null?void 0:W.space)==null?void 0:Y.vertical)==="top"?{...q,bottom:window.innerHeight-D.top+8}:{...q,top:D.bottom+8}};u.useEffect(()=>{const D=()=>j(!0);return document.addEventListener("closeAllSelects",D),()=>document.removeEventListener("closeAllSelects",D)},[j]),u.useEffect(()=>{const D=q=>{!q.target.closest(`#${e}`)&&!l&&j(!0)};return document.addEventListener("click",D),()=>{document.removeEventListener("click",D)}},[e,l,j]);const $=!!(g&&t),E=()=>I(!p),H=()=>M(!0),L=D=>{document.dispatchEvent(new Event("closeAllSelects")),D&&D.stopPropagation&&D.stopPropagation();const q=!l;j(q),M(!q)},A=u.useCallback(D=>{if(j(!0),document.dispatchEvent(new Event("closeAllSelects")),s&&Array.isArray(n)){if(!n.includes(D)){const q=[...n,D];C(q),w&&w(D)}}else C(D),w&&w(D);M(!0)},[s,n,j,C,w,M]),F=D=>{if(Array.isArray(n)&&n.includes(D)){const q=n.filter(K=>K!==D);C(q.length===0?[]:q)}};return r.jsx(we,{ref:T,position:"relative",width:"100%",display:"inline-block",id:e,role:"SelectBox",helperText:a,error:d,views:S,onClick:D=>{D.stopPropagation(),m||h||L(D)},children:r.jsxs(Ve,{label:t,size:y,error:d,shape:b,views:S,shadow:x,variant:k,value:n,color:"theme-primary",isHovered:p,isDisabled:m,isReadOnly:h,isFocused:g,showLabel:$,onMouseEnter:E,onMouseLeave:E,position:"relative",children:[r.jsxs(Qe,{children:[$&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...S,children:t}),r.jsx(Ss,{id:e,name:o,options:f,onChange:w,value:n,isDisabled:m,isReadOnly:h,isMulti:s,onFocus:H,..._}),r.jsx(Cs,{options:f,size:y,views:S,value:n,isDisabled:m,placeholder:i,removeOption:F})]}),r.jsx(Bt,{children:!h&&!m&&r.jsx(c.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:l?Jt.closed:Jt.open,children:r.jsx(ae,{color:"inherit",widthHeight:nn[y],style:S.icon,orientation:"down"})})}),!l&&f.length>0&&r.jsx(on,{children:r.jsx(c.Element,{ref:P,onClick:D=>D.stopPropagation(),style:{...z(),...xs.enter},children:r.jsx(ws,{size:y,views:S,options:f,callback:A,highlightedIndex:V,setHighlightedIndex:R,selectedValue:n})})})]})})},Ts=e=>{const o={...e,options:e.options||[]},t=en(o);return r.jsx(an,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},Ms=Ts,ln=({isDisabled:e,isChecked:o})=>{const[t,n]=u.useState(!1),[i,a]=u.useState(o||!1),[l,d]=u.useState(o||!1);return u.useEffect(()=>{o!==void 0&&(a(o),d(o))},[o]),{isHovered:t,setIsHovered:n,on:i,setOn:a,value:l,setValue:d}},zs={xs:{height:"8px",width:"8px"},sm:{height:"12px",width:"12px"},md:{height:"16px",width:"16px"},lg:{height:"20px",width:"20px"},xl:{height:"24px",width:"24px"}},Rs={xs:{height:"16px",width:"36px"},sm:{height:"20px",width:"44px"},md:{height:"24px",width:"52px"},lg:{height:"28px",width:"60px"},xl:{height:"32px",width:"68px"}},Vs={xs:{paddingVertical:4,paddingHorizontal:2},sm:{paddingVertical:4,paddingHorizontal:2},md:{paddingVertical:4,paddingHorizontal:4},lg:{paddingVertical:4,paddingHorizontal:4},xl:{paddingVertical:4,paddingHorizontal:4}},Pe={default:{active:"theme-primary",inactive:"color-gray-300",knob:"white",disabled:"color-gray-200"},states:{hover:{active:"theme-primary",inactive:"color-gray-400",activeOpacity:.9}}},er={slider:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},knob:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}},Es=e=>r.jsx(c.Input,{type:"checkbox",...e}),cn=({id:e,name:o,label:t,inActiveChild:n,isChecked:i,activeChild:a,labelPosition:l="right",shadow:d={},size:s="sm",value:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,on:f,setOn:x,onChange:y,setValue:b=()=>{},setIsHovered:k=()=>{},helperText:S,views:w={slider:{},circle:{},label:{}},...j})=>{const C=V=>{if(!h&&!m){const _=V.target.checked;b(_),x(_),y&&y(_)}},I=()=>k(!0),M=()=>k(!1),R={container:{gap:12,display:"flex",height:"fit-content",width:"fit-content",alignItems:"center",cursor:m?"not-allowed":h?"default":"pointer",opacity:m?.6:1,transition:"all 0.2s ease",...w.label}};return r.jsxs(ho,{htmlFor:e,onMouseEnter:I,onMouseLeave:M,...R.container,...j,children:[r.jsx(Es,{id:e,name:o,opacity:0,width:0,height:0,checked:g,onChange:C,disabled:m,readOnly:h,...j}),l==="left"&&t&&r.jsx(c.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t}),r.jsxs(c.View,{display:"flex",alignItems:"center",justifyContent:g?a?"space-between":"flex-end":n?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:m?Pe.default.disabled:g?p?Pe.states.hover.active:Pe.default.active:p?Pe.states.hover.inactive:Pe.default.inactive,opacity:!m&&g&&p?Pe.states.hover.activeOpacity:1,cursor:"pointer",...er.slider,...d,...Vs[s],...Rs[s],...w.slider,children:[a&&g&&r.jsx(c.View,{marginLeft:8,marginRight:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:a}),r.jsx(c.View,{borderRadius:"50%",backgroundColor:Pe.default.knob,boxShadow:p?"0 2px 4px rgba(0, 0, 0, 0.2)":"0 1px 2px rgba(0, 0, 0, 0.1)",transform:p?"scale(1.05)":"scale(1)",...er.knob,zIndex:1,...zs[s],...w.circle}),n&&!g&&r.jsx(c.View,{marginRight:8,marginLeft:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:n})]}),l==="right"&&t&&r.jsx(c.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t})]})},Ps=e=>{const o=ln(e);return r.jsx(cn,{...o,...e})},Ws=Ps,sn=({placeholder:e,isMulti:o,options:t,id:n=`selector-${Math.random().toString(36).substr(2,9)}`})=>{const i=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(i),[m,h]=u.useState(0),[f,x]=u.useState(!0);return{id:n,value:g,setValue:p,hide:f,setHide:x,isHovered:a,setIsHovered:l,isFocused:d,setIsFocused:s,highlightedIndex:m,setHighlightedIndex:h}},dn=({id:e,name:o,label:t,value:n,size:i,views:a={},options:l=[],onChange:d=()=>{},setValue:s=()=>{},...g})=>{const{getColor:p}=c.useTheme(),m=u.useCallback(h=>{s(h.value),d&&d(h.value)},[s,d]);return r.jsxs(we,{id:e,width:"100%",views:a,children:[t&&r.jsxs(c.Horizontal,{fontSize:"10px",letterSpacing:"wider",color:"color-black-500",fontWeight:"bold",marginBottom:12,alignItems:"center",gap:6,style:{textTransform:"uppercase"},children:[r.jsx(ze,{widthHeight:14})," ",r.jsx(c.Text,{children:t})]}),r.jsx(c.Horizontal,{gap:0,children:l.map((h,f,x)=>{const y=n===h.value;let b=p("color-gray-200"),k=p("color-gray-500"),S="transparent";if(y){if(h.color)h.color,b=p(h.color),k=p(h.color),S="rgba(0,0,0,0.05)";else{const w=p("theme-primary");b=w,k=w,S="color-gray-50"}h.color?(b=p(h.color),k=p(h.color),S="transparent"):(b=p("theme-primary"),k=p("theme-primary"),S="transparent")}return r.jsx(_e,{onClick:()=>m(h),flex:1,...i?{size:i}:{paddingVertical:6,fontSize:"12px"},fontWeight:y?"bold":"normal",style:{borderTop:`1px solid ${y?b:p("color-gray-200")}`,borderBottom:`1px solid ${y?b:p("color-gray-200")}`,borderLeft:`1px solid ${y?b:p("color-gray-200")}`,borderRight:f===x.length-1||y?`1px solid ${y?b:p("color-gray-200")}`:"none",backgroundColor:S,color:k,borderRadius:f===0?"6px 0 0 6px":f===x.length-1?"0 6px 6px 0":"0",zIndex:y?1:0,boxShadow:"none"},...a.item,children:h.label},h.value)})}),r.jsx("input",{type:"hidden",id:e,name:o,value:Array.isArray(n)?n.join(","):n,onChange:()=>{}})]})},_s=e=>{const o={...e,options:e.options||[]},t=sn(o);return r.jsx(dn,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},$s=_s,un=({label:e,placeholder:o,value:t})=>{const[n,i]=u.useState(e??o),[a,l]=u.useState(!1),[d,s]=u.useState(t||""),[g,p]=u.useState(!1);return u.useMemo(()=>{i(g&&!d?o??"":e??o)},[d,g,e,o]),{hint:n,setHint:i,isHovered:a,setIsHovered:l,value:d,setValue:s,isFocused:g,setIsFocused:p}},gn=({id:e,name:o,hint:t,error:n,value:i,label:a,shadow:l,helperText:d,placeholder:s,size:g="sm",shape:p="default",variant:m="default",isHovered:h=!1,isFocused:f=!1,isEditable:x=!1,isReadOnly:y=!1,isDisabled:b=!1,isAutoFocus:k=!1,isMultiline:S=!1,maxRows:w=3,maxCols:j=30,onBlur:C=()=>{},onChange:I,onFocus:M,setHint:R=()=>{},setValue:V=()=>{},setIsFocused:_=()=>{},setIsHovered:T=()=>{},views:W={label:{},helperText:{}},...B})=>{const P=!!(f&&a),z={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[g],lineHeight:`${Math.round(c.Typography.fontSizes[g]*1.5)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:b?"color-gray-400":"color-gray-900",cursor:b?"not-allowed":"text",opacity:b?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...W.field},$=()=>T(!h),E=()=>{_(!0),M&&M()},H=A=>{C(A),_(!1)},L=A=>{typeof A=="string"?(V(A),I&&I(A)):(V(A.target.value),I&&I(A.target.value))};return r.jsx(we,{helperText:d,error:n,views:W,...B,children:r.jsx(Ve,{label:a,size:g,error:n,shape:p,views:W,shadow:l,variant:m,value:i,color:"theme-primary",isHovered:h,isDisabled:b,isReadOnly:y,isFocused:f,showLabel:P,onMouseEnter:$,onMouseLeave:$,...W==null?void 0:W.content,children:r.jsxs(Qe,{...W==null?void 0:W.warper,children:[P&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:n,...W==null?void 0:W.label,children:a}),r.jsx(c.Element,{as:"textarea",id:e,name:o,rows:w,cols:j,value:i,readOnly:y,disabled:b,autoFocus:k,editable:`${!!x.toString()}`,placeholder:t,onBlur:H,onFocus:E,multiline:`${!!S.toString()}`,onChange:A=>L(A),...z,style:{resize:b||y?"none":"vertical"},...W==null?void 0:W.textarea})]})})})},Hs=e=>{const o=un(e);return r.jsx(gn,{...o,...e})},Bs=Hs,Lt=({label:e,placeholder:o,value:t})=>{const[n,i]=u.useState(e??o),[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(t);return u.useMemo(()=>{i(a&&!g?o??"":e??o)},[g,a,e,o]),{hint:n,setHint:i,isFocused:a,setIsFocused:l,isHovered:d,setIsHovered:s,setValue:p,value:g}},Ls=e=>r.jsx(c.Input,{type:"text",...e}),fo=({id:e,name:o,label:t,hint:n,value:i,onChange:a,left:l,right:d,helperText:s,placeholder:g,onChangeText:p,shadow:m={},views:h={container:{},field:{},label:{},helperText:{},text:{}},size:f="md",shape:x="default",variant:y="default",error:b=!1,isFocused:k=!1,isHovered:S=!1,isDisabled:w=!1,isReadOnly:j=!1,isClearable:C=!0,isAutoFocus:I=!1,setHint:M=()=>{},setIsFocused:R=()=>{},setIsHovered:V=()=>{},setValue:_=()=>{},onClick:T=()=>{},onFocus:W,onBlur:B=()=>{},themeMode:P,...z})=>{const{getColor:$,themeMode:E}=c.useTheme(),H=$("color-blueGray-700",{themeMode:P||E}),L=!!(k&&t),A={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",height:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[f],lineHeight:`${Math.round(c.Typography.fontSizes[f]*1.4)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:w?"color-gray-400":"color-gray-900",cursor:w?"not-allowed":"text",opacity:w?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...h.field},F=()=>{R(!0),W&&W()},D=()=>V(!S),q=O=>{B&&B(O),R(!1)},K=O=>{typeof O=="string"?(_(O),p&&p(O),a&&a(O)):(_(O.target.value),p&&p(O.target.value),a&&a(O.target.value))},Y=()=>{_(""),a&&(B({target:{name:o}}),p&&p(""),a&&a("")),typeof document>"u"&&p&&p("")};return r.jsx(we,{helperText:s,error:b,views:h,children:r.jsxs(Ve,{label:t,size:f,error:b,shape:x,views:h,shadow:m,variant:y,value:i,color:"theme-primary",isHovered:S,isDisabled:w,isReadOnly:j,isFocused:k,showLabel:L,onMouseEnter:D,onMouseLeave:D,children:[l,r.jsxs(Qe,{children:[L&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:b,...h,children:t}),r.jsx(Ls,{id:e,name:o,readOnly:j,disabled:w,autoFocus:I,placeholder:n,onFocus:F,onBlur:q,autoComplete:"off",...A,...z,onChange:K,value:i})]}),C&&i&&!j&&!w&&r.jsx(Bt,{children:r.jsx(fe,{size:20,color:H,onClick:Y,cursor:"pointer",borderRadius:"50%",transition:"background-color 150ms ease-out, transform 150ms ease-out",_hover:{backgroundColor:"color-gray-100",transform:"scale(1.05)"},_active:{transform:"scale(0.95)"}})}),d]})})},As=e=>{const o=Lt(e);return r.jsx(fo,{...o,...e})},xo=As,pn=({defaultIsSelected:e=!1})=>{const[o,t]=u.useState(!1),[n,i]=u.useState(e);return{isHovered:o,setIsHovered:t,isSelected:n,setIsSelected:i}},Ds={xs:{height:"12px",width:"12px"},sm:{height:"16px",width:"16px"},md:{height:"20px",width:"20px"},lg:{height:"24px",width:"24px"},xl:{height:"28px",width:"28px"}},or={xs:10,sm:14,md:16,lg:20,xl:24},Fs={selected:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},unselected:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-black",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},indeterminate:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"}},nt={hover:{selected:{opacity:.9},unselected:{borderColor:"color-gray-400",backgroundColor:"color-gray-50"},indeterminate:{opacity:.9}},disabled:{selected:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},unselected:{borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},indeterminate:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"}},error:{selected:{backgroundColor:"color-red-500",borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"},indeterminate:{backgroundColor:"color-red-500",borderColor:"color-red-500"}}},mn=({id:e,icon:o,name:t,label:n,isChecked:i,onChange:a,onValueChange:l,shadow:d={},labelPosition:s="right",size:g="md",error:p=!1,isSelected:m=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:x=!1,isIndeterminate:y=!1,defaultIsSelected:b=!1,setIsSelected:k=()=>{},setIsHovered:S=()=>{},views:w={checkbox:{},label:{}},infoText:j,helperText:C,...I})=>{const M=()=>S(!h),R=()=>{!x&&!f&&(k&&k(!m),a&&a(!i),l&&l(!i))},V=y?"indeterminate":i||m?"selected":"unselected",_=p?nt.error[V]:f?nt.disabled[V]:h?nt.hover[V]:{},T={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:p?"color-red-600":f?"color-gray-400":"color-gray-700",cursor:f?"not-allowed":x?"default":"pointer",opacity:f?.6:1,transition:"all 0.2s ease",...w.label},checkbox:{...Fs[V],..._,borderRadius:"4px",...Ds[g],transition:"all 0.2s ease",...d,...w.checkbox}};return r.jsxs(ho,{htmlFor:e,as:"div",onClick:R,onMouseEnter:M,onMouseLeave:M,size:c.Typography.fontSizes[g],...T.container,...I,children:[r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsxs(c.Horizontal,{gap:12,alignItems:"center",children:[" ",s==="left"&&n&&r.jsx(c.Text,{size:g,fontWeight:"500",...w==null?void 0:w.label,children:n}),r.jsx(c.Center,{...T.checkbox,children:y?r.jsx(Mr,{widthHeight:or[g],color:"white",transition:"all 0.2s ease"}):(i||m)&&(o??r.jsx(No,{widthHeight:or[g],color:"white",transition:"all 0.2s ease"}))}),s==="right"&&n&&r.jsx(c.Text,{size:g,fontWeight:"500",...w==null?void 0:w.label,children:n})]}),j&&r.jsx(c.Text,{marginLeft:s==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...w==null?void 0:w.infoText,children:j})]}),p&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:p})]})},Os=e=>{const o=pn(e);return r.jsx(mn,{...o,...e})},qs=Os,hn=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:i,onOpen:a,onClose:l,closeOnSelect:d=!0,maxRecentColors:s=8,showRecentColors:g=!0,isAutoFocus:p=!1}=e,[m,h]=u.useState(!1),[f,x]=u.useState(o??t),[y,b]=u.useState(""),[k,S]=u.useState([]),[w,j]=u.useState(!1),[C,I]=u.useState(!1),M=u.useRef(null),R=u.useRef(null);u.useEffect(()=>{o!==void 0&&x(o)},[o]),u.useEffect(()=>{if(g)try{const $=localStorage.getItem("colorInput-recentColors");$&&S(JSON.parse($))}catch($){console.warn("Failed to load recent colors from localStorage:",$)}},[g]),u.useEffect(()=>{p&&M.current&&M.current.focus()},[p]),u.useEffect(()=>{const $=E=>{m&&M.current&&R.current&&!M.current.contains(E.target)&&!R.current.contains(E.target)&&P()};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[m]);const V=u.useCallback($=>{g&&S(E=>{const H=E.filter(A=>A!==$),L=[$,...H].slice(0,s);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(L))}catch(A){console.warn("Failed to save recent colors to localStorage:",A)}return L})},[g,s]),_=u.useCallback(()=>{const $=!m;h($),$?a==null||a():l==null||l()},[m,a,l]),T=u.useCallback($=>{x($),V($),n==null||n($),i==null||i($),d&&(h(!1),l==null||l())},[n,i,d,l,V]),W=u.useCallback($=>{b($)},[]),B=u.useCallback(()=>{y&&(T(y),b(""))},[y,T]),P=u.useCallback(()=>{h(!1),l==null||l()},[l]),z=u.useCallback($=>{x($),n==null||n($)},[n]);return{isOpen:m,selectedColor:f,recentColors:k,customColor:y,isFocused:w,isHovered:C,handleToggle:_,handleColorSelect:T,handleCustomColorChange:W,handleCustomColorSubmit:B,handleClose:P,setIsFocused:j,setIsHovered:I,setValue:z,triggerRef:M,dropdownRef:R}},ro={container:{position:"relative",display:"inline-block",width:"fit-content"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",padding:"8px 12px"},dropdown:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"8px"},recentColors:{display:"flex",gap:"4px",flexWrap:"wrap"}},Ns={xs:{height:"28px",fontSize:"10px",padding:"4px 8px"},sm:{height:"32px",fontSize:"12px",padding:"6px 10px"},md:{height:"40px",fontSize:"14px",padding:"8px 12px"},lg:{height:"48px",fontSize:"16px",padding:"12px 16px"},xl:{height:"56px",fontSize:"20px",padding:"16px 20px"}},Us={default:{borderRadius:"6px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Gs={default:{backgroundColor:"color-white",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},outline:{backgroundColor:"transparent",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},none:{backgroundColor:"transparent",borderColor:"transparent",borderWidth:"0px"}},Ys=[{name:"Red 500",value:"color-red-500"},{name:"Orange 500",value:"color-orange-500"},{name:"Yellow 500",value:"color-yellow-500"},{name:"Green 500",value:"color-green-500"},{name:"Blue 500",value:"color-blue-500"},{name:"Indigo 500",value:"color-indigo-500"},{name:"Purple 500",value:"color-purple-500"},{name:"Pink 500",value:"color-pink-500"},{name:"Red 300",value:"color-red-300"},{name:"Orange 300",value:"color-orange-300"},{name:"Yellow 300",value:"color-yellow-300"},{name:"Green 300",value:"color-green-300"},{name:"Blue 300",value:"color-blue-300"},{name:"Indigo 300",value:"color-indigo-300"},{name:"Purple 300",value:"color-purple-300"},{name:"Pink 300",value:"color-pink-300"},{name:"Red 700",value:"color-red-700"},{name:"Orange 700",value:"color-orange-700"},{name:"Yellow 700",value:"color-yellow-700"},{name:"Green 700",value:"color-green-700"},{name:"Blue 700",value:"color-blue-700"},{name:"Indigo 700",value:"color-indigo-700"},{name:"Purple 700",value:"color-purple-700"},{name:"Pink 700",value:"color-pink-700"},{name:"Gray 100",value:"color-gray-100"},{name:"Gray 300",value:"color-gray-300"},{name:"Gray 500",value:"color-gray-500"},{name:"Gray 700",value:"color-gray-700"},{name:"Gray 900",value:"color-gray-900"},{name:"White",value:"color-white"},{name:"Black",value:"color-black"},{name:"Transparent",value:"transparent"}],fn=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",shadow:g,error:p=!1,isDisabled:m=!1,isReadOnly:h=!1,isFocused:f=!1,isHovered:x=!1,predefinedColors:y=Ys,showCustomInput:b=!0,showRecentColors:k=!0,isOpen:S=!1,selectedColor:w="",recentColors:j=[],customColor:C="",handleToggle:I=()=>{},handleColorSelect:M=()=>{},handleCustomColorChange:R=()=>{},handleCustomColorSubmit:V=()=>{},setIsFocused:_=()=>{},setIsHovered:T=()=>{},triggerRef:W,dropdownRef:B,onChange:P,...z})=>{const{getColor:$}=c.useTheme(),E={...ro.container,...a==null?void 0:a.container},H={...ro.trigger,...Ns[l],...Us[d],...Gs[s],...p&&{borderColor:"color-red-500"},...m&&{opacity:.6,cursor:"not-allowed"},...f&&{borderColor:"color-blue-500",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.1)"},...x&&!m&&{borderColor:"color-gray-400"},...a==null?void 0:a.trigger,...g&&g},L={...ro.dropdown,...a==null?void 0:a.dropdown},A={...ro.colorGrid,...a==null?void 0:a.colorGrid},F={...ro.recentColors,...a==null?void 0:a.recentColors},D=w||"color-gray-200";return r.jsxs(c.View,{...E,...z,children:[t&&r.jsx(ho,{htmlFor:e,size:l,isDisabled:m,error:p,views:a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:W,onClick:m||h?void 0:I,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),onFocus:()=>_(!0),onBlur:()=>_(!1),tabIndex:m?-1:0,role:"button","aria-expanded":S,"aria-haspopup":"listbox","aria-label":t||n,width:"fit-content",gap:8,...H,children:[r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:D,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),!h&&!m&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:S?"up":"down"})]}),S&&r.jsxs(c.View,{ref:B,...L,children:[r.jsx(c.View,{...A,children:y.map((q,K)=>r.jsx(c.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:q.value,borderWidth:"2px",borderStyle:"solid",borderColor:w===q.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(q.value),title:q.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},K))}),k&&j.length>0&&r.jsxs(c.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(c.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Recent Colors"}),r.jsx(c.Horizontal,{gap:4,flexWrap:"wrap",...F,children:j.map((q,K)=>r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:q,borderWidth:"1px",borderStyle:"solid",borderColor:w===q?"color-blue-500":"color-gray-300",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(q),title:q,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"}},K))})]}),b&&r.jsxs(c.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(c.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Custom Color"}),r.jsxs(c.Horizontal,{gap:8,children:[r.jsx(xo,{value:C,onChange:q=>R(q.target.value),placeholder:"#000000 or rgb(0,0,0)",size:"sm",style:{flex:1},views:a==null?void 0:a.customInput}),r.jsx(c.View,{padding:"8px 12px",backgroundColor:"color-blue-500",borderRadius:"4px",cursor:"pointer",onClick:V,_hover:{backgroundColor:"color-blue-600"},children:r.jsx(c.Text,{color:"color-white",fontSize:"12px",fontWeight:"500",children:"Add"})})]})]})]}),i&&r.jsx(c.Text,{fontSize:"12px",color:p?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i}),p&&typeof p=="string"&&r.jsx(c.Text,{fontSize:"12px",color:"color-red-500",marginTop:"4px",...a==null?void 0:a.error,children:p})]})},vs=e=>{const o=hn(e);return r.jsx(fn,{...o,...e})},Xs=vs,ht=[{name:"Afghanistan",dial_code:"+93",emoji:"🇦🇫",code:"AF"},{name:"Aland Islands",dial_code:"+358",emoji:"🇦🇽",code:"AX"},{name:"Albania",dial_code:"+355",emoji:"🇦🇱",code:"AL"},{name:"Algeria",dial_code:"+213",emoji:"🇩🇿",code:"DZ"},{name:"AmericanSamoa",dial_code:"+1684",emoji:"🇦🇸",code:"AS"},{name:"Andorra",dial_code:"+376",emoji:"🇦🇩",code:"AD"},{name:"Angola",dial_code:"+244",emoji:"🇦🇴",code:"AO"},{name:"Anguilla",dial_code:"+1264",emoji:"🇦🇮",code:"AI"},{name:"Antarctica",dial_code:"+672",emoji:"🇦🇶",code:"AQ"},{name:"Antigua and Barbuda",dial_code:"+1268",emoji:"🇦🇬",code:"AG"},{name:"Argentina",dial_code:"+54",emoji:"🇦🇷",code:"AR"},{name:"Armenia",dial_code:"+374",emoji:"🇦🇲",code:"AM"},{name:"Aruba",dial_code:"+297",emoji:"🇦🇼",code:"AW"},{name:"Australia",dial_code:"+61",emoji:"🇦🇺",code:"AU"},{name:"Austria",dial_code:"+43",emoji:"🇦🇹",code:"AT"},{name:"Azerbaijan",dial_code:"+994",emoji:"🇦🇿",code:"AZ"},{name:"Bahamas",dial_code:"+1242",emoji:"🇧🇸",code:"BS"},{name:"Bahrain",dial_code:"+973",emoji:"🇧🇭",code:"BH"},{name:"Bangladesh",dial_code:"+880",emoji:"🇧🇩",code:"BD"},{name:"Barbados",dial_code:"+1246",emoji:"🇧🇧",code:"BB"},{name:"Belarus",dial_code:"+375",emoji:"🇧🇾",code:"BY"},{name:"Belgium",dial_code:"+32",emoji:"🇧🇪",code:"BE"},{name:"Belize",dial_code:"+501",emoji:"🇧🇿",code:"BZ"},{name:"Benin",dial_code:"+229",emoji:"🇧🇯",code:"BJ"},{name:"Bermuda",dial_code:"+1441",emoji:"🇧🇲",code:"BM"},{name:"Bhutan",dial_code:"+975",emoji:"🇧🇹",code:"BT"},{name:"Bolivia, Plurinational State of",dial_code:"+591",emoji:"🇧🇴",code:"BO"},{name:"Bosnia and Herzegovina",dial_code:"+387",emoji:"🇧🇦",code:"BA"},{name:"Botswana",dial_code:"+267",emoji:"🇧🇼",code:"BW"},{name:"Brazil",dial_code:"+55",emoji:"🇧🇷",code:"BR"},{name:"British Indian Ocean Territory",dial_code:"+246",emoji:"🇮🇴",code:"IO"},{name:"Brunei Darussalam",dial_code:"+673",emoji:"🇧🇳",code:"BN"},{name:"Bulgaria",dial_code:"+359",emoji:"🇧🇬",code:"BG"},{name:"Burkina Faso",dial_code:"+226",emoji:"🇧🇫",code:"BF"},{name:"Burundi",dial_code:"+257",emoji:"🇧🇮",code:"BI"},{name:"Cambodia",dial_code:"+855",emoji:"🇰🇭",code:"KH"},{name:"Cameroon",dial_code:"+237",emoji:"🇨🇲",code:"CM"},{name:"Canada",dial_code:"+1",emoji:"🇨🇦",code:"CA"},{name:"Cape Verde",dial_code:"+238",emoji:"🇨🇻",code:"CV"},{name:"Cayman Islands",dial_code:"+345",emoji:"🇰🇾",code:"KY"},{name:"Central African Republic",dial_code:"+236",emoji:"🇨🇫",code:"CF"},{name:"Chad",dial_code:"+235",emoji:"🇹🇩",code:"TD"},{name:"Chile",dial_code:"+56",emoji:"🇨🇱",code:"CL"},{name:"China",dial_code:"+86",emoji:"🇨🇳",code:"CN"},{name:"Christmas Island",dial_code:"+61",emoji:"🇨🇽",code:"CX"},{name:"Cocos (Keeling) Islands",dial_code:"+61",emoji:"🇨🇨",code:"CC"},{name:"Colombia",dial_code:"+57",emoji:"🇨🇴",code:"CO"},{name:"Comoros",dial_code:"+269",emoji:"🇰🇲",code:"KM"},{name:"Congo",dial_code:"+242",emoji:"🇨🇬",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dial_code:"+243",emoji:"🇨🇩",code:"CD"},{name:"Cook Islands",dial_code:"+682",emoji:"🇨🇰",code:"CK"},{name:"Costa Rica",dial_code:"+506",emoji:"🇨🇷",code:"CR"},{name:"Cote d'Ivoire",dial_code:"+225",emoji:"🇨🇮",code:"CI"},{name:"Croatia",dial_code:"+385",emoji:"🇭🇷",code:"HR"},{name:"Cuba",dial_code:"+53",emoji:"🇨🇺",code:"CU"},{name:"Cyprus",dial_code:"+357",emoji:"🇨🇾",code:"CY"},{name:"Czech Republic",dial_code:"+420",emoji:"🇨🇿",code:"CZ"},{name:"Denmark",dial_code:"+45",emoji:"🇩🇰",code:"DK"},{name:"Djibouti",dial_code:"+253",emoji:"🇩🇯",code:"DJ"},{name:"Dominica",dial_code:"+1767",emoji:"🇩🇲",code:"DM"},{name:"Dominican Republic",dial_code:"+1849",emoji:"🇩🇴",code:"DO"},{name:"Ecuador",dial_code:"+593",emoji:"🇪🇨",code:"EC"},{name:"Egypt",dial_code:"+20",emoji:"🇪🇬",code:"EG"},{name:"El Salvador",dial_code:"+503",emoji:"🇸🇻",code:"SV"},{name:"Equatorial Guinea",dial_code:"+240",emoji:"🇬🇶",code:"GQ"},{name:"Eritrea",dial_code:"+291",emoji:"🇪🇷",code:"ER"},{name:"Estonia",dial_code:"+372",emoji:"🇪🇪",code:"EE"},{name:"Ethiopia",dial_code:"+251",emoji:"🇪🇹",code:"ET"},{name:"Falkland Islands (Malvinas)",dial_code:"+500",emoji:"🇫🇰",code:"FK"},{name:"Faroe Islands",dial_code:"+298",emoji:"🇫🇴",code:"FO"},{name:"Fiji",dial_code:"+679",emoji:"🇫🇯",code:"FJ"},{name:"Finland",dial_code:"+358",emoji:"🇫🇮",code:"FI"},{name:"France",dial_code:"+33",emoji:"🇫🇷",code:"FR"},{name:"French Guiana",dial_code:"+594",emoji:"🇬🇫",code:"GF"},{name:"French Polynesia",dial_code:"+689",emoji:"🇵🇫",code:"PF"},{name:"Gabon",dial_code:"+241",emoji:"🇬🇦",code:"GA"},{name:"Gambia",dial_code:"+220",emoji:"🇬🇲",code:"GM"},{name:"Georgia",dial_code:"+995",emoji:"🇬🇪",code:"GE"},{name:"Germany",dial_code:"+49",emoji:"🇩🇪",code:"DE"},{name:"Ghana",dial_code:"+233",emoji:"🇬🇭",code:"GH"},{name:"Gibraltar",dial_code:"+350",emoji:"🇬🇮",code:"GI"},{name:"Greece",dial_code:"+30",emoji:"🇬🇷",code:"GR"},{name:"Greenland",dial_code:"+299",emoji:"🇬🇱",code:"GL"},{name:"Grenada",dial_code:"+1473",emoji:"🇬🇩",code:"GD"},{name:"Guadeloupe",dial_code:"+590",emoji:"🇬🇵",code:"GP"},{name:"Guam",dial_code:"+1671",emoji:"🇬🇺",code:"GU"},{name:"Guatemala",dial_code:"+502",emoji:"🇬🇹",code:"GT"},{name:"Guernsey",dial_code:"+44",emoji:"🇬🇬",code:"GG"},{name:"Guinea",dial_code:"+224",emoji:"🇬🇳",code:"GN"},{name:"Guinea-Bissau",dial_code:"+245",emoji:"🇬🇼",code:"GW"},{name:"Guyana",dial_code:"+595",emoji:"🇬🇾",code:"GY"},{name:"Haiti",dial_code:"+509",emoji:"🇭🇹",code:"HT"},{name:"Holy See (Vatican City State)",dial_code:"+379",emoji:"🇻🇦",code:"VA"},{name:"Honduras",dial_code:"+504",emoji:"🇭🇳",code:"HN"},{name:"Hong Kong",dial_code:"+852",emoji:"🇭🇰",code:"HK"},{name:"Hungary",dial_code:"+36",emoji:"🇭🇺",code:"HU"},{name:"Iceland",dial_code:"+354",emoji:"🇮🇸",code:"IS"},{name:"India",dial_code:"+91",emoji:"🇮🇳",code:"IN"},{name:"Indonesia",dial_code:"+62",emoji:"🇮🇩",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dial_code:"+98",emoji:"🇮🇷",code:"IR"},{name:"Iraq",dial_code:"+964",emoji:"🇮🇷",code:"IQ"},{name:"Ireland",dial_code:"+353",emoji:"🇮🇪",code:"IE"},{name:"Isle of Man",dial_code:"+44",emoji:"🇮🇲",code:"IM"},{name:"Israel",dial_code:"+972",emoji:"🇮🇱",code:"IL"},{name:"Italy",dial_code:"+39",emoji:"🇮🇹",code:"IT"},{name:"Jamaica",dial_code:"+1876",emoji:"🇯🇲",code:"JM"},{name:"Japan",dial_code:"+81",emoji:"🇯🇵",code:"JP"},{name:"Jersey",dial_code:"+44",emoji:"🇯🇪",code:"JE"},{name:"Jordan",dial_code:"+962",emoji:"🇯🇴",code:"JO"},{name:"Kazakhstan",dial_code:"+77",emoji:"🇰🇿",code:"KZ"},{name:"Kenya",dial_code:"+254",emoji:"🇰🇪",code:"KE"},{name:"Kiribati",dial_code:"+686",emoji:"🇰🇮",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dial_code:"+850",emoji:"🇰🇵",code:"KP"},{name:"Korea, Republic of South Korea",dial_code:"+82",emoji:"🇰🇷",code:"KR"},{name:"Kuwait",dial_code:"+965",emoji:"🇰🇼",code:"KW"},{name:"Kyrgyzstan",dial_code:"+996",emoji:"🇰🇬",code:"KG"},{name:"Laos",dial_code:"+856",emoji:"🇱🇦",code:"LA"},{name:"Latvia",dial_code:"+371",emoji:"🇱🇻",code:"LV"},{name:"Lebanon",dial_code:"+961",emoji:"🇱🇧",code:"LB"},{name:"Lesotho",dial_code:"+266",emoji:"🇱🇸",code:"LS"},{name:"Liberia",dial_code:"+231",emoji:"🇱🇷",code:"LR"},{name:"Libyan Arab Jamahiriya",dial_code:"+218",emoji:"🇱🇾",code:"LY"},{name:"Liechtenstein",dial_code:"+423",emoji:"🇱🇮",code:"LI"},{name:"Lithuania",dial_code:"+370",emoji:"🇱🇹",code:"LT"},{name:"Luxembourg",dial_code:"+352",emoji:"🇱🇺",code:"LU"},{name:"Macao",dial_code:"+853",emoji:"🇲🇴",code:"MO"},{name:"Macedonia",dial_code:"+389",emoji:"🇲🇰",code:"MK"},{name:"Madagascar",dial_code:"+261",emoji:"🇲🇬",code:"MG"},{name:"Malawi",dial_code:"+265",emoji:"🇲🇼",code:"MW"},{name:"Malaysia",dial_code:"+60",emoji:"🇲🇾",code:"MY"},{name:"Maldives",dial_code:"+960",emoji:"🇲🇻",code:"MV"},{name:"Mali",dial_code:"+223",emoji:"🇲🇱",code:"ML"},{name:"Malta",dial_code:"+356",emoji:"🇲🇹",code:"MT"},{name:"Marshall Islands",dial_code:"+692",emoji:"🇲🇭",code:"MH"},{name:"Martinique",dial_code:"+596",emoji:"🇲🇶",code:"MQ"},{name:"Mauritania",dial_code:"+222",emoji:"🇲🇷",code:"MR"},{name:"Mauritius",dial_code:"+230",emoji:"🇲🇺",code:"MU"},{name:"Mayotte",dial_code:"+262",emoji:"🇾🇹",code:"YT"},{name:"Mexico",dial_code:"+52",emoji:"🇲🇽",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dial_code:"+691",emoji:"🇫🇲",code:"FM"},{name:"Moldova",dial_code:"+373",emoji:"🇲🇩",code:"MD"},{name:"Monaco",dial_code:"+377",emoji:"🇲🇨",code:"MC"},{name:"Mongolia",dial_code:"+976",emoji:"🇲🇳",code:"MN"},{name:"Montenegro",dial_code:"+382",emoji:"🇲🇪",code:"ME"},{name:"Montserrat",dial_code:"+1664",emoji:"🇲🇸",code:"MS"},{name:"Morocco",dial_code:"+212",emoji:"🇲🇦",code:"MA"},{name:"Mozambique",dial_code:"+258",emoji:"🇲🇿",code:"MZ"},{name:"Myanmar",dial_code:"+95",emoji:"🇲🇲",code:"MM"},{name:"Namibia",emoji:"🇳🇦",dial_code:"+264",code:"NA"},{name:"Nauru",dial_code:"+674",emoji:"🇳🇷",code:"NR"},{name:"Nepal",dial_code:"+977",emoji:"🇳🇵",code:"NP"},{name:"Netherlands",dial_code:"+31",emoji:"🇳🇱",code:"NL"},{name:"Netherlands Antilles",dial_code:"+599",emoji:"🇧🇶",code:"AN"},{name:"New Caledonia",dial_code:"+687",emoji:"🇳🇨",code:"NC"},{name:"New Zealand",dial_code:"+64",emoji:"🇳🇿",code:"NZ"},{name:"Nicaragua",dial_code:"+505",emoji:"🇳🇮",code:"NI"},{name:"Niger",dial_code:"+227",emoji:"🇳🇪",code:"NE"},{name:"Nigeria",dial_code:"+234",emoji:"🇳🇬",code:"NG"},{name:"Niue",dial_code:"+683",emoji:"🇳🇺",code:"NU"},{name:"Norfolk Island",dial_code:"+672",emoji:"🇳🇫",code:"NF"},{name:"Northern Mariana Islands",dial_code:"+1670",emoji:"🇲🇵",code:"MP"},{name:"Norway",dial_code:"+47",emoji:"🇳🇴",code:"NO"},{name:"Oman",dial_code:"+968",emoji:"🇴🇲",code:"OM"},{name:"Pakistan",dial_code:"+92",emoji:"🇵🇰",code:"PK"},{name:"Palau",dial_code:"+680",emoji:"🇵🇼",code:"PW"},{name:"Palestinian Territory, Occupied",dial_code:"+970",emoji:"🇵🇸",code:"PS"},{name:"Panama",dial_code:"+507",emoji:"🇵🇦",code:"PA"},{name:"Papua New Guinea",dial_code:"+675",emoji:"🇵🇬",code:"PG"},{name:"Paraguay",dial_code:"+595",emoji:"🇵🇾",code:"PY"},{name:"Peru",dial_code:"+51",emoji:"🇵🇪",code:"PE"},{name:"Philippines",dial_code:"+63",emoji:"🇵🇭",code:"PH"},{name:"Pitcairn",dial_code:"+872",emoji:"🇵🇳",code:"PN"},{name:"Poland",dial_code:"+48",emoji:"🇵🇱",code:"PL"},{name:"Portugal",dial_code:"+351",emoji:"🇵🇹",code:"PT"},{name:"Puerto Rico",dial_code:"+1939",emoji:"🇵🇷",code:"PR"},{name:"Qatar",dial_code:"+974",emoji:"🇶🇦",code:"QA"},{name:"Romania",dial_code:"+40",emoji:"🇷🇴",code:"RO"},{name:"Russia",dial_code:"+7",emoji:"🇷🇺",code:"RU"},{name:"Rwanda",dial_code:"+250",emoji:"🇷🇼",code:"RW"},{name:"Reunion",dial_code:"+262",emoji:"🇷🇪",code:"RE"},{name:"Saint Barthelemy",dial_code:"+590",emoji:"🇧🇱",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dial_code:"+290",emoji:"🇸🇭",code:"SH"},{name:"Saint Kitts and Nevis",dial_code:"+1869",emoji:"🇰🇳",code:"KN"},{name:"Saint Lucia",dial_code:"+1758",emoji:"🇱🇨",code:"LC"},{name:"Saint Martin",dial_code:"+590",emoji:"🇲🇫",code:"MF"},{name:"Saint Pierre and Miquelon",dial_code:"+508",emoji:"🇵🇲",code:"PM"},{name:"Saint Vincent and the Grenadines",dial_code:"+1784",emoji:"🇻🇨",code:"VC"},{name:"Samoa",dial_code:"+685",emoji:"🇼🇸",code:"WS"},{name:"San Marino",dial_code:"+378",emoji:"🇸🇲",code:"SM"},{name:"Sao Tome and Principe",dial_code:"+239",emoji:"🇸🇹",code:"ST"},{name:"Saudi Arabia",dial_code:"+966",emoji:"🇸🇦",code:"SA"},{name:"Senegal",dial_code:"+221",emoji:"🇸🇳",code:"SN"},{name:"Serbia",dial_code:"+381",emoji:"🇷🇸",code:"RS"},{name:"Seychelles",dial_code:"+248",emoji:"🇸🇨",code:"SC"},{name:"Sierra Leone",dial_code:"+232",emoji:"🇸🇱",code:"SL"},{name:"Singapore",dial_code:"+65",emoji:"🇸🇬",code:"SG"},{name:"Slovakia",dial_code:"+421",emoji:"🇸🇰",code:"SK"},{name:"Slovenia",dial_code:"+386",emoji:"🇸🇮",code:"SI"},{name:"Solomon Islands",dial_code:"+677",emoji:"🇸🇧",code:"SB"},{name:"Somalia",dial_code:"+252",emoji:"🇸🇴",code:"SO"},{name:"South Africa",dial_code:"+27",emoji:"🇿🇦",code:"ZA"},{name:"South Sudan",dial_code:"+211",emoji:"🇸🇸",code:"SS"},{name:"South Georgia and the South Sandwich Islands",dial_code:"+500",emoji:"🇬🇸",code:"GS"},{name:"Spain",dial_code:"+34",emoji:"🇪🇸",code:"ES"},{name:"Sri Lanka",dial_code:"+94",emoji:"🇱🇰",code:"LK"},{name:"Sudan",dial_code:"+249",emoji:"🇸🇩",code:"SD"},{name:"Suriname",dial_code:"+597",emoji:"🇸🇷",code:"SR"},{name:"Svalbard and Jan Mayen",dial_code:"+47",emoji:"🇸🇯",code:"SJ"},{name:"Swaziland",dial_code:"+268",emoji:"🇸🇿",code:"SZ"},{name:"Sweden",dial_code:"+46",emoji:"🇸🇪",code:"SE"},{name:"Switzerland",dial_code:"+41",emoji:"🇨🇭",code:"CH"},{name:"Syrian Arab Republic",dial_code:"+963",emoji:"🇸🇾",code:"SY"},{name:"Taiwan",dial_code:"+886",emoji:"🇹🇼",code:"TW"},{name:"Tajikistan",dial_code:"+992",emoji:"🇹🇯",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dial_code:"+255",emoji:"🇹🇿",code:"TZ"},{name:"Thailand",dial_code:"+66",emoji:"🇹🇭",code:"TH"},{name:"Timor-Leste",dial_code:"+670",emoji:"🇹🇱",code:"TL"},{name:"Togo",dial_code:"+228",emoji:"🇹🇬",code:"TG"},{name:"Tokelau",dial_code:"+690",emoji:"🇹🇰",code:"TK"},{name:"Tonga",dial_code:"+676",emoji:"🇹🇴",code:"TO"},{name:"Trinidad and Tobago",dial_code:"+1868",emoji:"🇹🇹",code:"TT"},{name:"Tunisia",dial_code:"+216",emoji:"🇹🇳",code:"TN"},{name:"Turkey",dial_code:"+90",emoji:"🇹🇷",code:"TR"},{name:"Turkmenistan",dial_code:"+993",emoji:"🇹🇲",code:"TM"},{name:"Turks and Caicos Islands",dial_code:"+1649",emoji:"🇹🇨",code:"TC"},{name:"Tuvalu",dial_code:"+688",emoji:"🇹🇻",code:"TV"},{name:"Uganda",dial_code:"+256",emoji:"🇺🇬",code:"UG"},{name:"Ukraine",dial_code:"+380",emoji:"🇺🇦",code:"UA"},{name:"United Arab Emirates",dial_code:"+971",emoji:"🇦🇪",code:"AE"},{name:"United Kingdom",dial_code:"+44",emoji:"🇬🇧",code:"GB"},{name:"United States",dial_code:"+1",emoji:"🇺🇸",code:"US"},{name:"Uruguay",dial_code:"+598",emoji:"🇺🇾",code:"UY"},{name:"Uzbekistan",dial_code:"+998",emoji:"🇺🇿",code:"UZ"},{name:"Vanuatu",dial_code:"+678",emoji:"🇻🇺",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dial_code:"+58",emoji:"🇻🇪",code:"VE"},{name:"Vietnam",dial_code:"+84",emoji:"🇻🇳",code:"VN"},{name:"Virgin Islands, British",dial_code:"+1284",emoji:"🇻🇬",code:"VG"},{name:"Virgin Islands, U.S.",dial_code:"+1340",emoji:"🇻🇮",code:"VI"},{name:"Wallis and Futuna",dial_code:"+681",emoji:"🇼🇫",code:"WF"},{name:"Yemen",dial_code:"+967",emoji:"🇾🇪",code:"YE"},{name:"Zambia",dial_code:"+260",emoji:"🇿🇲",code:"ZM"},{name:"Zimbabwe",dial_code:"+263",emoji:"🇿🇼",code:"ZW"}],xn=({placeholder:e})=>{const[o,t]=u.useState(ht),[n,i]=u.useState(e??ht[0].name),[a,l]=u.useState(!0),[d,s]=u.useState(!1),[g,p]=u.useState(!1);return{hide:a,setHide:l,newOptions:o,setNewOptions:t,isHovered:g,setIsHovered:p,isFocused:d,setIsFocused:s,value:n,setValue:i}},tr={xs:8,sm:10,md:12,lg:14,xl:16},Ks=({size:e,...o})=>r.jsx(c.Element,{as:"ul",...o}),Qs=e=>r.jsx(c.Input,{type:"country",...e}),Zs=({size:e,...o})=>r.jsx(c.Element,{as:"li",...o}),Js=({option:e,size:o="md",callback:t=()=>{},views:n={text:{}}})=>{const i=a=>{a&&a.stopPropagation&&a.stopPropagation(),t(e)};return r.jsx(Zs,{margin:0,role:"DropDownItem",listStyleType:"none",fontWeight:"normal",paddingVertical:6,paddingHorizontal:12,onClick:i,fontSize:c.Typography.fontSizes[o],_hover:{opacity:.8},...n.text,children:e})},ed=({size:e,views:o={dropDown:{}},options:t=[],callback:n=()=>{}})=>{const i=a=>n(a);return r.jsx(Ks,{role:"dropDown",margin:0,padding:0,top:"100%",width:"100%",display:"flex",zIndex:1e3,overflow:"auto",maxHeight:"300px",borderRadius:4,position:"absolute",flexDirection:"column",backgroundColor:"color-white",boxShadow:"rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px",...o.dropDown,children:t.map(a=>r.jsx(Js,{size:e,option:a.name,callback:i,...o.text},a.code))})},bn=({id:e,name:o,label:t,value:n,placeholder:i,helperText:a,hide:l=!1,error:d=!1,isHovered:s=!1,isFocused:g=!1,isAutoFocus:p=!1,isDisabled:m=!1,isReadOnly:h=!1,shadow:f={},newOptions:x=[],size:y="md",variant:b="default",shape:k="default",onChange:S,onBlur:w=()=>{},setHide:j=()=>{},setNewOptions:C=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setValue:R=()=>{},views:V={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:_,...T})=>{const{getColor:W,themeMode:B}=c.useTheme(),P=W("color-blueGray-700",{themeMode:_||B}),z=()=>M(!0),$=D=>{j(!l),R(D),S&&S(D)},E=()=>{!m&&!h&&j(!l)},H=D=>{const q=D.target.value,K=ht.filter(Y=>Y.name.toLowerCase().startsWith(q.toLowerCase()));l&&j(!1),C(K),S&&S(q)},L=D=>{w(D),M(!1)},A=!!(t&&(g||n)),F={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[y],backgroundColor:"transparent",color:m?"color-trueGray-600":"color-blueGray-700",cursor:m?"not-allowed":h?"auto":"pointer",...V.field};return r.jsxs(we,{helperText:a,error:d,views:V,onClick:E,children:[r.jsxs(Ve,{label:t,size:y,error:d,shape:k,views:V,shadow:f,variant:b,value:n,color:"theme-primary",isDisabled:m,isReadOnly:h,isFocused:g,showLabel:A,_hover:!m&&!d?{borderColor:"theme-primary"}:void 0,children:[r.jsxs(Qe,{children:[A&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...V,children:t}),r.jsx(Qs,{id:e,name:o,placeholder:i,readOnly:h,disabled:m,autoFocus:p,onBlur:L,onFocus:z,...F,...T,value:n,onChange:H})]}),r.jsx(Bt,{children:l?r.jsx(ae,{orientation:"down",widthHeight:tr[y],color:P,style:V.icon}):r.jsx(ae,{orientation:"up",widthHeight:tr[y],color:P,style:V.icon})})]}),!l&&r.jsx(ed,{size:y,views:V,options:x,callback:$})]})},od=e=>{const o=xn(e);return r.jsx(bn,{...o,...e})},td=od;function Bo(e){"@babel/helpers - typeof";return Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Bo(e)}function ge(e,o){if(o.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+o.length+" present")}function rd(e){return ge(1,arguments),e instanceof Date||Bo(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function je(e){ge(1,arguments);var o=Object.prototype.toString.call(e);return e instanceof Date||Bo(e)==="object"&&o==="[object Date]"?new Date(e.getTime()):typeof e=="number"||o==="[object Number]"?new Date(e):((typeof e=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function nd(e){if(ge(1,arguments),!rd(e)&&typeof e!="number")return!1;var o=je(e);return!isNaN(Number(o))}function $e(e){if(e===null||e===!0||e===!1)return NaN;var o=Number(e);return isNaN(o)?o:o<0?Math.ceil(o):Math.floor(o)}function ad(e,o){ge(2,arguments);var t=je(e).getTime(),n=$e(o);return new Date(t+n)}function id(e,o){ge(2,arguments);var t=$e(o);return ad(e,-t)}var ld=864e5;function cd(e){ge(1,arguments);var o=je(e),t=o.getTime();o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0);var n=o.getTime(),i=t-n;return Math.floor(i/ld)+1}function Lo(e){ge(1,arguments);var o=1,t=je(e),n=t.getUTCDay(),i=(n<o?7:0)+n-o;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}function yn(e){ge(1,arguments);var o=je(e),t=o.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var i=Lo(n),a=new Date(0);a.setUTCFullYear(t,0,4),a.setUTCHours(0,0,0,0);var l=Lo(a);return o.getTime()>=i.getTime()?t+1:o.getTime()>=l.getTime()?t:t-1}function sd(e){ge(1,arguments);var o=yn(e),t=new Date(0);t.setUTCFullYear(o,0,4),t.setUTCHours(0,0,0,0);var n=Lo(t);return n}var dd=6048e5;function ud(e){ge(1,arguments);var o=je(e),t=Lo(o).getTime()-sd(o).getTime();return Math.round(t/dd)+1}var gd={};function Qo(){return gd}function Ao(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=Qo(),m=$e((t=(n=(i=(a=o==null?void 0:o.weekStartsOn)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&i!==void 0?i:p.weekStartsOn)!==null&&n!==void 0?n:(s=p.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.weekStartsOn)!==null&&t!==void 0?t:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=je(e),f=h.getUTCDay(),x=(f<m?7:0)+f-m;return h.setUTCDate(h.getUTCDate()-x),h.setUTCHours(0,0,0,0),h}function kn(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=je(e),m=p.getUTCFullYear(),h=Qo(),f=$e((t=(n=(i=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:h.firstWeekContainsDate)!==null&&n!==void 0?n:(s=h.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(m+1,0,f),x.setUTCHours(0,0,0,0);var y=Ao(x,o),b=new Date(0);b.setUTCFullYear(m,0,f),b.setUTCHours(0,0,0,0);var k=Ao(b,o);return p.getTime()>=y.getTime()?m+1:p.getTime()>=k.getTime()?m:m-1}function pd(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=Qo(),m=$e((t=(n=(i=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&n!==void 0?n:(s=p.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=kn(e,o),f=new Date(0);f.setUTCFullYear(h,0,m),f.setUTCHours(0,0,0,0);var x=Ao(f,o);return x}var md=6048e5;function hd(e,o){ge(1,arguments);var t=je(e),n=Ao(t,o).getTime()-pd(t,o).getTime();return Math.round(n/md)+1}function te(e,o){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length<o;)n="0"+n;return t+n}var Te={y:function(o,t){var n=o.getUTCFullYear(),i=n>0?n:1-n;return te(t==="yy"?i%100:i,t.length)},M:function(o,t){var n=o.getUTCMonth();return t==="M"?String(n+1):te(n+1,2)},d:function(o,t){return te(o.getUTCDate(),t.length)},a:function(o,t){var n=o.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(o,t){return te(o.getUTCHours()%12||12,t.length)},H:function(o,t){return te(o.getUTCHours(),t.length)},m:function(o,t){return te(o.getUTCMinutes(),t.length)},s:function(o,t){return te(o.getUTCSeconds(),t.length)},S:function(o,t){var n=t.length,i=o.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return te(a,t.length)}},De={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fd={G:function(o,t,n){var i=o.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(o,t,n){if(t==="yo"){var i=o.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Te.y(o,t)},Y:function(o,t,n,i){var a=kn(o,i),l=a>0?a:1-a;if(t==="YY"){var d=l%100;return te(d,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):te(l,t.length)},R:function(o,t){var n=yn(o);return te(n,t.length)},u:function(o,t){var n=o.getUTCFullYear();return te(n,t.length)},Q:function(o,t,n){var i=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return te(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(o,t,n){var i=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return te(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(o,t,n){var i=o.getUTCMonth();switch(t){case"M":case"MM":return Te.M(o,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(o,t,n){var i=o.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return te(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(o,t,n,i){var a=hd(o,i);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):te(a,t.length)},I:function(o,t,n){var i=ud(o);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):te(i,t.length)},d:function(o,t,n){return t==="do"?n.ordinalNumber(o.getUTCDate(),{unit:"date"}):Te.d(o,t)},D:function(o,t,n){var i=cd(o);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):te(i,t.length)},E:function(o,t,n){var i=o.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(o,t,n,i){var a=o.getUTCDay(),l=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return te(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(o,t,n,i){var a=o.getUTCDay(),l=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return te(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(o,t,n){var i=o.getUTCDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return te(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(o,t,n){var i=o.getUTCHours(),a=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(o,t,n){var i=o.getUTCHours(),a;switch(i===12?a=De.noon:i===0?a=De.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(o,t,n){var i=o.getUTCHours(),a;switch(i>=17?a=De.evening:i>=12?a=De.afternoon:i>=4?a=De.morning:a=De.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(o,t,n){if(t==="ho"){var i=o.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Te.h(o,t)},H:function(o,t,n){return t==="Ho"?n.ordinalNumber(o.getUTCHours(),{unit:"hour"}):Te.H(o,t)},K:function(o,t,n){var i=o.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):te(i,t.length)},k:function(o,t,n){var i=o.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):te(i,t.length)},m:function(o,t,n){return t==="mo"?n.ordinalNumber(o.getUTCMinutes(),{unit:"minute"}):Te.m(o,t)},s:function(o,t,n){return t==="so"?n.ordinalNumber(o.getUTCSeconds(),{unit:"second"}):Te.s(o,t)},S:function(o,t){return Te.S(o,t)},X:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();if(l===0)return"Z";switch(t){case"X":return nr(l);case"XXXX":case"XX":return We(l);case"XXXXX":case"XXX":default:return We(l,":")}},x:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"x":return nr(l);case"xxxx":case"xx":return We(l);case"xxxxx":case"xxx":default:return We(l,":")}},O:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rr(l,":");case"OOOO":default:return"GMT"+We(l,":")}},z:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rr(l,":");case"zzzz":default:return"GMT"+We(l,":")}},t:function(o,t,n,i){var a=i._originalDate||o,l=Math.floor(a.getTime()/1e3);return te(l,t.length)},T:function(o,t,n,i){var a=i._originalDate||o,l=a.getTime();return te(l,t.length)}};function rr(e,o){var t=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return t+String(i);var l=o;return t+String(i)+l+te(a,2)}function nr(e,o){if(e%60===0){var t=e>0?"-":"+";return t+te(Math.abs(e)/60,2)}return We(e,o)}function We(e,o){var t=o||"",n=e>0?"-":"+",i=Math.abs(e),a=te(Math.floor(i/60),2),l=te(i%60,2);return n+a+t+l}var ar=function(o,t){switch(o){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},jn=function(o,t){switch(o){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},xd=function(o,t){var n=o.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return ar(o,t);var l;switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",ar(i,t)).replace("{{time}}",jn(a,t))},bd={p:jn,P:xd};function yd(e){var o=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return o.setUTCFullYear(e.getFullYear()),e.getTime()-o.getTime()}var kd=["D","DD"],jd=["YY","YYYY"];function Cd(e){return kd.indexOf(e)!==-1}function Sd(e){return jd.indexOf(e)!==-1}function ir(e,o,t){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(o,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(o,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(o,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(o,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var wd={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Id=function(o,t,n){var i,a=wd[o];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function at(e){return function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=o.width?String(o.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var Td={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Md={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rd={date:at({formats:Td,defaultWidth:"full"}),time:at({formats:Md,defaultWidth:"full"}),dateTime:at({formats:zd,defaultWidth:"full"})},Vd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ed=function(o,t,n,i){return Vd[o]};function no(e){return function(o,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,l=t!=null&&t.width?String(t.width):a;i=e.formattingValues[l]||e.formattingValues[a]}else{var d=e.defaultWidth,s=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[s]||e.values[d]}var g=e.argumentCallback?e.argumentCallback(o):o;return i[g]}}var Pd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},_d={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$d={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Hd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Bd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ld=function(o,t){var n=Number(o),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Ad={ordinalNumber:Ld,era:no({values:Pd,defaultWidth:"wide"}),quarter:no({values:Wd,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:no({values:_d,defaultWidth:"wide"}),day:no({values:$d,defaultWidth:"wide"}),dayPeriod:no({values:Hd,defaultWidth:"wide",formattingValues:Bd,defaultFormattingWidth:"wide"})};function ao(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=o.match(i);if(!a)return null;var l=a[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(d)?Fd(d,function(m){return m.test(l)}):Dd(d,function(m){return m.test(l)}),g;g=e.valueCallback?e.valueCallback(s):s,g=t.valueCallback?t.valueCallback(g):g;var p=o.slice(l.length);return{value:g,rest:p}}}function Dd(e,o){for(var t in e)if(e.hasOwnProperty(t)&&o(e[t]))return t}function Fd(e,o){for(var t=0;t<e.length;t++)if(o(e[t]))return t}function Od(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=o.match(e.matchPattern);if(!n)return null;var i=n[0],a=o.match(e.parsePattern);if(!a)return null;var l=e.valueCallback?e.valueCallback(a[0]):a[0];l=t.valueCallback?t.valueCallback(l):l;var d=o.slice(i.length);return{value:l,rest:d}}}var qd=/^(\d+)(th|st|nd|rd)?/i,Nd=/\d+/i,Ud={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Gd={any:[/^b/i,/^(a|c)/i]},Yd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vd={any:[/1/i,/2/i,/3/i,/4/i]},Xd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Kd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Qd={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Zd={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Jd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},eu={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ou={ordinalNumber:Od({matchPattern:qd,parsePattern:Nd,valueCallback:function(o){return parseInt(o,10)}}),era:ao({matchPatterns:Ud,defaultMatchWidth:"wide",parsePatterns:Gd,defaultParseWidth:"any"}),quarter:ao({matchPatterns:Yd,defaultMatchWidth:"wide",parsePatterns:vd,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:ao({matchPatterns:Xd,defaultMatchWidth:"wide",parsePatterns:Kd,defaultParseWidth:"any"}),day:ao({matchPatterns:Qd,defaultMatchWidth:"wide",parsePatterns:Zd,defaultParseWidth:"any"}),dayPeriod:ao({matchPatterns:Jd,defaultMatchWidth:"any",parsePatterns:eu,defaultParseWidth:"any"})},tu={code:"en-US",formatDistance:Id,formatLong:Rd,formatRelative:Ed,localize:Ad,match:ou,options:{weekStartsOn:0,firstWeekContainsDate:1}},ru=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nu=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,au=/^'([^]*?)'?$/,iu=/''/g,lu=/[a-zA-Z]/;function cu(e,o,t){var n,i,a,l,d,s,g,p,m,h,f,x,y,b;ge(2,arguments);var k=String(o),S=Qo(),w=(n=(i=void 0)!==null&&i!==void 0?i:S.locale)!==null&&n!==void 0?n:tu,j=$e((a=(l=(d=(s=void 0)!==null&&s!==void 0?s:void 0)!==null&&d!==void 0?d:S.firstWeekContainsDate)!==null&&l!==void 0?l:(g=S.locale)===null||g===void 0||(p=g.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(j>=1&&j<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var C=$e((m=(h=(f=(x=void 0)!==null&&x!==void 0?x:void 0)!==null&&f!==void 0?f:S.weekStartsOn)!==null&&h!==void 0?h:(y=S.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&m!==void 0?m:0);if(!(C>=0&&C<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!w.localize)throw new RangeError("locale must contain localize property");if(!w.formatLong)throw new RangeError("locale must contain formatLong property");var I=je(e);if(!nd(I))throw new RangeError("Invalid time value");var M=yd(I),R=id(I,M),V={firstWeekContainsDate:j,weekStartsOn:C,locale:w,_originalDate:I},_=k.match(nu).map(function(T){var W=T[0];if(W==="p"||W==="P"){var B=bd[W];return B(T,w.formatLong)}return T}).join("").match(ru).map(function(T){if(T==="''")return"'";var W=T[0];if(W==="'")return su(T);var B=fd[W];if(B)return Sd(T)&&ir(T,o,String(e)),Cd(T)&&ir(T,o,String(e)),B(R,T,w.localize,V);if(W.match(lu))throw new RangeError("Format string contains an unescaped latin alphabet character `"+W+"`");return T}).join("");return _}function su(e){var o=e.match(au);return o?o[1].replace(iu,"'"):e}const Cn=()=>{const[e,o]=u.useState(!1),[t,n]=u.useState(!1),[i,a]=u.useState(cu(new Date,"yyyy-MM-dd"));return{date:i,setDate:a,isHovered:e,setIsHovered:o,isFocused:t,setIsFocused:n}},du=e=>r.jsx(c.Input,{type:"date",...e}),Sn=({id:e,icon:o,name:t,label:n,date:i,children:a,helperText:l,shadow:d={},size:s="md",variant:g="default",shape:p="default",views:m={container:{},label:{},helperText:{},text:{},field:{}},error:h=!1,isHovered:f=!1,isFocused:x=!1,isDisabled:y=!1,isReadOnly:b=!1,setDate:k=()=>{},setIsFocused:S=()=>{},setIsHovered:w=()=>{},onChange:j,onChangeText:C,...I})=>{const M=!!(x&&n),R=()=>w(!f),V=()=>S(!0),_=W=>{typeof W=="string"?(k(W),C&&C(W)):(k(W.target.value),j&&j(W.target.value))},T={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none",backgroundColor:"transparent"}},fontSize:c.Typography.fontSizes[s],backgroundColor:"transparent",color:y?"color-trueGray-600":"color-blueGray-700",cursor:y?"not-allowed":b?"auto":"pointer",...m.field};return r.jsx(we,{helperText:l,error:h,views:m,children:r.jsx(Ve,{label:n,size:s,error:h,shape:p,views:m,shadow:d,color:"theme-primary",variant:g,value:i,isHovered:f,isDisabled:y,isReadOnly:b,isFocused:x,showLabel:M,onMouseEnter:R,onMouseLeave:R,children:r.jsxs(Qe,{children:[M&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:h,...m,children:n}),r.jsx(du,{id:e,name:t,onFocus:V,disabled:y,readOnly:b,...T,...I,...C&&{onChangeText:_},onChange:_})]})})})},uu=e=>{const o=Cn();return r.jsx(Sn,{...o,...e})},gu=uu,wn=e=>{const o=Lt(e),[t,n]=u.useState(!1);return{isVisible:t,setIsVisible:n,...e,...o}},pu=({visibleIcon:e=r.jsx(zt,{widthHeight:14}),hiddenIcon:o=r.jsx(Mt,{widthHeight:14}),...t})=>{const{isVisible:n,setIsVisible:i,...a}=wn(t);return r.jsx(fo,{...a,type:n?"text":"password",isClearable:!1,right:r.jsx(c.View,{onClick:()=>{t.isDisabled||i(!n)},children:n?e:o})})},mu=pu,In=(e,o,t)=>{const[n,i]=u.useState(e),[a,l]=u.useState(o?{value:o,label:o}:e[0]),[d,s]=u.useState([]),[g,p]=u.useState(0),[m,h]=u.useState(t??""),[f,x]=u.useState(!1);return{filteredItems:n,setFilteredItems:i,selectedItem:a,setSelectedItem:l,selectedItems:d,setSelectedItems:s,highlightedIndex:g,setHighlightedIndex:p,searchQuery:m,setSearchQuery:h,isDropdownVisible:f,setIsDropdownVisible:x}},hu={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},lr={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},initial:{opacity:0,transform:"translateY(-8px) scale(0.96)"}},fu={padding:"8px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-100",backgroundColor:"color-gray-50",borderTopLeftRadius:"10px",borderTopRightRadius:"10px"},xu={padding:"8px 10px",cursor:"pointer",borderRadius:"6px",margin:"1px 4px",transition:"background-color 0.15s ease"},bu={padding:"24px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},cr={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},yu={display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"color-gray-100",borderRadius:"4px",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},Tn=({placeholder:e,items:o,showTick:t=!0,onSelect:n,searchEnabled:i=!0,left:a,right:l,label:d,filteredItems:s,setSelectedItem:g,selectedItem:p,selectedItems:m,setSelectedItems:h,highlightedIndex:f,setHighlightedIndex:x,searchQuery:y,setSearchQuery:b,setFilteredItems:k,views:S,isDropdownVisible:w,setIsDropdownVisible:j,isMulti:C=!1,...I})=>{const{ref:M,relation:R}=c.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),V=u.useRef(null),[_,T]=u.useState(!1),[W,B]=u.useState(!1),P=()=>{var q;const L=W?lr.enter:lr.initial;if(!M.current)return{};const A=M.current.getBoundingClientRect(),F={position:"fixed",left:A.left,width:A.width,zIndex:1e4,...L};return((q=R==null?void 0:R.space)==null?void 0:q.vertical)==="top"?{...F,bottom:window.innerHeight-A.top+6}:{...F,top:A.bottom+6}};u.useEffect(()=>{if(w){const L=setTimeout(()=>B(!0),10);return()=>clearTimeout(L)}B(!1)},[w]),u.useEffect(()=>{const L=A=>{!A.composedPath().some(q=>(q==null?void 0:q.id)==="combobox-dropdown")&&M.current&&!M.current.contains(A.target)&&j(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);const z=L=>{if(b(L),L==="")k(o);else{const A=o.filter(F=>F.label.toLowerCase().includes(L.toLowerCase()));k(A)}x(0)},$=L=>{if(C){const A=m.some(D=>D.value===L.value);let F;A?F=m.filter(D=>D.value!==L.value):F=[...m,L],h(F),n==null||n(F)}else g(L),n==null||n(L),j(!1)},E=(L,A)=>{L.stopPropagation();const F=m.filter(D=>D.value!==A.value);h(F),n==null||n(F)},H=L=>C?m.some(A=>A.value===L.value):L.value===p.value;return r.jsxs(c.Horizontal,{role:"combobox",flexWrap:"nowrap",gap:15,alignItems:"center",width:"100%",...I,children:[d&&r.jsx(c.Text,{views:S==null?void 0:S.label,htmlFor:I.id,children:d}),r.jsxs(c.View,{position:"relative",width:"100%",children:[r.jsx("div",{ref:M,onClick:()=>j(!w),style:{width:"100%"},children:r.jsxs(Ve,{isHovered:_,isFocused:w,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),cursor:"pointer",views:{container:S==null?void 0:S.container},children:[r.jsxs(c.Horizontal,{gap:10,alignItems:"center",width:"100%",flexWrap:C?"wrap":"nowrap",...S==null?void 0:S.labelContainer,children:[a,C?m.length>0?r.jsx(c.Horizontal,{gap:6,flexWrap:"wrap",alignItems:"center",children:m.map(L=>r.jsxs(c.Horizontal,{...yu,_hover:{backgroundColor:"color-gray-200"},children:[L.icon&&r.jsx(c.View,{flexShrink:0,children:L.icon}),r.jsx(c.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:L.label}),r.jsx(fe,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:A=>E(A,L)})]},L.value))}):r.jsx(c.Text,{weight:"medium",flexGrow:1,color:"color-gray-500",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...S==null?void 0:S.label,children:e}):r.jsxs(r.Fragment,{children:[p.icon&&p.label!==e&&r.jsx(c.View,{children:p.icon}),r.jsx(c.Text,{weight:"medium",flexGrow:1,color:p.label===e?"color-gray-500":"color-gray-800",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...S==null?void 0:S.label,children:p.label})]})]}),r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[l,r.jsx(c.View,{style:w?cr.open:cr.closed,children:r.jsx(ae,{widthHeight:16,orientation:"down",color:w?"color-gray-700":"color-gray-400"})})]})]})}),w&&r.jsx(on,{children:r.jsxs(c.View,{ref:V,id:"combobox-dropdown",role:"listbox","aria-labelledby":I.id,...hu,style:P(),...S==null?void 0:S.dropdown,children:[i&&r.jsx(c.View,{...fu,children:r.jsx(fo,{id:`${I.id}-search`,name:`${I.name}-search`,width:"100%",type:"search",autoFocus:!0,value:y,onChange:L=>z(L),hint:e||"Search...",isClearable:!1,left:r.jsx(Po,{widthHeight:14,color:"color-gray-400"}),views:{container:{width:"100%",padding:"0",backgroundColor:"transparent",borderColor:"color-gray-200",...S==null?void 0:S.text},field:{fontSize:"13px"}}})}),s.length>0&&r.jsx(c.View,{margin:0,padding:"4px",children:s.map((L,A)=>{const F=H(L),D=A===f;return r.jsxs(c.Horizontal,{role:"option","aria-selected":F,justifyContent:"space-between",alignItems:"center",...xu,backgroundColor:F&&D?"rgba(59, 130, 246, 0.12)":F?"rgba(59, 130, 246, 0.08)":D?"color-gray-100":"transparent",onMouseEnter:()=>x(A),onClick:()=>$(L),...S==null?void 0:S.item,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[L.icon&&r.jsx(c.View,{flexShrink:0,children:L.icon}),r.jsx(c.Text,{size:"sm",color:F?"theme-primary":"color-gray-800",weight:F?"medium":"normal",children:L.label})]}),F&&t&&r.jsx(No,{widthHeight:16,color:"theme-primary"})]},L.value)})}),s.length===0&&r.jsxs(c.Vertical,{...bu,children:[r.jsx(Po,{widthHeight:24,color:"color-gray-300"}),r.jsx(c.Text,{color:"color-gray-500",size:"sm",align:"center",children:"No results found"}),r.jsx(c.Text,{color:"color-gray-400",size:"xs",align:"center",children:"Try a different search term"})]})]})})]})]})},ku=({id:e,name:o,items:t,placeholder:n,searchPlaceholder:i,...a})=>{const l=In(t,n,i);return r.jsx(Tn,{id:e,name:o,items:t,...l,...a})},ju=ku,Mn=e=>{const{tags:o,defaultTags:t=[],onTagsChange:n,onTagAdd:i,onTagRemove:a,maxTags:l,minTagLength:d=1,maxTagLength:s=50,allowDuplicates:g=!1,separators:p=["enter","comma"],isDisabled:m=!1,isReadOnly:h=!1}=e,[f,x]=u.useState(""),[y,b]=u.useState(()=>(o||t||[]).map((P,z)=>({id:`tag-${z}-${Date.now()}`,value:P}))),[k,S]=u.useState(!1),[w,j]=u.useState(!1),C=o&&Array.isArray(o)?o.map((B,P)=>({id:`tag-${P}-${Date.now()}`,value:B})):y;u.useEffect(()=>{o&&Array.isArray(o)&&b(o.map((B,P)=>({id:`tag-${P}-${Date.now()}`,value:B})))},[o]);const I=u.useCallback(B=>{const P=B.trim();return!(P.length<d||P.length>s||!g&&C.map($=>$.value.toLowerCase()).includes(P.toLowerCase())||l&&C.length>=l)},[C,d,s,g,l]),M=u.useCallback(B=>{if(m||h)return;const P=B.trim();if(!P||!I(P))return;const z={id:`tag-${Date.now()}-${Math.random()}`,value:P},$=[...C,z],E=$.map(H=>H.value);o||b($),n==null||n(E),i==null||i(P),x("")},[C,I,n,i,m,h,o]),R=u.useCallback(B=>{if(m||h)return;const P=C[B];if(!P)return;const z=C.filter((E,H)=>H!==B),$=z.map(E=>E.value);o||b(z),n==null||n($),a==null||a(P.value,B)},[C,n,a,m,h,o]),V=u.useCallback(B=>{if(m||h)return;const P=B.target.value;if(p.includes("comma")&&P.includes(",")){const z=P.split(","),$=z[0],E=z.slice(1).join(",");$.trim()&&M($),x(E);return}x(P)},[M,p,m,h]),_=u.useCallback(B=>{if(m||h)return;const{key:P}=B;if(p.includes("enter")&&P==="Enter"){B.preventDefault(),f.trim()&&M(f);return}if(p.includes("tab")&&P==="Tab"&&f.trim()){B.preventDefault(),M(f);return}if(p.includes("space")&&P===" "&&f.trim()){B.preventDefault(),M(f);return}if(P==="Backspace"&&!f&&C.length>0){B.preventDefault(),R(C.length-1);return}},[M,R,f,C,p,m,h]),T=u.useCallback(()=>{var B;S(!0),(B=e.onFocus)==null||B.call(e)},[e.onFocus]),W=u.useCallback(()=>{var B;S(!1),f.trim()&&M(f),(B=e.onBlur)==null||B.call(e)},[M,f,e.onBlur]);return{inputValue:f,setInputValue:x,tags:C,setTags:b,isFocused:k,setIsFocused:S,isHovered:w,setIsHovered:j,addTag:M,removeTag:R,handleInputChange:V,handleKeyDown:_,handleFocus:T,handleBlur:W,validateTag:I}},Cu=({tag:e,onRemove:o,isRemovable:t,size:n,views:i,isDisabled:a,isReadOnly:l})=>{const[d,s]=u.useState(!1),g={xs:{padding:"2px 8px",fontSize:"10px",iconSize:10},sm:{padding:"4px 10px",fontSize:"12px",iconSize:12},md:{padding:"6px 14px",fontSize:"14px",iconSize:14},lg:{padding:"8px 16px",fontSize:"16px",iconSize:16},xl:{padding:"10px 18px",fontSize:"18px",iconSize:18}}[n]||{padding:"6px 14px",fontSize:"14px",iconSize:14};return r.jsxs(c.Horizontal,{alignItems:"center",gap:6,padding:g.padding,backgroundColor:"color-gray-100-100",borderRadius:"16px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-100",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",opacity:a?.6:1,_hover:!a&&!l?{backgroundColor:"color-gray-100-200",borderColor:"color-gray-200",boxShadow:"0 4px 6px rgba(0,0,0,0.05)",transform:"translateY(-1px)"}:{},...i==null?void 0:i.tag,children:[r.jsx(c.Text,{fontSize:g.fontSize,color:a?"color-gray-100":"theme-primary",whiteSpace:"nowrap",...i==null?void 0:i.tagText,children:e}),t&&!a&&!l&&r.jsx(c.View,{cursor:"pointer",padding:"2px",borderRadius:"50%",transition:"all 0.2s ease",backgroundColor:d?"color-red-100":"transparent",opacity:d?1:.7,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:p=>{p.stopPropagation(),o()},_hover:{backgroundColor:"color-red-50"},...i==null?void 0:i.tagRemove,children:r.jsx(fe,{widthHeight:g.iconSize,color:d?"color-red-500":"color-gray-400"})})]})},zn=({id:e,name:o,label:t,placeholder:n="Type and press Enter to add tags...",helperText:i,error:a=!1,inputValue:l="",tags:d=[],left:s,right:g,shadow:p={},views:m={},size:h="md",shape:f="default",variant:x="default",isDisabled:y=!1,isReadOnly:b=!1,isAutoFocus:k=!1,isRemovable:S=!0,isFocused:w=!1,isHovered:j=!1,maxTags:C,handleInputChange:I,handleKeyDown:M,handleFocus:R,handleBlur:V,removeTag:_,setIsHovered:T,onClick:W,...B})=>{const{getColor:P,themeMode:z}=c.useTheme(),$=!!(t&&(w||d.length>0||l)),E=C&&d.length>=C,H={...tn[f],...rn[x],...m==null?void 0:m.inputContainer},L={border:"none",outline:"none",backgroundColor:"transparent",fontSize:c.Typography.fontSizes[h],color:y?"color-gray-400":"color-gray-800",flex:1,minWidth:"120px",...m==null?void 0:m.input};return r.jsx(we,{error:!!a,helperText:typeof a=="string"?a:i,views:m,...B,children:r.jsxs(Ve,{label:t,shadow:p,value:d.length>0||l?"has-content":"",size:h,shape:f,variant:x,error:!!a,showLabel:$,isFocused:w,isHovered:j,isDisabled:y,isReadOnly:b,views:m,onClick:W,onMouseEnter:()=>T==null?void 0:T(!0),onMouseLeave:()=>T==null?void 0:T(!1),...H,children:[s,r.jsxs(Qe,{children:[t&&r.jsx(He,{size:h,error:!!a,views:m,children:t}),r.jsxs(c.Horizontal,{alignItems:"center",gap:8,flexWrap:"wrap",width:"100%",minHeight:c.Typography.fontSizes[h],padding:"8px 0",...m==null?void 0:m.tagsContainer,children:[d.map((A,F)=>r.jsx(Cu,{tag:A.value,onRemove:()=>_==null?void 0:_(F),isRemovable:S,size:h,views:m,isDisabled:y,isReadOnly:b},A.id)),!E&&r.jsx(c.Input,{id:e,name:o,type:"text",value:l,placeholder:d.length===0?n:"",disabled:y,readOnly:b,autoFocus:k,onChange:I,onKeyDown:M,onFocus:R,onBlur:V,autoComplete:"off",...L}),E&&r.jsxs(c.Text,{fontSize:c.Typography.fontSizes[h],color:"color-gray-500",fontStyle:"italic",...m==null?void 0:m.placeholder,children:["Maximum ",C," tags reached"]})]})]}),g]})})},Su=e=>{const o=Mn(e),{tags:t,...n}=e;return r.jsx(zn,{...o,...n})},wu=Su;function Iu(e){const o=setTimeout(e,0),t=setTimeout(e,10),n=setTimeout(e,50);return[o,t,n]}const Rn=({value:e,defaultValue:o="",length:t=6,onChange:n,onChangeText:i,onComplete:a,onKeyDown:l,onKeyPress:d,onBlur:s,onFocus:g,isReadOnly:p,isDisabled:m,pattern:h,stepValues:f,pasteTransformer:x})=>{var K,Y;const y=e!==void 0,b=y?e:o,[k,S]=u.useState((b==null?void 0:b.slice(0,t))||""),[w,j]=u.useState(!1),[C,I]=u.useState(!1),[M,R]=u.useState(null),[V,_]=u.useState(null),T=u.useRef(null),W=u.useRef(null),B=u.useRef({value:k,onChange:n||(()=>{}),isIOS:typeof window<"u"&&((Y=(K=window==null?void 0:window.CSS)==null?void 0:K.supports)==null?void 0:Y.call(K,"-webkit-touch-callout","none"))}),P=u.useRef({prev:[null,null,"none"]}),z=h?typeof h=="string"?new RegExp(h):h:null;u.useEffect(()=>{y&&e!==k&&S((e==null?void 0:e.slice(0,t))||"")},[y,e,t,k]);const $=u.useCallback(O=>{let X=O;if(f&&f.length>0&&O){const Z=parseInt(O,10);if(!isNaN(Z)){let J=f[0],oe=Math.abs(Z-J);for(let re=1;re<f.length;re++){const ce=Math.abs(Z-f[re]);ce<oe&&(oe=ce,J=f[re])}X=J.toString()}}S(X),n&&n(X),i&&i(X),a&&X.length===t&&a(X)},[n,i,a,t,f]),E=u.useCallback(O=>{O&&T.current!==O&&Object.defineProperty(T,"current",{value:O,writable:!0})},[]),H=u.useCallback(O=>{const X=O.currentTarget.value.slice(0,t);if(X.length>0&&z&&!z.test(X)){O.preventDefault();return}$(X),T.current&&(T.current.value=X)},[t,z,$,T]),L=u.useCallback(()=>{var O;if(T.current){const X=Math.min(T.current.value.length,t-1),Z=T.current.value.length;(O=T.current)==null||O.setSelectionRange(X,Z),R(X),_(Z)}j(!0)},[t]),A=u.useCallback(()=>{j(!1)},[]),F=u.useCallback(O=>{l&&l(O)},[]),D=u.useCallback(O=>{d&&d(O)},[]),q=u.useCallback(O=>{const X=T.current;if(!O.clipboardData||!X)return;const Z=O.clipboardData.getData("text/plain"),J=x?x(Z):Z;O.preventDefault();const oe=X.selectionStart||0,re=X.selectionEnd||0,U=(oe!==re?k.slice(0,oe)+J+k.slice(re):k.slice(0,oe)+J+k.slice(oe)).slice(0,t);if(U.length>0&&z&&!z.test(U))return;X.value=U,$(U),S(U);const G=Math.min(U.length,t-1),ee=U.length;X.setSelectionRange(G,ee),R(G),_(ee)},[t,x,z,$,k,S]);return u.useEffect(()=>{const O=T.current,X=W.current;if(!O||!X)return;B.current.value!==O.value&&B.current.onChange&&B.current.onChange(O.value),P.current.prev=[O.selectionStart,O.selectionEnd,O.selectionDirection];function Z(){if(document.activeElement!==O){R(null),_(null);return}const re=(O==null?void 0:O.selectionStart)??null,ce=(O==null?void 0:O.selectionEnd)??null,me=(O==null?void 0:O.selectionDirection)??null,U=(O==null?void 0:O.maxLength)??0,G=(O==null?void 0:O.value)??"",ee=P.current.prev;let v=-1,Q=-1,le="none";if(G.length!==0&&re!==null&&ce!==null){const ne=re===ce,Ie=re===G.length&&G.length<U;if(ne&&!Ie){const ye=re;if(ye===0)v=0,Q=1,le="forward";else if(ye===U)v=ye-1,Q=ye,le="backward";else if(U>1&&G.length>1){let ot=0;if(ee[0]!==null&&ee[1]!==null){le=ye<ee[1]?"backward":"forward";const va=ee[0]===ee[1]&&ee[0]<U;le==="backward"&&!va&&(ot=-1)}v=ot+ye,Q=ot+ye+1}}v!==-1&&Q!==-1&&v!==Q&&T.current&&T.current.setSelectionRange(v,Q,le)}const se=v!==-1?v:re,pe=Q!==-1?Q:ce,xe=le!=="none"?le:me;R(se),_(pe),P.current.prev=[se,pe,xe]}document.addEventListener("selectionchange",Z,{capture:!0}),Z(),document.activeElement===O&&j(!0);const J=()=>{X&&X.style.setProperty("--root-height",`${O.clientHeight}px`)};J();const oe=new window.ResizeObserver(J);return oe.observe(O),()=>{document.removeEventListener("selectionchange",Z,{capture:!0}),oe.disconnect()}},[]),u.useEffect(()=>{Iu(()=>{var J,oe,re,ce;(J=T.current)==null||J.dispatchEvent(new Event("input"));const O=(oe=T.current)==null?void 0:oe.selectionStart,X=(re=T.current)==null?void 0:re.selectionEnd,Z=(ce=T.current)==null?void 0:ce.selectionDirection;O!==null&&X!==null&&O!==void 0&&X!==void 0&&(R(O),_(X),P.current.prev=[O,X,Z||"none"])})},[k,w]),{value:k,setValue:$,isFocused:w,setIsFocused:j,isHovered:C,setIsHovered:I,inputRef:T,containerRef:W,mirrorSelectionStart:M,mirrorSelectionEnd:V,setMirrorSelectionStart:R,setMirrorSelectionEnd:_,setInputRef:E,handleChange:H,handleFocus:L,handleBlur:A,handleKeyDown:F,handleKeyPress:D,handlePaste:q}},Tu=u.createContext({slots:[],isFocused:!1,isHovering:!1}),Mu=`
|
|
6
|
+
`,backgroundSize:`200% ${O}px, ${O}px 200%, 200% ${O}px, ${O}px 200%`,backgroundPosition:D,transitionProperty:"background-position",transitionDuration:`${E}s`,transitionTimingFunction:"linear",transitionDelay:Y,_hover:{backgroundPosition:q,transitionDelay:K},width:a?"fit-content":l?"100%":void 0,...m==null?void 0:m.container,...V,children:r.jsx(c.View,{as:t?"div":"button",disabled:!!(n||i),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:Math.max(0,_-3),width:"100%",height:"100%",...h,...f,...x,backgroundColor:(h==null?void 0:h.backgroundColor)||w,color:b,borderWidth:0,cursor:n?"default":"pointer",children:T})})}return r.jsx(c.Element,{ref:y,as:e==="link"&&t?"div":"button",type:e==="link"&&t?void 0:"button",disabled:!!(n||i),...f,...x,display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":l?"100%":void 0,borderRadius:so[s],boxShadow:g,transition:"background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",cursor:n?"default":"pointer",onClick:p,...h,...m==null?void 0:m.container,...V,children:T})},yc=u.memo(u.forwardRef(({variant:e="filled",size:o="md",shape:t="rounded",iconPosition:n="left",loaderPosition:i="left",backgroundColor:a,color:l,textColor:d,reversed:s=!1,isAuto:g=!0,isFilled:p,isDisabled:m,isLoading:h,isIconRounded:f,isHovered:x,icon:y,children:b,to:k,isExternal:S,shadow:w,onClick:j,views:C={},borderMovingDuration:I=2,borderMovingGradientColors:M=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:R="#705CFF",animatedStrokeTextColor:V="#333333",..._},T)=>{const{getColorHex:W}=c.useTheme();let z=W(m?"theme-disabled":h?"theme-loading":a??l??"theme-button-background");(z==="theme-button-background"||z==="theme-loading")&&(z=W(h?"color-dark-500":"theme-primary"));let E=W(d??"theme-button-text");E==="theme-button-text"&&(E=W("color-white"));const L=u.useMemo(()=>pc(z,E,s),[z,E,s])[e],A=(L==null?void 0:L.color)??E,F=r.jsx(mc,{icon:y,isLoading:h,iconPosition:n,loaderPosition:i,size:o,resolvedTextColor:A,isIconRounded:f,views:C,children:b}),D=Dr[o],q=f?Fr[o]:{};return r.jsx(bc,{variant:e,animation:_.animation,to:k,isDisabled:m,isLoading:h,isAuto:g,isFilled:p,isExternal:S,shape:t,shadow:w,onClick:j,views:C,baseStyles:L,sizeStyles:D,iconPad:q,resolvedTextColor:A,content:F,size:o,mainTone:z,borderMovingDuration:I,borderMovingGradientColors:M,animatedStrokeAccentColor:R,animatedStrokeTextColor:V,getColor:W,containerRef:T,..._})})),kc=e=>{const[o,t]=c.useHover();return r.jsx(yc,{isHovered:t,...e})},_e=kc,jc={sm:{padding:"12px"},md:{padding:"16px"},lg:{padding:"24px"}},Cc={square:0,rounded:"8px",pill:"24px"},Sc=e=>{const o=e==="dark";return{default:{backgroundColor:o?"color-gray-900":"color-white",border:"none",transition:"background-color 0.2s ease, box-shadow 0.2s ease"},outlined:{backgroundColor:o?"color-gray-900":"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:o?"color-gray-700":"color-gray-200",transition:"border-color 0.2s ease, box-shadow 0.2s ease",_hover:{borderColor:o?"color-gray-600":"color-gray-300",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.05)"}},elevated:{backgroundColor:o?"color-gray-900":"color-white",boxShadow:o?"0px 4px 12px rgba(0, 0, 0, 0.3)":"0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)",border:"none",transition:"box-shadow 0.2s ease",_hover:{boxShadow:o?"0px 8px 16px rgba(0, 0, 0, 0.4)":"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)"}}}},vo=e=>{const o=e.themeMode==="dark";return{container:{backgroundColor:o?"color-gray-900":"color-white",color:o?"color-white":"color-black",borderRadius:"8px",overflow:"hidden",transition:"all 0.2s ease"},header:{padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:o?"color-gray-800":"color-gray-100",color:"theme-primary"},content:{padding:"16px",color:o?"color-gray-300":"color-gray-600"},footer:{padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:o?"color-gray-800":"color-gray-100"}}},Or=u.createContext({}),_t=()=>u.useContext(Or),ut=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).header,s={...d,...l==null?void 0:l.header,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.header)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:8,...s,children:e})},gt=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).content,s={...d,...l==null?void 0:l.content,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.content)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:12,...s,children:e})},pt=({children:e,views:o,style:t,themeMode:n,...i})=>{var g;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).footer,s={...d,...l==null?void 0:l.footer,...i,style:{...d==null?void 0:d.style,...(g=l==null?void 0:l.footer)==null?void 0:g.style,...t}};return r.jsx(c.Vertical,{gap:8,...s,children:e})},wc=({variant:e="default",size:o="md",shape:t="rounded",children:n,header:i,footer:a,isFullWidth:l=!1,views:d,style:s,themeMode:g,...p})=>{var j,C;const m=c.useTheme(),h=vo(m),f=((j=jc[o])==null?void 0:j.padding)||"16px",x=u.useMemo(()=>({styles:{container:{...h.container,borderRadius:Cc[t],...d==null?void 0:d.container},header:{...h.header,padding:f,...d==null?void 0:d.header},content:{...h.content,padding:f,...d==null?void 0:d.content},footer:{...h.footer,padding:f,...d==null?void 0:d.footer}}}),[h,d,f,t]),y=u.Children.toArray(n).some(I=>u.isValidElement(I)&&(I.type===ut||I.type===gt||I.type===pt)),{themeMode:b}=m,S=Sc(g||b)[e],w={width:l?"100%":"auto",overflow:"hidden",...S,...x.styles.container,...p,style:{...(C=x.styles.container)==null?void 0:C.style,...s}};return r.jsx(Or.Provider,{value:x,children:r.jsx(c.View,{...w,children:y?n:r.jsxs(c.Vertical,{width:"100%",children:[i&&r.jsx(ut,{children:i}),r.jsx(gt,{children:n}),a&&r.jsx(pt,{children:a})]})})})},Ic=e=>r.jsx(wc,{...e}),Xo=Ic;Xo.Header=ut;Xo.Content=gt;Xo.Footer=pt;const Tc=({defaultActiveIndex:e=0,activeIndex:o,onChange:t,autoPlay:n=!1,autoPlayInterval:i=3e3,pauseOnHover:a=!0,infinite:l=!0,totalSlides:d,stepIndices:s})=>{const g=u.useRef(d||0),[p,m]=u.useState(d||0),h=u.useRef(new Set),f=u.useRef(0),x=u.useMemo(()=>jt("carousel-content"),[]),[y,b]=u.useState(o!==void 0?o:e),[k,S]=u.useState(!1),[w,j]=u.useState(!1),[C,I]=u.useState(0),[M,R]=u.useState(0),V=u.useRef(null);u.useEffect(()=>{o!==void 0&&b(o)},[o]);const _=u.useCallback(D=>{let q=D;l?D<0?q=p-1:D>=p&&(q=0):q=Math.max(0,Math.min(D,p-1)),s&&s.length>0&&(s.includes(q)||(q=s.reduce((Y,O)=>Math.abs(O-q)<Math.abs(Y-q)?O:Y))),o===void 0&&b(q),t&&t(q)},[o,l,t,p]),T=u.useCallback(()=>{_(y+1)},[y,_]),W=u.useCallback(()=>{_(y-1)},[y,_]);u.useEffect(()=>(n&&!k&&!w&&(V.current=setInterval(()=>{T()},i)),()=>{V.current&&clearInterval(V.current)}),[n,i,k,w,T,a]);const B=u.useCallback(()=>{a&&S(!0)},[a]),P=u.useCallback(()=>{S(!1)},[]),z=u.useCallback(D=>{j(!0),"touches"in D?(I(D.touches[0].clientX),R(D.touches[0].clientY)):(I(D.clientX),R(D.clientY))},[]),$=u.useCallback(D=>{if(!w)return;let q,K;"touches"in D?(q=D.touches[0].clientX,K=D.touches[0].clientY):(q=D.clientX,K=D.clientY);const Y=q-C,O=K-M;Math.abs(Y)>Math.abs(O)&&Math.abs(Y)>50&&(Y>0?W():T(),j(!1))},[w,C,M,T,W]),E=u.useCallback(()=>{j(!1)},[]),H=u.useCallback(()=>{const D=f.current++;h.current.add(D);const q=h.current.size;return g.current=q,m(q),D},[]),L=u.useCallback(D=>{h.current.delete(D);const q=h.current.size;if(g.current=q,m(q),q>0&&y>=q){const K=Math.max(0,q-1);o===void 0&&b(K),t&&t(K)}},[y,o,t]),A=l||y>0,F=l||y<p-1;return{activeIndex:y,totalSlides:p,goToSlide:_,nextSlide:T,prevSlide:W,canGoNext:F,canGoPrevious:A,handleMouseEnter:B,handleMouseLeave:P,handleDragStart:z,handleDragMove:$,handleDragEnd:E,registerSlide:H,unregisterSlide:L,contentId:x,infinite:l}},Mc={dot:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},line:{width:"20px",height:"4px",borderRadius:"2px",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},number:{minWidth:"24px",height:"24px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",transition:"background-color 0.3s ease"}},zc={dot:{backgroundColor:"theme-primary"},line:{backgroundColor:"theme-primary"},number:{backgroundColor:"theme-primary",color:"color-white"}},Wo={width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"color-white",color:"color-gray-800",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",boxShadow:"0 2px 5px rgba(0, 0, 0, 0.1)",zIndex:1,transition:"background-color 0.3s ease",_hover:{backgroundColor:"color-gray-100"}},mo=()=>({container:{position:"relative",overflow:"hidden"},content:{overflow:"hidden",width:"100%",height:"100%"},innerContainer:{display:"flex",transitionProperty:"transform",transitionDuration:"300ms",transitionTimingFunction:"ease-in-out",height:"100%"},item:{flex:"0 0 100%",minWidth:0,position:"relative",height:"100%"},prevButton:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)",zIndex:10,...Wo},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...Wo}}),qr=u.createContext(null),Ko=()=>{const e=u.useContext(qr);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},Nr=({children:e,isActive:o,views:t,...n})=>r.jsx(c.View,{flexShrink:0,width:"100%",height:"100%",display:o?"block":"none",...t,...n,children:e}),Ur=({views:e,children:o,...t})=>{const{goToPrevious:n,canGoPrevious:i,styles:a}=Ko(),d={...mo().prevButton,...a==null?void 0:a.prevButton,...e==null?void 0:e.prevButton};return r.jsx(_e,{"aria-label":"Previous slide",onClick:()=>n(),isDisabled:!i,...d,...t,children:o??r.jsx(ae,{orientation:"left",widthHeight:16})})},Gr=({views:e,children:o,...t})=>{const{goToNext:n,canGoNext:i,styles:a}=Ko(),d={...mo().nextButton,...a==null?void 0:a.nextButton,...e==null?void 0:e.nextButton};return r.jsx(_e,{"aria-label":"Next slide",onClick:()=>n(),isDisabled:!i,...d,...t,children:o??r.jsx(ae,{orientation:"right",widthHeight:16})})},Yr=({children:e,views:o,...t})=>{const{registerSlide:n,unregisterSlide:i,styles:a}=Ko(),l=u.useRef(null);u.useEffect(()=>{const g=n();return l.current=g,()=>{l.current!==null&&i(l.current)}},[n,i]);const s={...mo().item,...a==null?void 0:a.item,...o==null?void 0:o.item};return r.jsx(c.View,{role:"group","aria-roledescription":"slide",...s,...t,children:e})},vr=({children:e,views:o,style:t,...n})=>{const{currentIndex:i,styles:a,contentId:l}=Ko(),d=mo(),s={...d.content,...a==null?void 0:a.content,...o==null?void 0:o.content},g={...d.innerContainer,...a==null?void 0:a.innerContainer,...o==null?void 0:o.innerContainer},p=`-${i*100}%`;return r.jsx(c.View,{...s,...n,style:{...s==null?void 0:s.style,...t},id:l,"aria-live":"polite",children:r.jsx(c.View,{...g,style:{...g==null?void 0:g.style,transform:`translateX(${p})`},children:e})})},Rc=({children:e,defaultActiveIndex:o=0,activeIndex:t,onChange:n,showNavigation:i=!0,navigationPosition:a="inside",prevButton:l,nextButton:d,showIndicators:s=!0,indicatorPosition:g="bottom",indicatorVariant:p="dot",autoPlay:m=!1,autoPlayInterval:h=3e3,pauseOnHover:f=!0,infinite:x=!0,direction:y="horizontal",transitionDuration:b=300,views:k,stepIndices:S,themeMode:w,...j})=>{const C=u.useMemo(()=>u.Children.toArray(e),[e]),I=Tc({defaultActiveIndex:o,activeIndex:t,onChange:n,autoPlay:m,autoPlayInterval:h,pauseOnHover:f,infinite:x,totalSlides:C.length}),{activeIndex:M,totalSlides:R,goToSlide:V,nextSlide:_,prevSlide:T,handleMouseEnter:W,handleMouseLeave:B,handleDragStart:P,handleDragMove:z,handleDragEnd:$}=I,E=()=>{if(!i)return null;const A=l||r.jsx(c.View,{as:"button","aria-label":"Previous slide",...Wo,...k==null?void 0:k.prevButton,children:"❮"}),F=d||r.jsx(c.View,{as:"button","aria-label":"Next slide",...Wo,...k==null?void 0:k.nextButton,children:"❯"});return r.jsxs(r.Fragment,{children:[r.jsx(c.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",left:a==="inside"?"10px":"-40px",onClick:T,cursor:!x&&M===0?"not-allowed":"pointer",opacity:!x&&M===0?.5:1,children:A}),r.jsx(c.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",right:a==="inside"?"10px":"-40px",onClick:_,cursor:!x&&M===C.length-1?"not-allowed":"pointer",opacity:!x&&M===C.length-1?.5:1,children:F})]})},H=()=>s?r.jsx(c.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...g==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:C.map((A,F)=>r.jsx(c.View,{onClick:()=>V(F),cursor:"pointer",...Mc[p],...F===M?{...zc[p]}:{},...k==null?void 0:k.indicator,...F===M?k==null?void 0:k.activeIndicator:{},children:p==="number"&&F+1},F))}):null;return u.useMemo(()=>u.Children.toArray(e).some(A=>u.isValidElement(A)&&(A.type===vr||A.type===Yr||A.type===Ur||A.type===Gr)),[e])?r.jsx(qr.Provider,{value:{currentIndex:M,totalSlides:R,goToSlide:V,goToNext:_,goToPrevious:T,canGoNext:I.canGoNext,canGoPrevious:I.canGoPrevious,registerSlide:I.registerSlide,unregisterSlide:I.unregisterSlide,styles:{...mo(),...k},contentId:I.contentId,infinite:x},children:r.jsx(c.View,{role:"region","aria-roledescription":"carousel","aria-label":"Carousel",position:"relative",width:"100%",height:"100%",overflow:"hidden",...k==null?void 0:k.container,...j,children:e})}):r.jsxs(c.View,{position:"relative",width:"100%",height:"100%",overflow:"hidden",onMouseEnter:W,onMouseLeave:B,onTouchStart:P,onTouchMove:z,onTouchEnd:$,onMouseDown:P,onMouseMove:z,onMouseUp:$,...k==null?void 0:k.container,...j,children:[r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...k==null?void 0:k.slideWrapper,children:C.map((A,F)=>r.jsx(Nr,{isActive:F===M,index:F,views:k==null?void 0:k.slide,children:A},F))}),E(),H()]})},Vc=e=>r.jsx(Rc,{...e}),Xe=Vc;Xe.Slide=Nr;Xe.Content=vr;Xe.Item=Yr;Xe.Previous=Ur;Xe.Next=Gr;const ke={blue:"color-blue-500",green:"color-green-500",purple:"color-purple-500",orange:"color-orange-500",red:"color-red-500",teal:"color-teal-500",pink:"color-pink-500",indigo:"color-indigo-500",yellow:"color-yellow-500",cyan:"color-cyan-500"},Ec=[ke.blue,ke.green,ke.purple,ke.orange,ke.red,ke.teal,ke.pink,ke.indigo,ke.yellow,ke.cyan],Ge=Ec,Pc={width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},Wc={fontSize:"18px",fontWeight:"bold",marginBottom:"16px",textAlign:"center"},_c={display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"16px"},$c={display:"flex",alignItems:"center",marginRight:"16px",marginBottom:"8px"},Hc={width:"12px",height:"12px",borderRadius:"2px",marginRight:"6px"},Bc={fontSize:"14px"},Xr={stroke:"color-gray-200",strokeWidth:"1px"},_o={stroke:"color-gray-300",strokeWidth:"1px"},$o={fontSize:"12px",fill:"color-gray-600"},Lc={rx:"2px",ry:"2px",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},Ac={strokeWidth:"2px",fill:"none"},Dc={r:"4px",strokeWidth:"2px",stroke:"white",cursor:"pointer",transition:"r 0.2s ease"},Co={strokeWidth:"1px",stroke:"white",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},$t={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)",borderRadius:"4px",zIndex:10,padding:"16px",textAlign:"center"},Fc={...$t},Oc={...$t,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},qc={...$t,backgroundColor:"rgba(245, 245, 245, 0.8)",color:"color-gray-600"},Nc=({data:e,dataPoints:o,animated:t=!0,animationDuration:n=500,showTooltips:i=!0})=>{const[a,l]=u.useState(t?0:1),[d,s]=u.useState({visible:!1,x:0,y:0,content:null}),g=u.useRef(null),p=u.useRef(null);u.useEffect(()=>{if(!t){l(1);return}const y=Date.now(),b=()=>{const k=Date.now()-y,S=Math.min(k/n,1);l(S),S<1&&(g.current=requestAnimationFrame(b))};return g.current=requestAnimationFrame(b),()=>{g.current&&cancelAnimationFrame(g.current)}},[t,n]);const m=u.useCallback(()=>e?{...e,series:e.series.map((y,b)=>({...y,color:y.color||Ge[b%Ge.length]}))}:o?o.map((y,b)=>({...y,color:y.color||Ge[b%Ge.length]})):null,[e,o]),h=u.useCallback((y,b,k)=>{i&&s({visible:!0,x:y,y:b,content:k})},[i]),f=u.useCallback(()=>{s(y=>({...y,visible:!1}))},[]),x=u.useCallback(()=>{if(!p.current)return{width:0,height:0};const{width:y,height:b}=p.current.getBoundingClientRect();return{width:y,height:b}},[]);return{animationProgress:a,tooltip:d,containerRef:p,processedData:m,showTooltip:h,hideTooltip:f,getChartDimensions:x}},Uc=({data:e,width:o,height:t,animationProgress:n,showGrid:i=!0,onBarClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),p={top:20,right:20,bottom:40,left:50},m=o-p.left-p.right,h=t-p.top-p.bottom,f=u.useMemo(()=>{let C=0;return e.series.forEach(I=>{I.data.forEach(M=>{C=Math.max(C,M)})}),C},[e]),x=e.labels.length,y=e.series.length,b=m/x,k=b*.8/y,S=b*.2/(y+1),w=f||10,j=u.useMemo(()=>{const I=[];for(let M=0;M<=5;M++){const R=w/5*M;I.push(R)}return I},[f]);return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:p.left,y1:t-p.bottom,x2:o-p.right,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),r.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),e.labels.map((C,I)=>{const M=p.left+(I+.5)*b,R=t-p.bottom+20;return r.jsx("text",{x:M,y:R,textAnchor:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:C},`x-label-${I}`)}),j.map((C,I)=>{const M=t-p.bottom-C/w*h;return r.jsxs(u.Fragment,{children:[r.jsx("text",{x:p.left-10,y:M,textAnchor:"end",dominantBaseline:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:C.toFixed(0)}),i&&r.jsx("line",{x1:p.left,y1:M,x2:o-p.right,y2:M,...Xr,...s==null?void 0:s.grid})]},`y-tick-${I}`)}),e.series.map((C,I)=>r.jsx(u.Fragment,{children:C.data.map((M,R)=>{const V=M/w*h*n,_=p.left+R*b+S*(I+1)+k*I,T=t-p.bottom-V,W=e.labels[R],B=e.series.reduce((H,L)=>{const A=L.data[R];return H+(typeof A=="number"?A:0)},0),P=B>0?(M/B*100).toFixed(1):null,z=C.color?g(C.color):"black",$=H=>{const L=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"180px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:C.name}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:z})]}),r.jsx(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:W}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:M.toLocaleString()})]}),P!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:`${P}%`})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(c.Text,{fontWeight:"medium",children:B.toLocaleString()})]})]})]});l(H.clientX,H.clientY,L)},E=()=>{a&&a(C.name,R)};return r.jsx("rect",{x:_,y:T,width:k,height:V,fill:z,onMouseEnter:$,onMouseLeave:d,onClick:E,...Lc,...s==null?void 0:s.bar},`bar-${I}-${R}`)})},`series-${I}`))]})},Gc=({data:e,width:o,height:t,animationProgress:n,showGrid:i=!0,onPointClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),p={top:20,right:20,bottom:40,left:50},m=o-p.left-p.right,h=t-p.top-p.bottom,f=u.useMemo(()=>{let S=0;return e.series.forEach(w=>{w.data.forEach(j=>{S=Math.max(S,j)})}),S},[e]),x=f||10,y=u.useMemo(()=>{const w=[];for(let j=0;j<=5;j++){const C=x/5*j;w.push(C)}return w},[f]),b=S=>`M ${S.map((j,C)=>{const I=p.left+C/(e.labels.length-1)*m,M=t-p.bottom-j/x*h*n;return`${I},${M}`}).join(" L ")}`,k=S=>{const w=p.left,j=p.left+m,C=t-p.bottom,I=S.map((M,R)=>{const V=p.left+R/(e.labels.length-1)*m,_=t-p.bottom-M/x*h*n;return`${V},${_}`});return`M ${w},${C} L ${I.join(" L ")} L ${j},${C} Z`};return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:p.left,y1:t-p.bottom,x2:o-p.right,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),r.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),e.labels.map((S,w)=>{const j=p.left+w/(e.labels.length-1)*m,C=t-p.bottom+20;return r.jsx("text",{x:j,y:C,textAnchor:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:S},`x-label-${w}`)}),y.map((S,w)=>{const j=t-p.bottom-S/x*h;return r.jsxs(u.Fragment,{children:[r.jsx("text",{x:p.left-10,y:j,textAnchor:"end",dominantBaseline:"middle",...$o,...s==null?void 0:s.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:S.toFixed(0)}),i&&r.jsx("line",{x1:p.left,y1:j,x2:o-p.right,y2:j,...Xr,...s==null?void 0:s.grid})]},`y-tick-${w}`)}),e.series.map((S,w)=>{const j=S.color?g(S.color):"black";return r.jsxs(u.Fragment,{children:[r.jsx("path",{d:k(S.data),fill:j,opacity:.1,...s==null?void 0:s.area}),r.jsx("path",{d:b(S.data),stroke:j,...Ac,...s==null?void 0:s.line}),S.data.map((C,I)=>{const M=p.left+I/(e.labels.length-1)*m,R=t-p.bottom-C/x*h*n,V=e.labels[I],_=e.series.reduce((E,H)=>{const L=H.data[I];return E+(typeof L=="number"?L:0)},0),T=_>0?(C/_*100).toFixed(1):null,W=I>0&&typeof S.data[I-1]=="number"?S.data[I-1]:null,B=typeof W=="number"?C-W:null,P=typeof B=="number"?`${B>=0?"+":""}${B.toLocaleString()}`:null,z=E=>{const H=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:S.name}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:j})]}),r.jsx(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:V}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:C.toLocaleString()})]}),P!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Change"}),r.jsx(c.Text,{fontWeight:"medium",children:P})]}),T!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:`${T}%`})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(c.Text,{fontWeight:"medium",children:_.toLocaleString()})]})]})]});l(E.clientX,E.clientY,H)},$=()=>{a&&a(S.name,I)};return r.jsx("circle",{cx:M,cy:R,fill:j,onMouseEnter:z,onMouseLeave:d,onClick:$,...Dc,...s==null?void 0:s.point},`point-${w}-${I}`)})]},`series-${w}`)})]})},Yc=({dataPoints:e,width:o,height:t,animationProgress:n,isDonut:i=!1,onSliceClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:g}=c.useTheme(),{ref:p,relation:m}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),h=u.useRef(null);u.useEffect(()=>{h.current&&p&&(p.current=h.current)},[h,p]);const x=Math.min(o,t)/2*.8,y=o/2,b=t/2,k=i?x*.6:0,S=u.useMemo(()=>e.reduce((j,C)=>j+C.value,0),[e]),w=u.useMemo(()=>{if(S===0)return[{path:i?[`M ${y} ${b-x}`,`A ${x} ${x} 0 1 1 ${y} ${b+x}`,`A ${x} ${x} 0 1 1 ${y} ${b-x}`,`M ${y} ${b-k}`,`A ${k} ${k} 0 1 0 ${y} ${b+k}`,`A ${k} ${k} 0 1 0 ${y} ${b-k}`,"Z"].join(" "):[`M ${y} ${b}`,`M ${y} ${b-x}`,`A ${x} ${x} 0 1 1 ${y} ${b+x}`,`A ${x} ${x} 0 1 1 ${y} ${b-x}`,"Z"].join(" "),color:"#E2E8F0",label:"Total",value:0,percentage:"0%",labelX:y,labelY:b,startAngle:0,endAngle:Math.PI*2,index:-1}];const j=[];let C=-Math.PI/2;for(let I=0;I<e.length;I++){const R=e[I].value/S,V=R*2*Math.PI*n,_=C+V,T=y+Math.cos(C)*x,W=b+Math.sin(C)*x,B=y+Math.cos(_)*x,P=b+Math.sin(_)*x,z=y+Math.cos(C)*k,$=b+Math.sin(C)*k,E=y+Math.cos(_)*k,H=b+Math.sin(_)*k,L=V>Math.PI?1:0;let A;i?A=[`M ${T} ${W}`,`A ${x} ${x} 0 ${L} 1 ${B} ${P}`,`L ${E} ${H}`,`A ${k} ${k} 0 ${L} 0 ${z} ${$}`,"Z"].join(" "):A=[`M ${y} ${b}`,`L ${T} ${W}`,`A ${x} ${x} 0 ${L} 1 ${B} ${P}`,"Z"].join(" ");const F=C+V/2,D=x*.7,q=y+Math.cos(F)*D,K=b+Math.sin(F)*D,Y=`${(R*100).toFixed(1)}%`,O=e[I].color||Ge[I%Ge.length],X=g(O);j.push({path:A,color:X,label:e[I].label,value:e[I].value,percentage:Y,labelX:q,labelY:K,startAngle:C,endAngle:_,index:I}),C=_}return j},[e,S,x,y,b,k,n,i]);return r.jsxs("svg",{ref:h,width:o,height:t,style:{overflow:"visible"},children:[i&&r.jsx("circle",{cx:y,cy:b,r:k,fill:"white",pointerEvents:"none"}),w.map((j,C)=>{const I=V=>{const _=S>0?j.value/S*100:0,T=S>0?Math.max(0,100-_):null,W=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:j.label}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:j.color})]}),r.jsxs(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:["Slice ",j.index+1," of ",e.length]}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:j.value.toLocaleString()})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:j.percentage})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Total"}),r.jsx(c.Text,{fontWeight:"medium",children:S.toLocaleString()})]}),T!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Remaining"}),r.jsx(c.Text,{fontWeight:"medium",children:`${T.toFixed(1)}%`})]})]})]});let B=V.clientX,P=V.clientY;if(m&&h.current){const z=h.current.getBoundingClientRect();V.clientX-z.left,V.clientY-z.top,m.space.horizontal==="left"?B=V.clientX-100:B=V.clientX+10,m.space.vertical==="top"?P=V.clientY-30:P=V.clientY+10}l(B,P,W)},M=()=>{j.index!==-1&&a&&a(e[j.index],j.index)},R=j.index===-1;return r.jsxs("g",{children:[r.jsx("path",{d:j.path,fill:j.color,onMouseEnter:R?void 0:I,onMouseLeave:R?void 0:d,onClick:M,...Co,style:{...Co==null?void 0:Co.style,cursor:R?"default":"pointer"},...s==null?void 0:s.pie}),!R&&j.endAngle-j.startAngle>.2&&r.jsx("text",{x:j.labelX,y:j.labelY,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontWeight:"bold",pointerEvents:"none",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3)",filter:"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))"},children:j.percentage})]},`slice-${C}`)})]})},vc=({visible:e,x:o,y:t,content:n,maxDistance:i=100,views:a})=>{const l=u.useRef(null),[d,s]=u.useState({left:0,top:0});return u.useEffect(()=>{if(!e||!l.current)return;const p=l.current.getBoundingClientRect(),m=p.width,h=p.height,f=10,x=15;let y=o-x,b=t-x;const k=o-y,S=t-b;k>i&&(y=o-i),S>i&&(b=t-i),y+m>window.innerWidth-f&&(y=window.innerWidth-m-f,o-y>i&&(y=o-i)),y<f&&(y=f),b+h>window.innerHeight-f&&(b=window.innerHeight-h-f,t-b>i&&(b=t-i)),b<f&&(b=f),s({left:y,top:b})},[e,o,t,i]),e?r.jsx(c.View,{ref:l,position:"fixed",left:`${d.left}px`,top:`${d.top}px`,backgroundColor:"color-white",padding:"12px 16px",borderRadius:"8px",boxShadow:"0px 12px 24px rgba(15, 23, 42, 0.18)",border:"1px solid color-gray-200",fontSize:"14px",display:"flex",flexDirection:"column",pointerEvents:"none",zIndex:10,...a==null?void 0:a.tooltip,children:n}):null},Xc=({type:e,data:o,dataPoints:t,title:n,showLegend:i=!0,legendPosition:a="bottom",showGrid:l=!0,showTooltips:d=!0,animated:s=!0,animationDuration:g=500,responsive:p=!0,aspectRatio:m=16/9,width:h=200,height:f=200,views:x,onDataPointClick:y,onSeriesClick:b,isLoading:k=!1,error:S,noData:w,loadingIndicator:j,errorIndicator:C,noDataIndicator:I,"aria-label":M,themeMode:R,...V})=>{const{animationProgress:_,tooltip:T,containerRef:W,processedData:B,showTooltip:P,hideTooltip:z,getChartDimensions:$}=Nc({data:o,dataPoints:t,animated:s,animationDuration:g,showTooltips:d}),E=B(),{width:H,height:L}=$(),A=h||H,F=f||(p?H/m:L),D=()=>{if(!i||!E)return null;let J=[];return e==="pie"||e==="donut"?Array.isArray(E)&&(J=E):E&&E.series&&(J=E.series),!J||J.length===0?null:r.jsx(c.Horizontal,{flexWrap:"wrap",justifyContent:"center",marginTop:a==="bottom"?"16px":0,marginBottom:a==="top"?"16px":0,..._c,...x==null?void 0:x.legend,children:J.map((oe,re)=>r.jsxs(c.View,{...$c,...x==null?void 0:x.legendItem,children:[r.jsx(c.View,{backgroundColor:oe.color,...Hc}),r.jsx(c.Text,{...Bc,children:oe.name||oe.label})]},`legend-${re}`))})},q=()=>{if(!E)return null;switch(e){case"bar":return r.jsx(Uc,{data:E,width:A,height:F,animationProgress:_,showGrid:l,onBarClick:b,showTooltip:P,hideTooltip:z,views:x});case"line":case"area":return r.jsx(Gc,{data:E,width:A,height:F,animationProgress:_,showGrid:l,onPointClick:b,showTooltip:P,hideTooltip:z,views:x});case"pie":case"donut":return r.jsx(Yc,{dataPoints:E,width:A,height:F,animationProgress:_,isDonut:e==="donut",onSliceClick:y,showTooltip:P,hideTooltip:z,views:x});default:return null}},K=()=>k?r.jsx(c.View,{...Fc,...x==null?void 0:x.loadingOverlay,children:j||r.jsx(c.Center,{children:r.jsx(uo,{size:"lg"})})}):null,Y=()=>S?r.jsx(c.View,{...Oc,...x==null?void 0:x.errorOverlay,children:C||r.jsx(c.Text,{fontWeight:"medium",children:typeof S=="string"?S:"An error occurred"})}):null,O=()=>w?r.jsx(c.View,{...qc,...x==null?void 0:x.noDataOverlay,children:I||r.jsx(c.Text,{children:typeof w=="string"?w:"No data available"})}):null,X=M??(typeof n=="string"?n:"Chart"),Z=!S&&!k&&!w;return r.jsxs(c.View,{ref:W,role:"region","aria-label":X,"aria-busy":k,...Pc,...x==null?void 0:x.container,...V,children:[n&&r.jsx(c.Text,{...Wc,children:n}),Z&&a==="top"&&D(),r.jsxs(c.View,{flex:1,width:"100%",position:"relative",...x==null?void 0:x.chart,children:[Z&&q(),K(),Y(),O()]}),Z&&a==="bottom"&&D(),r.jsx(vc,{visible:d&&T.visible,x:T.x,y:T.y,content:T.content,maxDistance:100,views:x})]})},Kc=e=>r.jsx(Xc,{...e}),Qc=Kc,Zc=(e=365)=>{const[o,t]=u.useState(!1),[n,i]=u.useState(null),a="app-studio-cookie-consent";u.useEffect(()=>{const g=localStorage.getItem(a);i(g!==null?g==="true":!1)},[]);const l=g=>{localStorage.setItem(a,String(g));const p=new Date;p.setDate(p.getDate()+e),localStorage.setItem(`${a}-expires`,p.toISOString()),i(g)};return{isHovered:o,setIsHovered:t,hasConsent:n,acceptCookies:()=>{l(!0)},resetConsent:()=>{localStorage.removeItem(a),localStorage.removeItem(`${a}-expires`),i(!1)}}},Jc=e=>{const o=e==="dark";return{default:{container:{backgroundColor:o?"#1f2937":"#ffffff",borderColor:o?"#374151":"#e5e7eb",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#e5e7eb":"#1f2937"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:o?"#e5e7eb":"#4b5563",borderColor:o?"#4b5563":"#d1d5db",hoverBackgroundColor:o?"#374151":"#f3f4f6"}},info:{container:{backgroundColor:o?"#1e3a8a":"#eff6ff",borderColor:o?"#1e40af":"#bfdbfe",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#bfdbfe":"#1e40af"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:o?"#bfdbfe":"#1e40af",borderColor:o?"#3b82f6":"#93c5fd",hoverBackgroundColor:o?"#1e40af":"#dbeafe"}},primary:{container:{backgroundColor:o?"#0c4a6e":"#f0f9ff",borderColor:o?"#0369a1":"#bae6fd",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:o?"#bae6fd":"#0369a1"},acceptButton:{backgroundColor:"#0ea5e9",color:"#ffffff",hoverBackgroundColor:"#0284c7"},customizeButton:{backgroundColor:"transparent",color:o?"#bae6fd":"#0369a1",borderColor:o?"#0ea5e9":"#7dd3fc",hoverBackgroundColor:o?"#0369a1":"#e0f2fe"}}}},es=({title:e="Nous utilisons des cookies",description:o="Ce site utilise des cookies pour améliorer votre expérience. En continuant à naviguer sur ce site, vous acceptez notre utilisation des cookies conformément à notre politique de confidentialité.",acceptButtonText:t="Accepter",customizeButtonText:n="Personnaliser",position:i="bottom",variant:a="default",onAccept:l,onCustomize:d,views:s,showCustomizeButton:g=!0,cookieExpiration:p=365,themeMode:m,...h})=>{const{themeMode:f}=c.useTheme(),x=m||f||"light",{hasConsent:y,acceptCookies:b}=Zc(p),S=Jc(x)[a];if(y)return null;const w=()=>{b(),l&&l()},j=()=>{d&&d()};return r.jsx(c.View,{style:{position:"fixed",left:16,right:16,zIndex:1e3,...i==="bottom"?{bottom:16}:{top:16}},padding:16,borderWidth:"1px",borderStyle:"solid",borderRadius:8,maxWidth:"800px",marginLeft:"auto",marginRight:"auto",transition:"opacity 0.3s ease, transform 0.3s ease",...S.container,...s==null?void 0:s.container,...h,children:r.jsxs(c.Vertical,{gap:12,maxWidth:1200,marginLeft:"auto",marginRight:"auto",children:[e&&r.jsx(c.Text,{fontWeight:"bold",fontSize:18,color:"color-black",...s==null?void 0:s.title,children:e}),o&&r.jsx(c.Text,{fontSize:14,color:"color-black",...s==null?void 0:s.description,children:o}),r.jsxs(c.Horizontal,{gap:12,justifyContent:"flex-end",marginTop:8,...s==null?void 0:s.buttonGroup,children:[g&&r.jsx(_e,{variant:"outline",onClick:j,size:"sm",...s==null?void 0:s.customizeButton,children:n}),r.jsx(_e,{variant:"primary",onClick:w,size:"sm",...s==null?void 0:s.acceptButton,children:t})]})]})})},os=e=>r.jsx(es,{...e}),ts=os,rs=e=>{const{size:o,variant:t,onOpenChange:n}=e||{},[i,a]=u.useState(!1),[l,d]=u.useState({x:0,y:0}),[s,g]=u.useState(null),p=u.useRef(null),m=u.useRef(null),h=u.useMemo(()=>jt("contextmenu-content"),[]),f=u.useCallback(y=>{d({x:y.clientX,y:y.clientY}),a(!0),n==null||n(!0)},[n]),x=u.useCallback(()=>{a(!1),g(null),n==null||n(!1)},[n]);return u.useEffect(()=>{const y=S=>{m.current&&!m.current.contains(S.target)&&x()},b=()=>{i&&x()},k=S=>{S.key==="Escape"&&i&&x()};return document.addEventListener("mousedown",y),window.addEventListener("resize",b),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",y),window.removeEventListener("resize",b),document.removeEventListener("keydown",k)}},[i,x]),{isOpen:i,setIsOpen:a,position:l,setPosition:d,activeSubmenuId:s,setActiveSubmenuId:g,size:o,variant:t,triggerRef:p,contentRef:m,contentId:h,openMenu:f,closeMenu:x}},Kt={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},ns={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Qt={hover:{backgroundColor:"color-gray-100"}},Kr=u.createContext({isOpen:!1,setIsOpen:()=>{},position:{x:0,y:0},setPosition:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null},contentRef:{current:null},contentId:"contextmenu-content",closeMenu:()=>{},openMenu:()=>{}}),as=({children:e,value:o})=>r.jsx(Kr.Provider,{value:o,children:e}),Ho=()=>{const e=u.useContext(Kr);if(!e)throw new Error("useContextMenuContext must be used within a ContextMenuProvider");return e},Qr=({children:e,disableNativeContextMenu:o=!0,asChild:t=!1,isDisabled:n=!1,views:i,...a})=>{const{triggerRef:l,contentId:d,openMenu:s}=Ho(),p={ref:l,onContextMenu:m=>{if(!n)if(o&&m.preventDefault(),s)s(m);else{const{setIsOpen:h,setPosition:f}=Ho();f({x:m.clientX,y:m.clientY}),h(!0)}},"aria-controls":d,"aria-haspopup":"menu","data-disabled":n?"":void 0,...t&&u.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:n},...i==null?void 0:i.container,...a};if(t&&u.isValidElement(e)){const m=u.Children.only(e);return u.cloneElement(m,{...p,...m.props})}return r.jsx(c.View,{...p,children:e})},Ht=({items:e,children:o,position:t,side:n="right",align:i="start",views:a,style:l,...d})=>{const{isOpen:s,position:g,contentRef:p,contentId:m,variant:h}=Ho(),f=u.useRef(null),x=p||f,{ref:y,relation:b}=c.useElementPosition({}),[k,S]=u.useState({x:0,y:0});if(u.useEffect(()=>{if(s&&x.current){const j=t||g,C=x.current.offsetWidth,I=x.current.offsetHeight,M=window.innerWidth,R=window.innerHeight;let V=j.x,_=j.y;b&&(b.space.horizontal==="left"?V=j.x-C:V=j.x,b.space.vertical==="top"?_=j.y-I:_=j.y),V+C>M&&(V=M-C-8),V<8&&(V=8),_+I>R&&(_=R-I-8),_<8&&(_=8),S({x:V,y:_})}},[s,g,t,n,i,x,b]),!s)return null;const w={position:"fixed",top:`${k.y}px`,left:`${k.x}px`,zIndex:1e3,transformOrigin:"top left"};return r.jsxs(c.View,{id:m||"context-menu",ref:x,role:"menu",tabIndex:-1,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:{...w,...l},...ns[h],...a==null?void 0:a.menu,...a==null?void 0:a.content,...d,children:[e&&e.map((j,C)=>j.divider?r.jsx(Jr,{views:a},`divider-${C}`):r.jsx(Zr,{item:j,views:a},j.id)),o]})},Zr=({item:e,children:o,onSelect:t,isDisabled:n=!1,views:i,...a})=>{const{activeSubmenuId:l,setActiveSubmenuId:d,size:s,closeMenu:g}=Ho();if(e){const[m,h]=u.useState(!1),f=e.items&&e.items.length>0,x=l===e.id,[y,b]=u.useState({x:0,y:0}),k=e.disabled||n,S=()=>{h(!0),f&&d(e.id)},w=()=>{h(!1)},j=()=>{k||!f&&e.onClick&&(e.onClick(),g&&g())},{ref:C,relation:I}=c.useElementPosition({});return u.useEffect(()=>{if(x&&C.current){const M=C.current.getBoundingClientRect(),R=window.innerWidth,V=200;let _=!1;if(I)_=I.space.horizontal==="left";else{const T=R-M.right,W=M.left;_=T<V&&W>T}b({x:_?M.left-V:M.right,y:M.top})}},[x,e.items,I]),r.jsxs(c.View,{ref:C,role:"menuitem",display:"flex",alignItems:"center",cursor:k?"not-allowed":"pointer",opacity:k?.5:1,position:"relative","aria-disabled":k,"data-disabled":k?"":void 0,...Kt[s],_hover:k?{}:Qt.hover,backgroundColor:m&&!k?"color-gray-100":"transparent",onMouseEnter:S,onMouseLeave:w,onClick:j,...i==null?void 0:i.item,...a,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),r.jsx(c.View,{flexGrow:1,children:e.label}),f&&r.jsx(c.View,{marginLeft:8,...i==null?void 0:i.submenuIndicator,children:r.jsx(ae,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),x&&f&&r.jsx(Ht,{items:e.items||[],position:y,side:"right",align:"start",views:i})]})}const p=m=>{n||(t==null||t(m),g&&g())};return r.jsx(c.View,{role:"menuitem",onClick:p,cursor:n?"not-allowed":"pointer",opacity:n?.5:1,"aria-disabled":n,"data-disabled":n?"":void 0,...Kt[s],_hover:n?{}:Qt.hover,...i==null?void 0:i.item,...a,children:o})},Jr=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.divider,...o}),is=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.separator,...o}),ls=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:i=!0,views:a,themeMode:l,...d})=>!o||o.length===0?r.jsx(r.Fragment,{children:e}):r.jsxs(r.Fragment,{children:[r.jsx(Qr,{disableNativeContextMenu:i,views:a,...d,children:e}),r.jsx(Ht,{items:o,views:a})]}),cs=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:i=!0,onOpenChange:a,views:l,...d})=>{const s=rs({size:t,variant:n,onOpenChange:a}),{isOpen:g,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:f,setActiveSubmenuId:x,triggerRef:y,contentRef:b,contentId:k,openMenu:S,closeMenu:w}=s;return r.jsx(as,{value:{isOpen:g,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:f,setActiveSubmenuId:x,size:t,variant:n,triggerRef:y,contentRef:b,contentId:k,openMenu:S,closeMenu:w,styles:l},children:r.jsx(ls,{items:o,size:t,variant:n,disableNativeContextMenu:i,views:l,...d,children:e})})},Ke=cs;Ke.Trigger=Qr;Ke.Content=Ht;Ke.Item=Zr;Ke.Divider=Jr;Ke.Separator=is;const ss=({src:e,color:o,views:t,themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=o?{fill:a(o,{themeMode:l}),stroke:a(o,{themeMode:l})}:{};return r.jsx(c.Center,{...i,...t==null?void 0:t.container,children:r.jsx(c.Image,{...d,content:'url("'+e+'")',width:"100%",height:"100%",...t==null?void 0:t.image})})},ds=({path:e,...o})=>r.jsx(c.Image,{src:e,...o}),en=({placeholder:e,isMulti:o,options:t,id:n=`select-${Math.random().toString(36).substr(2,9)}`})=>{const i=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(i),[m,h]=u.useState(0),[f,x]=u.useState(!0);return{id:n,value:g,setValue:p,hide:f,setHide:x,isHovered:a,setIsHovered:l,isFocused:d,setIsFocused:s,highlightedIndex:m,setHighlightedIndex:h}},on=({children:e,containerId:o="portal-root"})=>{const[t,n]=u.useState(null);return u.useEffect(()=>{let i=document.getElementById(o),a=!1;return i||(a=!0,i=document.createElement("div"),i.setAttribute("id",o),document.body.appendChild(i)),n(i),()=>{a&&i&&i.parentNode&&i.childNodes.length===0&&i.parentNode.removeChild(i)}},[o]),t?ri.createPortal(e,t):null},mt=({children:e,views:o={helperText:{}},...t})=>r.jsx(c.Text,{size:"xs",fontWeight:"400",letterSpacing:"-0.01em",lineHeight:"16px",marginVertical:0,marginHorizontal:0,color:"color-gray-500",transition:"all 0.2s ease",...o.helperText,...t,children:e}),we=u.forwardRef(({children:e,helperText:o,error:t=!1,views:n,...i},a)=>r.jsxs(c.Vertical,{ref:a,gap:8,position:"relative",width:"100%",marginVertical:4,...i,...n==null?void 0:n.container,children:[e,!t&&o&&r.jsx(mt,{marginTop:4,...n==null?void 0:n.helperText,children:o}),t&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,fontWeight:"500",color:"color-red-500",transition:"all 0.2s ease",...n==null?void 0:n.error,children:t})]}));we.displayName="FieldContainer";const tn={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},Zt={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},rn={outline:{borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",transition:"border-color 200ms ease-out, box-shadow 200ms ease-out, background-color 200ms ease-out",_hover:{borderColor:"color-gray-300",backgroundColor:"color-gray-50"},_focus:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"},_focusVisible:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"}},default:{borderWidth:0,borderBottomWidth:"1.5px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",borderRadius:0,backgroundColor:"transparent",transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out",_hover:{borderBottomColor:"color-gray-400",backgroundColor:"color-gray-50"},_focus:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"},_focusVisible:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"}},none:{border:"none",backgroundColor:"transparent",transition:"background-color 200ms ease-out",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"},_focusVisible:{outline:"none",backgroundColor:"color-gray-100"}}},us={paddingTop:"16px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"12px",paddingBottom:"6px",paddingLeft:"12px",paddingRight:"12px"}}},gs={paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"12px",paddingRight:"12px"}}},Ve=({label:e,shadow:o,children:t,value:n,size:i="md",shape:a="default",variant:l="default",error:d=!1,showLabel:s=!1,isFocused:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,views:f={pickerBox:{}},...x})=>{const b=d?"color-red-500":(p||g)&&!m?"theme-primary":"color-gray-300";return r.jsx(c.Horizontal,{gap:8,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",marginBottom:2,borderStyle:"solid",borderColor:b,backgroundColor:"color-white",fontSize:c.Typography.fontSizes[i],cursor:m?"not-allowed":h?"auto":"text",opacity:m?.7:1,transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out, opacity 200ms ease-out",...s?us:gs,...o,...tn[a],...rn[l],...f==null?void 0:f.container,...x,children:t})},Bt=({children:e,...o})=>r.jsx(c.Center,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",...o,children:e}),ps={h1:{fontSize:96,lineHeight:112,letterSpacing:-1.5},h2:{fontSize:60,lineHeight:71,letterSpacing:-.5},h3:{fontSize:48,lineHeight:57,letterSpacing:0},h4:{fontSize:34,lineHeight:40,letterSpacing:.25},h5:{fontSize:24,lineHeight:28,letterSpacing:0},h6:{fontSize:20,lineHeight:24,letterSpacing:.15}},ms=({children:e,heading:o,isItalic:t=!1,isUnderlined:n=!1,isStriked:i=!1,weight:a="normal",size:l="sm",dropDown:d,...s})=>{const g=o?ps[o]:{};return r.jsx(c.Element,{as:"label",width:"100%",fontSize:l,fontStyle:t?"italic":"normal",fontWeight:c.Typography.fontWeights[a],textDecoration:i?"line-through":n?"underline":"none",...g,...s,children:e})},hs=e=>r.jsx(ms,{...e}),ho=hs,He=({children:e,size:o="md",error:t=!1,color:n="theme-primary",views:i={label:{}},helperText:a,...l})=>r.jsx(ho,{top:0,zIndex:-10,position:"absolute",fontSize:Zt[o],lineHeight:Zt[o],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:t?"color-red-500":n,transition:"color 200ms ease-out",...i.label,...l,children:e}),Qe=({children:e,...o})=>r.jsx(c.Vertical,{width:"100%",maxWidth:"100%",position:"relative",...o,children:e}),nn={xs:12,sm:14,md:16,lg:20,xl:24},fs={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},xs={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},bs={padding:"10px 12px",cursor:"pointer",borderRadius:"6px",margin:"2px 4px",transition:"background-color 0.15s ease"},So={default:{backgroundColor:"transparent"},highlighted:{backgroundColor:"color-gray-100"},selected:{backgroundColor:"color-gray-100"},selectedHighlighted:{backgroundColor:"color-gray-200"}},Jt={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},ys={padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},ks={scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.15) transparent"},js=({isHovered:e,setIsHovered:o,option:t,size:n="md",callback:i=()=>{},style:a,isSelected:l=!1,...d})=>{const s=(m,h)=>{m.stopPropagation(),m.preventDefault(),typeof i=="function"&&i(h)},g=()=>o(!e),p=()=>l&&e?So.selectedHighlighted:l?So.selected:e?So.highlighted:So.default;return r.jsxs(c.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...bs,...p(),onMouseEnter:g,onMouseLeave:g,onClick:m=>s(m,t.value),...d,children:[r.jsx(c.Text,{fontSize:c.Typography.fontSizes[n],fontWeight:l?"500":"400",lineHeight:"1.4",color:l?"color-gray-900":"color-gray-700",...a,children:t.label}),l&&r.jsx(c.Element,{as:"span",color:"theme-primary",fontSize:"14px",marginLeft:8,display:"flex",alignItems:"center",children:"✓"})]})},Cs=({size:e="md",views:o={field:{},text:{}},value:t,isDisabled:n,placeholder:i,removeOption:a=()=>{},options:l})=>{const d={margin:0,width:"95%",height:"100%",border:"none",paddingVertical:4,paddingHorizontal:0,fontSize:c.Typography.fontSizes[e],fontWeight:"400",lineHeight:"1.5",letterSpacing:"-0.01em",backgroundColor:"transparent",color:n?"color-gray-400":"color-gray-900",cursor:n?"not-allowed":"pointer",transition:"all 0.2s ease",...o.field,...o.text},s=l.length>0&&l.find(g=>g.value===t);return r.jsx(c.Text,{...d,children:(t===""||Array.isArray(t)&&t.length===0)&&i?i:r.jsx(r.Fragment,{children:typeof t=="string"?(s&&s.label)??t:Array.isArray(t)&&t.length>0?r.jsx(c.Horizontal,{gap:6,children:t.map(g=>r.jsx(Is,{option:g,removeOption:a},g))}):r.jsx("span",{children:t})})})},Ss=({id:e,name:o,value:t,onChange:n,isMulti:i=!1,isDisabled:a=!1,isReadOnly:l=!1,options:d=[],...s})=>{const g=p=>{n&&n(p)};return r.jsx(c.Element,{id:e,name:o,as:"select",opacity:0,width:1,height:1,overflow:"hidden",position:"absolute",pointerEvents:"none",tabIndex:-1,"aria-hidden":"true",value:t,disabled:a,readOnly:l,onChange:g,multiple:i,...s,children:d.length>0&&d.map(p=>r.jsx("option",{value:p.value,children:p.label},p.value))})},ws=({size:e,views:o={},options:t,callback:n=()=>{},highlightedIndex:i,setHighlightedIndex:a,selectedValue:l})=>{const d=g=>n(g),s=g=>Array.isArray(l)?l.includes(g):l===g;return r.jsx(c.Element,{as:"ul",role:"listbox",display:"flex",flexDirection:"column",margin:0,padding:"4px",...fs,style:ks,...o==null?void 0:o.dropDown,children:t&&t.length>0&&t.map((g,p)=>r.jsx(js,{size:e,style:o.text,option:g,callback:d,isSelected:s(g.value),isHovered:p===i,setIsHovered:()=>{},onMouseEnter:()=>a(p)},g.value))})},Is=({option:e,size:o="md",removeOption:t=()=>{},...n})=>{const i=()=>t(e);return r.jsxs(c.Horizontal,{gap:6,alignItems:"center",onClick:a=>a.stopPropagation(),...ys,_hover:{backgroundColor:"color-gray-200"},...n,children:[r.jsx(c.Text,{fontSize:c.Typography.fontSizes[o],fontWeight:"500",color:"color-gray-700",children:e}),r.jsx(fe,{role:"close-button",color:"color-gray-500",widthHeight:nn[o],onClick:i,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},an=({id:e,name:o,label:t,value:n,placeholder:i,helperText:a,hide:l=!1,error:d=!1,isMulti:s=!1,isFocused:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,options:f=[],shadow:x={},size:y="md",shape:b="default",variant:k="default",views:S={text:{},icon:{},dropDown:{},selectBox:{},label:{},helperText:{}},onChange:w=()=>{},setHide:j=()=>{},setValue:C=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setHighlightedIndex:R,highlightedIndex:V,..._})=>{const{ref:T,relation:W,updateRelation:B}=c.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),P=u.useRef(null),z=()=>{var Y;if(!T.current)return{};const D=T.current.getBoundingClientRect(),q={position:"fixed",left:D.left,width:D.width,zIndex:1e4};return((Y=W==null?void 0:W.space)==null?void 0:Y.vertical)==="top"?{...q,bottom:window.innerHeight-D.top+8}:{...q,top:D.bottom+8}};u.useEffect(()=>{const D=()=>j(!0);return document.addEventListener("closeAllSelects",D),()=>document.removeEventListener("closeAllSelects",D)},[j]),u.useEffect(()=>{const D=q=>{!q.target.closest(`#${e}`)&&!l&&j(!0)};return document.addEventListener("click",D),()=>{document.removeEventListener("click",D)}},[e,l,j]);const $=!!(g&&t),E=()=>I(!p),H=()=>M(!0),L=D=>{document.dispatchEvent(new Event("closeAllSelects")),D&&D.stopPropagation&&D.stopPropagation();const q=!l;j(q),M(!q)},A=u.useCallback(D=>{if(j(!0),document.dispatchEvent(new Event("closeAllSelects")),s&&Array.isArray(n)){if(!n.includes(D)){const q=[...n,D];C(q),w&&w(D)}}else C(D),w&&w(D);M(!0)},[s,n,j,C,w,M]),F=D=>{if(Array.isArray(n)&&n.includes(D)){const q=n.filter(K=>K!==D);C(q.length===0?[]:q)}};return r.jsx(we,{ref:T,position:"relative",width:"100%",display:"inline-block",id:e,role:"SelectBox",helperText:a,error:d,views:S,onClick:D=>{D.stopPropagation(),m||h||L(D)},children:r.jsxs(Ve,{label:t,size:y,error:d,shape:b,views:S,shadow:x,variant:k,value:n,color:"theme-primary",isHovered:p,isDisabled:m,isReadOnly:h,isFocused:g,showLabel:$,onMouseEnter:E,onMouseLeave:E,position:"relative",children:[r.jsxs(Qe,{children:[$&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...S,children:t}),r.jsx(Ss,{id:e,name:o,options:f,onChange:w,value:n,isDisabled:m,isReadOnly:h,isMulti:s,onFocus:H,..._}),r.jsx(Cs,{options:f,size:y,views:S,value:n,isDisabled:m,placeholder:i,removeOption:F})]}),r.jsx(Bt,{children:!h&&!m&&r.jsx(c.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:l?Jt.closed:Jt.open,children:r.jsx(ae,{color:"inherit",widthHeight:nn[y],style:S.icon,orientation:"down"})})}),!l&&f.length>0&&r.jsx(on,{children:r.jsx(c.Element,{ref:P,onClick:D=>D.stopPropagation(),style:{...z(),...xs.enter},children:r.jsx(ws,{size:y,views:S,options:f,callback:A,highlightedIndex:V,setHighlightedIndex:R,selectedValue:n})})})]})})},Ts=e=>{const o={...e,options:e.options||[]},t=en(o);return r.jsx(an,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},Ms=Ts,ln=({isDisabled:e,isChecked:o})=>{const[t,n]=u.useState(!1),[i,a]=u.useState(o||!1),[l,d]=u.useState(o||!1);return u.useEffect(()=>{o!==void 0&&(a(o),d(o))},[o]),{isHovered:t,setIsHovered:n,on:i,setOn:a,value:l,setValue:d}},zs={xs:{height:"8px",width:"8px"},sm:{height:"12px",width:"12px"},md:{height:"16px",width:"16px"},lg:{height:"20px",width:"20px"},xl:{height:"24px",width:"24px"}},Rs={xs:{height:"16px",width:"36px"},sm:{height:"20px",width:"44px"},md:{height:"24px",width:"52px"},lg:{height:"28px",width:"60px"},xl:{height:"32px",width:"68px"}},Vs={xs:{paddingVertical:4,paddingHorizontal:2},sm:{paddingVertical:4,paddingHorizontal:2},md:{paddingVertical:4,paddingHorizontal:4},lg:{paddingVertical:4,paddingHorizontal:4},xl:{paddingVertical:4,paddingHorizontal:4}},Pe={default:{active:"theme-primary",inactive:"color-gray-300",knob:"white",disabled:"color-gray-200"},states:{hover:{active:"theme-primary",inactive:"color-gray-400",activeOpacity:.9}}},er={slider:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},knob:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}},Es=e=>r.jsx(c.Input,{type:"checkbox",...e}),cn=({id:e,name:o,label:t,inActiveChild:n,isChecked:i,activeChild:a,labelPosition:l="right",shadow:d={},size:s="sm",value:g=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,on:f,setOn:x,onChange:y,setValue:b=()=>{},setIsHovered:k=()=>{},helperText:S,views:w={slider:{},circle:{},label:{}},...j})=>{const C=V=>{if(!h&&!m){const _=V.target.checked;b(_),x(_),y&&y(_)}},I=()=>k(!0),M=()=>k(!1),R={container:{gap:12,display:"flex",height:"fit-content",width:"fit-content",alignItems:"center",cursor:m?"not-allowed":h?"default":"pointer",opacity:m?.6:1,transition:"all 0.2s ease",...w.label}};return r.jsxs(ho,{htmlFor:e,onMouseEnter:I,onMouseLeave:M,...R.container,...j,children:[r.jsx(Es,{id:e,name:o,opacity:0,width:0,height:0,checked:g,onChange:C,disabled:m,readOnly:h,...j}),l==="left"&&t&&r.jsx(c.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t}),r.jsxs(c.View,{display:"flex",alignItems:"center",justifyContent:g?a?"space-between":"flex-end":n?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:m?Pe.default.disabled:g?p?Pe.states.hover.active:Pe.default.active:p?Pe.states.hover.inactive:Pe.default.inactive,opacity:!m&&g&&p?Pe.states.hover.activeOpacity:1,cursor:"pointer",...er.slider,...d,...Vs[s],...Rs[s],...w.slider,children:[a&&g&&r.jsx(c.View,{marginLeft:8,marginRight:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:a}),r.jsx(c.View,{borderRadius:"50%",backgroundColor:Pe.default.knob,boxShadow:p?"0 2px 4px rgba(0, 0, 0, 0.2)":"0 1px 2px rgba(0, 0, 0, 0.1)",transform:p?"scale(1.05)":"scale(1)",...er.knob,zIndex:1,...zs[s],...w.circle}),n&&!g&&r.jsx(c.View,{marginRight:8,marginLeft:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:n})]}),l==="right"&&t&&r.jsx(c.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t})]})},Ps=e=>{const o=ln(e);return r.jsx(cn,{...o,...e})},Ws=Ps,sn=({placeholder:e,isMulti:o,options:t,id:n=`selector-${Math.random().toString(36).substr(2,9)}`})=>{const i=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(i),[m,h]=u.useState(0),[f,x]=u.useState(!0);return{id:n,value:g,setValue:p,hide:f,setHide:x,isHovered:a,setIsHovered:l,isFocused:d,setIsFocused:s,highlightedIndex:m,setHighlightedIndex:h}},dn=({id:e,name:o,label:t,value:n,size:i,views:a={},options:l=[],onChange:d=()=>{},setValue:s=()=>{},...g})=>{const{getColor:p}=c.useTheme(),m=u.useCallback(h=>{s(h.value),d&&d(h.value)},[s,d]);return r.jsxs(we,{id:e,width:"100%",views:a,children:[t&&r.jsxs(c.Horizontal,{fontSize:"10px",letterSpacing:"wider",color:"color-black-500",fontWeight:"bold",marginBottom:12,alignItems:"center",gap:6,style:{textTransform:"uppercase"},children:[r.jsx(ze,{widthHeight:14})," ",r.jsx(c.Text,{children:t})]}),r.jsx(c.Horizontal,{gap:0,children:l.map((h,f,x)=>{const y=n===h.value;let b=p("color-gray-200"),k=p("color-gray-500"),S="transparent";if(y){if(h.color)h.color,b=p(h.color),k=p(h.color),S="rgba(0,0,0,0.05)";else{const w=p("theme-primary");b=w,k=w,S="color-gray-50"}h.color?(b=p(h.color),k=p(h.color),S="transparent"):(b=p("theme-primary"),k=p("theme-primary"),S="transparent")}return r.jsx(_e,{onClick:()=>m(h),flex:1,...i?{size:i}:{paddingVertical:6,fontSize:"12px"},fontWeight:y?"bold":"normal",style:{borderTop:`1px solid ${y?b:p("color-gray-200")}`,borderBottom:`1px solid ${y?b:p("color-gray-200")}`,borderLeft:`1px solid ${y?b:p("color-gray-200")}`,borderRight:f===x.length-1||y?`1px solid ${y?b:p("color-gray-200")}`:"none",backgroundColor:S,color:k,borderRadius:f===0?"6px 0 0 6px":f===x.length-1?"0 6px 6px 0":"0",zIndex:y?1:0,boxShadow:"none"},...a.item,children:h.label},h.value)})}),r.jsx("input",{type:"hidden",id:e,name:o,value:Array.isArray(n)?n.join(","):n,onChange:()=>{}})]})},_s=e=>{const o={...e,options:e.options||[]},t=sn(o);return r.jsx(dn,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},$s=_s,un=({label:e,placeholder:o,value:t})=>{const[n,i]=u.useState(e??o),[a,l]=u.useState(!1),[d,s]=u.useState(t||""),[g,p]=u.useState(!1);return u.useMemo(()=>{i(g&&!d?o??"":e??o)},[d,g,e,o]),{hint:n,setHint:i,isHovered:a,setIsHovered:l,value:d,setValue:s,isFocused:g,setIsFocused:p}},gn=({id:e,name:o,hint:t,error:n,value:i,label:a,shadow:l,helperText:d,placeholder:s,size:g="sm",shape:p="default",variant:m="default",isHovered:h=!1,isFocused:f=!1,isEditable:x=!1,isReadOnly:y=!1,isDisabled:b=!1,isAutoFocus:k=!1,isMultiline:S=!1,maxRows:w=3,maxCols:j=30,onBlur:C=()=>{},onChange:I,onFocus:M,setHint:R=()=>{},setValue:V=()=>{},setIsFocused:_=()=>{},setIsHovered:T=()=>{},views:W={label:{},helperText:{}},...B})=>{const P=!!(f&&a),z={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[g],lineHeight:`${Math.round(c.Typography.fontSizes[g]*1.5)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:b?"color-gray-400":"color-gray-900",cursor:b?"not-allowed":"text",opacity:b?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...W.field},$=()=>T(!h),E=()=>{_(!0),M&&M()},H=A=>{C(A),_(!1)},L=A=>{typeof A=="string"?(V(A),I&&I(A)):(V(A.target.value),I&&I(A.target.value))};return r.jsx(we,{helperText:d,error:n,views:W,...B,children:r.jsx(Ve,{label:a,size:g,error:n,shape:p,views:W,shadow:l,variant:m,value:i,color:"theme-primary",isHovered:h,isDisabled:b,isReadOnly:y,isFocused:f,showLabel:P,onMouseEnter:$,onMouseLeave:$,...W==null?void 0:W.content,children:r.jsxs(Qe,{...W==null?void 0:W.warper,children:[P&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:n,...W==null?void 0:W.label,children:a}),r.jsx(c.Element,{as:"textarea",id:e,name:o,rows:w,cols:j,value:i,readOnly:y,disabled:b,autoFocus:k,placeholder:t,onBlur:H,onFocus:E,onChange:A=>L(A),...z,style:{resize:b||y?"none":"vertical"},...W==null?void 0:W.textarea})]})})})},Hs=e=>{const o=un(e);return r.jsx(gn,{...o,...e})},Bs=Hs,Lt=({label:e,placeholder:o,value:t})=>{const[n,i]=u.useState(e??o),[a,l]=u.useState(!1),[d,s]=u.useState(!1),[g,p]=u.useState(t);return u.useMemo(()=>{i(a&&!g?o??"":e??o)},[g,a,e,o]),{hint:n,setHint:i,isFocused:a,setIsFocused:l,isHovered:d,setIsHovered:s,setValue:p,value:g}},Ls=e=>r.jsx(c.Input,{type:"text",...e}),fo=({id:e,name:o,label:t,hint:n,value:i,onChange:a,left:l,right:d,helperText:s,placeholder:g,onChangeText:p,shadow:m={},views:h={container:{},field:{},label:{},helperText:{},text:{}},size:f="md",shape:x="default",variant:y="default",error:b=!1,isFocused:k=!1,isHovered:S=!1,isDisabled:w=!1,isReadOnly:j=!1,isClearable:C=!0,isAutoFocus:I=!1,setHint:M=()=>{},setIsFocused:R=()=>{},setIsHovered:V=()=>{},setValue:_=()=>{},onClick:T=()=>{},onFocus:W,onBlur:B=()=>{},themeMode:P,...z})=>{const{getColor:$,themeMode:E}=c.useTheme(),H=$("color-blueGray-700",{themeMode:P||E}),L=!!(k&&t),A={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",height:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[f],lineHeight:`${Math.round(c.Typography.fontSizes[f]*1.4)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:w?"color-gray-400":"color-gray-900",cursor:w?"not-allowed":"text",opacity:w?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...h.field},F=()=>{R(!0),W&&W()},D=()=>V(!S),q=O=>{B&&B(O),R(!1)},K=O=>{typeof O=="string"?(_(O),p&&p(O),a&&a(O)):(_(O.target.value),p&&p(O.target.value),a&&a(O.target.value))},Y=()=>{_(""),a&&(B({target:{name:o}}),p&&p(""),a&&a("")),typeof document>"u"&&p&&p("")};return r.jsx(we,{helperText:s,error:b,views:h,children:r.jsxs(Ve,{label:t,size:f,error:b,shape:x,views:h,shadow:m,variant:y,value:i,color:"theme-primary",isHovered:S,isDisabled:w,isReadOnly:j,isFocused:k,showLabel:L,onMouseEnter:D,onMouseLeave:D,children:[l,r.jsxs(Qe,{children:[L&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:b,...h,children:t}),r.jsx(Ls,{id:e,name:o,readOnly:j,disabled:w,autoFocus:I,placeholder:n,onFocus:F,onBlur:q,autoComplete:"off",...A,...z,onChange:K,value:i})]}),C&&i&&!j&&!w&&r.jsx(Bt,{children:r.jsx(fe,{size:20,color:H,onClick:Y,cursor:"pointer",borderRadius:"50%",transition:"background-color 150ms ease-out, transform 150ms ease-out",_hover:{backgroundColor:"color-gray-100",transform:"scale(1.05)"},_active:{transform:"scale(0.95)"}})}),d]})})},As=e=>{const o=Lt(e);return r.jsx(fo,{...o,...e})},xo=As,pn=({defaultIsSelected:e=!1})=>{const[o,t]=u.useState(!1),[n,i]=u.useState(e);return{isHovered:o,setIsHovered:t,isSelected:n,setIsSelected:i}},Ds={xs:{height:"12px",width:"12px"},sm:{height:"16px",width:"16px"},md:{height:"20px",width:"20px"},lg:{height:"24px",width:"24px"},xl:{height:"28px",width:"28px"}},or={xs:10,sm:14,md:16,lg:20,xl:24},Fs={selected:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},unselected:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-black",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},indeterminate:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"}},nt={hover:{selected:{opacity:.9},unselected:{borderColor:"color-gray-400",backgroundColor:"color-gray-50"},indeterminate:{opacity:.9}},disabled:{selected:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},unselected:{borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},indeterminate:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"}},error:{selected:{backgroundColor:"color-red-500",borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"},indeterminate:{backgroundColor:"color-red-500",borderColor:"color-red-500"}}},mn=({id:e,icon:o,name:t,label:n,isChecked:i,onChange:a,onValueChange:l,shadow:d={},labelPosition:s="right",size:g="md",error:p=!1,isSelected:m=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:x=!1,isIndeterminate:y=!1,defaultIsSelected:b=!1,setIsSelected:k=()=>{},setIsHovered:S=()=>{},views:w={checkbox:{},label:{}},infoText:j,helperText:C,...I})=>{const M=()=>S(!h),R=()=>{!x&&!f&&(k&&k(!m),a&&a(!i),l&&l(!i))},V=y?"indeterminate":i||m?"selected":"unselected",_=p?nt.error[V]:f?nt.disabled[V]:h?nt.hover[V]:{},T={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:p?"color-red-600":f?"color-gray-400":"color-gray-700",cursor:f?"not-allowed":x?"default":"pointer",opacity:f?.6:1,transition:"all 0.2s ease",...w.label},checkbox:{...Fs[V],..._,borderRadius:"4px",...Ds[g],transition:"all 0.2s ease",...d,...w.checkbox}};return r.jsxs(ho,{htmlFor:e,as:"div",onClick:R,onMouseEnter:M,onMouseLeave:M,size:c.Typography.fontSizes[g],...T.container,...I,children:[r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsxs(c.Horizontal,{gap:12,alignItems:"center",children:[" ",s==="left"&&n&&r.jsx(c.Text,{size:g,fontWeight:"500",...w==null?void 0:w.label,children:n}),r.jsx(c.Center,{...T.checkbox,children:y?r.jsx(Mr,{widthHeight:or[g],color:"white",transition:"all 0.2s ease"}):(i||m)&&(o??r.jsx(No,{widthHeight:or[g],color:"white",transition:"all 0.2s ease"}))}),s==="right"&&n&&r.jsx(c.Text,{size:g,fontWeight:"500",...w==null?void 0:w.label,children:n})]}),j&&r.jsx(c.Text,{marginLeft:s==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...w==null?void 0:w.infoText,children:j})]}),p&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:p})]})},Os=e=>{const o=pn(e);return r.jsx(mn,{...o,...e})},qs=Os,hn=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:i,onOpen:a,onClose:l,closeOnSelect:d=!0,maxRecentColors:s=8,showRecentColors:g=!0,isAutoFocus:p=!1}=e,[m,h]=u.useState(!1),[f,x]=u.useState(o??t),[y,b]=u.useState(""),[k,S]=u.useState([]),[w,j]=u.useState(!1),[C,I]=u.useState(!1),M=u.useRef(null),R=u.useRef(null);u.useEffect(()=>{o!==void 0&&x(o)},[o]),u.useEffect(()=>{if(g)try{const $=localStorage.getItem("colorInput-recentColors");$&&S(JSON.parse($))}catch($){console.warn("Failed to load recent colors from localStorage:",$)}},[g]),u.useEffect(()=>{p&&M.current&&M.current.focus()},[p]),u.useEffect(()=>{const $=E=>{m&&M.current&&R.current&&!M.current.contains(E.target)&&!R.current.contains(E.target)&&P()};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[m]);const V=u.useCallback($=>{g&&S(E=>{const H=E.filter(A=>A!==$),L=[$,...H].slice(0,s);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(L))}catch(A){console.warn("Failed to save recent colors to localStorage:",A)}return L})},[g,s]),_=u.useCallback(()=>{const $=!m;h($),$?a==null||a():l==null||l()},[m,a,l]),T=u.useCallback($=>{x($),V($),n==null||n($),i==null||i($),d&&(h(!1),l==null||l())},[n,i,d,l,V]),W=u.useCallback($=>{b($)},[]),B=u.useCallback(()=>{y&&(T(y),b(""))},[y,T]),P=u.useCallback(()=>{h(!1),l==null||l()},[l]),z=u.useCallback($=>{x($),n==null||n($)},[n]);return{isOpen:m,selectedColor:f,recentColors:k,customColor:y,isFocused:w,isHovered:C,handleToggle:_,handleColorSelect:T,handleCustomColorChange:W,handleCustomColorSubmit:B,handleClose:P,setIsFocused:j,setIsHovered:I,setValue:z,triggerRef:M,dropdownRef:R}},ro={container:{position:"relative",display:"inline-block",width:"fit-content"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",padding:"8px 12px"},dropdown:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"8px"},recentColors:{display:"flex",gap:"4px",flexWrap:"wrap"}},Ns={xs:{height:"28px",fontSize:"10px",padding:"4px 8px"},sm:{height:"32px",fontSize:"12px",padding:"6px 10px"},md:{height:"40px",fontSize:"14px",padding:"8px 12px"},lg:{height:"48px",fontSize:"16px",padding:"12px 16px"},xl:{height:"56px",fontSize:"20px",padding:"16px 20px"}},Us={default:{borderRadius:"6px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Gs={default:{backgroundColor:"color-white",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},outline:{backgroundColor:"transparent",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},none:{backgroundColor:"transparent",borderColor:"transparent",borderWidth:"0px"}},Ys=[{name:"Red 500",value:"color-red-500"},{name:"Orange 500",value:"color-orange-500"},{name:"Yellow 500",value:"color-yellow-500"},{name:"Green 500",value:"color-green-500"},{name:"Blue 500",value:"color-blue-500"},{name:"Indigo 500",value:"color-indigo-500"},{name:"Purple 500",value:"color-purple-500"},{name:"Pink 500",value:"color-pink-500"},{name:"Red 300",value:"color-red-300"},{name:"Orange 300",value:"color-orange-300"},{name:"Yellow 300",value:"color-yellow-300"},{name:"Green 300",value:"color-green-300"},{name:"Blue 300",value:"color-blue-300"},{name:"Indigo 300",value:"color-indigo-300"},{name:"Purple 300",value:"color-purple-300"},{name:"Pink 300",value:"color-pink-300"},{name:"Red 700",value:"color-red-700"},{name:"Orange 700",value:"color-orange-700"},{name:"Yellow 700",value:"color-yellow-700"},{name:"Green 700",value:"color-green-700"},{name:"Blue 700",value:"color-blue-700"},{name:"Indigo 700",value:"color-indigo-700"},{name:"Purple 700",value:"color-purple-700"},{name:"Pink 700",value:"color-pink-700"},{name:"Gray 100",value:"color-gray-100"},{name:"Gray 300",value:"color-gray-300"},{name:"Gray 500",value:"color-gray-500"},{name:"Gray 700",value:"color-gray-700"},{name:"Gray 900",value:"color-gray-900"},{name:"White",value:"color-white"},{name:"Black",value:"color-black"},{name:"Transparent",value:"transparent"}],fn=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",shadow:g,error:p=!1,isDisabled:m=!1,isReadOnly:h=!1,isFocused:f=!1,isHovered:x=!1,predefinedColors:y=Ys,showCustomInput:b=!0,showRecentColors:k=!0,isOpen:S=!1,selectedColor:w="",recentColors:j=[],customColor:C="",handleToggle:I=()=>{},handleColorSelect:M=()=>{},handleCustomColorChange:R=()=>{},handleCustomColorSubmit:V=()=>{},setIsFocused:_=()=>{},setIsHovered:T=()=>{},triggerRef:W,dropdownRef:B,onChange:P,...z})=>{const{getColor:$}=c.useTheme(),E={...ro.container,...a==null?void 0:a.container},H={...ro.trigger,...Ns[l],...Us[d],...Gs[s],...p&&{borderColor:"color-red-500"},...m&&{opacity:.6,cursor:"not-allowed"},...f&&{borderColor:"color-blue-500",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.1)"},...x&&!m&&{borderColor:"color-gray-400"},...a==null?void 0:a.trigger,...g&&g},L={...ro.dropdown,...a==null?void 0:a.dropdown},A={...ro.colorGrid,...a==null?void 0:a.colorGrid},F={...ro.recentColors,...a==null?void 0:a.recentColors},D=w||"color-gray-200";return r.jsxs(c.View,{...E,...z,children:[t&&r.jsx(ho,{htmlFor:e,size:l,isDisabled:m,error:p,views:a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:W,onClick:m||h?void 0:I,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),onFocus:()=>_(!0),onBlur:()=>_(!1),tabIndex:m?-1:0,role:"button","aria-expanded":S,"aria-haspopup":"listbox","aria-label":t||n,width:"fit-content",gap:8,...H,children:[r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:D,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),!h&&!m&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:S?"up":"down"})]}),S&&r.jsxs(c.View,{ref:B,...L,children:[r.jsx(c.View,{...A,children:y.map((q,K)=>r.jsx(c.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:q.value,borderWidth:"2px",borderStyle:"solid",borderColor:w===q.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(q.value),title:q.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},K))}),k&&j.length>0&&r.jsxs(c.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(c.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Recent Colors"}),r.jsx(c.Horizontal,{gap:4,flexWrap:"wrap",...F,children:j.map((q,K)=>r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:q,borderWidth:"1px",borderStyle:"solid",borderColor:w===q?"color-blue-500":"color-gray-300",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(q),title:q,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"}},K))})]}),b&&r.jsxs(c.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(c.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Custom Color"}),r.jsxs(c.Horizontal,{gap:8,children:[r.jsx(xo,{value:C,onChange:q=>R(q.target.value),placeholder:"#000000 or rgb(0,0,0)",size:"sm",style:{flex:1},views:a==null?void 0:a.customInput}),r.jsx(c.View,{padding:"8px 12px",backgroundColor:"color-blue-500",borderRadius:"4px",cursor:"pointer",onClick:V,_hover:{backgroundColor:"color-blue-600"},children:r.jsx(c.Text,{color:"color-white",fontSize:"12px",fontWeight:"500",children:"Add"})})]})]})]}),i&&r.jsx(c.Text,{fontSize:"12px",color:p?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i}),p&&typeof p=="string"&&r.jsx(c.Text,{fontSize:"12px",color:"color-red-500",marginTop:"4px",...a==null?void 0:a.error,children:p})]})},vs=e=>{const o=hn(e);return r.jsx(fn,{...o,...e})},Xs=vs,ht=[{name:"Afghanistan",dial_code:"+93",emoji:"🇦🇫",code:"AF"},{name:"Aland Islands",dial_code:"+358",emoji:"🇦🇽",code:"AX"},{name:"Albania",dial_code:"+355",emoji:"🇦🇱",code:"AL"},{name:"Algeria",dial_code:"+213",emoji:"🇩🇿",code:"DZ"},{name:"AmericanSamoa",dial_code:"+1684",emoji:"🇦🇸",code:"AS"},{name:"Andorra",dial_code:"+376",emoji:"🇦🇩",code:"AD"},{name:"Angola",dial_code:"+244",emoji:"🇦🇴",code:"AO"},{name:"Anguilla",dial_code:"+1264",emoji:"🇦🇮",code:"AI"},{name:"Antarctica",dial_code:"+672",emoji:"🇦🇶",code:"AQ"},{name:"Antigua and Barbuda",dial_code:"+1268",emoji:"🇦🇬",code:"AG"},{name:"Argentina",dial_code:"+54",emoji:"🇦🇷",code:"AR"},{name:"Armenia",dial_code:"+374",emoji:"🇦🇲",code:"AM"},{name:"Aruba",dial_code:"+297",emoji:"🇦🇼",code:"AW"},{name:"Australia",dial_code:"+61",emoji:"🇦🇺",code:"AU"},{name:"Austria",dial_code:"+43",emoji:"🇦🇹",code:"AT"},{name:"Azerbaijan",dial_code:"+994",emoji:"🇦🇿",code:"AZ"},{name:"Bahamas",dial_code:"+1242",emoji:"🇧🇸",code:"BS"},{name:"Bahrain",dial_code:"+973",emoji:"🇧🇭",code:"BH"},{name:"Bangladesh",dial_code:"+880",emoji:"🇧🇩",code:"BD"},{name:"Barbados",dial_code:"+1246",emoji:"🇧🇧",code:"BB"},{name:"Belarus",dial_code:"+375",emoji:"🇧🇾",code:"BY"},{name:"Belgium",dial_code:"+32",emoji:"🇧🇪",code:"BE"},{name:"Belize",dial_code:"+501",emoji:"🇧🇿",code:"BZ"},{name:"Benin",dial_code:"+229",emoji:"🇧🇯",code:"BJ"},{name:"Bermuda",dial_code:"+1441",emoji:"🇧🇲",code:"BM"},{name:"Bhutan",dial_code:"+975",emoji:"🇧🇹",code:"BT"},{name:"Bolivia, Plurinational State of",dial_code:"+591",emoji:"🇧🇴",code:"BO"},{name:"Bosnia and Herzegovina",dial_code:"+387",emoji:"🇧🇦",code:"BA"},{name:"Botswana",dial_code:"+267",emoji:"🇧🇼",code:"BW"},{name:"Brazil",dial_code:"+55",emoji:"🇧🇷",code:"BR"},{name:"British Indian Ocean Territory",dial_code:"+246",emoji:"🇮🇴",code:"IO"},{name:"Brunei Darussalam",dial_code:"+673",emoji:"🇧🇳",code:"BN"},{name:"Bulgaria",dial_code:"+359",emoji:"🇧🇬",code:"BG"},{name:"Burkina Faso",dial_code:"+226",emoji:"🇧🇫",code:"BF"},{name:"Burundi",dial_code:"+257",emoji:"🇧🇮",code:"BI"},{name:"Cambodia",dial_code:"+855",emoji:"🇰🇭",code:"KH"},{name:"Cameroon",dial_code:"+237",emoji:"🇨🇲",code:"CM"},{name:"Canada",dial_code:"+1",emoji:"🇨🇦",code:"CA"},{name:"Cape Verde",dial_code:"+238",emoji:"🇨🇻",code:"CV"},{name:"Cayman Islands",dial_code:"+345",emoji:"🇰🇾",code:"KY"},{name:"Central African Republic",dial_code:"+236",emoji:"🇨🇫",code:"CF"},{name:"Chad",dial_code:"+235",emoji:"🇹🇩",code:"TD"},{name:"Chile",dial_code:"+56",emoji:"🇨🇱",code:"CL"},{name:"China",dial_code:"+86",emoji:"🇨🇳",code:"CN"},{name:"Christmas Island",dial_code:"+61",emoji:"🇨🇽",code:"CX"},{name:"Cocos (Keeling) Islands",dial_code:"+61",emoji:"🇨🇨",code:"CC"},{name:"Colombia",dial_code:"+57",emoji:"🇨🇴",code:"CO"},{name:"Comoros",dial_code:"+269",emoji:"🇰🇲",code:"KM"},{name:"Congo",dial_code:"+242",emoji:"🇨🇬",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dial_code:"+243",emoji:"🇨🇩",code:"CD"},{name:"Cook Islands",dial_code:"+682",emoji:"🇨🇰",code:"CK"},{name:"Costa Rica",dial_code:"+506",emoji:"🇨🇷",code:"CR"},{name:"Cote d'Ivoire",dial_code:"+225",emoji:"🇨🇮",code:"CI"},{name:"Croatia",dial_code:"+385",emoji:"🇭🇷",code:"HR"},{name:"Cuba",dial_code:"+53",emoji:"🇨🇺",code:"CU"},{name:"Cyprus",dial_code:"+357",emoji:"🇨🇾",code:"CY"},{name:"Czech Republic",dial_code:"+420",emoji:"🇨🇿",code:"CZ"},{name:"Denmark",dial_code:"+45",emoji:"🇩🇰",code:"DK"},{name:"Djibouti",dial_code:"+253",emoji:"🇩🇯",code:"DJ"},{name:"Dominica",dial_code:"+1767",emoji:"🇩🇲",code:"DM"},{name:"Dominican Republic",dial_code:"+1849",emoji:"🇩🇴",code:"DO"},{name:"Ecuador",dial_code:"+593",emoji:"🇪🇨",code:"EC"},{name:"Egypt",dial_code:"+20",emoji:"🇪🇬",code:"EG"},{name:"El Salvador",dial_code:"+503",emoji:"🇸🇻",code:"SV"},{name:"Equatorial Guinea",dial_code:"+240",emoji:"🇬🇶",code:"GQ"},{name:"Eritrea",dial_code:"+291",emoji:"🇪🇷",code:"ER"},{name:"Estonia",dial_code:"+372",emoji:"🇪🇪",code:"EE"},{name:"Ethiopia",dial_code:"+251",emoji:"🇪🇹",code:"ET"},{name:"Falkland Islands (Malvinas)",dial_code:"+500",emoji:"🇫🇰",code:"FK"},{name:"Faroe Islands",dial_code:"+298",emoji:"🇫🇴",code:"FO"},{name:"Fiji",dial_code:"+679",emoji:"🇫🇯",code:"FJ"},{name:"Finland",dial_code:"+358",emoji:"🇫🇮",code:"FI"},{name:"France",dial_code:"+33",emoji:"🇫🇷",code:"FR"},{name:"French Guiana",dial_code:"+594",emoji:"🇬🇫",code:"GF"},{name:"French Polynesia",dial_code:"+689",emoji:"🇵🇫",code:"PF"},{name:"Gabon",dial_code:"+241",emoji:"🇬🇦",code:"GA"},{name:"Gambia",dial_code:"+220",emoji:"🇬🇲",code:"GM"},{name:"Georgia",dial_code:"+995",emoji:"🇬🇪",code:"GE"},{name:"Germany",dial_code:"+49",emoji:"🇩🇪",code:"DE"},{name:"Ghana",dial_code:"+233",emoji:"🇬🇭",code:"GH"},{name:"Gibraltar",dial_code:"+350",emoji:"🇬🇮",code:"GI"},{name:"Greece",dial_code:"+30",emoji:"🇬🇷",code:"GR"},{name:"Greenland",dial_code:"+299",emoji:"🇬🇱",code:"GL"},{name:"Grenada",dial_code:"+1473",emoji:"🇬🇩",code:"GD"},{name:"Guadeloupe",dial_code:"+590",emoji:"🇬🇵",code:"GP"},{name:"Guam",dial_code:"+1671",emoji:"🇬🇺",code:"GU"},{name:"Guatemala",dial_code:"+502",emoji:"🇬🇹",code:"GT"},{name:"Guernsey",dial_code:"+44",emoji:"🇬🇬",code:"GG"},{name:"Guinea",dial_code:"+224",emoji:"🇬🇳",code:"GN"},{name:"Guinea-Bissau",dial_code:"+245",emoji:"🇬🇼",code:"GW"},{name:"Guyana",dial_code:"+595",emoji:"🇬🇾",code:"GY"},{name:"Haiti",dial_code:"+509",emoji:"🇭🇹",code:"HT"},{name:"Holy See (Vatican City State)",dial_code:"+379",emoji:"🇻🇦",code:"VA"},{name:"Honduras",dial_code:"+504",emoji:"🇭🇳",code:"HN"},{name:"Hong Kong",dial_code:"+852",emoji:"🇭🇰",code:"HK"},{name:"Hungary",dial_code:"+36",emoji:"🇭🇺",code:"HU"},{name:"Iceland",dial_code:"+354",emoji:"🇮🇸",code:"IS"},{name:"India",dial_code:"+91",emoji:"🇮🇳",code:"IN"},{name:"Indonesia",dial_code:"+62",emoji:"🇮🇩",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dial_code:"+98",emoji:"🇮🇷",code:"IR"},{name:"Iraq",dial_code:"+964",emoji:"🇮🇷",code:"IQ"},{name:"Ireland",dial_code:"+353",emoji:"🇮🇪",code:"IE"},{name:"Isle of Man",dial_code:"+44",emoji:"🇮🇲",code:"IM"},{name:"Israel",dial_code:"+972",emoji:"🇮🇱",code:"IL"},{name:"Italy",dial_code:"+39",emoji:"🇮🇹",code:"IT"},{name:"Jamaica",dial_code:"+1876",emoji:"🇯🇲",code:"JM"},{name:"Japan",dial_code:"+81",emoji:"🇯🇵",code:"JP"},{name:"Jersey",dial_code:"+44",emoji:"🇯🇪",code:"JE"},{name:"Jordan",dial_code:"+962",emoji:"🇯🇴",code:"JO"},{name:"Kazakhstan",dial_code:"+77",emoji:"🇰🇿",code:"KZ"},{name:"Kenya",dial_code:"+254",emoji:"🇰🇪",code:"KE"},{name:"Kiribati",dial_code:"+686",emoji:"🇰🇮",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dial_code:"+850",emoji:"🇰🇵",code:"KP"},{name:"Korea, Republic of South Korea",dial_code:"+82",emoji:"🇰🇷",code:"KR"},{name:"Kuwait",dial_code:"+965",emoji:"🇰🇼",code:"KW"},{name:"Kyrgyzstan",dial_code:"+996",emoji:"🇰🇬",code:"KG"},{name:"Laos",dial_code:"+856",emoji:"🇱🇦",code:"LA"},{name:"Latvia",dial_code:"+371",emoji:"🇱🇻",code:"LV"},{name:"Lebanon",dial_code:"+961",emoji:"🇱🇧",code:"LB"},{name:"Lesotho",dial_code:"+266",emoji:"🇱🇸",code:"LS"},{name:"Liberia",dial_code:"+231",emoji:"🇱🇷",code:"LR"},{name:"Libyan Arab Jamahiriya",dial_code:"+218",emoji:"🇱🇾",code:"LY"},{name:"Liechtenstein",dial_code:"+423",emoji:"🇱🇮",code:"LI"},{name:"Lithuania",dial_code:"+370",emoji:"🇱🇹",code:"LT"},{name:"Luxembourg",dial_code:"+352",emoji:"🇱🇺",code:"LU"},{name:"Macao",dial_code:"+853",emoji:"🇲🇴",code:"MO"},{name:"Macedonia",dial_code:"+389",emoji:"🇲🇰",code:"MK"},{name:"Madagascar",dial_code:"+261",emoji:"🇲🇬",code:"MG"},{name:"Malawi",dial_code:"+265",emoji:"🇲🇼",code:"MW"},{name:"Malaysia",dial_code:"+60",emoji:"🇲🇾",code:"MY"},{name:"Maldives",dial_code:"+960",emoji:"🇲🇻",code:"MV"},{name:"Mali",dial_code:"+223",emoji:"🇲🇱",code:"ML"},{name:"Malta",dial_code:"+356",emoji:"🇲🇹",code:"MT"},{name:"Marshall Islands",dial_code:"+692",emoji:"🇲🇭",code:"MH"},{name:"Martinique",dial_code:"+596",emoji:"🇲🇶",code:"MQ"},{name:"Mauritania",dial_code:"+222",emoji:"🇲🇷",code:"MR"},{name:"Mauritius",dial_code:"+230",emoji:"🇲🇺",code:"MU"},{name:"Mayotte",dial_code:"+262",emoji:"🇾🇹",code:"YT"},{name:"Mexico",dial_code:"+52",emoji:"🇲🇽",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dial_code:"+691",emoji:"🇫🇲",code:"FM"},{name:"Moldova",dial_code:"+373",emoji:"🇲🇩",code:"MD"},{name:"Monaco",dial_code:"+377",emoji:"🇲🇨",code:"MC"},{name:"Mongolia",dial_code:"+976",emoji:"🇲🇳",code:"MN"},{name:"Montenegro",dial_code:"+382",emoji:"🇲🇪",code:"ME"},{name:"Montserrat",dial_code:"+1664",emoji:"🇲🇸",code:"MS"},{name:"Morocco",dial_code:"+212",emoji:"🇲🇦",code:"MA"},{name:"Mozambique",dial_code:"+258",emoji:"🇲🇿",code:"MZ"},{name:"Myanmar",dial_code:"+95",emoji:"🇲🇲",code:"MM"},{name:"Namibia",emoji:"🇳🇦",dial_code:"+264",code:"NA"},{name:"Nauru",dial_code:"+674",emoji:"🇳🇷",code:"NR"},{name:"Nepal",dial_code:"+977",emoji:"🇳🇵",code:"NP"},{name:"Netherlands",dial_code:"+31",emoji:"🇳🇱",code:"NL"},{name:"Netherlands Antilles",dial_code:"+599",emoji:"🇧🇶",code:"AN"},{name:"New Caledonia",dial_code:"+687",emoji:"🇳🇨",code:"NC"},{name:"New Zealand",dial_code:"+64",emoji:"🇳🇿",code:"NZ"},{name:"Nicaragua",dial_code:"+505",emoji:"🇳🇮",code:"NI"},{name:"Niger",dial_code:"+227",emoji:"🇳🇪",code:"NE"},{name:"Nigeria",dial_code:"+234",emoji:"🇳🇬",code:"NG"},{name:"Niue",dial_code:"+683",emoji:"🇳🇺",code:"NU"},{name:"Norfolk Island",dial_code:"+672",emoji:"🇳🇫",code:"NF"},{name:"Northern Mariana Islands",dial_code:"+1670",emoji:"🇲🇵",code:"MP"},{name:"Norway",dial_code:"+47",emoji:"🇳🇴",code:"NO"},{name:"Oman",dial_code:"+968",emoji:"🇴🇲",code:"OM"},{name:"Pakistan",dial_code:"+92",emoji:"🇵🇰",code:"PK"},{name:"Palau",dial_code:"+680",emoji:"🇵🇼",code:"PW"},{name:"Palestinian Territory, Occupied",dial_code:"+970",emoji:"🇵🇸",code:"PS"},{name:"Panama",dial_code:"+507",emoji:"🇵🇦",code:"PA"},{name:"Papua New Guinea",dial_code:"+675",emoji:"🇵🇬",code:"PG"},{name:"Paraguay",dial_code:"+595",emoji:"🇵🇾",code:"PY"},{name:"Peru",dial_code:"+51",emoji:"🇵🇪",code:"PE"},{name:"Philippines",dial_code:"+63",emoji:"🇵🇭",code:"PH"},{name:"Pitcairn",dial_code:"+872",emoji:"🇵🇳",code:"PN"},{name:"Poland",dial_code:"+48",emoji:"🇵🇱",code:"PL"},{name:"Portugal",dial_code:"+351",emoji:"🇵🇹",code:"PT"},{name:"Puerto Rico",dial_code:"+1939",emoji:"🇵🇷",code:"PR"},{name:"Qatar",dial_code:"+974",emoji:"🇶🇦",code:"QA"},{name:"Romania",dial_code:"+40",emoji:"🇷🇴",code:"RO"},{name:"Russia",dial_code:"+7",emoji:"🇷🇺",code:"RU"},{name:"Rwanda",dial_code:"+250",emoji:"🇷🇼",code:"RW"},{name:"Reunion",dial_code:"+262",emoji:"🇷🇪",code:"RE"},{name:"Saint Barthelemy",dial_code:"+590",emoji:"🇧🇱",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dial_code:"+290",emoji:"🇸🇭",code:"SH"},{name:"Saint Kitts and Nevis",dial_code:"+1869",emoji:"🇰🇳",code:"KN"},{name:"Saint Lucia",dial_code:"+1758",emoji:"🇱🇨",code:"LC"},{name:"Saint Martin",dial_code:"+590",emoji:"🇲🇫",code:"MF"},{name:"Saint Pierre and Miquelon",dial_code:"+508",emoji:"🇵🇲",code:"PM"},{name:"Saint Vincent and the Grenadines",dial_code:"+1784",emoji:"🇻🇨",code:"VC"},{name:"Samoa",dial_code:"+685",emoji:"🇼🇸",code:"WS"},{name:"San Marino",dial_code:"+378",emoji:"🇸🇲",code:"SM"},{name:"Sao Tome and Principe",dial_code:"+239",emoji:"🇸🇹",code:"ST"},{name:"Saudi Arabia",dial_code:"+966",emoji:"🇸🇦",code:"SA"},{name:"Senegal",dial_code:"+221",emoji:"🇸🇳",code:"SN"},{name:"Serbia",dial_code:"+381",emoji:"🇷🇸",code:"RS"},{name:"Seychelles",dial_code:"+248",emoji:"🇸🇨",code:"SC"},{name:"Sierra Leone",dial_code:"+232",emoji:"🇸🇱",code:"SL"},{name:"Singapore",dial_code:"+65",emoji:"🇸🇬",code:"SG"},{name:"Slovakia",dial_code:"+421",emoji:"🇸🇰",code:"SK"},{name:"Slovenia",dial_code:"+386",emoji:"🇸🇮",code:"SI"},{name:"Solomon Islands",dial_code:"+677",emoji:"🇸🇧",code:"SB"},{name:"Somalia",dial_code:"+252",emoji:"🇸🇴",code:"SO"},{name:"South Africa",dial_code:"+27",emoji:"🇿🇦",code:"ZA"},{name:"South Sudan",dial_code:"+211",emoji:"🇸🇸",code:"SS"},{name:"South Georgia and the South Sandwich Islands",dial_code:"+500",emoji:"🇬🇸",code:"GS"},{name:"Spain",dial_code:"+34",emoji:"🇪🇸",code:"ES"},{name:"Sri Lanka",dial_code:"+94",emoji:"🇱🇰",code:"LK"},{name:"Sudan",dial_code:"+249",emoji:"🇸🇩",code:"SD"},{name:"Suriname",dial_code:"+597",emoji:"🇸🇷",code:"SR"},{name:"Svalbard and Jan Mayen",dial_code:"+47",emoji:"🇸🇯",code:"SJ"},{name:"Swaziland",dial_code:"+268",emoji:"🇸🇿",code:"SZ"},{name:"Sweden",dial_code:"+46",emoji:"🇸🇪",code:"SE"},{name:"Switzerland",dial_code:"+41",emoji:"🇨🇭",code:"CH"},{name:"Syrian Arab Republic",dial_code:"+963",emoji:"🇸🇾",code:"SY"},{name:"Taiwan",dial_code:"+886",emoji:"🇹🇼",code:"TW"},{name:"Tajikistan",dial_code:"+992",emoji:"🇹🇯",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dial_code:"+255",emoji:"🇹🇿",code:"TZ"},{name:"Thailand",dial_code:"+66",emoji:"🇹🇭",code:"TH"},{name:"Timor-Leste",dial_code:"+670",emoji:"🇹🇱",code:"TL"},{name:"Togo",dial_code:"+228",emoji:"🇹🇬",code:"TG"},{name:"Tokelau",dial_code:"+690",emoji:"🇹🇰",code:"TK"},{name:"Tonga",dial_code:"+676",emoji:"🇹🇴",code:"TO"},{name:"Trinidad and Tobago",dial_code:"+1868",emoji:"🇹🇹",code:"TT"},{name:"Tunisia",dial_code:"+216",emoji:"🇹🇳",code:"TN"},{name:"Turkey",dial_code:"+90",emoji:"🇹🇷",code:"TR"},{name:"Turkmenistan",dial_code:"+993",emoji:"🇹🇲",code:"TM"},{name:"Turks and Caicos Islands",dial_code:"+1649",emoji:"🇹🇨",code:"TC"},{name:"Tuvalu",dial_code:"+688",emoji:"🇹🇻",code:"TV"},{name:"Uganda",dial_code:"+256",emoji:"🇺🇬",code:"UG"},{name:"Ukraine",dial_code:"+380",emoji:"🇺🇦",code:"UA"},{name:"United Arab Emirates",dial_code:"+971",emoji:"🇦🇪",code:"AE"},{name:"United Kingdom",dial_code:"+44",emoji:"🇬🇧",code:"GB"},{name:"United States",dial_code:"+1",emoji:"🇺🇸",code:"US"},{name:"Uruguay",dial_code:"+598",emoji:"🇺🇾",code:"UY"},{name:"Uzbekistan",dial_code:"+998",emoji:"🇺🇿",code:"UZ"},{name:"Vanuatu",dial_code:"+678",emoji:"🇻🇺",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dial_code:"+58",emoji:"🇻🇪",code:"VE"},{name:"Vietnam",dial_code:"+84",emoji:"🇻🇳",code:"VN"},{name:"Virgin Islands, British",dial_code:"+1284",emoji:"🇻🇬",code:"VG"},{name:"Virgin Islands, U.S.",dial_code:"+1340",emoji:"🇻🇮",code:"VI"},{name:"Wallis and Futuna",dial_code:"+681",emoji:"🇼🇫",code:"WF"},{name:"Yemen",dial_code:"+967",emoji:"🇾🇪",code:"YE"},{name:"Zambia",dial_code:"+260",emoji:"🇿🇲",code:"ZM"},{name:"Zimbabwe",dial_code:"+263",emoji:"🇿🇼",code:"ZW"}],xn=({placeholder:e})=>{const[o,t]=u.useState(ht),[n,i]=u.useState(e??ht[0].name),[a,l]=u.useState(!0),[d,s]=u.useState(!1),[g,p]=u.useState(!1);return{hide:a,setHide:l,newOptions:o,setNewOptions:t,isHovered:g,setIsHovered:p,isFocused:d,setIsFocused:s,value:n,setValue:i}},tr={xs:8,sm:10,md:12,lg:14,xl:16},Ks=({size:e,...o})=>r.jsx(c.Element,{as:"ul",...o}),Qs=e=>r.jsx(c.Input,{type:"country",...e}),Zs=({size:e,...o})=>r.jsx(c.Element,{as:"li",...o}),Js=({option:e,size:o="md",callback:t=()=>{},views:n={text:{}}})=>{const i=a=>{a&&a.stopPropagation&&a.stopPropagation(),t(e)};return r.jsx(Zs,{margin:0,role:"DropDownItem",listStyleType:"none",fontWeight:"normal",paddingVertical:6,paddingHorizontal:12,onClick:i,fontSize:c.Typography.fontSizes[o],_hover:{opacity:.8},...n.text,children:e})},ed=({size:e,views:o={dropDown:{}},options:t=[],callback:n=()=>{}})=>{const i=a=>n(a);return r.jsx(Ks,{role:"dropDown",margin:0,padding:0,top:"100%",width:"100%",display:"flex",zIndex:1e3,overflow:"auto",maxHeight:"300px",borderRadius:4,position:"absolute",flexDirection:"column",backgroundColor:"color-white",boxShadow:"rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px",...o.dropDown,children:t.map(a=>r.jsx(Js,{size:e,option:a.name,callback:i,...o.text},a.code))})},bn=({id:e,name:o,label:t,value:n,placeholder:i,helperText:a,hide:l=!1,error:d=!1,isHovered:s=!1,isFocused:g=!1,isAutoFocus:p=!1,isDisabled:m=!1,isReadOnly:h=!1,shadow:f={},newOptions:x=[],size:y="md",variant:b="default",shape:k="default",onChange:S,onBlur:w=()=>{},setHide:j=()=>{},setNewOptions:C=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setValue:R=()=>{},views:V={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:_,...T})=>{const{getColor:W,themeMode:B}=c.useTheme(),P=W("color-blueGray-700",{themeMode:_||B}),z=()=>M(!0),$=D=>{j(!l),R(D),S&&S(D)},E=()=>{!m&&!h&&j(!l)},H=D=>{const q=D.target.value,K=ht.filter(Y=>Y.name.toLowerCase().startsWith(q.toLowerCase()));l&&j(!1),C(K),S&&S(q)},L=D=>{w(D),M(!1)},A=!!(t&&(g||n)),F={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[y],backgroundColor:"transparent",color:m?"color-trueGray-600":"color-blueGray-700",cursor:m?"not-allowed":h?"auto":"pointer",...V.field};return r.jsxs(we,{helperText:a,error:d,views:V,onClick:E,children:[r.jsxs(Ve,{label:t,size:y,error:d,shape:k,views:V,shadow:f,variant:b,value:n,color:"theme-primary",isDisabled:m,isReadOnly:h,isFocused:g,showLabel:A,_hover:!m&&!d?{borderColor:"theme-primary"}:void 0,children:[r.jsxs(Qe,{children:[A&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...V,children:t}),r.jsx(Qs,{id:e,name:o,placeholder:i,readOnly:h,disabled:m,autoFocus:p,onBlur:L,onFocus:z,...F,...T,value:n,onChange:H})]}),r.jsx(Bt,{children:l?r.jsx(ae,{orientation:"down",widthHeight:tr[y],color:P,style:V.icon}):r.jsx(ae,{orientation:"up",widthHeight:tr[y],color:P,style:V.icon})})]}),!l&&r.jsx(ed,{size:y,views:V,options:x,callback:$})]})},od=e=>{const o=xn(e);return r.jsx(bn,{...o,...e})},td=od;function Bo(e){"@babel/helpers - typeof";return Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Bo(e)}function ge(e,o){if(o.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+o.length+" present")}function rd(e){return ge(1,arguments),e instanceof Date||Bo(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function je(e){ge(1,arguments);var o=Object.prototype.toString.call(e);return e instanceof Date||Bo(e)==="object"&&o==="[object Date]"?new Date(e.getTime()):typeof e=="number"||o==="[object Number]"?new Date(e):((typeof e=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function nd(e){if(ge(1,arguments),!rd(e)&&typeof e!="number")return!1;var o=je(e);return!isNaN(Number(o))}function $e(e){if(e===null||e===!0||e===!1)return NaN;var o=Number(e);return isNaN(o)?o:o<0?Math.ceil(o):Math.floor(o)}function ad(e,o){ge(2,arguments);var t=je(e).getTime(),n=$e(o);return new Date(t+n)}function id(e,o){ge(2,arguments);var t=$e(o);return ad(e,-t)}var ld=864e5;function cd(e){ge(1,arguments);var o=je(e),t=o.getTime();o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0);var n=o.getTime(),i=t-n;return Math.floor(i/ld)+1}function Lo(e){ge(1,arguments);var o=1,t=je(e),n=t.getUTCDay(),i=(n<o?7:0)+n-o;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}function yn(e){ge(1,arguments);var o=je(e),t=o.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var i=Lo(n),a=new Date(0);a.setUTCFullYear(t,0,4),a.setUTCHours(0,0,0,0);var l=Lo(a);return o.getTime()>=i.getTime()?t+1:o.getTime()>=l.getTime()?t:t-1}function sd(e){ge(1,arguments);var o=yn(e),t=new Date(0);t.setUTCFullYear(o,0,4),t.setUTCHours(0,0,0,0);var n=Lo(t);return n}var dd=6048e5;function ud(e){ge(1,arguments);var o=je(e),t=Lo(o).getTime()-sd(o).getTime();return Math.round(t/dd)+1}var gd={};function Qo(){return gd}function Ao(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=Qo(),m=$e((t=(n=(i=(a=o==null?void 0:o.weekStartsOn)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&i!==void 0?i:p.weekStartsOn)!==null&&n!==void 0?n:(s=p.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.weekStartsOn)!==null&&t!==void 0?t:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=je(e),f=h.getUTCDay(),x=(f<m?7:0)+f-m;return h.setUTCDate(h.getUTCDate()-x),h.setUTCHours(0,0,0,0),h}function kn(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=je(e),m=p.getUTCFullYear(),h=Qo(),f=$e((t=(n=(i=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:h.firstWeekContainsDate)!==null&&n!==void 0?n:(s=h.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(m+1,0,f),x.setUTCHours(0,0,0,0);var y=Ao(x,o),b=new Date(0);b.setUTCFullYear(m,0,f),b.setUTCHours(0,0,0,0);var k=Ao(b,o);return p.getTime()>=y.getTime()?m+1:p.getTime()>=k.getTime()?m:m-1}function pd(e,o){var t,n,i,a,l,d,s,g;ge(1,arguments);var p=Qo(),m=$e((t=(n=(i=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&n!==void 0?n:(s=p.locale)===null||s===void 0||(g=s.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=kn(e,o),f=new Date(0);f.setUTCFullYear(h,0,m),f.setUTCHours(0,0,0,0);var x=Ao(f,o);return x}var md=6048e5;function hd(e,o){ge(1,arguments);var t=je(e),n=Ao(t,o).getTime()-pd(t,o).getTime();return Math.round(n/md)+1}function te(e,o){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length<o;)n="0"+n;return t+n}var Te={y:function(o,t){var n=o.getUTCFullYear(),i=n>0?n:1-n;return te(t==="yy"?i%100:i,t.length)},M:function(o,t){var n=o.getUTCMonth();return t==="M"?String(n+1):te(n+1,2)},d:function(o,t){return te(o.getUTCDate(),t.length)},a:function(o,t){var n=o.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(o,t){return te(o.getUTCHours()%12||12,t.length)},H:function(o,t){return te(o.getUTCHours(),t.length)},m:function(o,t){return te(o.getUTCMinutes(),t.length)},s:function(o,t){return te(o.getUTCSeconds(),t.length)},S:function(o,t){var n=t.length,i=o.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return te(a,t.length)}},De={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fd={G:function(o,t,n){var i=o.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(o,t,n){if(t==="yo"){var i=o.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Te.y(o,t)},Y:function(o,t,n,i){var a=kn(o,i),l=a>0?a:1-a;if(t==="YY"){var d=l%100;return te(d,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):te(l,t.length)},R:function(o,t){var n=yn(o);return te(n,t.length)},u:function(o,t){var n=o.getUTCFullYear();return te(n,t.length)},Q:function(o,t,n){var i=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return te(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(o,t,n){var i=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return te(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(o,t,n){var i=o.getUTCMonth();switch(t){case"M":case"MM":return Te.M(o,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(o,t,n){var i=o.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return te(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(o,t,n,i){var a=hd(o,i);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):te(a,t.length)},I:function(o,t,n){var i=ud(o);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):te(i,t.length)},d:function(o,t,n){return t==="do"?n.ordinalNumber(o.getUTCDate(),{unit:"date"}):Te.d(o,t)},D:function(o,t,n){var i=cd(o);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):te(i,t.length)},E:function(o,t,n){var i=o.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(o,t,n,i){var a=o.getUTCDay(),l=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return te(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(o,t,n,i){var a=o.getUTCDay(),l=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return te(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(o,t,n){var i=o.getUTCDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return te(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(o,t,n){var i=o.getUTCHours(),a=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(o,t,n){var i=o.getUTCHours(),a;switch(i===12?a=De.noon:i===0?a=De.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(o,t,n){var i=o.getUTCHours(),a;switch(i>=17?a=De.evening:i>=12?a=De.afternoon:i>=4?a=De.morning:a=De.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(o,t,n){if(t==="ho"){var i=o.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Te.h(o,t)},H:function(o,t,n){return t==="Ho"?n.ordinalNumber(o.getUTCHours(),{unit:"hour"}):Te.H(o,t)},K:function(o,t,n){var i=o.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):te(i,t.length)},k:function(o,t,n){var i=o.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):te(i,t.length)},m:function(o,t,n){return t==="mo"?n.ordinalNumber(o.getUTCMinutes(),{unit:"minute"}):Te.m(o,t)},s:function(o,t,n){return t==="so"?n.ordinalNumber(o.getUTCSeconds(),{unit:"second"}):Te.s(o,t)},S:function(o,t){return Te.S(o,t)},X:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();if(l===0)return"Z";switch(t){case"X":return nr(l);case"XXXX":case"XX":return We(l);case"XXXXX":case"XXX":default:return We(l,":")}},x:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"x":return nr(l);case"xxxx":case"xx":return We(l);case"xxxxx":case"xxx":default:return We(l,":")}},O:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rr(l,":");case"OOOO":default:return"GMT"+We(l,":")}},z:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rr(l,":");case"zzzz":default:return"GMT"+We(l,":")}},t:function(o,t,n,i){var a=i._originalDate||o,l=Math.floor(a.getTime()/1e3);return te(l,t.length)},T:function(o,t,n,i){var a=i._originalDate||o,l=a.getTime();return te(l,t.length)}};function rr(e,o){var t=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return t+String(i);var l=o;return t+String(i)+l+te(a,2)}function nr(e,o){if(e%60===0){var t=e>0?"-":"+";return t+te(Math.abs(e)/60,2)}return We(e,o)}function We(e,o){var t=o||"",n=e>0?"-":"+",i=Math.abs(e),a=te(Math.floor(i/60),2),l=te(i%60,2);return n+a+t+l}var ar=function(o,t){switch(o){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},jn=function(o,t){switch(o){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},xd=function(o,t){var n=o.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return ar(o,t);var l;switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",ar(i,t)).replace("{{time}}",jn(a,t))},bd={p:jn,P:xd};function yd(e){var o=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return o.setUTCFullYear(e.getFullYear()),e.getTime()-o.getTime()}var kd=["D","DD"],jd=["YY","YYYY"];function Cd(e){return kd.indexOf(e)!==-1}function Sd(e){return jd.indexOf(e)!==-1}function ir(e,o,t){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(o,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(o,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(o,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(o,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var wd={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Id=function(o,t,n){var i,a=wd[o];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function at(e){return function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=o.width?String(o.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var Td={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Md={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rd={date:at({formats:Td,defaultWidth:"full"}),time:at({formats:Md,defaultWidth:"full"}),dateTime:at({formats:zd,defaultWidth:"full"})},Vd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ed=function(o,t,n,i){return Vd[o]};function no(e){return function(o,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,l=t!=null&&t.width?String(t.width):a;i=e.formattingValues[l]||e.formattingValues[a]}else{var d=e.defaultWidth,s=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[s]||e.values[d]}var g=e.argumentCallback?e.argumentCallback(o):o;return i[g]}}var Pd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},_d={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$d={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Hd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Bd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ld=function(o,t){var n=Number(o),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Ad={ordinalNumber:Ld,era:no({values:Pd,defaultWidth:"wide"}),quarter:no({values:Wd,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:no({values:_d,defaultWidth:"wide"}),day:no({values:$d,defaultWidth:"wide"}),dayPeriod:no({values:Hd,defaultWidth:"wide",formattingValues:Bd,defaultFormattingWidth:"wide"})};function ao(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=o.match(i);if(!a)return null;var l=a[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(d)?Fd(d,function(m){return m.test(l)}):Dd(d,function(m){return m.test(l)}),g;g=e.valueCallback?e.valueCallback(s):s,g=t.valueCallback?t.valueCallback(g):g;var p=o.slice(l.length);return{value:g,rest:p}}}function Dd(e,o){for(var t in e)if(e.hasOwnProperty(t)&&o(e[t]))return t}function Fd(e,o){for(var t=0;t<e.length;t++)if(o(e[t]))return t}function Od(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=o.match(e.matchPattern);if(!n)return null;var i=n[0],a=o.match(e.parsePattern);if(!a)return null;var l=e.valueCallback?e.valueCallback(a[0]):a[0];l=t.valueCallback?t.valueCallback(l):l;var d=o.slice(i.length);return{value:l,rest:d}}}var qd=/^(\d+)(th|st|nd|rd)?/i,Nd=/\d+/i,Ud={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Gd={any:[/^b/i,/^(a|c)/i]},Yd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vd={any:[/1/i,/2/i,/3/i,/4/i]},Xd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Kd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Qd={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Zd={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Jd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},eu={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ou={ordinalNumber:Od({matchPattern:qd,parsePattern:Nd,valueCallback:function(o){return parseInt(o,10)}}),era:ao({matchPatterns:Ud,defaultMatchWidth:"wide",parsePatterns:Gd,defaultParseWidth:"any"}),quarter:ao({matchPatterns:Yd,defaultMatchWidth:"wide",parsePatterns:vd,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:ao({matchPatterns:Xd,defaultMatchWidth:"wide",parsePatterns:Kd,defaultParseWidth:"any"}),day:ao({matchPatterns:Qd,defaultMatchWidth:"wide",parsePatterns:Zd,defaultParseWidth:"any"}),dayPeriod:ao({matchPatterns:Jd,defaultMatchWidth:"any",parsePatterns:eu,defaultParseWidth:"any"})},tu={code:"en-US",formatDistance:Id,formatLong:Rd,formatRelative:Ed,localize:Ad,match:ou,options:{weekStartsOn:0,firstWeekContainsDate:1}},ru=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nu=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,au=/^'([^]*?)'?$/,iu=/''/g,lu=/[a-zA-Z]/;function cu(e,o,t){var n,i,a,l,d,s,g,p,m,h,f,x,y,b;ge(2,arguments);var k=String(o),S=Qo(),w=(n=(i=void 0)!==null&&i!==void 0?i:S.locale)!==null&&n!==void 0?n:tu,j=$e((a=(l=(d=(s=void 0)!==null&&s!==void 0?s:void 0)!==null&&d!==void 0?d:S.firstWeekContainsDate)!==null&&l!==void 0?l:(g=S.locale)===null||g===void 0||(p=g.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(j>=1&&j<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var C=$e((m=(h=(f=(x=void 0)!==null&&x!==void 0?x:void 0)!==null&&f!==void 0?f:S.weekStartsOn)!==null&&h!==void 0?h:(y=S.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&m!==void 0?m:0);if(!(C>=0&&C<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!w.localize)throw new RangeError("locale must contain localize property");if(!w.formatLong)throw new RangeError("locale must contain formatLong property");var I=je(e);if(!nd(I))throw new RangeError("Invalid time value");var M=yd(I),R=id(I,M),V={firstWeekContainsDate:j,weekStartsOn:C,locale:w,_originalDate:I},_=k.match(nu).map(function(T){var W=T[0];if(W==="p"||W==="P"){var B=bd[W];return B(T,w.formatLong)}return T}).join("").match(ru).map(function(T){if(T==="''")return"'";var W=T[0];if(W==="'")return su(T);var B=fd[W];if(B)return Sd(T)&&ir(T,o,String(e)),Cd(T)&&ir(T,o,String(e)),B(R,T,w.localize,V);if(W.match(lu))throw new RangeError("Format string contains an unescaped latin alphabet character `"+W+"`");return T}).join("");return _}function su(e){var o=e.match(au);return o?o[1].replace(iu,"'"):e}const Cn=()=>{const[e,o]=u.useState(!1),[t,n]=u.useState(!1),[i,a]=u.useState(cu(new Date,"yyyy-MM-dd"));return{date:i,setDate:a,isHovered:e,setIsHovered:o,isFocused:t,setIsFocused:n}},du=e=>r.jsx(c.Input,{type:"date",...e}),Sn=({id:e,icon:o,name:t,label:n,date:i,children:a,helperText:l,shadow:d={},size:s="md",variant:g="default",shape:p="default",views:m={container:{},label:{},helperText:{},text:{},field:{}},error:h=!1,isHovered:f=!1,isFocused:x=!1,isDisabled:y=!1,isReadOnly:b=!1,setDate:k=()=>{},setIsFocused:S=()=>{},setIsHovered:w=()=>{},onChange:j,onChangeText:C,...I})=>{const M=!!(x&&n),R=()=>w(!f),V=()=>S(!0),_=W=>{typeof W=="string"?(k(W),C&&C(W)):(k(W.target.value),j&&j(W.target.value))},T={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none",backgroundColor:"transparent"}},fontSize:c.Typography.fontSizes[s],backgroundColor:"transparent",color:y?"color-trueGray-600":"color-blueGray-700",cursor:y?"not-allowed":b?"auto":"pointer",...m.field};return r.jsx(we,{helperText:l,error:h,views:m,children:r.jsx(Ve,{label:n,size:s,error:h,shape:p,views:m,shadow:d,color:"theme-primary",variant:g,value:i,isHovered:f,isDisabled:y,isReadOnly:b,isFocused:x,showLabel:M,onMouseEnter:R,onMouseLeave:R,children:r.jsxs(Qe,{children:[M&&r.jsx(He,{htmlFor:e,color:"theme-primary",error:h,...m,children:n}),r.jsx(du,{id:e,name:t,onFocus:V,disabled:y,readOnly:b,...T,...I,...C&&{onChangeText:_},onChange:_})]})})})},uu=e=>{const o=Cn();return r.jsx(Sn,{...o,...e})},gu=uu,wn=e=>{const o=Lt(e),[t,n]=u.useState(!1);return{isVisible:t,setIsVisible:n,...e,...o}},pu=({visibleIcon:e=r.jsx(zt,{widthHeight:14}),hiddenIcon:o=r.jsx(Mt,{widthHeight:14}),...t})=>{const{isVisible:n,setIsVisible:i,...a}=wn(t);return r.jsx(fo,{...a,type:n?"text":"password",isClearable:!1,right:r.jsx(c.View,{onClick:()=>{t.isDisabled||i(!n)},children:n?e:o})})},mu=pu,In=(e,o,t)=>{const[n,i]=u.useState(e),[a,l]=u.useState(o?{value:o,label:o}:e[0]),[d,s]=u.useState([]),[g,p]=u.useState(0),[m,h]=u.useState(t??""),[f,x]=u.useState(!1);return{filteredItems:n,setFilteredItems:i,selectedItem:a,setSelectedItem:l,selectedItems:d,setSelectedItems:s,highlightedIndex:g,setHighlightedIndex:p,searchQuery:m,setSearchQuery:h,isDropdownVisible:f,setIsDropdownVisible:x}},hu={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},lr={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},initial:{opacity:0,transform:"translateY(-8px) scale(0.96)"}},fu={padding:"8px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-100",backgroundColor:"color-gray-50",borderTopLeftRadius:"10px",borderTopRightRadius:"10px"},xu={padding:"8px 10px",cursor:"pointer",borderRadius:"6px",margin:"1px 4px",transition:"background-color 0.15s ease"},bu={padding:"24px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},cr={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},yu={display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"color-gray-100",borderRadius:"4px",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},Tn=({placeholder:e,items:o,showTick:t=!0,onSelect:n,searchEnabled:i=!0,left:a,right:l,label:d,filteredItems:s,setSelectedItem:g,selectedItem:p,selectedItems:m,setSelectedItems:h,highlightedIndex:f,setHighlightedIndex:x,searchQuery:y,setSearchQuery:b,setFilteredItems:k,views:S,isDropdownVisible:w,setIsDropdownVisible:j,isMulti:C=!1,...I})=>{const{ref:M,relation:R}=c.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),V=u.useRef(null),[_,T]=u.useState(!1),[W,B]=u.useState(!1),P=()=>{var q;const L=W?lr.enter:lr.initial;if(!M.current)return{};const A=M.current.getBoundingClientRect(),F={position:"fixed",left:A.left,width:A.width,zIndex:1e4,...L};return((q=R==null?void 0:R.space)==null?void 0:q.vertical)==="top"?{...F,bottom:window.innerHeight-A.top+6}:{...F,top:A.bottom+6}};u.useEffect(()=>{if(w){const L=setTimeout(()=>B(!0),10);return()=>clearTimeout(L)}B(!1)},[w]),u.useEffect(()=>{const L=A=>{!A.composedPath().some(q=>(q==null?void 0:q.id)==="combobox-dropdown")&&M.current&&!M.current.contains(A.target)&&j(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);const z=L=>{if(b(L),L==="")k(o);else{const A=o.filter(F=>F.label.toLowerCase().includes(L.toLowerCase()));k(A)}x(0)},$=L=>{if(C){const A=m.some(D=>D.value===L.value);let F;A?F=m.filter(D=>D.value!==L.value):F=[...m,L],h(F),n==null||n(F)}else g(L),n==null||n(L),j(!1)},E=(L,A)=>{L.stopPropagation();const F=m.filter(D=>D.value!==A.value);h(F),n==null||n(F)},H=L=>C?m.some(A=>A.value===L.value):L.value===p.value;return r.jsxs(c.Horizontal,{role:"combobox",flexWrap:"nowrap",gap:15,alignItems:"center",width:"100%",...I,children:[d&&r.jsx(c.Text,{views:S==null?void 0:S.label,htmlFor:I.id,children:d}),r.jsxs(c.View,{position:"relative",width:"100%",children:[r.jsx("div",{ref:M,onClick:()=>j(!w),style:{width:"100%"},children:r.jsxs(Ve,{isHovered:_,isFocused:w,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),cursor:"pointer",views:{container:S==null?void 0:S.container},children:[r.jsxs(c.Horizontal,{gap:10,alignItems:"center",width:"100%",flexWrap:C?"wrap":"nowrap",...S==null?void 0:S.labelContainer,children:[a,C?m.length>0?r.jsx(c.Horizontal,{gap:6,flexWrap:"wrap",alignItems:"center",children:m.map(L=>r.jsxs(c.Horizontal,{...yu,_hover:{backgroundColor:"color-gray-200"},children:[L.icon&&r.jsx(c.View,{flexShrink:0,children:L.icon}),r.jsx(c.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:L.label}),r.jsx(fe,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:A=>E(A,L)})]},L.value))}):r.jsx(c.Text,{weight:"medium",flexGrow:1,color:"color-gray-500",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...S==null?void 0:S.label,children:e}):r.jsxs(r.Fragment,{children:[p.icon&&p.label!==e&&r.jsx(c.View,{children:p.icon}),r.jsx(c.Text,{weight:"medium",flexGrow:1,color:p.label===e?"color-gray-500":"color-gray-800",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...S==null?void 0:S.label,children:p.label})]})]}),r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[l,r.jsx(c.View,{style:w?cr.open:cr.closed,children:r.jsx(ae,{widthHeight:16,orientation:"down",color:w?"color-gray-700":"color-gray-400"})})]})]})}),w&&r.jsx(on,{children:r.jsxs(c.View,{ref:V,id:"combobox-dropdown",role:"listbox","aria-labelledby":I.id,...hu,style:P(),...S==null?void 0:S.dropdown,children:[i&&r.jsx(c.View,{...fu,children:r.jsx(fo,{id:`${I.id}-search`,name:`${I.name}-search`,width:"100%",type:"search",autoFocus:!0,value:y,onChange:L=>z(L),hint:e||"Search...",isClearable:!1,left:r.jsx(Po,{widthHeight:14,color:"color-gray-400"}),views:{container:{width:"100%",padding:"0",backgroundColor:"transparent",borderColor:"color-gray-200",...S==null?void 0:S.text},field:{fontSize:"13px"}}})}),s.length>0&&r.jsx(c.View,{margin:0,padding:"4px",children:s.map((L,A)=>{const F=H(L),D=A===f;return r.jsxs(c.Horizontal,{role:"option","aria-selected":F,justifyContent:"space-between",alignItems:"center",...xu,backgroundColor:F&&D?"rgba(59, 130, 246, 0.12)":F?"rgba(59, 130, 246, 0.08)":D?"color-gray-100":"transparent",onMouseEnter:()=>x(A),onClick:()=>$(L),...S==null?void 0:S.item,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[L.icon&&r.jsx(c.View,{flexShrink:0,children:L.icon}),r.jsx(c.Text,{size:"sm",color:F?"theme-primary":"color-gray-800",weight:F?"medium":"normal",children:L.label})]}),F&&t&&r.jsx(No,{widthHeight:16,color:"theme-primary"})]},L.value)})}),s.length===0&&r.jsxs(c.Vertical,{...bu,children:[r.jsx(Po,{widthHeight:24,color:"color-gray-300"}),r.jsx(c.Text,{color:"color-gray-500",size:"sm",align:"center",children:"No results found"}),r.jsx(c.Text,{color:"color-gray-400",size:"xs",align:"center",children:"Try a different search term"})]})]})})]})]})},ku=({id:e,name:o,items:t,placeholder:n,searchPlaceholder:i,...a})=>{const l=In(t,n,i);return r.jsx(Tn,{id:e,name:o,items:t,...l,...a})},ju=ku,Mn=e=>{const{tags:o,defaultTags:t=[],onTagsChange:n,onTagAdd:i,onTagRemove:a,maxTags:l,minTagLength:d=1,maxTagLength:s=50,allowDuplicates:g=!1,separators:p=["enter","comma"],isDisabled:m=!1,isReadOnly:h=!1}=e,[f,x]=u.useState(""),[y,b]=u.useState(()=>(o||t||[]).map((P,z)=>({id:`tag-${z}-${Date.now()}`,value:P}))),[k,S]=u.useState(!1),[w,j]=u.useState(!1),C=o&&Array.isArray(o)?o.map((B,P)=>({id:`tag-${P}-${Date.now()}`,value:B})):y;u.useEffect(()=>{o&&Array.isArray(o)&&b(o.map((B,P)=>({id:`tag-${P}-${Date.now()}`,value:B})))},[o]);const I=u.useCallback(B=>{const P=B.trim();return!(P.length<d||P.length>s||!g&&C.map($=>$.value.toLowerCase()).includes(P.toLowerCase())||l&&C.length>=l)},[C,d,s,g,l]),M=u.useCallback(B=>{if(m||h)return;const P=B.trim();if(!P||!I(P))return;const z={id:`tag-${Date.now()}-${Math.random()}`,value:P},$=[...C,z],E=$.map(H=>H.value);o||b($),n==null||n(E),i==null||i(P),x("")},[C,I,n,i,m,h,o]),R=u.useCallback(B=>{if(m||h)return;const P=C[B];if(!P)return;const z=C.filter((E,H)=>H!==B),$=z.map(E=>E.value);o||b(z),n==null||n($),a==null||a(P.value,B)},[C,n,a,m,h,o]),V=u.useCallback(B=>{if(m||h)return;const P=B.target.value;if(p.includes("comma")&&P.includes(",")){const z=P.split(","),$=z[0],E=z.slice(1).join(",");$.trim()&&M($),x(E);return}x(P)},[M,p,m,h]),_=u.useCallback(B=>{if(m||h)return;const{key:P}=B;if(p.includes("enter")&&P==="Enter"){B.preventDefault(),f.trim()&&M(f);return}if(p.includes("tab")&&P==="Tab"&&f.trim()){B.preventDefault(),M(f);return}if(p.includes("space")&&P===" "&&f.trim()){B.preventDefault(),M(f);return}if(P==="Backspace"&&!f&&C.length>0){B.preventDefault(),R(C.length-1);return}},[M,R,f,C,p,m,h]),T=u.useCallback(()=>{var B;S(!0),(B=e.onFocus)==null||B.call(e)},[e.onFocus]),W=u.useCallback(()=>{var B;S(!1),f.trim()&&M(f),(B=e.onBlur)==null||B.call(e)},[M,f,e.onBlur]);return{inputValue:f,setInputValue:x,tags:C,setTags:b,isFocused:k,setIsFocused:S,isHovered:w,setIsHovered:j,addTag:M,removeTag:R,handleInputChange:V,handleKeyDown:_,handleFocus:T,handleBlur:W,validateTag:I}},Cu=({tag:e,onRemove:o,isRemovable:t,size:n,views:i,isDisabled:a,isReadOnly:l})=>{const[d,s]=u.useState(!1),g={xs:{padding:"2px 8px",fontSize:"10px",iconSize:10},sm:{padding:"4px 10px",fontSize:"12px",iconSize:12},md:{padding:"6px 14px",fontSize:"14px",iconSize:14},lg:{padding:"8px 16px",fontSize:"16px",iconSize:16},xl:{padding:"10px 18px",fontSize:"18px",iconSize:18}}[n]||{padding:"6px 14px",fontSize:"14px",iconSize:14};return r.jsxs(c.Horizontal,{alignItems:"center",gap:6,padding:g.padding,backgroundColor:"color-gray-100-100",borderRadius:"16px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-100",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",opacity:a?.6:1,_hover:!a&&!l?{backgroundColor:"color-gray-100-200",borderColor:"color-gray-200",boxShadow:"0 4px 6px rgba(0,0,0,0.05)",transform:"translateY(-1px)"}:{},...i==null?void 0:i.tag,children:[r.jsx(c.Text,{fontSize:g.fontSize,color:a?"color-gray-100":"theme-primary",whiteSpace:"nowrap",...i==null?void 0:i.tagText,children:e}),t&&!a&&!l&&r.jsx(c.View,{cursor:"pointer",padding:"2px",borderRadius:"50%",transition:"all 0.2s ease",backgroundColor:d?"color-red-100":"transparent",opacity:d?1:.7,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:p=>{p.stopPropagation(),o()},_hover:{backgroundColor:"color-red-50"},...i==null?void 0:i.tagRemove,children:r.jsx(fe,{widthHeight:g.iconSize,color:d?"color-red-500":"color-gray-400"})})]})},zn=({id:e,name:o,label:t,placeholder:n="Type and press Enter to add tags...",helperText:i,error:a=!1,inputValue:l="",tags:d=[],left:s,right:g,shadow:p={},views:m={},size:h="md",shape:f="default",variant:x="default",isDisabled:y=!1,isReadOnly:b=!1,isAutoFocus:k=!1,isRemovable:S=!0,isFocused:w=!1,isHovered:j=!1,maxTags:C,handleInputChange:I,handleKeyDown:M,handleFocus:R,handleBlur:V,removeTag:_,setIsHovered:T,onClick:W,...B})=>{const{getColor:P,themeMode:z}=c.useTheme(),$=!!(t&&(w||d.length>0||l)),E=C&&d.length>=C,H={...tn[f],...rn[x],...m==null?void 0:m.inputContainer},L={border:"none",outline:"none",backgroundColor:"transparent",fontSize:c.Typography.fontSizes[h],color:y?"color-gray-400":"color-gray-800",flex:1,minWidth:"120px",...m==null?void 0:m.input};return r.jsx(we,{error:!!a,helperText:typeof a=="string"?a:i,views:m,...B,children:r.jsxs(Ve,{label:t,shadow:p,value:d.length>0||l?"has-content":"",size:h,shape:f,variant:x,error:!!a,showLabel:$,isFocused:w,isHovered:j,isDisabled:y,isReadOnly:b,views:m,onClick:W,onMouseEnter:()=>T==null?void 0:T(!0),onMouseLeave:()=>T==null?void 0:T(!1),...H,children:[s,r.jsxs(Qe,{children:[t&&r.jsx(He,{size:h,error:!!a,views:m,children:t}),r.jsxs(c.Horizontal,{alignItems:"center",gap:8,flexWrap:"wrap",width:"100%",minHeight:c.Typography.fontSizes[h],padding:"8px 0",...m==null?void 0:m.tagsContainer,children:[d.map((A,F)=>r.jsx(Cu,{tag:A.value,onRemove:()=>_==null?void 0:_(F),isRemovable:S,size:h,views:m,isDisabled:y,isReadOnly:b},A.id)),!E&&r.jsx(c.Input,{id:e,name:o,type:"text",value:l,placeholder:d.length===0?n:"",disabled:y,readOnly:b,autoFocus:k,onChange:I,onKeyDown:M,onFocus:R,onBlur:V,autoComplete:"off",...L}),E&&r.jsxs(c.Text,{fontSize:c.Typography.fontSizes[h],color:"color-gray-500",fontStyle:"italic",...m==null?void 0:m.placeholder,children:["Maximum ",C," tags reached"]})]})]}),g]})})},Su=e=>{const o=Mn(e),{tags:t,...n}=e;return r.jsx(zn,{...o,...n})},wu=Su;function Iu(e){const o=setTimeout(e,0),t=setTimeout(e,10),n=setTimeout(e,50);return[o,t,n]}const Rn=({value:e,defaultValue:o="",length:t=6,onChange:n,onChangeText:i,onComplete:a,onKeyDown:l,onKeyPress:d,onBlur:s,onFocus:g,isReadOnly:p,isDisabled:m,pattern:h,stepValues:f,pasteTransformer:x})=>{var K,Y;const y=e!==void 0,b=y?e:o,[k,S]=u.useState((b==null?void 0:b.slice(0,t))||""),[w,j]=u.useState(!1),[C,I]=u.useState(!1),[M,R]=u.useState(null),[V,_]=u.useState(null),T=u.useRef(null),W=u.useRef(null),B=u.useRef({value:k,onChange:n||(()=>{}),isIOS:typeof window<"u"&&((Y=(K=window==null?void 0:window.CSS)==null?void 0:K.supports)==null?void 0:Y.call(K,"-webkit-touch-callout","none"))}),P=u.useRef({prev:[null,null,"none"]}),z=h?typeof h=="string"?new RegExp(h):h:null;u.useEffect(()=>{y&&e!==k&&S((e==null?void 0:e.slice(0,t))||"")},[y,e,t,k]);const $=u.useCallback(O=>{let X=O;if(f&&f.length>0&&O){const Z=parseInt(O,10);if(!isNaN(Z)){let J=f[0],oe=Math.abs(Z-J);for(let re=1;re<f.length;re++){const ce=Math.abs(Z-f[re]);ce<oe&&(oe=ce,J=f[re])}X=J.toString()}}S(X),n&&n(X),i&&i(X),a&&X.length===t&&a(X)},[n,i,a,t,f]),E=u.useCallback(O=>{O&&T.current!==O&&Object.defineProperty(T,"current",{value:O,writable:!0})},[]),H=u.useCallback(O=>{const X=O.currentTarget.value.slice(0,t);if(X.length>0&&z&&!z.test(X)){O.preventDefault();return}$(X),T.current&&(T.current.value=X)},[t,z,$,T]),L=u.useCallback(()=>{var O;if(T.current){const X=Math.min(T.current.value.length,t-1),Z=T.current.value.length;(O=T.current)==null||O.setSelectionRange(X,Z),R(X),_(Z)}j(!0)},[t]),A=u.useCallback(()=>{j(!1)},[]),F=u.useCallback(O=>{l&&l(O)},[]),D=u.useCallback(O=>{d&&d(O)},[]),q=u.useCallback(O=>{const X=T.current;if(!O.clipboardData||!X)return;const Z=O.clipboardData.getData("text/plain"),J=x?x(Z):Z;O.preventDefault();const oe=X.selectionStart||0,re=X.selectionEnd||0,U=(oe!==re?k.slice(0,oe)+J+k.slice(re):k.slice(0,oe)+J+k.slice(oe)).slice(0,t);if(U.length>0&&z&&!z.test(U))return;X.value=U,$(U),S(U);const G=Math.min(U.length,t-1),ee=U.length;X.setSelectionRange(G,ee),R(G),_(ee)},[t,x,z,$,k,S]);return u.useEffect(()=>{const O=T.current,X=W.current;if(!O||!X)return;B.current.value!==O.value&&B.current.onChange&&B.current.onChange(O.value),P.current.prev=[O.selectionStart,O.selectionEnd,O.selectionDirection];function Z(){if(document.activeElement!==O){R(null),_(null);return}const re=(O==null?void 0:O.selectionStart)??null,ce=(O==null?void 0:O.selectionEnd)??null,me=(O==null?void 0:O.selectionDirection)??null,U=(O==null?void 0:O.maxLength)??0,G=(O==null?void 0:O.value)??"",ee=P.current.prev;let v=-1,Q=-1,le="none";if(G.length!==0&&re!==null&&ce!==null){const ne=re===ce,Ie=re===G.length&&G.length<U;if(ne&&!Ie){const ye=re;if(ye===0)v=0,Q=1,le="forward";else if(ye===U)v=ye-1,Q=ye,le="backward";else if(U>1&&G.length>1){let ot=0;if(ee[0]!==null&&ee[1]!==null){le=ye<ee[1]?"backward":"forward";const va=ee[0]===ee[1]&&ee[0]<U;le==="backward"&&!va&&(ot=-1)}v=ot+ye,Q=ot+ye+1}}v!==-1&&Q!==-1&&v!==Q&&T.current&&T.current.setSelectionRange(v,Q,le)}const se=v!==-1?v:re,pe=Q!==-1?Q:ce,xe=le!=="none"?le:me;R(se),_(pe),P.current.prev=[se,pe,xe]}document.addEventListener("selectionchange",Z,{capture:!0}),Z(),document.activeElement===O&&j(!0);const J=()=>{X&&X.style.setProperty("--root-height",`${O.clientHeight}px`)};J();const oe=new window.ResizeObserver(J);return oe.observe(O),()=>{document.removeEventListener("selectionchange",Z,{capture:!0}),oe.disconnect()}},[]),u.useEffect(()=>{Iu(()=>{var J,oe,re,ce;(J=T.current)==null||J.dispatchEvent(new Event("input"));const O=(oe=T.current)==null?void 0:oe.selectionStart,X=(re=T.current)==null?void 0:re.selectionEnd,Z=(ce=T.current)==null?void 0:ce.selectionDirection;O!==null&&X!==null&&O!==void 0&&X!==void 0&&(R(O),_(X),P.current.prev=[O,X,Z||"none"])})},[k,w]),{value:k,setValue:$,isFocused:w,setIsFocused:j,isHovered:C,setIsHovered:I,inputRef:T,containerRef:W,mirrorSelectionStart:M,mirrorSelectionEnd:V,setMirrorSelectionStart:R,setMirrorSelectionEnd:_,setInputRef:E,handleChange:H,handleFocus:L,handleBlur:A,handleKeyDown:F,handleKeyPress:D,handlePaste:q}},Tu=u.createContext({slots:[],isFocused:!1,isHovering:!1}),Mu=`
|
|
7
7
|
@keyframes blink {
|
|
8
8
|
0%, 100% { opacity: 1; }
|
|
9
9
|
50% { opacity: 0; }
|