@datacrest/dcuikit 1.0.12 → 1.0.13
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/build/index.css +1 -1
- package/build/index.esm.css +1 -1
- package/build/index.esm.js +2 -2
- package/build/index.esm.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/tsconfig.prod.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
|
@@ -17,7 +17,7 @@ var Be={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the ISC license.
|
|
19
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/const We=r(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:i="",children:a,iconNode:l,...s},c)=>n("svg",{ref:c,...Be,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:Ae("lucide",i),...!a&&!_e(s)&&{"aria-hidden":"true"},...s},[...l.map(([e,t])=>n(e,t)),...Array.isArray(a)?a:[a]])),Fe=(e,t)=>{const o=r(({className:r,...o},i)=>{return n(We,{ref:i,iconNode:t,className:Ae(`lucide-${a=Re(e),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...o});var a});return o.displayName=Re(e),o},$e=Fe("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),He=Fe("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Ve=Fe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),qe=Fe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Ye=Fe("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Ue=Fe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Ge=Fe("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Xe=Fe("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Ze=Fe("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),Ke=Fe("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),Qe=Fe("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),Je=Fe("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),et=Fe("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]),tt=Fe("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),rt=Fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),nt=({loading:e,children:r,iconLeft:n,iconRight:o})=>t.createElement("div",{className:Ie("flex items-center justify-center gap-2 transition-all duration-300",e?"opacity-0":"opacity-100")},n&&t.createElement("span",{className:"shrink-0"},n),t.createElement("span",{className:"relative z-10"},r),o&&t.createElement("span",{className:"shrink-0"},o)),ot=t.forwardRef(({iconLeft:e,iconRight:r,variant:n="primary",displayType:o="default",status:i="accepted",size:a="medium",loading:l=!1,disabled:s=!1,dataTestId:c,fluid:u=!1,className:p,...d},f)=>{const m=Ie("group relative inline-flex items-center justify-center font-medium","rounded-md ring-offset-background transition-all duration-300","focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50 disabled:border-input","before:absolute before:inset-0 before:rounded-md before:transition-all before:duration-300","after:absolute after:inset-0 after:rounded-md after:transition-all after:duration-300"),v={primary:Ie("bg-primary text-primary-foreground","border border-primary","shadow-[0_2px_10px] shadow-primary/30 dark:shadow-primary/20","hover:shadow-[0_8px_25px] hover:shadow-primary/40 dark:hover:shadow-primary/30","hover:bg-primary/90 hover:border-primary","active:shadow-[0_2px_6px] active:shadow-primary/30 dark:active:shadow-primary/20","before:bg-[radial-gradient(800px_circle_at_var(--mouse-x)_var(--mouse-y),transparent_40%)]","after:bg-linear-to-t after:from-black/10 after:to-transparent"),secondary:Ie("bg-
|
|
20
|
+
*/const We=r(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:i="",children:a,iconNode:l,...s},c)=>n("svg",{ref:c,...Be,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:Ae("lucide",i),...!a&&!_e(s)&&{"aria-hidden":"true"},...s},[...l.map(([e,t])=>n(e,t)),...Array.isArray(a)?a:[a]])),Fe=(e,t)=>{const o=r(({className:r,...o},i)=>{return n(We,{ref:i,iconNode:t,className:Ae(`lucide-${a=Re(e),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...o});var a});return o.displayName=Re(e),o},$e=Fe("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),He=Fe("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Ve=Fe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),qe=Fe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Ye=Fe("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Ue=Fe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Ge=Fe("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Xe=Fe("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Ze=Fe("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),Ke=Fe("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),Qe=Fe("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),Je=Fe("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),et=Fe("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]),tt=Fe("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),rt=Fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),nt=({loading:e,children:r,iconLeft:n,iconRight:o})=>t.createElement("div",{className:Ie("flex items-center justify-center gap-2 transition-all duration-300",e?"opacity-0":"opacity-100")},n&&t.createElement("span",{className:"shrink-0"},n),t.createElement("span",{className:"relative z-10"},r),o&&t.createElement("span",{className:"shrink-0"},o)),ot=t.forwardRef(({iconLeft:e,iconRight:r,variant:n="primary",displayType:o="default",status:i="accepted",size:a="medium",loading:l=!1,disabled:s=!1,dataTestId:c,fluid:u=!1,className:p,...d},f)=>{const m=Ie("group relative inline-flex items-center justify-center font-medium","rounded-md ring-offset-background transition-all duration-300","focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50 disabled:border-input","before:absolute before:inset-0 before:rounded-md before:transition-all before:duration-300","after:absolute after:inset-0 after:rounded-md after:transition-all after:duration-300"),v={primary:Ie("bg-primary text-primary-foreground","border border-primary","shadow-[0_2px_10px] shadow-primary/30 dark:shadow-primary/20","hover:shadow-[0_8px_25px] hover:shadow-primary/40 dark:hover:shadow-primary/30","hover:bg-primary/90 hover:border-primary","active:shadow-[0_2px_6px] active:shadow-primary/30 dark:active:shadow-primary/20","before:bg-[radial-gradient(800px_circle_at_var(--mouse-x)_var(--mouse-y),transparent_40%)]","after:bg-linear-to-t after:from-black/10 after:to-transparent"),secondary:Ie("bg-secondary text-secondary-foreground","border border-border dark:border-border","shadow-[0_2px_8px] shadow-black/5 dark:shadow-black/20","hover:shadow-[0_4px_16px] hover:shadow-black/10 dark:hover:shadow-black/30","hover:bg-secondary/80 hover:border-border dark:hover:bg-secondary/90 dark:hover:border-border","active:shadow-[0_1px_4px] active:shadow-black/10 active:translate-y-[1px]","before:bg-[radial-gradient(800px_circle_at_var(--mouse-x)_var(--mouse-y),rgba(255,255,255,0.1),transparent_50%)]","after:bg-linear-to-b after:from-white/20 after:to-transparent dark:after:from-white/5"),tertiary:Ie("bg-background text-foreground","border border-input dark:border-input","shadow-[0_1px_3px] shadow-black/5 dark:shadow-black/20","hover:border-muted-foreground/50 hover:bg-accent dark:hover:bg-accent dark:hover:border-muted-foreground/30","hover:shadow-[0_2px_8px] hover:shadow-black/10 dark:hover:shadow-black/25","active:bg-accent/80 dark:active:bg-accent/80","before:bg-[radial-gradient(800px_circle_at_var(--mouse-x)_var(--mouse-y),rgba(0,0,0,0.05),transparent_50%)] dark:before:bg-[radial-gradient(800px_circle_at_var(--mouse-x)_var(--mouse-y),rgba(255,255,255,0.05),transparent_50%)]","after:bg-linear-to-b after:from-white/40 after:to-transparent dark:after:from-white/5"),danger:Ie("bg-destructive text-destructive-foreground","border border-destructive","shadow-[0_2px_10px] shadow-destructive/30 dark:shadow-destructive/20","hover:shadow-[0_8px_25px] hover:shadow-destructive/40 dark:hover:shadow-destructive/30","hover:bg-destructive/90 hover:border-destructive/90","active:shadow-[0_2px_6px] active:shadow-destructive/30 dark:active:shadow-destructive/20","before:bg-[radial-gradient(800px_circle_at_var(--mouse-x)_var(--mouse-y),transparent_40%)]","after:bg-linear-to-t after:from-black/10 after:to-transparent"),warning:Ie("bg-warning text-warning-foreground","border border-warning dark:border-warning/80","shadow-[0_2px_10px] shadow-warning/30 dark:shadow-warning/20","hover:shadow-[0_8px_25px] hover:shadow-warning/40 dark:hover:shadow-warning/30","hover:bg-warning/90 hover:border-warning/90","active:shadow-[0_2px_6px] active:shadow-warning/30 dark:active:shadow-warning/20","before:bg-[radial-gradient(800px_circle_at_var(--mouse-x)_var(--mouse-y),transparent_40%)]","after:bg-linear-to-t after:from-black/10 after:to-transparent"),harford:Ie("bg-[#043d5a] text-primary-foreground","border border-[#043d5a]","shadow-[0_2px_10px] shadow-[#043d5a]/30 dark:shadow-[#043d5a]/20","hover:shadow-[0_8px_25px] hover:shadow-[#043d5a]/40 dark:hover:shadow-[#043d5a]/30","hover:bg-[#043d5a]/90 hover:border-[#043d5a]","active:shadow-[0_2px_6px] active:shadow-[#043d5a]/30 dark:active:shadow-[#043d5a]/20","before:bg-[radial-gradient(800px_circle_at_var(--mouse-x)_var(--mouse-y),transparent_40%)]","after:bg-linear-to-t after:from-black/10 after:to-transparent"),link:Ie("text-primary dark:text-primary/90 underline-offset-4","hover:text-primary/90 dark:hover:text-primary/80 hover:underline","bg-transparent border-none shadow-none","active:text-primary/80 dark:active:text-primary/70","before:hidden after:hidden")};return t.createElement("button",{...d,ref:f,disabled:l||s,"data-test-id":c,onMouseMove:e=>{const t=e.currentTarget,r=t.getBoundingClientRect(),n=e.clientX-r.left,o=e.clientY-r.top;t.style.setProperty("--mouse-x",`${n}px`),t.style.setProperty("--mouse-y",`${o}px`)},className:Ie(m,"default"===o?Ie(v[n],{small:"h-8 px-3 text-sm",medium:"h-10 px-4 py-2",large:"h-12 px-6 text-lg"}[a]):Ie({primary:"bg-primary text-primary-foreground border border-primary shadow-sm py-0.5 px-2.5 text-xs font-medium",secondary:"bg-secondary text-secondary-foreground border border-border shadow-sm py-0.5 px-2.5 text-xs font-medium",tertiary:"bg-muted text-muted-foreground border border-input shadow-sm py-0.5 px-2.5 text-xs font-medium",danger:"bg-destructive text-destructive-foreground border border-destructive shadow-sm py-0.5 px-2.5 text-xs font-medium",warning:"bg-warning text-warning-foreground border border-warning shadow-sm py-0.5 px-2.5 text-xs font-medium",harford:"bg-[#043d5a] text-primary-foreground border border-[#043d5a] shadow-sm py-0.5 px-2.5 text-xs font-medium",link:"bg-primary text-primary-foreground border border-primary shadow-sm py-0.5 px-2.5 text-xs font-medium underline underline-offset-2"}[n],"accepted"!==i&&{accepted:"",pending:"bg-amber-500 text-amber-50 border-amber-600"}[i]),u&&"w-full","default"===o&&"active:scale-[0.98] transition-transform duration-300",p)},l&&"badge"!==o&&t.createElement("div",{className:"absolute inset-0 flex items-center justify-center"},t.createElement(Je,{className:"h-5 w-5 animate-spin"})),t.createElement(nt,{loading:l,iconLeft:e,iconRight:r},d.children))});
|
|
21
21
|
/**
|
|
22
22
|
* @license lucide-react v0.525.0 - ISC
|
|
23
23
|
*
|
|
@@ -41,7 +41,7 @@ object-assign
|
|
|
41
41
|
Copyright (c) 2018 Jed Watson.
|
|
42
42
|
Licensed under the MIT License (MIT), see
|
|
43
43
|
http://jedwatson.github.io/classnames
|
|
44
|
-
*/var rg,ng=(eg||(eg=1,rg=tg,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=n(e,r(o)))}return e}function r(r){if("string"==typeof r||"number"==typeof r)return r;if("object"!=typeof r)return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var o="";for(var i in r)e.call(r,i)&&r[i]&&(o=n(o,i));return o}function n(e,t){return t?e?e+" "+t:e+t:e}rg.exports?(t.default=t,rg.exports=t):window.classNames=t}()),tg.exports),og=it(ng);const ig={extraSmall:"mt-1 mb-1",small:"mt-2 mb-2",medium:"mt-4 mb-4",large:"mt-6 mb-6",extraLarge:"mt-8 mb-8"},ag={tight:"tracking-tight",normal:"tracking-normal",wide:"tracking-wide",wider:"tracking-wider",widest:"tracking-widest"},lg={h1:"text-4xl",h2:"text-3xl",h3:"text-2xl",h4:"text-xl",h5:"text-lg",h6:"text-base"},sg={primary:"text-primary",secondary:"text-secondary",tertiary:"text-destructive",quaternary:"text-warning",quinary:"text-muted-foreground",white:"text-white",harford:"text-[#043d5a]"},cg={normal:"font-normal",bold:"font-bold",semibold:"font-semibold",light:"font-light"},ug={body:"text-base",paragraph:"text-lg",caption:"text-sm",small:"text-xs",regular:"text-base",paragraphSm:"text-md",captionSm:"text-xs"},pg=({variant:e,color:r="quaternary",marginTop:n,marginBottom:o,letterSpacing:i,textAlign:a="text-left",fontWeight:l="normal",children:s,...c})=>{const u=og(ug[e],sg[r],cg[l],n?ig[n]:"",o?ig[o]:"",i?ag[i]:"",a);return t.createElement("p",{className:u,...c},s)},dg=({variant:e="h1",color:r="harford",marginTop:n,marginBottom:o,letterSpacing:i,textAlign:a="text-left",fontWeight:l="normal",children:s,...c})=>{const u=og(lg[e],sg[r],cg[l],n?ig[n]:"",o?ig[o]:"",i?ag[i]:"",a);return t.createElement(e,{className:u,...c},s)},fg=({value:e,fluid:r,label:n,leftIcon:o,rightIcon:a,togglePassword:s,error:c,success:u,hint:p,disabled:d,type:f="text",hintTextProps:m={variant:"small"},className:v="",dataTestId:y,inputSize:h,...g})=>{const[b,w]=i(!1),[x,O]=i(!1),k=l(()=>b?t.createElement(Xh,{name:"EyeOff",size:16}):t.createElement(Xh,{name:"Eye",size:16}),[b]),E=n&&(e||x),j=(()=>{if(!n||!E)return 0;const e=n.length;return Math.max(8*e+24,50)})(),P=l(()=>{let e="relative flex items-center px-3 py-2 rounded-lg overflow-visible min-h-[2.5rem]";return n&&E||(e+=" border"),d?e+=" bg-muted text-muted-foreground":c?e+=" text-destructive":u&&(e+=" text-success"),r&&(e+=" w-full"),`${e} ${v}`},[d,c,u,E,n,r,v]),S=l(()=>{let e="peer w-full outline-none bg-transparent placeholder-transparent text-sm leading-5 transition-colors duration-200";return e+=d?" text-muted-foreground cursor-not-allowed":" text-foreground","password"===f&&(e+=" pr-8"),"number"===f&&(e+=" appearance-none"),e},[d,f]),z=l(()=>"password"===f&&b?"text":f,[f,b]),N=l(()=>{let e="absolute left-2 px-2 transform transition-all duration-200 ease-in-out z-20 pointer-events-none bg-background";return e+=E?" -top-4 text-sm text-muted-foreground":" top-1/2 -translate-y-1/2 text-base text-muted-foreground",x&&!d?e+=" text-primary":c?e+=" text-destructive":u&&(e+=" text-success"),e},[E,x,d,c,u]),C=d?"border-input":c?"border-destructive":u?"border-success":x||e?"border-primary":"border-input",T=x?"border-t-2 border-l-2 border-r-2 border-b-2":"border-t border-l border-r border-b";return t.createElement("div",{className:P},n&&E&&t.createElement(t.Fragment,null,t.createElement("div",{className:`absolute top-0 left-0 h-0 transition-all duration-200 ${T.split(" ")[0]} ${C}`,style:{width:"12px",borderTopLeftRadius:"8px"}}),t.createElement("div",{className:`absolute top-0 transition-all duration-200 ${T.split(" ")[0]} ${C}`,style:{left:`${12+j}px`,right:"0",height:"0",borderTopRightRadius:"8px"}}),t.createElement("div",{className:`absolute left-0 top-0 bottom-0 w-0 transition-all duration-200 ${T.split(" ")[1]} ${C}`,style:{borderBottomLeftRadius:"8px"}}),t.createElement("div",{className:`absolute right-0 top-0 bottom-0 w-0 transition-all duration-200 ${T.split(" ")[2]} ${C}`,style:{borderBottomRightRadius:"8px"}}),t.createElement("div",{className:`absolute bottom-0 left-0 right-0 h-0 transition-all duration-200 ${T.split(" ")[3]} ${C}`,style:{borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"}})),o&&t.createElement("div",{className:"flex items-center mr-2 text-muted-foreground"},o),t.createElement("div",{className:"relative w-full"},t.createElement("input",{...g,"data-test-id":y,id:g.id,value:e,disabled:d,type:z,className:S,placeholder:" ",onFocus:e=>{O(!0),g.onFocus?.(e)},onBlur:e=>{O(!1),g.onBlur?.(e)}}),n&&t.createElement("label",{htmlFor:g.id,className:N},n)),"password"===f&&s&&t.createElement("button",{type:"button",className:"absolute right-3 text-muted-foreground hover:text-foreground transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{!d&&e&&w(!b)},disabled:d,tabIndex:-1},k),a&&t.createElement("div",{className:"flex items-center ml-2 text-muted-foreground"},a),(c||u||p)&&t.createElement("div",{className:"absolute top-full left-0 mt-1 text-sm w-full"},t.createElement(pg,{...m},c?.message||u?.message&&!c?.message||!c?.message&&!u?.message&&p?.message)))};function mg(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function vg(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function yg(...e){return t=>{let r=!1;const n=e.map(e=>{const n=vg(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():vg(e[t],null)}}}}function hg(...t){return e.useCallback(yg(...t),t)}function gg(t,r=[]){let n=[];const o=()=>{const r=n.map(t=>e.createContext(t));return function(n){const o=n?.[t]||r;return e.useMemo(()=>({[`__scope${t}`]:{...n,[t]:o}}),[n,o])}};return o.scopeName=t,[function(r,o){const i=e.createContext(o),a=n.length;n=[...n,o];const l=r=>{const{scope:n,children:o,...l}=r,s=n?.[t]?.[a]||i,c=e.useMemo(()=>l,Object.values(l));return w(s.Provider,{value:c,children:o})};return l.displayName=r+"Provider",[l,function(n,l){const s=l?.[t]?.[a]||i,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${r}\``)}]},bg(o,...r)]}function bg(...t){const r=t[0];if(1===t.length)return r;const n=()=>{const n=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=n.reduce((e,{useScope:r,scopeName:n})=>({...e,...r(t)[`__scope${n}`]}),{});return e.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])}};return n.scopeName=r.scopeName,n}function wg(t){const r=Og(t),n=e.forwardRef((t,n)=>{const{children:o,...i}=t,a=e.Children.toArray(o),l=a.find(Eg);if(l){const t=l.props.children,o=a.map(r=>r===l?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:r);return w(r,{...i,ref:n,children:e.isValidElement(t)?e.cloneElement(t,void 0,o):null})}return w(r,{...i,ref:n,children:o})});return n.displayName=`${t}.Slot`,n}var xg=wg("Slot");function Og(t){const r=e.forwardRef((t,r)=>{const{children:n,...o}=t;if(e.isValidElement(n)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(n),i=function(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...i}:"className"===n&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}(o,n.props);return n.type!==e.Fragment&&(i.ref=r?yg(r,t):t),e.cloneElement(n,i)}return e.Children.count(n)>1?e.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}var kg=Symbol("radix.slottable");function Eg(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===kg}var jg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=wg(`Primitive.${r}`),o=e.forwardRef((e,t)=>{const{asChild:o,...i}=e,a=o?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),w(a,{...i,ref:t})});return o.displayName=`Primitive.${r}`,{...t,[r]:o}},{});var Pg=globalThis?.document?e.useLayoutEffect:()=>{},Sg=e[" useId ".trim().toString()]||(()=>{}),zg=0;function Ng(t){const[r,n]=e.useState(Sg());return Pg(()=>{n(e=>e??String(zg++))},[t]),r?`radix-${r}`:""}function Cg(t){const r=e.useRef(t);return e.useEffect(()=>{r.current=t}),e.useMemo(()=>(...e)=>r.current?.(...e),[])}var Tg=e[" useInsertionEffect ".trim().toString()]||Pg;function Lg({prop:t,defaultProp:r,onChange:n=()=>{},caller:o}){const[i,a,l]=function({defaultProp:t,onChange:r}){const[n,o]=e.useState(t),i=e.useRef(n),a=e.useRef(r);return Tg(()=>{a.current=r},[r]),e.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,o,a]}({defaultProp:r,onChange:n}),s=void 0!==t,c=s?t:i;{const r=e.useRef(void 0!==t);e.useEffect(()=>{const e=r.current;if(e!==s){const t=e?"controlled":"uncontrolled",r=s?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}r.current=s},[s,o])}const u=e.useCallback(e=>{if(s){const r=function(e){return"function"==typeof e}(e)?e(t):e;r!==t&&l.current?.(r)}else a(e)},[s,t,a,l]);return[c,u]}var Mg=e.createContext(void 0);function Dg(t){const r=e.useContext(Mg);return t||r||"ltr"}var Ig="rovingFocusGroup.onEntryFocus",Rg={bubbles:!1,cancelable:!0},Ag="RovingFocusGroup",[_g,Bg,Wg]=function(e){const r=e+"CollectionProvider",[n,o]=gg(r),[i,a]=n(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:r,children:n}=e,o=t.useRef(null),a=t.useRef(new Map).current;return w(i,{scope:r,itemMap:a,collectionRef:o,children:n})};l.displayName=r;const s=e+"CollectionSlot",c=wg(s),u=t.forwardRef((e,t)=>{const{scope:r,children:n}=e,o=hg(t,a(s,r).collectionRef);return w(c,{ref:o,children:n})});u.displayName=s;const p=e+"CollectionItemSlot",d="data-radix-collection-item",f=wg(p),m=t.forwardRef((e,r)=>{const{scope:n,children:o,...i}=e,l=t.useRef(null),s=hg(r,l),c=a(p,n);return t.useEffect(()=>(c.itemMap.set(l,{ref:l,...i}),()=>{c.itemMap.delete(l)})),w(f,{[d]:"",ref:s,children:o})});return m.displayName=p,[{Provider:l,Slot:u,ItemSlot:m},function(r){const n=a(e+"CollectionConsumer",r);return t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[n.collectionRef,n.itemMap])},o]}(Ag),[Fg,$g]=gg(Ag,[Wg]),[Hg,Vg]=Fg(Ag),qg=e.forwardRef((e,t)=>w(_g.Provider,{scope:e.__scopeRovingFocusGroup,children:w(_g.Slot,{scope:e.__scopeRovingFocusGroup,children:w(Yg,{...e,ref:t})})}));qg.displayName=Ag;var Yg=e.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...d}=t,f=e.useRef(null),m=hg(r,f),v=Dg(a),[y,h]=Lg({prop:l,defaultProp:s??null,onChange:c,caller:Ag}),[g,b]=e.useState(!1),x=Cg(u),O=Bg(n),k=e.useRef(!1),[E,j]=e.useState(0);return e.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(Ig,x),()=>e.removeEventListener(Ig,x)},[x]),w(Hg,{scope:n,orientation:o,dir:v,loop:i,currentTabStopId:y,onItemFocus:e.useCallback(e=>h(e),[h]),onItemShiftTab:e.useCallback(()=>b(!0),[]),onFocusableItemAdd:e.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>j(e=>e-1),[]),children:w(jg.div,{tabIndex:g||0===E?-1:0,"data-orientation":o,...d,ref:m,style:{outline:"none",...t.style},onMouseDown:mg(t.onMouseDown,()=>{k.current=!0}),onFocus:mg(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent(Ig,Rg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=O().filter(e=>e.focusable);Zg([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:mg(t.onBlur,()=>b(!1))})})}),Ug="RovingFocusGroupItem",Gg=e.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:a,children:l,...s}=t,c=Ng(),u=a||c,p=Vg(Ug,n),d=p.currentTabStopId===u,f=Bg(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:y}=p;return e.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),w(_g.ItemSlot,{scope:n,id:u,focusable:o,active:i,children:w(jg.span,{tabIndex:d?0:-1,"data-orientation":p.orientation,...s,ref:r,onMouseDown:mg(t.onMouseDown,e=>{o?p.onItemFocus(u):e.preventDefault()}),onFocus:mg(t.onFocus,()=>p.onItemFocus(u)),onKeyDown:mg(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:Xg[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=p.loop?(n=i+1,(r=o).map((e,t)=>r[(n+t)%r.length])):o.slice(i+1)}setTimeout(()=>Zg(o))}var r,n}),children:"function"==typeof l?l({isCurrentTabStop:d,hasTabStop:null!=y}):l})})});Gg.displayName=Ug;var Xg={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Zg(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var Kg=qg,Qg=Gg;function Jg(t){const[r,n]=e.useState(void 0);return Pg(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const r=e[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=t.offsetWidth,i=t.offsetHeight;n({width:o,height:i})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}n(void 0)},[t]),r}function eb(t){const r=e.useRef({value:t,previous:t});return e.useMemo(()=>(r.current.value!==t&&(r.current.previous=r.current.value,r.current.value=t),r.current.previous),[t])}var tb=t=>{const{present:r,children:n}=t,o=function(t){const[r,n]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,r){return e.useReducer((e,t)=>r[e][t]??e,t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=rb(o.current);a.current="mounted"===s?e:"none"},[s]),Pg(()=>{const e=o.current,r=i.current;if(r!==t){const n=a.current,o=rb(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(r&&n!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,c]),Pg(()=>{if(r){let e;const t=r.ownerDocument.defaultView??window,n=n=>{const a=rb(o.current).includes(n.animationName);if(n.target===r&&a&&(c("ANIMATION_END"),!i.current)){const n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},l=e=>{e.target===r&&(a.current=rb(o.current))};return r.addEventListener("animationstart",l),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",l),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}c("ANIMATION_END")},[r,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(r),i="function"==typeof n?n({present:o.isPresent}):e.Children.only(n),a=hg(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof n||o.isPresent?e.cloneElement(i,{ref:a}):null};function rb(e){return e?.animationName||"none"}tb.displayName="Presence";var nb="Radio",[ob,ib]=gg(nb),[ab,lb]=ob(nb),sb=e.forwardRef((t,r)=>{const{__scopeRadio:n,name:o,checked:i=!1,required:a,disabled:l,value:s="on",onCheck:c,form:u,...p}=t,[d,f]=e.useState(null),m=hg(r,e=>f(e)),v=e.useRef(!1),y=!d||(u||!!d.closest("form"));return O(ab,{scope:n,checked:i,disabled:l,children:[w(jg.button,{type:"button",role:"radio","aria-checked":i,"data-state":db(i),"data-disabled":l?"":void 0,disabled:l,value:s,...p,ref:m,onClick:mg(t.onClick,e=>{i||c?.(),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&w(pb,{control:d,bubbles:!v.current,name:o,value:s,checked:i,required:a,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});sb.displayName=nb;var cb="RadioIndicator",ub=e.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...o}=e,i=lb(cb,r);return w(tb,{present:n||i.checked,children:w(jg.span,{"data-state":db(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});ub.displayName=cb;var pb=e.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:o=!0,...i},a)=>{const l=e.useRef(null),s=hg(l,a),c=eb(n),u=Jg(r);return e.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(c!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[c,n,o]),w(jg.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function db(e){return e?"checked":"unchecked"}pb.displayName="RadioBubbleInput";var fb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],mb="RadioGroup",[vb,yb]=gg(mb,[$g,ib]),hb=$g(),gb=ib(),[bb,wb]=vb(mb),xb=e.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:o,value:i,required:a=!1,disabled:l=!1,orientation:s,dir:c,loop:u=!0,onValueChange:p,...d}=e,f=hb(r),m=Dg(c),[v,y]=Lg({prop:i,defaultProp:o??null,onChange:p,caller:mb});return w(bb,{scope:r,name:n,required:a,disabled:l,value:v,onValueChange:y,children:w(Kg,{asChild:!0,...f,orientation:s,dir:m,loop:u,children:w(jg.div,{role:"radiogroup","aria-required":a,"aria-orientation":s,"data-disabled":l?"":void 0,dir:m,...d,ref:t})})})});xb.displayName=mb;var Ob="RadioGroupItem",kb=e.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:o,...i}=t,a=wb(Ob,n),l=a.disabled||o,s=hb(n),c=gb(n),u=e.useRef(null),p=hg(r,u),d=a.value===i.value,f=e.useRef(!1);return e.useEffect(()=>{const e=e=>{fb.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),w(Qg,{asChild:!0,...s,focusable:!l,active:d,children:w(sb,{disabled:l,required:a.required,checked:d,...c,...i,name:a.name,ref:p,onCheck:()=>a.onValueChange(i.value),onKeyDown:mg(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:mg(i.onFocus,()=>{f.current&&u.current?.click()})})})});kb.displayName=Ob;var Eb=e.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,o=gb(r);return w(ub,{...o,...n,ref:t})});Eb.displayName="RadioGroupIndicator";var jb=xb,Pb=kb,Sb=Eb;const zb=t.forwardRef(({className:e,classNames:r,showIcons:n=!0,withCard:o=!0,options:i,...a},l)=>t.createElement(jb,{ref:l,className:Ie("grid gap-2",e,r?.root),...a},i.map(e=>t.createElement("div",{key:e.id,className:Ie("relative")},t.createElement("label",{htmlFor:e.id,className:Ie("relative flex w-full items-center gap-x-3",o&&["cursor-pointer rounded-lg border-2 p-4","border-input bg-background hover:bg-accent hover:text-accent-foreground","data-[state=checked]:border-primary data-[state=checked]:bg-primary/5"],!o&&"cursor-pointer py-2",r?.label)},t.createElement(Pb,{value:e.id,id:e.id,className:Ie("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background","focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",r?.item)},t.createElement(Sb,{className:Ie("flex items-center justify-center",r?.indicator)},t.createElement(Xe,{className:"h-2.5 w-2.5 fill-current text-current"}))),t.createElement("div",{className:"flex flex-1 items-center justify-between"},t.createElement("div",{className:Ie("space-y-1",!e.description&&"space-y-0")},t.createElement("p",{className:Ie("text-sm font-medium leading-none","peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r?.text)},e.label),e.description&&t.createElement("p",{className:Ie("text-sm text-muted-foreground",r?.description)},e.description)),n&&e.icon&&t.createElement("div",{className:Ie("ml-4 shrink-0 text-muted-foreground",r?.icon)},e.icon)))))));zb.displayName="RadioGroup";var Nb="Switch",[Cb,Tb]=gg(Nb),[Lb,Mb]=Cb(Nb),Db=e.forwardRef((t,r)=>{const{__scopeSwitch:n,name:o,checked:i,defaultChecked:a,required:l,disabled:s,value:c="on",onCheckedChange:u,form:p,...d}=t,[f,m]=e.useState(null),v=hg(r,e=>m(e)),y=e.useRef(!1),h=!f||(p||!!f.closest("form")),[g,b]=Lg({prop:i,defaultProp:a??!1,onChange:u,caller:Nb});return O(Lb,{scope:n,checked:g,disabled:s,children:[w(jg.button,{type:"button",role:"switch","aria-checked":g,"aria-required":l,"data-state":_b(g),"data-disabled":s?"":void 0,disabled:s,value:c,...d,ref:v,onClick:mg(t.onClick,e=>{b(e=>!e),h&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),h&&w(Ab,{control:f,bubbles:!y.current,name:o,value:c,checked:g,required:l,disabled:s,form:p,style:{transform:"translateX(-100%)"}})]})});Db.displayName=Nb;var Ib="SwitchThumb",Rb=e.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=Mb(Ib,r);return w(jg.span,{"data-state":_b(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});Rb.displayName=Ib;var Ab=e.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:o=!0,...i},a)=>{const l=e.useRef(null),s=hg(l,a),c=eb(n),u=Jg(r);return e.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(c!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[c,n,o]),w("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function _b(e){return e?"checked":"unchecked"}Ab.displayName="SwitchBubbleInput";var Bb=Db,Wb=Rb;const Fb="medium",$b="primary",Hb={small:{switch:"w-8 h-4",thumb:"w-3 h-3",translate:"translate-x-4"},medium:{switch:"w-11 h-6",thumb:"w-5 h-5",translate:"translate-x-5"},large:{switch:"w-14 h-7",thumb:"w-6 h-6",translate:"translate-x-7"}},Vb={primary:{background:"bg-primary",foreground:"text-primary-foreground",hover:"hover:bg-primary/90"},success:{background:"bg-[rgb(var(--success))]",foreground:"text-[rgb(var(--success-foreground))]",hover:"hover:bg-[rgb(var(--success))]/90"},danger:{background:"bg-destructive",foreground:"text-destructive-foreground",hover:"hover:bg-destructive/90"},warning:{background:"bg-[rgb(var(--warning))]",foreground:"text-foreground",hover:"hover:bg-[rgb(var(--warning))]/90"}},qb=({label:t,description:r,dataTestId:n})=>t||r?e.createElement("div",{className:"flex flex-col gap-1.5","data-test-id":n},t&&e.createElement(pg,{variant:"regular",color:"secondary"},t),r&&e.createElement(pg,{variant:"small",color:"secondary"},r)):null,Yb=e.forwardRef(({label:t,description:r,size:n=Fb,variant:o=$b,disabled:i=!1,loading:a=!1,className:l,onChange:s,dataTestId:c,checked:u,id:p,...d},f)=>{const m=n||Fb,v=o||$b;return e.createElement("div",{className:"flex items-center"},e.createElement("label",{htmlFor:p,className:Ie("relative inline-flex items-start gap-3 select-none",i&&"cursor-not-allowed opacity-60",l)},e.createElement("div",{className:"relative"},e.createElement(Bb,{id:p,checked:u,onCheckedChange:e=>{i||a||s?.(e)},disabled:i||a,"data-test-id":`${c}-root`,ref:f,...d,className:Ie("peer relative inline-flex shrink-0 cursor-pointer rounded-full transition-colors","border-2 border-transparent","focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",Hb[m].switch,u?Ie(Vb[v].background,Vb[v].foreground):"bg-input",i&&"cursor-not-allowed")},e.createElement(Wb,{className:Ie("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform","flex items-center justify-center",Hb[m].thumb,u?Hb[m].translate:"translate-x-0.5"),"data-test-id":`${c}-thumb`},a&&e.createElement(et,{className:"animate-spin text-black",size:{small:12,medium:16,large:20}[m]})))),e.createElement(qb,{label:t,description:r,dataTestId:c,disabled:i})))});Yb.displayName="Switch";const Ub=["small","medium","large"],Gb=["primary","success","danger","warning"],Xb=r(({className:e="",error:r=!1,disabled:n=!1,placeholder:o,value:a,defaultValue:l,onChange:c,onFocus:u,onBlur:p,rows:d=3,maxLength:f,required:m=!1,readOnly:v=!1,autoFocus:y=!1,resize:h=!1,label:g,helperText:b,showCharCount:w=!1,floatingLabel:x=!1,fluid:O=!0,width:k,...E},j)=>{const[P,S]=i(!1),[z,N]=i(a||l||""),C=s(e=>{S(!0),u?.(e)},[u]),T=s(e=>{S(!1),p?.(e)},[p]),L=s(e=>{N(e.target.value),c?.(e)},[c]),M=Boolean(z||a),D=P||M,I=(e=>`\n w-full transition-all duration-300 ease-out\n font-medium text-foreground placeholder:text-muted-foreground\n outline-none border-0 bg-transparent\n ${e?"resize":"resize-none"}\n p-4 text-base leading-6\n `.trim().replace(/\s+/g," "))(h),R=(({disabled:e,floatingLabel:t,isLabelFloated:r,focused:n,error:o})=>`\n relative overflow-visible rounded-lg\n bg-background shadow-sm transition-all duration-300\n hover:shadow-md\n ${e?"opacity-50 cursor-not-allowed bg-muted":""}\n ${t&&r?"":"border border-border hover:border-border/80"}\n ${!n||t&&r?"":"ring-2 ring-ring border-ring shadow-lg"}\n ${!o||t&&r?"":"ring-2 ring-destructive border-destructive"}\n `.trim().replace(/\s+/g," "))({disabled:n,floatingLabel:x,isLabelFloated:D,focused:P,error:r}),A=(({fluid:e,width:t,className:r})=>`\n ${e?"w-full":t?"":"w-auto"}\n ${r||""}\n `.trim())({fluid:O,width:k,className:e}),_=(e=>e?{width:e}:{})(k),B=((e,t)=>{const r=e||t||"";return"string"==typeof r?r.length:0})(a,z),W=(({isLabelFloated:e,focused:t,error:r})=>`\n absolute left-3 transition-all duration-200 pointer-events-none\n font-medium z-20\n ${e?"-top-2.5 text-xs px-2":"top-4 text-base px-0"}\n ${t?"text-ring":r?"text-destructive":e?"text-primary":"text-muted-foreground"}\n `.trim().replace(/\s+/g," "))({isLabelFloated:D,focused:P,error:r}),F=((e,t)=>`\n transition-all duration-200\n ${e?"border-ring":t?"border-destructive":"border-border"}\n `)(P,r),$=((e,t)=>{if(!e)return 0;const r=e.length+(t?1:0);return Math.max(7*r+16,40)})(g,m);return t.createElement("div",{className:A,style:_},g&&!x&&t.createElement(pg,{variant:"caption",color:"primary",fontWeight:"semibold",marginBottom:"small"},g,m&&t.createElement("span",{className:"text-destructive ml-1"},"*")),t.createElement("div",{className:R},x&&g&&D&&t.createElement(t.Fragment,null,t.createElement("div",{className:`absolute top-0 left-0 h-0 ${F} border-t-2`,style:{width:"12px",borderTopLeftRadius:"8px"}}),t.createElement("div",{className:`absolute top-0 ${F} border-t-2`,style:{left:`${12+$}px`,right:"0",height:"0",borderTopRightRadius:"8px"}}),t.createElement("div",{className:`absolute left-0 top-0 bottom-0 w-0 ${F} border-l-2`,style:{borderBottomLeftRadius:"8px"}}),t.createElement("div",{className:`absolute right-0 top-0 bottom-0 w-0 ${F} border-r-2`,style:{borderBottomRightRadius:"8px"}}),t.createElement("div",{className:`absolute bottom-0 left-0 right-0 h-0 ${F} border-b-2`,style:{borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"}}),P&&t.createElement("div",{className:"absolute inset-0 rounded-lg shadow-lg pointer-events-none"})),x&&g&&t.createElement("label",{className:W},g,m&&t.createElement("span",{className:"text-destructive ml-1"},"*")),t.createElement("textarea",{ref:j,className:`\n ${I}\n ${x&&g?"pt-6":""}\n `.trim().replace(/\s+/g," "),placeholder:x?"":o,value:a,defaultValue:l,onChange:L,onFocus:C,onBlur:T,disabled:n,readOnly:v,required:m,autoFocus:y,rows:d,maxLength:f,...E})),(b||w)&&t.createElement("div",{className:"flex justify-between items-center mt-2"},b&&t.createElement(pg,{variant:"captionSm",color:r?"tertiary":"quinary"},b),w&&f&&t.createElement(pg,{variant:"captionSm",color:B>.9*f?"tertiary":"quinary",className:"font-mono"},B,"/",f)))});var Zb,Kb;Xb.displayName="TextArea",function(e){e.Success="success",e.Error="error",e.Warning="warning",e.Info="info"}(Zb||(Zb={})),function(e){e.TopCenter="top-center",e.TopLeft="top-left",e.TopRight="top-right",e.BottomCenter="bottom-center",e.BottomLeft="bottom-left",e.BottomRight="bottom-right"}(Kb||(Kb={}));const Qb=({id:e,destroy:r,title:n,description:o,variant:l=Zb.Info,position:u=Kb.TopCenter,duration:p=5e3,animationDuration:d=400,icon:f,dataTestId:m})=>{const[v,y]=i(!1),[,h]=i(!1),g=c(null),b=c(null),w=c(0),x=c(p),O=s(()=>h(!0),[]),k=s(()=>h(!1),[]),E=s(()=>{b.current&&clearTimeout(b.current),y(!0),setTimeout(()=>{r()},d)},[r,d]);a(()=>(w.current=Date.now(),x.current=p,g.current&&(g.current.style.width="100%",g.current.style.transition="none",g.current.offsetWidth,g.current.style.transition=`width ${p}ms linear`,g.current.style.width="0%"),b.current=window.setTimeout(()=>{E()},p),()=>{b.current&&clearTimeout(b.current)}),[p,E]);const j={[Zb.Success]:{icon:"text-emerald-500 dark:text-emerald-400",progress:"bg-emerald-500 dark:bg-emerald-400"},[Zb.Error]:{icon:"text-destructive",progress:"bg-destructive"},[Zb.Warning]:{icon:"text-amber-500 dark:text-amber-400",progress:"bg-amber-500 dark:bg-amber-400"},[Zb.Info]:{icon:"text-primary",progress:"bg-primary"}}[l],P={[Kb.TopCenter]:v?"animate-slide-out-up":"animate-slide-in-down",[Kb.TopLeft]:v?"animate-slide-out-left":"animate-slide-in-left",[Kb.TopRight]:v?"animate-slide-out-right":"animate-slide-in-right",[Kb.BottomCenter]:v?"animate-slide-out-down":"animate-slide-in-up",[Kb.BottomLeft]:v?"animate-slide-out-left":"animate-slide-in-left",[Kb.BottomRight]:v?"animate-slide-out-right":"animate-slide-in-right"};return t.createElement("div",{id:e??`${l}-${"string"==typeof n?n:""}`,className:`\n relative group flex items-center justify-between pointer-events-auto\n rounded-lg max-w-md w-full overflow-hidden\n bg-background\n border border-border\n ${P[u]||P[Kb.TopCenter]}\n ${v?"opacity-0":"opacity-100"}\n transition-all duration-300 ease-out\n shadow-sm hover:shadow-md\n `,"data-test-id":m,onMouseEnter:O,onMouseLeave:k,style:{transition:`all ${d}ms cubic-bezier(0.4, 0, 0.2, 1)`}},t.createElement("div",{className:"flex items-center gap-3 px-4 py-3 w-full"},f&&t.createElement("div",{className:`flex-shrink-0 ${j.icon}`},f),t.createElement("div",{className:"flex flex-col min-w-0 flex-grow"},t.createElement("div",{className:"font-medium text-sm m-0 text-foreground"},n),o&&t.createElement("div",{className:"text-xs m-0 mt-0.5 text-muted-foreground truncate"},o)),t.createElement("button",{onClick:E,className:"\n flex-shrink-0 ml-2 p-1 rounded-md\n transition-all duration-200\n hover:bg-accent\n text-muted-foreground hover:text-accent-foreground\n ","aria-label":"Close notification"},t.createElement(rt,{size:14}))),!v&&t.createElement("div",{className:`absolute bottom-0 left-0 h-[2px] ${j.progress} opacity-80`,ref:g,style:{width:"100%",transformOrigin:"left"}}))};const Jb=new class{isSetup=!1;isBrowser="undefined"!=typeof window;containers={[Kb.TopCenter]:void 0,[Kb.TopLeft]:void 0,[Kb.TopRight]:void 0,[Kb.BottomCenter]:void 0,[Kb.BottomLeft]:void 0,[Kb.BottomRight]:void 0};roots={[Kb.TopCenter]:null,[Kb.TopLeft]:null,[Kb.TopRight]:null,[Kb.BottomCenter]:null,[Kb.BottomLeft]:null,[Kb.BottomRight]:null};messages={[Kb.TopCenter]:[],[Kb.TopLeft]:[],[Kb.TopRight]:[],[Kb.BottomCenter]:[],[Kb.BottomLeft]:[],[Kb.BottomRight]:[]};constructor(){this.isBrowser&&this.setup()}setup(){if(!this.isBrowser)return;const e=document.getElementsByTagName("body")[0];Object.values(Kb).forEach(t=>{const r=`message-container-${t}`;let n=document.getElementById(r);n||(n=document.createElement("div"),n.id=r,e.appendChild(n)),this.containers[t]=n,this.roots[t]=P(n)}),this.isSetup=!0}show(e){if(!this.isBrowser)return;this.isSetup||this.setup();const t=e.position||Kb.TopCenter,r=e.id||`message-${Math.random().toString().slice(2,11)}`,n=50*this.messages[t].length,o={id:r,...e,animationDuration:e.animationDuration||300,destroy:()=>this.destroy(r,t)};setTimeout(()=>{this.messages[t]=[o,...this.messages[t]],this.render(t)},n)}destroy(e,t=Kb.TopCenter){this.isBrowser&&(this.messages[t]=this.messages[t].filter(t=>t.id!==e),this.render(t))}success(e){this.show({icon:t.createElement(qh,{size:18}),...e,variant:Zb.Success})}error(e){this.show({icon:t.createElement(Wh,{size:18}),...e,variant:Zb.Error})}warning(e){this.show({icon:t.createElement(Bh,{size:18}),...e,variant:Zb.Warning})}info(e){this.show({icon:t.createElement(_h,{size:18}),...e,variant:Zb.Info})}getPositionStyles(e){switch(e){case Kb.TopLeft:return"fixed flex flex-col items-start justify-start gap-2 p-4 top-0 left-0 z-9999 pointer-events-none";case Kb.TopRight:return"fixed flex flex-col items-end justify-start gap-2 p-4 top-0 right-0 z-9999 pointer-events-none";case Kb.BottomCenter:return"fixed flex flex-col items-center justify-end gap-2 p-4 bottom-0 left-0 right-0 z-9999 pointer-events-none";case Kb.BottomLeft:return"fixed flex flex-col items-start justify-end gap-2 p-4 bottom-0 left-0 z-9999 pointer-events-none";case Kb.BottomRight:return"fixed flex flex-col items-end justify-end gap-2 p-4 bottom-0 right-0 z-9999 pointer-events-none";case Kb.TopCenter:default:return"fixed flex flex-col items-center justify-start gap-2 p-4 top-0 left-0 right-0 z-9999 pointer-events-none"}}render(e=Kb.TopCenter){if(!this.isBrowser||!this.roots[e])return;const r=this.messages[e].map(e=>t.createElement(Qb,{key:e.id,...e}));this.roots[e].render(t.createElement("div",{className:this.getPositionStyles(e)},r))}},ew="...",tw=({className:t,...r})=>e.createElement("nav",{role:"navigation","aria-label":"pagination",className:Ie("mx-auto flex w-full justify-center",t),...r}),rw=e.forwardRef(({className:t,...r},n)=>e.createElement("ul",{ref:n,className:Ie("flex flex-row items-center gap-1",t),...r}));rw.displayName="PaginationContent";const nw=e.forwardRef(({className:t,...r},n)=>e.createElement("li",{ref:n,className:Ie("",t),...r}));nw.displayName="PaginationItem";const ow=e.forwardRef(({className:t,isActive:r,size:n="medium",...o},i)=>e.createElement(ot,{ref:i,"aria-current":r?"page":void 0,variant:r?"primary":"link",size:n,className:Ie("h-9 w-9",t),...o}));ow.displayName="PaginationLink";const iw=e.forwardRef(({className:t,...r},n)=>e.createElement(ot,{ref:n,variant:"link",size:"medium",className:Ie("h-9 w-9",t),...r},e.createElement(Ye,{className:"h-4 w-4"}),e.createElement("span",{className:"sr-only"},"Previous page")));iw.displayName="PaginationPrevious";const aw=e.forwardRef(({className:t,...r},n)=>e.createElement(ot,{ref:n,variant:"link",size:"medium",className:Ie("h-9 w-9",t),...r},e.createElement("span",{className:"sr-only"},"Next page"),e.createElement(Ue,{className:"h-4 w-4"})));aw.displayName="PaginationNext";const lw=({className:t,...r})=>e.createElement("span",{"aria-hidden":!0,className:Ie("flex h-9 w-9 items-center justify-center",t),...r},e.createElement(Ze,{className:"h-4 w-4"}),e.createElement("span",{className:"sr-only"},"More pages"));lw.displayName="PaginationEllipsis";const sw=(e,t)=>{const r=t-e+1;return Array.from({length:r},(t,r)=>r+e)},cw=({currentPage:e,totalPages:r,onPageChange:n,siblingCount:o=1,className:i,disabled:c=!1,isLoading:u=!1,enableKeyboardNav:p=!1,showEllipsis:d=!0})=>{const f=l(()=>((e,t,r,n)=>{if(r+5>=t)return sw(1,t);const o=Math.max(e-r,1),i=Math.min(e+r,t),a=o>2,l=i<t-2;if(!a&&l){const e=sw(1,3+2*r);return n?[...e,ew,t]:[...e,t]}if(a&&!l){const e=sw(t-(3+2*r)+1,t);return n?[1,ew,...e]:[1,...e]}if(a&&l){const e=sw(o,i);return n?[1,ew,...e,ew,t]:[1,...e,t]}return sw(1,t)})(e,r,o,d),[e,r,o,d]),m=s(()=>{!c&&!u&&e>1&&n(e-1)},[e,n,c,u]),v=s(()=>{!c&&!u&&e<r&&n(e+1)},[e,r,n,c,u]),y=s(e=>{c||u||!p||("ArrowLeft"===e.key?(e.preventDefault(),m()):"ArrowRight"===e.key&&(e.preventDefault(),v()))},[m,v,c,u,p]);return a(()=>{if(p)return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[y,p]),0===e||f.length<2?null:t.createElement(tw,{className:Ie("select-none",i)},t.createElement(rw,null,t.createElement(nw,null,t.createElement(iw,{onClick:m,disabled:1===e||c||u,className:Ie("transition-all duration-200","hover:scale-105 hover:bg-accent",(c||u)&&"pointer-events-none opacity-50"),"aria-label":"Previous page"})),f.map((r,o)=>{if(r===ew)return t.createElement(nw,{key:`dots-${o}`},t.createElement(lw,null));const i=r,a=i===e;return t.createElement(nw,{key:i},t.createElement(ow,{isActive:a,onClick:()=>!c&&!u&&n(i),className:Ie("transition-all duration-200",a&&"hover:bg-primary/90",!a&&"hover:bg-accent hover:scale-105",(c||u)&&"pointer-events-none opacity-50"),"aria-label":`Page ${i}`,"aria-current":a?"page":void 0},i))}),t.createElement(nw,null,t.createElement(aw,{onClick:v,disabled:e===r||c||u,className:Ie("transition-all duration-200","hover:scale-105 hover:bg-accent",(c||u)&&"pointer-events-none opacity-50"),"aria-label":"Next page"}))))};var uw,pw,dw;!function(e){e.Left="left",e.Center="center",e.Right="right"}(uw||(uw={})),function(e){e.Left="left",e.Right="right",e.Center="center"}(pw||(pw={})),function(e){e.Text="text",e.Date="date",e.Status="status",e.Custom="custom"}(dw||(dw={}));const fw=(e=uw.Left)=>({left:"justify-start",center:"justify-center",right:"justify-end"}[e]),mw=(e,t,r,n,o,i)=>({toggleSorting:n=>{if(!t.find(t=>t.key===e))return;const o=n?"desc":"asc";i({key:e,direction:o}),r&&r(e,o)},getIsSorted:()=>!(!o||o.key!==e)&&o.direction,key:e,data:n}),vw=(e,t,r,n,o,i)=>mw(e,t,r,n,o,i),yw=e=>{switch(e){case pw.Right:return"ml-auto order-2";case pw.Center:return"mx-auto";default:return"order-1"}},hw=e=>{switch(e){case pw.Left:return"order-1";case pw.Center:return"mx-auto";default:return"ml-auto order-2"}},gw=(e=!1)=>e?{effectivePaginationPosition:pw.Left,effectiveEntriesPosition:pw.Right}:{effectivePaginationPosition:pw.Right,effectiveEntriesPosition:pw.Left},bw=(e,t)=>{if(!t)return e;const r=e.split(" ");return r.length<=t?e:`${r.slice(0,t).join(" ")}...`};var ww,xw={exports:{}};var Ow=(ww||(ww=1,xw.exports=function(){var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",l="day",s="week",c="month",u="quarter",p="year",d="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},h=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},g={s:h,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),o=r%60;return(t<=0?"+":"-")+h(n,2,"0")+":"+h(o,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),o=t.clone().add(n,c),i=r-o<0,a=t.clone().add(n+(i?-1:1),c);return+(-(n+(r-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:p,w:s,d:l,D:d,h:a,m:i,s:o,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",w={};w[b]=y;var x="$isDayjsObject",O=function(e){return e instanceof P||!(!e||!e[x])},k=function e(t,r,n){var o;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();w[i]&&(o=i),r&&(w[i]=r,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var l=t.name;w[l]=t,o=l}return!n&&o&&(b=o),o||!n&&b},E=function(e,t){if(O(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new P(r)},j=g;j.l=k,j.i=O,j.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var P=function(){function y(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var h=y.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(j.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(m);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(t)}(e),this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return j},h.isValid=function(){return!(this.$d.toString()===f)},h.isSame=function(e,t){var r=E(e);return this.startOf(t)<=r&&r<=this.endOf(t)},h.isAfter=function(e,t){return E(e)<this.startOf(t)},h.isBefore=function(e,t){return this.endOf(t)<E(e)},h.$g=function(e,t,r){return j.u(e)?this[t]:this.set(r,e)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(e,t){var r=this,n=!!j.u(t)||t,u=j.p(e),f=function(e,t){var o=j.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return n?o:o.endOf(l)},m=function(e,t){return j.w(r.toDate()[e].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},v=this.$W,y=this.$M,h=this.$D,g="set"+(this.$u?"UTC":"");switch(u){case p:return n?f(1,0):f(31,11);case c:return n?f(1,y):f(0,y+1);case s:var b=this.$locale().weekStart||0,w=(v<b?v+7:v)-b;return f(n?h-w:h+(6-w),y);case l:case d:return m(g+"Hours",0);case a:return m(g+"Minutes",1);case i:return m(g+"Seconds",2);case o:return m(g+"Milliseconds",3);default:return this.clone()}},h.endOf=function(e){return this.startOf(e,!1)},h.$set=function(e,t){var r,s=j.p(e),u="set"+(this.$u?"UTC":""),f=(r={},r[l]=u+"Date",r[d]=u+"Date",r[c]=u+"Month",r[p]=u+"FullYear",r[a]=u+"Hours",r[i]=u+"Minutes",r[o]=u+"Seconds",r[n]=u+"Milliseconds",r)[s],m=s===l?this.$D+(t-this.$W):t;if(s===c||s===p){var v=this.clone().set(d,1);v.$d[f](m),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else f&&this.$d[f](m);return this.init(),this},h.set=function(e,t){return this.clone().$set(e,t)},h.get=function(e){return this[j.p(e)]()},h.add=function(n,u){var d,f=this;n=Number(n);var m=j.p(u),v=function(e){var t=E(f);return j.w(t.date(t.date()+Math.round(e*n)),f)};if(m===c)return this.set(c,this.$M+n);if(m===p)return this.set(p,this.$y+n);if(m===l)return v(1);if(m===s)return v(7);var y=(d={},d[i]=t,d[a]=r,d[o]=e,d)[m]||1,h=this.$d.getTime()+n*y;return j.w(h,this)},h.subtract=function(e,t){return this.add(-1*e,t)},h.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||f;var n=e||"YYYY-MM-DDTHH:mm:ssZ",o=j.z(this),i=this.$H,a=this.$m,l=this.$M,s=r.weekdays,c=r.months,u=r.meridiem,p=function(e,r,o,i){return e&&(e[r]||e(t,n))||o[r].slice(0,i)},d=function(e){return j.s(i%12||12,e,"0")},m=u||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(v,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return j.s(t.$y,4,"0");case"M":return l+1;case"MM":return j.s(l+1,2,"0");case"MMM":return p(r.monthsShort,l,c,3);case"MMMM":return p(c,l);case"D":return t.$D;case"DD":return j.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(r.weekdaysMin,t.$W,s,2);case"ddd":return p(r.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(i);case"HH":return j.s(i,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return m(i,a,!0);case"A":return m(i,a,!1);case"m":return String(a);case"mm":return j.s(a,2,"0");case"s":return String(t.$s);case"ss":return j.s(t.$s,2,"0");case"SSS":return j.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(n,d,f){var m,v=this,y=j.p(d),h=E(n),g=(h.utcOffset()-this.utcOffset())*t,b=this-h,w=function(){return j.m(v,h)};switch(y){case p:m=w()/12;break;case c:m=w();break;case u:m=w()/3;break;case s:m=(b-g)/6048e5;break;case l:m=(b-g)/864e5;break;case a:m=b/r;break;case i:m=b/t;break;case o:m=b/e;break;default:m=b}return f?m:j.a(m)},h.daysInMonth=function(){return this.endOf(c).$D},h.$locale=function(){return w[this.$L]},h.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=k(e,t,!0);return n&&(r.$L=n),r},h.clone=function(){return j.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},y}(),S=P.prototype;return E.prototype=S,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",l],["$M",c],["$y",p],["$D",d]].forEach(function(e){S[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),E.extend=function(e,t){return e.$i||(e(t,P,E),e.$i=!0),E},E.locale=k,E.isDayjs=O,E.unix=function(e){return E(1e3*e)},E.en=w[b],E.Ls=w,E.p={},E}()),xw.exports),kw=it(Ow);const Ew={active:"bg-green-100 text-green-800",inactive:"bg-red-100 text-red-800",pending:"bg-yellow-100 text-yellow-800",completed:"bg-blue-100 text-blue-800",processing:"bg-purple-100 text-purple-800",default:"bg-gray-100 text-gray-800"},jw="name",Pw="200px",Sw="email",zw="joinDate",Nw="status",Cw=(e,r,n,o)=>{const i=r[e.key],a=fw(e.align),l=e=>t.createElement("div",{className:`flex w-full ${a}`},e);if(n&&e.customCell)return l(e.customCell(i,r));if(null==i)return l(null);switch(e.type){case dw.Date:{if(!e.dateFormat)return l(t.createElement(pg,{variant:"small",color:"primary"},String(i)));const r=kw(i,e.dateFormat.input).format(e.dateFormat.output);return l(t.createElement(pg,{variant:"small",color:"primary"},r))}case dw.Status:if(o){const e=String(i).toLowerCase(),r=Ew[e]||Ew.default;return l(t.createElement("span",{className:`px-2 py-1 text-xs font-medium rounded-full ${r}`},String(i)))}return l(t.createElement(pg,{variant:"small",color:"primary"},String(i)));case dw.Text:default:{const r=String(i),n=bw(r,e.maxWords);return l(t.createElement(pg,{variant:"small",color:"primary",className:n!==r?"truncate":"",title:r},n))}}},Tw=(e,r)=>r?.key!==e.key?t.createElement($e,{className:"h-4 w-4 opacity-40"}):"asc"===r.direction?t.createElement(Ge,{className:"h-4 w-4 text-primary"}):t.createElement(qe,{className:"h-4 w-4 text-primary"}),Lw=(e,r,n,o,i)=>{if(e.customHeader)return e.customHeader(r(e.key));const a=fw(e.align);return o&&e.sortable?t.createElement("div",{className:`flex w-full ${a}`},t.createElement(ot,{variant:"link",onClick:()=>n(e),className:"p-0 h-auto font-medium text-muted-foreground"},t.createElement("div",{className:"flex items-center"},t.createElement("span",{className:"truncate"},e.title),t.createElement("span",{className:"ml-2 inline-flex shrink-0"},Tw(e,i))))):t.createElement("div",{className:`flex w-full items-center h-9 ${a}`},t.createElement("span",{className:"truncate font-medium text-muted-foreground"},e.title))},Mw=(e,t,r,n,o)=>Lw(e,t,r,n,o),Dw={renderSortIcon:Tw,renderHeader:Lw,renderTableHeader:Mw},Iw=({columns:e,data:r,sortable:n=!1,pagination:o=!1,searchable:c=!1,currentPage:u=1,pageSize:p=5,onSort:d,onPageChange:f,actions:m,showCustomCells:v=!0,useBuiltInStatus:y=!0,swapPaginationLayout:h=!1,selectable:g=!1,onSelectionChange:b})=>{const[w,x]=i(null),[O,k]=i(u),[E,j]=i(p),[P,S]=i(""),[z,N]=i({}),[C,T]=i(!1),{effectivePaginationPosition:L,effectiveEntriesPosition:M}=gw(h);a(()=>{k(u)},[u]),a(()=>{g&&(N({}),T(!1))},[r,g]);const D=s(e=>{n&&e.sortable&&(w?.key===e.key?"asc"===w.direction?(x({key:e.key,direction:"desc"}),d&&d(e.key,"desc")):(x(null),d&&d("__clear_sort__","asc")):(x({key:e.key,direction:"asc"}),d&&d(e.key,"asc")))},[w,n,d]),I=s(e=>{n&&e.sortable&&D(e)},[n,D]),R=l(()=>w&&n?[...r].sort((e,t)=>{const r=e[w.key],n=t[w.key];return r<n?"asc"===w.direction?-1:1:r>n?"asc"===w.direction?1:-1:0}):r,[r,w,n]),A=s(e=>{S(e.target.value),k(1)},[]),_=l(()=>c&&P.trim()?R.filter(t=>e.some(e=>{const r=t[e.key];return null!=r&&String(r).toLowerCase().includes(P.toLowerCase())})):R,[R,e,P,c]),B=l(()=>Math.max(1,Math.ceil(_.length/E)),[_.length,E]),W=l(()=>{if(o){const e=(O-1)*E;return _.slice(e,e+E)}return _},[_,O,E,o]),F=s(e=>{e<1||e>B||(k(e),f&&f(e))},[B,f]),$=s(e=>{j(e),k(1)},[]),H=s((e,t)=>e.id||`row-${t}`,[]),V=s((e,t)=>{const r=H(e,t),n={...z,[r]:!z[r]};N(n);const o=W.every((e,t)=>!0===n[H(e,t)]);if(T(o),b){const e=W.filter((e,t)=>n[H(e,t)]);b(e)}},[z,W,b,H]),q=s(()=>{const e=!C;T(e);const t={...z};if(W.forEach((r,n)=>{const o=H(r,n);t[o]=e}),N(t),b){const t=e?[...W]:[];b(t)}},[C,W,z,b,H]),Y=l(()=>(e,t)=>Cw(e,t,v,y),[v,y]);return t.createElement("div",{className:"w-full"},t.createElement("div",{className:"flex flex-wrap items-center justify-between mb-6 gap-6"},c&&t.createElement("div",{className:"w-80"},t.createElement(fg,{id:"table-search",value:P,onChange:A,label:"Search",type:"search"})),o&&t.createElement("div",{className:"flex items-center space-x-3 ml-auto"},t.createElement("label",{htmlFor:"page-size-select",className:"text-sm font-medium text-muted-foreground"},"Rows per page"),t.createElement("select",{id:"page-size-select",value:E,onChange:e=>$(parseInt(e.target.value)),className:"h-9 rounded-md border border-input bg-background px-3 py-1 text-sm ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 transition-colors"},[5,10,20,50].map(e=>t.createElement("option",{key:e,value:e},e))))),t.createElement("div",{className:"relative w-full overflow-auto rounded-lg border shadow-xs"},t.createElement("table",{className:"w-full caption-bottom text-sm"},t.createElement("thead",{className:"bg-muted/40"},t.createElement("tr",{className:"border-b border-border"},g&&t.createElement("th",{className:"h-11 px-3 font-medium text-muted-foreground w-10"},t.createElement(Jh,{checked:C,onChange:q,dataTestId:"select-all-checkbox"})),e.map(r=>t.createElement("th",{key:r.key,className:"h-11 px-6 font-medium text-muted-foreground",style:{width:r.width||"auto"}},t.createElement("div",{className:"h-full flex items-center",onClick:()=>I(r)},Mw(r,t=>vw(t,e,d,W,w,x),D,n,w)))),m&&t.createElement("th",{className:"h-11 px-6 text-right font-medium text-muted-foreground"},t.createElement("div",{className:"flex items-center h-9 justify-end"},t.createElement("span",{className:"truncate font-medium text-muted-foreground"},"Actions"))))),t.createElement("tbody",{className:"[&_tr:last-child]:border-0"},W.length>0?W.map((r,n)=>t.createElement("tr",{key:H(r,n),className:"border-b border-border transition-colors hover:bg-muted/30 "+(z[H(r,n)]?"bg-muted/50":"")},g&&t.createElement("td",{className:"p-4 px-5 w-10"},t.createElement(Jh,{checked:!!z[H(r,n)],onChange:()=>V(r,n),dataTestId:`select-row-${n}`})),e.map(e=>t.createElement("td",{key:e.key,className:"p-4 px-6",style:{width:e.width||"auto"}},Y(e,r))),m&&t.createElement("td",{className:"p-4 px-6 text-right"},m(r)))):t.createElement("tr",null,t.createElement("td",{colSpan:e.length+(m?1:0)+(g?1:0),className:"py-10 px-6 text-center text-muted-foreground"},"No data available"))))),o&&B>0&&t.createElement("div",{className:"flex items-center justify-between px-3 mt-6 w-full"},t.createElement("div",{className:`text-sm font-medium text-muted-foreground whitespace-nowrap ${yw(M)}`},"Showing"," ",t.createElement("span",{className:"text-foreground"},Math.min((O-1)*E+1,_.length))," ","to"," ",t.createElement("span",{className:"text-foreground"},Math.min(O*E,_.length))," ","of ",t.createElement("span",{className:"text-foreground"},_.length)," ","entries"),t.createElement("div",{className:hw(L)},t.createElement(cw,{currentPage:O,totalPages:B,onPageChange:F,disabled:!1,isLoading:!1}))))},Rw=(e,t,r)=>({key:e,title:t,type:dw.Text,width:r?.width,sortable:r?.sortable,align:r?.align||uw.Left,customCell:r?.customCell,maxWords:r?.maxWords}),Aw=(e,t,r)=>({key:e,title:t,type:dw.Date,width:r?.width,sortable:r?.sortable,align:r?.align||uw.Left,dateFormat:{input:r?.inputFormat,output:r?.outputFormat||"MMM DD, YYYY"},customCell:r?.customCell}),_w=(e,t,r)=>({key:e,title:t,type:dw.Status,width:r?.width,sortable:r?.sortable,align:r?.align||uw.Center,customCell:r?.customCell}),Bw=(e,r)=>{const{enableTruncation:n=!1,maxWords:o=5}=r||{},i=Rw("description","Description",{sortable:!0,...n&&{maxWords:2*o}});return[Rw(jw,"Name",{width:Pw,sortable:!0,...n&&{maxWords:o},customCell:e?e=>t.createElement("div",{className:"flex items-center"},t.createElement("div",{className:"h-8 w-8 rounded-full bg-gray-200 mr-3 flex items-center justify-center"},t.createElement(pg,{variant:"small",color:"secondary"},e.charAt(0))),t.createElement(pg,{variant:"small",color:"secondary",fontWeight:"semibold"},e)):void 0}),Rw(Sw,"Email",{...n&&{maxWords:o},customCell:e?e=>t.createElement("a",{href:`mailto:${e}`,className:"hover:underline"},t.createElement(pg,{variant:"small",color:"secondary"},e)):void 0}),i,Aw(zw,"Join Date",{sortable:!0,inputFormat:"YYYY-MM-DD",outputFormat:"MMM DD, YYYY"}),e?Rw(Nw,"Status",{align:uw.Center,customCell:e=>{const r=e;return t.createElement("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full"},t.createElement(pg,{variant:"small",color:"secondary",fontWeight:"semibold"},r))}}):_w(Nw,"Status",{align:uw.Center})]};function Ww(t){var r=t.children,n=t.prefixCls,o=t.id,i=t.overlayInnerStyle,a=t.bodyClassName,l=t.className,s=t.style;return e.createElement("div",{className:og("".concat(n,"-content"),l),style:s},e.createElement("div",{className:og("".concat(n,"-inner"),a),id:o,role:"tooltip",style:i},"function"==typeof r?r():r))}function Fw(){return Fw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fw.apply(null,arguments)}function $w(e){return $w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$w(e)}function Hw(e){var t=function(e,t){if("object"!=$w(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=$w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$w(t)?t:t+""}function Vw(e,t,r){return(t=Hw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Yw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qw(Object(r),!0).forEach(function(t){Vw(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qw(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Uw(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Gw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Xw(e,t){if(e){if("string"==typeof e)return Gw(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Gw(e,t):void 0}}function Zw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,l=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||Xw(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kw(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}var Qw={},Jw=[];function ex(e,t){if("production"!==process.env.NODE_ENV&&!e&&void 0!==console){var r=Jw.reduce(function(e,t){return t(null!=e?e:"","warning")},t);r&&console.error("Warning: ".concat(r))}}function tx(e,t){if("production"!==process.env.NODE_ENV&&!e&&void 0!==console){var r=Jw.reduce(function(e,t){return t(null!=e?e:"","note")},t);r&&console.warn("Note: ".concat(r))}}function rx(e,t,r){t||Qw[r]||(e(!1,r),Qw[r]=!0)}function nx(e,t){rx(ex,e,t)}nx.preMessage=function(e){Jw.push(e)},nx.resetWarned=function(){Qw={}},nx.noteOnce=function(e,t){rx(tx,e,t)};var ox,ix={exports:{}},ax={};var lx,sx,cx={};
|
|
44
|
+
*/var rg,ng=(eg||(eg=1,rg=tg,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=n(e,r(o)))}return e}function r(r){if("string"==typeof r||"number"==typeof r)return r;if("object"!=typeof r)return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var o="";for(var i in r)e.call(r,i)&&r[i]&&(o=n(o,i));return o}function n(e,t){return t?e?e+" "+t:e+t:e}rg.exports?(t.default=t,rg.exports=t):window.classNames=t}()),tg.exports),og=it(ng);const ig={extraSmall:"mt-1 mb-1",small:"mt-2 mb-2",medium:"mt-4 mb-4",large:"mt-6 mb-6",extraLarge:"mt-8 mb-8"},ag={tight:"tracking-tight",normal:"tracking-normal",wide:"tracking-wide",wider:"tracking-wider",widest:"tracking-widest"},lg={h1:"text-4xl",h2:"text-3xl",h3:"text-2xl",h4:"text-xl",h5:"text-lg",h6:"text-base"},sg={primary:"text-primary",secondary:"text-secondary",tertiary:"text-destructive",quaternary:"text-warning",quinary:"text-muted-foreground",white:"text-white",harford:"text-[#043d5a]"},cg={normal:"font-normal",bold:"font-bold",semibold:"font-semibold",light:"font-light"},ug={body:"text-base",paragraph:"text-lg",caption:"text-sm",small:"text-xs",regular:"text-base",paragraphSm:"text-md",captionSm:"text-xs"},pg=({variant:e,color:r="quaternary",marginTop:n,marginBottom:o,letterSpacing:i,textAlign:a="text-left",fontWeight:l="normal",children:s,...c})=>{const u=og(ug[e],sg[r],cg[l],n?ig[n]:"",o?ig[o]:"",i?ag[i]:"",a);return t.createElement("p",{className:u,...c},s)},dg=({variant:e="h1",color:r="harford",marginTop:n,marginBottom:o,letterSpacing:i,textAlign:a="text-left",fontWeight:l="normal",children:s,...c})=>{const u=og(lg[e],sg[r],cg[l],n?ig[n]:"",o?ig[o]:"",i?ag[i]:"",a);return t.createElement(e,{className:u,...c},s)},fg=({value:e,fluid:r,label:n,leftIcon:o,rightIcon:a,togglePassword:s,error:c,success:u,hint:p,disabled:d,type:f="text",hintTextProps:m={variant:"small"},className:v="",dataTestId:y,inputSize:h,...g})=>{const[b,w]=i(!1),[x,O]=i(!1),k=l(()=>b?t.createElement(Xh,{name:"EyeOff",size:16}):t.createElement(Xh,{name:"Eye",size:16}),[b]),E=n&&(e||x),j=(()=>{if(!n||!E)return 0;const e=n.length;return Math.max(8*e+24,50)})(),P=l(()=>{let e="relative flex items-center px-3 py-2 rounded-lg overflow-visible min-h-[2.5rem]";return n&&E||(e+=" border"),d?e+=" bg-muted text-muted-foreground":c?e+=" text-destructive":u&&(e+=" text-success"),r&&(e+=" w-full"),`${e} ${v}`},[d,c,u,E,n,r,v]),S=l(()=>{let e="peer w-full outline-none bg-transparent placeholder-transparent text-sm leading-5 transition-colors duration-200";return e+=d?" text-muted-foreground cursor-not-allowed":" text-foreground","password"===f&&(e+=" pr-8"),"number"===f&&(e+=" appearance-none"),e},[d,f]),z=l(()=>"password"===f&&b?"text":f,[f,b]),N=l(()=>{let e="absolute left-2 px-2 transform transition-all duration-200 ease-in-out z-20 pointer-events-none";return e+=E?" -top-4 text-sm text-muted-foreground":" top-1/2 -translate-y-1/2 text-base text-muted-foreground",x&&!d?e+=" text-primary":c?e+=" text-destructive":u&&(e+=" text-success"),e},[E,x,d,c,u]),C=d?"border-input":c?"border-destructive":u?"border-success":x||e?"border-primary":"border-input",T=x?"border-t-2 border-l-2 border-r-2 border-b-2":"border-t border-l border-r border-b";return t.createElement("div",{className:P},n&&E&&t.createElement(t.Fragment,null,t.createElement("div",{className:`absolute top-0 left-0 h-0 transition-all duration-200 ${T.split(" ")[0]} ${C}`,style:{width:"12px",borderTopLeftRadius:"8px"}}),t.createElement("div",{className:`absolute top-0 transition-all duration-200 ${T.split(" ")[0]} ${C}`,style:{left:`${12+j}px`,right:"0",height:"0",borderTopRightRadius:"8px"}}),t.createElement("div",{className:`absolute left-0 top-0 bottom-0 w-0 transition-all duration-200 ${T.split(" ")[1]} ${C}`,style:{borderBottomLeftRadius:"8px"}}),t.createElement("div",{className:`absolute right-0 top-0 bottom-0 w-0 transition-all duration-200 ${T.split(" ")[2]} ${C}`,style:{borderBottomRightRadius:"8px"}}),t.createElement("div",{className:`absolute bottom-0 left-0 right-0 h-0 transition-all duration-200 ${T.split(" ")[3]} ${C}`,style:{borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"}})),o&&t.createElement("div",{className:"flex items-center mr-2 text-muted-foreground"},o),t.createElement("div",{className:"relative w-full"},t.createElement("input",{...g,"data-test-id":y,id:g.id,value:e,disabled:d,type:z,className:S,placeholder:" ",onFocus:e=>{O(!0),g.onFocus?.(e)},onBlur:e=>{O(!1),g.onBlur?.(e)}}),n&&t.createElement("label",{htmlFor:g.id,className:N},n)),"password"===f&&s&&t.createElement("button",{type:"button",className:"absolute right-3 text-muted-foreground hover:text-foreground transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{!d&&e&&w(!b)},disabled:d,tabIndex:-1},k),a&&t.createElement("div",{className:"flex items-center ml-2 text-muted-foreground"},a),(c||u||p)&&t.createElement("div",{className:"absolute top-full left-0 mt-1 text-sm w-full"},t.createElement(pg,{...m},c?.message||u?.message&&!c?.message||!c?.message&&!u?.message&&p?.message)))};function mg(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function vg(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function yg(...e){return t=>{let r=!1;const n=e.map(e=>{const n=vg(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():vg(e[t],null)}}}}function hg(...t){return e.useCallback(yg(...t),t)}function gg(t,r=[]){let n=[];const o=()=>{const r=n.map(t=>e.createContext(t));return function(n){const o=n?.[t]||r;return e.useMemo(()=>({[`__scope${t}`]:{...n,[t]:o}}),[n,o])}};return o.scopeName=t,[function(r,o){const i=e.createContext(o),a=n.length;n=[...n,o];const l=r=>{const{scope:n,children:o,...l}=r,s=n?.[t]?.[a]||i,c=e.useMemo(()=>l,Object.values(l));return w(s.Provider,{value:c,children:o})};return l.displayName=r+"Provider",[l,function(n,l){const s=l?.[t]?.[a]||i,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${r}\``)}]},bg(o,...r)]}function bg(...t){const r=t[0];if(1===t.length)return r;const n=()=>{const n=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=n.reduce((e,{useScope:r,scopeName:n})=>({...e,...r(t)[`__scope${n}`]}),{});return e.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])}};return n.scopeName=r.scopeName,n}function wg(t){const r=Og(t),n=e.forwardRef((t,n)=>{const{children:o,...i}=t,a=e.Children.toArray(o),l=a.find(Eg);if(l){const t=l.props.children,o=a.map(r=>r===l?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:r);return w(r,{...i,ref:n,children:e.isValidElement(t)?e.cloneElement(t,void 0,o):null})}return w(r,{...i,ref:n,children:o})});return n.displayName=`${t}.Slot`,n}var xg=wg("Slot");function Og(t){const r=e.forwardRef((t,r)=>{const{children:n,...o}=t;if(e.isValidElement(n)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(n),i=function(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...i}:"className"===n&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}(o,n.props);return n.type!==e.Fragment&&(i.ref=r?yg(r,t):t),e.cloneElement(n,i)}return e.Children.count(n)>1?e.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}var kg=Symbol("radix.slottable");function Eg(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===kg}var jg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=wg(`Primitive.${r}`),o=e.forwardRef((e,t)=>{const{asChild:o,...i}=e,a=o?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),w(a,{...i,ref:t})});return o.displayName=`Primitive.${r}`,{...t,[r]:o}},{});var Pg=globalThis?.document?e.useLayoutEffect:()=>{},Sg=e[" useId ".trim().toString()]||(()=>{}),zg=0;function Ng(t){const[r,n]=e.useState(Sg());return Pg(()=>{n(e=>e??String(zg++))},[t]),r?`radix-${r}`:""}function Cg(t){const r=e.useRef(t);return e.useEffect(()=>{r.current=t}),e.useMemo(()=>(...e)=>r.current?.(...e),[])}var Tg=e[" useInsertionEffect ".trim().toString()]||Pg;function Lg({prop:t,defaultProp:r,onChange:n=()=>{},caller:o}){const[i,a,l]=function({defaultProp:t,onChange:r}){const[n,o]=e.useState(t),i=e.useRef(n),a=e.useRef(r);return Tg(()=>{a.current=r},[r]),e.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,o,a]}({defaultProp:r,onChange:n}),s=void 0!==t,c=s?t:i;{const r=e.useRef(void 0!==t);e.useEffect(()=>{const e=r.current;if(e!==s){const t=e?"controlled":"uncontrolled",r=s?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}r.current=s},[s,o])}const u=e.useCallback(e=>{if(s){const r=function(e){return"function"==typeof e}(e)?e(t):e;r!==t&&l.current?.(r)}else a(e)},[s,t,a,l]);return[c,u]}var Mg=e.createContext(void 0);function Dg(t){const r=e.useContext(Mg);return t||r||"ltr"}var Ig="rovingFocusGroup.onEntryFocus",Rg={bubbles:!1,cancelable:!0},Ag="RovingFocusGroup",[_g,Bg,Wg]=function(e){const r=e+"CollectionProvider",[n,o]=gg(r),[i,a]=n(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:r,children:n}=e,o=t.useRef(null),a=t.useRef(new Map).current;return w(i,{scope:r,itemMap:a,collectionRef:o,children:n})};l.displayName=r;const s=e+"CollectionSlot",c=wg(s),u=t.forwardRef((e,t)=>{const{scope:r,children:n}=e,o=hg(t,a(s,r).collectionRef);return w(c,{ref:o,children:n})});u.displayName=s;const p=e+"CollectionItemSlot",d="data-radix-collection-item",f=wg(p),m=t.forwardRef((e,r)=>{const{scope:n,children:o,...i}=e,l=t.useRef(null),s=hg(r,l),c=a(p,n);return t.useEffect(()=>(c.itemMap.set(l,{ref:l,...i}),()=>{c.itemMap.delete(l)})),w(f,{[d]:"",ref:s,children:o})});return m.displayName=p,[{Provider:l,Slot:u,ItemSlot:m},function(r){const n=a(e+"CollectionConsumer",r);return t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[n.collectionRef,n.itemMap])},o]}(Ag),[Fg,$g]=gg(Ag,[Wg]),[Hg,Vg]=Fg(Ag),qg=e.forwardRef((e,t)=>w(_g.Provider,{scope:e.__scopeRovingFocusGroup,children:w(_g.Slot,{scope:e.__scopeRovingFocusGroup,children:w(Yg,{...e,ref:t})})}));qg.displayName=Ag;var Yg=e.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...d}=t,f=e.useRef(null),m=hg(r,f),v=Dg(a),[y,h]=Lg({prop:l,defaultProp:s??null,onChange:c,caller:Ag}),[g,b]=e.useState(!1),x=Cg(u),O=Bg(n),k=e.useRef(!1),[E,j]=e.useState(0);return e.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(Ig,x),()=>e.removeEventListener(Ig,x)},[x]),w(Hg,{scope:n,orientation:o,dir:v,loop:i,currentTabStopId:y,onItemFocus:e.useCallback(e=>h(e),[h]),onItemShiftTab:e.useCallback(()=>b(!0),[]),onFocusableItemAdd:e.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>j(e=>e-1),[]),children:w(jg.div,{tabIndex:g||0===E?-1:0,"data-orientation":o,...d,ref:m,style:{outline:"none",...t.style},onMouseDown:mg(t.onMouseDown,()=>{k.current=!0}),onFocus:mg(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent(Ig,Rg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=O().filter(e=>e.focusable);Zg([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:mg(t.onBlur,()=>b(!1))})})}),Ug="RovingFocusGroupItem",Gg=e.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:a,children:l,...s}=t,c=Ng(),u=a||c,p=Vg(Ug,n),d=p.currentTabStopId===u,f=Bg(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:y}=p;return e.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),w(_g.ItemSlot,{scope:n,id:u,focusable:o,active:i,children:w(jg.span,{tabIndex:d?0:-1,"data-orientation":p.orientation,...s,ref:r,onMouseDown:mg(t.onMouseDown,e=>{o?p.onItemFocus(u):e.preventDefault()}),onFocus:mg(t.onFocus,()=>p.onItemFocus(u)),onKeyDown:mg(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:Xg[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=p.loop?(n=i+1,(r=o).map((e,t)=>r[(n+t)%r.length])):o.slice(i+1)}setTimeout(()=>Zg(o))}var r,n}),children:"function"==typeof l?l({isCurrentTabStop:d,hasTabStop:null!=y}):l})})});Gg.displayName=Ug;var Xg={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Zg(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var Kg=qg,Qg=Gg;function Jg(t){const[r,n]=e.useState(void 0);return Pg(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const r=e[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=t.offsetWidth,i=t.offsetHeight;n({width:o,height:i})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}n(void 0)},[t]),r}function eb(t){const r=e.useRef({value:t,previous:t});return e.useMemo(()=>(r.current.value!==t&&(r.current.previous=r.current.value,r.current.value=t),r.current.previous),[t])}var tb=t=>{const{present:r,children:n}=t,o=function(t){const[r,n]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,r){return e.useReducer((e,t)=>r[e][t]??e,t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=rb(o.current);a.current="mounted"===s?e:"none"},[s]),Pg(()=>{const e=o.current,r=i.current;if(r!==t){const n=a.current,o=rb(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(r&&n!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,c]),Pg(()=>{if(r){let e;const t=r.ownerDocument.defaultView??window,n=n=>{const a=rb(o.current).includes(n.animationName);if(n.target===r&&a&&(c("ANIMATION_END"),!i.current)){const n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},l=e=>{e.target===r&&(a.current=rb(o.current))};return r.addEventListener("animationstart",l),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",l),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}c("ANIMATION_END")},[r,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(r),i="function"==typeof n?n({present:o.isPresent}):e.Children.only(n),a=hg(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof n||o.isPresent?e.cloneElement(i,{ref:a}):null};function rb(e){return e?.animationName||"none"}tb.displayName="Presence";var nb="Radio",[ob,ib]=gg(nb),[ab,lb]=ob(nb),sb=e.forwardRef((t,r)=>{const{__scopeRadio:n,name:o,checked:i=!1,required:a,disabled:l,value:s="on",onCheck:c,form:u,...p}=t,[d,f]=e.useState(null),m=hg(r,e=>f(e)),v=e.useRef(!1),y=!d||(u||!!d.closest("form"));return O(ab,{scope:n,checked:i,disabled:l,children:[w(jg.button,{type:"button",role:"radio","aria-checked":i,"data-state":db(i),"data-disabled":l?"":void 0,disabled:l,value:s,...p,ref:m,onClick:mg(t.onClick,e=>{i||c?.(),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&w(pb,{control:d,bubbles:!v.current,name:o,value:s,checked:i,required:a,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});sb.displayName=nb;var cb="RadioIndicator",ub=e.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...o}=e,i=lb(cb,r);return w(tb,{present:n||i.checked,children:w(jg.span,{"data-state":db(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});ub.displayName=cb;var pb=e.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:o=!0,...i},a)=>{const l=e.useRef(null),s=hg(l,a),c=eb(n),u=Jg(r);return e.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(c!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[c,n,o]),w(jg.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function db(e){return e?"checked":"unchecked"}pb.displayName="RadioBubbleInput";var fb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],mb="RadioGroup",[vb,yb]=gg(mb,[$g,ib]),hb=$g(),gb=ib(),[bb,wb]=vb(mb),xb=e.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:o,value:i,required:a=!1,disabled:l=!1,orientation:s,dir:c,loop:u=!0,onValueChange:p,...d}=e,f=hb(r),m=Dg(c),[v,y]=Lg({prop:i,defaultProp:o??null,onChange:p,caller:mb});return w(bb,{scope:r,name:n,required:a,disabled:l,value:v,onValueChange:y,children:w(Kg,{asChild:!0,...f,orientation:s,dir:m,loop:u,children:w(jg.div,{role:"radiogroup","aria-required":a,"aria-orientation":s,"data-disabled":l?"":void 0,dir:m,...d,ref:t})})})});xb.displayName=mb;var Ob="RadioGroupItem",kb=e.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:o,...i}=t,a=wb(Ob,n),l=a.disabled||o,s=hb(n),c=gb(n),u=e.useRef(null),p=hg(r,u),d=a.value===i.value,f=e.useRef(!1);return e.useEffect(()=>{const e=e=>{fb.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),w(Qg,{asChild:!0,...s,focusable:!l,active:d,children:w(sb,{disabled:l,required:a.required,checked:d,...c,...i,name:a.name,ref:p,onCheck:()=>a.onValueChange(i.value),onKeyDown:mg(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:mg(i.onFocus,()=>{f.current&&u.current?.click()})})})});kb.displayName=Ob;var Eb=e.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,o=gb(r);return w(ub,{...o,...n,ref:t})});Eb.displayName="RadioGroupIndicator";var jb=xb,Pb=kb,Sb=Eb;const zb=t.forwardRef(({className:e,classNames:r,showIcons:n=!0,withCard:o=!0,options:i,...a},l)=>t.createElement(jb,{ref:l,className:Ie("grid gap-2",e,r?.root),...a},i.map(e=>t.createElement("div",{key:e.id,className:Ie("relative")},t.createElement("label",{htmlFor:e.id,className:Ie("relative flex w-full items-center gap-x-3",o&&["cursor-pointer rounded-lg border-2 p-4","border-input bg-background hover:bg-accent hover:text-accent-foreground","data-[state=checked]:border-primary data-[state=checked]:bg-primary/5"],!o&&"cursor-pointer py-2",r?.label)},t.createElement(Pb,{value:e.id,id:e.id,className:Ie("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background","focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",r?.item)},t.createElement(Sb,{className:Ie("flex items-center justify-center",r?.indicator)},t.createElement(Xe,{className:"h-2.5 w-2.5 fill-current text-current"}))),t.createElement("div",{className:"flex flex-1 items-center justify-between"},t.createElement("div",{className:Ie("space-y-1",!e.description&&"space-y-0")},t.createElement("p",{className:Ie("text-sm font-medium leading-none","peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r?.text)},e.label),e.description&&t.createElement("p",{className:Ie("text-sm text-muted-foreground",r?.description)},e.description)),n&&e.icon&&t.createElement("div",{className:Ie("ml-4 shrink-0 text-muted-foreground",r?.icon)},e.icon)))))));zb.displayName="RadioGroup";var Nb="Switch",[Cb,Tb]=gg(Nb),[Lb,Mb]=Cb(Nb),Db=e.forwardRef((t,r)=>{const{__scopeSwitch:n,name:o,checked:i,defaultChecked:a,required:l,disabled:s,value:c="on",onCheckedChange:u,form:p,...d}=t,[f,m]=e.useState(null),v=hg(r,e=>m(e)),y=e.useRef(!1),h=!f||(p||!!f.closest("form")),[g,b]=Lg({prop:i,defaultProp:a??!1,onChange:u,caller:Nb});return O(Lb,{scope:n,checked:g,disabled:s,children:[w(jg.button,{type:"button",role:"switch","aria-checked":g,"aria-required":l,"data-state":_b(g),"data-disabled":s?"":void 0,disabled:s,value:c,...d,ref:v,onClick:mg(t.onClick,e=>{b(e=>!e),h&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),h&&w(Ab,{control:f,bubbles:!y.current,name:o,value:c,checked:g,required:l,disabled:s,form:p,style:{transform:"translateX(-100%)"}})]})});Db.displayName=Nb;var Ib="SwitchThumb",Rb=e.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=Mb(Ib,r);return w(jg.span,{"data-state":_b(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});Rb.displayName=Ib;var Ab=e.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:o=!0,...i},a)=>{const l=e.useRef(null),s=hg(l,a),c=eb(n),u=Jg(r);return e.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(c!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[c,n,o]),w("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function _b(e){return e?"checked":"unchecked"}Ab.displayName="SwitchBubbleInput";var Bb=Db,Wb=Rb;const Fb="medium",$b="primary",Hb={small:{switch:"w-8 h-4",thumb:"w-3 h-3",translate:"translate-x-4"},medium:{switch:"w-11 h-6",thumb:"w-5 h-5",translate:"translate-x-5"},large:{switch:"w-14 h-7",thumb:"w-6 h-6",translate:"translate-x-7"}},Vb={primary:{background:"bg-primary",foreground:"text-primary-foreground",hover:"hover:bg-primary/90"},success:{background:"bg-[rgb(var(--success))]",foreground:"text-[rgb(var(--success-foreground))]",hover:"hover:bg-[rgb(var(--success))]/90"},danger:{background:"bg-destructive",foreground:"text-destructive-foreground",hover:"hover:bg-destructive/90"},warning:{background:"bg-[rgb(var(--warning))]",foreground:"text-foreground",hover:"hover:bg-[rgb(var(--warning))]/90"}},qb=({label:t,description:r,dataTestId:n})=>t||r?e.createElement("div",{className:"flex flex-col gap-1.5","data-test-id":n},t&&e.createElement(pg,{variant:"regular",color:"secondary"},t),r&&e.createElement(pg,{variant:"small",color:"secondary"},r)):null,Yb=e.forwardRef(({label:t,description:r,size:n=Fb,variant:o=$b,disabled:i=!1,loading:a=!1,className:l,onChange:s,dataTestId:c,checked:u,id:p,...d},f)=>{const m=n||Fb,v=o||$b;return e.createElement("div",{className:"flex items-center"},e.createElement("label",{htmlFor:p,className:Ie("relative inline-flex items-start gap-3 select-none",i&&"cursor-not-allowed opacity-60",l)},e.createElement("div",{className:"relative"},e.createElement(Bb,{id:p,checked:u,onCheckedChange:e=>{i||a||s?.(e)},disabled:i||a,"data-test-id":`${c}-root`,ref:f,...d,className:Ie("peer relative inline-flex shrink-0 cursor-pointer rounded-full transition-colors","border-2 border-transparent","focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",Hb[m].switch,u?Ie(Vb[v].background,Vb[v].foreground):"bg-input",i&&"cursor-not-allowed")},e.createElement(Wb,{className:Ie("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform","flex items-center justify-center",Hb[m].thumb,u?Hb[m].translate:"translate-x-0.5"),"data-test-id":`${c}-thumb`},a&&e.createElement(et,{className:"animate-spin text-black",size:{small:12,medium:16,large:20}[m]})))),e.createElement(qb,{label:t,description:r,dataTestId:c,disabled:i})))});Yb.displayName="Switch";const Ub=["small","medium","large"],Gb=["primary","success","danger","warning"],Xb=r(({className:e="",error:r=!1,disabled:n=!1,placeholder:o,value:a,defaultValue:l,onChange:c,onFocus:u,onBlur:p,rows:d=3,maxLength:f,required:m=!1,readOnly:v=!1,autoFocus:y=!1,resize:h=!1,label:g,helperText:b,showCharCount:w=!1,floatingLabel:x=!1,fluid:O=!0,width:k,...E},j)=>{const[P,S]=i(!1),[z,N]=i(a||l||""),C=s(e=>{S(!0),u?.(e)},[u]),T=s(e=>{S(!1),p?.(e)},[p]),L=s(e=>{N(e.target.value),c?.(e)},[c]),M=Boolean(z||a),D=P||M,I=(e=>`\n w-full transition-all duration-300 ease-out\n font-medium text-foreground placeholder:text-muted-foreground\n outline-none border-0 bg-transparent\n ${e?"resize":"resize-none"}\n p-4 text-base leading-6\n `.trim().replace(/\s+/g," "))(h),R=(({disabled:e,floatingLabel:t,isLabelFloated:r,focused:n,error:o})=>`\n relative overflow-visible rounded-lg\n bg-background shadow-sm transition-all duration-300\n hover:shadow-md\n ${e?"opacity-50 cursor-not-allowed bg-muted":""}\n ${t&&r?"":"border border-border hover:border-border/80"}\n ${!n||t&&r?"":"ring-2 ring-ring border-ring shadow-lg"}\n ${!o||t&&r?"":"ring-2 ring-destructive border-destructive"}\n `.trim().replace(/\s+/g," "))({disabled:n,floatingLabel:x,isLabelFloated:D,focused:P,error:r}),A=(({fluid:e,width:t,className:r})=>`\n ${e?"w-full":t?"":"w-auto"}\n ${r||""}\n `.trim())({fluid:O,width:k,className:e}),_=(e=>e?{width:e}:{})(k),B=((e,t)=>{const r=e||t||"";return"string"==typeof r?r.length:0})(a,z),W=(({isLabelFloated:e,focused:t,error:r})=>`\n absolute left-3 transition-all duration-200 pointer-events-none\n font-medium z-20\n ${e?"-top-2.5 text-xs px-2":"top-4 text-base px-0"}\n ${t?"text-ring":r?"text-destructive":e?"text-primary":"text-muted-foreground"}\n `.trim().replace(/\s+/g," "))({isLabelFloated:D,focused:P,error:r}),F=((e,t)=>`\n transition-all duration-200\n ${e?"border-ring":t?"border-destructive":"border-border"}\n `)(P,r),$=((e,t)=>{if(!e)return 0;const r=e.length+(t?1:0);return Math.max(7*r+16,40)})(g,m);return t.createElement("div",{className:A,style:_},g&&!x&&t.createElement(pg,{variant:"caption",color:"primary",fontWeight:"semibold",marginBottom:"small"},g,m&&t.createElement("span",{className:"text-destructive ml-1"},"*")),t.createElement("div",{className:R},x&&g&&D&&t.createElement(t.Fragment,null,t.createElement("div",{className:`absolute top-0 left-0 h-0 ${F} border-t-2`,style:{width:"12px",borderTopLeftRadius:"8px"}}),t.createElement("div",{className:`absolute top-0 ${F} border-t-2`,style:{left:`${12+$}px`,right:"0",height:"0",borderTopRightRadius:"8px"}}),t.createElement("div",{className:`absolute left-0 top-0 bottom-0 w-0 ${F} border-l-2`,style:{borderBottomLeftRadius:"8px"}}),t.createElement("div",{className:`absolute right-0 top-0 bottom-0 w-0 ${F} border-r-2`,style:{borderBottomRightRadius:"8px"}}),t.createElement("div",{className:`absolute bottom-0 left-0 right-0 h-0 ${F} border-b-2`,style:{borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"}}),P&&t.createElement("div",{className:"absolute inset-0 rounded-lg shadow-lg pointer-events-none"})),x&&g&&t.createElement("label",{className:W},g,m&&t.createElement("span",{className:"text-destructive ml-1"},"*")),t.createElement("textarea",{ref:j,className:`\n ${I}\n ${x&&g?"pt-6":""}\n `.trim().replace(/\s+/g," "),placeholder:x?"":o,value:a,defaultValue:l,onChange:L,onFocus:C,onBlur:T,disabled:n,readOnly:v,required:m,autoFocus:y,rows:d,maxLength:f,...E})),(b||w)&&t.createElement("div",{className:"flex justify-between items-center mt-2"},b&&t.createElement(pg,{variant:"captionSm",color:r?"tertiary":"quinary"},b),w&&f&&t.createElement(pg,{variant:"captionSm",color:B>.9*f?"tertiary":"quinary",className:"font-mono"},B,"/",f)))});var Zb,Kb;Xb.displayName="TextArea",function(e){e.Success="success",e.Error="error",e.Warning="warning",e.Info="info"}(Zb||(Zb={})),function(e){e.TopCenter="top-center",e.TopLeft="top-left",e.TopRight="top-right",e.BottomCenter="bottom-center",e.BottomLeft="bottom-left",e.BottomRight="bottom-right"}(Kb||(Kb={}));const Qb=({id:e,destroy:r,title:n,description:o,variant:l=Zb.Info,position:u=Kb.TopCenter,duration:p=5e3,animationDuration:d=400,icon:f,dataTestId:m})=>{const[v,y]=i(!1),[,h]=i(!1),g=c(null),b=c(null),w=c(0),x=c(p),O=s(()=>h(!0),[]),k=s(()=>h(!1),[]),E=s(()=>{b.current&&clearTimeout(b.current),y(!0),setTimeout(()=>{r()},d)},[r,d]);a(()=>(w.current=Date.now(),x.current=p,g.current&&(g.current.style.width="100%",g.current.style.transition="none",g.current.offsetWidth,g.current.style.transition=`width ${p}ms linear`,g.current.style.width="0%"),b.current=window.setTimeout(()=>{E()},p),()=>{b.current&&clearTimeout(b.current)}),[p,E]);const j={[Zb.Success]:{icon:"text-emerald-500 dark:text-emerald-400",progress:"bg-emerald-500 dark:bg-emerald-400"},[Zb.Error]:{icon:"text-destructive",progress:"bg-destructive"},[Zb.Warning]:{icon:"text-amber-500 dark:text-amber-400",progress:"bg-amber-500 dark:bg-amber-400"},[Zb.Info]:{icon:"text-primary",progress:"bg-primary"}}[l],P={[Kb.TopCenter]:v?"animate-slide-out-up":"animate-slide-in-down",[Kb.TopLeft]:v?"animate-slide-out-left":"animate-slide-in-left",[Kb.TopRight]:v?"animate-slide-out-right":"animate-slide-in-right",[Kb.BottomCenter]:v?"animate-slide-out-down":"animate-slide-in-up",[Kb.BottomLeft]:v?"animate-slide-out-left":"animate-slide-in-left",[Kb.BottomRight]:v?"animate-slide-out-right":"animate-slide-in-right"};return t.createElement("div",{id:e??`${l}-${"string"==typeof n?n:""}`,className:`\n relative group flex items-center justify-between pointer-events-auto\n rounded-lg max-w-md w-full overflow-hidden\n bg-background\n border border-border\n ${P[u]||P[Kb.TopCenter]}\n ${v?"opacity-0":"opacity-100"}\n transition-all duration-300 ease-out\n shadow-sm hover:shadow-md\n `,"data-test-id":m,onMouseEnter:O,onMouseLeave:k,style:{transition:`all ${d}ms cubic-bezier(0.4, 0, 0.2, 1)`}},t.createElement("div",{className:"flex items-center gap-3 px-4 py-3 w-full"},f&&t.createElement("div",{className:`flex-shrink-0 ${j.icon}`},f),t.createElement("div",{className:"flex flex-col min-w-0 flex-grow"},t.createElement("div",{className:"font-medium text-sm m-0 text-foreground"},n),o&&t.createElement("div",{className:"text-xs m-0 mt-0.5 text-muted-foreground truncate"},o)),t.createElement("button",{onClick:E,className:"\n flex-shrink-0 ml-2 p-1 rounded-md\n transition-all duration-200\n hover:bg-accent\n text-muted-foreground hover:text-accent-foreground\n ","aria-label":"Close notification"},t.createElement(rt,{size:14}))),!v&&t.createElement("div",{className:`absolute bottom-0 left-0 h-[2px] ${j.progress} opacity-80`,ref:g,style:{width:"100%",transformOrigin:"left"}}))};const Jb=new class{isSetup=!1;isBrowser="undefined"!=typeof window;containers={[Kb.TopCenter]:void 0,[Kb.TopLeft]:void 0,[Kb.TopRight]:void 0,[Kb.BottomCenter]:void 0,[Kb.BottomLeft]:void 0,[Kb.BottomRight]:void 0};roots={[Kb.TopCenter]:null,[Kb.TopLeft]:null,[Kb.TopRight]:null,[Kb.BottomCenter]:null,[Kb.BottomLeft]:null,[Kb.BottomRight]:null};messages={[Kb.TopCenter]:[],[Kb.TopLeft]:[],[Kb.TopRight]:[],[Kb.BottomCenter]:[],[Kb.BottomLeft]:[],[Kb.BottomRight]:[]};constructor(){this.isBrowser&&this.setup()}setup(){if(!this.isBrowser)return;const e=document.getElementsByTagName("body")[0];Object.values(Kb).forEach(t=>{const r=`message-container-${t}`;let n=document.getElementById(r);n||(n=document.createElement("div"),n.id=r,e.appendChild(n)),this.containers[t]=n,this.roots[t]=P(n)}),this.isSetup=!0}show(e){if(!this.isBrowser)return;this.isSetup||this.setup();const t=e.position||Kb.TopCenter,r=e.id||`message-${Math.random().toString().slice(2,11)}`,n=50*this.messages[t].length,o={id:r,...e,animationDuration:e.animationDuration||300,destroy:()=>this.destroy(r,t)};setTimeout(()=>{this.messages[t]=[o,...this.messages[t]],this.render(t)},n)}destroy(e,t=Kb.TopCenter){this.isBrowser&&(this.messages[t]=this.messages[t].filter(t=>t.id!==e),this.render(t))}success(e){this.show({icon:t.createElement(qh,{size:18}),...e,variant:Zb.Success})}error(e){this.show({icon:t.createElement(Wh,{size:18}),...e,variant:Zb.Error})}warning(e){this.show({icon:t.createElement(Bh,{size:18}),...e,variant:Zb.Warning})}info(e){this.show({icon:t.createElement(_h,{size:18}),...e,variant:Zb.Info})}getPositionStyles(e){switch(e){case Kb.TopLeft:return"fixed flex flex-col items-start justify-start gap-2 p-4 top-0 left-0 z-9999 pointer-events-none";case Kb.TopRight:return"fixed flex flex-col items-end justify-start gap-2 p-4 top-0 right-0 z-9999 pointer-events-none";case Kb.BottomCenter:return"fixed flex flex-col items-center justify-end gap-2 p-4 bottom-0 left-0 right-0 z-9999 pointer-events-none";case Kb.BottomLeft:return"fixed flex flex-col items-start justify-end gap-2 p-4 bottom-0 left-0 z-9999 pointer-events-none";case Kb.BottomRight:return"fixed flex flex-col items-end justify-end gap-2 p-4 bottom-0 right-0 z-9999 pointer-events-none";case Kb.TopCenter:default:return"fixed flex flex-col items-center justify-start gap-2 p-4 top-0 left-0 right-0 z-9999 pointer-events-none"}}render(e=Kb.TopCenter){if(!this.isBrowser||!this.roots[e])return;const r=this.messages[e].map(e=>t.createElement(Qb,{key:e.id,...e}));this.roots[e].render(t.createElement("div",{className:this.getPositionStyles(e)},r))}},ew="...",tw=({className:t,...r})=>e.createElement("nav",{role:"navigation","aria-label":"pagination",className:Ie("mx-auto flex w-full justify-center",t),...r}),rw=e.forwardRef(({className:t,...r},n)=>e.createElement("ul",{ref:n,className:Ie("flex flex-row items-center gap-1",t),...r}));rw.displayName="PaginationContent";const nw=e.forwardRef(({className:t,...r},n)=>e.createElement("li",{ref:n,className:Ie("",t),...r}));nw.displayName="PaginationItem";const ow=e.forwardRef(({className:t,isActive:r,size:n="medium",...o},i)=>e.createElement(ot,{ref:i,"aria-current":r?"page":void 0,variant:r?"primary":"link",size:n,className:Ie("h-9 w-9",t),...o}));ow.displayName="PaginationLink";const iw=e.forwardRef(({className:t,...r},n)=>e.createElement(ot,{ref:n,variant:"link",size:"medium",className:Ie("h-9 w-9",t),...r},e.createElement(Ye,{className:"h-4 w-4"}),e.createElement("span",{className:"sr-only"},"Previous page")));iw.displayName="PaginationPrevious";const aw=e.forwardRef(({className:t,...r},n)=>e.createElement(ot,{ref:n,variant:"link",size:"medium",className:Ie("h-9 w-9",t),...r},e.createElement("span",{className:"sr-only"},"Next page"),e.createElement(Ue,{className:"h-4 w-4"})));aw.displayName="PaginationNext";const lw=({className:t,...r})=>e.createElement("span",{"aria-hidden":!0,className:Ie("flex h-9 w-9 items-center justify-center",t),...r},e.createElement(Ze,{className:"h-4 w-4"}),e.createElement("span",{className:"sr-only"},"More pages"));lw.displayName="PaginationEllipsis";const sw=(e,t)=>{const r=t-e+1;return Array.from({length:r},(t,r)=>r+e)},cw=({currentPage:e,totalPages:r,onPageChange:n,siblingCount:o=1,className:i,disabled:c=!1,isLoading:u=!1,enableKeyboardNav:p=!1,showEllipsis:d=!0})=>{const f=l(()=>((e,t,r,n)=>{if(r+5>=t)return sw(1,t);const o=Math.max(e-r,1),i=Math.min(e+r,t),a=o>2,l=i<t-2;if(!a&&l){const e=sw(1,3+2*r);return n?[...e,ew,t]:[...e,t]}if(a&&!l){const e=sw(t-(3+2*r)+1,t);return n?[1,ew,...e]:[1,...e]}if(a&&l){const e=sw(o,i);return n?[1,ew,...e,ew,t]:[1,...e,t]}return sw(1,t)})(e,r,o,d),[e,r,o,d]),m=s(()=>{!c&&!u&&e>1&&n(e-1)},[e,n,c,u]),v=s(()=>{!c&&!u&&e<r&&n(e+1)},[e,r,n,c,u]),y=s(e=>{c||u||!p||("ArrowLeft"===e.key?(e.preventDefault(),m()):"ArrowRight"===e.key&&(e.preventDefault(),v()))},[m,v,c,u,p]);return a(()=>{if(p)return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[y,p]),0===e||f.length<2?null:t.createElement(tw,{className:Ie("select-none",i)},t.createElement(rw,null,t.createElement(nw,null,t.createElement(iw,{onClick:m,disabled:1===e||c||u,className:Ie("transition-all duration-200","hover:scale-105 hover:bg-accent",(c||u)&&"pointer-events-none opacity-50"),"aria-label":"Previous page"})),f.map((r,o)=>{if(r===ew)return t.createElement(nw,{key:`dots-${o}`},t.createElement(lw,null));const i=r,a=i===e;return t.createElement(nw,{key:i},t.createElement(ow,{isActive:a,onClick:()=>!c&&!u&&n(i),className:Ie("transition-all duration-200",a&&"hover:bg-primary/90",!a&&"hover:bg-accent hover:scale-105",(c||u)&&"pointer-events-none opacity-50"),"aria-label":`Page ${i}`,"aria-current":a?"page":void 0},i))}),t.createElement(nw,null,t.createElement(aw,{onClick:v,disabled:e===r||c||u,className:Ie("transition-all duration-200","hover:scale-105 hover:bg-accent",(c||u)&&"pointer-events-none opacity-50"),"aria-label":"Next page"}))))};var uw,pw,dw;!function(e){e.Left="left",e.Center="center",e.Right="right"}(uw||(uw={})),function(e){e.Left="left",e.Right="right",e.Center="center"}(pw||(pw={})),function(e){e.Text="text",e.Date="date",e.Status="status",e.Custom="custom"}(dw||(dw={}));const fw=(e=uw.Left)=>({left:"justify-start",center:"justify-center",right:"justify-end"}[e]),mw=(e,t,r,n,o,i)=>({toggleSorting:n=>{if(!t.find(t=>t.key===e))return;const o=n?"desc":"asc";i({key:e,direction:o}),r&&r(e,o)},getIsSorted:()=>!(!o||o.key!==e)&&o.direction,key:e,data:n}),vw=(e,t,r,n,o,i)=>mw(e,t,r,n,o,i),yw=e=>{switch(e){case pw.Right:return"ml-auto order-2";case pw.Center:return"mx-auto";default:return"order-1"}},hw=e=>{switch(e){case pw.Left:return"order-1";case pw.Center:return"mx-auto";default:return"ml-auto order-2"}},gw=(e=!1)=>e?{effectivePaginationPosition:pw.Left,effectiveEntriesPosition:pw.Right}:{effectivePaginationPosition:pw.Right,effectiveEntriesPosition:pw.Left},bw=(e,t)=>{if(!t)return e;const r=e.split(" ");return r.length<=t?e:`${r.slice(0,t).join(" ")}...`};var ww,xw={exports:{}};var Ow=(ww||(ww=1,xw.exports=function(){var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",l="day",s="week",c="month",u="quarter",p="year",d="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},h=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},g={s:h,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),o=r%60;return(t<=0?"+":"-")+h(n,2,"0")+":"+h(o,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),o=t.clone().add(n,c),i=r-o<0,a=t.clone().add(n+(i?-1:1),c);return+(-(n+(r-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:p,w:s,d:l,D:d,h:a,m:i,s:o,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",w={};w[b]=y;var x="$isDayjsObject",O=function(e){return e instanceof P||!(!e||!e[x])},k=function e(t,r,n){var o;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();w[i]&&(o=i),r&&(w[i]=r,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var l=t.name;w[l]=t,o=l}return!n&&o&&(b=o),o||!n&&b},E=function(e,t){if(O(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new P(r)},j=g;j.l=k,j.i=O,j.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var P=function(){function y(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var h=y.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(j.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(m);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(t)}(e),this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return j},h.isValid=function(){return!(this.$d.toString()===f)},h.isSame=function(e,t){var r=E(e);return this.startOf(t)<=r&&r<=this.endOf(t)},h.isAfter=function(e,t){return E(e)<this.startOf(t)},h.isBefore=function(e,t){return this.endOf(t)<E(e)},h.$g=function(e,t,r){return j.u(e)?this[t]:this.set(r,e)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(e,t){var r=this,n=!!j.u(t)||t,u=j.p(e),f=function(e,t){var o=j.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return n?o:o.endOf(l)},m=function(e,t){return j.w(r.toDate()[e].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},v=this.$W,y=this.$M,h=this.$D,g="set"+(this.$u?"UTC":"");switch(u){case p:return n?f(1,0):f(31,11);case c:return n?f(1,y):f(0,y+1);case s:var b=this.$locale().weekStart||0,w=(v<b?v+7:v)-b;return f(n?h-w:h+(6-w),y);case l:case d:return m(g+"Hours",0);case a:return m(g+"Minutes",1);case i:return m(g+"Seconds",2);case o:return m(g+"Milliseconds",3);default:return this.clone()}},h.endOf=function(e){return this.startOf(e,!1)},h.$set=function(e,t){var r,s=j.p(e),u="set"+(this.$u?"UTC":""),f=(r={},r[l]=u+"Date",r[d]=u+"Date",r[c]=u+"Month",r[p]=u+"FullYear",r[a]=u+"Hours",r[i]=u+"Minutes",r[o]=u+"Seconds",r[n]=u+"Milliseconds",r)[s],m=s===l?this.$D+(t-this.$W):t;if(s===c||s===p){var v=this.clone().set(d,1);v.$d[f](m),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else f&&this.$d[f](m);return this.init(),this},h.set=function(e,t){return this.clone().$set(e,t)},h.get=function(e){return this[j.p(e)]()},h.add=function(n,u){var d,f=this;n=Number(n);var m=j.p(u),v=function(e){var t=E(f);return j.w(t.date(t.date()+Math.round(e*n)),f)};if(m===c)return this.set(c,this.$M+n);if(m===p)return this.set(p,this.$y+n);if(m===l)return v(1);if(m===s)return v(7);var y=(d={},d[i]=t,d[a]=r,d[o]=e,d)[m]||1,h=this.$d.getTime()+n*y;return j.w(h,this)},h.subtract=function(e,t){return this.add(-1*e,t)},h.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||f;var n=e||"YYYY-MM-DDTHH:mm:ssZ",o=j.z(this),i=this.$H,a=this.$m,l=this.$M,s=r.weekdays,c=r.months,u=r.meridiem,p=function(e,r,o,i){return e&&(e[r]||e(t,n))||o[r].slice(0,i)},d=function(e){return j.s(i%12||12,e,"0")},m=u||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(v,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return j.s(t.$y,4,"0");case"M":return l+1;case"MM":return j.s(l+1,2,"0");case"MMM":return p(r.monthsShort,l,c,3);case"MMMM":return p(c,l);case"D":return t.$D;case"DD":return j.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(r.weekdaysMin,t.$W,s,2);case"ddd":return p(r.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(i);case"HH":return j.s(i,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return m(i,a,!0);case"A":return m(i,a,!1);case"m":return String(a);case"mm":return j.s(a,2,"0");case"s":return String(t.$s);case"ss":return j.s(t.$s,2,"0");case"SSS":return j.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(n,d,f){var m,v=this,y=j.p(d),h=E(n),g=(h.utcOffset()-this.utcOffset())*t,b=this-h,w=function(){return j.m(v,h)};switch(y){case p:m=w()/12;break;case c:m=w();break;case u:m=w()/3;break;case s:m=(b-g)/6048e5;break;case l:m=(b-g)/864e5;break;case a:m=b/r;break;case i:m=b/t;break;case o:m=b/e;break;default:m=b}return f?m:j.a(m)},h.daysInMonth=function(){return this.endOf(c).$D},h.$locale=function(){return w[this.$L]},h.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=k(e,t,!0);return n&&(r.$L=n),r},h.clone=function(){return j.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},y}(),S=P.prototype;return E.prototype=S,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",l],["$M",c],["$y",p],["$D",d]].forEach(function(e){S[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),E.extend=function(e,t){return e.$i||(e(t,P,E),e.$i=!0),E},E.locale=k,E.isDayjs=O,E.unix=function(e){return E(1e3*e)},E.en=w[b],E.Ls=w,E.p={},E}()),xw.exports),kw=it(Ow);const Ew={active:"bg-green-100 text-green-800",inactive:"bg-red-100 text-red-800",pending:"bg-yellow-100 text-yellow-800",completed:"bg-blue-100 text-blue-800",processing:"bg-purple-100 text-purple-800",default:"bg-gray-100 text-gray-800"},jw="name",Pw="200px",Sw="email",zw="joinDate",Nw="status",Cw=(e,r,n,o)=>{const i=r[e.key],a=fw(e.align),l=e=>t.createElement("div",{className:`flex w-full ${a}`},e);if(n&&e.customCell)return l(e.customCell(i,r));if(null==i)return l(null);switch(e.type){case dw.Date:{if(!e.dateFormat)return l(t.createElement(pg,{variant:"small",color:"primary"},String(i)));const r=kw(i,e.dateFormat.input).format(e.dateFormat.output);return l(t.createElement(pg,{variant:"small",color:"primary"},r))}case dw.Status:if(o){const e=String(i).toLowerCase(),r=Ew[e]||Ew.default;return l(t.createElement("span",{className:`px-2 py-1 text-xs font-medium rounded-full ${r}`},String(i)))}return l(t.createElement(pg,{variant:"small",color:"primary"},String(i)));case dw.Text:default:{const r=String(i),n=bw(r,e.maxWords);return l(t.createElement(pg,{variant:"small",color:"primary",className:n!==r?"truncate":"",title:r},n))}}},Tw=(e,r)=>r?.key!==e.key?t.createElement($e,{className:"h-4 w-4 opacity-40"}):"asc"===r.direction?t.createElement(Ge,{className:"h-4 w-4 text-primary"}):t.createElement(qe,{className:"h-4 w-4 text-primary"}),Lw=(e,r,n,o,i)=>{if(e.customHeader)return e.customHeader(r(e.key));const a=fw(e.align);return o&&e.sortable?t.createElement("div",{className:`flex w-full ${a}`},t.createElement(ot,{variant:"link",onClick:()=>n(e),className:"p-0 h-auto font-medium text-muted-foreground"},t.createElement("div",{className:"flex items-center"},t.createElement("span",{className:"truncate"},e.title),t.createElement("span",{className:"ml-2 inline-flex shrink-0"},Tw(e,i))))):t.createElement("div",{className:`flex w-full items-center h-9 ${a}`},t.createElement("span",{className:"truncate font-medium text-muted-foreground"},e.title))},Mw=(e,t,r,n,o)=>Lw(e,t,r,n,o),Dw={renderSortIcon:Tw,renderHeader:Lw,renderTableHeader:Mw},Iw=({columns:e,data:r,sortable:n=!1,pagination:o=!1,searchable:c=!1,currentPage:u=1,pageSize:p=5,onSort:d,onPageChange:f,actions:m,showCustomCells:v=!0,useBuiltInStatus:y=!0,swapPaginationLayout:h=!1,selectable:g=!1,onSelectionChange:b})=>{const[w,x]=i(null),[O,k]=i(u),[E,j]=i(p),[P,S]=i(""),[z,N]=i({}),[C,T]=i(!1),{effectivePaginationPosition:L,effectiveEntriesPosition:M}=gw(h);a(()=>{k(u)},[u]),a(()=>{g&&(N({}),T(!1))},[r,g]);const D=s(e=>{n&&e.sortable&&(w?.key===e.key?"asc"===w.direction?(x({key:e.key,direction:"desc"}),d&&d(e.key,"desc")):(x(null),d&&d("__clear_sort__","asc")):(x({key:e.key,direction:"asc"}),d&&d(e.key,"asc")))},[w,n,d]),I=s(e=>{n&&e.sortable&&D(e)},[n,D]),R=l(()=>w&&n?[...r].sort((e,t)=>{const r=e[w.key],n=t[w.key];return r<n?"asc"===w.direction?-1:1:r>n?"asc"===w.direction?1:-1:0}):r,[r,w,n]),A=s(e=>{S(e.target.value),k(1)},[]),_=l(()=>c&&P.trim()?R.filter(t=>e.some(e=>{const r=t[e.key];return null!=r&&String(r).toLowerCase().includes(P.toLowerCase())})):R,[R,e,P,c]),B=l(()=>Math.max(1,Math.ceil(_.length/E)),[_.length,E]),W=l(()=>{if(o){const e=(O-1)*E;return _.slice(e,e+E)}return _},[_,O,E,o]),F=s(e=>{e<1||e>B||(k(e),f&&f(e))},[B,f]),$=s(e=>{j(e),k(1)},[]),H=s((e,t)=>e.id||`row-${t}`,[]),V=s((e,t)=>{const r=H(e,t),n={...z,[r]:!z[r]};N(n);const o=W.every((e,t)=>!0===n[H(e,t)]);if(T(o),b){const e=W.filter((e,t)=>n[H(e,t)]);b(e)}},[z,W,b,H]),q=s(()=>{const e=!C;T(e);const t={...z};if(W.forEach((r,n)=>{const o=H(r,n);t[o]=e}),N(t),b){const t=e?[...W]:[];b(t)}},[C,W,z,b,H]),Y=l(()=>(e,t)=>Cw(e,t,v,y),[v,y]);return t.createElement("div",{className:"w-full"},t.createElement("div",{className:"flex flex-wrap items-center justify-between mb-6 gap-6"},c&&t.createElement("div",{className:"w-80"},t.createElement(fg,{id:"table-search",value:P,onChange:A,label:"Search",type:"search"})),o&&t.createElement("div",{className:"flex items-center space-x-3 ml-auto"},t.createElement("label",{htmlFor:"page-size-select",className:"text-sm font-medium text-muted-foreground"},"Rows per page"),t.createElement("select",{id:"page-size-select",value:E,onChange:e=>$(parseInt(e.target.value)),className:"h-9 rounded-md border border-input bg-background px-3 py-1 text-sm ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 transition-colors"},[5,10,20,50].map(e=>t.createElement("option",{key:e,value:e},e))))),t.createElement("div",{className:"relative w-full overflow-auto rounded-lg border shadow-xs"},t.createElement("table",{className:"w-full caption-bottom text-sm"},t.createElement("thead",{className:"bg-muted/40"},t.createElement("tr",{className:"border-b border-border"},g&&t.createElement("th",{className:"h-11 px-3 font-medium text-muted-foreground w-10"},t.createElement(Jh,{checked:C,onChange:q,dataTestId:"select-all-checkbox"})),e.map(r=>t.createElement("th",{key:r.key,className:"h-11 px-6 font-medium text-muted-foreground",style:{width:r.width||"auto"}},t.createElement("div",{className:"h-full flex items-center",onClick:()=>I(r)},Mw(r,t=>vw(t,e,d,W,w,x),D,n,w)))),m&&t.createElement("th",{className:"h-11 px-6 text-right font-medium text-muted-foreground"},t.createElement("div",{className:"flex items-center h-9 justify-end"},t.createElement("span",{className:"truncate font-medium text-muted-foreground"},"Actions"))))),t.createElement("tbody",{className:"[&_tr:last-child]:border-0"},W.length>0?W.map((r,n)=>t.createElement("tr",{key:H(r,n),className:"border-b border-border transition-colors hover:bg-muted/30 "+(z[H(r,n)]?"bg-muted/50":"")},g&&t.createElement("td",{className:"p-4 px-5 w-10"},t.createElement(Jh,{checked:!!z[H(r,n)],onChange:()=>V(r,n),dataTestId:`select-row-${n}`})),e.map(e=>t.createElement("td",{key:e.key,className:"p-4 px-6",style:{width:e.width||"auto"}},Y(e,r))),m&&t.createElement("td",{className:"p-4 px-6 text-right"},m(r)))):t.createElement("tr",null,t.createElement("td",{colSpan:e.length+(m?1:0)+(g?1:0),className:"py-10 px-6 text-center text-muted-foreground"},"No data available"))))),o&&B>0&&t.createElement("div",{className:"flex items-center justify-between px-3 mt-6 w-full"},t.createElement("div",{className:`text-sm font-medium text-muted-foreground whitespace-nowrap ${yw(M)}`},"Showing"," ",t.createElement("span",{className:"text-foreground"},Math.min((O-1)*E+1,_.length))," ","to"," ",t.createElement("span",{className:"text-foreground"},Math.min(O*E,_.length))," ","of ",t.createElement("span",{className:"text-foreground"},_.length)," ","entries"),t.createElement("div",{className:hw(L)},t.createElement(cw,{currentPage:O,totalPages:B,onPageChange:F,disabled:!1,isLoading:!1}))))},Rw=(e,t,r)=>({key:e,title:t,type:dw.Text,width:r?.width,sortable:r?.sortable,align:r?.align||uw.Left,customCell:r?.customCell,maxWords:r?.maxWords}),Aw=(e,t,r)=>({key:e,title:t,type:dw.Date,width:r?.width,sortable:r?.sortable,align:r?.align||uw.Left,dateFormat:{input:r?.inputFormat,output:r?.outputFormat||"MMM DD, YYYY"},customCell:r?.customCell}),_w=(e,t,r)=>({key:e,title:t,type:dw.Status,width:r?.width,sortable:r?.sortable,align:r?.align||uw.Center,customCell:r?.customCell}),Bw=(e,r)=>{const{enableTruncation:n=!1,maxWords:o=5}=r||{},i=Rw("description","Description",{sortable:!0,...n&&{maxWords:2*o}});return[Rw(jw,"Name",{width:Pw,sortable:!0,...n&&{maxWords:o},customCell:e?e=>t.createElement("div",{className:"flex items-center"},t.createElement("div",{className:"h-8 w-8 rounded-full bg-gray-200 mr-3 flex items-center justify-center"},t.createElement(pg,{variant:"small",color:"secondary"},e.charAt(0))),t.createElement(pg,{variant:"small",color:"secondary",fontWeight:"semibold"},e)):void 0}),Rw(Sw,"Email",{...n&&{maxWords:o},customCell:e?e=>t.createElement("a",{href:`mailto:${e}`,className:"hover:underline"},t.createElement(pg,{variant:"small",color:"secondary"},e)):void 0}),i,Aw(zw,"Join Date",{sortable:!0,inputFormat:"YYYY-MM-DD",outputFormat:"MMM DD, YYYY"}),e?Rw(Nw,"Status",{align:uw.Center,customCell:e=>{const r=e;return t.createElement("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full"},t.createElement(pg,{variant:"small",color:"secondary",fontWeight:"semibold"},r))}}):_w(Nw,"Status",{align:uw.Center})]};function Ww(t){var r=t.children,n=t.prefixCls,o=t.id,i=t.overlayInnerStyle,a=t.bodyClassName,l=t.className,s=t.style;return e.createElement("div",{className:og("".concat(n,"-content"),l),style:s},e.createElement("div",{className:og("".concat(n,"-inner"),a),id:o,role:"tooltip",style:i},"function"==typeof r?r():r))}function Fw(){return Fw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fw.apply(null,arguments)}function $w(e){return $w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$w(e)}function Hw(e){var t=function(e,t){if("object"!=$w(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=$w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$w(t)?t:t+""}function Vw(e,t,r){return(t=Hw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Yw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qw(Object(r),!0).forEach(function(t){Vw(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qw(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Uw(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Gw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Xw(e,t){if(e){if("string"==typeof e)return Gw(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Gw(e,t):void 0}}function Zw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,l=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||Xw(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kw(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}var Qw={},Jw=[];function ex(e,t){if("production"!==process.env.NODE_ENV&&!e&&void 0!==console){var r=Jw.reduce(function(e,t){return t(null!=e?e:"","warning")},t);r&&console.error("Warning: ".concat(r))}}function tx(e,t){if("production"!==process.env.NODE_ENV&&!e&&void 0!==console){var r=Jw.reduce(function(e,t){return t(null!=e?e:"","note")},t);r&&console.warn("Note: ".concat(r))}}function rx(e,t,r){t||Qw[r]||(e(!1,r),Qw[r]=!0)}function nx(e,t){rx(ex,e,t)}nx.preMessage=function(e){Jw.push(e)},nx.resetWarned=function(){Qw={}},nx.noteOnce=function(e,t){rx(tx,e,t)};var ox,ix={exports:{}},ax={};var lx,sx,cx={};
|
|
45
45
|
/**
|
|
46
46
|
* @license React
|
|
47
47
|
* react-is.development.js
|