tekivex-ui 3.3.0 → 3.4.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.js CHANGED
@@ -1,154 +1,154 @@
1
- import{A as e,C as t,D as n,E as o,F as r,I as i,L as a,N as l,O as s,P as d,R as c,S as u,T as h,a as p,b as f,c as m,d as g,f as x,g as b,h as y,i as v,j as w,k,l as S,m as C,n as $,o as z,p as N,r as M,s as I,t as L,u as R,v as D,w as T,x as W,y as A}from"./chunk-DdHSYetV.js";import{A as B,C as E,D as H,E as F,O as j,S as P,T as O,_ as V,a as U,b as K,c as Y,d as X,f as q,g as G,h as _,i as Z,j as J,k as Q,l as ee,m as te,n as ne,o as oe,p as re,r as ie,s as ae,t as le,u as se,v as de,w as ce,x as ue,y as he}from"./chunk-DcVMayoM.js";import{a as pe,i as fe,n as me,o as ge,r as xe,t as be}from"./chunk-BHX35YDv.js";import{I18nContext as ye,LOCALES as ve,enUS as we,isRTL as ke,useDirection as Se,useI18n as Ce,useLocale as $e}from"./i18n.js";import{g as ze,h as Ne,m as Me}from"./chunk-DTO-RrPx.js";import Ie,{Children as Le,cloneElement as Re,createContext as De,createElement as Te,forwardRef as We,useCallback as Ae,useContext as Be,useEffect as Ee,useId as He,useImperativeHandle as Fe,useMemo as je,useReducer as Pe,useRef as Oe,useState as Ve}from"react";import{Fragment as Ue,jsx as Ke,jsxs as Ye}from"react/jsx-runtime";import{createPortal as Xe}from"react-dom";var qe={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},Ge={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},_e={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},Ze={sm:14,md:16,lg:18,xl:20};function Je({size:e}){const t=Ze[e];/* @__PURE__ */
2
- return Ye("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:U("animate-spin shrink-0"),children:[/* @__PURE__ */Ke("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),/* @__PURE__ */Ke("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}var Qe=We(({variant:e="solid",size:t="md",colorScheme:n="primary",isLoading:o=!1,loadingText:r,leftIcon:i,rightIcon:a,isFullWidth:l=!1,glow:s=!1,disabled:d,children:c,className:u,style:h,...p},f)=>{const m=N(),g=ge(),x=d||o,b={primary:m.primary,secondary:m.secondary,danger:m.danger,warning:m.warning,success:m.success}[n],y=A(b,["#ffffff","#000000",m.bg]),v="string"==typeof c?F(c):c,w=r?F(r):void 0,k="solid"===e?{backgroundColor:b,color:y,border:"none",boxShadow:s&&!g?`0 0 20px ${b}55`:void 0}:"outline"===e?{backgroundColor:"transparent",color:b,border:`2px solid ${b}`}:"ghost"===e?{backgroundColor:"transparent",color:b,border:"none"}:{backgroundColor:"transparent",color:b,border:"none",textDecoration:"underline"};/* @__PURE__ */
3
- return Ke("button",{ref:f,"aria-busy":o,"aria-disabled":x,disabled:x,className:le(U("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",qe[t],Ge[t],_e[t],"link"!==e&&_e[t],l&&"w-full",x?"cursor-not-allowed opacity-60":"cursor-pointer",!g&&"transition-all duration-200","focus-visible:focus-ring"),u),style:{...k,...h},...p,children:/* @__PURE__ */Ye(Ue,o?{children:[/* @__PURE__ */Ke(Je,{size:t}),w??v]}:{children:[i&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",children:i}),v,a&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",children:a})]})})});Qe.displayName="TkxButton";var et={none:"",sm:"p-3",md:"p-5",lg:"p-7"},tt=We(({variant:e="default",isHoverable:t,isClickable:n,padding:o="md",as:r,children:i,className:a,style:l,...s},d)=>{const c=N(),u=ge(),h=r??(n?"button":"div"),p={default:{backgroundColor:c.surface,border:`1px solid ${c.border}`},glass:{backgroundColor:`${c.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${c.border}55`,boxShadow:`0 4px 24px ${c.bg}40`},quantum:{backgroundColor:c.surfaceAlt,border:`1px solid ${c.primary}33`,boxShadow:`0 0 24px ${c.primary}18`},elevated:{backgroundColor:c.surface,boxShadow:`0 4px 20px ${c.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${c.border}`}}[e];/* @__PURE__ */
4
- return Ke(h,{ref:d,className:le("tkx-card",U("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",et[o],(t||n)&&!u&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default"),a),style:{color:c.text,...p,...l},...s,children:i})});function nt({title:e,subtitle:t,action:n,children:o,className:r,...i}){const a=N();/* @__PURE__ */
1
+ import{A as e,C as t,D as n,E as o,F as r,I as i,L as a,N as l,O as s,P as d,R as c,S as u,T as h,a as p,b as f,c as m,d as g,f as x,g as b,h as y,i as v,j as w,k,l as S,m as C,n as $,o as z,p as M,r as N,s as I,t as R,u as T,v as D,w as L,x as W,y as A}from"./chunk-DdHSYetV.js";import{A as B,C as E,D as H,E as F,O as j,S as P,T as O,_ as V,a as U,b as K,c as Y,d as X,f as q,g as G,h as J,i as _,j as Z,k as Q,l as ee,m as te,n as ne,o as oe,p as re,r as ie,s as ae,t as le,u as se,v as de,w as ce,x as ue,y as he}from"./chunk-DcVMayoM.js";import{a as pe,i as fe,n as me,o as ge,r as xe,t as be}from"./chunk-BHX35YDv.js";import{I18nContext as ye,LOCALES as ve,enUS as we,isRTL as ke,useDirection as Se,useI18n as Ce,useLocale as $e}from"./i18n.js";import{g as ze,h as Me,m as Ne}from"./chunk-DTO-RrPx.js";import Ie,{Children as Re,cloneElement as Te,createContext as De,createElement as Le,forwardRef as We,useCallback as Ae,useContext as Be,useEffect as Ee,useId as He,useImperativeHandle as Fe,useMemo as je,useReducer as Pe,useRef as Oe,useState as Ve}from"react";import{Fragment as Ue,jsx as Ke,jsxs as Ye}from"react/jsx-runtime";import{createPortal as Xe}from"react-dom";var qe={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},Ge={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},Je={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},_e={sm:14,md:16,lg:18,xl:20};function Ze({size:e}){const t=_e[e];/* @__PURE__ */
2
+ return Ye("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:U("animate-spin shrink-0"),children:[/* @__PURE__ */Ke("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),/* @__PURE__ */Ke("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}var Qe=We(({variant:e="solid",size:t="md",colorScheme:n="primary",isLoading:o=!1,loadingText:r,leftIcon:i,rightIcon:a,isFullWidth:l=!1,glow:s=!1,disabled:d,children:c,className:u,style:h,...p},f)=>{const m=M(),g=ge(),x=d||o,b={primary:m.primary,secondary:m.secondary,danger:m.danger,warning:m.warning,success:m.success}[n],y=A(b,["#ffffff","#000000",m.bg]),v="string"==typeof c?F(c):c,w=r?F(r):void 0,k="solid"===e?{backgroundColor:b,color:y,border:"none",boxShadow:s&&!g?`0 0 20px ${b}55`:void 0}:"outline"===e?{backgroundColor:"transparent",color:b,border:`2px solid ${b}`}:"ghost"===e?{backgroundColor:"transparent",color:b,border:"none"}:{backgroundColor:"transparent",color:b,border:"none",textDecoration:"underline"};/* @__PURE__ */
3
+ return Ke("button",{ref:f,"aria-busy":o,"aria-disabled":x,disabled:x,className:le(U("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",qe[t],Ge[t],Je[t],"link"!==e&&Je[t],l&&"w-full",x?"cursor-not-allowed opacity-60":"cursor-pointer",!g&&"transition-all duration-200","focus-visible:focus-ring"),u),style:{...k,...h},...p,children:/* @__PURE__ */Ye(Ue,o?{children:[/* @__PURE__ */Ke(Ze,{size:t}),w??v]}:{children:[i&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",children:i}),v,a&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",children:a})]})})});Qe.displayName="TkxButton";var et={none:"",sm:"p-3",md:"p-5",lg:"p-7"},tt=We(({variant:e="default",isHoverable:t,isClickable:n,padding:o="md",as:r,children:i,className:a,style:l,...s},d)=>{const c=M(),u=ge(),h=r??(n?"button":"div"),p={default:{backgroundColor:c.surface,border:`1px solid ${c.border}`},glass:{backgroundColor:`${c.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${c.border}55`,boxShadow:`0 4px 24px ${c.bg}40`},quantum:{backgroundColor:c.surfaceAlt,border:`1px solid ${c.primary}33`,boxShadow:`0 0 24px ${c.primary}18`},elevated:{backgroundColor:c.surface,boxShadow:`0 4px 20px ${c.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${c.border}`}}[e];/* @__PURE__ */
4
+ return Ke(h,{ref:d,className:le("tkx-card",U("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",et[o],(t||n)&&!u&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default"),a),style:{color:c.text,...p,...l},...s,children:i})});function nt({title:e,subtitle:t,action:n,children:o,className:r,...i}){const a=M();/* @__PURE__ */
5
5
  return Ye("div",{className:le(U("flex justify-between items-start mb-4"),r),...i,children:[/* @__PURE__ */Ye("div",{className:U("flex-1 min-w-0"),children:[e&&/* @__PURE__ */Ke("h3",{className:U("text-base font-semibold m-0"),style:{color:a.text},children:e}),t&&/* @__PURE__ */Ke("p",{className:U("text-sm mt-1 mb-0"),style:{color:a.textMuted},children:t}),o]}),n&&/* @__PURE__ */Ke("div",{className:U("ml-3 shrink-0"),children:n})]})}function ot({children:e,className:t,...n}){/* @__PURE__ */
6
- return Ke("div",{className:le(U(""),t),...n,children:e})}function rt({children:e,className:t,style:n,...o}){const r=N();/* @__PURE__ */
7
- return Ke("div",{className:le(U("flex items-center justify-end gap-2 mt-4 pt-4"),t),style:{borderTop:`1px solid ${r.border}`,...n},...o,children:e})}tt.displayName="TkxCard";var it=We(({label:e,id:t,error:n,hint:o,leftAddon:r,rightAddon:i,isInvalid:a,isRequired:l,disabled:s,className:d,style:c,unicodeSafe:u=!0,onChange:h,...p},f)=>{const m=N(),g=He(),x=t??g,b=`${x}-hint`,y=`${x}-error`,v=a||!!n,w=[o&&b,v&&y].filter(Boolean).join(" ")||void 0,k=F(e),S=n?F(n):void 0,C=o?F(o):void 0,$=v?m.danger:m.border;/* @__PURE__ */
6
+ return Ke("div",{className:le(U(""),t),...n,children:e})}function rt({children:e,className:t,style:n,...o}){const r=M();/* @__PURE__ */
7
+ return Ke("div",{className:le(U("flex items-center justify-end gap-2 mt-4 pt-4"),t),style:{borderTop:`1px solid ${r.border}`,...n},...o,children:e})}tt.displayName="TkxCard";var it=We(({label:e,id:t,error:n,hint:o,leftAddon:r,rightAddon:i,isInvalid:a,isRequired:l,disabled:s,className:d,style:c,unicodeSafe:u=!0,onChange:h,...p},f)=>{const m=M(),g=He(),x=t??g,b=`${x}-hint`,y=`${x}-error`,v=a||!!n,w=[o&&b,v&&y].filter(Boolean).join(" ")||void 0,k=F(e),S=n?F(n):void 0,C=o?F(o):void 0,$=v?m.danger:m.border;/* @__PURE__ */
8
8
  return Ye("div",{className:le(U("flex flex-col gap-1 w-full"),d),style:c,children:[
9
9
  /* @__PURE__ */Ye("label",{htmlFor:x,className:U("text-sm font-medium font-sans"),style:{color:m.text},children:[k,l&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("ml-1"),style:{color:m.danger},children:"*"})]}),
10
10
  /* @__PURE__ */Ye("div",{className:U("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",s?"opacity-60":""),style:{border:`1.5px solid ${$}`,backgroundColor:m.surface},children:[r&&/* @__PURE__ */Ke("div",{className:U("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:m.surfaceAlt,color:m.textMuted,borderRight:`1px solid ${m.border}`},children:r}),
11
- /* @__PURE__ */Ke("input",{ref:f,id:x,"aria-invalid":v,"aria-required":l,"aria-describedby":w,disabled:s,className:le(U("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:m.text},onChange:u?e=>{const t=H(e.target.value);t!==e.target.value&&(e.target.value=t),h?.(e)}:h,...p}),i&&/* @__PURE__ */Ke("div",{className:U("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:m.surfaceAlt,color:m.textMuted,borderLeft:`1px solid ${m.border}`},children:i})]}),C&&!S&&/* @__PURE__ */Ke("span",{id:b,className:U("text-xs"),style:{color:m.textMuted},children:C}),S&&/* @__PURE__ */Ye("span",{id:y,role:"alert",className:U("text-xs flex items-center gap-1"),style:{color:m.danger},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})}),S]})]})});it.displayName="TkxInput";var at={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]"},lt={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},st=We(({variant:e="default",size:t="md",dot:n=!1,pulse:o=!1,outlined:r=!1,children:i,className:a,style:l,...s},d)=>{const c=N(),u={default:c.border,primary:c.primary,secondary:c.secondary,danger:c.danger,warning:c.warning,success:c.success,info:c.info}[e]||"#666666",h=A(u,["#ffffff","#000000",c.bg||"#000000"]),p="string"==typeof i?F(i):i;/* @__PURE__ */
12
- return Ke("span",n?{ref:d,"aria-label":"string"==typeof i?F(i):void 0,className:le(U("inline-block rounded-full",lt[t],o&&"animate-pulse"),a),style:{backgroundColor:u,...l},...s}:{ref:d,className:le(U("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",at[t],o&&"animate-pulse"),a),style:{backgroundColor:r?"transparent":u,color:r?u:h,border:r?`1px solid ${u}`:"none",...l},...s,children:p})});st.displayName="TkxBadge";var dt={sm:"4px",md:"8px",lg:"12px"},ct={sm:32,md:48,lg:64},ut=We(({value:e,variant:t="linear",size:n="md",label:o,showValue:r,color:i,className:a,style:l,...s},d)=>{const c=N(),u=ge(),h=i??c.primary,p=void 0===e,f=void 0!==e?Math.min(100,Math.max(0,e)):0;if(void 0!==e){const{errors:t}=B({value:e},{value:{type:"number",min:0,max:100}});t.length}if("circular"===t){const e=ct[n],t="sm"===n?3:"md"===n?4:5,i=(e-2*t)/2,s=2*Math.PI*i,m=p?0:s-f/100*s;/* @__PURE__ */
11
+ /* @__PURE__ */Ke("input",{ref:f,id:x,"aria-invalid":v,"aria-required":l,"aria-describedby":w,disabled:s,className:le(U("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:m.text},onChange:u?e=>{const t=H(e.target.value);t!==e.target.value&&(e.target.value=t),h?.(e)}:h,...p}),i&&/* @__PURE__ */Ke("div",{className:U("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:m.surfaceAlt,color:m.textMuted,borderLeft:`1px solid ${m.border}`},children:i})]}),C&&!S&&/* @__PURE__ */Ke("span",{id:b,className:U("text-xs"),style:{color:m.textMuted},children:C}),S&&/* @__PURE__ */Ye("span",{id:y,role:"alert",className:U("text-xs flex items-center gap-1"),style:{color:m.danger},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})}),S]})]})});it.displayName="TkxInput";var at={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]"},lt={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},st=We(({variant:e="default",size:t="md",dot:n=!1,pulse:o=!1,outlined:r=!1,children:i,className:a,style:l,...s},d)=>{const c=M(),u={default:c.border,primary:c.primary,secondary:c.secondary,danger:c.danger,warning:c.warning,success:c.success,info:c.info}[e]||"#666666",h=A(u,["#ffffff","#000000",c.bg||"#000000"]),p="string"==typeof i?F(i):i;/* @__PURE__ */
12
+ return Ke("span",n?{ref:d,"aria-label":"string"==typeof i?F(i):void 0,className:le(U("inline-block rounded-full",lt[t],o&&"animate-pulse"),a),style:{backgroundColor:u,...l},...s}:{ref:d,className:le(U("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",at[t],o&&"animate-pulse"),a),style:{backgroundColor:r?"transparent":u,color:r?u:h,border:r?`1px solid ${u}`:"none",...l},...s,children:p})});st.displayName="TkxBadge";var dt={sm:"4px",md:"8px",lg:"12px"},ct={sm:32,md:48,lg:64},ut=We(({value:e,variant:t="linear",size:n="md",label:o,showValue:r,color:i,className:a,style:l,...s},d)=>{const c=M(),u=ge(),h=i??c.primary,p=void 0===e,f=void 0!==e?Math.min(100,Math.max(0,e)):0;if(void 0!==e){const{errors:t}=B({value:e},{value:{type:"number",min:0,max:100}});t.length}if("circular"===t){const e=ct[n],t="sm"===n?3:"md"===n?4:5,i=(e-2*t)/2,s=2*Math.PI*i,m=p?0:s-f/100*s;/* @__PURE__ */
13
13
  return Ye("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":p?void 0:f,"aria-label":o??(p?"Loading":`${f}%`),className:le(U("inline-flex flex-col items-center gap-1"),a),style:l,children:[/* @__PURE__ */Ye("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:c.border,strokeWidth:t}),/* @__PURE__ */Ke("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:h,strokeWidth:t,strokeLinecap:"round",strokeDasharray:s,strokeDashoffset:m,transform:`rotate(-90 ${e/2} ${e/2})`,style:{transition:u?"none":"stroke-dashoffset 300ms ease",animation:p&&!u?"tkx-spin 1s linear infinite":void 0}})]}),r&&!p&&/* @__PURE__ */Ye("span",{className:U("text-xs"),style:{color:c.textMuted},children:[f,"%"]})]})}const m=dt[n];/* @__PURE__ */
14
- return Ye("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":p?void 0:f,"aria-label":o??(p?"Loading":`${f}%`),className:le(U("flex flex-col gap-1 w-full"),a),style:l,children:[o&&/* @__PURE__ */Ye("div",{className:U("flex justify-between text-sm"),style:{color:c.text},children:[/* @__PURE__ */Ke("span",{children:o}),r&&!p&&/* @__PURE__ */Ye("span",{children:[f,"%"]})]}),/* @__PURE__ */Ke("div",{className:U("w-full overflow-hidden"),style:{height:m,borderRadius:m,backgroundColor:c.border},children:/* @__PURE__ */Ke("div",{style:{height:"100%",borderRadius:m,backgroundColor:h,width:p?"40%":`${f}%`,transition:u?"none":"width 300ms ease",animation:p&&!u?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});ut.displayName="TkxProgress";var ht={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}},pt=We(({checked:e,onChange:t,label:n,size:o="md",hideLabel:r,disabled:i,className:a,style:l,...s},d)=>{const c=N(),u=ge(),h=He();B({label:n,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:p,th:f,td:m,gap:g}=ht[o],x=e?p-m-g:g,b=e?c.primary:c.border;/* @__PURE__ */
15
- return Ye("div",{className:le(U("inline-flex items-center gap-2",i?"opacity-50":""),a),style:l,children:[!r&&/* @__PURE__ */Ke("label",{htmlFor:h,className:U("text-sm font-sans",i?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:c.text},children:n}),/* @__PURE__ */Ke("button",{ref:d,id:h,role:"switch","aria-checked":e,"aria-label":r?n:void 0,disabled:i,onClick:()=>!i&&t(!e),onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||i||(n.preventDefault(),t(!e))},className:le(U("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",i?"cursor-not-allowed":"cursor-pointer",!u&&"transition-colors duration-200")),style:{width:p,height:f,borderRadius:f,backgroundColor:b},...s,children:/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("absolute rounded-full"),style:{top:"50%",left:x,width:m,height:m,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:u?"none":"left 200ms ease"}})})]})});pt.displayName="TkxToggle";var ft={info:/* @__PURE__ */Ke("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:/* @__PURE__ */Ke("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})})};function mt({variant:e,title:t,children:n,dismissible:o,onDismiss:r,icon:i,style:a,className:l}){const s=N(),d=be(),c=t?F(t):void 0;Ee(()=>{c&&d(c,"danger"===e||"warning"===e?"assertive":"polite")},[c,e]);const u={info:s.info,success:s.success,warning:s.warning,danger:s.danger}[e];/* @__PURE__ */
14
+ return Ye("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":p?void 0:f,"aria-label":o??(p?"Loading":`${f}%`),className:le(U("flex flex-col gap-1 w-full"),a),style:l,children:[o&&/* @__PURE__ */Ye("div",{className:U("flex justify-between text-sm"),style:{color:c.text},children:[/* @__PURE__ */Ke("span",{children:o}),r&&!p&&/* @__PURE__ */Ye("span",{children:[f,"%"]})]}),/* @__PURE__ */Ke("div",{className:U("w-full overflow-hidden"),style:{height:m,borderRadius:m,backgroundColor:c.border},children:/* @__PURE__ */Ke("div",{style:{height:"100%",borderRadius:m,backgroundColor:h,width:p?"40%":`${f}%`,transition:u?"none":"width 300ms ease",animation:p&&!u?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});ut.displayName="TkxProgress";var ht={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}},pt=We(({checked:e,onChange:t,label:n,size:o="md",hideLabel:r,disabled:i,className:a,style:l,...s},d)=>{const c=M(),u=ge(),h=He();B({label:n,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:p,th:f,td:m,gap:g}=ht[o],x=e?p-m-g:g,b=e?c.primary:c.border;/* @__PURE__ */
15
+ return Ye("div",{className:le(U("inline-flex items-center gap-2",i?"opacity-50":""),a),style:l,children:[!r&&/* @__PURE__ */Ke("label",{htmlFor:h,className:U("text-sm font-sans",i?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:c.text},children:n}),/* @__PURE__ */Ke("button",{ref:d,id:h,role:"switch","aria-checked":e,"aria-label":r?n:void 0,disabled:i,onClick:()=>!i&&t(!e),onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||i||(n.preventDefault(),t(!e))},className:le(U("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",i?"cursor-not-allowed":"cursor-pointer",!u&&"transition-colors duration-200")),style:{width:p,height:f,borderRadius:f,backgroundColor:b},...s,children:/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("absolute rounded-full"),style:{top:"50%",left:x,width:m,height:m,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:u?"none":"left 200ms ease"}})})]})});pt.displayName="TkxToggle";var ft={info:/* @__PURE__ */Ke("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:/* @__PURE__ */Ke("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})})};function mt({variant:e,title:t,children:n,dismissible:o,onDismiss:r,icon:i,style:a,className:l}){const s=M(),d=be(),c=t?F(t):void 0;Ee(()=>{c&&d(c,"danger"===e||"warning"===e?"assertive":"polite")},[c,e]);const u={info:s.info,success:s.success,warning:s.warning,danger:s.danger}[e];/* @__PURE__ */
16
16
  return Ye("div",{role:"danger"===e||"warning"===e?"alert":"status",className:U("flex items-start gap-3 px-4 py-3 rounded-lg border animate-fade-in font-sans",l??""),style:{backgroundColor:`${u}18`,borderColor:u,color:s.text,...a},children:[
17
17
  /* @__PURE__ */Ke("span",{className:U("shrink-0 mt-[1px]"),style:{color:u},children:i??ft[e]}),
18
- /* @__PURE__ */Ye("div",{className:U("flex-1 min-w-0"),children:[c&&/* @__PURE__ */Ke("p",{className:U("m-0 font-semibold text-sm mb-1"),children:c}),/* @__PURE__ */Ke("div",{className:U("text-sm leading-relaxed"),children:n})]}),o&&r&&/* @__PURE__ */Ke("button",{"aria-label":"Dismiss alert",onClick:r,className:U("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}var gt={sm:"400px",md:"560px",lg:"720px",full:"100vw"},xt=0;function bt(){--xt<=0&&(xt=0,document.body.style.overflow="")}function yt({isOpen:e,onClose:t,title:n,size:o="md",closeOnOverlayClick:r=!0,closeOnEscape:i=!0,children:a,footer:l}){const s=N(),d=$e(),c=He(),u=fe(e),h=ge(),p=be(),f=F(n),m="full"===o;return xe(t,i&&e),Ee(()=>{if(e){if(1===++xt&&(document.body.style.overflow="hidden"),p(f,"polite"),he())try{window.dispatchEvent(new CustomEvent("tkx:framed-modal",{detail:{title:f,at:Date.now()}}))}catch{}}else bt();return()=>{e&&bt()}},[e,f,p]),e&&"undefined"!=typeof document?Xe(/* @__PURE__ */Ye("div",{role:"presentation",className:U("fixed inset-0 z-[9000] flex",m?"items-stretch":"items-center justify-center",m?"":"p-4"),children:[/* @__PURE__ */Ke("div",{"aria-hidden":"true",onClick:r?t:void 0,className:U("absolute inset-0",!h&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),/* @__PURE__ */Ye("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":c,className:U("relative z-10 flex flex-col overflow-hidden",!h&&"animate-slide-up",m?"":"rounded-xl"),style:{backgroundColor:s.surface,border:`1px solid ${s.border}`,width:gt[o],maxWidth:"100%",maxHeight:m?"100vh":"90vh",boxShadow:`0 20px 60px ${s.bg}80`},children:[
18
+ /* @__PURE__ */Ye("div",{className:U("flex-1 min-w-0"),children:[c&&/* @__PURE__ */Ke("p",{className:U("m-0 font-semibold text-sm mb-1"),children:c}),/* @__PURE__ */Ke("div",{className:U("text-sm leading-relaxed"),children:n})]}),o&&r&&/* @__PURE__ */Ke("button",{"aria-label":"Dismiss alert",onClick:r,className:U("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}var gt={sm:"400px",md:"560px",lg:"720px",full:"100vw"},xt=0;function bt(){--xt<=0&&(xt=0,document.body.style.overflow="")}function yt({isOpen:e,onClose:t,title:n,size:o="md",closeOnOverlayClick:r=!0,closeOnEscape:i=!0,children:a,footer:l}){const s=M(),d=$e(),c=He(),u=fe(e),h=ge(),p=be(),f=F(n),m="full"===o;return xe(t,i&&e),Ee(()=>{if(e){if(1===++xt&&(document.body.style.overflow="hidden"),p(f,"polite"),he())try{window.dispatchEvent(new CustomEvent("tkx:framed-modal",{detail:{title:f,at:Date.now()}}))}catch{}}else bt();return()=>{e&&bt()}},[e,f,p]),e&&"undefined"!=typeof document?Xe(/* @__PURE__ */Ye("div",{role:"presentation",className:U("fixed inset-0 z-[9000] flex",m?"items-stretch":"items-center justify-center",m?"":"p-4"),children:[/* @__PURE__ */Ke("div",{"aria-hidden":"true",onClick:r?t:void 0,className:U("absolute inset-0",!h&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),/* @__PURE__ */Ye("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":c,className:U("relative z-10 flex flex-col overflow-hidden",!h&&"animate-slide-up",m?"":"rounded-xl"),style:{backgroundColor:s.surface,border:`1px solid ${s.border}`,width:gt[o],maxWidth:"100%",maxHeight:m?"100vh":"90vh",boxShadow:`0 20px 60px ${s.bg}80`},children:[
19
19
  /* @__PURE__ */Ye("div",{className:U("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${s.border}`},children:[/* @__PURE__ */Ke("h2",{id:c,className:U("m-0 text-lg font-semibold font-sans"),style:{color:s.text},children:f}),/* @__PURE__ */Ke("button",{onClick:t,"aria-label":d.close,className:U("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),
20
20
  /* @__PURE__ */Ke("div",{className:U("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:s.text},children:a}),l&&/* @__PURE__ */Ke("div",{className:U("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${s.border}`},children:l})]})]}),document.body):null}var vt=De(null);function wt(){const e=Be(vt);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}function kt({defaultIndex:e=0,activeIndex:t,onChange:n,children:o,tabCount:r=0,style:i,className:a}){const[l,s]=Ve(e),d=He(),c=void 0!==t?t:l;/* @__PURE__ */
21
- return Ke(vt.Provider,{value:{activeIndex:c,setActiveIndex:e=>{void 0===t&&s(e),n?.(e)},baseId:d,tabCount:r},children:/* @__PURE__ */Ke("div",{className:a,style:i,children:o})})}function St({children:e,className:t,style:n,...o}){const r=N();/* @__PURE__ */
22
- return Ke("div",{role:"tablist",className:le(U("flex gap-1"),t),style:{borderBottom:`2px solid ${r.border}`,...n},...o,children:e})}function Ct({index:e,children:t,disabled:n=!1,className:o,style:r}){const i=N(),{activeIndex:a,setActiveIndex:l,baseId:s,tabCount:d}=wt(),c=Oe(null),u=a===e;/* @__PURE__ */
21
+ return Ke(vt.Provider,{value:{activeIndex:c,setActiveIndex:e=>{void 0===t&&s(e),n?.(e)},baseId:d,tabCount:r},children:/* @__PURE__ */Ke("div",{className:a,style:i,children:o})})}function St({children:e,className:t,style:n,...o}){const r=M();/* @__PURE__ */
22
+ return Ke("div",{role:"tablist",className:le(U("flex gap-1"),t),style:{borderBottom:`2px solid ${r.border}`,...n},...o,children:e})}function Ct({index:e,children:t,disabled:n=!1,className:o,style:r}){const i=M(),{activeIndex:a,setActiveIndex:l,baseId:s,tabCount:d}=wt(),c=Oe(null),u=a===e;/* @__PURE__ */
23
23
  return Ke("button",{ref:c,role:"tab",id:`${s}-tab-${e}`,"aria-controls":`${s}-panel-${e}`,"aria-selected":u,tabIndex:u?0:-1,disabled:n,className:le(U("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",n?"opacity-50 cursor-not-allowed":""),o),style:{color:u?i.primary:i.textMuted,fontWeight:u?600:400,borderBottom:u?`2px solid ${i.primary}`:"2px solid transparent",marginBottom:"-2px",...r},onClick:()=>!n&&l(e),onKeyDown:t=>f(t,e,d,e=>{l(e),document.getElementById(`${s}-tab-${e}`)?.focus()}),children:t})}function $t({children:e,className:t,...n}){/* @__PURE__ */
24
- return Ke("div",{className:t,...n,children:e})}function zt({index:e,children:t,style:n,className:o}){const{activeIndex:r,baseId:i}=wt();return r!==e?null:/* @__PURE__ */Ke("div",{role:"tabpanel",id:`${i}-panel-${e}`,"aria-labelledby":`${i}-tab-${e}`,tabIndex:0,className:le(U("pt-4"),o),style:n,children:t})}var Nt={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 Mt({content:e,children:t,placement:n="top",delay:o=300}){const r=N(),[i,a]=Ve(!1),l=Oe(null),s=He(),d=Oe(null),c=ge(),u=F(e),h=A(r.surfaceAlt,[r.text,"#ffffff","#000000"]);function p(){d.current=setTimeout(()=>a(!0),o)}function f(){d.current&&clearTimeout(d.current),a(!1)}xe(f,i),me(l,f),Ee(()=>()=>{d.current&&(clearTimeout(d.current),d.current=null)},[]);const m=t,g=Re(m,{"aria-describedby":i?s:void 0,onMouseEnter:e=>{m.props.onMouseEnter?.(e),p()},onMouseLeave:e=>{m.props.onMouseLeave?.(e),f()},onFocus:e=>{m.props.onFocus?.(e),p()},onBlur:e=>{m.props.onBlur?.(e),f()}});/* @__PURE__ */
25
- return Ye("span",{ref:l,className:U("relative inline-flex"),children:[g,i&&/* @__PURE__ */Ke("span",{id:s,role:"tooltip",className:U("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!c&&"animate-fade-in"),style:{backgroundColor:r.surfaceAlt,color:h,border:`1px solid ${r.border}`,boxShadow:`0 4px 12px ${r.bg}40`,maxWidth:280,...Nt[n]},children:u})]})}function It({variant:e,width:t,height:n,animation:o,bgColor:r,accentColor:i}){const a=void 0!==t?"number"==typeof t?`${t}px`:t:"100%",l=void 0!==n?"number"==typeof n?`${n}px`:n:{text:"1em",circular:a,rectangular:"80px"}[e],s=U("circular"===e?"rounded-full":"text"===e?"rounded":"rounded-lg"),d="pulse"===o?U("animate-pulse"):"wave"===o?U("animate-shimmer"):"",c="wave"===o?{background:`linear-gradient(90deg,${r} 25%,${i} 50%,${r} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:r};/* @__PURE__ */
26
- return Ke("div",{className:le(s,d),style:{width:a,height:l,...c}})}var Lt=We(({variant:e="rectangular",width:t,height:n,lines:o,animation:r="pulse",className:i,style:a,...l},s)=>{const d=N(),c=!ge()&&r;/* @__PURE__ */
27
- return Ke("div","text"===e&&o&&o>1?{ref:s,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:le(U("flex flex-col gap-2"),i),style:a,...l,children:Array.from({length:o},(e,r)=>/* @__PURE__ */Ke(It,{variant:"text",width:r===o-1?"75%":t,height:n,animation:c,bgColor:d.surfaceAlt,accentColor:d.border},r))}:{ref:s,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:i,style:a,...l,children:/* @__PURE__ */Ke(It,{variant:e,width:t,height:n,animation:c,bgColor:d.surfaceAlt,accentColor:d.border})})});Lt.displayName="TkxSkeleton";var Rt={xs:24,sm:32,md:40,lg:56,xl:72},Dt={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},Tt=We(({src:e,alt:t,initials:n,size:o="md",shape:r="circle",status:i,className:a,style:l,...s},d)=>{const c=N(),[u,h]=Ve(!1),p=Rt[o],f="circle"===r,m=c.surfaceAlt,g=A(m,[c.text,c.textMuted]),x=e&&!u,b=!x&&n,y=Math.max(8,.22*p),v=U("relative inline-flex shrink-0",f?"rounded-full":"rounded-lg"),w=U("block object-cover",f?"rounded-full":"rounded-lg"),k=U("flex items-center justify-center font-semibold font-sans select-none",f?"rounded-full":"rounded-lg");/* @__PURE__ */
24
+ return Ke("div",{className:t,...n,children:e})}function zt({index:e,children:t,style:n,className:o}){const{activeIndex:r,baseId:i}=wt();return r!==e?null:/* @__PURE__ */Ke("div",{role:"tabpanel",id:`${i}-panel-${e}`,"aria-labelledby":`${i}-tab-${e}`,tabIndex:0,className:le(U("pt-4"),o),style:n,children:t})}var Mt={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 Nt({content:e,children:t,placement:n="top",delay:o=300}){const r=M(),[i,a]=Ve(!1),l=Oe(null),s=He(),d=Oe(null),c=ge(),u=F(e),h=A(r.surfaceAlt,[r.text,"#ffffff","#000000"]);function p(){d.current=setTimeout(()=>a(!0),o)}function f(){d.current&&clearTimeout(d.current),a(!1)}xe(f,i),me(l,f),Ee(()=>()=>{d.current&&(clearTimeout(d.current),d.current=null)},[]);const m=t,g=Te(m,{"aria-describedby":i?s:void 0,onMouseEnter:e=>{m.props.onMouseEnter?.(e),p()},onMouseLeave:e=>{m.props.onMouseLeave?.(e),f()},onFocus:e=>{m.props.onFocus?.(e),p()},onBlur:e=>{m.props.onBlur?.(e),f()}});/* @__PURE__ */
25
+ return Ye("span",{ref:l,className:U("relative inline-flex"),children:[g,i&&/* @__PURE__ */Ke("span",{id:s,role:"tooltip",className:U("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!c&&"animate-fade-in"),style:{backgroundColor:r.surfaceAlt,color:h,border:`1px solid ${r.border}`,boxShadow:`0 4px 12px ${r.bg}40`,maxWidth:280,...Mt[n]},children:u})]})}function It({variant:e,width:t,height:n,animation:o,bgColor:r,accentColor:i}){const a=void 0!==t?"number"==typeof t?`${t}px`:t:"100%",l=void 0!==n?"number"==typeof n?`${n}px`:n:{text:"1em",circular:a,rectangular:"80px"}[e],s=U("circular"===e?"rounded-full":"text"===e?"rounded":"rounded-lg"),d="pulse"===o?U("animate-pulse"):"wave"===o?U("animate-shimmer"):"",c="wave"===o?{background:`linear-gradient(90deg,${r} 25%,${i} 50%,${r} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:r};/* @__PURE__ */
26
+ return Ke("div",{className:le(s,d),style:{width:a,height:l,...c}})}var Rt=We(({variant:e="rectangular",width:t,height:n,lines:o,animation:r="pulse",className:i,style:a,...l},s)=>{const d=M(),c=!ge()&&r;/* @__PURE__ */
27
+ return Ke("div","text"===e&&o&&o>1?{ref:s,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:le(U("flex flex-col gap-2"),i),style:a,...l,children:Array.from({length:o},(e,r)=>/* @__PURE__ */Ke(It,{variant:"text",width:r===o-1?"75%":t,height:n,animation:c,bgColor:d.surfaceAlt,accentColor:d.border},r))}:{ref:s,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:i,style:a,...l,children:/* @__PURE__ */Ke(It,{variant:e,width:t,height:n,animation:c,bgColor:d.surfaceAlt,accentColor:d.border})})});Rt.displayName="TkxSkeleton";var Tt={xs:24,sm:32,md:40,lg:56,xl:72},Dt={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},Lt=We(({src:e,alt:t,initials:n,size:o="md",shape:r="circle",status:i,className:a,style:l,...s},d)=>{const c=M(),[u,h]=Ve(!1),p=Tt[o],f="circle"===r,m=c.surfaceAlt,g=A(m,[c.text,c.textMuted]),x=e&&!u,b=!x&&n,y=Math.max(8,.22*p),v=U("relative inline-flex shrink-0",f?"rounded-full":"rounded-lg"),w=U("block object-cover",f?"rounded-full":"rounded-lg"),k=U("flex items-center justify-center font-semibold font-sans select-none",f?"rounded-full":"rounded-lg");/* @__PURE__ */
28
28
  return Ye("div",{ref:d,className:le(v,a),style:{width:p,height:p,...l},...s,children:[x?/* @__PURE__ */Ke("img",{src:F(e),alt:F(t),onError:()=>h(!0),className:w,style:{width:p,height:p}}):/* @__PURE__ */Ke("div",{role:"img","aria-label":F(t),className:k,style:{width:p,height:p,backgroundColor:m,color:g,fontSize:.38*p},children:b?F(n).slice(0,2).toUpperCase():/* @__PURE__ */Ye("svg",{width:.5*p,height:.5*p,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),/* @__PURE__ */Ke("circle",{cx:"12",cy:"7",r:"4"})]})}),i&&/* @__PURE__ */Ke("span",{"aria-label":`Status: ${i}`,className:U("absolute bottom-0 right-0 rounded-full"),style:{width:y,height:y,backgroundColor:Dt[i],border:`2px solid ${c.bg}`}})]})});function Wt({dir:e}){/* @__PURE__ */
29
- return Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:U("shrink-0"),children:/* @__PURE__ */Ke("path","asc"===e?{d:"M7 14l5-5 5 5H7z"}:"desc"===e?{d:"M7 10l5 5 5-5H7z"}:{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}function At({columns:e,data:t,caption:n,sortable:o,stickyHeader:r,isLoading:i,emptyState:a,style:l,className:s,striped:d,maxHeight:c,rowHeight:u=44,virtualScroll:h,onLoadMore:p,hasMore:f,loadingMore:m=!1,onRowClick:g,selectedRows:x,bordered:b,compact:y}){const v=N(),[w,k]=Ve(null),[S,C]=Ve("asc"),$=je(()=>w&&o?[...t].sort((e,t)=>{const n=e[w],o=t[w];let r=0;return"string"==typeof n&&"string"==typeof o?r=n.localeCompare(o):"number"==typeof n&&"number"==typeof o&&(r=n-o),"asc"===S?r:-r}):t,[t,w,S,o]),z=Ae(e=>{w===e?C(e=>"asc"===e?"desc":"asc"):(k(e),C("asc"))},[w]),M=void 0!==h?h:void 0!==c&&$.length>=50,I=Oe(null),[L,R]=Ve(0),[D,T]=Ve(400),W=Ae(()=>{I.current&&R(I.current.scrollTop)},[]);Ee(()=>{if(!M||!I.current)return;const e=I.current;T(e.clientHeight);const t=new ResizeObserver(()=>T(e.clientHeight));return t.observe(e),()=>t.disconnect()},[M]);const A=M?Math.max(0,Math.floor(L/u)-5):0,B=M?Math.min($.length,Math.ceil((L+D)/u)+5):$.length,E=M?$.slice(A,B):$,H=Oe(null),j=Oe(!1);Ee(()=>{j.current=!1},[t.length]),Ee(()=>{if(!p)return;const e=H.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!j.current&&!1!==f&&(j.current=!0,p())},{root:I.current,rootMargin:"0px 0px 200px 0px",threshold:0});return t.observe(e),()=>t.disconnect()},[p,f]);const P=y?"4px":"12px",O=y?"8px":"16px",V=b?`1px solid ${v.border}`:"none",K=je(()=>new Set(x??[]),[x]);/* @__PURE__ */
30
- return Ke("div",{className:U("w-full rounded-lg",s??""),style:{border:`1px solid ${v.border}`,overflow:"hidden",...l},children:/* @__PURE__ */Ye("div",{ref:I,onScroll:M?W:void 0,style:{overflowX:"auto",overflowY:c?"auto":"visible",maxHeight:c??"none"},children:[
29
+ return Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:U("shrink-0"),children:/* @__PURE__ */Ke("path","asc"===e?{d:"M7 14l5-5 5 5H7z"}:"desc"===e?{d:"M7 10l5 5 5-5H7z"}:{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}function At({columns:e,data:t,caption:n,sortable:o,stickyHeader:r,isLoading:i,emptyState:a,style:l,className:s,striped:d,maxHeight:c,rowHeight:u=44,virtualScroll:h,onLoadMore:p,hasMore:f,loadingMore:m=!1,onRowClick:g,selectedRows:x,bordered:b,compact:y}){const v=M(),[w,k]=Ve(null),[S,C]=Ve("asc"),$=je(()=>w&&o?[...t].sort((e,t)=>{const n=e[w],o=t[w];let r=0;return"string"==typeof n&&"string"==typeof o?r=n.localeCompare(o):"number"==typeof n&&"number"==typeof o&&(r=n-o),"asc"===S?r:-r}):t,[t,w,S,o]),z=Ae(e=>{w===e?C(e=>"asc"===e?"desc":"asc"):(k(e),C("asc"))},[w]),N=void 0!==h?h:void 0!==c&&$.length>=50,I=Oe(null),[R,T]=Ve(0),[D,L]=Ve(400),W=Ae(()=>{I.current&&T(I.current.scrollTop)},[]);Ee(()=>{if(!N||!I.current)return;const e=I.current;L(e.clientHeight);const t=new ResizeObserver(()=>L(e.clientHeight));return t.observe(e),()=>t.disconnect()},[N]);const A=N?Math.max(0,Math.floor(R/u)-5):0,B=N?Math.min($.length,Math.ceil((R+D)/u)+5):$.length,E=N?$.slice(A,B):$,H=Oe(null),j=Oe(!1);Ee(()=>{j.current=!1},[t.length]),Ee(()=>{if(!p)return;const e=H.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!j.current&&!1!==f&&(j.current=!0,p())},{root:I.current,rootMargin:"0px 0px 200px 0px",threshold:0});return t.observe(e),()=>t.disconnect()},[p,f]);const P=y?"4px":"12px",O=y?"8px":"16px",V=b?`1px solid ${v.border}`:"none",K=je(()=>new Set(x??[]),[x]);/* @__PURE__ */
30
+ return Ke("div",{className:U("w-full rounded-lg",s??""),style:{border:`1px solid ${v.border}`,overflow:"hidden",...l},children:/* @__PURE__ */Ye("div",{ref:I,onScroll:N?W:void 0,style:{overflowX:"auto",overflowY:c?"auto":"visible",maxHeight:c??"none"},children:[
31
31
  /* @__PURE__ */Ye("table",{className:U("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:v.text},children:[n&&/* @__PURE__ */Ke("caption",{className:U("text-sm text-left p-2"),style:{color:v.textMuted},children:F(n)}),
32
32
  /* @__PURE__ */Ke("thead",{style:r?{position:"sticky",top:0,backgroundColor:v.surfaceAlt,zIndex:1}:{backgroundColor:v.surfaceAlt},children:/* @__PURE__ */Ke("tr",{children:e.map(e=>{const t=o&&!1!==e.sortable,n=(r=e.key,w!==r?"none":S);var r;/* @__PURE__ */
33
33
  return Ke("th",{scope:"col","aria-sort":t?"none"===n?"none":"asc"===n?"ascending":"descending":void 0,className:U("text-left font-semibold whitespace-nowrap",t?"cursor-pointer select-none":""),style:{padding:`${P} ${O}`,color:v.textMuted,borderBottom:`2px solid ${v.border}`,borderRight:V,width:e.width},onClick:()=>t&&z(e.key),onKeyDown:n=>{!t||"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),z(e.key))},tabIndex:t?0:void 0,children:/* @__PURE__ */Ye("span",{className:U("inline-flex items-center gap-1.5"),children:[F(e.header),t&&/* @__PURE__ */Ke(Wt,{dir:n})]})},String(e.key))})})}),
34
- /* @__PURE__ */Ke("tbody",{children:i?Array.from({length:5},(t,n)=>/* @__PURE__ */Ke("tr",{children:e.map(e=>/* @__PURE__ */Ke("td",{style:{padding:`${P} ${O}`},children:/* @__PURE__ */Ke(Lt,{variant:"text",height:"16px"})},String(e.key)))},n)):0===$.length?/* @__PURE__ */Ke("tr",{children:/* @__PURE__ */Ke("td",{colSpan:e.length,className:U("text-center"),style:{padding:"32px 16px",color:v.textMuted},children:a??"No data available"})}):/* @__PURE__ */Ye(Ue,{children:[M&&A>0&&/* @__PURE__ */Ke("tr",{"aria-hidden":"true",style:{height:A*u},children:/* @__PURE__ */Ke("td",{colSpan:e.length,style:{padding:0,border:"none"}})}),E.map((t,n)=>{const o=A+n,r=K.has(o);/* @__PURE__ */
35
- return Ke("tr",{"aria-rowindex":o+1,"aria-selected":r||void 0,onClick:g?()=>g(t,o):void 0,onKeyDown:g?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),g(t,o))}:void 0,tabIndex:g?0:void 0,className:U(g?"cursor-pointer":""),style:{backgroundColor:r?`${v.primary}22`:d&&o%2==1?v.surfaceAlt:"transparent",borderBottom:`1px solid ${v.border}`,...M?{height:u,boxSizing:"border-box"}:{}},children:e.map(e=>{const n=t[e.key],o=e.render?e.render(n,t):"string"==typeof n?F(n):String(n??"");/* @__PURE__ */
36
- return Ke("td",{style:{padding:`${P} ${O}`,color:v.text,borderRight:V},children:o},String(e.key))})},o)}),M&&B<$.length&&/* @__PURE__ */Ke("tr",{"aria-hidden":"true",style:{height:($.length-B)*u},children:/* @__PURE__ */Ke("td",{colSpan:e.length,style:{padding:0,border:"none"}})})]})})]}),(f||m)&&/* @__PURE__ */Ke("div",{ref:H,style:{height:1,width:"100%"},children:m&&/* @__PURE__ */Ke("table",{style:{width:"100%",borderCollapse:"collapse"},children:/* @__PURE__ */Ke("tbody",{children:Array.from({length:3},(t,n)=>/* @__PURE__ */Ke("tr",{children:e.map(e=>/* @__PURE__ */Ke("td",{style:{padding:"10px 16px"},children:/* @__PURE__ */Ke(Lt,{variant:"text",height:"16px"})},String(e.key)))},n))})})}),!f&&p&&/* @__PURE__ */Ke("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:v.textMuted},children:"✓ All rows loaded"})]})})}Tt.displayName="TkxAvatar";var Bt=We(({orientation:e="horizontal",label:t,variant:n="solid",className:o,style:r,...i},a)=>{const l=N(),s=t?F(t):void 0,d="vertical"===e,c=d?"borderLeft":"borderTop",u=`1px ${n} ${l.border}`;return s?/* @__PURE__ */Ye("div",{role:"separator","aria-orientation":e,className:le(U("flex items-center gap-3 text-xs"),o),style:{color:l.textMuted,...r},...i,children:[
34
+ /* @__PURE__ */Ke("tbody",{children:i?Array.from({length:5},(t,n)=>/* @__PURE__ */Ke("tr",{children:e.map(e=>/* @__PURE__ */Ke("td",{style:{padding:`${P} ${O}`},children:/* @__PURE__ */Ke(Rt,{variant:"text",height:"16px"})},String(e.key)))},n)):0===$.length?/* @__PURE__ */Ke("tr",{children:/* @__PURE__ */Ke("td",{colSpan:e.length,className:U("text-center"),style:{padding:"32px 16px",color:v.textMuted},children:a??"No data available"})}):/* @__PURE__ */Ye(Ue,{children:[N&&A>0&&/* @__PURE__ */Ke("tr",{"aria-hidden":"true",style:{height:A*u},children:/* @__PURE__ */Ke("td",{colSpan:e.length,style:{padding:0,border:"none"}})}),E.map((t,n)=>{const o=A+n,r=K.has(o);/* @__PURE__ */
35
+ return Ke("tr",{"aria-rowindex":o+1,"aria-selected":r||void 0,onClick:g?()=>g(t,o):void 0,onKeyDown:g?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),g(t,o))}:void 0,tabIndex:g?0:void 0,className:U(g?"cursor-pointer":""),style:{backgroundColor:r?`${v.primary}22`:d&&o%2==1?v.surfaceAlt:"transparent",borderBottom:`1px solid ${v.border}`,...N?{height:u,boxSizing:"border-box"}:{}},children:e.map(e=>{const n=t[e.key],o=e.render?e.render(n,t):"string"==typeof n?F(n):String(n??"");/* @__PURE__ */
36
+ return Ke("td",{style:{padding:`${P} ${O}`,color:v.text,borderRight:V},children:o},String(e.key))})},o)}),N&&B<$.length&&/* @__PURE__ */Ke("tr",{"aria-hidden":"true",style:{height:($.length-B)*u},children:/* @__PURE__ */Ke("td",{colSpan:e.length,style:{padding:0,border:"none"}})})]})})]}),(f||m)&&/* @__PURE__ */Ke("div",{ref:H,style:{height:1,width:"100%"},children:m&&/* @__PURE__ */Ke("table",{style:{width:"100%",borderCollapse:"collapse"},children:/* @__PURE__ */Ke("tbody",{children:Array.from({length:3},(t,n)=>/* @__PURE__ */Ke("tr",{children:e.map(e=>/* @__PURE__ */Ke("td",{style:{padding:"10px 16px"},children:/* @__PURE__ */Ke(Rt,{variant:"text",height:"16px"})},String(e.key)))},n))})})}),!f&&p&&/* @__PURE__ */Ke("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:v.textMuted},children:"✓ All rows loaded"})]})})}Lt.displayName="TkxAvatar";var Bt=We(({orientation:e="horizontal",label:t,variant:n="solid",className:o,style:r,...i},a)=>{const l=M(),s=t?F(t):void 0,d="vertical"===e,c=d?"borderLeft":"borderTop",u=`1px ${n} ${l.border}`;return s?/* @__PURE__ */Ye("div",{role:"separator","aria-orientation":e,className:le(U("flex items-center gap-3 text-xs"),o),style:{color:l.textMuted,...r},...i,children:[
37
37
  /* @__PURE__ */Ke("hr",{className:U("flex-1 m-0 border-none"),style:{[c]:u}}),
38
38
  /* @__PURE__ */Ke("span",{children:s}),
39
39
  /* @__PURE__ */Ke("hr",{className:U("flex-1 m-0 border-none"),style:{[c]:u}})]}):/* @__PURE__ */Ke("hr",{ref:a,role:"separator","aria-orientation":e,className:le(U(d?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),o),style:{[c]:u,...r},...i})});Bt.displayName="TkxDivider";var Et={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 Ht(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function Ft({size:e,color:t}){/* @__PURE__ */
40
- return Ye("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:[/* @__PURE__ */Ke("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),/* @__PURE__ */Ke("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function jt({options:e,value:t,defaultValue:n,placeholder:o,size:r="md",isDisabled:i=!1,isInvalid:a=!1,label:l,hint:s,errorMessage:d,multiple:c=!1,searchable:u=!1,clearable:h=!1,isLoading:p=!1,onChange:f,renderOption:m,maxMenuHeight:g=280,virtualScroll:x,optionHeight:b=36,id:y,className:v,style:w}){const k=N(),S=$e(),C=o??S.selectPlaceholder,$=He(),z=y??$,M=`${z}-listbox`,I=`${z}-hint`,L=`${z}-error`,R=void 0!==t,[D,T]=Ve(Ht(n)),W=R?Ht(t):D,[A,B]=Ve(!1),[E,H]=Ve(""),[j,P]=Ve(-1),[O,V]=Ve(null),[K,Y]=Ve(""),X=Oe(null),q=Oe(null),G=Oe(null),_=Oe(null),Z=Oe(null),J=Et[r],Q=a||!!d,ee=Oe(null),[te,ne]=Ve(0),[oe,re]=Ve(0),ie=Ae(()=>{ee.current&&ne(ee.current.scrollTop)},[]);Ee(()=>{if(!A)return void ne(0);const e=ee.current;if(!e)return;re(e.clientHeight);const t=new ResizeObserver(()=>{re(e.clientHeight)});return t.observe(e),()=>t.disconnect()},[A]);const ae=u&&E?e.filter(e=>e.label.toLowerCase().includes(E.toLowerCase())):e,se=ae.filter(e=>!e.disabled),de=ae.some(e=>!!e.group),ce=(void 0!==x?x:ae.length>=100)&&!de,ue=ae.length*b,he=ce?Math.max(0,Math.floor(te/b)-8):0,pe=ce?Math.min(ae.length,Math.ceil((te+oe)/b)+8):ae.length,fe=ce?ae.slice(he,pe):ae,me=he*b,ge=ae.reduce((e,t)=>{const n=t.group??"";return e[n]||(e[n]=[]),e[n].push(t),e},{}),xe=Ae(e=>{let t;t=c?W.includes(e)?W.filter(t=>t!==e):[...W,e]:[e],R||T(t),f?.(c?t:t[0]??""),c||(B(!1),H(""),P(-1),q.current?.focus())},[R,c,f,W]),be=Ae((e,t)=>{t.stopPropagation();const n=W.filter(t=>t!==e);R||T(n),f?.(c?n:n[0]??"")},[R,c,f,W]),ye=Ae(e=>{e.stopPropagation(),R||T([]),f?.(c?[]:"")},[R,c,f]),ve=Ae(()=>{q.current&&A&&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}}(q.current,g))},[A,g]);function we(){if(i||p)return;B(!0);const e=se.findIndex(e=>W.includes(e.value));P(e>=0?e:0)}Ee(()=>{if(A)return ve(),window.addEventListener("scroll",ve,!0),window.addEventListener("resize",ve),()=>{window.removeEventListener("scroll",ve,!0),window.removeEventListener("resize",ve)}},[A,ve]),Ee(()=>{if(!A)return;const e=e=>{const t=e.target;q.current?.contains(t)||_.current?.contains(t)||(B(!1),H(""))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[A]),Ee(()=>{A&&u&&setTimeout(()=>G.current?.focus(),0)},[A,u]),Ee(()=>{if(A&&!(j<0))if(ce&&ee.current){const e=j*b,t=e+b,n=ee.current;e<n.scrollTop?n.scrollTop=e:t>n.scrollTop+n.clientHeight&&(n.scrollTop=t-n.clientHeight)}else(Z.current?.querySelector(`[data-idx="${j}"]`))?.scrollIntoView({block:"nearest"})},[j,A,ce,b]);const ke=Q?k.danger:A?k.primary:k.border,Se=j>=0&&se[j]?`${z}-opt-${se[j].value}`:void 0,Ce=[s&&I,Q&&L].filter(Boolean).join(" ")||void 0,ze=W.map(t=>e.find(e=>e.value===t)).filter(Boolean),Ne=A&&O?Xe(/* @__PURE__ */Ye("div",{ref:_,role:"listbox",id:M,"aria-label":l?F(l):"Options","aria-multiselectable":c,style:{position:"absolute",top:O.top,left:O.left,width:O.width,zIndex:9999,backgroundColor:k.surface,border:`1.5px solid ${k.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:O.width,maxHeight:g,display:"flex",flexDirection:"column"},children:[u&&/* @__PURE__ */Ye("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${k.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[/* @__PURE__ */Ke("circle",{cx:"11",cy:"11",r:"8"}),/* @__PURE__ */Ke("path",{d:"M21 21l-4.35-4.35"})]}),/* @__PURE__ */Ke("input",{ref:G,type:"text",value:E,onChange:e=>{H(e.target.value),P(0)},onKeyDown:e=>{switch(e.key){case"Escape":e.preventDefault(),B(!1),H(""),q.current?.focus();break;case"ArrowDown":e.preventDefault(),P(e=>Math.min(e+1,se.length-1));break;case"ArrowUp":e.preventDefault(),P(e=>Math.max(e-1,0));break;case"Home":e.preventDefault(),P(0);break;case"End":e.preventDefault(),P(se.length-1);break;case"Enter":e.preventDefault(),j>=0&&se[j]&&xe(se[j].value)}},placeholder:`${S.search}…`,"aria-label":`${S.search} options`,style:{border:"none",outline:"none",background:"transparent",color:k.text,fontSize:J.fontSize,fontFamily:"inherit",width:"100%"}})]}),/* @__PURE__ */Ke("div",{ref:e=>{Z.current=e,ee.current=e},onScroll:ce?ie:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:g-(u?48:0)},children:ce?/* @__PURE__ */Ye("div",{style:{height:ue,position:"relative"},children:[/* @__PURE__ */Ke("div",{style:{position:"absolute",top:me,left:0,right:0},children:fe.map(e=>{const t=se.indexOf(e),n=t===j,o=W.includes(e.value),r=m?m(e,o):/* @__PURE__ */Ye("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */Ke("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */Ke("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(e.label)})]}),e.description&&/* @__PURE__ */Ke("span",{style:{fontSize:"12px",color:k.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(e.description)})]});/* @__PURE__ */
41
- return Ye("div",{id:`${z}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":o,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&xe(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&P(t),style:{height:b,boxSizing:"border-box",padding:`0 ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:e.disabled?k.textMuted:k.text,backgroundColor:n?`${k.primary}22`:o?`${k.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:[r,o&&!m&&/* @__PURE__ */Ke("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})}),0===ae.length&&/* @__PURE__ */Ke("div",{style:{padding:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:k.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:p?"Loading…":"No options found"})]}):/* @__PURE__ */Ye(Ue,{children:[Object.entries(ge).map(([e,t])=>/* @__PURE__ */Ye("div",{children:[e&&/* @__PURE__ */Ke("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:k.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:k.surface,zIndex:1,borderBottom:`1px solid ${k.border}`},children:F(e)}),t.map(e=>{const t=se.indexOf(e),n=t===j,o=W.includes(e.value),r=m?m(e,o):/* @__PURE__ */Ye("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */Ke("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */Ke("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(e.label)})]}),e.description&&/* @__PURE__ */Ke("span",{style:{fontSize:"12px",color:k.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(e.description)})]});/* @__PURE__ */
42
- return Ye("div",{id:`${z}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":o,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&xe(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&P(t),style:{padding:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:e.disabled?k.textMuted:k.text,backgroundColor:n?`${k.primary}22`:o?`${k.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:[r,o&&!m&&/* @__PURE__ */Ke("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})]},e)),0===ae.length&&/* @__PURE__ */Ke("div",{style:{padding:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:k.textMuted,textAlign:"center"},children:p?"Loading…":"No options found"})]})})]}),document.body):null,Me=h&&W.length>0&&!i&&!p;/* @__PURE__ */
40
+ return Ye("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:[/* @__PURE__ */Ke("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),/* @__PURE__ */Ke("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function jt({options:e,value:t,defaultValue:n,placeholder:o,size:r="md",isDisabled:i=!1,isInvalid:a=!1,label:l,hint:s,errorMessage:d,multiple:c=!1,searchable:u=!1,clearable:h=!1,isLoading:p=!1,onChange:f,renderOption:m,maxMenuHeight:g=280,virtualScroll:x,optionHeight:b=36,id:y,className:v,style:w}){const k=M(),S=$e(),C=o??S.selectPlaceholder,$=He(),z=y??$,N=`${z}-listbox`,I=`${z}-hint`,R=`${z}-error`,T=void 0!==t,[D,L]=Ve(Ht(n)),W=T?Ht(t):D,[A,B]=Ve(!1),[E,H]=Ve(""),[j,P]=Ve(-1),[O,V]=Ve(null),[K,Y]=Ve(""),X=Oe(null),q=Oe(null),G=Oe(null),J=Oe(null),_=Oe(null),Z=Et[r],Q=a||!!d,ee=Oe(null),[te,ne]=Ve(0),[oe,re]=Ve(0),ie=Ae(()=>{ee.current&&ne(ee.current.scrollTop)},[]);Ee(()=>{if(!A)return void ne(0);const e=ee.current;if(!e)return;re(e.clientHeight);const t=new ResizeObserver(()=>{re(e.clientHeight)});return t.observe(e),()=>t.disconnect()},[A]);const ae=u&&E?e.filter(e=>e.label.toLowerCase().includes(E.toLowerCase())):e,se=ae.filter(e=>!e.disabled),de=ae.some(e=>!!e.group),ce=(void 0!==x?x:ae.length>=100)&&!de,ue=ae.length*b,he=ce?Math.max(0,Math.floor(te/b)-8):0,pe=ce?Math.min(ae.length,Math.ceil((te+oe)/b)+8):ae.length,fe=ce?ae.slice(he,pe):ae,me=he*b,ge=ae.reduce((e,t)=>{const n=t.group??"";return e[n]||(e[n]=[]),e[n].push(t),e},{}),xe=Ae(e=>{let t;t=c?W.includes(e)?W.filter(t=>t!==e):[...W,e]:[e],T||L(t),f?.(c?t:t[0]??""),c||(B(!1),H(""),P(-1),q.current?.focus())},[T,c,f,W]),be=Ae((e,t)=>{t.stopPropagation();const n=W.filter(t=>t!==e);T||L(n),f?.(c?n:n[0]??"")},[T,c,f,W]),ye=Ae(e=>{e.stopPropagation(),T||L([]),f?.(c?[]:"")},[T,c,f]),ve=Ae(()=>{q.current&&A&&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}}(q.current,g))},[A,g]);function we(){if(i||p)return;B(!0);const e=se.findIndex(e=>W.includes(e.value));P(e>=0?e:0)}Ee(()=>{if(A)return ve(),window.addEventListener("scroll",ve,!0),window.addEventListener("resize",ve),()=>{window.removeEventListener("scroll",ve,!0),window.removeEventListener("resize",ve)}},[A,ve]),Ee(()=>{if(!A)return;const e=e=>{const t=e.target;q.current?.contains(t)||J.current?.contains(t)||(B(!1),H(""))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[A]),Ee(()=>{A&&u&&setTimeout(()=>G.current?.focus(),0)},[A,u]),Ee(()=>{if(A&&!(j<0))if(ce&&ee.current){const e=j*b,t=e+b,n=ee.current;e<n.scrollTop?n.scrollTop=e:t>n.scrollTop+n.clientHeight&&(n.scrollTop=t-n.clientHeight)}else(_.current?.querySelector(`[data-idx="${j}"]`))?.scrollIntoView({block:"nearest"})},[j,A,ce,b]);const ke=Q?k.danger:A?k.primary:k.border,Se=j>=0&&se[j]?`${z}-opt-${se[j].value}`:void 0,Ce=[s&&I,Q&&R].filter(Boolean).join(" ")||void 0,ze=W.map(t=>e.find(e=>e.value===t)).filter(Boolean),Me=A&&O?Xe(/* @__PURE__ */Ye("div",{ref:J,role:"listbox",id:N,"aria-label":l?F(l):"Options","aria-multiselectable":c,style:{position:"absolute",top:O.top,left:O.left,width:O.width,zIndex:9999,backgroundColor:k.surface,border:`1.5px solid ${k.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:O.width,maxHeight:g,display:"flex",flexDirection:"column"},children:[u&&/* @__PURE__ */Ye("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${k.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[/* @__PURE__ */Ke("circle",{cx:"11",cy:"11",r:"8"}),/* @__PURE__ */Ke("path",{d:"M21 21l-4.35-4.35"})]}),/* @__PURE__ */Ke("input",{ref:G,type:"text",value:E,onChange:e=>{H(e.target.value),P(0)},onKeyDown:e=>{switch(e.key){case"Escape":e.preventDefault(),B(!1),H(""),q.current?.focus();break;case"ArrowDown":e.preventDefault(),P(e=>Math.min(e+1,se.length-1));break;case"ArrowUp":e.preventDefault(),P(e=>Math.max(e-1,0));break;case"Home":e.preventDefault(),P(0);break;case"End":e.preventDefault(),P(se.length-1);break;case"Enter":e.preventDefault(),j>=0&&se[j]&&xe(se[j].value)}},placeholder:`${S.search}…`,"aria-label":`${S.search} options`,style:{border:"none",outline:"none",background:"transparent",color:k.text,fontSize:Z.fontSize,fontFamily:"inherit",width:"100%"}})]}),/* @__PURE__ */Ke("div",{ref:e=>{_.current=e,ee.current=e},onScroll:ce?ie:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:g-(u?48:0)},children:ce?/* @__PURE__ */Ye("div",{style:{height:ue,position:"relative"},children:[/* @__PURE__ */Ke("div",{style:{position:"absolute",top:me,left:0,right:0},children:fe.map(e=>{const t=se.indexOf(e),n=t===j,o=W.includes(e.value),r=m?m(e,o):/* @__PURE__ */Ye("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */Ke("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */Ke("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(e.label)})]}),e.description&&/* @__PURE__ */Ke("span",{style:{fontSize:"12px",color:k.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(e.description)})]});/* @__PURE__ */
41
+ return Ye("div",{id:`${z}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":o,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&xe(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&P(t),style:{height:b,boxSizing:"border-box",padding:`0 ${Z.px}`,fontSize:Z.fontSize,fontFamily:"inherit",color:e.disabled?k.textMuted:k.text,backgroundColor:n?`${k.primary}22`:o?`${k.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:[r,o&&!m&&/* @__PURE__ */Ke("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})}),0===ae.length&&/* @__PURE__ */Ke("div",{style:{padding:`${Z.py} ${Z.px}`,fontSize:Z.fontSize,fontFamily:"inherit",color:k.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:p?"Loading…":"No options found"})]}):/* @__PURE__ */Ye(Ue,{children:[Object.entries(ge).map(([e,t])=>/* @__PURE__ */Ye("div",{children:[e&&/* @__PURE__ */Ke("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:k.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:k.surface,zIndex:1,borderBottom:`1px solid ${k.border}`},children:F(e)}),t.map(e=>{const t=se.indexOf(e),n=t===j,o=W.includes(e.value),r=m?m(e,o):/* @__PURE__ */Ye("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */Ke("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */Ke("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(e.label)})]}),e.description&&/* @__PURE__ */Ke("span",{style:{fontSize:"12px",color:k.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(e.description)})]});/* @__PURE__ */
42
+ return Ye("div",{id:`${z}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":o,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&xe(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&P(t),style:{padding:`${Z.py} ${Z.px}`,fontSize:Z.fontSize,fontFamily:"inherit",color:e.disabled?k.textMuted:k.text,backgroundColor:n?`${k.primary}22`:o?`${k.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:[r,o&&!m&&/* @__PURE__ */Ke("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})]},e)),0===ae.length&&/* @__PURE__ */Ke("div",{style:{padding:`${Z.py} ${Z.px}`,fontSize:Z.fontSize,fontFamily:"inherit",color:k.textMuted,textAlign:"center"},children:p?"Loading…":"No options found"})]})})]}),document.body):null,Ne=h&&W.length>0&&!i&&!p;/* @__PURE__ */
43
43
  return Ye("div",{className:le(U("flex flex-col gap-1 w-full"),v),style:w,children:[l&&/* @__PURE__ */Ke("label",{htmlFor:z,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:k.text,userSelect:"none"},children:F(l)}),
44
- /* @__PURE__ */Ke("div",{style:{position:"relative",width:"100%",opacity:i?.55:1},children:/* @__PURE__ */Ye("button",{ref:q,id:z,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":A,"aria-controls":M,"aria-activedescendant":Se,"aria-invalid":Q||void 0,"aria-describedby":Ce,"aria-multiselectable":c,disabled:i,onClick:()=>A?B(!1):we(),onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),A?j>=0&&se[j]&&xe(se[j].value):we();break;case"Escape":e.preventDefault(),B(!1),H("");break;case"ArrowDown":e.preventDefault(),A?P(e=>Math.min(e+1,se.length-1)):we();break;case"ArrowUp":e.preventDefault(),A?P(e=>Math.max(e-1,0)):we();break;case"Home":e.preventDefault(),A&&P(0);break;case"End":e.preventDefault(),A&&P(se.length-1);break;default:1!==e.key.length||e.ctrlKey||e.metaKey||(A||we(),function(e){X.current&&clearTimeout(X.current);const t=K+e.toLowerCase();Y(t);const n=se.findIndex(e=>e.label.toLowerCase().startsWith(t));n>=0&&P(n),X.current=setTimeout(()=>Y(""),800)}(e.key))}},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:c&&W.length>0?`4px ${J.px}`:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",backgroundColor:k.surface,color:W.length>0?k.text:k.textMuted,border:`1.5px solid ${ke}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:i?"not-allowed":"pointer",outline:"none",minHeight:"sm"===r?34:"lg"===r?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[/* @__PURE__ */Ke("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:c&&ze.length>0?ze.map(e=>/* @__PURE__ */Ye("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${J.tagPy} ${J.tagPx}`,fontSize:`calc(${J.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${k.primary}22`,color:k.primary,borderRadius:6,border:`1px solid ${k.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[/* @__PURE__ */Ke("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:F(e.label)}),/* @__PURE__ */Ke("span",{role:"button","aria-label":`Remove ${F(e.label)}`,tabIndex:-1,onClick:t=>be(e.value,t),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:/* @__PURE__ */Ke("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M18 6L6 18M6 6l12 12"})})})]},e.value)):!c&&W.length>0?(()=>{const t=e.find(e=>e.value===W[0]);/* @__PURE__ */
45
- return Ye("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[t?.icon&&/* @__PURE__ */Ke("span",{style:{flexShrink:0,display:"flex"},children:t.icon}),t?F(t.label):""]})})():/* @__PURE__ */Ke("span",{style:{opacity:.6},children:F(C)})}),/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:k.textMuted},children:[p&&/* @__PURE__ */Ke(Ft,{size:J.iconSize,color:k.primary}),Me&&!p&&/* @__PURE__ */Ke("span",{role:"button","aria-label":S.clearSelection,tabIndex:-1,onClick:ye,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:/* @__PURE__ */Ke("svg",{width:J.iconSize,height:J.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M18 6L6 18M6 6l12 12"})})}),
46
- /* @__PURE__ */Ke("svg",{width:J.iconSize,height:J.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:A?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M6 9l6 6 6-6"})})]})]})}),s&&!Q&&/* @__PURE__ */Ke("span",{id:I,style:{fontSize:"12px",color:k.textMuted,fontFamily:"inherit"},children:F(s)}),Q&&d&&/* @__PURE__ */Ye("span",{id:L,role:"alert",style:{fontSize:"12px",color:k.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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(d)]}),Ne]})}jt.displayName="TkxSelect";var Pt={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},Ot=We(({label:e,hint:t,isInvalid:n,errorMessage:o,isIndeterminate:r=!1,size:i="md",colorScheme:a="primary",checked:l,defaultChecked:s,onChange:d,disabled:c,className:u,style:h,id:p,...f},m)=>{const g=N(),x=ge(),b=He(),y=p??b,v=`${y}-hint`,w=`${y}-error`,k=Oe(null),[S,C]=Ve(!1),$=Pt[i],z=n||!!o,M={primary:g.primary,success:g.success,danger:g.danger,warning:g.warning}[a]??g.primary,I=void 0!==l?l:void 0;Ee(()=>{const e=m?.current??k.current;e&&(e.indeterminate=r)},[r,m]);const L=r||(I??!1),R=L?M:g.surface,D=z?g.danger:L?M:g.border,T=A(M),W=S?{outline:`2px solid ${M}`,outlineOffset:"2px"}:{},B=[t&&v,z&&w].filter(Boolean).join(" ")||void 0,E=!x&&L?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};/* @__PURE__ */
44
+ /* @__PURE__ */Ke("div",{style:{position:"relative",width:"100%",opacity:i?.55:1},children:/* @__PURE__ */Ye("button",{ref:q,id:z,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":A,"aria-controls":N,"aria-activedescendant":Se,"aria-invalid":Q||void 0,"aria-describedby":Ce,"aria-multiselectable":c,disabled:i,onClick:()=>A?B(!1):we(),onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),A?j>=0&&se[j]&&xe(se[j].value):we();break;case"Escape":e.preventDefault(),B(!1),H("");break;case"ArrowDown":e.preventDefault(),A?P(e=>Math.min(e+1,se.length-1)):we();break;case"ArrowUp":e.preventDefault(),A?P(e=>Math.max(e-1,0)):we();break;case"Home":e.preventDefault(),A&&P(0);break;case"End":e.preventDefault(),A&&P(se.length-1);break;default:1!==e.key.length||e.ctrlKey||e.metaKey||(A||we(),function(e){X.current&&clearTimeout(X.current);const t=K+e.toLowerCase();Y(t);const n=se.findIndex(e=>e.label.toLowerCase().startsWith(t));n>=0&&P(n),X.current=setTimeout(()=>Y(""),800)}(e.key))}},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:c&&W.length>0?`4px ${Z.px}`:`${Z.py} ${Z.px}`,fontSize:Z.fontSize,fontFamily:"inherit",backgroundColor:k.surface,color:W.length>0?k.text:k.textMuted,border:`1.5px solid ${ke}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:i?"not-allowed":"pointer",outline:"none",minHeight:"sm"===r?34:"lg"===r?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[/* @__PURE__ */Ke("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:c&&ze.length>0?ze.map(e=>/* @__PURE__ */Ye("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${Z.tagPy} ${Z.tagPx}`,fontSize:`calc(${Z.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${k.primary}22`,color:k.primary,borderRadius:6,border:`1px solid ${k.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[/* @__PURE__ */Ke("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:F(e.label)}),/* @__PURE__ */Ke("span",{role:"button","aria-label":`Remove ${F(e.label)}`,tabIndex:-1,onClick:t=>be(e.value,t),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:/* @__PURE__ */Ke("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M18 6L6 18M6 6l12 12"})})})]},e.value)):!c&&W.length>0?(()=>{const t=e.find(e=>e.value===W[0]);/* @__PURE__ */
45
+ return Ye("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[t?.icon&&/* @__PURE__ */Ke("span",{style:{flexShrink:0,display:"flex"},children:t.icon}),t?F(t.label):""]})})():/* @__PURE__ */Ke("span",{style:{opacity:.6},children:F(C)})}),/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:k.textMuted},children:[p&&/* @__PURE__ */Ke(Ft,{size:Z.iconSize,color:k.primary}),Ne&&!p&&/* @__PURE__ */Ke("span",{role:"button","aria-label":S.clearSelection,tabIndex:-1,onClick:ye,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:/* @__PURE__ */Ke("svg",{width:Z.iconSize,height:Z.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M18 6L6 18M6 6l12 12"})})}),
46
+ /* @__PURE__ */Ke("svg",{width:Z.iconSize,height:Z.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:A?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M6 9l6 6 6-6"})})]})]})}),s&&!Q&&/* @__PURE__ */Ke("span",{id:I,style:{fontSize:"12px",color:k.textMuted,fontFamily:"inherit"},children:F(s)}),Q&&d&&/* @__PURE__ */Ye("span",{id:R,role:"alert",style:{fontSize:"12px",color:k.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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(d)]}),Me]})}jt.displayName="TkxSelect";var Pt={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},Ot=We(({label:e,hint:t,isInvalid:n,errorMessage:o,isIndeterminate:r=!1,size:i="md",colorScheme:a="primary",checked:l,defaultChecked:s,onChange:d,disabled:c,className:u,style:h,id:p,...f},m)=>{const g=M(),x=ge(),b=He(),y=p??b,v=`${y}-hint`,w=`${y}-error`,k=Oe(null),[S,C]=Ve(!1),$=Pt[i],z=n||!!o,N={primary:g.primary,success:g.success,danger:g.danger,warning:g.warning}[a]??g.primary,I=void 0!==l?l:void 0;Ee(()=>{const e=m?.current??k.current;e&&(e.indeterminate=r)},[r,m]);const R=r||(I??!1),T=R?N:g.surface,D=z?g.danger:R?N:g.border,L=A(N),W=S?{outline:`2px solid ${N}`,outlineOffset:"2px"}:{},B=[t&&v,z&&w].filter(Boolean).join(" ")||void 0,E=!x&&R?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};/* @__PURE__ */
47
47
  return Ye("div",{className:le(U("flex flex-col gap-1"),u),style:{opacity:c?.5:1,...h},children:[
48
48
  /* @__PURE__ */Ke("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 "}),
49
49
  /* @__PURE__ */Ye("label",{htmlFor:y,className:U("flex items-center gap-2 select-none"),style:{cursor:c?"not-allowed":"pointer",fontFamily:"inherit"},children:[
50
50
  /* @__PURE__ */Ke("input",{ref:e=>{k.current=e,"function"==typeof m?m(e):m&&(m.current=e)},id:y,type:"checkbox",checked:l,defaultChecked:s,onChange:d,disabled:c,"aria-invalid":z,"aria-describedby":B,onFocus:e=>{e.target.matches(":focus-visible")&&C(!0)},onBlur:()=>C(!1),className:U("sr-only"),...f}),
51
- /* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{width:$.box,height:$.box,minWidth:$.box,borderRadius:"4px",border:`2px solid ${D}`,backgroundColor:R,display:"flex",alignItems:"center",justifyContent:"center",transition:x?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...W},children:r?/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{display:"block",width:.5*$.box,height:2,backgroundColor:T,borderRadius:"1px",...E}}):L?/* @__PURE__ */Ke("svg",{width:.6*$.box,height:.6*$.box,viewBox:"0 0 24 24",fill:"none",stroke:T,strokeWidth:$.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:E,children:/* @__PURE__ */Ke("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&/* @__PURE__ */Ke("span",{style:{fontSize:$.fontSize,color:g.text,lineHeight:1.4},children:"string"==typeof e?F(e):e})]}),t&&!z&&/* @__PURE__ */Ke("span",{id:v,className:U("text-xs ml-7"),style:{color:g.textMuted,marginLeft:$.box+8},children:F(t)}),z&&o&&/* @__PURE__ */Ye("span",{id:w,role:"alert",className:U("text-xs flex items-center gap-1"),style:{color:g.danger,marginLeft:$.box+8},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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(o)]})]})});Ot.displayName="TkxCheckbox";var Vt=De(null),Ut={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},Kt=We(({label:e,hint:t,size:n="md",colorScheme:o="primary",value:r,checked:i,onChange:a,disabled:l,name:s,className:d,style:c,id:u,...h},p)=>{const f=N(),m=ge(),g=He(),x=u??g,b=Be(Vt),y=b?b.value===String(r??""):i??!1,v=l??b?.isDisabled??!1,w=s??b?.name??"",k=Ut[n],S={primary:f.primary,success:f.success,danger:f.danger}[o]??f.primary;A(S);const C=y?S:f.border,$=f.surface;/* @__PURE__ */
51
+ /* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{width:$.box,height:$.box,minWidth:$.box,borderRadius:"4px",border:`2px solid ${D}`,backgroundColor:T,display:"flex",alignItems:"center",justifyContent:"center",transition:x?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...W},children:r?/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{display:"block",width:.5*$.box,height:2,backgroundColor:L,borderRadius:"1px",...E}}):R?/* @__PURE__ */Ke("svg",{width:.6*$.box,height:.6*$.box,viewBox:"0 0 24 24",fill:"none",stroke:L,strokeWidth:$.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:E,children:/* @__PURE__ */Ke("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&/* @__PURE__ */Ke("span",{style:{fontSize:$.fontSize,color:g.text,lineHeight:1.4},children:"string"==typeof e?F(e):e})]}),t&&!z&&/* @__PURE__ */Ke("span",{id:v,className:U("text-xs ml-7"),style:{color:g.textMuted,marginLeft:$.box+8},children:F(t)}),z&&o&&/* @__PURE__ */Ye("span",{id:w,role:"alert",className:U("text-xs flex items-center gap-1"),style:{color:g.danger,marginLeft:$.box+8},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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(o)]})]})});Ot.displayName="TkxCheckbox";var Vt=De(null),Ut={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},Kt=We(({label:e,hint:t,size:n="md",colorScheme:o="primary",value:r,checked:i,onChange:a,disabled:l,name:s,className:d,style:c,id:u,...h},p)=>{const f=M(),m=ge(),g=He(),x=u??g,b=Be(Vt),y=b?b.value===String(r??""):i??!1,v=l??b?.isDisabled??!1,w=s??b?.name??"",k=Ut[n],S={primary:f.primary,success:f.success,danger:f.danger}[o]??f.primary;A(S);const C=y?S:f.border,$=f.surface;/* @__PURE__ */
52
52
  return Ye("div",{className:le(U("flex flex-col gap-0.5"),d),style:{opacity:v?.5:1,...c},children:[
53
53
  /* @__PURE__ */Ke("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 "}),
54
54
  /* @__PURE__ */Ye("label",{htmlFor:x,className:U("flex items-center gap-2 select-none"),style:{cursor:v?"not-allowed":"pointer",fontFamily:"inherit"},children:[
55
55
  /* @__PURE__ */Ke("input",{ref:p,id:x,type:"radio",name:w,value:r,checked:y,onChange:()=>{v||(b?b.onChange(String(r??"")):a?.({target:{value:String(r??"")}}))},disabled:v,"aria-invalid":b?.isInvalid,className:U("sr-only"),...h}),
56
- /* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{position:"relative",width:k.outer,height:k.outer,minWidth:k.outer,borderRadius:"50%",border:`2px solid ${C}`,backgroundColor:$,display:"inline-block",boxSizing:"border-box",transition:m?"none":"border-color 120ms"},children:y&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:k.inner,height:k.inner,borderRadius:"50%",backgroundColor:S,transform:"translate(-50%, -50%)",transformOrigin:"center",...m?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&/* @__PURE__ */Ke("span",{style:{fontSize:k.fontSize,color:f.text,lineHeight:1.4},children:"string"==typeof e?F(e):e})]}),t&&/* @__PURE__ */Ke("span",{className:U("text-xs"),style:{color:f.textMuted,marginLeft:k.outer+8},children:F(t)})]})});function Yt({name:e,value:t,defaultValue:n="",onChange:o,label:r,orientation:i="vertical",isDisabled:a=!1,isInvalid:l=!1,errorMessage:s,children:d}){const c=N(),u=`${He()}-error`,[h,p]=Ve(n),f=void 0!==t,m=f?t:h,g=l||!!s;/* @__PURE__ */
56
+ /* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{position:"relative",width:k.outer,height:k.outer,minWidth:k.outer,borderRadius:"50%",border:`2px solid ${C}`,backgroundColor:$,display:"inline-block",boxSizing:"border-box",transition:m?"none":"border-color 120ms"},children:y&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:k.inner,height:k.inner,borderRadius:"50%",backgroundColor:S,transform:"translate(-50%, -50%)",transformOrigin:"center",...m?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&/* @__PURE__ */Ke("span",{style:{fontSize:k.fontSize,color:f.text,lineHeight:1.4},children:"string"==typeof e?F(e):e})]}),t&&/* @__PURE__ */Ke("span",{className:U("text-xs"),style:{color:f.textMuted,marginLeft:k.outer+8},children:F(t)})]})});function Yt({name:e,value:t,defaultValue:n="",onChange:o,label:r,orientation:i="vertical",isDisabled:a=!1,isInvalid:l=!1,errorMessage:s,children:d}){const c=M(),u=`${He()}-error`,[h,p]=Ve(n),f=void 0!==t,m=f?t:h,g=l||!!s;/* @__PURE__ */
57
57
  return Ke(Vt.Provider,{value:{name:e,value:m,onChange:e=>{f||p(e),o?.(e)},isDisabled:a,isInvalid:l},children:/* @__PURE__ */Ye("div",{role:"radiogroup","aria-label":r?F(r):void 0,"aria-describedby":g?u:void 0,"aria-invalid":g,children:[r&&/* @__PURE__ */Ke("div",{className:U("text-sm font-medium font-sans mb-2"),style:{color:c.text},children:F(r)}),
58
- /* @__PURE__ */Ke("div",{className:U("horizontal"===i?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:d}),g&&s&&/* @__PURE__ */Ye("span",{id:u,role:"alert",className:U("text-xs flex items-center gap-1 mt-1"),style:{color:c.danger},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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(s)]})]})})}Kt.displayName="TkxRadio";var Xt=[],qt=[],Gt=/* @__PURE__ */new Set,_t=/* @__PURE__ */new Map;function Zt(){const e=[...qt];Gt.forEach(t=>t(e))}function Jt(e,t){0!==t&&_t.set(e,setTimeout(()=>Qt(e),t))}function Qt(e){clearTimeout(_t.get(e)),_t.delete(e);const t=qt.some(t=>t.id===e);if(qt=qt.filter(t=>t.id!==e),Xt=Xt.filter(t=>t.id!==e),t&&Xt.length>0&&qt.length<5){const e=Xt.shift();qt=[...qt,e],Jt(e.id,e.duration??4e3)}Zt()}function en(){return{toast:Ae(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 qt.length<5?(qt=[...qt,n],Jt(t,n.duration)):Xt=[...Xt,n],Zt(),t}(e),[]),dismiss:Ae(e=>Qt(e),[]),dismissAll:Ae(()=>(_t.forEach(e=>clearTimeout(e)),_t.clear(),qt=[],Xt=[],void Zt()),[])}}var tn={default:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})})},nn={"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 on(e,t){return t?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function rn({toast:e,position:t,onDismiss:n,reduced:o}){const r=N(),i=$e(),a=He(),l={default:r.textMuted,success:r.success,danger:r.danger,warning:r.warning,info:r.info},s=e.variant??"default",d=l[s],c="danger"===s,u=e.title?F(e.title):void 0,h=e.description?F(e.description):void 0;/* @__PURE__ */
58
+ /* @__PURE__ */Ke("div",{className:U("horizontal"===i?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:d}),g&&s&&/* @__PURE__ */Ye("span",{id:u,role:"alert",className:U("text-xs flex items-center gap-1 mt-1"),style:{color:c.danger},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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(s)]})]})})}Kt.displayName="TkxRadio";var Xt=[],qt=[],Gt=/* @__PURE__ */new Set,Jt=/* @__PURE__ */new Map;function _t(){const e=[...qt];Gt.forEach(t=>t(e))}function Zt(e,t){0!==t&&Jt.set(e,setTimeout(()=>Qt(e),t))}function Qt(e){clearTimeout(Jt.get(e)),Jt.delete(e);const t=qt.some(t=>t.id===e);if(qt=qt.filter(t=>t.id!==e),Xt=Xt.filter(t=>t.id!==e),t&&Xt.length>0&&qt.length<5){const e=Xt.shift();qt=[...qt,e],Zt(e.id,e.duration??4e3)}_t()}function en(){return{toast:Ae(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 qt.length<5?(qt=[...qt,n],Zt(t,n.duration)):Xt=[...Xt,n],_t(),t}(e),[]),dismiss:Ae(e=>Qt(e),[]),dismissAll:Ae(()=>(Jt.forEach(e=>clearTimeout(e)),Jt.clear(),qt=[],Xt=[],void _t()),[])}}var tn={default:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})})},nn={"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 on(e,t){return t?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function rn({toast:e,position:t,onDismiss:n,reduced:o}){const r=M(),i=$e(),a=He(),l={default:r.textMuted,success:r.success,danger:r.danger,warning:r.warning,info:r.info},s=e.variant??"default",d=l[s],c="danger"===s,u=e.title?F(e.title):void 0,h=e.description?F(e.description):void 0;/* @__PURE__ */
59
59
  return Ye("div",{role:c?"alert":"status","aria-live":c?"assertive":"polite","aria-atomic":"true","aria-labelledby":u?a:void 0,className:U("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:r.surface,border:`1px solid ${d}55`,boxShadow:`0 8px 24px ${r.bg}cc`,color:r.text,...on(t,o)},children:[
60
60
  /* @__PURE__ */Ke("span",{className:U("shrink-0 mt-[2px]"),style:{color:d},children:tn[s]}),
61
61
  /* @__PURE__ */Ye("div",{className:U("flex-1 min-w-0"),children:[u&&/* @__PURE__ */Ke("p",{id:a,className:U("m-0 font-semibold text-sm leading-snug"),children:u}),h&&/* @__PURE__ */Ke("p",{className:U("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:r.textMuted},children:h}),e.action&&/* @__PURE__ */Ke("button",{onClick:()=>{e.action.onClick(),n(e.id)},className:U("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:d},children:F(e.action.label)})]}),
62
62
  /* @__PURE__ */Ke("button",{"aria-label":i.close,onClick:()=>n(e.id),className:U("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:r.textMuted},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function an({position:e="top-right",children:t}){const[n,o]=Ve([...qt]),r=ge(),i=$e();Ee(()=>{o([...qt]);const e=e=>o([...e]);return Gt.add(e),()=>{Gt.delete(e)}},[]);const a=e.startsWith("bottom"),l=nn[e],s=Oe(!1);if(Ee(()=>{if(!s.current&&"undefined"!=typeof document&&(s.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)/* @__PURE__ */return Ke(Ue,{children:t});const d=a?[...n].reverse():n;/* @__PURE__ */
63
- return Ye(Ue,{children:[t,Xe(/* @__PURE__ */Ke("div",{"aria-label":i.notifications??"Notifications",className:U("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:l,children:d.map(t=>/* @__PURE__ */Ke("div",{className:U("pointer-events-auto"),children:/* @__PURE__ */Ke(rn,{toast:t,position:e,onDismiss:Qt,reduced:r})},t.id))}),document.body)]})}var ln={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 sn({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?/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("polyline",{points:"6 9 12 15 18 9"})}):/* @__PURE__ */Ye("svg","plus"===n?{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:[/* @__PURE__ */Ke("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ke("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}:{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:[/* @__PURE__ */Ke("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),/* @__PURE__ */Ke("polyline",{points:"12 5 19 12 12 19"})]})}function dn({isOpen:e,reduced:t,children:n,id:o,triggerId:r}){const i=Oe(null),a=Oe(null),l=Oe(e),s=Oe(!1);return Ee(()=>{const t=i.current;t&&(e?(t.style.height="auto",t.style.overflow="visible"):(t.style.height="0px",t.style.overflow="hidden"))},[]),Ee(()=>{if(l.current===e)return;l.current=e;const n=i.current,o=a.current;if(n&&o){if(t)return n.style.height=e?"auto":"0px",void(n.style.overflow=e?"visible":"hidden");if(s.current){const e=n.getBoundingClientRect().height;n.style.transition="none",n.style.height=`${e}px`,n.offsetHeight}s.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]),/* @__PURE__ */Ke("div",{ref:i,id:o,role:"region","aria-labelledby":r,onTransitionEnd:t=>{if("height"!==t.propertyName)return;s.current=!1;const n=i.current;n&&(e?(n.style.height="auto",n.style.overflow="visible"):n.style.overflow="hidden")},style:{willChange:"height"},children:/* @__PURE__ */Ke("div",{ref:a,children:n})})}function cn({items:e,multiple:t=!1,defaultOpen:n,value:o,onChange:r,variant:i="default",size:a="md",iconPosition:l="right",iconStyle:s="chevron",flush:d=!1,className:c,style:u}){const h=N(),p=ge(),f=He(),m=void 0!==o,g=e=>e?Array.isArray(e)?new Set(e):new Set([e]):/* @__PURE__ */new Set,[x,b]=Ve(()=>g(n)),y=m?g(o):x,v=Ae((e,n)=>{if(n)return;let i;if(!m)return void b(n=>{i=new Set(n),i.has(e)?i.delete(e):(t||i.clear(),i.add(e));const o=[...i];return r?.(t?o:o[0]??""),i});{const n=g(o);i=new Set(n),i.has(e)?i.delete(e):(t||i.clear(),i.add(e))}const a=[...i];r?.(t?a:a[0]??"")},[t,r,m,o]),w=ln[a],k=(e,t,n)=>{if(d)return{};switch(i){case"default":case"bordered":return{borderBottom:n?"none":`1px solid ${h.border}`};case"separated":return{border:`1px solid ${h.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{}}},S="separated"===i;/* @__PURE__ */
63
+ return Ye(Ue,{children:[t,Xe(/* @__PURE__ */Ke("div",{"aria-label":i.notifications??"Notifications",className:U("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:l,children:d.map(t=>/* @__PURE__ */Ke("div",{className:U("pointer-events-auto"),children:/* @__PURE__ */Ke(rn,{toast:t,position:e,onDismiss:Qt,reduced:r})},t.id))}),document.body)]})}var ln={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 sn({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?/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("polyline",{points:"6 9 12 15 18 9"})}):/* @__PURE__ */Ye("svg","plus"===n?{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:[/* @__PURE__ */Ke("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ke("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}:{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:[/* @__PURE__ */Ke("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),/* @__PURE__ */Ke("polyline",{points:"12 5 19 12 12 19"})]})}function dn({isOpen:e,reduced:t,children:n,id:o,triggerId:r}){const i=Oe(null),a=Oe(null),l=Oe(e),s=Oe(!1);return Ee(()=>{const t=i.current;t&&(e?(t.style.height="auto",t.style.overflow="visible"):(t.style.height="0px",t.style.overflow="hidden"))},[]),Ee(()=>{if(l.current===e)return;l.current=e;const n=i.current,o=a.current;if(n&&o){if(t)return n.style.height=e?"auto":"0px",void(n.style.overflow=e?"visible":"hidden");if(s.current){const e=n.getBoundingClientRect().height;n.style.transition="none",n.style.height=`${e}px`,n.offsetHeight}s.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]),/* @__PURE__ */Ke("div",{ref:i,id:o,role:"region","aria-labelledby":r,onTransitionEnd:t=>{if("height"!==t.propertyName)return;s.current=!1;const n=i.current;n&&(e?(n.style.height="auto",n.style.overflow="visible"):n.style.overflow="hidden")},style:{willChange:"height"},children:/* @__PURE__ */Ke("div",{ref:a,children:n})})}function cn({items:e,multiple:t=!1,defaultOpen:n,value:o,onChange:r,variant:i="default",size:a="md",iconPosition:l="right",iconStyle:s="chevron",flush:d=!1,className:c,style:u}){const h=M(),p=ge(),f=He(),m=void 0!==o,g=e=>e?Array.isArray(e)?new Set(e):new Set([e]):/* @__PURE__ */new Set,[x,b]=Ve(()=>g(n)),y=m?g(o):x,v=Ae((e,n)=>{if(n)return;let i;if(!m)return void b(n=>{i=new Set(n),i.has(e)?i.delete(e):(t||i.clear(),i.add(e));const o=[...i];return r?.(t?o:o[0]??""),i});{const n=g(o);i=new Set(n),i.has(e)?i.delete(e):(t||i.clear(),i.add(e))}const a=[...i];r?.(t?a:a[0]??"")},[t,r,m,o]),w=ln[a],k=(e,t,n)=>{if(d)return{};switch(i){case"default":case"bordered":return{borderBottom:n?"none":`1px solid ${h.border}`};case"separated":return{border:`1px solid ${h.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{}}},S="separated"===i;/* @__PURE__ */
64
64
  return Ke("div",{className:U(c??""),style:{...d?{}:"bordered"===i?{border:`1px solid ${h.border}`,borderRadius:"10px",overflow:"hidden"}:{},display:S?"flex":void 0,flexDirection:S?"column":void 0,gap:S?"8px":void 0,...u},children:e.map((t,n)=>{const o=y.has(t.id),r=n===e.length-1,a=`${f}-trigger-${t.id}`,d=`${f}-panel-${t.id}`;/* @__PURE__ */
65
65
  return Ye("div",{className:t.className,style:k(0,0,r),children:[/* @__PURE__ */Ye("button",{id:a,type:"button",role:"button","aria-expanded":o,"aria-controls":d,disabled:t.disabled,onClick:()=>v(t.id,t.disabled),style:{width:"100%",display:"flex",alignItems:t.subtitle?"flex-start":"center",gap:"8px",padding:w.triggerPadding,border:"none",background:"transparent",cursor:t.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:w.fontSize,fontWeight:500,color:t.disabled?h.textMuted:h.text,opacity:t.disabled?.5:1,transition:p?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:e=>{t.disabled||(e.currentTarget.style.backgroundColor=(e=>"ghost"===i||"flush"===i?e?`${h.primary}10`:`${h.surfaceAlt}80`:e?`${h.primary}0d`:`${h.surfaceAlt}60`)(o))},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=o?`${h.primary}0d`:"transparent"},onFocus:e=>{t.disabled||(e.currentTarget.style.outline=`2px solid ${h.primary}`,e.currentTarget.style.outlineOffset="2px")},onBlur:e=>{e.currentTarget.style.outline="none"},children:[t.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:h.primary,marginTop:t.subtitle?"1px":void 0},children:t.icon}),"left"===l&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?h.primary:h.textMuted,marginTop:t.subtitle?"1px":void 0},children:/* @__PURE__ */Ke(sn,{open:o,reduced:p,iconStyle:s,size:w.iconSize,color:o?h.primary:h.textMuted})}),
66
66
  /* @__PURE__ */Ye("span",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ke("span",{style:{display:"block",lineHeight:1.4},children:t.title}),t.subtitle&&/* @__PURE__ */Ke("span",{style:{display:"block",fontSize:w.subtitleSize,color:h.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:t.subtitle})]}),t.badge&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:t.badge}),"right"===l&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?h.primary:h.textMuted,marginTop:t.subtitle?"1px":void 0},children:/* @__PURE__ */Ke(sn,{open:o,reduced:p,iconStyle:s,size:w.iconSize,color:o?h.primary:h.textMuted})})]}),/* @__PURE__ */Ke(dn,{isOpen:o,reduced:p,id:d,triggerId:a,children:/* @__PURE__ */Ke("div",{style:{padding:w.contentPadding,fontSize:w.fontSize,lineHeight:1.6,color:h.textMuted,fontFamily:"inherit"},children:t.content})})]},t.id)})})}cn.displayName="TkxAccordion";var un={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"},hn=0;function pn(){--hn<=0&&(hn=0,document.body.style.overflow="")}function fn(){/* @__PURE__ */
67
- return Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function mn({isOpen:e,onClose:t,placement:n="right",size:o="md",title:r,children:i,footer:a,closeOnOverlayClick:l=!0,closeOnEsc:s=!0}){const d=N(),c=ge(),u=He(),h=fe(e);if(xe(t,s&&e),Ee(()=>{if(e){if(1===++hn&&(document.body.style.overflow="hidden"),he())try{window.dispatchEvent(new CustomEvent("tkx:framed-drawer",{detail:{placement:n,at:Date.now()}}))}catch{}}else pn();return()=>{e&&pn()}},[e,n]),"undefined"==typeof document)return null;const p=function(e,t){const n=un[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%"}}(n,o),f=function(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}(n),m=c?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",g="string"==typeof r?F(r):r;return Xe(/* @__PURE__ */Ye("div",{role:"presentation",className:U("fixed inset-0 z-[9000]"),style:{pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden"},children:[/* @__PURE__ */Ke("div",{"aria-hidden":"true",onClick:l?t:void 0,className:U("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:c?"none":"opacity 280ms ease",cursor:l?"pointer":"default"}}),/* @__PURE__ */Ye("div",{ref:h,role:"dialog","aria-modal":"true","aria-labelledby":r?u:void 0,className:U("absolute flex flex-col font-sans"),style:{...p,backgroundColor:d.surface,borderLeft:"right"===n?`1px solid ${d.border}`:void 0,borderRight:"left"===n?`1px solid ${d.border}`:void 0,borderTop:"bottom"===n?`1px solid ${d.border}`:void 0,borderBottom:"top"===n?`1px solid ${d.border}`:void 0,boxShadow:`0 20px 60px ${d.bg}99`,transform:e?"translate(0,0)":f,opacity:e?1:0,transition:m,willChange:"transform"},children:[void 0!==r&&/* @__PURE__ */Ye("div",{className:U("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${d.border}`},children:[/* @__PURE__ */Ke("h2",{id:u,className:U("m-0 text-base font-semibold leading-snug"),style:{color:d.text},children:g}),/* @__PURE__ */Ke("button",{onClick:t,"aria-label":"Close drawer",className:U("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:d.textMuted},children:/* @__PURE__ */Ke(fn,{})})]}),void 0===r&&/* @__PURE__ */Ke("div",{className:U("flex justify-end px-3 pt-3 shrink-0"),children:/* @__PURE__ */Ke("button",{onClick:t,"aria-label":"Close drawer",className:U("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:d.textMuted},children:/* @__PURE__ */Ke(fn,{})})}),
67
+ return Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function mn({isOpen:e,onClose:t,placement:n="right",size:o="md",title:r,children:i,footer:a,closeOnOverlayClick:l=!0,closeOnEsc:s=!0}){const d=M(),c=ge(),u=He(),h=fe(e);if(xe(t,s&&e),Ee(()=>{if(e){if(1===++hn&&(document.body.style.overflow="hidden"),he())try{window.dispatchEvent(new CustomEvent("tkx:framed-drawer",{detail:{placement:n,at:Date.now()}}))}catch{}}else pn();return()=>{e&&pn()}},[e,n]),"undefined"==typeof document)return null;const p=function(e,t){const n=un[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%"}}(n,o),f=function(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}(n),m=c?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",g="string"==typeof r?F(r):r;return Xe(/* @__PURE__ */Ye("div",{role:"presentation",className:U("fixed inset-0 z-[9000]"),style:{pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden"},children:[/* @__PURE__ */Ke("div",{"aria-hidden":"true",onClick:l?t:void 0,className:U("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:c?"none":"opacity 280ms ease",cursor:l?"pointer":"default"}}),/* @__PURE__ */Ye("div",{ref:h,role:"dialog","aria-modal":"true","aria-labelledby":r?u:void 0,className:U("absolute flex flex-col font-sans"),style:{...p,backgroundColor:d.surface,borderLeft:"right"===n?`1px solid ${d.border}`:void 0,borderRight:"left"===n?`1px solid ${d.border}`:void 0,borderTop:"bottom"===n?`1px solid ${d.border}`:void 0,borderBottom:"top"===n?`1px solid ${d.border}`:void 0,boxShadow:`0 20px 60px ${d.bg}99`,transform:e?"translate(0,0)":f,opacity:e?1:0,transition:m,willChange:"transform"},children:[void 0!==r&&/* @__PURE__ */Ye("div",{className:U("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${d.border}`},children:[/* @__PURE__ */Ke("h2",{id:u,className:U("m-0 text-base font-semibold leading-snug"),style:{color:d.text},children:g}),/* @__PURE__ */Ke("button",{onClick:t,"aria-label":"Close drawer",className:U("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:d.textMuted},children:/* @__PURE__ */Ke(fn,{})})]}),void 0===r&&/* @__PURE__ */Ke("div",{className:U("flex justify-end px-3 pt-3 shrink-0"),children:/* @__PURE__ */Ke("button",{onClick:t,"aria-label":"Close drawer",className:U("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:d.textMuted},children:/* @__PURE__ */Ke(fn,{})})}),
68
68
  /* @__PURE__ */Ke("div",{className:U("flex-1 overflow-y-auto px-5 py-4"),style:{color:d.text},children:i}),a&&/* @__PURE__ */Ke("div",{className:U("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${d.border}`},children:a})]})]}),document.body)}var gn=["Su","Mo","Tu","We","Th","Fr","Sa"],xn=["January","February","March","April","May","June","July","August","September","October","November","December"],bn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function yn(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function vn(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function wn(e,t,n){return!(!t||!yn(e,t))||!(!n||!yn(e,n))}function kn(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"),a=bn[e.getMonth()],l=xn[e.getMonth()],s=e.getDate(),d=String(s).padStart(2,"0");return n.replace(/YYYY/g,t).replace(/YY/g,o).replace(/MMMM/g,l).replace(/MMM/g,a).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 Sn(e,t){return new Date(e,t+1,0).getDate()}function Cn(e){return 10*Math.floor(e/10)}function $n({values:e,selected:t,onSelect:n,label:o,theme:r,format:i}){const a=Oe([]),l=Oe(null);Ee(()=>{const e=a.current[t];e&&l.current&&e.scrollIntoView({block:"nearest"})},[t]);const s=i??(e=>String(e).padStart(2,"0"));/* @__PURE__ */
69
69
  return Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[/* @__PURE__ */Ke("div",{style:{fontSize:"11px",fontWeight:600,color:r.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:o}),/* @__PURE__ */Ke("div",{ref:l,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;/* @__PURE__ */
70
70
  return Ke("button",{ref:t=>{a.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:s(e)},e)})})]})}function zn({year:e,month:t,today:n,mode:o,selectedDate:r,selectedRange:i,multiDates:a,hoverDate:l,focusedDate:s,isDateDisabled:d,onSelectDate:c,onHoverDate:u,onSetFocused:h,theme:p,locale:f}){const m=function(e,t){const n=new Date(e,t,1).getDay(),o=Sn(e,t),r=[],i=Sn(e,t-1);for(let l=n-1;l>=0;l--)r.push(new Date(e,t-1,i-l));for(let l=1;l<=o;l++)r.push(new Date(e,t,l));let a=1;for(;r.length<42;)r.push(new Date(e,t+1,a++));return r}(e,t);/* @__PURE__ */
71
- return Ye("div",{children:[/* @__PURE__ */Ke("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:gn.map(e=>/* @__PURE__ */Ke("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:p.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),/* @__PURE__ */Ke("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:m.map((e,m)=>{const g=e.getMonth()===t,x=yn(e,n),b=0===e.getDay()||6===e.getDay(),y=d(e),v="single"===o&&null!=r&&yn(e,r),w="multiple"===o&&a.some(t=>yn(t,e)),k="range"===o&&wn(e,i[0],null),S="range"===o&&wn(e,null,i[1]),C=k||S,$="range"===o&&i[0]&&!i[1]&&l?l:i[1],z="range"===o&&function(e,t,n){if(!t||!n)return!1;const o=vn(e).getTime(),r=vn(t).getTime(),i=vn(n).getTime();return o>Math.min(r,i)&&o<Math.max(r,i)}(e,i[0],$),N="range"===o&&i[0]&&!i[1]&&l&&yn(e,l),M=v||w||C,I=null!=s&&yn(e,s);let L="transparent",R=g?b?`${p.text}cc`:p.text:`${p.textMuted}60`,D="none",T=400;return M||N?(L=p.primary,R=p.bg,T=600):z&&(L=`${p.primary}18`),x&&!M&&(D=`2px solid ${p.primary}`,T=600),y&&(R=`${p.textMuted}50`),I&&!M&&(D=`2px solid ${p.secondary}`),/* @__PURE__ */Ke("button",{type:"button","aria-label":e.toLocaleDateString(f,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":M,"aria-disabled":y,disabled:y,onClick:()=>!y&&c(e),onMouseEnter:()=>u(e),onMouseLeave:()=>u(null),onFocus:()=>h(e),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:L,color:R,border:D,fontSize:"13px",fontWeight:T,cursor:y?"not-allowed":"pointer",opacity:y?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:y?"line-through":"none",transition:"background-color 80ms ease"},children:e.getDate()},m)})})]})}function Nn({value:e,onChange:t,rangeValue:n,onRangeChange:o,multiValue:r,onMultiChange:i,mode:a="single",minDate:l,maxDate:s,disabledDates:d,locale:c="en-US",dateFormat:u,showTime:h=!1,timeValue:p,onTimeChange:f,showPresets:m=!1,customPresets:g,label:x,placeholder:b="MM/DD/YYYY",hint:y,isDisabled:v=!1,isInvalid:w=!1,errorMessage:k,numberOfMonths:S=1,id:C,className:$,style:z}){const M=N(),I=$e(),L=He(),R=C??L,D=ge(),T=vn(/* @__PURE__ */new Date),W=void 0!==e,[A,B]=Ve(null),E=W?e??null:A,H=void 0!==n,[j,P]=Ve([null,null]),O=H?n:j,V=void 0!==r,[U,K]=Ve([]),Y=V?r:U,[X,q]=Ve("start"),G="range"===a||"single"===a&&h,[_,Z]=Ve([null,null]),[J,Q]=Ve(null),ee=E??O[0]??T,[te,ne]=Ve(ee.getFullYear()),[oe,re]=Ve(ee.getMonth()),[ie,ae]=Ve("day"),[le,se]=Ve({h:0,m:0}),de=p??le,[ce,ue]=Ve(!1),[he,pe]=Ve(()=>{if("single"===a)return kn(E,c,u);if("range"===a){const[e,t]=O;if(e&&t)return`${kn(e,c,u)} – ${kn(t,c,u)}`}return""}),[fe,me]=Ve(null),[xe,be]=Ve(null),[ye,ve]=Ve({top:0,left:0,flipUp:!1}),[,we]=Pe(e=>e+1,0),ke=Oe(null),Se=Oe(null),Ce=Oe(null),ze=m?420:h?480:360;Ee(()=>{if("single"===a)pe(kn(E,c,u));else if("range"===a){const[e,t]=O;pe(e&&t?`${kn(e,c,u)} – ${kn(t,c,u)}`:e?kn(e,c,u):"")}else"multiple"===a&&pe(Y.length>0?`${Y.length} date${1!==Y.length?"s":""} selected`:"")},[E,O,Y,a,c,u]);const Ne=Ae(()=>{ke.current&&ve(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight,r=window.scrollY,i=window.scrollX,a=o-n.bottom<t+8&&n.top>t+8;return{top:a?r+n.top-t-4:r+n.bottom+4,left:i+n.left,flipUp:a}}(ke.current,ze))},[ze]);Ee(()=>{if(ce)return Ne(),window.addEventListener("scroll",Ne,!0),window.addEventListener("resize",Ne),()=>{window.removeEventListener("scroll",Ne,!0),window.removeEventListener("resize",Ne)}},[ce,Ne]),Ee(()=>{if(!ce)return;const e=e=>{ke.current?.contains(e.target)||Se.current?.contains(e.target)||ue(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[ce]),Ee(()=>{if(!ce)return;const e=e=>{"Escape"===e.key&&(ue(!1),Ce.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[ce]);const Me=Ae(e=>!!(l&&vn(e)<vn(l))||!!(s&&vn(e)>vn(s))||!!d&&("function"==typeof d?d(e):d.some(t=>yn(t,e))),[l,s,d]),Ie=Ae(e=>{if(!Me(e)){if("single"===a)G?Q(e):(W||B(e),t?.(e),pe(kn(e,c,u)),ue(!1));else if("range"===a)if("start"===X){const t=[e,null];Z(t),H||P(t),o?.(t),q("end")}else{const t=_[0]??O[0],n=t&&e<t?[e,t]:[t,e];Z(n),G?q("start"):(H||P(n),o?.(n),q("start"),ue(!1))}else if("multiple"===a){const t=Y.some(t=>yn(t,e))?Y.filter(t=>!yn(t,e)):[...Y,e];V||K(t),i?.(t)}we()}},[a,Me,W,H,V,t,o,i,X,_,O,Y,G,c]),Le=Ae(()=>{if("single"===a){const e=J??E;W||B(e),t?.(e)}else"range"===a&&(H||P(_),o?.(_));ue(!1),q("start")},[a,J,_,E,W,H,t,o]),Re=Ae(()=>{Q(null),Z([null,null]),q("start"),ue(!1)},[]),De=g??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=vn(/* @__PURE__ */new Date);return[e,e]}},{label:t.yesterday,getValue:()=>{const e=vn(/* @__PURE__ */new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:t.last7,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-6),[t,e]}},{label:t.last30,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-29),[t,e]}},{label:t.last90,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-89),[t,e]}},{label:t.thisWeek,getValue:()=>{const e=vn(/* @__PURE__ */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=vn(/* @__PURE__ */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=/* @__PURE__ */new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:t.lastMonth,getValue:()=>{const e=/* @__PURE__ */new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=/* @__PURE__ */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=/* @__PURE__ */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=/* @__PURE__ */(new Date).getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=/* @__PURE__ */(new Date).getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}]}(I),Te=11===oe?0:oe+1,We=11===oe?te+1:te,Be=S>=2,Fe=x?F(x):void 0,je=y?F(y):void 0,qe=k?F(k):void 0,Ge=F(b),_e="single"===a&&null!=E||"range"===a&&(null!=O[0]||null!=O[1])||"multiple"===a&&Y.length>0,Ze="range"===a?G?_:O:[null,null],Je=w?M.danger:ce?M.primary:M.border,Qe=Array.from({length:24},(e,t)=>t),et=Array.from({length:60},(e,t)=>t),tt=/* @__PURE__ */Ye("div",{ref:Se,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:e=>{if("day"!==ie)return;const t=fe??E??T;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&&fe)return void Ie(fe);n&&(e.preventDefault(),me(n),n.getMonth()===oe&&n.getFullYear()===te||(re(n.getMonth()),ne(n.getFullYear())))},style:{position:"absolute",top:ye.top,left:ye.left,zIndex:9999,backgroundColor:M.surface,border:`1px solid ${M.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:Be?"580px":"300px",maxWidth:Be&&m?"780px":Be?"620px":m?"520px":"300px",opacity:ce?1:0,transform:ce?"translateY(0) scale(1)":ye.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:D?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[m&&"range"===a&&/* @__PURE__ */Ye("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${M.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[/* @__PURE__ */Ke("div",{style:{fontSize:"11px",fontWeight:600,color:M.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),De.map(e=>{const[t,n]=e.getValue(),r=Ze[0]&&Ze[1]&&yn(Ze[0],t)&&yn(Ze[1],n);/* @__PURE__ */
72
- return Ke("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),r=[t,n];Z(r),H||P(r),o?.(r),ne(t.getFullYear()),re(t.getMonth()),q("start"),G||ue(!1)})(e),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:r?`${M.primary}20`:"transparent",color:r?M.primary:M.text,fontWeight:r?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:e=>{r||(e.currentTarget.style.backgroundColor=`${M.surfaceAlt}`)},onMouseLeave:e=>{r||(e.currentTarget.style.backgroundColor="transparent")},children:e.label},e.label)})]}),/* @__PURE__ */Ye("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[
71
+ return Ye("div",{children:[/* @__PURE__ */Ke("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:gn.map(e=>/* @__PURE__ */Ke("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:p.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),/* @__PURE__ */Ke("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:m.map((e,m)=>{const g=e.getMonth()===t,x=yn(e,n),b=0===e.getDay()||6===e.getDay(),y=d(e),v="single"===o&&null!=r&&yn(e,r),w="multiple"===o&&a.some(t=>yn(t,e)),k="range"===o&&wn(e,i[0],null),S="range"===o&&wn(e,null,i[1]),C=k||S,$="range"===o&&i[0]&&!i[1]&&l?l:i[1],z="range"===o&&function(e,t,n){if(!t||!n)return!1;const o=vn(e).getTime(),r=vn(t).getTime(),i=vn(n).getTime();return o>Math.min(r,i)&&o<Math.max(r,i)}(e,i[0],$),M="range"===o&&i[0]&&!i[1]&&l&&yn(e,l),N=v||w||C,I=null!=s&&yn(e,s);let R="transparent",T=g?b?`${p.text}cc`:p.text:`${p.textMuted}60`,D="none",L=400;return N||M?(R=p.primary,T=p.bg,L=600):z&&(R=`${p.primary}18`),x&&!N&&(D=`2px solid ${p.primary}`,L=600),y&&(T=`${p.textMuted}50`),I&&!N&&(D=`2px solid ${p.secondary}`),/* @__PURE__ */Ke("button",{type:"button","aria-label":e.toLocaleDateString(f,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":N,"aria-disabled":y,disabled:y,onClick:()=>!y&&c(e),onMouseEnter:()=>u(e),onMouseLeave:()=>u(null),onFocus:()=>h(e),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:R,color:T,border:D,fontSize:"13px",fontWeight:L,cursor:y?"not-allowed":"pointer",opacity:y?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:y?"line-through":"none",transition:"background-color 80ms ease"},children:e.getDate()},m)})})]})}function Mn({value:e,onChange:t,rangeValue:n,onRangeChange:o,multiValue:r,onMultiChange:i,mode:a="single",minDate:l,maxDate:s,disabledDates:d,locale:c="en-US",dateFormat:u,showTime:h=!1,timeValue:p,onTimeChange:f,showPresets:m=!1,customPresets:g,label:x,placeholder:b="MM/DD/YYYY",hint:y,isDisabled:v=!1,isInvalid:w=!1,errorMessage:k,numberOfMonths:S=1,id:C,className:$,style:z}){const N=M(),I=$e(),R=He(),T=C??R,D=ge(),L=vn(/* @__PURE__ */new Date),W=void 0!==e,[A,B]=Ve(null),E=W?e??null:A,H=void 0!==n,[j,P]=Ve([null,null]),O=H?n:j,V=void 0!==r,[U,K]=Ve([]),Y=V?r:U,[X,q]=Ve("start"),G="range"===a||"single"===a&&h,[J,_]=Ve([null,null]),[Z,Q]=Ve(null),ee=E??O[0]??L,[te,ne]=Ve(ee.getFullYear()),[oe,re]=Ve(ee.getMonth()),[ie,ae]=Ve("day"),[le,se]=Ve({h:0,m:0}),de=p??le,[ce,ue]=Ve(!1),[he,pe]=Ve(()=>{if("single"===a)return kn(E,c,u);if("range"===a){const[e,t]=O;if(e&&t)return`${kn(e,c,u)} – ${kn(t,c,u)}`}return""}),[fe,me]=Ve(null),[xe,be]=Ve(null),[ye,ve]=Ve({top:0,left:0,flipUp:!1}),[,we]=Pe(e=>e+1,0),ke=Oe(null),Se=Oe(null),Ce=Oe(null),ze=m?420:h?480:360;Ee(()=>{if("single"===a)pe(kn(E,c,u));else if("range"===a){const[e,t]=O;pe(e&&t?`${kn(e,c,u)} – ${kn(t,c,u)}`:e?kn(e,c,u):"")}else"multiple"===a&&pe(Y.length>0?`${Y.length} date${1!==Y.length?"s":""} selected`:"")},[E,O,Y,a,c,u]);const Me=Ae(()=>{ke.current&&ve(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight,r=window.scrollY,i=window.scrollX,a=o-n.bottom<t+8&&n.top>t+8;return{top:a?r+n.top-t-4:r+n.bottom+4,left:i+n.left,flipUp:a}}(ke.current,ze))},[ze]);Ee(()=>{if(ce)return Me(),window.addEventListener("scroll",Me,!0),window.addEventListener("resize",Me),()=>{window.removeEventListener("scroll",Me,!0),window.removeEventListener("resize",Me)}},[ce,Me]),Ee(()=>{if(!ce)return;const e=e=>{ke.current?.contains(e.target)||Se.current?.contains(e.target)||ue(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[ce]),Ee(()=>{if(!ce)return;const e=e=>{"Escape"===e.key&&(ue(!1),Ce.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[ce]);const Ne=Ae(e=>!!(l&&vn(e)<vn(l))||!!(s&&vn(e)>vn(s))||!!d&&("function"==typeof d?d(e):d.some(t=>yn(t,e))),[l,s,d]),Ie=Ae(e=>{if(!Ne(e)){if("single"===a)G?Q(e):(W||B(e),t?.(e),pe(kn(e,c,u)),ue(!1));else if("range"===a)if("start"===X){const t=[e,null];_(t),H||P(t),o?.(t),q("end")}else{const t=J[0]??O[0],n=t&&e<t?[e,t]:[t,e];_(n),G?q("start"):(H||P(n),o?.(n),q("start"),ue(!1))}else if("multiple"===a){const t=Y.some(t=>yn(t,e))?Y.filter(t=>!yn(t,e)):[...Y,e];V||K(t),i?.(t)}we()}},[a,Ne,W,H,V,t,o,i,X,J,O,Y,G,c]),Re=Ae(()=>{if("single"===a){const e=Z??E;W||B(e),t?.(e)}else"range"===a&&(H||P(J),o?.(J));ue(!1),q("start")},[a,Z,J,E,W,H,t,o]),Te=Ae(()=>{Q(null),_([null,null]),q("start"),ue(!1)},[]),De=g??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=vn(/* @__PURE__ */new Date);return[e,e]}},{label:t.yesterday,getValue:()=>{const e=vn(/* @__PURE__ */new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:t.last7,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-6),[t,e]}},{label:t.last30,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-29),[t,e]}},{label:t.last90,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-89),[t,e]}},{label:t.thisWeek,getValue:()=>{const e=vn(/* @__PURE__ */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=vn(/* @__PURE__ */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=/* @__PURE__ */new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:t.lastMonth,getValue:()=>{const e=/* @__PURE__ */new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=/* @__PURE__ */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=/* @__PURE__ */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=/* @__PURE__ */(new Date).getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=/* @__PURE__ */(new Date).getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}]}(I),Le=11===oe?0:oe+1,We=11===oe?te+1:te,Be=S>=2,Fe=x?F(x):void 0,je=y?F(y):void 0,qe=k?F(k):void 0,Ge=F(b),Je="single"===a&&null!=E||"range"===a&&(null!=O[0]||null!=O[1])||"multiple"===a&&Y.length>0,_e="range"===a?G?J:O:[null,null],Ze=w?N.danger:ce?N.primary:N.border,Qe=Array.from({length:24},(e,t)=>t),et=Array.from({length:60},(e,t)=>t),tt=/* @__PURE__ */Ye("div",{ref:Se,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:e=>{if("day"!==ie)return;const t=fe??E??L;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&&fe)return void Ie(fe);n&&(e.preventDefault(),me(n),n.getMonth()===oe&&n.getFullYear()===te||(re(n.getMonth()),ne(n.getFullYear())))},style:{position:"absolute",top:ye.top,left:ye.left,zIndex:9999,backgroundColor:N.surface,border:`1px solid ${N.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:Be?"580px":"300px",maxWidth:Be&&m?"780px":Be?"620px":m?"520px":"300px",opacity:ce?1:0,transform:ce?"translateY(0) scale(1)":ye.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:D?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[m&&"range"===a&&/* @__PURE__ */Ye("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${N.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[/* @__PURE__ */Ke("div",{style:{fontSize:"11px",fontWeight:600,color:N.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),De.map(e=>{const[t,n]=e.getValue(),r=_e[0]&&_e[1]&&yn(_e[0],t)&&yn(_e[1],n);/* @__PURE__ */
72
+ return Ke("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),r=[t,n];_(r),H||P(r),o?.(r),ne(t.getFullYear()),re(t.getMonth()),q("start"),G||ue(!1)})(e),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:r?`${N.primary}20`:"transparent",color:r?N.primary:N.text,fontWeight:r?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:e=>{r||(e.currentTarget.style.backgroundColor=`${N.surfaceAlt}`)},onMouseLeave:e=>{r||(e.currentTarget.style.backgroundColor="transparent")},children:e.label},e.label)})]}),/* @__PURE__ */Ye("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[
73
73
  /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[
74
- /* @__PURE__ */Ke("button",{type:"button","aria-label":"day"===ie?"Previous month":"month"===ie?"Previous year":"Previous decade",onClick:()=>{"day"===ie?(0===oe?(re(11),ne(e=>e-1)):re(e=>e-1),ae("day")):ne("month"===ie?e=>e-1:e=>e-10)},style:{border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ke("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"15 18 9 12 15 6"})})}),
74
+ /* @__PURE__ */Ke("button",{type:"button","aria-label":"day"===ie?"Previous month":"month"===ie?"Previous year":"Previous decade",onClick:()=>{"day"===ie?(0===oe?(re(11),ne(e=>e-1)):re(e=>e-1),ae("day")):ne("month"===ie?e=>e-1:e=>e-10)},style:{border:"none",background:"transparent",cursor:"pointer",color:N.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ke("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"15 18 9 12 15 6"})})}),
75
75
  /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:["day"===ie&&/* @__PURE__ */Ye(Ue,{children:[
76
- /* @__PURE__ */Ke("button",{type:"button",onClick:()=>ae("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:M.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:xn[oe]}),
77
- /* @__PURE__ */Ke("button",{type:"button",onClick:()=>ae("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:M.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:te}),Be&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("span",{style:{color:M.textMuted,fontSize:"14px"},children:"–"}),/* @__PURE__ */Ye("span",{style:{fontSize:"14px",fontWeight:600,color:M.text},children:[xn[Te]," ",We]})]})]}),"month"===ie&&/* @__PURE__ */Ke("button",{type:"button",onClick:()=>ae("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:M.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:te}),"year"===ie&&/* @__PURE__ */Ye("span",{style:{fontSize:"14px",fontWeight:600,color:M.text},children:[Cn(te),"–",Cn(te)+9]})]}),
78
- /* @__PURE__ */Ke("button",{type:"button","aria-label":"day"===ie?"Next month":"month"===ie?"Next year":"Next decade",onClick:()=>{"day"===ie?(11===oe?(re(0),ne(e=>e+1)):re(e=>e+1),ae("day")):ne("month"===ie?e=>e+1:e=>e+10)},style:{border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ke("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"9 18 15 12 9 6"})})})]}),"day"===ie&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:"20px"},children:[/* @__PURE__ */Ke(zn,{year:te,month:oe,today:T,mode:a,selectedDate:E,selectedRange:Ze,multiDates:Y,hoverDate:xe,focusedDate:fe,isDateDisabled:Me,onSelectDate:Ie,onHoverDate:be,onSetFocused:me,theme:M,locale:c}),Be&&/* @__PURE__ */Ke(zn,{year:We,month:Te,today:T,mode:a,selectedDate:E,selectedRange:Ze,multiDates:Y,hoverDate:xe,focusedDate:fe,isDateDisabled:Me,onSelectDate:Ie,onHoverDate:be,onSetFocused:me,theme:M,locale:c})]}),"month"===ie&&/* @__PURE__ */Ke("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:bn.map((e,t)=>{const n=t===oe;/* @__PURE__ */
79
- return Ke("button",{type:"button",onClick:()=>{re(t),ae("day")},style:{padding:"10px",borderRadius:"8px",border:t!==T.getMonth()||te!==T.getFullYear()||n?"none":`2px solid ${M.primary}`,cursor:"pointer",fontSize:"13px",fontWeight:n?600:400,backgroundColor:n?M.primary:"transparent",color:n?M.bg:M.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:e},e)})}),"year"===ie&&/* @__PURE__ */Ke("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(e,t)=>{const n=Cn(te)-1+t,o=n===te,r=n===T.getFullYear(),i=0===t||11===t;/* @__PURE__ */
80
- return Ke("button",{type:"button",onClick:()=>{ne(n),ae("month")},style:{padding:"10px 6px",borderRadius:"8px",border:r&&!o?`2px solid ${M.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?M.primary:"transparent",color:o?M.bg:i?M.textMuted:M.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:i?.5:1},children:n},n)})}),h&&"day"===ie&&/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[
81
- /* @__PURE__ */Ke($n,{values:Qe,selected:de.h,onSelect:e=>{p||se(t=>({...t,h:e})),f?.({...de,h:e})},label:"Hour",theme:M}),
82
- /* @__PURE__ */Ke("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:M.textMuted},children:":"}),
83
- /* @__PURE__ */Ke($n,{values:et,selected:de.m,onSelect:e=>{p||se(t=>({...t,m:e})),f?.({...de,m:e})},label:"Min",theme:M})]}),"multiple"===a&&"day"===ie&&Y.length>0&&/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"8px",fontSize:"12px",color:M.textMuted,textAlign:"center"},children:[Y.length," date",1!==Y.length?"s":""," selected"]}),
84
- /* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:G?"space-between":"flex-start",gap:"8px"},children:[/* @__PURE__ */Ke("button",{type:"button",onClick:()=>{ne(T.getFullYear()),re(T.getMonth()),ae("day"),Ie(T)},style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:M.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),G&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:"6px"},children:[/* @__PURE__ */Ke("button",{type:"button",onClick:Re,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${M.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:M.text,fontFamily:"inherit"},children:"Cancel"}),/* @__PURE__ */Ke("button",{type:"button",onClick:Le,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:M.primary,color:M.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});/* @__PURE__ */
85
- return Ye("div",{className:$,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...z},children:[Fe&&/* @__PURE__ */Ke("label",{htmlFor:R,style:{fontSize:"13px",fontWeight:500,color:M.text,marginBottom:"2px"},children:Fe}),
86
- /* @__PURE__ */Ye("div",{ref:ke,style:{display:"flex",alignItems:"center",border:`1.5px solid ${Je}`,borderRadius:"8px",backgroundColor:M.surface,overflow:"hidden",transition:D?"none":"border-color 120ms ease",opacity:v?.5:1},children:[
87
- /* @__PURE__ */Ke("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:M.textMuted,flexShrink:0},children:/* @__PURE__ */Ye("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
76
+ /* @__PURE__ */Ke("button",{type:"button",onClick:()=>ae("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:N.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:xn[oe]}),
77
+ /* @__PURE__ */Ke("button",{type:"button",onClick:()=>ae("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:N.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:te}),Be&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("span",{style:{color:N.textMuted,fontSize:"14px"},children:"–"}),/* @__PURE__ */Ye("span",{style:{fontSize:"14px",fontWeight:600,color:N.text},children:[xn[Le]," ",We]})]})]}),"month"===ie&&/* @__PURE__ */Ke("button",{type:"button",onClick:()=>ae("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:N.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:te}),"year"===ie&&/* @__PURE__ */Ye("span",{style:{fontSize:"14px",fontWeight:600,color:N.text},children:[Cn(te),"–",Cn(te)+9]})]}),
78
+ /* @__PURE__ */Ke("button",{type:"button","aria-label":"day"===ie?"Next month":"month"===ie?"Next year":"Next decade",onClick:()=>{"day"===ie?(11===oe?(re(0),ne(e=>e+1)):re(e=>e+1),ae("day")):ne("month"===ie?e=>e+1:e=>e+10)},style:{border:"none",background:"transparent",cursor:"pointer",color:N.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ke("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"9 18 15 12 9 6"})})})]}),"day"===ie&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:"20px"},children:[/* @__PURE__ */Ke(zn,{year:te,month:oe,today:L,mode:a,selectedDate:E,selectedRange:_e,multiDates:Y,hoverDate:xe,focusedDate:fe,isDateDisabled:Ne,onSelectDate:Ie,onHoverDate:be,onSetFocused:me,theme:N,locale:c}),Be&&/* @__PURE__ */Ke(zn,{year:We,month:Le,today:L,mode:a,selectedDate:E,selectedRange:_e,multiDates:Y,hoverDate:xe,focusedDate:fe,isDateDisabled:Ne,onSelectDate:Ie,onHoverDate:be,onSetFocused:me,theme:N,locale:c})]}),"month"===ie&&/* @__PURE__ */Ke("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:bn.map((e,t)=>{const n=t===oe;/* @__PURE__ */
79
+ return Ke("button",{type:"button",onClick:()=>{re(t),ae("day")},style:{padding:"10px",borderRadius:"8px",border:t!==L.getMonth()||te!==L.getFullYear()||n?"none":`2px solid ${N.primary}`,cursor:"pointer",fontSize:"13px",fontWeight:n?600:400,backgroundColor:n?N.primary:"transparent",color:n?N.bg:N.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:e},e)})}),"year"===ie&&/* @__PURE__ */Ke("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(e,t)=>{const n=Cn(te)-1+t,o=n===te,r=n===L.getFullYear(),i=0===t||11===t;/* @__PURE__ */
80
+ return Ke("button",{type:"button",onClick:()=>{ne(n),ae("month")},style:{padding:"10px 6px",borderRadius:"8px",border:r&&!o?`2px solid ${N.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?N.primary:"transparent",color:o?N.bg:i?N.textMuted:N.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:i?.5:1},children:n},n)})}),h&&"day"===ie&&/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${N.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[
81
+ /* @__PURE__ */Ke($n,{values:Qe,selected:de.h,onSelect:e=>{p||se(t=>({...t,h:e})),f?.({...de,h:e})},label:"Hour",theme:N}),
82
+ /* @__PURE__ */Ke("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:N.textMuted},children:":"}),
83
+ /* @__PURE__ */Ke($n,{values:et,selected:de.m,onSelect:e=>{p||se(t=>({...t,m:e})),f?.({...de,m:e})},label:"Min",theme:N})]}),"multiple"===a&&"day"===ie&&Y.length>0&&/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${N.border}`,paddingTop:"8px",fontSize:"12px",color:N.textMuted,textAlign:"center"},children:[Y.length," date",1!==Y.length?"s":""," selected"]}),
84
+ /* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${N.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:G?"space-between":"flex-start",gap:"8px"},children:[/* @__PURE__ */Ke("button",{type:"button",onClick:()=>{ne(L.getFullYear()),re(L.getMonth()),ae("day"),Ie(L)},style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:N.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),G&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:"6px"},children:[/* @__PURE__ */Ke("button",{type:"button",onClick:Te,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${N.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:N.text,fontFamily:"inherit"},children:"Cancel"}),/* @__PURE__ */Ke("button",{type:"button",onClick:Re,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:N.primary,color:N.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});/* @__PURE__ */
85
+ return Ye("div",{className:$,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...z},children:[Fe&&/* @__PURE__ */Ke("label",{htmlFor:T,style:{fontSize:"13px",fontWeight:500,color:N.text,marginBottom:"2px"},children:Fe}),
86
+ /* @__PURE__ */Ye("div",{ref:ke,style:{display:"flex",alignItems:"center",border:`1.5px solid ${Ze}`,borderRadius:"8px",backgroundColor:N.surface,overflow:"hidden",transition:D?"none":"border-color 120ms ease",opacity:v?.5:1},children:[
87
+ /* @__PURE__ */Ke("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:N.textMuted,flexShrink:0},children:/* @__PURE__ */Ye("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
88
88
  /* @__PURE__ */Ke("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),
89
89
  /* @__PURE__ */Ke("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),
90
90
  /* @__PURE__ */Ke("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),
91
91
  /* @__PURE__ */Ke("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),
92
- /* @__PURE__ */Ke("input",{ref:Ce,id:R,type:"text",value:he,placeholder:Ge,disabled:v,"aria-invalid":w,"aria-haspopup":"dialog","aria-expanded":ce,readOnly:"range"===a||"multiple"===a,onChange:e=>(e=>{if(pe(e),"single"===a){const n=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,u);n&&!Me(n)&&(W||B(n),t?.(n),ne(n.getFullYear()),re(n.getMonth()))}})(e.target.value),onFocus:()=>{v||ue(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:M.text,cursor:"single"!==a?"pointer":"text",fontFamily:"inherit",minWidth:0}}),_e&&!v&&/* @__PURE__ */Ke("button",{type:"button","aria-label":"Clear selection",onClick:e=>{if(e.stopPropagation(),"single"===a)W||B(null),t?.(null),pe("");else if("range"===a){const e=[null,null];H||P(e),o?.(e),Z(e),pe(""),q("start")}else"multiple"===a&&(V||K([]),i?.([]),pe(""))},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:/* @__PURE__ */Ye("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:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),
93
- /* @__PURE__ */Ke("button",{type:"button","aria-label":ce?"Close calendar":"Open calendar",tabIndex:-1,disabled:v,onClick:()=>{v||ue(e=>!e)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:v?"not-allowed":"pointer",color:M.textMuted,flexShrink:0},children:/* @__PURE__ */Ke("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:ce?"rotate(180deg)":"rotate(0deg)",transition:D?"none":"transform 160ms ease"},children:/* @__PURE__ */Ke("polyline",{points:"6 9 12 15 18 9"})})})]}),je&&!w&&/* @__PURE__ */Ke("span",{style:{fontSize:"12px",color:M.textMuted},children:je}),w&&qe&&/* @__PURE__ */Ke("span",{role:"alert",style:{fontSize:"12px",color:M.danger},children:qe}),ce&&"undefined"!=typeof document&&Xe(tt,document.body)]})}Nn.displayName="TkxDatePicker";var Mn={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function In(e,t,n){return Math.min(Math.max(e,t),n)}function Ln(e,t,n){return Math.round((e-t)/n)*n+t}function Rn(e,t,n){return(e-t)/(n-t)*100}function Dn({value:e,min:t,max:n,step:o,isDisabled:r,trackColor:i,thumbSize:a,ariaLabel:l,tooltipMode:s,formatValue:d,orientation:c,onChange:u,onChangeEnd:h}){const[p,f]=Ve(!1),[m,g]=Ve(!1),[x,b]=Ve(!1),y="vertical"===c,v=Rn(e,t,n);/* @__PURE__ */
94
- return Ye("div",{style:y?{position:"absolute",bottom:`${v}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${a/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"}:{position:"absolute",left:`${v}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${a/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"},children:[("always"===s||"hover"===s&&(x||m||p))&&/* @__PURE__ */Ke("div",{style:y?{position:"absolute",left:a+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:a+6,left:"50%",transform:"translateX(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"},children:d(e)}),/* @__PURE__ */Ke("div",{role:"slider",tabIndex:r?-1:0,"aria-label":l,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":r,"aria-orientation":c,onKeyDown:i=>{r||("ArrowRight"===i.key||"ArrowUp"===i.key?(i.preventDefault(),u(In(Ln(e+o,t,o),t,n))):"ArrowLeft"===i.key||"ArrowDown"===i.key?(i.preventDefault(),u(In(Ln(e-o,t,o),t,n))):"Home"===i.key?(i.preventDefault(),u(t)):"End"===i.key&&(i.preventDefault(),u(n)))},onFocus:()=>f(!0),onBlur:()=>f(!1),onPointerEnter:()=>b(!0),onPointerLeave:()=>b(!1),onPointerDown:e=>{r||(g(!0),e.target.setPointerCapture(e.pointerId))},onPointerUp:()=>{g(!1),h?.()},style:{width:a,height:a,borderRadius:"50%",backgroundColor:r?"#888":i,border:"3px solid #fff",boxShadow:p?`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 Tn({value:e,defaultValue:t=0,onChange:n,rangeValue:o,onRangeChange:r,min:i=0,max:a=100,step:l=1,isRange:s=!1,label:d,showValue:c=!1,showTicks:u=!1,tickCount:h=5,isDisabled:p=!1,colorScheme:f="primary",size:m="md",marks:g,orientation:x="horizontal",showTooltip:b=!1,formatValue:y,onChangeEnd:v,onRangeChangeEnd:w,gradient:k=!1}){const S=N(),C=He(),$=ge(),z=void 0!==e,[M,I]=Ve(t),L=z?e:M,R=void 0!==o,[D,T]=Ve([i,a]),W=R?o:D,A=Oe(null),B=Oe(L);B.current=L;const E=Oe(W);E.current=W;const H={primary:S.primary,success:S.success,danger:S.danger,warning:S.warning}[f],j=Mn[m],P="vertical"===x,O=!0===b?"hover":!1!==b&&b,V=y??(e=>String(e)),K=H+"66",Y=Ae((e,t)=>{const n=A.current;if(!n)return i;const o=n.getBoundingClientRect();let r;return r=In(P?(o.bottom-(t??0))/o.height:(e-o.left)/o.width,0,1),In(Ln(r*(a-i)+i,i,l),i,a)},[i,a,l,P]),X=Ae(e=>{if(p)return;const t=Y(e.clientX,e.clientY);if(s){const[e,n]=W,o=Math.abs(t-e)<=Math.abs(t-n)?[t,n]:[e,t];R||T(o),r?.(o)}else z||I(t),n?.(t)},[p,s,z,R,Y,n,r,W]),q=s?Rn(W[0],i,a):0,G=Rn(s?W[1]:L,i,a),_=u?Array.from({length:h},(e,t)=>i+t/(h-1)*(a-i)):[],Z=d?F(d):void 0,J=$?"none":"background 150ms ease";/* @__PURE__ */
95
- return Ye("div",{className:U("flex flex-col gap-2"),style:{opacity:p?.55:1,...P?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(Z||c)&&/* @__PURE__ */Ye("div",{className:U("flex items-center justify-between"),children:[Z&&/* @__PURE__ */Ke("label",{htmlFor:C,className:U("text-sm font-medium"),style:{color:S.text,fontSize:j.fontSize},children:Z}),c&&!s&&/* @__PURE__ */Ke("span",{className:U("text-sm tabular-nums"),style:{color:S.textMuted,fontSize:j.fontSize},children:V(L)}),c&&s&&/* @__PURE__ */Ye("span",{className:U("text-sm tabular-nums"),style:{color:S.textMuted,fontSize:j.fontSize},children:[V(W[0])," – ",V(W[1])]})]}),
92
+ /* @__PURE__ */Ke("input",{ref:Ce,id:T,type:"text",value:he,placeholder:Ge,disabled:v,"aria-invalid":w,"aria-haspopup":"dialog","aria-expanded":ce,readOnly:"range"===a||"multiple"===a,onChange:e=>(e=>{if(pe(e),"single"===a){const n=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,u);n&&!Ne(n)&&(W||B(n),t?.(n),ne(n.getFullYear()),re(n.getMonth()))}})(e.target.value),onFocus:()=>{v||ue(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:N.text,cursor:"single"!==a?"pointer":"text",fontFamily:"inherit",minWidth:0}}),Je&&!v&&/* @__PURE__ */Ke("button",{type:"button","aria-label":"Clear selection",onClick:e=>{if(e.stopPropagation(),"single"===a)W||B(null),t?.(null),pe("");else if("range"===a){const e=[null,null];H||P(e),o?.(e),_(e),pe(""),q("start")}else"multiple"===a&&(V||K([]),i?.([]),pe(""))},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:N.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:/* @__PURE__ */Ye("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:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),
93
+ /* @__PURE__ */Ke("button",{type:"button","aria-label":ce?"Close calendar":"Open calendar",tabIndex:-1,disabled:v,onClick:()=>{v||ue(e=>!e)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:v?"not-allowed":"pointer",color:N.textMuted,flexShrink:0},children:/* @__PURE__ */Ke("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:ce?"rotate(180deg)":"rotate(0deg)",transition:D?"none":"transform 160ms ease"},children:/* @__PURE__ */Ke("polyline",{points:"6 9 12 15 18 9"})})})]}),je&&!w&&/* @__PURE__ */Ke("span",{style:{fontSize:"12px",color:N.textMuted},children:je}),w&&qe&&/* @__PURE__ */Ke("span",{role:"alert",style:{fontSize:"12px",color:N.danger},children:qe}),ce&&"undefined"!=typeof document&&Xe(tt,document.body)]})}Mn.displayName="TkxDatePicker";var Nn={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function In(e,t,n){return Math.min(Math.max(e,t),n)}function Rn(e,t,n){return Math.round((e-t)/n)*n+t}function Tn(e,t,n){return(e-t)/(n-t)*100}function Dn({value:e,min:t,max:n,step:o,isDisabled:r,trackColor:i,thumbSize:a,ariaLabel:l,tooltipMode:s,formatValue:d,orientation:c,onChange:u,onChangeEnd:h}){const[p,f]=Ve(!1),[m,g]=Ve(!1),[x,b]=Ve(!1),y="vertical"===c,v=Tn(e,t,n);/* @__PURE__ */
94
+ return Ye("div",{style:y?{position:"absolute",bottom:`${v}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${a/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"}:{position:"absolute",left:`${v}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${a/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"},children:[("always"===s||"hover"===s&&(x||m||p))&&/* @__PURE__ */Ke("div",{style:y?{position:"absolute",left:a+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:a+6,left:"50%",transform:"translateX(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"},children:d(e)}),/* @__PURE__ */Ke("div",{role:"slider",tabIndex:r?-1:0,"aria-label":l,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":r,"aria-orientation":c,onKeyDown:i=>{r||("ArrowRight"===i.key||"ArrowUp"===i.key?(i.preventDefault(),u(In(Rn(e+o,t,o),t,n))):"ArrowLeft"===i.key||"ArrowDown"===i.key?(i.preventDefault(),u(In(Rn(e-o,t,o),t,n))):"Home"===i.key?(i.preventDefault(),u(t)):"End"===i.key&&(i.preventDefault(),u(n)))},onFocus:()=>f(!0),onBlur:()=>f(!1),onPointerEnter:()=>b(!0),onPointerLeave:()=>b(!1),onPointerDown:e=>{r||(g(!0),e.target.setPointerCapture(e.pointerId))},onPointerUp:()=>{g(!1),h?.()},style:{width:a,height:a,borderRadius:"50%",backgroundColor:r?"#888":i,border:"3px solid #fff",boxShadow:p?`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 Ln({value:e,defaultValue:t=0,onChange:n,rangeValue:o,onRangeChange:r,min:i=0,max:a=100,step:l=1,isRange:s=!1,label:d,showValue:c=!1,showTicks:u=!1,tickCount:h=5,isDisabled:p=!1,colorScheme:f="primary",size:m="md",marks:g,orientation:x="horizontal",showTooltip:b=!1,formatValue:y,onChangeEnd:v,onRangeChangeEnd:w,gradient:k=!1}){const S=M(),C=He(),$=ge(),z=void 0!==e,[N,I]=Ve(t),R=z?e:N,T=void 0!==o,[D,L]=Ve([i,a]),W=T?o:D,A=Oe(null),B=Oe(R);B.current=R;const E=Oe(W);E.current=W;const H={primary:S.primary,success:S.success,danger:S.danger,warning:S.warning}[f],j=Nn[m],P="vertical"===x,O=!0===b?"hover":!1!==b&&b,V=y??(e=>String(e)),K=H+"66",Y=Ae((e,t)=>{const n=A.current;if(!n)return i;const o=n.getBoundingClientRect();let r;return r=In(P?(o.bottom-(t??0))/o.height:(e-o.left)/o.width,0,1),In(Rn(r*(a-i)+i,i,l),i,a)},[i,a,l,P]),X=Ae(e=>{if(p)return;const t=Y(e.clientX,e.clientY);if(s){const[e,n]=W,o=Math.abs(t-e)<=Math.abs(t-n)?[t,n]:[e,t];T||L(o),r?.(o)}else z||I(t),n?.(t)},[p,s,z,T,Y,n,r,W]),q=s?Tn(W[0],i,a):0,G=Tn(s?W[1]:R,i,a),J=u?Array.from({length:h},(e,t)=>i+t/(h-1)*(a-i)):[],_=d?F(d):void 0,Z=$?"none":"background 150ms ease";/* @__PURE__ */
95
+ return Ye("div",{className:U("flex flex-col gap-2"),style:{opacity:p?.55:1,...P?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(_||c)&&/* @__PURE__ */Ye("div",{className:U("flex items-center justify-between"),children:[_&&/* @__PURE__ */Ke("label",{htmlFor:C,className:U("text-sm font-medium"),style:{color:S.text,fontSize:j.fontSize},children:_}),c&&!s&&/* @__PURE__ */Ke("span",{className:U("text-sm tabular-nums"),style:{color:S.textMuted,fontSize:j.fontSize},children:V(R)}),c&&s&&/* @__PURE__ */Ye("span",{className:U("text-sm tabular-nums"),style:{color:S.textMuted,fontSize:j.fontSize},children:[V(W[0])," – ",V(W[1])]})]}),
96
96
  /* @__PURE__ */Ye("div",{style:{position:"relative",...P?{paddingLeft:j.thumb/2,paddingRight:j.thumb/2,flex:1}:{paddingTop:j.thumb/2,paddingBottom:j.thumb/2}},children:[/* @__PURE__ */Ye("div",{ref:A,onPointerDown:X,style:{position:"relative",...P?{width:j.track,height:"100%"}:{height:j.track},borderRadius:9999,backgroundColor:S.border,cursor:p?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[
97
- /* @__PURE__ */Ke("div",{style:{position:"absolute",...P?{left:0,bottom:`${q}%`,height:G-q+"%",width:"100%"}:{top:0,left:`${q}%`,width:G-q+"%",height:"100%"},borderRadius:9999,...p?{backgroundColor:S.textMuted}:k?{background:P?`linear-gradient(to top, ${K}, ${H})`:`linear-gradient(to right, ${K}, ${H})`}:{backgroundColor:H},transition:J}}),_.map((e,t)=>/* @__PURE__ */Ke("div",{style:{position:"absolute",...P?{bottom:`${Rn(e,i,a)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:j.track+4}:{left:`${Rn(e,i,a)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:j.track+4},backgroundColor:S.surface,borderRadius:9999,pointerEvents:"none"}},t)),s?/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke(Dn,{value:W[0],min:i,max:W[1],step:l,isDisabled:p,trackColor:H,trackHeight:j.track,thumbSize:j.thumb,ariaLabel:`${Z??"Range"} start`,tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{const t=[In(e,i,W[1]),W[1]];R||T(t),r?.(t)},onChangeEnd:w?()=>w(E.current):void 0}),/* @__PURE__ */Ke(Dn,{value:W[1],min:W[0],max:a,step:l,isDisabled:p,trackColor:H,trackHeight:j.track,thumbSize:j.thumb,ariaLabel:`${Z??"Range"} end`,tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{const t=[W[0],In(e,W[0],a)];R||T(t),r?.(t)},onChangeEnd:w?()=>w(E.current):void 0})]}):/* @__PURE__ */Ke(Dn,{value:L,min:i,max:a,step:l,isDisabled:p,trackColor:H,trackHeight:j.track,thumbSize:j.thumb,ariaLabel:Z??"Slider",tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{z||I(e),n?.(e)},onChangeEnd:v?()=>v(B.current):void 0})]}),g&&g.length>0&&/* @__PURE__ */Ke("div",{style:{position:P?"absolute":"relative",...P?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:g.map((e,t)=>/* @__PURE__ */Ke("div",{style:{position:"absolute",...P?{bottom:`${Rn(e.value,i,a)}%`,transform:"translateY(50%)",left:0}:{left:`${Rn(e.value,i,a)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:S.textMuted,whiteSpace:"nowrap"},children:F(e.label)},t))})]}),u&&!g&&!P&&/* @__PURE__ */Ke("div",{style:{position:"relative",height:"1rem"},children:_.map((e,t)=>/* @__PURE__ */Ke("span",{style:{position:"absolute",left:`${Rn(e,i,a)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:S.textMuted},children:V(Math.round(e))},t))})]})}Tn.displayName="TkxSlider";var Wn={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 An({total:e,pageSize:t=10,page:n,defaultPage:o=1,onChange:r,siblingCount:i=1,showEdges:a=!0,showPageSize:l=!1,onPageSizeChange:s,pageSizeOptions:d=[10,25,50,100],size:c="md",variant:u="default"}){const h=N(),p=$e(),f=He(),m={pagination:"Pagination",firstPage:p.firstPage??"First page",lastPage:p.lastPage??"Last page",previousPage:p.previousPage??"Previous page",nextPage:p.nextPage??"Next page",pageN:e=>`Page ${e}`,showing:(e,t,n)=>p.showingRange?p.showingRange(e,t,n):`Showing ${e}–${t} of ${n} items`},g=void 0!==n,[x,b]=Ve(o),y=g?n:x,[v,w]=Ve(t),k=t,S=Math.max(1,Math.ceil(e/k)),C=e=>{const t=Math.min(Math.max(e,1),S);t!==y&&(g||b(t),r?.(t))},$=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),a=Math.min(e+n,t);if(!o){const e=[];return i>1&&e.push("..."),e.push(...r(i,a)),a<t&&e.push("..."),e}const l=i>3,s=a<t-2,d=[];d.push(1),l?d.push("left-ellipsis"):d.push(...r(2,i-1)),d.push(...r(Math.max(i,2),Math.min(a,t-1))),s?d.push("right-ellipsis"):d.push(...r(a+1,t-1)),t>1&&d.push(t);const c=/* @__PURE__ */new Set,u=[];for(const h of d)"number"==typeof h?c.has(h)||(c.add(h),u.push(h)):u.push(h);return u}(y,S,i,a),z=Wn[c],M=Math.min((y-1)*k+1,e),I=Math.min(y*k,e),L=(e,t)=>{const n={height:z.height,minWidth:z.minWidth,paddingLeft:z.px,paddingRight:z.px,fontSize:z.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:h.primary,color:h.bg,fontWeight:600,boxShadow:`0 0 0 2px ${h.primary}44`}:"default"===u?{...n,backgroundColor:h.surface,color:h.text,border:`1px solid ${h.border}`}:"outline"===u?{...n,backgroundColor:"transparent",color:h.text,border:`1px solid ${h.border}`}:{...n,backgroundColor:"transparent",color:h.text}},R=({d:e})=>/* @__PURE__ */Ke("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:e})});/* @__PURE__ */
98
- return Ye("nav",{"aria-label":m.pagination,className:U("flex flex-col gap-2"),children:[e>0&&/* @__PURE__ */Ke("p",{className:U("text-sm"),style:{color:h.textMuted,fontSize:z.fontSize},children:F(m.showing(M,I,e))}),/* @__PURE__ */Ye("div",{className:U("flex items-center gap-1 flex-wrap"),children:[a&&/* @__PURE__ */Ye("button",{type:"button","aria-label":m.firstPage,disabled:1===y,onClick:()=>C(1),style:L(!1,1===y),children:[/* @__PURE__ */Ke(R,{d:"15 18 9 12 15 6"}),/* @__PURE__ */Ke(R,{d:"20 18 14 12 20 6"})]}),
99
- /* @__PURE__ */Ke("button",{type:"button","aria-label":m.previousPage,disabled:1===y,onClick:()=>C(y-1),style:L(!1,1===y),children:/* @__PURE__ */Ke(R,{d:"15 18 9 12 15 6"})}),$.map((e,t)=>{if("string"==typeof e)/* @__PURE__ */return Ke("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:z.minWidth,height:z.height,fontSize:z.fontSize,color:h.textMuted,userSelect:"none"},children:"…"},`${e}-${t}`);const n=e,o=n===y;/* @__PURE__ */
100
- return Ke("button",{type:"button","aria-label":m.pageN(n),"aria-current":o?"page":void 0,onClick:()=>C(n),style:L(o,!1),children:n},n)}),
101
- /* @__PURE__ */Ke("button",{type:"button","aria-label":m.nextPage,disabled:y===S,onClick:()=>C(y+1),style:L(!1,y===S),children:/* @__PURE__ */Ke(R,{d:"9 18 15 12 9 6"})}),a&&/* @__PURE__ */Ye("button",{type:"button","aria-label":m.lastPage,disabled:y===S,onClick:()=>C(S),style:L(!1,y===S),children:[/* @__PURE__ */Ke(R,{d:"4 18 10 12 4 6"}),/* @__PURE__ */Ke(R,{d:"14 18 20 12 14 6"})]}),l&&/* @__PURE__ */Ye("div",{className:U("flex items-center gap-2 ml-2"),children:[/* @__PURE__ */Ke("label",{htmlFor:f,className:U("text-sm"),style:{color:h.textMuted,fontSize:z.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),/* @__PURE__ */Ke("select",{id:f,value:v,onChange:e=>{return t=Number(e.target.value),w(t),s?.(t),void C(1);var t},style:{height:z.height,paddingLeft:z.px,paddingRight:z.px,fontSize:z.fontSize,borderRadius:"8px",border:`1px solid ${h.border}`,backgroundColor:h.surface,color:h.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:d.map(e=>/* @__PURE__ */Ke("option",{value:e,children:e},e))})]})]})]})}An.displayName="TkxPagination";var Bn={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},En={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function Hn({color:e,size:t}){/* @__PURE__ */
97
+ /* @__PURE__ */Ke("div",{style:{position:"absolute",...P?{left:0,bottom:`${q}%`,height:G-q+"%",width:"100%"}:{top:0,left:`${q}%`,width:G-q+"%",height:"100%"},borderRadius:9999,...p?{backgroundColor:S.textMuted}:k?{background:P?`linear-gradient(to top, ${K}, ${H})`:`linear-gradient(to right, ${K}, ${H})`}:{backgroundColor:H},transition:Z}}),J.map((e,t)=>/* @__PURE__ */Ke("div",{style:{position:"absolute",...P?{bottom:`${Tn(e,i,a)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:j.track+4}:{left:`${Tn(e,i,a)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:j.track+4},backgroundColor:S.surface,borderRadius:9999,pointerEvents:"none"}},t)),s?/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke(Dn,{value:W[0],min:i,max:W[1],step:l,isDisabled:p,trackColor:H,trackHeight:j.track,thumbSize:j.thumb,ariaLabel:`${_??"Range"} start`,tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{const t=[In(e,i,W[1]),W[1]];T||L(t),r?.(t)},onChangeEnd:w?()=>w(E.current):void 0}),/* @__PURE__ */Ke(Dn,{value:W[1],min:W[0],max:a,step:l,isDisabled:p,trackColor:H,trackHeight:j.track,thumbSize:j.thumb,ariaLabel:`${_??"Range"} end`,tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{const t=[W[0],In(e,W[0],a)];T||L(t),r?.(t)},onChangeEnd:w?()=>w(E.current):void 0})]}):/* @__PURE__ */Ke(Dn,{value:R,min:i,max:a,step:l,isDisabled:p,trackColor:H,trackHeight:j.track,thumbSize:j.thumb,ariaLabel:_??"Slider",tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{z||I(e),n?.(e)},onChangeEnd:v?()=>v(B.current):void 0})]}),g&&g.length>0&&/* @__PURE__ */Ke("div",{style:{position:P?"absolute":"relative",...P?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:g.map((e,t)=>/* @__PURE__ */Ke("div",{style:{position:"absolute",...P?{bottom:`${Tn(e.value,i,a)}%`,transform:"translateY(50%)",left:0}:{left:`${Tn(e.value,i,a)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:S.textMuted,whiteSpace:"nowrap"},children:F(e.label)},t))})]}),u&&!g&&!P&&/* @__PURE__ */Ke("div",{style:{position:"relative",height:"1rem"},children:J.map((e,t)=>/* @__PURE__ */Ke("span",{style:{position:"absolute",left:`${Tn(e,i,a)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:S.textMuted},children:V(Math.round(e))},t))})]})}Ln.displayName="TkxSlider";var Wn={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 An({total:e,pageSize:t=10,page:n,defaultPage:o=1,onChange:r,siblingCount:i=1,showEdges:a=!0,showPageSize:l=!1,onPageSizeChange:s,pageSizeOptions:d=[10,25,50,100],size:c="md",variant:u="default"}){const h=M(),p=$e(),f=He(),m={pagination:"Pagination",firstPage:p.firstPage??"First page",lastPage:p.lastPage??"Last page",previousPage:p.previousPage??"Previous page",nextPage:p.nextPage??"Next page",pageN:e=>`Page ${e}`,showing:(e,t,n)=>p.showingRange?p.showingRange(e,t,n):`Showing ${e}–${t} of ${n} items`},g=void 0!==n,[x,b]=Ve(o),y=g?n:x,[v,w]=Ve(t),k=t,S=Math.max(1,Math.ceil(e/k)),C=e=>{const t=Math.min(Math.max(e,1),S);t!==y&&(g||b(t),r?.(t))},$=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),a=Math.min(e+n,t);if(!o){const e=[];return i>1&&e.push("..."),e.push(...r(i,a)),a<t&&e.push("..."),e}const l=i>3,s=a<t-2,d=[];d.push(1),l?d.push("left-ellipsis"):d.push(...r(2,i-1)),d.push(...r(Math.max(i,2),Math.min(a,t-1))),s?d.push("right-ellipsis"):d.push(...r(a+1,t-1)),t>1&&d.push(t);const c=/* @__PURE__ */new Set,u=[];for(const h of d)"number"==typeof h?c.has(h)||(c.add(h),u.push(h)):u.push(h);return u}(y,S,i,a),z=Wn[c],N=Math.min((y-1)*k+1,e),I=Math.min(y*k,e),R=(e,t)=>{const n={height:z.height,minWidth:z.minWidth,paddingLeft:z.px,paddingRight:z.px,fontSize:z.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:h.primary,color:h.bg,fontWeight:600,boxShadow:`0 0 0 2px ${h.primary}44`}:"default"===u?{...n,backgroundColor:h.surface,color:h.text,border:`1px solid ${h.border}`}:"outline"===u?{...n,backgroundColor:"transparent",color:h.text,border:`1px solid ${h.border}`}:{...n,backgroundColor:"transparent",color:h.text}},T=({d:e})=>/* @__PURE__ */Ke("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:e})});/* @__PURE__ */
98
+ return Ye("nav",{"aria-label":m.pagination,className:U("flex flex-col gap-2"),children:[e>0&&/* @__PURE__ */Ke("p",{className:U("text-sm"),style:{color:h.textMuted,fontSize:z.fontSize},children:F(m.showing(N,I,e))}),/* @__PURE__ */Ye("div",{className:U("flex items-center gap-1 flex-wrap"),children:[a&&/* @__PURE__ */Ye("button",{type:"button","aria-label":m.firstPage,disabled:1===y,onClick:()=>C(1),style:R(!1,1===y),children:[/* @__PURE__ */Ke(T,{d:"15 18 9 12 15 6"}),/* @__PURE__ */Ke(T,{d:"20 18 14 12 20 6"})]}),
99
+ /* @__PURE__ */Ke("button",{type:"button","aria-label":m.previousPage,disabled:1===y,onClick:()=>C(y-1),style:R(!1,1===y),children:/* @__PURE__ */Ke(T,{d:"15 18 9 12 15 6"})}),$.map((e,t)=>{if("string"==typeof e)/* @__PURE__ */return Ke("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:z.minWidth,height:z.height,fontSize:z.fontSize,color:h.textMuted,userSelect:"none"},children:"…"},`${e}-${t}`);const n=e,o=n===y;/* @__PURE__ */
100
+ return Ke("button",{type:"button","aria-label":m.pageN(n),"aria-current":o?"page":void 0,onClick:()=>C(n),style:R(o,!1),children:n},n)}),
101
+ /* @__PURE__ */Ke("button",{type:"button","aria-label":m.nextPage,disabled:y===S,onClick:()=>C(y+1),style:R(!1,y===S),children:/* @__PURE__ */Ke(T,{d:"9 18 15 12 9 6"})}),a&&/* @__PURE__ */Ye("button",{type:"button","aria-label":m.lastPage,disabled:y===S,onClick:()=>C(S),style:R(!1,y===S),children:[/* @__PURE__ */Ke(T,{d:"4 18 10 12 4 6"}),/* @__PURE__ */Ke(T,{d:"14 18 20 12 14 6"})]}),l&&/* @__PURE__ */Ye("div",{className:U("flex items-center gap-2 ml-2"),children:[/* @__PURE__ */Ke("label",{htmlFor:f,className:U("text-sm"),style:{color:h.textMuted,fontSize:z.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),/* @__PURE__ */Ke("select",{id:f,value:v,onChange:e=>{return t=Number(e.target.value),w(t),s?.(t),void C(1);var t},style:{height:z.height,paddingLeft:z.px,paddingRight:z.px,fontSize:z.fontSize,borderRadius:"8px",border:`1px solid ${h.border}`,backgroundColor:h.surface,color:h.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:d.map(e=>/* @__PURE__ */Ke("option",{value:e,children:e},e))})]})]})]})}An.displayName="TkxPagination";var Bn={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},En={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function Hn({color:e,size:t}){/* @__PURE__ */
102
102
  return Ye("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:1.5,"aria-hidden":"true",children:[
103
103
  /* @__PURE__ */Ke("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),
104
104
  /* @__PURE__ */Ke("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),
105
- /* @__PURE__ */Ke("path",{d:"M21 15l-5-5L5 21"})]})}function Fn({src:e,alt:t,fallback:n,placeholder:o="skeleton",fit:r="cover",ratio:i="auto",radius:a="none",caption:l,lazy:s=!0,preview:d=!1,className:c,style:u,...h}){const p=N(),f=ge(),[m,g]=Ve(!1),[x,b]=Ve(!1),[y,v]=Ve(!1),w=Oe(null),k=F(e),S=t?F(t):"",C=l?F(l):"",$=En[a];Ee(()=>{w.current?.complete&&g(!0)},[]);const z=Ae(()=>g(!0),[]),M=Ae(()=>b(!0),[]),I=Ae(()=>{d&&!x&&v(!0)},[d,x]),L=Ae(()=>v(!1),[]);Ee(()=>{if(!y)return;const e=e=>{"Escape"===e.key&&L()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[y,L]);const R="skeleton"===o&&!m&&!x,D=R&&!f?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},T=x?null:/* @__PURE__ */Ke("img",{ref:w,src:k,alt:S||void 0,role:S?void 0:"img","aria-label":S?void 0:"Image",loading:s?"lazy":void 0,onLoad:z,onError:M,onClick:d?I:void 0,className:le(U("block w-full h-full"),d&&!x?U("cursor-pointer"):""),style:{objectFit:r,borderRadius:$,opacity:m?1:0,transition:f?"none":"opacity 200ms ease",position:"auto"===i?void 0:"absolute",inset:"auto"===i?void 0:0},...h}),W=x?n?/* @__PURE__ */Ke(Ue,{children:n}):/* @__PURE__ */Ye("div",{role:"img","aria-label":S||"Image failed to load",className:U("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:p.surfaceAlt,borderRadius:$,color:p.textMuted,minHeight:"80px"},children:[/* @__PURE__ */Ke(Hn,{color:p.textMuted,size:32}),/* @__PURE__ */Ke("span",{className:U("text-xs"),style:{color:p.textMuted},children:"Failed to load"})]}):null,A=R?/* @__PURE__ */Ke("div",{"aria-hidden":"true",style:{position:"auto"===i?void 0:"absolute",inset:"auto"===i?void 0:0,width:"100%",height:"auto"===i?"100%":void 0,minHeight:"auto"===i?"80px":void 0,borderRadius:$,backgroundColor:p.surfaceAlt,...D}}):null,B=/* @__PURE__ */Ye("div","auto"===i?{className:U("relative w-full"),style:{borderRadius:$},children:[A,T,W]}:{className:U("relative w-full overflow-hidden"),style:{paddingBottom:Bn[i],borderRadius:$},children:[A,T,W]}),E=C?/* @__PURE__ */Ye("figure",{className:U("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:$},children:[B,/* @__PURE__ */Ke("figcaption",{className:U("text-sm text-center"),style:{color:p.textMuted},children:C})]}):B;/* @__PURE__ */
106
- return Ye(Ue,{children:[/* @__PURE__ */Ke("div",{className:le(U("inline-block w-full"),c),style:u,children:E}),y&&"undefined"!=typeof document?Xe(/* @__PURE__ */Ye("div",{role:"dialog","aria-modal":"true","aria-label":S||"Image preview",className:U("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:L,children:[
105
+ /* @__PURE__ */Ke("path",{d:"M21 15l-5-5L5 21"})]})}function Fn({src:e,alt:t,fallback:n,placeholder:o="skeleton",fit:r="cover",ratio:i="auto",radius:a="none",caption:l,lazy:s=!0,preview:d=!1,className:c,style:u,...h}){const p=M(),f=ge(),[m,g]=Ve(!1),[x,b]=Ve(!1),[y,v]=Ve(!1),w=Oe(null),k=F(e),S=t?F(t):"",C=l?F(l):"",$=En[a];Ee(()=>{w.current?.complete&&g(!0)},[]);const z=Ae(()=>g(!0),[]),N=Ae(()=>b(!0),[]),I=Ae(()=>{d&&!x&&v(!0)},[d,x]),R=Ae(()=>v(!1),[]);Ee(()=>{if(!y)return;const e=e=>{"Escape"===e.key&&R()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[y,R]);const T="skeleton"===o&&!m&&!x,D=T&&!f?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},L=x?null:/* @__PURE__ */Ke("img",{ref:w,src:k,alt:S||void 0,role:S?void 0:"img","aria-label":S?void 0:"Image",loading:s?"lazy":void 0,onLoad:z,onError:N,onClick:d?I:void 0,className:le(U("block w-full h-full"),d&&!x?U("cursor-pointer"):""),style:{objectFit:r,borderRadius:$,opacity:m?1:0,transition:f?"none":"opacity 200ms ease",position:"auto"===i?void 0:"absolute",inset:"auto"===i?void 0:0},...h}),W=x?n?/* @__PURE__ */Ke(Ue,{children:n}):/* @__PURE__ */Ye("div",{role:"img","aria-label":S||"Image failed to load",className:U("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:p.surfaceAlt,borderRadius:$,color:p.textMuted,minHeight:"80px"},children:[/* @__PURE__ */Ke(Hn,{color:p.textMuted,size:32}),/* @__PURE__ */Ke("span",{className:U("text-xs"),style:{color:p.textMuted},children:"Failed to load"})]}):null,A=T?/* @__PURE__ */Ke("div",{"aria-hidden":"true",style:{position:"auto"===i?void 0:"absolute",inset:"auto"===i?void 0:0,width:"100%",height:"auto"===i?"100%":void 0,minHeight:"auto"===i?"80px":void 0,borderRadius:$,backgroundColor:p.surfaceAlt,...D}}):null,B=/* @__PURE__ */Ye("div","auto"===i?{className:U("relative w-full"),style:{borderRadius:$},children:[A,L,W]}:{className:U("relative w-full overflow-hidden"),style:{paddingBottom:Bn[i],borderRadius:$},children:[A,L,W]}),E=C?/* @__PURE__ */Ye("figure",{className:U("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:$},children:[B,/* @__PURE__ */Ke("figcaption",{className:U("text-sm text-center"),style:{color:p.textMuted},children:C})]}):B;/* @__PURE__ */
106
+ return Ye(Ue,{children:[/* @__PURE__ */Ke("div",{className:le(U("inline-block w-full"),c),style:u,children:E}),y&&"undefined"!=typeof document?Xe(/* @__PURE__ */Ye("div",{role:"dialog","aria-modal":"true","aria-label":S||"Image preview",className:U("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:R,children:[
107
107
  /* @__PURE__ */Ke("div",{"aria-hidden":"true",className:U("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),
108
108
  /* @__PURE__ */Ke("img",{src:k,alt:S||"Full-size preview",onClick:e=>e.stopPropagation(),className:U("relative z-10 max-w-full max-h-full"),style:{objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)"}}),
109
- /* @__PURE__ */Ke("button",{"aria-label":"Close preview",onClick:L,className:U("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:/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null]})}function jn(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Pn({mimeType:e,color:t}){return e.startsWith("image/")?/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[
109
+ /* @__PURE__ */Ke("button",{"aria-label":"Close preview",onClick:R,className:U("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:/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null]})}function jn(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Pn({mimeType:e,color:t}){return e.startsWith("image/")?/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[
110
110
  /* @__PURE__ */Ke("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),
111
111
  /* @__PURE__ */Ke("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),
112
112
  /* @__PURE__ */Ke("path",{d:"M21 15l-5-5L5 21"})]}):/* @__PURE__ */Ye("svg","application/pdf"===e?{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[
113
113
  /* @__PURE__ */Ke("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),
114
114
  /* @__PURE__ */Ke("polyline",{points:"14 2 14 8 20 8"}),
115
115
  /* @__PURE__ */Ke("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),
116
- /* @__PURE__ */Ke("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}:{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[/* @__PURE__ */Ke("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),/* @__PURE__ */Ke("polyline",{points:"14 2 14 8 20 8"})]})}var On=0;function Vn({accept:e,multiple:t=!1,maxSize:n,maxFiles:o,onChange:r,onError:i,label:a,hint:l,isDisabled:s=!1,preview:d=!0,dragDrop:c=!0,variant:u="dropzone"}){const h=N(),p=$e(),f=a??p.uploadFiles??"Upload files",m=p.dropFiles?.replace(/^.*$/,p.dropFiles)??"Drop files here",g=ge(),x=He(),b=Oe(null),[y,v]=Ve(!1),[w,k]=Ve([]);Ee(()=>()=>{w.forEach(e=>{e.objectUrl&&URL.revokeObjectURL(e.objectUrl)})},[]);const S=Ae(e=>{let t=0;const n=setInterval(()=>{t+=Math.floor(20*Math.random())+10,t>=100&&(t=100,clearInterval(n)),k(n=>n.map(n=>n.id===e?{...n,progress:t}:n))},100)},[]),C=Ae(t=>n&&t.size>n?`"${F(t.name)}" exceeds max size of ${jn(n)}`:/[\u0000-\u001F\u007F]|\.\.\/|\.\.\\/.test(t.name)?`"${F(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)?`"${F(t.name)}" is not an accepted file type`:void 0,[e,n]),$=Ae(async e=>{if(!e.error)try{const t=await Q(e.file);if(t&&e.file.type&&!e.file.type.startsWith(t.split("/")[0])){const t=`"${F(e.file.name)}" file content does not match its type`;k(n=>n.map(n=>n.id===e.id?{...n,error:t}:n)),i?.(t)}}catch{}},[i]),z=Ae(e=>{const n=o?o-w.length:1/0;if(n<=0)return void i?.(`Maximum of ${o} file${1===o?"":"s"} allowed`);const a=e.slice(0,n).map(e=>{const t=C(e),n=d&&e.type.startsWith("image/")&&!t?URL.createObjectURL(e):void 0;return{file:e,id:"tkx-file-"+ ++On,objectUrl:n,progress:0,error:t}});k(e=>{const n=t?[...e,...a]:a,o=n.filter(e=>!e.error).map(e=>e.file);return r?.(o),n}),a.forEach(e=>{e.error?i?.(e.error):$(e)}),a.forEach(e=>{e.error||S(e.id)})},[w.length,o,t,r,i,d,S,C]),M=Ae(e=>{const t=Array.from(e.target.files??[]);t.length&&z(t),e.target.value=""},[z]),I=Ae(e=>{if(e.preventDefault(),v(!1),s)return;const t=Array.from(e.dataTransfer.files);t.length&&z(t)},[s,z]),L=Ae(e=>{e.preventDefault(),s||v(!0)},[s]),R=Ae(()=>v(!1),[]),D=Ae(e=>{k(t=>{const n=t.find(t=>t.id===e);n?.objectUrl&&URL.revokeObjectURL(n.objectUrl);const o=t.filter(t=>t.id!==e);return r?.(o.filter(e=>!e.error).map(e=>e.file)),o})},[r]),T=Ae(()=>{s||b.current?.click()},[s]),W=y?h.primary:h.border,A=F(f),B=l?F(l):"",E=/* @__PURE__ */Ye("div",{role:"button",tabIndex:s?-1:0,"aria-label":A,"aria-describedby":l?x:void 0,"aria-disabled":s,onClick:T,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T())},onDrop:c?I:void 0,onDragOver:c?L:void 0,onDragLeave:c?R:void 0,className:U("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${W}`,backgroundColor:y?`${h.primary}10`:h.surface,cursor:s?"not-allowed":"pointer",opacity:s?.5:1,transition:g?"none":"border-color 150ms ease, background-color 150ms ease",outline:"none"},children:[/* @__PURE__ */Ye("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:y?h.primary:h.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[
116
+ /* @__PURE__ */Ke("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}:{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[/* @__PURE__ */Ke("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),/* @__PURE__ */Ke("polyline",{points:"14 2 14 8 20 8"})]})}var On=0;function Vn({accept:e,multiple:t=!1,maxSize:n,maxFiles:o,onChange:r,onError:i,label:a,hint:l,isDisabled:s=!1,preview:d=!0,dragDrop:c=!0,variant:u="dropzone"}){const h=M(),p=$e(),f=a??p.uploadFiles??"Upload files",m=p.dropFiles?.replace(/^.*$/,p.dropFiles)??"Drop files here",g=ge(),x=He(),b=Oe(null),[y,v]=Ve(!1),[w,k]=Ve([]);Ee(()=>()=>{w.forEach(e=>{e.objectUrl&&URL.revokeObjectURL(e.objectUrl)})},[]);const S=Ae(e=>{let t=0;const n=setInterval(()=>{t+=Math.floor(20*Math.random())+10,t>=100&&(t=100,clearInterval(n)),k(n=>n.map(n=>n.id===e?{...n,progress:t}:n))},100)},[]),C=Ae(t=>n&&t.size>n?`"${F(t.name)}" exceeds max size of ${jn(n)}`:/[\u0000-\u001F\u007F]|\.\.\/|\.\.\\/.test(t.name)?`"${F(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)?`"${F(t.name)}" is not an accepted file type`:void 0,[e,n]),$=Ae(async e=>{if(!e.error)try{const t=await Q(e.file);if(t&&e.file.type&&!e.file.type.startsWith(t.split("/")[0])){const t=`"${F(e.file.name)}" file content does not match its type`;k(n=>n.map(n=>n.id===e.id?{...n,error:t}:n)),i?.(t)}}catch{}},[i]),z=Ae(e=>{const n=o?o-w.length:1/0;if(n<=0)return void i?.(`Maximum of ${o} file${1===o?"":"s"} allowed`);const a=e.slice(0,n).map(e=>{const t=C(e),n=d&&e.type.startsWith("image/")&&!t?URL.createObjectURL(e):void 0;return{file:e,id:"tkx-file-"+ ++On,objectUrl:n,progress:0,error:t}});k(e=>{const n=t?[...e,...a]:a,o=n.filter(e=>!e.error).map(e=>e.file);return r?.(o),n}),a.forEach(e=>{e.error?i?.(e.error):$(e)}),a.forEach(e=>{e.error||S(e.id)})},[w.length,o,t,r,i,d,S,C]),N=Ae(e=>{const t=Array.from(e.target.files??[]);t.length&&z(t),e.target.value=""},[z]),I=Ae(e=>{if(e.preventDefault(),v(!1),s)return;const t=Array.from(e.dataTransfer.files);t.length&&z(t)},[s,z]),R=Ae(e=>{e.preventDefault(),s||v(!0)},[s]),T=Ae(()=>v(!1),[]),D=Ae(e=>{k(t=>{const n=t.find(t=>t.id===e);n?.objectUrl&&URL.revokeObjectURL(n.objectUrl);const o=t.filter(t=>t.id!==e);return r?.(o.filter(e=>!e.error).map(e=>e.file)),o})},[r]),L=Ae(()=>{s||b.current?.click()},[s]),W=y?h.primary:h.border,A=F(f),B=l?F(l):"",E=/* @__PURE__ */Ye("div",{role:"button",tabIndex:s?-1:0,"aria-label":A,"aria-describedby":l?x:void 0,"aria-disabled":s,onClick:L,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),L())},onDrop:c?I:void 0,onDragOver:c?R:void 0,onDragLeave:c?T:void 0,className:U("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${W}`,backgroundColor:y?`${h.primary}10`:h.surface,cursor:s?"not-allowed":"pointer",opacity:s?.5:1,transition:g?"none":"border-color 150ms ease, background-color 150ms ease",outline:"none"},children:[/* @__PURE__ */Ye("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:y?h.primary:h.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[
117
117
  /* @__PURE__ */Ke("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
118
118
  /* @__PURE__ */Ke("polyline",{points:"17 8 12 3 7 8"}),
119
- /* @__PURE__ */Ke("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),/* @__PURE__ */Ye("div",{className:U("text-center"),children:[/* @__PURE__ */Ke("p",{className:U("m-0 text-sm font-medium"),style:{color:h.text},children:y?m:A}),B&&/* @__PURE__ */Ke("p",{id:x,className:U("m-0 text-xs mt-1"),style:{color:h.textMuted},children:B})]})]}),H=/* @__PURE__ */Ye("button",{type:"button",disabled:s,onClick:T,"aria-describedby":l?x:void 0,className:U("flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer"),style:{backgroundColor:h.primary,color:h.bg,opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},children:[
119
+ /* @__PURE__ */Ke("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),/* @__PURE__ */Ye("div",{className:U("text-center"),children:[/* @__PURE__ */Ke("p",{className:U("m-0 text-sm font-medium"),style:{color:h.text},children:y?m:A}),B&&/* @__PURE__ */Ke("p",{id:x,className:U("m-0 text-xs mt-1"),style:{color:h.textMuted},children:B})]})]}),H=/* @__PURE__ */Ye("button",{type:"button",disabled:s,onClick:L,"aria-describedby":l?x:void 0,className:U("flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer"),style:{backgroundColor:h.primary,color:h.bg,opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},children:[
120
120
  /* @__PURE__ */Ye("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[
121
121
  /* @__PURE__ */Ke("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
122
122
  /* @__PURE__ */Ke("polyline",{points:"17 8 12 3 7 8"}),
123
123
  /* @__PURE__ */Ke("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),A,l&&/* @__PURE__ */Ke("span",{id:x,className:U("sr-only"),children:B})]});/* @__PURE__ */
124
124
  return Ye("div",{className:U("flex flex-col gap-3 w-full font-sans"),children:[
125
- /* @__PURE__ */Ke("input",{ref:b,type:"file",accept:e,multiple:t,disabled:s,onChange:M,className:U("sr-only"),tabIndex:-1,"aria-hidden":"true"}),"dropzone"===u?E:H,w.length>0&&/* @__PURE__ */Ke("ul",{role:"status","aria-live":"polite","aria-label":p.uploadFiles??"Uploaded files",className:U("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:w.map(e=>/* @__PURE__ */Ye("li",{className:U("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:h.surfaceAlt,border:`1px solid ${e.error?h.danger:h.border}`},children:[/* @__PURE__ */Ye("div",{className:U("flex items-center gap-3"),children:[e.objectUrl&&d?/* @__PURE__ */Ke("img",{src:e.objectUrl,alt:F(e.file.name),className:U("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):/* @__PURE__ */Ke("span",{style:{flexShrink:0},children:/* @__PURE__ */Ke(Pn,{mimeType:e.file.type,color:e.error?h.danger:h.textMuted})}),
125
+ /* @__PURE__ */Ke("input",{ref:b,type:"file",accept:e,multiple:t,disabled:s,onChange:N,className:U("sr-only"),tabIndex:-1,"aria-hidden":"true"}),"dropzone"===u?E:H,w.length>0&&/* @__PURE__ */Ke("ul",{role:"status","aria-live":"polite","aria-label":p.uploadFiles??"Uploaded files",className:U("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:w.map(e=>/* @__PURE__ */Ye("li",{className:U("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:h.surfaceAlt,border:`1px solid ${e.error?h.danger:h.border}`},children:[/* @__PURE__ */Ye("div",{className:U("flex items-center gap-3"),children:[e.objectUrl&&d?/* @__PURE__ */Ke("img",{src:e.objectUrl,alt:F(e.file.name),className:U("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):/* @__PURE__ */Ke("span",{style:{flexShrink:0},children:/* @__PURE__ */Ke(Pn,{mimeType:e.file.type,color:e.error?h.danger:h.textMuted})}),
126
126
  /* @__PURE__ */Ye("div",{className:U("flex flex-col gap-0.5 flex-1 min-w-0"),children:[/* @__PURE__ */Ke("span",{className:U("text-sm font-medium truncate"),style:{color:e.error?h.danger:h.text},title:e.file.name,children:F(e.file.name)}),/* @__PURE__ */Ye("span",{className:U("text-xs"),style:{color:h.textMuted},children:[jn(e.file.size),e.error&&` — ${e.error}`]})]}),
127
127
  /* @__PURE__ */Ke("button",{type:"button","aria-label":`Remove ${F(e.file.name)}`,onClick:()=>D(e.id),className:U("flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1"),style:{color:h.textMuted,flexShrink:0},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!e.error&&e.progress<100&&/* @__PURE__ */Ke("div",{className:U("w-full overflow-hidden"),style:{height:"3px",borderRadius:"3px",backgroundColor:h.border},"aria-hidden":"true",children:/* @__PURE__ */Ke("div",{style:{height:"100%",borderRadius:"3px",backgroundColor:h.primary,width:`${e.progress}%`,transition:g?"none":"width 100ms ease"}})})]},e.id))})]})}var Un={sm:16,md:24,lg:32,xl:40};function Kn({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
128
128
  return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ke("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ke("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ke("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ke("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 Yn({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
129
129
  return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ke("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ke("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ke("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ke("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 Xn({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
130
130
  return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ke("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ke("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ke("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ke("circle",{cx:"12",cy:"12",r:"9",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5})]})}function qn({type:e,size:t,filled:n,color:o,halfFilled:r,uid:i}){/* @__PURE__ */
131
- return Ke("heart"===e?Yn:"circle"===e?Xn:Kn,{size:t,filled:n,color:o,halfFilled:r,id:i})}function Gn(e,t,n){return Math.min(n,Math.max(t,e))}function _n(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}function Zn({value:e,defaultValue:t=0,onChange:n,max:o=5,precision:r=1,size:i="md",isReadOnly:a=!1,isDisabled:l=!1,label:s,showValue:d=!1,colorScheme:c="warning",emptyIcon:u="star",filledIcon:h="star"}){const p=N(),f=ge(),m=He(),g=void 0!==e,[x,b]=Ve(t),[y,v]=Ve(null),w=Oe(null),k=g?e??0:x,S=y??k,C={warning:p.warning,primary:p.primary,danger:p.danger}[c]??p.warning,$=Un[i],z=!a&&!l,M=Ae(e=>{g||b(e),n?.(e)},[g,n]),I=Ae((e,t)=>{z&&v(_n(e,t,r))},[z,r]),L=Ae(()=>{z&&v(null)},[z]),R=Ae((e,t)=>{if(!z)return;const n=_n(e,t,r);M(n===k?0:n)},[z,r,k,M]),D=Ae(e=>{if(!z)return;const t=r;let n=k;if("ArrowRight"===e.key||"ArrowUp"===e.key)e.preventDefault(),n=Gn(k+t,0,o);else if("ArrowLeft"===e.key||"ArrowDown"===e.key)e.preventDefault(),n=Gn(k-t,0,o);else if("Home"===e.key)e.preventDefault(),n=0;else{if("End"!==e.key)return;e.preventDefault(),n=o}n=function(e,t){return 1===t?Math.round(e):Math.round(2*e)/2}(n,r),M(n)},[z,k,o,r,M]),T=s?F(s):"Rating";/* @__PURE__ */
132
- return Ye("div",{className:le(U("inline-flex items-center gap-2 font-sans"),l?U("opacity-50"):""),children:[/* @__PURE__ */Ke("div",{ref:w,role:"radiogroup","aria-label":T,"aria-disabled":l,"aria-readonly":a,tabIndex:z?0:-1,onKeyDown:D,onMouseLeave:L,className:U("flex items-center gap-0.5 outline-none"),style:{cursor:z?"pointer":"default"},children:Array.from({length:o},(e,t)=>{const n=t+1,o=t+.5,i=S>=n,a=!i&&.5===r&&S>=o,l=`${m}-${t}`;/* @__PURE__ */
133
- return Ke("span",{role:"radio","aria-checked":.5===r&&k===o||k===n,"aria-label":.5===r?`${o} star${1!==o?"s":""} / ${n} star${1!==n?"s":""}`:`${n} star${1!==n?"s":""}`,tabIndex:-1,onMouseMove:e=>I(e,t),onClick:e=>R(e,t),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:f?"none":"transform 120ms ease",transform:null!==y&&S>=o&&z?"scale(1.15)":"scale(1)"},children:/* @__PURE__ */Ke(qn,{type:i||a?h:u,size:$,filled:i,halfFilled:a,color:i||a?C:p.border,uid:a?l:void 0})},t)})}),d&&/* @__PURE__ */Ye("span",{className:U("text-sm tabular-nums"),style:{color:p.textMuted},"aria-live":"polite","aria-atomic":"true",children:[k%1==0?k.toFixed(0):k.toFixed(1)," / ",o]})]})}var Jn=!1;function Qn(){/* @__PURE__ */
131
+ return Ke("heart"===e?Yn:"circle"===e?Xn:Kn,{size:t,filled:n,color:o,halfFilled:r,id:i})}function Gn(e,t,n){return Math.min(n,Math.max(t,e))}function Jn(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}function _n({value:e,defaultValue:t=0,onChange:n,max:o=5,precision:r=1,size:i="md",isReadOnly:a=!1,isDisabled:l=!1,label:s,showValue:d=!1,colorScheme:c="warning",emptyIcon:u="star",filledIcon:h="star"}){const p=M(),f=ge(),m=He(),g=void 0!==e,[x,b]=Ve(t),[y,v]=Ve(null),w=Oe(null),k=g?e??0:x,S=y??k,C={warning:p.warning,primary:p.primary,danger:p.danger}[c]??p.warning,$=Un[i],z=!a&&!l,N=Ae(e=>{g||b(e),n?.(e)},[g,n]),I=Ae((e,t)=>{z&&v(Jn(e,t,r))},[z,r]),R=Ae(()=>{z&&v(null)},[z]),T=Ae((e,t)=>{if(!z)return;const n=Jn(e,t,r);N(n===k?0:n)},[z,r,k,N]),D=Ae(e=>{if(!z)return;const t=r;let n=k;if("ArrowRight"===e.key||"ArrowUp"===e.key)e.preventDefault(),n=Gn(k+t,0,o);else if("ArrowLeft"===e.key||"ArrowDown"===e.key)e.preventDefault(),n=Gn(k-t,0,o);else if("Home"===e.key)e.preventDefault(),n=0;else{if("End"!==e.key)return;e.preventDefault(),n=o}n=function(e,t){return 1===t?Math.round(e):Math.round(2*e)/2}(n,r),N(n)},[z,k,o,r,N]),L=s?F(s):"Rating";/* @__PURE__ */
132
+ return Ye("div",{className:le(U("inline-flex items-center gap-2 font-sans"),l?U("opacity-50"):""),children:[/* @__PURE__ */Ke("div",{ref:w,role:"radiogroup","aria-label":L,"aria-disabled":l,"aria-readonly":a,tabIndex:z?0:-1,onKeyDown:D,onMouseLeave:R,className:U("flex items-center gap-0.5 outline-none"),style:{cursor:z?"pointer":"default"},children:Array.from({length:o},(e,t)=>{const n=t+1,o=t+.5,i=S>=n,a=!i&&.5===r&&S>=o,l=`${m}-${t}`;/* @__PURE__ */
133
+ return Ke("span",{role:"radio","aria-checked":.5===r&&k===o||k===n,"aria-label":.5===r?`${o} star${1!==o?"s":""} / ${n} star${1!==n?"s":""}`:`${n} star${1!==n?"s":""}`,tabIndex:-1,onMouseMove:e=>I(e,t),onClick:e=>T(e,t),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:f?"none":"transform 120ms ease",transform:null!==y&&S>=o&&z?"scale(1.15)":"scale(1)"},children:/* @__PURE__ */Ke(qn,{type:i||a?h:u,size:$,filled:i,halfFilled:a,color:i||a?C:p.border,uid:a?l:void 0})},t)})}),d&&/* @__PURE__ */Ye("span",{className:U("text-sm tabular-nums"),style:{color:p.textMuted},"aria-live":"polite","aria-atomic":"true",children:[k%1==0?k.toFixed(0):k.toFixed(1)," / ",o]})]})}var Zn=!1;function Qn(){/* @__PURE__ */
134
134
  return Ye("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[
135
135
  /* @__PURE__ */Ke("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),
136
136
  /* @__PURE__ */Ke("circle",{cx:"14",cy:"11",r:"4",fill:"currentColor"}),
137
137
  /* @__PURE__ */Ke("path",{d:"M6 24c0-4.418 3.582-8 8-8s8 3.582 8 8",fill:"currentColor"})]})}function eo(){/* @__PURE__ */
138
- return Ye("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),/* @__PURE__ */Ke("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 to(){const e=N();/* @__PURE__ */
138
+ return Ye("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),/* @__PURE__ */Ke("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 to(){const e=M();/* @__PURE__ */
139
139
  return Ye("div",{className:U("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:[
140
140
  /* @__PURE__ */Ke("span",{className:"tkx-dot1 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),
141
141
  /* @__PURE__ */Ke("span",{className:"tkx-dot2 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),
142
- /* @__PURE__ */Ke("span",{className:"tkx-dot3 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}})]})}function no({message:e,showTimestamp:t,avatarUser:n,avatarAssistant:o}){const r=N(),i=ge(),{role:a,content:l,timestamp:s,isStreaming:d,error:c}=e,u=F(l),h=s?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(s):null;if("system"===a)/* @__PURE__ */return Ke("div",{role:"listitem",className:U("flex justify-center my-2"),children:/* @__PURE__ */Ke("p",{className:U("text-xs italic px-3 py-1 rounded-full"),style:{color:r.textMuted,backgroundColor:r.surfaceAlt},children:u})});const p="user"===a,f=p?n??/* @__PURE__ */Ke(Qn,{}):o??/* @__PURE__ */Ke(eo,{}),m=p?{backgroundColor:r.primary,color:r.bg}:{backgroundColor:r.surface,color:r.text,border:`1px solid ${c?r.danger:r.border}`};return c&&(m.borderColor=r.danger,m.borderWidth="2px"),/* @__PURE__ */Ye("div",{role:"listitem",className:U("flex gap-2 mb-4",p?"flex-row-reverse":"flex-row"),children:[/* @__PURE__ */Ke("div",{className:U("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:p?r.primary:r.secondary},children:f}),/* @__PURE__ */Ye("div",{className:U("flex flex-col gap-1 max-w-[75%]",p?"items-end":"items-start"),children:[/* @__PURE__ */Ye("div",{className:le(U("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),d&&!i?"tkx-cursor":""),style:m,children:[u,c&&/* @__PURE__ */Ke("span",{"aria-label":"Error",style:{marginLeft:6,color:r.danger},children:"⚠"})]}),t&&h&&/* @__PURE__ */Ke("span",{className:U("text-[10px]"),style:{color:r.textMuted},children:h})]})]})}function oo({messages:e,onSend:t,isLoading:n=!1,placeholder:o="Type a message…",maxLength:r,showTimestamps:i=!1,avatarUser:a,avatarAssistant:l,height:s=480,inputPosition:d="bottom"}){const c=N(),u=ge(),[h,p]=Ve(""),f=Oe(null),m=Oe(null);Ee(()=>{!function(){if(Jn||"undefined"==typeof document)return;Jn=!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)}()},[]),Ee(()=>{const e=f.current;e&&e.scrollTo({top:e.scrollHeight,behavior:u?"auto":"smooth"})},[e,n,u]);const g=Ae(()=>{const e=h.trim();e&&t&&(t(e),p(""),m.current&&(m.current.style.height="auto"))},[h,t]),x=Ae(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),g())},[g]),b=Ae(e=>{p(r?e.target.value.slice(0,r):e.target.value);const t=m.current;if(t){t.style.height="auto";const e=120;t.style.height=`${Math.min(t.scrollHeight,e)}px`}},[r]),y=h.trim().length>0&&!n,v="number"==typeof s?`${s}px`:s,w="floating"===d,k=/* @__PURE__ */Ye("div",{className:U("flex flex-col gap-1 p-3"),style:w?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:c.surface,border:`1px solid ${c.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${c.border}`,backgroundColor:c.surface},children:[/* @__PURE__ */Ye("div",{className:U("flex items-end gap-2"),children:[/* @__PURE__ */Ke("textarea",{ref:m,rows:1,value:h,onChange:b,onKeyDown:x,placeholder:F(o),"aria-label":"Message input","aria-multiline":"true",disabled:n,className:U("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:c.text,caretColor:c.primary,minHeight:32,maxHeight:120}}),/* @__PURE__ */Ke("button",{onClick:g,disabled:!y,"aria-label":"Send message",className:U("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!u&&"transition-opacity duration-150",y?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:c.primary,color:c.bg},children:/* @__PURE__ */Ke("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z",fill:"currentColor"})})})]}),r&&/* @__PURE__ */Ye("div",{className:U("text-right text-[10px]"),style:{color:c.textMuted},children:[h.length,"/",r]})]});/* @__PURE__ */
143
- return Ye("div",{className:U("flex flex-col overflow-hidden rounded-2xl"),style:{height:v,backgroundColor:c.bg,border:`1px solid ${c.border}`,position:"relative"},children:[/* @__PURE__ */Ke("div",{ref:f,role:"log","aria-live":"polite","aria-label":"Chat messages",className:U("flex-1 overflow-y-auto p-4"),style:{paddingBottom:w?80:void 0},children:/* @__PURE__ */Ye("div",{role:"list",children:[e.map(e=>/* @__PURE__ */Ke(no,{message:e,showTimestamp:i,avatarUser:a,avatarAssistant:l},e.id)),n&&/* @__PURE__ */Ye("div",{role:"listitem",className:U("flex gap-2 mb-4"),children:[/* @__PURE__ */Ke("div",{className:U("w-8 h-8 shrink-0")}),/* @__PURE__ */Ke(to,{})]})]})}),k]})}var ro={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},io={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},ao={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},lo={sm:12,md:14,lg:16};function so({variant:e="subtle",size:t="md",colorScheme:n="default",onRemove:o,leftIcon:r,isDisabled:i=!1,clickable:a=!1,children:l,className:s,style:d,onClick:c,...u}){N();const h=ge(),p=function(e,t){const n=N(),o={default:n.textMuted,primary:n.primary,secondary:n.secondary,success:n.success,danger:n.danger,warning:n.warning,info:n.info}[e];return"solid"===t?{bg:o,color:n.bg,border:"transparent"}:"subtle"===t?{bg:`${o}22`,color:o,border:"transparent"}:{bg:"transparent",color:o,border:o}}(n,e),f="string"==typeof l?F(l):l,m=lo[t],g=U("inline-flex items-center font-medium rounded-full select-none",ro[t],io[t],ao[t],i?"opacity-50 cursor-not-allowed":a?"cursor-pointer":"cursor-default",a&&!h&&"transition-opacity duration-150");/* @__PURE__ */
142
+ /* @__PURE__ */Ke("span",{className:"tkx-dot3 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}})]})}function no({message:e,showTimestamp:t,avatarUser:n,avatarAssistant:o}){const r=M(),i=ge(),{role:a,content:l,timestamp:s,isStreaming:d,error:c}=e,u=F(l),h=s?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(s):null;if("system"===a)/* @__PURE__ */return Ke("div",{role:"listitem",className:U("flex justify-center my-2"),children:/* @__PURE__ */Ke("p",{className:U("text-xs italic px-3 py-1 rounded-full"),style:{color:r.textMuted,backgroundColor:r.surfaceAlt},children:u})});const p="user"===a,f=p?n??/* @__PURE__ */Ke(Qn,{}):o??/* @__PURE__ */Ke(eo,{}),m=p?{backgroundColor:r.primary,color:r.bg}:{backgroundColor:r.surface,color:r.text,border:`1px solid ${c?r.danger:r.border}`};return c&&(m.borderColor=r.danger,m.borderWidth="2px"),/* @__PURE__ */Ye("div",{role:"listitem",className:U("flex gap-2 mb-4",p?"flex-row-reverse":"flex-row"),children:[/* @__PURE__ */Ke("div",{className:U("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:p?r.primary:r.secondary},children:f}),/* @__PURE__ */Ye("div",{className:U("flex flex-col gap-1 max-w-[75%]",p?"items-end":"items-start"),children:[/* @__PURE__ */Ye("div",{className:le(U("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),d&&!i?"tkx-cursor":""),style:m,children:[u,c&&/* @__PURE__ */Ke("span",{"aria-label":"Error",style:{marginLeft:6,color:r.danger},children:"⚠"})]}),t&&h&&/* @__PURE__ */Ke("span",{className:U("text-[10px]"),style:{color:r.textMuted},children:h})]})]})}function oo({messages:e,onSend:t,isLoading:n=!1,placeholder:o="Type a message…",maxLength:r,showTimestamps:i=!1,avatarUser:a,avatarAssistant:l,height:s=480,inputPosition:d="bottom"}){const c=M(),u=ge(),[h,p]=Ve(""),f=Oe(null),m=Oe(null);Ee(()=>{!function(){if(Zn||"undefined"==typeof document)return;Zn=!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)}()},[]),Ee(()=>{const e=f.current;e&&e.scrollTo({top:e.scrollHeight,behavior:u?"auto":"smooth"})},[e,n,u]);const g=Ae(()=>{const e=h.trim();e&&t&&(t(e),p(""),m.current&&(m.current.style.height="auto"))},[h,t]),x=Ae(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),g())},[g]),b=Ae(e=>{p(r?e.target.value.slice(0,r):e.target.value);const t=m.current;if(t){t.style.height="auto";const e=120;t.style.height=`${Math.min(t.scrollHeight,e)}px`}},[r]),y=h.trim().length>0&&!n,v="number"==typeof s?`${s}px`:s,w="floating"===d,k=/* @__PURE__ */Ye("div",{className:U("flex flex-col gap-1 p-3"),style:w?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:c.surface,border:`1px solid ${c.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${c.border}`,backgroundColor:c.surface},children:[/* @__PURE__ */Ye("div",{className:U("flex items-end gap-2"),children:[/* @__PURE__ */Ke("textarea",{ref:m,rows:1,value:h,onChange:b,onKeyDown:x,placeholder:F(o),"aria-label":"Message input","aria-multiline":"true",disabled:n,className:U("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:c.text,caretColor:c.primary,minHeight:32,maxHeight:120}}),/* @__PURE__ */Ke("button",{onClick:g,disabled:!y,"aria-label":"Send message",className:U("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!u&&"transition-opacity duration-150",y?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:c.primary,color:c.bg},children:/* @__PURE__ */Ke("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z",fill:"currentColor"})})})]}),r&&/* @__PURE__ */Ye("div",{className:U("text-right text-[10px]"),style:{color:c.textMuted},children:[h.length,"/",r]})]});/* @__PURE__ */
143
+ return Ye("div",{className:U("flex flex-col overflow-hidden rounded-2xl"),style:{height:v,backgroundColor:c.bg,border:`1px solid ${c.border}`,position:"relative"},children:[/* @__PURE__ */Ke("div",{ref:f,role:"log","aria-live":"polite","aria-label":"Chat messages",className:U("flex-1 overflow-y-auto p-4"),style:{paddingBottom:w?80:void 0},children:/* @__PURE__ */Ye("div",{role:"list",children:[e.map(e=>/* @__PURE__ */Ke(no,{message:e,showTimestamp:i,avatarUser:a,avatarAssistant:l},e.id)),n&&/* @__PURE__ */Ye("div",{role:"listitem",className:U("flex gap-2 mb-4"),children:[/* @__PURE__ */Ke("div",{className:U("w-8 h-8 shrink-0")}),/* @__PURE__ */Ke(to,{})]})]})}),k]})}var ro={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},io={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},ao={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},lo={sm:12,md:14,lg:16};function so({variant:e="subtle",size:t="md",colorScheme:n="default",onRemove:o,leftIcon:r,isDisabled:i=!1,clickable:a=!1,children:l,className:s,style:d,onClick:c,...u}){M();const h=ge(),p=function(e,t){const n=M(),o={default:n.textMuted,primary:n.primary,secondary:n.secondary,success:n.success,danger:n.danger,warning:n.warning,info:n.info}[e];return"solid"===t?{bg:o,color:n.bg,border:"transparent"}:"subtle"===t?{bg:`${o}22`,color:o,border:"transparent"}:{bg:"transparent",color:o,border:o}}(n,e),f="string"==typeof l?F(l):l,m=lo[t],g=U("inline-flex items-center font-medium rounded-full select-none",ro[t],io[t],ao[t],i?"opacity-50 cursor-not-allowed":a?"cursor-pointer":"cursor-default",a&&!h&&"transition-opacity duration-150");/* @__PURE__ */
144
144
  return Ye("span",{role:a?"button":void 0,tabIndex:a&&!i?0:void 0,"aria-disabled":i||void 0,className:le(g,s),style:{backgroundColor:p.bg,color:p.color,border:`1px solid ${"transparent"===p.border?"transparent":p.border}`,...d},onClick:i?void 0:c,onKeyDown:a&&!i&&c?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c(e))}:void 0,...u,children:[r&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("shrink-0 flex items-center"),children:r}),
145
- /* @__PURE__ */Ke("span",{children:f}),o&&!i&&/* @__PURE__ */Ke("button",{type:"button","aria-label":`Remove ${"string"==typeof l?l:"tag"}`,onClick:e=>{e.stopPropagation(),o()},className:U("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:m+4,height:m+4,color:p.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:/* @__PURE__ */Ke("svg",{width:m,height:m,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})})]})}function co({value:e,defaultValue:t=[],onChange:n,placeholder:o="Add tag…",maxTags:r,allowDuplicates:i=!1,validate:a,colorScheme:l="primary",size:s="md",label:d,hint:c,isDisabled:u=!1}){const h=N(),p=ge(),[f,m]=Ve(t),[g,x]=Ve(""),[b,y]=Ve(null),v=Oe(null),w=void 0!==e,k=w?e:f,S=Ae(e=>{w||m(e),n?.(e)},[w,n]),C=Ae(e=>{const t=e.trim();if(t)if(void 0!==r&&k.length>=r)y(`Maximum ${r} tags allowed`);else if(i||!k.includes(t)){if(a){const e=a(t);if(!1===e)return void y("Invalid tag");if("string"==typeof e)return void y(e)}y(null),S([...k,t]),x("")}else y("Duplicate tags are not allowed")},[k,r,i,a,S]),$=Ae(e=>{S(k.filter((t,n)=>n!==e)),y(null)},[k,S]),z=Ae(e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),C(g)):"Backspace"===e.key&&""===g&&k.length>0&&$(k.length-1)},[g,k,C,$]),M=Ae(e=>{const t=e.target.value;t.endsWith(",")?C(t.slice(0,-1)):(x(t),b&&y(null))},[C,b]),I="sm"===s?"6px 8px":"lg"===s?"10px 12px":"8px 10px",L="sm"===s?11:"lg"===s?14:12;/* @__PURE__ */
145
+ /* @__PURE__ */Ke("span",{children:f}),o&&!i&&/* @__PURE__ */Ke("button",{type:"button","aria-label":`Remove ${"string"==typeof l?l:"tag"}`,onClick:e=>{e.stopPropagation(),o()},className:U("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:m+4,height:m+4,color:p.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:/* @__PURE__ */Ke("svg",{width:m,height:m,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})})]})}function co({value:e,defaultValue:t=[],onChange:n,placeholder:o="Add tag…",maxTags:r,allowDuplicates:i=!1,validate:a,colorScheme:l="primary",size:s="md",label:d,hint:c,isDisabled:u=!1}){const h=M(),p=ge(),[f,m]=Ve(t),[g,x]=Ve(""),[b,y]=Ve(null),v=Oe(null),w=void 0!==e,k=w?e:f,S=Ae(e=>{w||m(e),n?.(e)},[w,n]),C=Ae(e=>{const t=e.trim();if(t)if(void 0!==r&&k.length>=r)y(`Maximum ${r} tags allowed`);else if(i||!k.includes(t)){if(a){const e=a(t);if(!1===e)return void y("Invalid tag");if("string"==typeof e)return void y(e)}y(null),S([...k,t]),x("")}else y("Duplicate tags are not allowed")},[k,r,i,a,S]),$=Ae(e=>{S(k.filter((t,n)=>n!==e)),y(null)},[k,S]),z=Ae(e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),C(g)):"Backspace"===e.key&&""===g&&k.length>0&&$(k.length-1)},[g,k,C,$]),N=Ae(e=>{const t=e.target.value;t.endsWith(",")?C(t.slice(0,-1)):(x(t),b&&y(null))},[C,b]),I="sm"===s?"6px 8px":"lg"===s?"10px 12px":"8px 10px",R="sm"===s?11:"lg"===s?14:12;/* @__PURE__ */
146
146
  return Ye("div",{className:U("flex flex-col gap-1.5"),children:[d&&/* @__PURE__ */Ke("label",{className:U("text-sm font-medium"),style:{color:h.text},onClick:()=>v.current?.focus(),children:F(d)}),
147
- /* @__PURE__ */Ye("div",{className:U("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!p&&"transition-colors duration-150"),style:{padding:I,backgroundColor:h.surface,border:`1.5px solid ${b?h.danger:h.border}`,opacity:u?.55:1,minHeight:"sm"===s?36:"lg"===s?48:40},onClick:()=>!u&&v.current?.focus(),children:[k.map((e,t)=>/* @__PURE__ */Ke(so,{size:s,variant:"subtle",colorScheme:l,onRemove:u?void 0:()=>$(t),isDisabled:u,children:e},`${e}-${t}`)),(!r||k.length<r)&&!u&&/* @__PURE__ */Ke("input",{ref:v,type:"text",value:g,onChange:M,onKeyDown:z,placeholder:0===k.length?F(o):"",disabled:u,className:U("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:L,color:h.text,caretColor:h.primary},"aria-label":d??"Tag input"})]}),b&&/* @__PURE__ */Ke("p",{className:U("text-xs"),style:{color:h.danger},role:"alert",children:b}),c&&!b&&/* @__PURE__ */Ke("p",{className:U("text-xs"),style:{color:h.textMuted},children:F(c)})]})}var uo=!1;function ho({status:e="pending",icon:t,size:n=28}){const o=N(),r=ge(),i=function(e="pending"){const t=N();return{completed:t.success,active:t.primary,pending:t.border,error:t.danger}[e]}(e),a="active"===e;/* @__PURE__ */
148
- return Ke("div",{className:le(U("relative flex items-center justify-center rounded-full shrink-0 z-10"),a&&!r?"tkx-pulse-dot":""),style:{width:n,height:n,backgroundColor:"pending"===e?o.surface:i,border:`2px solid ${i}`,color:"pending"===e?i:o.bg},"aria-hidden":"true",children:/* @__PURE__ */Ke("span",t?{style:{fontSize:.45*n,lineHeight:1},children:t}:{style:{width:.35*n,height:.35*n,borderRadius:"50%",backgroundColor:"pending"===e?i:o.bg,display:"block"}})})}function po({style:e,color:t,animate:n}){return N(),/* @__PURE__ */Ke("div",{className:le(U("w-0.5 flex-1 min-h-[24px]"),n?"tkx-draw-v":""),style:{borderLeft:`2px ${e} ${t}`,backgroundColor:"transparent",alignSelf:"stretch",borderColor:t,marginLeft:1},"aria-hidden":"true"})}function fo({style:e,color:t,animate:n}){/* @__PURE__ */
149
- return Ke("div",{className:le(U("h-0.5 flex-1 min-w-[24px]"),n?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${t}`,borderColor:t},"aria-hidden":"true"})}function mo({item:e,compact:t}){const n=N(),o=e.timestamp?F(e.timestamp):null;/* @__PURE__ */
147
+ /* @__PURE__ */Ye("div",{className:U("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!p&&"transition-colors duration-150"),style:{padding:I,backgroundColor:h.surface,border:`1.5px solid ${b?h.danger:h.border}`,opacity:u?.55:1,minHeight:"sm"===s?36:"lg"===s?48:40},onClick:()=>!u&&v.current?.focus(),children:[k.map((e,t)=>/* @__PURE__ */Ke(so,{size:s,variant:"subtle",colorScheme:l,onRemove:u?void 0:()=>$(t),isDisabled:u,children:e},`${e}-${t}`)),(!r||k.length<r)&&!u&&/* @__PURE__ */Ke("input",{ref:v,type:"text",value:g,onChange:N,onKeyDown:z,placeholder:0===k.length?F(o):"",disabled:u,className:U("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:R,color:h.text,caretColor:h.primary},"aria-label":d??"Tag input"})]}),b&&/* @__PURE__ */Ke("p",{className:U("text-xs"),style:{color:h.danger},role:"alert",children:b}),c&&!b&&/* @__PURE__ */Ke("p",{className:U("text-xs"),style:{color:h.textMuted},children:F(c)})]})}var uo=!1;function ho({status:e="pending",icon:t,size:n=28}){const o=M(),r=ge(),i=function(e="pending"){const t=M();return{completed:t.success,active:t.primary,pending:t.border,error:t.danger}[e]}(e),a="active"===e;/* @__PURE__ */
148
+ return Ke("div",{className:le(U("relative flex items-center justify-center rounded-full shrink-0 z-10"),a&&!r?"tkx-pulse-dot":""),style:{width:n,height:n,backgroundColor:"pending"===e?o.surface:i,border:`2px solid ${i}`,color:"pending"===e?i:o.bg},"aria-hidden":"true",children:/* @__PURE__ */Ke("span",t?{style:{fontSize:.45*n,lineHeight:1},children:t}:{style:{width:.35*n,height:.35*n,borderRadius:"50%",backgroundColor:"pending"===e?i:o.bg,display:"block"}})})}function po({style:e,color:t,animate:n}){return M(),/* @__PURE__ */Ke("div",{className:le(U("w-0.5 flex-1 min-h-[24px]"),n?"tkx-draw-v":""),style:{borderLeft:`2px ${e} ${t}`,backgroundColor:"transparent",alignSelf:"stretch",borderColor:t,marginLeft:1},"aria-hidden":"true"})}function fo({style:e,color:t,animate:n}){/* @__PURE__ */
149
+ return Ke("div",{className:le(U("h-0.5 flex-1 min-w-[24px]"),n?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${t}`,borderColor:t},"aria-hidden":"true"})}function mo({item:e,compact:t}){const n=M(),o=e.timestamp?F(e.timestamp):null;/* @__PURE__ */
150
150
  return Ye("div",{className:U("flex flex-col gap-0.5",t?"pb-3":"pb-5"),children:[/* @__PURE__ */Ye("div",{className:U("flex items-center gap-2 flex-wrap"),children:[
151
- /* @__PURE__ */Ke("span",{className:U("text-sm font-semibold leading-snug"),style:{color:n.text},children:"string"==typeof e.title?F(e.title):e.title}),e.badge&&/* @__PURE__ */Ke("span",{children:e.badge}),o&&/* @__PURE__ */Ke("span",{className:U("text-[11px] ml-auto"),style:{color:n.textMuted},children:o})]}),e.description&&!t&&/* @__PURE__ */Ke("div",{className:U("text-xs leading-relaxed mt-0.5"),style:{color:n.textMuted},children:"string"==typeof e.description?F(e.description):e.description})]})}function go({items:e,variant:t="default",orientation:n="vertical",connectorStyle:o="solid"}){const r=N(),i=ge(),a=Oe(!1);Ee(()=>{!function(){if(uo||"undefined"==typeof document)return;uo=!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)}(),a.current=!0},[]);const l=!i,s="compact"===t,d="alternating"===t&&"vertical"===n;/* @__PURE__ */
151
+ /* @__PURE__ */Ke("span",{className:U("text-sm font-semibold leading-snug"),style:{color:n.text},children:"string"==typeof e.title?F(e.title):e.title}),e.badge&&/* @__PURE__ */Ke("span",{children:e.badge}),o&&/* @__PURE__ */Ke("span",{className:U("text-[11px] ml-auto"),style:{color:n.textMuted},children:o})]}),e.description&&!t&&/* @__PURE__ */Ke("div",{className:U("text-xs leading-relaxed mt-0.5"),style:{color:n.textMuted},children:"string"==typeof e.description?F(e.description):e.description})]})}function go({items:e,variant:t="default",orientation:n="vertical",connectorStyle:o="solid"}){const r=M(),i=ge(),a=Oe(!1);Ee(()=>{!function(){if(uo||"undefined"==typeof document)return;uo=!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)}(),a.current=!0},[]);const l=!i,s="compact"===t,d="alternating"===t&&"vertical"===n;/* @__PURE__ */
152
152
  return Ke("div","horizontal"===n?{role:"list","aria-label":"Timeline",className:U("flex items-start w-full overflow-x-auto"),children:e.map((t,n)=>{const i=t.status??"pending",a="completed"===i?r.success:r.border,s=n===e.length-1;/* @__PURE__ */
153
153
  return Ke("div",{role:"listitem",className:U("flex items-start flex-1 min-w-0"),children:/* @__PURE__ */Ye("div",{className:U("flex flex-col items-center flex-1 min-w-0"),children:[/* @__PURE__ */Ye("div",{className:U("flex items-center w-full"),children:[n>0&&/* @__PURE__ */Ke(fo,{style:o,color:a,animate:l}),
154
154
  /* @__PURE__ */Ke(ho,{status:i,icon:t.icon,size:24}),!s&&/* @__PURE__ */Ke(fo,{style:o,color:a,animate:l})]}),/* @__PURE__ */Ye("div",{className:U("mt-2 px-1 text-center min-w-0 w-full"),children:[/* @__PURE__ */Ke("div",{className:U("text-xs font-semibold truncate"),style:{color:r.text},children:"string"==typeof t.title?F(t.title):t.title}),t.timestamp&&/* @__PURE__ */Ke("div",{className:U("text-[10px] mt-0.5"),style:{color:r.textMuted},children:F(t.timestamp)})]})]})},t.id)})}:{role:"list","aria-label":"Timeline",className:U("flex flex-col"),children:e.map((t,n)=>{const i=t.status??"pending",a=n===e.length-1,c="completed"===i?r.success:r.border,u=d&&n%2==0;/* @__PURE__ */
@@ -158,7 +158,7 @@ return Ye("div",d?{role:"listitem",className:U("flex items-stretch gap-0"),child
158
158
  /* @__PURE__ */Ke("div",{className:U("flex-1 flex flex-col items-start pl-4",u?"invisible":""),children:!u&&/* @__PURE__ */Ke(mo,{item:t,compact:s})})]}:{role:"listitem",className:U("flex gap-3 items-stretch"),children:[/* @__PURE__ */Ye("div",{className:U("flex flex-col items-center"),children:[/* @__PURE__ */Ke(ho,{status:i,icon:t.icon,size:s?22:28}),!a&&/* @__PURE__ */Ke(po,{style:o,color:c,animate:l})]}),/* @__PURE__ */Ke("div",{className:U("flex-1 min-w-0 pt-0.5"),children:/* @__PURE__ */Ke(mo,{item:t,compact:s})})]},t.id)})})}function xo(e,t,n,o){const r=window.innerWidth,i=window.innerHeight;let a=0,l=0,s="top left";switch(t){case"bottom-start":a=e.bottom+6,l=e.left,s="top left",a+o>i&&e.top-6-o>0&&(a=e.top-6-o,s="bottom left"),l+n>r&&(l=Math.max(0,r-n-8));break;case"bottom-end":a=e.bottom+6,l=e.right-n,s="top right",a+o>i&&e.top-6-o>0&&(a=e.top-6-o,s="bottom right"),l<0&&(l=8);break;case"top-start":a=e.top-6-o,l=e.left,s="bottom left",a<0&&(a=e.bottom+6,s="top left"),l+n>r&&(l=Math.max(0,r-n-8));break;case"top-end":a=e.top-6-o,l=e.right-n,s="bottom right",a<0&&(a=e.bottom+6,s="top right"),l<0&&(l=8);break;case"right-start":a=e.top,l=e.right+6,s="top left",l+n>r&&(l=e.left-6-n,s="top right"),a+o>i&&(a=Math.max(8,i-o-8));break;case"left-start":a=e.top,l=e.left-6-n,s="top right",l<0&&(l=e.right+6,s="top left"),a+o>i&&(a=Math.max(8,i-o-8))}return{top:a+window.scrollY,left:l+window.scrollX,transformOrigin:s}}function bo(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 yo({color:e}){/* @__PURE__ */
159
159
  return Ke("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:/* @__PURE__ */Ke("path",{d:"M20 6L9 17l-5-5"})})}function vo({color:e}){/* @__PURE__ */
160
160
  return Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"12",cy:"12",r:"5",fill:e}),/* @__PURE__ */Ke("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:e,strokeWidth:"2"})]})}function wo({color:e}){/* @__PURE__ */
161
- return Ke("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M9 18l6-6-6-6"})})}function ko({items:e,pos:t,panelId:n,onClose:o,onCloseAll:r,isSubmenu:i=!1}){const a=N(),[l,s]=Ve(-1),[d,c]=Ve(null),[u,h]=Ve(null),p=Oe(null),[f,m]=Ve(""),g=Oe(null),x=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);Ee(()=>{p.current?.focus()},[]),Ee(()=>{l<0||(p.current?.querySelector(`[data-midx="${l}"]`))?.scrollIntoView({block:"nearest"})},[l]);const b=Ae(e=>{if("action"===e.kind){if(e.item.disabled)return;e.item.onClick?.(),r()}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;c(e.item.id)}},[r]);function y(){c(null),h(null)}/* @__PURE__ */
161
+ return Ke("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M9 18l6-6-6-6"})})}function ko({items:e,pos:t,panelId:n,onClose:o,onCloseAll:r,isSubmenu:i=!1}){const a=M(),[l,s]=Ve(-1),[d,c]=Ve(null),[u,h]=Ve(null),p=Oe(null),[f,m]=Ve(""),g=Oe(null),x=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);Ee(()=>{p.current?.focus()},[]),Ee(()=>{l<0||(p.current?.querySelector(`[data-midx="${l}"]`))?.scrollIntoView({block:"nearest"})},[l]);const b=Ae(e=>{if("action"===e.kind){if(e.item.disabled)return;e.item.onClick?.(),r()}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;c(e.item.id)}},[r]);function y(){c(null),h(null)}/* @__PURE__ */
162
162
  return Ye(Ue,{children:[/* @__PURE__ */Ke("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"}),/* @__PURE__ */Ke("div",{ref:p,id:n,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),s(e=>{const t=e+1;return t<x.length?t:0});break;case"ArrowUp":e.preventDefault(),s(e=>{const t=e-1;return t>=0?t:x.length-1});break;case"Home":e.preventDefault(),s(0);break;case"End":e.preventDefault(),s(x.length-1);break;case"Enter":case" ":e.preventDefault(),l>=0&&x[l]&&b(x[l]);break;case"Escape":e.preventDefault(),i?o():r();break;case"Tab":e.preventDefault(),r();break;case"ArrowRight":e.preventDefault(),l>=0&&"submenu"===x[l]?.kind&&c(x[l].item.id);break;case"ArrowLeft":e.preventDefault(),i&&o();break;default:1!==e.key.length||e.ctrlKey||e.metaKey||function(e){g.current&&clearTimeout(g.current);const t=f+e.toLowerCase();m(t);const n=x.findIndex(e=>("radio"===e.kind?e.item.options[e.optionIdx].label:e.item.label).toLowerCase().startsWith(t));n>=0&&s(n),g.current=setTimeout(()=>m(""),800)}(e.key)}},style:{...bo(a,t),maxHeight:400,overflowY:"auto"},children:(()=>{let t=-1;return e.map(e=>{if("separator"===e.type)/* @__PURE__ */return Ke("div",{role:"separator",style:{margin:(e.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:e.label?/* @__PURE__ */Ye(Ue,{children:[
163
163
  /* @__PURE__ */Ke("div",{style:{flex:1,height:1,backgroundColor:a.border,marginLeft:14}}),
164
164
  /* @__PURE__ */Ke("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:a.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:F(e.label)}),
@@ -175,75 +175,75 @@ return Ye("div",{style:{position:"relative"},children:[/* @__PURE__ */Ye("div",{
175
175
  /* @__PURE__ */Ke(wo,{color:a.textMuted})]}),f&&u&&Xe(/* @__PURE__ */Ke(ko,{items:e.items,pos:u,panelId:`${n}-sub-${e.id}`,onClose:y,onCloseAll:r,isSubmenu:!0}),document.body)]},e.id)}const o=e;t++;const i=t,p=i===l,f=!!o.disabled,m=!!o.danger,g=So(a,p,m,f);/* @__PURE__ */
176
176
  return Ye("div",{role:"menuitem","aria-disabled":f||void 0,"data-midx":i,tabIndex:-1,style:g,onClick:()=>{f||(o.onClick?.(),r())},onMouseEnter:()=>{f||(s(i),y())},children:[
177
177
  /* @__PURE__ */Ke("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:o.icon?/* @__PURE__ */Ke("span",{style:{display:"flex",color:m?a.danger:a.textMuted},children:o.icon}):/* @__PURE__ */Ke("span",{style:{width:14}})}),
178
- /* @__PURE__ */Ye("span",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ke("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(o.label)}),o.description&&/* @__PURE__ */Ke("span",{style:{display:"block",fontSize:"12px",color:a.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(o.description)})]}),o.shortcut&&/* @__PURE__ */Ke("span",{style:{fontSize:"12px",color:a.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:F(o.shortcut)})]},o.id)})})()})]})}function So(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 Co({trigger:e,items:t,placement:n="bottom-start",isDisabled:o=!1,onOpen:r,onClose:i,className:a,style:l}){const s=`tkx-menu-${He().replace(/:/g,"")}`,[d,c]=Ve(!1),[u,h]=Ve(null),p=Oe(null),f=Ae(()=>{if(o)return;const e=p.current;e&&(h(xo(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360))),c(!0),r?.())},[o,t.length,r,n]),m=Ae(()=>{c(!1),i?.(),(p.current?.firstElementChild)?.focus?.()},[i]);return Ee(()=>{if(!d)return;const e=e=>{const t=e.target;if(p.current?.contains(t))return;const n=document.querySelectorAll(".tkx-menu-panel");for(const o of n)if(o.contains(t))return;m()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[d,m]),Ee(()=>{if(!d)return;const e=()=>{const e=p.current;e&&h(xo(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)}},[d,t.length,n]),/* @__PURE__ */Ye("span",{ref:p,className:a,style:{display:"inline-flex",...l},children:[/* @__PURE__ */Ke("span",{role:"button",tabIndex:o?-1:0,"aria-haspopup":"menu","aria-expanded":d,"aria-controls":d?s:void 0,"aria-disabled":o||void 0,onClick:()=>d?m():f(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),d||f()),"Escape"===e.key&&d&&(e.preventDefault(),m())},style:{display:"inline-flex",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,outline:"none"},children:e}),d&&u&&Xe(/* @__PURE__ */Ke(ko,{items:t,pos:u,panelId:s,onClose:m,onCloseAll:m}),document.body)]})}Co.displayName="TkxMenu";var $o={sm:120,md:180,lg:240,xl:320};function zo(e){const t=/* @__PURE__ */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),a=parseInt(o("second"),10),l=`${o("weekday")}, ${o("month")} ${o("day")}, ${o("year")}`;return{hours:r,minutes:i,seconds:a,milliseconds:t.getMilliseconds(),dateString:l}}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 No({time:e,size:t,analogStyle:n,showSeconds:o,reducedMotion:r,primary:i,danger:a,text:l,textMuted:s,border:d,surface:c,bg:u}){const h=t/2,p=t/2,f=t/2-4,{hours:m,minutes:g,seconds:x,milliseconds:b}=e,y=(x+(r?0:b)/1e3)/60*360,v=g/60*360+x/60*6,w=m%12/12*360+g/60*30,k=(e,t)=>{const n=(e-90)*Math.PI/180;return{x:h+Math.cos(n)*t,y:p+Math.sin(n)*t}},S=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} ${p+Math.sin(-90*Math.PI/180)*t} A ${t} ${t} 0 ${e>.5?1:0} 1 ${h+Math.cos(n*Math.PI/180)*t} ${p+Math.sin(n*Math.PI/180)*t}`},n=m%12/12+g/60/12,c=g/60+x/3600,u=(x+(r?0:b/1e3))/60,y=f-2,v=f-10,w=f-18;/* @__PURE__ */
178
+ /* @__PURE__ */Ye("span",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ke("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(o.label)}),o.description&&/* @__PURE__ */Ke("span",{style:{display:"block",fontSize:"12px",color:a.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F(o.description)})]}),o.shortcut&&/* @__PURE__ */Ke("span",{style:{fontSize:"12px",color:a.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:F(o.shortcut)})]},o.id)})})()})]})}function So(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 Co({trigger:e,items:t,placement:n="bottom-start",isDisabled:o=!1,onOpen:r,onClose:i,className:a,style:l}){const s=`tkx-menu-${He().replace(/:/g,"")}`,[d,c]=Ve(!1),[u,h]=Ve(null),p=Oe(null),f=Ae(()=>{if(o)return;const e=p.current;e&&(h(xo(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360))),c(!0),r?.())},[o,t.length,r,n]),m=Ae(()=>{c(!1),i?.(),(p.current?.firstElementChild)?.focus?.()},[i]);return Ee(()=>{if(!d)return;const e=e=>{const t=e.target;if(p.current?.contains(t))return;const n=document.querySelectorAll(".tkx-menu-panel");for(const o of n)if(o.contains(t))return;m()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[d,m]),Ee(()=>{if(!d)return;const e=()=>{const e=p.current;e&&h(xo(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)}},[d,t.length,n]),/* @__PURE__ */Ye("span",{ref:p,className:a,style:{display:"inline-flex",...l},children:[/* @__PURE__ */Ke("span",{role:"button",tabIndex:o?-1:0,"aria-haspopup":"menu","aria-expanded":d,"aria-controls":d?s:void 0,"aria-disabled":o||void 0,onClick:()=>d?m():f(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),d||f()),"Escape"===e.key&&d&&(e.preventDefault(),m())},style:{display:"inline-flex",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,outline:"none"},children:e}),d&&u&&Xe(/* @__PURE__ */Ke(ko,{items:t,pos:u,panelId:s,onClose:m,onCloseAll:m}),document.body)]})}Co.displayName="TkxMenu";var $o={sm:120,md:180,lg:240,xl:320};function zo(e){const t=/* @__PURE__ */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),a=parseInt(o("second"),10),l=`${o("weekday")}, ${o("month")} ${o("day")}, ${o("year")}`;return{hours:r,minutes:i,seconds:a,milliseconds:t.getMilliseconds(),dateString:l}}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 Mo({time:e,size:t,analogStyle:n,showSeconds:o,reducedMotion:r,primary:i,danger:a,text:l,textMuted:s,border:d,surface:c,bg:u}){const h=t/2,p=t/2,f=t/2-4,{hours:m,minutes:g,seconds:x,milliseconds:b}=e,y=(x+(r?0:b)/1e3)/60*360,v=g/60*360+x/60*6,w=m%12/12*360+g/60*30,k=(e,t)=>{const n=(e-90)*Math.PI/180;return{x:h+Math.cos(n)*t,y:p+Math.sin(n)*t}},S=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} ${p+Math.sin(-90*Math.PI/180)*t} A ${t} ${t} 0 ${e>.5?1:0} 1 ${h+Math.cos(n*Math.PI/180)*t} ${p+Math.sin(n*Math.PI/180)*t}`},n=m%12/12+g/60/12,c=g/60+x/3600,u=(x+(r?0:b/1e3))/60,y=f-2,v=f-10,w=f-18;/* @__PURE__ */
179
179
  return Ye("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",children:[
180
180
  /* @__PURE__ */Ke("circle",{cx:h,cy:p,r:y,fill:"none",stroke:d,strokeWidth:4}),
181
181
  /* @__PURE__ */Ke("circle",{cx:h,cy:p,r:v,fill:"none",stroke:d,strokeWidth:4}),o&&/* @__PURE__ */Ke("circle",{cx:h,cy:p,r:w,fill:"none",stroke:d,strokeWidth:3}),
182
182
  /* @__PURE__ */Ke("path",{d:e(n,y),fill:"none",stroke:i,strokeWidth:4,strokeLinecap:"round"}),
183
183
  /* @__PURE__ */Ke("path",{d:e(c,v),fill:"none",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o&&/* @__PURE__ */Ke("path",{d:e(u,w),fill:"none",stroke:a,strokeWidth:3,strokeLinecap:"round"}),
184
184
  /* @__PURE__ */Ke("circle",{cx:h,cy:p,r:4,fill:i}),
185
- /* @__PURE__ */Ye("text",{x:h,y:p+20,textAnchor:"middle",fontSize:.12*t,fill:s,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(m).padStart(2,"0"),":",String(g).padStart(2,"0")]})]})}const C=k(w,.5*f),$=k(v,.75*f),z=k(y,.85*f),N=k(y+180,.2*f),M=[];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?f-10:f-6,r=h+Math.cos(n)*f,i=p+Math.sin(n)*f,a=h+Math.cos(n)*o,d=p+Math.sin(n)*o;M.push(/* @__PURE__ */Ke("line",{x1:r,y1:i,x2:a,y2:d,stroke:t?l:s,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=f-20;M.push(/* @__PURE__ */Ke("text",{x:h+Math.cos(o)*r,y:p+Math.sin(o)*r,textAnchor:"middle",dominantBaseline:"central",fontSize:.09*t,fill:l,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:e},`n${e}`))}}else for(let I=0;I<12;I++){const e=(I/12*360-90)*Math.PI/180,t=f-8;M.push(/* @__PURE__ */Ke("circle",{cx:h+Math.cos(e)*t,cy:p+Math.sin(e)*t,r:I%3==0?3:2,fill:I%3==0?l:s},I))}/* @__PURE__ */
185
+ /* @__PURE__ */Ye("text",{x:h,y:p+20,textAnchor:"middle",fontSize:.12*t,fill:s,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(m).padStart(2,"0"),":",String(g).padStart(2,"0")]})]})}const C=k(w,.5*f),$=k(v,.75*f),z=k(y,.85*f),M=k(y+180,.2*f),N=[];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?f-10:f-6,r=h+Math.cos(n)*f,i=p+Math.sin(n)*f,a=h+Math.cos(n)*o,d=p+Math.sin(n)*o;N.push(/* @__PURE__ */Ke("line",{x1:r,y1:i,x2:a,y2:d,stroke:t?l:s,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=f-20;N.push(/* @__PURE__ */Ke("text",{x:h+Math.cos(o)*r,y:p+Math.sin(o)*r,textAnchor:"middle",dominantBaseline:"central",fontSize:.09*t,fill:l,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:e},`n${e}`))}}else for(let I=0;I<12;I++){const e=(I/12*360-90)*Math.PI/180,t=f-8;N.push(/* @__PURE__ */Ke("circle",{cx:h+Math.cos(e)*t,cy:p+Math.sin(e)*t,r:I%3==0?3:2,fill:I%3==0?l:s},I))}/* @__PURE__ */
186
186
  return Ye("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",style:{display:"block"},children:[
187
- /* @__PURE__ */Ke("circle",{cx:h,cy:p,r:f,fill:c,stroke:d,strokeWidth:2}),M,
187
+ /* @__PURE__ */Ke("circle",{cx:h,cy:p,r:f,fill:c,stroke:d,strokeWidth:2}),N,
188
188
  /* @__PURE__ */Ke("line",{x1:h,y1:p,x2:C.x,y2:C.y,stroke:i,strokeWidth:"minimal"===n?3:4,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:S}}),
189
- /* @__PURE__ */Ke("line",{x1:h,y1:p,x2:$.x,y2:$.y,stroke:l,strokeWidth:"minimal"===n?2:3,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:S}}),o&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("line",{x1:N.x,y1:N.y,x2:z.x,y2:z.y,stroke:a,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:"none"}}),/* @__PURE__ */Ke("circle",{cx:h,cy:p,r:3,fill:a})]}),
190
- /* @__PURE__ */Ke("circle",{cx:h,cy:p,r:"minimal"===n?3:5,fill:i})]})}function Mo({time:e,format:t,showSeconds:n,showDate:o,label:r,size:i,primary:a,text:l,textMuted:s,colonVisible:d}){const{hours:c,minutes:u,seconds:h,dateString:p}=e;let f=c,m="";"12h"===t&&(m=c>=12?"PM":"AM",f=c%12||12);const g=.2*i,x={opacity:d?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};/* @__PURE__ */
189
+ /* @__PURE__ */Ke("line",{x1:h,y1:p,x2:$.x,y2:$.y,stroke:l,strokeWidth:"minimal"===n?2:3,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:S}}),o&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("line",{x1:M.x,y1:M.y,x2:z.x,y2:z.y,stroke:a,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:"none"}}),/* @__PURE__ */Ke("circle",{cx:h,cy:p,r:3,fill:a})]}),
190
+ /* @__PURE__ */Ke("circle",{cx:h,cy:p,r:"minimal"===n?3:5,fill:i})]})}function No({time:e,format:t,showSeconds:n,showDate:o,label:r,size:i,primary:a,text:l,textMuted:s,colonVisible:d}){const{hours:c,minutes:u,seconds:h,dateString:p}=e;let f=c,m="";"12h"===t&&(m=c>=12?"PM":"AM",f=c%12||12);const g=.2*i,x={opacity:d?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};/* @__PURE__ */
191
191
  return Ye("div",{style:{textAlign:"center",fontFamily:"'Courier New', Courier, monospace",fontVariantNumeric:"tabular-nums",lineHeight:1.1},children:[
192
192
  /* @__PURE__ */Ye("div",{style:{fontSize:g,color:a,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[
193
193
  /* @__PURE__ */Ke("span",{children:String(f).padStart(2,"0")}),
194
194
  /* @__PURE__ */Ke("span",{style:x,children:":"}),
195
- /* @__PURE__ */Ke("span",{children:String(u).padStart(2,"0")}),n&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("span",{style:x,children:":"}),/* @__PURE__ */Ke("span",{children:String(h).padStart(2,"0")})]}),"12h"===t&&/* @__PURE__ */Ke("span",{style:{fontSize:.45*g,color:s,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:.05*g},children:m})]}),o&&/* @__PURE__ */Ke("div",{style:{fontSize:.072*i,color:s,marginTop:.025*i,letterSpacing:"0.03em"},children:p}),r&&/* @__PURE__ */Ke("div",{style:{fontSize:.065*i,color:s,marginTop:.015*i,textTransform:"uppercase",letterSpacing:"0.08em"},children:F(r)})]})}function Io({variant:e="both",size:t="md",showSeconds:n=!0,showDate:o=!1,format:r="24h",timezone:i,timezone2:a,label:l,analogStyle:s="classic",className:d,style:c}){const u=N(),h=ge(),[p,f]=Ve(()=>zo(i)),[m,g]=Ve(()=>a?zo(a):null),[x,b]=Ve(!0),[y,v]=Ve(!1),w=Oe(null);Ee(()=>{v(!0)},[]),Ee(()=>{const e=()=>{f(zo(i)),a&&g(zo(a))};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[i,a]),Ee(()=>(w.current=setInterval(()=>{b(e=>!e)},500),()=>{w.current&&clearInterval(w.current)}),[]);const k=$o[t],S="digital"===e||"both"===e;/* @__PURE__ */
196
- return Ye("div",{className:d,style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"both"===e?.06*k+"px":0,opacity:y?1:0,transition:h?"none":"opacity 0.4s ease",...c},role:"timer","aria-live":"off",children:[("analog"===e||"both"===e)&&/* @__PURE__ */Ke(No,{time:p,size:k,analogStyle:s,showSeconds:n,reducedMotion:h,primary:u.primary,danger:u.danger,text:u.text,textMuted:u.textMuted,border:u.border,surface:u.surface,bg:u.bg}),S&&/* @__PURE__ */Ke(Mo,{time:p,format:r,showSeconds:n,showDate:o,label:l,size:k,primary:u.primary,text:u.text,textMuted:u.textMuted,colonVisible:x}),m&&a&&/* @__PURE__ */Ke("div",{style:{marginTop:.04*k,padding:`${.03*k}px ${.06*k}px`,borderTop:`1px solid ${u.border}`,textAlign:"center"},children:/* @__PURE__ */Ke(Mo,{time:m,format:r,showSeconds:!1,showDate:!1,label:a,size:.7*k,primary:u.secondary,text:u.text,textMuted:u.textMuted,colonVisible:x})})]})}function Lo(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 Ro({path:e,size:t=20,color:n="currentColor",title:o}){/* @__PURE__ */
197
- return Ke("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:/* @__PURE__ */Ke("path",{d:e})})}Io.displayName="TkxClock";var Do="M8 5v14l11-7z",To="M6 19h4V5H6v14zm8-14v14h4V5h-4z";function Wo({onClick:e,title:t,children:n,active:o,primary:r}){const[i,a]=Ve(!1);/* @__PURE__ */
198
- return Ke("button",{type:"button",onClick:e,title:t,"aria-label":t,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!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 Ao({src:e,poster:t,title:n,width:o="100%",height:r,autoPlay:i=!1,loop:a=!1,muted:l=!1,controls:s=!0,showTitle:d=!0,allowFullscreen:c=!0,allowPiP:u=!0,allowDownload:h=!1,chapters:p=[],subtitles:f=[],startTime:m,onPlay:g,onPause:x,onEnded:b,onTimeUpdate:y,className:v,style:w}){const k=N(),S=ge(),C=Oe(null),$=Oe(null),z=Oe(null),M=Oe(null),[I,L]=Ve(!1),[R,D]=Ve(0),[T,W]=Ve(0),[A,B]=Ve(0),[E,H]=Ve(1),[j,P]=Ve(l),[O,V]=Ve(!1),[U,K]=Ve(!0),[Y,X]=Ve(!1),[q,G]=Ve(1),[_,Z]=Ve(!1),[J,Q]=Ve(-1),[ee,te]=Ve(null),[ne,oe]=Ve(0),[re,ie]=Ve(null),[ae,le]=Ve(!1),[se,de]=Ve(!1),[ce,ue]=Ve(null),[he,pe]=Ve(!1);Ee(()=>{const e=C.current;if(!e)return;void 0!==m&&(e.currentTime=m);const t=()=>{D(e.currentTime),e.buffered.length>0&&B(e.buffered.end(e.buffered.length-1))},n=()=>W(e.duration),o=()=>L(!0),r=()=>{L(!1),X(!0)},i=()=>{L(!1),X(!0),b?.()},a=()=>le(!0),l=()=>le(!1),s=()=>de(!0),d=()=>de(!1),c=()=>{const t=e.error;ue(t?`Error ${t.code}: ${t.message||"Failed to load video"}`:"Failed to load video"),de(!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",a),e.addEventListener("leavepictureinpicture",l),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",a),e.removeEventListener("leavepictureinpicture",l),e.removeEventListener("waiting",s),e.removeEventListener("canplay",d),e.removeEventListener("error",c)}},[b,m]),Ee(()=>{C.current&&(I?g?.():x?.())},[I,g,x]),Ee(()=>{y?.(R,T)},[R,T,y]),Ee(()=>{const e=C.current;if(!e)return;const t=e.textTracks;for(let n=0;n<t.length;n++)t[n].mode=n===J?"showing":"disabled"},[J]),Ee(()=>{const e=()=>V(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),Ee(()=>{const e=$.current;if(!e)return;const t=e=>{const t=C.current;if(t&&"INPUT"!==e.target.tagName)switch(e.key){case" ":case"k":e.preventDefault(),me();break;case"f":case"F":c&&be();break;case"m":case"M":xe();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(),H(Math.min(E+.1,1)),C.current&&(C.current.volume=Math.min(E+.1,1));break;case"ArrowDown":e.preventDefault(),H(Math.max(E-.1,0)),C.current&&(C.current.volume=Math.max(E-.1,0))}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[E,c]);const fe=Ae(()=>{K(!0),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{I&&K(!1)},3e3)},[I]);Ee(()=>(fe(),()=>{M.current&&clearTimeout(M.current)}),[I,fe]);const me=Ae(()=>{const e=C.current;e&&(e.paused?(e.play().catch(()=>{}),ie("play"),X(!1)):(e.pause(),ie("pause")),setTimeout(()=>ie(null),600))},[]),xe=Ae(()=>{const e=C.current;if(!e)return;const t=!j;P(t),e.muted=t},[j]),be=Ae(()=>{const e=$.current;e&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):e.requestFullscreen().catch(()=>{}))},[]),ye=Ae(async()=>{const e=C.current;if(e)try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{}},[]),ve=Ae(()=>{0!==f.length&&(Q(e=>(e+1)%(f.length+1)-1),Q(e=>{const t=e+1;return t>=f.length?-1:t}))},[f.length]),we=Ae(()=>{const e=C.current;e&&(e.currentTime=Math.min(e.currentTime+10,e.duration||0))},[]),ke=Ae(()=>{const e=C.current;e&&(e.currentTime=Math.max(e.currentTime-10,0))},[]),Se=Ae(()=>{const e=C.current;e&&(ue(null),e.load())},[]),Ce=Ae(()=>{c&&be()},[c,be]),$e=Ae(e=>{const t=C.current,n=z.current;if(!t||!n||!T)return;const o=n.getBoundingClientRect();t.currentTime=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width))*T},[T]),ze=Ae(e=>{const t=z.current;if(!t||!T)return;const n=t.getBoundingClientRect();te(Math.max(0,Math.min(1,(e.clientX-n.left)/n.width))*T),oe(e.clientX-n.left)},[T]),Ne=Ae(e=>{const t=parseFloat(e.target.value);H(t),C.current&&(C.current.volume=t,C.current.muted=0===t,P(0===t))},[]),Me=Ae(e=>{G(e),C.current&&(C.current.playbackRate=e),Z(!1)},[]),Ie=p.length>0?[...p].reverse().find(e=>R>=e.time):null,Le=e=>[...p].reverse().find(t=>e>=t.time)??null,Re=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],De=Array.isArray(e)?e[0].src:e,Te=U||Y||!I,We=S?"none":"opacity 0.25s ease",Be=j||0===E?"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":E<.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=T>0?R/T*100:0,Fe=T>0?A/T*100:0;/* @__PURE__ */
195
+ /* @__PURE__ */Ke("span",{children:String(u).padStart(2,"0")}),n&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("span",{style:x,children:":"}),/* @__PURE__ */Ke("span",{children:String(h).padStart(2,"0")})]}),"12h"===t&&/* @__PURE__ */Ke("span",{style:{fontSize:.45*g,color:s,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:.05*g},children:m})]}),o&&/* @__PURE__ */Ke("div",{style:{fontSize:.072*i,color:s,marginTop:.025*i,letterSpacing:"0.03em"},children:p}),r&&/* @__PURE__ */Ke("div",{style:{fontSize:.065*i,color:s,marginTop:.015*i,textTransform:"uppercase",letterSpacing:"0.08em"},children:F(r)})]})}function Io({variant:e="both",size:t="md",showSeconds:n=!0,showDate:o=!1,format:r="24h",timezone:i,timezone2:a,label:l,analogStyle:s="classic",className:d,style:c}){const u=M(),h=ge(),[p,f]=Ve(()=>zo(i)),[m,g]=Ve(()=>a?zo(a):null),[x,b]=Ve(!0),[y,v]=Ve(!1),w=Oe(null);Ee(()=>{v(!0)},[]),Ee(()=>{const e=()=>{f(zo(i)),a&&g(zo(a))};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[i,a]),Ee(()=>(w.current=setInterval(()=>{b(e=>!e)},500),()=>{w.current&&clearInterval(w.current)}),[]);const k=$o[t],S="digital"===e||"both"===e;/* @__PURE__ */
196
+ return Ye("div",{className:d,style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"both"===e?.06*k+"px":0,opacity:y?1:0,transition:h?"none":"opacity 0.4s ease",...c},role:"timer","aria-live":"off",children:[("analog"===e||"both"===e)&&/* @__PURE__ */Ke(Mo,{time:p,size:k,analogStyle:s,showSeconds:n,reducedMotion:h,primary:u.primary,danger:u.danger,text:u.text,textMuted:u.textMuted,border:u.border,surface:u.surface,bg:u.bg}),S&&/* @__PURE__ */Ke(No,{time:p,format:r,showSeconds:n,showDate:o,label:l,size:k,primary:u.primary,text:u.text,textMuted:u.textMuted,colonVisible:x}),m&&a&&/* @__PURE__ */Ke("div",{style:{marginTop:.04*k,padding:`${.03*k}px ${.06*k}px`,borderTop:`1px solid ${u.border}`,textAlign:"center"},children:/* @__PURE__ */Ke(No,{time:m,format:r,showSeconds:!1,showDate:!1,label:a,size:.7*k,primary:u.secondary,text:u.text,textMuted:u.textMuted,colonVisible:x})})]})}function Ro(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 To({path:e,size:t=20,color:n="currentColor",title:o}){/* @__PURE__ */
197
+ return Ke("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:/* @__PURE__ */Ke("path",{d:e})})}Io.displayName="TkxClock";var Do="M8 5v14l11-7z",Lo="M6 19h4V5H6v14zm8-14v14h4V5h-4z";function Wo({onClick:e,title:t,children:n,active:o,primary:r}){const[i,a]=Ve(!1);/* @__PURE__ */
198
+ return Ke("button",{type:"button",onClick:e,title:t,"aria-label":t,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!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 Ao({src:e,poster:t,title:n,width:o="100%",height:r,autoPlay:i=!1,loop:a=!1,muted:l=!1,controls:s=!0,showTitle:d=!0,allowFullscreen:c=!0,allowPiP:u=!0,allowDownload:h=!1,chapters:p=[],subtitles:f=[],startTime:m,onPlay:g,onPause:x,onEnded:b,onTimeUpdate:y,className:v,style:w}){const k=M(),S=ge(),C=Oe(null),$=Oe(null),z=Oe(null),N=Oe(null),[I,R]=Ve(!1),[T,D]=Ve(0),[L,W]=Ve(0),[A,B]=Ve(0),[E,H]=Ve(1),[j,P]=Ve(l),[O,V]=Ve(!1),[U,K]=Ve(!0),[Y,X]=Ve(!1),[q,G]=Ve(1),[J,_]=Ve(!1),[Z,Q]=Ve(-1),[ee,te]=Ve(null),[ne,oe]=Ve(0),[re,ie]=Ve(null),[ae,le]=Ve(!1),[se,de]=Ve(!1),[ce,ue]=Ve(null),[he,pe]=Ve(!1);Ee(()=>{const e=C.current;if(!e)return;void 0!==m&&(e.currentTime=m);const t=()=>{D(e.currentTime),e.buffered.length>0&&B(e.buffered.end(e.buffered.length-1))},n=()=>W(e.duration),o=()=>R(!0),r=()=>{R(!1),X(!0)},i=()=>{R(!1),X(!0),b?.()},a=()=>le(!0),l=()=>le(!1),s=()=>de(!0),d=()=>de(!1),c=()=>{const t=e.error;ue(t?`Error ${t.code}: ${t.message||"Failed to load video"}`:"Failed to load video"),de(!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",a),e.addEventListener("leavepictureinpicture",l),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",a),e.removeEventListener("leavepictureinpicture",l),e.removeEventListener("waiting",s),e.removeEventListener("canplay",d),e.removeEventListener("error",c)}},[b,m]),Ee(()=>{C.current&&(I?g?.():x?.())},[I,g,x]),Ee(()=>{y?.(T,L)},[T,L,y]),Ee(()=>{const e=C.current;if(!e)return;const t=e.textTracks;for(let n=0;n<t.length;n++)t[n].mode=n===Z?"showing":"disabled"},[Z]),Ee(()=>{const e=()=>V(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),Ee(()=>{const e=$.current;if(!e)return;const t=e=>{const t=C.current;if(t&&"INPUT"!==e.target.tagName)switch(e.key){case" ":case"k":e.preventDefault(),me();break;case"f":case"F":c&&be();break;case"m":case"M":xe();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(),H(Math.min(E+.1,1)),C.current&&(C.current.volume=Math.min(E+.1,1));break;case"ArrowDown":e.preventDefault(),H(Math.max(E-.1,0)),C.current&&(C.current.volume=Math.max(E-.1,0))}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[E,c]);const fe=Ae(()=>{K(!0),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{I&&K(!1)},3e3)},[I]);Ee(()=>(fe(),()=>{N.current&&clearTimeout(N.current)}),[I,fe]);const me=Ae(()=>{const e=C.current;e&&(e.paused?(e.play().catch(()=>{}),ie("play"),X(!1)):(e.pause(),ie("pause")),setTimeout(()=>ie(null),600))},[]),xe=Ae(()=>{const e=C.current;if(!e)return;const t=!j;P(t),e.muted=t},[j]),be=Ae(()=>{const e=$.current;e&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):e.requestFullscreen().catch(()=>{}))},[]),ye=Ae(async()=>{const e=C.current;if(e)try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{}},[]),ve=Ae(()=>{0!==f.length&&(Q(e=>(e+1)%(f.length+1)-1),Q(e=>{const t=e+1;return t>=f.length?-1:t}))},[f.length]),we=Ae(()=>{const e=C.current;e&&(e.currentTime=Math.min(e.currentTime+10,e.duration||0))},[]),ke=Ae(()=>{const e=C.current;e&&(e.currentTime=Math.max(e.currentTime-10,0))},[]),Se=Ae(()=>{const e=C.current;e&&(ue(null),e.load())},[]),Ce=Ae(()=>{c&&be()},[c,be]),$e=Ae(e=>{const t=C.current,n=z.current;if(!t||!n||!L)return;const o=n.getBoundingClientRect();t.currentTime=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width))*L},[L]),ze=Ae(e=>{const t=z.current;if(!t||!L)return;const n=t.getBoundingClientRect();te(Math.max(0,Math.min(1,(e.clientX-n.left)/n.width))*L),oe(e.clientX-n.left)},[L]),Me=Ae(e=>{const t=parseFloat(e.target.value);H(t),C.current&&(C.current.volume=t,C.current.muted=0===t,P(0===t))},[]),Ne=Ae(e=>{G(e),C.current&&(C.current.playbackRate=e),_(!1)},[]),Ie=p.length>0?[...p].reverse().find(e=>T>=e.time):null,Re=e=>[...p].reverse().find(t=>e>=t.time)??null,Te=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],De=Array.isArray(e)?e[0].src:e,Le=U||Y||!I,We=S?"none":"opacity 0.25s ease",Be=j||0===E?"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":E<.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=L>0?T/L*100:0,Fe=L>0?A/L*100:0;/* @__PURE__ */
199
199
  return Ye("div",{ref:$,className:v,tabIndex:0,onMouseMove:fe,onMouseLeave:()=>{I&&K(!1)},style:{position:"relative",width:o,height:r??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...w},children:[
200
- /* @__PURE__ */Ye("video",{ref:C,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:t,autoPlay:i,loop:a,muted:l,playsInline:!0,onClick:me,onDoubleClick:Ce,children:[Re.map((e,t)=>/* @__PURE__ */Ke("source",{src:e.src,type:e.type},t)),f.map((e,t)=>/* @__PURE__ */Ke("track",{kind:"subtitles",label:F(e.label),srcLang:e.lang,src:e.src,default:e.default},t))]}),d&&n&&/* @__PURE__ */Ye("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:Te?1:0,transition:We,pointerEvents:"none"},children:[/* @__PURE__ */Ke("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:F(n)}),Ie&&/* @__PURE__ */Ye("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",F(Ie.label)]})]}),re&&/* @__PURE__ */Ke("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:S?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:/* @__PURE__ */Ke(Ro,{path:"play"===re?Do:To,size:32,color:"#fff"})}),se&&!ce&&/* @__PURE__ */Ke("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:/* @__PURE__ */Ke("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:k.primary,borderRadius:"50%",animation:S?"none":"tkxvp-spin 0.8s linear infinite"}})}),ce&&/* @__PURE__ */Ye("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:[
201
- /* @__PURE__ */Ke(Ro,{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"}),
200
+ /* @__PURE__ */Ye("video",{ref:C,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:t,autoPlay:i,loop:a,muted:l,playsInline:!0,onClick:me,onDoubleClick:Ce,children:[Te.map((e,t)=>/* @__PURE__ */Ke("source",{src:e.src,type:e.type},t)),f.map((e,t)=>/* @__PURE__ */Ke("track",{kind:"subtitles",label:F(e.label),srcLang:e.lang,src:e.src,default:e.default},t))]}),d&&n&&/* @__PURE__ */Ye("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:Le?1:0,transition:We,pointerEvents:"none"},children:[/* @__PURE__ */Ke("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:F(n)}),Ie&&/* @__PURE__ */Ye("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",F(Ie.label)]})]}),re&&/* @__PURE__ */Ke("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:S?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:/* @__PURE__ */Ke(To,{path:"play"===re?Do:Lo,size:32,color:"#fff"})}),se&&!ce&&/* @__PURE__ */Ke("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:/* @__PURE__ */Ke("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:k.primary,borderRadius:"50%",animation:S?"none":"tkxvp-spin 0.8s linear infinite"}})}),ce&&/* @__PURE__ */Ye("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:[
201
+ /* @__PURE__ */Ke(To,{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"}),
202
202
  /* @__PURE__ */Ke("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:ce}),
203
- /* @__PURE__ */Ye("button",{type:"button",onClick:Se,style:{display:"flex",alignItems:"center",gap:6,background:k.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[/* @__PURE__ */Ke(Ro,{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"]})]}),s&&/* @__PURE__ */Ye("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:Te?1:0,transition:We},onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),children:[/* @__PURE__ */Ye("div",{ref:z,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(T),"aria-valuenow":Math.floor(R),tabIndex:0,onClick:$e,onMouseMove:ze,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",te(null)},children:[
203
+ /* @__PURE__ */Ye("button",{type:"button",onClick:Se,style:{display:"flex",alignItems:"center",gap:6,background:k.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[/* @__PURE__ */Ke(To,{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"]})]}),s&&/* @__PURE__ */Ye("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:Le?1:0,transition:We},onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),children:[/* @__PURE__ */Ye("div",{ref:z,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(L),"aria-valuenow":Math.floor(T),tabIndex:0,onClick:$e,onMouseMove:ze,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",te(null)},children:[
204
204
  /* @__PURE__ */Ke("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Fe}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),
205
205
  /* @__PURE__ */Ke("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${He}%`,background:k.primary,borderRadius:2,pointerEvents:"none"}}),
206
- /* @__PURE__ */Ke("div",{style:{position:"absolute",top:"50%",left:`${He}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:k.primary,pointerEvents:"none"}}),p.map((e,t)=>{const n=T>0?e.time/T*100:0;/* @__PURE__ */
207
- return Ke("div",{title:F(e.label),style:{position:"absolute",top:"50%",left:`${n}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${k.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},t)}),null!==ee&&/* @__PURE__ */Ye("div",{style:{position:"absolute",bottom:12,left:ne,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:[Lo(ee),Le(ee)&&/* @__PURE__ */Ke("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:F(Le(ee).label)})]})]}),/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:2},children:[
208
- /* @__PURE__ */Ke(Wo,{onClick:me,title:I?"Pause":"Play",primary:k.primary,children:/* @__PURE__ */Ke(Ro,{path:I?To:Do,size:22})}),
209
- /* @__PURE__ */Ke(Wo,{onClick:ke,title:"Skip back 10 seconds",primary:k.primary,children:/* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[/* @__PURE__ */Ke(Ro,{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}),/* @__PURE__ */Ke("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),
210
- /* @__PURE__ */Ke(Wo,{onClick:we,title:"Skip forward 10 seconds",primary:k.primary,children:/* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[/* @__PURE__ */Ke(Ro,{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}),/* @__PURE__ */Ke("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),
211
- /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>pe(!0),onMouseLeave:()=>pe(!1),children:[/* @__PURE__ */Ke(Wo,{onClick:xe,title:j?"Unmute":"Mute",primary:k.primary,children:/* @__PURE__ */Ke(Ro,{path:Be,size:20})}),/* @__PURE__ */Ke("div",{style:{overflow:"hidden",width:he?64:0,opacity:he?1:0,transition:S?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ke("input",{type:"range",min:0,max:1,step:.05,value:j?0:E,onChange:Ne,"aria-label":"Volume",style:{width:64,accentColor:k.primary,cursor:"pointer",height:4}})})]}),
212
- /* @__PURE__ */Ye("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[Lo(R)," / ",Lo(T)]}),
213
- /* @__PURE__ */Ke("div",{style:{flex:1}}),f.length>0&&/* @__PURE__ */Ke(Wo,{onClick:ve,title:"Subtitles",primary:k.primary,active:J>=0,children:/* @__PURE__ */Ke(Ro,{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})}),
206
+ /* @__PURE__ */Ke("div",{style:{position:"absolute",top:"50%",left:`${He}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:k.primary,pointerEvents:"none"}}),p.map((e,t)=>{const n=L>0?e.time/L*100:0;/* @__PURE__ */
207
+ return Ke("div",{title:F(e.label),style:{position:"absolute",top:"50%",left:`${n}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${k.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},t)}),null!==ee&&/* @__PURE__ */Ye("div",{style:{position:"absolute",bottom:12,left:ne,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:[Ro(ee),Re(ee)&&/* @__PURE__ */Ke("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:F(Re(ee).label)})]})]}),/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:2},children:[
208
+ /* @__PURE__ */Ke(Wo,{onClick:me,title:I?"Pause":"Play",primary:k.primary,children:/* @__PURE__ */Ke(To,{path:I?Lo:Do,size:22})}),
209
+ /* @__PURE__ */Ke(Wo,{onClick:ke,title:"Skip back 10 seconds",primary:k.primary,children:/* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[/* @__PURE__ */Ke(To,{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}),/* @__PURE__ */Ke("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),
210
+ /* @__PURE__ */Ke(Wo,{onClick:we,title:"Skip forward 10 seconds",primary:k.primary,children:/* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[/* @__PURE__ */Ke(To,{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}),/* @__PURE__ */Ke("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),
211
+ /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>pe(!0),onMouseLeave:()=>pe(!1),children:[/* @__PURE__ */Ke(Wo,{onClick:xe,title:j?"Unmute":"Mute",primary:k.primary,children:/* @__PURE__ */Ke(To,{path:Be,size:20})}),/* @__PURE__ */Ke("div",{style:{overflow:"hidden",width:he?64:0,opacity:he?1:0,transition:S?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ke("input",{type:"range",min:0,max:1,step:.05,value:j?0:E,onChange:Me,"aria-label":"Volume",style:{width:64,accentColor:k.primary,cursor:"pointer",height:4}})})]}),
212
+ /* @__PURE__ */Ye("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[Ro(T)," / ",Ro(L)]}),
213
+ /* @__PURE__ */Ke("div",{style:{flex:1}}),f.length>0&&/* @__PURE__ */Ke(Wo,{onClick:ve,title:"Subtitles",primary:k.primary,active:Z>=0,children:/* @__PURE__ */Ke(To,{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})}),
214
214
  /* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[
215
- /* @__PURE__ */Ye("button",{type:"button",onClick:()=>Z(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:[q,"×"]}),1!==q&&/* @__PURE__ */Ye("span",{style:{position:"absolute",top:0,right:0,background:k.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[q,"x"]}),_&&/* @__PURE__ */Ke("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${k.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(e=>/* @__PURE__ */Ye("button",{type:"button",onClick:()=>Me(e),style:{display:"block",width:"100%",padding:"6px 14px",background:e===q?k.primary+"30":"none",border:"none",color:e===q?k.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[e,"×"]},e))})]}),u&&"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&/* @__PURE__ */Ke(Wo,{onClick:ye,title:"Picture-in-Picture",primary:k.primary,active:ae,children:/* @__PURE__ */Ke(Ro,{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})}),h&&/* @__PURE__ */Ke("a",{href:De,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:/* @__PURE__ */Ke(Ro,{path:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",size:20})}),c&&/* @__PURE__ */Ke(Wo,{onClick:be,title:O?"Exit fullscreen":"Fullscreen",primary:k.primary,children:/* @__PURE__ */Ke(Ro,{path:O?"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})})]})]}),
215
+ /* @__PURE__ */Ye("button",{type:"button",onClick:()=>_(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:[q,"×"]}),1!==q&&/* @__PURE__ */Ye("span",{style:{position:"absolute",top:0,right:0,background:k.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[q,"x"]}),J&&/* @__PURE__ */Ke("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${k.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(e=>/* @__PURE__ */Ye("button",{type:"button",onClick:()=>Ne(e),style:{display:"block",width:"100%",padding:"6px 14px",background:e===q?k.primary+"30":"none",border:"none",color:e===q?k.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[e,"×"]},e))})]}),u&&"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&/* @__PURE__ */Ke(Wo,{onClick:ye,title:"Picture-in-Picture",primary:k.primary,active:ae,children:/* @__PURE__ */Ke(To,{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})}),h&&/* @__PURE__ */Ke("a",{href:De,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:/* @__PURE__ */Ke(To,{path:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",size:20})}),c&&/* @__PURE__ */Ke(Wo,{onClick:be,title:O?"Exit fullscreen":"Fullscreen",primary:k.primary,children:/* @__PURE__ */Ke(To,{path:O?"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})})]})]}),
216
216
  /* @__PURE__ */Ke("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 "})]})}Ao.displayName="TkxVideoPlayer";var Bo={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 Eo({size:e}){const t=.55*e;/* @__PURE__ */
217
217
  return Ke("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})}function Ho({size:e}){const t=.55*e;/* @__PURE__ */
218
218
  return Ke("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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 Fo({status:e,index:t,showStepNumbers:n,icon:o,circleSize:r,fontSize:i,primary:a,danger:l,success:s,text:d,textMuted:c,border:u,surface:h,variant:p,reducedMotion:f,clickable:m}){const g="completed"===e,x="active"===e,b="error"===e;let y=h,v=u,w=c,k=2;g?(y="filled"===p?s:h,v=s,w="filled"===p?"#fff":s):x?(y="outlined"===p?h:a,v=a,w="outlined"===p?a:"#fff",k=2):b?(y="filled"===p?l:h,v=l,w="filled"===p?"#fff":l):"pending"===e&&(y=h,v=u,w=c);const S=x&&!f?{boxShadow:`0 0 0 4px ${a}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},C=m?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let $;return $=!o||g||b?g?/* @__PURE__ */Ke(Eo,{size:r}):b?/* @__PURE__ */Ke(Ho,{size:r}):/* @__PURE__ */Ke("span",n?{style:{fontSize:i,fontWeight:600,lineHeight:1},children:t+1}:{style:{fontSize:.22*r,lineHeight:1,background:w,borderRadius:"50%",width:.22*r,height:.22*r,display:"block"}}):/* @__PURE__ */Ke("span",{style:{fontSize:i,lineHeight:1},children:o}),/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("style",{children:`\n @keyframes tkxstepper-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 ${a}50; }\n 50% { box-shadow: 0 0 0 6px ${a}20; }\n }\n `}),/* @__PURE__ */Ke("div",{style:{width:r,height:r,minWidth:r,borderRadius:"50%",border:`${k}px solid ${v}`,backgroundColor:y,color:w,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:f?"none":"background-color 0.2s, border-color 0.2s",...S,...C},children:$})]})}function jo({completed:e,orientation:t,connectorStyle:n,connectorWidth:o,primary:r,border:i,reducedMotion:a}){const l=e?r:i;/* @__PURE__ */
219
- return Ke("div","horizontal"===t?{"aria-hidden":"true",style:{flex:1,height:o,background:"solid"===n?l:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(90deg, ${l} 0, ${l} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:a?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}:{"aria-hidden":"true",style:{width:o,flex:1,minHeight:20,background:"solid"===n?l:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(180deg, ${l} 0, ${l} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:a?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function Po({steps:e,activeStep:t=0,orientation:n="horizontal",variant:o="default",size:r="md",clickable:i=!1,onStepClick:a,showStepNumbers:l=!0,alternateLabel:s=!1,connector:d="solid",className:c,style:u}){const h=N(),p=ge(),f=Bo[r],m="horizontal"===n;/* @__PURE__ */
219
+ return Ke("div","horizontal"===t?{"aria-hidden":"true",style:{flex:1,height:o,background:"solid"===n?l:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(90deg, ${l} 0, ${l} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:a?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}:{"aria-hidden":"true",style:{width:o,flex:1,minHeight:20,background:"solid"===n?l:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(180deg, ${l} 0, ${l} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:a?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function Po({steps:e,activeStep:t=0,orientation:n="horizontal",variant:o="default",size:r="md",clickable:i=!1,onStepClick:a,showStepNumbers:l=!0,alternateLabel:s=!1,connector:d="solid",className:c,style:u}){const h=M(),p=ge(),f=Bo[r],m="horizontal"===n;/* @__PURE__ */
220
220
  return Ke("div",{className:c,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:m?"row":"column",alignItems:m?s?"flex-start":"center":"stretch",width:"100%",gap:0,...u},children:e.map((n,r)=>{const c=((e,n)=>e.status?e.status:n<t?"completed":n===t?"active":"pending")(n,r),u=r===e.length-1,g="completed"===c||r<t,x=r%2==0,b=()=>{i&&a?.(r)},y=/* @__PURE__ */Ke(Fo,{status:c,index:r,showStepNumbers:l,icon:n.icon,circleSize:f.circle,fontSize:f.fontSize,primary:h.primary,danger:h.danger,success:h.success,text:h.text,textMuted:h.textMuted,border:h.border,surface:h.surface,variant:o,reducedMotion:p,clickable:i}),v=/* @__PURE__ */Ye("div",{style:{textAlign:m&&!s?"center":"left",maxWidth:m?120:void 0},children:[
221
221
  /* @__PURE__ */Ye("div",{style:{fontSize:f.titleSize,fontWeight:"active"===c?600:500,color:"pending"===c?h.textMuted:"error"===c?h.danger:h.text,lineHeight:1.3,transition:p?"none":"color 0.2s"},children:[F(n.title),n.optional&&/* @__PURE__ */Ke("span",{style:{fontSize:f.descSize,color:h.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),n.description&&/* @__PURE__ */Ke("div",{style:{fontSize:f.descSize,color:h.textMuted,marginTop:2,lineHeight:1.4},children:F(n.description)}),n.error&&"error"===c&&/* @__PURE__ */Ke("div",{style:{fontSize:f.descSize,color:h.danger,marginTop:2},children:F(n.error)})]});/* @__PURE__ */
222
222
  return Ye("div",m?{role:"listitem",style:{display:"flex",flex:u?0:1,alignItems:"center",minWidth:0},children:[/* @__PURE__ */Ye("div",{onClick:b,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:i?"pointer":"default",flexShrink:0},"aria-current":"active"===c?"step":void 0,children:[s&&!x&&/* @__PURE__ */Ke("div",{style:{minHeight:1.5*f.circle+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:v}),y,!s&&v,s&&x&&/* @__PURE__ */Ke("div",{style:{marginTop:6},children:v})]}),!u&&/* @__PURE__ */Ke(jo,{completed:g,orientation:"horizontal",connectorStyle:d,connectorWidth:f.connectorWidth,primary:h.primary,border:h.border,reducedMotion:p})]}:{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[/* @__PURE__ */Ke("div",{onClick:b,style:{cursor:i?"pointer":"default"},"aria-current":"active"===c?"step":void 0,children:y}),!u&&/* @__PURE__ */Ke(jo,{completed:g,orientation:"vertical",connectorStyle:d,connectorWidth:f.connectorWidth,primary:h.primary,border:h.border,reducedMotion:p})]}),/* @__PURE__ */Ke("div",{style:{paddingTop:(f.circle-16*parseFloat(f.titleSize))/2,paddingBottom:u?0:16,flex:1,minWidth:0},children:v})]},n.id)})})}function Oo(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),a=Math.min(t,n,o);let l=0,s=0;const d=(i+a)/2;if(i!==a){const e=i-a;switch(s=d>.5?e/(2-i-a):e/(i+a),i){case t:l=((n-o)/e+(n<o?6:0))/6;break;case n:l=((o-t)/e+2)/6;break;case o:l=((t-n)/e+4)/6}}return[Math.round(360*l),Math.round(100*s),Math.round(100*d)]}function Vo(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 Uo(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 Ko(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Yo(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Xo(e,t,n){if("hex"===n)return t<1?`${e}${Math.round(255*t).toString(16).padStart(2,"0")}`:e;const[o,r,i]=Uo(e);if("rgb"===n)return t<1?`rgba(${o}, ${r}, ${i}, ${t.toFixed(2)})`:`rgb(${o}, ${r}, ${i})`;const[a,l,s]=Oo(e);return"hsl"===n?t<1?`hsla(${a}, ${l}%, ${s}%, ${t.toFixed(2)})`:`hsl(${a}, ${l}%, ${s}%)`:e}Po.displayName="TkxStepper";var qo=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function Go({hue:e,sat:t,bright:n,onChange:o}){const r=Oe(null),i=Oe(!1),a=Ae(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)),a=Math.max(0,Math.min(1,(e.clientY-n.top)/n.height));o(Math.round(100*i),Math.round(100*(1-a)))},[o]);Ee(()=>{const e=e=>{i.current&&a(e)},t=()=>{i.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[a]);const l=`${t}%`,s=100-n+"%";/* @__PURE__ */
223
223
  return Ye("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,a(e)},children:[
224
224
  /* @__PURE__ */Ke("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),
225
225
  /* @__PURE__ */Ke("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),
226
- /* @__PURE__ */Ke("div",{style:{position:"absolute",left:l,top:s,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:Vo(e,t,n/2+25)}})]})}function _o({hue:e,onChange:t}){const n=Oe(null),o=Oe(!1),r=Ae(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 Ee(()=>{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]),/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("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 Zo({alpha:e,hex:t,onChange:n}){const o=Oe(null),r=Oe(!1),i=Ae(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]);Ee(()=>{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[a,l,s]=Uo(t);/* @__PURE__ */
227
- return Ye("div",{style:{position:"relative"},children:[/* @__PURE__ */Ke("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),/* @__PURE__ */Ke("div",{ref:o,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${a},${l},${s},0), rgba(${a},${l},${s},1))`},onMouseDown:e=>{r.current=!0,i(e)},children:/* @__PURE__ */Ke("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(${a},${l},${s},${e})`,pointerEvents:"none"}})})]})}function Jo({value:e,defaultValue:t="#3b82f6",onChange:n,format:o="hex",showAlpha:r=!1,presets:i=qo,disabled:a=!1,size:l="md",placeholder:s,label:d,style:c}){const u=N(),h=Oe(null),p=Oe(null),[f,m]=Ve(!1),g=void 0!==e,[x,b]=Ve(g&&e||t),y=g?e||t:x,[v,w]=Ve(1),[k,S]=Ve(y),[C,$]=Ve({top:0,left:0}),[z,M,I]=Oo(Yo(y)?y:t);Math.round(I+M/100*Math.min(I/100,1-I/100)*100);const L=Ae((e,t=v)=>{Yo(e)&&(S(e),g||b(e),n?.(Xo(e,t,o),o))},[v,g,o,n]);Ee(()=>{g&&e&&Yo(e)&&S(e)},[g,e]),Ee(()=>{if(!f)return;const e=e=>{p.current&&!p.current.contains(e.target)&&h.current&&!h.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]),Ee(()=>{if(!f)return;const e=e=>{"Escape"===e.key&&m(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f]);const R=e=>{w(e),n?.(Xo(y,e,o),o)},D={sm:28,md:34,lg:40}[l],[T,W,A]=Uo(Yo(y)?y:t),B={display:"inline-flex",alignItems:"center",gap:"8px",height:`${D}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${u.border}`,backgroundColor:u.surface,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,color:u.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...c},E={width:D-8+"px",height:D-8+"px",borderRadius:"4px",backgroundColor:`rgba(${T},${W},${A},${v})`,border:`1px solid ${u.border}`,flexShrink:0},H={position:"absolute",top:C.top,left:C.left,zIndex:9999,width:"260px",backgroundColor:u.surface,border:`1px solid ${u.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},F={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},j={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},P=e=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:e,border:e.toLowerCase()===y.toLowerCase()?`2px solid ${u.primary}`:`1px solid ${u.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});/* @__PURE__ */
226
+ /* @__PURE__ */Ke("div",{style:{position:"absolute",left:l,top:s,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:Vo(e,t,n/2+25)}})]})}function Jo({hue:e,onChange:t}){const n=Oe(null),o=Oe(!1),r=Ae(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 Ee(()=>{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]),/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("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 _o({alpha:e,hex:t,onChange:n}){const o=Oe(null),r=Oe(!1),i=Ae(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]);Ee(()=>{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[a,l,s]=Uo(t);/* @__PURE__ */
227
+ return Ye("div",{style:{position:"relative"},children:[/* @__PURE__ */Ke("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),/* @__PURE__ */Ke("div",{ref:o,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${a},${l},${s},0), rgba(${a},${l},${s},1))`},onMouseDown:e=>{r.current=!0,i(e)},children:/* @__PURE__ */Ke("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(${a},${l},${s},${e})`,pointerEvents:"none"}})})]})}function Zo({value:e,defaultValue:t="#3b82f6",onChange:n,format:o="hex",showAlpha:r=!1,presets:i=qo,disabled:a=!1,size:l="md",placeholder:s,label:d,style:c}){const u=M(),h=Oe(null),p=Oe(null),[f,m]=Ve(!1),g=void 0!==e,[x,b]=Ve(g&&e||t),y=g?e||t:x,[v,w]=Ve(1),[k,S]=Ve(y),[C,$]=Ve({top:0,left:0}),[z,N,I]=Oo(Yo(y)?y:t);Math.round(I+N/100*Math.min(I/100,1-I/100)*100);const R=Ae((e,t=v)=>{Yo(e)&&(S(e),g||b(e),n?.(Xo(e,t,o),o))},[v,g,o,n]);Ee(()=>{g&&e&&Yo(e)&&S(e)},[g,e]),Ee(()=>{if(!f)return;const e=e=>{p.current&&!p.current.contains(e.target)&&h.current&&!h.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]),Ee(()=>{if(!f)return;const e=e=>{"Escape"===e.key&&m(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f]);const T=e=>{w(e),n?.(Xo(y,e,o),o)},D={sm:28,md:34,lg:40}[l],[L,W,A]=Uo(Yo(y)?y:t),B={display:"inline-flex",alignItems:"center",gap:"8px",height:`${D}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${u.border}`,backgroundColor:u.surface,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,color:u.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...c},E={width:D-8+"px",height:D-8+"px",borderRadius:"4px",backgroundColor:`rgba(${L},${W},${A},${v})`,border:`1px solid ${u.border}`,flexShrink:0},H={position:"absolute",top:C.top,left:C.left,zIndex:9999,width:"260px",backgroundColor:u.surface,border:`1px solid ${u.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},F={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},j={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},P=e=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:e,border:e.toLowerCase()===y.toLowerCase()?`2px solid ${u.primary}`:`1px solid ${u.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});/* @__PURE__ */
228
228
  return Ye(Ue,{children:[d&&/* @__PURE__ */Ke("label",{style:{display:"block",fontSize:"13px",color:u.text,marginBottom:"6px",fontWeight:500},children:d}),
229
229
  /* @__PURE__ */Ye("button",{ref:h,type:"button",style:B,onClick:()=>{if(a)return;const e=h.current;if(!e)return;const t=e.getBoundingClientRect();$({top:(window.innerHeight-t.bottom>320?t.bottom+6:t.top-326)+window.scrollY,left:t.left+window.scrollX}),m(!0)},disabled:a,"aria-label":`Color picker, current color ${y}`,"aria-haspopup":"dialog","aria-expanded":f,children:[/* @__PURE__ */Ke("div",{style:E}),/* @__PURE__ */Ke("span",{style:{fontFamily:"monospace",fontSize:"12px",color:u.textMuted},children:s??Xo(Yo(y)?y:t,v,o)})]}),f&&Xe(/* @__PURE__ */Ye("div",{ref:p,style:H,role:"dialog","aria-label":"Color picker",children:[
230
- /* @__PURE__ */Ke(Go,{hue:z,sat:M,bright:I,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);L(Vo(z,Math.round(100*r),Math.round(100*o)))}}),
231
- /* @__PURE__ */Ke(_o,{hue:z,onChange:e=>{L(Vo(e,M,I))}}),r&&/* @__PURE__ */Ke(Zo,{alpha:v,hex:Yo(y)?y:t,onChange:R}),
232
- /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[/* @__PURE__ */Ke("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${T},${W},${A},${v})`,border:`1px solid ${u.border}`}}),/* @__PURE__ */Ke("input",{style:F,value:k,onChange:e=>{const t=e.target.value;S(t),Yo(t)&&L(t)},maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),
233
- /* @__PURE__ */Ye("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(e=>/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[/* @__PURE__ */Ke("input",{style:j,type:"number",min:0,max:255,value:"r"===e?T:"g"===e?W:A,onChange:t=>((e,t)=>{const n=Math.max(0,Math.min(255,parseInt(t)||0)),[o,r,i]=Uo(y);L("r"===e?Ko(n,r,i):"g"===e?Ko(o,n,i):Ko(o,r,n))})(e,t.target.value),"aria-label":`${e.toUpperCase()} channel`}),/* @__PURE__ */Ke("span",{style:{fontSize:"10px",color:u.textMuted,textTransform:"uppercase"},children:e})]},e)),r&&/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[/* @__PURE__ */Ke("input",{style:j,type:"number",min:0,max:100,value:Math.round(100*v),onChange:e=>R(Math.max(0,Math.min(1,parseInt(e.target.value)/100||0))),"aria-label":"Alpha channel"}),/* @__PURE__ */Ke("span",{style:{fontSize:"10px",color:u.textMuted},children:"A%"})]})]}),i.length>0&&/* @__PURE__ */Ye("div",{children:[/* @__PURE__ */Ke("div",{style:{fontSize:"11px",color:u.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),/* @__PURE__ */Ke("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:i.map(e=>/* @__PURE__ */Ke("button",{type:"button",style:P(e),onClick:()=>L(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)]})}var Qo={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 er(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 tr(e,t){if(void 0===t)return e;const n=Math.pow(10,t);return Math.round(e*n)/n}function nr({direction:e,isDisabled:t,btnW:n,height:o,primaryColor:r,borderColor:i,textMuted:a,iconSz:l,onStep:s,incrementLabel:d,decrementLabel:c}){const u=Oe(null),h=Oe(null),p="inc"===e?1:-1,f=Ae(()=>{s(p),u.current=setTimeout(()=>{h.current=setInterval(()=>s(p),60)},400)},[p,s]),m=Ae(()=>{u.current&&(clearTimeout(u.current),u.current=null),h.current&&(clearInterval(h.current),h.current=null)},[]);Ee(()=>()=>m(),[m]);const g="inc"===e;/* @__PURE__ */
234
- return Ke("button",{type:"button","aria-label":g?d:c,disabled:t,onMouseDown:f,onMouseUp:m,onMouseLeave:m,onTouchStart:e=>{e.preventDefault(),f()},onTouchEnd:m,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:g?void 0:`1px solid ${i}`,borderLeft:g?`1px solid ${i}`:void 0,cursor:t?"not-allowed":"pointer",color:t?a: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:g?/* @__PURE__ */Ye("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ke("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):/* @__PURE__ */Ke("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ke("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function or({value:e,defaultValue:t=0,onChange:n,min:o,max:r,step:i=1,precision:a,prefix:l,suffix:s,format:d,currency:c,locale:u,clampOnBlur:h=!0,allowMouseWheel:p=!1,size:f="md",label:m,hint:g,isDisabled:x=!1,isReadOnly:b=!1,isInvalid:y=!1,errorMessage:v,id:w,className:k,style:S}){const C=N(),$=$e(),z=$.increment??"Increment",M=$.decrement??"Decrement",I=He(),L=w??I,R=`${L}-hint`,D=`${L}-error`,T=void 0!==e,[W,A]=Ve(t),B=T?e:W,[E,H]=Ve(!1),[j,P]=Ve(""),O=Qo[f],V=y||!!v,K=V?C.danger:E?C.primary:C.border,Y=[g&&R,V&&D].filter(Boolean).join(" ")||void 0,X=m?F(m):void 0,q=g?F(g):void 0,G=v?F(v):void 0,_=l?F(l):void 0,Z=s?F(s):void 0,J=Ae(e=>{const t=tr(e,a);T||A(t),n?.(t)},[T,n,a]),Q=Ae(e=>{x||b||J(er(tr(B+e*i,a),o,r))},[x,b,B,i,a,o,r,J]),ee=E?j: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)}(B,d,c,u,a),te=(_||Z)&&!E;/* @__PURE__ */
235
- return Ye("div",{className:le(U("flex flex-col gap-1 w-full"),k),style:S,children:[X&&/* @__PURE__ */Ke("label",{htmlFor:L,className:U("text-sm font-medium font-sans"),style:{color:C.text},children:X}),
230
+ /* @__PURE__ */Ke(Go,{hue:z,sat:N,bright:I,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(Vo(z,Math.round(100*r),Math.round(100*o)))}}),
231
+ /* @__PURE__ */Ke(Jo,{hue:z,onChange:e=>{R(Vo(e,N,I))}}),r&&/* @__PURE__ */Ke(_o,{alpha:v,hex:Yo(y)?y:t,onChange:T}),
232
+ /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[/* @__PURE__ */Ke("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${L},${W},${A},${v})`,border:`1px solid ${u.border}`}}),/* @__PURE__ */Ke("input",{style:F,value:k,onChange:e=>{const t=e.target.value;S(t),Yo(t)&&R(t)},maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),
233
+ /* @__PURE__ */Ye("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(e=>/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[/* @__PURE__ */Ke("input",{style:j,type:"number",min:0,max:255,value:"r"===e?L:"g"===e?W:A,onChange:t=>((e,t)=>{const n=Math.max(0,Math.min(255,parseInt(t)||0)),[o,r,i]=Uo(y);R("r"===e?Ko(n,r,i):"g"===e?Ko(o,n,i):Ko(o,r,n))})(e,t.target.value),"aria-label":`${e.toUpperCase()} channel`}),/* @__PURE__ */Ke("span",{style:{fontSize:"10px",color:u.textMuted,textTransform:"uppercase"},children:e})]},e)),r&&/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[/* @__PURE__ */Ke("input",{style:j,type:"number",min:0,max:100,value:Math.round(100*v),onChange:e=>T(Math.max(0,Math.min(1,parseInt(e.target.value)/100||0))),"aria-label":"Alpha channel"}),/* @__PURE__ */Ke("span",{style:{fontSize:"10px",color:u.textMuted},children:"A%"})]})]}),i.length>0&&/* @__PURE__ */Ye("div",{children:[/* @__PURE__ */Ke("div",{style:{fontSize:"11px",color:u.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),/* @__PURE__ */Ke("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:i.map(e=>/* @__PURE__ */Ke("button",{type:"button",style:P(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)]})}var Qo={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 er(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 tr(e,t){if(void 0===t)return e;const n=Math.pow(10,t);return Math.round(e*n)/n}function nr({direction:e,isDisabled:t,btnW:n,height:o,primaryColor:r,borderColor:i,textMuted:a,iconSz:l,onStep:s,incrementLabel:d,decrementLabel:c}){const u=Oe(null),h=Oe(null),p="inc"===e?1:-1,f=Ae(()=>{s(p),u.current=setTimeout(()=>{h.current=setInterval(()=>s(p),60)},400)},[p,s]),m=Ae(()=>{u.current&&(clearTimeout(u.current),u.current=null),h.current&&(clearInterval(h.current),h.current=null)},[]);Ee(()=>()=>m(),[m]);const g="inc"===e;/* @__PURE__ */
234
+ return Ke("button",{type:"button","aria-label":g?d:c,disabled:t,onMouseDown:f,onMouseUp:m,onMouseLeave:m,onTouchStart:e=>{e.preventDefault(),f()},onTouchEnd:m,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:g?void 0:`1px solid ${i}`,borderLeft:g?`1px solid ${i}`:void 0,cursor:t?"not-allowed":"pointer",color:t?a: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:g?/* @__PURE__ */Ye("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ke("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):/* @__PURE__ */Ke("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ke("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function or({value:e,defaultValue:t=0,onChange:n,min:o,max:r,step:i=1,precision:a,prefix:l,suffix:s,format:d,currency:c,locale:u,clampOnBlur:h=!0,allowMouseWheel:p=!1,size:f="md",label:m,hint:g,isDisabled:x=!1,isReadOnly:b=!1,isInvalid:y=!1,errorMessage:v,id:w,className:k,style:S}){const C=M(),$=$e(),z=$.increment??"Increment",N=$.decrement??"Decrement",I=He(),R=w??I,T=`${R}-hint`,D=`${R}-error`,L=void 0!==e,[W,A]=Ve(t),B=L?e:W,[E,H]=Ve(!1),[j,P]=Ve(""),O=Qo[f],V=y||!!v,K=V?C.danger:E?C.primary:C.border,Y=[g&&T,V&&D].filter(Boolean).join(" ")||void 0,X=m?F(m):void 0,q=g?F(g):void 0,G=v?F(v):void 0,J=l?F(l):void 0,_=s?F(s):void 0,Z=Ae(e=>{const t=tr(e,a);L||A(t),n?.(t)},[L,n,a]),Q=Ae(e=>{x||b||Z(er(tr(B+e*i,a),o,r))},[x,b,B,i,a,o,r,Z]),ee=E?j: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)}(B,d,c,u,a),te=(J||_)&&!E;/* @__PURE__ */
235
+ return Ye("div",{className:le(U("flex flex-col gap-1 w-full"),k),style:S,children:[X&&/* @__PURE__ */Ke("label",{htmlFor:R,className:U("text-sm font-medium font-sans"),style:{color:C.text},children:X}),
236
236
  /* @__PURE__ */Ye("div",{className:U("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${K}`,backgroundColor:x?C.surfaceAlt:C.surface,opacity:x?.65:1,height:O.height},children:[
237
- /* @__PURE__ */Ke(nr,{direction:"dec",isDisabled:x||b,btnW:O.btnW,height:O.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:O.iconSz,onStep:Q,incrementLabel:z,decrementLabel:M}),
238
- /* @__PURE__ */Ye("div",{className:U("relative flex-1 flex items-center overflow-hidden"),children:[te&&_&&/* @__PURE__ */Ke("span",{style:{position:"absolute",left:O.px,fontSize:O.fontSize,color:C.textMuted,pointerEvents:"none",userSelect:"none"},children:_}),
239
- /* @__PURE__ */Ke("input",{id:L,type:"text",inputMode:"decimal",value:E?j:ee,readOnly:b,disabled:x,"aria-invalid":V,"aria-describedby":Y,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":B,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:O.fontSize,fontFamily:"inherit",color:C.text,paddingLeft:te&&_?`calc(${O.px} + 1.2em)`:O.px,paddingRight:te&&Z?`calc(${O.px} + 1.2em)`:O.px,cursor:x?"not-allowed":b?"default":"text"},onFocus:()=>{H(!0),P(String(B))},onBlur:()=>{H(!1);const e=parseFloat(j);if(isNaN(e))return n?.(null),void P(String(B));let t=tr(e,a);h&&(t=er(t,o,r)),J(t)},onChange:e=>{P(e.target.value)},onKeyDown:e=>{"ArrowUp"===e.key&&(e.preventDefault(),Q(1)),"ArrowDown"===e.key&&(e.preventDefault(),Q(-1))},onWheel:e=>{p&&E&&(e.preventDefault(),Q(e.deltaY<0?1:-1))}}),te&&Z&&/* @__PURE__ */Ke("span",{style:{position:"absolute",right:O.px,fontSize:O.fontSize,color:C.textMuted,pointerEvents:"none",userSelect:"none"},children:Z})]}),
240
- /* @__PURE__ */Ke(nr,{direction:"inc",isDisabled:x||b,btnW:O.btnW,height:O.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:O.iconSz,onStep:Q,incrementLabel:z,decrementLabel:M})]}),q&&!G&&/* @__PURE__ */Ke("span",{id:R,className:U("text-xs"),style:{color:C.textMuted},children:q}),G&&/* @__PURE__ */Ye("span",{id:D,role:"alert",className:U("text-xs flex items-center gap-1"),style:{color:C.danger},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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]})]})}or.displayName="TkxNumberInput";var rr={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},ir={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function ar(e,t){return ir[t].test(e)?e.toUpperCase():""}function lr({length:e=6,value:t,onChange:n,onComplete:o,type:r="number",mask:i=!1,autoFocus:a=!1,isDisabled:l=!1,isInvalid:s=!1,errorMessage:d,hint:c,size:u="md",separator:h,separatorPosition:p,webOTP:f=!0,className:m,style:g}){const x=N(),b=$e(),y=He(),v=`${y}-hint`,w=`${y}-error`,k=void 0!==t,S=t=>{const n=t.split("").slice(0,e);for(;n.length<e;)n.push("");return n},[C,$]=Ve(()=>S(k?t:"")),z=k?S(t):C,M=Oe([]),I=rr[u],L=s||!!d,R=z.every(e=>""!==e),D=c?F(c):void 0,T=d?F(d):void 0,W=e=>L?x.danger:R?x.success:x.border;Ee(()=>{a&&M.current[0]?.focus()},[]);const A=Ae(e=>{k||$(e);const t=e.join("");n?.(t),e.every(e=>""!==e)&&o?.(t)},[k,n,o]);Ee(()=>{if(!f||l)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=>ar(e,r));for(;n.length<e;)n.push("");A(n)}).catch(()=>{}),()=>t.abort()},[f,l,e,r]);const B=t=>{const n=Math.max(0,Math.min(e-1,t));M.current[n]?.focus()},E=t=>n=>{if(!l){if("Backspace"!==n.key){if("Delete"===n.key){n.preventDefault();const e=[...z];return e[t]="",void A(e)}return"ArrowLeft"===n.key?(n.preventDefault(),void B(t-1)):"ArrowRight"===n.key?(n.preventDefault(),void B(t+1)):"Home"===n.key?(n.preventDefault(),void B(0)):"End"===n.key?(n.preventDefault(),void B(e-1)):void 0}if(n.preventDefault(),""!==z[t]){const e=[...z];e[t]="",A(e)}else if(t>0){const e=[...z];e[t-1]="",A(e),B(t-1)}}},H=t=>n=>{if(l)return;const o=n.target.value.slice(-1);if(!o)return;const i=ar(o,r);if(!i)return;const a=[...z];a[t]=i,A(a),t<e-1&&B(t+1)},j=t=>n=>{if(n.preventDefault(),l)return;const o=n.clipboardData.getData("text").split("").map(e=>ar(e,r)).filter(Boolean);if(!o.length)return;const i=[...z];let a=t;for(const t of o){if(a>=e)break;i[a]=t,a++}A(i),B(Math.min(a,e-1))},P=[D&&v,L&&w].filter(Boolean).join(" ")||void 0;/* @__PURE__ */
237
+ /* @__PURE__ */Ke(nr,{direction:"dec",isDisabled:x||b,btnW:O.btnW,height:O.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:O.iconSz,onStep:Q,incrementLabel:z,decrementLabel:N}),
238
+ /* @__PURE__ */Ye("div",{className:U("relative flex-1 flex items-center overflow-hidden"),children:[te&&J&&/* @__PURE__ */Ke("span",{style:{position:"absolute",left:O.px,fontSize:O.fontSize,color:C.textMuted,pointerEvents:"none",userSelect:"none"},children:J}),
239
+ /* @__PURE__ */Ke("input",{id:R,type:"text",inputMode:"decimal",value:E?j:ee,readOnly:b,disabled:x,"aria-invalid":V,"aria-describedby":Y,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":B,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:O.fontSize,fontFamily:"inherit",color:C.text,paddingLeft:te&&J?`calc(${O.px} + 1.2em)`:O.px,paddingRight:te&&_?`calc(${O.px} + 1.2em)`:O.px,cursor:x?"not-allowed":b?"default":"text"},onFocus:()=>{H(!0),P(String(B))},onBlur:()=>{H(!1);const e=parseFloat(j);if(isNaN(e))return n?.(null),void P(String(B));let t=tr(e,a);h&&(t=er(t,o,r)),Z(t)},onChange:e=>{P(e.target.value)},onKeyDown:e=>{"ArrowUp"===e.key&&(e.preventDefault(),Q(1)),"ArrowDown"===e.key&&(e.preventDefault(),Q(-1))},onWheel:e=>{p&&E&&(e.preventDefault(),Q(e.deltaY<0?1:-1))}}),te&&_&&/* @__PURE__ */Ke("span",{style:{position:"absolute",right:O.px,fontSize:O.fontSize,color:C.textMuted,pointerEvents:"none",userSelect:"none"},children:_})]}),
240
+ /* @__PURE__ */Ke(nr,{direction:"inc",isDisabled:x||b,btnW:O.btnW,height:O.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:O.iconSz,onStep:Q,incrementLabel:z,decrementLabel:N})]}),q&&!G&&/* @__PURE__ */Ke("span",{id:T,className:U("text-xs"),style:{color:C.textMuted},children:q}),G&&/* @__PURE__ */Ye("span",{id:D,role:"alert",className:U("text-xs flex items-center gap-1"),style:{color:C.danger},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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]})]})}or.displayName="TkxNumberInput";var rr={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},ir={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function ar(e,t){return ir[t].test(e)?e.toUpperCase():""}function lr({length:e=6,value:t,onChange:n,onComplete:o,type:r="number",mask:i=!1,autoFocus:a=!1,isDisabled:l=!1,isInvalid:s=!1,errorMessage:d,hint:c,size:u="md",separator:h,separatorPosition:p,webOTP:f=!0,className:m,style:g}){const x=M(),b=$e(),y=He(),v=`${y}-hint`,w=`${y}-error`,k=void 0!==t,S=t=>{const n=t.split("").slice(0,e);for(;n.length<e;)n.push("");return n},[C,$]=Ve(()=>S(k?t:"")),z=k?S(t):C,N=Oe([]),I=rr[u],R=s||!!d,T=z.every(e=>""!==e),D=c?F(c):void 0,L=d?F(d):void 0,W=e=>R?x.danger:T?x.success:x.border;Ee(()=>{a&&N.current[0]?.focus()},[]);const A=Ae(e=>{k||$(e);const t=e.join("");n?.(t),e.every(e=>""!==e)&&o?.(t)},[k,n,o]);Ee(()=>{if(!f||l)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=>ar(e,r));for(;n.length<e;)n.push("");A(n)}).catch(()=>{}),()=>t.abort()},[f,l,e,r]);const B=t=>{const n=Math.max(0,Math.min(e-1,t));N.current[n]?.focus()},E=t=>n=>{if(!l){if("Backspace"!==n.key){if("Delete"===n.key){n.preventDefault();const e=[...z];return e[t]="",void A(e)}return"ArrowLeft"===n.key?(n.preventDefault(),void B(t-1)):"ArrowRight"===n.key?(n.preventDefault(),void B(t+1)):"Home"===n.key?(n.preventDefault(),void B(0)):"End"===n.key?(n.preventDefault(),void B(e-1)):void 0}if(n.preventDefault(),""!==z[t]){const e=[...z];e[t]="",A(e)}else if(t>0){const e=[...z];e[t-1]="",A(e),B(t-1)}}},H=t=>n=>{if(l)return;const o=n.target.value.slice(-1);if(!o)return;const i=ar(o,r);if(!i)return;const a=[...z];a[t]=i,A(a),t<e-1&&B(t+1)},j=t=>n=>{if(n.preventDefault(),l)return;const o=n.clipboardData.getData("text").split("").map(e=>ar(e,r)).filter(Boolean);if(!o.length)return;const i=[...z];let a=t;for(const t of o){if(a>=e)break;i[a]=t,a++}A(i),B(Math.min(a,e-1))},P=[D&&v,R&&w].filter(Boolean).join(" ")||void 0;/* @__PURE__ */
241
241
  return Ye("div",{className:le(U("flex flex-col gap-2 w-fit"),m),style:g,children:[
242
- /* @__PURE__ */Ke("div",{role:"group","aria-label":b.oneTimePassword??"One-time password","aria-describedby":P,className:U("flex items-center"),style:{gap:I.gap},children:Array.from({length:e},(t,n)=>{const o=W();return"undefined"!=typeof document&&(document.activeElement,M.current[n]/* @__PURE__ */),Ye("div",{className:U("flex items-center"),style:{gap:I.gap},children:[h&&p===n&&0!==n&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{color:x.textMuted,userSelect:"none",flexShrink:0},children:h}),/* @__PURE__ */Ke("input",{ref:e=>{M.current[n]=e},type:i?"password":"text",inputMode:"number"===r?"numeric":"text",maxLength:1,value:z[n],disabled:l,"aria-label":`Digit ${n+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:H(n),onKeyDown:E(n),onPaste:j(n),onFocus:e=>e.target.select(),style:{width:I.box,height:I.box,textAlign:"center",fontSize:I.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${o}`,borderRadius:"8px",backgroundColor:l?x.surfaceAlt:x.surface,color:x.text,outline:"none",boxShadow:"none",cursor:l?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:l?.6:1},onFocusCapture:e=>{l||(e.currentTarget.style.borderColor=L?x.danger:x.primary,e.currentTarget.style.boxShadow=`0 0 0 3px ${L?x.danger:x.primary}33`)},onBlurCapture:e=>{e.currentTarget.style.borderColor=W(),e.currentTarget.style.boxShadow="none"}})]},n)})}),D&&!T&&/* @__PURE__ */Ke("span",{id:v,className:U("text-xs"),style:{color:x.textMuted},children:D}),T&&/* @__PURE__ */Ye("span",{id:w,role:"alert",className:U("text-xs flex items-center gap-1"),style:{color:x.danger},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})}),T]})]})}function sr(){const[e,t]=Ve(!1);return{isOpen:e,open:Ae(()=>t(!0),[]),close:Ae(()=>t(!1),[]),toggle:Ae(()=>t(e=>!e),[])}}function dr(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 a=0,l=-1,s=-1;for(let d=0;d<o.length&&a<n.length;d++)o[d]===n[a]&&(-1!==s&&d===s+1||(-1!==l&&i.push([l,s]),l=d),s=d,a++);return-1!==l&&-1!==s&&i.push([l,s]),a<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:i,score:40}}function cr({text:e,ranges:t,color:n}){if(!t.length)/* @__PURE__ */return Ke(Ue,{children:e});const o=[];let r=0;for(const[i,a]of t)r<i&&o.push(/* @__PURE__ */Ke("span",{children:e.slice(r,i)},`t-${r}`)),o.push(/* @__PURE__ */Ke("span",{style:{color:n,fontWeight:700},children:e.slice(i,a+1)},`h-${i}`)),r=a+1;return r<e.length&&o.push(/* @__PURE__ */Ke("span",{children:e.slice(r)},"t-end")),/* @__PURE__ */Ke(Ue,{children:o})}function ur({surface:e,border:t}){/* @__PURE__ */
243
- return Ye("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[/* @__PURE__ */Ke("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}}),/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[/* @__PURE__ */Ke("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"}}),/* @__PURE__ */Ke("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 hr({items:e,isOpen:t=!1,onClose:n,placeholder:o,emptyMessage:r,maxItems:i=8,onItemSelect:a,className:l,style:s}){const d=N(),c=$e(),u=o??c.commandSearch??"Type a command or search…",[h,p]=Ve(""),[f,m]=Ve(0),[g,x]=Ve(!1),b=Oe(null),y=Oe(null),v=He(),w=function(e){const t=Oe(null);return Ee(()=>{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],a=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(e.preventDefault(),i?.focus()):document.activeElement===i&&(e.preventDefault(),r?.focus()))};return n.addEventListener("keydown",a),()=>n.removeEventListener("keydown",a)},[e]),t}(t),k=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=dr(e,o.label),r=o.description?dr(e,o.description):{matched:!1,score:0},i=(o.keywords??[]).some(t=>dr(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)}(h,e).slice(0,i),S=[];for(const N of k){const e=N.item.group,t=S.find(t=>t.group===e);t?t.items.push(N):S.push({group:e,items:[N]})}const C=S.flatMap(e=>e.items);var $,z;Ee(()=>{if(!z)return;const e=e=>{"Escape"===e.key&&$()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[$=()=>{n?.()},z=t]),Ee(()=>{t&&(p(""),m(0),setTimeout(()=>b.current?.focus(),30))},[t]),Ee(()=>{f>=C.length&&m(Math.max(0,C.length-1))},[C.length,f]);const M=Ae(e=>{const t=y.current;t&&t.querySelectorAll("[data-command-item]")[e]?.scrollIntoView({block:"nearest"})},[]),I=e=>{e.disabled||(e.onSelect?.(),a?.(e),n?.())};if(!t||"undefined"==typeof document)return null;const L=F(u),R=c.noCommandsFound??`No results for "${F(h)}"`,D=r?F(r):R;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 Xe(/* @__PURE__ */Ye("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[/* @__PURE__ */Ke("div",{"aria-hidden":"true",onClick:n,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",animation:"tkx-fade-in 120ms ease"}}),/* @__PURE__ */Ye("div",{ref:w,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:v,className:le(l),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:d.surface,border:`1px solid ${d.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${d.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...s},children:[
242
+ /* @__PURE__ */Ke("div",{role:"group","aria-label":b.oneTimePassword??"One-time password","aria-describedby":P,className:U("flex items-center"),style:{gap:I.gap},children:Array.from({length:e},(t,n)=>{const o=W();return"undefined"!=typeof document&&(document.activeElement,N.current[n]/* @__PURE__ */),Ye("div",{className:U("flex items-center"),style:{gap:I.gap},children:[h&&p===n&&0!==n&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{color:x.textMuted,userSelect:"none",flexShrink:0},children:h}),/* @__PURE__ */Ke("input",{ref:e=>{N.current[n]=e},type:i?"password":"text",inputMode:"number"===r?"numeric":"text",maxLength:1,value:z[n],disabled:l,"aria-label":`Digit ${n+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:H(n),onKeyDown:E(n),onPaste:j(n),onFocus:e=>e.target.select(),style:{width:I.box,height:I.box,textAlign:"center",fontSize:I.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${o}`,borderRadius:"8px",backgroundColor:l?x.surfaceAlt:x.surface,color:x.text,outline:"none",boxShadow:"none",cursor:l?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:l?.6:1},onFocusCapture:e=>{l||(e.currentTarget.style.borderColor=R?x.danger:x.primary,e.currentTarget.style.boxShadow=`0 0 0 3px ${R?x.danger:x.primary}33`)},onBlurCapture:e=>{e.currentTarget.style.borderColor=W(),e.currentTarget.style.boxShadow="none"}})]},n)})}),D&&!L&&/* @__PURE__ */Ke("span",{id:v,className:U("text-xs"),style:{color:x.textMuted},children:D}),L&&/* @__PURE__ */Ye("span",{id:w,role:"alert",className:U("text-xs flex items-center gap-1"),style:{color:x.danger},children:[/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})}),L]})]})}function sr(){const[e,t]=Ve(!1);return{isOpen:e,open:Ae(()=>t(!0),[]),close:Ae(()=>t(!1),[]),toggle:Ae(()=>t(e=>!e),[])}}function dr(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 a=0,l=-1,s=-1;for(let d=0;d<o.length&&a<n.length;d++)o[d]===n[a]&&(-1!==s&&d===s+1||(-1!==l&&i.push([l,s]),l=d),s=d,a++);return-1!==l&&-1!==s&&i.push([l,s]),a<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:i,score:40}}function cr({text:e,ranges:t,color:n}){if(!t.length)/* @__PURE__ */return Ke(Ue,{children:e});const o=[];let r=0;for(const[i,a]of t)r<i&&o.push(/* @__PURE__ */Ke("span",{children:e.slice(r,i)},`t-${r}`)),o.push(/* @__PURE__ */Ke("span",{style:{color:n,fontWeight:700},children:e.slice(i,a+1)},`h-${i}`)),r=a+1;return r<e.length&&o.push(/* @__PURE__ */Ke("span",{children:e.slice(r)},"t-end")),/* @__PURE__ */Ke(Ue,{children:o})}function ur({surface:e,border:t}){/* @__PURE__ */
243
+ return Ye("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[/* @__PURE__ */Ke("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}}),/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[/* @__PURE__ */Ke("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"}}),/* @__PURE__ */Ke("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 hr({items:e,isOpen:t=!1,onClose:n,placeholder:o,emptyMessage:r,maxItems:i=8,onItemSelect:a,className:l,style:s}){const d=M(),c=$e(),u=o??c.commandSearch??"Type a command or search…",[h,p]=Ve(""),[f,m]=Ve(0),[g,x]=Ve(!1),b=Oe(null),y=Oe(null),v=He(),w=function(e){const t=Oe(null);return Ee(()=>{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],a=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(e.preventDefault(),i?.focus()):document.activeElement===i&&(e.preventDefault(),r?.focus()))};return n.addEventListener("keydown",a),()=>n.removeEventListener("keydown",a)},[e]),t}(t),k=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=dr(e,o.label),r=o.description?dr(e,o.description):{matched:!1,score:0},i=(o.keywords??[]).some(t=>dr(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)}(h,e).slice(0,i),S=[];for(const M of k){const e=M.item.group,t=S.find(t=>t.group===e);t?t.items.push(M):S.push({group:e,items:[M]})}const C=S.flatMap(e=>e.items);var $,z;Ee(()=>{if(!z)return;const e=e=>{"Escape"===e.key&&$()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[$=()=>{n?.()},z=t]),Ee(()=>{t&&(p(""),m(0),setTimeout(()=>b.current?.focus(),30))},[t]),Ee(()=>{f>=C.length&&m(Math.max(0,C.length-1))},[C.length,f]);const N=Ae(e=>{const t=y.current;t&&t.querySelectorAll("[data-command-item]")[e]?.scrollIntoView({block:"nearest"})},[]),I=e=>{e.disabled||(e.onSelect?.(),a?.(e),n?.())};if(!t||"undefined"==typeof document)return null;const R=F(u),T=c.noCommandsFound??`No results for "${F(h)}"`,D=r?F(r):T;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 Xe(/* @__PURE__ */Ye("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[/* @__PURE__ */Ke("div",{"aria-hidden":"true",onClick:n,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",animation:"tkx-fade-in 120ms ease"}}),/* @__PURE__ */Ye("div",{ref:w,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:v,className:le(l),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:d.surface,border:`1px solid ${d.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${d.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...s},children:[
244
244
  /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 16px",borderBottom:`1px solid ${d.border}`},children:[
245
245
  /* @__PURE__ */Ye("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:d.textMuted,strokeWidth:2,"aria-hidden":"true",style:{flexShrink:0},children:[/* @__PURE__ */Ke("circle",{cx:"11",cy:"11",r:"8"}),/* @__PURE__ */Ke("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),
246
- /* @__PURE__ */Ke("input",{ref:b,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${v}-list`,"aria-activedescendant":C[f]?`${v}-item-${C[f].item.id}`:void 0,value:h,onChange:e=>{p(e.target.value),m(0)},onKeyDown:e=>{if("ArrowDown"===e.key){e.preventDefault();const t=Math.min(C.length-1,f+1);m(t),M(t)}else if("ArrowUp"===e.key){e.preventDefault();const t=Math.max(0,f-1);m(t),M(t)}else if("Enter"===e.key){e.preventDefault();const t=C[f];t&&I(t.item)}},placeholder:L,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:d.text}}),h&&/* @__PURE__ */Ke("button",{type:"button","aria-label":c.clearSelection,onClick:()=>{p(""),m(0),b.current?.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:d.textMuted,display:"flex",alignItems:"center",padding:0},children:/* @__PURE__ */Ye("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),
246
+ /* @__PURE__ */Ke("input",{ref:b,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${v}-list`,"aria-activedescendant":C[f]?`${v}-item-${C[f].item.id}`:void 0,value:h,onChange:e=>{p(e.target.value),m(0)},onKeyDown:e=>{if("ArrowDown"===e.key){e.preventDefault();const t=Math.min(C.length-1,f+1);m(t),N(t)}else if("ArrowUp"===e.key){e.preventDefault();const t=Math.max(0,f-1);m(t),N(t)}else if("Enter"===e.key){e.preventDefault();const t=C[f];t&&I(t.item)}},placeholder:R,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:d.text}}),h&&/* @__PURE__ */Ke("button",{type:"button","aria-label":c.clearSelection,onClick:()=>{p(""),m(0),b.current?.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:d.textMuted,display:"flex",alignItems:"center",padding:0},children:/* @__PURE__ */Ye("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),
247
247
  /* @__PURE__ */Ke("div",{id:`${v}-list`,ref:y,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:g?Array.from({length:4},(e,t)=>/* @__PURE__ */Ke(ur,{surface:d.surface,border:d.border},t)):0===C.length?/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:d.textMuted},children:[/* @__PURE__ */Ye("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:[
248
248
  /* @__PURE__ */Ke("circle",{cx:"11",cy:"11",r:"8"}),
249
249
  /* @__PURE__ */Ke("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),
@@ -254,107 +254,107 @@ return Ye("div",{id:`${v}-item-${i.id}`,role:"option","aria-selected":r,"aria-di
254
254
  /* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ke("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),
255
255
  /* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ke("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),
256
256
  /* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ke("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}function pr({direction:e,onClick:t,isDisabled:n,primaryColor:o,position:r,orientation:i}){const a="vertical"===i,l="prev"===e,s="inside"===r?{position:"absolute",zIndex:3,...a?{[l?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[l?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};/* @__PURE__ */
257
- return Ke("button",{type:"button","aria-label":l?"Previous slide":"Next slide",disabled:n,onClick:t,style:{...s,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:/* @__PURE__ */Ke("svg",a?l?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"18 15 12 9 6 15"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"6 9 12 15 18 9"})}:l?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"15 18 9 12 15 6"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"9 18 15 12 9 6"})})})}function fr({slides:e,autoPlay:t=!1,autoPlayInterval:n=4e3,pauseOnHover:o=!0,loop:r=!0,showArrows:i=!0,showDots:a=!0,showThumbnails:l=!1,orientation:s="horizontal",slidesToShow:d=1,gap:c=0,transitionDuration:u=400,swipeable:h=!0,initialIndex:p=0,onChange:f,arrowPosition:m="inside",height:g=320,className:x,style:b}){const y=N(),v=ge(),w=He(),k=e.length,[S,C]=Ve(p),[$,z]=Ve(r?p+1:p),[M,I]=Ve(!1),[L,R]=Ve(!1),D=Oe(null),T=Oe(null),W=Oe(null),A=Oe(0),B=Oe(!1),E="vertical"===s,H=v?0:u,F=r&&k>1?[e[k-1],...e,e[0]]:e,j=F.length,P=100/d,O=(e,t=0)=>{const n=0!==t?` - ${t}px`:"";return E?`translateY(calc(-${e*P}%${n}))`:`translateX(calc(-${e*P}%${n}))`},V=Ae((e,t=!1)=>{const n=r?(e%k+k)%k:Math.max(0,Math.min(k-1,e)),o=r?n+1:n;t&&D.current?(D.current.style.transition="none",z(o),C(n),D.current.offsetHeight,D.current.style.transition=""):(I(!0),z(o),C(n)),f?.(n)},[k,r,f]),K=Ae(()=>V(S-1),[S,V]),Y=Ae(()=>V(S+1),[S,V]),X=Ae(()=>{I(!1),!r||k<=1||(0===$?V(k-1,!0):$===j-1&&V(0,!0))},[r,k,$,j,V]);Ee(()=>{if(!(!t||L||k<=1))return T.current=setInterval(Y,n),()=>{T.current&&clearInterval(T.current)}},[t,L,n,Y,k]),Ee(()=>{const e=e=>{const t=document.activeElement;document.getElementById(w)?.contains(t)&&(e.key===(E?"ArrowUp":"ArrowLeft")&&(e.preventDefault(),K()),e.key===(E?"ArrowDown":"ArrowRight")&&(e.preventDefault(),Y()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[w,E,K,Y]);const q=e=>"touches"in e?E?e.touches[0].clientY:e.touches[0].clientX:E?e.clientY:e.clientX,G=e=>{h&&(W.current=q(e),A.current=0,B.current=!0)},_=e=>{if(!B.current||null===W.current)return;const t=q(e)-W.current;A.current=t,D.current&&(D.current.style.transition="none",D.current.style.transform=O($,-t))},Z=()=>{if(!B.current)return;B.current=!1;const e=A.current;D.current&&(D.current.style.transition="",D.current.style.transform=""),e<-50?Y():e>50?K():D.current&&(D.current.style.transform=O($)),W.current=null,A.current=0},J="number"==typeof g?`${g}px`:g,Q={display:"flex",flexDirection:E?"column":"row",width:E?"100%":j/d*100+"%",height:E?j/d*100+"%":"100%",transform:O($),transition:M||!v?`transform ${H}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:c>0?c:void 0},ee={flexShrink:0,width:E?"100%":P/(j/d)+"%",height:E?P/(j/d)+"%":"100%",overflow:"hidden",position:"relative"},te=r||S>0,ne=r||S<k-1,oe="outside"===m;/* @__PURE__ */
257
+ return Ke("button",{type:"button","aria-label":l?"Previous slide":"Next slide",disabled:n,onClick:t,style:{...s,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:/* @__PURE__ */Ke("svg",a?l?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"18 15 12 9 6 15"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"6 9 12 15 18 9"})}:l?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"15 18 9 12 15 6"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ke("polyline",{points:"9 18 15 12 9 6"})})})}function fr({slides:e,autoPlay:t=!1,autoPlayInterval:n=4e3,pauseOnHover:o=!0,loop:r=!0,showArrows:i=!0,showDots:a=!0,showThumbnails:l=!1,orientation:s="horizontal",slidesToShow:d=1,gap:c=0,transitionDuration:u=400,swipeable:h=!0,initialIndex:p=0,onChange:f,arrowPosition:m="inside",height:g=320,className:x,style:b}){const y=M(),v=ge(),w=He(),k=e.length,[S,C]=Ve(p),[$,z]=Ve(r?p+1:p),[N,I]=Ve(!1),[R,T]=Ve(!1),D=Oe(null),L=Oe(null),W=Oe(null),A=Oe(0),B=Oe(!1),E="vertical"===s,H=v?0:u,F=r&&k>1?[e[k-1],...e,e[0]]:e,j=F.length,P=100/d,O=(e,t=0)=>{const n=0!==t?` - ${t}px`:"";return E?`translateY(calc(-${e*P}%${n}))`:`translateX(calc(-${e*P}%${n}))`},V=Ae((e,t=!1)=>{const n=r?(e%k+k)%k:Math.max(0,Math.min(k-1,e)),o=r?n+1:n;t&&D.current?(D.current.style.transition="none",z(o),C(n),D.current.offsetHeight,D.current.style.transition=""):(I(!0),z(o),C(n)),f?.(n)},[k,r,f]),K=Ae(()=>V(S-1),[S,V]),Y=Ae(()=>V(S+1),[S,V]),X=Ae(()=>{I(!1),!r||k<=1||(0===$?V(k-1,!0):$===j-1&&V(0,!0))},[r,k,$,j,V]);Ee(()=>{if(!(!t||R||k<=1))return L.current=setInterval(Y,n),()=>{L.current&&clearInterval(L.current)}},[t,R,n,Y,k]),Ee(()=>{const e=e=>{const t=document.activeElement;document.getElementById(w)?.contains(t)&&(e.key===(E?"ArrowUp":"ArrowLeft")&&(e.preventDefault(),K()),e.key===(E?"ArrowDown":"ArrowRight")&&(e.preventDefault(),Y()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[w,E,K,Y]);const q=e=>"touches"in e?E?e.touches[0].clientY:e.touches[0].clientX:E?e.clientY:e.clientX,G=e=>{h&&(W.current=q(e),A.current=0,B.current=!0)},J=e=>{if(!B.current||null===W.current)return;const t=q(e)-W.current;A.current=t,D.current&&(D.current.style.transition="none",D.current.style.transform=O($,-t))},_=()=>{if(!B.current)return;B.current=!1;const e=A.current;D.current&&(D.current.style.transition="",D.current.style.transform=""),e<-50?Y():e>50?K():D.current&&(D.current.style.transform=O($)),W.current=null,A.current=0},Z="number"==typeof g?`${g}px`:g,Q={display:"flex",flexDirection:E?"column":"row",width:E?"100%":j/d*100+"%",height:E?j/d*100+"%":"100%",transform:O($),transition:N||!v?`transform ${H}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:c>0?c:void 0},ee={flexShrink:0,width:E?"100%":P/(j/d)+"%",height:E?P/(j/d)+"%":"100%",overflow:"hidden",position:"relative"},te=r||S>0,ne=r||S<k-1,oe="outside"===m;/* @__PURE__ */
258
258
  return Ye("div",{id:w,className:le(U("flex flex-col gap-2"),x),style:b,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[/* @__PURE__ */Ye("div",{className:U("flex items-center gap-2"),style:{gap:oe&&i?8:0},children:[i&&oe&&/* @__PURE__ */Ke(pr,{direction:"prev",onClick:K,isDisabled:!te,primaryColor:y.primary,position:"outside",orientation:s}),
259
- /* @__PURE__ */Ye("div",{style:{position:"relative",flex:1,overflow:"hidden",height:J,borderRadius:12,cursor:h?B.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>o&&R(!0),onMouseLeave:()=>{R(!1),Z()},onTouchStart:G,onTouchMove:_,onTouchEnd:Z,onMouseDown:G,onMouseMove:_,onMouseUp:Z,"aria-live":"polite","aria-atomic":"false",children:[i&&!oe&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke(pr,{direction:"prev",onClick:K,isDisabled:!te,primaryColor:y.primary,position:"inside",orientation:s}),/* @__PURE__ */Ke(pr,{direction:"next",onClick:Y,isDisabled:!ne,primaryColor:y.primary,position:"inside",orientation:s})]}),
259
+ /* @__PURE__ */Ye("div",{style:{position:"relative",flex:1,overflow:"hidden",height:Z,borderRadius:12,cursor:h?B.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>o&&T(!0),onMouseLeave:()=>{T(!1),_()},onTouchStart:G,onTouchMove:J,onTouchEnd:_,onMouseDown:G,onMouseMove:J,onMouseUp:_,"aria-live":"polite","aria-atomic":"false",children:[i&&!oe&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke(pr,{direction:"prev",onClick:K,isDisabled:!te,primaryColor:y.primary,position:"inside",orientation:s}),/* @__PURE__ */Ke(pr,{direction:"next",onClick:Y,isDisabled:!ne,primaryColor:y.primary,position:"inside",orientation:s})]}),
260
260
  /* @__PURE__ */Ke("div",{ref:D,style:Q,onTransitionEnd:X,children:F.map((e,t)=>/* @__PURE__ */Ke("div",{style:ee,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(t-(r?1:0)+k)%k+1} of ${k}`,"aria-hidden":(t-(r?1:0)+k)%k!==S,children:e.content},`${e.id}-${t}`))}),a&&!l&&/* @__PURE__ */Ke("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)=>/* @__PURE__ */Ke("button",{type:"button","aria-label":`Go to slide ${t+1}`,"aria-current":t===S?"true":void 0,onClick:()=>V(t),style:{width:t===S?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:t===S?y.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 ${y.primary}66`},onBlur:e=>{e.currentTarget.style.boxShadow="none"}},e.id))})]}),i&&oe&&/* @__PURE__ */Ke(pr,{direction:"next",onClick:Y,isDisabled:!ne,primaryColor:y.primary,position:"outside",orientation:s})]}),l&&/* @__PURE__ */Ke("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:e.map((e,t)=>/* @__PURE__ */Ye("button",{type:"button",role:"tab","aria-selected":t===S,"aria-label":`Thumbnail for slide ${t+1}`,onClick:()=>V(t),style:{flexShrink:0,width:60,height:42,border:`2px solid ${t===S?y.primary:y.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:y.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${y.primary}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},children:[e.thumbnail?/* @__PURE__ */Ke("img",{src:e.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):/* @__PURE__ */Ke("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:y.textMuted,fontWeight:600},children:t+1}),t===S&&/* @__PURE__ */Ke("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${y.primary}22`}})]},e.id))})]})}function mr({color:e}){/* @__PURE__ */
261
261
  return Ke("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M6 3l5 5-5 5",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function gr({onClick:e,bgColor:t,hoverColor:n,textColor:o,label:r}){/* @__PURE__ */
262
- return Ke("button",{type:"button",onClick:e,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},"aria-label":r,className:U("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:o,transition:"background-color 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=n},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t},children:"…"})}function xr({items:e,separator:t,maxItems:n,onNavigate:o,className:r,style:i}){const a=N(),l=$e(),s=ge(),d=void 0!==n&&n>1&&e.length>n,c=Ae(()=>{if(!d||!n)return e.map((e,t)=>({item:e,originalIndex:t}));const t=Math.ceil((n-1)/2),o=n-1-t,r=e.slice(0,t).map((e,t)=>({item:e,originalIndex:t})),i=e.slice(e.length-o).map((t,n)=>({item:t,originalIndex:e.length-o+n}));return r.concat(i)},[e,n,d])(),u=d&&n?Math.ceil((n-1)/2):-1,h=(e,t)=>{o?.(e,t)},p=s?{}:{transition:"color 150ms ease, background-color 150ms ease"},f=e=>/* @__PURE__ */Ke("li",{role:"presentation","aria-hidden":"true",className:U("flex items-center mx-1.5"),children:t??/* @__PURE__ */Ke(mr,{color:a.textMuted})},e),m=(e,t,n)=>{const r=F(e.label);if(n)/* @__PURE__ */return Ke("li",{children:/* @__PURE__ */Ye("span",{"aria-current":"page",className:U("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:a.text},children:[e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("flex-shrink-0"),children:e.icon}),r]})},`item-${t}`);const i=!!e.href,l={color:a.textMuted,textDecoration:"none",...p},s={onMouseEnter:e=>{e.currentTarget.style.color=a.primary},onMouseLeave:e=>{e.currentTarget.style.color=a.textMuted}},d=/* @__PURE__ */Ye(Ue,{children:[e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("flex-shrink-0"),children:e.icon}),r]});/* @__PURE__ */
262
+ return Ke("button",{type:"button",onClick:e,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},"aria-label":r,className:U("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:o,transition:"background-color 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=n},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t},children:"…"})}function xr({items:e,separator:t,maxItems:n,onNavigate:o,className:r,style:i}){const a=M(),l=$e(),s=ge(),d=void 0!==n&&n>1&&e.length>n,c=Ae(()=>{if(!d||!n)return e.map((e,t)=>({item:e,originalIndex:t}));const t=Math.ceil((n-1)/2),o=n-1-t,r=e.slice(0,t).map((e,t)=>({item:e,originalIndex:t})),i=e.slice(e.length-o).map((t,n)=>({item:t,originalIndex:e.length-o+n}));return r.concat(i)},[e,n,d])(),u=d&&n?Math.ceil((n-1)/2):-1,h=(e,t)=>{o?.(e,t)},p=s?{}:{transition:"color 150ms ease, background-color 150ms ease"},f=e=>/* @__PURE__ */Ke("li",{role:"presentation","aria-hidden":"true",className:U("flex items-center mx-1.5"),children:t??/* @__PURE__ */Ke(mr,{color:a.textMuted})},e),m=(e,t,n)=>{const r=F(e.label);if(n)/* @__PURE__ */return Ke("li",{children:/* @__PURE__ */Ye("span",{"aria-current":"page",className:U("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:a.text},children:[e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("flex-shrink-0"),children:e.icon}),r]})},`item-${t}`);const i=!!e.href,l={color:a.textMuted,textDecoration:"none",...p},s={onMouseEnter:e=>{e.currentTarget.style.color=a.primary},onMouseLeave:e=>{e.currentTarget.style.color=a.textMuted}},d=/* @__PURE__ */Ye(Ue,{children:[e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("flex-shrink-0"),children:e.icon}),r]});/* @__PURE__ */
263
263
  return Ke("li",i?{children:/* @__PURE__ */Ke("a",{href:e.href,onClick:n=>{o&&(n.preventDefault(),h(e,t))},className:U("inline-flex items-center gap-1.5 text-sm rounded","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:{...l,focusRingColor:a.primary},...s,children:d})}:{children:/* @__PURE__ */Ke("button",{type:"button",onClick:()=>h(e,t),onKeyDown:n=>((e,t,n)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h(t,n))})(n,e,t),className:U("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:d})},`item-${t}`)},g=[];let x=!1;for(let b=0;b<c.length;b++){const{item:t,originalIndex:n}=c[b],o=n===e.length-1;d&&!x&&b===u&&(g.length>0&&g.push(f("sep-ellipsis-before")),g.push(/* @__PURE__ */Ke("li",{role:"presentation",children:/* @__PURE__ */Ke(gr,{onClick:()=>{},bgColor:a.surfaceAlt,hoverColor:a.surface,textColor:a.textMuted,label:l.showHiddenItems??"Show hidden breadcrumb items"})},"ellipsis")),x=!0),g.length>0&&null!==g[g.length-1]&&g.push(f(`sep-${n}`)),g.push(m(t,n,o))}/* @__PURE__ */
264
- return Ke("nav",{"aria-label":l.breadcrumb??"Breadcrumb",className:U("font-sans",r??""),style:{...i},children:/* @__PURE__ */Ke("ol",{role:"list",className:U("flex items-center flex-wrap list-none m-0 p-0"),children:g})})}function br({trigger:e,content:t,placement:n="bottom",isOpen:o,onOpenChange:r,closeOnClickOutside:i=!0,className:a,style:l}){const s=N(),d=ge(),c=He(),u=void 0!==o,[h,p]=Ve(!1),f=u?o:h,m=Oe(null),g=Oe(null);Oe(null);const[x,b]=Ve(null),y=Ae(e=>{u||p(e),r?.(e)},[u,r]),v=Ae(()=>y(!1),[y]),w=Ae(()=>y(!f),[y,f]);xe(v,f),Ee(()=>{if(!f||!i)return;const e=e=>{const t=e.target;m.current?.contains(t)||g.current?.contains(t)||v()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[f,i,v]),Ee(()=>{if(!f||!m.current)return;const e=()=>{m.current&&g.current&&b(function(e,t,n){const o=t.getBoundingClientRect(),r=window.scrollX,i=window.scrollY,a=window.innerWidth,l=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<l,left:e.left-o.width-8-8>0,right:e.right+o.width+8+8<a};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,a+r-o.width-8)),s=Math.max(8,Math.min(s,l+i-o.height-8));const h={position:"absolute",width:0,height:0,borderStyle:"solid",borderWidth:8};switch(c){case"top":Object.assign(h,{bottom:-16,left:"50%",transform:"translateX(-50%)",borderColor:"var(--tkx-popover-bg) transparent transparent transparent"});break;case"bottom":Object.assign(h,{top:-16,left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent var(--tkx-popover-bg) transparent"});break;case"left":Object.assign(h,{right:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent var(--tkx-popover-bg)"});break;case"right":Object.assign(h,{left:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent var(--tkx-popover-bg) transparent transparent"})}return{top:s,left:d,arrowStyle:h,resolvedPlacement:c}}(m.current.getBoundingClientRect(),g.current,n))};return requestAnimationFrame(e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[f,n]);const k=d?{opacity:1}:{animation:"tkxPopoverFadeIn 150ms ease forwards",opacity:0},S=f&&"undefined"!=typeof document?Xe(/* @__PURE__ */Ye("div",{ref:g,id:c,role:"dialog","aria-modal":"false",className:U("absolute z-[9100] rounded-lg font-sans",a??""),style:{"--tkx-popover-bg":s.surface,top:x?.top??-9999,left:x?.left??-9999,backgroundColor:s.surface,border:`1px solid ${s.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:s.text,...k,...l},children:[x&&/* @__PURE__ */Ke("span",{style:x.arrowStyle,"aria-hidden":"true"}),t]}),document.body):null;/* @__PURE__ */
264
+ return Ke("nav",{"aria-label":l.breadcrumb??"Breadcrumb",className:U("font-sans",r??""),style:{...i},children:/* @__PURE__ */Ke("ol",{role:"list",className:U("flex items-center flex-wrap list-none m-0 p-0"),children:g})})}function br({trigger:e,content:t,placement:n="bottom",isOpen:o,onOpenChange:r,closeOnClickOutside:i=!0,className:a,style:l}){const s=M(),d=ge(),c=He(),u=void 0!==o,[h,p]=Ve(!1),f=u?o:h,m=Oe(null),g=Oe(null);Oe(null);const[x,b]=Ve(null),y=Ae(e=>{u||p(e),r?.(e)},[u,r]),v=Ae(()=>y(!1),[y]),w=Ae(()=>y(!f),[y,f]);xe(v,f),Ee(()=>{if(!f||!i)return;const e=e=>{const t=e.target;m.current?.contains(t)||g.current?.contains(t)||v()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[f,i,v]),Ee(()=>{if(!f||!m.current)return;const e=()=>{m.current&&g.current&&b(function(e,t,n){const o=t.getBoundingClientRect(),r=window.scrollX,i=window.scrollY,a=window.innerWidth,l=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<l,left:e.left-o.width-8-8>0,right:e.right+o.width+8+8<a};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,a+r-o.width-8)),s=Math.max(8,Math.min(s,l+i-o.height-8));const h={position:"absolute",width:0,height:0,borderStyle:"solid",borderWidth:8};switch(c){case"top":Object.assign(h,{bottom:-16,left:"50%",transform:"translateX(-50%)",borderColor:"var(--tkx-popover-bg) transparent transparent transparent"});break;case"bottom":Object.assign(h,{top:-16,left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent var(--tkx-popover-bg) transparent"});break;case"left":Object.assign(h,{right:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent var(--tkx-popover-bg)"});break;case"right":Object.assign(h,{left:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent var(--tkx-popover-bg) transparent transparent"})}return{top:s,left:d,arrowStyle:h,resolvedPlacement:c}}(m.current.getBoundingClientRect(),g.current,n))};return requestAnimationFrame(e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[f,n]);const k=d?{opacity:1}:{animation:"tkxPopoverFadeIn 150ms ease forwards",opacity:0},S=f&&"undefined"!=typeof document?Xe(/* @__PURE__ */Ye("div",{ref:g,id:c,role:"dialog","aria-modal":"false",className:U("absolute z-[9100] rounded-lg font-sans",a??""),style:{"--tkx-popover-bg":s.surface,top:x?.top??-9999,left:x?.left??-9999,backgroundColor:s.surface,border:`1px solid ${s.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:s.text,...k,...l},children:[x&&/* @__PURE__ */Ke("span",{style:x.arrowStyle,"aria-hidden":"true"}),t]}),document.body):null;/* @__PURE__ */
265
265
  return Ye(Ue,{children:[
266
266
  /* @__PURE__ */Ke("div",{ref:m,className:U("inline-flex"),onClick:w,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w())},"aria-expanded":f,"aria-haspopup":"dialog","aria-controls":f?c:void 0,children:e}),S,f&&!d&&/* @__PURE__ */Ke("style",{children:"\n @keyframes tkxPopoverFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})}function yr(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 vr({color:e}){/* @__PURE__ */
267
- return Ye("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:[/* @__PURE__ */Ke("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"2",opacity:"0.3"}),/* @__PURE__ */Ke("path",{d:"M14 8a6 6 0 00-6-6",stroke:e,strokeWidth:"2",strokeLinecap:"round"})]})}function wr({options:e,value:t,onChange:n,onInputChange:o,placeholder:r="",label:i,isLoading:a=!1,emptyMessage:l,filterFn:s,freeSolo:d=!1,className:c,style:u}){const h=N(),p=$e(),f=l??p.noResults,m=ge(),g=He(),x=He(),b=Oe(null),y=Oe(null),[v,w]=Ve(""),[k,S]=Ve(!1),[C,$]=Ve(-1),[z,M]=Ve(null);Ee(()=>{if(void 0!==t){const n=e.find(e=>e.value===t);w(n?n.label:t)}},[t,e]);const I=s??yr,L=je(()=>k?e.filter(e=>I(e,v)):[],[e,v,k,I]),R=F(i),D=F(f);Ee(()=>{if(!k||!y.current)return;const e=()=>{y.current&&M(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}}(y.current))};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[k]),Ee(()=>{if(!k)return;const e=e=>{const t=e.target;y.current?.contains(t)||document.getElementById(x)?.contains(t)||S(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[k,x]),xe(()=>S(!1),k);const T=Ae(e=>{e.disabled||(w(e.label),n?.(e.value),S(!1),$(-1),b.current?.focus())},[n]);Ee(()=>{if(C<0)return;const e=`${x}-opt-${C}`;document.getElementById(e)?.scrollIntoView({block:"nearest"})},[C,x]);const W=C>=0?`${x}-opt-${C}`:void 0,A=m?{}:{animation:"tkxAutoFadeIn 120ms ease forwards"},B=k&&"undefined"!=typeof document&&z?Xe(/* @__PURE__ */Ke("ul",{id:x,role:"listbox","aria-label":R,className:U("absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans"),style:{top:z.top,left:z.left,width:z.width,maxHeight:280,backgroundColor:h.surface,border:`1px solid ${h.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15)",...A},children:a?/* @__PURE__ */Ye("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:U("flex items-center gap-2 px-3 py-2 text-sm"),style:{color:h.textMuted},children:[/* @__PURE__ */Ke(vr,{color:h.primary}),"Loading..."]}):0===L.length?/* @__PURE__ */Ke("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:U("px-3 py-2 text-sm text-center"),style:{color:h.textMuted},children:D}):L.map((e,n)=>{const o=n===C,r=F(e.label),i=e.description?F(e.description):null;/* @__PURE__ */
268
- return Ye("li",{id:`${x}-opt-${n}`,role:"option","aria-selected":e.value===t,"aria-disabled":e.disabled||void 0,className:U("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?h.surfaceAlt:"transparent",color:e.disabled?h.textMuted:h.text,transition:m?"none":"background-color 100ms ease"},onMouseEnter:()=>!e.disabled&&$(n),onMouseDown:t=>{t.preventDefault(),T(e)},children:[e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("flex-shrink-0"),children:e.icon}),
267
+ return Ye("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:[/* @__PURE__ */Ke("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"2",opacity:"0.3"}),/* @__PURE__ */Ke("path",{d:"M14 8a6 6 0 00-6-6",stroke:e,strokeWidth:"2",strokeLinecap:"round"})]})}function wr({options:e,value:t,onChange:n,onInputChange:o,placeholder:r="",label:i,isLoading:a=!1,emptyMessage:l,filterFn:s,freeSolo:d=!1,className:c,style:u}){const h=M(),p=$e(),f=l??p.noResults,m=ge(),g=He(),x=He(),b=Oe(null),y=Oe(null),[v,w]=Ve(""),[k,S]=Ve(!1),[C,$]=Ve(-1),[z,N]=Ve(null);Ee(()=>{if(void 0!==t){const n=e.find(e=>e.value===t);w(n?n.label:t)}},[t,e]);const I=s??yr,R=je(()=>k?e.filter(e=>I(e,v)):[],[e,v,k,I]),T=F(i),D=F(f);Ee(()=>{if(!k||!y.current)return;const e=()=>{y.current&&N(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}}(y.current))};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[k]),Ee(()=>{if(!k)return;const e=e=>{const t=e.target;y.current?.contains(t)||document.getElementById(x)?.contains(t)||S(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[k,x]),xe(()=>S(!1),k);const L=Ae(e=>{e.disabled||(w(e.label),n?.(e.value),S(!1),$(-1),b.current?.focus())},[n]);Ee(()=>{if(C<0)return;const e=`${x}-opt-${C}`;document.getElementById(e)?.scrollIntoView({block:"nearest"})},[C,x]);const W=C>=0?`${x}-opt-${C}`:void 0,A=m?{}:{animation:"tkxAutoFadeIn 120ms ease forwards"},B=k&&"undefined"!=typeof document&&z?Xe(/* @__PURE__ */Ke("ul",{id:x,role:"listbox","aria-label":T,className:U("absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans"),style:{top:z.top,left:z.left,width:z.width,maxHeight:280,backgroundColor:h.surface,border:`1px solid ${h.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15)",...A},children:a?/* @__PURE__ */Ye("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:U("flex items-center gap-2 px-3 py-2 text-sm"),style:{color:h.textMuted},children:[/* @__PURE__ */Ke(vr,{color:h.primary}),"Loading..."]}):0===R.length?/* @__PURE__ */Ke("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:U("px-3 py-2 text-sm text-center"),style:{color:h.textMuted},children:D}):R.map((e,n)=>{const o=n===C,r=F(e.label),i=e.description?F(e.description):null;/* @__PURE__ */
268
+ return Ye("li",{id:`${x}-opt-${n}`,role:"option","aria-selected":e.value===t,"aria-disabled":e.disabled||void 0,className:U("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?h.surfaceAlt:"transparent",color:e.disabled?h.textMuted:h.text,transition:m?"none":"background-color 100ms ease"},onMouseEnter:()=>!e.disabled&&$(n),onMouseDown:t=>{t.preventDefault(),L(e)},children:[e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("flex-shrink-0"),children:e.icon}),
269
269
  /* @__PURE__ */Ye("span",{className:U("flex flex-col min-w-0"),children:[/* @__PURE__ */Ke("span",{className:U("truncate"),children:r}),i&&/* @__PURE__ */Ke("span",{className:U("text-xs truncate"),style:{color:h.textMuted},children:i})]}),e.value===t&&/* @__PURE__ */Ke("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:U("ml-auto flex-shrink-0"),children:/* @__PURE__ */Ke("path",{d:"M3 8l3.5 3.5L13 5",stroke:h.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},e.value)})}),document.body):null;/* @__PURE__ */
270
270
  return Ye("div",{ref:y,className:U("relative font-sans",c??""),style:u,children:[
271
- /* @__PURE__ */Ke("label",{htmlFor:g,className:U("block text-sm font-medium mb-1.5"),style:{color:h.text},children:R}),
272
- /* @__PURE__ */Ye("div",{className:U("relative flex items-center"),style:{backgroundColor:h.surface,border:`1px solid ${k?h.primary:h.border}`,borderRadius:8,transition:m?"none":"border-color 150ms ease"},children:[/* @__PURE__ */Ke("input",{ref:b,id:g,type:"text",role:"combobox","aria-expanded":k,"aria-controls":x,"aria-activedescendant":W,"aria-autocomplete":"list","aria-label":R,value:v,placeholder:r,onChange:e=>{const t=e.target.value;w(t),o?.(t),k||S(!0),$(-1),d&&n?.(t)},onFocus:()=>S(!0),onKeyDown:e=>{if(k||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)switch(e.key){case"ArrowDown":e.preventDefault(),$(e=>{let t=e+1;for(;t<L.length&&L[t].disabled;)t++;return t<L.length?t:e});break;case"ArrowUp":e.preventDefault(),$(e=>{let t=e-1;for(;t>=0&&L[t].disabled;)t--;return t>=0?t:e});break;case"Enter":e.preventDefault(),C>=0&&C<L.length?T(L[C]):d&&v&&(n?.(v),S(!1));break;case"Escape":S(!1),$(-1)}else S(!0)},className:U("w-full bg-transparent border-none outline-none text-sm py-2.5 px-3","placeholder:opacity-50"),style:{color:h.text}}),a&&/* @__PURE__ */Ke("span",{className:U("pr-3"),children:/* @__PURE__ */Ke(vr,{color:h.primary})})]}),B,k&&!m&&/* @__PURE__ */Ke("style",{children:"\n @keyframes tkxAutoFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})}function kr({expanded:e,color:t,reducedMotion:n}){/* @__PURE__ */
271
+ /* @__PURE__ */Ke("label",{htmlFor:g,className:U("block text-sm font-medium mb-1.5"),style:{color:h.text},children:T}),
272
+ /* @__PURE__ */Ye("div",{className:U("relative flex items-center"),style:{backgroundColor:h.surface,border:`1px solid ${k?h.primary:h.border}`,borderRadius:8,transition:m?"none":"border-color 150ms ease"},children:[/* @__PURE__ */Ke("input",{ref:b,id:g,type:"text",role:"combobox","aria-expanded":k,"aria-controls":x,"aria-activedescendant":W,"aria-autocomplete":"list","aria-label":T,value:v,placeholder:r,onChange:e=>{const t=e.target.value;w(t),o?.(t),k||S(!0),$(-1),d&&n?.(t)},onFocus:()=>S(!0),onKeyDown:e=>{if(k||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)switch(e.key){case"ArrowDown":e.preventDefault(),$(e=>{let t=e+1;for(;t<R.length&&R[t].disabled;)t++;return t<R.length?t:e});break;case"ArrowUp":e.preventDefault(),$(e=>{let t=e-1;for(;t>=0&&R[t].disabled;)t--;return t>=0?t:e});break;case"Enter":e.preventDefault(),C>=0&&C<R.length?L(R[C]):d&&v&&(n?.(v),S(!1));break;case"Escape":S(!1),$(-1)}else S(!0)},className:U("w-full bg-transparent border-none outline-none text-sm py-2.5 px-3","placeholder:opacity-50"),style:{color:h.text}}),a&&/* @__PURE__ */Ke("span",{className:U("pr-3"),children:/* @__PURE__ */Ke(vr,{color:h.primary})})]}),B,k&&!m&&/* @__PURE__ */Ke("style",{children:"\n @keyframes tkxAutoFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})}function kr({expanded:e,color:t,reducedMotion:n}){/* @__PURE__ */
273
273
  return Ke("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:/* @__PURE__ */Ke("path",{d:"M6 3l5 5-5 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Sr({checked:e,color:t,borderColor:n}){/* @__PURE__ */
274
- return Ke("span",{role:"presentation","aria-hidden":"true",className:U("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:n}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&/* @__PURE__ */Ke("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:/* @__PURE__ */Ke("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Cr({data:e,selected:t,onSelect:n,expanded:o,onExpand:r,multiSelect:i=!1,showCheckboxes:a=!1,showLines:l=!1,className:s,style:d}){const c=N(),u=ge();He();const[h,p]=Ve([]),[f,m]=Ve([]),g=new Set(t??h),x=new Set(o??f),b=Ae(e=>{void 0===o&&m(e),r?.(e)},[o,r]),y=Ae(e=>{void 0===t&&p(e),n?.(e)},[t,n]),v=Ae(e=>{const t=Array.from(x);x.has(e)?b(t.filter(t=>t!==e)):b([...t,e])},[x,b]),w=Ae(e=>{if(i){const t=Array.from(g);g.has(e)?y(t.filter(t=>t!==e)):y([...t,e])}else y(g.has(e)?[]:[e])},[i,g,y]),k=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,x),S=Oe(0),C=Oe(/* @__PURE__ */new Map),$=e=>{S.current=e,C.current.get(e)?.focus()};/* @__PURE__ */
274
+ return Ke("span",{role:"presentation","aria-hidden":"true",className:U("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:n}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&/* @__PURE__ */Ke("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:/* @__PURE__ */Ke("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Cr({data:e,selected:t,onSelect:n,expanded:o,onExpand:r,multiSelect:i=!1,showCheckboxes:a=!1,showLines:l=!1,className:s,style:d}){const c=M(),u=ge();He();const[h,p]=Ve([]),[f,m]=Ve([]),g=new Set(t??h),x=new Set(o??f),b=Ae(e=>{void 0===o&&m(e),r?.(e)},[o,r]),y=Ae(e=>{void 0===t&&p(e),n?.(e)},[t,n]),v=Ae(e=>{const t=Array.from(x);x.has(e)?b(t.filter(t=>t!==e)):b([...t,e])},[x,b]),w=Ae(e=>{if(i){const t=Array.from(g);g.has(e)?y(t.filter(t=>t!==e)):y([...t,e])}else y(g.has(e)?[]:[e])},[i,g,y]),k=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,x),S=Oe(0),C=Oe(/* @__PURE__ */new Map),$=e=>{S.current=e,C.current.get(e)?.focus()};/* @__PURE__ */
275
275
  return Ke("ul",{role:"tree","aria-label":"Tree view","aria-multiselectable":i||void 0,className:U("list-none m-0 p-0 font-sans select-none",s??""),style:{color:c.text,...d},children:k.map(({node:e,depth:t},n)=>{const o=(e.children?.length??0)>0,r=x.has(e.id),i=g.has(e.id),s=F(e.label);/* @__PURE__ */
276
276
  return Ye("li",{role:"treeitem","aria-selected":i,"aria-expanded":o?r:void 0,"aria-disabled":e.disabled||void 0,"aria-level":t+1,"aria-setsize":k.filter(e=>e.depth===t).length,tabIndex:0===n?0:-1,ref:e=>{e?C.current.set(n,e):C.current.delete(n)},onKeyDown:e=>((e,t)=>{const n=k[t];if(!n)return;const{node:o}=n,r=(o.children?.length??0)>0;switch(e.key){case"ArrowDown":e.preventDefault(),t<k.length-1&&$(t+1);break;case"ArrowUp":e.preventDefault(),t>0&&$(t-1);break;case"ArrowRight":e.preventDefault(),r&&!x.has(o.id)?v(o.id):r&&x.has(o.id)&&t<k.length-1&&$(t+1);break;case"ArrowLeft":if(e.preventDefault(),r&&x.has(o.id))v(o.id);else for(let e=t-1;e>=0;e--)if(k[e].depth<n.depth){$(e);break}break;case"Enter":case" ":e.preventDefault(),o.disabled||w(o.id);break;case"Home":e.preventDefault(),$(0);break;case"End":e.preventDefault(),$(k.length-1)}})(e,n),onClick:()=>{e.disabled||(o&&v(e.id),w(e.id))},className:U("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:i?`${c.primary}18`:"transparent",transition:u?"none":"background-color 100ms ease",minHeight:32},onMouseEnter:t=>{i||e.disabled||(t.currentTarget.style.backgroundColor=c.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=i?`${c.primary}18`:"transparent"},children:[l&&t>0&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{position:"absolute",left:24*(t-1)+16,top:0,bottom:0,width:1,backgroundColor:c.border}}),/* @__PURE__ */Ke("span",o?{role:"presentation",onClick:t=>{t.stopPropagation(),v(e.id)},className:U("inline-flex items-center justify-center cursor-pointer"),style:{width:20,height:20},children:/* @__PURE__ */Ke(kr,{expanded:r,color:c.textMuted,reducedMotion:u})}:{style:{width:20,height:20},"aria-hidden":"true"}),a&&/* @__PURE__ */Ke(Sr,{checked:i,color:c.primary,borderColor:c.border}),e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",className:U("flex-shrink-0"),children:e.icon}),
277
- /* @__PURE__ */Ke("span",{className:U("text-sm truncate"),style:{color:e.disabled?c.textMuted:c.text},children:s})]},e.id)})})}lr.displayName="TkxOTP",hr.displayName="TkxCommand",fr.displayName="TkxCarousel";var $r={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 zr({items:e,orientation:t="horizontal",size:n="md",variant:o="default",ariaLabel:r="Toolbar",className:i,style:a}){const l=N(),s=ge(),d=$r[n],c="horizontal"===t,u=Oe(/* @__PURE__ */new Map),h=e.filter(e=>"separator"!==e.type&&!e.disabled).map(e=>e.id),p=Ae(e=>{u.current.get(e)?.focus()},[]),f=Ae((e,t)=>{const n=h.indexOf(t);if(n<0)return;const o=c?"ArrowRight":"ArrowDown",r=c?"ArrowLeft":"ArrowUp";switch(e.key){case o:e.preventDefault(),p(h[n+1<h.length?n+1:0]);break;case r:e.preventDefault(),p(h[n-1>=0?n-1:h.length-1]);break;case"Home":e.preventDefault(),p(h[0]);break;case"End":e.preventDefault(),p(h[h.length-1])}},[h,p,c]),m=e=>{e.type;const t=e.active;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,padding:`${d.buttonPy}px ${d.buttonPx}px`,fontSize:d.fontSize,borderRadius:6,border:"none",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:t?`${l.primary}20`:"transparent",color:t?l.primary:e.disabled?l.textMuted:l.text,opacity:e.disabled?.5:1,outline:"none",transition:s?"none":"all 100ms ease",whiteSpace:"nowrap",lineHeight:1}};/* @__PURE__ */
277
+ /* @__PURE__ */Ke("span",{className:U("text-sm truncate"),style:{color:e.disabled?c.textMuted:c.text},children:s})]},e.id)})})}lr.displayName="TkxOTP",hr.displayName="TkxCommand",fr.displayName="TkxCarousel";var $r={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 zr({items:e,orientation:t="horizontal",size:n="md",variant:o="default",ariaLabel:r="Toolbar",className:i,style:a}){const l=M(),s=ge(),d=$r[n],c="horizontal"===t,u=Oe(/* @__PURE__ */new Map),h=e.filter(e=>"separator"!==e.type&&!e.disabled).map(e=>e.id),p=Ae(e=>{u.current.get(e)?.focus()},[]),f=Ae((e,t)=>{const n=h.indexOf(t);if(n<0)return;const o=c?"ArrowRight":"ArrowDown",r=c?"ArrowLeft":"ArrowUp";switch(e.key){case o:e.preventDefault(),p(h[n+1<h.length?n+1:0]);break;case r:e.preventDefault(),p(h[n-1>=0?n-1:h.length-1]);break;case"Home":e.preventDefault(),p(h[0]);break;case"End":e.preventDefault(),p(h[h.length-1])}},[h,p,c]),m=e=>{e.type;const t=e.active;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,padding:`${d.buttonPy}px ${d.buttonPx}px`,fontSize:d.fontSize,borderRadius:6,border:"none",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:t?`${l.primary}20`:"transparent",color:t?l.primary:e.disabled?l.textMuted:l.text,opacity:e.disabled?.5:1,outline:"none",transition:s?"none":"all 100ms ease",whiteSpace:"nowrap",lineHeight:1}};/* @__PURE__ */
278
278
  return Ke("div",{role:"toolbar","aria-label":r,"aria-orientation":t,className:U("inline-flex items-center rounded-lg font-sans",c?"flex-row":"flex-col",i??""),style:{...(()=>{switch(o){case"outlined":return{backgroundColor:"transparent",border:`1px solid ${l.border}`};case"filled":return{backgroundColor:l.surfaceAlt,border:"none"};default:return{backgroundColor:l.surface,border:`1px solid ${l.border}`}}})(),padding:d.gap,gap:d.gap,...a},children:e.map((e,t)=>{if("separator"===e.type)/* @__PURE__ */return Ke("div",{role:"separator","aria-orientation":c?"vertical":"horizontal",className:U("flex-shrink-0"),style:{...c?{width:1,height:d.separatorSize,marginLeft:2,marginRight:2}:{height:1,width:d.separatorSize,marginTop:2,marginBottom:2},backgroundColor:l.border}},e.id);const n=F(e.label),o=!e.disabled,r=h[0]===e.id;/* @__PURE__ */
279
- return Ye("button",{ref:t=>{t?u.current.set(e.id,t):u.current.delete(e.id)},type:"button",role:void e.type,"aria-pressed":"toggle"===e.type?e.active:void 0,"aria-label":n,"aria-disabled":e.disabled||void 0,tabIndex:o&&r?0:-1,disabled:e.disabled,onClick:()=>{e.disabled||e.onClick?.()},onKeyDown:t=>{f(t,e.id),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.disabled||e.onClick?.())},className:U("focus-visible:ring-2 focus-visible:ring-offset-1"),style:m(e),onMouseEnter:t=>{e.disabled||e.active||(t.currentTarget.style.backgroundColor=l.surfaceAlt)},onMouseLeave:t=>{e.disabled||(t.currentTarget.style.backgroundColor=e.active?`${l.primary}20`:"transparent")},children:[e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{width:d.iconSize,height:d.iconSize,display:"flex",alignItems:"center",justifyContent:"center"},children:e.icon}),!e.icon&&n]},e.id)})})}function Nr({color:e}){/* @__PURE__ */
280
- return Ye("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"6",cy:"6",r:"4.5",stroke:e,strokeWidth:"1.5"}),/* @__PURE__ */Ke("path",{d:"M9.5 9.5L13 13",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"})]})}function Mr({checked:e,primaryColor:t,borderColor:n}){/* @__PURE__ */
279
+ return Ye("button",{ref:t=>{t?u.current.set(e.id,t):u.current.delete(e.id)},type:"button",role:void e.type,"aria-pressed":"toggle"===e.type?e.active:void 0,"aria-label":n,"aria-disabled":e.disabled||void 0,tabIndex:o&&r?0:-1,disabled:e.disabled,onClick:()=>{e.disabled||e.onClick?.()},onKeyDown:t=>{f(t,e.id),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.disabled||e.onClick?.())},className:U("focus-visible:ring-2 focus-visible:ring-offset-1"),style:m(e),onMouseEnter:t=>{e.disabled||e.active||(t.currentTarget.style.backgroundColor=l.surfaceAlt)},onMouseLeave:t=>{e.disabled||(t.currentTarget.style.backgroundColor=e.active?`${l.primary}20`:"transparent")},children:[e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{width:d.iconSize,height:d.iconSize,display:"flex",alignItems:"center",justifyContent:"center"},children:e.icon}),!e.icon&&n]},e.id)})})}function Mr({color:e}){/* @__PURE__ */
280
+ return Ye("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"6",cy:"6",r:"4.5",stroke:e,strokeWidth:"1.5"}),/* @__PURE__ */Ke("path",{d:"M9.5 9.5L13 13",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"})]})}function Nr({checked:e,primaryColor:t,borderColor:n}){/* @__PURE__ */
281
281
  return Ke("span",{"aria-hidden":"true",className:U("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:n}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&/* @__PURE__ */Ke("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:/* @__PURE__ */Ke("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Ir({color:e}){/* @__PURE__ */
282
- return Ke("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M3 8h10M9 4l4 4-4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Lr({color:e}){/* @__PURE__ */
283
- return Ke("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M13 8H3M7 4l-4 4 4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Rr({title:e,items:t,selected:n,onToggle:o,onToggleAll:r,search:i,onSearchChange:a,searchable:l,height:s,listId:d}){const c=N(),u=ge(),h=F(e),p=je(()=>{if(!i)return t;const e=i.toLowerCase();return t.filter(t=>t.label.toLowerCase().includes(e))},[t,i]),f=p.filter(e=>!e.disabled),m=f.length>0&&f.every(e=>n.has(e.value));return f.some(e=>n.has(e.value)),/* @__PURE__ */Ye("div",{className:U("flex flex-col rounded-lg overflow-hidden flex-1 min-w-0"),style:{border:`1px solid ${c.border}`,backgroundColor:c.surface},children:[
282
+ return Ke("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M3 8h10M9 4l4 4-4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Rr({color:e}){/* @__PURE__ */
283
+ return Ke("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M13 8H3M7 4l-4 4 4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Tr({title:e,items:t,selected:n,onToggle:o,onToggleAll:r,search:i,onSearchChange:a,searchable:l,height:s,listId:d}){const c=M(),u=ge(),h=F(e),p=je(()=>{if(!i)return t;const e=i.toLowerCase();return t.filter(t=>t.label.toLowerCase().includes(e))},[t,i]),f=p.filter(e=>!e.disabled),m=f.length>0&&f.every(e=>n.has(e.value));return f.some(e=>n.has(e.value)),/* @__PURE__ */Ye("div",{className:U("flex flex-col rounded-lg overflow-hidden flex-1 min-w-0"),style:{border:`1px solid ${c.border}`,backgroundColor:c.surface},children:[
284
284
  /* @__PURE__ */Ye("div",{className:U("flex items-center gap-2 px-3 py-2 border-b"),style:{borderColor:c.border,backgroundColor:c.surfaceAlt},children:[
285
- /* @__PURE__ */Ke("button",{type:"button","aria-label":m?`Deselect all ${h}`:`Select all ${h}`,onClick:r,className:U("border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2"),children:/* @__PURE__ */Ke(Mr,{checked:m,primaryColor:c.primary,borderColor:c.border})}),
285
+ /* @__PURE__ */Ke("button",{type:"button","aria-label":m?`Deselect all ${h}`:`Select all ${h}`,onClick:r,className:U("border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2"),children:/* @__PURE__ */Ke(Nr,{checked:m,primaryColor:c.primary,borderColor:c.border})}),
286
286
  /* @__PURE__ */Ke("span",{className:U("text-sm font-medium flex-1 truncate"),style:{color:c.text},children:h}),
287
- /* @__PURE__ */Ye("span",{className:U("text-xs"),style:{color:c.textMuted},children:[n.size,"/",t.length]})]}),l&&/* @__PURE__ */Ye("div",{className:U("flex items-center gap-1.5 px-3 py-1.5 border-b"),style:{borderColor:c.border},children:[/* @__PURE__ */Ke(Nr,{color:c.textMuted}),/* @__PURE__ */Ke("input",{type:"text","aria-label":`Search ${h}`,value:i,onChange:e=>a(e.target.value),placeholder:"Search...",className:U("flex-1 bg-transparent border-none outline-none text-xs"),style:{color:c.text}})]}),
287
+ /* @__PURE__ */Ye("span",{className:U("text-xs"),style:{color:c.textMuted},children:[n.size,"/",t.length]})]}),l&&/* @__PURE__ */Ye("div",{className:U("flex items-center gap-1.5 px-3 py-1.5 border-b"),style:{borderColor:c.border},children:[/* @__PURE__ */Ke(Mr,{color:c.textMuted}),/* @__PURE__ */Ke("input",{type:"text","aria-label":`Search ${h}`,value:i,onChange:e=>a(e.target.value),placeholder:"Search...",className:U("flex-1 bg-transparent border-none outline-none text-xs"),style:{color:c.text}})]}),
288
288
  /* @__PURE__ */Ke("ul",{id:d,role:"listbox","aria-label":h,"aria-multiselectable":"true",className:U("list-none m-0 p-1 overflow-y-auto"),style:{height:s,minHeight:100},children:0===p.length?/* @__PURE__ */Ke("li",{className:U("text-xs text-center py-4"),style:{color:c.textMuted},"aria-disabled":"true",children:"No items"}):p.map(e=>{const t=n.has(e.value),r=F(e.label);/* @__PURE__ */
289
- return Ye("li",{role:"option","aria-selected":t,"aria-disabled":e.disabled||void 0,tabIndex:0,onClick:()=>!e.disabled&&o(e.value),onKeyDown:t=>!e.disabled&&((e,t)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o(t))})(t,e.value),className:U("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?c.textMuted:c.text,backgroundColor:t?`${c.primary}10`:"transparent",transition:u?"none":"background-color 100ms ease"},onMouseEnter:n=>{e.disabled||t||(n.currentTarget.style.backgroundColor=c.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t?`${c.primary}10`:"transparent"},children:[/* @__PURE__ */Ke(Mr,{checked:t,primaryColor:c.primary,borderColor:c.border}),/* @__PURE__ */Ke("span",{className:U("truncate"),children:r})]},e.value)})})]})}function Dr({sourceItems:e,targetItems:t,onTransfer:n,sourceTitle:o="Available",targetTitle:r="Selected",searchable:i=!1,height:a=300,className:l,style:s}){const d=N(),c=ge(),u=He(),h=He(),[p,f]=Ve(/* @__PURE__ */new Set),[m,g]=Ve(/* @__PURE__ */new Set),[x,b]=Ve(""),[y,v]=Ve(""),w=Ae(e=>{f(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),k=Ae(e=>{g(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),S=Ae(()=>{const t=e.filter(e=>!e.disabled).map(e=>e.value);t.every(e=>p.has(e))?f(/* @__PURE__ */new Set):f(new Set(t))},[e,p]),C=Ae(()=>{const e=t.filter(e=>!e.disabled).map(e=>e.value);e.every(e=>m.has(e))?g(/* @__PURE__ */new Set):g(new Set(e))},[t,m]),$=Ae(()=>{if(0===p.size)return;const o=e.filter(e=>p.has(e.value)&&!e.disabled);n(e.filter(e=>!p.has(e.value)||e.disabled),[...t,...o]),f(/* @__PURE__ */new Set)},[e,t,p,n]),z=Ae(()=>{if(0===m.size)return;const o=t.filter(e=>m.has(e.value)&&!e.disabled),r=t.filter(e=>!m.has(e.value)||e.disabled);n([...e,...o],r),g(/* @__PURE__ */new Set)},[e,t,m,n]),M=e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:`1px solid ${d.border}`,backgroundColor:e?d.surface:d.surfaceAlt,cursor:e?"not-allowed":"pointer",opacity:e?.5:1,transition:c?"none":"all 100ms ease",outline:"none"});/* @__PURE__ */
289
+ return Ye("li",{role:"option","aria-selected":t,"aria-disabled":e.disabled||void 0,tabIndex:0,onClick:()=>!e.disabled&&o(e.value),onKeyDown:t=>!e.disabled&&((e,t)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o(t))})(t,e.value),className:U("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?c.textMuted:c.text,backgroundColor:t?`${c.primary}10`:"transparent",transition:u?"none":"background-color 100ms ease"},onMouseEnter:n=>{e.disabled||t||(n.currentTarget.style.backgroundColor=c.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t?`${c.primary}10`:"transparent"},children:[/* @__PURE__ */Ke(Nr,{checked:t,primaryColor:c.primary,borderColor:c.border}),/* @__PURE__ */Ke("span",{className:U("truncate"),children:r})]},e.value)})})]})}function Dr({sourceItems:e,targetItems:t,onTransfer:n,sourceTitle:o="Available",targetTitle:r="Selected",searchable:i=!1,height:a=300,className:l,style:s}){const d=M(),c=ge(),u=He(),h=He(),[p,f]=Ve(/* @__PURE__ */new Set),[m,g]=Ve(/* @__PURE__ */new Set),[x,b]=Ve(""),[y,v]=Ve(""),w=Ae(e=>{f(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),k=Ae(e=>{g(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),S=Ae(()=>{const t=e.filter(e=>!e.disabled).map(e=>e.value);t.every(e=>p.has(e))?f(/* @__PURE__ */new Set):f(new Set(t))},[e,p]),C=Ae(()=>{const e=t.filter(e=>!e.disabled).map(e=>e.value);e.every(e=>m.has(e))?g(/* @__PURE__ */new Set):g(new Set(e))},[t,m]),$=Ae(()=>{if(0===p.size)return;const o=e.filter(e=>p.has(e.value)&&!e.disabled);n(e.filter(e=>!p.has(e.value)||e.disabled),[...t,...o]),f(/* @__PURE__ */new Set)},[e,t,p,n]),z=Ae(()=>{if(0===m.size)return;const o=t.filter(e=>m.has(e.value)&&!e.disabled),r=t.filter(e=>!m.has(e.value)||e.disabled);n([...e,...o],r),g(/* @__PURE__ */new Set)},[e,t,m,n]),N=e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:`1px solid ${d.border}`,backgroundColor:e?d.surface:d.surfaceAlt,cursor:e?"not-allowed":"pointer",opacity:e?.5:1,transition:c?"none":"all 100ms ease",outline:"none"});/* @__PURE__ */
290
290
  return Ye("div",{className:U("flex gap-3 font-sans","flex-col sm:flex-row",l??""),style:{color:d.text,...s},children:[
291
- /* @__PURE__ */Ke(Rr,{title:o,items:e,selected:p,onToggle:w,onToggleAll:S,search:x,onSearchChange:b,searchable:i,height:a,listId:u}),
292
- /* @__PURE__ */Ye("div",{className:U("flex items-center justify-center gap-2","flex-row sm:flex-col"),style:{padding:"8px 0"},children:[/* @__PURE__ */Ke("button",{type:"button","aria-label":"Move selected items to target list",disabled:0===p.size,onClick:$,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),$())},className:U("focus-visible:ring-2 focus-visible:ring-offset-1"),style:M(0===p.size),onMouseEnter:e=>{p.size>0&&(e.currentTarget.style.backgroundColor=d.primary,e.currentTarget.style.borderColor=d.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===p.size?d.surface:d.surfaceAlt,e.currentTarget.style.borderColor=d.border},children:/* @__PURE__ */Ke(Ir,{color:d.text})}),/* @__PURE__ */Ke("button",{type:"button","aria-label":"Move selected items to source list",disabled:0===m.size,onClick:z,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),z())},className:U("focus-visible:ring-2 focus-visible:ring-offset-1"),style:M(0===m.size),onMouseEnter:e=>{m.size>0&&(e.currentTarget.style.backgroundColor=d.primary,e.currentTarget.style.borderColor=d.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===m.size?d.surface:d.surfaceAlt,e.currentTarget.style.borderColor=d.border},children:/* @__PURE__ */Ke(Lr,{color:d.text})})]}),
293
- /* @__PURE__ */Ke(Rr,{title:r,items:t,selected:m,onToggle:k,onToggleAll:C,search:y,onSearchChange:v,searchable:i,height:a,listId:h})]})}function Tr({color:e,rotated:t,reducedMotion:n}){/* @__PURE__ */
294
- return Ke("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:/* @__PURE__ */Ke("path",{d:"M12 5v14M5 12h14",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"})})}var Wr={"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 Ar({actions:e,icon:t,direction:n="up",position:o="bottom-right",className:r,style:i}){const a=N(),l=ge(),s=He(),[d,c]=Ve(!1),[u,h]=Ve(-1),p=Oe(null),f=Oe(/* @__PURE__ */new Map),m=Ae(()=>{c(e=>!e),h(-1)},[]),g=Ae(()=>{c(!1),h(-1)},[]);xe(g,d),Ee(()=>{if(!d)return;const e=e=>{p.current?.contains(e.target)||g()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[d,g]),Ee(()=>{u>=0&&f.current.get(u)?.focus()},[u]);const x=e=>l?"0ms":40*e+"ms";/* @__PURE__ */
291
+ /* @__PURE__ */Ke(Tr,{title:o,items:e,selected:p,onToggle:w,onToggleAll:S,search:x,onSearchChange:b,searchable:i,height:a,listId:u}),
292
+ /* @__PURE__ */Ye("div",{className:U("flex items-center justify-center gap-2","flex-row sm:flex-col"),style:{padding:"8px 0"},children:[/* @__PURE__ */Ke("button",{type:"button","aria-label":"Move selected items to target list",disabled:0===p.size,onClick:$,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),$())},className:U("focus-visible:ring-2 focus-visible:ring-offset-1"),style:N(0===p.size),onMouseEnter:e=>{p.size>0&&(e.currentTarget.style.backgroundColor=d.primary,e.currentTarget.style.borderColor=d.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===p.size?d.surface:d.surfaceAlt,e.currentTarget.style.borderColor=d.border},children:/* @__PURE__ */Ke(Ir,{color:d.text})}),/* @__PURE__ */Ke("button",{type:"button","aria-label":"Move selected items to source list",disabled:0===m.size,onClick:z,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),z())},className:U("focus-visible:ring-2 focus-visible:ring-offset-1"),style:N(0===m.size),onMouseEnter:e=>{m.size>0&&(e.currentTarget.style.backgroundColor=d.primary,e.currentTarget.style.borderColor=d.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===m.size?d.surface:d.surfaceAlt,e.currentTarget.style.borderColor=d.border},children:/* @__PURE__ */Ke(Rr,{color:d.text})})]}),
293
+ /* @__PURE__ */Ke(Tr,{title:r,items:t,selected:m,onToggle:k,onToggleAll:C,search:y,onSearchChange:v,searchable:i,height:a,listId:h})]})}function Lr({color:e,rotated:t,reducedMotion:n}){/* @__PURE__ */
294
+ return Ke("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:/* @__PURE__ */Ke("path",{d:"M12 5v14M5 12h14",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"})})}var Wr={"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 Ar({actions:e,icon:t,direction:n="up",position:o="bottom-right",className:r,style:i}){const a=M(),l=ge(),s=He(),[d,c]=Ve(!1),[u,h]=Ve(-1),p=Oe(null),f=Oe(/* @__PURE__ */new Map),m=Ae(()=>{c(e=>!e),h(-1)},[]),g=Ae(()=>{c(!1),h(-1)},[]);xe(g,d),Ee(()=>{if(!d)return;const e=e=>{p.current?.contains(e.target)||g()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[d,g]),Ee(()=>{u>=0&&f.current.get(u)?.focus()},[u]);const x=e=>l?"0ms":40*e+"ms";/* @__PURE__ */
295
295
  return Ye(Ue,{children:[d&&"undefined"!=typeof document&&Xe(/* @__PURE__ */Ke("div",{"aria-hidden":"true",onClick:g,style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:9e3,transition:l?"none":"opacity 200ms ease"}}),document.body),
296
296
  /* @__PURE__ */Ye("div",{ref:p,className:U("fixed z-[9100] font-sans",r??""),style:{...Wr[o],...i},children:[d&&e.map((t,o)=>{const r=F(t.label),i=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%)"}}}(n,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}}}(n);/* @__PURE__ */
297
297
  return Ke("div",{className:U("absolute"),style:{...i,opacity:l?1:0,animation:l?"none":"tkxSpeedDialIn 180ms ease forwards",animationDelay:x(o)},children:/* @__PURE__ */Ye("div",{className:U("relative inline-flex"),children:[/* @__PURE__ */Ke("span",{className:U("absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none"),style:{...s,backgroundColor:a.surfaceAlt,color:a.text,border:`1px solid ${a.border}`,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},role:"tooltip",children:r}),/* @__PURE__ */Ke("button",{ref:e=>{e?f.current.set(o,e):f.current.delete(o)},type:"button","aria-label":r,tabIndex:d?0:-1,onClick:()=>{t.onClick?.(),g()},onKeyDown:t=>((t,n)=>{switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),h(n>0?n-1:e.length-1);break;case"ArrowDown":case"ArrowRight":t.preventDefault(),h(n<e.length-1?n+1:0);break;case"Enter":case" ":t.preventDefault(),e[n].onClick?.(),g();break;case"Escape":g();break;case"Home":t.preventDefault(),h(0);break;case"End":t.preventDefault(),h(e.length-1)}})(t,o),className:U("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:a.surface,color:a.text,border:`1px solid ${a.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",transition:l?"none":"all 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=a.surfaceAlt,e.currentTarget.style.transform="scale(1.1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=a.surface,e.currentTarget.style.transform="scale(1)"},children:t.icon})]})},t.id)}),
298
- /* @__PURE__ */Ke("button",{type:"button","aria-label":d?"Close actions menu":"Open actions menu","aria-expanded":d,"aria-controls":s,"aria-haspopup":"true",onClick:m,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m()),d&&("ArrowUp"!==e.key&&"ArrowLeft"!==e.key||(e.preventDefault(),h(0)),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),h(0)))},className:U("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:a.primary,color:a.bg,boxShadow:`0 6px 20px ${a.primary}40`,transition:l?"none":"all 200ms ease",position:"relative",zIndex:1},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 8px 28px ${a.primary}60`,l||(e.currentTarget.style.transform="scale(1.05)")},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 6px 20px ${a.primary}40`,e.currentTarget.style.transform="scale(1)"},children:t??/* @__PURE__ */Ke(Tr,{color:a.bg,rotated:d,reducedMotion:l})}),
298
+ /* @__PURE__ */Ke("button",{type:"button","aria-label":d?"Close actions menu":"Open actions menu","aria-expanded":d,"aria-controls":s,"aria-haspopup":"true",onClick:m,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m()),d&&("ArrowUp"!==e.key&&"ArrowLeft"!==e.key||(e.preventDefault(),h(0)),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),h(0)))},className:U("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:a.primary,color:a.bg,boxShadow:`0 6px 20px ${a.primary}40`,transition:l?"none":"all 200ms ease",position:"relative",zIndex:1},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 8px 28px ${a.primary}60`,l||(e.currentTarget.style.transform="scale(1.05)")},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 6px 20px ${a.primary}40`,e.currentTarget.style.transform="scale(1)"},children:t??/* @__PURE__ */Ke(Lr,{color:a.bg,rotated:d,reducedMotion:l})}),
299
299
  /* @__PURE__ */Ke("div",{id:s,role:"menu","aria-label":"Speed dial actions",style:{display:"none"},children:e.map(e=>/* @__PURE__ */Ke("div",{role:"menuitem",children:F(e.label)},e.id))})]}),d&&!l&&/* @__PURE__ */Ke("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 "})]})}function Br({open:e}){/* @__PURE__ */
300
300
  return Ke("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */Ye(Ue,e?{children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}:{children:[
301
301
  /* @__PURE__ */Ke("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),
302
302
  /* @__PURE__ */Ke("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),
303
- /* @__PURE__ */Ke("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}function Er({title:e,logo:t,actions:n,navigation:o,position:r="sticky",variant:i="default",color:a="surface"}){const l=N(),s=ge(),d=function(){const[e,t]=Ve(()=>"undefined"!=typeof window&&window.innerWidth<768);return Ee(()=>{if("undefined"==typeof window)return;const e=()=>t(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),[c,u]=Ve(!1),h=Oe(null),p=He();xe(()=>u(!1),c),Ee(()=>{!d&&c&&u(!1)},[d,c]),Ee(()=>{if(!c)return;const e=e=>{h.current&&!h.current.contains(e.target)&&u(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[c]);const f=Ae(()=>{u(e=>!e)},[]),m="primary"===a?l.primary:l.surface,g="primary"===a?l.bg:l.text,x={default:{backgroundColor:m,borderBottom:`1px solid ${l.border}`},transparent:{backgroundColor:"transparent",borderBottom:"none"},elevated:{backgroundColor:m,boxShadow:`0 2px 8px ${l.bg}66`,borderBottom:"none"}},b="string"==typeof e?F(e):e,y=s?"none":"max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease";/* @__PURE__ */
304
- return Ye("header",{role:"banner",className:U("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"}}[r],...x[i],color:g,height:56},children:[/* @__PURE__ */Ye("div",{ref:h,className:U("flex items-center h-full px-4"),style:{maxWidth:1440,margin:"0 auto"},children:[t&&/* @__PURE__ */Ke("div",{className:U("flex items-center shrink-0 mr-3"),"aria-hidden":"true",children:t}),b&&/* @__PURE__ */Ke("div",{className:U("text-base font-semibold shrink-0 mr-4 leading-snug"),style:{color:g},children:b}),!d&&o&&/* @__PURE__ */Ke("nav",{id:p,"aria-label":"Main navigation",className:U("flex items-center flex-1 gap-1"),children:o}),d&&/* @__PURE__ */Ke("div",{className:U("flex-1")}),n&&/* @__PURE__ */Ke("div",{className:U("flex items-center gap-2 ml-auto shrink-0"),children:n}),d&&o&&/* @__PURE__ */Ke("button",{onClick:f,"aria-expanded":c,"aria-controls":p,"aria-label":c?"Close navigation menu":"Open navigation menu",className:U("bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center","focus-visible:focus-ring"),style:{color:g},children:/* @__PURE__ */Ke(Br,{open:c})})]}),d&&o&&/* @__PURE__ */Ke("nav",{id:p,"aria-label":"Main navigation",style:{maxHeight:c?400:0,opacity:c?1:0,overflow:"hidden",transition:y,backgroundColor:l.surface,borderBottom:c?`1px solid ${l.border}`:"none"},children:/* @__PURE__ */Ke("div",{className:U("flex flex-col gap-1 px-4 py-3"),role:"menu",children:o})})]})}var Hr=!1;function Fr({items:e,activeId:t,onChange:n,showLabels:o=!0}){const r=N(),i=ge(),a=Oe(null);Ee(()=>{!function(){if(Hr||"undefined"==typeof document)return;Hr=!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 l=e.slice(0,5),s=Ae(e=>{n?.(e)},[n]),d=Ae(e=>{const t=a.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(),s(l[r].id))},[s,l]),c=i?"none":"color 200ms ease, transform 150ms ease";/* @__PURE__ */
303
+ /* @__PURE__ */Ke("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}function Er({title:e,logo:t,actions:n,navigation:o,position:r="sticky",variant:i="default",color:a="surface"}){const l=M(),s=ge(),d=function(){const[e,t]=Ve(()=>"undefined"!=typeof window&&window.innerWidth<768);return Ee(()=>{if("undefined"==typeof window)return;const e=()=>t(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),[c,u]=Ve(!1),h=Oe(null),p=He();xe(()=>u(!1),c),Ee(()=>{!d&&c&&u(!1)},[d,c]),Ee(()=>{if(!c)return;const e=e=>{h.current&&!h.current.contains(e.target)&&u(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[c]);const f=Ae(()=>{u(e=>!e)},[]),m="primary"===a?l.primary:l.surface,g="primary"===a?l.bg:l.text,x={default:{backgroundColor:m,borderBottom:`1px solid ${l.border}`},transparent:{backgroundColor:"transparent",borderBottom:"none"},elevated:{backgroundColor:m,boxShadow:`0 2px 8px ${l.bg}66`,borderBottom:"none"}},b="string"==typeof e?F(e):e,y=s?"none":"max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease";/* @__PURE__ */
304
+ return Ye("header",{role:"banner",className:U("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"}}[r],...x[i],color:g,height:56},children:[/* @__PURE__ */Ye("div",{ref:h,className:U("flex items-center h-full px-4"),style:{maxWidth:1440,margin:"0 auto"},children:[t&&/* @__PURE__ */Ke("div",{className:U("flex items-center shrink-0 mr-3"),"aria-hidden":"true",children:t}),b&&/* @__PURE__ */Ke("div",{className:U("text-base font-semibold shrink-0 mr-4 leading-snug"),style:{color:g},children:b}),!d&&o&&/* @__PURE__ */Ke("nav",{id:p,"aria-label":"Main navigation",className:U("flex items-center flex-1 gap-1"),children:o}),d&&/* @__PURE__ */Ke("div",{className:U("flex-1")}),n&&/* @__PURE__ */Ke("div",{className:U("flex items-center gap-2 ml-auto shrink-0"),children:n}),d&&o&&/* @__PURE__ */Ke("button",{onClick:f,"aria-expanded":c,"aria-controls":p,"aria-label":c?"Close navigation menu":"Open navigation menu",className:U("bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center","focus-visible:focus-ring"),style:{color:g},children:/* @__PURE__ */Ke(Br,{open:c})})]}),d&&o&&/* @__PURE__ */Ke("nav",{id:p,"aria-label":"Main navigation",style:{maxHeight:c?400:0,opacity:c?1:0,overflow:"hidden",transition:y,backgroundColor:l.surface,borderBottom:c?`1px solid ${l.border}`:"none"},children:/* @__PURE__ */Ke("div",{className:U("flex flex-col gap-1 px-4 py-3"),role:"menu",children:o})})]})}var Hr=!1;function Fr({items:e,activeId:t,onChange:n,showLabels:o=!0}){const r=M(),i=ge(),a=Oe(null);Ee(()=>{!function(){if(Hr||"undefined"==typeof document)return;Hr=!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 l=e.slice(0,5),s=Ae(e=>{n?.(e)},[n]),d=Ae(e=>{const t=a.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(),s(l[r].id))},[s,l]),c=i?"none":"color 200ms ease, transform 150ms ease";/* @__PURE__ */
305
305
  return Ke("nav",{ref:a,role:"navigation","aria-label":"Bottom navigation",className:U("fixed bottom-0 left-0 right-0 z-[1000] font-sans"),style:{height:56,backgroundColor:r.surface,borderTop:`1px solid ${r.border}`,boxShadow:`0 -2px 12px ${r.bg}44`},children:/* @__PURE__ */Ke("div",{role:"tablist","aria-label":"Navigation tabs",className:U("flex items-center justify-around h-full"),onKeyDown:d,children:l.map(e=>{const n=e.id===t,a=F(e.label),l=n?r.primary:r.textMuted;/* @__PURE__ */
306
306
  return Ye("button",{role:"tab","aria-selected":n,"aria-label":a,tabIndex:n?0:-1,onClick:()=>s(e.id),className:U("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:l,transition:c,outline:"none"},children:[n&&/* @__PURE__ */Ke("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:"25%",right:"25%",height:3,borderRadius:"0 0 3px 3px",backgroundColor:r.primary,transition:i?"none":"width 200ms ease"}}),
307
- /* @__PURE__ */Ye("div",{className:U("relative flex items-center justify-center"),style:{animation:n&&!i?"tkx-bottom-nav-pulse 300ms ease-out":"none"},children:[e.icon,void 0!==e.badge&&e.badge>0&&/* @__PURE__ */Ke("span",{"aria-label":`${e.badge} notifications`,className:U("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:r.danger,color:r.bg},children:e.badge>99?"99+":e.badge})]}),o&&/* @__PURE__ */Ke("span",{className:U("text-[10px] leading-tight mt-0.5"),style:{fontWeight:n?600:400,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a})]},e.id)})})})}var jr=!1,Pr={success:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})})},Or={"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 Vr({message:e,isOpen:t,onClose:n,action:o,variant:r="default",position:i="bottom-center",autoHideDuration:a=5e3,icon:l}){const s=N(),d=ge(),c=He(),u=Oe(null),[h,p]=Ve(!1),[f,m]=Ve(!1);Ee(()=>{!function(){if(jr||"undefined"==typeof document)return;jr=!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)}()},[]),Ee(()=>{if(t)m(!1),p(!0);else if(h){if(!d){m(!0);const e=setTimeout(()=>{p(!1),m(!1)},250);return()=>clearTimeout(e)}p(!1)}},[t,d,h]),Ee(()=>{if(t&&!(a<=0)&&n)return u.current=setTimeout(()=>{n()},a),()=>{u.current&&clearTimeout(u.current)}},[t,a,n]);const g=Ae(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),x=Ae(()=>{t&&a>0&&n&&(u.current=setTimeout(()=>n(),a))},[t,a,n]),b={default:s.textMuted,success:s.success,error:s.danger,warning:s.warning,info:s.info}[r],y=F(e);if(!h||"undefined"==typeof document)return null;let v={};d||(v=f?{animation:"tkx-snackbar-fade-out 250ms ease forwards"}:{animation:("top-center"===i?"tkx-snackbar-slide-down":"tkx-snackbar-slide-up")+" 250ms cubic-bezier(0.16,1,0.3,1) both"});const w=l??Pr[r]??null;return Xe(/* @__PURE__ */Ke("div",{role:"error"===r?"alert":"status","aria-live":"error"===r?"assertive":"polite","aria-atomic":"true","aria-labelledby":c,className:U("fixed z-[9500] font-sans"),style:{...Or[i],...v,pointerEvents:"auto"},onMouseEnter:g,onMouseLeave:x,children:/* @__PURE__ */Ye("div",{className:U("flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg","min-w-[280px] max-w-[480px]"),style:{backgroundColor:s.surface,border:`1px solid ${b}44`,boxShadow:`0 8px 24px ${s.bg}aa`,color:s.text},children:[w&&/* @__PURE__ */Ke("span",{className:U("shrink-0 flex items-center"),style:{color:b},children:w}),
307
+ /* @__PURE__ */Ye("div",{className:U("relative flex items-center justify-center"),style:{animation:n&&!i?"tkx-bottom-nav-pulse 300ms ease-out":"none"},children:[e.icon,void 0!==e.badge&&e.badge>0&&/* @__PURE__ */Ke("span",{"aria-label":`${e.badge} notifications`,className:U("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:r.danger,color:r.bg},children:e.badge>99?"99+":e.badge})]}),o&&/* @__PURE__ */Ke("span",{className:U("text-[10px] leading-tight mt-0.5"),style:{fontWeight:n?600:400,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a})]},e.id)})})})}var jr=!1,Pr={success:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})})},Or={"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 Vr({message:e,isOpen:t,onClose:n,action:o,variant:r="default",position:i="bottom-center",autoHideDuration:a=5e3,icon:l}){const s=M(),d=ge(),c=He(),u=Oe(null),[h,p]=Ve(!1),[f,m]=Ve(!1);Ee(()=>{!function(){if(jr||"undefined"==typeof document)return;jr=!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)}()},[]),Ee(()=>{if(t)m(!1),p(!0);else if(h){if(!d){m(!0);const e=setTimeout(()=>{p(!1),m(!1)},250);return()=>clearTimeout(e)}p(!1)}},[t,d,h]),Ee(()=>{if(t&&!(a<=0)&&n)return u.current=setTimeout(()=>{n()},a),()=>{u.current&&clearTimeout(u.current)}},[t,a,n]);const g=Ae(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),x=Ae(()=>{t&&a>0&&n&&(u.current=setTimeout(()=>n(),a))},[t,a,n]),b={default:s.textMuted,success:s.success,error:s.danger,warning:s.warning,info:s.info}[r],y=F(e);if(!h||"undefined"==typeof document)return null;let v={};d||(v=f?{animation:"tkx-snackbar-fade-out 250ms ease forwards"}:{animation:("top-center"===i?"tkx-snackbar-slide-down":"tkx-snackbar-slide-up")+" 250ms cubic-bezier(0.16,1,0.3,1) both"});const w=l??Pr[r]??null;return Xe(/* @__PURE__ */Ke("div",{role:"error"===r?"alert":"status","aria-live":"error"===r?"assertive":"polite","aria-atomic":"true","aria-labelledby":c,className:U("fixed z-[9500] font-sans"),style:{...Or[i],...v,pointerEvents:"auto"},onMouseEnter:g,onMouseLeave:x,children:/* @__PURE__ */Ye("div",{className:U("flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg","min-w-[280px] max-w-[480px]"),style:{backgroundColor:s.surface,border:`1px solid ${b}44`,boxShadow:`0 8px 24px ${s.bg}aa`,color:s.text},children:[w&&/* @__PURE__ */Ke("span",{className:U("shrink-0 flex items-center"),style:{color:b},children:w}),
308
308
  /* @__PURE__ */Ke("span",{id:c,className:U("flex-1 text-sm leading-snug"),children:y}),o&&/* @__PURE__ */Ke("button",{onClick:()=>{o.onClick(),n?.()},className:U("bg-transparent border-none cursor-pointer p-0 ml-2","text-sm font-semibold shrink-0","focus-visible:focus-ring"),style:{color:s.primary},children:F(o.label)}),n&&/* @__PURE__ */Ke("button",{"aria-label":"Dismiss snackbar",onClick:n,className:U("bg-transparent border-none cursor-pointer rounded p-[2px] ml-1","shrink-0 flex items-center justify-center","focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ke("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ke("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),document.body)}function Ur({direction:e}){/* @__PURE__ */
309
- return Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:U("shrink-0 ml-1"),children:/* @__PURE__ */Ke("path","asc"===e?{d:"M7 14l5-5 5 5H7z"}:"desc"===e?{d:"M7 10l5 5 5-5H7z"}:{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.35"})})}function Kr({checked:e,indeterminate:t}){const n=N();/* @__PURE__ */
309
+ return Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:U("shrink-0 ml-1"),children:/* @__PURE__ */Ke("path","asc"===e?{d:"M7 14l5-5 5 5H7z"}:"desc"===e?{d:"M7 10l5 5 5-5H7z"}:{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.35"})})}function Kr({checked:e,indeterminate:t}){const n=M();/* @__PURE__ */
310
310
  return Ye("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[
311
- /* @__PURE__ */Ke("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||t?n.primary:"transparent",stroke:e||t?n.primary:n.border,strokeWidth:"1.5"}),t&&/* @__PURE__ */Ke("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:n.bg,strokeWidth:"2"}),e&&!t&&/* @__PURE__ */Ke("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:n.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Yr(e,t){return"function"==typeof t?t(e):String(e[t])}function Xr(e,t){return e[t]}function qr(e){const t=String(e??"");return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t}function Gr({colCount:e}){const t=N();/* @__PURE__ */
312
- return Ke("tbody",{children:Array.from({length:5},(n,o)=>/* @__PURE__ */Ke("tr",{children:Array.from({length:e},(e,n)=>/* @__PURE__ */Ke("td",{className:U("px-3 py-2"),style:{borderBottom:`1px solid ${t.border}`},children:/* @__PURE__ */Ke(Lt,{height:16})},n))},o))})}function _r({label:e,showExport:t,onExport:n,totalRows:o,selectedCount:r,theme:i}){return t||0!==r?/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8},children:[/* @__PURE__ */Ke("span",{style:{fontSize:13,color:i.textMuted},children:r>0?`${r} of ${o} row${1!==o?"s":""} selected`:`${o} row${1!==o?"s":""}`}),t&&/* @__PURE__ */Ye("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:[/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
311
+ /* @__PURE__ */Ke("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||t?n.primary:"transparent",stroke:e||t?n.primary:n.border,strokeWidth:"1.5"}),t&&/* @__PURE__ */Ke("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:n.bg,strokeWidth:"2"}),e&&!t&&/* @__PURE__ */Ke("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:n.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Yr(e,t){return"function"==typeof t?t(e):String(e[t])}function Xr(e,t){return e[t]}function qr(e){const t=String(e??"");return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t}function Gr({colCount:e}){const t=M();/* @__PURE__ */
312
+ return Ke("tbody",{children:Array.from({length:5},(n,o)=>/* @__PURE__ */Ke("tr",{children:Array.from({length:e},(e,n)=>/* @__PURE__ */Ke("td",{className:U("px-3 py-2"),style:{borderBottom:`1px solid ${t.border}`},children:/* @__PURE__ */Ke(Rt,{height:16})},n))},o))})}function Jr({label:e,showExport:t,onExport:n,totalRows:o,selectedCount:r,theme:i}){return t||0!==r?/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8},children:[/* @__PURE__ */Ke("span",{style:{fontSize:13,color:i.textMuted},children:r>0?`${r} of ${o} row${1!==o?"s":""} selected`:`${o} row${1!==o?"s":""}`}),t&&/* @__PURE__ */Ye("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:[/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
313
313
  /* @__PURE__ */Ke("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
314
314
  /* @__PURE__ */Ke("polyline",{points:"7 10 12 15 17 10"}),
315
- /* @__PURE__ */Ke("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Export CSV"]})]}):null}function Zr({page:e,totalPages:t,pageSize:n,totalRows:o,onPageChange:r,theme:i}){const a=(e-1)*n+1,l=Math.min(e*n,o),s={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};/* @__PURE__ */
315
+ /* @__PURE__ */Ke("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Export CSV"]})]}):null}function _r({page:e,totalPages:t,pageSize:n,totalRows:o,onPageChange:r,theme:i}){const a=(e-1)*n+1,l=Math.min(e*n,o),s={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};/* @__PURE__ */
316
316
  return Ye("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:[/* @__PURE__ */Ke("span",{style:{fontSize:13,color:i.textMuted},children:0===o?"0 rows":`${a}–${l} of ${o}`}),/* @__PURE__ */Ye("div",{style:{display:"flex",gap:4},children:[
317
317
  /* @__PURE__ */Ke("button",{onClick:()=>r(1),disabled:1===e,"aria-label":"First page",style:{...s,opacity:1===e?.4:1},children:"«"}),
318
318
  /* @__PURE__ */Ke("button",{onClick:()=>r(e-1),disabled:1===e,"aria-label":"Previous page",style:{...s,opacity:1===e?.4:1},children:"‹"}),Array.from({length:Math.min(5,t)},(n,o)=>{let a=o+1;return t>5&&(a=Math.max(1,Math.min(e-Math.floor(2.5),t-4))+o),/* @__PURE__ */Ke("button",{onClick:()=>r(a),"aria-label":`Page ${a}`,"aria-current":a===e?"page":void 0,style:{...s,backgroundColor:a===e?i.primary:"transparent",color:a===e?i.bg:i.text,borderColor:a===e?i.primary:i.border},children:a},a)}),
319
319
  /* @__PURE__ */Ke("button",{onClick:()=>r(e+1),disabled:e===t,"aria-label":"Next page",style:{...s,opacity:e===t?.4:1},children:"›"}),
320
- /* @__PURE__ */Ke("button",{onClick:()=>r(t),disabled:e===t,"aria-label":"Last page",style:{...s,opacity:e===t?.4:1},children:"»"})]})]})}function Jr({columns:e,data:t,rowKey:n,selectable:o=!1,selectedRows:r=[],onSelectionChange:i,sortable:a=!1,onSort:l,loading:s=!1,emptyMessage:d,stickyHeader:c=!1,striped:u=!1,bordered:h=!1,compact:p=!1,maxHeight:f,onRowClick:m,virtualScroll:g,rowHeight:x=40,showFilters:b=!1,filterValues:y,onFilterChange:v,pageSize:w=0,showExport:k=!1,exportFileName:S="export",onLoadMore:C,hasMore:$,loadingMore:z=!1,loadMoreThreshold:M=200}){const I=N(),L=$e(),R=d??L.noRows??L.noData??"No data to display",D=ge(),T=He(),[W,A]=Ve(null),[B,E]=Ve("asc"),H=Ae(e=>{const t=W===e&&"asc"===B?"desc":"asc";A(e),E(t),l?.(e,t)},[W,B,l]),j=je(()=>l||!W?t:[...t].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"})}(Xr(e,W),Xr(t,W));return"asc"===B?n:-n}),[t,W,B,l]),[P,O]=Ve({}),V=y??P,K=Ae((e,t)=>{v?v(e,t):O(n=>({...n,[e]:t}))},[v]),Y=je(()=>{const e=Object.entries(V).filter(([,e])=>""!==e.trim());return 0===e.length?j:j.filter(t=>e.every(([e,n])=>{const o=Xr(t,e);return String(o??"").toLowerCase().includes(n.toLowerCase())}))},[j,V]),[X,q]=Ve(1),G=w>0,_=Y.length,Z=G?Math.max(1,Math.ceil(_/w)):1;Ee(()=>{q(1)},[V,W,B]);const J=je(()=>G?Y.slice((X-1)*w,X*w):Y,[Y,G,X,w]),Q=void 0!==g?g:!G&&void 0!==f&&J.length>=50,ee=Oe(null),[te,ne]=Ve(0),[oe,re]=Ve(0),ie=Ae(()=>{ee.current&&ne(ee.current.scrollTop)},[]);Ee(()=>{if(!Q||!ee.current)return;const e=ee.current;re(e.clientHeight);const t=new ResizeObserver(()=>re(e.clientHeight));return t.observe(e),()=>t.disconnect()},[Q]),J.length;const ae=Q?Math.max(0,Math.floor(te/x)-10):0,le=Q?Math.min(J.length,Math.ceil((te+oe)/x)+10):J.length,se=Q?J.slice(ae,le):J,de=ae*x,ce=Oe(null),ue=Oe(!1);Ee(()=>{ue.current=!1},[t.length]),Ee(()=>{if(!C)return;const e=ce.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!ue.current&&!1!==$&&(ue.current=!0,C())},{root:ee.current,rootMargin:`0px 0px ${M}px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[C,$,M]);const he=je(()=>new Set(r),[r]),pe=je(()=>Y.map(e=>Yr(e,n)),[Y,n]),fe=pe.length>0&&pe.every(e=>he.has(e)),me=pe.some(e=>he.has(e)),xe=Ae(()=>{i?.(fe?[]:pe)},[fe,pe,i]),be=Ae(e=>{const t=he.has(e)?r.filter(t=>t!==e):[...r,e];i?.(t)},[he,r,i]),[ye,ve]=Ve({}),we=Oe(null),ke=Ae((e,t)=>{t.preventDefault(),t.stopPropagation();const n=t.target.closest("th");if(!n)return;const o=ye[e]||n.getBoundingClientRect().width;we.current={key:e,startX:t.clientX,startWidth:o};const r=e=>{if(!we.current)return;const t=Math.max(50,we.current.startWidth+e.clientX-we.current.startX);ve(e=>({...e,[we.current.key]:t}))},i=()=>{we.current=null,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)},[ye]),Se=Ae(()=>{const t=[e.map(e=>qr(e.header)).join(","),...Y.map(t=>e.map(e=>qr(Xr(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=`${S}.csv`,r.click(),URL.revokeObjectURL(o)},[e,Y,S]),Ce=p?"4px":"8px",ze=p?"8px":"12px",Ne=e=>{const t=ye[e.key]||e.width;return{width:null!=t?t:void 0,minWidth:null!=t?t:80,textAlign:e.align??"left",padding:`${Ce} ${ze}`}},Me=h?`1px solid ${I.border}`:"none",Ie=F(R),Le=e.length+(o?1:0),Re=e.some(e=>e.filterable);/* @__PURE__ */
321
- return Ye("div",{role:"grid","aria-label":"Data grid","aria-rowcount":_,id:T,className:U("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${I.border}`,backgroundColor:I.bg},children:[
322
- /* @__PURE__ */Ke(_r,{label:"data grid",showExport:k,onExport:Se,totalRows:_,selectedCount:r.length,theme:I}),
320
+ /* @__PURE__ */Ke("button",{onClick:()=>r(t),disabled:e===t,"aria-label":"Last page",style:{...s,opacity:e===t?.4:1},children:"»"})]})]})}function Zr({columns:e,data:t,rowKey:n,selectable:o=!1,selectedRows:r=[],onSelectionChange:i,sortable:a=!1,onSort:l,loading:s=!1,emptyMessage:d,stickyHeader:c=!1,striped:u=!1,bordered:h=!1,compact:p=!1,maxHeight:f,onRowClick:m,virtualScroll:g,rowHeight:x=40,showFilters:b=!1,filterValues:y,onFilterChange:v,pageSize:w=0,showExport:k=!1,exportFileName:S="export",onLoadMore:C,hasMore:$,loadingMore:z=!1,loadMoreThreshold:N=200}){const I=M(),R=$e(),T=d??R.noRows??R.noData??"No data to display",D=ge(),L=He(),[W,A]=Ve(null),[B,E]=Ve("asc"),H=Ae(e=>{const t=W===e&&"asc"===B?"desc":"asc";A(e),E(t),l?.(e,t)},[W,B,l]),j=je(()=>l||!W?t:[...t].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"})}(Xr(e,W),Xr(t,W));return"asc"===B?n:-n}),[t,W,B,l]),[P,O]=Ve({}),V=y??P,K=Ae((e,t)=>{v?v(e,t):O(n=>({...n,[e]:t}))},[v]),Y=je(()=>{const e=Object.entries(V).filter(([,e])=>""!==e.trim());return 0===e.length?j:j.filter(t=>e.every(([e,n])=>{const o=Xr(t,e);return String(o??"").toLowerCase().includes(n.toLowerCase())}))},[j,V]),[X,q]=Ve(1),G=w>0,J=Y.length,_=G?Math.max(1,Math.ceil(J/w)):1;Ee(()=>{q(1)},[V,W,B]);const Z=je(()=>G?Y.slice((X-1)*w,X*w):Y,[Y,G,X,w]),Q=void 0!==g?g:!G&&void 0!==f&&Z.length>=50,ee=Oe(null),[te,ne]=Ve(0),[oe,re]=Ve(0),ie=Ae(()=>{ee.current&&ne(ee.current.scrollTop)},[]);Ee(()=>{if(!Q||!ee.current)return;const e=ee.current;re(e.clientHeight);const t=new ResizeObserver(()=>re(e.clientHeight));return t.observe(e),()=>t.disconnect()},[Q]),Z.length;const ae=Q?Math.max(0,Math.floor(te/x)-10):0,le=Q?Math.min(Z.length,Math.ceil((te+oe)/x)+10):Z.length,se=Q?Z.slice(ae,le):Z,de=ae*x,ce=Oe(null),ue=Oe(!1);Ee(()=>{ue.current=!1},[t.length]),Ee(()=>{if(!C)return;const e=ce.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!ue.current&&!1!==$&&(ue.current=!0,C())},{root:ee.current,rootMargin:`0px 0px ${N}px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[C,$,N]);const he=je(()=>new Set(r),[r]),pe=je(()=>Y.map(e=>Yr(e,n)),[Y,n]),fe=pe.length>0&&pe.every(e=>he.has(e)),me=pe.some(e=>he.has(e)),xe=Ae(()=>{i?.(fe?[]:pe)},[fe,pe,i]),be=Ae(e=>{const t=he.has(e)?r.filter(t=>t!==e):[...r,e];i?.(t)},[he,r,i]),[ye,ve]=Ve({}),we=Oe(null),ke=Ae((e,t)=>{t.preventDefault(),t.stopPropagation();const n=t.target.closest("th");if(!n)return;const o=ye[e]||n.getBoundingClientRect().width;we.current={key:e,startX:t.clientX,startWidth:o};const r=e=>{if(!we.current)return;const t=Math.max(50,we.current.startWidth+e.clientX-we.current.startX);ve(e=>({...e,[we.current.key]:t}))},i=()=>{we.current=null,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)},[ye]),Se=Ae(()=>{const t=[e.map(e=>qr(e.header)).join(","),...Y.map(t=>e.map(e=>qr(Xr(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=`${S}.csv`,r.click(),URL.revokeObjectURL(o)},[e,Y,S]),Ce=p?"4px":"8px",ze=p?"8px":"12px",Me=e=>{const t=ye[e.key]||e.width;return{width:null!=t?t:void 0,minWidth:null!=t?t:80,textAlign:e.align??"left",padding:`${Ce} ${ze}`}},Ne=h?`1px solid ${I.border}`:"none",Ie=F(T),Re=e.length+(o?1:0),Te=e.some(e=>e.filterable);/* @__PURE__ */
321
+ return Ye("div",{role:"grid","aria-label":"Data grid","aria-rowcount":J,id:L,className:U("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${I.border}`,backgroundColor:I.bg},children:[
322
+ /* @__PURE__ */Ke(Jr,{label:"data grid",showExport:k,onExport:Se,totalRows:J,selectedCount:r.length,theme:I}),
323
323
  /* @__PURE__ */Ye("div",{ref:ee,onScroll:Q?ie:void 0,style:{maxHeight:f??"none",overflowX:"auto",overflowY:f?"auto":"visible"},children:[
324
324
  /* @__PURE__ */Ye("table",{className:U("w-full"),style:{borderCollapse:"separate",borderSpacing:0,tableLayout:"auto"},children:[
325
- /* @__PURE__ */Ye("thead",{children:[/* @__PURE__ */Ye("tr",{role:"row",children:[o&&/* @__PURE__ */Ke("th",{scope:"col",role:"columnheader",style:{position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,borderBottom:`2px solid ${I.border}`,borderRight:Me,padding:`${Ce} ${ze}`,width:40,textAlign:"center"},children:/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},children:[/* @__PURE__ */Ke("input",{type:"checkbox",checked:fe,ref:e=>{e&&(e.indeterminate=me&&!fe)},onChange:xe,"aria-label":fe?"Deselect all rows":"Select all rows",style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),/* @__PURE__ */Ke(Kr,{checked:fe,indeterminate:me&&!fe})]})}),e.map(e=>{const t=(e.sortable??a)&&!1!==e.sortable,n=W===e.key,o=F(e.header);/* @__PURE__ */
326
- return Ke("th",{scope:"col",role:"columnheader","aria-sort":n?"asc"===B?"ascending":"descending":t?"none":void 0,className:U("text-xs font-semibold uppercase tracking-wider"),style:{...Ne(e),position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,color:I.textMuted,borderBottom:`2px solid ${I.border}`,borderRight:Me,cursor:t?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:D?"none":"background-color 150ms ease"},onClick:t?()=>H(e.key):void 0,onKeyDown:t?t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),H(e.key))}:void 0,tabIndex:t?0:void 0,children:/* @__PURE__ */Ye("div",{className:U("flex items-center gap-1"),style:{position:"relative"},children:[e.renderHeader?e.renderHeader(e):o,t&&/* @__PURE__ */Ke(Ur,{direction:n?B:null}),e.resizable&&/* @__PURE__ */Ke("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${o}`,className:U("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:t=>ke(e.key,t)})]})},e.key)})]}),(b||Re)&&/* @__PURE__ */Ye("tr",{role:"row","aria-label":"Column filters",children:[o&&/* @__PURE__ */Ke("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`4px ${ze}`,width:40}}),e.map(e=>/* @__PURE__ */Ke("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`4px ${ze}`},children:(e.filterable||b)&&/* @__PURE__ */Ke("input",{type:"text",value:V[e.key]??"",onChange:t=>K(e.key,t.target.value),placeholder:`${L.filterPlaceholder.replace(/[.…]+$/,"")} ${e.header}…`,"aria-label":`Filter by ${e.header}`,style:{width:"100%",padding:"3px 8px",fontSize:12,borderRadius:4,border:`1px solid ${I.border}`,backgroundColor:I.bg,color:I.text,outline:"none"}})},e.key))]})]}),s&&/* @__PURE__ */Ke(Gr,{colCount:Le}),!s&&/* @__PURE__ */Ke("tbody",{children:0===J.length?/* @__PURE__ */Ke("tr",{children:/* @__PURE__ */Ke("td",{colSpan:Le,className:U("text-center py-10"),style:{color:I.textMuted},children:Ie})}):/* @__PURE__ */Ye(Ue,{children:[Q&&de>0&&/* @__PURE__ */Ke("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ke("td",{colSpan:Le,style:{height:de,padding:0,border:"none"}})}),se.map((t,r)=>{const i=ae+r,a=Yr(t,n),l=he.has(a),s=u&&i%2==1;let d="transparent";return l?d=`${I.primary}22`:s&&(d=I.surfaceAlt),/* @__PURE__ */Ye("tr",{role:"row","aria-rowindex":i+1,"aria-selected":o?l:void 0,onClick:m?()=>m(t):void 0,onKeyDown:m?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m(t))}:void 0,tabIndex:m?0:void 0,className:U(m?"cursor-pointer":""),style:{backgroundColor:d,transition:D?"none":"background-color 120ms ease",...Q?{height:x,boxSizing:"border-box"}:{}},onMouseEnter:m?e=>{e.currentTarget.style.backgroundColor=l?`${I.primary}30`:I.surfaceAlt}:void 0,onMouseLeave:m?e=>{e.currentTarget.style.backgroundColor=d}:void 0,children:[o&&/* @__PURE__ */Ke("td",{role:"gridcell",style:{borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`${Ce} ${ze}`,textAlign:"center",width:40},children:/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},onClick:e=>e.stopPropagation(),children:[/* @__PURE__ */Ke("input",{type:"checkbox",checked:l,onChange:()=>be(a),"aria-label":l?`Deselect row ${a}`:`Select row ${a}`,style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),/* @__PURE__ */Ke(Kr,{checked:l})]})}),e.map(e=>{const n=Xr(t,e.key),o=e.renderCell?e.renderCell(n,t):"string"==typeof n?F(n):String(n??"");/* @__PURE__ */
327
- return Ke("td",{role:"gridcell",className:U("text-sm"),style:{...Ne(e),borderBottom:`1px solid ${I.border}`,borderRight:Me,color:I.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o},e.key)})]},a)}),Q&&le<J.length&&/* @__PURE__ */Ke("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ke("td",{colSpan:Le,style:{height:(J.length-le)*x,padding:0,border:"none"}})})]})})]}),($||z)&&/* @__PURE__ */Ke("div",{ref:ce,style:{height:1,width:"100%"},children:z&&/* @__PURE__ */Ke("table",{style:{width:"100%",borderCollapse:"collapse"},children:/* @__PURE__ */Ke("tbody",{children:Array.from({length:3},(t,n)=>/* @__PURE__ */Ke("tr",{children:e.map(e=>/* @__PURE__ */Ke("td",{style:{padding:"10px 16px"},children:/* @__PURE__ */Ke(Lt,{variant:"text",height:"16px"})},e.key))},n))})})}),!$&&C&&/* @__PURE__ */Ke("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:I.textMuted},children:"✓ All rows loaded"})]}),G&&!s&&/* @__PURE__ */Ke(Zr,{page:X,totalPages:Z,pageSize:w,totalRows:_,onPageChange:q,theme:I})]})}var Qr=!1;function ei({columns:e,gap:t=16,children:n}){N();const o=ge(),r=function(){const[e,t]=Ve(()=>{if("undefined"==typeof window)return"lg";const e=window.innerWidth;return e>=1024?"lg":e>=768?"md":"sm"});return Ee(()=>{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}();Ee(()=>{!function(){if(Qr||"undefined"==typeof document)return;Qr=!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 i=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,r),a=Le.toArray(n),l=je(()=>{const e=Array.from({length:i},()=>[]);return a.forEach((t,n)=>{e[n%i].push(t)}),e},[a,i]);/* @__PURE__ */
325
+ /* @__PURE__ */Ye("thead",{children:[/* @__PURE__ */Ye("tr",{role:"row",children:[o&&/* @__PURE__ */Ke("th",{scope:"col",role:"columnheader",style:{position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,borderBottom:`2px solid ${I.border}`,borderRight:Ne,padding:`${Ce} ${ze}`,width:40,textAlign:"center"},children:/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},children:[/* @__PURE__ */Ke("input",{type:"checkbox",checked:fe,ref:e=>{e&&(e.indeterminate=me&&!fe)},onChange:xe,"aria-label":fe?"Deselect all rows":"Select all rows",style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),/* @__PURE__ */Ke(Kr,{checked:fe,indeterminate:me&&!fe})]})}),e.map(e=>{const t=(e.sortable??a)&&!1!==e.sortable,n=W===e.key,o=F(e.header);/* @__PURE__ */
326
+ return Ke("th",{scope:"col",role:"columnheader","aria-sort":n?"asc"===B?"ascending":"descending":t?"none":void 0,className:U("text-xs font-semibold uppercase tracking-wider"),style:{...Me(e),position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,color:I.textMuted,borderBottom:`2px solid ${I.border}`,borderRight:Ne,cursor:t?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:D?"none":"background-color 150ms ease"},onClick:t?()=>H(e.key):void 0,onKeyDown:t?t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),H(e.key))}:void 0,tabIndex:t?0:void 0,children:/* @__PURE__ */Ye("div",{className:U("flex items-center gap-1"),style:{position:"relative"},children:[e.renderHeader?e.renderHeader(e):o,t&&/* @__PURE__ */Ke(Ur,{direction:n?B:null}),e.resizable&&/* @__PURE__ */Ke("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${o}`,className:U("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:t=>ke(e.key,t)})]})},e.key)})]}),(b||Te)&&/* @__PURE__ */Ye("tr",{role:"row","aria-label":"Column filters",children:[o&&/* @__PURE__ */Ke("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:Ne,padding:`4px ${ze}`,width:40}}),e.map(e=>/* @__PURE__ */Ke("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:Ne,padding:`4px ${ze}`},children:(e.filterable||b)&&/* @__PURE__ */Ke("input",{type:"text",value:V[e.key]??"",onChange:t=>K(e.key,t.target.value),placeholder:`${R.filterPlaceholder.replace(/[.…]+$/,"")} ${e.header}…`,"aria-label":`Filter by ${e.header}`,style:{width:"100%",padding:"3px 8px",fontSize:12,borderRadius:4,border:`1px solid ${I.border}`,backgroundColor:I.bg,color:I.text,outline:"none"}})},e.key))]})]}),s&&/* @__PURE__ */Ke(Gr,{colCount:Re}),!s&&/* @__PURE__ */Ke("tbody",{children:0===Z.length?/* @__PURE__ */Ke("tr",{children:/* @__PURE__ */Ke("td",{colSpan:Re,className:U("text-center py-10"),style:{color:I.textMuted},children:Ie})}):/* @__PURE__ */Ye(Ue,{children:[Q&&de>0&&/* @__PURE__ */Ke("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ke("td",{colSpan:Re,style:{height:de,padding:0,border:"none"}})}),se.map((t,r)=>{const i=ae+r,a=Yr(t,n),l=he.has(a),s=u&&i%2==1;let d="transparent";return l?d=`${I.primary}22`:s&&(d=I.surfaceAlt),/* @__PURE__ */Ye("tr",{role:"row","aria-rowindex":i+1,"aria-selected":o?l:void 0,onClick:m?()=>m(t):void 0,onKeyDown:m?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m(t))}:void 0,tabIndex:m?0:void 0,className:U(m?"cursor-pointer":""),style:{backgroundColor:d,transition:D?"none":"background-color 120ms ease",...Q?{height:x,boxSizing:"border-box"}:{}},onMouseEnter:m?e=>{e.currentTarget.style.backgroundColor=l?`${I.primary}30`:I.surfaceAlt}:void 0,onMouseLeave:m?e=>{e.currentTarget.style.backgroundColor=d}:void 0,children:[o&&/* @__PURE__ */Ke("td",{role:"gridcell",style:{borderBottom:`1px solid ${I.border}`,borderRight:Ne,padding:`${Ce} ${ze}`,textAlign:"center",width:40},children:/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},onClick:e=>e.stopPropagation(),children:[/* @__PURE__ */Ke("input",{type:"checkbox",checked:l,onChange:()=>be(a),"aria-label":l?`Deselect row ${a}`:`Select row ${a}`,style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),/* @__PURE__ */Ke(Kr,{checked:l})]})}),e.map(e=>{const n=Xr(t,e.key),o=e.renderCell?e.renderCell(n,t):"string"==typeof n?F(n):String(n??"");/* @__PURE__ */
327
+ return Ke("td",{role:"gridcell",className:U("text-sm"),style:{...Me(e),borderBottom:`1px solid ${I.border}`,borderRight:Ne,color:I.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o},e.key)})]},a)}),Q&&le<Z.length&&/* @__PURE__ */Ke("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ke("td",{colSpan:Re,style:{height:(Z.length-le)*x,padding:0,border:"none"}})})]})})]}),($||z)&&/* @__PURE__ */Ke("div",{ref:ce,style:{height:1,width:"100%"},children:z&&/* @__PURE__ */Ke("table",{style:{width:"100%",borderCollapse:"collapse"},children:/* @__PURE__ */Ke("tbody",{children:Array.from({length:3},(t,n)=>/* @__PURE__ */Ke("tr",{children:e.map(e=>/* @__PURE__ */Ke("td",{style:{padding:"10px 16px"},children:/* @__PURE__ */Ke(Rt,{variant:"text",height:"16px"})},e.key))},n))})})}),!$&&C&&/* @__PURE__ */Ke("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:I.textMuted},children:"✓ All rows loaded"})]}),G&&!s&&/* @__PURE__ */Ke(_r,{page:X,totalPages:_,pageSize:w,totalRows:J,onPageChange:q,theme:I})]})}var Qr=!1;function ei({columns:e,gap:t=16,children:n}){M();const o=ge(),r=function(){const[e,t]=Ve(()=>{if("undefined"==typeof window)return"lg";const e=window.innerWidth;return e>=1024?"lg":e>=768?"md":"sm"});return Ee(()=>{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}();Ee(()=>{!function(){if(Qr||"undefined"==typeof document)return;Qr=!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 i=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,r),a=Re.toArray(n),l=je(()=>{const e=Array.from({length:i},()=>[]);return a.forEach((t,n)=>{e[n%i].push(t)}),e},[a,i]);/* @__PURE__ */
328
328
  return Ke("div",{role:"list","aria-label":"Masonry grid",className:U("flex w-full"),style:{gap:t,alignItems:"flex-start"},children:l.map((e,n)=>/* @__PURE__ */Ke("div",{className:U("flex flex-col"),style:{flex:1,gap:t,minWidth:0},children:e.map((e,t)=>{/* @__PURE__ */
329
- return Ke("div",{role:"listitem",style:(r=t*i+n,o?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(40*r,400)}ms`}),children:e},t);var r})},n))})}var ti={info:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),success:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})})},ni={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}},oi={heading:function({block:e}){const t=N(),n=e.level??1,o=`h${n}`,r=F(e.content??"");/* @__PURE__ */
330
- return Ke(o,{className:U("m-0"),style:{...ni[n],color:t.text},children:r})},paragraph:function({block:e}){const t=N(),n=F(e.content??"");/* @__PURE__ */
331
- return Ke("p",{className:U("m-0"),style:{fontSize:"0.938rem",lineHeight:1.7,color:t.text,marginBottom:12},children:n})},blockquote:function({block:e}){const t=N(),n=F(e.content??"");/* @__PURE__ */
332
- return Ke("blockquote",{className:U("m-0"),style:{borderLeft:`3px solid ${t.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${t.surfaceAlt}`,borderRadius:"0 6px 6px 0",color:t.textMuted,fontStyle:"italic",fontSize:"0.938rem",lineHeight:1.6},children:n})},code:function({block:e}){const t=N(),n=F(e.content??""),o=e.language?F(e.language):null;/* @__PURE__ */
333
- return Ye("div",{className:U("rounded-lg overflow-hidden"),style:{marginTop:12,marginBottom:12,border:`1px solid ${t.border}`,backgroundColor:t.surfaceAlt},children:[o&&/* @__PURE__ */Ke("div",{className:U("px-3 py-1 text-[11px] font-semibold uppercase tracking-wider"),style:{color:t.textMuted,borderBottom:`1px solid ${t.border}`,backgroundColor:t.surface},children:o}),/* @__PURE__ */Ke("pre",{className:U("m-0 p-4 overflow-x-auto"),style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",fontSize:"0.85rem",lineHeight:1.6,color:t.text,tabSize:2},children:/* @__PURE__ */Ke("code",{"aria-label":o?`Code block in ${o}`:"Code block",children:n})})]})},list:function({block:e}){const t=N(),n=e.ordered?"ol":"ul",o=(e.items??[]).map(e=>F(e));/* @__PURE__ */
329
+ return Ke("div",{role:"listitem",style:(r=t*i+n,o?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(40*r,400)}ms`}),children:e},t);var r})},n))})}var ti={info:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),success:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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:/* @__PURE__ */Ke("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ke("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"})})},ni={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}},oi={heading:function({block:e}){const t=M(),n=e.level??1,o=`h${n}`,r=F(e.content??"");/* @__PURE__ */
330
+ return Ke(o,{className:U("m-0"),style:{...ni[n],color:t.text},children:r})},paragraph:function({block:e}){const t=M(),n=F(e.content??"");/* @__PURE__ */
331
+ return Ke("p",{className:U("m-0"),style:{fontSize:"0.938rem",lineHeight:1.7,color:t.text,marginBottom:12},children:n})},blockquote:function({block:e}){const t=M(),n=F(e.content??"");/* @__PURE__ */
332
+ return Ke("blockquote",{className:U("m-0"),style:{borderLeft:`3px solid ${t.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${t.surfaceAlt}`,borderRadius:"0 6px 6px 0",color:t.textMuted,fontStyle:"italic",fontSize:"0.938rem",lineHeight:1.6},children:n})},code:function({block:e}){const t=M(),n=F(e.content??""),o=e.language?F(e.language):null;/* @__PURE__ */
333
+ return Ye("div",{className:U("rounded-lg overflow-hidden"),style:{marginTop:12,marginBottom:12,border:`1px solid ${t.border}`,backgroundColor:t.surfaceAlt},children:[o&&/* @__PURE__ */Ke("div",{className:U("px-3 py-1 text-[11px] font-semibold uppercase tracking-wider"),style:{color:t.textMuted,borderBottom:`1px solid ${t.border}`,backgroundColor:t.surface},children:o}),/* @__PURE__ */Ke("pre",{className:U("m-0 p-4 overflow-x-auto"),style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",fontSize:"0.85rem",lineHeight:1.6,color:t.text,tabSize:2},children:/* @__PURE__ */Ke("code",{"aria-label":o?`Code block in ${o}`:"Code block",children:n})})]})},list:function({block:e}){const t=M(),n=e.ordered?"ol":"ul",o=(e.items??[]).map(e=>F(e));/* @__PURE__ */
334
334
  return Ke(n,{className:U("m-0"),style:{paddingLeft:24,marginTop:8,marginBottom:12,color:t.text,fontSize:"0.938rem",lineHeight:1.7,listStyleType:e.ordered?"decimal":"disc"},role:"list",children:o.map((e,t)=>/* @__PURE__ */Ke("li",{role:"listitem",style:{marginBottom:4},children:e},t))})},divider:function(){/* @__PURE__ */
335
- return Ke("hr",{"aria-hidden":"true",style:{border:"none",borderTop:`1px solid ${N().border}`,marginTop:20,marginBottom:20}})},image:function({block:e}){const t=N(),n=F(e.src??""),o=F(e.alt??"Image");/* @__PURE__ */
336
- return Ye("figure",{className:U("m-0"),style:{marginTop:12,marginBottom:12},children:[/* @__PURE__ */Ke("img",{src:n,alt:o,loading:"lazy",className:U("rounded-lg"),style:{maxWidth:"100%",height:"auto",display:"block",border:`1px solid ${t.border}`}}),e.alt&&/* @__PURE__ */Ke("figcaption",{className:U("text-xs mt-2 text-center"),style:{color:t.textMuted},children:o})]})},callout:function({block:e}){const t=N(),n=e.variant??"info",o=F(e.content??""),r={info:t.info,warning:t.warning,success:t.success,danger:t.danger}[n],i=ti[n];/* @__PURE__ */
337
- return Ye("div",{role:{info:"note",warning:"alert",success:"status",danger:"alert"}[n],className:U("flex gap-3 px-4 py-3 rounded-lg"),style:{backgroundColor:`${r}12`,border:`1px solid ${r}33`,marginTop:12,marginBottom:12},children:[/* @__PURE__ */Ke("span",{className:U("shrink-0 mt-[2px]"),style:{color:r},children:i}),/* @__PURE__ */Ke("div",{className:U("flex-1"),style:{fontSize:"0.9rem",lineHeight:1.6,color:t.text},children:o})]})}};function ri({blocks:e,className:t,style:n}){const o=N(),r=$e(),i=ge(),a=je(()=>e.map((e,t)=>{const n=oi[e.type];return n?/* @__PURE__ */Ke("div",{style:i?void 0:{animation:"tkx-rich-text-fade-in 300ms ease both",animationDelay:`${Math.min(30*t,300)}ms`},children:/* @__PURE__ */Ke(n,{block:e,index:t})},t):null}),[e,i]);return je(()=>{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)},[]),/* @__PURE__ */Ke("article",{"aria-label":r.richTextContent??"Rich text content",className:U("font-sans",t??""),style:{color:o.text,maxWidth:720,...n},children:a})}function ii(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=ai(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:ii(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:ii(e.slice(n+2,o))}),n=o+2;continue}}if("*"===i&&"*"===e[n+1]||"_"===i&&"_"===e[n+1]){const o=i+i,a=e.indexOf(o,n+2);if(-1!==a){r(),t.push({kind:"bold",children:ii(e.slice(n+2,a))}),n=a+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:ii(e.slice(n+1,o))}),n=o+1;continue}}o+=i,n++}}return r(),t}function ai(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 li(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:ii(i[2])}),o++;continue}if(/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(e)){n.push({kind:"hr"}),o++;continue}if(ci(e)&&o+1<t.length&&ui(t[o+1])){const r=hi(e).map(ii),i=pi(t[o+1]);o+=2;const a=[];for(;o<t.length&&ci(t[o]);)a.push(hi(t[o]).map(ii)),o++;n.push({kind:"table",headers:r,rows:a,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:li(e.join("\n"))});continue}if(si(e)){const[e,r]=di(t,o);n.push(e),o=r;continue}const a=[e];for(o++;o<t.length&&!/^\s*$/.test(t[o])&&!/^#{1,6}\s/.test(t[o])&&!/^\s*```/.test(t[o])&&!/^\s*>/.test(t[o])&&!si(t[o])&&!/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(t[o]);)a.push(t[o]),o++;n.push({kind:"paragraph",inline:ii(a.join(" "))})}return n}function si(e){return/^(\s*)([-*+]|\d+[.)])\s+/.test(e)}function di(e,t){const n=e[t].match(/^(\s*)([-*+]|\d+[.)])\s+/),o=n[1].length,r=/\d/.test(n[2]),i=[];let a=t;for(;a<e.length;){const t=e[a].match(/^(\s*)([-*+]|\d+[.)])\s+(.*)$/);if(!t||t[1].length!==o)break;const n=t[3];let r=null,l=n;const s=n.match(/^\[([ xX])\]\s+(.*)$/);s&&(r="x"===s[1].toLowerCase()?"checked":"unchecked",l=s[2]);const d=[l];for(a++;a<e.length;){if(/^\s*$/.test(e[a])){if(a+1<e.length&&/^\s+\S/.test(e[a+1])){d.push(""),a++;continue}break}const t=e[a].match(/^(\s*)(\S)/);if(!(t&&t[1].length>o))break;d.push(e[a].slice(o+2)),a++}i.push({blocks:li(d.join("\n")),task:r})}return[{kind:"list",ordered:r,items:i},a]}function ci(e){return/^\s*\|.+\|\s*$/.test(e.trim())||e.includes("|")&&e.trim().startsWith("|")}function ui(e){return/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e)}function hi(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim())}function pi(e){return hi(e).map(e=>{const t=e.startsWith(":"),n=e.endsWith(":");return t&&n?"center":n?"right":t?"left":null})}function fi(e,t,n="i"){return e.map((e,o)=>{const r=`${n}-${o}`;switch(e.kind){case"text":/* @__PURE__ */return Ke("span",{children:F(e.value)},r);case"bold":/* @__PURE__ */return Ke("strong",{children:fi(e.children,t,r)},r);case"italic":/* @__PURE__ */return Ke("em",{children:fi(e.children,t,r)},r);case"strike":/* @__PURE__ */return Ke("s",{children:fi(e.children,t,r)},r);case"code":/* @__PURE__ */return Ke("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:F(e.value)},r);case"link":{const n=mi(e.href);if(!n)/* @__PURE__ */return Ke("span",{children:fi(e.children,t,r)},r);const o=/^(https?:)?\/\//i.test(n)||n.startsWith("mailto:");/* @__PURE__ */
335
+ return Ke("hr",{"aria-hidden":"true",style:{border:"none",borderTop:`1px solid ${M().border}`,marginTop:20,marginBottom:20}})},image:function({block:e}){const t=M(),n=F(e.src??""),o=F(e.alt??"Image");/* @__PURE__ */
336
+ return Ye("figure",{className:U("m-0"),style:{marginTop:12,marginBottom:12},children:[/* @__PURE__ */Ke("img",{src:n,alt:o,loading:"lazy",className:U("rounded-lg"),style:{maxWidth:"100%",height:"auto",display:"block",border:`1px solid ${t.border}`}}),e.alt&&/* @__PURE__ */Ke("figcaption",{className:U("text-xs mt-2 text-center"),style:{color:t.textMuted},children:o})]})},callout:function({block:e}){const t=M(),n=e.variant??"info",o=F(e.content??""),r={info:t.info,warning:t.warning,success:t.success,danger:t.danger}[n],i=ti[n];/* @__PURE__ */
337
+ return Ye("div",{role:{info:"note",warning:"alert",success:"status",danger:"alert"}[n],className:U("flex gap-3 px-4 py-3 rounded-lg"),style:{backgroundColor:`${r}12`,border:`1px solid ${r}33`,marginTop:12,marginBottom:12},children:[/* @__PURE__ */Ke("span",{className:U("shrink-0 mt-[2px]"),style:{color:r},children:i}),/* @__PURE__ */Ke("div",{className:U("flex-1"),style:{fontSize:"0.9rem",lineHeight:1.6,color:t.text},children:o})]})}};function ri({blocks:e,className:t,style:n}){const o=M(),r=$e(),i=ge(),a=je(()=>e.map((e,t)=>{const n=oi[e.type];return n?/* @__PURE__ */Ke("div",{style:i?void 0:{animation:"tkx-rich-text-fade-in 300ms ease both",animationDelay:`${Math.min(30*t,300)}ms`},children:/* @__PURE__ */Ke(n,{block:e,index:t})},t):null}),[e,i]);return je(()=>{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)},[]),/* @__PURE__ */Ke("article",{"aria-label":r.richTextContent??"Rich text content",className:U("font-sans",t??""),style:{color:o.text,maxWidth:720,...n},children:a})}function ii(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=ai(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:ii(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:ii(e.slice(n+2,o))}),n=o+2;continue}}if("*"===i&&"*"===e[n+1]||"_"===i&&"_"===e[n+1]){const o=i+i,a=e.indexOf(o,n+2);if(-1!==a){r(),t.push({kind:"bold",children:ii(e.slice(n+2,a))}),n=a+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:ii(e.slice(n+1,o))}),n=o+1;continue}}o+=i,n++}}return r(),t}function ai(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 li(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:ii(i[2])}),o++;continue}if(/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(e)){n.push({kind:"hr"}),o++;continue}if(ci(e)&&o+1<t.length&&ui(t[o+1])){const r=hi(e).map(ii),i=pi(t[o+1]);o+=2;const a=[];for(;o<t.length&&ci(t[o]);)a.push(hi(t[o]).map(ii)),o++;n.push({kind:"table",headers:r,rows:a,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:li(e.join("\n"))});continue}if(si(e)){const[e,r]=di(t,o);n.push(e),o=r;continue}const a=[e];for(o++;o<t.length&&!/^\s*$/.test(t[o])&&!/^#{1,6}\s/.test(t[o])&&!/^\s*```/.test(t[o])&&!/^\s*>/.test(t[o])&&!si(t[o])&&!/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(t[o]);)a.push(t[o]),o++;n.push({kind:"paragraph",inline:ii(a.join(" "))})}return n}function si(e){return/^(\s*)([-*+]|\d+[.)])\s+/.test(e)}function di(e,t){const n=e[t].match(/^(\s*)([-*+]|\d+[.)])\s+/),o=n[1].length,r=/\d/.test(n[2]),i=[];let a=t;for(;a<e.length;){const t=e[a].match(/^(\s*)([-*+]|\d+[.)])\s+(.*)$/);if(!t||t[1].length!==o)break;const n=t[3];let r=null,l=n;const s=n.match(/^\[([ xX])\]\s+(.*)$/);s&&(r="x"===s[1].toLowerCase()?"checked":"unchecked",l=s[2]);const d=[l];for(a++;a<e.length;){if(/^\s*$/.test(e[a])){if(a+1<e.length&&/^\s+\S/.test(e[a+1])){d.push(""),a++;continue}break}const t=e[a].match(/^(\s*)(\S)/);if(!(t&&t[1].length>o))break;d.push(e[a].slice(o+2)),a++}i.push({blocks:li(d.join("\n")),task:r})}return[{kind:"list",ordered:r,items:i},a]}function ci(e){return/^\s*\|.+\|\s*$/.test(e.trim())||e.includes("|")&&e.trim().startsWith("|")}function ui(e){return/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e)}function hi(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim())}function pi(e){return hi(e).map(e=>{const t=e.startsWith(":"),n=e.endsWith(":");return t&&n?"center":n?"right":t?"left":null})}function fi(e,t,n="i"){return e.map((e,o)=>{const r=`${n}-${o}`;switch(e.kind){case"text":/* @__PURE__ */return Ke("span",{children:F(e.value)},r);case"bold":/* @__PURE__ */return Ke("strong",{children:fi(e.children,t,r)},r);case"italic":/* @__PURE__ */return Ke("em",{children:fi(e.children,t,r)},r);case"strike":/* @__PURE__ */return Ke("s",{children:fi(e.children,t,r)},r);case"code":/* @__PURE__ */return Ke("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:F(e.value)},r);case"link":{const n=mi(e.href);if(!n)/* @__PURE__ */return Ke("span",{children:fi(e.children,t,r)},r);const o=/^(https?:)?\/\//i.test(n)||n.startsWith("mailto:");/* @__PURE__ */
338
338
  return Ke("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:fi(e.children,t,r)},r)}case"image":/* @__PURE__ */return Ke("img",{src:mi(e.src)||"",alt:F(e.alt),loading:"lazy",decoding:"async",style:{maxWidth:"100%",height:"auto",borderRadius:6,display:"inline-block"}},r)}})}function mi(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 gi({text:e,theme:t}){const[n,o]=Ve(!1);/* @__PURE__ */
339
339
  return Ke("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 xi(e,t,n="b"){return e.map((e,o)=>{const r=`${n}-${o}`;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];/* @__PURE__ */
340
340
  return Ke(n,{style:{fontSize:o.fs,lineHeight:o.lh,marginTop:o.mt,marginBottom:o.mb,fontWeight:o.fw,color:t.theme.text,scrollMarginTop:"1em"},children:fi(e.inline,t,r)},r)}case"paragraph":/* @__PURE__ */return Ke("p",{style:{margin:"0 0 "+(t.compact?"0.7em":"1em"),lineHeight:1.65,color:t.theme.text,wordBreak:"break-word"},children:fi(e.inline,t,r)},r);case"blockquote":/* @__PURE__ */return Ke("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:xi(e.children,t,r)},r);case"code":{const n=e.value;/* @__PURE__ */
341
341
  return Ye("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&&/* @__PURE__ */Ke("div",{style:{padding:"4px 10px",fontSize:11,color:t.theme.textMuted,borderBottom:`1px solid ${t.theme.border}`,textTransform:"uppercase",letterSpacing:"0.05em"},children:F(e.language)}),t.copyableCode&&/* @__PURE__ */Ke(gi,{text:n,theme:t.theme}),
342
- /* @__PURE__ */Ke("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:/* @__PURE__ */Ke("code",{children:F(n)})})]},r)}case"list":/* @__PURE__ */return Ke(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)=>/* @__PURE__ */Ye("li",{style:{listStyle:null!==e.task?"none":void 0,marginLeft:null!==e.task?"-1.25em":void 0},children:[null!==e.task&&/* @__PURE__ */Ke("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"}),xi(e.blocks,t,`${r}-${n}`)]},`${r}-${n}`))},r);case"hr":/* @__PURE__ */return Ke("hr",{style:{border:"none",borderTop:`1px solid ${t.theme.border}`,margin:"1.5em 0"}},r);case"table":/* @__PURE__ */return Ke("div",{style:{overflowX:"auto",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:6,WebkitOverflowScrolling:"touch"},children:/* @__PURE__ */Ye("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14,color:t.theme.text},children:[/* @__PURE__ */Ke("thead",{children:/* @__PURE__ */Ke("tr",{children:e.headers.map((n,o)=>/* @__PURE__ */Ke("th",{style:{padding:"8px 12px",textAlign:e.align[o]??"left",borderBottom:`2px solid ${t.theme.border}`,background:t.theme.surfaceAlt,fontWeight:600},children:fi(n,t,`${r}-h-${o}`)},o))})}),/* @__PURE__ */Ke("tbody",{children:e.rows.map((n,o)=>/* @__PURE__ */Ke("tr",{children:n.map((n,i)=>/* @__PURE__ */Ke("td",{style:{padding:"8px 12px",textAlign:e.align[i]??"left",borderBottom:`1px solid ${t.theme.border}`},children:fi(n,t,`${r}-r-${o}-${i}`)},i))},o))})]})},r)}})}function bi({source:e,src:t,maxWidth:n="100%",compact:o=!1,copyableCode:r=!0,onLinkClick:i,externalLinkRel:a="noopener noreferrer",externalLinkTarget:l="_blank",loadingFallback:s,errorFallback:d,className:c,style:u}){const h=N(),[p,f]=Ve({text:null,error:null,loading:!!t&&void 0===e}),m=Oe(null);Ee(()=>{if(void 0!==e||!t)return;m.current?.abort();const n=new AbortController;return m.current=n,f({text:null,error:null,loading:!0}),fetch(t,{signal:n.signal}).then(async e=>{if(!e.ok)throw new Error(`Failed to load markdown (HTTP ${e.status})`);f({text:await e.text(),error:null,loading:!1})}).catch(e=>{"AbortError"!==e.name&&f({text:null,error:e.message,loading:!1})}),()=>n.abort()},[t,e]);const g=e??p.text??"",x=je(()=>g?li(g):[],[g]),b={theme:h,compact:o,copyableCode:r,externalLinkRel:a,externalLinkTarget:l,onLinkClick:i},y={maxWidth:n,width:"100%",color:h.text,fontFamily:"inherit",fontSize:o?14:15,lineHeight:1.65,wordBreak:"break-word",overflowWrap:"anywhere",boxSizing:"border-box",...u};if(void 0===e&&t){if(p.loading)/* @__PURE__ */return Ke("div",{className:c,style:y,"aria-busy":"true","aria-live":"polite",children:s??/* @__PURE__ */Ke("span",{style:{color:h.textMuted},children:"Loading…"})});if(p.error)/* @__PURE__ */return Ke("div",{className:c,style:y,role:"alert",children:d?d(p.error):/* @__PURE__ */Ke("span",{style:{color:h.danger},children:F(p.error)})})}/* @__PURE__ */
343
- return Ke("div",{className:c,style:y,children:xi(x,b)})}bi.displayName="TkxMarkdown";var yi={sm:576,md:768,lg:992,xl:1200};function vi(e){return"number"==typeof e?`${e}px`:e}var wi=De({h:0,v:0}),ki=We(({children:e,hasSider:t=!1,className:n,style:o,...r},i)=>{const a=N(),l=U("flex min-h-0 w-full font-sans"),s=t?{flexDirection:"row"}:{flexDirection:"column"};/* @__PURE__ */
344
- return Ke("section",{ref:i,className:le("tkx-layout",l,n),style:{minHeight:"100%",color:a.text,backgroundColor:a.bg,...s,...o},...r,children:e})});ki.displayName="TkxLayout";var Si=We(({children:e,height:t=64,fixed:n=!1,className:o,style:r,...i},a)=>{const l=N(),s=vi(t),d=U("flex items-center px-6 shrink-0 w-full"),c=n?{position:"fixed",top:0,left:0,right:0,zIndex:1e3}:{};/* @__PURE__ */
342
+ /* @__PURE__ */Ke("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:/* @__PURE__ */Ke("code",{children:F(n)})})]},r)}case"list":/* @__PURE__ */return Ke(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)=>/* @__PURE__ */Ye("li",{style:{listStyle:null!==e.task?"none":void 0,marginLeft:null!==e.task?"-1.25em":void 0},children:[null!==e.task&&/* @__PURE__ */Ke("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"}),xi(e.blocks,t,`${r}-${n}`)]},`${r}-${n}`))},r);case"hr":/* @__PURE__ */return Ke("hr",{style:{border:"none",borderTop:`1px solid ${t.theme.border}`,margin:"1.5em 0"}},r);case"table":/* @__PURE__ */return Ke("div",{style:{overflowX:"auto",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:6,WebkitOverflowScrolling:"touch"},children:/* @__PURE__ */Ye("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14,color:t.theme.text},children:[/* @__PURE__ */Ke("thead",{children:/* @__PURE__ */Ke("tr",{children:e.headers.map((n,o)=>/* @__PURE__ */Ke("th",{style:{padding:"8px 12px",textAlign:e.align[o]??"left",borderBottom:`2px solid ${t.theme.border}`,background:t.theme.surfaceAlt,fontWeight:600},children:fi(n,t,`${r}-h-${o}`)},o))})}),/* @__PURE__ */Ke("tbody",{children:e.rows.map((n,o)=>/* @__PURE__ */Ke("tr",{children:n.map((n,i)=>/* @__PURE__ */Ke("td",{style:{padding:"8px 12px",textAlign:e.align[i]??"left",borderBottom:`1px solid ${t.theme.border}`},children:fi(n,t,`${r}-r-${o}-${i}`)},i))},o))})]})},r)}})}function bi({source:e,src:t,maxWidth:n="100%",compact:o=!1,copyableCode:r=!0,onLinkClick:i,externalLinkRel:a="noopener noreferrer",externalLinkTarget:l="_blank",loadingFallback:s,errorFallback:d,className:c,style:u}){const h=M(),[p,f]=Ve({text:null,error:null,loading:!!t&&void 0===e}),m=Oe(null);Ee(()=>{if(void 0!==e||!t)return;m.current?.abort();const n=new AbortController;return m.current=n,f({text:null,error:null,loading:!0}),fetch(t,{signal:n.signal}).then(async e=>{if(!e.ok)throw new Error(`Failed to load markdown (HTTP ${e.status})`);f({text:await e.text(),error:null,loading:!1})}).catch(e=>{"AbortError"!==e.name&&f({text:null,error:e.message,loading:!1})}),()=>n.abort()},[t,e]);const g=e??p.text??"",x=je(()=>g?li(g):[],[g]),b={theme:h,compact:o,copyableCode:r,externalLinkRel:a,externalLinkTarget:l,onLinkClick:i},y={maxWidth:n,width:"100%",color:h.text,fontFamily:"inherit",fontSize:o?14:15,lineHeight:1.65,wordBreak:"break-word",overflowWrap:"anywhere",boxSizing:"border-box",...u};if(void 0===e&&t){if(p.loading)/* @__PURE__ */return Ke("div",{className:c,style:y,"aria-busy":"true","aria-live":"polite",children:s??/* @__PURE__ */Ke("span",{style:{color:h.textMuted},children:"Loading…"})});if(p.error)/* @__PURE__ */return Ke("div",{className:c,style:y,role:"alert",children:d?d(p.error):/* @__PURE__ */Ke("span",{style:{color:h.danger},children:F(p.error)})})}/* @__PURE__ */
343
+ return Ke("div",{className:c,style:y,children:xi(x,b)})}bi.displayName="TkxMarkdown";var yi={sm:576,md:768,lg:992,xl:1200};function vi(e){return"number"==typeof e?`${e}px`:e}var wi=De({h:0,v:0}),ki=We(({children:e,hasSider:t=!1,className:n,style:o,...r},i)=>{const a=M(),l=U("flex min-h-0 w-full font-sans"),s=t?{flexDirection:"row"}:{flexDirection:"column"};/* @__PURE__ */
344
+ return Ke("section",{ref:i,className:le("tkx-layout",l,n),style:{minHeight:"100%",color:a.text,backgroundColor:a.bg,...s,...o},...r,children:e})});ki.displayName="TkxLayout";var Si=We(({children:e,height:t=64,fixed:n=!1,className:o,style:r,...i},a)=>{const l=M(),s=vi(t),d=U("flex items-center px-6 shrink-0 w-full"),c=n?{position:"fixed",top:0,left:0,right:0,zIndex:1e3}:{};/* @__PURE__ */
345
345
  return Ke("header",{ref:a,className:le("tkx-layout-header",d,o),style:{height:s,minHeight:s,backgroundColor:l.surface,borderBottom:`1px solid ${l.border}`,...c,...r},...i,children:e})});function Ci({collapsed:e,onClick:t,color:n}){const o=ge();/* @__PURE__ */
346
- return Ke("button",{type:"button","aria-label":e?"Expand sidebar":"Collapse sidebar",onClick:t,className:U("flex items-center justify-center w-full py-3 cursor-pointer","border-0 bg-transparent"),style:{color:n},children:/* @__PURE__ */Ke("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{transform:e?"rotate(0deg)":"rotate(180deg)",transition:o?"none":"transform 200ms ease"},"aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}Si.displayName="TkxHeader";var $i=We(({children:e,width:t=240,collapsedWidth:n=64,collapsed:o,onCollapse:r,collapsible:i=!1,breakpoint:a,trigger:l,className:s,style:d,...c},u)=>{const h=N(),p=ge(),[f,m]=Ve(!1),g=o??f,x=Ae(e=>{void 0===o&&m(e),r?.(e)},[o,r]);Ee(()=>{if(!a)return;const e=yi[a];if(!e)return;const t=window.matchMedia(`(max-width: ${e-1}px)`),n=e=>{x(e.matches)};return x(t.matches),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[a,x]);const b=vi(t),y=g?`${n}px`:b,v=i&&null!==l,w=p?"none":"width 200ms ease, min-width 200ms ease, max-width 200ms ease";/* @__PURE__ */
347
- return Ye("aside",{ref:u,className:le("tkx-layout-sider",U("shrink-0 overflow-hidden flex flex-col"),s),style:{width:y,minWidth:y,maxWidth:y,backgroundColor:h.surface,borderRight:`1px solid ${h.border}`,transition:w,...d},...c,children:[/* @__PURE__ */Ke("div",{className:U("flex-1 overflow-y-auto overflow-x-hidden"),style:{width:y,transition:w},children:e}),v&&/* @__PURE__ */Ke("div",{className:U("shrink-0"),style:{borderTop:`1px solid ${h.border}`},children:void 0!==l?l:/* @__PURE__ */Ke(Ci,{collapsed:g,onClick:()=>x(!g),color:h.textMuted})})]})});$i.displayName="TkxSider";var zi=We(({children:e,className:t,style:n,...o},r)=>{const i=N();/* @__PURE__ */
348
- return Ke("main",{ref:r,className:le("tkx-layout-content",U("flex-1 min-w-0 min-h-0"),t),style:{backgroundColor:i.bg,padding:"24px",...n},...o,children:e})});zi.displayName="TkxContent";var Ni=We(({children:e,className:t,style:n,...o},r)=>{const i=N();/* @__PURE__ */
349
- return Ke("footer",{ref:r,className:le("tkx-layout-footer",U("flex items-center px-6 py-4 shrink-0"),t),style:{backgroundColor:i.surface,borderTop:`1px solid ${i.border}`,color:i.textMuted,...n},...o,children:e})});Ni.displayName="TkxFooter";var Mi={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},Ii={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},Li=We(({children:e,gutter:t,justify:n="start",align:o="top",wrap:r=!0,className:i,style:a,...l},s)=>{const[d,c]=Array.isArray(t)?t:[t??0,0],u=d/2,h=c/2,p=d||c?{marginLeft:-u,marginRight:-u,marginTop:-h,marginBottom:-h}:{},f={h:u,v:h};/* @__PURE__ */
350
- return Ke(wi.Provider,{value:f,children:/* @__PURE__ */Ke("div",{ref:s,className:le("tkx-row",U("flex w-full"),i),style:{flexWrap:r?"wrap":"nowrap",justifyContent:Mi[n]??"flex-start",alignItems:Ii[o]??"flex-start",...p,...a},...l,children:e})})});Li.displayName="TkxRow";var Ri=!1;function Di(e){if(void 0!==e)return"number"==typeof e?{span:e}:e}var Ti=We(({children:e,span:t,offset:n=0,push:o,pull:r,order:i,sm:a,md:l,lg:s,xl:d,className:c,style:u,...h},p)=>{Ee(()=>{!function(){if(Ri||"undefined"==typeof document)return;Ri=!0;const e=[];for(const[n,o]of Object.entries(yi)){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 f=Be(wi),m=void 0!==t?t/24*100+"%":void 0,g=n?n/24*100+"%":void 0,x=[],b=[["sm",a],["md",l],["lg",s],["xl",d]];for(const[v,w]of b){const e=Di(w);e&&(x.push(`tkx-col-${v}-${e.span}`),void 0!==e.offset&&e.offset>0&&x.push(`tkx-col-${v}-offset-${e.offset}`))}const y={};return void 0!==o&&(y.left=o/24*100+"%",y.position="relative"),void 0!==r&&(y.right=r/24*100+"%",y.position="relative"),void 0!==i&&(y.order=i),/* @__PURE__ */Ke("div",{ref:p,className:le("tkx-col",U("box-border min-h-[1px]"),...x,c),style:{flex:m?`0 0 ${m}`:"1",maxWidth:m??"100%",marginLeft:g,paddingLeft:f.h||void 0,paddingRight:f.h||void 0,paddingTop:f.v||void 0,paddingBottom:f.v||void 0,...y,...u},...h,children:e})});Ti.displayName="TkxCol";var Wi=De({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 Ai({children:e,locale:t,direction:n,componentDefaults:o,componentOverrides:r,prefixCls:i}){const a=Be(Wi),l=je(()=>({size:o?.size??a.componentDefaults.size,variant:o?.variant??a.componentDefaults.variant,animation:o?.animation??a.componentDefaults.animation,bordered:o?.bordered??a.componentDefaults.bordered}),[o,a.componentDefaults]),s=je(()=>{const e=a.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,a.componentOverrides]),d=t??a.locale,c=n??a.direction,u=i??a.prefixCls,h=Ae(e=>`${u}-${e}`,[u]),p=Ae((e,t)=>{if(void 0!==t)return t;if(e){const t=s[e];if(t?.size)return t.size}return l.size},[l.size,s]),f=Ae(e=>void 0!==e?e:l.animation,[l.animation]),m=Ae((e,t)=>{if(void 0!==t)return t;if(e){const t=s[e];if(void 0!==t?.bordered)return t.bordered}return l.bordered},[l.bordered,s]),g=je(()=>({locale:d,direction:c,componentDefaults:l,componentOverrides:s,prefixCls:u,configured:!0,cls:h,getSize:p,getAnimation:f,getBordered:m}),[d,c,l,s,u,h,p,f,m]);/* @__PURE__ */
351
- return Ke(Wi.Provider,{value:g,children:/* @__PURE__ */Ke("div",{dir:c,lang:d,className:`${u}-config-root`,style:{direction:c},children:e})})}function Bi(){return Be(Wi)}function Ei(e,t){const{prefixCls:n}=Bi();return`${t??n}-${e}`}function Hi(e,t){const{getSize:n}=Bi();return n(e,t)}Ai.displayName="TkxConfigProvider";var Fi={sm:32,md:40,lg:48},ji={sm:"0.75rem",md:"0.875rem",lg:"1rem"},Pi={sm:8,md:12,lg:16},Oi={sm:4,md:8,lg:12},Vi={sm:4,md:6,lg:8},Ui={sm:14,md:16,lg:20};function Ki(){const{direction:e}=Bi();if("rtl"===e)return{transform:"scaleX(-1)"}}function Yi(e,t=0){const{direction:n}=Bi(),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}}var Xi={"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"},qi=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function Gi(e){return qi.has(e)||qi.has(e.split("-")[0])}function _i(e){if(Xi[e])return Xi[e];if("undefined"!=typeof Intl&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e}function Zi(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Zi).join(""):e&&"object"==typeof e&&"props"in e?Zi(e.props.children):""}function Ji({text:e}){const t=N(),[n,o]=Ve(!1);return Te("button",{type:"button",onClick:Ae(()=>{navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},[e]),"aria-label":n?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:n?t.success:t.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},n?"Copied!":"⎘")}function Qi(e="default"){const t=N();return{default:t.text,secondary:t.textMuted,success:t.success,warning:t.warning,danger:t.danger}[e]}var ea={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}};function ta({level:e=1,children:t,copyable:n=!1,type:o="default",style:r}){const i=Qi(o);N();const a=ea[e],l=`h${e}`,s="string"==typeof t?F(t):t,d=Zi(t);return Te(l,{style:{color:i,fontSize:a.fontSize,lineHeight:a.lineHeight,fontWeight:a.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...r}},s,n&&Te(Ji,{text:d}))}function na({children:e,type:t="default",strong:n=!1,italic:o=!1,underline:r=!1,delete:i=!1,code:a=!1,mark:l=!1,copyable:s=!1,style:d}){const c=Qi(t),u=N(),h=Zi(e),p="string"==typeof e?F(e):e,f=[];r&&f.push("underline"),i&&f.push("line-through");let m=p;return a&&(m=Te("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:u.surfaceAlt,border:`1px solid ${u.border}`,borderRadius:"4px",fontFamily:"monospace"}},m)),l&&(m=Te("mark",{style:{backgroundColor:`${u.warning}33`,color:c,padding:"0 2px",borderRadius:"2px"}},m)),Te(n?"strong":o?"em":"span",{style:{color:c,fontStyle:o?"italic":"normal",textDecoration:f.length>0?f.join(" "):"none",...d}},m,s&&Te(Ji,{text:h}))}function oa({children:e,type:t="default",copyable:n=!1,ellipsis:o=!1,style:r}){const i=N(),a="secondary"===t?i.textMuted:i.text,l=Zi(e),s="string"==typeof e?F(e):e,d={};if(o){const e="object"==typeof o?o.rows??3:3;d.display="-webkit-box",d.WebkitLineClamp=e,d.WebkitBoxOrient="vertical",d.overflow="hidden"}return Te("div",{style:{color:a,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...d,...r}},s,n&&Te(Ji,{text:l}))}var ra={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}},ia=!1;function aa({size:e,color:t}){return Te("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},Te("circle",{cx:12,cy:12,r:10,stroke:`${t}33`,strokeWidth:2.5,fill:"none"}),Te("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:t,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function la({size:e,borderWidth:t,color:n,reducedMotion:o}){return o?Te(aa,{size:e,color:n}):(function(){if(ia||"undefined"==typeof document)return;ia=!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)}(),Te("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 sa({spinning:e=!0,size:t="md",tip:n,indicator:o,children:r,fullscreen:i=!1,delay:a=0,style:l}){const s=N(),d=ge(),[c,u]=Ve(0===a&&e),h=Oe(null);if(Ee(()=>(e&&a>0?h.current=setTimeout(()=>u(!0),a):u(e),()=>{null!==h.current&&clearTimeout(h.current)}),[e,a]),!c)return r?Te("div",{style:l},r):null;const p=ra[t],f=n?F(n):void 0,m=Te("div",{role:"status","aria-live":"polite","aria-label":f??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},o??Te(la,{size:p.dimension,borderWidth:p.borderWidth,color:s.primary,reducedMotion:d}),f&&Te("span",{style:{color:s.primary,fontSize:p.fontSize,marginTop:"4px"}},f));return i?Te("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}cc`,zIndex:9999,...l}},m):r?Te("div",{style:{position:"relative",...l}},Te("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:d?"none":"opacity 0.2s, filter 0.2s"}},r),Te("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}66`,borderRadius:"4px"}},m)):Te("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...l}},m)}function da({color:e,mutedColor:t}){return Te("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},Te("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${t}18`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Te("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${t}10`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Te("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${t}0d`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Te("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),Te("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function ca({mutedColor:e}){return Te("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},Te("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),Te("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Te("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Te("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Te("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),Te("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function ua({image:e="default",description:t="No data",children:n,style:o}){const r=N(),i="string"==typeof t?F(t):t;let a;return a="default"===e?Te(da,{color:r.primary,mutedColor:r.textMuted}):"simple"===e?Te(ca,{mutedColor:r.textMuted}):e,Te("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...o}},Te("div",{style:{marginBottom:"12px",opacity:.85}},a),i&&Te("div",{style:{color:r.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},i),n&&Te("div",{style:{marginTop:"16px"}},n))}function ha({direction:e,color:t}){return Te("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},Te("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 pa=!1;function fa({w:e,h:t,alt:n,bdr:o,rm:r}){return r||function(){if(pa||"undefined"==typeof document)return;pa=!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)}(),Te("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"}})}function ma({title:e,value:t,prefix:n,suffix:o,precision:r,groupSeparator:i=",",valueStyle:a,loading:l=!1,trend:s,trendValue:d,style:c}){const u=N(),h=ge(),p=F(e),f=d?F(d):void 0,m="up"===s?u.success:"down"===s?u.danger:void 0;return Te("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...c}},Te("div",{style:{color:u.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},p),l?Te(fa,{w:"120px",h:"32px",alt:u.surfaceAlt,bdr:u.border,rm:h}):Te("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u.text,fontVariantNumeric:"tabular-nums",...a}},n&&Te("span",{style:{fontSize:"0.75em",fontWeight:400}},n),Te("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}(t,r,i)),o&&Te("span",{style:{fontSize:"0.6em",fontWeight:400,color:u.textMuted}},o)),s&&Te("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:m,marginTop:"2px"}},Te(ha,{direction:s,color:m}),f&&Te("span",null,f)))}function ga({title:e,value:t,format:n="HH:mm:ss",onFinish:o,prefix:r,suffix:i,style:a}){const l=N(),s=F(e),d=Oe(o);d.current=o;const c=Oe(!1),[u,h]=Ve(()=>Math.max(0,t-Date.now()));Ee(()=>{c.current=!1;const e=()=>{const e=Math.max(0,t-Date.now());h(e),e<=0&&!c.current&&(c.current=!0,d.current?.())};e();const n=setInterval(e,1e3);return()=>clearInterval(n)},[t]);const p=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),a=n%60,l=e=>String(e).padStart(2,"0");return t.replace(/DD/g,l(o)).replace(/D/g,String(o)).replace(/HH/g,l(r)).replace(/H/g,String(r)).replace(/mm/g,l(i)).replace(/m/g,String(i)).replace(/ss/g,l(a)).replace(/s/g,String(a))}(u,n);return Te("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...a}},Te("div",{style:{color:l.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},s),Te("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u<=0?l.danger:l.text,fontVariantNumeric:"tabular-nums"}},r&&Te("span",{style:{fontSize:"0.75em",fontWeight:400}},r),Te("span",null,p),i&&Te("span",{style:{fontSize:"0.6em",fontWeight:400,color:l.textMuted}},i)))}var xa={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}};function ba({options:e,value:t,onChange:n,size:o="md",block:r=!1}){const i=N(),a=ge(),l=Oe(null),[s,d]=Ve(()=>Math.max(0,e.findIndex(e=>e.value===t))),[c,u]=Ve({}),h=xa[o];Ee(()=>{const n=e.findIndex(e=>e.value===t);n>=0&&d(n)},[t,e]),Ee(()=>{const e=l.current;if(!e)return;const t=e.querySelectorAll("[data-seg-btn]")[s];t&&u({left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight,transition:a?"none":"left 0.2s ease, width 0.2s ease"})},[s,e,a]);const p=Ae(t=>{const o=e[t];o&&!o.disabled&&(d(t),n?.(o.value))},[e,n]),f=Ae(t=>{let n=s;if("ArrowRight"===t.key||"ArrowDown"===t.key)for(t.preventDefault(),n=(s+1)%e.length;e[n]?.disabled&&n!==s;)n=(n+1)%e.length;else if("ArrowLeft"===t.key||"ArrowUp"===t.key)for(t.preventDefault(),n=(s-1+e.length)%e.length;e[n]?.disabled&&n!==s;)n=(n-1+e.length)%e.length;n!==s&&(p(n),(l.current?.querySelectorAll("[data-seg-btn]"))?.[n]?.focus())},[s,e,p]);/* @__PURE__ */
346
+ return Ke("button",{type:"button","aria-label":e?"Expand sidebar":"Collapse sidebar",onClick:t,className:U("flex items-center justify-center w-full py-3 cursor-pointer","border-0 bg-transparent"),style:{color:n},children:/* @__PURE__ */Ke("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{transform:e?"rotate(0deg)":"rotate(180deg)",transition:o?"none":"transform 200ms ease"},"aria-hidden":"true",children:/* @__PURE__ */Ke("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}Si.displayName="TkxHeader";var $i=We(({children:e,width:t=240,collapsedWidth:n=64,collapsed:o,onCollapse:r,collapsible:i=!1,breakpoint:a,trigger:l,className:s,style:d,...c},u)=>{const h=M(),p=ge(),[f,m]=Ve(!1),g=o??f,x=Ae(e=>{void 0===o&&m(e),r?.(e)},[o,r]);Ee(()=>{if(!a)return;const e=yi[a];if(!e)return;const t=window.matchMedia(`(max-width: ${e-1}px)`),n=e=>{x(e.matches)};return x(t.matches),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[a,x]);const b=vi(t),y=g?`${n}px`:b,v=i&&null!==l,w=p?"none":"width 200ms ease, min-width 200ms ease, max-width 200ms ease";/* @__PURE__ */
347
+ return Ye("aside",{ref:u,className:le("tkx-layout-sider",U("shrink-0 overflow-hidden flex flex-col"),s),style:{width:y,minWidth:y,maxWidth:y,backgroundColor:h.surface,borderRight:`1px solid ${h.border}`,transition:w,...d},...c,children:[/* @__PURE__ */Ke("div",{className:U("flex-1 overflow-y-auto overflow-x-hidden"),style:{width:y,transition:w},children:e}),v&&/* @__PURE__ */Ke("div",{className:U("shrink-0"),style:{borderTop:`1px solid ${h.border}`},children:void 0!==l?l:/* @__PURE__ */Ke(Ci,{collapsed:g,onClick:()=>x(!g),color:h.textMuted})})]})});$i.displayName="TkxSider";var zi=We(({children:e,className:t,style:n,...o},r)=>{const i=M();/* @__PURE__ */
348
+ return Ke("main",{ref:r,className:le("tkx-layout-content",U("flex-1 min-w-0 min-h-0"),t),style:{backgroundColor:i.bg,padding:"24px",...n},...o,children:e})});zi.displayName="TkxContent";var Mi=We(({children:e,className:t,style:n,...o},r)=>{const i=M();/* @__PURE__ */
349
+ return Ke("footer",{ref:r,className:le("tkx-layout-footer",U("flex items-center px-6 py-4 shrink-0"),t),style:{backgroundColor:i.surface,borderTop:`1px solid ${i.border}`,color:i.textMuted,...n},...o,children:e})});Mi.displayName="TkxFooter";var Ni={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},Ii={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},Ri=We(({children:e,gutter:t,justify:n="start",align:o="top",wrap:r=!0,className:i,style:a,...l},s)=>{const[d,c]=Array.isArray(t)?t:[t??0,0],u=d/2,h=c/2,p=d||c?{marginLeft:-u,marginRight:-u,marginTop:-h,marginBottom:-h}:{},f={h:u,v:h};/* @__PURE__ */
350
+ return Ke(wi.Provider,{value:f,children:/* @__PURE__ */Ke("div",{ref:s,className:le("tkx-row",U("flex w-full"),i),style:{flexWrap:r?"wrap":"nowrap",justifyContent:Ni[n]??"flex-start",alignItems:Ii[o]??"flex-start",...p,...a},...l,children:e})})});Ri.displayName="TkxRow";var Ti=!1;function Di(e){if(void 0!==e)return"number"==typeof e?{span:e}:e}var Li=We(({children:e,span:t,offset:n=0,push:o,pull:r,order:i,sm:a,md:l,lg:s,xl:d,className:c,style:u,...h},p)=>{Ee(()=>{!function(){if(Ti||"undefined"==typeof document)return;Ti=!0;const e=[];for(const[n,o]of Object.entries(yi)){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 f=Be(wi),m=void 0!==t?t/24*100+"%":void 0,g=n?n/24*100+"%":void 0,x=[],b=[["sm",a],["md",l],["lg",s],["xl",d]];for(const[v,w]of b){const e=Di(w);e&&(x.push(`tkx-col-${v}-${e.span}`),void 0!==e.offset&&e.offset>0&&x.push(`tkx-col-${v}-offset-${e.offset}`))}const y={};return void 0!==o&&(y.left=o/24*100+"%",y.position="relative"),void 0!==r&&(y.right=r/24*100+"%",y.position="relative"),void 0!==i&&(y.order=i),/* @__PURE__ */Ke("div",{ref:p,className:le("tkx-col",U("box-border min-h-[1px]"),...x,c),style:{flex:m?`0 0 ${m}`:"1",maxWidth:m??"100%",marginLeft:g,paddingLeft:f.h||void 0,paddingRight:f.h||void 0,paddingTop:f.v||void 0,paddingBottom:f.v||void 0,...y,...u},...h,children:e})});Li.displayName="TkxCol";var Wi=De({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 Ai({children:e,locale:t,direction:n,componentDefaults:o,componentOverrides:r,prefixCls:i}){const a=Be(Wi),l=je(()=>({size:o?.size??a.componentDefaults.size,variant:o?.variant??a.componentDefaults.variant,animation:o?.animation??a.componentDefaults.animation,bordered:o?.bordered??a.componentDefaults.bordered}),[o,a.componentDefaults]),s=je(()=>{const e=a.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,a.componentOverrides]),d=t??a.locale,c=n??a.direction,u=i??a.prefixCls,h=Ae(e=>`${u}-${e}`,[u]),p=Ae((e,t)=>{if(void 0!==t)return t;if(e){const t=s[e];if(t?.size)return t.size}return l.size},[l.size,s]),f=Ae(e=>void 0!==e?e:l.animation,[l.animation]),m=Ae((e,t)=>{if(void 0!==t)return t;if(e){const t=s[e];if(void 0!==t?.bordered)return t.bordered}return l.bordered},[l.bordered,s]),g=je(()=>({locale:d,direction:c,componentDefaults:l,componentOverrides:s,prefixCls:u,configured:!0,cls:h,getSize:p,getAnimation:f,getBordered:m}),[d,c,l,s,u,h,p,f,m]);/* @__PURE__ */
351
+ return Ke(Wi.Provider,{value:g,children:/* @__PURE__ */Ke("div",{dir:c,lang:d,className:`${u}-config-root`,style:{direction:c},children:e})})}function Bi(){return Be(Wi)}function Ei(e,t){const{prefixCls:n}=Bi();return`${t??n}-${e}`}function Hi(e,t){const{getSize:n}=Bi();return n(e,t)}Ai.displayName="TkxConfigProvider";var Fi={sm:32,md:40,lg:48},ji={sm:"0.75rem",md:"0.875rem",lg:"1rem"},Pi={sm:8,md:12,lg:16},Oi={sm:4,md:8,lg:12},Vi={sm:4,md:6,lg:8},Ui={sm:14,md:16,lg:20};function Ki(){const{direction:e}=Bi();if("rtl"===e)return{transform:"scaleX(-1)"}}function Yi(e,t=0){const{direction:n}=Bi(),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}}var Xi={"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"},qi=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function Gi(e){return qi.has(e)||qi.has(e.split("-")[0])}function Ji(e){if(Xi[e])return Xi[e];if("undefined"!=typeof Intl&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e}function _i(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(_i).join(""):e&&"object"==typeof e&&"props"in e?_i(e.props.children):""}function Zi({text:e}){const t=M(),[n,o]=Ve(!1);return Le("button",{type:"button",onClick:Ae(()=>{navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},[e]),"aria-label":n?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:n?t.success:t.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},n?"Copied!":"⎘")}function Qi(e="default"){const t=M();return{default:t.text,secondary:t.textMuted,success:t.success,warning:t.warning,danger:t.danger}[e]}var ea={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}};function ta({level:e=1,children:t,copyable:n=!1,type:o="default",style:r}){const i=Qi(o);M();const a=ea[e],l=`h${e}`,s="string"==typeof t?F(t):t,d=_i(t);return Le(l,{style:{color:i,fontSize:a.fontSize,lineHeight:a.lineHeight,fontWeight:a.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...r}},s,n&&Le(Zi,{text:d}))}function na({children:e,type:t="default",strong:n=!1,italic:o=!1,underline:r=!1,delete:i=!1,code:a=!1,mark:l=!1,copyable:s=!1,style:d}){const c=Qi(t),u=M(),h=_i(e),p="string"==typeof e?F(e):e,f=[];r&&f.push("underline"),i&&f.push("line-through");let m=p;return a&&(m=Le("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:u.surfaceAlt,border:`1px solid ${u.border}`,borderRadius:"4px",fontFamily:"monospace"}},m)),l&&(m=Le("mark",{style:{backgroundColor:`${u.warning}33`,color:c,padding:"0 2px",borderRadius:"2px"}},m)),Le(n?"strong":o?"em":"span",{style:{color:c,fontStyle:o?"italic":"normal",textDecoration:f.length>0?f.join(" "):"none",...d}},m,s&&Le(Zi,{text:h}))}function oa({children:e,type:t="default",copyable:n=!1,ellipsis:o=!1,style:r}){const i=M(),a="secondary"===t?i.textMuted:i.text,l=_i(e),s="string"==typeof e?F(e):e,d={};if(o){const e="object"==typeof o?o.rows??3:3;d.display="-webkit-box",d.WebkitLineClamp=e,d.WebkitBoxOrient="vertical",d.overflow="hidden"}return Le("div",{style:{color:a,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...d,...r}},s,n&&Le(Zi,{text:l}))}var ra={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}},ia=!1;function aa({size:e,color:t}){return Le("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},Le("circle",{cx:12,cy:12,r:10,stroke:`${t}33`,strokeWidth:2.5,fill:"none"}),Le("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:t,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function la({size:e,borderWidth:t,color:n,reducedMotion:o}){return o?Le(aa,{size:e,color:n}):(function(){if(ia||"undefined"==typeof document)return;ia=!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)}(),Le("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 sa({spinning:e=!0,size:t="md",tip:n,indicator:o,children:r,fullscreen:i=!1,delay:a=0,style:l}){const s=M(),d=ge(),[c,u]=Ve(0===a&&e),h=Oe(null);if(Ee(()=>(e&&a>0?h.current=setTimeout(()=>u(!0),a):u(e),()=>{null!==h.current&&clearTimeout(h.current)}),[e,a]),!c)return r?Le("div",{style:l},r):null;const p=ra[t],f=n?F(n):void 0,m=Le("div",{role:"status","aria-live":"polite","aria-label":f??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},o??Le(la,{size:p.dimension,borderWidth:p.borderWidth,color:s.primary,reducedMotion:d}),f&&Le("span",{style:{color:s.primary,fontSize:p.fontSize,marginTop:"4px"}},f));return i?Le("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}cc`,zIndex:9999,...l}},m):r?Le("div",{style:{position:"relative",...l}},Le("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:d?"none":"opacity 0.2s, filter 0.2s"}},r),Le("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}66`,borderRadius:"4px"}},m)):Le("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...l}},m)}function da({color:e,mutedColor:t}){return Le("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},Le("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${t}18`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Le("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${t}10`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Le("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${t}0d`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Le("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),Le("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function ca({mutedColor:e}){return Le("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},Le("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),Le("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Le("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Le("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Le("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),Le("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function ua({image:e="default",description:t="No data",children:n,style:o}){const r=M(),i="string"==typeof t?F(t):t;let a;return a="default"===e?Le(da,{color:r.primary,mutedColor:r.textMuted}):"simple"===e?Le(ca,{mutedColor:r.textMuted}):e,Le("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...o}},Le("div",{style:{marginBottom:"12px",opacity:.85}},a),i&&Le("div",{style:{color:r.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},i),n&&Le("div",{style:{marginTop:"16px"}},n))}function ha({direction:e,color:t}){return Le("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},Le("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 pa=!1;function fa({w:e,h:t,alt:n,bdr:o,rm:r}){return r||function(){if(pa||"undefined"==typeof document)return;pa=!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)}(),Le("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"}})}function ma({title:e,value:t,prefix:n,suffix:o,precision:r,groupSeparator:i=",",valueStyle:a,loading:l=!1,trend:s,trendValue:d,style:c}){const u=M(),h=ge(),p=F(e),f=d?F(d):void 0,m="up"===s?u.success:"down"===s?u.danger:void 0;return Le("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...c}},Le("div",{style:{color:u.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},p),l?Le(fa,{w:"120px",h:"32px",alt:u.surfaceAlt,bdr:u.border,rm:h}):Le("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u.text,fontVariantNumeric:"tabular-nums",...a}},n&&Le("span",{style:{fontSize:"0.75em",fontWeight:400}},n),Le("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}(t,r,i)),o&&Le("span",{style:{fontSize:"0.6em",fontWeight:400,color:u.textMuted}},o)),s&&Le("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:m,marginTop:"2px"}},Le(ha,{direction:s,color:m}),f&&Le("span",null,f)))}function ga({title:e,value:t,format:n="HH:mm:ss",onFinish:o,prefix:r,suffix:i,style:a}){const l=M(),s=F(e),d=Oe(o);d.current=o;const c=Oe(!1),[u,h]=Ve(()=>Math.max(0,t-Date.now()));Ee(()=>{c.current=!1;const e=()=>{const e=Math.max(0,t-Date.now());h(e),e<=0&&!c.current&&(c.current=!0,d.current?.())};e();const n=setInterval(e,1e3);return()=>clearInterval(n)},[t]);const p=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),a=n%60,l=e=>String(e).padStart(2,"0");return t.replace(/DD/g,l(o)).replace(/D/g,String(o)).replace(/HH/g,l(r)).replace(/H/g,String(r)).replace(/mm/g,l(i)).replace(/m/g,String(i)).replace(/ss/g,l(a)).replace(/s/g,String(a))}(u,n);return Le("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...a}},Le("div",{style:{color:l.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},s),Le("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u<=0?l.danger:l.text,fontVariantNumeric:"tabular-nums"}},r&&Le("span",{style:{fontSize:"0.75em",fontWeight:400}},r),Le("span",null,p),i&&Le("span",{style:{fontSize:"0.6em",fontWeight:400,color:l.textMuted}},i)))}var xa={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}};function ba({options:e,value:t,onChange:n,size:o="md",block:r=!1}){const i=M(),a=ge(),l=Oe(null),[s,d]=Ve(()=>Math.max(0,e.findIndex(e=>e.value===t))),[c,u]=Ve({}),h=xa[o];Ee(()=>{const n=e.findIndex(e=>e.value===t);n>=0&&d(n)},[t,e]),Ee(()=>{const e=l.current;if(!e)return;const t=e.querySelectorAll("[data-seg-btn]")[s];t&&u({left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight,transition:a?"none":"left 0.2s ease, width 0.2s ease"})},[s,e,a]);const p=Ae(t=>{const o=e[t];o&&!o.disabled&&(d(t),n?.(o.value))},[e,n]),f=Ae(t=>{let n=s;if("ArrowRight"===t.key||"ArrowDown"===t.key)for(t.preventDefault(),n=(s+1)%e.length;e[n]?.disabled&&n!==s;)n=(n+1)%e.length;else if("ArrowLeft"===t.key||"ArrowUp"===t.key)for(t.preventDefault(),n=(s-1+e.length)%e.length;e[n]?.disabled&&n!==s;)n=(n-1+e.length)%e.length;n!==s&&(p(n),(l.current?.querySelectorAll("[data-seg-btn]"))?.[n]?.focus())},[s,e,p]);/* @__PURE__ */
352
352
  return Ye("div",{ref:l,role:"radiogroup","aria-label":"Segmented control",className:U("relative inline-flex items-center rounded-lg p-1"),style:{backgroundColor:i.surfaceAlt,border:`1px solid ${i.border}`,width:r?"100%":void 0},onKeyDown:f,children:[/* @__PURE__ */Ke("div",{"aria-hidden":"true",className:U("absolute top-1 rounded-md"),style:{...c,backgroundColor:i.surface,boxShadow:`0 1px 3px ${i.border}`,zIndex:0}}),e.map((e,t)=>{const n=t===s,o=F(e.label);/* @__PURE__ */
353
- return Ye("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":n,"aria-disabled":e.disabled||void 0,disabled:e.disabled,tabIndex:n?0:-1,className:U("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:h.height,fontSize:h.fontSize,padding:`0 ${h.px}px`,flex:r?1:void 0,color:n?i.text:i.textMuted,backgroundColor:"transparent",opacity:e.disabled?.4:1,fontWeight:n?600:400,transition:a?"none":"color 0.15s ease"},onClick:()=>p(t),children:[e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",children:e.icon}),o]},e.value)})]})}function ya({options:e,value:t="",onChange:n,trigger:o="@",placeholder:r,label:i}){const a=N(),l=ge(),s=Oe(null),d=Oe(null),[c,u]=Ve(t),[h,p]=Ve(!1),[f,m]=Ve(""),[g,x]=Ve(0),[b,y]=Ve(-1);Ee(()=>{void 0!==t&&u(t)},[t]);const v=e.filter(e=>e.label.toLowerCase().includes(f.toLowerCase())),w=Ae(e=>{const t=e.target.value;u(t),n?.(t);const r=e.target.selectionStart??t.length,i=t.slice(0,r),a=i.lastIndexOf(o);if(a>=0){const e=i.slice(a+o.length);if(!/\s/.test(e))return m(e),y(a),p(!0),void x(0)}p(!1)},[o,n]),k=Ae(e=>{const t=c.slice(0,b),r=c.slice(b+o.length+f.length),i=`${t}${o}${e.value} ${r}`;u(i),n?.(i),p(!1),s.current?.focus()},[c,b,o,f,n]),S=Ae(e=>{h&&("ArrowDown"===e.key?(e.preventDefault(),x(e=>(e+1)%v.length)):"ArrowUp"===e.key?(e.preventDefault(),x(e=>(e-1+v.length)%v.length)):"Enter"===e.key&&v[g]?(e.preventDefault(),k(v[g])):"Escape"===e.key&&p(!1))},[h,v,g,k]);Ee(()=>{h&&d.current&&d.current.children[g]?.scrollIntoView({block:"nearest"})},[g,h]);const C=i?F(i):void 0,$=r?F(r):void 0;/* @__PURE__ */
353
+ return Ye("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":n,"aria-disabled":e.disabled||void 0,disabled:e.disabled,tabIndex:n?0:-1,className:U("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:h.height,fontSize:h.fontSize,padding:`0 ${h.px}px`,flex:r?1:void 0,color:n?i.text:i.textMuted,backgroundColor:"transparent",opacity:e.disabled?.4:1,fontWeight:n?600:400,transition:a?"none":"color 0.15s ease"},onClick:()=>p(t),children:[e.icon&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",children:e.icon}),o]},e.value)})]})}function ya({options:e,value:t="",onChange:n,trigger:o="@",placeholder:r,label:i}){const a=M(),l=ge(),s=Oe(null),d=Oe(null),[c,u]=Ve(t),[h,p]=Ve(!1),[f,m]=Ve(""),[g,x]=Ve(0),[b,y]=Ve(-1);Ee(()=>{void 0!==t&&u(t)},[t]);const v=e.filter(e=>e.label.toLowerCase().includes(f.toLowerCase())),w=Ae(e=>{const t=e.target.value;u(t),n?.(t);const r=e.target.selectionStart??t.length,i=t.slice(0,r),a=i.lastIndexOf(o);if(a>=0){const e=i.slice(a+o.length);if(!/\s/.test(e))return m(e),y(a),p(!0),void x(0)}p(!1)},[o,n]),k=Ae(e=>{const t=c.slice(0,b),r=c.slice(b+o.length+f.length),i=`${t}${o}${e.value} ${r}`;u(i),n?.(i),p(!1),s.current?.focus()},[c,b,o,f,n]),S=Ae(e=>{h&&("ArrowDown"===e.key?(e.preventDefault(),x(e=>(e+1)%v.length)):"ArrowUp"===e.key?(e.preventDefault(),x(e=>(e-1+v.length)%v.length)):"Enter"===e.key&&v[g]?(e.preventDefault(),k(v[g])):"Escape"===e.key&&p(!1))},[h,v,g,k]);Ee(()=>{h&&d.current&&d.current.children[g]?.scrollIntoView({block:"nearest"})},[g,h]);const C=i?F(i):void 0,$=r?F(r):void 0;/* @__PURE__ */
354
354
  return Ye("div",{className:U("relative font-sans"),style:{width:"100%"},children:[C&&/* @__PURE__ */Ke("label",{className:U("block text-sm font-medium mb-1"),style:{color:a.text},children:C}),
355
355
  /* @__PURE__ */Ke("textarea",{ref:s,role:"combobox","aria-expanded":h,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-label":C??"Mentions input",value:c,placeholder:$,onChange:w,onKeyDown:S,onBlur:()=>setTimeout(()=>p(!1),200),className:U("w-full rounded-lg border px-3 py-2 text-sm resize-y"),style:{backgroundColor:a.surface,borderColor:a.border,color:a.text,minHeight:80,outline:"none"},rows:3}),h&&v.length>0&&/* @__PURE__ */Ke("ul",{ref:d,role:"listbox","aria-label":"Mention suggestions",className:U("absolute left-0 right-0 z-50 rounded-lg border overflow-auto"),style:{backgroundColor:a.surface,borderColor:a.border,maxHeight:200,top:"100%",marginTop:4,listStyle:"none",padding:0,boxShadow:`0 4px 12px ${a.bg}80`,animation:l?"none":"tkxFadeIn 0.15s ease"},children:v.map((e,t)=>/* @__PURE__ */Ye("li",{role:"option","aria-selected":t===g,className:U("flex items-center gap-3 px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:t===g?a.surfaceAlt:"transparent",color:a.text},onMouseDown:t=>{t.preventDefault(),k(e)},onMouseEnter:()=>x(t),children:[e.avatar&&/* @__PURE__ */Ke("img",{src:F(e.avatar),alt:"","aria-hidden":"true",width:24,height:24,className:U("rounded-full"),style:{objectFit:"cover"}}),
356
356
  /* @__PURE__ */Ke("span",{children:F(e.label)}),
357
- /* @__PURE__ */Ye("span",{style:{color:a.textMuted,marginLeft:"auto"},children:[o,F(e.value)]})]},e.value))})]})}var va={L:.38,M:.42,Q:.48,H:.55};function wa({value:e,size:t=160,color:n,bgColor:o,errorLevel:r="M",icon:i,bordered:a=!0}){const l=N(),s=ge(),d=Oe(null),c=F(e),u=n??l.text,h=o??l.surface,p=je(()=>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=va[n]??.42,i=Array.from({length:t},()=>Array.from({length:t},()=>!1)),a=(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,a=n>=2&&n<=4&&o>=2&&o<=4;i[e+n][t+o]=r||a}};a(0,0),a(0,18),a(18,0);for(let l=7;l<18;l++)i[6][l]=l%2==0,i[l][6]=l%2==0;for(let l=0;l<t;l++)for(let e=0;e<t;e++)l<8&&e<8||l<8&&e>=17||l>=17&&e<8||6===l||6===e||(i[l][e]=o()<r);return i}(c,25,r),[c,r]);return Ee(()=>{const e=d.current;if(!e)return;const n=e.getContext("2d");if(!n)return;const o=window.devicePixelRatio||1;e.width=t*o,e.height=t*o,n.scale(o,o);const r=t/25;n.fillStyle=h,n.fillRect(0,0,t,t),n.fillStyle=u;for(let t=0;t<25;t++)for(let e=0;e<25;e++)p[t][e]&&n.fillRect(e*r,t*r,r,r);if(i){const e=.22*t,o=(t-e)/2;n.fillStyle=h,n.fillRect(o-2,o-2,e+4,e+4);const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{n.drawImage(r,o,o,e,e)},r.src=F(i)}},[p,t,u,h,i]),/* @__PURE__ */Ke("div",{role:"img","aria-label":`QR code for: ${c}`,className:U("inline-block rounded-lg"),style:{padding:a?12:0,backgroundColor:a?h:"transparent",border:a?`1px solid ${l.border}`:"none",lineHeight:0,animation:s?"none":"tkxFadeIn 0.2s ease"},children:/* @__PURE__ */Ke("canvas",{ref:d,"aria-hidden":"true",style:{width:t,height:t,display:"block"}})})}var ka={success:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ke("path",{d:"M22 37l9 9 19-19",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),error:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ke("path",{d:"M26 26l20 20M46 26L26 46",stroke:e,strokeWidth:"4",strokeLinecap:"round"})]}),warning:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[
357
+ /* @__PURE__ */Ye("span",{style:{color:a.textMuted,marginLeft:"auto"},children:[o,F(e.value)]})]},e.value))})]})}var va={L:.38,M:.42,Q:.48,H:.55};function wa({value:e,size:t=160,color:n,bgColor:o,errorLevel:r="M",icon:i,bordered:a=!0}){const l=M(),s=ge(),d=Oe(null),c=F(e),u=n??l.text,h=o??l.surface,p=je(()=>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=va[n]??.42,i=Array.from({length:t},()=>Array.from({length:t},()=>!1)),a=(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,a=n>=2&&n<=4&&o>=2&&o<=4;i[e+n][t+o]=r||a}};a(0,0),a(0,18),a(18,0);for(let l=7;l<18;l++)i[6][l]=l%2==0,i[l][6]=l%2==0;for(let l=0;l<t;l++)for(let e=0;e<t;e++)l<8&&e<8||l<8&&e>=17||l>=17&&e<8||6===l||6===e||(i[l][e]=o()<r);return i}(c,25,r),[c,r]);return Ee(()=>{const e=d.current;if(!e)return;const n=e.getContext("2d");if(!n)return;const o=window.devicePixelRatio||1;e.width=t*o,e.height=t*o,n.scale(o,o);const r=t/25;n.fillStyle=h,n.fillRect(0,0,t,t),n.fillStyle=u;for(let t=0;t<25;t++)for(let e=0;e<25;e++)p[t][e]&&n.fillRect(e*r,t*r,r,r);if(i){const e=.22*t,o=(t-e)/2;n.fillStyle=h,n.fillRect(o-2,o-2,e+4,e+4);const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{n.drawImage(r,o,o,e,e)},r.src=F(i)}},[p,t,u,h,i]),/* @__PURE__ */Ke("div",{role:"img","aria-label":`QR code for: ${c}`,className:U("inline-block rounded-lg"),style:{padding:a?12:0,backgroundColor:a?h:"transparent",border:a?`1px solid ${l.border}`:"none",lineHeight:0,animation:s?"none":"tkxFadeIn 0.2s ease"},children:/* @__PURE__ */Ke("canvas",{ref:d,"aria-hidden":"true",style:{width:t,height:t,display:"block"}})})}var ka={success:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ke("path",{d:"M22 37l9 9 19-19",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),error:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ke("path",{d:"M26 26l20 20M46 26L26 46",stroke:e,strokeWidth:"4",strokeLinecap:"round"})]}),warning:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[
358
358
  /* @__PURE__ */Ke("path",{d:"M36 6L4 64h64L36 6z",stroke:e,strokeWidth:"3",fill:`${e}18`}),
359
359
  /* @__PURE__ */Ke("path",{d:"M36 30v16",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),
360
360
  /* @__PURE__ */Ke("circle",{cx:"36",cy:"54",r:"2.5",fill:e})]}),info:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[
@@ -363,97 +363,97 @@ return Ye("div",{className:U("relative font-sans"),style:{width:"100%"},children
363
363
  /* @__PURE__ */Ke("circle",{cx:"36",cy:"22",r:"2.5",fill:e})]}),404:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ke("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"404"})]}),403:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[
364
364
  /* @__PURE__ */Ke("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),
365
365
  /* @__PURE__ */Ke("path",{d:"M28 30h16v16H28z",stroke:e,strokeWidth:"3",fill:"none"}),
366
- /* @__PURE__ */Ke("path",{d:"M32 30v-4a4 4 0 018 0v4",stroke:e,strokeWidth:"3",fill:"none"})]}),500:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ke("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"500"})]})};function Sa({status:e,title:t,subTitle:n,icon:o,extra:r}){const i=N(),a=ge(),l=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,i),s=F(t),d=n?F(n):void 0;/* @__PURE__ */
366
+ /* @__PURE__ */Ke("path",{d:"M32 30v-4a4 4 0 018 0v4",stroke:e,strokeWidth:"3",fill:"none"})]}),500:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ke("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ke("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"500"})]})};function Sa({status:e,title:t,subTitle:n,icon:o,extra:r}){const i=M(),a=ge(),l=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,i),s=F(t),d=n?F(n):void 0;/* @__PURE__ */
367
367
  return Ye("div",{role:"status","aria-live":"polite",className:U("flex flex-col items-center text-center px-6 py-12 font-sans"),style:{animation:a?"none":"tkxFadeIn 0.3s ease"},children:[
368
368
  /* @__PURE__ */Ke("div",{className:U("mb-6"),children:o??ka[e](l)}),
369
- /* @__PURE__ */Ke("h2",{className:U("text-xl font-semibold m-0 mb-2"),style:{color:i.text},children:s}),d&&/* @__PURE__ */Ke("p",{className:U("text-sm m-0 mb-6 max-w-md leading-relaxed"),style:{color:i.textMuted},children:d}),r&&/* @__PURE__ */Ke("div",{className:U("flex items-center gap-3 mt-4"),children:r})]})}function Ca({steps:e,isOpen:t=!1,onClose:n,current:o,onChange:r}){const i=N(),a=ge(),[l,s]=Ve(0),d=o??l,c=Oe(null),[u,h]=Ve({top:0,left:0}),[p,f]=Ve(null),m=e[d],g=Ae(()=>{if(!m)return;const e=function(e){const t=document.querySelector(e);return t?t.getBoundingClientRect():null}(m.target);if(f(e),e&&c.current){const t=c.current.offsetWidth,n=c.current.offsetHeight;h(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,m.placement??"bottom",t,n))}},[m]);Ee(()=>{if(t)return g(),window.addEventListener("resize",g),window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("resize",g),window.removeEventListener("scroll",g,!0)}},[t,d,g]),Ee(()=>{t&&c.current?.focus()},[t,d]);const x=Ae(e=>{s(e),r?.(e)},[r]),b=Ae(()=>{d<e.length-1?x(d+1):n?.()},[d,e.length,x,n]),y=Ae(()=>{d>0&&x(d-1)},[d,x]);if(!t||!m)return null;const v=F(m.title),w=F(m.description);return Xe(/* @__PURE__ */Ye("div",{"aria-hidden":"true",children:[/* @__PURE__ */Ke("div",{style:{position:"fixed",inset:0,zIndex:9998,backgroundColor:"rgba(0,0,0,0.55)",clipPath:p?`polygon(0% 0%, 0% 100%, ${p.left-6}px 100%, ${p.left-6}px ${p.top-6}px, ${p.right+6}px ${p.top-6}px, ${p.right+6}px ${p.bottom+6}px, ${p.left-6}px ${p.bottom+6}px, ${p.left-6}px 100%, 100% 100%, 100% 0%)`:void 0,transition:a?"none":"clip-path 0.25s ease"},onClick:n}),/* @__PURE__ */Ye("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":`Tour step ${d+1} of ${e.length}`,tabIndex:-1,style:{position:"absolute",zIndex:9999,top:u.top,left:u.left,width:300,backgroundColor:i.surface,border:`1px solid ${i.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${i.bg}80`,animation:a?"none":"tkxFadeIn 0.2s ease",fontFamily:"inherit"},onKeyDown:e=>{"Escape"===e.key&&n?.()},children:[
369
+ /* @__PURE__ */Ke("h2",{className:U("text-xl font-semibold m-0 mb-2"),style:{color:i.text},children:s}),d&&/* @__PURE__ */Ke("p",{className:U("text-sm m-0 mb-6 max-w-md leading-relaxed"),style:{color:i.textMuted},children:d}),r&&/* @__PURE__ */Ke("div",{className:U("flex items-center gap-3 mt-4"),children:r})]})}function Ca({steps:e,isOpen:t=!1,onClose:n,current:o,onChange:r}){const i=M(),a=ge(),[l,s]=Ve(0),d=o??l,c=Oe(null),[u,h]=Ve({top:0,left:0}),[p,f]=Ve(null),m=e[d],g=Ae(()=>{if(!m)return;const e=function(e){const t=document.querySelector(e);return t?t.getBoundingClientRect():null}(m.target);if(f(e),e&&c.current){const t=c.current.offsetWidth,n=c.current.offsetHeight;h(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,m.placement??"bottom",t,n))}},[m]);Ee(()=>{if(t)return g(),window.addEventListener("resize",g),window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("resize",g),window.removeEventListener("scroll",g,!0)}},[t,d,g]),Ee(()=>{t&&c.current?.focus()},[t,d]);const x=Ae(e=>{s(e),r?.(e)},[r]),b=Ae(()=>{d<e.length-1?x(d+1):n?.()},[d,e.length,x,n]),y=Ae(()=>{d>0&&x(d-1)},[d,x]);if(!t||!m)return null;const v=F(m.title),w=F(m.description);return Xe(/* @__PURE__ */Ye("div",{"aria-hidden":"true",children:[/* @__PURE__ */Ke("div",{style:{position:"fixed",inset:0,zIndex:9998,backgroundColor:"rgba(0,0,0,0.55)",clipPath:p?`polygon(0% 0%, 0% 100%, ${p.left-6}px 100%, ${p.left-6}px ${p.top-6}px, ${p.right+6}px ${p.top-6}px, ${p.right+6}px ${p.bottom+6}px, ${p.left-6}px ${p.bottom+6}px, ${p.left-6}px 100%, 100% 100%, 100% 0%)`:void 0,transition:a?"none":"clip-path 0.25s ease"},onClick:n}),/* @__PURE__ */Ye("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":`Tour step ${d+1} of ${e.length}`,tabIndex:-1,style:{position:"absolute",zIndex:9999,top:u.top,left:u.left,width:300,backgroundColor:i.surface,border:`1px solid ${i.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${i.bg}80`,animation:a?"none":"tkxFadeIn 0.2s ease",fontFamily:"inherit"},onKeyDown:e=>{"Escape"===e.key&&n?.()},children:[
370
370
  /* @__PURE__ */Ke("h3",{className:U("m-0 mb-2 text-base font-semibold"),style:{color:i.text},children:v}),
371
371
  /* @__PURE__ */Ke("p",{className:U("m-0 mb-4 text-sm leading-relaxed"),style:{color:i.textMuted},children:w}),
372
372
  /* @__PURE__ */Ke("div",{className:U("flex items-center gap-1 mb-4"),"aria-label":"Tour progress",children:e.map((e,t)=>/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",backgroundColor:t===d?i.primary:i.border,transition:a?"none":"background-color 0.2s"}},t))}),
373
- /* @__PURE__ */Ye("div",{className:U("flex items-center justify-between gap-2"),children:[/* @__PURE__ */Ke("button",{type:"button","aria-label":"Skip tour",onClick:n,className:U("border-0 bg-transparent cursor-pointer text-sm px-2 py-1"),style:{color:i.textMuted},children:"Skip"}),/* @__PURE__ */Ye("div",{className:U("flex gap-2"),children:[d>0&&/* @__PURE__ */Ke("button",{type:"button","aria-label":"Previous step",onClick:y,className:U("rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent"),style:{borderColor:i.border,color:i.text},children:"Prev"}),/* @__PURE__ */Ke("button",{type:"button","aria-label":d===e.length-1?"Finish tour":"Next step",onClick:b,className:U("rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium"),style:{backgroundColor:i.primary,color:"#fff"},children:d===e.length-1?"Finish":"Next"})]})]})]})]}),document.body)}function $a(){if("undefined"==typeof window)return!1;const e=window.outerWidth-window.innerWidth,t=window.outerHeight-window.innerHeight;return e>160||t>160}function za(){const[e,t]=Ve(!1);return Ee(()=>{if("undefined"==typeof window)return;t($a());const e=()=>t($a());window.addEventListener("resize",e);const n=window.setInterval(e,1e3);return()=>{window.removeEventListener("resize",e),window.clearInterval(n)}},[]),e}function Na({text:e,children:t,rotate:n=-22,gap:o=[100,100],fontSize:r=14,color:i,zIndex:a=10,pattern:l="tiled",dynamic:s=!1,refreshMs:d=0,intensifyOnDevtools:c=!1,fingerprintId:u}){const h=N(),p=ge(),f=Oe(null),[m,g]=Ve(""),[x,b]=Ve(0),y=za(),v=je(()=>{const t=(Array.isArray(e)?e:[e]).map(e=>F(e));return"fingerprint"===l?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))} • ${/* @__PURE__ */(new Date).toISOString().slice(0,16).replace("T"," ")}`]}(t,u):t},[e,l,u,x]),w=c&&y?"66":"22",k=i??`${h.textMuted}${w}`,S=Ae(()=>function(e,t,n,o,r,i){if("undefined"==typeof document)return"";const a=document.createElement("canvas"),l=a.getContext("2d");if(!l)return"";const s=1.5*o,d=e.length*s,c=Math.max(...e.map(e=>e.length))*o*.6;let u,h;return"single"===i?(u=Math.max(800,1.6*c),h=Math.max(600,4*d)):(u=n[0]+c,h=n[1]+d),a.width=2*u,a.height=2*h,l.scale(2,2),l.translate(u/2,h/2),l.rotate(t*Math.PI/180),l.font=`${o}px sans-serif`,l.fillStyle=r,l.textAlign="center",l.textBaseline="middle",e.forEach((t,n)=>{const o=(n-(e.length-1)/2)*s;l.fillText(t,0,o)}),a.toDataURL()}(v,n,o,r,k,l),[v,n,o,r,k,l]);Ee(()=>{const e=S();e&&g(`url(${e})`)},[S]),Ee(()=>{if(!d||d<=0)return;const e=window.setInterval(()=>b(e=>e+1),d);return()=>window.clearInterval(e)},[d]),Ee(()=>{if(!s||"undefined"==typeof document)return;const e=()=>{"visible"===document.visibilityState&&b(e=>e+1)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[s]),Ee(()=>{const e=f.current?.querySelector("[data-watermark]");if(!e)return;const t=new MutationObserver(()=>{const t=S();t&&(e.style.backgroundImage=`url(${t})`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[S]);const C={zIndex:a,backgroundImage:m,backgroundRepeat:"single"===l?"no-repeat":"repeat",backgroundPosition:"single"===l?"center center":void 0,animation:p?"none":"tkxFadeIn 0.3s ease"},$=c&&y?{filter:"blur(4px)",transition:"filter 0.2s"}:{};/* @__PURE__ */
373
+ /* @__PURE__ */Ye("div",{className:U("flex items-center justify-between gap-2"),children:[/* @__PURE__ */Ke("button",{type:"button","aria-label":"Skip tour",onClick:n,className:U("border-0 bg-transparent cursor-pointer text-sm px-2 py-1"),style:{color:i.textMuted},children:"Skip"}),/* @__PURE__ */Ye("div",{className:U("flex gap-2"),children:[d>0&&/* @__PURE__ */Ke("button",{type:"button","aria-label":"Previous step",onClick:y,className:U("rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent"),style:{borderColor:i.border,color:i.text},children:"Prev"}),/* @__PURE__ */Ke("button",{type:"button","aria-label":d===e.length-1?"Finish tour":"Next step",onClick:b,className:U("rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium"),style:{backgroundColor:i.primary,color:"#fff"},children:d===e.length-1?"Finish":"Next"})]})]})]})]}),document.body)}function $a(){if("undefined"==typeof window)return!1;const e=window.outerWidth-window.innerWidth,t=window.outerHeight-window.innerHeight;return e>160||t>160}function za(){const[e,t]=Ve(!1);return Ee(()=>{if("undefined"==typeof window)return;t($a());const e=()=>t($a());window.addEventListener("resize",e);const n=window.setInterval(e,1e3);return()=>{window.removeEventListener("resize",e),window.clearInterval(n)}},[]),e}function Ma({text:e,children:t,rotate:n=-22,gap:o=[100,100],fontSize:r=14,color:i,zIndex:a=10,pattern:l="tiled",dynamic:s=!1,refreshMs:d=0,intensifyOnDevtools:c=!1,fingerprintId:u}){const h=M(),p=ge(),f=Oe(null),[m,g]=Ve(""),[x,b]=Ve(0),y=za(),v=je(()=>{const t=(Array.isArray(e)?e:[e]).map(e=>F(e));return"fingerprint"===l?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))} • ${/* @__PURE__ */(new Date).toISOString().slice(0,16).replace("T"," ")}`]}(t,u):t},[e,l,u,x]),w=c&&y?"66":"22",k=i??`${h.textMuted}${w}`,S=Ae(()=>function(e,t,n,o,r,i){if("undefined"==typeof document)return"";const a=document.createElement("canvas"),l=a.getContext("2d");if(!l)return"";const s=1.5*o,d=e.length*s,c=Math.max(...e.map(e=>e.length))*o*.6;let u,h;return"single"===i?(u=Math.max(800,1.6*c),h=Math.max(600,4*d)):(u=n[0]+c,h=n[1]+d),a.width=2*u,a.height=2*h,l.scale(2,2),l.translate(u/2,h/2),l.rotate(t*Math.PI/180),l.font=`${o}px sans-serif`,l.fillStyle=r,l.textAlign="center",l.textBaseline="middle",e.forEach((t,n)=>{const o=(n-(e.length-1)/2)*s;l.fillText(t,0,o)}),a.toDataURL()}(v,n,o,r,k,l),[v,n,o,r,k,l]);Ee(()=>{const e=S();e&&g(`url(${e})`)},[S]),Ee(()=>{if(!d||d<=0)return;const e=window.setInterval(()=>b(e=>e+1),d);return()=>window.clearInterval(e)},[d]),Ee(()=>{if(!s||"undefined"==typeof document)return;const e=()=>{"visible"===document.visibilityState&&b(e=>e+1)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[s]),Ee(()=>{const e=f.current?.querySelector("[data-watermark]");if(!e)return;const t=new MutationObserver(()=>{const t=S();t&&(e.style.backgroundImage=`url(${t})`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[S]);const C={zIndex:a,backgroundImage:m,backgroundRepeat:"single"===l?"no-repeat":"repeat",backgroundPosition:"single"===l?"center center":void 0,animation:p?"none":"tkxFadeIn 0.3s ease"},$=c&&y?{filter:"blur(4px)",transition:"filter 0.2s"}:{};/* @__PURE__ */
374
374
  return Ye("div",{ref:f,className:U("relative"),style:{overflow:"hidden"},children:[
375
375
  /* @__PURE__ */Ke("div",{style:$,children:t}),
376
- /* @__PURE__ */Ke("div",{"data-watermark":!0,"aria-hidden":"true",className:U("absolute inset-0 pointer-events-none"),style:C}),c&&y&&/* @__PURE__ */Ke("div",{"aria-live":"polite",style:{position:"absolute",top:12,right:12,padding:"6px 12px",background:h.danger,color:"#fff",fontSize:12,fontWeight:600,borderRadius:6,zIndex:a+1,pointerEvents:"none"},children:"Developer Tools detected — content protected"})]})}function Ma(e){if(e)try{return e()}catch{return window}return window}function Ia({children:e,offsetTop:t,offsetBottom:n,onChange:o,target:r}){const i=N(),a=ge(),l=Oe(null),s=Oe(null),[d,c]=Ve(!1),[u,h]=Ve({width:0,height:0}),p=Oe(!1),f=je(()=>F("Sticky content"),[]),m=Ae(()=>{const e=l.current;if(!e)return;const i=e.getBoundingClientRect(),a=function(e){if(e instanceof Window)return{top:0,bottom:e.innerHeight};const t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}(Ma(r));let s=!1;void 0!==t?s=i.top-a.top<=t:void 0!==n&&(s=a.bottom-i.bottom<=n),s!==p.current&&(p.current=s,c(s),h({width:i.width,height:i.height}),o?.(s))},[t,n,o,r]);Ee(()=>{const e=Ma(r);return m(),e.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",m),()=>{e.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[m,r]);const g=d?{position:"fixed",zIndex:100,...void 0!==t?{top:t}:{},...void 0!==n?{bottom:n}:{},width:u.width||void 0,transition:a?"none":"box-shadow 0.2s ease",boxShadow:`0 2px 8px ${i.border}`}:{};/* @__PURE__ */
377
- return Ye(Ue,{children:[/* @__PURE__ */Ke("div",{ref:l,"aria-hidden":d,style:d?{height:u.height,width:u.width}:{}}),/* @__PURE__ */Ke("div",{ref:s,role:"region","aria-label":f,className:U(d?"tkx-affixed":""),style:g,children:e})]})}function La(e){const t=[];for(const n of e)t.push(n),n.children&&t.push(...La(n.children));return t}function Ra(e){return e.startsWith("#")?e.slice(1):e}function Da({item:e,activeKey:t,depth:n,onClick:o,theme:r,reducedMotion:i}){const a=e.key===t,l=F(e.title);/* @__PURE__ */
378
- return Ye("li",{role:"none",style:{listStyle:"none"},children:[/* @__PURE__ */Ke("a",{role:"treeitem","aria-current":a?"location":void 0,href:e.href,onClick:t=>{t.preventDefault(),o(e.href)},className:U("block text-sm py-1 no-underline"),style:{paddingLeft:12+16*n,color:a?r.primary:r.textMuted,fontWeight:a?600:400,borderLeft:`2px solid ${a?r.primary:"transparent"}`,transition:i?"none":"color 0.15s ease, border-color 0.15s ease"},children:l}),e.children&&e.children.length>0&&/* @__PURE__ */Ke("ul",{role:"group",style:{margin:0,padding:0},children:e.children.map(e=>/* @__PURE__ */Ke(Da,{item:e,activeKey:t,depth:n+1,onClick:o,theme:r,reducedMotion:i},e.key))})]})}function Ta({items:e,offsetTop:t=0,getCurrentAnchor:n,onChange:o}){const r=N(),i=ge(),[a,l]=Ve(e[0]?.key??""),s=Oe(!1),d=La(e),c=Ae(()=>{if(s.current)return;let e=d[0]?.key??"";for(const n of d){const o=Ra(n.href),r=document.getElementById(o);r&&r.getBoundingClientRect().top<=t+10&&(e=n.key)}n&&(e=n(e)),e!==a&&(l(e),o?.(e))},[d,t,n,a,o]);Ee(()=>(window.addEventListener("scroll",c,{passive:!0}),c(),()=>window.removeEventListener("scroll",c)),[c]);const u=Ae(e=>{const n=Ra(e),r=document.getElementById(n);if(!r)return;s.current=!0;const a=r.getBoundingClientRect().top+window.scrollY-t;window.scrollTo({top:a,behavior:i?"auto":"smooth"});const c=d.find(t=>t.href===e);c&&(l(c.key),o?.(c.key)),setTimeout(()=>{s.current=!1},800)},[d,t,i,o]);/* @__PURE__ */
379
- return Ke("nav",{role:"tree","aria-label":"Anchor navigation",className:U("font-sans"),style:{borderLeft:`1px solid ${r.border}`,padding:"4px 0"},children:/* @__PURE__ */Ke("ul",{role:"group",style:{margin:0,padding:0},children:e.map(e=>/* @__PURE__ */Ke(Da,{item:e,activeKey:a,depth:0,onClick:u,theme:r,reducedMotion:i},e.key))})})}function Wa(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}function Aa({options:e,value:t=[],onChange:n,placeholder:o="Select...",label:r,multiple:i=!1}){const a=N(),l=ge(),s=Oe(null),d=Oe(null),[c,u]=Ve(!1),[h,p]=Ve(t),[f,m]=Ve({top:0,left:0,width:0}),g=r?F(r):void 0,x=F(o),b=t.length>0?function(e,t){return Wa(e,t).map(e=>F(e.label)).join(" / ")}(e,t):"";Ee(()=>{if(!c||!s.current)return;const e=s.current.getBoundingClientRect();m({top:e.bottom+4+window.scrollY,left:e.left+window.scrollX,width:Math.max(e.width,200)})},[c]),Ee(()=>{if(!c)return;const e=e=>{s.current?.contains(e.target)||d.current?.contains(e.target)||u(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]);const y=Ae((t,o)=>{if(o.disabled)return;const r=[...h.slice(0,t),o.value];if(p(r),!o.children?.length){const t=Wa(e,r);n?.(r,t),i||u(!1)}},[h,e,n,i]),v=Ae(e=>{"Escape"===e.key?(u(!1),s.current?.focus()):"Enter"!==e.key&&" "!==e.key||c||(e.preventDefault(),u(!0))},[c]),w=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,h),k=c?Xe(/* @__PURE__ */Ke("div",{ref:d,role:"tree","aria-label":g??"Cascader options",className:U("flex rounded-lg border overflow-hidden"),style:{position:"absolute",zIndex:9999,top:f.top,left:f.left,backgroundColor:a.surface,borderColor:a.border,boxShadow:`0 4px 16px ${a.bg}80`,animation:l?"none":"tkxFadeIn 0.15s ease"},children:w.map((e,t)=>/* @__PURE__ */Ke("ul",{role:"group",className:U("m-0 p-0 overflow-auto"),style:{listStyle:"none",minWidth:160,maxHeight:260,borderRight:t<w.length-1?`1px solid ${a.border}`:"none"},children:e.map(e=>{const n=h[t]===e.value,o=F(e.label);/* @__PURE__ */
376
+ /* @__PURE__ */Ke("div",{"data-watermark":!0,"aria-hidden":"true",className:U("absolute inset-0 pointer-events-none"),style:C}),c&&y&&/* @__PURE__ */Ke("div",{"aria-live":"polite",style:{position:"absolute",top:12,right:12,padding:"6px 12px",background:h.danger,color:"#fff",fontSize:12,fontWeight:600,borderRadius:6,zIndex:a+1,pointerEvents:"none"},children:"Developer Tools detected — content protected"})]})}function Na(e){if(e)try{return e()}catch{return window}return window}function Ia({children:e,offsetTop:t,offsetBottom:n,onChange:o,target:r}){const i=M(),a=ge(),l=Oe(null),s=Oe(null),[d,c]=Ve(!1),[u,h]=Ve({width:0,height:0}),p=Oe(!1),f=je(()=>F("Sticky content"),[]),m=Ae(()=>{const e=l.current;if(!e)return;const i=e.getBoundingClientRect(),a=function(e){if(e instanceof Window)return{top:0,bottom:e.innerHeight};const t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}(Na(r));let s=!1;void 0!==t?s=i.top-a.top<=t:void 0!==n&&(s=a.bottom-i.bottom<=n),s!==p.current&&(p.current=s,c(s),h({width:i.width,height:i.height}),o?.(s))},[t,n,o,r]);Ee(()=>{const e=Na(r);return m(),e.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",m),()=>{e.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[m,r]);const g=d?{position:"fixed",zIndex:100,...void 0!==t?{top:t}:{},...void 0!==n?{bottom:n}:{},width:u.width||void 0,transition:a?"none":"box-shadow 0.2s ease",boxShadow:`0 2px 8px ${i.border}`}:{};/* @__PURE__ */
377
+ return Ye(Ue,{children:[/* @__PURE__ */Ke("div",{ref:l,"aria-hidden":d,style:d?{height:u.height,width:u.width}:{}}),/* @__PURE__ */Ke("div",{ref:s,role:"region","aria-label":f,className:U(d?"tkx-affixed":""),style:g,children:e})]})}function Ra(e){const t=[];for(const n of e)t.push(n),n.children&&t.push(...Ra(n.children));return t}function Ta(e){return e.startsWith("#")?e.slice(1):e}function Da({item:e,activeKey:t,depth:n,onClick:o,theme:r,reducedMotion:i}){const a=e.key===t,l=F(e.title);/* @__PURE__ */
378
+ return Ye("li",{role:"none",style:{listStyle:"none"},children:[/* @__PURE__ */Ke("a",{role:"treeitem","aria-current":a?"location":void 0,href:e.href,onClick:t=>{t.preventDefault(),o(e.href)},className:U("block text-sm py-1 no-underline"),style:{paddingLeft:12+16*n,color:a?r.primary:r.textMuted,fontWeight:a?600:400,borderLeft:`2px solid ${a?r.primary:"transparent"}`,transition:i?"none":"color 0.15s ease, border-color 0.15s ease"},children:l}),e.children&&e.children.length>0&&/* @__PURE__ */Ke("ul",{role:"group",style:{margin:0,padding:0},children:e.children.map(e=>/* @__PURE__ */Ke(Da,{item:e,activeKey:t,depth:n+1,onClick:o,theme:r,reducedMotion:i},e.key))})]})}function La({items:e,offsetTop:t=0,getCurrentAnchor:n,onChange:o}){const r=M(),i=ge(),[a,l]=Ve(e[0]?.key??""),s=Oe(!1),d=Ra(e),c=Ae(()=>{if(s.current)return;let e=d[0]?.key??"";for(const n of d){const o=Ta(n.href),r=document.getElementById(o);r&&r.getBoundingClientRect().top<=t+10&&(e=n.key)}n&&(e=n(e)),e!==a&&(l(e),o?.(e))},[d,t,n,a,o]);Ee(()=>(window.addEventListener("scroll",c,{passive:!0}),c(),()=>window.removeEventListener("scroll",c)),[c]);const u=Ae(e=>{const n=Ta(e),r=document.getElementById(n);if(!r)return;s.current=!0;const a=r.getBoundingClientRect().top+window.scrollY-t;window.scrollTo({top:a,behavior:i?"auto":"smooth"});const c=d.find(t=>t.href===e);c&&(l(c.key),o?.(c.key)),setTimeout(()=>{s.current=!1},800)},[d,t,i,o]);/* @__PURE__ */
379
+ return Ke("nav",{role:"tree","aria-label":"Anchor navigation",className:U("font-sans"),style:{borderLeft:`1px solid ${r.border}`,padding:"4px 0"},children:/* @__PURE__ */Ke("ul",{role:"group",style:{margin:0,padding:0},children:e.map(e=>/* @__PURE__ */Ke(Da,{item:e,activeKey:a,depth:0,onClick:u,theme:r,reducedMotion:i},e.key))})})}function Wa(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}function Aa({options:e,value:t=[],onChange:n,placeholder:o="Select...",label:r,multiple:i=!1}){const a=M(),l=ge(),s=Oe(null),d=Oe(null),[c,u]=Ve(!1),[h,p]=Ve(t),[f,m]=Ve({top:0,left:0,width:0}),g=r?F(r):void 0,x=F(o),b=t.length>0?function(e,t){return Wa(e,t).map(e=>F(e.label)).join(" / ")}(e,t):"";Ee(()=>{if(!c||!s.current)return;const e=s.current.getBoundingClientRect();m({top:e.bottom+4+window.scrollY,left:e.left+window.scrollX,width:Math.max(e.width,200)})},[c]),Ee(()=>{if(!c)return;const e=e=>{s.current?.contains(e.target)||d.current?.contains(e.target)||u(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]);const y=Ae((t,o)=>{if(o.disabled)return;const r=[...h.slice(0,t),o.value];if(p(r),!o.children?.length){const t=Wa(e,r);n?.(r,t),i||u(!1)}},[h,e,n,i]),v=Ae(e=>{"Escape"===e.key?(u(!1),s.current?.focus()):"Enter"!==e.key&&" "!==e.key||c||(e.preventDefault(),u(!0))},[c]),w=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,h),k=c?Xe(/* @__PURE__ */Ke("div",{ref:d,role:"tree","aria-label":g??"Cascader options",className:U("flex rounded-lg border overflow-hidden"),style:{position:"absolute",zIndex:9999,top:f.top,left:f.left,backgroundColor:a.surface,borderColor:a.border,boxShadow:`0 4px 16px ${a.bg}80`,animation:l?"none":"tkxFadeIn 0.15s ease"},children:w.map((e,t)=>/* @__PURE__ */Ke("ul",{role:"group",className:U("m-0 p-0 overflow-auto"),style:{listStyle:"none",minWidth:160,maxHeight:260,borderRight:t<w.length-1?`1px solid ${a.border}`:"none"},children:e.map(e=>{const n=h[t]===e.value,o=F(e.label);/* @__PURE__ */
380
380
  return Ye("li",{role:"treeitem","aria-selected":n,"aria-disabled":e.disabled||void 0,"aria-expanded":e.children?.length?n:void 0,className:U("flex items-center justify-between px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:n?a.surfaceAlt:"transparent",color:e.disabled?a.textMuted:a.text,opacity:e.disabled?.5:1,cursor:e.disabled?"not-allowed":"pointer"},onClick:()=>y(t,e),onMouseEnter:()=>{e.disabled||p(n=>[...n.slice(0,t),e.value])},children:[/* @__PURE__ */Ke("span",{children:o}),e.children&&e.children.length>0&&/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:a.textMuted,flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M10 6l6 6-6 6V6z"})})]},e.value)})},t))}),document.body):null;/* @__PURE__ */
381
381
  return Ye("div",{className:U("relative font-sans"),onKeyDown:v,children:[g&&/* @__PURE__ */Ke("label",{className:U("block text-sm font-medium mb-1"),style:{color:a.text},children:g}),
382
382
  /* @__PURE__ */Ye("button",{ref:s,type:"button",role:"combobox","aria-expanded":c,"aria-haspopup":"tree","aria-label":g??"Cascader",className:U("w-full flex items-center justify-between rounded-lg border px-3 py-2 text-sm cursor-pointer"),style:{backgroundColor:a.surface,borderColor:c?a.primary:a.border,color:b?a.text:a.textMuted,outline:"none",minHeight:38,textAlign:"left"},onClick:()=>u(e=>!e),children:[/* @__PURE__ */Ke("span",{className:U("truncate"),children:b||x}),/* @__PURE__ */Ke("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:a.textMuted,transform:c?"rotate(180deg)":"rotate(0deg)",transition:l?"none":"transform 0.2s ease",flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M7 10l5 5 5-5H7z"})})]}),k]})}var Ba={sm:"8px 12px",md:"12px 16px",lg:"16px 20px"};function Ea({theme:e,reducedMotion:t}){/* @__PURE__ */
383
- return Ye("div",{className:U("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[/* @__PURE__ */Ke("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),/* @__PURE__ */Ye("div",{className:U("flex-1"),children:[/* @__PURE__ */Ke("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),/* @__PURE__ */Ke("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}})]})]})}function Ha({items:e,header:t,footer:n,bordered:o=!0,size:r="md",loading:i=!1,emptyText:a="No data",grid:l}){const s=N(),d=ge(),c=F(a),u=Ba[r],h=!!l,p=l?.column??1,f=l?.gutter??16;/* @__PURE__ */
383
+ return Ye("div",{className:U("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[/* @__PURE__ */Ke("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),/* @__PURE__ */Ye("div",{className:U("flex-1"),children:[/* @__PURE__ */Ke("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),/* @__PURE__ */Ke("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}})]})]})}function Ha({items:e,header:t,footer:n,bordered:o=!0,size:r="md",loading:i=!1,emptyText:a="No data",grid:l}){const s=M(),d=ge(),c=F(a),u=Ba[r],h=!!l,p=l?.column??1,f=l?.gutter??16;/* @__PURE__ */
384
384
  return Ye("div",{role:"list","aria-label":"List","aria-busy":i,className:U("font-sans rounded-lg overflow-hidden"),style:{border:o?`1px solid ${s.border}`:"none",backgroundColor:s.surface},children:[t&&/* @__PURE__ */Ke("div",{className:U("font-semibold text-sm"),style:{padding:u,color:s.text,borderBottom:`1px solid ${s.border}`,backgroundColor:s.surfaceAlt},children:t}),i&&/* @__PURE__ */Ke("div",{children:Array.from({length:3}).map((e,t)=>/* @__PURE__ */Ke(Ea,{theme:s,reducedMotion:d},t))}),!i&&0===e.length&&/* @__PURE__ */Ke("div",{role:"status",className:U("text-center py-12 text-sm"),style:{color:s.textMuted},children:c}),!i&&e.length>0&&/* @__PURE__ */Ke("div",{style:h?{display:"grid",gridTemplateColumns:`repeat(${p}, 1fr)`,gap:f,padding:f}:void 0,children:e.map((t,n)=>{const o=F(t.title),r=t.description?F(t.description):void 0;/* @__PURE__ */
385
385
  return Ye("div",{role:"listitem",className:U("flex items-start gap-3"),style:{padding:u,borderBottom:!h&&n<e.length-1?`1px solid ${s.border}`:"none",...h?{border:`1px solid ${s.border}`,borderRadius:8,backgroundColor:s.surface}:{},animation:d?"none":`tkxFadeIn 0.2s ease ${.03*n}s both`},children:[t.avatar&&/* @__PURE__ */Ke("div",{"aria-hidden":"true",className:U("shrink-0"),children:t.avatar}),
386
- /* @__PURE__ */Ye("div",{className:U("flex-1 min-w-0"),children:[/* @__PURE__ */Ke("div",{className:U("text-sm font-medium"),style:{color:s.text},children:o}),r&&/* @__PURE__ */Ke("div",{className:U("text-xs mt-1 leading-relaxed"),style:{color:s.textMuted},children:r})]}),t.extra&&/* @__PURE__ */Ke("div",{className:U("shrink-0 ml-auto"),style:{color:s.textMuted},children:t.extra}),t.actions&&/* @__PURE__ */Ke("div",{className:U("shrink-0 flex items-center gap-2"),children:t.actions})]},t.key)})}),n&&/* @__PURE__ */Ke("div",{className:U("text-sm"),style:{padding:u,color:s.textMuted,borderTop:`1px solid ${s.border}`,backgroundColor:s.surfaceAlt},children:n})]})}var Fa={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"},ja={turnstile:"turnstile",hcaptcha:"hcaptcha",recaptcha:"grecaptcha"},Pa=/^[A-Za-z0-9_-]{20,80}$/,Oa={},Va=We(function({provider:e="turnstile",sitekey:t,theme:n="auto",size:o="normal",language:r,execution:i="render",onVerify:a,onExpire:l,onError:s,className:d,style:c,testMode:u=!1},h){const p=Oe(null),f=Oe(null),m=Oe(null);return"string"!=typeof t||Pa.test(t),Fe(h,()=>({reset:()=>{if(u)return void(m.current=null);const t=window[ja[e]];if(t&&null!=f.current){try{t.reset?.(f.current)}catch{}m.current=null}},execute:()=>{if(u)return void setTimeout(()=>{m.current="TEST_TOKEN",a("TEST_TOKEN")},200);const t=window[ja[e]];if(t&&null!=f.current)try{t.execute?.(f.current)}catch{}},getResponse:()=>m.current}),[e,a,u]),Ee(()=>{if(u){const e=window.setTimeout(()=>{m.current="TEST_TOKEN",a("TEST_TOKEN")},200);return()=>window.clearTimeout(e)}let d=!1,c=null;const h=p.current;if(h)return function(e,t){if("undefined"==typeof window)return Promise.resolve();if(window[ja[e]])return Promise.resolve();if(Oa[e])return Oa[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(/* @__PURE__ */new Error("script-load-failed")));const i=document.createElement("script");let a=Fa[e];t&&"turnstile"!==e&&(a+=`?hl=${encodeURIComponent(t)}`),i.src=a,i.async=!0,i.defer=!0,i.dataset.tkxCaptcha=e,i.addEventListener("load",()=>n()),i.addEventListener("error",()=>o(/* @__PURE__ */new Error("script-load-failed"))),document.head.appendChild(i)});return Oa[e]=n,n}(e,r).then(()=>{if(d||!h)return;const u=window[ja[e]];if(!u)return;const p={callback:e=>{m.current=e,a(e)},"expired-callback":()=>{m.current=null,l?.()},"error-callback":e=>{m.current=null,s?.("string"==typeof e?e:"unknown")}};try{"turnstile"===e?c=u.render(h,{sitekey:t,theme:n,size:"flexible"===o?"flexible":"compact"===o?"compact":"normal",execution:i,language:r||"auto",...p}):"hcaptcha"===e?c=u.render(h,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"compact"===o?"compact":"normal",...p}):"recaptcha"===e&&(c=u.render(h,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"normal",...p})),f.current=c}catch(g){s?.(g?.message||"render-failed")}}).catch(()=>{d||s?.("script-load-failed")}),()=>{d=!0;const t=window[ja[e]];if(t&&null!=c)try{t.remove?.(c)}catch{}f.current=null,m.current=null}},[]),/* @__PURE__ */Ke("div",{ref:p,className:d,style:c,"data-tkx-captcha-provider":e,children:u&&/* @__PURE__ */Ke("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]"})})});Va.displayName="TkxCaptcha";var Ua={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"}},Ka={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"]},Ya=!1;function Xa(e){if("undefined"==typeof document)return;const t=Ua[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 qa(e){return e&&(Ka[e]||Ka[e.split("-")[0]])||["latin"]}function Ga({scripts:e,language:t,preconnect:n=!0,children:o}){const r=e&&e.length>0?e:t?qa(t):["latin"];return Ee(()=>{n&&function(){if(Ya||"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),Ya=!0}(),r.forEach(Xa)},[r.join(","),n]),null==o?null:/* @__PURE__ */Ke(Ue,{children:o})}function _a(e){Xa(e)}function Za(e){!function(e){if("undefined"==typeof document)return;const t=Ua[e];if(!t)return;const n=document.getElementById(t.id);n&&n.remove()}(e)}var Ja=[{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 Qa(e){return e.replace(/\D+/g,"")}function el(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 tl(e,t){return Array.isArray(t)?e.length>=t[0]&&e.length<=t[1]:e.length===t}function nl(e){return Array.isArray(e)?`${e[0]}–${e[1]}`:`${e}`}var ol=We(function({defaultCountry:e="in",value:t,defaultValue:n,onChange:o,onValid:r,label:i,placeholder:a,disabled:l,required:s,id:d,name:c,extraCountries:u=[],className:h,style:p},f){const m=N(),g=He(),x=He(),b=je(()=>[...Ja,...u].sort((e,t)=>e.name.localeCompare(t.name)),[u]),y=e=>b.find(t=>t.iso2===e.toLowerCase())||b[0],v=t=>{if(!t.startsWith("+"))return{country:y(e),digits:Qa(t)};const n=Qa(t);for(const e of[4,3,2,1]){const t=n.slice(0,e),o=b.find(e=>e.dial===t);if(o)return{country:o,digits:n.slice(e)}}return{country:y(e),digits:n}},w=t?v(t):{country:y(e),digits:Qa(n||"")},[k,S]=Ve(w.country),[C,$]=Ve(w.digits),[z,M]=Ve(!1),[I,L]=Ve(""),[R,D]=Ve(0),T=Oe(null),W=Oe(null);Ee(()=>{if(void 0===t)return;const e=v(t);S(e.country),$(e.digits)},[t]);const A=el(C,k.format),B=tl(C,k.length),E=C?`+${k.dial}${C}`:"",H=(e,t)=>{const n={raw:el(e,t.format),digits:e,e164:e?`+${t.dial}${e}`:"",country:t,valid:tl(e,t.length)};o?.(n)},F=e=>{S(e),M(!1),H(C,e),T.current?.focus()},j=je(()=>{const e=I.trim().toLowerCase();return e?b.filter(t=>t.name.toLowerCase().includes(e)||t.iso2.includes(e)||t.dial.includes(e.replace(/^\+/,""))):b},[b,I]);Ee(()=>{D(0)},[I]),Ee(()=>{if(z){const e=setTimeout(()=>W.current?.focus(),0);return()=>clearTimeout(e)}},[z]);const P=a??nl(k.length).replace(/\d/g,"#"),O={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...p},V={fontSize:13,fontWeight:600,color:m.text},U={display:"flex",alignItems:"stretch",border:`1px solid ${m.border}`,borderRadius:8,background:m.surface,overflow:"visible",position:"relative"},K={display:"inline-flex",alignItems:"center",gap:6,padding:"0 10px",background:"transparent",border:"none",borderRight:`1px solid ${m.border}`,cursor:l?"not-allowed":"pointer",color:m.text,fontSize:14,minHeight:40,fontWeight:500},Y={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:m.text,background:"transparent",minHeight:40,minWidth:0},X={position:"absolute",top:"calc(100% + 4px)",left:0,right:0,maxHeight:280,overflow:"auto",background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,zIndex:1e3,padding:6,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},q={width:"100%",padding:"8px 10px",border:`1px solid ${m.border}`,borderRadius:6,background:m.bg,color:m.text,fontSize:13,marginBottom:6,outline:"none"},G={fontSize:12,color:m.danger,marginTop:2};/* @__PURE__ */
387
- return Ye("div",{className:h,style:O,onKeyDown:e=>{z&&("ArrowDown"===e.key?(e.preventDefault(),D(e=>Math.min(j.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),D(e=>Math.max(0,e-1))):"Enter"===e.key?(e.preventDefault(),j[R]&&F(j[R])):"Escape"===e.key&&(e.preventDefault(),M(!1),T.current?.focus()))},children:[i&&/* @__PURE__ */Ye("label",{htmlFor:d||g,style:V,children:[i,s&&/* @__PURE__ */Ke("span",{style:{color:m.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),
386
+ /* @__PURE__ */Ye("div",{className:U("flex-1 min-w-0"),children:[/* @__PURE__ */Ke("div",{className:U("text-sm font-medium"),style:{color:s.text},children:o}),r&&/* @__PURE__ */Ke("div",{className:U("text-xs mt-1 leading-relaxed"),style:{color:s.textMuted},children:r})]}),t.extra&&/* @__PURE__ */Ke("div",{className:U("shrink-0 ml-auto"),style:{color:s.textMuted},children:t.extra}),t.actions&&/* @__PURE__ */Ke("div",{className:U("shrink-0 flex items-center gap-2"),children:t.actions})]},t.key)})}),n&&/* @__PURE__ */Ke("div",{className:U("text-sm"),style:{padding:u,color:s.textMuted,borderTop:`1px solid ${s.border}`,backgroundColor:s.surfaceAlt},children:n})]})}var Fa={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"},ja={turnstile:"turnstile",hcaptcha:"hcaptcha",recaptcha:"grecaptcha"},Pa=/^[A-Za-z0-9_-]{20,80}$/,Oa={},Va=We(function({provider:e="turnstile",sitekey:t,theme:n="auto",size:o="normal",language:r,execution:i="render",onVerify:a,onExpire:l,onError:s,className:d,style:c,testMode:u=!1},h){const p=Oe(null),f=Oe(null),m=Oe(null);return"string"!=typeof t||Pa.test(t),Fe(h,()=>({reset:()=>{if(u)return void(m.current=null);const t=window[ja[e]];if(t&&null!=f.current){try{t.reset?.(f.current)}catch{}m.current=null}},execute:()=>{if(u)return void setTimeout(()=>{m.current="TEST_TOKEN",a("TEST_TOKEN")},200);const t=window[ja[e]];if(t&&null!=f.current)try{t.execute?.(f.current)}catch{}},getResponse:()=>m.current}),[e,a,u]),Ee(()=>{if(u){const e=window.setTimeout(()=>{m.current="TEST_TOKEN",a("TEST_TOKEN")},200);return()=>window.clearTimeout(e)}let d=!1,c=null;const h=p.current;if(h)return function(e,t){if("undefined"==typeof window)return Promise.resolve();if(window[ja[e]])return Promise.resolve();if(Oa[e])return Oa[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(/* @__PURE__ */new Error("script-load-failed")));const i=document.createElement("script");let a=Fa[e];t&&"turnstile"!==e&&(a+=`?hl=${encodeURIComponent(t)}`),i.src=a,i.async=!0,i.defer=!0,i.dataset.tkxCaptcha=e,i.addEventListener("load",()=>n()),i.addEventListener("error",()=>o(/* @__PURE__ */new Error("script-load-failed"))),document.head.appendChild(i)});return Oa[e]=n,n}(e,r).then(()=>{if(d||!h)return;const u=window[ja[e]];if(!u)return;const p={callback:e=>{m.current=e,a(e)},"expired-callback":()=>{m.current=null,l?.()},"error-callback":e=>{m.current=null,s?.("string"==typeof e?e:"unknown")}};try{"turnstile"===e?c=u.render(h,{sitekey:t,theme:n,size:"flexible"===o?"flexible":"compact"===o?"compact":"normal",execution:i,language:r||"auto",...p}):"hcaptcha"===e?c=u.render(h,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"compact"===o?"compact":"normal",...p}):"recaptcha"===e&&(c=u.render(h,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"normal",...p})),f.current=c}catch(g){s?.(g?.message||"render-failed")}}).catch(()=>{d||s?.("script-load-failed")}),()=>{d=!0;const t=window[ja[e]];if(t&&null!=c)try{t.remove?.(c)}catch{}f.current=null,m.current=null}},[]),/* @__PURE__ */Ke("div",{ref:p,className:d,style:c,"data-tkx-captcha-provider":e,children:u&&/* @__PURE__ */Ke("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]"})})});Va.displayName="TkxCaptcha";var Ua={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"}},Ka={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"]},Ya=!1;function Xa(e){if("undefined"==typeof document)return;const t=Ua[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 qa(e){return e&&(Ka[e]||Ka[e.split("-")[0]])||["latin"]}function Ga({scripts:e,language:t,preconnect:n=!0,children:o}){const r=e&&e.length>0?e:t?qa(t):["latin"];return Ee(()=>{n&&function(){if(Ya||"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),Ya=!0}(),r.forEach(Xa)},[r.join(","),n]),null==o?null:/* @__PURE__ */Ke(Ue,{children:o})}function Ja(e){Xa(e)}function _a(e){!function(e){if("undefined"==typeof document)return;const t=Ua[e];if(!t)return;const n=document.getElementById(t.id);n&&n.remove()}(e)}var Za=[{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 Qa(e){return e.replace(/\D+/g,"")}function el(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 tl(e,t){return Array.isArray(t)?e.length>=t[0]&&e.length<=t[1]:e.length===t}function nl(e){return Array.isArray(e)?`${e[0]}–${e[1]}`:`${e}`}var ol=We(function({defaultCountry:e="in",value:t,defaultValue:n,onChange:o,onValid:r,label:i,placeholder:a,disabled:l,required:s,id:d,name:c,extraCountries:u=[],className:h,style:p},f){const m=M(),g=He(),x=He(),b=je(()=>[...Za,...u].sort((e,t)=>e.name.localeCompare(t.name)),[u]),y=e=>b.find(t=>t.iso2===e.toLowerCase())||b[0],v=t=>{if(!t.startsWith("+"))return{country:y(e),digits:Qa(t)};const n=Qa(t);for(const e of[4,3,2,1]){const t=n.slice(0,e),o=b.find(e=>e.dial===t);if(o)return{country:o,digits:n.slice(e)}}return{country:y(e),digits:n}},w=t?v(t):{country:y(e),digits:Qa(n||"")},[k,S]=Ve(w.country),[C,$]=Ve(w.digits),[z,N]=Ve(!1),[I,R]=Ve(""),[T,D]=Ve(0),L=Oe(null),W=Oe(null);Ee(()=>{if(void 0===t)return;const e=v(t);S(e.country),$(e.digits)},[t]);const A=el(C,k.format),B=tl(C,k.length),E=C?`+${k.dial}${C}`:"",H=(e,t)=>{const n={raw:el(e,t.format),digits:e,e164:e?`+${t.dial}${e}`:"",country:t,valid:tl(e,t.length)};o?.(n)},F=e=>{S(e),N(!1),H(C,e),L.current?.focus()},j=je(()=>{const e=I.trim().toLowerCase();return e?b.filter(t=>t.name.toLowerCase().includes(e)||t.iso2.includes(e)||t.dial.includes(e.replace(/^\+/,""))):b},[b,I]);Ee(()=>{D(0)},[I]),Ee(()=>{if(z){const e=setTimeout(()=>W.current?.focus(),0);return()=>clearTimeout(e)}},[z]);const P=a??nl(k.length).replace(/\d/g,"#"),O={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...p},V={fontSize:13,fontWeight:600,color:m.text},U={display:"flex",alignItems:"stretch",border:`1px solid ${m.border}`,borderRadius:8,background:m.surface,overflow:"visible",position:"relative"},K={display:"inline-flex",alignItems:"center",gap:6,padding:"0 10px",background:"transparent",border:"none",borderRight:`1px solid ${m.border}`,cursor:l?"not-allowed":"pointer",color:m.text,fontSize:14,minHeight:40,fontWeight:500},Y={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:m.text,background:"transparent",minHeight:40,minWidth:0},X={position:"absolute",top:"calc(100% + 4px)",left:0,right:0,maxHeight:280,overflow:"auto",background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,zIndex:1e3,padding:6,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},q={width:"100%",padding:"8px 10px",border:`1px solid ${m.border}`,borderRadius:6,background:m.bg,color:m.text,fontSize:13,marginBottom:6,outline:"none"},G={fontSize:12,color:m.danger,marginTop:2};/* @__PURE__ */
387
+ return Ye("div",{className:h,style:O,onKeyDown:e=>{z&&("ArrowDown"===e.key?(e.preventDefault(),D(e=>Math.min(j.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),D(e=>Math.max(0,e-1))):"Enter"===e.key?(e.preventDefault(),j[T]&&F(j[T])):"Escape"===e.key&&(e.preventDefault(),N(!1),L.current?.focus()))},children:[i&&/* @__PURE__ */Ye("label",{htmlFor:d||g,style:V,children:[i,s&&/* @__PURE__ */Ke("span",{style:{color:m.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),
388
388
  /* @__PURE__ */Ye("div",{style:U,children:[
389
- /* @__PURE__ */Ye("button",{ref:T,type:"button",style:K,onClick:()=>!l&&M(e=>!e),"aria-haspopup":"listbox","aria-expanded":z,"aria-controls":x,"aria-label":`Country: ${k.name}, dial code +${k.dial}`,disabled:l,children:[
389
+ /* @__PURE__ */Ye("button",{ref:L,type:"button",style:K,onClick:()=>!l&&N(e=>!e),"aria-haspopup":"listbox","aria-expanded":z,"aria-controls":x,"aria-label":`Country: ${k.name}, dial code +${k.dial}`,disabled:l,children:[
390
390
  /* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{fontSize:18,lineHeight:1},children:k.flag}),
391
391
  /* @__PURE__ */Ye("span",{"aria-hidden":"true",children:["+",k.dial]}),
392
392
  /* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{fontSize:10,opacity:.6,marginLeft:2},children:"▾"})]}),
393
393
  /* @__PURE__ */Ke("input",{ref:f,id:d||g,name:c,type:"tel",inputMode:"tel",autoComplete:"tel-national",value:A,onChange:e=>{const t=Qa(e.target.value).slice(0,15);$(t),H(t,k)},onBlur:()=>{B&&r&&r({raw:A,digits:C,e164:E,country:k,valid:!0})},placeholder:P,disabled:l,required:s,"aria-invalid":C.length>0&&!B,"aria-describedby":C.length>0&&!B?`${g}-err`:void 0,style:Y}),z&&!l&&/* @__PURE__ */Ye("div",{id:x,role:"listbox","aria-label":"Select country",style:X,children:[
394
- /* @__PURE__ */Ke("input",{ref:W,type:"text",placeholder:"Search country or dial code…",value:I,onChange:e=>L(e.target.value),style:q,"aria-label":"Filter countries"}),0===j.length&&/* @__PURE__ */Ye("div",{style:{padding:"12px 10px",fontSize:13,color:m.textMuted},children:['No country matches "',I,'"']}),j.map((e,t)=>{/* @__PURE__ */return Ye("div",{role:"option","aria-selected":t===R,onMouseEnter:()=>D(t),onClick:()=>F(e),style:(n=t===R,{display:"flex",alignItems:"center",gap:10,padding:"8px 10px",borderRadius:6,cursor:"pointer",background:n?m.surfaceAlt:"transparent",color:m.text,fontSize:13}),children:[
394
+ /* @__PURE__ */Ke("input",{ref:W,type:"text",placeholder:"Search country or dial code…",value:I,onChange:e=>R(e.target.value),style:q,"aria-label":"Filter countries"}),0===j.length&&/* @__PURE__ */Ye("div",{style:{padding:"12px 10px",fontSize:13,color:m.textMuted},children:['No country matches "',I,'"']}),j.map((e,t)=>{/* @__PURE__ */return Ye("div",{role:"option","aria-selected":t===T,onMouseEnter:()=>D(t),onClick:()=>F(e),style:(n=t===T,{display:"flex",alignItems:"center",gap:10,padding:"8px 10px",borderRadius:6,cursor:"pointer",background:n?m.surfaceAlt:"transparent",color:m.text,fontSize:13}),children:[
395
395
  /* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{fontSize:16},children:e.flag}),
396
396
  /* @__PURE__ */Ke("span",{style:{flex:1},children:e.name}),
397
- /* @__PURE__ */Ye("span",{style:{color:m.textMuted,fontVariantNumeric:"tabular-nums"},children:["+",e.dial]})]},e.iso2);var n})]})]}),C.length>0&&!B&&/* @__PURE__ */Ye("div",{id:`${g}-err`,role:"alert",style:G,children:["Expected ",nl(k.length)," digits for ",k.name,"."]})]})});ol.displayName="TkxPhoneInput";var rl={free:null,"1:1":1,"3:4":3/4,"4:5":.8,"16:9":16/9,"4:3":4/3,"3:2":1.5},il={drop:"Drop an image here, or",browse:"browse",rotate:"Rotate",apply:"Apply",cancel:"Cancel",brightness:"Brightness",contrast:"Contrast",aspect:"Aspect",free:"Free"},al=We(function({src:e,aspectRatio:t="free",ratios:n=["free","1:1","3:4","4:5","16:9"],mimeType:o="image/png",quality:r=.92,maxOutputSize:i=2048,outputFilename:a="edited.png",onChange:l,onResult:s,onCancel:d,className:c,style:u,labels:h},p){const f={...il,...h},m=N(),g=Oe(null),x=Oe(null),b=Oe(null),y=Oe(null),[v,w]=Ve(e??null),[k,S]=Ve(null),[C,$]=Ve(t),[z,M]=Ve(0),[I,L]=Ve(100),[R,D]=Ve(100),[T,W]=Ve({x:0,y:0,w:0,h:0}),[A,B]=Ve(!1),E=Oe({mode:null,startX:0,startY:0,startCrop:{x:0,y:0,w:0,h:0}});Ee(()=>{if(!v)return y.current=null,void S(null);const e=new Image;e.crossOrigin="anonymous",e.onload=()=>{y.current=e,S({w:e.naturalWidth,h:e.naturalHeight});const t=rl[C];if(t){const n=Math.min(e.naturalWidth,e.naturalHeight*t),o=n/t;W({x:(e.naturalWidth-n)/2,y:(e.naturalHeight-o)/2,w:n,h:o})}else W({x:0,y:0,w:e.naturalWidth,h:e.naturalHeight})},e.src=v},[v,C]),Ee(()=>{l?.({rotation:z,brightness:I,contrast:R})},[z,I,R,l]);const H=Ae(()=>{const e=x.current,t=y.current,n=k;if(!e||!t||!n)return;const o=e.getContext("2d");if(!o)return;const r=b.current,i=r?Math.min(r.clientWidth,800):600,a=z%180!=0,l=a?n.h:n.w,s=a?n.w:n.h,d=Math.min(i/l,600/s,1),c=Math.floor(l*d),u=Math.floor(s*d);e.width=c,e.height=u,o.save(),o.filter=`brightness(${I}%) contrast(${R}%)`,o.translate(c/2,u/2),o.rotate(z*Math.PI/180),o.drawImage(t,-n.w*d/2,-n.h*d/2,n.w*d,n.h*d),o.restore()},[z,I,R,k]);Ee(()=>{H()},[H]),Ee(()=>{const e=k;if(!e)return;const t=rl[C];t&&W(n=>{const o=n.x+n.w/2,r=n.y+n.h/2;let i=n.w,a=i/t;return a>e.h&&(a=e.h,i=a*t),i>e.w&&(i=e.w,a=i/t),{x:Math.max(0,Math.min(e.w-i,o-i/2)),y:Math.max(0,Math.min(e.h-a,r-a/2)),w:i,h:a}})},[C,k]);const F=e=>{const t=new FileReader;t.onload=()=>{"string"==typeof t.result&&(w(t.result),M(0),L(100),D(100))},t.readAsDataURL(e)},j=e=>t=>{t.preventDefault(),t.stopPropagation();const n="touches"in t?t.touches[0]:t;E.current={mode:e,startX:n.clientX,startY:n.clientY,startCrop:{...T}};const o=e=>{e.preventDefault();const t="touches"in e?e.touches[0]:e,n=t.clientX-E.current.startX,o=t.clientY-E.current.startY,r=k;if(!r)return;const i=x.current;if(!i)return;const a=n*(r.w/i.width),l=o*(r.h/i.height),s=E.current.startCrop,d=rl[C];let c={...s};if("move"===E.current.mode)c.x=Math.max(0,Math.min(r.w-s.w,s.x+a)),c.y=Math.max(0,Math.min(r.h-s.h,s.y+l));else{const e=E.current.mode;if("se"===e)c.w=Math.max(20,Math.min(r.w-s.x,s.w+a)),c.h=d?c.w/d:Math.max(20,Math.min(r.h-s.y,s.h+l));else if("sw"===e){const e=Math.max(20,s.w-a);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+l))}else if("ne"===e){c.w=Math.max(20,Math.min(r.w-s.x,s.w+a));const e=d?c.w/d:Math.max(20,s.h-l);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-a);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-l);c.y=Math.max(0,s.y+s.h-t),c.h=s.y+s.h-c.y}}W(c)},r=()=>{E.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)},P=Ae(()=>new Promise(e=>{const t=y.current,n=k;if(!t||!n)return e(null);const l=document.createElement("canvas"),s=z%180!=0,d=s?T.h:T.w,c=s?T.w:T.h,u=Math.min(1,i/Math.max(d,c));l.width=Math.round(d*u),l.height=Math.round(c*u);const h=l.getContext("2d");if(!h)return e(null);h.filter=`brightness(${I}%) contrast(${R}%)`;const p=document.createElement("canvas");p.width=s?n.h:n.w,p.height=s?n.w:n.h;const f=p.getContext("2d");if(!f)return e(null);f.translate(p.width/2,p.height/2),f.rotate(z*Math.PI/180),f.drawImage(t,-n.w/2,-n.h/2,n.w,n.h),h.drawImage(p,T.x,T.y,T.w,T.h,0,0,l.width,l.height),l.toBlob(t=>{if(!t)return e(null);const n="image/jpeg"===o?"jpg":"image/webp"===o?"webp":"png",r=a.endsWith(`.${n}`)?a:a.replace(/\.\w+$/,"")+`.${n}`;e({blob:t,file:new File([t],r,{type:o,lastModified:Date.now()}),url:URL.createObjectURL(t),width:l.width,height:l.height})},o,r)}),[T,z,I,R,k,o,r,i,a]);Fe(p,()=>({getResult:P,reset:()=>{if(M(0),L(100),D(100),k){const e=rl[C];if(e){const t=Math.min(k.w,k.h*e),n=t/e;W({x:(k.w-t)/2,y:(k.h-n)/2,w:t,h:n})}else W({x:0,y:0,w:k.w,h:k.h})}},loadSource:e=>w(e)}),[P,C,k]);const O={border:`1px solid ${m.border}`,borderRadius:12,background:m.surface,padding:16,...u},V={border:`2px dashed ${A?m.primary:m.border}`,borderRadius:10,padding:48,textAlign:"center",color:m.textMuted,cursor:"pointer",transition:"border-color 0.15s",background:A?`${m.primary}10`:"transparent"},U={padding:"8px 14px",border:`1px solid ${m.border}`,borderRadius:6,background:m.bg,color:m.text,cursor:"pointer",fontSize:13,fontWeight:600,minHeight:36},K=je(()=>{const e=x.current,t=k;if(!e||!t)return null;const n=z%180!=0,o=n?t.h:t.w,r=n?t.w:t.h,i=e.width/o,a=e.height/r;return{left:T.x*i,top:T.y*a,width:T.w*i,height:T.h*a}},[T,k,z]);return v?/* @__PURE__ */Ye("div",{ref:b,className:c,style:O,children:[
397
+ /* @__PURE__ */Ye("span",{style:{color:m.textMuted,fontVariantNumeric:"tabular-nums"},children:["+",e.dial]})]},e.iso2);var n})]})]}),C.length>0&&!B&&/* @__PURE__ */Ye("div",{id:`${g}-err`,role:"alert",style:G,children:["Expected ",nl(k.length)," digits for ",k.name,"."]})]})});ol.displayName="TkxPhoneInput";var rl={free:null,"1:1":1,"3:4":3/4,"4:5":.8,"16:9":16/9,"4:3":4/3,"3:2":1.5},il={drop:"Drop an image here, or",browse:"browse",rotate:"Rotate",apply:"Apply",cancel:"Cancel",brightness:"Brightness",contrast:"Contrast",aspect:"Aspect",free:"Free"},al=We(function({src:e,aspectRatio:t="free",ratios:n=["free","1:1","3:4","4:5","16:9"],mimeType:o="image/png",quality:r=.92,maxOutputSize:i=2048,outputFilename:a="edited.png",onChange:l,onResult:s,onCancel:d,className:c,style:u,labels:h},p){const f={...il,...h},m=M(),g=Oe(null),x=Oe(null),b=Oe(null),y=Oe(null),[v,w]=Ve(e??null),[k,S]=Ve(null),[C,$]=Ve(t),[z,N]=Ve(0),[I,R]=Ve(100),[T,D]=Ve(100),[L,W]=Ve({x:0,y:0,w:0,h:0}),[A,B]=Ve(!1),E=Oe({mode:null,startX:0,startY:0,startCrop:{x:0,y:0,w:0,h:0}});Ee(()=>{if(!v)return y.current=null,void S(null);const e=new Image;e.crossOrigin="anonymous",e.onload=()=>{y.current=e,S({w:e.naturalWidth,h:e.naturalHeight});const t=rl[C];if(t){const n=Math.min(e.naturalWidth,e.naturalHeight*t),o=n/t;W({x:(e.naturalWidth-n)/2,y:(e.naturalHeight-o)/2,w:n,h:o})}else W({x:0,y:0,w:e.naturalWidth,h:e.naturalHeight})},e.src=v},[v,C]),Ee(()=>{l?.({rotation:z,brightness:I,contrast:T})},[z,I,T,l]);const H=Ae(()=>{const e=x.current,t=y.current,n=k;if(!e||!t||!n)return;const o=e.getContext("2d");if(!o)return;const r=b.current,i=r?Math.min(r.clientWidth,800):600,a=z%180!=0,l=a?n.h:n.w,s=a?n.w:n.h,d=Math.min(i/l,600/s,1),c=Math.floor(l*d),u=Math.floor(s*d);e.width=c,e.height=u,o.save(),o.filter=`brightness(${I}%) contrast(${T}%)`,o.translate(c/2,u/2),o.rotate(z*Math.PI/180),o.drawImage(t,-n.w*d/2,-n.h*d/2,n.w*d,n.h*d),o.restore()},[z,I,T,k]);Ee(()=>{H()},[H]),Ee(()=>{const e=k;if(!e)return;const t=rl[C];t&&W(n=>{const o=n.x+n.w/2,r=n.y+n.h/2;let i=n.w,a=i/t;return a>e.h&&(a=e.h,i=a*t),i>e.w&&(i=e.w,a=i/t),{x:Math.max(0,Math.min(e.w-i,o-i/2)),y:Math.max(0,Math.min(e.h-a,r-a/2)),w:i,h:a}})},[C,k]);const F=e=>{const t=new FileReader;t.onload=()=>{"string"==typeof t.result&&(w(t.result),N(0),R(100),D(100))},t.readAsDataURL(e)},j=e=>t=>{t.preventDefault(),t.stopPropagation();const n="touches"in t?t.touches[0]:t;E.current={mode:e,startX:n.clientX,startY:n.clientY,startCrop:{...L}};const o=e=>{e.preventDefault();const t="touches"in e?e.touches[0]:e,n=t.clientX-E.current.startX,o=t.clientY-E.current.startY,r=k;if(!r)return;const i=x.current;if(!i)return;const a=n*(r.w/i.width),l=o*(r.h/i.height),s=E.current.startCrop,d=rl[C];let c={...s};if("move"===E.current.mode)c.x=Math.max(0,Math.min(r.w-s.w,s.x+a)),c.y=Math.max(0,Math.min(r.h-s.h,s.y+l));else{const e=E.current.mode;if("se"===e)c.w=Math.max(20,Math.min(r.w-s.x,s.w+a)),c.h=d?c.w/d:Math.max(20,Math.min(r.h-s.y,s.h+l));else if("sw"===e){const e=Math.max(20,s.w-a);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+l))}else if("ne"===e){c.w=Math.max(20,Math.min(r.w-s.x,s.w+a));const e=d?c.w/d:Math.max(20,s.h-l);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-a);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-l);c.y=Math.max(0,s.y+s.h-t),c.h=s.y+s.h-c.y}}W(c)},r=()=>{E.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)},P=Ae(()=>new Promise(e=>{const t=y.current,n=k;if(!t||!n)return e(null);const l=document.createElement("canvas"),s=z%180!=0,d=s?L.h:L.w,c=s?L.w:L.h,u=Math.min(1,i/Math.max(d,c));l.width=Math.round(d*u),l.height=Math.round(c*u);const h=l.getContext("2d");if(!h)return e(null);h.filter=`brightness(${I}%) contrast(${T}%)`;const p=document.createElement("canvas");p.width=s?n.h:n.w,p.height=s?n.w:n.h;const f=p.getContext("2d");if(!f)return e(null);f.translate(p.width/2,p.height/2),f.rotate(z*Math.PI/180),f.drawImage(t,-n.w/2,-n.h/2,n.w,n.h),h.drawImage(p,L.x,L.y,L.w,L.h,0,0,l.width,l.height),l.toBlob(t=>{if(!t)return e(null);const n="image/jpeg"===o?"jpg":"image/webp"===o?"webp":"png",r=a.endsWith(`.${n}`)?a:a.replace(/\.\w+$/,"")+`.${n}`;e({blob:t,file:new File([t],r,{type:o,lastModified:Date.now()}),url:URL.createObjectURL(t),width:l.width,height:l.height})},o,r)}),[L,z,I,T,k,o,r,i,a]);Fe(p,()=>({getResult:P,reset:()=>{if(N(0),R(100),D(100),k){const e=rl[C];if(e){const t=Math.min(k.w,k.h*e),n=t/e;W({x:(k.w-t)/2,y:(k.h-n)/2,w:t,h:n})}else W({x:0,y:0,w:k.w,h:k.h})}},loadSource:e=>w(e)}),[P,C,k]);const O={border:`1px solid ${m.border}`,borderRadius:12,background:m.surface,padding:16,...u},V={border:`2px dashed ${A?m.primary:m.border}`,borderRadius:10,padding:48,textAlign:"center",color:m.textMuted,cursor:"pointer",transition:"border-color 0.15s",background:A?`${m.primary}10`:"transparent"},U={padding:"8px 14px",border:`1px solid ${m.border}`,borderRadius:6,background:m.bg,color:m.text,cursor:"pointer",fontSize:13,fontWeight:600,minHeight:36},K=je(()=>{const e=x.current,t=k;if(!e||!t)return null;const n=z%180!=0,o=n?t.h:t.w,r=n?t.w:t.h,i=e.width/o,a=e.height/r;return{left:L.x*i,top:L.y*a,width:L.w*i,height:L.h*a}},[L,k,z]);return v?/* @__PURE__ */Ye("div",{ref:b,className:c,style:O,children:[
398
398
  /* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12,alignItems:"center"},children:[
399
399
  /* @__PURE__ */Ye("span",{style:{fontSize:13,fontWeight:600,marginRight:4},children:[f.aspect,":"]}),n.map(e=>{/* @__PURE__ */return Ke("button",{type:"button",onClick:()=>$(e),style:(t=C===e,{...U,background:t?m.primary:m.bg,color:t?m.bg:m.text,borderColor:t?m.primary:m.border}),"aria-pressed":C===e,children:"free"===e?f.free:e},e);var t}),
400
400
  /* @__PURE__ */Ke("div",{style:{width:1,height:24,background:m.border,margin:"0 4px"}}),
401
- /* @__PURE__ */Ye("button",{type:"button",onClick:()=>M(e=>(e-90+360)%360),style:U,"aria-label":`${f.rotate} 90 degrees left`,children:["↺ ",f.rotate]}),
402
- /* @__PURE__ */Ye("button",{type:"button",onClick:()=>M(e=>(e+90)%360),style:U,"aria-label":`${f.rotate} 90 degrees right`,children:["↻ ",f.rotate]})]}),
401
+ /* @__PURE__ */Ye("button",{type:"button",onClick:()=>N(e=>(e-90+360)%360),style:U,"aria-label":`${f.rotate} 90 degrees left`,children:["↺ ",f.rotate]}),
402
+ /* @__PURE__ */Ye("button",{type:"button",onClick:()=>N(e=>(e+90)%360),style:U,"aria-label":`${f.rotate} 90 degrees right`,children:["↻ ",f.rotate]})]}),
403
403
  /* @__PURE__ */Ye("div",{style:{display:"flex",gap:16,marginBottom:12,flexWrap:"wrap"},children:[/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13},children:[
404
404
  /* @__PURE__ */Ke("span",{style:{minWidth:80},children:f.brightness}),
405
- /* @__PURE__ */Ke("input",{type:"range",min:50,max:150,value:I,onChange:e=>L(Number(e.target.value)),"aria-label":f.brightness,style:{width:140}}),
405
+ /* @__PURE__ */Ke("input",{type:"range",min:50,max:150,value:I,onChange:e=>R(Number(e.target.value)),"aria-label":f.brightness,style:{width:140}}),
406
406
  /* @__PURE__ */Ye("span",{style:{minWidth:40,color:m.textMuted,fontVariantNumeric:"tabular-nums"},children:[I,"%"]})]}),/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13},children:[
407
407
  /* @__PURE__ */Ke("span",{style:{minWidth:80},children:f.contrast}),
408
- /* @__PURE__ */Ke("input",{type:"range",min:50,max:150,value:R,onChange:e=>D(Number(e.target.value)),"aria-label":f.contrast,style:{width:140}}),
409
- /* @__PURE__ */Ye("span",{style:{minWidth:40,color:m.textMuted,fontVariantNumeric:"tabular-nums"},children:[R,"%"]})]})]}),
408
+ /* @__PURE__ */Ke("input",{type:"range",min:50,max:150,value:T,onChange:e=>D(Number(e.target.value)),"aria-label":f.contrast,style:{width:140}}),
409
+ /* @__PURE__ */Ye("span",{style:{minWidth:40,color:m.textMuted,fontVariantNumeric:"tabular-nums"},children:[T,"%"]})]})]}),
410
410
  /* @__PURE__ */Ye("div",{style:{position:"relative",display:"inline-block",maxWidth:"100%",userSelect:"none",touchAction:"none"},children:[/* @__PURE__ */Ke("canvas",{ref:x,style:{display:"block",maxWidth:"100%"}}),K&&/* @__PURE__ */Ke("div",{role:"region","aria-label":"Crop area",style:{position:"absolute",left:K.left,top:K.top,width:K.width,height:K.height,border:`2px solid ${m.primary}`,boxShadow:`0 0 0 9999px ${m.bg}aa`,cursor:"move",touchAction:"none"},onMouseDown:j("move"),onTouchStart:j("move"),tabIndex:0,onKeyDown:e=>{const t=k;if(!t)return;const n=e.shiftKey?20:5;"ArrowLeft"===e.key?W(e=>({...e,x:Math.max(0,e.x-n)})):"ArrowRight"===e.key?W(e=>({...e,x:Math.min(t.w-e.w,e.x+n)})):"ArrowUp"===e.key?W(e=>({...e,y:Math.max(0,e.y-n)})):"ArrowDown"===e.key&&W(e=>({...e,y:Math.min(t.h-e.h,e.y+n)}))},children:["nw","ne","sw","se"].map(e=>/* @__PURE__ */Ke("div",{onMouseDown:j(e),onTouchStart:j(e),style:{position:"absolute",width:14,height:14,background:m.primary,border:`2px solid ${m.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))})]}),
411
411
  /* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,marginTop:16,justifyContent:"flex-end"},children:[d&&/* @__PURE__ */Ke("button",{type:"button",onClick:d,style:U,children:f.cancel}),/* @__PURE__ */Ke("button",{type:"button",onClick:async()=>{const e=await P();e&&s&&s(e)},style:{...U,background:m.primary,color:m.bg,borderColor:m.primary},children:f.apply})]})]}):/* @__PURE__ */Ke("div",{className:c,style:O,children:/* @__PURE__ */Ye("div",{style:V,onClick:()=>g.current?.click(),onDrop:e=>{e.preventDefault(),B(!1);const t=e.dataTransfer.files?.[0];t&&t.type.startsWith("image/")&&F(t)},onDragOver:e=>{e.preventDefault(),B(!0)},onDragLeave:()=>B(!1),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),g.current?.click())},"aria-label":"Upload image to edit",children:[
412
412
  /* @__PURE__ */Ke("div",{style:{fontSize:14,marginBottom:6},children:f.drop}),
413
413
  /* @__PURE__ */Ke("button",{type:"button",style:{...U,color:m.primary,borderColor:m.primary},children:f.browse}),
414
- /* @__PURE__ */Ke("input",{ref:g,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>{const t=e.target.files?.[0];t&&F(t)}})]})})});al.displayName="TkxImageEditor";var ll={razorpay:"https://checkout.razorpay.com/v1/checkout.js",stripe:"https://js.stripe.com/v3/",square:"https://web.squarecdn.com/v1/square.js"},sl={razorpay:"Razorpay",stripe:"Stripe",square:"Square"},dl=/^[A-Za-z0-9_-]{20,200}$/,cl={},ul=We(function({config:e,onSuccess:t,onFailure:n,onDismiss:o,children:r,variant:i="primary",size:a="md",disabled:l,className:s,style:d},c){const u=N(),h=$e(),[p,f]=Ve(!1),m="razorpay"===e.provider||"stripe"===e.provider?e.publicKey:e.applicationId;dl.test(m);const g="sm"===a?13:"lg"===a?16:14,x="sm"===a?32:"lg"===a?48:40,b={padding:`${"sm"===a?6:"lg"===a?12:9}px ${"sm"===a?12:"lg"===a?22:16}px`,borderRadius:8,border:"outline"===i?`1.5px solid ${u.primary}`:"none",background:"outline"===i?"transparent":u.primary,color:"outline"===i?u.primary:u.bg,fontSize:g,fontWeight:600,cursor:l?"not-allowed":p?"progress":"pointer",opacity:l?.5:1,minHeight:x,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,transition:"opacity 0.15s, transform 0.05s",...d};/* @__PURE__ */
415
- return Ke("button",{ref:c,type:"button",onClick:async()=>{if(!p&&!l){f(!0);try{if(await function(e){if("undefined"==typeof window)return Promise.resolve();if(window[sl[e]])return Promise.resolve();if(cl[e])return cl[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(/* @__PURE__ */new Error("script-load-failed")));const r=document.createElement("script");r.src=ll[e],r.async=!0,r.dataset.tkxPayment=e,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(/* @__PURE__ */new Error("script-load-failed"))),document.head.appendChild(r)});return cl[e]=t,t}(e.provider),"razorpay"===e.provider){const r=window.Razorpay;if(!r)throw new Error("Razorpay script loaded but global missing");const i=new r({key:e.publicKey,amount:e.amount,currency:e.currency,order_id:e.orderId,name:F(e.brand?.name??"Payment"),description:F(e.brand?.description??""),image:e.brand?.image,prefill:e.prefill,notes:e.notes,theme:{color:e.themeColor??u.primary},handler:e=>{t({provider:"razorpay",paymentId:e.razorpay_payment_id,orderId:e.razorpay_order_id,signature:e.razorpay_signature,raw:e})},modal:{ondismiss:()=>{f(!1),o?.()}}});return i.on("payment.failed",e=>{f(!1),n?.({provider:"razorpay",code:e?.error?.code??"unknown",message:e?.error?.description??"Payment failed",raw:e})}),void i.open()}if("stripe"===e.provider){const t=window.Stripe;if(!t)throw new Error("Stripe script loaded but global missing");const o=await t(e.publicKey).redirectToCheckout({sessionId:e.sessionId});return void(o?.error&&(f(!1),n?.({provider:"stripe",code:o.error.code??"unknown",message:o.error.message??"Stripe checkout failed",raw:o})))}if("square"===e.provider){if(!window.Square)throw new Error("Square script loaded but global missing");const o={applicationId:e.applicationId,locationId:e.locationId,orderId:e.orderId,amount:e.amount,currency:e.currency,success:(n,o)=>t({provider:"square",paymentId:n,orderId:e.orderId,raw:o}),failure:(e,t,o)=>n?.({provider:"square",code:e,message:t,raw:o})};return void window.dispatchEvent(new CustomEvent("tkx-payment-square-init",{detail:o}))}}catch(r){f(!1),n?.({provider:e.provider,code:"sdk-load-failed",message:r?.message??"Unable to load payment SDK",raw:r})}}},disabled:l||p,"aria-busy":p,className:s,style:b,"data-tkx-payment-provider":e.provider,children:p?/* @__PURE__ */Ke("span",{"aria-hidden":"true",children:h.loading}):r??"Pay"})});ul.displayName="TkxPaymentButton";var hl=We(function({label:e,width:t,height:n=180,strokeColor:o,strokeWidth:r=2,backgroundColor:i,onChange:a,disabled:l,className:s,style:d},c){const u=N(),h=$e(),p=Oe(null),f=Oe(null),m=Oe([]),g=Oe(null),x=Oe(1),[b,y]=Ve(t??320),v=o??u.text,w=i??u.surface;Ee(()=>{if(void 0!==t)return;const e=p.current;if(!e||"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(e=>{for(const t of e){const e=Math.floor(t.contentRect.width);e>0&&y(e)}});return n.observe(e),()=>n.disconnect()},[t]);const k=Ae(()=>{const e=f.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const n=x.current;t.fillStyle=w,t.fillRect(0,0,e.width,e.height),t.strokeStyle=v,t.lineWidth=r*n,t.lineCap="round",t.lineJoin="round";for(const o of m.current){if(o.length<2){1===o.length&&(t.beginPath(),t.arc(o[0].x*n,o[0].y*n,r*n/2,0,2*Math.PI),t.fillStyle=v,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()}},[w,v,r]);Ee(()=>{const e=f.current;if(!e)return;const t=window.devicePixelRatio||1;x.current=t,e.width=b*t,e.height=n*t,e.style.width=`${b}px`,e.style.height=`${n}px`,k()},[b,n,k]);const S=e=>{const t=e.currentTarget.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},C=e=>{if(g.current){try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}g.current=null,a?.(f.current?.toDataURL("image/png")??"")}};Fe(c,()=>({clear:()=>{m.current=[],g.current=null,k(),a?.(f.current?.toDataURL("image/png")??"")},undo:()=>{m.current.pop(),k(),a?.(f.current?.toDataURL("image/png")??"")},isEmpty:()=>0===m.current.length,toDataURL:(e="image/png",t=.92)=>f.current?.toDataURL(e,t)??"",toBlob:(e="image/png",t=.92)=>new Promise(n=>{f.current?.toBlob(e=>n(e),e,t)})}),[k,a]);const $={display:"inline-flex",flexDirection:"column",gap:6,width:t??"100%",...d},z={fontSize:13,fontWeight:600,color:u.text},M={borderRadius:8,border:`1px solid ${u.border}`,background:w,cursor:l?"not-allowed":"crosshair",touchAction:"none",display:"block",width:"100%"};/* @__PURE__ */
416
- return Ye("div",{ref:p,className:s,style:$,children:[e&&/* @__PURE__ */Ke("label",{style:z,children:e}),/* @__PURE__ */Ke("canvas",{ref:f,role:"img","aria-label":e??h.uploadFiles??"Signature pad",style:M,onPointerDown:e=>{l||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),g.current=[S(e)],m.current.push(g.current))},onPointerMove:e=>{if(!g.current||l)return;e.preventDefault();const t=S(e),n=g.current,o=n[n.length-1];Math.abs(o.x-t.x)<1&&Math.abs(o.y-t.y)<1||(n.push(t),k())},onPointerUp:C,onPointerCancel:C})]})});hl.displayName="TkxSignaturePad";var pl=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:[]},fl=/^\d{6}$/,ml=We(function({value:e,onChange:t,lookup:n=pl,label:o,showAddressLines:r=!0,disabled:i,className:a,style:l},s){const d=N(),c=$e(),u=He(),[h,p]=Ve([]),[f,m]=Ve(!1),[g,x]=Ve(null);Ee(()=>{if(!e.pin||!fl.test(e.pin))return p([]),void x(null);const t=new AbortController;return m(!0),x(null),n(e.pin,t.signal).then(e=>{p(e),0===e.length&&x(c.noResults)}).catch(e=>{"AbortError"!==e?.name&&(x(e?.message||"Lookup failed"),p([]))}).finally(()=>m(!1)),()=>t.abort()},[e.pin]);const b=n=>{t({...e,pin:n.Pincode,postOffice:n.Name,city:n.District,state:n.State,country:n.Country}),p([])},y=(n,o)=>{t({...e,pin:e.pin??"",[n]:o})},v={display:"flex",flexDirection:"column",gap:8,width:"100%",...l},w={flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4},k={width:"100%",padding:"8px 10px",border:`1px solid ${d.border}`,borderRadius:8,background:d.surface,color:d.text,fontSize:14,outline:"none",minHeight:40},S={border:`1px solid ${d.border}`,borderRadius:8,background:d.surface,maxHeight:200,overflow:"auto",padding:4},C={padding:"8px 10px",borderRadius:6,cursor:"pointer",fontSize:13,color:d.text},$={fontSize:12,color:d.textMuted};/* @__PURE__ */
414
+ /* @__PURE__ */Ke("input",{ref:g,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>{const t=e.target.files?.[0];t&&F(t)}})]})})});al.displayName="TkxImageEditor";var ll={razorpay:"https://checkout.razorpay.com/v1/checkout.js",stripe:"https://js.stripe.com/v3/",square:"https://web.squarecdn.com/v1/square.js"},sl={razorpay:"Razorpay",stripe:"Stripe",square:"Square"},dl=/^[A-Za-z0-9_-]{20,200}$/,cl={},ul=We(function({config:e,onSuccess:t,onFailure:n,onDismiss:o,children:r,variant:i="primary",size:a="md",disabled:l,className:s,style:d},c){const u=M(),h=$e(),[p,f]=Ve(!1),m="razorpay"===e.provider||"stripe"===e.provider?e.publicKey:e.applicationId;dl.test(m);const g="sm"===a?13:"lg"===a?16:14,x="sm"===a?32:"lg"===a?48:40,b={padding:`${"sm"===a?6:"lg"===a?12:9}px ${"sm"===a?12:"lg"===a?22:16}px`,borderRadius:8,border:"outline"===i?`1.5px solid ${u.primary}`:"none",background:"outline"===i?"transparent":u.primary,color:"outline"===i?u.primary:u.bg,fontSize:g,fontWeight:600,cursor:l?"not-allowed":p?"progress":"pointer",opacity:l?.5:1,minHeight:x,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,transition:"opacity 0.15s, transform 0.05s",...d};/* @__PURE__ */
415
+ return Ke("button",{ref:c,type:"button",onClick:async()=>{if(!p&&!l){f(!0);try{if(await function(e){if("undefined"==typeof window)return Promise.resolve();if(window[sl[e]])return Promise.resolve();if(cl[e])return cl[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(/* @__PURE__ */new Error("script-load-failed")));const r=document.createElement("script");r.src=ll[e],r.async=!0,r.dataset.tkxPayment=e,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(/* @__PURE__ */new Error("script-load-failed"))),document.head.appendChild(r)});return cl[e]=t,t}(e.provider),"razorpay"===e.provider){const r=window.Razorpay;if(!r)throw new Error("Razorpay script loaded but global missing");const i=new r({key:e.publicKey,amount:e.amount,currency:e.currency,order_id:e.orderId,name:F(e.brand?.name??"Payment"),description:F(e.brand?.description??""),image:e.brand?.image,prefill:e.prefill,notes:e.notes,theme:{color:e.themeColor??u.primary},handler:e=>{t({provider:"razorpay",paymentId:e.razorpay_payment_id,orderId:e.razorpay_order_id,signature:e.razorpay_signature,raw:e})},modal:{ondismiss:()=>{f(!1),o?.()}}});return i.on("payment.failed",e=>{f(!1),n?.({provider:"razorpay",code:e?.error?.code??"unknown",message:e?.error?.description??"Payment failed",raw:e})}),void i.open()}if("stripe"===e.provider){const t=window.Stripe;if(!t)throw new Error("Stripe script loaded but global missing");const o=await t(e.publicKey).redirectToCheckout({sessionId:e.sessionId});return void(o?.error&&(f(!1),n?.({provider:"stripe",code:o.error.code??"unknown",message:o.error.message??"Stripe checkout failed",raw:o})))}if("square"===e.provider){if(!window.Square)throw new Error("Square script loaded but global missing");const o={applicationId:e.applicationId,locationId:e.locationId,orderId:e.orderId,amount:e.amount,currency:e.currency,success:(n,o)=>t({provider:"square",paymentId:n,orderId:e.orderId,raw:o}),failure:(e,t,o)=>n?.({provider:"square",code:e,message:t,raw:o})};return void window.dispatchEvent(new CustomEvent("tkx-payment-square-init",{detail:o}))}}catch(r){f(!1),n?.({provider:e.provider,code:"sdk-load-failed",message:r?.message??"Unable to load payment SDK",raw:r})}}},disabled:l||p,"aria-busy":p,className:s,style:b,"data-tkx-payment-provider":e.provider,children:p?/* @__PURE__ */Ke("span",{"aria-hidden":"true",children:h.loading}):r??"Pay"})});ul.displayName="TkxPaymentButton";var hl=We(function({label:e,width:t,height:n=180,strokeColor:o,strokeWidth:r=2,backgroundColor:i,onChange:a,disabled:l,className:s,style:d},c){const u=M(),h=$e(),p=Oe(null),f=Oe(null),m=Oe([]),g=Oe(null),x=Oe(1),[b,y]=Ve(t??320),v=o??u.text,w=i??u.surface;Ee(()=>{if(void 0!==t)return;const e=p.current;if(!e||"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(e=>{for(const t of e){const e=Math.floor(t.contentRect.width);e>0&&y(e)}});return n.observe(e),()=>n.disconnect()},[t]);const k=Ae(()=>{const e=f.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const n=x.current;t.fillStyle=w,t.fillRect(0,0,e.width,e.height),t.strokeStyle=v,t.lineWidth=r*n,t.lineCap="round",t.lineJoin="round";for(const o of m.current){if(o.length<2){1===o.length&&(t.beginPath(),t.arc(o[0].x*n,o[0].y*n,r*n/2,0,2*Math.PI),t.fillStyle=v,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()}},[w,v,r]);Ee(()=>{const e=f.current;if(!e)return;const t=window.devicePixelRatio||1;x.current=t,e.width=b*t,e.height=n*t,e.style.width=`${b}px`,e.style.height=`${n}px`,k()},[b,n,k]);const S=e=>{const t=e.currentTarget.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},C=e=>{if(g.current){try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}g.current=null,a?.(f.current?.toDataURL("image/png")??"")}};Fe(c,()=>({clear:()=>{m.current=[],g.current=null,k(),a?.(f.current?.toDataURL("image/png")??"")},undo:()=>{m.current.pop(),k(),a?.(f.current?.toDataURL("image/png")??"")},isEmpty:()=>0===m.current.length,toDataURL:(e="image/png",t=.92)=>f.current?.toDataURL(e,t)??"",toBlob:(e="image/png",t=.92)=>new Promise(n=>{f.current?.toBlob(e=>n(e),e,t)})}),[k,a]);const $={display:"inline-flex",flexDirection:"column",gap:6,width:t??"100%",...d},z={fontSize:13,fontWeight:600,color:u.text},N={borderRadius:8,border:`1px solid ${u.border}`,background:w,cursor:l?"not-allowed":"crosshair",touchAction:"none",display:"block",width:"100%"};/* @__PURE__ */
416
+ return Ye("div",{ref:p,className:s,style:$,children:[e&&/* @__PURE__ */Ke("label",{style:z,children:e}),/* @__PURE__ */Ke("canvas",{ref:f,role:"img","aria-label":e??h.uploadFiles??"Signature pad",style:N,onPointerDown:e=>{l||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),g.current=[S(e)],m.current.push(g.current))},onPointerMove:e=>{if(!g.current||l)return;e.preventDefault();const t=S(e),n=g.current,o=n[n.length-1];Math.abs(o.x-t.x)<1&&Math.abs(o.y-t.y)<1||(n.push(t),k())},onPointerUp:C,onPointerCancel:C})]})});hl.displayName="TkxSignaturePad";var pl=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:[]},fl=/^\d{6}$/,ml=We(function({value:e,onChange:t,lookup:n=pl,label:o,showAddressLines:r=!0,disabled:i,className:a,style:l},s){const d=M(),c=$e(),u=He(),[h,p]=Ve([]),[f,m]=Ve(!1),[g,x]=Ve(null);Ee(()=>{if(!e.pin||!fl.test(e.pin))return p([]),void x(null);const t=new AbortController;return m(!0),x(null),n(e.pin,t.signal).then(e=>{p(e),0===e.length&&x(c.noResults)}).catch(e=>{"AbortError"!==e?.name&&(x(e?.message||"Lookup failed"),p([]))}).finally(()=>m(!1)),()=>t.abort()},[e.pin]);const b=n=>{t({...e,pin:n.Pincode,postOffice:n.Name,city:n.District,state:n.State,country:n.Country}),p([])},y=(n,o)=>{t({...e,pin:e.pin??"",[n]:o})},v={display:"flex",flexDirection:"column",gap:8,width:"100%",...l},w={flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4},k={width:"100%",padding:"8px 10px",border:`1px solid ${d.border}`,borderRadius:8,background:d.surface,color:d.text,fontSize:14,outline:"none",minHeight:40},S={border:`1px solid ${d.border}`,borderRadius:8,background:d.surface,maxHeight:200,overflow:"auto",padding:4},C={padding:"8px 10px",borderRadius:6,cursor:"pointer",fontSize:13,color:d.text},$={fontSize:12,color:d.textMuted};/* @__PURE__ */
417
417
  return Ye("div",{className:a,style:v,children:[o&&/* @__PURE__ */Ke("label",{htmlFor:`${u}-pin`,style:{fontSize:13,fontWeight:600},children:o}),
418
418
  /* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[
419
419
  /* @__PURE__ */Ye("div",{style:{...w,flex:"0 0 140px"},children:[/* @__PURE__ */Ke("span",{style:$,children:"PIN code"}),/* @__PURE__ */Ke("input",{ref:s,id:`${u}-pin`,type:"text",inputMode:"numeric",maxLength:6,autoComplete:"postal-code",value:e.pin??"",onChange:n=>(n=>{const o=n.replace(/\D+/g,"").slice(0,6);t({...e,pin:o})})(n.target.value),disabled:i,"aria-busy":f,"aria-invalid":null!==g,style:k,placeholder:"000000"})]}),
420
420
  /* @__PURE__ */Ye("div",{style:w,children:[/* @__PURE__ */Ke("span",{style:$,children:"City"}),/* @__PURE__ */Ke("input",{type:"text",autoComplete:"address-level2",value:e.city??"",onChange:n=>t({...e,city:n.target.value,pin:e.pin??""}),disabled:i,style:k})]}),
421
421
  /* @__PURE__ */Ye("div",{style:w,children:[/* @__PURE__ */Ke("span",{style:$,children:"State"}),/* @__PURE__ */Ke("input",{type:"text",autoComplete:"address-level1",value:e.state??"",onChange:n=>t({...e,state:n.target.value,pin:e.pin??""}),disabled:i,style:k})]})]}),h.length>1&&/* @__PURE__ */Ke("div",{role:"listbox","aria-label":"Matching post offices",style:S,children:h.map(t=>/* @__PURE__ */Ye("div",{role:"option","aria-selected":e.postOffice===t.Name,onClick:()=>b(t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(t))},tabIndex:0,style:{...C,background:e.postOffice===t.Name?d.surfaceAlt:"transparent"},children:[
422
422
  /* @__PURE__ */Ke("strong",{children:t.Name})," ",
423
- /* @__PURE__ */Ye("span",{style:{color:d.textMuted},children:["· ",t.District,", ",t.State]})]},`${t.Pincode}-${t.Name}`))}),g&&/* @__PURE__ */Ke("div",{role:"alert",style:{fontSize:12,color:d.danger},children:g}),r&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("input",{type:"text",autoComplete:"address-line1",placeholder:"Address line 1",value:e.line1??"",onChange:e=>y("line1",e.target.value),disabled:i,style:k}),/* @__PURE__ */Ke("input",{type:"text",autoComplete:"address-line2",placeholder:"Address line 2 (optional)",value:e.line2??"",onChange:e=>y("line2",e.target.value),disabled:i,style:k})]})]})});ml.displayName="TkxAddressInput";var gl=new Set(["JPY","KRW"]),xl=We(function({value:e,onChange:t,currency:n="INR",locale:o,label:r,min:i,max:a,precision:l,required:s,disabled:d,showSymbol:c=!0,id:u,name:h,className:p,style:f},m){const g=N(),x=He(),b=u??x,y=o??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"}(n),v=l??(gl.has(n)?0:2),w=je(()=>new Intl.NumberFormat(y,{minimumFractionDigits:0,maximumFractionDigits:v,useGrouping:!0}),[y,v]),k=je(()=>{try{return new Intl.NumberFormat(y,{style:"currency",currency:n,currencyDisplay:"narrowSymbol",minimumFractionDigits:0,maximumFractionDigits:0}).formatToParts(0).find(e=>"currency"===e.type)?.value??n}catch{return n}},[y,n]),S=null===e||Number.isNaN(e)?"":w.format(e),C=Ae(e=>{const n=e.replace(/[^\d.,\-]/g,""),o=w.format(1.5),r=o.includes(",")&&!o.includes(".")?",":".",l=n.replace(new RegExp(`[^\\d\\-${r}]`,"g"),"").replace(r,".");if(""===l||"-"===l)return void t(null);const s=Number(l);if(Number.isNaN(s))return;let d=s;void 0!==i&&d<i&&(d=i),void 0!==a&&d>a&&(d=a),t(d)},[w,i,a,t]),$={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:320,...f},z={display:"flex",alignItems:"stretch",border:`1px solid ${g.border}`,borderRadius:8,background:g.surface,overflow:"hidden"},M={display:"inline-flex",alignItems:"center",padding:"0 12px",borderRight:`1px solid ${g.border}`,color:g.textMuted,fontSize:14,fontVariantNumeric:"tabular-nums",background:g.bg},I={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:g.text,background:"transparent",minHeight:40,minWidth:0,textAlign:"right",fontVariantNumeric:"tabular-nums"};/* @__PURE__ */
424
- return Ye("div",{className:p,style:$,children:[r&&/* @__PURE__ */Ye("label",{htmlFor:b,style:{fontSize:13,fontWeight:600,color:g.text},children:[r,s&&/* @__PURE__ */Ke("span",{style:{color:g.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),/* @__PURE__ */Ye("div",{style:z,children:[c&&/* @__PURE__ */Ke("span",{style:M,"aria-hidden":"true",children:k}),/* @__PURE__ */Ke("input",{ref:m,id:b,name:h,type:"text",inputMode:v>0?"decimal":"numeric",value:S,onChange:e=>C(e.target.value),disabled:d,required:s,"aria-label":r??`Amount in ${n}`,style:I})]})]})});xl.displayName="TkxCurrencyInput";var bl=We(function({items:e,onChange:t,renderItem:n,orientation:o="vertical",disabled:r,className:i,style:a,ariaLabel:l},s){const d=N(),c=He(),[u,h]=Ve(null),[p,f]=Ve(null),m=Oe(null),g=Ae((n,o)=>{if(n===o||n<0||o<0||o>=e.length)return;const r=[...e],[i]=r.splice(n,1);r.splice(o,0,i),t(r),m.current&&(m.current.textContent=`Moved item ${n+1} to position ${o+1}`)},[e,t]),x=e=>t=>{!r&&u&&(t.preventDefault(),t.dataTransfer.dropEffect="move",f(e))},b=()=>{h(null),f(null)},y=(t,n)=>t=>{if(r)return;const i="vertical"===o,a=i?"ArrowUp"===t.key:"ArrowLeft"===t.key,l=i?"ArrowDown"===t.key:"ArrowRight"===t.key;a&&n>0?(t.preventDefault(),g(n,n-1)):l&&n<e.length-1&&(t.preventDefault(),g(n,n+1))},v={display:"flex",flexDirection:"vertical"===o?"column":"row",gap:8,...a},w=e=>({cursor:r?"not-allowed":"grab",opacity:u===e?.5:1,transition:"opacity 0.15s, transform 0.05s",outline:p===e&&u!==e?`2px dashed ${d.primary}`:"none",outlineOffset:4,borderRadius:8});/* @__PURE__ */
425
- return Ye(Ue,{children:[/* @__PURE__ */Ke("div",{ref:s,id:c,role:"list","aria-label":l??"Sortable list","aria-orientation":o,className:i,style:v,children:e.map((t,o)=>{/* @__PURE__ */return Ke("div",{role:"listitem",tabIndex:r?-1:0,draggable:!r,"data-tkx-sortable-handle":"true","aria-grabbed":u===t.id,"aria-posinset":o+1,"aria-setsize":e.length,onDragStart:(a=t.id,e=>{r||(h(a),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",a))}),onDragOver:x(t.id),onDragEnd:b,onDrop:(i=t.id,t=>{t.preventDefault(),!r&&u&&(g(e.findIndex(e=>e.id===u),e.findIndex(e=>e.id===i)),h(null),f(null))}),onKeyDown:y(t.id,o),style:w(t.id),children:n(t,o)},t.id);var i,a})}),/* @__PURE__ */Ke("div",{ref:m,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}})]})});bl.displayName="TkxSortable";var yl=["#00f5d4","#7b2ff7","#f72585","#ffbe0b","#06d6a0","#3a86ff"],vl=We(function({trigger:e,particleCount:t=80,spread:n=60,origin:o,colors:r=yl,zIndex:i=9999,className:a,style:l},s){const d=Oe(null),c=Oe([]),u=Oe(null),h=ge(),p=Ae(()=>{const e=d.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)},[]);Ee(()=>(p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)),[p]);const f=Ae(()=>{const e=d.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=c.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()},[]),m=Ae(()=>{const e=c.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&&(c.current=e.filter(e=>e.ttl>0)),f(),u.current=t?requestAnimationFrame(m):null},[f]),g=Ae(e=>{if(!d.current)return;const i=e?.x??o?.x??window.innerWidth/2,a=e?.y??o?.y??window.innerHeight/3,l=[];for(let o=0;o<t;o++){const e=((Math.random()-.5)*n-90)*(Math.PI/180),t=6+6*Math.random();l.push({x:i,y:a,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:r[Math.floor(Math.random()*r.length)],alpha:1,ttl:90+Math.floor(30*Math.random())})}if(c.current.push(...l),h)return f(),void window.setTimeout(()=>{c.current=[],f()},1500);null===u.current&&(u.current=requestAnimationFrame(m))},[t,n,o,r,h,m,f]);return Fe(s,()=>({fire:g}),[g]),Ee(()=>{e&&g()},[e]),Ee(()=>()=>{null!==u.current&&cancelAnimationFrame(u.current)},[]),/* @__PURE__ */Ke("canvas",{ref:d,"aria-hidden":"true",className:a,style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:i,...l}})});vl.displayName="TkxConfetti";var wl="data-tkx-seo";function kl(){"undefined"!=typeof document&&document.querySelectorAll(`[${wl}]`).forEach(e=>e.remove())}function Sl(e,t,n="name"){if("undefined"==typeof document||!t)return;const o=document.createElement("meta");o.setAttribute(n,e),o.content=t,o.setAttribute(wl,"1"),document.head.appendChild(o)}function Cl({title:e,description:t,canonical:n,keywords:o,image:r,twitterSite:i,twitterCreator:a,ogType:l="website",locale:s,robots:d="index, follow, max-snippet:-1, max-image-preview:large",schema:c}){return Ee(()=>{if("undefined"!=typeof document)return kl(),e&&(document.title=e),t&&Sl("description",t),o&&Sl("keywords",o),Sl("robots",d),e&&Sl("og:title",e,"property"),t&&Sl("og:description",t,"property"),Sl("og:type",l,"property"),n&&Sl("og:url",n,"property"),r&&(Sl("og:image",r,"property"),Sl("og:image:width","1200","property"),Sl("og:image:height","630","property")),s&&Sl("og:locale",s,"property"),Sl("twitter:card",r?"summary_large_image":"summary"),e&&Sl("twitter:title",e),t&&Sl("twitter:description",t),r&&Sl("twitter:image",r),i&&Sl("twitter:site",i),a&&Sl("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(wl,"1"),document.head.appendChild(n)}(0,n),c&&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(wl,"1"),document.head.appendChild(e)}}(c),()=>kl()},[e,t,n,o,r,i,a,l,s,d,c]),null}var $l={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}}})},zl=["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"],Nl=["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 Ml(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 Il(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,a=Math.floor(o%360/(360/27))+1;return{tithi:Math.max(1,Math.min(30,i)),nakshatra:a}}(e);return{gregorian:e,display:`${new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(e)} · ${o<=15?"Shukla":"Krishna"} ${zl[o-1]} · ${Nl[r-1]}`,tithi:o,nakshatra:r}}(e,n,o);case"hijri":return Ml(e,n,"islamic-civil");case"hebrew":return Ml(e,n,"hebrew");case"buddhist":return Ml(e,n,"buddhist");default:return function(e,t){return{gregorian:e,display:new Intl.DateTimeFormat(t,{dateStyle:"long"}).format(e)}}(e,n)}}var Ll=We(function({value:e,onChange:t,calendar:n="gregorian",locale:o,tithiResolver:r,label:i,minDate:a,maxDate:l,disabled:s,className:d,style:c},u){const h=N(),p=$e(),f=o??("undefined"!=typeof navigator?navigator.language:"en-US"),[m,g]=Ve(!1),x=je(()=>e?Il(e,n,f,r).display:"",[e,n,f,r]),b={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...c},y={display:"flex",alignItems:"stretch",border:`1px solid ${h.border}`,borderRadius:8,background:h.surface,overflow:"hidden"},v={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:h.text,background:"transparent",minHeight:40,minWidth:0};/* @__PURE__ */
423
+ /* @__PURE__ */Ye("span",{style:{color:d.textMuted},children:["· ",t.District,", ",t.State]})]},`${t.Pincode}-${t.Name}`))}),g&&/* @__PURE__ */Ke("div",{role:"alert",style:{fontSize:12,color:d.danger},children:g}),r&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("input",{type:"text",autoComplete:"address-line1",placeholder:"Address line 1",value:e.line1??"",onChange:e=>y("line1",e.target.value),disabled:i,style:k}),/* @__PURE__ */Ke("input",{type:"text",autoComplete:"address-line2",placeholder:"Address line 2 (optional)",value:e.line2??"",onChange:e=>y("line2",e.target.value),disabled:i,style:k})]})]})});ml.displayName="TkxAddressInput";var gl=new Set(["JPY","KRW"]),xl=We(function({value:e,onChange:t,currency:n="INR",locale:o,label:r,min:i,max:a,precision:l,required:s,disabled:d,showSymbol:c=!0,id:u,name:h,className:p,style:f},m){const g=M(),x=He(),b=u??x,y=o??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"}(n),v=l??(gl.has(n)?0:2),w=je(()=>new Intl.NumberFormat(y,{minimumFractionDigits:0,maximumFractionDigits:v,useGrouping:!0}),[y,v]),k=je(()=>{try{return new Intl.NumberFormat(y,{style:"currency",currency:n,currencyDisplay:"narrowSymbol",minimumFractionDigits:0,maximumFractionDigits:0}).formatToParts(0).find(e=>"currency"===e.type)?.value??n}catch{return n}},[y,n]),S=null===e||Number.isNaN(e)?"":w.format(e),C=Ae(e=>{const n=e.replace(/[^\d.,\-]/g,""),o=w.format(1.5),r=o.includes(",")&&!o.includes(".")?",":".",l=n.replace(new RegExp(`[^\\d\\-${r}]`,"g"),"").replace(r,".");if(""===l||"-"===l)return void t(null);const s=Number(l);if(Number.isNaN(s))return;let d=s;void 0!==i&&d<i&&(d=i),void 0!==a&&d>a&&(d=a),t(d)},[w,i,a,t]),$={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:320,...f},z={display:"flex",alignItems:"stretch",border:`1px solid ${g.border}`,borderRadius:8,background:g.surface,overflow:"hidden"},N={display:"inline-flex",alignItems:"center",padding:"0 12px",borderRight:`1px solid ${g.border}`,color:g.textMuted,fontSize:14,fontVariantNumeric:"tabular-nums",background:g.bg},I={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:g.text,background:"transparent",minHeight:40,minWidth:0,textAlign:"right",fontVariantNumeric:"tabular-nums"};/* @__PURE__ */
424
+ return Ye("div",{className:p,style:$,children:[r&&/* @__PURE__ */Ye("label",{htmlFor:b,style:{fontSize:13,fontWeight:600,color:g.text},children:[r,s&&/* @__PURE__ */Ke("span",{style:{color:g.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),/* @__PURE__ */Ye("div",{style:z,children:[c&&/* @__PURE__ */Ke("span",{style:N,"aria-hidden":"true",children:k}),/* @__PURE__ */Ke("input",{ref:m,id:b,name:h,type:"text",inputMode:v>0?"decimal":"numeric",value:S,onChange:e=>C(e.target.value),disabled:d,required:s,"aria-label":r??`Amount in ${n}`,style:I})]})]})});xl.displayName="TkxCurrencyInput";var bl=We(function({items:e,onChange:t,renderItem:n,orientation:o="vertical",disabled:r,className:i,style:a,ariaLabel:l},s){const d=M(),c=He(),[u,h]=Ve(null),[p,f]=Ve(null),m=Oe(null),g=Ae((n,o)=>{if(n===o||n<0||o<0||o>=e.length)return;const r=[...e],[i]=r.splice(n,1);r.splice(o,0,i),t(r),m.current&&(m.current.textContent=`Moved item ${n+1} to position ${o+1}`)},[e,t]),x=e=>t=>{!r&&u&&(t.preventDefault(),t.dataTransfer.dropEffect="move",f(e))},b=()=>{h(null),f(null)},y=(t,n)=>t=>{if(r)return;const i="vertical"===o,a=i?"ArrowUp"===t.key:"ArrowLeft"===t.key,l=i?"ArrowDown"===t.key:"ArrowRight"===t.key;a&&n>0?(t.preventDefault(),g(n,n-1)):l&&n<e.length-1&&(t.preventDefault(),g(n,n+1))},v={display:"flex",flexDirection:"vertical"===o?"column":"row",gap:8,...a},w=e=>({cursor:r?"not-allowed":"grab",opacity:u===e?.5:1,transition:"opacity 0.15s, transform 0.05s",outline:p===e&&u!==e?`2px dashed ${d.primary}`:"none",outlineOffset:4,borderRadius:8});/* @__PURE__ */
425
+ return Ye(Ue,{children:[/* @__PURE__ */Ke("div",{ref:s,id:c,role:"list","aria-label":l??"Sortable list","aria-orientation":o,className:i,style:v,children:e.map((t,o)=>{/* @__PURE__ */return Ke("div",{role:"listitem",tabIndex:r?-1:0,draggable:!r,"data-tkx-sortable-handle":"true","aria-grabbed":u===t.id,"aria-posinset":o+1,"aria-setsize":e.length,onDragStart:(a=t.id,e=>{r||(h(a),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",a))}),onDragOver:x(t.id),onDragEnd:b,onDrop:(i=t.id,t=>{t.preventDefault(),!r&&u&&(g(e.findIndex(e=>e.id===u),e.findIndex(e=>e.id===i)),h(null),f(null))}),onKeyDown:y(t.id,o),style:w(t.id),children:n(t,o)},t.id);var i,a})}),/* @__PURE__ */Ke("div",{ref:m,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}})]})});bl.displayName="TkxSortable";var yl=["#00f5d4","#7b2ff7","#f72585","#ffbe0b","#06d6a0","#3a86ff"],vl=We(function({trigger:e,particleCount:t=80,spread:n=60,origin:o,colors:r=yl,zIndex:i=9999,className:a,style:l},s){const d=Oe(null),c=Oe([]),u=Oe(null),h=ge(),p=Ae(()=>{const e=d.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)},[]);Ee(()=>(p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)),[p]);const f=Ae(()=>{const e=d.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=c.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()},[]),m=Ae(()=>{const e=c.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&&(c.current=e.filter(e=>e.ttl>0)),f(),u.current=t?requestAnimationFrame(m):null},[f]),g=Ae(e=>{if(!d.current)return;const i=e?.x??o?.x??window.innerWidth/2,a=e?.y??o?.y??window.innerHeight/3,l=[];for(let o=0;o<t;o++){const e=((Math.random()-.5)*n-90)*(Math.PI/180),t=6+6*Math.random();l.push({x:i,y:a,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:r[Math.floor(Math.random()*r.length)],alpha:1,ttl:90+Math.floor(30*Math.random())})}if(c.current.push(...l),h)return f(),void window.setTimeout(()=>{c.current=[],f()},1500);null===u.current&&(u.current=requestAnimationFrame(m))},[t,n,o,r,h,m,f]);return Fe(s,()=>({fire:g}),[g]),Ee(()=>{e&&g()},[e]),Ee(()=>()=>{null!==u.current&&cancelAnimationFrame(u.current)},[]),/* @__PURE__ */Ke("canvas",{ref:d,"aria-hidden":"true",className:a,style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:i,...l}})});vl.displayName="TkxConfetti";var wl="data-tkx-seo";function kl(){"undefined"!=typeof document&&document.querySelectorAll(`[${wl}]`).forEach(e=>e.remove())}function Sl(e,t,n="name"){if("undefined"==typeof document||!t)return;const o=document.createElement("meta");o.setAttribute(n,e),o.content=t,o.setAttribute(wl,"1"),document.head.appendChild(o)}function Cl({title:e,description:t,canonical:n,keywords:o,image:r,twitterSite:i,twitterCreator:a,ogType:l="website",locale:s,robots:d="index, follow, max-snippet:-1, max-image-preview:large",schema:c}){return Ee(()=>{if("undefined"!=typeof document)return kl(),e&&(document.title=e),t&&Sl("description",t),o&&Sl("keywords",o),Sl("robots",d),e&&Sl("og:title",e,"property"),t&&Sl("og:description",t,"property"),Sl("og:type",l,"property"),n&&Sl("og:url",n,"property"),r&&(Sl("og:image",r,"property"),Sl("og:image:width","1200","property"),Sl("og:image:height","630","property")),s&&Sl("og:locale",s,"property"),Sl("twitter:card",r?"summary_large_image":"summary"),e&&Sl("twitter:title",e),t&&Sl("twitter:description",t),r&&Sl("twitter:image",r),i&&Sl("twitter:site",i),a&&Sl("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(wl,"1"),document.head.appendChild(n)}(0,n),c&&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(wl,"1"),document.head.appendChild(e)}}(c),()=>kl()},[e,t,n,o,r,i,a,l,s,d,c]),null}var $l={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}}})},zl=["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"],Ml=["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 Nl(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 Il(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,a=Math.floor(o%360/(360/27))+1;return{tithi:Math.max(1,Math.min(30,i)),nakshatra:a}}(e);return{gregorian:e,display:`${new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(e)} · ${o<=15?"Shukla":"Krishna"} ${zl[o-1]} · ${Ml[r-1]}`,tithi:o,nakshatra:r}}(e,n,o);case"hijri":return Nl(e,n,"islamic-civil");case"hebrew":return Nl(e,n,"hebrew");case"buddhist":return Nl(e,n,"buddhist");default:return function(e,t){return{gregorian:e,display:new Intl.DateTimeFormat(t,{dateStyle:"long"}).format(e)}}(e,n)}}var Rl=We(function({value:e,onChange:t,calendar:n="gregorian",locale:o,tithiResolver:r,label:i,minDate:a,maxDate:l,disabled:s,className:d,style:c},u){const h=M(),p=$e(),f=o??("undefined"!=typeof navigator?navigator.language:"en-US"),[m,g]=Ve(!1),x=je(()=>e?Il(e,n,f,r).display:"",[e,n,f,r]),b={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...c},y={display:"flex",alignItems:"stretch",border:`1px solid ${h.border}`,borderRadius:8,background:h.surface,overflow:"hidden"},v={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:h.text,background:"transparent",minHeight:40,minWidth:0};/* @__PURE__ */
426
426
  return Ye("div",{className:d,style:b,children:[i&&/* @__PURE__ */Ke("label",{style:{fontSize:13,fontWeight:600,color:h.text},children:i}),
427
427
  /* @__PURE__ */Ye("div",{style:y,children:[/* @__PURE__ */Ke("input",{ref:u,type:"text",readOnly:!0,value:x,onClick:()=>!s&&g(!0),onFocus:()=>!s&&g(!0),disabled:s,placeholder:p.selectDate,"aria-label":i??p.selectDate,style:v}),/* @__PURE__ */Ke("input",{type:"date",value:e?e.toISOString().slice(0,10):"",onChange:e=>(e=>{if(!e)return;const o=/* @__PURE__ */new Date(`${e}T00:00:00`);Number.isNaN(o.getTime())||a&&o<a||l&&o>l||(t(Il(o,n,f,r)),g(!1))})(e.target.value),min:a?a.toISOString().slice(0,10):void 0,max:l?l.toISOString().slice(0,10):void 0,disabled:s,"aria-hidden":"true",tabIndex:-1,style:{width:36,border:"none",borderLeft:`1px solid ${h.border}`,padding:0,background:h.bg,color:h.text,cursor:s?"not-allowed":"pointer"}})]}),m&&e&&"gregorian"!==n&&/* @__PURE__ */Ye("div",{role:"status",style:{padding:"6px 10px",borderRadius:6,background:h.surfaceAlt,fontSize:12,color:h.textMuted},children:[
428
- /* @__PURE__ */Ye("strong",{style:{color:h.text},children:[n,":"]})," ",x]})]})});Ll.displayName="TkxCalendarLunar";var Rl=We(function({items:e,currency:t,locale:n,taxRate:o=0,shipping:r=0,paymentConfigFor:i,onComplete:a,onCancel:l,initialAddress:s={},className:d,style:c},u){const h=N(),p=$e(),[f,m]=Ve("address"),[g,x]=Ve(s),[b,y]=Ve(null),[v,w]=Ve(null),k=e.reduce((e,t)=>e+t.quantity*t.unitPrice,0),S=k*o,C=k+S+r,$=e=>{try{return new Intl.NumberFormat(n??"en-IN",{style:"currency",currency:t}).format(e)}catch{return`${t} ${e.toFixed(2)}`}},z=Boolean(g.pin&&6===g.pin.length&&g.line1&&g.city),M={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 320px",gap:24,maxWidth:960,width:"100%",...c},I={border:`1px solid ${h.border}`,borderRadius:12,padding:20,background:h.surface},L={...I,position:"sticky",top:16,height:"fit-content"},R={fontSize:11,fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",color:h.textMuted,marginBottom:12};/* @__PURE__ */
429
- return Ye("div",{ref:u,className:d,style:M,children:[/* @__PURE__ */Ye("div",{style:I,children:[
430
- /* @__PURE__ */Ye("div",{style:R,children:["Step ","address"===f?1:"payment"===f?2:3," of 3"]}),"address"===f&&/* @__PURE__ */Ye(Ue,{children:[
428
+ /* @__PURE__ */Ye("strong",{style:{color:h.text},children:[n,":"]})," ",x]})]})});Rl.displayName="TkxCalendarLunar";var Tl=We(function({items:e,currency:t,locale:n,taxRate:o=0,shipping:r=0,paymentConfigFor:i,onComplete:a,onCancel:l,initialAddress:s={},className:d,style:c},u){const h=M(),p=$e(),[f,m]=Ve("address"),[g,x]=Ve(s),[b,y]=Ve(null),[v,w]=Ve(null),k=e.reduce((e,t)=>e+t.quantity*t.unitPrice,0),S=k*o,C=k+S+r,$=e=>{try{return new Intl.NumberFormat(n??"en-IN",{style:"currency",currency:t}).format(e)}catch{return`${t} ${e.toFixed(2)}`}},z=Boolean(g.pin&&6===g.pin.length&&g.line1&&g.city),N={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 320px",gap:24,maxWidth:960,width:"100%",...c},I={border:`1px solid ${h.border}`,borderRadius:12,padding:20,background:h.surface},R={...I,position:"sticky",top:16,height:"fit-content"},T={fontSize:11,fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",color:h.textMuted,marginBottom:12};/* @__PURE__ */
429
+ return Ye("div",{ref:u,className:d,style:N,children:[/* @__PURE__ */Ye("div",{style:I,children:[
430
+ /* @__PURE__ */Ye("div",{style:T,children:["Step ","address"===f?1:"payment"===f?2:3," of 3"]}),"address"===f&&/* @__PURE__ */Ye(Ue,{children:[
431
431
  /* @__PURE__ */Ke("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Shipping address"}),
432
432
  /* @__PURE__ */Ke(ml,{value:g,onChange:x}),v&&/* @__PURE__ */Ke("div",{role:"alert",style:{marginTop:12,fontSize:13,color:h.danger},children:v}),
433
433
  /* @__PURE__ */Ye("div",{style:{marginTop:20,display:"flex",justifyContent:"flex-end",gap:8},children:[l&&/* @__PURE__ */Ke("button",{type:"button",onClick:l,style:{padding:"8px 14px",borderRadius:6,border:`1px solid ${h.border}`,background:"transparent",color:h.text,cursor:"pointer",fontSize:13,fontWeight:600},children:p.cancel}),/* @__PURE__ */Ke("button",{type:"button",onClick:async()=>{if(z){w(null);try{y(await i(g)),m("payment")}catch(e){w(e?.message??"Could not initialise payment")}}else w(p.fieldRequired??"Address incomplete")},disabled:!z,style:{padding:"8px 14px",borderRadius:6,border:"none",background:z?h.primary:h.border,color:z?h.bg:h.textMuted,cursor:z?"pointer":"not-allowed",fontSize:13,fontWeight:600,minHeight:36},children:"Continue to payment"})]})]}),"payment"===f&&b&&/* @__PURE__ */Ye(Ue,{children:[
434
434
  /* @__PURE__ */Ke("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Payment"}),
435
435
  /* @__PURE__ */Ye("p",{style:{margin:"0 0 16px",color:h.textMuted,fontSize:14},children:["Total ",/* @__PURE__ */Ke("strong",{style:{color:h.text,fontSize:18},children:$(C)})]}),
436
436
  /* @__PURE__ */Ye(ul,{config:b,onSuccess:e=>{m("confirm"),a({address:g,payment:e})},onFailure:e=>{w(e.message)},size:"lg",children:["Pay ",$(C)]}),v&&/* @__PURE__ */Ke("div",{role:"alert",style:{marginTop:12,fontSize:13,color:h.danger},children:v}),
437
- /* @__PURE__ */Ke("div",{style:{marginTop:20},children:/* @__PURE__ */Ke("button",{type:"button",onClick:()=>m("address"),style:{padding:"6px 10px",border:"none",background:"transparent",color:h.textMuted,cursor:"pointer",fontSize:13},children:"← Back to address"})})]}),"confirm"===f&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Order confirmed"}),/* @__PURE__ */Ke("p",{style:{color:h.textMuted,fontSize:14,lineHeight:1.6},children:"Thank you. A receipt has been emailed to you. Your order will ship shortly."})]})]}),/* @__PURE__ */Ye("div",{style:L,children:[
438
- /* @__PURE__ */Ke("div",{style:R,children:"Order summary"}),e.map(e=>/* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",padding:"6px 0",fontSize:13},children:[/* @__PURE__ */Ye("span",{style:{color:h.text},children:[e.label," ",
437
+ /* @__PURE__ */Ke("div",{style:{marginTop:20},children:/* @__PURE__ */Ke("button",{type:"button",onClick:()=>m("address"),style:{padding:"6px 10px",border:"none",background:"transparent",color:h.textMuted,cursor:"pointer",fontSize:13},children:"← Back to address"})})]}),"confirm"===f&&/* @__PURE__ */Ye(Ue,{children:[/* @__PURE__ */Ke("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Order confirmed"}),/* @__PURE__ */Ke("p",{style:{color:h.textMuted,fontSize:14,lineHeight:1.6},children:"Thank you. A receipt has been emailed to you. Your order will ship shortly."})]})]}),/* @__PURE__ */Ye("div",{style:R,children:[
438
+ /* @__PURE__ */Ke("div",{style:T,children:"Order summary"}),e.map(e=>/* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",padding:"6px 0",fontSize:13},children:[/* @__PURE__ */Ye("span",{style:{color:h.text},children:[e.label," ",
439
439
  /* @__PURE__ */Ye("span",{style:{color:h.textMuted},children:["×",e.quantity]})]}),/* @__PURE__ */Ke("span",{style:{color:h.text,fontVariantNumeric:"tabular-nums"},children:$(e.quantity*e.unitPrice)})]},e.id)),
440
440
  /* @__PURE__ */Ke("hr",{style:{margin:"12px 0",border:0,borderTop:`1px solid ${h.border}`}}),o>0&&/* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13,color:h.textMuted},children:[/* @__PURE__ */Ye("span",{children:["Tax (",(100*o).toFixed(0),"%)"]}),/* @__PURE__ */Ke("span",{children:$(S)})]}),r>0&&/* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13,color:h.textMuted},children:[/* @__PURE__ */Ke("span",{children:"Shipping"}),/* @__PURE__ */Ke("span",{children:$(r)})]}),
441
- /* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",marginTop:12,paddingTop:12,borderTop:`2px solid ${h.text}`,fontSize:16,fontWeight:700},children:[/* @__PURE__ */Ke("span",{children:"Total"}),/* @__PURE__ */Ke("span",{children:$(C)})]})]})]})});Rl.displayName="TkxCheckout";var Dl=[[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]],Tl=[[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 Wl(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=Dl[n][Tl[r%8][parseInt(o[r],10)]];return 0===n}function Al(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 Bl(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 El=We(function({value:e,defaultValue:t,onChange:n,label:o,mask:r=!0,disabled:i,required:a,id:l,name:s,className:d,style:c},u){const h=N(),p=$e(),f=He(),m=l??f,g=void 0!==e,[x,b]=Ve(()=>(t??"").replace(/\D+/g,"").slice(0,12)),y=g?(e??"").replace(/\D+/g,"").slice(0,12):x,v=r?Bl(y):Al(y),w=Wl(y),k={fontSize:13,fontWeight:600,color:h.text},S={width:"100%",padding:"0 12px",border:`1px solid ${12!==y.length||w?h.border:h.danger}`,borderRadius:8,background:h.surface,color:h.text,fontSize:14,minHeight:40,outline:"none",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",letterSpacing:1.5};/* @__PURE__ */
441
+ /* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",marginTop:12,paddingTop:12,borderTop:`2px solid ${h.text}`,fontSize:16,fontWeight:700},children:[/* @__PURE__ */Ke("span",{children:"Total"}),/* @__PURE__ */Ke("span",{children:$(C)})]})]})]})});Tl.displayName="TkxCheckout";var Dl=[[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]],Ll=[[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 Wl(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=Dl[n][Ll[r%8][parseInt(o[r],10)]];return 0===n}function Al(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 Bl(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 El=We(function({value:e,defaultValue:t,onChange:n,label:o,mask:r=!0,disabled:i,required:a,id:l,name:s,className:d,style:c},u){const h=M(),p=$e(),f=He(),m=l??f,g=void 0!==e,[x,b]=Ve(()=>(t??"").replace(/\D+/g,"").slice(0,12)),y=g?(e??"").replace(/\D+/g,"").slice(0,12):x,v=r?Bl(y):Al(y),w=Wl(y),k={fontSize:13,fontWeight:600,color:h.text},S={width:"100%",padding:"0 12px",border:`1px solid ${12!==y.length||w?h.border:h.danger}`,borderRadius:8,background:h.surface,color:h.text,fontSize:14,minHeight:40,outline:"none",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",letterSpacing:1.5};/* @__PURE__ */
442
442
  return Ye("div",{className:d,style:{display:"flex",flexDirection:"column",gap:6,...c},children:[o&&/* @__PURE__ */Ye("label",{htmlFor:m,style:k,children:[o,a&&/* @__PURE__ */Ke("span",{style:{color:h.danger,marginLeft:4},children:"*"})]}),
443
- /* @__PURE__ */Ke("input",{ref:u,id:m,name:s,type:"text",inputMode:"numeric",autoComplete:"off",maxLength:14,value:v,onChange:e=>(e=>{const t=e.replace(/\D+/g,"").slice(0,12);g||b(t),n?.({raw:Al(t),digits:t,display:r?Bl(t):Al(t),valid:Wl(t)})})(e.target.value),disabled:i,required:a,"aria-invalid":12===y.length&&!w,"aria-describedby":12!==y.length||w?void 0:`${m}-err`,style:S,placeholder:"XXXX XXXX XXXX"}),12===y.length&&!w&&/* @__PURE__ */Ke("div",{id:`${m}-err`,role:"alert",style:{fontSize:12,color:h.danger},children:p.invalidFormat??"Invalid Aadhaar — checksum mismatch."}),y.length>0&&y.length<12&&/* @__PURE__ */Ye("div",{style:{fontSize:12,color:h.textMuted},children:[12-y.length," digit",12-y.length==1?"":"s"," remaining"]})]})});El.displayName="TkxAadhaarInput";var Hl=/^[A-Z]{5}[0-9]{4}[A-Z]$/;function Fl(e){const t=e.toUpperCase().trim();return!!Hl.test(t)&&"PFCHATBLJG".includes(t[3])}var jl=We(function({value:e,defaultValue:t,onChange:n,label:o,disabled:r,required:i,id:a,name:l,className:s,style:d},c){const u=N(),h=$e(),p=He(),f=a??p,m=void 0!==e,[g,x]=Ve((t??"").toUpperCase().slice(0,10)),b=(m?e??"":g).toUpperCase().slice(0,10),y=Fl(b);/* @__PURE__ */
443
+ /* @__PURE__ */Ke("input",{ref:u,id:m,name:s,type:"text",inputMode:"numeric",autoComplete:"off",maxLength:14,value:v,onChange:e=>(e=>{const t=e.replace(/\D+/g,"").slice(0,12);g||b(t),n?.({raw:Al(t),digits:t,display:r?Bl(t):Al(t),valid:Wl(t)})})(e.target.value),disabled:i,required:a,"aria-invalid":12===y.length&&!w,"aria-describedby":12!==y.length||w?void 0:`${m}-err`,style:S,placeholder:"XXXX XXXX XXXX"}),12===y.length&&!w&&/* @__PURE__ */Ke("div",{id:`${m}-err`,role:"alert",style:{fontSize:12,color:h.danger},children:p.invalidFormat??"Invalid Aadhaar — checksum mismatch."}),y.length>0&&y.length<12&&/* @__PURE__ */Ye("div",{style:{fontSize:12,color:h.textMuted},children:[12-y.length," digit",12-y.length==1?"":"s"," remaining"]})]})});El.displayName="TkxAadhaarInput";var Hl=/^[A-Z]{5}[0-9]{4}[A-Z]$/;function Fl(e){const t=e.toUpperCase().trim();return!!Hl.test(t)&&"PFCHATBLJG".includes(t[3])}var jl=We(function({value:e,defaultValue:t,onChange:n,label:o,disabled:r,required:i,id:a,name:l,className:s,style:d},c){const u=M(),h=$e(),p=He(),f=a??p,m=void 0!==e,[g,x]=Ve((t??"").toUpperCase().slice(0,10)),b=(m?e??"":g).toUpperCase().slice(0,10),y=Fl(b);/* @__PURE__ */
444
444
  return Ye("div",{className:s,style:{display:"flex",flexDirection:"column",gap:6,...d},children:[o&&/* @__PURE__ */Ye("label",{htmlFor:f,style:{fontSize:13,fontWeight:600,color:u.text},children:[o,i&&/* @__PURE__ */Ke("span",{style:{color:u.danger,marginLeft:4},children:"*"})]}),
445
- /* @__PURE__ */Ke("input",{ref:c,id:f,name:l,type:"text",inputMode:"text",autoComplete:"off",maxLength:10,value:b,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);m||x(t),n?.({raw:e,normalised:t,valid:Fl(t)})})(e.target.value),disabled:r,required:i,"aria-invalid":10===b.length&&!y,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==b.length||y?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:2,outline:"none",textTransform:"uppercase"},placeholder:"ABCDE1234F"}),10===b.length&&!y&&/* @__PURE__ */Ke("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid PAN format."})]})});jl.displayName="TkxPanInput";var Pl=/^[A-Z]{3}[0-9]{7}$/;function Ol(e){const t=e.toUpperCase().trim();return Pl.test(t)}var Vl=We(function({value:e,defaultValue:t,onChange:n,label:o,disabled:r,required:i,id:a,name:l,className:s,style:d},c){const u=N(),h=$e(),p=He(),f=a??p,m=void 0!==e,[g,x]=Ve((t??"").toUpperCase().slice(0,10)),b=(m?e??"":g).toUpperCase().slice(0,10),y=Ol(b);/* @__PURE__ */
445
+ /* @__PURE__ */Ke("input",{ref:c,id:f,name:l,type:"text",inputMode:"text",autoComplete:"off",maxLength:10,value:b,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);m||x(t),n?.({raw:e,normalised:t,valid:Fl(t)})})(e.target.value),disabled:r,required:i,"aria-invalid":10===b.length&&!y,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==b.length||y?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:2,outline:"none",textTransform:"uppercase"},placeholder:"ABCDE1234F"}),10===b.length&&!y&&/* @__PURE__ */Ke("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid PAN format."})]})});jl.displayName="TkxPanInput";var Pl=/^[A-Z]{3}[0-9]{7}$/;function Ol(e){const t=e.toUpperCase().trim();return Pl.test(t)}var Vl=We(function({value:e,defaultValue:t,onChange:n,label:o,disabled:r,required:i,id:a,name:l,className:s,style:d},c){const u=M(),h=$e(),p=He(),f=a??p,m=void 0!==e,[g,x]=Ve((t??"").toUpperCase().slice(0,10)),b=(m?e??"":g).toUpperCase().slice(0,10),y=Ol(b);/* @__PURE__ */
446
446
  return Ye("div",{className:s,style:{display:"flex",flexDirection:"column",gap:6,...d},children:[o&&/* @__PURE__ */Ye("label",{htmlFor:f,style:{fontSize:13,fontWeight:600,color:u.text},children:[o,i&&/* @__PURE__ */Ke("span",{style:{color:u.danger,marginLeft:4},children:"*"})]}),
447
- /* @__PURE__ */Ke("input",{ref:c,id:f,name:l,type:"text",autoComplete:"off",maxLength:10,value:b,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);m||x(t),n?.({raw:e,normalised:t,valid:Ol(t)})})(e.target.value),disabled:r,required:i,"aria-invalid":10===b.length&&!y,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==b.length||y?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.5,outline:"none",textTransform:"uppercase"},placeholder:"ABC1234567"}),10===b.length&&!y&&/* @__PURE__ */Ke("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid Voter ID format."})]})});Vl.displayName="TkxVoterIdInput";var Ul=15;function Kl(e){const t=e.toUpperCase().replace(/[\s-]/g,"");return t.length===Ul&&/^[A-Z]{2}[0-9]{13}$/.test(t)}function Yl(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 Xl=We(function({value:e,defaultValue:t,onChange:n,label:o,disabled:r,required:i,id:a,name:l,className:s,style:d},c){const u=N(),h=$e(),p=He(),f=a??p,m=void 0!==e,[g,x]=Ve((t??"").toUpperCase()),b=m?e??"":g,y=b.toUpperCase().replace(/[\s-]/g,"").slice(0,Ul),v=Kl(y);/* @__PURE__ */
447
+ /* @__PURE__ */Ke("input",{ref:c,id:f,name:l,type:"text",autoComplete:"off",maxLength:10,value:b,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);m||x(t),n?.({raw:e,normalised:t,valid:Ol(t)})})(e.target.value),disabled:r,required:i,"aria-invalid":10===b.length&&!y,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==b.length||y?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.5,outline:"none",textTransform:"uppercase"},placeholder:"ABC1234567"}),10===b.length&&!y&&/* @__PURE__ */Ke("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid Voter ID format."})]})});Vl.displayName="TkxVoterIdInput";var Ul=15;function Kl(e){const t=e.toUpperCase().replace(/[\s-]/g,"");return t.length===Ul&&/^[A-Z]{2}[0-9]{13}$/.test(t)}function Yl(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 Xl=We(function({value:e,defaultValue:t,onChange:n,label:o,disabled:r,required:i,id:a,name:l,className:s,style:d},c){const u=M(),h=$e(),p=He(),f=a??p,m=void 0!==e,[g,x]=Ve((t??"").toUpperCase()),b=m?e??"":g,y=b.toUpperCase().replace(/[\s-]/g,"").slice(0,Ul),v=Kl(y);/* @__PURE__ */
448
448
  return Ye("div",{className:s,style:{display:"flex",flexDirection:"column",gap:6,...d},children:[o&&/* @__PURE__ */Ye("label",{htmlFor:f,style:{fontSize:13,fontWeight:600,color:u.text},children:[o,i&&/* @__PURE__ */Ke("span",{style:{color:u.danger,marginLeft:4},children:"*"})]}),
449
- /* @__PURE__ */Ke("input",{ref:c,id:f,name:l,type:"text",autoComplete:"off",maxLength:20,value:b,onChange:e=>(e=>{const t=e.toUpperCase();m||x(t);const o=t.replace(/[\s-]/g,"").slice(0,Ul);n?.({raw:e,normalised:o,pretty:Yl(o),valid:Kl(o)})})(e.target.value),disabled:r,required:i,"aria-invalid":y.length===Ul&&!v,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${y.length!==Ul||v?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.2,outline:"none",textTransform:"uppercase"},placeholder:"MH-12-2010-0012345"}),y.length===Ul&&!v&&/* @__PURE__ */Ke("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid Driving Licence format."})]})});function ql(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)}`}}Xl.displayName="TkxDrivingLicenceInput";var Gl=We(function({plans:e,cycle:t,selectedId:n,onSelect:o,className:r,style:i},a){const l=N();/* @__PURE__ */
449
+ /* @__PURE__ */Ke("input",{ref:c,id:f,name:l,type:"text",autoComplete:"off",maxLength:20,value:b,onChange:e=>(e=>{const t=e.toUpperCase();m||x(t);const o=t.replace(/[\s-]/g,"").slice(0,Ul);n?.({raw:e,normalised:o,pretty:Yl(o),valid:Kl(o)})})(e.target.value),disabled:r,required:i,"aria-invalid":y.length===Ul&&!v,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${y.length!==Ul||v?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.2,outline:"none",textTransform:"uppercase"},placeholder:"MH-12-2010-0012345"}),y.length===Ul&&!v&&/* @__PURE__ */Ke("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid Driving Licence format."})]})});function ql(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)}`}}Xl.displayName="TkxDrivingLicenceInput";var Gl=We(function({plans:e,cycle:t,selectedId:n,onSelect:o,className:r,style:i},a){const l=M();/* @__PURE__ */
450
450
  return Ke("div",{ref:a,className:r,style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:16,...i},role:"radiogroup","aria-label":"Plans",children:e.map(e=>{const r=e.id===n;/* @__PURE__ */
451
451
  return Ye("button",{type:"button",role:"radio","aria-checked":r,disabled:e.disabled,onClick:()=>!e.disabled&&o?.(e),style:{position:"relative",padding:20,borderRadius:12,border:`${e.highlighted?2:1}px solid ${r||e.highlighted?l.primary:l.border}`,background:l.surface,color:l.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&&/* @__PURE__ */Ke("span",{style:{position:"absolute",top:-10,right:16,background:l.primary,color:l.bg,fontSize:11,fontWeight:700,padding:"2px 8px",borderRadius:4,letterSpacing:.4,textTransform:"uppercase"},"aria-hidden":"true",children:"Most popular"}),
452
452
  /* @__PURE__ */Ke("div",{style:{fontSize:12,fontWeight:700,color:l.textMuted,textTransform:"uppercase",letterSpacing:.5},children:e.name}),e.tagline&&/* @__PURE__ */Ke("div",{style:{fontSize:12,color:l.textMuted,marginTop:2},children:e.tagline}),
453
453
  /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"baseline",gap:4,marginTop:12},children:[/* @__PURE__ */Ke("span",{style:{fontSize:32,fontWeight:800,color:l.text},children:ql(e.prices[t],e.currency,e.locale)}),/* @__PURE__ */Ye("span",{style:{fontSize:12,color:l.textMuted},children:["/ ","monthly"===t?"mo":"yr"]})]}),
454
454
  /* @__PURE__ */Ke("ul",{style:{listStyle:"none",padding:0,margin:"16px 0 0",fontSize:13,lineHeight:1.7},children:e.features.map(e=>/* @__PURE__ */Ye("li",{style:{display:"flex",gap:6,alignItems:"flex-start",color:l.text},children:[/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{color:l.success},children:"✓"}),/* @__PURE__ */Ke("span",{children:e})]},e))}),
455
- /* @__PURE__ */Ke("div",{style:{marginTop:16,padding:"8px 12px",borderRadius:6,background:r?l.primary:"transparent",color:r?l.bg:l.primary,border:`1px solid ${l.primary}`,textAlign:"center",fontWeight:600,fontSize:13},children:e.ctaLabel??(r?"Selected":`Choose ${e.name}`)})]},e.id)})})});function _l({value:e,onChange:t,annualSavingsLabel:n,className:o,style:r}){const i=N(),a={display:"inline-flex",alignItems:"center",gap:8,padding:4,border:`1px solid ${i.border}`,borderRadius:999,background:i.surface,...r},l=e=>({padding:"6px 16px",borderRadius:999,fontSize:13,fontWeight:600,background:e?i.primary:"transparent",color:e?i.bg:i.text,border:"none",cursor:"pointer",transition:"background 0.15s, color 0.15s",display:"inline-flex",alignItems:"center",gap:6});/* @__PURE__ */
456
- return Ye("div",{role:"radiogroup","aria-label":"Billing cycle",className:o,style:a,children:[/* @__PURE__ */Ke("button",{type:"button",role:"radio","aria-checked":"monthly"===e,onClick:()=>t("monthly"),style:l("monthly"===e),children:"Monthly"}),/* @__PURE__ */Ye("button",{type:"button",role:"radio","aria-checked":"annual"===e,onClick:()=>t("annual"),style:l("annual"===e),children:["Annual",n&&/* @__PURE__ */Ke("span",{style:{fontSize:10,padding:"2px 6px",borderRadius:4,background:"annual"===e?i.bg:i.success,color:"annual"===e?i.success:i.bg,fontWeight:700},children:n})]})]})}function Zl({newPlan:e,currentPlan:t,cycle:n,daysRemaining:o,cycleDays:r,className:i,style:a,children:l}){const s=N(),d=r>0?o/r:0,c=t.prices[n]*d,u=e.prices[n]*d,h=Math.max(0,u-c),p=Math.max(0,c-u),f={border:`1px solid ${s.border}`,borderRadius:12,padding:20,background:s.surface,...a},m={display:"flex",justifyContent:"space-between",fontSize:13,padding:"6px 0"},g=t=>ql(t,e.currency,e.locale);/* @__PURE__ */
455
+ /* @__PURE__ */Ke("div",{style:{marginTop:16,padding:"8px 12px",borderRadius:6,background:r?l.primary:"transparent",color:r?l.bg:l.primary,border:`1px solid ${l.primary}`,textAlign:"center",fontWeight:600,fontSize:13},children:e.ctaLabel??(r?"Selected":`Choose ${e.name}`)})]},e.id)})})});function Jl({value:e,onChange:t,annualSavingsLabel:n,className:o,style:r}){const i=M(),a={display:"inline-flex",alignItems:"center",gap:8,padding:4,border:`1px solid ${i.border}`,borderRadius:999,background:i.surface,...r},l=e=>({padding:"6px 16px",borderRadius:999,fontSize:13,fontWeight:600,background:e?i.primary:"transparent",color:e?i.bg:i.text,border:"none",cursor:"pointer",transition:"background 0.15s, color 0.15s",display:"inline-flex",alignItems:"center",gap:6});/* @__PURE__ */
456
+ return Ye("div",{role:"radiogroup","aria-label":"Billing cycle",className:o,style:a,children:[/* @__PURE__ */Ke("button",{type:"button",role:"radio","aria-checked":"monthly"===e,onClick:()=>t("monthly"),style:l("monthly"===e),children:"Monthly"}),/* @__PURE__ */Ye("button",{type:"button",role:"radio","aria-checked":"annual"===e,onClick:()=>t("annual"),style:l("annual"===e),children:["Annual",n&&/* @__PURE__ */Ke("span",{style:{fontSize:10,padding:"2px 6px",borderRadius:4,background:"annual"===e?i.bg:i.success,color:"annual"===e?i.success:i.bg,fontWeight:700},children:n})]})]})}function _l({newPlan:e,currentPlan:t,cycle:n,daysRemaining:o,cycleDays:r,className:i,style:a,children:l}){const s=M(),d=r>0?o/r:0,c=t.prices[n]*d,u=e.prices[n]*d,h=Math.max(0,u-c),p=Math.max(0,c-u),f={border:`1px solid ${s.border}`,borderRadius:12,padding:20,background:s.surface,...a},m={display:"flex",justifyContent:"space-between",fontSize:13,padding:"6px 0"},g=t=>ql(t,e.currency,e.locale);/* @__PURE__ */
457
457
  return Ye("div",{className:i,style:f,children:[
458
458
  /* @__PURE__ */Ke("div",{style:{fontSize:12,fontWeight:700,color:s.textMuted,textTransform:"uppercase",letterSpacing:.5,marginBottom:12},children:"Plan change"}),
459
459
  /* @__PURE__ */Ye("div",{style:{...m,color:s.textMuted},children:[
@@ -465,34 +465,34 @@ return Ye("div",{className:i,style:f,children:[
465
465
  /* @__PURE__ */Ye("div",{style:{...m,color:s.textMuted},children:[/* @__PURE__ */Ye("span",{children:["Credit from ",t.name]}),/* @__PURE__ */Ye("span",{children:["−",g(c)]})]}),
466
466
  /* @__PURE__ */Ye("div",{style:{...m,color:s.textMuted},children:[/* @__PURE__ */Ye("span",{children:["Charge for ",e.name," (prorated)"]}),/* @__PURE__ */Ke("span",{children:g(u)})]}),
467
467
  /* @__PURE__ */Ke("hr",{style:{border:0,borderTop:`1px solid ${s.border}`,margin:"8px 0"}}),/* @__PURE__ */Ye("div",h>0?{style:{...m,fontSize:16,fontWeight:700},children:[/* @__PURE__ */Ke("span",{style:{color:s.text},children:"Due today"}),/* @__PURE__ */Ke("span",{style:{color:s.primary},children:g(h)})]}:{style:{...m,fontSize:14,color:s.success},children:[/* @__PURE__ */Ke("span",{children:"Credit applied at next billing"}),/* @__PURE__ */Ke("span",{children:g(p)})]}),
468
- /* @__PURE__ */Ke("div",{style:{...m,color:s.textMuted,fontSize:12,marginTop:6},children:/* @__PURE__ */Ye("span",{children:["Then ",g(e.prices[n])," / ","monthly"===n?"month":"year"]})}),l&&/* @__PURE__ */Ke("div",{style:{marginTop:16},children:l})]})}function Jl(e,t,n,o,r){if("vertical"===r){const r=e.x+n/2,i=e.y+o,a=t.x+n/2,l=t.y,s=(i+l)/2;return`M${r},${i} C${r},${s} ${a},${s} ${a},${l}`}const i=e.x+n,a=e.y+o/2,l=t.x,s=t.y+o/2,d=(i+l)/2;return`M${i},${a} C${d},${a} ${d},${s} ${l},${s}`}function Ql({node:e,w:t,h:n,isActive:o,theme:r}){const i=e.accent??r.primary,a=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),l=F(e.label),s=e.subLabel?F(e.subLabel):"",d=e.badge?F(e.badge):"";/* @__PURE__ */
468
+ /* @__PURE__ */Ke("div",{style:{...m,color:s.textMuted,fontSize:12,marginTop:6},children:/* @__PURE__ */Ye("span",{children:["Then ",g(e.prices[n])," / ","monthly"===n?"month":"year"]})}),l&&/* @__PURE__ */Ke("div",{style:{marginTop:16},children:l})]})}function Zl(e,t,n,o,r){if("vertical"===r){const r=e.x+n/2,i=e.y+o,a=t.x+n/2,l=t.y,s=(i+l)/2;return`M${r},${i} C${r},${s} ${a},${s} ${a},${l}`}const i=e.x+n,a=e.y+o/2,l=t.x,s=t.y+o/2,d=(i+l)/2;return`M${i},${a} C${d},${a} ${d},${s} ${l},${s}`}function Ql({node:e,w:t,h:n,isActive:o,theme:r}){const i=e.accent??r.primary,a=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),l=F(e.label),s=e.subLabel?F(e.subLabel):"",d=e.badge?F(e.badge):"";/* @__PURE__ */
469
469
  return Ye("div",{style:{width:t,height:n,boxSizing:"border-box",background:r.surface,border:`1.5px solid ${o?i:r.border}`,borderRadius:12,padding:"10px 12px",display:"flex",alignItems:"center",gap:10,boxShadow:o?`0 8px 24px -8px ${i}66`:`0 2px 8px -4px ${r.border}88`,transition:"border-color 0.15s ease, box-shadow 0.15s ease",overflow:"hidden"},children:[
470
470
  /* @__PURE__ */Ke("div",{style:{width:40,height:40,minWidth:40,borderRadius:"50%",overflow:"hidden",background:`${i}22`,color:i,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,border:`1.5px solid ${i}44`},"aria-hidden":"true",children:a?/* @__PURE__ */Ke("img",{src:a,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",style:{width:"100%",height:"100%",objectFit:"cover"}}):l.slice(0,2).toUpperCase()}),
471
471
  /* @__PURE__ */Ye("div",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ke("div",{style:{fontSize:13.5,fontWeight:700,color:r.text,lineHeight:1.25,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l}),s&&/* @__PURE__ */Ke("div",{style:{fontSize:11.5,color:r.textMuted,lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:1},children:s})]}),d&&/* @__PURE__ */Ke("span",{style:{fontSize:10,fontWeight:700,padding:"3px 7px",borderRadius:999,color:i,background:`${i}18`,border:`1px solid ${i}33`,letterSpacing:"0.04em",textTransform:"uppercase",flexShrink:0},children:d})]})}function es({collapsed:e,onClick:t,theme:n,direction:o,w:r,h:i}){const a={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"};/* @__PURE__ */
472
- return Ke("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:a,children:e?"+":"−"})}function ts({data:e,direction:t="vertical",interactive:n=!0,initialZoom:o=1,nodeWidth:r=200,nodeHeight:i=84,siblingGap:a=28,levelGap:l=64,onNodeClick:s,renderNode:d,collapsedByDefault:c=!1,height:u=560,ariaLabel:h="Organization chart",className:p,style:f}){const m=N(),g=Oe(null),x=Oe(null),[b,y]=Ve(()=>{if(!c)/* @__PURE__ */return new Set;const t=/* @__PURE__ */new Set;return function n(o){o.id!==e.id&&t.add(o.id),(o.children??[]).forEach(n)}(e),t}),[v,w]=Ve(ns(o)),[k,S]=Ve({x:0,y:0}),[C,$]=Ve(e.id),z=je(()=>function(e,t,n){const{nodeWidth:o,nodeHeight:r,siblingGap:i,levelGap:a,direction:l}=n,s=[],d=function e(n,o,r){const i=t.has(n.id),a={id:n.id,node:n,x:0,y:0,depth:o,parent:r,children:[],collapsed:i};if(!i)for(const t of n.children??[])a.children.push(e(t,o+1,a));return s.push(a),a}(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+a);if("horizontal"===l)for(const m of s){const e=m.x;m.x=m.y,m.y=e}let u=1/0,h=1/0,p=-1/0,f=-1/0;for(const m of s)m.x<u&&(u=m.x),m.y<h&&(h=m.y),m.x>p&&(p=m.x),m.y>f&&(f=m.y);Number.isFinite(u)||(u=0,h=0,p=0,f=0);for(const m of s)m.x-=u,m.y-=h;return{nodes:s,width:p-u+o,height:f-h+r}}(e,b,{nodeWidth:r,nodeHeight:i,siblingGap:a,levelGap:l,direction:t}),[e,b,r,i,a,l,t]),M=Ae(e=>{y(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Ee(()=>{if(!n)return;const e=g.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 S(t=>({x:t.x-e.deltaX,y:t.y-e.deltaY})),void e.preventDefault()}e.preventDefault();const t=e.deltaY<0?.1:-.1;w(e=>ns(e+t))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[n]),Ee(()=>{if(!n)return;const e=g.current;if(!e)return;let t=!1,o=0,r=0,i=0,a=0;const l=n=>{n.target.closest('button, [role="treeitem"], a, input')||(t=!0,o=n.clientX,r=n.clientY,i=k.x,a=k.y,e.setPointerCapture(n.pointerId))},s=e=>{t&&S({x:i+(e.clientX-o),y:a+(e.clientY-r)})},d=n=>{t=!1;try{e.releasePointerCapture(n.pointerId)}catch{}};return e.addEventListener("pointerdown",l),e.addEventListener("pointermove",s),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("pointerdown",l),e.removeEventListener("pointermove",s),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d)}},[n,k]);const I=Ae(e=>{const t=z.nodes.find(e=>e.id===C);if(t)if("ArrowRight"===e.key||"ArrowDown"===e.key){const n=t.children[0];n&&($(n.id),e.preventDefault())}else"ArrowLeft"===e.key||"ArrowUp"===e.key?t.parent&&($(t.parent.id),e.preventDefault()):"Enter"===e.key||" "===e.key?(s?.(t.node),e.preventDefault()):"+"===e.key||"="===e.key?w(e=>ns(e+.1)):"-"===e.key?w(e=>ns(e-.1)):"0"===e.key&&(w(1),S({x:0,y:0}))},[C,z,s]),L=je(()=>{const e=[];for(const n of z.nodes)for(const o of n.children)e.push({id:`${n.id}→${o.id}`,d:Jl(n,o,r,i,t)});return e},[z,r,i,t]),R={position:"relative",width:"100%",height:u,overflow:"hidden",borderRadius:12,background:m.bg,border:`1px solid ${m.border}`,touchAction:"none",cursor:n?"grab":"default",boxSizing:"border-box",...f},D={position:"absolute",left:"50%",top:24,width:z.width,height:z.height,transform:`translate(calc(-50% + ${k.x}px), ${k.y}px) scale(${v})`,transformOrigin:"top center",transition:"transform 0.08s ease-out"};/* @__PURE__ */
473
- return Ye("div",{ref:g,className:p,style:R,role:"tree","aria-label":F(h),tabIndex:0,onKeyDown:I,children:[n&&/* @__PURE__ */Ye("div",{style:{position:"absolute",top:12,right:12,zIndex:3,display:"flex",gap:6,background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,padding:4,boxShadow:`0 4px 12px -6px ${m.border}88`},children:[
472
+ return Ke("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:a,children:e?"+":"−"})}function ts({data:e,direction:t="vertical",interactive:n=!0,initialZoom:o=1,nodeWidth:r=200,nodeHeight:i=84,siblingGap:a=28,levelGap:l=64,onNodeClick:s,renderNode:d,collapsedByDefault:c=!1,height:u=560,ariaLabel:h="Organization chart",className:p,style:f}){const m=M(),g=Oe(null),x=Oe(null),[b,y]=Ve(()=>{if(!c)/* @__PURE__ */return new Set;const t=/* @__PURE__ */new Set;return function n(o){o.id!==e.id&&t.add(o.id),(o.children??[]).forEach(n)}(e),t}),[v,w]=Ve(ns(o)),[k,S]=Ve({x:0,y:0}),[C,$]=Ve(e.id),z=je(()=>function(e,t,n){const{nodeWidth:o,nodeHeight:r,siblingGap:i,levelGap:a,direction:l}=n,s=[],d=function e(n,o,r){const i=t.has(n.id),a={id:n.id,node:n,x:0,y:0,depth:o,parent:r,children:[],collapsed:i};if(!i)for(const t of n.children??[])a.children.push(e(t,o+1,a));return s.push(a),a}(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+a);if("horizontal"===l)for(const m of s){const e=m.x;m.x=m.y,m.y=e}let u=1/0,h=1/0,p=-1/0,f=-1/0;for(const m of s)m.x<u&&(u=m.x),m.y<h&&(h=m.y),m.x>p&&(p=m.x),m.y>f&&(f=m.y);Number.isFinite(u)||(u=0,h=0,p=0,f=0);for(const m of s)m.x-=u,m.y-=h;return{nodes:s,width:p-u+o,height:f-h+r}}(e,b,{nodeWidth:r,nodeHeight:i,siblingGap:a,levelGap:l,direction:t}),[e,b,r,i,a,l,t]),N=Ae(e=>{y(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Ee(()=>{if(!n)return;const e=g.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 S(t=>({x:t.x-e.deltaX,y:t.y-e.deltaY})),void e.preventDefault()}e.preventDefault();const t=e.deltaY<0?.1:-.1;w(e=>ns(e+t))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[n]),Ee(()=>{if(!n)return;const e=g.current;if(!e)return;let t=!1,o=0,r=0,i=0,a=0;const l=n=>{n.target.closest('button, [role="treeitem"], a, input')||(t=!0,o=n.clientX,r=n.clientY,i=k.x,a=k.y,e.setPointerCapture(n.pointerId))},s=e=>{t&&S({x:i+(e.clientX-o),y:a+(e.clientY-r)})},d=n=>{t=!1;try{e.releasePointerCapture(n.pointerId)}catch{}};return e.addEventListener("pointerdown",l),e.addEventListener("pointermove",s),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("pointerdown",l),e.removeEventListener("pointermove",s),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d)}},[n,k]);const I=Ae(e=>{const t=z.nodes.find(e=>e.id===C);if(t)if("ArrowRight"===e.key||"ArrowDown"===e.key){const n=t.children[0];n&&($(n.id),e.preventDefault())}else"ArrowLeft"===e.key||"ArrowUp"===e.key?t.parent&&($(t.parent.id),e.preventDefault()):"Enter"===e.key||" "===e.key?(s?.(t.node),e.preventDefault()):"+"===e.key||"="===e.key?w(e=>ns(e+.1)):"-"===e.key?w(e=>ns(e-.1)):"0"===e.key&&(w(1),S({x:0,y:0}))},[C,z,s]),R=je(()=>{const e=[];for(const n of z.nodes)for(const o of n.children)e.push({id:`${n.id}→${o.id}`,d:Zl(n,o,r,i,t)});return e},[z,r,i,t]),T={position:"relative",width:"100%",height:u,overflow:"hidden",borderRadius:12,background:m.bg,border:`1px solid ${m.border}`,touchAction:"none",cursor:n?"grab":"default",boxSizing:"border-box",...f},D={position:"absolute",left:"50%",top:24,width:z.width,height:z.height,transform:`translate(calc(-50% + ${k.x}px), ${k.y}px) scale(${v})`,transformOrigin:"top center",transition:"transform 0.08s ease-out"};/* @__PURE__ */
473
+ return Ye("div",{ref:g,className:p,style:T,role:"tree","aria-label":F(h),tabIndex:0,onKeyDown:I,children:[n&&/* @__PURE__ */Ye("div",{style:{position:"absolute",top:12,right:12,zIndex:3,display:"flex",gap:6,background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,padding:4,boxShadow:`0 4px 12px -6px ${m.border}88`},children:[
474
474
  /* @__PURE__ */Ke(os,{theme:m,label:"Zoom out",onClick:()=>w(e=>ns(e-.1)),children:"−"}),
475
475
  /* @__PURE__ */Ke(os,{theme:m,label:"Reset zoom",onClick:()=>{w(1),S({x:0,y:0})},children:"⟳"}),
476
- /* @__PURE__ */Ke(os,{theme:m,label:"Zoom in",onClick:()=>w(e=>ns(e+.1)),children:"+"})]}),/* @__PURE__ */Ye("div",{ref:x,style:D,children:[/* @__PURE__ */Ke("svg",{width:z.width,height:z.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none"},"aria-hidden":"true",children:L.map(e=>/* @__PURE__ */Ke("path",{d:e.d,fill:"none",stroke:m.border,strokeWidth:1.5},e.id))}),z.nodes.map(e=>{const n=(e.node.children?.length??0)>0,o=e.id===C;/* @__PURE__ */
477
- return Ye("div",{role:"treeitem","aria-label":F(e.node.label),"aria-selected":o,"aria-level":e.depth+1,"aria-expanded":n?!e.collapsed:void 0,tabIndex:-1,onClick:t=>{t.stopPropagation(),$(e.id),s?.(e.node)},style:{position:"absolute",left:e.x,top:e.y,width:r,height:i,cursor:s?"pointer":"default"},children:[d?d(e.node,o):/* @__PURE__ */Ke(Ql,{node:e.node,w:r,h:i,isActive:o,theme:m}),n&&/* @__PURE__ */Ke(es,{collapsed:e.collapsed,onClick:()=>M(e.id),theme:m,direction:t,w:r,h:i})]},e.id)})]})]})}function ns(e){return e<.25?.25:e>4?4:e}function os({children:e,onClick:t,label:n,theme:o}){/* @__PURE__ */
476
+ /* @__PURE__ */Ke(os,{theme:m,label:"Zoom in",onClick:()=>w(e=>ns(e+.1)),children:"+"})]}),/* @__PURE__ */Ye("div",{ref:x,style:D,children:[/* @__PURE__ */Ke("svg",{width:z.width,height:z.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none"},"aria-hidden":"true",children:R.map(e=>/* @__PURE__ */Ke("path",{d:e.d,fill:"none",stroke:m.border,strokeWidth:1.5},e.id))}),z.nodes.map(e=>{const n=(e.node.children?.length??0)>0,o=e.id===C;/* @__PURE__ */
477
+ return Ye("div",{role:"treeitem","aria-label":F(e.node.label),"aria-selected":o,"aria-level":e.depth+1,"aria-expanded":n?!e.collapsed:void 0,tabIndex:-1,onClick:t=>{t.stopPropagation(),$(e.id),s?.(e.node)},style:{position:"absolute",left:e.x,top:e.y,width:r,height:i,cursor:s?"pointer":"default"},children:[d?d(e.node,o):/* @__PURE__ */Ke(Ql,{node:e.node,w:r,h:i,isActive:o,theme:m}),n&&/* @__PURE__ */Ke(es,{collapsed:e.collapsed,onClick:()=>N(e.id),theme:m,direction:t,w:r,h:i})]},e.id)})]})]})}function ns(e){return e<.25?.25:e>4?4:e}function os({children:e,onClick:t,label:n,theme:o}){/* @__PURE__ */
478
478
  return Ke("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 rs({locale:e="en-US",direction:t,strings:n,children:o}){const r=je(()=>{const o=ve[e]??we,r=n?{...o,...n}:o;return{locale:e,direction:t??(ke(e)?"rtl":"ltr"),strings:r}},[e,t,n]);/* @__PURE__ */
479
479
  return Ke(ye.Provider,{value:r,children:/* @__PURE__ */Ke("div",{dir:r.direction,style:{direction:r.direction,display:"contents"},children:o})})}function is({contentId:e="tkx-main-content",label:t="Skip to main content"}){/* @__PURE__ */
480
480
  return Ke("a",{href:`#${e}`,className:"tkx-skip-nav",children:t})}function as({politeness:e="polite",children:t,atomic:n=!0}){/* @__PURE__ */
481
481
  return Ke("div",{role:"status","aria-live":e,"aria-atomic":n,className:"tkx-sr-only",children:t})}function ls({active:e,children:t,as:n="div"}){/* @__PURE__ */
482
482
  return Ke(n,{ref:fe(e),children:t})}function ss({as:e,children:t,...n}){/* @__PURE__ */
483
483
  return Ke(e??"span",{className:"tkx-sr-only",...n,children:t})}function ds(e,t,n,o){const r=e.getBoundingClientRect(),i=t?t.offsetHeight:320,a=t?t.offsetWidth:200,l=window.innerWidth,s=window.innerHeight,d=window.scrollX,c=window.scrollY;let u=0,h=0;switch(n){case"bottom-start":default:u=r.bottom+c+o,h=r.left+d;break;case"bottom-end":u=r.bottom+c+o,h=r.right+d-a;break;case"top-start":u=r.top+c-o-i,h=r.left+d;break;case"top-end":u=r.top+c-o-i,h=r.right+d-a;break;case"right":u=r.top+c,h=r.right+d+o;break;case"left":u=r.top+c,h=r.left+d-o-a}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),h+a>l+d&&(h=l+d-a-8),h<d&&(h=d+8),{top:u,left:h,minWidth:r.width}}function cs(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return-1===n?e:/* @__PURE__ */Ye(Ue,{children:[e.slice(0,n),
484
- /* @__PURE__ */Ke("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 us({groups:e,position:t,maxHeight:n,minWidth:o,selectedKeys:r,multiSelect:i,searchable:a,searchPlaceholder:l,onSelect:s,onClose:d,renderItem:c,menuRef:u,isPortal:h,menuId:p}){const f=N(),m=$e(),g=l??`${m.search}…`,[x,b]=Ve(""),[y,v]=Ve(0),[w,k]=Ve(null),[S,C]=Ve(0),$=Oe(null),z=Oe([]),M=Oe([]),I=x?e.map(e=>({...e,items:e.items.filter(e=>e.label.toLowerCase().includes(x.toLowerCase())||e.description?.toLowerCase().includes(x.toLowerCase())||e.children?.some(e=>e.label.toLowerCase().includes(x.toLowerCase())))})).filter(e=>e.items.length>0):e,L=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}(I,x);Ee(()=>{a&&$.current?$.current.focus():z.current[0]?.focus(),v(0)},[a]),Ee(()=>{a&&""===x||z.current[y]?.focus()},[y,a,x]);const R=Ae(e=>{switch(e.key){case"ArrowDown":if(e.preventDefault(),w){const e=(L.find(e=>e.key===w)?.children??[]).filter(e=>!e.disabled);C(t=>Math.min(t+1,e.length-1))}else v(e=>Math.min(e+1,L.length-1));break;case"ArrowUp":e.preventDefault(),w?C(e=>Math.max(e-1,0)):v(e=>Math.max(e-1,0));break;case"ArrowRight":{e.preventDefault();const t=L[y];t?.children?.length&&(k(t.key),C(0));break}case"ArrowLeft":e.preventDefault(),k(null);break;case"Enter":case" ":if(e.preventDefault(),w){const e=(L.find(e=>e.key===w)?.children??[]).filter(e=>!e.disabled)[S];e&&s(e.key,e)}else{const e=L[y];e&&s(e.key,e)}break;case"Escape":e.preventDefault(),w?k(null):d();break;case"Tab":d()}},[L,y,d,s,w,S]);Ee(()=>{w&&M.current[S]?.focus()},[S,w]);const D={position:h?"fixed":"absolute",top:h?t.top:void 0,left:h?t.left:void 0,minWidth:Math.max(o,t.minWidth),maxHeight:n,overflowY:"auto",background:f.surface,border:`1px solid ${f.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 T=0;/* @__PURE__ */
485
- return Ye("div",{ref:u,id:p,role:"menu","aria-label":"Dropdown menu",tabIndex:-1,style:D,onKeyDown:R,children:[
486
- /* @__PURE__ */Ke("style",{children:"\n @keyframes tkx-dropdown-in {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "}),a&&/* @__PURE__ */Ke("div",{style:{padding:"8px 8px 4px"},children:/* @__PURE__ */Ke("input",{ref:$,type:"text",value:x,onChange:e=>{b(e.target.value),v(0)},placeholder:g,"aria-label":`${m.search} items`,style:{width:"100%",boxSizing:"border-box",padding:"6px 10px",background:f.surfaceAlt,border:`1px solid ${f.border}`,borderRadius:6,color:f.text,fontSize:13,outline:"none"}})}),0===I.length&&/* @__PURE__ */Ke("div",{style:{padding:"12px 16px",color:f.textMuted,fontSize:13,textAlign:"center"},children:"No results found"}),I.map((e,t)=>/* @__PURE__ */Ye("div",{role:"group","aria-label":e.label,children:[e.label&&/* @__PURE__ */Ke("div",{style:{padding:"8px 12px 4px",fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:f.textMuted},children:F(e.label)}),e.items.map(e=>{const t=T;e.disabled||T++;const n=r.includes(e.key),o=t===y&&!e.disabled,a=!!e.children?.length,l=w===e.key,d=c?c(e,n):/* @__PURE__ */Ke(hs,{item:e,isSelected:n,isFocused:o,multiSelect:i,query:x,theme:f,hasSubmenu:a});/* @__PURE__ */
484
+ /* @__PURE__ */Ke("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 us({groups:e,position:t,maxHeight:n,minWidth:o,selectedKeys:r,multiSelect:i,searchable:a,searchPlaceholder:l,onSelect:s,onClose:d,renderItem:c,menuRef:u,isPortal:h,menuId:p}){const f=M(),m=$e(),g=l??`${m.search}…`,[x,b]=Ve(""),[y,v]=Ve(0),[w,k]=Ve(null),[S,C]=Ve(0),$=Oe(null),z=Oe([]),N=Oe([]),I=x?e.map(e=>({...e,items:e.items.filter(e=>e.label.toLowerCase().includes(x.toLowerCase())||e.description?.toLowerCase().includes(x.toLowerCase())||e.children?.some(e=>e.label.toLowerCase().includes(x.toLowerCase())))})).filter(e=>e.items.length>0):e,R=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}(I,x);Ee(()=>{a&&$.current?$.current.focus():z.current[0]?.focus(),v(0)},[a]),Ee(()=>{a&&""===x||z.current[y]?.focus()},[y,a,x]);const T=Ae(e=>{switch(e.key){case"ArrowDown":if(e.preventDefault(),w){const e=(R.find(e=>e.key===w)?.children??[]).filter(e=>!e.disabled);C(t=>Math.min(t+1,e.length-1))}else v(e=>Math.min(e+1,R.length-1));break;case"ArrowUp":e.preventDefault(),w?C(e=>Math.max(e-1,0)):v(e=>Math.max(e-1,0));break;case"ArrowRight":{e.preventDefault();const t=R[y];t?.children?.length&&(k(t.key),C(0));break}case"ArrowLeft":e.preventDefault(),k(null);break;case"Enter":case" ":if(e.preventDefault(),w){const e=(R.find(e=>e.key===w)?.children??[]).filter(e=>!e.disabled)[S];e&&s(e.key,e)}else{const e=R[y];e&&s(e.key,e)}break;case"Escape":e.preventDefault(),w?k(null):d();break;case"Tab":d()}},[R,y,d,s,w,S]);Ee(()=>{w&&N.current[S]?.focus()},[S,w]);const D={position:h?"fixed":"absolute",top:h?t.top:void 0,left:h?t.left:void 0,minWidth:Math.max(o,t.minWidth),maxHeight:n,overflowY:"auto",background:f.surface,border:`1px solid ${f.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 L=0;/* @__PURE__ */
485
+ return Ye("div",{ref:u,id:p,role:"menu","aria-label":"Dropdown menu",tabIndex:-1,style:D,onKeyDown:T,children:[
486
+ /* @__PURE__ */Ke("style",{children:"\n @keyframes tkx-dropdown-in {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "}),a&&/* @__PURE__ */Ke("div",{style:{padding:"8px 8px 4px"},children:/* @__PURE__ */Ke("input",{ref:$,type:"text",value:x,onChange:e=>{b(e.target.value),v(0)},placeholder:g,"aria-label":`${m.search} items`,style:{width:"100%",boxSizing:"border-box",padding:"6px 10px",background:f.surfaceAlt,border:`1px solid ${f.border}`,borderRadius:6,color:f.text,fontSize:13,outline:"none"}})}),0===I.length&&/* @__PURE__ */Ke("div",{style:{padding:"12px 16px",color:f.textMuted,fontSize:13,textAlign:"center"},children:"No results found"}),I.map((e,t)=>/* @__PURE__ */Ye("div",{role:"group","aria-label":e.label,children:[e.label&&/* @__PURE__ */Ke("div",{style:{padding:"8px 12px 4px",fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:f.textMuted},children:F(e.label)}),e.items.map(e=>{const t=L;e.disabled||L++;const n=r.includes(e.key),o=t===y&&!e.disabled,a=!!e.children?.length,l=w===e.key,d=c?c(e,n):/* @__PURE__ */Ke(hs,{item:e,isSelected:n,isFocused:o,multiSelect:i,query:x,theme:f,hasSubmenu:a});/* @__PURE__ */
487
487
  return Ye("div",{children:[e.divider&&/* @__PURE__ */Ke("div",{role:"separator",style:{height:1,background:f.border,margin:"4px 0"}}),/* @__PURE__ */Ye("div",{ref:e=>{z.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-checked":i?n:void 0,"aria-selected":i?void 0:n,"aria-haspopup":a?"menu":void 0,"aria-expanded":a?l:void 0,tabIndex:e.disabled?-1:0,style:{position:"relative",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:()=>{e.disabled||(a?(k(l?null:e.key),C(0)):s(e.key,e))},onMouseEnter:()=>{e.disabled||(v(t),a?(k(e.key),C(0)):k(null))},onFocus:()=>{e.disabled||v(t)},children:[d,a&&l&&/* @__PURE__ */Ke("div",{role:"menu",style:{position:"absolute",top:0,left:"100%",minWidth:180,background:f.surface,border:`1px solid ${f.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=r.includes(e.key),o=t===S;/* @__PURE__ */
488
- return Ke("div",{ref:e=>{M.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||s(e.key,e)},onMouseEnter:()=>C(t),children:/* @__PURE__ */Ke(hs,{item:e,isSelected:n,isFocused:o,multiSelect:i,query:x,theme:f,hasSubmenu:!1})},e.key)})})]})]},e.key)})]},t))]})}function hs({item:e,isSelected:t,isFocused:n,multiSelect:o,query:r,theme:i,hasSubmenu:a}){/* @__PURE__ */
488
+ return Ke("div",{ref:e=>{N.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||s(e.key,e)},onMouseEnter:()=>C(t),children:/* @__PURE__ */Ke(hs,{item:e,isSelected:n,isFocused:o,multiSelect:i,query:x,theme:f,hasSubmenu:!1})},e.key)})})]})]},e.key)})]},t))]})}function hs({item:e,isSelected:t,isFocused:n,multiSelect:o,query:r,theme:i,hasSubmenu:a}){/* @__PURE__ */
489
489
  return Ye("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&&/* @__PURE__ */Ke("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&&/* @__PURE__ */Ke("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:/* @__PURE__ */Ke("path",{d:"M1 4l3 3L9 1",stroke:i.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.icon&&/* @__PURE__ */Ke("span",{style:{display:"flex",alignItems:"center",flexShrink:0,color:e.danger?i.danger:i.textMuted},children:e.icon}),
490
- /* @__PURE__ */Ye("div",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ke("div",{style:{fontWeight:t&&!o?600:400},children:cs(e.label,r)}),e.description&&/* @__PURE__ */Ke("div",{style:{fontSize:12,color:i.textMuted,marginTop:1},children:cs(e.description,r)})]}),void 0!==e.badge&&/* @__PURE__ */Ke("span",{style:{background:i.primary,color:i.bg,fontSize:11,fontWeight:700,borderRadius:10,padding:"1px 7px",flexShrink:0},children:e.badge}),e.shortcut&&!a&&/* @__PURE__ */Ke("span",{style:{fontSize:12,color:i.textMuted,flexShrink:0},children:e.shortcut}),a&&/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M4 2l4 4-4 4",stroke:i.textMuted,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),!o&&t&&/* @__PURE__ */Ke("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M2 7l4 4L12 3",stroke:i.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})}function ps({trigger:e,items:t,groups:n,placement:o="bottom-start",onSelect:r,selectedKeys:i,multiSelect:a=!1,searchable:l=!1,searchPlaceholder:s,closeOnSelect:d,disabled:c=!1,maxHeight:u=320,minWidth:h=200,open:p,onOpenChange:f,portal:m=!0,offset:g=6,renderItem:x}){const[b,y]=Ve(!1),[v,w]=Ve([]),[k,S]=Ve({top:0,left:0,minWidth:h}),C=Oe(null),$=Oe(null),z=He(),N=void 0!==p?p:b,M=void 0!==i?i:v,I=void 0!==d?d:!a,L=n??(t?[{items:t}]:[{items:[]}]),R=Ae(e=>{void 0===p&&y(e),f?.(e)},[p,f]),D=Ae((e,t)=>{a&&void 0===i&&w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),r?.(e,t),I&&R(!1)},[a,i,r,I,R]),T=Ae(()=>R(!1),[R]);Ee(()=>{N&&C.current&&S(ds(C.current,$.current,o,g))},[N,o,g]),Ee(()=>{N&&C.current&&$.current&&S(ds(C.current,$.current,o,g))},[N,o,g]),Ee(()=>{if(!N)return;const e=e=>{const t=e.target;C.current&&!C.current.contains(t)&&$.current&&!$.current.contains(t)&&R(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[N,R]);const W=N?/* @__PURE__ */Ke(us,{groups:L,position:k,maxHeight:u,minWidth:h,selectedKeys:M,multiSelect:a,searchable:l,searchPlaceholder:s,onSelect:D,onClose:T,renderItem:x,menuRef:$,isPortal:m,menuId:z}):null;/* @__PURE__ */
491
- return Ye("div",{style:{display:"inline-block",position:"relative"},children:[/* @__PURE__ */Ke("div",{ref:C,onClick:()=>{c||R(!N)},"aria-haspopup":"menu","aria-expanded":N,"aria-controls":N?z:void 0,"aria-disabled":c,style:{cursor:c?"not-allowed":"pointer",opacity:c?.5:1,display:"inline-block"},children:e}),m&&"undefined"!=typeof document?Xe(W,document.body):W]})}ts.displayName="TkxOrgChart";var fs={sm:4,md:8,lg:12};function ms({value:e,label:t,showLabel:n=!0,size:o="md",animate:r=!0,className:i,style:a}){const l=N(),s=Oe(null),d=Math.max(0,Math.min(100,e)),c=function(e,t){return e>=80?"#10b981":e>=55?t:e>=30?"#f59e0b":"#ef4444"}(d,l.primary),u=fs[o];Ee(()=>{if(!r||!s.current)return;const e=s.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=`${d}%`});return()=>cancelAnimationFrame(t)},[d,r]);const h="number"==typeof d?`${d.toFixed(0)}% AI confidence${t?` for ${t}`:""}`:t;/* @__PURE__ */
490
+ /* @__PURE__ */Ye("div",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ke("div",{style:{fontWeight:t&&!o?600:400},children:cs(e.label,r)}),e.description&&/* @__PURE__ */Ke("div",{style:{fontSize:12,color:i.textMuted,marginTop:1},children:cs(e.description,r)})]}),void 0!==e.badge&&/* @__PURE__ */Ke("span",{style:{background:i.primary,color:i.bg,fontSize:11,fontWeight:700,borderRadius:10,padding:"1px 7px",flexShrink:0},children:e.badge}),e.shortcut&&!a&&/* @__PURE__ */Ke("span",{style:{fontSize:12,color:i.textMuted,flexShrink:0},children:e.shortcut}),a&&/* @__PURE__ */Ke("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M4 2l4 4-4 4",stroke:i.textMuted,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),!o&&t&&/* @__PURE__ */Ke("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{flexShrink:0},children:/* @__PURE__ */Ke("path",{d:"M2 7l4 4L12 3",stroke:i.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})}function ps({trigger:e,items:t,groups:n,placement:o="bottom-start",onSelect:r,selectedKeys:i,multiSelect:a=!1,searchable:l=!1,searchPlaceholder:s,closeOnSelect:d,disabled:c=!1,maxHeight:u=320,minWidth:h=200,open:p,onOpenChange:f,portal:m=!0,offset:g=6,renderItem:x}){const[b,y]=Ve(!1),[v,w]=Ve([]),[k,S]=Ve({top:0,left:0,minWidth:h}),C=Oe(null),$=Oe(null),z=He(),M=void 0!==p?p:b,N=void 0!==i?i:v,I=void 0!==d?d:!a,R=n??(t?[{items:t}]:[{items:[]}]),T=Ae(e=>{void 0===p&&y(e),f?.(e)},[p,f]),D=Ae((e,t)=>{a&&void 0===i&&w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),r?.(e,t),I&&T(!1)},[a,i,r,I,T]),L=Ae(()=>T(!1),[T]);Ee(()=>{M&&C.current&&S(ds(C.current,$.current,o,g))},[M,o,g]),Ee(()=>{M&&C.current&&$.current&&S(ds(C.current,$.current,o,g))},[M,o,g]),Ee(()=>{if(!M)return;const e=e=>{const t=e.target;C.current&&!C.current.contains(t)&&$.current&&!$.current.contains(t)&&T(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[M,T]);const W=M?/* @__PURE__ */Ke(us,{groups:R,position:k,maxHeight:u,minWidth:h,selectedKeys:N,multiSelect:a,searchable:l,searchPlaceholder:s,onSelect:D,onClose:L,renderItem:x,menuRef:$,isPortal:m,menuId:z}):null;/* @__PURE__ */
491
+ return Ye("div",{style:{display:"inline-block",position:"relative"},children:[/* @__PURE__ */Ke("div",{ref:C,onClick:()=>{c||T(!M)},"aria-haspopup":"menu","aria-expanded":M,"aria-controls":M?z:void 0,"aria-disabled":c,style:{cursor:c?"not-allowed":"pointer",opacity:c?.5:1,display:"inline-block"},children:e}),m&&"undefined"!=typeof document?Xe(W,document.body):W]})}ts.displayName="TkxOrgChart";var fs={sm:4,md:8,lg:12};function ms({value:e,label:t,showLabel:n=!0,size:o="md",animate:r=!0,className:i,style:a}){const l=M(),s=Oe(null),d=Math.max(0,Math.min(100,e)),c=function(e,t){return e>=80?"#10b981":e>=55?t:e>=30?"#f59e0b":"#ef4444"}(d,l.primary),u=fs[o];Ee(()=>{if(!r||!s.current)return;const e=s.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=`${d}%`});return()=>cancelAnimationFrame(t)},[d,r]);const h="number"==typeof d?`${d.toFixed(0)}% AI confidence${t?` for ${t}`:""}`:t;/* @__PURE__ */
492
492
  return Ye("div",{className:le(U("flex flex-col gap-1"),i),style:a,role:"meter","aria-valuenow":d,"aria-valuemin":0,"aria-valuemax":100,"aria-label":h,children:[(t||n)&&/* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[t&&/* @__PURE__ */Ke("span",{style:{fontSize:12,fontWeight:600,color:l.textMuted},children:t}),n&&/* @__PURE__ */Ye("span",{style:{fontSize:12,fontWeight:700,color:c,marginLeft:"auto"},children:[d.toFixed(0),"%"]})]}),
493
493
  /* @__PURE__ */Ye("div",{style:{height:u,borderRadius:u,background:`${l.border}`,overflow:"hidden",position:"relative"},children:[/* @__PURE__ */Ke("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}}),/* @__PURE__ */Ke("div",{ref:s,style:{height:"100%",width:r?"0%":`${d}%`,background:`linear-gradient(90deg, ${c}cc, ${c})`,borderRadius:u,boxShadow:`0 0 8px ${c}66`,transition:r?void 0:"width 0.3s ease"}})]}),
494
494
  /* @__PURE__ */Ye("div",{style:{fontSize:10,color:l.textMuted,marginTop:2,display:"flex",gap:4,alignItems:"center"},children:[/* @__PURE__ */Ke("span",{style:{width:6,height:6,borderRadius:"50%",background:c,display:"inline-block",flexShrink:0}}),d>=80?"High confidence":d>=55?"Moderate confidence":d>=30?"Low confidence":"Very low — review manually"]}),
495
- /* @__PURE__ */Ke("style",{children:"\n @keyframes tkx-ai-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n "})]})}function gs({src:e,name:t,size:n=32}){const o=N(),r=t?t.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():"?";return e?/* @__PURE__ */Ke("img",{src:e,alt:t??"avatar",width:n,height:n,style:{borderRadius:"50%",objectFit:"cover",flexShrink:0}}):/* @__PURE__ */Ke("div",{style:{width:n,height:n,borderRadius:"50%",flexShrink:0,background:`${o.primary}22`,border:`1px solid ${o.primary}44`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:.35*n,fontWeight:700,color:o.primary},children:r})}function xs({role:e,content:t,avatar:n,name:o,timestamp:r,streaming:i=!1,confidence:a,copyable:l=!1,className:s,style:d}){const c=N(),u="user"===e,h="system"===e,p="string"==typeof t?F(t):"",[f,m]=Ve(i?"":p),[g,x]=Ve(!1),[b,y]=Ve(i?"":p),v=Oe(0),w=Oe(null);if(Ee(()=>{if(!i||"string"!=typeof t)return void y(p);v.current=0,m(""),y("");const e=setInterval(()=>{v.current++;const t=p.slice(0,v.current);m(t),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>y(t),350),v.current>=p.length&&(clearInterval(e),w.current&&clearTimeout(w.current),y(p))},18);return()=>{clearInterval(e),w.current&&clearTimeout(w.current)}},[p,i,t]),h)/* @__PURE__ */return Ke("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:/* @__PURE__ */Ke("div",{style:{padding:"6px 16px",borderRadius:999,fontSize:12,background:`${c.border}`,color:c.textMuted,fontStyle:"italic"},children:"string"==typeof t?F(t):t})});const k={maxWidth:"75%",padding:"12px 16px",borderRadius:u?"18px 18px 4px 18px":"18px 18px 18px 4px",background:u?`linear-gradient(135deg, ${c.primary}, ${c.primary}cc)`:`${c.surface}`,border:u?"none":`1px solid ${c.border}`,color:u?"#fff":c.text,fontSize:14,lineHeight:1.65,boxShadow:u?`0 4px 16px -4px ${c.primary}55`:"0 2px 8px -2px rgba(0,0,0,0.2)",position:"relative",wordBreak:"break-word"};/* @__PURE__ */
495
+ /* @__PURE__ */Ke("style",{children:"\n @keyframes tkx-ai-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n "})]})}function gs({src:e,name:t,size:n=32}){const o=M(),r=t?t.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():"?";return e?/* @__PURE__ */Ke("img",{src:e,alt:t??"avatar",width:n,height:n,style:{borderRadius:"50%",objectFit:"cover",flexShrink:0}}):/* @__PURE__ */Ke("div",{style:{width:n,height:n,borderRadius:"50%",flexShrink:0,background:`${o.primary}22`,border:`1px solid ${o.primary}44`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:.35*n,fontWeight:700,color:o.primary},children:r})}function xs({role:e,content:t,avatar:n,name:o,timestamp:r,streaming:i=!1,confidence:a,copyable:l=!1,className:s,style:d}){const c=M(),u="user"===e,h="system"===e,p="string"==typeof t?F(t):"",[f,m]=Ve(i?"":p),[g,x]=Ve(!1),[b,y]=Ve(i?"":p),v=Oe(0),w=Oe(null);if(Ee(()=>{if(!i||"string"!=typeof t)return void y(p);v.current=0,m(""),y("");const e=setInterval(()=>{v.current++;const t=p.slice(0,v.current);m(t),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>y(t),350),v.current>=p.length&&(clearInterval(e),w.current&&clearTimeout(w.current),y(p))},18);return()=>{clearInterval(e),w.current&&clearTimeout(w.current)}},[p,i,t]),h)/* @__PURE__ */return Ke("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:/* @__PURE__ */Ke("div",{style:{padding:"6px 16px",borderRadius:999,fontSize:12,background:`${c.border}`,color:c.textMuted,fontStyle:"italic"},children:"string"==typeof t?F(t):t})});const k={maxWidth:"75%",padding:"12px 16px",borderRadius:u?"18px 18px 4px 18px":"18px 18px 18px 4px",background:u?`linear-gradient(135deg, ${c.primary}, ${c.primary}cc)`:`${c.surface}`,border:u?"none":`1px solid ${c.border}`,color:u?"#fff":c.text,fontSize:14,lineHeight:1.65,boxShadow:u?`0 4px 16px -4px ${c.primary}55`:"0 2px 8px -2px rgba(0,0,0,0.2)",position:"relative",wordBreak:"break-word"};/* @__PURE__ */
496
496
  return Ye("div",{className:le(U("flex gap-2"),s),style:{flexDirection:u?"row-reverse":"row",alignItems:"flex-end",...d},children:[
497
497
  /* @__PURE__ */Ke(gs,{src:n,name:o??(u?"You":"AI")}),
498
498
  /* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:u?"flex-end":"flex-start"},children:[(o||r)&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,alignItems:"center",paddingInline:4},children:[o&&/* @__PURE__ */Ke("span",{style:{fontSize:11,fontWeight:700,color:c.textMuted},children:o}),r&&/* @__PURE__ */Ke("span",{style:{fontSize:10,color:c.textMuted},children:r})]}),
@@ -508,17 +508,17 @@ return Ke("div",{style:{display:"flex",gap:3,alignItems:"center",height:20},chil
508
508
  return Ye("div",{style:{position:"relative",width:28,height:28},children:[
509
509
  /* @__PURE__ */Ke("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:`2px solid ${e}33`}}),
510
510
  /* @__PURE__ */Ke("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:"2px solid transparent",borderTopColor:e,animation:"tkx-thinking-orbit 0.8s linear infinite"}}),
511
- /* @__PURE__ */Ke("div",{style:{position:"absolute",inset:"38%",borderRadius:"50%",background:e,opacity:.8}})]})}var ks={sm:12,md:14,lg:16};function Ss({label:e="Thinking…",steps:t,size:n="md",variant:o="dots",active:r=!0,className:i,style:a}){const l=N(),[s,d]=Ve(0);Ee(()=>{if(!t?.length||!r)return;const e=setInterval(()=>{d(e=>(e+1)%t.length)},1800);return()=>clearInterval(e)},[t,r]);const c=l.primary,u=ks[n],h={dots:/* @__PURE__ */Ke(bs,{color:c}),pulse:/* @__PURE__ */Ke(ys,{color:c}),wave:/* @__PURE__ */Ke(vs,{color:c}),orbit:/* @__PURE__ */Ke(ws,{color:c})}[o];/* @__PURE__ */
511
+ /* @__PURE__ */Ke("div",{style:{position:"absolute",inset:"38%",borderRadius:"50%",background:e,opacity:.8}})]})}var ks={sm:12,md:14,lg:16};function Ss({label:e="Thinking…",steps:t,size:n="md",variant:o="dots",active:r=!0,className:i,style:a}){const l=M(),[s,d]=Ve(0);Ee(()=>{if(!t?.length||!r)return;const e=setInterval(()=>{d(e=>(e+1)%t.length)},1800);return()=>clearInterval(e)},[t,r]);const c=l.primary,u=ks[n],h={dots:/* @__PURE__ */Ke(bs,{color:c}),pulse:/* @__PURE__ */Ke(ys,{color:c}),wave:/* @__PURE__ */Ke(vs,{color:c}),orbit:/* @__PURE__ */Ke(ws,{color:c})}[o];/* @__PURE__ */
512
512
  return Ye("div",{className:le(U("inline-flex flex-col gap-2"),i),style:a,role:"status","aria-live":"polite","aria-label":r?e:"Done thinking",children:[
513
513
  /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:10},children:[/* @__PURE__ */Ke("div",{style:{opacity:r?1:.35,transition:"opacity 0.3s"},children:r?h:/* @__PURE__ */Ke("div",{style:{width:20,height:20,borderRadius:"50%",background:"#10b981",display:"flex",alignItems:"center",justifyContent:"center"},children:/* @__PURE__ */Ke("span",{style:{color:"#fff",fontSize:11,fontWeight:900},children:"✓"})})}),/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[/* @__PURE__ */Ke("span",{style:{fontSize:u,fontWeight:600,color:r?l.text:l.textMuted,transition:"color 0.3s"},children:r?t?t[s]:e:"Done"}),r&&/* @__PURE__ */Ke("span",{style:{fontSize:u-2,color:l.textMuted},children:"⚛ Quantum AI · Amplitude Amplification"})]})]}),t&&t.length>1&&/* @__PURE__ */Ke("div",{style:{display:"flex",gap:4,paddingLeft:2},children:t.map((e,t)=>/* @__PURE__ */Ke("div",{style:{width:t===s?16:6,height:4,borderRadius:4,background:t===s?c:`${c}44`,transition:"all 0.3s ease"}},t))}),
514
- /* @__PURE__ */Ke("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 "})]})}var Cs=!1,$s="tkx-holographic-styles";function zs(e={}){const{maxTilt:t=14,disabled:n=!1}=e,o=Oe(null),r=ge(),i=Oe(null),a=Oe({rx:0,ry:0,mx:50,my:50});return Ee(()=>{!function(){if(Cs||"undefined"==typeof document)return;if(document.getElementById($s))return void(Cs=!0);Cs=!0;const e=document.createElement("style");e.id=$s,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)}()},[]),Ee(()=>{const e=o.current;if(e&&!n&&!r)return e.addEventListener("pointermove",d),e.addEventListener("pointerleave",c),()=>{e.removeEventListener("pointermove",d),e.removeEventListener("pointerleave",c),null!=i.current&&cancelAnimationFrame(i.current)};function l(){if(!e)return;const{rx:t,ry:n,mx:o,my:r}=a.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}%`),i.current=null}function s(){null==i.current&&(i.current=requestAnimationFrame(l))}function d(n){const o=e.getBoundingClientRect(),r=(n.clientX-o.left)/o.width,i=(n.clientY-o.top)/o.height,l=Math.max(0,Math.min(1,r)),d=Math.max(0,Math.min(1,i));a.current={rx:(.5-d)*t*2,ry:(l-.5)*t*2,mx:100*l,my:100*d},e.classList.add("tkx-holo-tracking"),s()}function c(){a.current={rx:0,ry:0,mx:50,my:50},e.classList.remove("tkx-holo-tracking"),s()}},[t,n,r]),o}var Ns=We(function({children:e,maxTilt:t=14,scanLines:n=!0,foilIntensity:o="strong",radius:r=16,disabled:i=!1,className:a,style:l,...s},d){const c=N(),u=zs({maxTilt:t,disabled:i});Ee(()=>{if(!d)return;const e=u.current;"function"==typeof d?d(e):d.current=e},[d,u]);const h={borderRadius:"number"==typeof r?`${r}px`:r,background:`linear-gradient(135deg, ${c.surface}cc, ${c.surfaceAlt}cc)`,border:`1px solid ${c.border}`,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:c.text,...l};/* @__PURE__ */
514
+ /* @__PURE__ */Ke("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 "})]})}var Cs=!1,$s="tkx-holographic-styles";function zs(e={}){const{maxTilt:t=14,disabled:n=!1}=e,o=Oe(null),r=ge(),i=Oe(null),a=Oe({rx:0,ry:0,mx:50,my:50});return Ee(()=>{!function(){if(Cs||"undefined"==typeof document)return;if(document.getElementById($s))return void(Cs=!0);Cs=!0;const e=document.createElement("style");e.id=$s,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)}()},[]),Ee(()=>{const e=o.current;if(e&&!n&&!r)return e.addEventListener("pointermove",d),e.addEventListener("pointerleave",c),()=>{e.removeEventListener("pointermove",d),e.removeEventListener("pointerleave",c),null!=i.current&&cancelAnimationFrame(i.current)};function l(){if(!e)return;const{rx:t,ry:n,mx:o,my:r}=a.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}%`),i.current=null}function s(){null==i.current&&(i.current=requestAnimationFrame(l))}function d(n){const o=e.getBoundingClientRect(),r=(n.clientX-o.left)/o.width,i=(n.clientY-o.top)/o.height,l=Math.max(0,Math.min(1,r)),d=Math.max(0,Math.min(1,i));a.current={rx:(.5-d)*t*2,ry:(l-.5)*t*2,mx:100*l,my:100*d},e.classList.add("tkx-holo-tracking"),s()}function c(){a.current={rx:0,ry:0,mx:50,my:50},e.classList.remove("tkx-holo-tracking"),s()}},[t,n,r]),o}var Ms=We(function({children:e,maxTilt:t=14,scanLines:n=!0,foilIntensity:o="strong",radius:r=16,disabled:i=!1,className:a,style:l,...s},d){const c=M(),u=zs({maxTilt:t,disabled:i});Ee(()=>{if(!d)return;const e=u.current;"function"==typeof d?d(e):d.current=e},[d,u]);const h={borderRadius:"number"==typeof r?`${r}px`:r,background:`linear-gradient(135deg, ${c.surface}cc, ${c.surfaceAlt}cc)`,border:`1px solid ${c.border}`,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:c.text,...l};/* @__PURE__ */
515
515
  return Ye("div",{ref:u,className:["tkx-holo-root",a].filter(Boolean).join(" "),style:h,...s,children:["none"!==o&&/* @__PURE__ */Ke("div",{className:"tkx-holo-foil "+("soft"===o?"tkx-holo-foil-soft":""),"aria-hidden":"true"}),n&&/* @__PURE__ */Ke("div",{className:"tkx-holo-scan","aria-hidden":"true"}),
516
- /* @__PURE__ */Ke("div",{className:"tkx-holo-content",children:e})]})}),Ms=We(function({title:e,subtitle:t,badge:n,children:o,padding:r=24,...i},a){const l=N(),s=He(),d="number"==typeof r?`${r}px`:r;/* @__PURE__ */
517
- return Ke(Ns,{ref:a,role:"article","aria-labelledby":e?s:void 0,...i,style:{minHeight:200,...i.style},children:/* @__PURE__ */Ye("div",{style:{padding:d},children:[(e||n)&&/* @__PURE__ */Ye("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12,marginBottom:t?4:12},children:[e&&/* @__PURE__ */Ke("h3",{id:s,style:{margin:0,fontSize:20,fontWeight:700,letterSpacing:"-0.01em",color:l.text},children:e}),n]}),t&&/* @__PURE__ */Ke("p",{style:{margin:"0 0 16px",color:l.textMuted,fontSize:14},children:t}),o]})})}),Is=We(function({src:e,alt:t,size:n=96,initials:o,scanLines:r=!1,...i},a){const l=N();/* @__PURE__ */
518
- return Ke(Ns,{ref:a,radius:"50%",scanLines:r,...i,style:{width:n,height:n,...i.style},children:e?/* @__PURE__ */Ke("img",{src:e,alt:t,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover",display:"block"}}):/* @__PURE__ */Ke("div",{role:"img","aria-label":t,style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:.36*n,fontWeight:700,color:l.text},children:o??t.charAt(0).toUpperCase()})})}),Ls={sm:"4px 10px",md:"6px 14px",lg:"8px 18px"},Rs={sm:11,md:13,lg:15},Ds=We(function({children:e,size:t="md",scanLines:n=!1,...o},r){/* @__PURE__ */
519
- return Ke(Ns,{ref:r,radius:999,scanLines:n,maxTilt:6,...o,style:{display:"inline-flex",padding:Ls[t],fontSize:Rs[t],fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",...o.style},children:e})}),Ts=We(function({children:e,onClick:t,isDisabled:n=!1,type:o="button",maxTilt:r=8,...i},a){const l=N(),s=ge(),d=Oe(null),c=zs({maxTilt:r,disabled:n});return Ee(()=>{const e=d.current;e&&(c.current=e,"function"==typeof a?a(e):a&&(a.current=e))},[a,c]),/* @__PURE__ */Ye("button",{ref:d,type:o,onClick:n?void 0:t,disabled:n,className:"tkx-holo-root",style:{position:"relative",padding:"14px 28px",fontSize:15,fontWeight:700,letterSpacing:"0.02em",color:l.text,background:`linear-gradient(135deg, ${l.surface}, ${l.surfaceAlt})`,border:`1px solid ${l.primary}55`,borderRadius:12,cursor:n?"not-allowed":"pointer",opacity:n?.5:1,minHeight:44,transformStyle:"preserve-3d",...i.style},...i,children:[
516
+ /* @__PURE__ */Ke("div",{className:"tkx-holo-content",children:e})]})}),Ns=We(function({title:e,subtitle:t,badge:n,children:o,padding:r=24,...i},a){const l=M(),s=He(),d="number"==typeof r?`${r}px`:r;/* @__PURE__ */
517
+ return Ke(Ms,{ref:a,role:"article","aria-labelledby":e?s:void 0,...i,style:{minHeight:200,...i.style},children:/* @__PURE__ */Ye("div",{style:{padding:d},children:[(e||n)&&/* @__PURE__ */Ye("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12,marginBottom:t?4:12},children:[e&&/* @__PURE__ */Ke("h3",{id:s,style:{margin:0,fontSize:20,fontWeight:700,letterSpacing:"-0.01em",color:l.text},children:e}),n]}),t&&/* @__PURE__ */Ke("p",{style:{margin:"0 0 16px",color:l.textMuted,fontSize:14},children:t}),o]})})}),Is=We(function({src:e,alt:t,size:n=96,initials:o,scanLines:r=!1,...i},a){const l=M();/* @__PURE__ */
518
+ return Ke(Ms,{ref:a,radius:"50%",scanLines:r,...i,style:{width:n,height:n,...i.style},children:e?/* @__PURE__ */Ke("img",{src:e,alt:t,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover",display:"block"}}):/* @__PURE__ */Ke("div",{role:"img","aria-label":t,style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:.36*n,fontWeight:700,color:l.text},children:o??t.charAt(0).toUpperCase()})})}),Rs={sm:"4px 10px",md:"6px 14px",lg:"8px 18px"},Ts={sm:11,md:13,lg:15},Ds=We(function({children:e,size:t="md",scanLines:n=!1,...o},r){/* @__PURE__ */
519
+ return Ke(Ms,{ref:r,radius:999,scanLines:n,maxTilt:6,...o,style:{display:"inline-flex",padding:Rs[t],fontSize:Ts[t],fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",...o.style},children:e})}),Ls=We(function({children:e,onClick:t,isDisabled:n=!1,type:o="button",maxTilt:r=8,...i},a){const l=M(),s=ge(),d=Oe(null),c=zs({maxTilt:r,disabled:n});return Ee(()=>{const e=d.current;e&&(c.current=e,"function"==typeof a?a(e):a&&(a.current=e))},[a,c]),/* @__PURE__ */Ye("button",{ref:d,type:o,onClick:n?void 0:t,disabled:n,className:"tkx-holo-root",style:{position:"relative",padding:"14px 28px",fontSize:15,fontWeight:700,letterSpacing:"0.02em",color:l.text,background:`linear-gradient(135deg, ${l.surface}, ${l.surfaceAlt})`,border:`1px solid ${l.primary}55`,borderRadius:12,cursor:n?"not-allowed":"pointer",opacity:n?.5:1,minHeight:44,transformStyle:"preserve-3d",...i.style},...i,children:[
520
520
  /* @__PURE__ */Ke("span",{className:"tkx-holo-foil","aria-hidden":"true"}),
521
- /* @__PURE__ */Ke("span",{className:"tkx-holo-content",style:{display:"inline-block"},children:e}),!s&&!n&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{position:"absolute",inset:-1,borderRadius:12,border:`1px solid ${l.primary}88`,boxShadow:`0 0 24px ${l.primary}44`,pointerEvents:"none",opacity:.6}})]})}),Ws=We(function({columns:e,onReorder:t,renderCard:n,onCardClick:o,maxHeight:r=720,minColumnWidth:i=280,isDragDisabled:a=!1,className:l,style:s},d){const c=N(),u=ge();He();const[h,p]=Ve(null),[f,m]=Ve(""),g=Oe(/* @__PURE__ */new Map),x=Ae((e,t,n,o)=>{a||t.isDragDisabled||0!==e.button&&"mouse"===e.pointerType||(e.currentTarget.setPointerCapture(e.pointerId),p({cardId:t.id,fromColumnId:n.id,fromIndex:o,mode:"pointer",ghostX:0,ghostY:0,toColumnId:n.id,toIndex:o}),m(`Picked up "${t.title}" from ${n.title}, position ${o+1}`))},[a]),b=Ae((e,t,n)=>{if(!h||"pointer"!==h.mode)return;e.currentTarget;const o=g.current.get(h.cardId);if(!o)return;const r=o.getBoundingClientRect();p(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)},[h]),y=Ae(()=>{h&&"pointer"===h.mode&&w(h)},[h]),v=Ae(()=>{h&&(m("Drag cancelled"),p(null))},[h]);function w(n){if(n.fromColumnId!==n.toColumnId||n.fromIndex!==n.toIndex){const o=e.find(e=>e.id===n.toColumnId),r=e.find(e=>e.id===n.fromColumnId)?.cards[n.fromIndex];t({cardId:n.cardId,fromColumnId:n.fromColumnId,fromIndex:n.fromIndex,toColumnId:n.toColumnId,toIndex:n.toIndex}),m(r&&o?`Moved "${r.title}" to ${o.title}, position ${n.toIndex+1}`:"Card moved")}else m("Returned to original position");p(null)}const k=Ae((t,n,o,r)=>{if(a||n.isDragDisabled)return;if(" "===t.key||"Enter"===t.key)return t.preventDefault(),void(h?w(h):(p({cardId:n.id,fromColumnId:o.id,fromIndex:r,mode:"keyboard",toColumnId:o.id,toIndex:r}),m(`Grabbed "${n.title}". Use arrow keys to move. Enter to drop, Esc to cancel.`)));if("Escape"===t.key&&h)return t.preventDefault(),void v();if(!h||"keyboard"!==h.mode||h.cardId!==n.id)return;const i=e.findIndex(e=>e.id===h.toColumnId),l=e[i];if(l)switch(t.key){case"ArrowUp":t.preventDefault(),h.toIndex>0&&(p({...h,toIndex:h.toIndex-1}),m(`Position ${h.toIndex} of ${l.cards.length}`));break;case"ArrowDown":t.preventDefault(),h.toIndex<l.cards.length&&(p({...h,toIndex:h.toIndex+1}),m(`Position ${h.toIndex+2} of ${l.cards.length+1}`));break;case"ArrowLeft":if(t.preventDefault(),i>0){const t=e[i-1];p({...h,toColumnId:t.id,toIndex:Math.min(h.toIndex,t.cards.length)}),m(`Moved to ${t.title}`)}break;case"ArrowRight":if(t.preventDefault(),i<e.length-1){const t=e[i+1];p({...h,toColumnId:t.id,toIndex:Math.min(h.toIndex,t.cards.length)}),m(`Moved to ${t.title}`)}}},[e,h,v,a]);Ee(()=>{if(!h)return;const e=e=>{"Escape"===e.key&&v()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[h,v]);const S=Ae(e=>/* @__PURE__ */Ye(Ue,{children:[e.badges&&e.badges.length>0&&/* @__PURE__ */Ke("div",{style:{display:"flex",gap:6,marginBottom:8,flexWrap:"wrap"},children:e.badges.map((e,t)=>/* @__PURE__ */Ke("span",{style:{padding:"2px 8px",fontSize:10,fontWeight:700,borderRadius:999,background:e.color?`${e.color}22`:`${c.primary}22`,color:e.color??c.primary,letterSpacing:"0.05em",textTransform:"uppercase"},children:e.label},t))}),
521
+ /* @__PURE__ */Ke("span",{className:"tkx-holo-content",style:{display:"inline-block"},children:e}),!s&&!n&&/* @__PURE__ */Ke("span",{"aria-hidden":"true",style:{position:"absolute",inset:-1,borderRadius:12,border:`1px solid ${l.primary}88`,boxShadow:`0 0 24px ${l.primary}44`,pointerEvents:"none",opacity:.6}})]})}),Ws=We(function({columns:e,onReorder:t,renderCard:n,onCardClick:o,maxHeight:r=720,minColumnWidth:i=280,isDragDisabled:a=!1,className:l,style:s},d){const c=M(),u=ge();He();const[h,p]=Ve(null),[f,m]=Ve(""),g=Oe(/* @__PURE__ */new Map),x=Ae((e,t,n,o)=>{a||t.isDragDisabled||0!==e.button&&"mouse"===e.pointerType||(e.currentTarget.setPointerCapture(e.pointerId),p({cardId:t.id,fromColumnId:n.id,fromIndex:o,mode:"pointer",ghostX:0,ghostY:0,toColumnId:n.id,toIndex:o}),m(`Picked up "${t.title}" from ${n.title}, position ${o+1}`))},[a]),b=Ae((e,t,n)=>{if(!h||"pointer"!==h.mode)return;e.currentTarget;const o=g.current.get(h.cardId);if(!o)return;const r=o.getBoundingClientRect();p(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)},[h]),y=Ae(()=>{h&&"pointer"===h.mode&&w(h)},[h]),v=Ae(()=>{h&&(m("Drag cancelled"),p(null))},[h]);function w(n){if(n.fromColumnId!==n.toColumnId||n.fromIndex!==n.toIndex){const o=e.find(e=>e.id===n.toColumnId),r=e.find(e=>e.id===n.fromColumnId)?.cards[n.fromIndex];t({cardId:n.cardId,fromColumnId:n.fromColumnId,fromIndex:n.fromIndex,toColumnId:n.toColumnId,toIndex:n.toIndex}),m(r&&o?`Moved "${r.title}" to ${o.title}, position ${n.toIndex+1}`:"Card moved")}else m("Returned to original position");p(null)}const k=Ae((t,n,o,r)=>{if(a||n.isDragDisabled)return;if(" "===t.key||"Enter"===t.key)return t.preventDefault(),void(h?w(h):(p({cardId:n.id,fromColumnId:o.id,fromIndex:r,mode:"keyboard",toColumnId:o.id,toIndex:r}),m(`Grabbed "${n.title}". Use arrow keys to move. Enter to drop, Esc to cancel.`)));if("Escape"===t.key&&h)return t.preventDefault(),void v();if(!h||"keyboard"!==h.mode||h.cardId!==n.id)return;const i=e.findIndex(e=>e.id===h.toColumnId),l=e[i];if(l)switch(t.key){case"ArrowUp":t.preventDefault(),h.toIndex>0&&(p({...h,toIndex:h.toIndex-1}),m(`Position ${h.toIndex} of ${l.cards.length}`));break;case"ArrowDown":t.preventDefault(),h.toIndex<l.cards.length&&(p({...h,toIndex:h.toIndex+1}),m(`Position ${h.toIndex+2} of ${l.cards.length+1}`));break;case"ArrowLeft":if(t.preventDefault(),i>0){const t=e[i-1];p({...h,toColumnId:t.id,toIndex:Math.min(h.toIndex,t.cards.length)}),m(`Moved to ${t.title}`)}break;case"ArrowRight":if(t.preventDefault(),i<e.length-1){const t=e[i+1];p({...h,toColumnId:t.id,toIndex:Math.min(h.toIndex,t.cards.length)}),m(`Moved to ${t.title}`)}}},[e,h,v,a]);Ee(()=>{if(!h)return;const e=e=>{"Escape"===e.key&&v()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[h,v]);const S=Ae(e=>/* @__PURE__ */Ye(Ue,{children:[e.badges&&e.badges.length>0&&/* @__PURE__ */Ke("div",{style:{display:"flex",gap:6,marginBottom:8,flexWrap:"wrap"},children:e.badges.map((e,t)=>/* @__PURE__ */Ke("span",{style:{padding:"2px 8px",fontSize:10,fontWeight:700,borderRadius:999,background:e.color?`${e.color}22`:`${c.primary}22`,color:e.color??c.primary,letterSpacing:"0.05em",textTransform:"uppercase"},children:e.label},t))}),
522
522
  /* @__PURE__ */Ke("div",{style:{fontSize:14,fontWeight:600,color:c.text,lineHeight:1.4},children:e.title}),e.description&&/* @__PURE__ */Ke("div",{style:{fontSize:12,color:c.textMuted,marginTop:6,lineHeight:1.5},children:e.description}),e.assignee&&/* @__PURE__ */Ye("div",{style:{marginTop:10,display:"flex",alignItems:"center",gap:6,fontSize:11,color:c.textMuted},children:[e.assignee.avatarUrl?/* @__PURE__ */Ke("img",{src:e.assignee.avatarUrl,alt:"",style:{width:20,height:20,borderRadius:"50%"}}):/* @__PURE__ */Ke("div",{"aria-hidden":"true",style:{width:20,height:20,borderRadius:"50%",background:c.primary,color:c.bg,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:700},children:e.assignee.name.charAt(0).toUpperCase()}),/* @__PURE__ */Ke("span",{children:e.assignee.name})]})]}),[c]),C=je(()=>({display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${i}px, 1fr)`,gap:12,overflowX:"auto",maxHeight:"number"==typeof r?`${r}px`:r,padding:4,...s}),[r,i,s]);/* @__PURE__ */
523
523
  return Ye("div",{ref:d,className:l,role:"grid","aria-label":"Kanban board","aria-rowcount":Math.max(...e.map(e=>e.cards.length),0)+1,"aria-colcount":e.length,style:C,children:[/* @__PURE__ */Ke("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:f}),e.map((e,t)=>{const r=h?.toColumnId===e.id,i=void 0!==e.wipLimit&&e.cards.length>=e.wipLimit;/* @__PURE__ */
524
524
  return Ye("section",{role:"row","aria-rowindex":t+1,"aria-label":`Column: ${e.title}`,style:{background:c.surface,border:`1px solid ${r?e.color??c.primary:c.border}`,borderRadius:12,display:"flex",flexDirection:"column",minHeight:0,transition:"border-color 120ms"},children:[/* @__PURE__ */Ye("header",{style:{padding:"12px 14px",borderBottom:`1px solid ${c.border}`,display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[
@@ -526,8 +526,46 @@ return Ye("section",{role:"row","aria-rowindex":t+1,"aria-label":`Column: ${e.ti
526
526
  /* @__PURE__ */Ke("h3",{style:{margin:0,fontSize:13,fontWeight:700,color:c.text,letterSpacing:"0.02em",flex:1},children:e.title}),
527
527
  /* @__PURE__ */Ye("span",{style:{fontSize:12,color:i?c.danger:c.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}`]})]}),/* @__PURE__ */Ye("div",{style:{padding:8,display:"flex",flexDirection:"column",gap:8,overflowY:"auto",flex:1,minHeight:60},children:[e.cards.map((r,i)=>{const l=h?.cardId===r.id;/* @__PURE__ */
528
528
  return Ye("div",{children:[h&&h.toColumnId===e.id&&h.toIndex===i&&!l&&/* @__PURE__ */Ke(As,{color:e.color??c.primary}),/* @__PURE__ */Ke("div",{ref:e=>{e?g.current.set(r.id,e):g.current.delete(r.id)},role:"gridcell","aria-rowindex":i+1,"aria-colindex":t+1,"aria-grabbed":l,"aria-label":r.title,tabIndex:0,"data-card-id":r.id,onPointerDown:t=>x(t,r,e,i),onPointerMove:t=>"pointer"===h?.mode?b(t,e,i):void 0,onPointerUp:y,onPointerCancel:v,onKeyDown:t=>k(t,r,e,i),onClick:()=>{h||o?.(r,e)},style:{padding:12,borderRadius:8,background:c.surfaceAlt,border:`1px solid ${l?e.color??c.primary:c.border}`,cursor:a||r.isDragDisabled?"default":"grab",touchAction:a||r.isDragDisabled?"auto":"none",opacity:l?.4:1,transform:l&&"pointer"===h.mode&&!u?`translate(${h.ghostX??0}px, ${h.ghostY??0}px) scale(1.02)`:void 0,transition:l||u?"none":"transform 120ms, border-color 120ms",userSelect:"none",outlineOffset:2},children:(n??S)(r,e)})]},`slot-${i}`)}),h&&h.toColumnId===e.id&&h.toIndex>=e.cards.length&&/* @__PURE__ */Ke(As,{color:e.color??c.primary}),0===e.cards.length&&!h&&/* @__PURE__ */Ke("div",{style:{padding:24,textAlign:"center",color:c.textMuted,fontSize:12,border:`1px dashed ${c.border}`,borderRadius:8},children:"No cards"})]})]},e.id)})]})});function As({color:e}){/* @__PURE__ */
529
- return Ke("div",{"aria-hidden":"true",style:{height:3,background:e,borderRadius:999,margin:"2px 0",boxShadow:`0 0 8px ${e}66`}})}var Bs=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"]),Es=new Set(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","NOSCRIPT","TEMPLATE","META","LINK","BASE","FORM","INPUT","BUTTON","TEXTAREA","SELECT"]),Hs=new Set(["href","src","alt","title"]);function Fs(e){if(!e)return null;const t=e.trim().toLowerCase();return t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:")?null:e.trim()}function js(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 Ps(e){if("undefined"==typeof document)return e;const t=document.createElement("div");return t.innerHTML=e,Os(t),t.innerHTML}function Os(e){const t=Array.from(e.childNodes);for(const n of t)if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(Es.has(t.tagName)){e.removeChild(t);continue}if(!Bs.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(Hs.has(e.name)){if("href"===e.name&&"A"===t.tagName){const n=Fs(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&&(js(e.value)||t.removeAttribute("src"))}else t.removeAttribute(e.name);Os(t)}else n.nodeType===Node.COMMENT_NODE&&e.removeChild(n)}var Vs=[{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:"—"}],Us=We(function({initialValue:e="",onChange:t,placeholder:n="Start writing…",tools:o,maxHeight:r,minHeight:i=200,label:a="Rich text editor",isDisabled:l=!1,className:s,style:d,topSlot:c,bottomSlot:u},h){const p=N(),f=Oe(null),m=He(),[g,x]=Ve(/* @__PURE__ */new Set),[b,y]=Ve(!0),v=o??Vs.map(e=>e.id),w=Ae(()=>{if(!f.current)return;const e=Ps(f.current.innerHTML);t?.(e),y(""===f.current.textContent?.trim())},[t]);Fe(h,()=>({getHTML:()=>Ps(f.current?.innerHTML??""),getMarkdown:()=>function(e){if("undefined"==typeof document)return e;const t=document.createElement("div");return t.innerHTML=Ps(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`![${o.getAttribute("alt")||""}](${e})`}default:return r}}(t).trim()}(f.current?.innerHTML??""),getText:()=>f.current?.textContent??"",setHTML:e=>{f.current&&(f.current.innerHTML=Ps(e),w())},focus:()=>f.current?.focus()})),Ee(()=>{f.current&&e&&(f.current.innerHTML=Ps(e),y(""===f.current.textContent?.trim()))},[]);const k=Ae(()=>{if("undefined"==typeof document)return;const e=/* @__PURE__ */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{}x(e)},[]);Ee(()=>(document.addEventListener("selectionchange",k),()=>document.removeEventListener("selectionchange",k)),[k]);const S=Ae(e=>{if(l)return;f.current?.focus();const t=Vs.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=Fs(t);if(!o){window.alert("That URL is not allowed.");break}const r=e||o;document.execCommand("insertHTML",!1,`<a href="${Ks(o)}" target="_blank" rel="noopener noreferrer">${n=r,n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</a>`);break}case"image":{const e=window.prompt("Image URL (https:// or data:image/…)");if(!e)break;const t=js(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="${Ks(t)}" alt="${Ks(n)}" />`);break}case"hr":document.execCommand("insertHTML",!1,"<hr />");break;default:t?.cmd&&document.execCommand(t.cmd,!1)}var n;w(),k()},[l,w,k]),C=Ae(e=>{if(!e.metaKey&&!e.ctrlKey)return;const t=e.key.toLowerCase();"b"===t?(e.preventDefault(),S("bold")):"i"===t?(e.preventDefault(),S("italic")):"u"===t?(e.preventDefault(),S("underline")):"k"===t&&(e.preventDefault(),S("link"))},[S]),$=Ae(e=>{e.preventDefault();const t=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain");t?document.execCommand("insertHTML",!1,Ps(t)):n&&document.execCommand("insertText",!1,n),w()},[w]),z=Ae(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()))},[]),M={border:`1px solid ${p.border}`,borderRadius:12,background:p.surface,...d},I={display:"flex",flexWrap:"wrap",gap:4,padding:8,borderBottom:`1px solid ${p.border}`,background:p.surfaceAlt,borderTopLeftRadius:12,borderTopRightRadius:12},L={padding:16,outline:"none",minHeight:"number"==typeof i?`${i}px`:i,maxHeight:"number"==typeof r?`${r}px`:r,overflowY:r?"auto":"visible",color:p.text,fontSize:15,lineHeight:1.6,borderBottomLeftRadius:12,borderBottomRightRadius:12,cursor:l?"not-allowed":"text",opacity:l?.6:1};/* @__PURE__ */
530
- return Ye("div",{className:s,style:M,children:[c,
529
+ return Ke("div",{"aria-hidden":"true",style:{height:3,background:e,borderRadius:999,margin:"2px 0",boxShadow:`0 0 8px ${e}66`}})}var Bs=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"]),Es=new Set(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","NOSCRIPT","TEMPLATE","META","LINK","BASE","FORM","INPUT","BUTTON","TEXTAREA","SELECT"]),Hs=new Set(["href","src","alt","title"]);function Fs(e){if(!e)return null;const t=e.trim().toLowerCase();return t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:")?null:e.trim()}function js(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 Ps(e){if("undefined"==typeof document)return e;const t=document.createElement("div");return t.innerHTML=e,Os(t),t.innerHTML}function Os(e){const t=Array.from(e.childNodes);for(const n of t)if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(Es.has(t.tagName)){e.removeChild(t);continue}if(!Bs.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(Hs.has(e.name)){if("href"===e.name&&"A"===t.tagName){const n=Fs(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&&(js(e.value)||t.removeAttribute("src"))}else t.removeAttribute(e.name);Os(t)}else n.nodeType===Node.COMMENT_NODE&&e.removeChild(n)}var Vs=[{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:"—"}],Us=We(function({initialValue:e="",onChange:t,placeholder:n="Start writing…",tools:o,maxHeight:r,minHeight:i=200,label:a="Rich text editor",isDisabled:l=!1,className:s,style:d,topSlot:c,bottomSlot:u},h){const p=M(),f=Oe(null),m=He(),[g,x]=Ve(/* @__PURE__ */new Set),[b,y]=Ve(!0),v=o??Vs.map(e=>e.id),w=Ae(()=>{if(!f.current)return;const e=Ps(f.current.innerHTML);t?.(e),y(""===f.current.textContent?.trim())},[t]);Fe(h,()=>({getHTML:()=>Ps(f.current?.innerHTML??""),getMarkdown:()=>function(e){if("undefined"==typeof document)return e;const t=document.createElement("div");return t.innerHTML=Ps(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`![${o.getAttribute("alt")||""}](${e})`}default:return r}}(t).trim()}(f.current?.innerHTML??""),getText:()=>f.current?.textContent??"",setHTML:e=>{f.current&&(f.current.innerHTML=Ps(e),w())},focus:()=>f.current?.focus()})),Ee(()=>{f.current&&e&&(f.current.innerHTML=Ps(e),y(""===f.current.textContent?.trim()))},[]);const k=Ae(()=>{if("undefined"==typeof document)return;const e=/* @__PURE__ */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{}x(e)},[]);Ee(()=>(document.addEventListener("selectionchange",k),()=>document.removeEventListener("selectionchange",k)),[k]);const S=Ae(e=>{if(l)return;f.current?.focus();const t=Vs.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=Fs(t);if(!o){window.alert("That URL is not allowed.");break}const r=e||o;document.execCommand("insertHTML",!1,`<a href="${Ks(o)}" target="_blank" rel="noopener noreferrer">${n=r,n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</a>`);break}case"image":{const e=window.prompt("Image URL (https:// or data:image/…)");if(!e)break;const t=js(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="${Ks(t)}" alt="${Ks(n)}" />`);break}case"hr":document.execCommand("insertHTML",!1,"<hr />");break;default:t?.cmd&&document.execCommand(t.cmd,!1)}var n;w(),k()},[l,w,k]),C=Ae(e=>{if(!e.metaKey&&!e.ctrlKey)return;const t=e.key.toLowerCase();"b"===t?(e.preventDefault(),S("bold")):"i"===t?(e.preventDefault(),S("italic")):"u"===t?(e.preventDefault(),S("underline")):"k"===t&&(e.preventDefault(),S("link"))},[S]),$=Ae(e=>{e.preventDefault();const t=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain");t?document.execCommand("insertHTML",!1,Ps(t)):n&&document.execCommand("insertText",!1,n),w()},[w]),z=Ae(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()))},[]),N={border:`1px solid ${p.border}`,borderRadius:12,background:p.surface,...d},I={display:"flex",flexWrap:"wrap",gap:4,padding:8,borderBottom:`1px solid ${p.border}`,background:p.surfaceAlt,borderTopLeftRadius:12,borderTopRightRadius:12},R={padding:16,outline:"none",minHeight:"number"==typeof i?`${i}px`:i,maxHeight:"number"==typeof r?`${r}px`:r,overflowY:r?"auto":"visible",color:p.text,fontSize:15,lineHeight:1.6,borderBottomLeftRadius:12,borderBottomRightRadius:12,cursor:l?"not-allowed":"text",opacity:l?.6:1};/* @__PURE__ */
530
+ return Ye("div",{className:s,style:N,children:[c,
531
531
  /* @__PURE__ */Ke("div",{role:"toolbar","aria-label":"Formatting","aria-controls":m,onKeyDown:z,style:I,children:v.map((e,t)=>{const n=Vs.find(t=>t.id===e);if(!n)return null;const o=g.has(e);/* @__PURE__ */
532
532
  return Ke("button",{type:"button","data-tool":n.id,tabIndex:0===t?0:-1,"aria-label":n.label+(n.shortcut?` (${n.shortcut})`:""),"aria-pressed":o,disabled:l,onMouseDown:e=>e.preventDefault(),onClick:()=>S(n.id),style:{background:o?p.primary:"transparent",color:o?p.bg:p.text,border:`1px solid ${o?p.primary:"transparent"}`,padding:"6px 10px",borderRadius:6,cursor:l?"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)})}),
533
- /* @__PURE__ */Ye("div",{style:{position:"relative"},children:[/* @__PURE__ */Ke("div",{ref:f,id:m,role:"textbox","aria-label":a,"aria-multiline":"true","aria-readonly":l,contentEditable:!l,suppressContentEditableWarning:!0,onInput:w,onKeyDown:C,onPaste:$,spellCheck:!0,style:L}),b&&!l&&/* @__PURE__ */Ke("div",{"aria-hidden":"true",style:{position:"absolute",top:16,left:16,color:p.textMuted,pointerEvents:"none",fontSize:15},children:n})]}),u]})});function Ks(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;")}export{Ja as COUNTRIES,ls as FocusTrap,ye as I18nContext,rs as I18nProvider,d as LRUCache,as as LiveRegion,r as Quantum,Vi as SIZE_BORDER_RADIUS,ji as SIZE_FONT,Fi as SIZE_HEIGHT,Ui as SIZE_ICON,Pi as SIZE_PADDING_X,Oi as SIZE_PADDING_Y,se as SecurityCore,X as Shield,is as SkipNav,h as TKX,L as ThemeContext,$ as ThemeProvider,xs as TkxAIChatBubble,ms as TkxAIConfidenceBar,Ss as TkxAIThinking,El as TkxAadhaarInput,cn as TkxAccordion,ml as TkxAddressInput,Ia as TkxAffix,mt as TkxAlert,Ta as TkxAnchor,Er as TkxAppBar,wr as TkxAutocomplete,Tt as TkxAvatar,st as TkxBadge,_l as TkxBillingCycleToggle,Fr as TkxBottomNav,xr as TkxBreadcrumb,Qe as TkxButton,Ll as TkxCalendarLunar,Va as TkxCaptcha,tt as TkxCard,ot as TkxCardBody,rt as TkxCardFooter,nt as TkxCardHeader,fr as TkxCarousel,Aa as TkxCascader,oo as TkxChat,no as TkxChatBubble,Ot as TkxCheckbox,Rl as TkxCheckout,Io as TkxClock,Ti as TkxCol,Jo as TkxColorPicker,hr as TkxCommand,vl as TkxConfetti,Ai as TkxConfigProvider,zi as TkxContent,ga as TkxCountdown,xl as TkxCurrencyInput,Jr as TkxDataGrid,Nn as TkxDatePicker,Bt as TkxDivider,mn as TkxDrawer,Xl as TkxDrivingLicenceInput,ps as TkxDropdown,ua as TkxEmpty,Vn as TkxFileUpload,Ga as TkxFontProvider,Ni as TkxFooter,Me as TkxForm,Ne as TkxFormField,Si as TkxHeader,Is as TkxHolographicAvatar,Ds as TkxHolographicBadge,Ts as TkxHolographicButton,Ms as TkxHolographicCard,Ns as TkxHolographicSurface,Fn as TkxImage,al as TkxImageEditor,it as TkxInput,Ws as TkxKanban,ki as TkxLayout,Ha as TkxList,bi as TkxMarkdown,ei as TkxMasonry,ya as TkxMentions,Co as TkxMenu,yt as TkxModal,or as TkxNumberInput,lr as TkxOTP,ts as TkxOrgChart,An as TkxPagination,jl as TkxPanInput,oa as TkxParagraph,ul as TkxPaymentButton,ol as TkxPhoneInput,Gl as TkxPlanSelector,br as TkxPopover,ut as TkxProgress,Zl as TkxProrationPreview,wa as TkxQRCode,Kt as TkxRadio,Yt as TkxRadioGroup,Zn as TkxRating,Sa as TkxResult,Us as TkxRichEditor,ri as TkxRichTextDisplay,Li as TkxRow,Cl as TkxSEO,ba as TkxSegmented,jt as TkxSelect,$i as TkxSider,hl as TkxSignaturePad,Lt as TkxSkeleton,Tn as TkxSlider,Vr as TkxSnackbar,bl as TkxSortable,Ar as TkxSpeedDial,sa as TkxSpin,ma as TkxStatistic,Po as TkxStepper,Ct as TkxTab,St as TkxTabList,zt as TkxTabPanel,$t as TkxTabPanels,At as TkxTable,kt as TkxTabs,so as TkxTag,co as TkxTagInput,na as TkxText,to as TkxThinkingIndicator,go as TkxTimeline,ta as TkxTitle,an as TkxToastProvider,pt as TkxToggle,zr as TkxToolbar,Mt as TkxTooltip,Ca as TkxTour,Dr as TkxTransferList,Cr as TkxTreeView,Ao as TkxVideoPlayer,Vl as TkxVoterIdInput,Na as TkxWatermark,ss as VisuallyHidden,y as WCAGEngine,q as audit,M as auroraLight,i as batchUpdate,v as breakpoints,re as buildTkxCSP,b as contrastRatio,D as createFocusTrap,te as createRateLimiter,p as createTheme,o as css,n as cssVar,le as cx,_ as deepFreeze,ne as extractAtomicCSS,s as extractCSS,a as fnv1aHash,k as fromObject,z as generatePalette,A as getAccessibleForeground,G as getAuditLog,_i as getLocaleDisplayName,e as injectStyles,V as installFrameBuster,de as installTrustedTypes,he as isFramed,ke as isRTL,Gi as isRtlLocale,K as isSafeAttrName,Wl as isValidAadhaar,Kl as isValidDrivingLicence,Fl as isValidPan,Ol as isValidVoterId,w as keyframes,_a as loadFontScript,W as meetsAA,u as meetsAAA,c as memoize,t as prefersHighContrast,T as prefersReducedMotion,I as quantumDark,m as radii,ie as resetAtomicCSS,Z as resolvePluginUtility,l as responsive,ue as sanitizeCSS,P as sanitizeHTML,E as sanitizeHref,ce as sanitizeJSON,O as sanitizeProps,F as sanitizeString,H as sanitizeUnicode,qa as scriptsForLanguage,j as scrubPII,$l as seoSchema,S as shadows,Q as sniffMimeType,R as spacing,U as tkx,oe as tkxListPlugins,ae as tkxPlugin,Y as tkxRemovePlugin,ee as tx,g as typography,Za as unloadFontScript,be as useAnnounce,me as useClickOutside,Hi as useComponentSize,Bi as useConfig,za as useDevtoolsOpen,Se as useDirection,xe as useEscapeKey,fe as useFocusTrap,pe as useHighContrast,Ce as useI18n,$e as useLocale,Yi as useLogicalSpacing,x as usePrefersColorScheme,Ei as usePrefixCls,ge as useReducedMotion,Ki as useRtlFlip,N as useTheme,sr as useTkxCommand,ze as useTkxForm,en as useToast,B as validateProps,J as verifyAuditIntegrity,C as zIndex};
533
+ /* @__PURE__ */Ye("div",{style:{position:"relative"},children:[/* @__PURE__ */Ke("div",{ref:f,id:m,role:"textbox","aria-label":a,"aria-multiline":"true","aria-readonly":l,contentEditable:!l,suppressContentEditableWarning:!0,onInput:w,onKeyDown:C,onPaste:$,spellCheck:!0,style:R}),b&&!l&&/* @__PURE__ */Ke("div",{"aria-hidden":"true",style:{position:"absolute",top:16,left:16,color:p.textMuted,pointerEvents:"none",fontSize:15},children:n})]}),u]})});function Ks(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var Ys=[{key:"bg",label:"Page background",group:"surface"},{key:"surface",label:"Card surface",group:"surface"},{key:"surfaceAlt",label:"Alt surface",group:"surface"},{key:"border",label:"Border",group:"surface"},{key:"text",label:"Body text",group:"text",contrastAgainst:"bg",threshold:7},{key:"textMuted",label:"Muted text",group:"text",contrastAgainst:"bg",threshold:4.5},{key:"primary",label:"Primary",group:"brand",contrastAgainst:"bg",threshold:4.5},{key:"secondary",label:"Secondary",group:"brand",contrastAgainst:"bg",threshold:4.5},{key:"success",label:"Success",group:"status",contrastAgainst:"bg",threshold:4.5},{key:"warning",label:"Warning",group:"status",contrastAgainst:"bg",threshold:4.5},{key:"danger",label:"Danger",group:"status",contrastAgainst:"bg",threshold:4.5},{key:"info",label:"Info",group:"status",contrastAgainst:"bg",threshold:4.5}],Xs={surface:"Surfaces",text:"Text",brand:"Brand",status:"Status colors"};function qs(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gs(e){const t=e.replace(/^#/,"").match(/^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);if(!t)return 0;const[n,o,r]=[t[1],t[2],t[3]].map(e=>parseInt(e,16));return.2126*qs(n)+.7152*qs(o)+.0722*qs(r)}function Js({initialTheme:e,onChange:t,onExport:n,preview:o,exportName:r="myTheme",className:i,style:a}){const l=M(),s=e??l,[d,c]=Ve(s),[u,h]=Ve("ts"),[p,f]=Ve(!1),m=Ae((e,n)=>{c(o=>{const r={...o,[e]:n};return t?.(r),r})},[t]),g=je(()=>"json"===u?function(e){return JSON.stringify(e,null,2)}(d):"ts"===u?function(e,t="myTheme"){const n=["import type { ThemeTokens } from 'tekivex-ui';",""];n.push(`export const ${t}: ThemeTokens = {`);for(const[o,r]of Object.entries(e))n.push(` ${o}: ${JSON.stringify(r)},`);return n.push("};"),n.join("\n")}(d,r):function(e){const t=[":root {"];for(const[n,o]of Object.entries(e))t.push(` --tkx-${n}: ${o};`);return t.push("}"),t.join("\n")}(d),[d,u,r]),x=Ae(()=>{c(s),t?.(s)},[s,t]),b=je(()=>{const e={surface:[],text:[],brand:[],status:[]};for(const t of Ys)e[t.group].push(t);return e},[]);/* @__PURE__ */
534
+ return Ye("div",{className:i,style:{display:"grid",gridTemplateColumns:"minmax(300px, 380px) 1fr",gap:16,color:l.text,...a},role:"region","aria-label":"Theme editor",children:[
535
+ /* @__PURE__ */Ke("style",{children:"\n @media (max-width: 760px) {\n .tk-studio-grid { grid-template-columns: 1fr !important; }\n }\n "}),
536
+ /* @__PURE__ */Ye("aside",{style:{background:l.surface,border:`1px solid ${l.border}`,borderRadius:12,padding:16,display:"flex",flexDirection:"column",gap:16,maxHeight:"80vh",overflowY:"auto"},children:[
537
+ /* @__PURE__ */Ye("header",{style:{display:"flex",alignItems:"center",gap:8},children:[/* @__PURE__ */Ke("h2",{style:{margin:0,fontSize:16,fontWeight:800,letterSpacing:"-0.01em",flex:1},children:"Theme Studio"}),/* @__PURE__ */Ke("button",{type:"button",onClick:x,style:Qs(l),"aria-label":"Reset to original theme",children:"↺ Reset"})]}),Object.keys(b).map(e=>/* @__PURE__ */Ye("section",{children:[/* @__PURE__ */Ke("h3",{style:{margin:"0 0 10px",fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.08em",color:l.textMuted},children:Xs[e]}),/* @__PURE__ */Ke("div",{style:{display:"flex",flexDirection:"column",gap:10},children:b[e].map(e=>/* @__PURE__ */Ke(_s,{slot:e,value:d[e.key],pairedValue:e.contrastAgainst?d[e.contrastAgainst]:void 0,onChange:t=>m(e.key,t)},e.key))})]},e)),
538
+ /* @__PURE__ */Ye("section",{style:{marginTop:8},children:[
539
+ /* @__PURE__ */Ke("h3",{style:{margin:"0 0 10px",fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.08em",color:l.textMuted},children:"Export"}),
540
+ /* @__PURE__ */Ke("div",{role:"tablist",style:{display:"flex",gap:4,marginBottom:8},children:["ts","json","css"].map(e=>/* @__PURE__ */Ke("button",{role:"tab",type:"button","aria-selected":u===e,onClick:()=>h(e),style:ed(l,u===e),children:e.toUpperCase()},e))}),
541
+ /* @__PURE__ */Ke("pre",{style:{margin:0,padding:12,background:l.bg,border:`1px solid ${l.border}`,borderRadius:8,fontSize:11,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",color:l.text,maxHeight:200,overflow:"auto",lineHeight:1.5,whiteSpace:"pre"},children:/* @__PURE__ */Ke("code",{children:g})}),
542
+ /* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,marginTop:8},children:[/* @__PURE__ */Ke("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(g),f(!0),setTimeout(()=>f(!1),1500)},style:td(l),children:p?"✓ Copied":"📋 Copy"}),/* @__PURE__ */Ke("button",{type:"button",onClick:()=>n?.(u,g),disabled:!n,style:nd(l,!n),children:"Save…"})]})]})]}),
543
+ /* @__PURE__ */Ke("section",{"aria-label":"Theme preview",style:{background:d.bg,border:`1px solid ${d.border}`,borderRadius:12,padding:24,minHeight:480,color:d.text},children:/* @__PURE__ */Ke($,{theme:d,children:o??/* @__PURE__ */Ke(Zs,{})})})]})}function _s({slot:e,value:t,pairedValue:n,onChange:o}){const r=M(),i=n?function(e,t){const n=Gs(e),o=Gs(t),[r,i]=n>o?[n,o]:[o,n];return(r+.05)/(i+.05)}(t,n):null,a=i?function(e){return e>=7?{label:"AAA",color:"#06d6a0"}:e>=4.5?{label:"AA",color:"#ffbe0b"}:e>=3?{label:"AA Large",color:"#ff8500"}:{label:"fail",color:"#f72585"}}(i):null,l=e.threshold&&null!==i?i>=e.threshold:null;/* @__PURE__ */
544
+ return Ye("div",{style:{display:"grid",gridTemplateColumns:"32px 1fr auto",gap:10,alignItems:"center"},children:[
545
+ /* @__PURE__ */Ke("input",{type:"color",value:t,onChange:e=>o(e.target.value),"aria-label":`${e.label} color`,style:{width:32,height:32,padding:0,border:`1px solid ${r.border}`,borderRadius:6,background:"transparent",cursor:"pointer"}}),
546
+ /* @__PURE__ */Ye("div",{style:{minWidth:0},children:[/* @__PURE__ */Ke("div",{style:{fontSize:13,fontWeight:600,color:r.text},children:e.label}),/* @__PURE__ */Ke("input",{type:"text",value:t,onChange:e=>{const t=e.target.value;/^#[0-9a-f]{0,6}$/i.test(t)&&o(t)},"aria-label":`${e.label} hex`,style:{background:"transparent",border:"none",color:r.textMuted,fontFamily:"monospace",fontSize:12,padding:0,outline:"none",width:"100%"}})]}),a&&/* @__PURE__ */Ye("span",{title:`Contrast vs ${e.contrastAgainst}: ${i?.toFixed(2)}:1 — needs ${e.threshold}:1`,style:{padding:"3px 8px",borderRadius:999,fontSize:10,fontWeight:700,background:!1===l?"#f7258522":`${a.color}22`,color:!1===l?"#f72585":a.color,letterSpacing:"0.04em",whiteSpace:"nowrap"},children:[i?.toFixed(1)," · ",a.label]})]})}function Zs(){const e=M();/* @__PURE__ */
547
+ return Ye("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[
548
+ /* @__PURE__ */Ke("h2",{style:{margin:0,fontSize:24,fontWeight:800,color:e.text},children:"Live preview"}),
549
+ /* @__PURE__ */Ke("p",{style:{margin:0,color:e.textMuted},children:"Edit the tokens on the left. Sample components render here with the current theme. Contrast badges flag any token that fails WCAG."}),
550
+ /* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[
551
+ /* @__PURE__ */Ke("button",{style:od(e.primary,e.bg),children:"Primary"}),
552
+ /* @__PURE__ */Ke("button",{style:od(e.secondary,e.bg),children:"Secondary"}),
553
+ /* @__PURE__ */Ke("button",{style:od(e.success,e.bg),children:"Success"}),
554
+ /* @__PURE__ */Ke("button",{style:od(e.warning,e.bg),children:"Warning"}),
555
+ /* @__PURE__ */Ke("button",{style:od(e.danger,e.bg),children:"Danger"}),
556
+ /* @__PURE__ */Ke("button",{style:od(e.info,e.bg),children:"Info"})]}),
557
+ /* @__PURE__ */Ye("div",{style:{padding:16,background:e.surface,border:`1px solid ${e.border}`,borderRadius:12},children:[/* @__PURE__ */Ke("h3",{style:{margin:"0 0 6px",fontSize:16,fontWeight:700,color:e.text},children:"Card surface"}),/* @__PURE__ */Ye("p",{style:{margin:0,color:e.textMuted,fontSize:13},children:["Cards use the ",
558
+ /* @__PURE__ */Ke("code",{children:"surface"})," token with ",
559
+ /* @__PURE__ */Ke("code",{children:"border"})," as outline."]})]}),
560
+ /* @__PURE__ */Ye("div",{style:{padding:16,background:e.surfaceAlt,border:`1px solid ${e.border}`,borderRadius:12},children:[/* @__PURE__ */Ke("h3",{style:{margin:"0 0 6px",fontSize:16,fontWeight:700,color:e.text},children:"Alt surface"}),/* @__PURE__ */Ke("p",{style:{margin:0,color:e.textMuted,fontSize:13},children:"Used for nested panels (e.g. modal headers, kanban cards)."})]}),
561
+ /* @__PURE__ */Ke("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["primary","secondary","success","warning","danger","info"].map(t=>/* @__PURE__ */Ke("span",{style:rd(e[t]),children:t},t))}),
562
+ /* @__PURE__ */Ke("input",{type:"text",placeholder:"Sample input",style:{background:e.surface,border:`1px solid ${e.border}`,color:e.text,padding:"10px 14px",borderRadius:8,fontSize:14,outline:"none",minHeight:44}}),
563
+ /* @__PURE__ */Ke("p",{style:{color:e.text,fontSize:14,margin:0},children:"Body text on page background — must be 7:1 for AAA."}),
564
+ /* @__PURE__ */Ke("p",{style:{color:e.textMuted,fontSize:13,margin:0},children:"Muted text — must be at least 4.5:1."})]})}var Qs=e=>({background:"transparent",border:`1px solid ${e.border}`,color:e.textMuted,padding:"6px 12px",borderRadius:6,fontSize:12,cursor:"pointer",fontWeight:600}),ed=(e,t)=>({flex:1,background:t?e.primary:"transparent",color:t?e.bg:e.text,border:`1px solid ${t?e.primary:e.border}`,padding:"6px 10px",borderRadius:6,fontSize:11,fontWeight:700,cursor:"pointer",letterSpacing:"0.05em"}),td=e=>({flex:1,background:e.primary,color:e.bg,border:"none",padding:"8px 14px",borderRadius:6,fontSize:12,fontWeight:700,cursor:"pointer",minHeight:36}),nd=(e,t)=>({flex:1,background:"transparent",color:e.textMuted,border:`1px solid ${e.border}`,padding:"8px 14px",borderRadius:6,fontSize:12,fontWeight:600,cursor:t?"not-allowed":"pointer",opacity:t?.5:1,minHeight:36}),od=(e,t)=>({background:e,color:t,padding:"8px 14px",border:"none",borderRadius:6,fontWeight:700,fontSize:12,cursor:"pointer",minHeight:36}),rd=e=>({padding:"4px 10px",background:`${e}22`,color:e,fontSize:11,fontWeight:700,letterSpacing:"0.05em",textTransform:"uppercase",borderRadius:999,border:`1px solid ${e}55`}),id=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ad=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function ld(e){return e.toISOString().slice(0,10)}function sd(e){return Date,new Date(e)}function dd(e,t){const n=new Date(e);return n.setUTCHours(0,0,0,0),n.setUTCDate(n.getUTCDate()+t),n}function cd({data:e,endDate:t,startDate:n,colors:o,cellSize:r=11,gap:i=3,showMonthLabels:a=!0,showWeekdayLabels:l=!0,onCellClick:s,formatTooltip:d,ariaLabel:c,className:u,style:h}){const p=M(),[f,m]=Ve(null),{end:g,start:x,weeks:b,valuesByDate:y,max:v,total:w}=je(()=>{const o=t?sd(t):/* @__PURE__ */new Date,r=new Date(o);r.setUTCHours(0,0,0,0);const i=n?sd(n):dd(r,-365),a=/* @__PURE__ */new Map;let l=0,s=0;for(const t of e){const e=ld(sd(t.date)),n=(a.get(e)??0)+t.value;a.set(e,n),l+=t.value,n>s&&(s=n)}const d=[];let c=function(e){const t=new Date(e);return t.setUTCHours(0,0,0,0),t.setUTCDate(t.getUTCDate()-t.getUTCDay()),t}(i);for(;c<=r;){const e=[];for(let t=0;t<7;t++)e.push(dd(c,t));d.push(e),c=dd(c,7)}return{end:r,start:i,weeks:d,valuesByDate:a,max:s,total:l}},[e,n,t]),k=je(()=>{if(o)return o;const e=p.primary;return[p.surface,`${e}33`,`${e}66`,`${e}AA`,e]},[o,p.primary,p.surface]),S=Ae(d??(e=>{const t=sd(e.date).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric",year:"numeric"});return e.value>0?`${e.value} on ${t}`:`No activity on ${t}`}),[d]),C=je(()=>{const e=[];let t=-1;return b.forEach((n,o)=>{const r=n[0].getUTCMonth();r!==t&&(e.push({week:o,label:id[r]}),t=r)}),e},[b]),$=c??`Activity heatmap from ${ld(x)} to ${ld(g)}. ${w} total events.`;/* @__PURE__ */
565
+ return Ye("div",{className:u,style:{display:"inline-block",position:"relative",color:p.text,...h},role:"img","aria-label":$,children:[a&&/* @__PURE__ */Ye("div",{"aria-hidden":"true",style:{display:"grid",gridTemplateColumns:`${l?"24px ":""}repeat(${b.length}, ${r+i}px)`,marginBottom:4,fontSize:10,color:p.textMuted,position:"relative",height:14},children:[l&&/* @__PURE__ */Ke("div",{}),b.map((e,t)=>{const n=C.find(e=>e.week===t);/* @__PURE__ */
566
+ return Ke("div",{style:{position:"relative",overflow:"visible"},children:n&&/* @__PURE__ */Ke("span",{style:{position:"absolute",top:0,left:0,whiteSpace:"nowrap",fontWeight:600},children:n.label})},t)})]}),
567
+ /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"flex-start"},children:[l&&/* @__PURE__ */Ke("div",{"aria-hidden":"true",style:{display:"grid",gridTemplateRows:`repeat(7, ${r}px)`,rowGap:i,marginRight:4,fontSize:9,color:p.textMuted},children:ad.map((e,t)=>/* @__PURE__ */Ke("div",{style:{height:r,lineHeight:`${r}px`,visibility:t%2==1?"visible":"hidden"},children:e},e))}),/* @__PURE__ */Ke("div",{role:"grid",style:{display:"grid",gridTemplateColumns:`repeat(${b.length}, ${r}px)`,columnGap:i},children:b.map((e,t)=>/* @__PURE__ */Ke("div",{role:"row",style:{display:"grid",gridTemplateRows:`repeat(7, ${r}px)`,rowGap:i},children:e.map((e,n)=>{if(e<x||e>g)/* @__PURE__ */return Ke("div",{"aria-hidden":"true"},n);const o=ld(e),i=y.get(o)??0,a=function(e,t,n){if(e<=0)return n[0];if(t<=0)return n[0];const o=e/t;return o>.75?n[4]:o>.5?n[3]:o>.25?n[2]:n[1]}(i,v,k),l=S({date:o,value:i});/* @__PURE__ */
568
+ return Ke("div",{role:"gridcell",tabIndex:0===n&&0===t?0:-1,"data-cell":`${t}-${n}`,"aria-label":l,onClick:()=>s?.({date:o,value:i}),onKeyDown:e=>{"Enter"===e.key||" "===e.key?(e.preventDefault(),s?.({date:o,value:i})):((e,t,n)=>{let o=null;const r=e.currentTarget.parentElement?.parentElement;function i(e,t){return r.querySelector(`[data-cell="${e}-${t}"]`)}r&&("ArrowRight"===e.key?o=i(t+1,n):"ArrowLeft"===e.key?o=i(t-1,n):"ArrowDown"===e.key?o=i(t,n+1):"ArrowUp"===e.key&&(o=i(t,n-1)),o&&(e.preventDefault(),o.focus()))})(e,t,n)},onMouseEnter:e=>{const t=e.target.getBoundingClientRect(),n=e.currentTarget.closest('[role="img"]')?.getBoundingClientRect();m({date:o,value:i,x:t.left-(n?.left??0)+t.width/2,y:t.top-(n?.top??0)})},onMouseLeave:()=>m(null),onFocus:e=>{const t=e.target.getBoundingClientRect(),n=e.currentTarget.closest('[role="img"]')?.getBoundingClientRect();m({date:o,value:i,x:t.left-(n?.left??0)+t.width/2,y:t.top-(n?.top??0)})},onBlur:()=>m(null),style:{width:r,height:r,background:a,borderRadius:2,cursor:s?"pointer":"default",border:`1px solid ${p.border}33`,outline:"none"}},n)})},t))})]}),
569
+ /* @__PURE__ */Ye("div",{"aria-hidden":"true",style:{marginTop:8,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:6,fontSize:10,color:p.textMuted},children:[
570
+ /* @__PURE__ */Ke("span",{children:"Less"}),k.map((e,t)=>/* @__PURE__ */Ke("span",{style:{width:r,height:r,background:e,borderRadius:2,border:`1px solid ${p.border}33`}},t)),
571
+ /* @__PURE__ */Ke("span",{children:"More"})]}),f&&/* @__PURE__ */Ke("div",{role:"tooltip",style:{position:"absolute",left:f.x,top:f.y-8,transform:"translate(-50%, -100%)",padding:"4px 10px",background:p.surface,border:`1px solid ${p.border}`,borderRadius:6,fontSize:11,color:p.text,pointerEvents:"none",whiteSpace:"nowrap",zIndex:10,boxShadow:"0 4px 12px rgba(0,0,0,0.3)"},children:S({date:f.date,value:f.value})})]})}export{Za as COUNTRIES,ls as FocusTrap,ye as I18nContext,rs as I18nProvider,d as LRUCache,as as LiveRegion,r as Quantum,Vi as SIZE_BORDER_RADIUS,ji as SIZE_FONT,Fi as SIZE_HEIGHT,Ui as SIZE_ICON,Pi as SIZE_PADDING_X,Oi as SIZE_PADDING_Y,se as SecurityCore,X as Shield,is as SkipNav,h as TKX,R as ThemeContext,$ as ThemeProvider,xs as TkxAIChatBubble,ms as TkxAIConfidenceBar,Ss as TkxAIThinking,El as TkxAadhaarInput,cn as TkxAccordion,ml as TkxAddressInput,Ia as TkxAffix,mt as TkxAlert,La as TkxAnchor,Er as TkxAppBar,wr as TkxAutocomplete,Lt as TkxAvatar,st as TkxBadge,Jl as TkxBillingCycleToggle,Fr as TkxBottomNav,xr as TkxBreadcrumb,Qe as TkxButton,cd as TkxCalendarHeatmap,Rl as TkxCalendarLunar,Va as TkxCaptcha,tt as TkxCard,ot as TkxCardBody,rt as TkxCardFooter,nt as TkxCardHeader,fr as TkxCarousel,Aa as TkxCascader,oo as TkxChat,no as TkxChatBubble,Ot as TkxCheckbox,Tl as TkxCheckout,Io as TkxClock,Li as TkxCol,Zo as TkxColorPicker,hr as TkxCommand,vl as TkxConfetti,Ai as TkxConfigProvider,zi as TkxContent,ga as TkxCountdown,xl as TkxCurrencyInput,Zr as TkxDataGrid,Mn as TkxDatePicker,Bt as TkxDivider,mn as TkxDrawer,Xl as TkxDrivingLicenceInput,ps as TkxDropdown,ua as TkxEmpty,Vn as TkxFileUpload,Ga as TkxFontProvider,Mi as TkxFooter,Ne as TkxForm,Me as TkxFormField,Si as TkxHeader,Is as TkxHolographicAvatar,Ds as TkxHolographicBadge,Ls as TkxHolographicButton,Ns as TkxHolographicCard,Ms as TkxHolographicSurface,Fn as TkxImage,al as TkxImageEditor,it as TkxInput,Ws as TkxKanban,ki as TkxLayout,Ha as TkxList,bi as TkxMarkdown,ei as TkxMasonry,ya as TkxMentions,Co as TkxMenu,yt as TkxModal,or as TkxNumberInput,lr as TkxOTP,ts as TkxOrgChart,An as TkxPagination,jl as TkxPanInput,oa as TkxParagraph,ul as TkxPaymentButton,ol as TkxPhoneInput,Gl as TkxPlanSelector,br as TkxPopover,ut as TkxProgress,_l as TkxProrationPreview,wa as TkxQRCode,Kt as TkxRadio,Yt as TkxRadioGroup,_n as TkxRating,Sa as TkxResult,Us as TkxRichEditor,ri as TkxRichTextDisplay,Ri as TkxRow,Cl as TkxSEO,ba as TkxSegmented,jt as TkxSelect,$i as TkxSider,hl as TkxSignaturePad,Rt as TkxSkeleton,Ln as TkxSlider,Vr as TkxSnackbar,bl as TkxSortable,Ar as TkxSpeedDial,sa as TkxSpin,ma as TkxStatistic,Po as TkxStepper,Ct as TkxTab,St as TkxTabList,zt as TkxTabPanel,$t as TkxTabPanels,At as TkxTable,kt as TkxTabs,so as TkxTag,co as TkxTagInput,na as TkxText,Js as TkxThemeStudio,to as TkxThinkingIndicator,go as TkxTimeline,ta as TkxTitle,an as TkxToastProvider,pt as TkxToggle,zr as TkxToolbar,Nt as TkxTooltip,Ca as TkxTour,Dr as TkxTransferList,Cr as TkxTreeView,Ao as TkxVideoPlayer,Vl as TkxVoterIdInput,Ma as TkxWatermark,ss as VisuallyHidden,y as WCAGEngine,q as audit,N as auroraLight,i as batchUpdate,v as breakpoints,re as buildTkxCSP,b as contrastRatio,D as createFocusTrap,te as createRateLimiter,p as createTheme,o as css,n as cssVar,le as cx,J as deepFreeze,ne as extractAtomicCSS,s as extractCSS,a as fnv1aHash,k as fromObject,z as generatePalette,A as getAccessibleForeground,G as getAuditLog,Ji as getLocaleDisplayName,e as injectStyles,V as installFrameBuster,de as installTrustedTypes,he as isFramed,ke as isRTL,Gi as isRtlLocale,K as isSafeAttrName,Wl as isValidAadhaar,Kl as isValidDrivingLicence,Fl as isValidPan,Ol as isValidVoterId,w as keyframes,Ja as loadFontScript,W as meetsAA,u as meetsAAA,c as memoize,t as prefersHighContrast,L as prefersReducedMotion,I as quantumDark,m as radii,ie as resetAtomicCSS,_ as resolvePluginUtility,l as responsive,ue as sanitizeCSS,P as sanitizeHTML,E as sanitizeHref,ce as sanitizeJSON,O as sanitizeProps,F as sanitizeString,H as sanitizeUnicode,qa as scriptsForLanguage,j as scrubPII,$l as seoSchema,S as shadows,Q as sniffMimeType,T as spacing,U as tkx,oe as tkxListPlugins,ae as tkxPlugin,Y as tkxRemovePlugin,ee as tx,g as typography,_a as unloadFontScript,be as useAnnounce,me as useClickOutside,Hi as useComponentSize,Bi as useConfig,za as useDevtoolsOpen,Se as useDirection,xe as useEscapeKey,fe as useFocusTrap,pe as useHighContrast,Ce as useI18n,$e as useLocale,Yi as useLogicalSpacing,x as usePrefersColorScheme,Ei as usePrefixCls,ge as useReducedMotion,Ki as useRtlFlip,M as useTheme,sr as useTkxCommand,ze as useTkxForm,en as useToast,B as validateProps,Z as verifyAuditIntegrity,C as zIndex};