@moondreamsdev/dreamer-ui 1.7.19-test.21 → 1.7.19-test.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Toast-Bdi3ohxP.js → Toast-C5oX0fsR.js} +17 -12
- package/dist/Toast-C5oX0fsR.js.map +1 -0
- package/dist/{Toast-BU26UZ3N.cjs → Toast-DovlN7GS.cjs} +2 -2
- package/dist/Toast-DovlN7GS.cjs.map +1 -0
- package/dist/components.cjs.js +2 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +63 -63
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/textarea/Textarea.d.ts +1 -1
- package/package.json +1 -1
- package/dist/Toast-BU26UZ3N.cjs.map +0 -1
- package/dist/Toast-Bdi3ohxP.js.map +0 -1
package/dist/components.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var Qe=Object.defineProperty;var Ue=(r,a,t)=>a in r?Qe(r,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[a]=t;var je=(r,a,t)=>Ue(r,typeof a!="symbol"?a+"":a,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),w=require("./join-BVMUUvyP.cjs"),L=require("./Window-U9c7lCJ4.cjs"),V=require("./Toast-BU26UZ3N.cjs"),ee=require("./X-CgjeP2OI.cjs");require("./useTheme-Bdg1t0Zr.cjs");const Xe=require("./useScreenSize-UGyolnfn.cjs"),pe=require("react-dom"),Me=require("./utils.cjs.js");function ue({id:r,title:a,content:t,children:o,className:s="",disabled:n=!1,isOpen:i=!1,onToggle:u,triggerClassName:c="",bodyClassName:x=""}){const f=l.useId(),d=r||`accordion-item-${f}`,h=`${d}-header`,m=`${d}-panel`,y=()=>{!n&&u&&u()},v=b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),y())};return e.jsxs("div",{className:w.join("border-b border-gray-200",n&&"opacity-60 cursor-not-allowed",s),children:[e.jsxs("button",{id:h,type:"button",className:w.join("w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",n?"cursor-not-allowed":"hover:bg-gray-50/10 cursor-pointer",c),"aria-expanded":i,"aria-controls":m,disabled:n,onClick:y,onKeyDown:v,children:[e.jsx("span",{children:a}),e.jsx("span",{className:w.join("transform transition-transform ease-linear",i?"rotate-180":"rotate-0"),"aria-hidden":"true",children:e.jsx(L.ChevronDown,{size:18})})]}),e.jsx("div",{id:m,role:"region","aria-labelledby":h,className:w.join("transition-all ease-linear px-4",i?"max-h-96 opacity-100 overflow-auto py-3":"max-h-0 opacity-0 overflow-hidden",x),children:i&&(o||t)})]})}function Je({id:r,items:a=[],children:t,className:o="",itemClassName:s="",allowMultiple:n=!1,defaultOpenItems:i=[],triggersClassName:u="",bodiesClassName:c=""}){const x=l.useId(),f=r||`accordion-group-${x}`,[d,h]=l.useState(new Set(i)),m=b=>{h(C=>{const p=new Set(C);return p.has(b)?p.delete(b):(n||p.clear(),p.add(b)),p})},y=b=>`${x}-item-${b}`,v=b=>d.has(b);return e.jsxs("div",{id:f,className:o,children:[a.length>0&&a.map((b,C)=>{const p=b.id||y(C);return e.jsx(ue,{id:p,title:b.title,content:b.content,disabled:b.disabled,isOpen:v(p),onToggle:()=>m(p),className:s,triggerClassName:u,bodyClassName:c},p)}),a.length===0&&t&&l.Children.map(t,(b,C)=>{if(l.isValidElement(b)&&b.type===ue){const p=b.props.id||y(C);return l.createElement(ue,{...b.props,key:p,id:p,className:w.join(s,b.props.className),isOpen:v(p),onToggle:()=>m(p),triggerClassName:w.join(u,b.props.triggerClassName),bodyClassName:w.join(c,b.props.bodyClassName)})}return null})]})}function Oe({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"40",r:"32",fill:"url(#astronautHelmet)",stroke:"#4F46E5",strokeWidth:"2"}),e.jsx("circle",{cx:"50",cy:"40",r:"24",fill:"#FED7AA"}),e.jsx("circle",{cx:"43",cy:"36",r:"3",fill:"#1F2937"}),e.jsx("circle",{cx:"57",cy:"36",r:"3",fill:"#1F2937"}),e.jsx("path",{d:"M46 46 Q50 50 54 46",stroke:"#1F2937",strokeWidth:"2",fill:"none"}),e.jsx("rect",{x:"38",y:"65",width:"24",height:"30",rx:"12",fill:"#E5E7EB"}),e.jsx("rect",{x:"44",y:"70",width:"12",height:"8",rx:"2",fill:"#6366F1"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"astronautHelmet",cx:"50%",cy:"30%",r:"70%",children:[e.jsx("stop",{stopColor:"#DBEAFE"}),e.jsx("stop",{offset:"1",stopColor:"#93C5FD"})]})})]})}function et({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"url(#moonGradient)"}),e.jsx("circle",{cx:"38",cy:"35",r:"4",fill:"#D1D5DB"}),e.jsx("circle",{cx:"65",cy:"42",r:"3",fill:"#D1D5DB"}),e.jsx("circle",{cx:"42",cy:"65",r:"5",fill:"#D1D5DB"}),e.jsx("circle",{cx:"45",cy:"45",r:"2.5",fill:"#1F2937"}),e.jsx("circle",{cx:"58",cy:"45",r:"2.5",fill:"#1F2937"}),e.jsx("path",{d:"M47 55 Q52 60 57 55",stroke:"#1F2937",strokeWidth:"2",fill:"none"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"moonGradient",cx:"30%",cy:"30%",r:"80%",children:[e.jsx("stop",{stopColor:"#F9FAFB"}),e.jsx("stop",{offset:"1",stopColor:"#E5E7EB"})]})})]})}function tt({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("path",{d:"M50 15 L58 38 L82 38 L64 52 L72 75 L50 61 L28 75 L36 52 L18 38 L42 38 Z",fill:"url(#starGradient)"}),e.jsx("circle",{cx:"44",cy:"42",r:"2",fill:"#1F2937"}),e.jsx("circle",{cx:"56",cy:"42",r:"2",fill:"#1F2937"}),e.jsx("path",{d:"M46 50 Q50 54 54 50",stroke:"#1F2937",strokeWidth:"2",fill:"none"}),e.jsx("circle",{cx:"65",cy:"25",r:"1.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"35",cy:"30",r:"1",fill:"#FCD34D"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"starGradient",cx:"50%",cy:"40%",r:"60%",children:[e.jsx("stop",{stopColor:"#FEF3C7"}),e.jsx("stop",{offset:"1",stopColor:"#FCD34D"})]})})]})}function rt({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"38",fill:"url(#galaxyGradient)"}),e.jsx("path",{d:"M20 50 Q35 30 50 50 Q65 70 80 50",stroke:"#8B5CF6",strokeWidth:"3",opacity:"0.7"}),e.jsx("path",{d:"M50 20 Q70 35 50 50 Q30 65 50 80",stroke:"#A78BFA",strokeWidth:"2",opacity:"0.5"}),e.jsx("circle",{cx:"50",cy:"50",r:"12",fill:"#1E1B4B"}),e.jsx("circle",{cx:"46",cy:"47",r:"1.5",fill:"#E0E7FF"}),e.jsx("circle",{cx:"54",cy:"47",r:"1.5",fill:"#E0E7FF"}),e.jsx("path",{d:"M47 53 Q50 56 53 53",stroke:"#E0E7FF",strokeWidth:"1.5",fill:"none"}),e.jsx("circle",{cx:"30",cy:"25",r:"1",fill:"#FFF"}),e.jsx("circle",{cx:"75",cy:"70",r:"1.5",fill:"#FFF"}),e.jsx("circle",{cx:"25",cy:"75",r:"1",fill:"#FFF"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"galaxyGradient",cx:"50%",cy:"50%",r:"70%",children:[e.jsx("stop",{stopColor:"#4C1D95"}),e.jsx("stop",{offset:"0.5",stopColor:"#7C3AED"}),e.jsx("stop",{offset:"1",stopColor:"#1E1B4B"})]})})]})}function st({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("ellipse",{cx:"50",cy:"50",rx:"35",ry:"30",fill:"url(#nebulaGradient)",opacity:"0.8"}),e.jsx("ellipse",{cx:"40",cy:"45",rx:"20",ry:"25",fill:"url(#nebulaPink)",opacity:"0.6"}),e.jsx("ellipse",{cx:"60",cy:"55",rx:"25",ry:"20",fill:"url(#nebulaBlue)",opacity:"0.6"}),e.jsx("circle",{cx:"50",cy:"50",r:"15",fill:"#312E81",opacity:"0.9"}),e.jsx("circle",{cx:"46",cy:"47",r:"2",fill:"#E0E7FF"}),e.jsx("circle",{cx:"54",cy:"47",r:"2",fill:"#E0E7FF"}),e.jsx("path",{d:"M47 53 Q50 56 53 53",stroke:"#E0E7FF",strokeWidth:"1.5",fill:"none"}),e.jsx("circle",{cx:"25",cy:"30",r:"1",fill:"#FFF",opacity:"0.9"}),e.jsx("circle",{cx:"75",cy:"25",r:"1.5",fill:"#FFF",opacity:"0.8"}),e.jsx("circle",{cx:"30",cy:"75",r:"1",fill:"#FFF",opacity:"0.9"}),e.jsx("circle",{cx:"70",cy:"75",r:"1.5",fill:"#FFF",opacity:"0.7"}),e.jsxs("defs",{children:[e.jsxs("radialGradient",{id:"nebulaGradient",cx:"50%",cy:"50%",r:"70%",children:[e.jsx("stop",{stopColor:"#7C3AED"}),e.jsx("stop",{offset:"1",stopColor:"#312E81"})]}),e.jsxs("radialGradient",{id:"nebulaPink",cx:"50%",cy:"50%",r:"70%",children:[e.jsx("stop",{stopColor:"#F472B6"}),e.jsx("stop",{offset:"1",stopColor:"#BE185D"})]}),e.jsxs("radialGradient",{id:"nebulaBlue",cx:"50%",cy:"50%",r:"70%",children:[e.jsx("stop",{stopColor:"#3B82F6"}),e.jsx("stop",{offset:"1",stopColor:"#1E40AF"})]})]})]})}function nt({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"32",fill:"url(#planetGradient)"}),e.jsx("ellipse",{cx:"50",cy:"50",rx:"45",ry:"8",fill:"none",stroke:"#A78BFA",strokeWidth:"2",opacity:"0.7"}),e.jsx("circle",{cx:"38",cy:"40",r:"5",fill:"#065F46",opacity:"0.6"}),e.jsx("circle",{cx:"62",cy:"45",r:"4",fill:"#065F46",opacity:"0.6"}),e.jsx("circle",{cx:"45",cy:"62",r:"3",fill:"#065F46",opacity:"0.6"}),e.jsx("circle",{cx:"46",cy:"48",r:"2.5",fill:"#1F2937"}),e.jsx("circle",{cx:"54",cy:"48",r:"2.5",fill:"#1F2937"}),e.jsx("path",{d:"M47 55 Q50 58 53 55",stroke:"#1F2937",strokeWidth:"2",fill:"none"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"planetGradient",cx:"30%",cy:"30%",r:"80%",children:[e.jsx("stop",{stopColor:"#A7F3D0"}),e.jsx("stop",{offset:"0.6",stopColor:"#34D399"}),e.jsx("stop",{offset:"1",stopColor:"#059669"})]})})]})}function at({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"55",r:"28",fill:"url(#catGradient)"}),e.jsx("path",{d:"M28 40 L38 25 L42 45 Z",fill:"#6366F1"}),e.jsx("path",{d:"M58 45 L62 25 L72 40 Z",fill:"#6366F1"}),e.jsx("path",{d:"M32 38 L36 30 L38 40 Z",fill:"#EC4899"}),e.jsx("path",{d:"M62 40 L64 30 L68 38 Z",fill:"#EC4899"}),e.jsx("ellipse",{cx:"43",cy:"50",rx:"4",ry:"6",fill:"#FCD34D"}),e.jsx("ellipse",{cx:"57",cy:"50",rx:"4",ry:"6",fill:"#FCD34D"}),e.jsx("ellipse",{cx:"43",cy:"52",rx:"1.5",ry:"4",fill:"#1F2937"}),e.jsx("ellipse",{cx:"57",cy:"52",rx:"1.5",ry:"4",fill:"#1F2937"}),e.jsx("path",{d:"M48 58 L50 60 L52 58 Z",fill:"#EC4899"}),e.jsx("path",{d:"M50 60 Q46 64 42 62",stroke:"#1F2937",strokeWidth:"1.5",fill:"none"}),e.jsx("path",{d:"M50 60 Q54 64 58 62",stroke:"#1F2937",strokeWidth:"1.5",fill:"none"}),e.jsx("line",{x1:"25",y1:"55",x2:"35",y2:"57",stroke:"#1F2937",strokeWidth:"1"}),e.jsx("line",{x1:"65",y1:"57",x2:"75",y2:"55",stroke:"#1F2937",strokeWidth:"1"}),e.jsx("circle",{cx:"20",cy:"25",r:"1.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"80",cy:"30",r:"1",fill:"#FCD34D"}),e.jsx("circle",{cx:"15",cy:"70",r:"1",fill:"#FCD34D"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"catGradient",cx:"50%",cy:"40%",r:"70%",children:[e.jsx("stop",{stopColor:"#A78BFA"}),e.jsx("stop",{offset:"1",stopColor:"#6366F1"})]})})]})}function ot({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"35",cy:"55",r:"18",fill:"url(#cloudGradient)"}),e.jsx("circle",{cx:"55",cy:"50",r:"22",fill:"url(#cloudGradient)"}),e.jsx("circle",{cx:"45",cy:"65",r:"15",fill:"url(#cloudGradient)"}),e.jsx("circle",{cx:"65",cy:"60",r:"16",fill:"url(#cloudGradient)"}),e.jsx("circle",{cx:"48",cy:"52",r:"2.5",fill:"#6366F1"}),e.jsx("circle",{cx:"56",cy:"52",r:"2.5",fill:"#6366F1"}),e.jsx("path",{d:"M49 58 Q52 62 55 58",stroke:"#6366F1",strokeWidth:"2",fill:"none"}),e.jsx("circle",{cx:"70",cy:"35",r:"3",fill:"rgba(167, 139, 250, 0.3)",stroke:"#A78BFA"}),e.jsx("circle",{cx:"78",cy:"28",r:"2",fill:"rgba(167, 139, 250, 0.3)",stroke:"#A78BFA"}),e.jsx("circle",{cx:"83",cy:"20",r:"1.5",fill:"rgba(167, 139, 250, 0.3)",stroke:"#A78BFA"}),e.jsx("circle",{cx:"70",cy:"35",r:"0.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"78",cy:"28",r:"0.5",fill:"#FCD34D"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"cloudGradient",cx:"50%",cy:"40%",r:"70%",children:[e.jsx("stop",{stopColor:"#F8FAFC"}),e.jsx("stop",{offset:"1",stopColor:"#E2E8F0"})]})})]})}function lt({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("ellipse",{cx:"50",cy:"45",rx:"15",ry:"30",fill:"url(#rocketGradient)"}),e.jsx("path",{d:"M35 20 L50 10 L65 20 L50 25 Z",fill:"#EF4444"}),e.jsx("circle",{cx:"50",cy:"35",r:"8",fill:"#DBEAFE",stroke:"#2563EB",strokeWidth:"2"}),e.jsx("circle",{cx:"47",cy:"33",r:"1.5",fill:"#1F2937"}),e.jsx("circle",{cx:"53",cy:"33",r:"1.5",fill:"#1F2937"}),e.jsx("path",{d:"M48 37 Q50 39 52 37",stroke:"#1F2937",strokeWidth:"1",fill:"none"}),e.jsx("path",{d:"M35 60 L25 70 L35 75 Z",fill:"#6B7280"}),e.jsx("path",{d:"M65 60 L75 70 L65 75 Z",fill:"#6B7280"}),e.jsx("ellipse",{cx:"50",cy:"80",rx:"8",ry:"12",fill:"#F59E0B"}),e.jsx("ellipse",{cx:"50",cy:"82",rx:"5",ry:"8",fill:"#EF4444"}),e.jsx("circle",{cx:"25",cy:"20",r:"1",fill:"#FCD34D"}),e.jsx("circle",{cx:"75",cy:"25",r:"1.5",fill:"#FCD34D"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"rocketGradient",cx:"30%",cy:"30%",r:"80%",children:[e.jsx("stop",{stopColor:"#E5E7EB"}),e.jsx("stop",{offset:"1",stopColor:"#9CA3AF"})]})})]})}function it({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"38",fill:"url(#constellationBg)",opacity:"0.8"}),e.jsx("circle",{cx:"35",cy:"25",r:"2",fill:"#FCD34D"}),e.jsx("circle",{cx:"50",cy:"30",r:"2.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"65",cy:"35",r:"2",fill:"#FCD34D"}),e.jsx("circle",{cx:"30",cy:"50",r:"1.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"70",cy:"50",r:"2",fill:"#FCD34D"}),e.jsx("circle",{cx:"40",cy:"70",r:"2.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"60",cy:"75",r:"1.5",fill:"#FCD34D"}),e.jsx("line",{x1:"35",y1:"25",x2:"50",y2:"30",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("line",{x1:"50",y1:"30",x2:"65",y2:"35",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("line",{x1:"30",y1:"50",x2:"50",y2:"30",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("line",{x1:"50",y1:"30",x2:"70",y2:"50",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("line",{x1:"30",y1:"50",x2:"40",y2:"70",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("line",{x1:"70",y1:"50",x2:"60",y2:"75",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("circle",{cx:"48",cy:"48",r:"2",fill:"#E0E7FF"}),e.jsx("circle",{cx:"52",cy:"48",r:"2",fill:"#E0E7FF"}),e.jsx("path",{d:"M48 54 Q50 56 52 54",stroke:"#E0E7FF",strokeWidth:"1.5",fill:"none"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"constellationBg",cx:"50%",cy:"50%",r:"70%",children:[e.jsx("stop",{stopColor:"#1E1B4B"}),e.jsx("stop",{offset:"1",stopColor:"#0F0D2A"})]})})]})}function ct({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"35",cy:"35",r:"18",fill:"url(#cometGradient)"}),e.jsx("circle",{cx:"31",cy:"31",r:"2",fill:"#1F2937"}),e.jsx("circle",{cx:"39",cy:"31",r:"2",fill:"#1F2937"}),e.jsx("path",{d:"M32 38 Q35 41 38 38",stroke:"#1F2937",strokeWidth:"1.5",fill:"none"}),e.jsx("path",{d:"M50 50 Q65 65 85 85",stroke:"url(#tailGradient1)",strokeWidth:"8",opacity:"0.7"}),e.jsx("path",{d:"M48 52 Q60 68 75 88",stroke:"url(#tailGradient2)",strokeWidth:"6",opacity:"0.5"}),e.jsx("path",{d:"M52 48 Q70 62 90 82",stroke:"url(#tailGradient3)",strokeWidth:"4",opacity:"0.3"}),e.jsx("circle",{cx:"60",cy:"60",r:"1.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"70",cy:"70",r:"1",fill:"#FCD34D"}),e.jsx("circle",{cx:"80",cy:"80",r:"0.8",fill:"#FCD34D"}),e.jsxs("defs",{children:[e.jsxs("radialGradient",{id:"cometGradient",cx:"30%",cy:"30%",r:"80%",children:[e.jsx("stop",{stopColor:"#FEF3C7"}),e.jsx("stop",{offset:"1",stopColor:"#F59E0B"})]}),e.jsxs("linearGradient",{id:"tailGradient1",x1:"50%",y1:"50%",x2:"85%",y2:"85%",children:[e.jsx("stop",{stopColor:"#FCD34D"}),e.jsx("stop",{offset:"1",stopColor:"transparent"})]}),e.jsxs("linearGradient",{id:"tailGradient2",x1:"48%",y1:"52%",x2:"75%",y2:"88%",children:[e.jsx("stop",{stopColor:"#F472B6"}),e.jsx("stop",{offset:"1",stopColor:"transparent"})]}),e.jsxs("linearGradient",{id:"tailGradient3",x1:"52%",y1:"48%",x2:"90%",y2:"82%",children:[e.jsx("stop",{stopColor:"#A78BFA"}),e.jsx("stop",{offset:"1",stopColor:"transparent"})]})]})]})}function dt({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"url(#twilightGradient)"}),e.jsx("ellipse",{cx:"50",cy:"65",rx:"25",ry:"15",fill:"#1F2937",opacity:"0.8"}),e.jsx("circle",{cx:"30",cy:"25",r:"1.5",fill:"#FFF"}),e.jsx("circle",{cx:"70",cy:"30",r:"1",fill:"#FFF"}),e.jsx("circle",{cx:"40",cy:"35",r:"1.2",fill:"#FFF"}),e.jsx("circle",{cx:"60",cy:"25",r:"0.8",fill:"#FFF"}),e.jsx("path",{d:"M20 40 Q15 35 20 30 Q25 35 20 40",fill:"#FCD34D"}),e.jsx("circle",{cx:"47",cy:"62",r:"1.5",fill:"#E0E7FF"}),e.jsx("circle",{cx:"53",cy:"62",r:"1.5",fill:"#E0E7FF"}),e.jsx("path",{d:"M48 67 Q50 69 52 67",stroke:"#E0E7FF",strokeWidth:"1",fill:"none"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"twilightGradient",cx:"50%",cy:"30%",r:"80%",children:[e.jsx("stop",{stopColor:"#7C3AED"}),e.jsx("stop",{offset:"0.7",stopColor:"#3730A3"}),e.jsx("stop",{offset:"1",stopColor:"#1E1B4B"})]})})]})}const ut={astronaut:Oe,moon:et,star:tt,galaxy:rt,nebula:st,planet:nt,"cosmic-cat":at,"dream-cloud":ot,rocket:lt,constellation:it,comet:ct,twilight:dt},ft={xs:{size:"w-8 h-8",iconSize:"24"},sm:{size:"w-10 h-10",iconSize:"32"},md:{size:"w-12 h-12",iconSize:"40"},lg:{size:"w-16 h-16",iconSize:"56"},xl:{size:"w-20 h-20",iconSize:"72"},"2xl":{size:"w-24 h-24",iconSize:"88"}},xt={circle:"rounded-full",square:"rounded-lg"};function mt({id:r,ref:a,size:t="md",shape:o="circle",preset:s,alt:n,className:i,src:u,initials:c,...x}){const f=ft[t],d=xt[o],h=s?ut[s]:null;return e.jsx("div",{id:r,ref:a,className:w.join("relative inline-flex items-center justify-center overflow-hidden bg-gray-100 border-2 border-border",f.size,d,i),"data-size":t,"data-shape":o,"data-preset":s,role:"img","aria-label":n||`Avatar ${s?`of ${s}`:""}`,...x,children:u?e.jsx("img",{src:u,alt:n||"User avatar",className:"w-full h-full object-cover"}):h?e.jsx(h,{size:f.iconSize}):c?e.jsx("span",{className:"text-gray-600 font-medium text-sm",children:c.slice(0,2).toUpperCase()}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-gray-300 to-gray-400"})})}const ht={decorative:{"aria-hidden":!0},status:{role:"status"},alert:{role:"alert"}},pt={base:"",primary:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",accent:"bg-accent text-accent-foreground",destructive:"bg-destructive text-destructive-foreground",success:"bg-success text-success-foreground",warning:"bg-warning text-warning-foreground",muted:"bg-muted text-muted-foreground"},bt={base:"",primary:"border border-primary bg-transparent text-primary",secondary:"border border-secondary bg-transparent text-secondary",accent:"border border-accent bg-transparent text-accent",destructive:"border border-destructive bg-transparent text-destructive",success:"border border-success bg-transparent text-success",warning:"border border-warning bg-transparent text-warning",muted:"border border-muted-foreground bg-transparent text-muted-foreground"},be={xs:{text:"text-xs",aspectSquare:"p-1",aspectVideo:"px-2 py-0.5"},sm:{text:"text-sm",aspectSquare:"p-1.5",aspectVideo:"px-2.5 py-1"},md:{text:"text-base",aspectSquare:"p-2",aspectVideo:"px-3 py-1.5"}};function gt({id:r,ref:a,variant:t="muted",outline:o=!1,children:s,className:n,aspect:i="video",use:u="decorative",size:c="xs",...x}){return e.jsx("span",{id:r,ref:a,className:w.join("font-medium rounded-full inline-flex select-none",be[c].text,i==="square"&&be[c].aspectSquare,i==="video"&&be[c].aspectVideo,o?bt[t]:pt[t],n),"data-variant":t,"data-outline":o,"data-aspect":i,"data-use":u,"data-size":c,...ht[u],...x,children:s})}function ze(){const[r,a]=l.useState(0);return l.useEffect(()=>{const t=setInterval(()=>{a(o=>(o+1)%3)},500);return()=>clearInterval(t)},[]),e.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(t=>e.jsx("div",{className:w.join("rounded-full transition-all ease-in-out size-[0.35em] bg-current",r===t&&"transform -translate-y-1")},t))})}const yt={base:"focus:outline-current",primary:"bg-primary text-primary-foreground hover:bg-primary/80 focus:outline-primary outline-offset-2 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 focus:outline-secondary outline-offset-2 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary/80 disabled:text-muted-foreground focus:outline-primary",outline:"border border-primary text-primary hover:border-primary/80 hover:text-primary/80 focus:outline-primary outline-offset-2 disabled:border-muted-foreground disabled:text-muted-foreground",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted-foreground focus:outline-current",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80 focus:outline-destructive outline-offset-2 disabled:bg-muted disabled:text-muted-foreground"},vt={stripped:"",fitted:"size-fit leading-0",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},jt={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},ge={variant:"primary",size:"md",rounded:"md"};function Te({variant:r=ge.variant,size:a,rounded:t=ge.rounded,loading:o,className:s,...n}){let i;r==="link"&&!a?i="fitted":i=a||ge.size;const c=w.join("appearance-none not-disabled:hover:cursor-pointer outline outline-transparent disabled:opacity-50 disabled:cursor-not-allowed transition-all",yt[r],vt[i],jt[t],o&&"relative pointer-events-none",s);if(n.href&&!n.disabled)return e.jsx("a",{...n,rel:n.rel?n.rel:n.target==="_blank"?"noopener noreferrer":void 0,"aria-label":n["aria-label"],"aria-description":n["aria-description"],href:n.href,className:c,children:n.children});const x=n,f=()=>x.children?typeof x.children=="string"||typeof x.children=="number"||typeof x.children=="boolean"?e.jsx("span",{className:w.join(o&&"invisible"),children:x.children}):l.Children.map(x.children,(h,m)=>{if(l.isValidElement(h)){const y=h.props;return l.cloneElement(h,{key:m,className:w.join(o&&"invisible",y.className)})}return h}):null;return e.jsxs("button",{...x,"aria-label":x["aria-label"],"aria-description":x["aria-description"],"aria-disabled":x.disabled||o,"aria-busy":o,type:x.type??"button",className:c,children:[o&&e.jsx(ze,{}),f()]})}function wt(r={}){const{initialDate:a=new Date,mode:t="single",minDate:o,maxDate:s,view:n="month",onDateSelect:i,onRangeSelect:u}=r,[c,x]=l.useState({currentDate:a,selectedDate:t==="single"?a:null,selectedRange:null,view:n}),f=l.useCallback(N=>!!(o&&N<o||s&&N>s),[o,s]),d=l.useCallback(N=>{f(N)||(t==="single"?(x(D=>({...D,selectedDate:N})),i==null||i(N)):t==="range"&&x(D=>{const{selectedRange:A}=D;if(!(A!=null&&A.start)||A.start&&A.end){const M={start:N,end:null};return u==null||u(M),{...D,selectedRange:M}}else{const M=A.start,$=N,I={start:M<$?M:$,end:M<$?$:M};return u==null||u(I),{...D,selectedRange:I}}}))},[t,f,i,u]),h=l.useCallback(N=>{x(D=>{const A=new Date(D.currentDate);return N==="prev"?A.setMonth(A.getMonth()-1):A.setMonth(A.getMonth()+1),{...D,currentDate:A}})},[]),m=l.useCallback(N=>{x(D=>{const A=new Date(D.currentDate),M=N==="prev"?-7:7;return A.setDate(A.getDate()+M),{...D,currentDate:A}})},[]),y=l.useCallback(N=>{x(D=>{const A=new Date(D.currentDate),M=N==="prev"?-1:1;return A.setDate(A.getDate()+M),{...D,currentDate:A}})},[]),v=l.useCallback(N=>{c.view==="month"?h(N):c.view==="week"?m(N):y(N)},[c.view,h,m,y]),b=l.useCallback(N=>{x(D=>({...D,view:N}))},[]),C=l.useCallback(N=>{x(D=>({...D,currentDate:N}))},[]),p=l.useCallback(N=>{x(D=>{const A=new Date(D.currentDate);return A.setMonth(N),{...D,currentDate:A}})},[]),g=l.useCallback(N=>{x(D=>{const A=new Date(D.currentDate);return A.setFullYear(N),{...D,currentDate:A}})},[]),j=l.useMemo(()=>{const{currentDate:N,view:D}=c,A=[];if(D==="month"){const M=new Date(N.getFullYear(),N.getMonth(),1),$=new Date(M);$.setDate($.getDate()-M.getDay());for(let I=0;I<42;I++){const R=new Date($);R.setDate(R.getDate()+I),A.push(R)}}else if(D==="week"){const M=new Date(N);M.setDate(N.getDate()-N.getDay());for(let $=0;$<7;$++){const I=new Date(M);I.setDate(I.getDate()+$),A.push(I)}}else A.push(new Date(N));return A},[c]),E=l.useCallback(N=>{if(t==="single")return c.selectedDate&&N.toDateString()===c.selectedDate.toDateString();if(t==="range"&&c.selectedRange){const{start:D,end:A}=c.selectedRange;if(D&&A)return N>=D&&N<=A;if(D)return N.toDateString()===D.toDateString()}return!1},[t,c.selectedDate,c.selectedRange]),z=l.useCallback(N=>{var D,A;if(t==="range"&&((D=c.selectedRange)!=null&&D.start)&&((A=c.selectedRange)!=null&&A.end)){const{start:M,end:$}=c.selectedRange;return N>M&&N<$}return!1},[t,c.selectedRange]),k=l.useCallback(N=>{var D;return t==="range"&&((D=c.selectedRange)!=null&&D.start)?N.toDateString()===c.selectedRange.start.toDateString():!1},[t,c.selectedRange]),F=l.useCallback(N=>{var D;return t==="range"&&((D=c.selectedRange)!=null&&D.end)?N.toDateString()===c.selectedRange.end.toDateString():!1},[t,c.selectedRange]);return{currentDate:c.currentDate,selectedDate:c.selectedDate,selectedRange:c.selectedRange,view:c.view,daysInView:j,selectDate:d,navigate:v,changeView:b,goToDate:C,changeMonth:p,changeYear:g,isDateSelected:E,isDateDisabled:f,isDateInRange:z,isDateRangeStart:k,isDateRangeEnd:F}}const kt={small:{container:"text-xs",cell:"w-7 h-7 text-xs",header:"text-sm px-2 py-1",navigation:"p-1",weekdays:"text-xs px-1 py-1"},medium:{container:"text-sm",cell:"w-9 h-9 text-sm",header:"text-base px-3 py-2",navigation:"p-2",weekdays:"text-sm px-2 py-2"},large:{container:"text-base",cell:"w-12 h-12 text-base",header:"text-lg px-4 py-3",navigation:"p-3",weekdays:"text-base px-3 py-2"},auto:{container:"w-full h-full",cell:"flex-1 min-h-[2rem] text-sm",header:"text-base px-3 py-2",navigation:"p-2",weekdays:"text-sm px-2 py-2"}},Ct={month:"grid-cols-7",week:"grid-cols-7",day:"grid-cols-1"},we={size:"medium",view:"month"},Nt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ie=["January","February","March","April","May","June","July","August","September","October","November","December"],ke=100;function Dt({id:r,ref:a,className:t,size:o=we.size,customStyles:s={},view:n=we.view,mode:i="single",initialDate:u,minDate:c,maxDate:x,renderCell:f,showViewSelector:d=!1,showNavigation:h=!0,navigationLayout:m="around",useMonthYearSelector:y=!1,showTodayButton:v=!1,onDateSelect:b,onRangeSelect:C,...p}){const g=wt({initialDate:u,mode:i,minDate:c,maxDate:x,view:n,onDateSelect:b,onRangeSelect:C}),j=kt[o],E=Ct[g.view],z=S=>{const B=new Date;return S.toDateString()===B.toDateString()},k=S=>S.getMonth()===g.currentDate.getMonth()&&S.getFullYear()===g.currentDate.getFullYear(),F=()=>{g.goToDate(new Date)},N=()=>{const{currentDate:S,view:B}=g,Y=ie[S.getMonth()],H=S.getFullYear();if(B==="month")return`${Y} ${H}`;if(B==="week"){const q=new Date(S);q.setDate(S.getDate()-S.getDay());const Z=new Date(q);return Z.setDate(Z.getDate()+6),q.getMonth()===Z.getMonth()?`${Y} ${q.getDate()}-${Z.getDate()}, ${H}`:`${ie[q.getMonth()]} ${q.getDate()} - ${ie[Z.getMonth()]} ${Z.getDate()}, ${H}`}return`${Y} ${S.getDate()}, ${H}`},D=()=>d?e.jsx("div",{className:_,children:["month","week","day"].map(S=>e.jsx("button",{onClick:()=>g.changeView(S),className:w.join("px-2 py-1 rounded capitalize transition-colors",g.view===S?"bg-accent text-accent-foreground":"hover:bg-accent/20"),children:S},S))}):null,A=()=>{if(!y)return null;const S=g.currentDate.getMonth(),B=g.currentDate.getFullYear(),Y=B-ke,H=B+ke,q=[];for(let P=Y;P<=H;P++)q.push(P);const Z=w.join("border border-border rounded px-2 py-1 text-sm focus:outline-none focus:border-accent focus:ring-2 focus:ring-accent/50",s.monthYearSelectorsClassName);return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:S,onChange:P=>g.changeMonth(parseInt(P.target.value)),className:Z,children:ie.map((P,se)=>e.jsx("option",{value:se,children:P},P))}),e.jsx("select",{value:B,onChange:P=>g.changeYear(parseInt(P.target.value)),className:Z,children:q.map(P=>e.jsx("option",{value:P,children:P},P))})]})},M=()=>{if(!v)return null;const S=w.join("px-3 py-1 text-xs rounded border border-border hover:bg-accent/20 transition-colors focus:outline-none focus:ring focus:ring-accent/50",s.todayButtonClassName);return e.jsx("button",{onClick:F,className:S,"aria-label":"Go to today",children:"Today"})},$=S=>{const B=g.isDateSelected(S),Y=g.isDateDisabled(S),H=z(S),q=g.isDateInRange(S),Z=g.isDateRangeStart(S),P=g.isDateRangeEnd(S),se=k(S),ne=w.join("w-full flex items-center justify-center transition-colors cursor-pointer","focus:outline-none",j.cell),W=w.join(!q&&"rounded-md",!B&&"hover:bg-accent/20 focus:bg-accent/20",ne,s.cellClassName,B&&w.join("bg-accent text-accent-foreground",s.selectedCellClassName),q&&w.join("bg-accent/30",s.rangeCellClassName),Z&&w.join("bg-accent text-accent-foreground rounded-r-none",s.rangeStartCellClassName),P&&w.join("bg-accent text-accent-foreground rounded-l-none",s.rangeEndCellClassName),H&&!B&&w.join("border border-accent",s.todayCellClassName),Y&&w.join("opacity-50 cursor-not-allowed hover:bg-transparent",s.disabledCellClassName),g.view==="month"&&!se&&"text-muted-foreground/50"),Q=f?f(S,!!B,Y,H):S.getDate();return e.jsx("button",{onClick:()=>g.selectDate(S),disabled:Y,className:W,"data-date":S.toISOString().split("T")[0],"data-selected":!!B,"data-disabled":Y,"data-today":H,"aria-label":`${S.getDate()} ${ie[S.getMonth()]} ${S.getFullYear()}`,"aria-selected":!!B,"aria-disabled":Y,children:Q},S.toISOString())},I=w.join("bg-background border rounded-lg",j.container,s.containerClassName,t),R=w.join("flex items-center border-b px-4 py-2","justify-between",j.header,s.headerClassName),G=w.join("flex items-center gap-1",s.navigationClassName),K=w.join("p-1 rounded hover:bg-accent/20 transition-colors",j.navigation,s.prevButtonClassName),U=w.join("p-1 rounded hover:bg-accent/20 transition-colors",j.navigation,s.nextButtonClassName),T=w.join("font-semibold text-foreground",s.titleClassName),_=w.join("flex gap-1 text-xs",s.viewSelectorClassName),X=w.join("grid grid-cols-7 border-b text-muted-foreground font-medium",j.weekdays,s.weekdaysClassName),te=w.join("text-center",s.weekdayClassName),re=w.join("grid gap-y-1 p-2",g.view==="month"&&E,g.view==="week"&&w.join(E,s.weekGridClassName),g.view==="day"&&w.join(E,s.dayGridClassName),g.view==="month"&&s.monthGridClassName);return e.jsxs("div",{id:r,ref:a,className:I,"data-size":o,"data-view":g.view,"data-mode":i,role:"application","aria-label":"Calendar",...p,children:[e.jsxs("div",{className:R,children:[m==="adjacent"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4",children:[h&&e.jsxs("div",{className:G,children:[e.jsx("button",{onClick:()=>g.navigate("prev"),className:K,"aria-label":"Previous",children:e.jsx(L.ChevronLeft,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>g.navigate("next"),className:U,"aria-label":"Next",children:e.jsx(L.ChevronRight,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[!y&&e.jsx("h2",{className:T,children:N()}),A()]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[D(),M()]})]}),m==="around"&&e.jsxs(e.Fragment,{children:[h&&e.jsx("button",{onClick:()=>g.navigate("prev"),className:K,"aria-label":"Previous",children:e.jsx(L.ChevronLeft,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[!y&&e.jsx("h2",{className:T,children:N()}),A()]}),e.jsxs("div",{className:"flex items-center gap-2",children:[D(),M()]})]}),h&&e.jsx("button",{onClick:()=>g.navigate("next"),className:U,"aria-label":"Next",children:e.jsx(L.ChevronRight,{className:"w-4 h-4"})})]})]}),(g.view==="month"||g.view==="week")&&e.jsx("div",{className:X,children:Nt.map(S=>e.jsx("div",{className:te,children:S},S))}),e.jsx("div",{className:re,children:g.daysInView.map(S=>$(S))},`${g.currentDate.getFullYear()}-${g.currentDate.getMonth()}-${g.view}`)]})}const Et={info:{border:"border-blue-600",interior:"bg-blue-800/20",core:"text-blue-400",description:"text-blue-200"},destructive:{border:"border-destructive",interior:"bg-destructive/10",core:"text-destructive",description:"text-destructive"},success:{border:"border-success",interior:"bg-success/10",core:"text-success",description:"text-success"},warning:{border:"border-yellow-700",interior:"bg-yellow-800/20",core:"text-yellow-400",description:"text-yellow-200"},base:{border:"",interior:"",core:"",description:"opacity-90"}},St={info:e.jsx(ee.InfoCircled,{size:22}),destructive:e.jsx(ee.CrossCircled,{size:22}),success:e.jsx(L.CheckCircled,{size:22}),warning:e.jsx(ee.ExclamationTriangle,{size:20}),base:e.jsx(L.DeepRing,{size:22})};function Ft({id:r,ref:a,variant:t="base",icon:o,title:s,description:n,className:i,dismissible:u=!1,onDismiss:c}){const x=l.useId(),f=r||`callout-${x}`,[d,h]=l.useState(!1),m=Et[t],y=St[t],v=()=>{h(!0),c&&c()};return d?null:e.jsxs("div",{id:f,ref:a,className:w.join("relative rounded-lg p-2 sm:p-4 border",m.border,m.interior,i),"data-variant":t,role:"note","aria-describedby":n?`${f}-description`:void 0,"aria-labelledby":s?`${f}-title`:void 0,children:[e.jsxs("div",{className:"flex items-start gap-x-2",children:[o!==null&&e.jsx("span",{className:m.core,children:o===void 0?y:o}),(s||n)&&e.jsxs("div",{className:"flex-1",children:[s&&e.jsx("div",{id:`${f}-title`,className:w.join("font-medium",m.core),children:s}),n&&e.jsx("div",{id:`${f}-description`,className:w.join("mt-0.5 font-light",m.description),children:n})]})]}),u&&e.jsx("button",{type:"button",onClick:v,"data-callout-close-button":"true",className:w.join(m.core,"rounded-md p-0.5 top-2.5 right-2.5 absolute focus:outline-none hover:ring focus:ring-2 focus:ring-current leading-0"),"aria-label":"Close callout",children:e.jsx(ee.X,{size:18})})]})}const It={sm:{container:"text-sm",header:"text-base font-medium",content:"text-sm leading-relaxed",footer:"text-xs",paddingMulti:1/3},md:{container:"text-base",header:"text-lg font-semibold",content:"text-base leading-relaxed",footer:"text-sm",paddingMulti:1/2},lg:{container:"text-lg",header:"text-xl font-bold",content:"text-lg leading-relaxed",footer:"text-base",paddingMulti:1}};function At({id:r,className:a,ref:t,size:o="md",padding:s=16,header:n,footer:i,children:u,imageSrc:c,imageAlt:x,imageComponent:f,imageToEdge:d=!0,...h}){const m=It[o],y=c||f;return e.jsxs("div",{id:r,ref:t,"data-testid":"card","data-size":o,"data-padding":s,className:w.join("border border-border rounded-lg shadow-sm","w-full max-w-full",m.container,a),...h,children:[y&&e.jsx("div",{style:d?void 0:{padding:s,paddingBottom:0},className:"w-full overflow-hidden",children:f||e.jsx("img",{src:c,alt:x||"",className:"w-full h-auto object-cover rounded-xs",loading:"lazy"})}),e.jsxs("div",{style:{padding:s,rowGap:s*m.paddingMulti},className:"flex flex-col",children:[n&&e.jsx("div",{className:m.header,children:n}),u&&e.jsx("div",{className:m.content,children:u}),i&&e.jsx("div",{className:m.footer,children:i})]})]})}function $t({totalItems:r,itemsToShow:a,infinite:t,autoScroll:o,scrollInterval:s,pauseScrollOnHover:n,currentIndex:i,onIndexChange:u}){const[c,x]=l.useState(i||0),[f,d]=l.useState(!1),h=l.useRef(null),m=Math.ceil(r/a),y=t||c>0,v=t||c<m-1,b=l.useCallback(g=>{const j=Math.max(0,Math.min(g,m-1));x(j),u==null||u(j)},[m,u]),C=l.useCallback(()=>{if(y){const g=c===0&&t?m-1:c-1;b(g)}},[c,y,t,m,b]),p=l.useCallback(()=>{if(v){const g=c===m-1&&t?0:c+1;b(g)}},[c,v,t,m,b]);return l.useEffect(()=>{i!==void 0&&i!==c&&x(i)},[i,c]),l.useEffect(()=>{if(!o)return;const g=()=>{h.current=setInterval(()=>{n&&f||p()},s)},j=()=>{h.current&&(clearInterval(h.current),h.current=null)};return!f||!n?g():j(),j},[o,s,n,f,p]),l.useEffect(()=>{x(0)},[a]),{currentSlide:c,canGoPrev:y,canGoNext:v,goToPrev:C,goToNext:p,goToSlide:b,isHovered:f,setIsHovered:d}}const ce={sm:{button:"h-6 w-6 text-xs",icon:"size-3"},md:{button:"h-8 w-8 text-sm",icon:"size-4"},lg:{button:"h-10 w-10 text-lg",icon:"size-5"}},Ce={default:"bg-accent text-accent-foreground hover:bg-accent-foreground hover:text-accent",outline:"border border-border bg-background hover:bg-accent hover:text-accent-foreground hover:border-accent",ghost:"hover:text-accent"},de={aligned:{prev:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",next:"absolute right-0 top-1/2 translate-x-1/2 -translate-y-1/2 z-10"},exterior:{prev:"absolute -left-10 top-1/2 -translate-y-1/2 z-10",next:"absolute -right-10 top-1/2 -translate-y-1/2 z-10"},interior:{prev:"absolute left-2 top-1/2 -translate-y-1/2 z-10",next:"absolute right-2 top-1/2 -translate-y-1/2 z-10"}};function Mt({children:r,id:a,ref:t,className:o,autoScroll:s=!1,scrollInterval:n=3e3,pauseScrollOnHover:i=!0,currentIndex:u,onIndexChange:c,hidePrevNext:x=!1,hideDots:f=!1,itemsToShow:d=1,buttonSize:h="md",buttonVariant:m="default",buttonPosition:y="exterior",infinite:v=!0,prevButton:b,nextButton:C,itemsClassName:p,containerClassName:g,dotsClassName:j,gap:E=8}){var B,Y;const z=l.useRef(null),k=l.Children.toArray(r).filter(l.isValidElement),F=k.length,{screenSize:N}=Xe.useScreenSize(),D=l.useMemo(()=>{if(typeof d=="number")return d;if(typeof d=="object"&&d&&N){const H=["2xl","xl","lg","md","sm","xs"],q=H.indexOf(N);for(let Z=q;Z<H.length;Z++){const P=H[Z];if(d[P]!==void 0)return d[P]}}return 1},[d,N]),{currentSlide:A,canGoPrev:M,canGoNext:$,goToPrev:I,goToNext:R,goToSlide:G,setIsHovered:K}=$t({totalItems:F,itemsToShow:D,infinite:v,autoScroll:s,scrollInterval:n,pauseScrollOnHover:i,currentIndex:u,onIndexChange:c}),U=l.useCallback(H=>{if(D===1)return{leftWidth:0,rightWidth:0,widthReduction:0};const q=E*(D-1)/D;return H%D===0?{leftWidth:0,rightWidth:E/2,widthReduction:q}:H%D===D-1?{leftWidth:E/2,rightWidth:0,widthReduction:q}:{leftWidth:E/2,rightWidth:E/2,widthReduction:q}},[D,E]),T=()=>{I()},_=()=>{R()},X=()=>{i&&K(!0)},te=()=>{i&&K(!1)},re=-(A*(100/F)*D),S=w.join("inline-flex items-center justify-center rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring focus-visible:ring-ring disabled:pointer-events-none",y==="aligned"?"disabled:opacity-90":"disabled:opacity-50");return e.jsxs("div",{className:w.join("relative",o),"data-carousel-wrapper":"true",children:[!x&&e.jsx(e.Fragment,{children:b?l.cloneElement(b,{onClick:T,disabled:!M,className:w.join(((B=b.props)==null?void 0:B.className)||"",de[y].prev),role:"button","aria-disabled":!M,"aria-label":"Previous slide","data-carousel-prev":"true"}):e.jsx("button",{type:"button",onClick:T,disabled:!M,className:w.join(S,ce[h].button,Ce[m],de[y].prev),"aria-disabled":!M,"aria-label":"Previous slide","data-carousel-prev":"true",children:e.jsx(L.ChevronLeft,{className:ce[h].icon})})}),e.jsxs("div",{id:a,ref:t,className:w.join("relative overflow-hidden",g),onMouseEnter:X,onMouseLeave:te,"data-carousel":"true","data-current-index":A,"data-items-to-show":D,"data-auto-scroll":s,"data-button-position":y,children:[e.jsx("div",{ref:z,className:"flex transition-transform ease-in-out",style:{transform:`translateX(${re}%)`,width:`${F/D*100}%`},children:k.map((H,q)=>{const{leftWidth:Z,rightWidth:P,widthReduction:se}=U(q);return e.jsx("div",{className:w.join("flex-shrink-0",p),style:{width:`calc(${100/F}% - ${se}px)`,marginRight:P>0?`${P}px`:void 0,marginLeft:Z>0?`${Z}px`:void 0},"data-slide-index":q,children:H},q)})}),!f&&e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2",children:Array.from({length:Math.ceil(F/D)}).map((H,q)=>e.jsx("button",{type:"button",onClick:()=>G(q),className:w.join("w-2 h-2 rounded-full transition-colors",q===A?"bg-accent":"bg-muted-foreground/60 hover:bg-muted-foreground/100",j),"aria-label":`Go to slide ${q+1}`,"data-carousel-dot":q},q))})]}),!x&&e.jsx(e.Fragment,{children:C?l.cloneElement(C,{onClick:_,disabled:!$,className:w.join(((Y=C.props)==null?void 0:Y.className)||"",de[y].next),role:"button","aria-disabled":!$,"aria-label":"Next slide","data-carousel-next":"true"}):e.jsx("button",{type:"button",onClick:_,disabled:!$,className:w.join(S,ce[h].button,Ce[m],de[y].next),"aria-disabled":!$,"aria-label":"Next slide","data-carousel-next":"true",children:e.jsx(L.ChevronRight,{className:ce[h].icon})})})]})}function zt(r){const[a,t]=l.useState(""),o=l.useCallback(s=>{let n=s,i="";for(;n&&!i;){const u=window.getComputedStyle(n).backgroundColor;u&&u!=="transparent"&&u!=="rgba(0, 0, 0, 0)"&&(i=u),n=n.parentElement}return i||"transparent"},[]);return l.useEffect(()=>{const s=document.getElementById(r);if(s){const n=o(s.parentElement);t(n)}},[r,o]),a}function xe({ref:r,id:a,size:t=20,color:o,filled:s=!1,rounded:n=!0,checked:i=!1,indeterminate:u=!1,onCheckedChange:c,disabled:x,className:f="",display:d="inline",...h}){const m=l.useId(),y=l.useMemo(()=>a||`checkbox-${m}`,[a,m]),v=zt(y),[b,C]=l.useState(i),[p,g]=l.useState(u);l.useEffect(()=>{C(i)},[i]),l.useEffect(()=>{g(u)},[u]);const j=()=>{if(!x){const k=p?!0:!b;C(k),g(!1),c==null||c(k)}},E=k=>{k.key===" "&&(k.preventDefault(),j())},z=w.join("items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",d==="inline"?"inline-flex":"flex",n&&"rounded",x&&"opacity-40 cursor-not-allowed",!x&&"cursor-pointer",f);return e.jsx("button",{id:y,type:"button",ref:r,tabIndex:0,role:"checkbox",onClick:j,"aria-checked":p?"mixed":b,"aria-disabled":x,onKeyDownCapture:E,style:{width:t,height:t,color:o,backgroundColor:(b||p)&&s?"currentcolor":"transparent"},className:z,...h,children:p?e.jsx(L.Dash,{size:t,color:s?v:void 0}):e.jsx(L.Check,{size:t,color:s?v:void 0,className:b?"opacity-100":"opacity-0"})})}function Tt({children:r,className:a,linkTo:t,linkProps:o,onButtonClick:s,buttonProps:n,...i}){return t&&s&&console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'),e.jsxs("div",{className:w.join("relative w-fit",a),...i,children:[r,t&&e.jsx("a",{...o,rel:(o==null?void 0:o.rel)||"noreferrer",href:t,className:w.join("absolute inset-0",o==null?void 0:o.className)}),!t&&s&&e.jsx("button",{...n,type:"button",onClick:s,className:w.join("absolute inset-0 cursor-pointer",n==null?void 0:n.className)})]})}function Rt(r){const[a,t]=l.useState(null);return l.useEffect(()=>{var u;const o=(u=document.getElementById(r))==null?void 0:u.parentElement;if(!o)return;const s=()=>{const c=window.getComputedStyle(o),x=parseFloat(c.fontSize),f=c.lineHeight==="normal"?x*1.2:parseFloat(c.lineHeight),d=x-2,h=d/x,m=f*h;t({fontSize:x,lineHeight:f,smallerFontSize:d,smallerLineHeight:m})};s();const n=new ResizeObserver(s);n.observe(o);const i=new MutationObserver(s);return i.observe(o,{attributes:!0,attributeFilter:["style","class"],subtree:!1}),()=>{n.disconnect(),i.disconnect()}},[r]),a}const Bt={base:"",modest:"opacity-90 bg-muted/10",accent:"text-accent bg-muted/10",current:"text-current bg-current/10"};function Lt({id:r,ref:a,content:t,variant:o="accent",className:s,style:n,...i}){const u=l.useId(),c=r||`code-${u}`,x=Rt(c);return e.jsx("code",{id:c,ref:a,className:w.join("px-2 py-1 rounded",Bt[o],s),"data-variant":o,style:{fontSize:x?`${x.smallerFontSize}px`:void 0,lineHeight:x?`${x.smallerLineHeight}px`:void 0,...n},...i,children:t})}const Vt={keyword:"text-rose-400",runner:"text-amber-400",comment:"text-gray-500/80",command:"text-gray-100",variable:"text-blue-400",string:"text-white/70",option:"text-purple-400",plain:"text-gray-200",operator:"text-pink-500",substitution:"text-green-300"},Gt={selector:"text-blue-400 font-medium",property:"text-purple-400",value:"text-green-400",punctuation:"text-gray-400",atRule:"text-pink-400 font-semibold",comment:"text-gray-500 italic",string:"text-green-400",number:"text-green-400",plain:"text-gray-100",function:"text-cyan-400"},Wt={key:"text-purple-400 font-semibold",string:"text-green-400",number:"text-orange-400 font-medium",boolean:"text-cyan-400 font-medium",punctuation:"text-gray-400",plain:"text-gray-100"},_t={heading:"text-blue-400 font-bold","heading-hash":"text-gray-500",bold:"text-white font-bold",italic:"text-white italic","bold-marker":"text-gray-400","italic-marker":"text-gray-400",link:"text-blue-400 underline","link-text":"text-blue-400","link-url":"text-green-400","link-bracket":"text-gray-400","link-paren":"text-gray-400",code:"text-pink-400 bg-gray-800 px-1 rounded text-sm","code-marker":"text-gray-500","code-block":"text-green-400","code-block-marker":"text-gray-500","list-marker":"text-orange-400 font-medium","list-item":"text-gray-200",blockquote:"text-gray-300 italic","blockquote-marker":"text-gray-500",plain:"text-gray-200"},qt={keyword:"text-purple-400 font-semibold",type:"text-cyan-400 font-medium",string:"text-green-400","jsx-bracket":"text-gray-400","jsx-tag":"text-blue-400 font-medium","jsx-attribute":"text-amber-400","jsx-brace":"text-yellow-400",jsx:"text-blue-400 font-medium",property:"text-amber-400",number:"text-orange-400 font-medium",comment:"text-gray-500 italic",function:"text-rose-400 font-semibold",hook:"text-rose-400 font-semibold",operator:"text-gray-300",plain:"text-gray-100"},Pt=new Set(["for","in","do","done","else","if","fi","then","while","until","case","esac"]),Kt=new Set(["npm","npx","pnpm","yarn","vite"]);function Ht(r){const a=[];let t=0;for(a.push({text:"`",type:"string"}),t=1;t<r.length;){const o=r[t];if(o==="`"){a.push({text:"`",type:"string"}),t++;break}if(o==="$"&&t+1<r.length&&r[t+1]==="{"){a.push({text:"${",type:"string"}),t+=2;let n=1;const i=t;for(;t<r.length&&n>0;)r[t]==="{"?n++:r[t]==="}"&&n--,n>0&&t++;if(n===0){const u=r.slice(i,t);if(u.trim().length>0){const c=me(u,!1,0);a.push(...c)}a.push({text:"}",type:"string"}),t++}else a.push({text:r.slice(i,t),type:"string"});continue}const s=t;for(;t<r.length&&r[t]!=="`"&&!(r[t]==="$"&&t+1<r.length&&r[t+1]==="{");)t++;t>s&&a.push({text:r.slice(s,t),type:"string"})}return{tokens:a,consumed:t}}function Yt(r){const a=[];let t=0;for(;t<r.length;){const o=r[t];if(o==="`"){if(a.push({text:"`",type:"string"}),t++,t<r.length){const n=me(r.slice(t),!1,0,!1);a.push(...n)}break}if(o==="$"&&t+1<r.length&&r[t+1]==="{"){a.push({text:"${",type:"string"}),t+=2;let n=1;const i=t;for(;t<r.length&&n>0;)r[t]==="{"?n++:r[t]==="}"&&n--,n>0&&t++;if(n===0){const u=r.slice(i,t);if(u.trim().length>0){const c=me(u,!1,0,!1);a.push(...c)}a.push({text:"}",type:"string"}),t++}else{a.push({text:r.slice(i),type:"string"});break}continue}const s=t;for(;t<r.length&&r[t]!=="`"&&!(r[t]==="$"&&t+1<r.length&&r[t+1]==="{");)t++;t>s&&a.push({text:r.slice(s,t),type:"string"})}return{tokens:a}}function Re(r){const a=[];if(r.trim()==="")return a.push({text:" ",type:"plain"}),a;if(r.trim().startsWith("#"))return a.push({text:r,type:"comment"}),a;const t=/(\$\([^)]*\)|"[^"]*"|'[^']*'|\$[\w_]+|[a-zA-Z_]\w*=|--?[a-zA-Z0-9][\w-]*(?:=.*)?|>>|>|#.*|\s+|[^\s]+)/g,o=n=>{if(/^\$\([^)]*\)$/.test(n)){const i=n.slice(2,-1);return[{text:"$(",type:"operator"},...Re(i),{text:")",type:"operator"}]}if(/^".*"$/.test(n)){const i=n.slice(1,-1),u=[];let c=0;const x=/\$[\w_]+/g;let f;for(;(f=x.exec(i))!==null;)f.index>c&&u.push({text:i.slice(c,f.index),type:"string"}),u.push({text:f[0],type:"variable"}),c=f.index+f[0].length;return c<i.length&&u.push({text:i.slice(c),type:"string"}),[{text:'"',type:"string"},...u,{text:'"',type:"string"}]}return/^'.*'$/.test(n)?[{text:n,type:"string"}]:/^\$[\w_]+$/.test(n)?[{text:n,type:"variable"}]:/^[a-zA-Z_]\w*=$/.test(n)?[{text:n,type:"variable"}]:/^--?[a-zA-Z0-9][\w-]*(=.*)?$/.test(n)?[{text:n,type:"option"}]:/^>>|>$/.test(n)?[{text:n,type:"operator"}]:/^#.*$/.test(n)?[{text:n,type:"comment"}]:/^\s+$/.test(n)?[{text:n,type:"plain"}]:Pt.has(n)?[{text:n,type:"keyword"}]:Kt.has(n)?[{text:n,type:"runner"}]:[{text:n,type:"command"}]};let s;for(;(s=t.exec(r))!==null;)a.push(...o(s[0]));return a}function Zt(r,a=!1){const t=[];let o=a;if(r.trim()==="")return t.push({text:" ",type:"plain"}),{tokens:t,inComment:o};let s="selector",n=0;r.match(/^\s+/)&&r.includes(":")&&!r.includes("{")&&(s="property",n=1);const i=/(\/\*[\s\S]*?\*\/|\/\*[\s\S]*$|\*\/)|(@[a-zA-Z-]+)|(\{|\}|:|;|,|\(|\))|("(?:[^"]*)"|'(?:[^']*)')|([a-zA-Z-]+)(?=\()|([0-9.]+(?:px|rem|em|%|vh|vw|deg|s|ms|fr)?)|(#[a-fA-F0-9]{3,8})|([a-zA-Z0-9_-]+|[.#][a-zA-Z0-9_-]+)|(\s+)|(\S+)/g;let u;for(;u=i.exec(r);){const[,c,x,f,d,h,m,y,v,b,C]=u;if(c)c.includes("/*")&&!c.includes("*/")?o=!0:c.includes("*/")&&(o=!1),t.push({text:c,type:"comment"});else if(o)u[0].includes("*/")&&(o=!1),t.push({text:u[0],type:"comment"});else if(x)t.push({text:x,type:"atRule"});else if(h)t.push({text:h,type:"function"});else if(f)f==="{"?(n++,s="property"):f==="}"?(n--,s=n>0?"property":"selector"):f===":"?s==="property"&&(s="value"):f===";"?n>0&&(s="property"):f===","&&n===0&&(s="selector"),t.push({text:f,type:"punctuation"});else if(d)t.push({text:d,type:"string"});else if(m)t.push({text:m,type:"number"});else if(y)t.push({text:y,type:"value"});else if(v){let p;v.startsWith(".")||v.startsWith("#")||s==="selector"?p="selector":s==="property"?p="property":p="value",t.push({text:v,type:p})}else if(b)t.push({text:b.replace(/ /g," "),type:"plain"});else if(C){const p=s==="value"?"value":"plain";t.push({text:C,type:p})}}return{tokens:t,inComment:o}}function Qt(r){const a=/("[^"]*")\s*(:)|("[^"]*")|(\d+)|(true|false|null)|(\{|\}|\[|\]|,)/g,t=[];let o=0,s;for(;(s=a.exec(r))!==null;)s.index>o&&t.push({text:r.slice(o,s.index),type:"plain"}),s[1]&&s[2]?(t.push({text:s[1],type:"key"}),t.push({text:s[2],type:"punctuation"})):s[3]?t.push({text:s[3],type:"string"}):s[4]?t.push({text:s[4],type:"number"}):s[5]?t.push({text:s[5],type:"boolean"}):s[6]&&t.push({text:s[6],type:"punctuation"}),o=a.lastIndex;return o<r.length&&t.push({text:r.slice(o),type:"plain"}),t}function me(r,a=!1,t=0,o=!1){const s=[];let n=r,i=a,u=t;if(o){const c=Yt(n);return s.push(...c.tokens),s}for(;n.length>0;){const c=n.match(/^\/\*[\s\S]*?\*\//);if(c){s.push({text:c[0],type:"comment"}),n=n.slice(c[0].length);continue}const x=n.match(/^\/\/.*$/m);if(x){s.push({text:x[0],type:"comment"}),n=n.slice(x[0].length);continue}if(n.match(/^`/)){const F=Ht(n);s.push(...F.tokens),n=n.slice(F.consumed);continue}const d=n.match(/^("[^"]*"|'[^']*')/);if(d){s.push({text:d[0],type:"string"}),n=n.slice(d[0].length);continue}const h=n.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);if(h){s.push({text:"<",type:"jsx-bracket"}),s.push({text:h[1],type:"jsx-tag"}),n=n.slice(h[0].length),i=!0;continue}const m=n.match(/^<\/([a-zA-Z][a-zA-Z0-9]*)>/);if(m){s.push({text:"</",type:"jsx-bracket"}),s.push({text:m[1],type:"jsx-tag"}),s.push({text:">",type:"jsx-bracket"}),n=n.slice(m[0].length),i=!1;continue}if(n.match(/^\/?>/)){const F=n.match(/^(\/?>\s*)/);if(F){s.push({text:F[1].trim(),type:"jsx-bracket"}),n=n.slice(F[1].length),F[1].includes(">")&&(i=!1);continue}}const y=n.match(/^([a-zA-Z][a-zA-Z0-9]*)(\s*)(=)/);if(y&&i&&u===0){s.push({text:y[1],type:"jsx-attribute"}),y[2]&&s.push({text:y[2],type:"plain"}),s.push({text:"=",type:"plain"}),n=n.slice(y[0].length);continue}const v=n.match(/^[{}]/);if(v){s.push({text:v[0],type:"jsx-brace"}),v[0]==="{"?u++:v[0]==="}"&&u--,n=n.slice(1);continue}const b=n.match(/^\s+/);if(b){s.push({text:b[0],type:"plain"}),n=n.slice(b[0].length);continue}const C=n.match(/^(=>|===|!==|==|!=|<=|>=|&&|\|\||[+\-*/%=<>!&|^~?:;,()[\]{}.])/);if(C){s.push({text:C[0],type:"operator"}),n=n.slice(C[0].length);continue}const p=n.match(/^(const|let|var|function|if|else|for|while|return|import|export|class|extends|interface|type|enum|async|await|public|private|protected|static|from|as|default|new|this|super|try|catch|finally|throw|break|continue|switch|case|typeof|instanceof)\b/);if(p){s.push({text:p[0],type:"keyword"}),n=n.slice(p[0].length);continue}const g=n.match(/^(use[A-Z][a-zA-Z]*)\b/);if(g){s.push({text:g[0],type:"hook"}),n=n.slice(g[0].length);continue}const j=n.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?=(\?\.)?\()/);if(j){s.push({text:j[1],type:"function"}),n=n.slice(j[1].length);continue}const E=n.match(/^(string|number|boolean|object|any|void|never|unknown|null|undefined|Promise|Array|React\.FC|FC|JSX\.Element|HTMLElement|Event|MouseEvent|KeyboardEvent|ChangeEvent)\b/);if(E){s.push({text:E[0],type:"type"}),n=n.slice(E[0].length);continue}const z=n.match(/^(\d+\.?\d*)/);if(z){s.push({text:z[0],type:"number"}),n=n.slice(z[0].length);continue}const k=n.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?=:)/);if(k&&!i){s.push({text:k[1],type:"property"}),n=n.slice(k[1].length);continue}s.push({text:n[0],type:"plain"}),n=n.slice(1)}return s}function Ut(r){const a=[];if(r.trim()==="")return a.push({text:" ",type:"plain"}),a;const t=r,o=t.match(/^(#{1,6})\s*(.*)$/);if(o)return a.push({text:o[1],type:"heading-hash"}),o[2]&&(a.push({text:" ",type:"plain"}),a.push({text:o[2],type:"heading"})),a;const s=t.match(/^(>\s*)(.*)$/);if(s)return a.push({text:s[1],type:"blockquote-marker"}),s[2]&&a.push({text:s[2],type:"blockquote"}),a;const n=t.match(/^(\s*)([-*+]|\d+\.)\s*(.*)$/);if(n)return n[1]&&a.push({text:n[1],type:"plain"}),a.push({text:n[2],type:"list-marker"}),a.push({text:" ",type:"plain"}),n[3]&&Ne(n[3],a),a;const i=t.match(/^(```)\s*(.*)$/);return i?(a.push({text:i[1],type:"code-block-marker"}),i[2]&&(a.push({text:" ",type:"plain"}),a.push({text:i[2],type:"code-block"})),a):(Ne(t,a),a)}function Ne(r,a){let t=r;for(;t.length>0;){const o=t.match(/^(\[)([^\]]*?)(\])(\()([^)]*?)(\))/);if(o){a.push({text:o[1],type:"link-bracket"}),a.push({text:o[2],type:"link-text"}),a.push({text:o[3],type:"link-bracket"}),a.push({text:o[4],type:"link-paren"}),a.push({text:o[5],type:"link-url"}),a.push({text:o[6],type:"link-paren"}),t=t.slice(o[0].length);continue}const s=t.match(/^(`+)([^`]*?)\1/);if(s){a.push({text:s[1],type:"code-marker"}),a.push({text:s[2],type:"code"}),a.push({text:s[1],type:"code-marker"}),t=t.slice(s[0].length);continue}const n=t.match(/^(\*\*|__)([^*_]*?)\1/);if(n){a.push({text:n[1],type:"bold-marker"}),a.push({text:n[2],type:"bold"}),a.push({text:n[1],type:"bold-marker"}),t=t.slice(n[0].length);continue}const i=t.match(/^(\*|_)([^*_]*?)\1/);if(i){a.push({text:i[1],type:"italic-marker"}),a.push({text:i[2],type:"italic"}),a.push({text:i[1],type:"italic-marker"}),t=t.slice(i[0].length);continue}a.push({text:t[0],type:"plain"}),t=t.slice(1)}}function Xt(r,a){const t={...Vt,...a};return r.map((o,s)=>{const n=Re(o);return e.jsx("div",{className:"leading-6",children:n.map((i,u)=>e.jsx("span",{className:t[i.type]||"text-gray-100",children:i.text},u))},s)})}function Jt(r,a){const t={...Gt,...a};let o=!1;return r.map((s,n)=>{const{tokens:i,inComment:u}=Zt(s,o);return o=u,e.jsx("div",{className:"leading-6",children:i.map((c,x)=>e.jsx("span",{className:t[c.type]||"text-gray-100",children:c.text},x))},n)})}function Ot(r,a){const t={...Wt,...a};return r.map((o,s)=>e.jsx("div",{className:"leading-6",children:Qt(o).map((n,i)=>e.jsx("span",{className:t[n.type]||"text-gray-100",children:n.text},i))},s))}function er(r,a){const t={...qt,...a};let o=!1,s=0,n=!1;return r.map((i,u)=>{if(i.trim()==="")return e.jsx("div",{className:"leading-6",children:" "},u);const c=me(i,o,s,n);(i.match(/`/g)||[]).length%2===1&&(n=!n),i.includes("<")&&i.match(/<[a-zA-Z]/)&&(o=!0),i.includes(">")&&!i.includes("<")&&(o=!1,s=0);const f=(i.match(/\{/g)||[]).length,d=(i.match(/\}/g)||[]).length;return s+=f-d,s<0&&(s=0),e.jsx("div",{className:"leading-6",children:c.map((h,m)=>e.jsx("span",{className:t[h.type]||"text-gray-100",children:h.text},m))},u)})}function tr(r,a){const t={..._t,...a};return r.map((o,s)=>e.jsx("div",{className:"leading-6",children:Ut(o).map((n,i)=>e.jsx("span",{className:t[n.type]||"text-gray-100",children:n.text},i))},s))}function rr(r){const[a,t]=l.useState(!1),o=l.useCallback(async()=>{try{await navigator.clipboard.writeText(r),t(!0),setTimeout(()=>t(!1),3e3)}catch(s){console.error("Failed to copy code:",s)}},[r]);return{copied:a,handleCopy:o}}function sr(r,a){const t=l.useRef(null),o=l.useRef(null);return l.useEffect(()=>{if(r){t.current=document.activeElement,document.body.style.overflow="hidden",setTimeout(()=>{var n;(n=o.current)==null||n.focus()},100);const s=n=>{n.key==="Escape"&&a(!1)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),document.body.style.overflow=""}}else t.current&&(t.current.focus(),t.current=null)},[r,a]),{containerRef:o}}function nr(r,a,t,o){return{handleKeyDown:l.useCallback(n=>{n.key==="c"&&(n.metaKey||n.ctrlKey)&&r?(n.preventDefault(),t()):n.key==="f"&&a&&(n.preventDefault(),o())},[r,a,t,o])}}function ar(r){switch(r){case"typescript":case"ts":return"ts";case"tsx":return"tsx";case"json":return"json";case"bash":case"sh":return"sh";case"css":return"css";case"markdown":case"md":return"md";default:return"txt"}}function or({code:r,language:a="typescript",allowCopy:t=!0,allowDownload:o=!1,allowFullscreen:s=!1,filename:n,showTrafficLights:i=!0,showLineNumbers:u=!1,hideHeader:c=!1,hideFiletype:x=!1,maxHeight:f,tokenClasses:d,className:h,id:m,ref:y,...v}){const[b,C]=l.useState(!1),{containerRef:p}=sr(b,C),{copied:g,handleCopy:j}=rr(r),E=l.useCallback(()=>{const I=n||`code.${ar(a)}`;Me.downloadFile(r,I)},[r,n,a]),z=l.useCallback(()=>{C(I=>!I)},[]),{handleKeyDown:k}=nr(t,s,j,z),F=l.useMemo(()=>r.split(`
|
|
2
|
-
`),[r]),N=l.useCallback((I=!0)=>e.jsxs("div",{className:w.join("flex items-center space-x-2",!I&&"absolute top-2 right-2 z-10"),children:[!x&&e.jsx("span",{className:"text-xs text-gray-400 uppercase tracking-wide font-medium","aria-label":`Code language: ${a}`,children:a}),s&&e.jsx("button",{onClick:z,className:"p-1.5 leading-0 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors motion-reduce:transition-none min-h-[44px] min-w-[44px] flex items-center justify-center md:min-h-auto md:min-w-auto md:p-1.5",title:b?"Exit fullscreen":"Fullscreen","aria-label":b?"Exit fullscreen mode":"Enter fullscreen mode","aria-pressed":b,type:"button",children:b?e.jsx(L.Dash,{size:14}):e.jsx(L.Window,{size:14})}),o&&e.jsx("button",{onClick:E,className:"p-1.5 leading-0 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors motion-reduce:transition-none min-h-[44px] min-w-[44px] flex items-center justify-center md:min-h-auto md:min-w-auto md:p-1.5",title:"Download code","aria-label":"Download code as file",type:"button",children:e.jsx(L.Download,{size:14})}),t&&e.jsx("button",{onClick:j,className:"p-1.5 leading-0 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors motion-reduce:transition-none min-h-[44px] min-w-[44px] flex items-center justify-center md:min-h-auto md:min-w-auto md:p-1.5",title:g?"Code copied!":"Copy code","aria-label":g?"Code copied to clipboard":"Copy code to clipboard","aria-live":"polite",type:"button",children:g?e.jsx(L.Check,{size:14,className:"text-green-400"}):e.jsx(L.Copy,{size:14})})]}),[x,a,s,b,o,E,t,j,g,z]),D=l.useMemo(()=>a==="json"?Ot(F,d):a==="tsx"||a==="ts"||a==="typescript"?er(F,d):a==="bash"||a==="sh"?Xt(F,d):a==="css"?Jt(F,d):a==="markdown"||a==="md"?tr(F,d):[e.jsx("span",{className:"text-gray-400",children:"Unsupported language"},0)],[F,d,a]),A=l.useMemo(()=>u?F.map((I,R)=>e.jsx("div",{className:"text-gray-500 text-right pl-3 pr-1 select-none min-w-8 text-sm font-mono leading-6","aria-hidden":"true",role:"presentation",children:R+1},R)):null,[u,F]),M=l.useMemo(()=>({maxHeight:f&&!b?`${f}px`:b?c?"calc(100vh - 5px)":"calc(100vh - 45px)":void 0,overflow:f||b?"auto":"visible"}),[f,b,c]),$=e.jsxs("div",{id:m,ref:I=>{p.current=I,typeof y=="function"?y(I):y&&(y.current=I)},className:w.join("bg-gray-900 rounded-lg border border-gray-700 overflow-hidden motion-reduce:transition-none",b&&"fixed inset-0 z-[9999] max-h-fit",h),"data-language":a,"data-filename":n,"data-fullscreen":b,role:"region","aria-label":`Code block${n?` for ${n}`:""} in ${a}`,"aria-describedby":u?`${m}-description`:void 0,tabIndex:0,onKeyDown:k,...v,children:[u&&e.jsxs("div",{id:`${m}-description`,className:"sr-only",children:["Code block with line numbers. Use Cmd+C or Ctrl+C to copy code.",s&&" Press F to toggle fullscreen."]}),e.jsx("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:g&&"Code copied to clipboard"}),!c&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[i&&e.jsxs("div",{className:"flex space-x-2",children:[e.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full"}),e.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded-full"}),e.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full"})]}),n&&e.jsx("span",{className:"text-sm text-gray-300 font-medium",children:n})]}),N(!0)]}),e.jsxs("div",{className:w.join("flex overflow-hidden",c&&"relative"),style:M,children:[c&&N(!1),e.jsx("div",{className:"flex-1 overflow-x-auto",children:e.jsxs("div",{className:"flex",children:[u&&e.jsx("div",{className:"bg-gray-800 py-4 border-r border-gray-700 flex flex-col flex-shrink-0","aria-hidden":"true",role:"presentation",children:A}),e.jsx("div",{className:"flex-1 p-4",children:e.jsx("pre",{className:"text-sm font-mono focus:outline-none",role:"code","aria-label":`${a} code content`,tabIndex:-1,children:e.jsx("code",{children:D})})})]})})]})]});return e.jsxs(e.Fragment,{children:[!b&&$,b&&pe.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black z-[9998]",onClick:()=>C(!1),"aria-hidden":"true"}),$]}),document.body)]})}function lr({children:r,label:a,isOpen:t,onToggle:o,id:s,ref:n,disabled:i=!1,className:u,buttonClassName:c}){const x=l.useId(),f=s??x,[d,h]=l.useState(!1),m=t!==void 0?t:d,y=()=>{i||(t===void 0&&h(v=>!v),o==null||o(!m))};return l.useEffect(()=>{h(t??!1)},[t]),e.jsxs("div",{ref:n,id:f,"data-open":m,className:w.join("overflow-hidden",u),children:[e.jsx("button",{id:`${f}-button`,type:"button","aria-expanded":m,"aria-controls":`${f}-panel`,disabled:i,tabIndex:0,className:w.join("w-full px-4 py-3 font-medium hover:bg-primary/10 disabled:opacity-50 disabled:cursor-not-allowed",c),onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),y())},"data-open":m,"data-label":typeof a=="string"?a:void 0,children:e.jsxs("div",{className:"flex items-center w-full gap-2",children:[e.jsx("span",{className:"flex-1 text-left",children:a}),m?e.jsx(L.CaretCollapse,{className:"size-5","aria-hidden":"true"}):e.jsx(L.CaretExpand,{className:"size-5","aria-hidden":"true"})]})}),e.jsx("div",{id:`${f}-panel`,role:"region","aria-labelledby":f,"aria-live":"polite",hidden:!m,children:r})]})}function ir(r){const[a,t]=l.useState(!1),[o,s]=l.useState(!1);return l.useEffect(()=>{if(r){s(!0);const n=setTimeout(()=>t(!0),10);return()=>clearTimeout(n)}else{t(!1);const n=setTimeout(()=>s(!1),300);return()=>clearTimeout(n)}},[r]),{show:a,shouldRender:o}}function cr({isOpen:r,onClose:a,enabled:t=!0}){const[o,s]=l.useState(!1),[n,i]=l.useState(0),[u,c]=l.useState(0),x=l.useCallback(j=>{!t||!r||(s(!0),c(j),document.body.style.userSelect="none")},[t,r]),f=l.useCallback(j=>{if(!o||!t)return;const E=j-u,z=Math.max(0,E);i(z)},[o,t,u]),d=l.useCallback(()=>{if(!o||!t)return;s(!1),document.body.style.userSelect="",n>100&&a(),i(0)},[o,t,n,a]),h=l.useCallback(j=>{j.preventDefault(),x(j.clientY)},[x]),m=l.useCallback(j=>{f(j.clientY)},[f]),y=l.useCallback(()=>{d()},[d]),v=l.useCallback(j=>{j.preventDefault(),x(j.touches[0].clientY)},[x]),b=l.useCallback(j=>{j.preventDefault(),f(j.touches[0].clientY)},[f]),C=l.useCallback(()=>{d()},[d]);l.useEffect(()=>{if(o)return document.addEventListener("mousemove",m),document.addEventListener("mouseup",y),document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("touchend",C),()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",y),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",C)}},[o,m,y,b,C]);const p=l.useCallback(j=>{t&&(j.key==="ArrowDown"||j.key==="Escape")&&(j.preventDefault(),a())},[t,a]);return{dragHandlers:t?{onMouseDown:h,onTouchStart:v,onKeyDown:p}:{},translateY:n,isDragging:o}}function dr(r,a){const t=l.useRef(null);l.useEffect(()=>{if(!a)return;t.current=document.activeElement;const o=document.getElementById(r);o&&o.focus();const s=n=>{if(n.key!=="Tab")return;const i=document.getElementById(r);if(!i)return;const u=i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),c=u[0],x=u[u.length-1];n.shiftKey&&document.activeElement===c?(n.preventDefault(),x==null||x.focus()):!n.shiftKey&&document.activeElement===x&&(n.preventDefault(),c==null||c.focus())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),t.current&&typeof t.current.focus=="function"&&t.current.focus()}},[r,a])}function ur(r,a){l.useEffect(()=>{if(!r)return;const t=window.getComputedStyle(document.body).overflow;document.body.style.overflow="hidden";const o=s=>{s.key==="Escape"&&a()};return document.addEventListener("keydown",o),()=>{document.body.style.overflow=t,document.removeEventListener("keydown",o)}},[r,a])}function fr({ref:r,id:a,isOpen:t,onClose:o,title:s,children:n,footer:i,className:u,overlayClassName:c,showCloseButton:x=!1,disableCloseOnOverlayClick:f=!1,enableDragGestures:d=!0,ariaLabelledBy:h,ariaDescribedBy:m}){const y=l.useId(),v=a||`drawer-${y}`,b=`${y}-title`,{show:C,shouldRender:p}=ir(t),{dragHandlers:g,translateY:j,isDragging:E}=cr({isOpen:t,onClose:o,enabled:d});if(dr(v,p),ur(p,o),!p)return null;const z=()=>s?l.isValidElement(s)?e.jsx("div",{children:s}):e.jsx("h2",{className:"text-2xl font-semibold",id:b,children:s}):null,k=()=>{if(!i)return null;if(l.isValidElement(i)){const F=i,N=F.props.className||"";return l.cloneElement(F,{className:w.join("px-6 py-4",N)})}return e.jsx("div",{className:"px-6 py-4",children:i})};return e.jsx(e.Fragment,{children:pe.createPortal(e.jsxs("div",{"aria-labelledby":h??s?b:void 0,"aria-describedby":m,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-hidden","data-drawer-open":t,children:[e.jsx("div",{className:w.join("fixed inset-0 bg-black/40 transition-opacity",C?"opacity-100":"opacity-0",c),onClick:()=>{f||o()}}),e.jsx("div",{className:"fixed inset-x-0 bottom-0 flex max-h-full",children:e.jsx("div",{id:v,ref:r,tabIndex:-1,className:w.join("relative w-screen transform shadow-xl bg-popover text-popover-foreground transition-transform ease-in-out border-t border-border rounded-t-lg",C?"translate-y-0":"translate-y-full",u),style:{transform:d&&j!==0?`translateY(${j}px)`:void 0,transition:j!==0?"none":void 0},children:e.jsxs("div",{className:"flex h-full flex-col",children:[d&&e.jsx("div",{className:w.join("flex justify-center pt-3 pb-2 cursor-grab active:cursor-grabbing",d&&"select-none"),...g,role:d?"button":void 0,tabIndex:d?0:void 0,"aria-label":d?"Drag to resize drawer":void 0,children:e.jsx("div",{className:w.join("w-12 h-1.5 bg-popover-foreground/25 rounded-full transition-colors",d&&"hover:bg-popover-foreground/50",E&&"bg-popover-foreground/50")})}),s&&e.jsx("div",{className:"px-6 pt-4",children:z()}),x&&e.jsx("button",{type:"button",onClick:o,"data-drawer-close-button":"true","aria-label":"Close drawer",className:"rounded-md p-0.5 top-3 right-3 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:e.jsx(ee.X,{size:18})}),e.jsx("div",{className:w.join("flex-1 overflow-y-auto px-6 pb-6",s?"pt-6":"pt-4"),children:n}),k()]})})})]}),document.body)})}function xr(r){switch(r){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}function mr({internalIsOpen:r,autoSwitchPlacement:a,placement:t,offset:o,triggerRef:s,popoverRef:n}){const[i,u]=l.useState(t);return l.useEffect(()=>{if(!r||!a)return;const c=()=>{if(!s.current||!n.current)return;const d=s.current.getBoundingClientRect(),h=n.current.getBoundingClientRect(),m=window.innerWidth,y=window.innerHeight;let v=t;const b=xr(t);if(t==="top"||t==="bottom"){const C=t==="top"?d.top>=h.height+o:y-d.bottom>=h.height+o,p=b==="top"?d.top>=h.height+o:y-d.bottom>=h.height+o;!C&&p&&(v=b)}else{const C=t==="left"?d.left>=h.width+o:m-d.right>=h.width+o,p=b==="left"?d.left>=h.width+o:m-d.right>=h.width+o;!C&&p&&(v=b)}u(v)};c();const x=()=>c();window.addEventListener("scroll",x,!0),window.addEventListener("resize",x);const f=new ResizeObserver(c);return s.current&&f.observe(s.current),n.current&&f.observe(n.current),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x),f.disconnect()}},[r,t,o,a,s,n]),i}const hr={bottom:{start:"top-full left-0 origin-top-left",center:"top-full left-1/2 -translate-x-1/2 origin-top",end:"top-full right-0 origin-top-right"},top:{start:"bottom-full left-0 origin-bottom-left",center:"bottom-full left-1/2 -translate-x-1/2 origin-bottom",end:"bottom-full right-0 origin-bottom-right"},left:{start:"right-full top-0 origin-top-right",center:"right-full top-1/2 -translate-y-1/2 origin-right",end:"right-full bottom-0 origin-bottom-right"},right:{start:"left-full top-0 origin-top-left",center:"left-full top-1/2 -translate-y-1/2 origin-left",end:"left-full bottom-0 origin-bottom-left"}};function pr(r,a){switch(r){case"top":return{marginBottom:`${a}px`};case"bottom":return{marginTop:`${a}px`};case"left":return{marginRight:`${a}px`};case"right":return{marginLeft:`${a}px`};default:return{}}}function Be({id:r,ref:a,isOpen:t,onOpenChange:o,children:s,className:n,closeOnOverlayClick:i=!0,trigger:u,placement:c="bottom",alignment:x="center",closeOnTriggerClick:f=!0,offset:d=8,autoSwitchPlacement:h=!0,hoverable:m=!1}){const[y,v]=l.useState(t??!1),b=l.useRef(null),C=l.useRef(null),p=l.useRef(null),g=l.useId(),j=l.useRef(null),E=mr({internalIsOpen:y,autoSwitchPlacement:h,placement:c,offset:d,triggerRef:C,popoverRef:b}),z=l.useCallback(M=>{o&&o(M),t===void 0&&v(M)},[t,o]),k=l.useCallback(()=>{j.current&&(clearTimeout(j.current),j.current=null)},[]),F=l.useCallback(()=>{m&&(k(),z(!0))},[m,k,z]),N=l.useCallback(()=>{m&&(k(),j.current=setTimeout(()=>{z(!1)},200))},[m,k,z]);l.useEffect(()=>{t!==void 0&&v(t)},[t]),l.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]),l.useEffect(()=>{if(!y)return;const M=$=>{$.key==="Escape"&&z(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[y,z]),l.useEffect(()=>{if(!y||!i)return;const M=$=>{const I=$.target;b.current&&!b.current.contains(I)&&C.current&&!C.current.contains(I)&&z(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[y,i,z]),l.useEffect(()=>{var M,$;y?(p.current=document.activeElement,(M=b.current)==null||M.focus()):(($=p.current)==null||$.focus(),p.current=null)},[y]);const D=u.props,A=l.cloneElement(u,{"aria-expanded":y,"aria-haspopup":"dialog","aria-controls":g,ref:Me.mergeRefs(C,D.ref),onClick:M=>{var $,I;if(($=D.onClick)==null||$.call(D,M),!m&&!(!f&&y)&&t===void 0){if(M.defaultPrevented||(I=b.current)!=null&&I.contains(M.target))return;z(!y)}},onMouseEnter:M=>{var $;($=D.onMouseEnter)==null||$.call(D,M),F()},onMouseLeave:M=>{var $;($=D.onMouseLeave)==null||$.call(D,M),N()}});return e.jsxs("div",{id:r,ref:a,className:"relative inline-block",children:[A,e.jsx("div",{id:g,ref:b,className:w.join("absolute z-[90] transform rounded-md shadow-lg bg-popover text-popover-foreground transition-all ease-out",y?"opacity-100 scale-100":"opacity-0 scale-75 pointer-events-none",hr[E][x],n),style:pr(E,d),role:"dialog","aria-modal":"true",tabIndex:-1,inert:y?void 0:!0,"aria-hidden":y?void 0:!0,onMouseEnter:m?F:void 0,onMouseLeave:m?N:void 0,children:s})]})}function Le({option:r,...a}){const{onItemSelect:t}=V.useDropdownMenuContext(),o=()=>{r.onClick&&r.onClick(),r.value&&t(r.value)},s=r.subItems&&r.subItems.length>0,n=r.href&&!r.disabled,i=n?"a":"div";return e.jsxs(i,{href:n?r.href:void 0,className:w.join("relative flex items-center gap-2 px-3 py-2 text-sm focus:outline-none focus:bg-popover-foreground/10",r.disabled?"opacity-50 cursor-default":"cursor-pointer"),onClick:r.disabled?void 0:o,...a,children:[r.icon&&e.jsx("span",{className:"size-4",children:r.icon}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{children:r.label}),r.description&&e.jsx("div",{className:"text-xs text-popover-foreground/60",children:r.description})]}),r.keyboardShortcut&&e.jsx("div",{className:"text-xs text-popover-foreground/60",children:r.keyboardShortcut}),s&&e.jsx(L.ChevronRight,{className:"size-4"})]})}function br({option:r,level:a,index:t}){const{focus:o,setFocus:s}=V.useDropdownMenuContext(),[n,i]=l.useState(!1),[u,c]=l.useState(!1),x=l.useRef(null),f=l.useRef(void 0),d=l.useId(),h=()=>{r.disabled||(s({level:a,index:t}),y())},m=()=>{s(null),v()},y=()=>{i(!0)},v=()=>{i(!1)},b=g=>{if(g.key==="ArrowRight"){if(g.preventDefault(),r.disabled)return;c(!1)}};l.useEffect(()=>{const g=o==null?void 0:o.level,j=f.current,E=a+1;g&&j&&j===E&&g===j-1?c(!0):c(!1),f.current=g},[o,a]);const C=r.subItems!==void 0&&r.subItems.length>0,p=n&&!u&&C;return e.jsxs("div",{ref:x,className:"relative focus:outline-none focus:bg-popover-foreground/10",onMouseEnter:h,onMouseLeave:m,onFocus:y,onBlur:v,onKeyDown:b,tabIndex:0,"data-menu-item":r.value,"data-level":a,"data-index":t,"aria-haspopup":C?"true":void 0,"aria-expanded":p?"true":"false","aria-disabled":r.disabled?"true":void 0,"aria-label":r.label,"aria-controls":p?d:void 0,children:[e.jsx(Le,{option:r}),p&&e.jsx("div",{className:"absolute left-full top-0 z-30",children:e.jsx(Ve,{items:r.subItems??[],level:a+1,id:d})})]})}function Ve({items:r,level:a,id:t}){const{setFocus:o,className:s=""}=V.useDropdownMenuContext();let n=0;const i=(u,c)=>{switch(u.__type){case"option":return u.subItems&&u.subItems.length>0?e.jsx(br,{option:u,level:a,index:n++},c):e.jsx(Le,{option:u,"data-menu-item":u.value,"data-level":a,"data-index":n++,tabIndex:-1,"aria-disabled":u.disabled?"true":void 0,onMouseEnter:x=>{if(x.preventDefault(),u.disabled)return;const f=Number(x.currentTarget.getAttribute("data-index"));o({level:a,index:f})},onMouseLeave:x=>{x.preventDefault(),o(null)}},c);case"group":return e.jsxs("div",{children:[u.title&&e.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-popover-foreground/50 uppercase",children:u.title}),u.items.map((x,f)=>i(x,`${c}-${f}`))]},c);case"separator":return e.jsx("div",{"aria-hidden":!0,className:"my-1 mx-2 border-t border-popover-foreground/20"},c);case"custom":return e.jsx("div",{children:u.render()},c);default:return null}};return e.jsx("div",{id:t,className:w.join("border py-1 border-popover-foreground/20 rounded-md min-w-52 shadow-lg bg-popover text-popover-foreground",s),tabIndex:0,"data-level":a,"data-menu":!0,role:"menu","aria-label":`Dropdown menu level ${a}`,children:r.map((u,c)=>i(u,String(c)))})}function gr(r,a){return Array.from(r.querySelectorAll(`[data-menu-item][data-level="${a}"]`))}function yr(r,a){const t=a===null?0:(a+1)%r.length;for(let o=0;o<r.length;o++){const s=(t+o)%r.length;if(!r[s].hasAttribute("aria-disabled"))return s}return-1}function vr(r,a){const t=a===null?r.length-1:(a-1+r.length)%r.length;for(let o=0;o<r.length;o++){const s=(t-o+r.length)%r.length;if(!r[s].hasAttribute("aria-disabled"))return s}return-1}function jr({dropdownId:r,focus:a,setFocus:t,isOpen:o,onClose:s}){const n=l.useCallback(i=>{var d;if(!o)return;const{level:u,index:c}=a||{level:1,index:null},x=document.querySelector(`#${r} [data-menu][data-level="${u}"]`);if(!x)return;const f=gr(x,u);if(f.length!==0)switch(i.key){case"ArrowDown":{i.preventDefault();const h=yr(f,c);if(h===-1)return;t({level:u,index:h});break}case"ArrowUp":{i.preventDefault();const h=vr(f,c);if(h===-1)return;t({level:u,index:h});break}case"ArrowRight":{if(i.preventDefault(),c!==null){const m=f[c].querySelector("[data-menu]");m&&m.querySelector("[data-menu-item]")&&t({level:u+1,index:0})}break}case"ArrowLeft":{i.preventDefault();const h=(d=x.parentElement)==null?void 0:d.closest("[data-menu-item]");if(!h){console.error(`No parent menu found leaving menu level ${u}`);return}const m=h.getAttribute("data-index")?Number(h.getAttribute("data-index")):-1;h&&t({level:u-1,index:m===-1?0:m});break}case"Enter":{if(i.preventDefault(),c!==null){const h=f[c];h==null||h.click(),t(null)}break}case"Escape":{i.preventDefault(),s==null||s(),t(null);break}case"Tab":{s();break}}},[o,a,t,s,r]);return l.useEffect(()=>{if(o)return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[n,o]),{handleKeyDown:n}}function wr(r,a,t){return document.querySelector(`#${r} [data-menu-item][data-level="${a}"][data-index="${t}"]`)}function kr({id:r,items:a,onItemSelect:t,trigger:o,isOpen:s,placement:n="bottom",alignment:i="start",onOpenChange:u,className:c="",...x}){const f=l.useId(),d=r||`dropdown-menu-${f}`,[h,m]=l.useState(null),[y,v]=l.useState(!1),b=s===void 0,C=b?y:s,p=l.useCallback(()=>{m(null),v(!1)},[]),g=l.useCallback(k=>{t&&t(k),p()},[t,p]),j=l.useCallback(k=>{b&&v(k),u&&u(k)},[b,u]),E=l.useMemo(()=>({id:d,focus:h,setFocus:m,isOpen:C,onItemSelect:g,onClose:p,className:c}),[h,m,g,p,c,C,d]);jr({dropdownId:d,focus:h,setFocus:m,isOpen:C,onClose:p});const z=l.useMemo(()=>l.cloneElement(o,{onClick:k=>{b&&v(N=>!N);const F=o.props;F.onClick&&F.onClick(k)}}),[b,v,o]);return l.useEffect(()=>{if(h){const k=wr(d,h.level,h.index);k==null||k.focus()}},[h,d]),e.jsx(Be,{id:d,isOpen:b?y:C,trigger:z,placement:n,alignment:i,onOpenChange:j,className:w.join("min-w-52",c),...x,children:e.jsx(V.DropdownMenuContext.Provider,{value:E,children:e.jsx(Ve,{items:a,level:1})})})}const Cr=r=>({__type:"option",...r}),Nr=(r,a)=>({__type:"group",title:a,items:r}),Dr=()=>({__type:"separator"}),Er=r=>({__type:"custom",render:r}),Sr={option:Cr,group:Nr,separator:Dr,custom:Er};function Fr(r=[]){const[a,t]=l.useState(r),[o,s]=l.useState(null),[n,i]=l.useState(null),u=l.useRef(null),c=l.useCallback((p,g)=>{const j={...g,id:`item-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,content:p};return t(E=>[...E,j]),j},[]),x=l.useCallback(p=>{t(g=>g.filter(j=>j.id!==p))},[]),f=l.useCallback((p,g)=>{p!==g&&t(j=>{const E=[...j],[z]=E.splice(p,1);return E.splice(g,0,z),E})},[]),d=l.useCallback(p=>{p>0&&f(p,p-1)},[f]),h=l.useCallback(p=>{p<a.length-1&&f(p,p+1)},[f,a.length]),m=l.useCallback((p,g)=>{s(p),u.current=g,i(g)},[]),y=l.useCallback((p,g)=>{p.preventDefault(),i(g)},[]),v=l.useCallback(()=>{if(o&&n!==null&&u.current!==null){const p=u.current,g=n;p!==g&&f(p,g)}s(null),i(null),u.current=null},[o,n,f]),b=l.useCallback(p=>{p.preventDefault(),v()},[v]),C=l.useCallback(()=>{if(!o||n===null||u.current===null)return a;const p=u.current,g=n;if(p===g)return a;const j=[...a],[E]=j.splice(p,1);return j.splice(g,0,E),j},[a,o,n,u]);return{items:a,visualItems:C(),addItem:c,deleteItem:x,moveItem:f,moveItemUp:d,moveItemDown:h,draggedItem:o,draggedOverIndex:n,handleDragStart:m,handleDragOver:y,handleDragEnd:v,handleDrop:b}}const Ir={sm:"text-sm",md:"text-base",lg:"text-lg"},Ar={sm:"text-sm gap-2",md:"text-base gap-3",lg:"text-lg gap-4"},$r={sm:14,md:15,lg:16};function De({size:r=8,className:a=""}){return e.jsx("div",{className:`rounded-full flex-shrink-0 bg-current ${a}`,style:{width:r,height:r}})}function Mr({size:r=12,className:a=""}){return e.jsx("div",{className:`flex-shrink-0 bg-current ${a}`,style:{width:r,height:2}})}function zr({items:r=[],size:a="md",id:t,className:o="",ref:s,allowAdd:n=!0,allowDelete:i=!0,allowReorder:u=!0,addPlaceholder:c="Add new item...",onItemsChange:x,renderItem:f,marker:d,itemRenderer:h,showDividers:m=!0,showReorderButtons:y=!0,title:v,truncateText:b=!1}){const[C,p]=l.useState(""),[g,j]=l.useState(null),E=l.useRef(null),z=l.useId(),k=l.useRef(!1),F=l.useRef(r),N=t||`dynamic-list-${z}`,D=`${N}-title`,{items:A,visualItems:M,addItem:$,deleteItem:I,moveItemUp:R,moveItemDown:G,draggedItem:K,draggedOverIndex:U,handleDragStart:T,handleDragOver:_,handleDragEnd:X,handleDrop:te}=Fr(r),re=h||f;l.useEffect(()=>{if(!k.current){k.current=!0;return}F.current!==A&&(F.current=A,x==null||x(A))},[A,x]);const S=W=>document.querySelector(`#${N} #${CSS.escape(W)}`),B=()=>{var W;C.trim()&&($(C.trim()),p(""),(W=E.current)==null||W.focus())},Y=(W,Q)=>{var oe;if(!i)return;W.preventDefault();const J=Q<A.length-1?Q+1:Q-1,ae=A[J];I(A[Q].id),J>=0&&ae?setTimeout(()=>{const O=S(ae.id);O==null||O.focus()},0):((oe=E.current)==null||oe.focus(),j(null))},H=W=>{W.key==="Enter"&&B()},q=(W,Q)=>{switch(W.key){case"ArrowUp":if(!u)return;W.preventDefault(),R(Q),Q>0&&j(Q-1);break;case"ArrowDown":if(!u)return;W.preventDefault(),G(Q),Q<A.length-1&&j(Q+1);break;case"Backspace":case"Delete":Y(W,Q);break}},Z=()=>{if(!v)return null;const W=w.join("font-medium opacity-60",Ir[a]);if(typeof v=="string")return e.jsx("h4",{id:D,className:W,children:v});const Q=v.props;return l.cloneElement(v,{id:D,className:w.join(W,Q.className)})},P=W=>{if(!d)return null;if(l.isValidElement(d))return d;switch(d){case"disc":return e.jsx(De,{className:"text-muted-foreground"});case"dash":return e.jsx(Mr,{className:"text-muted-foreground"});case"decimal":return e.jsxs("span",{className:"text-sm font-medium text-muted-foreground flex-shrink-0 min-w-4 text-right",children:[W+1,"."]});default:return e.jsx(De,{className:"text-muted-foreground"})}},se=Ar[a],ne=$r[a];return e.jsxs("div",{ref:s,id:N,className:o,"data-size":a,"data-allow-add":n,"data-allow-delete":i,"data-allow-reorder":u,"data-marker":typeof d=="string"?d:"custom",children:[Z(),e.jsxs("ul",{className:se,role:"list","aria-labelledby":v?D:void 0,children:[M.map((W,Q)=>{const J=A.findIndex(O=>O.id===W.id),ae=(K==null?void 0:K.id)===W.id,oe=g===J;return e.jsxs("div",{children:[e.jsxs("li",{id:W.id,title:b?W.content:void 0,className:w.join("flex items-center group relative transition-all",ae&&"opacity-30",K&&U===Q&&!ae?"border-t-2 border-primary":""),draggable:u,onDragStart:O=>{O.dataTransfer.effectAllowed="move",T(W,J)},onDragOver:O=>_(O,Q),onDragEnd:X,onDrop:te,onMouseEnter:()=>j(J),onMouseLeave:()=>j(null),onFocus:O=>{O.currentTarget===O.target&&j(J)},tabIndex:0,role:"listitem","aria-label":`List item ${J+1}: ${W.content}`,onKeyDown:O=>q(O,J),"aria-description":`${u?"Use up/down arrow keys to reorder. ":""}${i?"Press Backspace/Delete to remove this item.":""}`,children:[u&&e.jsx("div",{className:w.join("absolute -translate-x-full flex-shrink-0 pl-2 pr-1 py-2 cursor-move transition-opacity opacity-0",(ae||oe&&!K)&&"opacity-100"),children:e.jsx(L.GripVertical,{size:ne+2})}),d&&e.jsx("div",{className:w.join("flex-shrink-0 flex items-center justify-center py-2 pr-2"),children:P(J)}),e.jsxs("div",{className:w.join("flex-1 flex min-w-0"),children:[e.jsx("div",{className:w.join("flex-1 min-w-0 py-2 pr-2"),children:re?re(W,J):e.jsx("span",{className:w.join("block",b&&"truncate"),children:W.content})}),!K&&e.jsxs("div",{className:w.join("flex-shrink-0 flex items-center gap-1 pr-2 opacity-0 transition-opacity",oe&&"opacity-100"),children:[u&&y&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>R(J),disabled:J===0,className:"p-0.5 opacity-50 leading-0 hover:opacity-80 disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors","aria-hidden":!0,tabIndex:-1,children:e.jsx(L.ChevronUp,{size:ne})}),e.jsx("button",{type:"button",onClick:()=>G(J),disabled:J===A.length-1,className:"p-0.5 opacity-50 leading-0 hover:opacity-80 disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors","aria-hidden":!0,tabIndex:-1,children:e.jsx(L.ChevronDown,{size:ne})})]}),i&&e.jsx("button",{tabIndex:oe?0:-1,type:"button",onClick:O=>Y(O,J),className:"p-0.5 text-destructive opacity-70 h-fit hover:opacity-90 rounded transition-colors focus:outline-none focus:ring-2 focus:ring-destructive","aria-label":"Delete item",children:e.jsx(L.Trash,{size:ne})})]})]})]}),m&&Q<A.length-1&&e.jsx("hr",{className:"border-border/50"})]},W.id)}),A.length===0&&e.jsxs("li",{className:w.join("text-center text-muted-foreground py-8",se),children:["No items yet. ",n&&"Add an item below to get started."]})]}),n&&e.jsxs("div",{className:w.join("border-t border-border/50 flex items-center gap-2",se),children:[e.jsx("input",{id:`${N}-new-item-input`,ref:E,type:"text",value:C,onChange:W=>p(W.target.value),onKeyDown:H,placeholder:c,className:"flex-1 bg-transparent border-none outline-none placeholder-muted-foreground pt-1","aria-label":"Add new list item"}),e.jsx("button",{type:"button",onClick:B,disabled:!C.trim(),className:"flex-shrink-0 p-1.5 text-muted-foreground opacity-70 enabled:hover:opacity-100 disabled:opacity-30 disabled:cursor-not-allowed rounded transition-opacity","aria-label":"Add item",children:e.jsx(L.Plus,{size:16})})]})]})}const Tr={danger:{container:"border-destructive bg-destructive/10",icon:"text-destructive",title:"text-destructive",description:"text-destructive/80",button:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-destructive",details:"bg-destructive/5 border-destructive/20 text-destructive"},warning:{container:"border-yellow-600 bg-yellow-600/10",icon:"text-yellow-600",title:"text-yellow-600",description:"text-yellow-600/80",button:"bg-yellow-600 text-white hover:bg-yellow-600/90 focus:ring-yellow-600",details:"bg-yellow-600/5 border-yellow-600/20 text-yellow-600"},info:{container:"border-blue-600 bg-blue-600/10",icon:"text-blue-600",title:"text-blue-600",description:"text-blue-600/80",button:"bg-blue-600 text-white hover:bg-blue-600/90 focus:ring-blue-600",details:"bg-blue-600/5 border-blue-600/20 text-blue-600"}},Rr={danger:e.jsx(ee.ExclamationTriangle,{size:24}),warning:e.jsx(ee.ExclamationTriangle,{size:24}),info:e.jsx(ee.InfoCircled,{size:24})};function Br({id:r,variant:a="danger",showRetry:t=!0,fallbackMessage:o,fallback:s,onRetry:n,onError:i,className:u,children:c,inDevEnv:x=!1}){return e.jsx(Lr,{id:r,variant:a,showRetry:t,fallbackMessage:o,fallback:s,onRetry:n,onError:i,className:u,inDevEnv:x,children:c})}class Lr extends l.Component{constructor(t){super(t);je(this,"handleRetry",()=>{var t,o;this.setState({hasError:!1,error:void 0,errorInfo:void 0}),(o=(t=this.props).onRetry)==null||o.call(t)});this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){var s,n;this.setState({error:t,errorInfo:o}),(n=(s=this.props).onError)==null||n.call(s,t,o),this.props.inDevEnv&&(console.error("ErrorBoundary caught an error:",t),console.error("Error info:",o))}render(){var x;const{id:t,variant:o="danger",showRetry:s=!0,fallbackMessage:n="Something went wrong",fallback:i,className:u,inDevEnv:c}=this.props;if(this.state.hasError){if(i)return i;const f=Tr[o],d=Rr[o];return e.jsxs("div",{id:t,"data-variant":o,"data-has-error":this.state.hasError,className:w.join("rounded-lg border p-6 text-center",f.container,u),role:"alert","aria-live":"assertive",children:[e.jsx("div",{className:w.join("mb-4 flex justify-center",f.icon),children:d}),e.jsx("h3",{className:w.join("text-lg font-semibold mb-2",f.title),children:"Oops! Something went wrong"}),e.jsx("p",{className:w.join("text-sm mb-4",f.description),children:n}),c&&this.state.error&&e.jsxs("details",{className:"mt-4 text-left",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium mb-2",children:"Error Details (Development Only)"}),e.jsxs("div",{className:w.join("rounded border p-3 text-xs font-mono whitespace-pre-wrap overflow-auto max-h-40",f.details),children:[e.jsx("div",{className:"font-bold mb-1",children:"Error:"}),e.jsx("div",{className:"mb-2",children:this.state.error.toString()}),((x=this.state.errorInfo)==null?void 0:x.componentStack)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-bold mb-1",children:"Component Stack:"}),e.jsx("div",{children:this.state.errorInfo.componentStack})]})]})]}),s&&e.jsx("button",{type:"button",onClick:this.handleRetry,className:w.join("inline-flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-colors","focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-transparent",f.button),"aria-label":"Try again",children:"Try Again"})]})}return this.props.children}}const Vr=r=>({__type:"input",...r}),Gr=r=>({__type:"textarea",...r}),Wr=r=>({__type:"select",...r}),_r=r=>({__type:"checkbox",...r}),qr=r=>({__type:"radio",...r}),Pr={input:Vr,textarea:Gr,select:Wr,checkbox:_r,radio:qr};function Kr(r,a){const[t,o]=l.useState({}),s=l.useCallback((f,d)=>{if(f.required&&(!d||typeof d=="string"&&d.trim()===""))return`${f.label} is required`;if(f.isValid&&d){const h=f.isValid,m=h(d);if(!m.valid)return m.message||`${f.label} is invalid`}return null},[]),n=l.useCallback((f=a)=>{const d={};return r.forEach(h=>{const m=s(h,f[h.name]);m&&(d[h.name]=m)}),o(d),Object.keys(d).length===0},[r,a,s]),i=l.useCallback((f,d)=>{const h=r.find(y=>y.name===f);if(!h)return;const m=s(h,d);return o(y=>{const v={...y};return m?v[f]=m:delete v[f],v}),!m},[r,s]),u=l.useCallback(()=>{o({})},[]),c=l.useMemo(()=>Object.values(t).some(f=>f),[t]),x=l.useMemo(()=>r.every(f=>{const d=a[f.name];if(f.required&&(!d||typeof d=="string"&&d.trim()===""))return!1;if(f.isValid&&d){const h=f.isValid;return h(d).valid}return!0})&&!c,[r,a,c]);return{errors:t,hasErrors:c,isFormValid:x,validateForm:n,validateSingleField:i,clearErrors:u}}const ye={spacing:{tight:"gap-3",normal:"gap-4",loose:"gap-6"},columns:{1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"},colSpan:{1:"col-span-1",2:"col-span-1 md:col-span-2",3:"col-span-1 md:col-span-2 lg:col-span-3",4:"col-span-1 md:col-span-2 lg:col-span-4",full:"col-span-full"}},ve={spacing:"normal",columns:1,responsive:!0};function le({display:r="inline",width:a="fit-content",className:t="",required:o,helpMessage:s,suffix:n,htmlFor:i,children:u,description:c,...x}){var v,b;const f=l.useId(),d=(((v=s==null?void 0:s.trim())==null?void 0:v.length)||0)>0,h=(((b=c==null?void 0:c.trim())==null?void 0:b.length)||0)>0,m=d?`${i??f}-help`:void 0,y=h?`${i??f}-description`:void 0;return e.jsxs("div",{style:{display:r==="inline"?"inline-block":"block",width:a},className:w.join("mb-0.5",t),children:[e.jsxs("div",{className:"relative flex",children:[e.jsxs("label",{className:"font-medium",htmlFor:i,...x,children:[u,o&&e.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),d&&e.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":m,"aria-label":"Help information",title:s,children:e.jsx(L.QuestionMarkCircled,{})}),d&&e.jsx("div",{id:m,className:"sr-only",children:s}),n&&e.jsx("span",{className:"ml-1",children:n})]}),h&&e.jsx("small",{id:y,className:"block opacity-80 mt-0.5",role:"note",children:c})]})}function he({elementId:r,type:a,message:t}){return l.useEffect(()=>{const o=document.getElementById(r);if(o){if(!t&&a==="error"){o.removeAttribute("data-error");return}if(!t&&a==="success"){o.removeAttribute("data-success");return}return o.setAttribute("aria-describedby",`${r}-${a}-message`),o.setAttribute("aria-invalid",a==="error"?"true":"false"),a==="error"&&o.setAttribute("data-error","true"),a==="success"&&o.setAttribute("data-success","true"),()=>{o.removeAttribute("aria-describedby"),o.removeAttribute("aria-invalid"),o.removeAttribute("data-error"),o.removeAttribute("data-success")}}},[r,a,t]),t?e.jsxs("small",{className:w.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",a==="error"&&"text-destructive",a==="success"&&"text-success"),role:"status",children:[a==="error"?e.jsx(ee.ExclamationTriangle,{}):e.jsx(L.CheckCircled,{}),e.jsx("span",{id:`${r}-${a}-message`,children:t})]}):null}const Hr={base:"",default:"ring ring-transparent focus:ring-primary-foreground/60 not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",underline:"border-b border-border focus:border-current/60 disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",outline:"border border-border focus:border-current/60 disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",solid:"bg-muted/50 focus:bg-muted/70 not-disabled:data-error:border-destructive/70 not-disabled:data-success:border-success/70"},Yr={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},Ee={variant:"default",rounded:"none"};function Ge({variant:r=Ee.variant,rounded:a,displayOnlyMode:t=!1,errorMessage:o,successMessage:s,type:n="text",className:i,...u}){const c=l.useId(),[x,f]=l.useState(!1);let d=a;r==="outline"&&!a&&(d="md"),d=d||Ee.rounded;const y=w.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted-foreground/70 hide-number-input-arrows transition-all","file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors",!t&&Hr[r],!t&&Yr[d],n==="password"&&"pr-10",!t&&"px-2 py-1",t&&"pointer-events-none",i);return e.jsxs("div",{className:w.join(t&&"cursor-text"),style:{height:u.height,width:u.width},children:[e.jsxs("div",{className:w.join(n==="password"&&"relative"),children:[e.jsx("input",{...u,id:c,type:n==="password"&&x?"text":n,"aria-disabled":u.disabled,readOnly:t,"aria-readonly":t||u["aria-readonly"],"data-error":o?!0:void 0,"data-success":s?!0:void 0,className:y}),n==="password"&&e.jsx("button",{onClick:()=>f(!x),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":x?"visible":"hidden",children:x?e.jsx(L.EyeOpened,{size:20}):e.jsx(L.EyeClosed,{size:20})})]}),!t&&e.jsx(he,{elementId:c,type:"error",message:o}),!t&&e.jsx(he,{elementId:c,type:"success",message:s})]})}function Zr({elementId:r,maxLength:a}){const[t,o]=l.useState(0);return l.useEffect(()=>{const s=document.getElementById(r);if(!s)return;const n=()=>{const i=s.value.length;o(i);const u=i>=a;s.setAttribute("aria-describedby",`${r}-character-count`),s.setAttribute("aria-invalid",u?"true":"false"),u?s.setAttribute("data-error","true"):s.removeAttribute("data-error")};return n(),s.addEventListener("input",n),s.setAttribute("maxlength",String(a)),()=>{s.removeEventListener("input",n),s.removeAttribute("maxlength"),s.removeAttribute("aria-describedby"),s.removeAttribute("aria-invalid"),s.removeAttribute("data-error")}},[r,a]),e.jsx("small",{className:w.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",t>=a&&"text-destructive",t<a&&"text-current"),role:"status",children:e.jsxs("span",{id:`${r}-character-count`,children:[t," / ",a," characters"]})})}function Qr(r,a){l.useEffect(()=>{const t=document.getElementById(r);if(!t)return;if(!a){t.style.height="auto";return}const o=()=>{t.style.height="auto",t.style.height=`${t.scrollHeight}px`};return o(),t.addEventListener("input",o),t.addEventListener("resize",o),window.addEventListener("resize",o),()=>{t.removeEventListener("input",o),t.removeEventListener("resize",o),window.removeEventListener("resize",o)}},[r,a])}const Ur={base:"","left-line":"border-l border-border focus:border-current/60 disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",outline:"border border-border focus:border-current/60 disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",solid:"bg-muted/50 focus:bg-muted/70 not-disabled:data-error:border-destructive/70 not-disabled:data-success:border-success/70"},Xr={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},Se={variant:"outline",rounded:"none"};function We({variant:r=Se.variant,rounded:a,displayOnlyMode:t=!1,errorMessage:o,successMessage:s,showResizeHandle:n=!1,autoExpand:i=!1,characterLimit:u=0,className:c,...x}){const f=l.useId();Qr(f,i||t);let d=a;r==="outline"&&!a&&(d="md"),d=d||Se.rounded;const m=w.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted-foreground/70 hide-number-input-arrows transition-all",!t&&Ur[r],!t&&Xr[d],!t&&"px-2 py-1",t&&"pointer-events-none",n&&"no-resize-handle",c);return e.jsxs("div",{className:w.join("-space-y-1.5",t&&"cursor-text"),children:[e.jsx("textarea",{...x,id:f,"aria-disabled":x.disabled,readOnly:t,"aria-readonly":t||x["aria-readonly"],style:{resize:i?"none":void 0},className:m}),u>0&&e.jsx(Zr,{elementId:f,maxLength:u}),!t&&e.jsx(he,{elementId:f,type:"error",message:o}),!t&&e.jsx(he,{elementId:f,type:"success",message:s})]})}function Jr(r){const[a,t]=l.useState(!1),[o,s]=l.useState(!1);return l.useEffect(()=>{r?(s(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>s(!1),150))},[r]),{show:a,shouldRender:o}}function Or({isOpen:r,setIsOpen:a,filteredOptions:t,highlightedIndex:o,setHighlightedIndex:s,onSelect:n,triggerRef:i}){return{handleKeyDown:l.useCallback(c=>{var x;switch(c.key){case"ArrowDown":if(c.preventDefault(),!r)a(!0);else{const f=o<t.length-1?o+1:0;let d=f;for(let h=0;h<t.length;h++){const m=(f+h)%t.length;if(!t[m].disabled){d=m;break}}s(d)}break;case"ArrowUp":if(c.preventDefault(),!r)a(!0);else{const f=o>0?o-1:t.length-1;let d=f;for(let h=0;h<t.length;h++){const m=(f-h+t.length)%t.length;if(!t[m].disabled){d=m;break}}s(d)}break;case"Enter":case" ":if(c.preventDefault(),!r)a(!0);else if(o>=0&&o<t.length){const f=t[o];f.disabled||n(f)}break;case"Escape":c.preventDefault(),r&&(a(!1),(x=i.current)==null||x.focus());break;case"Tab":r&&a(!1);break}},[r,a,t,o,s,n,i])}}function es({isOpen:r,filteredOptions:a,selectedOption:t,shouldRender:o,optionsContainerRef:s}){const[n,i]=l.useState(-1),u=l.useMemo(()=>t?a.findIndex(c=>c.value===t.value):-1,[a,t]);return l.useEffect(()=>{r&&a.length>0?i(t&&u>=0?u:0):i(-1)},[a,r,t,u]),l.useEffect(()=>{if(n>=0&&s.current&&o){const c=()=>{const x=s.current,f=x==null?void 0:x.querySelector(`[data-option-index="${n}"]`);if(f){const d=r&&t&&n===u?"auto":"smooth";f.scrollIntoView({behavior:d,block:"nearest"})}};r&&o&&t?setTimeout(c,10):c()}},[n,o,r,t,a,s,u]),{highlightedIndex:n,setHighlightedIndex:i}}const Fe={sm:{trigger:"px-2 py-1 text-sm",options:"px-2 py-2 text-xs"},md:{trigger:"px-3 py-2 text-base",options:"px-3 py-2.5 text-sm"},lg:{trigger:"px-4 py-3 text-lg",options:"px-4 py-3 text-base"}};function ts(r){const a=l.useRef(null),t=l.useRef(null),o=l.useRef(null),[s,n]=l.useState(!1),[i,u]=l.useState(!1),[c,x]=l.useState({vertical:!1,horizontal:!1}),f=l.useRef(null),d=l.useRef(null),h=l.useCallback(()=>{const v=a.current;if(!v)return;const b=v.scrollHeight>v.clientHeight,C=v.scrollWidth>v.clientWidth;x({vertical:b,horizontal:C})},[]),m=l.useCallback(()=>{const v=a.current,b=t.current,C=o.current;if(v){if(b&&c.vertical){const g=(c.horizontal?v.clientHeight-r:v.clientHeight)/v.scrollHeight,j=Math.max(g*100,10),E=v.scrollHeight-v.clientHeight,z=E>0?v.scrollTop/E:0,k=100-j,F=z*k;b.style.height=`${j}%`,b.style.top=`${F}%`,b.style.transform="none"}if(C&&c.horizontal){const g=(c.vertical?v.clientWidth-r:v.clientWidth)/v.scrollWidth,j=Math.max(g*100,10),E=v.scrollWidth-v.clientWidth,z=E>0?v.scrollLeft/E:0,k=100-j,F=z*k;C.style.width=`${j}%`,C.style.left=`${F}%`,C.style.transform="none"}}},[c,r]),y=l.useCallback(()=>{f.current&&clearTimeout(f.current),d.current&&clearTimeout(d.current),n(!0),u(!1),m(),f.current=setTimeout(()=>{u(!0),d.current=setTimeout(()=>{n(!1),u(!1)},300)},1e3)},[m]);return l.useEffect(()=>{const v=a.current;if(!v)return;h();const b=new ResizeObserver(h);b.observe(v);const C=new MutationObserver(h);return C.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{b.disconnect(),C.disconnect()}},[h]),l.useEffect(()=>{m()},[c,m]),l.useEffect(()=>()=>{f.current&&clearTimeout(f.current),d.current&&clearTimeout(d.current)},[]),{viewportRef:a,verticalThumbRef:t,horizontalThumbRef:o,isScrolling:s,isFadingOut:i,scrollbarVisible:c,handleScroll:y}}function _e({className:r,thumbClassName:a,viewportClassName:t,scrollbarClassName:o,scrollbarThickness:s=8,children:n,id:i,ref:u,...c}){const{viewportRef:x,verticalThumbRef:f,horizontalThumbRef:d,isScrolling:h,isFadingOut:m,scrollbarVisible:y,handleScroll:v}=ts(s),b=V.n("relative flex-1 rounded-full bg-slate-400/60 hover:bg-slate-400/80 active:bg-slate-400",a);return e.jsxs("div",{ref:u,id:i,className:V.n("relative overflow-hidden",r),"data-scroll-area-root":"",...c,children:[e.jsx("div",{ref:x,className:V.n("h-full w-full overflow-auto rounded-[inherit] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",t),onScroll:v,"data-scroll-area-viewport":"",children:n}),y.vertical&&(h||m)&&e.jsx("div",{className:V.n("touch-none select-none transition-all","p-[1px]","absolute right-0 top-0",m?"opacity-0":"opacity-100",o),"data-scroll-area-scrollbar":"vertical","data-state":h?"visible":"hidden",style:{width:`${s}px`,height:y.horizontal?`calc(100% - ${s}px)`:"100%"},children:e.jsx("div",{ref:f,className:V.n("absolute rounded-full",b),"data-scroll-area-thumb":"",style:{height:"20%",top:"0%",width:"100%"}})}),y.horizontal&&(h||m)&&e.jsx("div",{className:V.n("touch-none select-none transition-all","p-[1px]","absolute bottom-0 left-0",m?"opacity-0":"opacity-100",o),"data-scroll-area-scrollbar":"horizontal","data-state":h?"visible":"hidden",style:{height:`${s}px`,width:y.vertical?`calc(100% - ${s}px)`:"100%"},children:e.jsx("div",{ref:d,className:V.n("absolute rounded-full",b),"data-scroll-area-thumb":"",style:{width:"20%",left:"0%",height:"100%"}})}),y.vertical&&y.horizontal&&e.jsx("div",{className:V.n("bg-transparent","absolute bottom-0 right-0"),"data-scroll-area-corner":"",style:{height:`${s}px`,width:`${s}px`}})]})}function qe({options:r,value:a,placeholder:t="Select an option...",searchable:o=!1,disabled:s=!1,clearable:n=!1,size:i="md",className:u,triggerClassName:c,dropdownClassName:x,id:f,ref:d,onChange:h,onSearch:m,searchPlaceholder:y="Search options..."}){const v=l.useId(),C=`${f??v}-listbox`,p=S=>`${C}-option-${S}`,[g,j]=l.useState(!1),[E,z]=l.useState(""),k=l.useRef(null),F=l.useRef(null),N=l.useRef(null),D=l.useRef(null),{show:A,shouldRender:M}=Jr(g),$=l.useMemo(()=>!o||!E?r:r.filter(S=>{var B;return S.text.toLowerCase().includes(E.toLowerCase())||((B=S.description)==null?void 0:B.toLowerCase().includes(E.toLowerCase()))}),[r,o,E]),I=l.useMemo(()=>r.find(S=>S.value===a),[r,a]),{highlightedIndex:R,setHighlightedIndex:G}=es({isOpen:g,filteredOptions:$,selectedOption:I,shouldRender:M,optionsContainerRef:D}),K=R>=0?p(R):void 0;l.useEffect(()=>{g&&M&&o&&F.current&&F.current.focus()},[g,o,M]);const U=l.useCallback(S=>{var B;S.disabled||(h==null||h(S.value),j(!1),z(""),(B=k.current)==null||B.focus())},[h]),{handleKeyDown:T}=Or({isOpen:g,setIsOpen:j,filteredOptions:$,highlightedIndex:R,setHighlightedIndex:G,onSelect:U,triggerRef:k});l.useEffect(()=>{if(!g)return;const S=B=>{var Y;N.current&&!N.current.contains(B.target)&&!((Y=k.current)!=null&&Y.contains(B.target))&&(j(!1),z(""))};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[g]);const _=()=>{s||(j(!g),g||(z(""),G(-1)))},X=S=>{S.disabled||(h==null||h(S.value),j(!1),z(""))},te=S=>{const B=S.target.value;z(B),m==null||m(B),G(-1)},re=S=>{S.preventDefault(),S.stopPropagation(),h==null||h("")};return e.jsxs("div",{className:w.join("relative",u),id:f,ref:d,"data-select":"true","data-value":a,"data-searchable":o,"data-disabled":s,"data-clearable":n,children:[e.jsxs("div",{className:"relative",children:[e.jsxs("button",{ref:k,type:"button",className:w.join("flex items-center justify-between w-full text-left bg-inherit border border-border rounded-md transition-colors","hover:border-primary focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary",s&&"opacity-50 cursor-not-allowed hover:border-border",g&&"border-primary ring-1 ring-primary",Fe[i].trigger,c),onClick:_,onKeyDown:T,disabled:s,"aria-disabled":s,"aria-haspopup":"listbox","aria-expanded":g,"aria-controls":g?C:void 0,"aria-activedescendant":g&&!o?K:void 0,"aria-label":I?I.text:t,"data-select-trigger":"true",children:[e.jsx("span",{className:w.join("block truncate",!I&&"opacity-70"),children:I?I.text:t}),e.jsx("div",{className:"flex items-center ml-2",children:e.jsx(L.ChevronDown,{size:16,className:w.join("transition-transform",g&&"rotate-180")})})]}),n&&I&&e.jsx("button",{type:"button",onClick:re,className:"absolute right-8 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-accent/20 transition-colors group z-10","aria-label":"Clear selection","data-select-clear":"true",children:e.jsx(ee.X,{size:14,className:"opacity-70 group-hover:opacity-100 transition-opacity"})})]}),M&&e.jsxs("div",{ref:N,className:w.join("absolute z-50 w-full mt-1 bg-popover text-popover-foreground border border-border rounded-md shadow-lg transition-all",A?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",x),id:C,role:"listbox","data-select-content":"true",children:[o&&e.jsx("div",{className:"border-b border-border",children:e.jsx("input",{ref:F,type:"text",value:E,onChange:te,onKeyDown:T,placeholder:y,className:"w-full px-2 py-2 text-inherit focus:outline-none","aria-autocomplete":"list","aria-controls":C,"aria-activedescendant":K,"data-select-search":"true"})}),e.jsx(_e,{ref:D,viewportClassName:"max-h-60",children:$.length>0?$.map((S,B)=>e.jsxs("div",{id:p(B),className:w.join("flex items-center cursor-pointer transition-colors","hover:bg-accent/10 focus:bg-accent/10",Fe[i].options,S.disabled&&"opacity-50 cursor-not-allowed",B===R&&"bg-accent/20",a===S.value&&"bg-accent/30"),onClick:()=>X(S),role:"option","aria-selected":a===S.value,"aria-disabled":S.disabled,"data-select-option":"true","data-value":S.value,"data-highlighted":B===R,"data-option-index":B,children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium",children:S.text}),S.description&&e.jsx("div",{className:"text-xs opacity-70 mt-0.5",children:S.description})]}),a===S.value&&e.jsx(L.Check,{size:16,className:"ml-2 text-primary flex-shrink-0"})]},S.value)):e.jsx("div",{className:"px-3 py-2 text-sm opacity-70 text-center",children:o&&E?"No results found":"No options available"})})]})]})}function Pe({itemId:r,checked:a,onChange:t,name:o,disabled:s=!1,className:n=""}){const i="relative inline-flex items-center justify-center rounded-full",u=()=>{s||t()},c=w.join(i,!a&&"hover:border-current/60",!s&&"border-current cursor-pointer",s&&"border-muted/60 cursor-not-allowed",n);return e.jsx("div",{id:r,role:"radio",tabIndex:-1,"aria-checked":a,"aria-disabled":s,"aria-description":`Radio button for ${o}`,"aria-labelledby":`${r}-label`,onClick:u,className:c,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:a&&e.jsx("div",{className:w.join("size-full aspect-square rounded-full",s&&"bg-muted/60",!s&&"bg-current")})})}function fe({value:r,children:a,className:t="",isSelected:o=!1,onChange:s,disabled:n=!1,hideInput:i=!1,description:u,name:c}){const f=`radio-${l.useId()}-${r}`,d=()=>{n||s==null||s(r)};return e.jsxs("div",{title:u,className:w.join("relative flex items-center",t,i&&`p-2 border-2 focus-within:border-dashed focus-within:${n?"border-current/50":"border-current/80"}`,i&&!o&&`border-transparent ${n?"":"not-focus-within:hover:border-border/60"}`,i&&o&&"border-border",n&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!i&&e.jsx(Pe,{itemId:f,name:c||"",checked:o,onChange:d,disabled:n,className:w.join(i&&"")}),e.jsx("div",{id:i?f:void 0,tabIndex:i?-1:void 0,role:i?"radio":void 0,onClick:i?d:void 0,"aria-checked":i?o?"true":"false":void 0,"aria-disabled":i?n:void 0,"aria-description":i?u||`Radio button for ${c}`:void 0,"aria-labelledby":i?`${f}-label`:void 0,className:w.join(i&&"size-full",typeof a=="object"&&"grow focus:outline-none"),children:e.jsx("label",{id:`${f}-label`,onClick:i?void 0:d,className:w.join(n&&"cursor-not-allowed",!n&&"cursor-pointer"),children:a})})]})}function rs(r,a){const[t,o]=l.useState(a),[s,n]=l.useState(-1),[i,u]=l.useState(!1),c=l.useCallback((m,y)=>{var C;const v=m[y];v.hasAttribute("disabled")||v.getAttribute("aria-disabled")==="true"||((C=m[y])==null||C.click(),n(y))},[]),x=l.useCallback((m,y)=>{var b;if(m.preventDefault(),i||!y.length)return;const v=a!==-1?a:0;(b=y[v])==null||b.focus(),o(v),a!==-1&&c(y,v)},[a,i,c]),f=l.useCallback(m=>{var C;if(!m.shiftKey)return;m.preventDefault();const y=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(p=>!p.hasAttribute("disabled")&&p.tabIndex>=0),v=y.findIndex(p=>p.id===r),b=v>0?v-1:y.length-1;(C=y[b])==null||C.focus()},[r]),d=l.useCallback((m,y)=>{var g;if(!y.length)return;const v=m.target;if(!y.some(j=>j.id===v.id))return;const C=t!==-1?t:0;let p=C;switch(m.key){case"ArrowUp":case"ArrowLeft":m.preventDefault(),p=C>0?C-1:y.length-1;break;case"ArrowDown":case"ArrowRight":m.preventDefault(),p=(C+1)%y.length;break;case" ":m.preventDefault(),c(y,C);return;case"Tab":f(m);return;default:return}(g=y[p])==null||g.focus(),o(p),s!==-1&&c(y,p)},[t,s,f,c]),h=l.useCallback(()=>{const m=document.querySelector(`[id="${r}"][role="radiogroup"]`);return m?Array.from(m.querySelectorAll('[role="radio"]')):[]},[r]);l.useEffect(()=>{const m=document.querySelector(`[id="${r}"][role="radiogroup"]`);if(!m)return;const y=h(),v=g=>x(g,y),b=g=>d(g,y),C=()=>u(!0),p=()=>u(!1);return document.addEventListener("keydown",b),m.addEventListener("focus",v),m.addEventListener("mousedown",C),document.addEventListener("mouseup",p),()=>{document.removeEventListener("keydown",b),m.removeEventListener("focus",v),m.removeEventListener("mousedown",C),document.removeEventListener("mouseup",p)}},[r,h,x,d])}function Ke({options:r=[],value:a,onChange:t,id:o,children:s,className:n="",childrenClassName:i="",hideInputs:u=!1}){const c=l.useId(),x=o||`radio-group-${c}`;rs(x,r.findIndex(d=>d===a));const f=l.useMemo(()=>r.reduce((d,h)=>(typeof h=="string"?d.some(m=>m.value===h)||d.push({label:h,value:h}):d.push(h),d),[]),[r]);return e.jsxs("div",{id:x,role:"radiogroup",tabIndex:0,className:w.join(n,"focus:outline-none"),children:[f.length>0&&f.map((d,h)=>e.jsx(fe,{value:d.value,isSelected:a===d.value,onChange:t,name:x,disabled:d.disabled,description:d.description,hideInput:u,className:i,children:d.label},`${d.value}-${h}`)),f.length===0&&s&&l.Children.map(s,d=>l.isValidElement(d)&&d.type===fe?e.jsx(fe,{...d.props,className:w.join(i,d.props.className),hideInput:d.props.hideInput||u,isSelected:a===d.props.value,onChange:t,name:x,children:d.props.children}):null)]})}function ss({form:r,initialData:a={},onDataChange:t,onSubmit:o,submitButton:s,columns:n=ve.columns,responsive:i=ve.responsive,spacing:u=ve.spacing,className:c,id:x,ref:f}){const[d,h]=l.useState(a),{errors:m,validateForm:y,validateSingleField:v,isFormValid:b}=Kr(r,d),C=l.useCallback((k,F)=>{const N={...d,[k]:F};h(N),t==null||t(N),v(k,F)},[d,t,v]),p=l.useCallback(k=>{k.preventDefault(),y(d)&&o&&o(d)},[d,y,o]),g=k=>{const F=[],N={};return k.colSpan&&n>1&&F.push(ye.colSpan[k.colSpan]),{className:w.join(F.join(" "),k.className),style:N}},j=k=>{const F=d[k.name],N=m[k.name],D=x?`${x}-${k.name}`:k.name,{className:A,style:M}=g(k),$=()=>{switch(k.__type){case"input":{const I=k;return e.jsxs(e.Fragment,{children:[e.jsx(le,{htmlFor:D,required:k.required,description:k.description,children:k.label}),e.jsx(Ge,{id:D,type:I.type||"text",placeholder:I.placeholder,value:F||"",onChange:R=>C(k.name,R.target.value),disabled:k.disabled,variant:I.variant,rounded:I.rounded,errorMessage:N,"data-field-name":k.name,"data-field-type":k.__type})]})}case"textarea":{const I=k;return e.jsxs(e.Fragment,{children:[e.jsx(le,{htmlFor:D,required:k.required,description:k.description,children:k.label}),e.jsx(We,{id:D,placeholder:I.placeholder,value:F||"",onChange:R=>C(k.name,R.target.value),disabled:k.disabled,variant:I.variant,rounded:I.rounded,rows:I.rows,autoExpand:I.autoExpand,characterLimit:I.characterLimit,errorMessage:N,"data-field-name":k.name,"data-field-type":k.__type})]})}case"select":{const I=k,R=I.options.map(G=>({text:G.label,value:G.value,disabled:G.disabled}));return e.jsxs(e.Fragment,{children:[e.jsx(le,{htmlFor:D,required:k.required,description:k.description,children:k.label}),e.jsx(qe,{id:D,options:R,value:F||"",onChange:G=>C(k.name,G),placeholder:I.placeholder,disabled:k.disabled,searchable:I.searchable,clearable:I.clearable,"data-field-name":k.name,"data-field-type":k.__type}),N&&e.jsx("p",{className:"text-sm text-destructive mt-1",role:"alert",children:N})]})}case"checkbox":{const I=k,R=16;return e.jsxs("div",{className:"space-x-2",children:[e.jsx(xe,{id:D,checked:F||!1,onCheckedChange:G=>C(k.name,G),disabled:k.disabled,"data-field-name":k.name,"data-field-type":k.__type,size:R}),e.jsxs("div",{className:"inline-block",style:{maxWidth:`calc(100% - ${R+10}px)`},children:[" ",e.jsx(le,{htmlFor:D,className:"cursor-pointer",children:I.text||k.label}),k.description&&e.jsx("p",{className:"text-sm opacity-80 mt-1",children:k.description}),N&&e.jsx("p",{className:"text-sm text-destructive mt-1",role:"alert",children:N})]})]})}case"radio":{const R=k.options.map(G=>({label:G.label,value:G.value,disabled:G.disabled}));return e.jsxs(e.Fragment,{children:[e.jsx(le,{required:k.required,children:k.label}),k.description&&e.jsx("p",{className:"text-sm opacity-80 mb-2",children:k.description}),e.jsx(Ke,{options:R,value:F||"",onChange:G=>C(k.name,G),id:D,"data-field-name":k.name,"data-field-type":k.__type}),N&&e.jsx("p",{className:"text-sm text-destructive mt-1",role:"alert",children:N})]})}default:return null}};return e.jsx("div",{className:A,style:M,children:$()},k.name)},E=w.join("grid",n&&n>1?ye.columns[n]:"grid-cols-1",ye.spacing[u],c),z=()=>s?l.isValidElement(s)?l.cloneElement(s,{disabled:!b,"aria-disabled":!b,...s.props??{}}):e.jsx("div",{className:"col-span-full",children:s}):null;return e.jsxs("form",{ref:f,id:x,onSubmit:p,className:E,"data-form-fields":r.length,"data-form-columns":n,"data-form-responsive":i,"data-form-valid":b,children:[r.map(j),z()]})}function He({id:r,children:a,message:t,placement:o="top",disabled:s=!1,delay:n=100,showArrow:i=!0,className:u}){const[c,x]=l.useState(!1),[f,d]=l.useState(!1),[h,m]=l.useState(!1),[y,v]=l.useState(!1),b=l.useRef(null),C=l.useId(),p=r??C,g=l.useCallback(()=>{s||(b.current&&clearTimeout(b.current),b.current=window.setTimeout(()=>{x(!0)},n))},[s,n]),j=l.useCallback((F=!1)=>{if(b.current&&clearTimeout(b.current),F){x(!1);return}b.current=window.setTimeout(()=>{x(!1)},100)},[]);l.useEffect(()=>{!f&&!h&&!y&&c&&j()},[f,h,y,c,j]),l.useEffect(()=>{if(!c)return;const F=()=>{j(!0)};return window.addEventListener("scroll",F,!0),()=>{window.removeEventListener("scroll",F,!0)}},[c,j]),l.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]);const E=()=>{const F="absolute z-50 px-2 py-1 text-sm rounded shadow-lg bg-tooltip text-tooltip-foreground pointer-events-auto transition-all ease-out w-max max-w-xs",N=c?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none",D={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},A={top:"origin-bottom",bottom:"origin-top",left:"origin-right",right:"origin-left"};return w.join(F,D[o],A[o],N,u)},z=()=>{if(!i)return"";const F="absolute w-0 h-0 pointer-events-none",N={top:"top-full left-1/2 -translate-x-1/2 border-l-[6px] border-r-[6px] border-t-[6px] border-l-transparent border-r-transparent border-t-tooltip",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-[6px] border-r-[6px] border-b-[6px] border-l-transparent border-r-transparent border-b-tooltip",left:"left-full top-1/2 -translate-y-1/2 border-t-[6px] border-b-[6px] border-l-[6px] border-t-transparent border-b-transparent border-l-tooltip",right:"right-full top-1/2 -translate-y-1/2 border-t-[6px] border-b-[6px] border-r-[6px] border-t-transparent border-b-transparent border-r-tooltip"};return w.join(F,N[o])},k=a.props;return e.jsx(e.Fragment,{children:l.cloneElement(a,{style:{...k.style,position:"relative"},onMouseEnter:()=>{d(!0),g()},onMouseLeave:()=>{d(!1)},onFocus:()=>{v(!0),g()},onBlur:()=>{v(!1),j(!0)},onKeyDown:F=>{F.key==="Escape"&&j(!0)},"aria-describedby":s?void 0:p,children:e.jsxs(e.Fragment,{children:[k.children,!s&&e.jsxs("div",{id:p,role:"tooltip",className:E(),"aria-hidden":!c,"aria-live":c?"polite":void 0,onMouseEnter:()=>{m(!0),b.current&&clearTimeout(b.current)},onMouseLeave:()=>{m(!1)},children:[t,i&&e.jsx("div",{className:z(),"aria-hidden":!0})]})]})})})}function ns({id:r,ref:a,design:t="filled",iconSize:o=14,className:s,...n}){const i=t==="filled"?L.InfoCircledFilled:ee.InfoCircled;return e.jsx(He,{...n,children:e.jsx("div",{id:r,ref:a,className:w.join("inline-block cursor-help text-muted-foreground transition-colors align-top",s),"data-help-icon":"true","data-design":t,"data-size":o,children:e.jsx(i,{size:o,className:"fill-current"})})})}function as(r){const[a,t]=l.useState(!1),[o,s]=l.useState(!1);return l.useEffect(()=>{r?(s(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>s(!1),150))},[r]),{show:a,shouldRender:o}}function os(r,a){l.useEffect(()=>{const t=o=>{o.key==="Escape"&&r&&a()};return document.addEventListener("keydown",t),r&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[r,a])}function ls(r,a){const t=l.useRef(null),o=l.useCallback(()=>{const s=document.getElementById(r);if(!s)return;const n=s.querySelectorAll('[data-modal-action="true"]');if(n.length>0){n[0].focus();return}const i=s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(i.length>0){const u=Array.from(i).filter(c=>!(c instanceof HTMLButtonElement&&c.getAttribute("data-modal-close-button")==="true"));if(u.length>0){u[0].focus();return}i[0].focus();return}s.focus()},[r]);l.useEffect(()=>(a&&(t.current=document.activeElement,o()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[a,o])}function is({id:r,isOpen:a,onClose:t,title:o,children:s,contentOnly:n=!1,className:i,overlayClassName:u,containerClassName:c,hideCloseButton:x=!1,actions:f=[],disableCloseOnOverlayClick:d=!1,ariaLabelledBy:h,ariaDescribedBy:m}){const y=l.useId(),v=r||`modal-${y}`,b=r?`${r}-title`:`modal-title-${y}`,{show:C,shouldRender:p}=as(a);if(ls(v,p),os(p,t),!p)return null;const g=()=>o?l.isValidElement(o)?e.jsx("div",{className:"mb-4",children:o}):e.jsx("h2",{className:"mb-4 text-xl font-semibold",id:b,children:o}):null,j=()=>f.length===0?null:e.jsx("div",{className:"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3",children:f.map((E,z)=>{const{label:k,...F}=E,N=F;return e.jsx(Te,{...N,"data-modal-action":"true",children:k},z)})});return e.jsx(e.Fragment,{children:pe.createPortal(e.jsx("div",{"aria-labelledby":h??o?b:void 0,"aria-describedby":m,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:e.jsxs("div",{className:V.n("flex min-h-screen items-center justify-center p-4",c),children:[e.jsx("div",{className:V.n("fixed inset-0 bg-black/20 transition-all",u),onClick:()=>{d||t()}}),n&&e.jsx("div",{className:V.n("relative w-fit",i),children:s}),!n&&e.jsxs("div",{id:v,tabIndex:-1,className:V.n("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover text-popover-foreground transition-all p-6 focus:ring ease-in",C?"opacity-100 scale-100":"opacity-0 scale-90",i),children:[!x&&e.jsx("button",{type:"button",onClick:t,"data-modal-close-button":"true",className:"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:e.jsx(ee.X,{size:18})}),g(),s,j()]})]})}),document.body)})}const cs={link:"text-primary hover:text-primary-foreground hover:bg-primary/10 aria-current:text-primary-foreground aria-current:bg-primary",outline:"border border-primary text-primary hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground aria-current:border-primary",filled:"bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground"},ds={sm:"px-2 py-1 text-sm min-w-[32px] min-h-8",md:"px-2 py-1 text-base min-w-[40px] min-h-10"};function us({page:r,pageCount:a=5,maxVisiblePages:t=5,showFirstLast:o=!0,onPageChange:s,size:n="md",variant:i="link",className:u,ref:c,buttonsClassName:x,...f}){const d=a===1/0,m=l.useCallback(()=>{if(d)return[];const j=a,E=Math.min(t,j);if(j<=E)return Array.from({length:j},(N,D)=>D+1);const z=Math.floor(E/2);let k=Math.max(1,r-z),F=Math.min(j,k+E-1);return F-k+1<E&&(k=Math.max(1,F-E+1),F=Math.min(j,k+E-1)),Array.from({length:F-k+1},(N,D)=>k+D)},[d,t,r,a])(),y=r>1,v=d||r<a,b=o&&!d,C=o&&!d,p=j=>{j>=1&&(d||j<=a)&&s(j)},g=l.useCallback(()=>{const j=V.n("flex items-center justify-center min-w-fit","disabled:opacity-50 disabled:cursor-not-allowed",ds[n],"rounded-md");return V.n(j,cs[i],x)},[i,n,x]);return e.jsxs("nav",{ref:c,className:V.n("flex items-center justify-center gap-1",u),role:"navigation","aria-label":"Pagination","data-page":r,"data-page-count":d?"infinite":a,...f,children:[b&&e.jsxs("button",{onClick:()=>p(1),className:g(),disabled:r===1,"aria-label":"Go to first page",children:[e.jsx(L.ChevronDoubleLeft,{size:n==="sm"?12:15}),e.jsx("span",{className:"ml-1",children:"First"})]}),e.jsxs("button",{onClick:()=>p(r-1),className:g(),disabled:!y,"aria-label":"Go to previous page",children:[e.jsx(L.ChevronLeft,{size:n==="sm"?12:15}),e.jsx("span",{className:"ml-1",children:"Previous"})]}),!d&&m.map(j=>e.jsx("button",{onClick:()=>p(j),className:V.n(g(),"aspect-square"),"aria-label":`Go to page ${j}`,"aria-current":j===r?!0:void 0,children:j},j)),e.jsxs("button",{onClick:()=>p(r+1),className:g(),disabled:!v,"aria-label":"Go to next page",children:[e.jsx("span",{className:"mr-1",children:"Next"}),e.jsx(L.ChevronRight,{size:n==="sm"?12:15})]}),C&&e.jsxs("button",{onClick:()=>p(a),className:g(),disabled:r===a,"aria-label":"Go to last page",children:[e.jsx("span",{className:"mr-1",children:"Last"}),e.jsx(L.ChevronDoubleRight,{size:n==="sm"?12:15})]})]})}function fs(r){const[a,t]=l.useState(!1),[o,s]=l.useState(!1);return l.useEffect(()=>{r?(s(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>s(!1),300))},[r]),{show:a,shouldRender:o}}function xs(r,a){l.useEffect(()=>{const t=o=>{o.key==="Escape"&&r&&a()};return document.addEventListener("keydown",t),r&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[r,a])}function ms(r,a){const t=l.useRef(null),o=l.useCallback(()=>{const s=document.getElementById(r);if(!s)return;const n=s.querySelectorAll('[data-panel-action="true"]');if(n.length>0){n[0].focus();return}const i=s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(i.length>0){const u=Array.from(i).filter(c=>!(c instanceof HTMLButtonElement&&c.getAttribute("data-panel-close-button")==="true"));if(u.length>0){u[0].focus();return}i[0].focus();return}s.focus()},[r]);l.useEffect(()=>(a&&(t.current=document.activeElement,o()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[a,o])}function hs({ref:r,id:a,isOpen:t,onClose:o,title:s,children:n,footer:i,className:u,overlayClassName:c,hideCloseButton:x=!1,disableCloseOnOverlayClick:f=!1,ariaLabelledBy:d,ariaDescribedBy:h}){const m=l.useId(),y=a||`panel-${m}`,v=a?`${a}-title`:`panel-title-${m}`,{show:b,shouldRender:C}=fs(t);if(ms(y,C),xs(C,o),!C)return null;const p=()=>s?l.isValidElement(s)?e.jsx("div",{children:s}):e.jsx("h2",{className:"text-2xl font-semibold",id:v,children:s}):null,g=()=>{if(!i)return null;if(l.isValidElement(i)){const j=i,E=j.props.className||"";return l.cloneElement(j,{className:V.n("px-6 py-4",E)})}return e.jsx("div",{className:"px-6 py-4",children:i})};return e.jsx(e.Fragment,{children:pe.createPortal(e.jsxs("div",{"aria-labelledby":d??s?v:void 0,"aria-describedby":h,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-hidden","data-panel-open":t,children:[e.jsx("div",{className:V.n("fixed inset-0 bg-black/40 transition-opacity",b?"opacity-100":"opacity-0",c),onClick:()=>{f||o()}}),e.jsx("div",{className:"fixed inset-y-0 right-0 flex max-w-full",children:e.jsx("div",{id:y,ref:r,tabIndex:-1,className:V.n("relative h-full max-w-md transform shadow-xl bg-popover text-popover-foreground transition-transform ease-in-out border-l border-border",b?"translate-x-0":"translate-x-full",u),children:e.jsxs("div",{className:"flex h-full flex-col",children:[s&&e.jsx("div",{className:"px-6 pt-6",children:p()}),!x&&e.jsx("button",{type:"button",onClick:o,"data-panel-close-button":"true","aria-label":"Close panel",className:"rounded-md p-0.5 top-3 right-3 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:e.jsx(ee.X,{size:18})}),e.jsx("div",{className:V.n("flex-1 overflow-y-auto px-6 pb-6",s?"pt-6":"pt-10"),children:n}),g()]})})})]}),document.body)})}const ps={thin:{horizontal:"h-px",vertical:"w-px"},medium:{horizontal:"h-0.5",vertical:"w-0.5"},thick:{horizontal:"h-1",vertical:"w-1"},"extra-thick":{horizontal:"h-2",vertical:"w-2"}},bs={horizontal:"w-full",vertical:"min-h-4 h-full"};function gs({orientation:r="horizontal",decorative:a=!1,thickness:t="thin",className:o,...s}){const n=w.join("shrink-0 bg-border",bs[r],ps[t][r],o);return e.jsx("div",{...s,className:n,role:a?"presentation":"separator","aria-orientation":a?void 0:r,"aria-hidden":a,"data-orientation":r,"data-thickness":t})}const Ie={shape:{rectangle:"rounded-md min-h-1",circle:"rounded-full aspect-square min-h-1",text:"rounded-sm min-h-1 h-4"},lineSpacing:{xs:"space-y-1",sm:"space-y-2",md:"space-y-3",lg:"space-y-4",xl:"space-y-6"}};function ys({shape:r="rectangle",lineSpacing:a="sm",className:t,lines:o=1,animate:s=!0,ref:n,...i}){const u=w.join("bg-muted/70",s&&"animate-pulse",Ie.shape[r],t);return o>1?e.jsx("div",{ref:n,className:Ie.lineSpacing[a],role:"presentation","aria-hidden":"true","data-testid":"skeleton-container","data-lines":o,"data-shape":r,"data-animate":s,...i,children:Array.from({length:o},(c,x)=>e.jsx("div",{className:w.join(u,x===o-1&&"w-3/4"),role:"presentation","aria-hidden":"true","data-testid":"skeleton-line","data-line-index":x},x))}):e.jsx("div",{ref:n,className:u,role:"presentation","aria-hidden":"true","data-testid":"skeleton","data-shape":r,"data-animate":s,...i})}function vs({id:r,value:a,defaultValue:t=0,onValueChange:o,min:s=0,max:n=100,step:i=1,disabled:u=!1,trackClassName:c,rangeClassName:x,thumbClassName:f,className:d,ref:h,ariaLabel:m,ariaLabelledBy:y,...v}){const[b,C]=l.useState(t),p=a!==void 0,g=p?a:b,j=l.useRef(null),E=l.useRef(!1),z=l.useRef(0),k=l.useCallback($=>{const I=Math.max(s,Math.min(n,$)),R=Math.round(I/i)*i;p||C(R),o==null||o(R)},[s,n,i,p,o]),F=l.useCallback(($,I=!1)=>{var U;const R=(U=j.current)==null?void 0:U.getBoundingClientRect();if(!R)return g;let G=$.clientX;I&&(G=G-z.current);const K=Math.max(0,Math.min(1,(G-R.left)/R.width));return s+(n-s)*K},[s,n,g]),N=l.useCallback($=>{if(u||$.target!==$.currentTarget)return;const I=F($);k(I)},[u,F,k]),D=l.useCallback($=>{var U;if(u)return;$.stopPropagation(),E.current=!0;const I=(U=j.current)==null?void 0:U.getBoundingClientRect(),R=$.currentTarget.getBoundingClientRect();if(I&&R){const T=R.left+R.width/2;z.current=$.clientX-T}$.currentTarget.setPointerCapture($.pointerId);const G=T=>{if(!E.current)return;const _=F(T,!0);k(_)},K=T=>{if(T.pointerId===$.pointerId){E.current=!1,z.current=0;try{$.currentTarget.releasePointerCapture(T.pointerId)}catch{}document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",K)}};document.addEventListener("pointermove",G),document.addEventListener("pointerup",K)},[u,F,k]),A=l.useCallback($=>{if(u)return;let I=g;switch($.key){case"ArrowRight":case"ArrowUp":I=g+i;break;case"ArrowLeft":case"ArrowDown":I=g-i;break;case"Home":I=s;break;case"End":I=n;break;case"PageUp":I=g+i*10;break;case"PageDown":I=g-i*10;break;default:return}$.preventDefault(),k(I)},[u,g,i,s,n,k]),M=n===s?0:(g-s)/(n-s)*100;return e.jsx("div",{id:r,ref:h,className:V.n("relative flex items-center w-full touch-none select-none",u&&"opacity-50 cursor-not-allowed",d),"data-disabled":u,"data-value":g,"data-min":s,"data-max":n,"data-step":i,...v,children:e.jsxs("div",{ref:j,className:V.n("relative h-1.5 w-full rounded-full bg-muted-foreground cursor-pointer",u&&"cursor-not-allowed",c),onPointerDown:N,children:[e.jsx("div",{className:V.n("absolute h-full rounded-full pointer-events-none",!E.current&&"transition-all",x),style:{width:`${M}%`}}),e.jsx("div",{className:V.n("absolute size-5 -top-2 rounded-full shadow-md cursor-grab",u&&"cursor-not-allowed",!u&&"cursor-grab focus:outline-none focus:ring-2",E.current?"cursor-grabbing scale-110":"transition-all",f),style:{left:`calc(${M}% - 10px)`},tabIndex:u?-1:0,role:"slider","aria-valuemin":s,"aria-valuemax":n,"aria-valuenow":g,"aria-label":m,"aria-labelledby":y,"aria-disabled":u,onKeyDown:A,onPointerDown:D})]})})}function js({data:r,initialSort:a={key:null,direction:null}}){const[t,o]=l.useState(a),[s,n]=l.useState();return{sortedData:l.useMemo(()=>!t.key||!t.direction?r:[...r].sort((c,x)=>{if(s){const m=s(c,x);return t.direction==="desc"?-m:m}const f=c[t.key],d=x[t.key];if(f===d)return 0;let h=0;return typeof f=="string"&&typeof d=="string"?h=f.localeCompare(d):typeof f=="number"&&typeof d=="number"?h=f-d:f instanceof Date&&d instanceof Date?h=f.getTime()-d.getTime():h=String(f).localeCompare(String(d)),t.direction==="desc"?-h:h}),[r,t,s]),sortConfig:t,handleSort:(c,x)=>{n(()=>x),o(f=>{if(f.key===c){const d=f.direction==="asc"?"desc":f.direction==="desc"?null:"asc";return{key:d?c:null,direction:d}}else return{key:c,direction:"asc"}})}}}function ws({initialSelected:r=[]}={}){const[a,t]=l.useState(new Set(r));return{selectedRows:a,isRowSelected:f=>a.has(f),selectRow:f=>{t(d=>new Set([...d,f]))},deselectRow:f=>{t(d=>{const h=new Set(d);return h.delete(f),h})},selectAll:f=>{t(new Set(f))},deselectAll:()=>{t(new Set)},isAllSelected:f=>f.length>0&&f.every(d=>a.has(d)),isPartiallySelected:f=>{const d=f.filter(h=>a.has(h)).length;return d>0&&d<f.length}}}const ks={sm:{container:"text-sm",table:"w-full border-collapse",header:"border-b border-border",headerCell:"px-3 py-2.5 font-medium",sortButton:"inline-flex items-center gap-1 hover:text-accent transition-colors",cell:"px-3 py-2 text-sm",selectedRow:"bg-accent/10 hover:bg-accent/20",checkbox:"pl-5 pr-2 text-left w-3",checkboxSize:12},md:{container:"text-base",table:"w-full border-collapse",header:"border-b-2 border-border",headerCell:"px-4 py-3 font-semibold",sortButton:"inline-flex items-center gap-2 hover:text-accent transition-colors",cell:"px-4 py-3",selectedRow:"bg-accent/10 hover:bg-accent/20",checkbox:"pl-6 pr-3 py-3 text-left w-6",checkboxSize:16},lg:{container:"text-lg",table:"w-full border-collapse",header:"border-b-2 border-border",headerCell:"px-6 py-4 font-bold",sortButton:"inline-flex items-center gap-2 hover:text-accent transition-colors",cell:"px-6 py-4",selectedRow:"bg-accent/10 hover:bg-accent/20",checkbox:"pl-6 pr-3 py-4 text-left w-8",checkboxSize:18}};function Cs({id:r,className:a,ref:t,size:o="md",data:s,columns:n,selectable:i=!1,getRowId:u=(p,g)=>g,initialSelected:c=[],onSelectionChange:x,showHeader:f=!0,striped:d=!1,hoverable:h=!0,emptyState:m,loading:y=!1,loadingContent:v,caption:b,...C}){const p=ks[o],{sortedData:g,sortConfig:j,handleSort:E}=js({data:s,initialSort:{key:null,direction:null}}),{selectedRows:z,isRowSelected:k,selectRow:F,deselectRow:N,selectAll:D,deselectAll:A,isAllSelected:M,isPartiallySelected:$}=ws({initialSelected:c}),I=s.map((T,_)=>u(T,_));l.useEffect(()=>{x&&x(Array.from(z))},[z,x]);const R=()=>{M(I)?A():D(I)},G=(T,_)=>_.accessor?typeof _.accessor=="function"?_.accessor(T):T[_.accessor]:T[_.key],K=(T,_)=>{const X=G(T,_);return _.cell?_.cell(T,X):e.jsx(e.Fragment,{children:X})},U=T=>{switch(T){case"center":return"text-center";case"right":return"text-right";default:return"text-left"}};return y?e.jsx("div",{id:r,ref:t,className:w.join("flex items-center justify-center p-8",p.container,a),...C,children:v||e.jsx("div",{children:"Loading..."})}):s.length===0?e.jsx("div",{id:r,ref:t,className:w.join("flex items-center justify-center p-8",p.container,a),...C,children:m||e.jsx("div",{className:"text-muted-foreground",children:"No data available"})}):e.jsx("div",{id:r,ref:t,className:w.join("overflow-x-auto border border-border rounded-lg",p.container,a),"data-testid":"table-container","data-size":o,"data-selectable":i,...C,children:e.jsxs("table",{className:p.table,role:"table",children:[b&&e.jsx("caption",{className:"sr-only",children:b}),e.jsxs("colgroup",{children:[i&&e.jsx("col",{style:{width:"1%"}}),n.map(T=>e.jsx("col",{style:T.width?{width:T.width}:{},className:T.columnClassName},T.key))]}),f&&e.jsx("thead",{className:p.header,role:"rowgroup",children:e.jsxs("tr",{role:"row",children:[i&&e.jsx("th",{className:p.checkbox,role:"columnheader","aria-label":"Select all rows",children:e.jsx(xe,{size:p.checkboxSize,checked:M(I),indeterminate:$(I),onCheckedChange:R,"aria-label":"Select all rows",className:"align-middle"})}),n.map(T=>{const _=j.key===T.key?j.direction:null;return e.jsx("th",{className:w.join(p.headerCell,U(T.align),T.headerClassName),role:"columnheader","aria-sort":j.key===T.key?j.direction==="asc"?"ascending":j.direction==="desc"?"descending":"none":T.sortable?"none":void 0,children:T.sortable?e.jsxs("button",{className:p.sortButton,onClick:()=>E(T.key,T.sortFunction),"aria-label":`Sort by ${T.header}`,children:[T.header,e.jsxs("div",{className:"flex flex-col items-center -space-y-1",children:[e.jsx(L.ChevronUp,{size:p.checkboxSize-4,className:_==="asc"?"text-accent":"opacity-40"}),e.jsx(L.ChevronDown,{size:p.checkboxSize-4,className:_==="desc"?"text-accent":"opacity-40"})]})]}):T.header},T.key)})]})}),e.jsx("tbody",{role:"rowgroup",children:g.map((T,_)=>{const X=u(T,_),te=k(X),re=_===g.length-1;return e.jsxs("tr",{className:w.join("transition-all",!re&&"border-b border-border",h&&"hover:bg-accent/15",d&&_%2===1&&"bg-accent/25",te&&p.selectedRow),role:"row","aria-selected":i?te:void 0,"data-testid":"table-row","data-row-id":X,"data-selected":te,children:[i&&e.jsx("td",{className:p.checkbox,role:"cell",children:e.jsx(xe,{size:p.checkboxSize,checked:te,onCheckedChange:S=>{S?F(X):N(X)},"aria-label":`Select row ${_+1}`})}),n.map(S=>e.jsx("td",{className:w.join(p.cell,U(S.align),S.cellClassName),role:"cell",children:K(T,S)},S.key))]},X)})})]})})}const Ns=({defaultValue:r,value:a,onValueChange:t}={})=>{const[o,s]=l.useState(r||""),n=a!==void 0,i=n?a:o,u=l.useCallback(c=>{n||s(c),t==null||t(c)},[n,t]);return{value:i,onValueChange:u}},Ae={width:{fit:"w-fit",full:"w-full *:flex-1"},variant:{underline:"border-b border-border",pills:"",bordered:"border border-border rounded-lg p-1"}},Ds={underline:"border-b-2 border-transparent data-[state=active]:border-accent data-[state=active]:text-accent hover:text-accent/80",pills:"rounded-md data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30",bordered:"rounded data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30"};function Ye({children:r,className:a,id:t,ref:o}){const{tabsWidth:s,variant:n}=V.useTabsContext();return e.jsx("div",{id:t,ref:o,role:"tablist",className:w.join("flex",Ae.width[s],Ae.variant[n],a),"data-tabs-width":s,"data-variant":n,children:r})}function Ze({value:r,disabled:a=!1,className:t,children:o,onClick:s,id:n,ref:i}){const{selectedValue:u,onValueChange:c,variant:x,triggersClassName:f}=V.useTabsContext(),d=u===r,h=y=>{a||c(r),s==null||s(y)};return e.jsx("button",{id:n,ref:i,role:"tab",type:"button","aria-selected":d,"aria-controls":`tabs-content-${r}`,"data-state":d?"active":"inactive","data-value":r,disabled:a,className:w.join("inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",d?"font-medium":"font-light",Ds[x],f,t),onClick:h,children:o})}function Es({defaultValue:r,value:a,onValueChange:t,tabsWidth:o="fit",variant:s="underline",className:n,tabsList:i,children:u,ref:c,id:x,triggersClassName:f,contentClassName:d}){const{value:h,onValueChange:m}=Ns({defaultValue:r,value:a,onValueChange:t}),y={selectedValue:h,onValueChange:m,tabsWidth:o,variant:s,triggersClassName:f,contentClassName:d};return e.jsx(V.TabsContext.Provider,{value:y,children:e.jsxs("div",{id:x,ref:c,className:n,"data-tabs-width":o,"data-variant":s,children:[i&&e.jsx(Ye,{children:i.map(v=>e.jsx(Ze,{value:v.value,children:v.label},v.value))}),u]})})}function Ss({value:r,className:a,children:t,ref:o}){const{selectedValue:s,contentClassName:n}=V.useTabsContext(),i=s===r;return i?e.jsx("div",{ref:o,role:"tabpanel",id:`tabs-content-${r}`,"aria-labelledby":`tabs-trigger-${r}`,"data-state":i?"active":"inactive","data-value":r,className:w.join("mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2",n,a),tabIndex:0,children:t}):null}const Fs={sm:{container:"h-5 min-w-9 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{container:"h-6 min-w-11 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{container:"h-7 min-w-13 w-13",thumb:"h-6 w-6",translate:"translate-x-6"}},Is={default:{unchecked:"bg-muted-foreground",checked:"bg-primary"},success:{unchecked:"bg-muted-foreground",checked:"bg-success"},destructive:{unchecked:"bg-muted-foreground",checked:"bg-destructive"}},$e={variant:"default",size:"md"};function As({ref:r,id:a,size:t=$e.size,variant:o=$e.variant,checked:s,onCheckedChange:n,disabled:i=!1,className:u,thumbClassName:c,backgroundClassNames:x,...f}){const d=l.useId(),h=l.useMemo(()=>a||`toggle-${d}`,[a,d]),[m,y]=l.useState(s);l.useEffect(()=>{y(s)},[s]);const v=()=>{if(!i){const E=!m;s===void 0&&y(E),n==null||n(E)}},b=E=>{(E.key===" "||E.key==="Enter")&&(E.preventDefault(),v())},C=Fs[t],p=Is[o],g=w.join("relative inline-flex items-center rounded-full transition-all ease-in-out","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",C.container,m?(x==null?void 0:x.checked)||p.checked:(x==null?void 0:x.unchecked)||p.unchecked,i&&"opacity-50 cursor-not-allowed",!i&&"cursor-pointer",u),j=w.join("absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform ease-in-out",C.thumb,m&&C.translate,c);return e.jsxs("button",{ref:r,id:h,type:"button",role:"switch",tabIndex:0,"aria-checked":m,"aria-disabled":i,disabled:i,onClick:v,onKeyDown:b,className:g,...f,children:[e.jsx("span",{className:j}),e.jsx("span",{className:"sr-only",children:m?"Enabled":"Disabled"})]})}exports.ActionModal=V.ActionModal;exports.Toast=V.Toast;exports.Accordion=Je;exports.AccordionItem=ue;exports.Avatar=mt;exports.Badge=gt;exports.Button=Te;exports.Calendar=Dt;exports.Callout=Ft;exports.Card=At;exports.Carousel=Mt;exports.Checkbox=xe;exports.Clickable=Tt;exports.Code=Lt;exports.CodeBlock=or;exports.Disclosure=lr;exports.Drawer=fr;exports.DropdownMenu=kr;exports.DropdownMenuFactories=Sr;exports.DynamicList=zr;exports.ErrorBoundary=Br;exports.Form=ss;exports.FormFactories=Pr;exports.HelpIcon=ns;exports.Input=Ge;exports.Label=le;exports.LoadingDots=ze;exports.Modal=is;exports.Pagination=us;exports.Panel=hs;exports.Popover=Be;exports.RadioGroup=Ke;exports.RadioGroupItem=fe;exports.RadioInput=Pe;exports.ScrollArea=_e;exports.Select=qe;exports.Separator=gs;exports.Skeleton=ys;exports.Slider=vs;exports.Table=Cs;exports.Tabs=Es;exports.TabsContent=Ss;exports.TabsList=Ye;exports.TabsTrigger=Ze;exports.Textarea=We;exports.Toggle=As;exports.Tooltip=He;
|
|
1
|
+
"use strict";var Qe=Object.defineProperty;var Ue=(r,a,t)=>a in r?Qe(r,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[a]=t;var je=(r,a,t)=>Ue(r,typeof a!="symbol"?a+"":a,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),w=require("./join-BVMUUvyP.cjs"),L=require("./Window-U9c7lCJ4.cjs"),V=require("./Toast-DovlN7GS.cjs"),ee=require("./X-CgjeP2OI.cjs");require("./useTheme-Bdg1t0Zr.cjs");const Xe=require("./useScreenSize-UGyolnfn.cjs"),pe=require("react-dom"),Me=require("./utils.cjs.js");function ue({id:r,title:a,content:t,children:o,className:s="",disabled:n=!1,isOpen:i=!1,onToggle:u,triggerClassName:c="",bodyClassName:x=""}){const f=l.useId(),d=r||`accordion-item-${f}`,h=`${d}-header`,m=`${d}-panel`,y=()=>{!n&&u&&u()},v=b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),y())};return e.jsxs("div",{className:w.join("border-b border-gray-200",n&&"opacity-60 cursor-not-allowed",s),children:[e.jsxs("button",{id:h,type:"button",className:w.join("w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",n?"cursor-not-allowed":"hover:bg-gray-50/10 cursor-pointer",c),"aria-expanded":i,"aria-controls":m,disabled:n,onClick:y,onKeyDown:v,children:[e.jsx("span",{children:a}),e.jsx("span",{className:w.join("transform transition-transform ease-linear",i?"rotate-180":"rotate-0"),"aria-hidden":"true",children:e.jsx(L.ChevronDown,{size:18})})]}),e.jsx("div",{id:m,role:"region","aria-labelledby":h,className:w.join("transition-all ease-linear px-4",i?"max-h-96 opacity-100 overflow-auto py-3":"max-h-0 opacity-0 overflow-hidden",x),children:i&&(o||t)})]})}function Je({id:r,items:a=[],children:t,className:o="",itemClassName:s="",allowMultiple:n=!1,defaultOpenItems:i=[],triggersClassName:u="",bodiesClassName:c=""}){const x=l.useId(),f=r||`accordion-group-${x}`,[d,h]=l.useState(new Set(i)),m=b=>{h(C=>{const p=new Set(C);return p.has(b)?p.delete(b):(n||p.clear(),p.add(b)),p})},y=b=>`${x}-item-${b}`,v=b=>d.has(b);return e.jsxs("div",{id:f,className:o,children:[a.length>0&&a.map((b,C)=>{const p=b.id||y(C);return e.jsx(ue,{id:p,title:b.title,content:b.content,disabled:b.disabled,isOpen:v(p),onToggle:()=>m(p),className:s,triggerClassName:u,bodyClassName:c},p)}),a.length===0&&t&&l.Children.map(t,(b,C)=>{if(l.isValidElement(b)&&b.type===ue){const p=b.props.id||y(C);return l.createElement(ue,{...b.props,key:p,id:p,className:w.join(s,b.props.className),isOpen:v(p),onToggle:()=>m(p),triggerClassName:w.join(u,b.props.triggerClassName),bodyClassName:w.join(c,b.props.bodyClassName)})}return null})]})}function Oe({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"40",r:"32",fill:"url(#astronautHelmet)",stroke:"#4F46E5",strokeWidth:"2"}),e.jsx("circle",{cx:"50",cy:"40",r:"24",fill:"#FED7AA"}),e.jsx("circle",{cx:"43",cy:"36",r:"3",fill:"#1F2937"}),e.jsx("circle",{cx:"57",cy:"36",r:"3",fill:"#1F2937"}),e.jsx("path",{d:"M46 46 Q50 50 54 46",stroke:"#1F2937",strokeWidth:"2",fill:"none"}),e.jsx("rect",{x:"38",y:"65",width:"24",height:"30",rx:"12",fill:"#E5E7EB"}),e.jsx("rect",{x:"44",y:"70",width:"12",height:"8",rx:"2",fill:"#6366F1"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"astronautHelmet",cx:"50%",cy:"30%",r:"70%",children:[e.jsx("stop",{stopColor:"#DBEAFE"}),e.jsx("stop",{offset:"1",stopColor:"#93C5FD"})]})})]})}function et({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"url(#moonGradient)"}),e.jsx("circle",{cx:"38",cy:"35",r:"4",fill:"#D1D5DB"}),e.jsx("circle",{cx:"65",cy:"42",r:"3",fill:"#D1D5DB"}),e.jsx("circle",{cx:"42",cy:"65",r:"5",fill:"#D1D5DB"}),e.jsx("circle",{cx:"45",cy:"45",r:"2.5",fill:"#1F2937"}),e.jsx("circle",{cx:"58",cy:"45",r:"2.5",fill:"#1F2937"}),e.jsx("path",{d:"M47 55 Q52 60 57 55",stroke:"#1F2937",strokeWidth:"2",fill:"none"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"moonGradient",cx:"30%",cy:"30%",r:"80%",children:[e.jsx("stop",{stopColor:"#F9FAFB"}),e.jsx("stop",{offset:"1",stopColor:"#E5E7EB"})]})})]})}function tt({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("path",{d:"M50 15 L58 38 L82 38 L64 52 L72 75 L50 61 L28 75 L36 52 L18 38 L42 38 Z",fill:"url(#starGradient)"}),e.jsx("circle",{cx:"44",cy:"42",r:"2",fill:"#1F2937"}),e.jsx("circle",{cx:"56",cy:"42",r:"2",fill:"#1F2937"}),e.jsx("path",{d:"M46 50 Q50 54 54 50",stroke:"#1F2937",strokeWidth:"2",fill:"none"}),e.jsx("circle",{cx:"65",cy:"25",r:"1.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"35",cy:"30",r:"1",fill:"#FCD34D"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"starGradient",cx:"50%",cy:"40%",r:"60%",children:[e.jsx("stop",{stopColor:"#FEF3C7"}),e.jsx("stop",{offset:"1",stopColor:"#FCD34D"})]})})]})}function rt({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"38",fill:"url(#galaxyGradient)"}),e.jsx("path",{d:"M20 50 Q35 30 50 50 Q65 70 80 50",stroke:"#8B5CF6",strokeWidth:"3",opacity:"0.7"}),e.jsx("path",{d:"M50 20 Q70 35 50 50 Q30 65 50 80",stroke:"#A78BFA",strokeWidth:"2",opacity:"0.5"}),e.jsx("circle",{cx:"50",cy:"50",r:"12",fill:"#1E1B4B"}),e.jsx("circle",{cx:"46",cy:"47",r:"1.5",fill:"#E0E7FF"}),e.jsx("circle",{cx:"54",cy:"47",r:"1.5",fill:"#E0E7FF"}),e.jsx("path",{d:"M47 53 Q50 56 53 53",stroke:"#E0E7FF",strokeWidth:"1.5",fill:"none"}),e.jsx("circle",{cx:"30",cy:"25",r:"1",fill:"#FFF"}),e.jsx("circle",{cx:"75",cy:"70",r:"1.5",fill:"#FFF"}),e.jsx("circle",{cx:"25",cy:"75",r:"1",fill:"#FFF"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"galaxyGradient",cx:"50%",cy:"50%",r:"70%",children:[e.jsx("stop",{stopColor:"#4C1D95"}),e.jsx("stop",{offset:"0.5",stopColor:"#7C3AED"}),e.jsx("stop",{offset:"1",stopColor:"#1E1B4B"})]})})]})}function st({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("ellipse",{cx:"50",cy:"50",rx:"35",ry:"30",fill:"url(#nebulaGradient)",opacity:"0.8"}),e.jsx("ellipse",{cx:"40",cy:"45",rx:"20",ry:"25",fill:"url(#nebulaPink)",opacity:"0.6"}),e.jsx("ellipse",{cx:"60",cy:"55",rx:"25",ry:"20",fill:"url(#nebulaBlue)",opacity:"0.6"}),e.jsx("circle",{cx:"50",cy:"50",r:"15",fill:"#312E81",opacity:"0.9"}),e.jsx("circle",{cx:"46",cy:"47",r:"2",fill:"#E0E7FF"}),e.jsx("circle",{cx:"54",cy:"47",r:"2",fill:"#E0E7FF"}),e.jsx("path",{d:"M47 53 Q50 56 53 53",stroke:"#E0E7FF",strokeWidth:"1.5",fill:"none"}),e.jsx("circle",{cx:"25",cy:"30",r:"1",fill:"#FFF",opacity:"0.9"}),e.jsx("circle",{cx:"75",cy:"25",r:"1.5",fill:"#FFF",opacity:"0.8"}),e.jsx("circle",{cx:"30",cy:"75",r:"1",fill:"#FFF",opacity:"0.9"}),e.jsx("circle",{cx:"70",cy:"75",r:"1.5",fill:"#FFF",opacity:"0.7"}),e.jsxs("defs",{children:[e.jsxs("radialGradient",{id:"nebulaGradient",cx:"50%",cy:"50%",r:"70%",children:[e.jsx("stop",{stopColor:"#7C3AED"}),e.jsx("stop",{offset:"1",stopColor:"#312E81"})]}),e.jsxs("radialGradient",{id:"nebulaPink",cx:"50%",cy:"50%",r:"70%",children:[e.jsx("stop",{stopColor:"#F472B6"}),e.jsx("stop",{offset:"1",stopColor:"#BE185D"})]}),e.jsxs("radialGradient",{id:"nebulaBlue",cx:"50%",cy:"50%",r:"70%",children:[e.jsx("stop",{stopColor:"#3B82F6"}),e.jsx("stop",{offset:"1",stopColor:"#1E40AF"})]})]})]})}function nt({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"32",fill:"url(#planetGradient)"}),e.jsx("ellipse",{cx:"50",cy:"50",rx:"45",ry:"8",fill:"none",stroke:"#A78BFA",strokeWidth:"2",opacity:"0.7"}),e.jsx("circle",{cx:"38",cy:"40",r:"5",fill:"#065F46",opacity:"0.6"}),e.jsx("circle",{cx:"62",cy:"45",r:"4",fill:"#065F46",opacity:"0.6"}),e.jsx("circle",{cx:"45",cy:"62",r:"3",fill:"#065F46",opacity:"0.6"}),e.jsx("circle",{cx:"46",cy:"48",r:"2.5",fill:"#1F2937"}),e.jsx("circle",{cx:"54",cy:"48",r:"2.5",fill:"#1F2937"}),e.jsx("path",{d:"M47 55 Q50 58 53 55",stroke:"#1F2937",strokeWidth:"2",fill:"none"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"planetGradient",cx:"30%",cy:"30%",r:"80%",children:[e.jsx("stop",{stopColor:"#A7F3D0"}),e.jsx("stop",{offset:"0.6",stopColor:"#34D399"}),e.jsx("stop",{offset:"1",stopColor:"#059669"})]})})]})}function at({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"55",r:"28",fill:"url(#catGradient)"}),e.jsx("path",{d:"M28 40 L38 25 L42 45 Z",fill:"#6366F1"}),e.jsx("path",{d:"M58 45 L62 25 L72 40 Z",fill:"#6366F1"}),e.jsx("path",{d:"M32 38 L36 30 L38 40 Z",fill:"#EC4899"}),e.jsx("path",{d:"M62 40 L64 30 L68 38 Z",fill:"#EC4899"}),e.jsx("ellipse",{cx:"43",cy:"50",rx:"4",ry:"6",fill:"#FCD34D"}),e.jsx("ellipse",{cx:"57",cy:"50",rx:"4",ry:"6",fill:"#FCD34D"}),e.jsx("ellipse",{cx:"43",cy:"52",rx:"1.5",ry:"4",fill:"#1F2937"}),e.jsx("ellipse",{cx:"57",cy:"52",rx:"1.5",ry:"4",fill:"#1F2937"}),e.jsx("path",{d:"M48 58 L50 60 L52 58 Z",fill:"#EC4899"}),e.jsx("path",{d:"M50 60 Q46 64 42 62",stroke:"#1F2937",strokeWidth:"1.5",fill:"none"}),e.jsx("path",{d:"M50 60 Q54 64 58 62",stroke:"#1F2937",strokeWidth:"1.5",fill:"none"}),e.jsx("line",{x1:"25",y1:"55",x2:"35",y2:"57",stroke:"#1F2937",strokeWidth:"1"}),e.jsx("line",{x1:"65",y1:"57",x2:"75",y2:"55",stroke:"#1F2937",strokeWidth:"1"}),e.jsx("circle",{cx:"20",cy:"25",r:"1.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"80",cy:"30",r:"1",fill:"#FCD34D"}),e.jsx("circle",{cx:"15",cy:"70",r:"1",fill:"#FCD34D"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"catGradient",cx:"50%",cy:"40%",r:"70%",children:[e.jsx("stop",{stopColor:"#A78BFA"}),e.jsx("stop",{offset:"1",stopColor:"#6366F1"})]})})]})}function ot({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"35",cy:"55",r:"18",fill:"url(#cloudGradient)"}),e.jsx("circle",{cx:"55",cy:"50",r:"22",fill:"url(#cloudGradient)"}),e.jsx("circle",{cx:"45",cy:"65",r:"15",fill:"url(#cloudGradient)"}),e.jsx("circle",{cx:"65",cy:"60",r:"16",fill:"url(#cloudGradient)"}),e.jsx("circle",{cx:"48",cy:"52",r:"2.5",fill:"#6366F1"}),e.jsx("circle",{cx:"56",cy:"52",r:"2.5",fill:"#6366F1"}),e.jsx("path",{d:"M49 58 Q52 62 55 58",stroke:"#6366F1",strokeWidth:"2",fill:"none"}),e.jsx("circle",{cx:"70",cy:"35",r:"3",fill:"rgba(167, 139, 250, 0.3)",stroke:"#A78BFA"}),e.jsx("circle",{cx:"78",cy:"28",r:"2",fill:"rgba(167, 139, 250, 0.3)",stroke:"#A78BFA"}),e.jsx("circle",{cx:"83",cy:"20",r:"1.5",fill:"rgba(167, 139, 250, 0.3)",stroke:"#A78BFA"}),e.jsx("circle",{cx:"70",cy:"35",r:"0.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"78",cy:"28",r:"0.5",fill:"#FCD34D"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"cloudGradient",cx:"50%",cy:"40%",r:"70%",children:[e.jsx("stop",{stopColor:"#F8FAFC"}),e.jsx("stop",{offset:"1",stopColor:"#E2E8F0"})]})})]})}function lt({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("ellipse",{cx:"50",cy:"45",rx:"15",ry:"30",fill:"url(#rocketGradient)"}),e.jsx("path",{d:"M35 20 L50 10 L65 20 L50 25 Z",fill:"#EF4444"}),e.jsx("circle",{cx:"50",cy:"35",r:"8",fill:"#DBEAFE",stroke:"#2563EB",strokeWidth:"2"}),e.jsx("circle",{cx:"47",cy:"33",r:"1.5",fill:"#1F2937"}),e.jsx("circle",{cx:"53",cy:"33",r:"1.5",fill:"#1F2937"}),e.jsx("path",{d:"M48 37 Q50 39 52 37",stroke:"#1F2937",strokeWidth:"1",fill:"none"}),e.jsx("path",{d:"M35 60 L25 70 L35 75 Z",fill:"#6B7280"}),e.jsx("path",{d:"M65 60 L75 70 L65 75 Z",fill:"#6B7280"}),e.jsx("ellipse",{cx:"50",cy:"80",rx:"8",ry:"12",fill:"#F59E0B"}),e.jsx("ellipse",{cx:"50",cy:"82",rx:"5",ry:"8",fill:"#EF4444"}),e.jsx("circle",{cx:"25",cy:"20",r:"1",fill:"#FCD34D"}),e.jsx("circle",{cx:"75",cy:"25",r:"1.5",fill:"#FCD34D"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"rocketGradient",cx:"30%",cy:"30%",r:"80%",children:[e.jsx("stop",{stopColor:"#E5E7EB"}),e.jsx("stop",{offset:"1",stopColor:"#9CA3AF"})]})})]})}function it({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"38",fill:"url(#constellationBg)",opacity:"0.8"}),e.jsx("circle",{cx:"35",cy:"25",r:"2",fill:"#FCD34D"}),e.jsx("circle",{cx:"50",cy:"30",r:"2.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"65",cy:"35",r:"2",fill:"#FCD34D"}),e.jsx("circle",{cx:"30",cy:"50",r:"1.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"70",cy:"50",r:"2",fill:"#FCD34D"}),e.jsx("circle",{cx:"40",cy:"70",r:"2.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"60",cy:"75",r:"1.5",fill:"#FCD34D"}),e.jsx("line",{x1:"35",y1:"25",x2:"50",y2:"30",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("line",{x1:"50",y1:"30",x2:"65",y2:"35",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("line",{x1:"30",y1:"50",x2:"50",y2:"30",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("line",{x1:"50",y1:"30",x2:"70",y2:"50",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("line",{x1:"30",y1:"50",x2:"40",y2:"70",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("line",{x1:"70",y1:"50",x2:"60",y2:"75",stroke:"#A78BFA",strokeWidth:"1",opacity:"0.7"}),e.jsx("circle",{cx:"48",cy:"48",r:"2",fill:"#E0E7FF"}),e.jsx("circle",{cx:"52",cy:"48",r:"2",fill:"#E0E7FF"}),e.jsx("path",{d:"M48 54 Q50 56 52 54",stroke:"#E0E7FF",strokeWidth:"1.5",fill:"none"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"constellationBg",cx:"50%",cy:"50%",r:"70%",children:[e.jsx("stop",{stopColor:"#1E1B4B"}),e.jsx("stop",{offset:"1",stopColor:"#0F0D2A"})]})})]})}function ct({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"35",cy:"35",r:"18",fill:"url(#cometGradient)"}),e.jsx("circle",{cx:"31",cy:"31",r:"2",fill:"#1F2937"}),e.jsx("circle",{cx:"39",cy:"31",r:"2",fill:"#1F2937"}),e.jsx("path",{d:"M32 38 Q35 41 38 38",stroke:"#1F2937",strokeWidth:"1.5",fill:"none"}),e.jsx("path",{d:"M50 50 Q65 65 85 85",stroke:"url(#tailGradient1)",strokeWidth:"8",opacity:"0.7"}),e.jsx("path",{d:"M48 52 Q60 68 75 88",stroke:"url(#tailGradient2)",strokeWidth:"6",opacity:"0.5"}),e.jsx("path",{d:"M52 48 Q70 62 90 82",stroke:"url(#tailGradient3)",strokeWidth:"4",opacity:"0.3"}),e.jsx("circle",{cx:"60",cy:"60",r:"1.5",fill:"#FCD34D"}),e.jsx("circle",{cx:"70",cy:"70",r:"1",fill:"#FCD34D"}),e.jsx("circle",{cx:"80",cy:"80",r:"0.8",fill:"#FCD34D"}),e.jsxs("defs",{children:[e.jsxs("radialGradient",{id:"cometGradient",cx:"30%",cy:"30%",r:"80%",children:[e.jsx("stop",{stopColor:"#FEF3C7"}),e.jsx("stop",{offset:"1",stopColor:"#F59E0B"})]}),e.jsxs("linearGradient",{id:"tailGradient1",x1:"50%",y1:"50%",x2:"85%",y2:"85%",children:[e.jsx("stop",{stopColor:"#FCD34D"}),e.jsx("stop",{offset:"1",stopColor:"transparent"})]}),e.jsxs("linearGradient",{id:"tailGradient2",x1:"48%",y1:"52%",x2:"75%",y2:"88%",children:[e.jsx("stop",{stopColor:"#F472B6"}),e.jsx("stop",{offset:"1",stopColor:"transparent"})]}),e.jsxs("linearGradient",{id:"tailGradient3",x1:"52%",y1:"48%",x2:"90%",y2:"82%",children:[e.jsx("stop",{stopColor:"#A78BFA"}),e.jsx("stop",{offset:"1",stopColor:"transparent"})]})]})]})}function dt({size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 100 100",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"url(#twilightGradient)"}),e.jsx("ellipse",{cx:"50",cy:"65",rx:"25",ry:"15",fill:"#1F2937",opacity:"0.8"}),e.jsx("circle",{cx:"30",cy:"25",r:"1.5",fill:"#FFF"}),e.jsx("circle",{cx:"70",cy:"30",r:"1",fill:"#FFF"}),e.jsx("circle",{cx:"40",cy:"35",r:"1.2",fill:"#FFF"}),e.jsx("circle",{cx:"60",cy:"25",r:"0.8",fill:"#FFF"}),e.jsx("path",{d:"M20 40 Q15 35 20 30 Q25 35 20 40",fill:"#FCD34D"}),e.jsx("circle",{cx:"47",cy:"62",r:"1.5",fill:"#E0E7FF"}),e.jsx("circle",{cx:"53",cy:"62",r:"1.5",fill:"#E0E7FF"}),e.jsx("path",{d:"M48 67 Q50 69 52 67",stroke:"#E0E7FF",strokeWidth:"1",fill:"none"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"twilightGradient",cx:"50%",cy:"30%",r:"80%",children:[e.jsx("stop",{stopColor:"#7C3AED"}),e.jsx("stop",{offset:"0.7",stopColor:"#3730A3"}),e.jsx("stop",{offset:"1",stopColor:"#1E1B4B"})]})})]})}const ut={astronaut:Oe,moon:et,star:tt,galaxy:rt,nebula:st,planet:nt,"cosmic-cat":at,"dream-cloud":ot,rocket:lt,constellation:it,comet:ct,twilight:dt},ft={xs:{size:"w-8 h-8",iconSize:"24"},sm:{size:"w-10 h-10",iconSize:"32"},md:{size:"w-12 h-12",iconSize:"40"},lg:{size:"w-16 h-16",iconSize:"56"},xl:{size:"w-20 h-20",iconSize:"72"},"2xl":{size:"w-24 h-24",iconSize:"88"}},xt={circle:"rounded-full",square:"rounded-lg"};function mt({id:r,ref:a,size:t="md",shape:o="circle",preset:s,alt:n,className:i,src:u,initials:c,...x}){const f=ft[t],d=xt[o],h=s?ut[s]:null;return e.jsx("div",{id:r,ref:a,className:w.join("relative inline-flex items-center justify-center overflow-hidden bg-gray-100 border-2 border-border",f.size,d,i),"data-size":t,"data-shape":o,"data-preset":s,role:"img","aria-label":n||`Avatar ${s?`of ${s}`:""}`,...x,children:u?e.jsx("img",{src:u,alt:n||"User avatar",className:"w-full h-full object-cover"}):h?e.jsx(h,{size:f.iconSize}):c?e.jsx("span",{className:"text-gray-600 font-medium text-sm",children:c.slice(0,2).toUpperCase()}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-gray-300 to-gray-400"})})}const ht={decorative:{"aria-hidden":!0},status:{role:"status"},alert:{role:"alert"}},pt={base:"",primary:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",accent:"bg-accent text-accent-foreground",destructive:"bg-destructive text-destructive-foreground",success:"bg-success text-success-foreground",warning:"bg-warning text-warning-foreground",muted:"bg-muted text-muted-foreground"},bt={base:"",primary:"border border-primary bg-transparent text-primary",secondary:"border border-secondary bg-transparent text-secondary",accent:"border border-accent bg-transparent text-accent",destructive:"border border-destructive bg-transparent text-destructive",success:"border border-success bg-transparent text-success",warning:"border border-warning bg-transparent text-warning",muted:"border border-muted-foreground bg-transparent text-muted-foreground"},be={xs:{text:"text-xs",aspectSquare:"p-1",aspectVideo:"px-2 py-0.5"},sm:{text:"text-sm",aspectSquare:"p-1.5",aspectVideo:"px-2.5 py-1"},md:{text:"text-base",aspectSquare:"p-2",aspectVideo:"px-3 py-1.5"}};function gt({id:r,ref:a,variant:t="muted",outline:o=!1,children:s,className:n,aspect:i="video",use:u="decorative",size:c="xs",...x}){return e.jsx("span",{id:r,ref:a,className:w.join("font-medium rounded-full inline-flex select-none",be[c].text,i==="square"&&be[c].aspectSquare,i==="video"&&be[c].aspectVideo,o?bt[t]:pt[t],n),"data-variant":t,"data-outline":o,"data-aspect":i,"data-use":u,"data-size":c,...ht[u],...x,children:s})}function ze(){const[r,a]=l.useState(0);return l.useEffect(()=>{const t=setInterval(()=>{a(o=>(o+1)%3)},500);return()=>clearInterval(t)},[]),e.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(t=>e.jsx("div",{className:w.join("rounded-full transition-all ease-in-out size-[0.35em] bg-current",r===t&&"transform -translate-y-1")},t))})}const yt={base:"focus:outline-current",primary:"bg-primary text-primary-foreground hover:bg-primary/80 focus:outline-primary outline-offset-2 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 focus:outline-secondary outline-offset-2 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary/80 disabled:text-muted-foreground focus:outline-primary",outline:"border border-primary text-primary hover:border-primary/80 hover:text-primary/80 focus:outline-primary outline-offset-2 disabled:border-muted-foreground disabled:text-muted-foreground",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted-foreground focus:outline-current",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80 focus:outline-destructive outline-offset-2 disabled:bg-muted disabled:text-muted-foreground"},vt={stripped:"",fitted:"size-fit leading-0",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},jt={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},ge={variant:"primary",size:"md",rounded:"md"};function Te({variant:r=ge.variant,size:a,rounded:t=ge.rounded,loading:o,className:s,...n}){let i;r==="link"&&!a?i="fitted":i=a||ge.size;const c=w.join("appearance-none not-disabled:hover:cursor-pointer outline outline-transparent disabled:opacity-50 disabled:cursor-not-allowed transition-all",yt[r],vt[i],jt[t],o&&"relative pointer-events-none",s);if(n.href&&!n.disabled)return e.jsx("a",{...n,rel:n.rel?n.rel:n.target==="_blank"?"noopener noreferrer":void 0,"aria-label":n["aria-label"],"aria-description":n["aria-description"],href:n.href,className:c,children:n.children});const x=n,f=()=>x.children?typeof x.children=="string"||typeof x.children=="number"||typeof x.children=="boolean"?e.jsx("span",{className:w.join(o&&"invisible"),children:x.children}):l.Children.map(x.children,(h,m)=>{if(l.isValidElement(h)){const y=h.props;return l.cloneElement(h,{key:m,className:w.join(o&&"invisible",y.className)})}return h}):null;return e.jsxs("button",{...x,"aria-label":x["aria-label"],"aria-description":x["aria-description"],"aria-disabled":x.disabled||o,"aria-busy":o,type:x.type??"button",className:c,children:[o&&e.jsx(ze,{}),f()]})}function wt(r={}){const{initialDate:a=new Date,mode:t="single",minDate:o,maxDate:s,view:n="month",onDateSelect:i,onRangeSelect:u}=r,[c,x]=l.useState({currentDate:a,selectedDate:t==="single"?a:null,selectedRange:null,view:n}),f=l.useCallback(N=>!!(o&&N<o||s&&N>s),[o,s]),d=l.useCallback(N=>{f(N)||(t==="single"?(x(D=>({...D,selectedDate:N})),i==null||i(N)):t==="range"&&x(D=>{const{selectedRange:A}=D;if(!(A!=null&&A.start)||A.start&&A.end){const M={start:N,end:null};return u==null||u(M),{...D,selectedRange:M}}else{const M=A.start,$=N,I={start:M<$?M:$,end:M<$?$:M};return u==null||u(I),{...D,selectedRange:I}}}))},[t,f,i,u]),h=l.useCallback(N=>{x(D=>{const A=new Date(D.currentDate);return N==="prev"?A.setMonth(A.getMonth()-1):A.setMonth(A.getMonth()+1),{...D,currentDate:A}})},[]),m=l.useCallback(N=>{x(D=>{const A=new Date(D.currentDate),M=N==="prev"?-7:7;return A.setDate(A.getDate()+M),{...D,currentDate:A}})},[]),y=l.useCallback(N=>{x(D=>{const A=new Date(D.currentDate),M=N==="prev"?-1:1;return A.setDate(A.getDate()+M),{...D,currentDate:A}})},[]),v=l.useCallback(N=>{c.view==="month"?h(N):c.view==="week"?m(N):y(N)},[c.view,h,m,y]),b=l.useCallback(N=>{x(D=>({...D,view:N}))},[]),C=l.useCallback(N=>{x(D=>({...D,currentDate:N}))},[]),p=l.useCallback(N=>{x(D=>{const A=new Date(D.currentDate);return A.setMonth(N),{...D,currentDate:A}})},[]),g=l.useCallback(N=>{x(D=>{const A=new Date(D.currentDate);return A.setFullYear(N),{...D,currentDate:A}})},[]),j=l.useMemo(()=>{const{currentDate:N,view:D}=c,A=[];if(D==="month"){const M=new Date(N.getFullYear(),N.getMonth(),1),$=new Date(M);$.setDate($.getDate()-M.getDay());for(let I=0;I<42;I++){const R=new Date($);R.setDate(R.getDate()+I),A.push(R)}}else if(D==="week"){const M=new Date(N);M.setDate(N.getDate()-N.getDay());for(let $=0;$<7;$++){const I=new Date(M);I.setDate(I.getDate()+$),A.push(I)}}else A.push(new Date(N));return A},[c]),E=l.useCallback(N=>{if(t==="single")return c.selectedDate&&N.toDateString()===c.selectedDate.toDateString();if(t==="range"&&c.selectedRange){const{start:D,end:A}=c.selectedRange;if(D&&A)return N>=D&&N<=A;if(D)return N.toDateString()===D.toDateString()}return!1},[t,c.selectedDate,c.selectedRange]),z=l.useCallback(N=>{var D,A;if(t==="range"&&((D=c.selectedRange)!=null&&D.start)&&((A=c.selectedRange)!=null&&A.end)){const{start:M,end:$}=c.selectedRange;return N>M&&N<$}return!1},[t,c.selectedRange]),k=l.useCallback(N=>{var D;return t==="range"&&((D=c.selectedRange)!=null&&D.start)?N.toDateString()===c.selectedRange.start.toDateString():!1},[t,c.selectedRange]),F=l.useCallback(N=>{var D;return t==="range"&&((D=c.selectedRange)!=null&&D.end)?N.toDateString()===c.selectedRange.end.toDateString():!1},[t,c.selectedRange]);return{currentDate:c.currentDate,selectedDate:c.selectedDate,selectedRange:c.selectedRange,view:c.view,daysInView:j,selectDate:d,navigate:v,changeView:b,goToDate:C,changeMonth:p,changeYear:g,isDateSelected:E,isDateDisabled:f,isDateInRange:z,isDateRangeStart:k,isDateRangeEnd:F}}const kt={small:{container:"text-xs",cell:"w-7 h-7 text-xs",header:"text-sm px-2 py-1",navigation:"p-1",weekdays:"text-xs px-1 py-1"},medium:{container:"text-sm",cell:"w-9 h-9 text-sm",header:"text-base px-3 py-2",navigation:"p-2",weekdays:"text-sm px-2 py-2"},large:{container:"text-base",cell:"w-12 h-12 text-base",header:"text-lg px-4 py-3",navigation:"p-3",weekdays:"text-base px-3 py-2"},auto:{container:"w-full h-full",cell:"flex-1 min-h-[2rem] text-sm",header:"text-base px-3 py-2",navigation:"p-2",weekdays:"text-sm px-2 py-2"}},Ct={month:"grid-cols-7",week:"grid-cols-7",day:"grid-cols-1"},we={size:"medium",view:"month"},Nt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ie=["January","February","March","April","May","June","July","August","September","October","November","December"],ke=100;function Dt({id:r,ref:a,className:t,size:o=we.size,customStyles:s={},view:n=we.view,mode:i="single",initialDate:u,minDate:c,maxDate:x,renderCell:f,showViewSelector:d=!1,showNavigation:h=!0,navigationLayout:m="around",useMonthYearSelector:y=!1,showTodayButton:v=!1,onDateSelect:b,onRangeSelect:C,...p}){const g=wt({initialDate:u,mode:i,minDate:c,maxDate:x,view:n,onDateSelect:b,onRangeSelect:C}),j=kt[o],E=Ct[g.view],z=S=>{const B=new Date;return S.toDateString()===B.toDateString()},k=S=>S.getMonth()===g.currentDate.getMonth()&&S.getFullYear()===g.currentDate.getFullYear(),F=()=>{g.goToDate(new Date)},N=()=>{const{currentDate:S,view:B}=g,Z=ie[S.getMonth()],H=S.getFullYear();if(B==="month")return`${Z} ${H}`;if(B==="week"){const q=new Date(S);q.setDate(S.getDate()-S.getDay());const Y=new Date(q);return Y.setDate(Y.getDate()+6),q.getMonth()===Y.getMonth()?`${Z} ${q.getDate()}-${Y.getDate()}, ${H}`:`${ie[q.getMonth()]} ${q.getDate()} - ${ie[Y.getMonth()]} ${Y.getDate()}, ${H}`}return`${Z} ${S.getDate()}, ${H}`},D=()=>d?e.jsx("div",{className:_,children:["month","week","day"].map(S=>e.jsx("button",{onClick:()=>g.changeView(S),className:w.join("px-2 py-1 rounded capitalize transition-colors",g.view===S?"bg-accent text-accent-foreground":"hover:bg-accent/20"),children:S},S))}):null,A=()=>{if(!y)return null;const S=g.currentDate.getMonth(),B=g.currentDate.getFullYear(),Z=B-ke,H=B+ke,q=[];for(let P=Z;P<=H;P++)q.push(P);const Y=w.join("border border-border rounded px-2 py-1 text-sm focus:outline-none focus:border-accent focus:ring-2 focus:ring-accent/50",s.monthYearSelectorsClassName);return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:S,onChange:P=>g.changeMonth(parseInt(P.target.value)),className:Y,children:ie.map((P,se)=>e.jsx("option",{value:se,children:P},P))}),e.jsx("select",{value:B,onChange:P=>g.changeYear(parseInt(P.target.value)),className:Y,children:q.map(P=>e.jsx("option",{value:P,children:P},P))})]})},M=()=>{if(!v)return null;const S=w.join("px-3 py-1 text-xs rounded border border-border hover:bg-accent/20 transition-colors focus:outline-none focus:ring focus:ring-accent/50",s.todayButtonClassName);return e.jsx("button",{onClick:F,className:S,"aria-label":"Go to today",children:"Today"})},$=S=>{const B=g.isDateSelected(S),Z=g.isDateDisabled(S),H=z(S),q=g.isDateInRange(S),Y=g.isDateRangeStart(S),P=g.isDateRangeEnd(S),se=k(S),ne=w.join("w-full flex items-center justify-center transition-colors cursor-pointer","focus:outline-none",j.cell),W=w.join(!q&&"rounded-md",!B&&"hover:bg-accent/20 focus:bg-accent/20",ne,s.cellClassName,B&&w.join("bg-accent text-accent-foreground",s.selectedCellClassName),q&&w.join("bg-accent/30",s.rangeCellClassName),Y&&w.join("bg-accent text-accent-foreground rounded-r-none",s.rangeStartCellClassName),P&&w.join("bg-accent text-accent-foreground rounded-l-none",s.rangeEndCellClassName),H&&!B&&w.join("border border-accent",s.todayCellClassName),Z&&w.join("opacity-50 cursor-not-allowed hover:bg-transparent",s.disabledCellClassName),g.view==="month"&&!se&&"text-muted-foreground/50"),Q=f?f(S,!!B,Z,H):S.getDate();return e.jsx("button",{onClick:()=>g.selectDate(S),disabled:Z,className:W,"data-date":S.toISOString().split("T")[0],"data-selected":!!B,"data-disabled":Z,"data-today":H,"aria-label":`${S.getDate()} ${ie[S.getMonth()]} ${S.getFullYear()}`,"aria-selected":!!B,"aria-disabled":Z,children:Q},S.toISOString())},I=w.join("bg-background border rounded-lg",j.container,s.containerClassName,t),R=w.join("flex items-center border-b px-4 py-2","justify-between",j.header,s.headerClassName),G=w.join("flex items-center gap-1",s.navigationClassName),K=w.join("p-1 rounded hover:bg-accent/20 transition-colors",j.navigation,s.prevButtonClassName),U=w.join("p-1 rounded hover:bg-accent/20 transition-colors",j.navigation,s.nextButtonClassName),T=w.join("font-semibold text-foreground",s.titleClassName),_=w.join("flex gap-1 text-xs",s.viewSelectorClassName),X=w.join("grid grid-cols-7 border-b text-muted-foreground font-medium",j.weekdays,s.weekdaysClassName),te=w.join("text-center",s.weekdayClassName),re=w.join("grid gap-y-1 p-2",g.view==="month"&&E,g.view==="week"&&w.join(E,s.weekGridClassName),g.view==="day"&&w.join(E,s.dayGridClassName),g.view==="month"&&s.monthGridClassName);return e.jsxs("div",{id:r,ref:a,className:I,"data-size":o,"data-view":g.view,"data-mode":i,role:"application","aria-label":"Calendar",...p,children:[e.jsxs("div",{className:R,children:[m==="adjacent"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4",children:[h&&e.jsxs("div",{className:G,children:[e.jsx("button",{onClick:()=>g.navigate("prev"),className:K,"aria-label":"Previous",children:e.jsx(L.ChevronLeft,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>g.navigate("next"),className:U,"aria-label":"Next",children:e.jsx(L.ChevronRight,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[!y&&e.jsx("h2",{className:T,children:N()}),A()]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[D(),M()]})]}),m==="around"&&e.jsxs(e.Fragment,{children:[h&&e.jsx("button",{onClick:()=>g.navigate("prev"),className:K,"aria-label":"Previous",children:e.jsx(L.ChevronLeft,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[!y&&e.jsx("h2",{className:T,children:N()}),A()]}),e.jsxs("div",{className:"flex items-center gap-2",children:[D(),M()]})]}),h&&e.jsx("button",{onClick:()=>g.navigate("next"),className:U,"aria-label":"Next",children:e.jsx(L.ChevronRight,{className:"w-4 h-4"})})]})]}),(g.view==="month"||g.view==="week")&&e.jsx("div",{className:X,children:Nt.map(S=>e.jsx("div",{className:te,children:S},S))}),e.jsx("div",{className:re,children:g.daysInView.map(S=>$(S))},`${g.currentDate.getFullYear()}-${g.currentDate.getMonth()}-${g.view}`)]})}const Et={info:{border:"border-blue-600",interior:"bg-blue-800/20",core:"text-blue-400",description:"text-blue-200"},destructive:{border:"border-destructive",interior:"bg-destructive/10",core:"text-destructive",description:"text-destructive"},success:{border:"border-success",interior:"bg-success/10",core:"text-success",description:"text-success"},warning:{border:"border-yellow-700",interior:"bg-yellow-800/20",core:"text-yellow-400",description:"text-yellow-200"},base:{border:"",interior:"",core:"",description:"opacity-90"}},St={info:e.jsx(ee.InfoCircled,{size:22}),destructive:e.jsx(ee.CrossCircled,{size:22}),success:e.jsx(L.CheckCircled,{size:22}),warning:e.jsx(ee.ExclamationTriangle,{size:20}),base:e.jsx(L.DeepRing,{size:22})};function Ft({id:r,ref:a,variant:t="base",icon:o,title:s,description:n,className:i,dismissible:u=!1,onDismiss:c}){const x=l.useId(),f=r||`callout-${x}`,[d,h]=l.useState(!1),m=Et[t],y=St[t],v=()=>{h(!0),c&&c()};return d?null:e.jsxs("div",{id:f,ref:a,className:w.join("relative rounded-lg p-2 sm:p-4 border",m.border,m.interior,i),"data-variant":t,role:"note","aria-describedby":n?`${f}-description`:void 0,"aria-labelledby":s?`${f}-title`:void 0,children:[e.jsxs("div",{className:"flex items-start gap-x-2",children:[o!==null&&e.jsx("span",{className:m.core,children:o===void 0?y:o}),(s||n)&&e.jsxs("div",{className:"flex-1",children:[s&&e.jsx("div",{id:`${f}-title`,className:w.join("font-medium",m.core),children:s}),n&&e.jsx("div",{id:`${f}-description`,className:w.join("mt-0.5 font-light",m.description),children:n})]})]}),u&&e.jsx("button",{type:"button",onClick:v,"data-callout-close-button":"true",className:w.join(m.core,"rounded-md p-0.5 top-2.5 right-2.5 absolute focus:outline-none hover:ring focus:ring-2 focus:ring-current leading-0"),"aria-label":"Close callout",children:e.jsx(ee.X,{size:18})})]})}const It={sm:{container:"text-sm",header:"text-base font-medium",content:"text-sm leading-relaxed",footer:"text-xs",paddingMulti:1/3},md:{container:"text-base",header:"text-lg font-semibold",content:"text-base leading-relaxed",footer:"text-sm",paddingMulti:1/2},lg:{container:"text-lg",header:"text-xl font-bold",content:"text-lg leading-relaxed",footer:"text-base",paddingMulti:1}};function At({id:r,className:a,ref:t,size:o="md",padding:s=16,header:n,footer:i,children:u,imageSrc:c,imageAlt:x,imageComponent:f,imageToEdge:d=!0,...h}){const m=It[o],y=c||f;return e.jsxs("div",{id:r,ref:t,"data-testid":"card","data-size":o,"data-padding":s,className:w.join("border border-border rounded-lg shadow-sm","w-full max-w-full",m.container,a),...h,children:[y&&e.jsx("div",{style:d?void 0:{padding:s,paddingBottom:0},className:"w-full overflow-hidden",children:f||e.jsx("img",{src:c,alt:x||"",className:"w-full h-auto object-cover rounded-xs",loading:"lazy"})}),e.jsxs("div",{style:{padding:s,rowGap:s*m.paddingMulti},className:"flex flex-col",children:[n&&e.jsx("div",{className:m.header,children:n}),u&&e.jsx("div",{className:m.content,children:u}),i&&e.jsx("div",{className:m.footer,children:i})]})]})}function $t({totalItems:r,itemsToShow:a,infinite:t,autoScroll:o,scrollInterval:s,pauseScrollOnHover:n,currentIndex:i,onIndexChange:u}){const[c,x]=l.useState(i||0),[f,d]=l.useState(!1),h=l.useRef(null),m=Math.ceil(r/a),y=t||c>0,v=t||c<m-1,b=l.useCallback(g=>{const j=Math.max(0,Math.min(g,m-1));x(j),u==null||u(j)},[m,u]),C=l.useCallback(()=>{if(y){const g=c===0&&t?m-1:c-1;b(g)}},[c,y,t,m,b]),p=l.useCallback(()=>{if(v){const g=c===m-1&&t?0:c+1;b(g)}},[c,v,t,m,b]);return l.useEffect(()=>{i!==void 0&&i!==c&&x(i)},[i,c]),l.useEffect(()=>{if(!o)return;const g=()=>{h.current=setInterval(()=>{n&&f||p()},s)},j=()=>{h.current&&(clearInterval(h.current),h.current=null)};return!f||!n?g():j(),j},[o,s,n,f,p]),l.useEffect(()=>{x(0)},[a]),{currentSlide:c,canGoPrev:y,canGoNext:v,goToPrev:C,goToNext:p,goToSlide:b,isHovered:f,setIsHovered:d}}const ce={sm:{button:"h-6 w-6 text-xs",icon:"size-3"},md:{button:"h-8 w-8 text-sm",icon:"size-4"},lg:{button:"h-10 w-10 text-lg",icon:"size-5"}},Ce={default:"bg-accent text-accent-foreground hover:bg-accent-foreground hover:text-accent",outline:"border border-border bg-background hover:bg-accent hover:text-accent-foreground hover:border-accent",ghost:"hover:text-accent"},de={aligned:{prev:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",next:"absolute right-0 top-1/2 translate-x-1/2 -translate-y-1/2 z-10"},exterior:{prev:"absolute -left-10 top-1/2 -translate-y-1/2 z-10",next:"absolute -right-10 top-1/2 -translate-y-1/2 z-10"},interior:{prev:"absolute left-2 top-1/2 -translate-y-1/2 z-10",next:"absolute right-2 top-1/2 -translate-y-1/2 z-10"}};function Mt({children:r,id:a,ref:t,className:o,autoScroll:s=!1,scrollInterval:n=3e3,pauseScrollOnHover:i=!0,currentIndex:u,onIndexChange:c,hidePrevNext:x=!1,hideDots:f=!1,itemsToShow:d=1,buttonSize:h="md",buttonVariant:m="default",buttonPosition:y="exterior",infinite:v=!0,prevButton:b,nextButton:C,itemsClassName:p,containerClassName:g,dotsClassName:j,gap:E=8}){var B,Z;const z=l.useRef(null),k=l.Children.toArray(r).filter(l.isValidElement),F=k.length,{screenSize:N}=Xe.useScreenSize(),D=l.useMemo(()=>{if(typeof d=="number")return d;if(typeof d=="object"&&d&&N){const H=["2xl","xl","lg","md","sm","xs"],q=H.indexOf(N);for(let Y=q;Y<H.length;Y++){const P=H[Y];if(d[P]!==void 0)return d[P]}}return 1},[d,N]),{currentSlide:A,canGoPrev:M,canGoNext:$,goToPrev:I,goToNext:R,goToSlide:G,setIsHovered:K}=$t({totalItems:F,itemsToShow:D,infinite:v,autoScroll:s,scrollInterval:n,pauseScrollOnHover:i,currentIndex:u,onIndexChange:c}),U=l.useCallback(H=>{if(D===1)return{leftWidth:0,rightWidth:0,widthReduction:0};const q=E*(D-1)/D;return H%D===0?{leftWidth:0,rightWidth:E/2,widthReduction:q}:H%D===D-1?{leftWidth:E/2,rightWidth:0,widthReduction:q}:{leftWidth:E/2,rightWidth:E/2,widthReduction:q}},[D,E]),T=()=>{I()},_=()=>{R()},X=()=>{i&&K(!0)},te=()=>{i&&K(!1)},re=-(A*(100/F)*D),S=w.join("inline-flex items-center justify-center rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring focus-visible:ring-ring disabled:pointer-events-none",y==="aligned"?"disabled:opacity-90":"disabled:opacity-50");return e.jsxs("div",{className:w.join("relative",o),"data-carousel-wrapper":"true",children:[!x&&e.jsx(e.Fragment,{children:b?l.cloneElement(b,{onClick:T,disabled:!M,className:w.join(((B=b.props)==null?void 0:B.className)||"",de[y].prev),role:"button","aria-disabled":!M,"aria-label":"Previous slide","data-carousel-prev":"true"}):e.jsx("button",{type:"button",onClick:T,disabled:!M,className:w.join(S,ce[h].button,Ce[m],de[y].prev),"aria-disabled":!M,"aria-label":"Previous slide","data-carousel-prev":"true",children:e.jsx(L.ChevronLeft,{className:ce[h].icon})})}),e.jsxs("div",{id:a,ref:t,className:w.join("relative overflow-hidden",g),onMouseEnter:X,onMouseLeave:te,"data-carousel":"true","data-current-index":A,"data-items-to-show":D,"data-auto-scroll":s,"data-button-position":y,children:[e.jsx("div",{ref:z,className:"flex transition-transform ease-in-out",style:{transform:`translateX(${re}%)`,width:`${F/D*100}%`},children:k.map((H,q)=>{const{leftWidth:Y,rightWidth:P,widthReduction:se}=U(q);return e.jsx("div",{className:w.join("flex-shrink-0",p),style:{width:`calc(${100/F}% - ${se}px)`,marginRight:P>0?`${P}px`:void 0,marginLeft:Y>0?`${Y}px`:void 0},"data-slide-index":q,children:H},q)})}),!f&&e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2",children:Array.from({length:Math.ceil(F/D)}).map((H,q)=>e.jsx("button",{type:"button",onClick:()=>G(q),className:w.join("w-2 h-2 rounded-full transition-colors",q===A?"bg-accent":"bg-muted-foreground/60 hover:bg-muted-foreground/100",j),"aria-label":`Go to slide ${q+1}`,"data-carousel-dot":q},q))})]}),!x&&e.jsx(e.Fragment,{children:C?l.cloneElement(C,{onClick:_,disabled:!$,className:w.join(((Z=C.props)==null?void 0:Z.className)||"",de[y].next),role:"button","aria-disabled":!$,"aria-label":"Next slide","data-carousel-next":"true"}):e.jsx("button",{type:"button",onClick:_,disabled:!$,className:w.join(S,ce[h].button,Ce[m],de[y].next),"aria-disabled":!$,"aria-label":"Next slide","data-carousel-next":"true",children:e.jsx(L.ChevronRight,{className:ce[h].icon})})})]})}function zt(r){const[a,t]=l.useState(""),o=l.useCallback(s=>{let n=s,i="";for(;n&&!i;){const u=window.getComputedStyle(n).backgroundColor;u&&u!=="transparent"&&u!=="rgba(0, 0, 0, 0)"&&(i=u),n=n.parentElement}return i||"transparent"},[]);return l.useEffect(()=>{const s=document.getElementById(r);if(s){const n=o(s.parentElement);t(n)}},[r,o]),a}function xe({ref:r,id:a,size:t=20,color:o,filled:s=!1,rounded:n=!0,checked:i=!1,indeterminate:u=!1,onCheckedChange:c,disabled:x,className:f="",display:d="inline",...h}){const m=l.useId(),y=l.useMemo(()=>a||`checkbox-${m}`,[a,m]),v=zt(y),[b,C]=l.useState(i),[p,g]=l.useState(u);l.useEffect(()=>{C(i)},[i]),l.useEffect(()=>{g(u)},[u]);const j=()=>{if(!x){const k=p?!0:!b;C(k),g(!1),c==null||c(k)}},E=k=>{k.key===" "&&(k.preventDefault(),j())},z=w.join("items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",d==="inline"?"inline-flex":"flex",n&&"rounded",x&&"opacity-40 cursor-not-allowed",!x&&"cursor-pointer",f);return e.jsx("button",{id:y,type:"button",ref:r,tabIndex:0,role:"checkbox",onClick:j,"aria-checked":p?"mixed":b,"aria-disabled":x,onKeyDownCapture:E,style:{width:t,height:t,color:o,backgroundColor:(b||p)&&s?"currentcolor":"transparent"},className:z,...h,children:p?e.jsx(L.Dash,{size:t,color:s?v:void 0}):e.jsx(L.Check,{size:t,color:s?v:void 0,className:b?"opacity-100":"opacity-0"})})}function Tt({children:r,className:a,linkTo:t,linkProps:o,onButtonClick:s,buttonProps:n,...i}){return t&&s&&console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'),e.jsxs("div",{className:w.join("relative w-fit",a),...i,children:[r,t&&e.jsx("a",{...o,rel:(o==null?void 0:o.rel)||"noreferrer",href:t,className:w.join("absolute inset-0",o==null?void 0:o.className)}),!t&&s&&e.jsx("button",{...n,type:"button",onClick:s,className:w.join("absolute inset-0 cursor-pointer",n==null?void 0:n.className)})]})}function Rt(r){const[a,t]=l.useState(null);return l.useEffect(()=>{var u;const o=(u=document.getElementById(r))==null?void 0:u.parentElement;if(!o)return;const s=()=>{const c=window.getComputedStyle(o),x=parseFloat(c.fontSize),f=c.lineHeight==="normal"?x*1.2:parseFloat(c.lineHeight),d=x-2,h=d/x,m=f*h;t({fontSize:x,lineHeight:f,smallerFontSize:d,smallerLineHeight:m})};s();const n=new ResizeObserver(s);n.observe(o);const i=new MutationObserver(s);return i.observe(o,{attributes:!0,attributeFilter:["style","class"],subtree:!1}),()=>{n.disconnect(),i.disconnect()}},[r]),a}const Bt={base:"",modest:"opacity-90 bg-muted/10",accent:"text-accent bg-muted/10",current:"text-current bg-current/10"};function Lt({id:r,ref:a,content:t,variant:o="accent",className:s,style:n,...i}){const u=l.useId(),c=r||`code-${u}`,x=Rt(c);return e.jsx("code",{id:c,ref:a,className:w.join("px-2 py-1 rounded",Bt[o],s),"data-variant":o,style:{fontSize:x?`${x.smallerFontSize}px`:void 0,lineHeight:x?`${x.smallerLineHeight}px`:void 0,...n},...i,children:t})}const Vt={keyword:"text-rose-400",runner:"text-amber-400",comment:"text-gray-500/80",command:"text-gray-100",variable:"text-blue-400",string:"text-white/70",option:"text-purple-400",plain:"text-gray-200",operator:"text-pink-500",substitution:"text-green-300"},Gt={selector:"text-blue-400 font-medium",property:"text-purple-400",value:"text-green-400",punctuation:"text-gray-400",atRule:"text-pink-400 font-semibold",comment:"text-gray-500 italic",string:"text-green-400",number:"text-green-400",plain:"text-gray-100",function:"text-cyan-400"},Wt={key:"text-purple-400 font-semibold",string:"text-green-400",number:"text-orange-400 font-medium",boolean:"text-cyan-400 font-medium",punctuation:"text-gray-400",plain:"text-gray-100"},_t={heading:"text-blue-400 font-bold","heading-hash":"text-gray-500",bold:"text-white font-bold",italic:"text-white italic","bold-marker":"text-gray-400","italic-marker":"text-gray-400",link:"text-blue-400 underline","link-text":"text-blue-400","link-url":"text-green-400","link-bracket":"text-gray-400","link-paren":"text-gray-400",code:"text-pink-400 bg-gray-800 px-1 rounded text-sm","code-marker":"text-gray-500","code-block":"text-green-400","code-block-marker":"text-gray-500","list-marker":"text-orange-400 font-medium","list-item":"text-gray-200",blockquote:"text-gray-300 italic","blockquote-marker":"text-gray-500",plain:"text-gray-200"},qt={keyword:"text-purple-400 font-semibold",type:"text-cyan-400 font-medium",string:"text-green-400","jsx-bracket":"text-gray-400","jsx-tag":"text-blue-400 font-medium","jsx-attribute":"text-amber-400","jsx-brace":"text-yellow-400",jsx:"text-blue-400 font-medium",property:"text-amber-400",number:"text-orange-400 font-medium",comment:"text-gray-500 italic",function:"text-rose-400 font-semibold",hook:"text-rose-400 font-semibold",operator:"text-gray-300",plain:"text-gray-100"},Pt=new Set(["for","in","do","done","else","if","fi","then","while","until","case","esac"]),Kt=new Set(["npm","npx","pnpm","yarn","vite"]);function Ht(r){const a=[];let t=0;for(a.push({text:"`",type:"string"}),t=1;t<r.length;){const o=r[t];if(o==="`"){a.push({text:"`",type:"string"}),t++;break}if(o==="$"&&t+1<r.length&&r[t+1]==="{"){a.push({text:"${",type:"string"}),t+=2;let n=1;const i=t;for(;t<r.length&&n>0;)r[t]==="{"?n++:r[t]==="}"&&n--,n>0&&t++;if(n===0){const u=r.slice(i,t);if(u.trim().length>0){const c=me(u,!1,0);a.push(...c)}a.push({text:"}",type:"string"}),t++}else a.push({text:r.slice(i,t),type:"string"});continue}const s=t;for(;t<r.length&&r[t]!=="`"&&!(r[t]==="$"&&t+1<r.length&&r[t+1]==="{");)t++;t>s&&a.push({text:r.slice(s,t),type:"string"})}return{tokens:a,consumed:t}}function Zt(r){const a=[];let t=0;for(;t<r.length;){const o=r[t];if(o==="`"){if(a.push({text:"`",type:"string"}),t++,t<r.length){const n=me(r.slice(t),!1,0,!1);a.push(...n)}break}if(o==="$"&&t+1<r.length&&r[t+1]==="{"){a.push({text:"${",type:"string"}),t+=2;let n=1;const i=t;for(;t<r.length&&n>0;)r[t]==="{"?n++:r[t]==="}"&&n--,n>0&&t++;if(n===0){const u=r.slice(i,t);if(u.trim().length>0){const c=me(u,!1,0,!1);a.push(...c)}a.push({text:"}",type:"string"}),t++}else{a.push({text:r.slice(i),type:"string"});break}continue}const s=t;for(;t<r.length&&r[t]!=="`"&&!(r[t]==="$"&&t+1<r.length&&r[t+1]==="{");)t++;t>s&&a.push({text:r.slice(s,t),type:"string"})}return{tokens:a}}function Re(r){const a=[];if(r.trim()==="")return a.push({text:" ",type:"plain"}),a;if(r.trim().startsWith("#"))return a.push({text:r,type:"comment"}),a;const t=/(\$\([^)]*\)|"[^"]*"|'[^']*'|\$[\w_]+|[a-zA-Z_]\w*=|--?[a-zA-Z0-9][\w-]*(?:=.*)?|>>|>|#.*|\s+|[^\s]+)/g,o=n=>{if(/^\$\([^)]*\)$/.test(n)){const i=n.slice(2,-1);return[{text:"$(",type:"operator"},...Re(i),{text:")",type:"operator"}]}if(/^".*"$/.test(n)){const i=n.slice(1,-1),u=[];let c=0;const x=/\$[\w_]+/g;let f;for(;(f=x.exec(i))!==null;)f.index>c&&u.push({text:i.slice(c,f.index),type:"string"}),u.push({text:f[0],type:"variable"}),c=f.index+f[0].length;return c<i.length&&u.push({text:i.slice(c),type:"string"}),[{text:'"',type:"string"},...u,{text:'"',type:"string"}]}return/^'.*'$/.test(n)?[{text:n,type:"string"}]:/^\$[\w_]+$/.test(n)?[{text:n,type:"variable"}]:/^[a-zA-Z_]\w*=$/.test(n)?[{text:n,type:"variable"}]:/^--?[a-zA-Z0-9][\w-]*(=.*)?$/.test(n)?[{text:n,type:"option"}]:/^>>|>$/.test(n)?[{text:n,type:"operator"}]:/^#.*$/.test(n)?[{text:n,type:"comment"}]:/^\s+$/.test(n)?[{text:n,type:"plain"}]:Pt.has(n)?[{text:n,type:"keyword"}]:Kt.has(n)?[{text:n,type:"runner"}]:[{text:n,type:"command"}]};let s;for(;(s=t.exec(r))!==null;)a.push(...o(s[0]));return a}function Yt(r,a=!1){const t=[];let o=a;if(r.trim()==="")return t.push({text:" ",type:"plain"}),{tokens:t,inComment:o};let s="selector",n=0;r.match(/^\s+/)&&r.includes(":")&&!r.includes("{")&&(s="property",n=1);const i=/(\/\*[\s\S]*?\*\/|\/\*[\s\S]*$|\*\/)|(@[a-zA-Z-]+)|(\{|\}|:|;|,|\(|\))|("(?:[^"]*)"|'(?:[^']*)')|([a-zA-Z-]+)(?=\()|([0-9.]+(?:px|rem|em|%|vh|vw|deg|s|ms|fr)?)|(#[a-fA-F0-9]{3,8})|([a-zA-Z0-9_-]+|[.#][a-zA-Z0-9_-]+)|(\s+)|(\S+)/g;let u;for(;u=i.exec(r);){const[,c,x,f,d,h,m,y,v,b,C]=u;if(c)c.includes("/*")&&!c.includes("*/")?o=!0:c.includes("*/")&&(o=!1),t.push({text:c,type:"comment"});else if(o)u[0].includes("*/")&&(o=!1),t.push({text:u[0],type:"comment"});else if(x)t.push({text:x,type:"atRule"});else if(h)t.push({text:h,type:"function"});else if(f)f==="{"?(n++,s="property"):f==="}"?(n--,s=n>0?"property":"selector"):f===":"?s==="property"&&(s="value"):f===";"?n>0&&(s="property"):f===","&&n===0&&(s="selector"),t.push({text:f,type:"punctuation"});else if(d)t.push({text:d,type:"string"});else if(m)t.push({text:m,type:"number"});else if(y)t.push({text:y,type:"value"});else if(v){let p;v.startsWith(".")||v.startsWith("#")||s==="selector"?p="selector":s==="property"?p="property":p="value",t.push({text:v,type:p})}else if(b)t.push({text:b.replace(/ /g," "),type:"plain"});else if(C){const p=s==="value"?"value":"plain";t.push({text:C,type:p})}}return{tokens:t,inComment:o}}function Qt(r){const a=/("[^"]*")\s*(:)|("[^"]*")|(\d+)|(true|false|null)|(\{|\}|\[|\]|,)/g,t=[];let o=0,s;for(;(s=a.exec(r))!==null;)s.index>o&&t.push({text:r.slice(o,s.index),type:"plain"}),s[1]&&s[2]?(t.push({text:s[1],type:"key"}),t.push({text:s[2],type:"punctuation"})):s[3]?t.push({text:s[3],type:"string"}):s[4]?t.push({text:s[4],type:"number"}):s[5]?t.push({text:s[5],type:"boolean"}):s[6]&&t.push({text:s[6],type:"punctuation"}),o=a.lastIndex;return o<r.length&&t.push({text:r.slice(o),type:"plain"}),t}function me(r,a=!1,t=0,o=!1){const s=[];let n=r,i=a,u=t;if(o){const c=Zt(n);return s.push(...c.tokens),s}for(;n.length>0;){const c=n.match(/^\/\*[\s\S]*?\*\//);if(c){s.push({text:c[0],type:"comment"}),n=n.slice(c[0].length);continue}const x=n.match(/^\/\/.*$/m);if(x){s.push({text:x[0],type:"comment"}),n=n.slice(x[0].length);continue}if(n.match(/^`/)){const F=Ht(n);s.push(...F.tokens),n=n.slice(F.consumed);continue}const d=n.match(/^("[^"]*"|'[^']*')/);if(d){s.push({text:d[0],type:"string"}),n=n.slice(d[0].length);continue}const h=n.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);if(h){s.push({text:"<",type:"jsx-bracket"}),s.push({text:h[1],type:"jsx-tag"}),n=n.slice(h[0].length),i=!0;continue}const m=n.match(/^<\/([a-zA-Z][a-zA-Z0-9]*)>/);if(m){s.push({text:"</",type:"jsx-bracket"}),s.push({text:m[1],type:"jsx-tag"}),s.push({text:">",type:"jsx-bracket"}),n=n.slice(m[0].length),i=!1;continue}if(n.match(/^\/?>/)){const F=n.match(/^(\/?>\s*)/);if(F){s.push({text:F[1].trim(),type:"jsx-bracket"}),n=n.slice(F[1].length),F[1].includes(">")&&(i=!1);continue}}const y=n.match(/^([a-zA-Z][a-zA-Z0-9]*)(\s*)(=)/);if(y&&i&&u===0){s.push({text:y[1],type:"jsx-attribute"}),y[2]&&s.push({text:y[2],type:"plain"}),s.push({text:"=",type:"plain"}),n=n.slice(y[0].length);continue}const v=n.match(/^[{}]/);if(v){s.push({text:v[0],type:"jsx-brace"}),v[0]==="{"?u++:v[0]==="}"&&u--,n=n.slice(1);continue}const b=n.match(/^\s+/);if(b){s.push({text:b[0],type:"plain"}),n=n.slice(b[0].length);continue}const C=n.match(/^(=>|===|!==|==|!=|<=|>=|&&|\|\||[+\-*/%=<>!&|^~?:;,()[\]{}.])/);if(C){s.push({text:C[0],type:"operator"}),n=n.slice(C[0].length);continue}const p=n.match(/^(const|let|var|function|if|else|for|while|return|import|export|class|extends|interface|type|enum|async|await|public|private|protected|static|from|as|default|new|this|super|try|catch|finally|throw|break|continue|switch|case|typeof|instanceof)\b/);if(p){s.push({text:p[0],type:"keyword"}),n=n.slice(p[0].length);continue}const g=n.match(/^(use[A-Z][a-zA-Z]*)\b/);if(g){s.push({text:g[0],type:"hook"}),n=n.slice(g[0].length);continue}const j=n.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?=(\?\.)?\()/);if(j){s.push({text:j[1],type:"function"}),n=n.slice(j[1].length);continue}const E=n.match(/^(string|number|boolean|object|any|void|never|unknown|null|undefined|Promise|Array|React\.FC|FC|JSX\.Element|HTMLElement|Event|MouseEvent|KeyboardEvent|ChangeEvent)\b/);if(E){s.push({text:E[0],type:"type"}),n=n.slice(E[0].length);continue}const z=n.match(/^(\d+\.?\d*)/);if(z){s.push({text:z[0],type:"number"}),n=n.slice(z[0].length);continue}const k=n.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?=:)/);if(k&&!i){s.push({text:k[1],type:"property"}),n=n.slice(k[1].length);continue}s.push({text:n[0],type:"plain"}),n=n.slice(1)}return s}function Ut(r){const a=[];if(r.trim()==="")return a.push({text:" ",type:"plain"}),a;const t=r,o=t.match(/^(#{1,6})\s*(.*)$/);if(o)return a.push({text:o[1],type:"heading-hash"}),o[2]&&(a.push({text:" ",type:"plain"}),a.push({text:o[2],type:"heading"})),a;const s=t.match(/^(>\s*)(.*)$/);if(s)return a.push({text:s[1],type:"blockquote-marker"}),s[2]&&a.push({text:s[2],type:"blockquote"}),a;const n=t.match(/^(\s*)([-*+]|\d+\.)\s*(.*)$/);if(n)return n[1]&&a.push({text:n[1],type:"plain"}),a.push({text:n[2],type:"list-marker"}),a.push({text:" ",type:"plain"}),n[3]&&Ne(n[3],a),a;const i=t.match(/^(```)\s*(.*)$/);return i?(a.push({text:i[1],type:"code-block-marker"}),i[2]&&(a.push({text:" ",type:"plain"}),a.push({text:i[2],type:"code-block"})),a):(Ne(t,a),a)}function Ne(r,a){let t=r;for(;t.length>0;){const o=t.match(/^(\[)([^\]]*?)(\])(\()([^)]*?)(\))/);if(o){a.push({text:o[1],type:"link-bracket"}),a.push({text:o[2],type:"link-text"}),a.push({text:o[3],type:"link-bracket"}),a.push({text:o[4],type:"link-paren"}),a.push({text:o[5],type:"link-url"}),a.push({text:o[6],type:"link-paren"}),t=t.slice(o[0].length);continue}const s=t.match(/^(`+)([^`]*?)\1/);if(s){a.push({text:s[1],type:"code-marker"}),a.push({text:s[2],type:"code"}),a.push({text:s[1],type:"code-marker"}),t=t.slice(s[0].length);continue}const n=t.match(/^(\*\*|__)([^*_]*?)\1/);if(n){a.push({text:n[1],type:"bold-marker"}),a.push({text:n[2],type:"bold"}),a.push({text:n[1],type:"bold-marker"}),t=t.slice(n[0].length);continue}const i=t.match(/^(\*|_)([^*_]*?)\1/);if(i){a.push({text:i[1],type:"italic-marker"}),a.push({text:i[2],type:"italic"}),a.push({text:i[1],type:"italic-marker"}),t=t.slice(i[0].length);continue}a.push({text:t[0],type:"plain"}),t=t.slice(1)}}function Xt(r,a){const t={...Vt,...a};return r.map((o,s)=>{const n=Re(o);return e.jsx("div",{className:"leading-6",children:n.map((i,u)=>e.jsx("span",{className:t[i.type]||"text-gray-100",children:i.text},u))},s)})}function Jt(r,a){const t={...Gt,...a};let o=!1;return r.map((s,n)=>{const{tokens:i,inComment:u}=Yt(s,o);return o=u,e.jsx("div",{className:"leading-6",children:i.map((c,x)=>e.jsx("span",{className:t[c.type]||"text-gray-100",children:c.text},x))},n)})}function Ot(r,a){const t={...Wt,...a};return r.map((o,s)=>e.jsx("div",{className:"leading-6",children:Qt(o).map((n,i)=>e.jsx("span",{className:t[n.type]||"text-gray-100",children:n.text},i))},s))}function er(r,a){const t={...qt,...a};let o=!1,s=0,n=!1;return r.map((i,u)=>{if(i.trim()==="")return e.jsx("div",{className:"leading-6",children:" "},u);const c=me(i,o,s,n);(i.match(/`/g)||[]).length%2===1&&(n=!n),i.includes("<")&&i.match(/<[a-zA-Z]/)&&(o=!0),i.includes(">")&&!i.includes("<")&&(o=!1,s=0);const f=(i.match(/\{/g)||[]).length,d=(i.match(/\}/g)||[]).length;return s+=f-d,s<0&&(s=0),e.jsx("div",{className:"leading-6",children:c.map((h,m)=>e.jsx("span",{className:t[h.type]||"text-gray-100",children:h.text},m))},u)})}function tr(r,a){const t={..._t,...a};return r.map((o,s)=>e.jsx("div",{className:"leading-6",children:Ut(o).map((n,i)=>e.jsx("span",{className:t[n.type]||"text-gray-100",children:n.text},i))},s))}function rr(r){const[a,t]=l.useState(!1),o=l.useCallback(async()=>{try{await navigator.clipboard.writeText(r),t(!0),setTimeout(()=>t(!1),3e3)}catch(s){console.error("Failed to copy code:",s)}},[r]);return{copied:a,handleCopy:o}}function sr(r,a){const t=l.useRef(null),o=l.useRef(null);return l.useEffect(()=>{if(r){t.current=document.activeElement,document.body.style.overflow="hidden",setTimeout(()=>{var n;(n=o.current)==null||n.focus()},100);const s=n=>{n.key==="Escape"&&a(!1)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),document.body.style.overflow=""}}else t.current&&(t.current.focus(),t.current=null)},[r,a]),{containerRef:o}}function nr(r,a,t,o){return{handleKeyDown:l.useCallback(n=>{n.key==="c"&&(n.metaKey||n.ctrlKey)&&r?(n.preventDefault(),t()):n.key==="f"&&a&&(n.preventDefault(),o())},[r,a,t,o])}}function ar(r){switch(r){case"typescript":case"ts":return"ts";case"tsx":return"tsx";case"json":return"json";case"bash":case"sh":return"sh";case"css":return"css";case"markdown":case"md":return"md";default:return"txt"}}function or({code:r,language:a="typescript",allowCopy:t=!0,allowDownload:o=!1,allowFullscreen:s=!1,filename:n,showTrafficLights:i=!0,showLineNumbers:u=!1,hideHeader:c=!1,hideFiletype:x=!1,maxHeight:f,tokenClasses:d,className:h,id:m,ref:y,...v}){const[b,C]=l.useState(!1),{containerRef:p}=sr(b,C),{copied:g,handleCopy:j}=rr(r),E=l.useCallback(()=>{const I=n||`code.${ar(a)}`;Me.downloadFile(r,I)},[r,n,a]),z=l.useCallback(()=>{C(I=>!I)},[]),{handleKeyDown:k}=nr(t,s,j,z),F=l.useMemo(()=>r.split(`
|
|
2
|
+
`),[r]),N=l.useCallback((I=!0)=>e.jsxs("div",{className:w.join("flex items-center space-x-2",!I&&"absolute top-2 right-2 z-10"),children:[!x&&e.jsx("span",{className:"text-xs text-gray-400 uppercase tracking-wide font-medium","aria-label":`Code language: ${a}`,children:a}),s&&e.jsx("button",{onClick:z,className:"p-1.5 leading-0 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors motion-reduce:transition-none min-h-[44px] min-w-[44px] flex items-center justify-center md:min-h-auto md:min-w-auto md:p-1.5",title:b?"Exit fullscreen":"Fullscreen","aria-label":b?"Exit fullscreen mode":"Enter fullscreen mode","aria-pressed":b,type:"button",children:b?e.jsx(L.Dash,{size:14}):e.jsx(L.Window,{size:14})}),o&&e.jsx("button",{onClick:E,className:"p-1.5 leading-0 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors motion-reduce:transition-none min-h-[44px] min-w-[44px] flex items-center justify-center md:min-h-auto md:min-w-auto md:p-1.5",title:"Download code","aria-label":"Download code as file",type:"button",children:e.jsx(L.Download,{size:14})}),t&&e.jsx("button",{onClick:j,className:"p-1.5 leading-0 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors motion-reduce:transition-none min-h-[44px] min-w-[44px] flex items-center justify-center md:min-h-auto md:min-w-auto md:p-1.5",title:g?"Code copied!":"Copy code","aria-label":g?"Code copied to clipboard":"Copy code to clipboard","aria-live":"polite",type:"button",children:g?e.jsx(L.Check,{size:14,className:"text-green-400"}):e.jsx(L.Copy,{size:14})})]}),[x,a,s,b,o,E,t,j,g,z]),D=l.useMemo(()=>a==="json"?Ot(F,d):a==="tsx"||a==="ts"||a==="typescript"?er(F,d):a==="bash"||a==="sh"?Xt(F,d):a==="css"?Jt(F,d):a==="markdown"||a==="md"?tr(F,d):[e.jsx("span",{className:"text-gray-400",children:"Unsupported language"},0)],[F,d,a]),A=l.useMemo(()=>u?F.map((I,R)=>e.jsx("div",{className:"text-gray-500 text-right pl-3 pr-1 select-none min-w-8 text-sm font-mono leading-6","aria-hidden":"true",role:"presentation",children:R+1},R)):null,[u,F]),M=l.useMemo(()=>({maxHeight:f&&!b?`${f}px`:b?c?"calc(100vh - 5px)":"calc(100vh - 45px)":void 0,overflow:f||b?"auto":"visible"}),[f,b,c]),$=e.jsxs("div",{id:m,ref:I=>{p.current=I,typeof y=="function"?y(I):y&&(y.current=I)},className:w.join("bg-gray-900 rounded-lg border border-gray-700 overflow-hidden motion-reduce:transition-none",b&&"fixed inset-0 z-[9999] max-h-fit",h),"data-language":a,"data-filename":n,"data-fullscreen":b,role:"region","aria-label":`Code block${n?` for ${n}`:""} in ${a}`,"aria-describedby":u?`${m}-description`:void 0,tabIndex:0,onKeyDown:k,...v,children:[u&&e.jsxs("div",{id:`${m}-description`,className:"sr-only",children:["Code block with line numbers. Use Cmd+C or Ctrl+C to copy code.",s&&" Press F to toggle fullscreen."]}),e.jsx("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:g&&"Code copied to clipboard"}),!c&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[i&&e.jsxs("div",{className:"flex space-x-2",children:[e.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full"}),e.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded-full"}),e.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full"})]}),n&&e.jsx("span",{className:"text-sm text-gray-300 font-medium",children:n})]}),N(!0)]}),e.jsxs("div",{className:w.join("flex overflow-hidden",c&&"relative"),style:M,children:[c&&N(!1),e.jsx("div",{className:"flex-1 overflow-x-auto",children:e.jsxs("div",{className:"flex",children:[u&&e.jsx("div",{className:"bg-gray-800 py-4 border-r border-gray-700 flex flex-col flex-shrink-0","aria-hidden":"true",role:"presentation",children:A}),e.jsx("div",{className:"flex-1 p-4",children:e.jsx("pre",{className:"text-sm font-mono focus:outline-none",role:"code","aria-label":`${a} code content`,tabIndex:-1,children:e.jsx("code",{children:D})})})]})})]})]});return e.jsxs(e.Fragment,{children:[!b&&$,b&&pe.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black z-[9998]",onClick:()=>C(!1),"aria-hidden":"true"}),$]}),document.body)]})}function lr({children:r,label:a,isOpen:t,onToggle:o,id:s,ref:n,disabled:i=!1,className:u,buttonClassName:c}){const x=l.useId(),f=s??x,[d,h]=l.useState(!1),m=t!==void 0?t:d,y=()=>{i||(t===void 0&&h(v=>!v),o==null||o(!m))};return l.useEffect(()=>{h(t??!1)},[t]),e.jsxs("div",{ref:n,id:f,"data-open":m,className:w.join("overflow-hidden",u),children:[e.jsx("button",{id:`${f}-button`,type:"button","aria-expanded":m,"aria-controls":`${f}-panel`,disabled:i,tabIndex:0,className:w.join("w-full px-4 py-3 font-medium hover:bg-primary/10 disabled:opacity-50 disabled:cursor-not-allowed",c),onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),y())},"data-open":m,"data-label":typeof a=="string"?a:void 0,children:e.jsxs("div",{className:"flex items-center w-full gap-2",children:[e.jsx("span",{className:"flex-1 text-left",children:a}),m?e.jsx(L.CaretCollapse,{className:"size-5","aria-hidden":"true"}):e.jsx(L.CaretExpand,{className:"size-5","aria-hidden":"true"})]})}),e.jsx("div",{id:`${f}-panel`,role:"region","aria-labelledby":f,"aria-live":"polite",hidden:!m,children:r})]})}function ir(r){const[a,t]=l.useState(!1),[o,s]=l.useState(!1);return l.useEffect(()=>{if(r){s(!0);const n=setTimeout(()=>t(!0),10);return()=>clearTimeout(n)}else{t(!1);const n=setTimeout(()=>s(!1),300);return()=>clearTimeout(n)}},[r]),{show:a,shouldRender:o}}function cr({isOpen:r,onClose:a,enabled:t=!0}){const[o,s]=l.useState(!1),[n,i]=l.useState(0),[u,c]=l.useState(0),x=l.useCallback(j=>{!t||!r||(s(!0),c(j),document.body.style.userSelect="none")},[t,r]),f=l.useCallback(j=>{if(!o||!t)return;const E=j-u,z=Math.max(0,E);i(z)},[o,t,u]),d=l.useCallback(()=>{if(!o||!t)return;s(!1),document.body.style.userSelect="",n>100&&a(),i(0)},[o,t,n,a]),h=l.useCallback(j=>{j.preventDefault(),x(j.clientY)},[x]),m=l.useCallback(j=>{f(j.clientY)},[f]),y=l.useCallback(()=>{d()},[d]),v=l.useCallback(j=>{j.preventDefault(),x(j.touches[0].clientY)},[x]),b=l.useCallback(j=>{j.preventDefault(),f(j.touches[0].clientY)},[f]),C=l.useCallback(()=>{d()},[d]);l.useEffect(()=>{if(o)return document.addEventListener("mousemove",m),document.addEventListener("mouseup",y),document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("touchend",C),()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",y),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",C)}},[o,m,y,b,C]);const p=l.useCallback(j=>{t&&(j.key==="ArrowDown"||j.key==="Escape")&&(j.preventDefault(),a())},[t,a]);return{dragHandlers:t?{onMouseDown:h,onTouchStart:v,onKeyDown:p}:{},translateY:n,isDragging:o}}function dr(r,a){const t=l.useRef(null);l.useEffect(()=>{if(!a)return;t.current=document.activeElement;const o=document.getElementById(r);o&&o.focus();const s=n=>{if(n.key!=="Tab")return;const i=document.getElementById(r);if(!i)return;const u=i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),c=u[0],x=u[u.length-1];n.shiftKey&&document.activeElement===c?(n.preventDefault(),x==null||x.focus()):!n.shiftKey&&document.activeElement===x&&(n.preventDefault(),c==null||c.focus())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),t.current&&typeof t.current.focus=="function"&&t.current.focus()}},[r,a])}function ur(r,a){l.useEffect(()=>{if(!r)return;const t=window.getComputedStyle(document.body).overflow;document.body.style.overflow="hidden";const o=s=>{s.key==="Escape"&&a()};return document.addEventListener("keydown",o),()=>{document.body.style.overflow=t,document.removeEventListener("keydown",o)}},[r,a])}function fr({ref:r,id:a,isOpen:t,onClose:o,title:s,children:n,footer:i,className:u,overlayClassName:c,showCloseButton:x=!1,disableCloseOnOverlayClick:f=!1,enableDragGestures:d=!0,ariaLabelledBy:h,ariaDescribedBy:m}){const y=l.useId(),v=a||`drawer-${y}`,b=`${y}-title`,{show:C,shouldRender:p}=ir(t),{dragHandlers:g,translateY:j,isDragging:E}=cr({isOpen:t,onClose:o,enabled:d});if(dr(v,p),ur(p,o),!p)return null;const z=()=>s?l.isValidElement(s)?e.jsx("div",{children:s}):e.jsx("h2",{className:"text-2xl font-semibold",id:b,children:s}):null,k=()=>{if(!i)return null;if(l.isValidElement(i)){const F=i,N=F.props.className||"";return l.cloneElement(F,{className:w.join("px-6 py-4",N)})}return e.jsx("div",{className:"px-6 py-4",children:i})};return e.jsx(e.Fragment,{children:pe.createPortal(e.jsxs("div",{"aria-labelledby":h??s?b:void 0,"aria-describedby":m,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-hidden","data-drawer-open":t,children:[e.jsx("div",{className:w.join("fixed inset-0 bg-black/40 transition-opacity",C?"opacity-100":"opacity-0",c),onClick:()=>{f||o()}}),e.jsx("div",{className:"fixed inset-x-0 bottom-0 flex max-h-full",children:e.jsx("div",{id:v,ref:r,tabIndex:-1,className:w.join("relative w-screen transform shadow-xl bg-popover text-popover-foreground transition-transform ease-in-out border-t border-border rounded-t-lg",C?"translate-y-0":"translate-y-full",u),style:{transform:d&&j!==0?`translateY(${j}px)`:void 0,transition:j!==0?"none":void 0},children:e.jsxs("div",{className:"flex h-full flex-col",children:[d&&e.jsx("div",{className:w.join("flex justify-center pt-3 pb-2 cursor-grab active:cursor-grabbing",d&&"select-none"),...g,role:d?"button":void 0,tabIndex:d?0:void 0,"aria-label":d?"Drag to resize drawer":void 0,children:e.jsx("div",{className:w.join("w-12 h-1.5 bg-popover-foreground/25 rounded-full transition-colors",d&&"hover:bg-popover-foreground/50",E&&"bg-popover-foreground/50")})}),s&&e.jsx("div",{className:"px-6 pt-4",children:z()}),x&&e.jsx("button",{type:"button",onClick:o,"data-drawer-close-button":"true","aria-label":"Close drawer",className:"rounded-md p-0.5 top-3 right-3 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:e.jsx(ee.X,{size:18})}),e.jsx("div",{className:w.join("flex-1 overflow-y-auto px-6 pb-6",s?"pt-6":"pt-4"),children:n}),k()]})})})]}),document.body)})}function xr(r){switch(r){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}function mr({internalIsOpen:r,autoSwitchPlacement:a,placement:t,offset:o,triggerRef:s,popoverRef:n}){const[i,u]=l.useState(t);return l.useEffect(()=>{if(!r||!a)return;const c=()=>{if(!s.current||!n.current)return;const d=s.current.getBoundingClientRect(),h=n.current.getBoundingClientRect(),m=window.innerWidth,y=window.innerHeight;let v=t;const b=xr(t);if(t==="top"||t==="bottom"){const C=t==="top"?d.top>=h.height+o:y-d.bottom>=h.height+o,p=b==="top"?d.top>=h.height+o:y-d.bottom>=h.height+o;!C&&p&&(v=b)}else{const C=t==="left"?d.left>=h.width+o:m-d.right>=h.width+o,p=b==="left"?d.left>=h.width+o:m-d.right>=h.width+o;!C&&p&&(v=b)}u(v)};c();const x=()=>c();window.addEventListener("scroll",x,!0),window.addEventListener("resize",x);const f=new ResizeObserver(c);return s.current&&f.observe(s.current),n.current&&f.observe(n.current),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x),f.disconnect()}},[r,t,o,a,s,n]),i}const hr={bottom:{start:"top-full left-0 origin-top-left",center:"top-full left-1/2 -translate-x-1/2 origin-top",end:"top-full right-0 origin-top-right"},top:{start:"bottom-full left-0 origin-bottom-left",center:"bottom-full left-1/2 -translate-x-1/2 origin-bottom",end:"bottom-full right-0 origin-bottom-right"},left:{start:"right-full top-0 origin-top-right",center:"right-full top-1/2 -translate-y-1/2 origin-right",end:"right-full bottom-0 origin-bottom-right"},right:{start:"left-full top-0 origin-top-left",center:"left-full top-1/2 -translate-y-1/2 origin-left",end:"left-full bottom-0 origin-bottom-left"}};function pr(r,a){switch(r){case"top":return{marginBottom:`${a}px`};case"bottom":return{marginTop:`${a}px`};case"left":return{marginRight:`${a}px`};case"right":return{marginLeft:`${a}px`};default:return{}}}function Be({id:r,ref:a,isOpen:t,onOpenChange:o,children:s,className:n,closeOnOverlayClick:i=!0,trigger:u,placement:c="bottom",alignment:x="center",closeOnTriggerClick:f=!0,offset:d=8,autoSwitchPlacement:h=!0,hoverable:m=!1}){const[y,v]=l.useState(t??!1),b=l.useRef(null),C=l.useRef(null),p=l.useRef(null),g=l.useId(),j=l.useRef(null),E=mr({internalIsOpen:y,autoSwitchPlacement:h,placement:c,offset:d,triggerRef:C,popoverRef:b}),z=l.useCallback(M=>{o&&o(M),t===void 0&&v(M)},[t,o]),k=l.useCallback(()=>{j.current&&(clearTimeout(j.current),j.current=null)},[]),F=l.useCallback(()=>{m&&(k(),z(!0))},[m,k,z]),N=l.useCallback(()=>{m&&(k(),j.current=setTimeout(()=>{z(!1)},200))},[m,k,z]);l.useEffect(()=>{t!==void 0&&v(t)},[t]),l.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]),l.useEffect(()=>{if(!y)return;const M=$=>{$.key==="Escape"&&z(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[y,z]),l.useEffect(()=>{if(!y||!i)return;const M=$=>{const I=$.target;b.current&&!b.current.contains(I)&&C.current&&!C.current.contains(I)&&z(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[y,i,z]),l.useEffect(()=>{var M,$;y?(p.current=document.activeElement,(M=b.current)==null||M.focus()):(($=p.current)==null||$.focus(),p.current=null)},[y]);const D=u.props,A=l.cloneElement(u,{"aria-expanded":y,"aria-haspopup":"dialog","aria-controls":g,ref:Me.mergeRefs(C,D.ref),onClick:M=>{var $,I;if(($=D.onClick)==null||$.call(D,M),!m&&!(!f&&y)&&t===void 0){if(M.defaultPrevented||(I=b.current)!=null&&I.contains(M.target))return;z(!y)}},onMouseEnter:M=>{var $;($=D.onMouseEnter)==null||$.call(D,M),F()},onMouseLeave:M=>{var $;($=D.onMouseLeave)==null||$.call(D,M),N()}});return e.jsxs("div",{id:r,ref:a,className:"relative inline-block",children:[A,e.jsx("div",{id:g,ref:b,className:w.join("absolute z-[90] transform rounded-md shadow-lg bg-popover text-popover-foreground transition-all ease-out",y?"opacity-100 scale-100":"opacity-0 scale-75 pointer-events-none",hr[E][x],n),style:pr(E,d),role:"dialog","aria-modal":"true",tabIndex:-1,inert:y?void 0:!0,"aria-hidden":y?void 0:!0,onMouseEnter:m?F:void 0,onMouseLeave:m?N:void 0,children:s})]})}function Le({option:r,...a}){const{onItemSelect:t}=V.useDropdownMenuContext(),o=()=>{r.onClick&&r.onClick(),r.value&&t(r.value)},s=r.subItems&&r.subItems.length>0,n=r.href&&!r.disabled,i=n?"a":"div";return e.jsxs(i,{href:n?r.href:void 0,className:w.join("relative flex items-center gap-2 px-3 py-2 text-sm focus:outline-none focus:bg-popover-foreground/10",r.disabled?"opacity-50 cursor-default":"cursor-pointer"),onClick:r.disabled?void 0:o,...a,children:[r.icon&&e.jsx("span",{className:"size-4",children:r.icon}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{children:r.label}),r.description&&e.jsx("div",{className:"text-xs text-popover-foreground/60",children:r.description})]}),r.keyboardShortcut&&e.jsx("div",{className:"text-xs text-popover-foreground/60",children:r.keyboardShortcut}),s&&e.jsx(L.ChevronRight,{className:"size-4"})]})}function br({option:r,level:a,index:t}){const{focus:o,setFocus:s}=V.useDropdownMenuContext(),[n,i]=l.useState(!1),[u,c]=l.useState(!1),x=l.useRef(null),f=l.useRef(void 0),d=l.useId(),h=()=>{r.disabled||(s({level:a,index:t}),y())},m=()=>{s(null),v()},y=()=>{i(!0)},v=()=>{i(!1)},b=g=>{if(g.key==="ArrowRight"){if(g.preventDefault(),r.disabled)return;c(!1)}};l.useEffect(()=>{const g=o==null?void 0:o.level,j=f.current,E=a+1;g&&j&&j===E&&g===j-1?c(!0):c(!1),f.current=g},[o,a]);const C=r.subItems!==void 0&&r.subItems.length>0,p=n&&!u&&C;return e.jsxs("div",{ref:x,className:"relative focus:outline-none focus:bg-popover-foreground/10",onMouseEnter:h,onMouseLeave:m,onFocus:y,onBlur:v,onKeyDown:b,tabIndex:0,"data-menu-item":r.value,"data-level":a,"data-index":t,"aria-haspopup":C?"true":void 0,"aria-expanded":p?"true":"false","aria-disabled":r.disabled?"true":void 0,"aria-label":r.label,"aria-controls":p?d:void 0,children:[e.jsx(Le,{option:r}),p&&e.jsx("div",{className:"absolute left-full top-0 z-30",children:e.jsx(Ve,{items:r.subItems??[],level:a+1,id:d})})]})}function Ve({items:r,level:a,id:t}){const{setFocus:o,className:s=""}=V.useDropdownMenuContext();let n=0;const i=(u,c)=>{switch(u.__type){case"option":return u.subItems&&u.subItems.length>0?e.jsx(br,{option:u,level:a,index:n++},c):e.jsx(Le,{option:u,"data-menu-item":u.value,"data-level":a,"data-index":n++,tabIndex:-1,"aria-disabled":u.disabled?"true":void 0,onMouseEnter:x=>{if(x.preventDefault(),u.disabled)return;const f=Number(x.currentTarget.getAttribute("data-index"));o({level:a,index:f})},onMouseLeave:x=>{x.preventDefault(),o(null)}},c);case"group":return e.jsxs("div",{children:[u.title&&e.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-popover-foreground/50 uppercase",children:u.title}),u.items.map((x,f)=>i(x,`${c}-${f}`))]},c);case"separator":return e.jsx("div",{"aria-hidden":!0,className:"my-1 mx-2 border-t border-popover-foreground/20"},c);case"custom":return e.jsx("div",{children:u.render()},c);default:return null}};return e.jsx("div",{id:t,className:w.join("border py-1 border-popover-foreground/20 rounded-md min-w-52 shadow-lg bg-popover text-popover-foreground",s),tabIndex:0,"data-level":a,"data-menu":!0,role:"menu","aria-label":`Dropdown menu level ${a}`,children:r.map((u,c)=>i(u,String(c)))})}function gr(r,a){return Array.from(r.querySelectorAll(`[data-menu-item][data-level="${a}"]`))}function yr(r,a){const t=a===null?0:(a+1)%r.length;for(let o=0;o<r.length;o++){const s=(t+o)%r.length;if(!r[s].hasAttribute("aria-disabled"))return s}return-1}function vr(r,a){const t=a===null?r.length-1:(a-1+r.length)%r.length;for(let o=0;o<r.length;o++){const s=(t-o+r.length)%r.length;if(!r[s].hasAttribute("aria-disabled"))return s}return-1}function jr({dropdownId:r,focus:a,setFocus:t,isOpen:o,onClose:s}){const n=l.useCallback(i=>{var d;if(!o)return;const{level:u,index:c}=a||{level:1,index:null},x=document.querySelector(`#${r} [data-menu][data-level="${u}"]`);if(!x)return;const f=gr(x,u);if(f.length!==0)switch(i.key){case"ArrowDown":{i.preventDefault();const h=yr(f,c);if(h===-1)return;t({level:u,index:h});break}case"ArrowUp":{i.preventDefault();const h=vr(f,c);if(h===-1)return;t({level:u,index:h});break}case"ArrowRight":{if(i.preventDefault(),c!==null){const m=f[c].querySelector("[data-menu]");m&&m.querySelector("[data-menu-item]")&&t({level:u+1,index:0})}break}case"ArrowLeft":{i.preventDefault();const h=(d=x.parentElement)==null?void 0:d.closest("[data-menu-item]");if(!h){console.error(`No parent menu found leaving menu level ${u}`);return}const m=h.getAttribute("data-index")?Number(h.getAttribute("data-index")):-1;h&&t({level:u-1,index:m===-1?0:m});break}case"Enter":{if(i.preventDefault(),c!==null){const h=f[c];h==null||h.click(),t(null)}break}case"Escape":{i.preventDefault(),s==null||s(),t(null);break}case"Tab":{s();break}}},[o,a,t,s,r]);return l.useEffect(()=>{if(o)return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[n,o]),{handleKeyDown:n}}function wr(r,a,t){return document.querySelector(`#${r} [data-menu-item][data-level="${a}"][data-index="${t}"]`)}function kr({id:r,items:a,onItemSelect:t,trigger:o,isOpen:s,placement:n="bottom",alignment:i="start",onOpenChange:u,className:c="",...x}){const f=l.useId(),d=r||`dropdown-menu-${f}`,[h,m]=l.useState(null),[y,v]=l.useState(!1),b=s===void 0,C=b?y:s,p=l.useCallback(()=>{m(null),v(!1)},[]),g=l.useCallback(k=>{t&&t(k),p()},[t,p]),j=l.useCallback(k=>{b&&v(k),u&&u(k)},[b,u]),E=l.useMemo(()=>({id:d,focus:h,setFocus:m,isOpen:C,onItemSelect:g,onClose:p,className:c}),[h,m,g,p,c,C,d]);jr({dropdownId:d,focus:h,setFocus:m,isOpen:C,onClose:p});const z=l.useMemo(()=>l.cloneElement(o,{onClick:k=>{b&&v(N=>!N);const F=o.props;F.onClick&&F.onClick(k)}}),[b,v,o]);return l.useEffect(()=>{if(h){const k=wr(d,h.level,h.index);k==null||k.focus()}},[h,d]),e.jsx(Be,{id:d,isOpen:b?y:C,trigger:z,placement:n,alignment:i,onOpenChange:j,className:w.join("min-w-52",c),...x,children:e.jsx(V.DropdownMenuContext.Provider,{value:E,children:e.jsx(Ve,{items:a,level:1})})})}const Cr=r=>({__type:"option",...r}),Nr=(r,a)=>({__type:"group",title:a,items:r}),Dr=()=>({__type:"separator"}),Er=r=>({__type:"custom",render:r}),Sr={option:Cr,group:Nr,separator:Dr,custom:Er};function Fr(r=[]){const[a,t]=l.useState(r),[o,s]=l.useState(null),[n,i]=l.useState(null),u=l.useRef(null),c=l.useCallback((p,g)=>{const j={...g,id:`item-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,content:p};return t(E=>[...E,j]),j},[]),x=l.useCallback(p=>{t(g=>g.filter(j=>j.id!==p))},[]),f=l.useCallback((p,g)=>{p!==g&&t(j=>{const E=[...j],[z]=E.splice(p,1);return E.splice(g,0,z),E})},[]),d=l.useCallback(p=>{p>0&&f(p,p-1)},[f]),h=l.useCallback(p=>{p<a.length-1&&f(p,p+1)},[f,a.length]),m=l.useCallback((p,g)=>{s(p),u.current=g,i(g)},[]),y=l.useCallback((p,g)=>{p.preventDefault(),i(g)},[]),v=l.useCallback(()=>{if(o&&n!==null&&u.current!==null){const p=u.current,g=n;p!==g&&f(p,g)}s(null),i(null),u.current=null},[o,n,f]),b=l.useCallback(p=>{p.preventDefault(),v()},[v]),C=l.useCallback(()=>{if(!o||n===null||u.current===null)return a;const p=u.current,g=n;if(p===g)return a;const j=[...a],[E]=j.splice(p,1);return j.splice(g,0,E),j},[a,o,n,u]);return{items:a,visualItems:C(),addItem:c,deleteItem:x,moveItem:f,moveItemUp:d,moveItemDown:h,draggedItem:o,draggedOverIndex:n,handleDragStart:m,handleDragOver:y,handleDragEnd:v,handleDrop:b}}const Ir={sm:"text-sm",md:"text-base",lg:"text-lg"},Ar={sm:"text-sm gap-2",md:"text-base gap-3",lg:"text-lg gap-4"},$r={sm:14,md:15,lg:16};function De({size:r=8,className:a=""}){return e.jsx("div",{className:`rounded-full flex-shrink-0 bg-current ${a}`,style:{width:r,height:r}})}function Mr({size:r=12,className:a=""}){return e.jsx("div",{className:`flex-shrink-0 bg-current ${a}`,style:{width:r,height:2}})}function zr({items:r=[],size:a="md",id:t,className:o="",ref:s,allowAdd:n=!0,allowDelete:i=!0,allowReorder:u=!0,addPlaceholder:c="Add new item...",onItemsChange:x,renderItem:f,marker:d,itemRenderer:h,showDividers:m=!0,showReorderButtons:y=!0,title:v,truncateText:b=!1}){const[C,p]=l.useState(""),[g,j]=l.useState(null),E=l.useRef(null),z=l.useId(),k=l.useRef(!1),F=l.useRef(r),N=t||`dynamic-list-${z}`,D=`${N}-title`,{items:A,visualItems:M,addItem:$,deleteItem:I,moveItemUp:R,moveItemDown:G,draggedItem:K,draggedOverIndex:U,handleDragStart:T,handleDragOver:_,handleDragEnd:X,handleDrop:te}=Fr(r),re=h||f;l.useEffect(()=>{if(!k.current){k.current=!0;return}F.current!==A&&(F.current=A,x==null||x(A))},[A,x]);const S=W=>document.querySelector(`#${N} #${CSS.escape(W)}`),B=()=>{var W;C.trim()&&($(C.trim()),p(""),(W=E.current)==null||W.focus())},Z=(W,Q)=>{var oe;if(!i)return;W.preventDefault();const J=Q<A.length-1?Q+1:Q-1,ae=A[J];I(A[Q].id),J>=0&&ae?setTimeout(()=>{const O=S(ae.id);O==null||O.focus()},0):((oe=E.current)==null||oe.focus(),j(null))},H=W=>{W.key==="Enter"&&B()},q=(W,Q)=>{switch(W.key){case"ArrowUp":if(!u)return;W.preventDefault(),R(Q),Q>0&&j(Q-1);break;case"ArrowDown":if(!u)return;W.preventDefault(),G(Q),Q<A.length-1&&j(Q+1);break;case"Backspace":case"Delete":Z(W,Q);break}},Y=()=>{if(!v)return null;const W=w.join("font-medium opacity-60",Ir[a]);if(typeof v=="string")return e.jsx("h4",{id:D,className:W,children:v});const Q=v.props;return l.cloneElement(v,{id:D,className:w.join(W,Q.className)})},P=W=>{if(!d)return null;if(l.isValidElement(d))return d;switch(d){case"disc":return e.jsx(De,{className:"text-muted-foreground"});case"dash":return e.jsx(Mr,{className:"text-muted-foreground"});case"decimal":return e.jsxs("span",{className:"text-sm font-medium text-muted-foreground flex-shrink-0 min-w-4 text-right",children:[W+1,"."]});default:return e.jsx(De,{className:"text-muted-foreground"})}},se=Ar[a],ne=$r[a];return e.jsxs("div",{ref:s,id:N,className:o,"data-size":a,"data-allow-add":n,"data-allow-delete":i,"data-allow-reorder":u,"data-marker":typeof d=="string"?d:"custom",children:[Y(),e.jsxs("ul",{className:se,role:"list","aria-labelledby":v?D:void 0,children:[M.map((W,Q)=>{const J=A.findIndex(O=>O.id===W.id),ae=(K==null?void 0:K.id)===W.id,oe=g===J;return e.jsxs("div",{children:[e.jsxs("li",{id:W.id,title:b?W.content:void 0,className:w.join("flex items-center group relative transition-all",ae&&"opacity-30",K&&U===Q&&!ae?"border-t-2 border-primary":""),draggable:u,onDragStart:O=>{O.dataTransfer.effectAllowed="move",T(W,J)},onDragOver:O=>_(O,Q),onDragEnd:X,onDrop:te,onMouseEnter:()=>j(J),onMouseLeave:()=>j(null),onFocus:O=>{O.currentTarget===O.target&&j(J)},tabIndex:0,role:"listitem","aria-label":`List item ${J+1}: ${W.content}`,onKeyDown:O=>q(O,J),"aria-description":`${u?"Use up/down arrow keys to reorder. ":""}${i?"Press Backspace/Delete to remove this item.":""}`,children:[u&&e.jsx("div",{className:w.join("absolute -translate-x-full flex-shrink-0 pl-2 pr-1 py-2 cursor-move transition-opacity opacity-0",(ae||oe&&!K)&&"opacity-100"),children:e.jsx(L.GripVertical,{size:ne+2})}),d&&e.jsx("div",{className:w.join("flex-shrink-0 flex items-center justify-center py-2 pr-2"),children:P(J)}),e.jsxs("div",{className:w.join("flex-1 flex min-w-0"),children:[e.jsx("div",{className:w.join("flex-1 min-w-0 py-2 pr-2"),children:re?re(W,J):e.jsx("span",{className:w.join("block",b&&"truncate"),children:W.content})}),!K&&e.jsxs("div",{className:w.join("flex-shrink-0 flex items-center gap-1 pr-2 opacity-0 transition-opacity",oe&&"opacity-100"),children:[u&&y&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>R(J),disabled:J===0,className:"p-0.5 opacity-50 leading-0 hover:opacity-80 disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors","aria-hidden":!0,tabIndex:-1,children:e.jsx(L.ChevronUp,{size:ne})}),e.jsx("button",{type:"button",onClick:()=>G(J),disabled:J===A.length-1,className:"p-0.5 opacity-50 leading-0 hover:opacity-80 disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors","aria-hidden":!0,tabIndex:-1,children:e.jsx(L.ChevronDown,{size:ne})})]}),i&&e.jsx("button",{tabIndex:oe?0:-1,type:"button",onClick:O=>Z(O,J),className:"p-0.5 text-destructive opacity-70 h-fit hover:opacity-90 rounded transition-colors focus:outline-none focus:ring-2 focus:ring-destructive","aria-label":"Delete item",children:e.jsx(L.Trash,{size:ne})})]})]})]}),m&&Q<A.length-1&&e.jsx("hr",{className:"border-border/50"})]},W.id)}),A.length===0&&e.jsxs("li",{className:w.join("text-center text-muted-foreground py-8",se),children:["No items yet. ",n&&"Add an item below to get started."]})]}),n&&e.jsxs("div",{className:w.join("border-t border-border/50 flex items-center gap-2",se),children:[e.jsx("input",{id:`${N}-new-item-input`,ref:E,type:"text",value:C,onChange:W=>p(W.target.value),onKeyDown:H,placeholder:c,className:"flex-1 bg-transparent border-none outline-none placeholder-muted-foreground pt-1","aria-label":"Add new list item"}),e.jsx("button",{type:"button",onClick:B,disabled:!C.trim(),className:"flex-shrink-0 p-1.5 text-muted-foreground opacity-70 enabled:hover:opacity-100 disabled:opacity-30 disabled:cursor-not-allowed rounded transition-opacity","aria-label":"Add item",children:e.jsx(L.Plus,{size:16})})]})]})}const Tr={danger:{container:"border-destructive bg-destructive/10",icon:"text-destructive",title:"text-destructive",description:"text-destructive/80",button:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-destructive",details:"bg-destructive/5 border-destructive/20 text-destructive"},warning:{container:"border-yellow-600 bg-yellow-600/10",icon:"text-yellow-600",title:"text-yellow-600",description:"text-yellow-600/80",button:"bg-yellow-600 text-white hover:bg-yellow-600/90 focus:ring-yellow-600",details:"bg-yellow-600/5 border-yellow-600/20 text-yellow-600"},info:{container:"border-blue-600 bg-blue-600/10",icon:"text-blue-600",title:"text-blue-600",description:"text-blue-600/80",button:"bg-blue-600 text-white hover:bg-blue-600/90 focus:ring-blue-600",details:"bg-blue-600/5 border-blue-600/20 text-blue-600"}},Rr={danger:e.jsx(ee.ExclamationTriangle,{size:24}),warning:e.jsx(ee.ExclamationTriangle,{size:24}),info:e.jsx(ee.InfoCircled,{size:24})};function Br({id:r,variant:a="danger",showRetry:t=!0,fallbackMessage:o,fallback:s,onRetry:n,onError:i,className:u,children:c,inDevEnv:x=!1}){return e.jsx(Lr,{id:r,variant:a,showRetry:t,fallbackMessage:o,fallback:s,onRetry:n,onError:i,className:u,inDevEnv:x,children:c})}class Lr extends l.Component{constructor(t){super(t);je(this,"handleRetry",()=>{var t,o;this.setState({hasError:!1,error:void 0,errorInfo:void 0}),(o=(t=this.props).onRetry)==null||o.call(t)});this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){var s,n;this.setState({error:t,errorInfo:o}),(n=(s=this.props).onError)==null||n.call(s,t,o),this.props.inDevEnv&&(console.error("ErrorBoundary caught an error:",t),console.error("Error info:",o))}render(){var x;const{id:t,variant:o="danger",showRetry:s=!0,fallbackMessage:n="Something went wrong",fallback:i,className:u,inDevEnv:c}=this.props;if(this.state.hasError){if(i)return i;const f=Tr[o],d=Rr[o];return e.jsxs("div",{id:t,"data-variant":o,"data-has-error":this.state.hasError,className:w.join("rounded-lg border p-6 text-center",f.container,u),role:"alert","aria-live":"assertive",children:[e.jsx("div",{className:w.join("mb-4 flex justify-center",f.icon),children:d}),e.jsx("h3",{className:w.join("text-lg font-semibold mb-2",f.title),children:"Oops! Something went wrong"}),e.jsx("p",{className:w.join("text-sm mb-4",f.description),children:n}),c&&this.state.error&&e.jsxs("details",{className:"mt-4 text-left",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium mb-2",children:"Error Details (Development Only)"}),e.jsxs("div",{className:w.join("rounded border p-3 text-xs font-mono whitespace-pre-wrap overflow-auto max-h-40",f.details),children:[e.jsx("div",{className:"font-bold mb-1",children:"Error:"}),e.jsx("div",{className:"mb-2",children:this.state.error.toString()}),((x=this.state.errorInfo)==null?void 0:x.componentStack)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-bold mb-1",children:"Component Stack:"}),e.jsx("div",{children:this.state.errorInfo.componentStack})]})]})]}),s&&e.jsx("button",{type:"button",onClick:this.handleRetry,className:w.join("inline-flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-colors","focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-transparent",f.button),"aria-label":"Try again",children:"Try Again"})]})}return this.props.children}}const Vr=r=>({__type:"input",...r}),Gr=r=>({__type:"textarea",...r}),Wr=r=>({__type:"select",...r}),_r=r=>({__type:"checkbox",...r}),qr=r=>({__type:"radio",...r}),Pr={input:Vr,textarea:Gr,select:Wr,checkbox:_r,radio:qr};function Kr(r,a){const[t,o]=l.useState({}),s=l.useCallback((f,d)=>{if(f.required&&(!d||typeof d=="string"&&d.trim()===""))return`${f.label} is required`;if(f.isValid&&d){const h=f.isValid,m=h(d);if(!m.valid)return m.message||`${f.label} is invalid`}return null},[]),n=l.useCallback((f=a)=>{const d={};return r.forEach(h=>{const m=s(h,f[h.name]);m&&(d[h.name]=m)}),o(d),Object.keys(d).length===0},[r,a,s]),i=l.useCallback((f,d)=>{const h=r.find(y=>y.name===f);if(!h)return;const m=s(h,d);return o(y=>{const v={...y};return m?v[f]=m:delete v[f],v}),!m},[r,s]),u=l.useCallback(()=>{o({})},[]),c=l.useMemo(()=>Object.values(t).some(f=>f),[t]),x=l.useMemo(()=>r.every(f=>{const d=a[f.name];if(f.required&&(!d||typeof d=="string"&&d.trim()===""))return!1;if(f.isValid&&d){const h=f.isValid;return h(d).valid}return!0})&&!c,[r,a,c]);return{errors:t,hasErrors:c,isFormValid:x,validateForm:n,validateSingleField:i,clearErrors:u}}const ye={spacing:{tight:"gap-3",normal:"gap-4",loose:"gap-6"},columns:{1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"},colSpan:{1:"col-span-1",2:"col-span-1 md:col-span-2",3:"col-span-1 md:col-span-2 lg:col-span-3",4:"col-span-1 md:col-span-2 lg:col-span-4",full:"col-span-full"}},ve={spacing:"normal",columns:1,responsive:!0};function le({display:r="inline",width:a="fit-content",className:t="",required:o,helpMessage:s,suffix:n,htmlFor:i,children:u,description:c,...x}){var v,b;const f=l.useId(),d=(((v=s==null?void 0:s.trim())==null?void 0:v.length)||0)>0,h=(((b=c==null?void 0:c.trim())==null?void 0:b.length)||0)>0,m=d?`${i??f}-help`:void 0,y=h?`${i??f}-description`:void 0;return e.jsxs("div",{style:{display:r==="inline"?"inline-block":"block",width:a},className:w.join("mb-0.5",t),children:[e.jsxs("div",{className:"relative flex",children:[e.jsxs("label",{className:"font-medium",htmlFor:i,...x,children:[u,o&&e.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),d&&e.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":m,"aria-label":"Help information",title:s,children:e.jsx(L.QuestionMarkCircled,{})}),d&&e.jsx("div",{id:m,className:"sr-only",children:s}),n&&e.jsx("span",{className:"ml-1",children:n})]}),h&&e.jsx("small",{id:y,className:"block opacity-80 mt-0.5",role:"note",children:c})]})}function he({elementId:r,type:a,message:t}){return l.useEffect(()=>{const o=document.getElementById(r);if(o){if(!t&&a==="error"){o.removeAttribute("data-error");return}if(!t&&a==="success"){o.removeAttribute("data-success");return}return o.setAttribute("aria-describedby",`${r}-${a}-message`),o.setAttribute("aria-invalid",a==="error"?"true":"false"),a==="error"&&o.setAttribute("data-error","true"),a==="success"&&o.setAttribute("data-success","true"),()=>{o.removeAttribute("aria-describedby"),o.removeAttribute("aria-invalid"),o.removeAttribute("data-error"),o.removeAttribute("data-success")}}},[r,a,t]),t?e.jsxs("small",{className:w.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",a==="error"&&"text-destructive",a==="success"&&"text-success"),role:"status",children:[a==="error"?e.jsx(ee.ExclamationTriangle,{}):e.jsx(L.CheckCircled,{}),e.jsx("span",{id:`${r}-${a}-message`,children:t})]}):null}const Hr={base:"",default:"ring ring-transparent focus:ring-primary-foreground/60 not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",underline:"border-b border-border focus:border-current/60 disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",outline:"border border-border focus:border-current/60 disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",solid:"bg-muted/50 focus:bg-muted/70 not-disabled:data-error:border-destructive/70 not-disabled:data-success:border-success/70"},Zr={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},Ee={variant:"default",rounded:"none"};function Ge({variant:r=Ee.variant,rounded:a,displayOnlyMode:t=!1,errorMessage:o,successMessage:s,type:n="text",className:i,...u}){const c=l.useId(),[x,f]=l.useState(!1);let d=a;r==="outline"&&!a&&(d="md"),d=d||Ee.rounded;const y=w.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted-foreground/70 hide-number-input-arrows transition-all","file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors",!t&&Hr[r],!t&&Zr[d],n==="password"&&"pr-10",!t&&"px-2 py-1",t&&"pointer-events-none",i);return e.jsxs("div",{className:w.join(t&&"cursor-text"),style:{height:u.height,width:u.width},children:[e.jsxs("div",{className:w.join(n==="password"&&"relative"),children:[e.jsx("input",{...u,id:c,type:n==="password"&&x?"text":n,"aria-disabled":u.disabled,readOnly:t,"aria-readonly":t||u["aria-readonly"],"data-error":o?!0:void 0,"data-success":s?!0:void 0,className:y}),n==="password"&&e.jsx("button",{onClick:()=>f(!x),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":x?"visible":"hidden",children:x?e.jsx(L.EyeOpened,{size:20}):e.jsx(L.EyeClosed,{size:20})})]}),!t&&e.jsx(he,{elementId:c,type:"error",message:o}),!t&&e.jsx(he,{elementId:c,type:"success",message:s})]})}function Yr({elementId:r,maxLength:a}){const[t,o]=l.useState(0);return l.useEffect(()=>{const s=document.getElementById(r);if(!s)return;const n=()=>{const i=s.value.length;o(i);const u=i>=a;s.setAttribute("aria-describedby",`${r}-character-count`),s.setAttribute("aria-invalid",u?"true":"false"),u?s.setAttribute("data-error","true"):s.removeAttribute("data-error")};return n(),s.addEventListener("input",n),s.setAttribute("maxlength",String(a)),()=>{s.removeEventListener("input",n),s.removeAttribute("maxlength"),s.removeAttribute("aria-describedby"),s.removeAttribute("aria-invalid"),s.removeAttribute("data-error")}},[r,a]),e.jsx("small",{className:w.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",t>=a&&"text-destructive",t<a&&"text-current"),role:"status",children:e.jsxs("span",{id:`${r}-character-count`,children:[t," / ",a," characters"]})})}function Qr(r,a){l.useEffect(()=>{const t=document.getElementById(r);if(!t)return;if(!a){t.style.height="auto";return}const o=()=>{t.style.height="auto",t.style.height=`${t.scrollHeight}px`};return o(),t.addEventListener("input",o),t.addEventListener("resize",o),window.addEventListener("resize",o),()=>{t.removeEventListener("input",o),t.removeEventListener("resize",o),window.removeEventListener("resize",o)}},[r,a])}const Ur={base:"","left-line":"border-l border-border focus:border-current/60 disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",outline:"border border-border focus:border-current/60 disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",solid:"bg-muted/50 focus:bg-muted/70 not-disabled:data-error:border-destructive/70 not-disabled:data-success:border-success/70"},Xr={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},Se={variant:"outline",rounded:"none"};function We({variant:r=Se.variant,rounded:a,displayOnlyMode:t=!1,errorMessage:o,successMessage:s,showResizeHandle:n=!1,autoExpand:i=!1,characterLimit:u=0,className:c,...x}){const f=l.useId();Qr(f,i||t);let d=a;r==="outline"&&!a&&(d="md"),d=d||Se.rounded;const m=w.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted-foreground/70 hide-number-input-arrows transition-all",!t&&Ur[r],!t&&Xr[d],!t&&"px-2 py-1",t&&"pointer-events-none",!n&&"no-resize-handle",c);return e.jsxs("div",{className:w.join("-space-y-1.5",t&&"cursor-text"),children:[e.jsx("textarea",{...x,id:f,"aria-disabled":x.disabled,readOnly:t,"aria-readonly":t||x["aria-readonly"],style:{resize:i?"none":void 0},className:m}),u>0&&e.jsx(Yr,{elementId:f,maxLength:u}),!t&&e.jsx(he,{elementId:f,type:"error",message:o}),!t&&e.jsx(he,{elementId:f,type:"success",message:s})]})}function Jr(r){const[a,t]=l.useState(!1),[o,s]=l.useState(!1);return l.useEffect(()=>{r?(s(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>s(!1),150))},[r]),{show:a,shouldRender:o}}function Or({isOpen:r,setIsOpen:a,filteredOptions:t,highlightedIndex:o,setHighlightedIndex:s,onSelect:n,triggerRef:i}){return{handleKeyDown:l.useCallback(c=>{var x;switch(c.key){case"ArrowDown":if(c.preventDefault(),!r)a(!0);else{const f=o<t.length-1?o+1:0;let d=f;for(let h=0;h<t.length;h++){const m=(f+h)%t.length;if(!t[m].disabled){d=m;break}}s(d)}break;case"ArrowUp":if(c.preventDefault(),!r)a(!0);else{const f=o>0?o-1:t.length-1;let d=f;for(let h=0;h<t.length;h++){const m=(f-h+t.length)%t.length;if(!t[m].disabled){d=m;break}}s(d)}break;case"Enter":case" ":if(c.preventDefault(),!r)a(!0);else if(o>=0&&o<t.length){const f=t[o];f.disabled||n(f)}break;case"Escape":c.preventDefault(),r&&(a(!1),(x=i.current)==null||x.focus());break;case"Tab":r&&a(!1);break}},[r,a,t,o,s,n,i])}}function es({isOpen:r,filteredOptions:a,selectedOption:t,shouldRender:o,optionsContainerRef:s}){const[n,i]=l.useState(-1),u=l.useMemo(()=>t?a.findIndex(c=>c.value===t.value):-1,[a,t]);return l.useEffect(()=>{r&&a.length>0?i(t&&u>=0?u:0):i(-1)},[a,r,t,u]),l.useEffect(()=>{if(n>=0&&s.current&&o){const c=()=>{const x=s.current,f=x==null?void 0:x.querySelector(`[data-option-index="${n}"]`);if(f){const d=r&&t&&n===u?"auto":"smooth";f.scrollIntoView({behavior:d,block:"nearest"})}};r&&o&&t?setTimeout(c,10):c()}},[n,o,r,t,a,s,u]),{highlightedIndex:n,setHighlightedIndex:i}}const Fe={sm:{trigger:"px-2 py-1 text-sm",options:"px-2 py-2 text-xs"},md:{trigger:"px-3 py-2 text-base",options:"px-3 py-2.5 text-sm"},lg:{trigger:"px-4 py-3 text-lg",options:"px-4 py-3 text-base"}};function ts(r){const a=l.useRef(null),t=l.useRef(null),o=l.useRef(null),[s,n]=l.useState(!1),[i,u]=l.useState(!1),[c,x]=l.useState({vertical:!1,horizontal:!1}),f=l.useRef(null),d=l.useRef(null),h=l.useCallback(()=>{const v=a.current;if(!v)return;const b=v.scrollHeight>v.clientHeight,C=v.scrollWidth>v.clientWidth;x({vertical:b,horizontal:C})},[]),m=l.useCallback(()=>{const v=a.current,b=t.current,C=o.current;if(v){if(b&&c.vertical){const g=(c.horizontal?v.clientHeight-r:v.clientHeight)/v.scrollHeight,j=Math.max(g*100,10),E=v.scrollHeight-v.clientHeight,z=E>0?v.scrollTop/E:0,k=100-j,F=z*k;b.style.height=`${j}%`,b.style.top=`${F}%`,b.style.transform="none"}if(C&&c.horizontal){const g=(c.vertical?v.clientWidth-r:v.clientWidth)/v.scrollWidth,j=Math.max(g*100,10),E=v.scrollWidth-v.clientWidth,z=E>0?v.scrollLeft/E:0,k=100-j,F=z*k;C.style.width=`${j}%`,C.style.left=`${F}%`,C.style.transform="none"}}},[c,r]),y=l.useCallback(()=>{f.current&&clearTimeout(f.current),d.current&&clearTimeout(d.current),n(!0),u(!1),m(),f.current=setTimeout(()=>{u(!0),d.current=setTimeout(()=>{n(!1),u(!1)},300)},1e3)},[m]);return l.useEffect(()=>{const v=a.current;if(!v)return;h();const b=new ResizeObserver(h);b.observe(v);const C=new MutationObserver(h);return C.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{b.disconnect(),C.disconnect()}},[h]),l.useEffect(()=>{m()},[c,m]),l.useEffect(()=>()=>{f.current&&clearTimeout(f.current),d.current&&clearTimeout(d.current)},[]),{viewportRef:a,verticalThumbRef:t,horizontalThumbRef:o,isScrolling:s,isFadingOut:i,scrollbarVisible:c,handleScroll:y}}function _e({className:r,thumbClassName:a,viewportClassName:t,scrollbarClassName:o,scrollbarThickness:s=8,children:n,id:i,ref:u,...c}){const{viewportRef:x,verticalThumbRef:f,horizontalThumbRef:d,isScrolling:h,isFadingOut:m,scrollbarVisible:y,handleScroll:v}=ts(s),b=V.n("relative flex-1 rounded-full bg-slate-400/60 hover:bg-slate-400/80 active:bg-slate-400",a);return e.jsxs("div",{ref:u,id:i,className:V.n("relative overflow-hidden",r),"data-scroll-area-root":"",...c,children:[e.jsx("div",{ref:x,className:V.n("h-full w-full overflow-auto rounded-[inherit] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",t),onScroll:v,"data-scroll-area-viewport":"",children:n}),y.vertical&&(h||m)&&e.jsx("div",{className:V.n("touch-none select-none transition-all","p-[1px]","absolute right-0 top-0",m?"opacity-0":"opacity-100",o),"data-scroll-area-scrollbar":"vertical","data-state":h?"visible":"hidden",style:{width:`${s}px`,height:y.horizontal?`calc(100% - ${s}px)`:"100%"},children:e.jsx("div",{ref:f,className:V.n("absolute rounded-full",b),"data-scroll-area-thumb":"",style:{height:"20%",top:"0%",width:"100%"}})}),y.horizontal&&(h||m)&&e.jsx("div",{className:V.n("touch-none select-none transition-all","p-[1px]","absolute bottom-0 left-0",m?"opacity-0":"opacity-100",o),"data-scroll-area-scrollbar":"horizontal","data-state":h?"visible":"hidden",style:{height:`${s}px`,width:y.vertical?`calc(100% - ${s}px)`:"100%"},children:e.jsx("div",{ref:d,className:V.n("absolute rounded-full",b),"data-scroll-area-thumb":"",style:{width:"20%",left:"0%",height:"100%"}})}),y.vertical&&y.horizontal&&e.jsx("div",{className:V.n("bg-transparent","absolute bottom-0 right-0"),"data-scroll-area-corner":"",style:{height:`${s}px`,width:`${s}px`}})]})}function qe({options:r,value:a,placeholder:t="Select an option...",searchable:o=!1,disabled:s=!1,clearable:n=!1,size:i="md",className:u,triggerClassName:c,dropdownClassName:x,id:f,ref:d,onChange:h,onSearch:m,searchPlaceholder:y="Search options..."}){const v=l.useId(),C=`${f??v}-listbox`,p=S=>`${C}-option-${S}`,[g,j]=l.useState(!1),[E,z]=l.useState(""),k=l.useRef(null),F=l.useRef(null),N=l.useRef(null),D=l.useRef(null),{show:A,shouldRender:M}=Jr(g),$=l.useMemo(()=>!o||!E?r:r.filter(S=>{var B;return S.text.toLowerCase().includes(E.toLowerCase())||((B=S.description)==null?void 0:B.toLowerCase().includes(E.toLowerCase()))}),[r,o,E]),I=l.useMemo(()=>r.find(S=>S.value===a),[r,a]),{highlightedIndex:R,setHighlightedIndex:G}=es({isOpen:g,filteredOptions:$,selectedOption:I,shouldRender:M,optionsContainerRef:D}),K=R>=0?p(R):void 0;l.useEffect(()=>{g&&M&&o&&F.current&&F.current.focus()},[g,o,M]);const U=l.useCallback(S=>{var B;S.disabled||(h==null||h(S.value),j(!1),z(""),(B=k.current)==null||B.focus())},[h]),{handleKeyDown:T}=Or({isOpen:g,setIsOpen:j,filteredOptions:$,highlightedIndex:R,setHighlightedIndex:G,onSelect:U,triggerRef:k});l.useEffect(()=>{if(!g)return;const S=B=>{var Z;N.current&&!N.current.contains(B.target)&&!((Z=k.current)!=null&&Z.contains(B.target))&&(j(!1),z(""))};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[g]);const _=()=>{s||(j(!g),g||(z(""),G(-1)))},X=S=>{S.disabled||(h==null||h(S.value),j(!1),z(""))},te=S=>{const B=S.target.value;z(B),m==null||m(B),G(-1)},re=S=>{S.preventDefault(),S.stopPropagation(),h==null||h("")};return e.jsxs("div",{className:w.join("relative",u),id:f,ref:d,"data-select":"true","data-value":a,"data-searchable":o,"data-disabled":s,"data-clearable":n,children:[e.jsxs("div",{className:"relative",children:[e.jsxs("button",{ref:k,type:"button",className:w.join("flex items-center justify-between w-full text-left bg-inherit border border-border rounded-md transition-colors","hover:border-primary focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary",s&&"opacity-50 cursor-not-allowed hover:border-border",g&&"border-primary ring-1 ring-primary",Fe[i].trigger,c),onClick:_,onKeyDown:T,disabled:s,"aria-disabled":s,"aria-haspopup":"listbox","aria-expanded":g,"aria-controls":g?C:void 0,"aria-activedescendant":g&&!o?K:void 0,"aria-label":I?I.text:t,"data-select-trigger":"true",children:[e.jsx("span",{className:w.join("block truncate",!I&&"opacity-70"),children:I?I.text:t}),e.jsx("div",{className:"flex items-center ml-2",children:e.jsx(L.ChevronDown,{size:16,className:w.join("transition-transform",g&&"rotate-180")})})]}),n&&I&&e.jsx("button",{type:"button",onClick:re,className:"absolute right-8 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-accent/20 transition-colors group z-10","aria-label":"Clear selection","data-select-clear":"true",children:e.jsx(ee.X,{size:14,className:"opacity-70 group-hover:opacity-100 transition-opacity"})})]}),M&&e.jsxs("div",{ref:N,className:w.join("absolute z-50 w-full mt-1 bg-popover text-popover-foreground border border-border rounded-md shadow-lg transition-all",A?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",x),id:C,role:"listbox","data-select-content":"true",children:[o&&e.jsx("div",{className:"border-b border-border",children:e.jsx("input",{ref:F,type:"text",value:E,onChange:te,onKeyDown:T,placeholder:y,className:"w-full px-2 py-2 text-inherit focus:outline-none","aria-autocomplete":"list","aria-controls":C,"aria-activedescendant":K,"data-select-search":"true"})}),e.jsx(_e,{ref:D,viewportClassName:"max-h-60",children:$.length>0?$.map((S,B)=>e.jsxs("div",{id:p(B),className:w.join("flex items-center cursor-pointer transition-colors","hover:bg-accent/10 focus:bg-accent/10",Fe[i].options,S.disabled&&"opacity-50 cursor-not-allowed",B===R&&"bg-accent/20",a===S.value&&"bg-accent/30"),onClick:()=>X(S),role:"option","aria-selected":a===S.value,"aria-disabled":S.disabled,"data-select-option":"true","data-value":S.value,"data-highlighted":B===R,"data-option-index":B,children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium",children:S.text}),S.description&&e.jsx("div",{className:"text-xs opacity-70 mt-0.5",children:S.description})]}),a===S.value&&e.jsx(L.Check,{size:16,className:"ml-2 text-primary flex-shrink-0"})]},S.value)):e.jsx("div",{className:"px-3 py-2 text-sm opacity-70 text-center",children:o&&E?"No results found":"No options available"})})]})]})}function Pe({itemId:r,checked:a,onChange:t,name:o,disabled:s=!1,className:n=""}){const i="relative inline-flex items-center justify-center rounded-full",u=()=>{s||t()},c=w.join(i,!a&&"hover:border-current/60",!s&&"border-current cursor-pointer",s&&"border-muted/60 cursor-not-allowed",n);return e.jsx("div",{id:r,role:"radio",tabIndex:-1,"aria-checked":a,"aria-disabled":s,"aria-description":`Radio button for ${o}`,"aria-labelledby":`${r}-label`,onClick:u,className:c,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:a&&e.jsx("div",{className:w.join("size-full aspect-square rounded-full",s&&"bg-muted/60",!s&&"bg-current")})})}function fe({value:r,children:a,className:t="",isSelected:o=!1,onChange:s,disabled:n=!1,hideInput:i=!1,description:u,name:c}){const f=`radio-${l.useId()}-${r}`,d=()=>{n||s==null||s(r)};return e.jsxs("div",{title:u,className:w.join("relative flex items-center",t,i&&`p-2 border-2 focus-within:border-dashed focus-within:${n?"border-current/50":"border-current/80"}`,i&&!o&&`border-transparent ${n?"":"not-focus-within:hover:border-border/60"}`,i&&o&&"border-border",n&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!i&&e.jsx(Pe,{itemId:f,name:c||"",checked:o,onChange:d,disabled:n,className:w.join(i&&"")}),e.jsx("div",{id:i?f:void 0,tabIndex:i?-1:void 0,role:i?"radio":void 0,onClick:i?d:void 0,"aria-checked":i?o?"true":"false":void 0,"aria-disabled":i?n:void 0,"aria-description":i?u||`Radio button for ${c}`:void 0,"aria-labelledby":i?`${f}-label`:void 0,className:w.join(i&&"size-full",typeof a=="object"&&"grow focus:outline-none"),children:e.jsx("label",{id:`${f}-label`,onClick:i?void 0:d,className:w.join(n&&"cursor-not-allowed",!n&&"cursor-pointer"),children:a})})]})}function rs(r,a){const[t,o]=l.useState(a),[s,n]=l.useState(-1),[i,u]=l.useState(!1),c=l.useCallback((m,y)=>{var C;const v=m[y];v.hasAttribute("disabled")||v.getAttribute("aria-disabled")==="true"||((C=m[y])==null||C.click(),n(y))},[]),x=l.useCallback((m,y)=>{var b;if(m.preventDefault(),i||!y.length)return;const v=a!==-1?a:0;(b=y[v])==null||b.focus(),o(v),a!==-1&&c(y,v)},[a,i,c]),f=l.useCallback(m=>{var C;if(!m.shiftKey)return;m.preventDefault();const y=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(p=>!p.hasAttribute("disabled")&&p.tabIndex>=0),v=y.findIndex(p=>p.id===r),b=v>0?v-1:y.length-1;(C=y[b])==null||C.focus()},[r]),d=l.useCallback((m,y)=>{var g;if(!y.length)return;const v=m.target;if(!y.some(j=>j.id===v.id))return;const C=t!==-1?t:0;let p=C;switch(m.key){case"ArrowUp":case"ArrowLeft":m.preventDefault(),p=C>0?C-1:y.length-1;break;case"ArrowDown":case"ArrowRight":m.preventDefault(),p=(C+1)%y.length;break;case" ":m.preventDefault(),c(y,C);return;case"Tab":f(m);return;default:return}(g=y[p])==null||g.focus(),o(p),s!==-1&&c(y,p)},[t,s,f,c]),h=l.useCallback(()=>{const m=document.querySelector(`[id="${r}"][role="radiogroup"]`);return m?Array.from(m.querySelectorAll('[role="radio"]')):[]},[r]);l.useEffect(()=>{const m=document.querySelector(`[id="${r}"][role="radiogroup"]`);if(!m)return;const y=h(),v=g=>x(g,y),b=g=>d(g,y),C=()=>u(!0),p=()=>u(!1);return document.addEventListener("keydown",b),m.addEventListener("focus",v),m.addEventListener("mousedown",C),document.addEventListener("mouseup",p),()=>{document.removeEventListener("keydown",b),m.removeEventListener("focus",v),m.removeEventListener("mousedown",C),document.removeEventListener("mouseup",p)}},[r,h,x,d])}function Ke({options:r=[],value:a,onChange:t,id:o,children:s,className:n="",childrenClassName:i="",hideInputs:u=!1}){const c=l.useId(),x=o||`radio-group-${c}`;rs(x,r.findIndex(d=>d===a));const f=l.useMemo(()=>r.reduce((d,h)=>(typeof h=="string"?d.some(m=>m.value===h)||d.push({label:h,value:h}):d.push(h),d),[]),[r]);return e.jsxs("div",{id:x,role:"radiogroup",tabIndex:0,className:w.join(n,"focus:outline-none"),children:[f.length>0&&f.map((d,h)=>e.jsx(fe,{value:d.value,isSelected:a===d.value,onChange:t,name:x,disabled:d.disabled,description:d.description,hideInput:u,className:i,children:d.label},`${d.value}-${h}`)),f.length===0&&s&&l.Children.map(s,d=>l.isValidElement(d)&&d.type===fe?e.jsx(fe,{...d.props,className:w.join(i,d.props.className),hideInput:d.props.hideInput||u,isSelected:a===d.props.value,onChange:t,name:x,children:d.props.children}):null)]})}function ss({form:r,initialData:a={},onDataChange:t,onSubmit:o,submitButton:s,columns:n=ve.columns,responsive:i=ve.responsive,spacing:u=ve.spacing,className:c,id:x,ref:f}){const[d,h]=l.useState(a),{errors:m,validateForm:y,validateSingleField:v,isFormValid:b}=Kr(r,d),C=l.useCallback((k,F)=>{const N={...d,[k]:F};h(N),t==null||t(N),v(k,F)},[d,t,v]),p=l.useCallback(k=>{k.preventDefault(),y(d)&&o&&o(d)},[d,y,o]),g=k=>{const F=[],N={};return k.colSpan&&n>1&&F.push(ye.colSpan[k.colSpan]),{className:w.join(F.join(" "),k.className),style:N}},j=k=>{const F=d[k.name],N=m[k.name],D=x?`${x}-${k.name}`:k.name,{className:A,style:M}=g(k),$=()=>{switch(k.__type){case"input":{const I=k;return e.jsxs(e.Fragment,{children:[e.jsx(le,{htmlFor:D,required:k.required,description:k.description,children:k.label}),e.jsx(Ge,{id:D,type:I.type||"text",placeholder:I.placeholder,value:F||"",onChange:R=>C(k.name,R.target.value),disabled:k.disabled,variant:I.variant,rounded:I.rounded,errorMessage:N,"data-field-name":k.name,"data-field-type":k.__type})]})}case"textarea":{const I=k;return e.jsxs(e.Fragment,{children:[e.jsx(le,{htmlFor:D,required:k.required,description:k.description,children:k.label}),e.jsx(We,{id:D,placeholder:I.placeholder,value:F||"",onChange:R=>C(k.name,R.target.value),disabled:k.disabled,variant:I.variant,rounded:I.rounded,rows:I.rows,autoExpand:I.autoExpand,characterLimit:I.characterLimit,errorMessage:N,"data-field-name":k.name,"data-field-type":k.__type})]})}case"select":{const I=k,R=I.options.map(G=>({text:G.label,value:G.value,disabled:G.disabled}));return e.jsxs(e.Fragment,{children:[e.jsx(le,{htmlFor:D,required:k.required,description:k.description,children:k.label}),e.jsx(qe,{id:D,options:R,value:F||"",onChange:G=>C(k.name,G),placeholder:I.placeholder,disabled:k.disabled,searchable:I.searchable,clearable:I.clearable,"data-field-name":k.name,"data-field-type":k.__type}),N&&e.jsx("p",{className:"text-sm text-destructive mt-1",role:"alert",children:N})]})}case"checkbox":{const I=k,R=16;return e.jsxs("div",{className:"space-x-2",children:[e.jsx(xe,{id:D,checked:F||!1,onCheckedChange:G=>C(k.name,G),disabled:k.disabled,"data-field-name":k.name,"data-field-type":k.__type,size:R}),e.jsxs("div",{className:"inline-block",style:{maxWidth:`calc(100% - ${R+10}px)`},children:[" ",e.jsx(le,{htmlFor:D,className:"cursor-pointer",children:I.text||k.label}),k.description&&e.jsx("p",{className:"text-sm opacity-80 mt-1",children:k.description}),N&&e.jsx("p",{className:"text-sm text-destructive mt-1",role:"alert",children:N})]})]})}case"radio":{const R=k.options.map(G=>({label:G.label,value:G.value,disabled:G.disabled}));return e.jsxs(e.Fragment,{children:[e.jsx(le,{required:k.required,children:k.label}),k.description&&e.jsx("p",{className:"text-sm opacity-80 mb-2",children:k.description}),e.jsx(Ke,{options:R,value:F||"",onChange:G=>C(k.name,G),id:D,"data-field-name":k.name,"data-field-type":k.__type}),N&&e.jsx("p",{className:"text-sm text-destructive mt-1",role:"alert",children:N})]})}default:return null}};return e.jsx("div",{className:A,style:M,children:$()},k.name)},E=w.join("grid",n&&n>1?ye.columns[n]:"grid-cols-1",ye.spacing[u],c),z=()=>s?l.isValidElement(s)?l.cloneElement(s,{disabled:!b,"aria-disabled":!b,...s.props??{}}):e.jsx("div",{className:"col-span-full",children:s}):null;return e.jsxs("form",{ref:f,id:x,onSubmit:p,className:E,"data-form-fields":r.length,"data-form-columns":n,"data-form-responsive":i,"data-form-valid":b,children:[r.map(j),z()]})}function He({id:r,children:a,message:t,placement:o="top",disabled:s=!1,delay:n=100,showArrow:i=!0,className:u}){const[c,x]=l.useState(!1),[f,d]=l.useState(!1),[h,m]=l.useState(!1),[y,v]=l.useState(!1),b=l.useRef(null),C=l.useId(),p=r??C,g=l.useCallback(()=>{s||(b.current&&clearTimeout(b.current),b.current=window.setTimeout(()=>{x(!0)},n))},[s,n]),j=l.useCallback((F=!1)=>{if(b.current&&clearTimeout(b.current),F){x(!1);return}b.current=window.setTimeout(()=>{x(!1)},100)},[]);l.useEffect(()=>{!f&&!h&&!y&&c&&j()},[f,h,y,c,j]),l.useEffect(()=>{if(!c)return;const F=()=>{j(!0)};return window.addEventListener("scroll",F,!0),()=>{window.removeEventListener("scroll",F,!0)}},[c,j]),l.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]);const E=()=>{const F="absolute z-50 px-2 py-1 text-sm rounded shadow-lg bg-tooltip text-tooltip-foreground pointer-events-auto transition-all ease-out w-max max-w-xs",N=c?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none",D={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},A={top:"origin-bottom",bottom:"origin-top",left:"origin-right",right:"origin-left"};return w.join(F,D[o],A[o],N,u)},z=()=>{if(!i)return"";const F="absolute w-0 h-0 pointer-events-none",N={top:"top-full left-1/2 -translate-x-1/2 border-l-[6px] border-r-[6px] border-t-[6px] border-l-transparent border-r-transparent border-t-tooltip",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-[6px] border-r-[6px] border-b-[6px] border-l-transparent border-r-transparent border-b-tooltip",left:"left-full top-1/2 -translate-y-1/2 border-t-[6px] border-b-[6px] border-l-[6px] border-t-transparent border-b-transparent border-l-tooltip",right:"right-full top-1/2 -translate-y-1/2 border-t-[6px] border-b-[6px] border-r-[6px] border-t-transparent border-b-transparent border-r-tooltip"};return w.join(F,N[o])},k=a.props;return e.jsx(e.Fragment,{children:l.cloneElement(a,{style:{...k.style,position:"relative"},onMouseEnter:()=>{d(!0),g()},onMouseLeave:()=>{d(!1)},onFocus:()=>{v(!0),g()},onBlur:()=>{v(!1),j(!0)},onKeyDown:F=>{F.key==="Escape"&&j(!0)},"aria-describedby":s?void 0:p,children:e.jsxs(e.Fragment,{children:[k.children,!s&&e.jsxs("div",{id:p,role:"tooltip",className:E(),"aria-hidden":!c,"aria-live":c?"polite":void 0,onMouseEnter:()=>{m(!0),b.current&&clearTimeout(b.current)},onMouseLeave:()=>{m(!1)},children:[t,i&&e.jsx("div",{className:z(),"aria-hidden":!0})]})]})})})}function ns({id:r,ref:a,design:t="filled",iconSize:o=14,className:s,...n}){const i=t==="filled"?L.InfoCircledFilled:ee.InfoCircled;return e.jsx(He,{...n,children:e.jsx("div",{id:r,ref:a,className:w.join("inline-block cursor-help text-muted-foreground transition-colors align-top",s),"data-help-icon":"true","data-design":t,"data-size":o,children:e.jsx(i,{size:o,className:"fill-current"})})})}function as(r){const[a,t]=l.useState(!1),[o,s]=l.useState(!1);return l.useEffect(()=>{r?(s(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>s(!1),150))},[r]),{show:a,shouldRender:o}}function os(r,a){l.useEffect(()=>{const t=o=>{o.key==="Escape"&&r&&a()};return document.addEventListener("keydown",t),r&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[r,a])}function ls(r,a){const t=l.useRef(null),o=l.useCallback(()=>{const s=document.getElementById(r);if(!s)return;const n=s.querySelectorAll('[data-modal-action="true"]');if(n.length>0){n[0].focus();return}const i=s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(i.length>0){const u=Array.from(i).filter(c=>!(c instanceof HTMLButtonElement&&c.getAttribute("data-modal-close-button")==="true"));if(u.length>0){u[0].focus();return}i[0].focus();return}s.focus()},[r]);l.useEffect(()=>(a&&(t.current=document.activeElement,o()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[a,o])}function is({id:r,isOpen:a,onClose:t,title:o,children:s,contentOnly:n=!1,className:i,overlayClassName:u,containerClassName:c,hideCloseButton:x=!1,actions:f=[],disableCloseOnOverlayClick:d=!1,ariaLabelledBy:h,ariaDescribedBy:m}){const y=l.useId(),v=r||`modal-${y}`,b=r?`${r}-title`:`modal-title-${y}`,{show:C,shouldRender:p}=as(a);if(ls(v,p),os(p,t),!p)return null;const g=()=>o?l.isValidElement(o)?e.jsx("div",{className:"mb-4",children:o}):e.jsx("h2",{className:"mb-4 text-xl font-semibold",id:b,children:o}):null,j=()=>f.length===0?null:e.jsx("div",{className:"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3",children:f.map((E,z)=>{const{label:k,...F}=E,N=F;return e.jsx(Te,{...N,"data-modal-action":"true",children:k},z)})});return e.jsx(e.Fragment,{children:pe.createPortal(e.jsx("div",{"aria-labelledby":h??o?b:void 0,"aria-describedby":m,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:e.jsxs("div",{className:V.n("flex min-h-screen items-center justify-center p-4",c),children:[e.jsx("div",{className:V.n("fixed inset-0 bg-black/20 transition-all",u),onClick:()=>{d||t()}}),n&&e.jsx("div",{className:V.n("relative w-fit",i),children:s}),!n&&e.jsxs("div",{id:v,tabIndex:-1,className:V.n("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover text-popover-foreground transition-all p-6 focus:ring ease-in",C?"opacity-100 scale-100":"opacity-0 scale-90",i),children:[!x&&e.jsx("button",{type:"button",onClick:t,"data-modal-close-button":"true",className:"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:e.jsx(ee.X,{size:18})}),g(),s,j()]})]})}),document.body)})}const cs={link:"text-primary hover:text-primary-foreground hover:bg-primary/10 aria-current:text-primary-foreground aria-current:bg-primary",outline:"border border-primary text-primary hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground aria-current:border-primary",filled:"bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground"},ds={sm:"px-2 py-1 text-sm min-w-[32px] min-h-8",md:"px-2 py-1 text-base min-w-[40px] min-h-10"};function us({page:r,pageCount:a=5,maxVisiblePages:t=5,showFirstLast:o=!0,onPageChange:s,size:n="md",variant:i="link",className:u,ref:c,buttonsClassName:x,...f}){const d=a===1/0,m=l.useCallback(()=>{if(d)return[];const j=a,E=Math.min(t,j);if(j<=E)return Array.from({length:j},(N,D)=>D+1);const z=Math.floor(E/2);let k=Math.max(1,r-z),F=Math.min(j,k+E-1);return F-k+1<E&&(k=Math.max(1,F-E+1),F=Math.min(j,k+E-1)),Array.from({length:F-k+1},(N,D)=>k+D)},[d,t,r,a])(),y=r>1,v=d||r<a,b=o&&!d,C=o&&!d,p=j=>{j>=1&&(d||j<=a)&&s(j)},g=l.useCallback(()=>{const j=V.n("flex items-center justify-center min-w-fit","disabled:opacity-50 disabled:cursor-not-allowed",ds[n],"rounded-md");return V.n(j,cs[i],x)},[i,n,x]);return e.jsxs("nav",{ref:c,className:V.n("flex items-center justify-center gap-1",u),role:"navigation","aria-label":"Pagination","data-page":r,"data-page-count":d?"infinite":a,...f,children:[b&&e.jsxs("button",{onClick:()=>p(1),className:g(),disabled:r===1,"aria-label":"Go to first page",children:[e.jsx(L.ChevronDoubleLeft,{size:n==="sm"?12:15}),e.jsx("span",{className:"ml-1",children:"First"})]}),e.jsxs("button",{onClick:()=>p(r-1),className:g(),disabled:!y,"aria-label":"Go to previous page",children:[e.jsx(L.ChevronLeft,{size:n==="sm"?12:15}),e.jsx("span",{className:"ml-1",children:"Previous"})]}),!d&&m.map(j=>e.jsx("button",{onClick:()=>p(j),className:V.n(g(),"aspect-square"),"aria-label":`Go to page ${j}`,"aria-current":j===r?!0:void 0,children:j},j)),e.jsxs("button",{onClick:()=>p(r+1),className:g(),disabled:!v,"aria-label":"Go to next page",children:[e.jsx("span",{className:"mr-1",children:"Next"}),e.jsx(L.ChevronRight,{size:n==="sm"?12:15})]}),C&&e.jsxs("button",{onClick:()=>p(a),className:g(),disabled:r===a,"aria-label":"Go to last page",children:[e.jsx("span",{className:"mr-1",children:"Last"}),e.jsx(L.ChevronDoubleRight,{size:n==="sm"?12:15})]})]})}function fs(r){const[a,t]=l.useState(!1),[o,s]=l.useState(!1);return l.useEffect(()=>{r?(s(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>s(!1),300))},[r]),{show:a,shouldRender:o}}function xs(r,a){l.useEffect(()=>{const t=o=>{o.key==="Escape"&&r&&a()};return document.addEventListener("keydown",t),r&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[r,a])}function ms(r,a){const t=l.useRef(null),o=l.useCallback(()=>{const s=document.getElementById(r);if(!s)return;const n=s.querySelectorAll('[data-panel-action="true"]');if(n.length>0){n[0].focus();return}const i=s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(i.length>0){const u=Array.from(i).filter(c=>!(c instanceof HTMLButtonElement&&c.getAttribute("data-panel-close-button")==="true"));if(u.length>0){u[0].focus();return}i[0].focus();return}s.focus()},[r]);l.useEffect(()=>(a&&(t.current=document.activeElement,o()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[a,o])}function hs({ref:r,id:a,isOpen:t,onClose:o,title:s,children:n,footer:i,className:u,overlayClassName:c,hideCloseButton:x=!1,disableCloseOnOverlayClick:f=!1,ariaLabelledBy:d,ariaDescribedBy:h}){const m=l.useId(),y=a||`panel-${m}`,v=a?`${a}-title`:`panel-title-${m}`,{show:b,shouldRender:C}=fs(t);if(ms(y,C),xs(C,o),!C)return null;const p=()=>s?l.isValidElement(s)?e.jsx("div",{children:s}):e.jsx("h2",{className:"text-2xl font-semibold",id:v,children:s}):null,g=()=>{if(!i)return null;if(l.isValidElement(i)){const j=i,E=j.props.className||"";return l.cloneElement(j,{className:V.n("px-6 py-4",E)})}return e.jsx("div",{className:"px-6 py-4",children:i})};return e.jsx(e.Fragment,{children:pe.createPortal(e.jsxs("div",{"aria-labelledby":d??s?v:void 0,"aria-describedby":h,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-hidden","data-panel-open":t,children:[e.jsx("div",{className:V.n("fixed inset-0 bg-black/40 transition-opacity",b?"opacity-100":"opacity-0",c),onClick:()=>{f||o()}}),e.jsx("div",{className:"fixed inset-y-0 right-0 flex max-w-full",children:e.jsx("div",{id:y,ref:r,tabIndex:-1,className:V.n("relative h-full max-w-md transform shadow-xl bg-popover text-popover-foreground transition-transform ease-in-out border-l border-border",b?"translate-x-0":"translate-x-full",u),children:e.jsxs("div",{className:"flex h-full flex-col",children:[s&&e.jsx("div",{className:"px-6 pt-6",children:p()}),!x&&e.jsx("button",{type:"button",onClick:o,"data-panel-close-button":"true","aria-label":"Close panel",className:"rounded-md p-0.5 top-3 right-3 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:e.jsx(ee.X,{size:18})}),e.jsx("div",{className:V.n("flex-1 overflow-y-auto px-6 pb-6",s?"pt-6":"pt-10"),children:n}),g()]})})})]}),document.body)})}const ps={thin:{horizontal:"h-px",vertical:"w-px"},medium:{horizontal:"h-0.5",vertical:"w-0.5"},thick:{horizontal:"h-1",vertical:"w-1"},"extra-thick":{horizontal:"h-2",vertical:"w-2"}},bs={horizontal:"w-full",vertical:"min-h-4 h-full"};function gs({orientation:r="horizontal",decorative:a=!1,thickness:t="thin",className:o,...s}){const n=w.join("shrink-0 bg-border",bs[r],ps[t][r],o);return e.jsx("div",{...s,className:n,role:a?"presentation":"separator","aria-orientation":a?void 0:r,"aria-hidden":a,"data-orientation":r,"data-thickness":t})}const Ie={shape:{rectangle:"rounded-md min-h-1",circle:"rounded-full aspect-square min-h-1",text:"rounded-sm min-h-1 h-4"},lineSpacing:{xs:"space-y-1",sm:"space-y-2",md:"space-y-3",lg:"space-y-4",xl:"space-y-6"}};function ys({shape:r="rectangle",lineSpacing:a="sm",className:t,lines:o=1,animate:s=!0,ref:n,...i}){const u=w.join("bg-muted/70",s&&"animate-pulse",Ie.shape[r],t);return o>1?e.jsx("div",{ref:n,className:Ie.lineSpacing[a],role:"presentation","aria-hidden":"true","data-testid":"skeleton-container","data-lines":o,"data-shape":r,"data-animate":s,...i,children:Array.from({length:o},(c,x)=>e.jsx("div",{className:w.join(u,x===o-1&&"w-3/4"),role:"presentation","aria-hidden":"true","data-testid":"skeleton-line","data-line-index":x},x))}):e.jsx("div",{ref:n,className:u,role:"presentation","aria-hidden":"true","data-testid":"skeleton","data-shape":r,"data-animate":s,...i})}function vs({id:r,value:a,defaultValue:t=0,onValueChange:o,min:s=0,max:n=100,step:i=1,disabled:u=!1,trackClassName:c,rangeClassName:x,thumbClassName:f,className:d,ref:h,ariaLabel:m,ariaLabelledBy:y,...v}){const[b,C]=l.useState(t),p=a!==void 0,g=p?a:b,j=l.useRef(null),E=l.useRef(!1),z=l.useRef(0),k=l.useCallback($=>{const I=Math.max(s,Math.min(n,$)),R=Math.round(I/i)*i;p||C(R),o==null||o(R)},[s,n,i,p,o]),F=l.useCallback(($,I=!1)=>{var U;const R=(U=j.current)==null?void 0:U.getBoundingClientRect();if(!R)return g;let G=$.clientX;I&&(G=G-z.current);const K=Math.max(0,Math.min(1,(G-R.left)/R.width));return s+(n-s)*K},[s,n,g]),N=l.useCallback($=>{if(u||$.target!==$.currentTarget)return;const I=F($);k(I)},[u,F,k]),D=l.useCallback($=>{var U;if(u)return;$.stopPropagation(),E.current=!0;const I=(U=j.current)==null?void 0:U.getBoundingClientRect(),R=$.currentTarget.getBoundingClientRect();if(I&&R){const T=R.left+R.width/2;z.current=$.clientX-T}$.currentTarget.setPointerCapture($.pointerId);const G=T=>{if(!E.current)return;const _=F(T,!0);k(_)},K=T=>{if(T.pointerId===$.pointerId){E.current=!1,z.current=0;try{$.currentTarget.releasePointerCapture(T.pointerId)}catch{}document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",K)}};document.addEventListener("pointermove",G),document.addEventListener("pointerup",K)},[u,F,k]),A=l.useCallback($=>{if(u)return;let I=g;switch($.key){case"ArrowRight":case"ArrowUp":I=g+i;break;case"ArrowLeft":case"ArrowDown":I=g-i;break;case"Home":I=s;break;case"End":I=n;break;case"PageUp":I=g+i*10;break;case"PageDown":I=g-i*10;break;default:return}$.preventDefault(),k(I)},[u,g,i,s,n,k]),M=n===s?0:(g-s)/(n-s)*100;return e.jsx("div",{id:r,ref:h,className:V.n("relative flex items-center w-full touch-none select-none",u&&"opacity-50 cursor-not-allowed",d),"data-disabled":u,"data-value":g,"data-min":s,"data-max":n,"data-step":i,...v,children:e.jsxs("div",{ref:j,className:V.n("relative h-1.5 w-full rounded-full bg-muted-foreground cursor-pointer",u&&"cursor-not-allowed",c),onPointerDown:N,children:[e.jsx("div",{className:V.n("absolute h-full rounded-full pointer-events-none",!E.current&&"transition-all",x),style:{width:`${M}%`}}),e.jsx("div",{className:V.n("absolute size-5 -top-2 rounded-full shadow-md cursor-grab",u&&"cursor-not-allowed",!u&&"cursor-grab focus:outline-none focus:ring-2",E.current?"cursor-grabbing scale-110":"transition-all",f),style:{left:`calc(${M}% - 10px)`},tabIndex:u?-1:0,role:"slider","aria-valuemin":s,"aria-valuemax":n,"aria-valuenow":g,"aria-label":m,"aria-labelledby":y,"aria-disabled":u,onKeyDown:A,onPointerDown:D})]})})}function js({data:r,initialSort:a={key:null,direction:null}}){const[t,o]=l.useState(a),[s,n]=l.useState();return{sortedData:l.useMemo(()=>!t.key||!t.direction?r:[...r].sort((c,x)=>{if(s){const m=s(c,x);return t.direction==="desc"?-m:m}const f=c[t.key],d=x[t.key];if(f===d)return 0;let h=0;return typeof f=="string"&&typeof d=="string"?h=f.localeCompare(d):typeof f=="number"&&typeof d=="number"?h=f-d:f instanceof Date&&d instanceof Date?h=f.getTime()-d.getTime():h=String(f).localeCompare(String(d)),t.direction==="desc"?-h:h}),[r,t,s]),sortConfig:t,handleSort:(c,x)=>{n(()=>x),o(f=>{if(f.key===c){const d=f.direction==="asc"?"desc":f.direction==="desc"?null:"asc";return{key:d?c:null,direction:d}}else return{key:c,direction:"asc"}})}}}function ws({initialSelected:r=[]}={}){const[a,t]=l.useState(new Set(r));return{selectedRows:a,isRowSelected:f=>a.has(f),selectRow:f=>{t(d=>new Set([...d,f]))},deselectRow:f=>{t(d=>{const h=new Set(d);return h.delete(f),h})},selectAll:f=>{t(new Set(f))},deselectAll:()=>{t(new Set)},isAllSelected:f=>f.length>0&&f.every(d=>a.has(d)),isPartiallySelected:f=>{const d=f.filter(h=>a.has(h)).length;return d>0&&d<f.length}}}const ks={sm:{container:"text-sm",table:"w-full border-collapse",header:"border-b border-border",headerCell:"px-3 py-2.5 font-medium",sortButton:"inline-flex items-center gap-1 hover:text-accent transition-colors",cell:"px-3 py-2 text-sm",selectedRow:"bg-accent/10 hover:bg-accent/20",checkbox:"pl-5 pr-2 text-left w-3",checkboxSize:12},md:{container:"text-base",table:"w-full border-collapse",header:"border-b-2 border-border",headerCell:"px-4 py-3 font-semibold",sortButton:"inline-flex items-center gap-2 hover:text-accent transition-colors",cell:"px-4 py-3",selectedRow:"bg-accent/10 hover:bg-accent/20",checkbox:"pl-6 pr-3 py-3 text-left w-6",checkboxSize:16},lg:{container:"text-lg",table:"w-full border-collapse",header:"border-b-2 border-border",headerCell:"px-6 py-4 font-bold",sortButton:"inline-flex items-center gap-2 hover:text-accent transition-colors",cell:"px-6 py-4",selectedRow:"bg-accent/10 hover:bg-accent/20",checkbox:"pl-6 pr-3 py-4 text-left w-8",checkboxSize:18}};function Cs({id:r,className:a,ref:t,size:o="md",data:s,columns:n,selectable:i=!1,getRowId:u=(p,g)=>g,initialSelected:c=[],onSelectionChange:x,showHeader:f=!0,striped:d=!1,hoverable:h=!0,emptyState:m,loading:y=!1,loadingContent:v,caption:b,...C}){const p=ks[o],{sortedData:g,sortConfig:j,handleSort:E}=js({data:s,initialSort:{key:null,direction:null}}),{selectedRows:z,isRowSelected:k,selectRow:F,deselectRow:N,selectAll:D,deselectAll:A,isAllSelected:M,isPartiallySelected:$}=ws({initialSelected:c}),I=s.map((T,_)=>u(T,_));l.useEffect(()=>{x&&x(Array.from(z))},[z,x]);const R=()=>{M(I)?A():D(I)},G=(T,_)=>_.accessor?typeof _.accessor=="function"?_.accessor(T):T[_.accessor]:T[_.key],K=(T,_)=>{const X=G(T,_);return _.cell?_.cell(T,X):e.jsx(e.Fragment,{children:X})},U=T=>{switch(T){case"center":return"text-center";case"right":return"text-right";default:return"text-left"}};return y?e.jsx("div",{id:r,ref:t,className:w.join("flex items-center justify-center p-8",p.container,a),...C,children:v||e.jsx("div",{children:"Loading..."})}):s.length===0?e.jsx("div",{id:r,ref:t,className:w.join("flex items-center justify-center p-8",p.container,a),...C,children:m||e.jsx("div",{className:"text-muted-foreground",children:"No data available"})}):e.jsx("div",{id:r,ref:t,className:w.join("overflow-x-auto border border-border rounded-lg",p.container,a),"data-testid":"table-container","data-size":o,"data-selectable":i,...C,children:e.jsxs("table",{className:p.table,role:"table",children:[b&&e.jsx("caption",{className:"sr-only",children:b}),e.jsxs("colgroup",{children:[i&&e.jsx("col",{style:{width:"1%"}}),n.map(T=>e.jsx("col",{style:T.width?{width:T.width}:{},className:T.columnClassName},T.key))]}),f&&e.jsx("thead",{className:p.header,role:"rowgroup",children:e.jsxs("tr",{role:"row",children:[i&&e.jsx("th",{className:p.checkbox,role:"columnheader","aria-label":"Select all rows",children:e.jsx(xe,{size:p.checkboxSize,checked:M(I),indeterminate:$(I),onCheckedChange:R,"aria-label":"Select all rows",className:"align-middle"})}),n.map(T=>{const _=j.key===T.key?j.direction:null;return e.jsx("th",{className:w.join(p.headerCell,U(T.align),T.headerClassName),role:"columnheader","aria-sort":j.key===T.key?j.direction==="asc"?"ascending":j.direction==="desc"?"descending":"none":T.sortable?"none":void 0,children:T.sortable?e.jsxs("button",{className:p.sortButton,onClick:()=>E(T.key,T.sortFunction),"aria-label":`Sort by ${T.header}`,children:[T.header,e.jsxs("div",{className:"flex flex-col items-center -space-y-1",children:[e.jsx(L.ChevronUp,{size:p.checkboxSize-4,className:_==="asc"?"text-accent":"opacity-40"}),e.jsx(L.ChevronDown,{size:p.checkboxSize-4,className:_==="desc"?"text-accent":"opacity-40"})]})]}):T.header},T.key)})]})}),e.jsx("tbody",{role:"rowgroup",children:g.map((T,_)=>{const X=u(T,_),te=k(X),re=_===g.length-1;return e.jsxs("tr",{className:w.join("transition-all",!re&&"border-b border-border",h&&"hover:bg-accent/15",d&&_%2===1&&"bg-accent/25",te&&p.selectedRow),role:"row","aria-selected":i?te:void 0,"data-testid":"table-row","data-row-id":X,"data-selected":te,children:[i&&e.jsx("td",{className:p.checkbox,role:"cell",children:e.jsx(xe,{size:p.checkboxSize,checked:te,onCheckedChange:S=>{S?F(X):N(X)},"aria-label":`Select row ${_+1}`})}),n.map(S=>e.jsx("td",{className:w.join(p.cell,U(S.align),S.cellClassName),role:"cell",children:K(T,S)},S.key))]},X)})})]})})}const Ns=({defaultValue:r,value:a,onValueChange:t}={})=>{const[o,s]=l.useState(r||""),n=a!==void 0,i=n?a:o,u=l.useCallback(c=>{n||s(c),t==null||t(c)},[n,t]);return{value:i,onValueChange:u}},Ae={width:{fit:"w-fit",full:"w-full *:flex-1"},variant:{underline:"border-b border-border",pills:"",bordered:"border border-border rounded-lg p-1"}},Ds={underline:"border-b-2 border-transparent data-[state=active]:border-accent data-[state=active]:text-accent hover:text-accent/80",pills:"rounded-md data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30",bordered:"rounded data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30"};function Ze({children:r,className:a,id:t,ref:o}){const{tabsWidth:s,variant:n}=V.useTabsContext();return e.jsx("div",{id:t,ref:o,role:"tablist",className:w.join("flex",Ae.width[s],Ae.variant[n],a),"data-tabs-width":s,"data-variant":n,children:r})}function Ye({value:r,disabled:a=!1,className:t,children:o,onClick:s,id:n,ref:i}){const{selectedValue:u,onValueChange:c,variant:x,triggersClassName:f}=V.useTabsContext(),d=u===r,h=y=>{a||c(r),s==null||s(y)};return e.jsx("button",{id:n,ref:i,role:"tab",type:"button","aria-selected":d,"aria-controls":`tabs-content-${r}`,"data-state":d?"active":"inactive","data-value":r,disabled:a,className:w.join("inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",d?"font-medium":"font-light",Ds[x],f,t),onClick:h,children:o})}function Es({defaultValue:r,value:a,onValueChange:t,tabsWidth:o="fit",variant:s="underline",className:n,tabsList:i,children:u,ref:c,id:x,triggersClassName:f,contentClassName:d}){const{value:h,onValueChange:m}=Ns({defaultValue:r,value:a,onValueChange:t}),y={selectedValue:h,onValueChange:m,tabsWidth:o,variant:s,triggersClassName:f,contentClassName:d};return e.jsx(V.TabsContext.Provider,{value:y,children:e.jsxs("div",{id:x,ref:c,className:n,"data-tabs-width":o,"data-variant":s,children:[i&&e.jsx(Ze,{children:i.map(v=>e.jsx(Ye,{value:v.value,children:v.label},v.value))}),u]})})}function Ss({value:r,className:a,children:t,ref:o}){const{selectedValue:s,contentClassName:n}=V.useTabsContext(),i=s===r;return i?e.jsx("div",{ref:o,role:"tabpanel",id:`tabs-content-${r}`,"aria-labelledby":`tabs-trigger-${r}`,"data-state":i?"active":"inactive","data-value":r,className:w.join("mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2",n,a),tabIndex:0,children:t}):null}const Fs={sm:{container:"h-5 min-w-9 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{container:"h-6 min-w-11 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{container:"h-7 min-w-13 w-13",thumb:"h-6 w-6",translate:"translate-x-6"}},Is={default:{unchecked:"bg-muted-foreground",checked:"bg-primary"},success:{unchecked:"bg-muted-foreground",checked:"bg-success"},destructive:{unchecked:"bg-muted-foreground",checked:"bg-destructive"}},$e={variant:"default",size:"md"};function As({ref:r,id:a,size:t=$e.size,variant:o=$e.variant,checked:s,onCheckedChange:n,disabled:i=!1,className:u,thumbClassName:c,backgroundClassNames:x,...f}){const d=l.useId(),h=l.useMemo(()=>a||`toggle-${d}`,[a,d]),[m,y]=l.useState(s);l.useEffect(()=>{y(s)},[s]);const v=()=>{if(!i){const E=!m;s===void 0&&y(E),n==null||n(E)}},b=E=>{(E.key===" "||E.key==="Enter")&&(E.preventDefault(),v())},C=Fs[t],p=Is[o],g=w.join("relative inline-flex items-center rounded-full transition-all ease-in-out","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",C.container,m?(x==null?void 0:x.checked)||p.checked:(x==null?void 0:x.unchecked)||p.unchecked,i&&"opacity-50 cursor-not-allowed",!i&&"cursor-pointer",u),j=w.join("absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform ease-in-out",C.thumb,m&&C.translate,c);return e.jsxs("button",{ref:r,id:h,type:"button",role:"switch",tabIndex:0,"aria-checked":m,"aria-disabled":i,disabled:i,onClick:v,onKeyDown:b,className:g,...f,children:[e.jsx("span",{className:j}),e.jsx("span",{className:"sr-only",children:m?"Enabled":"Disabled"})]})}exports.ActionModal=V.ActionModal;exports.Toast=V.Toast;exports.Accordion=Je;exports.AccordionItem=ue;exports.Avatar=mt;exports.Badge=gt;exports.Button=Te;exports.Calendar=Dt;exports.Callout=Ft;exports.Card=At;exports.Carousel=Mt;exports.Checkbox=xe;exports.Clickable=Tt;exports.Code=Lt;exports.CodeBlock=or;exports.Disclosure=lr;exports.Drawer=fr;exports.DropdownMenu=kr;exports.DropdownMenuFactories=Sr;exports.DynamicList=zr;exports.ErrorBoundary=Br;exports.Form=ss;exports.FormFactories=Pr;exports.HelpIcon=ns;exports.Input=Ge;exports.Label=le;exports.LoadingDots=ze;exports.Modal=is;exports.Pagination=us;exports.Panel=hs;exports.Popover=Be;exports.RadioGroup=Ke;exports.RadioGroupItem=fe;exports.RadioInput=Pe;exports.ScrollArea=_e;exports.Select=qe;exports.Separator=gs;exports.Skeleton=ys;exports.Slider=vs;exports.Table=Cs;exports.Tabs=Es;exports.TabsContent=Ss;exports.TabsList=Ze;exports.TabsTrigger=Ye;exports.Textarea=We;exports.Toggle=As;exports.Tooltip=He;
|
|
3
3
|
//# sourceMappingURL=components.cjs.js.map
|