tekivex-ui 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +505 -493
- package/dist/src/components/TkxKanban.d.ts +43 -0
- package/dist/src/components/TkxRichEditor.d.ts +25 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunk-DmRB1Blb.js"),t=require("./chunk-BpuJ3-K8.js"),n=require("./chunk-D7-yknXg.js"),o=require("./chunk-C8Wy8P59.js"),r=require("./i18n.cjs"),i=require("./chunk-Bze40nDX.js");let l=require("react");l=e.__toESM(l,1);let a=require("react/jsx-runtime"),s=require("react-dom");var d={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},c={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},p={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},u={sm:14,md:16,lg:18,xl:20};function h({size:e}){const t=u[e];return(0,a.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:n.tkx("animate-spin shrink-0"),children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),(0,a.jsx)("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}var f=(0,l.forwardRef)(({variant:e="solid",size:r="md",colorScheme:i="primary",isLoading:l=!1,loadingText:s,leftIcon:u,rightIcon:f,isFullWidth:m=!1,glow:g=!1,disabled:x,children:y,className:b,style:v,...w},k)=>{const S=t.useTheme(),C=o.useReducedMotion(),$=x||l,z={primary:S.primary,secondary:S.secondary,danger:S.danger,warning:S.warning,success:S.success}[i],N=t.getAccessibleForeground(z,["#ffffff","#000000",S.bg]),M="string"==typeof y?n.sanitizeString(y):y,I=s?n.sanitizeString(s):void 0,D="solid"===e?{backgroundColor:z,color:N,border:"none",boxShadow:g&&!C?`0 0 20px ${z}55`:void 0}:"outline"===e?{backgroundColor:"transparent",color:z,border:`2px solid ${z}`}:"ghost"===e?{backgroundColor:"transparent",color:z,border:"none"}:{backgroundColor:"transparent",color:z,border:"none",textDecoration:"underline"};return(0,a.jsx)("button",{ref:k,"aria-busy":l,"aria-disabled":$,disabled:$,className:n.cx(n.tkx("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",d[r],c[r],p[r],"link"!==e&&p[r],m&&"w-full",$?"cursor-not-allowed opacity-60":"cursor-pointer",!C&&"transition-all duration-200","focus-visible:focus-ring"),b),style:{...D,...v},...w,children:l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h,{size:r}),I??M]}):(0,a.jsxs)(a.Fragment,{children:[u&&(0,a.jsx)("span",{"aria-hidden":"true",children:u}),M,f&&(0,a.jsx)("span",{"aria-hidden":"true",children:f})]})})});f.displayName="TkxButton";var m={none:"",sm:"p-3",md:"p-5",lg:"p-7"},g=(0,l.forwardRef)(({variant:e="default",isHoverable:r,isClickable:i,padding:l="md",as:s,children:d,className:c,style:p,...u},h)=>{const f=t.useTheme(),g=o.useReducedMotion(),x=s??(i?"button":"div"),y={default:{backgroundColor:f.surface,border:`1px solid ${f.border}`},glass:{backgroundColor:`${f.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${f.border}55`,boxShadow:`0 4px 24px ${f.bg}40`},quantum:{backgroundColor:f.surfaceAlt,border:`1px solid ${f.primary}33`,boxShadow:`0 0 24px ${f.primary}18`},elevated:{backgroundColor:f.surface,boxShadow:`0 4px 20px ${f.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${f.border}`}}[e];return(0,a.jsx)(x,{ref:h,className:n.cx("tkx-card",n.tkx("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",m[l],(r||i)&&!g&&"transition-transform duration-150 hover:scale-[1.01]",i?"cursor-pointer":"cursor-default"),c),style:{color:f.text,...y,...p},...u,children:d})});g.displayName="TkxCard";var x=(0,l.forwardRef)(({label:e,id:o,error:r,hint:i,leftAddon:s,rightAddon:d,isInvalid:c,isRequired:p,disabled:u,className:h,style:f,unicodeSafe:m=!0,onChange:g,...x},y)=>{const b=t.useTheme(),v=(0,l.useId)(),w=o??v,k=`${w}-hint`,S=`${w}-error`,C=c||!!r,$=[i&&k,C&&S].filter(Boolean).join(" ")||void 0,z=n.sanitizeString(e),N=r?n.sanitizeString(r):void 0,M=i?n.sanitizeString(i):void 0,I=C?b.danger:b.border;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1 w-full"),h),style:f,children:[(0,a.jsxs)("label",{htmlFor:w,className:n.tkx("text-sm font-medium font-sans"),style:{color:b.text},children:[z,p&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("ml-1"),style:{color:b.danger},children:"*"})]}),(0,a.jsxs)("div",{className:n.tkx("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",u?"opacity-60":""),style:{border:`1.5px solid ${I}`,backgroundColor:b.surface},children:[s&&(0,a.jsx)("div",{className:n.tkx("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:b.surfaceAlt,color:b.textMuted,borderRight:`1px solid ${b.border}`},children:s}),(0,a.jsx)("input",{ref:y,id:w,"aria-invalid":C,"aria-required":p,"aria-describedby":$,disabled:u,className:n.cx(n.tkx("flex-1 border-none bg-transparent text-sm font-sans py-2.5 px-3 outline-none min-w-0 focus-visible:focus-ring")),style:{color:b.text},onChange:m?e=>{const t=n.sanitizeUnicode(e.target.value);t!==e.target.value&&(e.target.value=t),g?.(e)}:g,...x}),d&&(0,a.jsx)("div",{className:n.tkx("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:b.surfaceAlt,color:b.textMuted,borderLeft:`1px solid ${b.border}`},children:d})]}),M&&!N&&(0,a.jsx)("span",{id:k,className:n.tkx("text-xs"),style:{color:b.textMuted},children:M}),N&&(0,a.jsxs)("span",{id:S,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:b.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),N]})]})});x.displayName="TkxInput";var y={sm:"text-xs px-1.5 py-[2px] min-h-[16px]",md:"text-xs px-2 py-[3px] min-h-[20px]",lg:"text-sm px-3 py-1 min-h-[24px]"},b={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},v=(0,l.forwardRef)(({variant:e="default",size:o="md",dot:r=!1,pulse:i=!1,outlined:l=!1,children:s,className:d,style:c,...p},u)=>{const h=t.useTheme(),f={default:h.border,primary:h.primary,secondary:h.secondary,danger:h.danger,warning:h.warning,success:h.success,info:h.info}[e]||"#666666",m=t.getAccessibleForeground(f,["#ffffff","#000000",h.bg||"#000000"]),g="string"==typeof s?n.sanitizeString(s):s;return r?(0,a.jsx)("span",{ref:u,"aria-label":"string"==typeof s?n.sanitizeString(s):void 0,className:n.cx(n.tkx("inline-block rounded-full",b[o],i&&"animate-pulse"),d),style:{backgroundColor:f,...c},...p}):(0,a.jsx)("span",{ref:u,className:n.cx(n.tkx("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",y[o],i&&"animate-pulse"),d),style:{backgroundColor:l?"transparent":f,color:l?f:m,border:l?`1px solid ${f}`:"none",...c},...p,children:g})});v.displayName="TkxBadge";var w={sm:"4px",md:"8px",lg:"12px"},k={sm:32,md:48,lg:64},S=(0,l.forwardRef)(({value:e,variant:r="linear",size:i="md",label:l,showValue:s,color:d,className:c,style:p,...u},h)=>{const f=t.useTheme(),m=o.useReducedMotion(),g=d??f.primary,x=void 0===e,y=void 0!==e?Math.min(100,Math.max(0,e)):0;if(void 0!==e){const{errors:t}=n.validateProps({value:e},{value:{type:"number",min:0,max:100}});t.length}if("circular"===r){const e=k[i],t="sm"===i?3:"md"===i?4:5,o=(e-2*t)/2,r=2*Math.PI*o,d=x?0:r-y/100*r;return(0,a.jsxs)("div",{ref:h,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x?void 0:y,"aria-label":l??(x?"Loading":`${y}%`),className:n.cx(n.tkx("inline-flex flex-col items-center gap-1"),c),style:p,children:[(0,a.jsxs)("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:e/2,cy:e/2,r:o,fill:"none",stroke:f.border,strokeWidth:t}),(0,a.jsx)("circle",{cx:e/2,cy:e/2,r:o,fill:"none",stroke:g,strokeWidth:t,strokeLinecap:"round",strokeDasharray:r,strokeDashoffset:d,transform:`rotate(-90 ${e/2} ${e/2})`,style:{transition:m?"none":"stroke-dashoffset 300ms ease",animation:x&&!m?"tkx-spin 1s linear infinite":void 0}})]}),s&&!x&&(0,a.jsxs)("span",{className:n.tkx("text-xs"),style:{color:f.textMuted},children:[y,"%"]})]})}const b=w[i];return(0,a.jsxs)("div",{ref:h,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x?void 0:y,"aria-label":l??(x?"Loading":`${y}%`),className:n.cx(n.tkx("flex flex-col gap-1 w-full"),c),style:p,children:[l&&(0,a.jsxs)("div",{className:n.tkx("flex justify-between text-sm"),style:{color:f.text},children:[(0,a.jsx)("span",{children:l}),s&&!x&&(0,a.jsxs)("span",{children:[y,"%"]})]}),(0,a.jsx)("div",{className:n.tkx("w-full overflow-hidden"),style:{height:b,borderRadius:b,backgroundColor:f.border},children:(0,a.jsx)("div",{style:{height:"100%",borderRadius:b,backgroundColor:g,width:x?"40%":`${y}%`,transition:m?"none":"width 300ms ease",animation:x&&!m?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});S.displayName="TkxProgress";var C={sm:{tw:28,th:16,td:10,gap:3},md:{tw:40,th:22,td:14,gap:4},lg:{tw:52,th:28,td:18,gap:5}},$=(0,l.forwardRef)(({checked:e,onChange:r,label:i,size:s="md",hideLabel:d,disabled:c,className:p,style:u,...h},f)=>{const m=t.useTheme(),g=o.useReducedMotion(),x=(0,l.useId)();n.validateProps({label:i,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:y,th:b,td:v,gap:w}=C[s],k=e?y-v-w:w,S=e?m.primary:m.border;return(0,a.jsxs)("div",{className:n.cx(n.tkx("inline-flex items-center gap-2",c?"opacity-50":""),p),style:u,children:[!d&&(0,a.jsx)("label",{htmlFor:x,className:n.tkx("text-sm font-sans",c?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:m.text},children:i}),(0,a.jsx)("button",{ref:f,id:x,role:"switch","aria-checked":e,"aria-label":d?i:void 0,disabled:c,onClick:()=>!c&&r(!e),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||c||(t.preventDefault(),r(!e))},className:n.cx(n.tkx("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",c?"cursor-not-allowed":"cursor-pointer",!g&&"transition-colors duration-200")),style:{width:y,height:b,borderRadius:b,backgroundColor:S},...h,children:(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("absolute rounded-full"),style:{top:"50%",left:k,width:v,height:v,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:g?"none":"left 200ms ease"}})})]})});$.displayName="TkxToggle";var z={info:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),warning:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})})},N={sm:"400px",md:"560px",lg:"720px",full:"100vw"},M=0;function I(){--M<=0&&(M=0,document.body.style.overflow="")}var D=(0,l.createContext)(null);function W(){const e=(0,l.useContext)(D);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}var L={top:{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:6},bottom:{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:6},left:{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:6},right:{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:6}};function R({variant:e,width:t,height:o,animation:r,bgColor:i,accentColor:l}){const s=void 0!==t?"number"==typeof t?`${t}px`:t:"100%",d=void 0!==o?"number"==typeof o?`${o}px`:o:{text:"1em",circular:s,rectangular:"80px"}[e],c=n.tkx("circular"===e?"rounded-full":"text"===e?"rounded":"rounded-lg"),p="pulse"===r?n.tkx("animate-pulse"):"wave"===r?n.tkx("animate-shimmer"):"",u="wave"===r?{background:`linear-gradient(90deg,${i} 25%,${l} 50%,${i} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:i};return(0,a.jsx)("div",{className:n.cx(c,p),style:{width:s,height:d,...u}})}var T=(0,l.forwardRef)(({variant:e="rectangular",width:r,height:i,lines:l,animation:s="pulse",className:d,style:c,...p},u)=>{const h=t.useTheme(),f=!o.useReducedMotion()&&s;return"text"===e&&l&&l>1?(0,a.jsx)("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:n.cx(n.tkx("flex flex-col gap-2"),d),style:c,...p,children:Array.from({length:l},(e,t)=>(0,a.jsx)(R,{variant:"text",width:t===l-1?"75%":r,height:i,animation:f,bgColor:h.surfaceAlt,accentColor:h.border},t))}):(0,a.jsx)("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:d,style:c,...p,children:(0,a.jsx)(R,{variant:e,width:r,height:i,animation:f,bgColor:h.surfaceAlt,accentColor:h.border})})});T.displayName="TkxSkeleton";var A={xs:24,sm:32,md:40,lg:56,xl:72},B={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},F=(0,l.forwardRef)(({src:e,alt:o,initials:r,size:i="md",shape:s="circle",status:d,className:c,style:p,...u},h)=>{const f=t.useTheme(),[m,g]=(0,l.useState)(!1),x=A[i],y="circle"===s,b=f.surfaceAlt,v=t.getAccessibleForeground(b,[f.text,f.textMuted]),w=e&&!m,k=!w&&r,S=Math.max(8,.22*x),C=n.tkx("relative inline-flex shrink-0",y?"rounded-full":"rounded-lg"),$=n.tkx("block object-cover",y?"rounded-full":"rounded-lg"),z=n.tkx("flex items-center justify-center font-semibold font-sans select-none",y?"rounded-full":"rounded-lg");return(0,a.jsxs)("div",{ref:h,className:n.cx(C,c),style:{width:x,height:x,...p},...u,children:[w?(0,a.jsx)("img",{src:n.sanitizeString(e),alt:n.sanitizeString(o),onError:()=>g(!0),className:$,style:{width:x,height:x}}):(0,a.jsx)("div",{role:"img","aria-label":n.sanitizeString(o),className:z,style:{width:x,height:x,backgroundColor:b,color:v,fontSize:.38*x},children:k?n.sanitizeString(r).slice(0,2).toUpperCase():(0,a.jsxs)("svg",{width:.5*x,height:.5*x,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),(0,a.jsx)("circle",{cx:"12",cy:"7",r:"4"})]})}),d&&(0,a.jsx)("span",{"aria-label":`Status: ${d}`,className:n.tkx("absolute bottom-0 right-0 rounded-full"),style:{width:S,height:S,backgroundColor:B[d],border:`2px solid ${f.bg}`}})]})});function E({dir:e}){return(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:n.tkx("shrink-0"),children:"asc"===e?(0,a.jsx)("path",{d:"M7 14l5-5 5 5H7z"}):"desc"===e?(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7z"}):(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}F.displayName="TkxAvatar";var j=(0,l.forwardRef)(({orientation:e="horizontal",label:o,variant:r="solid",className:i,style:l,...s},d)=>{const c=t.useTheme(),p=o?n.sanitizeString(o):void 0,u="vertical"===e,h=u?"borderLeft":"borderTop",f=`1px ${r} ${c.border}`;return p?(0,a.jsxs)("div",{role:"separator","aria-orientation":e,className:n.cx(n.tkx("flex items-center gap-3 text-xs"),i),style:{color:c.textMuted,...l},...s,children:[(0,a.jsx)("hr",{className:n.tkx("flex-1 m-0 border-none"),style:{[h]:f}}),(0,a.jsx)("span",{children:p}),(0,a.jsx)("hr",{className:n.tkx("flex-1 m-0 border-none"),style:{[h]:f}})]}):(0,a.jsx)("hr",{ref:d,role:"separator","aria-orientation":e,className:n.cx(n.tkx(u?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),i),style:{[h]:f,...l},...s})});j.displayName="TkxDivider";var H={sm:{py:"6px",px:"10px",fontSize:"13px",iconSize:14,tagPy:"1px",tagPx:"6px"},md:{py:"9px",px:"12px",fontSize:"14px",iconSize:16,tagPy:"2px",tagPx:"8px"},lg:{py:"12px",px:"14px",fontSize:"15px",iconSize:18,tagPy:"3px",tagPx:"10px"}};function P(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function O({size:e,color:t}){return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",style:{animation:"tkx-spin 0.7s linear infinite"},children:[(0,a.jsx)("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),(0,a.jsx)("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function V({options:e,value:o,defaultValue:i,placeholder:d,size:c="md",isDisabled:p=!1,isInvalid:u=!1,label:h,hint:f,errorMessage:m,multiple:g=!1,searchable:x=!1,clearable:y=!1,isLoading:b=!1,onChange:v,renderOption:w,maxMenuHeight:k=280,virtualScroll:S,optionHeight:C=36,id:$,className:z,style:N}){const M=t.useTheme(),I=r.useLocale(),D=d??I.selectPlaceholder,W=(0,l.useId)(),L=$??W,R=`${L}-listbox`,T=`${L}-hint`,A=`${L}-error`,B=void 0!==o,[F,E]=(0,l.useState)(P(i)),j=B?P(o):F,[V,K]=(0,l.useState)(!1),[U,Y]=(0,l.useState)(""),[q,X]=(0,l.useState)(-1),[Z,_]=(0,l.useState)(null),[G,J]=(0,l.useState)(""),Q=(0,l.useRef)(null),ee=(0,l.useRef)(null),te=(0,l.useRef)(null),ne=(0,l.useRef)(null),oe=(0,l.useRef)(null),re=H[c],ie=u||!!m,le=(0,l.useRef)(null),[ae,se]=(0,l.useState)(0),[de,ce]=(0,l.useState)(0),pe=(0,l.useCallback)(()=>{le.current&&se(le.current.scrollTop)},[]);(0,l.useEffect)(()=>{if(!V)return void se(0);const e=le.current;if(!e)return;ce(e.clientHeight);const t=new ResizeObserver(()=>{ce(e.clientHeight)});return t.observe(e),()=>t.disconnect()},[V]);const ue=x&&U?e.filter(e=>e.label.toLowerCase().includes(U.toLowerCase())):e,he=ue.filter(e=>!e.disabled),fe=ue.some(e=>!!e.group),me=(void 0!==S?S:ue.length>=100)&&!fe,ge=ue.length*C,xe=me?Math.max(0,Math.floor(ae/C)-8):0,ye=me?Math.min(ue.length,Math.ceil((ae+de)/C)+8):ue.length,be=me?ue.slice(xe,ye):ue,ve=xe*C,we=ue.reduce((e,t)=>{const n=t.group??"";return e[n]||(e[n]=[]),e[n].push(t),e},{}),ke=(0,l.useCallback)(e=>{let t;t=g?j.includes(e)?j.filter(t=>t!==e):[...j,e]:[e],B||E(t),v?.(g?t:t[0]??""),g||(K(!1),Y(""),X(-1),ee.current?.focus())},[B,g,v,j]),Se=(0,l.useCallback)((e,t)=>{t.stopPropagation();const n=j.filter(t=>t!==e);B||E(n),v?.(g?n:n[0]??"")},[B,g,v,j]),Ce=(0,l.useCallback)(e=>{e.stopPropagation(),B||E([]),v?.(g?[]:"")},[B,g,v]),$e=(0,l.useCallback)(()=>{ee.current&&V&&_(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight-n.bottom-6,r=n.top-6,i=o>=Math.min(t,200)||o>=r?"below":"above";return{top:"below"===i?n.bottom+window.scrollY+6:n.top+window.scrollY-6-Math.min(t,280),left:n.left+window.scrollX,width:n.width,placement:i}}(ee.current,k))},[V,k]);function ze(){if(p||b)return;K(!0);const e=he.findIndex(e=>j.includes(e.value));X(e>=0?e:0)}(0,l.useEffect)(()=>{if(V)return $e(),window.addEventListener("scroll",$e,!0),window.addEventListener("resize",$e),()=>{window.removeEventListener("scroll",$e,!0),window.removeEventListener("resize",$e)}},[V,$e]),(0,l.useEffect)(()=>{if(!V)return;const e=e=>{const t=e.target;ee.current?.contains(t)||ne.current?.contains(t)||(K(!1),Y(""))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[V]),(0,l.useEffect)(()=>{V&&x&&setTimeout(()=>te.current?.focus(),0)},[V,x]),(0,l.useEffect)(()=>{if(V&&!(q<0))if(me&&le.current){const e=q*C,t=e+C,n=le.current;e<n.scrollTop?n.scrollTop=e:t>n.scrollTop+n.clientHeight&&(n.scrollTop=t-n.clientHeight)}else(oe.current?.querySelector(`[data-idx="${q}"]`))?.scrollIntoView({block:"nearest"})},[q,V,me,C]);const Ne=ie?M.danger:V?M.primary:M.border,Me=q>=0&&he[q]?`${L}-opt-${he[q].value}`:void 0,Ie=[f&&T,ie&&A].filter(Boolean).join(" ")||void 0,De=j.map(t=>e.find(e=>e.value===t)).filter(Boolean),We=V&&Z?(0,s.createPortal)((0,a.jsxs)("div",{ref:ne,role:"listbox",id:R,"aria-label":h?n.sanitizeString(h):"Options","aria-multiselectable":g,style:{position:"absolute",top:Z.top,left:Z.left,width:Z.width,zIndex:9999,backgroundColor:M.surface,border:`1.5px solid ${M.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",overflow:"hidden",minWidth:Z.width,maxHeight:k,display:"flex",flexDirection:"column"},children:[x&&(0,a.jsxs)("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${M.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:M.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("path",{d:"M21 21l-4.35-4.35"})]}),(0,a.jsx)("input",{ref:te,type:"text",value:U,onChange:e=>{Y(e.target.value),X(0)},onKeyDown:e=>{switch(e.key){case"Escape":e.preventDefault(),K(!1),Y(""),ee.current?.focus();break;case"ArrowDown":e.preventDefault(),X(e=>Math.min(e+1,he.length-1));break;case"ArrowUp":e.preventDefault(),X(e=>Math.max(e-1,0));break;case"Home":e.preventDefault(),X(0);break;case"End":e.preventDefault(),X(he.length-1);break;case"Enter":e.preventDefault(),q>=0&&he[q]&&ke(he[q].value)}},placeholder:`${I.search}…`,"aria-label":`${I.search} options`,style:{border:"none",outline:"none",background:"transparent",color:M.text,fontSize:re.fontSize,fontFamily:"inherit",width:"100%"}})]}),(0,a.jsx)("div",{ref:e=>{oe.current=e,le.current=e},onScroll:me?pe:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:k-(x?48:0)},children:me?(0,a.jsxs)("div",{style:{height:ge,position:"relative"},children:[(0,a.jsx)("div",{style:{position:"absolute",top:ve,left:0,right:0},children:be.map(e=>{const t=he.indexOf(e),o=t===q,r=j.includes(e.value),i=w?w(e,r):(0,a.jsxs)("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[(0,a.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)})]}),e.description&&(0,a.jsx)("span",{style:{fontSize:"12px",color:M.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.description)})]});return(0,a.jsxs)("div",{id:`${L}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&ke(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&X(t),style:{height:C,boxSizing:"border-box",padding:`0 ${re.px}`,fontSize:re.fontSize,fontFamily:"inherit",color:e.disabled?M.textMuted:M.text,backgroundColor:o?`${M.primary}22`:r?`${M.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[i,r&&!w&&(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:M.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})}),0===ue.length&&(0,a.jsx)("div",{style:{padding:`${re.py} ${re.px}`,fontSize:re.fontSize,fontFamily:"inherit",color:M.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:b?"Loading…":"No options found"})]}):(0,a.jsxs)(a.Fragment,{children:[Object.entries(we).map(([e,t])=>(0,a.jsxs)("div",{children:[e&&(0,a.jsx)("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:M.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:M.surface,zIndex:1,borderBottom:`1px solid ${M.border}`},children:n.sanitizeString(e)}),t.map(e=>{const t=he.indexOf(e),o=t===q,r=j.includes(e.value),i=w?w(e,r):(0,a.jsxs)("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[(0,a.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)})]}),e.description&&(0,a.jsx)("span",{style:{fontSize:"12px",color:M.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.description)})]});return(0,a.jsxs)("div",{id:`${L}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&ke(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&X(t),style:{padding:`${re.py} ${re.px}`,fontSize:re.fontSize,fontFamily:"inherit",color:e.disabled?M.textMuted:M.text,backgroundColor:o?`${M.primary}22`:r?`${M.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[i,r&&!w&&(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:M.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})]},e)),0===ue.length&&(0,a.jsx)("div",{style:{padding:`${re.py} ${re.px}`,fontSize:re.fontSize,fontFamily:"inherit",color:M.textMuted,textAlign:"center"},children:b?"Loading…":"No options found"})]})})]}),document.body):null,Le=y&&j.length>0&&!p&&!b;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1 w-full"),z),style:N,children:[h&&(0,a.jsx)("label",{htmlFor:L,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:M.text,userSelect:"none"},children:n.sanitizeString(h)}),(0,a.jsx)("div",{style:{position:"relative",width:"100%",opacity:p?.55:1},children:(0,a.jsxs)("button",{ref:ee,id:L,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":V,"aria-controls":R,"aria-activedescendant":Me,"aria-invalid":ie||void 0,"aria-describedby":Ie,"aria-multiselectable":g,disabled:p,onClick:()=>V?K(!1):ze(),onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),V?q>=0&&he[q]&&ke(he[q].value):ze();break;case"Escape":e.preventDefault(),K(!1),Y("");break;case"ArrowDown":e.preventDefault(),V?X(e=>Math.min(e+1,he.length-1)):ze();break;case"ArrowUp":e.preventDefault(),V?X(e=>Math.max(e-1,0)):ze();break;case"Home":e.preventDefault(),V&&X(0);break;case"End":e.preventDefault(),V&&X(he.length-1);break;default:1!==e.key.length||e.ctrlKey||e.metaKey||(V||ze(),function(e){Q.current&&clearTimeout(Q.current);const t=G+e.toLowerCase();J(t);const n=he.findIndex(e=>e.label.toLowerCase().startsWith(t));n>=0&&X(n),Q.current=setTimeout(()=>J(""),800)}(e.key))}},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:g&&j.length>0?`4px ${re.px}`:`${re.py} ${re.px}`,fontSize:re.fontSize,fontFamily:"inherit",backgroundColor:M.surface,color:j.length>0?M.text:M.textMuted,border:`1.5px solid ${Ne}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:p?"not-allowed":"pointer",outline:"none",minHeight:"sm"===c?34:"lg"===c?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:g&&De.length>0?De.map(e=>(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${re.tagPy} ${re.tagPx}`,fontSize:`calc(${re.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${M.primary}22`,color:M.primary,borderRadius:6,border:`1px solid ${M.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:n.sanitizeString(e.label)}),(0,a.jsx)("span",{role:"button","aria-label":`Remove ${n.sanitizeString(e.label)}`,tabIndex:-1,onClick:t=>Se(e.value,t),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})]},e.value)):!g&&j.length>0?(()=>{const t=e.find(e=>e.value===j[0]);return(0,a.jsxs)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[t?.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex"},children:t.icon}),t?n.sanitizeString(t.label):""]})})():(0,a.jsx)("span",{style:{opacity:.6},children:n.sanitizeString(D)})}),(0,a.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:M.textMuted},children:[b&&(0,a.jsx)(O,{size:re.iconSize,color:M.primary}),Le&&!b&&(0,a.jsx)("span",{role:"button","aria-label":I.clearSelection,tabIndex:-1,onClick:Ce,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:e=>e.currentTarget.style.opacity="1",onMouseLeave:e=>e.currentTarget.style.opacity="0.7",children:(0,a.jsx)("svg",{width:re.iconSize,height:re.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})}),(0,a.jsx)("svg",{width:re.iconSize,height:re.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:V?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:(0,a.jsx)("path",{d:"M6 9l6 6 6-6"})})]})]})}),f&&!ie&&(0,a.jsx)("span",{id:T,style:{fontSize:"12px",color:M.textMuted,fontFamily:"inherit"},children:n.sanitizeString(f)}),ie&&m&&(0,a.jsxs)("span",{id:A,role:"alert",style:{fontSize:"12px",color:M.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),n.sanitizeString(m)]}),We]})}V.displayName="TkxSelect";var K={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},U=(0,l.forwardRef)(({label:e,hint:r,isInvalid:i,errorMessage:s,isIndeterminate:d=!1,size:c="md",colorScheme:p="primary",checked:u,defaultChecked:h,onChange:f,disabled:m,className:g,style:x,id:y,...b},v)=>{const w=t.useTheme(),k=o.useReducedMotion(),S=(0,l.useId)(),C=y??S,$=`${C}-hint`,z=`${C}-error`,N=(0,l.useRef)(null),[M,I]=(0,l.useState)(!1),D=K[c],W=i||!!s,L={primary:w.primary,success:w.success,danger:w.danger,warning:w.warning}[p]??w.primary,R=void 0!==u?u:void 0;(0,l.useEffect)(()=>{const e=v?.current??N.current;e&&(e.indeterminate=d)},[d,v]);const T=d||(R??!1),A=T?L:w.surface,B=W?w.danger:T?L:w.border,F=t.getAccessibleForeground(L),E=M?{outline:`2px solid ${L}`,outlineOffset:"2px"}:{},j=[r&&$,W&&z].filter(Boolean).join(" ")||void 0,H=!k&&T?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1"),g),style:{opacity:m?.5:1,...x},children:[(0,a.jsx)("style",{children:"\n @keyframes tkx-check-scale-in {\n from { transform: scale(0.4); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n }\n "}),(0,a.jsxs)("label",{htmlFor:C,className:n.tkx("flex items-center gap-2 select-none"),style:{cursor:m?"not-allowed":"pointer",fontFamily:"inherit"},children:[(0,a.jsx)("input",{ref:e=>{N.current=e,"function"==typeof v?v(e):v&&(v.current=e)},id:C,type:"checkbox",checked:u,defaultChecked:h,onChange:f,disabled:m,"aria-invalid":W,"aria-describedby":j,onFocus:e=>{e.target.matches(":focus-visible")&&I(!0)},onBlur:()=>I(!1),className:n.tkx("sr-only"),...b}),(0,a.jsx)("span",{"aria-hidden":"true",style:{width:D.box,height:D.box,minWidth:D.box,borderRadius:"4px",border:`2px solid ${B}`,backgroundColor:A,display:"flex",alignItems:"center",justifyContent:"center",transition:k?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...E},children:d?(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"block",width:.5*D.box,height:2,backgroundColor:F,borderRadius:"1px",...H}}):T?(0,a.jsx)("svg",{width:.6*D.box,height:.6*D.box,viewBox:"0 0 24 24",fill:"none",stroke:F,strokeWidth:D.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:H,children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&(0,a.jsx)("span",{style:{fontSize:D.fontSize,color:w.text,lineHeight:1.4},children:"string"==typeof e?n.sanitizeString(e):e})]}),r&&!W&&(0,a.jsx)("span",{id:$,className:n.tkx("text-xs ml-7"),style:{color:w.textMuted,marginLeft:D.box+8},children:n.sanitizeString(r)}),W&&s&&(0,a.jsxs)("span",{id:z,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:w.danger,marginLeft:D.box+8},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),n.sanitizeString(s)]})]})});U.displayName="TkxCheckbox";var Y=(0,l.createContext)(null),q={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},X=(0,l.forwardRef)(({label:e,hint:r,size:i="md",colorScheme:s="primary",value:d,checked:c,onChange:p,disabled:u,name:h,className:f,style:m,id:g,...x},y)=>{const b=t.useTheme(),v=o.useReducedMotion(),w=(0,l.useId)(),k=g??w,S=(0,l.useContext)(Y),C=S?S.value===String(d??""):c??!1,$=u??S?.isDisabled??!1,z=h??S?.name??"",N=q[i],M={primary:b.primary,success:b.success,danger:b.danger}[s]??b.primary;t.getAccessibleForeground(M);const I=C?M:b.border,D=b.surface;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-0.5"),f),style:{opacity:$?.5:1,...m},children:[(0,a.jsx)("style",{children:"\n @keyframes tkx-radio-dot-in {\n from { transform: scale(0) translate(-50%, -50%); opacity: 0; }\n to { transform: scale(1) translate(-50%, -50%); opacity: 1; }\n }\n "}),(0,a.jsxs)("label",{htmlFor:k,className:n.tkx("flex items-center gap-2 select-none"),style:{cursor:$?"not-allowed":"pointer",fontFamily:"inherit"},children:[(0,a.jsx)("input",{ref:y,id:k,type:"radio",name:z,value:d,checked:C,onChange:()=>{$||(S?S.onChange(String(d??"")):p?.({target:{value:String(d??"")}}))},disabled:$,"aria-invalid":S?.isInvalid,className:n.tkx("sr-only"),...x}),(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"relative",width:N.outer,height:N.outer,minWidth:N.outer,borderRadius:"50%",border:`2px solid ${I}`,backgroundColor:D,display:"inline-block",boxSizing:"border-box",transition:v?"none":"border-color 120ms"},children:C&&(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:N.inner,height:N.inner,borderRadius:"50%",backgroundColor:M,transform:"translate(-50%, -50%)",transformOrigin:"center",...v?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&(0,a.jsx)("span",{style:{fontSize:N.fontSize,color:b.text,lineHeight:1.4},children:"string"==typeof e?n.sanitizeString(e):e})]}),r&&(0,a.jsx)("span",{className:n.tkx("text-xs"),style:{color:b.textMuted,marginLeft:N.outer+8},children:n.sanitizeString(r)})]})});X.displayName="TkxRadio";var Z=[],_=[],G=new Set,J=new Map;function Q(){const e=[..._];G.forEach(t=>t(e))}function ee(e,t){0!==t&&J.set(e,setTimeout(()=>te(e),t))}function te(e){clearTimeout(J.get(e)),J.delete(e);const t=_.some(t=>t.id===e);if(_=_.filter(t=>t.id!==e),Z=Z.filter(t=>t.id!==e),t&&Z.length>0&&_.length<5){const e=Z.shift();_=[..._,e],ee(e.id,e.duration??4e3)}Q()}var ne={default:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),danger:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),warning:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})},oe={"top-right":{top:16,right:16,alignItems:"flex-end"},"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"}};function re(e,t){return t?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function ie({toast:e,position:o,onDismiss:i,reduced:s}){const d=t.useTheme(),c=r.useLocale(),p=(0,l.useId)(),u={default:d.textMuted,success:d.success,danger:d.danger,warning:d.warning,info:d.info},h=e.variant??"default",f=u[h],m="danger"===h,g=e.title?n.sanitizeString(e.title):void 0,x=e.description?n.sanitizeString(e.description):void 0;return(0,a.jsxs)("div",{role:m?"alert":"status","aria-live":m?"assertive":"polite","aria-atomic":"true","aria-labelledby":g?p:void 0,className:n.tkx("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:d.surface,border:`1px solid ${f}55`,boxShadow:`0 8px 24px ${d.bg}cc`,color:d.text,...re(o,s)},children:[(0,a.jsx)("span",{className:n.tkx("shrink-0 mt-[2px]"),style:{color:f},children:ne[h]}),(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[g&&(0,a.jsx)("p",{id:p,className:n.tkx("m-0 font-semibold text-sm leading-snug"),children:g}),x&&(0,a.jsx)("p",{className:n.tkx("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:d.textMuted},children:x}),e.action&&(0,a.jsx)("button",{onClick:()=>{e.action.onClick(),i(e.id)},className:n.tkx("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:f},children:n.sanitizeString(e.action.label)})]}),(0,a.jsx)("button",{"aria-label":c.close,onClick:()=>i(e.id),className:n.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:d.textMuted},children:(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}var le={sm:{triggerPadding:"10px 12px",contentPadding:"0 12px 10px 12px",fontSize:"13px",subtitleSize:"11px",iconSize:14},md:{triggerPadding:"14px 16px",contentPadding:"0 16px 14px 16px",fontSize:"14px",subtitleSize:"12px",iconSize:16},lg:{triggerPadding:"18px 20px",contentPadding:"0 20px 18px 20px",fontSize:"16px",subtitleSize:"13px",iconSize:18}};function ae({open:e,reduced:t,iconStyle:n,size:o,color:r}){const i=t?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return"chevron"===n?(0,a.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:i,flexShrink:0},children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})}):"plus"===n?(0,a.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):(0,a.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,a.jsx)("polyline",{points:"12 5 19 12 12 19"})]})}function se({isOpen:e,reduced:t,children:n,id:o,triggerId:r}){const i=(0,l.useRef)(null),s=(0,l.useRef)(null),d=(0,l.useRef)(e),c=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{const t=i.current;t&&(e?(t.style.height="auto",t.style.overflow="visible"):(t.style.height="0px",t.style.overflow="hidden"))},[]),(0,l.useEffect)(()=>{if(d.current===e)return;d.current=e;const n=i.current,o=s.current;if(n&&o){if(t)return n.style.height=e?"auto":"0px",void(n.style.overflow=e?"visible":"hidden");if(c.current){const e=n.getBoundingClientRect().height;n.style.transition="none",n.style.height=`${e}px`,n.offsetHeight}c.current=!0,n.style.overflow="hidden",e?(n.style.height="0px",n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height=`${o.scrollHeight}px`})})):(n.style.height=`${o.scrollHeight}px`,n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height="0px"})}))}},[e,t]),(0,a.jsx)("div",{ref:i,id:o,role:"region","aria-labelledby":r,onTransitionEnd:t=>{if("height"!==t.propertyName)return;c.current=!1;const n=i.current;n&&(e?(n.style.height="auto",n.style.overflow="visible"):n.style.overflow="hidden")},style:{willChange:"height"},children:(0,a.jsx)("div",{ref:s,children:n})})}function de({items:e,multiple:r=!1,defaultOpen:i,value:s,onChange:d,variant:c="default",size:p="md",iconPosition:u="right",iconStyle:h="chevron",flush:f=!1,className:m,style:g}){const x=t.useTheme(),y=o.useReducedMotion(),b=(0,l.useId)(),v=void 0!==s,w=e=>e?Array.isArray(e)?new Set(e):new Set([e]):new Set,[k,S]=(0,l.useState)(()=>w(i)),C=v?w(s):k,$=(0,l.useCallback)((e,t)=>{if(t)return;let n;if(!v)return void S(t=>{n=new Set(t),n.has(e)?n.delete(e):(r||n.clear(),n.add(e));const o=[...n];return d?.(r?o:o[0]??""),n});{const t=w(s);n=new Set(t),n.has(e)?n.delete(e):(r||n.clear(),n.add(e))}const o=[...n];d?.(r?o:o[0]??"")},[r,d,v,s]),z=le[p],N=(e,t,n)=>{if(f)return{};switch(c){case"default":case"bordered":return{borderBottom:n?"none":`1px solid ${x.border}`};case"separated":return{border:`1px solid ${x.border}`,borderRadius:"10px",overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)"};default:return{}}},M="separated"===c;return(0,a.jsx)("div",{className:n.tkx(m??""),style:{...f?{}:"bordered"===c?{border:`1px solid ${x.border}`,borderRadius:"10px",overflow:"hidden"}:{},display:M?"flex":void 0,flexDirection:M?"column":void 0,gap:M?"8px":void 0,...g},children:e.map((t,n)=>{const o=C.has(t.id),r=n===e.length-1,i=`${b}-trigger-${t.id}`,l=`${b}-panel-${t.id}`;return(0,a.jsxs)("div",{className:t.className,style:N(0,0,r),children:[(0,a.jsxs)("button",{id:i,type:"button",role:"button","aria-expanded":o,"aria-controls":l,disabled:t.disabled,onClick:()=>$(t.id,t.disabled),style:{width:"100%",display:"flex",alignItems:t.subtitle?"flex-start":"center",gap:"8px",padding:z.triggerPadding,border:"none",background:"transparent",cursor:t.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:z.fontSize,fontWeight:500,color:t.disabled?x.textMuted:x.text,opacity:t.disabled?.5:1,transition:y?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:e=>{t.disabled||(e.currentTarget.style.backgroundColor=(e=>"ghost"===c||"flush"===c?e?`${x.primary}10`:`${x.surfaceAlt}80`:e?`${x.primary}0d`:`${x.surfaceAlt}60`)(o))},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=o?`${x.primary}0d`:"transparent"},onFocus:e=>{t.disabled||(e.currentTarget.style.outline=`2px solid ${x.primary}`,e.currentTarget.style.outlineOffset="2px")},onBlur:e=>{e.currentTarget.style.outline="none"},children:[t.icon&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:x.primary,marginTop:t.subtitle?"1px":void 0},children:t.icon}),"left"===u&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?x.primary:x.textMuted,marginTop:t.subtitle?"1px":void 0},children:(0,a.jsx)(ae,{open:o,reduced:y,iconStyle:h,size:z.iconSize,color:o?x.primary:x.textMuted})}),(0,a.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("span",{style:{display:"block",lineHeight:1.4},children:t.title}),t.subtitle&&(0,a.jsx)("span",{style:{display:"block",fontSize:z.subtitleSize,color:x.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:t.subtitle})]}),t.badge&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:t.badge}),"right"===u&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?x.primary:x.textMuted,marginTop:t.subtitle?"1px":void 0},children:(0,a.jsx)(ae,{open:o,reduced:y,iconStyle:h,size:z.iconSize,color:o?x.primary:x.textMuted})})]}),(0,a.jsx)(se,{isOpen:o,reduced:y,id:l,triggerId:i,children:(0,a.jsx)("div",{style:{padding:z.contentPadding,fontSize:z.fontSize,lineHeight:1.6,color:x.textMuted,fontFamily:"inherit"},children:t.content})})]},t.id)})})}de.displayName="TkxAccordion";var ce={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"},pe=0;function ue(){--pe<=0&&(pe=0,document.body.style.overflow="")}function he(){return(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var fe=["Su","Mo","Tu","We","Th","Fr","Sa"],me=["January","February","March","April","May","June","July","August","September","October","November","December"],ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function ye(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function be(e,t,n){return!(!t||!xe(e,t))||!(!n||!xe(e,n))}function ve(e,t="en-US",n){if(!e)return"";if(n){const t=String(e.getFullYear()),o=t.slice(-2),r=e.getMonth()+1,i=String(r).padStart(2,"0"),l=ge[e.getMonth()],a=me[e.getMonth()],s=e.getDate(),d=String(s).padStart(2,"0");return n.replace(/YYYY/g,t).replace(/YY/g,o).replace(/MMMM/g,a).replace(/MMM/g,l).replace(/MM/g,i).replace(/\bM\b/g,String(r)).replace(/DD/g,d).replace(/\bD\b/g,String(s))}return e.toLocaleDateString(t,{month:"2-digit",day:"2-digit",year:"numeric"})}function we(e,t){return new Date(e,t+1,0).getDate()}function ke(e){return 10*Math.floor(e/10)}function Se({values:e,selected:t,onSelect:n,label:o,theme:r,format:i}){const s=(0,l.useRef)([]),d=(0,l.useRef)(null);(0,l.useEffect)(()=>{const e=s.current[t];e&&d.current&&e.scrollIntoView({block:"nearest"})},[t]);const c=i??(e=>String(e).padStart(2,"0"));return(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[(0,a.jsx)("div",{style:{fontSize:"11px",fontWeight:600,color:r.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:o}),(0,a.jsx)("div",{ref:d,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${r.border}`,borderRadius:"8px",padding:"4px"},children:e.map(e=>{const o=e===t;return(0,a.jsx)("button",{ref:t=>{s.current[e]=t},type:"button",onClick:()=>n(e),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?r.primary:"transparent",color:o?r.bg:r.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:c(e)},e)})})]})}function Ce({year:e,month:t,today:n,mode:o,selectedDate:r,selectedRange:i,multiDates:l,hoverDate:s,focusedDate:d,isDateDisabled:c,onSelectDate:p,onHoverDate:u,onSetFocused:h,theme:f,locale:m}){const g=function(e,t){const n=new Date(e,t,1).getDay(),o=we(e,t),r=[],i=we(e,t-1);for(let a=n-1;a>=0;a--)r.push(new Date(e,t-1,i-a));for(let a=1;a<=o;a++)r.push(new Date(e,t,a));let l=1;for(;r.length<42;)r.push(new Date(e,t+1,l++));return r}(e,t);return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:fe.map(e=>(0,a.jsx)("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:f.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:g.map((e,g)=>{const x=e.getMonth()===t,y=xe(e,n),b=0===e.getDay()||6===e.getDay(),v=c(e),w="single"===o&&null!=r&&xe(e,r),k="multiple"===o&&l.some(t=>xe(t,e)),S="range"===o&&be(e,i[0],null),C="range"===o&&be(e,null,i[1]),$=S||C,z="range"===o&&i[0]&&!i[1]&&s?s:i[1],N="range"===o&&function(e,t,n){if(!t||!n)return!1;const o=ye(e).getTime(),r=ye(t).getTime(),i=ye(n).getTime();return o>Math.min(r,i)&&o<Math.max(r,i)}(e,i[0],z),M="range"===o&&i[0]&&!i[1]&&s&&xe(e,s),I=w||k||$,D=null!=d&&xe(e,d);let W="transparent",L=x?b?`${f.text}cc`:f.text:`${f.textMuted}60`,R="none",T=400;return I||M?(W=f.primary,L=f.bg,T=600):N&&(W=`${f.primary}18`),y&&!I&&(R=`2px solid ${f.primary}`,T=600),v&&(L=`${f.textMuted}50`),D&&!I&&(R=`2px solid ${f.secondary}`),(0,a.jsx)("button",{type:"button","aria-label":e.toLocaleDateString(m,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":I,"aria-disabled":v,disabled:v,onClick:()=>!v&&p(e),onMouseEnter:()=>u(e),onMouseLeave:()=>u(null),onFocus:()=>h(e),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:W,color:L,border:R,fontSize:"13px",fontWeight:T,cursor:v?"not-allowed":"pointer",opacity:v?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:v?"line-through":"none",transition:"background-color 80ms ease"},children:e.getDate()},g)})})]})}function $e({value:e,onChange:i,rangeValue:d,onRangeChange:c,multiValue:p,onMultiChange:u,mode:h="single",minDate:f,maxDate:m,disabledDates:g,locale:x="en-US",dateFormat:y,showTime:b=!1,timeValue:v,onTimeChange:w,showPresets:k=!1,customPresets:S,label:C,placeholder:$="MM/DD/YYYY",hint:z,isDisabled:N=!1,isInvalid:M=!1,errorMessage:I,numberOfMonths:D=1,id:W,className:L,style:R}){const T=t.useTheme(),A=r.useLocale(),B=(0,l.useId)(),F=W??B,E=o.useReducedMotion(),j=ye(new Date),H=void 0!==e,[P,O]=(0,l.useState)(null),V=H?e??null:P,K=void 0!==d,[U,Y]=(0,l.useState)([null,null]),q=K?d:U,X=void 0!==p,[Z,_]=(0,l.useState)([]),G=X?p:Z,[J,Q]=(0,l.useState)("start"),ee="range"===h||"single"===h&&b,[te,ne]=(0,l.useState)([null,null]),[oe,re]=(0,l.useState)(null),ie=V??q[0]??j,[le,ae]=(0,l.useState)(ie.getFullYear()),[se,de]=(0,l.useState)(ie.getMonth()),[ce,pe]=(0,l.useState)("day"),[ue,he]=(0,l.useState)({h:0,m:0}),fe=v??ue,[be,we]=(0,l.useState)(!1),[$e,ze]=(0,l.useState)(()=>{if("single"===h)return ve(V,x,y);if("range"===h){const[e,t]=q;if(e&&t)return`${ve(e,x,y)} – ${ve(t,x,y)}`}return""}),[Ne,Me]=(0,l.useState)(null),[Ie,De]=(0,l.useState)(null),[We,Le]=(0,l.useState)({top:0,left:0,flipUp:!1}),[,Re]=(0,l.useReducer)(e=>e+1,0),Te=(0,l.useRef)(null),Ae=(0,l.useRef)(null),Be=(0,l.useRef)(null),Fe=k?420:b?480:360;(0,l.useEffect)(()=>{if("single"===h)ze(ve(V,x,y));else if("range"===h){const[e,t]=q;ze(e&&t?`${ve(e,x,y)} – ${ve(t,x,y)}`:e?ve(e,x,y):"")}else"multiple"===h&&ze(G.length>0?`${G.length} date${1!==G.length?"s":""} selected`:"")},[V,q,G,h,x,y]);const Ee=(0,l.useCallback)(()=>{Te.current&&Le(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight,r=window.scrollY,i=window.scrollX,l=o-n.bottom<t+8&&n.top>t+8;return{top:l?r+n.top-t-4:r+n.bottom+4,left:i+n.left,flipUp:l}}(Te.current,Fe))},[Fe]);(0,l.useEffect)(()=>{if(be)return Ee(),window.addEventListener("scroll",Ee,!0),window.addEventListener("resize",Ee),()=>{window.removeEventListener("scroll",Ee,!0),window.removeEventListener("resize",Ee)}},[be,Ee]),(0,l.useEffect)(()=>{if(!be)return;const e=e=>{Te.current?.contains(e.target)||Ae.current?.contains(e.target)||we(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[be]),(0,l.useEffect)(()=>{if(!be)return;const e=e=>{"Escape"===e.key&&(we(!1),Be.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[be]);const je=(0,l.useCallback)(e=>!!(f&&ye(e)<ye(f))||!!(m&&ye(e)>ye(m))||!!g&&("function"==typeof g?g(e):g.some(t=>xe(t,e))),[f,m,g]),He=(0,l.useCallback)(e=>{if(!je(e)){if("single"===h)ee?re(e):(H||O(e),i?.(e),ze(ve(e,x,y)),we(!1));else if("range"===h)if("start"===J){const t=[e,null];ne(t),K||Y(t),c?.(t),Q("end")}else{const t=te[0]??q[0],n=t&&e<t?[e,t]:[t,e];ne(n),ee?Q("start"):(K||Y(n),c?.(n),Q("start"),we(!1))}else if("multiple"===h){const t=G.some(t=>xe(t,e))?G.filter(t=>!xe(t,e)):[...G,e];X||_(t),u?.(t)}Re()}},[h,je,H,K,X,i,c,u,J,te,q,G,ee,x]),Pe=(0,l.useCallback)(()=>{if("single"===h){const e=oe??V;H||O(e),i?.(e)}else"range"===h&&(K||Y(te),c?.(te));we(!1),Q("start")},[h,oe,te,V,H,K,i,c]),Oe=(0,l.useCallback)(()=>{re(null),ne([null,null]),Q("start"),we(!1)},[]),Ve=S??function(e){const t={today:e?.today??"Today",yesterday:e?.yesterday??"Yesterday",last7:e?.last7Days??"Last 7 days",last30:e?.last30Days??"Last 30 days",last90:"Last 90 days",thisWeek:"This week",lastWeek:"Last week",thisMonth:e?.thisMonth??"This month",lastMonth:e?.lastMonth??"Last month"};return[{label:t.today,getValue:()=>{const e=ye(new Date);return[e,e]}},{label:t.yesterday,getValue:()=>{const e=ye(new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:t.last7,getValue:()=>{const e=ye(new Date),t=new Date(e);return t.setDate(t.getDate()-6),[t,e]}},{label:t.last30,getValue:()=>{const e=ye(new Date),t=new Date(e);return t.setDate(t.getDate()-29),[t,e]}},{label:t.last90,getValue:()=>{const e=ye(new Date),t=new Date(e);return t.setDate(t.getDate()-89),[t,e]}},{label:t.thisWeek,getValue:()=>{const e=ye(new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay());const n=new Date(t);return n.setDate(n.getDate()+6),[t,n]}},{label:t.lastWeek,getValue:()=>{const e=ye(new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay()-1);const n=new Date(t);return n.setDate(n.getDate()-6),[n,t]}},{label:t.thisMonth,getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:t.lastMonth,getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=new Date,t=Math.floor(e.getMonth()/3);return[new Date(e.getFullYear(),3*t,1),new Date(e.getFullYear(),3*t+3,0)]}},{label:"Last quarter",getValue:()=>{const e=new Date,t=Math.floor(e.getMonth()/3),n=0===t?3:t-1,o=0===t?e.getFullYear()-1:e.getFullYear();return[new Date(o,3*n,1),new Date(o,3*n+3,0)]}},{label:"This year",getValue:()=>{const e=(new Date).getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=(new Date).getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}]}(A),Ke=11===se?0:se+1,Ue=11===se?le+1:le,Ye=D>=2,qe=C?n.sanitizeString(C):void 0,Xe=z?n.sanitizeString(z):void 0,Ze=I?n.sanitizeString(I):void 0,_e=n.sanitizeString($),Ge="single"===h&&null!=V||"range"===h&&(null!=q[0]||null!=q[1])||"multiple"===h&&G.length>0,Je="range"===h?ee?te:q:[null,null],Qe=M?T.danger:be?T.primary:T.border,et=Array.from({length:24},(e,t)=>t),tt=Array.from({length:60},(e,t)=>t),nt=(0,a.jsxs)("div",{ref:Ae,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:e=>{if("day"!==ce)return;const t=Ne??V??j;let n=null;if("ArrowRight"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1);else if("ArrowLeft"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1);else if("ArrowDown"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+7);else if("ArrowUp"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-7);else if("Enter"===e.key&&Ne)return void He(Ne);n&&(e.preventDefault(),Me(n),n.getMonth()===se&&n.getFullYear()===le||(de(n.getMonth()),ae(n.getFullYear())))},style:{position:"absolute",top:We.top,left:We.left,zIndex:9999,backgroundColor:T.surface,border:`1px solid ${T.border}`,borderRadius:"14px",boxShadow:"0 8px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",display:"flex",overflow:"hidden",minWidth:Ye?"580px":"300px",maxWidth:Ye&&k?"780px":Ye?"620px":k?"520px":"300px",opacity:be?1:0,transform:be?"translateY(0) scale(1)":We.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:E?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[k&&"range"===h&&(0,a.jsxs)("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${T.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[(0,a.jsx)("div",{style:{fontSize:"11px",fontWeight:600,color:T.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),Ve.map(e=>{const[t,n]=e.getValue(),o=Je[0]&&Je[1]&&xe(Je[0],t)&&xe(Je[1],n);return(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),o=[t,n];ne(o),K||Y(o),c?.(o),ae(t.getFullYear()),de(t.getMonth()),Q("start"),ee||we(!1)})(e),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:o?`${T.primary}20`:"transparent",color:o?T.primary:T.text,fontWeight:o?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:e=>{o||(e.currentTarget.style.backgroundColor=`${T.surfaceAlt}`)},onMouseLeave:e=>{o||(e.currentTarget.style.backgroundColor="transparent")},children:e.label},e.label)})]}),(0,a.jsxs)("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsx)("button",{type:"button","aria-label":"day"===ce?"Previous month":"month"===ce?"Previous year":"Previous decade",onClick:()=>{"day"===ce?(0===se?(de(11),ae(e=>e-1)):de(e=>e-1),pe("day")):ae("month"===ce?e=>e-1:e=>e-10)},style:{border:"none",background:"transparent",cursor:"pointer",color:T.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"15 18 9 12 15 6"})})}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:["day"===ce&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",onClick:()=>pe("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:T.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:me[se]}),(0,a.jsx)("button",{type:"button",onClick:()=>pe("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:T.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:le}),Ye&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{style:{color:T.textMuted,fontSize:"14px"},children:"–"}),(0,a.jsxs)("span",{style:{fontSize:"14px",fontWeight:600,color:T.text},children:[me[Ke]," ",Ue]})]})]}),"month"===ce&&(0,a.jsx)("button",{type:"button",onClick:()=>pe("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:T.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:le}),"year"===ce&&(0,a.jsxs)("span",{style:{fontSize:"14px",fontWeight:600,color:T.text},children:[ke(le),"–",ke(le)+9]})]}),(0,a.jsx)("button",{type:"button","aria-label":"day"===ce?"Next month":"month"===ce?"Next year":"Next decade",onClick:()=>{"day"===ce?(11===se?(de(0),ae(e=>e+1)):de(e=>e+1),pe("day")):ae("month"===ce?e=>e+1:e=>e+10)},style:{border:"none",background:"transparent",cursor:"pointer",color:T.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"9 18 15 12 9 6"})})})]}),"day"===ce&&(0,a.jsxs)("div",{style:{display:"flex",gap:"20px"},children:[(0,a.jsx)(Ce,{year:le,month:se,today:j,mode:h,selectedDate:V,selectedRange:Je,multiDates:G,hoverDate:Ie,focusedDate:Ne,isDateDisabled:je,onSelectDate:He,onHoverDate:De,onSetFocused:Me,theme:T,locale:x}),Ye&&(0,a.jsx)(Ce,{year:Ue,month:Ke,today:j,mode:h,selectedDate:V,selectedRange:Je,multiDates:G,hoverDate:Ie,focusedDate:Ne,isDateDisabled:je,onSelectDate:He,onHoverDate:De,onSetFocused:Me,theme:T,locale:x})]}),"month"===ce&&(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:ge.map((e,t)=>{const n=t===se;return(0,a.jsx)("button",{type:"button",onClick:()=>{de(t),pe("day")},style:{padding:"10px",borderRadius:"8px",border:t!==j.getMonth()||le!==j.getFullYear()||n?"none":`2px solid ${T.primary}`,cursor:"pointer",fontSize:"13px",fontWeight:n?600:400,backgroundColor:n?T.primary:"transparent",color:n?T.bg:T.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:e},e)})}),"year"===ce&&(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(e,t)=>{const n=ke(le)-1+t,o=n===le,r=n===j.getFullYear(),i=0===t||11===t;return(0,a.jsx)("button",{type:"button",onClick:()=>{ae(n),pe("month")},style:{padding:"10px 6px",borderRadius:"8px",border:r&&!o?`2px solid ${T.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?T.primary:"transparent",color:o?T.bg:i?T.textMuted:T.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:i?.5:1},children:n},n)})}),b&&"day"===ce&&(0,a.jsxs)("div",{style:{borderTop:`1px solid ${T.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[(0,a.jsx)(Se,{values:et,selected:fe.h,onSelect:e=>{v||he(t=>({...t,h:e})),w?.({...fe,h:e})},label:"Hour",theme:T}),(0,a.jsx)("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:T.textMuted},children:":"}),(0,a.jsx)(Se,{values:tt,selected:fe.m,onSelect:e=>{v||he(t=>({...t,m:e})),w?.({...fe,m:e})},label:"Min",theme:T})]}),"multiple"===h&&"day"===ce&&G.length>0&&(0,a.jsxs)("div",{style:{borderTop:`1px solid ${T.border}`,paddingTop:"8px",fontSize:"12px",color:T.textMuted,textAlign:"center"},children:[G.length," date",1!==G.length?"s":""," selected"]}),(0,a.jsxs)("div",{style:{borderTop:`1px solid ${T.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:ee?"space-between":"flex-start",gap:"8px"},children:[(0,a.jsx)("button",{type:"button",onClick:()=>{ae(j.getFullYear()),de(j.getMonth()),pe("day"),He(j)},style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:T.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),ee&&(0,a.jsxs)("div",{style:{display:"flex",gap:"6px"},children:[(0,a.jsx)("button",{type:"button",onClick:Oe,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${T.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:T.text,fontFamily:"inherit"},children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:Pe,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:T.primary,color:T.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});return(0,a.jsxs)("div",{className:L,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...R},children:[qe&&(0,a.jsx)("label",{htmlFor:F,style:{fontSize:"13px",fontWeight:500,color:T.text,marginBottom:"2px"},children:qe}),(0,a.jsxs)("div",{ref:Te,style:{display:"flex",alignItems:"center",border:`1.5px solid ${Qe}`,borderRadius:"8px",backgroundColor:T.surface,overflow:"hidden",transition:E?"none":"border-color 120ms ease",opacity:N?.5:1},children:[(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:T.textMuted,flexShrink:0},children:(0,a.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),(0,a.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,a.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,a.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),(0,a.jsx)("input",{ref:Be,id:F,type:"text",value:$e,placeholder:_e,disabled:N,"aria-invalid":M,"aria-haspopup":"dialog","aria-expanded":be,readOnly:"range"===h||"multiple"===h,onChange:e=>(e=>{if(ze(e),"single"===h){const t=function(e,t){const n=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(n){const[,e,t,o]=n.map(Number);if(e>=1&&e<=12&&t>=1&&t<=31){const n=new Date(o,e-1,t);if(n.getMonth()===e-1)return n}}const o=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(o){const[,e,t,n]=o.map(Number),r=new Date(e,t-1,n);if(r.getMonth()===t-1)return r}if(t&&/^DD/.test(t)){const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(t){const[,e,n,o]=t.map(Number),r=new Date(o,n-1,e);if(r.getMonth()===n-1)return r}}return null}(e,y);t&&!je(t)&&(H||O(t),i?.(t),ae(t.getFullYear()),de(t.getMonth()))}})(e.target.value),onFocus:()=>{N||we(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:T.text,cursor:"single"!==h?"pointer":"text",fontFamily:"inherit",minWidth:0}}),Ge&&!N&&(0,a.jsx)("button",{type:"button","aria-label":"Clear selection",onClick:e=>{if(e.stopPropagation(),"single"===h)H||O(null),i?.(null),ze("");else if("range"===h){const e=[null,null];K||Y(e),c?.(e),ne(e),ze(""),Q("start")}else"multiple"===h&&(X||_([]),u?.([]),ze(""))},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:T.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:(0,a.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,a.jsx)("button",{type:"button","aria-label":be?"Close calendar":"Open calendar",tabIndex:-1,disabled:N,onClick:()=>{N||we(e=>!e)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:N?"not-allowed":"pointer",color:T.textMuted,flexShrink:0},children:(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:be?"rotate(180deg)":"rotate(0deg)",transition:E?"none":"transform 160ms ease"},children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})})})]}),Xe&&!M&&(0,a.jsx)("span",{style:{fontSize:"12px",color:T.textMuted},children:Xe}),M&&Ze&&(0,a.jsx)("span",{role:"alert",style:{fontSize:"12px",color:T.danger},children:Ze}),be&&"undefined"!=typeof document&&(0,s.createPortal)(nt,document.body)]})}$e.displayName="TkxDatePicker";var ze={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function Ne(e,t,n){return Math.min(Math.max(e,t),n)}function Me(e,t,n){return Math.round((e-t)/n)*n+t}function Ie(e,t,n){return(e-t)/(n-t)*100}function De({value:e,min:t,max:n,step:o,isDisabled:r,trackColor:i,thumbSize:s,ariaLabel:d,tooltipMode:c,formatValue:p,orientation:u,onChange:h,onChangeEnd:f}){const[m,g]=(0,l.useState)(!1),[x,y]=(0,l.useState)(!1),[b,v]=(0,l.useState)(!1),w="vertical"===u,k=Ie(e,t,n),S="always"===c||"hover"===c&&(b||x||m),C=w?{position:"absolute",bottom:`${k}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${s/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"}:{position:"absolute",left:`${k}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${s/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"},$=w?{position:"absolute",left:s+6,top:"50%",transform:"translateY(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:s+6,left:"50%",transform:"translateX(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"};return(0,a.jsxs)("div",{style:C,children:[S&&(0,a.jsx)("div",{style:$,children:p(e)}),(0,a.jsx)("div",{role:"slider",tabIndex:r?-1:0,"aria-label":d,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":r,"aria-orientation":u,onKeyDown:i=>{r||("ArrowRight"===i.key||"ArrowUp"===i.key?(i.preventDefault(),h(Ne(Me(e+o,t,o),t,n))):"ArrowLeft"===i.key||"ArrowDown"===i.key?(i.preventDefault(),h(Ne(Me(e-o,t,o),t,n))):"Home"===i.key?(i.preventDefault(),h(t)):"End"===i.key&&(i.preventDefault(),h(n)))},onFocus:()=>g(!0),onBlur:()=>g(!1),onPointerEnter:()=>v(!0),onPointerLeave:()=>v(!1),onPointerDown:e=>{r||(y(!0),e.target.setPointerCapture(e.pointerId))},onPointerUp:()=>{y(!1),f?.()},style:{width:s,height:s,borderRadius:"50%",backgroundColor:r?"#888":i,border:"3px solid #fff",boxShadow:m?`0 0 0 3px ${i}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function We({value:e,defaultValue:r=0,onChange:i,rangeValue:s,onRangeChange:d,min:c=0,max:p=100,step:u=1,isRange:h=!1,label:f,showValue:m=!1,showTicks:g=!1,tickCount:x=5,isDisabled:y=!1,colorScheme:b="primary",size:v="md",marks:w,orientation:k="horizontal",showTooltip:S=!1,formatValue:C,onChangeEnd:$,onRangeChangeEnd:z,gradient:N=!1}){const M=t.useTheme(),I=(0,l.useId)(),D=o.useReducedMotion(),W=void 0!==e,[L,R]=(0,l.useState)(r),T=W?e:L,A=void 0!==s,[B,F]=(0,l.useState)([c,p]),E=A?s:B,j=(0,l.useRef)(null),H=(0,l.useRef)(T);H.current=T;const P=(0,l.useRef)(E);P.current=E;const O={primary:M.primary,success:M.success,danger:M.danger,warning:M.warning}[b],V=ze[v],K="vertical"===k,U=!0===S?"hover":!1!==S&&S,Y=C??(e=>String(e)),q=O+"66",X=(0,l.useCallback)((e,t)=>{const n=j.current;if(!n)return c;const o=n.getBoundingClientRect();let r;return r=Ne(K?(o.bottom-(t??0))/o.height:(e-o.left)/o.width,0,1),Ne(Me(r*(p-c)+c,c,u),c,p)},[c,p,u,K]),Z=(0,l.useCallback)(e=>{if(y)return;const t=X(e.clientX,e.clientY);if(h){const[e,n]=E,o=Math.abs(t-e)<=Math.abs(t-n)?[t,n]:[e,t];A||F(o),d?.(o)}else W||R(t),i?.(t)},[y,h,W,A,X,i,d,E]),_=h?Ie(E[0],c,p):0,G=Ie(h?E[1]:T,c,p),J=g?Array.from({length:x},(e,t)=>c+t/(x-1)*(p-c)):[],Q=f?n.sanitizeString(f):void 0,ee=D?"none":"background 150ms ease";return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-2"),style:{opacity:y?.55:1,...K?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(Q||m)&&(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between"),children:[Q&&(0,a.jsx)("label",{htmlFor:I,className:n.tkx("text-sm font-medium"),style:{color:M.text,fontSize:V.fontSize},children:Q}),m&&!h&&(0,a.jsx)("span",{className:n.tkx("text-sm tabular-nums"),style:{color:M.textMuted,fontSize:V.fontSize},children:Y(T)}),m&&h&&(0,a.jsxs)("span",{className:n.tkx("text-sm tabular-nums"),style:{color:M.textMuted,fontSize:V.fontSize},children:[Y(E[0])," – ",Y(E[1])]})]}),(0,a.jsxs)("div",{style:{position:"relative",...K?{paddingLeft:V.thumb/2,paddingRight:V.thumb/2,flex:1}:{paddingTop:V.thumb/2,paddingBottom:V.thumb/2}},children:[(0,a.jsxs)("div",{ref:j,onPointerDown:Z,style:{position:"relative",...K?{width:V.track,height:"100%"}:{height:V.track},borderRadius:9999,backgroundColor:M.border,cursor:y?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[(0,a.jsx)("div",{style:{position:"absolute",...K?{left:0,bottom:`${_}%`,height:G-_+"%",width:"100%"}:{top:0,left:`${_}%`,width:G-_+"%",height:"100%"},borderRadius:9999,...y?{backgroundColor:M.textMuted}:N?{background:K?`linear-gradient(to top, ${q}, ${O})`:`linear-gradient(to right, ${q}, ${O})`}:{backgroundColor:O},transition:ee}}),J.map((e,t)=>(0,a.jsx)("div",{style:{position:"absolute",...K?{bottom:`${Ie(e,c,p)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:V.track+4}:{left:`${Ie(e,c,p)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:V.track+4},backgroundColor:M.surface,borderRadius:9999,pointerEvents:"none"}},t)),h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(De,{value:E[0],min:c,max:E[1],step:u,isDisabled:y,trackColor:O,trackHeight:V.track,thumbSize:V.thumb,ariaLabel:`${Q??"Range"} start`,tooltipMode:U,formatValue:Y,orientation:k,onChange:e=>{const t=[Ne(e,c,E[1]),E[1]];A||F(t),d?.(t)},onChangeEnd:z?()=>z(P.current):void 0}),(0,a.jsx)(De,{value:E[1],min:E[0],max:p,step:u,isDisabled:y,trackColor:O,trackHeight:V.track,thumbSize:V.thumb,ariaLabel:`${Q??"Range"} end`,tooltipMode:U,formatValue:Y,orientation:k,onChange:e=>{const t=[E[0],Ne(e,E[0],p)];A||F(t),d?.(t)},onChangeEnd:z?()=>z(P.current):void 0})]}):(0,a.jsx)(De,{value:T,min:c,max:p,step:u,isDisabled:y,trackColor:O,trackHeight:V.track,thumbSize:V.thumb,ariaLabel:Q??"Slider",tooltipMode:U,formatValue:Y,orientation:k,onChange:e=>{W||R(e),i?.(e)},onChangeEnd:$?()=>$(H.current):void 0})]}),w&&w.length>0&&(0,a.jsx)("div",{style:{position:K?"absolute":"relative",...K?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:w.map((e,t)=>(0,a.jsx)("div",{style:{position:"absolute",...K?{bottom:`${Ie(e.value,c,p)}%`,transform:"translateY(50%)",left:0}:{left:`${Ie(e.value,c,p)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:M.textMuted,whiteSpace:"nowrap"},children:n.sanitizeString(e.label)},t))})]}),g&&!w&&!K&&(0,a.jsx)("div",{style:{position:"relative",height:"1rem"},children:J.map((e,t)=>(0,a.jsx)("span",{style:{position:"absolute",left:`${Ie(e,c,p)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:M.textMuted},children:Y(Math.round(e))},t))})]})}We.displayName="TkxSlider";var Le={sm:{height:28,minWidth:28,fontSize:"0.75rem",px:8},md:{height:36,minWidth:36,fontSize:"0.875rem",px:10},lg:{height:44,minWidth:44,fontSize:"1rem",px:12}};function Re({total:e,pageSize:o=10,page:i,defaultPage:s=1,onChange:d,siblingCount:c=1,showEdges:p=!0,showPageSize:u=!1,onPageSizeChange:h,pageSizeOptions:f=[10,25,50,100],size:m="md",variant:g="default"}){const x=t.useTheme(),y=r.useLocale(),b=(0,l.useId)(),v={pagination:"Pagination",firstPage:y.firstPage??"First page",lastPage:y.lastPage??"Last page",previousPage:y.previousPage??"Previous page",nextPage:y.nextPage??"Next page",pageN:e=>`Page ${e}`,showing:(e,t,n)=>y.showingRange?y.showingRange(e,t,n):`Showing ${e}–${t} of ${n} items`},w=void 0!==i,[k,S]=(0,l.useState)(s),C=w?i:k,[$,z]=(0,l.useState)(o),N=o,M=Math.max(1,Math.ceil(e/N)),I=e=>{const t=Math.min(Math.max(e,1),M);t!==C&&(w||S(t),d?.(t))},D=function(e,t,n,o){if(t<=1)return[1];const r=(e,t)=>Array.from({length:Math.max(0,t-e+1)},(t,n)=>e+n),i=Math.max(e-n,1),l=Math.min(e+n,t);if(!o){const e=[];return i>1&&e.push("..."),e.push(...r(i,l)),l<t&&e.push("..."),e}const a=i>3,s=l<t-2,d=[];d.push(1),a?d.push("left-ellipsis"):d.push(...r(2,i-1)),d.push(...r(Math.max(i,2),Math.min(l,t-1))),s?d.push("right-ellipsis"):d.push(...r(l+1,t-1)),t>1&&d.push(t);const c=new Set,p=[];for(const u of d)"number"==typeof u?c.has(u)||(c.add(u),p.push(u)):p.push(u);return p}(C,M,c,p),W=Le[m],L=Math.min((C-1)*N+1,e),R=Math.min(C*N,e),T=(e,t)=>{const n={height:W.height,minWidth:W.minWidth,paddingLeft:W.px,paddingRight:W.px,fontSize:W.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:t?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:t?.4:1};return e?{...n,backgroundColor:x.primary,color:x.bg,fontWeight:600,boxShadow:`0 0 0 2px ${x.primary}44`}:"default"===g?{...n,backgroundColor:x.surface,color:x.text,border:`1px solid ${x.border}`}:"outline"===g?{...n,backgroundColor:"transparent",color:x.text,border:`1px solid ${x.border}`}:{...n,backgroundColor:"transparent",color:x.text}},A=({d:e})=>(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:(0,a.jsx)("polyline",{points:e})});return(0,a.jsxs)("nav",{"aria-label":v.pagination,className:n.tkx("flex flex-col gap-2"),children:[e>0&&(0,a.jsx)("p",{className:n.tkx("text-sm"),style:{color:x.textMuted,fontSize:W.fontSize},children:n.sanitizeString(v.showing(L,R,e))}),(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1 flex-wrap"),children:[p&&(0,a.jsxs)("button",{type:"button","aria-label":v.firstPage,disabled:1===C,onClick:()=>I(1),style:T(!1,1===C),children:[(0,a.jsx)(A,{d:"15 18 9 12 15 6"}),(0,a.jsx)(A,{d:"20 18 14 12 20 6"})]}),(0,a.jsx)("button",{type:"button","aria-label":v.previousPage,disabled:1===C,onClick:()=>I(C-1),style:T(!1,1===C),children:(0,a.jsx)(A,{d:"15 18 9 12 15 6"})}),D.map((e,t)=>{if("string"==typeof e)return(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:W.minWidth,height:W.height,fontSize:W.fontSize,color:x.textMuted,userSelect:"none"},children:"…"},`${e}-${t}`);const n=e,o=n===C;return(0,a.jsx)("button",{type:"button","aria-label":v.pageN(n),"aria-current":o?"page":void 0,onClick:()=>I(n),style:T(o,!1),children:n},n)}),(0,a.jsx)("button",{type:"button","aria-label":v.nextPage,disabled:C===M,onClick:()=>I(C+1),style:T(!1,C===M),children:(0,a.jsx)(A,{d:"9 18 15 12 9 6"})}),p&&(0,a.jsxs)("button",{type:"button","aria-label":v.lastPage,disabled:C===M,onClick:()=>I(M),style:T(!1,C===M),children:[(0,a.jsx)(A,{d:"4 18 10 12 4 6"}),(0,a.jsx)(A,{d:"14 18 20 12 14 6"})]}),u&&(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2 ml-2"),children:[(0,a.jsx)("label",{htmlFor:b,className:n.tkx("text-sm"),style:{color:x.textMuted,fontSize:W.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),(0,a.jsx)("select",{id:b,value:$,onChange:e=>{return t=Number(e.target.value),z(t),h?.(t),void I(1);var t},style:{height:W.height,paddingLeft:W.px,paddingRight:W.px,fontSize:W.fontSize,borderRadius:"8px",border:`1px solid ${x.border}`,backgroundColor:x.surface,color:x.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:f.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]})]})]})}Re.displayName="TkxPagination";var Te={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},Ae={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function Be({color:e,size:t}){return(0,a.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,a.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,a.jsx)("path",{d:"M21 15l-5-5L5 21"})]})}function Fe(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Ee({mimeType:e,color:t}){return e.startsWith("image/")?(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,a.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,a.jsx)("path",{d:"M21 15l-5-5L5 21"})]}):"application/pdf"===e?(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,a.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,a.jsx)("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),(0,a.jsx)("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}):(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,a.jsx)("polyline",{points:"14 2 14 8 20 8"})]})}var je=0,He={sm:16,md:24,lg:32,xl:40};function Pe({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"50%",stopColor:n}),(0,a.jsx)("stop",{offset:"50%",stopColor:"transparent"})]})}),(0,a.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Oe({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"50%",stopColor:n}),(0,a.jsx)("stop",{offset:"50%",stopColor:"transparent"})]})}),(0,a.jsx)("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Ve({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"50%",stopColor:n}),(0,a.jsx)("stop",{offset:"50%",stopColor:"transparent"})]})}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5})]})}function Ke({type:e,size:t,filled:n,color:o,halfFilled:r,uid:i}){const l={size:t,filled:n,color:o,halfFilled:r,id:i};return"heart"===e?(0,a.jsx)(Oe,{...l}):"circle"===e?(0,a.jsx)(Ve,{...l}):(0,a.jsx)(Pe,{...l})}function Ue(e,t,n){return Math.min(n,Math.max(t,e))}function Ye(e,t,n){if(1===n)return t+1;const o=e.currentTarget.getBoundingClientRect(),r=o.left+o.width/2;return e.clientX<r?t+.5:t+1}var qe=!1;function Xe(){return(0,a.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),(0,a.jsx)("circle",{cx:"14",cy:"11",r:"4",fill:"currentColor"}),(0,a.jsx)("path",{d:"M6 24c0-4.418 3.582-8 8-8s8 3.582 8 8",fill:"currentColor"})]})}function Ze(){return(0,a.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),(0,a.jsx)("path",{d:"M14 5l2.2 6.5H23l-5.6 4 2.2 6.5L14 18l-5.6 4 2.2-6.5L5 11.5h6.8z",fill:"currentColor"})]})}function _e(){const e=t.useTheme();return(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1.5 px-4 py-3 rounded-2xl w-fit"),style:{backgroundColor:e.surface,border:`1px solid ${e.border}`},"aria-label":"Assistant is thinking",children:[(0,a.jsx)("span",{className:"tkx-dot1 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),(0,a.jsx)("span",{className:"tkx-dot2 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),(0,a.jsx)("span",{className:"tkx-dot3 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}})]})}function Ge({message:e,showTimestamp:r,avatarUser:i,avatarAssistant:l}){const s=t.useTheme(),d=o.useReducedMotion(),{role:c,content:p,timestamp:u,isStreaming:h,error:f}=e,m=n.sanitizeString(p),g=u?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(u):null;if("system"===c)return(0,a.jsx)("div",{role:"listitem",className:n.tkx("flex justify-center my-2"),children:(0,a.jsx)("p",{className:n.tkx("text-xs italic px-3 py-1 rounded-full"),style:{color:s.textMuted,backgroundColor:s.surfaceAlt},children:m})});const x="user"===c,y=x?i??(0,a.jsx)(Xe,{}):l??(0,a.jsx)(Ze,{}),b=x?{backgroundColor:s.primary,color:s.bg}:{backgroundColor:s.surface,color:s.text,border:`1px solid ${f?s.danger:s.border}`};return f&&(b.borderColor=s.danger,b.borderWidth="2px"),(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex gap-2 mb-4",x?"flex-row-reverse":"flex-row"),children:[(0,a.jsx)("div",{className:n.tkx("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:x?s.primary:s.secondary},children:y}),(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-1 max-w-[75%]",x?"items-end":"items-start"),children:[(0,a.jsxs)("div",{className:n.cx(n.tkx("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),h&&!d?"tkx-cursor":""),style:b,children:[m,f&&(0,a.jsx)("span",{"aria-label":"Error",style:{marginLeft:6,color:s.danger},children:"⚠"})]}),r&&g&&(0,a.jsx)("span",{className:n.tkx("text-[10px]"),style:{color:s.textMuted},children:g})]})]})}var Je={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},Qe={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},et={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},tt={sm:12,md:14,lg:16};function nt({variant:e="subtle",size:r="md",colorScheme:i="default",onRemove:l,leftIcon:s,isDisabled:d=!1,clickable:c=!1,children:p,className:u,style:h,onClick:f,...m}){t.useTheme();const g=o.useReducedMotion(),x=function(e,n){const o=t.useTheme(),r={default:o.textMuted,primary:o.primary,secondary:o.secondary,success:o.success,danger:o.danger,warning:o.warning,info:o.info}[e];return"solid"===n?{bg:r,color:o.bg,border:"transparent"}:"subtle"===n?{bg:`${r}22`,color:r,border:"transparent"}:{bg:"transparent",color:r,border:r}}(i,e),y="string"==typeof p?n.sanitizeString(p):p,b=tt[r],v=n.tkx("inline-flex items-center font-medium rounded-full select-none",Je[r],Qe[r],et[r],d?"opacity-50 cursor-not-allowed":c?"cursor-pointer":"cursor-default",c&&!g&&"transition-opacity duration-150");return(0,a.jsxs)("span",{role:c?"button":void 0,tabIndex:c&&!d?0:void 0,"aria-disabled":d||void 0,className:n.cx(v,u),style:{backgroundColor:x.bg,color:x.color,border:`1px solid ${"transparent"===x.border?"transparent":x.border}`,...h},onClick:d?void 0:f,onKeyDown:c&&!d&&f?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),f(e))}:void 0,...m,children:[s&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("shrink-0 flex items-center"),children:s}),(0,a.jsx)("span",{children:y}),l&&!d&&(0,a.jsx)("button",{type:"button","aria-label":`Remove ${"string"==typeof p?p:"tag"}`,onClick:e=>{e.stopPropagation(),l()},className:n.tkx("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:b+4,height:b+4,color:x.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:(0,a.jsx)("svg",{width:b,height:b,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})})]})}var ot=!1;function rt({status:e="pending",icon:r,size:i=28}){const l=t.useTheme(),s=o.useReducedMotion(),d=function(e="pending"){const n=t.useTheme();return{completed:n.success,active:n.primary,pending:n.border,error:n.danger}[e]}(e),c="active"===e;return(0,a.jsx)("div",{className:n.cx(n.tkx("relative flex items-center justify-center rounded-full shrink-0 z-10"),c&&!s?"tkx-pulse-dot":""),style:{width:i,height:i,backgroundColor:"pending"===e?l.surface:d,border:`2px solid ${d}`,color:"pending"===e?d:l.bg},"aria-hidden":"true",children:r?(0,a.jsx)("span",{style:{fontSize:.45*i,lineHeight:1},children:r}):(0,a.jsx)("span",{style:{width:.35*i,height:.35*i,borderRadius:"50%",backgroundColor:"pending"===e?d:l.bg,display:"block"}})})}function it({style:e,color:o,animate:r}){return t.useTheme(),(0,a.jsx)("div",{className:n.cx(n.tkx("w-0.5 flex-1 min-h-[24px]"),r?"tkx-draw-v":""),style:{borderLeft:`2px ${e} ${o}`,backgroundColor:"transparent",alignSelf:"stretch",borderColor:o,marginLeft:1},"aria-hidden":"true"})}function lt({style:e,color:t,animate:o}){return(0,a.jsx)("div",{className:n.cx(n.tkx("h-0.5 flex-1 min-w-[24px]"),o?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${t}`,borderColor:t},"aria-hidden":"true"})}function at({item:e,compact:o}){const r=t.useTheme(),i=e.timestamp?n.sanitizeString(e.timestamp):null;return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-0.5",o?"pb-3":"pb-5"),children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2 flex-wrap"),children:[(0,a.jsx)("span",{className:n.tkx("text-sm font-semibold leading-snug"),style:{color:r.text},children:"string"==typeof e.title?n.sanitizeString(e.title):e.title}),e.badge&&(0,a.jsx)("span",{children:e.badge}),i&&(0,a.jsx)("span",{className:n.tkx("text-[11px] ml-auto"),style:{color:r.textMuted},children:i})]}),e.description&&!o&&(0,a.jsx)("div",{className:n.tkx("text-xs leading-relaxed mt-0.5"),style:{color:r.textMuted},children:"string"==typeof e.description?n.sanitizeString(e.description):e.description})]})}function st(e,t,n,o){const r=window.innerWidth,i=window.innerHeight;let l=0,a=0,s="top left";switch(t){case"bottom-start":l=e.bottom+6,a=e.left,s="top left",l+o>i&&e.top-6-o>0&&(l=e.top-6-o,s="bottom left"),a+n>r&&(a=Math.max(0,r-n-8));break;case"bottom-end":l=e.bottom+6,a=e.right-n,s="top right",l+o>i&&e.top-6-o>0&&(l=e.top-6-o,s="bottom right"),a<0&&(a=8);break;case"top-start":l=e.top-6-o,a=e.left,s="bottom left",l<0&&(l=e.bottom+6,s="top left"),a+n>r&&(a=Math.max(0,r-n-8));break;case"top-end":l=e.top-6-o,a=e.right-n,s="bottom right",l<0&&(l=e.bottom+6,s="top right"),a<0&&(a=8);break;case"right-start":l=e.top,a=e.right+6,s="top left",a+n>r&&(a=e.left-6-n,s="top right"),l+o>i&&(l=Math.max(8,i-o-8));break;case"left-start":l=e.top,a=e.left-6-n,s="top right",a<0&&(a=e.right+6,s="top left"),l+o>i&&(l=Math.max(8,i-o-8))}return{top:l+window.scrollY,left:a+window.scrollX,transformOrigin:s}}function dt(e,t){return{position:"absolute",top:t.top,left:t.left,zIndex:9999,minWidth:200,maxWidth:320,backgroundColor:e.surface,border:`1.5px solid ${e.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",padding:"4px 0",transformOrigin:t.transformOrigin,overflow:"hidden"}}function ct({color:e}){return(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})})}function pt({color:e}){return(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"5",fill:e}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:e,strokeWidth:"2"})]})}function ut({color:e}){return(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M9 18l6-6-6-6"})})}function ht({items:e,pos:o,panelId:r,onClose:i,onCloseAll:d,isSubmenu:c=!1}){const p=t.useTheme(),[u,h]=(0,l.useState)(-1),[f,m]=(0,l.useState)(null),[g,x]=(0,l.useState)(null),y=(0,l.useRef)(null),[b,v]=(0,l.useState)(""),w=(0,l.useRef)(null),k=function(e){const t=[];let n=0;for(const o of e)if("separator"!==o.type)if("radio-group"===o.type)for(let e=0;e<o.options.length;e++)t.push({kind:"radio",item:o,optionIdx:e,idx:n++});else"check"===o.type?t.push({kind:"check",item:o,idx:n++}):"submenu"===o.type?t.push({kind:"submenu",item:o,idx:n++}):t.push({kind:"action",item:o,idx:n++});return t}(e);(0,l.useEffect)(()=>{y.current?.focus()},[]),(0,l.useEffect)(()=>{u<0||(y.current?.querySelector(`[data-midx="${u}"]`))?.scrollIntoView({block:"nearest"})},[u]);const S=(0,l.useCallback)(e=>{if("action"===e.kind){if(e.item.disabled)return;e.item.onClick?.(),d()}else if("check"===e.kind){if(e.item.disabled)return;e.item.onChange?.(!e.item.checked)}else if("radio"===e.kind){if(e.item.disabled)return;e.item.onChange?.(e.item.options[e.optionIdx].value)}else if("submenu"===e.kind){if(e.item.disabled)return;m(e.item.id)}},[d]);function C(){m(null),x(null)}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("style",{children:"\n@keyframes tkxMenuIn {\n from { opacity: 0; transform: scale(0.94); }\n to { opacity: 1; transform: scale(1); }\n}\n@keyframes tkxMenuInReduced {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@media (prefers-reduced-motion: no-preference) {\n .tkx-menu-panel {\n animation: tkxMenuIn 130ms cubic-bezier(0.16, 1, 0.3, 1) forwards;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .tkx-menu-panel {\n animation: tkxMenuInReduced 100ms ease forwards;\n }\n}\n"}),(0,a.jsx)("div",{ref:y,id:r,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),h(e=>{const t=e+1;return t<k.length?t:0});break;case"ArrowUp":e.preventDefault(),h(e=>{const t=e-1;return t>=0?t:k.length-1});break;case"Home":e.preventDefault(),h(0);break;case"End":e.preventDefault(),h(k.length-1);break;case"Enter":case" ":e.preventDefault(),u>=0&&k[u]&&S(k[u]);break;case"Escape":e.preventDefault(),c?i():d();break;case"Tab":e.preventDefault(),d();break;case"ArrowRight":e.preventDefault(),u>=0&&"submenu"===k[u]?.kind&&m(k[u].item.id);break;case"ArrowLeft":e.preventDefault(),c&&i();break;default:1!==e.key.length||e.ctrlKey||e.metaKey||function(e){w.current&&clearTimeout(w.current);const t=b+e.toLowerCase();v(t);const n=k.findIndex(e=>("radio"===e.kind?e.item.options[e.optionIdx].label:e.item.label).toLowerCase().startsWith(t));n>=0&&h(n),w.current=setTimeout(()=>v(""),800)}(e.key)}},style:{...dt(p,o),maxHeight:400,overflowY:"auto"},children:(()=>{let t=-1;return e.map(e=>{if("separator"===e.type)return(0,a.jsx)("div",{role:"separator",style:{margin:(e.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:e.label?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{flex:1,height:1,backgroundColor:p.border,marginLeft:14}}),(0,a.jsx)("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:p.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)}),(0,a.jsx)("div",{style:{flex:1,height:1,backgroundColor:p.border,marginRight:14}})]}):(0,a.jsx)("div",{style:{flex:1,height:1,backgroundColor:p.border,margin:"0 10px"}})},e.id);if("radio-group"===e.type)return(0,a.jsxs)("div",{role:"group","aria-label":e.label,children:[e.label&&(0,a.jsx)("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:p.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:n.sanitizeString(e.label)}),e.options.map((o,r)=>{t++;const i=t,l=i===u,s=o.value===e.value,d=!!e.disabled,c=ft(p,l,!1,d);return(0,a.jsxs)("div",{role:"menuitemradio","aria-checked":s,"aria-disabled":d||void 0,"data-midx":i,tabIndex:-1,style:c,onClick:()=>!d&&e.onChange?.(o.value),onMouseEnter:()=>!d&&h(i),children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:s?(0,a.jsx)(pt,{color:p.primary}):(0,a.jsx)("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${p.border}`,display:"inline-block"}})}),o.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex",color:p.textMuted},children:o.icon}),(0,a.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(o.label)})]},o.value)})]},e.id);if("check"===e.type){t++;const o=t,r=o===u,i=!!e.disabled,l=ft(p,r,!1,i);return(0,a.jsxs)("div",{role:"menuitemcheckbox","aria-checked":e.checked,"aria-disabled":i||void 0,"data-midx":o,tabIndex:-1,style:l,onClick:()=>!i&&e.onChange?.(!e.checked),onMouseEnter:()=>!i&&h(o),children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:e.checked?(0,a.jsx)(ct,{color:p.primary}):(0,a.jsx)("span",{style:{width:14,height:14,display:"inline-block"}})}),e.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex",color:p.textMuted},children:e.icon}),(0,a.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)})]},e.id)}if("submenu"===e.type){t++;const o=t,i=o===u,l=!!e.disabled,c=f===e.id,y=ft(p,i||c,!1,l);return(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsxs)("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":c,"aria-disabled":l||void 0,"data-midx":o,tabIndex:-1,style:y,onMouseEnter:t=>{l||(h(o),function(e,t){const n=t.getBoundingClientRect();m(e.id),x(function(e,t,n){const o=window.innerWidth,r=window.innerHeight;let i=e.right+4,l="top left";i+220>o&&(i=e.left-4-220,l="top right");let a=e.top;return a+n>r&&(a=Math.max(8,r-n-8)),{top:a+window.scrollY,left:i+window.scrollX,transformOrigin:l}}(n,0,Math.min(38*e.items.length+12,360)))}(e,t.currentTarget))},onMouseLeave:()=>{},onClick:()=>{l||m(c?null:e.id)},children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:e.icon?(0,a.jsx)("span",{style:{display:"flex",color:p.textMuted},children:e.icon}):(0,a.jsx)("span",{style:{width:14}})}),(0,a.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)}),(0,a.jsx)(ut,{color:p.textMuted})]}),c&&g&&(0,s.createPortal)((0,a.jsx)(ht,{items:e.items,pos:g,panelId:`${r}-sub-${e.id}`,onClose:C,onCloseAll:d,isSubmenu:!0}),document.body)]},e.id)}const o=e;t++;const i=t,l=i===u,c=!!o.disabled,y=!!o.danger,b=ft(p,l,y,c);return(0,a.jsxs)("div",{role:"menuitem","aria-disabled":c||void 0,"data-midx":i,tabIndex:-1,style:b,onClick:()=>{c||(o.onClick?.(),d())},onMouseEnter:()=>{c||(h(i),C())},children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:o.icon?(0,a.jsx)("span",{style:{display:"flex",color:y?p.danger:p.textMuted},children:o.icon}):(0,a.jsx)("span",{style:{width:14}})}),(0,a.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(o.label)}),o.description&&(0,a.jsx)("span",{style:{display:"block",fontSize:"12px",color:p.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(o.description)})]}),o.shortcut&&(0,a.jsx)("span",{style:{fontSize:"12px",color:p.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:n.sanitizeString(o.shortcut)})]},o.id)})})()})]})}function ft(e,t,n,o){const r=n?e.danger:e.text;return{display:"flex",alignItems:"center",gap:8,padding:"7px 14px",fontSize:"14px",fontFamily:"inherit",cursor:o?"not-allowed":"pointer",userSelect:"none",color:o?e.textMuted:t&&n?e.danger:r,backgroundColor:t?n?`${e.danger}18`:`${e.primary}18`:"transparent",transition:"background-color 80ms",opacity:o?.5:1,outline:"none"}}function mt({trigger:e,items:t,placement:n="bottom-start",isDisabled:o=!1,onOpen:r,onClose:i,className:d,style:c}){const p=`tkx-menu-${(0,l.useId)().replace(/:/g,"")}`,[u,h]=(0,l.useState)(!1),[f,m]=(0,l.useState)(null),g=(0,l.useRef)(null),x=(0,l.useCallback)(()=>{if(o)return;const e=g.current;e&&(m(st(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360))),h(!0),r?.())},[o,t.length,r,n]),y=(0,l.useCallback)(()=>{h(!1),i?.(),(g.current?.firstElementChild)?.focus?.()},[i]);return(0,l.useEffect)(()=>{if(!u)return;const e=e=>{const t=e.target;if(g.current?.contains(t))return;const n=document.querySelectorAll(".tkx-menu-panel");for(const o of n)if(o.contains(t))return;y()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[u,y]),(0,l.useEffect)(()=>{if(!u)return;const e=()=>{const e=g.current;e&&m(st(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360)))};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[u,t.length,n]),(0,a.jsxs)("span",{ref:g,className:d,style:{display:"inline-flex",...c},children:[(0,a.jsx)("span",{role:"button",tabIndex:o?-1:0,"aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?p:void 0,"aria-disabled":o||void 0,onClick:()=>u?y():x(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),u||x()),"Escape"===e.key&&u&&(e.preventDefault(),y())},style:{display:"inline-flex",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,outline:"none"},children:e}),u&&f&&(0,s.createPortal)((0,a.jsx)(ht,{items:t,pos:f,panelId:p,onClose:y,onCloseAll:y}),document.body)]})}mt.displayName="TkxMenu";var gt={sm:120,md:180,lg:240,xl:320};function xt(e){const t=new Date;if(e)try{const n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,weekday:"long",month:"long",day:"2-digit",year:"numeric"}).formatToParts(t),o=e=>n.find(t=>t.type===e)?.value??"0";let r=parseInt(o("hour"),10);24===r&&(r=0);const i=parseInt(o("minute"),10),l=parseInt(o("second"),10),a=`${o("weekday")}, ${o("month")} ${o("day")}, ${o("year")}`;return{hours:r,minutes:i,seconds:l,milliseconds:t.getMilliseconds(),dateString:a}}catch{}const n=t.getHours(),o=t.getMinutes(),r=t.getSeconds(),i=t.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:o,seconds:r,milliseconds:t.getMilliseconds(),dateString:i}}function yt({time:e,size:t,analogStyle:n,showSeconds:o,reducedMotion:r,primary:i,danger:l,text:s,textMuted:d,border:c,surface:p,bg:u}){const h=t/2,f=t/2,m=t/2-4,{hours:g,minutes:x,seconds:y,milliseconds:b}=e,v=(y+(r?0:b)/1e3)/60*360,w=x/60*360+y/60*6,k=g%12/12*360+x/60*30,S=(e,t)=>{const n=(e-90)*Math.PI/180;return{x:h+Math.cos(n)*t,y:f+Math.sin(n)*t}},C=r?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if("modern"===n){const e=(e,t)=>{const n=360*e-90;return`M ${h+Math.cos(-90*Math.PI/180)*t} ${f+Math.sin(-90*Math.PI/180)*t} A ${t} ${t} 0 ${e>.5?1:0} 1 ${h+Math.cos(n*Math.PI/180)*t} ${f+Math.sin(n*Math.PI/180)*t}`},n=g%12/12+x/60/12,p=x/60+y/3600,u=(y+(r?0:b/1e3))/60,v=m-2,w=m-10,k=m-18;return(0,a.jsxs)("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:h,cy:f,r:v,fill:"none",stroke:c,strokeWidth:4}),(0,a.jsx)("circle",{cx:h,cy:f,r:w,fill:"none",stroke:c,strokeWidth:4}),o&&(0,a.jsx)("circle",{cx:h,cy:f,r:k,fill:"none",stroke:c,strokeWidth:3}),(0,a.jsx)("path",{d:e(n,v),fill:"none",stroke:i,strokeWidth:4,strokeLinecap:"round"}),(0,a.jsx)("path",{d:e(p,w),fill:"none",stroke:s,strokeWidth:4,strokeLinecap:"round"}),o&&(0,a.jsx)("path",{d:e(u,k),fill:"none",stroke:l,strokeWidth:3,strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:h,cy:f,r:4,fill:i}),(0,a.jsxs)("text",{x:h,y:f+20,textAnchor:"middle",fontSize:.12*t,fill:d,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(g).padStart(2,"0"),":",String(x).padStart(2,"0")]})]})}const $=S(k,.5*m),z=S(w,.75*m),N=S(v,.85*m),M=S(v+180,.2*m),I=[];if("classic"===n){for(let e=0;e<60;e++){const t=e%5==0,n=(e/60*360-90)*Math.PI/180,o=t?m-10:m-6,r=h+Math.cos(n)*m,i=f+Math.sin(n)*m,l=h+Math.cos(n)*o,c=f+Math.sin(n)*o;I.push((0,a.jsx)("line",{x1:r,y1:i,x2:l,y2:c,stroke:t?s:d,strokeWidth:t?2:1,strokeLinecap:"round"},e))}for(const{n:e,angle:n}of[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}]){const o=(n-90)*Math.PI/180,r=m-20;I.push((0,a.jsx)("text",{x:h+Math.cos(o)*r,y:f+Math.sin(o)*r,textAnchor:"middle",dominantBaseline:"central",fontSize:.09*t,fill:s,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:e},`n${e}`))}}else for(let D=0;D<12;D++){const e=(D/12*360-90)*Math.PI/180,t=m-8;I.push((0,a.jsx)("circle",{cx:h+Math.cos(e)*t,cy:f+Math.sin(e)*t,r:D%3==0?3:2,fill:D%3==0?s:d},D))}return(0,a.jsxs)("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",style:{display:"block"},children:[(0,a.jsx)("circle",{cx:h,cy:f,r:m,fill:p,stroke:c,strokeWidth:2}),I,(0,a.jsx)("line",{x1:h,y1:f,x2:$.x,y2:$.y,stroke:i,strokeWidth:"minimal"===n?3:4,strokeLinecap:"round",style:{transformOrigin:`${h}px ${f}px`,transition:C}}),(0,a.jsx)("line",{x1:h,y1:f,x2:z.x,y2:z.y,stroke:s,strokeWidth:"minimal"===n?2:3,strokeLinecap:"round",style:{transformOrigin:`${h}px ${f}px`,transition:C}}),o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("line",{x1:M.x,y1:M.y,x2:N.x,y2:N.y,stroke:l,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${h}px ${f}px`,transition:"none"}}),(0,a.jsx)("circle",{cx:h,cy:f,r:3,fill:l})]}),(0,a.jsx)("circle",{cx:h,cy:f,r:"minimal"===n?3:5,fill:i})]})}function bt({time:e,format:t,showSeconds:o,showDate:r,label:i,size:l,primary:s,text:d,textMuted:c,colonVisible:p}){const{hours:u,minutes:h,seconds:f,dateString:m}=e;let g=u,x="";"12h"===t&&(x=u>=12?"PM":"AM",g=u%12||12);const y=.2*l,b={opacity:p?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};return(0,a.jsxs)("div",{style:{textAlign:"center",fontFamily:"'Courier New', Courier, monospace",fontVariantNumeric:"tabular-nums",lineHeight:1.1},children:[(0,a.jsxs)("div",{style:{fontSize:y,color:s,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[(0,a.jsx)("span",{children:String(g).padStart(2,"0")}),(0,a.jsx)("span",{style:b,children:":"}),(0,a.jsx)("span",{children:String(h).padStart(2,"0")}),o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{style:b,children:":"}),(0,a.jsx)("span",{children:String(f).padStart(2,"0")})]}),"12h"===t&&(0,a.jsx)("span",{style:{fontSize:.45*y,color:c,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:.05*y},children:x})]}),r&&(0,a.jsx)("div",{style:{fontSize:.072*l,color:c,marginTop:.025*l,letterSpacing:"0.03em"},children:m}),i&&(0,a.jsx)("div",{style:{fontSize:.065*l,color:c,marginTop:.015*l,textTransform:"uppercase",letterSpacing:"0.08em"},children:n.sanitizeString(i)})]})}function vt({variant:e="both",size:n="md",showSeconds:r=!0,showDate:i=!1,format:s="24h",timezone:d,timezone2:c,label:p,analogStyle:u="classic",className:h,style:f}){const m=t.useTheme(),g=o.useReducedMotion(),[x,y]=(0,l.useState)(()=>xt(d)),[b,v]=(0,l.useState)(()=>c?xt(c):null),[w,k]=(0,l.useState)(!0),[S,C]=(0,l.useState)(!1),$=(0,l.useRef)(null);(0,l.useEffect)(()=>{C(!0)},[]),(0,l.useEffect)(()=>{const e=()=>{y(xt(d)),c&&v(xt(c))};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[d,c]),(0,l.useEffect)(()=>($.current=setInterval(()=>{k(e=>!e)},500),()=>{$.current&&clearInterval($.current)}),[]);const z=gt[n],N="analog"===e||"both"===e,M="digital"===e||"both"===e;return(0,a.jsxs)("div",{className:h,style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"both"===e?.06*z+"px":0,opacity:S?1:0,transition:g?"none":"opacity 0.4s ease",...f},role:"timer","aria-live":"off",children:[N&&(0,a.jsx)(yt,{time:x,size:z,analogStyle:u,showSeconds:r,reducedMotion:g,primary:m.primary,danger:m.danger,text:m.text,textMuted:m.textMuted,border:m.border,surface:m.surface,bg:m.bg}),M&&(0,a.jsx)(bt,{time:x,format:s,showSeconds:r,showDate:i,label:p,size:z,primary:m.primary,text:m.text,textMuted:m.textMuted,colonVisible:w}),b&&c&&(0,a.jsx)("div",{style:{marginTop:.04*z,padding:`${.03*z}px ${.06*z}px`,borderTop:`1px solid ${m.border}`,textAlign:"center"},children:(0,a.jsx)(bt,{time:b,format:s,showSeconds:!1,showDate:!1,label:c,size:.7*z,primary:m.secondary,text:m.text,textMuted:m.textMuted,colonVisible:w})})]})}function wt(e){if(!isFinite(e)||isNaN(e))return"0:00";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%60);return t>0?`${t}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`}function kt({path:e,size:t=20,color:n="currentColor",title:o}){return(0,a.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:n,"aria-hidden":o?void 0:"true",role:o?"img":void 0,"aria-label":o,style:{display:"block",flexShrink:0},children:(0,a.jsx)("path",{d:e})})}vt.displayName="TkxClock";var St="M8 5v14l11-7z",Ct="M6 19h4V5H6v14zm8-14v14h4V5h-4z";function $t({onClick:e,title:t,children:n,active:o,primary:r}){const[i,s]=(0,l.useState)(!1);return(0,a.jsx)("button",{type:"button",onClick:e,title:t,"aria-label":t,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:o||i?r:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function zt({src:e,poster:r,title:i,width:s="100%",height:d,autoPlay:c=!1,loop:p=!1,muted:u=!1,controls:h=!0,showTitle:f=!0,allowFullscreen:m=!0,allowPiP:g=!0,allowDownload:x=!1,chapters:y=[],subtitles:b=[],startTime:v,onPlay:w,onPause:k,onEnded:S,onTimeUpdate:C,className:$,style:z}){const N=t.useTheme(),M=o.useReducedMotion(),I=(0,l.useRef)(null),D=(0,l.useRef)(null),W=(0,l.useRef)(null),L=(0,l.useRef)(null),[R,T]=(0,l.useState)(!1),[A,B]=(0,l.useState)(0),[F,E]=(0,l.useState)(0),[j,H]=(0,l.useState)(0),[P,O]=(0,l.useState)(1),[V,K]=(0,l.useState)(u),[U,Y]=(0,l.useState)(!1),[q,X]=(0,l.useState)(!0),[Z,_]=(0,l.useState)(!1),[G,J]=(0,l.useState)(1),[Q,ee]=(0,l.useState)(!1),[te,ne]=(0,l.useState)(-1),[oe,re]=(0,l.useState)(null),[ie,le]=(0,l.useState)(0),[ae,se]=(0,l.useState)(null),[de,ce]=(0,l.useState)(!1),[pe,ue]=(0,l.useState)(!1),[he,fe]=(0,l.useState)(null),[me,ge]=(0,l.useState)(!1);(0,l.useEffect)(()=>{const e=I.current;if(!e)return;void 0!==v&&(e.currentTime=v);const t=()=>{B(e.currentTime),e.buffered.length>0&&H(e.buffered.end(e.buffered.length-1))},n=()=>E(e.duration),o=()=>T(!0),r=()=>{T(!1),_(!0)},i=()=>{T(!1),_(!0),S?.()},l=()=>ce(!0),a=()=>ce(!1),s=()=>ue(!0),d=()=>ue(!1),c=()=>{const t=e.error;fe(t?`Error ${t.code}: ${t.message||"Failed to load video"}`:"Failed to load video"),ue(!1)};return e.addEventListener("timeupdate",t),e.addEventListener("durationchange",n),e.addEventListener("play",o),e.addEventListener("pause",r),e.addEventListener("ended",i),e.addEventListener("enterpictureinpicture",l),e.addEventListener("leavepictureinpicture",a),e.addEventListener("waiting",s),e.addEventListener("canplay",d),e.addEventListener("error",c),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("durationchange",n),e.removeEventListener("play",o),e.removeEventListener("pause",r),e.removeEventListener("ended",i),e.removeEventListener("enterpictureinpicture",l),e.removeEventListener("leavepictureinpicture",a),e.removeEventListener("waiting",s),e.removeEventListener("canplay",d),e.removeEventListener("error",c)}},[S,v]),(0,l.useEffect)(()=>{I.current&&(R?w?.():k?.())},[R,w,k]),(0,l.useEffect)(()=>{C?.(A,F)},[A,F,C]),(0,l.useEffect)(()=>{const e=I.current;if(!e)return;const t=e.textTracks;for(let n=0;n<t.length;n++)t[n].mode=n===te?"showing":"disabled"},[te]),(0,l.useEffect)(()=>{const e=()=>Y(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),(0,l.useEffect)(()=>{const e=D.current;if(!e)return;const t=e=>{const t=I.current;if(t&&"INPUT"!==e.target.tagName)switch(e.key){case" ":case"k":e.preventDefault(),ye();break;case"f":case"F":m&&ve();break;case"m":case"M":be();break;case"ArrowRight":e.preventDefault(),t.currentTime=Math.min(t.currentTime+10,t.duration);break;case"ArrowLeft":e.preventDefault(),t.currentTime=Math.max(t.currentTime-10,0);break;case"ArrowUp":e.preventDefault(),O(Math.min(P+.1,1)),I.current&&(I.current.volume=Math.min(P+.1,1));break;case"ArrowDown":e.preventDefault(),O(Math.max(P-.1,0)),I.current&&(I.current.volume=Math.max(P-.1,0))}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[P,m]);const xe=(0,l.useCallback)(()=>{X(!0),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{R&&X(!1)},3e3)},[R]);(0,l.useEffect)(()=>(xe(),()=>{L.current&&clearTimeout(L.current)}),[R,xe]);const ye=(0,l.useCallback)(()=>{const e=I.current;e&&(e.paused?(e.play().catch(()=>{}),se("play"),_(!1)):(e.pause(),se("pause")),setTimeout(()=>se(null),600))},[]),be=(0,l.useCallback)(()=>{const e=I.current;if(!e)return;const t=!V;K(t),e.muted=t},[V]),ve=(0,l.useCallback)(()=>{const e=D.current;e&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):e.requestFullscreen().catch(()=>{}))},[]),we=(0,l.useCallback)(async()=>{const e=I.current;if(e)try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{}},[]),ke=(0,l.useCallback)(()=>{0!==b.length&&(ne(e=>(e+1)%(b.length+1)-1),ne(e=>{const t=e+1;return t>=b.length?-1:t}))},[b.length]),Se=(0,l.useCallback)(()=>{const e=I.current;e&&(e.currentTime=Math.min(e.currentTime+10,e.duration||0))},[]),Ce=(0,l.useCallback)(()=>{const e=I.current;e&&(e.currentTime=Math.max(e.currentTime-10,0))},[]),$e=(0,l.useCallback)(()=>{const e=I.current;e&&(fe(null),e.load())},[]),ze=(0,l.useCallback)(()=>{m&&ve()},[m,ve]),Ne=(0,l.useCallback)(e=>{const t=I.current,n=W.current;if(!t||!n||!F)return;const o=n.getBoundingClientRect();t.currentTime=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width))*F},[F]),Me=(0,l.useCallback)(e=>{const t=W.current;if(!t||!F)return;const n=t.getBoundingClientRect();re(Math.max(0,Math.min(1,(e.clientX-n.left)/n.width))*F),le(e.clientX-n.left)},[F]),Ie=(0,l.useCallback)(e=>{const t=parseFloat(e.target.value);O(t),I.current&&(I.current.volume=t,I.current.muted=0===t,K(0===t))},[]),De=(0,l.useCallback)(e=>{J(e),I.current&&(I.current.playbackRate=e),ee(!1)},[]),We=y.length>0?[...y].reverse().find(e=>A>=e.time):null,Le=e=>[...y].reverse().find(t=>e>=t.time)??null,Re=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],Te=Array.isArray(e)?e[0].src:e,Ae=q||Z||!R,Be=M?"none":"opacity 0.25s ease",Fe=V||0===P?"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z":P<.5?"M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z":"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z",Ee=F>0?A/F*100:0,je=F>0?j/F*100:0;return(0,a.jsxs)("div",{ref:D,className:$,tabIndex:0,onMouseMove:xe,onMouseLeave:()=>{R&&X(!1)},style:{position:"relative",width:s,height:d??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...z},children:[(0,a.jsxs)("video",{ref:I,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:r,autoPlay:c,loop:p,muted:u,playsInline:!0,onClick:ye,onDoubleClick:ze,children:[Re.map((e,t)=>(0,a.jsx)("source",{src:e.src,type:e.type},t)),b.map((e,t)=>(0,a.jsx)("track",{kind:"subtitles",label:n.sanitizeString(e.label),srcLang:e.lang,src:e.src,default:e.default},t))]}),f&&i&&(0,a.jsxs)("div",{style:{position:"absolute",top:0,left:0,right:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%)",padding:"16px 16px 32px",opacity:Ae?1:0,transition:Be,pointerEvents:"none"},children:[(0,a.jsx)("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:n.sanitizeString(i)}),We&&(0,a.jsxs)("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",n.sanitizeString(We.label)]})]}),ae&&(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.45)",borderRadius:"50%",width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center",animation:M?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:(0,a.jsx)(kt,{path:"play"===ae?St:Ct,size:32,color:"#fff"})}),pe&&!he&&(0,a.jsx)("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:(0,a.jsx)("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:N.primary,borderRadius:"50%",animation:M?"none":"tkxvp-spin 0.8s linear infinite"}})}),he&&(0,a.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.8)",zIndex:20,gap:12},children:[(0,a.jsx)(kt,{path:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",size:48,color:"#ef4444"}),(0,a.jsx)("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:he}),(0,a.jsxs)("button",{type:"button",onClick:$e,style:{display:"flex",alignItems:"center",gap:6,background:N.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[(0,a.jsx)(kt,{path:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",size:18,color:"#fff"}),"Retry"]})]}),h&&(0,a.jsxs)("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%)",padding:"32px 12px 8px",opacity:Ae?1:0,transition:Be},onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[(0,a.jsxs)("div",{ref:W,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(F),"aria-valuenow":Math.floor(A),tabIndex:0,onClick:Ne,onMouseMove:Me,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.height="8px"},onMouseLeave:e=>{e.currentTarget.style.height="4px",re(null)},children:[(0,a.jsx)("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${je}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),(0,a.jsx)("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Ee}%`,background:N.primary,borderRadius:2,pointerEvents:"none"}}),(0,a.jsx)("div",{style:{position:"absolute",top:"50%",left:`${Ee}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:N.primary,pointerEvents:"none"}}),y.map((e,t)=>{const o=F>0?e.time/F*100:0;return(0,a.jsx)("div",{title:n.sanitizeString(e.label),style:{position:"absolute",top:"50%",left:`${o}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${N.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},t)}),null!==oe&&(0,a.jsxs)("div",{style:{position:"absolute",bottom:12,left:ie,transform:"translateX(-50%)",background:"rgba(0,0,0,0.8)",color:"#fff",fontSize:"0.72rem",padding:"2px 6px",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none"},children:[wt(oe),Le(oe)&&(0,a.jsx)("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:n.sanitizeString(Le(oe).label)})]})]}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:2},children:[(0,a.jsx)($t,{onClick:ye,title:R?"Pause":"Play",primary:N.primary,children:(0,a.jsx)(kt,{path:R?Ct:St,size:22})}),(0,a.jsx)($t,{onClick:Ce,title:"Skip back 10 seconds",primary:N.primary,children:(0,a.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,a.jsx)(kt,{path:"M11.99 5V1l-5 5 5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z",size:22}),(0,a.jsx)("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),(0,a.jsx)($t,{onClick:Se,title:"Skip forward 10 seconds",primary:N.primary,children:(0,a.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,a.jsx)(kt,{path:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8V1l-5 5 5 5V7c3.31 0 6 2.69 6 6z",size:22}),(0,a.jsx)("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>ge(!0),onMouseLeave:()=>ge(!1),children:[(0,a.jsx)($t,{onClick:be,title:V?"Unmute":"Mute",primary:N.primary,children:(0,a.jsx)(kt,{path:Fe,size:20})}),(0,a.jsx)("div",{style:{overflow:"hidden",width:me?64:0,opacity:me?1:0,transition:M?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:(0,a.jsx)("input",{type:"range",min:0,max:1,step:.05,value:V?0:P,onChange:Ie,"aria-label":"Volume",style:{width:64,accentColor:N.primary,cursor:"pointer",height:4}})})]}),(0,a.jsxs)("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[wt(A)," / ",wt(F)]}),(0,a.jsx)("div",{style:{flex:1}}),b.length>0&&(0,a.jsx)($t,{onClick:ke,title:"Subtitles",primary:N.primary,active:te>=0,children:(0,a.jsx)(kt,{path:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z",size:20})}),(0,a.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ee(e=>!e),title:"Playback speed",style:{background:"none",border:"none",cursor:"pointer",color:"#fff",fontSize:"0.75rem",fontWeight:600,padding:"6px 8px",letterSpacing:"0.02em",position:"relative"},children:[G,"×"]}),1!==G&&(0,a.jsxs)("span",{style:{position:"absolute",top:0,right:0,background:N.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[G,"x"]}),Q&&(0,a.jsx)("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${N.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>De(e),style:{display:"block",width:"100%",padding:"6px 14px",background:e===G?N.primary+"30":"none",border:"none",color:e===G?N.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[e,"×"]},e))})]}),g&&"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&(0,a.jsx)($t,{onClick:we,title:"Picture-in-Picture",primary:N.primary,active:de,children:(0,a.jsx)(kt,{path:"M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z",size:20})}),x&&(0,a.jsx)("a",{href:Te,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:(0,a.jsx)(kt,{path:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",size:20})}),m&&(0,a.jsx)($t,{onClick:ve,title:U?"Exit fullscreen":"Fullscreen",primary:N.primary,children:(0,a.jsx)(kt,{path:U?"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z":"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",size:20})})]})]}),(0,a.jsx)("style",{children:"\n @keyframes tkxvp-flash {\n 0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }\n 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }\n }\n @keyframes tkxvp-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]})}zt.displayName="TkxVideoPlayer";var Nt={sm:{circle:24,fontSize:"0.75rem",titleSize:"0.8rem",descSize:"0.7rem",connectorWidth:2},md:{circle:32,fontSize:"0.875rem",titleSize:"0.9rem",descSize:"0.775rem",connectorWidth:2},lg:{circle:40,fontSize:"1rem",titleSize:"1rem",descSize:"0.85rem",connectorWidth:3}};function Mt({size:e}){const t=.55*e;return(0,a.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})}function It({size:e}){const t=.55*e;return(0,a.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})})}function Dt({status:e,index:t,showStepNumbers:n,icon:o,circleSize:r,fontSize:i,primary:l,danger:s,success:d,text:c,textMuted:p,border:u,surface:h,variant:f,reducedMotion:m,clickable:g}){const x="completed"===e,y="active"===e,b="error"===e;let v=h,w=u,k=p,S=2;x?(v="filled"===f?d:h,w=d,k="filled"===f?"#fff":d):y?(v="outlined"===f?h:l,w=l,k="outlined"===f?l:"#fff",S=2):b?(v="filled"===f?s:h,w=s,k="filled"===f?"#fff":s):"pending"===e&&(v=h,w=u,k=p);const C=y&&!m?{boxShadow:`0 0 0 4px ${l}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},$=g?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let z;return z=!o||x||b?x?(0,a.jsx)(Mt,{size:r}):b?(0,a.jsx)(It,{size:r}):n?(0,a.jsx)("span",{style:{fontSize:i,fontWeight:600,lineHeight:1},children:t+1}):(0,a.jsx)("span",{style:{fontSize:.22*r,lineHeight:1,background:k,borderRadius:"50%",width:.22*r,height:.22*r,display:"block"}}):(0,a.jsx)("span",{style:{fontSize:i,lineHeight:1},children:o}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("style",{children:`\n @keyframes tkxstepper-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 ${l}50; }\n 50% { box-shadow: 0 0 0 6px ${l}20; }\n }\n `}),(0,a.jsx)("div",{style:{width:r,height:r,minWidth:r,borderRadius:"50%",border:`${S}px solid ${w}`,backgroundColor:v,color:k,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:m?"none":"background-color 0.2s, border-color 0.2s",...C,...$},children:z})]})}function Wt({completed:e,orientation:t,connectorStyle:n,connectorWidth:o,primary:r,border:i,reducedMotion:l}){const s=e?r:i;return"horizontal"===t?(0,a.jsx)("div",{"aria-hidden":"true",style:{flex:1,height:o,background:"solid"===n?s:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(90deg, ${s} 0, ${s} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}):(0,a.jsx)("div",{"aria-hidden":"true",style:{width:o,flex:1,minHeight:20,background:"solid"===n?s:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(180deg, ${s} 0, ${s} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function Lt({steps:e,activeStep:r=0,orientation:i="horizontal",variant:l="default",size:s="md",clickable:d=!1,onStepClick:c,showStepNumbers:p=!0,alternateLabel:u=!1,connector:h="solid",className:f,style:m}){const g=t.useTheme(),x=o.useReducedMotion(),y=Nt[s],b="horizontal"===i;return(0,a.jsx)("div",{className:f,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:b?"row":"column",alignItems:b?u?"flex-start":"center":"stretch",width:"100%",gap:0,...m},children:e.map((t,o)=>{const i=((e,t)=>e.status?e.status:t<r?"completed":t===r?"active":"pending")(t,o),s=o===e.length-1,f="completed"===i||o<r,m=o%2==0,v=()=>{d&&c?.(o)},w=(0,a.jsx)(Dt,{status:i,index:o,showStepNumbers:p,icon:t.icon,circleSize:y.circle,fontSize:y.fontSize,primary:g.primary,danger:g.danger,success:g.success,text:g.text,textMuted:g.textMuted,border:g.border,surface:g.surface,variant:l,reducedMotion:x,clickable:d}),k=(0,a.jsxs)("div",{style:{textAlign:b&&!u?"center":"left",maxWidth:b?120:void 0},children:[(0,a.jsxs)("div",{style:{fontSize:y.titleSize,fontWeight:"active"===i?600:500,color:"pending"===i?g.textMuted:"error"===i?g.danger:g.text,lineHeight:1.3,transition:x?"none":"color 0.2s"},children:[n.sanitizeString(t.title),t.optional&&(0,a.jsx)("span",{style:{fontSize:y.descSize,color:g.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),t.description&&(0,a.jsx)("div",{style:{fontSize:y.descSize,color:g.textMuted,marginTop:2,lineHeight:1.4},children:n.sanitizeString(t.description)}),t.error&&"error"===i&&(0,a.jsx)("div",{style:{fontSize:y.descSize,color:g.danger,marginTop:2},children:n.sanitizeString(t.error)})]});return b?(0,a.jsxs)("div",{role:"listitem",style:{display:"flex",flex:s?0:1,alignItems:"center",minWidth:0},children:[(0,a.jsxs)("div",{onClick:v,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:d?"pointer":"default",flexShrink:0},"aria-current":"active"===i?"step":void 0,children:[u&&!m&&(0,a.jsx)("div",{style:{minHeight:1.5*y.circle+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:k}),w,!u&&k,u&&m&&(0,a.jsx)("div",{style:{marginTop:6},children:k})]}),!s&&(0,a.jsx)(Wt,{completed:f,orientation:"horizontal",connectorStyle:h,connectorWidth:y.connectorWidth,primary:g.primary,border:g.border,reducedMotion:x})]},t.id):(0,a.jsxs)("div",{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[(0,a.jsx)("div",{onClick:v,style:{cursor:d?"pointer":"default"},"aria-current":"active"===i?"step":void 0,children:w}),!s&&(0,a.jsx)(Wt,{completed:f,orientation:"vertical",connectorStyle:h,connectorWidth:y.connectorWidth,primary:g.primary,border:g.border,reducedMotion:x})]}),(0,a.jsx)("div",{style:{paddingTop:(y.circle-16*parseFloat(y.titleSize))/2,paddingBottom:s?0:16,flex:1,minWidth:0},children:k})]},t.id)})})}function Rt(e){let t=0,n=0,o=0;const r=e.replace("#","");3===r.length?(t=parseInt(r[0]+r[0],16),n=parseInt(r[1]+r[1],16),o=parseInt(r[2]+r[2],16)):r.length>=6&&(t=parseInt(r.slice(0,2),16),n=parseInt(r.slice(2,4),16),o=parseInt(r.slice(4,6),16)),t/=255,n/=255,o/=255;const i=Math.max(t,n,o),l=Math.min(t,n,o);let a=0,s=0;const d=(i+l)/2;if(i!==l){const e=i-l;switch(s=d>.5?e/(2-i-l):e/(i+l),i){case t:a=((n-o)/e+(n<o?6:0))/6;break;case n:a=((o-t)/e+2)/6;break;case o:a=((t-n)/e+4)/6}}return[Math.round(360*a),Math.round(100*s),Math.round(100*d)]}function Tt(e,t,n){n/=100;const o=(t/=100)*Math.min(n,1-n),r=t=>{const r=(t+e/30)%12,i=n-o*Math.max(Math.min(r-3,9-r,1),-1);return Math.round(255*i).toString(16).padStart(2,"0")};return`#${r(0)}${r(8)}${r(4)}`}function At(e){const t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return[isNaN(n)?0:n,isNaN(o)?0:o,isNaN(r)?0:r]}function Bt(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Ft(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Et(e,t,n){if("hex"===n)return t<1?`${e}${Math.round(255*t).toString(16).padStart(2,"0")}`:e;const[o,r,i]=At(e);if("rgb"===n)return t<1?`rgba(${o}, ${r}, ${i}, ${t.toFixed(2)})`:`rgb(${o}, ${r}, ${i})`;const[l,a,s]=Rt(e);return"hsl"===n?t<1?`hsla(${l}, ${a}%, ${s}%, ${t.toFixed(2)})`:`hsl(${l}, ${a}%, ${s}%)`:e}Lt.displayName="TkxStepper";var jt=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function Ht({hue:e,sat:t,bright:n,onChange:o}){const r=(0,l.useRef)(null),i=(0,l.useRef)(!1),s=(0,l.useCallback)(e=>{const t=r.current;if(!t)return;const n=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-n.left)/n.width)),l=Math.max(0,Math.min(1,(e.clientY-n.top)/n.height));o(Math.round(100*i),Math.round(100*(1-l)))},[o]);(0,l.useEffect)(()=>{const e=e=>{i.current&&s(e)},t=()=>{i.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[s]);const d=`${t}%`,c=100-n+"%";return(0,a.jsxs)("div",{ref:r,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:e=>{i.current=!0,s(e)},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),(0,a.jsx)("div",{style:{position:"absolute",left:d,top:c,transform:"translate(-50%, -50%)",width:"14px",height:"14px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.4)",pointerEvents:"none",backgroundColor:Tt(e,t,n/2+25)}})]})}function Pt({hue:e,onChange:t}){const n=(0,l.useRef)(null),o=(0,l.useRef)(!1),r=(0,l.useCallback)(e=>{const o=n.current;if(!o)return;const r=o.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));t(Math.round(360*i))},[t]);return(0,l.useEffect)(()=>{const e=e=>{o.current&&r(e)},t=()=>{o.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[r]),(0,a.jsx)("div",{ref:n,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:"linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)"},onMouseDown:e=>{o.current=!0,r(e)},children:(0,a.jsx)("div",{style:{position:"absolute",left:e/360*100+"%",top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`hsl(${e}, 100%, 50%)`,pointerEvents:"none"}})})}function Ot({alpha:e,hex:t,onChange:n}){const o=(0,l.useRef)(null),r=(0,l.useRef)(!1),i=(0,l.useCallback)(e=>{const t=o.current;if(!t)return;const r=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));n(Math.round(100*i)/100)},[n]);(0,l.useEffect)(()=>{const e=e=>{r.current&&i(e)},t=()=>{r.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[i]);const[s,d,c]=At(t);return(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),(0,a.jsx)("div",{ref:o,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${s},${d},${c},0), rgba(${s},${d},${c},1))`},onMouseDown:e=>{r.current=!0,i(e)},children:(0,a.jsx)("div",{style:{position:"absolute",left:100*e+"%",top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`rgba(${s},${d},${c},${e})`,pointerEvents:"none"}})})]})}var Vt={sm:{height:"32px",fontSize:"0.8125rem",px:"8px",btnW:"28px",iconSz:14},md:{height:"40px",fontSize:"0.875rem",px:"12px",btnW:"34px",iconSz:16},lg:{height:"48px",fontSize:"1rem",px:"14px",btnW:"40px",iconSz:18}};function Kt(e,t,n){let o=e;return void 0!==t&&(o=Math.max(o,t)),void 0!==n&&(o=Math.min(o,n)),o}function Ut(e,t){if(void 0===t)return e;const n=Math.pow(10,t);return Math.round(e*n)/n}function Yt({direction:e,isDisabled:t,btnW:n,height:o,primaryColor:r,borderColor:i,textMuted:s,iconSz:d,onStep:c,incrementLabel:p,decrementLabel:u}){const h=(0,l.useRef)(null),f=(0,l.useRef)(null),m="inc"===e?1:-1,g=(0,l.useCallback)(()=>{c(m),h.current=setTimeout(()=>{f.current=setInterval(()=>c(m),60)},400)},[m,c]),x=(0,l.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null),f.current&&(clearInterval(f.current),f.current=null)},[]);(0,l.useEffect)(()=>()=>x(),[x]);const y="inc"===e;return(0,a.jsx)("button",{type:"button","aria-label":y?p:u,disabled:t,onMouseDown:g,onMouseUp:x,onMouseLeave:x,onTouchStart:e=>{e.preventDefault(),g()},onTouchEnd:x,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:y?void 0:`1px solid ${i}`,borderLeft:y?`1px solid ${i}`:void 0,cursor:t?"not-allowed":"pointer",color:t?s:r,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:e=>{t||(e.currentTarget.style.background=`${r}12`)},onBlur:e=>{e.currentTarget.style.background="transparent"},children:y?(0,a.jsxs)("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):(0,a.jsx)("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function qt({value:e,defaultValue:o=0,onChange:i,min:s,max:d,step:c=1,precision:p,prefix:u,suffix:h,format:f,currency:m,locale:g,clampOnBlur:x=!0,allowMouseWheel:y=!1,size:b="md",label:v,hint:w,isDisabled:k=!1,isReadOnly:S=!1,isInvalid:C=!1,errorMessage:$,id:z,className:N,style:M}){const I=t.useTheme(),D=r.useLocale(),W=D.increment??"Increment",L=D.decrement??"Decrement",R=(0,l.useId)(),T=z??R,A=`${T}-hint`,B=`${T}-error`,F=void 0!==e,[E,j]=(0,l.useState)(o),H=F?e:E,[P,O]=(0,l.useState)(!1),[V,K]=(0,l.useState)(""),U=Vt[b],Y=C||!!$,q=Y?I.danger:P?I.primary:I.border,X=[w&&A,Y&&B].filter(Boolean).join(" ")||void 0,Z=v?n.sanitizeString(v):void 0,_=w?n.sanitizeString(w):void 0,G=$?n.sanitizeString($):void 0,J=u?n.sanitizeString(u):void 0,Q=h?n.sanitizeString(h):void 0,ee=(0,l.useCallback)(e=>{const t=Ut(e,p);F||j(t),i?.(t)},[F,i,p]),te=(0,l.useCallback)(e=>{k||S||ee(Kt(Ut(H+e*c,p),s,d))},[k,S,H,c,p,s,d,ee]),ne=P?V:function(e,t,n,o,r){const i=o??"en-US";return"currency"===t?new Intl.NumberFormat(i,{style:"currency",currency:n??"USD",minimumFractionDigits:r??2,maximumFractionDigits:r??2}).format(e):"percent"===t?new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:r??0,maximumFractionDigits:r??0}).format(e/100):"decimal"===t||void 0!==r?new Intl.NumberFormat(i,{minimumFractionDigits:r??0,maximumFractionDigits:r??20}).format(e):String(e)}(H,f,m,g,p),oe=(J||Q)&&!P;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1 w-full"),N),style:M,children:[Z&&(0,a.jsx)("label",{htmlFor:T,className:n.tkx("text-sm font-medium font-sans"),style:{color:I.text},children:Z}),(0,a.jsxs)("div",{className:n.tkx("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${q}`,backgroundColor:k?I.surfaceAlt:I.surface,opacity:k?.65:1,height:U.height},children:[(0,a.jsx)(Yt,{direction:"dec",isDisabled:k||S,btnW:U.btnW,height:U.height,primaryColor:I.primary,borderColor:I.border,textMuted:I.textMuted,iconSz:U.iconSz,onStep:te,incrementLabel:W,decrementLabel:L}),(0,a.jsxs)("div",{className:n.tkx("relative flex-1 flex items-center overflow-hidden"),children:[oe&&J&&(0,a.jsx)("span",{style:{position:"absolute",left:U.px,fontSize:U.fontSize,color:I.textMuted,pointerEvents:"none",userSelect:"none"},children:J}),(0,a.jsx)("input",{id:T,type:"text",inputMode:"decimal",value:P?V:ne,readOnly:S,disabled:k,"aria-invalid":Y,"aria-describedby":X,"aria-valuemin":s,"aria-valuemax":d,"aria-valuenow":H,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:U.fontSize,fontFamily:"inherit",color:I.text,paddingLeft:oe&&J?`calc(${U.px} + 1.2em)`:U.px,paddingRight:oe&&Q?`calc(${U.px} + 1.2em)`:U.px,cursor:k?"not-allowed":S?"default":"text"},onFocus:()=>{O(!0),K(String(H))},onBlur:()=>{O(!1);const e=parseFloat(V);if(isNaN(e))return i?.(null),void K(String(H));let t=Ut(e,p);x&&(t=Kt(t,s,d)),ee(t)},onChange:e=>{K(e.target.value)},onKeyDown:e=>{"ArrowUp"===e.key&&(e.preventDefault(),te(1)),"ArrowDown"===e.key&&(e.preventDefault(),te(-1))},onWheel:e=>{y&&P&&(e.preventDefault(),te(e.deltaY<0?1:-1))}}),oe&&Q&&(0,a.jsx)("span",{style:{position:"absolute",right:U.px,fontSize:U.fontSize,color:I.textMuted,pointerEvents:"none",userSelect:"none"},children:Q})]}),(0,a.jsx)(Yt,{direction:"inc",isDisabled:k||S,btnW:U.btnW,height:U.height,primaryColor:I.primary,borderColor:I.border,textMuted:I.textMuted,iconSz:U.iconSz,onStep:te,incrementLabel:W,decrementLabel:L})]}),_&&!G&&(0,a.jsx)("span",{id:A,className:n.tkx("text-xs"),style:{color:I.textMuted},children:_}),G&&(0,a.jsxs)("span",{id:B,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:I.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),G]})]})}qt.displayName="TkxNumberInput";var Xt={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},Zt={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function _t(e,t){return Zt[t].test(e)?e.toUpperCase():""}function Gt({length:e=6,value:o,onChange:i,onComplete:s,type:d="number",mask:c=!1,autoFocus:p=!1,isDisabled:u=!1,isInvalid:h=!1,errorMessage:f,hint:m,size:g="md",separator:x,separatorPosition:y,webOTP:b=!0,className:v,style:w}){const k=t.useTheme(),S=r.useLocale(),C=(0,l.useId)(),$=`${C}-hint`,z=`${C}-error`,N=void 0!==o,M=t=>{const n=t.split("").slice(0,e);for(;n.length<e;)n.push("");return n},[I,D]=(0,l.useState)(()=>M(N?o:"")),W=N?M(o):I,L=(0,l.useRef)([]),R=Xt[g],T=h||!!f,A=W.every(e=>""!==e),B=m?n.sanitizeString(m):void 0,F=f?n.sanitizeString(f):void 0,E=e=>T?k.danger:A?k.success:k.border;(0,l.useEffect)(()=>{p&&L.current[0]?.focus()},[]);const j=(0,l.useCallback)(e=>{N||D(e);const t=e.join("");i?.(t),e.every(e=>""!==e)&&s?.(t)},[N,i,s]);(0,l.useEffect)(()=>{if(!b||u)return;if("undefined"==typeof window||!("OTPCredential"in window))return;const t=new AbortController;return navigator.credentials?.get({otp:{transport:["sms"]},signal:t.signal}).then(t=>{if(!t?.code)return;const n=String(t.code).slice(0,e).split("").map(e=>_t(e,d));for(;n.length<e;)n.push("");j(n)}).catch(()=>{}),()=>t.abort()},[b,u,e,d]);const H=t=>{const n=Math.max(0,Math.min(e-1,t));L.current[n]?.focus()},P=t=>n=>{if(!u){if("Backspace"!==n.key){if("Delete"===n.key){n.preventDefault();const e=[...W];return e[t]="",void j(e)}return"ArrowLeft"===n.key?(n.preventDefault(),void H(t-1)):"ArrowRight"===n.key?(n.preventDefault(),void H(t+1)):"Home"===n.key?(n.preventDefault(),void H(0)):"End"===n.key?(n.preventDefault(),void H(e-1)):void 0}if(n.preventDefault(),""!==W[t]){const e=[...W];e[t]="",j(e)}else if(t>0){const e=[...W];e[t-1]="",j(e),H(t-1)}}},O=t=>n=>{if(u)return;const o=n.target.value.slice(-1);if(!o)return;const r=_t(o,d);if(!r)return;const i=[...W];i[t]=r,j(i),t<e-1&&H(t+1)},V=t=>n=>{if(n.preventDefault(),u)return;const o=n.clipboardData.getData("text").split("").map(e=>_t(e,d)).filter(Boolean);if(!o.length)return;const r=[...W];let i=t;for(const t of o){if(i>=e)break;r[i]=t,i++}j(r),H(Math.min(i,e-1))},K=[B&&$,T&&z].filter(Boolean).join(" ")||void 0;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-2 w-fit"),v),style:w,children:[(0,a.jsx)("div",{role:"group","aria-label":S.oneTimePassword??"One-time password","aria-describedby":K,className:n.tkx("flex items-center"),style:{gap:R.gap},children:Array.from({length:e},(t,o)=>{const r=E();return"undefined"!=typeof document&&(document.activeElement,L.current[o]),(0,a.jsxs)("div",{className:n.tkx("flex items-center"),style:{gap:R.gap},children:[x&&y===o&&0!==o&&(0,a.jsx)("span",{"aria-hidden":"true",style:{color:k.textMuted,userSelect:"none",flexShrink:0},children:x}),(0,a.jsx)("input",{ref:e=>{L.current[o]=e},type:c?"password":"text",inputMode:"number"===d?"numeric":"text",maxLength:1,value:W[o],disabled:u,"aria-label":`Digit ${o+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:O(o),onKeyDown:P(o),onPaste:V(o),onFocus:e=>e.target.select(),style:{width:R.box,height:R.box,textAlign:"center",fontSize:R.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${r}`,borderRadius:"8px",backgroundColor:u?k.surfaceAlt:k.surface,color:k.text,outline:"none",boxShadow:"none",cursor:u?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:u?.6:1},onFocusCapture:e=>{u||(e.currentTarget.style.borderColor=T?k.danger:k.primary,e.currentTarget.style.boxShadow=`0 0 0 3px ${T?k.danger:k.primary}33`)},onBlurCapture:e=>{e.currentTarget.style.borderColor=E(),e.currentTarget.style.boxShadow="none"}})]},o)})}),B&&!F&&(0,a.jsx)("span",{id:$,className:n.tkx("text-xs"),style:{color:k.textMuted},children:B}),F&&(0,a.jsxs)("span",{id:z,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:k.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),F]})]})}function Jt(e,t){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),o=t.toLowerCase(),r=o.indexOf(n);if(-1!==r)return{matched:!0,ranges:[[r,r+n.length-1]],score:0===r?100:80};const i=[];let l=0,a=-1,s=-1;for(let d=0;d<o.length&&l<n.length;d++)o[d]===n[l]&&(-1!==s&&d===s+1||(-1!==a&&i.push([a,s]),a=d),s=d,l++);return-1!==a&&-1!==s&&i.push([a,s]),l<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:i,score:40}}function Qt({text:e,ranges:t,color:n}){if(!t.length)return(0,a.jsx)(a.Fragment,{children:e});const o=[];let r=0;for(const[i,l]of t)r<i&&o.push((0,a.jsx)("span",{children:e.slice(r,i)},`t-${r}`)),o.push((0,a.jsx)("span",{style:{color:n,fontWeight:700},children:e.slice(i,l+1)},`h-${i}`)),r=l+1;return r<e.length&&o.push((0,a.jsx)("span",{children:e.slice(r)},"t-end")),(0,a.jsx)(a.Fragment,{children:o})}function en({surface:e,border:t}){return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[(0,a.jsx)("div",{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite",flexShrink:0}}),(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[(0,a.jsx)("div",{style:{height:13,borderRadius:4,width:"60%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite"}}),(0,a.jsx)("div",{style:{height:10,borderRadius:4,width:"40%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out 0.2s infinite"}})]})]})}function tn({items:e,isOpen:o=!1,onClose:i,placeholder:d,emptyMessage:c,maxItems:p=8,onItemSelect:u,className:h,style:f}){const m=t.useTheme(),g=r.useLocale(),x=d??g.commandSearch??"Type a command or search…",[y,b]=(0,l.useState)(""),[v,w]=(0,l.useState)(0),[k,S]=(0,l.useState)(!1),C=(0,l.useRef)(null),$=(0,l.useRef)(null),z=(0,l.useId)(),N=function(e){const t=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!e||!t.current)return;const n=t.current,o=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),r=o[0],i=o[o.length-1],l=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(e.preventDefault(),i?.focus()):document.activeElement===i&&(e.preventDefault(),r?.focus()))};return n.addEventListener("keydown",l),()=>n.removeEventListener("keydown",l)},[e]),t}(o),M=function(e,t){if(!e.trim())return t.filter(e=>!e.disabled).map(e=>({item:e,score:0,labelRanges:[]}));const n=[];for(const o of t){if(o.disabled)continue;const t=Jt(e,o.label),r=o.description?Jt(e,o.description):{matched:!1,score:0},i=(o.keywords??[]).some(t=>Jt(e,t).matched);t.matched?n.push({item:o,score:t.score+20,labelRanges:t.ranges}):r.matched?n.push({item:o,score:r.score,labelRanges:[]}):i&&n.push({item:o,score:20,labelRanges:[]})}return n.sort((e,t)=>t.score-e.score)}(y,e).slice(0,p),I=[];for(const t of M){const e=t.item.group,n=I.find(t=>t.group===e);n?n.items.push(t):I.push({group:e,items:[t]})}const D=I.flatMap(e=>e.items);var W,L;W=()=>{i?.()},L=o,(0,l.useEffect)(()=>{if(!L)return;const e=e=>{"Escape"===e.key&&W()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[W,L]),(0,l.useEffect)(()=>{o&&(b(""),w(0),setTimeout(()=>C.current?.focus(),30))},[o]),(0,l.useEffect)(()=>{v>=D.length&&w(Math.max(0,D.length-1))},[D.length,v]);const R=(0,l.useCallback)(e=>{const t=$.current;t&&t.querySelectorAll("[data-command-item]")[e]?.scrollIntoView({block:"nearest"})},[]),T=e=>{e.disabled||(e.onSelect?.(),u?.(e),i?.())};if(!o||"undefined"==typeof document)return null;const A=n.sanitizeString(x),B=g.noCommandsFound??`No results for "${n.sanitizeString(y)}"`,F=c?n.sanitizeString(c):B;if("undefined"!=typeof document&&!document.getElementById("tkx-shimmer-style")){const e=document.createElement("style");e.id="tkx-shimmer-style",e.textContent="@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }",document.head.appendChild(e)}return(0,s.createPortal)((0,a.jsxs)("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[(0,a.jsx)("div",{"aria-hidden":"true",onClick:i,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",animation:"tkx-fade-in 120ms ease"}}),(0,a.jsxs)("div",{ref:N,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:z,className:n.cx(h),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${m.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...f},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 16px",borderBottom:`1px solid ${m.border}`},children:[(0,a.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:m.textMuted,strokeWidth:2,"aria-hidden":"true",style:{flexShrink:0},children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,a.jsx)("input",{ref:C,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${z}-list`,"aria-activedescendant":D[v]?`${z}-item-${D[v].item.id}`:void 0,value:y,onChange:e=>{b(e.target.value),w(0)},onKeyDown:e=>{if("ArrowDown"===e.key){e.preventDefault();const t=Math.min(D.length-1,v+1);w(t),R(t)}else if("ArrowUp"===e.key){e.preventDefault();const t=Math.max(0,v-1);w(t),R(t)}else if("Enter"===e.key){e.preventDefault();const t=D[v];t&&T(t.item)}},placeholder:A,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:m.text}}),y&&(0,a.jsx)("button",{type:"button","aria-label":g.clearSelection,onClick:()=>{b(""),w(0),C.current?.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:m.textMuted,display:"flex",alignItems:"center",padding:0},children:(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,a.jsx)("div",{id:`${z}-list`,ref:$,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:k?Array.from({length:4},(e,t)=>(0,a.jsx)(en,{surface:m.surface,border:m.border},t)):0===D.length?(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:m.textMuted},children:[(0,a.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,a.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]}),(0,a.jsx)("span",{style:{fontSize:"0.875rem"},children:F})]}):I.map(({group:e,items:t},o)=>{const r=I.slice(0,o).reduce((e,t)=>e+t.items.length,0);return(0,a.jsxs)("div",{children:[e&&(0,a.jsx)("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:m.textMuted,padding:"10px 12px 4px"},children:n.sanitizeString(e)}),t.map((e,t)=>{const o=r+t,i=o===v,l=e.item;return(0,a.jsxs)("div",{id:`${z}-item-${l.id}`,role:"option","aria-selected":i,"aria-disabled":l.disabled,"data-command-item":!0,onClick:()=>T(l),onMouseEnter:()=>w(o),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:l.disabled?"not-allowed":"pointer",opacity:l.disabled?.45:1,backgroundColor:i?`${m.primary}18`:"transparent",borderLeft:i?`2px solid ${m.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[l.icon&&(0,a.jsx)("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:i?m.primary:m.textMuted},children:l.icon}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontSize:"0.875rem",fontWeight:500,color:m.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,a.jsx)(Qt,{text:l.label,ranges:e.labelRanges,color:m.primary})}),l.description&&(0,a.jsx)("div",{style:{fontSize:"0.75rem",color:m.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.sanitizeString(l.description)})]}),l.shortcut&&(0,a.jsx)("span",{style:{flexShrink:0,fontSize:"0.6875rem",fontWeight:500,color:m.textMuted,backgroundColor:m.surfaceAlt,border:`1px solid ${m.border}`,borderRadius:6,padding:"2px 6px",fontFamily:"monospace",letterSpacing:"0.04em"},children:n.sanitizeString(l.shortcut)})]},l.id)})]},e??"__default__")})}),D.length>0&&(0,a.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderTop:`1px solid ${m.border}`,fontSize:"0.6875rem",color:m.textMuted},children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),(0,a.jsxs)("span",{children:[(0,a.jsx)("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),(0,a.jsxs)("span",{children:[(0,a.jsx)("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}function nn({direction:e,onClick:t,isDisabled:n,primaryColor:o,position:r,orientation:i}){const l="vertical"===i,s="prev"===e,d="inside"===r?{position:"absolute",zIndex:3,...l?{[s?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[s?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};return(0,a.jsx)("button",{type:"button","aria-label":s?"Previous slide":"Next slide",disabled:n,onClick:t,style:{...d,width:36,height:36,borderRadius:"50%",border:"none",backgroundColor:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:n?"not-allowed":"pointer",opacity:n?.35:1,transition:"background 150ms ease, opacity 150ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${o}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},onMouseEnter:e=>{n||(e.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:l?s?(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"18 15 12 9 6 15"})}):(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})}):s?(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"15 18 9 12 15 6"})}):(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"9 18 15 12 9 6"})})})}function on({slides:e,autoPlay:r=!1,autoPlayInterval:i=4e3,pauseOnHover:s=!0,loop:d=!0,showArrows:c=!0,showDots:p=!0,showThumbnails:u=!1,orientation:h="horizontal",slidesToShow:f=1,gap:m=0,transitionDuration:g=400,swipeable:x=!0,initialIndex:y=0,onChange:b,arrowPosition:v="inside",height:w=320,className:k,style:S}){const C=t.useTheme(),$=o.useReducedMotion(),z=(0,l.useId)(),N=e.length,[M,I]=(0,l.useState)(y),[D,W]=(0,l.useState)(d?y+1:y),[L,R]=(0,l.useState)(!1),[T,A]=(0,l.useState)(!1),B=(0,l.useRef)(null),F=(0,l.useRef)(null),E=(0,l.useRef)(null),j=(0,l.useRef)(0),H=(0,l.useRef)(!1),P="vertical"===h,O=$?0:g,V=d&&N>1?[e[N-1],...e,e[0]]:e,K=V.length,U=100/f,Y=(e,t=0)=>{const n=0!==t?` - ${t}px`:"";return P?`translateY(calc(-${e*U}%${n}))`:`translateX(calc(-${e*U}%${n}))`},q=(0,l.useCallback)((e,t=!1)=>{const n=d?(e%N+N)%N:Math.max(0,Math.min(N-1,e)),o=d?n+1:n;t&&B.current?(B.current.style.transition="none",W(o),I(n),B.current.offsetHeight,B.current.style.transition=""):(R(!0),W(o),I(n)),b?.(n)},[N,d,b]),X=(0,l.useCallback)(()=>q(M-1),[M,q]),Z=(0,l.useCallback)(()=>q(M+1),[M,q]),_=(0,l.useCallback)(()=>{R(!1),!d||N<=1||(0===D?q(N-1,!0):D===K-1&&q(0,!0))},[d,N,D,K,q]);(0,l.useEffect)(()=>{if(!(!r||T||N<=1))return F.current=setInterval(Z,i),()=>{F.current&&clearInterval(F.current)}},[r,T,i,Z,N]),(0,l.useEffect)(()=>{const e=e=>{const t=document.activeElement;document.getElementById(z)?.contains(t)&&(e.key===(P?"ArrowUp":"ArrowLeft")&&(e.preventDefault(),X()),e.key===(P?"ArrowDown":"ArrowRight")&&(e.preventDefault(),Z()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[z,P,X,Z]);const G=e=>"touches"in e?P?e.touches[0].clientY:e.touches[0].clientX:P?e.clientY:e.clientX,J=e=>{x&&(E.current=G(e),j.current=0,H.current=!0)},Q=e=>{if(!H.current||null===E.current)return;const t=G(e)-E.current;j.current=t,B.current&&(B.current.style.transition="none",B.current.style.transform=Y(D,-t))},ee=()=>{if(!H.current)return;H.current=!1;const e=j.current;B.current&&(B.current.style.transition="",B.current.style.transform=""),e<-50?Z():e>50?X():B.current&&(B.current.style.transform=Y(D)),E.current=null,j.current=0},te="number"==typeof w?`${w}px`:w,ne={display:"flex",flexDirection:P?"column":"row",width:P?"100%":K/f*100+"%",height:P?K/f*100+"%":"100%",transform:Y(D),transition:L||!$?`transform ${O}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:m>0?m:void 0},oe={flexShrink:0,width:P?"100%":U/(K/f)+"%",height:P?U/(K/f)+"%":"100%",overflow:"hidden",position:"relative"},re=d||M>0,ie=d||M<N-1,le="outside"===v;return(0,a.jsxs)("div",{id:z,className:n.cx(n.tkx("flex flex-col gap-2"),k),style:S,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2"),style:{gap:le&&c?8:0},children:[c&&le&&(0,a.jsx)(nn,{direction:"prev",onClick:X,isDisabled:!re,primaryColor:C.primary,position:"outside",orientation:h}),(0,a.jsxs)("div",{style:{position:"relative",flex:1,overflow:"hidden",height:te,borderRadius:12,cursor:x?H.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>s&&A(!0),onMouseLeave:()=>{A(!1),ee()},onTouchStart:J,onTouchMove:Q,onTouchEnd:ee,onMouseDown:J,onMouseMove:Q,onMouseUp:ee,"aria-live":"polite","aria-atomic":"false",children:[c&&!le&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(nn,{direction:"prev",onClick:X,isDisabled:!re,primaryColor:C.primary,position:"inside",orientation:h}),(0,a.jsx)(nn,{direction:"next",onClick:Z,isDisabled:!ie,primaryColor:C.primary,position:"inside",orientation:h})]}),(0,a.jsx)("div",{ref:B,style:ne,onTransitionEnd:_,children:V.map((e,t)=>(0,a.jsx)("div",{style:oe,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(t-(d?1:0)+N)%N+1} of ${N}`,"aria-hidden":(t-(d?1:0)+N)%N!==M,children:e.content},`${e.id}-${t}`))}),p&&!u&&(0,a.jsx)("div",{"aria-label":"Slide indicators",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:2},children:e.map((e,t)=>(0,a.jsx)("button",{type:"button","aria-label":`Go to slide ${t+1}`,"aria-current":t===M?"true":void 0,onClick:()=>q(t),style:{width:t===M?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:t===M?C.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${C.primary}66`},onBlur:e=>{e.currentTarget.style.boxShadow="none"}},e.id))})]}),c&&le&&(0,a.jsx)(nn,{direction:"next",onClick:Z,isDisabled:!ie,primaryColor:C.primary,position:"outside",orientation:h})]}),u&&(0,a.jsx)("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:e.map((e,t)=>(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":t===M,"aria-label":`Thumbnail for slide ${t+1}`,onClick:()=>q(t),style:{flexShrink:0,width:60,height:42,border:`2px solid ${t===M?C.primary:C.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:C.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${C.primary}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},children:[e.thumbnail?(0,a.jsx)("img",{src:e.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):(0,a.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:C.textMuted,fontWeight:600},children:t+1}),t===M&&(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${C.primary}22`}})]},e.id))})]})}function rn({color:e}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M6 3l5 5-5 5",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ln({onClick:e,bgColor:t,hoverColor:o,textColor:r,label:i}){return(0,a.jsx)("button",{type:"button",onClick:e,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},"aria-label":i,className:n.tkx("inline-flex items-center justify-center rounded px-1.5 py-0.5","text-sm font-medium cursor-pointer border-none outline-none","focus-visible:ring-2 focus-visible:ring-offset-1"),style:{backgroundColor:t,color:r,transition:"background-color 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=o},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t},children:"…"})}function an(e,t){if(!t)return!0;const n=t.toLowerCase(),o=e.label.toLowerCase();let r=0;for(let i=0;i<o.length&&r<n.length;i++)o[i]===n[r]&&r++;return r===n.length}function sn({color:e}){return(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{animation:"spin 0.8s linear infinite",flexShrink:0},children:[(0,a.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"2",opacity:"0.3"}),(0,a.jsx)("path",{d:"M14 8a6 6 0 00-6-6",stroke:e,strokeWidth:"2",strokeLinecap:"round"})]})}function dn({expanded:e,color:t,reducedMotion:n}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:n?"none":"transform 150ms ease",flexShrink:0},children:(0,a.jsx)("path",{d:"M6 3l5 5-5 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function cn({checked:e,color:t,borderColor:o}){return(0,a.jsx)("span",{role:"presentation","aria-hidden":"true",className:n.tkx("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:o}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,a.jsx)("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}Gt.displayName="TkxOTP",tn.displayName="TkxCommand",on.displayName="TkxCarousel";var pn={sm:{buttonPx:6,buttonPy:4,fontSize:12,iconSize:14,gap:2,separatorSize:16},md:{buttonPx:8,buttonPy:6,fontSize:13,iconSize:16,gap:4,separatorSize:20},lg:{buttonPx:12,buttonPy:8,fontSize:14,iconSize:18,gap:6,separatorSize:24}};function un({color:e}){return(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"6",cy:"6",r:"4.5",stroke:e,strokeWidth:"1.5"}),(0,a.jsx)("path",{d:"M9.5 9.5L13 13",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"})]})}function hn({checked:e,primaryColor:t,borderColor:o}){return(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:o}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,a.jsx)("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function fn({color:e}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M3 8h10M9 4l4 4-4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function mn({color:e}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M13 8H3M7 4l-4 4 4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function gn({title:e,items:r,selected:i,onToggle:s,onToggleAll:d,search:c,onSearchChange:p,searchable:u,height:h,listId:f}){const m=t.useTheme(),g=o.useReducedMotion(),x=n.sanitizeString(e),y=(0,l.useMemo)(()=>{if(!c)return r;const e=c.toLowerCase();return r.filter(t=>t.label.toLowerCase().includes(e))},[r,c]),b=y.filter(e=>!e.disabled),v=b.length>0&&b.every(e=>i.has(e.value));return b.some(e=>i.has(e.value)),(0,a.jsxs)("div",{className:n.tkx("flex flex-col rounded-lg overflow-hidden flex-1 min-w-0"),style:{border:`1px solid ${m.border}`,backgroundColor:m.surface},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2 px-3 py-2 border-b"),style:{borderColor:m.border,backgroundColor:m.surfaceAlt},children:[(0,a.jsx)("button",{type:"button","aria-label":v?`Deselect all ${x}`:`Select all ${x}`,onClick:d,className:n.tkx("border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2"),children:(0,a.jsx)(hn,{checked:v,primaryColor:m.primary,borderColor:m.border})}),(0,a.jsx)("span",{className:n.tkx("text-sm font-medium flex-1 truncate"),style:{color:m.text},children:x}),(0,a.jsxs)("span",{className:n.tkx("text-xs"),style:{color:m.textMuted},children:[i.size,"/",r.length]})]}),u&&(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1.5 px-3 py-1.5 border-b"),style:{borderColor:m.border},children:[(0,a.jsx)(un,{color:m.textMuted}),(0,a.jsx)("input",{type:"text","aria-label":`Search ${x}`,value:c,onChange:e=>p(e.target.value),placeholder:"Search...",className:n.tkx("flex-1 bg-transparent border-none outline-none text-xs"),style:{color:m.text}})]}),(0,a.jsx)("ul",{id:f,role:"listbox","aria-label":x,"aria-multiselectable":"true",className:n.tkx("list-none m-0 p-1 overflow-y-auto"),style:{height:h,minHeight:100},children:0===y.length?(0,a.jsx)("li",{className:n.tkx("text-xs text-center py-4"),style:{color:m.textMuted},"aria-disabled":"true",children:"No items"}):y.map(e=>{const t=i.has(e.value),o=n.sanitizeString(e.label);return(0,a.jsxs)("li",{role:"option","aria-selected":t,"aria-disabled":e.disabled||void 0,tabIndex:0,onClick:()=>!e.disabled&&s(e.value),onKeyDown:t=>!e.disabled&&((e,t)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s(t))})(t,e.value),className:n.tkx("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",e.disabled?"opacity-50 cursor-not-allowed":""),style:{color:e.disabled?m.textMuted:m.text,backgroundColor:t?`${m.primary}10`:"transparent",transition:g?"none":"background-color 100ms ease"},onMouseEnter:n=>{e.disabled||t||(n.currentTarget.style.backgroundColor=m.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t?`${m.primary}10`:"transparent"},children:[(0,a.jsx)(hn,{checked:t,primaryColor:m.primary,borderColor:m.border}),(0,a.jsx)("span",{className:n.tkx("truncate"),children:o})]},e.value)})})]})}function xn({color:e,rotated:t,reducedMotion:n}){return(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{transform:t?"rotate(45deg)":"rotate(0deg)",transition:n?"none":"transform 200ms ease"},children:(0,a.jsx)("path",{d:"M12 5v14M5 12h14",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"})})}var yn={"bottom-right":{bottom:24,right:24},"bottom-left":{bottom:24,left:24},"top-right":{top:24,right:24},"top-left":{top:24,left:24}};function bn({open:e}){return(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",children:e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,a.jsx)("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),(0,a.jsx)("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}var vn=!1,wn=!1,kn={success:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),error:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),warning:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})},Sn={"bottom-left":{bottom:24,left:24},"bottom-center":{bottom:24,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:24,right:24},"top-center":{top:24,left:"50%",transform:"translateX(-50%)"}};function Cn({direction:e}){return(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:n.tkx("shrink-0 ml-1"),children:"asc"===e?(0,a.jsx)("path",{d:"M7 14l5-5 5 5H7z"}):"desc"===e?(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7z"}):(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.35"})})}function $n({checked:e,indeterminate:n}){const o=t.useTheme();return(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||n?o.primary:"transparent",stroke:e||n?o.primary:o.border,strokeWidth:"1.5"}),n&&(0,a.jsx)("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:o.bg,strokeWidth:"2"}),e&&!n&&(0,a.jsx)("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:o.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function zn(e,t){return"function"==typeof t?t(e):String(e[t])}function Nn(e,t){return e[t]}function Mn(e){const t=String(e??"");return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t}function In({colCount:e}){const o=t.useTheme();return(0,a.jsx)("tbody",{children:Array.from({length:5},(t,r)=>(0,a.jsx)("tr",{children:Array.from({length:e},(e,t)=>(0,a.jsx)("td",{className:n.tkx("px-3 py-2"),style:{borderBottom:`1px solid ${o.border}`},children:(0,a.jsx)(T,{height:16})},t))},r))})}function Dn({label:e,showExport:t,onExport:n,totalRows:o,selectedCount:r,theme:i}){return t||0!==r?(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8},children:[(0,a.jsx)("span",{style:{fontSize:13,color:i.textMuted},children:r>0?`${r} of ${o} row${1!==o?"s":""} selected`:`${o} row${1!==o?"s":""}`}),t&&(0,a.jsxs)("button",{onClick:n,"aria-label":`Export ${e} as CSV`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 12px",fontSize:13,fontWeight:500,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer"},children:[(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,a.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Export CSV"]})]}):null}function Wn({page:e,totalPages:t,pageSize:n,totalRows:o,onPageChange:r,theme:i}){const l=(e-1)*n+1,s=Math.min(e*n,o),d={display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer",fontSize:13,fontWeight:500};return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderTop:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8,flexWrap:"wrap"},role:"navigation","aria-label":"Pagination",children:[(0,a.jsx)("span",{style:{fontSize:13,color:i.textMuted},children:0===o?"0 rows":`${l}–${s} of ${o}`}),(0,a.jsxs)("div",{style:{display:"flex",gap:4},children:[(0,a.jsx)("button",{onClick:()=>r(1),disabled:1===e,"aria-label":"First page",style:{...d,opacity:1===e?.4:1},children:"«"}),(0,a.jsx)("button",{onClick:()=>r(e-1),disabled:1===e,"aria-label":"Previous page",style:{...d,opacity:1===e?.4:1},children:"‹"}),Array.from({length:Math.min(5,t)},(n,o)=>{let l=o+1;return t>5&&(l=Math.max(1,Math.min(e-Math.floor(2.5),t-4))+o),(0,a.jsx)("button",{onClick:()=>r(l),"aria-label":`Page ${l}`,"aria-current":l===e?"page":void 0,style:{...d,backgroundColor:l===e?i.primary:"transparent",color:l===e?i.bg:i.text,borderColor:l===e?i.primary:i.border},children:l},l)}),(0,a.jsx)("button",{onClick:()=>r(e+1),disabled:e===t,"aria-label":"Next page",style:{...d,opacity:e===t?.4:1},children:"›"}),(0,a.jsx)("button",{onClick:()=>r(t),disabled:e===t,"aria-label":"Last page",style:{...d,opacity:e===t?.4:1},children:"»"})]})]})}var Ln=!1,Rn={info:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),warning:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),success:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),danger:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})})},Tn={1:{fontSize:"1.75rem",fontWeight:700,lineHeight:1.25,marginTop:24,marginBottom:12},2:{fontSize:"1.375rem",fontWeight:600,lineHeight:1.3,marginTop:20,marginBottom:10},3:{fontSize:"1.1rem",fontWeight:600,lineHeight:1.35,marginTop:16,marginBottom:8}},An={heading:function({block:e}){const o=t.useTheme(),r=e.level??1,i=`h${r}`,l=n.sanitizeString(e.content??"");return(0,a.jsx)(i,{className:n.tkx("m-0"),style:{...Tn[r],color:o.text},children:l})},paragraph:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.content??"");return(0,a.jsx)("p",{className:n.tkx("m-0"),style:{fontSize:"0.938rem",lineHeight:1.7,color:o.text,marginBottom:12},children:r})},blockquote:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.content??"");return(0,a.jsx)("blockquote",{className:n.tkx("m-0"),style:{borderLeft:`3px solid ${o.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${o.surfaceAlt}`,borderRadius:"0 6px 6px 0",color:o.textMuted,fontStyle:"italic",fontSize:"0.938rem",lineHeight:1.6},children:r})},code:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.content??""),i=e.language?n.sanitizeString(e.language):null;return(0,a.jsxs)("div",{className:n.tkx("rounded-lg overflow-hidden"),style:{marginTop:12,marginBottom:12,border:`1px solid ${o.border}`,backgroundColor:o.surfaceAlt},children:[i&&(0,a.jsx)("div",{className:n.tkx("px-3 py-1 text-[11px] font-semibold uppercase tracking-wider"),style:{color:o.textMuted,borderBottom:`1px solid ${o.border}`,backgroundColor:o.surface},children:i}),(0,a.jsx)("pre",{className:n.tkx("m-0 p-4 overflow-x-auto"),style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",fontSize:"0.85rem",lineHeight:1.6,color:o.text,tabSize:2},children:(0,a.jsx)("code",{"aria-label":i?`Code block in ${i}`:"Code block",children:r})})]})},list:function({block:e}){const o=t.useTheme(),r=e.ordered?"ol":"ul",i=(e.items??[]).map(e=>n.sanitizeString(e));return(0,a.jsx)(r,{className:n.tkx("m-0"),style:{paddingLeft:24,marginTop:8,marginBottom:12,color:o.text,fontSize:"0.938rem",lineHeight:1.7,listStyleType:e.ordered?"decimal":"disc"},role:"list",children:i.map((e,t)=>(0,a.jsx)("li",{role:"listitem",style:{marginBottom:4},children:e},t))})},divider:function(){return(0,a.jsx)("hr",{"aria-hidden":"true",style:{border:"none",borderTop:`1px solid ${t.useTheme().border}`,marginTop:20,marginBottom:20}})},image:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.src??""),i=n.sanitizeString(e.alt??"Image");return(0,a.jsxs)("figure",{className:n.tkx("m-0"),style:{marginTop:12,marginBottom:12},children:[(0,a.jsx)("img",{src:r,alt:i,loading:"lazy",className:n.tkx("rounded-lg"),style:{maxWidth:"100%",height:"auto",display:"block",border:`1px solid ${o.border}`}}),e.alt&&(0,a.jsx)("figcaption",{className:n.tkx("text-xs mt-2 text-center"),style:{color:o.textMuted},children:i})]})},callout:function({block:e}){const o=t.useTheme(),r=e.variant??"info",i=n.sanitizeString(e.content??""),l={info:o.info,warning:o.warning,success:o.success,danger:o.danger}[r],s=Rn[r];return(0,a.jsxs)("div",{role:{info:"note",warning:"alert",success:"status",danger:"alert"}[r],className:n.tkx("flex gap-3 px-4 py-3 rounded-lg"),style:{backgroundColor:`${l}12`,border:`1px solid ${l}33`,marginTop:12,marginBottom:12},children:[(0,a.jsx)("span",{className:n.tkx("shrink-0 mt-[2px]"),style:{color:l},children:s}),(0,a.jsx)("div",{className:n.tkx("flex-1"),style:{fontSize:"0.9rem",lineHeight:1.6,color:o.text},children:i})]})}};function Bn(e){const t=[];let n=0,o="";const r=()=>{o&&(t.push({kind:"text",value:o}),o="")};for(;n<e.length;){const i=e[n];if("\\"===i&&n+1<e.length)o+=e[n+1],n+=2;else{if("!"===i&&"["===e[n+1]){const o=e.indexOf("]",n+2);if(-1!==o&&"("===e[o+1]){const i=e.indexOf(")",o+2);if(-1!==i){r(),t.push({kind:"image",alt:e.slice(n+2,o),src:e.slice(o+2,i)}),n=i+1;continue}}}if("["===i){const o=Fn(e,n,"[","]");if(-1!==o&&"("===e[o+1]){const i=e.indexOf(")",o+2);if(-1!==i){r(),t.push({kind:"link",href:e.slice(o+2,i).trim(),children:Bn(e.slice(n+1,o))}),n=i+1;continue}}}if("<"===i){const o=e.indexOf(">",n+1);if(-1!==o){const i=e.slice(n+1,o);if(/^(https?:\/\/|mailto:)/i.test(i)||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)){r();const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)?`mailto:${i}`:i;t.push({kind:"link",href:e,children:[{kind:"text",value:i}]}),n=o+1;continue}}}if("`"===i){const o=e.indexOf("`",n+1);if(-1!==o){r(),t.push({kind:"code",value:e.slice(n+1,o)}),n=o+1;continue}}if("~"===i&&"~"===e[n+1]){const o=e.indexOf("~~",n+2);if(-1!==o){r(),t.push({kind:"strike",children:Bn(e.slice(n+2,o))}),n=o+2;continue}}if("*"===i&&"*"===e[n+1]||"_"===i&&"_"===e[n+1]){const o=i+i,l=e.indexOf(o,n+2);if(-1!==l){r(),t.push({kind:"bold",children:Bn(e.slice(n+2,l))}),n=l+2;continue}}if(("*"===i||"_"===i)&&e[n+1]!==i){const o=e.indexOf(i,n+1);if(-1!==o&&e.slice(n+1,o).trim().length>0){r(),t.push({kind:"italic",children:Bn(e.slice(n+1,o))}),n=o+1;continue}}o+=i,n++}}return r(),t}function Fn(e,t,n,o){let r=0;for(let i=t;i<e.length;i++)if("\\"!==e[i]){if(e[i]===n)r++;else if(e[i]===o&&(r--,0===r))return i}else i++;return-1}function En(e){const t=e.replace(/^\uFEFF/,"").replace(/\r\n?/g,"\n").split("\n"),n=[];let o=0;for(;o<t.length;){const e=t[o];if(/^\s*$/.test(e)){o++;continue}const r=e.match(/^\s*```(.*)$/);if(r){const e=r[1].trim();o++;const i=[];for(;o<t.length&&!/^\s*```\s*$/.test(t[o]);)i.push(t[o]),o++;o<t.length&&o++,n.push({kind:"code",language:e,value:i.join("\n")});continue}const i=e.match(/^(#{1,6})\s+(.*?)\s*#*\s*$/);if(i){n.push({kind:"heading",level:i[1].length,inline:Bn(i[2])}),o++;continue}if(/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(e)){n.push({kind:"hr"}),o++;continue}if(Pn(e)&&o+1<t.length&&On(t[o+1])){const r=Vn(e).map(Bn),i=Kn(t[o+1]);o+=2;const l=[];for(;o<t.length&&Pn(t[o]);)l.push(Vn(t[o]).map(Bn)),o++;n.push({kind:"table",headers:r,rows:l,align:i});continue}if(/^\s*>/.test(e)){const e=[];for(;o<t.length&&/^\s*>/.test(t[o]);)e.push(t[o].replace(/^\s*>\s?/,"")),o++;n.push({kind:"blockquote",children:En(e.join("\n"))});continue}if(jn(e)){const[e,r]=Hn(t,o);n.push(e),o=r;continue}const l=[e];for(o++;o<t.length&&!/^\s*$/.test(t[o])&&!/^#{1,6}\s/.test(t[o])&&!/^\s*```/.test(t[o])&&!/^\s*>/.test(t[o])&&!jn(t[o])&&!/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(t[o]);)l.push(t[o]),o++;n.push({kind:"paragraph",inline:Bn(l.join(" "))})}return n}function jn(e){return/^(\s*)([-*+]|\d+[.)])\s+/.test(e)}function Hn(e,t){const n=e[t].match(/^(\s*)([-*+]|\d+[.)])\s+/),o=n[1].length,r=/\d/.test(n[2]),i=[];let l=t;for(;l<e.length;){const t=e[l].match(/^(\s*)([-*+]|\d+[.)])\s+(.*)$/);if(!t||t[1].length!==o)break;const n=t[3];let r=null,a=n;const s=n.match(/^\[([ xX])\]\s+(.*)$/);s&&(r="x"===s[1].toLowerCase()?"checked":"unchecked",a=s[2]);const d=[a];for(l++;l<e.length;){if(/^\s*$/.test(e[l])){if(l+1<e.length&&/^\s+\S/.test(e[l+1])){d.push(""),l++;continue}break}const t=e[l].match(/^(\s*)(\S)/);if(!(t&&t[1].length>o))break;d.push(e[l].slice(o+2)),l++}i.push({blocks:En(d.join("\n")),task:r})}return[{kind:"list",ordered:r,items:i},l]}function Pn(e){return/^\s*\|.+\|\s*$/.test(e.trim())||e.includes("|")&&e.trim().startsWith("|")}function On(e){return/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e)}function Vn(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim())}function Kn(e){return Vn(e).map(e=>{const t=e.startsWith(":"),n=e.endsWith(":");return t&&n?"center":n?"right":t?"left":null})}function Un(e,t,o="i"){return e.map((e,r)=>{const i=`${o}-${r}`;switch(e.kind){case"text":return(0,a.jsx)("span",{children:n.sanitizeString(e.value)},i);case"bold":return(0,a.jsx)("strong",{children:Un(e.children,t,i)},i);case"italic":return(0,a.jsx)("em",{children:Un(e.children,t,i)},i);case"strike":return(0,a.jsx)("s",{children:Un(e.children,t,i)},i);case"code":return(0,a.jsx)("code",{style:{background:t.theme.surfaceAlt,border:`1px solid ${t.theme.border}`,borderRadius:4,padding:"0.15em 0.4em",fontSize:"0.9em",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",wordBreak:"break-word"},children:n.sanitizeString(e.value)},i);case"link":{const n=Yn(e.href);if(!n)return(0,a.jsx)("span",{children:Un(e.children,t,i)},i);const o=/^(https?:)?\/\//i.test(n)||n.startsWith("mailto:");return(0,a.jsx)("a",{href:n,target:o?t.externalLinkTarget:void 0,rel:o?t.externalLinkRel:void 0,onClick:e=>{!1===t.onLinkClick?.(n,e)&&e.preventDefault()},style:{color:t.theme.primary,textDecoration:"underline",wordBreak:"break-word"},children:Un(e.children,t,i)},i)}case"image":return(0,a.jsx)("img",{src:Yn(e.src)||"",alt:n.sanitizeString(e.alt),loading:"lazy",decoding:"async",style:{maxWidth:"100%",height:"auto",borderRadius:6,display:"inline-block"}},i)}})}function Yn(e){const t=e.trim();return t?/^javascript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)||/^vbscript:/i.test(t)?null:t:null}function qn({text:e,theme:t}){const[n,o]=(0,l.useState)(!1);return(0,a.jsx)("button",{type:"button",onClick:()=>{"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})},"aria-label":n?"Copied to clipboard":"Copy code",style:{position:"absolute",top:6,right:6,padding:"2px 8px",fontSize:11,background:t.surface,color:n?t.success:t.textMuted,border:`1px solid ${t.border}`,borderRadius:4,cursor:"pointer",fontFamily:"inherit",transition:"color 120ms"},children:n?"Copied":"Copy"})}function Xn(e,t,o="b"){return e.map((e,r)=>{const i=`${o}-${r}`;switch(e.kind){case"heading":{const n=`h${e.level}`,o={1:{fs:t.compact?"1.75rem":"2rem",lh:"1.2",mt:"0.6em",mb:"0.5em",fw:700},2:{fs:t.compact?"1.4rem":"1.6rem",lh:"1.25",mt:"1em",mb:"0.5em",fw:700},3:{fs:t.compact?"1.2rem":"1.3rem",lh:"1.3",mt:"1em",mb:"0.4em",fw:600},4:{fs:"1.1rem",lh:"1.35",mt:"1em",mb:"0.4em",fw:600},5:{fs:"1rem",lh:"1.4",mt:"1em",mb:"0.3em",fw:600},6:{fs:"0.9rem",lh:"1.4",mt:"1em",mb:"0.3em",fw:600}}[e.level];return(0,a.jsx)(n,{style:{fontSize:o.fs,lineHeight:o.lh,marginTop:o.mt,marginBottom:o.mb,fontWeight:o.fw,color:t.theme.text,scrollMarginTop:"1em"},children:Un(e.inline,t,i)},i)}case"paragraph":return(0,a.jsx)("p",{style:{margin:"0 0 "+(t.compact?"0.7em":"1em"),lineHeight:1.65,color:t.theme.text,wordBreak:"break-word"},children:Un(e.inline,t,i)},i);case"blockquote":return(0,a.jsx)("blockquote",{style:{margin:"0 0 1em",padding:"0.5em 1em",borderLeft:`4px solid ${t.theme.primary}`,background:`${t.theme.surfaceAlt}`,color:t.theme.textMuted,borderRadius:"0 6px 6px 0"},children:Xn(e.children,t,i)},i);case"code":{const o=e.value;return(0,a.jsxs)("div",{style:{position:"relative",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:8,background:t.theme.surfaceAlt,overflow:"hidden"},children:[e.language&&(0,a.jsx)("div",{style:{padding:"4px 10px",fontSize:11,color:t.theme.textMuted,borderBottom:`1px solid ${t.theme.border}`,textTransform:"uppercase",letterSpacing:"0.05em"},children:n.sanitizeString(e.language)}),t.copyableCode&&(0,a.jsx)(qn,{text:o,theme:t.theme}),(0,a.jsx)("pre",{style:{margin:0,padding:12,overflowX:"auto",fontSize:13,lineHeight:1.55,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",color:t.theme.text,whiteSpace:"pre"},children:(0,a.jsx)("code",{children:n.sanitizeString(o)})})]},i)}case"list":return(0,a.jsx)(e.ordered?"ol":"ul",{style:{margin:"0 0 1em",paddingLeft:"1.5em",color:t.theme.text,lineHeight:1.65},children:e.items.map((e,n)=>(0,a.jsxs)("li",{style:{listStyle:null!==e.task?"none":void 0,marginLeft:null!==e.task?"-1.25em":void 0},children:[null!==e.task&&(0,a.jsx)("input",{type:"checkbox",disabled:!0,checked:"checked"===e.task,readOnly:!0,style:{marginRight:6,verticalAlign:"middle"},"aria-label":"checked"===e.task?"Completed task":"Uncompleted task"}),Xn(e.blocks,t,`${i}-${n}`)]},`${i}-${n}`))},i);case"hr":return(0,a.jsx)("hr",{style:{border:"none",borderTop:`1px solid ${t.theme.border}`,margin:"1.5em 0"}},i);case"table":return(0,a.jsx)("div",{style:{overflowX:"auto",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:6,WebkitOverflowScrolling:"touch"},children:(0,a.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14,color:t.theme.text},children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers.map((n,o)=>(0,a.jsx)("th",{style:{padding:"8px 12px",textAlign:e.align[o]??"left",borderBottom:`2px solid ${t.theme.border}`,background:t.theme.surfaceAlt,fontWeight:600},children:Un(n,t,`${i}-h-${o}`)},o))})}),(0,a.jsx)("tbody",{children:e.rows.map((n,o)=>(0,a.jsx)("tr",{children:n.map((n,r)=>(0,a.jsx)("td",{style:{padding:"8px 12px",textAlign:e.align[r]??"left",borderBottom:`1px solid ${t.theme.border}`},children:Un(n,t,`${i}-r-${o}-${r}`)},r))},o))})]})},i)}})}function Zn({source:e,src:o,maxWidth:r="100%",compact:i=!1,copyableCode:s=!0,onLinkClick:d,externalLinkRel:c="noopener noreferrer",externalLinkTarget:p="_blank",loadingFallback:u,errorFallback:h,className:f,style:m}){const g=t.useTheme(),[x,y]=(0,l.useState)({text:null,error:null,loading:!!o&&void 0===e}),b=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(void 0!==e||!o)return;b.current?.abort();const t=new AbortController;return b.current=t,y({text:null,error:null,loading:!0}),fetch(o,{signal:t.signal}).then(async e=>{if(!e.ok)throw new Error(`Failed to load markdown (HTTP ${e.status})`);y({text:await e.text(),error:null,loading:!1})}).catch(e=>{"AbortError"!==e.name&&y({text:null,error:e.message,loading:!1})}),()=>t.abort()},[o,e]);const v=e??x.text??"",w=(0,l.useMemo)(()=>v?En(v):[],[v]),k={theme:g,compact:i,copyableCode:s,externalLinkRel:c,externalLinkTarget:p,onLinkClick:d},S={maxWidth:r,width:"100%",color:g.text,fontFamily:"inherit",fontSize:i?14:15,lineHeight:1.65,wordBreak:"break-word",overflowWrap:"anywhere",boxSizing:"border-box",...m};if(void 0===e&&o){if(x.loading)return(0,a.jsx)("div",{className:f,style:S,"aria-busy":"true","aria-live":"polite",children:u??(0,a.jsx)("span",{style:{color:g.textMuted},children:"Loading…"})});if(x.error)return(0,a.jsx)("div",{className:f,style:S,role:"alert",children:h?h(x.error):(0,a.jsx)("span",{style:{color:g.danger},children:n.sanitizeString(x.error)})})}return(0,a.jsx)("div",{className:f,style:S,children:Xn(w,k)})}Zn.displayName="TkxMarkdown";var _n={sm:576,md:768,lg:992,xl:1200};function Gn(e){return"number"==typeof e?`${e}px`:e}var Jn=(0,l.createContext)({h:0,v:0}),Qn=(0,l.forwardRef)(({children:e,hasSider:o=!1,className:r,style:i,...l},s)=>{const d=t.useTheme(),c=n.tkx("flex min-h-0 w-full font-sans"),p=o?{flexDirection:"row"}:{flexDirection:"column"};return(0,a.jsx)("section",{ref:s,className:n.cx("tkx-layout",c,r),style:{minHeight:"100%",color:d.text,backgroundColor:d.bg,...p,...i},...l,children:e})});Qn.displayName="TkxLayout";var eo=(0,l.forwardRef)(({children:e,height:o=64,fixed:r=!1,className:i,style:l,...s},d)=>{const c=t.useTheme(),p=Gn(o),u=n.tkx("flex items-center px-6 shrink-0 w-full"),h=r?{position:"fixed",top:0,left:0,right:0,zIndex:1e3}:{};return(0,a.jsx)("header",{ref:d,className:n.cx("tkx-layout-header",u,i),style:{height:p,minHeight:p,backgroundColor:c.surface,borderBottom:`1px solid ${c.border}`,...h,...l},...s,children:e})});function to({collapsed:e,onClick:t,color:r}){const i=o.useReducedMotion();return(0,a.jsx)("button",{type:"button","aria-label":e?"Expand sidebar":"Collapse sidebar",onClick:t,className:n.tkx("flex items-center justify-center w-full py-3 cursor-pointer","border-0 bg-transparent"),style:{color:r},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{transform:e?"rotate(0deg)":"rotate(180deg)",transition:i?"none":"transform 200ms ease"},"aria-hidden":"true",children:(0,a.jsx)("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}eo.displayName="TkxHeader";var no=(0,l.forwardRef)(({children:e,width:r=240,collapsedWidth:i=64,collapsed:s,onCollapse:d,collapsible:c=!1,breakpoint:p,trigger:u,className:h,style:f,...m},g)=>{const x=t.useTheme(),y=o.useReducedMotion(),[b,v]=(0,l.useState)(!1),w=s??b,k=(0,l.useCallback)(e=>{void 0===s&&v(e),d?.(e)},[s,d]);(0,l.useEffect)(()=>{if(!p)return;const e=_n[p];if(!e)return;const t=window.matchMedia(`(max-width: ${e-1}px)`),n=e=>{k(e.matches)};return k(t.matches),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[p,k]);const S=Gn(r),C=w?`${i}px`:S,$=c&&null!==u,z=y?"none":"width 200ms ease, min-width 200ms ease, max-width 200ms ease";return(0,a.jsxs)("aside",{ref:g,className:n.cx("tkx-layout-sider",n.tkx("shrink-0 overflow-hidden flex flex-col"),h),style:{width:C,minWidth:C,maxWidth:C,backgroundColor:x.surface,borderRight:`1px solid ${x.border}`,transition:z,...f},...m,children:[(0,a.jsx)("div",{className:n.tkx("flex-1 overflow-y-auto overflow-x-hidden"),style:{width:C,transition:z},children:e}),$&&(0,a.jsx)("div",{className:n.tkx("shrink-0"),style:{borderTop:`1px solid ${x.border}`},children:void 0!==u?u:(0,a.jsx)(to,{collapsed:w,onClick:()=>k(!w),color:x.textMuted})})]})});no.displayName="TkxSider";var oo=(0,l.forwardRef)(({children:e,className:o,style:r,...i},l)=>{const s=t.useTheme();return(0,a.jsx)("main",{ref:l,className:n.cx("tkx-layout-content",n.tkx("flex-1 min-w-0 min-h-0"),o),style:{backgroundColor:s.bg,padding:"24px",...r},...i,children:e})});oo.displayName="TkxContent";var ro=(0,l.forwardRef)(({children:e,className:o,style:r,...i},l)=>{const s=t.useTheme();return(0,a.jsx)("footer",{ref:l,className:n.cx("tkx-layout-footer",n.tkx("flex items-center px-6 py-4 shrink-0"),o),style:{backgroundColor:s.surface,borderTop:`1px solid ${s.border}`,color:s.textMuted,...r},...i,children:e})});ro.displayName="TkxFooter";var io={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},lo={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},ao=(0,l.forwardRef)(({children:e,gutter:t,justify:o="start",align:r="top",wrap:i=!0,className:l,style:s,...d},c)=>{const[p,u]=Array.isArray(t)?t:[t??0,0],h=p/2,f=u/2,m=p||u?{marginLeft:-h,marginRight:-h,marginTop:-f,marginBottom:-f}:{},g={h,v:f};return(0,a.jsx)(Jn.Provider,{value:g,children:(0,a.jsx)("div",{ref:c,className:n.cx("tkx-row",n.tkx("flex w-full"),l),style:{flexWrap:i?"wrap":"nowrap",justifyContent:io[o]??"flex-start",alignItems:lo[r]??"flex-start",...m,...s},...d,children:e})})});ao.displayName="TkxRow";var so=!1;function co(e){if(void 0!==e)return"number"==typeof e?{span:e}:e}var po=(0,l.forwardRef)(({children:e,span:t,offset:o=0,push:r,pull:i,order:s,sm:d,md:c,lg:p,xl:u,className:h,style:f,...m},g)=>{(0,l.useEffect)(()=>{!function(){if(so||"undefined"==typeof document)return;so=!0;const e=[];for(const[n,o]of Object.entries(_n)){for(let t=1;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-${t} { flex: 0 0 ${r} !important; max-width: ${r} !important; } }`)}for(let t=0;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-offset-${t} { margin-left: ${r} !important; } }`)}}const t=document.createElement("style");t.id="tkx-col-responsive",t.textContent=e.join("\n"),document.head.appendChild(t)}()},[]);const x=(0,l.useContext)(Jn),y=void 0!==t?t/24*100+"%":void 0,b=o?o/24*100+"%":void 0,v=[],w=[["sm",d],["md",c],["lg",p],["xl",u]];for(const[n,l]of w){const e=co(l);e&&(v.push(`tkx-col-${n}-${e.span}`),void 0!==e.offset&&e.offset>0&&v.push(`tkx-col-${n}-offset-${e.offset}`))}const k={};return void 0!==r&&(k.left=r/24*100+"%",k.position="relative"),void 0!==i&&(k.right=i/24*100+"%",k.position="relative"),void 0!==s&&(k.order=s),(0,a.jsx)("div",{ref:g,className:n.cx("tkx-col",n.tkx("box-border min-h-[1px]"),...v,h),style:{flex:y?`0 0 ${y}`:"1",maxWidth:y??"100%",marginLeft:b,paddingLeft:x.h||void 0,paddingRight:x.h||void 0,paddingTop:x.v||void 0,paddingBottom:x.v||void 0,...k,...f},...m,children:e})});po.displayName="TkxCol";var uo=(0,l.createContext)({locale:"en-US",direction:"ltr",componentDefaults:{size:"md",variant:"default",animation:!0,bordered:!0},componentOverrides:{},prefixCls:"tkx",configured:!1,cls:e=>`tkx-${e}`,getSize:()=>"md",getAnimation:()=>!0,getBordered:()=>!0});function ho({children:e,locale:t,direction:n,componentDefaults:o,componentOverrides:r,prefixCls:i}){const s=(0,l.useContext)(uo),d=(0,l.useMemo)(()=>({size:o?.size??s.componentDefaults.size,variant:o?.variant??s.componentDefaults.variant,animation:o?.animation??s.componentDefaults.animation,bordered:o?.bordered??s.componentDefaults.bordered}),[o,s.componentDefaults]),c=(0,l.useMemo)(()=>{const e=s.componentOverrides,t=r??{};return{button:{...e.button,...t.button},input:{...e.input,...t.input},table:{...e.table,...t.table},modal:{...e.modal,...t.modal}}},[r,s.componentOverrides]),p=t??s.locale,u=n??s.direction,h=i??s.prefixCls,f=(0,l.useCallback)(e=>`${h}-${e}`,[h]),m=(0,l.useCallback)((e,t)=>{if(void 0!==t)return t;if(e){const t=c[e];if(t?.size)return t.size}return d.size},[d.size,c]),g=(0,l.useCallback)(e=>void 0!==e?e:d.animation,[d.animation]),x=(0,l.useCallback)((e,t)=>{if(void 0!==t)return t;if(e){const t=c[e];if(void 0!==t?.bordered)return t.bordered}return d.bordered},[d.bordered,c]),y=(0,l.useMemo)(()=>({locale:p,direction:u,componentDefaults:d,componentOverrides:c,prefixCls:h,configured:!0,cls:f,getSize:m,getAnimation:g,getBordered:x}),[p,u,d,c,h,f,m,g,x]);return(0,a.jsx)(uo.Provider,{value:y,children:(0,a.jsx)("div",{dir:u,lang:p,className:`${h}-config-root`,style:{direction:u},children:e})})}function fo(){return(0,l.useContext)(uo)}ho.displayName="TkxConfigProvider";var mo={"en-US":"English (US)","en-GB":"English (UK)","es-ES":"Spanish","fr-FR":"French","de-DE":"German","ja-JP":"Japanese","ko-KR":"Korean","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)","pt-BR":"Portuguese (Brazil)","ar-SA":"Arabic","hi-IN":"Hindi","ru-RU":"Russian","it-IT":"Italian","nl-NL":"Dutch","sv-SE":"Swedish","pl-PL":"Polish","tr-TR":"Turkish","th-TH":"Thai","vi-VN":"Vietnamese"},go=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function xo(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(xo).join(""):e&&"object"==typeof e&&"props"in e?xo(e.props.children):""}function yo({text:e}){const n=t.useTheme(),[o,r]=(0,l.useState)(!1);return(0,l.createElement)("button",{type:"button",onClick:(0,l.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})},[e]),"aria-label":o?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:o?n.success:n.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},o?"Copied!":"⎘")}function bo(e="default"){const n=t.useTheme();return{default:n.text,secondary:n.textMuted,success:n.success,warning:n.warning,danger:n.danger}[e]}var vo={1:{fontSize:"2.25rem",lineHeight:"1.2",fontWeight:700},2:{fontSize:"1.875rem",lineHeight:"1.25",fontWeight:700},3:{fontSize:"1.5rem",lineHeight:"1.3",fontWeight:600},4:{fontSize:"1.25rem",lineHeight:"1.35",fontWeight:600},5:{fontSize:"1rem",lineHeight:"1.4",fontWeight:600}},wo={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}},ko=!1;function So({size:e,color:t}){return(0,l.createElement)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},(0,l.createElement)("circle",{cx:12,cy:12,r:10,stroke:`${t}33`,strokeWidth:2.5,fill:"none"}),(0,l.createElement)("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:t,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function Co({size:e,borderWidth:t,color:n,reducedMotion:o}){return o?(0,l.createElement)(So,{size:e,color:n}):(function(){if(ko||"undefined"==typeof document)return;ko=!0;const e=document.createElement("style");e.id="tkx-spin-styles",e.textContent="\n @keyframes tkx-spin-rotate {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",document.head.appendChild(e)}(),(0,l.createElement)("div",{role:"img","aria-label":"Loading",style:{width:`${e}px`,height:`${e}px`,border:`${t}px solid ${n}33`,borderTopColor:n,borderRadius:"50%",animation:"tkx-spin-rotate 0.8s linear infinite",boxSizing:"border-box"}}))}function $o({color:e,mutedColor:t}){return(0,l.createElement)("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},(0,l.createElement)("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${t}18`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),(0,l.createElement)("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${t}10`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),(0,l.createElement)("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${t}0d`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),(0,l.createElement)("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),(0,l.createElement)("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function zo({mutedColor:e}){return(0,l.createElement)("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},(0,l.createElement)("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),(0,l.createElement)("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),(0,l.createElement)("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),(0,l.createElement)("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),(0,l.createElement)("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),(0,l.createElement)("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function No({direction:e,color:t}){return(0,l.createElement)("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},(0,l.createElement)("path",{d:"up"===e?"M6 10 L10 4 L14 10":"M6 4 L10 10 L14 4",stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))}var Mo=!1;function Io({w:e,h:t,alt:n,bdr:o,rm:r}){return r||function(){if(Mo||"undefined"==typeof document)return;Mo=!0;const e=document.createElement("style");e.id="tkx-statistic-skeleton",e.textContent="@keyframes tkx-stat-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}",document.head.appendChild(e)}(),(0,l.createElement)("div",{"aria-hidden":"true",style:{width:e,height:t,borderRadius:"4px",background:r?n:`linear-gradient(90deg, ${n} 25%, ${o} 50%, ${n} 75%)`,backgroundSize:"200% 100%",animation:r?"none":"tkx-stat-shimmer 1.5s ease-in-out infinite"}})}var Do={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}},Wo={L:.38,M:.42,Q:.48,H:.55},Lo={success:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M22 37l9 9 19-19",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),error:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M26 26l20 20M46 26L26 46",stroke:e,strokeWidth:"4",strokeLinecap:"round"})]}),warning:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M36 6L4 64h64L36 6z",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M36 30v16",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:"36",cy:"54",r:"2.5",fill:e})]}),info:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M36 32v18",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:"36",cy:"22",r:"2.5",fill:e})]}),404:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"404"})]}),403:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M28 30h16v16H28z",stroke:e,strokeWidth:"3",fill:"none"}),(0,a.jsx)("path",{d:"M32 30v-4a4 4 0 018 0v4",stroke:e,strokeWidth:"3",fill:"none"})]}),500:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"500"})]})};function Ro(){if("undefined"==typeof window)return!1;const e=window.outerWidth-window.innerWidth,t=window.outerHeight-window.innerHeight;return e>160||t>160}function To(){const[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if("undefined"==typeof window)return;t(Ro());const e=()=>t(Ro());window.addEventListener("resize",e);const n=window.setInterval(e,1e3);return()=>{window.removeEventListener("resize",e),window.clearInterval(n)}},[]),e}function Ao(e){if(e)try{return e()}catch{return window}return window}function Bo(e){const t=[];for(const n of e)t.push(n),n.children&&t.push(...Bo(n.children));return t}function Fo(e){return e.startsWith("#")?e.slice(1):e}function Eo({item:e,activeKey:t,depth:o,onClick:r,theme:i,reducedMotion:l}){const s=e.key===t,d=n.sanitizeString(e.title);return(0,a.jsxs)("li",{role:"none",style:{listStyle:"none"},children:[(0,a.jsx)("a",{role:"treeitem","aria-current":s?"location":void 0,href:e.href,onClick:t=>{t.preventDefault(),r(e.href)},className:n.tkx("block text-sm py-1 no-underline"),style:{paddingLeft:12+16*o,color:s?i.primary:i.textMuted,fontWeight:s?600:400,borderLeft:`2px solid ${s?i.primary:"transparent"}`,transition:l?"none":"color 0.15s ease, border-color 0.15s ease"},children:d}),e.children&&e.children.length>0&&(0,a.jsx)("ul",{role:"group",style:{margin:0,padding:0},children:e.children.map(e=>(0,a.jsx)(Eo,{item:e,activeKey:t,depth:o+1,onClick:r,theme:i,reducedMotion:l},e.key))})]})}function jo(e,t){const n=[];let o=e;for(const r of t){const e=o.find(e=>e.value===r);if(!e)break;n.push(e),o=e.children??[]}return n}var Ho={sm:"8px 12px",md:"12px 16px",lg:"16px 20px"};function Po({theme:e,reducedMotion:t}){return(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[(0,a.jsx)("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),(0,a.jsxs)("div",{className:n.tkx("flex-1"),children:[(0,a.jsx)("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),(0,a.jsx)("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}})]})]})}var Oo={turnstile:"https://challenges.cloudflare.com/turnstile/v0/api.js",hcaptcha:"https://js.hcaptcha.com/1/api.js",recaptcha:"https://www.google.com/recaptcha/api.js"},Vo={turnstile:"turnstile",hcaptcha:"hcaptcha",recaptcha:"grecaptcha"},Ko=/^[A-Za-z0-9_-]{20,80}$/,Uo={},Yo=(0,l.forwardRef)(function({provider:e="turnstile",sitekey:t,theme:n="auto",size:o="normal",language:r,execution:i="render",onVerify:s,onExpire:d,onError:c,className:p,style:u,testMode:h=!1},f){const m=(0,l.useRef)(null),g=(0,l.useRef)(null),x=(0,l.useRef)(null);return"string"!=typeof t||Ko.test(t),(0,l.useImperativeHandle)(f,()=>({reset:()=>{if(h)return void(x.current=null);const t=window[Vo[e]];if(t&&null!=g.current){try{t.reset?.(g.current)}catch{}x.current=null}},execute:()=>{if(h)return void setTimeout(()=>{x.current="TEST_TOKEN",s("TEST_TOKEN")},200);const t=window[Vo[e]];if(t&&null!=g.current)try{t.execute?.(g.current)}catch{}},getResponse:()=>x.current}),[e,s,h]),(0,l.useEffect)(()=>{if(h){const e=window.setTimeout(()=>{x.current="TEST_TOKEN",s("TEST_TOKEN")},200);return()=>window.clearTimeout(e)}let l=!1,a=null;const p=m.current;if(p)return function(e,t){if("undefined"==typeof window)return Promise.resolve();if(window[Vo[e]])return Promise.resolve();if(Uo[e])return Uo[e];const n=new Promise((n,o)=>{const r=document.querySelector(`script[data-tkx-captcha="${e}"]`);if(r)return r.addEventListener("load",()=>n()),void r.addEventListener("error",()=>o(new Error("script-load-failed")));const i=document.createElement("script");let l=Oo[e];t&&"turnstile"!==e&&(l+=`?hl=${encodeURIComponent(t)}`),i.src=l,i.async=!0,i.defer=!0,i.dataset.tkxCaptcha=e,i.addEventListener("load",()=>n()),i.addEventListener("error",()=>o(new Error("script-load-failed"))),document.head.appendChild(i)});return Uo[e]=n,n}(e,r).then(()=>{if(l||!p)return;const u=window[Vo[e]];if(!u)return;const h={callback:e=>{x.current=e,s(e)},"expired-callback":()=>{x.current=null,d?.()},"error-callback":e=>{x.current=null,c?.("string"==typeof e?e:"unknown")}};try{"turnstile"===e?a=u.render(p,{sitekey:t,theme:n,size:"flexible"===o?"flexible":"compact"===o?"compact":"normal",execution:i,language:r||"auto",...h}):"hcaptcha"===e?a=u.render(p,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"compact"===o?"compact":"normal",...h}):"recaptcha"===e&&(a=u.render(p,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"normal",...h})),g.current=a}catch(f){c?.(f?.message||"render-failed")}}).catch(()=>{l||c?.("script-load-failed")}),()=>{l=!0;const t=window[Vo[e]];if(t&&null!=a)try{t.remove?.(a)}catch{}g.current=null,x.current=null}},[]),(0,a.jsx)("div",{ref:m,className:p,style:u,"data-tkx-captcha-provider":e,children:h&&(0,a.jsx)("div",{"aria-live":"polite",style:{padding:"12px 16px",border:"1px dashed currentColor",borderRadius:8,fontSize:13,opacity:.7,display:"inline-block"},children:"[TkxCaptcha test mode — auto-verifying with TEST_TOKEN]"})})});Yo.displayName="TkxCaptcha";var qo={latin:{id:"tkx-font-latin",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap"},"latin-ext":{id:"tkx-font-latin-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=latin-ext"},devanagari:{id:"tkx-font-devanagari",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap"},tamil:{id:"tkx-font-tamil",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil:wght@400;500;600;700&display=swap"},telugu:{id:"tkx-font-telugu",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Telugu:wght@400;500;600;700&display=swap"},kannada:{id:"tkx-font-kannada",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Kannada:wght@400;500;600;700&display=swap"},malayalam:{id:"tkx-font-malayalam",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Malayalam:wght@400;500;600;700&display=swap"},bengali:{id:"tkx-font-bengali",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap"},gujarati:{id:"tkx-font-gujarati",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Gujarati:wght@400;500;600;700&display=swap"},gurmukhi:{id:"tkx-font-gurmukhi",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Gurmukhi:wght@400;500;600;700&display=swap"},oriya:{id:"tkx-font-oriya",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Oriya:wght@400;500;600;700&display=swap"},sinhala:{id:"tkx-font-sinhala",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:wght@400;500;600;700&display=swap"},arabic:{id:"tkx-font-arabic",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap"},hebrew:{id:"tkx-font-hebrew",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew:wght@400;500;600;700&display=swap"},thai:{id:"tkx-font-thai",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700&display=swap"},vietnamese:{id:"tkx-font-vietnamese",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=vietnamese"},cyrillic:{id:"tkx-font-cyrillic",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=cyrillic"},"cyrillic-ext":{id:"tkx-font-cyrillic-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=cyrillic-ext"},greek:{id:"tkx-font-greek",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=greek"},"greek-ext":{id:"tkx-font-greek-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=greek-ext"},jp:{id:"tkx-font-jp",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap"},kr:{id:"tkx-font-kr",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap"},sc:{id:"tkx-font-sc",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap"},tc:{id:"tkx-font-tc",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&display=swap"}},Xo={en:["latin"],hi:["devanagari"],mr:["devanagari"],sa:["devanagari"],ne:["devanagari"],ta:["tamil"],te:["telugu"],kn:["kannada"],ml:["malayalam"],bn:["bengali"],as:["bengali"],gu:["gujarati"],pa:["gurmukhi"],or:["oriya"],si:["sinhala"],ar:["arabic"],ur:["arabic"],fa:["arabic"],he:["hebrew"],th:["thai"],vi:["vietnamese","latin"],ru:["cyrillic"],uk:["cyrillic"],bg:["cyrillic"],el:["greek"],ja:["jp"],ko:["kr"],zh:["sc"],"zh-CN":["sc"],"zh-TW":["tc"],"zh-HK":["tc"]},Zo=!1;function _o(e){if("undefined"==typeof document)return;const t=qo[e];if(!t)return;if(document.getElementById(t.id))return;const n=document.createElement("link");n.id=t.id,n.rel="stylesheet",n.href=t.href,document.head.appendChild(n)}function Go(e){return e&&(Xo[e]||Xo[e.split("-")[0]])||["latin"]}var Jo=[{iso2:"in",name:"India",dial:"91",length:10,format:"##### #####",flag:"🇮🇳"},{iso2:"us",name:"United States",dial:"1",length:10,format:"(###) ###-####",flag:"🇺🇸"},{iso2:"gb",name:"United Kingdom",dial:"44",length:[9,10],format:"#### ######",flag:"🇬🇧"},{iso2:"ca",name:"Canada",dial:"1",length:10,format:"(###) ###-####",flag:"🇨🇦"},{iso2:"au",name:"Australia",dial:"61",length:9,format:"### ### ###",flag:"🇦🇺"},{iso2:"de",name:"Germany",dial:"49",length:[10,11],format:"#### ########",flag:"🇩🇪"},{iso2:"fr",name:"France",dial:"33",length:9,format:"# ## ## ## ##",flag:"🇫🇷"},{iso2:"es",name:"Spain",dial:"34",length:9,format:"### ### ###",flag:"🇪🇸"},{iso2:"it",name:"Italy",dial:"39",length:[9,10],format:"### ### ####",flag:"🇮🇹"},{iso2:"nl",name:"Netherlands",dial:"31",length:9,format:"# #### ####",flag:"🇳🇱"},{iso2:"se",name:"Sweden",dial:"46",length:[7,9],format:"## ### ## ##",flag:"🇸🇪"},{iso2:"no",name:"Norway",dial:"47",length:8,format:"### ## ###",flag:"🇳🇴"},{iso2:"dk",name:"Denmark",dial:"45",length:8,format:"## ## ## ##",flag:"🇩🇰"},{iso2:"fi",name:"Finland",dial:"358",length:[9,10],format:"## ### ####",flag:"🇫🇮"},{iso2:"pl",name:"Poland",dial:"48",length:9,format:"### ### ###",flag:"🇵🇱"},{iso2:"ie",name:"Ireland",dial:"353",length:9,format:"## ### ####",flag:"🇮🇪"},{iso2:"pt",name:"Portugal",dial:"351",length:9,format:"### ### ###",flag:"🇵🇹"},{iso2:"ch",name:"Switzerland",dial:"41",length:9,format:"## ### ## ##",flag:"🇨🇭"},{iso2:"at",name:"Austria",dial:"43",length:[10,11],format:"### ### ####",flag:"🇦🇹"},{iso2:"be",name:"Belgium",dial:"32",length:9,format:"### ## ## ##",flag:"🇧🇪"},{iso2:"jp",name:"Japan",dial:"81",length:10,format:"## #### ####",flag:"🇯🇵"},{iso2:"kr",name:"South Korea",dial:"82",length:[9,10],format:"## #### ####",flag:"🇰🇷"},{iso2:"cn",name:"China",dial:"86",length:11,format:"### #### ####",flag:"🇨🇳"},{iso2:"hk",name:"Hong Kong",dial:"852",length:8,format:"#### ####",flag:"🇭🇰"},{iso2:"sg",name:"Singapore",dial:"65",length:8,format:"#### ####",flag:"🇸🇬"},{iso2:"my",name:"Malaysia",dial:"60",length:[9,10],format:"## ### ####",flag:"🇲🇾"},{iso2:"id",name:"Indonesia",dial:"62",length:[9,12],format:"### ### ####",flag:"🇮🇩"},{iso2:"th",name:"Thailand",dial:"66",length:9,format:"## ### ####",flag:"🇹🇭"},{iso2:"vn",name:"Vietnam",dial:"84",length:[9,10],format:"### ### ####",flag:"🇻🇳"},{iso2:"ph",name:"Philippines",dial:"63",length:10,format:"### ### ####",flag:"🇵🇭"},{iso2:"pk",name:"Pakistan",dial:"92",length:10,format:"### #######",flag:"🇵🇰"},{iso2:"bd",name:"Bangladesh",dial:"880",length:10,format:"#### ######",flag:"🇧🇩"},{iso2:"lk",name:"Sri Lanka",dial:"94",length:9,format:"## ### ####",flag:"🇱🇰"},{iso2:"np",name:"Nepal",dial:"977",length:10,format:"###-#######",flag:"🇳🇵"},{iso2:"ae",name:"UAE",dial:"971",length:9,format:"## ### ####",flag:"🇦🇪"},{iso2:"sa",name:"Saudi Arabia",dial:"966",length:9,format:"## ### ####",flag:"🇸🇦"},{iso2:"qa",name:"Qatar",dial:"974",length:8,format:"#### ####",flag:"🇶🇦"},{iso2:"kw",name:"Kuwait",dial:"965",length:8,format:"#### ####",flag:"🇰🇼"},{iso2:"om",name:"Oman",dial:"968",length:8,format:"#### ####",flag:"🇴🇲"},{iso2:"bh",name:"Bahrain",dial:"973",length:8,format:"#### ####",flag:"🇧🇭"},{iso2:"il",name:"Israel",dial:"972",length:9,format:"## ### ####",flag:"🇮🇱"},{iso2:"tr",name:"Turkey",dial:"90",length:10,format:"### ### ####",flag:"🇹🇷"},{iso2:"ru",name:"Russia",dial:"7",length:10,format:"### ### ####",flag:"🇷🇺"},{iso2:"ua",name:"Ukraine",dial:"380",length:9,format:"## ### ####",flag:"🇺🇦"},{iso2:"br",name:"Brazil",dial:"55",length:[10,11],format:"## ##### ####",flag:"🇧🇷"},{iso2:"mx",name:"Mexico",dial:"52",length:10,format:"## #### ####",flag:"🇲🇽"},{iso2:"ar",name:"Argentina",dial:"54",length:10,format:"## #### ####",flag:"🇦🇷"},{iso2:"cl",name:"Chile",dial:"56",length:9,format:"# #### ####",flag:"🇨🇱"},{iso2:"co",name:"Colombia",dial:"57",length:10,format:"### ### ####",flag:"🇨🇴"},{iso2:"pe",name:"Peru",dial:"51",length:9,format:"### ### ###",flag:"🇵🇪"},{iso2:"za",name:"South Africa",dial:"27",length:9,format:"## ### ####",flag:"🇿🇦"},{iso2:"ng",name:"Nigeria",dial:"234",length:10,format:"### ### ####",flag:"🇳🇬"},{iso2:"ke",name:"Kenya",dial:"254",length:9,format:"### ### ###",flag:"🇰🇪"},{iso2:"eg",name:"Egypt",dial:"20",length:10,format:"### ### ####",flag:"🇪🇬"},{iso2:"ma",name:"Morocco",dial:"212",length:9,format:"## ### ####",flag:"🇲🇦"},{iso2:"nz",name:"New Zealand",dial:"64",length:[8,9],format:"## ### ####",flag:"🇳🇿"}];function Qo(e){return e.replace(/\D+/g,"")}function er(e,t){if(!t)return e;let n="",o=0;for(const r of t)if("#"===r){if(o>=e.length)break;n+=e[o++]}else o<e.length&&(n+=r);return o<e.length&&(n+=e.slice(o)),n}function tr(e,t){return Array.isArray(t)?e.length>=t[0]&&e.length<=t[1]:e.length===t}function nr(e){return Array.isArray(e)?`${e[0]}–${e[1]}`:`${e}`}var or=(0,l.forwardRef)(function({defaultCountry:e="in",value:n,defaultValue:o,onChange:r,onValid:i,label:s,placeholder:d,disabled:c,required:p,id:u,name:h,extraCountries:f=[],className:m,style:g},x){const y=t.useTheme(),b=(0,l.useId)(),v=(0,l.useId)(),w=(0,l.useMemo)(()=>[...Jo,...f].sort((e,t)=>e.name.localeCompare(t.name)),[f]),k=e=>w.find(t=>t.iso2===e.toLowerCase())||w[0],S=t=>{if(!t.startsWith("+"))return{country:k(e),digits:Qo(t)};const n=Qo(t);for(const e of[4,3,2,1]){const t=n.slice(0,e),o=w.find(e=>e.dial===t);if(o)return{country:o,digits:n.slice(e)}}return{country:k(e),digits:n}},C=n?S(n):{country:k(e),digits:Qo(o||"")},[$,z]=(0,l.useState)(C.country),[N,M]=(0,l.useState)(C.digits),[I,D]=(0,l.useState)(!1),[W,L]=(0,l.useState)(""),[R,T]=(0,l.useState)(0),A=(0,l.useRef)(null),B=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(void 0===n)return;const e=S(n);z(e.country),M(e.digits)},[n]);const F=er(N,$.format),E=tr(N,$.length),j=N?`+${$.dial}${N}`:"",H=(e,t)=>{const n={raw:er(e,t.format),digits:e,e164:e?`+${t.dial}${e}`:"",country:t,valid:tr(e,t.length)};r?.(n)},P=e=>{z(e),D(!1),H(N,e),A.current?.focus()},O=(0,l.useMemo)(()=>{const e=W.trim().toLowerCase();return e?w.filter(t=>t.name.toLowerCase().includes(e)||t.iso2.includes(e)||t.dial.includes(e.replace(/^\+/,""))):w},[w,W]);(0,l.useEffect)(()=>{T(0)},[W]),(0,l.useEffect)(()=>{if(I){const e=setTimeout(()=>B.current?.focus(),0);return()=>clearTimeout(e)}},[I]);const V=d??nr($.length).replace(/\d/g,"#"),K={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...g},U={fontSize:13,fontWeight:600,color:y.text},Y={display:"flex",alignItems:"stretch",border:`1px solid ${y.border}`,borderRadius:8,background:y.surface,overflow:"visible",position:"relative"},q={display:"inline-flex",alignItems:"center",gap:6,padding:"0 10px",background:"transparent",border:"none",borderRight:`1px solid ${y.border}`,cursor:c?"not-allowed":"pointer",color:y.text,fontSize:14,minHeight:40,fontWeight:500},X={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:y.text,background:"transparent",minHeight:40,minWidth:0},Z={position:"absolute",top:"calc(100% + 4px)",left:0,right:0,maxHeight:280,overflow:"auto",background:y.surface,border:`1px solid ${y.border}`,borderRadius:8,zIndex:1e3,padding:6,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},_={width:"100%",padding:"8px 10px",border:`1px solid ${y.border}`,borderRadius:6,background:y.bg,color:y.text,fontSize:13,marginBottom:6,outline:"none"},G={fontSize:12,color:y.danger,marginTop:2};return(0,a.jsxs)("div",{className:m,style:K,onKeyDown:e=>{I&&("ArrowDown"===e.key?(e.preventDefault(),T(e=>Math.min(O.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),T(e=>Math.max(0,e-1))):"Enter"===e.key?(e.preventDefault(),O[R]&&P(O[R])):"Escape"===e.key&&(e.preventDefault(),D(!1),A.current?.focus()))},children:[s&&(0,a.jsxs)("label",{htmlFor:u||b,style:U,children:[s,p&&(0,a.jsx)("span",{style:{color:y.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),(0,a.jsxs)("div",{style:Y,children:[(0,a.jsxs)("button",{ref:A,type:"button",style:q,onClick:()=>!c&&D(e=>!e),"aria-haspopup":"listbox","aria-expanded":I,"aria-controls":v,"aria-label":`Country: ${$.name}, dial code +${$.dial}`,disabled:c,children:[(0,a.jsx)("span",{"aria-hidden":"true",style:{fontSize:18,lineHeight:1},children:$.flag}),(0,a.jsxs)("span",{"aria-hidden":"true",children:["+",$.dial]}),(0,a.jsx)("span",{"aria-hidden":"true",style:{fontSize:10,opacity:.6,marginLeft:2},children:"▾"})]}),(0,a.jsx)("input",{ref:x,id:u||b,name:h,type:"tel",inputMode:"tel",autoComplete:"tel-national",value:F,onChange:e=>{const t=Qo(e.target.value).slice(0,15);M(t),H(t,$)},onBlur:()=>{E&&i&&i({raw:F,digits:N,e164:j,country:$,valid:!0})},placeholder:V,disabled:c,required:p,"aria-invalid":N.length>0&&!E,"aria-describedby":N.length>0&&!E?`${b}-err`:void 0,style:X}),I&&!c&&(0,a.jsxs)("div",{id:v,role:"listbox","aria-label":"Select country",style:Z,children:[(0,a.jsx)("input",{ref:B,type:"text",placeholder:"Search country or dial code…",value:W,onChange:e=>L(e.target.value),style:_,"aria-label":"Filter countries"}),0===O.length&&(0,a.jsxs)("div",{style:{padding:"12px 10px",fontSize:13,color:y.textMuted},children:['No country matches "',W,'"']}),O.map((e,t)=>{return(0,a.jsxs)("div",{role:"option","aria-selected":t===R,onMouseEnter:()=>T(t),onClick:()=>P(e),style:(n=t===R,{display:"flex",alignItems:"center",gap:10,padding:"8px 10px",borderRadius:6,cursor:"pointer",background:n?y.surfaceAlt:"transparent",color:y.text,fontSize:13}),children:[(0,a.jsx)("span",{"aria-hidden":"true",style:{fontSize:16},children:e.flag}),(0,a.jsx)("span",{style:{flex:1},children:e.name}),(0,a.jsxs)("span",{style:{color:y.textMuted,fontVariantNumeric:"tabular-nums"},children:["+",e.dial]})]},e.iso2);var n})]})]}),N.length>0&&!E&&(0,a.jsxs)("div",{id:`${b}-err`,role:"alert",style:G,children:["Expected ",nr($.length)," digits for ",$.name,"."]})]})});or.displayName="TkxPhoneInput";var rr={free:null,"1:1":1,"3:4":3/4,"4:5":.8,"16:9":16/9,"4:3":4/3,"3:2":1.5},ir={drop:"Drop an image here, or",browse:"browse",rotate:"Rotate",apply:"Apply",cancel:"Cancel",brightness:"Brightness",contrast:"Contrast",aspect:"Aspect",free:"Free"},lr=(0,l.forwardRef)(function({src:e,aspectRatio:n="free",ratios:o=["free","1:1","3:4","4:5","16:9"],mimeType:r="image/png",quality:i=.92,maxOutputSize:s=2048,outputFilename:d="edited.png",onChange:c,onResult:p,onCancel:u,className:h,style:f,labels:m},g){const x={...ir,...m},y=t.useTheme(),b=(0,l.useRef)(null),v=(0,l.useRef)(null),w=(0,l.useRef)(null),k=(0,l.useRef)(null),[S,C]=(0,l.useState)(e??null),[$,z]=(0,l.useState)(null),[N,M]=(0,l.useState)(n),[I,D]=(0,l.useState)(0),[W,L]=(0,l.useState)(100),[R,T]=(0,l.useState)(100),[A,B]=(0,l.useState)({x:0,y:0,w:0,h:0}),[F,E]=(0,l.useState)(!1),j=(0,l.useRef)({mode:null,startX:0,startY:0,startCrop:{x:0,y:0,w:0,h:0}});(0,l.useEffect)(()=>{if(!S)return k.current=null,void z(null);const e=new Image;e.crossOrigin="anonymous",e.onload=()=>{k.current=e,z({w:e.naturalWidth,h:e.naturalHeight});const t=rr[N];if(t){const n=Math.min(e.naturalWidth,e.naturalHeight*t),o=n/t;B({x:(e.naturalWidth-n)/2,y:(e.naturalHeight-o)/2,w:n,h:o})}else B({x:0,y:0,w:e.naturalWidth,h:e.naturalHeight})},e.src=S},[S,N]),(0,l.useEffect)(()=>{c?.({rotation:I,brightness:W,contrast:R})},[I,W,R,c]);const H=(0,l.useCallback)(()=>{const e=v.current,t=k.current,n=$;if(!e||!t||!n)return;const o=e.getContext("2d");if(!o)return;const r=w.current,i=r?Math.min(r.clientWidth,800):600,l=I%180!=0,a=l?n.h:n.w,s=l?n.w:n.h,d=Math.min(i/a,600/s,1),c=Math.floor(a*d),p=Math.floor(s*d);e.width=c,e.height=p,o.save(),o.filter=`brightness(${W}%) contrast(${R}%)`,o.translate(c/2,p/2),o.rotate(I*Math.PI/180),o.drawImage(t,-n.w*d/2,-n.h*d/2,n.w*d,n.h*d),o.restore()},[I,W,R,$]);(0,l.useEffect)(()=>{H()},[H]),(0,l.useEffect)(()=>{const e=$;if(!e)return;const t=rr[N];t&&B(n=>{const o=n.x+n.w/2,r=n.y+n.h/2;let i=n.w,l=i/t;return l>e.h&&(l=e.h,i=l*t),i>e.w&&(i=e.w,l=i/t),{x:Math.max(0,Math.min(e.w-i,o-i/2)),y:Math.max(0,Math.min(e.h-l,r-l/2)),w:i,h:l}})},[N,$]);const P=e=>{const t=new FileReader;t.onload=()=>{"string"==typeof t.result&&(C(t.result),D(0),L(100),T(100))},t.readAsDataURL(e)},O=e=>t=>{t.preventDefault(),t.stopPropagation();const n="touches"in t?t.touches[0]:t;j.current={mode:e,startX:n.clientX,startY:n.clientY,startCrop:{...A}};const o=e=>{e.preventDefault();const t="touches"in e?e.touches[0]:e,n=t.clientX-j.current.startX,o=t.clientY-j.current.startY,r=$;if(!r)return;const i=v.current;if(!i)return;const l=n*(r.w/i.width),a=o*(r.h/i.height),s=j.current.startCrop,d=rr[N];let c={...s};if("move"===j.current.mode)c.x=Math.max(0,Math.min(r.w-s.w,s.x+l)),c.y=Math.max(0,Math.min(r.h-s.h,s.y+a));else{const e=j.current.mode;if("se"===e)c.w=Math.max(20,Math.min(r.w-s.x,s.w+l)),c.h=d?c.w/d:Math.max(20,Math.min(r.h-s.y,s.h+a));else if("sw"===e){const e=Math.max(20,s.w-l);c.x=Math.max(0,s.x+s.w-e),c.w=s.x+s.w-c.x,c.h=d?c.w/d:Math.max(20,Math.min(r.h-s.y,s.h+a))}else if("ne"===e){c.w=Math.max(20,Math.min(r.w-s.x,s.w+l));const e=d?c.w/d:Math.max(20,s.h-a);c.y=Math.max(0,s.y+s.h-e),c.h=s.y+s.h-c.y}else if("nw"===e){const e=Math.max(20,s.w-l);c.x=Math.max(0,s.x+s.w-e),c.w=s.x+s.w-c.x;const t=d?c.w/d:Math.max(20,s.h-a);c.y=Math.max(0,s.y+s.h-t),c.h=s.y+s.h-c.y}}B(c)},r=()=>{j.current.mode=null,window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",r),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",r)};window.addEventListener("mousemove",o,{passive:!1}),window.addEventListener("mouseup",r),window.addEventListener("touchmove",o,{passive:!1}),window.addEventListener("touchend",r)},V=(0,l.useCallback)(()=>new Promise(e=>{const t=k.current,n=$;if(!t||!n)return e(null);const o=document.createElement("canvas"),l=I%180!=0,a=l?A.h:A.w,c=l?A.w:A.h,p=Math.min(1,s/Math.max(a,c));o.width=Math.round(a*p),o.height=Math.round(c*p);const u=o.getContext("2d");if(!u)return e(null);u.filter=`brightness(${W}%) contrast(${R}%)`;const h=document.createElement("canvas");h.width=l?n.h:n.w,h.height=l?n.w:n.h;const f=h.getContext("2d");if(!f)return e(null);f.translate(h.width/2,h.height/2),f.rotate(I*Math.PI/180),f.drawImage(t,-n.w/2,-n.h/2,n.w,n.h),u.drawImage(h,A.x,A.y,A.w,A.h,0,0,o.width,o.height),o.toBlob(t=>{if(!t)return e(null);const n="image/jpeg"===r?"jpg":"image/webp"===r?"webp":"png",i=d.endsWith(`.${n}`)?d:d.replace(/\.\w+$/,"")+`.${n}`;e({blob:t,file:new File([t],i,{type:r,lastModified:Date.now()}),url:URL.createObjectURL(t),width:o.width,height:o.height})},r,i)}),[A,I,W,R,$,r,i,s,d]);(0,l.useImperativeHandle)(g,()=>({getResult:V,reset:()=>{if(D(0),L(100),T(100),$){const e=rr[N];if(e){const t=Math.min($.w,$.h*e),n=t/e;B({x:($.w-t)/2,y:($.h-n)/2,w:t,h:n})}else B({x:0,y:0,w:$.w,h:$.h})}},loadSource:e=>C(e)}),[V,N,$]);const K={border:`1px solid ${y.border}`,borderRadius:12,background:y.surface,padding:16,...f},U={border:`2px dashed ${F?y.primary:y.border}`,borderRadius:10,padding:48,textAlign:"center",color:y.textMuted,cursor:"pointer",transition:"border-color 0.15s",background:F?`${y.primary}10`:"transparent"},Y={padding:"8px 14px",border:`1px solid ${y.border}`,borderRadius:6,background:y.bg,color:y.text,cursor:"pointer",fontSize:13,fontWeight:600,minHeight:36},q=(0,l.useMemo)(()=>{const e=v.current,t=$;if(!e||!t)return null;const n=I%180!=0,o=n?t.h:t.w,r=n?t.w:t.h,i=e.width/o,l=e.height/r;return{left:A.x*i,top:A.y*l,width:A.w*i,height:A.h*l}},[A,$,I]);return S?(0,a.jsxs)("div",{ref:w,className:h,style:K,children:[(0,a.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12,alignItems:"center"},children:[(0,a.jsxs)("span",{style:{fontSize:13,fontWeight:600,marginRight:4},children:[x.aspect,":"]}),o.map(e=>{return(0,a.jsx)("button",{type:"button",onClick:()=>M(e),style:(t=N===e,{...Y,background:t?y.primary:y.bg,color:t?y.bg:y.text,borderColor:t?y.primary:y.border}),"aria-pressed":N===e,children:"free"===e?x.free:e},e);var t}),(0,a.jsx)("div",{style:{width:1,height:24,background:y.border,margin:"0 4px"}}),(0,a.jsxs)("button",{type:"button",onClick:()=>D(e=>(e-90+360)%360),style:Y,"aria-label":`${x.rotate} 90 degrees left`,children:["↺ ",x.rotate]}),(0,a.jsxs)("button",{type:"button",onClick:()=>D(e=>(e+90)%360),style:Y,"aria-label":`${x.rotate} 90 degrees right`,children:["↻ ",x.rotate]})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:16,marginBottom:12,flexWrap:"wrap"},children:[(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13},children:[(0,a.jsx)("span",{style:{minWidth:80},children:x.brightness}),(0,a.jsx)("input",{type:"range",min:50,max:150,value:W,onChange:e=>L(Number(e.target.value)),"aria-label":x.brightness,style:{width:140}}),(0,a.jsxs)("span",{style:{minWidth:40,color:y.textMuted,fontVariantNumeric:"tabular-nums"},children:[W,"%"]})]}),(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13},children:[(0,a.jsx)("span",{style:{minWidth:80},children:x.contrast}),(0,a.jsx)("input",{type:"range",min:50,max:150,value:R,onChange:e=>T(Number(e.target.value)),"aria-label":x.contrast,style:{width:140}}),(0,a.jsxs)("span",{style:{minWidth:40,color:y.textMuted,fontVariantNumeric:"tabular-nums"},children:[R,"%"]})]})]}),(0,a.jsxs)("div",{style:{position:"relative",display:"inline-block",maxWidth:"100%",userSelect:"none",touchAction:"none"},children:[(0,a.jsx)("canvas",{ref:v,style:{display:"block",maxWidth:"100%"}}),q&&(0,a.jsx)("div",{role:"region","aria-label":"Crop area",style:{position:"absolute",left:q.left,top:q.top,width:q.width,height:q.height,border:`2px solid ${y.primary}`,boxShadow:`0 0 0 9999px ${y.bg}aa`,cursor:"move",touchAction:"none"},onMouseDown:O("move"),onTouchStart:O("move"),tabIndex:0,onKeyDown:e=>{const t=$;if(!t)return;const n=e.shiftKey?20:5;"ArrowLeft"===e.key?B(e=>({...e,x:Math.max(0,e.x-n)})):"ArrowRight"===e.key?B(e=>({...e,x:Math.min(t.w-e.w,e.x+n)})):"ArrowUp"===e.key?B(e=>({...e,y:Math.max(0,e.y-n)})):"ArrowDown"===e.key&&B(e=>({...e,y:Math.min(t.h-e.h,e.y+n)}))},children:["nw","ne","sw","se"].map(e=>(0,a.jsx)("div",{onMouseDown:O(e),onTouchStart:O(e),style:{position:"absolute",width:14,height:14,background:y.primary,border:`2px solid ${y.bg}`,borderRadius:2,cursor:`${e}-resize`,top:e.startsWith("n")?-7:void 0,bottom:e.startsWith("s")?-7:void 0,left:e.endsWith("w")?-7:void 0,right:e.endsWith("e")?-7:void 0,touchAction:"none"},"aria-hidden":"true"},e))})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,marginTop:16,justifyContent:"flex-end"},children:[u&&(0,a.jsx)("button",{type:"button",onClick:u,style:Y,children:x.cancel}),(0,a.jsx)("button",{type:"button",onClick:async()=>{const e=await V();e&&p&&p(e)},style:{...Y,background:y.primary,color:y.bg,borderColor:y.primary},children:x.apply})]})]}):(0,a.jsx)("div",{className:h,style:K,children:(0,a.jsxs)("div",{style:U,onClick:()=>b.current?.click(),onDrop:e=>{e.preventDefault(),E(!1);const t=e.dataTransfer.files?.[0];t&&t.type.startsWith("image/")&&P(t)},onDragOver:e=>{e.preventDefault(),E(!0)},onDragLeave:()=>E(!1),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b.current?.click())},"aria-label":"Upload image to edit",children:[(0,a.jsx)("div",{style:{fontSize:14,marginBottom:6},children:x.drop}),(0,a.jsx)("button",{type:"button",style:{...Y,color:y.primary,borderColor:y.primary},children:x.browse}),(0,a.jsx)("input",{ref:b,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>{const t=e.target.files?.[0];t&&P(t)}})]})})});lr.displayName="TkxImageEditor";var ar={razorpay:"https://checkout.razorpay.com/v1/checkout.js",stripe:"https://js.stripe.com/v3/",square:"https://web.squarecdn.com/v1/square.js"},sr={razorpay:"Razorpay",stripe:"Stripe",square:"Square"},dr=/^[A-Za-z0-9_-]{20,200}$/,cr={},pr=(0,l.forwardRef)(function({config:e,onSuccess:o,onFailure:i,onDismiss:s,children:d,variant:c="primary",size:p="md",disabled:u,className:h,style:f},m){const g=t.useTheme(),x=r.useLocale(),[y,b]=(0,l.useState)(!1),v="razorpay"===e.provider||"stripe"===e.provider?e.publicKey:e.applicationId;dr.test(v);const w="sm"===p?13:"lg"===p?16:14,k="sm"===p?32:"lg"===p?48:40,S={padding:`${"sm"===p?6:"lg"===p?12:9}px ${"sm"===p?12:"lg"===p?22:16}px`,borderRadius:8,border:"outline"===c?`1.5px solid ${g.primary}`:"none",background:"outline"===c?"transparent":g.primary,color:"outline"===c?g.primary:g.bg,fontSize:w,fontWeight:600,cursor:u?"not-allowed":y?"progress":"pointer",opacity:u?.5:1,minHeight:k,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,transition:"opacity 0.15s, transform 0.05s",...f};return(0,a.jsx)("button",{ref:m,type:"button",onClick:async()=>{if(!y&&!u){b(!0);try{if(await function(e){if("undefined"==typeof window)return Promise.resolve();if(window[sr[e]])return Promise.resolve();if(cr[e])return cr[e];const t=new Promise((t,n)=>{const o=document.querySelector(`script[data-tkx-payment="${e}"]`);if(o)return o.addEventListener("load",()=>t()),void o.addEventListener("error",()=>n(new Error("script-load-failed")));const r=document.createElement("script");r.src=ar[e],r.async=!0,r.dataset.tkxPayment=e,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(new Error("script-load-failed"))),document.head.appendChild(r)});return cr[e]=t,t}(e.provider),"razorpay"===e.provider){const t=window.Razorpay;if(!t)throw new Error("Razorpay script loaded but global missing");const r=new t({key:e.publicKey,amount:e.amount,currency:e.currency,order_id:e.orderId,name:n.sanitizeString(e.brand?.name??"Payment"),description:n.sanitizeString(e.brand?.description??""),image:e.brand?.image,prefill:e.prefill,notes:e.notes,theme:{color:e.themeColor??g.primary},handler:e=>{o({provider:"razorpay",paymentId:e.razorpay_payment_id,orderId:e.razorpay_order_id,signature:e.razorpay_signature,raw:e})},modal:{ondismiss:()=>{b(!1),s?.()}}});return r.on("payment.failed",e=>{b(!1),i?.({provider:"razorpay",code:e?.error?.code??"unknown",message:e?.error?.description??"Payment failed",raw:e})}),void r.open()}if("stripe"===e.provider){const t=window.Stripe;if(!t)throw new Error("Stripe script loaded but global missing");const n=await t(e.publicKey).redirectToCheckout({sessionId:e.sessionId});return void(n?.error&&(b(!1),i?.({provider:"stripe",code:n.error.code??"unknown",message:n.error.message??"Stripe checkout failed",raw:n})))}if("square"===e.provider){if(!window.Square)throw new Error("Square script loaded but global missing");const t={applicationId:e.applicationId,locationId:e.locationId,orderId:e.orderId,amount:e.amount,currency:e.currency,success:(t,n)=>o({provider:"square",paymentId:t,orderId:e.orderId,raw:n}),failure:(e,t,n)=>i?.({provider:"square",code:e,message:t,raw:n})};return void window.dispatchEvent(new CustomEvent("tkx-payment-square-init",{detail:t}))}}catch(t){b(!1),i?.({provider:e.provider,code:"sdk-load-failed",message:t?.message??"Unable to load payment SDK",raw:t})}}},disabled:u||y,"aria-busy":y,className:h,style:S,"data-tkx-payment-provider":e.provider,children:y?(0,a.jsx)("span",{"aria-hidden":"true",children:x.loading}):d??"Pay"})});pr.displayName="TkxPaymentButton";var ur=(0,l.forwardRef)(function({label:e,width:n,height:o=180,strokeColor:i,strokeWidth:s=2,backgroundColor:d,onChange:c,disabled:p,className:u,style:h},f){const m=t.useTheme(),g=r.useLocale(),x=(0,l.useRef)(null),y=(0,l.useRef)(null),b=(0,l.useRef)([]),v=(0,l.useRef)(null),w=(0,l.useRef)(1),[k,S]=(0,l.useState)(n??320),C=i??m.text,$=d??m.surface;(0,l.useEffect)(()=>{if(void 0!==n)return;const e=x.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(e=>{for(const t of e){const e=Math.floor(t.contentRect.width);e>0&&S(e)}});return t.observe(e),()=>t.disconnect()},[n]);const z=(0,l.useCallback)(()=>{const e=y.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const n=w.current;t.fillStyle=$,t.fillRect(0,0,e.width,e.height),t.strokeStyle=C,t.lineWidth=s*n,t.lineCap="round",t.lineJoin="round";for(const o of b.current){if(o.length<2){1===o.length&&(t.beginPath(),t.arc(o[0].x*n,o[0].y*n,s*n/2,0,2*Math.PI),t.fillStyle=C,t.fill());continue}t.beginPath(),t.moveTo(o[0].x*n,o[0].y*n);for(let r=1;r<o.length-1;r++){const e=(o[r].x+o[r+1].x)/2,i=(o[r].y+o[r+1].y)/2;t.quadraticCurveTo(o[r].x*n,o[r].y*n,e*n,i*n)}const e=o[o.length-1];t.lineTo(e.x*n,e.y*n),t.stroke()}},[$,C,s]);(0,l.useEffect)(()=>{const e=y.current;if(!e)return;const t=window.devicePixelRatio||1;w.current=t,e.width=k*t,e.height=o*t,e.style.width=`${k}px`,e.style.height=`${o}px`,z()},[k,o,z]);const N=e=>{const t=e.currentTarget.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},M=e=>{if(v.current){try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}v.current=null,c?.(y.current?.toDataURL("image/png")??"")}};(0,l.useImperativeHandle)(f,()=>({clear:()=>{b.current=[],v.current=null,z(),c?.(y.current?.toDataURL("image/png")??"")},undo:()=>{b.current.pop(),z(),c?.(y.current?.toDataURL("image/png")??"")},isEmpty:()=>0===b.current.length,toDataURL:(e="image/png",t=.92)=>y.current?.toDataURL(e,t)??"",toBlob:(e="image/png",t=.92)=>new Promise(n=>{y.current?.toBlob(e=>n(e),e,t)})}),[z,c]);const I={display:"inline-flex",flexDirection:"column",gap:6,width:n??"100%",...h},D={fontSize:13,fontWeight:600,color:m.text},W={borderRadius:8,border:`1px solid ${m.border}`,background:$,cursor:p?"not-allowed":"crosshair",touchAction:"none",display:"block",width:"100%"};return(0,a.jsxs)("div",{ref:x,className:u,style:I,children:[e&&(0,a.jsx)("label",{style:D,children:e}),(0,a.jsx)("canvas",{ref:y,role:"img","aria-label":e??g.uploadFiles??"Signature pad",style:W,onPointerDown:e=>{p||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),v.current=[N(e)],b.current.push(v.current))},onPointerMove:e=>{if(!v.current||p)return;e.preventDefault();const t=N(e),n=v.current,o=n[n.length-1];Math.abs(o.x-t.x)<1&&Math.abs(o.y-t.y)<1||(n.push(t),z())},onPointerUp:M,onPointerCancel:M})]})});ur.displayName="TkxSignaturePad";var hr=async(e,t)=>{const n=await fetch(`https://api.postalpincode.in/pincode/${e}`,{signal:t});if(!n.ok)throw new Error(`HTTP ${n.status}`);const o=await n.json();return Array.isArray(o)&&o[0]&&"Success"===o[0].Status&&o[0].PostOffice?o[0].PostOffice:[]},fr=/^\d{6}$/,mr=(0,l.forwardRef)(function({value:e,onChange:n,lookup:o=hr,label:i,showAddressLines:s=!0,disabled:d,className:c,style:p},u){const h=t.useTheme(),f=r.useLocale(),m=(0,l.useId)(),[g,x]=(0,l.useState)([]),[y,b]=(0,l.useState)(!1),[v,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!e.pin||!fr.test(e.pin))return x([]),void w(null);const t=new AbortController;return b(!0),w(null),o(e.pin,t.signal).then(e=>{x(e),0===e.length&&w(f.noResults)}).catch(e=>{"AbortError"!==e?.name&&(w(e?.message||"Lookup failed"),x([]))}).finally(()=>b(!1)),()=>t.abort()},[e.pin]);const k=t=>{n({...e,pin:t.Pincode,postOffice:t.Name,city:t.District,state:t.State,country:t.Country}),x([])},S=(t,o)=>{n({...e,pin:e.pin??"",[t]:o})},C={display:"flex",flexDirection:"column",gap:8,width:"100%",...p},$={flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4},z={width:"100%",padding:"8px 10px",border:`1px solid ${h.border}`,borderRadius:8,background:h.surface,color:h.text,fontSize:14,outline:"none",minHeight:40},N={border:`1px solid ${h.border}`,borderRadius:8,background:h.surface,maxHeight:200,overflow:"auto",padding:4},M={padding:"8px 10px",borderRadius:6,cursor:"pointer",fontSize:13,color:h.text},I={fontSize:12,color:h.textMuted};return(0,a.jsxs)("div",{className:c,style:C,children:[i&&(0,a.jsx)("label",{htmlFor:`${m}-pin`,style:{fontSize:13,fontWeight:600},children:i}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,a.jsxs)("div",{style:{...$,flex:"0 0 140px"},children:[(0,a.jsx)("span",{style:I,children:"PIN code"}),(0,a.jsx)("input",{ref:u,id:`${m}-pin`,type:"text",inputMode:"numeric",maxLength:6,autoComplete:"postal-code",value:e.pin??"",onChange:t=>(t=>{const o=t.replace(/\D+/g,"").slice(0,6);n({...e,pin:o})})(t.target.value),disabled:d,"aria-busy":y,"aria-invalid":null!==v,style:z,placeholder:"000000"})]}),(0,a.jsxs)("div",{style:$,children:[(0,a.jsx)("span",{style:I,children:"City"}),(0,a.jsx)("input",{type:"text",autoComplete:"address-level2",value:e.city??"",onChange:t=>n({...e,city:t.target.value,pin:e.pin??""}),disabled:d,style:z})]}),(0,a.jsxs)("div",{style:$,children:[(0,a.jsx)("span",{style:I,children:"State"}),(0,a.jsx)("input",{type:"text",autoComplete:"address-level1",value:e.state??"",onChange:t=>n({...e,state:t.target.value,pin:e.pin??""}),disabled:d,style:z})]})]}),g.length>1&&(0,a.jsx)("div",{role:"listbox","aria-label":"Matching post offices",style:N,children:g.map(t=>(0,a.jsxs)("div",{role:"option","aria-selected":e.postOffice===t.Name,onClick:()=>k(t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),k(t))},tabIndex:0,style:{...M,background:e.postOffice===t.Name?h.surfaceAlt:"transparent"},children:[(0,a.jsx)("strong",{children:t.Name})," ",(0,a.jsxs)("span",{style:{color:h.textMuted},children:["· ",t.District,", ",t.State]})]},`${t.Pincode}-${t.Name}`))}),v&&(0,a.jsx)("div",{role:"alert",style:{fontSize:12,color:h.danger},children:v}),s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"text",autoComplete:"address-line1",placeholder:"Address line 1",value:e.line1??"",onChange:e=>S("line1",e.target.value),disabled:d,style:z}),(0,a.jsx)("input",{type:"text",autoComplete:"address-line2",placeholder:"Address line 2 (optional)",value:e.line2??"",onChange:e=>S("line2",e.target.value),disabled:d,style:z})]})]})});mr.displayName="TkxAddressInput";var gr=new Set(["JPY","KRW"]),xr=(0,l.forwardRef)(function({value:e,onChange:n,currency:o="INR",locale:r,label:i,min:s,max:d,precision:c,required:p,disabled:u,showSymbol:h=!0,id:f,name:m,className:g,style:x},y){const b=t.useTheme(),v=(0,l.useId)(),w=f??v,k=r??function(e){return"INR"===e?"en-IN":"PKR"===e?"ur-PK":"BDT"===e?"bn-BD":"JPY"===e?"ja-JP":"KRW"===e?"ko-KR":"CNY"===e?"zh-CN":"undefined"!=typeof navigator&&navigator.language?navigator.language:"en-US"}(o),S=c??(gr.has(o)?0:2),C=(0,l.useMemo)(()=>new Intl.NumberFormat(k,{minimumFractionDigits:0,maximumFractionDigits:S,useGrouping:!0}),[k,S]),$=(0,l.useMemo)(()=>{try{return new Intl.NumberFormat(k,{style:"currency",currency:o,currencyDisplay:"narrowSymbol",minimumFractionDigits:0,maximumFractionDigits:0}).formatToParts(0).find(e=>"currency"===e.type)?.value??o}catch{return o}},[k,o]),z=null===e||Number.isNaN(e)?"":C.format(e),N=(0,l.useCallback)(e=>{const t=e.replace(/[^\d.,\-]/g,""),o=C.format(1.5),r=o.includes(",")&&!o.includes(".")?",":".",i=t.replace(new RegExp(`[^\\d\\-${r}]`,"g"),"").replace(r,".");if(""===i||"-"===i)return void n(null);const l=Number(i);if(Number.isNaN(l))return;let a=l;void 0!==s&&a<s&&(a=s),void 0!==d&&a>d&&(a=d),n(a)},[C,s,d,n]),M={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:320,...x},I={display:"flex",alignItems:"stretch",border:`1px solid ${b.border}`,borderRadius:8,background:b.surface,overflow:"hidden"},D={display:"inline-flex",alignItems:"center",padding:"0 12px",borderRight:`1px solid ${b.border}`,color:b.textMuted,fontSize:14,fontVariantNumeric:"tabular-nums",background:b.bg},W={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:b.text,background:"transparent",minHeight:40,minWidth:0,textAlign:"right",fontVariantNumeric:"tabular-nums"};return(0,a.jsxs)("div",{className:g,style:M,children:[i&&(0,a.jsxs)("label",{htmlFor:w,style:{fontSize:13,fontWeight:600,color:b.text},children:[i,p&&(0,a.jsx)("span",{style:{color:b.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),(0,a.jsxs)("div",{style:I,children:[h&&(0,a.jsx)("span",{style:D,"aria-hidden":"true",children:$}),(0,a.jsx)("input",{ref:y,id:w,name:m,type:"text",inputMode:S>0?"decimal":"numeric",value:z,onChange:e=>N(e.target.value),disabled:u,required:p,"aria-label":i??`Amount in ${o}`,style:W})]})]})});xr.displayName="TkxCurrencyInput";var yr=(0,l.forwardRef)(function({items:e,onChange:n,renderItem:o,orientation:r="vertical",disabled:i,className:s,style:d,ariaLabel:c},p){const u=t.useTheme(),h=(0,l.useId)(),[f,m]=(0,l.useState)(null),[g,x]=(0,l.useState)(null),y=(0,l.useRef)(null),b=(0,l.useCallback)((t,o)=>{if(t===o||t<0||o<0||o>=e.length)return;const r=[...e],[i]=r.splice(t,1);r.splice(o,0,i),n(r),y.current&&(y.current.textContent=`Moved item ${t+1} to position ${o+1}`)},[e,n]),v=e=>t=>{!i&&f&&(t.preventDefault(),t.dataTransfer.dropEffect="move",x(e))},w=()=>{m(null),x(null)},k=(t,n)=>t=>{if(i)return;const o="vertical"===r,l=o?"ArrowUp"===t.key:"ArrowLeft"===t.key,a=o?"ArrowDown"===t.key:"ArrowRight"===t.key;l&&n>0?(t.preventDefault(),b(n,n-1)):a&&n<e.length-1&&(t.preventDefault(),b(n,n+1))},S={display:"flex",flexDirection:"vertical"===r?"column":"row",gap:8,...d},C=e=>({cursor:i?"not-allowed":"grab",opacity:f===e?.5:1,transition:"opacity 0.15s, transform 0.05s",outline:g===e&&f!==e?`2px dashed ${u.primary}`:"none",outlineOffset:4,borderRadius:8});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:p,id:h,role:"list","aria-label":c??"Sortable list","aria-orientation":r,className:s,style:S,children:e.map((t,n)=>{return(0,a.jsx)("div",{role:"listitem",tabIndex:i?-1:0,draggable:!i,"data-tkx-sortable-handle":"true","aria-grabbed":f===t.id,"aria-posinset":n+1,"aria-setsize":e.length,onDragStart:(l=t.id,e=>{i||(m(l),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",l))}),onDragOver:v(t.id),onDragEnd:w,onDrop:(r=t.id,t=>{t.preventDefault(),!i&&f&&(b(e.findIndex(e=>e.id===f),e.findIndex(e=>e.id===r)),m(null),x(null))}),onKeyDown:k(t.id,n),style:C(t.id),children:o(t,n)},t.id);var r,l})}),(0,a.jsx)("div",{ref:y,role:"status","aria-live":"polite","aria-atomic":"true",style:{position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0}})]})});yr.displayName="TkxSortable";var br=["#00f5d4","#7b2ff7","#f72585","#ffbe0b","#06d6a0","#3a86ff"],vr=(0,l.forwardRef)(function({trigger:e,particleCount:t=80,spread:n=60,origin:r,colors:i=br,zIndex:s=9999,className:d,style:c},p){const u=(0,l.useRef)(null),h=(0,l.useRef)([]),f=(0,l.useRef)(null),m=o.useReducedMotion(),g=(0,l.useCallback)(()=>{const e=u.current;if(!e)return;const t=window.devicePixelRatio||1;e.width=window.innerWidth*t,e.height=window.innerHeight*t,e.style.width="100vw",e.style.height="100vh";const n=e.getContext("2d");n&&n.scale(t,t)},[]);(0,l.useEffect)(()=>(g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)),[g]);const x=(0,l.useCallback)(()=>{const e=u.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const n=window.devicePixelRatio||1;t.clearRect(0,0,e.width/n,e.height/n);const o=h.current;for(const r of o)t.save(),t.globalAlpha=r.alpha,t.translate(r.x,r.y),t.rotate(r.rot*Math.PI/180),t.fillStyle=r.color,t.fillRect(-r.size/2,-r.size/4,r.size,r.size/2),t.restore()},[]),y=(0,l.useCallback)(()=>{const e=h.current;let t=!1;for(const n of e)n.ttl<=0||(n.x+=n.vx,n.y+=n.vy,n.vy+=.18,n.vx*=.99,n.rot+=n.vRot,n.ttl-=1,n.ttl<30&&(n.alpha=n.ttl/30),t=!0);e.length>1e3&&(h.current=e.filter(e=>e.ttl>0)),x(),f.current=t?requestAnimationFrame(y):null},[x]),b=(0,l.useCallback)(e=>{if(!u.current)return;const o=e?.x??r?.x??window.innerWidth/2,l=e?.y??r?.y??window.innerHeight/3,a=[];for(let r=0;r<t;r++){const e=((Math.random()-.5)*n-90)*(Math.PI/180),t=6+6*Math.random();a.push({x:o,y:l,vx:Math.cos(e)*t,vy:Math.sin(e)*t,rot:360*Math.random(),vRot:14*(Math.random()-.5),size:6+6*Math.random(),color:i[Math.floor(Math.random()*i.length)],alpha:1,ttl:90+Math.floor(30*Math.random())})}if(h.current.push(...a),m)return x(),void window.setTimeout(()=>{h.current=[],x()},1500);null===f.current&&(f.current=requestAnimationFrame(y))},[t,n,r,i,m,y,x]);return(0,l.useImperativeHandle)(p,()=>({fire:b}),[b]),(0,l.useEffect)(()=>{e&&b()},[e]),(0,l.useEffect)(()=>()=>{null!==f.current&&cancelAnimationFrame(f.current)},[]),(0,a.jsx)("canvas",{ref:u,"aria-hidden":"true",className:d,style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:s,...c}})});vr.displayName="TkxConfetti";var wr="data-tkx-seo";function kr(){"undefined"!=typeof document&&document.querySelectorAll(`[${wr}]`).forEach(e=>e.remove())}function Sr(e,t,n="name"){if("undefined"==typeof document||!t)return;const o=document.createElement("meta");o.setAttribute(n,e),o.content=t,o.setAttribute(wr,"1"),document.head.appendChild(o)}var Cr=["Pratipada","Dwitiya","Tritiya","Chaturthi","Panchami","Shashthi","Saptami","Ashtami","Navami","Dashami","Ekadashi","Dwadashi","Trayodashi","Chaturdashi","Purnima","Pratipada","Dwitiya","Tritiya","Chaturthi","Panchami","Shashthi","Saptami","Ashtami","Navami","Dashami","Ekadashi","Dwadashi","Trayodashi","Chaturdashi","Amavasya"],$r=["Ashwini","Bharani","Krittika","Rohini","Mrigashira","Ardra","Punarvasu","Pushya","Ashlesha","Magha","Purva Phalguni","Uttara Phalguni","Hasta","Chitra","Swati","Vishakha","Anuradha","Jyeshtha","Mula","Purva Ashadha","Uttara Ashadha","Shravana","Dhanishtha","Shatabhisha","Purva Bhadrapada","Uttara Bhadrapada","Revati"];function zr(e,t,n){try{return{gregorian:e,display:new Intl.DateTimeFormat(`${t}-u-ca-${n}`,{day:"numeric",month:"long",year:"numeric"}).format(e)}}catch{return{gregorian:e,display:e.toISOString().slice(0,10)}}}function Nr(e,t,n,o){switch(t){case"hindu":return function(e,t,n){const{tithi:o,nakshatra:r}=n?n(e):function(e){const t=function(e){return e.getTime()/864e5-10957.5}(e),n=function(e){return(280.46+.9856474*e)%360}(t),o=function(e){return(218.316+13.176396*e)%360}(t);let r=(o-n+360)%360;const i=Math.floor(r/12)+1,l=Math.floor(o%360/(360/27))+1;return{tithi:Math.max(1,Math.min(30,i)),nakshatra:l}}(e);return{gregorian:e,display:`${new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(e)} · ${o<=15?"Shukla":"Krishna"} ${Cr[o-1]} · ${$r[r-1]}`,tithi:o,nakshatra:r}}(e,n,o);case"hijri":return zr(e,n,"islamic-civil");case"hebrew":return zr(e,n,"hebrew");case"buddhist":return zr(e,n,"buddhist");default:return function(e,t){return{gregorian:e,display:new Intl.DateTimeFormat(t,{dateStyle:"long"}).format(e)}}(e,n)}}var Mr=(0,l.forwardRef)(function({value:e,onChange:n,calendar:o="gregorian",locale:i,tithiResolver:s,label:d,minDate:c,maxDate:p,disabled:u,className:h,style:f},m){const g=t.useTheme(),x=r.useLocale(),y=i??("undefined"!=typeof navigator?navigator.language:"en-US"),[b,v]=(0,l.useState)(!1),w=(0,l.useMemo)(()=>e?Nr(e,o,y,s).display:"",[e,o,y,s]),k={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...f},S={display:"flex",alignItems:"stretch",border:`1px solid ${g.border}`,borderRadius:8,background:g.surface,overflow:"hidden"},C={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:g.text,background:"transparent",minHeight:40,minWidth:0};return(0,a.jsxs)("div",{className:h,style:k,children:[d&&(0,a.jsx)("label",{style:{fontSize:13,fontWeight:600,color:g.text},children:d}),(0,a.jsxs)("div",{style:S,children:[(0,a.jsx)("input",{ref:m,type:"text",readOnly:!0,value:w,onClick:()=>!u&&v(!0),onFocus:()=>!u&&v(!0),disabled:u,placeholder:x.selectDate,"aria-label":d??x.selectDate,style:C}),(0,a.jsx)("input",{type:"date",value:e?e.toISOString().slice(0,10):"",onChange:e=>(e=>{if(!e)return;const t=new Date(`${e}T00:00:00`);Number.isNaN(t.getTime())||c&&t<c||p&&t>p||(n(Nr(t,o,y,s)),v(!1))})(e.target.value),min:c?c.toISOString().slice(0,10):void 0,max:p?p.toISOString().slice(0,10):void 0,disabled:u,"aria-hidden":"true",tabIndex:-1,style:{width:36,border:"none",borderLeft:`1px solid ${g.border}`,padding:0,background:g.bg,color:g.text,cursor:u?"not-allowed":"pointer"}})]}),b&&e&&"gregorian"!==o&&(0,a.jsxs)("div",{role:"status",style:{padding:"6px 10px",borderRadius:6,background:g.surfaceAlt,fontSize:12,color:g.textMuted},children:[(0,a.jsxs)("strong",{style:{color:g.text},children:[o,":"]})," ",w]})]})});Mr.displayName="TkxCalendarLunar";var Ir=(0,l.forwardRef)(function({items:e,currency:n,locale:o,taxRate:i=0,shipping:s=0,paymentConfigFor:d,onComplete:c,onCancel:p,initialAddress:u={},className:h,style:f},m){const g=t.useTheme(),x=r.useLocale(),[y,b]=(0,l.useState)("address"),[v,w]=(0,l.useState)(u),[k,S]=(0,l.useState)(null),[C,$]=(0,l.useState)(null),z=e.reduce((e,t)=>e+t.quantity*t.unitPrice,0),N=z*i,M=z+N+s,I=e=>{try{return new Intl.NumberFormat(o??"en-IN",{style:"currency",currency:n}).format(e)}catch{return`${n} ${e.toFixed(2)}`}},D=Boolean(v.pin&&6===v.pin.length&&v.line1&&v.city),W={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 320px",gap:24,maxWidth:960,width:"100%",...f},L={border:`1px solid ${g.border}`,borderRadius:12,padding:20,background:g.surface},R={...L,position:"sticky",top:16,height:"fit-content"},T={fontSize:11,fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",color:g.textMuted,marginBottom:12};return(0,a.jsxs)("div",{ref:m,className:h,style:W,children:[(0,a.jsxs)("div",{style:L,children:[(0,a.jsxs)("div",{style:T,children:["Step ","address"===y?1:"payment"===y?2:3," of 3"]}),"address"===y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Shipping address"}),(0,a.jsx)(mr,{value:v,onChange:w}),C&&(0,a.jsx)("div",{role:"alert",style:{marginTop:12,fontSize:13,color:g.danger},children:C}),(0,a.jsxs)("div",{style:{marginTop:20,display:"flex",justifyContent:"flex-end",gap:8},children:[p&&(0,a.jsx)("button",{type:"button",onClick:p,style:{padding:"8px 14px",borderRadius:6,border:`1px solid ${g.border}`,background:"transparent",color:g.text,cursor:"pointer",fontSize:13,fontWeight:600},children:x.cancel}),(0,a.jsx)("button",{type:"button",onClick:async()=>{if(D){$(null);try{S(await d(v)),b("payment")}catch(e){$(e?.message??"Could not initialise payment")}}else $(x.fieldRequired??"Address incomplete")},disabled:!D,style:{padding:"8px 14px",borderRadius:6,border:"none",background:D?g.primary:g.border,color:D?g.bg:g.textMuted,cursor:D?"pointer":"not-allowed",fontSize:13,fontWeight:600,minHeight:36},children:"Continue to payment"})]})]}),"payment"===y&&k&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Payment"}),(0,a.jsxs)("p",{style:{margin:"0 0 16px",color:g.textMuted,fontSize:14},children:["Total ",(0,a.jsx)("strong",{style:{color:g.text,fontSize:18},children:I(M)})]}),(0,a.jsxs)(pr,{config:k,onSuccess:e=>{b("confirm"),c({address:v,payment:e})},onFailure:e=>{$(e.message)},size:"lg",children:["Pay ",I(M)]}),C&&(0,a.jsx)("div",{role:"alert",style:{marginTop:12,fontSize:13,color:g.danger},children:C}),(0,a.jsx)("div",{style:{marginTop:20},children:(0,a.jsx)("button",{type:"button",onClick:()=>b("address"),style:{padding:"6px 10px",border:"none",background:"transparent",color:g.textMuted,cursor:"pointer",fontSize:13},children:"← Back to address"})})]}),"confirm"===y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Order confirmed"}),(0,a.jsx)("p",{style:{color:g.textMuted,fontSize:14,lineHeight:1.6},children:"Thank you. A receipt has been emailed to you. Your order will ship shortly."})]})]}),(0,a.jsxs)("div",{style:R,children:[(0,a.jsx)("div",{style:T,children:"Order summary"}),e.map(e=>(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"6px 0",fontSize:13},children:[(0,a.jsxs)("span",{style:{color:g.text},children:[e.label," ",(0,a.jsxs)("span",{style:{color:g.textMuted},children:["×",e.quantity]})]}),(0,a.jsx)("span",{style:{color:g.text,fontVariantNumeric:"tabular-nums"},children:I(e.quantity*e.unitPrice)})]},e.id)),(0,a.jsx)("hr",{style:{margin:"12px 0",border:0,borderTop:`1px solid ${g.border}`}}),i>0&&(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13,color:g.textMuted},children:[(0,a.jsxs)("span",{children:["Tax (",(100*i).toFixed(0),"%)"]}),(0,a.jsx)("span",{children:I(N)})]}),s>0&&(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13,color:g.textMuted},children:[(0,a.jsx)("span",{children:"Shipping"}),(0,a.jsx)("span",{children:I(s)})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginTop:12,paddingTop:12,borderTop:`2px solid ${g.text}`,fontSize:16,fontWeight:700},children:[(0,a.jsx)("span",{children:"Total"}),(0,a.jsx)("span",{children:I(M)})]})]})]})});Ir.displayName="TkxCheckout";var Dr=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],Wr=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]];function Lr(e){const t=e.replace(/\D+/g,"");if(12!==t.length)return!1;let n=0;const o=t.split("").reverse();for(let r=0;r<o.length;r++)n=Dr[n][Wr[r%8][parseInt(o[r],10)]];return 0===n}function Rr(e){const t=e.replace(/\D+/g,"").slice(0,12);return[t.slice(0,4),t.slice(4,8),t.slice(8,12)].filter(Boolean).join(" ")}function Tr(e){const t=e.replace(/\D+/g,"").slice(0,12);return 0===t.length?"":t.length<=8?"X".repeat(t.length).match(/.{1,4}/g).join(" "):`XXXX XXXX ${t.slice(8,12)}`}var Ar=(0,l.forwardRef)(function({value:e,defaultValue:n,onChange:o,label:i,mask:s=!0,disabled:d,required:c,id:p,name:u,className:h,style:f},m){const g=t.useTheme(),x=r.useLocale(),y=(0,l.useId)(),b=p??y,v=void 0!==e,[w,k]=(0,l.useState)(()=>(n??"").replace(/\D+/g,"").slice(0,12)),S=v?(e??"").replace(/\D+/g,"").slice(0,12):w,C=s?Tr(S):Rr(S),$=Lr(S),z={fontSize:13,fontWeight:600,color:g.text},N={width:"100%",padding:"0 12px",border:`1px solid ${12!==S.length||$?g.border:g.danger}`,borderRadius:8,background:g.surface,color:g.text,fontSize:14,minHeight:40,outline:"none",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",letterSpacing:1.5};return(0,a.jsxs)("div",{className:h,style:{display:"flex",flexDirection:"column",gap:6,...f},children:[i&&(0,a.jsxs)("label",{htmlFor:b,style:z,children:[i,c&&(0,a.jsx)("span",{style:{color:g.danger,marginLeft:4},children:"*"})]}),(0,a.jsx)("input",{ref:m,id:b,name:u,type:"text",inputMode:"numeric",autoComplete:"off",maxLength:14,value:C,onChange:e=>(e=>{const t=e.replace(/\D+/g,"").slice(0,12);v||k(t),o?.({raw:Rr(t),digits:t,display:s?Tr(t):Rr(t),valid:Lr(t)})})(e.target.value),disabled:d,required:c,"aria-invalid":12===S.length&&!$,"aria-describedby":12!==S.length||$?void 0:`${b}-err`,style:N,placeholder:"XXXX XXXX XXXX"}),12===S.length&&!$&&(0,a.jsx)("div",{id:`${b}-err`,role:"alert",style:{fontSize:12,color:g.danger},children:x.invalidFormat??"Invalid Aadhaar — checksum mismatch."}),S.length>0&&S.length<12&&(0,a.jsxs)("div",{style:{fontSize:12,color:g.textMuted},children:[12-S.length," digit",12-S.length==1?"":"s"," remaining"]})]})});Ar.displayName="TkxAadhaarInput";var Br=/^[A-Z]{5}[0-9]{4}[A-Z]$/;function Fr(e){const t=e.toUpperCase().trim();return!!Br.test(t)&&"PFCHATBLJG".includes(t[3])}var Er=(0,l.forwardRef)(function({value:e,defaultValue:n,onChange:o,label:i,disabled:s,required:d,id:c,name:p,className:u,style:h},f){const m=t.useTheme(),g=r.useLocale(),x=(0,l.useId)(),y=c??x,b=void 0!==e,[v,w]=(0,l.useState)((n??"").toUpperCase().slice(0,10)),k=(b?e??"":v).toUpperCase().slice(0,10),S=Fr(k);return(0,a.jsxs)("div",{className:u,style:{display:"flex",flexDirection:"column",gap:6,...h},children:[i&&(0,a.jsxs)("label",{htmlFor:y,style:{fontSize:13,fontWeight:600,color:m.text},children:[i,d&&(0,a.jsx)("span",{style:{color:m.danger,marginLeft:4},children:"*"})]}),(0,a.jsx)("input",{ref:f,id:y,name:p,type:"text",inputMode:"text",autoComplete:"off",maxLength:10,value:k,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);b||w(t),o?.({raw:e,normalised:t,valid:Fr(t)})})(e.target.value),disabled:s,required:d,"aria-invalid":10===k.length&&!S,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==k.length||S?m.border:m.danger}`,borderRadius:8,background:m.surface,color:m.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:2,outline:"none",textTransform:"uppercase"},placeholder:"ABCDE1234F"}),10===k.length&&!S&&(0,a.jsx)("div",{role:"alert",style:{fontSize:12,color:m.danger},children:g.invalidFormat??"Invalid PAN format."})]})});Er.displayName="TkxPanInput";var jr=/^[A-Z]{3}[0-9]{7}$/;function Hr(e){const t=e.toUpperCase().trim();return jr.test(t)}var Pr=(0,l.forwardRef)(function({value:e,defaultValue:n,onChange:o,label:i,disabled:s,required:d,id:c,name:p,className:u,style:h},f){const m=t.useTheme(),g=r.useLocale(),x=(0,l.useId)(),y=c??x,b=void 0!==e,[v,w]=(0,l.useState)((n??"").toUpperCase().slice(0,10)),k=(b?e??"":v).toUpperCase().slice(0,10),S=Hr(k);return(0,a.jsxs)("div",{className:u,style:{display:"flex",flexDirection:"column",gap:6,...h},children:[i&&(0,a.jsxs)("label",{htmlFor:y,style:{fontSize:13,fontWeight:600,color:m.text},children:[i,d&&(0,a.jsx)("span",{style:{color:m.danger,marginLeft:4},children:"*"})]}),(0,a.jsx)("input",{ref:f,id:y,name:p,type:"text",autoComplete:"off",maxLength:10,value:k,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);b||w(t),o?.({raw:e,normalised:t,valid:Hr(t)})})(e.target.value),disabled:s,required:d,"aria-invalid":10===k.length&&!S,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==k.length||S?m.border:m.danger}`,borderRadius:8,background:m.surface,color:m.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.5,outline:"none",textTransform:"uppercase"},placeholder:"ABC1234567"}),10===k.length&&!S&&(0,a.jsx)("div",{role:"alert",style:{fontSize:12,color:m.danger},children:g.invalidFormat??"Invalid Voter ID format."})]})});Pr.displayName="TkxVoterIdInput";var Or=15;function Vr(e){const t=e.toUpperCase().replace(/[\s-]/g,"");return t.length===Or&&/^[A-Z]{2}[0-9]{13}$/.test(t)}function Kr(e){const t=e.toUpperCase().replace(/[\s-]/g,"");return 0===t.length?"":[t.slice(0,2),t.slice(2,4),t.slice(4,8),t.slice(8)].filter(Boolean).join("-")}var Ur=(0,l.forwardRef)(function({value:e,defaultValue:n,onChange:o,label:i,disabled:s,required:d,id:c,name:p,className:u,style:h},f){const m=t.useTheme(),g=r.useLocale(),x=(0,l.useId)(),y=c??x,b=void 0!==e,[v,w]=(0,l.useState)((n??"").toUpperCase()),k=b?e??"":v,S=k.toUpperCase().replace(/[\s-]/g,"").slice(0,Or),C=Vr(S);return(0,a.jsxs)("div",{className:u,style:{display:"flex",flexDirection:"column",gap:6,...h},children:[i&&(0,a.jsxs)("label",{htmlFor:y,style:{fontSize:13,fontWeight:600,color:m.text},children:[i,d&&(0,a.jsx)("span",{style:{color:m.danger,marginLeft:4},children:"*"})]}),(0,a.jsx)("input",{ref:f,id:y,name:p,type:"text",autoComplete:"off",maxLength:20,value:k,onChange:e=>(e=>{const t=e.toUpperCase();b||w(t);const n=t.replace(/[\s-]/g,"").slice(0,Or);o?.({raw:e,normalised:n,pretty:Kr(n),valid:Vr(n)})})(e.target.value),disabled:s,required:d,"aria-invalid":S.length===Or&&!C,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${S.length!==Or||C?m.border:m.danger}`,borderRadius:8,background:m.surface,color:m.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.2,outline:"none",textTransform:"uppercase"},placeholder:"MH-12-2010-0012345"}),S.length===Or&&!C&&(0,a.jsx)("div",{role:"alert",style:{fontSize:12,color:m.danger},children:g.invalidFormat??"Invalid Driving Licence format."})]})});function Yr(e,t,n){try{return new Intl.NumberFormat(n??"en-US",{style:"currency",currency:t,maximumFractionDigits:e%1==0?0:2}).format(e)}catch{return`${t} ${e.toFixed(2)}`}}Ur.displayName="TkxDrivingLicenceInput";var qr=(0,l.forwardRef)(function({plans:e,cycle:n,selectedId:o,onSelect:r,className:i,style:l},s){const d=t.useTheme();return(0,a.jsx)("div",{ref:s,className:i,style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:16,...l},role:"radiogroup","aria-label":"Plans",children:e.map(e=>{const t=e.id===o;return(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":t,disabled:e.disabled,onClick:()=>!e.disabled&&r?.(e),style:{position:"relative",padding:20,borderRadius:12,border:`${e.highlighted?2:1}px solid ${t||e.highlighted?d.primary:d.border}`,background:d.surface,color:d.text,textAlign:"left",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,transition:"border-color 0.15s, transform 0.05s",fontFamily:"inherit",fontSize:"inherit",width:"100%"},children:[e.highlighted&&(0,a.jsx)("span",{style:{position:"absolute",top:-10,right:16,background:d.primary,color:d.bg,fontSize:11,fontWeight:700,padding:"2px 8px",borderRadius:4,letterSpacing:.4,textTransform:"uppercase"},"aria-hidden":"true",children:"Most popular"}),(0,a.jsx)("div",{style:{fontSize:12,fontWeight:700,color:d.textMuted,textTransform:"uppercase",letterSpacing:.5},children:e.name}),e.tagline&&(0,a.jsx)("div",{style:{fontSize:12,color:d.textMuted,marginTop:2},children:e.tagline}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:4,marginTop:12},children:[(0,a.jsx)("span",{style:{fontSize:32,fontWeight:800,color:d.text},children:Yr(e.prices[n],e.currency,e.locale)}),(0,a.jsxs)("span",{style:{fontSize:12,color:d.textMuted},children:["/ ","monthly"===n?"mo":"yr"]})]}),(0,a.jsx)("ul",{style:{listStyle:"none",padding:0,margin:"16px 0 0",fontSize:13,lineHeight:1.7},children:e.features.map(e=>(0,a.jsxs)("li",{style:{display:"flex",gap:6,alignItems:"flex-start",color:d.text},children:[(0,a.jsx)("span",{"aria-hidden":"true",style:{color:d.success},children:"✓"}),(0,a.jsx)("span",{children:e})]},e))}),(0,a.jsx)("div",{style:{marginTop:16,padding:"8px 12px",borderRadius:6,background:t?d.primary:"transparent",color:t?d.bg:d.primary,border:`1px solid ${d.primary}`,textAlign:"center",fontWeight:600,fontSize:13},children:e.ctaLabel??(t?"Selected":`Choose ${e.name}`)})]},e.id)})})});function Xr(e,t,n,o,r){if("vertical"===r){const r=e.x+n/2,i=e.y+o,l=t.x+n/2,a=t.y,s=(i+a)/2;return`M${r},${i} C${r},${s} ${l},${s} ${l},${a}`}const i=e.x+n,l=e.y+o/2,a=t.x,s=t.y+o/2,d=(i+a)/2;return`M${i},${l} C${d},${l} ${d},${s} ${a},${s}`}function Zr({node:e,w:t,h:o,isActive:r,theme:i}){const l=e.accent??i.primary,s=function(e){if(!e)return;const t=e.trim();return!t||/^javascript:/i.test(t)||/^vbscript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)?void 0:t}(e.avatar),d=n.sanitizeString(e.label),c=e.subLabel?n.sanitizeString(e.subLabel):"",p=e.badge?n.sanitizeString(e.badge):"";return(0,a.jsxs)("div",{style:{width:t,height:o,boxSizing:"border-box",background:i.surface,border:`1.5px solid ${r?l:i.border}`,borderRadius:12,padding:"10px 12px",display:"flex",alignItems:"center",gap:10,boxShadow:r?`0 8px 24px -8px ${l}66`:`0 2px 8px -4px ${i.border}88`,transition:"border-color 0.15s ease, box-shadow 0.15s ease",overflow:"hidden"},children:[(0,a.jsx)("div",{style:{width:40,height:40,minWidth:40,borderRadius:"50%",overflow:"hidden",background:`${l}22`,color:l,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,border:`1.5px solid ${l}44`},"aria-hidden":"true",children:s?(0,a.jsx)("img",{src:s,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",style:{width:"100%",height:"100%",objectFit:"cover"}}):d.slice(0,2).toUpperCase()}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontSize:13.5,fontWeight:700,color:i.text,lineHeight:1.25,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d}),c&&(0,a.jsx)("div",{style:{fontSize:11.5,color:i.textMuted,lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:1},children:c})]}),p&&(0,a.jsx)("span",{style:{fontSize:10,fontWeight:700,padding:"3px 7px",borderRadius:999,color:l,background:`${l}18`,border:`1px solid ${l}33`,letterSpacing:"0.04em",textTransform:"uppercase",flexShrink:0},children:p})]})}function _r({collapsed:e,onClick:t,theme:n,direction:o,w:r,h:i}){const l={position:"absolute",..."vertical"===o?{left:r/2-10,top:i-10}:{left:r-10,top:i/2-10},width:20,height:20,borderRadius:"50%",background:n.surfaceAlt,border:`1.5px solid ${n.border}`,color:n.text,fontSize:12,fontWeight:700,cursor:"pointer",padding:0,lineHeight:1,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center"};return(0,a.jsx)("button",{type:"button","aria-label":e?"Expand subtree":"Collapse subtree","aria-expanded":!e,onClick:e=>{e.stopPropagation(),t(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.stopPropagation(),t(e))},style:l,children:e?"+":"−"})}function Gr({data:e,direction:o="vertical",interactive:r=!0,initialZoom:i=1,nodeWidth:s=200,nodeHeight:d=84,siblingGap:c=28,levelGap:p=64,onNodeClick:u,renderNode:h,collapsedByDefault:f=!1,height:m=560,ariaLabel:g="Organization chart",className:x,style:y}){const b=t.useTheme(),v=(0,l.useRef)(null),w=(0,l.useRef)(null),[k,S]=(0,l.useState)(()=>{if(!f)return new Set;const t=new Set;return function n(o){o.id!==e.id&&t.add(o.id),(o.children??[]).forEach(n)}(e),t}),[C,$]=(0,l.useState)(Jr(i)),[z,N]=(0,l.useState)({x:0,y:0}),[M,I]=(0,l.useState)(e.id),D=(0,l.useMemo)(()=>function(e,t,n){const{nodeWidth:o,nodeHeight:r,siblingGap:i,levelGap:l,direction:a}=n,s=[],d=function e(n,o,r){const i=t.has(n.id),l={id:n.id,node:n,x:0,y:0,depth:o,parent:r,children:[],collapsed:i};if(!i)for(const t of n.children??[])l.children.push(e(t,o+1,l));return s.push(l),l}(e,0,null);let c=0;!function e(t){if(0===t.children.length)return t.x=c,void(c+=o+i);t.children.forEach(e),t.x=(t.children[0].x+t.children[t.children.length-1].x)/2}(d);for(const m of s)m.y=m.depth*(r+l);if("horizontal"===a)for(const m of s){const e=m.x;m.x=m.y,m.y=e}let p=1/0,u=1/0,h=-1/0,f=-1/0;for(const m of s)m.x<p&&(p=m.x),m.y<u&&(u=m.y),m.x>h&&(h=m.x),m.y>f&&(f=m.y);Number.isFinite(p)||(p=0,u=0,h=0,f=0);for(const m of s)m.x-=p,m.y-=u;return{nodes:s,width:h-p+o,height:f-u+r}}(e,k,{nodeWidth:s,nodeHeight:d,siblingGap:c,levelGap:p,direction:o}),[e,k,s,d,c,p,o]),W=(0,l.useCallback)(e=>{S(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);(0,l.useEffect)(()=>{if(!r)return;const e=v.current;if(!e)return;const t=e=>{if(!e.ctrlKey&&!e.metaKey){if(Math.abs(e.deltaY)<4&&Math.abs(e.deltaX)<4)return;return N(t=>({x:t.x-e.deltaX,y:t.y-e.deltaY})),void e.preventDefault()}e.preventDefault();const t=e.deltaY<0?.1:-.1;$(e=>Jr(e+t))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[r]),(0,l.useEffect)(()=>{if(!r)return;const e=v.current;if(!e)return;let t=!1,n=0,o=0,i=0,l=0;const a=r=>{r.target.closest('button, [role="treeitem"], a, input')||(t=!0,n=r.clientX,o=r.clientY,i=z.x,l=z.y,e.setPointerCapture(r.pointerId))},s=e=>{t&&N({x:i+(e.clientX-n),y:l+(e.clientY-o)})},d=n=>{t=!1;try{e.releasePointerCapture(n.pointerId)}catch{}};return e.addEventListener("pointerdown",a),e.addEventListener("pointermove",s),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("pointerdown",a),e.removeEventListener("pointermove",s),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d)}},[r,z]);const L=(0,l.useCallback)(e=>{const t=D.nodes.find(e=>e.id===M);if(t)if("ArrowRight"===e.key||"ArrowDown"===e.key){const n=t.children[0];n&&(I(n.id),e.preventDefault())}else"ArrowLeft"===e.key||"ArrowUp"===e.key?t.parent&&(I(t.parent.id),e.preventDefault()):"Enter"===e.key||" "===e.key?(u?.(t.node),e.preventDefault()):"+"===e.key||"="===e.key?$(e=>Jr(e+.1)):"-"===e.key?$(e=>Jr(e-.1)):"0"===e.key&&($(1),N({x:0,y:0}))},[M,D,u]),R=(0,l.useMemo)(()=>{const e=[];for(const t of D.nodes)for(const n of t.children)e.push({id:`${t.id}→${n.id}`,d:Xr(t,n,s,d,o)});return e},[D,s,d,o]),T={position:"relative",width:"100%",height:m,overflow:"hidden",borderRadius:12,background:b.bg,border:`1px solid ${b.border}`,touchAction:"none",cursor:r?"grab":"default",boxSizing:"border-box",...y},A={position:"absolute",left:"50%",top:24,width:D.width,height:D.height,transform:`translate(calc(-50% + ${z.x}px), ${z.y}px) scale(${C})`,transformOrigin:"top center",transition:"transform 0.08s ease-out"};return(0,a.jsxs)("div",{ref:v,className:x,style:T,role:"tree","aria-label":n.sanitizeString(g),tabIndex:0,onKeyDown:L,children:[r&&(0,a.jsxs)("div",{style:{position:"absolute",top:12,right:12,zIndex:3,display:"flex",gap:6,background:b.surface,border:`1px solid ${b.border}`,borderRadius:8,padding:4,boxShadow:`0 4px 12px -6px ${b.border}88`},children:[(0,a.jsx)(Qr,{theme:b,label:"Zoom out",onClick:()=>$(e=>Jr(e-.1)),children:"−"}),(0,a.jsx)(Qr,{theme:b,label:"Reset zoom",onClick:()=>{$(1),N({x:0,y:0})},children:"⟳"}),(0,a.jsx)(Qr,{theme:b,label:"Zoom in",onClick:()=>$(e=>Jr(e+.1)),children:"+"})]}),(0,a.jsxs)("div",{ref:w,style:A,children:[(0,a.jsx)("svg",{width:D.width,height:D.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none"},"aria-hidden":"true",children:R.map(e=>(0,a.jsx)("path",{d:e.d,fill:"none",stroke:b.border,strokeWidth:1.5},e.id))}),D.nodes.map(e=>{const t=(e.node.children?.length??0)>0,r=e.id===M;return(0,a.jsxs)("div",{role:"treeitem","aria-label":n.sanitizeString(e.node.label),"aria-selected":r,"aria-level":e.depth+1,"aria-expanded":t?!e.collapsed:void 0,tabIndex:-1,onClick:t=>{t.stopPropagation(),I(e.id),u?.(e.node)},style:{position:"absolute",left:e.x,top:e.y,width:s,height:d,cursor:u?"pointer":"default"},children:[h?h(e.node,r):(0,a.jsx)(Zr,{node:e.node,w:s,h:d,isActive:r,theme:b}),t&&(0,a.jsx)(_r,{collapsed:e.collapsed,onClick:()=>W(e.id),theme:b,direction:o,w:s,h:d})]},e.id)})]})]})}function Jr(e){return e<.25?.25:e>4?4:e}function Qr({children:e,onClick:t,label:n,theme:o}){return(0,a.jsx)("button",{type:"button","aria-label":n,onClick:t,style:{width:28,height:28,borderRadius:6,background:"transparent",border:"none",color:o.text,fontSize:14,fontWeight:700,cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:e=>{e.currentTarget.style.background=o.surfaceAlt},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:e})}function ei(e,t,n,o){const r=e.getBoundingClientRect(),i=t?t.offsetHeight:320,l=t?t.offsetWidth:200,a=window.innerWidth,s=window.innerHeight,d=window.scrollX,c=window.scrollY;let p=0,u=0;switch(n){case"bottom-start":default:p=r.bottom+c+o,u=r.left+d;break;case"bottom-end":p=r.bottom+c+o,u=r.right+d-l;break;case"top-start":p=r.top+c-o-i,u=r.left+d;break;case"top-end":p=r.top+c-o-i,u=r.right+d-l;break;case"right":p=r.top+c,u=r.right+d+o;break;case"left":p=r.top+c,u=r.left+d-o-l}return n.startsWith("bottom")&&r.bottom+i>s&&(p=r.top+c-o-i),n.startsWith("top")&&r.top-i<0&&(p=r.bottom+c+o),u+l>a+d&&(u=a+d-l-8),u<d&&(u=d+8),{top:p,left:u,minWidth:r.width}}function ti(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return-1===n?e:(0,a.jsxs)(a.Fragment,{children:[e.slice(0,n),(0,a.jsx)("mark",{style:{background:"rgba(0,245,212,0.3)",color:"inherit",borderRadius:2},children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function ni({groups:e,position:o,maxHeight:i,minWidth:s,selectedKeys:d,multiSelect:c,searchable:p,searchPlaceholder:u,onSelect:h,onClose:f,renderItem:m,menuRef:g,isPortal:x,menuId:y}){const b=t.useTheme(),v=r.useLocale(),w=u??`${v.search}…`,[k,S]=(0,l.useState)(""),[C,$]=(0,l.useState)(0),[z,N]=(0,l.useState)(null),[M,I]=(0,l.useState)(0),D=(0,l.useRef)(null),W=(0,l.useRef)([]),L=(0,l.useRef)([]),R=k?e.map(e=>({...e,items:e.items.filter(e=>e.label.toLowerCase().includes(k.toLowerCase())||e.description?.toLowerCase().includes(k.toLowerCase())||e.children?.some(e=>e.label.toLowerCase().includes(k.toLowerCase())))})).filter(e=>e.items.length>0):e,T=function(e,t){const n=[];for(const o of e)for(const e of o.items)e.disabled||t&&!e.label.toLowerCase().includes(t.toLowerCase())||n.push(e);return n}(R,k);(0,l.useEffect)(()=>{p&&D.current?D.current.focus():W.current[0]?.focus(),$(0)},[p]),(0,l.useEffect)(()=>{p&&""===k||W.current[C]?.focus()},[C,p,k]);const A=(0,l.useCallback)(e=>{switch(e.key){case"ArrowDown":if(e.preventDefault(),z){const e=(T.find(e=>e.key===z)?.children??[]).filter(e=>!e.disabled);I(t=>Math.min(t+1,e.length-1))}else $(e=>Math.min(e+1,T.length-1));break;case"ArrowUp":e.preventDefault(),z?I(e=>Math.max(e-1,0)):$(e=>Math.max(e-1,0));break;case"ArrowRight":{e.preventDefault();const t=T[C];t?.children?.length&&(N(t.key),I(0));break}case"ArrowLeft":e.preventDefault(),N(null);break;case"Enter":case" ":if(e.preventDefault(),z){const e=(T.find(e=>e.key===z)?.children??[]).filter(e=>!e.disabled)[M];e&&h(e.key,e)}else{const e=T[C];e&&h(e.key,e)}break;case"Escape":e.preventDefault(),z?N(null):f();break;case"Tab":f()}},[T,C,f,h,z,M]);(0,l.useEffect)(()=>{z&&L.current[M]?.focus()},[M,z]);const B={position:x?"fixed":"absolute",top:x?o.top:void 0,left:x?o.left:void 0,minWidth:Math.max(s,o.minWidth),maxHeight:i,overflowY:"auto",background:b.surface,border:`1px solid ${b.border}`,borderRadius:8,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",zIndex:9999,outline:"none",transformOrigin:"top left",animation:"tkx-dropdown-in 150ms ease forwards"};let F=0;return(0,a.jsxs)("div",{ref:g,id:y,role:"menu","aria-label":"Dropdown menu",tabIndex:-1,style:B,onKeyDown:A,children:[(0,a.jsx)("style",{children:"\n @keyframes tkx-dropdown-in {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "}),p&&(0,a.jsx)("div",{style:{padding:"8px 8px 4px"},children:(0,a.jsx)("input",{ref:D,type:"text",value:k,onChange:e=>{S(e.target.value),$(0)},placeholder:w,"aria-label":`${v.search} items`,style:{width:"100%",boxSizing:"border-box",padding:"6px 10px",background:b.surfaceAlt,border:`1px solid ${b.border}`,borderRadius:6,color:b.text,fontSize:13,outline:"none"}})}),0===R.length&&(0,a.jsx)("div",{style:{padding:"12px 16px",color:b.textMuted,fontSize:13,textAlign:"center"},children:"No results found"}),R.map((e,t)=>(0,a.jsxs)("div",{role:"group","aria-label":e.label,children:[e.label&&(0,a.jsx)("div",{style:{padding:"8px 12px 4px",fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:b.textMuted},children:n.sanitizeString(e.label)}),e.items.map(e=>{const t=F;e.disabled||F++;const n=d.includes(e.key),o=t===C&&!e.disabled,r=!!e.children?.length,i=z===e.key,l=m?m(e,n):(0,a.jsx)(oi,{item:e,isSelected:n,isFocused:o,multiSelect:c,query:k,theme:b,hasSubmenu:r});return(0,a.jsxs)("div",{children:[e.divider&&(0,a.jsx)("div",{role:"separator",style:{height:1,background:b.border,margin:"4px 0"}}),(0,a.jsxs)("div",{ref:e=>{W.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-checked":c?n:void 0,"aria-selected":c?void 0:n,"aria-haspopup":r?"menu":void 0,"aria-expanded":r?i:void 0,tabIndex:e.disabled?-1:0,style:{position:"relative",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:()=>{e.disabled||(r?(N(i?null:e.key),I(0)):h(e.key,e))},onMouseEnter:()=>{e.disabled||($(t),r?(N(e.key),I(0)):N(null))},onFocus:()=>{e.disabled||$(t)},children:[l,r&&i&&(0,a.jsx)("div",{role:"menu",style:{position:"absolute",top:0,left:"100%",minWidth:180,background:b.surface,border:`1px solid ${b.border}`,borderRadius:8,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",zIndex:1e4,animation:"tkx-dropdown-in 120ms ease forwards"},children:e.children.map((e,t)=>{const n=d.includes(e.key),o=t===M;return(0,a.jsx)("div",{ref:e=>{L.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-selected":n,tabIndex:e.disabled?-1:0,style:{cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:t=>{t.stopPropagation(),e.disabled||h(e.key,e)},onMouseEnter:()=>I(t),children:(0,a.jsx)(oi,{item:e,isSelected:n,isFocused:o,multiSelect:c,query:k,theme:b,hasSubmenu:!1})},e.key)})})]})]},e.key)})]},t))]})}function oi({item:e,isSelected:t,isFocused:n,multiSelect:o,query:r,theme:i,hasSubmenu:l}){return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:n?e.danger?`${i.danger}20`:`${i.primary}18`:"transparent",transition:"background 80ms",color:e.danger?i.danger:i.text,fontSize:14,userSelect:"none"},children:[o&&(0,a.jsx)("div",{style:{width:16,height:16,border:`2px solid ${t?i.primary:i.border}`,borderRadius:4,background:t?i.primary:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 120ms"},children:t&&(0,a.jsx)("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:(0,a.jsx)("path",{d:"M1 4l3 3L9 1",stroke:i.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.icon&&(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",flexShrink:0,color:e.danger?i.danger:i.textMuted},children:e.icon}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontWeight:t&&!o?600:400},children:ti(e.label,r)}),e.description&&(0,a.jsx)("div",{style:{fontSize:12,color:i.textMuted,marginTop:1},children:ti(e.description,r)})]}),void 0!==e.badge&&(0,a.jsx)("span",{style:{background:i.primary,color:i.bg,fontSize:11,fontWeight:700,borderRadius:10,padding:"1px 7px",flexShrink:0},children:e.badge}),e.shortcut&&!l&&(0,a.jsx)("span",{style:{fontSize:12,color:i.textMuted,flexShrink:0},children:e.shortcut}),l&&(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M4 2l4 4-4 4",stroke:i.textMuted,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),!o&&t&&(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M2 7l4 4L12 3",stroke:i.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})}Gr.displayName="TkxOrgChart";var ri={sm:4,md:8,lg:12};function ii({src:e,name:n,size:o=32}){const r=t.useTheme(),i=n?n.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():"?";return e?(0,a.jsx)("img",{src:e,alt:n??"avatar",width:o,height:o,style:{borderRadius:"50%",objectFit:"cover",flexShrink:0}}):(0,a.jsx)("div",{style:{width:o,height:o,borderRadius:"50%",flexShrink:0,background:`${r.primary}22`,border:`1px solid ${r.primary}44`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:.35*o,fontWeight:700,color:r.primary},children:i})}function li({color:e}){return(0,a.jsx)("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[0,1,2].map(t=>(0,a.jsx)("div",{style:{width:7,height:7,borderRadius:"50%",background:e,animation:`tkx-thinking-dot 1.2s ease-in-out ${.18*t}s infinite`}},t))})}function ai({color:e}){return(0,a.jsxs)("div",{style:{position:"relative",width:24,height:24},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:e,opacity:.15,animation:"tkx-thinking-pulse 1.5s ease-out infinite"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:4,borderRadius:"50%",background:e,opacity:.6,animation:"tkx-thinking-pulse 1.5s ease-out 0.3s infinite"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:8,borderRadius:"50%",background:e}})]})}function si({color:e}){return(0,a.jsx)("div",{style:{display:"flex",gap:3,alignItems:"center",height:20},children:[0,1,2,3,4].map(t=>(0,a.jsx)("div",{style:{width:3,borderRadius:3,background:e,animation:`tkx-thinking-wave 1s ease-in-out ${.1*t}s infinite`}},t))})}function di({color:e}){return(0,a.jsxs)("div",{style:{position:"relative",width:28,height:28},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:`2px solid ${e}33`}}),(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:"2px solid transparent",borderTopColor:e,animation:"tkx-thinking-orbit 0.8s linear infinite"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:"38%",borderRadius:"50%",background:e,opacity:.8}})]})}var ci={sm:12,md:14,lg:16},pi=!1,ui="tkx-holographic-styles";function hi(e={}){const{maxTilt:t=14,disabled:n=!1}=e,r=(0,l.useRef)(null),i=o.useReducedMotion(),a=(0,l.useRef)(null),s=(0,l.useRef)({rx:0,ry:0,mx:50,my:50});return(0,l.useEffect)(()=>{!function(){if(pi||"undefined"==typeof document)return;if(document.getElementById(ui))return void(pi=!0);pi=!0;const e=document.createElement("style");e.id=ui,e.textContent="\n@keyframes tkx-holo-shimmer {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n}\n@keyframes tkx-holo-snapback {\n to { --tkx-holo-rx: 0deg; --tkx-holo-ry: 0deg; --tkx-holo-mx: 50%; --tkx-holo-my: 50%; }\n}\n.tkx-holo-root {\n --tkx-holo-rx: 0deg;\n --tkx-holo-ry: 0deg;\n --tkx-holo-mx: 50%;\n --tkx-holo-my: 50%;\n position: relative;\n transform-style: preserve-3d;\n transform: perspective(1000px) rotateX(var(--tkx-holo-rx)) rotateY(var(--tkx-holo-ry));\n transition: transform 280ms cubic-bezier(.2,.8,.2,1);\n will-change: transform;\n isolation: isolate;\n}\n.tkx-holo-root.tkx-holo-tracking {\n transition: none;\n}\n.tkx-holo-foil {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n background:\n radial-gradient(circle at var(--tkx-holo-mx) var(--tkx-holo-my),\n rgba(255,255,255,0.32) 0%,\n rgba(255,255,255,0.08) 22%,\n transparent 55%),\n conic-gradient(from calc(var(--tkx-holo-mx) * 3.6deg) at 50% 50%,\n #ff006e, #ffbe0b, #06d6a0, #00f5d4, #3a86ff, #7b2ff7, #ff006e);\n background-size: 100% 100%, 280% 280%;\n background-position: 0 0, var(--tkx-holo-mx) var(--tkx-holo-my);\n mix-blend-mode: color-dodge;\n opacity: 0.55;\n filter: saturate(1.4) contrast(1.1);\n}\n.tkx-holo-foil.tkx-holo-foil-soft {\n mix-blend-mode: overlay;\n opacity: 0.35;\n}\n.tkx-holo-scan {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n background: repeating-linear-gradient(\n 180deg,\n rgba(255,255,255,0.06) 0px,\n rgba(255,255,255,0.06) 1px,\n transparent 1px,\n transparent 3px\n );\n mix-blend-mode: overlay;\n opacity: 0.5;\n}\n.tkx-holo-content {\n position: relative;\n z-index: 1;\n transform: translateZ(20px);\n}\n.tkx-holo-root:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: 4px;\n}\n@media (prefers-reduced-motion: reduce) {\n .tkx-holo-root, .tkx-holo-root.tkx-holo-tracking {\n transform: none !important;\n transition: none;\n }\n .tkx-holo-content { transform: none !important; }\n .tkx-holo-foil { animation: tkx-holo-shimmer 8s ease infinite; }\n}",document.head.appendChild(e)}()},[]),(0,l.useEffect)(()=>{const e=r.current;if(e&&!n&&!i)return e.addEventListener("pointermove",d),e.addEventListener("pointerleave",c),()=>{e.removeEventListener("pointermove",d),e.removeEventListener("pointerleave",c),null!=a.current&&cancelAnimationFrame(a.current)};function o(){if(!e)return;const{rx:t,ry:n,mx:o,my:r}=s.current;e.style.setProperty("--tkx-holo-rx",`${t}deg`),e.style.setProperty("--tkx-holo-ry",`${n}deg`),e.style.setProperty("--tkx-holo-mx",`${o}%`),e.style.setProperty("--tkx-holo-my",`${r}%`),a.current=null}function l(){null==a.current&&(a.current=requestAnimationFrame(o))}function d(n){const o=e.getBoundingClientRect(),r=(n.clientX-o.left)/o.width,i=(n.clientY-o.top)/o.height,a=Math.max(0,Math.min(1,r)),d=Math.max(0,Math.min(1,i));s.current={rx:(.5-d)*t*2,ry:(a-.5)*t*2,mx:100*a,my:100*d},e.classList.add("tkx-holo-tracking"),l()}function c(){s.current={rx:0,ry:0,mx:50,my:50},e.classList.remove("tkx-holo-tracking"),l()}},[t,n,i]),r}var fi=(0,l.forwardRef)(function({children:e,maxTilt:n=14,scanLines:o=!0,foilIntensity:r="strong",radius:i=16,disabled:s=!1,className:d,style:c,...p},u){const h=t.useTheme(),f=hi({maxTilt:n,disabled:s});(0,l.useEffect)(()=>{if(!u)return;const e=f.current;"function"==typeof u?u(e):u.current=e},[u,f]);const m={borderRadius:"number"==typeof i?`${i}px`:i,background:`linear-gradient(135deg, ${h.surface}cc, ${h.surfaceAlt}cc)`,border:`1px solid ${h.border}`,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:h.text,...c};return(0,a.jsxs)("div",{ref:f,className:["tkx-holo-root",d].filter(Boolean).join(" "),style:m,...p,children:["none"!==r&&(0,a.jsx)("div",{className:"tkx-holo-foil "+("soft"===r?"tkx-holo-foil-soft":""),"aria-hidden":"true"}),o&&(0,a.jsx)("div",{className:"tkx-holo-scan","aria-hidden":"true"}),(0,a.jsx)("div",{className:"tkx-holo-content",children:e})]})}),mi=(0,l.forwardRef)(function({title:e,subtitle:n,badge:o,children:r,padding:i=24,...s},d){const c=t.useTheme(),p=(0,l.useId)(),u="number"==typeof i?`${i}px`:i;return(0,a.jsx)(fi,{ref:d,role:"article","aria-labelledby":e?p:void 0,...s,style:{minHeight:200,...s.style},children:(0,a.jsxs)("div",{style:{padding:u},children:[(e||o)&&(0,a.jsxs)("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12,marginBottom:n?4:12},children:[e&&(0,a.jsx)("h3",{id:p,style:{margin:0,fontSize:20,fontWeight:700,letterSpacing:"-0.01em",color:c.text},children:e}),o]}),n&&(0,a.jsx)("p",{style:{margin:"0 0 16px",color:c.textMuted,fontSize:14},children:n}),r]})})}),gi=(0,l.forwardRef)(function({src:e,alt:n,size:o=96,initials:r,scanLines:i=!1,...l},s){const d=t.useTheme();return(0,a.jsx)(fi,{ref:s,radius:"50%",scanLines:i,...l,style:{width:o,height:o,...l.style},children:e?(0,a.jsx)("img",{src:e,alt:n,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover",display:"block"}}):(0,a.jsx)("div",{role:"img","aria-label":n,style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:.36*o,fontWeight:700,color:d.text},children:r??n.charAt(0).toUpperCase()})})}),xi={sm:"4px 10px",md:"6px 14px",lg:"8px 18px"},yi={sm:11,md:13,lg:15},bi=(0,l.forwardRef)(function({children:e,size:t="md",scanLines:n=!1,...o},r){return(0,a.jsx)(fi,{ref:r,radius:999,scanLines:n,maxTilt:6,...o,style:{display:"inline-flex",padding:xi[t],fontSize:yi[t],fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",...o.style},children:e})}),vi=(0,l.forwardRef)(function({children:e,onClick:n,isDisabled:r=!1,type:i="button",maxTilt:s=8,...d},c){const p=t.useTheme(),u=o.useReducedMotion(),h=(0,l.useRef)(null),f=hi({maxTilt:s,disabled:r});return(0,l.useEffect)(()=>{const e=h.current;e&&(f.current=e,"function"==typeof c?c(e):c&&(c.current=e))},[c,f]),(0,a.jsxs)("button",{ref:h,type:i,onClick:r?void 0:n,disabled:r,className:"tkx-holo-root",style:{position:"relative",padding:"14px 28px",fontSize:15,fontWeight:700,letterSpacing:"0.02em",color:p.text,background:`linear-gradient(135deg, ${p.surface}, ${p.surfaceAlt})`,border:`1px solid ${p.primary}55`,borderRadius:12,cursor:r?"not-allowed":"pointer",opacity:r?.5:1,minHeight:44,transformStyle:"preserve-3d",...d.style},...d,children:[(0,a.jsx)("span",{className:"tkx-holo-foil","aria-hidden":"true"}),(0,a.jsx)("span",{className:"tkx-holo-content",style:{display:"inline-block"},children:e}),!u&&!r&&(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",inset:-1,borderRadius:12,border:`1px solid ${p.primary}88`,boxShadow:`0 0 24px ${p.primary}44`,pointerEvents:"none",opacity:.6}})]})});exports.COUNTRIES=Jo,exports.FocusTrap=function({active:e,children:t,as:n="div"}){return(0,a.jsx)(n,{ref:o.useFocusTrap(e),children:t})},exports.I18nContext=r.I18nContext,exports.I18nProvider=function({locale:e="en-US",direction:t,strings:n,children:o}){const i=(0,l.useMemo)(()=>{const o=r.LOCALES[e]??r.enUS,i=n?{...o,...n}:o;return{locale:e,direction:t??(r.isRTL(e)?"rtl":"ltr"),strings:i}},[e,t,n]);return(0,a.jsx)(r.I18nContext.Provider,{value:i,children:(0,a.jsx)("div",{dir:i.direction,style:{direction:i.direction,display:"contents"},children:o})})},exports.LRUCache=t.LRUCache,exports.LiveRegion=function({politeness:e="polite",children:t,atomic:n=!0}){return(0,a.jsx)("div",{role:"status","aria-live":e,"aria-atomic":n,className:"tkx-sr-only",children:t})},exports.Quantum=t.Quantum,exports.SIZE_BORDER_RADIUS={sm:4,md:6,lg:8},exports.SIZE_FONT={sm:"0.75rem",md:"0.875rem",lg:"1rem"},exports.SIZE_HEIGHT={sm:32,md:40,lg:48},exports.SIZE_ICON={sm:14,md:16,lg:20},exports.SIZE_PADDING_X={sm:8,md:12,lg:16},exports.SIZE_PADDING_Y={sm:4,md:8,lg:12},exports.SecurityCore=n.SecurityCore,exports.Shield=n.Shield,exports.SkipNav=function({contentId:e="tkx-main-content",label:t="Skip to main content"}){return(0,a.jsx)("a",{href:`#${e}`,className:"tkx-skip-nav",children:t})},exports.TKX=t.TKX,exports.ThemeContext=t.ThemeContext,exports.ThemeProvider=t.ThemeProvider,exports.TkxAIChatBubble=function({role:e,content:o,avatar:r,name:i,timestamp:s,streaming:d=!1,confidence:c,copyable:p=!1,className:u,style:h}){const f=t.useTheme(),m="user"===e,g="system"===e,x="string"==typeof o?n.sanitizeString(o):"",[y,b]=(0,l.useState)(d?"":x),[v,w]=(0,l.useState)(!1),[k,S]=(0,l.useState)(d?"":x),C=(0,l.useRef)(0),$=(0,l.useRef)(null);if((0,l.useEffect)(()=>{if(!d||"string"!=typeof o)return void S(x);C.current=0,b(""),S("");const e=setInterval(()=>{C.current++;const t=x.slice(0,C.current);b(t),$.current&&clearTimeout($.current),$.current=setTimeout(()=>S(t),350),C.current>=x.length&&(clearInterval(e),$.current&&clearTimeout($.current),S(x))},18);return()=>{clearInterval(e),$.current&&clearTimeout($.current)}},[x,d,o]),g)return(0,a.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:(0,a.jsx)("div",{style:{padding:"6px 16px",borderRadius:999,fontSize:12,background:`${f.border}`,color:f.textMuted,fontStyle:"italic"},children:"string"==typeof o?n.sanitizeString(o):o})});const z={maxWidth:"75%",padding:"12px 16px",borderRadius:m?"18px 18px 4px 18px":"18px 18px 18px 4px",background:m?`linear-gradient(135deg, ${f.primary}, ${f.primary}cc)`:`${f.surface}`,border:m?"none":`1px solid ${f.border}`,color:m?"#fff":f.text,fontSize:14,lineHeight:1.65,boxShadow:m?`0 4px 16px -4px ${f.primary}55`:"0 2px 8px -2px rgba(0,0,0,0.2)",position:"relative",wordBreak:"break-word"};return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex gap-2"),u),style:{flexDirection:m?"row-reverse":"row",alignItems:"flex-end",...h},children:[(0,a.jsx)(ii,{src:r,name:i??(m?"You":"AI")}),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:m?"flex-end":"flex-start"},children:[(i||s)&&(0,a.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",paddingInline:4},children:[i&&(0,a.jsx)("span",{style:{fontSize:11,fontWeight:700,color:f.textMuted},children:i}),s&&(0,a.jsx)("span",{style:{fontSize:10,color:f.textMuted},children:s})]}),(0,a.jsxs)("div",{style:z,role:"article","aria-label":m?"Your message":"Assistant message",children:["string"==typeof o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{"aria-hidden":d?"true":void 0,children:d?y:n.sanitizeString(o)}),d&&y.length<x.length&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:2,height:14,background:m?"#fff":f.primary,marginLeft:2,animation:"tkx-blink 1s step-end infinite",verticalAlign:"text-bottom"}}),d&&(0,a.jsx)("span",{"aria-live":"polite","aria-atomic":"false",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:k})]}):o,p&&!m&&(0,a.jsx)("button",{onClick:()=>{navigator.clipboard?.writeText(x),w(!0),setTimeout(()=>w(!1),2e3)},title:"Copy message",style:{position:"absolute",top:8,right:8,background:"none",border:"none",cursor:"pointer",fontSize:13,color:v?"#10b981":f.textMuted,padding:"2px 4px",borderRadius:4,transition:"color 0.2s"},children:v?"✓":"⎘"})]}),!m&&void 0!==c&&(0,a.jsx)("div",{style:{paddingInline:4,width:"100%",maxWidth:240},children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,a.jsx)("div",{style:{flex:1,height:3,borderRadius:3,background:f.border,overflow:"hidden"},children:(0,a.jsx)("div",{style:{height:"100%",width:`${c}%`,background:(N=c,M=f.primary,N>=80?"#10b981":N>=55?M:N>=30?"#f59e0b":"#ef4444"),borderRadius:3,transition:"width 0.8s ease"}})}),(0,a.jsxs)("span",{style:{fontSize:10,color:f.textMuted,whiteSpace:"nowrap"},children:[c,"% confident"]})]})})]}),(0,a.jsx)("style",{children:"\n @keyframes tkx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }\n "})]});var N,M},exports.TkxAIConfidenceBar=function({value:e,label:o,showLabel:r=!0,size:i="md",animate:s=!0,className:d,style:c}){const p=t.useTheme(),u=(0,l.useRef)(null),h=Math.max(0,Math.min(100,e)),f=function(e,t){return e>=80?"#10b981":e>=55?t:e>=30?"#f59e0b":"#ef4444"}(h,p.primary),m=ri[i];(0,l.useEffect)(()=>{if(!s||!u.current)return;const e=u.current;e.style.width="0%";const t=requestAnimationFrame(()=>{e.style.transition="width 0.9s cubic-bezier(0.4, 0, 0.2, 1)",e.style.width=`${h}%`});return()=>cancelAnimationFrame(t)},[h,s]);const g="number"==typeof h?`${h.toFixed(0)}% AI confidence${o?` for ${o}`:""}`:o;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1"),d),style:c,role:"meter","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":100,"aria-label":g,children:[(o||r)&&(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[o&&(0,a.jsx)("span",{style:{fontSize:12,fontWeight:600,color:p.textMuted},children:o}),r&&(0,a.jsxs)("span",{style:{fontSize:12,fontWeight:700,color:f,marginLeft:"auto"},children:[h.toFixed(0),"%"]})]}),(0,a.jsxs)("div",{style:{height:m,borderRadius:m,background:`${p.border}`,overflow:"hidden",position:"relative"},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"tkx-ai-shimmer 2s linear infinite",pointerEvents:"none",zIndex:1}}),(0,a.jsx)("div",{ref:u,style:{height:"100%",width:s?"0%":`${h}%`,background:`linear-gradient(90deg, ${f}cc, ${f})`,borderRadius:m,boxShadow:`0 0 8px ${f}66`,transition:s?void 0:"width 0.3s ease"}})]}),(0,a.jsxs)("div",{style:{fontSize:10,color:p.textMuted,marginTop:2,display:"flex",gap:4,alignItems:"center"},children:[(0,a.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:f,display:"inline-block",flexShrink:0}}),h>=80?"High confidence":h>=55?"Moderate confidence":h>=30?"Low confidence":"Very low — review manually"]}),(0,a.jsx)("style",{children:"\n @keyframes tkx-ai-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n "})]})},exports.TkxAIThinking=function({label:e="Thinking…",steps:o,size:r="md",variant:i="dots",active:s=!0,className:d,style:c}){const p=t.useTheme(),[u,h]=(0,l.useState)(0);(0,l.useEffect)(()=>{if(!o?.length||!s)return;const e=setInterval(()=>{h(e=>(e+1)%o.length)},1800);return()=>clearInterval(e)},[o,s]);const f=p.primary,m=ci[r],g={dots:(0,a.jsx)(li,{color:f}),pulse:(0,a.jsx)(ai,{color:f}),wave:(0,a.jsx)(si,{color:f}),orbit:(0,a.jsx)(di,{color:f})}[i];return(0,a.jsxs)("div",{className:n.cx(n.tkx("inline-flex flex-col gap-2"),d),style:c,role:"status","aria-live":"polite","aria-label":s?e:"Done thinking",children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,a.jsx)("div",{style:{opacity:s?1:.35,transition:"opacity 0.3s"},children:s?g:(0,a.jsx)("div",{style:{width:20,height:20,borderRadius:"50%",background:"#10b981",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,a.jsx)("span",{style:{color:"#fff",fontSize:11,fontWeight:900},children:"✓"})})}),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[(0,a.jsx)("span",{style:{fontSize:m,fontWeight:600,color:s?p.text:p.textMuted,transition:"color 0.3s"},children:s?o?o[u]:e:"Done"}),s&&(0,a.jsx)("span",{style:{fontSize:m-2,color:p.textMuted},children:"⚛ Quantum AI · Amplitude Amplification"})]})]}),o&&o.length>1&&(0,a.jsx)("div",{style:{display:"flex",gap:4,paddingLeft:2},children:o.map((e,t)=>(0,a.jsx)("div",{style:{width:t===u?16:6,height:4,borderRadius:4,background:t===u?f:`${f}44`,transition:"all 0.3s ease"}},t))}),(0,a.jsx)("style",{children:"\n @keyframes tkx-thinking-dot {\n 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }\n 40% { transform: scale(1); opacity: 1; }\n }\n @keyframes tkx-thinking-pulse {\n 0% { transform: scale(0.6); opacity: 0.8; }\n 100% { transform: scale(2); opacity: 0; }\n }\n @keyframes tkx-thinking-wave {\n 0%, 100% { height: 6px; }\n 50% { height: 18px; }\n }\n @keyframes tkx-thinking-orbit {\n to { transform: rotate(360deg); }\n }\n "})]})},exports.TkxAadhaarInput=Ar,exports.TkxAccordion=de,exports.TkxAddressInput=mr,exports.TkxAffix=function({children:e,offsetTop:r,offsetBottom:i,onChange:s,target:d}){const c=t.useTheme(),p=o.useReducedMotion(),u=(0,l.useRef)(null),h=(0,l.useRef)(null),[f,m]=(0,l.useState)(!1),[g,x]=(0,l.useState)({width:0,height:0}),y=(0,l.useRef)(!1),b=(0,l.useMemo)(()=>n.sanitizeString("Sticky content"),[]),v=(0,l.useCallback)(()=>{const e=u.current;if(!e)return;const t=e.getBoundingClientRect(),n=function(e){if(e instanceof Window)return{top:0,bottom:e.innerHeight};const t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}(Ao(d));let o=!1;void 0!==r?o=t.top-n.top<=r:void 0!==i&&(o=n.bottom-t.bottom<=i),o!==y.current&&(y.current=o,m(o),x({width:t.width,height:t.height}),s?.(o))},[r,i,s,d]);(0,l.useEffect)(()=>{const e=Ao(d);return v(),e.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),()=>{e.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[v,d]);const w=f?{position:"fixed",zIndex:100,...void 0!==r?{top:r}:{},...void 0!==i?{bottom:i}:{},width:g.width||void 0,transition:p?"none":"box-shadow 0.2s ease",boxShadow:`0 2px 8px ${c.border}`}:{};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:u,"aria-hidden":f,style:f?{height:g.height,width:g.width}:{}}),(0,a.jsx)("div",{ref:h,role:"region","aria-label":b,className:n.tkx(f?"tkx-affixed":""),style:w,children:e})]})},exports.TkxAlert=function({variant:e,title:r,children:i,dismissible:s,onDismiss:d,icon:c,style:p,className:u}){const h=t.useTheme(),f=o.useAnnounce(),m=r?n.sanitizeString(r):void 0;(0,l.useEffect)(()=>{m&&f(m,"danger"===e||"warning"===e?"assertive":"polite")},[m,e]);const g={info:h.info,success:h.success,warning:h.warning,danger:h.danger}[e];return(0,a.jsxs)("div",{role:"danger"===e||"warning"===e?"alert":"status",className:n.tkx("flex items-start gap-3 px-4 py-3 rounded-lg border animate-fade-in font-sans",u??""),style:{backgroundColor:`${g}18`,borderColor:g,color:h.text,...p},children:[(0,a.jsx)("span",{className:n.tkx("shrink-0 mt-[1px]"),style:{color:g},children:c??z[e]}),(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[m&&(0,a.jsx)("p",{className:n.tkx("m-0 font-semibold text-sm mb-1"),children:m}),(0,a.jsx)("div",{className:n.tkx("text-sm leading-relaxed"),children:i})]}),s&&d&&(0,a.jsx)("button",{"aria-label":"Dismiss alert",onClick:d,className:n.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:h.textMuted},children:(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})},exports.TkxAnchor=function({items:e,offsetTop:r=0,getCurrentAnchor:i,onChange:s}){const d=t.useTheme(),c=o.useReducedMotion(),[p,u]=(0,l.useState)(e[0]?.key??""),h=(0,l.useRef)(!1),f=Bo(e),m=(0,l.useCallback)(()=>{if(h.current)return;let e=f[0]?.key??"";for(const t of f){const n=Fo(t.href),o=document.getElementById(n);o&&o.getBoundingClientRect().top<=r+10&&(e=t.key)}i&&(e=i(e)),e!==p&&(u(e),s?.(e))},[f,r,i,p,s]);(0,l.useEffect)(()=>(window.addEventListener("scroll",m,{passive:!0}),m(),()=>window.removeEventListener("scroll",m)),[m]);const g=(0,l.useCallback)(e=>{const t=Fo(e),n=document.getElementById(t);if(!n)return;h.current=!0;const o=n.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:o,behavior:c?"auto":"smooth"});const i=f.find(t=>t.href===e);i&&(u(i.key),s?.(i.key)),setTimeout(()=>{h.current=!1},800)},[f,r,c,s]);return(0,a.jsx)("nav",{role:"tree","aria-label":"Anchor navigation",className:n.tkx("font-sans"),style:{borderLeft:`1px solid ${d.border}`,padding:"4px 0"},children:(0,a.jsx)("ul",{role:"group",style:{margin:0,padding:0},children:e.map(e=>(0,a.jsx)(Eo,{item:e,activeKey:p,depth:0,onClick:g,theme:d,reducedMotion:c},e.key))})})},exports.TkxAppBar=function({title:e,logo:r,actions:i,navigation:s,position:d="sticky",variant:c="default",color:p="surface"}){const u=t.useTheme(),h=o.useReducedMotion(),f=function(){const[e,t]=(0,l.useState)(()=>"undefined"!=typeof window&&window.innerWidth<768);return(0,l.useEffect)(()=>{if("undefined"==typeof window)return;const e=()=>t(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),[m,g]=(0,l.useState)(!1),x=(0,l.useRef)(null),y=(0,l.useId)();o.useEscapeKey(()=>g(!1),m),(0,l.useEffect)(()=>{!f&&m&&g(!1)},[f,m]),(0,l.useEffect)(()=>{if(!m)return;const e=e=>{x.current&&!x.current.contains(e.target)&&g(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[m]);const b=(0,l.useCallback)(()=>{g(e=>!e)},[]),v="primary"===p?u.primary:u.surface,w="primary"===p?u.bg:u.text,k={default:{backgroundColor:v,borderBottom:`1px solid ${u.border}`},transparent:{backgroundColor:"transparent",borderBottom:"none"},elevated:{backgroundColor:v,boxShadow:`0 2px 8px ${u.bg}66`,borderBottom:"none"}},S="string"==typeof e?n.sanitizeString(e):e,C=h?"none":"max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease";return(0,a.jsxs)("header",{role:"banner",className:n.tkx("font-sans w-full"),style:{...{fixed:{position:"fixed",top:0,left:0,right:0,zIndex:1100},sticky:{position:"sticky",top:0,zIndex:1100},static:{position:"static"}}[d],...k[c],color:w,height:56},children:[(0,a.jsxs)("div",{ref:x,className:n.tkx("flex items-center h-full px-4"),style:{maxWidth:1440,margin:"0 auto"},children:[r&&(0,a.jsx)("div",{className:n.tkx("flex items-center shrink-0 mr-3"),"aria-hidden":"true",children:r}),S&&(0,a.jsx)("div",{className:n.tkx("text-base font-semibold shrink-0 mr-4 leading-snug"),style:{color:w},children:S}),!f&&s&&(0,a.jsx)("nav",{id:y,"aria-label":"Main navigation",className:n.tkx("flex items-center flex-1 gap-1"),children:s}),f&&(0,a.jsx)("div",{className:n.tkx("flex-1")}),i&&(0,a.jsx)("div",{className:n.tkx("flex items-center gap-2 ml-auto shrink-0"),children:i}),f&&s&&(0,a.jsx)("button",{onClick:b,"aria-expanded":m,"aria-controls":y,"aria-label":m?"Close navigation menu":"Open navigation menu",className:n.tkx("bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center","focus-visible:focus-ring"),style:{color:w},children:(0,a.jsx)(bn,{open:m})})]}),f&&s&&(0,a.jsx)("nav",{id:y,"aria-label":"Main navigation",style:{maxHeight:m?400:0,opacity:m?1:0,overflow:"hidden",transition:C,backgroundColor:u.surface,borderBottom:m?`1px solid ${u.border}`:"none"},children:(0,a.jsx)("div",{className:n.tkx("flex flex-col gap-1 px-4 py-3"),role:"menu",children:s})})]})},exports.TkxAutocomplete=function({options:e,value:i,onChange:d,onInputChange:c,placeholder:p="",label:u,isLoading:h=!1,emptyMessage:f,filterFn:m,freeSolo:g=!1,className:x,style:y}){const b=t.useTheme(),v=r.useLocale(),w=f??v.noResults,k=o.useReducedMotion(),S=(0,l.useId)(),C=(0,l.useId)(),$=(0,l.useRef)(null),z=(0,l.useRef)(null),[N,M]=(0,l.useState)(""),[I,D]=(0,l.useState)(!1),[W,L]=(0,l.useState)(-1),[R,T]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(void 0!==i){const t=e.find(e=>e.value===i);M(t?t.label:i)}},[i,e]);const A=m??an,B=(0,l.useMemo)(()=>I?e.filter(e=>A(e,N)):[],[e,N,I,A]),F=n.sanitizeString(u),E=n.sanitizeString(w);(0,l.useEffect)(()=>{if(!I||!z.current)return;const e=()=>{z.current&&T(function(e){const t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,o=t.top,r=n>=284||n>=o?"below":"above";return{top:"below"===r?t.bottom+window.scrollY+4:t.top+window.scrollY-280-4,left:t.left+window.scrollX,width:t.width,placement:r}}(z.current))};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[I]),(0,l.useEffect)(()=>{if(!I)return;const e=e=>{const t=e.target;z.current?.contains(t)||document.getElementById(C)?.contains(t)||D(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[I,C]),o.useEscapeKey(()=>D(!1),I);const j=(0,l.useCallback)(e=>{e.disabled||(M(e.label),d?.(e.value),D(!1),L(-1),$.current?.focus())},[d]);(0,l.useEffect)(()=>{if(W<0)return;const e=`${C}-opt-${W}`;document.getElementById(e)?.scrollIntoView({block:"nearest"})},[W,C]);const H=W>=0?`${C}-opt-${W}`:void 0,P=k?{}:{animation:"tkxAutoFadeIn 120ms ease forwards"},O=I&&"undefined"!=typeof document&&R?(0,s.createPortal)((0,a.jsx)("ul",{id:C,role:"listbox","aria-label":F,className:n.tkx("absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans"),style:{top:R.top,left:R.left,width:R.width,maxHeight:280,backgroundColor:b.surface,border:`1px solid ${b.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15)",...P},children:h?(0,a.jsxs)("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:n.tkx("flex items-center gap-2 px-3 py-2 text-sm"),style:{color:b.textMuted},children:[(0,a.jsx)(sn,{color:b.primary}),"Loading..."]}):0===B.length?(0,a.jsx)("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:n.tkx("px-3 py-2 text-sm text-center"),style:{color:b.textMuted},children:E}):B.map((e,t)=>{const o=t===W,r=n.sanitizeString(e.label),l=e.description?n.sanitizeString(e.description):null;return(0,a.jsxs)("li",{id:`${C}-opt-${t}`,role:"option","aria-selected":e.value===i,"aria-disabled":e.disabled||void 0,className:n.tkx("flex items-center gap-2 px-3 py-2 text-sm rounded-md cursor-pointer",e.disabled?"opacity-50 cursor-not-allowed":""),style:{backgroundColor:o?b.surfaceAlt:"transparent",color:e.disabled?b.textMuted:b.text,transition:k?"none":"background-color 100ms ease"},onMouseEnter:()=>!e.disabled&&L(t),onMouseDown:t=>{t.preventDefault(),j(e)},children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),(0,a.jsxs)("span",{className:n.tkx("flex flex-col min-w-0"),children:[(0,a.jsx)("span",{className:n.tkx("truncate"),children:r}),l&&(0,a.jsx)("span",{className:n.tkx("text-xs truncate"),style:{color:b.textMuted},children:l})]}),e.value===i&&(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:n.tkx("ml-auto flex-shrink-0"),children:(0,a.jsx)("path",{d:"M3 8l3.5 3.5L13 5",stroke:b.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},e.value)})}),document.body):null;return(0,a.jsxs)("div",{ref:z,className:n.tkx("relative font-sans",x??""),style:y,children:[(0,a.jsx)("label",{htmlFor:S,className:n.tkx("block text-sm font-medium mb-1.5"),style:{color:b.text},children:F}),(0,a.jsxs)("div",{className:n.tkx("relative flex items-center"),style:{backgroundColor:b.surface,border:`1px solid ${I?b.primary:b.border}`,borderRadius:8,transition:k?"none":"border-color 150ms ease"},children:[(0,a.jsx)("input",{ref:$,id:S,type:"text",role:"combobox","aria-expanded":I,"aria-controls":C,"aria-activedescendant":H,"aria-autocomplete":"list","aria-label":F,value:N,placeholder:p,onChange:e=>{const t=e.target.value;M(t),c?.(t),I||D(!0),L(-1),g&&d?.(t)},onFocus:()=>D(!0),onKeyDown:e=>{if(I||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)switch(e.key){case"ArrowDown":e.preventDefault(),L(e=>{let t=e+1;for(;t<B.length&&B[t].disabled;)t++;return t<B.length?t:e});break;case"ArrowUp":e.preventDefault(),L(e=>{let t=e-1;for(;t>=0&&B[t].disabled;)t--;return t>=0?t:e});break;case"Enter":e.preventDefault(),W>=0&&W<B.length?j(B[W]):g&&N&&(d?.(N),D(!1));break;case"Escape":D(!1),L(-1)}else D(!0)},className:n.tkx("w-full bg-transparent border-none outline-none text-sm py-2.5 px-3","placeholder:opacity-50"),style:{color:b.text}}),h&&(0,a.jsx)("span",{className:n.tkx("pr-3"),children:(0,a.jsx)(sn,{color:b.primary})})]}),O,I&&!k&&(0,a.jsx)("style",{children:"\n @keyframes tkxAutoFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})},exports.TkxAvatar=F,exports.TkxBadge=v,exports.TkxBillingCycleToggle=function({value:e,onChange:n,annualSavingsLabel:o,className:r,style:i}){const l=t.useTheme(),s={display:"inline-flex",alignItems:"center",gap:8,padding:4,border:`1px solid ${l.border}`,borderRadius:999,background:l.surface,...i},d=e=>({padding:"6px 16px",borderRadius:999,fontSize:13,fontWeight:600,background:e?l.primary:"transparent",color:e?l.bg:l.text,border:"none",cursor:"pointer",transition:"background 0.15s, color 0.15s",display:"inline-flex",alignItems:"center",gap:6});return(0,a.jsxs)("div",{role:"radiogroup","aria-label":"Billing cycle",className:r,style:s,children:[(0,a.jsx)("button",{type:"button",role:"radio","aria-checked":"monthly"===e,onClick:()=>n("monthly"),style:d("monthly"===e),children:"Monthly"}),(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":"annual"===e,onClick:()=>n("annual"),style:d("annual"===e),children:["Annual",o&&(0,a.jsx)("span",{style:{fontSize:10,padding:"2px 6px",borderRadius:4,background:"annual"===e?l.bg:l.success,color:"annual"===e?l.success:l.bg,fontWeight:700},children:o})]})]})},exports.TkxBottomNav=function({items:e,activeId:r,onChange:i,showLabels:s=!0}){const d=t.useTheme(),c=o.useReducedMotion(),p=(0,l.useRef)(null);(0,l.useEffect)(()=>{!function(){if(vn||"undefined"==typeof document)return;vn=!0;const e=document.createElement("style");e.id="tkx-bottom-nav-kf",e.textContent="\n @keyframes tkx-bottom-nav-pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.15); }\n 100% { transform: scale(1); }\n }\n ",document.head.appendChild(e)}()},[]);const u=e.slice(0,5),h=(0,l.useCallback)(e=>{i?.(e)},[i]),f=(0,l.useCallback)(e=>{const t=p.current;if(!t)return;const n=Array.from(t.querySelectorAll('[role="tab"]')),o=n.findIndex(e=>e===document.activeElement);if(-1===o)return;let r=o;"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),r=(o+1)%n.length):"ArrowLeft"===e.key||"ArrowUp"===e.key?(e.preventDefault(),r=(o-1+n.length)%n.length):"Home"===e.key?(e.preventDefault(),r=0):"End"===e.key&&(e.preventDefault(),r=n.length-1),r!==o&&(n[r].focus(),h(u[r].id))},[h,u]),m=c?"none":"color 200ms ease, transform 150ms ease";return(0,a.jsx)("nav",{ref:p,role:"navigation","aria-label":"Bottom navigation",className:n.tkx("fixed bottom-0 left-0 right-0 z-[1000] font-sans"),style:{height:56,backgroundColor:d.surface,borderTop:`1px solid ${d.border}`,boxShadow:`0 -2px 12px ${d.bg}44`},children:(0,a.jsx)("div",{role:"tablist","aria-label":"Navigation tabs",className:n.tkx("flex items-center justify-around h-full"),onKeyDown:f,children:u.map(e=>{const t=e.id===r,o=n.sanitizeString(e.label),i=t?d.primary:d.textMuted;return(0,a.jsxs)("button",{role:"tab","aria-selected":t,"aria-label":o,tabIndex:t?0:-1,onClick:()=>h(e.id),className:n.tkx("flex flex-col items-center justify-center gap-0.5","bg-transparent border-none cursor-pointer p-1","flex-1 h-full relative","focus-visible:focus-ring"),style:{color:i,transition:m,outline:"none"},children:[t&&(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:"25%",right:"25%",height:3,borderRadius:"0 0 3px 3px",backgroundColor:d.primary,transition:c?"none":"width 200ms ease"}}),(0,a.jsxs)("div",{className:n.tkx("relative flex items-center justify-center"),style:{animation:t&&!c?"tkx-bottom-nav-pulse 300ms ease-out":"none"},children:[e.icon,void 0!==e.badge&&e.badge>0&&(0,a.jsx)("span",{"aria-label":`${e.badge} notifications`,className:n.tkx("absolute flex items-center justify-center","text-[10px] font-bold leading-none rounded-full"),style:{top:-4,right:-8,minWidth:16,height:16,padding:"0 4px",backgroundColor:d.danger,color:d.bg},children:e.badge>99?"99+":e.badge})]}),s&&(0,a.jsx)("span",{className:n.tkx("text-[10px] leading-tight mt-0.5"),style:{fontWeight:t?600:400,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o})]},e.id)})})})},exports.TkxBreadcrumb=function({items:e,separator:i,maxItems:s,onNavigate:d,className:c,style:p}){const u=t.useTheme(),h=r.useLocale(),f=o.useReducedMotion(),m=void 0!==s&&s>1&&e.length>s,g=(0,l.useCallback)(()=>{if(!m||!s)return e.map((e,t)=>({item:e,originalIndex:t}));const t=Math.ceil((s-1)/2),n=s-1-t,o=e.slice(0,t).map((e,t)=>({item:e,originalIndex:t})),r=e.slice(e.length-n).map((t,o)=>({item:t,originalIndex:e.length-n+o}));return o.concat(r)},[e,s,m])(),x=m&&s?Math.ceil((s-1)/2):-1,y=(e,t)=>{d?.(e,t)},b=f?{}:{transition:"color 150ms ease, background-color 150ms ease"},v=e=>(0,a.jsx)("li",{role:"presentation","aria-hidden":"true",className:n.tkx("flex items-center mx-1.5"),children:i??(0,a.jsx)(rn,{color:u.textMuted})},e),w=(e,t,o)=>{const r=n.sanitizeString(e.label);if(o)return(0,a.jsx)("li",{children:(0,a.jsxs)("span",{"aria-current":"page",className:n.tkx("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:u.text},children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),r]})},`item-${t}`);const i=!!e.href,l={color:u.textMuted,textDecoration:"none",...b},s={onMouseEnter:e=>{e.currentTarget.style.color=u.primary},onMouseLeave:e=>{e.currentTarget.style.color=u.textMuted}},c=(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),r]});return i?(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:e.href,onClick:n=>{d&&(n.preventDefault(),y(e,t))},className:n.tkx("inline-flex items-center gap-1.5 text-sm rounded","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:{...l,focusRingColor:u.primary},...s,children:c})},`item-${t}`):(0,a.jsx)("li",{children:(0,a.jsx)("button",{type:"button",onClick:()=>y(e,t),onKeyDown:n=>((e,t,n)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),y(t,n))})(n,e,t),className:n.tkx("inline-flex items-center gap-1.5 text-sm rounded","border-none bg-transparent cursor-pointer p-0","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:l,...s,children:c})},`item-${t}`)},k=[];let S=!1;for(let t=0;t<g.length;t++){const{item:n,originalIndex:o}=g[t],r=o===e.length-1;m&&!S&&t===x&&(k.length>0&&k.push(v("sep-ellipsis-before")),k.push((0,a.jsx)("li",{role:"presentation",children:(0,a.jsx)(ln,{onClick:()=>{},bgColor:u.surfaceAlt,hoverColor:u.surface,textColor:u.textMuted,label:h.showHiddenItems??"Show hidden breadcrumb items"})},"ellipsis")),S=!0),k.length>0&&null!==k[k.length-1]&&k.push(v(`sep-${o}`)),k.push(w(n,o,r))}return(0,a.jsx)("nav",{"aria-label":h.breadcrumb??"Breadcrumb",className:n.tkx("font-sans",c??""),style:{...p},children:(0,a.jsx)("ol",{role:"list",className:n.tkx("flex items-center flex-wrap list-none m-0 p-0"),children:k})})},exports.TkxButton=f,exports.TkxCalendarLunar=Mr,exports.TkxCaptcha=Yo,exports.TkxCard=g,exports.TkxCardBody=function({children:e,className:t,...o}){return(0,a.jsx)("div",{className:n.cx(n.tkx(""),t),...o,children:e})},exports.TkxCardFooter=function({children:e,className:o,style:r,...i}){const l=t.useTheme();return(0,a.jsx)("div",{className:n.cx(n.tkx("flex items-center justify-end gap-2 mt-4 pt-4"),o),style:{borderTop:`1px solid ${l.border}`,...r},...i,children:e})},exports.TkxCardHeader=function({title:e,subtitle:o,action:r,children:i,className:l,...s}){const d=t.useTheme();return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex justify-between items-start mb-4"),l),...s,children:[(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[e&&(0,a.jsx)("h3",{className:n.tkx("text-base font-semibold m-0"),style:{color:d.text},children:e}),o&&(0,a.jsx)("p",{className:n.tkx("text-sm mt-1 mb-0"),style:{color:d.textMuted},children:o}),i]}),r&&(0,a.jsx)("div",{className:n.tkx("ml-3 shrink-0"),children:r})]})},exports.TkxCarousel=on,exports.TkxCascader=function({options:e,value:r=[],onChange:i,placeholder:d="Select...",label:c,multiple:p=!1}){const u=t.useTheme(),h=o.useReducedMotion(),f=(0,l.useRef)(null),m=(0,l.useRef)(null),[g,x]=(0,l.useState)(!1),[y,b]=(0,l.useState)(r),[v,w]=(0,l.useState)({top:0,left:0,width:0}),k=c?n.sanitizeString(c):void 0,S=n.sanitizeString(d),C=r.length>0?function(e,t){return jo(e,t).map(e=>n.sanitizeString(e.label)).join(" / ")}(e,r):"";(0,l.useEffect)(()=>{if(!g||!f.current)return;const e=f.current.getBoundingClientRect();w({top:e.bottom+4+window.scrollY,left:e.left+window.scrollX,width:Math.max(e.width,200)})},[g]),(0,l.useEffect)(()=>{if(!g)return;const e=e=>{f.current?.contains(e.target)||m.current?.contains(e.target)||x(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]);const $=(0,l.useCallback)((t,n)=>{if(n.disabled)return;const o=[...y.slice(0,t),n.value];if(b(o),!n.children?.length){const t=jo(e,o);i?.(o,t),p||x(!1)}},[y,e,i,p]),z=(0,l.useCallback)(e=>{"Escape"===e.key?(x(!1),f.current?.focus()):"Enter"!==e.key&&" "!==e.key||g||(e.preventDefault(),x(!0))},[g]),N=function(e,t){const n=[e];let o=e;for(const r of t){const e=o.find(e=>e.value===r);if(!e?.children?.length)break;n.push(e.children),o=e.children}return n}(e,y),M=g?(0,s.createPortal)((0,a.jsx)("div",{ref:m,role:"tree","aria-label":k??"Cascader options",className:n.tkx("flex rounded-lg border overflow-hidden"),style:{position:"absolute",zIndex:9999,top:v.top,left:v.left,backgroundColor:u.surface,borderColor:u.border,boxShadow:`0 4px 16px ${u.bg}80`,animation:h?"none":"tkxFadeIn 0.15s ease"},children:N.map((e,t)=>(0,a.jsx)("ul",{role:"group",className:n.tkx("m-0 p-0 overflow-auto"),style:{listStyle:"none",minWidth:160,maxHeight:260,borderRight:t<N.length-1?`1px solid ${u.border}`:"none"},children:e.map(e=>{const o=y[t]===e.value,r=n.sanitizeString(e.label);return(0,a.jsxs)("li",{role:"treeitem","aria-selected":o,"aria-disabled":e.disabled||void 0,"aria-expanded":e.children?.length?o:void 0,className:n.tkx("flex items-center justify-between px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:o?u.surfaceAlt:"transparent",color:e.disabled?u.textMuted:u.text,opacity:e.disabled?.5:1,cursor:e.disabled?"not-allowed":"pointer"},onClick:()=>$(t,e),onMouseEnter:()=>{e.disabled||b(n=>[...n.slice(0,t),e.value])},children:[(0,a.jsx)("span",{children:r}),e.children&&e.children.length>0&&(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:u.textMuted,flexShrink:0},children:(0,a.jsx)("path",{d:"M10 6l6 6-6 6V6z"})})]},e.value)})},t))}),document.body):null;return(0,a.jsxs)("div",{className:n.tkx("relative font-sans"),onKeyDown:z,children:[k&&(0,a.jsx)("label",{className:n.tkx("block text-sm font-medium mb-1"),style:{color:u.text},children:k}),(0,a.jsxs)("button",{ref:f,type:"button",role:"combobox","aria-expanded":g,"aria-haspopup":"tree","aria-label":k??"Cascader",className:n.tkx("w-full flex items-center justify-between rounded-lg border px-3 py-2 text-sm cursor-pointer"),style:{backgroundColor:u.surface,borderColor:g?u.primary:u.border,color:C?u.text:u.textMuted,outline:"none",minHeight:38,textAlign:"left"},onClick:()=>x(e=>!e),children:[(0,a.jsx)("span",{className:n.tkx("truncate"),children:C||S}),(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:u.textMuted,transform:g?"rotate(180deg)":"rotate(0deg)",transition:h?"none":"transform 0.2s ease",flexShrink:0},children:(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7z"})})]}),M]})},exports.TkxChat=function({messages:e,onSend:r,isLoading:i=!1,placeholder:s="Type a message…",maxLength:d,showTimestamps:c=!1,avatarUser:p,avatarAssistant:u,height:h=480,inputPosition:f="bottom"}){const m=t.useTheme(),g=o.useReducedMotion(),[x,y]=(0,l.useState)(""),b=(0,l.useRef)(null),v=(0,l.useRef)(null);(0,l.useEffect)(()=>{!function(){if(qe||"undefined"==typeof document)return;qe=!0;const e=document.createElement("style");e.textContent="\n @keyframes tkx-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }\n @keyframes tkx-bounce { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }\n .tkx-cursor::after { content:'▋'; display:inline-block; animation:tkx-blink 1s step-start infinite; margin-left:1px; }\n .tkx-dot1 { animation:tkx-bounce 1s ease-in-out infinite; }\n .tkx-dot2 { animation:tkx-bounce 1s ease-in-out 0.2s infinite; }\n .tkx-dot3 { animation:tkx-bounce 1s ease-in-out 0.4s infinite; }\n ",document.head.appendChild(e)}()},[]),(0,l.useEffect)(()=>{const e=b.current;e&&e.scrollTo({top:e.scrollHeight,behavior:g?"auto":"smooth"})},[e,i,g]);const w=(0,l.useCallback)(()=>{const e=x.trim();e&&r&&(r(e),y(""),v.current&&(v.current.style.height="auto"))},[x,r]),k=(0,l.useCallback)(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),w())},[w]),S=(0,l.useCallback)(e=>{y(d?e.target.value.slice(0,d):e.target.value);const t=v.current;if(t){t.style.height="auto";const e=120;t.style.height=`${Math.min(t.scrollHeight,e)}px`}},[d]),C=x.trim().length>0&&!i,$="number"==typeof h?`${h}px`:h,z="floating"===f,N=(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-1 p-3"),style:z?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:m.surface,border:`1px solid ${m.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${m.border}`,backgroundColor:m.surface},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-end gap-2"),children:[(0,a.jsx)("textarea",{ref:v,rows:1,value:x,onChange:S,onKeyDown:k,placeholder:n.sanitizeString(s),"aria-label":"Message input","aria-multiline":"true",disabled:i,className:n.tkx("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:m.text,caretColor:m.primary,minHeight:32,maxHeight:120}}),(0,a.jsx)("button",{onClick:w,disabled:!C,"aria-label":"Send message",className:n.tkx("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!g&&"transition-opacity duration-150",C?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:m.primary,color:m.bg},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z",fill:"currentColor"})})})]}),d&&(0,a.jsxs)("div",{className:n.tkx("text-right text-[10px]"),style:{color:m.textMuted},children:[x.length,"/",d]})]});return(0,a.jsxs)("div",{className:n.tkx("flex flex-col overflow-hidden rounded-2xl"),style:{height:$,backgroundColor:m.bg,border:`1px solid ${m.border}`,position:"relative"},children:[(0,a.jsx)("div",{ref:b,role:"log","aria-live":"polite","aria-label":"Chat messages",className:n.tkx("flex-1 overflow-y-auto p-4"),style:{paddingBottom:z?80:void 0},children:(0,a.jsxs)("div",{role:"list",children:[e.map(e=>(0,a.jsx)(Ge,{message:e,showTimestamp:c,avatarUser:p,avatarAssistant:u},e.id)),i&&(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex gap-2 mb-4"),children:[(0,a.jsx)("div",{className:n.tkx("w-8 h-8 shrink-0")}),(0,a.jsx)(_e,{})]})]})}),N]})},exports.TkxChatBubble=Ge,exports.TkxCheckbox=U,exports.TkxCheckout=Ir,exports.TkxClock=vt,exports.TkxCol=po,exports.TkxColorPicker=function({value:e,defaultValue:n="#3b82f6",onChange:o,format:r="hex",showAlpha:i=!1,presets:d=jt,disabled:c=!1,size:p="md",placeholder:u,label:h,style:f}){const m=t.useTheme(),g=(0,l.useRef)(null),x=(0,l.useRef)(null),[y,b]=(0,l.useState)(!1),v=void 0!==e,[w,k]=(0,l.useState)(v&&e||n),S=v?e||n:w,[C,$]=(0,l.useState)(1),[z,N]=(0,l.useState)(S),[M,I]=(0,l.useState)({top:0,left:0}),[D,W,L]=Rt(Ft(S)?S:n);Math.round(L+W/100*Math.min(L/100,1-L/100)*100);const R=(0,l.useCallback)((e,t=C)=>{Ft(e)&&(N(e),v||k(e),o?.(Et(e,t,r),r))},[C,v,r,o]);(0,l.useEffect)(()=>{v&&e&&Ft(e)&&N(e)},[v,e]),(0,l.useEffect)(()=>{if(!y)return;const e=e=>{x.current&&!x.current.contains(e.target)&&g.current&&!g.current.contains(e.target)&&b(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[y]),(0,l.useEffect)(()=>{if(!y)return;const e=e=>{"Escape"===e.key&&b(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[y]);const T=e=>{$(e),o?.(Et(S,e,r),r)},A={sm:28,md:34,lg:40}[p],[B,F,E]=At(Ft(S)?S:n),j={display:"inline-flex",alignItems:"center",gap:"8px",height:`${A}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${m.border}`,backgroundColor:m.surface,cursor:c?"not-allowed":"pointer",opacity:c?.5:1,color:m.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...f},H={width:A-8+"px",height:A-8+"px",borderRadius:"4px",backgroundColor:`rgba(${B},${F},${E},${C})`,border:`1px solid ${m.border}`,flexShrink:0},P={position:"absolute",top:M.top,left:M.left,zIndex:9999,width:"260px",backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},O={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},V={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},K=e=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:e,border:e.toLowerCase()===S.toLowerCase()?`2px solid ${m.primary}`:`1px solid ${m.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});return(0,a.jsxs)(a.Fragment,{children:[h&&(0,a.jsx)("label",{style:{display:"block",fontSize:"13px",color:m.text,marginBottom:"6px",fontWeight:500},children:h}),(0,a.jsxs)("button",{ref:g,type:"button",style:j,onClick:()=>{if(c)return;const e=g.current;if(!e)return;const t=e.getBoundingClientRect();I({top:(window.innerHeight-t.bottom>320?t.bottom+6:t.top-326)+window.scrollY,left:t.left+window.scrollX}),b(!0)},disabled:c,"aria-label":`Color picker, current color ${S}`,"aria-haspopup":"dialog","aria-expanded":y,children:[(0,a.jsx)("div",{style:H}),(0,a.jsx)("span",{style:{fontFamily:"monospace",fontSize:"12px",color:m.textMuted},children:u??Et(Ft(S)?S:n,C,r)})]}),y&&(0,s.createPortal)((0,a.jsxs)("div",{ref:x,style:P,role:"dialog","aria-label":"Color picker",children:[(0,a.jsx)(Ht,{hue:D,sat:W,bright:L,onChange:(e,t)=>{const n=t/100,o=n*(1-e/100/2),r=0===o||1===o?0:(n-o)/Math.min(o,1-o);R(Tt(D,Math.round(100*r),Math.round(100*o)))}}),(0,a.jsx)(Pt,{hue:D,onChange:e=>{R(Tt(e,W,L))}}),i&&(0,a.jsx)(Ot,{alpha:C,hex:Ft(S)?S:n,onChange:T}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,a.jsx)("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${B},${F},${E},${C})`,border:`1px solid ${m.border}`}}),(0,a.jsx)("input",{style:O,value:z,onChange:e=>{const t=e.target.value;N(t),Ft(t)&&R(t)},maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(e=>(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[(0,a.jsx)("input",{style:V,type:"number",min:0,max:255,value:"r"===e?B:"g"===e?F:E,onChange:t=>((e,t)=>{const n=Math.max(0,Math.min(255,parseInt(t)||0)),[o,r,i]=At(S);R("r"===e?Bt(n,r,i):"g"===e?Bt(o,n,i):Bt(o,r,n))})(e,t.target.value),"aria-label":`${e.toUpperCase()} channel`}),(0,a.jsx)("span",{style:{fontSize:"10px",color:m.textMuted,textTransform:"uppercase"},children:e})]},e)),i&&(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[(0,a.jsx)("input",{style:V,type:"number",min:0,max:100,value:Math.round(100*C),onChange:e=>T(Math.max(0,Math.min(1,parseInt(e.target.value)/100||0))),"aria-label":"Alpha channel"}),(0,a.jsx)("span",{style:{fontSize:"10px",color:m.textMuted},children:"A%"})]})]}),d.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontSize:"11px",color:m.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),(0,a.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:d.map(e=>(0,a.jsx)("button",{type:"button",style:K(e),onClick:()=>R(e),"aria-label":`Select color ${e}`,onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.15)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"}},e))})]})]}),document.body)]})},exports.TkxCommand=tn,exports.TkxConfetti=vr,exports.TkxConfigProvider=ho,exports.TkxContent=oo,exports.TkxCountdown=function({title:e,value:o,format:r="HH:mm:ss",onFinish:i,prefix:a,suffix:s,style:d}){const c=t.useTheme(),p=n.sanitizeString(e),u=(0,l.useRef)(i);u.current=i;const h=(0,l.useRef)(!1),[f,m]=(0,l.useState)(()=>Math.max(0,o-Date.now()));(0,l.useEffect)(()=>{h.current=!1;const e=()=>{const e=Math.max(0,o-Date.now());m(e),e<=0&&!h.current&&(h.current=!0,u.current?.())};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[o]);const g=function(e,t){if(e<=0)return t.replace(/DD?/g,"0").replace(/HH?/g,"00").replace(/mm?/g,"00").replace(/ss?/g,"00");const n=Math.floor(e/1e3),o=Math.floor(n/86400),r=Math.floor(n%86400/3600),i=Math.floor(n%3600/60),l=n%60,a=e=>String(e).padStart(2,"0");return t.replace(/DD/g,a(o)).replace(/D/g,String(o)).replace(/HH/g,a(r)).replace(/H/g,String(r)).replace(/mm/g,a(i)).replace(/m/g,String(i)).replace(/ss/g,a(l)).replace(/s/g,String(l))}(f,r);return(0,l.createElement)("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...d}},(0,l.createElement)("div",{style:{color:c.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},p),(0,l.createElement)("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:f<=0?c.danger:c.text,fontVariantNumeric:"tabular-nums"}},a&&(0,l.createElement)("span",{style:{fontSize:"0.75em",fontWeight:400}},a),(0,l.createElement)("span",null,g),s&&(0,l.createElement)("span",{style:{fontSize:"0.6em",fontWeight:400,color:c.textMuted}},s)))},exports.TkxCurrencyInput=xr,exports.TkxDataGrid=function({columns:e,data:i,rowKey:s,selectable:d=!1,selectedRows:c=[],onSelectionChange:p,sortable:u=!1,onSort:h,loading:f=!1,emptyMessage:m,stickyHeader:g=!1,striped:x=!1,bordered:y=!1,compact:b=!1,maxHeight:v,onRowClick:w,virtualScroll:k,rowHeight:S=40,showFilters:C=!1,filterValues:$,onFilterChange:z,pageSize:N=0,showExport:M=!1,exportFileName:I="export",onLoadMore:D,hasMore:W,loadingMore:L=!1,loadMoreThreshold:R=200}){const A=t.useTheme(),B=r.useLocale(),F=m??B.noRows??B.noData??"No data to display",E=o.useReducedMotion(),j=(0,l.useId)(),[H,P]=(0,l.useState)(null),[O,V]=(0,l.useState)("asc"),K=(0,l.useCallback)(e=>{const t=H===e&&"asc"===O?"desc":"asc";P(e),V(t),h?.(e,t)},[H,O,h]),U=(0,l.useMemo)(()=>h||!H?i:[...i].sort((e,t)=>{const n=function(e,t){return null==e&&null==t?0:null==e?1:null==t?-1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}(Nn(e,H),Nn(t,H));return"asc"===O?n:-n}),[i,H,O,h]),[Y,q]=(0,l.useState)({}),X=$??Y,Z=(0,l.useCallback)((e,t)=>{z?z(e,t):q(n=>({...n,[e]:t}))},[z]),_=(0,l.useMemo)(()=>{const e=Object.entries(X).filter(([,e])=>""!==e.trim());return 0===e.length?U:U.filter(t=>e.every(([e,n])=>{const o=Nn(t,e);return String(o??"").toLowerCase().includes(n.toLowerCase())}))},[U,X]),[G,J]=(0,l.useState)(1),Q=N>0,ee=_.length,te=Q?Math.max(1,Math.ceil(ee/N)):1;(0,l.useEffect)(()=>{J(1)},[X,H,O]);const ne=(0,l.useMemo)(()=>Q?_.slice((G-1)*N,G*N):_,[_,Q,G,N]),oe=void 0!==k?k:!Q&&void 0!==v&&ne.length>=50,re=(0,l.useRef)(null),[ie,le]=(0,l.useState)(0),[ae,se]=(0,l.useState)(0),de=(0,l.useCallback)(()=>{re.current&&le(re.current.scrollTop)},[]);(0,l.useEffect)(()=>{if(!oe||!re.current)return;const e=re.current;se(e.clientHeight);const t=new ResizeObserver(()=>se(e.clientHeight));return t.observe(e),()=>t.disconnect()},[oe]),ne.length;const ce=oe?Math.max(0,Math.floor(ie/S)-10):0,pe=oe?Math.min(ne.length,Math.ceil((ie+ae)/S)+10):ne.length,ue=oe?ne.slice(ce,pe):ne,he=ce*S,fe=(0,l.useRef)(null),me=(0,l.useRef)(!1);(0,l.useEffect)(()=>{me.current=!1},[i.length]),(0,l.useEffect)(()=>{if(!D)return;const e=fe.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!me.current&&!1!==W&&(me.current=!0,D())},{root:re.current,rootMargin:`0px 0px ${R}px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[D,W,R]);const ge=(0,l.useMemo)(()=>new Set(c),[c]),xe=(0,l.useMemo)(()=>_.map(e=>zn(e,s)),[_,s]),ye=xe.length>0&&xe.every(e=>ge.has(e)),be=xe.some(e=>ge.has(e)),ve=(0,l.useCallback)(()=>{p?.(ye?[]:xe)},[ye,xe,p]),we=(0,l.useCallback)(e=>{const t=ge.has(e)?c.filter(t=>t!==e):[...c,e];p?.(t)},[ge,c,p]),[ke,Se]=(0,l.useState)({}),Ce=(0,l.useRef)(null),$e=(0,l.useCallback)((e,t)=>{t.preventDefault(),t.stopPropagation();const n=t.target.closest("th");if(!n)return;const o=ke[e]||n.getBoundingClientRect().width;Ce.current={key:e,startX:t.clientX,startWidth:o};const r=e=>{if(!Ce.current)return;const t=Math.max(50,Ce.current.startWidth+e.clientX-Ce.current.startX);Se(e=>({...e,[Ce.current.key]:t}))},i=()=>{Ce.current=null,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)},[ke]),ze=(0,l.useCallback)(()=>{const t=[e.map(e=>Mn(e.header)).join(","),..._.map(t=>e.map(e=>Mn(Nn(t,e.key))).join(","))].join("\n"),n=new Blob([t],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download=`${I}.csv`,r.click(),URL.revokeObjectURL(o)},[e,_,I]),Ne=b?"4px":"8px",Me=b?"8px":"12px",Ie=e=>{const t=ke[e.key]||e.width;return{width:null!=t?t:void 0,minWidth:null!=t?t:80,textAlign:e.align??"left",padding:`${Ne} ${Me}`}},De=y?`1px solid ${A.border}`:"none",We=n.sanitizeString(F),Le=e.length+(d?1:0),Re=e.some(e=>e.filterable);return(0,a.jsxs)("div",{role:"grid","aria-label":"Data grid","aria-rowcount":ee,id:j,className:n.tkx("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${A.border}`,backgroundColor:A.bg},children:[(0,a.jsx)(Dn,{label:"data grid",showExport:M,onExport:ze,totalRows:ee,selectedCount:c.length,theme:A}),(0,a.jsxs)("div",{ref:re,onScroll:oe?de:void 0,style:{maxHeight:v??"none",overflowX:"auto",overflowY:v?"auto":"visible"},children:[(0,a.jsxs)("table",{className:n.tkx("w-full"),style:{borderCollapse:"separate",borderSpacing:0,tableLayout:"auto"},children:[(0,a.jsxs)("thead",{children:[(0,a.jsxs)("tr",{role:"row",children:[d&&(0,a.jsx)("th",{scope:"col",role:"columnheader",style:{position:g?"sticky":"static",top:0,zIndex:2,backgroundColor:A.surface,borderBottom:`2px solid ${A.border}`,borderRight:De,padding:`${Ne} ${Me}`,width:40,textAlign:"center"},children:(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},children:[(0,a.jsx)("input",{type:"checkbox",checked:ye,ref:e=>{e&&(e.indeterminate=be&&!ye)},onChange:ve,"aria-label":ye?"Deselect all rows":"Select all rows",style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),(0,a.jsx)($n,{checked:ye,indeterminate:be&&!ye})]})}),e.map(e=>{const t=(e.sortable??u)&&!1!==e.sortable,o=H===e.key,r=n.sanitizeString(e.header);return(0,a.jsx)("th",{scope:"col",role:"columnheader","aria-sort":o?"asc"===O?"ascending":"descending":t?"none":void 0,className:n.tkx("text-xs font-semibold uppercase tracking-wider"),style:{...Ie(e),position:g?"sticky":"static",top:0,zIndex:2,backgroundColor:A.surface,color:A.textMuted,borderBottom:`2px solid ${A.border}`,borderRight:De,cursor:t?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:E?"none":"background-color 150ms ease"},onClick:t?()=>K(e.key):void 0,onKeyDown:t?t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),K(e.key))}:void 0,tabIndex:t?0:void 0,children:(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1"),style:{position:"relative"},children:[e.renderHeader?e.renderHeader(e):r,t&&(0,a.jsx)(Cn,{direction:o?O:null}),e.resizable&&(0,a.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${r}`,className:n.tkx("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:t=>$e(e.key,t)})]})},e.key)})]}),(C||Re)&&(0,a.jsxs)("tr",{role:"row","aria-label":"Column filters",children:[d&&(0,a.jsx)("th",{scope:"col",style:{backgroundColor:A.surfaceAlt,borderBottom:`1px solid ${A.border}`,borderRight:De,padding:`4px ${Me}`,width:40}}),e.map(e=>(0,a.jsx)("th",{scope:"col",style:{backgroundColor:A.surfaceAlt,borderBottom:`1px solid ${A.border}`,borderRight:De,padding:`4px ${Me}`},children:(e.filterable||C)&&(0,a.jsx)("input",{type:"text",value:X[e.key]??"",onChange:t=>Z(e.key,t.target.value),placeholder:`${B.filterPlaceholder.replace(/[.…]+$/,"")} ${e.header}…`,"aria-label":`Filter by ${e.header}`,style:{width:"100%",padding:"3px 8px",fontSize:12,borderRadius:4,border:`1px solid ${A.border}`,backgroundColor:A.bg,color:A.text,outline:"none"}})},e.key))]})]}),f&&(0,a.jsx)(In,{colCount:Le}),!f&&(0,a.jsx)("tbody",{children:0===ne.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:Le,className:n.tkx("text-center py-10"),style:{color:A.textMuted},children:We})}):(0,a.jsxs)(a.Fragment,{children:[oe&&he>0&&(0,a.jsx)("tr",{"aria-hidden":"true",children:(0,a.jsx)("td",{colSpan:Le,style:{height:he,padding:0,border:"none"}})}),ue.map((t,o)=>{const r=ce+o,i=zn(t,s),l=ge.has(i),c=x&&r%2==1;let p="transparent";return l?p=`${A.primary}22`:c&&(p=A.surfaceAlt),(0,a.jsxs)("tr",{role:"row","aria-rowindex":r+1,"aria-selected":d?l:void 0,onClick:w?()=>w(t):void 0,onKeyDown:w?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w(t))}:void 0,tabIndex:w?0:void 0,className:n.tkx(w?"cursor-pointer":""),style:{backgroundColor:p,transition:E?"none":"background-color 120ms ease",...oe?{height:S,boxSizing:"border-box"}:{}},onMouseEnter:w?e=>{e.currentTarget.style.backgroundColor=l?`${A.primary}30`:A.surfaceAlt}:void 0,onMouseLeave:w?e=>{e.currentTarget.style.backgroundColor=p}:void 0,children:[d&&(0,a.jsx)("td",{role:"gridcell",style:{borderBottom:`1px solid ${A.border}`,borderRight:De,padding:`${Ne} ${Me}`,textAlign:"center",width:40},children:(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("input",{type:"checkbox",checked:l,onChange:()=>we(i),"aria-label":l?`Deselect row ${i}`:`Select row ${i}`,style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),(0,a.jsx)($n,{checked:l})]})}),e.map(e=>{const o=Nn(t,e.key),r=e.renderCell?e.renderCell(o,t):"string"==typeof o?n.sanitizeString(o):String(o??"");return(0,a.jsx)("td",{role:"gridcell",className:n.tkx("text-sm"),style:{...Ie(e),borderBottom:`1px solid ${A.border}`,borderRight:De,color:A.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r},e.key)})]},i)}),oe&&pe<ne.length&&(0,a.jsx)("tr",{"aria-hidden":"true",children:(0,a.jsx)("td",{colSpan:Le,style:{height:(ne.length-pe)*S,padding:0,border:"none"}})})]})})]}),(W||L)&&(0,a.jsx)("div",{ref:fe,style:{height:1,width:"100%"},children:L&&(0,a.jsx)("table",{style:{width:"100%",borderCollapse:"collapse"},children:(0,a.jsx)("tbody",{children:Array.from({length:3},(t,n)=>(0,a.jsx)("tr",{children:e.map(e=>(0,a.jsx)("td",{style:{padding:"10px 16px"},children:(0,a.jsx)(T,{variant:"text",height:"16px"})},e.key))},n))})})}),!W&&D&&(0,a.jsx)("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:A.textMuted},children:"✓ All rows loaded"})]}),Q&&!f&&(0,a.jsx)(Wn,{page:G,totalPages:te,pageSize:N,totalRows:ee,onPageChange:J,theme:A})]})},exports.TkxDatePicker=$e,exports.TkxDivider=j,exports.TkxDrawer=function({isOpen:e,onClose:r,placement:i="right",size:d="md",title:c,children:p,footer:u,closeOnOverlayClick:h=!0,closeOnEsc:f=!0}){const m=t.useTheme(),g=o.useReducedMotion(),x=(0,l.useId)(),y=o.useFocusTrap(e);if(o.useEscapeKey(r,f&&e),(0,l.useEffect)(()=>{if(e){if(1===++pe&&(document.body.style.overflow="hidden"),n.isFramed())try{window.dispatchEvent(new CustomEvent("tkx:framed-drawer",{detail:{placement:i,at:Date.now()}}))}catch{}}else ue();return()=>{e&&ue()}},[e,i]),"undefined"==typeof document)return null;const b=function(e,t){const n=ce[t],o={position:"absolute"};return"left"===e||"right"===e?{...o,top:0,bottom:0,[e]:0,width:n,maxWidth:"100vw",height:"100%"}:{...o,left:0,right:0,[e]:0,height:n,maxHeight:"100vh",width:"100%"}}(i,d),v=function(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}(i),w=g?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",k="string"==typeof c?n.sanitizeString(c):c;return(0,s.createPortal)((0,a.jsxs)("div",{role:"presentation",className:n.tkx("fixed inset-0 z-[9000]"),style:{pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden"},children:[(0,a.jsx)("div",{"aria-hidden":"true",onClick:h?r:void 0,className:n.tkx("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:g?"none":"opacity 280ms ease",cursor:h?"pointer":"default"}}),(0,a.jsxs)("div",{ref:y,role:"dialog","aria-modal":"true","aria-labelledby":c?x:void 0,className:n.tkx("absolute flex flex-col font-sans"),style:{...b,backgroundColor:m.surface,borderLeft:"right"===i?`1px solid ${m.border}`:void 0,borderRight:"left"===i?`1px solid ${m.border}`:void 0,borderTop:"bottom"===i?`1px solid ${m.border}`:void 0,borderBottom:"top"===i?`1px solid ${m.border}`:void 0,boxShadow:`0 20px 60px ${m.bg}99`,transform:e?"translate(0,0)":v,opacity:e?1:0,transition:w,willChange:"transform"},children:[void 0!==c&&(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${m.border}`},children:[(0,a.jsx)("h2",{id:x,className:n.tkx("m-0 text-base font-semibold leading-snug"),style:{color:m.text},children:k}),(0,a.jsx)("button",{onClick:r,"aria-label":"Close drawer",className:n.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:m.textMuted},children:(0,a.jsx)(he,{})})]}),void 0===c&&(0,a.jsx)("div",{className:n.tkx("flex justify-end px-3 pt-3 shrink-0"),children:(0,a.jsx)("button",{onClick:r,"aria-label":"Close drawer",className:n.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:m.textMuted},children:(0,a.jsx)(he,{})})}),(0,a.jsx)("div",{className:n.tkx("flex-1 overflow-y-auto px-5 py-4"),style:{color:m.text},children:p}),u&&(0,a.jsx)("div",{className:n.tkx("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${m.border}`},children:u})]})]}),document.body)},exports.TkxDrivingLicenceInput=Ur,exports.TkxDropdown=function({trigger:e,items:t,groups:n,placement:o="bottom-start",onSelect:r,selectedKeys:i,multiSelect:d=!1,searchable:c=!1,searchPlaceholder:p,closeOnSelect:u,disabled:h=!1,maxHeight:f=320,minWidth:m=200,open:g,onOpenChange:x,portal:y=!0,offset:b=6,renderItem:v}){const[w,k]=(0,l.useState)(!1),[S,C]=(0,l.useState)([]),[$,z]=(0,l.useState)({top:0,left:0,minWidth:m}),N=(0,l.useRef)(null),M=(0,l.useRef)(null),I=(0,l.useId)(),D=void 0!==g?g:w,W=void 0!==i?i:S,L=void 0!==u?u:!d,R=n??(t?[{items:t}]:[{items:[]}]),T=(0,l.useCallback)(e=>{void 0===g&&k(e),x?.(e)},[g,x]),A=(0,l.useCallback)((e,t)=>{d&&void 0===i&&C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),r?.(e,t),L&&T(!1)},[d,i,r,L,T]),B=(0,l.useCallback)(()=>T(!1),[T]);(0,l.useEffect)(()=>{D&&N.current&&z(ei(N.current,M.current,o,b))},[D,o,b]),(0,l.useEffect)(()=>{D&&N.current&&M.current&&z(ei(N.current,M.current,o,b))},[D,o,b]),(0,l.useEffect)(()=>{if(!D)return;const e=e=>{const t=e.target;N.current&&!N.current.contains(t)&&M.current&&!M.current.contains(t)&&T(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[D,T]);const F=D?(0,a.jsx)(ni,{groups:R,position:$,maxHeight:f,minWidth:m,selectedKeys:W,multiSelect:d,searchable:c,searchPlaceholder:p,onSelect:A,onClose:B,renderItem:v,menuRef:M,isPortal:y,menuId:I}):null;return(0,a.jsxs)("div",{style:{display:"inline-block",position:"relative"},children:[(0,a.jsx)("div",{ref:N,onClick:()=>{h||T(!D)},"aria-haspopup":"menu","aria-expanded":D,"aria-controls":D?I:void 0,"aria-disabled":h,style:{cursor:h?"not-allowed":"pointer",opacity:h?.5:1,display:"inline-block"},children:e}),y&&"undefined"!=typeof document?(0,s.createPortal)(F,document.body):F]})},exports.TkxEmpty=function({image:e="default",description:o="No data",children:r,style:i}){const a=t.useTheme(),s="string"==typeof o?n.sanitizeString(o):o;let d;return d="default"===e?(0,l.createElement)($o,{color:a.primary,mutedColor:a.textMuted}):"simple"===e?(0,l.createElement)(zo,{mutedColor:a.textMuted}):e,(0,l.createElement)("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...i}},(0,l.createElement)("div",{style:{marginBottom:"12px",opacity:.85}},d),s&&(0,l.createElement)("div",{style:{color:a.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},s),r&&(0,l.createElement)("div",{style:{marginTop:"16px"}},r))},exports.TkxFileUpload=function({accept:e,multiple:i=!1,maxSize:s,maxFiles:d,onChange:c,onError:p,label:u,hint:h,isDisabled:f=!1,preview:m=!0,dragDrop:g=!0,variant:x="dropzone"}){const y=t.useTheme(),b=r.useLocale(),v=u??b.uploadFiles??"Upload files",w=b.dropFiles?.replace(/^.*$/,b.dropFiles)??"Drop files here",k=o.useReducedMotion(),S=(0,l.useId)(),C=(0,l.useRef)(null),[$,z]=(0,l.useState)(!1),[N,M]=(0,l.useState)([]);(0,l.useEffect)(()=>()=>{N.forEach(e=>{e.objectUrl&&URL.revokeObjectURL(e.objectUrl)})},[]);const I=(0,l.useCallback)(e=>{let t=0;const n=setInterval(()=>{t+=Math.floor(20*Math.random())+10,t>=100&&(t=100,clearInterval(n)),M(n=>n.map(n=>n.id===e?{...n,progress:t}:n))},100)},[]),D=(0,l.useCallback)(t=>s&&t.size>s?`"${n.sanitizeString(t.name)}" exceeds max size of ${Fe(s)}`:/[\u0000-\u001F\u007F]|\.\.\/|\.\.\\/.test(t.name)?`"${n.sanitizeString(t.name)}" contains forbidden characters`:e&&!e.split(",").map(e=>e.trim()).some(e=>e.startsWith(".")?t.name.toLowerCase().endsWith(e.toLowerCase()):e.endsWith("/*")?t.type.startsWith(e.slice(0,-1)):t.type===e)?`"${n.sanitizeString(t.name)}" is not an accepted file type`:void 0,[e,s]),W=(0,l.useCallback)(async e=>{if(!e.error)try{const t=await n.sniffMimeType(e.file);if(t&&e.file.type&&!e.file.type.startsWith(t.split("/")[0])){const t=`"${n.sanitizeString(e.file.name)}" file content does not match its type`;M(n=>n.map(n=>n.id===e.id?{...n,error:t}:n)),p?.(t)}}catch{}},[p]),L=(0,l.useCallback)(e=>{const t=d?d-N.length:1/0;if(t<=0)return void p?.(`Maximum of ${d} file${1===d?"":"s"} allowed`);const n=e.slice(0,t).map(e=>{const t=D(e),n=m&&e.type.startsWith("image/")&&!t?URL.createObjectURL(e):void 0;return{file:e,id:"tkx-file-"+ ++je,objectUrl:n,progress:0,error:t}});M(e=>{const t=i?[...e,...n]:n,o=t.filter(e=>!e.error).map(e=>e.file);return c?.(o),t}),n.forEach(e=>{e.error?p?.(e.error):W(e)}),n.forEach(e=>{e.error||I(e.id)})},[N.length,d,i,c,p,m,I,D]),R=(0,l.useCallback)(e=>{const t=Array.from(e.target.files??[]);t.length&&L(t),e.target.value=""},[L]),T=(0,l.useCallback)(e=>{if(e.preventDefault(),z(!1),f)return;const t=Array.from(e.dataTransfer.files);t.length&&L(t)},[f,L]),A=(0,l.useCallback)(e=>{e.preventDefault(),f||z(!0)},[f]),B=(0,l.useCallback)(()=>z(!1),[]),F=(0,l.useCallback)(e=>{M(t=>{const n=t.find(t=>t.id===e);n?.objectUrl&&URL.revokeObjectURL(n.objectUrl);const o=t.filter(t=>t.id!==e);return c?.(o.filter(e=>!e.error).map(e=>e.file)),o})},[c]),E=(0,l.useCallback)(()=>{f||C.current?.click()},[f]),j=$?y.primary:y.border,H=n.sanitizeString(v),P=h?n.sanitizeString(h):"",O=(0,a.jsxs)("div",{role:"button",tabIndex:f?-1:0,"aria-label":H,"aria-describedby":h?S:void 0,"aria-disabled":f,onClick:E,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),E())},onDrop:g?T:void 0,onDragOver:g?A:void 0,onDragLeave:g?B:void 0,className:n.tkx("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${j}`,backgroundColor:$?`${y.primary}10`:y.surface,cursor:f?"not-allowed":"pointer",opacity:f?.5:1,transition:k?"none":"border-color 150ms ease, background-color 150ms ease",outline:"none"},children:[(0,a.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:$?y.primary:y.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,a.jsx)("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),(0,a.jsxs)("div",{className:n.tkx("text-center"),children:[(0,a.jsx)("p",{className:n.tkx("m-0 text-sm font-medium"),style:{color:y.text},children:$?w:H}),P&&(0,a.jsx)("p",{id:S,className:n.tkx("m-0 text-xs mt-1"),style:{color:y.textMuted},children:P})]})]}),V=(0,a.jsxs)("button",{type:"button",disabled:f,onClick:E,"aria-describedby":h?S:void 0,className:n.tkx("flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer"),style:{backgroundColor:y.primary,color:y.bg,opacity:f?.5:1,cursor:f?"not-allowed":"pointer"},children:[(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,a.jsx)("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),H,h&&(0,a.jsx)("span",{id:S,className:n.tkx("sr-only"),children:P})]});return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-3 w-full font-sans"),children:[(0,a.jsx)("input",{ref:C,type:"file",accept:e,multiple:i,disabled:f,onChange:R,className:n.tkx("sr-only"),tabIndex:-1,"aria-hidden":"true"}),"dropzone"===x?O:V,N.length>0&&(0,a.jsx)("ul",{role:"status","aria-live":"polite","aria-label":b.uploadFiles??"Uploaded files",className:n.tkx("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:N.map(e=>(0,a.jsxs)("li",{className:n.tkx("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:y.surfaceAlt,border:`1px solid ${e.error?y.danger:y.border}`},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-3"),children:[e.objectUrl&&m?(0,a.jsx)("img",{src:e.objectUrl,alt:n.sanitizeString(e.file.name),className:n.tkx("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):(0,a.jsx)("span",{style:{flexShrink:0},children:(0,a.jsx)(Ee,{mimeType:e.file.type,color:e.error?y.danger:y.textMuted})}),(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-0.5 flex-1 min-w-0"),children:[(0,a.jsx)("span",{className:n.tkx("text-sm font-medium truncate"),style:{color:e.error?y.danger:y.text},title:e.file.name,children:n.sanitizeString(e.file.name)}),(0,a.jsxs)("span",{className:n.tkx("text-xs"),style:{color:y.textMuted},children:[Fe(e.file.size),e.error&&` — ${e.error}`]})]}),(0,a.jsx)("button",{type:"button","aria-label":`Remove ${n.sanitizeString(e.file.name)}`,onClick:()=>F(e.id),className:n.tkx("flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1"),style:{color:y.textMuted,flexShrink:0},children:(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!e.error&&e.progress<100&&(0,a.jsx)("div",{className:n.tkx("w-full overflow-hidden"),style:{height:"3px",borderRadius:"3px",backgroundColor:y.border},"aria-hidden":"true",children:(0,a.jsx)("div",{style:{height:"100%",borderRadius:"3px",backgroundColor:y.primary,width:`${e.progress}%`,transition:k?"none":"width 100ms ease"}})})]},e.id))})]})},exports.TkxFontProvider=function({scripts:e,language:t,preconnect:n=!0,children:o}){const r=e&&e.length>0?e:t?Go(t):["latin"];return(0,l.useEffect)(()=>{n&&function(){if(Zo||"undefined"==typeof document)return;const e=document.head,t=(t,n)=>{if(e.querySelector(`link[rel="preconnect"][href="${t}"]`))return;const o=document.createElement("link");o.rel="preconnect",o.href=t,n&&(o.crossOrigin="anonymous"),e.appendChild(o)};t("https://fonts.googleapis.com"),t("https://fonts.gstatic.com",!0),Zo=!0}(),r.forEach(_o)},[r.join(","),n]),null==o?null:(0,a.jsx)(a.Fragment,{children:o})},exports.TkxFooter=ro,exports.TkxForm=i.TkxForm,exports.TkxFormField=i.TkxFormField,exports.TkxHeader=eo,exports.TkxHolographicAvatar=gi,exports.TkxHolographicBadge=bi,exports.TkxHolographicButton=vi,exports.TkxHolographicCard=mi,exports.TkxHolographicSurface=fi,exports.TkxImage=function({src:e,alt:r,fallback:i,placeholder:d="skeleton",fit:c="cover",ratio:p="auto",radius:u="none",caption:h,lazy:f=!0,preview:m=!1,className:g,style:x,...y}){const b=t.useTheme(),v=o.useReducedMotion(),[w,k]=(0,l.useState)(!1),[S,C]=(0,l.useState)(!1),[$,z]=(0,l.useState)(!1),N=(0,l.useRef)(null),M=n.sanitizeString(e),I=r?n.sanitizeString(r):"",D=h?n.sanitizeString(h):"",W=Ae[u];(0,l.useEffect)(()=>{N.current?.complete&&k(!0)},[]);const L=(0,l.useCallback)(()=>k(!0),[]),R=(0,l.useCallback)(()=>C(!0),[]),T=(0,l.useCallback)(()=>{m&&!S&&z(!0)},[m,S]),A=(0,l.useCallback)(()=>z(!1),[]);(0,l.useEffect)(()=>{if(!$)return;const e=e=>{"Escape"===e.key&&A()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[$,A]);const B="skeleton"===d&&!w&&!S,F=B&&!v?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},E=S?null:(0,a.jsx)("img",{ref:N,src:M,alt:I||void 0,role:I?void 0:"img","aria-label":I?void 0:"Image",loading:f?"lazy":void 0,onLoad:L,onError:R,onClick:m?T:void 0,className:n.cx(n.tkx("block w-full h-full"),m&&!S?n.tkx("cursor-pointer"):""),style:{objectFit:c,borderRadius:W,opacity:w?1:0,transition:v?"none":"opacity 200ms ease",position:"auto"===p?void 0:"absolute",inset:"auto"===p?void 0:0},...y}),j=S?i?(0,a.jsx)(a.Fragment,{children:i}):(0,a.jsxs)("div",{role:"img","aria-label":I||"Image failed to load",className:n.tkx("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:b.surfaceAlt,borderRadius:W,color:b.textMuted,minHeight:"80px"},children:[(0,a.jsx)(Be,{color:b.textMuted,size:32}),(0,a.jsx)("span",{className:n.tkx("text-xs"),style:{color:b.textMuted},children:"Failed to load"})]}):null,H=B?(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"auto"===p?void 0:"absolute",inset:"auto"===p?void 0:0,width:"100%",height:"auto"===p?"100%":void 0,minHeight:"auto"===p?"80px":void 0,borderRadius:W,backgroundColor:b.surfaceAlt,...F}}):null,P="auto"===p?(0,a.jsxs)("div",{className:n.tkx("relative w-full"),style:{borderRadius:W},children:[H,E,j]}):(0,a.jsxs)("div",{className:n.tkx("relative w-full overflow-hidden"),style:{paddingBottom:Te[p],borderRadius:W},children:[H,E,j]}),O=D?(0,a.jsxs)("figure",{className:n.tkx("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:W},children:[P,(0,a.jsx)("figcaption",{className:n.tkx("text-sm text-center"),style:{color:b.textMuted},children:D})]}):P;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n.cx(n.tkx("inline-block w-full"),g),style:x,children:O}),$&&"undefined"!=typeof document?(0,s.createPortal)((0,a.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":I||"Image preview",className:n.tkx("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:A,children:[(0,a.jsx)("div",{"aria-hidden":"true",className:n.tkx("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),(0,a.jsx)("img",{src:M,alt:I||"Full-size preview",onClick:e=>e.stopPropagation(),className:n.tkx("relative z-10 max-w-full max-h-full"),style:{objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)"}}),(0,a.jsx)("button",{"aria-label":"Close preview",onClick:A,className:n.tkx("absolute top-4 right-4 z-10 flex items-center justify-center","bg-transparent border-none cursor-pointer rounded-full p-2"),style:{color:"#fff",backgroundColor:"rgba(255,255,255,0.15)"},children:(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null]})},exports.TkxImageEditor=lr,exports.TkxInput=x,exports.TkxLayout=Qn,exports.TkxList=function({items:e,header:r,footer:i,bordered:l=!0,size:s="md",loading:d=!1,emptyText:c="No data",grid:p}){const u=t.useTheme(),h=o.useReducedMotion(),f=n.sanitizeString(c),m=Ho[s],g=!!p,x=p?.column??1,y=p?.gutter??16;return(0,a.jsxs)("div",{role:"list","aria-label":"List","aria-busy":d,className:n.tkx("font-sans rounded-lg overflow-hidden"),style:{border:l?`1px solid ${u.border}`:"none",backgroundColor:u.surface},children:[r&&(0,a.jsx)("div",{className:n.tkx("font-semibold text-sm"),style:{padding:m,color:u.text,borderBottom:`1px solid ${u.border}`,backgroundColor:u.surfaceAlt},children:r}),d&&(0,a.jsx)("div",{children:Array.from({length:3}).map((e,t)=>(0,a.jsx)(Po,{theme:u,reducedMotion:h},t))}),!d&&0===e.length&&(0,a.jsx)("div",{role:"status",className:n.tkx("text-center py-12 text-sm"),style:{color:u.textMuted},children:f}),!d&&e.length>0&&(0,a.jsx)("div",{style:g?{display:"grid",gridTemplateColumns:`repeat(${x}, 1fr)`,gap:y,padding:y}:void 0,children:e.map((t,o)=>{const r=n.sanitizeString(t.title),i=t.description?n.sanitizeString(t.description):void 0;return(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex items-start gap-3"),style:{padding:m,borderBottom:!g&&o<e.length-1?`1px solid ${u.border}`:"none",...g?{border:`1px solid ${u.border}`,borderRadius:8,backgroundColor:u.surface}:{},animation:h?"none":`tkxFadeIn 0.2s ease ${.03*o}s both`},children:[t.avatar&&(0,a.jsx)("div",{"aria-hidden":"true",className:n.tkx("shrink-0"),children:t.avatar}),(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[(0,a.jsx)("div",{className:n.tkx("text-sm font-medium"),style:{color:u.text},children:r}),i&&(0,a.jsx)("div",{className:n.tkx("text-xs mt-1 leading-relaxed"),style:{color:u.textMuted},children:i})]}),t.extra&&(0,a.jsx)("div",{className:n.tkx("shrink-0 ml-auto"),style:{color:u.textMuted},children:t.extra}),t.actions&&(0,a.jsx)("div",{className:n.tkx("shrink-0 flex items-center gap-2"),children:t.actions})]},t.key)})}),i&&(0,a.jsx)("div",{className:n.tkx("text-sm"),style:{padding:m,color:u.textMuted,borderTop:`1px solid ${u.border}`,backgroundColor:u.surfaceAlt},children:i})]})},exports.TkxMarkdown=Zn,exports.TkxMasonry=function({columns:e,gap:r=16,children:i}){t.useTheme();const s=o.useReducedMotion(),d=function(){const[e,t]=(0,l.useState)(()=>{if("undefined"==typeof window)return"lg";const e=window.innerWidth;return e>=1024?"lg":e>=768?"md":"sm"});return(0,l.useEffect)(()=>{if("undefined"==typeof window)return;const e=()=>{const e=window.innerWidth;t(e>=1024?"lg":e>=768?"md":"sm")};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}();(0,l.useEffect)(()=>{!function(){if(Ln||"undefined"==typeof document)return;Ln=!0;const e=document.createElement("style");e.id="tkx-masonry-kf",e.textContent="\n @keyframes tkx-masonry-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}()},[]);const c=function(e,t){return void 0===e?3:"number"==typeof e?Math.max(1,e):"lg"===t?e.lg??e.md??e.sm??3:"md"===t?e.md??e.sm??2:e.sm??1}(e,d),p=l.Children.toArray(i),u=(0,l.useMemo)(()=>{const e=Array.from({length:c},()=>[]);return p.forEach((t,n)=>{e[n%c].push(t)}),e},[p,c]);return(0,a.jsx)("div",{role:"list","aria-label":"Masonry grid",className:n.tkx("flex w-full"),style:{gap:r,alignItems:"flex-start"},children:u.map((e,t)=>(0,a.jsx)("div",{className:n.tkx("flex flex-col"),style:{flex:1,gap:r,minWidth:0},children:e.map((e,n)=>{return(0,a.jsx)("div",{role:"listitem",style:(o=n*c+t,s?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(40*o,400)}ms`}),children:e},n);var o})},t))})},exports.TkxMentions=function({options:e,value:r="",onChange:i,trigger:s="@",placeholder:d,label:c}){const p=t.useTheme(),u=o.useReducedMotion(),h=(0,l.useRef)(null),f=(0,l.useRef)(null),[m,g]=(0,l.useState)(r),[x,y]=(0,l.useState)(!1),[b,v]=(0,l.useState)(""),[w,k]=(0,l.useState)(0),[S,C]=(0,l.useState)(-1);(0,l.useEffect)(()=>{void 0!==r&&g(r)},[r]);const $=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),z=(0,l.useCallback)(e=>{const t=e.target.value;g(t),i?.(t);const n=e.target.selectionStart??t.length,o=t.slice(0,n),r=o.lastIndexOf(s);if(r>=0){const e=o.slice(r+s.length);if(!/\s/.test(e))return v(e),C(r),y(!0),void k(0)}y(!1)},[s,i]),N=(0,l.useCallback)(e=>{const t=m.slice(0,S),n=m.slice(S+s.length+b.length),o=`${t}${s}${e.value} ${n}`;g(o),i?.(o),y(!1),h.current?.focus()},[m,S,s,b,i]),M=(0,l.useCallback)(e=>{x&&("ArrowDown"===e.key?(e.preventDefault(),k(e=>(e+1)%$.length)):"ArrowUp"===e.key?(e.preventDefault(),k(e=>(e-1+$.length)%$.length)):"Enter"===e.key&&$[w]?(e.preventDefault(),N($[w])):"Escape"===e.key&&y(!1))},[x,$,w,N]);(0,l.useEffect)(()=>{x&&f.current&&f.current.children[w]?.scrollIntoView({block:"nearest"})},[w,x]);const I=c?n.sanitizeString(c):void 0,D=d?n.sanitizeString(d):void 0;return(0,a.jsxs)("div",{className:n.tkx("relative font-sans"),style:{width:"100%"},children:[I&&(0,a.jsx)("label",{className:n.tkx("block text-sm font-medium mb-1"),style:{color:p.text},children:I}),(0,a.jsx)("textarea",{ref:h,role:"combobox","aria-expanded":x,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-label":I??"Mentions input",value:m,placeholder:D,onChange:z,onKeyDown:M,onBlur:()=>setTimeout(()=>y(!1),200),className:n.tkx("w-full rounded-lg border px-3 py-2 text-sm resize-y"),style:{backgroundColor:p.surface,borderColor:p.border,color:p.text,minHeight:80,outline:"none"},rows:3}),x&&$.length>0&&(0,a.jsx)("ul",{ref:f,role:"listbox","aria-label":"Mention suggestions",className:n.tkx("absolute left-0 right-0 z-50 rounded-lg border overflow-auto"),style:{backgroundColor:p.surface,borderColor:p.border,maxHeight:200,top:"100%",marginTop:4,listStyle:"none",padding:0,boxShadow:`0 4px 12px ${p.bg}80`,animation:u?"none":"tkxFadeIn 0.15s ease"},children:$.map((e,t)=>(0,a.jsxs)("li",{role:"option","aria-selected":t===w,className:n.tkx("flex items-center gap-3 px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:t===w?p.surfaceAlt:"transparent",color:p.text},onMouseDown:t=>{t.preventDefault(),N(e)},onMouseEnter:()=>k(t),children:[e.avatar&&(0,a.jsx)("img",{src:n.sanitizeString(e.avatar),alt:"","aria-hidden":"true",width:24,height:24,className:n.tkx("rounded-full"),style:{objectFit:"cover"}}),(0,a.jsx)("span",{children:n.sanitizeString(e.label)}),(0,a.jsxs)("span",{style:{color:p.textMuted,marginLeft:"auto"},children:[s,n.sanitizeString(e.value)]})]},e.value))})]})},exports.TkxMenu=mt,exports.TkxModal=function({isOpen:e,onClose:i,title:d,size:c="md",closeOnOverlayClick:p=!0,closeOnEscape:u=!0,children:h,footer:f}){const m=t.useTheme(),g=r.useLocale(),x=(0,l.useId)(),y=o.useFocusTrap(e),b=o.useReducedMotion(),v=o.useAnnounce(),w=n.sanitizeString(d),k="full"===c;return o.useEscapeKey(i,u&&e),(0,l.useEffect)(()=>{if(e){if(1===++M&&(document.body.style.overflow="hidden"),v(w,"polite"),n.isFramed())try{window.dispatchEvent(new CustomEvent("tkx:framed-modal",{detail:{title:w,at:Date.now()}}))}catch{}}else I();return()=>{e&&I()}},[e,w,v]),e&&"undefined"!=typeof document?(0,s.createPortal)((0,a.jsxs)("div",{role:"presentation",className:n.tkx("fixed inset-0 z-[9000] flex",k?"items-stretch":"items-center justify-center",k?"":"p-4"),children:[(0,a.jsx)("div",{"aria-hidden":"true",onClick:p?i:void 0,className:n.tkx("absolute inset-0",!b&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),(0,a.jsxs)("div",{ref:y,role:"dialog","aria-modal":"true","aria-labelledby":x,className:n.tkx("relative z-10 flex flex-col overflow-hidden",!b&&"animate-slide-up",k?"":"rounded-xl"),style:{backgroundColor:m.surface,border:`1px solid ${m.border}`,width:N[c],maxWidth:"100%",maxHeight:k?"100vh":"90vh",boxShadow:`0 20px 60px ${m.bg}80`},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${m.border}`},children:[(0,a.jsx)("h2",{id:x,className:n.tkx("m-0 text-lg font-semibold font-sans"),style:{color:m.text},children:w}),(0,a.jsx)("button",{onClick:i,"aria-label":g.close,className:n.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:m.textMuted},children:(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,a.jsx)("div",{className:n.tkx("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:m.text},children:h}),f&&(0,a.jsx)("div",{className:n.tkx("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${m.border}`},children:f})]})]}),document.body):null},exports.TkxNumberInput=qt,exports.TkxOTP=Gt,exports.TkxOrgChart=Gr,exports.TkxPagination=Re,exports.TkxPanInput=Er,exports.TkxParagraph=function({children:e,type:o="default",copyable:r=!1,ellipsis:i=!1,style:a}){const s=t.useTheme(),d="secondary"===o?s.textMuted:s.text,c=xo(e),p="string"==typeof e?n.sanitizeString(e):e,u={};if(i){const e="object"==typeof i?i.rows??3:3;u.display="-webkit-box",u.WebkitLineClamp=e,u.WebkitBoxOrient="vertical",u.overflow="hidden"}return(0,l.createElement)("div",{style:{color:d,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...u,...a}},p,r&&(0,l.createElement)(yo,{text:c}))},exports.TkxPaymentButton=pr,exports.TkxPhoneInput=or,exports.TkxPlanSelector=qr,exports.TkxPopover=function({trigger:e,content:r,placement:i="bottom",isOpen:d,onOpenChange:c,closeOnClickOutside:p=!0,className:u,style:h}){const f=t.useTheme(),m=o.useReducedMotion(),g=(0,l.useId)(),x=void 0!==d,[y,b]=(0,l.useState)(!1),v=x?d:y,w=(0,l.useRef)(null),k=(0,l.useRef)(null);(0,l.useRef)(null);const[S,C]=(0,l.useState)(null),$=(0,l.useCallback)(e=>{x||b(e),c?.(e)},[x,c]),z=(0,l.useCallback)(()=>$(!1),[$]),N=(0,l.useCallback)(()=>$(!v),[$,v]);o.useEscapeKey(z,v),(0,l.useEffect)(()=>{if(!v||!p)return;const e=e=>{const t=e.target;w.current?.contains(t)||k.current?.contains(t)||z()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[v,p,z]),(0,l.useEffect)(()=>{if(!v||!w.current)return;const e=()=>{w.current&&k.current&&C(function(e,t,n){const o=t.getBoundingClientRect(),r=window.scrollX,i=window.scrollY,l=window.innerWidth,a=window.innerHeight;let s=0,d=0,c=n;const p={top:e.top-o.height-8-8>0,bottom:e.bottom+o.height+8+8<a,left:e.left-o.width-8-8>0,right:e.right+o.width+8+8<l};if(!p[n]){const e={top:"bottom",bottom:"top",left:"right",right:"left"};p[e[n]]&&(c=e[n])}switch(c){case"top":s=e.top+i-o.height-8-8,d=e.left+r+e.width/2-o.width/2;break;case"bottom":s=e.bottom+i+8+8,d=e.left+r+e.width/2-o.width/2;break;case"left":s=e.top+i+e.height/2-o.height/2,d=e.left+r-o.width-8-8;break;case"right":s=e.top+i+e.height/2-o.height/2,d=e.right+r+8+8}d=Math.max(8,Math.min(d,l+r-o.width-8)),s=Math.max(8,Math.min(s,a+i-o.height-8));const u={position:"absolute",width:0,height:0,borderStyle:"solid",borderWidth:8};switch(c){case"top":Object.assign(u,{bottom:-16,left:"50%",transform:"translateX(-50%)",borderColor:"var(--tkx-popover-bg) transparent transparent transparent"});break;case"bottom":Object.assign(u,{top:-16,left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent var(--tkx-popover-bg) transparent"});break;case"left":Object.assign(u,{right:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent var(--tkx-popover-bg)"});break;case"right":Object.assign(u,{left:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent var(--tkx-popover-bg) transparent transparent"})}return{top:s,left:d,arrowStyle:u,resolvedPlacement:c}}(w.current.getBoundingClientRect(),k.current,i))};return requestAnimationFrame(e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[v,i]);const M=m?{opacity:1}:{animation:"tkxPopoverFadeIn 150ms ease forwards",opacity:0},I=v&&"undefined"!=typeof document?(0,s.createPortal)((0,a.jsxs)("div",{ref:k,id:g,role:"dialog","aria-modal":"false",className:n.tkx("absolute z-[9100] rounded-lg font-sans",u??""),style:{"--tkx-popover-bg":f.surface,top:S?.top??-9999,left:S?.left??-9999,backgroundColor:f.surface,border:`1px solid ${f.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",minWidth:200,maxWidth:420,padding:"12px 16px",color:f.text,...M,...h},children:[S&&(0,a.jsx)("span",{style:S.arrowStyle,"aria-hidden":"true"}),r]}),document.body):null;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:w,className:n.tkx("inline-flex"),onClick:N,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),N())},"aria-expanded":v,"aria-haspopup":"dialog","aria-controls":v?g:void 0,children:e}),I,v&&!m&&(0,a.jsx)("style",{children:"\n @keyframes tkxPopoverFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})},exports.TkxProgress=S,exports.TkxProrationPreview=function({newPlan:e,currentPlan:n,cycle:o,daysRemaining:r,cycleDays:i,className:l,style:s,children:d}){const c=t.useTheme(),p=i>0?r/i:0,u=n.prices[o]*p,h=e.prices[o]*p,f=Math.max(0,h-u),m=Math.max(0,u-h),g={border:`1px solid ${c.border}`,borderRadius:12,padding:20,background:c.surface,...s},x={display:"flex",justifyContent:"space-between",fontSize:13,padding:"6px 0"},y=t=>Yr(t,e.currency,e.locale);return(0,a.jsxs)("div",{className:l,style:g,children:[(0,a.jsx)("div",{style:{fontSize:12,fontWeight:700,color:c.textMuted,textTransform:"uppercase",letterSpacing:.5,marginBottom:12},children:"Plan change"}),(0,a.jsxs)("div",{style:{...x,color:c.textMuted},children:[(0,a.jsxs)("span",{children:["From ",(0,a.jsx)("strong",{style:{color:c.text},children:n.name})]}),(0,a.jsx)("span",{children:"→"}),(0,a.jsxs)("span",{children:["To ",(0,a.jsx)("strong",{style:{color:c.primary},children:e.name})]})]}),(0,a.jsx)("hr",{style:{border:0,borderTop:`1px solid ${c.border}`,margin:"8px 0"}}),(0,a.jsxs)("div",{style:{...x,color:c.textMuted},children:[(0,a.jsx)("span",{children:"Days remaining in cycle"}),(0,a.jsxs)("span",{children:[r," / ",i]})]}),(0,a.jsxs)("div",{style:{...x,color:c.textMuted},children:[(0,a.jsxs)("span",{children:["Credit from ",n.name]}),(0,a.jsxs)("span",{children:["−",y(u)]})]}),(0,a.jsxs)("div",{style:{...x,color:c.textMuted},children:[(0,a.jsxs)("span",{children:["Charge for ",e.name," (prorated)"]}),(0,a.jsx)("span",{children:y(h)})]}),(0,a.jsx)("hr",{style:{border:0,borderTop:`1px solid ${c.border}`,margin:"8px 0"}}),f>0?(0,a.jsxs)("div",{style:{...x,fontSize:16,fontWeight:700},children:[(0,a.jsx)("span",{style:{color:c.text},children:"Due today"}),(0,a.jsx)("span",{style:{color:c.primary},children:y(f)})]}):(0,a.jsxs)("div",{style:{...x,fontSize:14,color:c.success},children:[(0,a.jsx)("span",{children:"Credit applied at next billing"}),(0,a.jsx)("span",{children:y(m)})]}),(0,a.jsx)("div",{style:{...x,color:c.textMuted,fontSize:12,marginTop:6},children:(0,a.jsxs)("span",{children:["Then ",y(e.prices[o])," / ","monthly"===o?"month":"year"]})}),d&&(0,a.jsx)("div",{style:{marginTop:16},children:d})]})},exports.TkxQRCode=function({value:e,size:r=160,color:i,bgColor:s,errorLevel:d="M",icon:c,bordered:p=!0}){const u=t.useTheme(),h=o.useReducedMotion(),f=(0,l.useRef)(null),m=n.sanitizeString(e),g=i??u.text,x=s??u.surface,y=(0,l.useMemo)(()=>function(e,t,n){const o=function(e){let t=e;return()=>(t=1664525*t+1013904223|0,(t>>>0)/4294967295)}(function(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return Math.abs(t)}(e)),r=Wo[n]??.42,i=Array.from({length:t},()=>Array.from({length:t},()=>!1)),l=(e,t)=>{for(let n=0;n<7;n++)for(let o=0;o<7;o++){const r=0===n||6===n||0===o||6===o,l=n>=2&&n<=4&&o>=2&&o<=4;i[e+n][t+o]=r||l}};l(0,0),l(0,18),l(18,0);for(let a=7;a<18;a++)i[6][a]=a%2==0,i[a][6]=a%2==0;for(let a=0;a<t;a++)for(let e=0;e<t;e++)a<8&&e<8||a<8&&e>=17||a>=17&&e<8||6===a||6===e||(i[a][e]=o()<r);return i}(m,25,d),[m,d]);return(0,l.useEffect)(()=>{const e=f.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const o=window.devicePixelRatio||1;e.width=r*o,e.height=r*o,t.scale(o,o);const i=r/25;t.fillStyle=x,t.fillRect(0,0,r,r),t.fillStyle=g;for(let n=0;n<25;n++)for(let e=0;e<25;e++)y[n][e]&&t.fillRect(e*i,n*i,i,i);if(c){const e=.22*r,o=(r-e)/2;t.fillStyle=x,t.fillRect(o-2,o-2,e+4,e+4);const i=new Image;i.crossOrigin="anonymous",i.onload=()=>{t.drawImage(i,o,o,e,e)},i.src=n.sanitizeString(c)}},[y,r,g,x,c]),(0,a.jsx)("div",{role:"img","aria-label":`QR code for: ${m}`,className:n.tkx("inline-block rounded-lg"),style:{padding:p?12:0,backgroundColor:p?x:"transparent",border:p?`1px solid ${u.border}`:"none",lineHeight:0,animation:h?"none":"tkxFadeIn 0.2s ease"},children:(0,a.jsx)("canvas",{ref:f,"aria-hidden":"true",style:{width:r,height:r,display:"block"}})})},exports.TkxRadio=X,exports.TkxRadioGroup=function({name:e,value:o,defaultValue:r="",onChange:i,label:s,orientation:d="vertical",isDisabled:c=!1,isInvalid:p=!1,errorMessage:u,children:h}){const f=t.useTheme(),m=`${(0,l.useId)()}-error`,[g,x]=(0,l.useState)(r),y=void 0!==o,b=y?o:g,v=p||!!u;return(0,a.jsx)(Y.Provider,{value:{name:e,value:b,onChange:e=>{y||x(e),i?.(e)},isDisabled:c,isInvalid:p},children:(0,a.jsxs)("div",{role:"radiogroup","aria-label":s?n.sanitizeString(s):void 0,"aria-describedby":v?m:void 0,"aria-invalid":v,children:[s&&(0,a.jsx)("div",{className:n.tkx("text-sm font-medium font-sans mb-2"),style:{color:f.text},children:n.sanitizeString(s)}),(0,a.jsx)("div",{className:n.tkx("horizontal"===d?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:h}),v&&u&&(0,a.jsxs)("span",{id:m,role:"alert",className:n.tkx("text-xs flex items-center gap-1 mt-1"),style:{color:f.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),n.sanitizeString(u)]})]})})},exports.TkxRating=function({value:e,defaultValue:r=0,onChange:i,max:s=5,precision:d=1,size:c="md",isReadOnly:p=!1,isDisabled:u=!1,label:h,showValue:f=!1,colorScheme:m="warning",emptyIcon:g="star",filledIcon:x="star"}){const y=t.useTheme(),b=o.useReducedMotion(),v=(0,l.useId)(),w=void 0!==e,[k,S]=(0,l.useState)(r),[C,$]=(0,l.useState)(null),z=(0,l.useRef)(null),N=w?e??0:k,M=C??N,I={warning:y.warning,primary:y.primary,danger:y.danger}[m]??y.warning,D=He[c],W=!p&&!u,L=(0,l.useCallback)(e=>{w||S(e),i?.(e)},[w,i]),R=(0,l.useCallback)((e,t)=>{W&&$(Ye(e,t,d))},[W,d]),T=(0,l.useCallback)(()=>{W&&$(null)},[W]),A=(0,l.useCallback)((e,t)=>{if(!W)return;const n=Ye(e,t,d);L(n===N?0:n)},[W,d,N,L]),B=(0,l.useCallback)(e=>{if(!W)return;const t=d;let n=N;if("ArrowRight"===e.key||"ArrowUp"===e.key)e.preventDefault(),n=Ue(N+t,0,s);else if("ArrowLeft"===e.key||"ArrowDown"===e.key)e.preventDefault(),n=Ue(N-t,0,s);else if("Home"===e.key)e.preventDefault(),n=0;else{if("End"!==e.key)return;e.preventDefault(),n=s}n=function(e,t){return 1===t?Math.round(e):Math.round(2*e)/2}(n,d),L(n)},[W,N,s,d,L]),F=h?n.sanitizeString(h):"Rating";return(0,a.jsxs)("div",{className:n.cx(n.tkx("inline-flex items-center gap-2 font-sans"),u?n.tkx("opacity-50"):""),children:[(0,a.jsx)("div",{ref:z,role:"radiogroup","aria-label":F,"aria-disabled":u,"aria-readonly":p,tabIndex:W?0:-1,onKeyDown:B,onMouseLeave:T,className:n.tkx("flex items-center gap-0.5 outline-none"),style:{cursor:W?"pointer":"default"},children:Array.from({length:s},(e,t)=>{const n=t+1,o=t+.5,r=M>=n,i=!r&&.5===d&&M>=o,l=`${v}-${t}`;return(0,a.jsx)("span",{role:"radio","aria-checked":.5===d&&N===o||N===n,"aria-label":.5===d?`${o} star${1!==o?"s":""} / ${n} star${1!==n?"s":""}`:`${n} star${1!==n?"s":""}`,tabIndex:-1,onMouseMove:e=>R(e,t),onClick:e=>A(e,t),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:b?"none":"transform 120ms ease",transform:null!==C&&M>=o&&W?"scale(1.15)":"scale(1)"},children:(0,a.jsx)(Ke,{type:r||i?x:g,size:D,filled:r,halfFilled:i,color:r||i?I:y.border,uid:i?l:void 0})},t)})}),f&&(0,a.jsxs)("span",{className:n.tkx("text-sm tabular-nums"),style:{color:y.textMuted},"aria-live":"polite","aria-atomic":"true",children:[N%1==0?N.toFixed(0):N.toFixed(1)," / ",s]})]})},exports.TkxResult=function({status:e,title:r,subTitle:i,icon:l,extra:s}){const d=t.useTheme(),c=o.useReducedMotion(),p=function(e,t){switch(e){case"success":return t.success;case"error":case"500":return t.danger;case"warning":return t.warning;case"info":return t.info;case"404":case"403":return t.textMuted}}(e,d),u=n.sanitizeString(r),h=i?n.sanitizeString(i):void 0;return(0,a.jsxs)("div",{role:"status","aria-live":"polite",className:n.tkx("flex flex-col items-center text-center px-6 py-12 font-sans"),style:{animation:c?"none":"tkxFadeIn 0.3s ease"},children:[(0,a.jsx)("div",{className:n.tkx("mb-6"),children:l??Lo[e](p)}),(0,a.jsx)("h2",{className:n.tkx("text-xl font-semibold m-0 mb-2"),style:{color:d.text},children:u}),h&&(0,a.jsx)("p",{className:n.tkx("text-sm m-0 mb-6 max-w-md leading-relaxed"),style:{color:d.textMuted},children:h}),s&&(0,a.jsx)("div",{className:n.tkx("flex items-center gap-3 mt-4"),children:s})]})},exports.TkxRichTextDisplay=function({blocks:e,className:i,style:s}){const d=t.useTheme(),c=r.useLocale(),p=o.useReducedMotion(),u=(0,l.useMemo)(()=>e.map((e,t)=>{const n=An[e.type];return n?(0,a.jsx)("div",{style:p?void 0:{animation:"tkx-rich-text-fade-in 300ms ease both",animationDelay:`${Math.min(30*t,300)}ms`},children:(0,a.jsx)(n,{block:e,index:t})},t):null}),[e,p]);return(0,l.useMemo)(()=>{if("undefined"==typeof document)return;if(document.getElementById("tkx-rich-text-kf"))return;const e=document.createElement("style");e.id="tkx-rich-text-kf",e.textContent="\n @keyframes tkx-rich-text-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n ",document.head.appendChild(e)},[]),(0,a.jsx)("article",{"aria-label":c.richTextContent??"Rich text content",className:n.tkx("font-sans",i??""),style:{color:d.text,maxWidth:720,...s},children:u})},exports.TkxRow=ao,exports.TkxSEO=function({title:e,description:t,canonical:n,keywords:o,image:r,twitterSite:i,twitterCreator:a,ogType:s="website",locale:d,robots:c="index, follow, max-snippet:-1, max-image-preview:large",schema:p}){return(0,l.useEffect)(()=>{if("undefined"!=typeof document)return kr(),e&&(document.title=e),t&&Sr("description",t),o&&Sr("keywords",o),Sr("robots",c),e&&Sr("og:title",e,"property"),t&&Sr("og:description",t,"property"),Sr("og:type",s,"property"),n&&Sr("og:url",n,"property"),r&&(Sr("og:image",r,"property"),Sr("og:image:width","1200","property"),Sr("og:image:height","630","property")),d&&Sr("og:locale",d,"property"),Sr("twitter:card",r?"summary_large_image":"summary"),e&&Sr("twitter:title",e),t&&Sr("twitter:description",t),r&&Sr("twitter:image",r),i&&Sr("twitter:site",i),a&&Sr("twitter:creator",a),n&&function(e,t){if("undefined"==typeof document||!t)return;const n=document.createElement("link");n.rel="canonical",n.href=t,n.setAttribute(wr,"1"),document.head.appendChild(n)}(0,n),p&&function(e){if("undefined"==typeof document)return;const t=Array.isArray(e)?e:[e];for(const n of t){const e=document.createElement("script");e.type="application/ld+json",e.text=JSON.stringify(n),e.setAttribute(wr,"1"),document.head.appendChild(e)}}(p),()=>kr()},[e,t,n,o,r,i,a,s,d,c,p]),null},exports.TkxSegmented=function({options:e,value:r,onChange:i,size:s="md",block:d=!1}){const c=t.useTheme(),p=o.useReducedMotion(),u=(0,l.useRef)(null),[h,f]=(0,l.useState)(()=>Math.max(0,e.findIndex(e=>e.value===r))),[m,g]=(0,l.useState)({}),x=Do[s];(0,l.useEffect)(()=>{const t=e.findIndex(e=>e.value===r);t>=0&&f(t)},[r,e]),(0,l.useEffect)(()=>{const e=u.current;if(!e)return;const t=e.querySelectorAll("[data-seg-btn]")[h];t&&g({left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight,transition:p?"none":"left 0.2s ease, width 0.2s ease"})},[h,e,p]);const y=(0,l.useCallback)(t=>{const n=e[t];n&&!n.disabled&&(f(t),i?.(n.value))},[e,i]),b=(0,l.useCallback)(t=>{let n=h;if("ArrowRight"===t.key||"ArrowDown"===t.key)for(t.preventDefault(),n=(h+1)%e.length;e[n]?.disabled&&n!==h;)n=(n+1)%e.length;else if("ArrowLeft"===t.key||"ArrowUp"===t.key)for(t.preventDefault(),n=(h-1+e.length)%e.length;e[n]?.disabled&&n!==h;)n=(n-1+e.length)%e.length;n!==h&&(y(n),(u.current?.querySelectorAll("[data-seg-btn]"))?.[n]?.focus())},[h,e,y]);return(0,a.jsxs)("div",{ref:u,role:"radiogroup","aria-label":"Segmented control",className:n.tkx("relative inline-flex items-center rounded-lg p-1"),style:{backgroundColor:c.surfaceAlt,border:`1px solid ${c.border}`,width:d?"100%":void 0},onKeyDown:b,children:[(0,a.jsx)("div",{"aria-hidden":"true",className:n.tkx("absolute top-1 rounded-md"),style:{...m,backgroundColor:c.surface,boxShadow:`0 1px 3px ${c.border}`,zIndex:0}}),e.map((e,t)=>{const o=t===h,r=n.sanitizeString(e.label);return(0,a.jsxs)("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":o,"aria-disabled":e.disabled||void 0,disabled:e.disabled,tabIndex:o?0:-1,className:n.tkx("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:x.height,fontSize:x.fontSize,padding:`0 ${x.px}px`,flex:d?1:void 0,color:o?c.text:c.textMuted,backgroundColor:"transparent",opacity:e.disabled?.4:1,fontWeight:o?600:400,transition:p?"none":"color 0.15s ease"},onClick:()=>y(t),children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",children:e.icon}),r]},e.value)})]})},exports.TkxSelect=V,exports.TkxSider=no,exports.TkxSignaturePad=ur,exports.TkxSkeleton=T,exports.TkxSlider=We,exports.TkxSnackbar=function({message:e,isOpen:r,onClose:i,action:d,variant:c="default",position:p="bottom-center",autoHideDuration:u=5e3,icon:h}){const f=t.useTheme(),m=o.useReducedMotion(),g=(0,l.useId)(),x=(0,l.useRef)(null),[y,b]=(0,l.useState)(!1),[v,w]=(0,l.useState)(!1);(0,l.useEffect)(()=>{!function(){if(wn||"undefined"==typeof document)return;wn=!0;const e=document.createElement("style");e.id="tkx-snackbar-kf",e.textContent="\n @keyframes tkx-snackbar-slide-up {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-snackbar-slide-down {\n from { opacity: 0; transform: translateY(-24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-snackbar-fade-out {\n from { opacity: 1; }\n to { opacity: 0; transform: translateY(8px); }\n }\n ",document.head.appendChild(e)}()},[]),(0,l.useEffect)(()=>{if(r)w(!1),b(!0);else if(y){if(!m){w(!0);const e=setTimeout(()=>{b(!1),w(!1)},250);return()=>clearTimeout(e)}b(!1)}},[r,m,y]),(0,l.useEffect)(()=>{if(r&&!(u<=0)&&i)return x.current=setTimeout(()=>{i()},u),()=>{x.current&&clearTimeout(x.current)}},[r,u,i]);const k=(0,l.useCallback)(()=>{x.current&&(clearTimeout(x.current),x.current=null)},[]),S=(0,l.useCallback)(()=>{r&&u>0&&i&&(x.current=setTimeout(()=>i(),u))},[r,u,i]),C={default:f.textMuted,success:f.success,error:f.danger,warning:f.warning,info:f.info}[c],$=n.sanitizeString(e);if(!y||"undefined"==typeof document)return null;let z={};m||(z=v?{animation:"tkx-snackbar-fade-out 250ms ease forwards"}:{animation:("top-center"===p?"tkx-snackbar-slide-down":"tkx-snackbar-slide-up")+" 250ms cubic-bezier(0.16,1,0.3,1) both"});const N=h??kn[c]??null;return(0,s.createPortal)((0,a.jsx)("div",{role:"error"===c?"alert":"status","aria-live":"error"===c?"assertive":"polite","aria-atomic":"true","aria-labelledby":g,className:n.tkx("fixed z-[9500] font-sans"),style:{...Sn[p],...z,pointerEvents:"auto"},onMouseEnter:k,onMouseLeave:S,children:(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg","min-w-[280px] max-w-[480px]"),style:{backgroundColor:f.surface,border:`1px solid ${C}44`,boxShadow:`0 8px 24px ${f.bg}aa`,color:f.text},children:[N&&(0,a.jsx)("span",{className:n.tkx("shrink-0 flex items-center"),style:{color:C},children:N}),(0,a.jsx)("span",{id:g,className:n.tkx("flex-1 text-sm leading-snug"),children:$}),d&&(0,a.jsx)("button",{onClick:()=>{d.onClick(),i?.()},className:n.tkx("bg-transparent border-none cursor-pointer p-0 ml-2","text-sm font-semibold shrink-0","focus-visible:focus-ring"),style:{color:f.primary},children:n.sanitizeString(d.label)}),i&&(0,a.jsx)("button",{"aria-label":"Dismiss snackbar",onClick:i,className:n.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] ml-1","shrink-0 flex items-center justify-center","focus-visible:focus-ring"),style:{color:f.textMuted},children:(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),document.body)},exports.TkxSortable=yr,exports.TkxSpeedDial=function({actions:e,icon:r,direction:i="up",position:d="bottom-right",className:c,style:p}){const u=t.useTheme(),h=o.useReducedMotion(),f=(0,l.useId)(),[m,g]=(0,l.useState)(!1),[x,y]=(0,l.useState)(-1),b=(0,l.useRef)(null),v=(0,l.useRef)(new Map),w=(0,l.useCallback)(()=>{g(e=>!e),y(-1)},[]),k=(0,l.useCallback)(()=>{g(!1),y(-1)},[]);o.useEscapeKey(k,m),(0,l.useEffect)(()=>{if(!m)return;const e=e=>{b.current?.contains(e.target)||k()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[m,k]),(0,l.useEffect)(()=>{x>=0&&v.current.get(x)?.focus()},[x]);const S=e=>h?"0ms":40*e+"ms";return(0,a.jsxs)(a.Fragment,{children:[m&&"undefined"!=typeof document&&(0,s.createPortal)((0,a.jsx)("div",{"aria-hidden":"true",onClick:k,style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:9e3,transition:h?"none":"opacity 200ms ease"}}),document.body),(0,a.jsxs)("div",{ref:b,className:n.tkx("fixed z-[9100] font-sans",c??""),style:{...yn[d],...p},children:[m&&e.map((t,o)=>{const r=n.sanitizeString(t.label),l=function(e,t){const n=64*(t+1);switch(e){case"up":return{bottom:n,left:"50%",transform:"translateX(-50%)"};case"down":return{top:n,left:"50%",transform:"translateX(-50%)"};case"left":return{right:n,top:"50%",transform:"translateY(-50%)"};case"right":return{left:n,top:"50%",transform:"translateY(-50%)"}}}(i,o),s=function(e){switch(e){case"up":case"down":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:10};case"left":case"right":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10}}}(i);return(0,a.jsx)("div",{className:n.tkx("absolute"),style:{...l,opacity:h?1:0,animation:h?"none":"tkxSpeedDialIn 180ms ease forwards",animationDelay:S(o)},children:(0,a.jsxs)("div",{className:n.tkx("relative inline-flex"),children:[(0,a.jsx)("span",{className:n.tkx("absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none"),style:{...s,backgroundColor:u.surfaceAlt,color:u.text,border:`1px solid ${u.border}`,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},role:"tooltip",children:r}),(0,a.jsx)("button",{ref:e=>{e?v.current.set(o,e):v.current.delete(o)},type:"button","aria-label":r,tabIndex:m?0:-1,onClick:()=>{t.onClick?.(),k()},onKeyDown:t=>((t,n)=>{switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),y(n>0?n-1:e.length-1);break;case"ArrowDown":case"ArrowRight":t.preventDefault(),y(n<e.length-1?n+1:0);break;case"Enter":case" ":t.preventDefault(),e[n].onClick?.(),k();break;case"Escape":k();break;case"Home":t.preventDefault(),y(0);break;case"End":t.preventDefault(),y(e.length-1)}})(t,o),className:n.tkx("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2","shadow-lg"),style:{width:48,height:48,backgroundColor:u.surface,color:u.text,border:`1px solid ${u.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",transition:h?"none":"all 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=u.surfaceAlt,e.currentTarget.style.transform="scale(1.1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=u.surface,e.currentTarget.style.transform="scale(1)"},children:t.icon})]})},t.id)}),(0,a.jsx)("button",{type:"button","aria-label":m?"Close actions menu":"Open actions menu","aria-expanded":m,"aria-controls":f,"aria-haspopup":"true",onClick:w,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w()),m&&("ArrowUp"!==e.key&&"ArrowLeft"!==e.key||(e.preventDefault(),y(0)),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),y(0)))},className:n.tkx("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2"),style:{width:56,height:56,backgroundColor:u.primary,color:u.bg,boxShadow:`0 6px 20px ${u.primary}40`,transition:h?"none":"all 200ms ease",position:"relative",zIndex:1},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 8px 28px ${u.primary}60`,h||(e.currentTarget.style.transform="scale(1.05)")},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 6px 20px ${u.primary}40`,e.currentTarget.style.transform="scale(1)"},children:r??(0,a.jsx)(xn,{color:u.bg,rotated:m,reducedMotion:h})}),(0,a.jsx)("div",{id:f,role:"menu","aria-label":"Speed dial actions",style:{display:"none"},children:e.map(e=>(0,a.jsx)("div",{role:"menuitem",children:n.sanitizeString(e.label)},e.id))})]}),m&&!h&&(0,a.jsx)("style",{children:"\n @keyframes tkxSpeedDialIn {\n from { opacity: 0; transform: translateX(-50%) scale(0.5); }\n to { opacity: 1; transform: translateX(-50%) scale(1); }\n }\n "})]})},exports.TkxSpin=function({spinning:e=!0,size:r="md",tip:i,indicator:a,children:s,fullscreen:d=!1,delay:c=0,style:p}){const u=t.useTheme(),h=o.useReducedMotion(),[f,m]=(0,l.useState)(0===c&&e),g=(0,l.useRef)(null);if((0,l.useEffect)(()=>(e&&c>0?g.current=setTimeout(()=>m(!0),c):m(e),()=>{null!==g.current&&clearTimeout(g.current)}),[e,c]),!f)return s?(0,l.createElement)("div",{style:p},s):null;const x=wo[r],y=i?n.sanitizeString(i):void 0,b=(0,l.createElement)("div",{role:"status","aria-live":"polite","aria-label":y??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},a??(0,l.createElement)(Co,{size:x.dimension,borderWidth:x.borderWidth,color:u.primary,reducedMotion:h}),y&&(0,l.createElement)("span",{style:{color:u.primary,fontSize:x.fontSize,marginTop:"4px"}},y));return d?(0,l.createElement)("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${u.bg}cc`,zIndex:9999,...p}},b):s?(0,l.createElement)("div",{style:{position:"relative",...p}},(0,l.createElement)("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:h?"none":"opacity 0.2s, filter 0.2s"}},s),(0,l.createElement)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${u.bg}66`,borderRadius:"4px"}},b)):(0,l.createElement)("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...p}},b)},exports.TkxStatistic=function({title:e,value:r,prefix:i,suffix:a,precision:s,groupSeparator:d=",",valueStyle:c,loading:p=!1,trend:u,trendValue:h,style:f}){const m=t.useTheme(),g=o.useReducedMotion(),x=n.sanitizeString(e),y=h?n.sanitizeString(h):void 0,b="up"===u?m.success:"down"===u?m.danger:void 0;return(0,l.createElement)("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...f}},(0,l.createElement)("div",{style:{color:m.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},x),p?(0,l.createElement)(Io,{w:"120px",h:"32px",alt:m.surfaceAlt,bdr:m.border,rm:g}):(0,l.createElement)("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:m.text,fontVariantNumeric:"tabular-nums",...c}},i&&(0,l.createElement)("span",{style:{fontSize:"0.75em",fontWeight:400}},i),(0,l.createElement)("span",null,function(e,t,n=","){if("string"==typeof e)return e;const[o,r]=(void 0!==t?e.toFixed(t):String(e)).split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,n);return void 0!==r?`${i}.${r}`:i}(r,s,d)),a&&(0,l.createElement)("span",{style:{fontSize:"0.6em",fontWeight:400,color:m.textMuted}},a)),u&&(0,l.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:b,marginTop:"2px"}},(0,l.createElement)(No,{direction:u,color:b}),y&&(0,l.createElement)("span",null,y)))},exports.TkxStepper=Lt,exports.TkxTab=function({index:e,children:o,disabled:r=!1,className:i,style:s}){const d=t.useTheme(),{activeIndex:c,setActiveIndex:p,baseId:u,tabCount:h}=W(),f=(0,l.useRef)(null),m=c===e;return(0,a.jsx)("button",{ref:f,role:"tab",id:`${u}-tab-${e}`,"aria-controls":`${u}-panel-${e}`,"aria-selected":m,tabIndex:m?0:-1,disabled:r,className:n.cx(n.tkx("border-none bg-transparent font-sans text-sm rounded-t cursor-pointer select-none","py-2.5 px-4 transition-colors duration-150 focus-visible:focus-ring",r?"opacity-50 cursor-not-allowed":""),i),style:{color:m?d.primary:d.textMuted,fontWeight:m?600:400,borderBottom:m?`2px solid ${d.primary}`:"2px solid transparent",marginBottom:"-2px",...s},onClick:()=>!r&&p(e),onKeyDown:n=>t.handleTabsKeyboard(n,e,h,e=>{p(e),document.getElementById(`${u}-tab-${e}`)?.focus()}),children:o})},exports.TkxTabList=function({children:e,className:o,style:r,...i}){const l=t.useTheme();return(0,a.jsx)("div",{role:"tablist",className:n.cx(n.tkx("flex gap-1"),o),style:{borderBottom:`2px solid ${l.border}`,...r},...i,children:e})},exports.TkxTabPanel=function({index:e,children:t,style:o,className:r}){const{activeIndex:i,baseId:l}=W();return i!==e?null:(0,a.jsx)("div",{role:"tabpanel",id:`${l}-panel-${e}`,"aria-labelledby":`${l}-tab-${e}`,tabIndex:0,className:n.cx(n.tkx("pt-4"),r),style:o,children:t})},exports.TkxTabPanels=function({children:e,className:t,...n}){return(0,a.jsx)("div",{className:t,...n,children:e})},exports.TkxTable=function({columns:e,data:o,caption:r,sortable:i,stickyHeader:s,isLoading:d,emptyState:c,style:p,className:u,striped:h,maxHeight:f,rowHeight:m=44,virtualScroll:g,onLoadMore:x,hasMore:y,loadingMore:b=!1,onRowClick:v,selectedRows:w,bordered:k,compact:S}){const C=t.useTheme(),[$,z]=(0,l.useState)(null),[N,M]=(0,l.useState)("asc"),I=(0,l.useMemo)(()=>$&&i?[...o].sort((e,t)=>{const n=e[$],o=t[$];let r=0;return"string"==typeof n&&"string"==typeof o?r=n.localeCompare(o):"number"==typeof n&&"number"==typeof o&&(r=n-o),"asc"===N?r:-r}):o,[o,$,N,i]),D=(0,l.useCallback)(e=>{$===e?M(e=>"asc"===e?"desc":"asc"):(z(e),M("asc"))},[$]),W=void 0!==g?g:void 0!==f&&I.length>=50,L=(0,l.useRef)(null),[R,A]=(0,l.useState)(0),[B,F]=(0,l.useState)(400),j=(0,l.useCallback)(()=>{L.current&&A(L.current.scrollTop)},[]);(0,l.useEffect)(()=>{if(!W||!L.current)return;const e=L.current;F(e.clientHeight);const t=new ResizeObserver(()=>F(e.clientHeight));return t.observe(e),()=>t.disconnect()},[W]);const H=W?Math.max(0,Math.floor(R/m)-5):0,P=W?Math.min(I.length,Math.ceil((R+B)/m)+5):I.length,O=W?I.slice(H,P):I,V=(0,l.useRef)(null),K=(0,l.useRef)(!1);(0,l.useEffect)(()=>{K.current=!1},[o.length]),(0,l.useEffect)(()=>{if(!x)return;const e=V.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!K.current&&!1!==y&&(K.current=!0,x())},{root:L.current,rootMargin:"0px 0px 200px 0px",threshold:0});return t.observe(e),()=>t.disconnect()},[x,y]);const U=S?"4px":"12px",Y=S?"8px":"16px",q=k?`1px solid ${C.border}`:"none",X=(0,l.useMemo)(()=>new Set(w??[]),[w]);return(0,a.jsx)("div",{className:n.tkx("w-full rounded-lg",u??""),style:{border:`1px solid ${C.border}`,overflow:"hidden",...p},children:(0,a.jsxs)("div",{ref:L,onScroll:W?j:void 0,style:{overflowX:"auto",overflowY:f?"auto":"visible",maxHeight:f??"none"},children:[(0,a.jsxs)("table",{className:n.tkx("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:C.text},children:[r&&(0,a.jsx)("caption",{className:n.tkx("text-sm text-left p-2"),style:{color:C.textMuted},children:n.sanitizeString(r)}),(0,a.jsx)("thead",{style:s?{position:"sticky",top:0,backgroundColor:C.surfaceAlt,zIndex:1}:{backgroundColor:C.surfaceAlt},children:(0,a.jsx)("tr",{children:e.map(e=>{const t=i&&!1!==e.sortable,o=(r=e.key,$!==r?"none":N);var r;return(0,a.jsx)("th",{scope:"col","aria-sort":t?"none"===o?"none":"asc"===o?"ascending":"descending":void 0,className:n.tkx("text-left font-semibold whitespace-nowrap",t?"cursor-pointer select-none":""),style:{padding:`${U} ${Y}`,color:C.textMuted,borderBottom:`2px solid ${C.border}`,borderRight:q,width:e.width},onClick:()=>t&&D(e.key),onKeyDown:n=>{!t||"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),D(e.key))},tabIndex:t?0:void 0,children:(0,a.jsxs)("span",{className:n.tkx("inline-flex items-center gap-1.5"),children:[n.sanitizeString(e.header),t&&(0,a.jsx)(E,{dir:o})]})},String(e.key))})})}),(0,a.jsx)("tbody",{children:d?Array.from({length:5},(t,n)=>(0,a.jsx)("tr",{children:e.map(e=>(0,a.jsx)("td",{style:{padding:`${U} ${Y}`},children:(0,a.jsx)(T,{variant:"text",height:"16px"})},String(e.key)))},n)):0===I.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:e.length,className:n.tkx("text-center"),style:{padding:"32px 16px",color:C.textMuted},children:c??"No data available"})}):(0,a.jsxs)(a.Fragment,{children:[W&&H>0&&(0,a.jsx)("tr",{"aria-hidden":"true",style:{height:H*m},children:(0,a.jsx)("td",{colSpan:e.length,style:{padding:0,border:"none"}})}),O.map((t,o)=>{const r=H+o,i=X.has(r);return(0,a.jsx)("tr",{"aria-rowindex":r+1,"aria-selected":i||void 0,onClick:v?()=>v(t,r):void 0,onKeyDown:v?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),v(t,r))}:void 0,tabIndex:v?0:void 0,className:n.tkx(v?"cursor-pointer":""),style:{backgroundColor:i?`${C.primary}22`:h&&r%2==1?C.surfaceAlt:"transparent",borderBottom:`1px solid ${C.border}`,...W?{height:m,boxSizing:"border-box"}:{}},children:e.map(e=>{const o=t[e.key],r=e.render?e.render(o,t):"string"==typeof o?n.sanitizeString(o):String(o??"");return(0,a.jsx)("td",{style:{padding:`${U} ${Y}`,color:C.text,borderRight:q},children:r},String(e.key))})},r)}),W&&P<I.length&&(0,a.jsx)("tr",{"aria-hidden":"true",style:{height:(I.length-P)*m},children:(0,a.jsx)("td",{colSpan:e.length,style:{padding:0,border:"none"}})})]})})]}),(y||b)&&(0,a.jsx)("div",{ref:V,style:{height:1,width:"100%"},children:b&&(0,a.jsx)("table",{style:{width:"100%",borderCollapse:"collapse"},children:(0,a.jsx)("tbody",{children:Array.from({length:3},(t,n)=>(0,a.jsx)("tr",{children:e.map(e=>(0,a.jsx)("td",{style:{padding:"10px 16px"},children:(0,a.jsx)(T,{variant:"text",height:"16px"})},String(e.key)))},n))})})}),!y&&x&&(0,a.jsx)("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:C.textMuted},children:"✓ All rows loaded"})]})})},exports.TkxTabs=function({defaultIndex:e=0,activeIndex:t,onChange:n,children:o,tabCount:r=0,style:i,className:s}){const[d,c]=(0,l.useState)(e),p=(0,l.useId)(),u=void 0!==t?t:d;return(0,a.jsx)(D.Provider,{value:{activeIndex:u,setActiveIndex:e=>{void 0===t&&c(e),n?.(e)},baseId:p,tabCount:r},children:(0,a.jsx)("div",{className:s,style:i,children:o})})},exports.TkxTag=nt,exports.TkxTagInput=function({value:e,defaultValue:r=[],onChange:i,placeholder:s="Add tag…",maxTags:d,allowDuplicates:c=!1,validate:p,colorScheme:u="primary",size:h="md",label:f,hint:m,isDisabled:g=!1}){const x=t.useTheme(),y=o.useReducedMotion(),[b,v]=(0,l.useState)(r),[w,k]=(0,l.useState)(""),[S,C]=(0,l.useState)(null),$=(0,l.useRef)(null),z=void 0!==e,N=z?e:b,M=(0,l.useCallback)(e=>{z||v(e),i?.(e)},[z,i]),I=(0,l.useCallback)(e=>{const t=e.trim();if(t)if(void 0!==d&&N.length>=d)C(`Maximum ${d} tags allowed`);else if(c||!N.includes(t)){if(p){const e=p(t);if(!1===e)return void C("Invalid tag");if("string"==typeof e)return void C(e)}C(null),M([...N,t]),k("")}else C("Duplicate tags are not allowed")},[N,d,c,p,M]),D=(0,l.useCallback)(e=>{M(N.filter((t,n)=>n!==e)),C(null)},[N,M]),W=(0,l.useCallback)(e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),I(w)):"Backspace"===e.key&&""===w&&N.length>0&&D(N.length-1)},[w,N,I,D]),L=(0,l.useCallback)(e=>{const t=e.target.value;t.endsWith(",")?I(t.slice(0,-1)):(k(t),S&&C(null))},[I,S]),R="sm"===h?"6px 8px":"lg"===h?"10px 12px":"8px 10px",T="sm"===h?11:"lg"===h?14:12;return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-1.5"),children:[f&&(0,a.jsx)("label",{className:n.tkx("text-sm font-medium"),style:{color:x.text},onClick:()=>$.current?.focus(),children:n.sanitizeString(f)}),(0,a.jsxs)("div",{className:n.tkx("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!y&&"transition-colors duration-150"),style:{padding:R,backgroundColor:x.surface,border:`1.5px solid ${S?x.danger:x.border}`,opacity:g?.55:1,minHeight:"sm"===h?36:"lg"===h?48:40},onClick:()=>!g&&$.current?.focus(),children:[N.map((e,t)=>(0,a.jsx)(nt,{size:h,variant:"subtle",colorScheme:u,onRemove:g?void 0:()=>D(t),isDisabled:g,children:e},`${e}-${t}`)),(!d||N.length<d)&&!g&&(0,a.jsx)("input",{ref:$,type:"text",value:w,onChange:L,onKeyDown:W,placeholder:0===N.length?n.sanitizeString(s):"",disabled:g,className:n.tkx("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:T,color:x.text,caretColor:x.primary},"aria-label":f??"Tag input"})]}),S&&(0,a.jsx)("p",{className:n.tkx("text-xs"),style:{color:x.danger},role:"alert",children:S}),m&&!S&&(0,a.jsx)("p",{className:n.tkx("text-xs"),style:{color:x.textMuted},children:n.sanitizeString(m)})]})},exports.TkxText=function({children:e,type:o="default",strong:r=!1,italic:i=!1,underline:a=!1,delete:s=!1,code:d=!1,mark:c=!1,copyable:p=!1,style:u}){const h=bo(o),f=t.useTheme(),m=xo(e),g="string"==typeof e?n.sanitizeString(e):e,x=[];a&&x.push("underline"),s&&x.push("line-through");let y=g;return d&&(y=(0,l.createElement)("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:f.surfaceAlt,border:`1px solid ${f.border}`,borderRadius:"4px",fontFamily:"monospace"}},y)),c&&(y=(0,l.createElement)("mark",{style:{backgroundColor:`${f.warning}33`,color:h,padding:"0 2px",borderRadius:"2px"}},y)),(0,l.createElement)(r?"strong":i?"em":"span",{style:{color:h,fontStyle:i?"italic":"normal",textDecoration:x.length>0?x.join(" "):"none",...u}},y,p&&(0,l.createElement)(yo,{text:m}))},exports.TkxThinkingIndicator=_e,exports.TkxTimeline=function({items:e,variant:r="default",orientation:i="vertical",connectorStyle:s="solid"}){const d=t.useTheme(),c=o.useReducedMotion(),p=(0,l.useRef)(!1);(0,l.useEffect)(()=>{!function(){if(ot||"undefined"==typeof document)return;ot=!0;const e=document.createElement("style");e.textContent="\n @keyframes tkx-pulse-dot { 0%,100% { box-shadow:0 0 0 0 currentColor; opacity:1; } 70% { box-shadow:0 0 0 8px transparent; opacity:0.7; } }\n @keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }\n @keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }\n .tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }\n .tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }\n .tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }\n ",document.head.appendChild(e)}(),p.current=!0},[]);const u=!c,h="compact"===r,f="alternating"===r&&"vertical"===i;return"horizontal"===i?(0,a.jsx)("div",{role:"list","aria-label":"Timeline",className:n.tkx("flex items-start w-full overflow-x-auto"),children:e.map((t,o)=>{const r=t.status??"pending",i="completed"===r?d.success:d.border,l=o===e.length-1;return(0,a.jsx)("div",{role:"listitem",className:n.tkx("flex items-start flex-1 min-w-0"),children:(0,a.jsxs)("div",{className:n.tkx("flex flex-col items-center flex-1 min-w-0"),children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center w-full"),children:[o>0&&(0,a.jsx)(lt,{style:s,color:i,animate:u}),(0,a.jsx)(rt,{status:r,icon:t.icon,size:24}),!l&&(0,a.jsx)(lt,{style:s,color:i,animate:u})]}),(0,a.jsxs)("div",{className:n.tkx("mt-2 px-1 text-center min-w-0 w-full"),children:[(0,a.jsx)("div",{className:n.tkx("text-xs font-semibold truncate"),style:{color:d.text},children:"string"==typeof t.title?n.sanitizeString(t.title):t.title}),t.timestamp&&(0,a.jsx)("div",{className:n.tkx("text-[10px] mt-0.5"),style:{color:d.textMuted},children:n.sanitizeString(t.timestamp)})]})]})},t.id)})}):(0,a.jsx)("div",{role:"list","aria-label":"Timeline",className:n.tkx("flex flex-col"),children:e.map((t,o)=>{const r=t.status??"pending",i=o===e.length-1,l="completed"===r?d.success:d.border,c=f&&o%2==0;return f?(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex items-stretch gap-0"),children:[(0,a.jsx)("div",{className:n.tkx("flex-1 flex flex-col items-end pr-4",c?"":"invisible"),children:c&&(0,a.jsx)(at,{item:t,compact:h})}),(0,a.jsxs)("div",{className:n.tkx("flex flex-col items-center"),children:[(0,a.jsx)(rt,{status:r,icon:t.icon,size:28}),!i&&(0,a.jsx)(it,{style:s,color:l,animate:u})]}),(0,a.jsx)("div",{className:n.tkx("flex-1 flex flex-col items-start pl-4",c?"invisible":""),children:!c&&(0,a.jsx)(at,{item:t,compact:h})})]},t.id):(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex gap-3 items-stretch"),children:[(0,a.jsxs)("div",{className:n.tkx("flex flex-col items-center"),children:[(0,a.jsx)(rt,{status:r,icon:t.icon,size:h?22:28}),!i&&(0,a.jsx)(it,{style:s,color:l,animate:u})]}),(0,a.jsx)("div",{className:n.tkx("flex-1 min-w-0 pt-0.5"),children:(0,a.jsx)(at,{item:t,compact:h})})]},t.id)})})},exports.TkxTitle=function({level:e=1,children:o,copyable:r=!1,type:i="default",style:a}){const s=bo(i);t.useTheme();const d=vo[e],c=`h${e}`,p="string"==typeof o?n.sanitizeString(o):o,u=xo(o);return(0,l.createElement)(c,{style:{color:s,fontSize:d.fontSize,lineHeight:d.lineHeight,fontWeight:d.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...a}},p,r&&(0,l.createElement)(yo,{text:u}))},exports.TkxToastProvider=function({position:e="top-right",children:t}){const[i,d]=(0,l.useState)([..._]),c=o.useReducedMotion(),p=r.useLocale();(0,l.useEffect)(()=>{d([..._]);const e=e=>d([...e]);return G.add(e),()=>{G.delete(e)}},[]);const u=e.startsWith("bottom"),h=oe[e],f=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(!f.current&&"undefined"!=typeof document&&(f.current=!0,!document.getElementById("tkx-toast-kf"))){const e=document.createElement("style");e.id="tkx-toast-kf",e.textContent="\n @keyframes tkx-toast-slide-down {\n from { opacity: 0; transform: translateY(-16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-toast-slide-up {\n from { opacity: 0; transform: translateY(16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}},[]),"undefined"==typeof document)return(0,a.jsx)(a.Fragment,{children:t});const m=u?[...i].reverse():i;return(0,a.jsxs)(a.Fragment,{children:[t,(0,s.createPortal)((0,a.jsx)("div",{"aria-label":p.notifications??"Notifications",className:n.tkx("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:h,children:m.map(t=>(0,a.jsx)("div",{className:n.tkx("pointer-events-auto"),children:(0,a.jsx)(ie,{toast:t,position:e,onDismiss:te,reduced:c})},t.id))}),document.body)]})},exports.TkxToggle=$,exports.TkxToolbar=function({items:e,orientation:r="horizontal",size:i="md",variant:s="default",ariaLabel:d="Toolbar",className:c,style:p}){const u=t.useTheme(),h=o.useReducedMotion(),f=pn[i],m="horizontal"===r,g=(0,l.useRef)(new Map),x=e.filter(e=>"separator"!==e.type&&!e.disabled).map(e=>e.id),y=(0,l.useCallback)(e=>{g.current.get(e)?.focus()},[]),b=(0,l.useCallback)((e,t)=>{const n=x.indexOf(t);if(n<0)return;const o=m?"ArrowRight":"ArrowDown",r=m?"ArrowLeft":"ArrowUp";switch(e.key){case o:e.preventDefault(),y(x[n+1<x.length?n+1:0]);break;case r:e.preventDefault(),y(x[n-1>=0?n-1:x.length-1]);break;case"Home":e.preventDefault(),y(x[0]);break;case"End":e.preventDefault(),y(x[x.length-1])}},[x,y,m]),v=e=>{e.type;const t=e.active;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,padding:`${f.buttonPy}px ${f.buttonPx}px`,fontSize:f.fontSize,borderRadius:6,border:"none",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:t?`${u.primary}20`:"transparent",color:t?u.primary:e.disabled?u.textMuted:u.text,opacity:e.disabled?.5:1,outline:"none",transition:h?"none":"all 100ms ease",whiteSpace:"nowrap",lineHeight:1}};return(0,a.jsx)("div",{role:"toolbar","aria-label":d,"aria-orientation":r,className:n.tkx("inline-flex items-center rounded-lg font-sans",m?"flex-row":"flex-col",c??""),style:{...(()=>{switch(s){case"outlined":return{backgroundColor:"transparent",border:`1px solid ${u.border}`};case"filled":return{backgroundColor:u.surfaceAlt,border:"none"};default:return{backgroundColor:u.surface,border:`1px solid ${u.border}`}}})(),padding:f.gap,gap:f.gap,...p},children:e.map((e,t)=>{if("separator"===e.type)return(0,a.jsx)("div",{role:"separator","aria-orientation":m?"vertical":"horizontal",className:n.tkx("flex-shrink-0"),style:{...m?{width:1,height:f.separatorSize,marginLeft:2,marginRight:2}:{height:1,width:f.separatorSize,marginTop:2,marginBottom:2},backgroundColor:u.border}},e.id);const o=n.sanitizeString(e.label),r=!e.disabled,i=x[0]===e.id;return(0,a.jsxs)("button",{ref:t=>{t?g.current.set(e.id,t):g.current.delete(e.id)},type:"button",role:void e.type,"aria-pressed":"toggle"===e.type?e.active:void 0,"aria-label":o,"aria-disabled":e.disabled||void 0,tabIndex:r&&i?0:-1,disabled:e.disabled,onClick:()=>{e.disabled||e.onClick?.()},onKeyDown:t=>{b(t,e.id),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.disabled||e.onClick?.())},className:n.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:v(e),onMouseEnter:t=>{e.disabled||e.active||(t.currentTarget.style.backgroundColor=u.surfaceAlt)},onMouseLeave:t=>{e.disabled||(t.currentTarget.style.backgroundColor=e.active?`${u.primary}20`:"transparent")},children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",style:{width:f.iconSize,height:f.iconSize,display:"flex",alignItems:"center",justifyContent:"center"},children:e.icon}),!e.icon&&o]},e.id)})})},exports.TkxTooltip=function({content:e,children:r,placement:i="top",delay:s=300}){const d=t.useTheme(),[c,p]=(0,l.useState)(!1),u=(0,l.useRef)(null),h=(0,l.useId)(),f=(0,l.useRef)(null),m=o.useReducedMotion(),g=n.sanitizeString(e),x=t.getAccessibleForeground(d.surfaceAlt,[d.text,"#ffffff","#000000"]);function y(){f.current=setTimeout(()=>p(!0),s)}function b(){f.current&&clearTimeout(f.current),p(!1)}o.useEscapeKey(b,c),o.useClickOutside(u,b),(0,l.useEffect)(()=>()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]);const v=r,w=(0,l.cloneElement)(v,{"aria-describedby":c?h:void 0,onMouseEnter:e=>{v.props.onMouseEnter?.(e),y()},onMouseLeave:e=>{v.props.onMouseLeave?.(e),b()},onFocus:e=>{v.props.onFocus?.(e),y()},onBlur:e=>{v.props.onBlur?.(e),b()}});return(0,a.jsxs)("span",{ref:u,className:n.tkx("relative inline-flex"),children:[w,c&&(0,a.jsx)("span",{id:h,role:"tooltip",className:n.tkx("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!m&&"animate-fade-in"),style:{backgroundColor:d.surfaceAlt,color:x,border:`1px solid ${d.border}`,boxShadow:`0 4px 12px ${d.bg}40`,maxWidth:280,...L[i]},children:g})]})},exports.TkxTour=function({steps:e,isOpen:r=!1,onClose:i,current:d,onChange:c}){const p=t.useTheme(),u=o.useReducedMotion(),[h,f]=(0,l.useState)(0),m=d??h,g=(0,l.useRef)(null),[x,y]=(0,l.useState)({top:0,left:0}),[b,v]=(0,l.useState)(null),w=e[m],k=(0,l.useCallback)(()=>{if(!w)return;const e=function(e){const t=document.querySelector(e);return t?t.getBoundingClientRect():null}(w.target);if(v(e),e&&g.current){const t=g.current.offsetWidth,n=g.current.offsetHeight;y(function(e,t,n,o){switch(t){case"top":return{top:e.top-o-12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case"bottom":return{top:e.bottom+12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case"left":return{top:e.top+e.height/2-o/2+window.scrollY,left:e.left-n-12+window.scrollX};case"right":return{top:e.top+e.height/2-o/2+window.scrollY,left:e.right+12+window.scrollX};default:return{top:e.bottom+12+window.scrollY,left:e.left+window.scrollX}}}(e,w.placement??"bottom",t,n))}},[w]);(0,l.useEffect)(()=>{if(r)return k(),window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0)}},[r,m,k]),(0,l.useEffect)(()=>{r&&g.current?.focus()},[r,m]);const S=(0,l.useCallback)(e=>{f(e),c?.(e)},[c]),C=(0,l.useCallback)(()=>{m<e.length-1?S(m+1):i?.()},[m,e.length,S,i]),$=(0,l.useCallback)(()=>{m>0&&S(m-1)},[m,S]);if(!r||!w)return null;const z=n.sanitizeString(w.title),N=n.sanitizeString(w.description);return(0,s.createPortal)((0,a.jsxs)("div",{"aria-hidden":"true",children:[(0,a.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9998,backgroundColor:"rgba(0,0,0,0.55)",clipPath:b?`polygon(0% 0%, 0% 100%, ${b.left-6}px 100%, ${b.left-6}px ${b.top-6}px, ${b.right+6}px ${b.top-6}px, ${b.right+6}px ${b.bottom+6}px, ${b.left-6}px ${b.bottom+6}px, ${b.left-6}px 100%, 100% 100%, 100% 0%)`:void 0,transition:u?"none":"clip-path 0.25s ease"},onClick:i}),(0,a.jsxs)("div",{ref:g,role:"dialog","aria-modal":"true","aria-label":`Tour step ${m+1} of ${e.length}`,tabIndex:-1,style:{position:"absolute",zIndex:9999,top:x.top,left:x.left,width:300,backgroundColor:p.surface,border:`1px solid ${p.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${p.bg}80`,animation:u?"none":"tkxFadeIn 0.2s ease",fontFamily:"inherit"},onKeyDown:e=>{"Escape"===e.key&&i?.()},children:[(0,a.jsx)("h3",{className:n.tkx("m-0 mb-2 text-base font-semibold"),style:{color:p.text},children:z}),(0,a.jsx)("p",{className:n.tkx("m-0 mb-4 text-sm leading-relaxed"),style:{color:p.textMuted},children:N}),(0,a.jsx)("div",{className:n.tkx("flex items-center gap-1 mb-4"),"aria-label":"Tour progress",children:e.map((e,t)=>(0,a.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",backgroundColor:t===m?p.primary:p.border,transition:u?"none":"background-color 0.2s"}},t))}),(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between gap-2"),children:[(0,a.jsx)("button",{type:"button","aria-label":"Skip tour",onClick:i,className:n.tkx("border-0 bg-transparent cursor-pointer text-sm px-2 py-1"),style:{color:p.textMuted},children:"Skip"}),(0,a.jsxs)("div",{className:n.tkx("flex gap-2"),children:[m>0&&(0,a.jsx)("button",{type:"button","aria-label":"Previous step",onClick:$,className:n.tkx("rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent"),style:{borderColor:p.border,color:p.text},children:"Prev"}),(0,a.jsx)("button",{type:"button","aria-label":m===e.length-1?"Finish tour":"Next step",onClick:C,className:n.tkx("rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium"),style:{backgroundColor:p.primary,color:"#fff"},children:m===e.length-1?"Finish":"Next"})]})]})]})]}),document.body)},exports.TkxTransferList=function({sourceItems:e,targetItems:r,onTransfer:i,sourceTitle:s="Available",targetTitle:d="Selected",searchable:c=!1,height:p=300,className:u,style:h}){const f=t.useTheme(),m=o.useReducedMotion(),g=(0,l.useId)(),x=(0,l.useId)(),[y,b]=(0,l.useState)(new Set),[v,w]=(0,l.useState)(new Set),[k,S]=(0,l.useState)(""),[C,$]=(0,l.useState)(""),z=(0,l.useCallback)(e=>{b(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),N=(0,l.useCallback)(e=>{w(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),M=(0,l.useCallback)(()=>{const t=e.filter(e=>!e.disabled).map(e=>e.value);t.every(e=>y.has(e))?b(new Set):b(new Set(t))},[e,y]),I=(0,l.useCallback)(()=>{const e=r.filter(e=>!e.disabled).map(e=>e.value);e.every(e=>v.has(e))?w(new Set):w(new Set(e))},[r,v]),D=(0,l.useCallback)(()=>{if(0===y.size)return;const t=e.filter(e=>y.has(e.value)&&!e.disabled);i(e.filter(e=>!y.has(e.value)||e.disabled),[...r,...t]),b(new Set)},[e,r,y,i]),W=(0,l.useCallback)(()=>{if(0===v.size)return;const t=r.filter(e=>v.has(e.value)&&!e.disabled),n=r.filter(e=>!v.has(e.value)||e.disabled);i([...e,...t],n),w(new Set)},[e,r,v,i]),L=e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:`1px solid ${f.border}`,backgroundColor:e?f.surface:f.surfaceAlt,cursor:e?"not-allowed":"pointer",opacity:e?.5:1,transition:m?"none":"all 100ms ease",outline:"none"});return(0,a.jsxs)("div",{className:n.tkx("flex gap-3 font-sans","flex-col sm:flex-row",u??""),style:{color:f.text,...h},children:[(0,a.jsx)(gn,{title:s,items:e,selected:y,onToggle:z,onToggleAll:M,search:k,onSearchChange:S,searchable:c,height:p,listId:g}),(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-center gap-2","flex-row sm:flex-col"),style:{padding:"8px 0"},children:[(0,a.jsx)("button",{type:"button","aria-label":"Move selected items to target list",disabled:0===y.size,onClick:D,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),D())},className:n.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:L(0===y.size),onMouseEnter:e=>{y.size>0&&(e.currentTarget.style.backgroundColor=f.primary,e.currentTarget.style.borderColor=f.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===y.size?f.surface:f.surfaceAlt,e.currentTarget.style.borderColor=f.border},children:(0,a.jsx)(fn,{color:f.text})}),(0,a.jsx)("button",{type:"button","aria-label":"Move selected items to source list",disabled:0===v.size,onClick:W,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),W())},className:n.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:L(0===v.size),onMouseEnter:e=>{v.size>0&&(e.currentTarget.style.backgroundColor=f.primary,e.currentTarget.style.borderColor=f.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===v.size?f.surface:f.surfaceAlt,e.currentTarget.style.borderColor=f.border},children:(0,a.jsx)(mn,{color:f.text})})]}),(0,a.jsx)(gn,{title:d,items:r,selected:v,onToggle:N,onToggleAll:I,search:C,onSearchChange:$,searchable:c,height:p,listId:x})]})},exports.TkxTreeView=function({data:e,selected:r,onSelect:i,expanded:s,onExpand:d,multiSelect:c=!1,showCheckboxes:p=!1,showLines:u=!1,className:h,style:f}){const m=t.useTheme(),g=o.useReducedMotion();(0,l.useId)();const[x,y]=(0,l.useState)([]),[b,v]=(0,l.useState)([]),w=new Set(r??x),k=new Set(s??b),S=(0,l.useCallback)(e=>{void 0===s&&v(e),d?.(e)},[s,d]),C=(0,l.useCallback)(e=>{void 0===r&&y(e),i?.(e)},[r,i]),$=(0,l.useCallback)(e=>{const t=Array.from(k);k.has(e)?S(t.filter(t=>t!==e)):S([...t,e])},[k,S]),z=(0,l.useCallback)(e=>{if(c){const t=Array.from(w);w.has(e)?C(t.filter(t=>t!==e)):C([...t,e])}else C(w.has(e)?[]:[e])},[c,w,C]),N=function(e,t){const n=[];return function e(o,r){for(const i of o)n.push({node:i,depth:r}),i.children?.length&&t.has(i.id)&&e(i.children,r+1)}(e,0),n}(e,k),M=(0,l.useRef)(0),I=(0,l.useRef)(new Map),D=e=>{M.current=e,I.current.get(e)?.focus()};return(0,a.jsx)("ul",{role:"tree","aria-label":"Tree view","aria-multiselectable":c||void 0,className:n.tkx("list-none m-0 p-0 font-sans select-none",h??""),style:{color:m.text,...f},children:N.map(({node:e,depth:t},o)=>{const r=(e.children?.length??0)>0,i=k.has(e.id),l=w.has(e.id),s=n.sanitizeString(e.label);return(0,a.jsxs)("li",{role:"treeitem","aria-selected":l,"aria-expanded":r?i:void 0,"aria-disabled":e.disabled||void 0,"aria-level":t+1,"aria-setsize":N.filter(e=>e.depth===t).length,tabIndex:0===o?0:-1,ref:e=>{e?I.current.set(o,e):I.current.delete(o)},onKeyDown:e=>((e,t)=>{const n=N[t];if(!n)return;const{node:o}=n,r=(o.children?.length??0)>0;switch(e.key){case"ArrowDown":e.preventDefault(),t<N.length-1&&D(t+1);break;case"ArrowUp":e.preventDefault(),t>0&&D(t-1);break;case"ArrowRight":e.preventDefault(),r&&!k.has(o.id)?$(o.id):r&&k.has(o.id)&&t<N.length-1&&D(t+1);break;case"ArrowLeft":if(e.preventDefault(),r&&k.has(o.id))$(o.id);else for(let e=t-1;e>=0;e--)if(N[e].depth<n.depth){D(e);break}break;case"Enter":case" ":e.preventDefault(),o.disabled||z(o.id);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),D(N.length-1)}})(e,o),onClick:()=>{e.disabled||(r&&$(e.id),z(e.id))},className:n.tkx("relative flex items-center gap-1.5 py-1 px-2 rounded-md cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",e.disabled?"opacity-50 cursor-not-allowed":""),style:{paddingLeft:24*t+8,backgroundColor:l?`${m.primary}18`:"transparent",transition:g?"none":"background-color 100ms ease",minHeight:32},onMouseEnter:t=>{l||e.disabled||(t.currentTarget.style.backgroundColor=m.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=l?`${m.primary}18`:"transparent"},children:[u&&t>0&&(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",left:24*(t-1)+16,top:0,bottom:0,width:1,backgroundColor:m.border}}),r?(0,a.jsx)("span",{role:"presentation",onClick:t=>{t.stopPropagation(),$(e.id)},className:n.tkx("inline-flex items-center justify-center cursor-pointer"),style:{width:20,height:20},children:(0,a.jsx)(dn,{expanded:i,color:m.textMuted,reducedMotion:g})}):(0,a.jsx)("span",{style:{width:20,height:20},"aria-hidden":"true"}),p&&(0,a.jsx)(cn,{checked:l,color:m.primary,borderColor:m.border}),e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),(0,a.jsx)("span",{className:n.tkx("text-sm truncate"),style:{color:e.disabled?m.textMuted:m.text},children:s})]},e.id)})})},exports.TkxVideoPlayer=zt,exports.TkxVoterIdInput=Pr,exports.TkxWatermark=function({text:e,children:r,rotate:i=-22,gap:s=[100,100],fontSize:d=14,color:c,zIndex:p=10,pattern:u="tiled",dynamic:h=!1,refreshMs:f=0,intensifyOnDevtools:m=!1,fingerprintId:g}){const x=t.useTheme(),y=o.useReducedMotion(),b=(0,l.useRef)(null),[v,w]=(0,l.useState)(""),[k,S]=(0,l.useState)(0),C=To(),$=(0,l.useMemo)(()=>{const t=(Array.isArray(e)?e:[e]).map(e=>n.sanitizeString(e));return"fingerprint"===u?function(e,t){return[...e,`id:${t||("undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10))} • ${(new Date).toISOString().slice(0,16).replace("T"," ")}`]}(t,g):t},[e,u,g,k]),z=m&&C?"66":"22",N=c??`${x.textMuted}${z}`,M=(0,l.useCallback)(()=>function(e,t,n,o,r,i){if("undefined"==typeof document)return"";const l=document.createElement("canvas"),a=l.getContext("2d");if(!a)return"";const s=1.5*o,d=e.length*s,c=Math.max(...e.map(e=>e.length))*o*.6;let p,u;return"single"===i?(p=Math.max(800,1.6*c),u=Math.max(600,4*d)):(p=n[0]+c,u=n[1]+d),l.width=2*p,l.height=2*u,a.scale(2,2),a.translate(p/2,u/2),a.rotate(t*Math.PI/180),a.font=`${o}px sans-serif`,a.fillStyle=r,a.textAlign="center",a.textBaseline="middle",e.forEach((t,n)=>{const o=(n-(e.length-1)/2)*s;a.fillText(t,0,o)}),l.toDataURL()}($,i,s,d,N,u),[$,i,s,d,N,u]);(0,l.useEffect)(()=>{const e=M();e&&w(`url(${e})`)},[M]),(0,l.useEffect)(()=>{if(!f||f<=0)return;const e=window.setInterval(()=>S(e=>e+1),f);return()=>window.clearInterval(e)},[f]),(0,l.useEffect)(()=>{if(!h||"undefined"==typeof document)return;const e=()=>{"visible"===document.visibilityState&&S(e=>e+1)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[h]),(0,l.useEffect)(()=>{const e=b.current?.querySelector("[data-watermark]");if(!e)return;const t=new MutationObserver(()=>{const t=M();t&&(e.style.backgroundImage=`url(${t})`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[M]);const I={zIndex:p,backgroundImage:v,backgroundRepeat:"single"===u?"no-repeat":"repeat",backgroundPosition:"single"===u?"center center":void 0,animation:y?"none":"tkxFadeIn 0.3s ease"},D=m&&C?{filter:"blur(4px)",transition:"filter 0.2s"}:{};return(0,a.jsxs)("div",{ref:b,className:n.tkx("relative"),style:{overflow:"hidden"},children:[(0,a.jsx)("div",{style:D,children:r}),(0,a.jsx)("div",{"data-watermark":!0,"aria-hidden":"true",className:n.tkx("absolute inset-0 pointer-events-none"),style:I}),m&&C&&(0,a.jsx)("div",{"aria-live":"polite",style:{position:"absolute",top:12,right:12,padding:"6px 12px",background:x.danger,color:"#fff",fontSize:12,fontWeight:600,borderRadius:6,zIndex:p+1,pointerEvents:"none"},children:"Developer Tools detected — content protected"})]})},exports.VisuallyHidden=function({as:e,children:t,...n}){return(0,a.jsx)(e??"span",{className:"tkx-sr-only",...n,children:t})},exports.WCAGEngine=t.WCAGEngine,exports.audit=n.audit,exports.auroraLight=t.auroraLight,exports.batchUpdate=t.batchUpdate,exports.breakpoints=t.breakpoints,exports.buildTkxCSP=n.buildTkxCSP,exports.contrastRatio=t.contrastRatio,exports.createFocusTrap=t.createFocusTrap,exports.createRateLimiter=n.createRateLimiter,exports.createTheme=t.createTheme,exports.css=t.css,exports.cssVar=t.cssVar,exports.cx=n.cx,exports.deepFreeze=n.deepFreeze,exports.extractAtomicCSS=n.extractAtomicCSS,exports.extractCSS=t.extractCSS,exports.fnv1aHash=t.fnv1aHash,exports.fromObject=t.fromObject,exports.generatePalette=t.generatePalette,exports.getAccessibleForeground=t.getAccessibleForeground,exports.getAuditLog=n.getAuditLog,exports.getLocaleDisplayName=function(e){if(mo[e])return mo[e];if("undefined"!=typeof Intl&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e},exports.injectStyles=t.injectStyles,exports.installFrameBuster=n.installFrameBuster,exports.installTrustedTypes=n.installTrustedTypes,exports.isFramed=n.isFramed,exports.isRTL=r.isRTL,exports.isRtlLocale=function(e){return go.has(e)||go.has(e.split("-")[0])},exports.isSafeAttrName=n.isSafeAttrName,exports.isValidAadhaar=Lr,exports.isValidDrivingLicence=Vr,exports.isValidPan=Fr,exports.isValidVoterId=Hr,exports.keyframes=t.keyframes,exports.loadFontScript=function(e){_o(e)},exports.meetsAA=t.meetsAA,exports.meetsAAA=t.meetsAAA,exports.memoize=t.memoize,exports.prefersHighContrast=t.prefersHighContrast,exports.prefersReducedMotion=t.prefersReducedMotion,exports.quantumDark=t.quantumDark,exports.radii=t.radii,exports.resetAtomicCSS=n.resetAtomicCSS,exports.resolvePluginUtility=n.resolvePluginUtility,exports.responsive=t.responsive,exports.sanitizeCSS=n.sanitizeCSS,exports.sanitizeHTML=n.sanitizeHTML,exports.sanitizeHref=n.sanitizeHref,exports.sanitizeJSON=n.sanitizeJSON,exports.sanitizeProps=n.sanitizeProps,exports.sanitizeString=n.sanitizeString,exports.sanitizeUnicode=n.sanitizeUnicode,exports.scriptsForLanguage=Go,exports.scrubPII=n.scrubPII,exports.seoSchema={softwareApplication:e=>({"@context":"https://schema.org","@type":"SoftwareApplication",name:e.name,description:e.description,url:e.url,applicationCategory:"DeveloperApplication",operatingSystem:"Web",...e.version&&{softwareVersion:e.version,version:e.version},...e.license&&{license:e.license},...e.repository&&{codeRepository:e.repository},...e.downloadUrl&&{downloadUrl:e.downloadUrl},...void 0!==e.price&&{offers:{"@type":"Offer",price:e.price,priceCurrency:e.currency??"USD"}}}),article:e=>({"@context":"https://schema.org","@type":"Article",headline:e.headline,description:e.description,mainEntityOfPage:e.url,...e.image&&{image:e.image},author:{"@type":"Person",name:e.author},datePublished:e.datePublished,...e.dateModified&&{dateModified:e.dateModified}}),faqPage:e=>({"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))}),breadcrumbList:e=>({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.map((e,t)=>({"@type":"ListItem",position:t+1,name:e.name,item:e.url}))}),product:e=>({"@context":"https://schema.org","@type":"Product",name:e.name,description:e.description,image:e.image,brand:{"@type":"Brand",name:e.brand},...e.sku&&{sku:e.sku},offers:{"@type":"Offer",price:e.price,priceCurrency:e.currency,availability:`https://schema.org/${e.availability??"InStock"}`},...e.rating&&{aggregateRating:{"@type":"AggregateRating",ratingValue:e.rating.value,reviewCount:e.rating.count}}})},exports.shadows=t.shadows,exports.sniffMimeType=n.sniffMimeType,exports.spacing=t.spacing,exports.tkx=n.tkx,exports.tkxListPlugins=n.tkxListPlugins,exports.tkxPlugin=n.tkxPlugin,exports.tkxRemovePlugin=n.tkxRemovePlugin,exports.tx=n.tx,exports.typography=t.typography,exports.unloadFontScript=function(e){!function(e){if("undefined"==typeof document)return;const t=qo[e];if(!t)return;const n=document.getElementById(t.id);n&&n.remove()}(e)},exports.useAnnounce=o.useAnnounce,exports.useClickOutside=o.useClickOutside,exports.useComponentSize=function(e,t){const{getSize:n}=fo();return n(e,t)},exports.useConfig=fo,exports.useDevtoolsOpen=To,exports.useDirection=r.useDirection,exports.useEscapeKey=o.useEscapeKey,exports.useFocusTrap=o.useFocusTrap,exports.useHighContrast=o.useHighContrast,exports.useI18n=r.useI18n,exports.useLocale=r.useLocale,exports.useLogicalSpacing=function(e,t=0){const{direction:n}=fo(),o="number"==typeof e?`${e}px`:e,r="number"==typeof t?`${t}px`:t;return"rtl"===n?{marginRight:o,marginLeft:r}:{marginLeft:o,marginRight:r}},exports.usePrefersColorScheme=t.usePrefersColorScheme,exports.usePrefixCls=function(e,t){const{prefixCls:n}=fo();return`${t??n}-${e}`},exports.useReducedMotion=o.useReducedMotion,exports.useRtlFlip=function(){const{direction:e}=fo();if("rtl"===e)return{transform:"scaleX(-1)"}},exports.useTheme=t.useTheme,exports.useTkxCommand=function(){const[e,t]=(0,l.useState)(!1);return{isOpen:e,open:(0,l.useCallback)(()=>t(!0),[]),close:(0,l.useCallback)(()=>t(!1),[]),toggle:(0,l.useCallback)(()=>t(e=>!e),[])}},exports.useTkxForm=i.useTkxForm,exports.useToast=function(){return{toast:(0,l.useCallback)(e=>function(e){const t=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:t,duration:e.duration??4e3};return _.length<5?(_=[..._,n],ee(t,n.duration)):Z=[...Z,n],Q(),t}(e),[]),dismiss:(0,l.useCallback)(e=>te(e),[]),dismissAll:(0,l.useCallback)(()=>(J.forEach(e=>clearTimeout(e)),J.clear(),_=[],Z=[],void Q()),[])}},exports.validateProps=n.validateProps,exports.verifyAuditIntegrity=n.verifyAuditIntegrity,exports.zIndex=t.zIndex;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunk-DmRB1Blb.js"),t=require("./chunk-BpuJ3-K8.js"),n=require("./chunk-D7-yknXg.js"),o=require("./chunk-C8Wy8P59.js"),r=require("./i18n.cjs"),i=require("./chunk-Bze40nDX.js");let l=require("react");l=e.__toESM(l,1);let a=require("react/jsx-runtime"),s=require("react-dom");var d={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},c={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},u={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},p={sm:14,md:16,lg:18,xl:20};function h({size:e}){const t=p[e];return(0,a.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:n.tkx("animate-spin shrink-0"),children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),(0,a.jsx)("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}var f=(0,l.forwardRef)(({variant:e="solid",size:r="md",colorScheme:i="primary",isLoading:l=!1,loadingText:s,leftIcon:p,rightIcon:f,isFullWidth:m=!1,glow:g=!1,disabled:x,children:b,className:y,style:v,...w},k)=>{const S=t.useTheme(),C=o.useReducedMotion(),$=x||l,z={primary:S.primary,secondary:S.secondary,danger:S.danger,warning:S.warning,success:S.success}[i],M=t.getAccessibleForeground(z,["#ffffff","#000000",S.bg]),N="string"==typeof b?n.sanitizeString(b):b,I=s?n.sanitizeString(s):void 0,L="solid"===e?{backgroundColor:z,color:M,border:"none",boxShadow:g&&!C?`0 0 20px ${z}55`:void 0}:"outline"===e?{backgroundColor:"transparent",color:z,border:`2px solid ${z}`}:"ghost"===e?{backgroundColor:"transparent",color:z,border:"none"}:{backgroundColor:"transparent",color:z,border:"none",textDecoration:"underline"};return(0,a.jsx)("button",{ref:k,"aria-busy":l,"aria-disabled":$,disabled:$,className:n.cx(n.tkx("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",d[r],c[r],u[r],"link"!==e&&u[r],m&&"w-full",$?"cursor-not-allowed opacity-60":"cursor-pointer",!C&&"transition-all duration-200","focus-visible:focus-ring"),y),style:{...L,...v},...w,children:l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h,{size:r}),I??N]}):(0,a.jsxs)(a.Fragment,{children:[p&&(0,a.jsx)("span",{"aria-hidden":"true",children:p}),N,f&&(0,a.jsx)("span",{"aria-hidden":"true",children:f})]})})});f.displayName="TkxButton";var m={none:"",sm:"p-3",md:"p-5",lg:"p-7"},g=(0,l.forwardRef)(({variant:e="default",isHoverable:r,isClickable:i,padding:l="md",as:s,children:d,className:c,style:u,...p},h)=>{const f=t.useTheme(),g=o.useReducedMotion(),x=s??(i?"button":"div"),b={default:{backgroundColor:f.surface,border:`1px solid ${f.border}`},glass:{backgroundColor:`${f.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${f.border}55`,boxShadow:`0 4px 24px ${f.bg}40`},quantum:{backgroundColor:f.surfaceAlt,border:`1px solid ${f.primary}33`,boxShadow:`0 0 24px ${f.primary}18`},elevated:{backgroundColor:f.surface,boxShadow:`0 4px 20px ${f.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${f.border}`}}[e];return(0,a.jsx)(x,{ref:h,className:n.cx("tkx-card",n.tkx("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",m[l],(r||i)&&!g&&"transition-transform duration-150 hover:scale-[1.01]",i?"cursor-pointer":"cursor-default"),c),style:{color:f.text,...b,...u},...p,children:d})});g.displayName="TkxCard";var x=(0,l.forwardRef)(({label:e,id:o,error:r,hint:i,leftAddon:s,rightAddon:d,isInvalid:c,isRequired:u,disabled:p,className:h,style:f,unicodeSafe:m=!0,onChange:g,...x},b)=>{const y=t.useTheme(),v=(0,l.useId)(),w=o??v,k=`${w}-hint`,S=`${w}-error`,C=c||!!r,$=[i&&k,C&&S].filter(Boolean).join(" ")||void 0,z=n.sanitizeString(e),M=r?n.sanitizeString(r):void 0,N=i?n.sanitizeString(i):void 0,I=C?y.danger:y.border;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1 w-full"),h),style:f,children:[(0,a.jsxs)("label",{htmlFor:w,className:n.tkx("text-sm font-medium font-sans"),style:{color:y.text},children:[z,u&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("ml-1"),style:{color:y.danger},children:"*"})]}),(0,a.jsxs)("div",{className:n.tkx("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",p?"opacity-60":""),style:{border:`1.5px solid ${I}`,backgroundColor:y.surface},children:[s&&(0,a.jsx)("div",{className:n.tkx("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:y.surfaceAlt,color:y.textMuted,borderRight:`1px solid ${y.border}`},children:s}),(0,a.jsx)("input",{ref:b,id:w,"aria-invalid":C,"aria-required":u,"aria-describedby":$,disabled:p,className:n.cx(n.tkx("flex-1 border-none bg-transparent text-sm font-sans py-2.5 px-3 outline-none min-w-0 focus-visible:focus-ring")),style:{color:y.text},onChange:m?e=>{const t=n.sanitizeUnicode(e.target.value);t!==e.target.value&&(e.target.value=t),g?.(e)}:g,...x}),d&&(0,a.jsx)("div",{className:n.tkx("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:y.surfaceAlt,color:y.textMuted,borderLeft:`1px solid ${y.border}`},children:d})]}),N&&!M&&(0,a.jsx)("span",{id:k,className:n.tkx("text-xs"),style:{color:y.textMuted},children:N}),M&&(0,a.jsxs)("span",{id:S,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:y.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),M]})]})});x.displayName="TkxInput";var b={sm:"text-xs px-1.5 py-[2px] min-h-[16px]",md:"text-xs px-2 py-[3px] min-h-[20px]",lg:"text-sm px-3 py-1 min-h-[24px]"},y={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},v=(0,l.forwardRef)(({variant:e="default",size:o="md",dot:r=!1,pulse:i=!1,outlined:l=!1,children:s,className:d,style:c,...u},p)=>{const h=t.useTheme(),f={default:h.border,primary:h.primary,secondary:h.secondary,danger:h.danger,warning:h.warning,success:h.success,info:h.info}[e]||"#666666",m=t.getAccessibleForeground(f,["#ffffff","#000000",h.bg||"#000000"]),g="string"==typeof s?n.sanitizeString(s):s;return r?(0,a.jsx)("span",{ref:p,"aria-label":"string"==typeof s?n.sanitizeString(s):void 0,className:n.cx(n.tkx("inline-block rounded-full",y[o],i&&"animate-pulse"),d),style:{backgroundColor:f,...c},...u}):(0,a.jsx)("span",{ref:p,className:n.cx(n.tkx("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",b[o],i&&"animate-pulse"),d),style:{backgroundColor:l?"transparent":f,color:l?f:m,border:l?`1px solid ${f}`:"none",...c},...u,children:g})});v.displayName="TkxBadge";var w={sm:"4px",md:"8px",lg:"12px"},k={sm:32,md:48,lg:64},S=(0,l.forwardRef)(({value:e,variant:r="linear",size:i="md",label:l,showValue:s,color:d,className:c,style:u,...p},h)=>{const f=t.useTheme(),m=o.useReducedMotion(),g=d??f.primary,x=void 0===e,b=void 0!==e?Math.min(100,Math.max(0,e)):0;if(void 0!==e){const{errors:t}=n.validateProps({value:e},{value:{type:"number",min:0,max:100}});t.length}if("circular"===r){const e=k[i],t="sm"===i?3:"md"===i?4:5,o=(e-2*t)/2,r=2*Math.PI*o,d=x?0:r-b/100*r;return(0,a.jsxs)("div",{ref:h,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x?void 0:b,"aria-label":l??(x?"Loading":`${b}%`),className:n.cx(n.tkx("inline-flex flex-col items-center gap-1"),c),style:u,children:[(0,a.jsxs)("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:e/2,cy:e/2,r:o,fill:"none",stroke:f.border,strokeWidth:t}),(0,a.jsx)("circle",{cx:e/2,cy:e/2,r:o,fill:"none",stroke:g,strokeWidth:t,strokeLinecap:"round",strokeDasharray:r,strokeDashoffset:d,transform:`rotate(-90 ${e/2} ${e/2})`,style:{transition:m?"none":"stroke-dashoffset 300ms ease",animation:x&&!m?"tkx-spin 1s linear infinite":void 0}})]}),s&&!x&&(0,a.jsxs)("span",{className:n.tkx("text-xs"),style:{color:f.textMuted},children:[b,"%"]})]})}const y=w[i];return(0,a.jsxs)("div",{ref:h,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x?void 0:b,"aria-label":l??(x?"Loading":`${b}%`),className:n.cx(n.tkx("flex flex-col gap-1 w-full"),c),style:u,children:[l&&(0,a.jsxs)("div",{className:n.tkx("flex justify-between text-sm"),style:{color:f.text},children:[(0,a.jsx)("span",{children:l}),s&&!x&&(0,a.jsxs)("span",{children:[b,"%"]})]}),(0,a.jsx)("div",{className:n.tkx("w-full overflow-hidden"),style:{height:y,borderRadius:y,backgroundColor:f.border},children:(0,a.jsx)("div",{style:{height:"100%",borderRadius:y,backgroundColor:g,width:x?"40%":`${b}%`,transition:m?"none":"width 300ms ease",animation:x&&!m?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});S.displayName="TkxProgress";var C={sm:{tw:28,th:16,td:10,gap:3},md:{tw:40,th:22,td:14,gap:4},lg:{tw:52,th:28,td:18,gap:5}},$=(0,l.forwardRef)(({checked:e,onChange:r,label:i,size:s="md",hideLabel:d,disabled:c,className:u,style:p,...h},f)=>{const m=t.useTheme(),g=o.useReducedMotion(),x=(0,l.useId)();n.validateProps({label:i,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:b,th:y,td:v,gap:w}=C[s],k=e?b-v-w:w,S=e?m.primary:m.border;return(0,a.jsxs)("div",{className:n.cx(n.tkx("inline-flex items-center gap-2",c?"opacity-50":""),u),style:p,children:[!d&&(0,a.jsx)("label",{htmlFor:x,className:n.tkx("text-sm font-sans",c?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:m.text},children:i}),(0,a.jsx)("button",{ref:f,id:x,role:"switch","aria-checked":e,"aria-label":d?i:void 0,disabled:c,onClick:()=>!c&&r(!e),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||c||(t.preventDefault(),r(!e))},className:n.cx(n.tkx("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",c?"cursor-not-allowed":"cursor-pointer",!g&&"transition-colors duration-200")),style:{width:b,height:y,borderRadius:y,backgroundColor:S},...h,children:(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("absolute rounded-full"),style:{top:"50%",left:k,width:v,height:v,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:g?"none":"left 200ms ease"}})})]})});$.displayName="TkxToggle";var z={info:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),warning:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})})},M={sm:"400px",md:"560px",lg:"720px",full:"100vw"},N=0;function I(){--N<=0&&(N=0,document.body.style.overflow="")}var L=(0,l.createContext)(null);function R(){const e=(0,l.useContext)(L);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}var D={top:{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:6},bottom:{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:6},left:{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:6},right:{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:6}};function T({variant:e,width:t,height:o,animation:r,bgColor:i,accentColor:l}){const s=void 0!==t?"number"==typeof t?`${t}px`:t:"100%",d=void 0!==o?"number"==typeof o?`${o}px`:o:{text:"1em",circular:s,rectangular:"80px"}[e],c=n.tkx("circular"===e?"rounded-full":"text"===e?"rounded":"rounded-lg"),u="pulse"===r?n.tkx("animate-pulse"):"wave"===r?n.tkx("animate-shimmer"):"",p="wave"===r?{background:`linear-gradient(90deg,${i} 25%,${l} 50%,${i} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:i};return(0,a.jsx)("div",{className:n.cx(c,u),style:{width:s,height:d,...p}})}var W=(0,l.forwardRef)(({variant:e="rectangular",width:r,height:i,lines:l,animation:s="pulse",className:d,style:c,...u},p)=>{const h=t.useTheme(),f=!o.useReducedMotion()&&s;return"text"===e&&l&&l>1?(0,a.jsx)("div",{ref:p,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:n.cx(n.tkx("flex flex-col gap-2"),d),style:c,...u,children:Array.from({length:l},(e,t)=>(0,a.jsx)(T,{variant:"text",width:t===l-1?"75%":r,height:i,animation:f,bgColor:h.surfaceAlt,accentColor:h.border},t))}):(0,a.jsx)("div",{ref:p,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:d,style:c,...u,children:(0,a.jsx)(T,{variant:e,width:r,height:i,animation:f,bgColor:h.surfaceAlt,accentColor:h.border})})});W.displayName="TkxSkeleton";var A={xs:24,sm:32,md:40,lg:56,xl:72},B={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},E=(0,l.forwardRef)(({src:e,alt:o,initials:r,size:i="md",shape:s="circle",status:d,className:c,style:u,...p},h)=>{const f=t.useTheme(),[m,g]=(0,l.useState)(!1),x=A[i],b="circle"===s,y=f.surfaceAlt,v=t.getAccessibleForeground(y,[f.text,f.textMuted]),w=e&&!m,k=!w&&r,S=Math.max(8,.22*x),C=n.tkx("relative inline-flex shrink-0",b?"rounded-full":"rounded-lg"),$=n.tkx("block object-cover",b?"rounded-full":"rounded-lg"),z=n.tkx("flex items-center justify-center font-semibold font-sans select-none",b?"rounded-full":"rounded-lg");return(0,a.jsxs)("div",{ref:h,className:n.cx(C,c),style:{width:x,height:x,...u},...p,children:[w?(0,a.jsx)("img",{src:n.sanitizeString(e),alt:n.sanitizeString(o),onError:()=>g(!0),className:$,style:{width:x,height:x}}):(0,a.jsx)("div",{role:"img","aria-label":n.sanitizeString(o),className:z,style:{width:x,height:x,backgroundColor:y,color:v,fontSize:.38*x},children:k?n.sanitizeString(r).slice(0,2).toUpperCase():(0,a.jsxs)("svg",{width:.5*x,height:.5*x,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),(0,a.jsx)("circle",{cx:"12",cy:"7",r:"4"})]})}),d&&(0,a.jsx)("span",{"aria-label":`Status: ${d}`,className:n.tkx("absolute bottom-0 right-0 rounded-full"),style:{width:S,height:S,backgroundColor:B[d],border:`2px solid ${f.bg}`}})]})});function H({dir:e}){return(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:n.tkx("shrink-0"),children:"asc"===e?(0,a.jsx)("path",{d:"M7 14l5-5 5 5H7z"}):"desc"===e?(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7z"}):(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}E.displayName="TkxAvatar";var F=(0,l.forwardRef)(({orientation:e="horizontal",label:o,variant:r="solid",className:i,style:l,...s},d)=>{const c=t.useTheme(),u=o?n.sanitizeString(o):void 0,p="vertical"===e,h=p?"borderLeft":"borderTop",f=`1px ${r} ${c.border}`;return u?(0,a.jsxs)("div",{role:"separator","aria-orientation":e,className:n.cx(n.tkx("flex items-center gap-3 text-xs"),i),style:{color:c.textMuted,...l},...s,children:[(0,a.jsx)("hr",{className:n.tkx("flex-1 m-0 border-none"),style:{[h]:f}}),(0,a.jsx)("span",{children:u}),(0,a.jsx)("hr",{className:n.tkx("flex-1 m-0 border-none"),style:{[h]:f}})]}):(0,a.jsx)("hr",{ref:d,role:"separator","aria-orientation":e,className:n.cx(n.tkx(p?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),i),style:{[h]:f,...l},...s})});F.displayName="TkxDivider";var j={sm:{py:"6px",px:"10px",fontSize:"13px",iconSize:14,tagPy:"1px",tagPx:"6px"},md:{py:"9px",px:"12px",fontSize:"14px",iconSize:16,tagPy:"2px",tagPx:"8px"},lg:{py:"12px",px:"14px",fontSize:"15px",iconSize:18,tagPy:"3px",tagPx:"10px"}};function P(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function O({size:e,color:t}){return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",style:{animation:"tkx-spin 0.7s linear infinite"},children:[(0,a.jsx)("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),(0,a.jsx)("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function V({options:e,value:o,defaultValue:i,placeholder:d,size:c="md",isDisabled:u=!1,isInvalid:p=!1,label:h,hint:f,errorMessage:m,multiple:g=!1,searchable:x=!1,clearable:b=!1,isLoading:y=!1,onChange:v,renderOption:w,maxMenuHeight:k=280,virtualScroll:S,optionHeight:C=36,id:$,className:z,style:M}){const N=t.useTheme(),I=r.useLocale(),L=d??I.selectPlaceholder,R=(0,l.useId)(),D=$??R,T=`${D}-listbox`,W=`${D}-hint`,A=`${D}-error`,B=void 0!==o,[E,H]=(0,l.useState)(P(i)),F=B?P(o):E,[V,U]=(0,l.useState)(!1),[K,Y]=(0,l.useState)(""),[q,X]=(0,l.useState)(-1),[G,_]=(0,l.useState)(null),[Z,J]=(0,l.useState)(""),Q=(0,l.useRef)(null),ee=(0,l.useRef)(null),te=(0,l.useRef)(null),ne=(0,l.useRef)(null),oe=(0,l.useRef)(null),re=j[c],ie=p||!!m,le=(0,l.useRef)(null),[ae,se]=(0,l.useState)(0),[de,ce]=(0,l.useState)(0),ue=(0,l.useCallback)(()=>{le.current&&se(le.current.scrollTop)},[]);(0,l.useEffect)(()=>{if(!V)return void se(0);const e=le.current;if(!e)return;ce(e.clientHeight);const t=new ResizeObserver(()=>{ce(e.clientHeight)});return t.observe(e),()=>t.disconnect()},[V]);const pe=x&&K?e.filter(e=>e.label.toLowerCase().includes(K.toLowerCase())):e,he=pe.filter(e=>!e.disabled),fe=pe.some(e=>!!e.group),me=(void 0!==S?S:pe.length>=100)&&!fe,ge=pe.length*C,xe=me?Math.max(0,Math.floor(ae/C)-8):0,be=me?Math.min(pe.length,Math.ceil((ae+de)/C)+8):pe.length,ye=me?pe.slice(xe,be):pe,ve=xe*C,we=pe.reduce((e,t)=>{const n=t.group??"";return e[n]||(e[n]=[]),e[n].push(t),e},{}),ke=(0,l.useCallback)(e=>{let t;t=g?F.includes(e)?F.filter(t=>t!==e):[...F,e]:[e],B||H(t),v?.(g?t:t[0]??""),g||(U(!1),Y(""),X(-1),ee.current?.focus())},[B,g,v,F]),Se=(0,l.useCallback)((e,t)=>{t.stopPropagation();const n=F.filter(t=>t!==e);B||H(n),v?.(g?n:n[0]??"")},[B,g,v,F]),Ce=(0,l.useCallback)(e=>{e.stopPropagation(),B||H([]),v?.(g?[]:"")},[B,g,v]),$e=(0,l.useCallback)(()=>{ee.current&&V&&_(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight-n.bottom-6,r=n.top-6,i=o>=Math.min(t,200)||o>=r?"below":"above";return{top:"below"===i?n.bottom+window.scrollY+6:n.top+window.scrollY-6-Math.min(t,280),left:n.left+window.scrollX,width:n.width,placement:i}}(ee.current,k))},[V,k]);function ze(){if(u||y)return;U(!0);const e=he.findIndex(e=>F.includes(e.value));X(e>=0?e:0)}(0,l.useEffect)(()=>{if(V)return $e(),window.addEventListener("scroll",$e,!0),window.addEventListener("resize",$e),()=>{window.removeEventListener("scroll",$e,!0),window.removeEventListener("resize",$e)}},[V,$e]),(0,l.useEffect)(()=>{if(!V)return;const e=e=>{const t=e.target;ee.current?.contains(t)||ne.current?.contains(t)||(U(!1),Y(""))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[V]),(0,l.useEffect)(()=>{V&&x&&setTimeout(()=>te.current?.focus(),0)},[V,x]),(0,l.useEffect)(()=>{if(V&&!(q<0))if(me&&le.current){const e=q*C,t=e+C,n=le.current;e<n.scrollTop?n.scrollTop=e:t>n.scrollTop+n.clientHeight&&(n.scrollTop=t-n.clientHeight)}else(oe.current?.querySelector(`[data-idx="${q}"]`))?.scrollIntoView({block:"nearest"})},[q,V,me,C]);const Me=ie?N.danger:V?N.primary:N.border,Ne=q>=0&&he[q]?`${D}-opt-${he[q].value}`:void 0,Ie=[f&&W,ie&&A].filter(Boolean).join(" ")||void 0,Le=F.map(t=>e.find(e=>e.value===t)).filter(Boolean),Re=V&&G?(0,s.createPortal)((0,a.jsxs)("div",{ref:ne,role:"listbox",id:T,"aria-label":h?n.sanitizeString(h):"Options","aria-multiselectable":g,style:{position:"absolute",top:G.top,left:G.left,width:G.width,zIndex:9999,backgroundColor:N.surface,border:`1.5px solid ${N.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",overflow:"hidden",minWidth:G.width,maxHeight:k,display:"flex",flexDirection:"column"},children:[x&&(0,a.jsxs)("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${N.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:N.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("path",{d:"M21 21l-4.35-4.35"})]}),(0,a.jsx)("input",{ref:te,type:"text",value:K,onChange:e=>{Y(e.target.value),X(0)},onKeyDown:e=>{switch(e.key){case"Escape":e.preventDefault(),U(!1),Y(""),ee.current?.focus();break;case"ArrowDown":e.preventDefault(),X(e=>Math.min(e+1,he.length-1));break;case"ArrowUp":e.preventDefault(),X(e=>Math.max(e-1,0));break;case"Home":e.preventDefault(),X(0);break;case"End":e.preventDefault(),X(he.length-1);break;case"Enter":e.preventDefault(),q>=0&&he[q]&&ke(he[q].value)}},placeholder:`${I.search}…`,"aria-label":`${I.search} options`,style:{border:"none",outline:"none",background:"transparent",color:N.text,fontSize:re.fontSize,fontFamily:"inherit",width:"100%"}})]}),(0,a.jsx)("div",{ref:e=>{oe.current=e,le.current=e},onScroll:me?ue:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:k-(x?48:0)},children:me?(0,a.jsxs)("div",{style:{height:ge,position:"relative"},children:[(0,a.jsx)("div",{style:{position:"absolute",top:ve,left:0,right:0},children:ye.map(e=>{const t=he.indexOf(e),o=t===q,r=F.includes(e.value),i=w?w(e,r):(0,a.jsxs)("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[(0,a.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)})]}),e.description&&(0,a.jsx)("span",{style:{fontSize:"12px",color:N.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.description)})]});return(0,a.jsxs)("div",{id:`${D}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&ke(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&X(t),style:{height:C,boxSizing:"border-box",padding:`0 ${re.px}`,fontSize:re.fontSize,fontFamily:"inherit",color:e.disabled?N.textMuted:N.text,backgroundColor:o?`${N.primary}22`:r?`${N.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[i,r&&!w&&(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:N.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})}),0===pe.length&&(0,a.jsx)("div",{style:{padding:`${re.py} ${re.px}`,fontSize:re.fontSize,fontFamily:"inherit",color:N.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:y?"Loading…":"No options found"})]}):(0,a.jsxs)(a.Fragment,{children:[Object.entries(we).map(([e,t])=>(0,a.jsxs)("div",{children:[e&&(0,a.jsx)("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:N.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:N.surface,zIndex:1,borderBottom:`1px solid ${N.border}`},children:n.sanitizeString(e)}),t.map(e=>{const t=he.indexOf(e),o=t===q,r=F.includes(e.value),i=w?w(e,r):(0,a.jsxs)("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[(0,a.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)})]}),e.description&&(0,a.jsx)("span",{style:{fontSize:"12px",color:N.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.description)})]});return(0,a.jsxs)("div",{id:`${D}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&ke(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&X(t),style:{padding:`${re.py} ${re.px}`,fontSize:re.fontSize,fontFamily:"inherit",color:e.disabled?N.textMuted:N.text,backgroundColor:o?`${N.primary}22`:r?`${N.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[i,r&&!w&&(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:N.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})]},e)),0===pe.length&&(0,a.jsx)("div",{style:{padding:`${re.py} ${re.px}`,fontSize:re.fontSize,fontFamily:"inherit",color:N.textMuted,textAlign:"center"},children:y?"Loading…":"No options found"})]})})]}),document.body):null,De=b&&F.length>0&&!u&&!y;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1 w-full"),z),style:M,children:[h&&(0,a.jsx)("label",{htmlFor:D,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:N.text,userSelect:"none"},children:n.sanitizeString(h)}),(0,a.jsx)("div",{style:{position:"relative",width:"100%",opacity:u?.55:1},children:(0,a.jsxs)("button",{ref:ee,id:D,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":V,"aria-controls":T,"aria-activedescendant":Ne,"aria-invalid":ie||void 0,"aria-describedby":Ie,"aria-multiselectable":g,disabled:u,onClick:()=>V?U(!1):ze(),onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),V?q>=0&&he[q]&&ke(he[q].value):ze();break;case"Escape":e.preventDefault(),U(!1),Y("");break;case"ArrowDown":e.preventDefault(),V?X(e=>Math.min(e+1,he.length-1)):ze();break;case"ArrowUp":e.preventDefault(),V?X(e=>Math.max(e-1,0)):ze();break;case"Home":e.preventDefault(),V&&X(0);break;case"End":e.preventDefault(),V&&X(he.length-1);break;default:1!==e.key.length||e.ctrlKey||e.metaKey||(V||ze(),function(e){Q.current&&clearTimeout(Q.current);const t=Z+e.toLowerCase();J(t);const n=he.findIndex(e=>e.label.toLowerCase().startsWith(t));n>=0&&X(n),Q.current=setTimeout(()=>J(""),800)}(e.key))}},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:g&&F.length>0?`4px ${re.px}`:`${re.py} ${re.px}`,fontSize:re.fontSize,fontFamily:"inherit",backgroundColor:N.surface,color:F.length>0?N.text:N.textMuted,border:`1.5px solid ${Me}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:u?"not-allowed":"pointer",outline:"none",minHeight:"sm"===c?34:"lg"===c?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:g&&Le.length>0?Le.map(e=>(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${re.tagPy} ${re.tagPx}`,fontSize:`calc(${re.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${N.primary}22`,color:N.primary,borderRadius:6,border:`1px solid ${N.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:n.sanitizeString(e.label)}),(0,a.jsx)("span",{role:"button","aria-label":`Remove ${n.sanitizeString(e.label)}`,tabIndex:-1,onClick:t=>Se(e.value,t),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})]},e.value)):!g&&F.length>0?(()=>{const t=e.find(e=>e.value===F[0]);return(0,a.jsxs)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[t?.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex"},children:t.icon}),t?n.sanitizeString(t.label):""]})})():(0,a.jsx)("span",{style:{opacity:.6},children:n.sanitizeString(L)})}),(0,a.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:N.textMuted},children:[y&&(0,a.jsx)(O,{size:re.iconSize,color:N.primary}),De&&!y&&(0,a.jsx)("span",{role:"button","aria-label":I.clearSelection,tabIndex:-1,onClick:Ce,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:e=>e.currentTarget.style.opacity="1",onMouseLeave:e=>e.currentTarget.style.opacity="0.7",children:(0,a.jsx)("svg",{width:re.iconSize,height:re.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})}),(0,a.jsx)("svg",{width:re.iconSize,height:re.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:V?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:(0,a.jsx)("path",{d:"M6 9l6 6 6-6"})})]})]})}),f&&!ie&&(0,a.jsx)("span",{id:W,style:{fontSize:"12px",color:N.textMuted,fontFamily:"inherit"},children:n.sanitizeString(f)}),ie&&m&&(0,a.jsxs)("span",{id:A,role:"alert",style:{fontSize:"12px",color:N.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),n.sanitizeString(m)]}),Re]})}V.displayName="TkxSelect";var U={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},K=(0,l.forwardRef)(({label:e,hint:r,isInvalid:i,errorMessage:s,isIndeterminate:d=!1,size:c="md",colorScheme:u="primary",checked:p,defaultChecked:h,onChange:f,disabled:m,className:g,style:x,id:b,...y},v)=>{const w=t.useTheme(),k=o.useReducedMotion(),S=(0,l.useId)(),C=b??S,$=`${C}-hint`,z=`${C}-error`,M=(0,l.useRef)(null),[N,I]=(0,l.useState)(!1),L=U[c],R=i||!!s,D={primary:w.primary,success:w.success,danger:w.danger,warning:w.warning}[u]??w.primary,T=void 0!==p?p:void 0;(0,l.useEffect)(()=>{const e=v?.current??M.current;e&&(e.indeterminate=d)},[d,v]);const W=d||(T??!1),A=W?D:w.surface,B=R?w.danger:W?D:w.border,E=t.getAccessibleForeground(D),H=N?{outline:`2px solid ${D}`,outlineOffset:"2px"}:{},F=[r&&$,R&&z].filter(Boolean).join(" ")||void 0,j=!k&&W?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1"),g),style:{opacity:m?.5:1,...x},children:[(0,a.jsx)("style",{children:"\n @keyframes tkx-check-scale-in {\n from { transform: scale(0.4); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n }\n "}),(0,a.jsxs)("label",{htmlFor:C,className:n.tkx("flex items-center gap-2 select-none"),style:{cursor:m?"not-allowed":"pointer",fontFamily:"inherit"},children:[(0,a.jsx)("input",{ref:e=>{M.current=e,"function"==typeof v?v(e):v&&(v.current=e)},id:C,type:"checkbox",checked:p,defaultChecked:h,onChange:f,disabled:m,"aria-invalid":R,"aria-describedby":F,onFocus:e=>{e.target.matches(":focus-visible")&&I(!0)},onBlur:()=>I(!1),className:n.tkx("sr-only"),...y}),(0,a.jsx)("span",{"aria-hidden":"true",style:{width:L.box,height:L.box,minWidth:L.box,borderRadius:"4px",border:`2px solid ${B}`,backgroundColor:A,display:"flex",alignItems:"center",justifyContent:"center",transition:k?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...H},children:d?(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"block",width:.5*L.box,height:2,backgroundColor:E,borderRadius:"1px",...j}}):W?(0,a.jsx)("svg",{width:.6*L.box,height:.6*L.box,viewBox:"0 0 24 24",fill:"none",stroke:E,strokeWidth:L.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:j,children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&(0,a.jsx)("span",{style:{fontSize:L.fontSize,color:w.text,lineHeight:1.4},children:"string"==typeof e?n.sanitizeString(e):e})]}),r&&!R&&(0,a.jsx)("span",{id:$,className:n.tkx("text-xs ml-7"),style:{color:w.textMuted,marginLeft:L.box+8},children:n.sanitizeString(r)}),R&&s&&(0,a.jsxs)("span",{id:z,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:w.danger,marginLeft:L.box+8},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),n.sanitizeString(s)]})]})});K.displayName="TkxCheckbox";var Y=(0,l.createContext)(null),q={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},X=(0,l.forwardRef)(({label:e,hint:r,size:i="md",colorScheme:s="primary",value:d,checked:c,onChange:u,disabled:p,name:h,className:f,style:m,id:g,...x},b)=>{const y=t.useTheme(),v=o.useReducedMotion(),w=(0,l.useId)(),k=g??w,S=(0,l.useContext)(Y),C=S?S.value===String(d??""):c??!1,$=p??S?.isDisabled??!1,z=h??S?.name??"",M=q[i],N={primary:y.primary,success:y.success,danger:y.danger}[s]??y.primary;t.getAccessibleForeground(N);const I=C?N:y.border,L=y.surface;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-0.5"),f),style:{opacity:$?.5:1,...m},children:[(0,a.jsx)("style",{children:"\n @keyframes tkx-radio-dot-in {\n from { transform: scale(0) translate(-50%, -50%); opacity: 0; }\n to { transform: scale(1) translate(-50%, -50%); opacity: 1; }\n }\n "}),(0,a.jsxs)("label",{htmlFor:k,className:n.tkx("flex items-center gap-2 select-none"),style:{cursor:$?"not-allowed":"pointer",fontFamily:"inherit"},children:[(0,a.jsx)("input",{ref:b,id:k,type:"radio",name:z,value:d,checked:C,onChange:()=>{$||(S?S.onChange(String(d??"")):u?.({target:{value:String(d??"")}}))},disabled:$,"aria-invalid":S?.isInvalid,className:n.tkx("sr-only"),...x}),(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"relative",width:M.outer,height:M.outer,minWidth:M.outer,borderRadius:"50%",border:`2px solid ${I}`,backgroundColor:L,display:"inline-block",boxSizing:"border-box",transition:v?"none":"border-color 120ms"},children:C&&(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:M.inner,height:M.inner,borderRadius:"50%",backgroundColor:N,transform:"translate(-50%, -50%)",transformOrigin:"center",...v?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&(0,a.jsx)("span",{style:{fontSize:M.fontSize,color:y.text,lineHeight:1.4},children:"string"==typeof e?n.sanitizeString(e):e})]}),r&&(0,a.jsx)("span",{className:n.tkx("text-xs"),style:{color:y.textMuted,marginLeft:M.outer+8},children:n.sanitizeString(r)})]})});X.displayName="TkxRadio";var G=[],_=[],Z=new Set,J=new Map;function Q(){const e=[..._];Z.forEach(t=>t(e))}function ee(e,t){0!==t&&J.set(e,setTimeout(()=>te(e),t))}function te(e){clearTimeout(J.get(e)),J.delete(e);const t=_.some(t=>t.id===e);if(_=_.filter(t=>t.id!==e),G=G.filter(t=>t.id!==e),t&&G.length>0&&_.length<5){const e=G.shift();_=[..._,e],ee(e.id,e.duration??4e3)}Q()}var ne={default:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),danger:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),warning:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})},oe={"top-right":{top:16,right:16,alignItems:"flex-end"},"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"}};function re(e,t){return t?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function ie({toast:e,position:o,onDismiss:i,reduced:s}){const d=t.useTheme(),c=r.useLocale(),u=(0,l.useId)(),p={default:d.textMuted,success:d.success,danger:d.danger,warning:d.warning,info:d.info},h=e.variant??"default",f=p[h],m="danger"===h,g=e.title?n.sanitizeString(e.title):void 0,x=e.description?n.sanitizeString(e.description):void 0;return(0,a.jsxs)("div",{role:m?"alert":"status","aria-live":m?"assertive":"polite","aria-atomic":"true","aria-labelledby":g?u:void 0,className:n.tkx("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:d.surface,border:`1px solid ${f}55`,boxShadow:`0 8px 24px ${d.bg}cc`,color:d.text,...re(o,s)},children:[(0,a.jsx)("span",{className:n.tkx("shrink-0 mt-[2px]"),style:{color:f},children:ne[h]}),(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[g&&(0,a.jsx)("p",{id:u,className:n.tkx("m-0 font-semibold text-sm leading-snug"),children:g}),x&&(0,a.jsx)("p",{className:n.tkx("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:d.textMuted},children:x}),e.action&&(0,a.jsx)("button",{onClick:()=>{e.action.onClick(),i(e.id)},className:n.tkx("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:f},children:n.sanitizeString(e.action.label)})]}),(0,a.jsx)("button",{"aria-label":c.close,onClick:()=>i(e.id),className:n.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:d.textMuted},children:(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}var le={sm:{triggerPadding:"10px 12px",contentPadding:"0 12px 10px 12px",fontSize:"13px",subtitleSize:"11px",iconSize:14},md:{triggerPadding:"14px 16px",contentPadding:"0 16px 14px 16px",fontSize:"14px",subtitleSize:"12px",iconSize:16},lg:{triggerPadding:"18px 20px",contentPadding:"0 20px 18px 20px",fontSize:"16px",subtitleSize:"13px",iconSize:18}};function ae({open:e,reduced:t,iconStyle:n,size:o,color:r}){const i=t?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return"chevron"===n?(0,a.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:i,flexShrink:0},children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})}):"plus"===n?(0,a.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):(0,a.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,a.jsx)("polyline",{points:"12 5 19 12 12 19"})]})}function se({isOpen:e,reduced:t,children:n,id:o,triggerId:r}){const i=(0,l.useRef)(null),s=(0,l.useRef)(null),d=(0,l.useRef)(e),c=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{const t=i.current;t&&(e?(t.style.height="auto",t.style.overflow="visible"):(t.style.height="0px",t.style.overflow="hidden"))},[]),(0,l.useEffect)(()=>{if(d.current===e)return;d.current=e;const n=i.current,o=s.current;if(n&&o){if(t)return n.style.height=e?"auto":"0px",void(n.style.overflow=e?"visible":"hidden");if(c.current){const e=n.getBoundingClientRect().height;n.style.transition="none",n.style.height=`${e}px`,n.offsetHeight}c.current=!0,n.style.overflow="hidden",e?(n.style.height="0px",n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height=`${o.scrollHeight}px`})})):(n.style.height=`${o.scrollHeight}px`,n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height="0px"})}))}},[e,t]),(0,a.jsx)("div",{ref:i,id:o,role:"region","aria-labelledby":r,onTransitionEnd:t=>{if("height"!==t.propertyName)return;c.current=!1;const n=i.current;n&&(e?(n.style.height="auto",n.style.overflow="visible"):n.style.overflow="hidden")},style:{willChange:"height"},children:(0,a.jsx)("div",{ref:s,children:n})})}function de({items:e,multiple:r=!1,defaultOpen:i,value:s,onChange:d,variant:c="default",size:u="md",iconPosition:p="right",iconStyle:h="chevron",flush:f=!1,className:m,style:g}){const x=t.useTheme(),b=o.useReducedMotion(),y=(0,l.useId)(),v=void 0!==s,w=e=>e?Array.isArray(e)?new Set(e):new Set([e]):new Set,[k,S]=(0,l.useState)(()=>w(i)),C=v?w(s):k,$=(0,l.useCallback)((e,t)=>{if(t)return;let n;if(!v)return void S(t=>{n=new Set(t),n.has(e)?n.delete(e):(r||n.clear(),n.add(e));const o=[...n];return d?.(r?o:o[0]??""),n});{const t=w(s);n=new Set(t),n.has(e)?n.delete(e):(r||n.clear(),n.add(e))}const o=[...n];d?.(r?o:o[0]??"")},[r,d,v,s]),z=le[u],M=(e,t,n)=>{if(f)return{};switch(c){case"default":case"bordered":return{borderBottom:n?"none":`1px solid ${x.border}`};case"separated":return{border:`1px solid ${x.border}`,borderRadius:"10px",overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)"};default:return{}}},N="separated"===c;return(0,a.jsx)("div",{className:n.tkx(m??""),style:{...f?{}:"bordered"===c?{border:`1px solid ${x.border}`,borderRadius:"10px",overflow:"hidden"}:{},display:N?"flex":void 0,flexDirection:N?"column":void 0,gap:N?"8px":void 0,...g},children:e.map((t,n)=>{const o=C.has(t.id),r=n===e.length-1,i=`${y}-trigger-${t.id}`,l=`${y}-panel-${t.id}`;return(0,a.jsxs)("div",{className:t.className,style:M(0,0,r),children:[(0,a.jsxs)("button",{id:i,type:"button",role:"button","aria-expanded":o,"aria-controls":l,disabled:t.disabled,onClick:()=>$(t.id,t.disabled),style:{width:"100%",display:"flex",alignItems:t.subtitle?"flex-start":"center",gap:"8px",padding:z.triggerPadding,border:"none",background:"transparent",cursor:t.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:z.fontSize,fontWeight:500,color:t.disabled?x.textMuted:x.text,opacity:t.disabled?.5:1,transition:b?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:e=>{t.disabled||(e.currentTarget.style.backgroundColor=(e=>"ghost"===c||"flush"===c?e?`${x.primary}10`:`${x.surfaceAlt}80`:e?`${x.primary}0d`:`${x.surfaceAlt}60`)(o))},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=o?`${x.primary}0d`:"transparent"},onFocus:e=>{t.disabled||(e.currentTarget.style.outline=`2px solid ${x.primary}`,e.currentTarget.style.outlineOffset="2px")},onBlur:e=>{e.currentTarget.style.outline="none"},children:[t.icon&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:x.primary,marginTop:t.subtitle?"1px":void 0},children:t.icon}),"left"===p&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?x.primary:x.textMuted,marginTop:t.subtitle?"1px":void 0},children:(0,a.jsx)(ae,{open:o,reduced:b,iconStyle:h,size:z.iconSize,color:o?x.primary:x.textMuted})}),(0,a.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("span",{style:{display:"block",lineHeight:1.4},children:t.title}),t.subtitle&&(0,a.jsx)("span",{style:{display:"block",fontSize:z.subtitleSize,color:x.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:t.subtitle})]}),t.badge&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:t.badge}),"right"===p&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?x.primary:x.textMuted,marginTop:t.subtitle?"1px":void 0},children:(0,a.jsx)(ae,{open:o,reduced:b,iconStyle:h,size:z.iconSize,color:o?x.primary:x.textMuted})})]}),(0,a.jsx)(se,{isOpen:o,reduced:b,id:l,triggerId:i,children:(0,a.jsx)("div",{style:{padding:z.contentPadding,fontSize:z.fontSize,lineHeight:1.6,color:x.textMuted,fontFamily:"inherit"},children:t.content})})]},t.id)})})}de.displayName="TkxAccordion";var ce={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"},ue=0;function pe(){--ue<=0&&(ue=0,document.body.style.overflow="")}function he(){return(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var fe=["Su","Mo","Tu","We","Th","Fr","Sa"],me=["January","February","March","April","May","June","July","August","September","October","November","December"],ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function be(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function ye(e,t,n){return!(!t||!xe(e,t))||!(!n||!xe(e,n))}function ve(e,t="en-US",n){if(!e)return"";if(n){const t=String(e.getFullYear()),o=t.slice(-2),r=e.getMonth()+1,i=String(r).padStart(2,"0"),l=ge[e.getMonth()],a=me[e.getMonth()],s=e.getDate(),d=String(s).padStart(2,"0");return n.replace(/YYYY/g,t).replace(/YY/g,o).replace(/MMMM/g,a).replace(/MMM/g,l).replace(/MM/g,i).replace(/\bM\b/g,String(r)).replace(/DD/g,d).replace(/\bD\b/g,String(s))}return e.toLocaleDateString(t,{month:"2-digit",day:"2-digit",year:"numeric"})}function we(e,t){return new Date(e,t+1,0).getDate()}function ke(e){return 10*Math.floor(e/10)}function Se({values:e,selected:t,onSelect:n,label:o,theme:r,format:i}){const s=(0,l.useRef)([]),d=(0,l.useRef)(null);(0,l.useEffect)(()=>{const e=s.current[t];e&&d.current&&e.scrollIntoView({block:"nearest"})},[t]);const c=i??(e=>String(e).padStart(2,"0"));return(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[(0,a.jsx)("div",{style:{fontSize:"11px",fontWeight:600,color:r.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:o}),(0,a.jsx)("div",{ref:d,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${r.border}`,borderRadius:"8px",padding:"4px"},children:e.map(e=>{const o=e===t;return(0,a.jsx)("button",{ref:t=>{s.current[e]=t},type:"button",onClick:()=>n(e),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?r.primary:"transparent",color:o?r.bg:r.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:c(e)},e)})})]})}function Ce({year:e,month:t,today:n,mode:o,selectedDate:r,selectedRange:i,multiDates:l,hoverDate:s,focusedDate:d,isDateDisabled:c,onSelectDate:u,onHoverDate:p,onSetFocused:h,theme:f,locale:m}){const g=function(e,t){const n=new Date(e,t,1).getDay(),o=we(e,t),r=[],i=we(e,t-1);for(let a=n-1;a>=0;a--)r.push(new Date(e,t-1,i-a));for(let a=1;a<=o;a++)r.push(new Date(e,t,a));let l=1;for(;r.length<42;)r.push(new Date(e,t+1,l++));return r}(e,t);return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:fe.map(e=>(0,a.jsx)("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:f.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:g.map((e,g)=>{const x=e.getMonth()===t,b=xe(e,n),y=0===e.getDay()||6===e.getDay(),v=c(e),w="single"===o&&null!=r&&xe(e,r),k="multiple"===o&&l.some(t=>xe(t,e)),S="range"===o&&ye(e,i[0],null),C="range"===o&&ye(e,null,i[1]),$=S||C,z="range"===o&&i[0]&&!i[1]&&s?s:i[1],M="range"===o&&function(e,t,n){if(!t||!n)return!1;const o=be(e).getTime(),r=be(t).getTime(),i=be(n).getTime();return o>Math.min(r,i)&&o<Math.max(r,i)}(e,i[0],z),N="range"===o&&i[0]&&!i[1]&&s&&xe(e,s),I=w||k||$,L=null!=d&&xe(e,d);let R="transparent",D=x?y?`${f.text}cc`:f.text:`${f.textMuted}60`,T="none",W=400;return I||N?(R=f.primary,D=f.bg,W=600):M&&(R=`${f.primary}18`),b&&!I&&(T=`2px solid ${f.primary}`,W=600),v&&(D=`${f.textMuted}50`),L&&!I&&(T=`2px solid ${f.secondary}`),(0,a.jsx)("button",{type:"button","aria-label":e.toLocaleDateString(m,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":I,"aria-disabled":v,disabled:v,onClick:()=>!v&&u(e),onMouseEnter:()=>p(e),onMouseLeave:()=>p(null),onFocus:()=>h(e),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:R,color:D,border:T,fontSize:"13px",fontWeight:W,cursor:v?"not-allowed":"pointer",opacity:v?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:v?"line-through":"none",transition:"background-color 80ms ease"},children:e.getDate()},g)})})]})}function $e({value:e,onChange:i,rangeValue:d,onRangeChange:c,multiValue:u,onMultiChange:p,mode:h="single",minDate:f,maxDate:m,disabledDates:g,locale:x="en-US",dateFormat:b,showTime:y=!1,timeValue:v,onTimeChange:w,showPresets:k=!1,customPresets:S,label:C,placeholder:$="MM/DD/YYYY",hint:z,isDisabled:M=!1,isInvalid:N=!1,errorMessage:I,numberOfMonths:L=1,id:R,className:D,style:T}){const W=t.useTheme(),A=r.useLocale(),B=(0,l.useId)(),E=R??B,H=o.useReducedMotion(),F=be(new Date),j=void 0!==e,[P,O]=(0,l.useState)(null),V=j?e??null:P,U=void 0!==d,[K,Y]=(0,l.useState)([null,null]),q=U?d:K,X=void 0!==u,[G,_]=(0,l.useState)([]),Z=X?u:G,[J,Q]=(0,l.useState)("start"),ee="range"===h||"single"===h&&y,[te,ne]=(0,l.useState)([null,null]),[oe,re]=(0,l.useState)(null),ie=V??q[0]??F,[le,ae]=(0,l.useState)(ie.getFullYear()),[se,de]=(0,l.useState)(ie.getMonth()),[ce,ue]=(0,l.useState)("day"),[pe,he]=(0,l.useState)({h:0,m:0}),fe=v??pe,[ye,we]=(0,l.useState)(!1),[$e,ze]=(0,l.useState)(()=>{if("single"===h)return ve(V,x,b);if("range"===h){const[e,t]=q;if(e&&t)return`${ve(e,x,b)} – ${ve(t,x,b)}`}return""}),[Me,Ne]=(0,l.useState)(null),[Ie,Le]=(0,l.useState)(null),[Re,De]=(0,l.useState)({top:0,left:0,flipUp:!1}),[,Te]=(0,l.useReducer)(e=>e+1,0),We=(0,l.useRef)(null),Ae=(0,l.useRef)(null),Be=(0,l.useRef)(null),Ee=k?420:y?480:360;(0,l.useEffect)(()=>{if("single"===h)ze(ve(V,x,b));else if("range"===h){const[e,t]=q;ze(e&&t?`${ve(e,x,b)} – ${ve(t,x,b)}`:e?ve(e,x,b):"")}else"multiple"===h&&ze(Z.length>0?`${Z.length} date${1!==Z.length?"s":""} selected`:"")},[V,q,Z,h,x,b]);const He=(0,l.useCallback)(()=>{We.current&&De(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight,r=window.scrollY,i=window.scrollX,l=o-n.bottom<t+8&&n.top>t+8;return{top:l?r+n.top-t-4:r+n.bottom+4,left:i+n.left,flipUp:l}}(We.current,Ee))},[Ee]);(0,l.useEffect)(()=>{if(ye)return He(),window.addEventListener("scroll",He,!0),window.addEventListener("resize",He),()=>{window.removeEventListener("scroll",He,!0),window.removeEventListener("resize",He)}},[ye,He]),(0,l.useEffect)(()=>{if(!ye)return;const e=e=>{We.current?.contains(e.target)||Ae.current?.contains(e.target)||we(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[ye]),(0,l.useEffect)(()=>{if(!ye)return;const e=e=>{"Escape"===e.key&&(we(!1),Be.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[ye]);const Fe=(0,l.useCallback)(e=>!!(f&&be(e)<be(f))||!!(m&&be(e)>be(m))||!!g&&("function"==typeof g?g(e):g.some(t=>xe(t,e))),[f,m,g]),je=(0,l.useCallback)(e=>{if(!Fe(e)){if("single"===h)ee?re(e):(j||O(e),i?.(e),ze(ve(e,x,b)),we(!1));else if("range"===h)if("start"===J){const t=[e,null];ne(t),U||Y(t),c?.(t),Q("end")}else{const t=te[0]??q[0],n=t&&e<t?[e,t]:[t,e];ne(n),ee?Q("start"):(U||Y(n),c?.(n),Q("start"),we(!1))}else if("multiple"===h){const t=Z.some(t=>xe(t,e))?Z.filter(t=>!xe(t,e)):[...Z,e];X||_(t),p?.(t)}Te()}},[h,Fe,j,U,X,i,c,p,J,te,q,Z,ee,x]),Pe=(0,l.useCallback)(()=>{if("single"===h){const e=oe??V;j||O(e),i?.(e)}else"range"===h&&(U||Y(te),c?.(te));we(!1),Q("start")},[h,oe,te,V,j,U,i,c]),Oe=(0,l.useCallback)(()=>{re(null),ne([null,null]),Q("start"),we(!1)},[]),Ve=S??function(e){const t={today:e?.today??"Today",yesterday:e?.yesterday??"Yesterday",last7:e?.last7Days??"Last 7 days",last30:e?.last30Days??"Last 30 days",last90:"Last 90 days",thisWeek:"This week",lastWeek:"Last week",thisMonth:e?.thisMonth??"This month",lastMonth:e?.lastMonth??"Last month"};return[{label:t.today,getValue:()=>{const e=be(new Date);return[e,e]}},{label:t.yesterday,getValue:()=>{const e=be(new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:t.last7,getValue:()=>{const e=be(new Date),t=new Date(e);return t.setDate(t.getDate()-6),[t,e]}},{label:t.last30,getValue:()=>{const e=be(new Date),t=new Date(e);return t.setDate(t.getDate()-29),[t,e]}},{label:t.last90,getValue:()=>{const e=be(new Date),t=new Date(e);return t.setDate(t.getDate()-89),[t,e]}},{label:t.thisWeek,getValue:()=>{const e=be(new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay());const n=new Date(t);return n.setDate(n.getDate()+6),[t,n]}},{label:t.lastWeek,getValue:()=>{const e=be(new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay()-1);const n=new Date(t);return n.setDate(n.getDate()-6),[n,t]}},{label:t.thisMonth,getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:t.lastMonth,getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=new Date,t=Math.floor(e.getMonth()/3);return[new Date(e.getFullYear(),3*t,1),new Date(e.getFullYear(),3*t+3,0)]}},{label:"Last quarter",getValue:()=>{const e=new Date,t=Math.floor(e.getMonth()/3),n=0===t?3:t-1,o=0===t?e.getFullYear()-1:e.getFullYear();return[new Date(o,3*n,1),new Date(o,3*n+3,0)]}},{label:"This year",getValue:()=>{const e=(new Date).getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=(new Date).getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}]}(A),Ue=11===se?0:se+1,Ke=11===se?le+1:le,Ye=L>=2,qe=C?n.sanitizeString(C):void 0,Xe=z?n.sanitizeString(z):void 0,Ge=I?n.sanitizeString(I):void 0,_e=n.sanitizeString($),Ze="single"===h&&null!=V||"range"===h&&(null!=q[0]||null!=q[1])||"multiple"===h&&Z.length>0,Je="range"===h?ee?te:q:[null,null],Qe=N?W.danger:ye?W.primary:W.border,et=Array.from({length:24},(e,t)=>t),tt=Array.from({length:60},(e,t)=>t),nt=(0,a.jsxs)("div",{ref:Ae,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:e=>{if("day"!==ce)return;const t=Me??V??F;let n=null;if("ArrowRight"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1);else if("ArrowLeft"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1);else if("ArrowDown"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+7);else if("ArrowUp"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-7);else if("Enter"===e.key&&Me)return void je(Me);n&&(e.preventDefault(),Ne(n),n.getMonth()===se&&n.getFullYear()===le||(de(n.getMonth()),ae(n.getFullYear())))},style:{position:"absolute",top:Re.top,left:Re.left,zIndex:9999,backgroundColor:W.surface,border:`1px solid ${W.border}`,borderRadius:"14px",boxShadow:"0 8px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",display:"flex",overflow:"hidden",minWidth:Ye?"580px":"300px",maxWidth:Ye&&k?"780px":Ye?"620px":k?"520px":"300px",opacity:ye?1:0,transform:ye?"translateY(0) scale(1)":Re.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:H?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[k&&"range"===h&&(0,a.jsxs)("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${W.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[(0,a.jsx)("div",{style:{fontSize:"11px",fontWeight:600,color:W.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),Ve.map(e=>{const[t,n]=e.getValue(),o=Je[0]&&Je[1]&&xe(Je[0],t)&&xe(Je[1],n);return(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),o=[t,n];ne(o),U||Y(o),c?.(o),ae(t.getFullYear()),de(t.getMonth()),Q("start"),ee||we(!1)})(e),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:o?`${W.primary}20`:"transparent",color:o?W.primary:W.text,fontWeight:o?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:e=>{o||(e.currentTarget.style.backgroundColor=`${W.surfaceAlt}`)},onMouseLeave:e=>{o||(e.currentTarget.style.backgroundColor="transparent")},children:e.label},e.label)})]}),(0,a.jsxs)("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsx)("button",{type:"button","aria-label":"day"===ce?"Previous month":"month"===ce?"Previous year":"Previous decade",onClick:()=>{"day"===ce?(0===se?(de(11),ae(e=>e-1)):de(e=>e-1),ue("day")):ae("month"===ce?e=>e-1:e=>e-10)},style:{border:"none",background:"transparent",cursor:"pointer",color:W.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"15 18 9 12 15 6"})})}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:["day"===ce&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",onClick:()=>ue("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:W.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:me[se]}),(0,a.jsx)("button",{type:"button",onClick:()=>ue("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:W.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:le}),Ye&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{style:{color:W.textMuted,fontSize:"14px"},children:"–"}),(0,a.jsxs)("span",{style:{fontSize:"14px",fontWeight:600,color:W.text},children:[me[Ue]," ",Ke]})]})]}),"month"===ce&&(0,a.jsx)("button",{type:"button",onClick:()=>ue("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:W.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:le}),"year"===ce&&(0,a.jsxs)("span",{style:{fontSize:"14px",fontWeight:600,color:W.text},children:[ke(le),"–",ke(le)+9]})]}),(0,a.jsx)("button",{type:"button","aria-label":"day"===ce?"Next month":"month"===ce?"Next year":"Next decade",onClick:()=>{"day"===ce?(11===se?(de(0),ae(e=>e+1)):de(e=>e+1),ue("day")):ae("month"===ce?e=>e+1:e=>e+10)},style:{border:"none",background:"transparent",cursor:"pointer",color:W.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"9 18 15 12 9 6"})})})]}),"day"===ce&&(0,a.jsxs)("div",{style:{display:"flex",gap:"20px"},children:[(0,a.jsx)(Ce,{year:le,month:se,today:F,mode:h,selectedDate:V,selectedRange:Je,multiDates:Z,hoverDate:Ie,focusedDate:Me,isDateDisabled:Fe,onSelectDate:je,onHoverDate:Le,onSetFocused:Ne,theme:W,locale:x}),Ye&&(0,a.jsx)(Ce,{year:Ke,month:Ue,today:F,mode:h,selectedDate:V,selectedRange:Je,multiDates:Z,hoverDate:Ie,focusedDate:Me,isDateDisabled:Fe,onSelectDate:je,onHoverDate:Le,onSetFocused:Ne,theme:W,locale:x})]}),"month"===ce&&(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:ge.map((e,t)=>{const n=t===se;return(0,a.jsx)("button",{type:"button",onClick:()=>{de(t),ue("day")},style:{padding:"10px",borderRadius:"8px",border:t!==F.getMonth()||le!==F.getFullYear()||n?"none":`2px solid ${W.primary}`,cursor:"pointer",fontSize:"13px",fontWeight:n?600:400,backgroundColor:n?W.primary:"transparent",color:n?W.bg:W.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:e},e)})}),"year"===ce&&(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(e,t)=>{const n=ke(le)-1+t,o=n===le,r=n===F.getFullYear(),i=0===t||11===t;return(0,a.jsx)("button",{type:"button",onClick:()=>{ae(n),ue("month")},style:{padding:"10px 6px",borderRadius:"8px",border:r&&!o?`2px solid ${W.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?W.primary:"transparent",color:o?W.bg:i?W.textMuted:W.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:i?.5:1},children:n},n)})}),y&&"day"===ce&&(0,a.jsxs)("div",{style:{borderTop:`1px solid ${W.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[(0,a.jsx)(Se,{values:et,selected:fe.h,onSelect:e=>{v||he(t=>({...t,h:e})),w?.({...fe,h:e})},label:"Hour",theme:W}),(0,a.jsx)("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:W.textMuted},children:":"}),(0,a.jsx)(Se,{values:tt,selected:fe.m,onSelect:e=>{v||he(t=>({...t,m:e})),w?.({...fe,m:e})},label:"Min",theme:W})]}),"multiple"===h&&"day"===ce&&Z.length>0&&(0,a.jsxs)("div",{style:{borderTop:`1px solid ${W.border}`,paddingTop:"8px",fontSize:"12px",color:W.textMuted,textAlign:"center"},children:[Z.length," date",1!==Z.length?"s":""," selected"]}),(0,a.jsxs)("div",{style:{borderTop:`1px solid ${W.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:ee?"space-between":"flex-start",gap:"8px"},children:[(0,a.jsx)("button",{type:"button",onClick:()=>{ae(F.getFullYear()),de(F.getMonth()),ue("day"),je(F)},style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:W.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),ee&&(0,a.jsxs)("div",{style:{display:"flex",gap:"6px"},children:[(0,a.jsx)("button",{type:"button",onClick:Oe,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${W.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:W.text,fontFamily:"inherit"},children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:Pe,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:W.primary,color:W.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});return(0,a.jsxs)("div",{className:D,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...T},children:[qe&&(0,a.jsx)("label",{htmlFor:E,style:{fontSize:"13px",fontWeight:500,color:W.text,marginBottom:"2px"},children:qe}),(0,a.jsxs)("div",{ref:We,style:{display:"flex",alignItems:"center",border:`1.5px solid ${Qe}`,borderRadius:"8px",backgroundColor:W.surface,overflow:"hidden",transition:H?"none":"border-color 120ms ease",opacity:M?.5:1},children:[(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:W.textMuted,flexShrink:0},children:(0,a.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),(0,a.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,a.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,a.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),(0,a.jsx)("input",{ref:Be,id:E,type:"text",value:$e,placeholder:_e,disabled:M,"aria-invalid":N,"aria-haspopup":"dialog","aria-expanded":ye,readOnly:"range"===h||"multiple"===h,onChange:e=>(e=>{if(ze(e),"single"===h){const t=function(e,t){const n=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(n){const[,e,t,o]=n.map(Number);if(e>=1&&e<=12&&t>=1&&t<=31){const n=new Date(o,e-1,t);if(n.getMonth()===e-1)return n}}const o=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(o){const[,e,t,n]=o.map(Number),r=new Date(e,t-1,n);if(r.getMonth()===t-1)return r}if(t&&/^DD/.test(t)){const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(t){const[,e,n,o]=t.map(Number),r=new Date(o,n-1,e);if(r.getMonth()===n-1)return r}}return null}(e,b);t&&!Fe(t)&&(j||O(t),i?.(t),ae(t.getFullYear()),de(t.getMonth()))}})(e.target.value),onFocus:()=>{M||we(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:W.text,cursor:"single"!==h?"pointer":"text",fontFamily:"inherit",minWidth:0}}),Ze&&!M&&(0,a.jsx)("button",{type:"button","aria-label":"Clear selection",onClick:e=>{if(e.stopPropagation(),"single"===h)j||O(null),i?.(null),ze("");else if("range"===h){const e=[null,null];U||Y(e),c?.(e),ne(e),ze(""),Q("start")}else"multiple"===h&&(X||_([]),p?.([]),ze(""))},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:W.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:(0,a.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,a.jsx)("button",{type:"button","aria-label":ye?"Close calendar":"Open calendar",tabIndex:-1,disabled:M,onClick:()=>{M||we(e=>!e)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:M?"not-allowed":"pointer",color:W.textMuted,flexShrink:0},children:(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:ye?"rotate(180deg)":"rotate(0deg)",transition:H?"none":"transform 160ms ease"},children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})})})]}),Xe&&!N&&(0,a.jsx)("span",{style:{fontSize:"12px",color:W.textMuted},children:Xe}),N&&Ge&&(0,a.jsx)("span",{role:"alert",style:{fontSize:"12px",color:W.danger},children:Ge}),ye&&"undefined"!=typeof document&&(0,s.createPortal)(nt,document.body)]})}$e.displayName="TkxDatePicker";var ze={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function Me(e,t,n){return Math.min(Math.max(e,t),n)}function Ne(e,t,n){return Math.round((e-t)/n)*n+t}function Ie(e,t,n){return(e-t)/(n-t)*100}function Le({value:e,min:t,max:n,step:o,isDisabled:r,trackColor:i,thumbSize:s,ariaLabel:d,tooltipMode:c,formatValue:u,orientation:p,onChange:h,onChangeEnd:f}){const[m,g]=(0,l.useState)(!1),[x,b]=(0,l.useState)(!1),[y,v]=(0,l.useState)(!1),w="vertical"===p,k=Ie(e,t,n),S="always"===c||"hover"===c&&(y||x||m),C=w?{position:"absolute",bottom:`${k}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${s/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"}:{position:"absolute",left:`${k}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${s/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"},$=w?{position:"absolute",left:s+6,top:"50%",transform:"translateY(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:s+6,left:"50%",transform:"translateX(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"};return(0,a.jsxs)("div",{style:C,children:[S&&(0,a.jsx)("div",{style:$,children:u(e)}),(0,a.jsx)("div",{role:"slider",tabIndex:r?-1:0,"aria-label":d,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":r,"aria-orientation":p,onKeyDown:i=>{r||("ArrowRight"===i.key||"ArrowUp"===i.key?(i.preventDefault(),h(Me(Ne(e+o,t,o),t,n))):"ArrowLeft"===i.key||"ArrowDown"===i.key?(i.preventDefault(),h(Me(Ne(e-o,t,o),t,n))):"Home"===i.key?(i.preventDefault(),h(t)):"End"===i.key&&(i.preventDefault(),h(n)))},onFocus:()=>g(!0),onBlur:()=>g(!1),onPointerEnter:()=>v(!0),onPointerLeave:()=>v(!1),onPointerDown:e=>{r||(b(!0),e.target.setPointerCapture(e.pointerId))},onPointerUp:()=>{b(!1),f?.()},style:{width:s,height:s,borderRadius:"50%",backgroundColor:r?"#888":i,border:"3px solid #fff",boxShadow:m?`0 0 0 3px ${i}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function Re({value:e,defaultValue:r=0,onChange:i,rangeValue:s,onRangeChange:d,min:c=0,max:u=100,step:p=1,isRange:h=!1,label:f,showValue:m=!1,showTicks:g=!1,tickCount:x=5,isDisabled:b=!1,colorScheme:y="primary",size:v="md",marks:w,orientation:k="horizontal",showTooltip:S=!1,formatValue:C,onChangeEnd:$,onRangeChangeEnd:z,gradient:M=!1}){const N=t.useTheme(),I=(0,l.useId)(),L=o.useReducedMotion(),R=void 0!==e,[D,T]=(0,l.useState)(r),W=R?e:D,A=void 0!==s,[B,E]=(0,l.useState)([c,u]),H=A?s:B,F=(0,l.useRef)(null),j=(0,l.useRef)(W);j.current=W;const P=(0,l.useRef)(H);P.current=H;const O={primary:N.primary,success:N.success,danger:N.danger,warning:N.warning}[y],V=ze[v],U="vertical"===k,K=!0===S?"hover":!1!==S&&S,Y=C??(e=>String(e)),q=O+"66",X=(0,l.useCallback)((e,t)=>{const n=F.current;if(!n)return c;const o=n.getBoundingClientRect();let r;return r=Me(U?(o.bottom-(t??0))/o.height:(e-o.left)/o.width,0,1),Me(Ne(r*(u-c)+c,c,p),c,u)},[c,u,p,U]),G=(0,l.useCallback)(e=>{if(b)return;const t=X(e.clientX,e.clientY);if(h){const[e,n]=H,o=Math.abs(t-e)<=Math.abs(t-n)?[t,n]:[e,t];A||E(o),d?.(o)}else R||T(t),i?.(t)},[b,h,R,A,X,i,d,H]),_=h?Ie(H[0],c,u):0,Z=Ie(h?H[1]:W,c,u),J=g?Array.from({length:x},(e,t)=>c+t/(x-1)*(u-c)):[],Q=f?n.sanitizeString(f):void 0,ee=L?"none":"background 150ms ease";return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-2"),style:{opacity:b?.55:1,...U?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(Q||m)&&(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between"),children:[Q&&(0,a.jsx)("label",{htmlFor:I,className:n.tkx("text-sm font-medium"),style:{color:N.text,fontSize:V.fontSize},children:Q}),m&&!h&&(0,a.jsx)("span",{className:n.tkx("text-sm tabular-nums"),style:{color:N.textMuted,fontSize:V.fontSize},children:Y(W)}),m&&h&&(0,a.jsxs)("span",{className:n.tkx("text-sm tabular-nums"),style:{color:N.textMuted,fontSize:V.fontSize},children:[Y(H[0])," – ",Y(H[1])]})]}),(0,a.jsxs)("div",{style:{position:"relative",...U?{paddingLeft:V.thumb/2,paddingRight:V.thumb/2,flex:1}:{paddingTop:V.thumb/2,paddingBottom:V.thumb/2}},children:[(0,a.jsxs)("div",{ref:F,onPointerDown:G,style:{position:"relative",...U?{width:V.track,height:"100%"}:{height:V.track},borderRadius:9999,backgroundColor:N.border,cursor:b?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[(0,a.jsx)("div",{style:{position:"absolute",...U?{left:0,bottom:`${_}%`,height:Z-_+"%",width:"100%"}:{top:0,left:`${_}%`,width:Z-_+"%",height:"100%"},borderRadius:9999,...b?{backgroundColor:N.textMuted}:M?{background:U?`linear-gradient(to top, ${q}, ${O})`:`linear-gradient(to right, ${q}, ${O})`}:{backgroundColor:O},transition:ee}}),J.map((e,t)=>(0,a.jsx)("div",{style:{position:"absolute",...U?{bottom:`${Ie(e,c,u)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:V.track+4}:{left:`${Ie(e,c,u)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:V.track+4},backgroundColor:N.surface,borderRadius:9999,pointerEvents:"none"}},t)),h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Le,{value:H[0],min:c,max:H[1],step:p,isDisabled:b,trackColor:O,trackHeight:V.track,thumbSize:V.thumb,ariaLabel:`${Q??"Range"} start`,tooltipMode:K,formatValue:Y,orientation:k,onChange:e=>{const t=[Me(e,c,H[1]),H[1]];A||E(t),d?.(t)},onChangeEnd:z?()=>z(P.current):void 0}),(0,a.jsx)(Le,{value:H[1],min:H[0],max:u,step:p,isDisabled:b,trackColor:O,trackHeight:V.track,thumbSize:V.thumb,ariaLabel:`${Q??"Range"} end`,tooltipMode:K,formatValue:Y,orientation:k,onChange:e=>{const t=[H[0],Me(e,H[0],u)];A||E(t),d?.(t)},onChangeEnd:z?()=>z(P.current):void 0})]}):(0,a.jsx)(Le,{value:W,min:c,max:u,step:p,isDisabled:b,trackColor:O,trackHeight:V.track,thumbSize:V.thumb,ariaLabel:Q??"Slider",tooltipMode:K,formatValue:Y,orientation:k,onChange:e=>{R||T(e),i?.(e)},onChangeEnd:$?()=>$(j.current):void 0})]}),w&&w.length>0&&(0,a.jsx)("div",{style:{position:U?"absolute":"relative",...U?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:w.map((e,t)=>(0,a.jsx)("div",{style:{position:"absolute",...U?{bottom:`${Ie(e.value,c,u)}%`,transform:"translateY(50%)",left:0}:{left:`${Ie(e.value,c,u)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:N.textMuted,whiteSpace:"nowrap"},children:n.sanitizeString(e.label)},t))})]}),g&&!w&&!U&&(0,a.jsx)("div",{style:{position:"relative",height:"1rem"},children:J.map((e,t)=>(0,a.jsx)("span",{style:{position:"absolute",left:`${Ie(e,c,u)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:N.textMuted},children:Y(Math.round(e))},t))})]})}Re.displayName="TkxSlider";var De={sm:{height:28,minWidth:28,fontSize:"0.75rem",px:8},md:{height:36,minWidth:36,fontSize:"0.875rem",px:10},lg:{height:44,minWidth:44,fontSize:"1rem",px:12}};function Te({total:e,pageSize:o=10,page:i,defaultPage:s=1,onChange:d,siblingCount:c=1,showEdges:u=!0,showPageSize:p=!1,onPageSizeChange:h,pageSizeOptions:f=[10,25,50,100],size:m="md",variant:g="default"}){const x=t.useTheme(),b=r.useLocale(),y=(0,l.useId)(),v={pagination:"Pagination",firstPage:b.firstPage??"First page",lastPage:b.lastPage??"Last page",previousPage:b.previousPage??"Previous page",nextPage:b.nextPage??"Next page",pageN:e=>`Page ${e}`,showing:(e,t,n)=>b.showingRange?b.showingRange(e,t,n):`Showing ${e}–${t} of ${n} items`},w=void 0!==i,[k,S]=(0,l.useState)(s),C=w?i:k,[$,z]=(0,l.useState)(o),M=o,N=Math.max(1,Math.ceil(e/M)),I=e=>{const t=Math.min(Math.max(e,1),N);t!==C&&(w||S(t),d?.(t))},L=function(e,t,n,o){if(t<=1)return[1];const r=(e,t)=>Array.from({length:Math.max(0,t-e+1)},(t,n)=>e+n),i=Math.max(e-n,1),l=Math.min(e+n,t);if(!o){const e=[];return i>1&&e.push("..."),e.push(...r(i,l)),l<t&&e.push("..."),e}const a=i>3,s=l<t-2,d=[];d.push(1),a?d.push("left-ellipsis"):d.push(...r(2,i-1)),d.push(...r(Math.max(i,2),Math.min(l,t-1))),s?d.push("right-ellipsis"):d.push(...r(l+1,t-1)),t>1&&d.push(t);const c=new Set,u=[];for(const p of d)"number"==typeof p?c.has(p)||(c.add(p),u.push(p)):u.push(p);return u}(C,N,c,u),R=De[m],D=Math.min((C-1)*M+1,e),T=Math.min(C*M,e),W=(e,t)=>{const n={height:R.height,minWidth:R.minWidth,paddingLeft:R.px,paddingRight:R.px,fontSize:R.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:t?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:t?.4:1};return e?{...n,backgroundColor:x.primary,color:x.bg,fontWeight:600,boxShadow:`0 0 0 2px ${x.primary}44`}:"default"===g?{...n,backgroundColor:x.surface,color:x.text,border:`1px solid ${x.border}`}:"outline"===g?{...n,backgroundColor:"transparent",color:x.text,border:`1px solid ${x.border}`}:{...n,backgroundColor:"transparent",color:x.text}},A=({d:e})=>(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:(0,a.jsx)("polyline",{points:e})});return(0,a.jsxs)("nav",{"aria-label":v.pagination,className:n.tkx("flex flex-col gap-2"),children:[e>0&&(0,a.jsx)("p",{className:n.tkx("text-sm"),style:{color:x.textMuted,fontSize:R.fontSize},children:n.sanitizeString(v.showing(D,T,e))}),(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1 flex-wrap"),children:[u&&(0,a.jsxs)("button",{type:"button","aria-label":v.firstPage,disabled:1===C,onClick:()=>I(1),style:W(!1,1===C),children:[(0,a.jsx)(A,{d:"15 18 9 12 15 6"}),(0,a.jsx)(A,{d:"20 18 14 12 20 6"})]}),(0,a.jsx)("button",{type:"button","aria-label":v.previousPage,disabled:1===C,onClick:()=>I(C-1),style:W(!1,1===C),children:(0,a.jsx)(A,{d:"15 18 9 12 15 6"})}),L.map((e,t)=>{if("string"==typeof e)return(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:R.minWidth,height:R.height,fontSize:R.fontSize,color:x.textMuted,userSelect:"none"},children:"…"},`${e}-${t}`);const n=e,o=n===C;return(0,a.jsx)("button",{type:"button","aria-label":v.pageN(n),"aria-current":o?"page":void 0,onClick:()=>I(n),style:W(o,!1),children:n},n)}),(0,a.jsx)("button",{type:"button","aria-label":v.nextPage,disabled:C===N,onClick:()=>I(C+1),style:W(!1,C===N),children:(0,a.jsx)(A,{d:"9 18 15 12 9 6"})}),u&&(0,a.jsxs)("button",{type:"button","aria-label":v.lastPage,disabled:C===N,onClick:()=>I(N),style:W(!1,C===N),children:[(0,a.jsx)(A,{d:"4 18 10 12 4 6"}),(0,a.jsx)(A,{d:"14 18 20 12 14 6"})]}),p&&(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2 ml-2"),children:[(0,a.jsx)("label",{htmlFor:y,className:n.tkx("text-sm"),style:{color:x.textMuted,fontSize:R.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),(0,a.jsx)("select",{id:y,value:$,onChange:e=>{return t=Number(e.target.value),z(t),h?.(t),void I(1);var t},style:{height:R.height,paddingLeft:R.px,paddingRight:R.px,fontSize:R.fontSize,borderRadius:"8px",border:`1px solid ${x.border}`,backgroundColor:x.surface,color:x.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:f.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]})]})]})}Te.displayName="TkxPagination";var We={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},Ae={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function Be({color:e,size:t}){return(0,a.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,a.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,a.jsx)("path",{d:"M21 15l-5-5L5 21"})]})}function Ee(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function He({mimeType:e,color:t}){return e.startsWith("image/")?(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,a.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,a.jsx)("path",{d:"M21 15l-5-5L5 21"})]}):"application/pdf"===e?(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,a.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,a.jsx)("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),(0,a.jsx)("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}):(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,a.jsx)("polyline",{points:"14 2 14 8 20 8"})]})}var Fe=0,je={sm:16,md:24,lg:32,xl:40};function Pe({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"50%",stopColor:n}),(0,a.jsx)("stop",{offset:"50%",stopColor:"transparent"})]})}),(0,a.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Oe({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"50%",stopColor:n}),(0,a.jsx)("stop",{offset:"50%",stopColor:"transparent"})]})}),(0,a.jsx)("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Ve({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"50%",stopColor:n}),(0,a.jsx)("stop",{offset:"50%",stopColor:"transparent"})]})}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5})]})}function Ue({type:e,size:t,filled:n,color:o,halfFilled:r,uid:i}){const l={size:t,filled:n,color:o,halfFilled:r,id:i};return"heart"===e?(0,a.jsx)(Oe,{...l}):"circle"===e?(0,a.jsx)(Ve,{...l}):(0,a.jsx)(Pe,{...l})}function Ke(e,t,n){return Math.min(n,Math.max(t,e))}function Ye(e,t,n){if(1===n)return t+1;const o=e.currentTarget.getBoundingClientRect(),r=o.left+o.width/2;return e.clientX<r?t+.5:t+1}var qe=!1;function Xe(){return(0,a.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),(0,a.jsx)("circle",{cx:"14",cy:"11",r:"4",fill:"currentColor"}),(0,a.jsx)("path",{d:"M6 24c0-4.418 3.582-8 8-8s8 3.582 8 8",fill:"currentColor"})]})}function Ge(){return(0,a.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),(0,a.jsx)("path",{d:"M14 5l2.2 6.5H23l-5.6 4 2.2 6.5L14 18l-5.6 4 2.2-6.5L5 11.5h6.8z",fill:"currentColor"})]})}function _e(){const e=t.useTheme();return(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1.5 px-4 py-3 rounded-2xl w-fit"),style:{backgroundColor:e.surface,border:`1px solid ${e.border}`},"aria-label":"Assistant is thinking",children:[(0,a.jsx)("span",{className:"tkx-dot1 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),(0,a.jsx)("span",{className:"tkx-dot2 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),(0,a.jsx)("span",{className:"tkx-dot3 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}})]})}function Ze({message:e,showTimestamp:r,avatarUser:i,avatarAssistant:l}){const s=t.useTheme(),d=o.useReducedMotion(),{role:c,content:u,timestamp:p,isStreaming:h,error:f}=e,m=n.sanitizeString(u),g=p?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(p):null;if("system"===c)return(0,a.jsx)("div",{role:"listitem",className:n.tkx("flex justify-center my-2"),children:(0,a.jsx)("p",{className:n.tkx("text-xs italic px-3 py-1 rounded-full"),style:{color:s.textMuted,backgroundColor:s.surfaceAlt},children:m})});const x="user"===c,b=x?i??(0,a.jsx)(Xe,{}):l??(0,a.jsx)(Ge,{}),y=x?{backgroundColor:s.primary,color:s.bg}:{backgroundColor:s.surface,color:s.text,border:`1px solid ${f?s.danger:s.border}`};return f&&(y.borderColor=s.danger,y.borderWidth="2px"),(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex gap-2 mb-4",x?"flex-row-reverse":"flex-row"),children:[(0,a.jsx)("div",{className:n.tkx("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:x?s.primary:s.secondary},children:b}),(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-1 max-w-[75%]",x?"items-end":"items-start"),children:[(0,a.jsxs)("div",{className:n.cx(n.tkx("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),h&&!d?"tkx-cursor":""),style:y,children:[m,f&&(0,a.jsx)("span",{"aria-label":"Error",style:{marginLeft:6,color:s.danger},children:"⚠"})]}),r&&g&&(0,a.jsx)("span",{className:n.tkx("text-[10px]"),style:{color:s.textMuted},children:g})]})]})}var Je={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},Qe={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},et={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},tt={sm:12,md:14,lg:16};function nt({variant:e="subtle",size:r="md",colorScheme:i="default",onRemove:l,leftIcon:s,isDisabled:d=!1,clickable:c=!1,children:u,className:p,style:h,onClick:f,...m}){t.useTheme();const g=o.useReducedMotion(),x=function(e,n){const o=t.useTheme(),r={default:o.textMuted,primary:o.primary,secondary:o.secondary,success:o.success,danger:o.danger,warning:o.warning,info:o.info}[e];return"solid"===n?{bg:r,color:o.bg,border:"transparent"}:"subtle"===n?{bg:`${r}22`,color:r,border:"transparent"}:{bg:"transparent",color:r,border:r}}(i,e),b="string"==typeof u?n.sanitizeString(u):u,y=tt[r],v=n.tkx("inline-flex items-center font-medium rounded-full select-none",Je[r],Qe[r],et[r],d?"opacity-50 cursor-not-allowed":c?"cursor-pointer":"cursor-default",c&&!g&&"transition-opacity duration-150");return(0,a.jsxs)("span",{role:c?"button":void 0,tabIndex:c&&!d?0:void 0,"aria-disabled":d||void 0,className:n.cx(v,p),style:{backgroundColor:x.bg,color:x.color,border:`1px solid ${"transparent"===x.border?"transparent":x.border}`,...h},onClick:d?void 0:f,onKeyDown:c&&!d&&f?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),f(e))}:void 0,...m,children:[s&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("shrink-0 flex items-center"),children:s}),(0,a.jsx)("span",{children:b}),l&&!d&&(0,a.jsx)("button",{type:"button","aria-label":`Remove ${"string"==typeof u?u:"tag"}`,onClick:e=>{e.stopPropagation(),l()},className:n.tkx("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:y+4,height:y+4,color:x.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:(0,a.jsx)("svg",{width:y,height:y,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})})]})}var ot=!1;function rt({status:e="pending",icon:r,size:i=28}){const l=t.useTheme(),s=o.useReducedMotion(),d=function(e="pending"){const n=t.useTheme();return{completed:n.success,active:n.primary,pending:n.border,error:n.danger}[e]}(e),c="active"===e;return(0,a.jsx)("div",{className:n.cx(n.tkx("relative flex items-center justify-center rounded-full shrink-0 z-10"),c&&!s?"tkx-pulse-dot":""),style:{width:i,height:i,backgroundColor:"pending"===e?l.surface:d,border:`2px solid ${d}`,color:"pending"===e?d:l.bg},"aria-hidden":"true",children:r?(0,a.jsx)("span",{style:{fontSize:.45*i,lineHeight:1},children:r}):(0,a.jsx)("span",{style:{width:.35*i,height:.35*i,borderRadius:"50%",backgroundColor:"pending"===e?d:l.bg,display:"block"}})})}function it({style:e,color:o,animate:r}){return t.useTheme(),(0,a.jsx)("div",{className:n.cx(n.tkx("w-0.5 flex-1 min-h-[24px]"),r?"tkx-draw-v":""),style:{borderLeft:`2px ${e} ${o}`,backgroundColor:"transparent",alignSelf:"stretch",borderColor:o,marginLeft:1},"aria-hidden":"true"})}function lt({style:e,color:t,animate:o}){return(0,a.jsx)("div",{className:n.cx(n.tkx("h-0.5 flex-1 min-w-[24px]"),o?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${t}`,borderColor:t},"aria-hidden":"true"})}function at({item:e,compact:o}){const r=t.useTheme(),i=e.timestamp?n.sanitizeString(e.timestamp):null;return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-0.5",o?"pb-3":"pb-5"),children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2 flex-wrap"),children:[(0,a.jsx)("span",{className:n.tkx("text-sm font-semibold leading-snug"),style:{color:r.text},children:"string"==typeof e.title?n.sanitizeString(e.title):e.title}),e.badge&&(0,a.jsx)("span",{children:e.badge}),i&&(0,a.jsx)("span",{className:n.tkx("text-[11px] ml-auto"),style:{color:r.textMuted},children:i})]}),e.description&&!o&&(0,a.jsx)("div",{className:n.tkx("text-xs leading-relaxed mt-0.5"),style:{color:r.textMuted},children:"string"==typeof e.description?n.sanitizeString(e.description):e.description})]})}function st(e,t,n,o){const r=window.innerWidth,i=window.innerHeight;let l=0,a=0,s="top left";switch(t){case"bottom-start":l=e.bottom+6,a=e.left,s="top left",l+o>i&&e.top-6-o>0&&(l=e.top-6-o,s="bottom left"),a+n>r&&(a=Math.max(0,r-n-8));break;case"bottom-end":l=e.bottom+6,a=e.right-n,s="top right",l+o>i&&e.top-6-o>0&&(l=e.top-6-o,s="bottom right"),a<0&&(a=8);break;case"top-start":l=e.top-6-o,a=e.left,s="bottom left",l<0&&(l=e.bottom+6,s="top left"),a+n>r&&(a=Math.max(0,r-n-8));break;case"top-end":l=e.top-6-o,a=e.right-n,s="bottom right",l<0&&(l=e.bottom+6,s="top right"),a<0&&(a=8);break;case"right-start":l=e.top,a=e.right+6,s="top left",a+n>r&&(a=e.left-6-n,s="top right"),l+o>i&&(l=Math.max(8,i-o-8));break;case"left-start":l=e.top,a=e.left-6-n,s="top right",a<0&&(a=e.right+6,s="top left"),l+o>i&&(l=Math.max(8,i-o-8))}return{top:l+window.scrollY,left:a+window.scrollX,transformOrigin:s}}function dt(e,t){return{position:"absolute",top:t.top,left:t.left,zIndex:9999,minWidth:200,maxWidth:320,backgroundColor:e.surface,border:`1.5px solid ${e.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",padding:"4px 0",transformOrigin:t.transformOrigin,overflow:"hidden"}}function ct({color:e}){return(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})})}function ut({color:e}){return(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"5",fill:e}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:e,strokeWidth:"2"})]})}function pt({color:e}){return(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M9 18l6-6-6-6"})})}function ht({items:e,pos:o,panelId:r,onClose:i,onCloseAll:d,isSubmenu:c=!1}){const u=t.useTheme(),[p,h]=(0,l.useState)(-1),[f,m]=(0,l.useState)(null),[g,x]=(0,l.useState)(null),b=(0,l.useRef)(null),[y,v]=(0,l.useState)(""),w=(0,l.useRef)(null),k=function(e){const t=[];let n=0;for(const o of e)if("separator"!==o.type)if("radio-group"===o.type)for(let e=0;e<o.options.length;e++)t.push({kind:"radio",item:o,optionIdx:e,idx:n++});else"check"===o.type?t.push({kind:"check",item:o,idx:n++}):"submenu"===o.type?t.push({kind:"submenu",item:o,idx:n++}):t.push({kind:"action",item:o,idx:n++});return t}(e);(0,l.useEffect)(()=>{b.current?.focus()},[]),(0,l.useEffect)(()=>{p<0||(b.current?.querySelector(`[data-midx="${p}"]`))?.scrollIntoView({block:"nearest"})},[p]);const S=(0,l.useCallback)(e=>{if("action"===e.kind){if(e.item.disabled)return;e.item.onClick?.(),d()}else if("check"===e.kind){if(e.item.disabled)return;e.item.onChange?.(!e.item.checked)}else if("radio"===e.kind){if(e.item.disabled)return;e.item.onChange?.(e.item.options[e.optionIdx].value)}else if("submenu"===e.kind){if(e.item.disabled)return;m(e.item.id)}},[d]);function C(){m(null),x(null)}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("style",{children:"\n@keyframes tkxMenuIn {\n from { opacity: 0; transform: scale(0.94); }\n to { opacity: 1; transform: scale(1); }\n}\n@keyframes tkxMenuInReduced {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@media (prefers-reduced-motion: no-preference) {\n .tkx-menu-panel {\n animation: tkxMenuIn 130ms cubic-bezier(0.16, 1, 0.3, 1) forwards;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .tkx-menu-panel {\n animation: tkxMenuInReduced 100ms ease forwards;\n }\n}\n"}),(0,a.jsx)("div",{ref:b,id:r,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),h(e=>{const t=e+1;return t<k.length?t:0});break;case"ArrowUp":e.preventDefault(),h(e=>{const t=e-1;return t>=0?t:k.length-1});break;case"Home":e.preventDefault(),h(0);break;case"End":e.preventDefault(),h(k.length-1);break;case"Enter":case" ":e.preventDefault(),p>=0&&k[p]&&S(k[p]);break;case"Escape":e.preventDefault(),c?i():d();break;case"Tab":e.preventDefault(),d();break;case"ArrowRight":e.preventDefault(),p>=0&&"submenu"===k[p]?.kind&&m(k[p].item.id);break;case"ArrowLeft":e.preventDefault(),c&&i();break;default:1!==e.key.length||e.ctrlKey||e.metaKey||function(e){w.current&&clearTimeout(w.current);const t=y+e.toLowerCase();v(t);const n=k.findIndex(e=>("radio"===e.kind?e.item.options[e.optionIdx].label:e.item.label).toLowerCase().startsWith(t));n>=0&&h(n),w.current=setTimeout(()=>v(""),800)}(e.key)}},style:{...dt(u,o),maxHeight:400,overflowY:"auto"},children:(()=>{let t=-1;return e.map(e=>{if("separator"===e.type)return(0,a.jsx)("div",{role:"separator",style:{margin:(e.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:e.label?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{flex:1,height:1,backgroundColor:u.border,marginLeft:14}}),(0,a.jsx)("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:u.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)}),(0,a.jsx)("div",{style:{flex:1,height:1,backgroundColor:u.border,marginRight:14}})]}):(0,a.jsx)("div",{style:{flex:1,height:1,backgroundColor:u.border,margin:"0 10px"}})},e.id);if("radio-group"===e.type)return(0,a.jsxs)("div",{role:"group","aria-label":e.label,children:[e.label&&(0,a.jsx)("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:u.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:n.sanitizeString(e.label)}),e.options.map((o,r)=>{t++;const i=t,l=i===p,s=o.value===e.value,d=!!e.disabled,c=ft(u,l,!1,d);return(0,a.jsxs)("div",{role:"menuitemradio","aria-checked":s,"aria-disabled":d||void 0,"data-midx":i,tabIndex:-1,style:c,onClick:()=>!d&&e.onChange?.(o.value),onMouseEnter:()=>!d&&h(i),children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:s?(0,a.jsx)(ut,{color:u.primary}):(0,a.jsx)("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${u.border}`,display:"inline-block"}})}),o.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex",color:u.textMuted},children:o.icon}),(0,a.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(o.label)})]},o.value)})]},e.id);if("check"===e.type){t++;const o=t,r=o===p,i=!!e.disabled,l=ft(u,r,!1,i);return(0,a.jsxs)("div",{role:"menuitemcheckbox","aria-checked":e.checked,"aria-disabled":i||void 0,"data-midx":o,tabIndex:-1,style:l,onClick:()=>!i&&e.onChange?.(!e.checked),onMouseEnter:()=>!i&&h(o),children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:e.checked?(0,a.jsx)(ct,{color:u.primary}):(0,a.jsx)("span",{style:{width:14,height:14,display:"inline-block"}})}),e.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex",color:u.textMuted},children:e.icon}),(0,a.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)})]},e.id)}if("submenu"===e.type){t++;const o=t,i=o===p,l=!!e.disabled,c=f===e.id,b=ft(u,i||c,!1,l);return(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsxs)("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":c,"aria-disabled":l||void 0,"data-midx":o,tabIndex:-1,style:b,onMouseEnter:t=>{l||(h(o),function(e,t){const n=t.getBoundingClientRect();m(e.id),x(function(e,t,n){const o=window.innerWidth,r=window.innerHeight;let i=e.right+4,l="top left";i+220>o&&(i=e.left-4-220,l="top right");let a=e.top;return a+n>r&&(a=Math.max(8,r-n-8)),{top:a+window.scrollY,left:i+window.scrollX,transformOrigin:l}}(n,0,Math.min(38*e.items.length+12,360)))}(e,t.currentTarget))},onMouseLeave:()=>{},onClick:()=>{l||m(c?null:e.id)},children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:e.icon?(0,a.jsx)("span",{style:{display:"flex",color:u.textMuted},children:e.icon}):(0,a.jsx)("span",{style:{width:14}})}),(0,a.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)}),(0,a.jsx)(pt,{color:u.textMuted})]}),c&&g&&(0,s.createPortal)((0,a.jsx)(ht,{items:e.items,pos:g,panelId:`${r}-sub-${e.id}`,onClose:C,onCloseAll:d,isSubmenu:!0}),document.body)]},e.id)}const o=e;t++;const i=t,l=i===p,c=!!o.disabled,b=!!o.danger,y=ft(u,l,b,c);return(0,a.jsxs)("div",{role:"menuitem","aria-disabled":c||void 0,"data-midx":i,tabIndex:-1,style:y,onClick:()=>{c||(o.onClick?.(),d())},onMouseEnter:()=>{c||(h(i),C())},children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:o.icon?(0,a.jsx)("span",{style:{display:"flex",color:b?u.danger:u.textMuted},children:o.icon}):(0,a.jsx)("span",{style:{width:14}})}),(0,a.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(o.label)}),o.description&&(0,a.jsx)("span",{style:{display:"block",fontSize:"12px",color:u.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(o.description)})]}),o.shortcut&&(0,a.jsx)("span",{style:{fontSize:"12px",color:u.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:n.sanitizeString(o.shortcut)})]},o.id)})})()})]})}function ft(e,t,n,o){const r=n?e.danger:e.text;return{display:"flex",alignItems:"center",gap:8,padding:"7px 14px",fontSize:"14px",fontFamily:"inherit",cursor:o?"not-allowed":"pointer",userSelect:"none",color:o?e.textMuted:t&&n?e.danger:r,backgroundColor:t?n?`${e.danger}18`:`${e.primary}18`:"transparent",transition:"background-color 80ms",opacity:o?.5:1,outline:"none"}}function mt({trigger:e,items:t,placement:n="bottom-start",isDisabled:o=!1,onOpen:r,onClose:i,className:d,style:c}){const u=`tkx-menu-${(0,l.useId)().replace(/:/g,"")}`,[p,h]=(0,l.useState)(!1),[f,m]=(0,l.useState)(null),g=(0,l.useRef)(null),x=(0,l.useCallback)(()=>{if(o)return;const e=g.current;e&&(m(st(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360))),h(!0),r?.())},[o,t.length,r,n]),b=(0,l.useCallback)(()=>{h(!1),i?.(),(g.current?.firstElementChild)?.focus?.()},[i]);return(0,l.useEffect)(()=>{if(!p)return;const e=e=>{const t=e.target;if(g.current?.contains(t))return;const n=document.querySelectorAll(".tkx-menu-panel");for(const o of n)if(o.contains(t))return;b()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[p,b]),(0,l.useEffect)(()=>{if(!p)return;const e=()=>{const e=g.current;e&&m(st(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360)))};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[p,t.length,n]),(0,a.jsxs)("span",{ref:g,className:d,style:{display:"inline-flex",...c},children:[(0,a.jsx)("span",{role:"button",tabIndex:o?-1:0,"aria-haspopup":"menu","aria-expanded":p,"aria-controls":p?u:void 0,"aria-disabled":o||void 0,onClick:()=>p?b():x(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),p||x()),"Escape"===e.key&&p&&(e.preventDefault(),b())},style:{display:"inline-flex",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,outline:"none"},children:e}),p&&f&&(0,s.createPortal)((0,a.jsx)(ht,{items:t,pos:f,panelId:u,onClose:b,onCloseAll:b}),document.body)]})}mt.displayName="TkxMenu";var gt={sm:120,md:180,lg:240,xl:320};function xt(e){const t=new Date;if(e)try{const n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,weekday:"long",month:"long",day:"2-digit",year:"numeric"}).formatToParts(t),o=e=>n.find(t=>t.type===e)?.value??"0";let r=parseInt(o("hour"),10);24===r&&(r=0);const i=parseInt(o("minute"),10),l=parseInt(o("second"),10),a=`${o("weekday")}, ${o("month")} ${o("day")}, ${o("year")}`;return{hours:r,minutes:i,seconds:l,milliseconds:t.getMilliseconds(),dateString:a}}catch{}const n=t.getHours(),o=t.getMinutes(),r=t.getSeconds(),i=t.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:o,seconds:r,milliseconds:t.getMilliseconds(),dateString:i}}function bt({time:e,size:t,analogStyle:n,showSeconds:o,reducedMotion:r,primary:i,danger:l,text:s,textMuted:d,border:c,surface:u,bg:p}){const h=t/2,f=t/2,m=t/2-4,{hours:g,minutes:x,seconds:b,milliseconds:y}=e,v=(b+(r?0:y)/1e3)/60*360,w=x/60*360+b/60*6,k=g%12/12*360+x/60*30,S=(e,t)=>{const n=(e-90)*Math.PI/180;return{x:h+Math.cos(n)*t,y:f+Math.sin(n)*t}},C=r?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if("modern"===n){const e=(e,t)=>{const n=360*e-90;return`M ${h+Math.cos(-90*Math.PI/180)*t} ${f+Math.sin(-90*Math.PI/180)*t} A ${t} ${t} 0 ${e>.5?1:0} 1 ${h+Math.cos(n*Math.PI/180)*t} ${f+Math.sin(n*Math.PI/180)*t}`},n=g%12/12+x/60/12,u=x/60+b/3600,p=(b+(r?0:y/1e3))/60,v=m-2,w=m-10,k=m-18;return(0,a.jsxs)("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:h,cy:f,r:v,fill:"none",stroke:c,strokeWidth:4}),(0,a.jsx)("circle",{cx:h,cy:f,r:w,fill:"none",stroke:c,strokeWidth:4}),o&&(0,a.jsx)("circle",{cx:h,cy:f,r:k,fill:"none",stroke:c,strokeWidth:3}),(0,a.jsx)("path",{d:e(n,v),fill:"none",stroke:i,strokeWidth:4,strokeLinecap:"round"}),(0,a.jsx)("path",{d:e(u,w),fill:"none",stroke:s,strokeWidth:4,strokeLinecap:"round"}),o&&(0,a.jsx)("path",{d:e(p,k),fill:"none",stroke:l,strokeWidth:3,strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:h,cy:f,r:4,fill:i}),(0,a.jsxs)("text",{x:h,y:f+20,textAnchor:"middle",fontSize:.12*t,fill:d,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(g).padStart(2,"0"),":",String(x).padStart(2,"0")]})]})}const $=S(k,.5*m),z=S(w,.75*m),M=S(v,.85*m),N=S(v+180,.2*m),I=[];if("classic"===n){for(let e=0;e<60;e++){const t=e%5==0,n=(e/60*360-90)*Math.PI/180,o=t?m-10:m-6,r=h+Math.cos(n)*m,i=f+Math.sin(n)*m,l=h+Math.cos(n)*o,c=f+Math.sin(n)*o;I.push((0,a.jsx)("line",{x1:r,y1:i,x2:l,y2:c,stroke:t?s:d,strokeWidth:t?2:1,strokeLinecap:"round"},e))}for(const{n:e,angle:n}of[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}]){const o=(n-90)*Math.PI/180,r=m-20;I.push((0,a.jsx)("text",{x:h+Math.cos(o)*r,y:f+Math.sin(o)*r,textAnchor:"middle",dominantBaseline:"central",fontSize:.09*t,fill:s,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:e},`n${e}`))}}else for(let L=0;L<12;L++){const e=(L/12*360-90)*Math.PI/180,t=m-8;I.push((0,a.jsx)("circle",{cx:h+Math.cos(e)*t,cy:f+Math.sin(e)*t,r:L%3==0?3:2,fill:L%3==0?s:d},L))}return(0,a.jsxs)("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",style:{display:"block"},children:[(0,a.jsx)("circle",{cx:h,cy:f,r:m,fill:u,stroke:c,strokeWidth:2}),I,(0,a.jsx)("line",{x1:h,y1:f,x2:$.x,y2:$.y,stroke:i,strokeWidth:"minimal"===n?3:4,strokeLinecap:"round",style:{transformOrigin:`${h}px ${f}px`,transition:C}}),(0,a.jsx)("line",{x1:h,y1:f,x2:z.x,y2:z.y,stroke:s,strokeWidth:"minimal"===n?2:3,strokeLinecap:"round",style:{transformOrigin:`${h}px ${f}px`,transition:C}}),o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("line",{x1:N.x,y1:N.y,x2:M.x,y2:M.y,stroke:l,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${h}px ${f}px`,transition:"none"}}),(0,a.jsx)("circle",{cx:h,cy:f,r:3,fill:l})]}),(0,a.jsx)("circle",{cx:h,cy:f,r:"minimal"===n?3:5,fill:i})]})}function yt({time:e,format:t,showSeconds:o,showDate:r,label:i,size:l,primary:s,text:d,textMuted:c,colonVisible:u}){const{hours:p,minutes:h,seconds:f,dateString:m}=e;let g=p,x="";"12h"===t&&(x=p>=12?"PM":"AM",g=p%12||12);const b=.2*l,y={opacity:u?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};return(0,a.jsxs)("div",{style:{textAlign:"center",fontFamily:"'Courier New', Courier, monospace",fontVariantNumeric:"tabular-nums",lineHeight:1.1},children:[(0,a.jsxs)("div",{style:{fontSize:b,color:s,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[(0,a.jsx)("span",{children:String(g).padStart(2,"0")}),(0,a.jsx)("span",{style:y,children:":"}),(0,a.jsx)("span",{children:String(h).padStart(2,"0")}),o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{style:y,children:":"}),(0,a.jsx)("span",{children:String(f).padStart(2,"0")})]}),"12h"===t&&(0,a.jsx)("span",{style:{fontSize:.45*b,color:c,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:.05*b},children:x})]}),r&&(0,a.jsx)("div",{style:{fontSize:.072*l,color:c,marginTop:.025*l,letterSpacing:"0.03em"},children:m}),i&&(0,a.jsx)("div",{style:{fontSize:.065*l,color:c,marginTop:.015*l,textTransform:"uppercase",letterSpacing:"0.08em"},children:n.sanitizeString(i)})]})}function vt({variant:e="both",size:n="md",showSeconds:r=!0,showDate:i=!1,format:s="24h",timezone:d,timezone2:c,label:u,analogStyle:p="classic",className:h,style:f}){const m=t.useTheme(),g=o.useReducedMotion(),[x,b]=(0,l.useState)(()=>xt(d)),[y,v]=(0,l.useState)(()=>c?xt(c):null),[w,k]=(0,l.useState)(!0),[S,C]=(0,l.useState)(!1),$=(0,l.useRef)(null);(0,l.useEffect)(()=>{C(!0)},[]),(0,l.useEffect)(()=>{const e=()=>{b(xt(d)),c&&v(xt(c))};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[d,c]),(0,l.useEffect)(()=>($.current=setInterval(()=>{k(e=>!e)},500),()=>{$.current&&clearInterval($.current)}),[]);const z=gt[n],M="analog"===e||"both"===e,N="digital"===e||"both"===e;return(0,a.jsxs)("div",{className:h,style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"both"===e?.06*z+"px":0,opacity:S?1:0,transition:g?"none":"opacity 0.4s ease",...f},role:"timer","aria-live":"off",children:[M&&(0,a.jsx)(bt,{time:x,size:z,analogStyle:p,showSeconds:r,reducedMotion:g,primary:m.primary,danger:m.danger,text:m.text,textMuted:m.textMuted,border:m.border,surface:m.surface,bg:m.bg}),N&&(0,a.jsx)(yt,{time:x,format:s,showSeconds:r,showDate:i,label:u,size:z,primary:m.primary,text:m.text,textMuted:m.textMuted,colonVisible:w}),y&&c&&(0,a.jsx)("div",{style:{marginTop:.04*z,padding:`${.03*z}px ${.06*z}px`,borderTop:`1px solid ${m.border}`,textAlign:"center"},children:(0,a.jsx)(yt,{time:y,format:s,showSeconds:!1,showDate:!1,label:c,size:.7*z,primary:m.secondary,text:m.text,textMuted:m.textMuted,colonVisible:w})})]})}function wt(e){if(!isFinite(e)||isNaN(e))return"0:00";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%60);return t>0?`${t}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`}function kt({path:e,size:t=20,color:n="currentColor",title:o}){return(0,a.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:n,"aria-hidden":o?void 0:"true",role:o?"img":void 0,"aria-label":o,style:{display:"block",flexShrink:0},children:(0,a.jsx)("path",{d:e})})}vt.displayName="TkxClock";var St="M8 5v14l11-7z",Ct="M6 19h4V5H6v14zm8-14v14h4V5h-4z";function $t({onClick:e,title:t,children:n,active:o,primary:r}){const[i,s]=(0,l.useState)(!1);return(0,a.jsx)("button",{type:"button",onClick:e,title:t,"aria-label":t,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:o||i?r:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function zt({src:e,poster:r,title:i,width:s="100%",height:d,autoPlay:c=!1,loop:u=!1,muted:p=!1,controls:h=!0,showTitle:f=!0,allowFullscreen:m=!0,allowPiP:g=!0,allowDownload:x=!1,chapters:b=[],subtitles:y=[],startTime:v,onPlay:w,onPause:k,onEnded:S,onTimeUpdate:C,className:$,style:z}){const M=t.useTheme(),N=o.useReducedMotion(),I=(0,l.useRef)(null),L=(0,l.useRef)(null),R=(0,l.useRef)(null),D=(0,l.useRef)(null),[T,W]=(0,l.useState)(!1),[A,B]=(0,l.useState)(0),[E,H]=(0,l.useState)(0),[F,j]=(0,l.useState)(0),[P,O]=(0,l.useState)(1),[V,U]=(0,l.useState)(p),[K,Y]=(0,l.useState)(!1),[q,X]=(0,l.useState)(!0),[G,_]=(0,l.useState)(!1),[Z,J]=(0,l.useState)(1),[Q,ee]=(0,l.useState)(!1),[te,ne]=(0,l.useState)(-1),[oe,re]=(0,l.useState)(null),[ie,le]=(0,l.useState)(0),[ae,se]=(0,l.useState)(null),[de,ce]=(0,l.useState)(!1),[ue,pe]=(0,l.useState)(!1),[he,fe]=(0,l.useState)(null),[me,ge]=(0,l.useState)(!1);(0,l.useEffect)(()=>{const e=I.current;if(!e)return;void 0!==v&&(e.currentTime=v);const t=()=>{B(e.currentTime),e.buffered.length>0&&j(e.buffered.end(e.buffered.length-1))},n=()=>H(e.duration),o=()=>W(!0),r=()=>{W(!1),_(!0)},i=()=>{W(!1),_(!0),S?.()},l=()=>ce(!0),a=()=>ce(!1),s=()=>pe(!0),d=()=>pe(!1),c=()=>{const t=e.error;fe(t?`Error ${t.code}: ${t.message||"Failed to load video"}`:"Failed to load video"),pe(!1)};return e.addEventListener("timeupdate",t),e.addEventListener("durationchange",n),e.addEventListener("play",o),e.addEventListener("pause",r),e.addEventListener("ended",i),e.addEventListener("enterpictureinpicture",l),e.addEventListener("leavepictureinpicture",a),e.addEventListener("waiting",s),e.addEventListener("canplay",d),e.addEventListener("error",c),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("durationchange",n),e.removeEventListener("play",o),e.removeEventListener("pause",r),e.removeEventListener("ended",i),e.removeEventListener("enterpictureinpicture",l),e.removeEventListener("leavepictureinpicture",a),e.removeEventListener("waiting",s),e.removeEventListener("canplay",d),e.removeEventListener("error",c)}},[S,v]),(0,l.useEffect)(()=>{I.current&&(T?w?.():k?.())},[T,w,k]),(0,l.useEffect)(()=>{C?.(A,E)},[A,E,C]),(0,l.useEffect)(()=>{const e=I.current;if(!e)return;const t=e.textTracks;for(let n=0;n<t.length;n++)t[n].mode=n===te?"showing":"disabled"},[te]),(0,l.useEffect)(()=>{const e=()=>Y(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),(0,l.useEffect)(()=>{const e=L.current;if(!e)return;const t=e=>{const t=I.current;if(t&&"INPUT"!==e.target.tagName)switch(e.key){case" ":case"k":e.preventDefault(),be();break;case"f":case"F":m&&ve();break;case"m":case"M":ye();break;case"ArrowRight":e.preventDefault(),t.currentTime=Math.min(t.currentTime+10,t.duration);break;case"ArrowLeft":e.preventDefault(),t.currentTime=Math.max(t.currentTime-10,0);break;case"ArrowUp":e.preventDefault(),O(Math.min(P+.1,1)),I.current&&(I.current.volume=Math.min(P+.1,1));break;case"ArrowDown":e.preventDefault(),O(Math.max(P-.1,0)),I.current&&(I.current.volume=Math.max(P-.1,0))}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[P,m]);const xe=(0,l.useCallback)(()=>{X(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{T&&X(!1)},3e3)},[T]);(0,l.useEffect)(()=>(xe(),()=>{D.current&&clearTimeout(D.current)}),[T,xe]);const be=(0,l.useCallback)(()=>{const e=I.current;e&&(e.paused?(e.play().catch(()=>{}),se("play"),_(!1)):(e.pause(),se("pause")),setTimeout(()=>se(null),600))},[]),ye=(0,l.useCallback)(()=>{const e=I.current;if(!e)return;const t=!V;U(t),e.muted=t},[V]),ve=(0,l.useCallback)(()=>{const e=L.current;e&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):e.requestFullscreen().catch(()=>{}))},[]),we=(0,l.useCallback)(async()=>{const e=I.current;if(e)try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{}},[]),ke=(0,l.useCallback)(()=>{0!==y.length&&(ne(e=>(e+1)%(y.length+1)-1),ne(e=>{const t=e+1;return t>=y.length?-1:t}))},[y.length]),Se=(0,l.useCallback)(()=>{const e=I.current;e&&(e.currentTime=Math.min(e.currentTime+10,e.duration||0))},[]),Ce=(0,l.useCallback)(()=>{const e=I.current;e&&(e.currentTime=Math.max(e.currentTime-10,0))},[]),$e=(0,l.useCallback)(()=>{const e=I.current;e&&(fe(null),e.load())},[]),ze=(0,l.useCallback)(()=>{m&&ve()},[m,ve]),Me=(0,l.useCallback)(e=>{const t=I.current,n=R.current;if(!t||!n||!E)return;const o=n.getBoundingClientRect();t.currentTime=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width))*E},[E]),Ne=(0,l.useCallback)(e=>{const t=R.current;if(!t||!E)return;const n=t.getBoundingClientRect();re(Math.max(0,Math.min(1,(e.clientX-n.left)/n.width))*E),le(e.clientX-n.left)},[E]),Ie=(0,l.useCallback)(e=>{const t=parseFloat(e.target.value);O(t),I.current&&(I.current.volume=t,I.current.muted=0===t,U(0===t))},[]),Le=(0,l.useCallback)(e=>{J(e),I.current&&(I.current.playbackRate=e),ee(!1)},[]),Re=b.length>0?[...b].reverse().find(e=>A>=e.time):null,De=e=>[...b].reverse().find(t=>e>=t.time)??null,Te=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],We=Array.isArray(e)?e[0].src:e,Ae=q||G||!T,Be=N?"none":"opacity 0.25s ease",Ee=V||0===P?"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z":P<.5?"M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z":"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z",He=E>0?A/E*100:0,Fe=E>0?F/E*100:0;return(0,a.jsxs)("div",{ref:L,className:$,tabIndex:0,onMouseMove:xe,onMouseLeave:()=>{T&&X(!1)},style:{position:"relative",width:s,height:d??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...z},children:[(0,a.jsxs)("video",{ref:I,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:r,autoPlay:c,loop:u,muted:p,playsInline:!0,onClick:be,onDoubleClick:ze,children:[Te.map((e,t)=>(0,a.jsx)("source",{src:e.src,type:e.type},t)),y.map((e,t)=>(0,a.jsx)("track",{kind:"subtitles",label:n.sanitizeString(e.label),srcLang:e.lang,src:e.src,default:e.default},t))]}),f&&i&&(0,a.jsxs)("div",{style:{position:"absolute",top:0,left:0,right:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%)",padding:"16px 16px 32px",opacity:Ae?1:0,transition:Be,pointerEvents:"none"},children:[(0,a.jsx)("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:n.sanitizeString(i)}),Re&&(0,a.jsxs)("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",n.sanitizeString(Re.label)]})]}),ae&&(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.45)",borderRadius:"50%",width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center",animation:N?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:(0,a.jsx)(kt,{path:"play"===ae?St:Ct,size:32,color:"#fff"})}),ue&&!he&&(0,a.jsx)("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:(0,a.jsx)("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:M.primary,borderRadius:"50%",animation:N?"none":"tkxvp-spin 0.8s linear infinite"}})}),he&&(0,a.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.8)",zIndex:20,gap:12},children:[(0,a.jsx)(kt,{path:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",size:48,color:"#ef4444"}),(0,a.jsx)("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:he}),(0,a.jsxs)("button",{type:"button",onClick:$e,style:{display:"flex",alignItems:"center",gap:6,background:M.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[(0,a.jsx)(kt,{path:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",size:18,color:"#fff"}),"Retry"]})]}),h&&(0,a.jsxs)("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%)",padding:"32px 12px 8px",opacity:Ae?1:0,transition:Be},onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[(0,a.jsxs)("div",{ref:R,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(E),"aria-valuenow":Math.floor(A),tabIndex:0,onClick:Me,onMouseMove:Ne,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.height="8px"},onMouseLeave:e=>{e.currentTarget.style.height="4px",re(null)},children:[(0,a.jsx)("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Fe}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),(0,a.jsx)("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${He}%`,background:M.primary,borderRadius:2,pointerEvents:"none"}}),(0,a.jsx)("div",{style:{position:"absolute",top:"50%",left:`${He}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:M.primary,pointerEvents:"none"}}),b.map((e,t)=>{const o=E>0?e.time/E*100:0;return(0,a.jsx)("div",{title:n.sanitizeString(e.label),style:{position:"absolute",top:"50%",left:`${o}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${M.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},t)}),null!==oe&&(0,a.jsxs)("div",{style:{position:"absolute",bottom:12,left:ie,transform:"translateX(-50%)",background:"rgba(0,0,0,0.8)",color:"#fff",fontSize:"0.72rem",padding:"2px 6px",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none"},children:[wt(oe),De(oe)&&(0,a.jsx)("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:n.sanitizeString(De(oe).label)})]})]}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:2},children:[(0,a.jsx)($t,{onClick:be,title:T?"Pause":"Play",primary:M.primary,children:(0,a.jsx)(kt,{path:T?Ct:St,size:22})}),(0,a.jsx)($t,{onClick:Ce,title:"Skip back 10 seconds",primary:M.primary,children:(0,a.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,a.jsx)(kt,{path:"M11.99 5V1l-5 5 5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z",size:22}),(0,a.jsx)("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),(0,a.jsx)($t,{onClick:Se,title:"Skip forward 10 seconds",primary:M.primary,children:(0,a.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,a.jsx)(kt,{path:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8V1l-5 5 5 5V7c3.31 0 6 2.69 6 6z",size:22}),(0,a.jsx)("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>ge(!0),onMouseLeave:()=>ge(!1),children:[(0,a.jsx)($t,{onClick:ye,title:V?"Unmute":"Mute",primary:M.primary,children:(0,a.jsx)(kt,{path:Ee,size:20})}),(0,a.jsx)("div",{style:{overflow:"hidden",width:me?64:0,opacity:me?1:0,transition:N?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:(0,a.jsx)("input",{type:"range",min:0,max:1,step:.05,value:V?0:P,onChange:Ie,"aria-label":"Volume",style:{width:64,accentColor:M.primary,cursor:"pointer",height:4}})})]}),(0,a.jsxs)("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[wt(A)," / ",wt(E)]}),(0,a.jsx)("div",{style:{flex:1}}),y.length>0&&(0,a.jsx)($t,{onClick:ke,title:"Subtitles",primary:M.primary,active:te>=0,children:(0,a.jsx)(kt,{path:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z",size:20})}),(0,a.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ee(e=>!e),title:"Playback speed",style:{background:"none",border:"none",cursor:"pointer",color:"#fff",fontSize:"0.75rem",fontWeight:600,padding:"6px 8px",letterSpacing:"0.02em",position:"relative"},children:[Z,"×"]}),1!==Z&&(0,a.jsxs)("span",{style:{position:"absolute",top:0,right:0,background:M.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[Z,"x"]}),Q&&(0,a.jsx)("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${M.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>Le(e),style:{display:"block",width:"100%",padding:"6px 14px",background:e===Z?M.primary+"30":"none",border:"none",color:e===Z?M.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[e,"×"]},e))})]}),g&&"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&(0,a.jsx)($t,{onClick:we,title:"Picture-in-Picture",primary:M.primary,active:de,children:(0,a.jsx)(kt,{path:"M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z",size:20})}),x&&(0,a.jsx)("a",{href:We,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:(0,a.jsx)(kt,{path:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",size:20})}),m&&(0,a.jsx)($t,{onClick:ve,title:K?"Exit fullscreen":"Fullscreen",primary:M.primary,children:(0,a.jsx)(kt,{path:K?"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z":"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",size:20})})]})]}),(0,a.jsx)("style",{children:"\n @keyframes tkxvp-flash {\n 0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }\n 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }\n }\n @keyframes tkxvp-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]})}zt.displayName="TkxVideoPlayer";var Mt={sm:{circle:24,fontSize:"0.75rem",titleSize:"0.8rem",descSize:"0.7rem",connectorWidth:2},md:{circle:32,fontSize:"0.875rem",titleSize:"0.9rem",descSize:"0.775rem",connectorWidth:2},lg:{circle:40,fontSize:"1rem",titleSize:"1rem",descSize:"0.85rem",connectorWidth:3}};function Nt({size:e}){const t=.55*e;return(0,a.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})}function It({size:e}){const t=.55*e;return(0,a.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})})}function Lt({status:e,index:t,showStepNumbers:n,icon:o,circleSize:r,fontSize:i,primary:l,danger:s,success:d,text:c,textMuted:u,border:p,surface:h,variant:f,reducedMotion:m,clickable:g}){const x="completed"===e,b="active"===e,y="error"===e;let v=h,w=p,k=u,S=2;x?(v="filled"===f?d:h,w=d,k="filled"===f?"#fff":d):b?(v="outlined"===f?h:l,w=l,k="outlined"===f?l:"#fff",S=2):y?(v="filled"===f?s:h,w=s,k="filled"===f?"#fff":s):"pending"===e&&(v=h,w=p,k=u);const C=b&&!m?{boxShadow:`0 0 0 4px ${l}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},$=g?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let z;return z=!o||x||y?x?(0,a.jsx)(Nt,{size:r}):y?(0,a.jsx)(It,{size:r}):n?(0,a.jsx)("span",{style:{fontSize:i,fontWeight:600,lineHeight:1},children:t+1}):(0,a.jsx)("span",{style:{fontSize:.22*r,lineHeight:1,background:k,borderRadius:"50%",width:.22*r,height:.22*r,display:"block"}}):(0,a.jsx)("span",{style:{fontSize:i,lineHeight:1},children:o}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("style",{children:`\n @keyframes tkxstepper-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 ${l}50; }\n 50% { box-shadow: 0 0 0 6px ${l}20; }\n }\n `}),(0,a.jsx)("div",{style:{width:r,height:r,minWidth:r,borderRadius:"50%",border:`${S}px solid ${w}`,backgroundColor:v,color:k,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:m?"none":"background-color 0.2s, border-color 0.2s",...C,...$},children:z})]})}function Rt({completed:e,orientation:t,connectorStyle:n,connectorWidth:o,primary:r,border:i,reducedMotion:l}){const s=e?r:i;return"horizontal"===t?(0,a.jsx)("div",{"aria-hidden":"true",style:{flex:1,height:o,background:"solid"===n?s:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(90deg, ${s} 0, ${s} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}):(0,a.jsx)("div",{"aria-hidden":"true",style:{width:o,flex:1,minHeight:20,background:"solid"===n?s:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(180deg, ${s} 0, ${s} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function Dt({steps:e,activeStep:r=0,orientation:i="horizontal",variant:l="default",size:s="md",clickable:d=!1,onStepClick:c,showStepNumbers:u=!0,alternateLabel:p=!1,connector:h="solid",className:f,style:m}){const g=t.useTheme(),x=o.useReducedMotion(),b=Mt[s],y="horizontal"===i;return(0,a.jsx)("div",{className:f,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:y?"row":"column",alignItems:y?p?"flex-start":"center":"stretch",width:"100%",gap:0,...m},children:e.map((t,o)=>{const i=((e,t)=>e.status?e.status:t<r?"completed":t===r?"active":"pending")(t,o),s=o===e.length-1,f="completed"===i||o<r,m=o%2==0,v=()=>{d&&c?.(o)},w=(0,a.jsx)(Lt,{status:i,index:o,showStepNumbers:u,icon:t.icon,circleSize:b.circle,fontSize:b.fontSize,primary:g.primary,danger:g.danger,success:g.success,text:g.text,textMuted:g.textMuted,border:g.border,surface:g.surface,variant:l,reducedMotion:x,clickable:d}),k=(0,a.jsxs)("div",{style:{textAlign:y&&!p?"center":"left",maxWidth:y?120:void 0},children:[(0,a.jsxs)("div",{style:{fontSize:b.titleSize,fontWeight:"active"===i?600:500,color:"pending"===i?g.textMuted:"error"===i?g.danger:g.text,lineHeight:1.3,transition:x?"none":"color 0.2s"},children:[n.sanitizeString(t.title),t.optional&&(0,a.jsx)("span",{style:{fontSize:b.descSize,color:g.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),t.description&&(0,a.jsx)("div",{style:{fontSize:b.descSize,color:g.textMuted,marginTop:2,lineHeight:1.4},children:n.sanitizeString(t.description)}),t.error&&"error"===i&&(0,a.jsx)("div",{style:{fontSize:b.descSize,color:g.danger,marginTop:2},children:n.sanitizeString(t.error)})]});return y?(0,a.jsxs)("div",{role:"listitem",style:{display:"flex",flex:s?0:1,alignItems:"center",minWidth:0},children:[(0,a.jsxs)("div",{onClick:v,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:d?"pointer":"default",flexShrink:0},"aria-current":"active"===i?"step":void 0,children:[p&&!m&&(0,a.jsx)("div",{style:{minHeight:1.5*b.circle+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:k}),w,!p&&k,p&&m&&(0,a.jsx)("div",{style:{marginTop:6},children:k})]}),!s&&(0,a.jsx)(Rt,{completed:f,orientation:"horizontal",connectorStyle:h,connectorWidth:b.connectorWidth,primary:g.primary,border:g.border,reducedMotion:x})]},t.id):(0,a.jsxs)("div",{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[(0,a.jsx)("div",{onClick:v,style:{cursor:d?"pointer":"default"},"aria-current":"active"===i?"step":void 0,children:w}),!s&&(0,a.jsx)(Rt,{completed:f,orientation:"vertical",connectorStyle:h,connectorWidth:b.connectorWidth,primary:g.primary,border:g.border,reducedMotion:x})]}),(0,a.jsx)("div",{style:{paddingTop:(b.circle-16*parseFloat(b.titleSize))/2,paddingBottom:s?0:16,flex:1,minWidth:0},children:k})]},t.id)})})}function Tt(e){let t=0,n=0,o=0;const r=e.replace("#","");3===r.length?(t=parseInt(r[0]+r[0],16),n=parseInt(r[1]+r[1],16),o=parseInt(r[2]+r[2],16)):r.length>=6&&(t=parseInt(r.slice(0,2),16),n=parseInt(r.slice(2,4),16),o=parseInt(r.slice(4,6),16)),t/=255,n/=255,o/=255;const i=Math.max(t,n,o),l=Math.min(t,n,o);let a=0,s=0;const d=(i+l)/2;if(i!==l){const e=i-l;switch(s=d>.5?e/(2-i-l):e/(i+l),i){case t:a=((n-o)/e+(n<o?6:0))/6;break;case n:a=((o-t)/e+2)/6;break;case o:a=((t-n)/e+4)/6}}return[Math.round(360*a),Math.round(100*s),Math.round(100*d)]}function Wt(e,t,n){n/=100;const o=(t/=100)*Math.min(n,1-n),r=t=>{const r=(t+e/30)%12,i=n-o*Math.max(Math.min(r-3,9-r,1),-1);return Math.round(255*i).toString(16).padStart(2,"0")};return`#${r(0)}${r(8)}${r(4)}`}function At(e){const t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return[isNaN(n)?0:n,isNaN(o)?0:o,isNaN(r)?0:r]}function Bt(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Et(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Ht(e,t,n){if("hex"===n)return t<1?`${e}${Math.round(255*t).toString(16).padStart(2,"0")}`:e;const[o,r,i]=At(e);if("rgb"===n)return t<1?`rgba(${o}, ${r}, ${i}, ${t.toFixed(2)})`:`rgb(${o}, ${r}, ${i})`;const[l,a,s]=Tt(e);return"hsl"===n?t<1?`hsla(${l}, ${a}%, ${s}%, ${t.toFixed(2)})`:`hsl(${l}, ${a}%, ${s}%)`:e}Dt.displayName="TkxStepper";var Ft=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function jt({hue:e,sat:t,bright:n,onChange:o}){const r=(0,l.useRef)(null),i=(0,l.useRef)(!1),s=(0,l.useCallback)(e=>{const t=r.current;if(!t)return;const n=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-n.left)/n.width)),l=Math.max(0,Math.min(1,(e.clientY-n.top)/n.height));o(Math.round(100*i),Math.round(100*(1-l)))},[o]);(0,l.useEffect)(()=>{const e=e=>{i.current&&s(e)},t=()=>{i.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[s]);const d=`${t}%`,c=100-n+"%";return(0,a.jsxs)("div",{ref:r,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:e=>{i.current=!0,s(e)},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),(0,a.jsx)("div",{style:{position:"absolute",left:d,top:c,transform:"translate(-50%, -50%)",width:"14px",height:"14px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.4)",pointerEvents:"none",backgroundColor:Wt(e,t,n/2+25)}})]})}function Pt({hue:e,onChange:t}){const n=(0,l.useRef)(null),o=(0,l.useRef)(!1),r=(0,l.useCallback)(e=>{const o=n.current;if(!o)return;const r=o.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));t(Math.round(360*i))},[t]);return(0,l.useEffect)(()=>{const e=e=>{o.current&&r(e)},t=()=>{o.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[r]),(0,a.jsx)("div",{ref:n,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:"linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)"},onMouseDown:e=>{o.current=!0,r(e)},children:(0,a.jsx)("div",{style:{position:"absolute",left:e/360*100+"%",top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`hsl(${e}, 100%, 50%)`,pointerEvents:"none"}})})}function Ot({alpha:e,hex:t,onChange:n}){const o=(0,l.useRef)(null),r=(0,l.useRef)(!1),i=(0,l.useCallback)(e=>{const t=o.current;if(!t)return;const r=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));n(Math.round(100*i)/100)},[n]);(0,l.useEffect)(()=>{const e=e=>{r.current&&i(e)},t=()=>{r.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[i]);const[s,d,c]=At(t);return(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),(0,a.jsx)("div",{ref:o,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${s},${d},${c},0), rgba(${s},${d},${c},1))`},onMouseDown:e=>{r.current=!0,i(e)},children:(0,a.jsx)("div",{style:{position:"absolute",left:100*e+"%",top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`rgba(${s},${d},${c},${e})`,pointerEvents:"none"}})})]})}var Vt={sm:{height:"32px",fontSize:"0.8125rem",px:"8px",btnW:"28px",iconSz:14},md:{height:"40px",fontSize:"0.875rem",px:"12px",btnW:"34px",iconSz:16},lg:{height:"48px",fontSize:"1rem",px:"14px",btnW:"40px",iconSz:18}};function Ut(e,t,n){let o=e;return void 0!==t&&(o=Math.max(o,t)),void 0!==n&&(o=Math.min(o,n)),o}function Kt(e,t){if(void 0===t)return e;const n=Math.pow(10,t);return Math.round(e*n)/n}function Yt({direction:e,isDisabled:t,btnW:n,height:o,primaryColor:r,borderColor:i,textMuted:s,iconSz:d,onStep:c,incrementLabel:u,decrementLabel:p}){const h=(0,l.useRef)(null),f=(0,l.useRef)(null),m="inc"===e?1:-1,g=(0,l.useCallback)(()=>{c(m),h.current=setTimeout(()=>{f.current=setInterval(()=>c(m),60)},400)},[m,c]),x=(0,l.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null),f.current&&(clearInterval(f.current),f.current=null)},[]);(0,l.useEffect)(()=>()=>x(),[x]);const b="inc"===e;return(0,a.jsx)("button",{type:"button","aria-label":b?u:p,disabled:t,onMouseDown:g,onMouseUp:x,onMouseLeave:x,onTouchStart:e=>{e.preventDefault(),g()},onTouchEnd:x,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:b?void 0:`1px solid ${i}`,borderLeft:b?`1px solid ${i}`:void 0,cursor:t?"not-allowed":"pointer",color:t?s:r,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:e=>{t||(e.currentTarget.style.background=`${r}12`)},onBlur:e=>{e.currentTarget.style.background="transparent"},children:b?(0,a.jsxs)("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):(0,a.jsx)("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function qt({value:e,defaultValue:o=0,onChange:i,min:s,max:d,step:c=1,precision:u,prefix:p,suffix:h,format:f,currency:m,locale:g,clampOnBlur:x=!0,allowMouseWheel:b=!1,size:y="md",label:v,hint:w,isDisabled:k=!1,isReadOnly:S=!1,isInvalid:C=!1,errorMessage:$,id:z,className:M,style:N}){const I=t.useTheme(),L=r.useLocale(),R=L.increment??"Increment",D=L.decrement??"Decrement",T=(0,l.useId)(),W=z??T,A=`${W}-hint`,B=`${W}-error`,E=void 0!==e,[H,F]=(0,l.useState)(o),j=E?e:H,[P,O]=(0,l.useState)(!1),[V,U]=(0,l.useState)(""),K=Vt[y],Y=C||!!$,q=Y?I.danger:P?I.primary:I.border,X=[w&&A,Y&&B].filter(Boolean).join(" ")||void 0,G=v?n.sanitizeString(v):void 0,_=w?n.sanitizeString(w):void 0,Z=$?n.sanitizeString($):void 0,J=p?n.sanitizeString(p):void 0,Q=h?n.sanitizeString(h):void 0,ee=(0,l.useCallback)(e=>{const t=Kt(e,u);E||F(t),i?.(t)},[E,i,u]),te=(0,l.useCallback)(e=>{k||S||ee(Ut(Kt(j+e*c,u),s,d))},[k,S,j,c,u,s,d,ee]),ne=P?V:function(e,t,n,o,r){const i=o??"en-US";return"currency"===t?new Intl.NumberFormat(i,{style:"currency",currency:n??"USD",minimumFractionDigits:r??2,maximumFractionDigits:r??2}).format(e):"percent"===t?new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:r??0,maximumFractionDigits:r??0}).format(e/100):"decimal"===t||void 0!==r?new Intl.NumberFormat(i,{minimumFractionDigits:r??0,maximumFractionDigits:r??20}).format(e):String(e)}(j,f,m,g,u),oe=(J||Q)&&!P;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1 w-full"),M),style:N,children:[G&&(0,a.jsx)("label",{htmlFor:W,className:n.tkx("text-sm font-medium font-sans"),style:{color:I.text},children:G}),(0,a.jsxs)("div",{className:n.tkx("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${q}`,backgroundColor:k?I.surfaceAlt:I.surface,opacity:k?.65:1,height:K.height},children:[(0,a.jsx)(Yt,{direction:"dec",isDisabled:k||S,btnW:K.btnW,height:K.height,primaryColor:I.primary,borderColor:I.border,textMuted:I.textMuted,iconSz:K.iconSz,onStep:te,incrementLabel:R,decrementLabel:D}),(0,a.jsxs)("div",{className:n.tkx("relative flex-1 flex items-center overflow-hidden"),children:[oe&&J&&(0,a.jsx)("span",{style:{position:"absolute",left:K.px,fontSize:K.fontSize,color:I.textMuted,pointerEvents:"none",userSelect:"none"},children:J}),(0,a.jsx)("input",{id:W,type:"text",inputMode:"decimal",value:P?V:ne,readOnly:S,disabled:k,"aria-invalid":Y,"aria-describedby":X,"aria-valuemin":s,"aria-valuemax":d,"aria-valuenow":j,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:K.fontSize,fontFamily:"inherit",color:I.text,paddingLeft:oe&&J?`calc(${K.px} + 1.2em)`:K.px,paddingRight:oe&&Q?`calc(${K.px} + 1.2em)`:K.px,cursor:k?"not-allowed":S?"default":"text"},onFocus:()=>{O(!0),U(String(j))},onBlur:()=>{O(!1);const e=parseFloat(V);if(isNaN(e))return i?.(null),void U(String(j));let t=Kt(e,u);x&&(t=Ut(t,s,d)),ee(t)},onChange:e=>{U(e.target.value)},onKeyDown:e=>{"ArrowUp"===e.key&&(e.preventDefault(),te(1)),"ArrowDown"===e.key&&(e.preventDefault(),te(-1))},onWheel:e=>{b&&P&&(e.preventDefault(),te(e.deltaY<0?1:-1))}}),oe&&Q&&(0,a.jsx)("span",{style:{position:"absolute",right:K.px,fontSize:K.fontSize,color:I.textMuted,pointerEvents:"none",userSelect:"none"},children:Q})]}),(0,a.jsx)(Yt,{direction:"inc",isDisabled:k||S,btnW:K.btnW,height:K.height,primaryColor:I.primary,borderColor:I.border,textMuted:I.textMuted,iconSz:K.iconSz,onStep:te,incrementLabel:R,decrementLabel:D})]}),_&&!Z&&(0,a.jsx)("span",{id:A,className:n.tkx("text-xs"),style:{color:I.textMuted},children:_}),Z&&(0,a.jsxs)("span",{id:B,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:I.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),Z]})]})}qt.displayName="TkxNumberInput";var Xt={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},Gt={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function _t(e,t){return Gt[t].test(e)?e.toUpperCase():""}function Zt({length:e=6,value:o,onChange:i,onComplete:s,type:d="number",mask:c=!1,autoFocus:u=!1,isDisabled:p=!1,isInvalid:h=!1,errorMessage:f,hint:m,size:g="md",separator:x,separatorPosition:b,webOTP:y=!0,className:v,style:w}){const k=t.useTheme(),S=r.useLocale(),C=(0,l.useId)(),$=`${C}-hint`,z=`${C}-error`,M=void 0!==o,N=t=>{const n=t.split("").slice(0,e);for(;n.length<e;)n.push("");return n},[I,L]=(0,l.useState)(()=>N(M?o:"")),R=M?N(o):I,D=(0,l.useRef)([]),T=Xt[g],W=h||!!f,A=R.every(e=>""!==e),B=m?n.sanitizeString(m):void 0,E=f?n.sanitizeString(f):void 0,H=e=>W?k.danger:A?k.success:k.border;(0,l.useEffect)(()=>{u&&D.current[0]?.focus()},[]);const F=(0,l.useCallback)(e=>{M||L(e);const t=e.join("");i?.(t),e.every(e=>""!==e)&&s?.(t)},[M,i,s]);(0,l.useEffect)(()=>{if(!y||p)return;if("undefined"==typeof window||!("OTPCredential"in window))return;const t=new AbortController;return navigator.credentials?.get({otp:{transport:["sms"]},signal:t.signal}).then(t=>{if(!t?.code)return;const n=String(t.code).slice(0,e).split("").map(e=>_t(e,d));for(;n.length<e;)n.push("");F(n)}).catch(()=>{}),()=>t.abort()},[y,p,e,d]);const j=t=>{const n=Math.max(0,Math.min(e-1,t));D.current[n]?.focus()},P=t=>n=>{if(!p){if("Backspace"!==n.key){if("Delete"===n.key){n.preventDefault();const e=[...R];return e[t]="",void F(e)}return"ArrowLeft"===n.key?(n.preventDefault(),void j(t-1)):"ArrowRight"===n.key?(n.preventDefault(),void j(t+1)):"Home"===n.key?(n.preventDefault(),void j(0)):"End"===n.key?(n.preventDefault(),void j(e-1)):void 0}if(n.preventDefault(),""!==R[t]){const e=[...R];e[t]="",F(e)}else if(t>0){const e=[...R];e[t-1]="",F(e),j(t-1)}}},O=t=>n=>{if(p)return;const o=n.target.value.slice(-1);if(!o)return;const r=_t(o,d);if(!r)return;const i=[...R];i[t]=r,F(i),t<e-1&&j(t+1)},V=t=>n=>{if(n.preventDefault(),p)return;const o=n.clipboardData.getData("text").split("").map(e=>_t(e,d)).filter(Boolean);if(!o.length)return;const r=[...R];let i=t;for(const t of o){if(i>=e)break;r[i]=t,i++}F(r),j(Math.min(i,e-1))},U=[B&&$,W&&z].filter(Boolean).join(" ")||void 0;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-2 w-fit"),v),style:w,children:[(0,a.jsx)("div",{role:"group","aria-label":S.oneTimePassword??"One-time password","aria-describedby":U,className:n.tkx("flex items-center"),style:{gap:T.gap},children:Array.from({length:e},(t,o)=>{const r=H();return"undefined"!=typeof document&&(document.activeElement,D.current[o]),(0,a.jsxs)("div",{className:n.tkx("flex items-center"),style:{gap:T.gap},children:[x&&b===o&&0!==o&&(0,a.jsx)("span",{"aria-hidden":"true",style:{color:k.textMuted,userSelect:"none",flexShrink:0},children:x}),(0,a.jsx)("input",{ref:e=>{D.current[o]=e},type:c?"password":"text",inputMode:"number"===d?"numeric":"text",maxLength:1,value:R[o],disabled:p,"aria-label":`Digit ${o+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:O(o),onKeyDown:P(o),onPaste:V(o),onFocus:e=>e.target.select(),style:{width:T.box,height:T.box,textAlign:"center",fontSize:T.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${r}`,borderRadius:"8px",backgroundColor:p?k.surfaceAlt:k.surface,color:k.text,outline:"none",boxShadow:"none",cursor:p?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:p?.6:1},onFocusCapture:e=>{p||(e.currentTarget.style.borderColor=W?k.danger:k.primary,e.currentTarget.style.boxShadow=`0 0 0 3px ${W?k.danger:k.primary}33`)},onBlurCapture:e=>{e.currentTarget.style.borderColor=H(),e.currentTarget.style.boxShadow="none"}})]},o)})}),B&&!E&&(0,a.jsx)("span",{id:$,className:n.tkx("text-xs"),style:{color:k.textMuted},children:B}),E&&(0,a.jsxs)("span",{id:z,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:k.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),E]})]})}function Jt(e,t){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),o=t.toLowerCase(),r=o.indexOf(n);if(-1!==r)return{matched:!0,ranges:[[r,r+n.length-1]],score:0===r?100:80};const i=[];let l=0,a=-1,s=-1;for(let d=0;d<o.length&&l<n.length;d++)o[d]===n[l]&&(-1!==s&&d===s+1||(-1!==a&&i.push([a,s]),a=d),s=d,l++);return-1!==a&&-1!==s&&i.push([a,s]),l<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:i,score:40}}function Qt({text:e,ranges:t,color:n}){if(!t.length)return(0,a.jsx)(a.Fragment,{children:e});const o=[];let r=0;for(const[i,l]of t)r<i&&o.push((0,a.jsx)("span",{children:e.slice(r,i)},`t-${r}`)),o.push((0,a.jsx)("span",{style:{color:n,fontWeight:700},children:e.slice(i,l+1)},`h-${i}`)),r=l+1;return r<e.length&&o.push((0,a.jsx)("span",{children:e.slice(r)},"t-end")),(0,a.jsx)(a.Fragment,{children:o})}function en({surface:e,border:t}){return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[(0,a.jsx)("div",{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite",flexShrink:0}}),(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[(0,a.jsx)("div",{style:{height:13,borderRadius:4,width:"60%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite"}}),(0,a.jsx)("div",{style:{height:10,borderRadius:4,width:"40%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out 0.2s infinite"}})]})]})}function tn({items:e,isOpen:o=!1,onClose:i,placeholder:d,emptyMessage:c,maxItems:u=8,onItemSelect:p,className:h,style:f}){const m=t.useTheme(),g=r.useLocale(),x=d??g.commandSearch??"Type a command or search…",[b,y]=(0,l.useState)(""),[v,w]=(0,l.useState)(0),[k,S]=(0,l.useState)(!1),C=(0,l.useRef)(null),$=(0,l.useRef)(null),z=(0,l.useId)(),M=function(e){const t=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!e||!t.current)return;const n=t.current,o=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),r=o[0],i=o[o.length-1],l=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(e.preventDefault(),i?.focus()):document.activeElement===i&&(e.preventDefault(),r?.focus()))};return n.addEventListener("keydown",l),()=>n.removeEventListener("keydown",l)},[e]),t}(o),N=function(e,t){if(!e.trim())return t.filter(e=>!e.disabled).map(e=>({item:e,score:0,labelRanges:[]}));const n=[];for(const o of t){if(o.disabled)continue;const t=Jt(e,o.label),r=o.description?Jt(e,o.description):{matched:!1,score:0},i=(o.keywords??[]).some(t=>Jt(e,t).matched);t.matched?n.push({item:o,score:t.score+20,labelRanges:t.ranges}):r.matched?n.push({item:o,score:r.score,labelRanges:[]}):i&&n.push({item:o,score:20,labelRanges:[]})}return n.sort((e,t)=>t.score-e.score)}(b,e).slice(0,u),I=[];for(const t of N){const e=t.item.group,n=I.find(t=>t.group===e);n?n.items.push(t):I.push({group:e,items:[t]})}const L=I.flatMap(e=>e.items);var R,D;R=()=>{i?.()},D=o,(0,l.useEffect)(()=>{if(!D)return;const e=e=>{"Escape"===e.key&&R()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[R,D]),(0,l.useEffect)(()=>{o&&(y(""),w(0),setTimeout(()=>C.current?.focus(),30))},[o]),(0,l.useEffect)(()=>{v>=L.length&&w(Math.max(0,L.length-1))},[L.length,v]);const T=(0,l.useCallback)(e=>{const t=$.current;t&&t.querySelectorAll("[data-command-item]")[e]?.scrollIntoView({block:"nearest"})},[]),W=e=>{e.disabled||(e.onSelect?.(),p?.(e),i?.())};if(!o||"undefined"==typeof document)return null;const A=n.sanitizeString(x),B=g.noCommandsFound??`No results for "${n.sanitizeString(b)}"`,E=c?n.sanitizeString(c):B;if("undefined"!=typeof document&&!document.getElementById("tkx-shimmer-style")){const e=document.createElement("style");e.id="tkx-shimmer-style",e.textContent="@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }",document.head.appendChild(e)}return(0,s.createPortal)((0,a.jsxs)("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[(0,a.jsx)("div",{"aria-hidden":"true",onClick:i,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",animation:"tkx-fade-in 120ms ease"}}),(0,a.jsxs)("div",{ref:M,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:z,className:n.cx(h),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${m.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...f},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 16px",borderBottom:`1px solid ${m.border}`},children:[(0,a.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:m.textMuted,strokeWidth:2,"aria-hidden":"true",style:{flexShrink:0},children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,a.jsx)("input",{ref:C,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${z}-list`,"aria-activedescendant":L[v]?`${z}-item-${L[v].item.id}`:void 0,value:b,onChange:e=>{y(e.target.value),w(0)},onKeyDown:e=>{if("ArrowDown"===e.key){e.preventDefault();const t=Math.min(L.length-1,v+1);w(t),T(t)}else if("ArrowUp"===e.key){e.preventDefault();const t=Math.max(0,v-1);w(t),T(t)}else if("Enter"===e.key){e.preventDefault();const t=L[v];t&&W(t.item)}},placeholder:A,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:m.text}}),b&&(0,a.jsx)("button",{type:"button","aria-label":g.clearSelection,onClick:()=>{y(""),w(0),C.current?.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:m.textMuted,display:"flex",alignItems:"center",padding:0},children:(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,a.jsx)("div",{id:`${z}-list`,ref:$,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:k?Array.from({length:4},(e,t)=>(0,a.jsx)(en,{surface:m.surface,border:m.border},t)):0===L.length?(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:m.textMuted},children:[(0,a.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,a.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]}),(0,a.jsx)("span",{style:{fontSize:"0.875rem"},children:E})]}):I.map(({group:e,items:t},o)=>{const r=I.slice(0,o).reduce((e,t)=>e+t.items.length,0);return(0,a.jsxs)("div",{children:[e&&(0,a.jsx)("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:m.textMuted,padding:"10px 12px 4px"},children:n.sanitizeString(e)}),t.map((e,t)=>{const o=r+t,i=o===v,l=e.item;return(0,a.jsxs)("div",{id:`${z}-item-${l.id}`,role:"option","aria-selected":i,"aria-disabled":l.disabled,"data-command-item":!0,onClick:()=>W(l),onMouseEnter:()=>w(o),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:l.disabled?"not-allowed":"pointer",opacity:l.disabled?.45:1,backgroundColor:i?`${m.primary}18`:"transparent",borderLeft:i?`2px solid ${m.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[l.icon&&(0,a.jsx)("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:i?m.primary:m.textMuted},children:l.icon}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontSize:"0.875rem",fontWeight:500,color:m.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,a.jsx)(Qt,{text:l.label,ranges:e.labelRanges,color:m.primary})}),l.description&&(0,a.jsx)("div",{style:{fontSize:"0.75rem",color:m.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.sanitizeString(l.description)})]}),l.shortcut&&(0,a.jsx)("span",{style:{flexShrink:0,fontSize:"0.6875rem",fontWeight:500,color:m.textMuted,backgroundColor:m.surfaceAlt,border:`1px solid ${m.border}`,borderRadius:6,padding:"2px 6px",fontFamily:"monospace",letterSpacing:"0.04em"},children:n.sanitizeString(l.shortcut)})]},l.id)})]},e??"__default__")})}),L.length>0&&(0,a.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderTop:`1px solid ${m.border}`,fontSize:"0.6875rem",color:m.textMuted},children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),(0,a.jsxs)("span",{children:[(0,a.jsx)("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),(0,a.jsxs)("span",{children:[(0,a.jsx)("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}function nn({direction:e,onClick:t,isDisabled:n,primaryColor:o,position:r,orientation:i}){const l="vertical"===i,s="prev"===e,d="inside"===r?{position:"absolute",zIndex:3,...l?{[s?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[s?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};return(0,a.jsx)("button",{type:"button","aria-label":s?"Previous slide":"Next slide",disabled:n,onClick:t,style:{...d,width:36,height:36,borderRadius:"50%",border:"none",backgroundColor:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:n?"not-allowed":"pointer",opacity:n?.35:1,transition:"background 150ms ease, opacity 150ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${o}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},onMouseEnter:e=>{n||(e.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:l?s?(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"18 15 12 9 6 15"})}):(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})}):s?(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"15 18 9 12 15 6"})}):(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"9 18 15 12 9 6"})})})}function on({slides:e,autoPlay:r=!1,autoPlayInterval:i=4e3,pauseOnHover:s=!0,loop:d=!0,showArrows:c=!0,showDots:u=!0,showThumbnails:p=!1,orientation:h="horizontal",slidesToShow:f=1,gap:m=0,transitionDuration:g=400,swipeable:x=!0,initialIndex:b=0,onChange:y,arrowPosition:v="inside",height:w=320,className:k,style:S}){const C=t.useTheme(),$=o.useReducedMotion(),z=(0,l.useId)(),M=e.length,[N,I]=(0,l.useState)(b),[L,R]=(0,l.useState)(d?b+1:b),[D,T]=(0,l.useState)(!1),[W,A]=(0,l.useState)(!1),B=(0,l.useRef)(null),E=(0,l.useRef)(null),H=(0,l.useRef)(null),F=(0,l.useRef)(0),j=(0,l.useRef)(!1),P="vertical"===h,O=$?0:g,V=d&&M>1?[e[M-1],...e,e[0]]:e,U=V.length,K=100/f,Y=(e,t=0)=>{const n=0!==t?` - ${t}px`:"";return P?`translateY(calc(-${e*K}%${n}))`:`translateX(calc(-${e*K}%${n}))`},q=(0,l.useCallback)((e,t=!1)=>{const n=d?(e%M+M)%M:Math.max(0,Math.min(M-1,e)),o=d?n+1:n;t&&B.current?(B.current.style.transition="none",R(o),I(n),B.current.offsetHeight,B.current.style.transition=""):(T(!0),R(o),I(n)),y?.(n)},[M,d,y]),X=(0,l.useCallback)(()=>q(N-1),[N,q]),G=(0,l.useCallback)(()=>q(N+1),[N,q]),_=(0,l.useCallback)(()=>{T(!1),!d||M<=1||(0===L?q(M-1,!0):L===U-1&&q(0,!0))},[d,M,L,U,q]);(0,l.useEffect)(()=>{if(!(!r||W||M<=1))return E.current=setInterval(G,i),()=>{E.current&&clearInterval(E.current)}},[r,W,i,G,M]),(0,l.useEffect)(()=>{const e=e=>{const t=document.activeElement;document.getElementById(z)?.contains(t)&&(e.key===(P?"ArrowUp":"ArrowLeft")&&(e.preventDefault(),X()),e.key===(P?"ArrowDown":"ArrowRight")&&(e.preventDefault(),G()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[z,P,X,G]);const Z=e=>"touches"in e?P?e.touches[0].clientY:e.touches[0].clientX:P?e.clientY:e.clientX,J=e=>{x&&(H.current=Z(e),F.current=0,j.current=!0)},Q=e=>{if(!j.current||null===H.current)return;const t=Z(e)-H.current;F.current=t,B.current&&(B.current.style.transition="none",B.current.style.transform=Y(L,-t))},ee=()=>{if(!j.current)return;j.current=!1;const e=F.current;B.current&&(B.current.style.transition="",B.current.style.transform=""),e<-50?G():e>50?X():B.current&&(B.current.style.transform=Y(L)),H.current=null,F.current=0},te="number"==typeof w?`${w}px`:w,ne={display:"flex",flexDirection:P?"column":"row",width:P?"100%":U/f*100+"%",height:P?U/f*100+"%":"100%",transform:Y(L),transition:D||!$?`transform ${O}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:m>0?m:void 0},oe={flexShrink:0,width:P?"100%":K/(U/f)+"%",height:P?K/(U/f)+"%":"100%",overflow:"hidden",position:"relative"},re=d||N>0,ie=d||N<M-1,le="outside"===v;return(0,a.jsxs)("div",{id:z,className:n.cx(n.tkx("flex flex-col gap-2"),k),style:S,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2"),style:{gap:le&&c?8:0},children:[c&&le&&(0,a.jsx)(nn,{direction:"prev",onClick:X,isDisabled:!re,primaryColor:C.primary,position:"outside",orientation:h}),(0,a.jsxs)("div",{style:{position:"relative",flex:1,overflow:"hidden",height:te,borderRadius:12,cursor:x?j.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>s&&A(!0),onMouseLeave:()=>{A(!1),ee()},onTouchStart:J,onTouchMove:Q,onTouchEnd:ee,onMouseDown:J,onMouseMove:Q,onMouseUp:ee,"aria-live":"polite","aria-atomic":"false",children:[c&&!le&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(nn,{direction:"prev",onClick:X,isDisabled:!re,primaryColor:C.primary,position:"inside",orientation:h}),(0,a.jsx)(nn,{direction:"next",onClick:G,isDisabled:!ie,primaryColor:C.primary,position:"inside",orientation:h})]}),(0,a.jsx)("div",{ref:B,style:ne,onTransitionEnd:_,children:V.map((e,t)=>(0,a.jsx)("div",{style:oe,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(t-(d?1:0)+M)%M+1} of ${M}`,"aria-hidden":(t-(d?1:0)+M)%M!==N,children:e.content},`${e.id}-${t}`))}),u&&!p&&(0,a.jsx)("div",{"aria-label":"Slide indicators",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:2},children:e.map((e,t)=>(0,a.jsx)("button",{type:"button","aria-label":`Go to slide ${t+1}`,"aria-current":t===N?"true":void 0,onClick:()=>q(t),style:{width:t===N?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:t===N?C.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${C.primary}66`},onBlur:e=>{e.currentTarget.style.boxShadow="none"}},e.id))})]}),c&&le&&(0,a.jsx)(nn,{direction:"next",onClick:G,isDisabled:!ie,primaryColor:C.primary,position:"outside",orientation:h})]}),p&&(0,a.jsx)("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:e.map((e,t)=>(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":t===N,"aria-label":`Thumbnail for slide ${t+1}`,onClick:()=>q(t),style:{flexShrink:0,width:60,height:42,border:`2px solid ${t===N?C.primary:C.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:C.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${C.primary}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},children:[e.thumbnail?(0,a.jsx)("img",{src:e.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):(0,a.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:C.textMuted,fontWeight:600},children:t+1}),t===N&&(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${C.primary}22`}})]},e.id))})]})}function rn({color:e}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M6 3l5 5-5 5",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ln({onClick:e,bgColor:t,hoverColor:o,textColor:r,label:i}){return(0,a.jsx)("button",{type:"button",onClick:e,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},"aria-label":i,className:n.tkx("inline-flex items-center justify-center rounded px-1.5 py-0.5","text-sm font-medium cursor-pointer border-none outline-none","focus-visible:ring-2 focus-visible:ring-offset-1"),style:{backgroundColor:t,color:r,transition:"background-color 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=o},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t},children:"…"})}function an(e,t){if(!t)return!0;const n=t.toLowerCase(),o=e.label.toLowerCase();let r=0;for(let i=0;i<o.length&&r<n.length;i++)o[i]===n[r]&&r++;return r===n.length}function sn({color:e}){return(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{animation:"spin 0.8s linear infinite",flexShrink:0},children:[(0,a.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"2",opacity:"0.3"}),(0,a.jsx)("path",{d:"M14 8a6 6 0 00-6-6",stroke:e,strokeWidth:"2",strokeLinecap:"round"})]})}function dn({expanded:e,color:t,reducedMotion:n}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:n?"none":"transform 150ms ease",flexShrink:0},children:(0,a.jsx)("path",{d:"M6 3l5 5-5 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function cn({checked:e,color:t,borderColor:o}){return(0,a.jsx)("span",{role:"presentation","aria-hidden":"true",className:n.tkx("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:o}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,a.jsx)("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}Zt.displayName="TkxOTP",tn.displayName="TkxCommand",on.displayName="TkxCarousel";var un={sm:{buttonPx:6,buttonPy:4,fontSize:12,iconSize:14,gap:2,separatorSize:16},md:{buttonPx:8,buttonPy:6,fontSize:13,iconSize:16,gap:4,separatorSize:20},lg:{buttonPx:12,buttonPy:8,fontSize:14,iconSize:18,gap:6,separatorSize:24}};function pn({color:e}){return(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"6",cy:"6",r:"4.5",stroke:e,strokeWidth:"1.5"}),(0,a.jsx)("path",{d:"M9.5 9.5L13 13",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"})]})}function hn({checked:e,primaryColor:t,borderColor:o}){return(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:o}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,a.jsx)("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function fn({color:e}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M3 8h10M9 4l4 4-4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function mn({color:e}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M13 8H3M7 4l-4 4 4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function gn({title:e,items:r,selected:i,onToggle:s,onToggleAll:d,search:c,onSearchChange:u,searchable:p,height:h,listId:f}){const m=t.useTheme(),g=o.useReducedMotion(),x=n.sanitizeString(e),b=(0,l.useMemo)(()=>{if(!c)return r;const e=c.toLowerCase();return r.filter(t=>t.label.toLowerCase().includes(e))},[r,c]),y=b.filter(e=>!e.disabled),v=y.length>0&&y.every(e=>i.has(e.value));return y.some(e=>i.has(e.value)),(0,a.jsxs)("div",{className:n.tkx("flex flex-col rounded-lg overflow-hidden flex-1 min-w-0"),style:{border:`1px solid ${m.border}`,backgroundColor:m.surface},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2 px-3 py-2 border-b"),style:{borderColor:m.border,backgroundColor:m.surfaceAlt},children:[(0,a.jsx)("button",{type:"button","aria-label":v?`Deselect all ${x}`:`Select all ${x}`,onClick:d,className:n.tkx("border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2"),children:(0,a.jsx)(hn,{checked:v,primaryColor:m.primary,borderColor:m.border})}),(0,a.jsx)("span",{className:n.tkx("text-sm font-medium flex-1 truncate"),style:{color:m.text},children:x}),(0,a.jsxs)("span",{className:n.tkx("text-xs"),style:{color:m.textMuted},children:[i.size,"/",r.length]})]}),p&&(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1.5 px-3 py-1.5 border-b"),style:{borderColor:m.border},children:[(0,a.jsx)(pn,{color:m.textMuted}),(0,a.jsx)("input",{type:"text","aria-label":`Search ${x}`,value:c,onChange:e=>u(e.target.value),placeholder:"Search...",className:n.tkx("flex-1 bg-transparent border-none outline-none text-xs"),style:{color:m.text}})]}),(0,a.jsx)("ul",{id:f,role:"listbox","aria-label":x,"aria-multiselectable":"true",className:n.tkx("list-none m-0 p-1 overflow-y-auto"),style:{height:h,minHeight:100},children:0===b.length?(0,a.jsx)("li",{className:n.tkx("text-xs text-center py-4"),style:{color:m.textMuted},"aria-disabled":"true",children:"No items"}):b.map(e=>{const t=i.has(e.value),o=n.sanitizeString(e.label);return(0,a.jsxs)("li",{role:"option","aria-selected":t,"aria-disabled":e.disabled||void 0,tabIndex:0,onClick:()=>!e.disabled&&s(e.value),onKeyDown:t=>!e.disabled&&((e,t)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s(t))})(t,e.value),className:n.tkx("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",e.disabled?"opacity-50 cursor-not-allowed":""),style:{color:e.disabled?m.textMuted:m.text,backgroundColor:t?`${m.primary}10`:"transparent",transition:g?"none":"background-color 100ms ease"},onMouseEnter:n=>{e.disabled||t||(n.currentTarget.style.backgroundColor=m.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t?`${m.primary}10`:"transparent"},children:[(0,a.jsx)(hn,{checked:t,primaryColor:m.primary,borderColor:m.border}),(0,a.jsx)("span",{className:n.tkx("truncate"),children:o})]},e.value)})})]})}function xn({color:e,rotated:t,reducedMotion:n}){return(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{transform:t?"rotate(45deg)":"rotate(0deg)",transition:n?"none":"transform 200ms ease"},children:(0,a.jsx)("path",{d:"M12 5v14M5 12h14",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"})})}var bn={"bottom-right":{bottom:24,right:24},"bottom-left":{bottom:24,left:24},"top-right":{top:24,right:24},"top-left":{top:24,left:24}};function yn({open:e}){return(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",children:e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,a.jsx)("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),(0,a.jsx)("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}var vn=!1,wn=!1,kn={success:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),error:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),warning:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})},Sn={"bottom-left":{bottom:24,left:24},"bottom-center":{bottom:24,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:24,right:24},"top-center":{top:24,left:"50%",transform:"translateX(-50%)"}};function Cn({direction:e}){return(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:n.tkx("shrink-0 ml-1"),children:"asc"===e?(0,a.jsx)("path",{d:"M7 14l5-5 5 5H7z"}):"desc"===e?(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7z"}):(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.35"})})}function $n({checked:e,indeterminate:n}){const o=t.useTheme();return(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||n?o.primary:"transparent",stroke:e||n?o.primary:o.border,strokeWidth:"1.5"}),n&&(0,a.jsx)("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:o.bg,strokeWidth:"2"}),e&&!n&&(0,a.jsx)("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:o.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function zn(e,t){return"function"==typeof t?t(e):String(e[t])}function Mn(e,t){return e[t]}function Nn(e){const t=String(e??"");return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t}function In({colCount:e}){const o=t.useTheme();return(0,a.jsx)("tbody",{children:Array.from({length:5},(t,r)=>(0,a.jsx)("tr",{children:Array.from({length:e},(e,t)=>(0,a.jsx)("td",{className:n.tkx("px-3 py-2"),style:{borderBottom:`1px solid ${o.border}`},children:(0,a.jsx)(W,{height:16})},t))},r))})}function Ln({label:e,showExport:t,onExport:n,totalRows:o,selectedCount:r,theme:i}){return t||0!==r?(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8},children:[(0,a.jsx)("span",{style:{fontSize:13,color:i.textMuted},children:r>0?`${r} of ${o} row${1!==o?"s":""} selected`:`${o} row${1!==o?"s":""}`}),t&&(0,a.jsxs)("button",{onClick:n,"aria-label":`Export ${e} as CSV`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 12px",fontSize:13,fontWeight:500,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer"},children:[(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,a.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Export CSV"]})]}):null}function Rn({page:e,totalPages:t,pageSize:n,totalRows:o,onPageChange:r,theme:i}){const l=(e-1)*n+1,s=Math.min(e*n,o),d={display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer",fontSize:13,fontWeight:500};return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderTop:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8,flexWrap:"wrap"},role:"navigation","aria-label":"Pagination",children:[(0,a.jsx)("span",{style:{fontSize:13,color:i.textMuted},children:0===o?"0 rows":`${l}–${s} of ${o}`}),(0,a.jsxs)("div",{style:{display:"flex",gap:4},children:[(0,a.jsx)("button",{onClick:()=>r(1),disabled:1===e,"aria-label":"First page",style:{...d,opacity:1===e?.4:1},children:"«"}),(0,a.jsx)("button",{onClick:()=>r(e-1),disabled:1===e,"aria-label":"Previous page",style:{...d,opacity:1===e?.4:1},children:"‹"}),Array.from({length:Math.min(5,t)},(n,o)=>{let l=o+1;return t>5&&(l=Math.max(1,Math.min(e-Math.floor(2.5),t-4))+o),(0,a.jsx)("button",{onClick:()=>r(l),"aria-label":`Page ${l}`,"aria-current":l===e?"page":void 0,style:{...d,backgroundColor:l===e?i.primary:"transparent",color:l===e?i.bg:i.text,borderColor:l===e?i.primary:i.border},children:l},l)}),(0,a.jsx)("button",{onClick:()=>r(e+1),disabled:e===t,"aria-label":"Next page",style:{...d,opacity:e===t?.4:1},children:"›"}),(0,a.jsx)("button",{onClick:()=>r(t),disabled:e===t,"aria-label":"Last page",style:{...d,opacity:e===t?.4:1},children:"»"})]})]})}var Dn=!1,Tn={info:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),warning:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),success:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),danger:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})})},Wn={1:{fontSize:"1.75rem",fontWeight:700,lineHeight:1.25,marginTop:24,marginBottom:12},2:{fontSize:"1.375rem",fontWeight:600,lineHeight:1.3,marginTop:20,marginBottom:10},3:{fontSize:"1.1rem",fontWeight:600,lineHeight:1.35,marginTop:16,marginBottom:8}},An={heading:function({block:e}){const o=t.useTheme(),r=e.level??1,i=`h${r}`,l=n.sanitizeString(e.content??"");return(0,a.jsx)(i,{className:n.tkx("m-0"),style:{...Wn[r],color:o.text},children:l})},paragraph:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.content??"");return(0,a.jsx)("p",{className:n.tkx("m-0"),style:{fontSize:"0.938rem",lineHeight:1.7,color:o.text,marginBottom:12},children:r})},blockquote:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.content??"");return(0,a.jsx)("blockquote",{className:n.tkx("m-0"),style:{borderLeft:`3px solid ${o.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${o.surfaceAlt}`,borderRadius:"0 6px 6px 0",color:o.textMuted,fontStyle:"italic",fontSize:"0.938rem",lineHeight:1.6},children:r})},code:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.content??""),i=e.language?n.sanitizeString(e.language):null;return(0,a.jsxs)("div",{className:n.tkx("rounded-lg overflow-hidden"),style:{marginTop:12,marginBottom:12,border:`1px solid ${o.border}`,backgroundColor:o.surfaceAlt},children:[i&&(0,a.jsx)("div",{className:n.tkx("px-3 py-1 text-[11px] font-semibold uppercase tracking-wider"),style:{color:o.textMuted,borderBottom:`1px solid ${o.border}`,backgroundColor:o.surface},children:i}),(0,a.jsx)("pre",{className:n.tkx("m-0 p-4 overflow-x-auto"),style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",fontSize:"0.85rem",lineHeight:1.6,color:o.text,tabSize:2},children:(0,a.jsx)("code",{"aria-label":i?`Code block in ${i}`:"Code block",children:r})})]})},list:function({block:e}){const o=t.useTheme(),r=e.ordered?"ol":"ul",i=(e.items??[]).map(e=>n.sanitizeString(e));return(0,a.jsx)(r,{className:n.tkx("m-0"),style:{paddingLeft:24,marginTop:8,marginBottom:12,color:o.text,fontSize:"0.938rem",lineHeight:1.7,listStyleType:e.ordered?"decimal":"disc"},role:"list",children:i.map((e,t)=>(0,a.jsx)("li",{role:"listitem",style:{marginBottom:4},children:e},t))})},divider:function(){return(0,a.jsx)("hr",{"aria-hidden":"true",style:{border:"none",borderTop:`1px solid ${t.useTheme().border}`,marginTop:20,marginBottom:20}})},image:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.src??""),i=n.sanitizeString(e.alt??"Image");return(0,a.jsxs)("figure",{className:n.tkx("m-0"),style:{marginTop:12,marginBottom:12},children:[(0,a.jsx)("img",{src:r,alt:i,loading:"lazy",className:n.tkx("rounded-lg"),style:{maxWidth:"100%",height:"auto",display:"block",border:`1px solid ${o.border}`}}),e.alt&&(0,a.jsx)("figcaption",{className:n.tkx("text-xs mt-2 text-center"),style:{color:o.textMuted},children:i})]})},callout:function({block:e}){const o=t.useTheme(),r=e.variant??"info",i=n.sanitizeString(e.content??""),l={info:o.info,warning:o.warning,success:o.success,danger:o.danger}[r],s=Tn[r];return(0,a.jsxs)("div",{role:{info:"note",warning:"alert",success:"status",danger:"alert"}[r],className:n.tkx("flex gap-3 px-4 py-3 rounded-lg"),style:{backgroundColor:`${l}12`,border:`1px solid ${l}33`,marginTop:12,marginBottom:12},children:[(0,a.jsx)("span",{className:n.tkx("shrink-0 mt-[2px]"),style:{color:l},children:s}),(0,a.jsx)("div",{className:n.tkx("flex-1"),style:{fontSize:"0.9rem",lineHeight:1.6,color:o.text},children:i})]})}};function Bn(e){const t=[];let n=0,o="";const r=()=>{o&&(t.push({kind:"text",value:o}),o="")};for(;n<e.length;){const i=e[n];if("\\"===i&&n+1<e.length)o+=e[n+1],n+=2;else{if("!"===i&&"["===e[n+1]){const o=e.indexOf("]",n+2);if(-1!==o&&"("===e[o+1]){const i=e.indexOf(")",o+2);if(-1!==i){r(),t.push({kind:"image",alt:e.slice(n+2,o),src:e.slice(o+2,i)}),n=i+1;continue}}}if("["===i){const o=En(e,n,"[","]");if(-1!==o&&"("===e[o+1]){const i=e.indexOf(")",o+2);if(-1!==i){r(),t.push({kind:"link",href:e.slice(o+2,i).trim(),children:Bn(e.slice(n+1,o))}),n=i+1;continue}}}if("<"===i){const o=e.indexOf(">",n+1);if(-1!==o){const i=e.slice(n+1,o);if(/^(https?:\/\/|mailto:)/i.test(i)||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)){r();const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)?`mailto:${i}`:i;t.push({kind:"link",href:e,children:[{kind:"text",value:i}]}),n=o+1;continue}}}if("`"===i){const o=e.indexOf("`",n+1);if(-1!==o){r(),t.push({kind:"code",value:e.slice(n+1,o)}),n=o+1;continue}}if("~"===i&&"~"===e[n+1]){const o=e.indexOf("~~",n+2);if(-1!==o){r(),t.push({kind:"strike",children:Bn(e.slice(n+2,o))}),n=o+2;continue}}if("*"===i&&"*"===e[n+1]||"_"===i&&"_"===e[n+1]){const o=i+i,l=e.indexOf(o,n+2);if(-1!==l){r(),t.push({kind:"bold",children:Bn(e.slice(n+2,l))}),n=l+2;continue}}if(("*"===i||"_"===i)&&e[n+1]!==i){const o=e.indexOf(i,n+1);if(-1!==o&&e.slice(n+1,o).trim().length>0){r(),t.push({kind:"italic",children:Bn(e.slice(n+1,o))}),n=o+1;continue}}o+=i,n++}}return r(),t}function En(e,t,n,o){let r=0;for(let i=t;i<e.length;i++)if("\\"!==e[i]){if(e[i]===n)r++;else if(e[i]===o&&(r--,0===r))return i}else i++;return-1}function Hn(e){const t=e.replace(/^\uFEFF/,"").replace(/\r\n?/g,"\n").split("\n"),n=[];let o=0;for(;o<t.length;){const e=t[o];if(/^\s*$/.test(e)){o++;continue}const r=e.match(/^\s*```(.*)$/);if(r){const e=r[1].trim();o++;const i=[];for(;o<t.length&&!/^\s*```\s*$/.test(t[o]);)i.push(t[o]),o++;o<t.length&&o++,n.push({kind:"code",language:e,value:i.join("\n")});continue}const i=e.match(/^(#{1,6})\s+(.*?)\s*#*\s*$/);if(i){n.push({kind:"heading",level:i[1].length,inline:Bn(i[2])}),o++;continue}if(/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(e)){n.push({kind:"hr"}),o++;continue}if(Pn(e)&&o+1<t.length&&On(t[o+1])){const r=Vn(e).map(Bn),i=Un(t[o+1]);o+=2;const l=[];for(;o<t.length&&Pn(t[o]);)l.push(Vn(t[o]).map(Bn)),o++;n.push({kind:"table",headers:r,rows:l,align:i});continue}if(/^\s*>/.test(e)){const e=[];for(;o<t.length&&/^\s*>/.test(t[o]);)e.push(t[o].replace(/^\s*>\s?/,"")),o++;n.push({kind:"blockquote",children:Hn(e.join("\n"))});continue}if(Fn(e)){const[e,r]=jn(t,o);n.push(e),o=r;continue}const l=[e];for(o++;o<t.length&&!/^\s*$/.test(t[o])&&!/^#{1,6}\s/.test(t[o])&&!/^\s*```/.test(t[o])&&!/^\s*>/.test(t[o])&&!Fn(t[o])&&!/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(t[o]);)l.push(t[o]),o++;n.push({kind:"paragraph",inline:Bn(l.join(" "))})}return n}function Fn(e){return/^(\s*)([-*+]|\d+[.)])\s+/.test(e)}function jn(e,t){const n=e[t].match(/^(\s*)([-*+]|\d+[.)])\s+/),o=n[1].length,r=/\d/.test(n[2]),i=[];let l=t;for(;l<e.length;){const t=e[l].match(/^(\s*)([-*+]|\d+[.)])\s+(.*)$/);if(!t||t[1].length!==o)break;const n=t[3];let r=null,a=n;const s=n.match(/^\[([ xX])\]\s+(.*)$/);s&&(r="x"===s[1].toLowerCase()?"checked":"unchecked",a=s[2]);const d=[a];for(l++;l<e.length;){if(/^\s*$/.test(e[l])){if(l+1<e.length&&/^\s+\S/.test(e[l+1])){d.push(""),l++;continue}break}const t=e[l].match(/^(\s*)(\S)/);if(!(t&&t[1].length>o))break;d.push(e[l].slice(o+2)),l++}i.push({blocks:Hn(d.join("\n")),task:r})}return[{kind:"list",ordered:r,items:i},l]}function Pn(e){return/^\s*\|.+\|\s*$/.test(e.trim())||e.includes("|")&&e.trim().startsWith("|")}function On(e){return/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e)}function Vn(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim())}function Un(e){return Vn(e).map(e=>{const t=e.startsWith(":"),n=e.endsWith(":");return t&&n?"center":n?"right":t?"left":null})}function Kn(e,t,o="i"){return e.map((e,r)=>{const i=`${o}-${r}`;switch(e.kind){case"text":return(0,a.jsx)("span",{children:n.sanitizeString(e.value)},i);case"bold":return(0,a.jsx)("strong",{children:Kn(e.children,t,i)},i);case"italic":return(0,a.jsx)("em",{children:Kn(e.children,t,i)},i);case"strike":return(0,a.jsx)("s",{children:Kn(e.children,t,i)},i);case"code":return(0,a.jsx)("code",{style:{background:t.theme.surfaceAlt,border:`1px solid ${t.theme.border}`,borderRadius:4,padding:"0.15em 0.4em",fontSize:"0.9em",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",wordBreak:"break-word"},children:n.sanitizeString(e.value)},i);case"link":{const n=Yn(e.href);if(!n)return(0,a.jsx)("span",{children:Kn(e.children,t,i)},i);const o=/^(https?:)?\/\//i.test(n)||n.startsWith("mailto:");return(0,a.jsx)("a",{href:n,target:o?t.externalLinkTarget:void 0,rel:o?t.externalLinkRel:void 0,onClick:e=>{!1===t.onLinkClick?.(n,e)&&e.preventDefault()},style:{color:t.theme.primary,textDecoration:"underline",wordBreak:"break-word"},children:Kn(e.children,t,i)},i)}case"image":return(0,a.jsx)("img",{src:Yn(e.src)||"",alt:n.sanitizeString(e.alt),loading:"lazy",decoding:"async",style:{maxWidth:"100%",height:"auto",borderRadius:6,display:"inline-block"}},i)}})}function Yn(e){const t=e.trim();return t?/^javascript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)||/^vbscript:/i.test(t)?null:t:null}function qn({text:e,theme:t}){const[n,o]=(0,l.useState)(!1);return(0,a.jsx)("button",{type:"button",onClick:()=>{"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})},"aria-label":n?"Copied to clipboard":"Copy code",style:{position:"absolute",top:6,right:6,padding:"2px 8px",fontSize:11,background:t.surface,color:n?t.success:t.textMuted,border:`1px solid ${t.border}`,borderRadius:4,cursor:"pointer",fontFamily:"inherit",transition:"color 120ms"},children:n?"Copied":"Copy"})}function Xn(e,t,o="b"){return e.map((e,r)=>{const i=`${o}-${r}`;switch(e.kind){case"heading":{const n=`h${e.level}`,o={1:{fs:t.compact?"1.75rem":"2rem",lh:"1.2",mt:"0.6em",mb:"0.5em",fw:700},2:{fs:t.compact?"1.4rem":"1.6rem",lh:"1.25",mt:"1em",mb:"0.5em",fw:700},3:{fs:t.compact?"1.2rem":"1.3rem",lh:"1.3",mt:"1em",mb:"0.4em",fw:600},4:{fs:"1.1rem",lh:"1.35",mt:"1em",mb:"0.4em",fw:600},5:{fs:"1rem",lh:"1.4",mt:"1em",mb:"0.3em",fw:600},6:{fs:"0.9rem",lh:"1.4",mt:"1em",mb:"0.3em",fw:600}}[e.level];return(0,a.jsx)(n,{style:{fontSize:o.fs,lineHeight:o.lh,marginTop:o.mt,marginBottom:o.mb,fontWeight:o.fw,color:t.theme.text,scrollMarginTop:"1em"},children:Kn(e.inline,t,i)},i)}case"paragraph":return(0,a.jsx)("p",{style:{margin:"0 0 "+(t.compact?"0.7em":"1em"),lineHeight:1.65,color:t.theme.text,wordBreak:"break-word"},children:Kn(e.inline,t,i)},i);case"blockquote":return(0,a.jsx)("blockquote",{style:{margin:"0 0 1em",padding:"0.5em 1em",borderLeft:`4px solid ${t.theme.primary}`,background:`${t.theme.surfaceAlt}`,color:t.theme.textMuted,borderRadius:"0 6px 6px 0"},children:Xn(e.children,t,i)},i);case"code":{const o=e.value;return(0,a.jsxs)("div",{style:{position:"relative",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:8,background:t.theme.surfaceAlt,overflow:"hidden"},children:[e.language&&(0,a.jsx)("div",{style:{padding:"4px 10px",fontSize:11,color:t.theme.textMuted,borderBottom:`1px solid ${t.theme.border}`,textTransform:"uppercase",letterSpacing:"0.05em"},children:n.sanitizeString(e.language)}),t.copyableCode&&(0,a.jsx)(qn,{text:o,theme:t.theme}),(0,a.jsx)("pre",{style:{margin:0,padding:12,overflowX:"auto",fontSize:13,lineHeight:1.55,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",color:t.theme.text,whiteSpace:"pre"},children:(0,a.jsx)("code",{children:n.sanitizeString(o)})})]},i)}case"list":return(0,a.jsx)(e.ordered?"ol":"ul",{style:{margin:"0 0 1em",paddingLeft:"1.5em",color:t.theme.text,lineHeight:1.65},children:e.items.map((e,n)=>(0,a.jsxs)("li",{style:{listStyle:null!==e.task?"none":void 0,marginLeft:null!==e.task?"-1.25em":void 0},children:[null!==e.task&&(0,a.jsx)("input",{type:"checkbox",disabled:!0,checked:"checked"===e.task,readOnly:!0,style:{marginRight:6,verticalAlign:"middle"},"aria-label":"checked"===e.task?"Completed task":"Uncompleted task"}),Xn(e.blocks,t,`${i}-${n}`)]},`${i}-${n}`))},i);case"hr":return(0,a.jsx)("hr",{style:{border:"none",borderTop:`1px solid ${t.theme.border}`,margin:"1.5em 0"}},i);case"table":return(0,a.jsx)("div",{style:{overflowX:"auto",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:6,WebkitOverflowScrolling:"touch"},children:(0,a.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14,color:t.theme.text},children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers.map((n,o)=>(0,a.jsx)("th",{style:{padding:"8px 12px",textAlign:e.align[o]??"left",borderBottom:`2px solid ${t.theme.border}`,background:t.theme.surfaceAlt,fontWeight:600},children:Kn(n,t,`${i}-h-${o}`)},o))})}),(0,a.jsx)("tbody",{children:e.rows.map((n,o)=>(0,a.jsx)("tr",{children:n.map((n,r)=>(0,a.jsx)("td",{style:{padding:"8px 12px",textAlign:e.align[r]??"left",borderBottom:`1px solid ${t.theme.border}`},children:Kn(n,t,`${i}-r-${o}-${r}`)},r))},o))})]})},i)}})}function Gn({source:e,src:o,maxWidth:r="100%",compact:i=!1,copyableCode:s=!0,onLinkClick:d,externalLinkRel:c="noopener noreferrer",externalLinkTarget:u="_blank",loadingFallback:p,errorFallback:h,className:f,style:m}){const g=t.useTheme(),[x,b]=(0,l.useState)({text:null,error:null,loading:!!o&&void 0===e}),y=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(void 0!==e||!o)return;y.current?.abort();const t=new AbortController;return y.current=t,b({text:null,error:null,loading:!0}),fetch(o,{signal:t.signal}).then(async e=>{if(!e.ok)throw new Error(`Failed to load markdown (HTTP ${e.status})`);b({text:await e.text(),error:null,loading:!1})}).catch(e=>{"AbortError"!==e.name&&b({text:null,error:e.message,loading:!1})}),()=>t.abort()},[o,e]);const v=e??x.text??"",w=(0,l.useMemo)(()=>v?Hn(v):[],[v]),k={theme:g,compact:i,copyableCode:s,externalLinkRel:c,externalLinkTarget:u,onLinkClick:d},S={maxWidth:r,width:"100%",color:g.text,fontFamily:"inherit",fontSize:i?14:15,lineHeight:1.65,wordBreak:"break-word",overflowWrap:"anywhere",boxSizing:"border-box",...m};if(void 0===e&&o){if(x.loading)return(0,a.jsx)("div",{className:f,style:S,"aria-busy":"true","aria-live":"polite",children:p??(0,a.jsx)("span",{style:{color:g.textMuted},children:"Loading…"})});if(x.error)return(0,a.jsx)("div",{className:f,style:S,role:"alert",children:h?h(x.error):(0,a.jsx)("span",{style:{color:g.danger},children:n.sanitizeString(x.error)})})}return(0,a.jsx)("div",{className:f,style:S,children:Xn(w,k)})}Gn.displayName="TkxMarkdown";var _n={sm:576,md:768,lg:992,xl:1200};function Zn(e){return"number"==typeof e?`${e}px`:e}var Jn=(0,l.createContext)({h:0,v:0}),Qn=(0,l.forwardRef)(({children:e,hasSider:o=!1,className:r,style:i,...l},s)=>{const d=t.useTheme(),c=n.tkx("flex min-h-0 w-full font-sans"),u=o?{flexDirection:"row"}:{flexDirection:"column"};return(0,a.jsx)("section",{ref:s,className:n.cx("tkx-layout",c,r),style:{minHeight:"100%",color:d.text,backgroundColor:d.bg,...u,...i},...l,children:e})});Qn.displayName="TkxLayout";var eo=(0,l.forwardRef)(({children:e,height:o=64,fixed:r=!1,className:i,style:l,...s},d)=>{const c=t.useTheme(),u=Zn(o),p=n.tkx("flex items-center px-6 shrink-0 w-full"),h=r?{position:"fixed",top:0,left:0,right:0,zIndex:1e3}:{};return(0,a.jsx)("header",{ref:d,className:n.cx("tkx-layout-header",p,i),style:{height:u,minHeight:u,backgroundColor:c.surface,borderBottom:`1px solid ${c.border}`,...h,...l},...s,children:e})});function to({collapsed:e,onClick:t,color:r}){const i=o.useReducedMotion();return(0,a.jsx)("button",{type:"button","aria-label":e?"Expand sidebar":"Collapse sidebar",onClick:t,className:n.tkx("flex items-center justify-center w-full py-3 cursor-pointer","border-0 bg-transparent"),style:{color:r},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{transform:e?"rotate(0deg)":"rotate(180deg)",transition:i?"none":"transform 200ms ease"},"aria-hidden":"true",children:(0,a.jsx)("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}eo.displayName="TkxHeader";var no=(0,l.forwardRef)(({children:e,width:r=240,collapsedWidth:i=64,collapsed:s,onCollapse:d,collapsible:c=!1,breakpoint:u,trigger:p,className:h,style:f,...m},g)=>{const x=t.useTheme(),b=o.useReducedMotion(),[y,v]=(0,l.useState)(!1),w=s??y,k=(0,l.useCallback)(e=>{void 0===s&&v(e),d?.(e)},[s,d]);(0,l.useEffect)(()=>{if(!u)return;const e=_n[u];if(!e)return;const t=window.matchMedia(`(max-width: ${e-1}px)`),n=e=>{k(e.matches)};return k(t.matches),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[u,k]);const S=Zn(r),C=w?`${i}px`:S,$=c&&null!==p,z=b?"none":"width 200ms ease, min-width 200ms ease, max-width 200ms ease";return(0,a.jsxs)("aside",{ref:g,className:n.cx("tkx-layout-sider",n.tkx("shrink-0 overflow-hidden flex flex-col"),h),style:{width:C,minWidth:C,maxWidth:C,backgroundColor:x.surface,borderRight:`1px solid ${x.border}`,transition:z,...f},...m,children:[(0,a.jsx)("div",{className:n.tkx("flex-1 overflow-y-auto overflow-x-hidden"),style:{width:C,transition:z},children:e}),$&&(0,a.jsx)("div",{className:n.tkx("shrink-0"),style:{borderTop:`1px solid ${x.border}`},children:void 0!==p?p:(0,a.jsx)(to,{collapsed:w,onClick:()=>k(!w),color:x.textMuted})})]})});no.displayName="TkxSider";var oo=(0,l.forwardRef)(({children:e,className:o,style:r,...i},l)=>{const s=t.useTheme();return(0,a.jsx)("main",{ref:l,className:n.cx("tkx-layout-content",n.tkx("flex-1 min-w-0 min-h-0"),o),style:{backgroundColor:s.bg,padding:"24px",...r},...i,children:e})});oo.displayName="TkxContent";var ro=(0,l.forwardRef)(({children:e,className:o,style:r,...i},l)=>{const s=t.useTheme();return(0,a.jsx)("footer",{ref:l,className:n.cx("tkx-layout-footer",n.tkx("flex items-center px-6 py-4 shrink-0"),o),style:{backgroundColor:s.surface,borderTop:`1px solid ${s.border}`,color:s.textMuted,...r},...i,children:e})});ro.displayName="TkxFooter";var io={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},lo={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},ao=(0,l.forwardRef)(({children:e,gutter:t,justify:o="start",align:r="top",wrap:i=!0,className:l,style:s,...d},c)=>{const[u,p]=Array.isArray(t)?t:[t??0,0],h=u/2,f=p/2,m=u||p?{marginLeft:-h,marginRight:-h,marginTop:-f,marginBottom:-f}:{},g={h,v:f};return(0,a.jsx)(Jn.Provider,{value:g,children:(0,a.jsx)("div",{ref:c,className:n.cx("tkx-row",n.tkx("flex w-full"),l),style:{flexWrap:i?"wrap":"nowrap",justifyContent:io[o]??"flex-start",alignItems:lo[r]??"flex-start",...m,...s},...d,children:e})})});ao.displayName="TkxRow";var so=!1;function co(e){if(void 0!==e)return"number"==typeof e?{span:e}:e}var uo=(0,l.forwardRef)(({children:e,span:t,offset:o=0,push:r,pull:i,order:s,sm:d,md:c,lg:u,xl:p,className:h,style:f,...m},g)=>{(0,l.useEffect)(()=>{!function(){if(so||"undefined"==typeof document)return;so=!0;const e=[];for(const[n,o]of Object.entries(_n)){for(let t=1;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-${t} { flex: 0 0 ${r} !important; max-width: ${r} !important; } }`)}for(let t=0;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-offset-${t} { margin-left: ${r} !important; } }`)}}const t=document.createElement("style");t.id="tkx-col-responsive",t.textContent=e.join("\n"),document.head.appendChild(t)}()},[]);const x=(0,l.useContext)(Jn),b=void 0!==t?t/24*100+"%":void 0,y=o?o/24*100+"%":void 0,v=[],w=[["sm",d],["md",c],["lg",u],["xl",p]];for(const[n,l]of w){const e=co(l);e&&(v.push(`tkx-col-${n}-${e.span}`),void 0!==e.offset&&e.offset>0&&v.push(`tkx-col-${n}-offset-${e.offset}`))}const k={};return void 0!==r&&(k.left=r/24*100+"%",k.position="relative"),void 0!==i&&(k.right=i/24*100+"%",k.position="relative"),void 0!==s&&(k.order=s),(0,a.jsx)("div",{ref:g,className:n.cx("tkx-col",n.tkx("box-border min-h-[1px]"),...v,h),style:{flex:b?`0 0 ${b}`:"1",maxWidth:b??"100%",marginLeft:y,paddingLeft:x.h||void 0,paddingRight:x.h||void 0,paddingTop:x.v||void 0,paddingBottom:x.v||void 0,...k,...f},...m,children:e})});uo.displayName="TkxCol";var po=(0,l.createContext)({locale:"en-US",direction:"ltr",componentDefaults:{size:"md",variant:"default",animation:!0,bordered:!0},componentOverrides:{},prefixCls:"tkx",configured:!1,cls:e=>`tkx-${e}`,getSize:()=>"md",getAnimation:()=>!0,getBordered:()=>!0});function ho({children:e,locale:t,direction:n,componentDefaults:o,componentOverrides:r,prefixCls:i}){const s=(0,l.useContext)(po),d=(0,l.useMemo)(()=>({size:o?.size??s.componentDefaults.size,variant:o?.variant??s.componentDefaults.variant,animation:o?.animation??s.componentDefaults.animation,bordered:o?.bordered??s.componentDefaults.bordered}),[o,s.componentDefaults]),c=(0,l.useMemo)(()=>{const e=s.componentOverrides,t=r??{};return{button:{...e.button,...t.button},input:{...e.input,...t.input},table:{...e.table,...t.table},modal:{...e.modal,...t.modal}}},[r,s.componentOverrides]),u=t??s.locale,p=n??s.direction,h=i??s.prefixCls,f=(0,l.useCallback)(e=>`${h}-${e}`,[h]),m=(0,l.useCallback)((e,t)=>{if(void 0!==t)return t;if(e){const t=c[e];if(t?.size)return t.size}return d.size},[d.size,c]),g=(0,l.useCallback)(e=>void 0!==e?e:d.animation,[d.animation]),x=(0,l.useCallback)((e,t)=>{if(void 0!==t)return t;if(e){const t=c[e];if(void 0!==t?.bordered)return t.bordered}return d.bordered},[d.bordered,c]),b=(0,l.useMemo)(()=>({locale:u,direction:p,componentDefaults:d,componentOverrides:c,prefixCls:h,configured:!0,cls:f,getSize:m,getAnimation:g,getBordered:x}),[u,p,d,c,h,f,m,g,x]);return(0,a.jsx)(po.Provider,{value:b,children:(0,a.jsx)("div",{dir:p,lang:u,className:`${h}-config-root`,style:{direction:p},children:e})})}function fo(){return(0,l.useContext)(po)}ho.displayName="TkxConfigProvider";var mo={"en-US":"English (US)","en-GB":"English (UK)","es-ES":"Spanish","fr-FR":"French","de-DE":"German","ja-JP":"Japanese","ko-KR":"Korean","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)","pt-BR":"Portuguese (Brazil)","ar-SA":"Arabic","hi-IN":"Hindi","ru-RU":"Russian","it-IT":"Italian","nl-NL":"Dutch","sv-SE":"Swedish","pl-PL":"Polish","tr-TR":"Turkish","th-TH":"Thai","vi-VN":"Vietnamese"},go=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function xo(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(xo).join(""):e&&"object"==typeof e&&"props"in e?xo(e.props.children):""}function bo({text:e}){const n=t.useTheme(),[o,r]=(0,l.useState)(!1);return(0,l.createElement)("button",{type:"button",onClick:(0,l.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})},[e]),"aria-label":o?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:o?n.success:n.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},o?"Copied!":"⎘")}function yo(e="default"){const n=t.useTheme();return{default:n.text,secondary:n.textMuted,success:n.success,warning:n.warning,danger:n.danger}[e]}var vo={1:{fontSize:"2.25rem",lineHeight:"1.2",fontWeight:700},2:{fontSize:"1.875rem",lineHeight:"1.25",fontWeight:700},3:{fontSize:"1.5rem",lineHeight:"1.3",fontWeight:600},4:{fontSize:"1.25rem",lineHeight:"1.35",fontWeight:600},5:{fontSize:"1rem",lineHeight:"1.4",fontWeight:600}},wo={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}},ko=!1;function So({size:e,color:t}){return(0,l.createElement)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},(0,l.createElement)("circle",{cx:12,cy:12,r:10,stroke:`${t}33`,strokeWidth:2.5,fill:"none"}),(0,l.createElement)("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:t,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function Co({size:e,borderWidth:t,color:n,reducedMotion:o}){return o?(0,l.createElement)(So,{size:e,color:n}):(function(){if(ko||"undefined"==typeof document)return;ko=!0;const e=document.createElement("style");e.id="tkx-spin-styles",e.textContent="\n @keyframes tkx-spin-rotate {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",document.head.appendChild(e)}(),(0,l.createElement)("div",{role:"img","aria-label":"Loading",style:{width:`${e}px`,height:`${e}px`,border:`${t}px solid ${n}33`,borderTopColor:n,borderRadius:"50%",animation:"tkx-spin-rotate 0.8s linear infinite",boxSizing:"border-box"}}))}function $o({color:e,mutedColor:t}){return(0,l.createElement)("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},(0,l.createElement)("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${t}18`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),(0,l.createElement)("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${t}10`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),(0,l.createElement)("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${t}0d`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),(0,l.createElement)("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),(0,l.createElement)("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function zo({mutedColor:e}){return(0,l.createElement)("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},(0,l.createElement)("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),(0,l.createElement)("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),(0,l.createElement)("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),(0,l.createElement)("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),(0,l.createElement)("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),(0,l.createElement)("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function Mo({direction:e,color:t}){return(0,l.createElement)("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},(0,l.createElement)("path",{d:"up"===e?"M6 10 L10 4 L14 10":"M6 4 L10 10 L14 4",stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))}var No=!1;function Io({w:e,h:t,alt:n,bdr:o,rm:r}){return r||function(){if(No||"undefined"==typeof document)return;No=!0;const e=document.createElement("style");e.id="tkx-statistic-skeleton",e.textContent="@keyframes tkx-stat-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}",document.head.appendChild(e)}(),(0,l.createElement)("div",{"aria-hidden":"true",style:{width:e,height:t,borderRadius:"4px",background:r?n:`linear-gradient(90deg, ${n} 25%, ${o} 50%, ${n} 75%)`,backgroundSize:"200% 100%",animation:r?"none":"tkx-stat-shimmer 1.5s ease-in-out infinite"}})}var Lo={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}},Ro={L:.38,M:.42,Q:.48,H:.55},Do={success:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M22 37l9 9 19-19",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),error:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M26 26l20 20M46 26L26 46",stroke:e,strokeWidth:"4",strokeLinecap:"round"})]}),warning:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M36 6L4 64h64L36 6z",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M36 30v16",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:"36",cy:"54",r:"2.5",fill:e})]}),info:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M36 32v18",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:"36",cy:"22",r:"2.5",fill:e})]}),404:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"404"})]}),403:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M28 30h16v16H28z",stroke:e,strokeWidth:"3",fill:"none"}),(0,a.jsx)("path",{d:"M32 30v-4a4 4 0 018 0v4",stroke:e,strokeWidth:"3",fill:"none"})]}),500:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"500"})]})};function To(){if("undefined"==typeof window)return!1;const e=window.outerWidth-window.innerWidth,t=window.outerHeight-window.innerHeight;return e>160||t>160}function Wo(){const[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if("undefined"==typeof window)return;t(To());const e=()=>t(To());window.addEventListener("resize",e);const n=window.setInterval(e,1e3);return()=>{window.removeEventListener("resize",e),window.clearInterval(n)}},[]),e}function Ao(e){if(e)try{return e()}catch{return window}return window}function Bo(e){const t=[];for(const n of e)t.push(n),n.children&&t.push(...Bo(n.children));return t}function Eo(e){return e.startsWith("#")?e.slice(1):e}function Ho({item:e,activeKey:t,depth:o,onClick:r,theme:i,reducedMotion:l}){const s=e.key===t,d=n.sanitizeString(e.title);return(0,a.jsxs)("li",{role:"none",style:{listStyle:"none"},children:[(0,a.jsx)("a",{role:"treeitem","aria-current":s?"location":void 0,href:e.href,onClick:t=>{t.preventDefault(),r(e.href)},className:n.tkx("block text-sm py-1 no-underline"),style:{paddingLeft:12+16*o,color:s?i.primary:i.textMuted,fontWeight:s?600:400,borderLeft:`2px solid ${s?i.primary:"transparent"}`,transition:l?"none":"color 0.15s ease, border-color 0.15s ease"},children:d}),e.children&&e.children.length>0&&(0,a.jsx)("ul",{role:"group",style:{margin:0,padding:0},children:e.children.map(e=>(0,a.jsx)(Ho,{item:e,activeKey:t,depth:o+1,onClick:r,theme:i,reducedMotion:l},e.key))})]})}function Fo(e,t){const n=[];let o=e;for(const r of t){const e=o.find(e=>e.value===r);if(!e)break;n.push(e),o=e.children??[]}return n}var jo={sm:"8px 12px",md:"12px 16px",lg:"16px 20px"};function Po({theme:e,reducedMotion:t}){return(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[(0,a.jsx)("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),(0,a.jsxs)("div",{className:n.tkx("flex-1"),children:[(0,a.jsx)("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),(0,a.jsx)("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}})]})]})}var Oo={turnstile:"https://challenges.cloudflare.com/turnstile/v0/api.js",hcaptcha:"https://js.hcaptcha.com/1/api.js",recaptcha:"https://www.google.com/recaptcha/api.js"},Vo={turnstile:"turnstile",hcaptcha:"hcaptcha",recaptcha:"grecaptcha"},Uo=/^[A-Za-z0-9_-]{20,80}$/,Ko={},Yo=(0,l.forwardRef)(function({provider:e="turnstile",sitekey:t,theme:n="auto",size:o="normal",language:r,execution:i="render",onVerify:s,onExpire:d,onError:c,className:u,style:p,testMode:h=!1},f){const m=(0,l.useRef)(null),g=(0,l.useRef)(null),x=(0,l.useRef)(null);return"string"!=typeof t||Uo.test(t),(0,l.useImperativeHandle)(f,()=>({reset:()=>{if(h)return void(x.current=null);const t=window[Vo[e]];if(t&&null!=g.current){try{t.reset?.(g.current)}catch{}x.current=null}},execute:()=>{if(h)return void setTimeout(()=>{x.current="TEST_TOKEN",s("TEST_TOKEN")},200);const t=window[Vo[e]];if(t&&null!=g.current)try{t.execute?.(g.current)}catch{}},getResponse:()=>x.current}),[e,s,h]),(0,l.useEffect)(()=>{if(h){const e=window.setTimeout(()=>{x.current="TEST_TOKEN",s("TEST_TOKEN")},200);return()=>window.clearTimeout(e)}let l=!1,a=null;const u=m.current;if(u)return function(e,t){if("undefined"==typeof window)return Promise.resolve();if(window[Vo[e]])return Promise.resolve();if(Ko[e])return Ko[e];const n=new Promise((n,o)=>{const r=document.querySelector(`script[data-tkx-captcha="${e}"]`);if(r)return r.addEventListener("load",()=>n()),void r.addEventListener("error",()=>o(new Error("script-load-failed")));const i=document.createElement("script");let l=Oo[e];t&&"turnstile"!==e&&(l+=`?hl=${encodeURIComponent(t)}`),i.src=l,i.async=!0,i.defer=!0,i.dataset.tkxCaptcha=e,i.addEventListener("load",()=>n()),i.addEventListener("error",()=>o(new Error("script-load-failed"))),document.head.appendChild(i)});return Ko[e]=n,n}(e,r).then(()=>{if(l||!u)return;const p=window[Vo[e]];if(!p)return;const h={callback:e=>{x.current=e,s(e)},"expired-callback":()=>{x.current=null,d?.()},"error-callback":e=>{x.current=null,c?.("string"==typeof e?e:"unknown")}};try{"turnstile"===e?a=p.render(u,{sitekey:t,theme:n,size:"flexible"===o?"flexible":"compact"===o?"compact":"normal",execution:i,language:r||"auto",...h}):"hcaptcha"===e?a=p.render(u,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"compact"===o?"compact":"normal",...h}):"recaptcha"===e&&(a=p.render(u,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"normal",...h})),g.current=a}catch(f){c?.(f?.message||"render-failed")}}).catch(()=>{l||c?.("script-load-failed")}),()=>{l=!0;const t=window[Vo[e]];if(t&&null!=a)try{t.remove?.(a)}catch{}g.current=null,x.current=null}},[]),(0,a.jsx)("div",{ref:m,className:u,style:p,"data-tkx-captcha-provider":e,children:h&&(0,a.jsx)("div",{"aria-live":"polite",style:{padding:"12px 16px",border:"1px dashed currentColor",borderRadius:8,fontSize:13,opacity:.7,display:"inline-block"},children:"[TkxCaptcha test mode — auto-verifying with TEST_TOKEN]"})})});Yo.displayName="TkxCaptcha";var qo={latin:{id:"tkx-font-latin",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap"},"latin-ext":{id:"tkx-font-latin-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=latin-ext"},devanagari:{id:"tkx-font-devanagari",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap"},tamil:{id:"tkx-font-tamil",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil:wght@400;500;600;700&display=swap"},telugu:{id:"tkx-font-telugu",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Telugu:wght@400;500;600;700&display=swap"},kannada:{id:"tkx-font-kannada",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Kannada:wght@400;500;600;700&display=swap"},malayalam:{id:"tkx-font-malayalam",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Malayalam:wght@400;500;600;700&display=swap"},bengali:{id:"tkx-font-bengali",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap"},gujarati:{id:"tkx-font-gujarati",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Gujarati:wght@400;500;600;700&display=swap"},gurmukhi:{id:"tkx-font-gurmukhi",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Gurmukhi:wght@400;500;600;700&display=swap"},oriya:{id:"tkx-font-oriya",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Oriya:wght@400;500;600;700&display=swap"},sinhala:{id:"tkx-font-sinhala",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:wght@400;500;600;700&display=swap"},arabic:{id:"tkx-font-arabic",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap"},hebrew:{id:"tkx-font-hebrew",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew:wght@400;500;600;700&display=swap"},thai:{id:"tkx-font-thai",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700&display=swap"},vietnamese:{id:"tkx-font-vietnamese",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=vietnamese"},cyrillic:{id:"tkx-font-cyrillic",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=cyrillic"},"cyrillic-ext":{id:"tkx-font-cyrillic-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=cyrillic-ext"},greek:{id:"tkx-font-greek",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=greek"},"greek-ext":{id:"tkx-font-greek-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=greek-ext"},jp:{id:"tkx-font-jp",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap"},kr:{id:"tkx-font-kr",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap"},sc:{id:"tkx-font-sc",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap"},tc:{id:"tkx-font-tc",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&display=swap"}},Xo={en:["latin"],hi:["devanagari"],mr:["devanagari"],sa:["devanagari"],ne:["devanagari"],ta:["tamil"],te:["telugu"],kn:["kannada"],ml:["malayalam"],bn:["bengali"],as:["bengali"],gu:["gujarati"],pa:["gurmukhi"],or:["oriya"],si:["sinhala"],ar:["arabic"],ur:["arabic"],fa:["arabic"],he:["hebrew"],th:["thai"],vi:["vietnamese","latin"],ru:["cyrillic"],uk:["cyrillic"],bg:["cyrillic"],el:["greek"],ja:["jp"],ko:["kr"],zh:["sc"],"zh-CN":["sc"],"zh-TW":["tc"],"zh-HK":["tc"]},Go=!1;function _o(e){if("undefined"==typeof document)return;const t=qo[e];if(!t)return;if(document.getElementById(t.id))return;const n=document.createElement("link");n.id=t.id,n.rel="stylesheet",n.href=t.href,document.head.appendChild(n)}function Zo(e){return e&&(Xo[e]||Xo[e.split("-")[0]])||["latin"]}var Jo=[{iso2:"in",name:"India",dial:"91",length:10,format:"##### #####",flag:"🇮🇳"},{iso2:"us",name:"United States",dial:"1",length:10,format:"(###) ###-####",flag:"🇺🇸"},{iso2:"gb",name:"United Kingdom",dial:"44",length:[9,10],format:"#### ######",flag:"🇬🇧"},{iso2:"ca",name:"Canada",dial:"1",length:10,format:"(###) ###-####",flag:"🇨🇦"},{iso2:"au",name:"Australia",dial:"61",length:9,format:"### ### ###",flag:"🇦🇺"},{iso2:"de",name:"Germany",dial:"49",length:[10,11],format:"#### ########",flag:"🇩🇪"},{iso2:"fr",name:"France",dial:"33",length:9,format:"# ## ## ## ##",flag:"🇫🇷"},{iso2:"es",name:"Spain",dial:"34",length:9,format:"### ### ###",flag:"🇪🇸"},{iso2:"it",name:"Italy",dial:"39",length:[9,10],format:"### ### ####",flag:"🇮🇹"},{iso2:"nl",name:"Netherlands",dial:"31",length:9,format:"# #### ####",flag:"🇳🇱"},{iso2:"se",name:"Sweden",dial:"46",length:[7,9],format:"## ### ## ##",flag:"🇸🇪"},{iso2:"no",name:"Norway",dial:"47",length:8,format:"### ## ###",flag:"🇳🇴"},{iso2:"dk",name:"Denmark",dial:"45",length:8,format:"## ## ## ##",flag:"🇩🇰"},{iso2:"fi",name:"Finland",dial:"358",length:[9,10],format:"## ### ####",flag:"🇫🇮"},{iso2:"pl",name:"Poland",dial:"48",length:9,format:"### ### ###",flag:"🇵🇱"},{iso2:"ie",name:"Ireland",dial:"353",length:9,format:"## ### ####",flag:"🇮🇪"},{iso2:"pt",name:"Portugal",dial:"351",length:9,format:"### ### ###",flag:"🇵🇹"},{iso2:"ch",name:"Switzerland",dial:"41",length:9,format:"## ### ## ##",flag:"🇨🇭"},{iso2:"at",name:"Austria",dial:"43",length:[10,11],format:"### ### ####",flag:"🇦🇹"},{iso2:"be",name:"Belgium",dial:"32",length:9,format:"### ## ## ##",flag:"🇧🇪"},{iso2:"jp",name:"Japan",dial:"81",length:10,format:"## #### ####",flag:"🇯🇵"},{iso2:"kr",name:"South Korea",dial:"82",length:[9,10],format:"## #### ####",flag:"🇰🇷"},{iso2:"cn",name:"China",dial:"86",length:11,format:"### #### ####",flag:"🇨🇳"},{iso2:"hk",name:"Hong Kong",dial:"852",length:8,format:"#### ####",flag:"🇭🇰"},{iso2:"sg",name:"Singapore",dial:"65",length:8,format:"#### ####",flag:"🇸🇬"},{iso2:"my",name:"Malaysia",dial:"60",length:[9,10],format:"## ### ####",flag:"🇲🇾"},{iso2:"id",name:"Indonesia",dial:"62",length:[9,12],format:"### ### ####",flag:"🇮🇩"},{iso2:"th",name:"Thailand",dial:"66",length:9,format:"## ### ####",flag:"🇹🇭"},{iso2:"vn",name:"Vietnam",dial:"84",length:[9,10],format:"### ### ####",flag:"🇻🇳"},{iso2:"ph",name:"Philippines",dial:"63",length:10,format:"### ### ####",flag:"🇵🇭"},{iso2:"pk",name:"Pakistan",dial:"92",length:10,format:"### #######",flag:"🇵🇰"},{iso2:"bd",name:"Bangladesh",dial:"880",length:10,format:"#### ######",flag:"🇧🇩"},{iso2:"lk",name:"Sri Lanka",dial:"94",length:9,format:"## ### ####",flag:"🇱🇰"},{iso2:"np",name:"Nepal",dial:"977",length:10,format:"###-#######",flag:"🇳🇵"},{iso2:"ae",name:"UAE",dial:"971",length:9,format:"## ### ####",flag:"🇦🇪"},{iso2:"sa",name:"Saudi Arabia",dial:"966",length:9,format:"## ### ####",flag:"🇸🇦"},{iso2:"qa",name:"Qatar",dial:"974",length:8,format:"#### ####",flag:"🇶🇦"},{iso2:"kw",name:"Kuwait",dial:"965",length:8,format:"#### ####",flag:"🇰🇼"},{iso2:"om",name:"Oman",dial:"968",length:8,format:"#### ####",flag:"🇴🇲"},{iso2:"bh",name:"Bahrain",dial:"973",length:8,format:"#### ####",flag:"🇧🇭"},{iso2:"il",name:"Israel",dial:"972",length:9,format:"## ### ####",flag:"🇮🇱"},{iso2:"tr",name:"Turkey",dial:"90",length:10,format:"### ### ####",flag:"🇹🇷"},{iso2:"ru",name:"Russia",dial:"7",length:10,format:"### ### ####",flag:"🇷🇺"},{iso2:"ua",name:"Ukraine",dial:"380",length:9,format:"## ### ####",flag:"🇺🇦"},{iso2:"br",name:"Brazil",dial:"55",length:[10,11],format:"## ##### ####",flag:"🇧🇷"},{iso2:"mx",name:"Mexico",dial:"52",length:10,format:"## #### ####",flag:"🇲🇽"},{iso2:"ar",name:"Argentina",dial:"54",length:10,format:"## #### ####",flag:"🇦🇷"},{iso2:"cl",name:"Chile",dial:"56",length:9,format:"# #### ####",flag:"🇨🇱"},{iso2:"co",name:"Colombia",dial:"57",length:10,format:"### ### ####",flag:"🇨🇴"},{iso2:"pe",name:"Peru",dial:"51",length:9,format:"### ### ###",flag:"🇵🇪"},{iso2:"za",name:"South Africa",dial:"27",length:9,format:"## ### ####",flag:"🇿🇦"},{iso2:"ng",name:"Nigeria",dial:"234",length:10,format:"### ### ####",flag:"🇳🇬"},{iso2:"ke",name:"Kenya",dial:"254",length:9,format:"### ### ###",flag:"🇰🇪"},{iso2:"eg",name:"Egypt",dial:"20",length:10,format:"### ### ####",flag:"🇪🇬"},{iso2:"ma",name:"Morocco",dial:"212",length:9,format:"## ### ####",flag:"🇲🇦"},{iso2:"nz",name:"New Zealand",dial:"64",length:[8,9],format:"## ### ####",flag:"🇳🇿"}];function Qo(e){return e.replace(/\D+/g,"")}function er(e,t){if(!t)return e;let n="",o=0;for(const r of t)if("#"===r){if(o>=e.length)break;n+=e[o++]}else o<e.length&&(n+=r);return o<e.length&&(n+=e.slice(o)),n}function tr(e,t){return Array.isArray(t)?e.length>=t[0]&&e.length<=t[1]:e.length===t}function nr(e){return Array.isArray(e)?`${e[0]}–${e[1]}`:`${e}`}var or=(0,l.forwardRef)(function({defaultCountry:e="in",value:n,defaultValue:o,onChange:r,onValid:i,label:s,placeholder:d,disabled:c,required:u,id:p,name:h,extraCountries:f=[],className:m,style:g},x){const b=t.useTheme(),y=(0,l.useId)(),v=(0,l.useId)(),w=(0,l.useMemo)(()=>[...Jo,...f].sort((e,t)=>e.name.localeCompare(t.name)),[f]),k=e=>w.find(t=>t.iso2===e.toLowerCase())||w[0],S=t=>{if(!t.startsWith("+"))return{country:k(e),digits:Qo(t)};const n=Qo(t);for(const e of[4,3,2,1]){const t=n.slice(0,e),o=w.find(e=>e.dial===t);if(o)return{country:o,digits:n.slice(e)}}return{country:k(e),digits:n}},C=n?S(n):{country:k(e),digits:Qo(o||"")},[$,z]=(0,l.useState)(C.country),[M,N]=(0,l.useState)(C.digits),[I,L]=(0,l.useState)(!1),[R,D]=(0,l.useState)(""),[T,W]=(0,l.useState)(0),A=(0,l.useRef)(null),B=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(void 0===n)return;const e=S(n);z(e.country),N(e.digits)},[n]);const E=er(M,$.format),H=tr(M,$.length),F=M?`+${$.dial}${M}`:"",j=(e,t)=>{const n={raw:er(e,t.format),digits:e,e164:e?`+${t.dial}${e}`:"",country:t,valid:tr(e,t.length)};r?.(n)},P=e=>{z(e),L(!1),j(M,e),A.current?.focus()},O=(0,l.useMemo)(()=>{const e=R.trim().toLowerCase();return e?w.filter(t=>t.name.toLowerCase().includes(e)||t.iso2.includes(e)||t.dial.includes(e.replace(/^\+/,""))):w},[w,R]);(0,l.useEffect)(()=>{W(0)},[R]),(0,l.useEffect)(()=>{if(I){const e=setTimeout(()=>B.current?.focus(),0);return()=>clearTimeout(e)}},[I]);const V=d??nr($.length).replace(/\d/g,"#"),U={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...g},K={fontSize:13,fontWeight:600,color:b.text},Y={display:"flex",alignItems:"stretch",border:`1px solid ${b.border}`,borderRadius:8,background:b.surface,overflow:"visible",position:"relative"},q={display:"inline-flex",alignItems:"center",gap:6,padding:"0 10px",background:"transparent",border:"none",borderRight:`1px solid ${b.border}`,cursor:c?"not-allowed":"pointer",color:b.text,fontSize:14,minHeight:40,fontWeight:500},X={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:b.text,background:"transparent",minHeight:40,minWidth:0},G={position:"absolute",top:"calc(100% + 4px)",left:0,right:0,maxHeight:280,overflow:"auto",background:b.surface,border:`1px solid ${b.border}`,borderRadius:8,zIndex:1e3,padding:6,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},_={width:"100%",padding:"8px 10px",border:`1px solid ${b.border}`,borderRadius:6,background:b.bg,color:b.text,fontSize:13,marginBottom:6,outline:"none"},Z={fontSize:12,color:b.danger,marginTop:2};return(0,a.jsxs)("div",{className:m,style:U,onKeyDown:e=>{I&&("ArrowDown"===e.key?(e.preventDefault(),W(e=>Math.min(O.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),W(e=>Math.max(0,e-1))):"Enter"===e.key?(e.preventDefault(),O[T]&&P(O[T])):"Escape"===e.key&&(e.preventDefault(),L(!1),A.current?.focus()))},children:[s&&(0,a.jsxs)("label",{htmlFor:p||y,style:K,children:[s,u&&(0,a.jsx)("span",{style:{color:b.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),(0,a.jsxs)("div",{style:Y,children:[(0,a.jsxs)("button",{ref:A,type:"button",style:q,onClick:()=>!c&&L(e=>!e),"aria-haspopup":"listbox","aria-expanded":I,"aria-controls":v,"aria-label":`Country: ${$.name}, dial code +${$.dial}`,disabled:c,children:[(0,a.jsx)("span",{"aria-hidden":"true",style:{fontSize:18,lineHeight:1},children:$.flag}),(0,a.jsxs)("span",{"aria-hidden":"true",children:["+",$.dial]}),(0,a.jsx)("span",{"aria-hidden":"true",style:{fontSize:10,opacity:.6,marginLeft:2},children:"▾"})]}),(0,a.jsx)("input",{ref:x,id:p||y,name:h,type:"tel",inputMode:"tel",autoComplete:"tel-national",value:E,onChange:e=>{const t=Qo(e.target.value).slice(0,15);N(t),j(t,$)},onBlur:()=>{H&&i&&i({raw:E,digits:M,e164:F,country:$,valid:!0})},placeholder:V,disabled:c,required:u,"aria-invalid":M.length>0&&!H,"aria-describedby":M.length>0&&!H?`${y}-err`:void 0,style:X}),I&&!c&&(0,a.jsxs)("div",{id:v,role:"listbox","aria-label":"Select country",style:G,children:[(0,a.jsx)("input",{ref:B,type:"text",placeholder:"Search country or dial code…",value:R,onChange:e=>D(e.target.value),style:_,"aria-label":"Filter countries"}),0===O.length&&(0,a.jsxs)("div",{style:{padding:"12px 10px",fontSize:13,color:b.textMuted},children:['No country matches "',R,'"']}),O.map((e,t)=>{return(0,a.jsxs)("div",{role:"option","aria-selected":t===T,onMouseEnter:()=>W(t),onClick:()=>P(e),style:(n=t===T,{display:"flex",alignItems:"center",gap:10,padding:"8px 10px",borderRadius:6,cursor:"pointer",background:n?b.surfaceAlt:"transparent",color:b.text,fontSize:13}),children:[(0,a.jsx)("span",{"aria-hidden":"true",style:{fontSize:16},children:e.flag}),(0,a.jsx)("span",{style:{flex:1},children:e.name}),(0,a.jsxs)("span",{style:{color:b.textMuted,fontVariantNumeric:"tabular-nums"},children:["+",e.dial]})]},e.iso2);var n})]})]}),M.length>0&&!H&&(0,a.jsxs)("div",{id:`${y}-err`,role:"alert",style:Z,children:["Expected ",nr($.length)," digits for ",$.name,"."]})]})});or.displayName="TkxPhoneInput";var rr={free:null,"1:1":1,"3:4":3/4,"4:5":.8,"16:9":16/9,"4:3":4/3,"3:2":1.5},ir={drop:"Drop an image here, or",browse:"browse",rotate:"Rotate",apply:"Apply",cancel:"Cancel",brightness:"Brightness",contrast:"Contrast",aspect:"Aspect",free:"Free"},lr=(0,l.forwardRef)(function({src:e,aspectRatio:n="free",ratios:o=["free","1:1","3:4","4:5","16:9"],mimeType:r="image/png",quality:i=.92,maxOutputSize:s=2048,outputFilename:d="edited.png",onChange:c,onResult:u,onCancel:p,className:h,style:f,labels:m},g){const x={...ir,...m},b=t.useTheme(),y=(0,l.useRef)(null),v=(0,l.useRef)(null),w=(0,l.useRef)(null),k=(0,l.useRef)(null),[S,C]=(0,l.useState)(e??null),[$,z]=(0,l.useState)(null),[M,N]=(0,l.useState)(n),[I,L]=(0,l.useState)(0),[R,D]=(0,l.useState)(100),[T,W]=(0,l.useState)(100),[A,B]=(0,l.useState)({x:0,y:0,w:0,h:0}),[E,H]=(0,l.useState)(!1),F=(0,l.useRef)({mode:null,startX:0,startY:0,startCrop:{x:0,y:0,w:0,h:0}});(0,l.useEffect)(()=>{if(!S)return k.current=null,void z(null);const e=new Image;e.crossOrigin="anonymous",e.onload=()=>{k.current=e,z({w:e.naturalWidth,h:e.naturalHeight});const t=rr[M];if(t){const n=Math.min(e.naturalWidth,e.naturalHeight*t),o=n/t;B({x:(e.naturalWidth-n)/2,y:(e.naturalHeight-o)/2,w:n,h:o})}else B({x:0,y:0,w:e.naturalWidth,h:e.naturalHeight})},e.src=S},[S,M]),(0,l.useEffect)(()=>{c?.({rotation:I,brightness:R,contrast:T})},[I,R,T,c]);const j=(0,l.useCallback)(()=>{const e=v.current,t=k.current,n=$;if(!e||!t||!n)return;const o=e.getContext("2d");if(!o)return;const r=w.current,i=r?Math.min(r.clientWidth,800):600,l=I%180!=0,a=l?n.h:n.w,s=l?n.w:n.h,d=Math.min(i/a,600/s,1),c=Math.floor(a*d),u=Math.floor(s*d);e.width=c,e.height=u,o.save(),o.filter=`brightness(${R}%) contrast(${T}%)`,o.translate(c/2,u/2),o.rotate(I*Math.PI/180),o.drawImage(t,-n.w*d/2,-n.h*d/2,n.w*d,n.h*d),o.restore()},[I,R,T,$]);(0,l.useEffect)(()=>{j()},[j]),(0,l.useEffect)(()=>{const e=$;if(!e)return;const t=rr[M];t&&B(n=>{const o=n.x+n.w/2,r=n.y+n.h/2;let i=n.w,l=i/t;return l>e.h&&(l=e.h,i=l*t),i>e.w&&(i=e.w,l=i/t),{x:Math.max(0,Math.min(e.w-i,o-i/2)),y:Math.max(0,Math.min(e.h-l,r-l/2)),w:i,h:l}})},[M,$]);const P=e=>{const t=new FileReader;t.onload=()=>{"string"==typeof t.result&&(C(t.result),L(0),D(100),W(100))},t.readAsDataURL(e)},O=e=>t=>{t.preventDefault(),t.stopPropagation();const n="touches"in t?t.touches[0]:t;F.current={mode:e,startX:n.clientX,startY:n.clientY,startCrop:{...A}};const o=e=>{e.preventDefault();const t="touches"in e?e.touches[0]:e,n=t.clientX-F.current.startX,o=t.clientY-F.current.startY,r=$;if(!r)return;const i=v.current;if(!i)return;const l=n*(r.w/i.width),a=o*(r.h/i.height),s=F.current.startCrop,d=rr[M];let c={...s};if("move"===F.current.mode)c.x=Math.max(0,Math.min(r.w-s.w,s.x+l)),c.y=Math.max(0,Math.min(r.h-s.h,s.y+a));else{const e=F.current.mode;if("se"===e)c.w=Math.max(20,Math.min(r.w-s.x,s.w+l)),c.h=d?c.w/d:Math.max(20,Math.min(r.h-s.y,s.h+a));else if("sw"===e){const e=Math.max(20,s.w-l);c.x=Math.max(0,s.x+s.w-e),c.w=s.x+s.w-c.x,c.h=d?c.w/d:Math.max(20,Math.min(r.h-s.y,s.h+a))}else if("ne"===e){c.w=Math.max(20,Math.min(r.w-s.x,s.w+l));const e=d?c.w/d:Math.max(20,s.h-a);c.y=Math.max(0,s.y+s.h-e),c.h=s.y+s.h-c.y}else if("nw"===e){const e=Math.max(20,s.w-l);c.x=Math.max(0,s.x+s.w-e),c.w=s.x+s.w-c.x;const t=d?c.w/d:Math.max(20,s.h-a);c.y=Math.max(0,s.y+s.h-t),c.h=s.y+s.h-c.y}}B(c)},r=()=>{F.current.mode=null,window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",r),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",r)};window.addEventListener("mousemove",o,{passive:!1}),window.addEventListener("mouseup",r),window.addEventListener("touchmove",o,{passive:!1}),window.addEventListener("touchend",r)},V=(0,l.useCallback)(()=>new Promise(e=>{const t=k.current,n=$;if(!t||!n)return e(null);const o=document.createElement("canvas"),l=I%180!=0,a=l?A.h:A.w,c=l?A.w:A.h,u=Math.min(1,s/Math.max(a,c));o.width=Math.round(a*u),o.height=Math.round(c*u);const p=o.getContext("2d");if(!p)return e(null);p.filter=`brightness(${R}%) contrast(${T}%)`;const h=document.createElement("canvas");h.width=l?n.h:n.w,h.height=l?n.w:n.h;const f=h.getContext("2d");if(!f)return e(null);f.translate(h.width/2,h.height/2),f.rotate(I*Math.PI/180),f.drawImage(t,-n.w/2,-n.h/2,n.w,n.h),p.drawImage(h,A.x,A.y,A.w,A.h,0,0,o.width,o.height),o.toBlob(t=>{if(!t)return e(null);const n="image/jpeg"===r?"jpg":"image/webp"===r?"webp":"png",i=d.endsWith(`.${n}`)?d:d.replace(/\.\w+$/,"")+`.${n}`;e({blob:t,file:new File([t],i,{type:r,lastModified:Date.now()}),url:URL.createObjectURL(t),width:o.width,height:o.height})},r,i)}),[A,I,R,T,$,r,i,s,d]);(0,l.useImperativeHandle)(g,()=>({getResult:V,reset:()=>{if(L(0),D(100),W(100),$){const e=rr[M];if(e){const t=Math.min($.w,$.h*e),n=t/e;B({x:($.w-t)/2,y:($.h-n)/2,w:t,h:n})}else B({x:0,y:0,w:$.w,h:$.h})}},loadSource:e=>C(e)}),[V,M,$]);const U={border:`1px solid ${b.border}`,borderRadius:12,background:b.surface,padding:16,...f},K={border:`2px dashed ${E?b.primary:b.border}`,borderRadius:10,padding:48,textAlign:"center",color:b.textMuted,cursor:"pointer",transition:"border-color 0.15s",background:E?`${b.primary}10`:"transparent"},Y={padding:"8px 14px",border:`1px solid ${b.border}`,borderRadius:6,background:b.bg,color:b.text,cursor:"pointer",fontSize:13,fontWeight:600,minHeight:36},q=(0,l.useMemo)(()=>{const e=v.current,t=$;if(!e||!t)return null;const n=I%180!=0,o=n?t.h:t.w,r=n?t.w:t.h,i=e.width/o,l=e.height/r;return{left:A.x*i,top:A.y*l,width:A.w*i,height:A.h*l}},[A,$,I]);return S?(0,a.jsxs)("div",{ref:w,className:h,style:U,children:[(0,a.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12,alignItems:"center"},children:[(0,a.jsxs)("span",{style:{fontSize:13,fontWeight:600,marginRight:4},children:[x.aspect,":"]}),o.map(e=>{return(0,a.jsx)("button",{type:"button",onClick:()=>N(e),style:(t=M===e,{...Y,background:t?b.primary:b.bg,color:t?b.bg:b.text,borderColor:t?b.primary:b.border}),"aria-pressed":M===e,children:"free"===e?x.free:e},e);var t}),(0,a.jsx)("div",{style:{width:1,height:24,background:b.border,margin:"0 4px"}}),(0,a.jsxs)("button",{type:"button",onClick:()=>L(e=>(e-90+360)%360),style:Y,"aria-label":`${x.rotate} 90 degrees left`,children:["↺ ",x.rotate]}),(0,a.jsxs)("button",{type:"button",onClick:()=>L(e=>(e+90)%360),style:Y,"aria-label":`${x.rotate} 90 degrees right`,children:["↻ ",x.rotate]})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:16,marginBottom:12,flexWrap:"wrap"},children:[(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13},children:[(0,a.jsx)("span",{style:{minWidth:80},children:x.brightness}),(0,a.jsx)("input",{type:"range",min:50,max:150,value:R,onChange:e=>D(Number(e.target.value)),"aria-label":x.brightness,style:{width:140}}),(0,a.jsxs)("span",{style:{minWidth:40,color:b.textMuted,fontVariantNumeric:"tabular-nums"},children:[R,"%"]})]}),(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13},children:[(0,a.jsx)("span",{style:{minWidth:80},children:x.contrast}),(0,a.jsx)("input",{type:"range",min:50,max:150,value:T,onChange:e=>W(Number(e.target.value)),"aria-label":x.contrast,style:{width:140}}),(0,a.jsxs)("span",{style:{minWidth:40,color:b.textMuted,fontVariantNumeric:"tabular-nums"},children:[T,"%"]})]})]}),(0,a.jsxs)("div",{style:{position:"relative",display:"inline-block",maxWidth:"100%",userSelect:"none",touchAction:"none"},children:[(0,a.jsx)("canvas",{ref:v,style:{display:"block",maxWidth:"100%"}}),q&&(0,a.jsx)("div",{role:"region","aria-label":"Crop area",style:{position:"absolute",left:q.left,top:q.top,width:q.width,height:q.height,border:`2px solid ${b.primary}`,boxShadow:`0 0 0 9999px ${b.bg}aa`,cursor:"move",touchAction:"none"},onMouseDown:O("move"),onTouchStart:O("move"),tabIndex:0,onKeyDown:e=>{const t=$;if(!t)return;const n=e.shiftKey?20:5;"ArrowLeft"===e.key?B(e=>({...e,x:Math.max(0,e.x-n)})):"ArrowRight"===e.key?B(e=>({...e,x:Math.min(t.w-e.w,e.x+n)})):"ArrowUp"===e.key?B(e=>({...e,y:Math.max(0,e.y-n)})):"ArrowDown"===e.key&&B(e=>({...e,y:Math.min(t.h-e.h,e.y+n)}))},children:["nw","ne","sw","se"].map(e=>(0,a.jsx)("div",{onMouseDown:O(e),onTouchStart:O(e),style:{position:"absolute",width:14,height:14,background:b.primary,border:`2px solid ${b.bg}`,borderRadius:2,cursor:`${e}-resize`,top:e.startsWith("n")?-7:void 0,bottom:e.startsWith("s")?-7:void 0,left:e.endsWith("w")?-7:void 0,right:e.endsWith("e")?-7:void 0,touchAction:"none"},"aria-hidden":"true"},e))})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,marginTop:16,justifyContent:"flex-end"},children:[p&&(0,a.jsx)("button",{type:"button",onClick:p,style:Y,children:x.cancel}),(0,a.jsx)("button",{type:"button",onClick:async()=>{const e=await V();e&&u&&u(e)},style:{...Y,background:b.primary,color:b.bg,borderColor:b.primary},children:x.apply})]})]}):(0,a.jsx)("div",{className:h,style:U,children:(0,a.jsxs)("div",{style:K,onClick:()=>y.current?.click(),onDrop:e=>{e.preventDefault(),H(!1);const t=e.dataTransfer.files?.[0];t&&t.type.startsWith("image/")&&P(t)},onDragOver:e=>{e.preventDefault(),H(!0)},onDragLeave:()=>H(!1),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),y.current?.click())},"aria-label":"Upload image to edit",children:[(0,a.jsx)("div",{style:{fontSize:14,marginBottom:6},children:x.drop}),(0,a.jsx)("button",{type:"button",style:{...Y,color:b.primary,borderColor:b.primary},children:x.browse}),(0,a.jsx)("input",{ref:y,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>{const t=e.target.files?.[0];t&&P(t)}})]})})});lr.displayName="TkxImageEditor";var ar={razorpay:"https://checkout.razorpay.com/v1/checkout.js",stripe:"https://js.stripe.com/v3/",square:"https://web.squarecdn.com/v1/square.js"},sr={razorpay:"Razorpay",stripe:"Stripe",square:"Square"},dr=/^[A-Za-z0-9_-]{20,200}$/,cr={},ur=(0,l.forwardRef)(function({config:e,onSuccess:o,onFailure:i,onDismiss:s,children:d,variant:c="primary",size:u="md",disabled:p,className:h,style:f},m){const g=t.useTheme(),x=r.useLocale(),[b,y]=(0,l.useState)(!1),v="razorpay"===e.provider||"stripe"===e.provider?e.publicKey:e.applicationId;dr.test(v);const w="sm"===u?13:"lg"===u?16:14,k="sm"===u?32:"lg"===u?48:40,S={padding:`${"sm"===u?6:"lg"===u?12:9}px ${"sm"===u?12:"lg"===u?22:16}px`,borderRadius:8,border:"outline"===c?`1.5px solid ${g.primary}`:"none",background:"outline"===c?"transparent":g.primary,color:"outline"===c?g.primary:g.bg,fontSize:w,fontWeight:600,cursor:p?"not-allowed":b?"progress":"pointer",opacity:p?.5:1,minHeight:k,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,transition:"opacity 0.15s, transform 0.05s",...f};return(0,a.jsx)("button",{ref:m,type:"button",onClick:async()=>{if(!b&&!p){y(!0);try{if(await function(e){if("undefined"==typeof window)return Promise.resolve();if(window[sr[e]])return Promise.resolve();if(cr[e])return cr[e];const t=new Promise((t,n)=>{const o=document.querySelector(`script[data-tkx-payment="${e}"]`);if(o)return o.addEventListener("load",()=>t()),void o.addEventListener("error",()=>n(new Error("script-load-failed")));const r=document.createElement("script");r.src=ar[e],r.async=!0,r.dataset.tkxPayment=e,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(new Error("script-load-failed"))),document.head.appendChild(r)});return cr[e]=t,t}(e.provider),"razorpay"===e.provider){const t=window.Razorpay;if(!t)throw new Error("Razorpay script loaded but global missing");const r=new t({key:e.publicKey,amount:e.amount,currency:e.currency,order_id:e.orderId,name:n.sanitizeString(e.brand?.name??"Payment"),description:n.sanitizeString(e.brand?.description??""),image:e.brand?.image,prefill:e.prefill,notes:e.notes,theme:{color:e.themeColor??g.primary},handler:e=>{o({provider:"razorpay",paymentId:e.razorpay_payment_id,orderId:e.razorpay_order_id,signature:e.razorpay_signature,raw:e})},modal:{ondismiss:()=>{y(!1),s?.()}}});return r.on("payment.failed",e=>{y(!1),i?.({provider:"razorpay",code:e?.error?.code??"unknown",message:e?.error?.description??"Payment failed",raw:e})}),void r.open()}if("stripe"===e.provider){const t=window.Stripe;if(!t)throw new Error("Stripe script loaded but global missing");const n=await t(e.publicKey).redirectToCheckout({sessionId:e.sessionId});return void(n?.error&&(y(!1),i?.({provider:"stripe",code:n.error.code??"unknown",message:n.error.message??"Stripe checkout failed",raw:n})))}if("square"===e.provider){if(!window.Square)throw new Error("Square script loaded but global missing");const t={applicationId:e.applicationId,locationId:e.locationId,orderId:e.orderId,amount:e.amount,currency:e.currency,success:(t,n)=>o({provider:"square",paymentId:t,orderId:e.orderId,raw:n}),failure:(e,t,n)=>i?.({provider:"square",code:e,message:t,raw:n})};return void window.dispatchEvent(new CustomEvent("tkx-payment-square-init",{detail:t}))}}catch(t){y(!1),i?.({provider:e.provider,code:"sdk-load-failed",message:t?.message??"Unable to load payment SDK",raw:t})}}},disabled:p||b,"aria-busy":b,className:h,style:S,"data-tkx-payment-provider":e.provider,children:b?(0,a.jsx)("span",{"aria-hidden":"true",children:x.loading}):d??"Pay"})});ur.displayName="TkxPaymentButton";var pr=(0,l.forwardRef)(function({label:e,width:n,height:o=180,strokeColor:i,strokeWidth:s=2,backgroundColor:d,onChange:c,disabled:u,className:p,style:h},f){const m=t.useTheme(),g=r.useLocale(),x=(0,l.useRef)(null),b=(0,l.useRef)(null),y=(0,l.useRef)([]),v=(0,l.useRef)(null),w=(0,l.useRef)(1),[k,S]=(0,l.useState)(n??320),C=i??m.text,$=d??m.surface;(0,l.useEffect)(()=>{if(void 0!==n)return;const e=x.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(e=>{for(const t of e){const e=Math.floor(t.contentRect.width);e>0&&S(e)}});return t.observe(e),()=>t.disconnect()},[n]);const z=(0,l.useCallback)(()=>{const e=b.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const n=w.current;t.fillStyle=$,t.fillRect(0,0,e.width,e.height),t.strokeStyle=C,t.lineWidth=s*n,t.lineCap="round",t.lineJoin="round";for(const o of y.current){if(o.length<2){1===o.length&&(t.beginPath(),t.arc(o[0].x*n,o[0].y*n,s*n/2,0,2*Math.PI),t.fillStyle=C,t.fill());continue}t.beginPath(),t.moveTo(o[0].x*n,o[0].y*n);for(let r=1;r<o.length-1;r++){const e=(o[r].x+o[r+1].x)/2,i=(o[r].y+o[r+1].y)/2;t.quadraticCurveTo(o[r].x*n,o[r].y*n,e*n,i*n)}const e=o[o.length-1];t.lineTo(e.x*n,e.y*n),t.stroke()}},[$,C,s]);(0,l.useEffect)(()=>{const e=b.current;if(!e)return;const t=window.devicePixelRatio||1;w.current=t,e.width=k*t,e.height=o*t,e.style.width=`${k}px`,e.style.height=`${o}px`,z()},[k,o,z]);const M=e=>{const t=e.currentTarget.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},N=e=>{if(v.current){try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}v.current=null,c?.(b.current?.toDataURL("image/png")??"")}};(0,l.useImperativeHandle)(f,()=>({clear:()=>{y.current=[],v.current=null,z(),c?.(b.current?.toDataURL("image/png")??"")},undo:()=>{y.current.pop(),z(),c?.(b.current?.toDataURL("image/png")??"")},isEmpty:()=>0===y.current.length,toDataURL:(e="image/png",t=.92)=>b.current?.toDataURL(e,t)??"",toBlob:(e="image/png",t=.92)=>new Promise(n=>{b.current?.toBlob(e=>n(e),e,t)})}),[z,c]);const I={display:"inline-flex",flexDirection:"column",gap:6,width:n??"100%",...h},L={fontSize:13,fontWeight:600,color:m.text},R={borderRadius:8,border:`1px solid ${m.border}`,background:$,cursor:u?"not-allowed":"crosshair",touchAction:"none",display:"block",width:"100%"};return(0,a.jsxs)("div",{ref:x,className:p,style:I,children:[e&&(0,a.jsx)("label",{style:L,children:e}),(0,a.jsx)("canvas",{ref:b,role:"img","aria-label":e??g.uploadFiles??"Signature pad",style:R,onPointerDown:e=>{u||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),v.current=[M(e)],y.current.push(v.current))},onPointerMove:e=>{if(!v.current||u)return;e.preventDefault();const t=M(e),n=v.current,o=n[n.length-1];Math.abs(o.x-t.x)<1&&Math.abs(o.y-t.y)<1||(n.push(t),z())},onPointerUp:N,onPointerCancel:N})]})});pr.displayName="TkxSignaturePad";var hr=async(e,t)=>{const n=await fetch(`https://api.postalpincode.in/pincode/${e}`,{signal:t});if(!n.ok)throw new Error(`HTTP ${n.status}`);const o=await n.json();return Array.isArray(o)&&o[0]&&"Success"===o[0].Status&&o[0].PostOffice?o[0].PostOffice:[]},fr=/^\d{6}$/,mr=(0,l.forwardRef)(function({value:e,onChange:n,lookup:o=hr,label:i,showAddressLines:s=!0,disabled:d,className:c,style:u},p){const h=t.useTheme(),f=r.useLocale(),m=(0,l.useId)(),[g,x]=(0,l.useState)([]),[b,y]=(0,l.useState)(!1),[v,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!e.pin||!fr.test(e.pin))return x([]),void w(null);const t=new AbortController;return y(!0),w(null),o(e.pin,t.signal).then(e=>{x(e),0===e.length&&w(f.noResults)}).catch(e=>{"AbortError"!==e?.name&&(w(e?.message||"Lookup failed"),x([]))}).finally(()=>y(!1)),()=>t.abort()},[e.pin]);const k=t=>{n({...e,pin:t.Pincode,postOffice:t.Name,city:t.District,state:t.State,country:t.Country}),x([])},S=(t,o)=>{n({...e,pin:e.pin??"",[t]:o})},C={display:"flex",flexDirection:"column",gap:8,width:"100%",...u},$={flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4},z={width:"100%",padding:"8px 10px",border:`1px solid ${h.border}`,borderRadius:8,background:h.surface,color:h.text,fontSize:14,outline:"none",minHeight:40},M={border:`1px solid ${h.border}`,borderRadius:8,background:h.surface,maxHeight:200,overflow:"auto",padding:4},N={padding:"8px 10px",borderRadius:6,cursor:"pointer",fontSize:13,color:h.text},I={fontSize:12,color:h.textMuted};return(0,a.jsxs)("div",{className:c,style:C,children:[i&&(0,a.jsx)("label",{htmlFor:`${m}-pin`,style:{fontSize:13,fontWeight:600},children:i}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,a.jsxs)("div",{style:{...$,flex:"0 0 140px"},children:[(0,a.jsx)("span",{style:I,children:"PIN code"}),(0,a.jsx)("input",{ref:p,id:`${m}-pin`,type:"text",inputMode:"numeric",maxLength:6,autoComplete:"postal-code",value:e.pin??"",onChange:t=>(t=>{const o=t.replace(/\D+/g,"").slice(0,6);n({...e,pin:o})})(t.target.value),disabled:d,"aria-busy":b,"aria-invalid":null!==v,style:z,placeholder:"000000"})]}),(0,a.jsxs)("div",{style:$,children:[(0,a.jsx)("span",{style:I,children:"City"}),(0,a.jsx)("input",{type:"text",autoComplete:"address-level2",value:e.city??"",onChange:t=>n({...e,city:t.target.value,pin:e.pin??""}),disabled:d,style:z})]}),(0,a.jsxs)("div",{style:$,children:[(0,a.jsx)("span",{style:I,children:"State"}),(0,a.jsx)("input",{type:"text",autoComplete:"address-level1",value:e.state??"",onChange:t=>n({...e,state:t.target.value,pin:e.pin??""}),disabled:d,style:z})]})]}),g.length>1&&(0,a.jsx)("div",{role:"listbox","aria-label":"Matching post offices",style:M,children:g.map(t=>(0,a.jsxs)("div",{role:"option","aria-selected":e.postOffice===t.Name,onClick:()=>k(t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),k(t))},tabIndex:0,style:{...N,background:e.postOffice===t.Name?h.surfaceAlt:"transparent"},children:[(0,a.jsx)("strong",{children:t.Name})," ",(0,a.jsxs)("span",{style:{color:h.textMuted},children:["· ",t.District,", ",t.State]})]},`${t.Pincode}-${t.Name}`))}),v&&(0,a.jsx)("div",{role:"alert",style:{fontSize:12,color:h.danger},children:v}),s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"text",autoComplete:"address-line1",placeholder:"Address line 1",value:e.line1??"",onChange:e=>S("line1",e.target.value),disabled:d,style:z}),(0,a.jsx)("input",{type:"text",autoComplete:"address-line2",placeholder:"Address line 2 (optional)",value:e.line2??"",onChange:e=>S("line2",e.target.value),disabled:d,style:z})]})]})});mr.displayName="TkxAddressInput";var gr=new Set(["JPY","KRW"]),xr=(0,l.forwardRef)(function({value:e,onChange:n,currency:o="INR",locale:r,label:i,min:s,max:d,precision:c,required:u,disabled:p,showSymbol:h=!0,id:f,name:m,className:g,style:x},b){const y=t.useTheme(),v=(0,l.useId)(),w=f??v,k=r??function(e){return"INR"===e?"en-IN":"PKR"===e?"ur-PK":"BDT"===e?"bn-BD":"JPY"===e?"ja-JP":"KRW"===e?"ko-KR":"CNY"===e?"zh-CN":"undefined"!=typeof navigator&&navigator.language?navigator.language:"en-US"}(o),S=c??(gr.has(o)?0:2),C=(0,l.useMemo)(()=>new Intl.NumberFormat(k,{minimumFractionDigits:0,maximumFractionDigits:S,useGrouping:!0}),[k,S]),$=(0,l.useMemo)(()=>{try{return new Intl.NumberFormat(k,{style:"currency",currency:o,currencyDisplay:"narrowSymbol",minimumFractionDigits:0,maximumFractionDigits:0}).formatToParts(0).find(e=>"currency"===e.type)?.value??o}catch{return o}},[k,o]),z=null===e||Number.isNaN(e)?"":C.format(e),M=(0,l.useCallback)(e=>{const t=e.replace(/[^\d.,\-]/g,""),o=C.format(1.5),r=o.includes(",")&&!o.includes(".")?",":".",i=t.replace(new RegExp(`[^\\d\\-${r}]`,"g"),"").replace(r,".");if(""===i||"-"===i)return void n(null);const l=Number(i);if(Number.isNaN(l))return;let a=l;void 0!==s&&a<s&&(a=s),void 0!==d&&a>d&&(a=d),n(a)},[C,s,d,n]),N={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:320,...x},I={display:"flex",alignItems:"stretch",border:`1px solid ${y.border}`,borderRadius:8,background:y.surface,overflow:"hidden"},L={display:"inline-flex",alignItems:"center",padding:"0 12px",borderRight:`1px solid ${y.border}`,color:y.textMuted,fontSize:14,fontVariantNumeric:"tabular-nums",background:y.bg},R={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:y.text,background:"transparent",minHeight:40,minWidth:0,textAlign:"right",fontVariantNumeric:"tabular-nums"};return(0,a.jsxs)("div",{className:g,style:N,children:[i&&(0,a.jsxs)("label",{htmlFor:w,style:{fontSize:13,fontWeight:600,color:y.text},children:[i,u&&(0,a.jsx)("span",{style:{color:y.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),(0,a.jsxs)("div",{style:I,children:[h&&(0,a.jsx)("span",{style:L,"aria-hidden":"true",children:$}),(0,a.jsx)("input",{ref:b,id:w,name:m,type:"text",inputMode:S>0?"decimal":"numeric",value:z,onChange:e=>M(e.target.value),disabled:p,required:u,"aria-label":i??`Amount in ${o}`,style:R})]})]})});xr.displayName="TkxCurrencyInput";var br=(0,l.forwardRef)(function({items:e,onChange:n,renderItem:o,orientation:r="vertical",disabled:i,className:s,style:d,ariaLabel:c},u){const p=t.useTheme(),h=(0,l.useId)(),[f,m]=(0,l.useState)(null),[g,x]=(0,l.useState)(null),b=(0,l.useRef)(null),y=(0,l.useCallback)((t,o)=>{if(t===o||t<0||o<0||o>=e.length)return;const r=[...e],[i]=r.splice(t,1);r.splice(o,0,i),n(r),b.current&&(b.current.textContent=`Moved item ${t+1} to position ${o+1}`)},[e,n]),v=e=>t=>{!i&&f&&(t.preventDefault(),t.dataTransfer.dropEffect="move",x(e))},w=()=>{m(null),x(null)},k=(t,n)=>t=>{if(i)return;const o="vertical"===r,l=o?"ArrowUp"===t.key:"ArrowLeft"===t.key,a=o?"ArrowDown"===t.key:"ArrowRight"===t.key;l&&n>0?(t.preventDefault(),y(n,n-1)):a&&n<e.length-1&&(t.preventDefault(),y(n,n+1))},S={display:"flex",flexDirection:"vertical"===r?"column":"row",gap:8,...d},C=e=>({cursor:i?"not-allowed":"grab",opacity:f===e?.5:1,transition:"opacity 0.15s, transform 0.05s",outline:g===e&&f!==e?`2px dashed ${p.primary}`:"none",outlineOffset:4,borderRadius:8});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:u,id:h,role:"list","aria-label":c??"Sortable list","aria-orientation":r,className:s,style:S,children:e.map((t,n)=>{return(0,a.jsx)("div",{role:"listitem",tabIndex:i?-1:0,draggable:!i,"data-tkx-sortable-handle":"true","aria-grabbed":f===t.id,"aria-posinset":n+1,"aria-setsize":e.length,onDragStart:(l=t.id,e=>{i||(m(l),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",l))}),onDragOver:v(t.id),onDragEnd:w,onDrop:(r=t.id,t=>{t.preventDefault(),!i&&f&&(y(e.findIndex(e=>e.id===f),e.findIndex(e=>e.id===r)),m(null),x(null))}),onKeyDown:k(t.id,n),style:C(t.id),children:o(t,n)},t.id);var r,l})}),(0,a.jsx)("div",{ref:b,role:"status","aria-live":"polite","aria-atomic":"true",style:{position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0}})]})});br.displayName="TkxSortable";var yr=["#00f5d4","#7b2ff7","#f72585","#ffbe0b","#06d6a0","#3a86ff"],vr=(0,l.forwardRef)(function({trigger:e,particleCount:t=80,spread:n=60,origin:r,colors:i=yr,zIndex:s=9999,className:d,style:c},u){const p=(0,l.useRef)(null),h=(0,l.useRef)([]),f=(0,l.useRef)(null),m=o.useReducedMotion(),g=(0,l.useCallback)(()=>{const e=p.current;if(!e)return;const t=window.devicePixelRatio||1;e.width=window.innerWidth*t,e.height=window.innerHeight*t,e.style.width="100vw",e.style.height="100vh";const n=e.getContext("2d");n&&n.scale(t,t)},[]);(0,l.useEffect)(()=>(g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)),[g]);const x=(0,l.useCallback)(()=>{const e=p.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const n=window.devicePixelRatio||1;t.clearRect(0,0,e.width/n,e.height/n);const o=h.current;for(const r of o)t.save(),t.globalAlpha=r.alpha,t.translate(r.x,r.y),t.rotate(r.rot*Math.PI/180),t.fillStyle=r.color,t.fillRect(-r.size/2,-r.size/4,r.size,r.size/2),t.restore()},[]),b=(0,l.useCallback)(()=>{const e=h.current;let t=!1;for(const n of e)n.ttl<=0||(n.x+=n.vx,n.y+=n.vy,n.vy+=.18,n.vx*=.99,n.rot+=n.vRot,n.ttl-=1,n.ttl<30&&(n.alpha=n.ttl/30),t=!0);e.length>1e3&&(h.current=e.filter(e=>e.ttl>0)),x(),f.current=t?requestAnimationFrame(b):null},[x]),y=(0,l.useCallback)(e=>{if(!p.current)return;const o=e?.x??r?.x??window.innerWidth/2,l=e?.y??r?.y??window.innerHeight/3,a=[];for(let r=0;r<t;r++){const e=((Math.random()-.5)*n-90)*(Math.PI/180),t=6+6*Math.random();a.push({x:o,y:l,vx:Math.cos(e)*t,vy:Math.sin(e)*t,rot:360*Math.random(),vRot:14*(Math.random()-.5),size:6+6*Math.random(),color:i[Math.floor(Math.random()*i.length)],alpha:1,ttl:90+Math.floor(30*Math.random())})}if(h.current.push(...a),m)return x(),void window.setTimeout(()=>{h.current=[],x()},1500);null===f.current&&(f.current=requestAnimationFrame(b))},[t,n,r,i,m,b,x]);return(0,l.useImperativeHandle)(u,()=>({fire:y}),[y]),(0,l.useEffect)(()=>{e&&y()},[e]),(0,l.useEffect)(()=>()=>{null!==f.current&&cancelAnimationFrame(f.current)},[]),(0,a.jsx)("canvas",{ref:p,"aria-hidden":"true",className:d,style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:s,...c}})});vr.displayName="TkxConfetti";var wr="data-tkx-seo";function kr(){"undefined"!=typeof document&&document.querySelectorAll(`[${wr}]`).forEach(e=>e.remove())}function Sr(e,t,n="name"){if("undefined"==typeof document||!t)return;const o=document.createElement("meta");o.setAttribute(n,e),o.content=t,o.setAttribute(wr,"1"),document.head.appendChild(o)}var Cr=["Pratipada","Dwitiya","Tritiya","Chaturthi","Panchami","Shashthi","Saptami","Ashtami","Navami","Dashami","Ekadashi","Dwadashi","Trayodashi","Chaturdashi","Purnima","Pratipada","Dwitiya","Tritiya","Chaturthi","Panchami","Shashthi","Saptami","Ashtami","Navami","Dashami","Ekadashi","Dwadashi","Trayodashi","Chaturdashi","Amavasya"],$r=["Ashwini","Bharani","Krittika","Rohini","Mrigashira","Ardra","Punarvasu","Pushya","Ashlesha","Magha","Purva Phalguni","Uttara Phalguni","Hasta","Chitra","Swati","Vishakha","Anuradha","Jyeshtha","Mula","Purva Ashadha","Uttara Ashadha","Shravana","Dhanishtha","Shatabhisha","Purva Bhadrapada","Uttara Bhadrapada","Revati"];function zr(e,t,n){try{return{gregorian:e,display:new Intl.DateTimeFormat(`${t}-u-ca-${n}`,{day:"numeric",month:"long",year:"numeric"}).format(e)}}catch{return{gregorian:e,display:e.toISOString().slice(0,10)}}}function Mr(e,t,n,o){switch(t){case"hindu":return function(e,t,n){const{tithi:o,nakshatra:r}=n?n(e):function(e){const t=function(e){return e.getTime()/864e5-10957.5}(e),n=function(e){return(280.46+.9856474*e)%360}(t),o=function(e){return(218.316+13.176396*e)%360}(t);let r=(o-n+360)%360;const i=Math.floor(r/12)+1,l=Math.floor(o%360/(360/27))+1;return{tithi:Math.max(1,Math.min(30,i)),nakshatra:l}}(e);return{gregorian:e,display:`${new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(e)} · ${o<=15?"Shukla":"Krishna"} ${Cr[o-1]} · ${$r[r-1]}`,tithi:o,nakshatra:r}}(e,n,o);case"hijri":return zr(e,n,"islamic-civil");case"hebrew":return zr(e,n,"hebrew");case"buddhist":return zr(e,n,"buddhist");default:return function(e,t){return{gregorian:e,display:new Intl.DateTimeFormat(t,{dateStyle:"long"}).format(e)}}(e,n)}}var Nr=(0,l.forwardRef)(function({value:e,onChange:n,calendar:o="gregorian",locale:i,tithiResolver:s,label:d,minDate:c,maxDate:u,disabled:p,className:h,style:f},m){const g=t.useTheme(),x=r.useLocale(),b=i??("undefined"!=typeof navigator?navigator.language:"en-US"),[y,v]=(0,l.useState)(!1),w=(0,l.useMemo)(()=>e?Mr(e,o,b,s).display:"",[e,o,b,s]),k={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...f},S={display:"flex",alignItems:"stretch",border:`1px solid ${g.border}`,borderRadius:8,background:g.surface,overflow:"hidden"},C={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:g.text,background:"transparent",minHeight:40,minWidth:0};return(0,a.jsxs)("div",{className:h,style:k,children:[d&&(0,a.jsx)("label",{style:{fontSize:13,fontWeight:600,color:g.text},children:d}),(0,a.jsxs)("div",{style:S,children:[(0,a.jsx)("input",{ref:m,type:"text",readOnly:!0,value:w,onClick:()=>!p&&v(!0),onFocus:()=>!p&&v(!0),disabled:p,placeholder:x.selectDate,"aria-label":d??x.selectDate,style:C}),(0,a.jsx)("input",{type:"date",value:e?e.toISOString().slice(0,10):"",onChange:e=>(e=>{if(!e)return;const t=new Date(`${e}T00:00:00`);Number.isNaN(t.getTime())||c&&t<c||u&&t>u||(n(Mr(t,o,b,s)),v(!1))})(e.target.value),min:c?c.toISOString().slice(0,10):void 0,max:u?u.toISOString().slice(0,10):void 0,disabled:p,"aria-hidden":"true",tabIndex:-1,style:{width:36,border:"none",borderLeft:`1px solid ${g.border}`,padding:0,background:g.bg,color:g.text,cursor:p?"not-allowed":"pointer"}})]}),y&&e&&"gregorian"!==o&&(0,a.jsxs)("div",{role:"status",style:{padding:"6px 10px",borderRadius:6,background:g.surfaceAlt,fontSize:12,color:g.textMuted},children:[(0,a.jsxs)("strong",{style:{color:g.text},children:[o,":"]})," ",w]})]})});Nr.displayName="TkxCalendarLunar";var Ir=(0,l.forwardRef)(function({items:e,currency:n,locale:o,taxRate:i=0,shipping:s=0,paymentConfigFor:d,onComplete:c,onCancel:u,initialAddress:p={},className:h,style:f},m){const g=t.useTheme(),x=r.useLocale(),[b,y]=(0,l.useState)("address"),[v,w]=(0,l.useState)(p),[k,S]=(0,l.useState)(null),[C,$]=(0,l.useState)(null),z=e.reduce((e,t)=>e+t.quantity*t.unitPrice,0),M=z*i,N=z+M+s,I=e=>{try{return new Intl.NumberFormat(o??"en-IN",{style:"currency",currency:n}).format(e)}catch{return`${n} ${e.toFixed(2)}`}},L=Boolean(v.pin&&6===v.pin.length&&v.line1&&v.city),R={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 320px",gap:24,maxWidth:960,width:"100%",...f},D={border:`1px solid ${g.border}`,borderRadius:12,padding:20,background:g.surface},T={...D,position:"sticky",top:16,height:"fit-content"},W={fontSize:11,fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",color:g.textMuted,marginBottom:12};return(0,a.jsxs)("div",{ref:m,className:h,style:R,children:[(0,a.jsxs)("div",{style:D,children:[(0,a.jsxs)("div",{style:W,children:["Step ","address"===b?1:"payment"===b?2:3," of 3"]}),"address"===b&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Shipping address"}),(0,a.jsx)(mr,{value:v,onChange:w}),C&&(0,a.jsx)("div",{role:"alert",style:{marginTop:12,fontSize:13,color:g.danger},children:C}),(0,a.jsxs)("div",{style:{marginTop:20,display:"flex",justifyContent:"flex-end",gap:8},children:[u&&(0,a.jsx)("button",{type:"button",onClick:u,style:{padding:"8px 14px",borderRadius:6,border:`1px solid ${g.border}`,background:"transparent",color:g.text,cursor:"pointer",fontSize:13,fontWeight:600},children:x.cancel}),(0,a.jsx)("button",{type:"button",onClick:async()=>{if(L){$(null);try{S(await d(v)),y("payment")}catch(e){$(e?.message??"Could not initialise payment")}}else $(x.fieldRequired??"Address incomplete")},disabled:!L,style:{padding:"8px 14px",borderRadius:6,border:"none",background:L?g.primary:g.border,color:L?g.bg:g.textMuted,cursor:L?"pointer":"not-allowed",fontSize:13,fontWeight:600,minHeight:36},children:"Continue to payment"})]})]}),"payment"===b&&k&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Payment"}),(0,a.jsxs)("p",{style:{margin:"0 0 16px",color:g.textMuted,fontSize:14},children:["Total ",(0,a.jsx)("strong",{style:{color:g.text,fontSize:18},children:I(N)})]}),(0,a.jsxs)(ur,{config:k,onSuccess:e=>{y("confirm"),c({address:v,payment:e})},onFailure:e=>{$(e.message)},size:"lg",children:["Pay ",I(N)]}),C&&(0,a.jsx)("div",{role:"alert",style:{marginTop:12,fontSize:13,color:g.danger},children:C}),(0,a.jsx)("div",{style:{marginTop:20},children:(0,a.jsx)("button",{type:"button",onClick:()=>y("address"),style:{padding:"6px 10px",border:"none",background:"transparent",color:g.textMuted,cursor:"pointer",fontSize:13},children:"← Back to address"})})]}),"confirm"===b&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Order confirmed"}),(0,a.jsx)("p",{style:{color:g.textMuted,fontSize:14,lineHeight:1.6},children:"Thank you. A receipt has been emailed to you. Your order will ship shortly."})]})]}),(0,a.jsxs)("div",{style:T,children:[(0,a.jsx)("div",{style:W,children:"Order summary"}),e.map(e=>(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"6px 0",fontSize:13},children:[(0,a.jsxs)("span",{style:{color:g.text},children:[e.label," ",(0,a.jsxs)("span",{style:{color:g.textMuted},children:["×",e.quantity]})]}),(0,a.jsx)("span",{style:{color:g.text,fontVariantNumeric:"tabular-nums"},children:I(e.quantity*e.unitPrice)})]},e.id)),(0,a.jsx)("hr",{style:{margin:"12px 0",border:0,borderTop:`1px solid ${g.border}`}}),i>0&&(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13,color:g.textMuted},children:[(0,a.jsxs)("span",{children:["Tax (",(100*i).toFixed(0),"%)"]}),(0,a.jsx)("span",{children:I(M)})]}),s>0&&(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13,color:g.textMuted},children:[(0,a.jsx)("span",{children:"Shipping"}),(0,a.jsx)("span",{children:I(s)})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginTop:12,paddingTop:12,borderTop:`2px solid ${g.text}`,fontSize:16,fontWeight:700},children:[(0,a.jsx)("span",{children:"Total"}),(0,a.jsx)("span",{children:I(N)})]})]})]})});Ir.displayName="TkxCheckout";var Lr=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],Rr=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]];function Dr(e){const t=e.replace(/\D+/g,"");if(12!==t.length)return!1;let n=0;const o=t.split("").reverse();for(let r=0;r<o.length;r++)n=Lr[n][Rr[r%8][parseInt(o[r],10)]];return 0===n}function Tr(e){const t=e.replace(/\D+/g,"").slice(0,12);return[t.slice(0,4),t.slice(4,8),t.slice(8,12)].filter(Boolean).join(" ")}function Wr(e){const t=e.replace(/\D+/g,"").slice(0,12);return 0===t.length?"":t.length<=8?"X".repeat(t.length).match(/.{1,4}/g).join(" "):`XXXX XXXX ${t.slice(8,12)}`}var Ar=(0,l.forwardRef)(function({value:e,defaultValue:n,onChange:o,label:i,mask:s=!0,disabled:d,required:c,id:u,name:p,className:h,style:f},m){const g=t.useTheme(),x=r.useLocale(),b=(0,l.useId)(),y=u??b,v=void 0!==e,[w,k]=(0,l.useState)(()=>(n??"").replace(/\D+/g,"").slice(0,12)),S=v?(e??"").replace(/\D+/g,"").slice(0,12):w,C=s?Wr(S):Tr(S),$=Dr(S),z={fontSize:13,fontWeight:600,color:g.text},M={width:"100%",padding:"0 12px",border:`1px solid ${12!==S.length||$?g.border:g.danger}`,borderRadius:8,background:g.surface,color:g.text,fontSize:14,minHeight:40,outline:"none",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",letterSpacing:1.5};return(0,a.jsxs)("div",{className:h,style:{display:"flex",flexDirection:"column",gap:6,...f},children:[i&&(0,a.jsxs)("label",{htmlFor:y,style:z,children:[i,c&&(0,a.jsx)("span",{style:{color:g.danger,marginLeft:4},children:"*"})]}),(0,a.jsx)("input",{ref:m,id:y,name:p,type:"text",inputMode:"numeric",autoComplete:"off",maxLength:14,value:C,onChange:e=>(e=>{const t=e.replace(/\D+/g,"").slice(0,12);v||k(t),o?.({raw:Tr(t),digits:t,display:s?Wr(t):Tr(t),valid:Dr(t)})})(e.target.value),disabled:d,required:c,"aria-invalid":12===S.length&&!$,"aria-describedby":12!==S.length||$?void 0:`${y}-err`,style:M,placeholder:"XXXX XXXX XXXX"}),12===S.length&&!$&&(0,a.jsx)("div",{id:`${y}-err`,role:"alert",style:{fontSize:12,color:g.danger},children:x.invalidFormat??"Invalid Aadhaar — checksum mismatch."}),S.length>0&&S.length<12&&(0,a.jsxs)("div",{style:{fontSize:12,color:g.textMuted},children:[12-S.length," digit",12-S.length==1?"":"s"," remaining"]})]})});Ar.displayName="TkxAadhaarInput";var Br=/^[A-Z]{5}[0-9]{4}[A-Z]$/;function Er(e){const t=e.toUpperCase().trim();return!!Br.test(t)&&"PFCHATBLJG".includes(t[3])}var Hr=(0,l.forwardRef)(function({value:e,defaultValue:n,onChange:o,label:i,disabled:s,required:d,id:c,name:u,className:p,style:h},f){const m=t.useTheme(),g=r.useLocale(),x=(0,l.useId)(),b=c??x,y=void 0!==e,[v,w]=(0,l.useState)((n??"").toUpperCase().slice(0,10)),k=(y?e??"":v).toUpperCase().slice(0,10),S=Er(k);return(0,a.jsxs)("div",{className:p,style:{display:"flex",flexDirection:"column",gap:6,...h},children:[i&&(0,a.jsxs)("label",{htmlFor:b,style:{fontSize:13,fontWeight:600,color:m.text},children:[i,d&&(0,a.jsx)("span",{style:{color:m.danger,marginLeft:4},children:"*"})]}),(0,a.jsx)("input",{ref:f,id:b,name:u,type:"text",inputMode:"text",autoComplete:"off",maxLength:10,value:k,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);y||w(t),o?.({raw:e,normalised:t,valid:Er(t)})})(e.target.value),disabled:s,required:d,"aria-invalid":10===k.length&&!S,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==k.length||S?m.border:m.danger}`,borderRadius:8,background:m.surface,color:m.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:2,outline:"none",textTransform:"uppercase"},placeholder:"ABCDE1234F"}),10===k.length&&!S&&(0,a.jsx)("div",{role:"alert",style:{fontSize:12,color:m.danger},children:g.invalidFormat??"Invalid PAN format."})]})});Hr.displayName="TkxPanInput";var Fr=/^[A-Z]{3}[0-9]{7}$/;function jr(e){const t=e.toUpperCase().trim();return Fr.test(t)}var Pr=(0,l.forwardRef)(function({value:e,defaultValue:n,onChange:o,label:i,disabled:s,required:d,id:c,name:u,className:p,style:h},f){const m=t.useTheme(),g=r.useLocale(),x=(0,l.useId)(),b=c??x,y=void 0!==e,[v,w]=(0,l.useState)((n??"").toUpperCase().slice(0,10)),k=(y?e??"":v).toUpperCase().slice(0,10),S=jr(k);return(0,a.jsxs)("div",{className:p,style:{display:"flex",flexDirection:"column",gap:6,...h},children:[i&&(0,a.jsxs)("label",{htmlFor:b,style:{fontSize:13,fontWeight:600,color:m.text},children:[i,d&&(0,a.jsx)("span",{style:{color:m.danger,marginLeft:4},children:"*"})]}),(0,a.jsx)("input",{ref:f,id:b,name:u,type:"text",autoComplete:"off",maxLength:10,value:k,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);y||w(t),o?.({raw:e,normalised:t,valid:jr(t)})})(e.target.value),disabled:s,required:d,"aria-invalid":10===k.length&&!S,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==k.length||S?m.border:m.danger}`,borderRadius:8,background:m.surface,color:m.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.5,outline:"none",textTransform:"uppercase"},placeholder:"ABC1234567"}),10===k.length&&!S&&(0,a.jsx)("div",{role:"alert",style:{fontSize:12,color:m.danger},children:g.invalidFormat??"Invalid Voter ID format."})]})});Pr.displayName="TkxVoterIdInput";var Or=15;function Vr(e){const t=e.toUpperCase().replace(/[\s-]/g,"");return t.length===Or&&/^[A-Z]{2}[0-9]{13}$/.test(t)}function Ur(e){const t=e.toUpperCase().replace(/[\s-]/g,"");return 0===t.length?"":[t.slice(0,2),t.slice(2,4),t.slice(4,8),t.slice(8)].filter(Boolean).join("-")}var Kr=(0,l.forwardRef)(function({value:e,defaultValue:n,onChange:o,label:i,disabled:s,required:d,id:c,name:u,className:p,style:h},f){const m=t.useTheme(),g=r.useLocale(),x=(0,l.useId)(),b=c??x,y=void 0!==e,[v,w]=(0,l.useState)((n??"").toUpperCase()),k=y?e??"":v,S=k.toUpperCase().replace(/[\s-]/g,"").slice(0,Or),C=Vr(S);return(0,a.jsxs)("div",{className:p,style:{display:"flex",flexDirection:"column",gap:6,...h},children:[i&&(0,a.jsxs)("label",{htmlFor:b,style:{fontSize:13,fontWeight:600,color:m.text},children:[i,d&&(0,a.jsx)("span",{style:{color:m.danger,marginLeft:4},children:"*"})]}),(0,a.jsx)("input",{ref:f,id:b,name:u,type:"text",autoComplete:"off",maxLength:20,value:k,onChange:e=>(e=>{const t=e.toUpperCase();y||w(t);const n=t.replace(/[\s-]/g,"").slice(0,Or);o?.({raw:e,normalised:n,pretty:Ur(n),valid:Vr(n)})})(e.target.value),disabled:s,required:d,"aria-invalid":S.length===Or&&!C,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${S.length!==Or||C?m.border:m.danger}`,borderRadius:8,background:m.surface,color:m.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.2,outline:"none",textTransform:"uppercase"},placeholder:"MH-12-2010-0012345"}),S.length===Or&&!C&&(0,a.jsx)("div",{role:"alert",style:{fontSize:12,color:m.danger},children:g.invalidFormat??"Invalid Driving Licence format."})]})});function Yr(e,t,n){try{return new Intl.NumberFormat(n??"en-US",{style:"currency",currency:t,maximumFractionDigits:e%1==0?0:2}).format(e)}catch{return`${t} ${e.toFixed(2)}`}}Kr.displayName="TkxDrivingLicenceInput";var qr=(0,l.forwardRef)(function({plans:e,cycle:n,selectedId:o,onSelect:r,className:i,style:l},s){const d=t.useTheme();return(0,a.jsx)("div",{ref:s,className:i,style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:16,...l},role:"radiogroup","aria-label":"Plans",children:e.map(e=>{const t=e.id===o;return(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":t,disabled:e.disabled,onClick:()=>!e.disabled&&r?.(e),style:{position:"relative",padding:20,borderRadius:12,border:`${e.highlighted?2:1}px solid ${t||e.highlighted?d.primary:d.border}`,background:d.surface,color:d.text,textAlign:"left",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,transition:"border-color 0.15s, transform 0.05s",fontFamily:"inherit",fontSize:"inherit",width:"100%"},children:[e.highlighted&&(0,a.jsx)("span",{style:{position:"absolute",top:-10,right:16,background:d.primary,color:d.bg,fontSize:11,fontWeight:700,padding:"2px 8px",borderRadius:4,letterSpacing:.4,textTransform:"uppercase"},"aria-hidden":"true",children:"Most popular"}),(0,a.jsx)("div",{style:{fontSize:12,fontWeight:700,color:d.textMuted,textTransform:"uppercase",letterSpacing:.5},children:e.name}),e.tagline&&(0,a.jsx)("div",{style:{fontSize:12,color:d.textMuted,marginTop:2},children:e.tagline}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:4,marginTop:12},children:[(0,a.jsx)("span",{style:{fontSize:32,fontWeight:800,color:d.text},children:Yr(e.prices[n],e.currency,e.locale)}),(0,a.jsxs)("span",{style:{fontSize:12,color:d.textMuted},children:["/ ","monthly"===n?"mo":"yr"]})]}),(0,a.jsx)("ul",{style:{listStyle:"none",padding:0,margin:"16px 0 0",fontSize:13,lineHeight:1.7},children:e.features.map(e=>(0,a.jsxs)("li",{style:{display:"flex",gap:6,alignItems:"flex-start",color:d.text},children:[(0,a.jsx)("span",{"aria-hidden":"true",style:{color:d.success},children:"✓"}),(0,a.jsx)("span",{children:e})]},e))}),(0,a.jsx)("div",{style:{marginTop:16,padding:"8px 12px",borderRadius:6,background:t?d.primary:"transparent",color:t?d.bg:d.primary,border:`1px solid ${d.primary}`,textAlign:"center",fontWeight:600,fontSize:13},children:e.ctaLabel??(t?"Selected":`Choose ${e.name}`)})]},e.id)})})});function Xr(e,t,n,o,r){if("vertical"===r){const r=e.x+n/2,i=e.y+o,l=t.x+n/2,a=t.y,s=(i+a)/2;return`M${r},${i} C${r},${s} ${l},${s} ${l},${a}`}const i=e.x+n,l=e.y+o/2,a=t.x,s=t.y+o/2,d=(i+a)/2;return`M${i},${l} C${d},${l} ${d},${s} ${a},${s}`}function Gr({node:e,w:t,h:o,isActive:r,theme:i}){const l=e.accent??i.primary,s=function(e){if(!e)return;const t=e.trim();return!t||/^javascript:/i.test(t)||/^vbscript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)?void 0:t}(e.avatar),d=n.sanitizeString(e.label),c=e.subLabel?n.sanitizeString(e.subLabel):"",u=e.badge?n.sanitizeString(e.badge):"";return(0,a.jsxs)("div",{style:{width:t,height:o,boxSizing:"border-box",background:i.surface,border:`1.5px solid ${r?l:i.border}`,borderRadius:12,padding:"10px 12px",display:"flex",alignItems:"center",gap:10,boxShadow:r?`0 8px 24px -8px ${l}66`:`0 2px 8px -4px ${i.border}88`,transition:"border-color 0.15s ease, box-shadow 0.15s ease",overflow:"hidden"},children:[(0,a.jsx)("div",{style:{width:40,height:40,minWidth:40,borderRadius:"50%",overflow:"hidden",background:`${l}22`,color:l,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,border:`1.5px solid ${l}44`},"aria-hidden":"true",children:s?(0,a.jsx)("img",{src:s,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",style:{width:"100%",height:"100%",objectFit:"cover"}}):d.slice(0,2).toUpperCase()}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontSize:13.5,fontWeight:700,color:i.text,lineHeight:1.25,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d}),c&&(0,a.jsx)("div",{style:{fontSize:11.5,color:i.textMuted,lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:1},children:c})]}),u&&(0,a.jsx)("span",{style:{fontSize:10,fontWeight:700,padding:"3px 7px",borderRadius:999,color:l,background:`${l}18`,border:`1px solid ${l}33`,letterSpacing:"0.04em",textTransform:"uppercase",flexShrink:0},children:u})]})}function _r({collapsed:e,onClick:t,theme:n,direction:o,w:r,h:i}){const l={position:"absolute",..."vertical"===o?{left:r/2-10,top:i-10}:{left:r-10,top:i/2-10},width:20,height:20,borderRadius:"50%",background:n.surfaceAlt,border:`1.5px solid ${n.border}`,color:n.text,fontSize:12,fontWeight:700,cursor:"pointer",padding:0,lineHeight:1,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center"};return(0,a.jsx)("button",{type:"button","aria-label":e?"Expand subtree":"Collapse subtree","aria-expanded":!e,onClick:e=>{e.stopPropagation(),t(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.stopPropagation(),t(e))},style:l,children:e?"+":"−"})}function Zr({data:e,direction:o="vertical",interactive:r=!0,initialZoom:i=1,nodeWidth:s=200,nodeHeight:d=84,siblingGap:c=28,levelGap:u=64,onNodeClick:p,renderNode:h,collapsedByDefault:f=!1,height:m=560,ariaLabel:g="Organization chart",className:x,style:b}){const y=t.useTheme(),v=(0,l.useRef)(null),w=(0,l.useRef)(null),[k,S]=(0,l.useState)(()=>{if(!f)return new Set;const t=new Set;return function n(o){o.id!==e.id&&t.add(o.id),(o.children??[]).forEach(n)}(e),t}),[C,$]=(0,l.useState)(Jr(i)),[z,M]=(0,l.useState)({x:0,y:0}),[N,I]=(0,l.useState)(e.id),L=(0,l.useMemo)(()=>function(e,t,n){const{nodeWidth:o,nodeHeight:r,siblingGap:i,levelGap:l,direction:a}=n,s=[],d=function e(n,o,r){const i=t.has(n.id),l={id:n.id,node:n,x:0,y:0,depth:o,parent:r,children:[],collapsed:i};if(!i)for(const t of n.children??[])l.children.push(e(t,o+1,l));return s.push(l),l}(e,0,null);let c=0;!function e(t){if(0===t.children.length)return t.x=c,void(c+=o+i);t.children.forEach(e),t.x=(t.children[0].x+t.children[t.children.length-1].x)/2}(d);for(const m of s)m.y=m.depth*(r+l);if("horizontal"===a)for(const m of s){const e=m.x;m.x=m.y,m.y=e}let u=1/0,p=1/0,h=-1/0,f=-1/0;for(const m of s)m.x<u&&(u=m.x),m.y<p&&(p=m.y),m.x>h&&(h=m.x),m.y>f&&(f=m.y);Number.isFinite(u)||(u=0,p=0,h=0,f=0);for(const m of s)m.x-=u,m.y-=p;return{nodes:s,width:h-u+o,height:f-p+r}}(e,k,{nodeWidth:s,nodeHeight:d,siblingGap:c,levelGap:u,direction:o}),[e,k,s,d,c,u,o]),R=(0,l.useCallback)(e=>{S(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);(0,l.useEffect)(()=>{if(!r)return;const e=v.current;if(!e)return;const t=e=>{if(!e.ctrlKey&&!e.metaKey){if(Math.abs(e.deltaY)<4&&Math.abs(e.deltaX)<4)return;return M(t=>({x:t.x-e.deltaX,y:t.y-e.deltaY})),void e.preventDefault()}e.preventDefault();const t=e.deltaY<0?.1:-.1;$(e=>Jr(e+t))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[r]),(0,l.useEffect)(()=>{if(!r)return;const e=v.current;if(!e)return;let t=!1,n=0,o=0,i=0,l=0;const a=r=>{r.target.closest('button, [role="treeitem"], a, input')||(t=!0,n=r.clientX,o=r.clientY,i=z.x,l=z.y,e.setPointerCapture(r.pointerId))},s=e=>{t&&M({x:i+(e.clientX-n),y:l+(e.clientY-o)})},d=n=>{t=!1;try{e.releasePointerCapture(n.pointerId)}catch{}};return e.addEventListener("pointerdown",a),e.addEventListener("pointermove",s),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("pointerdown",a),e.removeEventListener("pointermove",s),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d)}},[r,z]);const D=(0,l.useCallback)(e=>{const t=L.nodes.find(e=>e.id===N);if(t)if("ArrowRight"===e.key||"ArrowDown"===e.key){const n=t.children[0];n&&(I(n.id),e.preventDefault())}else"ArrowLeft"===e.key||"ArrowUp"===e.key?t.parent&&(I(t.parent.id),e.preventDefault()):"Enter"===e.key||" "===e.key?(p?.(t.node),e.preventDefault()):"+"===e.key||"="===e.key?$(e=>Jr(e+.1)):"-"===e.key?$(e=>Jr(e-.1)):"0"===e.key&&($(1),M({x:0,y:0}))},[N,L,p]),T=(0,l.useMemo)(()=>{const e=[];for(const t of L.nodes)for(const n of t.children)e.push({id:`${t.id}→${n.id}`,d:Xr(t,n,s,d,o)});return e},[L,s,d,o]),W={position:"relative",width:"100%",height:m,overflow:"hidden",borderRadius:12,background:y.bg,border:`1px solid ${y.border}`,touchAction:"none",cursor:r?"grab":"default",boxSizing:"border-box",...b},A={position:"absolute",left:"50%",top:24,width:L.width,height:L.height,transform:`translate(calc(-50% + ${z.x}px), ${z.y}px) scale(${C})`,transformOrigin:"top center",transition:"transform 0.08s ease-out"};return(0,a.jsxs)("div",{ref:v,className:x,style:W,role:"tree","aria-label":n.sanitizeString(g),tabIndex:0,onKeyDown:D,children:[r&&(0,a.jsxs)("div",{style:{position:"absolute",top:12,right:12,zIndex:3,display:"flex",gap:6,background:y.surface,border:`1px solid ${y.border}`,borderRadius:8,padding:4,boxShadow:`0 4px 12px -6px ${y.border}88`},children:[(0,a.jsx)(Qr,{theme:y,label:"Zoom out",onClick:()=>$(e=>Jr(e-.1)),children:"−"}),(0,a.jsx)(Qr,{theme:y,label:"Reset zoom",onClick:()=>{$(1),M({x:0,y:0})},children:"⟳"}),(0,a.jsx)(Qr,{theme:y,label:"Zoom in",onClick:()=>$(e=>Jr(e+.1)),children:"+"})]}),(0,a.jsxs)("div",{ref:w,style:A,children:[(0,a.jsx)("svg",{width:L.width,height:L.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none"},"aria-hidden":"true",children:T.map(e=>(0,a.jsx)("path",{d:e.d,fill:"none",stroke:y.border,strokeWidth:1.5},e.id))}),L.nodes.map(e=>{const t=(e.node.children?.length??0)>0,r=e.id===N;return(0,a.jsxs)("div",{role:"treeitem","aria-label":n.sanitizeString(e.node.label),"aria-selected":r,"aria-level":e.depth+1,"aria-expanded":t?!e.collapsed:void 0,tabIndex:-1,onClick:t=>{t.stopPropagation(),I(e.id),p?.(e.node)},style:{position:"absolute",left:e.x,top:e.y,width:s,height:d,cursor:p?"pointer":"default"},children:[h?h(e.node,r):(0,a.jsx)(Gr,{node:e.node,w:s,h:d,isActive:r,theme:y}),t&&(0,a.jsx)(_r,{collapsed:e.collapsed,onClick:()=>R(e.id),theme:y,direction:o,w:s,h:d})]},e.id)})]})]})}function Jr(e){return e<.25?.25:e>4?4:e}function Qr({children:e,onClick:t,label:n,theme:o}){return(0,a.jsx)("button",{type:"button","aria-label":n,onClick:t,style:{width:28,height:28,borderRadius:6,background:"transparent",border:"none",color:o.text,fontSize:14,fontWeight:700,cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:e=>{e.currentTarget.style.background=o.surfaceAlt},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:e})}function ei(e,t,n,o){const r=e.getBoundingClientRect(),i=t?t.offsetHeight:320,l=t?t.offsetWidth:200,a=window.innerWidth,s=window.innerHeight,d=window.scrollX,c=window.scrollY;let u=0,p=0;switch(n){case"bottom-start":default:u=r.bottom+c+o,p=r.left+d;break;case"bottom-end":u=r.bottom+c+o,p=r.right+d-l;break;case"top-start":u=r.top+c-o-i,p=r.left+d;break;case"top-end":u=r.top+c-o-i,p=r.right+d-l;break;case"right":u=r.top+c,p=r.right+d+o;break;case"left":u=r.top+c,p=r.left+d-o-l}return n.startsWith("bottom")&&r.bottom+i>s&&(u=r.top+c-o-i),n.startsWith("top")&&r.top-i<0&&(u=r.bottom+c+o),p+l>a+d&&(p=a+d-l-8),p<d&&(p=d+8),{top:u,left:p,minWidth:r.width}}function ti(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return-1===n?e:(0,a.jsxs)(a.Fragment,{children:[e.slice(0,n),(0,a.jsx)("mark",{style:{background:"rgba(0,245,212,0.3)",color:"inherit",borderRadius:2},children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function ni({groups:e,position:o,maxHeight:i,minWidth:s,selectedKeys:d,multiSelect:c,searchable:u,searchPlaceholder:p,onSelect:h,onClose:f,renderItem:m,menuRef:g,isPortal:x,menuId:b}){const y=t.useTheme(),v=r.useLocale(),w=p??`${v.search}…`,[k,S]=(0,l.useState)(""),[C,$]=(0,l.useState)(0),[z,M]=(0,l.useState)(null),[N,I]=(0,l.useState)(0),L=(0,l.useRef)(null),R=(0,l.useRef)([]),D=(0,l.useRef)([]),T=k?e.map(e=>({...e,items:e.items.filter(e=>e.label.toLowerCase().includes(k.toLowerCase())||e.description?.toLowerCase().includes(k.toLowerCase())||e.children?.some(e=>e.label.toLowerCase().includes(k.toLowerCase())))})).filter(e=>e.items.length>0):e,W=function(e,t){const n=[];for(const o of e)for(const e of o.items)e.disabled||t&&!e.label.toLowerCase().includes(t.toLowerCase())||n.push(e);return n}(T,k);(0,l.useEffect)(()=>{u&&L.current?L.current.focus():R.current[0]?.focus(),$(0)},[u]),(0,l.useEffect)(()=>{u&&""===k||R.current[C]?.focus()},[C,u,k]);const A=(0,l.useCallback)(e=>{switch(e.key){case"ArrowDown":if(e.preventDefault(),z){const e=(W.find(e=>e.key===z)?.children??[]).filter(e=>!e.disabled);I(t=>Math.min(t+1,e.length-1))}else $(e=>Math.min(e+1,W.length-1));break;case"ArrowUp":e.preventDefault(),z?I(e=>Math.max(e-1,0)):$(e=>Math.max(e-1,0));break;case"ArrowRight":{e.preventDefault();const t=W[C];t?.children?.length&&(M(t.key),I(0));break}case"ArrowLeft":e.preventDefault(),M(null);break;case"Enter":case" ":if(e.preventDefault(),z){const e=(W.find(e=>e.key===z)?.children??[]).filter(e=>!e.disabled)[N];e&&h(e.key,e)}else{const e=W[C];e&&h(e.key,e)}break;case"Escape":e.preventDefault(),z?M(null):f();break;case"Tab":f()}},[W,C,f,h,z,N]);(0,l.useEffect)(()=>{z&&D.current[N]?.focus()},[N,z]);const B={position:x?"fixed":"absolute",top:x?o.top:void 0,left:x?o.left:void 0,minWidth:Math.max(s,o.minWidth),maxHeight:i,overflowY:"auto",background:y.surface,border:`1px solid ${y.border}`,borderRadius:8,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",zIndex:9999,outline:"none",transformOrigin:"top left",animation:"tkx-dropdown-in 150ms ease forwards"};let E=0;return(0,a.jsxs)("div",{ref:g,id:b,role:"menu","aria-label":"Dropdown menu",tabIndex:-1,style:B,onKeyDown:A,children:[(0,a.jsx)("style",{children:"\n @keyframes tkx-dropdown-in {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "}),u&&(0,a.jsx)("div",{style:{padding:"8px 8px 4px"},children:(0,a.jsx)("input",{ref:L,type:"text",value:k,onChange:e=>{S(e.target.value),$(0)},placeholder:w,"aria-label":`${v.search} items`,style:{width:"100%",boxSizing:"border-box",padding:"6px 10px",background:y.surfaceAlt,border:`1px solid ${y.border}`,borderRadius:6,color:y.text,fontSize:13,outline:"none"}})}),0===T.length&&(0,a.jsx)("div",{style:{padding:"12px 16px",color:y.textMuted,fontSize:13,textAlign:"center"},children:"No results found"}),T.map((e,t)=>(0,a.jsxs)("div",{role:"group","aria-label":e.label,children:[e.label&&(0,a.jsx)("div",{style:{padding:"8px 12px 4px",fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:y.textMuted},children:n.sanitizeString(e.label)}),e.items.map(e=>{const t=E;e.disabled||E++;const n=d.includes(e.key),o=t===C&&!e.disabled,r=!!e.children?.length,i=z===e.key,l=m?m(e,n):(0,a.jsx)(oi,{item:e,isSelected:n,isFocused:o,multiSelect:c,query:k,theme:y,hasSubmenu:r});return(0,a.jsxs)("div",{children:[e.divider&&(0,a.jsx)("div",{role:"separator",style:{height:1,background:y.border,margin:"4px 0"}}),(0,a.jsxs)("div",{ref:e=>{R.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-checked":c?n:void 0,"aria-selected":c?void 0:n,"aria-haspopup":r?"menu":void 0,"aria-expanded":r?i:void 0,tabIndex:e.disabled?-1:0,style:{position:"relative",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:()=>{e.disabled||(r?(M(i?null:e.key),I(0)):h(e.key,e))},onMouseEnter:()=>{e.disabled||($(t),r?(M(e.key),I(0)):M(null))},onFocus:()=>{e.disabled||$(t)},children:[l,r&&i&&(0,a.jsx)("div",{role:"menu",style:{position:"absolute",top:0,left:"100%",minWidth:180,background:y.surface,border:`1px solid ${y.border}`,borderRadius:8,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",zIndex:1e4,animation:"tkx-dropdown-in 120ms ease forwards"},children:e.children.map((e,t)=>{const n=d.includes(e.key),o=t===N;return(0,a.jsx)("div",{ref:e=>{D.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-selected":n,tabIndex:e.disabled?-1:0,style:{cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:t=>{t.stopPropagation(),e.disabled||h(e.key,e)},onMouseEnter:()=>I(t),children:(0,a.jsx)(oi,{item:e,isSelected:n,isFocused:o,multiSelect:c,query:k,theme:y,hasSubmenu:!1})},e.key)})})]})]},e.key)})]},t))]})}function oi({item:e,isSelected:t,isFocused:n,multiSelect:o,query:r,theme:i,hasSubmenu:l}){return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:n?e.danger?`${i.danger}20`:`${i.primary}18`:"transparent",transition:"background 80ms",color:e.danger?i.danger:i.text,fontSize:14,userSelect:"none"},children:[o&&(0,a.jsx)("div",{style:{width:16,height:16,border:`2px solid ${t?i.primary:i.border}`,borderRadius:4,background:t?i.primary:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 120ms"},children:t&&(0,a.jsx)("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:(0,a.jsx)("path",{d:"M1 4l3 3L9 1",stroke:i.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.icon&&(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",flexShrink:0,color:e.danger?i.danger:i.textMuted},children:e.icon}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontWeight:t&&!o?600:400},children:ti(e.label,r)}),e.description&&(0,a.jsx)("div",{style:{fontSize:12,color:i.textMuted,marginTop:1},children:ti(e.description,r)})]}),void 0!==e.badge&&(0,a.jsx)("span",{style:{background:i.primary,color:i.bg,fontSize:11,fontWeight:700,borderRadius:10,padding:"1px 7px",flexShrink:0},children:e.badge}),e.shortcut&&!l&&(0,a.jsx)("span",{style:{fontSize:12,color:i.textMuted,flexShrink:0},children:e.shortcut}),l&&(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M4 2l4 4-4 4",stroke:i.textMuted,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),!o&&t&&(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M2 7l4 4L12 3",stroke:i.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})}Zr.displayName="TkxOrgChart";var ri={sm:4,md:8,lg:12};function ii({src:e,name:n,size:o=32}){const r=t.useTheme(),i=n?n.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():"?";return e?(0,a.jsx)("img",{src:e,alt:n??"avatar",width:o,height:o,style:{borderRadius:"50%",objectFit:"cover",flexShrink:0}}):(0,a.jsx)("div",{style:{width:o,height:o,borderRadius:"50%",flexShrink:0,background:`${r.primary}22`,border:`1px solid ${r.primary}44`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:.35*o,fontWeight:700,color:r.primary},children:i})}function li({color:e}){return(0,a.jsx)("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[0,1,2].map(t=>(0,a.jsx)("div",{style:{width:7,height:7,borderRadius:"50%",background:e,animation:`tkx-thinking-dot 1.2s ease-in-out ${.18*t}s infinite`}},t))})}function ai({color:e}){return(0,a.jsxs)("div",{style:{position:"relative",width:24,height:24},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:e,opacity:.15,animation:"tkx-thinking-pulse 1.5s ease-out infinite"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:4,borderRadius:"50%",background:e,opacity:.6,animation:"tkx-thinking-pulse 1.5s ease-out 0.3s infinite"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:8,borderRadius:"50%",background:e}})]})}function si({color:e}){return(0,a.jsx)("div",{style:{display:"flex",gap:3,alignItems:"center",height:20},children:[0,1,2,3,4].map(t=>(0,a.jsx)("div",{style:{width:3,borderRadius:3,background:e,animation:`tkx-thinking-wave 1s ease-in-out ${.1*t}s infinite`}},t))})}function di({color:e}){return(0,a.jsxs)("div",{style:{position:"relative",width:28,height:28},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:`2px solid ${e}33`}}),(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:"2px solid transparent",borderTopColor:e,animation:"tkx-thinking-orbit 0.8s linear infinite"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:"38%",borderRadius:"50%",background:e,opacity:.8}})]})}var ci={sm:12,md:14,lg:16},ui=!1,pi="tkx-holographic-styles";function hi(e={}){const{maxTilt:t=14,disabled:n=!1}=e,r=(0,l.useRef)(null),i=o.useReducedMotion(),a=(0,l.useRef)(null),s=(0,l.useRef)({rx:0,ry:0,mx:50,my:50});return(0,l.useEffect)(()=>{!function(){if(ui||"undefined"==typeof document)return;if(document.getElementById(pi))return void(ui=!0);ui=!0;const e=document.createElement("style");e.id=pi,e.textContent="\n@keyframes tkx-holo-shimmer {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n}\n@keyframes tkx-holo-snapback {\n to { --tkx-holo-rx: 0deg; --tkx-holo-ry: 0deg; --tkx-holo-mx: 50%; --tkx-holo-my: 50%; }\n}\n.tkx-holo-root {\n --tkx-holo-rx: 0deg;\n --tkx-holo-ry: 0deg;\n --tkx-holo-mx: 50%;\n --tkx-holo-my: 50%;\n position: relative;\n transform-style: preserve-3d;\n transform: perspective(1000px) rotateX(var(--tkx-holo-rx)) rotateY(var(--tkx-holo-ry));\n transition: transform 280ms cubic-bezier(.2,.8,.2,1);\n will-change: transform;\n isolation: isolate;\n}\n.tkx-holo-root.tkx-holo-tracking {\n transition: none;\n}\n.tkx-holo-foil {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n background:\n radial-gradient(circle at var(--tkx-holo-mx) var(--tkx-holo-my),\n rgba(255,255,255,0.32) 0%,\n rgba(255,255,255,0.08) 22%,\n transparent 55%),\n conic-gradient(from calc(var(--tkx-holo-mx) * 3.6deg) at 50% 50%,\n #ff006e, #ffbe0b, #06d6a0, #00f5d4, #3a86ff, #7b2ff7, #ff006e);\n background-size: 100% 100%, 280% 280%;\n background-position: 0 0, var(--tkx-holo-mx) var(--tkx-holo-my);\n mix-blend-mode: color-dodge;\n opacity: 0.55;\n filter: saturate(1.4) contrast(1.1);\n}\n.tkx-holo-foil.tkx-holo-foil-soft {\n mix-blend-mode: overlay;\n opacity: 0.35;\n}\n.tkx-holo-scan {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n background: repeating-linear-gradient(\n 180deg,\n rgba(255,255,255,0.06) 0px,\n rgba(255,255,255,0.06) 1px,\n transparent 1px,\n transparent 3px\n );\n mix-blend-mode: overlay;\n opacity: 0.5;\n}\n.tkx-holo-content {\n position: relative;\n z-index: 1;\n transform: translateZ(20px);\n}\n.tkx-holo-root:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: 4px;\n}\n@media (prefers-reduced-motion: reduce) {\n .tkx-holo-root, .tkx-holo-root.tkx-holo-tracking {\n transform: none !important;\n transition: none;\n }\n .tkx-holo-content { transform: none !important; }\n .tkx-holo-foil { animation: tkx-holo-shimmer 8s ease infinite; }\n}",document.head.appendChild(e)}()},[]),(0,l.useEffect)(()=>{const e=r.current;if(e&&!n&&!i)return e.addEventListener("pointermove",d),e.addEventListener("pointerleave",c),()=>{e.removeEventListener("pointermove",d),e.removeEventListener("pointerleave",c),null!=a.current&&cancelAnimationFrame(a.current)};function o(){if(!e)return;const{rx:t,ry:n,mx:o,my:r}=s.current;e.style.setProperty("--tkx-holo-rx",`${t}deg`),e.style.setProperty("--tkx-holo-ry",`${n}deg`),e.style.setProperty("--tkx-holo-mx",`${o}%`),e.style.setProperty("--tkx-holo-my",`${r}%`),a.current=null}function l(){null==a.current&&(a.current=requestAnimationFrame(o))}function d(n){const o=e.getBoundingClientRect(),r=(n.clientX-o.left)/o.width,i=(n.clientY-o.top)/o.height,a=Math.max(0,Math.min(1,r)),d=Math.max(0,Math.min(1,i));s.current={rx:(.5-d)*t*2,ry:(a-.5)*t*2,mx:100*a,my:100*d},e.classList.add("tkx-holo-tracking"),l()}function c(){s.current={rx:0,ry:0,mx:50,my:50},e.classList.remove("tkx-holo-tracking"),l()}},[t,n,i]),r}var fi=(0,l.forwardRef)(function({children:e,maxTilt:n=14,scanLines:o=!0,foilIntensity:r="strong",radius:i=16,disabled:s=!1,className:d,style:c,...u},p){const h=t.useTheme(),f=hi({maxTilt:n,disabled:s});(0,l.useEffect)(()=>{if(!p)return;const e=f.current;"function"==typeof p?p(e):p.current=e},[p,f]);const m={borderRadius:"number"==typeof i?`${i}px`:i,background:`linear-gradient(135deg, ${h.surface}cc, ${h.surfaceAlt}cc)`,border:`1px solid ${h.border}`,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:h.text,...c};return(0,a.jsxs)("div",{ref:f,className:["tkx-holo-root",d].filter(Boolean).join(" "),style:m,...u,children:["none"!==r&&(0,a.jsx)("div",{className:"tkx-holo-foil "+("soft"===r?"tkx-holo-foil-soft":""),"aria-hidden":"true"}),o&&(0,a.jsx)("div",{className:"tkx-holo-scan","aria-hidden":"true"}),(0,a.jsx)("div",{className:"tkx-holo-content",children:e})]})}),mi=(0,l.forwardRef)(function({title:e,subtitle:n,badge:o,children:r,padding:i=24,...s},d){const c=t.useTheme(),u=(0,l.useId)(),p="number"==typeof i?`${i}px`:i;return(0,a.jsx)(fi,{ref:d,role:"article","aria-labelledby":e?u:void 0,...s,style:{minHeight:200,...s.style},children:(0,a.jsxs)("div",{style:{padding:p},children:[(e||o)&&(0,a.jsxs)("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12,marginBottom:n?4:12},children:[e&&(0,a.jsx)("h3",{id:u,style:{margin:0,fontSize:20,fontWeight:700,letterSpacing:"-0.01em",color:c.text},children:e}),o]}),n&&(0,a.jsx)("p",{style:{margin:"0 0 16px",color:c.textMuted,fontSize:14},children:n}),r]})})}),gi=(0,l.forwardRef)(function({src:e,alt:n,size:o=96,initials:r,scanLines:i=!1,...l},s){const d=t.useTheme();return(0,a.jsx)(fi,{ref:s,radius:"50%",scanLines:i,...l,style:{width:o,height:o,...l.style},children:e?(0,a.jsx)("img",{src:e,alt:n,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover",display:"block"}}):(0,a.jsx)("div",{role:"img","aria-label":n,style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:.36*o,fontWeight:700,color:d.text},children:r??n.charAt(0).toUpperCase()})})}),xi={sm:"4px 10px",md:"6px 14px",lg:"8px 18px"},bi={sm:11,md:13,lg:15},yi=(0,l.forwardRef)(function({children:e,size:t="md",scanLines:n=!1,...o},r){return(0,a.jsx)(fi,{ref:r,radius:999,scanLines:n,maxTilt:6,...o,style:{display:"inline-flex",padding:xi[t],fontSize:bi[t],fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",...o.style},children:e})}),vi=(0,l.forwardRef)(function({children:e,onClick:n,isDisabled:r=!1,type:i="button",maxTilt:s=8,...d},c){const u=t.useTheme(),p=o.useReducedMotion(),h=(0,l.useRef)(null),f=hi({maxTilt:s,disabled:r});return(0,l.useEffect)(()=>{const e=h.current;e&&(f.current=e,"function"==typeof c?c(e):c&&(c.current=e))},[c,f]),(0,a.jsxs)("button",{ref:h,type:i,onClick:r?void 0:n,disabled:r,className:"tkx-holo-root",style:{position:"relative",padding:"14px 28px",fontSize:15,fontWeight:700,letterSpacing:"0.02em",color:u.text,background:`linear-gradient(135deg, ${u.surface}, ${u.surfaceAlt})`,border:`1px solid ${u.primary}55`,borderRadius:12,cursor:r?"not-allowed":"pointer",opacity:r?.5:1,minHeight:44,transformStyle:"preserve-3d",...d.style},...d,children:[(0,a.jsx)("span",{className:"tkx-holo-foil","aria-hidden":"true"}),(0,a.jsx)("span",{className:"tkx-holo-content",style:{display:"inline-block"},children:e}),!p&&!r&&(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",inset:-1,borderRadius:12,border:`1px solid ${u.primary}88`,boxShadow:`0 0 24px ${u.primary}44`,pointerEvents:"none",opacity:.6}})]})}),wi=(0,l.forwardRef)(function({columns:e,onReorder:n,renderCard:r,onCardClick:i,maxHeight:s=720,minColumnWidth:d=280,isDragDisabled:c=!1,className:u,style:p},h){const f=t.useTheme(),m=o.useReducedMotion();(0,l.useId)();const[g,x]=(0,l.useState)(null),[b,y]=(0,l.useState)(""),v=(0,l.useRef)(new Map),w=(0,l.useCallback)((e,t,n,o)=>{c||t.isDragDisabled||0!==e.button&&"mouse"===e.pointerType||(e.currentTarget.setPointerCapture(e.pointerId),x({cardId:t.id,fromColumnId:n.id,fromIndex:o,mode:"pointer",ghostX:0,ghostY:0,toColumnId:n.id,toIndex:o}),y(`Picked up "${t.title}" from ${n.title}, position ${o+1}`))},[c]),k=(0,l.useCallback)((e,t,n)=>{if(!g||"pointer"!==g.mode)return;e.currentTarget;const o=v.current.get(g.cardId);if(!o)return;const r=o.getBoundingClientRect();x(o=>o?{...o,ghostX:e.clientX-(r.left+r.width/2),ghostY:e.clientY-(r.top+r.height/2),toColumnId:t.id,toIndex:n}:o)},[g]),S=(0,l.useCallback)(()=>{g&&"pointer"===g.mode&&$(g)},[g]),C=(0,l.useCallback)(()=>{g&&(y("Drag cancelled"),x(null))},[g]);function $(t){if(t.fromColumnId!==t.toColumnId||t.fromIndex!==t.toIndex){const o=e.find(e=>e.id===t.toColumnId),r=e.find(e=>e.id===t.fromColumnId)?.cards[t.fromIndex];n({cardId:t.cardId,fromColumnId:t.fromColumnId,fromIndex:t.fromIndex,toColumnId:t.toColumnId,toIndex:t.toIndex}),y(r&&o?`Moved "${r.title}" to ${o.title}, position ${t.toIndex+1}`:"Card moved")}else y("Returned to original position");x(null)}const z=(0,l.useCallback)((t,n,o,r)=>{if(c||n.isDragDisabled)return;if(" "===t.key||"Enter"===t.key)return t.preventDefault(),void(g?$(g):(x({cardId:n.id,fromColumnId:o.id,fromIndex:r,mode:"keyboard",toColumnId:o.id,toIndex:r}),y(`Grabbed "${n.title}". Use arrow keys to move. Enter to drop, Esc to cancel.`)));if("Escape"===t.key&&g)return t.preventDefault(),void C();if(!g||"keyboard"!==g.mode||g.cardId!==n.id)return;const i=e.findIndex(e=>e.id===g.toColumnId),l=e[i];if(l)switch(t.key){case"ArrowUp":t.preventDefault(),g.toIndex>0&&(x({...g,toIndex:g.toIndex-1}),y(`Position ${g.toIndex} of ${l.cards.length}`));break;case"ArrowDown":t.preventDefault(),g.toIndex<l.cards.length&&(x({...g,toIndex:g.toIndex+1}),y(`Position ${g.toIndex+2} of ${l.cards.length+1}`));break;case"ArrowLeft":if(t.preventDefault(),i>0){const t=e[i-1];x({...g,toColumnId:t.id,toIndex:Math.min(g.toIndex,t.cards.length)}),y(`Moved to ${t.title}`)}break;case"ArrowRight":if(t.preventDefault(),i<e.length-1){const t=e[i+1];x({...g,toColumnId:t.id,toIndex:Math.min(g.toIndex,t.cards.length)}),y(`Moved to ${t.title}`)}}},[e,g,C,c]);(0,l.useEffect)(()=>{if(!g)return;const e=e=>{"Escape"===e.key&&C()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,C]);const M=(0,l.useCallback)(e=>(0,a.jsxs)(a.Fragment,{children:[e.badges&&e.badges.length>0&&(0,a.jsx)("div",{style:{display:"flex",gap:6,marginBottom:8,flexWrap:"wrap"},children:e.badges.map((e,t)=>(0,a.jsx)("span",{style:{padding:"2px 8px",fontSize:10,fontWeight:700,borderRadius:999,background:e.color?`${e.color}22`:`${f.primary}22`,color:e.color??f.primary,letterSpacing:"0.05em",textTransform:"uppercase"},children:e.label},t))}),(0,a.jsx)("div",{style:{fontSize:14,fontWeight:600,color:f.text,lineHeight:1.4},children:e.title}),e.description&&(0,a.jsx)("div",{style:{fontSize:12,color:f.textMuted,marginTop:6,lineHeight:1.5},children:e.description}),e.assignee&&(0,a.jsxs)("div",{style:{marginTop:10,display:"flex",alignItems:"center",gap:6,fontSize:11,color:f.textMuted},children:[e.assignee.avatarUrl?(0,a.jsx)("img",{src:e.assignee.avatarUrl,alt:"",style:{width:20,height:20,borderRadius:"50%"}}):(0,a.jsx)("div",{"aria-hidden":"true",style:{width:20,height:20,borderRadius:"50%",background:f.primary,color:f.bg,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:700},children:e.assignee.name.charAt(0).toUpperCase()}),(0,a.jsx)("span",{children:e.assignee.name})]})]}),[f]),N=(0,l.useMemo)(()=>({display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${d}px, 1fr)`,gap:12,overflowX:"auto",maxHeight:"number"==typeof s?`${s}px`:s,padding:4,...p}),[s,d,p]);return(0,a.jsxs)("div",{ref:h,className:u,role:"grid","aria-label":"Kanban board","aria-rowcount":Math.max(...e.map(e=>e.cards.length),0)+1,"aria-colcount":e.length,style:N,children:[(0,a.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:b}),e.map((e,t)=>{const n=g?.toColumnId===e.id,o=void 0!==e.wipLimit&&e.cards.length>=e.wipLimit;return(0,a.jsxs)("section",{role:"row","aria-rowindex":t+1,"aria-label":`Column: ${e.title}`,style:{background:f.surface,border:`1px solid ${n?e.color??f.primary:f.border}`,borderRadius:12,display:"flex",flexDirection:"column",minHeight:0,transition:"border-color 120ms"},children:[(0,a.jsxs)("header",{style:{padding:"12px 14px",borderBottom:`1px solid ${f.border}`,display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[(0,a.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:e.color??f.primary}}),(0,a.jsx)("h3",{style:{margin:0,fontSize:13,fontWeight:700,color:f.text,letterSpacing:"0.02em",flex:1},children:e.title}),(0,a.jsxs)("span",{style:{fontSize:12,color:o?f.danger:f.textMuted,fontFamily:"monospace",fontWeight:600},"aria-label":e.wipLimit?`${e.cards.length} of ${e.wipLimit} cards`:`${e.cards.length} cards`,children:[e.cards.length,e.wipLimit&&` / ${e.wipLimit}`]})]}),(0,a.jsxs)("div",{style:{padding:8,display:"flex",flexDirection:"column",gap:8,overflowY:"auto",flex:1,minHeight:60},children:[e.cards.map((n,o)=>{const l=g?.cardId===n.id;return(0,a.jsxs)("div",{children:[g&&g.toColumnId===e.id&&g.toIndex===o&&!l&&(0,a.jsx)(ki,{color:e.color??f.primary}),(0,a.jsx)("div",{ref:e=>{e?v.current.set(n.id,e):v.current.delete(n.id)},role:"gridcell","aria-rowindex":o+1,"aria-colindex":t+1,"aria-grabbed":l,"aria-label":n.title,tabIndex:0,"data-card-id":n.id,onPointerDown:t=>w(t,n,e,o),onPointerMove:t=>"pointer"===g?.mode?k(t,e,o):void 0,onPointerUp:S,onPointerCancel:C,onKeyDown:t=>z(t,n,e,o),onClick:()=>{g||i?.(n,e)},style:{padding:12,borderRadius:8,background:f.surfaceAlt,border:`1px solid ${l?e.color??f.primary:f.border}`,cursor:c||n.isDragDisabled?"default":"grab",touchAction:c||n.isDragDisabled?"auto":"none",opacity:l?.4:1,transform:l&&"pointer"===g.mode&&!m?`translate(${g.ghostX??0}px, ${g.ghostY??0}px) scale(1.02)`:void 0,transition:l||m?"none":"transform 120ms, border-color 120ms",userSelect:"none",outlineOffset:2},children:(r??M)(n,e)})]},`slot-${o}`)}),g&&g.toColumnId===e.id&&g.toIndex>=e.cards.length&&(0,a.jsx)(ki,{color:e.color??f.primary}),0===e.cards.length&&!g&&(0,a.jsx)("div",{style:{padding:24,textAlign:"center",color:f.textMuted,fontSize:12,border:`1px dashed ${f.border}`,borderRadius:8},children:"No cards"})]})]},e.id)})]})});function ki({color:e}){return(0,a.jsx)("div",{"aria-hidden":"true",style:{height:3,background:e,borderRadius:999,margin:"2px 0",boxShadow:`0 0 8px ${e}66`}})}var Si=new Set(["P","BR","DIV","SPAN","B","STRONG","I","EM","U","S","STRIKE","DEL","H1","H2","H3","H4","H5","H6","UL","OL","LI","BLOCKQUOTE","PRE","CODE","A","IMG","HR"]),Ci=new Set(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","NOSCRIPT","TEMPLATE","META","LINK","BASE","FORM","INPUT","BUTTON","TEXTAREA","SELECT"]),$i=new Set(["href","src","alt","title"]);function zi(e){if(!e)return null;const t=e.trim().toLowerCase();return t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:")?null:e.trim()}function Mi(e){if(!e)return null;const t=e.trim().toLowerCase();return t.startsWith("https://")||t.startsWith("http://")||t.startsWith("data:image/")?e.trim():null}function Ni(e){if("undefined"==typeof document)return e;const t=document.createElement("div");return t.innerHTML=e,Ii(t),t.innerHTML}function Ii(e){const t=Array.from(e.childNodes);for(const n of t)if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(Ci.has(t.tagName)){e.removeChild(t);continue}if(!Si.has(t.tagName)){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t);continue}const o=Array.from(t.attributes);for(const e of o)if(e.name.startsWith("on"))t.removeAttribute(e.name);else if($i.has(e.name)){if("href"===e.name&&"A"===t.tagName){const n=zi(e.value);n?(t.setAttribute("href",n),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank")):t.removeAttribute("href")}"src"===e.name&&"IMG"===t.tagName&&(Mi(e.value)||t.removeAttribute("src"))}else t.removeAttribute(e.name);Ii(t)}else n.nodeType===Node.COMMENT_NODE&&e.removeChild(n)}var Li=[{id:"bold",label:"Bold",icon:"B",cmd:"bold",shortcut:"⌘B"},{id:"italic",label:"Italic",icon:"I",cmd:"italic",shortcut:"⌘I"},{id:"underline",label:"Underline",icon:"U",cmd:"underline",shortcut:"⌘U"},{id:"strike",label:"Strikethrough",icon:"S",cmd:"strikeThrough"},{id:"h1",label:"Heading 1",icon:"H1"},{id:"h2",label:"Heading 2",icon:"H2"},{id:"h3",label:"Heading 3",icon:"H3"},{id:"ul",label:"Bullet list",icon:"•",cmd:"insertUnorderedList"},{id:"ol",label:"Numbered list",icon:"1.",cmd:"insertOrderedList"},{id:"quote",label:"Quote",icon:'"'},{id:"code",label:"Inline code",icon:"<>"},{id:"codeblock",label:"Code block",icon:"{ }"},{id:"link",label:"Link",icon:"🔗",shortcut:"⌘K"},{id:"image",label:"Image",icon:"🖼"},{id:"hr",label:"Divider",icon:"—"}],Ri=(0,l.forwardRef)(function({initialValue:e="",onChange:n,placeholder:o="Start writing…",tools:r,maxHeight:i,minHeight:s=200,label:d="Rich text editor",isDisabled:c=!1,className:u,style:p,topSlot:h,bottomSlot:f},m){const g=t.useTheme(),x=(0,l.useRef)(null),b=(0,l.useId)(),[y,v]=(0,l.useState)(new Set),[w,k]=(0,l.useState)(!0),S=r??Li.map(e=>e.id),C=(0,l.useCallback)(()=>{if(!x.current)return;const e=Ni(x.current.innerHTML);n?.(e),k(""===x.current.textContent?.trim())},[n]);(0,l.useImperativeHandle)(m,()=>({getHTML:()=>Ni(x.current?.innerHTML??""),getMarkdown:()=>function(e){if("undefined"==typeof document)return e;const t=document.createElement("div");return t.innerHTML=Ni(e),function e(t,n=0){if(t.nodeType===Node.TEXT_NODE)return t.textContent||"";if(t.nodeType!==Node.ELEMENT_NODE)return"";const o=t,r=Array.from(o.childNodes).map(t=>e(t,n)).join("");switch(o.tagName){case"B":case"STRONG":return`**${r}**`;case"I":case"EM":return`*${r}*`;case"U":return`<u>${r}</u>`;case"S":case"STRIKE":case"DEL":return`~~${r}~~`;case"H1":return`# ${r}\n\n`;case"H2":return`## ${r}\n\n`;case"H3":return`### ${r}\n\n`;case"H4":return`#### ${r}\n\n`;case"H5":return`##### ${r}\n\n`;case"H6":return`###### ${r}\n\n`;case"P":return`${r}\n\n`;case"BR":return"\n";case"HR":return"\n---\n\n";case"BLOCKQUOTE":return`> ${r.replace(/\n/g,"\n> ")}\n\n`;case"CODE":return"PRE"===o.parentElement?.tagName?r:`\`${r}\``;case"PRE":return`\`\`\`\n${r}\n\`\`\`\n\n`;case"UL":case"OL":return"\n"+Array.from(o.children).map((t,r)=>e(t,n+1).replace(/^/,"OL"===o.tagName?`${r+1}. `:"- ")).join("")+"\n";case"LI":return`${" ".repeat(Math.max(0,n-1))}${r}\n`;case"A":return`[${r}](${o.getAttribute("href")||""})`;case"IMG":{const e=o.getAttribute("src")||"";return``}default:return r}}(t).trim()}(x.current?.innerHTML??""),getText:()=>x.current?.textContent??"",setHTML:e=>{x.current&&(x.current.innerHTML=Ni(e),C())},focus:()=>x.current?.focus()})),(0,l.useEffect)(()=>{x.current&&e&&(x.current.innerHTML=Ni(e),k(""===x.current.textContent?.trim()))},[]);const $=(0,l.useCallback)(()=>{if("undefined"==typeof document)return;const e=new Set;try{document.queryCommandState("bold")&&e.add("bold"),document.queryCommandState("italic")&&e.add("italic"),document.queryCommandState("underline")&&e.add("underline"),document.queryCommandState("strikeThrough")&&e.add("strike"),document.queryCommandState("insertUnorderedList")&&e.add("ul"),document.queryCommandState("insertOrderedList")&&e.add("ol")}catch{}v(e)},[]);(0,l.useEffect)(()=>(document.addEventListener("selectionchange",$),()=>document.removeEventListener("selectionchange",$)),[$]);const z=(0,l.useCallback)(e=>{if(c)return;x.current?.focus();const t=Li.find(t=>t.id===e);switch(e){case"h1":case"h2":case"h3":document.execCommand("formatBlock",!1,e);break;case"quote":document.execCommand("formatBlock",!1,"blockquote");break;case"code":!function(){if("undefined"==typeof window)return;const e=window.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0),n=t.toString();if(!n)return;const o=document.createElement("code");o.textContent=n,t.deleteContents(),t.insertNode(o)}();break;case"codeblock":document.execCommand("formatBlock",!1,"pre");break;case"link":{const e=window.getSelection()?.toString()||"",t=window.prompt("Link URL","https://");if(!t)break;const o=zi(t);if(!o){window.alert("That URL is not allowed.");break}const r=e||o;document.execCommand("insertHTML",!1,`<a href="${Di(o)}" target="_blank" rel="noopener noreferrer">${n=r,n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</a>`);break}case"image":{const e=window.prompt("Image URL (https:// or data:image/…)");if(!e)break;const t=Mi(e);if(!t){window.alert("That image URL is not allowed.");break}const n=window.prompt("Alt text (required for accessibility)")||"";document.execCommand("insertHTML",!1,`<img src="${Di(t)}" alt="${Di(n)}" />`);break}case"hr":document.execCommand("insertHTML",!1,"<hr />");break;default:t?.cmd&&document.execCommand(t.cmd,!1)}var n;C(),$()},[c,C,$]),M=(0,l.useCallback)(e=>{if(!e.metaKey&&!e.ctrlKey)return;const t=e.key.toLowerCase();"b"===t?(e.preventDefault(),z("bold")):"i"===t?(e.preventDefault(),z("italic")):"u"===t?(e.preventDefault(),z("underline")):"k"===t&&(e.preventDefault(),z("link"))},[z]),N=(0,l.useCallback)(e=>{e.preventDefault();const t=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain");t?document.execCommand("insertHTML",!1,Ni(t)):n&&document.execCommand("insertText",!1,n),C()},[C]),I=(0,l.useCallback)(e=>{const t=Array.from(e.currentTarget.querySelectorAll("button[data-tool]")),n=t.indexOf(document.activeElement);n<0||("ArrowRight"===e.key?(e.preventDefault(),t[(n+1)%t.length].focus()):"ArrowLeft"===e.key?(e.preventDefault(),t[(n-1+t.length)%t.length].focus()):"Home"===e.key?(e.preventDefault(),t[0].focus()):"End"===e.key&&(e.preventDefault(),t[t.length-1].focus()))},[]),L={border:`1px solid ${g.border}`,borderRadius:12,background:g.surface,...p},R={display:"flex",flexWrap:"wrap",gap:4,padding:8,borderBottom:`1px solid ${g.border}`,background:g.surfaceAlt,borderTopLeftRadius:12,borderTopRightRadius:12},D={padding:16,outline:"none",minHeight:"number"==typeof s?`${s}px`:s,maxHeight:"number"==typeof i?`${i}px`:i,overflowY:i?"auto":"visible",color:g.text,fontSize:15,lineHeight:1.6,borderBottomLeftRadius:12,borderBottomRightRadius:12,cursor:c?"not-allowed":"text",opacity:c?.6:1};return(0,a.jsxs)("div",{className:u,style:L,children:[h,(0,a.jsx)("div",{role:"toolbar","aria-label":"Formatting","aria-controls":b,onKeyDown:I,style:R,children:S.map((e,t)=>{const n=Li.find(t=>t.id===e);if(!n)return null;const o=y.has(e);return(0,a.jsx)("button",{type:"button","data-tool":n.id,tabIndex:0===t?0:-1,"aria-label":n.label+(n.shortcut?` (${n.shortcut})`:""),"aria-pressed":o,disabled:c,onMouseDown:e=>e.preventDefault(),onClick:()=>z(n.id),style:{background:o?g.primary:"transparent",color:o?g.bg:g.text,border:`1px solid ${o?g.primary:"transparent"}`,padding:"6px 10px",borderRadius:6,cursor:c?"not-allowed":"pointer",fontWeight:700,fontSize:13,minWidth:32,minHeight:32,display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"background 120ms"},children:n.icon},n.id)})}),(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("div",{ref:x,id:b,role:"textbox","aria-label":d,"aria-multiline":"true","aria-readonly":c,contentEditable:!c,suppressContentEditableWarning:!0,onInput:C,onKeyDown:M,onPaste:N,spellCheck:!0,style:D}),w&&!c&&(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:16,left:16,color:g.textMuted,pointerEvents:"none",fontSize:15},children:o})]}),f]})});function Di(e){return e.replace(/"/g,""").replace(/'/g,"'")}exports.COUNTRIES=Jo,exports.FocusTrap=function({active:e,children:t,as:n="div"}){return(0,a.jsx)(n,{ref:o.useFocusTrap(e),children:t})},exports.I18nContext=r.I18nContext,exports.I18nProvider=function({locale:e="en-US",direction:t,strings:n,children:o}){const i=(0,l.useMemo)(()=>{const o=r.LOCALES[e]??r.enUS,i=n?{...o,...n}:o;return{locale:e,direction:t??(r.isRTL(e)?"rtl":"ltr"),strings:i}},[e,t,n]);return(0,a.jsx)(r.I18nContext.Provider,{value:i,children:(0,a.jsx)("div",{dir:i.direction,style:{direction:i.direction,display:"contents"},children:o})})},exports.LRUCache=t.LRUCache,exports.LiveRegion=function({politeness:e="polite",children:t,atomic:n=!0}){return(0,a.jsx)("div",{role:"status","aria-live":e,"aria-atomic":n,className:"tkx-sr-only",children:t})},exports.Quantum=t.Quantum,exports.SIZE_BORDER_RADIUS={sm:4,md:6,lg:8},exports.SIZE_FONT={sm:"0.75rem",md:"0.875rem",lg:"1rem"},exports.SIZE_HEIGHT={sm:32,md:40,lg:48},exports.SIZE_ICON={sm:14,md:16,lg:20},exports.SIZE_PADDING_X={sm:8,md:12,lg:16},exports.SIZE_PADDING_Y={sm:4,md:8,lg:12},exports.SecurityCore=n.SecurityCore,exports.Shield=n.Shield,exports.SkipNav=function({contentId:e="tkx-main-content",label:t="Skip to main content"}){return(0,a.jsx)("a",{href:`#${e}`,className:"tkx-skip-nav",children:t})},exports.TKX=t.TKX,exports.ThemeContext=t.ThemeContext,exports.ThemeProvider=t.ThemeProvider,exports.TkxAIChatBubble=function({role:e,content:o,avatar:r,name:i,timestamp:s,streaming:d=!1,confidence:c,copyable:u=!1,className:p,style:h}){const f=t.useTheme(),m="user"===e,g="system"===e,x="string"==typeof o?n.sanitizeString(o):"",[b,y]=(0,l.useState)(d?"":x),[v,w]=(0,l.useState)(!1),[k,S]=(0,l.useState)(d?"":x),C=(0,l.useRef)(0),$=(0,l.useRef)(null);if((0,l.useEffect)(()=>{if(!d||"string"!=typeof o)return void S(x);C.current=0,y(""),S("");const e=setInterval(()=>{C.current++;const t=x.slice(0,C.current);y(t),$.current&&clearTimeout($.current),$.current=setTimeout(()=>S(t),350),C.current>=x.length&&(clearInterval(e),$.current&&clearTimeout($.current),S(x))},18);return()=>{clearInterval(e),$.current&&clearTimeout($.current)}},[x,d,o]),g)return(0,a.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:(0,a.jsx)("div",{style:{padding:"6px 16px",borderRadius:999,fontSize:12,background:`${f.border}`,color:f.textMuted,fontStyle:"italic"},children:"string"==typeof o?n.sanitizeString(o):o})});const z={maxWidth:"75%",padding:"12px 16px",borderRadius:m?"18px 18px 4px 18px":"18px 18px 18px 4px",background:m?`linear-gradient(135deg, ${f.primary}, ${f.primary}cc)`:`${f.surface}`,border:m?"none":`1px solid ${f.border}`,color:m?"#fff":f.text,fontSize:14,lineHeight:1.65,boxShadow:m?`0 4px 16px -4px ${f.primary}55`:"0 2px 8px -2px rgba(0,0,0,0.2)",position:"relative",wordBreak:"break-word"};return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex gap-2"),p),style:{flexDirection:m?"row-reverse":"row",alignItems:"flex-end",...h},children:[(0,a.jsx)(ii,{src:r,name:i??(m?"You":"AI")}),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:m?"flex-end":"flex-start"},children:[(i||s)&&(0,a.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",paddingInline:4},children:[i&&(0,a.jsx)("span",{style:{fontSize:11,fontWeight:700,color:f.textMuted},children:i}),s&&(0,a.jsx)("span",{style:{fontSize:10,color:f.textMuted},children:s})]}),(0,a.jsxs)("div",{style:z,role:"article","aria-label":m?"Your message":"Assistant message",children:["string"==typeof o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{"aria-hidden":d?"true":void 0,children:d?b:n.sanitizeString(o)}),d&&b.length<x.length&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:2,height:14,background:m?"#fff":f.primary,marginLeft:2,animation:"tkx-blink 1s step-end infinite",verticalAlign:"text-bottom"}}),d&&(0,a.jsx)("span",{"aria-live":"polite","aria-atomic":"false",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:k})]}):o,u&&!m&&(0,a.jsx)("button",{onClick:()=>{navigator.clipboard?.writeText(x),w(!0),setTimeout(()=>w(!1),2e3)},title:"Copy message",style:{position:"absolute",top:8,right:8,background:"none",border:"none",cursor:"pointer",fontSize:13,color:v?"#10b981":f.textMuted,padding:"2px 4px",borderRadius:4,transition:"color 0.2s"},children:v?"✓":"⎘"})]}),!m&&void 0!==c&&(0,a.jsx)("div",{style:{paddingInline:4,width:"100%",maxWidth:240},children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,a.jsx)("div",{style:{flex:1,height:3,borderRadius:3,background:f.border,overflow:"hidden"},children:(0,a.jsx)("div",{style:{height:"100%",width:`${c}%`,background:(M=c,N=f.primary,M>=80?"#10b981":M>=55?N:M>=30?"#f59e0b":"#ef4444"),borderRadius:3,transition:"width 0.8s ease"}})}),(0,a.jsxs)("span",{style:{fontSize:10,color:f.textMuted,whiteSpace:"nowrap"},children:[c,"% confident"]})]})})]}),(0,a.jsx)("style",{children:"\n @keyframes tkx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }\n "})]});var M,N},exports.TkxAIConfidenceBar=function({value:e,label:o,showLabel:r=!0,size:i="md",animate:s=!0,className:d,style:c}){const u=t.useTheme(),p=(0,l.useRef)(null),h=Math.max(0,Math.min(100,e)),f=function(e,t){return e>=80?"#10b981":e>=55?t:e>=30?"#f59e0b":"#ef4444"}(h,u.primary),m=ri[i];(0,l.useEffect)(()=>{if(!s||!p.current)return;const e=p.current;e.style.width="0%";const t=requestAnimationFrame(()=>{e.style.transition="width 0.9s cubic-bezier(0.4, 0, 0.2, 1)",e.style.width=`${h}%`});return()=>cancelAnimationFrame(t)},[h,s]);const g="number"==typeof h?`${h.toFixed(0)}% AI confidence${o?` for ${o}`:""}`:o;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1"),d),style:c,role:"meter","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":100,"aria-label":g,children:[(o||r)&&(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[o&&(0,a.jsx)("span",{style:{fontSize:12,fontWeight:600,color:u.textMuted},children:o}),r&&(0,a.jsxs)("span",{style:{fontSize:12,fontWeight:700,color:f,marginLeft:"auto"},children:[h.toFixed(0),"%"]})]}),(0,a.jsxs)("div",{style:{height:m,borderRadius:m,background:`${u.border}`,overflow:"hidden",position:"relative"},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"tkx-ai-shimmer 2s linear infinite",pointerEvents:"none",zIndex:1}}),(0,a.jsx)("div",{ref:p,style:{height:"100%",width:s?"0%":`${h}%`,background:`linear-gradient(90deg, ${f}cc, ${f})`,borderRadius:m,boxShadow:`0 0 8px ${f}66`,transition:s?void 0:"width 0.3s ease"}})]}),(0,a.jsxs)("div",{style:{fontSize:10,color:u.textMuted,marginTop:2,display:"flex",gap:4,alignItems:"center"},children:[(0,a.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:f,display:"inline-block",flexShrink:0}}),h>=80?"High confidence":h>=55?"Moderate confidence":h>=30?"Low confidence":"Very low — review manually"]}),(0,a.jsx)("style",{children:"\n @keyframes tkx-ai-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n "})]})},exports.TkxAIThinking=function({label:e="Thinking…",steps:o,size:r="md",variant:i="dots",active:s=!0,className:d,style:c}){const u=t.useTheme(),[p,h]=(0,l.useState)(0);(0,l.useEffect)(()=>{if(!o?.length||!s)return;const e=setInterval(()=>{h(e=>(e+1)%o.length)},1800);return()=>clearInterval(e)},[o,s]);const f=u.primary,m=ci[r],g={dots:(0,a.jsx)(li,{color:f}),pulse:(0,a.jsx)(ai,{color:f}),wave:(0,a.jsx)(si,{color:f}),orbit:(0,a.jsx)(di,{color:f})}[i];return(0,a.jsxs)("div",{className:n.cx(n.tkx("inline-flex flex-col gap-2"),d),style:c,role:"status","aria-live":"polite","aria-label":s?e:"Done thinking",children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,a.jsx)("div",{style:{opacity:s?1:.35,transition:"opacity 0.3s"},children:s?g:(0,a.jsx)("div",{style:{width:20,height:20,borderRadius:"50%",background:"#10b981",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,a.jsx)("span",{style:{color:"#fff",fontSize:11,fontWeight:900},children:"✓"})})}),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[(0,a.jsx)("span",{style:{fontSize:m,fontWeight:600,color:s?u.text:u.textMuted,transition:"color 0.3s"},children:s?o?o[p]:e:"Done"}),s&&(0,a.jsx)("span",{style:{fontSize:m-2,color:u.textMuted},children:"⚛ Quantum AI · Amplitude Amplification"})]})]}),o&&o.length>1&&(0,a.jsx)("div",{style:{display:"flex",gap:4,paddingLeft:2},children:o.map((e,t)=>(0,a.jsx)("div",{style:{width:t===p?16:6,height:4,borderRadius:4,background:t===p?f:`${f}44`,transition:"all 0.3s ease"}},t))}),(0,a.jsx)("style",{children:"\n @keyframes tkx-thinking-dot {\n 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }\n 40% { transform: scale(1); opacity: 1; }\n }\n @keyframes tkx-thinking-pulse {\n 0% { transform: scale(0.6); opacity: 0.8; }\n 100% { transform: scale(2); opacity: 0; }\n }\n @keyframes tkx-thinking-wave {\n 0%, 100% { height: 6px; }\n 50% { height: 18px; }\n }\n @keyframes tkx-thinking-orbit {\n to { transform: rotate(360deg); }\n }\n "})]})},exports.TkxAadhaarInput=Ar,exports.TkxAccordion=de,exports.TkxAddressInput=mr,exports.TkxAffix=function({children:e,offsetTop:r,offsetBottom:i,onChange:s,target:d}){const c=t.useTheme(),u=o.useReducedMotion(),p=(0,l.useRef)(null),h=(0,l.useRef)(null),[f,m]=(0,l.useState)(!1),[g,x]=(0,l.useState)({width:0,height:0}),b=(0,l.useRef)(!1),y=(0,l.useMemo)(()=>n.sanitizeString("Sticky content"),[]),v=(0,l.useCallback)(()=>{const e=p.current;if(!e)return;const t=e.getBoundingClientRect(),n=function(e){if(e instanceof Window)return{top:0,bottom:e.innerHeight};const t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}(Ao(d));let o=!1;void 0!==r?o=t.top-n.top<=r:void 0!==i&&(o=n.bottom-t.bottom<=i),o!==b.current&&(b.current=o,m(o),x({width:t.width,height:t.height}),s?.(o))},[r,i,s,d]);(0,l.useEffect)(()=>{const e=Ao(d);return v(),e.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),()=>{e.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[v,d]);const w=f?{position:"fixed",zIndex:100,...void 0!==r?{top:r}:{},...void 0!==i?{bottom:i}:{},width:g.width||void 0,transition:u?"none":"box-shadow 0.2s ease",boxShadow:`0 2px 8px ${c.border}`}:{};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:p,"aria-hidden":f,style:f?{height:g.height,width:g.width}:{}}),(0,a.jsx)("div",{ref:h,role:"region","aria-label":y,className:n.tkx(f?"tkx-affixed":""),style:w,children:e})]})},exports.TkxAlert=function({variant:e,title:r,children:i,dismissible:s,onDismiss:d,icon:c,style:u,className:p}){const h=t.useTheme(),f=o.useAnnounce(),m=r?n.sanitizeString(r):void 0;(0,l.useEffect)(()=>{m&&f(m,"danger"===e||"warning"===e?"assertive":"polite")},[m,e]);const g={info:h.info,success:h.success,warning:h.warning,danger:h.danger}[e];return(0,a.jsxs)("div",{role:"danger"===e||"warning"===e?"alert":"status",className:n.tkx("flex items-start gap-3 px-4 py-3 rounded-lg border animate-fade-in font-sans",p??""),style:{backgroundColor:`${g}18`,borderColor:g,color:h.text,...u},children:[(0,a.jsx)("span",{className:n.tkx("shrink-0 mt-[1px]"),style:{color:g},children:c??z[e]}),(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[m&&(0,a.jsx)("p",{className:n.tkx("m-0 font-semibold text-sm mb-1"),children:m}),(0,a.jsx)("div",{className:n.tkx("text-sm leading-relaxed"),children:i})]}),s&&d&&(0,a.jsx)("button",{"aria-label":"Dismiss alert",onClick:d,className:n.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:h.textMuted},children:(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})},exports.TkxAnchor=function({items:e,offsetTop:r=0,getCurrentAnchor:i,onChange:s}){const d=t.useTheme(),c=o.useReducedMotion(),[u,p]=(0,l.useState)(e[0]?.key??""),h=(0,l.useRef)(!1),f=Bo(e),m=(0,l.useCallback)(()=>{if(h.current)return;let e=f[0]?.key??"";for(const t of f){const n=Eo(t.href),o=document.getElementById(n);o&&o.getBoundingClientRect().top<=r+10&&(e=t.key)}i&&(e=i(e)),e!==u&&(p(e),s?.(e))},[f,r,i,u,s]);(0,l.useEffect)(()=>(window.addEventListener("scroll",m,{passive:!0}),m(),()=>window.removeEventListener("scroll",m)),[m]);const g=(0,l.useCallback)(e=>{const t=Eo(e),n=document.getElementById(t);if(!n)return;h.current=!0;const o=n.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:o,behavior:c?"auto":"smooth"});const i=f.find(t=>t.href===e);i&&(p(i.key),s?.(i.key)),setTimeout(()=>{h.current=!1},800)},[f,r,c,s]);return(0,a.jsx)("nav",{role:"tree","aria-label":"Anchor navigation",className:n.tkx("font-sans"),style:{borderLeft:`1px solid ${d.border}`,padding:"4px 0"},children:(0,a.jsx)("ul",{role:"group",style:{margin:0,padding:0},children:e.map(e=>(0,a.jsx)(Ho,{item:e,activeKey:u,depth:0,onClick:g,theme:d,reducedMotion:c},e.key))})})},exports.TkxAppBar=function({title:e,logo:r,actions:i,navigation:s,position:d="sticky",variant:c="default",color:u="surface"}){const p=t.useTheme(),h=o.useReducedMotion(),f=function(){const[e,t]=(0,l.useState)(()=>"undefined"!=typeof window&&window.innerWidth<768);return(0,l.useEffect)(()=>{if("undefined"==typeof window)return;const e=()=>t(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),[m,g]=(0,l.useState)(!1),x=(0,l.useRef)(null),b=(0,l.useId)();o.useEscapeKey(()=>g(!1),m),(0,l.useEffect)(()=>{!f&&m&&g(!1)},[f,m]),(0,l.useEffect)(()=>{if(!m)return;const e=e=>{x.current&&!x.current.contains(e.target)&&g(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[m]);const y=(0,l.useCallback)(()=>{g(e=>!e)},[]),v="primary"===u?p.primary:p.surface,w="primary"===u?p.bg:p.text,k={default:{backgroundColor:v,borderBottom:`1px solid ${p.border}`},transparent:{backgroundColor:"transparent",borderBottom:"none"},elevated:{backgroundColor:v,boxShadow:`0 2px 8px ${p.bg}66`,borderBottom:"none"}},S="string"==typeof e?n.sanitizeString(e):e,C=h?"none":"max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease";return(0,a.jsxs)("header",{role:"banner",className:n.tkx("font-sans w-full"),style:{...{fixed:{position:"fixed",top:0,left:0,right:0,zIndex:1100},sticky:{position:"sticky",top:0,zIndex:1100},static:{position:"static"}}[d],...k[c],color:w,height:56},children:[(0,a.jsxs)("div",{ref:x,className:n.tkx("flex items-center h-full px-4"),style:{maxWidth:1440,margin:"0 auto"},children:[r&&(0,a.jsx)("div",{className:n.tkx("flex items-center shrink-0 mr-3"),"aria-hidden":"true",children:r}),S&&(0,a.jsx)("div",{className:n.tkx("text-base font-semibold shrink-0 mr-4 leading-snug"),style:{color:w},children:S}),!f&&s&&(0,a.jsx)("nav",{id:b,"aria-label":"Main navigation",className:n.tkx("flex items-center flex-1 gap-1"),children:s}),f&&(0,a.jsx)("div",{className:n.tkx("flex-1")}),i&&(0,a.jsx)("div",{className:n.tkx("flex items-center gap-2 ml-auto shrink-0"),children:i}),f&&s&&(0,a.jsx)("button",{onClick:y,"aria-expanded":m,"aria-controls":b,"aria-label":m?"Close navigation menu":"Open navigation menu",className:n.tkx("bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center","focus-visible:focus-ring"),style:{color:w},children:(0,a.jsx)(yn,{open:m})})]}),f&&s&&(0,a.jsx)("nav",{id:b,"aria-label":"Main navigation",style:{maxHeight:m?400:0,opacity:m?1:0,overflow:"hidden",transition:C,backgroundColor:p.surface,borderBottom:m?`1px solid ${p.border}`:"none"},children:(0,a.jsx)("div",{className:n.tkx("flex flex-col gap-1 px-4 py-3"),role:"menu",children:s})})]})},exports.TkxAutocomplete=function({options:e,value:i,onChange:d,onInputChange:c,placeholder:u="",label:p,isLoading:h=!1,emptyMessage:f,filterFn:m,freeSolo:g=!1,className:x,style:b}){const y=t.useTheme(),v=r.useLocale(),w=f??v.noResults,k=o.useReducedMotion(),S=(0,l.useId)(),C=(0,l.useId)(),$=(0,l.useRef)(null),z=(0,l.useRef)(null),[M,N]=(0,l.useState)(""),[I,L]=(0,l.useState)(!1),[R,D]=(0,l.useState)(-1),[T,W]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(void 0!==i){const t=e.find(e=>e.value===i);N(t?t.label:i)}},[i,e]);const A=m??an,B=(0,l.useMemo)(()=>I?e.filter(e=>A(e,M)):[],[e,M,I,A]),E=n.sanitizeString(p),H=n.sanitizeString(w);(0,l.useEffect)(()=>{if(!I||!z.current)return;const e=()=>{z.current&&W(function(e){const t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,o=t.top,r=n>=284||n>=o?"below":"above";return{top:"below"===r?t.bottom+window.scrollY+4:t.top+window.scrollY-280-4,left:t.left+window.scrollX,width:t.width,placement:r}}(z.current))};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[I]),(0,l.useEffect)(()=>{if(!I)return;const e=e=>{const t=e.target;z.current?.contains(t)||document.getElementById(C)?.contains(t)||L(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[I,C]),o.useEscapeKey(()=>L(!1),I);const F=(0,l.useCallback)(e=>{e.disabled||(N(e.label),d?.(e.value),L(!1),D(-1),$.current?.focus())},[d]);(0,l.useEffect)(()=>{if(R<0)return;const e=`${C}-opt-${R}`;document.getElementById(e)?.scrollIntoView({block:"nearest"})},[R,C]);const j=R>=0?`${C}-opt-${R}`:void 0,P=k?{}:{animation:"tkxAutoFadeIn 120ms ease forwards"},O=I&&"undefined"!=typeof document&&T?(0,s.createPortal)((0,a.jsx)("ul",{id:C,role:"listbox","aria-label":E,className:n.tkx("absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans"),style:{top:T.top,left:T.left,width:T.width,maxHeight:280,backgroundColor:y.surface,border:`1px solid ${y.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15)",...P},children:h?(0,a.jsxs)("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:n.tkx("flex items-center gap-2 px-3 py-2 text-sm"),style:{color:y.textMuted},children:[(0,a.jsx)(sn,{color:y.primary}),"Loading..."]}):0===B.length?(0,a.jsx)("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:n.tkx("px-3 py-2 text-sm text-center"),style:{color:y.textMuted},children:H}):B.map((e,t)=>{const o=t===R,r=n.sanitizeString(e.label),l=e.description?n.sanitizeString(e.description):null;return(0,a.jsxs)("li",{id:`${C}-opt-${t}`,role:"option","aria-selected":e.value===i,"aria-disabled":e.disabled||void 0,className:n.tkx("flex items-center gap-2 px-3 py-2 text-sm rounded-md cursor-pointer",e.disabled?"opacity-50 cursor-not-allowed":""),style:{backgroundColor:o?y.surfaceAlt:"transparent",color:e.disabled?y.textMuted:y.text,transition:k?"none":"background-color 100ms ease"},onMouseEnter:()=>!e.disabled&&D(t),onMouseDown:t=>{t.preventDefault(),F(e)},children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),(0,a.jsxs)("span",{className:n.tkx("flex flex-col min-w-0"),children:[(0,a.jsx)("span",{className:n.tkx("truncate"),children:r}),l&&(0,a.jsx)("span",{className:n.tkx("text-xs truncate"),style:{color:y.textMuted},children:l})]}),e.value===i&&(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:n.tkx("ml-auto flex-shrink-0"),children:(0,a.jsx)("path",{d:"M3 8l3.5 3.5L13 5",stroke:y.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},e.value)})}),document.body):null;return(0,a.jsxs)("div",{ref:z,className:n.tkx("relative font-sans",x??""),style:b,children:[(0,a.jsx)("label",{htmlFor:S,className:n.tkx("block text-sm font-medium mb-1.5"),style:{color:y.text},children:E}),(0,a.jsxs)("div",{className:n.tkx("relative flex items-center"),style:{backgroundColor:y.surface,border:`1px solid ${I?y.primary:y.border}`,borderRadius:8,transition:k?"none":"border-color 150ms ease"},children:[(0,a.jsx)("input",{ref:$,id:S,type:"text",role:"combobox","aria-expanded":I,"aria-controls":C,"aria-activedescendant":j,"aria-autocomplete":"list","aria-label":E,value:M,placeholder:u,onChange:e=>{const t=e.target.value;N(t),c?.(t),I||L(!0),D(-1),g&&d?.(t)},onFocus:()=>L(!0),onKeyDown:e=>{if(I||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)switch(e.key){case"ArrowDown":e.preventDefault(),D(e=>{let t=e+1;for(;t<B.length&&B[t].disabled;)t++;return t<B.length?t:e});break;case"ArrowUp":e.preventDefault(),D(e=>{let t=e-1;for(;t>=0&&B[t].disabled;)t--;return t>=0?t:e});break;case"Enter":e.preventDefault(),R>=0&&R<B.length?F(B[R]):g&&M&&(d?.(M),L(!1));break;case"Escape":L(!1),D(-1)}else L(!0)},className:n.tkx("w-full bg-transparent border-none outline-none text-sm py-2.5 px-3","placeholder:opacity-50"),style:{color:y.text}}),h&&(0,a.jsx)("span",{className:n.tkx("pr-3"),children:(0,a.jsx)(sn,{color:y.primary})})]}),O,I&&!k&&(0,a.jsx)("style",{children:"\n @keyframes tkxAutoFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})},exports.TkxAvatar=E,exports.TkxBadge=v,exports.TkxBillingCycleToggle=function({value:e,onChange:n,annualSavingsLabel:o,className:r,style:i}){const l=t.useTheme(),s={display:"inline-flex",alignItems:"center",gap:8,padding:4,border:`1px solid ${l.border}`,borderRadius:999,background:l.surface,...i},d=e=>({padding:"6px 16px",borderRadius:999,fontSize:13,fontWeight:600,background:e?l.primary:"transparent",color:e?l.bg:l.text,border:"none",cursor:"pointer",transition:"background 0.15s, color 0.15s",display:"inline-flex",alignItems:"center",gap:6});return(0,a.jsxs)("div",{role:"radiogroup","aria-label":"Billing cycle",className:r,style:s,children:[(0,a.jsx)("button",{type:"button",role:"radio","aria-checked":"monthly"===e,onClick:()=>n("monthly"),style:d("monthly"===e),children:"Monthly"}),(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":"annual"===e,onClick:()=>n("annual"),style:d("annual"===e),children:["Annual",o&&(0,a.jsx)("span",{style:{fontSize:10,padding:"2px 6px",borderRadius:4,background:"annual"===e?l.bg:l.success,color:"annual"===e?l.success:l.bg,fontWeight:700},children:o})]})]})},exports.TkxBottomNav=function({items:e,activeId:r,onChange:i,showLabels:s=!0}){const d=t.useTheme(),c=o.useReducedMotion(),u=(0,l.useRef)(null);(0,l.useEffect)(()=>{!function(){if(vn||"undefined"==typeof document)return;vn=!0;const e=document.createElement("style");e.id="tkx-bottom-nav-kf",e.textContent="\n @keyframes tkx-bottom-nav-pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.15); }\n 100% { transform: scale(1); }\n }\n ",document.head.appendChild(e)}()},[]);const p=e.slice(0,5),h=(0,l.useCallback)(e=>{i?.(e)},[i]),f=(0,l.useCallback)(e=>{const t=u.current;if(!t)return;const n=Array.from(t.querySelectorAll('[role="tab"]')),o=n.findIndex(e=>e===document.activeElement);if(-1===o)return;let r=o;"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),r=(o+1)%n.length):"ArrowLeft"===e.key||"ArrowUp"===e.key?(e.preventDefault(),r=(o-1+n.length)%n.length):"Home"===e.key?(e.preventDefault(),r=0):"End"===e.key&&(e.preventDefault(),r=n.length-1),r!==o&&(n[r].focus(),h(p[r].id))},[h,p]),m=c?"none":"color 200ms ease, transform 150ms ease";return(0,a.jsx)("nav",{ref:u,role:"navigation","aria-label":"Bottom navigation",className:n.tkx("fixed bottom-0 left-0 right-0 z-[1000] font-sans"),style:{height:56,backgroundColor:d.surface,borderTop:`1px solid ${d.border}`,boxShadow:`0 -2px 12px ${d.bg}44`},children:(0,a.jsx)("div",{role:"tablist","aria-label":"Navigation tabs",className:n.tkx("flex items-center justify-around h-full"),onKeyDown:f,children:p.map(e=>{const t=e.id===r,o=n.sanitizeString(e.label),i=t?d.primary:d.textMuted;return(0,a.jsxs)("button",{role:"tab","aria-selected":t,"aria-label":o,tabIndex:t?0:-1,onClick:()=>h(e.id),className:n.tkx("flex flex-col items-center justify-center gap-0.5","bg-transparent border-none cursor-pointer p-1","flex-1 h-full relative","focus-visible:focus-ring"),style:{color:i,transition:m,outline:"none"},children:[t&&(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:"25%",right:"25%",height:3,borderRadius:"0 0 3px 3px",backgroundColor:d.primary,transition:c?"none":"width 200ms ease"}}),(0,a.jsxs)("div",{className:n.tkx("relative flex items-center justify-center"),style:{animation:t&&!c?"tkx-bottom-nav-pulse 300ms ease-out":"none"},children:[e.icon,void 0!==e.badge&&e.badge>0&&(0,a.jsx)("span",{"aria-label":`${e.badge} notifications`,className:n.tkx("absolute flex items-center justify-center","text-[10px] font-bold leading-none rounded-full"),style:{top:-4,right:-8,minWidth:16,height:16,padding:"0 4px",backgroundColor:d.danger,color:d.bg},children:e.badge>99?"99+":e.badge})]}),s&&(0,a.jsx)("span",{className:n.tkx("text-[10px] leading-tight mt-0.5"),style:{fontWeight:t?600:400,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o})]},e.id)})})})},exports.TkxBreadcrumb=function({items:e,separator:i,maxItems:s,onNavigate:d,className:c,style:u}){const p=t.useTheme(),h=r.useLocale(),f=o.useReducedMotion(),m=void 0!==s&&s>1&&e.length>s,g=(0,l.useCallback)(()=>{if(!m||!s)return e.map((e,t)=>({item:e,originalIndex:t}));const t=Math.ceil((s-1)/2),n=s-1-t,o=e.slice(0,t).map((e,t)=>({item:e,originalIndex:t})),r=e.slice(e.length-n).map((t,o)=>({item:t,originalIndex:e.length-n+o}));return o.concat(r)},[e,s,m])(),x=m&&s?Math.ceil((s-1)/2):-1,b=(e,t)=>{d?.(e,t)},y=f?{}:{transition:"color 150ms ease, background-color 150ms ease"},v=e=>(0,a.jsx)("li",{role:"presentation","aria-hidden":"true",className:n.tkx("flex items-center mx-1.5"),children:i??(0,a.jsx)(rn,{color:p.textMuted})},e),w=(e,t,o)=>{const r=n.sanitizeString(e.label);if(o)return(0,a.jsx)("li",{children:(0,a.jsxs)("span",{"aria-current":"page",className:n.tkx("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:p.text},children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),r]})},`item-${t}`);const i=!!e.href,l={color:p.textMuted,textDecoration:"none",...y},s={onMouseEnter:e=>{e.currentTarget.style.color=p.primary},onMouseLeave:e=>{e.currentTarget.style.color=p.textMuted}},c=(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),r]});return i?(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:e.href,onClick:n=>{d&&(n.preventDefault(),b(e,t))},className:n.tkx("inline-flex items-center gap-1.5 text-sm rounded","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:{...l,focusRingColor:p.primary},...s,children:c})},`item-${t}`):(0,a.jsx)("li",{children:(0,a.jsx)("button",{type:"button",onClick:()=>b(e,t),onKeyDown:n=>((e,t,n)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(t,n))})(n,e,t),className:n.tkx("inline-flex items-center gap-1.5 text-sm rounded","border-none bg-transparent cursor-pointer p-0","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:l,...s,children:c})},`item-${t}`)},k=[];let S=!1;for(let t=0;t<g.length;t++){const{item:n,originalIndex:o}=g[t],r=o===e.length-1;m&&!S&&t===x&&(k.length>0&&k.push(v("sep-ellipsis-before")),k.push((0,a.jsx)("li",{role:"presentation",children:(0,a.jsx)(ln,{onClick:()=>{},bgColor:p.surfaceAlt,hoverColor:p.surface,textColor:p.textMuted,label:h.showHiddenItems??"Show hidden breadcrumb items"})},"ellipsis")),S=!0),k.length>0&&null!==k[k.length-1]&&k.push(v(`sep-${o}`)),k.push(w(n,o,r))}return(0,a.jsx)("nav",{"aria-label":h.breadcrumb??"Breadcrumb",className:n.tkx("font-sans",c??""),style:{...u},children:(0,a.jsx)("ol",{role:"list",className:n.tkx("flex items-center flex-wrap list-none m-0 p-0"),children:k})})},exports.TkxButton=f,exports.TkxCalendarLunar=Nr,exports.TkxCaptcha=Yo,exports.TkxCard=g,exports.TkxCardBody=function({children:e,className:t,...o}){return(0,a.jsx)("div",{className:n.cx(n.tkx(""),t),...o,children:e})},exports.TkxCardFooter=function({children:e,className:o,style:r,...i}){const l=t.useTheme();return(0,a.jsx)("div",{className:n.cx(n.tkx("flex items-center justify-end gap-2 mt-4 pt-4"),o),style:{borderTop:`1px solid ${l.border}`,...r},...i,children:e})},exports.TkxCardHeader=function({title:e,subtitle:o,action:r,children:i,className:l,...s}){const d=t.useTheme();return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex justify-between items-start mb-4"),l),...s,children:[(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[e&&(0,a.jsx)("h3",{className:n.tkx("text-base font-semibold m-0"),style:{color:d.text},children:e}),o&&(0,a.jsx)("p",{className:n.tkx("text-sm mt-1 mb-0"),style:{color:d.textMuted},children:o}),i]}),r&&(0,a.jsx)("div",{className:n.tkx("ml-3 shrink-0"),children:r})]})},exports.TkxCarousel=on,exports.TkxCascader=function({options:e,value:r=[],onChange:i,placeholder:d="Select...",label:c,multiple:u=!1}){const p=t.useTheme(),h=o.useReducedMotion(),f=(0,l.useRef)(null),m=(0,l.useRef)(null),[g,x]=(0,l.useState)(!1),[b,y]=(0,l.useState)(r),[v,w]=(0,l.useState)({top:0,left:0,width:0}),k=c?n.sanitizeString(c):void 0,S=n.sanitizeString(d),C=r.length>0?function(e,t){return Fo(e,t).map(e=>n.sanitizeString(e.label)).join(" / ")}(e,r):"";(0,l.useEffect)(()=>{if(!g||!f.current)return;const e=f.current.getBoundingClientRect();w({top:e.bottom+4+window.scrollY,left:e.left+window.scrollX,width:Math.max(e.width,200)})},[g]),(0,l.useEffect)(()=>{if(!g)return;const e=e=>{f.current?.contains(e.target)||m.current?.contains(e.target)||x(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]);const $=(0,l.useCallback)((t,n)=>{if(n.disabled)return;const o=[...b.slice(0,t),n.value];if(y(o),!n.children?.length){const t=Fo(e,o);i?.(o,t),u||x(!1)}},[b,e,i,u]),z=(0,l.useCallback)(e=>{"Escape"===e.key?(x(!1),f.current?.focus()):"Enter"!==e.key&&" "!==e.key||g||(e.preventDefault(),x(!0))},[g]),M=function(e,t){const n=[e];let o=e;for(const r of t){const e=o.find(e=>e.value===r);if(!e?.children?.length)break;n.push(e.children),o=e.children}return n}(e,b),N=g?(0,s.createPortal)((0,a.jsx)("div",{ref:m,role:"tree","aria-label":k??"Cascader options",className:n.tkx("flex rounded-lg border overflow-hidden"),style:{position:"absolute",zIndex:9999,top:v.top,left:v.left,backgroundColor:p.surface,borderColor:p.border,boxShadow:`0 4px 16px ${p.bg}80`,animation:h?"none":"tkxFadeIn 0.15s ease"},children:M.map((e,t)=>(0,a.jsx)("ul",{role:"group",className:n.tkx("m-0 p-0 overflow-auto"),style:{listStyle:"none",minWidth:160,maxHeight:260,borderRight:t<M.length-1?`1px solid ${p.border}`:"none"},children:e.map(e=>{const o=b[t]===e.value,r=n.sanitizeString(e.label);return(0,a.jsxs)("li",{role:"treeitem","aria-selected":o,"aria-disabled":e.disabled||void 0,"aria-expanded":e.children?.length?o:void 0,className:n.tkx("flex items-center justify-between px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:o?p.surfaceAlt:"transparent",color:e.disabled?p.textMuted:p.text,opacity:e.disabled?.5:1,cursor:e.disabled?"not-allowed":"pointer"},onClick:()=>$(t,e),onMouseEnter:()=>{e.disabled||y(n=>[...n.slice(0,t),e.value])},children:[(0,a.jsx)("span",{children:r}),e.children&&e.children.length>0&&(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:p.textMuted,flexShrink:0},children:(0,a.jsx)("path",{d:"M10 6l6 6-6 6V6z"})})]},e.value)})},t))}),document.body):null;return(0,a.jsxs)("div",{className:n.tkx("relative font-sans"),onKeyDown:z,children:[k&&(0,a.jsx)("label",{className:n.tkx("block text-sm font-medium mb-1"),style:{color:p.text},children:k}),(0,a.jsxs)("button",{ref:f,type:"button",role:"combobox","aria-expanded":g,"aria-haspopup":"tree","aria-label":k??"Cascader",className:n.tkx("w-full flex items-center justify-between rounded-lg border px-3 py-2 text-sm cursor-pointer"),style:{backgroundColor:p.surface,borderColor:g?p.primary:p.border,color:C?p.text:p.textMuted,outline:"none",minHeight:38,textAlign:"left"},onClick:()=>x(e=>!e),children:[(0,a.jsx)("span",{className:n.tkx("truncate"),children:C||S}),(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:p.textMuted,transform:g?"rotate(180deg)":"rotate(0deg)",transition:h?"none":"transform 0.2s ease",flexShrink:0},children:(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7z"})})]}),N]})},exports.TkxChat=function({messages:e,onSend:r,isLoading:i=!1,placeholder:s="Type a message…",maxLength:d,showTimestamps:c=!1,avatarUser:u,avatarAssistant:p,height:h=480,inputPosition:f="bottom"}){const m=t.useTheme(),g=o.useReducedMotion(),[x,b]=(0,l.useState)(""),y=(0,l.useRef)(null),v=(0,l.useRef)(null);(0,l.useEffect)(()=>{!function(){if(qe||"undefined"==typeof document)return;qe=!0;const e=document.createElement("style");e.textContent="\n @keyframes tkx-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }\n @keyframes tkx-bounce { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }\n .tkx-cursor::after { content:'▋'; display:inline-block; animation:tkx-blink 1s step-start infinite; margin-left:1px; }\n .tkx-dot1 { animation:tkx-bounce 1s ease-in-out infinite; }\n .tkx-dot2 { animation:tkx-bounce 1s ease-in-out 0.2s infinite; }\n .tkx-dot3 { animation:tkx-bounce 1s ease-in-out 0.4s infinite; }\n ",document.head.appendChild(e)}()},[]),(0,l.useEffect)(()=>{const e=y.current;e&&e.scrollTo({top:e.scrollHeight,behavior:g?"auto":"smooth"})},[e,i,g]);const w=(0,l.useCallback)(()=>{const e=x.trim();e&&r&&(r(e),b(""),v.current&&(v.current.style.height="auto"))},[x,r]),k=(0,l.useCallback)(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),w())},[w]),S=(0,l.useCallback)(e=>{b(d?e.target.value.slice(0,d):e.target.value);const t=v.current;if(t){t.style.height="auto";const e=120;t.style.height=`${Math.min(t.scrollHeight,e)}px`}},[d]),C=x.trim().length>0&&!i,$="number"==typeof h?`${h}px`:h,z="floating"===f,M=(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-1 p-3"),style:z?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:m.surface,border:`1px solid ${m.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${m.border}`,backgroundColor:m.surface},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-end gap-2"),children:[(0,a.jsx)("textarea",{ref:v,rows:1,value:x,onChange:S,onKeyDown:k,placeholder:n.sanitizeString(s),"aria-label":"Message input","aria-multiline":"true",disabled:i,className:n.tkx("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:m.text,caretColor:m.primary,minHeight:32,maxHeight:120}}),(0,a.jsx)("button",{onClick:w,disabled:!C,"aria-label":"Send message",className:n.tkx("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!g&&"transition-opacity duration-150",C?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:m.primary,color:m.bg},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z",fill:"currentColor"})})})]}),d&&(0,a.jsxs)("div",{className:n.tkx("text-right text-[10px]"),style:{color:m.textMuted},children:[x.length,"/",d]})]});return(0,a.jsxs)("div",{className:n.tkx("flex flex-col overflow-hidden rounded-2xl"),style:{height:$,backgroundColor:m.bg,border:`1px solid ${m.border}`,position:"relative"},children:[(0,a.jsx)("div",{ref:y,role:"log","aria-live":"polite","aria-label":"Chat messages",className:n.tkx("flex-1 overflow-y-auto p-4"),style:{paddingBottom:z?80:void 0},children:(0,a.jsxs)("div",{role:"list",children:[e.map(e=>(0,a.jsx)(Ze,{message:e,showTimestamp:c,avatarUser:u,avatarAssistant:p},e.id)),i&&(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex gap-2 mb-4"),children:[(0,a.jsx)("div",{className:n.tkx("w-8 h-8 shrink-0")}),(0,a.jsx)(_e,{})]})]})}),M]})},exports.TkxChatBubble=Ze,exports.TkxCheckbox=K,exports.TkxCheckout=Ir,exports.TkxClock=vt,exports.TkxCol=uo,exports.TkxColorPicker=function({value:e,defaultValue:n="#3b82f6",onChange:o,format:r="hex",showAlpha:i=!1,presets:d=Ft,disabled:c=!1,size:u="md",placeholder:p,label:h,style:f}){const m=t.useTheme(),g=(0,l.useRef)(null),x=(0,l.useRef)(null),[b,y]=(0,l.useState)(!1),v=void 0!==e,[w,k]=(0,l.useState)(v&&e||n),S=v?e||n:w,[C,$]=(0,l.useState)(1),[z,M]=(0,l.useState)(S),[N,I]=(0,l.useState)({top:0,left:0}),[L,R,D]=Tt(Et(S)?S:n);Math.round(D+R/100*Math.min(D/100,1-D/100)*100);const T=(0,l.useCallback)((e,t=C)=>{Et(e)&&(M(e),v||k(e),o?.(Ht(e,t,r),r))},[C,v,r,o]);(0,l.useEffect)(()=>{v&&e&&Et(e)&&M(e)},[v,e]),(0,l.useEffect)(()=>{if(!b)return;const e=e=>{x.current&&!x.current.contains(e.target)&&g.current&&!g.current.contains(e.target)&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b]),(0,l.useEffect)(()=>{if(!b)return;const e=e=>{"Escape"===e.key&&y(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[b]);const W=e=>{$(e),o?.(Ht(S,e,r),r)},A={sm:28,md:34,lg:40}[u],[B,E,H]=At(Et(S)?S:n),F={display:"inline-flex",alignItems:"center",gap:"8px",height:`${A}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${m.border}`,backgroundColor:m.surface,cursor:c?"not-allowed":"pointer",opacity:c?.5:1,color:m.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...f},j={width:A-8+"px",height:A-8+"px",borderRadius:"4px",backgroundColor:`rgba(${B},${E},${H},${C})`,border:`1px solid ${m.border}`,flexShrink:0},P={position:"absolute",top:N.top,left:N.left,zIndex:9999,width:"260px",backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},O={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},V={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},U=e=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:e,border:e.toLowerCase()===S.toLowerCase()?`2px solid ${m.primary}`:`1px solid ${m.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});return(0,a.jsxs)(a.Fragment,{children:[h&&(0,a.jsx)("label",{style:{display:"block",fontSize:"13px",color:m.text,marginBottom:"6px",fontWeight:500},children:h}),(0,a.jsxs)("button",{ref:g,type:"button",style:F,onClick:()=>{if(c)return;const e=g.current;if(!e)return;const t=e.getBoundingClientRect();I({top:(window.innerHeight-t.bottom>320?t.bottom+6:t.top-326)+window.scrollY,left:t.left+window.scrollX}),y(!0)},disabled:c,"aria-label":`Color picker, current color ${S}`,"aria-haspopup":"dialog","aria-expanded":b,children:[(0,a.jsx)("div",{style:j}),(0,a.jsx)("span",{style:{fontFamily:"monospace",fontSize:"12px",color:m.textMuted},children:p??Ht(Et(S)?S:n,C,r)})]}),b&&(0,s.createPortal)((0,a.jsxs)("div",{ref:x,style:P,role:"dialog","aria-label":"Color picker",children:[(0,a.jsx)(jt,{hue:L,sat:R,bright:D,onChange:(e,t)=>{const n=t/100,o=n*(1-e/100/2),r=0===o||1===o?0:(n-o)/Math.min(o,1-o);T(Wt(L,Math.round(100*r),Math.round(100*o)))}}),(0,a.jsx)(Pt,{hue:L,onChange:e=>{T(Wt(e,R,D))}}),i&&(0,a.jsx)(Ot,{alpha:C,hex:Et(S)?S:n,onChange:W}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,a.jsx)("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${B},${E},${H},${C})`,border:`1px solid ${m.border}`}}),(0,a.jsx)("input",{style:O,value:z,onChange:e=>{const t=e.target.value;M(t),Et(t)&&T(t)},maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(e=>(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[(0,a.jsx)("input",{style:V,type:"number",min:0,max:255,value:"r"===e?B:"g"===e?E:H,onChange:t=>((e,t)=>{const n=Math.max(0,Math.min(255,parseInt(t)||0)),[o,r,i]=At(S);T("r"===e?Bt(n,r,i):"g"===e?Bt(o,n,i):Bt(o,r,n))})(e,t.target.value),"aria-label":`${e.toUpperCase()} channel`}),(0,a.jsx)("span",{style:{fontSize:"10px",color:m.textMuted,textTransform:"uppercase"},children:e})]},e)),i&&(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[(0,a.jsx)("input",{style:V,type:"number",min:0,max:100,value:Math.round(100*C),onChange:e=>W(Math.max(0,Math.min(1,parseInt(e.target.value)/100||0))),"aria-label":"Alpha channel"}),(0,a.jsx)("span",{style:{fontSize:"10px",color:m.textMuted},children:"A%"})]})]}),d.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontSize:"11px",color:m.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),(0,a.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:d.map(e=>(0,a.jsx)("button",{type:"button",style:U(e),onClick:()=>T(e),"aria-label":`Select color ${e}`,onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.15)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"}},e))})]})]}),document.body)]})},exports.TkxCommand=tn,exports.TkxConfetti=vr,exports.TkxConfigProvider=ho,exports.TkxContent=oo,exports.TkxCountdown=function({title:e,value:o,format:r="HH:mm:ss",onFinish:i,prefix:a,suffix:s,style:d}){const c=t.useTheme(),u=n.sanitizeString(e),p=(0,l.useRef)(i);p.current=i;const h=(0,l.useRef)(!1),[f,m]=(0,l.useState)(()=>Math.max(0,o-Date.now()));(0,l.useEffect)(()=>{h.current=!1;const e=()=>{const e=Math.max(0,o-Date.now());m(e),e<=0&&!h.current&&(h.current=!0,p.current?.())};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[o]);const g=function(e,t){if(e<=0)return t.replace(/DD?/g,"0").replace(/HH?/g,"00").replace(/mm?/g,"00").replace(/ss?/g,"00");const n=Math.floor(e/1e3),o=Math.floor(n/86400),r=Math.floor(n%86400/3600),i=Math.floor(n%3600/60),l=n%60,a=e=>String(e).padStart(2,"0");return t.replace(/DD/g,a(o)).replace(/D/g,String(o)).replace(/HH/g,a(r)).replace(/H/g,String(r)).replace(/mm/g,a(i)).replace(/m/g,String(i)).replace(/ss/g,a(l)).replace(/s/g,String(l))}(f,r);return(0,l.createElement)("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...d}},(0,l.createElement)("div",{style:{color:c.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},u),(0,l.createElement)("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:f<=0?c.danger:c.text,fontVariantNumeric:"tabular-nums"}},a&&(0,l.createElement)("span",{style:{fontSize:"0.75em",fontWeight:400}},a),(0,l.createElement)("span",null,g),s&&(0,l.createElement)("span",{style:{fontSize:"0.6em",fontWeight:400,color:c.textMuted}},s)))},exports.TkxCurrencyInput=xr,exports.TkxDataGrid=function({columns:e,data:i,rowKey:s,selectable:d=!1,selectedRows:c=[],onSelectionChange:u,sortable:p=!1,onSort:h,loading:f=!1,emptyMessage:m,stickyHeader:g=!1,striped:x=!1,bordered:b=!1,compact:y=!1,maxHeight:v,onRowClick:w,virtualScroll:k,rowHeight:S=40,showFilters:C=!1,filterValues:$,onFilterChange:z,pageSize:M=0,showExport:N=!1,exportFileName:I="export",onLoadMore:L,hasMore:R,loadingMore:D=!1,loadMoreThreshold:T=200}){const A=t.useTheme(),B=r.useLocale(),E=m??B.noRows??B.noData??"No data to display",H=o.useReducedMotion(),F=(0,l.useId)(),[j,P]=(0,l.useState)(null),[O,V]=(0,l.useState)("asc"),U=(0,l.useCallback)(e=>{const t=j===e&&"asc"===O?"desc":"asc";P(e),V(t),h?.(e,t)},[j,O,h]),K=(0,l.useMemo)(()=>h||!j?i:[...i].sort((e,t)=>{const n=function(e,t){return null==e&&null==t?0:null==e?1:null==t?-1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}(Mn(e,j),Mn(t,j));return"asc"===O?n:-n}),[i,j,O,h]),[Y,q]=(0,l.useState)({}),X=$??Y,G=(0,l.useCallback)((e,t)=>{z?z(e,t):q(n=>({...n,[e]:t}))},[z]),_=(0,l.useMemo)(()=>{const e=Object.entries(X).filter(([,e])=>""!==e.trim());return 0===e.length?K:K.filter(t=>e.every(([e,n])=>{const o=Mn(t,e);return String(o??"").toLowerCase().includes(n.toLowerCase())}))},[K,X]),[Z,J]=(0,l.useState)(1),Q=M>0,ee=_.length,te=Q?Math.max(1,Math.ceil(ee/M)):1;(0,l.useEffect)(()=>{J(1)},[X,j,O]);const ne=(0,l.useMemo)(()=>Q?_.slice((Z-1)*M,Z*M):_,[_,Q,Z,M]),oe=void 0!==k?k:!Q&&void 0!==v&&ne.length>=50,re=(0,l.useRef)(null),[ie,le]=(0,l.useState)(0),[ae,se]=(0,l.useState)(0),de=(0,l.useCallback)(()=>{re.current&&le(re.current.scrollTop)},[]);(0,l.useEffect)(()=>{if(!oe||!re.current)return;const e=re.current;se(e.clientHeight);const t=new ResizeObserver(()=>se(e.clientHeight));return t.observe(e),()=>t.disconnect()},[oe]),ne.length;const ce=oe?Math.max(0,Math.floor(ie/S)-10):0,ue=oe?Math.min(ne.length,Math.ceil((ie+ae)/S)+10):ne.length,pe=oe?ne.slice(ce,ue):ne,he=ce*S,fe=(0,l.useRef)(null),me=(0,l.useRef)(!1);(0,l.useEffect)(()=>{me.current=!1},[i.length]),(0,l.useEffect)(()=>{if(!L)return;const e=fe.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!me.current&&!1!==R&&(me.current=!0,L())},{root:re.current,rootMargin:`0px 0px ${T}px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[L,R,T]);const ge=(0,l.useMemo)(()=>new Set(c),[c]),xe=(0,l.useMemo)(()=>_.map(e=>zn(e,s)),[_,s]),be=xe.length>0&&xe.every(e=>ge.has(e)),ye=xe.some(e=>ge.has(e)),ve=(0,l.useCallback)(()=>{u?.(be?[]:xe)},[be,xe,u]),we=(0,l.useCallback)(e=>{const t=ge.has(e)?c.filter(t=>t!==e):[...c,e];u?.(t)},[ge,c,u]),[ke,Se]=(0,l.useState)({}),Ce=(0,l.useRef)(null),$e=(0,l.useCallback)((e,t)=>{t.preventDefault(),t.stopPropagation();const n=t.target.closest("th");if(!n)return;const o=ke[e]||n.getBoundingClientRect().width;Ce.current={key:e,startX:t.clientX,startWidth:o};const r=e=>{if(!Ce.current)return;const t=Math.max(50,Ce.current.startWidth+e.clientX-Ce.current.startX);Se(e=>({...e,[Ce.current.key]:t}))},i=()=>{Ce.current=null,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)},[ke]),ze=(0,l.useCallback)(()=>{const t=[e.map(e=>Nn(e.header)).join(","),..._.map(t=>e.map(e=>Nn(Mn(t,e.key))).join(","))].join("\n"),n=new Blob([t],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download=`${I}.csv`,r.click(),URL.revokeObjectURL(o)},[e,_,I]),Me=y?"4px":"8px",Ne=y?"8px":"12px",Ie=e=>{const t=ke[e.key]||e.width;return{width:null!=t?t:void 0,minWidth:null!=t?t:80,textAlign:e.align??"left",padding:`${Me} ${Ne}`}},Le=b?`1px solid ${A.border}`:"none",Re=n.sanitizeString(E),De=e.length+(d?1:0),Te=e.some(e=>e.filterable);return(0,a.jsxs)("div",{role:"grid","aria-label":"Data grid","aria-rowcount":ee,id:F,className:n.tkx("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${A.border}`,backgroundColor:A.bg},children:[(0,a.jsx)(Ln,{label:"data grid",showExport:N,onExport:ze,totalRows:ee,selectedCount:c.length,theme:A}),(0,a.jsxs)("div",{ref:re,onScroll:oe?de:void 0,style:{maxHeight:v??"none",overflowX:"auto",overflowY:v?"auto":"visible"},children:[(0,a.jsxs)("table",{className:n.tkx("w-full"),style:{borderCollapse:"separate",borderSpacing:0,tableLayout:"auto"},children:[(0,a.jsxs)("thead",{children:[(0,a.jsxs)("tr",{role:"row",children:[d&&(0,a.jsx)("th",{scope:"col",role:"columnheader",style:{position:g?"sticky":"static",top:0,zIndex:2,backgroundColor:A.surface,borderBottom:`2px solid ${A.border}`,borderRight:Le,padding:`${Me} ${Ne}`,width:40,textAlign:"center"},children:(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},children:[(0,a.jsx)("input",{type:"checkbox",checked:be,ref:e=>{e&&(e.indeterminate=ye&&!be)},onChange:ve,"aria-label":be?"Deselect all rows":"Select all rows",style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),(0,a.jsx)($n,{checked:be,indeterminate:ye&&!be})]})}),e.map(e=>{const t=(e.sortable??p)&&!1!==e.sortable,o=j===e.key,r=n.sanitizeString(e.header);return(0,a.jsx)("th",{scope:"col",role:"columnheader","aria-sort":o?"asc"===O?"ascending":"descending":t?"none":void 0,className:n.tkx("text-xs font-semibold uppercase tracking-wider"),style:{...Ie(e),position:g?"sticky":"static",top:0,zIndex:2,backgroundColor:A.surface,color:A.textMuted,borderBottom:`2px solid ${A.border}`,borderRight:Le,cursor:t?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:H?"none":"background-color 150ms ease"},onClick:t?()=>U(e.key):void 0,onKeyDown:t?t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),U(e.key))}:void 0,tabIndex:t?0:void 0,children:(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1"),style:{position:"relative"},children:[e.renderHeader?e.renderHeader(e):r,t&&(0,a.jsx)(Cn,{direction:o?O:null}),e.resizable&&(0,a.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${r}`,className:n.tkx("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:t=>$e(e.key,t)})]})},e.key)})]}),(C||Te)&&(0,a.jsxs)("tr",{role:"row","aria-label":"Column filters",children:[d&&(0,a.jsx)("th",{scope:"col",style:{backgroundColor:A.surfaceAlt,borderBottom:`1px solid ${A.border}`,borderRight:Le,padding:`4px ${Ne}`,width:40}}),e.map(e=>(0,a.jsx)("th",{scope:"col",style:{backgroundColor:A.surfaceAlt,borderBottom:`1px solid ${A.border}`,borderRight:Le,padding:`4px ${Ne}`},children:(e.filterable||C)&&(0,a.jsx)("input",{type:"text",value:X[e.key]??"",onChange:t=>G(e.key,t.target.value),placeholder:`${B.filterPlaceholder.replace(/[.…]+$/,"")} ${e.header}…`,"aria-label":`Filter by ${e.header}`,style:{width:"100%",padding:"3px 8px",fontSize:12,borderRadius:4,border:`1px solid ${A.border}`,backgroundColor:A.bg,color:A.text,outline:"none"}})},e.key))]})]}),f&&(0,a.jsx)(In,{colCount:De}),!f&&(0,a.jsx)("tbody",{children:0===ne.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:De,className:n.tkx("text-center py-10"),style:{color:A.textMuted},children:Re})}):(0,a.jsxs)(a.Fragment,{children:[oe&&he>0&&(0,a.jsx)("tr",{"aria-hidden":"true",children:(0,a.jsx)("td",{colSpan:De,style:{height:he,padding:0,border:"none"}})}),pe.map((t,o)=>{const r=ce+o,i=zn(t,s),l=ge.has(i),c=x&&r%2==1;let u="transparent";return l?u=`${A.primary}22`:c&&(u=A.surfaceAlt),(0,a.jsxs)("tr",{role:"row","aria-rowindex":r+1,"aria-selected":d?l:void 0,onClick:w?()=>w(t):void 0,onKeyDown:w?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w(t))}:void 0,tabIndex:w?0:void 0,className:n.tkx(w?"cursor-pointer":""),style:{backgroundColor:u,transition:H?"none":"background-color 120ms ease",...oe?{height:S,boxSizing:"border-box"}:{}},onMouseEnter:w?e=>{e.currentTarget.style.backgroundColor=l?`${A.primary}30`:A.surfaceAlt}:void 0,onMouseLeave:w?e=>{e.currentTarget.style.backgroundColor=u}:void 0,children:[d&&(0,a.jsx)("td",{role:"gridcell",style:{borderBottom:`1px solid ${A.border}`,borderRight:Le,padding:`${Me} ${Ne}`,textAlign:"center",width:40},children:(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("input",{type:"checkbox",checked:l,onChange:()=>we(i),"aria-label":l?`Deselect row ${i}`:`Select row ${i}`,style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),(0,a.jsx)($n,{checked:l})]})}),e.map(e=>{const o=Mn(t,e.key),r=e.renderCell?e.renderCell(o,t):"string"==typeof o?n.sanitizeString(o):String(o??"");return(0,a.jsx)("td",{role:"gridcell",className:n.tkx("text-sm"),style:{...Ie(e),borderBottom:`1px solid ${A.border}`,borderRight:Le,color:A.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r},e.key)})]},i)}),oe&&ue<ne.length&&(0,a.jsx)("tr",{"aria-hidden":"true",children:(0,a.jsx)("td",{colSpan:De,style:{height:(ne.length-ue)*S,padding:0,border:"none"}})})]})})]}),(R||D)&&(0,a.jsx)("div",{ref:fe,style:{height:1,width:"100%"},children:D&&(0,a.jsx)("table",{style:{width:"100%",borderCollapse:"collapse"},children:(0,a.jsx)("tbody",{children:Array.from({length:3},(t,n)=>(0,a.jsx)("tr",{children:e.map(e=>(0,a.jsx)("td",{style:{padding:"10px 16px"},children:(0,a.jsx)(W,{variant:"text",height:"16px"})},e.key))},n))})})}),!R&&L&&(0,a.jsx)("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:A.textMuted},children:"✓ All rows loaded"})]}),Q&&!f&&(0,a.jsx)(Rn,{page:Z,totalPages:te,pageSize:M,totalRows:ee,onPageChange:J,theme:A})]})},exports.TkxDatePicker=$e,exports.TkxDivider=F,exports.TkxDrawer=function({isOpen:e,onClose:r,placement:i="right",size:d="md",title:c,children:u,footer:p,closeOnOverlayClick:h=!0,closeOnEsc:f=!0}){const m=t.useTheme(),g=o.useReducedMotion(),x=(0,l.useId)(),b=o.useFocusTrap(e);if(o.useEscapeKey(r,f&&e),(0,l.useEffect)(()=>{if(e){if(1===++ue&&(document.body.style.overflow="hidden"),n.isFramed())try{window.dispatchEvent(new CustomEvent("tkx:framed-drawer",{detail:{placement:i,at:Date.now()}}))}catch{}}else pe();return()=>{e&&pe()}},[e,i]),"undefined"==typeof document)return null;const y=function(e,t){const n=ce[t],o={position:"absolute"};return"left"===e||"right"===e?{...o,top:0,bottom:0,[e]:0,width:n,maxWidth:"100vw",height:"100%"}:{...o,left:0,right:0,[e]:0,height:n,maxHeight:"100vh",width:"100%"}}(i,d),v=function(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}(i),w=g?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",k="string"==typeof c?n.sanitizeString(c):c;return(0,s.createPortal)((0,a.jsxs)("div",{role:"presentation",className:n.tkx("fixed inset-0 z-[9000]"),style:{pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden"},children:[(0,a.jsx)("div",{"aria-hidden":"true",onClick:h?r:void 0,className:n.tkx("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:g?"none":"opacity 280ms ease",cursor:h?"pointer":"default"}}),(0,a.jsxs)("div",{ref:b,role:"dialog","aria-modal":"true","aria-labelledby":c?x:void 0,className:n.tkx("absolute flex flex-col font-sans"),style:{...y,backgroundColor:m.surface,borderLeft:"right"===i?`1px solid ${m.border}`:void 0,borderRight:"left"===i?`1px solid ${m.border}`:void 0,borderTop:"bottom"===i?`1px solid ${m.border}`:void 0,borderBottom:"top"===i?`1px solid ${m.border}`:void 0,boxShadow:`0 20px 60px ${m.bg}99`,transform:e?"translate(0,0)":v,opacity:e?1:0,transition:w,willChange:"transform"},children:[void 0!==c&&(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${m.border}`},children:[(0,a.jsx)("h2",{id:x,className:n.tkx("m-0 text-base font-semibold leading-snug"),style:{color:m.text},children:k}),(0,a.jsx)("button",{onClick:r,"aria-label":"Close drawer",className:n.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:m.textMuted},children:(0,a.jsx)(he,{})})]}),void 0===c&&(0,a.jsx)("div",{className:n.tkx("flex justify-end px-3 pt-3 shrink-0"),children:(0,a.jsx)("button",{onClick:r,"aria-label":"Close drawer",className:n.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:m.textMuted},children:(0,a.jsx)(he,{})})}),(0,a.jsx)("div",{className:n.tkx("flex-1 overflow-y-auto px-5 py-4"),style:{color:m.text},children:u}),p&&(0,a.jsx)("div",{className:n.tkx("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${m.border}`},children:p})]})]}),document.body)},exports.TkxDrivingLicenceInput=Kr,exports.TkxDropdown=function({trigger:e,items:t,groups:n,placement:o="bottom-start",onSelect:r,selectedKeys:i,multiSelect:d=!1,searchable:c=!1,searchPlaceholder:u,closeOnSelect:p,disabled:h=!1,maxHeight:f=320,minWidth:m=200,open:g,onOpenChange:x,portal:b=!0,offset:y=6,renderItem:v}){const[w,k]=(0,l.useState)(!1),[S,C]=(0,l.useState)([]),[$,z]=(0,l.useState)({top:0,left:0,minWidth:m}),M=(0,l.useRef)(null),N=(0,l.useRef)(null),I=(0,l.useId)(),L=void 0!==g?g:w,R=void 0!==i?i:S,D=void 0!==p?p:!d,T=n??(t?[{items:t}]:[{items:[]}]),W=(0,l.useCallback)(e=>{void 0===g&&k(e),x?.(e)},[g,x]),A=(0,l.useCallback)((e,t)=>{d&&void 0===i&&C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),r?.(e,t),D&&W(!1)},[d,i,r,D,W]),B=(0,l.useCallback)(()=>W(!1),[W]);(0,l.useEffect)(()=>{L&&M.current&&z(ei(M.current,N.current,o,y))},[L,o,y]),(0,l.useEffect)(()=>{L&&M.current&&N.current&&z(ei(M.current,N.current,o,y))},[L,o,y]),(0,l.useEffect)(()=>{if(!L)return;const e=e=>{const t=e.target;M.current&&!M.current.contains(t)&&N.current&&!N.current.contains(t)&&W(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[L,W]);const E=L?(0,a.jsx)(ni,{groups:T,position:$,maxHeight:f,minWidth:m,selectedKeys:R,multiSelect:d,searchable:c,searchPlaceholder:u,onSelect:A,onClose:B,renderItem:v,menuRef:N,isPortal:b,menuId:I}):null;return(0,a.jsxs)("div",{style:{display:"inline-block",position:"relative"},children:[(0,a.jsx)("div",{ref:M,onClick:()=>{h||W(!L)},"aria-haspopup":"menu","aria-expanded":L,"aria-controls":L?I:void 0,"aria-disabled":h,style:{cursor:h?"not-allowed":"pointer",opacity:h?.5:1,display:"inline-block"},children:e}),b&&"undefined"!=typeof document?(0,s.createPortal)(E,document.body):E]})},exports.TkxEmpty=function({image:e="default",description:o="No data",children:r,style:i}){const a=t.useTheme(),s="string"==typeof o?n.sanitizeString(o):o;let d;return d="default"===e?(0,l.createElement)($o,{color:a.primary,mutedColor:a.textMuted}):"simple"===e?(0,l.createElement)(zo,{mutedColor:a.textMuted}):e,(0,l.createElement)("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...i}},(0,l.createElement)("div",{style:{marginBottom:"12px",opacity:.85}},d),s&&(0,l.createElement)("div",{style:{color:a.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},s),r&&(0,l.createElement)("div",{style:{marginTop:"16px"}},r))},exports.TkxFileUpload=function({accept:e,multiple:i=!1,maxSize:s,maxFiles:d,onChange:c,onError:u,label:p,hint:h,isDisabled:f=!1,preview:m=!0,dragDrop:g=!0,variant:x="dropzone"}){const b=t.useTheme(),y=r.useLocale(),v=p??y.uploadFiles??"Upload files",w=y.dropFiles?.replace(/^.*$/,y.dropFiles)??"Drop files here",k=o.useReducedMotion(),S=(0,l.useId)(),C=(0,l.useRef)(null),[$,z]=(0,l.useState)(!1),[M,N]=(0,l.useState)([]);(0,l.useEffect)(()=>()=>{M.forEach(e=>{e.objectUrl&&URL.revokeObjectURL(e.objectUrl)})},[]);const I=(0,l.useCallback)(e=>{let t=0;const n=setInterval(()=>{t+=Math.floor(20*Math.random())+10,t>=100&&(t=100,clearInterval(n)),N(n=>n.map(n=>n.id===e?{...n,progress:t}:n))},100)},[]),L=(0,l.useCallback)(t=>s&&t.size>s?`"${n.sanitizeString(t.name)}" exceeds max size of ${Ee(s)}`:/[\u0000-\u001F\u007F]|\.\.\/|\.\.\\/.test(t.name)?`"${n.sanitizeString(t.name)}" contains forbidden characters`:e&&!e.split(",").map(e=>e.trim()).some(e=>e.startsWith(".")?t.name.toLowerCase().endsWith(e.toLowerCase()):e.endsWith("/*")?t.type.startsWith(e.slice(0,-1)):t.type===e)?`"${n.sanitizeString(t.name)}" is not an accepted file type`:void 0,[e,s]),R=(0,l.useCallback)(async e=>{if(!e.error)try{const t=await n.sniffMimeType(e.file);if(t&&e.file.type&&!e.file.type.startsWith(t.split("/")[0])){const t=`"${n.sanitizeString(e.file.name)}" file content does not match its type`;N(n=>n.map(n=>n.id===e.id?{...n,error:t}:n)),u?.(t)}}catch{}},[u]),D=(0,l.useCallback)(e=>{const t=d?d-M.length:1/0;if(t<=0)return void u?.(`Maximum of ${d} file${1===d?"":"s"} allowed`);const n=e.slice(0,t).map(e=>{const t=L(e),n=m&&e.type.startsWith("image/")&&!t?URL.createObjectURL(e):void 0;return{file:e,id:"tkx-file-"+ ++Fe,objectUrl:n,progress:0,error:t}});N(e=>{const t=i?[...e,...n]:n,o=t.filter(e=>!e.error).map(e=>e.file);return c?.(o),t}),n.forEach(e=>{e.error?u?.(e.error):R(e)}),n.forEach(e=>{e.error||I(e.id)})},[M.length,d,i,c,u,m,I,L]),T=(0,l.useCallback)(e=>{const t=Array.from(e.target.files??[]);t.length&&D(t),e.target.value=""},[D]),W=(0,l.useCallback)(e=>{if(e.preventDefault(),z(!1),f)return;const t=Array.from(e.dataTransfer.files);t.length&&D(t)},[f,D]),A=(0,l.useCallback)(e=>{e.preventDefault(),f||z(!0)},[f]),B=(0,l.useCallback)(()=>z(!1),[]),E=(0,l.useCallback)(e=>{N(t=>{const n=t.find(t=>t.id===e);n?.objectUrl&&URL.revokeObjectURL(n.objectUrl);const o=t.filter(t=>t.id!==e);return c?.(o.filter(e=>!e.error).map(e=>e.file)),o})},[c]),H=(0,l.useCallback)(()=>{f||C.current?.click()},[f]),F=$?b.primary:b.border,j=n.sanitizeString(v),P=h?n.sanitizeString(h):"",O=(0,a.jsxs)("div",{role:"button",tabIndex:f?-1:0,"aria-label":j,"aria-describedby":h?S:void 0,"aria-disabled":f,onClick:H,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),H())},onDrop:g?W:void 0,onDragOver:g?A:void 0,onDragLeave:g?B:void 0,className:n.tkx("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${F}`,backgroundColor:$?`${b.primary}10`:b.surface,cursor:f?"not-allowed":"pointer",opacity:f?.5:1,transition:k?"none":"border-color 150ms ease, background-color 150ms ease",outline:"none"},children:[(0,a.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:$?b.primary:b.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,a.jsx)("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),(0,a.jsxs)("div",{className:n.tkx("text-center"),children:[(0,a.jsx)("p",{className:n.tkx("m-0 text-sm font-medium"),style:{color:b.text},children:$?w:j}),P&&(0,a.jsx)("p",{id:S,className:n.tkx("m-0 text-xs mt-1"),style:{color:b.textMuted},children:P})]})]}),V=(0,a.jsxs)("button",{type:"button",disabled:f,onClick:H,"aria-describedby":h?S:void 0,className:n.tkx("flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer"),style:{backgroundColor:b.primary,color:b.bg,opacity:f?.5:1,cursor:f?"not-allowed":"pointer"},children:[(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,a.jsx)("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),j,h&&(0,a.jsx)("span",{id:S,className:n.tkx("sr-only"),children:P})]});return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-3 w-full font-sans"),children:[(0,a.jsx)("input",{ref:C,type:"file",accept:e,multiple:i,disabled:f,onChange:T,className:n.tkx("sr-only"),tabIndex:-1,"aria-hidden":"true"}),"dropzone"===x?O:V,M.length>0&&(0,a.jsx)("ul",{role:"status","aria-live":"polite","aria-label":y.uploadFiles??"Uploaded files",className:n.tkx("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:M.map(e=>(0,a.jsxs)("li",{className:n.tkx("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:b.surfaceAlt,border:`1px solid ${e.error?b.danger:b.border}`},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-3"),children:[e.objectUrl&&m?(0,a.jsx)("img",{src:e.objectUrl,alt:n.sanitizeString(e.file.name),className:n.tkx("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):(0,a.jsx)("span",{style:{flexShrink:0},children:(0,a.jsx)(He,{mimeType:e.file.type,color:e.error?b.danger:b.textMuted})}),(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-0.5 flex-1 min-w-0"),children:[(0,a.jsx)("span",{className:n.tkx("text-sm font-medium truncate"),style:{color:e.error?b.danger:b.text},title:e.file.name,children:n.sanitizeString(e.file.name)}),(0,a.jsxs)("span",{className:n.tkx("text-xs"),style:{color:b.textMuted},children:[Ee(e.file.size),e.error&&` — ${e.error}`]})]}),(0,a.jsx)("button",{type:"button","aria-label":`Remove ${n.sanitizeString(e.file.name)}`,onClick:()=>E(e.id),className:n.tkx("flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1"),style:{color:b.textMuted,flexShrink:0},children:(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!e.error&&e.progress<100&&(0,a.jsx)("div",{className:n.tkx("w-full overflow-hidden"),style:{height:"3px",borderRadius:"3px",backgroundColor:b.border},"aria-hidden":"true",children:(0,a.jsx)("div",{style:{height:"100%",borderRadius:"3px",backgroundColor:b.primary,width:`${e.progress}%`,transition:k?"none":"width 100ms ease"}})})]},e.id))})]})},exports.TkxFontProvider=function({scripts:e,language:t,preconnect:n=!0,children:o}){const r=e&&e.length>0?e:t?Zo(t):["latin"];return(0,l.useEffect)(()=>{n&&function(){if(Go||"undefined"==typeof document)return;const e=document.head,t=(t,n)=>{if(e.querySelector(`link[rel="preconnect"][href="${t}"]`))return;const o=document.createElement("link");o.rel="preconnect",o.href=t,n&&(o.crossOrigin="anonymous"),e.appendChild(o)};t("https://fonts.googleapis.com"),t("https://fonts.gstatic.com",!0),Go=!0}(),r.forEach(_o)},[r.join(","),n]),null==o?null:(0,a.jsx)(a.Fragment,{children:o})},exports.TkxFooter=ro,exports.TkxForm=i.TkxForm,exports.TkxFormField=i.TkxFormField,exports.TkxHeader=eo,exports.TkxHolographicAvatar=gi,exports.TkxHolographicBadge=yi,exports.TkxHolographicButton=vi,exports.TkxHolographicCard=mi,exports.TkxHolographicSurface=fi,exports.TkxImage=function({src:e,alt:r,fallback:i,placeholder:d="skeleton",fit:c="cover",ratio:u="auto",radius:p="none",caption:h,lazy:f=!0,preview:m=!1,className:g,style:x,...b}){const y=t.useTheme(),v=o.useReducedMotion(),[w,k]=(0,l.useState)(!1),[S,C]=(0,l.useState)(!1),[$,z]=(0,l.useState)(!1),M=(0,l.useRef)(null),N=n.sanitizeString(e),I=r?n.sanitizeString(r):"",L=h?n.sanitizeString(h):"",R=Ae[p];(0,l.useEffect)(()=>{M.current?.complete&&k(!0)},[]);const D=(0,l.useCallback)(()=>k(!0),[]),T=(0,l.useCallback)(()=>C(!0),[]),W=(0,l.useCallback)(()=>{m&&!S&&z(!0)},[m,S]),A=(0,l.useCallback)(()=>z(!1),[]);(0,l.useEffect)(()=>{if(!$)return;const e=e=>{"Escape"===e.key&&A()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[$,A]);const B="skeleton"===d&&!w&&!S,E=B&&!v?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},H=S?null:(0,a.jsx)("img",{ref:M,src:N,alt:I||void 0,role:I?void 0:"img","aria-label":I?void 0:"Image",loading:f?"lazy":void 0,onLoad:D,onError:T,onClick:m?W:void 0,className:n.cx(n.tkx("block w-full h-full"),m&&!S?n.tkx("cursor-pointer"):""),style:{objectFit:c,borderRadius:R,opacity:w?1:0,transition:v?"none":"opacity 200ms ease",position:"auto"===u?void 0:"absolute",inset:"auto"===u?void 0:0},...b}),F=S?i?(0,a.jsx)(a.Fragment,{children:i}):(0,a.jsxs)("div",{role:"img","aria-label":I||"Image failed to load",className:n.tkx("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:y.surfaceAlt,borderRadius:R,color:y.textMuted,minHeight:"80px"},children:[(0,a.jsx)(Be,{color:y.textMuted,size:32}),(0,a.jsx)("span",{className:n.tkx("text-xs"),style:{color:y.textMuted},children:"Failed to load"})]}):null,j=B?(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"auto"===u?void 0:"absolute",inset:"auto"===u?void 0:0,width:"100%",height:"auto"===u?"100%":void 0,minHeight:"auto"===u?"80px":void 0,borderRadius:R,backgroundColor:y.surfaceAlt,...E}}):null,P="auto"===u?(0,a.jsxs)("div",{className:n.tkx("relative w-full"),style:{borderRadius:R},children:[j,H,F]}):(0,a.jsxs)("div",{className:n.tkx("relative w-full overflow-hidden"),style:{paddingBottom:We[u],borderRadius:R},children:[j,H,F]}),O=L?(0,a.jsxs)("figure",{className:n.tkx("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:R},children:[P,(0,a.jsx)("figcaption",{className:n.tkx("text-sm text-center"),style:{color:y.textMuted},children:L})]}):P;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n.cx(n.tkx("inline-block w-full"),g),style:x,children:O}),$&&"undefined"!=typeof document?(0,s.createPortal)((0,a.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":I||"Image preview",className:n.tkx("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:A,children:[(0,a.jsx)("div",{"aria-hidden":"true",className:n.tkx("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),(0,a.jsx)("img",{src:N,alt:I||"Full-size preview",onClick:e=>e.stopPropagation(),className:n.tkx("relative z-10 max-w-full max-h-full"),style:{objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)"}}),(0,a.jsx)("button",{"aria-label":"Close preview",onClick:A,className:n.tkx("absolute top-4 right-4 z-10 flex items-center justify-center","bg-transparent border-none cursor-pointer rounded-full p-2"),style:{color:"#fff",backgroundColor:"rgba(255,255,255,0.15)"},children:(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null]})},exports.TkxImageEditor=lr,exports.TkxInput=x,exports.TkxKanban=wi,exports.TkxLayout=Qn,exports.TkxList=function({items:e,header:r,footer:i,bordered:l=!0,size:s="md",loading:d=!1,emptyText:c="No data",grid:u}){const p=t.useTheme(),h=o.useReducedMotion(),f=n.sanitizeString(c),m=jo[s],g=!!u,x=u?.column??1,b=u?.gutter??16;return(0,a.jsxs)("div",{role:"list","aria-label":"List","aria-busy":d,className:n.tkx("font-sans rounded-lg overflow-hidden"),style:{border:l?`1px solid ${p.border}`:"none",backgroundColor:p.surface},children:[r&&(0,a.jsx)("div",{className:n.tkx("font-semibold text-sm"),style:{padding:m,color:p.text,borderBottom:`1px solid ${p.border}`,backgroundColor:p.surfaceAlt},children:r}),d&&(0,a.jsx)("div",{children:Array.from({length:3}).map((e,t)=>(0,a.jsx)(Po,{theme:p,reducedMotion:h},t))}),!d&&0===e.length&&(0,a.jsx)("div",{role:"status",className:n.tkx("text-center py-12 text-sm"),style:{color:p.textMuted},children:f}),!d&&e.length>0&&(0,a.jsx)("div",{style:g?{display:"grid",gridTemplateColumns:`repeat(${x}, 1fr)`,gap:b,padding:b}:void 0,children:e.map((t,o)=>{const r=n.sanitizeString(t.title),i=t.description?n.sanitizeString(t.description):void 0;return(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex items-start gap-3"),style:{padding:m,borderBottom:!g&&o<e.length-1?`1px solid ${p.border}`:"none",...g?{border:`1px solid ${p.border}`,borderRadius:8,backgroundColor:p.surface}:{},animation:h?"none":`tkxFadeIn 0.2s ease ${.03*o}s both`},children:[t.avatar&&(0,a.jsx)("div",{"aria-hidden":"true",className:n.tkx("shrink-0"),children:t.avatar}),(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[(0,a.jsx)("div",{className:n.tkx("text-sm font-medium"),style:{color:p.text},children:r}),i&&(0,a.jsx)("div",{className:n.tkx("text-xs mt-1 leading-relaxed"),style:{color:p.textMuted},children:i})]}),t.extra&&(0,a.jsx)("div",{className:n.tkx("shrink-0 ml-auto"),style:{color:p.textMuted},children:t.extra}),t.actions&&(0,a.jsx)("div",{className:n.tkx("shrink-0 flex items-center gap-2"),children:t.actions})]},t.key)})}),i&&(0,a.jsx)("div",{className:n.tkx("text-sm"),style:{padding:m,color:p.textMuted,borderTop:`1px solid ${p.border}`,backgroundColor:p.surfaceAlt},children:i})]})},exports.TkxMarkdown=Gn,exports.TkxMasonry=function({columns:e,gap:r=16,children:i}){t.useTheme();const s=o.useReducedMotion(),d=function(){const[e,t]=(0,l.useState)(()=>{if("undefined"==typeof window)return"lg";const e=window.innerWidth;return e>=1024?"lg":e>=768?"md":"sm"});return(0,l.useEffect)(()=>{if("undefined"==typeof window)return;const e=()=>{const e=window.innerWidth;t(e>=1024?"lg":e>=768?"md":"sm")};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}();(0,l.useEffect)(()=>{!function(){if(Dn||"undefined"==typeof document)return;Dn=!0;const e=document.createElement("style");e.id="tkx-masonry-kf",e.textContent="\n @keyframes tkx-masonry-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}()},[]);const c=function(e,t){return void 0===e?3:"number"==typeof e?Math.max(1,e):"lg"===t?e.lg??e.md??e.sm??3:"md"===t?e.md??e.sm??2:e.sm??1}(e,d),u=l.Children.toArray(i),p=(0,l.useMemo)(()=>{const e=Array.from({length:c},()=>[]);return u.forEach((t,n)=>{e[n%c].push(t)}),e},[u,c]);return(0,a.jsx)("div",{role:"list","aria-label":"Masonry grid",className:n.tkx("flex w-full"),style:{gap:r,alignItems:"flex-start"},children:p.map((e,t)=>(0,a.jsx)("div",{className:n.tkx("flex flex-col"),style:{flex:1,gap:r,minWidth:0},children:e.map((e,n)=>{return(0,a.jsx)("div",{role:"listitem",style:(o=n*c+t,s?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(40*o,400)}ms`}),children:e},n);var o})},t))})},exports.TkxMentions=function({options:e,value:r="",onChange:i,trigger:s="@",placeholder:d,label:c}){const u=t.useTheme(),p=o.useReducedMotion(),h=(0,l.useRef)(null),f=(0,l.useRef)(null),[m,g]=(0,l.useState)(r),[x,b]=(0,l.useState)(!1),[y,v]=(0,l.useState)(""),[w,k]=(0,l.useState)(0),[S,C]=(0,l.useState)(-1);(0,l.useEffect)(()=>{void 0!==r&&g(r)},[r]);const $=e.filter(e=>e.label.toLowerCase().includes(y.toLowerCase())),z=(0,l.useCallback)(e=>{const t=e.target.value;g(t),i?.(t);const n=e.target.selectionStart??t.length,o=t.slice(0,n),r=o.lastIndexOf(s);if(r>=0){const e=o.slice(r+s.length);if(!/\s/.test(e))return v(e),C(r),b(!0),void k(0)}b(!1)},[s,i]),M=(0,l.useCallback)(e=>{const t=m.slice(0,S),n=m.slice(S+s.length+y.length),o=`${t}${s}${e.value} ${n}`;g(o),i?.(o),b(!1),h.current?.focus()},[m,S,s,y,i]),N=(0,l.useCallback)(e=>{x&&("ArrowDown"===e.key?(e.preventDefault(),k(e=>(e+1)%$.length)):"ArrowUp"===e.key?(e.preventDefault(),k(e=>(e-1+$.length)%$.length)):"Enter"===e.key&&$[w]?(e.preventDefault(),M($[w])):"Escape"===e.key&&b(!1))},[x,$,w,M]);(0,l.useEffect)(()=>{x&&f.current&&f.current.children[w]?.scrollIntoView({block:"nearest"})},[w,x]);const I=c?n.sanitizeString(c):void 0,L=d?n.sanitizeString(d):void 0;return(0,a.jsxs)("div",{className:n.tkx("relative font-sans"),style:{width:"100%"},children:[I&&(0,a.jsx)("label",{className:n.tkx("block text-sm font-medium mb-1"),style:{color:u.text},children:I}),(0,a.jsx)("textarea",{ref:h,role:"combobox","aria-expanded":x,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-label":I??"Mentions input",value:m,placeholder:L,onChange:z,onKeyDown:N,onBlur:()=>setTimeout(()=>b(!1),200),className:n.tkx("w-full rounded-lg border px-3 py-2 text-sm resize-y"),style:{backgroundColor:u.surface,borderColor:u.border,color:u.text,minHeight:80,outline:"none"},rows:3}),x&&$.length>0&&(0,a.jsx)("ul",{ref:f,role:"listbox","aria-label":"Mention suggestions",className:n.tkx("absolute left-0 right-0 z-50 rounded-lg border overflow-auto"),style:{backgroundColor:u.surface,borderColor:u.border,maxHeight:200,top:"100%",marginTop:4,listStyle:"none",padding:0,boxShadow:`0 4px 12px ${u.bg}80`,animation:p?"none":"tkxFadeIn 0.15s ease"},children:$.map((e,t)=>(0,a.jsxs)("li",{role:"option","aria-selected":t===w,className:n.tkx("flex items-center gap-3 px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:t===w?u.surfaceAlt:"transparent",color:u.text},onMouseDown:t=>{t.preventDefault(),M(e)},onMouseEnter:()=>k(t),children:[e.avatar&&(0,a.jsx)("img",{src:n.sanitizeString(e.avatar),alt:"","aria-hidden":"true",width:24,height:24,className:n.tkx("rounded-full"),style:{objectFit:"cover"}}),(0,a.jsx)("span",{children:n.sanitizeString(e.label)}),(0,a.jsxs)("span",{style:{color:u.textMuted,marginLeft:"auto"},children:[s,n.sanitizeString(e.value)]})]},e.value))})]})},exports.TkxMenu=mt,exports.TkxModal=function({isOpen:e,onClose:i,title:d,size:c="md",closeOnOverlayClick:u=!0,closeOnEscape:p=!0,children:h,footer:f}){const m=t.useTheme(),g=r.useLocale(),x=(0,l.useId)(),b=o.useFocusTrap(e),y=o.useReducedMotion(),v=o.useAnnounce(),w=n.sanitizeString(d),k="full"===c;return o.useEscapeKey(i,p&&e),(0,l.useEffect)(()=>{if(e){if(1===++N&&(document.body.style.overflow="hidden"),v(w,"polite"),n.isFramed())try{window.dispatchEvent(new CustomEvent("tkx:framed-modal",{detail:{title:w,at:Date.now()}}))}catch{}}else I();return()=>{e&&I()}},[e,w,v]),e&&"undefined"!=typeof document?(0,s.createPortal)((0,a.jsxs)("div",{role:"presentation",className:n.tkx("fixed inset-0 z-[9000] flex",k?"items-stretch":"items-center justify-center",k?"":"p-4"),children:[(0,a.jsx)("div",{"aria-hidden":"true",onClick:u?i:void 0,className:n.tkx("absolute inset-0",!y&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),(0,a.jsxs)("div",{ref:b,role:"dialog","aria-modal":"true","aria-labelledby":x,className:n.tkx("relative z-10 flex flex-col overflow-hidden",!y&&"animate-slide-up",k?"":"rounded-xl"),style:{backgroundColor:m.surface,border:`1px solid ${m.border}`,width:M[c],maxWidth:"100%",maxHeight:k?"100vh":"90vh",boxShadow:`0 20px 60px ${m.bg}80`},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${m.border}`},children:[(0,a.jsx)("h2",{id:x,className:n.tkx("m-0 text-lg font-semibold font-sans"),style:{color:m.text},children:w}),(0,a.jsx)("button",{onClick:i,"aria-label":g.close,className:n.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:m.textMuted},children:(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,a.jsx)("div",{className:n.tkx("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:m.text},children:h}),f&&(0,a.jsx)("div",{className:n.tkx("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${m.border}`},children:f})]})]}),document.body):null},exports.TkxNumberInput=qt,exports.TkxOTP=Zt,exports.TkxOrgChart=Zr,exports.TkxPagination=Te,exports.TkxPanInput=Hr,exports.TkxParagraph=function({children:e,type:o="default",copyable:r=!1,ellipsis:i=!1,style:a}){const s=t.useTheme(),d="secondary"===o?s.textMuted:s.text,c=xo(e),u="string"==typeof e?n.sanitizeString(e):e,p={};if(i){const e="object"==typeof i?i.rows??3:3;p.display="-webkit-box",p.WebkitLineClamp=e,p.WebkitBoxOrient="vertical",p.overflow="hidden"}return(0,l.createElement)("div",{style:{color:d,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...p,...a}},u,r&&(0,l.createElement)(bo,{text:c}))},exports.TkxPaymentButton=ur,exports.TkxPhoneInput=or,exports.TkxPlanSelector=qr,exports.TkxPopover=function({trigger:e,content:r,placement:i="bottom",isOpen:d,onOpenChange:c,closeOnClickOutside:u=!0,className:p,style:h}){const f=t.useTheme(),m=o.useReducedMotion(),g=(0,l.useId)(),x=void 0!==d,[b,y]=(0,l.useState)(!1),v=x?d:b,w=(0,l.useRef)(null),k=(0,l.useRef)(null);(0,l.useRef)(null);const[S,C]=(0,l.useState)(null),$=(0,l.useCallback)(e=>{x||y(e),c?.(e)},[x,c]),z=(0,l.useCallback)(()=>$(!1),[$]),M=(0,l.useCallback)(()=>$(!v),[$,v]);o.useEscapeKey(z,v),(0,l.useEffect)(()=>{if(!v||!u)return;const e=e=>{const t=e.target;w.current?.contains(t)||k.current?.contains(t)||z()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[v,u,z]),(0,l.useEffect)(()=>{if(!v||!w.current)return;const e=()=>{w.current&&k.current&&C(function(e,t,n){const o=t.getBoundingClientRect(),r=window.scrollX,i=window.scrollY,l=window.innerWidth,a=window.innerHeight;let s=0,d=0,c=n;const u={top:e.top-o.height-8-8>0,bottom:e.bottom+o.height+8+8<a,left:e.left-o.width-8-8>0,right:e.right+o.width+8+8<l};if(!u[n]){const e={top:"bottom",bottom:"top",left:"right",right:"left"};u[e[n]]&&(c=e[n])}switch(c){case"top":s=e.top+i-o.height-8-8,d=e.left+r+e.width/2-o.width/2;break;case"bottom":s=e.bottom+i+8+8,d=e.left+r+e.width/2-o.width/2;break;case"left":s=e.top+i+e.height/2-o.height/2,d=e.left+r-o.width-8-8;break;case"right":s=e.top+i+e.height/2-o.height/2,d=e.right+r+8+8}d=Math.max(8,Math.min(d,l+r-o.width-8)),s=Math.max(8,Math.min(s,a+i-o.height-8));const p={position:"absolute",width:0,height:0,borderStyle:"solid",borderWidth:8};switch(c){case"top":Object.assign(p,{bottom:-16,left:"50%",transform:"translateX(-50%)",borderColor:"var(--tkx-popover-bg) transparent transparent transparent"});break;case"bottom":Object.assign(p,{top:-16,left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent var(--tkx-popover-bg) transparent"});break;case"left":Object.assign(p,{right:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent var(--tkx-popover-bg)"});break;case"right":Object.assign(p,{left:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent var(--tkx-popover-bg) transparent transparent"})}return{top:s,left:d,arrowStyle:p,resolvedPlacement:c}}(w.current.getBoundingClientRect(),k.current,i))};return requestAnimationFrame(e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[v,i]);const N=m?{opacity:1}:{animation:"tkxPopoverFadeIn 150ms ease forwards",opacity:0},I=v&&"undefined"!=typeof document?(0,s.createPortal)((0,a.jsxs)("div",{ref:k,id:g,role:"dialog","aria-modal":"false",className:n.tkx("absolute z-[9100] rounded-lg font-sans",p??""),style:{"--tkx-popover-bg":f.surface,top:S?.top??-9999,left:S?.left??-9999,backgroundColor:f.surface,border:`1px solid ${f.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",minWidth:200,maxWidth:420,padding:"12px 16px",color:f.text,...N,...h},children:[S&&(0,a.jsx)("span",{style:S.arrowStyle,"aria-hidden":"true"}),r]}),document.body):null;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:w,className:n.tkx("inline-flex"),onClick:M,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),M())},"aria-expanded":v,"aria-haspopup":"dialog","aria-controls":v?g:void 0,children:e}),I,v&&!m&&(0,a.jsx)("style",{children:"\n @keyframes tkxPopoverFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})},exports.TkxProgress=S,exports.TkxProrationPreview=function({newPlan:e,currentPlan:n,cycle:o,daysRemaining:r,cycleDays:i,className:l,style:s,children:d}){const c=t.useTheme(),u=i>0?r/i:0,p=n.prices[o]*u,h=e.prices[o]*u,f=Math.max(0,h-p),m=Math.max(0,p-h),g={border:`1px solid ${c.border}`,borderRadius:12,padding:20,background:c.surface,...s},x={display:"flex",justifyContent:"space-between",fontSize:13,padding:"6px 0"},b=t=>Yr(t,e.currency,e.locale);return(0,a.jsxs)("div",{className:l,style:g,children:[(0,a.jsx)("div",{style:{fontSize:12,fontWeight:700,color:c.textMuted,textTransform:"uppercase",letterSpacing:.5,marginBottom:12},children:"Plan change"}),(0,a.jsxs)("div",{style:{...x,color:c.textMuted},children:[(0,a.jsxs)("span",{children:["From ",(0,a.jsx)("strong",{style:{color:c.text},children:n.name})]}),(0,a.jsx)("span",{children:"→"}),(0,a.jsxs)("span",{children:["To ",(0,a.jsx)("strong",{style:{color:c.primary},children:e.name})]})]}),(0,a.jsx)("hr",{style:{border:0,borderTop:`1px solid ${c.border}`,margin:"8px 0"}}),(0,a.jsxs)("div",{style:{...x,color:c.textMuted},children:[(0,a.jsx)("span",{children:"Days remaining in cycle"}),(0,a.jsxs)("span",{children:[r," / ",i]})]}),(0,a.jsxs)("div",{style:{...x,color:c.textMuted},children:[(0,a.jsxs)("span",{children:["Credit from ",n.name]}),(0,a.jsxs)("span",{children:["−",b(p)]})]}),(0,a.jsxs)("div",{style:{...x,color:c.textMuted},children:[(0,a.jsxs)("span",{children:["Charge for ",e.name," (prorated)"]}),(0,a.jsx)("span",{children:b(h)})]}),(0,a.jsx)("hr",{style:{border:0,borderTop:`1px solid ${c.border}`,margin:"8px 0"}}),f>0?(0,a.jsxs)("div",{style:{...x,fontSize:16,fontWeight:700},children:[(0,a.jsx)("span",{style:{color:c.text},children:"Due today"}),(0,a.jsx)("span",{style:{color:c.primary},children:b(f)})]}):(0,a.jsxs)("div",{style:{...x,fontSize:14,color:c.success},children:[(0,a.jsx)("span",{children:"Credit applied at next billing"}),(0,a.jsx)("span",{children:b(m)})]}),(0,a.jsx)("div",{style:{...x,color:c.textMuted,fontSize:12,marginTop:6},children:(0,a.jsxs)("span",{children:["Then ",b(e.prices[o])," / ","monthly"===o?"month":"year"]})}),d&&(0,a.jsx)("div",{style:{marginTop:16},children:d})]})},exports.TkxQRCode=function({value:e,size:r=160,color:i,bgColor:s,errorLevel:d="M",icon:c,bordered:u=!0}){const p=t.useTheme(),h=o.useReducedMotion(),f=(0,l.useRef)(null),m=n.sanitizeString(e),g=i??p.text,x=s??p.surface,b=(0,l.useMemo)(()=>function(e,t,n){const o=function(e){let t=e;return()=>(t=1664525*t+1013904223|0,(t>>>0)/4294967295)}(function(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return Math.abs(t)}(e)),r=Ro[n]??.42,i=Array.from({length:t},()=>Array.from({length:t},()=>!1)),l=(e,t)=>{for(let n=0;n<7;n++)for(let o=0;o<7;o++){const r=0===n||6===n||0===o||6===o,l=n>=2&&n<=4&&o>=2&&o<=4;i[e+n][t+o]=r||l}};l(0,0),l(0,18),l(18,0);for(let a=7;a<18;a++)i[6][a]=a%2==0,i[a][6]=a%2==0;for(let a=0;a<t;a++)for(let e=0;e<t;e++)a<8&&e<8||a<8&&e>=17||a>=17&&e<8||6===a||6===e||(i[a][e]=o()<r);return i}(m,25,d),[m,d]);return(0,l.useEffect)(()=>{const e=f.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const o=window.devicePixelRatio||1;e.width=r*o,e.height=r*o,t.scale(o,o);const i=r/25;t.fillStyle=x,t.fillRect(0,0,r,r),t.fillStyle=g;for(let n=0;n<25;n++)for(let e=0;e<25;e++)b[n][e]&&t.fillRect(e*i,n*i,i,i);if(c){const e=.22*r,o=(r-e)/2;t.fillStyle=x,t.fillRect(o-2,o-2,e+4,e+4);const i=new Image;i.crossOrigin="anonymous",i.onload=()=>{t.drawImage(i,o,o,e,e)},i.src=n.sanitizeString(c)}},[b,r,g,x,c]),(0,a.jsx)("div",{role:"img","aria-label":`QR code for: ${m}`,className:n.tkx("inline-block rounded-lg"),style:{padding:u?12:0,backgroundColor:u?x:"transparent",border:u?`1px solid ${p.border}`:"none",lineHeight:0,animation:h?"none":"tkxFadeIn 0.2s ease"},children:(0,a.jsx)("canvas",{ref:f,"aria-hidden":"true",style:{width:r,height:r,display:"block"}})})},exports.TkxRadio=X,exports.TkxRadioGroup=function({name:e,value:o,defaultValue:r="",onChange:i,label:s,orientation:d="vertical",isDisabled:c=!1,isInvalid:u=!1,errorMessage:p,children:h}){const f=t.useTheme(),m=`${(0,l.useId)()}-error`,[g,x]=(0,l.useState)(r),b=void 0!==o,y=b?o:g,v=u||!!p;return(0,a.jsx)(Y.Provider,{value:{name:e,value:y,onChange:e=>{b||x(e),i?.(e)},isDisabled:c,isInvalid:u},children:(0,a.jsxs)("div",{role:"radiogroup","aria-label":s?n.sanitizeString(s):void 0,"aria-describedby":v?m:void 0,"aria-invalid":v,children:[s&&(0,a.jsx)("div",{className:n.tkx("text-sm font-medium font-sans mb-2"),style:{color:f.text},children:n.sanitizeString(s)}),(0,a.jsx)("div",{className:n.tkx("horizontal"===d?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:h}),v&&p&&(0,a.jsxs)("span",{id:m,role:"alert",className:n.tkx("text-xs flex items-center gap-1 mt-1"),style:{color:f.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),n.sanitizeString(p)]})]})})},exports.TkxRating=function({value:e,defaultValue:r=0,onChange:i,max:s=5,precision:d=1,size:c="md",isReadOnly:u=!1,isDisabled:p=!1,label:h,showValue:f=!1,colorScheme:m="warning",emptyIcon:g="star",filledIcon:x="star"}){const b=t.useTheme(),y=o.useReducedMotion(),v=(0,l.useId)(),w=void 0!==e,[k,S]=(0,l.useState)(r),[C,$]=(0,l.useState)(null),z=(0,l.useRef)(null),M=w?e??0:k,N=C??M,I={warning:b.warning,primary:b.primary,danger:b.danger}[m]??b.warning,L=je[c],R=!u&&!p,D=(0,l.useCallback)(e=>{w||S(e),i?.(e)},[w,i]),T=(0,l.useCallback)((e,t)=>{R&&$(Ye(e,t,d))},[R,d]),W=(0,l.useCallback)(()=>{R&&$(null)},[R]),A=(0,l.useCallback)((e,t)=>{if(!R)return;const n=Ye(e,t,d);D(n===M?0:n)},[R,d,M,D]),B=(0,l.useCallback)(e=>{if(!R)return;const t=d;let n=M;if("ArrowRight"===e.key||"ArrowUp"===e.key)e.preventDefault(),n=Ke(M+t,0,s);else if("ArrowLeft"===e.key||"ArrowDown"===e.key)e.preventDefault(),n=Ke(M-t,0,s);else if("Home"===e.key)e.preventDefault(),n=0;else{if("End"!==e.key)return;e.preventDefault(),n=s}n=function(e,t){return 1===t?Math.round(e):Math.round(2*e)/2}(n,d),D(n)},[R,M,s,d,D]),E=h?n.sanitizeString(h):"Rating";return(0,a.jsxs)("div",{className:n.cx(n.tkx("inline-flex items-center gap-2 font-sans"),p?n.tkx("opacity-50"):""),children:[(0,a.jsx)("div",{ref:z,role:"radiogroup","aria-label":E,"aria-disabled":p,"aria-readonly":u,tabIndex:R?0:-1,onKeyDown:B,onMouseLeave:W,className:n.tkx("flex items-center gap-0.5 outline-none"),style:{cursor:R?"pointer":"default"},children:Array.from({length:s},(e,t)=>{const n=t+1,o=t+.5,r=N>=n,i=!r&&.5===d&&N>=o,l=`${v}-${t}`;return(0,a.jsx)("span",{role:"radio","aria-checked":.5===d&&M===o||M===n,"aria-label":.5===d?`${o} star${1!==o?"s":""} / ${n} star${1!==n?"s":""}`:`${n} star${1!==n?"s":""}`,tabIndex:-1,onMouseMove:e=>T(e,t),onClick:e=>A(e,t),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:y?"none":"transform 120ms ease",transform:null!==C&&N>=o&&R?"scale(1.15)":"scale(1)"},children:(0,a.jsx)(Ue,{type:r||i?x:g,size:L,filled:r,halfFilled:i,color:r||i?I:b.border,uid:i?l:void 0})},t)})}),f&&(0,a.jsxs)("span",{className:n.tkx("text-sm tabular-nums"),style:{color:b.textMuted},"aria-live":"polite","aria-atomic":"true",children:[M%1==0?M.toFixed(0):M.toFixed(1)," / ",s]})]})},exports.TkxResult=function({status:e,title:r,subTitle:i,icon:l,extra:s}){const d=t.useTheme(),c=o.useReducedMotion(),u=function(e,t){switch(e){case"success":return t.success;case"error":case"500":return t.danger;case"warning":return t.warning;case"info":return t.info;case"404":case"403":return t.textMuted}}(e,d),p=n.sanitizeString(r),h=i?n.sanitizeString(i):void 0;return(0,a.jsxs)("div",{role:"status","aria-live":"polite",className:n.tkx("flex flex-col items-center text-center px-6 py-12 font-sans"),style:{animation:c?"none":"tkxFadeIn 0.3s ease"},children:[(0,a.jsx)("div",{className:n.tkx("mb-6"),children:l??Do[e](u)}),(0,a.jsx)("h2",{className:n.tkx("text-xl font-semibold m-0 mb-2"),style:{color:d.text},children:p}),h&&(0,a.jsx)("p",{className:n.tkx("text-sm m-0 mb-6 max-w-md leading-relaxed"),style:{color:d.textMuted},children:h}),s&&(0,a.jsx)("div",{className:n.tkx("flex items-center gap-3 mt-4"),children:s})]})},exports.TkxRichEditor=Ri,exports.TkxRichTextDisplay=function({blocks:e,className:i,style:s}){const d=t.useTheme(),c=r.useLocale(),u=o.useReducedMotion(),p=(0,l.useMemo)(()=>e.map((e,t)=>{const n=An[e.type];return n?(0,a.jsx)("div",{style:u?void 0:{animation:"tkx-rich-text-fade-in 300ms ease both",animationDelay:`${Math.min(30*t,300)}ms`},children:(0,a.jsx)(n,{block:e,index:t})},t):null}),[e,u]);return(0,l.useMemo)(()=>{if("undefined"==typeof document)return;if(document.getElementById("tkx-rich-text-kf"))return;const e=document.createElement("style");e.id="tkx-rich-text-kf",e.textContent="\n @keyframes tkx-rich-text-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n ",document.head.appendChild(e)},[]),(0,a.jsx)("article",{"aria-label":c.richTextContent??"Rich text content",className:n.tkx("font-sans",i??""),style:{color:d.text,maxWidth:720,...s},children:p})},exports.TkxRow=ao,exports.TkxSEO=function({title:e,description:t,canonical:n,keywords:o,image:r,twitterSite:i,twitterCreator:a,ogType:s="website",locale:d,robots:c="index, follow, max-snippet:-1, max-image-preview:large",schema:u}){return(0,l.useEffect)(()=>{if("undefined"!=typeof document)return kr(),e&&(document.title=e),t&&Sr("description",t),o&&Sr("keywords",o),Sr("robots",c),e&&Sr("og:title",e,"property"),t&&Sr("og:description",t,"property"),Sr("og:type",s,"property"),n&&Sr("og:url",n,"property"),r&&(Sr("og:image",r,"property"),Sr("og:image:width","1200","property"),Sr("og:image:height","630","property")),d&&Sr("og:locale",d,"property"),Sr("twitter:card",r?"summary_large_image":"summary"),e&&Sr("twitter:title",e),t&&Sr("twitter:description",t),r&&Sr("twitter:image",r),i&&Sr("twitter:site",i),a&&Sr("twitter:creator",a),n&&function(e,t){if("undefined"==typeof document||!t)return;const n=document.createElement("link");n.rel="canonical",n.href=t,n.setAttribute(wr,"1"),document.head.appendChild(n)}(0,n),u&&function(e){if("undefined"==typeof document)return;const t=Array.isArray(e)?e:[e];for(const n of t){const e=document.createElement("script");e.type="application/ld+json",e.text=JSON.stringify(n),e.setAttribute(wr,"1"),document.head.appendChild(e)}}(u),()=>kr()},[e,t,n,o,r,i,a,s,d,c,u]),null},exports.TkxSegmented=function({options:e,value:r,onChange:i,size:s="md",block:d=!1}){const c=t.useTheme(),u=o.useReducedMotion(),p=(0,l.useRef)(null),[h,f]=(0,l.useState)(()=>Math.max(0,e.findIndex(e=>e.value===r))),[m,g]=(0,l.useState)({}),x=Lo[s];(0,l.useEffect)(()=>{const t=e.findIndex(e=>e.value===r);t>=0&&f(t)},[r,e]),(0,l.useEffect)(()=>{const e=p.current;if(!e)return;const t=e.querySelectorAll("[data-seg-btn]")[h];t&&g({left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight,transition:u?"none":"left 0.2s ease, width 0.2s ease"})},[h,e,u]);const b=(0,l.useCallback)(t=>{const n=e[t];n&&!n.disabled&&(f(t),i?.(n.value))},[e,i]),y=(0,l.useCallback)(t=>{let n=h;if("ArrowRight"===t.key||"ArrowDown"===t.key)for(t.preventDefault(),n=(h+1)%e.length;e[n]?.disabled&&n!==h;)n=(n+1)%e.length;else if("ArrowLeft"===t.key||"ArrowUp"===t.key)for(t.preventDefault(),n=(h-1+e.length)%e.length;e[n]?.disabled&&n!==h;)n=(n-1+e.length)%e.length;n!==h&&(b(n),(p.current?.querySelectorAll("[data-seg-btn]"))?.[n]?.focus())},[h,e,b]);return(0,a.jsxs)("div",{ref:p,role:"radiogroup","aria-label":"Segmented control",className:n.tkx("relative inline-flex items-center rounded-lg p-1"),style:{backgroundColor:c.surfaceAlt,border:`1px solid ${c.border}`,width:d?"100%":void 0},onKeyDown:y,children:[(0,a.jsx)("div",{"aria-hidden":"true",className:n.tkx("absolute top-1 rounded-md"),style:{...m,backgroundColor:c.surface,boxShadow:`0 1px 3px ${c.border}`,zIndex:0}}),e.map((e,t)=>{const o=t===h,r=n.sanitizeString(e.label);return(0,a.jsxs)("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":o,"aria-disabled":e.disabled||void 0,disabled:e.disabled,tabIndex:o?0:-1,className:n.tkx("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:x.height,fontSize:x.fontSize,padding:`0 ${x.px}px`,flex:d?1:void 0,color:o?c.text:c.textMuted,backgroundColor:"transparent",opacity:e.disabled?.4:1,fontWeight:o?600:400,transition:u?"none":"color 0.15s ease"},onClick:()=>b(t),children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",children:e.icon}),r]},e.value)})]})},exports.TkxSelect=V,exports.TkxSider=no,exports.TkxSignaturePad=pr,exports.TkxSkeleton=W,exports.TkxSlider=Re,exports.TkxSnackbar=function({message:e,isOpen:r,onClose:i,action:d,variant:c="default",position:u="bottom-center",autoHideDuration:p=5e3,icon:h}){const f=t.useTheme(),m=o.useReducedMotion(),g=(0,l.useId)(),x=(0,l.useRef)(null),[b,y]=(0,l.useState)(!1),[v,w]=(0,l.useState)(!1);(0,l.useEffect)(()=>{!function(){if(wn||"undefined"==typeof document)return;wn=!0;const e=document.createElement("style");e.id="tkx-snackbar-kf",e.textContent="\n @keyframes tkx-snackbar-slide-up {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-snackbar-slide-down {\n from { opacity: 0; transform: translateY(-24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-snackbar-fade-out {\n from { opacity: 1; }\n to { opacity: 0; transform: translateY(8px); }\n }\n ",document.head.appendChild(e)}()},[]),(0,l.useEffect)(()=>{if(r)w(!1),y(!0);else if(b){if(!m){w(!0);const e=setTimeout(()=>{y(!1),w(!1)},250);return()=>clearTimeout(e)}y(!1)}},[r,m,b]),(0,l.useEffect)(()=>{if(r&&!(p<=0)&&i)return x.current=setTimeout(()=>{i()},p),()=>{x.current&&clearTimeout(x.current)}},[r,p,i]);const k=(0,l.useCallback)(()=>{x.current&&(clearTimeout(x.current),x.current=null)},[]),S=(0,l.useCallback)(()=>{r&&p>0&&i&&(x.current=setTimeout(()=>i(),p))},[r,p,i]),C={default:f.textMuted,success:f.success,error:f.danger,warning:f.warning,info:f.info}[c],$=n.sanitizeString(e);if(!b||"undefined"==typeof document)return null;let z={};m||(z=v?{animation:"tkx-snackbar-fade-out 250ms ease forwards"}:{animation:("top-center"===u?"tkx-snackbar-slide-down":"tkx-snackbar-slide-up")+" 250ms cubic-bezier(0.16,1,0.3,1) both"});const M=h??kn[c]??null;return(0,s.createPortal)((0,a.jsx)("div",{role:"error"===c?"alert":"status","aria-live":"error"===c?"assertive":"polite","aria-atomic":"true","aria-labelledby":g,className:n.tkx("fixed z-[9500] font-sans"),style:{...Sn[u],...z,pointerEvents:"auto"},onMouseEnter:k,onMouseLeave:S,children:(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg","min-w-[280px] max-w-[480px]"),style:{backgroundColor:f.surface,border:`1px solid ${C}44`,boxShadow:`0 8px 24px ${f.bg}aa`,color:f.text},children:[M&&(0,a.jsx)("span",{className:n.tkx("shrink-0 flex items-center"),style:{color:C},children:M}),(0,a.jsx)("span",{id:g,className:n.tkx("flex-1 text-sm leading-snug"),children:$}),d&&(0,a.jsx)("button",{onClick:()=>{d.onClick(),i?.()},className:n.tkx("bg-transparent border-none cursor-pointer p-0 ml-2","text-sm font-semibold shrink-0","focus-visible:focus-ring"),style:{color:f.primary},children:n.sanitizeString(d.label)}),i&&(0,a.jsx)("button",{"aria-label":"Dismiss snackbar",onClick:i,className:n.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] ml-1","shrink-0 flex items-center justify-center","focus-visible:focus-ring"),style:{color:f.textMuted},children:(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),document.body)},exports.TkxSortable=br,exports.TkxSpeedDial=function({actions:e,icon:r,direction:i="up",position:d="bottom-right",className:c,style:u}){const p=t.useTheme(),h=o.useReducedMotion(),f=(0,l.useId)(),[m,g]=(0,l.useState)(!1),[x,b]=(0,l.useState)(-1),y=(0,l.useRef)(null),v=(0,l.useRef)(new Map),w=(0,l.useCallback)(()=>{g(e=>!e),b(-1)},[]),k=(0,l.useCallback)(()=>{g(!1),b(-1)},[]);o.useEscapeKey(k,m),(0,l.useEffect)(()=>{if(!m)return;const e=e=>{y.current?.contains(e.target)||k()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[m,k]),(0,l.useEffect)(()=>{x>=0&&v.current.get(x)?.focus()},[x]);const S=e=>h?"0ms":40*e+"ms";return(0,a.jsxs)(a.Fragment,{children:[m&&"undefined"!=typeof document&&(0,s.createPortal)((0,a.jsx)("div",{"aria-hidden":"true",onClick:k,style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:9e3,transition:h?"none":"opacity 200ms ease"}}),document.body),(0,a.jsxs)("div",{ref:y,className:n.tkx("fixed z-[9100] font-sans",c??""),style:{...bn[d],...u},children:[m&&e.map((t,o)=>{const r=n.sanitizeString(t.label),l=function(e,t){const n=64*(t+1);switch(e){case"up":return{bottom:n,left:"50%",transform:"translateX(-50%)"};case"down":return{top:n,left:"50%",transform:"translateX(-50%)"};case"left":return{right:n,top:"50%",transform:"translateY(-50%)"};case"right":return{left:n,top:"50%",transform:"translateY(-50%)"}}}(i,o),s=function(e){switch(e){case"up":case"down":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:10};case"left":case"right":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10}}}(i);return(0,a.jsx)("div",{className:n.tkx("absolute"),style:{...l,opacity:h?1:0,animation:h?"none":"tkxSpeedDialIn 180ms ease forwards",animationDelay:S(o)},children:(0,a.jsxs)("div",{className:n.tkx("relative inline-flex"),children:[(0,a.jsx)("span",{className:n.tkx("absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none"),style:{...s,backgroundColor:p.surfaceAlt,color:p.text,border:`1px solid ${p.border}`,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},role:"tooltip",children:r}),(0,a.jsx)("button",{ref:e=>{e?v.current.set(o,e):v.current.delete(o)},type:"button","aria-label":r,tabIndex:m?0:-1,onClick:()=>{t.onClick?.(),k()},onKeyDown:t=>((t,n)=>{switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),b(n>0?n-1:e.length-1);break;case"ArrowDown":case"ArrowRight":t.preventDefault(),b(n<e.length-1?n+1:0);break;case"Enter":case" ":t.preventDefault(),e[n].onClick?.(),k();break;case"Escape":k();break;case"Home":t.preventDefault(),b(0);break;case"End":t.preventDefault(),b(e.length-1)}})(t,o),className:n.tkx("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2","shadow-lg"),style:{width:48,height:48,backgroundColor:p.surface,color:p.text,border:`1px solid ${p.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",transition:h?"none":"all 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=p.surfaceAlt,e.currentTarget.style.transform="scale(1.1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=p.surface,e.currentTarget.style.transform="scale(1)"},children:t.icon})]})},t.id)}),(0,a.jsx)("button",{type:"button","aria-label":m?"Close actions menu":"Open actions menu","aria-expanded":m,"aria-controls":f,"aria-haspopup":"true",onClick:w,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w()),m&&("ArrowUp"!==e.key&&"ArrowLeft"!==e.key||(e.preventDefault(),b(0)),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),b(0)))},className:n.tkx("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2"),style:{width:56,height:56,backgroundColor:p.primary,color:p.bg,boxShadow:`0 6px 20px ${p.primary}40`,transition:h?"none":"all 200ms ease",position:"relative",zIndex:1},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 8px 28px ${p.primary}60`,h||(e.currentTarget.style.transform="scale(1.05)")},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 6px 20px ${p.primary}40`,e.currentTarget.style.transform="scale(1)"},children:r??(0,a.jsx)(xn,{color:p.bg,rotated:m,reducedMotion:h})}),(0,a.jsx)("div",{id:f,role:"menu","aria-label":"Speed dial actions",style:{display:"none"},children:e.map(e=>(0,a.jsx)("div",{role:"menuitem",children:n.sanitizeString(e.label)},e.id))})]}),m&&!h&&(0,a.jsx)("style",{children:"\n @keyframes tkxSpeedDialIn {\n from { opacity: 0; transform: translateX(-50%) scale(0.5); }\n to { opacity: 1; transform: translateX(-50%) scale(1); }\n }\n "})]})},exports.TkxSpin=function({spinning:e=!0,size:r="md",tip:i,indicator:a,children:s,fullscreen:d=!1,delay:c=0,style:u}){const p=t.useTheme(),h=o.useReducedMotion(),[f,m]=(0,l.useState)(0===c&&e),g=(0,l.useRef)(null);if((0,l.useEffect)(()=>(e&&c>0?g.current=setTimeout(()=>m(!0),c):m(e),()=>{null!==g.current&&clearTimeout(g.current)}),[e,c]),!f)return s?(0,l.createElement)("div",{style:u},s):null;const x=wo[r],b=i?n.sanitizeString(i):void 0,y=(0,l.createElement)("div",{role:"status","aria-live":"polite","aria-label":b??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},a??(0,l.createElement)(Co,{size:x.dimension,borderWidth:x.borderWidth,color:p.primary,reducedMotion:h}),b&&(0,l.createElement)("span",{style:{color:p.primary,fontSize:x.fontSize,marginTop:"4px"}},b));return d?(0,l.createElement)("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${p.bg}cc`,zIndex:9999,...u}},y):s?(0,l.createElement)("div",{style:{position:"relative",...u}},(0,l.createElement)("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:h?"none":"opacity 0.2s, filter 0.2s"}},s),(0,l.createElement)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${p.bg}66`,borderRadius:"4px"}},y)):(0,l.createElement)("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...u}},y)},exports.TkxStatistic=function({title:e,value:r,prefix:i,suffix:a,precision:s,groupSeparator:d=",",valueStyle:c,loading:u=!1,trend:p,trendValue:h,style:f}){const m=t.useTheme(),g=o.useReducedMotion(),x=n.sanitizeString(e),b=h?n.sanitizeString(h):void 0,y="up"===p?m.success:"down"===p?m.danger:void 0;return(0,l.createElement)("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...f}},(0,l.createElement)("div",{style:{color:m.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},x),u?(0,l.createElement)(Io,{w:"120px",h:"32px",alt:m.surfaceAlt,bdr:m.border,rm:g}):(0,l.createElement)("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:m.text,fontVariantNumeric:"tabular-nums",...c}},i&&(0,l.createElement)("span",{style:{fontSize:"0.75em",fontWeight:400}},i),(0,l.createElement)("span",null,function(e,t,n=","){if("string"==typeof e)return e;const[o,r]=(void 0!==t?e.toFixed(t):String(e)).split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,n);return void 0!==r?`${i}.${r}`:i}(r,s,d)),a&&(0,l.createElement)("span",{style:{fontSize:"0.6em",fontWeight:400,color:m.textMuted}},a)),p&&(0,l.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:y,marginTop:"2px"}},(0,l.createElement)(Mo,{direction:p,color:y}),b&&(0,l.createElement)("span",null,b)))},exports.TkxStepper=Dt,exports.TkxTab=function({index:e,children:o,disabled:r=!1,className:i,style:s}){const d=t.useTheme(),{activeIndex:c,setActiveIndex:u,baseId:p,tabCount:h}=R(),f=(0,l.useRef)(null),m=c===e;return(0,a.jsx)("button",{ref:f,role:"tab",id:`${p}-tab-${e}`,"aria-controls":`${p}-panel-${e}`,"aria-selected":m,tabIndex:m?0:-1,disabled:r,className:n.cx(n.tkx("border-none bg-transparent font-sans text-sm rounded-t cursor-pointer select-none","py-2.5 px-4 transition-colors duration-150 focus-visible:focus-ring",r?"opacity-50 cursor-not-allowed":""),i),style:{color:m?d.primary:d.textMuted,fontWeight:m?600:400,borderBottom:m?`2px solid ${d.primary}`:"2px solid transparent",marginBottom:"-2px",...s},onClick:()=>!r&&u(e),onKeyDown:n=>t.handleTabsKeyboard(n,e,h,e=>{u(e),document.getElementById(`${p}-tab-${e}`)?.focus()}),children:o})},exports.TkxTabList=function({children:e,className:o,style:r,...i}){const l=t.useTheme();return(0,a.jsx)("div",{role:"tablist",className:n.cx(n.tkx("flex gap-1"),o),style:{borderBottom:`2px solid ${l.border}`,...r},...i,children:e})},exports.TkxTabPanel=function({index:e,children:t,style:o,className:r}){const{activeIndex:i,baseId:l}=R();return i!==e?null:(0,a.jsx)("div",{role:"tabpanel",id:`${l}-panel-${e}`,"aria-labelledby":`${l}-tab-${e}`,tabIndex:0,className:n.cx(n.tkx("pt-4"),r),style:o,children:t})},exports.TkxTabPanels=function({children:e,className:t,...n}){return(0,a.jsx)("div",{className:t,...n,children:e})},exports.TkxTable=function({columns:e,data:o,caption:r,sortable:i,stickyHeader:s,isLoading:d,emptyState:c,style:u,className:p,striped:h,maxHeight:f,rowHeight:m=44,virtualScroll:g,onLoadMore:x,hasMore:b,loadingMore:y=!1,onRowClick:v,selectedRows:w,bordered:k,compact:S}){const C=t.useTheme(),[$,z]=(0,l.useState)(null),[M,N]=(0,l.useState)("asc"),I=(0,l.useMemo)(()=>$&&i?[...o].sort((e,t)=>{const n=e[$],o=t[$];let r=0;return"string"==typeof n&&"string"==typeof o?r=n.localeCompare(o):"number"==typeof n&&"number"==typeof o&&(r=n-o),"asc"===M?r:-r}):o,[o,$,M,i]),L=(0,l.useCallback)(e=>{$===e?N(e=>"asc"===e?"desc":"asc"):(z(e),N("asc"))},[$]),R=void 0!==g?g:void 0!==f&&I.length>=50,D=(0,l.useRef)(null),[T,A]=(0,l.useState)(0),[B,E]=(0,l.useState)(400),F=(0,l.useCallback)(()=>{D.current&&A(D.current.scrollTop)},[]);(0,l.useEffect)(()=>{if(!R||!D.current)return;const e=D.current;E(e.clientHeight);const t=new ResizeObserver(()=>E(e.clientHeight));return t.observe(e),()=>t.disconnect()},[R]);const j=R?Math.max(0,Math.floor(T/m)-5):0,P=R?Math.min(I.length,Math.ceil((T+B)/m)+5):I.length,O=R?I.slice(j,P):I,V=(0,l.useRef)(null),U=(0,l.useRef)(!1);(0,l.useEffect)(()=>{U.current=!1},[o.length]),(0,l.useEffect)(()=>{if(!x)return;const e=V.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!U.current&&!1!==b&&(U.current=!0,x())},{root:D.current,rootMargin:"0px 0px 200px 0px",threshold:0});return t.observe(e),()=>t.disconnect()},[x,b]);const K=S?"4px":"12px",Y=S?"8px":"16px",q=k?`1px solid ${C.border}`:"none",X=(0,l.useMemo)(()=>new Set(w??[]),[w]);return(0,a.jsx)("div",{className:n.tkx("w-full rounded-lg",p??""),style:{border:`1px solid ${C.border}`,overflow:"hidden",...u},children:(0,a.jsxs)("div",{ref:D,onScroll:R?F:void 0,style:{overflowX:"auto",overflowY:f?"auto":"visible",maxHeight:f??"none"},children:[(0,a.jsxs)("table",{className:n.tkx("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:C.text},children:[r&&(0,a.jsx)("caption",{className:n.tkx("text-sm text-left p-2"),style:{color:C.textMuted},children:n.sanitizeString(r)}),(0,a.jsx)("thead",{style:s?{position:"sticky",top:0,backgroundColor:C.surfaceAlt,zIndex:1}:{backgroundColor:C.surfaceAlt},children:(0,a.jsx)("tr",{children:e.map(e=>{const t=i&&!1!==e.sortable,o=(r=e.key,$!==r?"none":M);var r;return(0,a.jsx)("th",{scope:"col","aria-sort":t?"none"===o?"none":"asc"===o?"ascending":"descending":void 0,className:n.tkx("text-left font-semibold whitespace-nowrap",t?"cursor-pointer select-none":""),style:{padding:`${K} ${Y}`,color:C.textMuted,borderBottom:`2px solid ${C.border}`,borderRight:q,width:e.width},onClick:()=>t&&L(e.key),onKeyDown:n=>{!t||"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),L(e.key))},tabIndex:t?0:void 0,children:(0,a.jsxs)("span",{className:n.tkx("inline-flex items-center gap-1.5"),children:[n.sanitizeString(e.header),t&&(0,a.jsx)(H,{dir:o})]})},String(e.key))})})}),(0,a.jsx)("tbody",{children:d?Array.from({length:5},(t,n)=>(0,a.jsx)("tr",{children:e.map(e=>(0,a.jsx)("td",{style:{padding:`${K} ${Y}`},children:(0,a.jsx)(W,{variant:"text",height:"16px"})},String(e.key)))},n)):0===I.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:e.length,className:n.tkx("text-center"),style:{padding:"32px 16px",color:C.textMuted},children:c??"No data available"})}):(0,a.jsxs)(a.Fragment,{children:[R&&j>0&&(0,a.jsx)("tr",{"aria-hidden":"true",style:{height:j*m},children:(0,a.jsx)("td",{colSpan:e.length,style:{padding:0,border:"none"}})}),O.map((t,o)=>{const r=j+o,i=X.has(r);return(0,a.jsx)("tr",{"aria-rowindex":r+1,"aria-selected":i||void 0,onClick:v?()=>v(t,r):void 0,onKeyDown:v?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),v(t,r))}:void 0,tabIndex:v?0:void 0,className:n.tkx(v?"cursor-pointer":""),style:{backgroundColor:i?`${C.primary}22`:h&&r%2==1?C.surfaceAlt:"transparent",borderBottom:`1px solid ${C.border}`,...R?{height:m,boxSizing:"border-box"}:{}},children:e.map(e=>{const o=t[e.key],r=e.render?e.render(o,t):"string"==typeof o?n.sanitizeString(o):String(o??"");return(0,a.jsx)("td",{style:{padding:`${K} ${Y}`,color:C.text,borderRight:q},children:r},String(e.key))})},r)}),R&&P<I.length&&(0,a.jsx)("tr",{"aria-hidden":"true",style:{height:(I.length-P)*m},children:(0,a.jsx)("td",{colSpan:e.length,style:{padding:0,border:"none"}})})]})})]}),(b||y)&&(0,a.jsx)("div",{ref:V,style:{height:1,width:"100%"},children:y&&(0,a.jsx)("table",{style:{width:"100%",borderCollapse:"collapse"},children:(0,a.jsx)("tbody",{children:Array.from({length:3},(t,n)=>(0,a.jsx)("tr",{children:e.map(e=>(0,a.jsx)("td",{style:{padding:"10px 16px"},children:(0,a.jsx)(W,{variant:"text",height:"16px"})},String(e.key)))},n))})})}),!b&&x&&(0,a.jsx)("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:C.textMuted},children:"✓ All rows loaded"})]})})},exports.TkxTabs=function({defaultIndex:e=0,activeIndex:t,onChange:n,children:o,tabCount:r=0,style:i,className:s}){const[d,c]=(0,l.useState)(e),u=(0,l.useId)(),p=void 0!==t?t:d;return(0,a.jsx)(L.Provider,{value:{activeIndex:p,setActiveIndex:e=>{void 0===t&&c(e),n?.(e)},baseId:u,tabCount:r},children:(0,a.jsx)("div",{className:s,style:i,children:o})})},exports.TkxTag=nt,exports.TkxTagInput=function({value:e,defaultValue:r=[],onChange:i,placeholder:s="Add tag…",maxTags:d,allowDuplicates:c=!1,validate:u,colorScheme:p="primary",size:h="md",label:f,hint:m,isDisabled:g=!1}){const x=t.useTheme(),b=o.useReducedMotion(),[y,v]=(0,l.useState)(r),[w,k]=(0,l.useState)(""),[S,C]=(0,l.useState)(null),$=(0,l.useRef)(null),z=void 0!==e,M=z?e:y,N=(0,l.useCallback)(e=>{z||v(e),i?.(e)},[z,i]),I=(0,l.useCallback)(e=>{const t=e.trim();if(t)if(void 0!==d&&M.length>=d)C(`Maximum ${d} tags allowed`);else if(c||!M.includes(t)){if(u){const e=u(t);if(!1===e)return void C("Invalid tag");if("string"==typeof e)return void C(e)}C(null),N([...M,t]),k("")}else C("Duplicate tags are not allowed")},[M,d,c,u,N]),L=(0,l.useCallback)(e=>{N(M.filter((t,n)=>n!==e)),C(null)},[M,N]),R=(0,l.useCallback)(e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),I(w)):"Backspace"===e.key&&""===w&&M.length>0&&L(M.length-1)},[w,M,I,L]),D=(0,l.useCallback)(e=>{const t=e.target.value;t.endsWith(",")?I(t.slice(0,-1)):(k(t),S&&C(null))},[I,S]),T="sm"===h?"6px 8px":"lg"===h?"10px 12px":"8px 10px",W="sm"===h?11:"lg"===h?14:12;return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-1.5"),children:[f&&(0,a.jsx)("label",{className:n.tkx("text-sm font-medium"),style:{color:x.text},onClick:()=>$.current?.focus(),children:n.sanitizeString(f)}),(0,a.jsxs)("div",{className:n.tkx("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!b&&"transition-colors duration-150"),style:{padding:T,backgroundColor:x.surface,border:`1.5px solid ${S?x.danger:x.border}`,opacity:g?.55:1,minHeight:"sm"===h?36:"lg"===h?48:40},onClick:()=>!g&&$.current?.focus(),children:[M.map((e,t)=>(0,a.jsx)(nt,{size:h,variant:"subtle",colorScheme:p,onRemove:g?void 0:()=>L(t),isDisabled:g,children:e},`${e}-${t}`)),(!d||M.length<d)&&!g&&(0,a.jsx)("input",{ref:$,type:"text",value:w,onChange:D,onKeyDown:R,placeholder:0===M.length?n.sanitizeString(s):"",disabled:g,className:n.tkx("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:W,color:x.text,caretColor:x.primary},"aria-label":f??"Tag input"})]}),S&&(0,a.jsx)("p",{className:n.tkx("text-xs"),style:{color:x.danger},role:"alert",children:S}),m&&!S&&(0,a.jsx)("p",{className:n.tkx("text-xs"),style:{color:x.textMuted},children:n.sanitizeString(m)})]})},exports.TkxText=function({children:e,type:o="default",strong:r=!1,italic:i=!1,underline:a=!1,delete:s=!1,code:d=!1,mark:c=!1,copyable:u=!1,style:p}){const h=yo(o),f=t.useTheme(),m=xo(e),g="string"==typeof e?n.sanitizeString(e):e,x=[];a&&x.push("underline"),s&&x.push("line-through");let b=g;return d&&(b=(0,l.createElement)("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:f.surfaceAlt,border:`1px solid ${f.border}`,borderRadius:"4px",fontFamily:"monospace"}},b)),c&&(b=(0,l.createElement)("mark",{style:{backgroundColor:`${f.warning}33`,color:h,padding:"0 2px",borderRadius:"2px"}},b)),(0,l.createElement)(r?"strong":i?"em":"span",{style:{color:h,fontStyle:i?"italic":"normal",textDecoration:x.length>0?x.join(" "):"none",...p}},b,u&&(0,l.createElement)(bo,{text:m}))},exports.TkxThinkingIndicator=_e,exports.TkxTimeline=function({items:e,variant:r="default",orientation:i="vertical",connectorStyle:s="solid"}){const d=t.useTheme(),c=o.useReducedMotion(),u=(0,l.useRef)(!1);(0,l.useEffect)(()=>{!function(){if(ot||"undefined"==typeof document)return;ot=!0;const e=document.createElement("style");e.textContent="\n @keyframes tkx-pulse-dot { 0%,100% { box-shadow:0 0 0 0 currentColor; opacity:1; } 70% { box-shadow:0 0 0 8px transparent; opacity:0.7; } }\n @keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }\n @keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }\n .tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }\n .tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }\n .tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }\n ",document.head.appendChild(e)}(),u.current=!0},[]);const p=!c,h="compact"===r,f="alternating"===r&&"vertical"===i;return"horizontal"===i?(0,a.jsx)("div",{role:"list","aria-label":"Timeline",className:n.tkx("flex items-start w-full overflow-x-auto"),children:e.map((t,o)=>{const r=t.status??"pending",i="completed"===r?d.success:d.border,l=o===e.length-1;return(0,a.jsx)("div",{role:"listitem",className:n.tkx("flex items-start flex-1 min-w-0"),children:(0,a.jsxs)("div",{className:n.tkx("flex flex-col items-center flex-1 min-w-0"),children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center w-full"),children:[o>0&&(0,a.jsx)(lt,{style:s,color:i,animate:p}),(0,a.jsx)(rt,{status:r,icon:t.icon,size:24}),!l&&(0,a.jsx)(lt,{style:s,color:i,animate:p})]}),(0,a.jsxs)("div",{className:n.tkx("mt-2 px-1 text-center min-w-0 w-full"),children:[(0,a.jsx)("div",{className:n.tkx("text-xs font-semibold truncate"),style:{color:d.text},children:"string"==typeof t.title?n.sanitizeString(t.title):t.title}),t.timestamp&&(0,a.jsx)("div",{className:n.tkx("text-[10px] mt-0.5"),style:{color:d.textMuted},children:n.sanitizeString(t.timestamp)})]})]})},t.id)})}):(0,a.jsx)("div",{role:"list","aria-label":"Timeline",className:n.tkx("flex flex-col"),children:e.map((t,o)=>{const r=t.status??"pending",i=o===e.length-1,l="completed"===r?d.success:d.border,c=f&&o%2==0;return f?(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex items-stretch gap-0"),children:[(0,a.jsx)("div",{className:n.tkx("flex-1 flex flex-col items-end pr-4",c?"":"invisible"),children:c&&(0,a.jsx)(at,{item:t,compact:h})}),(0,a.jsxs)("div",{className:n.tkx("flex flex-col items-center"),children:[(0,a.jsx)(rt,{status:r,icon:t.icon,size:28}),!i&&(0,a.jsx)(it,{style:s,color:l,animate:p})]}),(0,a.jsx)("div",{className:n.tkx("flex-1 flex flex-col items-start pl-4",c?"invisible":""),children:!c&&(0,a.jsx)(at,{item:t,compact:h})})]},t.id):(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex gap-3 items-stretch"),children:[(0,a.jsxs)("div",{className:n.tkx("flex flex-col items-center"),children:[(0,a.jsx)(rt,{status:r,icon:t.icon,size:h?22:28}),!i&&(0,a.jsx)(it,{style:s,color:l,animate:p})]}),(0,a.jsx)("div",{className:n.tkx("flex-1 min-w-0 pt-0.5"),children:(0,a.jsx)(at,{item:t,compact:h})})]},t.id)})})},exports.TkxTitle=function({level:e=1,children:o,copyable:r=!1,type:i="default",style:a}){const s=yo(i);t.useTheme();const d=vo[e],c=`h${e}`,u="string"==typeof o?n.sanitizeString(o):o,p=xo(o);return(0,l.createElement)(c,{style:{color:s,fontSize:d.fontSize,lineHeight:d.lineHeight,fontWeight:d.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...a}},u,r&&(0,l.createElement)(bo,{text:p}))},exports.TkxToastProvider=function({position:e="top-right",children:t}){const[i,d]=(0,l.useState)([..._]),c=o.useReducedMotion(),u=r.useLocale();(0,l.useEffect)(()=>{d([..._]);const e=e=>d([...e]);return Z.add(e),()=>{Z.delete(e)}},[]);const p=e.startsWith("bottom"),h=oe[e],f=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(!f.current&&"undefined"!=typeof document&&(f.current=!0,!document.getElementById("tkx-toast-kf"))){const e=document.createElement("style");e.id="tkx-toast-kf",e.textContent="\n @keyframes tkx-toast-slide-down {\n from { opacity: 0; transform: translateY(-16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-toast-slide-up {\n from { opacity: 0; transform: translateY(16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}},[]),"undefined"==typeof document)return(0,a.jsx)(a.Fragment,{children:t});const m=p?[...i].reverse():i;return(0,a.jsxs)(a.Fragment,{children:[t,(0,s.createPortal)((0,a.jsx)("div",{"aria-label":u.notifications??"Notifications",className:n.tkx("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:h,children:m.map(t=>(0,a.jsx)("div",{className:n.tkx("pointer-events-auto"),children:(0,a.jsx)(ie,{toast:t,position:e,onDismiss:te,reduced:c})},t.id))}),document.body)]})},exports.TkxToggle=$,exports.TkxToolbar=function({items:e,orientation:r="horizontal",size:i="md",variant:s="default",ariaLabel:d="Toolbar",className:c,style:u}){const p=t.useTheme(),h=o.useReducedMotion(),f=un[i],m="horizontal"===r,g=(0,l.useRef)(new Map),x=e.filter(e=>"separator"!==e.type&&!e.disabled).map(e=>e.id),b=(0,l.useCallback)(e=>{g.current.get(e)?.focus()},[]),y=(0,l.useCallback)((e,t)=>{const n=x.indexOf(t);if(n<0)return;const o=m?"ArrowRight":"ArrowDown",r=m?"ArrowLeft":"ArrowUp";switch(e.key){case o:e.preventDefault(),b(x[n+1<x.length?n+1:0]);break;case r:e.preventDefault(),b(x[n-1>=0?n-1:x.length-1]);break;case"Home":e.preventDefault(),b(x[0]);break;case"End":e.preventDefault(),b(x[x.length-1])}},[x,b,m]),v=e=>{e.type;const t=e.active;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,padding:`${f.buttonPy}px ${f.buttonPx}px`,fontSize:f.fontSize,borderRadius:6,border:"none",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:t?`${p.primary}20`:"transparent",color:t?p.primary:e.disabled?p.textMuted:p.text,opacity:e.disabled?.5:1,outline:"none",transition:h?"none":"all 100ms ease",whiteSpace:"nowrap",lineHeight:1}};return(0,a.jsx)("div",{role:"toolbar","aria-label":d,"aria-orientation":r,className:n.tkx("inline-flex items-center rounded-lg font-sans",m?"flex-row":"flex-col",c??""),style:{...(()=>{switch(s){case"outlined":return{backgroundColor:"transparent",border:`1px solid ${p.border}`};case"filled":return{backgroundColor:p.surfaceAlt,border:"none"};default:return{backgroundColor:p.surface,border:`1px solid ${p.border}`}}})(),padding:f.gap,gap:f.gap,...u},children:e.map((e,t)=>{if("separator"===e.type)return(0,a.jsx)("div",{role:"separator","aria-orientation":m?"vertical":"horizontal",className:n.tkx("flex-shrink-0"),style:{...m?{width:1,height:f.separatorSize,marginLeft:2,marginRight:2}:{height:1,width:f.separatorSize,marginTop:2,marginBottom:2},backgroundColor:p.border}},e.id);const o=n.sanitizeString(e.label),r=!e.disabled,i=x[0]===e.id;return(0,a.jsxs)("button",{ref:t=>{t?g.current.set(e.id,t):g.current.delete(e.id)},type:"button",role:void e.type,"aria-pressed":"toggle"===e.type?e.active:void 0,"aria-label":o,"aria-disabled":e.disabled||void 0,tabIndex:r&&i?0:-1,disabled:e.disabled,onClick:()=>{e.disabled||e.onClick?.()},onKeyDown:t=>{y(t,e.id),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.disabled||e.onClick?.())},className:n.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:v(e),onMouseEnter:t=>{e.disabled||e.active||(t.currentTarget.style.backgroundColor=p.surfaceAlt)},onMouseLeave:t=>{e.disabled||(t.currentTarget.style.backgroundColor=e.active?`${p.primary}20`:"transparent")},children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",style:{width:f.iconSize,height:f.iconSize,display:"flex",alignItems:"center",justifyContent:"center"},children:e.icon}),!e.icon&&o]},e.id)})})},exports.TkxTooltip=function({content:e,children:r,placement:i="top",delay:s=300}){const d=t.useTheme(),[c,u]=(0,l.useState)(!1),p=(0,l.useRef)(null),h=(0,l.useId)(),f=(0,l.useRef)(null),m=o.useReducedMotion(),g=n.sanitizeString(e),x=t.getAccessibleForeground(d.surfaceAlt,[d.text,"#ffffff","#000000"]);function b(){f.current=setTimeout(()=>u(!0),s)}function y(){f.current&&clearTimeout(f.current),u(!1)}o.useEscapeKey(y,c),o.useClickOutside(p,y),(0,l.useEffect)(()=>()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]);const v=r,w=(0,l.cloneElement)(v,{"aria-describedby":c?h:void 0,onMouseEnter:e=>{v.props.onMouseEnter?.(e),b()},onMouseLeave:e=>{v.props.onMouseLeave?.(e),y()},onFocus:e=>{v.props.onFocus?.(e),b()},onBlur:e=>{v.props.onBlur?.(e),y()}});return(0,a.jsxs)("span",{ref:p,className:n.tkx("relative inline-flex"),children:[w,c&&(0,a.jsx)("span",{id:h,role:"tooltip",className:n.tkx("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!m&&"animate-fade-in"),style:{backgroundColor:d.surfaceAlt,color:x,border:`1px solid ${d.border}`,boxShadow:`0 4px 12px ${d.bg}40`,maxWidth:280,...D[i]},children:g})]})},exports.TkxTour=function({steps:e,isOpen:r=!1,onClose:i,current:d,onChange:c}){const u=t.useTheme(),p=o.useReducedMotion(),[h,f]=(0,l.useState)(0),m=d??h,g=(0,l.useRef)(null),[x,b]=(0,l.useState)({top:0,left:0}),[y,v]=(0,l.useState)(null),w=e[m],k=(0,l.useCallback)(()=>{if(!w)return;const e=function(e){const t=document.querySelector(e);return t?t.getBoundingClientRect():null}(w.target);if(v(e),e&&g.current){const t=g.current.offsetWidth,n=g.current.offsetHeight;b(function(e,t,n,o){switch(t){case"top":return{top:e.top-o-12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case"bottom":return{top:e.bottom+12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case"left":return{top:e.top+e.height/2-o/2+window.scrollY,left:e.left-n-12+window.scrollX};case"right":return{top:e.top+e.height/2-o/2+window.scrollY,left:e.right+12+window.scrollX};default:return{top:e.bottom+12+window.scrollY,left:e.left+window.scrollX}}}(e,w.placement??"bottom",t,n))}},[w]);(0,l.useEffect)(()=>{if(r)return k(),window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0)}},[r,m,k]),(0,l.useEffect)(()=>{r&&g.current?.focus()},[r,m]);const S=(0,l.useCallback)(e=>{f(e),c?.(e)},[c]),C=(0,l.useCallback)(()=>{m<e.length-1?S(m+1):i?.()},[m,e.length,S,i]),$=(0,l.useCallback)(()=>{m>0&&S(m-1)},[m,S]);if(!r||!w)return null;const z=n.sanitizeString(w.title),M=n.sanitizeString(w.description);return(0,s.createPortal)((0,a.jsxs)("div",{"aria-hidden":"true",children:[(0,a.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9998,backgroundColor:"rgba(0,0,0,0.55)",clipPath:y?`polygon(0% 0%, 0% 100%, ${y.left-6}px 100%, ${y.left-6}px ${y.top-6}px, ${y.right+6}px ${y.top-6}px, ${y.right+6}px ${y.bottom+6}px, ${y.left-6}px ${y.bottom+6}px, ${y.left-6}px 100%, 100% 100%, 100% 0%)`:void 0,transition:p?"none":"clip-path 0.25s ease"},onClick:i}),(0,a.jsxs)("div",{ref:g,role:"dialog","aria-modal":"true","aria-label":`Tour step ${m+1} of ${e.length}`,tabIndex:-1,style:{position:"absolute",zIndex:9999,top:x.top,left:x.left,width:300,backgroundColor:u.surface,border:`1px solid ${u.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${u.bg}80`,animation:p?"none":"tkxFadeIn 0.2s ease",fontFamily:"inherit"},onKeyDown:e=>{"Escape"===e.key&&i?.()},children:[(0,a.jsx)("h3",{className:n.tkx("m-0 mb-2 text-base font-semibold"),style:{color:u.text},children:z}),(0,a.jsx)("p",{className:n.tkx("m-0 mb-4 text-sm leading-relaxed"),style:{color:u.textMuted},children:M}),(0,a.jsx)("div",{className:n.tkx("flex items-center gap-1 mb-4"),"aria-label":"Tour progress",children:e.map((e,t)=>(0,a.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",backgroundColor:t===m?u.primary:u.border,transition:p?"none":"background-color 0.2s"}},t))}),(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between gap-2"),children:[(0,a.jsx)("button",{type:"button","aria-label":"Skip tour",onClick:i,className:n.tkx("border-0 bg-transparent cursor-pointer text-sm px-2 py-1"),style:{color:u.textMuted},children:"Skip"}),(0,a.jsxs)("div",{className:n.tkx("flex gap-2"),children:[m>0&&(0,a.jsx)("button",{type:"button","aria-label":"Previous step",onClick:$,className:n.tkx("rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent"),style:{borderColor:u.border,color:u.text},children:"Prev"}),(0,a.jsx)("button",{type:"button","aria-label":m===e.length-1?"Finish tour":"Next step",onClick:C,className:n.tkx("rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium"),style:{backgroundColor:u.primary,color:"#fff"},children:m===e.length-1?"Finish":"Next"})]})]})]})]}),document.body)},exports.TkxTransferList=function({sourceItems:e,targetItems:r,onTransfer:i,sourceTitle:s="Available",targetTitle:d="Selected",searchable:c=!1,height:u=300,className:p,style:h}){const f=t.useTheme(),m=o.useReducedMotion(),g=(0,l.useId)(),x=(0,l.useId)(),[b,y]=(0,l.useState)(new Set),[v,w]=(0,l.useState)(new Set),[k,S]=(0,l.useState)(""),[C,$]=(0,l.useState)(""),z=(0,l.useCallback)(e=>{y(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),M=(0,l.useCallback)(e=>{w(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),N=(0,l.useCallback)(()=>{const t=e.filter(e=>!e.disabled).map(e=>e.value);t.every(e=>b.has(e))?y(new Set):y(new Set(t))},[e,b]),I=(0,l.useCallback)(()=>{const e=r.filter(e=>!e.disabled).map(e=>e.value);e.every(e=>v.has(e))?w(new Set):w(new Set(e))},[r,v]),L=(0,l.useCallback)(()=>{if(0===b.size)return;const t=e.filter(e=>b.has(e.value)&&!e.disabled);i(e.filter(e=>!b.has(e.value)||e.disabled),[...r,...t]),y(new Set)},[e,r,b,i]),R=(0,l.useCallback)(()=>{if(0===v.size)return;const t=r.filter(e=>v.has(e.value)&&!e.disabled),n=r.filter(e=>!v.has(e.value)||e.disabled);i([...e,...t],n),w(new Set)},[e,r,v,i]),D=e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:`1px solid ${f.border}`,backgroundColor:e?f.surface:f.surfaceAlt,cursor:e?"not-allowed":"pointer",opacity:e?.5:1,transition:m?"none":"all 100ms ease",outline:"none"});return(0,a.jsxs)("div",{className:n.tkx("flex gap-3 font-sans","flex-col sm:flex-row",p??""),style:{color:f.text,...h},children:[(0,a.jsx)(gn,{title:s,items:e,selected:b,onToggle:z,onToggleAll:N,search:k,onSearchChange:S,searchable:c,height:u,listId:g}),(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-center gap-2","flex-row sm:flex-col"),style:{padding:"8px 0"},children:[(0,a.jsx)("button",{type:"button","aria-label":"Move selected items to target list",disabled:0===b.size,onClick:L,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),L())},className:n.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:D(0===b.size),onMouseEnter:e=>{b.size>0&&(e.currentTarget.style.backgroundColor=f.primary,e.currentTarget.style.borderColor=f.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===b.size?f.surface:f.surfaceAlt,e.currentTarget.style.borderColor=f.border},children:(0,a.jsx)(fn,{color:f.text})}),(0,a.jsx)("button",{type:"button","aria-label":"Move selected items to source list",disabled:0===v.size,onClick:R,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),R())},className:n.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:D(0===v.size),onMouseEnter:e=>{v.size>0&&(e.currentTarget.style.backgroundColor=f.primary,e.currentTarget.style.borderColor=f.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===v.size?f.surface:f.surfaceAlt,e.currentTarget.style.borderColor=f.border},children:(0,a.jsx)(mn,{color:f.text})})]}),(0,a.jsx)(gn,{title:d,items:r,selected:v,onToggle:M,onToggleAll:I,search:C,onSearchChange:$,searchable:c,height:u,listId:x})]})},exports.TkxTreeView=function({data:e,selected:r,onSelect:i,expanded:s,onExpand:d,multiSelect:c=!1,showCheckboxes:u=!1,showLines:p=!1,className:h,style:f}){const m=t.useTheme(),g=o.useReducedMotion();(0,l.useId)();const[x,b]=(0,l.useState)([]),[y,v]=(0,l.useState)([]),w=new Set(r??x),k=new Set(s??y),S=(0,l.useCallback)(e=>{void 0===s&&v(e),d?.(e)},[s,d]),C=(0,l.useCallback)(e=>{void 0===r&&b(e),i?.(e)},[r,i]),$=(0,l.useCallback)(e=>{const t=Array.from(k);k.has(e)?S(t.filter(t=>t!==e)):S([...t,e])},[k,S]),z=(0,l.useCallback)(e=>{if(c){const t=Array.from(w);w.has(e)?C(t.filter(t=>t!==e)):C([...t,e])}else C(w.has(e)?[]:[e])},[c,w,C]),M=function(e,t){const n=[];return function e(o,r){for(const i of o)n.push({node:i,depth:r}),i.children?.length&&t.has(i.id)&&e(i.children,r+1)}(e,0),n}(e,k),N=(0,l.useRef)(0),I=(0,l.useRef)(new Map),L=e=>{N.current=e,I.current.get(e)?.focus()};return(0,a.jsx)("ul",{role:"tree","aria-label":"Tree view","aria-multiselectable":c||void 0,className:n.tkx("list-none m-0 p-0 font-sans select-none",h??""),style:{color:m.text,...f},children:M.map(({node:e,depth:t},o)=>{const r=(e.children?.length??0)>0,i=k.has(e.id),l=w.has(e.id),s=n.sanitizeString(e.label);return(0,a.jsxs)("li",{role:"treeitem","aria-selected":l,"aria-expanded":r?i:void 0,"aria-disabled":e.disabled||void 0,"aria-level":t+1,"aria-setsize":M.filter(e=>e.depth===t).length,tabIndex:0===o?0:-1,ref:e=>{e?I.current.set(o,e):I.current.delete(o)},onKeyDown:e=>((e,t)=>{const n=M[t];if(!n)return;const{node:o}=n,r=(o.children?.length??0)>0;switch(e.key){case"ArrowDown":e.preventDefault(),t<M.length-1&&L(t+1);break;case"ArrowUp":e.preventDefault(),t>0&&L(t-1);break;case"ArrowRight":e.preventDefault(),r&&!k.has(o.id)?$(o.id):r&&k.has(o.id)&&t<M.length-1&&L(t+1);break;case"ArrowLeft":if(e.preventDefault(),r&&k.has(o.id))$(o.id);else for(let e=t-1;e>=0;e--)if(M[e].depth<n.depth){L(e);break}break;case"Enter":case" ":e.preventDefault(),o.disabled||z(o.id);break;case"Home":e.preventDefault(),L(0);break;case"End":e.preventDefault(),L(M.length-1)}})(e,o),onClick:()=>{e.disabled||(r&&$(e.id),z(e.id))},className:n.tkx("relative flex items-center gap-1.5 py-1 px-2 rounded-md cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",e.disabled?"opacity-50 cursor-not-allowed":""),style:{paddingLeft:24*t+8,backgroundColor:l?`${m.primary}18`:"transparent",transition:g?"none":"background-color 100ms ease",minHeight:32},onMouseEnter:t=>{l||e.disabled||(t.currentTarget.style.backgroundColor=m.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=l?`${m.primary}18`:"transparent"},children:[p&&t>0&&(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",left:24*(t-1)+16,top:0,bottom:0,width:1,backgroundColor:m.border}}),r?(0,a.jsx)("span",{role:"presentation",onClick:t=>{t.stopPropagation(),$(e.id)},className:n.tkx("inline-flex items-center justify-center cursor-pointer"),style:{width:20,height:20},children:(0,a.jsx)(dn,{expanded:i,color:m.textMuted,reducedMotion:g})}):(0,a.jsx)("span",{style:{width:20,height:20},"aria-hidden":"true"}),u&&(0,a.jsx)(cn,{checked:l,color:m.primary,borderColor:m.border}),e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),(0,a.jsx)("span",{className:n.tkx("text-sm truncate"),style:{color:e.disabled?m.textMuted:m.text},children:s})]},e.id)})})},exports.TkxVideoPlayer=zt,exports.TkxVoterIdInput=Pr,exports.TkxWatermark=function({text:e,children:r,rotate:i=-22,gap:s=[100,100],fontSize:d=14,color:c,zIndex:u=10,pattern:p="tiled",dynamic:h=!1,refreshMs:f=0,intensifyOnDevtools:m=!1,fingerprintId:g}){const x=t.useTheme(),b=o.useReducedMotion(),y=(0,l.useRef)(null),[v,w]=(0,l.useState)(""),[k,S]=(0,l.useState)(0),C=Wo(),$=(0,l.useMemo)(()=>{const t=(Array.isArray(e)?e:[e]).map(e=>n.sanitizeString(e));return"fingerprint"===p?function(e,t){return[...e,`id:${t||("undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10))} • ${(new Date).toISOString().slice(0,16).replace("T"," ")}`]}(t,g):t},[e,p,g,k]),z=m&&C?"66":"22",M=c??`${x.textMuted}${z}`,N=(0,l.useCallback)(()=>function(e,t,n,o,r,i){if("undefined"==typeof document)return"";const l=document.createElement("canvas"),a=l.getContext("2d");if(!a)return"";const s=1.5*o,d=e.length*s,c=Math.max(...e.map(e=>e.length))*o*.6;let u,p;return"single"===i?(u=Math.max(800,1.6*c),p=Math.max(600,4*d)):(u=n[0]+c,p=n[1]+d),l.width=2*u,l.height=2*p,a.scale(2,2),a.translate(u/2,p/2),a.rotate(t*Math.PI/180),a.font=`${o}px sans-serif`,a.fillStyle=r,a.textAlign="center",a.textBaseline="middle",e.forEach((t,n)=>{const o=(n-(e.length-1)/2)*s;a.fillText(t,0,o)}),l.toDataURL()}($,i,s,d,M,p),[$,i,s,d,M,p]);(0,l.useEffect)(()=>{const e=N();e&&w(`url(${e})`)},[N]),(0,l.useEffect)(()=>{if(!f||f<=0)return;const e=window.setInterval(()=>S(e=>e+1),f);return()=>window.clearInterval(e)},[f]),(0,l.useEffect)(()=>{if(!h||"undefined"==typeof document)return;const e=()=>{"visible"===document.visibilityState&&S(e=>e+1)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[h]),(0,l.useEffect)(()=>{const e=y.current?.querySelector("[data-watermark]");if(!e)return;const t=new MutationObserver(()=>{const t=N();t&&(e.style.backgroundImage=`url(${t})`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[N]);const I={zIndex:u,backgroundImage:v,backgroundRepeat:"single"===p?"no-repeat":"repeat",backgroundPosition:"single"===p?"center center":void 0,animation:b?"none":"tkxFadeIn 0.3s ease"},L=m&&C?{filter:"blur(4px)",transition:"filter 0.2s"}:{};return(0,a.jsxs)("div",{ref:y,className:n.tkx("relative"),style:{overflow:"hidden"},children:[(0,a.jsx)("div",{style:L,children:r}),(0,a.jsx)("div",{"data-watermark":!0,"aria-hidden":"true",className:n.tkx("absolute inset-0 pointer-events-none"),style:I}),m&&C&&(0,a.jsx)("div",{"aria-live":"polite",style:{position:"absolute",top:12,right:12,padding:"6px 12px",background:x.danger,color:"#fff",fontSize:12,fontWeight:600,borderRadius:6,zIndex:u+1,pointerEvents:"none"},children:"Developer Tools detected — content protected"})]})},exports.VisuallyHidden=function({as:e,children:t,...n}){return(0,a.jsx)(e??"span",{className:"tkx-sr-only",...n,children:t})},exports.WCAGEngine=t.WCAGEngine,exports.audit=n.audit,exports.auroraLight=t.auroraLight,exports.batchUpdate=t.batchUpdate,exports.breakpoints=t.breakpoints,exports.buildTkxCSP=n.buildTkxCSP,exports.contrastRatio=t.contrastRatio,exports.createFocusTrap=t.createFocusTrap,exports.createRateLimiter=n.createRateLimiter,exports.createTheme=t.createTheme,exports.css=t.css,exports.cssVar=t.cssVar,exports.cx=n.cx,exports.deepFreeze=n.deepFreeze,exports.extractAtomicCSS=n.extractAtomicCSS,exports.extractCSS=t.extractCSS,exports.fnv1aHash=t.fnv1aHash,exports.fromObject=t.fromObject,exports.generatePalette=t.generatePalette,exports.getAccessibleForeground=t.getAccessibleForeground,exports.getAuditLog=n.getAuditLog,exports.getLocaleDisplayName=function(e){if(mo[e])return mo[e];if("undefined"!=typeof Intl&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e},exports.injectStyles=t.injectStyles,exports.installFrameBuster=n.installFrameBuster,exports.installTrustedTypes=n.installTrustedTypes,exports.isFramed=n.isFramed,exports.isRTL=r.isRTL,exports.isRtlLocale=function(e){return go.has(e)||go.has(e.split("-")[0])},exports.isSafeAttrName=n.isSafeAttrName,exports.isValidAadhaar=Dr,exports.isValidDrivingLicence=Vr,exports.isValidPan=Er,exports.isValidVoterId=jr,exports.keyframes=t.keyframes,exports.loadFontScript=function(e){_o(e)},exports.meetsAA=t.meetsAA,exports.meetsAAA=t.meetsAAA,exports.memoize=t.memoize,exports.prefersHighContrast=t.prefersHighContrast,exports.prefersReducedMotion=t.prefersReducedMotion,exports.quantumDark=t.quantumDark,exports.radii=t.radii,exports.resetAtomicCSS=n.resetAtomicCSS,exports.resolvePluginUtility=n.resolvePluginUtility,exports.responsive=t.responsive,exports.sanitizeCSS=n.sanitizeCSS,exports.sanitizeHTML=n.sanitizeHTML,exports.sanitizeHref=n.sanitizeHref,exports.sanitizeJSON=n.sanitizeJSON,exports.sanitizeProps=n.sanitizeProps,exports.sanitizeString=n.sanitizeString,exports.sanitizeUnicode=n.sanitizeUnicode,exports.scriptsForLanguage=Zo,exports.scrubPII=n.scrubPII,exports.seoSchema={softwareApplication:e=>({"@context":"https://schema.org","@type":"SoftwareApplication",name:e.name,description:e.description,url:e.url,applicationCategory:"DeveloperApplication",operatingSystem:"Web",...e.version&&{softwareVersion:e.version,version:e.version},...e.license&&{license:e.license},...e.repository&&{codeRepository:e.repository},...e.downloadUrl&&{downloadUrl:e.downloadUrl},...void 0!==e.price&&{offers:{"@type":"Offer",price:e.price,priceCurrency:e.currency??"USD"}}}),article:e=>({"@context":"https://schema.org","@type":"Article",headline:e.headline,description:e.description,mainEntityOfPage:e.url,...e.image&&{image:e.image},author:{"@type":"Person",name:e.author},datePublished:e.datePublished,...e.dateModified&&{dateModified:e.dateModified}}),faqPage:e=>({"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))}),breadcrumbList:e=>({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.map((e,t)=>({"@type":"ListItem",position:t+1,name:e.name,item:e.url}))}),product:e=>({"@context":"https://schema.org","@type":"Product",name:e.name,description:e.description,image:e.image,brand:{"@type":"Brand",name:e.brand},...e.sku&&{sku:e.sku},offers:{"@type":"Offer",price:e.price,priceCurrency:e.currency,availability:`https://schema.org/${e.availability??"InStock"}`},...e.rating&&{aggregateRating:{"@type":"AggregateRating",ratingValue:e.rating.value,reviewCount:e.rating.count}}})},exports.shadows=t.shadows,exports.sniffMimeType=n.sniffMimeType,exports.spacing=t.spacing,exports.tkx=n.tkx,exports.tkxListPlugins=n.tkxListPlugins,exports.tkxPlugin=n.tkxPlugin,exports.tkxRemovePlugin=n.tkxRemovePlugin,exports.tx=n.tx,exports.typography=t.typography,exports.unloadFontScript=function(e){!function(e){if("undefined"==typeof document)return;const t=qo[e];if(!t)return;const n=document.getElementById(t.id);n&&n.remove()}(e)},exports.useAnnounce=o.useAnnounce,exports.useClickOutside=o.useClickOutside,exports.useComponentSize=function(e,t){const{getSize:n}=fo();return n(e,t)},exports.useConfig=fo,exports.useDevtoolsOpen=Wo,exports.useDirection=r.useDirection,exports.useEscapeKey=o.useEscapeKey,exports.useFocusTrap=o.useFocusTrap,exports.useHighContrast=o.useHighContrast,exports.useI18n=r.useI18n,exports.useLocale=r.useLocale,exports.useLogicalSpacing=function(e,t=0){const{direction:n}=fo(),o="number"==typeof e?`${e}px`:e,r="number"==typeof t?`${t}px`:t;return"rtl"===n?{marginRight:o,marginLeft:r}:{marginLeft:o,marginRight:r}},exports.usePrefersColorScheme=t.usePrefersColorScheme,exports.usePrefixCls=function(e,t){const{prefixCls:n}=fo();return`${t??n}-${e}`},exports.useReducedMotion=o.useReducedMotion,exports.useRtlFlip=function(){const{direction:e}=fo();if("rtl"===e)return{transform:"scaleX(-1)"}},exports.useTheme=t.useTheme,exports.useTkxCommand=function(){const[e,t]=(0,l.useState)(!1);return{isOpen:e,open:(0,l.useCallback)(()=>t(!0),[]),close:(0,l.useCallback)(()=>t(!1),[]),toggle:(0,l.useCallback)(()=>t(e=>!e),[])}},exports.useTkxForm=i.useTkxForm,exports.useToast=function(){return{toast:(0,l.useCallback)(e=>function(e){const t=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:t,duration:e.duration??4e3};return _.length<5?(_=[..._,n],ee(t,n.duration)):G=[...G,n],Q(),t}(e),[]),dismiss:(0,l.useCallback)(e=>te(e),[]),dismissAll:(0,l.useCallback)(()=>(J.forEach(e=>clearTimeout(e)),J.clear(),_=[],G=[],void Q()),[])}},exports.validateProps=n.validateProps,exports.verifyAuditIntegrity=n.verifyAuditIntegrity,exports.zIndex=t.zIndex;
|